From c846f6a87bba1ee6ab680c4bc5812c08bacfe18d Mon Sep 17 00:00:00 2001 From: heitbaum Date: Sun, 14 Feb 2021 03:10:49 +0000 Subject: [PATCH] Samsung: linux: Remove patches included in 5.10.15 samsung-0001-FROMLIST-v1-serial-samsung-Re-factors-UART-IRQ-resou.patch - deleted - ref: https://www.spinics.net/lists/linux-serial/msg39463.html samsung-0012-MEMEKA-phy-exynos5-usbdrd-Calibrating-makes-sense-on.patch - deleted - incorporated in 5.10.y samsung-0013-MEMEKA-clk-samsung-exynos5420-Keep-top-G3D-clocks-en.patch - deleted - replaced by https://github.com/torvalds/linux/commit/67f96ff7c8f073648696eab50fd23ded23441067 - included in kernel 5.10.y samsung-0016-MEMEKA-thermal-add-irq-mode-configuration-for-trip-p.patch - updated for 5.10.y, needs to be build/run tested. --- ...al-samsung-Re-factors-UART-IRQ-resou.patch | 46 ---------- ...s5-usbdrd-Calibrating-makes-sense-on.patch | 34 -------- ...ng-exynos5420-Keep-top-G3D-clocks-en.patch | 83 ------------------- ...dd-irq-mode-configuration-for-trip-p.patch | 17 ++-- 4 files changed, 11 insertions(+), 169 deletions(-) delete mode 100644 projects/Samsung/patches/linux/samsung-0001-FROMLIST-v1-serial-samsung-Re-factors-UART-IRQ-resou.patch delete mode 100644 projects/Samsung/patches/linux/samsung-0012-MEMEKA-phy-exynos5-usbdrd-Calibrating-makes-sense-on.patch delete mode 100644 projects/Samsung/patches/linux/samsung-0013-MEMEKA-clk-samsung-exynos5420-Keep-top-G3D-clocks-en.patch diff --git a/projects/Samsung/patches/linux/samsung-0001-FROMLIST-v1-serial-samsung-Re-factors-UART-IRQ-resou.patch b/projects/Samsung/patches/linux/samsung-0001-FROMLIST-v1-serial-samsung-Re-factors-UART-IRQ-resou.patch deleted file mode 100644 index 53865d0216..0000000000 --- a/projects/Samsung/patches/linux/samsung-0001-FROMLIST-v1-serial-samsung-Re-factors-UART-IRQ-resou.patch +++ /dev/null @@ -1,46 +0,0 @@ -From abda70cb93d3882dc22592c7a5179e739e56133b Mon Sep 17 00:00:00 2001 -From: Tamseel Shams -Date: Sun, 5 Jul 2020 03:51:47 +0000 -Subject: [PATCH 01/25] FROMLIST(v1): serial: samsung: Re-factors UART IRQ - resource for various Samsung SoC - -In few older Samsung SoCs like s3c2410, s3c2412 -and s3c2440, UART IP is having 2 interrupt lines. -However, in other SoCs like s3c6400, s5pv210, -exynos5433, and exynos4210 UART is having only 1 -interrupt line. Due to this, "platform_get_irq(platdev, 1)" -call in the driver gives the following warning: -"IRQ index 1 not found" on recent platforms. - -This patch re-factors the IRQ resources handling for -each platform and hence fixing the above warnings seen -on some platforms. - -Signed-off-by: Tamseel Shams ---- - drivers/tty/serial/samsung_tty.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c -index 73f951d65b93..7f05335c3a1e 100644 ---- a/drivers/tty/serial/samsung_tty.c -+++ b/drivers/tty/serial/samsung_tty.c -@@ -1885,10 +1885,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, - else { - port->irq = ret; - ourport->rx_irq = ret; -- ourport->tx_irq = ret + 1; -+ if (s3c24xx_serial_has_interrupt_mask(port)) -+ ourport->tx_irq = ret; -+ else -+ ourport->tx_irq = ret + 1; - } - -- ret = platform_get_irq(platdev, 1); -+ ret = platform_get_irq_optional(platdev, 1); - if (ret > 0) - ourport->tx_irq = ret; - /* --- -2.17.1 - diff --git a/projects/Samsung/patches/linux/samsung-0012-MEMEKA-phy-exynos5-usbdrd-Calibrating-makes-sense-on.patch b/projects/Samsung/patches/linux/samsung-0012-MEMEKA-phy-exynos5-usbdrd-Calibrating-makes-sense-on.patch deleted file mode 100644 index 7994b5e952..0000000000 --- a/projects/Samsung/patches/linux/samsung-0012-MEMEKA-phy-exynos5-usbdrd-Calibrating-makes-sense-on.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b67896608244f63641885f1e186c9f2add9447cc Mon Sep 17 00:00:00 2001 -From: Marek Szyprowski -Date: Fri, 19 Jul 2019 11:27:34 +0200 -Subject: [PATCH 12/25] MEMEKA: phy: exynos5-usbdrd: Calibrating makes sense - only for USB2.0 PHY - -PHY calibration is needed only for USB2.0 (UTMI) PHY, so skip calling -calibration code when phy_calibrate() is called for USB3.0 (PIPE3) PHY. - -Fixes: d8c80bb3b55b ("phy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800") -Signed-off-by: Marek Szyprowski -Signed-off-by: memeka ---- - drivers/phy/samsung/phy-exynos5-usbdrd.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c -index e510732afb8b..7f6279fb4f8f 100644 ---- a/drivers/phy/samsung/phy-exynos5-usbdrd.c -+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c -@@ -714,7 +714,9 @@ static int exynos5_usbdrd_phy_calibrate(struct phy *phy) - struct phy_usb_instance *inst = phy_get_drvdata(phy); - struct exynos5_usbdrd_phy *phy_drd = to_usbdrd_phy(inst); - -- return exynos5420_usbdrd_phy_calibrate(phy_drd); -+ if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) -+ return exynos5420_usbdrd_phy_calibrate(phy_drd); -+ return 0; - } - - static const struct phy_ops exynos5_usbdrd_phy_ops = { --- -2.17.1 - diff --git a/projects/Samsung/patches/linux/samsung-0013-MEMEKA-clk-samsung-exynos5420-Keep-top-G3D-clocks-en.patch b/projects/Samsung/patches/linux/samsung-0013-MEMEKA-clk-samsung-exynos5420-Keep-top-G3D-clocks-en.patch deleted file mode 100644 index 8d13f9aca9..0000000000 --- a/projects/Samsung/patches/linux/samsung-0013-MEMEKA-clk-samsung-exynos5420-Keep-top-G3D-clocks-en.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 5e218f158f89780e48be29c11da270ff1f6f968d Mon Sep 17 00:00:00 2001 -From: Marek Szyprowski -Date: Thu, 21 Nov 2019 11:11:45 +0100 -Subject: [PATCH 13/25] MEMEKA: clk: samsung: exynos5420: Keep top G3D clocks - enabled - -All top clocks on G3D path has to be enabled all the time to allow proper -G3D power domain operation. This is achieved by adding CRITICAL flag to -"mout_sw_aclk_g3d" clock, what keeps this clock and all its parents -enabled. - -This fixes following imprecise abort issue observed on Odroid XU3/XU4 -after enabling Panfrost driver by commit 1a5a85c56402 "ARM: dts: exynos: -Add Mali/GPU node on Exynos5420 and enable it on Odroid XU3/4"): - -panfrost 11800000.gpu: clock rate = 400000000 -panfrost 11800000.gpu: failed to get regulator: -517 -panfrost 11800000.gpu: regulator init failed -517 -Power domain G3D disable failed -... -panfrost 11800000.gpu: clock rate = 400000000 -8<--- cut here --- -Unhandled fault: imprecise external abort (0x1406) at 0x00000000 -pgd = (ptrval) -[00000000] *pgd=00000000 -Internal error: : 1406 [#1] PREEMPT SMP ARM -Modules linked in: -CPU: 7 PID: 53 Comm: kworker/7:1 Not tainted 5.4.0-rc8-next-20191119-00032-g56f1001191a6 #6923 -Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) -Workqueue: events deferred_probe_work_func -PC is at panfrost_gpu_soft_reset+0x94/0x110 -LR is at ___might_sleep+0x128/0x2dc -... -[] (panfrost_gpu_soft_reset) from [] (panfrost_gpu_init+0x10/0x67c) -[] (panfrost_gpu_init) from [] (panfrost_device_init+0x158/0x2cc) -[] (panfrost_device_init) from [] (panfrost_probe+0x80/0x178) -[] (panfrost_probe) from [] (platform_drv_probe+0x48/0x9c) -[] (platform_drv_probe) from [] (really_probe+0x1c4/0x474) -[] (really_probe) from [] (driver_probe_device+0x78/0x1bc) -[] (driver_probe_device) from [] (bus_for_each_drv+0x74/0xb8) -[] (bus_for_each_drv) from [] (__device_attach+0xd4/0x16c) -[] (__device_attach) from [] (bus_probe_device+0x88/0x90) -[] (bus_probe_device) from [] (deferred_probe_work_func+0x4c/0xd0) -[] (deferred_probe_work_func) from [] (process_one_work+0x300/0x864) -[] (process_one_work) from [] (worker_thread+0x58/0x5a0) -[] (worker_thread) from [] (kthread+0x12c/0x160) -[] (kthread) from [] (ret_from_fork+0x14/0x20) -Exception stack(0xee03dfb0 to 0xee03dff8) -... -Code: e594300c e5933020 e3130c01 1a00000f (ebefff50). ----[ end trace badde2b74a65a540 ]--- - -In the above case, the Panfrost driver disables G3D clocks after failure -of getting the needed regulator and return with -EPROVE_DEFER code. This -causes G3D power domain disable failure and then, during second probe -an imprecise abort is triggered due to undefined power domain state. - -Fixes: 45f10dabb56b ("clk: samsung: exynos5420: Add SET_RATE_PARENT flag to clocks on G3D path") -Fixes: c9f7567aff31 ("clk: samsung: exynos542x: Move G3D subsystem clocks to its sub-CMU") -Signed-off-by: Marek Szyprowski -Acked-by: Chanwoo Choi - -Signed-off-by: Marian Mihailescu ---- - drivers/clk/samsung/clk-exynos5420.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c -index edb2363c735a..1a5289d81a9f 100644 ---- a/drivers/clk/samsung/clk-exynos5420.c -+++ b/drivers/clk/samsung/clk-exynos5420.c -@@ -713,7 +713,7 @@ static const struct samsung_mux_clock exynos5x_mux_clks[] __initconst = { - MUX(0, "mout_sw_aclk266_g2d", mout_sw_aclk266_g2d_p, - SRC_TOP12, 12, 1), - MUX_F(0, "mout_sw_aclk_g3d", mout_sw_aclk_g3d_p, SRC_TOP12, 16, 1, -- CLK_SET_RATE_PARENT, 0), -+ CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0), - MUX(0, "mout_sw_aclk300_jpeg", mout_sw_aclk300_jpeg_p, - SRC_TOP12, 20, 1), - MUX(CLK_MOUT_SW_ACLK300, "mout_sw_aclk300_disp1", --- -2.17.1 - diff --git a/projects/Samsung/patches/linux/samsung-0016-MEMEKA-thermal-add-irq-mode-configuration-for-trip-p.patch b/projects/Samsung/patches/linux/samsung-0016-MEMEKA-thermal-add-irq-mode-configuration-for-trip-p.patch index 4e367f1ce0..29ad0e7c53 100644 --- a/projects/Samsung/patches/linux/samsung-0016-MEMEKA-thermal-add-irq-mode-configuration-for-trip-p.patch +++ b/projects/Samsung/patches/linux/samsung-0016-MEMEKA-thermal-add-irq-mode-configuration-for-trip-p.patch @@ -20,15 +20,15 @@ Cc: Daniel Lezcano Signed-off-by: Lukasz Luba Signed-off-by: memeka --- - drivers/thermal/of-thermal.c | 17 +++++++++++++++++ + drivers/thermal/thermal_of.c | 17 +++++++++++++++++ drivers/thermal/thermal_core.c | 10 ++++++++-- include/linux/thermal.h | 5 +++++ 3 files changed, 30 insertions(+), 2 deletions(-) -diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c +diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 874a47d6923f..1549561e28b2 100644 ---- a/drivers/thermal/of-thermal.c -+++ b/drivers/thermal/of-thermal.c +--- a/drivers/thermal/thermal_of.c ++++ b/drivers/thermal/thermal_of.c @@ -315,6 +315,20 @@ static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip, return 0; } @@ -71,10 +71,11 @@ diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9a321dc548c8..ef23a33d34b6 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c -@@ -410,6 +410,7 @@ static void handle_critical_trips(struct thermal_zone_device *tz, +@@ -410,7 +410,8 @@ static void handle_critical_trips(struct thermal_zone_device *tz, static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) { enum thermal_trip_type type; + int trip_temp, hyst = 0; + bool irq_mode = false; /* Ignore disabled trip points */ @@ -113,9 +114,13 @@ index c91b1e344d56..c4ce2b875b73 100644 struct thermal_attr *trip_type_attrs; struct thermal_attr *trip_hyst_attrs; + struct thermal_attr *trip_irq_mode_attrs; + enum thermal_device_mode mode; void *devdata; int trips; - unsigned long trips_disabled; /* bitmap for disabled trips */ +diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h +index c91b1e344d56..c4ce2b875b73 100644 +--- a/drivers/thermal/thermal_core.h ++++ b/drivers/thermal/thermal_core.h @@ -353,6 +355,8 @@ struct thermal_zone_of_device_ops { * @temperature: temperature value in miliCelsius * @hysteresis: relative hysteresis in miliCelsius