mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
scsi: fix the type for well known LUs
Some devices may respond with wrong type for well-known logical units. This patch forces well-known type for devices which doesn't report it correct. Signed-off-by: Subhash Jadavani <[email protected]> Signed-off-by: Sujit Reddy Thumma <[email protected]> Signed-off-by: Dolev Raviv <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
db525fce95
commit
45341ca3fc
2 changed files with 14 additions and 0 deletions
|
|
@ -815,6 +815,19 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
|
|||
} else {
|
||||
sdev->type = (inq_result[0] & 0x1f);
|
||||
sdev->removable = (inq_result[1] & 0x80) >> 7;
|
||||
|
||||
/*
|
||||
* some devices may respond with wrong type for
|
||||
* well-known logical units. Force well-known type
|
||||
* to enumerate them correctly.
|
||||
*/
|
||||
if (scsi_is_wlun(sdev->lun) && sdev->type != TYPE_WLUN) {
|
||||
sdev_printk(KERN_WARNING, sdev,
|
||||
"%s: correcting incorrect peripheral device type 0x%x for W-LUN 0x%16xhN\n",
|
||||
__func__, sdev->type, (unsigned int)sdev->lun);
|
||||
sdev->type = TYPE_WLUN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (sdev->type == TYPE_RBC || sdev->type == TYPE_ROM) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue