From patchwork Wed Jun 5 12:38:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13686801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA3C6C25B76 for ; Wed, 5 Jun 2024 12:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=VtXVd2ifV4RApjFvpD73BacX+bPYy9TtSIC2/lqR8Ko=; b=xLzQG8ooWC7akG hQBs0InUjC5eoJglxmXY8ldMt3appdtsHDWRGvnAyORT8b9Xia+jbBvFAereJxrXRV/79igvt4KpF V0Ri0pMURRe46R5rPLSpTe1Kvlz4KnGR8UTHRBYsuu3Gt2isxzzGjTCgBsQdyDrag1eVIKgi1zvw+ NauRnzFcNr/62zR9fZgiHm23otH7svuFoVNGYi5OEYSx251RVeaz83zl/h6LZTRneeK/vhI0p2Ntg f8OPOqK4YeaCBnloX6AFiGWlklY5W8LMgj9NIQTNAyo/oWrfLDOo0zgwuTPHnKqI9YHUrPYNW9CRI enaJgIY7biJovYEatkpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEpvU-000000062Ti-27uJ; Wed, 05 Jun 2024 12:39:36 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEpvR-000000062Qt-1hYX for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2024 12:39:35 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42148c0cb1aso20177355e9.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=lists.infradead.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=dBcjbxIe07jl6zA08oRuMFYWfqaZuXCSFfIbO8CTCDO87pgE69PQPWV0pooxGc8lst m16VBtghKYgYS63LTFYon+7aLzTfyEhJW7DE7aD85QbErtak1KyPd964dv96Z7SyXqmb 6w7TF8JRkTJ+9Xiose2G2EFlMVAQPXa5ywHEA44LSJ3RScMNxKN6AxMlwqjaWaDZNABH NnzQBO8THH7iiJvB08uPyCiyTRweTmeHI3xjs0i4yHb9SbLZj88KuqqWXBS2v7mZWl5h s06O6oUbHjg3g10mCUzV/XQ6glTKWJyUGuo/u50h2JCbpxT+tcxjNBj7Qoez/u9ZIlJS wtwQ== 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=u5RLji6r+6Kz1ftDqU+9N3pRjr0KXCOj5XeYv+f9Sa5XSMlcZZlFyR4K1o0vI3HR+E N8InKwSHn2n7YBTw2KNBCvYkyLk0SIPMPJgN+3g8oYup3StC90n0B6IRUmlG5ggYTdl0 WC/C+yj9RKjsfc7XSxFGnhmjGjZPQV0AJ9tgt8JB6jmI32t0AG3xlTSOll8xSlaIu/5h PKxe+1iSi0ZrS/rH0WBAO35zygTmBTMfBEzbA4U0hWlkwNyVdyxL8IipQoE4JgKNWYWJ KyaupnMmpydOWa3gh1AndifFqig1BC7wxlJdFknFEE4gIOO0zLCt8cqVNg/siEoVO2Qo jboA== X-Forwarded-Encrypted: i=1; AJvYcCXR0Tm1MFPoaz8rm9r5pnCzTIQ9DJ9vHBKIucss8yB4hwzoO2q8EeY4b4aCZ+hI4ERU1N4UgAVLqukiZBB4byRA2E2B/+HTWXX6h8LMgeG2VTIFi6g= X-Gm-Message-State: AOJu0Yzrmek8e0XTOjKtD66zE6x27uc02IY0M7gFoXHfuyl6zCuukGtu 3FfdWvrwrJdJk/xr4ZHqARtqVXoMnCMoNqlMeXuqPmd2fF77btbG0AHSliPB/b4= X-Google-Smtp-Source: AGHT+IGD/jtVA3Rdnq+bTWW2i+WoMmfuwV5XxVW4+NDqwpMdifM8PtmushixxRUAGEgebmaoZjpfYw== 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_053933_698405_23055520 X-CRM114-Status: GOOD ( 21.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski