From patchwork Fri Dec 10 06:49:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1566196 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RGKGRB/9; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J9M4J2sKzz9sR4 for ; Fri, 10 Dec 2021 17:50:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 16E7282982; Fri, 10 Dec 2021 07:50:45 +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="RGKGRB/9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3780582DA1; Fri, 10 Dec 2021 07:50:35 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (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 F271F82FAB for ; Fri, 10 Dec 2021 07:50:28 +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-pg1-x52a.google.com with SMTP id g16so7283727pgi.1 for ; Thu, 09 Dec 2021 22:50:28 -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=qmWo8ajh6FC3+J769E1n7+e/fv+fhY8AOmOHacKJHKs=; b=RGKGRB/9J7UVNjx24s10qv1aiNocGebL8N+xIjDVf+2DfT8VT5/2EqsWMiJP7PbEsM AcWxAxbPB9EPUPRhhVwLQGfIovy29e/l7KabtxQgB2q4z7utqhcsJRFQRgLSkdqu1E8t vSC8T0LFxnPwwe4ViX9+TLcIC1N4oK7NPgkaKCaAPNgO5Qq5hpjAmZ1n1mGjqdRCh6tL QP3Wm9rkrcTvEvHvPewPllJ99dRV+yHY4Wx40bDh+GDu74qBEvRWrjaYZo1eD6o5DG7i 50fgzPAJCzGGRkLrAW+dzomHROa+orzIMUhJyJY4BOtyEGoAuXm0CCe84H6obV1hoqwo O1sA== 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=qmWo8ajh6FC3+J769E1n7+e/fv+fhY8AOmOHacKJHKs=; b=rf419/PUu3oqASpHpxzL8hbIOifopw+5NGUkHDXmIstG4FeU0wLsqiRqOOONabepSc Oag3VrT0qKc6iw5GAmBl14NlRJ+8XjtMpdTF9zx2X9QsHSFb464JJyD/41g5ZybVgTT3 Vvi0Vhy5Lpcx5a6dpGq1P1GsIkIQ7PN+oQD9vJNdaZhDVZMMacu4/N+jtchL08GdetPX vCb0A9wTe3EYCFP8xzteyRiiN1x5caEgpYqZnbvmjAN9P9w0l7d3YELE4eQJjKxZPugY FjaCpk5dE3ztoe29v3ckjwN6MEbE1keAjbjUEavoIQTdB5gsJUZg0A8yWu3OVPIOeQh7 pxYg== X-Gm-Message-State: AOAM531+rcUpgA9dmBxkdqtNIl608mAHJPm5YJOfIK4AjUZ9hAQtZ6BS 5vsOuu3/MJtGQVbhEOq80LgX7OC7e0wGdHlL X-Google-Smtp-Source: ABdhPJxHO4+MYV4/14vvFL+fwdJEE0nfmzTf0jI9I4tMQO2BBOxSWVbym8L8CXopgWYzMp+hjZNHpQ== X-Received: by 2002:a05:6a00:21c3:b0:4a7:ffeb:ec1f with SMTP id t3-20020a056a0021c300b004a7ffebec1fmr16481857pfj.60.1639119027404; Thu, 09 Dec 2021 22:50:27 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:75dd:4e0e:4542:936e]) by smtp.gmail.com with ESMTPSA id nn4sm1639035pjb.38.2021.12.09.22.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:50:26 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC v2 03/20] scsi: call device_probe() after scanning Date: Fri, 10 Dec 2021 15:49:30 +0900 Message-Id: <20211210064947.73361-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211210064947.73361-1-takahiro.akashi@linaro.org> References: <20211210064947.73361-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 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 d93d24192853..9a763ea78bbd 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);