Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp387258lqp; Wed, 12 Jun 2024 04:58:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRXt0wNu/famGWLByM5gowyWR2yZabtHerRt6eDuLn0fap/cd1fa391GwfpqZHW7zZyg4oJdOunmCaVk2eNVWhygTgXtnYSuRvhY4y8Q== X-Google-Smtp-Source: AGHT+IFYgyOXTjtet+CRJCXNDjFisRrnu2SBBXlMzSCfOpkU2UpQc3r9IVlOuLXfcaPd2sVlgaXB X-Received: by 2002:a17:907:9722:b0:a6a:6ed0:fbd7 with SMTP id a640c23a62f3a-a6f47fac446mr136437166b.37.1718193480843; Wed, 12 Jun 2024 04:58:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718193480; cv=pass; d=google.com; s=arc-20160816; b=W1r1i9pKfI7N5e/QLnwfHItSWjL5j+dbxtwYqzb25MdQscjEj25hg/uimEfGbto0FH HCJgksuIz1gtO/MJx544RPkKB2yxOFjICEJ52Ciz9e5KOTT577uq7t9AxQcVEXuzx/X8 Ws4n2DBnOQczwK++bsqss/5HkKqE0o2OUE17egxsrZ98rjLlvLzNcxVmxDLmk1oDu8Lr 2Sc4e35oBvgjFrsutlM5wVGYpXgKVTIrd/0O1487AeEC+LotSxjuCcZaZ7qirGfDnRjQ 8ZuXRqUv527izvSR9SI9G6D3OC2egoOQBlmMyFiXVs/qH14/FvIRy/xp+qL31+EK0PQo XrXw== 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=4fnQoWbKQPigJStkTW3OuZtA3AHbdJ+985auD2zJfsY=; fh=4IpFHAIPnc+aqNmX+4jLmq9vyJE93VbGHfUhGjSo1cE=; b=ugkHbL5Dzrp0m9R16AGThAYlbbdu2GrX2TtQ5BRz5Fli4SV+AhgsroDR1LhwEdbVIY YD0P4Y0dZQVeVaSesR0fyJaEb+YVqWNKGyQajpVrTLSFDTs3+MbsIirPe/q/QTGCPZkh w6oiEVag09XrPGO6VWKrWYKn2n/7BGgomJGyTwmsr/z0iat4C7CTZ9IBvcqTw24yfAPm AQkWYKCBsorqrGOPf6daSULCOzaQq0NQ/7SyanF90TnYp4Uuze4ytwHIHKVl4EViYrvi l6M2lLWhxO2IXCyBscvxeSRTy4sYPjX1Jfq5LXCVjwatRNVeu8WAId0yU1IM6fYvRMbi JsbA==; 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=DlIdZTO8; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-211165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211165-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef60ab22fsi489327366b.509.2024.06.12.04.58.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 04:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=DlIdZTO8; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-211165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211165-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B38EC1F26CD4 for ; Wed, 12 Jun 2024 08:20:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F33116D33B; Wed, 12 Jun 2024 08:20:37 +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="DlIdZTO8" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 8853216C852 for ; Wed, 12 Jun 2024 08:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180436; cv=none; b=TUj5b3d7x84IgMfjMxGCp5rpVvv6fsDFyQ1CpfaaXQSDinXUYy+e3DjTgA4HRhrp1DQ/gCPgZ9kxNh73XNIDrUjY0YDwSpDa30oEbuwiUONsNVGJeWpQy8dSoNI7YIn2JOeZONkHYl01Pr5pTUG5H3wXU0j1J/JzeqwZipKOug8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180436; c=relaxed/simple; bh=UjX30Q/chhMfu+tqaRL4g479FQ85eWt5DCCzNJXZE7Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=R1we8ppVzOkDLLWWpA09c5vFe8MSVsrsHz1WaFO6JGveXX/1aL8YFERpoWwyY17IYlYbkRozINj2B71kKx0zEnL5k8pJ0SRcv1DowPRWp77P6Hwe1Q0XhzQUpGC1YmbYrK45D2VLjM0eAlXKyjoGY+f5q4XmY1TixOvA3+iOrYc= 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=DlIdZTO8; arc=none smtp.client-ip=209.85.128.42 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-f42.google.com with SMTP id 5b1f17b1804b1-421820fc26dso27304545e9.2 for ; Wed, 12 Jun 2024 01:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718180433; x=1718785233; 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=4fnQoWbKQPigJStkTW3OuZtA3AHbdJ+985auD2zJfsY=; b=DlIdZTO8TEvDB+QrFcVD0LjJqFuJPpJjXu8QA5niT5sa/oK3V+R9ahBDxFv1P3wCzd IGYUKeHFXElc/MPicFdRSpLfgnNUiA5qpf69mjhWiGKBqqSawjw6UuqzqhS/jynFbcrA Y5qOuEtaaY193AoPLhv+6FGiasYxMA2xcCpFL+lxcJ09uHAvGh4Zh+GJNgrrvAjiBo0/ XO/id5tuR8KzN+YY+uuI5N2rJ4a153OJYxoMfSWI3S+zK8bocWkmoBmgFIeKwo+RwXH1 MMGpfPXfpc/y+6xQ8/sgbiMK6peckxDY4qpYDdKtPJZJkWibXoejGML6JlIH/pjS/f98 BvhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718180433; x=1718785233; 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=4fnQoWbKQPigJStkTW3OuZtA3AHbdJ+985auD2zJfsY=; b=MflCpcKfuMxoJdLNNsfXiCVi3KviU2LtBXoJhC32nOdpoEu02OFv+wP2Rwriv582lT zevjzWK/srUutU0vLdC3Ssy2pzS+Kmx7NbdqwmgG37/A5olVWUmfCkBBEgD67vpIoDxl p11UB+bkpj3zNW9h5+M5TeQvQu6NLghu9q9eue8RwSB8pjR514mGEViyAoNhQp6hFKA1 AESDbBIgc0AembH499IfJTa4o6K/1wa4HHEZfWwHawgqK6L7/NAAmZP40CmTbDkS0GZx S2QORqFsvfelUonHCnkgsB0jXuRlzQXc3OciMaB2eg1J7V+3brJ9aMpolMtl54/FjyAY giaA== X-Gm-Message-State: AOJu0YxAIhdHpBUHVYC8GYtgM88YlnGdae1SZVlspKT8FV4+iizSknpM iyIfTN+yh0Evt09Pu+5WUo/VzFIIirkgb8nz16qTlg6636JkwZ9DdHBPdRLyx0tDZlu/on1hSzF J X-Received: by 2002:a05:600c:458a:b0:421:b16c:5bf5 with SMTP id 5b1f17b1804b1-422862acb06mr10454575e9.2.1718180432772; Wed, 12 Jun 2024 01:20:32 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:8d3:3800:a172:4e8b:453e:2f03]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4229207d1a7sm6011775e9.1.2024.06.12.01.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:20:32 -0700 (PDT) From: Bartosz Golaszewski To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v9 0/5] PCI/pwrctl: initial implementation and first user Date: Wed, 12 Jun 2024 10:20:13 +0200 Message-ID: <20240612082019.19161-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: 8bit From: Bartosz Golaszewski I'm sending the PCI part separately to keep the history on the list. Bjorn acked all of them so I'll pick them up later today into the pwrseq tree. Changelog: Since v8: - split out the PCI patches into their own series - improved commit messages (added rationale for the PCI pwrctl and the powrseq driver for QCOM QCAxyz, start with a capital letter) - pick up Acks from Bjorn - 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 (5): PCI: Hold the rescan mutex when scanning for the first time PCI/pwrctl: Reuse the OF node for power controlled devices PCI/pwrctl: Create platform devices for child OF nodes of the port node PCI/pwrctl: Add PCI power control core code PCI/pwrctl: Add a PCI power control driver for power sequenced devices MAINTAINERS | 8 ++ drivers/pci/Kconfig | 1 + drivers/pci/Makefile | 1 + drivers/pci/bus.c | 9 ++ drivers/pci/of.c | 14 ++- drivers/pci/probe.c | 2 + drivers/pci/pwrctl/Kconfig | 17 +++ drivers/pci/pwrctl/Makefile | 6 ++ drivers/pci/pwrctl/core.c | 137 +++++++++++++++++++++++++ drivers/pci/pwrctl/pci-pwrctl-pwrseq.c | 89 ++++++++++++++++ drivers/pci/remove.c | 3 +- include/linux/pci-pwrctl.h | 51 +++++++++ 12 files changed, 333 insertions(+), 5 deletions(-) create mode 100644 drivers/pci/pwrctl/Kconfig create mode 100644 drivers/pci/pwrctl/Makefile create mode 100644 drivers/pci/pwrctl/core.c create mode 100644 drivers/pci/pwrctl/pci-pwrctl-pwrseq.c create mode 100644 include/linux/pci-pwrctl.h -- 2.40.1