lkml.org 
[lkml]   [2022]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for quad-uart support
On Fri, Dec 16, 2022 at 09:30:42AM +0000, Tharunkumar.Pasumarthi@microchip.com wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Friday, December 16, 2022 1:56 PM

...

> > > > > + pci_iounmap(pdev, priv->membase);
> > > >
> > > > Here is inconsistency on how you interpret pci_*() calls when
> > > > pcim_enable_device() has been used. I.e. for IRQ you don't
> > > > deallocate resources explicitly (yes, it's done automatically
> > > > anyway), but you explicitly call pci_iounmap(). Choose a single approach
> > for all of them.
> > >
> > > AFAIK call to pci_iounmap cannot be avoided since pci_ioremap_bar is not
> > 'managed' API.
> > > You suggest calling pci_free_irq_vectors (even though it is not mandatory)?
> >
> > Why is it not mandatory?
>
> Following is the reason why I felt calling pci_free_irq_vectors is not
> mandatory. Correct me if my understanding is wrong.
>
> Following is the Callback Sequence (from 6.1 kernel) that gets executed upon
> calling pci_alloc_irq_vectors:
> pci_alloc_irq_vectors =>
> pci_alloc_irq_vectors_affinity =>
> __pci_enable_msi_range =>
> pci_setup_msi_context =>
> pcim_setup_msi_release =>
>
> devm_add_action(&dev->dev, pcim_msi_release, dev);
>
> Inside pcim_msi_release: (called since pcim_enable_device is used)
> pci_free_irq_vectors(dev);
>
> From this sequence, it seemed like, kernel takes care of freeing irq and
> calling pci_free_irq_vectors is not required.

Technically you are correct, but... read this discussion, and pay attention to
what Christoph said there:

https://lore.kernel.org/linux-serial/0250c46e-da6c-71f3-50ae-b7c17fd0bd2c@siemens.com/

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-12-16 10:39    [W:0.053 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site