[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 00/11] PCI: Drop duplicated tracking of a pci_dev's bound driver
- To: Bjorn Helgaas <helgaas@xxxxxxxxxx>
- From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
- Date: Wed, 13 Oct 2021 16:23:09 +0300
- Cc: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>, linux-pci <linux-pci@xxxxxxxxxxxxxxx>, Sascha Hauer <kernel@xxxxxxxxxxxxxx>, Alexander Duyck <alexanderduyck@xxxxxx>, Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Andrew Donnellan <ajd@xxxxxxxxxxxxx>, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Fiona Trahe <fiona.trahe@xxxxxxxxx>, Frederic Barrat <fbarrat@xxxxxxxxxxxxx>, Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Ido Schimmel <idosch@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Jack Xu <jack.xu@xxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Jesse Brandeburg <jesse.brandeburg@xxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>, Jiri Pirko <jiri@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Marco Chiappero <marco.chiappero@xxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Mathias Nyman <mathias.nyman@xxxxxxxxx>, Michael Buesch <m@xxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Namhyung Kim <namhyung@xxxxxxxxxx>, Oliver O'Halloran <oohall@xxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Rafał Miłecki <zajec5@xxxxxxxxx>, Russell Currey <ruscur@xxxxxxxxxx>, Salil Mehta <salil.mehta@xxxxxxxxxx>, Sathya Prakash <sathya.prakash@xxxxxxxxxxxx>, Simon Horman <simon.horman@xxxxxxxxxxxx>, Sreekanth Reddy <sreekanth.reddy@xxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Suganath Prabu Subramani <suganath-prabu.subramani@xxxxxxxxxxxx>, Taras Chornyi <tchornyi@xxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Tomaszx Kowalik <tomaszx.kowalik@xxxxxxxxx>, Vadym Kochan <vkochan@xxxxxxxxxxx>, Wojciech Ziemba <wojciech.ziemba@xxxxxxxxx>, Yisen Zhuang <yisen.zhuang@xxxxxxxxxx>, Zhou Wang <wangzhou1@xxxxxxxxxxxxx>, linux-crypto <linux-crypto@xxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, linux-perf-users@xxxxxxxxxxxxxxx, "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" <linuxppc-dev@xxxxxxxxxxxxxxxx>, linux-scsi <linux-scsi@xxxxxxxxxxxxxxx>, USB <linux-usb@xxxxxxxxxxxxxxx>, "open list:TI WILINK WIRELES..." <linux-wireless@xxxxxxxxxxxxxxx>, MPT-FusionLinux.pdl@xxxxxxxxxxxx, netdev <netdev@xxxxxxxxxxxxxxx>, oss-drivers@xxxxxxxxxxxx, qat-linux@xxxxxxxxx, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 13 Oct 2021 13:23:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxxxx> wrote:
> > > On Mon, Oct 04, 2021 at 02:59:24PM +0200, Uwe Kleine-König wrote:
...
> > It's a bit unusual. Other to_*_dev() are not NULL-aware IIRC.
>
> It is a little unusual. I only found three of 77 that are NULL-aware:
>
> to_moxtet_driver()
> to_siox_driver()
> to_spi_driver()
>
> It seems worthwhile to me because it makes the patch and the resulting
> code significantly cleaner.
I'm not objecting the change, just a remark.
...
> > > + for (id = drv ? drv->id_table : NULL; id && id->vendor; id++)
> > > + if (id->vendor == vendor && id->device == device)
> >
> > > + break;
> >
> > return true;
> >
> > > return id && id->vendor;
> >
> > return false;
>
> Good cleanup for a follow-up patch, but doesn't seem directly related
> to the objective here.
True. Maybe you can bake one while not forgotten?
...
> > > + 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?
...
> > > + 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;
?
...
> > 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.
--
With Best Regards,
Andy Shevchenko
|