Patrick Mansfield wrote: > On Thu, May 19, 2005 at 04:38:27PM +0200, Hannes Reinecke wrote: >>Hi James, >> >>this is an updated version of the patch. As I suspected, the issue isn't >>quite as easy. Problem is that older SCSI-2 device have the habit for >>responding to LUN1 in addition to LUN0, even though only one device is >>attached. LUN1 has set PQ to 3 accordingly. >>And of course we _don't_ want those fake devices to stick around. >>So I've improved the logic to not register devices with LUN != 0 and a >>PQ of 1 or 3. All other devices are registered accordingly. >> >>I can't really see why we should register devices with PQ 1 and LUN != >>0; if one wants to have them he still can do a REPORT LUN on LUN 0 and >>an explicit scan for the missing device. >> >>And I do think the locking is slightly wrong for the failure case; >>without this adaptecs have a habit of crashing when doing a rmmod. > > Is that what the extra put's are fixing? That should be a separate patch. > Hm. Yes, probably. [ .. ] > I don't have a strong opinion for either direction, but having LUN 0 with > and sometimes without an sd there bothers me. Pick your poison ... > I don't really have a problem with having sd attached to LUN 0 sometimes. We're doing only what the SCSI device tells us ... > Long term, a way to access any LUN on a target from user space would be > very useful, not just LUN 0. > That's what I thought also; only some dastardly SCSI-2 drives respond to LUN 0 and LUN 1 (actually all SCSI-2 device which I have connected here; wonder whether this is again some 'interesting' specification interpretation). So it's doubtful whether this a possible way to go. Or maybe return all LUNs for SCSI-3 and higher? [ .. ] > I prefer naming with all LUN in all the defines since we are returning LUN > status, or leave as is. For SCSI_SCAN_TARGET_IGNORED, we are not > configuring the LUN. > > i.e. keep the original: > > #define SCSI_SCAN_NO_RESPONSE 0 > #define SCSI_SCAN_TARGET_PRESENT 1 > #define SCSI_SCAN_LUN_PRESENT 2 > > Or: > > #define SCSI_SCAN_NO_RESPONSE 0 > #define SCSI_SCAN_LUN_IGNORED 1 > #define SCSI_SCAN_LUN_PRESENT 2 > > Yes, this makes more sense. Still think having SCSI_SCAN_LUN_IGNORED instead of SCSI_SCAN_TARGET_PRESENT is more sensible as the meaning of those flags changed slightly (flags indicate now the device state in scsi-ml, not the state according to the SCSI-bus). > You should add code to not print the "unknown device type" if PQ 3 or 1, > or special case type 31 (0x1f). > > SCSI spec says for PQ of 011 (3): > > The device server is not capable of supporting a peripheral device > on this logical unit. For this peripheral qualifier the > peripheral device type shall be set to 1Fh to provide > compatibility with previous versions of SCSI. > Agreed. Fixed patch attached. Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de