Skip to contentSkip to conversation

dm: scsi: Scan the actual number of ports

PATCH New Park 3 participants 3 messages Aug 20, 2019 – Aug 27, 2019 libata

lore
Share & tools
lore

Park

#0 lore raw

PATCH 1/1 dm: scsi: Scan the actual number of ports

The scsi_scan_dev() is looping over the number of uc_plat->max_id. The number of actual ports a AHCI controller has can be greater than max_id. Update uc_plat->max_id to make SCSI scan all detected ports.

---
 drivers/ata/ahci.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/ata/ahci.c +8 -0
index e3135bb75f..9a08575053 100644
@@ -1167,6 +1167,14 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
 	if (ret)
 		return ret;
 
+	/*
+	 * scsi_scan_dev() scans devices up-to the number of max_id.
+	 * Update max_id if the number of detected ports exceeds max_id.
+	 * This allows SCSI to scan all detected ports.
+	 */
+	uc_plat->max_id = max_t(unsigned long, uc_priv->n_ports,
+				uc_plat->max_id);
+
 	return 0;
 }
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 dm: scsi: Scan the actual number of ports

Quoted 10 lines · Aiden

The scsi_scan_dev() is looping over the number of uc_plat->max_id. The number of actual ports a AHCI controller has can be greater than max_id. Update uc_plat->max_id to make SCSI scan all detected ports.

---
 drivers/ata/ahci.c | 8 ++++++++
 1 file changed, 8 insertions(+)
#2 lore raw

PATCH 1/1 dm: scsi: Scan the actual number of ports

In reply to Park
Quoted 6 lines · Aiden

The scsi_scan_dev() is looping over the number of uc_plat->max_id. The number of actual ports a AHCI controller has can be greater than max_id. Update uc_plat->max_id to make SCSI scan all detected ports.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190826/340f1dae/attachment.sig>