From patchwork Thu Jun 30 01:59:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 642318 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rg4Lh2bZ5z9sCg for ; Thu, 30 Jun 2016 13:11:08 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rg4Lh1gnFzDrQh for ; Thu, 30 Jun 2016 13:11:08 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rg2nh1xrxzDq5f for ; Thu, 30 Jun 2016 12:00:56 +1000 (AEST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 565933710D6; Thu, 30 Jun 2016 02:00:54 +0000 (UTC) Received: from ad.usersys.redhat.com (dhcp-15-133.nay.redhat.com [10.66.15.133]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5U201qS029340; Wed, 29 Jun 2016 22:00:48 -0400 From: Fam Zheng To: linux-kernel@vger.kernel.org Subject: [PATCH v2 07/12] pktcdvd: Generate uevent after attribute available Date: Thu, 30 Jun 2016 09:59:48 +0800 Message-Id: <20160630015953.6888-8-famz@redhat.com> In-Reply-To: <20160630015953.6888-1-famz@redhat.com> References: <20160630015953.6888-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 30 Jun 2016 02:00:54 +0000 (UTC) X-Mailman-Approved-At: Thu, 30 Jun 2016 13:01:50 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Sergey Senozhatsky , "Michael S. Tsirkin" , linux-nvme@lists.infradead.org, virtualization@lists.linux-foundation.org, Keith Busch , Paul Mackerras , Christoph Hellwig , Shaohua Li , Nitin Gupta , famz@redhat.com, Jiri Kosina , linux-block@vger.kernel.org, "Ed L. Cashin" , Jens Axboe , linux-raid@vger.kernel.org, David Woodhouse , linux-mmc@vger.kernel.org, Minchan Kim , linux-mtd@lists.infradead.org, Brian Norris , linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- drivers/block/pktcdvd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 00928406..a4e6bb7 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -2785,11 +2785,13 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) disk->events = pd->bdev->bd_disk->events; disk->async_events = pd->bdev->bd_disk->async_events; - add_disk(disk, true); + add_disk(disk, false); pkt_sysfs_dev_new(pd); pkt_debugfs_dev_new(pd); + disk_gen_uevents(disk); + pkt_devs[idx] = pd; if (pkt_dev) *pkt_dev = pd->pkt_dev;