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: 522726 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp2168714imb; Thu, 9 Dec 2021 22:50:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyI0cHmtKlps4nebR41LHw1qv+DUgeWJLyP63IEcHw+rl7b3W3/Yjm1fIOebpURUnX+EWCW X-Received: by 2002:a17:907:3da6:: with SMTP id he38mr21006180ejc.151.1639119054036; Thu, 09 Dec 2021 22:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639119054; cv=none; d=google.com; s=arc-20160816; b=t9ulIeh0XET38pIp8BpfKOXJCVoTYQjW1Iv1S2oWSZgUCuQ3PiO3d/RJ5jCh8QrpAi B+hS+07859wx7DmiUScc+lKeOnbkkR9bCkmP1V8N7oD3zPV06lCY0YvfBYnbtg9OOjHV 7wxS7CsFz1GuC8DgEs24SHBJfLpTFapYLTgGBBh3zxhZSepJiVioyc6Raa/TMGtg8RpL soZz7DKlTRcdRkBKfh4jUoxyESBlLHkrpSHVLorQdk+LvD55w+WNqHe2EFYIY/fM0m48 zcAJNhu+Je+Jy00kZr6o5X8i4/04URjpRVMkDeKmou12apNHEmyNefHE6kTrPbGp9BFu kh0Q== 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=qmWo8ajh6FC3+J769E1n7+e/fv+fhY8AOmOHacKJHKs=; b=J7pDx225F3SKQGt8kxaJPws0WSwQLP/aX+rxQBiNkJz23lolPGwW7eBptUXrNjTh67 OYXS0HUGJIH3v7SCo93ZmdcO62YsU2UXtTc4Bj/ahpWqZQSI+qgOOgNK2P+fm0nGE2AY S7n4WuQequdL0vJ/D6JWHEkSG5JxMOoVcnrBEWJKFnEu4uHDFcjz3w8/xmDg+fpa5VB9 /yxkLz9R/tykASsZP/0w7tnQjs7a5H7iQUDkYRJUq6QwmE6pS2a0o7/OuH1vO+kGHP6B ucRnuREJFhWFPAyHY5e31S3qIiNKezAdqJB2ZmaMQTyC6UFL1l8qCjCoufXO1w42q/9e tqow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RGKGRB/9"; 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 z1si4402734edc.600.2021.12.09.22.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 22:50:54 -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="RGKGRB/9"; 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 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-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);