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 EC90AC433F5 for ; Mon, 20 Dec 2021 05:19:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B75B783031; Mon, 20 Dec 2021 06:19: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="eZkkZONv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B74EC8307B; Mon, 20 Dec 2021 06:19:46 +0100 (CET) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 F29E582FA3 for ; Mon, 20 Dec 2021 06:19:42 +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-x52e.google.com with SMTP id d11so8363608pgl.1 for ; Sun, 19 Dec 2021 21:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=WLtvkHsNFCvYtYfpdqNeIZRQaHN6GiV7e1cwAN7LBBQ=; b=eZkkZONvrtiQIrA1dASvZs3ni7cz/o79fvJRJl1iwlFuZvVZdjJsKzwUdMRvnxk0QL b5RmgMDnaUxos7/BVJVA7kRfibJSjSltgkj5q88f6ASHDsGgCwdObHOJewUdqzm/mO7x lmykyguhfn0lyWf65UNy3lE/idIhPFNxLCpy5CitHr8JYPArdlZL4uEDnKrK7JtVGR2l S+XoHlaE7urxy6aSXuaPhH9aLzymVpl2jZFkk9jT4qfW36pGIU+tzteBNjJHeIeFXKVd 8gN4UZe4M9Nc13tpnd6ZLOQ/5RK9EH6BUz6W81AKxsEXEnvpqTH3UhYcwFw9SZ8O3iV6 oXgQ== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=WLtvkHsNFCvYtYfpdqNeIZRQaHN6GiV7e1cwAN7LBBQ=; b=w8JWDi9IUhUO5Gd6Rn1MRK0jJ44zKuCMZDNNi81xFfwmTrDF5C0wO49/IA7JhhuX0b TXu8UePPAfemyRN1N4+RwWTS8t1+m6j5GSiPaTkPTPyquyp1ZRG9nXR9LaSpGLHZTGyK 5295h/sXAZgsxtc3jomocM0KX60ImiuuMfbelfddQBpS2MmOTpHaQ8PEh+liPWHv3qKA Fc9qCvNcUb9Gzz1VKUyexF0FMVlzq5LaRk52Y6fS3nbVxuURwdoMK09fzwSsCY5sDSwp XenAghOnTvhYRZaBduhJPdIRrNPuIAztAP1eTOchKehjlM564SUjGfOL5cA+sG1oj4e1 lfDQ== X-Gm-Message-State: AOAM533yNvxha8kHtgAfmJXKK4AtUQtW7Z06G4uZOi1w4+CvZ0dtTiAL KwFMYpWR/xTtcUA5wppDWngOkg== X-Google-Smtp-Source: ABdhPJz/Idvj+oqjMVKPE6mky1xC7DEC4Nlieyt8yJC/vwKmdgxYunVY69U4qnwMA2m0/c0eQtvZwA== X-Received: by 2002:a05:6a00:8cf:b0:4a8:3ae:1a78 with SMTP id s15-20020a056a0008cf00b004a803ae1a78mr14536951pfu.7.1639977581401; Sun, 19 Dec 2021 21:19:41 -0800 (PST) Received: from laputa ([2400:4050:c3e1:100:89bf:be4:468d:12c2]) by smtp.gmail.com with ESMTPSA id d17sm1595705pfv.48.2021.12.19.21.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Dec 2021 21:19:41 -0800 (PST) Date: Mon, 20 Dec 2021 14:19:37 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: Simon Glass , agraf@csgraf.de, masami.hiramatsu@linaro.org, ilias.apalodimas@linaro.org, u-boot@lists.denx.de Subject: Re: [RFC v2 02/20] blk: add a helper function, blk_probe_or_unbind() Message-ID: <20211220051937.GA31993@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , Simon Glass , agraf@csgraf.de, masami.hiramatsu@linaro.org, ilias.apalodimas@linaro.org, u-boot@lists.denx.de References: <20211210064947.73361-1-takahiro.akashi@linaro.org> <20211210064947.73361-3-takahiro.akashi@linaro.org> <20211214070103.GA49357@laputa> <70e958c5-5e82-9266-0f59-2bdb68c80949@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <70e958c5-5e82-9266-0f59-2bdb68c80949@gmx.de> 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 On Sat, Dec 18, 2021 at 11:55:41AM +0100, Heinrich Schuchardt wrote: > On 12/14/21 08:01, AKASHI Takahiro wrote: > > Hi Simon, > > > > Thank you for your review on this series. > > > > On Mon, Dec 13, 2021 at 05:51:40AM -0700, Simon Glass wrote: > > > Hi Takahiro, > > > > > > On Thu, 9 Dec 2021 at 23:59, AKASHI Takahiro wrote: > > > > > > > > This function will be commonly used in block device drivers > > > > in the succeeding patches. > > > > > > > > Signed-off-by: AKASHI Takahiro > > > > --- > > > > drivers/block/blk-uclass.c | 13 +++++++++++++ > > > > include/blk.h | 12 ++++++++++++ > > > > 2 files changed, 25 insertions(+) > > > > > > Reviewed-by: Simon Glass > > > > > > But please add a test for this. > > > > Well, how can we test this simple function? > > I can't simply imagine what the meaningful test scenario is. > > > > > > > > > > diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c > > > > index 83682dcc181a..f7ad90e8890f 100644 > > > > --- a/drivers/block/blk-uclass.c > > > > +++ b/drivers/block/blk-uclass.c > > > > @@ -670,6 +670,19 @@ int blk_create_devicef(struct udevice *parent, const char *drv_name, > > > > return 0; > > > > } > > > > > > > > +int blk_probe_or_unbind(struct udevice *dev) > > > > +{ > > > > + int ret; > > > > + > > > > + ret = device_probe(dev); > > > > + if (ret) { > > > > + debug("probing %s failed\n", dev->name); > > %s/debug(/log_debug(/ I used "debug()" here as it is commonly used in this file(blk-uclass.c). > > > > + device_unbind(dev); > > > > + } > > > > + > > > > + return ret; > > > > +} > > > > + > > > > int blk_unbind_all(int if_type) > > > > { > > > > struct uclass *uc; > > > > diff --git a/include/blk.h b/include/blk.h > > > > index f0cc7ca1a28c..ef79e7b27b0a 100644 > > > > --- a/include/blk.h > > > > +++ b/include/blk.h > > > > @@ -369,6 +369,18 @@ int blk_create_devicef(struct udevice *parent, const char *drv_name, > > > > const char *name, int if_type, int devnum, int blksz, > > > > lbaint_t lba, struct udevice **devp); > > > > > > > > +/** > > > > + * blk_probe_or_unbind() - Try to probe > > > > + * > > > > + * Try to probe the device, primarily for enumelating partitions. > > > > > > enumerating > > > > Ah, OK. > > > > -Takahiro Akashi > > > > > > > > > > > > + * If it fails, the device itself is unbound since it means that it won't > > > > + * work any more. > > > > + * > > > > + * @dev: The device to probe > > > > + * @return 0 if OK, -ve on error > > %s/@return/Return:/ I used "@return" here as it is commonly used in this file(blk.h). > Please, stick to Spinx style comments as documented in > https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#function-documentation > > Otherwise 'make htmldocs' will fail. If so, why don't other uses of "@return" cause failures as well? > I will fix the remaining issues when merging. Thank you. We'd better fix all the occurrences in those files at the same time to avoid possible confusion. -Takahiro Akashi > Best regards > > Heinrich > > > > > + */ > > > > +int blk_probe_or_unbind(struct udevice *dev); > > > > + > > > > /** > > > > * blk_unbind_all() - Unbind all device of the given interface type > > > > * > > > > -- > > > > 2.33.0 > > > > >