Hi, Alan Stern wrote: >> Since most PL-3507 enclosures are probably user-upgradable and the most >> recent >> firmware doesn't have the off-by-one bug, it might be better to not >> include >> that UNUSUAL_DEV entry. Otherwise, e.g. using dd to create an image file >> of the >> disk omits the last sector. > > How is the kernel supposed to tell whether or not an enclosure is > running the latest firmware? We don't want drives that haven't been > updated yet to suddenly stop working right. That's a good question. There may not be anything in the lsusb output (see below) to indicate the firmware version. It is definitely possible to determine the version though; the Prolific flashing program does that. I haven't looked at its code to see exactly how it talks to the enclosure. There is a changelog In the firmware archive on the Prolific web site but none of the entries explicitly states when the off-by-one error was fixed. What is the typical failure mode if a device with off-by-one capacity bug is connected? I'm assuming the kernel tries to read (what it thinks is) the last sector, which fails. Does the kernel then refuse to access the device at all? Or is the issue that the device itself crashes/hangs on receiving a READ command for a too-large LBA? At least with my enclosure (with the most recent firmware), attempting a read beyond the end of the disk returns an error as it should, and the enclosure doesn't appear to lock up on receiving that command. Of course the behaviour of earlier firmware versions may differ. The disk in the enclosure has 39102336 512-byte sectors, so the last LBA is 39102335. Try reading the last block: # sg_read blk_sgio=1 bpt=1 bs=512 cdbsz=10 count=1 if=/dev/sg2 skip=39102335 verbose=3 Opened /dev/sg2 for SG_IO with flags=0x2 SG_GET_RESERVED_SIZE yields: 32768 read cdb: 28 00 02 54 a7 7f 00 00 01 00 duration=0 ms 1+0 records in, SCSI READ commands issued: 1 Try reading the block *after* the last one, which should fail: # sg_read blk_sgio=1 bpt=1 bs=512 cdbsz=10 count=1 if=/dev/sg2 skip=39102336 verbose=3 Opened /dev/sg2 for SG_IO with flags=0x2 SG_GET_RESERVED_SIZE yields: 32768 read cdb: 28 00 02 54 a7 80 00 00 01 00 duration=144 ms reading: Host_status=0x07 [DID_ERROR] plus...: Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK] Fixed format, current; Sense key: Hardware Error Additional sense: No additional sense information Raw sense data (in hex): 70 00 04 00 00 00 00 0a 00 00 00 00 00 00 00 00 00 00 sg_read: SCSI READ medium/hardware error Some error occurred, remaining block count=1 0+0 records in > Can you provide the output from "lsusb -v" for the new firmware? $ sudo lsusb -v -d 067b:3507 Bus 002 Device 004: ID 067b:3507 Prolific Technology, Inc. PL3507 ATAPI6 Bridge Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x067b Prolific Technology, Inc. idProduct 0x3507 PL3507 ATAPI6 Bridge bcdDevice 0.01 iManufacturer 1 Prolific Technology Inc. iProduct 2 ATAPI-6 Bridge Controller iSerial 3 1 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 2mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk (Zip) iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 0 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0001 Self Powered -- Mark -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html