From nobody Tue Dec 16 15:25:10 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 629C228002E for ; Tue, 6 May 2025 13:10:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537030; cv=none; b=nznnbD60EFNicgkuqNTVnyoty96osNWYwTg7RQ1TlGb+eVQfUGiZH7RytNjoChWQhX/Txa+bCpLdLK3J33s8Td7n4zY1fB5Z1C5gx7mvw2hNi40u/8+wIq0lQvPALOZBnY9KfGHZsEIBnQIs4GqGDaUK4JTYLsqzKbOauRTCZMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537030; c=relaxed/simple; bh=oTcDnSI1bNVQqjBsPCRTQxoefbYwyIGZKDofCNxpi+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Hz69YBVUJB4fdnFpJI8JCC25obuj0blsw4gnXJ5aSjW6Snb/FGfEiImAiLJKtt5cB0tJDNYkLq5bPUY6RFUttHSknGdobS9ZIQHWAX0HUC+YlwGA/z3SdGS3I0dyUkRBK/+0BHxBrhnpzs6MOLwMEloJfTyCmFefGWq9suMnJ6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=a4WKFFdK; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="a4WKFFdK" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-441ab63a415so56549265e9.3 for ; Tue, 06 May 2025 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537025; x=1747141825; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/Iv8onXZwEMREo5qlPvqBSmY6LEmZfGy2ZM9zSxD9OA=; b=a4WKFFdKS8MVw21zsMcTol8MZQl49WtmzRvMReUEFRkt5/um+olhpbKiolV6TpcvJU nLIf9qEEMgAi2n0f3eln+MDaG3oEacH0XJotjT+P6BH7QXa+xes4/5wgwcctL9zYqInA CbccGZlAp1XZl1CaNqgs/xDcr1ZDU4w3423W4czWtcItiFRmEyVeQPAIvPIVNTnPb5Gi oUBv5K0awT4KrM8oGzSjwvHnJMISOg8miPL75Kn59S2UVRrHPzL4fglayhBlDnHaCJL6 ejBr7wILHBDQ+W/IuOzxgxxjpEWLAY7ITVDlDauZ2wstguuReERnp1g1hd6mLRAJ/Wd9 AY3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537025; x=1747141825; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Iv8onXZwEMREo5qlPvqBSmY6LEmZfGy2ZM9zSxD9OA=; b=Wm7B5piQRdFBGh5sc5grSyiVB3P3/Z7VXhWAmmff5iytdUSGHImwtEURiul3ZBTJKT 6i+1zzrft/seEY/pOdEiuRvL0zw/SC0sbfPCDFvaPeqVGE+N6ciuAfZgmFuiKRXImXG7 FISUemm0sqxoEKOlwKhGRc1E+QyvzQjR4BB2Id220e8KSBAG/GIuHJj8TkbgVPONeA4S nTLuJ9c8MDN5xS/5TNqK7aMjl9TWc7vrg27YeApLsnj4Invx9kdd5vvicMZXJRvMZkk+ tlh8C/ikGWuggO6V/xsg2e6JT4D6rx2IOiQgPL3MVSt0qGF46zvn5U0Ozi4Lth552dJu EQMg== X-Forwarded-Encrypted: i=1; AJvYcCVEdqi2rg16QtP7OiWVSZW+L8/wO0LjcE89Rj2cX9E9Dd92ZtyUrcvZ117oXn/p4miMh/ysPquLbG/22qk=@vger.kernel.org X-Gm-Message-State: AOJu0YxTThuUTdncneR6sq8dhd4nOnexjyJFvJf0bQ4Tk3C+IhKQaEAi Va9mo9w0tfEgoqFctS1FYp/sb6i6YJKVvWq/sL5ak0vXqYlzI51ffIsMbj/8B+4= X-Gm-Gg: ASbGncvKwDkunSMbuoz2Va6Tx8QDD0p1jinjvayNJ/DtCTECXgu2roLQwdu1DwkJ3RT H7veRW5UaBo73EfI1zrSu6tEmXjWi0fRYfYcbo0/dK+6Q5XPnLLUauk0SBQLdoYgcFGS14alacT O93vIEq+uKoRCm3Awa2g5/omwRl6JIHwS+aRit9a8vq7T/QH4OLGuKokFZ9TCVstXoT28wkwyRQ jVj5lLXrVR7E9AF8SBbM4wwtGvJVvvzhJgIcwdd/AZLhvc3GWznOZJ3lB6z1EbEm7CmkHG3eN0O xlegfavNC0Ln6sdB9KpAREqpUDm7Fjxa63sWJWexgTa9lSE8uIap4xc= X-Google-Smtp-Source: AGHT+IEHzp+5y+s2Mm6GFfK8W7K4y8+KiivNWsSPRroJGQvmgcFnvlH4/ZTzSgWez3LsluqXUbVrRQ== X-Received: by 2002:a05:600c:3b17:b0:43d:745a:5a50 with SMTP id 5b1f17b1804b1-441d0fd348dmr21279125e9.19.1746537024283; Tue, 06 May 2025 06:10:24 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:23 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:08 +0200 Subject: [PATCH 1/4] dt-bindings: mailbox: qcom,apcs: Add separate node for clock-controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-1-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 APCS "global" is sort of a "miscellaneous" hardware block that combines multiple registers inside the application processor subsystem. Two distinct use cases are currently stuffed together in a single device tree node: - Mailbox: to communicate with other remoteprocs in the system. - Clock: for controlling the CPU frequency. These two use cases have unavoidable circular dependencies: the mailbox is needed as early as possible during boot to start controlling shared resources like clocks and power domains, while the clock controller needs one of these shared clocks as its parent. Currently, there is no way to distinguish these two use cases for generic mechanisms like fw_devlink. This is currently blocking conversion of the deprecated custom "qcom,ipc" properties to the standard "mboxes", see e.g. commit d92e9ea2f0f9 ("arm64: dts: qcom: msm8939: revert use of APCS mbox for RPM"): 1. remoteproc &rpm needs mboxes =3D <&apcs1_mbox 8>; 2. The clock controller inside &apcs1_mbox needs clocks =3D <&rpmcc RPM_SMD_XO_CLK_SRC>. 3. &rpmcc is a child of remoteproc &rpm The mailbox itself does not need any clocks and should probe early to unblock the rest of the boot process. The "clocks" are only needed for the separate clock controller. In Linux, these are already two separate drivers that can probe independently. Break up the circular dependency chain in the device tree by separating the clock controller into a separate child node. Deprecate the old approach of specifying the clock properties as part of the root node, but keep them for backwards compatibility. Signed-off-by: Stephan Gerhold Reviewed-by: Krzysztof Kozlowski --- .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 169 ++++++++++++++---= ---- 1 file changed, 118 insertions(+), 51 deletions(-) diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-globa= l.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.ya= ml index a58a018f3f7b9f8edd70d7c1bd137844ff2549df..3a0a304bb65a68b2d4a1df79b32= 43ddac6bf88b2 100644 --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml @@ -72,6 +72,7 @@ properties: description: phandles to the parent clocks of the clock driver minItems: 2 maxItems: 3 + deprecated: true =20 '#mbox-cells': const: 1 @@ -82,6 +83,23 @@ properties: clock-names: minItems: 2 maxItems: 3 + deprecated: true + + clock-controller: + type: object + additionalProperties: false + properties: + clocks: + description: phandles to the parent clocks of the clock driver + minItems: 2 + maxItems: 3 + + '#clock-cells': + enum: [0, 1] + + clock-names: + minItems: 2 + maxItems: 3 =20 required: - compatible @@ -90,6 +108,76 @@ required: =20 additionalProperties: false =20 +# Clocks should be specified either on the parent node or on the child node +oneOf: + - required: + - clock-controller + properties: + clocks: false + clock-names: false + '#clock-cells': false + - properties: + clock-controller: false + +$defs: + msm8916-apcs-clock-controller: + properties: + clocks: + items: + - description: primary pll parent of the clock driver + - description: auxiliary parent + clock-names: + items: + - const: pll + - const: aux + '#clock-cells': + const: 0 + + msm8939-apcs-clock-controller: + properties: + clocks: + items: + - description: primary pll parent of the clock driver + - description: auxiliary parent + - description: reference clock + clock-names: + items: + - const: pll + - const: aux + - const: ref + '#clock-cells': + const: 0 + + sdx55-apcs-clock-controller: + properties: + clocks: + items: + - description: reference clock + - description: primary pll parent of the clock driver + - description: auxiliary parent + clock-names: + items: + - const: ref + - const: pll + - const: aux + '#clock-cells': + const: 0 + + ipq6018-apcs-clock-controller: + properties: + clocks: + items: + - description: primary pll parent of the clock driver + - description: XO clock + - description: GCC GPLL0 clock source + clock-names: + items: + - const: pll + - const: xo + - const: gpll0 + '#clock-cells': + const: 1 + allOf: - if: properties: @@ -98,15 +186,10 @@ allOf: enum: - qcom,msm8916-apcs-kpss-global then: + $ref: "#/$defs/msm8916-apcs-clock-controller" properties: - clocks: - items: - - description: primary pll parent of the clock driver - - description: auxiliary parent - clock-names: - items: - - const: pll - - const: aux + clock-controller: + $ref: "#/$defs/msm8916-apcs-clock-controller" =20 - if: properties: @@ -115,17 +198,10 @@ allOf: enum: - qcom,msm8939-apcs-kpss-global then: + $ref: "#/$defs/msm8939-apcs-clock-controller" properties: - clocks: - items: - - description: primary pll parent of the clock driver - - description: auxiliary parent - - description: reference clock - clock-names: - items: - - const: pll - - const: aux - - const: ref + clock-controller: + $ref: "#/$defs/msm8939-apcs-clock-controller" =20 - if: properties: @@ -134,17 +210,10 @@ allOf: enum: - qcom,sdx55-apcs-gcc then: + $ref: "#/$defs/sdx55-apcs-clock-controller" properties: - clocks: - items: - - description: reference clock - - description: primary pll parent of the clock driver - - description: auxiliary parent - clock-names: - items: - - const: ref - - const: pll - - const: aux + clock-controller: + $ref: "#/$defs/sdx55-apcs-clock-controller" =20 - if: properties: @@ -153,17 +222,10 @@ allOf: enum: - qcom,ipq6018-apcs-apps-global then: + $ref: "#/$defs/ipq6018-apcs-clock-controller" properties: - clocks: - items: - - description: primary pll parent of the clock driver - - description: XO clock - - description: GCC GPLL0 clock source - clock-names: - items: - - const: pll - - const: xo - - const: gpll0 + clock-controller: + $ref: "#/$defs/ipq6018-apcs-clock-controller" =20 - if: properties: @@ -179,19 +241,7 @@ allOf: properties: clocks: false clock-names: false - - - if: - properties: - compatible: - contains: - enum: - - qcom,ipq6018-apcs-apps-global - then: - properties: - '#clock-cells': - const: 1 - else: - properties: + clock-controller: false '#clock-cells': const: 0 =20 @@ -216,6 +266,23 @@ examples: }; =20 # Example apcs with qcs404 + - | + #define GCC_APSS_AHB_CLK_SRC 1 + #define GCC_GPLL0_AO_OUT_MAIN 123 + mailbox@b011000 { + compatible =3D "qcom,qcs404-apcs-apps-global", + "qcom,msm8916-apcs-kpss-global", "syscon"; + reg =3D <0x0b011000 0x1000>; + #mbox-cells =3D <1>; + + apcs_clk: clock-controller { + clocks =3D <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>; + clock-names =3D "pll", "aux"; + #clock-cells =3D <0>; + }; + }; + + # Example apcs with qcs404 (deprecated: use clock-controller subnode) - | #define GCC_APSS_AHB_CLK_SRC 1 #define GCC_GPLL0_AO_OUT_MAIN 123 --=20 2.47.2 From nobody Tue Dec 16 15:25:10 2025 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 10A19279787 for ; Tue, 6 May 2025 13:10:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537029; cv=none; b=o/yZ7u5LkM92c7pfiOiDruJ/8ebpN/iZiwNwpqnOgGJJZEZpdUoxxBeb5bX80jLG1AFneS+VQyT3lwX5FZz4qXlYPqDDP4BKo+7PcJrhlrTilOyMHHjfXLH0QfpK5a1bnzcVKgP0soCZl6o5v5c/CV1qgLpRcyWHnXudKMlvCOM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537029; c=relaxed/simple; bh=fK59Oou5drgQyhp0Ss+j4VYrMmVw0bDtAiWMF9Ozu5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L37Ym9qij4n/XlMBfspg613UKaeyYEaAJDQ1u7Svq4w0cFzMDJgbeneKSqs7/wF0CltINRuIle0sNLWObAzj19Lm2YhhGw/kxnfM8fW4K/92mtoXoCbqo5TtB+Lbyk2Y59hfeY6Bub5SQU0rQb0MvfbQcZ3LaYtqyun340iSxhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rgQdvIU8; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rgQdvIU8" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-39c14016868so6592556f8f.1 for ; Tue, 06 May 2025 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537025; x=1747141825; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=j7hjl3tAkLPYtX6/B2YAWQ6GsOIrYFPOtKZDg5lJipo=; b=rgQdvIU8Wgoph89KHmvIdRzGLA46hKnq8YNvFmQU9aFK7mKkcLsmi9PAeaSckyZz9D U0kzWXeyKmcv8uh9VdBlXIaF7SvqveE1dV4qWDXOwihJgblTSvxniE3jDMDB01W68lE/ T4Ts0SRiAKT3nNiSFeKJ3S/ET9iiUV80+tlsqfyWIQpFhspSDeo7I9F3neo0LppTRkbY Gapgm2ng1hvYfAYNbh6UVdZ/ejpADcdgtz9VbnFGmWHT12VnjHlvk653SRnEl7ECZ3Pg ic521jpizxKEEaMVvlZCCSWOOvpTz4lm3Bkf1pTh+sQd1cKTdpwCC3RWyRtF4LvFi3Bk WX+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537025; x=1747141825; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j7hjl3tAkLPYtX6/B2YAWQ6GsOIrYFPOtKZDg5lJipo=; b=WENPXdCHDWBT2Lb9KNx0y0quwwLQNW27pVYUnRL1ksx90VTyuGbqVS4Z6Pb7sorGO+ BHvBE7Ly5AILYREwabco9xQiSEmt0Unvzx1Twdnm/TZFdHvC0fGNXP/1umf+ZI3PUs7r o/ypF4ndDWnJIdi6GxH/YWIvSoMnAS2tNGTXV2iegIwGmwIazJCY6eexQ2TRmXB69E7c sD0ZTYRO5VSZzGt6/ZttCcjry5NVnijFBGtKsPEsEGoV/Ue+uQejwSQBmN1jlDsAfq8y zA2pAZORI7R2CTVh2GqOCv1GLChGZS9Qo1E9Gx5s0XWYRrAiEz4/YAfFCdziAQsfOvdK 1w8w== X-Forwarded-Encrypted: i=1; AJvYcCWuH2UHkSq1a+fcSxhNAHkIoOUk6sg1fUIL7oSvfvKLqYtzVey/7Jd5YBWRiJZBKhF+ywvznaYrmqQMqMg=@vger.kernel.org X-Gm-Message-State: AOJu0YwCI0qAH/wwiO7rNpypKoDk0lrer3RB0sou1FZUXu3p5++g3tq5 xxM8B9gDeBU58D8X9GZ170gOa1L9QsR9OhYtsJUZnO+lv+58DWKe6YoNe+TMgGQ= X-Gm-Gg: ASbGncvNEnW35FxMquMNTG7fzCdK41ia9KJvJnEGiBoTN3ecMm3PRFRDaFG/Bh8Ibke XoNzlo4mw1Q3lb/7imfbfRWneKZsuwsVfBCfQ0+ot780pZY2dhiKTeN9btwufKef63Tf2NcJsCU qveyprWVI1wXR/TrETMQhtwY/gLKmF92+1qflHubbdGl95yRX/gNP7YZdP9ni7rgNWpQ09h6cmP QULbYbKIMp4ItECxRBvtI5aTEwDZiehNu1B7JkNkfiKwzXBIAgIAQgX/Mf75qOgrT23Fp9cB2BA eLsWSQPpqENyziG1PiwXQYrritpr1nPwD3GjSOo8O8/PaJVMDuNgonk= X-Google-Smtp-Source: AGHT+IEiRsxAkVrXgPCAZV3F4X2CztHeRG9ctQ5zIhdFUM3PU84EJKKoITEP995ACO1Ck8FEqkm68g== X-Received: by 2002:a05:6000:18a6:b0:39e:cbe3:17c8 with SMTP id ffacd0b85a97d-3a09fd6ce46mr7930291f8f.12.1746537025293; Tue, 06 May 2025 06:10:25 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:24 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:09 +0200 Subject: [PATCH 2/4] mailbox: qcom-apcs-ipc: Assign OF node to clock controller child device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-2-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 Currently, the child device for the clock controller inside the APCS block is created without any OF node assigned, so the drivers need to rely on the parent device for obtaining any resources. Add support for defining the clock controller inside a "clock-controller" subnode to break up circular dependencies between the mailbox and required parent clocks of the clock controller. For backwards compatibility, if the subnode is not defined, reuse the OF node from the parent device. Signed-off-by: Stephan Gerhold Reviewed-by: Dmitry Baryshkov --- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom= -apcs-ipc-mailbox.c index 11c41e935a3619b74ad0f5e2d82699ca8aa05722..8b24ec0fa191efc975625d9b927= 0140ad1fe7b9b 100644 --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c @@ -116,10 +116,18 @@ static int qcom_apcs_ipc_probe(struct platform_device= *pdev) } =20 if (apcs_data->clk_name) { - apcs->clk =3D platform_device_register_data(&pdev->dev, - apcs_data->clk_name, - PLATFORM_DEVID_AUTO, - NULL, 0); + struct device_node *np =3D of_get_child_by_name(pdev->dev.of_node, + "clock-controller"); + struct platform_device_info pdevinfo =3D { + .parent =3D &pdev->dev, + .name =3D apcs_data->clk_name, + .id =3D PLATFORM_DEVID_AUTO, + .fwnode =3D of_fwnode_handle(np) ?: pdev->dev.fwnode, + .of_node_reused =3D !np, + }; + + apcs->clk =3D platform_device_register_full(&pdevinfo); + of_node_put(np); if (IS_ERR(apcs->clk)) dev_err(&pdev->dev, "failed to register APCS clk\n"); } --=20 2.47.2 From nobody Tue Dec 16 15:25:10 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 24358280325 for ; Tue, 6 May 2025 13:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537030; cv=none; b=usAfCSTO22cNIV99NY6XxIaVfvC6SZ7ttLIRK4zU/Pg0vysY49R7svB/OyfHV6xMrIJxvK4ttjjkGJL88xv81pV4ZEE5nYMsveBDgSyTXYdTvuA9Sr/ebJHqa8Eu/HhTaIRD2wChfQYjz0ciruLYZX5CD8XxhmbXtgkFoBYMSYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537030; c=relaxed/simple; bh=yxf14Ljk58+UMoTg7Yyge6qVosH5ZXrWvi6A5xwpE58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q6HBLMTs60NVB78RdvW0N/pmhLVu8BoTww7Gg0aF6oOSbGet8diEh5hP4SI2ykeL/aAq8HMMulqtaio70OJcPiE30AJKwC0WzhbNX6KUfiHy+hs/0yTmcdoc7+Avlumk3TS5er52i2e01cBzrfiHNt38pft/VrQ2zIjA9d/YwA0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=cptEZha7; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cptEZha7" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43cfe574976so35862375e9.1 for ; Tue, 06 May 2025 06:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537026; x=1747141826; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TgxrymKBqlMpBOa4fXvZbXrP4W9uX8YtK+8DIxg3UAo=; b=cptEZha7oz2gk4leZ3179fl5bOD1MXNRE9fZM93udsp24gxoJexzpHeE9lWgsMrf3Y blVG1y8SxyHSw0abw7cZlHaLw8c9v+6qBiFTQeuY9p/F9t9FqTarACbaCXvWQjECZQ1/ PBh2omLc6+OuxVSqM1XMzYU6ZslauQikCob2oimdrtEl0YFX/A3vBFHiU/37lvVudOWx E9yjaXKNGEDbalAquXZCCiAHl0YBcE/tPOqAxJMuMcZ+ChcLNc4pc72irqY/OE7kNWK7 LldukcY+Z7bn0Bqy8AIAV9obrgGcXfgBcYV3m36H73i6EKmHXGV2TnRiWIzQw8FGOIjB MtqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537026; x=1747141826; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TgxrymKBqlMpBOa4fXvZbXrP4W9uX8YtK+8DIxg3UAo=; b=KIe4jK0MyzXo3vEfqqrN0GnWA5N1M1ztkrtT0lSPjVwo704iO50a2J7Izr/tg/4ILA rqTe4/ZybnzADLN8qrnE2yi3Vzfr43RtqCIU0vssdAmgA5hAkZiX/g4eJGfRDWiz4J50 Hwc9baBc9UziZEfTkVqBFOPkLCcC4gNlRXaMNUiV6QKLK8Zbft7qSIM648NIpxv8p1O+ Ts/lQQf7gDwnQMSlKtc/vuJPYDVr47Tbd8U7YL4kuWpr13YbB7NN1KROEvwg/cEDcpn6 wu18PdRPAVd5wee8JgZpCgzMqpfWGzez+UdUpSD/sFD+hRLpj3tQhsU0oViQ/lY/Sp7e uweg== X-Forwarded-Encrypted: i=1; AJvYcCVLNQX6wYy+AiMK5mIOc+NJfnrpK5fX2XlNdw/efIQBZ+QizsHOGkRfp0UwDDLaaaASPINVLbQQS98OSaw=@vger.kernel.org X-Gm-Message-State: AOJu0YxdDkkUouOjaLD0iKnHKYGRSTwWLNNGFaWRXgCznK4xFaKnSrPC E4ZxIrT8JbsdESKTiGbhyk1/cfHn7rCMnntr+FZZ1jiHhmkt8VKWQa/QyzqsSLuS4WSUZWZpSUu S X-Gm-Gg: ASbGncsU3sgrOjYZkx98pfqRC32lwJ2MJOX9hXSvQC+uoMTXZhcOxbliUH2C36oOvDf IMk8APPRBPGE0KjaozBrBjtRQNH3ZwECRmfXjlrRGZ65tW9Qb5ibHSjVfeJRxXsZ+vLOR1m3cO/ 2MEmjKKMeCg1D78kpD6Rbz32DzyMjW9U0sgH4IQacFnaoqtPuYHdIOGRquC0ecukg7nPtHGyPDh /tdzHQZlZzjkY3Htx8wphlid69ZBZ4x3j/JWZNLVi8rmcB4VnBfp3Ce6ckltO/+t8afUmrYKIf9 iU9jT9HFhJKyBfL9E5i2bT9zIQhbcAXZADXGJiaXGYGy1sqlqoqcemCUtj+Ds2Dbbg== X-Google-Smtp-Source: AGHT+IH4gKCkUyIZVMKUSRcuZsuNAPJ6O+y8mkjQv/iAU3euFY+19csLb2q2NlIB4YzdYULF7KFX4w== X-Received: by 2002:a05:600c:350e:b0:43c:e478:889 with SMTP id 5b1f17b1804b1-441bbe2c815mr163710535e9.0.1746537026227; Tue, 06 May 2025 06:10:26 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:25 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:10 +0200 Subject: [PATCH 3/4] clk: qcom: apcs-msm8916: Obtain clock from own OF node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-3-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 So far we had to obtain all resources like clocks from the parent device, because the qcom-apcs-msm8916-clk platform device did not have an own OF node assigned. Now that the parent mailbox driver assigns this, obtain the resources directly from the assigned OF node to add support for describing the clock controller in a separate child node. This allows breaking up circular dependencies between the mailbox and the clock controller. Signed-off-by: Stephan Gerhold --- @Bjorn: If this looks good to you and you are fine with merging this through the mailbox subsystem, could you provide an Acked-by here? --- drivers/clk/qcom/apcs-msm8916.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm891= 6.c index ef31386831ebd2404b99edaeff4c95a31eb68477..af60f3ab1f82068e5ab046ee4a2= 231c7fb85ff41 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -82,7 +82,7 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_de= vice *pdev) a53cc->src_shift =3D 8; a53cc->parent_map =3D gpll0_a53cc_map; =20 - a53cc->pclk =3D devm_clk_get(parent, NULL); + a53cc->pclk =3D devm_clk_get(dev, NULL); if (IS_ERR(a53cc->pclk)) { ret =3D PTR_ERR(a53cc->pclk); if (ret !=3D -EPROBE_DEFER) --=20 2.47.2 From nobody Tue Dec 16 15:25:10 2025 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 0F31B280338 for ; Tue, 6 May 2025 13:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537032; cv=none; b=Eycr+9vplzBNhuGup/DtnuMb0QGxNBObnw714/W8iSd9tyWNAcmW2YQ/XukIZqB2d7LiayLg+12GJUPr8hX+7qSE2goaImx9Fy/yp0lzSyRXa5RAvUDbkNPk12Y3HTBV+WJ55QAW5mEGST0rXPSG3Fx+ivn2+uzCxAyLCQYpDPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746537032; c=relaxed/simple; bh=dYgm4NlH5IPfrUOXQB7Rxpf3oTIhlLONuVDqq3iAZvo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qOPAZTiimd54J6gNJOv+pEi1fWB+7uyNd3H9SQgt8ktYuwASBMb28/vI+iWiW+DxeWs8rQWavimZwipIS9TKBEUmNRsU1u9nCaC4MuBwKzuhbcWr+s9mQmBpiv/F1xx8V04JSHjIWZIgV7WpucncB12AoBsNtmt/AwO5rdMcYxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=h/l2YURg; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="h/l2YURg" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43edecbfb94so47568535e9.1 for ; Tue, 06 May 2025 06:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746537027; x=1747141827; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TjTp/aG9h3L2/xPCCH1ShAi5uTe++Ief7FWXdc/5tOU=; b=h/l2YURgLeT+rf4NEzDX2p0MgKrifr0yHvBozo8IhI0tq7YA/GgReFHjp9R9c88c+q OdFNMPs/fcYQ7wBc3YSP9H1gLZecg1H/4CvgCAXwWo71igwMtX0diLJuTBPc71kL73k2 pqYMvYUd52RrcE4AAAPCyZAKwHhLaiSA/jm2Wa+Ti6efiJD/FvqlRStvOUqrkKhDutEI K/38joCVEfpXtC3wDUYd6Bi2Nwd+ME6L2nf7OdkzWHU9YY3LQUw8RUCwW6EfnWSRtDa7 qJub9sDhtCWEOIwnTYfCUmaa9Mg+TeqGcEJxCFXNatrlwmKGU+2+UWZ1eDqI6y/cDUfZ XDrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746537027; x=1747141827; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TjTp/aG9h3L2/xPCCH1ShAi5uTe++Ief7FWXdc/5tOU=; b=kaaJG/2bDaZ2TjW8bidni1rp9GAaLubienGy1y8zcemqiUgWTrVTdYZ2S56re5W8hk 0j2kSu8xu3kQWbXEeE1t1GnCAmDduz6FN1gjpXFe4ae53cJ5AuTVyhsJ39Ns5mhBs7Tg 76LoWSKX82bPxznNawp/HOKuzQ6QvzNY8gHyY0kng0xnV5+fnFUVBUtga3kFGwA2cmli xHqBnkZl9QW3S+4KxM06TzsuQd+Z60nSUQXfLWx6p2OZLiUqgPmdwvSm13JUMmgqMHO1 R41kxUKCcn53woSN/jw3z2B/ZzufDE1Jh9yn1XFwaCkibiBNYJybnknvDa0VlNUh3oOR TJfw== X-Forwarded-Encrypted: i=1; AJvYcCWBOrk3VHFaEQEuRg+9LB5CednqH/MXrHXaYUmqdGB0a1GIVqN4ZRIXMII5oNLM32FkNo2R/jDn4Fa5Us4=@vger.kernel.org X-Gm-Message-State: AOJu0YzIGhEMZQzCsWlUMVnFYtirNaD78wXeQOMsUZT72/mhjsOKSjlM LjKuDr6yy72RSO54WqiUR0OQrppk5wfUzcCWR0RD3ecHkQdEIVbA5ORPKHBgBnw= X-Gm-Gg: ASbGncsGmC/1DIdg0yqrdGuvmCzGLyAJ8DE0eUA/VwQwRJXg3Ija5jiVW1c1y8SdATt EmL6pnImgodXs4B9Vg8+NqP7Lp63WOyAd1PSr+Qg5rvlhcXS/1d2AgSiu4idDSHYJ651T2ToxHC Jy0+hNB3J3d4405H8vLiu+kRhlQOrvpbVdWpnBMpzjAGFesrk6hF+niYT6so7k7kiAYDi4P9NGV QWVKgxi+4aj/dKHpJ84Ccp0SEkdaV0IK/3I/rrjEwk2MEaeACrdaLzMxhvGbyAPCILRVDsZEJxn NZJwArwBoqk6SA5ZrOYFLImj8HxzOOfSfQGD7u/d9NZYlCPXeBe82fw= X-Google-Smtp-Source: AGHT+IFaFB/FZezjripHyQEZgUYd+jxmBl3+AL6siEuRgHFWmNVit4blU6ZNo6pVl6a4NIiA+7gYKA== X-Received: by 2002:a05:600c:1c84:b0:43c:eeee:b713 with SMTP id 5b1f17b1804b1-441c4919f07mr78232605e9.20.1746537027193; Tue, 06 May 2025 06:10:27 -0700 (PDT) Received: from [127.0.0.2] ([2a02:2454:ff21:ef41:3f93:4614:996d:f5f7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a0af3255afsm1771268f8f.66.2025.05.06.06.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 May 2025 06:10:26 -0700 (PDT) From: Stephan Gerhold Date: Tue, 06 May 2025 15:10:11 +0200 Subject: [PATCH 4/4] clk: qcom: apcs-sdx55: Obtain clock from own OF node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250506-qcom-apcs-mailbox-cc-v1-4-b54dddb150a5@linaro.org> References: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> In-Reply-To: <20250506-qcom-apcs-mailbox-cc-v1-0-b54dddb150a5@linaro.org> To: Jassi Brar , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Georgi Djakov , Manivannan Sadhasivam X-Mailer: b4 0.14.2 So far we had to obtain all resources like clocks from the parent device, because the qcom-sdx55-acps-clk platform device did not have an own OF node assigned. Now that the parent mailbox driver assigns this, obtain the resources directly from the assigned OF node to add support for describing the clock controller in a separate child node. This allows breaking up circular dependencies between the mailbox and the clock controller. Signed-off-by: Stephan Gerhold --- @Bjorn: If this looks good to you and you are fine with merging this through the mailbox subsystem, could you provide an Acked-by here? --- drivers/clk/qcom/apcs-sdx55.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/apcs-sdx55.c b/drivers/clk/qcom/apcs-sdx55.c index 76ece6c4a969266aecb32806269c791712f98804..e0e779a81f2c6b8b9cd34d839ee= e9aaf9fa33f03 100644 --- a/drivers/clk/qcom/apcs-sdx55.c +++ b/drivers/clk/qcom/apcs-sdx55.c @@ -79,7 +79,7 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_devi= ce *pdev) a7cc->src_shift =3D 8; a7cc->parent_map =3D apcs_mux_clk_parent_map; =20 - a7cc->pclk =3D devm_clk_get(parent, "pll"); + a7cc->pclk =3D devm_clk_get(dev, "pll"); if (IS_ERR(a7cc->pclk)) return dev_err_probe(dev, PTR_ERR(a7cc->pclk), "Failed to get PLL clk\n"); --=20 2.47.2