All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [OE-core] [PATCH] systemd-boot: upgrade 253.1 -> 253.3
From: Khem Raj @ 2023-04-10 17:11 UTC (permalink / raw)
  To: wangmy; +Cc: openembedded-core
In-Reply-To: <1681117459-24898-4-git-send-email-wangmy@fujitsu.com>

This also upgrades systemd and not only systemd-boot, Secondly also
check a musl build with systemd when doing upgrades to ensure
the musl patches can still apply cleanly, otherwise it leaves some
cleanup for others, See [1]

[1] https://lists.openembedded.org/g/openembedded-core/message/179895

On Mon, Apr 10, 2023 at 2:04 AM wangmy <wangmy@fujitsu.com> wrote:
>
> From: Wang Mingyu <wangmy@fujitsu.com>
>
> Changelog:
> https://github.com/systemd/systemd-stable/blob/v253.3/NEWS
>
> 0025-systemctl-explicitly-cast-the-constants-to-uint64_t.patch
> removed since it's included in 253.3
>
> Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
> ---
>  ...md-boot_253.1.bb => systemd-boot_253.3.bb} |  0
>  meta/recipes-core/systemd/systemd.inc         |  3 +-
>  ...citly-cast-the-constants-to-uint64_t.patch | 44 -------------------
>  3 files changed, 1 insertion(+), 46 deletions(-)
>  rename meta/recipes-core/systemd/{systemd-boot_253.1.bb => systemd-boot_253.3.bb} (100%)
>  delete mode 100644 meta/recipes-core/systemd/systemd/0025-systemctl-explicitly-cast-the-constants-to-uint64_t.patch
>
> diff --git a/meta/recipes-core/systemd/systemd-boot_253.1.bb b/meta/recipes-core/systemd/systemd-boot_253.3.bb
> similarity index 100%
> rename from meta/recipes-core/systemd/systemd-boot_253.1.bb
> rename to meta/recipes-core/systemd/systemd-boot_253.3.bb
> diff --git a/meta/recipes-core/systemd/systemd.inc b/meta/recipes-core/systemd/systemd.inc
> index 14608f9abc..d50f2c9cba 100644
> --- a/meta/recipes-core/systemd/systemd.inc
> +++ b/meta/recipes-core/systemd/systemd.inc
> @@ -14,11 +14,10 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
>  LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
>                      file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
>
> -SRCREV = "6c327d74aa0d350482e82a247d7018559699798d"
> +SRCREV = "ed18c2ab79e8b94182d5dcf31d58457763f3e3e1"
>  SRCBRANCH = "v253-stable"
>  SRC_URI = "git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH} \
>             file://0026-src-boot-efi-efi-string.c-define-wchar_t-from-__WCHA.patch \
> -           file://0025-systemctl-explicitly-cast-the-constants-to-uint64_t.patch \
>             "
>
>  S = "${WORKDIR}/git"
> diff --git a/meta/recipes-core/systemd/systemd/0025-systemctl-explicitly-cast-the-constants-to-uint64_t.patch b/meta/recipes-core/systemd/systemd/0025-systemctl-explicitly-cast-the-constants-to-uint64_t.patch
> deleted file mode 100644
> index d840de870f..0000000000
> --- a/meta/recipes-core/systemd/systemd/0025-systemctl-explicitly-cast-the-constants-to-uint64_t.patch
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -From fad29ce1f5cc7b12bc13671d9ad80775771a67eb Mon Sep 17 00:00:00 2001
> -From: Frantisek Sumsal <frantisek@sumsal.cz>
> -Date: Fri, 3 Mar 2023 12:17:27 +0100
> -Subject: [PATCH] systemctl: explicitly cast the constants to uint64_t
> -
> -Otherwise under certain conditions `va_arg()` might get garbage instead
> -of the expected value, i.e.:
> -
> -$ sudo build-o0/systemctl disable asdfasfaf
> -sd_bus_message_appendv: Got uint64_t: 0
> -Failed to disable unit: Unit file asdfasfaf.service does not exist.
> -
> -$ sudo build-o1/systemctl disable asdfasfaf
> -sd_bus_message_appendv: Got uint64_t: 7954875719681572864
> -Failed to disable unit: Invalid argument
> -
> -(reproduced on an armv7hl machine)
> -
> -Resolves: #26568
> -Follow-up to: bf1bea43f15
> -Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735
> -
> -Upstream-Status: Backport [https://github.com/systemd/systemd/commit/c63bfd0884cf20e48befbee49d41f667660a8802]
> -Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ----
> - src/systemctl/systemctl-enable.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c
> -index 86d9f602fa..f94a286122 100644
> ---- a/src/systemctl/systemctl-enable.c
> -+++ b/src/systemctl/systemctl-enable.c
> -@@ -211,7 +211,7 @@ int verb_enable(int argc, char *argv[], void *userdata) {
> -
> -                 if (send_runtime) {
> -                         if (streq(method, "DisableUnitFilesWithFlagsAndInstallInfo"))
> --                                r = sd_bus_message_append(m, "t", arg_runtime ? UNIT_FILE_RUNTIME : 0);
> -+                                r = sd_bus_message_append(m, "t", arg_runtime ? (uint64_t) UNIT_FILE_RUNTIME : UINT64_C(0));
> -                         else
> -                                 r = sd_bus_message_append(m, "b", arg_runtime);
> -                         if (r < 0)
> ---
> -2.39.2
> -
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#179866): https://lists.openembedded.org/g/openembedded-core/message/179866
> Mute This Topic: https://lists.openembedded.org/mt/98172014/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply

* Re: [PATCH 1/2] KVM: VMX: Use kvm_read_cr4() to get cr4 value
From: Sean Christopherson @ 2023-04-10 17:11 UTC (permalink / raw)
  To: Xiaoyao Li; +Cc: Paolo Bonzini, kvm, linux-kernel
In-Reply-To: <20230410125017.1305238-2-xiaoyao.li@intel.com>

On Mon, Apr 10, 2023, Xiaoyao Li wrote:
> Directly use vcpu->arch.cr4 is not recommended since it gets stale value
> if the cr4 is not available.
> 
> Use kvm_read_cr4() instead to ensure correct value.
> 
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
>  arch/x86/kvm/vmx/vmx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index d7bf14abdba1..befa2486836b 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -3431,7 +3431,7 @@ static bool vmx_is_valid_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
>  
>  void vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
>  {
> -	unsigned long old_cr4 = vcpu->arch.cr4;
> +	unsigned long old_cr4 = kvm_read_cr4(vcpu);

Ha!  I've been tempted to change this multiple times, but always thought I was
just being a bit obsessive :-)

Patches look good, but I'm going to hold them for 6.5 just in case this somehow
causes a problem, e.g. if there's a bizzaro nested path that "works" because KVM
_doesn't_ decache info from the current VMCS.

^ permalink raw reply

* [PATCH v8 2/2] arm64: dts: qcom: sm6115: Add USB SS qmp phy node
From: Bhupesh Sharma @ 2023-04-10 17:10 UTC (permalink / raw)
  To: linux-arm-msm, devicetree, linux-phy
  Cc: agross, linux-kernel, andersson, bhupesh.sharma, bhupesh.linux,
	krzysztof.kozlowski, robh+dt, konrad.dybcio, kishon, vkoul,
	krzysztof.kozlowski+dt
In-Reply-To: <20230410171010.2561393-1-bhupesh.sharma@linaro.org>

Add USB superspeed qmp phy node to dtsi.

Make sure that the various board dts files (which include sm4250.dtsi file)
continue to work as intended.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 .../boot/dts/qcom/sm4250-oneplus-billie2.dts  |  3 ++
 arch/arm64/boot/dts/qcom/sm6115.dtsi          | 29 +++++++++++++++++--
 .../boot/dts/qcom/sm6115p-lenovo-j606f.dts    |  3 ++
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts b/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts
index a1f0622db5a0..75951fd439df 100644
--- a/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts
+++ b/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts
@@ -242,6 +242,9 @@ &usb {
 &usb_dwc3 {
 	maximum-speed = "high-speed";
 	dr_mode = "peripheral";
+
+	phys = <&usb_hsphy>;
+	phy-names = "usb2-phy";
 };
 
 &usb_hsphy {
diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi
index 2505c815c65a..b2ea8f13e827 100644
--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi
@@ -651,6 +651,31 @@ usb_hsphy: phy@1613000 {
 			status = "disabled";
 		};
 
+		usb_qmpphy: phy@1615000 {
+			compatible = "qcom,sm6115-qmp-usb3-phy";
+			reg = <0x0 0x01615000 0x0 0x200>;
+
+			clocks = <&gcc GCC_AHB2PHY_USB_CLK>,
+				 <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+				 <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>,
+				 <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+			clock-names = "cfg_ahb",
+				      "ref",
+				      "com_aux",
+				      "pipe";
+
+			resets = <&gcc GCC_USB3_PHY_PRIM_SP0_BCR>,
+				 <&gcc GCC_USB3PHY_PHY_PRIM_SP0_BCR>;
+			reset-names = "phy", "phy_phy";
+
+			#clock-cells = <0>;
+			clock-output-names = "usb3_phy_pipe_clk_src";
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
 		qfprom@1b40000 {
 			compatible = "qcom,sm6115-qfprom", "qcom,qfprom";
 			reg = <0x0 0x01b40000 0x0 0x7000>;
@@ -1101,8 +1126,8 @@ usb_dwc3: usb@4e00000 {
 				compatible = "snps,dwc3";
 				reg = <0x0 0x04e00000 0x0 0xcd00>;
 				interrupts = <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>;
-				phys = <&usb_hsphy>;
-				phy-names = "usb2-phy";
+				phys = <&usb_hsphy>, <&usb_ssphy>;
+				phy-names = "usb2-phy", "usb3-phy";
 				iommus = <&apps_smmu 0x120 0x0>;
 				snps,dis_u2_susphy_quirk;
 				snps,dis_enblslpm_quirk;
diff --git a/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts b/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts
index 10c9d338446c..d60cc024749b 100644
--- a/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts
+++ b/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts
@@ -280,6 +280,9 @@ &usb {
 &usb_dwc3 {
 	maximum-speed = "high-speed";
 	dr_mode = "peripheral";
+
+	phys = <&usb_hsphy>;
+	phy-names = "usb2-phy";
 };
 
 &usb_hsphy {
-- 
2.38.1


^ permalink raw reply related

* [PATCH v8 1/2] dt-bindings: phy: qcom,qmp-usb: Drop legacy bindings and move to newer one (SM6115 & QCM2290)
From: Bhupesh Sharma @ 2023-04-10 17:10 UTC (permalink / raw)
  To: linux-arm-msm, devicetree, linux-phy
  Cc: agross, linux-kernel, andersson, bhupesh.sharma, bhupesh.linux,
	krzysztof.kozlowski, robh+dt, konrad.dybcio, kishon, vkoul,
	krzysztof.kozlowski+dt
In-Reply-To: <20230410171010.2561393-1-bhupesh.sharma@linaro.org>

'qcom,msm8996-qmp-usb3-phy.yaml' defines bindings for several PHYs
which predate USB -> USB+DP migration. Since SM6115 and QCM2290
nodes for USB QMP phy are being added to dtsi files by followup patches,
move these bindings instead to the newer style
'qcom,sc8280xp-qmp-usb3-uni-phy.yaml' file.

Since no device trees use these bindings presently, so we have no ABI breakages
with this patch.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 .../phy/qcom,msm8996-qmp-usb3-phy.yaml        | 27 ------------
 .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml   | 44 ++++++++++++++++---
 2 files changed, 39 insertions(+), 32 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
index e81a38281f8c..4c96dab5b9e3 100644
--- a/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
@@ -23,14 +23,12 @@ properties:
       - qcom,ipq8074-qmp-usb3-phy
       - qcom,msm8996-qmp-usb3-phy
       - qcom,msm8998-qmp-usb3-phy
-      - qcom,qcm2290-qmp-usb3-phy
       - qcom,sc7180-qmp-usb3-phy
       - qcom,sc8180x-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-uni-phy
       - qcom,sdx55-qmp-usb3-uni-phy
       - qcom,sdx65-qmp-usb3-uni-phy
-      - qcom,sm6115-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-uni-phy
       - qcom,sm8250-qmp-usb3-phy
@@ -248,29 +246,6 @@ allOf:
             - const: phy
             - const: common
 
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,qcm2290-qmp-usb3-phy
-              - qcom,sm6115-qmp-usb3-phy
-    then:
-      properties:
-        clocks:
-          maxItems: 3
-        clock-names:
-          items:
-            - const: cfg_ahb
-            - const: ref
-            - const: com_aux
-        resets:
-          maxItems: 2
-        reset-names:
-          items:
-            - const: phy_phy
-            - const: phy
-
   - if:
       properties:
         compatible:
@@ -318,12 +293,10 @@ allOf:
             enum:
               - qcom,ipq6018-qmp-usb3-phy
               - qcom,ipq8074-qmp-usb3-phy
-              - qcom,qcm2290-qmp-usb3-phy
               - qcom,sc7180-qmp-usb3-phy
               - qcom,sc8180x-qmp-usb3-phy
               - qcom,sdx55-qmp-usb3-uni-phy
               - qcom,sdx65-qmp-usb3-uni-phy
-              - qcom,sm6115-qmp-usb3-phy
               - qcom,sm8150-qmp-usb3-uni-phy
               - qcom,sm8250-qmp-usb3-phy
     then:
diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
index 16fce1038285..05335e6bbb58 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
@@ -16,7 +16,9 @@ description:
 properties:
   compatible:
     enum:
+      - qcom,qcm2290-qmp-usb3-phy
       - qcom,sc8280xp-qmp-usb3-uni-phy
+      - qcom,sm6115-qmp-usb3-phy
 
   reg:
     maxItems: 1
@@ -25,11 +27,7 @@ properties:
     maxItems: 4
 
   clock-names:
-    items:
-      - const: aux
-      - const: ref
-      - const: com_aux
-      - const: pipe
+    maxItems: 4
 
   power-domains:
     maxItems: 1
@@ -71,6 +69,42 @@ required:
 
 additionalProperties: false
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,qcm2290-qmp-usb3-phy
+              - qcom,sm6115-qmp-usb3-phy
+    then:
+      properties:
+        clocks:
+          maxItems: 4
+        clock-names:
+          items:
+            - const: cfg_ahb
+            - const: ref
+            - const: com_aux
+            - const: pipe
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sc8280xp-qmp-usb3-uni-phy
+    then:
+      properties:
+        clocks:
+          maxItems: 4
+        clock-names:
+          items:
+            - const: aux
+            - const: ref
+            - const: com_aux
+            - const: pipe
+
 examples:
   - |
     #include <dt-bindings/clock/qcom,gcc-sc8280xp.h>
-- 
2.38.1


^ permalink raw reply related

* [PATCH v8 0/2] Enable USB SS qmp phy for Qualcomm SM6115 SoC
From: Bhupesh Sharma @ 2023-04-10 17:10 UTC (permalink / raw)
  To: linux-arm-msm, devicetree, linux-phy
  Cc: agross, linux-kernel, andersson, bhupesh.sharma, bhupesh.linux,
	krzysztof.kozlowski, robh+dt, konrad.dybcio, kishon, vkoul,
	krzysztof.kozlowski+dt

Changes since v7:
-----------------
- v7 can be seen here: https://lore.kernel.org/linux-arm-msm/20230409200934.2329297-1-bhupesh.sharma@linaro.org/
- Addressed review comments from Dmitry and added "pipe clk".

Changes since v6:
-----------------
- v6 can be seen here: https://lore.kernel.org/linux-arm-msm/20230407061122.2036838-1-bhupesh.sharma@linaro.org/
- Addressed review comments from Bjorn and Dmitry and dropped old bindings in this
  version.

Changes since v5:
-----------------
- v5 can be seen here: https://lore.kernel.org/linux-arm-msm/20230405191633.1864671-1-bhupesh.sharma@linaro.org/
- Addressed review comments from Dmitry and made [PATCH 1/2] compatible with his 
  'split away legacy USB+DP code' series:
  <https://patchwork.kernel.org/project/linux-phy/cover/20230324215550.1966809-1-dmitry.baryshkov@linaro.org>

Changes since v4:
-----------------
- v4 can be seen here: https://lore.kernel.org/linux-arm-msm/20230401154725.1059563-1-bhupesh.sharma@linaro.org/ 
- Collected Krzysztof's Ack for [PATCH 1/2].
- Added more descriptive commit logs as per Dmitry's comments on v4.

Changes since v3:
-----------------
- v3 can be seen here: https://lore.kernel.org/linux-arm-msm/20221215094532.589291-4-bhupesh.sharma@linaro.org/
- Fixed v4 as per the downstream driver code: https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/heads/android-msm-bramble-4.19-android11-qpr1/qcom/bengal-usb.dtsi#296

This patchset adds the support for USB SS qmp phy for Qualcomm SM6115
SoC. For the previous versions of this patch there were conversations
on irc as to whether this was a 'qcom,usb-ssphy-qmp-usb3-or-dp' or a
'qcom,usb-ssphy-qmp-dp-combo' as per downstream code and hardware
documentation.

But after a careful look at downstream dtsi (see [1]) it appears that
this indeed is a 'qcom,usb-ssphy-qmp-usb3-or-dp' phy and not a
'dp-combo' phy.

[1]. https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/heads/android-msm-bramble-4.19-android11-qpr1/qcom/bengal-usb.dtsi#296

Bhupesh Sharma (2):
  dt-bindings: phy: qcom,qmp-usb: Drop legacy bindings and move to newer
    one (SM6115 & QCM2290)
  arm64: dts: qcom: sm6115: Add USB SS qmp phy node

 .../phy/qcom,msm8996-qmp-usb3-phy.yaml        | 27 ------------
 .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml   | 44 ++++++++++++++++---
 .../boot/dts/qcom/sm4250-oneplus-billie2.dts  |  3 ++
 arch/arm64/boot/dts/qcom/sm6115.dtsi          | 29 +++++++++++-
 .../boot/dts/qcom/sm6115p-lenovo-j606f.dts    |  3 ++
 5 files changed, 72 insertions(+), 34 deletions(-)

-- 
2.38.1


^ permalink raw reply

* Re: [PATCH 14/16] bsd-user: Implment core dumps
From: Warner Losh @ 2023-04-10 17:09 UTC (permalink / raw)
  To: Richard Henderson
  Cc: qemu-devel, reinoud, riastradh, ryoon, jrtc27, kevans, Brad Smith,
	Stacey Son, Ed Schouten
In-Reply-To: <CANCZdfpoO_bSn6BObQT+Dy=cON_MBFODGQU3OjHyzgu1bggt+w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3196 bytes --]

On Sat, Apr 8, 2023 at 11:00 PM Warner Losh <imp@bsdimp.com> wrote:

>
>
> On Sat, Apr 8, 2023 at 1:15 PM Richard Henderson <
> richard.henderson@linaro.org> wrote:
>
>> On 4/5/23 14:36, Warner Losh wrote:
>> > From: Stacey Son <sson@FreeBSD.org>
>> >
>> > Bring in the code that was originally copied from linxu-user/elfload.c
>> > and moved to elfcore.c. This code then removed the Linux specific bits,
>> > replacing them with FreeBSD specific bits. The commit history for this
>> > is not at all what we'd like (it was done in one go by sson in
>> > 227070562fc in one commit, with very few followup tweaks). Since the
>> > original commit, this code has been moved, and updated by sson and ed
>> > slightly. That makes it hard to split into smaller commits.
>> >
>> > Signed-off-by: Stacey Son <sson@FreeBSD.org>
>> > Signed-off-by: Ed Schouten <ed@nuxi.nl>
>> > Signed-off-by: Warner Losh <imp@bsdimp.com>
>> > ---
>> >   bsd-user/elfcore.c | 1318 +++++++++++++++++++++++++++++++++++++++++++-
>> >   1 file changed, 1315 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/bsd-user/elfcore.c b/bsd-user/elfcore.c
>> > index c49d9280e2d..2905f2b8414 100644
>> > --- a/bsd-user/elfcore.c
>> > +++ b/bsd-user/elfcore.c
>> > @@ -1,10 +1,1322 @@
>> > -/* Stubbed out version of core dump support, explicitly in public
>> domain */
>> > +/*
>> > + *  ELF loading code
>> > + *
>> > + *  Copyright (c) 2015 Stacey D. Son
>> > + *
>> > + *  This program is free software; you can redistribute it and/or
>> modify
>> > + *  it under the terms of the GNU General Public License as published
>> by
>> > + *  the Free Software Foundation; either version 2 of the License, or
>> > + *  (at your option) any later version.
>> > + *
>> > + *  This program is distributed in the hope that it will be useful,
>> > + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> > + *  GNU General Public License for more details.
>> > + *
>> > + *  You should have received a copy of the GNU General Public License
>> > + *  along with this program; if not, see <http://www.gnu.org/licenses/
>> >.
>> > + */
>> > +#include "qemu/osdep.h"
>> >
>> > -static int elf_core_dump(int signr, CPUArchState *env)
>> > +#ifdef USE_ELF_CORE_DUMP
>>
>> Would this ever be unset?
>>
>
> I was sure that some architectures didn't use this. However, they all have
> them, so I'll
> remove it.
>

I'll remove it as a separate commit since it affects other files as well
that currently define it.

Warner


> Typo in subject.
>>
>
> Doh! Yes. Thanks.
>
>
>> I'm not going to review this one line by line, but
>>
>> Acked-by: Richard Henderson <richard.henderson@linaro.org>
>>
>
> I've looked at this at a high level, and it seems legit...  But it is a
> bit daunting... And for a 'debug' feature,
> I'm OK with 'working and looks OK'... If it were more central, I'd worry
> more about it, but we still have
> about 20k lines to upstream and I'd rather more of them be looked at than
> this if push comes to shove....
>
> Warner
>
>
>> r~
>>
>

[-- Attachment #2: Type: text/html, Size: 5081 bytes --]

^ permalink raw reply

* [PATCH v8 2/2] arm64: dts: qcom: sm6115: Add USB SS qmp phy node
From: Bhupesh Sharma @ 2023-04-10 17:10 UTC (permalink / raw)
  To: linux-arm-msm, devicetree, linux-phy
  Cc: agross, linux-kernel, andersson, bhupesh.sharma, bhupesh.linux,
	krzysztof.kozlowski, robh+dt, konrad.dybcio, kishon, vkoul,
	krzysztof.kozlowski+dt
In-Reply-To: <20230410171010.2561393-1-bhupesh.sharma@linaro.org>

Add USB superspeed qmp phy node to dtsi.

Make sure that the various board dts files (which include sm4250.dtsi file)
continue to work as intended.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 .../boot/dts/qcom/sm4250-oneplus-billie2.dts  |  3 ++
 arch/arm64/boot/dts/qcom/sm6115.dtsi          | 29 +++++++++++++++++--
 .../boot/dts/qcom/sm6115p-lenovo-j606f.dts    |  3 ++
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts b/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts
index a1f0622db5a0..75951fd439df 100644
--- a/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts
+++ b/arch/arm64/boot/dts/qcom/sm4250-oneplus-billie2.dts
@@ -242,6 +242,9 @@ &usb {
 &usb_dwc3 {
 	maximum-speed = "high-speed";
 	dr_mode = "peripheral";
+
+	phys = <&usb_hsphy>;
+	phy-names = "usb2-phy";
 };
 
 &usb_hsphy {
diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi
index 2505c815c65a..b2ea8f13e827 100644
--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi
@@ -651,6 +651,31 @@ usb_hsphy: phy@1613000 {
 			status = "disabled";
 		};
 
+		usb_qmpphy: phy@1615000 {
+			compatible = "qcom,sm6115-qmp-usb3-phy";
+			reg = <0x0 0x01615000 0x0 0x200>;
+
+			clocks = <&gcc GCC_AHB2PHY_USB_CLK>,
+				 <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+				 <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>,
+				 <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+			clock-names = "cfg_ahb",
+				      "ref",
+				      "com_aux",
+				      "pipe";
+
+			resets = <&gcc GCC_USB3_PHY_PRIM_SP0_BCR>,
+				 <&gcc GCC_USB3PHY_PHY_PRIM_SP0_BCR>;
+			reset-names = "phy", "phy_phy";
+
+			#clock-cells = <0>;
+			clock-output-names = "usb3_phy_pipe_clk_src";
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
 		qfprom@1b40000 {
 			compatible = "qcom,sm6115-qfprom", "qcom,qfprom";
 			reg = <0x0 0x01b40000 0x0 0x7000>;
@@ -1101,8 +1126,8 @@ usb_dwc3: usb@4e00000 {
 				compatible = "snps,dwc3";
 				reg = <0x0 0x04e00000 0x0 0xcd00>;
 				interrupts = <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>;
-				phys = <&usb_hsphy>;
-				phy-names = "usb2-phy";
+				phys = <&usb_hsphy>, <&usb_ssphy>;
+				phy-names = "usb2-phy", "usb3-phy";
 				iommus = <&apps_smmu 0x120 0x0>;
 				snps,dis_u2_susphy_quirk;
 				snps,dis_enblslpm_quirk;
diff --git a/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts b/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts
index 10c9d338446c..d60cc024749b 100644
--- a/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts
+++ b/arch/arm64/boot/dts/qcom/sm6115p-lenovo-j606f.dts
@@ -280,6 +280,9 @@ &usb {
 &usb_dwc3 {
 	maximum-speed = "high-speed";
 	dr_mode = "peripheral";
+
+	phys = <&usb_hsphy>;
+	phy-names = "usb2-phy";
 };
 
 &usb_hsphy {
-- 
2.38.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related

* [PATCH v8 1/2] dt-bindings: phy: qcom,qmp-usb: Drop legacy bindings and move to newer one (SM6115 & QCM2290)
From: Bhupesh Sharma @ 2023-04-10 17:10 UTC (permalink / raw)
  To: linux-arm-msm, devicetree, linux-phy
  Cc: agross, linux-kernel, andersson, bhupesh.sharma, bhupesh.linux,
	krzysztof.kozlowski, robh+dt, konrad.dybcio, kishon, vkoul,
	krzysztof.kozlowski+dt
In-Reply-To: <20230410171010.2561393-1-bhupesh.sharma@linaro.org>

'qcom,msm8996-qmp-usb3-phy.yaml' defines bindings for several PHYs
which predate USB -> USB+DP migration. Since SM6115 and QCM2290
nodes for USB QMP phy are being added to dtsi files by followup patches,
move these bindings instead to the newer style
'qcom,sc8280xp-qmp-usb3-uni-phy.yaml' file.

Since no device trees use these bindings presently, so we have no ABI breakages
with this patch.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
---
 .../phy/qcom,msm8996-qmp-usb3-phy.yaml        | 27 ------------
 .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml   | 44 ++++++++++++++++---
 2 files changed, 39 insertions(+), 32 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
index e81a38281f8c..4c96dab5b9e3 100644
--- a/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,msm8996-qmp-usb3-phy.yaml
@@ -23,14 +23,12 @@ properties:
       - qcom,ipq8074-qmp-usb3-phy
       - qcom,msm8996-qmp-usb3-phy
       - qcom,msm8998-qmp-usb3-phy
-      - qcom,qcm2290-qmp-usb3-phy
       - qcom,sc7180-qmp-usb3-phy
       - qcom,sc8180x-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-phy
       - qcom,sdm845-qmp-usb3-uni-phy
       - qcom,sdx55-qmp-usb3-uni-phy
       - qcom,sdx65-qmp-usb3-uni-phy
-      - qcom,sm6115-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-phy
       - qcom,sm8150-qmp-usb3-uni-phy
       - qcom,sm8250-qmp-usb3-phy
@@ -248,29 +246,6 @@ allOf:
             - const: phy
             - const: common
 
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - qcom,qcm2290-qmp-usb3-phy
-              - qcom,sm6115-qmp-usb3-phy
-    then:
-      properties:
-        clocks:
-          maxItems: 3
-        clock-names:
-          items:
-            - const: cfg_ahb
-            - const: ref
-            - const: com_aux
-        resets:
-          maxItems: 2
-        reset-names:
-          items:
-            - const: phy_phy
-            - const: phy
-
   - if:
       properties:
         compatible:
@@ -318,12 +293,10 @@ allOf:
             enum:
               - qcom,ipq6018-qmp-usb3-phy
               - qcom,ipq8074-qmp-usb3-phy
-              - qcom,qcm2290-qmp-usb3-phy
               - qcom,sc7180-qmp-usb3-phy
               - qcom,sc8180x-qmp-usb3-phy
               - qcom,sdx55-qmp-usb3-uni-phy
               - qcom,sdx65-qmp-usb3-uni-phy
-              - qcom,sm6115-qmp-usb3-phy
               - qcom,sm8150-qmp-usb3-uni-phy
               - qcom,sm8250-qmp-usb3-phy
     then:
diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
index 16fce1038285..05335e6bbb58 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
@@ -16,7 +16,9 @@ description:
 properties:
   compatible:
     enum:
+      - qcom,qcm2290-qmp-usb3-phy
       - qcom,sc8280xp-qmp-usb3-uni-phy
+      - qcom,sm6115-qmp-usb3-phy
 
   reg:
     maxItems: 1
@@ -25,11 +27,7 @@ properties:
     maxItems: 4
 
   clock-names:
-    items:
-      - const: aux
-      - const: ref
-      - const: com_aux
-      - const: pipe
+    maxItems: 4
 
   power-domains:
     maxItems: 1
@@ -71,6 +69,42 @@ required:
 
 additionalProperties: false
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,qcm2290-qmp-usb3-phy
+              - qcom,sm6115-qmp-usb3-phy
+    then:
+      properties:
+        clocks:
+          maxItems: 4
+        clock-names:
+          items:
+            - const: cfg_ahb
+            - const: ref
+            - const: com_aux
+            - const: pipe
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sc8280xp-qmp-usb3-uni-phy
+    then:
+      properties:
+        clocks:
+          maxItems: 4
+        clock-names:
+          items:
+            - const: aux
+            - const: ref
+            - const: com_aux
+            - const: pipe
+
 examples:
   - |
     #include <dt-bindings/clock/qcom,gcc-sc8280xp.h>
-- 
2.38.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related

* [PATCH v8 0/2] Enable USB SS qmp phy for Qualcomm SM6115 SoC
From: Bhupesh Sharma @ 2023-04-10 17:10 UTC (permalink / raw)
  To: linux-arm-msm, devicetree, linux-phy
  Cc: agross, linux-kernel, andersson, bhupesh.sharma, bhupesh.linux,
	krzysztof.kozlowski, robh+dt, konrad.dybcio, kishon, vkoul,
	krzysztof.kozlowski+dt

Changes since v7:
-----------------
- v7 can be seen here: https://lore.kernel.org/linux-arm-msm/20230409200934.2329297-1-bhupesh.sharma@linaro.org/
- Addressed review comments from Dmitry and added "pipe clk".

Changes since v6:
-----------------
- v6 can be seen here: https://lore.kernel.org/linux-arm-msm/20230407061122.2036838-1-bhupesh.sharma@linaro.org/
- Addressed review comments from Bjorn and Dmitry and dropped old bindings in this
  version.

Changes since v5:
-----------------
- v5 can be seen here: https://lore.kernel.org/linux-arm-msm/20230405191633.1864671-1-bhupesh.sharma@linaro.org/
- Addressed review comments from Dmitry and made [PATCH 1/2] compatible with his 
  'split away legacy USB+DP code' series:
  <https://patchwork.kernel.org/project/linux-phy/cover/20230324215550.1966809-1-dmitry.baryshkov@linaro.org>

Changes since v4:
-----------------
- v4 can be seen here: https://lore.kernel.org/linux-arm-msm/20230401154725.1059563-1-bhupesh.sharma@linaro.org/ 
- Collected Krzysztof's Ack for [PATCH 1/2].
- Added more descriptive commit logs as per Dmitry's comments on v4.

Changes since v3:
-----------------
- v3 can be seen here: https://lore.kernel.org/linux-arm-msm/20221215094532.589291-4-bhupesh.sharma@linaro.org/
- Fixed v4 as per the downstream driver code: https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/heads/android-msm-bramble-4.19-android11-qpr1/qcom/bengal-usb.dtsi#296

This patchset adds the support for USB SS qmp phy for Qualcomm SM6115
SoC. For the previous versions of this patch there were conversations
on irc as to whether this was a 'qcom,usb-ssphy-qmp-usb3-or-dp' or a
'qcom,usb-ssphy-qmp-dp-combo' as per downstream code and hardware
documentation.

But after a careful look at downstream dtsi (see [1]) it appears that
this indeed is a 'qcom,usb-ssphy-qmp-usb3-or-dp' phy and not a
'dp-combo' phy.

[1]. https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/heads/android-msm-bramble-4.19-android11-qpr1/qcom/bengal-usb.dtsi#296

Bhupesh Sharma (2):
  dt-bindings: phy: qcom,qmp-usb: Drop legacy bindings and move to newer
    one (SM6115 & QCM2290)
  arm64: dts: qcom: sm6115: Add USB SS qmp phy node

 .../phy/qcom,msm8996-qmp-usb3-phy.yaml        | 27 ------------
 .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml   | 44 ++++++++++++++++---
 .../boot/dts/qcom/sm4250-oneplus-billie2.dts  |  3 ++
 arch/arm64/boot/dts/qcom/sm6115.dtsi          | 29 +++++++++++-
 .../boot/dts/qcom/sm6115p-lenovo-j606f.dts    |  3 ++
 5 files changed, 72 insertions(+), 34 deletions(-)

-- 
2.38.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply

* Re: [PATCH v7 1/4] soc: ti: pruss: Add pruss_get()/put() API
From: Mathieu Poirier @ 2023-04-10 17:09 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Nishanth Menon, srk, linux-omap, Vignesh Raghavendra, Tero Kristo,
	devicetree, netdev, Bjorn Andersson, linux-remoteproc,
	linux-kernel, Andrew F. Davis, Roger Quadros, Santosh Shilimkar,
	linux-arm-kernel
In-Reply-To: <20230404115336.599430-2-danishanwar@ti.com>

On Tue, Apr 04, 2023 at 05:23:33PM +0530, MD Danish Anwar wrote:
> From: Tero Kristo <t-kristo@ti.com>
> 
> Add two new get and put API, pruss_get() and pruss_put() to the
> PRUSS platform driver to allow client drivers to request a handle
> to a PRUSS device. This handle will be used by client drivers to
> request various operations of the PRUSS platform driver through
> additional API that will be added in the following patches.
> 
> The pruss_get() function returns the pruss handle corresponding
> to a PRUSS device referenced by a PRU remoteproc instance. The
> pruss_put() is the complimentary function to pruss_get().
> 
> Co-developed-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Co-developed-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
> Reviewed-by: Roger Quadros <rogerq@kernel.org>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> ---
>  drivers/remoteproc/pru_rproc.c                |  2 +-
>  drivers/soc/ti/pruss.c                        | 64 ++++++++++++++++++-
>  .../{pruss_driver.h => pruss_internal.h}      |  7 +-
>  include/linux/remoteproc/pruss.h              | 19 ++++++
>  4 files changed, 87 insertions(+), 5 deletions(-)
>  rename include/linux/{pruss_driver.h => pruss_internal.h} (90%)
>

Throughout this patchset an API to access resources required by the PRUSS
is added to pruss.c but all the function declarations are added to
remoteproc/pruss.h.  Is this something you were asked to do or is this how the
original implementation was?

Other than pruss_get() nothing in there is related to the remoteproc
subsystem, the bulk of the work is all about PRUSS.

In my opinion all the function declaration should go in pruss_driver.h, which
should stay as it is and not made internal.  The code looks good now but it
needs to be added where it belongs.

Thanks,
Mathieu

> diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c
> index b76db7fa693d..4ddd5854d56e 100644
> --- a/drivers/remoteproc/pru_rproc.c
> +++ b/drivers/remoteproc/pru_rproc.c
> @@ -19,7 +19,7 @@
>  #include <linux/of_device.h>
>  #include <linux/of_irq.h>
>  #include <linux/remoteproc/pruss.h>
> -#include <linux/pruss_driver.h>
> +#include <linux/pruss_internal.h>
>  #include <linux/remoteproc.h>
>  
>  #include "remoteproc_internal.h"
> diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
> index 6882c86b3ce5..28b77d715903 100644
> --- a/drivers/soc/ti/pruss.c
> +++ b/drivers/soc/ti/pruss.c
> @@ -6,6 +6,7 @@
>   * Author(s):
>   *	Suman Anna <s-anna@ti.com>
>   *	Andrew F. Davis <afd@ti.com>
> + *	Tero Kristo <t-kristo@ti.com>
>   */
>  
>  #include <linux/clk-provider.h>
> @@ -16,8 +17,9 @@
>  #include <linux/of_address.h>
>  #include <linux/of_device.h>
>  #include <linux/pm_runtime.h>
> -#include <linux/pruss_driver.h>
> +#include <linux/pruss_internal.h>
>  #include <linux/regmap.h>
> +#include <linux/remoteproc.h>
>  #include <linux/slab.h>
>  
>  /**
> @@ -30,6 +32,66 @@ struct pruss_private_data {
>  	bool has_core_mux_clock;
>  };
>  
> +/**
> + * pruss_get() - get the pruss for a given PRU remoteproc
> + * @rproc: remoteproc handle of a PRU instance
> + *
> + * Finds the parent pruss device for a PRU given the @rproc handle of the
> + * PRU remote processor. This function increments the pruss device's refcount,
> + * so always use pruss_put() to decrement it back once pruss isn't needed
> + * anymore.
> + *
> + * This API doesn't check if @rproc is valid or not. It is expected the caller
> + * will have done a pru_rproc_get() on @rproc, before calling this API to make
> + * sure that @rproc is valid.
> + *
> + * Return: pruss handle on success, and an ERR_PTR on failure using one
> + * of the following error values
> + *    -EINVAL if invalid parameter
> + *    -ENODEV if PRU device or PRUSS device is not found
> + */
> +struct pruss *pruss_get(struct rproc *rproc)
> +{
> +	struct pruss *pruss;
> +	struct device *dev;
> +	struct platform_device *ppdev;
> +
> +	if (IS_ERR_OR_NULL(rproc))
> +		return ERR_PTR(-EINVAL);
> +
> +	dev = &rproc->dev;
> +
> +	/* make sure it is PRU rproc */
> +	if (!dev->parent || !is_pru_rproc(dev->parent))
> +		return ERR_PTR(-ENODEV);
> +
> +	ppdev = to_platform_device(dev->parent->parent);
> +	pruss = platform_get_drvdata(ppdev);
> +	if (!pruss)
> +		return ERR_PTR(-ENODEV);
> +
> +	get_device(pruss->dev);
> +
> +	return pruss;
> +}
> +EXPORT_SYMBOL_GPL(pruss_get);
> +
> +/**
> + * pruss_put() - decrement pruss device's usecount
> + * @pruss: pruss handle
> + *
> + * Complimentary function for pruss_get(). Needs to be called
> + * after the PRUSS is used, and only if the pruss_get() succeeds.
> + */
> +void pruss_put(struct pruss *pruss)
> +{
> +	if (IS_ERR_OR_NULL(pruss))
> +		return;
> +
> +	put_device(pruss->dev);
> +}
> +EXPORT_SYMBOL_GPL(pruss_put);
> +
>  static void pruss_of_free_clk_provider(void *data)
>  {
>  	struct device_node *clk_mux_np = data;
> diff --git a/include/linux/pruss_driver.h b/include/linux/pruss_internal.h
> similarity index 90%
> rename from include/linux/pruss_driver.h
> rename to include/linux/pruss_internal.h
> index ecfded30ed05..8f91cb164054 100644
> --- a/include/linux/pruss_driver.h
> +++ b/include/linux/pruss_internal.h
> @@ -6,9 +6,10 @@
>   *	Suman Anna <s-anna@ti.com>
>   */
>  
> -#ifndef _PRUSS_DRIVER_H_
> -#define _PRUSS_DRIVER_H_
> +#ifndef _PRUSS_INTERNAL_H_
> +#define _PRUSS_INTERNAL_H_
>  
> +#include <linux/remoteproc/pruss.h>
>  #include <linux/types.h>
>  
>  /*
> @@ -51,4 +52,4 @@ struct pruss {
>  	struct clk *iep_clk_mux;
>  };
>  
> -#endif	/* _PRUSS_DRIVER_H_ */
> +#endif	/* _PRUSS_INTERNAL_H_ */
> diff --git a/include/linux/remoteproc/pruss.h b/include/linux/remoteproc/pruss.h
> index 039b50d58df2..93a98cac7829 100644
> --- a/include/linux/remoteproc/pruss.h
> +++ b/include/linux/remoteproc/pruss.h
> @@ -4,12 +4,14 @@
>   *
>   * Copyright (C) 2015-2022 Texas Instruments Incorporated - http://www.ti.com
>   *	Suman Anna <s-anna@ti.com>
> + *	Tero Kristo <t-kristo@ti.com>
>   */
>  
>  #ifndef __LINUX_PRUSS_H
>  #define __LINUX_PRUSS_H
>  
>  #include <linux/device.h>
> +#include <linux/err.h>
>  #include <linux/types.h>
>  
>  #define PRU_RPROC_DRVNAME "pru-rproc"
> @@ -44,6 +46,23 @@ enum pru_ctable_idx {
>  
>  struct device_node;
>  struct rproc;
> +struct pruss;
> +
> +#if IS_ENABLED(CONFIG_TI_PRUSS)
> +
> +struct pruss *pruss_get(struct rproc *rproc);
> +void pruss_put(struct pruss *pruss);
> +
> +#else
> +
> +static inline struct pruss *pruss_get(struct rproc *rproc)
> +{
> +	return ERR_PTR(-EOPNOTSUPP);
> +}
> +
> +static inline void pruss_put(struct pruss *pruss) { }
> +
> +#endif /* CONFIG_TI_PRUSS */
>  
>  #if IS_ENABLED(CONFIG_PRU_REMOTEPROC)
>  
> -- 
> 2.25.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* Re: [PATCH 1/2] handshake: include additional sha256 AKMs for PMKID generation
From: James Prestwood @ 2023-04-10 17:10 UTC (permalink / raw)
  To: Denis Kenzior, iwd
In-Reply-To: <1d8a1939-93fe-12b6-5007-e6621dffa7f1@gmail.com>

Hi Denis,

On 4/9/23 10:21 AM, Denis Kenzior wrote:
> Hi James,
> 
> On 4/4/23 15:38, James Prestwood wrote:
>> The 802.11 spec defines what AKMs should use sha256 to derive the
>> PMKID. Hostapd commit b6d3fd05e3 changed the PMKID derivation in
>> accordance with 802.11-2020 which then breaks PMKID validation in
>> IWD. This breaks FT-PSK/8021x AKMs in IWD if the AP uses this
>> hostapd version.
>>
>> Updating IWD to use sha256 in these cases will now break backwards
>> compatibility with *older* APs, but this will be worked around in
>> future commits.
>> ---
>>   src/handshake.c | 15 ++++++++++++++-
>>   1 file changed, 14 insertions(+), 1 deletion(-)
>>
> 
> <snip>
> 
>>       if (s->akm_suite & (IE_RSN_AKM_SUITE_8021X_SHA256 |
>> -            IE_RSN_AKM_SUITE_PSK_SHA256))
>> +            IE_RSN_AKM_SUITE_PSK_SHA256 |
>> +            IE_RSN_AKM_SUITE_FT_OVER_8021X |
>> +            IE_RSN_AKM_SUITE_FT_USING_PSK))
> 
> I don't see that the hostapd commit is actually adding FT_USING_PSK to 
> use sha256 generation? Only FT_OVER_8021X?  Is this a bug on their side?

Ugh, yep looks like its a bug on their side, at least according to 
12.7.1.6.3. There is another API rsn_pmkid(), which also doesn't include 
FT_USING_PSK, but references the 2016 spec (which is ambiguous).

Hostapd/wpa_supplicant get around this by not checking the PMKID KDE 
unless enabled... :/

So I think like you mentioned in patch 2 we just need to try both ways, 
at least for these AKMs in question. So my idea would be to add these 
AKMs to handshake_state_get_pmkid() (plus SHA384), then introduce 
handshake_state_check_pmkid() which will try both (for use in eapol). 
Sound good?

> 
> However, one consequence of this is that preauthentication is likely 
> broken for FT-over-8021x networks?  Do we even test this case?

I don't think we have this problem, 802.11 disallows preauthentication 
for FT networks:

"A STA shall not use preauthentication within the same mobility domain 
if an AKM suite type for which the Authentication type column indicates 
FT authentication"

Thanks,
James

> 
> Regards,
> -Denis

^ permalink raw reply

* Re: [Intel-xe] [PATCH v2 rebased 3/6] drm/i915: Only initialize dlk phy lock in display 12 and newer
From: Souza, Jose @ 2023-04-10 17:10 UTC (permalink / raw)
  To: Vivi, Rodrigo
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
In-Reply-To: <ZDQtIsxj2dhD+nPU@intel.com>

On Mon, 2023-04-10 at 11:37 -0400, Rodrigo Vivi wrote:
> On Thu, Apr 06, 2023 at 07:31:30AM -0700, José Roberto de Souza wrote:
> > This spin lock will not be used in older display versions, so no need
> > to initialize it.
> 
> Should we add some warn_on(disp_ver < 12) on the dkl phy functions?

If called in platforms with display version older than 12 we will get warnings about spink lock functions being called in a non initialized spinlock_t
anyways.

> 
> Anyway:
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> 
> > 
> > Cc: intel-gfx@lists.freedesktop.org
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dkl_phy.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dkl_phy.c b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > index 5bce7b5b27bc7..1c5d410b74e5d 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > @@ -108,5 +108,6 @@ intel_dkl_phy_posting_read(struct drm_i915_private *i915, struct intel_dkl_phy_r
> >  void
> >  intel_dkl_phy_init(struct drm_i915_private *i915)
> >  {
> > -	spin_lock_init(&i915->display.dkl.phy_lock);
> > +	if (DISPLAY_VER(i915) >= 12)
> > +		spin_lock_init(&i915->display.dkl.phy_lock);
> >  }
> > -- 
> > 2.40.0
> > 


^ permalink raw reply

* Re: [Intel-gfx] [Intel-xe] [PATCH v2 rebased 3/6] drm/i915: Only initialize dlk phy lock in display 12 and newer
From: Souza, Jose @ 2023-04-10 17:10 UTC (permalink / raw)
  To: Vivi, Rodrigo
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
In-Reply-To: <ZDQtIsxj2dhD+nPU@intel.com>

On Mon, 2023-04-10 at 11:37 -0400, Rodrigo Vivi wrote:
> On Thu, Apr 06, 2023 at 07:31:30AM -0700, José Roberto de Souza wrote:
> > This spin lock will not be used in older display versions, so no need
> > to initialize it.
> 
> Should we add some warn_on(disp_ver < 12) on the dkl phy functions?

If called in platforms with display version older than 12 we will get warnings about spink lock functions being called in a non initialized spinlock_t
anyways.

> 
> Anyway:
> 
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> 
> > 
> > Cc: intel-gfx@lists.freedesktop.org
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dkl_phy.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dkl_phy.c b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > index 5bce7b5b27bc7..1c5d410b74e5d 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > @@ -108,5 +108,6 @@ intel_dkl_phy_posting_read(struct drm_i915_private *i915, struct intel_dkl_phy_r
> >  void
> >  intel_dkl_phy_init(struct drm_i915_private *i915)
> >  {
> > -	spin_lock_init(&i915->display.dkl.phy_lock);
> > +	if (DISPLAY_VER(i915) >= 12)
> > +		spin_lock_init(&i915->display.dkl.phy_lock);
> >  }
> > -- 
> > 2.40.0
> > 


^ permalink raw reply

* Re: [PATCH v2 09/12] block: mq-deadline: Disable head insertion for zoned writes
From: Bart Van Assche @ 2023-04-10 17:09 UTC (permalink / raw)
  To: Damien Le Moal, Jens Axboe
  Cc: linux-block, Jaegeuk Kim, Christoph Hellwig, Ming Lei,
	Mike Snitzer
In-Reply-To: <81ccc853-63f6-5be4-7ab3-fc95c128b7f9@kernel.org>

On 4/10/23 01:10, Damien Le Moal wrote:
> On 4/8/23 08:58, Bart Van Assche wrote:
>> Make sure that zoned writes are submitted in LBA order.
>>
>> Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
>> Cc: Christoph Hellwig <hch@lst.de>
>> Cc: Ming Lei <ming.lei@redhat.com>
>> Cc: Mike Snitzer <snitzer@kernel.org>
>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>> ---
>>   block/mq-deadline.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
>> index 50a9d3b0a291..891ee0da73ac 100644
>> --- a/block/mq-deadline.c
>> +++ b/block/mq-deadline.c
>> @@ -798,7 +798,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
>>   
>>   	trace_block_rq_insert(rq);
>>   
>> -	if (at_head) {
>> +	if (at_head && !blk_rq_is_seq_zoned_write(rq)) {
>>   		list_add(&rq->queuelist, &per_prio->dispatch);
>>   		rq->fifo_time = jiffies;
>>   	} else {
> 
> Looks OK, but I would prefer us addressing the caller site using at_head = true,
> as that is almost always completely wrong for sequential zone writes.
> That would reduce the number of places we check for blk_rq_is_seq_zoned_write().

Hi Damien,

The code for deciding whether or not to use head insertion is spread all 
over the block layer. I prefer a single additional check to disable head 
insertion instead of modifying all the code that decides whether or not 
to use head-insertion. Additionally, the call to 
blk_rq_is_seq_zoned_write() would remain if the decision whether or not 
to use head insertion is moved into the callers of 
elevator_type.insert_request.

Thanks,

Bart.

^ permalink raw reply

* [PATCH] systemd: Refresh a musl patch to remove patch-fuzz with 253.3
From: Khem Raj @ 2023-04-10 17:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Wang Mingyu

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Wang Mingyu <wangmy@fujitsu.com>
---
 ...k-parse_printf_format-implementation.patch | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch b/meta/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch
index 6f01721459..2090d81dc3 100644
--- a/meta/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch
+++ b/meta/recipes-core/systemd/systemd/0010-add-fallback-parse_printf_format-implementation.patch
@@ -21,8 +21,6 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
  create mode 100644 src/basic/parse-printf-format.c
  create mode 100644 src/basic/parse-printf-format.h
 
-diff --git a/meson.build b/meson.build
-index bfc86857d6..fb96143c37 100644
 --- a/meson.build
 +++ b/meson.build
 @@ -755,6 +755,7 @@ endif
@@ -31,10 +29,8 @@ index bfc86857d6..fb96143c37 100644
                    'linux/vm_sockets.h',
 +                  'printf.h',
                    'sys/auxv.h',
+                   'threads.h',
                    'valgrind/memcheck.h',
-                   'valgrind/valgrind.h',
-diff --git a/src/basic/meson.build b/src/basic/meson.build
-index 7aae031d81..1aa9f5006d 100644
 --- a/src/basic/meson.build
 +++ b/src/basic/meson.build
 @@ -173,6 +173,11 @@ endforeach
@@ -49,9 +45,6 @@ index 7aae031d81..1aa9f5006d 100644
  ############################################################
  
  arch_list = [
-diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
-new file mode 100644
-index 0000000000..49437e5445
 --- /dev/null
 +++ b/src/basic/parse-printf-format.c
 @@ -0,0 +1,273 @@
@@ -328,9 +321,6 @@ index 0000000000..49437e5445
 +
 +        return last;
 +}
-diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
-new file mode 100644
-index 0000000000..47be7522d7
 --- /dev/null
 +++ b/src/basic/parse-printf-format.h
 @@ -0,0 +1,57 @@
@@ -391,8 +381,6 @@ index 0000000000..47be7522d7
 +size_t parse_printf_format(const char *fmt, size_t n, int *types);
 +
 +#endif /* HAVE_PRINTF_H */
-diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
-index 4e93ac90c9..f9deb6f662 100644
 --- a/src/basic/stdio-util.h
 +++ b/src/basic/stdio-util.h
 @@ -1,12 +1,12 @@
@@ -409,8 +397,6 @@ index 4e93ac90c9..f9deb6f662 100644
  
  _printf_(3, 4)
  static inline char *snprintf_ok(char *buf, size_t len, const char *format, ...) {
-diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c
-index 3b74d2246e..136ebcb153 100644
 --- a/src/libsystemd/sd-journal/journal-send.c
 +++ b/src/libsystemd/sd-journal/journal-send.c
 @@ -2,7 +2,6 @@
@@ -429,6 +415,3 @@ index 3b74d2246e..136ebcb153 100644
  
  #define SNDBUF_SIZE (8*1024*1024)
  
--- 
-2.39.2
-
-- 
2.40.0



^ permalink raw reply related

* [PATCH v2 1/1] HID: shield: Initial driver implementation with Thunderstrike support
From: Rahul Rameshbabu @ 2023-04-10 17:08 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, linux-kernel, Rahul Rameshbabu
In-Reply-To: <20230410170840.16119-1-rrameshbabu@nvidia.com>

Supports the Thunderstrike (SHIELD 2017) controller. Implements support for
the Thunderstrike HOSTCMD firmware interface. Adds sysfs attributes about a
SHIELD device and introduces haptics support for controllers.

Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
---
 MAINTAINERS              |   6 +
 drivers/hid/Kconfig      |  18 ++
 drivers/hid/Makefile     |   1 +
 drivers/hid/hid-ids.h    |   3 +
 drivers/hid/hid-shield.c | 587 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 615 insertions(+)
 create mode 100644 drivers/hid/hid-shield.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 2b073facf399..4fa673401bc7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9122,6 +9122,12 @@ F:	drivers/hid/hid-sensor-*
 F:	drivers/iio/*/hid-*
 F:	include/linux/hid-sensor-*
 
+HID SHIELD DRIVER
+M:	Rahul Rameshbabu <rrameshbabu@nvidia.com>
+L:	linux-input@vger.kernel.org
+S:	Maintained
+F:	drivers/hid/hid-shield.c
+
 HID VRC-2 CAR CONTROLLER DRIVER
 M:	Marcus Folkesson <marcus.folkesson@gmail.com>
 L:	linux-input@vger.kernel.org
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 82f64fb31fda..eb19debaa1f5 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -990,6 +990,24 @@ config HID_SEMITEK
 	- Woo-dy
 	- X-Bows Nature/Knight
 
+config HID_SHIELD
+	tristate "SHIELD HID Driver"
+	depends on USB_HID
+	depends on BT_HIDP
+	help
+	Support for NVIDIA SHIELD accessories.
+
+	Supported devices:
+	- Thunderstrike (NVIDIA SHIELD Controller 2017)
+
+config SHIELD_FF
+	bool "SHIELD force feedback support"
+	depends on HID_SHIELD
+	select INPUT_FF_MEMLESS
+	help
+	Say Y here if you would like to enable force feedback support for
+	NVIDIA SHIELD accessories with haptics capabilities.
+
 config HID_SIGMAMICRO
 	tristate "SiGma Micro-based keyboards"
 	depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 5d37cacbde33..a2ed1db9ed9d 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -116,6 +116,7 @@ obj-$(CONFIG_HID_RMI)		+= hid-rmi.o
 obj-$(CONFIG_HID_SAITEK)	+= hid-saitek.o
 obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
 obj-$(CONFIG_HID_SEMITEK)	+= hid-semitek.o
+obj-$(CONFIG_HID_SHIELD)	+= hid-shield.o
 obj-$(CONFIG_HID_SIGMAMICRO)	+= hid-sigmamicro.o
 obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
 obj-$(CONFIG_HID_SONY)		+= hid-sony.o
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 63545cd307e5..4000d53b1bac 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -993,6 +993,9 @@
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18   0x0014
 #define USB_DEVICE_ID_NTRIG_DUOSENSE 0x1500
 
+#define USB_VENDOR_ID_NVIDIA				0x0955
+#define USB_DEVICE_ID_NVIDIA_THUNDERSTRIKE_CONTROLLER	0x7214
+
 #define USB_VENDOR_ID_ONTRAK		0x0a07
 #define USB_DEVICE_ID_ONTRAK_ADU100	0x0064
 
diff --git a/drivers/hid/hid-shield.c b/drivers/hid/hid-shield.c
new file mode 100644
index 000000000000..3befa8f133c7
--- /dev/null
+++ b/drivers/hid/hid-shield.c
@@ -0,0 +1,587 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.
+ *
+ *  HID driver for NVIDIA SHIELD peripherals.
+ */
+
+#include <linux/hid.h>
+#include <linux/input-event-codes.h>
+#include <linux/input.h>
+#include <linux/module.h>
+#include <linux/spinlock.h>
+#include <linux/workqueue.h>
+
+#include "hid-ids.h"
+
+#define NOT_INIT_STR "NOT INITIALIZED"
+
+enum {
+	SHIELD_FW_VERSION_INITIALIZED = 0,
+	SHIELD_BOARD_INFO_INITIALIZED,
+};
+
+enum {
+	THUNDERSTRIKE_FW_VERSION_UPDATE = 0,
+	THUNDERSTRIKE_BOARD_INFO_UPDATE,
+	THUNDERSTRIKE_HAPTICS_UPDATE,
+};
+
+enum {
+	THUNDERSTRIKE_HOSTCMD_REPORT_SIZE = 33,
+	THUNDERSTRIKE_HOSTCMD_REQ_REPORT_ID = 0x4,
+	THUNDERSTRIKE_HOSTCMD_RESP_REPORT_ID = 0x3,
+};
+
+enum {
+	THUNDERSTRIKE_HOSTCMD_ID_FW_VERSION = 1,
+	THUNDERSTRIKE_HOSTCMD_ID_BOARD_INFO = 16,
+	THUNDERSTRIKE_HOSTCMD_ID_USB_INIT = 53,
+	THUNDERSTRIKE_HOSTCMD_ID_HAPTICS = 57,
+	THUNDERSTRIKE_HOSTCMD_ID_BLUETOOTH_INIT = 58,
+};
+
+struct thunderstrike_hostcmd_board_info {
+	__le16 revision;
+	__le16 serial[7];
+};
+
+struct thunderstrike_hostcmd_haptics {
+	u8 motor_left;
+	u8 motor_right;
+};
+
+struct thunderstrike_hostcmd_resp_report {
+	u8 report_id; /* THUNDERSTRIKE_HOSTCMD_RESP_REPORT_ID */
+	u8 cmd_id;
+	u8 reserved_at_10;
+
+	union {
+		struct thunderstrike_hostcmd_board_info board_info;
+		struct thunderstrike_hostcmd_haptics motors;
+		__le16 fw_version;
+		u8 payload[30];
+	};
+} __packed;
+static_assert(sizeof(struct thunderstrike_hostcmd_resp_report) ==
+	      THUNDERSTRIKE_HOSTCMD_REPORT_SIZE);
+
+struct thunderstrike_hostcmd_req_report {
+	u8 report_id; /* THUNDERSTRIKE_HOSTCMD_REQ_REPORT_ID */
+	u8 cmd_id;
+	u8 reserved_at_10;
+
+	struct {
+		u8 update;
+		struct thunderstrike_hostcmd_haptics motors;
+	} haptics;
+	u8 reserved_at_30[27];
+} __packed;
+static_assert(sizeof(struct thunderstrike_hostcmd_req_report) ==
+	      THUNDERSTRIKE_HOSTCMD_REPORT_SIZE);
+
+/* Common struct for shield accessories. */
+struct shield_device {
+	struct hid_device *hdev;
+
+	unsigned long initialized_flags;
+	const char *codename;
+	u16 fw_version;
+	struct {
+		u16 revision;
+		char serial_number[15];
+	} board_info;
+};
+
+struct thunderstrike {
+	struct shield_device base;
+
+	/* Sub-devices */
+	struct input_dev *haptics_dev;
+
+	/* Resources */
+	void *req_report_dmabuf;
+	unsigned long update_flags;
+	struct thunderstrike_hostcmd_haptics haptics_val;
+	spinlock_t haptics_update_lock;
+	struct work_struct hostcmd_req_work;
+};
+
+static inline void thunderstrike_hostcmd_req_report_init(
+	struct thunderstrike_hostcmd_req_report *report, u8 cmd_id)
+{
+	memset(report, 0, sizeof(*report));
+	report->report_id = THUNDERSTRIKE_HOSTCMD_REQ_REPORT_ID;
+	report->cmd_id = cmd_id;
+}
+
+static inline void shield_strrev(char *dest, size_t len, u16 rev)
+{
+	dest[0] = ('A' - 1) + (rev >> 8);
+	snprintf(&dest[1], len - 1, "%02X", 0xff & rev);
+}
+
+static struct input_dev *shield_allocate_input_dev(struct hid_device *hdev,
+						   const char *name_suffix)
+{
+	struct input_dev *idev;
+
+	idev = input_allocate_device();
+	if (!idev)
+		goto err_device;
+
+	idev->id.bustype = hdev->bus;
+	idev->id.vendor = hdev->vendor;
+	idev->id.product = hdev->product;
+	idev->id.version = hdev->version;
+	idev->uniq = hdev->uniq;
+	idev->name = devm_kasprintf(&idev->dev, GFP_KERNEL, "%s %s", hdev->name,
+				    name_suffix);
+	if (!idev->name)
+		goto err_name;
+
+	input_set_drvdata(idev, hdev);
+
+	return idev;
+
+err_name:
+	input_free_device(idev);
+err_device:
+	return ERR_PTR(-ENOMEM);
+}
+
+static struct input_dev *shield_haptics_create(
+	struct shield_device *dev,
+	int (*play_effect)(struct input_dev *, void *, struct ff_effect *))
+{
+	struct input_dev *haptics;
+	int ret;
+
+	if (!IS_ENABLED(CONFIG_SHIELD_FF))
+		return NULL;
+
+	haptics = shield_allocate_input_dev(dev->hdev, "Haptics");
+	if (IS_ERR(haptics))
+		return haptics;
+
+	input_set_capability(haptics, EV_FF, FF_RUMBLE);
+	input_ff_create_memless(haptics, NULL, play_effect);
+
+	ret = input_register_device(haptics);
+	if (ret)
+		goto err;
+
+	return haptics;
+
+ err:
+	input_free_device(haptics);
+	return ERR_PTR(ret);
+}
+
+static inline void thunderstrike_send_hostcmd_request(struct thunderstrike *ts)
+{
+	struct thunderstrike_hostcmd_req_report *report = ts->req_report_dmabuf;
+	struct shield_device *shield_dev = &ts->base;
+	int ret;
+
+	ret = hid_hw_raw_request(shield_dev->hdev, report->report_id,
+				 ts->req_report_dmabuf,
+				 THUNDERSTRIKE_HOSTCMD_REPORT_SIZE,
+				 HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
+
+	if (ret < 0) {
+		hid_err(shield_dev->hdev,
+			"Failed to output Thunderstrike HOSTCMD request HID report due to %pe\n",
+			ERR_PTR(ret));
+	}
+}
+
+static void thunderstrike_hostcmd_req_work_handler(struct work_struct *work)
+{
+	struct thunderstrike *ts =
+		container_of(work, struct thunderstrike, hostcmd_req_work);
+	struct thunderstrike_hostcmd_req_report *report;
+	unsigned long flags;
+
+	report = ts->req_report_dmabuf;
+
+	if (test_and_clear_bit(THUNDERSTRIKE_FW_VERSION_UPDATE, &ts->update_flags)) {
+		thunderstrike_hostcmd_req_report_init(
+			report, THUNDERSTRIKE_HOSTCMD_ID_FW_VERSION);
+		thunderstrike_send_hostcmd_request(ts);
+	}
+
+	if (test_and_clear_bit(THUNDERSTRIKE_BOARD_INFO_UPDATE, &ts->update_flags)) {
+		thunderstrike_hostcmd_req_report_init(
+			report, THUNDERSTRIKE_HOSTCMD_ID_BOARD_INFO);
+		thunderstrike_send_hostcmd_request(ts);
+	}
+
+	if (test_and_clear_bit(THUNDERSTRIKE_HAPTICS_UPDATE, &ts->update_flags)) {
+		thunderstrike_hostcmd_req_report_init(
+			report, THUNDERSTRIKE_HOSTCMD_ID_HAPTICS);
+
+		report->haptics.update = 1;
+		spin_lock_irqsave(&ts->haptics_update_lock, flags);
+		report->haptics.motors = ts->haptics_val;
+		spin_unlock_irqrestore(&ts->haptics_update_lock, flags);
+
+		thunderstrike_send_hostcmd_request(ts);
+	}
+}
+
+static inline void thunderstrike_request_firmware_version(struct thunderstrike *ts)
+{
+	set_bit(THUNDERSTRIKE_FW_VERSION_UPDATE, &ts->update_flags);
+	schedule_work(&ts->hostcmd_req_work);
+}
+
+static inline void thunderstrike_request_board_info(struct thunderstrike *ts)
+{
+	set_bit(THUNDERSTRIKE_BOARD_INFO_UPDATE, &ts->update_flags);
+	schedule_work(&ts->hostcmd_req_work);
+}
+
+static inline int
+thunderstrike_update_haptics(struct thunderstrike *ts,
+			     struct thunderstrike_hostcmd_haptics *motors)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&ts->haptics_update_lock, flags);
+	ts->haptics_val = *motors;
+	spin_unlock_irqrestore(&ts->haptics_update_lock, flags);
+
+	set_bit(THUNDERSTRIKE_HAPTICS_UPDATE, &ts->update_flags);
+	schedule_work(&ts->hostcmd_req_work);
+
+	return 0;
+}
+
+static int thunderstrike_play_effect(struct input_dev *idev, void *data,
+				     struct ff_effect *effect)
+{
+	struct hid_device *hdev = input_get_drvdata(idev);
+	struct thunderstrike_hostcmd_haptics motors;
+	struct shield_device *shield_dev;
+	struct thunderstrike *ts;
+
+	if (effect->type != FF_RUMBLE)
+		return 0;
+
+	shield_dev = hid_get_drvdata(hdev);
+	ts = container_of(shield_dev, struct thunderstrike, base);
+
+	/* Thunderstrike motor values range from 0 to 32 inclusively */
+	motors.motor_left = effect->u.rumble.strong_magnitude / 2047;
+	motors.motor_right = effect->u.rumble.weak_magnitude / 2047;
+
+	hid_dbg(hdev, "Thunderstrike FF_RUMBLE request, left: %u right: %u\n",
+		motors.motor_left, motors.motor_right);
+
+	return thunderstrike_update_haptics(ts, &motors);
+}
+
+static void
+thunderstrike_parse_fw_version_payload(struct shield_device *shield_dev,
+				       __le16 fw_version)
+{
+	shield_dev->fw_version = le16_to_cpu(fw_version);
+
+	set_bit(SHIELD_FW_VERSION_INITIALIZED, &shield_dev->initialized_flags);
+
+	hid_dbg(shield_dev->hdev, "Thunderstrike firmware version 0x%04X\n",
+		shield_dev->fw_version);
+}
+
+static void
+thunderstrike_parse_board_info_payload(struct shield_device *shield_dev,
+				       struct thunderstrike_hostcmd_board_info *board_info)
+{
+	char board_revision_str[4];
+	int i;
+
+	shield_dev->board_info.revision = le16_to_cpu(board_info->revision);
+	for (i = 0; i < 7; ++i) {
+		u16 val = le16_to_cpu(board_info->serial[i]);
+
+		shield_dev->board_info.serial_number[2 * i] = val & 0xFF;
+		shield_dev->board_info.serial_number[2 * i + 1] = val >> 8;
+	}
+	shield_dev->board_info.serial_number[14] = '\0';
+
+	set_bit(SHIELD_BOARD_INFO_INITIALIZED, &shield_dev->initialized_flags);
+
+	shield_strrev(board_revision_str, 4, shield_dev->board_info.revision);
+	hid_dbg(shield_dev->hdev,
+		"Thunderstrike BOARD_REVISION_%s (0x%04X) S/N: %s\n",
+		board_revision_str, shield_dev->board_info.revision,
+		shield_dev->board_info.serial_number);
+}
+
+static inline void
+thunderstrike_parse_haptics_payload(struct shield_device *shield_dev,
+				    struct thunderstrike_hostcmd_haptics *haptics)
+{
+	hid_dbg(shield_dev->hdev,
+		"Thunderstrike haptics HOSTCMD response, left: %u right: %u\n",
+		haptics->motor_left, haptics->motor_right);
+}
+
+static int thunderstrike_parse_report(struct shield_device *shield_dev,
+				      struct hid_report *report, u8 *data,
+				      int size)
+{
+	struct thunderstrike_hostcmd_resp_report *hostcmd_resp_report;
+	struct thunderstrike *ts =
+		container_of(shield_dev, struct thunderstrike, base);
+	struct hid_device *hdev = shield_dev->hdev;
+
+	switch (report->id) {
+	case THUNDERSTRIKE_HOSTCMD_RESP_REPORT_ID:
+		if (size != THUNDERSTRIKE_HOSTCMD_REPORT_SIZE) {
+			hid_err(hdev,
+				"Encountered Thunderstrike HOSTCMD HID report with unexpected size %d\n",
+				size);
+			return -EINVAL;
+		}
+
+		hostcmd_resp_report =
+			(struct thunderstrike_hostcmd_resp_report *)data;
+
+		switch (hostcmd_resp_report->cmd_id) {
+		case THUNDERSTRIKE_HOSTCMD_ID_FW_VERSION:
+			thunderstrike_parse_fw_version_payload(
+				shield_dev, hostcmd_resp_report->fw_version);
+			break;
+		case THUNDERSTRIKE_HOSTCMD_ID_BOARD_INFO:
+			thunderstrike_parse_board_info_payload(
+				shield_dev, &hostcmd_resp_report->board_info);
+			break;
+		case THUNDERSTRIKE_HOSTCMD_ID_HAPTICS:
+			thunderstrike_parse_haptics_payload(
+				shield_dev, &hostcmd_resp_report->motors);
+			break;
+
+		case THUNDERSTRIKE_HOSTCMD_ID_USB_INIT:
+		case THUNDERSTRIKE_HOSTCMD_ID_BLUETOOTH_INIT:
+			/* May block HOSTCMD requests till received initially */
+			thunderstrike_request_firmware_version(ts);
+			thunderstrike_request_board_info(ts);
+			/* Only HOSTCMD that can be triggered without a request */
+			return 0;
+		default:
+			hid_warn(hdev,
+				 "Unhandled Thunderstrike HOSTCMD id %d\n",
+				 hostcmd_resp_report->cmd_id);
+			return -ENOENT;
+		}
+
+		break;
+	default:
+		return 0;
+	}
+
+	return 0;
+}
+
+static struct shield_device *thunderstrike_create(struct hid_device *hdev)
+{
+	struct shield_device *shield_dev;
+	struct thunderstrike *ts;
+
+	ts = devm_kzalloc(&hdev->dev, sizeof(*ts), GFP_KERNEL);
+	if (!ts)
+		return ERR_PTR(-ENOMEM);
+
+	ts->req_report_dmabuf = devm_kzalloc(
+		&hdev->dev, THUNDERSTRIKE_HOSTCMD_REPORT_SIZE, GFP_KERNEL);
+	if (!ts->req_report_dmabuf)
+		return ERR_PTR(-ENOMEM);
+
+	shield_dev = &ts->base;
+	shield_dev->hdev = hdev;
+	shield_dev->codename = "Thunderstrike";
+
+	spin_lock_init(&ts->haptics_update_lock);
+	INIT_WORK(&ts->hostcmd_req_work, thunderstrike_hostcmd_req_work_handler);
+
+	hid_set_drvdata(hdev, shield_dev);
+
+	ts->haptics_dev = shield_haptics_create(shield_dev, thunderstrike_play_effect);
+	if (IS_ERR(ts->haptics_dev))
+		return ERR_CAST(ts->haptics_dev);
+
+	hid_info(hdev, "Registered Thunderstrike controller\n");
+	return shield_dev;
+}
+
+static ssize_t firmware_version_show(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	struct hid_device *hdev = to_hid_device(dev);
+	struct shield_device *shield_dev;
+	int ret;
+
+	shield_dev = hid_get_drvdata(hdev);
+
+	if (test_bit(SHIELD_FW_VERSION_INITIALIZED, &shield_dev->initialized_flags))
+		ret = sysfs_emit(buf, "0x%04X\n", shield_dev->fw_version);
+	else
+		ret = sysfs_emit(buf, NOT_INIT_STR "\n");
+
+	return ret;
+}
+
+static DEVICE_ATTR_RO(firmware_version);
+
+static ssize_t hardware_version_show(struct device *dev,
+				     struct device_attribute *attr, char *buf)
+{
+	struct hid_device *hdev = to_hid_device(dev);
+	struct shield_device *shield_dev;
+	char board_revision_str[4];
+	int ret;
+
+	shield_dev = hid_get_drvdata(hdev);
+
+	if (test_bit(SHIELD_BOARD_INFO_INITIALIZED, &shield_dev->initialized_flags)) {
+		shield_strrev(board_revision_str, 4, shield_dev->board_info.revision);
+		ret = sysfs_emit(buf, "%s BOARD_REVISION_%s (0x%04X)\n",
+				 shield_dev->codename, board_revision_str,
+				 shield_dev->board_info.revision);
+	} else
+		ret = sysfs_emit(buf, NOT_INIT_STR "\n");
+
+	return ret;
+}
+
+static DEVICE_ATTR_RO(hardware_version);
+
+static ssize_t serial_number_show(struct device *dev,
+				  struct device_attribute *attr, char *buf)
+{
+	struct hid_device *hdev = to_hid_device(dev);
+	struct shield_device *shield_dev;
+	int ret;
+
+	shield_dev = hid_get_drvdata(hdev);
+
+	if (test_bit(SHIELD_BOARD_INFO_INITIALIZED, &shield_dev->initialized_flags))
+		ret = sysfs_emit(buf, "%s\n", shield_dev->board_info.serial_number);
+	else
+		ret = sysfs_emit(buf, NOT_INIT_STR "\n");
+
+	return ret;
+}
+
+static DEVICE_ATTR_RO(serial_number);
+
+static struct attribute *shield_device_attrs[] = {
+	&dev_attr_firmware_version.attr,
+	&dev_attr_hardware_version.attr,
+	&dev_attr_serial_number.attr,
+	NULL,
+};
+ATTRIBUTE_GROUPS(shield_device);
+
+static int shield_raw_event(struct hid_device *hdev, struct hid_report *report,
+			    u8 *data, int size)
+{
+	struct shield_device *dev = hid_get_drvdata(hdev);
+
+	return thunderstrike_parse_report(dev, report, data, size);
+}
+
+static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+	struct shield_device *shield_dev = NULL;
+	struct thunderstrike *ts;
+	int ret;
+
+	ret = hid_parse(hdev);
+	if (ret) {
+		hid_err(hdev, "Parse failed\n");
+		return ret;
+	}
+
+	switch (id->product) {
+	case USB_DEVICE_ID_NVIDIA_THUNDERSTRIKE_CONTROLLER:
+		shield_dev = thunderstrike_create(hdev);
+		break;
+	}
+
+	if (unlikely(!shield_dev)) {
+		hid_err(hdev, "Failed to identify SHIELD device\n");
+		return -ENODEV;
+	}
+	if (IS_ERR(shield_dev)) {
+		hid_err(hdev, "Failed to create SHIELD device\n");
+		return PTR_ERR(shield_dev);
+	}
+
+	ts = container_of(shield_dev, struct thunderstrike, base);
+
+	ret = hid_hw_start(hdev, HID_CONNECT_HIDINPUT);
+	if (ret) {
+		hid_err(hdev, "Failed to start HID device\n");
+		goto err_haptics;
+	}
+
+	ret = hid_hw_open(hdev);
+	if (ret) {
+		hid_err(hdev, "Failed to open HID device\n");
+		goto err_stop;
+	}
+
+	thunderstrike_request_firmware_version(ts);
+	thunderstrike_request_board_info(ts);
+
+	return ret;
+
+err_stop:
+	hid_hw_stop(hdev);
+err_haptics:
+	if (ts->haptics_dev)
+		input_unregister_device(ts->haptics_dev);
+	return ret;
+}
+
+static void shield_remove(struct hid_device *hdev)
+{
+	struct shield_device *dev = hid_get_drvdata(hdev);
+	struct thunderstrike *ts;
+
+	ts = container_of(dev, struct thunderstrike, base);
+
+	hid_hw_close(hdev);
+	if (ts->haptics_dev)
+		input_unregister_device(ts->haptics_dev);
+	cancel_work_sync(&ts->hostcmd_req_work);
+	hid_hw_stop(hdev);
+}
+
+static const struct hid_device_id shield_devices[] = {
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NVIDIA,
+			       USB_DEVICE_ID_NVIDIA_THUNDERSTRIKE_CONTROLLER) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_NVIDIA,
+			 USB_DEVICE_ID_NVIDIA_THUNDERSTRIKE_CONTROLLER) },
+	{}
+};
+MODULE_DEVICE_TABLE(hid, shield_devices);
+
+static struct hid_driver shield_driver = {
+	.name         = "shield",
+	.id_table     = shield_devices,
+	.probe        = shield_probe,
+	.remove       = shield_remove,
+	.raw_event    = shield_raw_event,
+	.driver = {
+		.dev_groups = shield_device_groups,
+	},
+};
+module_hid_driver(shield_driver);
+
+MODULE_AUTHOR("Rahul Rameshbabu <rrameshbabu@nvidia.com>");
+MODULE_DESCRIPTION("HID Driver for NVIDIA SHIELD peripherals.");
+MODULE_LICENSE("GPL");
-- 
2.38.4


^ permalink raw reply related

* Re: [PATCH v7 1/4] soc: ti: pruss: Add pruss_get()/put() API
From: Mathieu Poirier @ 2023-04-10 17:09 UTC (permalink / raw)
  To: MD Danish Anwar
  Cc: Andrew F. Davis, Suman Anna, Roger Quadros, Vignesh Raghavendra,
	Tero Kristo, Bjorn Andersson, Santosh Shilimkar, Nishanth Menon,
	linux-remoteproc, linux-arm-kernel, linux-kernel, linux-omap, srk,
	devicetree, netdev
In-Reply-To: <20230404115336.599430-2-danishanwar@ti.com>

On Tue, Apr 04, 2023 at 05:23:33PM +0530, MD Danish Anwar wrote:
> From: Tero Kristo <t-kristo@ti.com>
> 
> Add two new get and put API, pruss_get() and pruss_put() to the
> PRUSS platform driver to allow client drivers to request a handle
> to a PRUSS device. This handle will be used by client drivers to
> request various operations of the PRUSS platform driver through
> additional API that will be added in the following patches.
> 
> The pruss_get() function returns the pruss handle corresponding
> to a PRUSS device referenced by a PRU remoteproc instance. The
> pruss_put() is the complimentary function to pruss_get().
> 
> Co-developed-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Co-developed-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
> Signed-off-by: Puranjay Mohan <p-mohan@ti.com>
> Reviewed-by: Roger Quadros <rogerq@kernel.org>
> Reviewed-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> ---
>  drivers/remoteproc/pru_rproc.c                |  2 +-
>  drivers/soc/ti/pruss.c                        | 64 ++++++++++++++++++-
>  .../{pruss_driver.h => pruss_internal.h}      |  7 +-
>  include/linux/remoteproc/pruss.h              | 19 ++++++
>  4 files changed, 87 insertions(+), 5 deletions(-)
>  rename include/linux/{pruss_driver.h => pruss_internal.h} (90%)
>

Throughout this patchset an API to access resources required by the PRUSS
is added to pruss.c but all the function declarations are added to
remoteproc/pruss.h.  Is this something you were asked to do or is this how the
original implementation was?

Other than pruss_get() nothing in there is related to the remoteproc
subsystem, the bulk of the work is all about PRUSS.

In my opinion all the function declaration should go in pruss_driver.h, which
should stay as it is and not made internal.  The code looks good now but it
needs to be added where it belongs.

Thanks,
Mathieu

> diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c
> index b76db7fa693d..4ddd5854d56e 100644
> --- a/drivers/remoteproc/pru_rproc.c
> +++ b/drivers/remoteproc/pru_rproc.c
> @@ -19,7 +19,7 @@
>  #include <linux/of_device.h>
>  #include <linux/of_irq.h>
>  #include <linux/remoteproc/pruss.h>
> -#include <linux/pruss_driver.h>
> +#include <linux/pruss_internal.h>
>  #include <linux/remoteproc.h>
>  
>  #include "remoteproc_internal.h"
> diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
> index 6882c86b3ce5..28b77d715903 100644
> --- a/drivers/soc/ti/pruss.c
> +++ b/drivers/soc/ti/pruss.c
> @@ -6,6 +6,7 @@
>   * Author(s):
>   *	Suman Anna <s-anna@ti.com>
>   *	Andrew F. Davis <afd@ti.com>
> + *	Tero Kristo <t-kristo@ti.com>
>   */
>  
>  #include <linux/clk-provider.h>
> @@ -16,8 +17,9 @@
>  #include <linux/of_address.h>
>  #include <linux/of_device.h>
>  #include <linux/pm_runtime.h>
> -#include <linux/pruss_driver.h>
> +#include <linux/pruss_internal.h>
>  #include <linux/regmap.h>
> +#include <linux/remoteproc.h>
>  #include <linux/slab.h>
>  
>  /**
> @@ -30,6 +32,66 @@ struct pruss_private_data {
>  	bool has_core_mux_clock;
>  };
>  
> +/**
> + * pruss_get() - get the pruss for a given PRU remoteproc
> + * @rproc: remoteproc handle of a PRU instance
> + *
> + * Finds the parent pruss device for a PRU given the @rproc handle of the
> + * PRU remote processor. This function increments the pruss device's refcount,
> + * so always use pruss_put() to decrement it back once pruss isn't needed
> + * anymore.
> + *
> + * This API doesn't check if @rproc is valid or not. It is expected the caller
> + * will have done a pru_rproc_get() on @rproc, before calling this API to make
> + * sure that @rproc is valid.
> + *
> + * Return: pruss handle on success, and an ERR_PTR on failure using one
> + * of the following error values
> + *    -EINVAL if invalid parameter
> + *    -ENODEV if PRU device or PRUSS device is not found
> + */
> +struct pruss *pruss_get(struct rproc *rproc)
> +{
> +	struct pruss *pruss;
> +	struct device *dev;
> +	struct platform_device *ppdev;
> +
> +	if (IS_ERR_OR_NULL(rproc))
> +		return ERR_PTR(-EINVAL);
> +
> +	dev = &rproc->dev;
> +
> +	/* make sure it is PRU rproc */
> +	if (!dev->parent || !is_pru_rproc(dev->parent))
> +		return ERR_PTR(-ENODEV);
> +
> +	ppdev = to_platform_device(dev->parent->parent);
> +	pruss = platform_get_drvdata(ppdev);
> +	if (!pruss)
> +		return ERR_PTR(-ENODEV);
> +
> +	get_device(pruss->dev);
> +
> +	return pruss;
> +}
> +EXPORT_SYMBOL_GPL(pruss_get);
> +
> +/**
> + * pruss_put() - decrement pruss device's usecount
> + * @pruss: pruss handle
> + *
> + * Complimentary function for pruss_get(). Needs to be called
> + * after the PRUSS is used, and only if the pruss_get() succeeds.
> + */
> +void pruss_put(struct pruss *pruss)
> +{
> +	if (IS_ERR_OR_NULL(pruss))
> +		return;
> +
> +	put_device(pruss->dev);
> +}
> +EXPORT_SYMBOL_GPL(pruss_put);
> +
>  static void pruss_of_free_clk_provider(void *data)
>  {
>  	struct device_node *clk_mux_np = data;
> diff --git a/include/linux/pruss_driver.h b/include/linux/pruss_internal.h
> similarity index 90%
> rename from include/linux/pruss_driver.h
> rename to include/linux/pruss_internal.h
> index ecfded30ed05..8f91cb164054 100644
> --- a/include/linux/pruss_driver.h
> +++ b/include/linux/pruss_internal.h
> @@ -6,9 +6,10 @@
>   *	Suman Anna <s-anna@ti.com>
>   */
>  
> -#ifndef _PRUSS_DRIVER_H_
> -#define _PRUSS_DRIVER_H_
> +#ifndef _PRUSS_INTERNAL_H_
> +#define _PRUSS_INTERNAL_H_
>  
> +#include <linux/remoteproc/pruss.h>
>  #include <linux/types.h>
>  
>  /*
> @@ -51,4 +52,4 @@ struct pruss {
>  	struct clk *iep_clk_mux;
>  };
>  
> -#endif	/* _PRUSS_DRIVER_H_ */
> +#endif	/* _PRUSS_INTERNAL_H_ */
> diff --git a/include/linux/remoteproc/pruss.h b/include/linux/remoteproc/pruss.h
> index 039b50d58df2..93a98cac7829 100644
> --- a/include/linux/remoteproc/pruss.h
> +++ b/include/linux/remoteproc/pruss.h
> @@ -4,12 +4,14 @@
>   *
>   * Copyright (C) 2015-2022 Texas Instruments Incorporated - http://www.ti.com
>   *	Suman Anna <s-anna@ti.com>
> + *	Tero Kristo <t-kristo@ti.com>
>   */
>  
>  #ifndef __LINUX_PRUSS_H
>  #define __LINUX_PRUSS_H
>  
>  #include <linux/device.h>
> +#include <linux/err.h>
>  #include <linux/types.h>
>  
>  #define PRU_RPROC_DRVNAME "pru-rproc"
> @@ -44,6 +46,23 @@ enum pru_ctable_idx {
>  
>  struct device_node;
>  struct rproc;
> +struct pruss;
> +
> +#if IS_ENABLED(CONFIG_TI_PRUSS)
> +
> +struct pruss *pruss_get(struct rproc *rproc);
> +void pruss_put(struct pruss *pruss);
> +
> +#else
> +
> +static inline struct pruss *pruss_get(struct rproc *rproc)
> +{
> +	return ERR_PTR(-EOPNOTSUPP);
> +}
> +
> +static inline void pruss_put(struct pruss *pruss) { }
> +
> +#endif /* CONFIG_TI_PRUSS */
>  
>  #if IS_ENABLED(CONFIG_PRU_REMOTEPROC)
>  
> -- 
> 2.25.1
> 

^ permalink raw reply

* [PATCH v2 0/1] HID: shield
From: Rahul Rameshbabu @ 2023-04-10 17:08 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, linux-kernel, Rahul Rameshbabu

Hi.

This is an initial driver implementation for supporting NVIDIA SHIELD
peripherals. Currently supports the following functionality for the
THUNDERSTRIKE (SHIELD 2017) controller.

  - Haptics (ff_memless)
  - Serial number query (sysfs)
  - Hardware information query (sysfs)
  - Firmware version query (sysfs)

Changes:
  v1 -> v2:
     * Declared thunderstrike_hostcmd_req_work_handler as static.
        Reported-by: kernel test robot <lkp@intel.com>
        Link: https://lore.kernel.org/oe-kbuild-all/202304011342.6Bh3cWhA-lkp@intel.com/
        Link: https://lore.kernel.org/oe-kbuild-all/202304020922.vsngJnBT-lkp@intel.com/

Rahul Rameshbabu (1):
  HID: shield: Initial driver implementation with Thunderstrike support

 MAINTAINERS              |   6 +
 drivers/hid/Kconfig      |  18 ++
 drivers/hid/Makefile     |   1 +
 drivers/hid/hid-ids.h    |   3 +
 drivers/hid/hid-shield.c | 587 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 615 insertions(+)
 create mode 100644 drivers/hid/hid-shield.c

Link: https://lore.kernel.org/linux-input/20230401032150.7424-1-rrameshbabu@nvidia.com/
-- 
2.38.4


^ permalink raw reply

* Re: [PATCH v2 2/2] dt-bindings: cisco: document the CrayAR compatibles
From: Daniel Walker (danielwa) @ 2023-04-10 17:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: xe-linux-external(mailer list),
	Marcin Wierzbicki -X (mawierzb - GLOBALLOGIC INC at Cisco),
	Rob Herring, Daniel Walker, Krzysztof Kozlowski,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <6af9effe-89c0-7630-9a72-a5a6351e0a95@linaro.org>

On Mon, Apr 10, 2023 at 05:28:03PM +0200, Krzysztof Kozlowski wrote:
> On 07/04/2023 18:04, Daniel Walker (danielwa) wrote:
> > On Thu, Apr 06, 2023 at 09:12:34AM +0200, Krzysztof Kozlowski wrote:
> >>> @@ -0,0 +1,27 @@
> >>> +# SPDX-License-Identifier: GPL-2.0-only
> >>
> >> Dual license.
> >>
> > 
> > What are my choices here? I see this,
> > 
> > # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> 
> Yes, the one suggested by the checkpatch. Did you run it?
 
 I don't recall if I did or not.

> > 
> > Which appears to be what your suggesting. I also see this,
> > 
> > # SPDX-License-Identifier: GPL-2.0
> > 
> > I'd rather use the later.
> 
> Why? Bindings should be licensed under BSD, so what is the reason to
> make here exception?

I'm sure I can re-license my submissions. I'd have to look into it.

Dainel

^ permalink raw reply

* Re: [PATCH v2 2/2] arm64: dts: qcom: Add base qrb4210-rb2 board dts
From: Bjorn Andersson @ 2023-04-10 17:12 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bhupesh Sharma, linux-arm-msm, devicetree, agross, linux-kernel,
	bhupesh.linux, robh+dt, krzysztof.kozlowski
In-Reply-To: <79731f2a-83e5-1e35-d450-456492cc5df2@linaro.org>

On Thu, Mar 16, 2023 at 12:52:10AM +0100, Konrad Dybcio wrote:
> 
> 
> On 15.03.2023 23:36, Bjorn Andersson wrote:
> > On Thu, Mar 16, 2023 at 02:31:45AM +0530, Bhupesh Sharma wrote:
> >> Add DTS for Qualcomm qrb4210-rb2 board which uses SM4250 SoC.
> >>
> >> This adds debug uart, emmc, uSD and tlmm support along with
> >> regulators found on this board.
> >>
> >> Also defines the 'xo_board' and 'sleep_clk' frequencies for
> >> this board.
> >>
> >> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
> >> ---
> [...]
> 
> >> +	vmmc-supply = <&vreg_l24a_2p96>;
> > 
> > Is there any reason why this platform doesn't require the vmmc supply to
> > be driven to HPM? This has traditionally been coming back biting us
> > through some stability issues later.
> Do we even support HPM/LPM on SMD RPM?
> 

We support specifying the load, which will trickle down to have the
HPM/LPM effect. You can find an example of this, with motivation in [1].

PS. While looking for an example I found [2]. regulator-system-load
doesn't do anything unless regulator-allow-set-load is defined...

[1] e38161bd325e ("arm64: dts: apq8096-db820c: Increase load on l21 for SDCARD")
[2] 1d99fee382a6 ("arm64: dts: qcom: sdm845-tama: Add regulator-system-load to l14a/l28a")

Regards,
Bjorn

^ permalink raw reply

* Re: [Intel-gfx] [PATCH v2 rebased 2/6] drm/i915: Initialize dkl_phy spin lock from display code path
From: Souza, Jose @ 2023-04-10 17:07 UTC (permalink / raw)
  To: Vivi, Rodrigo
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
In-Reply-To: <ZDQsYi1aR2QZjEw5@intel.com>

On Mon, 2023-04-10 at 11:33 -0400, Rodrigo Vivi wrote:
> On Thu, Apr 06, 2023 at 07:31:29AM -0700, José Roberto de Souza wrote:
> > Start to move the initialization of some lock from
> > i915_driver_early_probe().
> > This will also fix a warning in Xe kmd:
> > 
> > [  201.894839] xe 0000:00:02.0: [drm] [ENCODER:235:DDI A/PHY A] failed to retrieve link info, disabling eDP
> > [  202.136336] xe 0000:00:02.0: [drm] *ERROR* Failed to write source OUI
> > [  202.175346] INFO: trying to register non-static key.
> > [  202.175347] irq event stamp: 754060
> > [  202.175359] hardirqs last  enabled at (754059): [<ffffffff8122cf79>] tick_nohz_idle_enter+0x59/0x80
> > [  202.180294] The code is fine but needs lockdep annotation, or maybe
> > [  202.183774] hardirqs last disabled at (754060): [<ffffffff811a5539>] do_idle+0x99/0x230
> > [  202.192734] you didn't initialize this object before use?
> > [  202.198951] softirqs last  enabled at (753948): [<ffffffff8114abae>] irq_exit_rcu+0xbe/0x130
> > [  202.206882] turning off the locking correctness validator.
> > [  202.212236] softirqs last disabled at (753943): [<ffffffff8114abae>] irq_exit_rcu+0xbe/0x130
> > [  202.220592] CPU: 2 PID: 1415 Comm: modprobe Tainted: G        W          6.3.0-rc4+zeh-xe+ #909
> > [  202.243002] Hardware name: Intel Corporation Raptor Lake Client Platform/RaptorLake-P LP5 RVP, BIOS RPLPFWI1.R00.3361.A14.2211151548 11/15/2022
> > [  202.255737] Call Trace:
> > [  202.258179]  <TASK>
> > [  202.260275]  dump_stack_lvl+0x58/0xc0
> > [  202.263922]  register_lock_class+0x756/0x7d0
> > [  202.268165]  ? find_held_lock+0x2b/0x80
> > [  202.271975]  __lock_acquire+0x72/0x28b0
> > [  202.275786]  ? debug_object_free+0xb4/0x160
> > [  202.279946]  lock_acquire+0xd1/0x2d0
> > [  202.283503]  ? intel_dkl_phy_read+0x18/0x60 [xe]
> > [  202.288181]  _raw_spin_lock+0x2a/0x40
> > [  202.291825]  ? intel_dkl_phy_read+0x18/0x60 [xe]
> > [  202.296475]  intel_dkl_phy_read+0x18/0x60 [xe]
> > [  202.300949]  icl_aux_power_well_enable+0x2bd/0x400 [xe]
> > [  202.306202]  ? intel_display_power_grab_async_put_ref+0x75/0x120 [xe]
> > [  202.312649]  intel_power_well_enable+0x1c/0x70 [xe]
> > [  202.317543]  __intel_display_power_get_domain.part.0+0x4d/0x70 [xe]
> > [  202.323812]  intel_display_power_get+0x43/0x70 [xe]
> > [  202.328708]  intel_tc_port_init+0x199/0x2a0 [xe]
> > [  202.333363]  intel_ddi_init+0x6ad/0xb00 [xe]
> > [  202.337678]  intel_modeset_init_nogem+0x536/0x6d0 [xe]
> > [  202.342838]  xe_display_init_noaccel+0x19/0x40 [xe]
> > [  202.347743]  xe_device_probe+0x1f5/0x2a0 [xe]
> > [  202.352127]  xe_pci_probe+0x28c/0x480 [xe]
> > [  202.356260]  pci_device_probe+0x9d/0x150
> > [  202.360164]  really_probe+0x19a/0x400
> > [  202.363809]  ? __pfx___driver_attach+0x10/0x10
> > [  202.368226]  __driver_probe_device+0x73/0x170
> > [  202.372558]  driver_probe_device+0x1a/0x90
> > [  202.376632]  __driver_attach+0xcd/0x1c0
> > [  202.380442]  bus_for_each_dev+0x72/0xc0
> > [  202.384253]  bus_add_driver+0x110/0x210
> > [  202.388063]  driver_register+0x50/0x100
> > [  202.391873]  ? __pfx_init_module+0x10/0x10 [xe]
> > [  202.396431]  do_one_initcall+0x55/0x260
> > [  202.400245]  ? rcu_is_watching+0xd/0x40
> > [  202.404058]  ? kmalloc_trace+0xa0/0xb0
> > [  202.407786]  do_init_module+0x45/0x1e0
> > [  202.411512]  __do_sys_finit_module+0xac/0x120
> > [  202.415838]  do_syscall_64+0x37/0x90
> > [  202.419397]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
> > [  202.424409] RIP: 0033:0x7fd11291ea3d
> > [  202.427967] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 a3 0f 00 f7 d8 64 89 01 48
> > [  202.446530] RSP: 002b:00007ffffde11368 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
> > [  202.454031] RAX: ffffffffffffffda RBX: 00005616a617f210 RCX: 00007fd11291ea3d
> > [  202.461106] RDX: 0000000000000000 RSI: 00005616a617fe60 RDI: 000000000000000e
> > [  202.468182] RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000002
> > [  202.475250] R10: 000000000000000e R11: 0000000000000246 R12: 00005616a617fe60
> > [  202.482319] R13: 00005616a617f340 R14: 0000000000000000 R15: 00005616a6180650
> > [  202.489396]  </TASK>
> > 
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 3 +++
> >  drivers/gpu/drm/i915/display/intel_dkl_phy.c | 6 ++++++
> >  drivers/gpu/drm/i915/display/intel_dkl_phy.h | 2 ++
> >  drivers/gpu/drm/i915/i915_driver.c           | 1 -
> >  4 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 2d59330ff5abd..92e1b535b2798 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -85,6 +85,7 @@
> >  #include "intel_display_debugfs.h"
> >  #include "intel_display_power.h"
> >  #include "intel_display_types.h"
> > +#include "intel_dkl_phy.h"
> >  #include "intel_dmc.h"
> >  #include "intel_dp.h"
> >  #include "intel_dp_link_training.h"
> > @@ -7890,6 +7891,8 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
> 
> I'm afraid this is too late. Since dkl phy read can happen on some get hw state
> which can occur in wm and power_domain code...


Double checked in:
intel_power_domains_init()
intel_power_domains_init_hw()
intel_wm_init()
intel_modeset_init_hw()

And none of those places call any dkl function.

The closest is:
intel_power_domains_init_hw() -> icl_display_core_init() -> intel_combo_phy_init() -> icl_combo_phys_init()
but it is only over combo phys.

But I can move it to intel_modeset_init_noirq(), before intel_power_domains_init() is you think is better to be safer.

> 
> >  	if (!HAS_DISPLAY(dev_priv))
> >  		return;
> >  
> > +	intel_dkl_phy_init(dev_priv);
> > +
> >  	if (IS_DG2(dev_priv)) {
> >  		intel_ddi_init(dev_priv, PORT_A);
> >  		intel_ddi_init(dev_priv, PORT_B);
> > diff --git a/drivers/gpu/drm/i915/display/intel_dkl_phy.c b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > index 57cc3edba0163..5bce7b5b27bc7 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > @@ -104,3 +104,9 @@ intel_dkl_phy_posting_read(struct drm_i915_private *i915, struct intel_dkl_phy_r
> >  
> >  	spin_unlock(&i915->display.dkl.phy_lock);
> >  }
> > +
> > +void
> > +intel_dkl_phy_init(struct drm_i915_private *i915)
> > +{
> > +	spin_lock_init(&i915->display.dkl.phy_lock);
> > +}
> > diff --git a/drivers/gpu/drm/i915/display/intel_dkl_phy.h b/drivers/gpu/drm/i915/display/intel_dkl_phy.h
> > index 570ee36f9386f..615429b6392c5 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dkl_phy.h
> > +++ b/drivers/gpu/drm/i915/display/intel_dkl_phy.h
> > @@ -20,5 +20,7 @@ void
> >  intel_dkl_phy_rmw(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg, u32 clear, u32 set);
> >  void
> >  intel_dkl_phy_posting_read(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg);
> > +void
> > +intel_dkl_phy_init(struct drm_i915_private *i915);
> >  
> >  #endif /* __INTEL_DKL_PHY_H__ */
> > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> > index ea2cc56d18a6e..617b3d0da267d 100644
> > --- a/drivers/gpu/drm/i915/i915_driver.c
> > +++ b/drivers/gpu/drm/i915/i915_driver.c
> > @@ -223,7 +223,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
> >  	mutex_init(&dev_priv->display.wm.wm_mutex);
> >  	mutex_init(&dev_priv->display.pps.mutex);
> >  	mutex_init(&dev_priv->display.hdcp.comp_mutex);
> > -	spin_lock_init(&dev_priv->display.dkl.phy_lock);
> >  
> >  	i915_memcpy_init_early(dev_priv);
> >  	intel_runtime_pm_init_early(&dev_priv->runtime_pm);
> > -- 
> > 2.40.0
> > 


^ permalink raw reply

* Re: [Intel-xe] [Intel-gfx] [PATCH v2 rebased 2/6] drm/i915: Initialize dkl_phy spin lock from display code path
From: Souza, Jose @ 2023-04-10 17:07 UTC (permalink / raw)
  To: Vivi, Rodrigo
  Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
In-Reply-To: <ZDQsYi1aR2QZjEw5@intel.com>

On Mon, 2023-04-10 at 11:33 -0400, Rodrigo Vivi wrote:
> On Thu, Apr 06, 2023 at 07:31:29AM -0700, José Roberto de Souza wrote:
> > Start to move the initialization of some lock from
> > i915_driver_early_probe().
> > This will also fix a warning in Xe kmd:
> > 
> > [  201.894839] xe 0000:00:02.0: [drm] [ENCODER:235:DDI A/PHY A] failed to retrieve link info, disabling eDP
> > [  202.136336] xe 0000:00:02.0: [drm] *ERROR* Failed to write source OUI
> > [  202.175346] INFO: trying to register non-static key.
> > [  202.175347] irq event stamp: 754060
> > [  202.175359] hardirqs last  enabled at (754059): [<ffffffff8122cf79>] tick_nohz_idle_enter+0x59/0x80
> > [  202.180294] The code is fine but needs lockdep annotation, or maybe
> > [  202.183774] hardirqs last disabled at (754060): [<ffffffff811a5539>] do_idle+0x99/0x230
> > [  202.192734] you didn't initialize this object before use?
> > [  202.198951] softirqs last  enabled at (753948): [<ffffffff8114abae>] irq_exit_rcu+0xbe/0x130
> > [  202.206882] turning off the locking correctness validator.
> > [  202.212236] softirqs last disabled at (753943): [<ffffffff8114abae>] irq_exit_rcu+0xbe/0x130
> > [  202.220592] CPU: 2 PID: 1415 Comm: modprobe Tainted: G        W          6.3.0-rc4+zeh-xe+ #909
> > [  202.243002] Hardware name: Intel Corporation Raptor Lake Client Platform/RaptorLake-P LP5 RVP, BIOS RPLPFWI1.R00.3361.A14.2211151548 11/15/2022
> > [  202.255737] Call Trace:
> > [  202.258179]  <TASK>
> > [  202.260275]  dump_stack_lvl+0x58/0xc0
> > [  202.263922]  register_lock_class+0x756/0x7d0
> > [  202.268165]  ? find_held_lock+0x2b/0x80
> > [  202.271975]  __lock_acquire+0x72/0x28b0
> > [  202.275786]  ? debug_object_free+0xb4/0x160
> > [  202.279946]  lock_acquire+0xd1/0x2d0
> > [  202.283503]  ? intel_dkl_phy_read+0x18/0x60 [xe]
> > [  202.288181]  _raw_spin_lock+0x2a/0x40
> > [  202.291825]  ? intel_dkl_phy_read+0x18/0x60 [xe]
> > [  202.296475]  intel_dkl_phy_read+0x18/0x60 [xe]
> > [  202.300949]  icl_aux_power_well_enable+0x2bd/0x400 [xe]
> > [  202.306202]  ? intel_display_power_grab_async_put_ref+0x75/0x120 [xe]
> > [  202.312649]  intel_power_well_enable+0x1c/0x70 [xe]
> > [  202.317543]  __intel_display_power_get_domain.part.0+0x4d/0x70 [xe]
> > [  202.323812]  intel_display_power_get+0x43/0x70 [xe]
> > [  202.328708]  intel_tc_port_init+0x199/0x2a0 [xe]
> > [  202.333363]  intel_ddi_init+0x6ad/0xb00 [xe]
> > [  202.337678]  intel_modeset_init_nogem+0x536/0x6d0 [xe]
> > [  202.342838]  xe_display_init_noaccel+0x19/0x40 [xe]
> > [  202.347743]  xe_device_probe+0x1f5/0x2a0 [xe]
> > [  202.352127]  xe_pci_probe+0x28c/0x480 [xe]
> > [  202.356260]  pci_device_probe+0x9d/0x150
> > [  202.360164]  really_probe+0x19a/0x400
> > [  202.363809]  ? __pfx___driver_attach+0x10/0x10
> > [  202.368226]  __driver_probe_device+0x73/0x170
> > [  202.372558]  driver_probe_device+0x1a/0x90
> > [  202.376632]  __driver_attach+0xcd/0x1c0
> > [  202.380442]  bus_for_each_dev+0x72/0xc0
> > [  202.384253]  bus_add_driver+0x110/0x210
> > [  202.388063]  driver_register+0x50/0x100
> > [  202.391873]  ? __pfx_init_module+0x10/0x10 [xe]
> > [  202.396431]  do_one_initcall+0x55/0x260
> > [  202.400245]  ? rcu_is_watching+0xd/0x40
> > [  202.404058]  ? kmalloc_trace+0xa0/0xb0
> > [  202.407786]  do_init_module+0x45/0x1e0
> > [  202.411512]  __do_sys_finit_module+0xac/0x120
> > [  202.415838]  do_syscall_64+0x37/0x90
> > [  202.419397]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
> > [  202.424409] RIP: 0033:0x7fd11291ea3d
> > [  202.427967] Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 a3 0f 00 f7 d8 64 89 01 48
> > [  202.446530] RSP: 002b:00007ffffde11368 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
> > [  202.454031] RAX: ffffffffffffffda RBX: 00005616a617f210 RCX: 00007fd11291ea3d
> > [  202.461106] RDX: 0000000000000000 RSI: 00005616a617fe60 RDI: 000000000000000e
> > [  202.468182] RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000002
> > [  202.475250] R10: 000000000000000e R11: 0000000000000246 R12: 00005616a617fe60
> > [  202.482319] R13: 00005616a617f340 R14: 0000000000000000 R15: 00005616a6180650
> > [  202.489396]  </TASK>
> > 
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 3 +++
> >  drivers/gpu/drm/i915/display/intel_dkl_phy.c | 6 ++++++
> >  drivers/gpu/drm/i915/display/intel_dkl_phy.h | 2 ++
> >  drivers/gpu/drm/i915/i915_driver.c           | 1 -
> >  4 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 2d59330ff5abd..92e1b535b2798 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -85,6 +85,7 @@
> >  #include "intel_display_debugfs.h"
> >  #include "intel_display_power.h"
> >  #include "intel_display_types.h"
> > +#include "intel_dkl_phy.h"
> >  #include "intel_dmc.h"
> >  #include "intel_dp.h"
> >  #include "intel_dp_link_training.h"
> > @@ -7890,6 +7891,8 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
> 
> I'm afraid this is too late. Since dkl phy read can happen on some get hw state
> which can occur in wm and power_domain code...


Double checked in:
intel_power_domains_init()
intel_power_domains_init_hw()
intel_wm_init()
intel_modeset_init_hw()

And none of those places call any dkl function.

The closest is:
intel_power_domains_init_hw() -> icl_display_core_init() -> intel_combo_phy_init() -> icl_combo_phys_init()
but it is only over combo phys.

But I can move it to intel_modeset_init_noirq(), before intel_power_domains_init() is you think is better to be safer.

> 
> >  	if (!HAS_DISPLAY(dev_priv))
> >  		return;
> >  
> > +	intel_dkl_phy_init(dev_priv);
> > +
> >  	if (IS_DG2(dev_priv)) {
> >  		intel_ddi_init(dev_priv, PORT_A);
> >  		intel_ddi_init(dev_priv, PORT_B);
> > diff --git a/drivers/gpu/drm/i915/display/intel_dkl_phy.c b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > index 57cc3edba0163..5bce7b5b27bc7 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dkl_phy.c
> > @@ -104,3 +104,9 @@ intel_dkl_phy_posting_read(struct drm_i915_private *i915, struct intel_dkl_phy_r
> >  
> >  	spin_unlock(&i915->display.dkl.phy_lock);
> >  }
> > +
> > +void
> > +intel_dkl_phy_init(struct drm_i915_private *i915)
> > +{
> > +	spin_lock_init(&i915->display.dkl.phy_lock);
> > +}
> > diff --git a/drivers/gpu/drm/i915/display/intel_dkl_phy.h b/drivers/gpu/drm/i915/display/intel_dkl_phy.h
> > index 570ee36f9386f..615429b6392c5 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dkl_phy.h
> > +++ b/drivers/gpu/drm/i915/display/intel_dkl_phy.h
> > @@ -20,5 +20,7 @@ void
> >  intel_dkl_phy_rmw(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg, u32 clear, u32 set);
> >  void
> >  intel_dkl_phy_posting_read(struct drm_i915_private *i915, struct intel_dkl_phy_reg reg);
> > +void
> > +intel_dkl_phy_init(struct drm_i915_private *i915);
> >  
> >  #endif /* __INTEL_DKL_PHY_H__ */
> > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> > index ea2cc56d18a6e..617b3d0da267d 100644
> > --- a/drivers/gpu/drm/i915/i915_driver.c
> > +++ b/drivers/gpu/drm/i915/i915_driver.c
> > @@ -223,7 +223,6 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
> >  	mutex_init(&dev_priv->display.wm.wm_mutex);
> >  	mutex_init(&dev_priv->display.pps.mutex);
> >  	mutex_init(&dev_priv->display.hdcp.comp_mutex);
> > -	spin_lock_init(&dev_priv->display.dkl.phy_lock);
> >  
> >  	i915_memcpy_init_early(dev_priv);
> >  	intel_runtime_pm_init_early(&dev_priv->runtime_pm);
> > -- 
> > 2.40.0
> > 


^ permalink raw reply

* Re: git log causing hang while browsing upstream linux
From: Rohit Ner @ 2023-04-10 17:07 UTC (permalink / raw)
  To: Kristoffer Haugsbakk; +Cc: git
In-Reply-To: <b5316855-971d-4b7b-89cd-e81ececc5124@app.fastmail.com>

I have not given the command more than 10 seconds, shouldn't the
intended behaviour be to render the visible subgraph first?

On Wed, Apr 5, 2023 at 2:21 AM Kristoffer Haugsbakk
<kristofferhaugsbakk@fastmail.com> wrote:
>
> On Tue, Apr 4, 2023, at 22:27, Kristoffer Haugsbakk wrote:
> > FWIW: on my machine:
>
> So my point is: have you given the command a half a minute or so to
> output the initial lines? Certain `log` invocations can take a long time
> on repositories with rich histories.
>
> --
> Kristoffer Haugsbakk

^ permalink raw reply

* Re: [RFC PATCH net] net: ipv4/ipv6 addrconf: call igmp{,6}_group_dropped() while dev is still up
From: Vladimir Oltean @ 2023-04-10 17:07 UTC (permalink / raw)
  To: Ido Schimmel
  Cc: David Ahern, netdev, Jakub Kicinski, David S. Miller,
	Eric Dumazet, Paolo Abeni
In-Reply-To: <ZDP2bxXGbHX8C4BC@shredder>

On Mon, Apr 10, 2023 at 02:43:43PM +0300, Ido Schimmel wrote:
> On Mon, Apr 10, 2023 at 01:09:58PM +0300, Vladimir Oltean wrote:
> > So, how do you think I should proceed with this? One patch or two
> > (for IPv4 and IPv6)? Is the Fixes: tag ok?
> 
> Fixes tag looks OK and one patch is fine by me. However, given the
> problem is the check you mentioned in __dev_set_rx_mode(), wouldn't it
> be better to simply remove it? From the comment above this check it
> seems to assume that there is no need to update the Rx filters of the
> device when it's down because they will be synced when it's put back up,
> but it fails to consider the case where one wants to clear the filters
> of the device as part of device dismantle.

Yes, I can do this.

^ permalink raw reply

* Re: [PATCH] staging: octeon: remove typedef declaration for enums in octeon-stubs
From: Alison Schofield @ 2023-04-10 17:07 UTC (permalink / raw)
  To: Dalvin-Ehinoma Noah Aiguobas; +Cc: gregkh, linux-staging, linux-kernel
In-Reply-To: <20230410150852.GA57989@koolguy>

On Mon, Apr 10, 2023 at 05:08:52PM +0200, Dalvin-Ehinoma Noah Aiguobas wrote:

Hi Dalvin-Ehinoma,

I recognize this as a revision of an earlier patch. It needs to be
labeled [PATCH v2] in your subject line and a changelog included.

How to revise and resend patches:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html
https://kernelnewbies.org/PatchPhilosophy

Checkpatch is emitting this warning:
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#56:
Fix checkpatch.pl warning for enums in drivers/staging/octeon/octeon-stubs.h:

Alison

> Fix checkpatch.pl warning for enums in drivers/staging/octeon/octeon-stubs.h:
> cvmx_helper_interface_mode_t,
> cvmx_spi_mode_t,
> cvmx_pow_wait_t,
> cvmx_pko_lock_t,
> cvmx_pko_status_t
> 
> Change typedef cvmx_helper_interface_mode_t to
> enum cvmx_helper_interface_mode in ethernet.c
> 
> Signed-off-by: Dalvin-Ehinoma Noah Aiguobas <pharcodra@gmail.com>
> ---
>  drivers/staging/octeon/ethernet.c     |  2 +-
>  drivers/staging/octeon/octeon-stubs.h | 39 +++++++++++++--------------
>  2 files changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index 9eee28f2940c..023b107e077a 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -798,7 +798,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
>  
>  	num_interfaces = cvmx_helper_get_number_of_interfaces();
>  	for (interface = 0; interface < num_interfaces; interface++) {
> -		cvmx_helper_interface_mode_t imode =
> +		enum cvmx_helper_interface_mode imode =
>  		    cvmx_helper_interface_get_mode(interface);
>  		int num_ports = cvmx_helper_ports_on_interface(interface);
>  		int port;
> diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> index 3e7b92cd2e35..58708a7f727a 100644
> --- a/drivers/staging/octeon/octeon-stubs.h
> +++ b/drivers/staging/octeon/octeon-stubs.h
> @@ -213,14 +213,14 @@ enum cvmx_fau_op_size {
>  	CVMX_FAU_OP_SIZE_64 = 3
>  };
>  
> -typedef enum {
> +enum cvmx_spi_mode {
>  	CVMX_SPI_MODE_UNKNOWN = 0,
>  	CVMX_SPI_MODE_TX_HALFPLEX = 1,
>  	CVMX_SPI_MODE_RX_HALFPLEX = 2,
>  	CVMX_SPI_MODE_DUPLEX = 3
> -} cvmx_spi_mode_t;
> +};
>  
> -typedef enum {
> +enum cvmx_helper_interface_mode {
>  	CVMX_HELPER_INTERFACE_MODE_DISABLED,
>  	CVMX_HELPER_INTERFACE_MODE_RGMII,
>  	CVMX_HELPER_INTERFACE_MODE_GMII,
> @@ -231,20 +231,20 @@ typedef enum {
>  	CVMX_HELPER_INTERFACE_MODE_PICMG,
>  	CVMX_HELPER_INTERFACE_MODE_NPI,
>  	CVMX_HELPER_INTERFACE_MODE_LOOP,
> -} cvmx_helper_interface_mode_t;
> +};
>  
> -typedef enum {
> +enum cvmx_pow_wait {
>  	CVMX_POW_WAIT = 1,
>  	CVMX_POW_NO_WAIT = 0,
> -} cvmx_pow_wait_t;
> +};
>  
> -typedef enum {
> +enum cvmx_pko_lock {
>  	CVMX_PKO_LOCK_NONE = 0,
>  	CVMX_PKO_LOCK_ATOMIC_TAG = 1,
>  	CVMX_PKO_LOCK_CMD_QUEUE = 2,
> -} cvmx_pko_lock_t;
> +};
>  
> -typedef enum {
> +enum cvmx_pko_status {
>  	CVMX_PKO_SUCCESS,
>  	CVMX_PKO_INVALID_PORT,
>  	CVMX_PKO_INVALID_QUEUE,
> @@ -252,7 +252,7 @@ typedef enum {
>  	CVMX_PKO_NO_MEMORY,
>  	CVMX_PKO_PORT_ALREADY_SETUP,
>  	CVMX_PKO_CMD_QUEUE_INIT_ERROR
> -} cvmx_pko_status_t;
> +};
>  
>  enum cvmx_pow_tag_type {
>  	CVMX_POW_TAG_TYPE_ORDERED   = 0L,
> @@ -1265,8 +1265,7 @@ static inline void cvmx_pko_get_port_status(uint64_t port_num, uint64_t clear,
>  					    cvmx_pko_port_status_t *status)
>  { }
>  
> -static inline cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
> -								   interface)
> +static inline enum cvmx_helper_interface_mode cvmx_helper_interface_get_mode(int interface)
>  {
>  	return 0;
>  }
> @@ -1342,11 +1341,11 @@ static inline unsigned int cvmx_get_core_num(void)
>  }
>  
>  static inline void cvmx_pow_work_request_async_nocheck(int scr_addr,
> -						       cvmx_pow_wait_t wait)
> +						       enum cvmx_pow_wait wait)
>  { }
>  
>  static inline void cvmx_pow_work_request_async(int scr_addr,
> -					       cvmx_pow_wait_t wait)
> +					       enum cvmx_pow_wait wait)
>  { }
>  
>  static inline struct cvmx_wqe *cvmx_pow_work_response_async(int scr_addr)
> @@ -1356,13 +1355,13 @@ static inline struct cvmx_wqe *cvmx_pow_work_response_async(int scr_addr)
>  	return wqe;
>  }
>  
> -static inline struct cvmx_wqe *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait)
> +static inline struct cvmx_wqe *cvmx_pow_work_request_sync(enum cvmx_pow_wait wait)
>  {
>  	return (void *)(unsigned long)wait;
>  }
>  
>  static inline int cvmx_spi_restart_interface(int interface,
> -					cvmx_spi_mode_t mode, int timeout)
> +				       enum cvmx_spi_mode mode, int timeout)
>  {
>  	return 0;
>  }
> @@ -1381,12 +1380,12 @@ static inline union cvmx_gmxx_rxx_rx_inbnd cvmx_spi4000_check_speed(int interfac
>  }
>  
>  static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue,
> -						cvmx_pko_lock_t use_locking)
> +						enum cvmx_pko_lock use_locking)
>  { }
>  
> -static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port,
> -		uint64_t queue, union cvmx_pko_command_word0 pko_command,
> -		union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking)
> +static inline enum cvmx_pko_status cvmx_pko_send_packet_finish(uint64_t port,
> +		    uint64_t queue, union cvmx_pko_command_word0 pko_command,
> +		    union cvmx_buf_ptr packet, enum cvmx_pko_lock use_locking)
>  {
>  	return 0;
>  }
> -- 
> 2.25.1
> 

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.