public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peng Ma <peng.ma@nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/3] cmd: sata: Add block unbind device function
Date: Wed, 4 Dec 2019 10:36:47 +0000	[thread overview]
Message-ID: <20191204103558.24251-3-peng.ma@nxp.com> (raw)
In-Reply-To: <20191204103558.24251-1-peng.ma@nxp.com>

If we didn't unbind the sata from block device, the same devices would
be added after sata remove,
This patch is to resolve this issue as below:

=> sata info
SATA#0:
	(3.0 Gbps)
SATA#1:
	(3.0 Gbps)
Device 0: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY30
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
Device 1: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX30
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
=> sata stop
=> sata info
SATA#0:
	(3.0 Gbps)
SATA#1:
	(3.0 Gbps)
Device 0: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY300
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
Device 1: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX300
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
Device 2: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY300
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)
Device 3: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX300
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 286168.1 MB = 279.4 GB (586072368 x 512)

Signed-off-by: Peng Ma <peng.ma@nxp.com>
---
 cmd/sata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmd/sata.c b/cmd/sata.c
index a73cc54bd3..6bdb516cb5 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -26,6 +26,8 @@ int sata_remove(int devnum)
 	struct udevice *dev;
 	int rc;
 
+	blk_unbind_all(IF_TYPE_SATA);
+
 	rc = uclass_find_device(UCLASS_AHCI, devnum, &dev);
 	if (!rc && !dev)
 		rc = uclass_find_first_device(UCLASS_AHCI, &dev);
-- 
2.17.1

  parent reply	other threads:[~2019-12-04 10:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 10:36 [PATCH 1/3] ata: sata_sil: Continue probing other sata port when failed current port Peng Ma
2019-12-04 10:36 ` [PATCH 2/3] ata: fsl_sata: " Peng Ma
2019-12-28  2:26   ` Simon Glass
2019-12-30  7:32     ` [EXT] " Peng Ma
2020-01-08 20:12   ` Tom Rini
2019-12-04 10:36 ` Peng Ma [this message]
2019-12-28  2:26   ` [PATCH 3/3] cmd: sata: Add block unbind device function Simon Glass
2019-12-30  7:19     ` [EXT] " Peng Ma
2020-01-08 20:12   ` Tom Rini
2020-01-08 21:49     ` Anatolij Gustschin
2020-01-08 21:57       ` Tom Rini
2020-01-28  0:56   ` Tom Rini
2019-12-28  2:26 ` [PATCH 1/3] ata: sata_sil: Continue probing other sata port when failed current port Simon Glass
2019-12-30  7:27   ` [EXT] " Peng Ma
2020-01-08 20:12 ` Tom Rini
2020-01-09  2:22   ` [EXT] " Peng Ma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191204103558.24251-3-peng.ma@nxp.com \
    --to=peng.ma@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox