public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Simon Glass <sjg@chromium.org>,
	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()
Date: Mon, 20 Dec 2021 14:19:37 +0900	[thread overview]
Message-ID: <20211220051937.GA31993@laputa> (raw)
In-Reply-To: <70e958c5-5e82-9266-0f59-2bdb68c80949@gmx.de>

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 <takahiro.akashi@linaro.org> wrote:
> > > > 
> > > > This function will be commonly used in block device drivers
> > > > in the succeeding patches.
> > > > 
> > > > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > > > ---
> > > >   drivers/block/blk-uclass.c | 13 +++++++++++++
> > > >   include/blk.h              | 12 ++++++++++++
> > > >   2 files changed, 25 insertions(+)
> > > 
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > 
> > > 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
> > > > 
> 

  reply	other threads:[~2021-12-20  5:19 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  6:49 [RFC v2 00/20] efi_loader: more tightly integrate UEFI disks to driver model AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 01/20] part: call part_init() in blk_get_device_by_str() only for MMC AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 02/20] blk: add a helper function, blk_probe_or_unbind() AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-14  7:01     ` AKASHI Takahiro
2021-12-18 10:55       ` Heinrich Schuchardt
2021-12-20  5:19         ` AKASHI Takahiro [this message]
2021-12-10  6:49 ` [RFC v2 03/20] scsi: call device_probe() after scanning AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 04/20] usb: storage: " AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 05/20] mmc: " AKASHI Takahiro
2021-12-18  9:48   ` Heinrich Schuchardt
2021-12-18 10:03     ` Heinrich Schuchardt
2022-01-02  9:47   ` Heinrich Schuchardt
2022-01-03 10:09   ` Jaehoon Chung
2021-12-10  6:49 ` [RFC v2 06/20] nvme: " AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 07/20] sata: " AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-10  6:49 ` [RFC v2 08/20] block: ide: " AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 09/20] dm: fix an 'undefined' error in some macros AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2022-01-07 12:38     ` Ilias Apalodimas
2021-12-10  6:49 ` [RFC v2 10/20] virtio: call device_probe() in scanning AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-10  6:49 ` [RFC v2 11/20] dm: add event notification AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-14  7:07     ` AKASHI Takahiro
2021-12-19 22:17       ` Simon Glass
2022-01-02  9:41   ` Heinrich Schuchardt
2021-12-10  6:49 ` [RFC v2 12/20] dm: add tag support AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-14  7:05     ` AKASHI Takahiro
2021-12-28  8:32       ` Simon Glass
2021-12-10  6:49 ` [RFC v2 13/20] dm: disk: add UCLASS_PARTITION AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 14/20] dm: blk: add a device-probe hook for scanning disk partitions AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-10  6:49 ` [RFC v2 15/20] efi_loader: disk: a helper function to create efi_disk objects from udevice AKASHI Takahiro
2022-01-02  9:18   ` Heinrich Schuchardt
2022-01-06  7:16     ` AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 16/20] efi_loader: disk: a helper function to delete efi_disk objects AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 17/20] dm: disk: add read/write interfaces with udevice AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 18/20] efi_loader: disk: use udevice instead of blk_desc AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2021-12-10  6:49 ` [RFC v2 19/20] efi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI) devices AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2022-01-02  9:19   ` Heinrich Schuchardt
2022-01-06  6:59     ` AKASHI Takahiro
2021-12-10  6:49 ` [RFC v2 20/20] efi_driver: align with efi_disk-dm integration AKASHI Takahiro
2021-12-13 12:51   ` Simon Glass
2022-01-27 15:05 ` [RFC v2 00/20] efi_loader: more tightly integrate UEFI disks to driver model Simon Glass
2022-01-28  5:01   ` AKASHI Takahiro
2022-01-28 12:32     ` AKASHI Takahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211220051937.GA31993@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=masami.hiramatsu@linaro.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox