Commit 782d1222 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'spi-fix-v5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A small collection of driver specific fixes, the fsl-espi and bcm-qspi
  changes in particular have been causing breakage for users"

* tag 'spi-fix-v5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: bcm-qspi: Fix probe regression on iProc platforms
  spi: fsl-dspi: fix use-after-free in remove path
  spi: fsl-espi: Only process interrupts for expected events
  spi: bcm2835: Make polling_limit_us static
  spi: spi-fsl-dspi: use XSPI mode instead of DMA for DPAA2 SoCs
parents 814324b5 00fb259c
...@@ -1295,7 +1295,7 @@ static const struct of_device_id bcm_qspi_of_match[] = { ...@@ -1295,7 +1295,7 @@ static const struct of_device_id bcm_qspi_of_match[] = {
}, },
{ {
.compatible = "brcm,spi-bcm-qspi", .compatible = "brcm,spi-bcm-qspi",
.data = &bcm_qspi_rev_data, .data = &bcm_qspi_no_rev_data,
}, },
{ {
.compatible = "brcm,spi-bcm7216-qspi", .compatible = "brcm,spi-bcm7216-qspi",
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
#define DRV_NAME "spi-bcm2835" #define DRV_NAME "spi-bcm2835"
/* define polling limits */ /* define polling limits */
unsigned int polling_limit_us = 30; static unsigned int polling_limit_us = 30;
module_param(polling_limit_us, uint, 0664); module_param(polling_limit_us, uint, 0664);
MODULE_PARM_DESC(polling_limit_us, MODULE_PARM_DESC(polling_limit_us,
"time in us to run a transfer in polling mode\n"); "time in us to run a transfer in polling mode\n");
......
...@@ -174,17 +174,17 @@ static const struct fsl_dspi_devtype_data devtype_data[] = { ...@@ -174,17 +174,17 @@ static const struct fsl_dspi_devtype_data devtype_data[] = {
.fifo_size = 16, .fifo_size = 16,
}, },
[LS2080A] = { [LS2080A] = {
.trans_mode = DSPI_DMA_MODE, .trans_mode = DSPI_XSPI_MODE,
.max_clock_factor = 8, .max_clock_factor = 8,
.fifo_size = 4, .fifo_size = 4,
}, },
[LS2085A] = { [LS2085A] = {
.trans_mode = DSPI_DMA_MODE, .trans_mode = DSPI_XSPI_MODE,
.max_clock_factor = 8, .max_clock_factor = 8,
.fifo_size = 4, .fifo_size = 4,
}, },
[LX2160A] = { [LX2160A] = {
.trans_mode = DSPI_DMA_MODE, .trans_mode = DSPI_XSPI_MODE,
.max_clock_factor = 8, .max_clock_factor = 8,
.fifo_size = 4, .fifo_size = 4,
}, },
...@@ -1273,11 +1273,14 @@ static int dspi_probe(struct platform_device *pdev) ...@@ -1273,11 +1273,14 @@ static int dspi_probe(struct platform_device *pdev)
void __iomem *base; void __iomem *base;
bool big_endian; bool big_endian;
ctlr = spi_alloc_master(&pdev->dev, sizeof(struct fsl_dspi)); dspi = devm_kzalloc(&pdev->dev, sizeof(*dspi), GFP_KERNEL);
if (!dspi)
return -ENOMEM;
ctlr = spi_alloc_master(&pdev->dev, 0);
if (!ctlr) if (!ctlr)
return -ENOMEM; return -ENOMEM;
dspi = spi_controller_get_devdata(ctlr);
dspi->pdev = pdev; dspi->pdev = pdev;
dspi->ctlr = ctlr; dspi->ctlr = ctlr;
...@@ -1414,7 +1417,7 @@ static int dspi_probe(struct platform_device *pdev) ...@@ -1414,7 +1417,7 @@ static int dspi_probe(struct platform_device *pdev)
if (dspi->devtype_data->trans_mode != DSPI_DMA_MODE) if (dspi->devtype_data->trans_mode != DSPI_DMA_MODE)
ctlr->ptp_sts_supported = true; ctlr->ptp_sts_supported = true;
platform_set_drvdata(pdev, ctlr); platform_set_drvdata(pdev, dspi);
ret = spi_register_controller(ctlr); ret = spi_register_controller(ctlr);
if (ret != 0) { if (ret != 0) {
...@@ -1437,8 +1440,7 @@ static int dspi_probe(struct platform_device *pdev) ...@@ -1437,8 +1440,7 @@ static int dspi_probe(struct platform_device *pdev)
static int dspi_remove(struct platform_device *pdev) static int dspi_remove(struct platform_device *pdev)
{ {
struct spi_controller *ctlr = platform_get_drvdata(pdev); struct fsl_dspi *dspi = platform_get_drvdata(pdev);
struct fsl_dspi *dspi = spi_controller_get_devdata(ctlr);
/* Disconnect from the SPI framework */ /* Disconnect from the SPI framework */
spi_unregister_controller(dspi->ctlr); spi_unregister_controller(dspi->ctlr);
......
...@@ -564,13 +564,14 @@ static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events) ...@@ -564,13 +564,14 @@ static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events)
static irqreturn_t fsl_espi_irq(s32 irq, void *context_data) static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)
{ {
struct fsl_espi *espi = context_data; struct fsl_espi *espi = context_data;
u32 events; u32 events, mask;
spin_lock(&espi->lock); spin_lock(&espi->lock);
/* Get interrupt events(tx/rx) */ /* Get interrupt events(tx/rx) */
events = fsl_espi_read_reg(espi, ESPI_SPIE); events = fsl_espi_read_reg(espi, ESPI_SPIE);
if (!events) { mask = fsl_espi_read_reg(espi, ESPI_SPIM);
if (!(events & mask)) {
spin_unlock(&espi->lock); spin_unlock(&espi->lock);
return IRQ_NONE; return IRQ_NONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment