From nobody Thu Nov 28 03:42:59 2024 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4EAC148FF6 for ; Fri, 4 Oct 2024 12:52:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728046362; cv=none; b=YiNf4oTvUoedyDP36XD9Z0kmr2+4W5xpSRFMuYwcsKzuy+VlfUpbcIUQZ8QUAsinq6btRNC9LgOx2g3+HD6Rts1b5w8eFM19kQy6RG/Ncx1DB/iUFJ2h3vNAeTISq1loFN07y4Wv03KghZI1bvRus/cmPykMkJCqlYeH64aKqcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728046362; c=relaxed/simple; bh=9PYW71iDSCM5kPIkNn6Mt8m5WS1qZgw9PcoQq9wIi/k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nIcS5l0AZyQ4oJktE3d2C3SAsVt6GKXPqIMpSHwobbJHDRDZpoa/M59gjEyqDz4LWp5iLW93VljjPmcsAAjzmq++AqZh/6d33GaVyBMUQ9VTpGG2sY5miciBrh0q1K8xUsgl6nRbfGGY3C5lAPnsNPQbLG2NUIJhFCkGg6/oIVI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=XBAFHk+s; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="XBAFHk+s" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-42cae102702so16934685e9.0 for ; Fri, 04 Oct 2024 05:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1728046358; x=1728651158; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9ItTuNJesRv8aPVVPDBG9NjVbPRogCviOxa9DraYVho=; b=XBAFHk+sggd97QJH5ZQ0LJR5hajQO4YirBVPJ7R5KXgNHo43jsFpJD/w8tKHQULEpu yCVGQkAlJLHACXiw/jN6WaleLeogaTzXbvTkejHisDuBO/ylJTUuHahg88r0t1IyGAu+ ZHFX5nJgBxIxCCLvnzOp5vP5Rhhd5ludi9D3wWlzFX7OA229weB9It60cW76NeiMdJ/e Ju6cc5g/+ER+CYJS8E6WOvfwpqF0rpzm3dICN0bva6uW0kso8VZrDmDZBsXlO/cNlJUm YudxVk9uosWggVr/zs1NfMsvwpUrFruptjmJZIifyYTyUdY9FqVdUH10kRyQPLO8NLdK /COg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728046358; x=1728651158; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9ItTuNJesRv8aPVVPDBG9NjVbPRogCviOxa9DraYVho=; b=qjNGHzlAR9ToDhUdIK+U9PbBjDfYu1rUdRoncypRY/xKAjyfdwLJzdaGvGgd1uxdBb wcv5wm4CwnpiNbYX7BKzy77FEacFw0Lz1jCu6k/g3QCWwEjByLPVo8Zjaa/cpRIsqhw2 tk8kd8ci1gil+WalBjspKQ4vw0hFt8zy8N7/+LzKNdrMMgqXfCnbDHCWAxPK/AEi9RfE px7zC2hGzcy5aMHyZRgoMY9ffWsAwP62fdF+gT2wflqHHlZnfrM//XweW4TwKBeUuOra YBERN9TrZnlww/aDvHwJtYBN7aNIzSMK3OG3cmM+CgXIu6nzm8rnSPJrBWqJUV/DAE/d TP4g== X-Forwarded-Encrypted: i=1; AJvYcCXABMhYDxlq57aNaa2ua9lj2wAnt3hPTZyD21aiab56yHgttP+SLkSL5Fzv6I7x43mv9+7lXyODqR66TeI=@vger.kernel.org X-Gm-Message-State: AOJu0YxraBu9cMsTBIYo2DIqvu+oxMsn4jmdX/AwOjNrd1IFYntPg3mr ru8UFei08A3dqtEX73sllZh9NnyO3SewntDXgkgXYPOhoO6oW03fE2ZSHdVgOUI= X-Google-Smtp-Source: AGHT+IG+2BRoSh77J4Sl0ajlbC5Py8WTVYqjuen+MLAY1ENUWyu6ojnznZ8DA20fmDDX40F92PGboQ== X-Received: by 2002:a05:600c:511c:b0:42c:a8f8:1d58 with SMTP id 5b1f17b1804b1-42f85aa32c0mr15613935e9.7.1728046357780; Fri, 04 Oct 2024 05:52:37 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:80ea:d045:eb77:2d3b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f869a39adsm15238885e9.0.2024.10.04.05.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:52:37 -0700 (PDT) From: Bartosz Golaszewski To: Bartosz Golaszewski , Bjorn Helgaas , Bjorn Andersson , Konrad Dybcio Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Johan Hovold , Stephan Gerhold Subject: [PATCH] PCI/pwrctl: pwrseq: abandon probe on pre-pwrseq device-trees Date: Fri, 4 Oct 2024 14:52:27 +0200 Message-ID: <20241004125227.46514-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bartosz Golaszewski Old device trees for some platforms already define wifi nodes for the WCN family of chips since before power sequencing was added upstream. These nodes don't consume the regulator outputs from the PMU and if we allow this driver to bind to one of such "incomplete" nodes, we'll see a kernel log error about the indefinite probe deferral. Let's check the existence of the regulator supply that exists on all WCN models before moving forward. Fixes: 6140d185a43d ("PCI/pwrctl: Add a PCI power control driver for power = sequenced devices") Reported-by: Johan Hovold Closes: https://lore.kernel.org/all/Zv565olMDDGHyYVt@hovoldconsulting.com/ Suggested-by: Stephan Gerhold Signed-off-by: Bartosz Golaszewski --- drivers/pci/pwrctl/pci-pwrctl-pwrseq.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c b/drivers/pci/pwrctl/pc= i-pwrctl-pwrseq.c index a23a4312574b..8ed613655d4a 100644 --- a/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c +++ b/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,25 @@ static int pci_pwrctl_pwrseq_probe(struct platform_devic= e *pdev) struct device *dev =3D &pdev->dev; int ret; =20 + /* + * Old device trees for some platforms already define wifi nodes for + * the WCN family of chips since before power sequencing was added + * upstream. + * + * These nodes don't consume the regulator outputs from the PMU and + * if we allow this driver to bind to one of such "incomplete" nodes, + * we'll see a kernel log error about the indefinite probe deferral. + * + * Let's check the existence of the regulator supply that exists on all + * WCN models before moving forward. + * + * NOTE: If this driver is ever used to support a device other than + * a WCN chip, the following lines should become conditional and depend + * on the compatible string. + */ + if (!device_property_present(dev, "vddaon-supply")) + return -ENODEV; + data =3D devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; --=20 2.43.0