diff options
| author | Michal Simek <[email protected]> | 2017-01-02 09:40:09 +0100 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2017-01-09 11:25:20 -0700 |
| commit | f8f41ae668040d58271e03bc85b58e13becb14af (patch) | |
| tree | be7a4f1114872cdcd95edf77e8251211def63ca1 | |
| parent | 886b392f1b4cfa63c7e4bb5d211ee2ed77b39d37 (diff) | |
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: [email protected], 6, 0
scsi_scan: if_type=2, devnum=0: [email protected], 2, 0
scsi_scan: if_type=2, devnum=0: [email protected], 2, 1
scsi_scan: if_type=2, devnum=0: [email protected], 2, 2
scsi_scan: if_type=2, devnum=0: [email protected], 2, 3
scsi_scan: if_type=2, devnum=0: [email protected], 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: Ken Ma <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Acked-by: Simon Glass <[email protected]>
| -rw-r--r-- | common/scsi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/scsi.c b/common/scsi.c index e7efa5ae797..fb5b407f6b1 100644 --- a/common/scsi.c +++ b/common/scsi.c @@ -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; |
