Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-26 Thread Dejin Zheng
On Thu, Feb 25, 2021 at 10:33:53AM +0100, Robert Richter wrote: > On 23.02.21 22:14:35, Dejin Zheng wrote: > > On Tue, Feb 23, 2021 at 09:02:54AM +0100, Robert Richter wrote: > > > On 22.02.21 23:14:15, Dejin Zheng wrote: > > > > On Mon, Feb 22, 2021 at 11:56:08AM +0100, Robert Richter wrote: > >

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-25 Thread Robert Richter
On 23.02.21 22:14:35, Dejin Zheng wrote: > On Tue, Feb 23, 2021 at 09:02:54AM +0100, Robert Richter wrote: > > On 22.02.21 23:14:15, Dejin Zheng wrote: > > > On Mon, Feb 22, 2021 at 11:56:08AM +0100, Robert Richter wrote: > > > > On 20.02.21 00:46:49, Dejin Zheng wrote: > > > > > > On 18.02.21

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-23 Thread Dejin Zheng
On Tue, Feb 23, 2021 at 09:02:54AM +0100, Robert Richter wrote: > On 22.02.21 23:14:15, Dejin Zheng wrote: > > On Mon, Feb 22, 2021 at 11:56:08AM +0100, Robert Richter wrote: > > > On 20.02.21 00:46:49, Dejin Zheng wrote: > > > > > On 18.02.21 23:04:55, Dejin Zheng wrote: > > > > > > > > > + if

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-23 Thread Robert Richter
On 22.02.21 23:14:15, Dejin Zheng wrote: > On Mon, Feb 22, 2021 at 11:56:08AM +0100, Robert Richter wrote: > > On 20.02.21 00:46:49, Dejin Zheng wrote: > > > > On 18.02.21 23:04:55, Dejin Zheng wrote: > > > > > > > + if (!dr || !dr->enabled) > > > here checks whether the pci device is

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-22 Thread Dejin Zheng
On Mon, Feb 22, 2021 at 11:56:08AM +0100, Robert Richter wrote: > On 20.02.21 00:46:49, Dejin Zheng wrote: > > > On 18.02.21 23:04:55, Dejin Zheng wrote: > > > > > + if (!dr || !dr->enabled) > > here checks whether the pci device is enabled. > > What is the purpose of this? The device

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-22 Thread Robert Richter
On 19.02.21 17:15:50, Krzysztof Wilczyński wrote: > Hi Robert, > > [...] > > Obiously this is meant here: > > > > if (!pci_is_managed(dev)) > [...] > > A question to improve my understanding for future reference. Was the > previous approach of checking for "enabled" flag from struct

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-22 Thread Robert Richter
On 20.02.21 00:46:49, Dejin Zheng wrote: > > On 18.02.21 23:04:55, Dejin Zheng wrote: > > > + if (!dr || !dr->enabled) > here checks whether the pci device is enabled. What is the purpose of this? The device "is_managed" or not. -Robert

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-19 Thread Dejin Zheng
On Fri, Feb 19, 2021 at 03:40:05PM +0100, Robert Richter wrote: > On 18.02.21 23:04:55, Dejin Zheng wrote: > > Introduce pcim_alloc_irq_vectors(), a device-managed version of > > pci_alloc_irq_vectors(). Introducing this function can simplify > > the error handling path in many drivers. > > > >

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-19 Thread Krzysztof Wilczyński
Hi Robert, [...] > Obiously this is meant here: > > if (!pci_is_managed(dev)) [...] A question to improve my understanding for future reference. Was the previous approach of checking for "enabled" flag from struct pci_devres was not a good choice here? Krzysztof

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-19 Thread Robert Richter
On 19.02.21 16:48:57, Andy Shevchenko wrote: > On Fri, Feb 19, 2021 at 03:40:05PM +0100, Robert Richter wrote: > > On 18.02.21 23:04:55, Dejin Zheng wrote: > > > Introduce pcim_alloc_irq_vectors(), a device-managed version of > > > pci_alloc_irq_vectors(). Introducing this function can simplify >

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-19 Thread Andy Shevchenko
On Fri, Feb 19, 2021 at 03:40:05PM +0100, Robert Richter wrote: > On 18.02.21 23:04:55, Dejin Zheng wrote: > > Introduce pcim_alloc_irq_vectors(), a device-managed version of > > pci_alloc_irq_vectors(). Introducing this function can simplify > > the error handling path in many drivers. > > > >

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-19 Thread Robert Richter
On 19.02.21 15:40:11, Robert Richter wrote: > static inline int pcim_alloc_irq_vectors(struct pci_dev *dev, > unsigned int min_vecs, unsigned int max_vecs, unsigned int flags) > { > if (!pci_is_managed(dev, min_vecs, max_vecs, flags)) Obiously this is meant here: if

Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-19 Thread Robert Richter
On 18.02.21 23:04:55, Dejin Zheng wrote: > Introduce pcim_alloc_irq_vectors(), a device-managed version of > pci_alloc_irq_vectors(). Introducing this function can simplify > the error handling path in many drivers. > > And use pci_free_irq_vectors() to replace some code in pcim_release(), > they

[PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors()

2021-02-18 Thread Dejin Zheng
Introduce pcim_alloc_irq_vectors(), a device-managed version of pci_alloc_irq_vectors(). Introducing this function can simplify the error handling path in many drivers. And use pci_free_irq_vectors() to replace some code in pcim_release(), they are equivalent, and no functional change. It is more