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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Thu, 8 Aug 2024 15:32:07 +0300
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> On Wed, Aug 7, 2024 at 1:10 PM Herve Codina <herve.codina@xxxxxxxxxxx> wrote:
> > On Mon, 5 Aug 2024 22:13:38 +0200
> > Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:  
> > > On Mon, Aug 5, 2024 at 12:19 PM Herve Codina <herve.codina@xxxxxxxxxxx> wrote:  
> 
> ...
> 
> > > > +       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).  
> 
> > 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?
> 
> > 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é




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux