diff options
| author | Borislav Petkov <bp@suse.de> | 2018-09-27 18:36:24 +0200 |
|---|---|---|
| committer | Borislav Petkov <bp@suse.de> | 2018-09-27 18:36:24 +0200 |
| commit | d913e8966a8f4b259dd6f11f0c334d865cf9d3aa (patch) | |
| tree | 0b354028600f61001317426da875edc50685d36d /drivers/usb/storage/uas.c | |
| parent | 6b58859419554fb824e09cfdd73151a195473cbc (diff) | |
| parent | c9661c1e80b609cd038db7c908e061f0535804ef (diff) | |
Merge branch 'tip-x86-hygon' into edac-for-4.20
... to pick up a dependent commit and share it with the tip tree, branch
tip:x86/cpu.
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/usb/storage/uas.c')
| -rw-r--r-- | drivers/usb/storage/uas.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 9e9de5452860..1f7b401c4d04 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -842,6 +842,27 @@ static int uas_slave_configure(struct scsi_device *sdev) sdev->skip_ms_page_8 = 1; sdev->wce_default_on = 1; } + + /* + * Some disks return the total number of blocks in response + * to READ CAPACITY rather than the highest block number. + * If this device makes that mistake, tell the sd driver. + */ + if (devinfo->flags & US_FL_FIX_CAPACITY) + sdev->fix_capacity = 1; + + /* + * Some devices don't like MODE SENSE with page=0x3f, + * which is the command used for checking if a device + * is write-protected. Now that we tell the sd driver + * to do a 192-byte transfer with this command the + * majority of devices work fine, but a few still can't + * handle it. The sd driver will simply assume those + * devices are write-enabled. + */ + if (devinfo->flags & US_FL_NO_WP_DETECT) + sdev->skip_ms_page_3f = 1; + scsi_change_queue_depth(sdev, devinfo->qdepth - 2); return 0; } |
