Thread (19 messages) 19 messages, 3 authors, 2024-08-08

Re: [PATCH v4 1/8] misc: Add support for LAN966x PCI device

From: Herve Codina <herve.codina@bootlin.com>
Date: 2024-08-08 14:07:42
Also in: linux-devicetree, linux-pci, lkml, netdev

Hi Andy,

On Thu, 8 Aug 2024 15:32:07 +0300
Andy Shevchenko [off-list ref] wrote:
On Wed, Aug 7, 2024 at 1:10 PM Herve Codina [off-list ref] wrote:
quoted
On Mon, 5 Aug 2024 22:13:38 +0200
Andy Shevchenko [off-list ref] wrote:  
quoted
On Mon, Aug 5, 2024 at 12:19 PM Herve Codina [off-list ref] wrote:  
...
quoted
quoted
quoted
+       if (!pdev->irq)
+               return ERR_PTR(-EOPNOTSUPP);  
Before even trying to get it via APIs? (see below as well)
Also, when is it possible to have 0 here?  
pdev->irq can be 0 if the PCI device did not request any IRQ
(i.e. PCI_INTERRUPT_PIN in PCI config header is 0).  
quoted
I use that to check whether or not INTx is supported.  
But why do you need that? What happens if you get a new device that
supports let's say MSI?
quoted
Even if this code is present in the LAN966x PCI driver, it can be use as a
starting point for other drivers and may be moved to a common part in the
future.

Do you think I should remove it ?  
I think pci_alloc_vectors() should be enough. Make it to be the first
call, if you think it's better.
Thanks for your answer.

I will remove the pdev->irq check an rely pci_alloc_vectors().
Not sure that I will move the call to the first call.

Best regards.
Hervé
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help