* RE: Question: where should the SCSI driver place MODE_SENSE data ?
@ 2006-03-21 22:43 Ju, Seokmann
0 siblings, 0 replies; 5+ messages in thread
From: Ju, Seokmann @ 2006-03-21 22:43 UTC (permalink / raw)
To: Ju, Seokmann, James Bottomley; +Cc: linux-scsi, linux-kernel
Any comment on this question would be appreciated.
Thanks you,
> -----Original Message-----
> From: Ju, Seokmann
> Sent: Tuesday, March 21, 2006 11:45 AM
> To: 'James Bottomley'
> Cc: linux-scsi; linux-kernel
> Subject: Question: where should the SCSI driver place
> MODE_SENSE data ?
>
> In the 2.6 (2.6.9 and scsi-misc in git) kernel, MODE_SENSE
> SCSI command packet (scsi_cmnd) carries following entries
> with unexpectedly small in size.
> - request_bufflen
> - bufflen
>
> Especially for MODE SENSE with page code 8 (caching page),
> driver has minumum 12 Bytes MODE_SENSE data to deliver
> besides 'mode parameter header' and 'block descriptors'.
> When I dump those entries, they both are 4 Bytes in size.
> To me, it seems like that SCSI mid layer allocated 512 Bytes
> for MODE_SENSE data buffer, but the buffer length passed down
> to LLD incorrectly.
>
> Please guide me if there is anything missing.
>
> Thank you,
>
> Seokmann
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Question: where should the SCSI driver place MODE_SENSE data ?
2006-03-22 15:52 Ju, Seokmann
@ 2006-03-22 16:14 ` James Bottomley
0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2006-03-22 16:14 UTC (permalink / raw)
To: Ju, Seokmann; +Cc: linux-scsi, linux-kernel
On Wed, 2006-03-22 at 08:52 -0700, Ju, Seokmann wrote:
> On Tuesday, March 21, 2006 6:02 PM, James Bottomley wrote:
> > I don't understand the question. Are you asking why
> > sd_read_write_protect_flag and sd_read_cache_type operate in the way
> > they do? i.e. header first then actual data.
> For any SCSI command including MODE_SENSE, 'bufflen'in scsi_cmnd structure holds actual data buffer size in bytes if 'use_sg' flage is NOT set.
> The question is that "value of bufflen is 4 for the sd_read_cache_type operation and that is NOT sufficient to return header and page data by driver".
> If there is something that I misunderstood with the operation, please guide.
If you look at the functions in sd.c you'll see it goes about asking for
mode sense very carefully, because there are a lot of broken devices out
there. The first request is only for enough of the headers to work out
the length of the page.
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Question: where should the SCSI driver place MODE_SENSE data ?
@ 2006-03-22 15:52 Ju, Seokmann
2006-03-22 16:14 ` James Bottomley
0 siblings, 1 reply; 5+ messages in thread
From: Ju, Seokmann @ 2006-03-22 15:52 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, linux-kernel
On Tuesday, March 21, 2006 6:02 PM, James Bottomley wrote:
> I don't understand the question. Are you asking why
> sd_read_write_protect_flag and sd_read_cache_type operate in the way
> they do? i.e. header first then actual data.
For any SCSI command including MODE_SENSE, 'bufflen'in scsi_cmnd structure holds actual data buffer size in bytes if 'use_sg' flage is NOT set.
The question is that "value of bufflen is 4 for the sd_read_cache_type operation and that is NOT sufficient to return header and page data by driver".
If there is something that I misunderstood with the operation, please guide.
> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
> Sent: Tuesday, March 21, 2006 6:02 PM
> To: Ju, Seokmann
> Cc: linux-scsi; linux-kernel
> Subject: Re: Question: where should the SCSI driver place
> MODE_SENSE data ?
>
> On Tue, 2006-03-21 at 09:44 -0700, Ju, Seokmann wrote:
> > In the 2.6 (2.6.9 and scsi-misc in git) kernel, MODE_SENSE
> SCSI command
> > packet (scsi_cmnd) carries following entries with
> unexpectedly small in
> > size.
> > - request_bufflen
> > - bufflen
> >
> > Especially for MODE SENSE with page code 8 (caching page),
> driver has
> > minumum 12 Bytes MODE_SENSE data to deliver besides 'mode parameter
> > header' and 'block descriptors'.
> > When I dump those entries, they both are 4 Bytes in size.
> > To me, it seems like that SCSI mid layer allocated 512 Bytes for
> > MODE_SENSE data buffer, but the buffer length passed down to LLD
> > incorrectly.
>
> I don't understand the question. Are you asking why
> sd_read_write_protect_flag and sd_read_cache_type operate in the way
> they do? i.e. header first then actual data.
>
> James
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Question: where should the SCSI driver place MODE_SENSE data ?
2006-03-21 16:44 Ju, Seokmann
@ 2006-03-21 23:01 ` James Bottomley
0 siblings, 0 replies; 5+ messages in thread
From: James Bottomley @ 2006-03-21 23:01 UTC (permalink / raw)
To: Ju, Seokmann; +Cc: linux-scsi, linux-kernel
On Tue, 2006-03-21 at 09:44 -0700, Ju, Seokmann wrote:
> In the 2.6 (2.6.9 and scsi-misc in git) kernel, MODE_SENSE SCSI command
> packet (scsi_cmnd) carries following entries with unexpectedly small in
> size.
> - request_bufflen
> - bufflen
>
> Especially for MODE SENSE with page code 8 (caching page), driver has
> minumum 12 Bytes MODE_SENSE data to deliver besides 'mode parameter
> header' and 'block descriptors'.
> When I dump those entries, they both are 4 Bytes in size.
> To me, it seems like that SCSI mid layer allocated 512 Bytes for
> MODE_SENSE data buffer, but the buffer length passed down to LLD
> incorrectly.
I don't understand the question. Are you asking why
sd_read_write_protect_flag and sd_read_cache_type operate in the way
they do? i.e. header first then actual data.
James
^ permalink raw reply [flat|nested] 5+ messages in thread
* Question: where should the SCSI driver place MODE_SENSE data ?
@ 2006-03-21 16:44 Ju, Seokmann
2006-03-21 23:01 ` James Bottomley
0 siblings, 1 reply; 5+ messages in thread
From: Ju, Seokmann @ 2006-03-21 16:44 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, linux-kernel
In the 2.6 (2.6.9 and scsi-misc in git) kernel, MODE_SENSE SCSI command
packet (scsi_cmnd) carries following entries with unexpectedly small in
size.
- request_bufflen
- bufflen
Especially for MODE SENSE with page code 8 (caching page), driver has
minumum 12 Bytes MODE_SENSE data to deliver besides 'mode parameter
header' and 'block descriptors'.
When I dump those entries, they both are 4 Bytes in size.
To me, it seems like that SCSI mid layer allocated 512 Bytes for
MODE_SENSE data buffer, but the buffer length passed down to LLD
incorrectly.
Please guide me if there is anything missing.
Thank you,
Seokmann
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-22 16:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-21 22:43 Question: where should the SCSI driver place MODE_SENSE data ? Ju, Seokmann
-- strict thread matches above, loose matches on Subject: below --
2006-03-22 15:52 Ju, Seokmann
2006-03-22 16:14 ` James Bottomley
2006-03-21 16:44 Ju, Seokmann
2006-03-21 23:01 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).