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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A42AEC07E96 for ; Tue, 6 Jul 2021 12:44:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E97D61C7A for ; Tue, 6 Jul 2021 12:44:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238392AbhGFMqw (ORCPT ); Tue, 6 Jul 2021 08:46:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237543AbhGFMql (ORCPT ); Tue, 6 Jul 2021 08:46:41 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 823ACC028BB7 for ; Tue, 6 Jul 2021 05:21:25 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0jyQ-0001jl-7p; Tue, 06 Jul 2021 14:14:46 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1m0jyP-0001fC-Gy; Tue, 06 Jul 2021 14:14:45 +0200 Date: Tue, 6 Jul 2021 14:14:45 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Cornelia Huck Cc: Greg Kroah-Hartman , nvdimm@lists.linux.dev, Alexey Kardashevskiy , Benjamin Herrenschmidt , Samuel Iglesias Gonsalvez , Jens Taprogge , Ulf Hansson , Jaroslav Kysela , Benjamin Tissoires , Paul Mackerras , Srinivas Pandruvada , "K. Y. Srinivasan" , Mike Christie , Wei Liu , Maxim Levitsky , Samuel Holland , Michael Ellerman , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, Tomas Winkler , Julien Grall , Ohad Ben-Cohen , Alex Williamson , Alex Elder , linux-parisc@vger.kernel.org, Geoff Levand , linux-fpga@vger.kernel.org, linux-usb@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Thorsten Scherer , kernel@pengutronix.de, Jon Mason , linux-ntb@googlegroups.com, Wu Hao , David Woodhouse , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Alexandre Belloni , Manohar Vanga , linux-wireless@vger.kernel.org, Dominik Brodowski , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , target-devel@vger.kernel.org, Srinivas Kandagatla , linux-i2c@vger.kernel.org, Kai-Heng Feng , Stefano Stabellini , Stephen Hemminger , Ira Weiny , Helge Deller , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , industrypack-devel@lists.sourceforge.net, linux-mips@vger.kernel.org, Len Brown , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, Maxime Ripard , Johan Hovold , greybus-dev@lists.linaro.org, Bjorn Helgaas , Dave Jiang , Boris Ostrovsky , Mika Westerberg , linux-arm-kernel@lists.infradead.org, Johannes Thumshirn , Mathieu Poirier , Stephen Boyd , Wolfram Sang , Joey Pabalan , Yehezkel Bernat , Pali =?utf-8?B?Um9ow6Fy?= , Bodo Stroesser , Alison Schofield , Heikki Krogerus , Tyrel Datwyler , Alexander Shishkin , Tom Rix , Jason Wang , SeongJae Park , linux-hyperv@vger.kernel.org, platform-driver-x86@vger.kernel.org, Frank Li , netdev@vger.kernel.org, Qinglang Miao , Jiri Slaby , Rob Herring , Lorenzo Pieralisi , Mark Gross , linux-staging@lists.linux.dev, Dexuan Cui , Jernej Skrabec , Kishon Vijay Abraham I , Chen-Yu Tsai , linux-input@vger.kernel.org, Matt Porter , Allen Hubbe , Alex Dubov , Haiyang Zhang , Jiri Kosina , Vladimir Zapolskiy , Ben Widawsky , Moritz Fischer , linux-cxl@vger.kernel.org, Michael Buesch , Dan Williams , Mauro Carvalho Chehab , Cristian Marussi , Thomas Bogendoerfer , "Martin K. Petersen" , Martyn Welch , Dmitry Torokhov , linux-mmc@vger.kernel.org, linux-sunxi@lists.linux.dev, Stefan Richter , Sudeep Holla , "David S. Miller" , Sven Van Asbroeck , kvm@vger.kernel.org, "Michael S. Tsirkin" , linux-remoteproc@vger.kernel.org, Bjorn Andersson , Kirti Wankhede , Andreas Noever , linux-i3c@lists.infradead.org, linux1394-devel@lists.sourceforge.net, Lee Jones , Arnd Bergmann , linux-scsi@vger.kernel.org, Vishal Verma , Russell King , Andy Gross , linux-serial@vger.kernel.org, Jakub Kicinski , Michael Jamet , William Breathitt Gray , Hans de Goede , Hannes Reinecke , Adrian Hunter , Juergen Gross , linuxppc-dev@lists.ozlabs.org, Takashi Iwai , Alexandre Bounine , Vinod Koul , Mark Brown , Marc Zyngier , dmaengine@vger.kernel.org, Johannes Berg , Maximilian Luz Subject: Re: [PATCH] bus: Make remove callback return void Message-ID: <20210706121445.o3nxgi4bhzrw5w73@pengutronix.de> References: <20210706095037.1425211-1-u.kleine-koenig@pengutronix.de> <87pmvvhfqq.fsf@redhat.com> <87mtqzhesu.fsf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qlv3rwmw2vf6tbvn" Content-Disposition: inline In-Reply-To: <87mtqzhesu.fsf@redhat.com> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qlv3rwmw2vf6tbvn Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 06, 2021 at 01:17:37PM +0200, Cornelia Huck wrote: > On Tue, Jul 06 2021, Cornelia Huck wrote: >=20 > > On Tue, Jul 06 2021, Uwe Kleine-K=F6nig wrote: > > > >> The driver core ignores the return value of this callback because there > >> is only little it can do when a device disappears. > >> > >> This is the final bit of a long lasting cleanup quest where several > >> buses were converted to also return void from their remove callback. > >> Additionally some resource leaks were fixed that were caused by drivers > >> returning an error code in the expectation that the driver won't go > >> away. > >> > >> With struct bus_type::remove returning void it's prevented that newly > >> implemented buses return an ignored error code and so don't anticipate > >> wrong expectations for driver authors. > > > > Yay! > > > >> > >> Signed-off-by: Uwe Kleine-K=F6nig > >> --- > >> Hello, > >> > >> this patch depends on "PCI: endpoint: Make struct pci_epf_driver::remo= ve > >> return void" that is not yet applied, see > >> https://lore.kernel.org/r/20210223090757.57604-1-u.kleine-koenig@pengu= tronix.de. > >> > >> I tested it using allmodconfig on amd64 and arm, but I wouldn't be > >> surprised if I still missed to convert a driver. So it would be great = to > >> get this into next early after the merge window closes. > > > > I'm afraid you missed the s390-specific busses in drivers/s390/cio/ > > (css/ccw/ccwgroup). :-\ > The change for vfio/mdev looks good. >=20 > The following should do the trick for s390; not sure if other > architectures have easy-to-miss busses as well. >=20 > diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c > index 9748165e08e9..a66f416138ab 100644 > --- a/drivers/s390/cio/ccwgroup.c > +++ b/drivers/s390/cio/ccwgroup.c > @@ -439,17 +439,15 @@ module_exit(cleanup_ccwgroup); > =20 > /************************** driver stuff ******************************/ > =20 > -static int ccwgroup_remove(struct device *dev) > +static void ccwgroup_remove(struct device *dev) > { > struct ccwgroup_device *gdev =3D to_ccwgroupdev(dev); > struct ccwgroup_driver *gdrv =3D to_ccwgroupdrv(dev->driver); > =20 > if (!dev->driver) > - return 0; > + return; This is fine to be squashed into my patch. In the long run: in a remove callback dev->driver cannot be NULL, so this if could go away. > if (gdrv->remove) > gdrv->remove(gdev); > - > - return 0; > } > =20 > static void ccwgroup_shutdown(struct device *dev) > diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c > index a974943c27da..ebc321edba51 100644 > --- a/drivers/s390/cio/css.c > +++ b/drivers/s390/cio/css.c > @@ -1371,15 +1371,14 @@ static int css_probe(struct device *dev) > return ret; > } > =20 > -static int css_remove(struct device *dev) > +static void css_remove(struct device *dev) > { > struct subchannel *sch; > - int ret; > =20 > sch =3D to_subchannel(dev); > - ret =3D sch->driver->remove ? sch->driver->remove(sch) : 0; > + if (sch->driver->remove) > + sch->driver->remove(sch); Maybe the return type for this function pointer can be changed to void, too. I will add these changes to a v2 that I plan to send out after the dust settles some more. Thanks Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --qlv3rwmw2vf6tbvn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmDkSTIACgkQwfwUeK3K 7AmpKwf/cEGBSAtr38Z6g8D5Sb7wD6N+VKt79z1eeeFykI81lxaibOS1hxqeDq28 jW5itKeFVh1+cP8UVt8l7VJlvhIUO+xFsMgJ/LrRGoynkDBqMdlbTfQnZ/yOULyX KI6vecR8mDHh+M0cs+KxsmbHXtKL+WJfAnGYMVFhrq7cayZ2ZnflKlVAFFyN1iWR ewHXQduLqDi718k76IDgu9PZfUuQbRNLuX69ZAwyVl1F+BpBxMCvnMU2apcdJQ1B ovWeCbDSh+HLgMrfUAYcVddvRKo81lrMn1i24FK2RuVnrnYdupIRl3L+Y5V4D7Pd xOqLOUY6yncBK5uZwnZctg9p3aX8wA== =Zesi -----END PGP SIGNATURE----- --qlv3rwmw2vf6tbvn--