summaryrefslogtreecommitdiff
path: root/drivers/hotplug
diff options
context:
space:
mode:
authorAndries E. Brouwer <andries.brouwer@cwi.nl>2002-09-03 05:41:25 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-03 05:41:25 -0700
commite91004e8307c60647c4598e2bdc15ea1c7a94ea7 (patch)
tree026f5eef3311b779b2151cb683a87aa50c778429 /drivers/hotplug
parent27254059c0a4af49dc40639861e06841d65464d0 (diff)
[PATCH] try more sd.c MODE SENSE modes
In sd.c we call MODE SENSE (6) in order to find out whether the device is write protected. The info we need is in byte 2, the header of the MODE SENSE answer, but in the request we have to specify (i) what page(s) we want, and (ii) how many bytes we want. Long ago we asked for 12 bytes from page 1 (Daniel Roche, 1.3.35). Matthew Dharm made this 8 bytes from page 3F (all pages), patch-2.4.0-test8. In patch-2.4.10 the 8 was increased to 255. I found on the one hand devices that only react to page 0 (the vendor page), and return an error for page 3F. And on the other hand devices that are unable to handle requests for more bytes than they actually have. So, it seems that the cautious way to ask for MODE SENSE data is to first ask for the header only, see how much is available, and then ask for everything. The patch below first separates out the MODE SENSE call, and then tries it three times: on all pages (3F), only the first four bytes; on the vendor page (0), only the first four bytes; on all pages (3F), 255 bytes. This should be at least as robust as our current code. I tried it on 8 SCSI devices (of which 2 fail under 2.5.33) and found no problems.
Diffstat (limited to 'drivers/hotplug')
0 files changed, 0 insertions, 0 deletions