All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-pci <linux-pci@vger.kernel.org>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Alexander Duyck" <alexanderduyck@fb.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Andrew Donnellan" <ajd@linux.ibm.com>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Fiona Trahe" <fiona.trahe@intel.com>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Giovanni Cabiddu" <giovanni.cabiddu@intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Ingo Molnar" <mingo@redhat.com>, "Jack Xu" <jack.xu@intel.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Jesse Brandeburg" <jesse.brandeburg@intel.com>,
	"Jiri Olsa" <jolsa@redhat.com>, "Jiri Pirko" <jiri@nvidia.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Marco Chiappero" <marco.chiappero@intel.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Mathias Nyman" <mathias.nyman@intel.com>,
	"Michael Buesch" <m@bues.ch>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Russell Currey" <ruscur@russell.cc>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"Sathya Prakash" <sathya.prakash@broadcom.com>,
	"Simon Horman" <simon.horman@corigine.com>,
	"Sreekanth Reddy" <sreekanth.reddy@broadcom.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Suganath Prabu Subramani"
	<suganath-prabu.subramani@broadcom.com>,
	"Taras Chornyi" <tchornyi@marvell.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Tomaszx Kowalik" <tomaszx.kowalik@intel.com>,
	"Vadym Kochan" <vkochan@marvell.com>,
	"Wojciech Ziemba" <wojciech.ziemba@intel.com>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Zhou Wang" <wangzhou1@hisilicon.com>,
	linux-crypto <linux-crypto@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org,
	"open list:LINUX FOR POWERPC PA SEMI PWRFICIENT"
	<linuxppc-dev@lists.ozlabs.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	USB <linux-usb@vger.kernel.org>,
	"open list:TI WILINK WIRELES..." <linux-wireless@vger.kernel.org>,
	MPT-FusionLinux.pdl@broadcom.com, netdev <netdev@vger.kernel.org>,
	oss-drivers@corigine.com, qat-linux@intel.com,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver
Date: Fri, 15 Oct 2021 11:46:53 -0500	[thread overview]
Message-ID: <20211015164653.GA2108651@bhelgaas> (raw)
In-Reply-To: <YWbdvc7EWEZLVTHM@smile.fi.intel.com>

On Wed, Oct 13, 2021 at 04:23:09PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 13, 2021 at 06:33:56AM -0500, Bjorn Helgaas wrote:
> > On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote:
> > > On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:

> > > > +       return drv && drv->resume ?
> > > > +                       drv->resume(pci_dev) : pci_pm_reenable_device(pci_dev);
> > > 
> > > One line?
> > 
> > I don't think I touched that line.
> 
> Then why they are both in + section?

They're both in the + section of the interdiff because Uwe's v6 patch
looks like this:

  static int pci_legacy_resume(struct device *dev)
  {
          struct pci_dev *pci_dev = to_pci_dev(dev);
  -       return drv && drv->resume ?
  -                       drv->resume(pci_dev) : pci_pm_reenable_device(pci_dev);
  +       if (pci_dev->dev.driver) {
  +               struct pci_driver *drv = to_pci_driver(pci_dev->dev.driver);
  +
  +               if (drv->resume)
  +                       return drv->resume(pci_dev);
  +       }
  +
  +       return pci_pm_reenable_device(pci_dev);

and my revision looks like this:

   static int pci_legacy_resume(struct device *dev)
   {
	  struct pci_dev *pci_dev = to_pci_dev(dev);
  -       struct pci_driver *drv = pci_dev->driver;
  +       struct pci_driver *drv = to_pci_driver(dev->driver);

so compared to Uwe's v6, I restored that section to the original code.
My goal here was to make the patch as simple and easy to review as
possible.

> > > > +       struct pci_driver *drv = to_pci_driver(dev->dev.driver);
> > > >         const struct pci_error_handlers *err_handler =
> > > > -                       dev->dev.driver ? to_pci_driver(dev->dev.driver)->err_handler : NULL;
> > > > +                       drv ? drv->err_handler : NULL;
> > > 
> > > Isn't dev->driver == to_pci_driver(dev->dev.driver)?
> > 
> > Yes, I think so, but not sure what you're getting at here, can you
> > elaborate?
> 
> Getting pointer from another pointer seems waste of resources, why we
> can't simply
> 
> 	struct pci_driver *drv = dev->driver;

I think this is in pci_dev_save_and_disable(), and "dev" here is a
struct pci_dev *.  We're removing the dev->driver member.  Let me know
if I'm still missing something.

> > > > -                               "bad request in aer recovery "
> > > > -                               "operation!\n");
> > > > +                               "bad request in AER recovery operation!\n");

