forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/scsi/scsi_scan.c
....@@ -236,7 +236,6 @@
236236 sdev->sdev_state = SDEV_CREATED;
237237 INIT_LIST_HEAD(&sdev->siblings);
238238 INIT_LIST_HEAD(&sdev->same_target_siblings);
239
- INIT_LIST_HEAD(&sdev->cmd_list);
240239 INIT_LIST_HEAD(&sdev->starved_entry);
241240 INIT_LIST_HEAD(&sdev->event_list);
242241 spin_lock_init(&sdev->list_lock);
....@@ -266,10 +265,7 @@
266265 */
267266 sdev->borken = 1;
268267
269
- if (shost_use_blk_mq(shost))
270
- sdev->request_queue = scsi_mq_alloc_queue(sdev);
271
- else
272
- sdev->request_queue = scsi_old_alloc_queue(sdev);
268
+ sdev->request_queue = scsi_mq_alloc_queue(sdev);
273269 if (!sdev->request_queue) {
274270 /* release fn is set up in scsi_sysfs_device_initialise, so
275271 * have to free and put manually here */
....@@ -280,11 +276,6 @@
280276 WARN_ON_ONCE(!blk_get_queue(sdev->request_queue));
281277 sdev->request_queue->queuedata = sdev;
282278
283
- if (!shost_use_blk_mq(sdev->host)) {
284
- blk_queue_init_tags(sdev->request_queue,
285
- sdev->host->cmd_per_lun, shost->bqt,
286
- shost->hostt->tag_alloc_policy);
287
- }
288279 scsi_change_queue_depth(sdev, sdev->host->cmd_per_lun ?
289280 sdev->host->cmd_per_lun : 1);
290281
....@@ -1138,7 +1129,8 @@
11381129 * that no LUN is present, so don't add sdev in these cases.
11391130 * Two specific examples are:
11401131 * 1) NetApp targets: return PQ=1, PDT=0x1f
1141
- * 2) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
1132
+ * 2) IBM/2145 targets: return PQ=1, PDT=0
1133
+ * 3) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved"
11421134 * in the UFI 1.0 spec (we cannot rely on reserved bits).
11431135 *
11441136 * References:
....@@ -1152,8 +1144,8 @@
11521144 * PDT=00h Direct-access device (floppy)
11531145 * PDT=1Fh none (no FDD connected to the requested logical unit)
11541146 */
1155
- if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) &&
1156
- (result[0] & 0x1f) == 0x1f &&
1147
+ if (((result[0] >> 5) == 1 ||
1148
+ (starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f)) &&
11571149 !scsi_is_wlun(lun)) {
11581150 SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
11591151 "scsi scan: peripheral device type"