Merge tag 'spi-fix-v7.2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A fairly unremarkable collection of fixes that came in over the
  merge window, plus a new device ID for the DesignWare controller
  in the StarFive JHB100 SoC.

  There's a couple of core fixes included, one avoiding freeing an
  empty resource in error handling cases and another which fixes a
  NULL dereference which could be triggered by using an abnormal
  device registration flow like driver_override"

* tag 'spi-fix-v7.2-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: imx: reconfigure for PIO when DMA cannot be started
  spi: dw: Add support for snps,dwc-ssi-2.00a
  spi: dt-bindings: snps,dw-apb-ssi: Add starfive,jhb100-spi
  spi: rpc-if: Use correct device for hardware reinitialization on resume
  spi: acpi: Free resource list at appropriate time
  spi: dw: fix wrong BAUDR setting after resume
  spi: uniphier: Fix completion initialization order before devm_request_irq()
  spi: Add NULL check for spi_get_device_id() in spi_get_device_match_data()
This commit is contained in:
Linus Torvalds
2026-06-26 11:18:49 -07:00
7 changed files with 24 additions and 7 deletions

View File

@@ -54,6 +54,12 @@ properties:
- sophgo,sg2042-spi
- thead,th1520-spi
- const: snps,dw-apb-ssi
- description: Vendor controllers which use snps,dwc-ssi-2.00a as fallback
items:
- enum:
- starfive,jhb100-spi
- const: snps,dwc-ssi-2.00a
- const: snps,dwc-ssi-1.01a
- description: Intel Keem Bay SPI Controller
const: intel,keembay-ssi
- description: Intel Mount Evans Integrated Management Complex SPI Controller

View File

@@ -438,6 +438,7 @@ static const struct of_device_id dw_spi_mmio_of_match[] = {
{ .compatible = "amazon,alpine-dw-apb-ssi", .data = dw_spi_alpine_init},
{ .compatible = "renesas,rzn1-spi", .data = dw_spi_pssi_init},
{ .compatible = "snps,dwc-ssi-1.01a", .data = dw_spi_hssi_init},
{ .compatible = "snps,dwc-ssi-2.00a", .data = dw_spi_hssi_init},
{ .compatible = "intel,keembay-ssi", .data = dw_spi_hssi_no_dma_init},
{
.compatible = "intel,mountevans-imc-ssi",

View File

@@ -282,6 +282,7 @@ static inline void dw_spi_shutdown_chip(struct dw_spi *dws)
{
dw_spi_enable_chip(dws, 0);
dw_spi_set_clk(dws, 0);
dws->current_freq = 0;
}
extern void dw_spi_set_cs(struct spi_device *spi, bool enable);

View File

@@ -2152,7 +2152,8 @@ static int spi_imx_transfer_one(struct spi_controller *controller,
if (spi_imx->usedma) {
ret = spi_imx_dma_transfer(spi_imx, transfer);
if (transfer->error & SPI_TRANS_FAIL_NO_START) {
spi_imx->usedma = false;
controller->fallback = true;
spi_imx_setupxfer(spi, transfer);
if (spi_imx->target_mode)
return spi_imx_pio_transfer_target(spi, transfer);
else

View File

@@ -206,8 +206,12 @@ static int rpcif_spi_suspend(struct device *dev)
static int rpcif_spi_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
struct rpcif *rpc = spi_controller_get_devdata(ctlr);
int ret;
rpcif_hw_init(dev, false);
ret = rpcif_hw_init(rpc->dev, false);
if (ret)
return ret;
return spi_controller_resume(ctlr);
}

View File

@@ -656,6 +656,8 @@ static int uniphier_spi_probe(struct platform_device *pdev)
priv->host = host;
priv->is_save_param = false;
init_completion(&priv->xfer_done);
priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
@@ -679,8 +681,6 @@ static int uniphier_spi_probe(struct platform_device *pdev)
return ret;
}
init_completion(&priv->xfer_done);
clk_rate = clk_get_rate(priv->clk);
host->max_speed_hz = DIV_ROUND_UP(clk_rate, SSI_MIN_CLK_DIVIDER);

View File

@@ -355,12 +355,16 @@ EXPORT_SYMBOL_GPL(spi_get_device_id);
const void *spi_get_device_match_data(const struct spi_device *sdev)
{
const void *match;
const struct spi_device_id *id;
match = device_get_match_data(&sdev->dev);
if (match)
return match;
return (const void *)spi_get_device_id(sdev)->driver_data;
id = spi_get_device_id(sdev);
if (!id)
return NULL;
return (const void *)id->driver_data;
}
EXPORT_SYMBOL_GPL(spi_get_device_match_data);
@@ -2975,12 +2979,12 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_resources(adev, &resource_list,
acpi_spi_add_resource, &lookup);
acpi_dev_free_resource_list(&resource_list);
if (ret < 0)
/* Found SPI in _CRS but it points to another controller */
return ERR_PTR(ret);
acpi_dev_free_resource_list(&resource_list);
if (!lookup.max_speed_hz &&
ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
device_match_acpi_handle(lookup.ctlr->dev.parent, parent_handle)) {