提交 89dbef45 编写于 作者: M Martin K. Petersen 提交者: zhaoxiaoqiang11

scsi: Revert "scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT"

stable inclusion
from stable-v5.10.168
commit de990d157179369135b6f48bed6853524178c177
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=de990d157179369135b6f48bed6853524178c177

----------------------------------------------------

[ Upstream commit 15600159 ]

This reverts commit 948e922f.

Not all targets that return PQ=1 and PDT=0 should be ignored. While
the SCSI spec is vague in this department, there appears to be a
critical mass of devices which rely on devices being accessible with
this combination of reported values.

Fixes: 948e922f ("scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT")
Link: https://lore.kernel.org/r/yq1lelrleqr.fsf@ca-mkp.ca.oracle.comAcked-by: NBart Van Assche <bvanassche@acm.org>
Acked-by: NMartin Wilck <mwilck@suse.com>
Acked-by: NHannes Reinecke <hare@suse.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
上级 3744d8a5
...@@ -1129,8 +1129,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, ...@@ -1129,8 +1129,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. * that no LUN is present, so don't add sdev in these cases.
* Two specific examples are: * Two specific examples are:
* 1) NetApp targets: return PQ=1, PDT=0x1f * 1) NetApp targets: return PQ=1, PDT=0x1f
* 2) IBM/2145 targets: return PQ=1, PDT=0 * 2) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
* 3) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
* in the UFI 1.0 spec (we cannot rely on reserved bits). * in the UFI 1.0 spec (we cannot rely on reserved bits).
* *
* References: * References:
...@@ -1144,8 +1143,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, ...@@ -1144,8 +1143,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
* PDT=00h Direct-access device (floppy) * PDT=00h Direct-access device (floppy)
* PDT=1Fh none (no FDD connected to the requested logical unit) * PDT=1Fh none (no FDD connected to the requested logical unit)
*/ */
if (((result[0] >> 5) == 1 || if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) &&
(starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f)) && (result[0] & 0x1f) == 0x1f &&
!scsi_is_wlun(lun)) { !scsi_is_wlun(lun)) {
SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
"scsi scan: peripheral device type" "scsi scan: peripheral device type"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册