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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ABBAC433F5 for ; Mon, 4 Oct 2021 18:45:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6CE6E61409 for ; Mon, 4 Oct 2021 18:45:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6CE6E61409 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58EE782D78; Mon, 4 Oct 2021 20:45:43 +0200 (CEST) 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="aVFag3cR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C16C482D78; Mon, 4 Oct 2021 20:45:41 +0200 (CEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 09E0680691 for ; Mon, 4 Oct 2021 20:45:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wr1-x433.google.com with SMTP id s15so4290398wrv.11 for ; Mon, 04 Oct 2021 11:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xQORnHGPB9zViAR8EoiYxu8N1cnU/s+zVWGybIbUsEc=; b=aVFag3cRl+9N4kq6J65SHXz64bPvakCRqu8K2fxfG6n/4W6VcQf2g4rkKu4truPwP8 4/uT3U6jqyuyq48g4kbNYoPamL7wP1vKy/ellhdragDqEMVNY2ZEMDj9+oUBn3sGRL5Q UEGVWBc7GWlpEHVzeShDveYEGpfbqHYR01z7waLZJkvjoXEGMIRnjh/Ko8ZmowgSsG2k +9xRajEikBCVdRTp5qG60ZuQyXxdFKwM3rGLcnIOMPRLUE7+TC7xhyKYyMMx4Y/RrbO5 rh0Mk39Kuo3NhGS1I1TlGnYRnGdDr/kjEZ6wcD2VS83ssRfjjdhB4YAmFRJPv0EysQ0L fMSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xQORnHGPB9zViAR8EoiYxu8N1cnU/s+zVWGybIbUsEc=; b=gL4+C94aqZq6Hpu14ZdIAo75EEbpJE6pPmTiJ4dGdmPLIYSai0ciUMrGaJLk/2KgbZ w9T8ef4b63Oeb4BQnF7+LcQnD1MkkCp08STkcb6uLx+evbY7CbnKcOduCs6YgEzx/90V 8L8E3+VlPtfT7znX0/ReWFbVBc/Amgt0LsP9J7w3BMNoRqUpztbkbL34tfYh7C57ctfS JAS/ZCxt4aRbMZKsewNccC1fFsewARmcLNe2IONljHWBYEcP5yws8AePTcs8VBBicLa0 f0E7OlpIy4yDNhzqB9gxbR1PazS0+J/Mvf/fFGt1N829Gva16NAbW7rqpR1Jt7X0ZaBd 6duA== X-Gm-Message-State: AOAM530tgXMel9aypcM72rUjXoG8s3T+KhzbAFw93xS93hBRnmD4HutB 3oKziLWINcmncIB5zVhGReX/Yg== X-Google-Smtp-Source: ABdhPJzhQ8Cv8xFYQYNiq0wKVpboVS9RDNeci3iQuoL5YM3D4Lu2BaNfxE+tMbUZkFiilNiX7nk/oQ== X-Received: by 2002:a5d:6d8e:: with SMTP id l14mr16142680wrs.270.1633373137617; Mon, 04 Oct 2021 11:45:37 -0700 (PDT) Received: from enceladus (ppp-94-66-220-209.home.otenet.gr. [94.66.220.209]) by smtp.gmail.com with ESMTPSA id r19sm14653393wmp.43.2021.10.04.11.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 11:45:37 -0700 (PDT) Date: Mon, 4 Oct 2021 21:45:35 +0300 From: Ilias Apalodimas To: AKASHI Takahiro Cc: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, u-boot@lists.denx.de Subject: Re: [resent RFC 06/22] sata: call device_probe() after scanning Message-ID: References: <20211004034430.41355-1-takahiro.akashi@linaro.org> <20211004034430.41355-7-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211004034430.41355-7-takahiro.akashi@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 On Mon, Oct 04, 2021 at 12:44:14PM +0900, AKASHI Takahiro wrote: > Every time a sata bus/port is scanned and a new 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 > --- > drivers/ata/dwc_ahsata.c | 10 ++++++++++ > drivers/ata/fsl_sata.c | 11 +++++++++++ > drivers/ata/sata_mv.c | 9 +++++++++ > drivers/ata/sata_sil.c | 12 ++++++++++++ > 4 files changed, 42 insertions(+) > > diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c > index 6d42548087b3..6a51c70d1170 100644 > --- a/drivers/ata/dwc_ahsata.c > +++ b/drivers/ata/dwc_ahsata.c > @@ -1026,6 +1026,16 @@ int dwc_ahsata_scan(struct udevice *dev) > return ret; > } > > + ret = device_probe(bdev); > + if (ret < 0) { > + debug("Can't probe\n"); > + /* TODO: undo create */ > + > + device_unbind(bdev); > + > + return ret; > + } > + Patches 2-6 seem to do the same thing for different subsystems. I think creating a function for that would make it easier. > return 0; > } > > diff --git a/drivers/ata/fsl_sata.c b/drivers/ata/fsl_sata.c > index e44db0a37458..346e9298b4c5 100644 > --- a/drivers/ata/fsl_sata.c > +++ b/drivers/ata/fsl_sata.c > @@ -982,6 +982,17 @@ static int fsl_ata_probe(struct udevice *dev) > failed_number++; > continue; > } > + > + ret = device_probe(bdev); > + if (ret < 0) { > + debug("Can't probe\n"); > + ret = fsl_unbind_device(blk); Apart from this exception I guess > + if (ret) > + return ret; > + > + failed_number++; > + continue; > + } > } > > if (failed_number == nr_ports) > diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c > index 003222d47be6..09b735779ebf 100644 > --- a/drivers/ata/sata_mv.c > +++ b/drivers/ata/sata_mv.c > @@ -1099,6 +1099,15 @@ static int sata_mv_probe(struct udevice *dev) > continue; > } > > + ret = device_probe(bdev); > + if (ret < 0) { > + debug("Can't probe\n"); > + /* TODO: undo create */ > + > + device_unbind(bdev); > + continue; > + } > + > /* If we got here, the current SATA port was probed > * successfully, so set the probe status to successful. > */ > diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c > index dda712f42cb2..295f7ca72303 100644 > --- a/drivers/ata/sata_sil.c > +++ b/drivers/ata/sata_sil.c > @@ -864,6 +864,18 @@ static int sil_pci_probe(struct udevice *dev) > failed_number++; > continue; > } > + > + ret = device_probe(bdev); > + if (ret < 0) { > + debug("Can't probe\n"); > + ret = sil_unbind_device(blk); > + device_unbind(bdev); > + if (ret) > + return ret; > + > + failed_number++; > + continue; > + } > } > > if (failed_number == sata_info.maxport) > -- > 2.33.0 >