> > > Stray change? Or is it in a separate patch in your tree?
> > 
> > Could be skipped.  The string now fits on one line so I combined it to
> > make it more greppable.
> 
> This is inconsistency in your changes, in one case you are objecting of
> doing something close to the changed lines, in the other you are doing
> unrelated change.

You're right, this didn't make much sense in that patch.  I moved the
line join to the previous patch, which unindented this section and
made space for this to fit on one line.  Here's the revised commit:

  https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?id=34ab316d7287


WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Giovanni Cabiddu" <giovanni.cabiddu@intel.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Sathya Prakash" <sathya.prakash@broadcom.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Alexander Duyck" <alexanderduyck@fb.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>,
	qat-linux@intel.com, oss-drivers@corigine.com,
	"Oliver O'Halloran" <oohall@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>, "Jiri Olsa" <jolsa@redhat.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Marco Chiappero" <marco.chiappero@intel.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Jesse Brandeburg" <jesse.brandeburg@intel.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	linux-pci <linux-pci@vger.kernel.org>,
	"open list:TI WILINK WIRELES..." <linux-wireless@vger.kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	"Suganath Prabu Subramani"
	<suganath-prabu.subramani@broadcom.com>,
	"Fiona Trahe" <fiona.trahe@intel.com>,
	"Andrew Donnellan" <ajd@linux.ibm.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Simon Horman" <simon.horman@corigine.com>,
	"open list:LINUX FOR POWERPC PA SEMI PWRFICIENT"
	<linuxppc-dev@lists.ozlabs.org>,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Jack Xu" <jack.xu@intel.com>, "Borislav Petkov" <bp@alien8.de>,
	"Michael Buesch" <m@bues.ch>, "Jiri Pirko" <jiri@nvidia.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Namhyung Kim" <namhyung@kernel.org>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	"Sreekanth Reddy" <sreekanth.reddy@broadcom.com>,
	xen-devel@lists.xenproject.org,
	"Vadym Kochan" <vkochan@marvell.com>,
	MPT-FusionLinux.pdl@broadcom.com,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	USB <linux-usb@vger.kernel.org>,
	"Wojciech Ziemba" <wojciech.ziemba@intel.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Mathias Nyman" <mathias.nyman@intel.com>,
	"Zhou Wang" <wangzhou1@hisilicon.com>,
	linux-crypto <linux-crypto@vger.kernel.org>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	netdev <netdev@vger.kernel.org>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Tomaszx Kowalik" <tomaszx.kowalik@intel.com>,
	"Taras Chornyi" <tchornyi@marvell.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver
Date: Fri, 15 Oct 2021 11:46:53 -0500	[thread overview]
Message-ID: <20211015164653.GA2108651@bhelgaas> (raw)
In-Reply-To: <YWbdvc7EWEZLVTHM@smile.fi.intel.com>

On Wed, Oct 13, 2021 at 04:23:09PM +0300, Andy Shevchenko wrote:
> On Wed, Oct 13, 2021 at 06:33:56AM -0500, Bjorn Helgaas wrote:
> > On Wed, Oct 13, 2021 at 12:26:42PM +0300, Andy Shevchenko wrote:
> > > On Wed, Oct 13, 2021 at 2:33 AM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:

> > > > +       return drv && drv->resume ?
> > > > +                       drv->resume(pci_dev) : pci_pm_reenable_device(pci_dev);
> > > 
> > > One line?
> > 
> > I don't think I touched that line.
> 
> Then why they are both in + section?

They're both in the + section of the interdiff because Uwe's v6 patch
looks like this:

  static int pci_legacy_resume(struct device *dev)
  {
          struct pci_dev *pci_dev = to_pci_dev(dev);
  -       return drv && drv->resume ?
  -                       drv->resume(pci_dev) : pci_pm_reenable_device(pci_dev);
  +       if (pci_dev->dev.driver) {
  +               struct pci_driver *drv = to_pci_driver(pci_dev->dev.driver);
  +
  +               if (drv->resume)
  +                       return drv->resume(pci_dev);
  +       }
  +
  +       return pci_pm_reenable_device(pci_dev);

and my revision looks like this:

   static int pci_legacy_resume(struct device *dev)
   {
	  struct pci_dev *pci_dev = to_pci_dev(dev);
  -       struct pci_driver *drv = pci_dev->driver;
  +       struct pci_driver *drv = to_pci_driver(dev->driver);

so compared to Uwe's v6, I restored that section to the original code.
My goal here was to make the patch as simple and easy to review as
possible.

> > > > +       struct pci_driver *drv = to_pci_driver(dev->dev.driver);
> > > >         const struct pci_error_handlers *err_handler =
> > > > -                       dev->dev.driver ? to_pci_driver(dev->dev.driver)->err_handler : NULL;
> > > > +                       drv ? drv->err_handler : NULL;
> > > 
> > > Isn't dev->driver == to_pci_driver(dev->dev.driver)?
> > 
> > Yes, I think so, but not sure what you're getting at here, can you
> > elaborate?
> 
> Getting pointer from another pointer seems waste of resources, why we
> can't simply
> 
> 	struct pci_driver *drv = dev->driver;

I think this is in pci_dev_save_and_disable(), and "dev" here is a
struct pci_dev *.  We're removing the dev->driver member.  Let me know
if I'm still missing something.

> > > > -                               "bad request in aer recovery "
> > > > -                               "operation!\n");
> > > > +                               "bad request in AER recovery operation!\n");

