Re: [PATCH] spi: Fix acpi deferred irq probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 22-Nov-24 10:42 AM, Stanislaw Gruszka wrote:
> When probing spi device take care of deferred probe of ACPI irq gpio
> similar like for OF/DT case.
> 
> From practical standpoint this fixes issue with vsc-tp driver on
> Dell XP 9340 laptop, which try to request interrupt with spi->irq
> equal to -EPROBE_DEFER and fail to probe with the following error:
> 
> vsc-tp spi-INTC10D0:00: probe with driver vsc-tp failed with error -22
> 
> Suggested-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> Fixes: 33ada67da352 ("ACPI / spi: attach GPIO IRQ from ACPI description to SPI device")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@xxxxxxxxxxxxxxx>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>

Regards,

Hans




> ---
>  drivers/spi/spi.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index c1dad30a4528..0f3e6e2c2474 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -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;
> @@ -2869,9 +2879,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;





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux