aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2020-09-04 14:09:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-17 13:47:56 +0200
commitebd9aff7b62ad70fa06ca0cb468a178f6c057fe4 (patch)
treede86fdb58d0d988d073c373ef16e5c8e71b2a5fb
parent848eeb75c81daee3c6de9513b0615164871ae2f4 (diff)
downloadlinux-yocto-ebd9aff7b62ad70fa06ca0cb468a178f6c057fe4.tar.gz
linux-yocto-ebd9aff7b62ad70fa06ca0cb468a178f6c057fe4.tar.bz2
linux-yocto-ebd9aff7b62ad70fa06ca0cb468a178f6c057fe4.zip
usb: typec: ucsi: acpi: Check the _DEP dependencies
commit 1f3546ff3f0a1000971daef58406954bad3f7061 upstream. Failing probe with -EPROBE_DEFER until all dependencies listed in the _DEP (Operation Region Dependencies) object have been met. This will fix an issue where on some platforms UCSI ACPI driver fails to probe because the address space handler for the operation region that the UCSI ACPI interface uses has not been loaded yet. Fixes: 8243edf44152 ("usb: typec: ucsi: Add ACPI driver") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20200904110918.51546-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/typec/ucsi/ucsi_acpi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
index a18112a83fae..dda8bd39c918 100644
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -64,11 +64,15 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data)
static int ucsi_acpi_probe(struct platform_device *pdev)
{
+ struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
struct ucsi_acpi *ua;
struct resource *res;
acpi_status status;
int ret;
+ if (adev->dep_unmet)
+ return -EPROBE_DEFER;
+
ua = devm_kzalloc(&pdev->dev, sizeof(*ua), GFP_KERNEL);
if (!ua)
return -ENOMEM;