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

linux: update to 6.4.y #7837

Merged
merged 19 commits into from
Jul 4, 2023
Merged

linux: update to 6.4.y #7837

merged 19 commits into from
Jul 4, 2023

Conversation

heitbaum
Copy link
Contributor

@heitbaum heitbaum commented May 13, 2023

6.4 - Linux Kernel release
6.4.1 - 31 patches

errors / fixes / issues / regressions / todo

  • incorporate Wireless Intel AX101
  • nvidia update to 470.182.03 and patch
  • rtw88: drop upstreamed patches included in kernel 6.4
  • TODO: Add working 6.3 rtw88 patch to Amlogic
  • TODO: Rockchip
    • review WIP patches
  • update to Linux 6.4.1
  • update iwlwifi firmware for 6.4 - core78

log

6.4.1 Build tested on all of:

PROJECT=Allwinner ARCH=arm DEVICE=A64 s/build linux
PROJECT=Allwinner ARCH=arm DEVICE=H3 s/build linux
PROJECT=Allwinner ARCH=arm DEVICE=H5 s/build linux
PROJECT=Allwinner ARCH=arm DEVICE=H6 s/build linux
PROJECT=Rockchip ARCH=arm DEVICE=RK3288 s/build linux
PROJECT=Rockchip ARCH=arm DEVICE=RK3328 s/build linux
PROJECT=Rockchip ARCH=arm DEVICE=RK3399 s/build linux
PROJECT=NXP ARCH=arm DEVICE=iMX6 s/build linux
PROJECT=NXP ARCH=arm DEVICE=iMX8 s/build linux
PROJECT=Qualcomm ARCH=arm DEVICE=Dragonboard s/build linux - u-boot build failure
PROJECT=Generic ARCH=x86_64 DEVICE=Generic s/build linux
PROJECT=Generic ARCH=x86_64 DEVICE=Generic-legacy s/build linux
PROJECT=Samsung ARCH=arm DEVICE=Exynos s/build linux

6.3.y Run tested on all of:

  • Allwinner all - tested - TBA - jernejsk
  • Allwinner H6 (Tanix TX6) - 6.4.1 - heitbaum
  • Generic Generic (Intel ADL - NUC12) - 6.4.1 - heitbaum
  • NXP iMX6 (Cubox-i4Pro) - TBA - heitbaum
  • Rockchip RK3399pro (Rock Pi N10) - TBA - heitbaum
  • RK all - tested - TBA - knaerzche
  • Samsung Exynos (Hardkernel ODROID XU4) - TBA - heitbaum

——

Fixed: Issues on Tanix TX6 - 8822bs/cs - fixed with byte-wise-word-io patch

8822bs
[    8.817489] rtw_8822bs mmc1:0001:1: Firmware version 27.2.0, H2C version 13
[    8.817786] sunxi-mmc 4021000.mmc: unaligned scatterlist: os f80 length 2
[    8.817796] sunxi-mmc 4021000.mmc: map DMA failed
[    8.817804] rtw_8822bs mmc1:0001:1: sdio read16 failed (0x10230): -22
...
[    8.818259] rtw_8822bs mmc1:0001:1: failed to download rsvd page
[    8.818313] rtw_8822bs mmc1:0001:1: failed to download firmware
...
[    8.819096] rtw_8822bs mmc1:0001:1: failed to setup chip efuse info
[    8.819103] rtw_8822bs mmc1:0001:1: failed to setup chip information
[    8.819323] rtw_8822bs: probe of mmc1:0001:1 failed with error -16

