Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3286460pxk; Mon, 21 Sep 2020 09:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/noQ9HE3e4vYKTl2+nLuNV0Qzwxb7NJZCzbzNHt5/kBGBA/vrtrKTlTBoB3udgtbEXmum X-Received: by 2002:a50:99d5:: with SMTP id n21mr574716edb.88.1600706600181; Mon, 21 Sep 2020 09:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706600; cv=none; d=google.com; s=arc-20160816; b=sWwiNyUEPx9WmtMVl49XpxnnTffef7zyIYlPs27BspZa6F42QOTxmQMZY2i0YHCu7i NMgsDjSg/LcCp8CKWMRRb1O4Nh7j48ETqvNeuJxQkCmYQ52SUxJNm25skFz7qCrYDuhw HCcOBfH1HUF0e7/rY6QGni6yxBzC9vEZq/B0iy8WmmZkZXH9yZays+axrUDsjVmSO/yv ZX8bg8MHhmk466YFGezekgIadMCaPgaaFJD7s0TRXTeYXWI+qyYOBGT94E48gq7z/Evr hvg6qtN4wcu0qiY6JW/HE6XItWu3Hd3sTYQ07F5Ppgv5AQUtCE+pDSJhV9mCBAbECm61 xNXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MJXqmaWOioCJcD6l5fh6vdeMHzvBq7hs17TAhOtVTDM=; b=1IaHspnM5OuGN6XrWEYJBPcMkrfuEaYiSCZHyidM3O+QsyVA4pbH51A+RUW1CE/V4c sm45d6jf07xBSRSYRXgv/JFwD66VEW/G+whKgDhPtNpe7jYsFzWNzEpLc8D1F0LI1Osc pKT5E+Z3Ui2cL9HNWVnlZtsJ92qHGmNs1C/aCp4sWXXSLsoViO/56pUwRNHOX+SimJg6 1IY64FeTfZ+FllebZWaeh4OvY/eqhwxQGSC7jnaGFxnvks1ps3N1CQla2irMJYSfDRw0 odHwukVs6dYtgxxqVHHBaLty7nqzxJoW3Kp91VW1hPiprTx54HgsMd79Own0Begm1dEf /s6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vU9DBIPt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si8333900edw.18.2020.09.21.09.42.56; Mon, 21 Sep 2020 09:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vU9DBIPt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729348AbgIUQka (ORCPT + 99 others); Mon, 21 Sep 2020 12:40:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:42814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbgIUQkN (ORCPT ); Mon, 21 Sep 2020 12:40:13 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1AB823998; Mon, 21 Sep 2020 16:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706413; bh=Cm7zi0oycO/VORlrjs1Rf7bW3IHMkcejIpXZaKzDbZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vU9DBIPtIoXHKZZxnIqadFP06nG9GpS5B/nDOkJbetZQKsABVPjWgeuHLRjiyBD7c k6GUcloO9SLyVX4zl3PMtH7z9xQEP1IzYG9LLeouP8sbULCweo3PBhPFGclls+CR04 bJkXv41ZU9hl/JGAjPG470KiISFqrTeoIXvNAqfI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heikki Krogerus Subject: [PATCH 4.14 59/94] usb: typec: ucsi: acpi: Check the _DEP dependencies Date: Mon, 21 Sep 2020 18:27:46 +0200 Message-Id: <20200921162038.260737209@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heikki Krogerus 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 Link: https://lore.kernel.org/r/20200904110918.51546-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/ucsi/ucsi_acpi.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -67,11 +67,15 @@ static void ucsi_acpi_notify(acpi_handle 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;