Message ID | 20221207085137.445249-36-sjg@chromium.org |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ko0iIk5M; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NRrrn1X71z23pB for <incoming@patchwork.ozlabs.org>; Wed, 7 Dec 2022 20:02:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A1FC85670; Wed, 7 Dec 2022 09:56:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ko0iIk5M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6095585608; Wed, 7 Dec 2022 09:56:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CE9AB85652 for <u-boot@lists.denx.de>; Wed, 7 Dec 2022 09:55:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pl1-x632.google.com with SMTP id jl24so16419798plb.8 for <u-boot@lists.denx.de>; Wed, 07 Dec 2022 00:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xtIU8RUfT8cVHzbarhsyLG9Ageo3osY8iBUgffqITg8=; b=ko0iIk5M6mzSGgeQKDax3B8pQsONeYtTmpVOOZjwUiwa0o+eMJzLAAHHD6suRyznHX Bzd8yvTzjX0hFGce4O9Yo66U5Lo2xSqIu1+xS1EpOXaxMro0WcoUb6qChZeYHs8HDx/A ctLjqhVFakxQadjD23uzlr+PkiIUCLXhdMgiA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xtIU8RUfT8cVHzbarhsyLG9Ageo3osY8iBUgffqITg8=; b=6/Wjl9MLRIiJ1cN5yaaRdiXNNh8/dOhNHy9Sw8byHuMO4H8/xFNiEO8nOA2kQ7g7Rf zvU2ktb78aIc0Fs3OIz8FHoTMsRHAlSF3Iv60/CWyhCgwfKn5C8CiqMwkmey1aEu/slg kt5scKFEFFm7dfhu17M8Eu/s1x6AbxZNt3YACvXHE2TPqdhN622TYRl0zueXu/5mfLVs T9ybG05LHO3BHKU8dz9jmyk3o3g76LLxQCGOUj2AQoW+Re6De7Y7rrhWWYr+AXZKvtIm SNUatqtWrcdDmCXeBvRY60vn0dpU37ktChjc/InXFJ7HjN0Ou+Src46ftESS0uNVko// Tyxw== X-Gm-Message-State: ANoB5pn5SoaBOkmpCHy+9gAYMUhb8lT9opjzvnqJyu0Nt29NZ97rI0NB SFZMhdABH47ING/ULrUCMOEbCsQkNsCIBzmW X-Google-Smtp-Source: AA0mqf7fqkCQRGE5YanNn8GgjDJjyELZ/zF+hX6Z/XQeCWn3fUQsMEm8t6I07pgATl2sFfV0OHlLiA== X-Received: by 2002:a17:902:8d98:b0:189:8e39:3c88 with SMTP id v24-20020a1709028d9800b001898e393c88mr47246063plo.102.1670403356968; Wed, 07 Dec 2022 00:55:56 -0800 (PST) Received: from localhost.localdomain ([27.110.126.54]) by smtp.gmail.com with ESMTPSA id l16-20020a170903121000b0018157b415dbsm14145514plh.63.2022.12.07.00.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 00:55:56 -0800 (PST) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: U-Boot Custodians <u-boot-custodians@lists.denx.de>, Simon Glass <sjg@chromium.org>, AKASHI Takahiro <takahiro.akashi@linaro.org>, Rob Herring <rob.herring@calxeda.com>, Stefan Roese <sr@denx.de> Subject: [PATCH 35/71] scsi: Remove all children of SCSI devices before rescanning Date: Wed, 7 Dec 2022 21:51:01 +1300 Message-Id: <20221207085137.445249-36-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog In-Reply-To: <20221207085137.445249-1-sjg@chromium.org> References: <20221207085137.445249-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean |
Series |
bootstd: Allow migration from distro_bootcmd scripts
|
expand
|
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 6419f4be210..2ae96e171eb 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -644,12 +644,23 @@ int scsi_scan(bool verbose) if (verbose) printf("scanning bus for devices...\n"); - blk_unbind_all(UCLASS_SCSI); - ret = uclass_get(UCLASS_SCSI, &uc); if (ret) return ret; + /* remove all children of the SCSI devices */ + uclass_foreach_dev(dev, uc) { + log_debug("unbind %s\n", dev->name); + ret = device_chld_remove(dev, NULL, DM_REMOVE_NORMAL); + if (!ret) + ret = device_chld_unbind(dev, NULL); + if (ret) { + if (verbose) + printf("unable to unbind devices (%dE)\n", ret); + return log_msg_ret("unb", ret); + } + } + uclass_foreach_dev(dev, uc) { ret = scsi_scan_dev(dev, verbose); if (ret)
At present this only unbinds block devices of a certain type. But SCSI device can have different types of children, including bootdevs. Unbind all children so tht everything is clean and ready for a new scan. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/scsi/scsi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)