8822cs
[    7.426639] rtw_8822cs mmc1:0001:1: WOW Firmware version 9.9.4, H2C version 15
[    7.428342] rtw_8822cs mmc1:0001:1: Firmware version 9.9.15, H2C version 15
[    7.437851] sunxi-mmc 4021000.mmc: unaligned scatterlist: os f80 length 2
[    7.437891] sunxi-mmc 4021000.mmc: map DMA failed
[    7.437901] rtw_8822cs mmc1:0001:1: sdio read16 failed (0x10230): -22
...
[    7.438363] rtw_8822cs mmc1:0001:1: sdio write16 failed (0x10204): -22
[    7.438393] rtw_8822cs mmc1:0001:1: failed to download rsvd page
[    7.438444] rtw_8822cs mmc1:0001:1: failed to download firmware
...
[    7.438928] rtw_8822cs mmc1:0001:1: failed to setup chip efuse info
[    7.438944] rtw_8822cs mmc1:0001:1: failed to setup chip information
[    7.439218] rtw_8822cs: probe of mmc1:0001:1 failed with error -16

@heitbaum
Copy link
Contributor Author

See https://lore.kernel.org/linux-wireless/880bb4ed-f3a5-2d7f-db10-fec65087dd05@lwfinger.net/T/#mf53120e175d8015c12a8ef57d2643da2ac34a74f for wifi issue

