Skip to content

Commit 8006112

Browse files
committed
Merge tag 'spi-fix-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "A few driver specific fixes, none especially remarkable, plus a MAINTAINERS file update due to the previous maintainer for the NXP FSPI driver having left the company" * tag 'spi-fix-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: cadence-quadspi: Remove spi_master_put() in probe failure path MAINTAINERS: change the NXP FSPI driver maintainer. spi: amd: Limit max transfer and message size spi: aspeed: Fix division by zero spi: aspeed: Add dev_dbg() to dump the spi-mem direct mapping descriptor
2 parents 1c49f28 + 73d5fe0 commit 8006112

4 files changed

Lines changed: 28 additions & 14 deletions

File tree

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14362,7 +14362,8 @@ S: Maintained
1436214362
F: drivers/net/phy/nxp-c45-tja11xx.c
1436314363

1436414364
NXP FSPI DRIVER
14365-
M: Ashish Kumar <ashish.kumar@nxp.com>
14365+
M: Han Xu <han.xu@nxp.com>
14366+
M: Haibo Chen <haibo.chen@nxp.com>
1436614367
R: Yogesh Gaur <yogeshgaur.83@gmail.com>
1436714368
L: linux-spi@vger.kernel.org
1436814369
S: Maintained

drivers/spi/spi-amd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#define AMD_SPI_RX_COUNT_REG 0x4B
3434
#define AMD_SPI_STATUS_REG 0x4C
3535

36+
#define AMD_SPI_FIFO_SIZE 70
3637
#define AMD_SPI_MEM_SIZE 200
3738

3839
/* M_CMD OP codes for SPI */
@@ -270,6 +271,11 @@ static int amd_spi_master_transfer(struct spi_master *master,
270271
return 0;
271272
}
272273

274+
static size_t amd_spi_max_transfer_size(struct spi_device *spi)
275+
{
276+
return AMD_SPI_FIFO_SIZE;
277+
}
278+
273279
static int amd_spi_probe(struct platform_device *pdev)
274280
{
275281
struct device *dev = &pdev->dev;
@@ -302,6 +308,8 @@ static int amd_spi_probe(struct platform_device *pdev)
302308
master->flags = SPI_MASTER_HALF_DUPLEX;
303309
master->setup = amd_spi_master_setup;
304310
master->transfer_one_message = amd_spi_master_transfer;
311+
master->max_transfer_size = amd_spi_max_transfer_size;
312+
master->max_message_size = amd_spi_max_transfer_size;
305313

306314
/* Register the controller with SPI framework */
307315
err = devm_spi_register_master(dev, master);

drivers/spi/spi-aspeed-smc.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,14 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)
558558
u32 ctl_val;
559559
int ret = 0;
560560

561+
dev_dbg(aspi->dev,
562+
"CE%d %s dirmap [ 0x%.8llx - 0x%.8llx ] OP %#x mode:%d.%d.%d.%d naddr:%#x ndummies:%#x\n",
563+
chip->cs, op->data.dir == SPI_MEM_DATA_IN ? "read" : "write",
564+
desc->info.offset, desc->info.offset + desc->info.length,
565+
op->cmd.opcode, op->cmd.buswidth, op->addr.buswidth,
566+
op->dummy.buswidth, op->data.buswidth,
567+
op->addr.nbytes, op->dummy.nbytes);
568+
561569
chip->clk_freq = desc->mem->spi->max_speed_hz;
562570

563571
/* Only for reads */
@@ -574,9 +582,11 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)
574582
ctl_val = readl(chip->ctl) & ~CTRL_IO_CMD_MASK;
575583
ctl_val |= aspeed_spi_get_io_mode(op) |
576584
op->cmd.opcode << CTRL_COMMAND_SHIFT |
577-
CTRL_IO_DUMMY_SET(op->dummy.nbytes / op->dummy.buswidth) |
578585
CTRL_IO_MODE_READ;
579586

587+
if (op->dummy.nbytes)
588+
ctl_val |= CTRL_IO_DUMMY_SET(op->dummy.nbytes / op->dummy.buswidth);
589+
580590
/* Tune 4BYTE address mode */
581591
if (op->addr.nbytes) {
582592
u32 addr_mode = readl(aspi->regs + CE_CTRL_REG);

drivers/spi/spi-cadence-quadspi.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,16 +1578,15 @@ static int cqspi_probe(struct platform_device *pdev)
15781578
ret = cqspi_of_get_pdata(cqspi);
15791579
if (ret) {
15801580
dev_err(dev, "Cannot get mandatory OF data.\n");
1581-
ret = -ENODEV;
1582-
goto probe_master_put;
1581+
return -ENODEV;
15831582
}
15841583

15851584
/* Obtain QSPI clock. */
15861585
cqspi->clk = devm_clk_get(dev, NULL);
15871586
if (IS_ERR(cqspi->clk)) {
15881587
dev_err(dev, "Cannot claim QSPI clock.\n");
15891588
ret = PTR_ERR(cqspi->clk);
1590-
goto probe_master_put;
1589+
return ret;
15911590
}
15921591

15931592
/* Obtain and remap controller address. */
@@ -1596,7 +1595,7 @@ static int cqspi_probe(struct platform_device *pdev)
15961595
if (IS_ERR(cqspi->iobase)) {
15971596
dev_err(dev, "Cannot remap controller address.\n");
15981597
ret = PTR_ERR(cqspi->iobase);
1599-
goto probe_master_put;
1598+
return ret;
16001599
}
16011600

16021601
/* Obtain and remap AHB address. */
@@ -1605,7 +1604,7 @@ static int cqspi_probe(struct platform_device *pdev)
16051604
if (IS_ERR(cqspi->ahb_base)) {
16061605
dev_err(dev, "Cannot remap AHB address.\n");
16071606
ret = PTR_ERR(cqspi->ahb_base);
1608-
goto probe_master_put;
1607+
return ret;
16091608
}
16101609
cqspi->mmap_phys_base = (dma_addr_t)res_ahb->start;
16111610
cqspi->ahb_size = resource_size(res_ahb);
@@ -1614,15 +1613,13 @@ static int cqspi_probe(struct platform_device *pdev)
16141613

16151614
/* Obtain IRQ line. */
16161615
irq = platform_get_irq(pdev, 0);
1617-
if (irq < 0) {
1618-
ret = -ENXIO;
1619-
goto probe_master_put;
1620-
}
1616+
if (irq < 0)
1617+
return -ENXIO;
16211618

16221619
pm_runtime_enable(dev);
16231620
ret = pm_runtime_resume_and_get(dev);
16241621
if (ret < 0)
1625-
goto probe_master_put;
1622+
return ret;
16261623

16271624
ret = clk_prepare_enable(cqspi->clk);
16281625
if (ret) {
@@ -1716,8 +1713,6 @@ static int cqspi_probe(struct platform_device *pdev)
17161713
probe_clk_failed:
17171714
pm_runtime_put_sync(dev);
17181715
pm_runtime_disable(dev);
1719-
probe_master_put:
1720-
spi_master_put(master);
17211716
return ret;
17221717
}
17231718

0 commit comments

Comments
 (0)