> > > Stray change? Or is it in a separate patch in your tree?
> > 
> > Could be skipped.  The string now fits on one line so I combined it to
> > make it more greppable.
> 
> This is inconsistency in your changes, in one case you are objecting of
> doing something close to the changed lines, in the other you are doing
> unrelated change.

You're right, this didn't make much sense in that patch.  I moved the
line join to the previous patch, which unindented this section and
made space for this to fit on one line.  Here's the revised commit:

  https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?id=34ab316d7287


  reply	other threads:[~2021-10-15 16:46 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 12:59 [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-10-04 12:59 ` Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 01/11] PCI: Simplify pci_device_remove() Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 02/11] PCI: Drop useless check from pci_device_probe() Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 03/11] xen/pci: Drop some checks that are always true Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 04/11] bcma: simplify reference to the driver's name Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 05/11] powerpc/eeh: Don't use driver member of struct pci_dev and further cleanups Uwe Kleine-König
2021-10-04 12:59   ` Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 06/11] ssb: Simplify determination of driver name Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 07/11] PCI: Replace pci_dev::driver usage that gets the " Uwe Kleine-König
2021-10-04 12:59   ` Uwe Kleine-König
2021-10-04 16:06   ` Ido Schimmel
2021-10-04 16:06     ` Ido Schimmel
2021-10-04 12:59 ` [PATCH v6 08/11] scsi: message: fusion: Remove unused parameter of mpt_pci driver's probe() Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 09/11] crypto: qat - simplify adf_enable_aer() Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 10/11] PCI: Replace pci_dev::driver usage by pci_dev::dev.driver Uwe Kleine-König
2021-10-04 12:59   ` Uwe Kleine-König
2021-10-04 12:59 ` [PATCH v6 11/11] PCI: Drop duplicated tracking of a pci_dev's bound driver Uwe Kleine-König
2021-10-12 23:32 ` [PATCH v6 00/11] " Bjorn Helgaas
2021-10-12 23:32   ` Bjorn Helgaas
2021-10-13  8:51   ` Uwe Kleine-König
2021-10-13  8:51     ` Uwe Kleine-König
2021-10-13 10:54     ` Bjorn Helgaas
2021-10-13 10:54       ` Bjorn Helgaas
2021-10-13 10:58       ` Uwe Kleine-König
2021-10-13 10:58         ` Uwe Kleine-König
2021-10-13  9:26   ` Andy Shevchenko
2021-10-13  9:26     ` Andy Shevchenko
2021-10-13 11:33     ` Bjorn Helgaas
2021-10-13 11:33       ` Bjorn Helgaas
2021-10-13 13:23       ` Andy Shevchenko
2021-10-13 13:23         ` Andy Shevchenko
2021-10-15 16:46         ` Bjorn Helgaas [this message]
2021-10-15 16:46           ` Bjorn Helgaas
2021-10-15 19:52           ` Andy Shevchenko
2021-10-15 19:52             ` Andy Shevchenko

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=20211015164653.GA2108651@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=acme@kernel.org \
    --cc=ajd@linux.ibm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexanderduyck@fb.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=fbarrat@linux.ibm.com \
    --cc=fiona.trahe@intel.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=idosch@nvidia.com \
    --cc=jack.xu@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=jgross@suse.com \
    --cc=jiri@nvidia.com \
    --cc=jolsa@redhat.com \
    --cc=kernel@pengutronix.de \
    --cc=konrad.wilk@oracle.com \
    --cc=kuba@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m@bues.ch \
    --cc=marco.chiappero@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=mathias.nyman@intel.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=namhyung@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oohall@gmail.com \
    --cc=oss-drivers@corigine.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=qat-linux@intel.com \
    --cc=ruscur@russell.cc \
    --cc=salil.mehta@huawei.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=simon.horman@corigine.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=sstabellini@kernel.org \
    --cc=suganath-prabu.subramani@broadcom.com \
    --cc=tchornyi@marvell.com \
    --cc=tglx@linutronix.de \
    --cc=tomaszx.kowalik@intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkochan@marvell.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=wojciech.ziemba@intel.com \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yisen.zhuang@huawei.com \
    --cc=zajec5@gmail.com \
    /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.