I can confirm that both TX6 (822bs and 8822cs have running WiFi and Bluetooth with 6.4-rc1 and the byte-wise-word-io patch. I havent done any performance tests / ... But connectivity was no issue.

With HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2 now in 6.4-rc1 - I'll tidy up the BT 8822bs patch and submit.

@heitbaum
Copy link
Contributor Author

iperf testing has no dmesg errors - tested with both ipv4/ipv6 and both arm/aarch64 user lands

tx6-8822cs:~ # iperf --client nuc12.local -t 60
...
[  5]  57.00-58.00  sec  4.85 MBytes  40.7 Mbits/sec    0   1.06 MBytes
[  5]  58.00-59.00  sec  5.40 MBytes  45.3 Mbits/sec    0   1.06 MBytes
[  5]  59.00-60.00  sec  5.10 MBytes  42.7 Mbits/sec    0   1.06 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-60.00  sec   351 MBytes  49.1 Mbits/sec    0             sender
[  5]   0.00-60.04  sec   347 MBytes  48.5 Mbits/sec                  receiver

tx6-8822bs:~ # iperf --client nuc12.local -t 60
...
[  5]  57.00-58.00  sec  4.11 MBytes  34.5 Mbits/sec    0    650 KBytes
[  5]  58.00-59.00  sec  4.85 MBytes  40.7 Mbits/sec    0    650 KBytes
[  5]  59.00-60.00  sec  4.85 MBytes  40.7 Mbits/sec    0    650 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-60.00  sec   291 MBytes  40.7 Mbits/sec    0             sender
[  5]   0.00-60.03  sec   289 MBytes  40.4 Mbits/sec                  receiver


nuc12:~ # iperf --client tx6-8822cs -t 60
...
[  5]  57.00-58.00  sec  7.61 MBytes  63.9 Mbits/sec    0   3.15 MBytes
[  5]  58.00-59.00  sec  7.92 MBytes  66.4 Mbits/sec    0   3.15 MBytes
[  5]  59.00-60.00  sec  8.60 MBytes  72.1 Mbits/sec    0   3.15 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-60.00  sec   493 MBytes  68.9 Mbits/sec    0             sender
[  5]   0.00-60.00  sec   492 MBytes  68.8 Mbits/sec                  receiver

nuc12:~ # iperf --client tx6-8822bs -t 60
...
[  5]  57.00-58.00  sec  4.79 MBytes  40.2 Mbits/sec    0   3.15 MBytes
[  5]  58.00-59.00  sec  4.30 MBytes  36.1 Mbits/sec    0   3.15 MBytes
[  5]  59.00-60.00  sec  4.11 MBytes  34.5 Mbits/sec    0   3.15 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-60.00  sec   260 MBytes  36.3 Mbits/sec    0             sender
[  5]   0.00-60.00  sec   259 MBytes  36.3 Mbits/sec                  receiver

@heitbaum heitbaum force-pushed the kernel64 branch 5 times, most recently from 0a7adbe to 1d67891 Compare May 14, 2023 22:30
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request May 15, 2023
The Allwinner sunxi-mmc controller cannot handle word (16 bit)
transfers. So and sdio_{read,write}w fails with messages like the
following example using an RTL8822BS (but the same problems were also
observed with RTL8822CS and RTL8723DS chips):
  rtw_8822bs mmc1:0001:1: Firmware version 27.2.0, H2C version 13
  sunxi-mmc 4021000.mmc: unaligned scatterlist: os f80 length 2
  sunxi-mmc 4021000.mmc: map DMA failed
  rtw_8822bs mmc1:0001:1: sdio read16 failed (0x10230): -22

Use two consecutive single byte accesses for word operations instead. It
turns out that upon closer inspection this is also what the vendor
driver does, even though it does have support for sdio_{read,write}w. So
we can conclude that the rtw88 chips do support word access but only on
SDIO controllers that also support it. Since there's no way to detect if
the controller supports word access or not the rtw88 sdio driver
switches to the easiest approach: avoiding word access.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Closes: https://lore.kernel.org/linux-wireless/527585e5-9cdd-66ed-c3af-6da162f4b720@lwfinger.net/
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: LibreELEC/LibreELEC.tv#7837 (comment)
Fixes: 65371a3 ("wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets")
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
xdarklight added a commit to xdarklight/linux that referenced this pull request May 15, 2023
The Allwinner sunxi-mmc controller cannot handle word (16 bit)
transfers. So and sdio_{read,write}w fails with messages like the
following example using an RTL8822BS (but the same problems were also
observed with RTL8822CS and RTL8723DS chips):
  rtw_8822bs mmc1:0001:1: Firmware version 27.2.0, H2C version 13
  sunxi-mmc 4021000.mmc: unaligned scatterlist: os f80 length 2
  sunxi-mmc 4021000.mmc: map DMA failed
  rtw_8822bs mmc1:0001:1: sdio read16 failed (0x10230): -22

Use two consecutive single byte accesses for word operations instead. It
turns out that upon closer inspection this is also what the vendor
driver does, even though it does have support for sdio_{read,write}w. So
we can conclude that the rtw88 chips do support word access but only on
SDIO controllers that also support it. Since there's no way to detect if
the controller supports word access or not the rtw88 sdio driver
switches to the easiest approach: avoiding word access.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Closes: https://lore.kernel.org/linux-wireless/527585e5-9cdd-66ed-c3af-6da162f4b720@lwfinger.net/
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: LibreELEC/LibreELEC.tv#7837 (comment)
Fixes: 65371a3 ("wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets")
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
@heitbaum heitbaum force-pushed the kernel64 branch 7 times, most recently from ea3141e to 566dbd8 Compare June 24, 2023 04:37
@heitbaum
Copy link
Contributor Author

@Kwiboo / @knaerzche - are these rebases ok? Otherwise let me know. If so I squash (change from wip) and finalise 6.4.

  • 3ccfdf5653bee1b575fcd39ddafb5782379f4b35
  • 3a8937ba828b809c56e95765fe4d7f2ed5e926aa

@heitbaum
Copy link
Contributor Author

@Kwiboo / @knaerzche - are these rebases ok? Otherwise let me know. If so I squash (change from wip) and finalise 6.4.

I can take a closer look, the dropped patches should probably be reworked and not just dropped.

Currently slowly working on upstreaming rockchip hdmi 2.0 patches and will rework as progress is made.

@Kwiboo I’ve gone through the code today, the 3 dropped patches were across the same function dw_hdmi_rockchip_mode_valid. Diffs are below, few differences in that MODE_CLOCK_HIGH, ycbcr_420_allowed and no specific handling for 340000. I can see where the code has diverged but come back together in the mpll_cfg, but not quite sure on rebasing it all back together.

the brute force revert 6.5 to 6.4-LE patch is here 40ff3634f71b8bf1769d05a565e7275b6ecbac51 which is easier to read

upstream change 6.4 to 6.5

@@ -241,23 +250,39 @@
 }
 
 static enum drm_mode_status
