On Tue, Nov 18, 2003 at 10:20:17AM -0500, Alan Stern wrote:

> Alignment to a 512-byte boundary would suffice and page alignment would be
> more than enough.  The cleanest way to fix the problem would be to have st
> and sg refuse to do direct I/O when the user's buffer isn't page aligned.  
> That's probably too draconian (but it would allow us to give the user
> process an appropriate error code right away).

The above restriction sounds reasonable to me, but I do not have
experience in this area. I thought that the raw and direct block
interfaces already had such restrictions.

Jens or Doug G can you comment on this?

You could add a scsi_host fields or bits specifying alignment
restrictions, and enforce them as needed in upper level drivers.

> So instead I'm going to change the usb-storage driver to make it reject
> any s-g transfer that doesn't meet the entry length requirements.  My
> question is this: What's the best way to inform the SCSI midlayer about
> what went wrong?  Return a DID_ABORT code?  Or would something else be
> better?
> 
> Alan Stern

Assuming a printk is OK, DID_ABORT is OK.

If there is an existing appropriate sense code, you could generate that
and pass it back. I searched the SPC3 spec and did not find any that have
"align" but there are some with "invalid" that might be OK, though you
might not be able to tell for certain if the sense was from the device or
not, it is less vague than a DID_ABORT.

-- Patrick Mansfield


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to