Skip to contentSkip to conversation

ieee1394: sbp2: switch flavor of MODE SENSE

PATCH New Stefan Richter 1 participant 3 messages Sep 7, 2006

lore
Share & tools
lore
#0 lore raw

cover ieee1394: sbp2: switch flavor of MODE SENSE

It became apparent lately that MODE SENSE (6) is more palatable to some SBP-2 devices and is more popular among other OSs than MODE SENSE (10). The RBC spec disagrees with sbp2 too.

- ieee1394: sbp2: don't prefer MODE SENSE 10
(supercedes recent workaround for write protect bit of Initio firmware)
- ieee1394: sbp2: enable auto spin-up for all SBP-2 devices (old patch, reposted in refreshed form to be reapplied smoothly without the Initio workaround underneath)

Signature · 3 lines
Stefan Richter
-=====-=-==- =--= -=---
http://arcgraph.de/sr/
#1 lore raw

PATCH 1/2 ieee1394: sbp2: don't prefer MODE SENSE 10

In the old days, sbp2 used to coerce all MODE SENSE commands into the 10 bytes version. When all command set conversions were removed from sbp2 several months ago, sdev->use_10_for_ms = 1 was added. Meaning, higher SCSI layers preferred the 10 bytes version but would try the 6 bytes version if the former failed.

Recently, a problem with the 10 bytes version was discovered. An Initio INIC-1530 firmware accepted the 10 bytes version but replied with bogus data, showing the HDD incorrectly as write-protected. Since RBC actually mandates MODE SENSE (6), I checked which version was sent by Windows XP and Mac OS X 10.3 to an SBP-2 target hosted by Linux --- it was the 6 bytes version. (Exception: OS X sent the 10 bytes version to an MMC target. RBC and SBC got MODE SENSE (6).)

Therefore, drop the use_10_for_ms flag from sbp2. Now the upper layers will try MODE SENSE (6) before MODE SENSE (10) on all SBP-2 devices.

---
Long story, short patch. This supercedes patch "ieee1394: sbp2:
workaround for write protect bit of Initio firmware".

drivers/ieee1394/sbp2.c +0 -1
Index: linux/drivers/ieee1394/sbp2.c
===================================================================
@@ -2529,7 +2529,6 @@ static int sbp2scsi_slave_configure(stru
 
 	blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
 	sdev->use_10_for_rw = 1;
-	sdev->use_10_for_ms = 1;
 
 	if (sdev->type == TYPE_DISK &&
 	    scsi_id->workarounds & SBP2_WORKAROUND_MODE_SENSE_8)
#2 lore raw

PATCH 2/2 ieee1394: sbp2: enable auto spin-up for all SBP-2 devices

In reply to Stefan Richter

This is a follow-up to patch "ieee1394: sbp2: enable auto spin-up for Maxtor disks". When I 'ejected' an OXUF922 based HDD from a Mac OS X box, it was spun down by the Mac and did not spin up by itself when attached to a Linux box right after that. The first SCSI command that required the bridge to access the drive ended in
sda:<6>sd 18:0:0:0: Device not ready: <6>: Current: sense key: Not Ready
Additional sense: Logical unit not ready, initializing cmd. required

Therefore the flag which instructs scsi_mod to send START STOP UNIT with START=1 ("make medium ready") after such a condition is now enabled unconditionally for all FireWire storage devices.

---
Patch updated (refreshed) to be applicable without the obsolete patch "ieee1394: sbp2: workaround for write protect bit of Initio firmware".

Intendend to be dropped into the same place in -mm's order of patches as before. It's not hard to resolve it manually though.

drivers/ieee1394/sbp2.c +1 -3
Index: linux/drivers/ieee1394/sbp2.c
===================================================================
@@ -2441,6 +2441,7 @@ static int sbp2scsi_slave_alloc(struct s
 		(struct scsi_id_instance_data *)sdev->host->hostdata[0];
 
 	scsi_id->sdev = sdev;
+	sdev->allow_restart = 1;
 
 	if (scsi_id->workarounds & SBP2_WORKAROUND_INQUIRY_36)
 		sdev->inquiry_len = 36;
@@ -2461,9 +2462,6 @@ static int sbp2scsi_slave_configure(stru
 		sdev->skip_ms_page_8 = 1;
 	if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY)
 		sdev->fix_capacity = 1;
-	if (scsi_id->ne->guid_vendor_id == 0x0010b9 && /* Maxtor's OUI */
-	    (sdev->type == TYPE_DISK || sdev->type == TYPE_RBC))
-		sdev->allow_restart = 1;
 	return 0;
 }