Re: [PATCH] PCI: Remove pci_try_set_mwi
From: Andy Shevchenko
Date: Fri Mar 26 2021 - 17:44:08 EST
On Fri, Mar 26, 2021 at 04:26:55PM -0500, Bjorn Helgaas wrote:
> [+cc Randy, Andrew (though I'm sure you have zero interest in this
> ancient question :))]
>
> On Wed, Dec 09, 2020 at 09:31:21AM +0100, Heiner Kallweit wrote:
> > pci_set_mwi() and pci_try_set_mwi() do exactly the same, just that the
> > former one is declared as __must_check. However also some callers of
> > pci_set_mwi() have a comment that it's an optional feature. I don't
> > think there's much sense in this separation and the use of
> > __must_check. Therefore remove pci_try_set_mwi() and remove the
> > __must_check attribute from pci_set_mwi().
> > I don't expect either function to be used in new code anyway.
>
> There's not much I like better than removing things. But some
> significant thought went into adding pci_try_set_mwi() in the first
> place, so I need a little more convincing about why it's safe to
> remove it.
>
> The argument should cite the discussion about adding it. I think one
> of the earliest conversations is here:
> https://lore.kernel.org/linux-ide/20070404213704.224128ec.randy.dunlap@xxxxxxxxxx/
It's solely PCI feature which is absent on PCIe.
So, if there is a guarantee that the driver never services a device connected
to old PCI bus, it's okay to remove the call (it's no-op on PCIe anyway).
OTOH, PCI core may try MWI itself for every device (but this is an opposite,
what should we do on broken devices that do change their state based on that
bit while violating specification).
In any case
Acked-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
for DesignWare DMA case. I have added that and I never saw that IP connected
to the old PCI.
--
With Best Regards,
Andy Shevchenko