-dw_hdmi_rockchip_mode_valid(struct dw_hdmi *hdmi, void *data,
+dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, void *data,
                            const struct drm_display_info *info,
                            const struct drm_display_mode *mode)
 {
+       struct rockchip_hdmi *hdmi = data;
        const struct dw_hdmi_mpll_config *mpll_cfg = rockchip_mpll_cfg;
        int pclk = mode->clock * 1000;
-       bool valid = false;
+       bool exact_match = hdmi->plat_data->phy_force_vendor;
        int i;
 
+       if (hdmi->ref_clk) {
+               int rpclk = clk_round_rate(hdmi->ref_clk, pclk);
+
+               if (abs(rpclk - pclk) > pclk / 1000)
+                       return MODE_NOCLOCK;
+       }
+
        for (i = 0; mpll_cfg[i].mpixelclock != (~0UL); i++) {
-               if (pclk == mpll_cfg[i].mpixelclock) {
-                       valid = true;
-                       break;
-               }
+               /*
+                * For vendor specific phys force an exact match of the pixelclock
+                * to preserve the original behaviour of the driver.
+                */
+               if (exact_match && pclk == mpll_cfg[i].mpixelclock)
+                       return MODE_OK;
+               /*
+                * The Synopsys phy can work with pixelclocks up to the value given
+                * in the corresponding mpll_cfg entry.
+                */
+               if (!exact_match && pclk <= mpll_cfg[i].mpixelclock)
+                       return MODE_OK;
        }
 
-       return (valid) ? MODE_OK : MODE_BAD;
+       return MODE_BAD;
 }
 
 static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder)

Downstream LE patches 6.4 to 6.4-LE

@@ -245,19 +245,31 @@
                            const struct drm_display_info *info,
                            const struct drm_display_mode *mode)
 {
-       const struct dw_hdmi_mpll_config *mpll_cfg = rockchip_mpll_cfg;
-       int pclk = mode->clock * 1000;
-       bool valid = false;
-       int i;
-
-       for (i = 0; mpll_cfg[i].mpixelclock != (~0UL); i++) {
-               if (pclk == mpll_cfg[i].mpixelclock) {
-                       valid = true;
-                       break;
-               }
+       struct dw_hdmi_plat_data *pdata = (struct dw_hdmi_plat_data *)data;
+       const struct dw_hdmi_mpll_config *mpll_cfg = pdata->mpll_cfg;
+       int clock = mode->clock;
+       unsigned int i = 0;
+
+       if (pdata->ycbcr_420_allowed && drm_mode_is_420(info, mode) &&
+           (info->color_formats & DRM_COLOR_FORMAT_YCBCR420)) {
+               clock /= 2;
+               mpll_cfg = pdata->mpll_cfg_420;
+       }
+
+       if ((!mpll_cfg && clock > 340000) ||
+           (info->max_tmds_clock && clock > info->max_tmds_clock))
+               return MODE_CLOCK_HIGH;
+
+       if (mpll_cfg) {
+               while ((clock * 1000) < mpll_cfg[i].mpixelclock &&
+                      mpll_cfg[i].mpixelclock != (~0UL))
+                      i++;
+
+               if (mpll_cfg[i].mpixelclock == (~0UL))
+                       return MODE_CLOCK_HIGH;
        }
 
-       return (valid) ? MODE_OK : MODE_BAD;
+       return MODE_OK;
 }
 
 static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder)

Resulting difference between 6.4-LE and 6.5


@@ -241,35 +250,39 @@
 }
 
 static enum drm_mode_status
