lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YC5zVHnRog3EX0rl@smile.fi.intel.com>
Date:   Thu, 18 Feb 2021 16:01:56 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Robert Richter <rric@...nel.org>
Cc:     Dejin Zheng <zhengdejin5@...il.com>, corbet@....net,
        jarkko.nikula@...ux.intel.com, mika.westerberg@...ux.intel.com,
        bhelgaas@...gle.com, wsa@...nel.org, linux-doc@...r.kernel.org,
        linux-i2c@...r.kernel.org, linux-pci@...r.kernel.org, kw@...ux.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 0/4] Introduce pcim_alloc_irq_vectors()

On Thu, Feb 18, 2021 at 10:36:28AM +0100, Robert Richter wrote:
> On 17.02.21 00:02:45, Dejin Zheng wrote:
> > Introduce pcim_alloc_irq_vectors(), a device-managed version of
> > pci_alloc_irq_vectors(), In some i2c drivers, If pcim_enable_device()
> > has been called before, then pci_alloc_irq_vectors() is actually a
> > device-managed function. It is used as a device-managed function, So
> > replace it with pcim_alloc_irq_vectors().
> > 
> > Changelog
> > ---------
> > v2 -> v3:
> > 	- Add some commit comments for replace some codes in
> > 	  pcim_release() by pci_free_irq_vectors().
> > 	- Simplify the error handling path in i2c designware
> > 	  driver.
> > v1 -> v2:
> > 	- Use pci_free_irq_vectors() to replace some code in
> > 	  pcim_release().
> > 	- Modify some commit messages.
> > 
> > Dejin Zheng (4):
> >   PCI: Introduce pcim_alloc_irq_vectors()
> >   Documentation: devres: Add pcim_alloc_irq_vectors()
> 
> This is already taken care of, see pcim_release():
> 
>         if (dev->msi_enabled)
>                 pci_disable_msi(dev);
>         if (dev->msix_enabled)
>                 pci_disable_msix(dev);
> 
> Activated when used with pcim_enable_device().
> 
> This series is not required.

The problem this series solves is an imbalanced API.
Christoph IIRC was clear that if we want to use PCI IRQ allocation API the
caller must know what's going on. Hiding this behind the scenes is not good.
And this series unhides that.

Also, you may go and clean up all pci_free_irq_vectors() when
pcim_enable_device() is called, but I guess you will get painful process and
rejection in a pile of cases.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