Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P1801-T & grate_defconfig updates #126

Merged
merged 6 commits into from
Aug 14, 2022
Merged

Conversation

maximschwalm
Copy link
Contributor

Add support for the Genesys Logic USB2.0 Hub found on the Asus P1801-T.

Signed-off-by: Maxim Schwalm <[email protected]>
ARM: tegra: p1801-t: Add on-board hub and devices to USB3 port

Add the on-board hub and devices which are connected to the USB3 port.

Signed-off-by: Maxim Schwalm <[email protected]>
Comment on lines +2102 to +2113
compatible = "usb457,817";
reg = <1>;
reset-gpios = <&gpio TEGRA_GPIO(H, 6) GPIO_ACTIVE_LOW>;
power-gpios = <&gpio TEGRA_GPIO(S, 0) GPIO_ACTIVE_HIGH>;
};

/* Chicony USB2.0 HD UVC WebCam */
device@2 {
compatible = "usb4f2,b354";
reg = <2>;
power-gpios = <&gpio TEGRA_GPIO(BB, 4) GPIO_ACTIVE_HIGH>;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use gpio hogs for these USB devices?

In general we shouldn't amend changes that aren't upstreamable right now, such changes should be kept in a separate patches on top of the more ready patches. Hence there should be the basic tegra30-asus-p1801-t.dts that we can send to upstream today and everything else should be made on top of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can improve this later on.

@digetx
Copy link
Member

digetx commented Aug 14, 2022

Thanks

@digetx digetx merged commit 57f7aa8 into grate-driver:master Aug 14, 2022
okias pushed a commit to okias/linux that referenced this pull request Jan 11, 2024
Like commit 1cf3bfc ("bpf: Support 64-bit pointers to kfuncs")
for s390x, add support for 64-bit pointers to kfuncs for LoongArch.
Since the infrastructure is already implemented in BPF core, the only
thing need to be done is to override bpf_jit_supports_far_kfunc_call().

Before this change, several test_verifier tests failed:

  # ./test_verifier | grep # | grep FAIL
  grate-driver#119/p calls: invalid kfunc call: ptr_to_mem to struct with non-scalar FAIL
  grate-driver#120/p calls: invalid kfunc call: ptr_to_mem to struct with nesting depth > 4 FAIL
  grate-driver#121/p calls: invalid kfunc call: ptr_to_mem to struct with FAM FAIL
  grate-driver#122/p calls: invalid kfunc call: reg->type != PTR_TO_CTX FAIL
  grate-driver#123/p calls: invalid kfunc call: void * not allowed in func proto without mem size arg FAIL
  grate-driver#124/p calls: trigger reg2btf_ids[reg->type] for reg->type > __BPF_REG_TYPE_MAX FAIL
  grate-driver#125/p calls: invalid kfunc call: reg->off must be zero when passed to release kfunc FAIL
  grate-driver#126/p calls: invalid kfunc call: don't match first member type when passed to release kfunc FAIL
  grate-driver#127/p calls: invalid kfunc call: PTR_TO_BTF_ID with negative offset FAIL
  grate-driver#128/p calls: invalid kfunc call: PTR_TO_BTF_ID with variable offset FAIL
  grate-driver#129/p calls: invalid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  grate-driver#130/p calls: valid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  #486/p map_kptr: ref: reference state created and released on xchg FAIL

This is because the kfuncs in the loaded module are far away from
__bpf_call_base:

  ffff800002009440 t bpf_kfunc_call_test_fail1    [bpf_testmod]
  9000000002e128d8 T __bpf_call_base

The offset relative to __bpf_call_base does NOT fit in s32, which breaks
the assumption in BPF core. Enable bpf_jit_supports_far_kfunc_call() lifts
this limit.

Note that to reproduce the above result, tools/testing/selftests/bpf/config
should be applied, and run the test with JIT enabled, unpriv BPF enabled.

With this change, the test_verifier tests now all passed:

  # ./test_verifier
  ...
  Summary: 777 PASSED, 0 SKIPPED, 0 FAILED

Tested-by: Tiezhu Yang <[email protected]>
Signed-off-by: Hengqi Chen <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants