Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp303184lqr; Wed, 5 Jun 2024 06:41:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPod4y/TOOfu1bxO2qNLlKNhzkxPhY53aG4pVuIQR3oxBjj2kwgrvf5IofMT1O1SJQu59imbk4ahZvAuqlkStM3TQP+duY9YF1qSWWFA== X-Google-Smtp-Source: AGHT+IGhosGjsvpcSyMmLYVSuQgZAr/imWt3zLw9fJajRPUea65mihbmrpA3Fp9Z94IIkWuJFUNf X-Received: by 2002:a05:6e02:1561:b0:374:8fcb:a5f7 with SMTP id e9e14a558f8ab-374b1f40402mr27821405ab.26.1717594906984; Wed, 05 Jun 2024 06:41:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717594906; cv=pass; d=google.com; s=arc-20160816; b=PZ1+KWVjBJJitnrbaO3UOS229vrVzdlMxWkAFIkWfMKYDJTq2c2mfnuDJh3s6VceeZ 4zvZldG5uOWLJ2+EBNq0t0LMMjYxrnnCkJa0wRbaQYIVz4OV4djkvVFcymZ2IZvCQsIg mD7knif6VNjt+2Xs7Wc7LWb/KZPUfDaicVK7CdDkFii7fQTfldjjHUPRsIwH3RAdaMBM 8JKOk1/G2N0K3rQhKqmMsjNKa0oWTA/Tscobr4OL5zjjd5/Iy3lPo6RgYMVMpPyRtSRZ 7fsQnjrST+bIoAzyk+TmR6Pri7U+Gv/TZxpo/4UZs5U33c7MeCBbjXfOE0H90HJpWZ04 6N6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=AsYvB5nRpR6ZIwbX5ZKQq6PXeotZMnLfWgyw/MJXre0=; fh=z7BHfSA7ySfqTCJf2iKu2qzbYfFbFWyUX9qjc2zEZ/Y=; b=OxbFfw5OxUKF9vGrxL9WhrW7e2fAOoGmusDAqlGmURekybRN46IAg8RdlfbfaqIRA/ xzMWoJqYALwoNqa5BX2OJ6vnYT6Dsrk3C55CbkiGwWbuy1BMwv8XSc6P3UyGxelQbcEi YTOfchbGE4/+uC+0bsemzCTxffRJpuUfQwe7bLwaAjABxWxQl+UQRzxzBlHSCL1po61U 3uQTUMYOueueb+nnUaaBoPdvbJBYng2kZNHyazn49J9mpgEhG2aq8CcZCq6uGhLCmWM8 9J8ZWZv49Wf7eAxNnWwinLSjeg4jTAOuVxtm3gsgrbrNEZ15STSK+0sDa6DEX/3DZYP2 R4Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=APmbBRop; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5134-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5134-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35a0e6a31si9923017a12.404.2024.06.05.06.41.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:41:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5134-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=APmbBRop; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5134-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5134-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 612B9288ACD for ; Wed, 5 Jun 2024 13:16:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2A411993B0; Wed, 5 Jun 2024 12:39:34 +0000 (UTC) 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="APmbBRop" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 2C77B192B98 for ; Wed, 5 Jun 2024 12:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717591174; cv=none; b=iLVVF3SEBHdhB1ecqAKWL9cy8Tv0x5cCLzKGoBgTChRrLh9dq+jQwGlj1iZ3E7v069MBbdQhr4xsIwTaPazxU+UEKieOyPJGuNFmP1aKfm4x3EBEsjBBBA1tqLpTmFNeI3+apyBUNR45OEnbHoO8xh7CfqGAJkcdcMUwQI4p9mI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717591174; c=relaxed/simple; bh=PN3w34drIVFY3EPIMuK3d7MloOEqH6vrNoCXQcodqfw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fYtA3rpHIkatogAI09p6U45aU/zAMkJz/loKlwugeP6fb9rHz+E/rhbyx0XfvTPae3ttdFMZLxe2wTbBR3QATwlo1nHAEyHBrNYhWiBMHkYy4koF4+ksm9dQgQCbrUoK5fzuWeP2/APyIzpIfxZlh4ObtZkqOteHOP2Kr7TFKQ8= 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=APmbBRop; arc=none smtp.client-ip=209.85.128.52 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 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42148c0cb1aso20177305e9.3 for ; Wed, 05 Jun 2024 05:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1717591170; x=1718195970; 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=AsYvB5nRpR6ZIwbX5ZKQq6PXeotZMnLfWgyw/MJXre0=; b=APmbBRop3ZoA/xyNiNARNuvmlyDAKlSv17U3fbW5Iluy3U1DQVmAuKlnBustljvjsS 1JRbEa1eqVEW0zK6dvt01Vt17jKXiYZrMcsJvtOWFKRzOH20i7cHvJie/v2oiyrDEjRz GTBNJ2gGiupuD0AGFOnuCYzK/q8kLKoEVTq6SgK5jQV4SgkhkAyXAQ2qfNh2WzdzGoP0 QzKmhti2hOwlGcVMbHtY00RtDuX+Bp9HDZtDPmtyCPHWar/Q1slMm8y7SwEPpjw+gPBg xBpnCl0dwwlV3r8ihyI2PMWWVT9UfmaktiSCgCCRaXu/o4KIB67/t7hTmoo9HJcZ54f7 +XKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717591170; x=1718195970; 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=AsYvB5nRpR6ZIwbX5ZKQq6PXeotZMnLfWgyw/MJXre0=; b=pRzU6Q9bCdYx8mNwwMNfKCN/gULDRnN8JZ7wQpcnURXD3J8w+7s0O3oHUIK3P/SF+q at6eENhhQ3PnC4Cqn/+xkLU/yf99MHIj/Dol4nqMLcZY3ICi/1MAnZ81bP7Vpm1jrXwR 5TPb9VLWx51V+T5+L2xE0hSODTw99hyvQasqGyX+HCJiBKEgC0wDzE6vlYJIpf1Hp7Hy G8NSLw7S36HvG1rpN7eQq1vhwEfKXOYEKGUE19Yj5trraZIqD/o/zeKKngvVGAl3WAED Sx9Vw97i/8axdFfsW8QoL8JJ+CiDu74xQXaC07hC8dk+2Ifp3afAe0JuPtnCs24XvUJk BIPw== X-Gm-Message-State: AOJu0Yw9E5pLXGUifPJKAvNjmawGW4Fnd2G1rabKdmYdyYhGzaAI8tHq JXNQIg8cbUafrM+8EeHOloiBYgAdYu36U+1lrV18PZsTYiMyeewg9M/OFu9IbI4= X-Received: by 2002:a05:600c:44d4:b0:41f:ed4b:93f9 with SMTP id 5b1f17b1804b1-421562dc3abmr17532165e9.19.1717591170461; Wed, 05 Jun 2024 05:39:30 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:d3dd:423:e1eb:d88b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42158148f66sm21992535e9.32.2024.06.05.05.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:39:30 -0700 (PDT) From: Bartosz Golaszewski To: Marcel Holtmann , Luiz Augusto von Dentz , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kalle Valo , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Catalin Marinas , Will Deacon , Bjorn Helgaas , Bartosz Golaszewski , Saravana Kannan , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , Marek Szyprowski , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa , Manivannan Sadhasivam , Lukas Wunner , Dmitry Baryshkov , Amit Pundir , Xilin Wu Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v9 0/2] pwrseq: introduce the subsystem and first driver Date: Wed, 5 Jun 2024 14:38:48 +0200 Message-ID: <20240605123850.24857-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bartosz Golaszewski Hi! These are the power sequencing patches sent separately after some improvements suggested by Bjorn Helgaas. I intend to pick them up into a new branch and maintain the subsystem from now on. I then plan to provide an immutable tag to the Bluetooth and PCI subsystems so that the rest of the C changes can be applied. This new branch will then be directly sent to Linus Torvalds for the next merge window. Changelog: Since v8: - split the pwrseq patches out into their own series - rename incref/decref functions to get/put for consistency - fix typos - make it very explicit in docs that arrays of targets and units must be NULL-terminated - Link to v8: https://lore.kernel.org/r/20240528-pwrseq-v8-0-d354d52b763c@linaro.org Since v7: - added DTS changes for sm8650-hdk - added circular dependency detection for pwrseq units - fixed a KASAN reported use-after-free error in remove path - improve Kconfig descriptions - fix typos in bindings and Kconfig - fixed issues reported by smatch - fix the unbind path in PCI pwrctl - lots of minor improvements to the pwrseq core Since v6: - kernel doc fixes - drop myself from the DT bindings maintainers list for ath12k - wait until the PCI bridge device is fully added before creating the PCI pwrctl platform devices for its sub-nodes, otherwise we may see sysfs and procfs attribute failures (due to duplication, we're basically trying to probe the same device twice at the same time) - I kept the regulators for QCA6390's ath11k as required as they only apply to this specific Qualcomm package Since v5: - unify the approach to modelling the WCN WLAN/BT chips by always exposing the PMU node on the device tree and making the WLAN and BT nodes become consumers of its power outputs; this includes a major rework of the DT sources, bindings and driver code; there's no more a separate PCI pwrctl driver for WCN7850, instead its power-up sequence was moved into the pwrseq driver common for all WCN chips - don't set load_uA from new regulator consumers - fix reported kerneldoc issues - drop voltage ranges for PMU outputs from DT - many minor tweaks and reworks v1: Original RFC: https://lore.kernel.org/lkml/20240104130123.37115-1-brgl@bgdev.pl/T/ v2: First real patch series (should have been PATCH v2) adding what I referred to back then as PCI power sequencing: https://lore.kernel.org/linux-arm-kernel/2024021413-grumbling-unlivable-c145@gregkh/T/ v3: RFC for the DT representation of the PMU supplying the WLAN and BT modules inside the QCA6391 package (was largely separate from the series but probably should have been called PATCH or RFC v3): https://lore.kernel.org/all/CAMRc=Mc+GNoi57eTQg71DXkQKjdaoAmCpB=h2ndEpGnmdhVV-Q@mail.gmail.com/T/ v4: Second attempt at the full series with changed scope (introduction of the pwrseq subsystem, should have been RFC v4) https://lore.kernel.org/lkml/20240201155532.49707-1-brgl@bgdev.pl/T/ v5: Two different ways of handling QCA6390 and WCN7850: https://lore.kernel.org/lkml/20240216203215.40870-1-brgl@bgdev.pl/ Bartosz Golaszewski (2): power: sequencing: implement the pwrseq core power: pwrseq: add a driver for the PMU module on the QCom WCN chipsets MAINTAINERS | 8 + drivers/power/Kconfig | 1 + drivers/power/Makefile | 1 + drivers/power/sequencing/Kconfig | 29 + drivers/power/sequencing/Makefile | 6 + drivers/power/sequencing/core.c | 1105 ++++++++++++++++++++ drivers/power/sequencing/pwrseq-qcom-wcn.c | 336 ++++++ include/linux/pwrseq/consumer.h | 56 + include/linux/pwrseq/provider.h | 75 ++ 9 files changed, 1617 insertions(+) create mode 100644 drivers/power/sequencing/Kconfig create mode 100644 drivers/power/sequencing/Makefile create mode 100644 drivers/power/sequencing/core.c create mode 100644 drivers/power/sequencing/pwrseq-qcom-wcn.c create mode 100644 include/linux/pwrseq/consumer.h create mode 100644 include/linux/pwrseq/provider.h -- 2.40.1