All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Dan Williams <dan.j.williams@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-nvme@lists.infradead.org,
	virtualization@lists.linux-foundation.org,
	Keith Busch <keith.busch@intel.com>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Christoph Hellwig <hch@infradead.org>,
	Shaohua Li <shli@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
	Jiri Kosina <jikos@kernel.org>,
	linux-block@vger.kernel.org, "Ed L. Cashin" <ed.cashin@acm.org>,
	Jens Axboe <axboe@kernel.dk>,
	linux-raid <linux-raid@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Minchan Kim <minchan@kernel.org>,
	linux-mtd@lists.infradead.org,
	Brian Norris <computersforpeace@gmail.com>linuxppc-dev <l>
Subject: Re: [PATCH v2 04/12] axonrom: Generate uevent after attribute available
Date: Fri, 1 Jul 2016 09:03:07 +0800	[thread overview]
Message-ID: <20160701010307.GC10122@ad.usersys.redhat.com> (raw)
In-Reply-To: <CAA9_cmf0cKZXdQ2N3iSbwVqgLDGJ7TMvVYuZTqjVE-7EqHHcdg@mail.gmail.com>

On Thu, 06/30 15:10, Dan Williams wrote:
> On Wed, Jun 29, 2016 at 6:59 PM, Fam Zheng <famz@redhat.com> wrote:
> > It is documented that KOBJ_ADD should be generated after the object's
> > attributes and children are ready.  We can achieve this with the new
> > disk_gen_uevents interface.
> >
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  arch/powerpc/sysdev/axonram.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
> > index 4efd69b..27e7175 100644
> > --- a/arch/powerpc/sysdev/axonram.c
> > +++ b/arch/powerpc/sysdev/axonram.c
> > @@ -238,7 +238,7 @@ static int axon_ram_probe(struct platform_device *device)
> >         set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT);
> >         blk_queue_make_request(bank->disk->queue, axon_ram_make_request);
> >         blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
> > -       add_disk(bank->disk, true);
> > +       add_disk(bank->disk, false);
> >
> >         bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0);
> >         if (bank->irq_id == NO_IRQ) {
> > @@ -262,6 +262,7 @@ static int axon_ram_probe(struct platform_device *device)
> >                 rc = -EFAULT;
> >                 goto failed;
> >         }
> > +       disk_gen_uevents(bank->disk);
> 
> I assume you are doing this after:
> 
>    rc = device_create_file(&device->dev, &dev_attr_ecc);
> 
> ...so that userspace gets notified of the new attribute, but this
> attribute is on the parent device, not the disk itself.  Instead I
> think this attribute should simply be registered before the call to
> add_disk().  Then the KOBJ_ADD event for the disk comes after the
> attribute is available.  It's still not a clean fit, because userspace
> should not be expecting a child device uevent to signal new attributes
> available on the parent.

Yes you are right, this patch is a mistake. Moving to before add_disk makes
sense to me.

Thanks for taking a look!

Fam

WARNING: multiple messages have this Message-ID (diff)
From: Fam Zheng <famz@redhat.com>
To: Dan Williams <dan.j.williams@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Jens Axboe <axboe@kernel.dk>, "Ed L. Cashin" <ed.cashin@acm.org>,
	Jiri Kosina <jikos@kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Shaohua Li <shli@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Keith Busch <keith.busch@intel.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	linux-block@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-raid <linux-raid@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH v2 04/12] axonrom: Generate uevent after attribute available
Date: Fri, 1 Jul 2016 09:03:07 +0800	[thread overview]
Message-ID: <20160701010307.GC10122@ad.usersys.redhat.com> (raw)
In-Reply-To: <CAA9_cmf0cKZXdQ2N3iSbwVqgLDGJ7TMvVYuZTqjVE-7EqHHcdg@mail.gmail.com>

On Thu, 06/30 15:10, Dan Williams wrote:
> On Wed, Jun 29, 2016 at 6:59 PM, Fam Zheng <famz@redhat.com> wrote:
> > It is documented that KOBJ_ADD should be generated after the object's
> > attributes and children are ready.  We can achieve this with the new
> > disk_gen_uevents interface.
> >
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  arch/powerpc/sysdev/axonram.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
> > index 4efd69b..27e7175 100644
> > --- a/arch/powerpc/sysdev/axonram.c
> > +++ b/arch/powerpc/sysdev/axonram.c
> > @@ -238,7 +238,7 @@ static int axon_ram_probe(struct platform_device *device)
> >         set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT);
> >         blk_queue_make_request(bank->disk->queue, axon_ram_make_request);
> >         blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
> > -       add_disk(bank->disk, true);
> > +       add_disk(bank->disk, false);
> >
> >         bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0);
> >         if (bank->irq_id == NO_IRQ) {
> > @@ -262,6 +262,7 @@ static int axon_ram_probe(struct platform_device *device)
> >                 rc = -EFAULT;
> >                 goto failed;
> >         }
> > +       disk_gen_uevents(bank->disk);
> 
> I assume you are doing this after:
> 
>    rc = device_create_file(&device->dev, &dev_attr_ecc);
> 
> ...so that userspace gets notified of the new attribute, but this
> attribute is on the parent device, not the disk itself.  Instead I
> think this attribute should simply be registered before the call to
> add_disk().  Then the KOBJ_ADD event for the disk comes after the
> attribute is available.  It's still not a clean fit, because userspace
> should not be expecting a child device uevent to signal new attributes
> available on the parent.

Yes you are right, this patch is a mistake. Moving to before add_disk makes
sense to me.

Thanks for taking a look!

Fam

WARNING: multiple messages have this Message-ID (diff)
From: famz@redhat.com (Fam Zheng)
Subject: [PATCH v2 04/12] axonrom: Generate uevent after attribute available
Date: Fri, 1 Jul 2016 09:03:07 +0800	[thread overview]
Message-ID: <20160701010307.GC10122@ad.usersys.redhat.com> (raw)
In-Reply-To: <CAA9_cmf0cKZXdQ2N3iSbwVqgLDGJ7TMvVYuZTqjVE-7EqHHcdg@mail.gmail.com>

On Thu, 06/30 15:10, Dan Williams wrote:
> On Wed, Jun 29, 2016@6:59 PM, Fam Zheng <famz@redhat.com> wrote:
> > It is documented that KOBJ_ADD should be generated after the object's
> > attributes and children are ready.  We can achieve this with the new
> > disk_gen_uevents interface.
> >
> > Signed-off-by: Fam Zheng <famz at redhat.com>
> > ---
> >  arch/powerpc/sysdev/axonram.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
> > index 4efd69b..27e7175 100644
> > --- a/arch/powerpc/sysdev/axonram.c
> > +++ b/arch/powerpc/sysdev/axonram.c
> > @@ -238,7 +238,7 @@ static int axon_ram_probe(struct platform_device *device)
> >         set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT);
> >         blk_queue_make_request(bank->disk->queue, axon_ram_make_request);
> >         blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
> > -       add_disk(bank->disk, true);
> > +       add_disk(bank->disk, false);
> >
> >         bank->irq_id = irq_of_parse_and_map(device->dev.of_node, 0);
> >         if (bank->irq_id == NO_IRQ) {
> > @@ -262,6 +262,7 @@ static int axon_ram_probe(struct platform_device *device)
> >                 rc = -EFAULT;
> >                 goto failed;
> >         }
> > +       disk_gen_uevents(bank->disk);
> 
> I assume you are doing this after:
> 
>    rc = device_create_file(&device->dev, &dev_attr_ecc);
> 
> ...so that userspace gets notified of the new attribute, but this
> attribute is on the parent device, not the disk itself.  Instead I
> think this attribute should simply be registered before the call to
> add_disk().  Then the KOBJ_ADD event for the disk comes after the
> attribute is available.  It's still not a clean fit, because userspace
> should not be expecting a child device uevent to signal new attributes
> available on the parent.

Yes you are right, this patch is a mistake. Moving to before add_disk makes
sense to me.

Thanks for taking a look!

Fam

  reply	other threads:[~2016-07-01  1:03 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30  1:59 [PATCH v2 00/12] gendisk: Generate uevent after attribute available Fam Zheng
2016-06-30  1:59 ` Fam Zheng
2016-06-30  1:59 ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 01/12] genhd: Add "gen_uevent" parameter to add_disk Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 02/12] genhd: Honor gen_uevent and add disk_gen_uevents Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  3:26   ` kbuild test robot
2016-06-30  3:26     ` kbuild test robot
2016-06-30  3:26     ` kbuild test robot
2016-06-30  1:59 ` [PATCH v2 03/12] virtio-blk: Generate uevent after attribute available Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 04/12] axonrom: " Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30 22:10   ` Dan Williams
2016-06-30 22:10     ` Dan Williams
2016-06-30 22:10     ` Dan Williams
2016-07-01  1:03     ` Fam Zheng [this message]
2016-07-01  1:03       ` Fam Zheng
2016-07-01  1:03       ` Fam Zheng
2016-06-30 22:10   ` Dan Williams
2016-06-30  1:59 ` [PATCH v2 05/12] aoeblk: " Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-07-01  0:57   ` Ed Cashin
2016-07-01  0:57     ` Ed Cashin
2016-07-01  0:57     ` Ed Cashin
2016-07-01  0:57   ` Ed Cashin
2016-06-30  1:59 ` [PATCH v2 06/12] mtip32xx: " Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 07/12] pktcdvd: " Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 08/12] zram: " Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 09/12] md: " Fam Zheng
2016-06-30  1:59 ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 10/12] mmc: " Fam Zheng
2016-06-30  1:59 ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 11/12] mtd: " Fam Zheng
2016-06-30  1:59 ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  1:59 ` [PATCH v2 12/12] nvme: " Fam Zheng
2016-06-30  1:59 ` Fam Zheng
2016-06-30  1:59   ` Fam Zheng
2016-06-30  6:24 ` [PATCH v2 00/12] gendisk: " Christoph Hellwig
2016-06-30  6:24   ` Christoph Hellwig
2016-06-30  6:24   ` Christoph Hellwig
2016-06-30  6:24   ` Christoph Hellwig
2016-06-30  6:35   ` Fam Zheng
2016-06-30  6:35     ` Fam Zheng
2016-06-30  6:35     ` Fam Zheng
2016-06-30  6:38     ` Christoph Hellwig
2016-06-30  6:38       ` Christoph Hellwig
2016-06-30  6:38       ` Christoph Hellwig
2016-07-01  1:01       ` Fam Zheng
2016-07-01  1:01         ` Fam Zheng
2016-07-01  1:01         ` Fam Zheng
2016-07-01  1:29         ` Dan Williams
2016-07-01  1:29         ` Dan Williams
2016-07-01  1:29           ` Dan Williams
2016-07-01  1:29           ` Dan Williams
2016-07-01  1:29           ` Dan Williams

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=20160701010307.GC10122@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=benh@kernel.crashing.org \
    --cc=computersforpeace@gmail.com \
    --cc=dan.j.williams@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=ed.cashin@acm.org \
    --cc=hch@infradead.org \
    --cc=jikos@kernel.org \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=mst@redhat.com \
    --cc=ngupta@vflare.org \
    --cc=paulus@samba.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=shli@kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.