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 X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88963C4360C for ; Sat, 28 Sep 2019 07:43:17 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3103A20815 for ; Sat, 28 Sep 2019 07:43:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mbu+RXzL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3103A20815 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46gLHk6Bl9zDqVF for ; Sat, 28 Sep 2019 17:43:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linuxfoundation.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Mbu+RXzL"; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46gLFl2hc9zDqNr for ; Sat, 28 Sep 2019 17:41:30 +1000 (AEST) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87C1B20815; Sat, 28 Sep 2019 07:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569656488; bh=JVIeHjjNRyOVRl0OMflBw//1gGMM44nM13GY8cdFb4Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mbu+RXzLKYq+z9tKXDMCTcrCq67mm4Z3D60deamWop0jx3EwhTey4EzM6FaNUgwkt UXwRuNitUPsjzMeEQdvTtMJWWgcm2RjR0YK9s1ivZYup+L/msb3S3jscGLaxHhcbBd cZG504x/+4vvmZJLjzb6+HYjegEPlKZvkg42ctxk= Date: Sat, 28 Sep 2019 09:41:24 +0200 From: Greg Kroah-Hartman To: Dan Streetman Subject: Re: [PATCH] powerpc/vio: use simple dummy struct device as bus parent Message-ID: <20190928074124.GD1836895@kroah.com> References: <20190927130402.687-1-ddstreet@canonical.com> <20190927181856.GD1804168@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Alexey Kardashevskiy , linux-kernel@vger.kernel.org, Paul Mackerras , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Sep 27, 2019 at 03:48:49PM -0400, Dan Streetman wrote: > On Fri, Sep 27, 2019 at 2:19 PM Greg Kroah-Hartman > wrote: > > > > On Fri, Sep 27, 2019 at 09:04:02AM -0400, Dan Streetman wrote: > > > The dummy vio_bus_device creates the /sys/devices/vio directory, which > > > contains real vio devices under it; since it represents itself as having > > > a bus = &vio_bus_type, its /sys/devices/vio/uevent does call the bus's > > > .uevent function, vio_hotplug(), and as that function won't find a real > > > device for the dummy vio_dev, it will return -ENODEV. > > > > > > One of the main users of the uevent node is udevadm, e.g. when it is called > > > with 'udevadm trigger --devices'. Up until recently, it would ignore any > > > errors returned when writing to devices' uevent file, but it was recently > > > changed to start returning error if it gets an error writing to any uevent > > > file: > > > https://github.com/systemd/systemd/commit/97afc0351a96e0daa83964df33937967c75c644f > > > > > > since the /sys/devices/vio/uevent file has always returned ENODEV from > > > any write to it, this now causes the udevadm trigger command to return > > > an error. This may be fixed in udevadm to ignore ENODEV errors, but the > > > vio driver should still be fixed. > > > > > > This patch changes the arch/powerpc/platform/pseries/vio.c 'dummy' > > > parent device into a real dummy device with no .bus, so its uevent > > > file will stop returning ENODEV and simply do nothing and return 0. > > > > > > Signed-off-by: Dan Streetman > > > --- > > > arch/powerpc/platforms/pseries/vio.c | 11 ++++------- > > > 1 file changed, 4 insertions(+), 7 deletions(-) > > > > > > diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c > > > index 79e2287991db..63bc16631680 100644 > > > --- a/arch/powerpc/platforms/pseries/vio.c > > > +++ b/arch/powerpc/platforms/pseries/vio.c > > > @@ -32,11 +32,8 @@ > > > #include > > > #include > > > > > > -static struct vio_dev vio_bus_device = { /* fake "parent" device */ > > > - .name = "vio", > > > - .type = "", > > > - .dev.init_name = "vio", > > > - .dev.bus = &vio_bus_type, > > > +static struct device vio_bus = { > > > + .init_name = "vio", > > > > Eeek, no! Why are you creating a static device that will then be > > reference counted? Not nice :( > > sorry! I'll admit that I simply copied what drivers/base/platform.c > seemed to be doing. I don't see platform.c having a 'static struct device' anywhere in it, am I missing it in my searching? thanks, greg k-h