[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6scWdm-vghMPy5S@smile.fi.intel.com>
Date: Tue, 11 Feb 2025 11:46:01 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Jiri Slaby <jirislaby@...nel.org>
Cc: Kartik Rajput <kkartik@...dia.com>, gregkh@...uxfoundation.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
thierry.reding@...il.com, jonathanh@...dia.com,
hvilleneuve@...onoff.com, arnd@...nel.org, geert+renesas@...der.be,
robert.marko@...tura.hr, schnelle@...ux.ibm.com,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
devicetree@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH v2 2/2] serial: tegra-utc: Add driver for Tegra UART
Trace Controller (UTC)
On Tue, Feb 11, 2025 at 08:23:47AM +0100, Jiri Slaby wrote:
> On 11. 02. 25, 7:19, Kartik Rajput wrote:
...
> > +static irqreturn_t tegra_utc_isr(int irq, void *dev_id)
> > +{
> > + struct tegra_utc_port *tup = dev_id;
> > + unsigned long flags;
> > + u32 status;
> > +
> > + uart_port_lock_irqsave(&tup->port, &flags);
> > +
> > + /* Process RX_REQ and RX_TIMEOUT interrupts. */
> > + do {
> > + status = tegra_utc_rx_readl(tup, TEGRA_UTC_INTR_STATUS) & tup->rx_irqmask;
> > + if (status) {
> > + tegra_utc_rx_writel(tup, tup->rx_irqmask, TEGRA_UTC_INTR_CLEAR);
> > + tegra_utc_rx_chars(tup);
> > + }
> > + } while (status);
> > +
> > + /* Process TX_REQ interrupt. */
> > + do {
> > + status = tegra_utc_tx_readl(tup, TEGRA_UTC_INTR_STATUS) & tup->tx_irqmask;
> > + if (status) {
> > + tegra_utc_tx_writel(tup, tup->tx_irqmask, TEGRA_UTC_INTR_CLEAR);
> > + tegra_utc_tx_chars(tup);
> > + }
> > + } while (status);
> > +
> > + uart_port_unlock_irqrestore(&tup->port, flags);
> > +
> > + return IRQ_HANDLED;
>
> You do not let the irq subsystem to kill this IRQ if you do not handle it
> above (in case HW gets mad, triggers IRQ, but does not set rx/tx flags).
> That is, return IRQ_HANDLED only when you really handled it (some status
> above was nonzero).
>
> > +}
I am also wondering why _irqsave / _irqrestore? Don't you have interrupts
already being disabled at this point?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists