From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Kartik Rajput <kkartik@nvidia.com>,
gregkh@linuxfoundation.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, thierry.reding@gmail.com,
jonathanh@nvidia.com, hvilleneuve@dimonoff.com, arnd@kernel.org,
geert+renesas@glider.be, robert.marko@sartura.hr,
schnelle@linux.ibm.com, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org, devicetree@vger.kernel.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH v2 2/2] serial: tegra-utc: Add driver for Tegra UART Trace Controller (UTC)
Date: Tue, 11 Feb 2025 11:46:01 +0200 [thread overview]
Message-ID: <Z6scWdm-vghMPy5S@smile.fi.intel.com> (raw)
In-Reply-To: <974ae61f-6883-40fb-b5b1-27139c0f07df@kernel.org>
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
next prev parent reply other threads:[~2025-02-11 9:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 6:19 [PATCH v2 0/2] Add support for Tegra UART Trace Controller (UTC) client Kartik Rajput
2025-02-11 6:19 ` [PATCH v2 1/2] dt-bindings: serial: Add bindings for nvidia,tegra264-utc Kartik Rajput
2025-02-11 6:19 ` [PATCH v2 2/2] serial: tegra-utc: Add driver for Tegra UART Trace Controller (UTC) Kartik Rajput
2025-02-11 7:23 ` Jiri Slaby
2025-02-11 9:46 ` Andy Shevchenko [this message]
2025-02-12 9:55 ` Kartik Rajput
2025-02-11 10:01 ` Andy Shevchenko
2025-02-11 10:04 ` Andy Shevchenko
2025-02-12 10:02 ` Kartik Rajput
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=Z6scWdm-vghMPy5S@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=hvilleneuve@dimonoff.com \
--cc=jirislaby@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kkartik@nvidia.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=robert.marko@sartura.hr \
--cc=robh@kernel.org \
--cc=schnelle@linux.ibm.com \
--cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.