From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 968EAC433EF for ; Wed, 2 Feb 2022 01:10:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E40C48389E; Wed, 2 Feb 2022 02:09:47 +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="pIlkQN+8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D7D5882FA5; Wed, 2 Feb 2022 02:09:44 +0100 (CET) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (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 5B6F883384 for ; Wed, 2 Feb 2022 02:09:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x432.google.com with SMTP id a19so11449499pfx.4 for ; Tue, 01 Feb 2022 17:09:38 -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=pIlkQN+83wjPugEUiKQgdOZ1LXo6s1GhWm4aTbWyFMUBqwrhzvsrMKPjoy6YF2mnxi U4R49LjmjZrazppU2RMSk3v7BzvP5n4Aw6PDRWyJbvizoLPXToceebmeYMQYC42b+oNB YiMl0fhiAAAZwZOOQyFcV+CWWbC8u63xGbe+8gmMyPxSG8l5SSeMEIdk9VpjtuJrYJ8D r9yjHs2GDCNZk4eVXAgoAQnZg6a2kEpLr2r8342Up7FP23LCA+GwDRGeqoz/RP1jhuJ3 A8NZdqOkKqVx++7eZSXbepadLYTNg8+0+wJnrfS0RSlDaLvqZwn76B+lqA/Hwwf9oZNk PR2A== 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=JYdrnGr9HRklgcJ1yit4f9+fr4WXGFS2OcqN844XXBOuLDzZBzG/1Iui3rd3Joma6K 6OYZYlrdCI/yo9/HNFjtDWmHldKa/BuNz/RE4uCC98p1QM/iPJn1Qo+0ArjikZcbaA4d L1cMNvrmqGpi0krKWYmxkU+RV9xeuyvQ48b2b0ZhIZ+if+f3SbuGN/pCk+iuN7J7pagF t4NTY+2dAmasDJ7pqy7d2aZCJLGj1DwfrJsSusWyT8XwwxdcLtaR3n3BFpS27f3fqq+L aEm7izJAA7LDZMPsh1xmKSKtAmzED9P69ehb+XKawu4Mr/+koyr7BCn5fWUT3swNPcKV A0rw== X-Gm-Message-State: AOAM533ULqNG9nx1vTep7f/UJomhcUyjJI0IGO0Mi3gmBLnDCmO4SwoM WuNoQgfLz2U17MusLzLrK5Zacw== X-Google-Smtp-Source: ABdhPJwcEQ4fXNssqGFR0CpNnJUx9OBaa41ofSD7rACGIxigJsJ3oqu9hKQgjfdotksOzWMqSXP6KQ== X-Received: by 2002:a05:6a00:2348:: with SMTP id j8mr25359139pfj.34.1643764171725; Tue, 01 Feb 2022 17:09:31 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:314e:b83b:fa90:7f2e]) by smtp.gmail.com with ESMTPSA id f5sm10761429pfc.0.2022.02.01.17.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 17:09:31 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.com, peng.ma@nxp.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 01/19] scsi: call device_probe() after scanning Date: Wed, 2 Feb 2022 10:08:35 +0900 Message-Id: <20220202010853.40405-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220202010853.40405-1-takahiro.akashi@linaro.org> References: <20220202010853.40405-1-takahiro.akashi@linaro.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 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 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); -- 2.33.0