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

arm(64)/dts/connect4: Reduce SPI frequency of KSZ9897 #30

Conversation

linosanfilippo-kunbus
Copy link

It turned out that if the SPI frequency for accessing the KSZ9897 is too
high (more than 33MHz) the data read from the PHY registers may be
corrupted if at the same time the USB is accessed. This may be caused by
interferences between the SPI and USB signals.
However reducing the frequency to a value below or equal to 33MHz for the
SPI communication with the switch eliminates this effect.
To be on the save side choose a value of 25MHz.

Signed-off-by: Lino Sanfilippo l.sanfilippo@kunbus.com

@@ -199,7 +199,7 @@
ksz9897: ksz9897@0 {
compatible = "microchip,ksz9897";
reg = <0>;
spi-max-frequency = <50000000>;
spi-max-frequency = <25000000>;

Choose a reason for hiding this comment

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

Could you add a comment in the file as well?

Choose a reason for hiding this comment

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

yes, makes sense

It turned out that if the SPI frequency for accessing the KSZ9897 is too
high (more than 33MHz) the data read from the PHY registers may be
corrupted if at the same time the USB is accessed. This may be caused by
interferences between the SPI and USB signals.
However reducing the frequency to a value below or equal to 33MHz for the
SPI communication with the switch eliminates this effect.
To be on the save side choose a value of 25MHz.

Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
@linosanfilippo-kunbus linosanfilippo-kunbus force-pushed the fix/REVPI-1403/invalid_values_from_phy branch from 14253e0 to 072cdfa Compare August 4, 2021 09:15
@iluminat23 iluminat23 self-requested a review August 9, 2021 06:29
@linosanfilippo-kunbus linosanfilippo-kunbus merged commit 7279e49 into RevolutionPi:devel/connect4/dt Aug 9, 2021
iluminat23 pushed a commit that referenced this pull request Jan 20, 2022
[ Upstream commit d412137 ]

The perf_buffer fails on system with offline cpus:

  # test_progs -t perf_buffer
  test_perf_buffer:PASS:nr_cpus 0 nsec
  test_perf_buffer:PASS:nr_on_cpus 0 nsec
  test_perf_buffer:PASS:skel_load 0 nsec
  test_perf_buffer:PASS:attach_kprobe 0 nsec
  test_perf_buffer:PASS:perf_buf__new 0 nsec
  test_perf_buffer:PASS:epoll_fd 0 nsec
  skipping offline CPU #24
  skipping offline CPU #25
  skipping offline CPU #26
  skipping offline CPU #27
  skipping offline CPU #28
  skipping offline CPU #29
  skipping offline CPU #30
  skipping offline CPU #31
  test_perf_buffer:PASS:perf_buffer__poll 0 nsec
  test_perf_buffer:PASS:seen_cpu_cnt 0 nsec
  test_perf_buffer:FAIL:buf_cnt got 24, expected 32
  Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED

Changing the test to check online cpus instead of possible.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20211021114132.8196-2-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
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