From patchwork Tue Mar 8 11:36:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 549269 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp2538611mag; Tue, 8 Mar 2022 03:38:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK0lyLzNi5zKFfoGqLVZrPtwAA1sLHqZHHzJSF0tzh4CYVXl5s77HTM9ot4OU5IeHHHtss X-Received: by 2002:a05:6402:17c4:b0:415:ed36:52cb with SMTP id s4-20020a05640217c400b00415ed3652cbmr15690466edy.379.1646739496351; Tue, 08 Mar 2022 03:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646739496; cv=none; d=google.com; s=arc-20160816; b=dVQPDdkmC0DhWxJ6vs5vGfJh149UoOuci1shkZxKlF88VfSq3mZnizIy8KoVq4i9Mx sgohXk4QvsgUqn7fHYkqJauvceZi8xYYP9KA7ciMSTwHcyVXbHOztyRpUA82UgCqabfE P9kw1/hOSsd1QJG0JklP0F554bL/MRFZzjgHDqVi56v++JMdstabmHABgqlL3+StRCOG 6zcFBZx4jao9L84TYUSY3361x61uUH2CUomPGzwIrEKgfxYGt078Pf3wm0LvaL/fuYFV 8Vt53hJvWUKoWUl6AMF+1aPjmN9iwGTtj4Ic+KDJcWskdN22wBvzahpzjOGNQJsnGeye uBaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u4oZB8HJOqBzKw3cluC92tnysS8ZpEneBaNmr6hGsJU=; b=J+2B9KruWluEMNyZvLyYe/jydusqf54fOkMa9CyiNope8FN+BSGb0Jly6j0+lA2nuK U0wmexcFifSh4hCLdRKHfvhak3/1Hd5b67EWw4fbTzLne1a50nQzoFGuIPrIVrb7aXS0 p4u/ZVF1aXaYsLOY5LePXjacN4H3pkDKAxlA37fVncyVQd6cz/ix+iAfBWc20QQEtGjO a6eiB5w7ptX+xCGL36VuRpPL22hKEF17XTbU+27dHWIBxfJ3b5/8/hgfuUppam1yuHo+ zCsBZRItLOHpPCmGwK7U5DUYMFHjGNWEmQruUYAHM25yeeoUwDwYypK5GDBMxrZOSgnd jOqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CHMzFwJD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id sg13-20020a170907a40d00b006da8435c0e3si11400361ejc.639.2022.03.08.03.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 03:38:16 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CHMzFwJD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 973688397B; Tue, 8 Mar 2022 12:38:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="CHMzFwJD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 55AB681520; Tue, 8 Mar 2022 12:38:03 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) (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 4343C838E1 for ; Tue, 8 Mar 2022 12:37:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x42a.google.com with SMTP id t5so17111329pfg.4 for ; Tue, 08 Mar 2022 03:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u4oZB8HJOqBzKw3cluC92tnysS8ZpEneBaNmr6hGsJU=; b=CHMzFwJDWlxU4N6o//54Wwj+M5U2lwWRtO93oyVRNMAX/h+IeprmYrBiWAVSrK3E5f SlugrAmKOGeWt9r0njiu1bHuV8fP+VajBZuwuIgJ8MXgrX5IVfvlg03rnb9Qk5hywjuW X+1iRDKJpu3fYCYI+xP1YAsMkxsRl3NBKlEiDPc663th9AtVhqjkYcWuWrvux5PXNALm leDj8NYwOjtjDwyuBjXqs/vy03uf7VBLESTS0mhCaBBjoXQNuPtFKdJx1RUc3QdA36rZ 9GWY2K9GP0a/wTyyyXdnz2pn54kpoFFWTfd5flVT7W8GTuwfQq1Ieh7b/StigkTqkT9i Av0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u4oZB8HJOqBzKw3cluC92tnysS8ZpEneBaNmr6hGsJU=; b=dxx1pSOWF/KQipt918Vgb0ZWX8Ow+JTrvqBLp5U2x84NOe6kvAT5GmNBvweHhwTCCA noFXnM+FszdhkQH8b1OePaEquvcthzIQfuJFRoHQNs4dGhjF3lRfzVOWfDnCXuGiqkWa TPipWh6IXwU+E4R9LGd1u0rQT0xkrretE1rUozbFLX5RPMKHRitc02AP9BK90XgzEoil NU+xrXrswaetqGbA9hqMawHZ0ekB7XIaoNwZMHyDGdwnILsdHQB2EeLLnrXgpO23QTrk JTNvgjCmwwo0y7WJPBpbcy+2dJTYUF7pKAFZqb6ekRtQtNxRQQlc976Bsd4SS3paS4Eq Cnag== X-Gm-Message-State: AOAM531XvXumN7YrxsEGOk1AdpB9wkuc7IGQGGA3z6Ywz2Nxv/s6nl6X etV0DMQpxbrxtSUSDN9ZlO88cQ== X-Received: by 2002:a05:6a00:1304:b0:4e1:2338:f11e with SMTP id j4-20020a056a00130400b004e12338f11emr17952777pfu.24.1646739466606; Tue, 08 Mar 2022 03:37:46 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:b94a:f47a:3d51:185c]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a170200b001bf2d530d64sm3434677pjd.2.2022.03.08.03.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 03:37:46 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.com, sr@denx.de, xypron.glpk@gmx.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v3 01/19] scsi: call device_probe() after scanning Date: Tue, 8 Mar 2022 20:36:39 +0900 Message-Id: <20220308113657.221101-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220308113657.221101-1-takahiro.akashi@linaro.org> References: <20220308113657.221101-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Every time a scsi bus/port is scanned and a new block device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass --- drivers/scsi/scsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index d7b33010e469..78d729d809d7 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -595,6 +595,11 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) ata_swap_buf_le16((u16 *)&bdesc->revision, sizeof(bd.revision) / 2); } + ret = blk_probe_or_unbind(bdev); + if (ret < 0) + /* TODO: undo create */ + return ret; + if (verbose) { printf(" Device %d: ", bdesc->devnum); dev_print(bdesc);