author | Urja (ARMLFS builder)
<urja+armlfs@urja.dev> 2025-02-10 10:15:00 UTC |
committer | Urja (ARMLFS builder)
<urja+armlfs@urja.dev> 2025-02-10 10:15:00 UTC |
parent | a4ee6e7c316caf3623200f3003fedebd96da2389 |
.SRCINFO | +36 | -0 |
PKGBUILD | +6 | -6 |
armlfs.patch | +328 | -327 |
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..acb3014 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,36 @@ +pkgbase = linux-armlfs + pkgver = 6.13.2 + pkgrel = 1 + url = http://www.kernel.org/ + arch = armv7h + license = GPL2 + makedepends = xmlto + makedepends = docbook-xsl + makedepends = kmod + makedepends = inetutils + makedepends = bc + makedepends = git + makedepends = dtc + makedepends = vboot-utils + makedepends = uboot-tools + options = !strip + source = https://www.kernel.org/pub/linux/kernel/v6.x/linux-6.13.tar.xz + source = https://www.kernel.org/pub/linux/kernel/v6.x/patch-6.13.2.xz + source = armlfs.patch + source = kernel.its + source = kernel.keyblock + source = kernel_data_key.vbprivk + source = 60-linux.hook + source = config + sha256sums = e79dcc6eb86695c6babfb07c2861912b635d5075c6cd1cd0567d1ea155f80d6e + sha256sums = 20803fd927b70f81f74d43108f1e9048aa429b970a307c522e929061d500f249 + sha256sums = 37ea9fa8f1f9656ac6f906d5774c813e659646785027c4ec102ab7cdb1759c11 + sha256sums = 994aee74b13313bdc7c47df4d621c890f5ee52bc18f6c7b658de215c17423b2a + sha256sums = 4e708c9ec43ac4a5d718474c9431ba6b6da3e64a9dda6afd2853a9e9e3079ffb + sha256sums = bc9e707a86e55a93f423e7bcdae4a25fd470b868e53829b91bbe2ccfbc6da27b + sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21 + sha256sums = 91b60d81760bf349abc4fcc8e7660269ed5fc996a636a1b88b5328256b5c6772 + +pkgname = linux-armlfs + +pkgname = linux-armlfs-chromebook diff --git a/PKGBUILD b/PKGBUILD index be08b3f..bee0e3e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -11,11 +11,11 @@ buildarch=4 _xname= pkgbase=linux-armlfs${_xname} -_srcname=linux-6.10 +_srcname=linux-6.13 _kernelname=${pkgbase#linux} _desc="Veyron Speedy" -pkgver=6.10.2 -pkgrel=3 +pkgver=6.13.2 +pkgrel=1 arch=('armv7h') url="http://www.kernel.org/" license=('GPL2') @@ -167,9 +167,9 @@ for _p in ${pkgname[@]}; do }" done -sha256sums=('774698422ee54c5f1e704456f37c65c06b51b4e9a8b0866f34580d86fef8e226' - 'f3166b9b9f6a7dbae9ed7e92e373c8ddb672c5bd2da3991207aa30f52ceda7fa' - 'cb7604e70e47c32840e3555871ae7b85193d4348834e8c7baf0b0c28796f68cf' +sha256sums=('e79dcc6eb86695c6babfb07c2861912b635d5075c6cd1cd0567d1ea155f80d6e' + '20803fd927b70f81f74d43108f1e9048aa429b970a307c522e929061d500f249' + '37ea9fa8f1f9656ac6f906d5774c813e659646785027c4ec102ab7cdb1759c11' '994aee74b13313bdc7c47df4d621c890f5ee52bc18f6c7b658de215c17423b2a' '4e708c9ec43ac4a5d718474c9431ba6b6da3e64a9dda6afd2853a9e9e3079ffb' 'bc9e707a86e55a93f423e7bcdae4a25fd470b868e53829b91bbe2ccfbc6da27b' diff --git a/armlfs.patch b/armlfs.patch index cc28106..c0bf04b 100644 --- a/armlfs.patch +++ b/armlfs.patch @@ -1,4 +1,4 @@ -From 351552ca316e279db9c47a6353d7b8adec7a3631 Mon Sep 17 00:00:00 2001 +From c36a6c0c3be3621cb7f4031ac40e1f2424edc52a Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Mon, 27 Aug 2018 10:30:55 +0000 Subject: [PATCH 01/33] drivers: clk-rk3288: support for dedicating NPLL to a @@ -8,12 +8,12 @@ As controlled by the just introduced dts property. Signed-off-by: Urja Rannikko <urjaman@gmail.com> --- - drivers/clk/rockchip/clk-rk3288.c | 69 +++++++++++++++++++++++++------ + drivers/clk/rockchip/clk-rk3288.c | 70 +++++++++++++++++++++++++------ drivers/clk/rockchip/clk.h | 3 ++ - 2 files changed, 60 insertions(+), 12 deletions(-) + 2 files changed, 61 insertions(+), 12 deletions(-) diff --git a/drivers/clk/rockchip/clk-rk3288.c b/drivers/clk/rockchip/clk-rk3288.c -index baa5aebd3277..11493f0be2b1 100644 +index 90d329216064..671c786ddbaa 100644 --- a/drivers/clk/rockchip/clk-rk3288.c +++ b/drivers/clk/rockchip/clk-rk3288.c @@ -195,10 +195,14 @@ PNAME(mux_ddrphy_p) = { "dpll_ddr", "gpll_ddr" }; @@ -93,15 +93,15 @@ index baa5aebd3277..11493f0be2b1 100644 RK3288_CLKSEL_CON(35), 6, 2, MFLAGS, 0, 5, DFLAGS, RK3288_CLKGATE_CON(4), 10, GFLAGS), -@@ -932,6 +936,7 @@ static void __init rk3288_common_init(struct device_node *np, - enum rk3288_variant soc) +@@ -933,6 +937,7 @@ static void __init rk3288_common_init(struct device_node *np, { struct rockchip_clk_provider *ctx; + unsigned long clk_nr_clks; + s32 npll_vop = -1; rk3288_cru_base = of_iomap(np, 0); if (!rk3288_cru_base) { -@@ -939,6 +944,46 @@ static void __init rk3288_common_init(struct device_node *np, +@@ -940,9 +945,50 @@ static void __init rk3288_common_init(struct device_node *np, return; } @@ -145,14 +145,18 @@ index baa5aebd3277..11493f0be2b1 100644 + } + } + - ctx = rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS); + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3288_clk_branches, + ARRAY_SIZE(rk3288_clk_branches)) + 1; + ctx = rockchip_clk_init(np, rk3288_cru_base, clk_nr_clks); ++ if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); + iounmap(rk3288_cru_base); diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h -index fd3b476dedda..878693518ee4 100644 +index f1957e1c1178..7c37a6ee5d40 100644 --- a/drivers/clk/rockchip/clk.h +++ b/drivers/clk/rockchip/clk.h -@@ -510,6 +510,9 @@ struct clk *rockchip_clk_register_muxgrf(const char *name, +@@ -563,6 +563,9 @@ struct clk *rockchip_clk_register_muxgrf(const char *name, #define PNAME(x) static const char *const x[] __initconst @@ -166,7 +170,7 @@ index fd3b476dedda..878693518ee4 100644 2.44.0 -From 3930ab3228d62714c2aac87ce2d0c922a450c8b8 Mon Sep 17 00:00:00 2001 +From b824b9ea6bc90628bba2d4039f993de928507fa8 Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Wed, 22 Aug 2018 18:36:40 +0000 Subject: [PATCH 02/33] drm: dw_hdmi-rockchip: better clock selection logic and @@ -195,16 +199,16 @@ CHROMIUM: drm: rockchip/dw_hdmi-rockchip: Decrease slop Signed-off-by: Urja Rannikko <urjaman@gmail.com> Signed-off-by: Maya Matuszczyk <maccraft123mc@gmail.com> --- - drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 279 ++++++++++++-------- - 1 file changed, 166 insertions(+), 113 deletions(-) + drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 136 ++++++++++++++++---- + 1 file changed, 109 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c -index fe33092abbe7..42576b4807cf 100644 +index 42bda4ffbbbd..a5aa95e20b07 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c -@@ -80,8 +80,13 @@ struct rockchip_hdmi { - struct regulator *avdd_0v9; - struct regulator *avdd_1v8; +@@ -81,8 +81,13 @@ struct rockchip_hdmi { + struct clk *grf_clk; + struct dw_hdmi *hdmi; struct phy *phy; + u32* rates; + u32 rates_cnt; @@ -216,7 +220,7 @@ index fe33092abbe7..42576b4807cf 100644 static struct rockchip_hdmi *to_rockchip_hdmi(struct drm_encoder *encoder) { struct rockchip_encoder *rkencoder = to_rockchip_encoder(encoder); -@@ -89,126 +94,132 @@ static struct rockchip_hdmi *to_rockchip_hdmi(struct drm_encoder *encoder) +@@ -90,6 +95,23 @@ static struct rockchip_hdmi *to_rockchip_hdmi(struct drm_encoder *encoder) return container_of(rkencoder, struct rockchip_hdmi, encoder); } @@ -239,186 +243,25 @@ index fe33092abbe7..42576b4807cf 100644 + static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = { { -- 27000000, { -- { 0x00b3, 0x0000}, -- { 0x2153, 0x0000}, -- { 0x40f3, 0x0000} -+ 30666000, { -+ { 0x00b3, 0x0000 }, -+ { 0x2153, 0x0000 }, -+ { 0x40f3, 0x0000 }, - }, -- }, { -- 36000000, { -- { 0x00b3, 0x0000}, -- { 0x2153, 0x0000}, -- { 0x40f3, 0x0000} -- }, -- }, { -- 40000000, { -- { 0x00b3, 0x0000}, -- { 0x2153, 0x0000}, -- { 0x40f3, 0x0000} -+ }, { -+ 36800000, { -+ { 0x00b3, 0x0000 }, -+ { 0x2153, 0x0000 }, -+ { 0x40a2, 0x0001 }, - }, -- }, { -- 54000000, { -- { 0x0072, 0x0001}, -- { 0x2142, 0x0001}, -- { 0x40a2, 0x0001}, -+ }, { -+ 46000000, { -+ { 0x00b3, 0x0000 }, -+ { 0x2142, 0x0001 }, -+ { 0x40a2, 0x0001 }, - }, -- }, { -- 65000000, { -- { 0x0072, 0x0001}, -- { 0x2142, 0x0001}, -- { 0x40a2, 0x0001}, -+ }, { -+ 61333000, { -+ { 0x0072, 0x0001 }, -+ { 0x2142, 0x0001 }, -+ { 0x40a2, 0x0001 }, - }, -- }, { -- 66000000, { -- { 0x013e, 0x0003}, -- { 0x217e, 0x0002}, -- { 0x4061, 0x0002} -+ }, { -+ 73600000, { -+ { 0x0072, 0x0001 }, -+ { 0x2142, 0x0001 }, -+ { 0x4061, 0x0002 }, - }, -- }, { -- 74250000, { -- { 0x0072, 0x0001}, -- { 0x2145, 0x0002}, -- { 0x4061, 0x0002} -+ }, { -+ 92000000, { -+ { 0x0072, 0x0001 }, -+ { 0x2145, 0x0002 }, -+ { 0x4061, 0x0002 }, - }, -- }, { -- 83500000, { -- { 0x0072, 0x0001}, -+ }, { -+ 122666000, { -+ { 0x0051, 0x0002 }, -+ { 0x2145, 0x0002 }, -+ { 0x4061, 0x0002 }, - }, -- }, { -- 108000000, { -- { 0x0051, 0x0002}, -- { 0x2145, 0x0002}, -- { 0x4061, 0x0002} -+ }, { -+ 147200000, { -+ { 0x0051, 0x0002 }, -+ { 0x2145, 0x0002 }, -+ { 0x4064, 0x0003 }, - }, -- }, { -- 106500000, { -- { 0x0051, 0x0002}, -- { 0x2145, 0x0002}, -- { 0x4061, 0x0002} -+ }, { -+ 184000000, { -+ { 0x0051, 0x0002 }, -+ { 0x214c, 0x0003 }, -+ { 0x4064, 0x0003 }, - }, -- }, { -- 146250000, { -- { 0x0051, 0x0002}, -- { 0x2145, 0x0002}, -- { 0x4061, 0x0002} -+ }, { -+ 226666000, { -+ { 0x0040, 0x0003 }, -+ { 0x214c, 0x0003 }, -+ { 0x4064, 0x0003 }, - }, -- }, { -- 148500000, { -- { 0x0051, 0x0003}, -- { 0x214c, 0x0003}, -- { 0x4064, 0x0003} -+ }, { -+ 272000000, { -+ { 0x0040, 0x0003 }, -+ { 0x214c, 0x0003 }, -+ { 0x5a64, 0x0003 }, - }, -- }, { -+ }, { - 340000000, { - { 0x0040, 0x0003 }, - { 0x3b4c, 0x0003 }, - { 0x5a64, 0x0003 }, - }, -- }, { -+ }, { -+ 600000000, { -+ { 0x1a40, 0x0003 }, -+ { 0x3b4c, 0x0003 }, -+ { 0x5a64, 0x0003 }, -+ }, -+ }, { - ~0UL, { -- { 0x00a0, 0x000a }, -- { 0x2001, 0x000f }, -- { 0x4002, 0x000f }, -+ { 0x0000, 0x0000 }, -+ { 0x0000, 0x0000 }, -+ { 0x0000, 0x0000 }, - }, - } + 30666000, { +@@ -179,7 +201,7 @@ static const struct dw_hdmi_mpll_config rockchip_mpll_cfg[] = { }; static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = { - /* pixelclk bpp8 bpp10 bpp12 */ + /* pixelclk bpp8 bpp10 bpp12 */ { -- 40000000, { 0x0018, 0x0018, 0x0018 }, -- }, { -- 65000000, { 0x0028, 0x0028, 0x0028 }, -+ 600000000, { 0x0000, 0x0000, 0x0000 }, + 600000000, { 0x0000, 0x0000, 0x0000 }, }, { -- 66000000, { 0x0038, 0x0038, 0x0038 }, -- }, { -- 74250000, { 0x0028, 0x0038, 0x0038 }, -- }, { -- 83500000, { 0x0028, 0x0038, 0x0038 }, -- }, { -- 146250000, { 0x0038, 0x0038, 0x0038 }, -- }, { -- 148500000, { 0x0000, 0x0038, 0x0038 }, -- }, { -- 600000000, { 0x0000, 0x0000, 0x0000 }, -- }, { -- ~0UL, { 0x0000, 0x0000, 0x0000}, -+ ~0UL, { 0x0000, 0x0000, 0x0000}, - } +@@ -188,18 +210,18 @@ static const struct dw_hdmi_curr_ctrl rockchip_cur_ctr[] = { }; static const struct dw_hdmi_phy_config rockchip_phy_config[] = { - /*pixelclk symbol term vlev*/ - { 74250000, 0x8009, 0x0004, 0x0272}, -- { 148500000, 0x802b, 0x0004, 0x028d}, +- { 165000000, 0x802b, 0x0004, 0x0209}, - { 297000000, 0x8039, 0x0005, 0x028d}, +- { 594000000, 0x8039, 0x0000, 0x019d}, - { ~0UL, 0x0000, 0x0000, 0x0000} + /*pixelclk symbol term vlev*/ + { CLK_PLUS_SLOP(74250000), 0x8009, 0x0004, 0x0272}, @@ -430,14 +273,19 @@ index fe33092abbe7..42576b4807cf 100644 static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) { struct device_node *np = hdmi->dev->of_node; + int ret; + int rates_cnt; hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); if (IS_ERR(hdmi->regmap)) { -@@ -245,39 +256,51 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) - if (IS_ERR(hdmi->avdd_1v8)) - return PTR_ERR(hdmi->avdd_1v8); +@@ -231,34 +253,58 @@ static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) + return ret; + + ret = devm_regulator_get_enable(hdmi->dev, "avdd-1v8"); ++ if (ret) ++ return ret; +- return ret; + if ((rates_cnt = of_property_count_u32_elems(np, "rockchip,hdmi-rates-hz")) > 0) { + int rv; + u32 *rates = devm_kmalloc_array(hdmi->dev, rates_cnt, sizeof(u32), GFP_KERNEL); @@ -457,8 +305,7 @@ index fe33092abbe7..42576b4807cf 100644 + hdmi->rates_cnt = rates_cnt; + } + -+ - return 0; ++ return 0; } static enum drm_mode_status @@ -468,15 +315,21 @@ index fe33092abbe7..42576b4807cf 100644 const struct drm_display_mode *mode) { - struct rockchip_hdmi *hdmi = data; -- const struct dw_hdmi_mpll_config *mpll_cfg = rockchip_mpll_cfg; + struct rockchip_hdmi *hdmi = to_rockchip_hdmi(encoder); int pclk = mode->clock * 1000; -- bool exact_match = hdmi->plat_data->phy_force_vendor; + int num_rates = hdmi->rates_cnt; - int i; ++ int i; + + if (hdmi->chip_data->max_tmds_clock && + mode->clock > hdmi->chip_data->max_tmds_clock) + return MODE_CLOCK_HIGH; - if (hdmi->ref_clk) { - int rpclk = clk_round_rate(hdmi->ref_clk, pclk); +- +- if (rpclk < 0 || abs(rpclk - pclk) > pclk / 1000) +- return MODE_NOCLOCK; +- } + /* + * Pixel clocks we support are always < 2GHz and so fit in an + * int. We should make sure source rate does too so we don't get @@ -485,30 +338,20 @@ index fe33092abbe7..42576b4807cf 100644 + if (mode->clock > INT_MAX / 1000) + return MODE_BAD; -- if (abs(rpclk - pclk) > pclk / 1000) -- return MODE_NOCLOCK; -- } +- if (hdmi->hdmiphy_clk) { +- int rpclk = clk_round_rate(hdmi->hdmiphy_clk, pclk); + for (i = 0; i < num_rates; i++) { + int slop = CLK_SLOP(pclk); -- 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) +- if (rpclk < 0 || abs(rpclk - pclk) > pclk / 1000) +- return MODE_NOCLOCK; + if ((pclk >= hdmi->rates[i] - slop) && + (pclk <= hdmi->rates[i] + slop)) - return MODE_OK; ++ return MODE_OK; } -@@ -293,7 +316,39 @@ dw_hdmi_rockchip_encoder_mode_fixup(struct drm_encoder *encoder, + return MODE_OK; +@@ -273,7 +319,39 @@ dw_hdmi_rockchip_encoder_mode_fixup(struct drm_encoder *encoder, const struct drm_display_mode *mode, struct drm_display_mode *adj_mode) { @@ -549,7 +392,7 @@ index fe33092abbe7..42576b4807cf 100644 } static void dw_hdmi_rockchip_encoder_mode_set(struct drm_encoder *encoder, -@@ -349,6 +404,7 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder, +@@ -328,6 +406,7 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder *encoder, } static const struct drm_encoder_helper_funcs dw_hdmi_rockchip_encoder_helper_funcs = { @@ -557,15 +400,18 @@ index fe33092abbe7..42576b4807cf 100644 .mode_fixup = dw_hdmi_rockchip_encoder_mode_fixup, .mode_set = dw_hdmi_rockchip_encoder_mode_set, .enable = dw_hdmi_rockchip_encoder_enable, -@@ -449,7 +505,6 @@ static struct rockchip_hdmi_chip_data rk3228_chip_data = { +@@ -433,7 +512,9 @@ static struct rockchip_hdmi_chip_data rk3228_chip_data = { }; static const struct dw_hdmi_plat_data rk3228_hdmi_drv_data = { - .mode_valid = dw_hdmi_rockchip_mode_valid, - .mpll_cfg = rockchip_mpll_cfg, - .cur_ctr = rockchip_cur_ctr, - .phy_config = rockchip_phy_config, -@@ -466,7 +521,6 @@ static struct rockchip_hdmi_chip_data rk3288_chip_data = { ++ .mpll_cfg = rockchip_mpll_cfg, ++ .cur_ctr = rockchip_cur_ctr, ++ .phy_config = rockchip_phy_config, + .phy_data = &rk3228_chip_data, + .phy_ops = &rk3228_hdmi_phy_ops, + .phy_name = "inno_dw_hdmi_phy2", +@@ -448,7 +529,6 @@ static struct rockchip_hdmi_chip_data rk3288_chip_data = { }; static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = { @@ -573,15 +419,18 @@ index fe33092abbe7..42576b4807cf 100644 .mpll_cfg = rockchip_mpll_cfg, .cur_ctr = rockchip_cur_ctr, .phy_config = rockchip_phy_config, -@@ -486,7 +540,6 @@ static struct rockchip_hdmi_chip_data rk3328_chip_data = { +@@ -469,7 +549,9 @@ static struct rockchip_hdmi_chip_data rk3328_chip_data = { }; static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = { - .mode_valid = dw_hdmi_rockchip_mode_valid, - .mpll_cfg = rockchip_mpll_cfg, - .cur_ctr = rockchip_cur_ctr, - .phy_config = rockchip_phy_config, -@@ -504,7 +557,6 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = { ++ .mpll_cfg = rockchip_mpll_cfg, ++ .cur_ctr = rockchip_cur_ctr, ++ .phy_config = rockchip_phy_config, + .phy_data = &rk3328_chip_data, + .phy_ops = &rk3328_hdmi_phy_ops, + .phy_name = "inno_dw_hdmi_phy2", +@@ -485,7 +567,6 @@ static struct rockchip_hdmi_chip_data rk3399_chip_data = { }; static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { @@ -589,7 +438,7 @@ index fe33092abbe7..42576b4807cf 100644 .mpll_cfg = rockchip_mpll_cfg, .cur_ctr = rockchip_cur_ctr, .phy_config = rockchip_phy_config, -@@ -517,7 +569,6 @@ static struct rockchip_hdmi_chip_data rk3568_chip_data = { +@@ -499,7 +580,6 @@ static struct rockchip_hdmi_chip_data rk3568_chip_data = { }; static const struct dw_hdmi_plat_data rk3568_hdmi_drv_data = { @@ -597,27 +446,27 @@ index fe33092abbe7..42576b4807cf 100644 .mpll_cfg = rockchip_mpll_cfg, .cur_ctr = rockchip_cur_ctr, .phy_config = rockchip_phy_config, -@@ -650,6 +701,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, +@@ -622,6 +702,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, return 0; err_bind: + devm_kfree(hdmi->dev, hdmi->rates); drm_encoder_cleanup(encoder); - clk_disable_unprepare(hdmi->ref_clk); - err_clk: -@@ -665,6 +717,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, + + return ret; +@@ -632,6 +713,7 @@ static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master, { struct rockchip_hdmi *hdmi = dev_get_drvdata(dev); + devm_kfree(hdmi->dev, hdmi->rates); dw_hdmi_unbind(hdmi->hdmi); drm_encoder_cleanup(&hdmi->encoder.encoder); - clk_disable_unprepare(hdmi->ref_clk); + } -- 2.44.0 -From e4e0ebcb6fc680ca8cef8cbb22fe8b5ff4f8d7bb Mon Sep 17 00:00:00 2001 +From f4e3154dde59023e7513a343ea8acc38ea55f223 Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Mon, 27 Aug 2018 19:00:50 +0000 Subject: [PATCH 03/33] dts: rk3288: support for dedicating npll to a vop @@ -656,7 +505,7 @@ index 3f1d640afafa..2992c323d555 100644 2.44.0 -From 49029855f01e3e2e0a49bfb87823ed7a1e1d0386 Mon Sep 17 00:00:00 2001 +From b8999e4d9e9a952aeb565782dc3f5aa207177ad4 Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Mon, 27 Aug 2018 19:03:49 +0000 Subject: [PATCH 04/33] dts: rk3288-veyron-chromebook: dedicate npll to @@ -673,7 +522,7 @@ Signed-off-by: Urja Rannikko <urjaman@gmail.com> 1 file changed, 62 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi b/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi -index 092316be67f7..e4d5c0240657 100644 +index 3677571b4d82..b61a4b0d7015 100644 --- a/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi @@ -83,6 +83,68 @@ @@ -749,7 +598,7 @@ index 092316be67f7..e4d5c0240657 100644 2.44.0 -From cae09e9064b8556660bcf9231ee7222bf939958c Mon Sep 17 00:00:00 2001 +From 4022023ef9a08df4b0f6983827acdfab71ab5f37 Mon Sep 17 00:00:00 2001 From: SolidHal <hal@halemmerich.com> Date: Sun, 21 Oct 2018 16:40:15 -0500 Subject: [PATCH 05/33] Added a second reset when having an issue reading the @@ -772,10 +621,10 @@ Signed-off-by: Urja Rannikko <urjaman@gmail.com> 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index 367509b5b646..479b2248e014 100644 +index 4830628510e6..7658effcb6ef 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c -@@ -1028,6 +1028,7 @@ static unsigned int mmc_blk_data_timeout_ms(struct mmc_host *host, +@@ -1090,6 +1090,7 @@ static unsigned int mmc_blk_data_timeout_ms(struct mmc_host *host, static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host, int type) { @@ -783,7 +632,7 @@ index 367509b5b646..479b2248e014 100644 int err; struct mmc_blk_data *main_md = dev_get_drvdata(&host->card->dev); -@@ -1035,7 +1036,14 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host, +@@ -1097,7 +1098,14 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host, return -EEXIST; md->reset_done |= type; @@ -802,7 +651,7 @@ index 367509b5b646..479b2248e014 100644 2.44.0 -From a7a856e356b827ef1cd15e20e7ed5672975fcea0 Mon Sep 17 00:00:00 2001 +From 053623a802710a69b2f64459551f74c131ed0148 Mon Sep 17 00:00:00 2001 From: "Miouyouyou (Myy)" <myy@miouyouyou.fr> Date: Tue, 9 Oct 2018 22:01:07 +0200 Subject: [PATCH 06/33] block: partitions: efi: Ignore bizarre Chromebook GPT @@ -955,7 +804,7 @@ index 84b9f36b9e47..09726227e891 100644 2.44.0 -From 4745f19a4c0545367fdc3d543b8315b1e1fca8d2 Mon Sep 17 00:00:00 2001 +From 50ef165c46d051021cb7b1630ea4d9b38e911a31 Mon Sep 17 00:00:00 2001 From: "Miouyouyou (Myy)" <myy@miouyouyou.fr> Date: Tue, 30 Oct 2018 22:44:54 +0100 Subject: [PATCH 07/33] mmc: Added a flag to disable cache flush during reset @@ -991,10 +840,10 @@ index 48bda70145ee..a2b84e1aa03b 100644 /* Must be after "non-removable" check */ if (device_property_read_u32(dev, "fixed-emmc-driver-type", &drv_type) == 0) { diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c -index 5b2f7c285461..ca82772f3bf4 100644 +index 6a23be214543..d4701521f6b2 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c -@@ -2252,6 +2252,12 @@ static int mmc_runtime_resume(struct mmc_host *host) +@@ -2238,6 +2238,12 @@ static int mmc_runtime_resume(struct mmc_host *host) return 0; } @@ -1007,7 +856,7 @@ index 5b2f7c285461..ca82772f3bf4 100644 static int mmc_can_reset(struct mmc_card *card) { u8 rst_n_function; -@@ -2266,11 +2272,15 @@ static int _mmc_hw_reset(struct mmc_host *host) +@@ -2252,11 +2258,15 @@ static int _mmc_hw_reset(struct mmc_host *host) { struct mmc_card *card = host->card; @@ -1028,22 +877,22 @@ index 5b2f7c285461..ca82772f3bf4 100644 if ((host->caps & MMC_CAP_HW_RESET) && host->ops->card_hw_reset && mmc_can_reset(card)) { diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h -index 88c6a76042ee..b25f9d57a439 100644 +index f166d6611ddb..d3fbd8369564 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h -@@ -427,6 +427,7 @@ struct mmc_host { +@@ -459,6 +459,7 @@ struct mmc_host { #define MMC_CAP2_CRYPTO 0 #endif #define MMC_CAP2_ALT_GPT_TEGRA (1 << 28) /* Host with eMMC that has GPT entry at a non-standard location */ +#define MMC_CAP2_NO_RECOVERY_CACHE_FLUSH (1 << 29) /* Do not flush the device cache when recovering */ - int fixed_drv_type; /* fixed driver type for non-removable media */ - + bool uhs2_sd_tran; /* UHS-II flag for SD_TRAN state */ + bool uhs2_app_cmd; /* UHS-II flag for APP command */ -- 2.44.0 -From bce26f5fb1b377c4fe83e18200dd75dc55ed9abe Mon Sep 17 00:00:00 2001 +From d1d26ead77961a1886437d47e489f73656fb8811 Mon Sep 17 00:00:00 2001 From: "Miouyouyou (Myy)" <myy@miouyouyou.fr> Date: Thu, 1 Nov 2018 21:31:26 +0100 Subject: [PATCH 08/33] arm: dts: veyron: Added a flag to disable cache flush @@ -1061,7 +910,7 @@ Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr> 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron.dtsi b/arch/arm/boot/dts/rockchip/rk3288-veyron.dtsi -index d838bf0d5d9a..7aeb70e9b828 100644 +index 260d6c92cfd1..08ce8bfb70b2 100644 --- a/arch/arm/boot/dts/rockchip/rk3288-veyron.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3288-veyron.dtsi @@ -157,6 +157,7 @@ @@ -1076,7 +925,7 @@ index d838bf0d5d9a..7aeb70e9b828 100644 2.44.0 -From 76cd3be968d648aaf27ac48d538fcce00c0bdbe2 Mon Sep 17 00:00:00 2001 +From 983494470e77f54a8da15203622aac0c309495ba Mon Sep 17 00:00:00 2001 From: Hal Emmerich <hal@halemmerich.com> Date: Wed, 21 Aug 2019 16:52:41 -0500 Subject: [PATCH 09/33] Fix ath9k dwc2 init frame overruns @@ -1119,7 +968,7 @@ index 238c6fd50e75..ea4ce893d5b9 100644 2.44.0 -From 86c89364a156f7e5aeb9ffe6720a98f38246f0d4 Mon Sep 17 00:00:00 2001 +From e43e7809017cd5d77c5e3edf08710aeb04ad8e45 Mon Sep 17 00:00:00 2001 From: barzur <boris@konbu.org> Date: Fri, 12 Jul 2019 11:33:32 +0900 Subject: [PATCH 10/33] usb/dwc2/hcd: channel halt may not be an error @@ -1159,7 +1008,7 @@ meantime I'm including it here. 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c -index cb54390e7de4..841478f88dd4 100644 +index 8c3941ecaaf5..c51ebcdbabbc 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -2457,7 +2457,8 @@ static void dwc2_free_dma_aligned_buffer(struct urb *urb) @@ -1190,7 +1039,7 @@ index 5c7538d498dd..96dc5d8115d2 100644 2.44.0 -From 60a5fbb088bb911a0ab651b6367234fbf25ac6c1 Mon Sep 17 00:00:00 2001 +From 3779fd36d1cff963cbc2265fc63dd1dcc20a5898 Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Tue, 8 Oct 2019 11:03:37 +0000 Subject: [PATCH 11/33] drm/panel: edp: Extend Innolux N116BGE mode info for @@ -1202,10 +1051,10 @@ Signed-off-by: Urja Rannikko <urjaman@gmail.com> 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c -index 6db277efcbb7..02a981b83ad5 100644 +index 94a46241dece..37da2a6a5c0e 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c -@@ -1355,16 +1355,25 @@ static const struct panel_desc innolux_n116bca_ea1 = { +@@ -1295,16 +1295,25 @@ static const struct panel_desc innolux_n116bca_ea1 = { * porch, back porch, or sync length. For now we'll leave a single setting * here which allows a bit of tweaking of the pixel clock at the expense of * refresh rate. @@ -1237,7 +1086,7 @@ index 6db277efcbb7..02a981b83ad5 100644 2.44.0 -From a7bfa8b75c6b2846a04810370f536d02242a5e43 Mon Sep 17 00:00:00 2001 +From 9105cbd43054c562fa344a05568bce7e03ba63cb Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Tue, 8 Oct 2019 11:12:33 +0000 Subject: [PATCH 12/33] ARM: dts: rockchip: Adjust rk3288-veyron n116bge mode @@ -1253,7 +1102,7 @@ Signed-off-by: Urja Rannikko <urjaman@gmail.com> 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron-edp.dtsi b/arch/arm/boot/dts/rockchip/rk3288-veyron-edp.dtsi -index 32c0f10765dd..ea20818202fc 100644 +index fb031964fa2b..128176b7c372 100644 --- a/arch/arm/boot/dts/rockchip/rk3288-veyron-edp.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3288-veyron-edp.dtsi @@ -62,13 +62,13 @@ @@ -1276,7 +1125,7 @@ index 32c0f10765dd..ea20818202fc 100644 2.44.0 -From 9e48813afa66d55543444a7ef029ca128652614f Mon Sep 17 00:00:00 2001 +From e080f99345a4526d320498ec012cbd62b4a0cf9f Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Mon, 25 Dec 2023 18:06:10 +0200 Subject: [PATCH 13/33] dts: veyron: bluetooth: disable dma on uart0 @@ -1304,7 +1153,7 @@ index 2992c323d555..949bc1829c8f 100644 2.44.0 -From 5114d7c4bf84e1a58c0240a7302b9804441f6986 Mon Sep 17 00:00:00 2001 +From 7c002ac2887a258e8f339837870372c2ff6373ee Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:00 +0000 Subject: [PATCH 14/33] media: v4l2-common: Add helpers to calculate @@ -1320,10 +1169,10 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c -index 4165c815faef..9f749384a4f5 100644 +index 0a2f4f0d0a07..8ad04d48a023 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c -@@ -355,6 +355,34 @@ static inline unsigned int v4l2_format_block_height(const struct v4l2_format_inf +@@ -357,6 +357,34 @@ static inline unsigned int v4l2_format_block_height(const struct v4l2_format_inf return info->block_h[plane]; } @@ -1358,7 +1207,7 @@ index 4165c815faef..9f749384a4f5 100644 void v4l2_apply_frmsize_constraints(u32 *width, u32 *height, const struct v4l2_frmsize_stepwise *frmsize) { -@@ -390,37 +418,19 @@ int v4l2_fill_pixfmt_mp(struct v4l2_pix_format_mplane *pixfmt, +@@ -392,37 +420,19 @@ int v4l2_fill_pixfmt_mp(struct v4l2_pix_format_mplane *pixfmt, if (info->mem_planes == 1) { plane = &pixfmt->plane_fmt[0]; @@ -1403,7 +1252,7 @@ index 4165c815faef..9f749384a4f5 100644 } } return 0; -@@ -444,22 +454,12 @@ int v4l2_fill_pixfmt(struct v4l2_pix_format *pixfmt, u32 pixelformat, +@@ -446,22 +456,12 @@ int v4l2_fill_pixfmt(struct v4l2_pix_format *pixfmt, u32 pixelformat, pixfmt->width = width; pixfmt->height = height; pixfmt->pixelformat = pixelformat; @@ -1434,7 +1283,7 @@ index 4165c815faef..9f749384a4f5 100644 2.44.0 -From ceac85673a70cb76ffc525263d3a872964120179 Mon Sep 17 00:00:00 2001 +From 3415545386fe2aed64adb1ad837fdafe08c90526 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:01 +0000 Subject: [PATCH 15/33] media: v4l2: Add NV15 and NV20 pixel formats @@ -1462,7 +1311,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 4 files changed, 134 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst -index 1840224faa41..4366cdcb970e 100644 +index b788f6933855..22cad8c9726b 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst @@ -79,6 +79,13 @@ All components are stored with the same number of bits per component. @@ -1479,7 +1328,7 @@ index 1840224faa41..4366cdcb970e 100644 * - V4L2_PIX_FMT_NV12M - 'NM12' - 8 -@@ -158,6 +165,13 @@ All components are stored with the same number of bits per component. +@@ -172,6 +179,13 @@ All components are stored with the same number of bits per component. - Cr, Cb - Yes - Linear @@ -1493,7 +1342,7 @@ index 1840224faa41..4366cdcb970e 100644 * - V4L2_PIX_FMT_NV16M - 'NM16' - 8 -@@ -288,6 +302,57 @@ of the luma plane. +@@ -302,6 +316,57 @@ of the luma plane. - Cr\ :sub:`11` @@ -1551,7 +1400,7 @@ index 1840224faa41..4366cdcb970e 100644 .. _V4L2-PIX-FMT-NV12MT: .. _V4L2-PIX-FMT-NV12MT-16X16: .. _V4L2-PIX-FMT-NV12-4L4: -@@ -500,6 +565,69 @@ number of lines as the luma plane. +@@ -631,6 +696,69 @@ number of lines as the luma plane. - Cr\ :sub:`32` @@ -1622,10 +1471,10 @@ index 1840224faa41..4366cdcb970e 100644 .. _V4L2-PIX-FMT-NV42: diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c -index 9f749384a4f5..f03c9e89ef1f 100644 +index 8ad04d48a023..53b6fdfcb4dd 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c -@@ -275,8 +275,10 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) +@@ -277,8 +277,10 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) /* YUV planar formats */ { .format = V4L2_PIX_FMT_NV12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 }, { .format = V4L2_PIX_FMT_NV21, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 }, @@ -1637,10 +1486,10 @@ index 9f749384a4f5..f03c9e89ef1f 100644 { .format = V4L2_PIX_FMT_NV42, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 }, { .format = V4L2_PIX_FMT_P010, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 1 }, diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c -index 4c76d17b4629..1ffe39e2ba93 100644 +index 0304daa8471d..864cd2939222 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c -@@ -1358,8 +1358,10 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) +@@ -1361,8 +1361,10 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_YUV48_12: descr = "12-bit YUV 4:4:4 Packed"; break; case V4L2_PIX_FMT_NV12: descr = "Y/UV 4:2:0"; break; case V4L2_PIX_FMT_NV21: descr = "Y/VU 4:2:0"; break; @@ -1652,10 +1501,10 @@ index 4c76d17b4629..1ffe39e2ba93 100644 case V4L2_PIX_FMT_NV42: descr = "Y/VU 4:4:4"; break; case V4L2_PIX_FMT_P010: descr = "10-bit Y/UV 4:2:0"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h -index fe6b67e83751..1c99b1dc73b0 100644 +index e7c4dce39007..700e7033b88e 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h -@@ -640,8 +640,10 @@ struct v4l2_pix_format { +@@ -643,8 +643,10 @@ struct v4l2_pix_format { /* two planes -- one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ @@ -1670,7 +1519,7 @@ index fe6b67e83751..1c99b1dc73b0 100644 2.44.0 -From 4943161fd0b65237166084c7502d5474bc4147a7 Mon Sep 17 00:00:00 2001 +From 30745f12d31b2ef4347eaf46df01e34d46d6ef41 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:02 +0000 Subject: [PATCH 16/33] media: rkvdec: h264: Use bytesperline and buffer height @@ -1729,7 +1578,7 @@ index 4fc167b42cf0..7a1e76d423df 100644 2.44.0 -From b3f0aa86d80d93683b4b614565d0c27dba13bc00 Mon Sep 17 00:00:00 2001 +From f5ba96f59b075d936f53fed399c78dcf55e58a1c Mon Sep 17 00:00:00 2001 From: Alex Bee <knaerzche@gmail.com> Date: Sun, 5 Nov 2023 16:55:03 +0000 Subject: [PATCH 17/33] media: rkvdec: h264: Don't hardcode SPS/PPS parameters @@ -1784,7 +1633,7 @@ index 7a1e76d423df..8bce8902b8dd 100644 2.44.0 -From 46140e4704529367ec77607200bcb45b0d02ca06 Mon Sep 17 00:00:00 2001 +From 0ef457a270fad37a85264319bc42e67203fd4ee9 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:04 +0000 Subject: [PATCH 18/33] media: rkvdec: h264: Remove SPS validation at streaming @@ -1849,7 +1698,7 @@ index 8bce8902b8dd..815d5359ddd5 100644 2.44.0 -From f3522bb442f0fcc3daa083afc5ad869f3cd0c0e1 Mon Sep 17 00:00:00 2001 +From 67d3ca2c833f9f500a00d27f0f331bea8fd52117 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:05 +0000 Subject: [PATCH 19/33] media: rkvdec: Extract rkvdec_fill_decoded_pixfmt into @@ -1864,7 +1713,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index ac398b5a9736..d1087519d218 100644 +index f9bef5173bf2..e354360f4acc 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -27,6 +27,16 @@ @@ -1919,7 +1768,7 @@ index ac398b5a9736..d1087519d218 100644 2.44.0 -From b059f72de9fba75e13fca26acfe4cb5095e34f62 Mon Sep 17 00:00:00 2001 +From e6f805dc683ae9dcbbbdc96d0d96d654888bb149 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:06 +0000 Subject: [PATCH 20/33] media: rkvdec: Move rkvdec_reset_decoded_fmt helper @@ -1933,7 +1782,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index d1087519d218..7e59db3fc24d 100644 +index e354360f4acc..1f8f98cf91dc 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -37,6 +37,29 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx, @@ -2007,7 +1856,7 @@ index d1087519d218..7e59db3fc24d 100644 2.44.0 -From ac1ee64cabe069ffec757e54546ce58e540d588e Mon Sep 17 00:00:00 2001 +From 1996142669a96302cf1509a8163fe316310fa108 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:07 +0000 Subject: [PATCH 21/33] media: rkvdec: Extract decoded format enumeration into @@ -2026,7 +1875,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 7e59db3fc24d..efbf9aa578ae 100644 +index 1f8f98cf91dc..52e64b399dcc 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -27,6 +27,32 @@ @@ -2121,7 +1970,7 @@ index 7e59db3fc24d..efbf9aa578ae 100644 2.44.0 -From 64e182b3e8f2ce7468ec76ff3f653123fa46e205 Mon Sep 17 00:00:00 2001 +From b03b60b5e309491447745524d168ffa18cb3173b Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:08 +0000 Subject: [PATCH 22/33] media: rkvdec: Add image format concept @@ -2139,7 +1988,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index efbf9aa578ae..d8fb2d935ffc 100644 +index 52e64b399dcc..24b04cc35d83 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -27,26 +27,42 @@ @@ -2284,7 +2133,7 @@ index 633335ebb9c4..6f8cf50c5d99 100644 2.44.0 -From c2a80a7e8376bac9afeb10e4bce735715b8cc96a Mon Sep 17 00:00:00 2001 +From ec9abcb539b4f67fc76b1c0d271069bdd0f0d898 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:09 +0000 Subject: [PATCH 23/33] media: rkvdec: Add get_image_fmt ops @@ -2302,7 +2151,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index d8fb2d935ffc..455b9cd34b6a 100644 +index 24b04cc35d83..d9f72c0b44cf 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -108,15 +108,60 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl) @@ -2385,7 +2234,7 @@ index 6f8cf50c5d99..e466a2753ccf 100644 2.44.0 -From 7c9a2d5ae0701c52038398ecfd48ab7f08bfb621 Mon Sep 17 00:00:00 2001 +From ea27782ec3180b0334e19dee83961e1e273c9a13 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 16:55:10 +0000 Subject: [PATCH 24/33] media: rkvdec: h264: Support High 10 and 4:2:2 profiles @@ -2477,7 +2326,7 @@ index 815d5359ddd5..baac6d012ddd 100644 + .get_image_fmt = rkvdec_h264_get_image_fmt, }; diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 455b9cd34b6a..7d909d4a5d00 100644 +index d9f72c0b44cf..20c4eb62bec7 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -73,7 +73,7 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx, @@ -2577,7 +2426,7 @@ index e466a2753ccf..9a9f4fced7a1 100644 2.44.0 -From 918cb7ceb0db4606aa508061494054252f26c61c Mon Sep 17 00:00:00 2001 +From 4ddda1ee6011bbe3c580a36f02a0e322b4b6d692 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 23:36:08 +0000 Subject: [PATCH 25/33] media: rkvdec: Add HEVC backend @@ -5314,7 +5163,7 @@ index 15b9bee92016..83bf790ed9b7 100644 #define RKVDEC_MODE_VP9 2 #define RKVDEC_RPS_MODE BIT(24) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 7d909d4a5d00..ca82ccda1825 100644 +index 20c4eb62bec7..119a4d14dd1d 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -164,6 +164,67 @@ static const struct v4l2_ctrl_ops rkvdec_ctrl_ops = { @@ -5423,7 +5272,7 @@ index 9a9f4fced7a1..2f3bda1df5f0 100644 2.44.0 -From 29cfde56ed059dcf3f060dc7c00733cf8e69cda1 Mon Sep 17 00:00:00 2001 +From c13e495dd12a65ce3a6b7be0242a6c6b44b8abe8 Mon Sep 17 00:00:00 2001 From: Alex Bee <knaerzche@gmail.com> Date: Sun, 5 Nov 2023 23:36:09 +0000 Subject: [PATCH 26/33] media: rkvdec: Add variants support @@ -5442,7 +5291,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index ca82ccda1825..768683747e8a 100644 +index 119a4d14dd1d..6dda80c6bb51 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -13,6 +13,7 @@ @@ -5477,7 +5326,7 @@ index ca82ccda1825..768683747e8a 100644 } }; -@@ -1170,8 +1174,17 @@ static void rkvdec_watchdog_func(struct work_struct *work) +@@ -1168,8 +1172,17 @@ static void rkvdec_watchdog_func(struct work_struct *work) } } @@ -5496,7 +5345,7 @@ index ca82ccda1825..768683747e8a 100644 { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, of_rkvdec_match); -@@ -1182,16 +1195,22 @@ static const char * const rkvdec_clk_names[] = { +@@ -1180,16 +1193,22 @@ static const char * const rkvdec_clk_names[] = { static int rkvdec_probe(struct platform_device *pdev) { @@ -5565,7 +5414,7 @@ index 2f3bda1df5f0..14ce26a6c618 100644 2.44.0 -From faa98c110fdfa75e8c0a66c0ec202d9c192668b5 Mon Sep 17 00:00:00 2001 +From 55fdd3d68df954c5fa0fdebb11d286a81e075cf4 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 23:36:10 +0000 Subject: [PATCH 27/33] media: rkvdec: Implement capability filtering @@ -5580,7 +5429,7 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 768683747e8a..6725c5f06d10 100644 +index 6dda80c6bb51..3b7484589c7a 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -370,13 +370,34 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = { @@ -5692,7 +5541,7 @@ index 768683747e8a..6725c5f06d10 100644 return 0; } -@@ -971,14 +997,17 @@ static int rkvdec_init_ctrls(struct rkvdec_ctx *ctx) +@@ -969,14 +995,17 @@ static int rkvdec_init_ctrls(struct rkvdec_ctx *ctx) int ret; for (i = 0; i < ARRAY_SIZE(rkvdec_coded_fmts); i++) @@ -5718,7 +5567,7 @@ index 768683747e8a..6725c5f06d10 100644 2.44.0 -From 5bc044ba64f6d52188f81bf20c91d7e2a4eca61e Mon Sep 17 00:00:00 2001 +From 59d5aa34e838b32785f6c04c6a034450f9982212 Mon Sep 17 00:00:00 2001 From: Alex Bee <knaerzche@gmail.com> Date: Sun, 5 Nov 2023 23:36:11 +0000 Subject: [PATCH 28/33] media: rkvdec: Add RK3288 variant @@ -5733,10 +5582,10 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se> 1 file changed, 8 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 6725c5f06d10..ba5812707e03 100644 +index 3b7484589c7a..7a667e6ecf33 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c -@@ -1203,6 +1203,10 @@ static void rkvdec_watchdog_func(struct work_struct *work) +@@ -1201,6 +1201,10 @@ static void rkvdec_watchdog_func(struct work_struct *work) } } @@ -5747,7 +5596,7 @@ index 6725c5f06d10..ba5812707e03 100644 static const struct rkvdec_variant rk3399_rkvdec_variant = { .capabilities = RKVDEC_CAPABILITY_HEVC | RKVDEC_CAPABILITY_H264 | -@@ -1210,6 +1214,10 @@ static const struct rkvdec_variant rk3399_rkvdec_variant = { +@@ -1208,6 +1212,10 @@ static const struct rkvdec_variant rk3399_rkvdec_variant = { }; static const struct of_device_id of_rkvdec_match[] = { @@ -5762,7 +5611,7 @@ index 6725c5f06d10..ba5812707e03 100644 2.44.0 -From c2146c64c18998c975514a2ddc3c7c2b414fbbd5 Mon Sep 17 00:00:00 2001 +From 673e3502b0c3f0dddbd1133b830b9280f579bb98 Mon Sep 17 00:00:00 2001 From: Alex Bee <knaerzche@gmail.com> Date: Sun, 5 Nov 2023 23:36:12 +0000 Subject: [PATCH 29/33] media: rkvdec: Disable QoS for HEVC and VP9 on RK3328 @@ -5838,10 +5687,10 @@ index 0e7e16f20eeb..cadb9d592308 100644 writel(RKVDEC_INTERRUPT_DEC_E | RKVDEC_CONFIG_DEC_CLK_GATE_E | RKVDEC_TIMEOUT_E | RKVDEC_BUF_EMPTY_E, diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index ba5812707e03..e76a719e021c 100644 +index 7a667e6ecf33..c12555d4821a 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c -@@ -1207,6 +1207,13 @@ static const struct rkvdec_variant rk3288_rkvdec_variant = { +@@ -1205,6 +1205,13 @@ static const struct rkvdec_variant rk3288_rkvdec_variant = { .capabilities = RKVDEC_CAPABILITY_HEVC, }; @@ -5855,7 +5704,7 @@ index ba5812707e03..e76a719e021c 100644 static const struct rkvdec_variant rk3399_rkvdec_variant = { .capabilities = RKVDEC_CAPABILITY_HEVC | RKVDEC_CAPABILITY_H264 | -@@ -1218,6 +1225,10 @@ static const struct of_device_id of_rkvdec_match[] = { +@@ -1216,6 +1223,10 @@ static const struct of_device_id of_rkvdec_match[] = { .compatible = "rockchip,rk3288-vdec", .data = &rk3288_rkvdec_variant, }, @@ -5866,7 +5715,7 @@ index ba5812707e03..e76a719e021c 100644 { .compatible = "rockchip,rk3399-vdec", .data = &rk3399_rkvdec_variant, -@@ -1248,6 +1259,7 @@ static int rkvdec_probe(struct platform_device *pdev) +@@ -1246,6 +1257,7 @@ static int rkvdec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rkvdec); rkvdec->dev = &pdev->dev; rkvdec->capabilities = variant->capabilities; @@ -5907,7 +5756,7 @@ index 14ce26a6c618..1d5d405da56c 100644 2.44.0 -From fb3983caf61eabc335dc98be62b97e123fa87b67 Mon Sep 17 00:00:00 2001 +From c256d4fbfc002f2a49863517c50bc4ac0c2deac6 Mon Sep 17 00:00:00 2001 From: Jonas Karlman <jonas@kwiboo.se> Date: Sun, 5 Nov 2023 23:36:13 +0000 Subject: [PATCH 30/33] media: dt-bindings: rockchip,vdec: Add RK3288 @@ -5940,7 +5789,7 @@ index 08b02ec16755..0f00e9c86737 100644 2.44.0 -From 3664778dedc58d5a34f2e7fd94bcee5e8a18d659 Mon Sep 17 00:00:00 2001 +From 53ee90f269c3a929b5539b2a427eb537d122a668 Mon Sep 17 00:00:00 2001 From: Alex Bee <knaerzche@gmail.com> Date: Sun, 5 Nov 2023 23:36:14 +0000 Subject: [PATCH 31/33] ARM: dts: rockchip: Add vdec node for RK3288 @@ -5993,7 +5842,7 @@ index 949bc1829c8f..dbf2d3b8f13e 100644 2.44.0 -From 7a7c48e7294f68ec0dcbb4ee894c030e45e8bd3a Mon Sep 17 00:00:00 2001 +From 790db2842a18f10751bcfb1ff15c096cf0a5f303 Mon Sep 17 00:00:00 2001 From: Urja Rannikko <urjaman@gmail.com> Date: Tue, 28 Sep 2021 20:23:13 +0300 Subject: [PATCH 32/33] Revert "clk: divider: Implement and wire up @@ -6008,10 +5857,10 @@ in my tree to be able to test the rest of 5.15 rc's. 1 file changed, 23 deletions(-) diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c -index a2c2b5203b0a..9a63a0447d6f 100644 +index c1f426b8a504..3941b4d984f7 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c -@@ -446,27 +446,6 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, +@@ -452,27 +452,6 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, divider->width, divider->flags); } @@ -6039,7 +5888,7 @@ index a2c2b5203b0a..9a63a0447d6f 100644 int divider_get_val(unsigned long rate, unsigned long parent_rate, const struct clk_div_table *table, u8 width, unsigned long flags) -@@ -522,7 +501,6 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, +@@ -528,7 +507,6 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, const struct clk_ops clk_divider_ops = { .recalc_rate = clk_divider_recalc_rate, .round_rate = clk_divider_round_rate, @@ -6047,7 +5896,7 @@ index a2c2b5203b0a..9a63a0447d6f 100644 .set_rate = clk_divider_set_rate, }; EXPORT_SYMBOL_GPL(clk_divider_ops); -@@ -530,7 +508,6 @@ EXPORT_SYMBOL_GPL(clk_divider_ops); +@@ -536,7 +514,6 @@ EXPORT_SYMBOL_GPL(clk_divider_ops); const struct clk_ops clk_divider_ro_ops = { .recalc_rate = clk_divider_recalc_rate, .round_rate = clk_divider_round_rate, @@ -6059,33 +5908,185 @@ index a2c2b5203b0a..9a63a0447d6f 100644 2.44.0 -From 1de0fdcf3ddab9af169e075109d3f244ade1c695 Mon Sep 17 00:00:00 2001 -From: "Urja (ARMLFS builder)" <urja+armlfs@urja.dev> -Date: Wed, 24 Jul 2024 00:06:43 +0300 -Subject: [PATCH 33/33] mfd: rk8xx: workaround veyron/ASUS C201 not powering - off - -By just registering the poweroff hook in power_off instead of _prepare. -With _prepare there are no hooks in power_off, thus the system -will refuse to use the shutdown path. This was effectively -done in power_off (pm_power_off) pre-6.4 anyways. +From ce7941bb625c4e5ecea3337d715a344793083779 Mon Sep 17 00:00:00 2001 +From: Sebastian Reichel <sebastian.reichel@collabora.com> +Date: Tue, 30 Jul 2024 20:05:05 +0200 +Subject: [PATCH 33/33] mfd: rk8xx: Fix shutdown handler + +When I converted rk808 to device managed resources I converted the rk808 +specific pm_power_off handler to devm_register_sys_off_handler() using +SYS_OFF_MODE_POWER_OFF_PREPARE, which is allowed to sleep. I did this +because the driver's poweroff function makes use of regmap and the backend +of that might sleep. + +But the PMIC poweroff function will kill off the board power and the +kernel does some extra steps after the prepare handler. Thus the prepare +handler should not be used for the PMIC's poweroff routine. Instead the +normal SYS_OFF_MODE_POWER_OFF phase should be used. The old pm_power_off +method is also being called from there, so this would have been a +cleaner conversion anyways. + +But it still makes sense to investigate the sleep handling and check +if there are any issues. Apparently the Rockchip and Meson I2C drivers +(the only platforms using the PMICs handled by this driver) both have +support for atomic transfers and thus may be called from the proper +poweroff context. + +Things are different on the SPI side. That is so far only used by rk806 +and that one is only used by Rockchip RK3588. Unfortunately the Rockchip +SPI driver does not support atomic transfers. That means using the +normal POWER_OFF handler would introduce the following error splash +during shutdown on all RK3588 boards currently supported upstream: + +[ 13.761353] ------------[ cut here ]------------ +[ 13.761764] Voluntary context switch within RCU read-side critical section! +[ 13.761776] WARNING: CPU: 0 PID: 1 at kernel/rcu/tree_plugin.h:330 rcu_note_context_switch+0x3ac/0x404 +[ 13.763219] Modules linked in: +[ 13.763498] CPU: 0 UID: 0 PID: 1 Comm: systemd-shutdow Not tainted 6.10.0-12284-g2818a9a19514 #1499 +[ 13.764297] Hardware name: Rockchip RK3588 EVB1 V10 Board (DT) +[ 13.764812] pstate: 604000c9 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) +[ 13.765427] pc : rcu_note_context_switch+0x3ac/0x404 +[ 13.765871] lr : rcu_note_context_switch+0x3ac/0x404 +[ 13.766314] sp : ffff800084f4b5b0 +[ 13.766609] x29: ffff800084f4b5b0 x28: ffff00040139b800 x27: 00007dfb4439ae80 +[ 13.767245] x26: ffff00040139bc80 x25: 0000000000000000 x24: ffff800082118470 +[ 13.767880] x23: 0000000000000000 x22: ffff000400300000 x21: ffff000400300000 +[ 13.768515] x20: ffff800083a9d600 x19: ffff0004fee48600 x18: fffffffffffed448 +[ 13.769151] x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000048 +[ 13.769787] x14: fffffffffffed490 x13: ffff80008473b3c0 x12: 0000000000000900 +[ 13.770421] x11: 0000000000000300 x10: ffff800084797bc0 x9 : ffff80008473b3c0 +[ 13.771057] x8 : 00000000ffffefff x7 : ffff8000847933c0 x6 : 0000000000000300 +[ 13.771692] x5 : 0000000000000301 x4 : 40000000fffff300 x3 : 0000000000000000 +[ 13.772328] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000400300000 +[ 13.772964] Call trace: +[ 13.773184] rcu_note_context_switch+0x3ac/0x404 +[ 13.773598] __schedule+0x94/0xb0c +[ 13.773907] schedule+0x34/0x104 +[ 13.774198] schedule_timeout+0x84/0xfc +[ 13.774544] wait_for_completion_timeout+0x78/0x14c +[ 13.774980] spi_transfer_one_message+0x588/0x690 +[ 13.775403] __spi_pump_transfer_message+0x19c/0x4ec +[ 13.775846] __spi_sync+0x2a8/0x3c4 +[ 13.776161] spi_write_then_read+0x120/0x208 +[ 13.776543] rk806_spi_bus_read+0x54/0x88 +[ 13.776905] _regmap_raw_read+0xec/0x16c +[ 13.777257] _regmap_bus_read+0x44/0x7c +[ 13.777601] _regmap_read+0x60/0xd8 +[ 13.777915] _regmap_update_bits+0xf4/0x13c +[ 13.778289] regmap_update_bits_base+0x64/0x98 +[ 13.778686] rk808_power_off+0x70/0xfc +[ 13.779024] sys_off_notify+0x40/0x6c +[ 13.779356] atomic_notifier_call_chain+0x60/0x90 +[ 13.779776] do_kernel_power_off+0x54/0x6c +[ 13.780146] machine_power_off+0x18/0x24 +[ 13.780499] kernel_power_off+0x70/0x7c +[ 13.780845] __do_sys_reboot+0x210/0x270 +[ 13.781198] __arm64_sys_reboot+0x24/0x30 +[ 13.781558] invoke_syscall+0x48/0x10c +[ 13.781897] el0_svc_common+0x3c/0xe8 +[ 13.782228] do_el0_svc+0x20/0x2c +[ 13.782528] el0_svc+0x34/0xd8 +[ 13.782806] el0t_64_sync_handler+0x120/0x12c +[ 13.783197] el0t_64_sync+0x190/0x194 +[ 13.783527] ---[ end trace 0000000000000000 ]--- + +To avoid this we keep the SYS_OFF_MODE_POWER_OFF_PREPARE handler for the +SPI backend. This is not great, but at least avoids regressions and the +fix should be small enough to allow backporting. + +As a side-effect this also works around a shutdown problem on the Asus +C201. For reasons unknown that skips calling the prepare handler and +directly calls the final shutdown handler. + +Fixes: 4fec8a5a85c49 ("mfd: rk808: Convert to device managed resources") +Cc: stable@vger.kernel.org +Reported-by: Urja <urja@urja.dev> +Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> --- - drivers/mfd/rk8xx-core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + drivers/mfd/rk8xx-core.c | 15 +++++++++++++-- + drivers/mfd/rk8xx-i2c.c | 2 +- + drivers/mfd/rk8xx-spi.c | 2 +- + include/linux/mfd/rk808.h | 2 +- + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c -index 5eda3c0dbbdf..983db36ebc4a 100644 +index 71c2b80a4678..0f43c3183ae5 100644 --- a/drivers/mfd/rk8xx-core.c +++ b/drivers/mfd/rk8xx-core.c -@@ -788,7 +788,7 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap - if (device_property_read_bool(dev, "rockchip,system-power-controller") || - device_property_read_bool(dev, "system-power-controller")) { +@@ -692,10 +692,11 @@ void rk8xx_shutdown(struct device *dev) + } + EXPORT_SYMBOL_GPL(rk8xx_shutdown); + +-int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap *regmap) ++int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap *regmap, bool is_spi) + { + struct rk808 *rk808; + const struct rk808_reg_data *pre_init_reg; ++ enum sys_off_mode pwr_off_mode = SYS_OFF_MODE_POWER_OFF; + const struct mfd_cell *cells; + int dual_support = 0; + int nr_pre_init_regs; +@@ -785,10 +786,20 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap + if (ret) + return dev_err_probe(dev, ret, "failed to add MFD devices\n"); + ++ /* ++ * Currently the Rockchip SPI driver always sleeps when doing SPI ++ * transfers. This is not allowed in the SYS_OFF_MODE_POWER_OFF ++ * handler, so we are using the prepare handler as a workaround. ++ * This should be removed once the Rockchip SPI driver has been ++ * adapted. ++ */ ++ if (is_spi) ++ pwr_off_mode = SYS_OFF_MODE_POWER_OFF_PREPARE; ++ + if (device_property_read_bool(dev, "system-power-controller") || + device_property_read_bool(dev, "rockchip,system-power-controller")) { ret = devm_register_sys_off_handler(dev, - SYS_OFF_MODE_POWER_OFF_PREPARE, SYS_OFF_PRIO_HIGH, -+ SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_HIGH, ++ pwr_off_mode, SYS_OFF_PRIO_HIGH, &rk808_power_off, rk808); if (ret) return dev_err_probe(dev, ret, +diff --git a/drivers/mfd/rk8xx-i2c.c b/drivers/mfd/rk8xx-i2c.c +index 37287b06dab0..b8c0c368ab8a 100644 +--- a/drivers/mfd/rk8xx-i2c.c ++++ b/drivers/mfd/rk8xx-i2c.c +@@ -213,7 +213,7 @@ static int rk8xx_i2c_probe(struct i2c_client *client) + return dev_err_probe(&client->dev, PTR_ERR(regmap), + "regmap initialization failed\n"); + +- return rk8xx_probe(&client->dev, data->variant, client->irq, regmap); ++ return rk8xx_probe(&client->dev, data->variant, client->irq, regmap, false); + } + + static void rk8xx_i2c_shutdown(struct i2c_client *client) +diff --git a/drivers/mfd/rk8xx-spi.c b/drivers/mfd/rk8xx-spi.c +index 3405fb82ff9f..20f9428f94bb 100644 +--- a/drivers/mfd/rk8xx-spi.c ++++ b/drivers/mfd/rk8xx-spi.c +@@ -94,7 +94,7 @@ static int rk8xx_spi_probe(struct spi_device *spi) + return dev_err_probe(&spi->dev, PTR_ERR(regmap), + "Failed to init regmap\n"); + +- return rk8xx_probe(&spi->dev, RK806_ID, spi->irq, regmap); ++ return rk8xx_probe(&spi->dev, RK806_ID, spi->irq, regmap, true); + } + + static const struct of_device_id rk8xx_spi_of_match[] = { +diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h +index 69cbea78b430..be15b84cff9e 100644 +--- a/include/linux/mfd/rk808.h ++++ b/include/linux/mfd/rk808.h +@@ -1349,7 +1349,7 @@ struct rk808 { + }; + + void rk8xx_shutdown(struct device *dev); +-int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap *regmap); ++int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap *regmap, bool is_spi); + int rk8xx_suspend(struct device *dev); + int rk8xx_resume(struct device *dev); + -- 2.44.0