Skip to content

Commit ddf41bf

Browse files
Dilip Kotabroonie
authored andcommitted
spi: lantiq: Add SMP support
Existing driver supports only single core SoC. New multicore platforms uses the same driver/IP so SMP support is required. This patch adds multicore support in the driver. Signed-off-by: Dilip Kota <[email protected]> Link: https://lore.kernel.org/r/d6663296b41f102c582fda08e71f62b72ca05d5d.1594957019.git.eswara.kota@linux.intel.com Signed-off-by: Mark Brown <[email protected]>
1 parent 661ccf2 commit ddf41bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/spi/spi-lantiq-ssc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,9 @@ static void rx_request(struct lantiq_ssc_spi *spi)
622622
static irqreturn_t lantiq_ssc_xmit_interrupt(int irq, void *data)
623623
{
624624
struct lantiq_ssc_spi *spi = data;
625+
unsigned long flags;
625626

627+
spin_lock_irqsave(&spi->lock, flags);
626628
if (spi->tx) {
627629
if (spi->rx && spi->rx_todo)
628630
rx_fifo_read_full_duplex(spi);
@@ -644,10 +646,12 @@ static irqreturn_t lantiq_ssc_xmit_interrupt(int irq, void *data)
644646
}
645647
}
646648

649+
spin_unlock_irqrestore(&spi->lock, flags);
647650
return IRQ_HANDLED;
648651

649652
completed:
650653
queue_work(spi->wq, &spi->work);
654+
spin_unlock_irqrestore(&spi->lock, flags);
651655

652656
return IRQ_HANDLED;
653657
}
@@ -656,10 +660,12 @@ static irqreturn_t lantiq_ssc_err_interrupt(int irq, void *data)
656660
{
657661
struct lantiq_ssc_spi *spi = data;
658662
u32 stat = lantiq_ssc_readl(spi, LTQ_SPI_STAT);
663+
unsigned long flags;
659664

660665
if (!(stat & LTQ_SPI_STAT_ERRORS))
661666
return IRQ_NONE;
662667

668+
spin_lock_irqsave(&spi->lock, flags);
663669
if (stat & LTQ_SPI_STAT_RUE)
664670
dev_err(spi->dev, "receive underflow error\n");
665671
if (stat & LTQ_SPI_STAT_TUE)
@@ -680,6 +686,7 @@ static irqreturn_t lantiq_ssc_err_interrupt(int irq, void *data)
680686
if (spi->master->cur_msg)
681687
spi->master->cur_msg->status = -EIO;
682688
queue_work(spi->wq, &spi->work);
689+
spin_unlock_irqrestore(&spi->lock, flags);
683690

684691
return IRQ_HANDLED;
685692
}

0 commit comments

Comments
 (0)