-dw_hdmi_rockchip_mode_valid(struct dw_hdmi *hdmi, void *data,
+dw_hdmi_rockchip_mode_valid(struct dw_hdmi *dw_hdmi, void *data,
                            const struct drm_display_info *info,
                            const struct drm_display_mode *mode)
 {
-       struct dw_hdmi_plat_data *pdata = (struct dw_hdmi_plat_data *)data;
-       const struct dw_hdmi_mpll_config *mpll_cfg = pdata->mpll_cfg;
-       int clock = mode->clock;
-       unsigned int i = 0;
-
-       if (pdata->ycbcr_420_allowed && drm_mode_is_420(info, mode) &&
-           (info->color_formats & DRM_COLOR_FORMAT_YCBCR420)) {
-               clock /= 2;
-               mpll_cfg = pdata->mpll_cfg_420;
-       }
-
-       if ((!mpll_cfg && clock > 340000) ||
-           (info->max_tmds_clock && clock > info->max_tmds_clock))
-               return MODE_CLOCK_HIGH;
-
-       if (mpll_cfg) {
-               while ((clock * 1000) < mpll_cfg[i].mpixelclock &&
-                      mpll_cfg[i].mpixelclock != (~0UL))
-                      i++;
-
-               if (mpll_cfg[i].mpixelclock == (~0UL))
-                       return MODE_CLOCK_HIGH;
+       struct rockchip_hdmi *hdmi = data;
+       const struct dw_hdmi_mpll_config *mpll_cfg = rockchip_mpll_cfg;
+       int pclk = mode->clock * 1000;
+       bool exact_match = hdmi->plat_data->phy_force_vendor;
+       int i;
+
+       if (hdmi->ref_clk) {
+               int rpclk = clk_round_rate(hdmi->ref_clk, pclk);
+
+               if (abs(rpclk - pclk) > pclk / 1000)
+                       return MODE_NOCLOCK;
+       }
+
+       for (i = 0; mpll_cfg[i].mpixelclock != (~0UL); i++) {
+               /*
+                * For vendor specific phys force an exact match of the pixelclock
+                * to preserve the original behaviour of the driver.
+                */
+               if (exact_match && pclk == mpll_cfg[i].mpixelclock)
+                       return MODE_OK;
+               /*
+                * The Synopsys phy can work with pixelclocks up to the value given
+                * in the corresponding mpll_cfg entry.
+                */
+               if (!exact_match && pclk <= mpll_cfg[i].mpixelclock)
+                       return MODE_OK;
        }
 
-       return MODE_OK;
+       return MODE_BAD;
 }
 
 static void dw_hdmi_rockchip_encoder_disable(struct drm_encoder *encoder)

@heitbaum heitbaum marked this pull request as ready for review June 26, 2023 06:18
@CvH CvH merged commit db76177 into LibreELEC:master Jul 4, 2023
@heitbaum heitbaum deleted the kernel64 branch July 4, 2023 21:57
PlaidCat added a commit to ctrliq/kernel-src-tree that referenced this pull request Sep 13, 2024
jira LE-1907
Rebuild_History Non-Buildable kernel-4.18.0-512.el8
commit-author Martin Blumenstingl <martin.blumenstingl@googlemail.com>
commit cb0ddaa

The Allwinner sunxi-mmc controller cannot handle word (16 bit)
transfers. So and sdio_{read,write}w fails with messages like the
following example using an RTL8822BS (but the same problems were also
observed with RTL8822CS and RTL8723DS chips):
  rtw_8822bs mmc1:0001:1: Firmware version 27.2.0, H2C version 13
  sunxi-mmc 4021000.mmc: unaligned scatterlist: os f80 length 2
  sunxi-mmc 4021000.mmc: map DMA failed
  rtw_8822bs mmc1:0001:1: sdio read16 failed (0x10230): -22

Use two consecutive single byte accesses for word operations instead. It
turns out that upon closer inspection this is also what the vendor
driver does, even though it does have support for sdio_{read,write}w. So
we can conclude that the rtw88 chips do support word access but only on
SDIO controllers that also support it. Since there's no way to detect if
the controller supports word access or not the rtw88 sdio driver
switches to the easiest approach: avoiding word access.

	Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Closes: https://lore.kernel.org/linux-wireless/527585e5-9cdd-66ed-c3af-6da162f4b720@lwfinger.net/
	Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: LibreELEC/LibreELEC.tv#7837 (comment)
Fixes: 65371a3 ("wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets")
	Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
	Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
	Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230515195043.572375-1-martin.blumenstingl@googlemail.com
(cherry picked from commit cb0ddaa)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants