From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5046D222D67; Thu, 12 Dec 2024 17:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734025402; cv=none; b=QJePXqJho6tIxdJulu3rSmmNwR5apa/vIhx3GuRz2GaLzKBC8i2k07XQklusA1dBC+evZ/lqg3f4IDpTr4lR6rsOapaCjA8HwPixLl2KEkyos2X5/sIMYKyGUJEjQTlRdcaXfIC9moWBQ9lLsHOYJ5CtrLlDApjxFg0IIayXmiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734025402; c=relaxed/simple; bh=KctbU6bKkpGMRWsZ8JI4gNHczi6WutcAt0KtOyRUb18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AgMA3/mcoSi+Vaa/W/aCrG/eDcOulVRVYXHNEXGq26154D5lsFSKEmZ6erycLuXlic1U1NKrpG8w5ZocYZtXj5+WDD3ZhKABlyH+au+/pBv0gTG7oz//peQV2dRplmiZFLzABJTfaLVcqkrmbyjXphtUUIjJK/qsaSQvLGlKPW8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PmCAQDes; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PmCAQDes" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A65AC4CED0; Thu, 12 Dec 2024 17:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734025401; bh=KctbU6bKkpGMRWsZ8JI4gNHczi6WutcAt0KtOyRUb18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PmCAQDessZVjyxOf4jb17xSDaZgvd16761hiYqjAxAmpGuFh9R1KR0YKTg75APp6e XOiiXjkNsQUBYGbBoqZJDM63y8tNazOLStr4V9F/impz84klyFyW10Aluy4KH8bcgX +eDKz3wbPjE9Wd2wpF1vqjnB66vfyaqnaXPMu2tU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hans de Goede , Stanislaw Gruszka , Mark Brown , =?UTF-8?q?Alexis=20Lothor=C3=A9?= Subject: [PATCH 5.4 158/321] spi: Fix acpi deferred irq probe Date: Thu, 12 Dec 2024 16:01:16 +0100 Message-ID: <20241212144236.218944409@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144229.291682835@linuxfoundation.org> References: <20241212144229.291682835@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stanislaw Gruszka commit d24cfee7f63d6b44d45a67c5662bd1cc48e8b3ca upstream. 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 Fixes: 33ada67da352 ("ACPI / spi: attach GPIO IRQ from ACPI description to SPI device") Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka Reviewed-by: Hans de Goede Tested-by: Alexis Lothoré # Dell XPS9320, ov01a10 Link: https://patch.msgid.link/20241122094224.226773-1-stanislaw.gruszka@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -397,6 +397,16 @@ static int spi_drv_probe(struct device * 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; @@ -2045,9 +2055,6 @@ static acpi_status acpi_register_spi_dev 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;