Re: [PATCH v2 2/2] serial: tegra-utc: Add driver for Tegra UART Trace Controller (UTC)

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

 



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






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux