diff options
Diffstat (limited to 'drivers/usb/storage')
| -rw-r--r-- | drivers/usb/storage/sddr55.c | 2 | ||||
| -rw-r--r-- | drivers/usb/storage/uas.c | 16 | ||||
| -rw-r--r-- | drivers/usb/storage/unusual_devs.h | 2 | ||||
| -rw-r--r-- | drivers/usb/storage/unusual_uas.h | 14 | 
4 files changed, 29 insertions, 5 deletions
| diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index c8a988d2cfdd..15dc25801cdc 100644 --- a/drivers/usb/storage/sddr55.c +++ b/drivers/usb/storage/sddr55.c @@ -592,7 +592,7 @@ static unsigned long sddr55_get_capacity(struct us_data *us) {  	case 0x64:  		info->pageshift = 8;  		info->smallpageshift = 1; -		/* fall through */ +		fallthrough;  	case 0x5d: // 5d is a ROM card with pagesize 512.  		return 0x00200000; diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index d592071119ba..8183504e3abb 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -662,8 +662,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,  	if (devinfo->resetting) {  		cmnd->result = DID_ERROR << 16;  		cmnd->scsi_done(cmnd); -		spin_unlock_irqrestore(&devinfo->lock, flags); -		return 0; +		goto zombie;  	}  	/* Find a free uas-tag */ @@ -688,7 +687,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,  		break;  	case DMA_BIDIRECTIONAL:  		cmdinfo->state |= ALLOC_DATA_IN_URB | SUBMIT_DATA_IN_URB; -		/* fall through */ +		fallthrough;  	case DMA_TO_DEVICE:  		cmdinfo->state |= ALLOC_DATA_OUT_URB | SUBMIT_DATA_OUT_URB;  	case DMA_NONE: @@ -699,6 +698,16 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,  		cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB);  	err = uas_submit_urbs(cmnd, devinfo); +	/* +	 * in case of fatal errors the SCSI layer is peculiar +	 * a command that has finished is a success for the purpose +	 * of queueing, no matter how fatal the error +	 */ +	if (err == -ENODEV) { +		cmnd->result = DID_ERROR << 16; +		cmnd->scsi_done(cmnd); +		goto zombie; +	}  	if (err) {  		/* If we did nothing, give up now */  		if (cmdinfo->state & SUBMIT_STATUS_URB) { @@ -709,6 +718,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,  	}  	devinfo->cmnd[idx] = cmnd; +zombie:  	spin_unlock_irqrestore(&devinfo->lock, flags);  	return 0;  } diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 220ae2c356ee..5732e9691f08 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -2328,7 +2328,7 @@ UNUSUAL_DEV(  0x357d, 0x7788, 0x0114, 0x0114,  		"JMicron",  		"USB to ATA/ATAPI Bridge",  		USB_SC_DEVICE, USB_PR_DEVICE, NULL, -		US_FL_BROKEN_FUA ), +		US_FL_BROKEN_FUA | US_FL_IGNORE_UAS ),  /* Reported by Andrey Rahmatullin <[email protected]> */  UNUSUAL_DEV(  0x4102, 0x1020, 0x0100,  0x0100, diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h index 162b09d69f62..711ab240058c 100644 --- a/drivers/usb/storage/unusual_uas.h +++ b/drivers/usb/storage/unusual_uas.h @@ -28,6 +28,13 @@   * and don't forget to CC: the USB development list <[email protected]>   */ +/* Reported-by: Till Dörges <[email protected]> */ +UNUSUAL_DEV(0x054c, 0x087d, 0x0000, 0x9999, +		"Sony", +		"PSZ-HA*", +		USB_SC_DEVICE, USB_PR_DEVICE, NULL, +		US_FL_NO_REPORT_OPCODES), +  /* Reported-by: Julian Groß <[email protected]> */  UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,  		"LaCie", @@ -80,6 +87,13 @@ UNUSUAL_DEV(0x152d, 0x0578, 0x0000, 0x9999,  		USB_SC_DEVICE, USB_PR_DEVICE, NULL,  		US_FL_BROKEN_FUA), +/* Reported-by: Thinh Nguyen <[email protected]> */ +UNUSUAL_DEV(0x154b, 0xf00d, 0x0000, 0x9999, +		"PNY", +		"Pro Elite SSD", +		USB_SC_DEVICE, USB_PR_DEVICE, NULL, +		US_FL_NO_ATA_1X), +  /* Reported-by: Hans de Goede <[email protected]> */  UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,  		"VIA", |