Commit 9083e0b0 authored by Markus Schneider-Pargmann's avatar Markus Schneider-Pargmann Committed by Marc Kleine-Budde
Browse files

can: m_can: Keep interrupts enabled during peripheral read



Interrupts currently get disabled if the interrupt status shows new
received data. Non-peripheral chips handle receiving in a worker thread,
but peripheral chips are handling the receive process in the threaded
interrupt routine itself without scheduling it for a different worker.
So there is no need to disable interrupts for peripheral chips.

Signed-off-by: default avatarMarkus Schneider-Pargmann <msp@baylibre.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/all/20230315110546.2518305-6-msp@baylibre.com


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 897e6632
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -972,8 +972,8 @@ static int m_can_rx_peripheral(struct net_device *dev, u32 irqstatus)
	/* Don't re-enable interrupts if the driver had a fatal error
	 * (e.g., FIFO read failure).
	 */
	if (work_done >= 0)
		m_can_enable_all_interrupts(cdev);
	if (work_done < 0)
		m_can_disable_all_interrupts(cdev);

	return work_done;
}
@@ -1095,12 +1095,13 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
	 */
	if ((ir & IR_RF0N) || (ir & IR_ERR_ALL_30X)) {
		cdev->irqstatus = ir;
		if (!cdev->is_peripheral) {
			m_can_disable_all_interrupts(cdev);
		if (!cdev->is_peripheral)
			napi_schedule(&cdev->napi);
		else if (m_can_rx_peripheral(dev, ir) < 0)
		} else if (m_can_rx_peripheral(dev, ir) < 0) {
			goto out_fail;
		}
	}

	if (cdev->version == 30) {
		if (ir & IR_TC) {