From patchwork Thu Feb 10 08:11:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 541395 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp2038506imo; Thu, 10 Feb 2022 00:12:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwTtJAyaOa+bG76FTSHQRyuF8fiRn5furranVr0KTwYVJwJi6cghsJSgP86a/iJuTcT7Z1 X-Received: by 2002:a05:6402:5cf:: with SMTP id n15mr6962330edx.245.1644480748609; Thu, 10 Feb 2022 00:12:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644480748; cv=none; d=google.com; s=arc-20160816; b=awUih+GxKH8sA5CaY82MRb09yN76w6wWeZvD4X26ZQ0MG+cZNXzy1rCR/fiSARAJ1t 9DhGMYSMahreFZXvk/5pPYBOqI2Cg/xqJdZf86lMYGFBh8fWaog4XKq7d0a6CCVhC/Ru aTi0ayF4F3xyjRkk+IW4vp02FksqbNTuQhvNdjqjvXZTHT6smT6Op6p91jIpfa9J+myZ y1n0Nw7Y48jyHZRDSNOEEjGAM+vUWgXLB9CjjORFgNLktXlCbWUrZnUcbQpMv27JpU+M pHO4nS65NjmD/9Eaa+Z2JsVA36Ou9h7iXRuRRKrO1qakIHVqVedBoS+1eC8ftupA/wom SzSw== 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=wWZWsl/17bJqb6Hld4dDf7eMnBfRLZNj37qeoAXo4JDf7ckzYc0BPgK2ubMU+pZu5r XlqSeCc3meQ1TciWsBdeRqjcbgSEneo5ljLsvRs7bEfHbfSgioD00f4NPkC5kcBrRxG3 nbDRWp6FGQlCrY4Sf536L1qxpEKzmmogLuxecA2avet8k6SZOhDsEyVwsovxhdqLCfQn 3BNXXzpRCVGYDbjJhEvJ45w399QU1DpMvWST1Gm3PnbMQRthKxOwGnFKWx/rbuq12U6f /D9g6KH4JoCBpgZrULcnpDexKPTfm4TIQQcaTDqWnQDLEfYvIzPWHlZOl+I0GrrrgAY7 GwPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d1Ve+Nsq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id ds9si13639761ejc.775.2022.02.10.00.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 00:12:28 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d1Ve+Nsq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 F336B82014; Thu, 10 Feb 2022 09:12:23 +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="d1Ve+Nsq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 153D18142D; Thu, 10 Feb 2022 09:12:22 +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=ham 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 1A59F8142D for ; Thu, 10 Feb 2022 09:12:17 +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 u16so3212211pfg.3 for ; Thu, 10 Feb 2022 00:12:17 -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=d1Ve+NsqDaTmI978GbxCVhm3rqMsicBN7/MV5eMEup3ykMeQfUBHxgsC9XuvDRpXy8 xIxcY2b1pOqn9kFWhGTpci1t1x/oabURht7znjjRY5P6MhgbhIuI7TkGyB87jpIdn8ET 0yYFegi6h+ASJO/+1L3t+seGMMEr8GITfWGeTRc+r7+JaIMaeJ1/uGsLlnB0GWtKU679 t+on5LY1A+feFIUa0s567le8jW+WmbxGdWsdy8pSHFFNRTHe5Jq3g48YJwHWExxmK7XV GSJ5L3br8zjKESSL70t+mht55A2LdefMw6oD8DTJOFYQyAVvG4kvsYeOoIIM3lmvt3xl ofLw== 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=xxD5Q192vpYc/ahyF0/RjqAvuh4RMm8QBayPYfLuqjLrk08bnRRjTjUYgud7jcfbA+ wBoo6ILUbcP7uudjNk5/YmlVXGg0Hiex81xy8JQYDDbfL3YPbAWD+RH4iprXU5+RpBjg iZWAidAK2Z6z2bEVbmmCq0z0CeeTGwkdcWjJqpYbqU3xpGEFuZ4sCZye+u94ekkVlpor PVZ1iVokFpZSpVKBoB9od4HQ+hE6ftKu4GOuGnAgF1lT1eDkP0Q23FHlvIN6k+Zq0phe r8J8Nty0cbwCqvMlS1PFZZn+eYaxvDlJ5PBMkPNKXQPhgNoJMw7FRmdGYSgmvkYHOzxH Y8ag== X-Gm-Message-State: AOAM531fRWeWwbVmvoUUOMV3Iwg+rDgmb0PUTtVrBRATUvhGXyhONG9V i78a59hst1PJ3cZJtC9It4LEdA== X-Received: by 2002:a62:2581:: with SMTP id l123mr6319629pfl.71.1644480734936; Thu, 10 Feb 2022 00:12:14 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:412e:384:fab9:f24]) by smtp.gmail.com with ESMTPSA id lk8sm1529208pjb.40.2022.02.10.00.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 00:12:14 -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 v2 01/20] scsi: call device_probe() after scanning Date: Thu, 10 Feb 2022 17:11:05 +0900 Message-Id: <20220210081124.86612-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220210081124.86612-1-takahiro.akashi@linaro.org> References: <20220210081124.86612-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 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);