Commit f8f41ae6 authored by Michal Simek's avatar Michal Simek Committed by Simon Glass

scsi: dm: Unbind all scsi based block devices before new scan

New scan should unbind all block devices not to be listed again.
Without this patch if scsi reset or scan is called new block devices are
created which point to the same id and lun.

For example:
ZynqMP> scsi scan
scsi_scan: if_type=2, devnum=0: sdhci@ff170000.blk, 6, 0
scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 0
scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 1
scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 2
scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 3
scsi_scan: if_type=2, devnum=0: ahci@fd0c0000.id1lun0, 2, 4
scanning bus for devices...
  Device 0: (1:0) Vendor: ATA Prod.: KINGSTON SVP200S Rev: 501A
            Type: Hard Disk
            Capacity: 57241.8 MB = 55.9 GB (117231408 x 512)
Reported-by: default avatarKen Ma <make@marvell.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent 886b392f
......@@ -559,6 +559,8 @@ int scsi_scan(int mode)
if (mode == 1)
printf("scanning bus for devices...\n");
blk_unbind_all(IF_TYPE_SCSI);
ret = uclass_get(UCLASS_SCSI, &uc);
if (ret)
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment