linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tharunkumar.Pasumarthi@microchip.com
Cc: Kumaravel.Thiagarajan@microchip.com,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	gregkh@linuxfoundation.org, jirislaby@kernel.org,
	ilpo.jarvinen@linux.intel.com, macro@orcam.me.uk,
	cang1@live.co.uk, colin.i.king@gmail.com,
	phil.edworthy@renesas.com, biju.das.jz@bp.renesas.com,
	geert+renesas@glider.be, lukas@wunner.de,
	u.kleine-koenig@pengutronix.de, wander@redhat.com,
	etremblay@distech-controls.com, jk@ozlabs.org,
	UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v9 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for quad-uart support
Date: Fri, 16 Dec 2022 10:26:07 +0200	[thread overview]
Message-ID: <Y5wrnzLMv5SCWPkn@smile.fi.intel.com> (raw)
In-Reply-To: <PH7PR11MB5958DF2284FDC67FA7018E9B9BE69@PH7PR11MB5958.namprd11.prod.outlook.com>

On Fri, Dec 16, 2022 at 05:40:31AM +0000, Tharunkumar.Pasumarthi@microchip.com wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Thursday, December 15, 2022 11:13 PM

...

> > > +     ret = serial8250_pci_setup_port(pdev, port, 0, port_idx * 256,
> > > + 0);
> > 
> > Actually isn't 0x100 better (show that there is an offset rather than a value of
> > an register)?
> 
> Okay, I will so something like this,
> #define PORT_OFFSET 0x100
> ret = serial8250_pci_setup_port(pdev, port, 0, PORT_OFFSET * port_idx, 0);

Makes sense.

...

> > > +     num_vectors = pci_alloc_irq_vectors(pdev, 1, max_vec_reqd,
> > PCI_IRQ_ALL_TYPES);
> > > +     if (num_vectors < 0) {
> > 
> > > +             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?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-12-16  8:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  5:26 [PATCH v9 tty-next 0/4] serial: 8250_pci1xxxx: Add driver for the pci1xxxx's quad-uart function Kumaravel Thiagarajan
2022-12-16  5:26 ` [PATCH v9 tty-next 1/4] serial: 8250_pci: Add serial8250_pci_setup_port definition in 8250_pcilib.c Kumaravel Thiagarajan
2022-12-16  5:26 ` [PATCH v9 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for quad-uart support Kumaravel Thiagarajan
2022-12-15 17:42   ` Andy Shevchenko
2022-12-15 17:44     ` Andy Shevchenko
2022-12-16  5:40     ` Tharunkumar.Pasumarthi
2022-12-16  8:26       ` Andy Shevchenko [this message]
2022-12-16  9:30         ` Tharunkumar.Pasumarthi
2022-12-16  9:38           ` Andy Shevchenko
2022-12-16 10:31             ` Tharunkumar.Pasumarthi
2022-12-16 13:29               ` Andy Shevchenko
2022-12-16  5:26 ` [PATCH v9 tty-next 3/4] serial: 8250_pci1xxxx: Add RS485 support to quad-uart driver Kumaravel Thiagarajan
2022-12-16  5:26 ` [PATCH v9 tty-next 4/4] serial: 8250_pci1xxxx: Add power management functions " Kumaravel Thiagarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5wrnzLMv5SCWPkn@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Kumaravel.Thiagarajan@microchip.com \
    --cc=Tharunkumar.Pasumarthi@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cang1@live.co.uk \
    --cc=colin.i.king@gmail.com \
    --cc=etremblay@distech-controls.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=jk@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=macro@orcam.me.uk \
    --cc=phil.edworthy@renesas.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wander@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).