Skip to content

Commit

Permalink
Merge tag 'spi-fix-v6.13-merge-window' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few fairly minor driver specific fixes, plus one core fix for the
  handling of deferred probe on ACPI systems - ignoring probe deferral
  and incorrectly treating it like a fatal error while parsing the
  generic ACPI bindings for SPI devices"

* tag 'spi-fix-v6.13-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: Fix acpi deferred irq probe
  spi: atmel-quadspi: Fix register name in verbose logging function
  spi-imx: prevent overflow when estimating transfer time
  spi: rockchip-sfc: Embedded DMA only support 4B aligned address
  • Loading branch information
Linus Torvalds committed Nov 28, 2024
2 parents d83ec4a + d24cfee commit 86f4197
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/spi/atmel-quadspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static const char *atmel_qspi_reg_name(u32 offset, char *tmp, size_t sz)
case QSPI_MR:
return "MR";
case QSPI_RD:
return "MR";
return "RD";
case QSPI_TD:
return "TD";
case QSPI_SR:
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ static unsigned int spi_imx_transfer_estimate_time_us(struct spi_transfer *trans
words = DIV_ROUND_UP(transfer->len * BITS_PER_BYTE, transfer->bits_per_word);
word_delay_us = DIV_ROUND_CLOSEST(spi_delay_to_ns(&transfer->word_delay, transfer),
NSEC_PER_USEC);
result += words * word_delay_us;
result += (u64)words * word_delay_us;
}

return min(result, U32_MAX);
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/spi-rockchip-sfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ static int rockchip_sfc_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op
rockchip_sfc_adjust_op_work((struct spi_mem_op *)op);
rockchip_sfc_xfer_setup(sfc, mem, op, len);
if (len) {
if (likely(sfc->use_dma) && len >= SFC_DMA_TRANS_THRETHOLD) {
if (likely(sfc->use_dma) && len >= SFC_DMA_TRANS_THRETHOLD && !(len & 0x3)) {
init_completion(&sfc->cp);
rockchip_sfc_irq_unmask(sfc, SFC_IMR_DMA);
ret = rockchip_sfc_xfer_data_dma(sfc, op, len);
Expand Down
13 changes: 10 additions & 3 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@ static int spi_probe(struct device *dev)
spi->irq = 0;
}

if (has_acpi_companion(dev) && spi->irq < 0) {
struct acpi_device *adev = to_acpi_device_node(dev->fwnode);

spi->irq = acpi_dev_gpio_irq_get(adev, 0);
if (spi->irq == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (spi->irq < 0)
spi->irq = 0;
}

ret = dev_pm_domain_attach(dev, true);
if (ret)
return ret;
Expand Down Expand Up @@ -2866,9 +2876,6 @@ static acpi_status acpi_register_spi_device(struct spi_controller *ctlr,
acpi_set_modalias(adev, acpi_device_hid(adev), spi->modalias,
sizeof(spi->modalias));

if (spi->irq < 0)
spi->irq = acpi_dev_gpio_irq_get(adev, 0);

acpi_device_set_enumerated(adev);

adev->power.flags.ignore_parent = true;
Expand Down

0 comments on commit 86f4197

Please sign in to comment.