* [U-Boot] [PATCH 1/1] dm: scsi: report correct device number
@ 2019-02-05 17:06 Heinrich Schuchardt
2019-02-19 15:16 ` Simon Glass
2019-02-20 1:57 ` [U-Boot] [U-Boot,1/1] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2019-02-05 17:06 UTC (permalink / raw)
To: u-boot
Before the patch scsi would report the same device number for all SCSI
devices, e.g.
Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
Type: Hard Disk
Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
Device 0: (1:0) Vendor: ATA Prod.: Rev:
Type: Hard Disk
Capacity: not available
With the patch the same device number is reported as is used in
scsi_read():
Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
Type: Hard Disk
Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
Device 1: (1:0) Vendor: ATA Prod.: Rev:
Type: Hard Disk
Capacity: not available
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
drivers/scsi/scsi.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index df47e2fc78..75900d8228 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -594,7 +594,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)
memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision));
if (verbose) {
- printf(" Device %d: ", 0);
+ printf(" Device %d: ", bdesc->devnum);
dev_print(bdesc);
}
return 0;
@@ -659,15 +659,16 @@ int scsi_scan(bool verbose)
scsi_max_devs = 0;
for (i = 0; i < CONFIG_SYS_SCSI_MAX_SCSI_ID; i++) {
for (lun = 0; lun < CONFIG_SYS_SCSI_MAX_LUN; lun++) {
- ret = scsi_detect_dev(NULL, i, lun,
- &scsi_dev_desc[scsi_max_devs]);
+ struct blk_desc *bdesc = &scsi_dev_desc[scsi_max_devs];
+
+ ret = scsi_detect_dev(NULL, i, lun, bdesc);
if (ret)
continue;
- part_init(&scsi_dev_desc[scsi_max_devs]);
+ part_init(bdesc);
if (verbose) {
- printf(" Device %d: ", 0);
- dev_print(&scsi_dev_desc[scsi_max_devs]);
+ printf(" Device %d: ", bdesc->devnum);
+ dev_print(bdesc);
}
scsi_max_devs++;
} /* next LUN */
--
2.19.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH 1/1] dm: scsi: report correct device number
2019-02-05 17:06 [U-Boot] [PATCH 1/1] dm: scsi: report correct device number Heinrich Schuchardt
@ 2019-02-19 15:16 ` Simon Glass
2019-02-20 1:57 ` [U-Boot] [U-Boot,1/1] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2019-02-19 15:16 UTC (permalink / raw)
To: u-boot
On Tue, 5 Feb 2019 at 10:06, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Before the patch scsi would report the same device number for all SCSI
> devices, e.g.
>
> Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
> Type: Hard Disk
> Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
> Device 0: (1:0) Vendor: ATA Prod.: Rev:
> Type: Hard Disk
> Capacity: not available
>
> With the patch the same device number is reported as is used in
> scsi_read():
>
> Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
> Type: Hard Disk
> Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
> Device 1: (1:0) Vendor: ATA Prod.: Rev:
> Type: Hard Disk
> Capacity: not available
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> drivers/scsi/scsi.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [U-Boot,1/1] dm: scsi: report correct device number
2019-02-05 17:06 [U-Boot] [PATCH 1/1] dm: scsi: report correct device number Heinrich Schuchardt
2019-02-19 15:16 ` Simon Glass
@ 2019-02-20 1:57 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-02-20 1:57 UTC (permalink / raw)
To: u-boot
On Tue, Feb 05, 2019 at 06:06:24PM +0100, Heinrich Schuchardt wrote:
> Before the patch scsi would report the same device number for all SCSI
> devices, e.g.
>
> Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
> Type: Hard Disk
> Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
> Device 0: (1:0) Vendor: ATA Prod.: Rev:
> Type: Hard Disk
> Capacity: not available
>
> With the patch the same device number is reported as is used in
> scsi_read():
>
> Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
> Type: Hard Disk
> Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
> Device 1: (1:0) Vendor: ATA Prod.: Rev:
> Type: Hard Disk
> Capacity: not available
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Applied to u-boot/master, thanks!
--
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/20190219/2c79d633/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-20 1:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 17:06 [U-Boot] [PATCH 1/1] dm: scsi: report correct device number Heinrich Schuchardt
2019-02-19 15:16 ` Simon Glass
2019-02-20 1:57 ` [U-Boot] [U-Boot,1/1] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.