SCSI fixes on 20230131
Two core fixes. One simply moves an annotation from put to release to avoid the warning triggering needlessly in alua, but to keep it in case release is ever called from that path (which we don't think will happen). The other reverts a change to the PQ=1 target scanning behaviour that's under intense discussion at the moment. Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com> -----BEGIN PGP SIGNATURE----- iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCY9lCeiYcamFtZXMuYm90 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishX7uAQDhcLu9 0YYWJfkEj41fJqcLOsai0UvSoY0oJQVBSvvyOwEA7KjLz4XNWBNE0fw3TkijOio8 YdIVb2K2sKlDo8oKM0U= =fNIn -----END PGP SIGNATURE----- Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Two core fixes. One simply moves an annotation from put to release to avoid the warning triggering needlessly in alua, but to keep it in case release is ever called from that path (which we don't think will happen). The other reverts a change to the PQ=1 target scanning behaviour that's under intense discussion at the moment" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: Revert "scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT" scsi: core: Fix the scsi_device_put() might_sleep annotation
This commit is contained in:
commit
58706f7fb0
@ -588,8 +588,6 @@ void scsi_device_put(struct scsi_device *sdev)
|
||||
{
|
||||
struct module *mod = sdev->host->hostt->module;
|
||||
|
||||
might_sleep();
|
||||
|
||||
put_device(&sdev->sdev_gendev);
|
||||
module_put(mod);
|
||||
}
|
||||
|
@ -1232,8 +1232,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
|
||||
* that no LUN is present, so don't add sdev in these cases.
|
||||
* Two specific examples are:
|
||||
* 1) NetApp targets: return PQ=1, PDT=0x1f
|
||||
* 2) IBM/2145 targets: return PQ=1, PDT=0
|
||||
* 3) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
|
||||
* 2) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
|
||||
* in the UFI 1.0 spec (we cannot rely on reserved bits).
|
||||
*
|
||||
* References:
|
||||
@ -1247,8 +1246,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
|
||||
* PDT=00h Direct-access device (floppy)
|
||||
* PDT=1Fh none (no FDD connected to the requested logical unit)
|
||||
*/
|
||||
if (((result[0] >> 5) == 1 ||
|
||||
(starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f)) &&
|
||||
if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) &&
|
||||
(result[0] & 0x1f) == 0x1f &&
|
||||
!scsi_is_wlun(lun)) {
|
||||
SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
|
||||
"scsi scan: peripheral device type"
|
||||
|
@ -451,6 +451,8 @@ static void scsi_device_dev_release(struct device *dev)
|
||||
struct scsi_vpd *vpd_pgb0 = NULL, *vpd_pgb1 = NULL, *vpd_pgb2 = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
might_sleep();
|
||||
|
||||
scsi_dh_release_device(sdev);
|
||||
|
||||
parent = sdev->sdev_gendev.parent;
|
||||
|
Loading…
Reference in New Issue
Block a user