From: Thorsten Blum To: elver@google.com, dvyukov@google.com Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH] kcsan: Use min() to fix Coccinelle warning Date: Mon, 24 Jun 2024 00:06:07 +0200 Message-ID: <20240623220606.134718-2-thorsten.blum@toblux.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256228 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Fixes the following Coccinelle/coccicheck warning reported by minmax.cocci: WARNING opportunity for min() Use size_t instead of int for the result of min(). Signed-off-by: Thorsten Blum --- kernel/kcsan/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kcsan/debugfs.c b/kernel/kcsan/debugfs.c index 1d1d1b0e4248..11b891fe6f7a 100644 --- a/kernel/kcsan/debugfs.c +++ b/kernel/kcsan/debugfs.c @@ -225,7 +225,7 @@ debugfs_write(struct file *file, const char __user *buf, size_t count, loff_t *o { char kbuf[KSYM_NAME_LEN]; char *arg; - int read_len = count < (sizeof(kbuf) - 1) ? count : (sizeof(kbuf) - 1); + size_t read_len = min(count, (sizeof(kbuf) - 1)); if (copy_from_user(kbuf, buf, read_len)) return -EFAULT; -- 2.45.2 . From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 0/7] firewire: core: add tracepoints events for isochronous context Date: Mon, 24 Jun 2024 07:08:51 +0900 Message-ID: <20240623220859.851685-1-o-takashi@sakamocchi.jp> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256229 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi, It is helpful to trace any operation for isochronous context for debugging purposes. This series of changes is the last part to add tracepoints events into core function. Takashi Sakamoto (7): firewire: core: add tracepoints events for allocation/deallocation of isochronous context firewire: core: add tracepoints events for setting channels of multichannel context firewire: core: add tracepoints events for starting/stopping of isochronous context firewire: core: add tracepoints events for flushing of isochronous context firewire: core: add tracepoints events for flushing completions of isochronous context firewire: core: add tracepoints events for queueing packets of isochronous context firewire: core: add tracepoints events for completions of packets in isochronous context drivers/firewire/core-iso.c | 32 +++ drivers/firewire/core-trace.c | 4 + drivers/firewire/ohci.c | 25 +- include/trace/events/firewire.h | 463 ++++++++++++++++++++++++++++++++ 4 files changed, 518 insertions(+), 6 deletions(-) -- 2.43.0 . From: =?utf-8?q?Barnab=C3=A1s_Cz=C3=A9m=C3=A1n?= Date: Mon, 24 Jun 2024 00:26:01 +0200 Subject: [PATCH] drm/msm/mdp5: Remove MDP_CAP_SRC_SPLIT from msm8x53_config X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240624-msm8953-mdp-fix-v1-1-be4d3262ebe3@gmail.com> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Sireesh Kodali , Vladimir Lypak Cc: Rob Clark , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, =?utf-8?q?Barnab=C3=A1s_Cz=C3=A9m=C3=A1n?= Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256245 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-arm-msm,org.kernel.vger.phone-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Remove MDP_CAP_SRC_SPLIT from msm8x53_config because it is not referenced in downstream. Fixes: fb25d4474fa0 ("drm/msm/mdp5: Add configuration for MDP v1.16") Signed-off-by: Barnabás Czémán --- drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c index c5179e4c393c..92d06b7faa0a 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c @@ -837,8 +837,7 @@ static const struct mdp5_cfg_hw msm8x53_config = { .name = "msm8x53", .mdp = { .count = 1, - .caps = MDP_CAP_CDM | - MDP_CAP_SRC_SPLIT, + .caps = MDP_CAP_CDM, }, .ctl = { .count = 3, --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240624-msm8953-mdp-fix-8af4ec159082 Best regards, -- Barnabás Czémán . Date: Sun, 23 Jun 2024 16:05:38 -0700 From: Dmitry Torokhov To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [git pull] Input updates for v6.10-rc5 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256247 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-input Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi Linus, Please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git tags/input-for-v6.10-rc5 to receive updates for the input subsystem. You will get: - fixes for ili210x and elantech drivers - new products IDs added to xpad controller driver - a tweak to i8042 driver to always keep keyboard in Ayaneo Kun handheld in raw mode - populated "id_table" in ads7846 touchscreen driver to make sure non-OF instantiated devices can properly determine the model data. Changelog: --------- Alexander Stein (1): Input: ads7846 - use spi_device_id table John Keeping (1): Input: ili210x - fix ili251x_read_touch_data() return value Jonathan Denose (1): Input: elantech - fix touchpad state on resume for Lenovo N24 Luke D. Jones (1): Input: xpad - add support for ASUS ROG RAIKIRI PRO Tobias Jakobi (1): Input: i8042 - add Ayaneo Kun to i8042 quirk table Diffstat: -------- drivers/input/joystick/xpad.c | 1 + drivers/input/mouse/elantech.c | 31 +++++++++++++++++++++++++++++++ drivers/input/serio/i8042-acpipnpio.h | 18 ++++++++++++++++-- drivers/input/touchscreen/ads7846.c | 12 +++++++++++- drivers/input/touchscreen/ili210x.c | 4 ++-- 5 files changed, 61 insertions(+), 5 deletions(-) Thanks. -- Dmitry . From: George Chan via B4 Relay Subject: [PATCH v2 0/8] Add sc7180 camss subsys support Date: Mon, 24 Jun 2024 07:22:39 +0800 Message-Id: <20240624-b4-sc7180-camss-v2-0-0dfecdc50073@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, George Chan X-Original-From: George Chan Reply-To: gchan9527@gmail.com Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256253 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.feeds.b4-sent,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-media Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail SM7125 is the SoC found in the Xiaomi Redmi Note 9 Pro(joyeuse) cellphone. This series adds support to bring up the CSIPHY, CSID, VFE/RDI interfaces. Since SM7125 is a low-speed variant of SC7180, SC7180 testers please take a look and have a test as well. sc7180 provides - 2 x VFE - 1 x VFE Lite - 2 x CSID - 1 x CSID Lite - 4 x CSI PHY The sc7180-camss binding should be comaptible with sdm845 yaml. I've copied a new yaml from sdm845-camss.yaml, strip all _src clk and put new maintainer information. If this is not desirable then i can add binding to existing sdm845 yaml instead. In addition, a bootable tree of sm7125/joyeuse is availble at: https://github.com/99degree/linux/tree/camss Signed-off-by: George Chan --- Changes in v2: - Revised dt-binding as stated by krzk - Added dt-binding item power-domain-name as stated by Bryan - Combine patch #2 and #3 as stated by krzk and Bryan - Split eror-print log for clk name from patch #5 as suggested by Konrad - Reformat dt-node of camss as stated by krzk - Corrected phy init sequence for v1.2.2 as spot by Bryan - Added 3 more debug info for missing clk and low clk-rate issue. - Adding port info to ports sub-node - Adding required-opps node to dt - Link to v1: https://lore.kernel.org/r/20240621-b4-sc7180-camss-v1-0-14937929f30e@gmail.com --- George Chan (8): Add qcom,sc7180-camss Add Gen2 v1.2.2 two-phase MIPI CSI-2 DPHY init Add sc7180 support Add sc7180 resources Add debug log info to camss_enable_clocks function Add debug log info to msm_csid_subdev_init function Add debug log info to vfe block init and set clock rate [RFT]Add support for sc7180 camss subsys .../bindings/media/qcom,sc7180-camss.yaml | 327 +++++++++++++++++++++ arch/arm64/boot/dts/qcom/sc7180.dtsi | 135 +++++++++ drivers/media/platform/qcom/camss/camss-csid.c | 4 +- .../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 135 +++++++++ drivers/media/platform/qcom/camss/camss-csiphy.c | 1 + drivers/media/platform/qcom/camss/camss-vfe.c | 10 +- drivers/media/platform/qcom/camss/camss-video.c | 1 + drivers/media/platform/qcom/camss/camss.c | 218 +++++++++++++- drivers/media/platform/qcom/camss/camss.h | 1 + 9 files changed, 828 insertions(+), 4 deletions(-) --- base-commit: 2102cb0d050d34d50b9642a3a50861787527e922 change-id: 20240621-b4-sc7180-camss-cddc6b60a9b4 Best regards, -- George Chan . Return-Path: From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Ard Biesheuvel , Charlie Jenkins Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v2] riscv: enable HAVE_ARCH_STACKLEAK Date: Mon, 24 Jun 2024 07:53:16 +0800 Message-ID: <20240623235316.2010-1-jszhang@kernel.org> MIME-Version: 1.0 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Xref: photonic.trudheim.com org.infradead.lists.linux-riscv:78903 org.kernel.vger.linux-kernel:1256264 Newsgroups: org.infradead.lists.linux-riscv,org.kernel.vger.linux-efi,org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add support for the stackleak feature. Whenever the kernel returns to user space the kernel stack is filled with a poison value. At the same time, disables the plugin in EFI stub code because EFI stub is out of scope for the protection. Tested on qemu and milkv duo: / # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT [ 38.675575] lkdtm: Performing direct entry STACKLEAK_ERASING [ 38.678448] lkdtm: stackleak stack usage: [ 38.678448] high offset: 288 bytes [ 38.678448] current: 496 bytes [ 38.678448] lowest: 1328 bytes [ 38.678448] tracked: 1328 bytes [ 38.678448] untracked: 448 bytes [ 38.678448] poisoned: 14312 bytes [ 38.678448] low offset: 8 bytes [ 38.689887] lkdtm: OK: the rest of the thread stack is properly erased Signed-off-by: Jisheng Zhang --- since v2: - add #include to fixing compiler error found by Charlie arch/riscv/Kconfig | 1 + arch/riscv/include/asm/thread_info.h | 1 + arch/riscv/kernel/entry.S | 4 ++++ drivers/firmware/efi/libstub/Makefile | 3 ++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 0525ee2d63c7..9cbfdffec96c 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -118,6 +118,7 @@ config RISCV select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET select HAVE_ARCH_SECCOMP_FILTER + select HAVE_ARCH_STACKLEAK select HAVE_ARCH_THREAD_STRUCT_WHITELIST select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h index 5d473343634b..fca5c6be2b81 100644 --- a/arch/riscv/include/asm/thread_info.h +++ b/arch/riscv/include/asm/thread_info.h @@ -10,6 +10,7 @@ #include #include +#include /* thread information allocation */ #define THREAD_SIZE_ORDER CONFIG_THREAD_SIZE_ORDER diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 68a24cf9481a..80ff55a26d13 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -130,6 +130,10 @@ SYM_CODE_START_NOALIGN(ret_from_exception) #endif bnez s0, 1f +#ifdef CONFIG_GCC_PLUGIN_STACKLEAK + call stackleak_erase_on_task_stack +#endif + /* Save unwound kernel stack pointer in thread_info */ addi s0, sp, PT_SIZE_ON_STACK REG_S s0, TASK_TI_KERNEL_SP(tp) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 06f0428a723c..3a9521c57641 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -28,7 +28,8 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \ -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \ -DEFI_HAVE_STRCMP -fno-builtin -fpic \ $(call cc-option,-mno-single-pic-base) -cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax +cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax \ + $(DISABLE_STACKLEAK_PLUGIN) cflags-$(CONFIG_LOONGARCH) += -fpie cflags-$(CONFIG_EFI_PARAMS_FROM_FDT) += -I$(srctree)/scripts/dtc/libfdt -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . From: "Luke D. Jones" To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jikos@kernel.org, bentiss@kernel.org, "Luke D. Jones" Subject: [PATCH] Fixes: bda38f9a41 ("HID: asus: use hid for brightness control on keyboard") Date: Mon, 24 Jun 2024 12:14:50 +1200 Message-ID: <20240624001450.969059-1-luke@ljones.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256269 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-input Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail - Fix missing braces around initializer - Remove unused function declaration from asus-wmi.h Signed-off-by: Luke D. Jones --- include/linux/platform_data/x86/asus-wmi.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h index 96c780efa0d7..74b32e1d6735 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -162,15 +162,6 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, #endif /* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */ -#if IS_ENABLED(CONFIG_ASUS_WMI) -bool asus_use_hid_led(void); -#else -static inline bool asus_use_hid_led(void) -{ - return true; -} -#endif - static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = { { .matches = { @@ -202,7 +193,7 @@ static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = { DMI_MATCH(DMI_BOARD_NAME, "RC71L"), }, }, - NULL, + { }, }; #endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */ -- 2.45.2 . From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v2 0/8] mips: Support for RTL9302C Date: Mon, 24 Jun 2024 13:22:52 +1200 Message-ID: <20240624012300.1713290-1-chris.packham@alliedtelesis.co.nz> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=6678ca7d a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=cAq4xmbCUuwB6dAq1EgA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256284 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-mips Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This series adds basic support for the RTL9302C reference board. Currentl= y the focus is on the CPU block stuff. I hope to get around to the DSA switch d= river eventually but this is a small start that lets me boot a mainline kernel = on the board I have. I initialiy started with code from openwrt but have paired = it down to just the clocksource driver and devicetree. The first two patches in this series are fixing some complaints from make dtbs_check for some existing realtek dts files. They can be applied on th= eir own if desired. Chris Packham (8): mips: dts: realtek: use "serial" instead of "uart" in node name mips: dts: realtek: add device_type property to cpu node dt-bindings: mips: realtek: Add rtl930x-soc compatible dt-bindings: timer: Add schema for realtek,otto-timer dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc clocksource: realtek: Add timer driver for rtl-otto platforms mips: generic: add fdt fixup for Realtek reference board mips: dts: realtek: Add RTL9302C board .../realtek,rtl-intc.yaml | 17 +- .../devicetree/bindings/mips/realtek-rtl.yaml | 4 + .../bindings/timer/realtek,otto-timer.yaml | 66 ++++ arch/mips/boot/dts/realtek/Makefile | 1 + arch/mips/boot/dts/realtek/rtl838x.dtsi | 1 + arch/mips/boot/dts/realtek/rtl83xx.dtsi | 4 +- arch/mips/boot/dts/realtek/rtl9302c.dts | 73 +++++ arch/mips/boot/dts/realtek/rtl930x.dtsi | 79 +++++ arch/mips/generic/Makefile | 1 + arch/mips/generic/board-realtek.c | 81 +++++ drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-rtl-otto.c | 287 ++++++++++++++++++ include/linux/cpuhotplug.h | 1 + 14 files changed, 624 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/timer/realtek,otto-= timer.yaml create mode 100644 arch/mips/boot/dts/realtek/rtl9302c.dts create mode 100644 arch/mips/boot/dts/realtek/rtl930x.dtsi create mode 100644 arch/mips/generic/board-realtek.c create mode 100644 drivers/clocksource/timer-rtl-otto.c --=20 2.45.2 . From: Wentong Wu To: sakari.ailus@linux.intel.com, tomas.winkler@intel.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Wentong Wu Subject: [PATCH v2 0/5] Fix MEI command timeout issue following warm reboot Date: Mon, 24 Jun 2024 09:42:18 +0800 Message-Id: <20240624014223.4171341-1-wentong.wu@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256295 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail While enabling the IVSC on certain recent commercial products, the chipset may occasionally enter an unknown state following a warm reboot. This issue can cause the firmware to fail in responding to the MEI command from the host, despite the firmware being re-downloaded. To resolve this, the current patch set incorporates reset logic during system shutdown to ensure that the IVSC chipset remains in a valid state after a warm reboot. Furthermore, after the firmware download is complete, the firmware requires some time to become operational. To enhance this, additional sleep time has been introduced before the initial read operation to prevent a confusing timeout error in vsc_tp_xfer(). Additionally, this patch set includes several enhancements as well: 1) utilizing the appropriate byte order swap function for data received from the ROM; 2) correcting a spelling error in a comment; 3) Constructing the SPI transfer command as per the specific request. --- v1 -> v2: - remove cc spelling fix to stable - remove the reset toggling enhancement Wentong Wu (5): mei: vsc: Enhance IVSC chipset stability during warm reboot mei: vsc: Enhance SPI transfer of IVSC rom mei: vsc: Utilize the appropriate byte order swap function mei: vsc: Prevent timeout error with added delay post-firmware download mei: vsc: Fix spelling error drivers/misc/mei/platform-vsc.c | 4 ++-- drivers/misc/mei/vsc-fw-loader.c | 2 +- drivers/misc/mei/vsc-tp.c | 18 ++++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) -- 2.34.1 . From: Liu Ying To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: neil.armstrong@linaro.org, quic_jesszhan@quicinc.com, sam@ravnborg.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, victor.liu@nxp.com, emil.l.velikov@gmail.com Subject: [PATCH RESEND] drm/panel: simple: Add missing display timing flags for KOE TX26D202VM0BWA Date: Mon, 24 Jun 2024 09:56:12 +0800 Message-Id: <20240624015612.341983-1-victor.liu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256301 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail KOE TX26D202VM0BWA panel spec indicates the DE signal is active high in timing chart, so add DISPLAY_FLAGS_DE_HIGH flag in display timing flags. This aligns display_timing with panel_desc. Fixes: 8a07052440c2 ("drm/panel: simple: Add support for KOE TX26D202VM0BWA panel") Signed-off-by: Liu Ying --- drivers/gpu/drm/panel/panel-simple.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 20e3df1c59d4..7b70606e5760 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2704,6 +2704,7 @@ static const struct display_timing koe_tx26d202vm0bwa_timing = { .vfront_porch = { 3, 5, 10 }, .vback_porch = { 2, 5, 10 }, .vsync_len = { 5, 5, 5 }, + .flags = DISPLAY_FLAGS_DE_HIGH, }; static const struct panel_desc koe_tx26d202vm0bwa = { -- 2.34.1 . From: Ma Ke To: neal_liu@aspeedtech.com, gregkh@linuxfoundation.org, joel@jms.id.au, andrew@codeconstruct.com.au Cc: linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ma Ke Subject: [PATCH v2] usb: gadget: aspeed_udc: validate endpoint index for ast udc Date: Mon, 24 Jun 2024 09:53:13 +0800 Message-Id: <20240624015314.2249128-1-make24@iscas.ac.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256303 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-usb Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail We should verify the bound of the array to assure that host may not manipulate the index to point past endpoint array. Found by static analysis. Signed-off-by: Ma Ke --- drivers/usb/gadget/udc/aspeed_udc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c index 3916c8e2ba01..d972ef4644bc 100644 --- a/drivers/usb/gadget/udc/aspeed_udc.c +++ b/drivers/usb/gadget/udc/aspeed_udc.c @@ -1009,6 +1009,8 @@ static void ast_udc_getstatus(struct ast_udc_dev *udc) break; case USB_RECIP_ENDPOINT: epnum = crq.wIndex & USB_ENDPOINT_NUMBER_MASK; + if (epnum >= AST_UDC_NUM_ENDPOINTS) + goto stall; status = udc->ep[epnum].stopped; break; default: -- 2.25.1 . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Alexander Coffin Date: Sun, 23 Jun 2024 18:57:13 -0700 Message-ID: Subject: PROBLEM: ext4 resize2fs on-line resizing panic To: "Theodore Ts'o" , Jan Kara Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256306 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-ext4 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail [1.] One line summary of the problem: Using resize2fs on-line resizing on a specific ext4 partition is causing an Oops. [2.] Full description of the problem/report: I have a partition that if it is live mounted causes a kernel panic upon invoking resize2fs on it. I believe this to be a bug, and currently don't have time to investigate the issue further so I am hoping someone else will be able to investigate this further. [3.] Keywords (i.e., modules, networking, kernel): resize2fs ext4 [4.] Kernel information [4.1.] Kernel version (from /proc/version): Linux version 6.10.0-rc5 (root@debian11-vm-acoffin) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #4 SMP PREEMPT_DYNAMIC Sun Jun 23 17:49:17 PDT 2024 The kernel was built from git commit f2661062f16b2de5d7b6a5c42a9a5c96326b8454 with a config pretty much copy, and pasted from the standard Debian ones (I don't believe the config to be relevant although I have only tested the issue on Debian kernels). It also appears to affect kernels 5.10, and 6.1 from the Debian repositories. [4.2.] Kernel .config file: https://drive.google.com/file/d/1aG2-Ju0kPX09LPk9E8-ioHqQqQCgSl4x/view?usp=sharing sha256sum of file 7af96f35d621f702433a74e171af11c34b99bd96e57ab08494614af7bfcb9c21 [5.] Most recent kernel version which did not have the bug: None known. [6.] Output of Oops.. message (if applicable) with symbolic information resolved (see Documentation/admin-guide/bug-hunting.rst) ``` [ 445.552287] ------------[ cut here ]------------ [ 445.552300] kernel BUG at fs/jbd2/journal.c:846! [ 445.552345] Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 445.552365] CPU: 12 PID: 1899 Comm: jbd2/loop0-8 Not tainted 6.10.0-rc5 #4 [ 445.552374] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 [ 445.552380] RIP: 0010:jbd2_journal_next_log_block (fs/jbd2/journal.c:846 (discriminator 1)) jbd2 [ 445.552428] Code: 8b 85 88 03 00 00 48 89 85 70 03 00 00 4c 89 ef e8 b9 d3 98 e3 4c 89 e2 4c 89 f6 48 89 ef 5d 41 5c 41 5d 41 5e e9 a4 fe ff ff <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f All code ======== 0: 8b 85 88 03 00 00 mov 0x388(%rbp),%eax 6: 48 89 85 70 03 00 00 mov %rax,0x370(%rbp) d: 4c 89 ef mov %r13,%rdi 10: e8 b9 d3 98 e3 callq 0xffffffffe398d3ce 15: 4c 89 e2 mov %r12,%rdx 18: 4c 89 f6 mov %r14,%rsi 1b: 48 89 ef mov %rbp,%rdi 1e: 5d pop %rbp 1f: 41 5c pop %r12 21: 41 5d pop %r13 23: 41 5e pop %r14 25: e9 a4 fe ff ff jmpq 0xfffffffffffffece 2a:* 0f 0b ud2 <-- trapping instruction 2c: 66 90 xchg %ax,%ax 2e: 90 nop 2f: 90 nop 30: 90 nop 31: 90 nop 32: 90 nop 33: 90 nop 34: 90 nop 35: 90 nop 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 0f .byte 0xf 3f: 1f (bad) Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: 66 90 xchg %ax,%ax 4: 90 nop 5: 90 nop 6: 90 nop 7: 90 nop 8: 90 nop 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 0f .byte 0xf 15: 1f (bad) [ 445.552435] RSP: 0018:ffffb03c006a7c48 EFLAGS: 00010246 [ 445.552443] RAX: 0000000000000001 RBX: ffff9ba702ed1000 RCX: 00000000ffffffff [ 445.552449] RDX: 00000000000000ff RSI: ffffb03c006a7c70 RDI: ffff9ba707c78040 [ 445.552454] RBP: ffff9ba707c78000 R08: ffffb03c013e3900 R09: ffffb03c013e3900 [ 445.552458] R10: ffff9ba77ba35a80 R11: 0000000000000000 R12: ffffb03c006a7c70 [ 445.552463] R13: ffff9ba707c78040 R14: 0000000000000000 R15: ffff9ba702ed1000 [ 445.552468] FS: 0000000000000000(0000) GS:ffff9ba77ba00000(0000) knlGS:0000000000000000 [ 445.552474] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 445.552479] CR2: 000055824eb84444 CR3: 0000000100ad4000 CR4: 0000000000750ef0 [ 445.552492] PKRU: 55555554 [ 445.552496] Call Trace: [ 445.552504] [ 445.552511] ? die (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:434 arch/x86/kernel/dumpstack.c:447) [ 445.552613] ? do_trap (arch/x86/kernel/traps.c:114 arch/x86/kernel/traps.c:155) [ 445.552633] ? jbd2_journal_next_log_block (fs/jbd2/journal.c:846 (discriminator 1)) jbd2 [ 445.552660] ? do_error_trap (./arch/x86/include/asm/traps.h:58 arch/x86/kernel/traps.c:176) [ 445.552669] ? jbd2_journal_next_log_block (fs/jbd2/journal.c:846 (discriminator 1)) jbd2 [ 445.552693] ? exc_invalid_op (arch/x86/kernel/traps.c:267) [ 445.552757] ? jbd2_journal_next_log_block (fs/jbd2/journal.c:846 (discriminator 1)) jbd2 [ 445.552781] ? asm_exc_invalid_op (./arch/x86/include/asm/idtentry.h:621) [ 445.552818] ? jbd2_journal_next_log_block (fs/jbd2/journal.c:846 (discriminator 1)) jbd2 [ 445.552842] ? jbd2_journal_next_log_block (fs/jbd2/journal.c:846) jbd2 [ 445.552866] jbd2_journal_get_descriptor_buffer (fs/jbd2/journal.c:1007) jbd2 [ 445.552894] journal_submit_commit_record.part.0 (fs/jbd2/commit.c:131) jbd2 [ 445.552925] jbd2_journal_commit_transaction (./include/linux/mm.h:1508 fs/jbd2/commit.c:881) jbd2 [ 445.552957] ? _raw_spin_unlock_irqrestore (./arch/x86/include/asm/paravirt.h:589 ./arch/x86/include/asm/qspinlock.h:57 ./include/linux/spinlock.h:204 ./include/linux/spinlock_api_smp.h:150 kernel/locking/spinlock.c:194) [ 445.552977] kjournald2 (fs/jbd2/journal.c:202 (discriminator 3)) jbd2 [ 445.553010] ? __pfx_autoremove_wake_function (kernel/sched/wait.c:383) [ 445.553049] ? __pfx_kjournald2 (fs/jbd2/journal.c:161) jbd2 [ 445.553074] kthread (kernel/kthread.c:389) [ 445.553125] ? __pfx_kthread (kernel/kthread.c:342) [ 445.553135] ret_from_fork (arch/x86/kernel/process.c:147) [ 445.553179] ? __pfx_kthread (kernel/kthread.c:342) [ 445.553188] ret_from_fork_asm (arch/x86/entry/entry_64.S:257) [ 445.553269] [ 445.553273] Modules linked in: loop intel_rapl_msr intel_rapl_common intel_uncore_frequency_common intel_pmc_core intel_vsec pmt_telemetry pmt_class kvm_intel kvm ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_ssse3 aesni_intel crypto_simd cryptd rapl snd_hda_codec_generic snd_hda_intel rfkill snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer iTCO_wdt snd intel_pmc_bxt iTCO_vendor_support joydev watchdog serio_raw virtio_balloon pcspkr soundcore virtio_console evdev qemu_fw_cfg nfsd auth_rpcgss binfmt_misc nfs_acl lockd grace parport_pc ppdev lp sunrpc parport fuse configfs virtio_rng ip_tables x_tables autofs4 ext4 crc32c_generic crc16 mbcache jbd2 hid_generic usbhid hid virtio_gpu virtio_dma_buf drm_shmem_helper drm_kms_helper virtio_net ahci libahci net_failover xhci_pci drm xhci_hcd failover virtio_blk dimlib libata usbcore crct10dif_pclmul virtio_pci crct10dif_common scsi_mod virtio_pci_legacy_dev psmouse crc32_pclmul i2c_i801 virtio_pci_modern_dev crc32c_intel lpc_ich [ 445.553426] virtio i2c_smbus scsi_common usb_common virtio_ring button [ 445.553513] ---[ end trace 0000000000000000 ]--- [ 445.553519] RIP: 0010:jbd2_journal_next_log_block (fs/jbd2/journal.c:846 (discriminator 1)) jbd2 [ 445.553546] Code: 8b 85 88 03 00 00 48 89 85 70 03 00 00 4c 89 ef e8 b9 d3 98 e3 4c 89 e2 4c 89 f6 48 89 ef 5d 41 5c 41 5d 41 5e e9 a4 fe ff ff <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f All code ======== 0: 8b 85 88 03 00 00 mov 0x388(%rbp),%eax 6: 48 89 85 70 03 00 00 mov %rax,0x370(%rbp) d: 4c 89 ef mov %r13,%rdi 10: e8 b9 d3 98 e3 callq 0xffffffffe398d3ce 15: 4c 89 e2 mov %r12,%rdx 18: 4c 89 f6 mov %r14,%rsi 1b: 48 89 ef mov %rbp,%rdi 1e: 5d pop %rbp 1f: 41 5c pop %r12 21: 41 5d pop %r13 23: 41 5e pop %r14 25: e9 a4 fe ff ff jmpq 0xfffffffffffffece 2a:* 0f 0b ud2 <-- trapping instruction 2c: 66 90 xchg %ax,%ax 2e: 90 nop 2f: 90 nop 30: 90 nop 31: 90 nop 32: 90 nop 33: 90 nop 34: 90 nop 35: 90 nop 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 0f .byte 0xf 3f: 1f (bad) Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: 66 90 xchg %ax,%ax 4: 90 nop 5: 90 nop 6: 90 nop 7: 90 nop 8: 90 nop 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: 90 nop 14: 0f .byte 0xf 15: 1f (bad) [ 445.553553] RSP: 0018:ffffb03c006a7c48 EFLAGS: 00010246 [ 445.553561] RAX: 0000000000000001 RBX: ffff9ba702ed1000 RCX: 00000000ffffffff [ 445.553567] RDX: 00000000000000ff RSI: ffffb03c006a7c70 RDI: ffff9ba707c78040 [ 445.553572] RBP: ffff9ba707c78000 R08: ffffb03c013e3900 R09: ffffb03c013e3900 [ 445.553578] R10: ffff9ba77ba35a80 R11: 0000000000000000 R12: ffffb03c006a7c70 [ 445.553583] R13: ffff9ba707c78040 R14: 0000000000000000 R15: ffff9ba702ed1000 [ 445.553588] FS: 0000000000000000(0000) GS:ffff9ba77ba00000(0000) knlGS:0000000000000000 [ 445.553595] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 445.553601] CR2: 000055824eb84444 CR3: 0000000100ad4000 CR4: 0000000000750ef0 [ 445.553613] PKRU: 55555554 [ 445.553618] note: jbd2/loop0-8[1899] exited with preempt_count 1 ``` And the raw relevant dmesg section ``` [ 154.118871] loop: module loaded [ 154.119555] loop0: detected capacity change from 0 to 1048576 [ 154.452675] EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w with ordered data mode. Quota mode: none. [ 154.452686] ext4 filesystem being mounted at /mnt supports timestamps until 2038-01-19 (0x7fffffff) [ 441.561378] EXT4-fs (loop0): resizing filesystem from 32769 to 524288 blocks [ 445.552287] ------------[ cut here ]------------ [ 445.552300] kernel BUG at fs/jbd2/journal.c:846! [ 445.552345] Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 445.552365] CPU: 12 PID: 1899 Comm: jbd2/loop0-8 Not tainted 6.10.0-rc5 #4 [ 445.552374] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 [ 445.552380] RIP: 0010:jbd2_journal_next_log_block+0x7c/0x80 [jbd2] [ 445.552428] Code: 8b 85 88 03 00 00 48 89 85 70 03 00 00 4c 89 ef e8 b9 d3 98 e3 4c 89 e2 4c 89 f6 48 89 ef 5d 41 5c 41 5d 41 5e e9 a4 fe ff ff <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f [ 445.552435] RSP: 0018:ffffb03c006a7c48 EFLAGS: 00010246 [ 445.552443] RAX: 0000000000000001 RBX: ffff9ba702ed1000 RCX: 00000000ffffffff [ 445.552449] RDX: 00000000000000ff RSI: ffffb03c006a7c70 RDI: ffff9ba707c78040 [ 445.552454] RBP: ffff9ba707c78000 R08: ffffb03c013e3900 R09: ffffb03c013e3900 [ 445.552458] R10: ffff9ba77ba35a80 R11: 0000000000000000 R12: ffffb03c006a7c70 [ 445.552463] R13: ffff9ba707c78040 R14: 0000000000000000 R15: ffff9ba702ed1000 [ 445.552468] FS: 0000000000000000(0000) GS:ffff9ba77ba00000(0000) knlGS:0000000000000000 [ 445.552474] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 445.552479] CR2: 000055824eb84444 CR3: 0000000100ad4000 CR4: 0000000000750ef0 [ 445.552492] PKRU: 55555554 [ 445.552496] Call Trace: [ 445.552504] [ 445.552511] ? die+0x33/0x90 [ 445.552613] ? do_trap+0xd9/0x100 [ 445.552633] ? jbd2_journal_next_log_block+0x7c/0x80 [jbd2] [ 445.552660] ? do_error_trap+0x6a/0x90 [ 445.552669] ? jbd2_journal_next_log_block+0x7c/0x80 [jbd2] [ 445.552693] ? exc_invalid_op+0x4e/0x70 [ 445.552757] ? jbd2_journal_next_log_block+0x7c/0x80 [jbd2] [ 445.552781] ? asm_exc_invalid_op+0x16/0x20 [ 445.552818] ? jbd2_journal_next_log_block+0x7c/0x80 [jbd2] [ 445.552842] ? jbd2_journal_next_log_block+0x1e/0x80 [jbd2] [ 445.552866] jbd2_journal_get_descriptor_buffer+0x32/0x100 [jbd2] [ 445.552894] journal_submit_commit_record.part.0+0x37/0x1d0 [jbd2] [ 445.552925] jbd2_journal_commit_transaction+0x151c/0x1a20 [jbd2] [ 445.552957] ? _raw_spin_unlock_irqrestore+0xa/0x40 [ 445.552977] kjournald2+0xa8/0x260 [jbd2] [ 445.553010] ? __pfx_autoremove_wake_function+0x10/0x10 [ 445.553049] ? __pfx_kjournald2+0x10/0x10 [jbd2] [ 445.553074] kthread+0xcc/0x100 [ 445.553125] ? __pfx_kthread+0x10/0x10 [ 445.553135] ret_from_fork+0x2d/0x50 [ 445.553179] ? __pfx_kthread+0x10/0x10 [ 445.553188] ret_from_fork_asm+0x1a/0x30 [ 445.553269] [ 445.553273] Modules linked in: loop intel_rapl_msr intel_rapl_common intel_uncore_frequency_common intel_pmc_core intel_vsec pmt_telemetry pmt_class kvm_intel kvm ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_ssse3 aesni_intel crypto_simd cryptd rapl snd_hda_codec_generic snd_hda_intel rfkill snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer iTCO_wdt snd intel_pmc_bxt iTCO_vendor_support joydev watchdog serio_raw virtio_balloon pcspkr soundcore virtio_console evdev qemu_fw_cfg nfsd auth_rpcgss binfmt_misc nfs_acl lockd grace parport_pc ppdev lp sunrpc parport fuse configfs virtio_rng ip_tables x_tables autofs4 ext4 crc32c_generic crc16 mbcache jbd2 hid_generic usbhid hid virtio_gpu virtio_dma_buf drm_shmem_helper drm_kms_helper virtio_net ahci libahci net_failover xhci_pci drm xhci_hcd failover virtio_blk dimlib libata usbcore crct10dif_pclmul virtio_pci crct10dif_common scsi_mod virtio_pci_legacy_dev psmouse crc32_pclmul i2c_i801 virtio_pci_modern_dev crc32c_intel lpc_ich [ 445.553426] virtio i2c_smbus scsi_common usb_common virtio_ring button [ 445.553513] ---[ end trace 0000000000000000 ]--- [ 445.553519] RIP: 0010:jbd2_journal_next_log_block+0x7c/0x80 [jbd2] [ 445.553546] Code: 8b 85 88 03 00 00 48 89 85 70 03 00 00 4c 89 ef e8 b9 d3 98 e3 4c 89 e2 4c 89 f6 48 89 ef 5d 41 5c 41 5d 41 5e e9 a4 fe ff ff <0f> 0b 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f [ 445.553553] RSP: 0018:ffffb03c006a7c48 EFLAGS: 00010246 [ 445.553561] RAX: 0000000000000001 RBX: ffff9ba702ed1000 RCX: 00000000ffffffff [ 445.553567] RDX: 00000000000000ff RSI: ffffb03c006a7c70 RDI: ffff9ba707c78040 [ 445.553572] RBP: ffff9ba707c78000 R08: ffffb03c013e3900 R09: ffffb03c013e3900 [ 445.553578] R10: ffff9ba77ba35a80 R11: 0000000000000000 R12: ffffb03c006a7c70 [ 445.553583] R13: ffff9ba707c78040 R14: 0000000000000000 R15: ffff9ba702ed1000 [ 445.553588] FS: 0000000000000000(0000) GS:ffff9ba77ba00000(0000) knlGS:0000000000000000 [ 445.553595] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 445.553601] CR2: 000055824eb84444 CR3: 0000000100ad4000 CR4: 0000000000750ef0 [ 445.553613] PKRU: 55555554 [ 445.553618] note: jbd2/loop0-8[1899] exited with preempt_count 1 ``` [7.] A small shell script or example program which triggers the problem (if possible) If anyone wants to investigate the ext4 partition themselves you can download a version that should recreate this bug from here https://drive.google.com/file/d/1lzWKlBOixVWtLwGN4WEIuRiLYQz9rrH3/view?usp=sharing . ```bash sha256sum foo.iso.gz # It should show: # d7c49a5f7c26aa9a04edefb57f3f23aae660901c9ad5e88b10eb31ae4757bee8 foo.iso.gz gunzip ./foo.iso.gz mkdir /mnt/foo mount ./foo.iso /mnt/foo # Or wherever it loop mounted if not /dev/loop0 resize2fs /dev/loop0 ``` ``` root@debian11-vm-acoffin:~/tmp# mount ./foo.iso /mnt root@debian11-vm-acoffin:~/tmp# df -h Filesystem Size Used Avail Use% Mounted on udev 1.9G 0 1.9G 0% /dev tmpfs 392M 1.1M 391M 1% /run /dev/vda1 78G 71G 3.3G 96% / tmpfs 2.0G 0 2.0G 0% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 392M 44K 392M 1% /run/user/0 /dev/loop0 30M 16M 12M 59% /mnt root@debian11-vm-acoffin:~/tmp# resize2fs /dev/loop0 resize2fs 1.46.2 (28-Feb-2021) Filesystem at /dev/loop0 is mounted on /mnt; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 4 ``` [8.] Environment [8.1.] Software (add the output of the ver_linux script here) Linux debian11-vm-acoffin 6.10.0-rc5 #4 SMP PREEMPT_DYNAMIC Sun Jun 23 17:49:17 PDT 2024 x86_64 GNU/Linux GNU C 10 GNU Make 4.3 Binutils 2.35.2 Util-linux 2.36.1 Mount 2.36.1 Module-init-tools 28 E2fsprogs 1.46.2 PPP 2.4.9 Nfs-utils 1.3.3 Bison 3.7.5 Flex 2.6.4 Linux C++ Library 6.0.28 Linux C Library 2.31 Dynamic linker (ldd) 2.31 Procps 3.3.17 Kbd 2.3.0 Console-tools 2.3.0 Sh-utils 8.32 Udev 247 Modules Loaded aesni_intel ahci auth_rpcgss autofs4 binfmt_misc button configfs crc16 crc32c_generic crc32c_intel crc32_pclmul crct10dif_common crct10dif_pclmul cryptd crypto_simd dimlib drm drm_kms_helper drm_shmem_helper evdev ext4 failover fuse ghash_clmulni_intel grace hid hid_generic i2c_i801 i2c_smbus intel_pmc_bxt intel_pmc_core intel_rapl_common intel_rapl_msr intel_uncore_frequency_common intel_vsec ip_tables iTCO_vendor_support iTCO_wdt jbd2 joydev kvm kvm_intel libahci libata lockd lp lpc_ich mbcache net_failover nfs_acl nfsd parport parport_pc pcspkr pmt_class pmt_telemetry ppdev psmouse qemu_fw_cfg rapl rfkill scsi_common scsi_mod serio_raw sha1_ssse3 sha256_ssse3 sha512_ssse3 snd snd_hda_codec snd_hda_codec_generic snd_hda_core snd_hda_intel snd_hwdep snd_intel_dspcfg snd_intel_sdw_acpi snd_pcm snd_timer soundcore sunrpc usb_common usbcore usbhid virtio virtio_balloon virtio_blk virtio_console virtio_dma_buf virtio_gpu virtio_net virtio_pci virtio_pci_legacy_dev virtio_pci_modern_dev virtio_ring virtio_rng watchdog xhci_hcd xhci_pci x_tables [8.2.] Processor information (from /proc/cpuinfo): Not relevant. Can be recreated on both ARM64, and AMD64 systems. If anyone wants this I will add it in a follow up email. [8.3.] Module information (from /proc/modules): intel_rapl_msr 20480 0 - Live 0xffffffffc0e43000 intel_rapl_common 49152 1 intel_rapl_msr, Live 0xffffffffc0ddf000 intel_uncore_frequency_common 16384 0 - Live 0xffffffffc0ec4000 intel_pmc_core 122880 0 - Live 0xffffffffc0e8d000 intel_vsec 20480 1 intel_pmc_core, Live 0xffffffffc0e47000 pmt_telemetry 16384 1 intel_pmc_core, Live 0xffffffffc0df2000 pmt_class 12288 1 pmt_telemetry, Live 0xffffffffc0bff000 kvm_intel 413696 0 - Live 0xffffffffc1144000 kvm 1323008 1 kvm_intel, Live 0xffffffffc0fa7000 ghash_clmulni_intel 16384 0 - Live 0xffffffffc0df7000 sha512_ssse3 45056 0 - Live 0xffffffffc0de4000 sha256_ssse3 32768 0 - Live 0xffffffffc0dd6000 sha1_ssse3 32768 0 - Live 0xffffffffc0dcd000 aesni_intel 364544 0 - Live 0xffffffffc0f56000 crypto_simd 16384 1 aesni_intel, Live 0xffffffffc0d95000 cryptd 28672 2 ghash_clmulni_intel,crypto_simd, Live 0xffffffffc0d87000 rapl 20480 0 - Live 0xffffffffc0b99000 rfkill 40960 1 - Live 0xffffffffc0d6b000 snd_hda_codec_generic 110592 1 - Live 0xffffffffc0f37000 snd_hda_intel 61440 0 - Live 0xffffffffc0f1c000 snd_intel_dspcfg 36864 1 snd_hda_intel, Live 0xffffffffc0b9b000 snd_intel_sdw_acpi 16384 1 snd_intel_dspcfg, Live 0xffffffffc0a33000 snd_hda_codec 212992 2 snd_hda_codec_generic,snd_hda_intel, Live 0xffffffffc0eca000 snd_hda_core 143360 3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec, Live 0xffffffffc0e92000 iTCO_wdt 12288 0 - Live 0xffffffffc0e87000 snd_hwdep 16384 1 snd_hda_codec, Live 0xffffffffc0e6e000 intel_pmc_bxt 16384 1 iTCO_wdt, Live 0xffffffffc0e62000 joydev 24576 0 - Live 0xffffffffc0e53000 iTCO_vendor_support 12288 1 iTCO_wdt, Live 0xffffffffc0e49000 snd_pcm 188416 3 snd_hda_intel,snd_hda_codec,snd_hda_core, Live 0xffffffffc0e06000 watchdog 49152 1 iTCO_wdt, Live 0xffffffffc0d70000 snd_timer 53248 1 snd_pcm, Live 0xffffffffc0c2b000 pcspkr 12288 0 - Live 0xffffffffc0bf2000 snd 147456 6 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer, Live 0xffffffffc0c6c000 serio_raw 16384 0 - Live 0xffffffffc0bbe000 soundcore 16384 1 snd, Live 0xffffffffc0bb2000 virtio_console 40960 1 - Live 0xffffffffc0b9e000 virtio_balloon 32768 0 - Live 0xffffffffc0b8f000 qemu_fw_cfg 20480 0 - Live 0xffffffffc0a43000 evdev 28672 6 - Live 0xffffffffc0a5f000 binfmt_misc 28672 1 - Live 0xffffffffc0da4000 nfsd 937984 3 - Live 0xffffffffc0c7d000 auth_rpcgss 192512 1 nfsd, Live 0xffffffffc0c39000 nfs_acl 12288 1 nfsd, Live 0xffffffffc0a45000 lockd 155648 1 nfsd, Live 0xffffffffc0c03000 grace 12288 2 nfsd,lockd, Live 0xffffffffc0bf9000 parport_pc 40960 0 - Live 0xffffffffc0be4000 ppdev 24576 0 - Live 0xffffffffc0bd5000 sunrpc 851968 18 nfsd,auth_rpcgss,nfs_acl,lockd, Live 0xffffffffc0abb000 lp 20480 0 - Live 0xffffffffc0aae000 fuse 221184 1 - Live 0xffffffffc0a66000 parport 81920 3 parport_pc,ppdev,lp, Live 0xffffffffc0a49000 configfs 65536 1 - Live 0xffffffffc07a1000 virtio_rng 12288 0 - Live 0xffffffffc0a37000 ip_tables 36864 0 - Live 0xffffffffc0918000 x_tables 65536 1 ip_tables, Live 0xffffffffc07c5000 autofs4 57344 2 - Live 0xffffffffc077d000 ext4 1118208 1 - Live 0xffffffffc0920000 crc32c_generic 12288 0 - Live 0xffffffffc06ba000 crc16 12288 1 ext4, Live 0xffffffffc05f0000 mbcache 16384 1 ext4, Live 0xffffffffc0521000 jbd2 196608 1 ext4, Live 0xffffffffc08df000 hid_generic 12288 0 - Live 0xffffffffc04c6000 usbhid 73728 0 - Live 0xffffffffc074c000 hid 253952 2 hid_generic,usbhid, Live 0xffffffffc06a7000 virtio_gpu 98304 1 - Live 0xffffffffc04ff000 virtio_dma_buf 12288 1 virtio_gpu, Live 0xffffffffc0464000 drm_shmem_helper 28672 1 virtio_gpu, Live 0xffffffffc0461000 drm_kms_helper 253952 2 virtio_gpu, Live 0xffffffffc0589000 drm 749568 5 virtio_gpu,drm_shmem_helper,drm_kms_helper, Live 0xffffffffc07f3000 virtio_net 98304 0 - Live 0xffffffffc07ce000 ahci 49152 0 - Live 0xffffffffc07b5000 net_failover 24576 1 virtio_net, Live 0xffffffffc07a7000 libahci 61440 1 ahci, Live 0xffffffffc078e000 failover 12288 1 net_failover, Live 0xffffffffc0783000 virtio_blk 32768 1 - Live 0xffffffffc0771000 xhci_pci 24576 0 - Live 0xffffffffc0760000 dimlib 16384 1 virtio_net, Live 0xffffffffc0756000 libata 450560 2 ahci,libahci, Live 0xffffffffc06bf000 xhci_hcd 356352 1 xhci_pci, Live 0xffffffffc064c000 crct10dif_pclmul 12288 0 - Live 0xffffffffc0478000 crct10dif_common 12288 1 crct10dif_pclmul, Live 0xffffffffc0644000 scsi_mod 319488 1 libata, Live 0xffffffffc05ce000 virtio_pci 40960 0 - Live 0xffffffffc05c5000 crc32_pclmul 12288 0 - Live 0xffffffffc05bb000 i2c_i801 36864 0 - Live 0xffffffffc05a8000 usbcore 397312 3 usbhid,xhci_pci,xhci_hcd, Live 0xffffffffc0524000 virtio_pci_legacy_dev 16384 1 virtio_pci, Live 0xffffffffc051a000 crc32c_intel 16384 2 - Live 0xffffffffc050f000 psmouse 208896 0 - Live 0xffffffffc04c8000 virtio_pci_modern_dev 20480 1 virtio_pci, Live 0xffffffffc04bc000 lpc_ich 28672 0 - Live 0xffffffffc04ab000 i2c_smbus 16384 1 i2c_i801, Live 0xffffffffc049e000 scsi_common 16384 2 libata,scsi_mod, Live 0xffffffffc0494000 virtio 16384 7 virtio_console,virtio_balloon,virtio_rng,virtio_gpu,virtio_net,virtio_blk,virtio_pci, Live 0xffffffffc048a000 usb_common 16384 2 xhci_hcd,usbcore, Live 0xffffffffc047e000 virtio_ring 57344 7 virtio_console,virtio_balloon,virtio_rng,virtio_gpu,virtio_net,virtio_blk,virtio_pci, Live 0xffffffffc0466000 button 24576 0 - Live 0xffffffffc0457000 [8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) In order to keep this email from going over any size limits I will skip this unless requested in a follow up email. [8.5.] PCI information ('lspci -vvv' as root) In order to keep this email from going over any size limits I will skip this unless requested in a follow up email. [8.6.] SCSI information (from /proc/scsi/scsi) In order to keep this email from going over any size limits I will skip this unless requested in a follow up email. [8.7.] Other information that might be relevant to the problem (please look in /proc and include all information that you think to be relevant): Nothing that I know of. [X.] Other notes, patches, fixes, workarounds: The file system was originally created with mkfs.ext4. The unmodified version of the provided partition displayed these issues and in order to be able to upload the file system here (keeping it small, and not leaking proprietary files) all the files were zeroed, and unused blocks removed. The modified version shared here shows the exact same issues and all of the bug report information filled out in this email correspond to the version of the partition available in this email. . From: Jiapeng Chong To: harry.wentland@amd.com Cc: sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] drm/amd/display: use swap() in is_config_schedulable() Date: Mon, 24 Jun 2024 09:57:07 +0800 Message-Id: <20240624015707.121287-1-jiapeng.chong@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256309 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Use existing swap() function rather than duplicating its implementation. ./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c:1171:103-104: WARNING opportunity for swap(). ./drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c:1231:99-100: WARNING opportunity for swap(). Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9400 Signed-off-by: Jiapeng Chong --- .../dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c index 7272a04b9d1d..926d45496e79 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c @@ -1158,7 +1158,6 @@ static bool is_config_schedulable( schedulable = true; /* sort disallow times from greatest to least */ - unsigned int temp; for (i = 0; i < s->pmo_dcn4.num_timing_groups; i++) { bool swapped = false; @@ -1167,9 +1166,8 @@ static bool is_config_schedulable( double jp1_disallow_us = s->pmo_dcn4.group_common_fams2_meta[s->pmo_dcn4.sorted_group_gtl_disallow_index[j + 1]].disallow_time_us; if (j_disallow_us < jp1_disallow_us) { /* swap as A < B */ - temp = s->pmo_dcn4.sorted_group_gtl_disallow_index[j]; - s->pmo_dcn4.sorted_group_gtl_disallow_index[j] = s->pmo_dcn4.sorted_group_gtl_disallow_index[j + 1]; - s->pmo_dcn4.sorted_group_gtl_disallow_index[j + 1] = temp; + swap(s->pmo_dcn4.sorted_group_gtl_disallow_index[j], + s->pmo_dcn4.sorted_group_gtl_disallow_index[j+1]); swapped = true; } } @@ -1227,9 +1225,8 @@ static bool is_config_schedulable( double jp1_period_us = s->pmo_dcn4.group_common_fams2_meta[s->pmo_dcn4.sorted_group_gtl_period_index[j + 1]].period_us; if (j_period_us < jp1_period_us) { /* swap as A < B */ - temp = s->pmo_dcn4.sorted_group_gtl_period_index[j]; - s->pmo_dcn4.sorted_group_gtl_period_index[j] = s->pmo_dcn4.sorted_group_gtl_period_index[j + 1]; - s->pmo_dcn4.sorted_group_gtl_period_index[j + 1] = temp; + swap(s->pmo_dcn4.sorted_group_gtl_period_index[j], + s->pmo_dcn4.sorted_group_gtl_period_index[j+1]); swapped = true; } } -- 2.20.1.7.g153144c . Return-Path: From: Drew Fustini Subject: [PATCH v2 0/7] clk: thead: Add support for TH1520 AP_SUBSYS clock controller Date: Sun, 23 Jun 2024 19:12:30 -0700 Message-Id: <20240623-th1520-clk-v2-0-ad8d6432d9fb@tenstorrent.com> MIME-Version: 1.0 To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini , Conor Dooley X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Xref: photonic.trudheim.com org.infradead.lists.linux-riscv:78910 org.kernel.vger.linux-kernel:1256317 Newsgroups: org.infradead.lists.linux-riscv,org.kernel.vger.linux-clk,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This series adds support for the AP sub-system clock controller in the T-Head TH1520 [1]. Yangtao Li originally submitted this series in May 2023 [2]. Jisheng made additional improvements and then passed on the work in progress to me. Changes in v2: - Add clock property to the gpio nodes after Conor asked why they were missing. These clock gates correspond to enable bits in PERI_CLK_CFG. - Drop 2 cell address and size properties from the binding example per Conor and add Reviewed-by from from Conor. Changes in v1: - Split th1520_clks into groups for gate, mux, div, pll - Convert gate clocks to devm_clk_hw_register_gate_parent_data() - Convert mux clocks to devm_clk_hw_register_mux_parent_data_table() - Split the PLL recalculation into th1520_pll_vco_recalc_rate() and th1520_pll_postdiv_recalc_rate(). Based on Emil's comments in v1, add logic to handle the fractional portion of feedback divide value when the delta-sigma modulator (DSM) is active. - Drop clock-names from the binding per Stephan to avoid relying on anything other than the cell index when describing clk_parent_data (note: I dropped Rob's Rb because I changed the binding patch) - Rename reg/reg2 to cfg0/cfg1 to match the SoC documentation - Rename struct for pll clocks from ccu_mdiv to ccu_pll - Rebase on v6.10-rc3, remove the dts node reordering patch from v3 now that it is in mainline Changes in RFC v3 [3]: - Drop redundant new line and unused clk label from the dts example in the DT binding which I failed to fix in v2. - Add patch [4] from Thomas Bonnefille that fixes dts node ordering in th1520.dtsi. Conor has already merged it into riscv-dt-for-next so the dts patches in this series are based on top of that. - Remove fixed uart clock and converted uart DT nodes to use clocks from the clock controller. - Remove fixed apb clock and converted the dma controller and timer DT nodes to use a clock from the clock controller. - Made ccu_disable_helper() and ccu_enable_helper() to static functions - Follow the advice from Stephen Boyd in Yangtao's original series to not use strings for clk tree topology. Created clk_parent_data arrays to be used with CLK_HW_INIT_PARENTS_DATA instead of parent strings. - Rebase on top of v6.9-rc7 Changes in RFC v2 [5]: - squash the header file patch into the DT schema patch - describe the changes I made to original series in the cover letter instead of the individual patches - fix my typo in my email address Changes in RFC v1 [6] from the original series: - corrected the npu_clk enable bit - deduplicated CLK_NPU and CLK_NPU_AXI number in header - fixed c910_i0_clk reg typo - fixed checkpatch and dt_binding_check warnings - rebased on v6.9-rc5 - revised commit descriptions Thank you, Drew [1] https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf [2] https://lore.kernel.org/all/20230515054402.27633-1-frank.li@vivo.com/ [3] https://lore.kernel.org/all/20240506-th1520-clk-v3-0-085a18a23a7f@tenstorrent.com/ [4] https://lore.kernel.org/all/20240425082138.374445-1-thomas.bonnefille@bootlin.com/ [5] https://lore.kernel.org/all/20240426-th1520-clk-v2-v2-0-96b829e6fcee@tenstorrent.com/ [6] https://lore.kernel.org/all/20240110-clk-th1520-v1-0-8b0682567984@tenstorrent.com/ To: Jisheng Zhang To: Guo Ren To: Fu Wei To: Yangtao Li To: Thomas Bonnefille To: Emil Renner Berthing To: Michael Turquette To: Stephen Boyd To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Paul Walmsley To: Palmer Dabbelt To: Albert Ou Cc: linux-riscv@lists.infradead.org Cc: linux-clk@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Drew Fustini --- Drew Fustini (7): dt-bindings: clock: Document T-Head TH1520 AP_SUBSYS controller clk: thead: Add support for T-Head TH1520 AP_SUBSYS clocks riscv: dts: thead: Add TH1520 AP_SUBSYS clock controller riscv: dts: thead: change TH1520 uart nodes to use clock controller riscv: dts: thead: change TH1520 mmc nodes to use clock controller riscv: dts: thead: update TH1520 dma and timer nodes to use clock controller riscv: dts: thead: add clock to TH1520 gpio nodes .../bindings/clock/thead,th1520-clk-ap.yaml | 53 + MAINTAINERS | 3 + arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 12 - .../boot/dts/thead/th1520-lichee-module-4a.dtsi | 12 - arch/riscv/boot/dts/thead/th1520.dtsi | 73 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/thead/Kconfig | 12 + drivers/clk/thead/Makefile | 2 + drivers/clk/thead/clk-th1520-ap.c | 1086 ++++++++++++++++++++ include/dt-bindings/clock/thead,th1520-clk-ap.h | 96 ++ 11 files changed, 1290 insertions(+), 61 deletions(-) --- base-commit: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 change-id: 20240622-th1520-clk-e813a97b9e16 Best regards, -- Drew Fustini _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . From: YijieYang To: , , , , , , , , CC: , , , , , Subject: [PATCH v2] dt-bindings: phy: qcom,qmp-usb: fix spelling error Date: Mon, 24 Jun 2024 10:19:16 +0800 Message-ID: <20240624021916.2033062-1-quic_yijiyang@quicinc.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-QCInternal: smtphost Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256321 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-phy,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Yijie Yang Correct the spelling error, changing 'com' to 'qcom'. Cc: stable@vger.kernel.org Fixes: f75a4b3a6efc ("dt-bindings: phy: qcom,qmp-usb: Add QDU1000 USB3 PHY") Signed-off-by: Yijie Yang --- v1 -> v2: - add 'Fixes' and 'Cc-stable' tags previous discussion here: [1] v1: https://lore.kernel.org/all/20240621061521.332567-1-quic_yijiyang@quicinc.com/ --- .../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml index 5755245ecfd6..0e0b6cae07bc 100644 --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml @@ -20,7 +20,7 @@ properties: - qcom,ipq8074-qmp-usb3-phy - qcom,ipq9574-qmp-usb3-phy - qcom,msm8996-qmp-usb3-phy - - com,qdu1000-qmp-usb3-uni-phy + - qcom,qdu1000-qmp-usb3-uni-phy - qcom,sa8775p-qmp-usb3-uni-phy - qcom,sc8180x-qmp-usb3-uni-phy - qcom,sc8280xp-qmp-usb3-uni-phy base-commit: b992b79ca8bc336fa8e2c80990b5af80ed8f36fd -- 2.34.1 . From: Jiapeng Chong To: alexander.deucher@amd.com Cc: christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] drm/amd/display: Remove unused function reverse_planes_order Date: Mon, 24 Jun 2024 10:22:25 +0800 Message-Id: <20240624022225.28655-1-jiapeng.chong@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256324 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The function are defined in the amdgpu_dm.c file, but not called anywhere, so delete the unused function. drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:371:20: warning: unused function 'reverse_planes_order'. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9402 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 4b86b30eddc4..1e0e33b565f1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -368,15 +368,6 @@ static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state, return false; } -static inline void reverse_planes_order(struct dc_surface_update *array_of_surface_update, - int planes_count) -{ - int i, j; - - for (i = 0, j = planes_count - 1; i < j; i++, j--) - swap(array_of_surface_update[i], array_of_surface_update[j]); -} - /* * DC will program planes with their z-order determined by their ordering * in the dc_surface_updates array. This comparator is used to sort them -- 2.20.1.7.g153144c . From: Jinjie Ruan To: , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v2] ARM: Add support for STACKLEAK gcc plugin Date: Mon, 24 Jun 2024 10:36:12 +0800 Message-ID: <20240624023612.2134144-1-ruanjinjie@huawei.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256327 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-efi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add the STACKLEAK gcc plugin to arm32 by adding the helper used by stackleak common code: on_thread_stack(). It initialize the stack with the poison value before returning from system calls which improves the kernel security. Additionally, this disables the plugin in EFI stub code and decompress code, which are out of scope for the protection. Before the test on Qemu versatilepb board: # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT lkdtm: Performing direct entry STACKLEAK_ERASING lkdtm: XFAIL: stackleak is not supported on this arch (HAVE_ARCH_STACKLEAK=n) After: # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT lkdtm: Performing direct entry STACKLEAK_ERASING lkdtm: stackleak stack usage: high offset: 80 bytes current: 280 bytes lowest: 696 bytes tracked: 696 bytes untracked: 192 bytes poisoned: 7220 bytes low offset: 4 bytes lkdtm: OK: the rest of the thread stack is properly erased Signed-off-by: Jinjie Ruan Acked-by: Ard Biesheuvel --- v2: - Make on_thread_stack() more legible. - Add Acked-by. --- arch/arm/Kconfig | 1 + arch/arm/boot/compressed/Makefile | 1 + arch/arm/include/asm/stacktrace.h | 7 +++++++ arch/arm/kernel/entry-common.S | 3 +++ drivers/firmware/efi/libstub/Makefile | 3 ++- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 036381c5d42f..b211b7f5a138 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -86,6 +86,7 @@ config ARM select HAVE_ARCH_PFN_VALID select HAVE_ARCH_SECCOMP select HAVE_ARCH_SECCOMP_FILTER if AEABI && !OABI_COMPAT + select HAVE_ARCH_STACKLEAK select HAVE_ARCH_THREAD_STRUCT_WHITELIST select HAVE_ARCH_TRACEHOOK select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 6bca03c0c7f0..945b5975fce2 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -9,6 +9,7 @@ OBJS = HEAD = head.o OBJS += misc.o decompress.o +CFLAGS_decompress.o += $(DISABLE_STACKLEAK_PLUGIN) ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y) OBJS += debug.o AFLAGS_head.o += -DDEBUG diff --git a/arch/arm/include/asm/stacktrace.h b/arch/arm/include/asm/stacktrace.h index 360f0d2406bf..f80a85b091d6 100644 --- a/arch/arm/include/asm/stacktrace.h +++ b/arch/arm/include/asm/stacktrace.h @@ -26,6 +26,13 @@ struct stackframe { #endif }; +static inline bool on_thread_stack(void) +{ + unsigned long delta = current_stack_pointer ^ (unsigned long)current->stack; + + return delta < THREAD_SIZE; +} + static __always_inline void arm_get_current_stackframe(struct pt_regs *regs, struct stackframe *frame) { diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 5c31e9de7a60..f379c852dcb7 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -119,6 +119,9 @@ no_work_pending: ct_user_enter save = 0 +#ifdef CONFIG_GCC_PLUGIN_STACKLEAK + bl stackleak_erase_on_task_stack +#endif restore_user_regs fast = 0, offset = 0 ENDPROC(ret_to_user_from_irq) ENDPROC(ret_to_user) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 06f0428a723c..20d8a491f25f 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -27,7 +27,8 @@ cflags-$(CONFIG_ARM64) += -fpie $(DISABLE_STACKLEAK_PLUGIN) \ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \ -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \ -DEFI_HAVE_STRCMP -fno-builtin -fpic \ - $(call cc-option,-mno-single-pic-base) + $(call cc-option,-mno-single-pic-base) \ + $(DISABLE_STACKLEAK_PLUGIN) cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax cflags-$(CONFIG_LOONGARCH) += -fpie -- 2.34.1 . From: "Peng Fan (OSS)" To: abelvesa@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: imx@lists.linux.dev, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , kernel test robot Subject: [PATCH] clk: imx: composite-7ulp: Use NULL instead of 0 Date: Mon, 24 Jun 2024 10:43:51 +0800 Message-Id: <20240624024351.488492-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256328 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.imx,org.kernel.vger.linux-clk Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Peng Fan Address the sparse warnings " sparse warnings: (new ones prefixed by >>) >> drivers/clk/imx/clk-composite-7ulp.c:85:24: sparse: sparse: Using plain integer as NULL pointer " Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406220536.JnAncjqz-lkp@intel.com/ Signed-off-by: Peng Fan --- V1: Since the orignal patch is still in linux-next tree, so not add fixes tag drivers/clk/imx/clk-composite-7ulp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-composite-7ulp.c b/drivers/clk/imx/clk-composite-7ulp.c index db7f40b07d1a..8ed2e0ad2769 100644 --- a/drivers/clk/imx/clk-composite-7ulp.c +++ b/drivers/clk/imx/clk-composite-7ulp.c @@ -82,7 +82,7 @@ static struct clk_hw *imx_ulp_clk_hw_composite(const char *name, val = readl(reg); if (!(val & PCG_PR_MASK)) { pr_info("PCC PR is 0 for clk:%s, bypass\n", name); - return 0; + return NULL; } if (mux_present) { -- 2.37.1 . From: Jiapeng Chong To: yannick.fertre@foss.st.com Cc: raphael.gallais-pou@foss.st.com, philippe.cornu@foss.st.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] drm/stm: ltdc: Remove unused function plane_to_ltdc Date: Mon, 24 Jun 2024 10:41:13 +0800 Message-Id: <20240624024113.54850-1-jiapeng.chong@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256332 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-arm-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The function are defined in the ltdc.c file, but not called anywhere, so delete the unused function. drivers/gpu/drm/stm/ltdc.c:494:35: warning: unused function 'encoder_to_ltdc'. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9403 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/stm/ltdc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 5576fdae4962..3f280155e25c 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -491,11 +491,6 @@ static inline struct ltdc_device *plane_to_ltdc(struct drm_plane *plane) return (struct ltdc_device *)plane->dev->dev_private; } -static inline struct ltdc_device *encoder_to_ltdc(struct drm_encoder *enc) -{ - return (struct ltdc_device *)enc->dev->dev_private; -} - static inline enum ltdc_pix_fmt to_ltdc_pixelformat(u32 drm_fmt) { enum ltdc_pix_fmt pf; -- 2.20.1.7.g153144c . From: Lu Baolu To: iommu@lists.linux.dev Cc: Joerg Roedel , Will Deacon , Robin Murphy , linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 1/1] iommu/vt-d: Remove comment for def_domain_type Date: Mon, 24 Jun 2024 10:43:27 +0800 Message-Id: <20240624024327.234979-1-baolu.lu@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256334 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.iommu Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The comment for def_domain_type is outdated. Part of it is irrelevant. Furthermore, it could just be deleted since the iommu_ops::def_domain_type callback is properly documented in iommu.h, so individual implementations shouldn't need to repeat that. Remove it to avoid confusion. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index ccde5f5972e4..640081933aed 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -2177,17 +2177,6 @@ static bool device_rmrr_is_relaxable(struct device *dev) return false; } -/* - * Return the required default domain type for a specific device. - * - * @dev: the device in query - * @startup: true if this is during early boot - * - * Returns: - * - IOMMU_DOMAIN_DMA: device requires a dynamic mapping domain - * - IOMMU_DOMAIN_IDENTITY: device requires an identical mapping domain - * - 0: both identity and dynamic domains work for this device - */ static int device_def_domain_type(struct device *dev) { if (dev_is_pci(dev)) { -- 2.34.1 . From: Ma Ke To: harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, wenjing.liu@amd.com, jun.lei@amd.com, hamza.mahfooz@amd.com, alex.hung@amd.com, alvin.lee2@amd.com, george.shen@amd.com, dillon.varone@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ma Ke Subject: [PATCH] drm/amd/display: Check pipe_ctx before it is used Date: Mon, 24 Jun 2024 10:48:35 +0800 Message-Id: <20240624024835.2278651-1-make24@iscas.ac.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256335 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail resource_get_otg_master_for_stream() could return NULL, we should check the return value of 'otg_master' before it is used in resource_log_pipe_for_stream(). Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 15819416a2f3..597ca9f369c6 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2279,6 +2279,8 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state) state->stream_status[stream_idx].mall_stream_config.paired_stream); otg_master = resource_get_otg_master_for_stream( &state->res_ctx, state->streams[phantom_stream_idx]); + if (!otg_master) + continue; resource_log_pipe_for_stream(dc, state, otg_master, stream_idx); } } -- 2.25.1 . From: Jiapeng Chong To: djakov@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] interconnect: mediatek: remove unneeded semicolon Date: Mon, 24 Jun 2024 10:53:26 +0800 Message-Id: <20240624025326.69551-1-jiapeng.chong@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256336 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail No functional modification involved. ./drivers/interconnect/mediatek/icc-emi.c:71:2-3: Unneeded semicolon. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9401 Signed-off-by: Jiapeng Chong --- drivers/interconnect/mediatek/icc-emi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/mediatek/icc-emi.c b/drivers/interconnect/mediatek/icc-emi.c index d420c55682d0..7da740b5fa8d 100644 --- a/drivers/interconnect/mediatek/icc-emi.c +++ b/drivers/interconnect/mediatek/icc-emi.c @@ -68,7 +68,7 @@ static int mtk_emi_icc_set(struct icc_node *src, struct icc_node *dst) default: dev_err(src->provider->dev, "Unknown endpoint %u\n", node->ep); return -EINVAL; - }; + } return 0; } -- 2.20.1.7.g153144c . From: Chris Packham To: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chris Packham , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Landen Chao , DENG Qingfang , Sean Wang , Daniel Golle Subject: [PATCH] dt-bindings: net: dsa: mediatek,mt7530: Minor grammar fixes Date: Mon, 24 Jun 2024 14:58:11 +1200 Message-ID: <20240624025812.1729229-1-chris.packham@alliedtelesis.co.nz> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=6678e0c8 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=Mc0CNVgLlbBwIVVfR90A:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256337 org.kernel.vger.netdev:354828 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.linux-devicetree,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Update the mt7530 binding with some minor updates that make the document easier to read. Signed-off-by: Chris Packham --- Notes: I was referring to this dt binding and found a couple of places where the wording could be improved. I'm not exactly a techical writer but hopefully I've made things a bit better. .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.ya= ml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 1c2444121e60..6c0abb020631 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -22,16 +22,16 @@ description: | =20 The MT7988 SoC comes with a built-in switch similar to MT7531 as well = as four Gigabit Ethernet PHYs. The switch registers are directly mapped into t= he SoC's - memory map rather than using MDIO. The switch got an internally connec= ted 10G + memory map rather than using MDIO. The switch has an internally connec= ted 10G CPU port and 4 user ports connected to the built-in Gigabit Ethernet P= HYs. =20 - MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has got 10/1= 00 PHYs + MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs have 10/100 = PHYs and the switch registers are directly mapped into SoC's memory map rat= her than using MDIO. The DSA driver currently doesn't support MT7620 variants. =20 There is only the standalone version of MT7531. =20 - Port 5 on MT7530 has got various ways of configuration: + Port 5 on MT7530 supports various configurations: =20 - Port 5 can be used as a CPU port. =20 --=20 2.45.2 . From: "Ethan D. Twardy" To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Martin Rodriguez Reboredo , "Ethan D. Twardy" , Trevor Gross , Aswin Unnikrishnan , rust-for-linux@vger.kernel.org (open list:RUST), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 0/4] Enable rustdoc tests for the macros crate Date: Sun, 23 Jun 2024 22:03:02 -0500 Message-ID: <20240624030327.90301-1-ethan.twardy@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256339 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch series addresses GitHub issue Rust-For-Linux/linux#1076 by enabling the rustdoc tests for the macros crate and updating kbuild to compile these tests with appropriate dependencies respected. Reviewers: Please pay particular attention to the Kbuild changes in rust/Makefile. I appreciate your time in reviewing this series! Ethan D. Twardy (4): kbuild: rust: Expand rusttest target for macros rust: Enable test for macros::module rust: macros: Enable use from macro_rules! rust: macros: Enable the rest of the tests rust/Makefile | 37 ++++++++++++- rust/macros/lib.rs | 127 ++++++++++++++++++++++++++++++++----------- rust/macros/paste.rs | 15 ++++- 3 files changed, 142 insertions(+), 37 deletions(-) base-commit: a126eca844353360ebafa9088d22865cb8e022e3 -- 2.44.2 . From: Jeongjun Park To: clm@fb.com, dsterba@suse.com, josef@toxicpanda.com Cc: syzbot+a0d1f7e26910be4dc171@syzkaller.appspotmail.com, fdmanana@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Jeongjun Park Subject: [PATCH] btrfs: qgroup: fix slab-out-of-bounds in btrfs_qgroup_inherit Date: Mon, 24 Jun 2024 12:07:20 +0900 Message-Id: <20240624030720.137753-1-aha310510@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256345 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-btrfs Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail If a value exists in inherit->num_ref_copies or inherit->num_excl_copies, an out-of-bounds vulnerability occurs. Therefore, you need to add code to check the presence or absence of that value. Regards. Jeongjun Park. Reported-by: syzbot+a0d1f7e26910be4dc171@syzkaller.appspotmail.com Fixes: 3f5e2d3b3877 ("Btrfs: fix missing check in the btrfs_qgroup_inherit()") Signed-off-by: Jeongjun Park --- fs/btrfs/qgroup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/qgroup.c b /fs/btrfs/qgroup.c index fc2a7ea26354..23beac746637 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -3270,6 +3270,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, u64 srcid, } if (inherit) { + if (inherit->num_ref_copies > 0 || inherit->num_excl_copies > 0) { + ret = -EINVAL; + goto out; + } i_qgroups = (u64 *)(inherit + 1); nums = inherit->num_qgroups + 2 * inherit->num_ref_copies + 2 * inherit->num_excl_copies; -- . From: Jiapeng Chong To: harry.wentland@amd.com Cc: sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] drm/amd/display: Use ARRAY_SIZE for array length Date: Mon, 24 Jun 2024 11:11:58 +0800 Message-Id: <20240624031158.98502-1-jiapeng.chong@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256346 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Use of macro ARRAY_SIZE to calculate array size minimizes the redundant code and improves code reusability. ./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:164:45-46: WARNING: Use ARRAY_SIZE. ./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:183:47-48: WARNING: Use ARRAY_SIZE. ./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:237:45-46: WARNING: Use ARRAY_SIZE. ./drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c:257:47-48: WARNING: Use ARRAY_SIZE. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9405 Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c index 1b2df97226a3..7ecf76aea950 100644 --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c @@ -161,8 +161,7 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp, return MOD_HDCP_STATUS_DDC_FAILURE; if (is_dp_hdcp(hdcp)) { - int num_dpcd_addrs = sizeof(hdcp_dpcd_addrs) / - sizeof(hdcp_dpcd_addrs[0]); + int num_dpcd_addrs = ARRAY_SIZE(hdcp_dpcd_addrs); if (msg_id >= num_dpcd_addrs) return MOD_HDCP_STATUS_DDC_FAILURE; @@ -180,8 +179,7 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp, data_offset += cur_size; } } else { - int num_i2c_offsets = sizeof(hdcp_i2c_offsets) / - sizeof(hdcp_i2c_offsets[0]); + int num_i2c_offsets = ARRAY_SIZE(hdcp_i2c_offsets); if (msg_id >= num_i2c_offsets) return MOD_HDCP_STATUS_DDC_FAILURE; @@ -234,8 +232,7 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp, return MOD_HDCP_STATUS_DDC_FAILURE; if (is_dp_hdcp(hdcp)) { - int num_dpcd_addrs = sizeof(hdcp_dpcd_addrs) / - sizeof(hdcp_dpcd_addrs[0]); + int num_dpcd_addrs = ARRAY_SIZE(hdcp_dpcd_addrs); if (msg_id >= num_dpcd_addrs) return MOD_HDCP_STATUS_DDC_FAILURE; @@ -254,8 +251,7 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp, data_offset += cur_size; } } else { - int num_i2c_offsets = sizeof(hdcp_i2c_offsets) / - sizeof(hdcp_i2c_offsets[0]); + int num_i2c_offsets = ARRAY_SIZE(hdcp_i2c_offsets); if (msg_id >= num_i2c_offsets) return MOD_HDCP_STATUS_DDC_FAILURE; -- 2.20.1.7.g153144c . From: Lu Baolu To: Joerg Roedel , Kevin Tian , Yi Liu , Jacob Pan Cc: Will Deacon , Robin Murphy , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 1/1] iommu/vt-d: Remove control over Execute-Requested requests Date: Mon, 24 Jun 2024 11:23:51 +0800 Message-Id: <20240624032351.249858-1-baolu.lu@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256349 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.iommu Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The VT-d specification has removed architectural support of the requests with pasid with a value of 1 for Execute-Requested (ER). And the NXE bit in the pasid table entry and XD bit in the first-stage paging Entries are deprecated accordingly. Remove the programming of these bits to make it consistent with the spec. Suggested-by: Jacob Pan Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.h | 6 ++---- drivers/iommu/intel/pasid.h | 10 ---------- drivers/iommu/intel/iommu.c | 4 ++-- drivers/iommu/intel/pasid.c | 1 - 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h index eaf015b4353b..9a3b064126de 100644 --- a/drivers/iommu/intel/iommu.h +++ b/drivers/iommu/intel/iommu.h @@ -49,7 +49,6 @@ #define DMA_FL_PTE_US BIT_ULL(2) #define DMA_FL_PTE_ACCESS BIT_ULL(5) #define DMA_FL_PTE_DIRTY BIT_ULL(6) -#define DMA_FL_PTE_XD BIT_ULL(63) #define DMA_SL_PTE_DIRTY_BIT 9 #define DMA_SL_PTE_DIRTY BIT_ULL(DMA_SL_PTE_DIRTY_BIT) @@ -831,11 +830,10 @@ static inline void dma_clear_pte(struct dma_pte *pte) static inline u64 dma_pte_addr(struct dma_pte *pte) { #ifdef CONFIG_64BIT - return pte->val & VTD_PAGE_MASK & (~DMA_FL_PTE_XD); + return pte->val & VTD_PAGE_MASK; #else /* Must have a full atomic 64-bit read */ - return __cmpxchg64(&pte->val, 0ULL, 0ULL) & - VTD_PAGE_MASK & (~DMA_FL_PTE_XD); + return __cmpxchg64(&pte->val, 0ULL, 0ULL) & VTD_PAGE_MASK; #endif } diff --git a/drivers/iommu/intel/pasid.h b/drivers/iommu/intel/pasid.h index da9978fef7ac..dde6d3ba5ae0 100644 --- a/drivers/iommu/intel/pasid.h +++ b/drivers/iommu/intel/pasid.h @@ -247,16 +247,6 @@ static inline void pasid_set_page_snoop(struct pasid_entry *pe, bool value) pasid_set_bits(&pe->val[1], 1 << 23, value << 23); } -/* - * Setup No Execute Enable bit (Bit 133) of a scalable mode PASID - * entry. It is required when XD bit of the first level page table - * entry is about to be set. - */ -static inline void pasid_set_nxe(struct pasid_entry *pe) -{ - pasid_set_bits(&pe->val[2], 1 << 5, 1 << 5); -} - /* * Setup the Page Snoop (PGSNP) field (Bit 88) of a scalable mode * PASID entry. diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 2e9811bf2a4e..0ea1f2183f93 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -854,7 +854,7 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE); pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE; if (domain->use_first_level) - pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS; + pteval |= DMA_FL_PTE_US | DMA_FL_PTE_ACCESS; tmp = 0ULL; if (!try_cmpxchg64(&pte->val, &tmp, pteval)) @@ -1872,7 +1872,7 @@ __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, attr = prot & (DMA_PTE_READ | DMA_PTE_WRITE | DMA_PTE_SNP); attr |= DMA_FL_PTE_PRESENT; if (domain->use_first_level) { - attr |= DMA_FL_PTE_XD | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS; + attr |= DMA_FL_PTE_US | DMA_FL_PTE_ACCESS; if (prot & DMA_PTE_WRITE) attr |= DMA_FL_PTE_DIRTY; } diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index abce19e2ad6f..aabcdf756581 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -333,7 +333,6 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu, pasid_set_domain_id(pte, did); pasid_set_address_width(pte, iommu->agaw); pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap)); - pasid_set_nxe(pte); /* Setup Present and PASID Granular Transfer Type: */ pasid_set_translation_type(pte, PASID_ENTRY_PGTT_FL_ONLY); -- 2.34.1 . From: Shengjiu Wang To: p.zabel@pengutronix.de, abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, marex@denx.de, linux-clk@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com Subject: [PATCH v9] reset: imx8mp-audiomix: Add AudioMix Block Control reset driver Date: Mon, 24 Jun 2024 11:39:05 +0800 Message-Id: <1719200345-32006-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256354 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-clk,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add support for the resets on i.MX8MP Audio Block Control module, which includes the EARC PHY software reset and EARC controller software reset. The reset controller is created using the auxiliary device framework and set up in the clock driver. Signed-off-by: Shengjiu Wang Reviewed-by: Marco Felsch --- changes in v9: - only send this commits because others have been applied - remove depends on in config - add spin lock - call iounmmap() changes in v8: https://lore.kernel.org/linux-arm-kernel/27ea1bf7de6f349426fcd7ddb056a1adfae47c73.camel@pengutronix.de/T/ drivers/reset/Kconfig | 7 ++ drivers/reset/Makefile | 1 + drivers/reset/reset-imx8mp-audiomix.c | 128 ++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 drivers/reset/reset-imx8mp-audiomix.c diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 7112f5932609..509f70e5c4c0 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -91,6 +91,13 @@ config RESET_IMX7 help This enables the reset controller driver for i.MX7 SoCs. +config RESET_IMX8MP_AUDIOMIX + tristate "i.MX8MP AudioMix Reset Driver" + select AUXILIARY_BUS + default CLK_IMX8MP + help + This enables the reset controller driver for i.MX8MP AudioMix + config RESET_INTEL_GW bool "Intel Reset Controller Driver" depends on X86 || COMPILE_TEST diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index fd8b49fa46fc..a6796e83900b 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_RESET_BRCMSTB_RESCAL) += reset-brcmstb-rescal.o obj-$(CONFIG_RESET_GPIO) += reset-gpio.o obj-$(CONFIG_RESET_HSDK) += reset-hsdk.o obj-$(CONFIG_RESET_IMX7) += reset-imx7.o +obj-$(CONFIG_RESET_IMX8MP_AUDIOMIX) += reset-imx8mp-audiomix.o obj-$(CONFIG_RESET_INTEL_GW) += reset-intel-gw.o obj-$(CONFIG_RESET_K210) += reset-k210.o obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c new file mode 100644 index 000000000000..6e3f3069f727 --- /dev/null +++ b/drivers/reset/reset-imx8mp-audiomix.c @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright 2024 NXP + */ + +#include +#include +#include +#include +#include +#include +#include + +#define EARC 0x200 +#define EARC_RESET_MASK 0x3 + +struct imx8mp_audiomix_reset { + struct reset_controller_dev rcdev; + spinlock_t lock; /* protect register read-modify-write cycle */ + void __iomem *base; +}; + +static struct imx8mp_audiomix_reset *to_imx8mp_audiomix_reset(struct reset_controller_dev *rcdev) +{ + return container_of(rcdev, struct imx8mp_audiomix_reset, rcdev); +} + +static int imx8mp_audiomix_reset_assert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev); + void __iomem *reg_addr = priv->base; + unsigned int mask, reg; + unsigned long flags; + + mask = BIT(id); + spin_lock_irqsave(&priv->lock, flags); + reg = readl(reg_addr + EARC); + writel(reg & ~mask, reg_addr + EARC); + spin_unlock_irqrestore(&priv->lock, flags); + + return 0; +} + +static int imx8mp_audiomix_reset_deassert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + struct imx8mp_audiomix_reset *priv = to_imx8mp_audiomix_reset(rcdev); + void __iomem *reg_addr = priv->base; + unsigned int mask, reg; + unsigned long flags; + + mask = BIT(id); + spin_lock_irqsave(&priv->lock, flags); + reg = readl(reg_addr + EARC); + writel(reg | mask, reg_addr + EARC); + spin_unlock_irqrestore(&priv->lock, flags); + + return 0; +} + +static const struct reset_control_ops imx8mp_audiomix_reset_ops = { + .assert = imx8mp_audiomix_reset_assert, + .deassert = imx8mp_audiomix_reset_deassert, +}; + +static int imx8mp_audiomix_reset_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct imx8mp_audiomix_reset *priv; + struct device *dev = &adev->dev; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + spin_lock_init(&priv->lock); + + priv->rcdev.owner = THIS_MODULE; + priv->rcdev.nr_resets = fls(EARC_RESET_MASK); + priv->rcdev.ops = &imx8mp_audiomix_reset_ops; + priv->rcdev.of_node = dev->parent->of_node; + priv->rcdev.dev = dev; + priv->rcdev.of_reset_n_cells = 1; + priv->base = of_iomap(dev->parent->of_node, 0); + if (!priv->base) + return -ENOMEM; + + dev_set_drvdata(dev, priv); + + ret = devm_reset_controller_register(dev, &priv->rcdev); + if (ret) + goto out_unmap; + + return 0; + +out_unmap: + iounmap(priv->base); + return ret; +} + +static void imx8mp_audiomix_reset_remove(struct auxiliary_device *adev) +{ + struct imx8mp_audiomix_reset *priv = dev_get_drvdata(&adev->dev); + + iounmap(priv->base); +} + +static const struct auxiliary_device_id imx8mp_audiomix_reset_ids[] = { + { + .name = "clk_imx8mp_audiomix.reset", + }, + { } +}; +MODULE_DEVICE_TABLE(auxiliary, imx8mp_audiomix_reset_ids); + +static struct auxiliary_driver imx8mp_audiomix_reset_driver = { + .probe = imx8mp_audiomix_reset_probe, + .remove = imx8mp_audiomix_reset_remove, + .id_table = imx8mp_audiomix_reset_ids, +}; + +module_auxiliary_driver(imx8mp_audiomix_reset_driver); + +MODULE_AUTHOR("Shengjiu Wang "); +MODULE_DESCRIPTION("Freescale i.MX8MP Audio Block Controller reset driver"); +MODULE_LICENSE("GPL"); -- 2.34.1 . Date: Mon, 24 Jun 2024 12:20:21 +0800 From: kernel test robot To: Jiaxun Yang Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Thomas Bogendoerfer Subject: error: ABI 'o32' is not supported on CPU 'mips4' Message-ID: <202406241220.InhXAWQe-lkp@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256362 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.oe-kbuild-all Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: f2661062f16b2de5d7b6a5c42a9a5c96326b8454 commit: bfc0a330c1b4526b88f6f9e711484b342cb00fb5 MIPS: Fallback CPU -march flag to ISA level if unsupported date: 4 months ago config: mips-randconfig-r062-20240624 (https://download.01.org/0day-ci/archive/20240624/202406241220.InhXAWQe-lkp@intel.com/config) compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240624/202406241220.InhXAWQe-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202406241220.InhXAWQe-lkp@intel.com/ All errors (new ones prefixed by >>): >> error: ABI 'o32' is not supported on CPU 'mips4' scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr] scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr] scripts/genksyms/parse.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples >> error: ABI 'o32' is not supported on CPU 'mips4' >> error: ABI 'o32' is not supported on CPU 'mips4' make[3]: *** [scripts/Makefile.build:243: scripts/mod/empty.o] Error 1 make[3]: *** [scripts/Makefile.build:116: scripts/mod/devicetable-offsets.s] Error 1 make[3]: Target 'scripts/mod/' not remade because of errors. make[2]: *** [Makefile:1198: prepare0] Error 2 make[2]: Target 'prepare' not remade because of errors. make[1]: *** [Makefile:240: __sub-make] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [Makefile:240: __sub-make] Error 2 make: Target 'prepare' not remade because of errors. -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki . X-CID-INFO: VERSION:1.1.38,REQID:53c491e2-b8da-4ec8-862d-4f50d5d39a69,IP:15,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:5,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:45 X-User: lizhenneng@kylinos.cn From: Zhenneng Li To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] migrate_pages: modify max number of pages to migrate in batch Date: Mon, 24 Jun 2024 12:41:40 +0800 Message-Id: <20240624044140.117196-1-lizhenneng@kylinos.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256368 org.kvack.linux-mm:201050 Newsgroups: org.kernel.vger.linux-kernel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail We restrict the number of pages to be migrated to no more than HPAGE_PMD_NR or NR_MAX_BATCHED_MIGRATION, but in fact, the number of pages to be migrated may reach 2*HPAGE_PMD_NR-1 or 2 *NR_MAX_BATCHED_MIGRATION-1, it's not in inconsistent with the context. Please refer to the patch: 42012e0436d4(migrate_pages: restrict number of pages to migrate in batch) Signed-off-by: Zhenneng Li --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 781979567f64..7a4b37aac9e8 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1961,7 +1961,7 @@ int migrate_pages(struct list_head *from, new_folio_t get_new_folio, break; } if (nr_pages >= NR_MAX_BATCHED_MIGRATION) - list_cut_before(&folios, from, &folio2->lru); + list_cut_before(&folios, from, &folio->lru); else list_splice_init(from, &folios); if (mode == MIGRATE_ASYNC) -- 2.25.1 . From: Jagadeesh Kona To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Ulf Hansson , "Rafael J . Wysocki" , Kevin Hilman , Pavel Machek , Len Brown , Greg Kroah-Hartman , Konrad Dybcio , "Andy Gross" , Dmitry Baryshkov , Abel Vesa CC: , , , , , Taniya Das , "Jagadeesh Kona" , Satya Priya Kakitapalli , Imran Shaik , "Ajit Pandey" Subject: [PATCH V7 0/5] Add control for switching back and forth to HW control Date: Mon, 24 Jun 2024 10:18:04 +0530 Message-ID: <20240624044809.17751-1-quic_jkona@quicinc.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-QCInternal: smtphost Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256372 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-clk,org.kernel.vger.linux-media,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This series adds support for dev_pm_genpd_set_hwmode() and dev_pm_genpd_get_hwmode() APIs and support in gdsc genpd provider drivers to register respective callbacks and a venus consumer driver example using above API to switch the power domain(GDSC) to HW/SW modes dynamically at runtime. Changes in V7: - [PATCH 3/5]: Updated the comment description in gdsc_set_hwmode as per V6 review comments - Added R-By tags received on V6 - Link to V6: https://lore.kernel.org/all/20240619141413.7983-1-quic_jkona@quicinc.com/ Changes in V6: - [PATCH 3/5]: Added details for 1usec delay in gdsc_set_hwmode() - [PATCH 4/5]: Updated commit text - Added R-By and T-By tags received on V5 RESEND - Link to V5 RESEND: https://lore.kernel.org/all/20240413152013.22307-1-quic_jkona@quicinc.com/ - Link to V5: https://lore.kernel.org/all/20240315111046.22136-1-quic_jkona@quicinc.com/ Changes in V5: - Updated 1st patch as per V4 review comments to synchronize the initial HW mode state by invoking ->get_hwmode_dev()callback in genpd_add_device() - With above change, SW cached hwmode will contain correct value initially, and it will be updated everytime mode is changed in set_hwmode, hence updated dev_pm_genpd_get_hwmode() to just return SW cached hwmode in 1st patch - Updated commit text for 1st, 3rd, 4th and 5th patches - Updated 3rd and 5th patches as per review comments received on V4 series - Added R-By tags received in older series to 1st and 2nd patches - Link to V4: https://lore.kernel.org/all/20240122-gdsc-hwctrl-v4-0-9061e8a7aa07@linaro.org/ Changes in V4: - Re-worded 1st patch commit message, as per Bjorn's suggestion, and added Dmitry's R-b tag - Added Bjorn's and Dmitry's R-b tags to the 2nd patch - Re-worded 3rd patch commit message, to better explain the HW_CTRL_TRIGGER flag. - Added mode transition delay when setting mode for GDSC - Added status polling if GDSSC is enabled when transitioning from HW to SW - Re-worded 4th patch commit message to better explain why the HW_CTRL_TRIGGER needs to be used instead - Drop changes to SC7180, SDM845 and SM8550 video CC drivers, as only SC7280 and SM8250 have been tested so far. More platforms (with v6 venus) will be added eventually. - Call genpd set_hwmode API only for v6 and dropped the vcodec_pmdomains_hwctrl. - Re-worded 5th patch commit message accordingly. - Link to V3: https://lore.kernel.org/lkml/20230823114528.3677667-1-abel.vesa@linaro.org/ Changes in V3: - 5th patch has been squashed in the 4th one - Link to V2: https://lore.kernel.org/lkml/20230816145741.1472721-1-abel.vesa@linaro.org/ Changes in V2: - patch for printing domain HW-managed mode in the summary - patch that adds one consumer (venus) - patch for gdsc with new (different) flag - patch for videocc GDSC provider to update flags - Link to V1: https://lore.kernel.org/all/20230628105652.1670316-1-abel.vesa@linaro.org/ Abel Vesa (1): PM: domains: Add the domain HW-managed mode to the summary Jagadeesh Kona (3): clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode clk: qcom: videocc: Use HW_CTRL_TRIGGER for SM8250, SC7280 vcodec GDSC's venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode on V6 Ulf Hansson (1): PM: domains: Allow devices attached to genpd to be managed by HW drivers/clk/qcom/gdsc.c | 41 ++++++++++ drivers/clk/qcom/gdsc.h | 1 + drivers/clk/qcom/videocc-sc7280.c | 2 +- drivers/clk/qcom/videocc-sm8250.c | 4 +- .../media/platform/qcom/venus/pm_helpers.c | 39 ++++++---- drivers/pmdomain/core.c | 78 ++++++++++++++++++- include/linux/pm_domain.h | 17 ++++ 7 files changed, 161 insertions(+), 21 deletions(-) -- 2.43.0 . X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 24 Jun 2024 06:40:45 +0200 X-ME-IP: 86.243.222.230 From: Christophe JAILLET To: Benoit Parrot , Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-media@vger.kernel.org Subject: [PATCH] media: ti: cal: Constify struct media_entity_operations Date: Mon, 24 Jun 2024 06:40:38 +0200 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256378 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-media Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail 'struct media_entity_operations' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 20694 1394 32 22120 5668 drivers/media/platform/ti/cal/cal-camerarx.o After: ===== text data bss dec hex filename 20726 1362 32 22120 5668 drivers/media/platform/ti/cal/cal-camerarx.o Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/media/platform/ti/cal/cal-camerarx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti/cal/cal-camerarx.c b/drivers/media/platform/ti/cal/cal-camerarx.c index 4afc2ad00330..42dfe08b765f 100644 --- a/drivers/media/platform/ti/cal/cal-camerarx.c +++ b/drivers/media/platform/ti/cal/cal-camerarx.c @@ -798,7 +798,7 @@ static const struct v4l2_subdev_internal_ops cal_camerarx_internal_ops = { .init_state = cal_camerarx_sd_init_state, }; -static struct media_entity_operations cal_camerarx_media_ops = { +static const struct media_entity_operations cal_camerarx_media_ops = { .link_validate = v4l2_subdev_link_validate, }; -- 2.45.2 . X-CID-INFO: VERSION:1.1.38,REQID:513e5f83-4bc0-4c29-9adf-5881a04f0a2b,IP:15,UR L:0,TC:0,Content:0,EDM:-25,RT:0,SF:-1,FILE:0,BULK:0,RULE:EDM_GE969F26,ACTI ON:release,TS:-11 X-User: lizhenneng@kylinos.cn From: Zhenneng Li To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhenneng Li Subject: [PATCH] migrate_pages: modify max number of pages to migrate in batch Date: Mon, 24 Jun 2024 12:51:20 +0800 Message-Id: <20240624045120.121261-1-lizhenneng@kylinos.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256381 org.kvack.linux-mm:201051 Newsgroups: org.kernel.vger.linux-kernel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail We restrict the number of pages to be migrated to no more than HPAGE_PMD_NR or NR_MAX_BATCHED_MIGRATION, but in fact, the number of pages to be migrated may reach 2*HPAGE_PMD_NR-1 or 2 *NR_MAX_BATCHED_MIGRATION-1, it's not in inconsistent with the context. Please refer to the patch: 42012e0436d4(migrate_pages: restrict number of pages to migrate in batch) Signed-off-by: Zhenneng Li --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 781979567f64..7a4b37aac9e8 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1961,7 +1961,7 @@ int migrate_pages(struct list_head *from, new_folio_t get_new_folio, break; } if (nr_pages >= NR_MAX_BATCHED_MIGRATION) - list_cut_before(&folios, from, &folio2->lru); + list_cut_before(&folios, from, &folio->lru); else list_splice_init(from, &folios); if (mode == MIGRATE_ASYNC) -- 2.25.1 . From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 0/7] Enable CPR for IPQ9574 Date: Mon, 24 Jun 2024 10:32:47 +0530 Message-ID: <20240624050254.2942959-1-quic_varada@quicinc.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-QCInternal: smtphost Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256391 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-clk,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This series tries to enable CPR on IPQ9574, that implements CPRv4. Since [1] is older, faced few minor issues. Those are addressed in [2]. dt_binding_check and dtbs_check passed. Depends: [1] https://lore.kernel.org/lkml/20230217-topic-cpr3h-v14-0-9fd23241493d@linaro.org/T/ [2] https://github.com/quic-varada/cpr/commits/konrad/ v2: Fix Signed-off-by order in 2 patches Update constraints in qcom,cpr3.yaml Add rbcpr_clk_src registration Add Reviewed-by to one of the patches Not adding Acked-by as the file has changed Varadarajan Narayanan (7): dt-bindings: power: rpmpd: Add IPQ9574 power domains dt-bindings: soc: qcom: cpr3: Add bindings for IPQ9574 pmdomain: qcom: rpmpd: Add IPQ9574 power domains dt-bindings: clock: Add CPR clock defines for IPQ9574 clk: qcom: gcc-ipq9574: Add CPR clock definition soc: qcom: cpr3: Add IPQ9574 definitions dts: arm64: qcom: ipq9574: Enable CPR .../devicetree/bindings/power/qcom,rpmpd.yaml | 1 + .../bindings/soc/qcom/qcom,cpr3.yaml | 35 +++ arch/arm64/boot/dts/qcom/ipq9574.dtsi | 269 ++++++++++++++++-- drivers/clk/qcom/gcc-ipq9574.c | 39 +++ drivers/pmdomain/qcom/cpr3.c | 137 +++++++++ drivers/pmdomain/qcom/rpmpd.c | 19 ++ include/dt-bindings/clock/qcom,ipq9574-gcc.h | 2 + include/dt-bindings/power/qcom-rpmpd.h | 3 + 8 files changed, 488 insertions(+), 17 deletions(-) -- 2.34.1 . From: Lu Baolu To: Joerg Roedel , Kevin Tian , Yi Liu , Jacob Pan Cc: Will Deacon , Robin Murphy , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 1/2] iommu/vt-d: Convert dmar_ats_supported() to return bool Date: Mon, 24 Jun 2024 13:25:00 +0800 Message-Id: <20240624052501.253405-1-baolu.lu@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256406 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.iommu Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail dmar_ats_supported() returns an integer that is used as a boolean. Since it all it needs is to return true or false, change the return type from int to bool to make it a bit more readable and obvious. Cleanup this helper accordingly with no functional change intended. Signed-off-by: Lu Baolu --- drivers/iommu/intel/iommu.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 38cda454fc64..07e394dfccc1 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -3043,15 +3043,15 @@ static struct dmar_satc_unit *dmar_find_matched_satc_unit(struct pci_dev *dev) return satcu; } -static int dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu) +static bool dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu) { - int i, ret = 1; - struct pci_bus *bus; struct pci_dev *bridge = NULL; - struct device *tmp; - struct acpi_dmar_atsr *atsr; struct dmar_atsr_unit *atsru; struct dmar_satc_unit *satcu; + struct acpi_dmar_atsr *atsr; + struct pci_bus *bus; + struct device *tmp; + int i; dev = pci_physfn(dev); satcu = dmar_find_matched_satc_unit(dev); @@ -3069,11 +3069,11 @@ static int dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu) bridge = bus->self; /* If it's an integrated device, allow ATS */ if (!bridge) - return 1; + return true; /* Connected via non-PCIe: no ATS */ if (!pci_is_pcie(bridge) || pci_pcie_type(bridge) == PCI_EXP_TYPE_PCI_BRIDGE) - return 0; + return false; /* If we found the root port, look it up in the ATSR */ if (pci_pcie_type(bridge) == PCI_EXP_TYPE_ROOT_PORT) break; @@ -3085,18 +3085,21 @@ static int dmar_ats_supported(struct pci_dev *dev, struct intel_iommu *iommu) if (atsr->segment != pci_domain_nr(dev->bus)) continue; - for_each_dev_scope(atsru->devices, atsru->devices_cnt, i, tmp) - if (tmp == &bridge->dev) - goto out; + for_each_dev_scope(atsru->devices, atsru->devices_cnt, i, tmp) { + if (tmp == &bridge->dev) { + rcu_read_unlock(); + return true; + } + } - if (atsru->include_all) - goto out; + if (atsru->include_all) { + rcu_read_unlock(); + return true; + } } - ret = 0; -out: rcu_read_unlock(); - return ret; + return false; } int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info) -- 2.34.1 . From: Dhananjay Ugwekar To: , , , , , , , , , , , , , , , , , CC: , , , , , , , , , Dhananjay Ugwekar Subject: [PATCH v3 00/10] Add per-core RAPL energy counter support for AMD CPUs Date: Mon, 24 Jun 2024 05:58:57 +0000 Message-ID: <20240624055907.7720-1-Dhananjay.Ugwekar@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256428 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-hardening,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Currently the energy-cores event in the power PMU aggregates energy consumption data at a package level. On the other hand the core energy RAPL counter in AMD CPUs has a core scope (which means the energy consumption is recorded separately for each core). Earlier efforts to add the core event in the power PMU had failed [1], due to the difference in the scope of these two events. Hence, there is a need for a new core scope PMU. This patchset adds a new "power_per_core" PMU alongside the existing "power" PMU, which will be responsible for collecting the new "energy-per-core" event. Tested the package level and core level PMU counters with workloads pinned to different CPUs. Results with workload pinned to CPU 1 in Core 1 on an AMD Zen4 Genoa machine: $ perf stat -a --per-core -e power_per_core/energy-per-core/ -- sleep 1 Performance counter stats for 'system wide': S0-D0-C0 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C1 1 5.72 Joules power_per_core/energy-per-core/ S0-D0-C2 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C3 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C4 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C5 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C6 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C7 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C8 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C9 1 0.02 Joules power_per_core/energy-per-core/ S0-D0-C10 1 0.02 Joules power_per_core/energy-per-core/ [1]: https://lore.kernel.org/lkml/3e766f0e-37d4-0f82-3868-31b14228868d@linux.intel.com/ This patchset applies cleanly on top of v6.10-rc4 as well as latest tip/master. v3 changes: * Patch 1 added to introduce the logical_core_id which is unique across the system (Prateek) * Use the unique topology_logical_core_id() instead of topology_core_id() (which is only unique within a package on tested AMD and Intel systems) in Patch 10 v2 changes: * Patches 6,7,8 added to split some changes out of the last patch * Use container_of to get the rapl_pmus from event variable (Rui) * Set PERF_EV_CAP_READ_ACTIVE_PKG flag only for pkg scope PMU (Rui) * Use event id 0x1 for energy-per-core event (Rui) * Use PERF_RAPL_PER_CORE bit instead of adding a new flag to check for per-core counter hw support (Rui) Dhananjay Ugwekar (9): perf/x86/rapl: Fix the energy-pkg event for AMD CPUs perf/x86/rapl: Rename rapl_pmu variables perf/x86/rapl: Make rapl_model struct global perf/x86/rapl: Move cpumask variable to rapl_pmus struct perf/x86/rapl: Add wrapper for online/offline functions perf/x86/rapl: Add an argument to the cleanup and init functions perf/x86/rapl: Modify the generic variable names to *_pkg* perf/x86/rapl: Remove the global variable rapl_msrs perf/x86/rapl: Add per-core energy counter support for AMD CPUs K Prateek Nayak (1): x86/topology: Introduce topology_logical_core_id() Documentation/arch/x86/topology.rst | 4 + arch/x86/events/rapl.c | 418 ++++++++++++++++++-------- arch/x86/include/asm/processor.h | 1 + arch/x86/include/asm/topology.h | 1 + arch/x86/kernel/cpu/debugfs.c | 1 + arch/x86/kernel/cpu/topology_common.c | 1 + 6 files changed, 305 insertions(+), 121 deletions(-) -- 2.34.1 . From: Chen-Yu Tsai To: Mark Brown , AngeloGioacchino Del Regno Cc: Chen-Yu Tsai , Trevor Wu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2] ASoC: mediatek: mt8195: Add platform entry for ETDM1_OUT_BE dai link Date: Mon, 24 Jun 2024 14:12:56 +0800 Message-ID: <20240624061257.3115467-1-wenst@chromium.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256443 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.linux-sound Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Commit e70b8dd26711 ("ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link") removed the codec entry for the ETDM1_OUT_BE dai link entirely instead of replacing it with COMP_EMPTY(). This worked by accident as the remaining COMP_EMPTY() platform entry became the codec entry, and the platform entry became completely empty, effectively the same as COMP_DUMMY() since snd_soc_fill_dummy_dai() doesn't do anything for platform entries. This causes a KASAN out-of-bounds warning in mtk_soundcard_common_probe() in sound/soc/mediatek/common/mtk-soundcard-driver.c: for_each_card_prelinks(card, i, dai_link) { if (adsp_node && !strncmp(dai_link->name, "AFE_SOF", strlen("AFE_SOF"))) dai_link->platforms->of_node = adsp_node; else if (!dai_link->platforms->name && !dai_link->platforms->of_node) dai_link->platforms->of_node = platform_node; } where the code expects the platforms array to have space for at least one entry. Add an COMP_EMPTY() entry so that dai_link->platforms has space. Fixes: e70b8dd26711 ("ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link") Signed-off-by: Chen-Yu Tsai --- Changes since v1: - Reword commit message with more details on how the original commit got things wrong, and what this commit adds and fixes --- sound/soc/mediatek/mt8195/mt8195-mt6359.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c index ca8751190520..2832ef78eaed 100644 --- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c +++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c @@ -827,6 +827,7 @@ SND_SOC_DAILINK_DEFS(ETDM2_IN_BE, SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE, DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")), + DAILINK_COMP_ARRAY(COMP_EMPTY()), DAILINK_COMP_ARRAY(COMP_EMPTY())); SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE, -- 2.45.2.741.gdbec12cfda-goog . From: Maxim Anisimov To: Cc: maxim.anisimov.ua@gmail.com, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Martin Kurbanov , Michael Walle , Mark Brown , "Chia-Lin Kao (AceLan)" , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH] mtd: spinand: Add support for HeYangTek HYF1GQ4UDACAE Date: Mon, 24 Jun 2024 09:12:17 +0300 Message-ID: <20240624061246.5292-1-maxim.anisimov.ua@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256444 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-mtd Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add Support HeYangTek HYF1GQ4UDACAE SPI NAND. Datasheet Link: - https://www.heyangtek.cn/previewfile.jsp?file=ABUIABA9GAAgwsvRnwYo-eDpsgc Signed-off-by: Maxim Anisimov --- drivers/mtd/nand/spi/Makefile | 4 +- drivers/mtd/nand/spi/core.c | 1 + drivers/mtd/nand/spi/heyangtek.c | 112 +++++++++++++++++++++++++++++++ include/linux/mtd/spinand.h | 1 + 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 drivers/mtd/nand/spi/heyangtek.c diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile index 19cc77288ebb..69d95fbdd0ce 100644 --- a/drivers/mtd/nand/spi/Makefile +++ b/drivers/mtd/nand/spi/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o -spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o +spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o heyangtek.o +spinand-objs += macronix.o micron.o paragon.o toshiba.o winbond.o xtx.o obj-$(CONFIG_MTD_SPI_NAND) += spinand.o diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index e0b6715e5dfe..45795e5f1e49 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -942,6 +942,7 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = { &esmt_c8_spinand_manufacturer, &foresee_spinand_manufacturer, &gigadevice_spinand_manufacturer, + &heyangtek_spinand_manufacturer, ¯onix_spinand_manufacturer, µn_spinand_manufacturer, ¶gon_spinand_manufacturer, diff --git a/drivers/mtd/nand/spi/heyangtek.c b/drivers/mtd/nand/spi/heyangtek.c new file mode 100644 index 000000000000..d4a5dbca40fb --- /dev/null +++ b/drivers/mtd/nand/spi/heyangtek.c @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Author: + * Andrey Zolotarev - the main driver logic + * Maxim Anisimov - adaptation to mainline linux kernel + * + * Based on: + * https://github.com/keenetic/kernel-49/commit/bacade569fb12bc0ad31ba09bca9b890118fbca7 + */ + +#include +#include +#include + +#define SPINAND_MFR_HEYANGTEK 0xC9 + +#define STATUS_ECC_LIMIT_BITFLIPS (3 << 4) + +static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + +static SPINAND_OP_VARIANTS(write_cache_variants, + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), + SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static SPINAND_OP_VARIANTS(update_cache_variants, + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + +static int hyfxgq4uda_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 3) + return -ERANGE; + + region->offset = section * 16 + 8; + region->length = 8; + + return 0; +} + +static int hyfxgq4uda_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 3) + return -ERANGE; + + /* ECC-protected user meta-data */ + region->offset = section * 16 + 4; + region->length = 4; + + return 0; +} + +static const struct mtd_ooblayout_ops hyfxgq4uda_ooblayout = { + .ecc = hyfxgq4uda_ooblayout_ecc, + .free = hyfxgq4uda_ooblayout_free, +}; + +static int hyfxgq4uda_ecc_get_status(struct spinand_device *spinand, + u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + + switch (status & STATUS_ECC_MASK) { + case STATUS_ECC_NO_BITFLIPS: + return 0; + + case STATUS_ECC_UNCOR_ERROR: + return -EBADMSG; + + case STATUS_ECC_HAS_BITFLIPS: + return nanddev_get_ecc_conf(nand)->strength >> 1; + + case STATUS_ECC_LIMIT_BITFLIPS: + return nanddev_get_ecc_conf(nand)->strength; + + default: + break; + } + + return -EINVAL; +} + +static const struct spinand_info heyangtek_spinand_table[] = { + SPINAND_INFO("HYF1GQ4UDACAE", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x21), + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), + NAND_ECCREQ(4, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&hyfxgq4uda_ooblayout, + hyfxgq4uda_ecc_get_status)), +}; + +static const struct spinand_manufacturer_ops heyangtek_spinand_manuf_ops = { +}; + +const struct spinand_manufacturer heyangtek_spinand_manufacturer = { + .id = SPINAND_MFR_HEYANGTEK, + .name = "HeYangTek", + .chips = heyangtek_spinand_table, + .nchips = ARRAY_SIZE(heyangtek_spinand_table), + .ops = &heyangtek_spinand_manuf_ops, +}; diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 5c19ead60499..06ee35a27e3b 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -265,6 +265,7 @@ extern const struct spinand_manufacturer ato_spinand_manufacturer; extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer; extern const struct spinand_manufacturer foresee_spinand_manufacturer; extern const struct spinand_manufacturer gigadevice_spinand_manufacturer; +extern const struct spinand_manufacturer heyangtek_spinand_manufacturer; extern const struct spinand_manufacturer macronix_spinand_manufacturer; extern const struct spinand_manufacturer micron_spinand_manufacturer; extern const struct spinand_manufacturer paragon_spinand_manufacturer; -- 2.45.1 . From: Jan Kiszka To: Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Bao Cheng Su , Diogo Ivo Subject: [PATCH 0/4] arm64: dts: k3: Resolve remaining dtbs_check warnings Date: Mon, 24 Jun 2024 08:20:46 +0200 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256451 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This goes on top of https://patchwork.kernel.org/project/linux-arm-kernel/cover/20240518-dt-bindings-ti-soc-mfd-v1-0-b3952f104c9a@linaro.org/ As we are working in this area, having a zero-warning baseline helps a lot finding own issues quicker. Maybe not all of the suggested resolutions are optimal, open for feedback, just want to have them all fixed now soon. Jan Jan Kiszka (4): arm64: dts: ti: k3-j72xx-mcu-wakeup: add dedicated wakeup controller compatible arm64: dts: ti: k3-am642-evm: Silence schema warning dt-bindings: soc: ti: am645-system-controller: add child nodes used by main domain arm64: dts: ti: k3-am65-main: add system controller compatible .../soc/ti/ti,am654-system-controller.yaml | 29 +++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am642-evm.dts | 4 +++ arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 2 +- .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 2 +- .../boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 2 +- .../boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 2 +- 6 files changed, 37 insertions(+), 4 deletions(-) -- 2.43.0 . From: =?UTF-8?Q?Aaron?= Reply-To: aaron@xyexpansion.com To: linux-kernel@vger.kernel.org Subject: =?UTF-8?Q?A_factory_you_can_trust?= Date: Mon, 24 Jun 2024 13:50:34 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Mark=_1009550050477508" Message-ID: <009A0B8C06180D3223344F799EF2@PC-20240130SRIC> Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256455 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This is a multi-part message in MIME format. --Mark=_1009550050477508 Content-Type: multipart/related; type="multipart/alternative"; boundary="Mark=_100955005047750803" --Mark=_100955005047750803 Content-Type: multipart/alternative; boundary="Mark=_10095500504775044" --Mark=_10095500504775044 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi : I hope your business is getting better! We are a Very big production factory! we produce high quality b= rand for swimwear and yoga and fitness and cycling and some t-shirts an= d beach shorts so on, We have over 2500 workers in our factory. There is no problem for any guest to require any audit report=E3= =80=82 I hope we can become as close as brothers and cooperate for a lo= ng time. We have been doing clothing factory for more than 30 years, I wa= nt to find a few good brothers sincerely good cooperation. we develop t= ogether.and become real good brothers, are you willing ? Whenever you come to China, remember to call me and get togeth= er to eat and talk. I hope your business goes from strength to strength !!! keep i= n touch, my brother friend ! Best regarding. Waitting for your reply. General Manager : Mr.Aaron Email : aaron@xyexpansion.com, Mobile: +86 18965665987 Wechat ID : +86 18965665987 Skype ID : yingtinggao9 Address : Industrial Park,YingLin Town, JinJiang City,FuJian Province,China. Postal code : 362256. --Mark=_10095500504775044-- --Mark=_100955005047750803-- --Mark=_1009550050477508-- . From: Thorsten Blum To: jstultz@google.com, tglx@linutronix.de, sboyd@kernel.org, linux-kernel@vger.kernel.org Cc: Thorsten Blum Subject: [PATCH] timekeeping: Use min() to fix Coccinelle warning Date: Mon, 24 Jun 2024 08:24:12 +0200 Message-ID: <20240624062411.321995-2-thorsten.blum@toblux.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256456 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Fixes the following Coccinelle/coccicheck warning reported by minmax.cocci: WARNING opportunity for min() Signed-off-by: Thorsten Blum --- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 4e18db1819f8..f1a9c52b7c66 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -799,7 +799,7 @@ static void timekeeping_forward_now(struct timekeeper *tk) while (delta > 0) { u64 max = tk->tkr_mono.clock->max_cycles; - u64 incr = delta < max ? delta : max; + u64 incr = min(delta, max); tk->tkr_mono.xtime_nsec += incr * tk->tkr_mono.mult; tk->tkr_raw.xtime_nsec += incr * tk->tkr_raw.mult; -- 2.45.2 . From: Chun-Yi Lee X-Google-Original-From: Chun-Yi Lee To: Justin Sanders Cc: Jens Axboe , Pavel Emelianov , Kirill Korotaev , "David S . Miller" , Nicolai Stange , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Chun-Yi Lee Subject: [PATCH v2] aoe: fix the potential use-after-free problem in more places Date: Mon, 24 Jun 2024 14:44:18 +0800 Message-Id: <20240624064418.27043-1-jlee@suse.com> X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Xref: photonic.trudheim.com org.kernel.vger.linux-block:93397 org.kernel.vger.linux-kernel:1256459 Newsgroups: org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail For fixing CVE-2023-6270, f98364e92662 ("aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts") makes tx() calling dev_put() instead of doing in aoecmd_cfg_pkts(). It avoids that the tx() runs into use-after-free. Then Nicolai Stange found more places in aoe have potential use-after-free problem with tx(). e.g. revalidate(), aoecmd_ata_rw(), resend(), probe() and aoecmd_cfg_rsp(). Those functions also use aoenet_xmit() to push packet to tx queue. So they should also use dev_hold() to increase the refcnt of skb->dev. Link: https://nvd.nist.gov/vuln/detail/CVE-2023-6270 Fixes: f98364e92662 ("aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts") Reported-by: Nicolai Stange Signed-off-by: Chun-Yi Lee --- v2: - Improve patch description - Improved wording - Add oneline summary of the commit f98364e92662 - Used curly brackets in the if-else blocks. drivers/block/aoe/aoecmd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index cc9077b588d7..d1f4ddc57645 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -361,6 +361,7 @@ ata_rw_frameinit(struct frame *f) } ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit; + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; } @@ -401,6 +402,8 @@ aoecmd_ata_rw(struct aoedev *d) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); + } else { + dev_put(f->t->ifp->nd); } return 1; } @@ -483,10 +486,13 @@ resend(struct aoedev *d, struct frame *f) memcpy(h->dst, t->addr, sizeof h->dst); memcpy(h->src, t->ifp->nd->dev_addr, sizeof h->src); + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; skb = skb_clone(skb, GFP_ATOMIC); - if (skb == NULL) + if (skb == NULL) { + dev_put(t->ifp->nd); return; + } f->sent = ktime_get(); __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); @@ -617,6 +623,8 @@ probe(struct aoetgt *t) __skb_queue_head_init(&queue); __skb_queue_tail(&queue, skb); aoenet_xmit(&queue); + } else { + dev_put(f->t->ifp->nd); } } @@ -1395,6 +1403,7 @@ aoecmd_ata_id(struct aoedev *d) ah->cmdstat = ATA_CMD_ID_ATA; ah->lba3 = 0xa0; + dev_hold(t->ifp->nd); skb->dev = t->ifp->nd; d->rttavg = RTTAVG_INIT; @@ -1404,6 +1413,8 @@ aoecmd_ata_id(struct aoedev *d) skb = skb_clone(skb, GFP_ATOMIC); if (skb) f->sent = ktime_get(); + else + dev_put(t->ifp->nd); return skb; } -- 2.35.3 . From: Neha Malcom Francis To: , CC: , , , Subject: [PATCH] soc: ti: k3-socinfo: Add J721E SR2.0 Date: Mon, 24 Jun 2024 12:22:05 +0530 Message-ID: <20240624065205.718449-1-n-francis@ti.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256467 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add support to detect J721E SR2.0 Signed-off-by: Neha Malcom Francis --- drivers/soc/ti/k3-socinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index 59101bf7cf23..4fb0f0a24828 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -61,7 +61,7 @@ static const struct k3_soc_id { }; static const char * const j721e_rev_string_map[] = { - "1.0", "1.1", + "1.0", "1.1", "2.0", }; static int -- 2.34.1 . From: Bibo Mao To: Tianrui Zhao , Huacai Chen Cc: WANG Xuerui , Sean Christopherson , kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, WANG Rui Subject: [PATCH v3 0/7] LoongArch: KVM: VM migration enhancement Date: Mon, 24 Jun 2024 15:14:15 +0800 Message-Id: <20240624071422.3473789-1-maobibo@loongson.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256483 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.loongarch,org.kernel.vger.kvm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patchset is to solve VM migration issues, the first six patches are mmu relative, the last patch is relative with vcpu interrupt status. It fixes potential issue about tlb flush of secondary mmu and huge page selection etc. Also it hardens LoongArch kvm mmu module. With this patchset, VM successfully migrates on my 3C5000 Dual-Way machine with 32 cores. 1. Pass to migrate when unixbench workload runs with 32 vcpus, for some unixbench testcases there is much IPI sending. 2. Pass to migrate with kernel compiling with 8 vcpus in VM 3. Fail to migrate with kernel compiling with 32 vcpus in VM, since there is to much memory writing operation, also there will be file system inode inconsistent error after migration. --- v2 ... v3: 1. Merge patch 7 into this patchset since it is relative with VM migration bugfix. 2. Sync pending interrupt when getting ESTAT register, SW ESTAT register is read after vcpu_put(). 3. Add notation about smp_wmb() when update pmd entry, to elimate checkpatch warning. 4. Remove unnecessary modification about function kvm_pte_huge() in patch 2. 5. Add notation about secondary mmu tlb since it is firstly used here. v1 ... v2: 1. Combine seperate patches into one patchset, all are relative with migration. 2. Mark page accessed without mmu_lock still, however with page ref added --- Bibo Mao (7): LoongArch: KVM: Delay secondary mmu tlb flush until guest entry LoongArch: KVM: Select huge page only if secondary mmu supports it LoongArch: KVM: Discard dirty page tracking on readonly memslot LoongArch: KVM: Add memory barrier before update pmd entry LoongArch: KVM: Add dirty bitmap initially all set support LoongArch: KVM: Mark page accessed and dirty with page ref added LoongArch: KVM: Sync pending interrupt when getting ESTAT from user mode arch/loongarch/include/asm/kvm_host.h | 5 ++ arch/loongarch/include/asm/kvm_mmu.h | 2 +- arch/loongarch/kvm/main.c | 1 + arch/loongarch/kvm/mmu.c | 67 ++++++++++++++++++++------- arch/loongarch/kvm/tlb.c | 5 +- arch/loongarch/kvm/vcpu.c | 29 ++++++++++++ 6 files changed, 86 insertions(+), 23 deletions(-) base-commit: 50736169ecc8387247fe6a00932852ce7b057083 -- 2.39.3 . From: Bastien Curutchet To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Herve Codina , Christopher Cordahi , Bastien Curutchet Subject: [PATCH] spi: davinci: Unset POWERDOWN bit when releasing resources Date: Mon, 24 Jun 2024 09:17:45 +0200 Message-ID: <20240624071745.17409-1-bastien.curutchet@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: bastien.curutchet@bootlin.com Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256489 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-spi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail On the OMAPL138, the SPI reference clock is provided by the Power and Sleep Controller (PSC). The PSC's datasheet says that 'some peripherals have special programming requirements and additional recommended steps you must take before you can invoke the PSC module state transition'. I didn't find more details in documentation but it appears that PSC needs the SPI to clear the POWERDOWN bit before disabling the clock. Indeed, when this bit is set, the PSC gets stuck in transitions from enable to disable state. Clear the POWERDOWN bit when releasing driver's resources Signed-off-by: Bastien Curutchet --- Hi, I ran into this bug by enabling the 'cs-gpio' property. It causes the probe to fail at first with -EPROBE_DEFER because the gpio provider is not ready. So the clock gets disabled. In the clock controller's driver (drivers/clk/davinci/psc.c) the clock_disable() calls a regmap_read_poll_timeout() with an infinite timeout. This poll() polls a transition bit status that never goes down so we end stuck in the middle of the boot sequence. drivers/spi/spi-davinci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index be3998104bfb..f7e8b5efa50e 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -984,6 +984,9 @@ static int davinci_spi_probe(struct platform_device *pdev) return ret; free_dma: + /* This bit needs to be cleared to disable dpsi->clk */ + clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK); + if (dspi->dma_rx) { dma_release_channel(dspi->dma_rx); dma_release_channel(dspi->dma_tx); @@ -1013,6 +1016,9 @@ static void davinci_spi_remove(struct platform_device *pdev) spi_bitbang_stop(&dspi->bitbang); + /* This bit needs to be cleared to disable dpsi->clk */ + clear_io_bits(dspi->base + SPIGCR1, SPIGCR1_POWERDOWN_MASK); + if (dspi->dma_rx) { dma_release_channel(dspi->dma_rx); dma_release_channel(dspi->dma_tx); -- 2.45.0 . From: Tianchen Ding To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Josh Don Subject: [PATCH] sched/fair: Make SCHED_IDLE se be preempted in strict hierarchy Date: Mon, 24 Jun 2024 15:39:00 +0800 Message-Id: <20240624073900.10343-1-dtcccc@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256502 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Consider the following cgroup: root | ------------------------ | | normal_cgroup idle_cgroup | | SCHED_IDLE task_A SCHED_NORMAL task_B According to the cgroup hierarchy, A should preempt B. But current check_preempt_wakeup_fair() treats cgroup se and task separately, so B will preempt A unexpectedly. Unify the wakeup logic by {p}se_is_idle only. Also fix a bug about se_is_idle() definition when !CONFIG_FAIR_GROUP_SCHED. Fixes: 304000390f88 ("sched: Cgroup SCHED_IDLE support") Signed-off-by: Tianchen Ding --- kernel/sched/fair.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 41b58387023d..c91cfaa7d9ee 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -511,7 +511,7 @@ static int cfs_rq_is_idle(struct cfs_rq *cfs_rq) static int se_is_idle(struct sched_entity *se) { - return 0; + return task_has_idle_policy(task_of(se)); } #endif /* CONFIG_FAIR_GROUP_SCHED */ @@ -8382,16 +8382,7 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int if (test_tsk_need_resched(curr)) return; - /* Idle tasks are by definition preempted by non-idle tasks. */ - if (unlikely(task_has_idle_policy(curr)) && - likely(!task_has_idle_policy(p))) - goto preempt; - - /* - * Batch and idle tasks do not preempt non-idle tasks (their preemption - * is driven by the tick): - */ - if (unlikely(p->policy != SCHED_NORMAL) || !sched_feat(WAKEUP_PREEMPTION)) + if (!sched_feat(WAKEUP_PREEMPTION)) return; find_matching_se(&se, &pse); @@ -8408,6 +8399,12 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int goto preempt; if (cse_is_idle != pse_is_idle) return; + /* + * Batch tasks do not preempt non-idle tasks (their preemption + * is driven by the tick): + */ + if (unlikely(pse == &p->se && p->policy == SCHED_BATCH)) + return; cfs_rq = cfs_rq_of(se); update_curr(cfs_rq); -- 2.39.3 . From: Mateusz Guzik To: cfijalkovich@google.com Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Mateusz Guzik Subject: [RFC PATCH] vfs: wrap CONFIG_READ_ONLY_THP_FOR_FS-related code with an ifdef Date: Mon, 24 Jun 2024 09:41:34 +0200 Message-ID: <20240624074135.486845-1-mjguzik@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256504 org.kvack.linux-mm:201066 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-fsdevel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail On kernels compiled without this option (which is currently the default state) filemap_nr_thps expands to 0. do_dentry_open has a big chunk dependent on it, most of which gets optimized away, except for a branch and a full fence: if (f->f_mode & FMODE_WRITE) { [snip] smp_mb(); if (filemap_nr_thps(inode->i_mapping)) { [snip] } } While the branch is pretty minor the fence really does not need to be there. This is a bare-minimum patch which takes care of it until someone(tm) cleans this up. Notably it does not conditionally compile other spots which issue the matching fence. I did not bother benchmarking it, not issuing a spurious full fence in the fast path does not warrant justification from perf standpoint. Signed-off-by: Mateusz Guzik --- I am not particularly familiar with any of this, the smp_mb in the open for write path was sticking out like a sore thumb on code read so I figured there may be One Weird Trick to whack it. If the stock code is correct as is, then the ifdef as above is fine. The ifdefed chunk is big enough that it should probably be its own routine. I don't want to bikeshed so I did not go for it. For a moment I considered adding filemap_nr_thps_mb which would expand to 0 or issue the fence + do the read, but then I figured a routine claiming to post a fence and only conditionally do it is misleading at best. As per the commit message fences in collapse_file remain compiled in. It is unclear to me if the code following them is doing anything useful on kernels !CONFIG_READ_ONLY_THP_FOR_FS. All that said, if there is cosmetic touch ups you want done here, I can do them. However, a nice full patch would take care of all of the above and I have neither the information needed to do it nor the interest to get it, so should someone insinst on a full version I'm going to suggest they write it themselves. I repeat this is merely a damage control until someone sorts thigs out. fs/open.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/open.c b/fs/open.c index 28f2fcbebb1b..654c300b3c33 100644 --- a/fs/open.c +++ b/fs/open.c @@ -980,6 +980,7 @@ static int do_dentry_open(struct file *f, if ((f->f_flags & O_DIRECT) && !(f->f_mode & FMODE_CAN_ODIRECT)) return -EINVAL; +#ifdef CONFIG_READ_ONLY_THP_FOR_FS /* * XXX: Huge page cache doesn't support writing yet. Drop all page * cache for this file before processing writes. @@ -1007,6 +1008,7 @@ static int do_dentry_open(struct file *f, filemap_invalidate_unlock(inode->i_mapping); } } +#endif return 0; -- 2.43.0 . From: yskelg@gmail.com To: Paolo Bonzini Cc: MichelleJin , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yunseong Kim Subject: [PATCH] tools/kvm_stat: update exit reasons for userspace Date: Mon, 24 Jun 2024 16:58:21 +0900 Message-ID: <20240624075820.71583-2-yskelg@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256512 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.kvm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Yunseong Kim Update EXIT_REASONS from source, including 2 USERSPACE_EXIT_REASONS: 'KVM_EXIT_LOONGARCH_IOCSR' and 'KVM_EXIT_MEMORY_FAULT'. Link: https://lore.kernel.org/all/20231121225650.390246-3-namhyung@kernel.org/ Link: https://lore.kernel.org/lkml/ZbVLbkngp4oq13qN@kernel.org/ Signed-off-by: Yunseong Kim --- tools/kvm/kvm_stat/kvm_stat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat index 15bf00e79e3f..eec6c00e3ff9 100755 --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat @@ -288,6 +288,8 @@ USERSPACE_EXIT_REASONS = { 'RISCV_SBI': 35, 'RISCV_CSR': 36, 'NOTIFY': 37, + 'LOONGARCH_IOCSR': 38, + 'MEMORY_FAULT': 39 } IOCTL_NUMBERS = { -- 2.45.2 . From: Neil Armstrong Subject: [PATCH v2 0/3] clk: qcom: dispcc-sm8650: round of fixes Date: Mon, 24 Jun 2024 10:05:49 +0200 Message-Id: <20240624-topic-sm8650-upstream-fix-dispcc-v2-0-ddaa13f3b207@linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Konrad Dybcio , Taniya Das Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , Dmitry Baryshkov Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256519 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-clk Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail While trying to fix a crash when display is started late in the boot process, I ran on multiple issues with the DISPCC clock definitions that needed some fixups. Signed-off-by: Neil Armstrong --- Changes in v2: - Squashed patch 2 into patch 1 - Dropped shared_ops to disp_cc_sleep_clk_src & disp_cc_xo_clk_src as Taniya recommends - Dropped patch 3 - Removed wait_val fields updates from GDSC, this requires a larger solution - Link to v1: https://lore.kernel.org/r/20240621-topic-sm8650-upstream-fix-dispcc-v1-0-7b297dd9fcc1@linaro.org --- Neil Armstrong (3): clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable clk: qcom: dispcc-sm8650: add missing CLK_SET_RATE_PARENT flag clk: qcom: dispcc-sm8650: Update the GDSC flags drivers/clk/qcom/dispcc-sm8650.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) --- base-commit: b992b79ca8bc336fa8e2c80990b5af80ed8f36fd change-id: 20240621-topic-sm8650-upstream-fix-dispcc-a1994038c003 Best regards, -- Neil Armstrong . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 01:10:20 -0700 Message-ID: <000000000000eea704061b9e4fb8@google.com> Subject: [syzbot] [ext4?] WARNING in __ext4_ioctl From: syzbot To: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256527 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-ext4 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: 7c16f0a4ed1c Merge tag 'i2c-for-6.10-rc5' of git://git.ker.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=10e04151980000 kernel config: https://syzkaller.appspot.com/x/.config?x=3d112b9ab538ebab dashboard link: https://syzkaller.appspot.com/bug?extid=2cab87506a0e7885f4b9 compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/b29845d4c0ce/disk-7c16f0a4.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/e39e5d18a392/vmlinux-7c16f0a4.xz kernel image: https://storage.googleapis.com/syzbot-assets/f6ac8c44d142/bzImage-7c16f0a4.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+2cab87506a0e7885f4b9@syzkaller.appspotmail.com ------------[ cut here ]------------ strnlen: detected buffer overflow: 17 byte read of buffer size 16 WARNING: CPU: 1 PID: 19420 at lib/string_helpers.c:1029 __fortify_report+0x9c/0xd0 lib/string_helpers.c:1029 Modules linked in: CPU: 1 PID: 19420 Comm: syz-executor.1 Not tainted 6.10.0-rc4-syzkaller-00330-g7c16f0a4ed1c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 RIP: 0010:__fortify_report+0x9c/0xd0 lib/string_helpers.c:1029 Code: ed 48 c7 c0 20 c9 8f 8b 48 0f 44 d8 e8 8d 53 0b fd 4d 89 e0 48 89 ea 48 89 d9 4c 89 f6 48 c7 c7 a0 c9 8f 8b e8 e5 6e cd fc 90 <0f> 0b 90 90 5b 5d 41 5c 41 5d 41 5e e9 3e 67 8c 06 48 89 de 48 c7 RSP: 0018:ffffc90004c2fbf0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffffffff8b8fc920 RCX: ffffc9000bb9b000 RDX: 0000000000040000 RSI: ffffffff81514a46 RDI: 0000000000000001 RBP: 0000000000000011 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000010 R13: 0000000000000000 R14: ffffffff8b8fd2e0 R15: ffff88802bb42060 FS: 00007f6eba6e46c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff2d1cbc28 CR3: 0000000062552000 CR4: 0000000000350ef0 Call Trace: __fortify_panic+0x23/0x30 lib/string_helpers.c:1036 strnlen include/linux/fortify-string.h:235 [inline] sized_strscpy include/linux/fortify-string.h:309 [inline] ext4_ioctl_getlabel fs/ext4/ioctl.c:1154 [inline] __ext4_ioctl+0x404d/0x4580 fs/ext4/ioctl.c:1609 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x196/0x220 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6eb987d0a9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6eba6e40c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f6eb99b3f80 RCX: 00007f6eb987d0a9 RDX: 0000000020000100 RSI: 0000000081009431 RDI: 0000000000000003 RBP: 00007f6eb98ec074 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f6eb99b3f80 R15: 00007ffcd312f958 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . From: Jian-Hong Pan To: Bjorn Helgaas Cc: Johan Hovold , David Box , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Kuppuswamy Sathyanarayanan , Mika Westerberg , Damien Le Moal , Nirmal Patel , Jonathan Derrick , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessos.org, Jian-Hong Pan Subject: [PATCH v6 0/3] PCI: vmd: Enable PCI PM's L1 substates of remapped PCIe Root Port and NVMe Date: Mon, 24 Jun 2024 16:11:09 +0800 Message-ID: <20240624081108.10143-2-jhp@endlessos.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256529 org.kernel.vger.linux-pci:144390 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Notice the VMD remapped PCIe Root Port and NVMe have PCI PM L1 substates capability, but they are disabled originally. Here is a failed example on ASUS B1400CEAE with enabled VMD: 10000:e0:06.0 PCI bridge: Intel Corporation 11th Gen Core Processor PCIe Controller (rev 01) (prog-if 00 [Normal decode]) ... Capabilities: [200 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+ PortCommonModeRestoreTime=45us PortTPowerOnTime=50us L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2+ ASPM_L1.1- T_CommonMode=45us LTR1.2_Threshold=101376ns L1SubCtl2: T_PwrOn=50us 10000:e1:00.0 Non-Volatile memory controller: Sandisk Corp WD Blue SN550 NVMe SSD (rev 01) (prog-if 02 [NVM Express]) ... Capabilities: [900 v1] L1 PM Substates L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1- ASPM_L1.2+ ASPM_L1.1- L1_PM_Substates+ PortCommonModeRestoreTime=32us PortTPowerOnTime=10us L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2+ ASPM_L1.1- T_CommonMode=0us LTR1.2_Threshold=0ns L1SubCtl2: T_PwrOn=10us According to "PCIe r6.0, sec 5.5.4", to config the link between the PCIe Root Port and the child device correctly: * Ensure both devices are in D0 before enabling PCI-PM L1 PM Substates. * Ensure L1.2 parameters: Common_Mode_Restore_Times, T_POWER_ON and LTR_L1.2_THRESHOLD are programmed properly on both devices before enable bits for L1.2. Prepare this series to fix that. Jian-Hong Pan (3): PCI: vmd: Set PCI devices to D0 before enable PCI PM's L1 substates PCI/ASPM: Add notes about enabling PCI-PM L1SS to pci_enable_link_state(_locked) PCI: vmd: Drop resetting PCI bus action after scan mapped PCI child bus drivers/pci/controller/vmd.c | 33 +++++++++------------------------ drivers/pci/pcie/aspm.c | 6 ++++++ 2 files changed, 15 insertions(+), 24 deletions(-) -- 2.45.2 . Return-Path: From: Alexandre Ghiti To: Steven Rostedt , Masami Hiramatsu , Mark Rutland , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Alexandre Ghiti , Andy Chiu , Puranjay Mohan , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Conor Dooley Subject: [PATCH -fixes] riscv: patch: Flush the icache right after patching to avoid illegal insns Date: Mon, 24 Jun 2024 10:21:41 +0200 Message-Id: <20240624082141.153871-1-alexghiti@rivosinc.com> MIME-Version: 1.0 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Xref: photonic.trudheim.com org.infradead.lists.linux-riscv:78922 org.kernel.vger.linux-kernel:1256531 Newsgroups: org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel,org.kernel.vger.linux-trace-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail We cannot delay the icache flush after patching some functions as we may have patched a function that will get called before the icache flush. The only way to completely avoid such scenario is by flushing the icache as soon as we patch a function. This will probably be costly as we don't batch the icache maintenance anymore. Fixes: 6ca445d8af0e ("riscv: Fix early ftrace nop patching") Reported-by: Conor Dooley Closes: https://lore.kernel.org/linux-riscv/20240613-lubricant-breath-061192a9489a@wendy/ Signed-off-by: Alexandre Ghiti --- arch/riscv/kernel/ftrace.c | 7 ++----- arch/riscv/kernel/patch.c | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/arch/riscv/kernel/ftrace.c b/arch/riscv/kernel/ftrace.c index 87cbd86576b2..4b95c574fd04 100644 --- a/arch/riscv/kernel/ftrace.c +++ b/arch/riscv/kernel/ftrace.c @@ -120,9 +120,6 @@ int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec) out = ftrace_make_nop(mod, rec, MCOUNT_ADDR); mutex_unlock(&text_mutex); - if (!mod) - local_flush_icache_range(rec->ip, rec->ip + MCOUNT_INSN_SIZE); - return out; } @@ -156,9 +153,9 @@ static int __ftrace_modify_code(void *data) } else { while (atomic_read(¶m->cpu_count) <= num_online_cpus()) cpu_relax(); - } - local_flush_icache_all(); + local_flush_icache_all(); + } return 0; } diff --git a/arch/riscv/kernel/patch.c b/arch/riscv/kernel/patch.c index 4007563fb607..ab03732d06c4 100644 --- a/arch/riscv/kernel/patch.c +++ b/arch/riscv/kernel/patch.c @@ -89,6 +89,14 @@ static int __patch_insn_set(void *addr, u8 c, size_t len) memset(waddr, c, len); + /* + * We could have just patched a function that is about to be + * called so make sure we don't execute partially patched + * instructions by flushing the icache as soon as possible. + */ + local_flush_icache_range((unsigned long)waddr, + (unsigned long)waddr + len); + patch_unmap(FIX_TEXT_POKE0); if (across_pages) @@ -135,6 +143,14 @@ static int __patch_insn_write(void *addr, const void *insn, size_t len) ret = copy_to_kernel_nofault(waddr, insn, len); + /* + * We could have just patched a function that is about to be + * called so make sure we don't execute partially patched + * instructions by flushing the icache as soon as possible. + */ + local_flush_icache_range((unsigned long)waddr, + (unsigned long)waddr + len); + patch_unmap(FIX_TEXT_POKE0); if (across_pages) @@ -189,9 +205,6 @@ int patch_text_set_nosync(void *addr, u8 c, size_t len) ret = patch_insn_set(tp, c, len); - if (!ret) - flush_icache_range((uintptr_t)tp, (uintptr_t)tp + len); - return ret; } NOKPROBE_SYMBOL(patch_text_set_nosync); @@ -224,9 +237,6 @@ int patch_text_nosync(void *addr, const void *insns, size_t len) ret = patch_insn_write(tp, insns, len); - if (!ret) - flush_icache_range((uintptr_t) tp, (uintptr_t) tp + len); - return ret; } NOKPROBE_SYMBOL(patch_text_nosync); @@ -253,9 +263,9 @@ static int patch_text_cb(void *data) } else { while (atomic_read(&patch->cpu_count) <= num_online_cpus()) cpu_relax(); - } - local_flush_icache_all(); + local_flush_icache_all(); + } return ret; } -- 2.39.2 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 01:17:20 -0700 Message-ID: <000000000000fb03a7061b9e68eb@google.com> Subject: [syzbot] [mm?] KCSAN: data-race in __anon_vma_prepare / handle_mm_fault (3) From: syzbot To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256539 Newsgroups: org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: 7c16f0a4ed1c Merge tag 'i2c-for-6.10-rc5' of git://git.ker.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=17a1b551980000 kernel config: https://syzkaller.appspot.com/x/.config?x=704451bc2941bcb0 dashboard link: https://syzkaller.appspot.com/bug?extid=3d69e72f363bbb907374 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/9acd4869df3e/disk-7c16f0a4.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/a5b6e853a6e5/vmlinux-7c16f0a4.xz kernel image: https://storage.googleapis.com/syzbot-assets/23b225386827/bzImage-7c16f0a4.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+3d69e72f363bbb907374@syzkaller.appspotmail.com ================================================================== BUG: KCSAN: data-race in __anon_vma_prepare / handle_mm_fault write to 0xffff888103d6e888 of 8 bytes by task 6933 on cpu 0: __anon_vma_prepare+0x180/0x310 mm/rmap.c:213 vmf_anon_prepare mm/memory.c:3239 [inline] do_anonymous_page mm/memory.c:4451 [inline] do_pte_missing mm/memory.c:3895 [inline] handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0x1c03/0x2a80 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x296/0x650 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 __put_user_4+0x11/0x20 arch/x86/lib/putuser.S:86 __sys_socketpair+0xba/0x430 net/socket.c:1756 __do_sys_socketpair net/socket.c:1822 [inline] __se_sys_socketpair net/socket.c:1819 [inline] __x64_sys_socketpair+0x52/0x60 net/socket.c:1819 x64_sys_call+0x27a9/0x2d70 arch/x86/include/generated/asm/syscalls_64.h:54 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f read to 0xffff888103d6e888 of 8 bytes by task 6932 on cpu 1: vmf_anon_prepare mm/memory.c:3231 [inline] do_anonymous_page mm/memory.c:4451 [inline] do_pte_missing mm/memory.c:3895 [inline] handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault mm/memory.c:5523 [inline] handle_mm_fault+0xcf3/0x2a80 mm/memory.c:5688 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x3b9/0x650 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 value changed: 0x0000000000000000 -> 0xffff888118538138 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 6932 Comm: syz-executor.4 Not tainted 6.10.0-rc4-syzkaller-00330-g7c16f0a4ed1c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 ================================================================== --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . From: Dmitry Baryshkov Date: Mon, 24 Jun 2024 11:19:09 +0300 Subject: [PATCH] MAINTAINERS: CC dri-devel list on Qualcomm FastRPC patches X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-fastrpc-ml-v1-1-5dad89dce78f@linaro.org> To: Srinivas Kandagatla , Amol Maheshwari , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256544 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-media Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail FastRPC is a way to offload method invocation to the DSPs on Qualcomm platforms. As the driver uses dma-bufs, add dri-devel mailing list to the MAINTAINERS's entry, so that DRM maintainers are notified about the uAPI changes. This follows the usual practice established by the "DMA BUFFER SHARING FRAMEWORK" entry in the file. Suggested-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index f45881e982d2..26d628c677a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18621,6 +18621,7 @@ QUALCOMM FASTRPC DRIVER M: Srinivas Kandagatla M: Amol Maheshwari L: linux-arm-msm@vger.kernel.org +L: dri-devel@lists.freedesktop.org S: Maintained F: Documentation/devicetree/bindings/misc/qcom,fastrpc.yaml F: drivers/misc/fastrpc.c --- base-commit: 2102cb0d050d34d50b9642a3a50861787527e922 change-id: 20240624-fastrpc-ml-24c7d5cf5e7b Best regards, -- Dmitry Baryshkov . From: Jacobe Zang To: arend.vanspriel@broadcom.com Cc: kvalo@kernel.org, duoming@zju.edu.cn, bhelgaas@google.com, minipli@grsecurity.net, linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, megi@xff.cz, robh@kernel.org, efectn@protonmail.com, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, nick@khadas.com, jagan@edgeble.ai, dsimic@manjaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jacobe Zang Subject: [PATCH v2 0/5] Add AP6275P wireless support Date: Mon, 24 Jun 2024 16:19:01 +0800 Message-Id: <20240624081906.1399447-1-jacobe.zang@wesion.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256553 org.kernel.vger.linux-wireless:85262 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.brcm80211,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-wireless Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail These add AP6275P wireless support on Khadas Edge2. Enable 32k clock for Wi-Fi module and extend the hardware IDs table in the brcmfmac driver for it to attach. Changes in v2: - Add SoB tags for original developer. - Add dt-bindings for pci14e4,449d and clocks. - Replace dev_info to brcmf_dbg in pcie.c - Link to v1: https://lore.kernel.org/all/20240620020015.4021696-1-jacobe.zang@wesion.com/ Jacobe Zang (5): arm64: dts: rockchip: Add AP6275P wireless support to Khadas Edge 2 net: wireless: brcmfmac: Add optional 32k clock enable support net: wireless: brcmfmac: Add support for AP6275P dt-bindings: net: wireless: brcm4329-fmac: add clock description. dt-bindings: net: wireless: brcm4329-fmac: add pci14e4,449d .../bindings/net/wireless/brcm,bcm4329-fmac.yaml | 10 ++++++++++ .../boot/dts/rockchip/rk3588s-khadas-edge2.dts | 16 ++++++++++++++++ .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 15 ++++++++++++++- .../broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++ 4 files changed, 42 insertions(+), 1 deletion(-) -- 2.34.1 . From: Jacobe Zang To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de Cc: nick@khadas.com, efectn@protonmail.com, jagan@edgeble.ai, dsimic@manjaro.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jacobe Zang Subject: [PATCH v4 0/2] arm64: dts: Add board support for Khadas Edge2 Date: Mon, 24 Jun 2024 16:32:34 +0800 Message-Id: <20240624083236.1401673-1-jacobe.zang@wesion.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256570 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail These patches add board support as following: - 2x TYPE-C port - BCM43438 bluetooth Changes in v4: - Add SoB tags for original developer. - Link to v3: https://patchwork.kernel.org/project/linux-rockchip/cover/20240620014536.4019524-1-jacobe.zang@wesion.com/ Changes in v3: - Strip Wi-Fi patch, commit it with PCI driver together. - Removed CPU frequency patch because it won't be needed. - Revert HDMI patch, waiting for the previous commit to be merged. - Link to v2: https://patchwork.kernel.org/project/linux-rockchip/cover/20240617071112.3133101-1-jacobe.zang@wesion.com/ Changes in v2: - Removed unrelated parts in Wi-Fi patch. - Fix indent error in USB-C patch. - Link to v1: https://patchwork.kernel.org/project/linux-rockchip/cover/20240617030537.3112356-1-jacobe.zang@wesion.com/ Jacobe Zang (2): arm64: dts: rockchip: Add USB-C to Khadas Edge 2 arm64: dts: rockchip: Add bluetooth rfkill to Khadas Edge2 .../dts/rockchip/rk3588s-khadas-edge2.dts | 127 +++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) -- 2.34.1 . From: Alain Volmat To: Hugues Fruchet , Alain Volmat , Mauro Carvalho Chehab , Maxime Coquelin , Alexandre Torgue , Hans Verkuil , Sakari Ailus CC: , , , , Subject: [PATCH] media: stm32: dcmipp: correct error handling in dcmipp_create_subdevs Date: Mon, 24 Jun 2024 10:41:22 +0200 Message-ID: <20240624084123.3009122-1-alain.volmat@foss.st.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256581 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-media,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Correct error handling within the dcmipp_create_subdevs by properly decrementing the i counter when releasing the subdeves. Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver") Cc: stable@vger.kernel.org Signed-off-by: Alain Volmat --- drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c index 4acc3b90d03a..4924ee36cfda 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c @@ -202,7 +202,7 @@ static int dcmipp_create_subdevs(struct dcmipp_device *dcmipp) return 0; err_init_entity: - while (i > 0) + while (i-- > 0) dcmipp->pipe_cfg->ents[i - 1].release(dcmipp->entity[i - 1]); return ret; } -- 2.25.1 . Date: Mon, 24 Jun 2024 16:49:04 +0800 From: kernel test robot To: Usama Arif CC: , , Linux Memory Management List , Andrew Morton , "Chengming Zhou" , Yosry Ahmed , "Nhat Pham" , David Hildenbrand , "Huang, Ying" , Hugh Dickins , Johannes Weiner , Matthew Wilcox , Shakeel Butt , Andi Kleen , , Subject: [linux-next:master] [mm] 0fa2857d23: WARNING:at_mm/page_alloc.c:#__alloc_pages_noprof Message-ID: <202406241651.963e3e78-oliver.sang@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256593 org.kvack.linux-mm:201076 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.oe-lkp,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, kernel test robot noticed "WARNING:at_mm/page_alloc.c:#__alloc_pages_noprof" on: commit: 0fa2857d23aa170e5e28d13c467b303b0065aad8 ("mm: store zero pages to be swapped out in a bitmap") https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master [test failed on linux-next/master f76698bd9a8ca01d3581236082d786e9a6b72bb7] in testcase: vm-scalability version: vm-scalability-x86_64-6f4ef16-0_20240303 with following parameters: runtime: 300 thp_enabled: always thp_defrag: always nr_task: 32 nr_ssd: 1 priority: 1 test: swap-w-rand-mt cpufreq_governor: performance compiler: gcc-13 test machine: 128 threads 2 sockets Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz (Ice Lake) with 128G memory (please refer to attached dmesg/kmsg for entire log/backtrace) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-lkp/202406241651.963e3e78-oliver.sang@intel.com [ 34.776816][ T2413] ------------[ cut here ]------------ [ 34.782497][ T2413] WARNING: CPU: 11 PID: 2413 at mm/page_alloc.c:4685 __alloc_pages_noprof (mm/page_alloc.c:4685 (discriminator 11)) [ 34.792245][ T2413] Modules linked in: btrfs blake2b_generic xor raid6_pq libcrc32c sd_mod t10_pi intel_rapl_msr intel_rapl_common crc64_rocksoft_generic crc64_rocksoft x86_pkg_temp_thermal crc64 intel_powerclamp sg coretemp binfmt_misc kvm_intel ipmi_ssif kvm crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel sha512_ssse3 ahci ast libahci rapl drm_shmem_helper intel_cstate mei_me intel_th_gth ioatdma acpi_power_meter i2c_i801 intel_th_pci libata intel_uncore drm_kms_helper ipmi_si acpi_ipmi dax_hmem mei i2c_smbus intel_th intel_pch_thermal dca wmi ipmi_devintf ipmi_msghandler acpi_pad joydev drm fuse loop dm_mod ip_tables [ 34.849370][ T2413] CPU: 11 PID: 2413 Comm: swapon Not tainted 6.10.0-rc4-00263-g0fa2857d23aa #1 [ 34.858458][ T2413] RIP: 0010:__alloc_pages_noprof (mm/page_alloc.c:4685 (discriminator 11)) [ 34.864602][ T2413] Code: 00 00 00 48 89 54 24 08 e9 83 fe ff ff 83 fd 0a 0f 86 f6 fd ff ff 80 3d 8a f4 d6 01 00 0f 85 7f fe ff ff c6 05 7d f4 d6 01 01 <0f> 0b e9 71 fe ff ff f7 c1 00 00 80 00 75 61 f7 c1 00 00 08 00 74 All code ======== 0: 00 00 add %al,(%rax) 2: 00 48 89 add %cl,-0x77(%rax) 5: 54 push %rsp 6: 24 08 and $0x8,%al 8: e9 83 fe ff ff jmpq 0xfffffffffffffe90 d: 83 fd 0a cmp $0xa,%ebp 10: 0f 86 f6 fd ff ff jbe 0xfffffffffffffe0c 16: 80 3d 8a f4 d6 01 00 cmpb $0x0,0x1d6f48a(%rip) # 0x1d6f4a7 1d: 0f 85 7f fe ff ff jne 0xfffffffffffffea2 23: c6 05 7d f4 d6 01 01 movb $0x1,0x1d6f47d(%rip) # 0x1d6f4a7 2a:* 0f 0b ud2 <-- trapping instruction 2c: e9 71 fe ff ff jmpq 0xfffffffffffffea2 31: f7 c1 00 00 80 00 test $0x800000,%ecx 37: 75 61 jne 0x9a 39: f7 c1 00 00 08 00 test $0x80000,%ecx 3f: 74 .byte 0x74 Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: e9 71 fe ff ff jmpq 0xfffffffffffffe78 7: f7 c1 00 00 80 00 test $0x800000,%ecx d: 75 61 jne 0x70 f: f7 c1 00 00 08 00 test $0x80000,%ecx 15: 74 .byte 0x74 [ 34.884371][ T2413] RSP: 0018:ffa000000ce8fda8 EFLAGS: 00010246 [ 34.890619][ T2413] RAX: 0000000000000000 RBX: 0000000000040dc0 RCX: 0000000000000000 [ 34.898766][ T2413] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000040dc0 [ 34.906910][ T2413] RBP: 000000000000000b R08: ffa000000ce8fd44 R09: ff11000104e13bc0 [ 34.915074][ T2413] R10: ffa000000ce8feb0 R11: ffa0000023201000 R12: 0000000000000000 [ 34.923264][ T2413] R13: 0000000000000001 R14: 0000000000000dc0 R15: 0000000003200000 [ 34.931414][ T2413] FS: 00007f8ac1a03840(0000) GS:ff1100103e780000(0000) knlGS:0000000000000000 [ 34.940527][ T2413] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 34.947348][ T2413] CR2: 000056306078b000 CR3: 00000001307f4001 CR4: 0000000000771ef0 [ 34.955505][ T2413] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 34.963661][ T2413] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 34.971815][ T2413] PKRU: 55555554 [ 34.975551][ T2413] Call Trace: [ 34.979030][ T2413] [ 34.982179][ T2413] ? __warn (kernel/panic.c:693) [ 34.986427][ T2413] ? __alloc_pages_noprof (mm/page_alloc.c:4685 (discriminator 11)) [ 34.991965][ T2413] ? report_bug (lib/bug.c:180 lib/bug.c:219) [ 34.996643][ T2413] ? handle_bug (arch/x86/kernel/traps.c:239) [ 35.001163][ T2413] ? exc_invalid_op (arch/x86/kernel/traps.c:260 (discriminator 1)) [ 35.006011][ T2413] ? asm_exc_invalid_op (arch/x86/include/asm/idtentry.h:621) [ 35.011233][ T2413] ? __alloc_pages_noprof (mm/page_alloc.c:4685 (discriminator 11)) [ 35.016765][ T2413] __kmalloc_large_node (mm/slub.c:4069) [ 35.022043][ T2413] __kmalloc_noprof (arch/x86/include/asm/bitops.h:417 include/asm-generic/getorder.h:46 mm/slub.c:4113 mm/slub.c:4136) [ 35.027066][ T2413] ? __do_sys_swapon (mm/swapfile.c:3173) [ 35.032196][ T2413] ? __do_sys_swapon (mm/swapfile.c:3173) [ 35.037290][ T2413] ? __do_sys_swapon (mm/swapfile.c:3167) [ 35.042379][ T2413] __do_sys_swapon (mm/swapfile.c:3173) [ 35.047300][ T2413] do_syscall_64 (arch/x86/entry/common.c:52 (discriminator 1) arch/x86/entry/common.c:83 (discriminator 1)) [ 35.051955][ T2413] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 35.058002][ T2413] RIP: 0033:0x7f8ac1bcef97 [ 35.062571][ T2413] Code: 73 01 c3 48 8b 0d 69 2e 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a7 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 39 2e 0d 00 f7 d8 64 89 01 48 All code ======== 0: 73 01 jae 0x3 2: c3 retq 3: 48 8b 0d 69 2e 0d 00 mov 0xd2e69(%rip),%rcx # 0xd2e73 a: f7 d8 neg %eax c: 64 89 01 mov %eax,%fs:(%rcx) f: 48 83 c8 ff or $0xffffffffffffffff,%rax 13: c3 retq 14: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1b: 00 00 00 1e: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 23: b8 a7 00 00 00 mov $0xa7,%eax 28: 0f 05 syscall 2a:* 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 30: 73 01 jae 0x33 32: c3 retq 33: 48 8b 0d 39 2e 0d 00 mov 0xd2e39(%rip),%rcx # 0xd2e73 3a: f7 d8 neg %eax 3c: 64 89 01 mov %eax,%fs:(%rcx) 3f: 48 rex.W Code starting with the faulting instruction =========================================== 0: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax 6: 73 01 jae 0x9 8: c3 retq 9: 48 8b 0d 39 2e 0d 00 mov 0xd2e39(%rip),%rcx # 0xd2e49 10: f7 d8 neg %eax 12: 64 89 01 mov %eax,%fs:(%rcx) 15: 48 rex.W [ 35.063745][ T1492] is_virt=false [ 35.082007][ T2413] RSP: 002b:00007fffa761ac08 EFLAGS: 00000246 ORIG_RAX: 00000000000000a7 [ 35.082010][ T2413] RAX: ffffffffffffffda RBX: 000056306077c190 RCX: 00007f8ac1bcef97 [ 35.082010][ T2413] RDX: 0000000000008001 RSI: 0000000000008001 RDI: 000056306077c190 [ 35.082011][ T2413] RBP: 0000000000008001 R08: 0000000000000ff6 R09: 0000000000001000 [ 35.082012][ T2413] R10: 4e45505355533253 R11: 0000000000000246 R12: 00007fffa761ae3c [ 35.082012][ T2413] R13: 0000000000000001 R14: 0000003200000000 R15: 000056306077cfe0 [ 35.082014][ T2413] [ 35.082015][ T2413] ---[ end trace 0000000000000000 ]--- The kernel config and materials to reproduce are available at: https://download.01.org/0day-ci/archive/20240624/202406241651.963e3e78-oliver.sang@intel.com -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki . From: Zhang Zekun To: , , , CC: , , Subject: [PATCH] iommu/iova: Bettering utilizing cpu_rcaches in no-strict mode Date: Mon, 24 Jun 2024 16:39:52 +0800 Message-ID: <20240624083952.52612-1-zhangzekun11@huawei.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256595 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.iommu Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Currently, when iommu working in no-strict mode, fq_flush_timeout() will always try to free iovas on one cpu. Freeing the iovas from all cpus on one cpu is not cache-friendly to iova_rcache, because it will first filling up the cpu_rcache and then pushing iovas to the depot, iovas in the depot will finally goto the underlying rbtree if the depot_size is greater than num_online_cpus(). Let fq_flush_timeout() freeing iovas on cpus who call dma_unmap* APIs, can decrease the overall time caused by fq_flush_timeout() by better utilizing the iova_rcache, and minimizing the competition for the iova_rbtree_lock(). Signed-off-by: Zhang Zekun --- drivers/iommu/dma-iommu.c | 22 +++++++++++++--------- drivers/iommu/iova.c | 21 ++++++++++++++------- include/linux/iova.h | 7 +++++++ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 43520e7275cc..217b7c70d06c 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -145,7 +145,8 @@ static inline unsigned int fq_ring_add(struct iova_fq *fq) return idx; } -static void fq_ring_free_locked(struct iommu_dma_cookie *cookie, struct iova_fq *fq) +static void fq_ring_free_locked(struct iommu_dma_cookie *cookie, struct iova_fq *fq, + int cpu) { u64 counter = atomic64_read(&cookie->fq_flush_finish_cnt); unsigned int idx; @@ -158,20 +159,21 @@ static void fq_ring_free_locked(struct iommu_dma_cookie *cookie, struct iova_fq break; iommu_put_pages_list(&fq->entries[idx].freelist); - free_iova_fast(&cookie->iovad, + free_iova_fast_cpu(&cookie->iovad, fq->entries[idx].iova_pfn, - fq->entries[idx].pages); + fq->entries[idx].pages, cpu); fq->head = (fq->head + 1) & fq->mod_mask; } } -static void fq_ring_free(struct iommu_dma_cookie *cookie, struct iova_fq *fq) +static void fq_ring_free(struct iommu_dma_cookie *cookie, struct iova_fq *fq, + int cpu) { unsigned long flags; spin_lock_irqsave(&fq->lock, flags); - fq_ring_free_locked(cookie, fq); + fq_ring_free_locked(cookie, fq, cpu); spin_unlock_irqrestore(&fq->lock, flags); } @@ -191,10 +193,11 @@ static void fq_flush_timeout(struct timer_list *t) fq_flush_iotlb(cookie); if (cookie->options.qt == IOMMU_DMA_OPTS_SINGLE_QUEUE) { - fq_ring_free(cookie, cookie->single_fq); + cpu = smp_processor_id(); + fq_ring_free(cookie, cookie->single_fq, cpu); } else { for_each_possible_cpu(cpu) - fq_ring_free(cookie, per_cpu_ptr(cookie->percpu_fq, cpu)); + fq_ring_free(cookie, per_cpu_ptr(cookie->percpu_fq, cpu), cpu); } } @@ -205,6 +208,7 @@ static void queue_iova(struct iommu_dma_cookie *cookie, struct iova_fq *fq; unsigned long flags; unsigned int idx; + int cpu = smp_processor_id(); /* * Order against the IOMMU driver's pagetable update from unmapping @@ -227,11 +231,11 @@ static void queue_iova(struct iommu_dma_cookie *cookie, * flushed out on another CPU. This makes the fq_full() check below less * likely to be true. */ - fq_ring_free_locked(cookie, fq); + fq_ring_free_locked(cookie, fq, cpu); if (fq_full(fq)) { fq_flush_iotlb(cookie); - fq_ring_free_locked(cookie, fq); + fq_ring_free_locked(cookie, fq, cpu); } idx = fq_ring_add(fq); diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index d59d0ea2fd21..46a2188c263b 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -20,7 +20,7 @@ static bool iova_rcache_insert(struct iova_domain *iovad, unsigned long pfn, - unsigned long size); + unsigned long size, int cpu); static unsigned long iova_rcache_get(struct iova_domain *iovad, unsigned long size, unsigned long limit_pfn); @@ -423,12 +423,19 @@ EXPORT_SYMBOL_GPL(alloc_iova_fast); void free_iova_fast(struct iova_domain *iovad, unsigned long pfn, unsigned long size) { - if (iova_rcache_insert(iovad, pfn, size)) + free_iova_fast_cpu(iovad, pfn, size, smp_processor_id()); +} +EXPORT_SYMBOL_GPL(free_iova_fast); + +void +free_iova_fast_cpu(struct iova_domain *iovad, unsigned long pfn, + unsigned long size, int cpu) +{ + if (iova_rcache_insert(iovad, pfn, size, cpu)) return; free_iova(iovad, pfn); } -EXPORT_SYMBOL_GPL(free_iova_fast); static void iova_domain_free_rcaches(struct iova_domain *iovad) { @@ -762,13 +769,13 @@ EXPORT_SYMBOL_GPL(iova_domain_init_rcaches); */ static bool __iova_rcache_insert(struct iova_domain *iovad, struct iova_rcache *rcache, - unsigned long iova_pfn) + unsigned long iova_pfn, int cpu) { struct iova_cpu_rcache *cpu_rcache; bool can_insert = false; unsigned long flags; - cpu_rcache = raw_cpu_ptr(rcache->cpu_rcaches); + cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu); spin_lock_irqsave(&cpu_rcache->lock, flags); if (!iova_magazine_full(cpu_rcache->loaded)) { @@ -799,14 +806,14 @@ static bool __iova_rcache_insert(struct iova_domain *iovad, } static bool iova_rcache_insert(struct iova_domain *iovad, unsigned long pfn, - unsigned long size) + unsigned long size, int cpu) { unsigned int log_size = order_base_2(size); if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE) return false; - return __iova_rcache_insert(iovad, &iovad->rcaches[log_size], pfn); + return __iova_rcache_insert(iovad, &iovad->rcaches[log_size], pfn, cpu); } /* diff --git a/include/linux/iova.h b/include/linux/iova.h index d2c4fd923efa..91e4e3d5bcb3 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h @@ -93,6 +93,8 @@ struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size, bool size_aligned); void free_iova_fast(struct iova_domain *iovad, unsigned long pfn, unsigned long size); +void free_iova_fast_cpu(struct iova_domain *iovad, unsigned long pfn, + unsigned long size, int cpu); unsigned long alloc_iova_fast(struct iova_domain *iovad, unsigned long size, unsigned long limit_pfn, bool flush_rcache); struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, @@ -134,6 +136,11 @@ static inline void free_iova_fast(struct iova_domain *iovad, { } +static inline void free_iova_fast_cpu(struct iova_domain *iovad, unsigned long pfn, + unsigned long size, int cpu); +{ +} + static inline unsigned long alloc_iova_fast(struct iova_domain *iovad, unsigned long size, unsigned long limit_pfn, -- 2.17.1 . From: Xi Ruoyao To: Christian Brauner , Alexander Viro , Jan Kara , Mateusz Guzik , Linus Torvalds Cc: Xi Ruoyao , Alejandro Colomar , Arnd Bergmann , Huacai Chen , Xuerui Wang , Jiaxun Yang , Icenowy Zheng , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2] vfs: Shortcut AT_EMPTY_PATH early for statx, and add AT_NO_PATH for statx and fstatat Date: Mon, 24 Jun 2024 16:50:26 +0800 Message-ID: <20240624085037.33442-2-xry111@xry111.site> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256596 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.loongarch,org.kernel.vger.linux-arch,org.kernel.vger.linux-fsdevel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail It's cheap to check if the path is empty in the userspace, but expensive to check if a userspace string is empty from the kernel. So it seems a waste to delay the check into the kernel, and using statx(AT_EMPTY_PATH) to implement fstat is slower than a "native" fstat call. In the past there was a similar performance issue with several Glibc releases using fstatat(AT_EMPTY_PATH) for fstat. That issue was fixed by Glibc with reverting back to plain fstat, and worked around by the kernel with a special fast code path for fstatat(AT_EMPTY_PATH) at commit 9013c51c630a ("vfs: mostly undo glibc turning 'fstat()' into 'fstatat(AT_EMPTY_PATH)'"). But for arch/loongarch fstat does not exist, so we have to use statx. And on all 32-bit architectures we must use statx for fstat after 2037 since the plain fstat call uses 32-bit timestamp. Thus Glibc uses statx for fstat on LoongArch and all 32-bit platforms, and these platforms still suffer the performance issue. So port the fstatat(AT_EMPTY_PATH) fast path to statx(AT_EMPTY_PATH) as well, and add AT_NO_PATH (the name is suggested by Mateusz) which makes statx and fstatat completely skip the path check and assume the path is empty. Benchmark on LoongArch Loongson 3A6000: 1. Unpatched kernel, Glibc fstat, actually statx(AT_EMPTY_PATH): 2575328 ops/s 2. Patched kernel, Glibc fstat, actually statx(AT_EMPTY_PATH): 5434782 ops/s, +111% from 1 3. Patched kernel, statx(AT_NO_PATH): 5773672 ops/s, +124% from 1, +6.2% from 2. Seccomp sandboxes can also green light fstatat/statx(AT_NO_PATH) easier than fstatat/statx(AT_EMPTY_PATH) for which the audition needs to check 5434782543478254347825434782the path but seccomp BPF program cannot do that now. Link: https://sourceware.org/pipermail/libc-alpha/2023-September/151364.html Link: https://sourceware.org/git/?p=glibc.git;a=commit;h=e6547d635b99 Link: https://sourceware.org/git/?p=glibc.git;a=commit;h=551101e8240b Link: https://lore.kernel.org/loongarch/599df4a3-47a4-49be-9c81-8e21ea1f988a@xen0n.name/ Cc: Christian Brauner Cc: Alexander Viro Cc: Jan Kara Cc: Linus Torvalds Cc: Mateusz Guzik Cc: Alejandro Colomar Cc: Arnd Bergmann Cc: Huacai Chen Cc: Xuerui Wang Cc: Jiaxun Yang Cc: Icenowy Zheng Cc: linux-fsdevel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: loongarch@lists.linux.dev Cc: linux-kernel@vger.kernel.org Signed-off-by: Xi Ruoyao --- Superseds https://lore.kernel.org/all/20240622105621.7922-1-xry111@xry111.site/. fs/stat.c | 103 +++++++++++++++++++++++++------------ include/uapi/linux/fcntl.h | 3 ++ 2 files changed, 74 insertions(+), 32 deletions(-) diff --git a/fs/stat.c b/fs/stat.c index 70bd3e888cfa..2b7d4a22f971 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -208,7 +208,7 @@ int getname_statx_lookup_flags(int flags) lookup_flags |= LOOKUP_FOLLOW; if (!(flags & AT_NO_AUTOMOUNT)) lookup_flags |= LOOKUP_AUTOMOUNT; - if (flags & AT_EMPTY_PATH) + if (flags & (AT_EMPTY_PATH | AT_NO_PATH)) lookup_flags |= LOOKUP_EMPTY; return lookup_flags; @@ -217,7 +217,8 @@ int getname_statx_lookup_flags(int flags) /** * vfs_statx - Get basic and extra attributes by filename * @dfd: A file descriptor representing the base dir for a relative filename - * @filename: The name of the file of interest + * @filename: The name of the file of interest, or NULL if the file of + interest is dfd itself and dfd isn't AT_FDCWD * @flags: Flags to control the query * @stat: The result structure to fill in. * @request_mask: STATX_xxx flags indicating what the caller wants @@ -232,42 +233,56 @@ int getname_statx_lookup_flags(int flags) static int vfs_statx(int dfd, struct filename *filename, int flags, struct kstat *stat, u32 request_mask) { - struct path path; + struct path path, *p; + struct fd f; unsigned int lookup_flags = getname_statx_lookup_flags(flags); int error; if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | AT_EMPTY_PATH | - AT_STATX_SYNC_TYPE)) + AT_STATX_SYNC_TYPE | AT_NO_PATH)) return -EINVAL; retry: - error = filename_lookup(dfd, filename, lookup_flags, &path, NULL); - if (error) - goto out; + if (filename) { + p = &path; + error = filename_lookup(dfd, filename, lookup_flags, p, + NULL); + if (error) + goto out; + } else { + f = fdget_raw(dfd); + if (!f.file) + return -EBADF; + p = &f.file->f_path; + } - error = vfs_getattr(&path, stat, request_mask, flags); + error = vfs_getattr(p, stat, request_mask, flags); if (request_mask & STATX_MNT_ID_UNIQUE) { - stat->mnt_id = real_mount(path.mnt)->mnt_id_unique; + stat->mnt_id = real_mount(p->mnt)->mnt_id_unique; stat->result_mask |= STATX_MNT_ID_UNIQUE; } else { - stat->mnt_id = real_mount(path.mnt)->mnt_id; + stat->mnt_id = real_mount(p->mnt)->mnt_id; stat->result_mask |= STATX_MNT_ID; } - if (path.mnt->mnt_root == path.dentry) + if (p->mnt->mnt_root == p->dentry) stat->attributes |= STATX_ATTR_MOUNT_ROOT; stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT; /* Handle STATX_DIOALIGN for block devices. */ if (request_mask & STATX_DIOALIGN) { - struct inode *inode = d_backing_inode(path.dentry); + struct inode *inode = d_backing_inode(p->dentry); if (S_ISBLK(inode->i_mode)) bdev_statx_dioalign(inode, stat); } - path_put(&path); + if (filename) + path_put(p); + else + fdput(f); + if (retry_estale(error, lookup_flags)) { lookup_flags |= LOOKUP_REVAL; goto retry; @@ -276,33 +291,53 @@ static int vfs_statx(int dfd, struct filename *filename, int flags, return error; } -int vfs_fstatat(int dfd, const char __user *filename, - struct kstat *stat, int flags) +static struct filename *getname_statx(int dfd, const char __user *filename, + int flags) { - int ret; - int statx_flags = flags | AT_NO_AUTOMOUNT; - struct filename *name; + int r; + char c; + bool no_path = false; + + if (dfd < 0 && dfd != AT_FDCWD) + return ERR_PTR(-EBADF); /* - * Work around glibc turning fstat() into fstatat(AT_EMPTY_PATH) + * Work around glibc turning fstat() into fstatat(AT_EMPTY_PATH) or + * statx(AT_EMPTY_PATH) * * If AT_EMPTY_PATH is set, we expect the common case to be that * empty path, and avoid doing all the extra pathname work. */ - if (dfd >= 0 && flags == AT_EMPTY_PATH) { - char c; + if (flags & AT_NO_PATH) + no_path = true; + else if (flags & AT_EMPTY_PATH) { + r = get_user(c, filename); + if (unlikely(r)) + return ERR_PTR(r); + no_path = likely(!c); + } - ret = get_user(c, filename); - if (unlikely(ret)) - return ret; + if (no_path) + return dfd == AT_FDCWD ? getname_kernel("") : NULL; - if (likely(!c)) - return vfs_fstat(dfd, stat); - } + return getname_flags(filename, getname_statx_lookup_flags(flags), + NULL); +} + +int vfs_fstatat(int dfd, const char __user *filename, + struct kstat *stat, int flags) +{ + int ret; + int statx_flags = flags | AT_NO_AUTOMOUNT; + struct filename *name = getname_statx(dfd, filename, flags); + + if (IS_ERR(name)) + return PTR_ERR(name); - name = getname_flags(filename, getname_statx_lookup_flags(statx_flags), NULL); ret = vfs_statx(dfd, name, statx_flags, stat, STATX_BASIC_STATS); - putname(name); + + if (name) + putname(name); return ret; } @@ -703,11 +738,15 @@ SYSCALL_DEFINE5(statx, struct statx __user *, buffer) { int ret; - struct filename *name; + struct filename *name = getname_statx(dfd, filename, flags); + + if (IS_ERR(name)) + return PTR_ERR(name); - name = getname_flags(filename, getname_statx_lookup_flags(flags), NULL); ret = do_statx(dfd, name, flags, mask, buffer); - putname(name); + + if (name) + putname(name); return ret; } diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h index c0bcc185fa48..470b5c77000c 100644 --- a/include/uapi/linux/fcntl.h +++ b/include/uapi/linux/fcntl.h @@ -113,6 +113,9 @@ #define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */ #define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */ +#define AT_NO_PATH 0x10000 /* Ignore relative pathname, + behave as if AT_EMPTY_PATH and + the relative pathname is empty */ /* Flags for name_to_handle_at(2). We reuse AT_ flag space to save bits... */ #define AT_HANDLE_FID AT_REMOVEDIR /* file handle is needed to -- 2.45.2 . From: Mateusz Guzik To: akpm@linux-foundation.org Cc: brauner@kernel.org, viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Mateusz Guzik Subject: [PATCH v2] vfs: remove redundant smp_mb for thp handling in do_dentry_open Date: Mon, 24 Jun 2024 10:54:02 +0200 Message-ID: <20240624085402.493630-1-mjguzik@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256598 org.kvack.linux-mm:201077 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-fsdevel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail opening for write performs: if (f->f_mode & FMODE_WRITE) { [snip] smp_mb(); if (filemap_nr_thps(inode->i_mapping)) { [snip] } } filemap_nr_thps on kernels built without CONFIG_READ_ONLY_THP_FOR expands to 0, allowing the compiler to eliminate the entire thing, with exception of the fence (and the branch leading there). So happens required synchronisation between i_writecount and nr_thps changes is already provided by the full fence coming from get_write_access -> atomic_inc_unless_negative, thus the smp_mb instance above can be removed regardless of CONFIG_READ_ONLY_THP_FOR. While I updated commentary in places claiming to match the now-removed fence, I did not try to patch them to act on the compile option. I did not bother benchmarking it, not issuing a spurious full fence in the fast path does not warrant justification from perf standpoint. Signed-off-by: Mateusz Guzik --- v2: - just whack the fence instead of ifdefing - change To recipient, the person who committed the original change is no longer active fs/open.c | 9 ++++----- mm/khugepaged.c | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/open.c b/fs/open.c index 28f2fcbebb1b..64976b6dc75f 100644 --- a/fs/open.c +++ b/fs/open.c @@ -986,12 +986,11 @@ static int do_dentry_open(struct file *f, */ if (f->f_mode & FMODE_WRITE) { /* - * Paired with smp_mb() in collapse_file() to ensure nr_thps - * is up to date and the update to i_writecount by - * get_write_access() is visible. Ensures subsequent insertion - * of THPs into the page cache will fail. + * Depends on full fence from get_write_access() to synchronize + * against collapse_file() regarding i_writecount and nr_thps + * updates. Ensures subsequent insertion of THPs into the page + * cache will fail. */ - smp_mb(); if (filemap_nr_thps(inode->i_mapping)) { struct address_space *mapping = inode->i_mapping; diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 409f67a817f1..2e017585f813 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1997,9 +1997,9 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, if (!is_shmem) { filemap_nr_thps_inc(mapping); /* - * Paired with smp_mb() in do_dentry_open() to ensure - * i_writecount is up to date and the update to nr_thps is - * visible. Ensures the page cache will be truncated if the + * Paired with the fence in do_dentry_open() -> get_write_access() + * to ensure i_writecount is up to date and the update to nr_thps + * is visible. Ensures the page cache will be truncated if the * file is opened writable. */ smp_mb(); @@ -2187,8 +2187,8 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr, if (!is_shmem && result == SCAN_COPY_MC) { filemap_nr_thps_dec(mapping); /* - * Paired with smp_mb() in do_dentry_open() to - * ensure the update to nr_thps is visible. + * Paired with the fence in do_dentry_open() -> get_write_access() + * to ensure the update to nr_thps is visible. */ smp_mb(); } -- 2.43.0 . From: Neil Armstrong Date: Mon, 24 Jun 2024 10:58:23 +0200 Subject: [PATCH] dt-bindings: usb: dwc2: switch to unevaluatedProperties X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-topic-amlogic-upstream-bindings-fixes-dwc2-subnodes-v1-1-f2544f21f594@linaro.org> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Fabrice Gasnier Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256603 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-usb Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Define "unevaluatedProperties" instead of "additionalProperties" to allow properties from common schemas but still disallow undefined properties. This allow defining a device subnode and fixes: meson-gxbb-odroidc2.dtb: usb@c9100000: '#address-cells', '#size-cells', 'hub@1' do not match any of the regexes: 'p inctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/usb/dwc2.yaml# Fixes: bb88dbbee2c9 ("dt-bindings: usb: dwc2: Add reference to usb-drd.yaml") Fixes: 54bd6c9a3b7b ("dt-bindings: usb: dwc2: document TPL support") Signed-off-by: Neil Armstrong --- Documentation/devicetree/bindings/usb/dwc2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/dwc2.yaml b/Documentation/devicetree/bindings/usb/dwc2.yaml index 4f36a22aa6d7..a5f2e3442a0e 100644 --- a/Documentation/devicetree/bindings/usb/dwc2.yaml +++ b/Documentation/devicetree/bindings/usb/dwc2.yaml @@ -188,7 +188,7 @@ required: - clocks - clock-names -additionalProperties: false +unevaluatedProperties: false examples: - | --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240624-topic-amlogic-upstream-bindings-fixes-dwc2-subnodes-f88620bca1fa Best regards, -- Neil Armstrong . From: Neil Armstrong Date: Mon, 24 Jun 2024 10:59:36 +0200 Subject: [PATCH] arm64: dts: amlogic: ad402: fix thermal zone node name X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-topic-amlogic-upstream-bindings-fixes-dts-round-2-v1-1-0a21f456eb8d@linaro.org> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Dmitry Rokosov Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Neil Armstrong Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256605 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-amlogic,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Fixes the following: thermal-zones: 'soc_thermal' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml# Fixes: 593ab951232b ("arm64: dts: amlogic: ad402: setup thermal-zones") Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts index 6883471a93b4..0d92f5253b64 100644 --- a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts +++ b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts @@ -86,7 +86,7 @@ vddio_1v8: regulator-vddio-1v8 { }; thermal-zones { - soc_thermal: soc_thermal { + soc_thermal: soc-thermal { polling-delay = <1000>; polling-delay-passive = <100>; sustainable-power = <130>; --- base-commit: 202661addeb4130fbd99075ab7b4f5290a692542 change-id: 20240624-topic-amlogic-upstream-bindings-fixes-dts-round-2-5ca9b1193bff Best regards, -- Neil Armstrong . From: Mauro Carvalho Chehab To: Cc: Mauro Carvalho Chehab , Borislav Petkov , Tony Luck , James Morse , Jonathan Cameron , Shiju Jose , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, Ard Biesheuvel , Jonathan Corbet , Len Brown , linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v5 0/4] fix CPER issues related to UEFI 2.9A Errata Date: Mon, 24 Jun 2024 11:19:17 +0200 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256628 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-acpi,org.kernel.vger.linux-doc,org.kernel.vger.linux-edac,org.kernel.vger.linux-efi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The UEFI 2.9A errata makes clear how ARM processor type encoding should be done: it is meant to be equal to Generic processor, using a bitmask. The current code assumes, for both generic and ARM processor types that this is an integer, which is an incorrect assumption. Fix it. While here, also fix a compilation issue when using W=1. After the change, Kernel will properly decode receiving two errors at the same message, as defined at UEFI spec: [ 75.282430] Memory failure: 0x5cdfd: recovery action for free buddy page: Recovered [ 94.973081] {2}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1 [ 94.973770] {2}[Hardware Error]: event severity: recoverable [ 94.974334] {2}[Hardware Error]: Error 0, type: recoverable [ 94.974962] {2}[Hardware Error]: section_type: ARM processor error [ 94.975586] {2}[Hardware Error]: MIDR: 0x000000000000cd24 [ 94.976202] {2}[Hardware Error]: Multiprocessor Affinity Register (MPIDR): 0x000000000000ab12 [ 94.977011] {2}[Hardware Error]: error affinity level: 2 [ 94.977593] {2}[Hardware Error]: running state: 0x1 [ 94.978135] {2}[Hardware Error]: Power State Coordination Interface state: 4660 [ 94.978884] {2}[Hardware Error]: Error info structure 0: [ 94.979463] {2}[Hardware Error]: num errors: 3 [ 94.979971] {2}[Hardware Error]: first error captured [ 94.980523] {2}[Hardware Error]: propagated error captured [ 94.981110] {2}[Hardware Error]: overflow occurred, error info is incomplete [ 94.981893] {2}[Hardware Error]: error_type: 0x0006: cache error|TLB error [ 94.982606] {2}[Hardware Error]: error_info: 0x000000000091000f [ 94.983249] {2}[Hardware Error]: transaction type: Data Access [ 94.983891] {2}[Hardware Error]: cache error, operation type: Data write [ 94.984559] {2}[Hardware Error]: TLB error, operation type: Data write [ 94.985215] {2}[Hardware Error]: cache level: 2 [ 94.985749] {2}[Hardware Error]: TLB level: 2 [ 94.986277] {2}[Hardware Error]: processor context not corrupted And the error code is properly decoded according with table N.17 from UEFI 2.10 spec: [ 94.981893] {2}[Hardware Error]: error_type: 0x0006: cache error|TLB error The error injection logic was checked via QEMU using this patch: https://lore.kernel.org/all/20240621165115.336-1-shiju.jose@huawei.com/ v5: - Do some cleanups and minor fixes as suggested by Jonathan and Tony: - check errors at strscpy(); - simplify cper_bits_to_str() function; - use FIELD_GET() and for_each_set_bit(); - use ARRAY_SIZE() on infofx to let it clear that it should be size of newpfx + 1; - fix kernel-doc warning with W=1; - use kernel-doc for two exported functions at cper.c. v4: - The print function had some bugs on it, which was discovered with the help of an error injection tool I'm now using. v3: - It adds a helper function to produce a buffer describing the error bits at cper's printk and ghes pr_warn_bitrated. It also fixes a W=1 error while building cper. v2: - It fixes the way printks are handled on both cper_arm and ghes drivers. v1: - (tagged as RFC) was mostly to give a heads up that the current implementation is not following the spec. It also touches only cper code. Mauro Carvalho Chehab (4): efi/cper: Adjust infopfx size to accept an extra space efi/cper: Add a new helper function to print bitmasks efi/cper: align ARM CPER type with UEFI 2.9A/2.10 specs docs: efi: add CPER functions to driver-api .../driver-api/firmware/efi/index.rst | 11 ++-- drivers/acpi/apei/ghes.c | 15 +++--- drivers/firmware/efi/cper-arm.c | 52 +++++++++---------- drivers/firmware/efi/cper.c | 41 ++++++++++++++- include/linux/cper.h | 12 +++-- 5 files changed, 89 insertions(+), 42 deletions(-) -- 2.45.2 . From: Sibi Sankar To: , , , , , , CC: , , , , , , , , Subject: [PATCH V3 0/4] arm64: dts: qcom: x1e80100: Enable bwmon support Date: Mon, 24 Jun 2024 14:52:10 +0530 Message-ID: <20240624092214.146935-1-quic_sibis@quicinc.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256632 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch series enables bwmon support on X1E80100 SoCs. V3: * Pickup Rb's and Tb's from the list. * Drop OPP table from the required property list. [Konrad/Krzysztof] * Update commit message describing the race condition. [Bjorn] * Update comment in the bwmon driver. [Dmitry] * Add a comment describing which cluster each bwmon instance belongs to. [Konrad] V2: * Allow for opp-tables to be optional on X1E cpu-bwmon instances. [Konrad] * Drop Rb from Krzysztof due to more bindings changes. * Use explicit request/free irq and add comments regarding the race introduced when adding the IRQF_SHARED flag. [Krzysztof/Dmitry] * Use consistent numbering of the opps across instances. [Shiv] * Use ICC_TAG_ACTIVE_ONLY instead of magic numbers. [Konrad] * Drop fastrpc enablement patch. [Bjorn] tag: next-20240621 base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 Sibi Sankar (4): dt-bindings: interconnect: qcom,msm8998-bwmon: Remove opp-table from the required list dt-bindings: interconnect: qcom,msm8998-bwmon: Add X1E80100 BWMON instances soc: qcom: icc-bwmon: Allow for interrupts to be shared across instances arm64: dts: qcom: x1e80100: Add BWMONs .../interconnect/qcom,msm8998-bwmon.yaml | 3 +- arch/arm64/boot/dts/qcom/x1e80100.dtsi | 123 ++++++++++++++++++ drivers/soc/qcom/icc-bwmon.c | 12 +- 3 files changed, 134 insertions(+), 4 deletions(-) -- 2.34.1 . From: Jiwei Sun To: nirmal.patel@linux.intel.com, jonathan.derrick@linux.dev Cc: paul.m.stillwell.jr@intel.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, sunjw10@lenovo.com, ahuang12@lenovo.com, sunjw10@outlook.com Subject: [PATCH v2] PCI: vmd: Use raw spinlock for cfg_lock Date: Mon, 24 Jun 2024 17:37:00 +0800 Message-ID: Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256650 org.kernel.vger.linux-pci:144397 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Jiwei Sun If the kernel is built with the following configurations and booting CONFIG_VMD=y CONFIG_DEBUG_LOCKDEP=y CONFIG_DEBUG_SPINLOCK=y CONFIG_PROVE_LOCKING=y CONFIG_PROVE_RAW_LOCK_NESTING=y The following log appears, ============================= [ BUG: Invalid wait context ] 6.10.0-rc4 #80 Not tainted ----------------------------- kworker/18:2/633 is trying to lock: ffff888c474e5648 (&vmd->cfg_lock){....}-{3:3}, at: vmd_pci_write+0x185/0x2a0 other info that might help us debug this: context-{5:5} 4 locks held by kworker/18:2/633: #0: ffff888100108958 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0xf78/0x1920 #1: ffffc9000ae1fd90 ((work_completion)(&wfc.work)){+.+.}-{0:0}, at: process_one_work+0x7fe/0x1920 #2: ffff888c483508a8 (&md->mutex){+.+.}-{4:4}, at: __pci_enable_msi_range+0x208/0x800 #3: ffff888c48329bd8 (&dev->msi_lock){....}-{2:2}, at: pci_msi_update_mask+0x91/0x170 stack backtrace: CPU: 18 PID: 633 Comm: kworker/18:2 Not tainted 6.10.0-rc4 #80 7c0f2526417bfbb7579e3c3442683c5961773c75 Hardware name: Lenovo ThinkSystem SR630/-[7X01RCZ000]-, BIOS IVEL60O-2.71 09/28/2020 Workqueue: events work_for_cpu_fn Call Trace: dump_stack_lvl+0x7c/0xc0 __lock_acquire+0x9e5/0x1ed0 lock_acquire+0x194/0x490 _raw_spin_lock_irqsave+0x42/0x90 vmd_pci_write+0x185/0x2a0 pci_msi_update_mask+0x10c/0x170 __pci_enable_msi_range+0x291/0x800 pci_alloc_irq_vectors_affinity+0x13e/0x1d0 pcie_portdrv_probe+0x570/0xe60 local_pci_probe+0xdc/0x190 work_for_cpu_fn+0x4e/0xa0 process_one_work+0x86d/0x1920 process_scheduled_works+0xd7/0x140 worker_thread+0x3e9/0xb90 kthread+0x2e9/0x3d0 ret_from_fork+0x2d/0x60 ret_from_fork_asm+0x1a/0x30 If CONFIG_PREEMPT_RT is not set, the spinlock_t is based on raw_spinlock, there is no any question in the above call trace. But if CONFIG_PREEMPT_RT is set, the spinlock_t is based on rt_mutex, a task will be scheduled when waiting for rt_mutex. For example, there are two threads are trying to hold a rt_mutex lock, if A hold the lock firstly, and B will be scheduled in rtlock_slowlock_locked() waiting for A to release the lock. The raw_spinlock is a real spinning lock, which is not allowed the task of the raw_spinlock owner is scheduled in its critical region. In other words, we should not try to acquire rt_mutex lock in the critical region of the raw_spinlock when CONFIG_PREEMPT_RT is set. CONFIG_PROVE_LOCKING and CONFIG_PROVE_RAW_LOCK_NESTING options are used to detect the invalid lock nesting (the raw_spinlock vs. spinlock nesting checks). Here is the call path: pci_msi_update_mask ---> hold raw_spinlock dev->msi_lock pci_write_config_dword pci_bus_write_config_dword vmd_pci_write ---> hold spinlock_t vmd->cfg_lock The above call path is the invalid lock nesting becuase the vmd driver tries to acquire the vmd->cfg_lock spinlock within the raw_spinlock region (dev->msi_lock). That's why the message "BUG: Invalid wait contex" is shown. Signed-off-by: Jiwei Sun Suggested-by: Adrian Huang --- v2 changes: - Add more explanations regarding the root cause in the commit message drivers/pci/controller/vmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 87b7856f375a..45d0ebf96adc 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -125,7 +125,7 @@ struct vmd_irq_list { struct vmd_dev { struct pci_dev *dev; - spinlock_t cfg_lock; + raw_spinlock_t cfg_lock; void __iomem *cfgbar; int msix_count; @@ -402,7 +402,7 @@ static int vmd_pci_read(struct pci_bus *bus, unsigned int devfn, int reg, if (!addr) return -EFAULT; - spin_lock_irqsave(&vmd->cfg_lock, flags); + raw_spin_lock_irqsave(&vmd->cfg_lock, flags); switch (len) { case 1: *value = readb(addr); @@ -417,7 +417,7 @@ static int vmd_pci_read(struct pci_bus *bus, unsigned int devfn, int reg, ret = -EINVAL; break; } - spin_unlock_irqrestore(&vmd->cfg_lock, flags); + raw_spin_unlock_irqrestore(&vmd->cfg_lock, flags); return ret; } @@ -437,7 +437,7 @@ static int vmd_pci_write(struct pci_bus *bus, unsigned int devfn, int reg, if (!addr) return -EFAULT; - spin_lock_irqsave(&vmd->cfg_lock, flags); + raw_spin_lock_irqsave(&vmd->cfg_lock, flags); switch (len) { case 1: writeb(value, addr); @@ -455,7 +455,7 @@ static int vmd_pci_write(struct pci_bus *bus, unsigned int devfn, int reg, ret = -EINVAL; break; } - spin_unlock_irqrestore(&vmd->cfg_lock, flags); + raw_spin_unlock_irqrestore(&vmd->cfg_lock, flags); return ret; } @@ -1015,7 +1015,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) if (features & VMD_FEAT_OFFSET_FIRST_VECTOR) vmd->first_vec = 1; - spin_lock_init(&vmd->cfg_lock); + raw_spin_lock_init(&vmd->cfg_lock); pci_set_drvdata(dev, vmd); err = vmd_enable_domain(vmd, features); if (err) -- 2.27.0 . From: Bartosz Golaszewski To: Linus Walleij , Thomas Gleixner Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 0/2] gpio: sim: lock simulated GPIOs as interrupts Date: Mon, 24 Jun 2024 11:39:31 +0200 Message-ID: <20240624093934.17089-1-brgl@bgdev.pl> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256653 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-gpio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Bartosz Golaszewski I realized that the gpio-sim module doesn't lock the GPIOs as interrupts when they are requested from the irq_sim. This leads to users being able to change the direction of GPIOs that should remain as inputs to output. This series extends the irq_sim interface and allows users to supply callbacks that will be executed to inform users about interrupts being requested and released so that they can act accordingly. The gpio-sim is made to use this new API and lock GPIOs as interrupts when needed. Thomas: if this is fine with you, can you Ack it so that I can take it through the GPIO tree for the next merge window? Changes since v1: - drop the notifier in favor of specific callbacks Bartosz Golaszewski (2): genirq/irq_sim: add an extended irq_sim initializer gpio: sim: lock GPIOs as interrupts when they are requested drivers/gpio/gpio-sim.c | 25 ++++++++++++++++- include/linux/irq_sim.h | 17 ++++++++++++ kernel/irq/irq_sim.c | 60 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 98 insertions(+), 4 deletions(-) -- 2.43.0 . From: Jason-JH.Lin To: Chun-Kuang Hu , AngeloGioacchino Del Regno CC: , , , , Jason-ch Chen , "Jason-JH . Lin" , Singo Chang , Nancy Lin Subject: [PATCH] drm/mediatek: Fix bit depth overwritten for mtk_ovl_set bit_depth() Date: Mon, 24 Jun 2024 17:57:26 +0800 Message-ID: <20240624095726.18818-1-jason-jh.lin@mediatek.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256668 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Refine the value and mask define of bit depth for mtk_ovl_set bit_depth(). Use cmdq_pkt_write_mask() instead of cmdq_pkt_write() to avoid bit depth settings being overwritten. Fixes: fb36c5020c9c ("drm/mediatek: Add support for AR30 and BA30 overlays") Signed-off-by: Jason-JH.Lin --- Based on: https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 4b370bc0746d..d35f5b4b22c2 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -42,7 +42,11 @@ #define DISP_REG_OVL_RDMA_CTRL(n) (0x00c0 + 0x20 * (n)) #define DISP_REG_OVL_RDMA_GMC(n) (0x00c8 + 0x20 * (n)) #define DISP_REG_OVL_ADDR_MT2701 0x0040 -#define DISP_REG_OVL_CLRFMT_EXT 0x02D0 +#define DISP_REG_OVL_CLRFMT_EXT 0x02d0 +#define OVL_CON_CLRFMT_BIT_DEPTH_MASK(n) (GENMASK(1, 0) << (4 * (n))) +#define OVL_CON_CLRFMT_BIT_DEPTH(depth, n) ((depth) << (4 * (n))) +#define OVL_CON_CLRFMT_8_BIT (0) +#define OVL_CON_CLRFMT_10_BIT (1) #define DISP_REG_OVL_ADDR_MT8173 0x0f40 #define DISP_REG_OVL_ADDR(ovl, n) ((ovl)->data->addr + 0x20 * (n)) #define DISP_REG_OVL_HDR_ADDR(ovl, n) ((ovl)->data->addr + 0x20 * (n) + 0x04) @@ -65,10 +69,6 @@ 0 : OVL_CON_CLRFMT_RGB) #define OVL_CON_CLRFMT_RGB888(ovl) ((ovl)->data->fmt_rgb565_is_0 ? \ OVL_CON_CLRFMT_RGB : 0) -#define OVL_CON_CLRFMT_BIT_DEPTH_MASK(ovl) (0xFF << 4 * (ovl)) -#define OVL_CON_CLRFMT_BIT_DEPTH(depth, ovl) (depth << 4 * (ovl)) -#define OVL_CON_CLRFMT_8_BIT 0x00 -#define OVL_CON_CLRFMT_10_BIT 0x01 #define OVL_CON_AEN BIT(8) #define OVL_CON_ALPHA 0xff #define OVL_CON_VIRT_FLIP BIT(9) @@ -273,22 +273,17 @@ static void mtk_ovl_set_bit_depth(struct device *dev, int idx, u32 format, struct cmdq_pkt *cmdq_pkt) { struct mtk_disp_ovl *ovl = dev_get_drvdata(dev); - unsigned int reg; unsigned int bit_depth = OVL_CON_CLRFMT_8_BIT; if (!ovl->data->supports_clrfmt_ext) return; - reg = readl(ovl->regs + DISP_REG_OVL_CLRFMT_EXT); - reg &= ~OVL_CON_CLRFMT_BIT_DEPTH_MASK(idx); - if (is_10bit_rgb(format)) bit_depth = OVL_CON_CLRFMT_10_BIT; - reg |= OVL_CON_CLRFMT_BIT_DEPTH(bit_depth, idx); - - mtk_ddp_write(cmdq_pkt, reg, &ovl->cmdq_reg, - ovl->regs, DISP_REG_OVL_CLRFMT_EXT); + mtk_ddp_write_mask(cmdq_pkt, OVL_CON_CLRFMT_BIT_DEPTH(bit_depth, idx), + &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_CLRFMT_EXT, + OVL_CON_CLRFMT_BIT_DEPTH_MASK(idx)); } void mtk_ovl_config(struct device *dev, unsigned int w, -- 2.18.0 . From: Christoph Schlameuss To: linux-s390@vger.kernel.org Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , Paolo Bonzini , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH] s390/kvm: Reject memory region operations for ucontrol VMs Date: Mon, 24 Jun 2024 11:59:02 +0200 Message-ID: <20240624095902.29375-1-schlameuss@linux.ibm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256669 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.kvm,org.kernel.vger.linux-doc,org.kernel.vger.linux-s390 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This change rejects the KVM_SET_USER_MEMORY_REGION and KVM_SET_USER_MEMORY_REGION2 ioctls when called on a ucontrol VM. This is neccessary since ucontrol VMs have kvm->arch.gmap set to 0 and would thus result in a null pointer dereference further in. Memory management needs to be performed in userspace and using the ioctls KVM_S390_UCAS_MAP and KVM_S390_UCAS_UNMAP. Also improve s390 specific documentation for KVM_SET_USER_MEMORY_REGION and KVM_SET_USER_MEMORY_REGION2. Signed-off-by: Christoph Schlameuss --- Documentation/virt/kvm/api.rst | 12 ++++++++++++ arch/s390/kvm/kvm-s390.c | 3 +++ 2 files changed, 15 insertions(+) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index a71d91978d9e..eec8df1dde06 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -1403,6 +1403,12 @@ Instead, an abort (data abort if the cause of the page-table update was a load or a store, instruction abort if it was an instruction fetch) is injected in the guest. +S390: +^^^^^ + +Returns -EINVAL if the VM has the KVM_VM_S390_UCONTROL flag set. +Returns -EINVAL if called on a protected VM. + 4.36 KVM_SET_TSS_ADDR --------------------- @@ -6273,6 +6279,12 @@ state. At VM creation time, all memory is shared, i.e. the PRIVATE attribute is '0' for all gfns. Userspace can control whether memory is shared/private by toggling KVM_MEMORY_ATTRIBUTE_PRIVATE via KVM_SET_MEMORY_ATTRIBUTES as needed. +S390: +^^^^^ + +Returns -EINVAL if the VM has the KVM_VM_S390_UCONTROL flag set. +Returns -EINVAL if called on a protected VM. + 4.141 KVM_SET_MEMORY_ATTRIBUTES ------------------------------- diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 82e9631cd9ef..854d0d1410be 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -5748,6 +5748,9 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, { gpa_t size; + if (kvm_is_ucontrol(kvm)) + return -EINVAL; + /* When we are protected, we should not change the memory slots */ if (kvm_s390_pv_get_handle(kvm)) return -EINVAL; base-commit: f2661062f16b2de5d7b6a5c42a9a5c96326b8454 -- 2.45.2 . From: Sibi Sankar To: , , , , CC: , , , , , , , Subject: [PATCH V3] arm64: dts: qcom: x1e80100: Add fastrpc nodes Date: Mon, 24 Jun 2024 15:32:14 +0530 Message-ID: <20240624100214.189991-1-quic_sibis@quicinc.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256671 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add fastrpc nodes for ADSP and CDSP on X1E80100 SoC. Signed-off-by: Sibi Sankar --- tag: next-20240621 base-id: f76698bd9a8ca01d3581236082d786e9a6b72bb7 v2: * Remove redundant SID information. [Konrad] arch/arm64/boot/dts/qcom/x1e80100.dtsi | 144 +++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/qcom/x1e80100.dtsi index 9944c654851e..29af7928e63c 100644 --- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi +++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi @@ -5368,6 +5368,55 @@ IPCC_MPROC_SIGNAL_GLINK_QMP label = "lpass"; qcom,remote-pid = <2>; + fastrpc { + compatible = "qcom,fastrpc"; + qcom,glink-channels = "fastrpcglink-apps-dsp"; + label = "adsp"; + qcom,non-secure-domain; + #address-cells = <1>; + #size-cells = <0>; + + compute-cb@3 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <3>; + iommus = <&apps_smmu 0x1003 0x80>, + <&apps_smmu 0x1063 0x0>; + dma-coherent; + }; + + compute-cb@4 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <4>; + iommus = <&apps_smmu 0x1004 0x80>, + <&apps_smmu 0x1064 0x0>; + dma-coherent; + }; + + compute-cb@5 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <5>; + iommus = <&apps_smmu 0x1005 0x80>, + <&apps_smmu 0x1065 0x0>; + dma-coherent; + }; + + compute-cb@6 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <6>; + iommus = <&apps_smmu 0x1006 0x80>, + <&apps_smmu 0x1066 0x0>; + dma-coherent; + }; + + compute-cb@7 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <7>; + iommus = <&apps_smmu 0x1007 0x80>, + <&apps_smmu 0x1067 0x0>; + dma-coherent; + }; + }; + gpr { compatible = "qcom,gpr"; qcom,glink-channels = "adsp_apps"; @@ -5457,6 +5506,101 @@ IPCC_MPROC_SIGNAL_GLINK_QMP label = "cdsp"; qcom,remote-pid = <5>; + + fastrpc { + compatible = "qcom,fastrpc"; + qcom,glink-channels = "fastrpcglink-apps-dsp"; + label = "cdsp"; + qcom,non-secure-domain; + #address-cells = <1>; + #size-cells = <0>; + + compute-cb@1 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <1>; + iommus = <&apps_smmu 0x0c01 0x20>; + dma-coherent; + }; + + compute-cb@2 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <2>; + iommus = <&apps_smmu 0x0c02 0x20>; + dma-coherent; + }; + + compute-cb@3 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <3>; + iommus = <&apps_smmu 0x0c03 0x20>; + dma-coherent; + }; + + compute-cb@4 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <4>; + iommus = <&apps_smmu 0x0c04 0x20>; + dma-coherent; + }; + + compute-cb@5 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <5>; + iommus = <&apps_smmu 0x0c05 0x20>; + dma-coherent; + }; + + compute-cb@6 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <6>; + iommus = <&apps_smmu 0x0c06 0x20>; + dma-coherent; + }; + + compute-cb@7 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <7>; + iommus = <&apps_smmu 0x0c07 0x20>; + dma-coherent; + }; + + compute-cb@8 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <8>; + iommus = <&apps_smmu 0x0c08 0x20>; + dma-coherent; + }; + + /* note: compute-cb@9 is secure */ + + compute-cb@10 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <10>; + iommus = <&apps_smmu 0x0c0c 0x20>; + dma-coherent; + }; + + compute-cb@11 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <11>; + iommus = <&apps_smmu 0x0c0d 0x20>; + dma-coherent; + }; + + compute-cb@12 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <12>; + iommus = <&apps_smmu 0x0c0e 0x20>; + dma-coherent; + }; + + compute-cb@13 { + compatible = "qcom,fastrpc-compute-cb"; + reg = <13>; + iommus = <&apps_smmu 0x0c0f 0x20>; + dma-coherent; + }; + }; }; }; }; -- 2.34.1 . X-Amp-Result: SKIPPED(no attachment in message) From: Manikandan Muralidharan To: , , , , , , , , , , , , , CC: , , , , , , , , "Manikandan Muralidharan" Subject: [PATCH 0/5] Convert Atmel PIO3 Pinctrl and GPIO bindings to yaml Date: Mon, 24 Jun 2024 15:34:26 +0530 Message-ID: <20240624100431.191172-1-manikandan.m@microchip.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256675 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-gpio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch series cleans-up the compatible property of PIO3 Pinctrl and GPIO bank nodes in DT and includes the text to yaml conversion of Atmel PIO3 Pinctrl and GPIO bindings. yaml files are validated using the following commands make dt_binding_check DT_SCHEMA_FILES= make CHECK_DTBS=y DT_SCHEMA_FILES= Manikandan Muralidharan (5): ARM: dts: microchip: change to simple-mfd from simple-bus for PIO3 pinumux controller ARM: dts: microchip: Remove additional compatible string from PIO3 pinctrl nodes ARM: dts: microchip: sam9x60: Remove additional compatible string from GPIO node dt-bindings: gpio: convert Atmel GPIO to json-schema dt-bindings: pinctrl: Convert Atmel PIO3 pinctrl to json-schema .../bindings/gpio/atmel,at91rm9200-gpio.yaml | 78 +++++++ .../devicetree/bindings/gpio/gpio_atmel.txt | 31 --- .../bindings/pinctrl/atmel,at91-pinctrl.txt | 178 ---------------- .../pinctrl/atmel,at91rm9200-pinctrl.yaml | 194 ++++++++++++++++++ arch/arm/boot/dts/microchip/at91rm9200.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9260.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9261.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9263.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9g45.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9n12.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9rl.dtsi | 2 +- arch/arm/boot/dts/microchip/at91sam9x5.dtsi | 2 +- arch/arm/boot/dts/microchip/sam9x60.dtsi | 10 +- arch/arm/boot/dts/microchip/sama5d3.dtsi | 2 +- arch/arm/boot/dts/microchip/sama5d4.dtsi | 2 +- 15 files changed, 287 insertions(+), 224 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/atmel,at91rm9200-gpio.yaml delete mode 100644 Documentation/devicetree/bindings/gpio/gpio_atmel.txt delete mode 100644 Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt create mode 100644 Documentation/devicetree/bindings/pinctrl/atmel,at91rm9200-pinctrl.yaml -- 2.25.1 . From: Emanuele Ghidoli To: alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org Cc: Emanuele Ghidoli , jjang@nvidia.com, kobak@nvidia.com, mochs@nvidia.com Subject: [PATCH v1 0/2] Fixes for RX8310 RTC Configuration and rtctest Alarm Date: Mon, 24 Jun 2024 12:23:52 +0200 Message-Id: <20240624102354.894871-1-ghidoliemanuele@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256696 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-rtc Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Emanuele Ghidoli Hi, I am submitting two patches related to the RX8310 RTC configuration: 1. **Correct RX8310 RTC Features Configuration:** - Sets one-minute alarm resolution. - Disables update IRQ. Without this patch, if the interrupt is configured in the device tree, `hwclock` fails to read the RTC as it waits for the update IRQ. 2. **Avoid rtctest Alarm Test Failures:** - Ensures rtctest alarm tests do not fail on hardware that only supports one-minute alarm resolution. I know the second patch creates conflict with this one: https://lore.kernel.org/all/20240524013807.154338-1-jjang@nvidia.com/. I think that series can reuse the rtc_get_features function I implemented. Best regards, Emanuele Ghidoli Emanuele Ghidoli (2): rtc: ds1307: set one-minute alarm resolution for rx_8130 selftests: rtc: rtctest: skip alarm test if alarm resolution is one minute drivers/rtc/rtc-ds1307.c | 14 +++++++++++-- tools/testing/selftests/rtc/rtctest.c | 30 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) -- 2.34.1 . From: Dmitry Baryshkov Date: Mon, 24 Jun 2024 13:31:46 +0300 Subject: [PATCH] drm/lcdif: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-mxc-lcdif-bridge-attach-v1-1-37e8c5d5d934@linaro.org> To: Marek Vasut , Stefan Agner , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Alexander Stein Cc: dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256702 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.imx,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-arm-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Existing in-kernel device trees use LCDIF with the dsim + adv7533, dsim + tc358762 or with ldb + panel_bridge. All these combinations support using DRM_BRIDGE_ATTACH_NO_CONNECTOR for bridge attachment. Change lcdif driver to use this flag when attaching the bridge and create drm_bridge_connector afterwards. Signed-off-by: Dmitry Baryshkov --- Note: compile-tested only. --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 0f895b8a99d6..1d5508449995 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -48,6 +49,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct device *dev = lcdif->drm->dev; struct device_node *ep; + struct drm_connector *connector; struct drm_bridge *bridge; int ret; @@ -96,13 +98,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) return ret; } - ret = drm_bridge_attach(encoder, bridge, NULL, 0); + ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret) { of_node_put(ep); return dev_err_probe(dev, ret, "Failed to attach bridge for endpoint%u\n", of_ep.id); } + + connector = drm_bridge_connector_init(lcdif->drm, encoder); + if (IS_ERR(connector)) { + ret = PTR_ERR(connector); + of_node_put(ep); + + return dev_err_probe(dev, ret, + "Failed to create bridge connector for endpoint%u\n", + of_ep.id); + } } return 0; --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240624-mxc-lcdif-bridge-attach-60368807b2f9 Best regards, -- Dmitry Baryshkov . From: Thippeswamy Havalige To: , , , , , CC: , , , , , , Thippeswamy Havalige Subject: [PATCH 0/2] Add support for Xilinx XDMA Soft IP as Root Port Date: Mon, 24 Jun 2024 16:12:37 +0530 Message-ID: <20240624104239.132159-1-thippesw@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256709 org.kernel.vger.linux-pci:144398 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This series of patch add support for Xilinx QDMA Soft IP as Root Port. The Xilinx QDMA Soft IP support's 32 bit and 64bit BAR's. As Root Port it supports MSI and legacy interrupts. Thippeswamy Havalige (2): dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver .../devicetree/bindings/pci/xlnx,xdma-host.yaml | 41 +++++++++++++++- drivers/pci/controller/pcie-xilinx-dma-pl.c | 56 ++++++++++++++++++++-- 2 files changed, 92 insertions(+), 5 deletions(-) -- 1.8.3.1 . From: Srinivas Kandagatla Subject: [PATCH 0/3] arm64: dts: qcom: x1e80100: Add soundwire controller resets Date: Mon, 24 Jun 2024 11:55:29 +0100 Message-Id: <20240624-x1e-swr-reset-v1-0-da326d0733d4@linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256719 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-clk,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Soundwire resets are missing in the existing dts, add resets for all the 4 instances of Soundwire controllers (WSA, WSA2, RX, TX). Signed-off-by: Srinivas Kandagatla --- Srinivas Kandagatla (3): dt-bindings: clock: Add x1e80100 LPASS AUDIOCC reset controller dt-bindings: clock: Add x1e80100 LPASSCC reset controller arm64: dts: qcom: x1e80100: add soundwire controller resets .../bindings/clock/qcom,sc8280xp-lpasscc.yaml | 2 ++ arch/arm64/boot/dts/qcom/x1e80100.dtsi | 23 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) --- base-commit: 781025f172e19ca5682d7bfc5243e7aa74c4977f change-id: 20240624-x1e-swr-reset-0196fbf7b8f9 Best regards, -- Srinivas Kandagatla . From: Thippeswamy Havalige To: , , , , , CC: , , , , "Thippeswamy Havalige" Subject: [PATCH 0/2] Add support for Xilinx XDMA Soft IP as Root Port Date: Mon, 24 Jun 2024 16:37:53 +0530 Message-ID: <20240624110755.133625-1-thippesw@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256730 org.kernel.vger.linux-pci:144401 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This series of patch add support for Xilinx QDMA Soft IP as Root Port. The Xilinx QDMA Soft IP support's 32 bit and 64bit BAR's. As Root Port it supports MSI and legacy interrupts. Thippeswamy Havalige (2): dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx QDMA PCIe Root Port Bridge PCI: xilinx-xdma: Add Xilinx QDMA Root Port driver .../devicetree/bindings/pci/xlnx,xdma-host.yaml | 41 +++++++++++++++- drivers/pci/controller/pcie-xilinx-dma-pl.c | 56 ++++++++++++++++++++-- 2 files changed, 92 insertions(+), 5 deletions(-) -- 1.8.3.1 . From: Thippeswamy Havalige To: , , , , , CC: , , , , "Thippeswamy Havalige" Subject: [PATCH] dt-bindings: PCI: xilinx-cpm: Fix ranges property to avoid overlapping of bridge register and 32-bit BAR addresses Date: Mon, 24 Jun 2024 16:40:22 +0530 Message-ID: <20240624111022.133780-1-thippesw@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256736 org.kernel.vger.linux-pci:144403 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The current configuration had non-prefetchable memory overlapping with bridge registers by 64KB from base address. This patch fixes the 'ranges' property in the device tree by adjusting the non-prefetchable memory addresses beyond the 64KB mark to prevent conflicts. Signed-off-by: Thippeswamy Havalige --- Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml b/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml index 4770ce02fcc3..989fb0fa2577 100644 --- a/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml +++ b/Documentation/devicetree/bindings/pci/xilinx-versal-cpm.yaml @@ -92,7 +92,7 @@ examples: <0 0 0 3 &pcie_intc_0 2>, <0 0 0 4 &pcie_intc_0 3>; bus-range = <0x00 0xff>; - ranges = <0x02000000 0x0 0xe0000000 0x0 0xe0000000 0x0 0x10000000>, + ranges = <0x02000000 0x0 0xe0010000 0x0 0xe0010000 0x0 0x10000000>, <0x43000000 0x80 0x00000000 0x80 0x00000000 0x0 0x80000000>; msi-map = <0x0 &its_gic 0x0 0x10000>; reg = <0x0 0xfca10000 0x0 0x1000>, -- 2.25.1 . From: Nicolas Schier Date: Mon, 24 Jun 2024 13:12:14 +0200 Subject: [PATCH] kbuild: Use $(obj)/%.cc to fix host C++ module builds X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-kbuild-fix-xconfig-v1-1-7c06eae6d3aa@avm.de> To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Rolf Eike Beer X-purgate-ID: 149429::1719227539-627AAE4F-BC86F478/0/0 X-purgate-type: clean X-purgate-size: 1504 X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256742 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-kbuild Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Use $(obj)/ instead of $(src)/ prefix when building C++ modules for host, as explained in commit b1992c3772e6 ("kbuild: use $(src) instead of $(srctree)/$(src) for source directory"). This fixes build failures of 'xconfig': $ make O=build/ xconfig make[1]: Entering directory '/data/linux/kbuild-review/build' GEN Makefile make[3]: *** No rule to make target '../scripts/kconfig/qconf-moc.cc', needed by 'scripts/kconfig/qconf-moc.o'. Stop. Fixes: b1992c3772e6 ("kbuild: use $(src) instead of $(srctree)/$(src) for source directory") Reported-by: Rolf Eike Beer Signed-off-by: Nicolas Schier --- scripts/Makefile.host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.host b/scripts/Makefile.host index d35f55e0d141..e85be7721a48 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -146,7 +146,7 @@ $(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs) # Create .o file from a single .cc (C++) file quiet_cmd_host-cxxobjs = HOSTCXX $@ cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $< -$(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE +$(host-cxxobjs): $(obj)/%.o: $(obj)/%.cc FORCE $(call if_changed_dep,host-cxxobjs) # Create executable from a single Rust crate (which may consist of --- base-commit: 224a21441b0925ce1e60afb27629773a522c946e change-id: 20240624-kbuild-fix-xconfig-f0e95d0d5b27 Best regards, -- Nicolas Schier . Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Christian Brauner , Matthew Wilcox cc: dhowells@redhat.com, Jeff Layton , netfs@lists.linux.dev, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfs: Fix netfs_page_mkwrite() to check folio->mapping is valid X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Jun 2024 12:23:01 +0100 Message-ID: <614257.1719228181@warthog.procyon.org.uk> Xref: photonic.trudheim.com org.kernel.vger.linux-cifs:43202 org.kernel.vger.linux-kernel:1256749 org.kvack.linux-mm:201089 Newsgroups: org.kernel.vger.linux-cifs,dev.linux.lists.netfs,dev.linux.lists.v9fs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Fix netfs_page_mkwrite() to check that folio->mapping is valid once it has taken the folio lock (as filemap_page_mkwrite() does). Without this, generic/247 occasionally oopses with something like the following: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page RIP: 0010:trace_event_raw_event_netfs_folio+0x61/0xc0 ... Call Trace: ? __die_body+0x1a/0x60 ? page_fault_oops+0x6e/0xa0 ? exc_page_fault+0xc2/0xe0 ? asm_exc_page_fault+0x22/0x30 ? trace_event_raw_event_netfs_folio+0x61/0xc0 trace_netfs_folio+0x39/0x40 netfs_page_mkwrite+0x14c/0x1d0 do_page_mkwrite+0x50/0x90 do_pte_missing+0x184/0x200 __handle_mm_fault+0x42d/0x500 handle_mm_fault+0x121/0x1f0 do_user_addr_fault+0x23e/0x3c0 exc_page_fault+0xc2/0xe0 asm_exc_page_fault+0x22/0x30 This is due to the invalidate_inode_pages2_range() issued at the end of th= e DIO write interfering with the mmap'd writes. Fixes: 102a7e2c598c ("netfs: Allow buffered shared-writeable mmap through = netfs_page_mkwrite()") Signed-off-by: David Howells cc: Matthew Wilcox cc: Jeff Layton cc: netfs@lists.linux.dev cc: v9fs@lists.linux.dev cc: linux-afs@lists.infradead.org cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org cc: linux-fsdevel@vger.kernel.org --- fs/netfs/buffered_write.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index c36643c97cb5..6a6387b3aaff 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -497,6 +497,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, st= ruct netfs_group *netfs_gr struct netfs_group *group; struct folio *folio =3D page_folio(vmf->page); struct file *file =3D vmf->vma->vm_file; + struct address_space *mapping =3D file->f_mapping; struct inode *inode =3D file_inode(file); struct netfs_inode *ictx =3D netfs_inode(inode); vm_fault_t ret =3D VM_FAULT_RETRY; @@ -508,6 +509,10 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, s= truct netfs_group *netfs_gr = if (folio_lock_killable(folio) < 0) goto out; + if (folio->mapping !=3D mapping) { + ret =3D VM_FAULT_NOPAGE | VM_FAULT_LOCKED; + goto out; + } = if (folio_wait_writeback_killable(folio)) { ret =3D VM_FAULT_LOCKED; @@ -523,7 +528,7 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, st= ruct netfs_group *netfs_gr group =3D netfs_folio_group(folio); if (group !=3D netfs_group && group !=3D NETFS_FOLIO_COPY_TO_CACHE) { folio_unlock(folio); - err =3D filemap_fdatawait_range(inode->i_mapping, + err =3D filemap_fdatawait_range(mapping, folio_pos(folio), folio_pos(folio) + folio_size(folio)); switch (err) { . Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: Christian Brauner , Matthew Wilcox cc: dhowells@redhat.com, Jeff Layton , netfs@lists.linux.dev, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Jun 2024 12:24:03 +0100 Message-ID: <614300.1719228243@warthog.procyon.org.uk> Xref: photonic.trudheim.com org.kernel.vger.linux-cifs:43203 org.kernel.vger.linux-kernel:1256750 org.kvack.linux-mm:201090 Newsgroups: org.kernel.vger.linux-cifs,dev.linux.lists.netfs,dev.linux.lists.v9fs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Fix netfs_page_mkwrite() to use filemap_fdatawrite_range(), not filemap_fdatawait_range() to flush conflicting data. Fixes: 102a7e2c598c ("netfs: Allow buffered shared-writeable mmap through = netfs_page_mkwrite()") Signed-off-by: David Howells cc: Matthew Wilcox cc: Jeff Layton cc: netfs@lists.linux.dev cc: v9fs@lists.linux.dev cc: linux-afs@lists.infradead.org cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org cc: linux-fsdevel@vger.kernel.org --- fs/netfs/buffered_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index 05745bcc54c6..9cbbeeee6170 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -554,9 +554,9 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, st= ruct netfs_group *netfs_gr group =3D netfs_folio_group(folio); if (group !=3D netfs_group && group !=3D NETFS_FOLIO_COPY_TO_CACHE) { folio_unlock(folio); - err =3D filemap_fdatawait_range(mapping, - folio_pos(folio), - folio_pos(folio) + folio_size(folio)); + err =3D filemap_fdatawrite_range(mapping, + folio_pos(folio), + folio_pos(folio) + folio_size(folio)); switch (err) { case 0: ret =3D VM_FAULT_RETRY; . From: =?utf-8?q?T=C3=B3th_J=C3=A1nos_via_B4_Relay?= Date: Mon, 24 Jun 2024 13:25:13 +0200 Subject: [PATCH v4] drivers: rtc: Add driver for SD2405AL. X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240624-rtc-sd2405al-v4-1-2b2bc759f98f@gmail.com> To: Alexandre Belloni Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, csokas.bence@prolan.hu, =?utf-8?q?T=C3=B3th_J=C3=A1nos?= X-Original-From: =?utf-8?q?T=C3=B3th_J=C3=A1nos?= Reply-To: gomba007@gmail.com Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256770 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.feeds.b4-sent,org.kernel.vger.linux-rtc Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Tóth János Add support for the DFRobot SD2405AL I2C RTC Module. Datasheet: https://image.dfrobot.com/image/data/TOY0021/SD2405AL%20datasheet%20(Angelo%20v0.1).pdf Product: https://www.dfrobot.com/product-1600.html To instantiate (assuming device is connected to I2C-1) as root: echo sd2405al 0x32 > /sys/bus/i2c/devices/i2c-1/new_device as user: echo 'sd2405al 0x32' | sudo tee /sys/class/i2c-adapter/i2c-1/new_device The driver is tested with: + hwclock + tools/testing/selftests/rtc/setdate + tools/testing/selftests/rtc/rtctest Signed-off-by: Tóth János --- Changes in v4: - Implement more comprehensive data validation. - Inline some temporary variables. - Link to v3: https://lore.kernel.org/r/20240620-rtc-sd2405al-v3-1-65d5bb01af50@gmail.com Changes in v3: - #define-s of registers are reworked. - Minor revisions based on the reviewer's suggestions. - Link to v2: https://lore.kernel.org/r/20240619-rtc-sd2405al-v2-1-39bea29bd2a5@gmail.com Changes in v2: - Refactored based on reviewer's suggestions. - I couldn't get the I2C IRQ to work on Raspberry Pi 4, so alarm is skipped. - Link to v1: https://lore.kernel.org/r/20240607-rtc-sd2405al-v1-1-535971e7a866@gmail.com --- MAINTAINERS | 6 + drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-sd2405al.c | 319 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 336 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8754ac2c259d..c78587811433 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6337,6 +6337,12 @@ F: include/net/devlink.h F: include/uapi/linux/devlink.h F: net/devlink/ +DFROBOT SD2405AL RTC DRIVER +M: Tóth János +L: linux-rtc@vger.kernel.org +S: Maintained +F: drivers/rtc/rtc-sd2405al.c + DH ELECTRONICS IMX6 DHCOM/DHCOR BOARD SUPPORT M: Christoph Niedermaier L: kernel@dh-electronics.com diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 2a95b05982ad..15f1c0ba5759 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -743,6 +743,16 @@ config RTC_DRV_S5M This driver can also be built as a module. If so, the module will be called rtc-s5m. +config RTC_DRV_SD2405AL + tristate "DFRobot SD2405AL" + select REGMAP_I2C + help + If you say yes here you will get support for the + DFRobot SD2405AL I2C RTC Module. + + This driver can also be built as a module. If so, the module + will be called rtc-sd2405al. + config RTC_DRV_SD3078 tristate "ZXW Shenzhen whwave SD3078" select REGMAP_I2C diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 3004e372f25f..3d19feba1e1c 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -162,6 +162,7 @@ obj-$(CONFIG_RTC_DRV_S3C) += rtc-s3c.o obj-$(CONFIG_RTC_DRV_S5M) += rtc-s5m.o obj-$(CONFIG_RTC_DRV_SA1100) += rtc-sa1100.o obj-$(CONFIG_RTC_DRV_SC27XX) += rtc-sc27xx.o +obj-$(CONFIG_RTC_DRV_SD2405AL) += rtc-sd2405al.o obj-$(CONFIG_RTC_DRV_SD3078) += rtc-sd3078.o obj-$(CONFIG_RTC_DRV_SH) += rtc-sh.o obj-$(CONFIG_RTC_DRV_SNVS) += rtc-snvs.o diff --git a/drivers/rtc/rtc-sd2405al.c b/drivers/rtc/rtc-sd2405al.c new file mode 100644 index 000000000000..5440cc1aed1d --- /dev/null +++ b/drivers/rtc/rtc-sd2405al.c @@ -0,0 +1,319 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * RTC driver for the SD2405AL Real-Time Clock + * + * Datasheet: + * https://image.dfrobot.com/image/data/TOY0021/SD2405AL%20datasheet%20(Angelo%20v0.1).pdf + * + * Copyright (C) 2024 Tóth János + * Copyright (C) 2018 Zoro Li (rtc-sd3078.c) + * Copyright (C) 2005 James Chapman (rtc-ds1307.c) + */ + +#include +#include +#include +#include + +/* Real time clock registers */ +#define SD2405AL_REG_T_SEC 0x00 +#define SD2405AL_REG_T_MIN 0x01 +#define SD2405AL_REG_T_HOUR 0x02 +# define SD2405AL_BIT_12H_PM BIT(5) +# define SD2405AL_BIT_24H BIT(7) +#define SD2405AL_REG_T_WEEK 0x03 +#define SD2405AL_REG_T_DAY 0x04 +#define SD2405AL_REG_T_MON 0x05 +#define SD2405AL_REG_T_YEAR 0x06 + +#define SD2405AL_NUM_T_REGS (SD2405AL_REG_T_YEAR - SD2405AL_REG_T_SEC + 1) + +/* Control registers */ +#define SD2405AL_REG_CTR1 0x0F +# define SD2405AL_BIT_WRTC2 BIT(2) +# define SD2405AL_BIT_WRTC3 BIT(6) +#define SD2405AL_REG_CTR2 0x10 +# define SD2405AL_BIT_WRTC1 BIT(7) +#define SD2405AL_REG_CTR3 0x11 +#define SD2405AL_REG_TTF 0x12 +#define SD2405AL_REG_CNTDWN 0x13 + +/* General RAM */ +#define SD2405AL_REG_M_START 0x14 +#define SD2405AL_REG_M_END 0x1F + +struct sd2405al { + struct device *dev; + struct rtc_device *rtc; + struct regmap *regmap; +}; + +static int sd2405al_check_writable(struct sd2405al *sd2405al) +{ + u8 data[2] = { 0 }; + int ret; + + ret = regmap_bulk_read(sd2405al->regmap, SD2405AL_REG_CTR1, data, 2); + if (ret < 0) { + dev_err(sd2405al->dev, "read failed: %d\n", ret); + return ret; + } + + return (data[0] & (SD2405AL_BIT_WRTC2 | SD2405AL_BIT_WRTC3)) != 0 && + (data[1] & SD2405AL_BIT_WRTC1) != 0; +} + +static int sd2405al_setup(struct sd2405al *sd2405al) +{ + int ret; + + /* order of writes is important */ + /* + * CTR2.WRTC1 = 1, device is writable + * CTR2.IM = 0, single event alarm + * CTR2.S{1,0} = 0, disable INT pin + * CTR2.FOBAT = 0, interrupt enabled during battery backup mode + * CTR2.INTDE = 0, countdown interrupt disabled + * CTR2.INTAE = 0, alarm interrupt disabled + * CTR2.INTFE = 0, frequency interrupt disabled + */ + ret = regmap_write(sd2405al->regmap, SD2405AL_REG_CTR2, + SD2405AL_BIT_WRTC1); + if (ret < 0) { + dev_err(sd2405al->dev, "write failed: %d\n", ret); + return ret; + } + + /* + * CTR2.WRTC3 = 1, device is writable + * CTR1.INTAF = 0, clear alarm interrupt flag + * CTR2.INTDF = 0, clear countdown interrupt flag + * CTR2.WRTC2 = 1, device is writable + */ + ret = regmap_write(sd2405al->regmap, SD2405AL_REG_CTR1, + SD2405AL_BIT_WRTC2 | SD2405AL_BIT_WRTC3); + if (ret < 0) { + dev_err(sd2405al->dev, "write failed: %d\n", ret); + return ret; + } + + /* + * CRT3.ARTS = 0, disable auto reset of interrupt flags + * CTR3.TDS{1,0} = 0, unused, since countdown interrupt is disabled + * CTR3.FS{3,2,1,0} = 0, unused since frequency interrupt is disabled + */ + ret = regmap_write(sd2405al->regmap, SD2405AL_REG_CTR3, 0); + if (ret < 0) { + dev_err(sd2405al->dev, "write failed: %d\n", ret); + return ret; + } + + ret = sd2405al_check_writable(sd2405al); + if (ret == 0) { + dev_err(sd2405al->dev, "device is not writable\n"); + return -EINVAL; + } else if (ret < 0) { + return ret; + } else { + dev_dbg(sd2405al->dev, "device is writable\n"); + } + + return 0; +} + +static int sd2405al_read_time(struct device *dev, struct rtc_time *time) +{ + u8 data[SD2405AL_NUM_T_REGS] = { 0 }; + struct sd2405al *sd2405al = dev_get_drvdata(dev); + int ret; + + ret = regmap_bulk_read(sd2405al->regmap, SD2405AL_REG_T_SEC, data, + SD2405AL_NUM_T_REGS); + if (ret < 0) { + dev_err(sd2405al->dev, "read failed: %d\n", ret); + return ret; + } + + if (data[SD2405AL_REG_T_SEC] & 0x80) { + dev_err(sd2405al->dev, "invalid second\n"); + return -EINVAL; + } + + if (data[SD2405AL_REG_T_MIN] & 0x80) { + dev_err(sd2405al->dev, "invalid minute\n"); + return -EINVAL; + } + + if (data[SD2405AL_REG_T_HOUR] & 0x40) { + dev_err(sd2405al->dev, "invalid hour\n"); + return -EINVAL; + } + + if (data[SD2405AL_REG_T_WEEK] & 0xF8) { + dev_err(sd2405al->dev, "invalid week\n"); + return -EINVAL; + } + + if (data[SD2405AL_REG_T_DAY] & 0xC0) { + dev_err(sd2405al->dev, "invalid day\n"); + return -EINVAL; + } + + if (data[SD2405AL_REG_T_MON] & 0xE0) { + dev_err(sd2405al->dev, "invalid month\n"); + return -EINVAL; + } + + time->tm_sec = bcd2bin(data[SD2405AL_REG_T_SEC] & 0x7F); + time->tm_min = bcd2bin(data[SD2405AL_REG_T_MIN] & 0x7F); + + if (data[SD2405AL_REG_T_HOUR] & SD2405AL_BIT_24H) + time->tm_hour = bcd2bin(data[SD2405AL_REG_T_HOUR] & 0x3F); + else + if (data[SD2405AL_REG_T_HOUR] & SD2405AL_BIT_12H_PM) + time->tm_hour = bcd2bin(data[SD2405AL_REG_T_HOUR] + & 0x1F) + 12; + else /* 12 hour mode, AM */ + time->tm_hour = bcd2bin(data[SD2405AL_REG_T_HOUR] + & 0x1F); + + time->tm_wday = data[SD2405AL_REG_T_WEEK] & 0x07; + time->tm_mday = bcd2bin(data[SD2405AL_REG_T_DAY] & 0x3F); + time->tm_mon = bcd2bin(data[SD2405AL_REG_T_MON] & 0x1F) - 1; + time->tm_year = bcd2bin(data[SD2405AL_REG_T_YEAR]) + 100; + + dev_dbg(sd2405al->dev, "read time: %d-%02d-%02d %02d:%02d:%02d\n", + time->tm_year, time->tm_mon, time->tm_mday, + time->tm_hour, time->tm_min, time->tm_sec); + + return 0; +} + +static int sd2405al_set_time(struct device *dev, struct rtc_time *time) +{ + u8 data[SD2405AL_NUM_T_REGS]; + struct sd2405al *sd2405al = dev_get_drvdata(dev); + int ret; + + ret = sd2405al_check_writable(sd2405al); + if (ret == 0) { + dev_err(sd2405al->dev, "device is not writable\n"); + return -EINVAL; + } else if (ret < 0) { + return ret; + } else { + dev_dbg(sd2405al->dev, "device is writable\n"); + } + + data[SD2405AL_REG_T_SEC] = bin2bcd(time->tm_sec); + data[SD2405AL_REG_T_MIN] = bin2bcd(time->tm_min); + data[SD2405AL_REG_T_HOUR] = bin2bcd(time->tm_hour) | SD2405AL_BIT_24H; + data[SD2405AL_REG_T_DAY] = bin2bcd(time->tm_mday); + data[SD2405AL_REG_T_WEEK] = time->tm_wday & 0x07; + data[SD2405AL_REG_T_MON] = bin2bcd(time->tm_mon) + 1; + data[SD2405AL_REG_T_YEAR] = bin2bcd(time->tm_year - 100); + + ret = regmap_bulk_write(sd2405al->regmap, SD2405AL_REG_T_SEC, data, + SD2405AL_NUM_T_REGS); + if (ret < 0) { + dev_err(sd2405al->dev, "write failed: %d\n", ret); + return ret; + } + + dev_dbg(sd2405al->dev, "set time: %d-%02d-%02d %02d:%02d:%02d\n", + time->tm_year, time->tm_mon, time->tm_mday, + time->tm_hour, time->tm_min, time->tm_sec); + + return 0; +} + +static const struct rtc_class_ops sd2405al_rtc_ops = { + .read_time = sd2405al_read_time, + .set_time = sd2405al_set_time, +}; + +static const struct regmap_config sd2405al_regmap_conf = { + .reg_bits = 8, + .val_bits = 8, + .max_register = SD2405AL_REG_M_END, +}; + +static int sd2405al_probe(struct i2c_client *client) +{ + struct sd2405al *sd2405al; + int func; + int ret; + + func = i2c_check_functionality(client->adapter, I2C_FUNC_I2C); + if (!func) { + dev_err(&client->dev, "invalid adapter\n"); + return -ENODEV; + } + + sd2405al = devm_kzalloc(&client->dev, sizeof(*sd2405al), GFP_KERNEL); + if (!sd2405al) { + dev_err(&client->dev, "unable to allocate memory\n"); + return -ENOMEM; + } + + sd2405al->dev = &client->dev; + + sd2405al->regmap = devm_regmap_init_i2c(client, &sd2405al_regmap_conf); + if (IS_ERR(sd2405al->regmap)) { + dev_err(sd2405al->dev, "unable to allocate regmap\n"); + return PTR_ERR(sd2405al->regmap); + } + + ret = sd2405al_setup(sd2405al); + if (ret < 0) { + dev_err(sd2405al->dev, "unable to setup device\n"); + return ret; + } + + sd2405al->rtc = devm_rtc_allocate_device(&client->dev); + if (IS_ERR(sd2405al->rtc)) { + dev_err(sd2405al->dev, "unable to allocate device\n"); + return PTR_ERR(sd2405al->rtc); + } + + sd2405al->rtc->ops = &sd2405al_rtc_ops; + sd2405al->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; + sd2405al->rtc->range_max = RTC_TIMESTAMP_END_2099; + + dev_set_drvdata(&client->dev, sd2405al); + + ret = devm_rtc_register_device(sd2405al->rtc); + if (ret < 0) { + dev_err(sd2405al->dev, "unable to register device: %d\n", ret); + return ret; + } + + return 0; +} + +static const struct i2c_device_id sd2405al_id[] = { + { "sd2405al", 0 }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(i2c, sd2405al_id); + +static const __maybe_unused struct of_device_id sd2405al_of_match[] = { + { .compatible = "dfrobot,sd2405al" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, sd2405al_of_match); + +static struct i2c_driver sd2405al_driver = { + .driver = { + .name = "sd2405al", + .of_match_table = of_match_ptr(sd2405al_of_match), + }, + .probe = sd2405al_probe, + .id_table = sd2405al_id, +}; + +module_i2c_driver(sd2405al_driver); + +MODULE_AUTHOR("Tóth János"); +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("SD2405AL RTC driver"); --- base-commit: c3f38fa61af77b49866b006939479069cd451173 change-id: 20240607-rtc-sd2405al-a0947377c73d Best regards, -- Tóth János . Message-ID: <1cd309fa-a4d3-4283-aa47-1330a40448a7@gmail.com> Date: Mon, 24 Jun 2024 13:40:03 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johan Jonker Subject: [PATCH v1] clk: rockchip: rk3188: Drop CLK_NR_CLKS usage To: heiko@sntech.de Cc: mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256787 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-clk Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Johan Jonker --- drivers/clk/rockchip/clk-rk3188.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c index 9c8af4d1dae0..30e670c8afba 100644 --- a/drivers/clk/rockchip/clk-rk3188.c +++ b/drivers/clk/rockchip/clk-rk3188.c @@ -757,9 +757,11 @@ static const char *const rk3188_critical_clocks[] __initconst = { "sclk_mac_lbtest", }; -static struct rockchip_clk_provider *__init rk3188_common_clk_init(struct device_node *np) +static struct rockchip_clk_provider *__init rk3188_common_clk_init(struct device_node *np, + unsigned long soc_nr_clks) { struct rockchip_clk_provider *ctx; + unsigned long common_nr_clks; void __iomem *reg_base; reg_base = of_iomap(np, 0); @@ -768,7 +770,9 @@ static struct rockchip_clk_provider *__init rk3188_common_clk_init(struct device return ERR_PTR(-ENOMEM); } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + common_nr_clks = rockchip_clk_find_max_clk_id(common_clk_branches, + ARRAY_SIZE(common_clk_branches)) + 1; + ctx = rockchip_clk_init(np, reg_base, max(common_nr_clks, soc_nr_clks)); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); @@ -789,8 +793,11 @@ static struct rockchip_clk_provider *__init rk3188_common_clk_init(struct device static void __init rk3066a_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long soc_nr_clks; - ctx = rk3188_common_clk_init(np); + soc_nr_clks = rockchip_clk_find_max_clk_id(rk3066a_clk_branches, + ARRAY_SIZE(rk3066a_clk_branches)) + 1; + ctx = rk3188_common_clk_init(np, soc_nr_clks); if (IS_ERR(ctx)) return; @@ -812,11 +819,14 @@ CLK_OF_DECLARE(rk3066a_cru, "rockchip,rk3066a-cru", rk3066a_clk_init); static void __init rk3188a_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long soc_nr_clks; struct clk *clk1, *clk2; unsigned long rate; int ret; - ctx = rk3188_common_clk_init(np); + soc_nr_clks = rockchip_clk_find_max_clk_id(rk3188_clk_branches, + ARRAY_SIZE(rk3188_clk_branches)) + 1; + ctx = rk3188_common_clk_init(np, soc_nr_clks); if (IS_ERR(ctx)) return; -- 2.39.2 . X-AuditID: ac14000a-03251700000021bc-c4-66795b750406 From: Leonard Anderweit To: "alexandre.belloni@bootlin.com" , "arnd@arndb.de" CC: "linux-rtc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "upstream@phytec.de" Subject: Question about [PATCH] [RFC] rtc: y2038: remove broken RTC_HCTOSYS workaround Date: Mon, 24 Jun 2024 11:41:41 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeLIzCtJLcpLzFFi42JZI8nAq1saXZlmcGu9rkX7u2XsFn8nHWO3 uLxrDpvFsdVX2BxYPH7/msToMW9NtcfnTXIBzFFcNimpOZllqUX6dglcGTNefWUruMNScXLb YpYGxjMsXYycHBICJhKv7p1k7mLk4hASWMIkceLxRyYI5z6jxIHrf6CcDYwSS38tYwJpYRPQ l1i54ikziC0ikCbxvHMmI0gRs8BKRomPU5axdzFycAgLREh0v7OCqImVOHflNRtIWERAT2Ld QwOQMIuAqkTXmbfsIDavgJvEo/btbCA2o4CsxIYN58HGMwuIS2x69p0V4lIBiSV7IOISAqIS Lx//g4rLS5y4NY0JZDyzgKbE+l36EK0WEtN3v2KDsBUlpnQ/hFolKHFy5hOWCYyis5BsmIXQ PQtJ9ywk3bOQdC9gZF3FKJSbmZydWpSZrVeQUVmSmqyXkrqJERRRIgxcOxj75ngcYmTiYDzE KMHBrCTCO72+LE2INyWxsiq1KD++qDQntfgQozQHi5I47+qO4FQhgfTEktTs1NSC1CKYLBMH p1QDo366lernqzz7nb7a5We3yRZt6JupGxDstzFq9XyrcE5lp81d3At/M827sO2VjknvjiXe amJxaowrJDcxldk/YWdkUX9Q/0qr7KJpSvCz5kObntxauPuU1s5vXMEzI7lnTlzl/W+NznHl WQUcc7zEmLfUMZZG7+/qZrN4vmmH54znkiZMzld/KrEUZyQaajEXFScCAPQzlQmWAgAA Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256789 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-rtc Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail SGksDQoNCkkgZm91bmQgdGhpcyBwYXRjaCBbMV0gd2hpY2ggaXMgbmVjZXNzYXJ5IGZvciBhIHBy b2plY3QgSSdtIGN1cnJlbnRseQ0Kd29ya2luZyBvbi4gSSdtIHVzaW5nIHBoeWJvYXJkLXdlZ2Eg WzJdIHdpdGggYW4gYW0zMzUgQVJNIFNvQyB3aGljaCBJDQp3YW50IHRvIG1ha2UgeTIwMzggcHJv b2YuDQpJcyB0aGVyZSBhbnkgcmVhc29uIGl0IHdhcyBuZXZlciBhY2NlcHRlZD8NCg0KWzFdaHR0 cHM6Ly9sb3JlLmtlcm5lbC5vcmcvYWxsLzIwMjIwOTA4MTE1MzM3LjE2MDQyNzctMS1hcm5kQGtl cm5lbC5vcmcvDQoNCg0KWzJdaHR0cHM6Ly9naXQua2VybmVsLm9yZy9wdWIvc2NtL2xpbnV4L2tl cm5lbC9naXQvc3RhYmxlL2xpbnV4LmdpdC90cmVlL2FyY2gvYXJtL2Jvb3QvZHRzL3RpL29tYXAv YW0zMzV4LXdlZ2EtcmRrLmR0cw0KDQpSZWdhcmRzDQpMZW9uYXJkDQo= . From: "Kirill A. Shutemov" To: "Kirill A. Shutemov" , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Cc: linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCHv5 0/4] x86/tdx: Adjust TD settings on boot Date: Mon, 24 Jun 2024 14:41:45 +0300 Message-ID: <20240624114149.377492-1-kirill.shutemov@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256791 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.linux-coco Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The patchset adjusts a few TD settings on boot for the optimal functioning of the system: - Disable EPT violation #VE on private memory if TD can control it The newer TDX module allows the guest to control whether it wants to see #VE on EPT violation on private memory. The Linux kernel does not want such #VEs and needs to disable them. - Enable virtualization of topology-related CPUID leafs X2APIC_APICID MSR; The ENUM_TOPOLOGY feature allows the VMM to provide topology information to the guest. Enabling the feature eliminates topology-related #VEs: the TDX module virtualizes accesses to the CPUID leafs and the MSR. It allows TDX guest to run with non-trivial topology configuration. v5: - Rebased to current tip tree; v4: - Drop unnecessary enumeration; - Drop TDG.SYS.RD wrapper; - CC stable@ for SEPT disable patch; - Update commit messages; v3: - Update commit messages; - Rework patches 3/4 and 4/4; v2: - Rebased; - Allow write to TDCS_TD_CTLS to fail; - Adjust commit messages; Kirill A. Shutemov (4): x86/tdx: Introduce wrappers to read and write TD metadata x86/tdx: Rename tdx_parse_tdinfo() to tdx_setup() x86/tdx: Dynamically disable SEPT violations from causing #VEs x86/tdx: Enable CPU topology enumeration arch/x86/coco/tdx/tdx.c | 140 +++++++++++++++++++++++++----- arch/x86/include/asm/shared/tdx.h | 13 ++- 2 files changed, 130 insertions(+), 23 deletions(-) -- 2.43.0 . Subject: [PATCH V2] cgroup/rstat: Avoid thundering herd problem by kswapd across NUMA nodes From: Jesper Dangaard Brouer To: tj@kernel.org, cgroups@vger.kernel.org, yosryahmed@google.com, shakeel.butt@linux.dev Cc: Jesper Dangaard Brouer , hannes@cmpxchg.org, lizefan.x@bytedance.com, longman@redhat.com, kernel-team@cloudflare.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 24 Jun 2024 13:55:32 +0200 Message-ID: <171923011608.1500238.3591002573732683639.stgit@firesoul> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256807 org.kvack.linux-mm:201095 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.cgroups,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Avoid lock contention on the global cgroup rstat lock caused by kswapd starting on all NUMA nodes simultaneously. At Cloudflare, we observed massive issues due to kswapd and the specific mem_cgroup_flush_stats() call inlined in shrink_node, which takes the rstat lock. On our 12 NUMA node machines, each with a kswapd kthread per NUMA node, we noted severe lock contention on the rstat lock. This contention causes 12 CPUs to waste cycles spinning every time kswapd runs. Fleet-wide stats (/proc/N/schedstat) for kthreads revealed that we are burning an average of 20,000 CPU cores fleet-wide on kswapd, primarily due to spinning on the rstat lock. To help reviewer follow code: When the Per-CPU-Pages (PCP) freelist is empty, __alloc_pages_slowpath calls wake_all_kswapds(), causing all kswapdN threads to wake up simultaneously. The kswapd thread invokes shrink_node (via balance_pgdat) triggering the cgroup rstat flush operation as part of its work. This results in kernel self-induced rstat lock contention by waking up all kswapd threads simultaneously. Leveraging this detail: balance_pgdat() have NULL value in target_mem_cgroup, this cause mem_cgroup_flush_stats() to do flush with root_mem_cgroup. To resolve the kswapd issue, we generalized the "stats_flush_ongoing" concept to apply to all users of cgroup rstat, not just memcg. This concept was originally reverted in commit 7d7ef0a4686a ("mm: memcg: restore subtree stats flushing"). If there is an ongoing rstat flush, limited to the root cgroup, the flush is skipped. This is effective as kswapd operates on the root tree, sufficiently mitigating the thundering herd problem. This lowers contention on the global rstat lock, although limited to the root cgroup. Flushing cgroup subtree's can still lead to lock contention. Fixes: 7d7ef0a4686a ("mm: memcg: restore subtree stats flushing"). Signed-off-by: Jesper Dangaard Brouer --- V1: https://lore.kernel.org/all/171898037079.1222367.13467317484793748519.stgit@firesoul/ RFC: https://lore.kernel.org/all/171895533185.1084853.3033751561302228252.stgit@firesoul/ include/linux/cgroup.h | 5 +++++ kernel/cgroup/rstat.c | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 2150ca60394b..ad41cca5c3b6 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -499,6 +499,11 @@ static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) return NULL; } +static inline bool cgroup_is_root(struct cgroup *cgrp) +{ + return cgroup_parent(cgrp) == NULL; +} + /** * cgroup_is_descendant - test ancestry * @cgrp: the cgroup to be tested diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index fb8b49437573..2591840b6dc1 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -11,6 +11,7 @@ static DEFINE_SPINLOCK(cgroup_rstat_lock); static DEFINE_PER_CPU(raw_spinlock_t, cgroup_rstat_cpu_lock); +static atomic_t root_rstat_flush_ongoing = ATOMIC_INIT(0); static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu); @@ -350,8 +351,25 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp) { might_sleep(); + /* + * This avoids thundering herd problem on global rstat lock. When an + * ongoing flush of the entire tree is in progress, then skip flush. + */ + if (atomic_read(&root_rstat_flush_ongoing)) + return; + + /* Grab right to be ongoing flusher, return if loosing race */ + if (cgroup_is_root(cgrp) && + atomic_xchg(&root_rstat_flush_ongoing, 1)) + return; + __cgroup_rstat_lock(cgrp, -1); + cgroup_rstat_flush_locked(cgrp); + + if (cgroup_is_root(cgrp)) + atomic_set(&root_rstat_flush_ongoing, 0); + __cgroup_rstat_unlock(cgrp, -1); } @@ -362,13 +380,20 @@ __bpf_kfunc void cgroup_rstat_flush(struct cgroup *cgrp) * Flush stats in @cgrp's subtree and prevent further flushes. Must be * paired with cgroup_rstat_flush_release(). * + * Current invariant, not called with root cgrp. + * * This function may block. */ void cgroup_rstat_flush_hold(struct cgroup *cgrp) __acquires(&cgroup_rstat_lock) { might_sleep(); + __cgroup_rstat_lock(cgrp, -1); + + if (atomic_read(&root_rstat_flush_ongoing)) + return; + cgroup_rstat_flush_locked(cgrp); } . From: Krishna Kumar To: mpe@ellerman.id.au, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, brking@linux.vnet.ibm.com, gbatra@linux.ibm.com, aneesh.kumar@kernel.org, christophe.leroy@csgroup.eu, nathanl@linux.ibm.com, bhelgaas@google.com, oohall@gmail.com, tpearson@raptorengineering.com, mahesh.salgaonkar@in.ibm.com, Krishna Kumar Subject: [PATCH v3 0/2] PCI hotplug driver fixes Date: Mon, 24 Jun 2024 17:39:26 +0530 Message-ID: <20240624121052.233232-1-krishnak@linux.ibm.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=yes Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256813 org.kernel.vger.linux-pci:144409 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.ozlabs.lists.linuxppc-dev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The fix of Powerpc hotplug driver (drivers/pci/hotplug/pnv_php.c) addresses below two issues. 1. Kernel Crash during hot unplug of bridge/switch slot. 2. Bridge Support Enablement - Previously, when we do a hot-unplug operation on a bridge slot, all the ports and devices behind the bridge-ports would be hot-unplugged/offline, but when we do a hot-plug operation on the same bridge slot, all the ports and devices behind the bridge would not get hot-plugged/online. In this case, Only the first port of the bridge gets enabled and the remaining port/devices remain unplugged/offline. After the fix, The hot-unplug and hot-plug operations on the slot associated with the bridge started behaving correctly and became in sync. Now, after the hot plug operation on the same slot, all the bridge ports and devices behind the bridge become hot-plugged/online/restored in the same manner as it was before the hot-unplug operation. Krishna Kumar (2): pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv powerpc: hotplug driver bridge support arch/powerpc/include/asm/ppc-pci.h | 4 ++++ arch/powerpc/kernel/pci-hotplug.c | 5 ++--- arch/powerpc/kernel/pci_dn.c | 32 ++++++++++++++++++++++++++++++ drivers/pci/hotplug/pnv_php.c | 3 +-- 4 files changed, 39 insertions(+), 5 deletions(-) Changelog: ========== v3: 24 June 2024 - Removed the DPC keyword from description in cover letter and patch2 v2: 14 May 2024 - Used of_property_read_u32() in place of of_get_property() and of_read_number(). [patch2] - Removed some unnecessary variable and changed the function return type from void* to void. [patch2] - Removed the export declaration of pci_traverse_sibling_nodes_and_scan_slot() as its not needed. [patch2] -- 2.45.0 . From: George Chan via B4 Relay Subject: [PATCH RFT v3 0/5] Add sc7180 camss subsys support Date: Mon, 24 Jun 2024 20:13:11 +0800 Message-Id: <20240624-b4-sc7180-camss-v3-0-89ece6471431@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, George Chan X-Original-From: George Chan Reply-To: gchan9527@gmail.com Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256820 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-media Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail SM7125 is the SoC found in the Xiaomi Redmi Note 9 Pro(joyeuse) cellphone. This series adds support to bring up the CSIPHY, CSID, VFE/RDI interfaces. Since SM7125 is a low-speed variant of SC7180, SC7180 testers please take a look and have a test as well. sc7180 provides - 2 x VFE - 1 x VFE Lite - 2 x CSID - 1 x CSID Lite - 4 x CSI PHY The sc7180-camss binding should be comaptible with sdm845 yaml. I've copied a new yaml from sdm845-camss.yaml, strip all _src clk and put new maintainer information. If this is not desirable then i can add binding to existing sdm845 yaml instead. In addition, a bootable tree of sm7125/joyeuse is availble at: https://github.com/99degree/linux/tree/camss Signed-off-by: George Chan --- Changes in v3: - Rebased on 20240522154659.510-1-quic_grosikop@quicinc.com - Bryan - Align email title to sc8280xp series - krzk - Line-up dt-binding example ordering to same as qcom,sm8250-camss.yaml - krzk - Drop non-related patches #5 #6 #7, I will send follow-up patches later - Add RFT tag to all patches, since no tested-by at all. - Drop required-opps node from dt - Link to v2: https://lore.kernel.org/r/20240624-b4-sc7180-camss-v2-0-0dfecdc50073@gmail.com Changes in v2: - Revised dt-binding title - krzk - Revised dt-binding maintainers - krzk - Drop all dt-binding minItems - krzk - Drops "|" symbol postfixed to description - krzk - Accending order of dt-binding required list - krzk - Added dt-binding item power-domain-name - Bryan - Reformat dt-binding example - krzk - Move reg as 2nd property - krzk - Move reg-names as 3nd property - krzk - Reduce iommus maxItems to 3 - rob's bot - Reduce clocks maxItems to 24 - rob's bot - Combine patch #2 and #3 - krzk and Bryan - Split eror-print log for clk name from #5 - Konrad - Reformat dt-node - krzk - Corrected phy init sequence for v1.2.2 - Bryan - Added 3 more debug info for missing clk and low clk-rate issue. - Adding port info to ports sub-node - Adding required-opps node to dt - Link to v1: https://lore.kernel.org/r/20240621-b4-sc7180-camss-v1-0-14937929f30e@gmail.com --- George Chan (5): dt-bindings: media: camss: Add qcom,sc7180-camss media: camss: csiphy-3ph: Add Gen2 v1.2.2 two-phase MIPI CSI-2 DPHY init media: qcom: camss: Add sc7180 support media: qcom: camss: Add sc7180 resources arm64: dts: qcom: sc7180: camss: Add CAMSS block definition .../bindings/media/qcom,sc7180-camss.yaml | 328 +++++++++++++++++++++ arch/arm64/boot/dts/qcom/sc7180.dtsi | 133 +++++++++ .../platform/qcom/camss/camss-csiphy-3ph-1-0.c | 135 +++++++++ drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 251 ++++++++++++++++ drivers/media/platform/qcom/camss/camss.h | 1 + 6 files changed, 850 insertions(+) --- base-commit: 28f69d2ea67db489d4a94e7d04c21b14e5aa6535 change-id: 20240621-b4-sc7180-camss-cddc6b60a9b4 Best regards, -- George Chan . Return-Path: From: Stuart Menefy To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Stuart Menefy , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: Remove redundant restriction on memory size Date: Mon, 24 Jun 2024 13:17:23 +0100 Message-ID: <20240624121723.2186279-1-stuart.menefy@codasip.com> MIME-Version: 1.0 X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Xref: photonic.trudheim.com org.infradead.lists.linux-riscv:78941 org.kernel.vger.linux-kernel:1256825 Newsgroups: org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The original reason for reserving the top 4GiB of the direct map (space for modules/BPF/kernel) hasn't applied since the address map was reworked for KASAN. Signed-off-by: Stuart Menefy --- arch/riscv/mm/init.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 7e25606f858a..3998d1ca369c 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -1130,13 +1130,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa) 0UL : PAGE_OFFSET - kernel_map.phys_addr; kernel_map.va_kernel_pa_offset = kernel_map.virt_addr - kernel_map.phys_addr; - /* - * The default maximal physical memory size is KERN_VIRT_SIZE for 32-bit - * kernel, whereas for 64-bit kernel, the end of the virtual address - * space is occupied by the modules/BPF/kernel mappings which reduces - * the available size of the linear mapping. - */ - memory_limit = KERN_VIRT_SIZE - (IS_ENABLED(CONFIG_64BIT) ? SZ_4G : 0); + memory_limit = KERN_VIRT_SIZE; /* Sanity check alignment and size */ BUG_ON((PAGE_OFFSET % PGDIR_SIZE) != 0); -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . From: Kanak Shilledar To: Cc: Kanak Shilledar , kernel test robot , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vladimir Zapolskiy , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3] dt-bindings: i2c: nxp,lpc1788-i2c: convert to dt schema Date: Mon, 24 Jun 2024 17:44:17 +0530 Message-ID: <20240624121421.549010-2-kanakshilledar@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256826 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-i2c Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Convert the NXP I2C controller for LPC2xxx/178x/18xx/43xx to newer DT schema. Created DT schema based on the .txt file which had `compatible`, `reg`, `interrupts`, `clocks`, `#address-cells` and `#size-cells` as required properties. Additional changes to the original .txt binding - added maintainer from the MAINTAINERS file. - added resets property required by the corresponding DTS files. Signed-off-by: Kanak Shilledar Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406200223.QexMAKqr-lkp@intel.com/ --- Changes in v3: - removed "address-cells" and "size-cells" as per feedback. Changes in v2: - updated subject line to include device name. - changed removed description from properties except `clock-frequency`. - updated MAINTAINERS to track this file. --- .../devicetree/bindings/i2c/i2c-lpc2k.txt | 33 ------------ .../bindings/i2c/nxp,lpc1788-i2c.yaml | 54 +++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 55 insertions(+), 34 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt create mode 100644 Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml diff --git a/Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt b/Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt deleted file mode 100644 index 4101aa621ad4..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt +++ /dev/null @@ -1,33 +0,0 @@ -NXP I2C controller for LPC2xxx/178x/18xx/43xx - -Required properties: - - compatible: must be "nxp,lpc1788-i2c" - - reg: physical address and length of the device registers - - interrupts: a single interrupt specifier - - clocks: clock for the device - - #address-cells: should be <1> - - #size-cells: should be <0> - -Optional properties: -- clock-frequency: the desired I2C bus clock frequency in Hz; in - absence of this property the default value is used (100 kHz). - -Example: -i2c0: i2c@400a1000 { - compatible = "nxp,lpc1788-i2c"; - reg = <0x400a1000 0x1000>; - interrupts = <18>; - clocks = <&ccu1 CLK_APB1_I2C0>; - #address-cells = <1>; - #size-cells = <0>; -}; - -&i2c0 { - clock-frequency = <400000>; - - lm75@48 { - compatible = "nxp,lm75"; - reg = <0x48>; - }; -}; - diff --git a/Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml b/Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml new file mode 100644 index 000000000000..9a1b95c2d03c --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/nxp,lpc1788-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP I2C controller for LPC2xxx/178x/18xx/43xx + +maintainers: + - Vladimir Zapolskiy + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml# + +properties: + compatible: + const: nxp,lpc1788-i2c + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-frequency: + description: the desired I2C bus clock frequency in Hz + default: 100000 + + resets: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + +unevaluatedProperties: false + +examples: + - | + #include "dt-bindings/clock/lpc18xx-ccu.h" + + i2c@400a1000 { + compatible = "nxp,lpc1788-i2c"; + reg = <0x400a1000 0x1000>; + interrupts = <18>; + clocks = <&ccu1 CLK_APB1_I2C0>; + #address-cells = <1>; + #size-cells = <0>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index cf9c9221c388..920e4f28b5ae 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2374,7 +2374,7 @@ ARM/LPC18XX ARCHITECTURE M: Vladimir Zapolskiy L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained -F: Documentation/devicetree/bindings/i2c/i2c-lpc2k.txt +F: Documentation/devicetree/bindings/i2c/nxp,lpc1788-i2c.yaml F: arch/arm/boot/dts/nxp/lpc/lpc43* F: drivers/i2c/busses/i2c-lpc2k.c F: drivers/memory/pl172.c -- 2.45.2 . From: Caleb Connolly Subject: [PATCH 0/3] arm64: dts: qcom: make dev boards prefer usb host mode Date: Mon, 24 Jun 2024 14:23:41 +0200 Message-Id: <20240624-b4-rb2-fixes-v1-0-8d763ee4e42e@linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dmitry Baryshkov Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Connolly Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256833 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Many of the Qualcomm development boards feature DRD capable type-c ports. However these boards differ from smartphones in their usage, and it's generally preferred that they would enter host mode by default when given the choice. This doesn't affect connection to a host-only PC, since the controller is still DRD capable. The RB1/2 are a special case, since they feature an on-board USB hub and a manual dip switch to toggle between it and the type-c port. Preferring host mode offers a useful hint to the software if it doesn't feature a fully DRD capable USB controller driver, it can just use the default mode (rather than defaulting to peripheral mode unconditionally). --- Caleb Connolly (3): arm64: dts: qcom: sm8650: move usb-role-switch to sm8650.dtsi arm64: dts: qcom: sm8350: move usb-role-switch to sm8350.dtsi arm64: dts: qcom: prefer host mode on dev boards arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 1 + arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 4 ++++ arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 4 ++++ arch/arm64/boot/dts/qcom/sm8150-hdk.dts | 1 + arch/arm64/boot/dts/qcom/sm8350-hdk.dts | 3 +-- arch/arm64/boot/dts/qcom/sm8350.dtsi | 1 + arch/arm64/boot/dts/qcom/sm8450-hdk.dts | 1 + arch/arm64/boot/dts/qcom/sm8550-hdk.dts | 4 ++++ arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 4 ++++ arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 4 ++++ arch/arm64/boot/dts/qcom/sm8650-hdk.dts | 3 +-- arch/arm64/boot/dts/qcom/sm8650-mtp.dts | 3 +-- arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 3 +-- arch/arm64/boot/dts/qcom/sm8650.dtsi | 1 + 14 files changed, 29 insertions(+), 8 deletions(-) --- change-id: 20240624-b4-rb2-fixes-1ad33cd72f3a base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 // Caleb (they/them) . From: Nianyao Tang To: , , , CC: , , Subject: [PATCH] irqchip/gic-v4.1: Use the ITS of the NUMA node where current cpu is located Date: Mon, 24 Jun 2024 12:25:10 +0000 Message-ID: <20240624122510.3906474-1-tangnianyao@huawei.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256838 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail When GICv4.1 enabled, guest sending IPI use the last ITS reported. On multi-NUMA environment with more than one ITS, it makes IPI performance various from VM to VM, depending on which NUMA the VM is deployed on. We can use closer ITS instead of the last ITS reported. Modify find_4_1_its to find the ITS of the NUMA node where current cpu is located and save it with per cpu variable. Signed-off-by: Nianyao Tang --- drivers/irqchip/irq-gic-v3-its.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 3c755d5dad6e..d35b42f3b2af 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -193,6 +193,8 @@ static DEFINE_RAW_SPINLOCK(vmovp_lock); static DEFINE_IDA(its_vpeid_ida); +static DEFINE_PER_CPU(struct its_node *, its_on_cpu); + #define gic_data_rdist() (raw_cpu_ptr(gic_rdists->rdist)) #define gic_data_rdist_cpu(cpu) (per_cpu_ptr(gic_rdists->rdist, cpu)) #define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base) @@ -4058,19 +4060,26 @@ static struct irq_chip its_vpe_irq_chip = { static struct its_node *find_4_1_its(void) { - static struct its_node *its = NULL; + struct its_node *its = NULL; + struct its_node *its_non_cpu_node = NULL; + int cpu = smp_processor_id(); - if (!its) { - list_for_each_entry(its, &its_nodes, entry) { - if (is_v4_1(its)) - return its; - } + if (per_cpu(its_on_cpu, cpu)) + return per_cpu(its_on_cpu, cpu); - /* Oops? */ - its = NULL; - } + list_for_each_entry(its, &its_nodes, entry) { + if (is_v4_1(its) && its->numa_node == cpu_to_node(cpu)) { + per_cpu(its_on_cpu, cpu) = its; + return its; + } + else if (is_v4_1(its)) + its_non_cpu_node = its; + } - return its; + if (!per_cpu(its_on_cpu, cpu) && its_non_cpu_node) + per_cpu(its_on_cpu, cpu) = its_non_cpu_node; + + return its_non_cpu_node; } static void its_vpe_4_1_send_inv(struct irq_data *d) -- 2.30.0 . Return-Path: From: Yunhui Cui To: charlie@rivosinc.com, rppt@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, alexghiti@rivosinc.com, akpm@linux-foundation.org, bhe@redhat.com, dawei.li@shingroup.cn, jszhang@kernel.org, namcao@linutronix.de, chenjiahao16@huawei.com, bjorn@rivosinc.com, cuiyunhui@bytedance.com, vishal.moola@gmail.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] RISC-V: cmdline: Add support for 'memmap' parameter Date: Mon, 24 Jun 2024 20:37:39 +0800 Message-Id: <20240624123739.43604-1-cuiyunhui@bytedance.com> MIME-Version: 1.0 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Xref: photonic.trudheim.com org.infradead.lists.linux-riscv:78942 org.kernel.vger.linux-kernel:1256841 Newsgroups: org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add parsing of 'memmap' to use or reserve a specific region of memory. Implement the following memmap variants: - memmap=nn[KMG]@ss[KMG]: force usage of a specific region of memory; - memmap=nn[KMG]$ss[KMG]: mark specified memory as reserved; Signed-off-by: Yunhui Cui --- arch/riscv/mm/init.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index e3405e4b99af..8e1d93ae5cb2 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -208,6 +208,52 @@ static int __init early_mem(char *p) } early_param("mem", early_mem); +static void __init parse_memmap_one(char *p) +{ + char *oldp; + unsigned long start_at, mem_size; + + if (!p) + return; + + oldp = p; + mem_size = memparse(p, &p); + if (p == oldp) + return; + + switch (*p) { + case '@': + start_at = memparse(p + 1, &p); + memblock_add(start_at, mem_size); + break; + + case '$': + start_at = memparse(p + 1, &p); + memblock_reserve(start_at, mem_size); + break; + + default: + pr_warn("Unrecognized memmap syntax: %s\n", p); + break; + } +} + +static int __init parse_memmap_opt(char *str) +{ + while (str) { + char *k = strchr(str, ','); + + if (k) + *k++ = 0; + + parse_memmap_one(str); + str = k; + } + + return 0; +} +early_param("memmap", parse_memmap_opt); + static void __init setup_bootmem(void) { phys_addr_t vmlinux_end = __pa_symbol(&_end); -- 2.20.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . Subject: [PATCH v4 0/6] powerpc: pSeries: vfio: iommu: Re-enable support for SPAPR TCE VFIO From: Shivaprasad G Bhat To: mpe@ellerman.id.au, tpearson@raptorengineering.com, alex.williamson@redhat.com, linuxppc-dev@lists.ozlabs.org, aik@amd.com Cc: npiggin@gmail.com, christophe.leroy@csgroup.eu, aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com, gbatra@linux.vnet.ibm.com, brking@linux.vnet.ibm.com, sbhat@linux.ibm.com, aik@ozlabs.ru, jgg@ziepe.ca, ruscur@russell.cc, robh@kernel.org, sanastasio@raptorengineering.com, linux-kernel@vger.kernel.org, joel@jms.id.au, kvm@vger.kernel.org, msuchanek@suse.de, oohall@gmail.com, mahesh@linux.ibm.com, jroedel@suse.de, vaibhav@linux.ibm.com, svaidy@linux.ibm.com Date: Mon, 24 Jun 2024 12:38:07 +0000 Message-ID: <171923268781.1397.8871195514893204050.stgit@linux.ibm.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256851 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.kvm,org.ozlabs.lists.linuxppc-dev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The patches reimplement the iommu table_group_ops for pSeries for VFIO SPAPR TCE sub-driver thereby bringing consistency with PowerNV implementation and getting rid of limitations/bugs which were emanating from these differences on the earlier approach on pSeries. Structure of the patchset: ------------------------- The first and fifth patches just code movements. Second patch takes care of collecting the TCE and DDW information for the vfio_iommu_spapr_tce_ddw_info during probe. Third patch fixes the convention of using table[1] for VFs on pSeries when used by the host driver. Fourth patch fixes the VFIO to call TCE clear before unset window. The last patch has the API reimplementations, please find the details on its commit description. Testing: ------- Tested with nested guest for NVME card, Mellanox multi-function card by attaching them to nested kvm guest running on a pSeries lpar. Also vfio-test [2] by Alex Willamson, was forked and updated to add support for pSeries guest and used to test these patches[3]. Limitations/Known Issues: ------------------------ * The DMA window restrictions with SRIOV VF scenarios of having maximum 1 dma window is taken care in the current patches itself. However, the necessary changes required in vfio_iommu_spapr_tce_ddw_info to expose the default window being a 64-bit one and the qemu changes handle the same will be taken care in future versions. References: ---------- [1] https://lore.kernel.org/linuxppc-dev/171026724548.8367.8321359354119254395.stgit@linux.ibm.com/ [2] https://github.com/awilliam/tests [3] https://github.com/nnmwebmin/vfio-ppc-tests/tree/vfio-ppc-ex --- Changelog: v3: https://lore.kernel.org/linuxppc-dev/171810893836.1721.2640631616827396553.stgit@linux.ibm.com/ - Rebased to top of the tree. - In the first patch, spapr_tce_table_group_ops is only used locally in the pseries/iommu.c file. So, made it static. - Fixed the test robot reported issues 202406121640.yr6LK5HJ-lkp@intel.com and 202406142110.r97Ts8Xm-lkp@intel.com - Updated the commit messages v2: https://lore.kernel.org/linuxppc-dev/171450753489.10851.3056035705169121613.stgit@linux.ibm.com/ - Rebased to upstream. So, required the explicit vmalloc.h inclusion as its removed from the system header io.h now. - Fixed the DLPAR hotplugged device assignment case. The dma window property is backed up before removal. That copy is restored when required. - Cleaned up bit more. Removed leftover debug prints and dump_stack()s. - The warning at remap_pfn_range_notrack() during kvm guest boot is no longer seen after the rebase. v1: https://lore.kernel.org/linuxppc-dev/171026724548.8367.8321359354119254395.stgit@linux.ibm.com/ - Rewrite as to stop borrowing the DMA windows and implemented the table_group_ops for pSeries. - Cover letter and Patch 6 has more details as this was a rewrite. Shivaprasad G Bhat (6): powerpc/iommu: Move pSeries specific functions to pseries/iommu.c powerpc/pseries/iommu: Fix the VFIO_IOMMU_SPAPR_TCE_GET_INFO ioctl output powerpc/pseries/iommu: Use the iommu table[0] for IOV VF's DDW vfio/spapr: Always clear TCEs before unsetting the window powerpc/iommu: Move dev_has_iommu_table() to iommu.c powerpc/iommu: Reimplement the iommu_table_group_ops for pSeries arch/powerpc/include/asm/iommu.h | 14 +- arch/powerpc/kernel/eeh.c | 16 - arch/powerpc/kernel/iommu.c | 170 +----- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +- arch/powerpc/platforms/pseries/iommu.c | 704 +++++++++++++++++++++- drivers/vfio/vfio_iommu_spapr_tce.c | 13 +- 6 files changed, 718 insertions(+), 205 deletions(-) -- Signature . From: Alisa-Dariana Roman To: Alisa-Dariana Roman , Jonathan Cameron , Michael Hennerich , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown Subject: [PATCH v6 0/6] iio: adc: ad7192: Improvements Date: Mon, 24 Jun 2024 15:49:35 +0300 Message-Id: <20240624124941.113010-1-alisa.roman@analog.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256865 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Dear everyone, Thank you very much for your feedback! The series is based on testing branch, since the initial first commit was applied there. Here is the upgraded series. Please consider applying the commits in order! Conor, please note that I didn't add your Reviewed-by tag, since I modified that commit in this series. Kind regards, Alisa-Dariana Roman. v5 -> v6 add my SoB to David's commit add restrictions to the bindings patches and also modify their commit messages v5: https://lore.kernel.org/all/20240618142138.520192-1-alisa.roman@analog.com/ . From: Li Lingfeng To: tj@kernel.org, josef@toxicpanda.com, hch@lst.de, axboe@kernel.dk Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yangerkun@huawei.com, yukuai1@huaweicloud.com, houtao1@huawei.com, yi.zhang@huawei.com, lilingfeng@huaweicloud.com, lilingfeng3@huawei.com Subject: [PATCH] block: cancel all throttled bios when deleting the cgroup Date: Mon, 24 Jun 2024 21:09:40 +0800 Message-Id: <20240624130940.3751791-1-lilingfeng@huaweicloud.com> X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-block:93422 org.kernel.vger.linux-kernel:1256875 Newsgroups: org.kernel.vger.linux-block,org.kernel.vger.cgroups,org.kernel.vger.linux-kernel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Li Lingfeng When a process migrates to another cgroup and the original cgroup is deleted, the restrictions of throttled bios cannot be removed. If the restrictions are set too low, it will take a long time to complete these bios. Refer to the process of deleting a disk to remove the restrictions and issue bios when deleting the cgroup. References: https://lore.kernel.org/r/20220318130144.1066064-4-ming.lei@redhat.com Signed-off-by: Li Lingfeng --- block/blk-throttle.c | 68 ++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index c1bf73f8c75d..a0e5b28951ca 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1534,6 +1534,42 @@ static void throtl_shutdown_wq(struct request_queue *q) cancel_work_sync(&td->dispatch_work); } +static void tg_cancel_bios(struct throtl_grp *tg) +{ + struct throtl_service_queue *sq = &tg->service_queue; + + if (tg->flags & THROTL_TG_CANCELING) + return; + /* + * Set the flag to make sure throtl_pending_timer_fn() won't + * stop until all throttled bios are dispatched. + */ + tg->flags |= THROTL_TG_CANCELING; + + /* + * Do not dispatch cgroup without THROTL_TG_PENDING or cgroup + * will be inserted to service queue without THROTL_TG_PENDING + * set in tg_update_disptime below. Then IO dispatched from + * child in tg_dispatch_one_bio will trigger double insertion + * and corrupt the tree. + */ + if (!(tg->flags & THROTL_TG_PENDING)) + return; + + /* + * Update disptime after setting the above flag to make sure + * throtl_select_dispatch() won't exit without dispatching. + */ + tg_update_disptime(tg); + + throtl_schedule_pending_timer(sq, jiffies + 1); +} + +static void throtl_pd_offline(struct blkg_policy_data *pd) +{ + tg_cancel_bios(pd_to_tg(pd)); +} + struct blkcg_policy blkcg_policy_throtl = { .dfl_cftypes = throtl_files, .legacy_cftypes = throtl_legacy_files, @@ -1541,6 +1577,7 @@ struct blkcg_policy blkcg_policy_throtl = { .pd_alloc_fn = throtl_pd_alloc, .pd_init_fn = throtl_pd_init, .pd_online_fn = throtl_pd_online, + .pd_offline_fn = throtl_pd_offline, .pd_free_fn = throtl_pd_free, }; @@ -1561,32 +1598,15 @@ void blk_throtl_cancel_bios(struct gendisk *disk) */ rcu_read_lock(); blkg_for_each_descendant_post(blkg, pos_css, q->root_blkg) { - struct throtl_grp *tg = blkg_to_tg(blkg); - struct throtl_service_queue *sq = &tg->service_queue; - - /* - * Set the flag to make sure throtl_pending_timer_fn() won't - * stop until all throttled bios are dispatched. - */ - tg->flags |= THROTL_TG_CANCELING; - /* - * Do not dispatch cgroup without THROTL_TG_PENDING or cgroup - * will be inserted to service queue without THROTL_TG_PENDING - * set in tg_update_disptime below. Then IO dispatched from - * child in tg_dispatch_one_bio will trigger double insertion - * and corrupt the tree. + * disk_release will call pd_offline_fn to cancel bios. + * However, disk_release can't be called if someone get + * the refcount of device and issued bios which are + * inflight after del_gendisk. + * Cancel bios here to ensure no bios are inflight after + * del_gendisk. */ - if (!(tg->flags & THROTL_TG_PENDING)) - continue; - - /* - * Update disptime after setting the above flag to make sure - * throtl_select_dispatch() won't exit without dispatching. - */ - tg_update_disptime(tg); - - throtl_schedule_pending_timer(sq, jiffies + 1); + tg_cancel_bios(blkg_to_tg(blkg)); } rcu_read_unlock(); spin_unlock_irq(&q->queue_lock); -- 2.31.1 . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Linus Walleij Date: Mon, 24 Jun 2024 15:05:00 +0200 Message-ID: Subject: [GIT PULL] pin control fixes for v6.10 To: Linus Torvalds Cc: linux-kernel , "open list:GPIO SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256880 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-gpio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi Linus, here are some accumulated fixes for the v6.10 kernel cycle. A bit late because midsummer. A bit of brief details in the signed tag as usual. Please pull it in! Yours, Linus Walleij The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git tags/pinctrl-v6.10-2 for you to fetch changes up to 4ea4d4808e342ddf89ba24b93ffa2057005aaced: pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set (2024-06-17 10:36:56 +0200) ---------------------------------------------------------------- Pin control fixes for the v6.10 series: - Use flag saving spinlocks in the Renesas rzg2l driver. This fixes up PREEMPT_RT problems. - Remove broken Qualcomm PM8008 that clearly was never working. A new version will arrive in the next merge window. - Add a quirk for LP8764 regmap that was missed and made the TI J7200 board unusable. - Fix persistance on the BCM2835 GPIO outputs kernel parameter so this remains consisten across a booted kernel. - Fix a potential deadlock in create_pinctrl() - Fix some erroneous bitfields and pinmux reset in the Rockchip RK3328 driver. ---------------------------------------------------------------- Claudiu Beznea (1): pinctrl: renesas: rzg2l: Use spin_{lock,unlock}_irq{save,restore} Hagar Hemdan (1): pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER Huang-Huang Bao (4): pinctrl: rockchip: fix pinmux bits for RK3328 GPIO2-B pins pinctrl: rockchip: fix pinmux bits for RK3328 GPIO3-B pins pinctrl: rockchip: use dedicated pinctrl type for RK3328 pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set Johan Hovold (2): pinctrl: qcom: spmi-gpio: drop broken pm8008 support dt-bindings: pinctrl: qcom,pmic-gpio: drop pm8008 Linus Walleij (1): Merge tag 'renesas-pinctrl-fixes-for-v6.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into fixes Stefan Wahren (1): pinctrl: bcm2835: Fix permissions of persist_gpio_outputs Thomas Richard (1): pinctrl: tps6594: add missing support for LP8764 PMIC .../bindings/pinctrl/qcom,pmic-gpio.yaml | 3 - drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- drivers/pinctrl/core.c | 2 +- drivers/pinctrl/pinctrl-rockchip.c | 68 +++++++++++++++++++--- drivers/pinctrl/pinctrl-rockchip.h | 1 + drivers/pinctrl/pinctrl-tps6594.c | 1 + drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 - drivers/pinctrl/renesas/pinctrl-rzg2l.c | 4 +- 8 files changed, 65 insertions(+), 17 deletions(-) . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 06:18:19 -0700 Message-ID: <00000000000063fd99061ba29d87@google.com> Subject: [syzbot] [nfs?] INFO: task hung in nfsd_nl_version_get_doit From: syzbot To: Dai.Ngo@oracle.com, chuck.lever@oracle.com, jlayton@kernel.org, kolga@netapp.com, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, neilb@suse.de, syzkaller-bugs@googlegroups.com, tom@talpey.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256894 org.kernel.vger.linux-nfs:86252 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: 2ccbdf43d5e7 Merge tag 'for-linus' of git://git.kernel.org.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=17a8c3de980000 kernel config: https://syzkaller.appspot.com/x/.config?x=c79815c08cc14227 dashboard link: https://syzkaller.appspot.com/bug?extid=41bc60511c2884783c27 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/9fb20954c51e/disk-2ccbdf43.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/06d78b3cf960/vmlinux-2ccbdf43.xz kernel image: https://storage.googleapis.com/syzbot-assets/15e5b0a8df77/bzImage-2ccbdf43.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+41bc60511c2884783c27@syzkaller.appspotmail.com INFO: task syz-executor.2:26515 blocked for more than 144 seconds. Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor.2 state:D stack:26328 pid:26515 tgid:26509 ppid:26207 flags:0x00000006 Call Trace: context_switch kernel/sched/core.c:5408 [inline] __schedule+0x1796/0x49d0 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0x14b/0x320 kernel/sched/core.c:6837 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894 __mutex_lock_common kernel/locking/mutex.c:684 [inline] __mutex_lock+0x6a4/0xd70 kernel/locking/mutex.c:752 nfsd_nl_version_get_doit+0x181/0x780 fs/nfsd/nfsctl.c:1892 genl_family_rcv_msg_doit net/netlink/genetlink.c:1115 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0xb14/0xec0 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2564 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ea/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8db/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2585 ___sys_sendmsg net/socket.c:2639 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2668 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7e21a7cea9 RSP: 002b:00007f7e228320c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f7e21bb4120 RCX: 00007f7e21a7cea9 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 000000000000000c RBP: 00007f7e21aebff4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f7e21bb4120 R15: 00007ffcc0bd6078 Showing all locks held in the system: 1 lock held by pool_workqueue_/3: 1 lock held by khungtaskd/30: #0: ffffffff8e333fa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8e333fa0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #0: ffffffff8e333fa0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6614 2 locks held by kworker/u8:6/1098: 2 locks held by getty/4840: #0: ffff88802abac0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243 #1: ffffc90002f0e2f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b5/0x1e10 drivers/tty/n_tty.c:2201 2 locks held by syz-fuzzer/5091: 3 locks held by kworker/0:0/15508: #0: ffff888015080948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline] #0: ffff888015080948 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312 #1: ffffc9000429fd00 (free_ipc_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline] #1: ffffc9000429fd00 (free_ipc_work){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312 #2: ffffffff8e339378 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:323 [inline] #2: ffffffff8e339378 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x451/0x830 kernel/rcu/tree_exp.h:939 2 locks held by kworker/u8:14/18935: 2 locks held by syz-executor.0/25819: #0: ffffffff8f63b9d0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1218 #1: ffffffff8e600748 (nfsd_mutex){+.+.}-{3:3}, at: nfsd_nl_listener_set_doit+0x12d/0x1a90 fs/nfsd/nfsctl.c:1966 2 locks held by syz-executor.2/26515: #0: ffffffff8f63b9d0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1218 #1: ffffffff8e600748 (nfsd_mutex){+.+.}-{3:3}, at: nfsd_nl_version_get_doit+0x181/0x780 fs/nfsd/nfsctl.c:1892 2 locks held by syz-executor.3/26579: #0: ffffffff8f63b9d0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1218 #1: ffffffff8e600748 (nfsd_mutex){+.+.}-{3:3}, at: nfsd_nl_version_get_doit+0x181/0x780 fs/nfsd/nfsctl.c:1892 1 lock held by syz-executor.2/28062: #0: ffffffff8e339378 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:291 [inline] #0: ffffffff8e339378 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x381/0x830 kernel/rcu/tree_exp.h:939 1 lock held by syz-executor.3/28067: ============================================= NMI backtrace for cpu 1 CPU: 1 PID: 30 Comm: khungtaskd Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 nmi_cpu_backtrace+0x49c/0x4d0 lib/nmi_backtrace.c:113 nmi_trigger_cpumask_backtrace+0x198/0x320 lib/nmi_backtrace.c:62 trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline] check_hung_uninterruptible_tasks kernel/hung_task.c:223 [inline] watchdog+0xfde/0x1020 kernel/hung_task.c:379 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Sending NMI from CPU 1 to CPUs 0: NMI backtrace for cpu 0 CPU: 0 PID: 28056 Comm: syz-executor.0 Not tainted 6.10.0-rc3-syzkaller --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 06:18:19 -0700 Message-ID: <000000000000689a2b061ba29db3@google.com> Subject: [syzbot] [nfs?] INFO: task hung in nfsd_nl_threads_get_doit From: syzbot To: Dai.Ngo@oracle.com, chuck.lever@oracle.com, jlayton@kernel.org, kolga@netapp.com, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, neilb@suse.de, syzkaller-bugs@googlegroups.com, tom@talpey.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256895 org.kernel.vger.linux-nfs:86253 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: cea2a26553ac mailmap: Add my outdated addresses to the map.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=118b1796980000 kernel config: https://syzkaller.appspot.com/x/.config?x=b8786f381e62940f dashboard link: https://syzkaller.appspot.com/bug?extid=c0831b61d6ade1e2d098 compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/c2c55a2edceb/disk-cea2a265.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/e3f36f58a11d/vmlinux-cea2a265.xz kernel image: https://storage.googleapis.com/syzbot-assets/0447e9647456/bzImage-cea2a265.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+c0831b61d6ade1e2d098@syzkaller.appspotmail.com INFO: task syz-executor.2:20070 blocked for more than 143 seconds. Not tainted 6.10.0-rc3-syzkaller-00022-gcea2a26553ac #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor.2 state:D stack:27840 pid:20070 tgid:20068 ppid:19010 flags:0x00000006 Call Trace: context_switch kernel/sched/core.c:5408 [inline] __schedule+0xf15/0x5d00 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0xe7/0x350 kernel/sched/core.c:6837 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894 __mutex_lock_common kernel/locking/mutex.c:684 [inline] __mutex_lock+0x5b8/0x9c0 kernel/locking/mutex.c:752 nfsd_nl_threads_get_doit+0x1c6/0x7d0 fs/nfsd/nfsctl.c:1757 genl_family_rcv_msg_doit+0x202/0x2f0 net/netlink/genetlink.c:1115 genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline] genl_rcv_msg+0x565/0x800 net/netlink/genetlink.c:1210 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2564 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0xab5/0xc90 net/socket.c:2585 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2639 __sys_sendmsg+0x117/0x1f0 net/socket.c:2668 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8368c7cea9 RSP: 002b:00007f8369a710c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f8368db3f80 RCX: 00007f8368c7cea9 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000003 RBP: 00007f8368cebff4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f8368db3f80 R15: 00007ffc121dd2e8 Showing all locks held in the system: 1 lock held by khungtaskd/30: #0: ffffffff8dbb1920 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #0: ffffffff8dbb1920 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #0: ffffffff8dbb1920 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x75/0x340 kernel/locking/lockdep.c:6614 2 locks held by getty/4834: #0: ffff88802a5540a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x24/0x80 drivers/tty/tty_ldisc.c:243 #1: ffffc90002f062f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xfc8/0x1490 drivers/tty/n_tty.c:2201 1 lock held by syz-fuzzer/5075: 3 locks held by kworker/0:4/10299: #0: ffff888015480948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x12bf/0x1b60 kernel/workqueue.c:3206 #1: ffffc900032cfd80 (free_ipc_work){+.+.}-{0:0}, at: process_one_work+0x957/0x1b60 kernel/workqueue.c:3207 #2: ffffffff8dbbd0b8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock+0x282/0x3b0 kernel/rcu/tree_exp.h:291 2 locks held by syz-executor.0/19218: #0: ffffffff8f7e9d90 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1218 #1: ffffffff8dfb2f48 (nfsd_mutex){+.+.}-{3:3}, at: nfsd_nl_listener_set_doit+0xe3/0x1b30 fs/nfsd/nfsctl.c:1966 1 lock held by syz-executor.1/19451: 3 locks held by kworker/u8:0/20032: 2 locks held by syz-executor.2/20070: #0: ffffffff8f7e9d90 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1218 #1: ffffffff8dfb2f48 (nfsd_mutex){+.+.}-{3:3}, at: nfsd_nl_threads_get_doit+0x1c6/0x7d0 fs/nfsd/nfsctl.c:1757 3 locks held by syz-executor.4/20215: #0: ffff8880560b0d88 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x26/0x90 net/bluetooth/hci_core.c:554 #1: ffff8880560b0078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x339/0x1100 net/bluetooth/hci_sync.c:5050 #2: ffffffff8f9adba8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1982 [inline] #2: ffffffff8f9adba8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xc4/0x260 net/bluetooth/hci_conn.c:2584 2 locks held by syz-executor.2/20315: 3 locks held by syz-executor.3/20448: #0: ffff888063cf4d88 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x26/0x90 net/bluetooth/hci_core.c:554 #1: ffff888063cf4078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x339/0x1100 net/bluetooth/hci_sync.c:5050 #2: ffffffff8f9adba8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1982 [inline] #2: ffffffff8f9adba8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xc4/0x260 net/bluetooth/hci_conn.c:2584 1 lock held by syz-executor.0/21407: #0: ffffffff8dbbd0b8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock+0x1a4/0x3b0 kernel/rcu/tree_exp.h:323 ============================================= NMI backtrace for cpu 0 CPU: 0 PID: 30 Comm: khungtaskd Not tainted 6.10.0-rc3-syzkaller-00022-gcea2a26553ac #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 nmi_cpu_backtrace+0x27b/0x390 lib/nmi_backtrace.c:113 nmi_trigger_cpumask_backtrace+0x29c/0x300 lib/nmi_backtrace.c:62 trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline] check_hung_uninterruptible_tasks kernel/hung_task.c:223 [inline] watchdog+0xf86/0x1240 kernel/hung_task.c:379 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Sending NMI from CPU 0 to CPUs 1: NMI backtrace for cpu 1 skipped: idling at native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] NMI backtrace for cpu 1 skipped: idling at arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline] NMI backtrace for cpu 1 skipped: idling at acpi_safe_halt+0x1a/0x20 drivers/acpi/processor_idle.c:112 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . From: Animesh Agarwal To: Cc: animeshagarwal28@gmail.com, Daniel Baluta , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ASoC: dt-bindings: realtek,rt5659: Convert to dtschema Date: Mon, 24 Jun 2024 18:59:44 +0530 Message-ID: <20240624132949.124228-1-animeshagarwal28@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256908 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-sound Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Convert the RT5659/RT5658 audio CODEC bindings to DT schema. Signed-off-by: Animesh Agarwal Cc: Daniel Baluta --- Changes in v2: - Dropped redundant descriptions from reg, interrupts and clocks. - Added default to gpio properties. - Dropped sound-name-prefix: true --- .../bindings/sound/realtek,rt5659.yaml | 129 ++++++++++++++++++ .../devicetree/bindings/sound/rt5659.txt | 89 ------------ 2 files changed, 129 insertions(+), 89 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/realtek,rt5659.yaml delete mode 100644 Documentation/devicetree/bindings/sound/rt5659.txt diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml new file mode 100644 index 000000000000..1100ffd9a7c0 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/realtek,rt5659.yaml @@ -0,0 +1,129 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/realtek,rt5659.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RT5659/RT5658 audio CODEC + +maintainers: + - Animesh Agarwal + +description: | + This device supports I2C only. + + Pins on the device (for linking into audio routes) for RT5659/RT5658: + * DMIC L1 + * DMIC R1 + * DMIC L2 + * DMIC R2 + * IN1P + * IN1N + * IN2P + * IN2N + * IN3P + * IN3N + * IN4P + * IN4N + * HPOL + * HPOR + * SPOL + * SPOR + * LOUTL + * LOUTR + * MONOOUT + * PDML + * PDMR + * SPDIF + +allOf: + - $ref: dai-common.yaml# + +properties: + compatible: + enum: + - realtek,rt5659 + - realtek,rt5658 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + const: mclk + + realtek,dmic1-data-pin: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 0 # dmic1 is not used + - 1 # using IN2N pin as dmic1 data pin + - 2 # using GPIO5 pin as dmic1 data pin + - 3 # using GPIO9 pin as dmic1 data pin + - 4 # using GPIO11 pin as dmic1 data pin + description: Specify which pin to be used as DMIC1 data pin. + default: 0 + + realtek,dmic2-data-pin: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 0 # dmic2 is not used + - 1 # using IN2P pin as dmic2 data pin + - 2 # using GPIO6 pin as dmic2 data pin + - 3 # using GPIO10 pin as dmic2 data pin + - 4 # using GPIO12 pin as dmic2 data pin + description: Specify which pin to be used as DMIC2 data pin. + default: 0 + + realtek,jd-src: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: + - 0 # No JD is used + - 1 # using JD3 as JD source + - 2 # JD source for Intel HDA header + description: Specify which JD source be used. + default: 0 + + realtek,ldo1-en-gpios: + maxItems: 1 + description: CODEC's LDO1_EN pin. + + realtek,reset-gpios: + maxItems: 1 + description: CODEC's RESET pin. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + port: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + codec@1b { + compatible = "realtek,rt5659"; + reg = <0x1b>; + interrupt-parent = <&gpio>; + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; + realtek,ldo1-en-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + }; + }; diff --git a/Documentation/devicetree/bindings/sound/rt5659.txt b/Documentation/devicetree/bindings/sound/rt5659.txt deleted file mode 100644 index 8f3f62c0226a..000000000000 --- a/Documentation/devicetree/bindings/sound/rt5659.txt +++ /dev/null @@ -1,89 +0,0 @@ -RT5659/RT5658 audio CODEC - -This device supports I2C only. - -Required properties: - -- compatible : One of "realtek,rt5659" or "realtek,rt5658". - -- reg : The I2C address of the device. - -- interrupts : The CODEC's interrupt output. - -Optional properties: - -- clocks: The phandle of the master clock to the CODEC -- clock-names: Should be "mclk" - -- realtek,in1-differential -- realtek,in3-differential -- realtek,in4-differential - Boolean. Indicate MIC1/3/4 input are differential, rather than single-ended. - -- realtek,dmic1-data-pin - 0: dmic1 is not used - 1: using IN2N pin as dmic1 data pin - 2: using GPIO5 pin as dmic1 data pin - 3: using GPIO9 pin as dmic1 data pin - 4: using GPIO11 pin as dmic1 data pin - -- realtek,dmic2-data-pin - 0: dmic2 is not used - 1: using IN2P pin as dmic2 data pin - 2: using GPIO6 pin as dmic2 data pin - 3: using GPIO10 pin as dmic2 data pin - 4: using GPIO12 pin as dmic2 data pin - -- realtek,jd-src - 0: No JD is used - 1: using JD3 as JD source - 2: JD source for Intel HDA header - -- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. -- realtek,reset-gpios : The GPIO that controls the CODEC's RESET pin. - -- sound-name-prefix: Please refer to dai-common.yaml - -- ports: A Codec may have a single or multiple I2S interfaces. These - interfaces on Codec side can be described under 'ports' or 'port'. - When the SoC or host device is connected to multiple interfaces of - the Codec, the connectivity can be described using 'ports' property. - If a single interface is used, then 'port' can be used. The usage - depends on the platform or board design. - Please refer to Documentation/devicetree/bindings/graph.txt - -Pins on the device (for linking into audio routes) for RT5659/RT5658: - - * DMIC L1 - * DMIC R1 - * DMIC L2 - * DMIC R2 - * IN1P - * IN1N - * IN2P - * IN2N - * IN3P - * IN3N - * IN4P - * IN4N - * HPOL - * HPOR - * SPOL - * SPOR - * LOUTL - * LOUTR - * MONOOUT - * PDML - * PDMR - * SPDIF - -Example: - -rt5659 { - compatible = "realtek,rt5659"; - reg = <0x1b>; - interrupt-parent = <&gpio>; - interrupts = ; - realtek,ldo1-en-gpios = - <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>; -}; -- 2.45.2 . From: Johan Hovold To: Greg Kroah-Hartman , Jiri Slaby Cc: Konrad Dybcio , Douglas Anderson , Bjorn Andersson , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 0/3] serial: qcom-geni: fix lockups Date: Mon, 24 Jun 2024 15:31:32 +0200 Message-ID: <20240624133135.7445-1-johan+linaro@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256912 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-serial Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Since 6.10-rc1, Qualcomm machines with a serial port can easily lock up hard, for example, when stopping a getty on reboot. The first patch in this series fixes this severe regression by restoring the pre-6.10-rc1 behaviour of printing additional characters when flushing the tx buffer. The second patch fixes a long-standing issue in the GENI driver which can lead to a soft lock up when using software flow control and on suspend. The third patch, addresses the old issue with additional characters being printing when flushing the buffer. Note that timeouts used when clearing the tx fifo are a bit excessive since I'm reusing the current qcom_geni_serial_poll_bit() helper for now. I think at least the first patch should be merged for rc6 while we consider the best way forward to address the remaining issues. Doug has posted an alternative series of fixes here that depends on reworking the driver a fair bit here: https://lore.kernel.org/lkml/20240610222515.3023730-1-dianders@chromium.org/ Johan Johan Hovold (3): serial: qcom-geni: fix hard lockup on buffer flush serial: qcom-geni: fix soft lockup on sw flow control and suspend serial: qcom-geni: fix garbage output after buffer flush drivers/tty/serial/qcom_geni_serial.c | 36 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) -- 2.44.1 . From: Srinivas Kandagatla Subject: [PATCH v2 0/3] arm64: dts: qcom: x1e80100: Add soundwire controller resets Date: Mon, 24 Jun 2024 14:32:35 +0100 Message-Id: <20240624-x1e-swr-reset-v2-0-8bc677fcfa64@linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256916 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-clk,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Soundwire resets are missing in the existing dts, add resets for all the 4 instances of Soundwire controllers (WSA, WSA2, RX, TX). Signed-off-by: Srinivas Kandagatla --- Changes in v2: - fixed dt bindings. - Link to v1: https://lore.kernel.org/r/20240624-x1e-swr-reset-v1-0-da326d0733d4@linaro.org --- Srinivas Kandagatla (3): dt-bindings: clock: Add x1e80100 LPASS AUDIOCC reset controller dt-bindings: clock: Add x1e80100 LPASSCC reset controller arm64: dts: qcom: x1e80100: add soundwire controller resets .../bindings/clock/qcom,sc8280xp-lpasscc.yaml | 13 +++++++++--- arch/arm64/boot/dts/qcom/x1e80100.dtsi | 23 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) --- base-commit: 781025f172e19ca5682d7bfc5243e7aa74c4977f change-id: 20240624-x1e-swr-reset-0196fbf7b8f9 Best regards, -- Srinivas Kandagatla . From: Matthias Schiffer To: Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH v2] arm64: dts: ti: k3-am642-tqma64xxl-mbax4xxl: add PRU Ethernet support Date: Mon, 24 Jun 2024 15:42:35 +0200 Message-ID: <20240624134235.202243-1-matthias.schiffer@ew.tq-group.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256928 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add PRU Ethernet controller and PHY nodes, as it was previously done for the AM64x EVM Device Trees. Signed-off-by: Matthias Schiffer --- v2: - Dropped binding change patch - Moved prueth device node to DTS toplevel, matching the AM64x EVM - Update firmware filenames to match EVM .../dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts b/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts index 1f4dc5ad1696a..204f5e48a9c63 100644 --- a/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts +++ b/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts @@ -24,6 +24,8 @@ / { aliases { ethernet0 = &cpsw_port1; + ethernet1 = &icssg1_emac0; + ethernet2 = &icssg1_emac1; i2c1 = &mcu_i2c0; mmc1 = &sdhci1; serial0 = &mcu_uart0; @@ -71,6 +73,66 @@ led-1 { }; }; + icssg1_eth: icssg1-eth { + compatible = "ti,am642-icssg-prueth"; + pinctrl-names = "default"; + pinctrl-0 = <&pru_icssg1_rgmii1_pins>, <&pru_icssg1_rgmii2_pins>; + interrupt-parent = <&icssg1_intc>; + interrupts = <24 0 2>, <25 1 3>; + interrupt-names = "tx_ts0", "tx_ts1"; + dmas = <&main_pktdma 0xc200 15>, /* egress slice 0 */ + <&main_pktdma 0xc201 15>, /* egress slice 0 */ + <&main_pktdma 0xc202 15>, /* egress slice 0 */ + <&main_pktdma 0xc203 15>, /* egress slice 0 */ + <&main_pktdma 0xc204 15>, /* egress slice 1 */ + <&main_pktdma 0xc205 15>, /* egress slice 1 */ + <&main_pktdma 0xc206 15>, /* egress slice 1 */ + <&main_pktdma 0xc207 15>, /* egress slice 1 */ + <&main_pktdma 0x4200 15>, /* ingress slice 0 */ + <&main_pktdma 0x4201 15>; /* ingress slice 1 */ + dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3", + "tx1-0", "tx1-1", "tx1-2", "tx1-3", + "rx0", "rx1"; + sram = <&oc_sram>; + firmware-name = "ti-pruss/am64x-sr2-pru0-prueth-fw.elf", + "ti-pruss/am64x-sr2-rtu0-prueth-fw.elf", + "ti-pruss/am64x-sr2-txpru0-prueth-fw.elf", + "ti-pruss/am64x-sr2-pru1-prueth-fw.elf", + "ti-pruss/am64x-sr2-rtu1-prueth-fw.elf", + "ti-pruss/am64x-sr2-txpru1-prueth-fw.elf"; + ti,prus = <&pru1_0>, <&rtu1_0>, <&tx_pru1_0>, <&pru1_1>, <&rtu1_1>, <&tx_pru1_1>; + ti,pruss-gp-mux-sel = <2>, /* MII mode */ + <2>, + <2>, + <2>, /* MII mode */ + <2>, + <2>; + ti,mii-g-rt = <&icssg1_mii_g_rt>; + ti,mii-rt = <&icssg1_mii_rt>; + ti,iep = <&icssg1_iep0>, <&icssg1_iep1>; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + icssg1_emac0: port@0 { + reg = <0>; + phy-handle = <&icssg1_phy0c>; + phy-mode = "rgmii-id"; + /* Filled in by bootloader */ + local-mac-address = [00 00 00 00 00 00]; + }; + + icssg1_emac1: port@1 { + reg = <1>; + phy-handle = <&icssg1_phy03>; + phy-mode = "rgmii-id"; + /* Filled in by bootloader */ + local-mac-address = [00 00 00 00 00 00]; + }; + }; + }; + fan0: pwm-fan { compatible = "pwm-fan"; pinctrl-names = "default"; @@ -154,6 +216,42 @@ &epwm5 { status = "okay"; }; +&icssg1_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&pru_icssg1_mdio_pins>; + status = "okay"; + + /* phy-mode is fixed up to rgmii-rxid by prueth driver to account for + * the SoC integration, so the only rx-internal-delay and no + * tx-internal-delay is set for the PHYs. + */ + + icssg1_phy03: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x3>; + reset-gpios = <&main_gpio1 47 GPIO_ACTIVE_LOW>; + reset-assert-us = <1000>; + reset-deassert-us = <1000>; + ti,rx-fifo-depth = ; + ti,tx-fifo-depth = ; + ti,rx-internal-delay = ; + ti,clk-output-sel = ; + }; + + icssg1_phy0c: ethernet-phy@c { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0xc>; + reset-gpios = <&main_gpio1 51 GPIO_ACTIVE_LOW>; + reset-assert-us = <1000>; + reset-deassert-us = <1000>; + ti,rx-fifo-depth = ; + ti,tx-fifo-depth = ; + ti,rx-internal-delay = ; + ti,clk-output-sel = ; + }; +}; + + &main_gpio0 { pinctrl-names = "default"; pinctrl-0 = <&main_gpio0_digital_pins>, -- TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider https://www.tq-group.com/ . From: Jiaxin Yu To: , CC: , , , , Jiaxin Yu Subject: [PATCH RESEND,v2] ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode. Date: Mon, 24 Jun 2024 21:55:46 +0800 Message-ID: <20240624135546.19275-1-jiaxin.yu@mediatek.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256940 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail There are two hardware connection methods for DMICs on the MT6358. In cases where more than two DMICs are used, we need to time-multiplex these DMICs. Therefore, we need to dynamically switch the modes of these DMICs based on the actual usage scenarios. ---- DMIC1 AU_VIN0 --- ---- DMIC2 AU_VIN2 --- ----DMIC3 When we want to use DMIC1/2, configure it to one-wire mode. When we want to use DMIC1/3, configure it to two-wire mode. Signed-off-by: Jiaxin Yu --- Changes in v2: - fix potential mixter-text errors, only allowing the user to set it to 0 or 1. sound/soc/codecs/mt6358.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c index 0284e29c11d3..9247b90d1b99 100644 --- a/sound/soc/codecs/mt6358.c +++ b/sound/soc/codecs/mt6358.c @@ -96,7 +96,7 @@ struct mt6358_priv { int wov_enabled; - unsigned int dmic_one_wire_mode; + int dmic_one_wire_mode; }; int mt6358_set_mtkaif_protocol(struct snd_soc_component *cmpnt, @@ -577,6 +577,39 @@ static int mt6358_put_wov(struct snd_kcontrol *kcontrol, return 0; } +static int mt6358_dmic_mode_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol); + struct mt6358_priv *priv = snd_soc_component_get_drvdata(c); + + ucontrol->value.integer.value[0] = priv->dmic_one_wire_mode; + dev_dbg(priv->dev, "%s() dmic_mode = %d", __func__, priv->dmic_one_wire_mode); + + return 0; +} + +static int mt6358_dmic_mode_set(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol); + struct mt6358_priv *priv = snd_soc_component_get_drvdata(c); + int enabled = ucontrol->value.integer.value[0]; + + if (enabled < 0 || enabled > 1) + return -EINVAL; + + if (priv->dmic_one_wire_mode != enabled) { + priv->dmic_one_wire_mode = enabled; + dev_dbg(priv->dev, "%s() dmic_mode = %d", __func__, priv->dmic_one_wire_mode); + + return 1; + } + dev_dbg(priv->dev, "%s() dmic_mode = %d", __func__, priv->dmic_one_wire_mode); + + return 0; +} + static const DECLARE_TLV_DB_SCALE(playback_tlv, -1000, 100, 0); static const DECLARE_TLV_DB_SCALE(pga_tlv, 0, 600, 0); @@ -599,6 +632,9 @@ static const struct snd_kcontrol_new mt6358_snd_controls[] = { SOC_SINGLE_BOOL_EXT("Wake-on-Voice Phase2 Switch", 0, mt6358_get_wov, mt6358_put_wov), + + SOC_SINGLE_BOOL_EXT("Dmic Mode Switch", 0, + mt6358_dmic_mode_get, mt6358_dmic_mode_set), }; /* MUX */ -- 2.25.1 . From: Usama Arif To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, shakeel.butt@linux.dev, david@redhat.com, ying.huang@intel.com, hughd@google.com, willy@infradead.org, yosryahmed@google.com, nphamcs@gmail.com, chengming.zhou@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, Usama Arif Subject: [PATCH v6 0/2] mm: store zero pages to be swapped out in a bitmap Date: Mon, 24 Jun 2024 15:01:27 +0100 Message-ID: <20240624140427.1334871-1-usamaarif642@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256951 org.kvack.linux-mm:201106 Newsgroups: org.kernel.vger.linux-kernel,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail As shown in the patchseries that introduced the zswap same-filled optimization [1], 10-20% of the pages stored in zswap are same-filled. This is also observed across Meta's server fleet. By using VM counters in swap_writepage (not included in this patchseries) it was found that less than 1% of the same-filled pages to be swapped out are non-zero pages. For conventional swap setup (without zswap), rather than reading/writing these pages to flash resulting in increased I/O and flash wear, a bitmap can be used to mark these pages as zero at write time, and the pages can be filled at read time if the bit corresponding to the page is set. When using zswap with swap, this also means that a zswap_entry does not need to be allocated for zero filled pages resulting in memory savings which would offset the memory used for the bitmap. A similar attempt was made earlier in [2] where zswap would only track zero-filled pages instead of same-filled. This patchseries adds zero-filled pages optimization to swap (hence it can be used even if zswap is disabled) and removes the same-filled code from zswap (as only 1% of the same-filled pages are non-zero), simplifying code. This patchseries is based on mm-unstable. [1] https://lore.kernel.org/all/20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1/ [2] https://lore.kernel.org/lkml/20240325235018.2028408-1-yosryahmed@google.com/ --- v5 -> v6 (kernel test robot ): - change bitmap_zalloc/free to kvzalloc/free as a very large swap file will result in the allocation order to exceed MAX_PAGE_ORDER retulting in bitmap_zalloc to fail. v4 -> v5 (Yosry): - Correct comment about using clear_bit instead of bitmp_clear. - Remove clearing the zeromap from swap_cluster_schedule_discard and swap_do_scheduled_discard. v3 -> v4: - remove folio_start/end_writeback when folio is zero filled at swap_writepage (Matthew) - check if a large folio is partially in zeromap and return without folio_mark_uptodate so that an IO error is emitted, rather than checking zswap/disk (Yosry) - clear zeromap in swap_free_cluster (Nhat) v2 -> v3: - Going back to the v1 version of the implementation (David and Shakeel) - convert unatomic bitmap_set/clear to atomic set/clear_bit (Johannes) - use clear_highpage instead of folio_page_zero_fill (Yosry) v1 -> v2: - instead of using a bitmap in swap, clear pte for zero pages and let do_pte_missing handle this page at page fault. (Yosry and Matthew) - Check end of page first when checking if folio is zero filled as it could lead to better performance. (Yosry) Usama Arif (2): mm: store zero pages to be swapped out in a bitmap mm: remove code to handle same filled pages include/linux/swap.h | 1 + mm/page_io.c | 113 ++++++++++++++++++++++++++++++++++++++++++- mm/swapfile.c | 15 ++++++ mm/zswap.c | 86 +++----------------------------- 4 files changed, 136 insertions(+), 79 deletions(-) -- 2.43.0 . From: Zhaoxiong Lv To: dmitry.torokhov@gmail.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.co, dianders@google.com, hsinyi@google.com, jagan@edgeble.ai, neil.armstrong@linaro.org, quic_jesszhan@quicinc.com, dmitry.baryshkov@linaro.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiong Lv Subject: [PATCH v5 0/5] Add kd101ne3-40ti configuration in driver jd9365da Date: Mon, 24 Jun 2024 22:19:21 +0800 Message-Id: <20240624141926.5250-1-lvzhaoxiong@huaqin.corp-partner.google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256958 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This kingdisplay panel uses the jd9365da controller, so add it to panel-jadard-jd9365da-h3.c driver, but because the init_code and timing are different, some variables are added in struct jadard_panel_des to control it. In addition, since sending init_code in the enable() function takes a long time, it is moved to the prepare() function. Changes between V5 and V4: - PATCH 1/5: No changes. - PATCH 2/5: No changes. - PATCH 3/5: New Patch, Switch jd9365da to use mipi_dsi_dcs_write_seq_multi() but no - functional changes. - PATCH 4/5: Add a "_ms" suffix to the variables. - Use more "_multi" in the enable/disable function - Use mipi_dsi_dcs_write_seq_multi() in the init() function. - PATCH 5/5: Use dev_err_probe(). - Link to v4: https://lore.kernel.org/all/20240620080509.18504-1-lvzhaoxiong@huaqin.corp-partner.google.com/ Changes between V4 and V3: - PATCH 1/4: Only move mipi_dsi_dcs_write_buffer from enable() function to prepare() function, - and no longer use mipi_dsi_dcs_write_seq_multi. - PATCH 2/4: Move positions to keep the list sorted. - PATCH 3/4: Use mipi_dsi_msleep. - Adjust the ".clock" assignment format. - Adjust "compatible" positions to keep the list sorted. - PATCH 4/4: No changes. - Link to v3: https://lore.kernel.org/all/20240614145510.22965-1-lvzhaoxiong@huaqin.corp-partner.google.com/ Changes between V3 and V2: - PATCH 1/4: Modify the init_code sending method - PATCH 2/4: Add binding for kingdisplay-kd101ne3 in jadard,jd9365da-h3.yaml - PATCH 3/4: Add compatibility for kingdisplay-kd101ne3 in panel-jadard-jd9365da-h3.c driver, - and add some variables to control timing. - PATCH 4/4: Add the function of adjusting orientation. - Link to v2: https://lore.kernel.org/all/20240601084528.22502-1-lvzhaoxiong@huaqin.corp-partner.google.com/ Changes between V2 and V1: - PATCH 1/4: Delete some unnecessary information. - PATCH 2/4: Use the new mipi_dsi_dcs_write_seq_multi() function, deleted some unnecessary functions. - PATCH 3/4: Add compatible for Starry-er88577. - PATCH 4/4: Add starry panel configuration in panel-kingdisplay-kd101ne3 driver. - Link to v1: https://lore.kernel.org/all/20240418081548.12160-1-lvzhaoxiong@huaqin.corp-partner.google.com/ Zhaoxiong Lv (5): drm/panel: jd9365da: Modify the method of sending commands dt-bindings: display: panel: Add compatible for kingdisplay-kd101ne3 drm/panel: panel-jadard-jd9365da-h3: use wrapped MIPI DCS functions drm/panel: jd9365da: Support for kd101ne3-40ti MIPI-DSI panel drm/panel: jd9365da: Add the function of adjusting orientation .../display/panel/jadard,jd9365da-h3.yaml | 1 + .../gpu/drm/panel/panel-jadard-jd9365da-h3.c | 1088 +++++++++++------ 2 files changed, 682 insertions(+), 407 deletions(-) -- 2.17.1 . From: Mathis Marion To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= , Kylian Balan , Alexander Aring , Mathis Marion Subject: [PATCH v1 0/2] ipv6: always accept routing headers with 0 segments left Date: Mon, 24 Jun 2024 16:15:31 +0200 Message-ID: <20240624141602.206398-1-Mathis.Marion@silabs.com> Content-Transfer-Encoding: base64 Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256978 org.kernel.vger.netdev:354896 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail RnJvbTogTWF0aGlzIE1hcmlvbiA8bWF0aGlzLm1hcmlvbkBzaWxhYnMuY29tPgoKSGVsbG8gbWFp bnRhaW5lcnMsCgpIZXJlIGlzIGEgYml0IG9mIGNvbnRleHQgZm9yIHRoaXMgc2VyaWVzOiBTaWxp Y29uIExhYnMgaXMgd29ya2luZwpvbiBpbXBsZW1lbnRpbmcgYSBXaS1TVU5bMV0gcm91dGluZyBk YWVtb24gZm9yIExpbnV4WzJdLiBXaS1TVU4gdXNlcwpSUExbM10gZm9yIHJvdXRpbmcsIHdoaWNo IHVzZXMgYSBzcGVjaWFsaXplZCBJUHY2IHJvdXRpbmcgaGVhZGVyWzRdLApzdXBwb3J0ZWQgYnkg YSBrZXJuZWwgbW9kdWxlWzVdLiBDdXJyZW50bHksIG91ciBib3JkZXIgcm91dGVyIGRhZW1vbgpk b2VzIG5vdCByZWx5IG9uIHRoYXQga2VybmVsIG1vZHVsZSBhbmQgaW5zdGVhZCBpbnNlcnRzIHRo ZSBTb3VyY2UKUm91dGluZyBIZWFkZXIgKFNSSCkgaW4gdXNlcnNwYWNlIGFmdGVyIHJlYWRpbmcg dGhlIElQdjYgcGFja2V0IGZyb20gYQpUVU4gZGV2aWNlLgoKRnV0dXJlIGRldmVsb3BtZW50IGlz IG5vdyBnZWFyZWQgdG93YXJkcyBhIHJvdXRlciBpbXBsZW1lbnRhdGlvbiAoYXMKb3Bwb3NlZCB0 byBhIGJvcmRlciByb3V0ZXIpLCB3aGljaCBkb2VzIG5vdCBpbnNlcnQgdGhlIFNSSCBidXQgaW5z dGVhZApwcm9jZXNzZXMgaXQuIFRoZSBmaXJzdCBzdGVwIHdhcyB0byBpbXBsZW1lbnQgYSBsZWFm IG5vZGUsIHdoaWNoIGFsd2F5cwpyZWNlaXZlIGEgU1JIIHdpdGggMCBzZWdtZW50cyBsZWZ0LiBF dmVuIHdpdGhvdXQgaGF2aW5nIHRoZSBSUEwga2VybmVsCm1vZHVsZSBlbmFibGVkLCBJIHdhcyBl eHBlY3RpbmcgdGhlIGtlcm5lbCB0byBwcm9wZXJseSByZWNlaXZlIHRoZXNlCnBhY2tldHMsIGJ1 dCB0aGV5IHdlcmUgaW5zdGVhZCBiZWluZyBkcm9wcGVkLiBMb29raW5nIGF0IHRoZSBrZXJuZWwK Y29kZSwgaXQgc2VlbXMgdGhhdCB0aGUgU1JIIHdvdWxkIGhhdmUgYmVlbiBhY2NlcHRlZCBiZWZv cmUKODYxMGM3YzZlM2JkICgibmV0OiBpcHY2OiBhZGQgc3VwcG9ydCBmb3IgcnBsIHNyIGV4dGhk ciIpLgoKWzFdOiBodHRwczovL3dpLXN1bi5vcmcvClsyXTogaHR0cHM6Ly9naXRodWIuY29tL1Np bGljb25MYWJzL3dpc3VuLWJyLWxpbnV4ClszXTogaHR0cHM6Ly93d3cucmZjLWVkaXRvci5vcmcv cmZjL3JmYzY1NTAuaHRtbApbNF06IGh0dHBzOi8vd3d3LnJmYy1lZGl0b3Iub3JnL3JmYy9yZmM2 NTU0Lmh0bWwKWzVdOiBodHRwczovL2VsaXhpci5ib290bGluLmNvbS9saW51eC92Ni45L3NvdXJj ZS9uZXQvaXB2Ni9LY29uZmlnI0wzMjIKCk1hdGhpcyBNYXJpb24gKDIpOgogIGlwdjY6IGludHJv ZHVjZSBpcHY2X3J0aGRyX3Jjdl9sYXN0KCkKICBpcHY2OiBhbHdheXMgYWNjZXB0IHJvdXRpbmcg aGVhZGVycyB3aXRoIDAgc2VnbWVudHMgbGVmdAoKIG5ldC9pcHY2L2V4dGhkcnMuYyB8IDEyNCAr KysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFu Z2VkLCA0OCBpbnNlcnRpb25zKCspLCA3NiBkZWxldGlvbnMoLSkKCi0tIAoyLjQzLjAKCg== . From: Dmitry Baryshkov Subject: [PATCH v9 0/2] usb: typec: ucsi: enable Lenovo Yoga C630 EC Date: Mon, 24 Jun 2024 18:08:11 +0300 Message-Id: <20240624-ucsi-yoga-ec-driver-v9-0-53af411a9bd6@linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Bjorn Andersson , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Bryan O'Donoghue , Heikki Krogerus , Greg Kroah-Hartman , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nikita Travkin Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257038 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-usb,org.kernel.vger.platform-driver-x86 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add driver for the UCSI on the Lenovo Yoga C630 laptop, as implemented by the Embedded Controlller of the laptop. Support for this EC was implemented by Bjorn, who later could not work on this driver. I've picked this patchset up and updated it following the pending review comments. NOTE: Ilpo, the first patch is required to fix test builds for the Yoga C630 UCSI driver. run by Greg Kroah-Hartman. Could you please either ack Greg to merge the patch to his tree or pick it to the immutable branch to be submerged by Greg. NOTE: the patch depends on the header from the platform driver. Ilpo Järvinen has created an immutable branch based on v6.10-rc1, please pull it before merging the patches: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git tags/platform-drivers-x86-ib-lenovo-c630-v6.11 platform: arm64: add Lenovo Yoga C630 WOS EC driver (2024-06-14 12:51:30 +0300) ---------------------------------------------------------------- Immutable branch between pdx86 lenovo c630 branch, power/supply and USB subsystems due for the v6.11 merge window. platform-drivers-x86-ib-lenovo-c630-v6.11: v6.10-rc1 + platform-drivers-x86-lenovo-c630 for merging into the power/supply and USB subsystems for v6.11. ---------------------------------------------------------------- --- Changes in v9: - Fixed modular builds of platforms/arm64 on non-ARM64 platforms (Greg) - Link to v8: https://lore.kernel.org/r/20240621-ucsi-yoga-ec-driver-v8-1-e03f3536b8c6@linaro.org Changes in v8: - Split to a separate USB-related series - Mention the immutable branch. - Link to v7: https://lore.kernel.org/r/20240614-yoga-ec-driver-v7-0-9f0b9b40ae76@linaro.org Changes in v7: - In PSY driver use guard() instead of scoped_guard() (Ilpo) - Use switch/case rather than ifs in yoga_c630_ucsi_read() (Ilpo) - Link to v6: https://lore.kernel.org/r/20240612-yoga-ec-driver-v6-0-8e76ba060439@linaro.org Changes in v6: - Use guard() instead of scoped_guard() (Ilpo) - Add a define for UCSI version register (Ilpo) - Added a check to prevent overflowing the address in reg16 read (Ilpo) - Link to v5: https://lore.kernel.org/r/20240607-yoga-ec-driver-v5-0-1ac91a0b4326@linaro.org Changes in v5: - Added missing article in the commit message (Bryan) - Changed yoga_c630_ec_ucsi_get_version() to explicitly set the register instead of just incrementing it (Bryan) - Dropped spurious debugging pr_info (Bryan) - Added missing includes all over the place (Ilpo) - Switched to scoped_guard() where it's suitable (Ilpo) - Defined register bits (Ilpo, Bryan) - Whitespace cleanup (Ilpo, Bryan) - Reworked yoga_c630_ucsi_notify() to use switch-case (Bryan) - Use ternary operators instead of if()s (Ilpo) - Switched power supply driver to use fwnode (Sebastian) - Fixed handling of the adapter's type vs usb_type (Sebastian) - Added SCOPE property to the battery (Sebastian) - Link to v4: https://lore.kernel.org/r/20240528-yoga-ec-driver-v4-0-4fa8dfaae7b6@linaro.org Changes in v4: - Moved bindings to platform/ to follow example of other Acer Aspire1 EC (Nikita Travkin) - Fixed dt validation for EC interrupt pin (Rob Herring) - Dropped separate 'scale' property (Oliver Neukum) - Link to v3: https://lore.kernel.org/r/20240527-yoga-ec-driver-v3-0-327a9851dad5@linaro.org Changes in v3: - Split the driver into core and power supply drivers, - Added UCSI driver part, handling USB connections, - Fixed Bjorn's address in DT bindings (Brian Masney) - Changed power-role for both ports to be "dual" per UCSI - Link to v2: https://lore.kernel.org/linux-arm-msm/20230205152809.2233436-1-dmitry.baryshkov@linaro.org/ Changes in v2: - Dropped DP support for now, as the bindings are in process of being discussed separately, - Merged dt patch into the same patchseries, - Removed the fixed serial number battery property, - Fixed indentation of dt bindings example, - Added property: reg and unevaluatedProperties to the connector bindings. - Link to v1: https://lore.kernel.org/linux-arm-msm/20220810035424.2796777-1-bjorn.andersson@linaro.org/ --- Dmitry Baryshkov (2): platform/arm64: build drivers even on non-ARM64 platforms usb: typec: ucsi: add Lenovo Yoga C630 glue driver drivers/platform/Makefile | 2 +- drivers/usb/typec/ucsi/Kconfig | 9 ++ drivers/usb/typec/ucsi/Makefile | 1 + drivers/usb/typec/ucsi/ucsi_yoga_c630.c | 204 ++++++++++++++++++++++++++++++++ 4 files changed, 215 insertions(+), 1 deletion(-) --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240527-ucsi-yoga-ec-driver-76fd7f5ddae8 Best regards, -- Dmitry Baryshkov . From: Wu Hoi Pok To: Cc: Thomas Zimmermann , Wu Hoi Pok , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/7] drm/radeon: remove load callback Date: Mon, 24 Jun 2024 11:10:44 -0400 Message-ID: <20240624151122.23724-1-wuhoipok@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257042 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Changes between v1 and v3: 1. add "ddev->dev_private = rdev;" 2. include a cover letter Wu Hoi Pok (7): drm/radeon: remove load callback drm/radeon: rdev->ddev to rdev_to_drm(rdev) 1 drm/radeon: rdev->ddev to rdev_to_drm(rdev) 2 drm/radeon: rdev->ddev to rdev_to_drm(rdev) 3 drm/radeon: rdev->ddev to rdev_to_drm(rdev) 4 drm/radeon: rdev->ddev to rdev_to_drm(rdev) 5 drm/radeon: rdev->ddev to rdev_to_drm(rdev) 6 drivers/gpu/drm/radeon/atombios_encoders.c | 2 +- drivers/gpu/drm/radeon/cik.c | 14 ++-- drivers/gpu/drm/radeon/dce6_afmt.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 12 ++-- drivers/gpu/drm/radeon/ni.c | 2 +- drivers/gpu/drm/radeon/r100.c | 24 +++---- drivers/gpu/drm/radeon/r300.c | 6 +- drivers/gpu/drm/radeon/r420.c | 6 +- drivers/gpu/drm/radeon/r520.c | 2 +- drivers/gpu/drm/radeon/r600.c | 12 ++-- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 4 +- drivers/gpu/drm/radeon/r600_hdmi.c | 2 +- drivers/gpu/drm/radeon/radeon.h | 11 +++- drivers/gpu/drm/radeon/radeon_acpi.c | 10 +-- drivers/gpu/drm/radeon/radeon_agp.c | 2 +- drivers/gpu/drm/radeon/radeon_atombios.c | 2 +- drivers/gpu/drm/radeon/radeon_audio.c | 4 +- drivers/gpu/drm/radeon/radeon_combios.c | 12 ++-- drivers/gpu/drm/radeon/radeon_device.c | 19 ++---- drivers/gpu/drm/radeon/radeon_display.c | 74 +++++++++++----------- drivers/gpu/drm/radeon/radeon_drv.c | 27 +++++--- drivers/gpu/drm/radeon/radeon_drv.h | 1 - drivers/gpu/drm/radeon/radeon_fbdev.c | 26 ++++---- drivers/gpu/drm/radeon/radeon_fence.c | 8 +-- drivers/gpu/drm/radeon/radeon_gem.c | 2 +- drivers/gpu/drm/radeon/radeon_i2c.c | 2 +- drivers/gpu/drm/radeon/radeon_ib.c | 2 +- drivers/gpu/drm/radeon/radeon_irq_kms.c | 12 ++-- drivers/gpu/drm/radeon/radeon_kms.c | 18 ++---- drivers/gpu/drm/radeon/radeon_object.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 20 +++--- drivers/gpu/drm/radeon/radeon_ring.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 6 +- drivers/gpu/drm/radeon/rs400.c | 6 +- drivers/gpu/drm/radeon/rs600.c | 14 ++-- drivers/gpu/drm/radeon/rs690.c | 2 +- drivers/gpu/drm/radeon/rv515.c | 4 +- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 4 +- 40 files changed, 193 insertions(+), 191 deletions(-) -- 2.45.2 . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 08:26:20 -0700 Message-ID: <0000000000003c9f54061ba467b9@google.com> Subject: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in __sock_queue_rcv_skb From: syzbot To: johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, luiz.dentz@gmail.com, marcel@holtmann.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257062 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-bluetooth Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: 96e09b8f8166 Merge tag 'platform-drivers-x86-v6.10-3' of g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=143e77ba980000 kernel config: https://syzkaller.appspot.com/x/.config?x=96fd46a1ee1615e0 dashboard link: https://syzkaller.appspot.com/bug?extid=88fd97e5fd010b9cd053 compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 userspace arch: i386 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7bc7510fe41f/non_bootable_disk-96e09b8f.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/d2bf80e54d1f/vmlinux-96e09b8f.xz kernel image: https://storage.googleapis.com/syzbot-assets/b81837ec8c21/bzImage-96e09b8f.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+88fd97e5fd010b9cd053@syzkaller.appspotmail.com Bluetooth: hci5: Opcode 0x1003 failed: -110 ================================================================== BUG: KASAN: slab-use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 Read of size 4 at addr ffff888029af3104 by task kworker/u33:3/5232 CPU: 0 PID: 5232 Comm: kworker/u33:3 Not tainted 6.10.0-rc2-syzkaller-00269-g96e09b8f8166 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Workqueue: hci3 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock+0x271/0x2c0 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 __sock_queue_rcv_skb+0x377/0xa80 net/core/sock.c:504 l2cap_sock_recv_cb+0xfa/0x3d0 net/bluetooth/l2cap_sock.c:1507 l2cap_conless_channel net/bluetooth/l2cap_core.c:6780 [inline] l2cap_recv_frame+0x20d0/0xa080 net/bluetooth/l2cap_core.c:6833 l2cap_recv_acldata+0x9ac/0xb60 net/bluetooth/l2cap_core.c:7516 hci_acldata_packet net/bluetooth/hci_core.c:3842 [inline] hci_rx_work+0xaa7/0x1610 net/bluetooth/hci_core.c:4079 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 7577: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4121 [inline] __kmalloc_noprof+0x1ec/0x420 mm/slub.c:4134 kmalloc_noprof include/linux/slab.h:664 [inline] sk_prot_alloc+0x1a8/0x2a0 net/core/sock.c:2080 sk_alloc+0x36/0xb90 net/core/sock.c:2133 bt_sock_alloc+0x3b/0x3a0 net/bluetooth/af_bluetooth.c:148 l2cap_sock_alloc.constprop.0+0x35/0x180 net/bluetooth/l2cap_sock.c:1869 l2cap_sock_create+0x123/0x1f0 net/bluetooth/l2cap_sock.c:1909 bt_sock_create+0x182/0x350 net/bluetooth/af_bluetooth.c:132 __sock_create+0x32e/0x800 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socket_create net/socket.c:1659 [inline] __sys_socket+0x14f/0x260 net/socket.c:1706 __do_sys_socket net/socket.c:1720 [inline] __se_sys_socket net/socket.c:1718 [inline] __ia32_sys_socket+0x72/0xb0 net/socket.c:1718 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 7576: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kfree+0x12a/0x3b0 mm/slub.c:4557 sk_prot_free net/core/sock.c:2116 [inline] __sk_destruct+0x5d8/0x730 net/core/sock.c:2208 sk_destruct+0xc2/0xf0 net/core/sock.c:2223 __sk_free+0xf4/0x3e0 net/core/sock.c:2234 sk_free+0x7c/0xa0 net/core/sock.c:2245 sock_put include/net/sock.h:1879 [inline] l2cap_sock_kill net/bluetooth/l2cap_sock.c:1246 [inline] l2cap_sock_kill+0x22f/0x270 net/bluetooth/l2cap_sock.c:1235 l2cap_sock_release+0x189/0x210 net/bluetooth/l2cap_sock.c:1417 __sock_release+0xb0/0x270 net/socket.c:659 sock_close+0x1c/0x30 net/socket.c:1421 __fput+0x408/0xbb0 fs/file_table.c:422 __fput_sync+0x47/0x50 fs/file_table.c:507 __do_sys_close fs/open.c:1555 [inline] __se_sys_close fs/open.c:1540 [inline] __ia32_sys_close+0x86/0x100 fs/open.c:1540 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888029af3000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 260 bytes inside of freed 2048-byte region [ffff888029af3000, ffff888029af3800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29af0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888015442f00 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000080008 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888015442f00 dead000000000100 dead000000000122 head: 0000000000000000 0000000000080008 00000001ffffefff 0000000000000000 head: 00fff00000000003 ffffea0000a6bc01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4916, tgid 4916 (dhcpcd), ts 29721812125, free_ts 29702960673 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2df0 mm/page_alloc.c:3402 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4660 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2264 allocate_slab mm/slub.c:2427 [inline] new_slab+0x84/0x260 mm/slub.c:2480 ___slab_alloc+0xdac/0x1870 mm/slub.c:3666 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3756 __slab_alloc_node mm/slub.c:3809 [inline] slab_alloc_node mm/slub.c:3988 [inline] kmalloc_trace_noprof+0x2c5/0x310 mm/slub.c:4147 kmalloc_noprof include/linux/slab.h:660 [inline] rtnl_newlink+0x49/0xa0 net/core/rtnetlink.c:3739 rtnetlink_rcv_msg+0x3c7/0xea0 net/core/rtnetlink.c:6635 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x9b4/0xb50 net/socket.c:2585 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2639 __sys_sendmsg+0x117/0x1f0 net/socket.c:2668 page last free pid 5022 tgid 5022 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2565 __put_partials+0x14c/0x170 mm/slub.c:2994 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4007 getname_flags.part.0+0x50/0x4f0 fs/namei.c:139 getname_flags include/linux/audit.h:322 [inline] getname+0x8f/0xe0 fs/namei.c:218 do_sys_openat2+0x104/0x1e0 fs/open.c:1399 do_sys_open fs/open.c:1420 [inline] __do_sys_openat fs/open.c:1436 [inline] __se_sys_openat fs/open.c:1431 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1431 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888029af3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888029af3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888029af3100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888029af3180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888029af3200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . From: Sebastian Andrzej Siewior To: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Daniel Bristot de Oliveira , Frederic Weisbecker , Ian Rogers , Ingo Molnar , Jiri Olsa , Kan Liang , Marco Elver , Mark Rutland , Namhyung Kim , Peter Zijlstra , Thomas Gleixner Subject: [PATCH v4 0/6] perf: Make SIGTRAP and __perf_pending_irq() work on RT. Date: Mon, 24 Jun 2024 17:15:13 +0200 Message-ID: <20240624152732.1231678-1-bigeasy@linutronix.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257066 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi, Arnaldo reported that "perf test sigtrap" fails on PREEMPT_RT. Sending the signal gets delayed until event_sched_out() which then uses task_work_add() for its delivery. This breaks on PREEMPT_RT because the signal is delivered with disabled preemption. While looking at this, I also stumbled upon __perf_pending_irq() which requires disabled interrupts but this is not the case on PREEMPT_RT. This series aim to address both issues while not introducing a new issue at the same time ;) Any testing is appreciated. v3=E2=80=A6v4: https://lore.kernel.org/all/20240322065208.60456-1-bigeasy@l= inutronix.de/ - Rebased on top of Frederic's series (https://lore.kernel.org/all/20240621091601.18227-1-frederic@kernel.o= rg) - Frederick pointed out that perf_pending_task() needs to perf_swevent_get_recursion_context() in order not to recurse if something within perf_swevent_.*_recursion_context() triggers a software event. To address this, the counters have been moved to the task_struct (#3 + #4) and preemt_disable() has been replaced with a RCU-read lock (#5). - The remaning logic same that means the event is pushed to task-work instead of delivering from IRQ-work. The series was tested with remove_on_exec as suggested by Marco Elver: On PREEMPT_RT a single invocation passes, 100 parallel invocations report (for some) unexpected SIGTRAPs and timeouts. This also observed on !RT (without the series) with a higher task-count. v2=E2=80=A6v3: https://lore.kernel.org/all/20240312180814.3373778-1-bigeasy= @linutronix.de/ - Marco suggested to add a few comments - Added a comment to __perf_event_overflow() to explain why irq_work is raised in the in_nmi() case. - Added a comment to perf_event_exit_event() to explain why the pending event is deleted. v1=E2=80=A6v2: https://lore.kernel.org/all/20240308175810.2894694-1-bigeasy= @linutronix.de/ - Marco pointed me to the testsuite that showed two problems: - Delayed task_work from NMI / missing events. Fixed by triggering dummy irq_work to enforce an interrupt for the exit-to-userland path which checks task_work - Increased ref-count on clean up/ during exec. Mostly addressed by the former change. There is still a window if the NMI occurs during execve(). This is addressed by removing the task_work before free_event(). The testsuite (remove_on_exec) fails sometimes if the event/ SIGTRAP is sent before the sighandler is installed. Sebastian . From: Javier Carrasco Date: Mon, 24 Jun 2024 17:30:50 +0200 Subject: [PATCH] backlight: lm3509_bl: Fix early returns in for_each_child_of_node() X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-lm3509_bl_scoped-v1-1-ceba9df38f23@gmail.com> To: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot , Julia Lawall , Javier Carrasco Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257076 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-fbdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The for_each_child_of_node() macro automatically decrements the child refcount at the end of every iteration. On early exits, of_node_put() must be used to manually decrement the refcount and avoid memory leaks. The scoped version of the macro accounts for such early breaks, fixing the early exits without the need for explicit calls to of_node_put(). Reported-by: kernel test robot Reported-by: Julia Lawall Closes: https://lore.kernel.org/r/202406172314.2vVgelaS-lkp@intel.com/ Fixes: b72755f5b577 ("backlight: Add new lm3509 backlight driver") Signed-off-by: Javier Carrasco --- drivers/video/backlight/lm3509_bl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/backlight/lm3509_bl.c b/drivers/video/backlight/lm3509_bl.c index c93cdedff5ad..7a36f5c08640 100644 --- a/drivers/video/backlight/lm3509_bl.c +++ b/drivers/video/backlight/lm3509_bl.c @@ -157,10 +157,9 @@ static int lm3509_parse_led_sources(struct device_node *node, static int lm3509_parse_dt_node(struct device *dev, struct lm3509_bl_led_data *led_data) { - struct device_node *child; int seen_led_sources = 0; - for_each_child_of_node(dev->of_node, child) { + for_each_child_of_node_scoped(dev->of_node, child) { struct lm3509_bl_led_data *ld; int ret; u32 reg; --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240624-lm3509_bl_scoped-75983f702aed Best regards, -- Javier Carrasco . From: Prabhakar To: Ulf Hansson , Wolfram Sang , Geert Uytterhoeven , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm , linux-mmc@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v3 0/3] Add SD/MMC support for Renesas RZ/V2H(P) SoC Date: Mon, 24 Jun 2024 16:32:26 +0100 Message-Id: <20240624153229.68882-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257077 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-mmc,org.kernel.vger.linux-renesas-soc Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Lad Prabhakar Hi All, This patch series aims to add SD/MMC support for Renesas RZ/V2H(P) SoC. Below is the sample usage of using internal regulator: SoC DTSI node: sdhi1: mmc@15c10000 { compatible = "renesas,sdhi-r9a09g057"; reg = <0x0 0x15c10000 0 0x10000>; interrupts = , ; clocks = <&cpg CPG_MOD 167>, <&cpg CPG_MOD 169>, <&cpg CPG_MOD 168>, <&cpg CPG_MOD 170>; clock-names = "core", "clkh", "cd", "aclk"; resets = <&cpg 168>; power-domains = <&cpg>; status = "disabled"; vqmmc_sdhi1: vqmmc-regulator { regulator-compatible = "vqmmc-r9a09g057-regulator"; regulator-name = "sdhi1-vqmmc-regulator"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>; status = "disabled"; }; }; * Example of SDHI1 while using internal regulator: ** Board DTS: &sdhi1 { pinctrl-0 = <&sdhi1_pins>; pinctrl-1 = <&sdhi1_pins>; pinctrl-names = "default", "state_uhs"; renesas,sdhi-use-internal-regulator; vmmc-supply = <®_3p3v>; vqmmc-supply = <&vqmmc_sdhi1>; bus-width = <4>; sd-uhs-sdr50; sd-uhs-sdr104; status = "okay"; }; &vqmmc_sdhi1 { status = "okay"; }; * Example of SDHI1 while using GPIO regulator while internal regulator is present: ** Board DTS: vccq_sdhi1: regulator-vccq-sdhi1 { compatible = "regulator-gpio"; regulator-name = "SDHI1 VccQ"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>; gpios = <&pinctrl RZG2L_GPIO(10, 2) GPIO_ACTIVE_HIGH>; gpios-states = <0>; states = <3300000 0>, <1800000 1>; }; &sdhi1 { pinctrl-0 = <&sdhi1_pins>; pinctrl-1 = <&sdhi1_pins>; pinctrl-names = "default", "state_uhs"; vmmc-supply = <®_3p3v>; vqmmc-supply = <&vccq_sdhi1>; bus-width = <4>; sd-uhs-sdr50; sd-uhs-sdr104; status = "okay"; }; v2->v3 - Renamed vqmmc-r9a09g057-regulator object to vqmmc-regulator - Added regulator-compatible property for vqmmc-regulator - Added 'renesas,sdhi-use-internal-regulator' DT property - Included RB tags for patch 2/3 - Moved regulator info to renesas_sdhi_of_data instead of quirks - Added support to configure the init state of regulator - Added function pointers to configure regulator - Added REGULATOR_CHANGE_VOLTAGE mask v1->v2 - Dropped regulator core API changes - Updated DT binding - Now controlling PWEN bit via regultor api v1: https://patchwork.kernel.org/project/linux-renesas-soc/cover/20240605074936.578687-1-prabhakar.mahadev-lad.rj@bp.renesas.com/ Cheers, Prabhakar Lad Prabhakar (3): dt-bindings: mmc: renesas,sdhi: Document RZ/V2H(P) support mmc: tmio: Use MMC core APIs to control the vqmmc regulator mmc: renesas_sdhi: Add support for RZ/V2H(P) SoC .../devicetree/bindings/mmc/renesas,sdhi.yaml | 30 +++- drivers/mmc/host/renesas_sdhi.h | 13 ++ drivers/mmc/host/renesas_sdhi_core.c | 93 +++++++++++ drivers/mmc/host/renesas_sdhi_internal_dmac.c | 150 ++++++++++++++++++ drivers/mmc/host/tmio_mmc.h | 5 + drivers/mmc/host/tmio_mmc_core.c | 7 +- 6 files changed, 293 insertions(+), 5 deletions(-) -- 2.34.1 . Date: Mon, 24 Jun 2024 16:41:41 +0100 From: Mark Brown To: Rob Clark , Sean Paul Cc: Bartosz Golaszewski , Bjorn Andersson , Connor Abbott , Linux Kernel Mailing List , Linux Next Mailing List , Rob Clark Subject: linux-next: manual merge of the drm-msm tree with the qcom tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tF+rPnmXMmmPiY27" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257086 org.kernel.vger.linux-next:61909 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --tF+rPnmXMmmPiY27 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the drm-msm tree got a conflict in: include/linux/firmware/qcom/qcom_scm.h between commits: 158ed777e330e ("firmware: qcom: scm: Add gpu_init_regs call") 178e19c0df1b1 ("firmware: qcom: scm: add support for SHM bridge operation= s") =66rom the qcom tree and commit: 90c3e2bc9ecbf ("firmware: qcom_scm: Add gpu_init_regs call") =66rom the drm-msm tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --cc include/linux/firmware/qcom/qcom_scm.h index 9f14976399ab8,a221a643dc12a..0000000000000 --- a/include/linux/firmware/qcom/qcom_scm.h +++ b/include/linux/firmware/qcom/qcom_scm.h --tF+rPnmXMmmPiY27 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5k7QACgkQJNaLcl1U h9DtZgf+JWDavVOeEGi+W3qXnBC4EOr8J0+Gg1g/JMLxXDHBFNOBKSAGt3q+EKqH zqCTV9nCyAc7Nd4SNVB1L1aO4iWu6CKvETAHlou+Et0oKLV/IwB3hbArAoTcLMs3 Tx/JP5lDMKFW8GPFD/Y/Sg4igRVbPOPWEYiY8IULxt8REJHHzyaN7Ry1hKhiSg5A zpzLi2lhCwb4b5fpK8Y0hAnsnimvTj7d84YxJzjMRoCsFhRRLcRIx6Zfzx7hU1i9 nou9zDIIHOBPeXzsEYYETkmEguS9BNbdaafB2e1HAIg0jZnfI6r2h/jPybdw8W2x iulizHUxtdfdJ4hPEoy33USJZyoIEw== =JN2W -----END PGP SIGNATURE----- --tF+rPnmXMmmPiY27-- . From: Leon Romanovsky To: Jason Gunthorpe Cc: Leon Romanovsky , Ajay Sharma , Akiva Goldberger , Bernard Metzler , Chengchang Tang , Cheng Xu , Dennis Dalessandro , Junxian Huang , Kai Shen , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Long Li , Michael Margolin , Mustafa Ismail , Potnuri Bharat Teja , Selvin Xavier , Shiraz Saleem , Yishai Hadas , Zhu Yanjun Subject: [PATCH rdma-next v1 0/2] Extend mlx5 CQ creation with large UAR page index Date: Mon, 24 Jun 2024 19:00:09 +0300 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257103 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-rdma Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Leon Romanovsky Changelog: v1: * Fixed compilation errors in first patch * Changed new attribute name as Jason suggested v0: https://lore.kernel.org/all/cover.1718554263.git.leon@kernel.org/ ------------------------------------------------------------------------ Hi, This series from Akiva extends the mlx5 private field with the UAR page index which is larger than 16 bits as was before. As this is first time, we extend ioctl API with private data field after it already has UHW object, we need to change create CQ API signature to support it. Thanks Akiva Goldberger (2): RDMA: Pass entire uverbs attr bundle to create cq function RDMA/mlx5: Send UAR page index as ioctl attribute drivers/infiniband/core/uverbs_cmd.c | 2 +- drivers/infiniband/core/uverbs_std_types_cq.c | 2 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 3 +- drivers/infiniband/hw/bnxt_re/ib_verbs.h | 2 +- drivers/infiniband/hw/cxgb4/cq.c | 3 +- drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 2 +- drivers/infiniband/hw/efa/efa.h | 2 +- drivers/infiniband/hw/efa/efa_verbs.c | 3 +- drivers/infiniband/hw/erdma/erdma_verbs.c | 3 +- drivers/infiniband/hw/erdma/erdma_verbs.h | 2 +- drivers/infiniband/hw/hns/hns_roce_cq.c | 3 +- drivers/infiniband/hw/hns/hns_roce_device.h | 2 +- drivers/infiniband/hw/irdma/verbs.c | 5 +-- drivers/infiniband/hw/mana/cq.c | 3 +- drivers/infiniband/hw/mana/mana_ib.h | 2 +- drivers/infiniband/hw/mlx4/cq.c | 3 +- drivers/infiniband/hw/mlx4/mlx4_ib.h | 2 +- drivers/infiniband/hw/mlx5/cq.c | 31 ++++++++++++++++--- drivers/infiniband/hw/mlx5/main.c | 1 + drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 +- drivers/infiniband/hw/mthca/mthca_provider.c | 3 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 3 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.h | 2 +- drivers/infiniband/sw/rdmavt/cq.c | 6 ++-- drivers/infiniband/sw/rdmavt/cq.h | 2 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 3 +- drivers/infiniband/sw/siw/siw_verbs.c | 5 +-- drivers/infiniband/sw/siw/siw_verbs.h | 2 +- include/rdma/ib_verbs.h | 2 +- include/uapi/rdma/ib_user_ioctl_cmds.h | 7 ++--- include/uapi/rdma/mlx5_user_ioctl_cmds.h | 4 +++ 31 files changed, 80 insertions(+), 38 deletions(-) -- 2.45.2 . From: Jeff Johnson Date: Mon, 24 Jun 2024 09:09:48 -0700 Subject: [PATCH v2] mailbox: mtk-cmdq: add missing MODULE_DESCRIPTION() macro X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240624-md-drivers-mailbox-v2-1-e5a428d52224@quicinc.com> To: Jassi Brar , Matthias Brugger , AngeloGioacchino Del Regno CC: , , , , "Jeff Johnson" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257107 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.kernel-janitors Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/mailbox/mtk-cmdq-mailbox.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Jeff Johnson --- Changes in v2: - Updated description per AngeloGioacchino Del Regno and propaged the Reviewed-by tag - Link to v1: https://lore.kernel.org/r/20240608-md-drivers-mailbox-v1-1-6ce5d6f924ad@quicinc.com --- drivers/mailbox/mtk-cmdq-mailbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index 4aa394e91109..71eb78c3d6ce 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -790,4 +790,5 @@ static void __exit cmdq_drv_exit(void) subsys_initcall(cmdq_drv_init); module_exit(cmdq_drv_exit); +MODULE_DESCRIPTION("Mediatek Command Queue(CMDQ) Mailbox driver"); MODULE_LICENSE("GPL v2"); --- base-commit: 19ca0d8a433ff37018f9429f7e7739e9f3d3d2b4 change-id: 20240608-md-drivers-mailbox-3cd31fdfc4b6 . From: Srinivas Pandruvada To: rafael@kernel.org, viresh.kumar@linaro.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Srinivas Pandruvada Subject: [PATCH v2 0/2] Update highest frequency of a CPU after boot Date: Mon, 24 Jun 2024 09:11:07 -0700 Message-ID: <20240624161109.1427640-1-srinivas.pandruvada@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257108 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Intel Xeon servers, which are capable of dynamic highest performance change, are unable to achieve the highest frequency when the performance profile is changed. The highest frequency at which a CPU can operate is not fixed and can vary after the system boots. These changes can be initiated by switching to different performance profiles using the Intel Speed Select Technology interface. Additionally, adjustments can be made remotely through a BMC (Baseboard Management Controller) interface. Administrators can select various performance profiles to align with specific performance requirements, as these choices will directly influence the total power consumption and cooling requirements. Whenever an administrator switches to a different performance profile that alters the highest frequency, the hardware sends an interrupt and update the new highest frequency at which the system can operate. This interrupt can be enabled via the MSR_HWP_INTERRUPT register, and only if support is indicated by the CPUID[6].EAX[15] = 1. To enable changes to the highest frequency, add a CPU features flag and enable the HWP (Hardware P-states) highest performance change interrupt when it is supported by the CPU. v2: - Prevent display in /proc/cpuinfo flags - Use cpu_feature_enabled() instead of boot_cpu_has() Srinivas Pandruvada (2): x86/cpufeatures: Add HWP highest perf change feature flag cpufreq: intel_pstate: Support highest performance change interrupt arch/x86/include/asm/cpufeatures.h | 1 + drivers/cpufreq/intel_pstate.c | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) -- 2.40.1 . Date: Mon, 24 Jun 2024 17:20:05 +0100 From: Mark Brown To: Dmitry Baryshkov Cc: Linux Kernel Mailing List , Linux Next Mailing List , Maxime Ripard Subject: linux-next: build failure after merge of the drm-msm-lumag tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OzhFpMnD5U+YYOyJ" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257122 org.kernel.vger.linux-next:61910 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --OzhFpMnD5U+YYOyJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, After merging the drm-msm-lumag tree, today's linux-next build (x86_64 allmodconfig) failed like this: ERROR: modpost: too long symbol "drm_atomic_helper_connector_hdmi_disable_audio_infoframe" [drivers/gpu/drm/msm/msm.ko] Caused by commit 000d1940c90984 ("drm/connector: hdmi: allow disabling Audio Infoframe") I used the version from 20240621 instead. --OzhFpMnD5U+YYOyJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5nLQACgkQJNaLcl1U h9Dyhwf/aE00dFlj/i85JoOZOI+HoeBOECCZ86tvhBvKOXwkqPXK0RJ/pda3pQTZ 9pmQsEalJvLRMcIpAIIfQgWA6dd53MUesshXZwnlMxSRDszMxXFuwCTRpNdOmcTH qCOZREc5QaHaiaF6ABDKK+f6JVmOuoYk6ZljTDkhDazce4hOJIyWYgtC8si8MS4s K6HAX0wKNoVCIjeVD4YE2NT9RWsEbZZTlmNZQ3VTxxuMngPXTI81fr12H/F9W3C5 AxQ0AtSGILqB/zbDicMsGZeo2rtG/nmbixeIh5PC5jUo2gn5BpZ3l7+/2yHNZZkx avod9t5pp6hTvZBrPOQNJ8hn+qoOFQ== =Bkdn -----END PGP SIGNATURE----- --OzhFpMnD5U+YYOyJ-- . From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Mon, 24 Jun 2024 19:22:10 +0300 (EEST) To: Dmitry Baryshkov , Sebastian Reichel , Heikki Krogerus , Greg Kroah-Hartman cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Hans de Goede , Bryan O'Donoghue , Konrad Dybcio , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, LKML , platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nikita Travkin , Krzysztof Kozlowski Subject: branch between pdx86 lenovo c630 branch, power/supply and USB Message-ID: <0986fbac-7fba-56ea-cabb-c040ae12a795@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257130 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pm,org.kernel.vger.linux-usb,org.kernel.vger.platform-driver-x86 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi, This is v2 of the lenovo c630 IB branch with the build fix for non-ARM64 platforms (built on top of the commits in the previous IB PR). The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git tags/platform-drivers-x86-ib-lenovo-c630-v6.11-2 for you to fetch changes up to 13bbe1c83bc401c2538c758228d27b4042b08341: platform/arm64: build drivers even on non-ARM64 platforms (2024-06-24 18:22:15 +0300) ---------------------------------------------------------------- Immutable branch between pdx86 lenovo c630 branch, power/supply and USB subsystems due for the v6.11 merge window. platform-drivers-x86-ib-lenovo-c630-v6.11-2: v6.10-rc1 + platform-drivers-x86-lenovo-c630 for merging into the power/supply and USB subsystems for v6.11. ---------------------------------------------------------------- Bjorn Andersson (1): dt-bindings: platform: Add Lenovo Yoga C630 EC Dmitry Baryshkov (2): platform: arm64: add Lenovo Yoga C630 WOS EC driver platform/arm64: build drivers even on non-ARM64 platforms .../bindings/platform/lenovo,yoga-c630-ec.yaml | 83 ++++++ drivers/platform/Makefile | 2 +- drivers/platform/arm64/Kconfig | 14 + drivers/platform/arm64/Makefile | 1 + drivers/platform/arm64/lenovo-yoga-c630.c | 291 +++++++++++++++++++++ include/linux/platform_data/lenovo-yoga-c630.h | 44 ++++ 6 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/platform/lenovo,yoga-c630-ec.yaml create mode 100644 drivers/platform/arm64/lenovo-yoga-c630.c create mode 100644 include/linux/platform_data/lenovo-yoga-c630.h . From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Mon, 24 Jun 2024 19:24:55 +0300 (EEST) To: Dmitry Baryshkov , Sebastian Reichel , Heikki Krogerus , Greg Kroah-Hartman cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Hans de Goede , Bryan O'Donoghue , Konrad Dybcio , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, LKML , platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nikita Travkin , Krzysztof Kozlowski Subject: [GIT PULL RESEND] Immutable branch between pdx86 lenovo c630 branch, power/supply and USB Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257135 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-pm,org.kernel.vger.linux-usb,org.kernel.vger.platform-driver-x86 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi, This is v2 of the lenovo c630 IB branch with the build fix for non-ARM64 platforms (built on top of the commits in the previous IB PR). Resent with full Subject line. The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0: Linux 6.10-rc1 (2024-05-26 15:20:12 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git tags/platform-drivers-x86-ib-lenovo-c630-v6.11-2 for you to fetch changes up to 13bbe1c83bc401c2538c758228d27b4042b08341: platform/arm64: build drivers even on non-ARM64 platforms (2024-06-24 18:22:15 +0300) ---------------------------------------------------------------- Immutable branch between pdx86 lenovo c630 branch, power/supply and USB subsystems due for the v6.11 merge window. platform-drivers-x86-ib-lenovo-c630-v6.11-2: v6.10-rc1 + platform-drivers-x86-lenovo-c630 for merging into the power/supply and USB subsystems for v6.11. ---------------------------------------------------------------- Bjorn Andersson (1): dt-bindings: platform: Add Lenovo Yoga C630 EC Dmitry Baryshkov (2): platform: arm64: add Lenovo Yoga C630 WOS EC driver platform/arm64: build drivers even on non-ARM64 platforms .../bindings/platform/lenovo,yoga-c630-ec.yaml | 83 ++++++ drivers/platform/Makefile | 2 +- drivers/platform/arm64/Kconfig | 14 + drivers/platform/arm64/Makefile | 1 + drivers/platform/arm64/lenovo-yoga-c630.c | 291 +++++++++++++++++++++ include/linux/platform_data/lenovo-yoga-c630.h | 44 ++++ 6 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/platform/lenovo,yoga-c630-ec.yaml create mode 100644 drivers/platform/arm64/lenovo-yoga-c630.c create mode 100644 include/linux/platform_data/lenovo-yoga-c630.h . From: Srinivas Pandruvada To: rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH] cpufreq: intel_pstate: Replace boot_cpu_has() Date: Mon, 24 Jun 2024 09:27:14 -0700 Message-ID: <20240624162714.1431182-1-srinivas.pandruvada@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257137 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Replace boot_cpu_has() with cpu_feature_enabled(). Signed-off-by: Srinivas Pandruvada --- This is based on comment from Borislov for the change to suppot HWP highest interrupt. drivers/cpufreq/intel_pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index d53b99bab687..4ee244f59f54 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1635,7 +1635,7 @@ void notify_hwp_interrupt(void) u64 value, status_mask; unsigned long flags; - if (!hwp_active || !boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) + if (!hwp_active || !cpu_feature_enabled(X86_FEATURE_HWP_NOTIFY)) return; status_mask = HWP_GUARANTEED_PERF_CHANGE_STATUS; @@ -1667,7 +1667,7 @@ static void intel_pstate_disable_hwp_interrupt(struct cpudata *cpudata) { bool cancel_work; - if (!boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) + if (!cpu_feature_enabled(X86_FEATURE_HWP_NOTIFY)) return; /* wrmsrl_on_cpu has to be outside spinlock as this can result in IPC */ -- 2.44.0 . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 09:28:23 -0700 Message-ID: <00000000000026f7f2061ba545c2@google.com> Subject: [syzbot] [bcachefs?] INFO: task hung in bch2_write_iter From: syzbot To: bfoster@redhat.com, kent.overstreet@linux.dev, linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257140 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-bcachefs Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: 2ccbdf43d5e7 Merge tag 'for-linus' of git://git.kernel.org.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=14e2c02a980000 kernel config: https://syzkaller.appspot.com/x/.config?x=c79815c08cc14227 dashboard link: https://syzkaller.appspot.com/bug?extid=d8b126a5bfdcd1f3e7c5 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/35e32e9073a7/disk-2ccbdf43.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/6c6e34658d16/vmlinux-2ccbdf43.xz kernel image: https://storage.googleapis.com/syzbot-assets/4417e7ef76ed/bzImage-2ccbdf43.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+d8b126a5bfdcd1f3e7c5@syzkaller.appspotmail.com INFO: task syz-executor.4:6221 blocked for more than 143 seconds. Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor.4 state:D stack:27824 pid:6221 tgid:6208 ppid:5618 flags:0x00000006 Call Trace: context_switch kernel/sched/core.c:5408 [inline] __schedule+0x1796/0x49d0 kernel/sched/core.c:6745 __schedule_loop kernel/sched/core.c:6822 [inline] schedule+0x14b/0x320 kernel/sched/core.c:6837 schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:6894 rwsem_down_write_slowpath+0xeeb/0x13b0 kernel/locking/rwsem.c:1178 __down_write_common+0x1af/0x200 kernel/locking/rwsem.c:1306 inode_lock include/linux/fs.h:791 [inline] bch2_buffered_write fs/bcachefs/fs-io-buffered.c:1012 [inline] bch2_write_iter+0x22e/0x2840 fs/bcachefs/fs-io-buffered.c:1136 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7efe64e7cf29 RSP: 002b:00007efe65bc10c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007efe64fb4050 RCX: 00007efe64e7cf29 RDX: 0 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . From: Srinivas Kandagatla Date: Mon, 24 Jun 2024 17:33:41 +0100 Subject: [PATCH] arm64: dts: qcom: x1e80100-qcp: add audio support X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-qcp-audio-v1-1-323a6b5e1fe5@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257148 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add audio support to QCP platform which includes 2 x Speakers Headset Mic and Headset support. Signed-off-by: Srinivas Kandagatla --- arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 155 ++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts index b045b7bac9e0..02d30c0ada80 100644 --- a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts +++ b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts @@ -19,6 +19,32 @@ aliases { serial0 = &uart21; }; + wcd938x: audio-codec { + compatible = "qcom,wcd9385-codec"; + + pinctrl-names = "default"; + pinctrl-0 = <&wcd_default>; + + qcom,micbias1-microvolt = <1800000>; + qcom,micbias2-microvolt = <1800000>; + qcom,micbias3-microvolt = <1800000>; + qcom,micbias4-microvolt = <1800000>; + qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>; + qcom,mbhc-headset-vthreshold-microvolt = <1700000>; + qcom,mbhc-headphone-vthreshold-microvolt = <50000>; + qcom,rx-device = <&wcd_rx>; + qcom,tx-device = <&wcd_tx>; + + reset-gpios = <&tlmm 191 GPIO_ACTIVE_LOW>; + + vdd-buck-supply = <&vreg_l15b_1p8>; + vdd-rxtx-supply = <&vreg_l15b_1p8>; + vdd-io-supply = <&vreg_l15b_1p8>; + vdd-mic-bias-supply = <&vreg_bob1>; + + #sound-dai-cells = <1>; + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -127,6 +153,66 @@ linux,cma { }; }; + sound { + compatible = "qcom,x1e80100-sndcard"; + model = "X1E80100-QCP"; + audio-routing = "SpkrLeft IN", "WSA WSA_SPK1 OUT", + "SpkrRight IN", "WSA WSA_SPK2 OUT", + "IN1_HPHL", "HPHL_OUT", + "IN2_HPHR", "HPHR_OUT", + "AMIC2", "MIC BIAS2", + "TX SWR_INPUT1", "ADC2_OUTPUT"; + + wcd-playback-dai-link { + link-name = "WCD Playback"; + + cpu { + sound-dai = <&q6apmbedai RX_CODEC_DMA_RX_0>; + }; + + codec { + sound-dai = <&wcd938x 0>, <&swr1 0>, <&lpass_rxmacro 0>; + }; + + platform { + sound-dai = <&q6apm>; + }; + }; + + wcd-capture-dai-link { + link-name = "WCD Capture"; + + cpu { + sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>; + }; + + codec { + sound-dai = <&wcd938x 1>, <&swr2 1>, <&lpass_txmacro 0>; + }; + + platform { + sound-dai = <&q6apm>; + }; + }; + + wsa-dai-link { + link-name = "WSA Playback"; + + cpu { + sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>; + }; + + codec { + sound-dai = <&left_spkr>, <&right_spkr>, + <&swr0 0>, <&lpass_wsamacro 0>; + }; + + platform { + sound-dai = <&q6apm>; + }; + }; + }; + vph_pwr: vph-pwr-regulator { compatible = "regulator-fixed"; @@ -520,6 +606,16 @@ vreg_l3j_0p8: ldo3 { }; }; +&lpass_tlmm { + spkr_01_sd_n_active: spkr-01-sd-n-active-state { + pins = "gpio12"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-low; + }; +}; + &mdss { status = "okay"; }; @@ -638,6 +734,57 @@ &smb2360_2_eusb2_repeater { vdd3-supply = <&vreg_l8b_3p0>; }; +&swr0 { + status = "okay"; + + pinctrl-0 = <&wsa_swr_active>, <&spkr_01_sd_n_active>; + pinctrl-names = "default"; + + /* WSA8845, Left Speaker */ + left_spkr: speaker@0,0 { + compatible = "sdw20217020400"; + reg = <0 0>; + #sound-dai-cells = <0>; + reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>; + sound-name-prefix = "SpkrLeft"; + vdd-1p8-supply = <&vreg_l15b_1p8>; + vdd-io-supply = <&vreg_l12b_1p2>; + }; + + /* WSA8845, Right Speaker */ + right_spkr: speaker@0,1 { + compatible = "sdw20217020400"; + reg = <0 1>; + #sound-dai-cells = <0>; + reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>; + sound-name-prefix = "SpkrRight"; + vdd-1p8-supply = <&vreg_l15b_1p8>; + vdd-io-supply = <&vreg_l12b_1p2>; + }; +}; + +&swr1 { + status = "okay"; + + /* WCD9385 RX */ + wcd_rx: codec@0,4 { + compatible = "sdw20217010d00"; + reg = <0 4>; + qcom,rx-port-mapping = <1 2 3 4 5>; + }; +}; + +&swr2 { + status = "okay"; + + /* WCD9385 TX */ + wcd_tx: codec@0,3 { + compatible = "sdw20217010d00"; + reg = <0 3>; + qcom,tx-port-mapping = <2 2 3 4>; + }; +}; + &tlmm { gpio-reserved-ranges = <33 3>, /* Unused */ <44 4>, /* SPI (TPM) */ @@ -679,6 +826,14 @@ wake-n-pins { bias-pull-up; }; }; + + wcd_default: wcd-reset-n-active-state { + pins = "gpio191"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-low; + }; }; &uart21 { --- base-commit: 781025f172e19ca5682d7bfc5243e7aa74c4977f change-id: 20240624-qcp-audio-dd424c7d4e58 Best regards, -- Srinivas Kandagatla . From: Javier Carrasco Subject: [PATCH 0/3] drm/mediatek: fixes for ovl_adaptor Date: Mon, 24 Jun 2024 18:43:45 +0200 Message-Id: <20240624-mtk_disp_ovl_adaptor_scoped-v1-0-9fa1e074d881@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , "Nancy.Lin" Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Javier Carrasco , stable@vger.kernel.org Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257155 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The main fix is a possible memory leak on an early exit in the for_each_child_of_node() loop. That fix has been divided into a patch that can be backported (a simple of_node_put()), and another one that uses the scoped variant of the macro, removing the need for any of_node_put(). That prevents mistakes if new break/return instructions are added, but the macro might not be available in older kernels. When at it, an unused header has been dropped. Signed-off-by: Javier Carrasco --- Javier Carrasco (3): drm/mediatek: ovl_adaptor: drop unused mtk_crtc.h header drm/mediatek: ovl_adaptor: add missing of_node_put() drm/mediatek: ovl_adaptor: use scoped variant of for_each_child_of_node() drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240624-mtk_disp_ovl_adaptor_scoped-0702a6b23443 Best regards, -- Javier Carrasco . From: Roman Kagan To: CC: Catalin Marinas , Will Deacon , , , , Thomas Gleixner , Jonathan Corbet , Marc Zyngier Subject: [PATCH] irqchip/gicv3-its: Workaround for GIC-700 erratum 2195890 Date: Mon, 24 Jun 2024 18:55:41 +0200 Message-ID: <20240624165541.1286227-1-rkagan@amazon.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257173 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-doc Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail According to Arm CoreLink GIC-700 erratum 2195890, on GIC revisions r0p0, r0p1, r1p0 under certain conditions LPIs may remain in the Pending Table until one of a number of external events occurs. No LPIs are lost but they may not be delivered in a finite time. The workaround is to issue an INV using GICR_INVLPIR to an unused, in range LPI ID to retrigger the search. Add this workaround to the quirk table. When the quirk is applicable, carve out one LPI ID from the available range and run periodic work to do INV to it, in order to prevent GIC from stalling. TT: https://t.corp.amazon.com/D82032616 Signed-off-by: Elad Rosner Signed-off-by: Mohamed Mediouni Signed-off-by: Roman Kagan --- drivers/irqchip/irq-gic-v3-its.c | 70 ++++++++++++++++++++- Documentation/arch/arm64/silicon-errata.rst | 2 + arch/arm64/Kconfig | 18 ++++++ 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 3c755d5dad6e..53cf50dd8e13 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -49,6 +50,7 @@ #define RD_LOCAL_MEMRESERVE_DONE BIT(2) static u32 lpi_id_bits; +static u32 lpi_id_base __initdata = 8192; /* * We allocate memory for PROPBASE to cover 2 ^ lpi_id_bits LPIs to @@ -2136,7 +2138,7 @@ static int __init its_lpi_init(u32 id_bits) * Initializing the allocator is just the same as freeing the * full range of LPIs. */ - err = free_lpi_range(8192, lpis); + err = free_lpi_range(lpi_id_base, lpis - lpi_id_base + 8192); pr_debug("ITS: Allocator initialized for %u LPIs\n", lpis); return err; } @@ -4763,6 +4765,61 @@ static bool its_set_non_coherent(void *data) return true; } +#define ITS_QUIRK_GIC700_2195890_PERIOD_MSEC 1000 +static struct { + u32 lpi; + struct delayed_work work; +} its_quirk_gic700_2195890_data __maybe_unused; + +static void __maybe_unused its_quirk_gic700_2195890_work_handler(struct work_struct *work) +{ + int cpu; + void __iomem *rdbase; + u64 gicr_invlpir_val; + + for_each_online_cpu(cpu) { + rdbase = gic_data_rdist_cpu(cpu)->rd_base; + if (!rdbase) { + continue; + } + + /* + * Prod the respective GIC with an INV for an otherwise unused + * LPI. This is only to resume the stalled processing, so + * there's no need to wait for invalidation to complete. + */ + gicr_invlpir_val = + FIELD_PREP(GICR_INVLPIR_INTID, + its_quirk_gic700_2195890_data.lpi); + raw_spin_lock(&gic_data_rdist_cpu(cpu)->rd_lock); + gic_write_lpir(gicr_invlpir_val, rdbase + GICR_INVLPIR); + raw_spin_unlock(&gic_data_rdist_cpu(cpu)->rd_lock); + } + + schedule_delayed_work(&its_quirk_gic700_2195890_data.work, + msecs_to_jiffies(ITS_QUIRK_GIC700_2195890_PERIOD_MSEC)); +} + +static bool __maybe_unused its_enable_quirk_gic700_2195890(void *data) +{ + struct its_node *its = data; + + if (its_quirk_gic700_2195890_data.lpi) + return true; + + /* + * Use one LPI INTID from the start of the LPI range for GIC prodding, + * and make it unavailable for regular LPI use later. + */ + its_quirk_gic700_2195890_data.lpi = lpi_id_base++; + + INIT_DELAYED_WORK(&its_quirk_gic700_2195890_data.work, + its_quirk_gic700_2195890_work_handler); + schedule_delayed_work(&its_quirk_gic700_2195890_data.work, 0); + + return true; +} + static const struct gic_quirk its_quirks[] = { #ifdef CONFIG_CAVIUM_ERRATUM_22375 { @@ -4822,6 +4879,17 @@ static const struct gic_quirk its_quirks[] = { .property = "dma-noncoherent", .init = its_set_non_coherent, }, +#ifdef CONFIG_ARM64_ERRATUM_2195890 + { + .desc = "ITS: GIC-700 erratum 2195890", + /* + * Applies to r0p0, r0p1, r1p0: iidr_var(bits 16..19) == 0 or 1 + */ + .iidr = 0x0400043b, + .mask = 0xfffeffff, + .init = its_enable_quirk_gic700_2195890, + }, +#endif { } }; diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst index eb8af8032c31..67445075ae88 100644 --- a/Documentation/arch/arm64/silicon-errata.rst +++ b/Documentation/arch/arm64/silicon-errata.rst @@ -169,6 +169,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | GIC-700 | #2941627 | ARM64_ERRATUM_2941627 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | GIC-700 | #2195890 | ARM64_ERRATUM_2195890 | ++----------------+-----------------+-----------------+-----------------------------+ +----------------+-----------------+-----------------+-----------------------------+ | Broadcom | Brahma-B53 | N/A | ARM64_ERRATUM_845719 | +----------------+-----------------+-----------------+-----------------------------+ diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 5d91259ee7b5..9c330029131c 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1279,6 +1279,24 @@ config ROCKCHIP_ERRATUM_3588001 If unsure, say Y. +config ARM64_ERRATUM_2195890 + bool "GIC-700: 2195890: LPIs may be held in Pending Table until specific external events happen" + default y + help + This option adds a workaround for Arm GIC-700 erratum 2195890. + + In affected GIC-700 versions (r0p0, r0p1, r1p0) under certain + conditions LPIs may remain in the Pending Table until one of a number + of external events occurs. + + No LPIs are lost and this can happen on physical or virtual PEs but + this erratum means they may not be delivered in a finite time. + + Work around the issue by inserting an INV command for an unused but + valid LPI INTID every so often to retrigger the search. + + If unsure, say Y. + config SOCIONEXT_SYNQUACER_PREITS bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" default y -- 2.34.1 Amazon Web Services Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B Sitz: Berlin Ust-ID: DE 365 538 597 . From: Udit Kumar To: , , CC: , , , , , , , , Udit Kumar , Subject: [PATCH v4] serial: 8250_omap: Implementation of Errata i2310 Date: Mon, 24 Jun 2024 22:26:56 +0530 Message-ID: <20240624165656.2634658-1-u-kumar1@ti.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257175 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-serial,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail As per Errata i2310[0], Erroneous timeout can be triggered, if this Erroneous interrupt is not cleared then it may leads to storm of interrupts, therefore apply Errata i2310 solution. [0] https://www.ti.com/lit/pdf/sprz536 page 23 Fixes: b67e830d38fa ("serial: 8250: 8250_omap: Fix possible interrupt storm on K3 SoCs") Cc: stable@vger.kernel.org Signed-off-by: Udit Kumar --- Test logs: https://gist.github.com/uditkumarti/48e239540db4e761861fbd1d7d31cfed Change logs Changes in v4: - Reverted fifo empty check before applying errata Link to v3: https://lore.kernel.org/all/20240619105903.165434-1-u-kumar1@ti.com/ Changes in v3: - CC stable in commit message Link to v2: https://lore.kernel.org/all/20240617052253.2188140-1-u-kumar1@ti.com/ Changes in v2: - Added Fixes Tag and typo correction in commit message - Corrected bit position to UART_OMAP_EFR2_TIMEOUT_BEHAVE Link to v1 https://lore.kernel.org/all/20240614061314.290840-1-u-kumar1@ti.com/ drivers/tty/serial/8250/8250_omap.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 170639d12b2a..1af9aed99c65 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -115,6 +115,10 @@ /* RX FIFO occupancy indicator */ #define UART_OMAP_RX_LVL 0x19 +/* Timeout low and High */ +#define UART_OMAP_TO_L 0x26 +#define UART_OMAP_TO_H 0x27 + /* * Copy of the genpd flags for the console. * Only used if console suspend is disabled @@ -663,13 +667,25 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) /* * On K3 SoCs, it is observed that RX TIMEOUT is signalled after - * FIFO has been drained, in which case a dummy read of RX FIFO - * is required to clear RX TIMEOUT condition. + * FIFO has been drained or erroneously. + * So apply solution of Errata i2310 as mentioned in + * https://www.ti.com/lit/pdf/sprz536 */ if (priv->habit & UART_RX_TIMEOUT_QUIRK && (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT && serial_port_in(port, UART_OMAP_RX_LVL) == 0) { - serial_port_in(port, UART_RX); + unsigned char efr2, timeout_h, timeout_l; + + efr2 = serial_in(up, UART_OMAP_EFR2); + timeout_h = serial_in(up, UART_OMAP_TO_H); + timeout_l = serial_in(up, UART_OMAP_TO_L); + serial_out(up, UART_OMAP_TO_H, 0xFF); + serial_out(up, UART_OMAP_TO_L, 0xFF); + serial_out(up, UART_OMAP_EFR2, UART_OMAP_EFR2_TIMEOUT_BEHAVE); + serial_in(up, UART_IIR); + serial_out(up, UART_OMAP_EFR2, efr2); + serial_out(up, UART_OMAP_TO_H, timeout_h); + serial_out(up, UART_OMAP_TO_L, timeout_l); } /* Stop processing interrupts on input overrun */ -- 2.34.1 . Date: Mon, 24 Jun 2024 18:06:50 +0100 From: Mark Brown To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra Cc: Borislav Petkov , Linux Kernel Mailing List , Linux Next Mailing List , Mario Limonciello , Perry Yuan , Xiaojian Du Subject: linux-next: manual merge of the tip tree with the pm tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4klZvQdydUy1+7yP" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257181 org.kernel.vger.linux-next:61911 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --4klZvQdydUy1+7yP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the tip tree got a conflict in: arch/x86/include/asm/cpufeatures.h between commit: c7107750b2ffa ("x86/cpufeatures: Add AMD FAST CPPC feature flag") =66rom the pm tree and commit: 78ce84b9e0a54 ("x86/cpufeatures: Flip the /proc/cpuinfo appearance logic") =66rom the tip tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --cc arch/x86/include/asm/cpufeatures.h index 6c128d463a143,6007462e03d66..0000000000000 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@@ -465,12 -466,11 +466,12 @@@ * * Reuse free bits when adding new feature flags! */ - #define X86_FEATURE_AMD_LBR_PMC_FREEZE (21*32+ 0) /* AMD LBR and PMC Free= ze */ - #define X86_FEATURE_CLEAR_BHB_LOOP (21*32+ 1) /* "" Clear branch history = at syscall entry using SW loop */ - #define X86_FEATURE_BHI_CTRL (21*32+ 2) /* "" BHI_DIS_S HW control avail= able */ - #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* "" BHI_DIS_S HW control en= abled */ - #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* "" Clear branc= h history at vmexit using SW loop */ - #define X86_FEATURE_FAST_CPPC (21*32 + 5) /* "" AMD Fast CPPC */ + #define X86_FEATURE_AMD_LBR_PMC_FREEZE (21*32+ 0) /* "amd_lbr_pmc_freeze"= AMD LBR and PMC Freeze */ + #define X86_FEATURE_CLEAR_BHB_LOOP (21*32+ 1) /* Clear branch history at = syscall entry using SW loop */ + #define X86_FEATURE_BHI_CTRL (21*32+ 2) /* BHI_DIS_S HW control availabl= e */ + #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* BHI_DIS_S HW control enabl= ed */ + #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* Clear branch h= istory at vmexit using SW loop */ ++#define X86_FEATURE_FAST_CPPC (21*32 + 5) /* AMD Fast CPPC */ =20 /* * BUG word(s) --4klZvQdydUy1+7yP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5p6kACgkQJNaLcl1U h9BV/gf+IyBdZ108YiWqPp6OdY+fl10ivWtGa96tpjUhGmBj/9kQDQbWr/k5fJEU ER+E1ouGYwjmR6XO0Y7XuCGSggpcGTtXQKzqms8kYg+E6s6uQxI2P+5nkwX7p4Pa i5wehtb/8USpNi5cp2RpTCn/DDOauUnGdFB1KoYkdBXw1tQYt4imcjzwsB5bCj0l HRC011cCcgcDuD+ZucXF7h8y/L3IORm2K77Bbyem0eQPySBzPwlajOd26tmcM7im GKWqFp8H+YRMNsE/pInAFzpXt/flSdJkxU7tJ/FGaL175NhuNTcX7eC4lFIO5Zh4 ApX5YnecR3u2C8DY0ATmKTiGG+xdNA== =NgFk -----END PGP SIGNATURE----- --4klZvQdydUy1+7yP-- . From: Prabhakar To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Geert Uytterhoeven , Magnus Damm , Wolfram Sang Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Claudiu Beznea , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 0/2] Add Watchdog Timer driver for Renesas RZ/V2H(P) SoC Date: Mon, 24 Jun 2024 18:25:07 +0100 Message-Id: <20240624172509.106912-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257186 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-watchdog Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Lad Prabhakar Hi All, This patch series aims to add WDT support to Renesas RZ/V2H(P) SoC. v1->v2 - Included RB tag for binding patch - Fixed review comments from Claudiu - Stopped using PM runtime calls in restart handler - Dropped rstc deassert from probe Cheers, Prabhakar Lad Prabhakar (2): dt-bindings: watchdog: renesas,wdt: Document RZ/V2H(P) SoC watchdog: Add Watchdog Timer driver for RZ/V2H(P) .../bindings/watchdog/renesas,wdt.yaml | 17 +- drivers/watchdog/Kconfig | 8 + drivers/watchdog/Makefile | 1 + drivers/watchdog/rzv2h_wdt.c | 251 ++++++++++++++++++ 4 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 drivers/watchdog/rzv2h_wdt.c -- 2.34.1 . Message-ID: <9d0fabb0-70b0-4b4b-ac7c-389b1c7afe20@gmail.com> Date: Mon, 24 Jun 2024 19:26:48 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johan Jonker Subject: [PATCH v1] ARM: dts: rockchip: rk3128: add #sound-dai-cells to hdmi node To: heiko@sntech.de Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257190 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail '#sound-dai-cells' is required to properly interpret the list of DAI specified in the 'sound-dai' property, so add them to the 'hdmi' node for 'rk3128.dtsi'. Signed-off-by: Johan Jonker --- arch/arm/boot/dts/rockchip/rk3128.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index 41feb121bd84..e956c9cdd02b 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -566,6 +566,7 @@ hdmi: hdmi@20034000 { pinctrl-names = "default"; pinctrl-0 = <&hdmii2c_xfer &hdmi_hpd &hdmi_cec>; power-domains = <&power RK3128_PD_VIO>; + #sound-dai-cells = <0>; status = "disabled"; ports { -- 2.39.2 . From: Jerome Brunet To: Jonathan Cameron , Lars-Peter Clausen , Neil Armstrong Cc: Jerome Brunet , Kevin Hilman , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-iio@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH 0/2] iio: frequency: add iio support for Amlogic clock measure Date: Mon, 24 Jun 2024 19:31:01 +0200 Message-ID: <20240624173105.909554-1-jbrunet@baylibre.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257192 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-amlogic,org.kernel.vger.linux-iio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add support for the HW found in most Amlogic SoC dedicated to measure system clocks. This drivers aims to replace the one found in drivers/soc/amlogic/meson-clk-measure.c with following improvements: * Access to the measurements through the IIO API: Easier re-use of the results in userspace and other drivers * Controllable scale with raw measurements * Higher precision with processed measurements Jerome Brunet (2): dt-bindings: iio: frequency: add clock measure support iio: frequency: add amlogic clock measure support .../iio/frequency/amlogic,clk-msr-io.yaml | 50 ++ drivers/iio/frequency/Kconfig | 15 + drivers/iio/frequency/Makefile | 1 + drivers/iio/frequency/amlogic-clk-msr-io.c | 802 ++++++++++++++++++ 4 files changed, 868 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/frequency/amlogic,clk-msr-io.yaml create mode 100644 drivers/iio/frequency/amlogic-clk-msr-io.c -- 2.43.0 . X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a From: Armin Wolf To: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com Cc: corbet@lwn.net, platform-driver-x86@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] platform/x86: wmi: Add driver_override support Date: Mon, 24 Jun 2024 19:31:14 +0200 Message-Id: <20240624173116.31314-1-W_Armin@gmx.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable UI-OutboundReport: notjunk:1;M01:P0:ac+iIapHrVE=;c7BNJ5Ziuz/zVTphmFXtD4cqGoS x89IxJI071YKPVZlUS/aVBsObQUmo7WEFivFpBVpw17+IyBkQXkSRb6sZLhPjhCeqoTWGBLFf +Dr+gzEjOUAWPOjh8RZ/AuY6x3R/EaYzHRihZKMsxK6l21CLFGkxNqmmi0oOJUu9IPylqRSy3 X9VmLwtoWBaXPEJc5uukTS/djiir+avJ/2/G1cOOj28PscfDg4/OPICILGZzOhgPc+1bowoeF waf0CqIBimklTLCXd3nmV1dGFmjLChauqDfqKdEqwAblmR8O5PO+6zuH5aKZSHk6+AWPvcy72 zJ1tQqATMmPM0iFlSnIqvXWNXwsSh2vpnpQPEERmKwpsh8QH2UiP3K/gg7QRF8SLt05mtOkxm Bc+I0cx9McJQVcGk9dMU2sFStboGpY5or1uA+MdDaLV4lq032ZdyRhHMyG0AvnYWAha5IyHMR 6vkv2dNssxGX8pQt/ZHWjUomA56T02yL70727SEkUl8U1U3PV+pM5fbTR3bKHv5DV5DDUFvNc EZUQt/SEeZUXqUfFm4VvWxRcKfCdE5Sh1O67HTbobA7DVh80ML8FoNzodKxUOisR4/R238Y49 Zyt/Xp3NU08qHvRtMKBlXnTcZmz9wFv0xKsW6NsqjfN0D5DOVwGw7Ai6EktSShEvTu31S9hLf y8hxtygTn9YaCSoupqkBYOmVFZM0AFr0F0mb05DBsPIAoXPp4ANvzFjgQHyYm1odsv63jNJz0 zp3QgwRHO24sqD8VqlrVtwyETEZQZUH0rS5mlsG9Bry0BruzVaUzcTO2F6Mc3aZzNO2g2REWM ItdgfeOzX4Z3OCu4XPefciHUftaaVyylHMXQy/kwxPRLE= Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257196 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-doc,org.kernel.vger.platform-driver-x86 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch series add support for using the driver_override sysfs attribute with WMI devices. The reason for this is that there will exist a couple of generic WMI drivers in the future for allowing driver developers to directly access the underlying WMI device. Since those generic WMI drivers do not have an ID table, the driver_override mechanism is used to bind them to WMI devices. Changes since v1: - Add Reviewed-by tags - Add line breaks and implement requested changes in the documentation of the driver_override attr Armin Wolf (2): platform/x86: wmi: Add driver_override support platform/x86: wmi: Add bus ABI documentation Documentation/ABI/testing/sysfs-bus-wmi | 81 +++++++++++++++++++++++++ MAINTAINERS | 1 + drivers/platform/x86/wmi.c | 33 ++++++++++ include/linux/wmi.h | 4 ++ 4 files changed, 119 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-wmi =2D- 2.39.2 . From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: prabhakar.pujeri@gmail.com Subject: [PATCH] scsi:Replace printk and WARN_ON with WARN macro Date: Mon, 24 Jun 2024 13:32:05 -0400 Message-ID: <20240624173205.1227297-1-prabhakar.pujeri@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257199 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch modifies the error handling in the SCSI library and Initio SCSI driver by replacing the combination of printk and WARN_ON macros with the WARN macro for better consistency and readability. Signed-off-by: Prabhakar Pujeri --- drivers/scsi/initio.c | 3 +-- drivers/scsi/scsi_lib.c | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 625fd547ee60..39273457f5bd 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2737,8 +2737,7 @@ static void i91uSCBPost(u8 * host_mem, u8 * cblk_mem) host = (struct initio_host *) host_mem; cblk = (struct scsi_ctrl_blk *) cblk_mem; if ((cmnd = cblk->srb) == NULL) { - printk(KERN_ERR "i91uSCBPost: SRB pointer is empty\n"); - WARN_ON(1); + WARN(1,KERN_ERR "i91uSCBPost: SRB pointer is empty\n"); initio_release_scb(host, cblk); /* Release SCB for current channel */ return; } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index ec39acc986d6..54a4122c93f0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -3117,10 +3117,11 @@ void *scsi_kmap_atomic_sg(struct scatterlist *sgl, int sg_count, } if (unlikely(i == sg_count)) { - printk(KERN_ERR "%s: Bytes in sg: %zu, requested offset %zu, " + WARN(1, + + KERN_ERR "%s: Bytes in sg: %zu, requested offset %zu, " "elements %d\n", __func__, sg_len, *offset, sg_count); - WARN_ON(1); return NULL; } -- 2.45.2 . Message-ID: <6c3fbc2d-85d9-4502-b43c-0950ccdd6f7e@redhat.com> Date: Mon, 24 Jun 2024 13:32:34 -0400 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Language: en-US To: Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Johannes Weiner , Chris Down , Yu Zhao , Axel Rasmussen Cc: Linux Kernel Mailing List , Linux Memory Management List , Rafael Aquini , "cgroups@vger.kernel.org" From: Waiman Long Subject: MGLRU OOM problem Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257200 org.kvack.linux-mm:201157 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.cgroups,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi, We are hitting an OOM issue with our OpenShift middleware which is based on Kubernetes. Currently, it only sets memory.max when setting a memory limit.  OOM kills are rather frequently encountered when we try to write a large data file that exceeds memory.max to a NFS mount filesystem. I have bisected the problem down to commit 14aa8b2d5c2e ("mm/mglru: don't sync disk for each aging cycle"). The following command can be used to cause an OOM kill when running in a memory cgroup with a memory.max limit of 600M on a NFS mount filesystem.  # dd if=/dev/urandom of=/disk/2G.bin bs=32K count=65536 status=progress iflag=fullblock In my case, I can cause an OOM when I ran the reproducer the 2nd time in a test system. In the first successful run, the reported data rate was:   2147483648 bytes (2.1 GB, 2.0 GiB) copied, 57.5474 s, 37.3 MB/s After reverting commit 14aa8b2d5c2e ("mm/mglru: don't sync disk for each aging cycle"), OOM can no longer be reproduced and the new data rate was:   2147483648 bytes (2.1 GB, 2.0 GiB) copied, 25.694 s, 83.6 MB/s If I disabled MGLRU (echo 0 > /sys/kernel/mm/lru_gen/enabled), the data rate was:   2147483648 bytes (2.1 GB, 2.0 GiB) copied, 21.184 s, 101 MB/s I know that the purpose of commit 14aa8b2d5c2e to prevent premature aging of SSDs. However I would like to find a way to wake up the flusher whenever the cgroup is under memory pressure and have a lot of dirty pages, but I don't have a solid clue yet. I am aware that there was a previous discussion about this commit in [1], so I would like to engage the same community to see if there can be a proper solution to this problem. [1] https://lore.kernel.org/lkml/ZcWOh9u3uqZjNFMa@chrisdown.name/ Cheers, Longman . Date: Mon, 24 Jun 2024 18:35:57 +0100 From: Mark Brown To: Greg KH Cc: Linux Kernel Mailing List , Linux Next Mailing List , Philipp Zabel , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: linux-next: manual merge of the driver-core tree with the reset tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GJugohMgk3C+vYLN" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257202 org.kernel.vger.linux-next:61912 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --GJugohMgk3C+vYLN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the driver-core tree got a conflict in: drivers/reset/reset-meson-audio-arb.c between commit: 0e8b3bca280a7 ("reset: meson-audio-arb: Use devm_clk_get_enabled()") =66rom the reset tree and commit: b99e9c096148f ("reset: meson-audio-arb: Convert to platform remove callba= ck returning void") =66rom the driver-core tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --cc drivers/reset/reset-meson-audio-arb.c index 894ad9d37a665,8740f5f6abf80..0000000000000 --- a/drivers/reset/reset-meson-audio-arb.c +++ b/drivers/reset/reset-meson-audio-arb.c --GJugohMgk3C+vYLN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5rnwACgkQJNaLcl1U h9BqvAf+N+QFDTGcix7Fx0GDZJAEXLzVeLejo+SM2MugdPCxN56XGKZtQ+99h9lV Ryz0k7m/XCNxfME/gOt3slNh7lNIjPQDn9FIZW1TyYoMftE0p916LdA5bcFcNLLS 9vTJH8L3QFg1G6iSEJmI4mEvt8v5P3IN843X3f8+tNgO8dubELgnFtl3oUoqQSC4 KtqIpgqLOtD4zxl2X8sle9jOjImz/ZsquNNZKnIBRDk6HpAkND/bYuVycpcD3O3a UBxBVJIfP4aJ84mWee7YQBASN+tii+EJZu8tD52ErErBXEiY3yulsvI3Mjeea/4s vYXFAZ+tSCnHlwxT0ZMKt255Fdrk4g== =6y0T -----END PGP SIGNATURE----- --GJugohMgk3C+vYLN-- . From: Dmitry Baryshkov Date: Mon, 24 Jun 2024 20:39:58 +0300 Subject: [PATCH] drm/connector: hdmi: shorten too long function name X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-hdmi-connector-shorten-name-v1-1-5bd3410138db@linaro.org> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mark Brown Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257207 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail If CONFIG_MODVERSIONS is enabled, then using the HDMI Connector framework can result in build failures. Rename the function to make it fit into the name requirements. ERROR: modpost: too long symbol "drm_atomic_helper_connector_hdmi_disable_audio_infoframe" [drivers/gpu/drm/msm/msm.ko] Reported-by: Mark Brown Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 6 +++--- include/drm/display/drm_hdmi_state_helper.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index 2dab3ad8ce64..7854820089ec 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -716,7 +716,7 @@ drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *co EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_update_audio_infoframe); /** - * drm_atomic_helper_connector_hdmi_disable_audio_infoframe - Stop sending the Audio Infoframe + * drm_atomic_helper_connector_hdmi_clear_audio_infoframe - Stop sending the Audio Infoframe * @connector: A pointer to the HDMI connector * * This function is meant for HDMI connector drivers to stop sending their @@ -727,7 +727,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_update_audio_infoframe); * Zero on success, error code on failure. */ int -drm_atomic_helper_connector_hdmi_disable_audio_infoframe(struct drm_connector *connector) +drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *connector) { struct drm_connector_hdmi_infoframe *infoframe = &connector->hdmi.infoframes.audio; @@ -749,4 +749,4 @@ drm_atomic_helper_connector_hdmi_disable_audio_infoframe(struct drm_connector *c return ret; } -EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_disable_audio_infoframe); +EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_clear_audio_infoframe); diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/display/drm_hdmi_state_helper.h index 285f366cf716..2d45fcfa4619 100644 --- a/include/drm/display/drm_hdmi_state_helper.h +++ b/include/drm/display/drm_hdmi_state_helper.h @@ -16,7 +16,7 @@ int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, int drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *connector, struct hdmi_audio_infoframe *frame); -int drm_atomic_helper_connector_hdmi_disable_audio_infoframe(struct drm_connector *connector); +int drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *connector); int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *connector, struct drm_atomic_state *state); --- base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7 change-id: 20240624-hdmi-connector-shorten-name-3122d804b6c7 Best regards, -- Dmitry Baryshkov . Message-ID: <55d302e5-c018-4b93-84c1-8cf75162e939@gmail.com> Date: Mon, 24 Jun 2024 19:43:29 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johan Jonker Subject: [PATCH v1] ARM: dts: rockchip: rk3036: add #sound-dai-cells to hdmi node To: heiko@sntech.de Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257212 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail '#sound-dai-cells' is required to properly interpret the list of DAI specified in the 'sound-dai' property, so add them to the 'hdmi' node for 'rk3036.dtsi'. Signed-off-by: Johan Jonker --- arch/arm/boot/dts/rockchip/rk3036.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/rockchip/rk3036.dtsi b/arch/arm/boot/dts/rockchip/rk3036.dtsi index 04af224005f8..96279d1e02fe 100644 --- a/arch/arm/boot/dts/rockchip/rk3036.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3036.dtsi @@ -402,6 +402,7 @@ hdmi: hdmi@20034000 { rockchip,grf = <&grf>; pinctrl-names = "default"; pinctrl-0 = <&hdmi_ctl>; + #sound-dai-cells = <0>; status = "disabled"; ports { -- 2.39.2 . Date: Mon, 24 Jun 2024 18:45:37 +0100 From: Mark Brown To: Greg KH Cc: Andy Shevchenko , Greg Kroah-Hartman , Linux Kernel Mailing List , Linux Next Mailing List , Petr Mladek , Tony Lindgren Subject: linux-next: manual merge of the tty tree with the printk tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DC1J995vhGFiO/gP" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257217 org.kernel.vger.linux-next:61913 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --DC1J995vhGFiO/gP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the tty tree got a conflict in: drivers/tty/serial/8250/8250_core.c between commit: b70dc67cceb97 ("serial: core: Revert unusable console quirk handling") =66rom the printk tree and commit: ffd8e8bd26e94 ("serial: 8250: Extract platform driver") =66rom the tty tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. I'm not sure git rerere will do the right thing with this one... diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/= 8250_core.c index 44f7cc56ff70d..5f9f06911795c 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -6,11 +6,9 @@ * * Copyright (C) 2001 Russell King. * - * Supports: ISA-compatible 8250/16550 ports - * PNP 8250/16550 ports + * Supports: * early_serial_setup() ports * userspace-configurable "phantom" ports - * "serial8250" platform devices * serial8250_register_8250_port() ports */ =20 @@ -35,52 +33,13 @@ #include #include #include -#ifdef CONFIG_SPARC -#include -#endif =20 #include =20 #include "8250.h" =20 -/* - * Configuration: - * share_irqs - whether we pass IRQF_SHARED to request_irq(). This opti= on - * is unsafe when used on edge-triggered interrupts. - */ -static unsigned int share_irqs =3D SERIAL8250_SHARE_IRQS; - -static unsigned int nr_uarts =3D CONFIG_SERIAL_8250_RUNTIME_UARTS; - -static struct uart_driver serial8250_reg; - -static unsigned int skip_txen_test; /* force skip of txen test at init tim= e */ - #define PASS_LIMIT 512 =20 -#include -/* - * SERIAL_PORT_DFNS tells us about built-in ports that have no - * standard enumeration mechanism. Platforms that can find all - * serial ports via mechanisms like ACPI or PCI need not supply it. - */ -#ifndef SERIAL_PORT_DFNS -#define SERIAL_PORT_DFNS -#endif - -static const struct old_serial_port old_serial_port[] =3D { - SERIAL_PORT_DFNS /* defined in asm/serial.h */ -}; - -#define UART_NR CONFIG_SERIAL_8250_NR_UARTS - -#ifdef CONFIG_SERIAL_8250_RSA - -#define PORT_RSA_MAX 4 -static unsigned long probe_rsa[PORT_RSA_MAX]; -static unsigned int probe_rsa_count; -#endif /* CONFIG_SERIAL_8250_RSA */ - struct irq_info { struct hlist_node node; int irq; @@ -345,45 +304,8 @@ static void univ8250_release_irq(struct uart_8250_port= *up) serial_unlink_irq_chain(up); } =20 -#ifdef CONFIG_SERIAL_8250_RSA -static int serial8250_request_rsa_resource(struct uart_8250_port *up) -{ - unsigned long start =3D UART_RSA_BASE << up->port.regshift; - unsigned int size =3D 8 << up->port.regshift; - struct uart_port *port =3D &up->port; - int ret =3D -EINVAL; - - switch (port->iotype) { - case UPIO_HUB6: - case UPIO_PORT: - start +=3D port->iobase; - if (request_region(start, size, "serial-rsa")) - ret =3D 0; - else - ret =3D -EBUSY; - break; - } - - return ret; -} - -static void serial8250_release_rsa_resource(struct uart_8250_port *up) -{ - unsigned long offset =3D UART_RSA_BASE << up->port.regshift; - unsigned int size =3D 8 << up->port.regshift; - struct uart_port *port =3D &up->port; - - switch (port->iotype) { - case UPIO_HUB6: - case UPIO_PORT: - release_region(port->iobase + offset, size); - break; - } -} -#endif - -static const struct uart_ops *base_ops; -static struct uart_ops univ8250_port_ops; +const struct uart_ops *univ8250_port_base_ops =3D NULL; +struct uart_ops univ8250_port_ops; =20 static const struct uart_8250_ops univ8250_driver_ops =3D { .setup_irq =3D univ8250_setup_irq, @@ -411,85 +333,12 @@ struct uart_8250_port *serial8250_get_port(int line) } EXPORT_SYMBOL_GPL(serial8250_get_port); =20 -static void (*serial8250_isa_config)(int port, struct uart_port *up, - u32 *capabilities); - -void serial8250_set_isa_configurator( - void (*v)(int port, struct uart_port *up, u32 *capabilities)) -{ - serial8250_isa_config =3D v; -} -EXPORT_SYMBOL(serial8250_set_isa_configurator); - -#ifdef CONFIG_SERIAL_8250_RSA - -static void univ8250_config_port(struct uart_port *port, int flags) -{ - struct uart_8250_port *up =3D up_to_u8250p(port); - - up->probe &=3D ~UART_PROBE_RSA; - if (port->type =3D=3D PORT_RSA) { - if (serial8250_request_rsa_resource(up) =3D=3D 0) - up->probe |=3D UART_PROBE_RSA; - } else if (flags & UART_CONFIG_TYPE) { - int i; - - for (i =3D 0; i < probe_rsa_count; i++) { - if (probe_rsa[i] =3D=3D up->port.iobase) { - if (serial8250_request_rsa_resource(up) =3D=3D 0) - up->probe |=3D UART_PROBE_RSA; - break; - } - } - } - - base_ops->config_port(port, flags); - - if (port->type !=3D PORT_RSA && up->probe & UART_PROBE_RSA) - serial8250_release_rsa_resource(up); -} - -static int univ8250_request_port(struct uart_port *port) -{ - struct uart_8250_port *up =3D up_to_u8250p(port); - int ret; - - ret =3D base_ops->request_port(port); - if (ret =3D=3D 0 && port->type =3D=3D PORT_RSA) { - ret =3D serial8250_request_rsa_resource(up); - if (ret < 0) - base_ops->release_port(port); - } - - return ret; -} - -static void univ8250_release_port(struct uart_port *port) -{ - struct uart_8250_port *up =3D up_to_u8250p(port); - - if (port->type =3D=3D PORT_RSA) - serial8250_release_rsa_resource(up); - base_ops->release_port(port); -} - -static void univ8250_rsa_support(struct uart_ops *ops) -{ - ops->config_port =3D univ8250_config_port; - ops->request_port =3D univ8250_request_port; - ops->release_port =3D univ8250_release_port; -} - -#else -#define univ8250_rsa_support(x) do { } while (0) -#endif /* CONFIG_SERIAL_8250_RSA */ - static inline void serial8250_apply_quirks(struct uart_8250_port *up) { up->port.quirks |=3D skip_txen_test ? UPQ_NO_TXEN_TEST : 0; } =20 -static struct uart_8250_port *serial8250_setup_port(int index) +struct uart_8250_port *serial8250_setup_port(int index) { struct uart_8250_port *up; =20 @@ -501,8 +350,8 @@ static struct uart_8250_port *serial8250_setup_port(int= index) up->port.port_id =3D index; =20 serial8250_init_port(up); - if (!base_ops) - base_ops =3D up->port.ops; + if (!univ8250_port_base_ops) + univ8250_port_base_ops =3D up->port.ops; up->port.ops =3D &univ8250_port_ops; =20 timer_setup(&up->timer, serial8250_timeout, 0); @@ -514,57 +363,7 @@ static struct uart_8250_port *serial8250_setup_port(in= t index) return up; } =20 -static void __init serial8250_isa_init_ports(void) -{ - struct uart_8250_port *up; - static int first =3D 1; - int i, irqflag =3D 0; - - if (!first) - return; - first =3D 0; - - if (nr_uarts > UART_NR) - nr_uarts =3D UART_NR; - - /* - * Set up initial isa ports based on nr_uart module param, or else - * default to CONFIG_SERIAL_8250_RUNTIME_UARTS. Note that we do not - * need to increase nr_uarts when setting up the initial isa ports. - */ - for (i =3D 0; i < nr_uarts; i++) - serial8250_setup_port(i); - - /* chain base port ops to support Remote Supervisor Adapter */ - univ8250_port_ops =3D *base_ops; - univ8250_rsa_support(&univ8250_port_ops); - - if (share_irqs) - irqflag =3D IRQF_SHARED; - - for (i =3D 0, up =3D serial8250_ports; - i < ARRAY_SIZE(old_serial_port) && i < nr_uarts; - i++, up++) { - struct uart_port *port =3D &up->port; - - port->iobase =3D old_serial_port[i].port; - port->irq =3D irq_canonicalize(old_serial_port[i].irq); - port->irqflags =3D 0; - port->uartclk =3D old_serial_port[i].baud_base * 16; - port->flags =3D old_serial_port[i].flags; - port->hub6 =3D 0; - port->membase =3D old_serial_port[i].iomem_base; - port->iotype =3D old_serial_port[i].io_type; - port->regshift =3D old_serial_port[i].iomem_reg_shift; - - port->irqflags |=3D irqflag; - if (serial8250_isa_config !=3D NULL) - serial8250_isa_config(i, &up->port, &up->capabilities); - } -} - -static void __init -serial8250_register_ports(struct uart_driver *drv, struct device *dev) +void __init serial8250_register_ports(struct uart_driver *drv, struct devi= ce *dev) { int i; =20 @@ -721,7 +520,7 @@ console_initcall(univ8250_console_init); #define SERIAL8250_CONSOLE NULL #endif =20 -static struct uart_driver serial8250_reg =3D { +struct uart_driver serial8250_reg =3D { .owner =3D THIS_MODULE, .driver_name =3D "serial", .dev_name =3D "ttyS", @@ -822,120 +621,6 @@ void serial8250_resume_port(int line) } EXPORT_SYMBOL(serial8250_resume_port); =20 -/* - * Register a set of serial devices attached to a platform device. The - * list is terminated with a zero flags entry, which means we expect - * all entries to have at least UPF_BOOT_AUTOCONF set. - */ -static int serial8250_probe(struct platform_device *dev) -{ - struct plat_serial8250_port *p =3D dev_get_platdata(&dev->dev); - struct uart_8250_port uart; - int ret, i, irqflag =3D 0; - - memset(&uart, 0, sizeof(uart)); - - if (share_irqs) - irqflag =3D IRQF_SHARED; - - for (i =3D 0; p && p->flags !=3D 0; p++, i++) { - uart.port.iobase =3D p->iobase; - uart.port.membase =3D p->membase; - uart.port.irq =3D p->irq; - uart.port.irqflags =3D p->irqflags; - uart.port.uartclk =3D p->uartclk; - uart.port.regshift =3D p->regshift; - uart.port.iotype =3D p->iotype; - uart.port.flags =3D p->flags; - uart.port.mapbase =3D p->mapbase; - uart.port.mapsize =3D p->mapsize; - uart.port.hub6 =3D p->hub6; - uart.port.has_sysrq =3D p->has_sysrq; - uart.port.private_data =3D p->private_data; - uart.port.type =3D p->type; - uart.bugs =3D p->bugs; - uart.port.serial_in =3D p->serial_in; - uart.port.serial_out =3D p->serial_out; - uart.dl_read =3D p->dl_read; - uart.dl_write =3D p->dl_write; - uart.port.handle_irq =3D p->handle_irq; - uart.port.handle_break =3D p->handle_break; - uart.port.set_termios =3D p->set_termios; - uart.port.set_ldisc =3D p->set_ldisc; - uart.port.get_mctrl =3D p->get_mctrl; - uart.port.pm =3D p->pm; - uart.port.dev =3D &dev->dev; - uart.port.irqflags |=3D irqflag; - ret =3D serial8250_register_8250_port(&uart); - if (ret < 0) { - dev_err(&dev->dev, "unable to register port at index %d " - "(IO%lx MEM%llx IRQ%d): %d\n", i, - p->iobase, (unsigned long long)p->mapbase, - p->irq, ret); - } - } - return 0; -} - -/* - * Remove serial ports registered against a platform device. - */ -static void serial8250_remove(struct platform_device *dev) -{ - int i; - - for (i =3D 0; i < nr_uarts; i++) { - struct uart_8250_port *up =3D &serial8250_ports[i]; - - if (up->port.dev =3D=3D &dev->dev) - serial8250_unregister_port(i); - } -} - -static int serial8250_suspend(struct platform_device *dev, pm_message_t st= ate) -{ - int i; - - for (i =3D 0; i < UART_NR; i++) { - struct uart_8250_port *up =3D &serial8250_ports[i]; - - if (up->port.type !=3D PORT_UNKNOWN && up->port.dev =3D=3D &dev->dev) - uart_suspend_port(&serial8250_reg, &up->port); - } - - return 0; -} - -static int serial8250_resume(struct platform_device *dev) -{ - int i; - - for (i =3D 0; i < UART_NR; i++) { - struct uart_8250_port *up =3D &serial8250_ports[i]; - - if (up->port.type !=3D PORT_UNKNOWN && up->port.dev =3D=3D &dev->dev) - serial8250_resume_port(i); - } - - return 0; -} - -static struct platform_driver serial8250_isa_driver =3D { - .probe =3D serial8250_probe, - .remove_new =3D serial8250_remove, - .suspend =3D serial8250_suspend, - .resume =3D serial8250_resume, - .driver =3D { - .name =3D "serial8250", - }, -}; - -/* - * This "device" covers _all_ ISA 8250-compatible serial devices listed - * in the table in include/asm/serial.h - */ -static struct platform_device *serial8250_isa_devs; - /* * serial8250_register_8250_port and serial8250_unregister_port allows for * 16x50 serial ports to be configured at run-time, to support PCMCIA @@ -1212,134 +897,5 @@ void serial8250_unregister_port(int line) } EXPORT_SYMBOL(serial8250_unregister_port); =20 -static int __init serial8250_init(void) -{ - int ret; - - if (nr_uarts =3D=3D 0) - return -ENODEV; - - serial8250_isa_init_ports(); - - pr_info("Serial: 8250/16550 driver, %d ports, IRQ sharing %s\n", - nr_uarts, str_enabled_disabled(share_irqs)); - -#ifdef CONFIG_SPARC - ret =3D sunserial_register_minors(&serial8250_reg, UART_NR); -#else - serial8250_reg.nr =3D UART_NR; - ret =3D uart_register_driver(&serial8250_reg); -#endif - if (ret) - goto out; - - ret =3D serial8250_pnp_init(); - if (ret) - goto unreg_uart_drv; - - serial8250_isa_devs =3D platform_device_alloc("serial8250", - PLAT8250_DEV_LEGACY); - if (!serial8250_isa_devs) { - ret =3D -ENOMEM; - goto unreg_pnp; - } - - ret =3D platform_device_add(serial8250_isa_devs); - if (ret) - goto put_dev; - - serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); - - ret =3D platform_driver_register(&serial8250_isa_driver); - if (ret =3D=3D 0) - goto out; - - platform_device_del(serial8250_isa_devs); -put_dev: - platform_device_put(serial8250_isa_devs); -unreg_pnp: - serial8250_pnp_exit(); -unreg_uart_drv: -#ifdef CONFIG_SPARC - sunserial_unregister_minors(&serial8250_reg, UART_NR); -#else - uart_unregister_driver(&serial8250_reg); -#endif -out: - return ret; -} - -static void __exit serial8250_exit(void) -{ - struct platform_device *isa_dev =3D serial8250_isa_devs; - - /* - * This tells serial8250_unregister_port() not to re-register - * the ports (thereby making serial8250_isa_driver permanently - * in use.) - */ - serial8250_isa_devs =3D NULL; - - platform_driver_unregister(&serial8250_isa_driver); - platform_device_unregister(isa_dev); - - serial8250_pnp_exit(); - -#ifdef CONFIG_SPARC - sunserial_unregister_minors(&serial8250_reg, UART_NR); -#else - uart_unregister_driver(&serial8250_reg); -#endif -} - -module_init(serial8250_init); -module_exit(serial8250_exit); - MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 serial driver"); - -module_param_hw(share_irqs, uint, other, 0644); -MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices= (unsafe)"); - -module_param(nr_uarts, uint, 0644); -MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODU= LE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")"); - -module_param(skip_txen_test, uint, 0644); -MODULE_PARM_DESC(skip_txen_test, "Skip checking for the TXEN bug at init t= ime"); - -#ifdef CONFIG_SERIAL_8250_RSA -module_param_hw_array(probe_rsa, ulong, ioport, &probe_rsa_count, 0444); -MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); -#endif -MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); - -#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS -#ifndef MODULE -/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name - * working as well for the module options so we don't break people. We - * need to keep the names identical and the convenient macros will happily - * refuse to let us do that by failing the build with redefinition errors - * of global variables. So we stick them inside a dummy function to avoid - * those conflicts. The options still get parsed, and the redefined - * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. - * - * This is hacky. I'm sorry. - */ -static void __used s8250_options(void) -{ -#undef MODULE_PARAM_PREFIX -#define MODULE_PARAM_PREFIX "8250_core." - - module_param_cb(share_irqs, ¶m_ops_uint, &share_irqs, 0644); - module_param_cb(nr_uarts, ¶m_ops_uint, &nr_uarts, 0644); - module_param_cb(skip_txen_test, ¶m_ops_uint, &skip_txen_test, 0644); -#ifdef CONFIG_SERIAL_8250_RSA - __module_param_call(MODULE_PARAM_PREFIX, probe_rsa, - ¶m_array_ops, .arr =3D &__param_arr_probe_rsa, - 0444, -1, 0); -#endif -} -#else -MODULE_ALIAS("8250_core"); -#endif -#endif diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8= 250/8250_platform.c index ded985182e04a..4664dbbf26def 100644 --- a/drivers/tty/serial/8250/8250_platform.c +++ b/drivers/tty/serial/8250/8250_platform.c @@ -17,7 +17,6 @@ #include #endif =20 -#include "../serial_base.h" /* For serial_base_add_isa_preferred_console()= */ #include "8250.h" =20 /* @@ -97,8 +96,6 @@ void __init serial8250_isa_init_ports(void) port->irqflags |=3D irqflag; if (serial8250_isa_config !=3D NULL) serial8250_isa_config(i, &up->port, &up->capabilities); - - serial_base_add_isa_preferred_console(serial8250_reg.dev_name, i); } } =20 --DC1J995vhGFiO/gP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5sMAACgkQJNaLcl1U h9Ajugf5AQOGHw5WqhGFjoWp4tnBFTq8Bx0ZGHjGjIs8BSdJiV6G1BH6DjzEK+SN b9NNjGW+Zi94CL6Q4Ai8kttAaAHa3fMDGCWpQK5y2K/QkCxQbzYTxa0Fms+pOjnu wezp4lWNUlOz7S+CchgKVcL6xSH+jfhmkuTIt1Frjjkwe+zfgOZ0mRYX+YajezeH 6rQH4l4EHwc9knS7u4SUNTUzG/lmQExEuP/01Pcmupworgbutx8rGl8IQ33Jf7Hr 2XKQ8YzPbZ4L3ITSOSI8Afq3oyJMiEN1nA/07B2yhDse/FeSeaqXgFx1zjCIcHsB gvPpqx9kPc0YWBMBu+NpkEEhlqqeiw== =AMS7 -----END PGP SIGNATURE----- --DC1J995vhGFiO/gP-- . X-Envelope-To: jic23@kernel.org X-Envelope-To: jdelvare@suse.com X-Envelope-To: linux@roeck-us.net X-Envelope-To: linux-iio@vger.kernel.org X-Envelope-To: linux-hwmon@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: lars@metafoo.de X-Envelope-To: sean.anderson@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson To: Jonathan Cameron , Jean Delvare , Guenter Roeck , linux-iio@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Lars-Peter Clausen , Sean Anderson Subject: [PATCH v2 0/2] hwmon: iio: Add labels Date: Mon, 24 Jun 2024 13:45:59 -0400 Message-Id: <20240624174601.1527244-1-sean.anderson@linux.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257220 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-hwmon,org.kernel.vger.linux-iio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add support for using IIO channel labels for HWMON labels. Changes in v2: - Check if the label exists before creating the attribute Sean Anderson (2): iio: Add iio_read_channel_label to inkern API hwmon: iio: Add labels from IIO channels drivers/hwmon/iio_hwmon.c | 45 +++++++++++++++++++++++++++++---- drivers/iio/iio_core.h | 4 +++ drivers/iio/industrialio-core.c | 23 ++++++++++------- drivers/iio/inkern.c | 6 +++++ include/linux/iio/consumer.h | 10 ++++++++ 5 files changed, 74 insertions(+), 14 deletions(-) -- 2.35.1.1320.gc452695387.dirty . From: yskelg@gmail.com To: "Michael S . Tsirkin" , Jason Wang , Xuan Zhuo , =?UTF-8?q?Eugenio=20P=C3=A9rez?= Cc: Austin Kim , MichelleJin , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, Yunseong Kim Subject: [PATCH RESEND v2] tools/virtio: creating pipe assertion in vringh_test Date: Tue, 25 Jun 2024 02:49:06 +0900 Message-ID: <20240624174905.27980-2-yskelg@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257230 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.virtualization Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Yunseong Kim parallel_test() function in vringh_test needs to verify the creation of the guest/host pipe. Signed-off-by: Yunseong Kim --- tools/virtio/vringh_test.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index 98ff808d6f0c..43d3a6aa1dcf 100644 --- a/tools/virtio/vringh_test.c +++ b/tools/virtio/vringh_test.c @@ -139,7 +139,7 @@ static int parallel_test(u64 features, bool fast_vringh) { void *host_map, *guest_map; - int fd, mapsize, to_guest[2], to_host[2]; + int pipe_ret, fd, mapsize, to_guest[2], to_host[2]; unsigned long xfers = 0, notifies = 0, receives = 0; unsigned int first_cpu, last_cpu; cpu_set_t cpu_set; @@ -161,8 +161,11 @@ static int parallel_test(u64 features, host_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); guest_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - pipe(to_guest); - pipe(to_host); + pipe_ret = pipe(to_guest); + assert(!pipe_ret); + + pipe_ret = pipe(to_host); + assert(!pipe_ret); CPU_ZERO(&cpu_set); find_cpus(&first_cpu, &last_cpu); -- 2.45.2 . From: Danielle Ratson To: CC: , , , , , , , , , , , , , , , , , , , , , Danielle Ratson Subject: [PATCH net-next v7 0/9] Add ability to flash modules' firmware Date: Mon, 24 Jun 2024 20:51:50 +0300 Message-ID: <20240624175201.130522-1-danieller@nvidia.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257234 org.kernel.vger.netdev:354901 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-doc,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail CMIS compliant modules such as QSFP-DD might be running a firmware that can be updated in a vendor-neutral way by exchanging messages between the host and the module as described in section 7.2.2 of revision 4.0 of the CMIS standard. According to the CMIS standard, the firmware update process is done using a CDB commands sequence. CDB (Command Data Block Message Communication) reads and writes are performed on memory map pages 9Fh-AFh according to the CMIS standard, section 8.12 of revision 4.0. Add a pair of new ethtool messages that allow: * User space to trigger firmware update of transceiver modules * The kernel to notify user space about the progress of the process The user interface is designed to be asynchronous in order to avoid RTNL being held for too long and to allow several modules to be updated simultaneously. The interface is designed with CMIS compliant modules in mind, but kept generic enough to accommodate future use cases, if these arise. The kernel interface that will implement the firmware update using CDB command will include 2 layers that will be added under ethtool: * The upper layer that will be triggered from the module layer, is cmis_ fw_update. * The lower one is cmis_cdb. In the future there might be more operations to implement using CDB commands. Therefore, the idea is to keep the cmis_cdb interface clean and the cmis_fw_update specific to the cdb commands handling it. The communication between the kernel and the driver will be done using two ethtool operations that enable reading and writing the transceiver module EEPROM. The operation ethtool_ops::get_module_eeprom_by_page, that is already implemented, will be used for reading from the EEPROM the CDB reply, e.g. reading module setting, state, etc. The operation ethtool_ops::set_module_eeprom_by_page, that is added in the current patchset, will be used for writing to the EEPROM the CDB command such as start firmware image, run firmware image, etc. Therefore in order for a driver to implement module flashing, that driver needs to implement the two functions mentioned above. Patchset overview: Patch #1-#2: Implement the EEPROM writing in mlxsw. Patch #3: Define the interface between the kernel and user space. Patch #4: Add ability to notify the flashing firmware progress. Patch #5: Veto operations during flashing. Patch #6: Add extended compliance codes. Patch #7: Add the cdb layer. Patch #8: Add the fw_update layer. Patch #9: Add ability to flash transceiver modules' firmware. v7: Patch #4: * Return -ENOMEM instead of PTR_ERR(attr) on ethnl_module_fw_flash_ntf_put_err(). Patch #9: * Fix Warning for not unlocking the spin_lock in the error flow on module_flash_fw_work_list_add(). * Avoid the fall-through on ethnl_sock_priv_destroy(). v6: * Squash some of the last patch to patch #5 and patch #9. Patch #3: * Add paragraph in .rst file. Patch #4: * Reserve '1' more place on SKB for NUL terminator in the error message string. * Add more prints on error flow, re-write the printing function and add ethnl_module_fw_flash_ntf_put_err(). * Change the communication method so notification will be sent in unicast instead of multicast. * Add new 'struct ethnl_module_fw_flash_ntf_params' that holds the relevant info for unicast communication and use it to send notification to the specific socket. * s/nla_put_u64_64bit/nla_put_uint/ Patch #7: * In ethtool_cmis_cdb_init(), Use 'const' for the 'params' parameter. Patch #8: * Add a list field to struct ethtool_module_fw_flash for module_fw_flash_work_list that will be presented in the next patch. * Move ethtool_cmis_fw_update() cleaning to a new function that will be represented in the next patch. * Move some of the fields in struct ethtool_module_fw_flash to a separate struct, so ethtool_cmis_fw_update() will get only the relevant parameters for it. * Edit the relevant functions to get the relevant params for them. * s/CMIS_MODULE_READY_MAX_DURATION_USEC/CMIS_MODULE_READY_MAX_DURATION_MSEC Patch #9: * Add a paragraph in the commit message. * Rename labels in module_flash_fw_schedule(). * Add info to genl_sk_priv_*() and implement the relevant callbacks, in order to handle properly a scenario of closing the socket from user space before the work item was ended. * Add a list the holds all the ethtool_module_fw_flash struct that corresponds to the in progress work items. * Add a new enum for the socket types. * Use both above to identify a flashing socket, add it to the list and when closing socket affect only the flashing type. * Create a new function that will get the work item instead of ethtool_cmis_fw_update(). * Edit the relevant functions to get the relevant params for them. * The new function will call the old ethtool_cmis_fw_update(), and do the cleaning, so the existence of the list should be completely isolated in module.c. Danielle Ratson (7): ethtool: Add an interface for flashing transceiver modules' firmware ethtool: Add flashing transceiver modules' firmware notifications ability ethtool: Veto some operations during firmware flashing process net: sfp: Add more extended compliance codes ethtool: cmis_cdb: Add a layer for supporting CDB commands ethtool: cmis_fw_update: add a layer for supporting firmware update using CDB ethtool: Add ability to flash transceiver modules' firmware Ido Schimmel (2): ethtool: Add ethtool operation to write to a transceiver module EEPROM mlxsw: Implement ethtool operation to write to a transceiver module EEPROM Documentation/netlink/specs/ethtool.yaml | 55 ++ Documentation/networking/ethtool-netlink.rst | 70 +++ .../net/ethernet/mellanox/mlxsw/core_env.c | 57 ++ .../net/ethernet/mellanox/mlxsw/core_env.h | 6 + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 15 + .../mellanox/mlxsw/spectrum_ethtool.c | 15 + include/linux/ethtool.h | 20 +- include/linux/netdevice.h | 4 +- include/linux/sfp.h | 6 + include/uapi/linux/ethtool.h | 18 + include/uapi/linux/ethtool_netlink.h | 19 + net/ethtool/Makefile | 2 +- net/ethtool/cmis.h | 124 ++++ net/ethtool/cmis_cdb.c | 581 ++++++++++++++++++ net/ethtool/cmis_fw_update.c | 399 ++++++++++++ net/ethtool/eeprom.c | 6 + net/ethtool/ioctl.c | 12 + net/ethtool/module.c | 394 ++++++++++++ net/ethtool/module_fw.h | 75 +++ net/ethtool/netlink.c | 56 ++ net/ethtool/netlink.h | 16 + tools/net/ynl/Makefile.deps | 3 +- 22 files changed, 1942 insertions(+), 11 deletions(-) create mode 100644 net/ethtool/cmis.h create mode 100644 net/ethtool/cmis_cdb.c create mode 100644 net/ethtool/cmis_fw_update.c create mode 100644 net/ethtool/module_fw.h -- 2.45.0 . Date: Mon, 24 Jun 2024 18:55:15 +0100 From: Mark Brown To: William Breathitt Gray Cc: David Lechner , Linux Kernel Mailing List , Linux Next Mailing List Subject: linux-next: manual merge of the counter-next tree with the counter-current tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="40OqtuILxyApl9cd" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257243 org.kernel.vger.linux-next:61915 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --40OqtuILxyApl9cd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the counter-next tree got a conflict in: drivers/counter/ti-eqep.c between commit: 0cf81c73e4c6a ("counter: ti-eqep: enable clock at probe") =66rom the counter-current tree and commit: 1c30c6d024726 ("counter: ti-eqep: implement over/underflow events") =66rom the counter-next tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --cc drivers/counter/ti-eqep.c index 825ae22c3ebc7,9742ba9fc3072..0000000000000 --- a/drivers/counter/ti-eqep.c +++ b/drivers/counter/ti-eqep.c @@@ -6,8 -6,8 +6,9 @@@ */ =20 #include +#include #include + #include #include #include #include @@@ -377,8 -465,7 +466,8 @@@ static int ti_eqep_probe(struct platfor struct counter_device *counter; struct ti_eqep_cnt *priv; void __iomem *base; + struct clk *clk; - int err; + int err, irq; =20 counter =3D devm_counter_alloc(dev, sizeof(*priv)); if (!counter) --40OqtuILxyApl9cd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5swIACgkQJNaLcl1U h9AFVQgAgDJvCuLymRf+pSDaEA3ZixKP1r/fCMazx0wEx0iwce9qiKiW2yvGYRpq HiR3ZJCfbxzcyo6hF4iZoIyHW8Mz4wKUGrMTDSuceaMO1oWn50DSjj2kk3NeA7zY FTaI0UqJHVOiAkpiprgw9PgbYYaAzKFbFB6yRVdPTgacVnZMZET1jmOvJ46kicP6 vOu0JhmkKrhtxGYwiVs8auZLcDIJkrUO77Fj4JBm4VOA5k1S9wSOeX1h8av6xKFz eF7jYbs9zwe66mnhIgOaBHQV+7hXhzbxUqRebm/eZ4pm3jcKr9jAWQrfY0SqP1EJ ExTWa6APtc9StQiXYoSlh478IT92zQ== =Y+J7 -----END PGP SIGNATURE----- --40OqtuILxyApl9cd-- . From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] mm/damon/core: merge regions aggressively when max_nr_regions is unmet Date: Mon, 24 Jun 2024 10:58:14 -0700 Message-Id: <20240624175814.89611-1-sj@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257247 org.kvack.linux-mm:201160 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.damon,org.kernel.vger.stable,org.kvack.linux-mm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail DAMON keeps the number of regions under max_nr_regions by skipping regions split operations when doing so can make the number higher than the limit. It works well for preventing violation of the limit. But, if somehow the violation happens, it cannot recovery well depending on the situation. In detail, if the real number of regions having different access pattern is higher than the limit, the mechanism cannot reduce the number below the limit. In such a case, the system could suffer from high monitoring overhead of DAMON. The violation can actually happen. For an example, the user could reduce max_nr_regions while DAMON is running, to be lower than the current number of regions. Fix the problem by repeating the merge operations with increasing aggressiveness in kdamond_merge_regions() for the case, until the limit is met. Fixes: b9a6ac4e4ede ("mm/damon: adaptively adjust regions") Cc: # 5.15.x Signed-off-by: SeongJae Park --- mm/damon/core.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index f69250b68bcc..e6598c44b53c 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1694,14 +1694,30 @@ static void damon_merge_regions_of(struct damon_target *t, unsigned int thres, * access frequencies are similar. This is for minimizing the monitoring * overhead under the dynamically changeable access pattern. If a merge was * unnecessarily made, later 'kdamond_split_regions()' will revert it. + * + * The total number of regions could be temporarily higher than the + * user-defined limit, max_nr_regions for some cases. For an example, the user + * updates max_nr_regions to a number that lower than the current number of + * regions while DAMON is running. Depending on the access pattern, it could + * take indefinitve time to reduce the number below the limit. For such a + * case, repeat merging until the limit is met while increasing @threshold and + * @sz_limit. */ static void kdamond_merge_regions(struct damon_ctx *c, unsigned int threshold, unsigned long sz_limit) { struct damon_target *t; + unsigned int nr_regions; - damon_for_each_target(t, c) - damon_merge_regions_of(t, threshold, sz_limit); + do { + nr_regions = 0; + damon_for_each_target(t, c) { + damon_merge_regions_of(t, threshold, sz_limit); + nr_regions += damon_nr_regions(t); + } + threshold = max(1, threshold * 2); + sz_limit = max(1, sz_limit * 2); + } while (nr_regions > c->attrs.max_nr_regions); } /* -- 2.39.2 . Date: Tue, 25 Jun 2024 02:06:28 +0800 From: kernel test robot To: Jisheng Zhang Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner Subject: [tip:irq/core 41/49] drivers/irqchip/irq-dw-apb-ictl.c:33:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'dw_apb_ictl_handle_irq' Message-ID: <202406250214.WZEjWnnU-lkp@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257256 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.oe-kbuild-all Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi Jisheng, First bad commit (maybe != root cause): tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core head: f2605e1715dd28e8943b557453fed3a40421d3b5 commit: 7cc4f309c933ec5d64eea31066fe86bbf9e48819 [41/49] irqchip/dw-apb-ictl: Support building as module config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240625/202406250214.WZEjWnnU-lkp@intel.com/config) compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240625/202406250214.WZEjWnnU-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202406250214.WZEjWnnU-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/irqchip/irq-dw-apb-ictl.c:33:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'dw_apb_ictl_handle_irq' 33 | static void __irq_entry dw_apb_ictl_handle_irq(struct pt_regs *regs) | ^~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/irqchip/irq-dw-apb-ictl.c:15: drivers/irqchip/irq-dw-apb-ictl.c: In function 'dw_apb_ictl_init': >> drivers/irqchip/irq-dw-apb-ictl.c:206:32: error: 'dw_apb_ictl_handle_irq' undeclared (first use in this function); did you mean 'dw_apb_ictl_init'? 206 | set_handle_irq(dw_apb_ictl_handle_irq); | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/irq.h:1331:23: note: in definition of macro 'set_handle_irq' 1331 | (void)handle_irq; \ | ^~~~~~~~~~ drivers/irqchip/irq-dw-apb-ictl.c:206:32: note: each undeclared identifier is reported only once for each function it appears in 206 | set_handle_irq(dw_apb_ictl_handle_irq); | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/irq.h:1331:23: note: in definition of macro 'set_handle_irq' 1331 | (void)handle_irq; \ | ^~~~~~~~~~ vim +33 drivers/irqchip/irq-dw-apb-ictl.c 54a38440b84f89 Zhen Lei 2020-09-24 32 54a38440b84f89 Zhen Lei 2020-09-24 @33 static void __irq_entry dw_apb_ictl_handle_irq(struct pt_regs *regs) 54a38440b84f89 Zhen Lei 2020-09-24 34 { 54a38440b84f89 Zhen Lei 2020-09-24 35 struct irq_domain *d = dw_apb_ictl_irq_domain; 54a38440b84f89 Zhen Lei 2020-09-24 36 int n; 54a38440b84f89 Zhen Lei 2020-09-24 37 54a38440b84f89 Zhen Lei 2020-09-24 38 for (n = 0; n < d->revmap_size; n += 32) { 54a38440b84f89 Zhen Lei 2020-09-24 39 struct irq_chip_generic *gc = irq_get_domain_generic_chip(d, n); 54a38440b84f89 Zhen Lei 2020-09-24 40 u32 stat = readl_relaxed(gc->reg_base + APB_INT_FINALSTATUS_L); 54a38440b84f89 Zhen Lei 2020-09-24 41 54a38440b84f89 Zhen Lei 2020-09-24 42 while (stat) { 54a38440b84f89 Zhen Lei 2020-09-24 43 u32 hwirq = ffs(stat) - 1; 54a38440b84f89 Zhen Lei 2020-09-24 44 0953fb263714e1 Mark Rutland 2021-10-20 45 generic_handle_domain_irq(d, hwirq); 54a38440b84f89 Zhen Lei 2020-09-24 46 stat &= ~BIT(hwirq); 54a38440b84f89 Zhen Lei 2020-09-24 47 } 54a38440b84f89 Zhen Lei 2020-09-24 48 } 54a38440b84f89 Zhen Lei 2020-09-24 49 } 54a38440b84f89 Zhen Lei 2020-09-24 50 d59f7d15989146 Zhen Lei 2020-09-24 51 static void dw_apb_ictl_handle_irq_cascaded(struct irq_desc *desc) 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 52 { b66231183a8542 Thomas Gleixner 2015-07-06 53 struct irq_domain *d = irq_desc_get_handler_data(desc); b66231183a8542 Thomas Gleixner 2015-07-06 54 struct irq_chip *chip = irq_desc_get_chip(desc); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 55 int n; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 56 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 57 chained_irq_enter(chip, desc); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 58 b66231183a8542 Thomas Gleixner 2015-07-06 59 for (n = 0; n < d->revmap_size; n += 32) { b66231183a8542 Thomas Gleixner 2015-07-06 60 struct irq_chip_generic *gc = irq_get_domain_generic_chip(d, n); b66231183a8542 Thomas Gleixner 2015-07-06 61 u32 stat = readl_relaxed(gc->reg_base + APB_INT_FINALSTATUS_L); b66231183a8542 Thomas Gleixner 2015-07-06 62 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 63 while (stat) { 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 64 u32 hwirq = ffs(stat) - 1; 046a6ee2343bb2 Marc Zyngier 2021-05-04 65 generic_handle_domain_irq(d, gc->irq_base + hwirq); b66231183a8542 Thomas Gleixner 2015-07-06 66 d59f7d15989146 Zhen Lei 2020-09-24 67 stat &= ~BIT(hwirq); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 68 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 69 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 70 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 71 chained_irq_exit(chip, desc); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 72 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 73 54a38440b84f89 Zhen Lei 2020-09-24 74 static int dw_apb_ictl_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, 54a38440b84f89 Zhen Lei 2020-09-24 75 unsigned int nr_irqs, void *arg) 54a38440b84f89 Zhen Lei 2020-09-24 76 { 54a38440b84f89 Zhen Lei 2020-09-24 77 int i, ret; 54a38440b84f89 Zhen Lei 2020-09-24 78 irq_hw_number_t hwirq; 54a38440b84f89 Zhen Lei 2020-09-24 79 unsigned int type = IRQ_TYPE_NONE; 54a38440b84f89 Zhen Lei 2020-09-24 80 struct irq_fwspec *fwspec = arg; 54a38440b84f89 Zhen Lei 2020-09-24 81 54a38440b84f89 Zhen Lei 2020-09-24 82 ret = irq_domain_translate_onecell(domain, fwspec, &hwirq, &type); 54a38440b84f89 Zhen Lei 2020-09-24 83 if (ret) 54a38440b84f89 Zhen Lei 2020-09-24 84 return ret; 54a38440b84f89 Zhen Lei 2020-09-24 85 54a38440b84f89 Zhen Lei 2020-09-24 86 for (i = 0; i < nr_irqs; i++) 54a38440b84f89 Zhen Lei 2020-09-24 87 irq_map_generic_chip(domain, virq + i, hwirq + i); 54a38440b84f89 Zhen Lei 2020-09-24 88 54a38440b84f89 Zhen Lei 2020-09-24 89 return 0; 54a38440b84f89 Zhen Lei 2020-09-24 90 } 54a38440b84f89 Zhen Lei 2020-09-24 91 54a38440b84f89 Zhen Lei 2020-09-24 92 static const struct irq_domain_ops dw_apb_ictl_irq_domain_ops = { 54a38440b84f89 Zhen Lei 2020-09-24 93 .translate = irq_domain_translate_onecell, 54a38440b84f89 Zhen Lei 2020-09-24 94 .alloc = dw_apb_ictl_irq_domain_alloc, 54a38440b84f89 Zhen Lei 2020-09-24 95 .free = irq_domain_free_irqs_top, 54a38440b84f89 Zhen Lei 2020-09-24 96 }; 54a38440b84f89 Zhen Lei 2020-09-24 97 1655b0530d9502 Jisheng Zhang 2014-11-12 98 #ifdef CONFIG_PM 1655b0530d9502 Jisheng Zhang 2014-11-12 99 static void dw_apb_ictl_resume(struct irq_data *d) 1655b0530d9502 Jisheng Zhang 2014-11-12 100 { 1655b0530d9502 Jisheng Zhang 2014-11-12 101 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 1655b0530d9502 Jisheng Zhang 2014-11-12 102 struct irq_chip_type *ct = irq_data_get_chip_type(d); 1655b0530d9502 Jisheng Zhang 2014-11-12 103 1655b0530d9502 Jisheng Zhang 2014-11-12 104 irq_gc_lock(gc); 1655b0530d9502 Jisheng Zhang 2014-11-12 105 writel_relaxed(~0, gc->reg_base + ct->regs.enable); 1655b0530d9502 Jisheng Zhang 2014-11-12 106 writel_relaxed(*ct->mask_cache, gc->reg_base + ct->regs.mask); 1655b0530d9502 Jisheng Zhang 2014-11-12 107 irq_gc_unlock(gc); 1655b0530d9502 Jisheng Zhang 2014-11-12 108 } 1655b0530d9502 Jisheng Zhang 2014-11-12 109 #else 1655b0530d9502 Jisheng Zhang 2014-11-12 110 #define dw_apb_ictl_resume NULL 1655b0530d9502 Jisheng Zhang 2014-11-12 111 #endif /* CONFIG_PM */ 1655b0530d9502 Jisheng Zhang 2014-11-12 112 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 113 static int __init dw_apb_ictl_init(struct device_node *np, 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 114 struct device_node *parent) 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 115 { d59f7d15989146 Zhen Lei 2020-09-24 116 const struct irq_domain_ops *domain_ops; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 117 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 118 struct resource r; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 119 struct irq_domain *domain; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 120 struct irq_chip_generic *gc; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 121 void __iomem *iobase; d59f7d15989146 Zhen Lei 2020-09-24 122 int ret, nrirqs, parent_irq, i; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 123 u32 reg; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 124 7cc4f309c933ec Jisheng Zhang 2024-06-14 125 if (!parent && IS_BUILTIN(CONFIG_DW_APB_ICTL)) { 54a38440b84f89 Zhen Lei 2020-09-24 126 /* Used as the primary interrupt controller */ 54a38440b84f89 Zhen Lei 2020-09-24 127 parent_irq = 0; 54a38440b84f89 Zhen Lei 2020-09-24 128 domain_ops = &dw_apb_ictl_irq_domain_ops; 54a38440b84f89 Zhen Lei 2020-09-24 129 } else { 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 130 /* Map the parent interrupt for the chained handler */ d59f7d15989146 Zhen Lei 2020-09-24 131 parent_irq = irq_of_parse_and_map(np, 0); d59f7d15989146 Zhen Lei 2020-09-24 132 if (parent_irq <= 0) { e81f54c668d89e Rob Herring 2017-07-18 133 pr_err("%pOF: unable to parse irq\n", np); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 134 return -EINVAL; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 135 } 54a38440b84f89 Zhen Lei 2020-09-24 136 domain_ops = &irq_generic_chip_ops; 54a38440b84f89 Zhen Lei 2020-09-24 137 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 138 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 139 ret = of_address_to_resource(np, 0, &r); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 140 if (ret) { e81f54c668d89e Rob Herring 2017-07-18 141 pr_err("%pOF: unable to get resource\n", np); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 142 return ret; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 143 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 144 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 145 if (!request_mem_region(r.start, resource_size(&r), np->full_name)) { e81f54c668d89e Rob Herring 2017-07-18 146 pr_err("%pOF: unable to request mem region\n", np); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 147 return -ENOMEM; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 148 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 149 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 150 iobase = ioremap(r.start, resource_size(&r)); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 151 if (!iobase) { e81f54c668d89e Rob Herring 2017-07-18 152 pr_err("%pOF: unable to map resource\n", np); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 153 ret = -ENOMEM; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 154 goto err_release; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 155 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 156 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 157 /* 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 158 * DW IP can be configured to allow 2-64 irqs. We can determine 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 159 * the number of irqs supported by writing into enable register 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 160 * and look for bits not set, as corresponding flip-flops will c5f48c0a7aa1a8 Ingo Molnar 2018-12-03 161 * have been removed by synthesis tool. 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 162 */ 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 163 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 164 /* mask and enable all interrupts */ 8876ce7d1cbaca Jisheng Zhang 2014-11-12 165 writel_relaxed(~0, iobase + APB_INT_MASK_L); 8876ce7d1cbaca Jisheng Zhang 2014-11-12 166 writel_relaxed(~0, iobase + APB_INT_MASK_H); 8876ce7d1cbaca Jisheng Zhang 2014-11-12 167 writel_relaxed(~0, iobase + APB_INT_ENABLE_L); 8876ce7d1cbaca Jisheng Zhang 2014-11-12 168 writel_relaxed(~0, iobase + APB_INT_ENABLE_H); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 169 8876ce7d1cbaca Jisheng Zhang 2014-11-12 170 reg = readl_relaxed(iobase + APB_INT_ENABLE_H); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 171 if (reg) 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 172 nrirqs = 32 + fls(reg); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 173 else 8876ce7d1cbaca Jisheng Zhang 2014-11-12 174 nrirqs = fls(readl_relaxed(iobase + APB_INT_ENABLE_L)); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 175 d59f7d15989146 Zhen Lei 2020-09-24 176 domain = irq_domain_add_linear(np, nrirqs, domain_ops, NULL); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 177 if (!domain) { e81f54c668d89e Rob Herring 2017-07-18 178 pr_err("%pOF: unable to add irq domain\n", np); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 179 ret = -ENOMEM; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 180 goto err_unmap; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 181 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 182 b66231183a8542 Thomas Gleixner 2015-07-06 183 ret = irq_alloc_domain_generic_chips(domain, 32, 1, np->name, b66231183a8542 Thomas Gleixner 2015-07-06 184 handle_level_irq, clr, 0, 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 185 IRQ_GC_INIT_MASK_CACHE); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 186 if (ret) { e81f54c668d89e Rob Herring 2017-07-18 187 pr_err("%pOF: unable to alloc irq domain gc\n", np); 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 188 goto err_unmap; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 189 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 190 b66231183a8542 Thomas Gleixner 2015-07-06 191 for (i = 0; i < DIV_ROUND_UP(nrirqs, 32); i++) { b66231183a8542 Thomas Gleixner 2015-07-06 192 gc = irq_get_domain_generic_chip(domain, i * 32); b66231183a8542 Thomas Gleixner 2015-07-06 193 gc->reg_base = iobase + i * APB_INT_BASE_OFFSET; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 194 gc->chip_types[0].regs.mask = APB_INT_MASK_L; 1655b0530d9502 Jisheng Zhang 2014-11-12 195 gc->chip_types[0].regs.enable = APB_INT_ENABLE_L; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 196 gc->chip_types[0].chip.irq_mask = irq_gc_mask_set_bit; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 197 gc->chip_types[0].chip.irq_unmask = irq_gc_mask_clr_bit; 1655b0530d9502 Jisheng Zhang 2014-11-12 198 gc->chip_types[0].chip.irq_resume = dw_apb_ictl_resume; 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 199 } 350d71b94fc9ed Sebastian Hesselbarth 2013-09-09 200 54a38440b84f89 Zhen Lei 2020-09-24 201 if (parent_irq) { d59f7d15989146 Zhen Lei 2020-09-24 202 irq_set_chained_handler_and_data(parent_irq, d59f7d15989146 Zhen Lei 2020-09-24 203 dw_apb_ictl_handle_irq_cascaded, domain); 54a38440b84f89 Zhen Lei 2020-09-24 204 } else { 54a38440b84f89 Zhen Lei 2020-09-24 205 dw_apb_ictl_irq_domain = domain; 54a38440b84f89 Zhen Lei 2020-09-24 @206 set_handle_irq(dw_apb_ictl_handle_irq); :::::: The code at line 33 was first introduced by commit :::::: 54a38440b84f8933b555c23273deca6a396f6708 irqchip/dw-apb-ictl: Add primary interrupt controller support :::::: TO: Zhen Lei :::::: CC: Marc Zyngier -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki . From: Howard Chu To: acme@kernel.org Cc: adrian.hunter@intel.com, irogers@google.com, jolsa@kernel.org, kan.liang@linux.intel.com, namhyung@kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/8] perf trace: Augment enum arguments with BTF Date: Tue, 25 Jun 2024 02:13:37 +0800 Message-ID: <20240624181345.124764-1-howardchu95@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257260 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail In this patch, BTF is used to turn enum value to the corresponding enum variable name. There is only one system call that uses enum value as its argument, that is `landlock_add_rule()`. Enum arguments of non-syscall tracepoints can also be augmented, for instance timer:hrtimer_start and timer:hrtimer_init's 'mode' argument. Changes in v3: - Add trace__btf_scnprintf() helper function - Remove is_enum memeber in struct syscall_arg_fmt, replace it with btf_is_enum() - Add syscall_arg_fmt__cache_btf_enum() to cache btf_type only - Resolve NO_LIBBPF=1 build error - Skip BTF augmentation test if landlock_add_rule syscall and LIBBPF are not available - Rename landlock.c workload, add a comment to landlock.c workload - Change the way of skipping 'enum ' prefix - Add type_name member to struct syscall_arg Changes in v2: - Add trace_btf_enum regression test, and landlock workload Arnaldo Carvalho de Melo (2): perf trace: Introduce trace__btf_scnprintf() perf trace: Remove arg_fmt->is_enum, we can get that from the BTF type Howard Chu (6): perf trace: Fix iteration of syscall ids in syscalltbl->entries perf trace: BTF-based enum pretty printing for syscall args perf trace: Augment non-syscall tracepoints with enum arguments with BTF perf trace: Filter enum arguments with enum names perf test: Add landlock workload perf test trace_btf_enum: Add regression test for the BTF augmentation of enums in 'perf trace' tools/perf/builtin-trace.c | 229 ++++++++++++++++++++--- tools/perf/tests/builtin-test.c | 1 + tools/perf/tests/shell/trace_btf_enum.sh | 61 ++++++ tools/perf/tests/tests.h | 1 + tools/perf/tests/workloads/Build | 1 + tools/perf/tests/workloads/landlock.c | 39 ++++ tools/perf/trace/beauty/beauty.h | 1 + tools/perf/util/syscalltbl.c | 7 + tools/perf/util/syscalltbl.h | 1 + 9 files changed, 317 insertions(+), 24 deletions(-) create mode 100755 tools/perf/tests/shell/trace_btf_enum.sh create mode 100644 tools/perf/tests/workloads/landlock.c -- 2.45.2 . Date: Mon, 24 Jun 2024 19:23:36 +0100 From: Mark Brown To: Greg KH , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Niklas =?iso-8859-1?Q?S=F6derlund?= , Andrew Lunn , "David S. Miller" Cc: Linux Kernel Mailing List , Linux Next Mailing List Subject: linux-next: build failure after merge of the driver-core tree Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fnI7Duvj7Pn/WS/q" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257281 org.kernel.vger.linux-next:61918 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --fnI7Duvj7Pn/WS/q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, After merging the driver-core tree, today's linux-next build (x86_64 allmodconfig) failed like this: /tmp/next/build/drivers/net/ethernet/renesas/rtsn.c:1381:27: error: initial= ization of 'void (*)(struct platform_device *)' from incompatible pointer t= ype 'int (*)(struct platform_device *)' [-Werror=3Dincompatible-pointer-typ= es] 1381 | .remove =3D rtsn_remove, | ^~~~~~~~~~~ /tmp/next/build/drivers/net/ethernet/renesas/rtsn.c:1381:27: note: (near in= itialization for 'rtsn_driver..remove') Caused by commit 0edb555a65d1e ("platform: Make platform_driver::remove() return void") interacting with b0d3969d2b4db ("net: ethernet: rtsn: Add support for Renesas Ethernet-TSN= ") I have applied the below patch. =46rom 8f276c3b5b1be09214cbd5643dd4fe4b2e6c692f Mon Sep 17 00:00:00 2001 =46rom: Mark Brown Date: Mon, 24 Jun 2024 19:02:24 +0100 Subject: [PATCH] net: ethernet: rtsn: Fix up for remove() coversion to retu= rn void Fixes: 0edb555a65d1e ("platform: Make platform_driver::remove() return void= ") Signed-off-by: Mark Brown --- drivers/net/ethernet/renesas/rtsn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/renesas/rtsn.c b/drivers/net/ethernet/ren= esas/rtsn.c index ad69d47463cbd..5a6cc99e6b35a 100644 --- a/drivers/net/ethernet/renesas/rtsn.c +++ b/drivers/net/ethernet/renesas/rtsn.c @@ -1358,7 +1358,7 @@ static int rtsn_probe(struct platform_device *pdev) return ret; } =20 -static int rtsn_remove(struct platform_device *pdev) +static void rtsn_remove(struct platform_device *pdev) { struct rtsn_private *priv =3D platform_get_drvdata(pdev); =20 @@ -1372,8 +1372,6 @@ static int rtsn_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); =20 free_netdev(priv->ndev); - - return 0; } =20 static struct platform_driver rtsn_driver =3D { --=20 2.39.2 --fnI7Duvj7Pn/WS/q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5uagACgkQJNaLcl1U h9AI0Qf/eLVgpyAXif2IQX/J4c88dt/Cfea1xezgjF5IjoBQYowjP4ytp/kwxLZN LtXjsESKx6vyPCtCSTPetqut9lo1mElbIubtSCXiODNIKxRdE3azseqTXqI8Di6K Z+6SQF04dDZPjwQzMsuhSnN+GfZyqrVnLIjDneemzf0uEBjuMfva0Go5WdpIF6Qp 7zaftKbpBcCP3BGFiJFkBOZq74Q4ENgEbcmN83EhSNTQ7ev9Hly+qAJKbXeYa/g7 JwkUdgwIflaQHEOJkMW85AVICjDToXJ/7wFEhHMA/4xVtP9hXZZXLuQ1V69zlmCH vdBYjcSBNyq4/tWeSaIUHAliAc0exg== =bvVu -----END PGP SIGNATURE----- --fnI7Duvj7Pn/WS/q-- . Return-Path: From: SeongJae Park To: Jonathan Corbet Cc: SeongJae Park , Albert Ou , Alex Shi , Avadhut Naik , Bill Wendling , Carlos Bilbao , Federico Vaga , Hu Haowen <2023002089@link.tyut.edu.cn>, Justin Stitt , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Palmer Dabbelt , Paul Walmsley , Yanteng Si , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, workflows@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/7] minor document fixups Date: Mon, 24 Jun 2024 11:53:05 -0700 Message-Id: <20240624185312.94537-1-sj@kernel.org> MIME-Version: 1.0 X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Xref: photonic.trudheim.com org.infradead.lists.linux-riscv:78948 org.kernel.vger.linux-kernel:1257293 Newsgroups: org.infradead.lists.linux-riscv,dev.linux.lists.llvm,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.workflows Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch series is for minor document fixups. First five patches clean up and remove 'Other material' section of process/index in favor of 'staging/' and better place for docs on the section. A patch for adding DAMON maintainer-profile reference on maintainers' handbook follows. And then the last patch adds 'hkml' as one of available email tools on email-clients document. SeongJae Park (7): Docs/process/index: Remove unaligned-memory-access from 'Other material' Docs/process/index: Remove riscv/patch-acceptance from 'Other material' section Docs: Move magic-number from process to staging Docs: Move clang-format from process/ to dev-tools/ Docs/process/index: Remove unsorted docs section Docs/maintainer/maintainer-entry-profile: add DAMON maintainer profile Docs/process/email-clients: Document HacKerMaiL .clang-format | 2 +- Documentation/{process => dev-tools}/clang-format.rst | 0 Documentation/dev-tools/index.rst | 1 + Documentation/maintainer/maintainer-entry-profile.rst | 1 + Documentation/process/4.Coding.rst | 2 +- Documentation/process/coding-style.rst | 2 +- Documentation/process/email-clients.rst | 9 +++++++++ Documentation/process/index.rst | 11 ----------- Documentation/staging/index.rst | 1 + Documentation/{process => staging}/magic-number.rst | 0 .../translations/it_IT/process/clang-format.rst | 2 +- .../translations/it_IT/process/magic-number.rst | 2 +- .../translations/sp_SP/process/coding-style.rst | 2 +- .../translations/sp_SP/process/magic-number.rst | 2 +- Documentation/translations/zh_CN/process/4.Coding.rst | 2 +- .../translations/zh_CN/process/coding-style.rst | 2 +- .../translations/zh_CN/process/magic-number.rst | 2 +- Documentation/translations/zh_TW/process/4.Coding.rst | 2 +- .../translations/zh_TW/process/coding-style.rst | 2 +- .../translations/zh_TW/process/magic-number.rst | 2 +- 20 files changed, 25 insertions(+), 24 deletions(-) rename Documentation/{process => dev-tools}/clang-format.rst (100%) rename Documentation/{process => staging}/magic-number.rst (100%) base-commit: 88407e61007a3d3ebb62fc65479cc58d891ef74e -- 2.39.2 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv . From: Michael Trimarchi To: neil.armstrong@linaro.org Cc: quic_jesszhan@quicinc.com, sam@ravnborg.org, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Michael Trimarchi Subject: [RFC PATCH] drm/panel: synaptics-r63353: Fix regulator unbalance Date: Mon, 24 Jun 2024 20:53:45 +0200 Message-ID: <20240624185345.11113-1-michael@amarulasolutions.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257305 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The shutdown function can be called when the display is already unprepared. For example during reboot this trigger a kernel backlog. Calling the drm_panel_unprepare, allow us to avoid to trigger the kernel warning Signed-off-by: Michael Trimarchi --- It's not obviovus if shutdown can be dropped or this problem depends on the display stack as it is implmented. More feedback is required here --- drivers/gpu/drm/panel/panel-synaptics-r63353.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-synaptics-r63353.c b/drivers/gpu/drm/panel/panel-synaptics-r63353.c index 169c629746c7..17349825543f 100644 --- a/drivers/gpu/drm/panel/panel-synaptics-r63353.c +++ b/drivers/gpu/drm/panel/panel-synaptics-r63353.c @@ -325,7 +325,7 @@ static void r63353_panel_shutdown(struct mipi_dsi_device *dsi) { struct r63353_panel *rpanel = mipi_dsi_get_drvdata(dsi); - r63353_panel_unprepare(&rpanel->base); + drm_panel_unprepare(&rpanel->base); } static const struct r63353_desc sharp_ls068b3sx02_data = { -- 2.43.0 . From: Frank Li Subject: [PATCH v4 0/3] spi: fsl-dspi: Convert to yaml format and use common SPI property Date: Mon, 24 Jun 2024 14:55:26 -0400 Message-Id: <20240624-ls_qspi-v4-0-3d1c6f5005bf@nxp.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Vladimir Oltean , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li , Kuldeep Singh , Vladimir Oltean X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257309 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.imx,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-spi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Convert fsl-dspi binding to to yaml format. Using common SPI property spi-cs-setup-delay-ns and spi-cs-hold-delay-ns. Update driver and ls1043 dts file. To: Vladimir Oltean To: Mark Brown To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Shawn Guo Cc: linux-spi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: imx@lists.linux.dev Cc: olteanv@gmail.com Signed-off-by: Frank Li --- Changes in v4: - See each patch - Link to v3: https://lore.kernel.org/r/20240620-ls_qspi-v3-0-1a2afcf417e4@nxp.com Changes in v3: - using Vladimir Oltean's https://lore.kernel.org/imx/20240613-ls_qspi-v2-0-b288f6f5b736@nxp.com/T/#t for fsl periphal part to keep compatiblity. - Add common property and depericated fsl private property. - Link to v2: https://lore.kernel.org/r/20240613-ls_qspi-v2-0-b288f6f5b736@nxp.com --- Frank Li (3): spi: fsl-dspi: use common proptery 'spi-cs-setup(hold)-delay-ns' spi: dt-bindings: fsl-dspi: Convert to yaml format arm64: dts: fsl-ls1043a-rdb: use common spi-cs-setup(hold)-delay-ns .../bindings/spi/fsl,dspi-peripheral-props.yaml | 30 ++++++ .../devicetree/bindings/spi/fsl,dspi.yaml | 103 +++++++++++++++++++++ .../devicetree/bindings/spi/spi-fsl-dspi.txt | 65 ------------- .../bindings/spi/spi-peripheral-props.yaml | 1 + MAINTAINERS | 2 +- arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 18 ++++ drivers/spi/spi-fsl-dspi.c | 19 +++- 7 files changed, 167 insertions(+), 71 deletions(-) --- base-commit: 03d44168cbd7fc57d5de56a3730427db758fc7f6 change-id: 20240613-ls_qspi-bdced20e235e Best regards, --- Frank Li . Date: Mon, 24 Jun 2024 19:57:40 +0100 From: Mark Brown To: Linux Next Mailing List Cc: Linux Kernel Mailing List Subject: linux-next: Tree for Jun 24 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FPoAcc1pD40vVTwI" Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257315 org.kernel.vger.linux-next:61919 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-next Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail --FPoAcc1pD40vVTwI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, Changes since 20240621: The drm-msm tree gained a conflict with the qcom tree. The drm-msm-lumag tree gained a build failure, I use the version from 20240621 instead. The tip tree gained a conflict with the pm tree. The driver-core tree gained a conflict with the reset tree. The driver-core tree gained a build failure for which I applied a patch. The tty tree gained a conflict with the printk tree. The counter-next tree gained a conflict with the counter-current tree. Non-merge commits (relative to Linus' tree): 7232 8069 files changed, 728210 insertions(+), 138737 deletions(-) ---------------------------------------------------------------------------- I have created today's linux-next tree at git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git (patches at http://www.kernel.org/pub/linux/kernel/next/ ). If you are tracking the linux-next tree using git, you should not use "git pull" to do so as that will try to merge the new linux-next release with the old one. You should use "git fetch" and checkout or reset to the new master. You can see which trees have been included by looking in the Next/Trees file in the source. There is also the merge.log file in the Next directory. Between each merge, the tree was built with a defconfig for arm64, an allmodconfig for x86_64, a multi_v7_defconfig for arm and a native build of tools/perf. Below is a summary of the state of the merge. I am currently merging 378 trees (counting Linus' and 106 trees of bug fix patches pending for the current merge release). Stats about the size of the tree over time can be seen at http://neuling.org/linux-next-size.html . Status of my local build tests will be at http://kisskb.ellerman.id.au/linux-next . If maintainers want to give advice about cross compilers/configs that work, we are always open to add more builds. Thanks to Randy Dunlap for doing many randconfig builds. And to Paul Gortmaker for triage and bug fixes. --FPoAcc1pD40vVTwI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZ5waQACgkQJNaLcl1U h9Av/wgAgMNgWW8V6MGsM7jHlQ4sHJeDNdpsY4hkpyw3mO05pVsu6wee7r5DjWjO DwAF+9yebpM3Wp7kTaKbwMsFABhCb7ixSC7L8e35Q61wwoSBpzqKTlkLQJHgDQl5 wsYWWk39AHNnqfmjd1amfuGRamztF7wPCxBTdRiwqCDy9F8QaEyAgmDKoAriurtC WMSIN70Z88pqzZYktv79bkiFxg+6MDGnXGH6Avzwp/yvyqIAAMoXtTINRuV4YGxB T49ZfMzpaP1APcCOrEQPge9mFwsc17hW8PioetQX0/M72reLslcrxPu8v7e2r4gc 0cVn94avbhQE8Qbw3H9MLYwIGVFMNA== =hhAB -----END PGP SIGNATURE----- --FPoAcc1pD40vVTwI-- . From: Bartosz Golaszewski To: Bjorn Andersson , Konrad Dybcio , Andrew Halaney , Elliot Berman Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , kernel test robot Subject: [PATCH] firmware: qcom: tzmem: export devm_qcom_tzmem_pool_new() Date: Mon, 24 Jun 2024 21:06:14 +0200 Message-ID: <20240624190615.36282-1-brgl@bgdev.pl> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257319 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-arm-msm Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Bartosz Golaszewski EXPORT_SYMBOL_GPL() is missing for devm_qcom_tzmem_pool_new() which causes build failures with randconfig. Add it and fix the issue. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406250127.8Pl2kqFp-lkp@intel.com Fixes: 84f5a7b67b61 ("firmware: qcom: add a dedicated TrustZone buffer allocator") Signed-off-by: Bartosz Golaszewski --- drivers/firmware/qcom/qcom_tzmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/qcom/qcom_tzmem.c b/drivers/firmware/qcom/qcom_tzmem.c index aab6376cade5..5d526753183d 100644 --- a/drivers/firmware/qcom/qcom_tzmem.c +++ b/drivers/firmware/qcom/qcom_tzmem.c @@ -324,6 +324,7 @@ devm_qcom_tzmem_pool_new(struct device *dev, return pool; } +EXPORT_SYMBOL_GPL(devm_qcom_tzmem_pool_new); static bool qcom_tzmem_try_grow_pool(struct qcom_tzmem_pool *pool, size_t requested, gfp_t gfp) -- 2.43.0 . From: Guilherme Giacomo Simoes To: miriam.rachel.korenblit@intel.com, kvalo@kernel.org, rafael.j.wysocki@intel.com, daniel.lezcano@linaro.org, johannes.berg@intel.com, gregory.greenman@intel.com, dmantipov@yandex.ru Cc: Guilherme Giacomo Simoes , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v4] iwlwifi: mvm: adding check if the thermal firmware is running Date: Mon, 24 Jun 2024 16:14:26 -0300 Message-ID: <20240624191428.39681-1-trintaeoitogc@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257324 org.kernel.vger.linux-wireless:85288 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail In the dmesg is showing the message "failed to read out thermal zone" as if the temperature read is failed by don't find the thermal zone. After researching and debugging, I see that this specific error is occurrenced because the thermal try read the temperature when is started, but the firmware is not running yet. For more legibiliti i change the tt.c for return EAGAIN when this was occurrence. After this change, in my computer I compile and install kernel in /boot and in my dmesg the message "failed to read out thermal zone" is not show any more. I would like to thanks for Rafael Wysocki , Kalle Valo and Johannes Berg for your suggestions in my previous patch. Signed-off-by: Guilherme Giacomo Simoes --- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c index 8083c4b2ab6b..d1dd334b5049 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c @@ -620,8 +620,12 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device, mutex_lock(&mvm->mutex); - if (!iwl_mvm_firmware_running(mvm) || - mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { + if (!iwl_mvm_firmware_running(mvm)) { + ret = -EAGAIN; + goto out; + } + + if (mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) { ret = -ENODATA; goto out; } -- 2.45.2 . Date: Tue, 25 Jun 2024 03:20:27 +0800 From: kernel test robot To: Jisheng Zhang Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner Subject: [tip:irq/core 41/49] drivers/irqchip/irq-dw-apb-ictl.c:33:13: error: variable has incomplete type 'void' Message-ID: <202406250323.bMydP9v3-lkp@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257326 Newsgroups: org.kernel.vger.linux-kernel,dev.linux.lists.llvm,dev.linux.lists.oe-kbuild-all Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi Jisheng, First bad commit (maybe != root cause): tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core head: f2605e1715dd28e8943b557453fed3a40421d3b5 commit: 7cc4f309c933ec5d64eea31066fe86bbf9e48819 [41/49] irqchip/dw-apb-ictl: Support building as module config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240625/202406250323.bMydP9v3-lkp@intel.com/config) compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240625/202406250323.bMydP9v3-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202406250323.bMydP9v3-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/irqchip/irq-dw-apb-ictl.c:33:13: error: variable has incomplete type 'void' 33 | static void __irq_entry dw_apb_ictl_handle_irq(struct pt_regs *regs) | ^ arch/x86/include/asm/irq.h:19:21: note: expanded from macro '__irq_entry' 19 | #define __irq_entry __invalid_section | ^ >> drivers/irqchip/irq-dw-apb-ictl.c:33:24: error: expected ';' after top level declarator 33 | static void __irq_entry dw_apb_ictl_handle_irq(struct pt_regs *regs) | ^ | ; >> drivers/irqchip/irq-dw-apb-ictl.c:206:18: error: use of undeclared identifier 'dw_apb_ictl_handle_irq' 206 | set_handle_irq(dw_apb_ictl_handle_irq); | ^ 3 errors generated. vim +/void +33 drivers/irqchip/irq-dw-apb-ictl.c 54a38440b84f893 Zhen Lei 2020-09-24 32 54a38440b84f893 Zhen Lei 2020-09-24 @33 static void __irq_entry dw_apb_ictl_handle_irq(struct pt_regs *regs) 54a38440b84f893 Zhen Lei 2020-09-24 34 { 54a38440b84f893 Zhen Lei 2020-09-24 35 struct irq_domain *d = dw_apb_ictl_irq_domain; 54a38440b84f893 Zhen Lei 2020-09-24 36 int n; 54a38440b84f893 Zhen Lei 2020-09-24 37 54a38440b84f893 Zhen Lei 2020-09-24 38 for (n = 0; n < d->revmap_size; n += 32) { 54a38440b84f893 Zhen Lei 2020-09-24 39 struct irq_chip_generic *gc = irq_get_domain_generic_chip(d, n); 54a38440b84f893 Zhen Lei 2020-09-24 40 u32 stat = readl_relaxed(gc->reg_base + APB_INT_FINALSTATUS_L); 54a38440b84f893 Zhen Lei 2020-09-24 41 54a38440b84f893 Zhen Lei 2020-09-24 42 while (stat) { 54a38440b84f893 Zhen Lei 2020-09-24 43 u32 hwirq = ffs(stat) - 1; 54a38440b84f893 Zhen Lei 2020-09-24 44 0953fb263714e1c Mark Rutland 2021-10-20 45 generic_handle_domain_irq(d, hwirq); 54a38440b84f893 Zhen Lei 2020-09-24 46 stat &= ~BIT(hwirq); 54a38440b84f893 Zhen Lei 2020-09-24 47 } 54a38440b84f893 Zhen Lei 2020-09-24 48 } 54a38440b84f893 Zhen Lei 2020-09-24 49 } 54a38440b84f893 Zhen Lei 2020-09-24 50 d59f7d159891466 Zhen Lei 2020-09-24 51 static void dw_apb_ictl_handle_irq_cascaded(struct irq_desc *desc) 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 52 { b66231183a8542d Thomas Gleixner 2015-07-06 53 struct irq_domain *d = irq_desc_get_handler_data(desc); b66231183a8542d Thomas Gleixner 2015-07-06 54 struct irq_chip *chip = irq_desc_get_chip(desc); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 55 int n; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 56 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 57 chained_irq_enter(chip, desc); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 58 b66231183a8542d Thomas Gleixner 2015-07-06 59 for (n = 0; n < d->revmap_size; n += 32) { b66231183a8542d Thomas Gleixner 2015-07-06 60 struct irq_chip_generic *gc = irq_get_domain_generic_chip(d, n); b66231183a8542d Thomas Gleixner 2015-07-06 61 u32 stat = readl_relaxed(gc->reg_base + APB_INT_FINALSTATUS_L); b66231183a8542d Thomas Gleixner 2015-07-06 62 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 63 while (stat) { 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 64 u32 hwirq = ffs(stat) - 1; 046a6ee2343bb26 Marc Zyngier 2021-05-04 65 generic_handle_domain_irq(d, gc->irq_base + hwirq); b66231183a8542d Thomas Gleixner 2015-07-06 66 d59f7d159891466 Zhen Lei 2020-09-24 67 stat &= ~BIT(hwirq); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 68 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 69 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 70 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 71 chained_irq_exit(chip, desc); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 72 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 73 54a38440b84f893 Zhen Lei 2020-09-24 74 static int dw_apb_ictl_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, 54a38440b84f893 Zhen Lei 2020-09-24 75 unsigned int nr_irqs, void *arg) 54a38440b84f893 Zhen Lei 2020-09-24 76 { 54a38440b84f893 Zhen Lei 2020-09-24 77 int i, ret; 54a38440b84f893 Zhen Lei 2020-09-24 78 irq_hw_number_t hwirq; 54a38440b84f893 Zhen Lei 2020-09-24 79 unsigned int type = IRQ_TYPE_NONE; 54a38440b84f893 Zhen Lei 2020-09-24 80 struct irq_fwspec *fwspec = arg; 54a38440b84f893 Zhen Lei 2020-09-24 81 54a38440b84f893 Zhen Lei 2020-09-24 82 ret = irq_domain_translate_onecell(domain, fwspec, &hwirq, &type); 54a38440b84f893 Zhen Lei 2020-09-24 83 if (ret) 54a38440b84f893 Zhen Lei 2020-09-24 84 return ret; 54a38440b84f893 Zhen Lei 2020-09-24 85 54a38440b84f893 Zhen Lei 2020-09-24 86 for (i = 0; i < nr_irqs; i++) 54a38440b84f893 Zhen Lei 2020-09-24 87 irq_map_generic_chip(domain, virq + i, hwirq + i); 54a38440b84f893 Zhen Lei 2020-09-24 88 54a38440b84f893 Zhen Lei 2020-09-24 89 return 0; 54a38440b84f893 Zhen Lei 2020-09-24 90 } 54a38440b84f893 Zhen Lei 2020-09-24 91 54a38440b84f893 Zhen Lei 2020-09-24 92 static const struct irq_domain_ops dw_apb_ictl_irq_domain_ops = { 54a38440b84f893 Zhen Lei 2020-09-24 93 .translate = irq_domain_translate_onecell, 54a38440b84f893 Zhen Lei 2020-09-24 94 .alloc = dw_apb_ictl_irq_domain_alloc, 54a38440b84f893 Zhen Lei 2020-09-24 95 .free = irq_domain_free_irqs_top, 54a38440b84f893 Zhen Lei 2020-09-24 96 }; 54a38440b84f893 Zhen Lei 2020-09-24 97 1655b0530d9502e Jisheng Zhang 2014-11-12 98 #ifdef CONFIG_PM 1655b0530d9502e Jisheng Zhang 2014-11-12 99 static void dw_apb_ictl_resume(struct irq_data *d) 1655b0530d9502e Jisheng Zhang 2014-11-12 100 { 1655b0530d9502e Jisheng Zhang 2014-11-12 101 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 1655b0530d9502e Jisheng Zhang 2014-11-12 102 struct irq_chip_type *ct = irq_data_get_chip_type(d); 1655b0530d9502e Jisheng Zhang 2014-11-12 103 1655b0530d9502e Jisheng Zhang 2014-11-12 104 irq_gc_lock(gc); 1655b0530d9502e Jisheng Zhang 2014-11-12 105 writel_relaxed(~0, gc->reg_base + ct->regs.enable); 1655b0530d9502e Jisheng Zhang 2014-11-12 106 writel_relaxed(*ct->mask_cache, gc->reg_base + ct->regs.mask); 1655b0530d9502e Jisheng Zhang 2014-11-12 107 irq_gc_unlock(gc); 1655b0530d9502e Jisheng Zhang 2014-11-12 108 } 1655b0530d9502e Jisheng Zhang 2014-11-12 109 #else 1655b0530d9502e Jisheng Zhang 2014-11-12 110 #define dw_apb_ictl_resume NULL 1655b0530d9502e Jisheng Zhang 2014-11-12 111 #endif /* CONFIG_PM */ 1655b0530d9502e Jisheng Zhang 2014-11-12 112 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 113 static int __init dw_apb_ictl_init(struct device_node *np, 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 114 struct device_node *parent) 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 115 { d59f7d159891466 Zhen Lei 2020-09-24 116 const struct irq_domain_ops *domain_ops; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 117 unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 118 struct resource r; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 119 struct irq_domain *domain; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 120 struct irq_chip_generic *gc; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 121 void __iomem *iobase; d59f7d159891466 Zhen Lei 2020-09-24 122 int ret, nrirqs, parent_irq, i; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 123 u32 reg; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 124 7cc4f309c933ec5 Jisheng Zhang 2024-06-14 125 if (!parent && IS_BUILTIN(CONFIG_DW_APB_ICTL)) { 54a38440b84f893 Zhen Lei 2020-09-24 126 /* Used as the primary interrupt controller */ 54a38440b84f893 Zhen Lei 2020-09-24 127 parent_irq = 0; 54a38440b84f893 Zhen Lei 2020-09-24 128 domain_ops = &dw_apb_ictl_irq_domain_ops; 54a38440b84f893 Zhen Lei 2020-09-24 129 } else { 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 130 /* Map the parent interrupt for the chained handler */ d59f7d159891466 Zhen Lei 2020-09-24 131 parent_irq = irq_of_parse_and_map(np, 0); d59f7d159891466 Zhen Lei 2020-09-24 132 if (parent_irq <= 0) { e81f54c668d89e5 Rob Herring 2017-07-18 133 pr_err("%pOF: unable to parse irq\n", np); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 134 return -EINVAL; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 135 } 54a38440b84f893 Zhen Lei 2020-09-24 136 domain_ops = &irq_generic_chip_ops; 54a38440b84f893 Zhen Lei 2020-09-24 137 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 138 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 139 ret = of_address_to_resource(np, 0, &r); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 140 if (ret) { e81f54c668d89e5 Rob Herring 2017-07-18 141 pr_err("%pOF: unable to get resource\n", np); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 142 return ret; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 143 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 144 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 145 if (!request_mem_region(r.start, resource_size(&r), np->full_name)) { e81f54c668d89e5 Rob Herring 2017-07-18 146 pr_err("%pOF: unable to request mem region\n", np); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 147 return -ENOMEM; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 148 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 149 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 150 iobase = ioremap(r.start, resource_size(&r)); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 151 if (!iobase) { e81f54c668d89e5 Rob Herring 2017-07-18 152 pr_err("%pOF: unable to map resource\n", np); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 153 ret = -ENOMEM; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 154 goto err_release; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 155 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 156 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 157 /* 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 158 * DW IP can be configured to allow 2-64 irqs. We can determine 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 159 * the number of irqs supported by writing into enable register 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 160 * and look for bits not set, as corresponding flip-flops will c5f48c0a7aa1a8c Ingo Molnar 2018-12-03 161 * have been removed by synthesis tool. 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 162 */ 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 163 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 164 /* mask and enable all interrupts */ 8876ce7d1cbaca4 Jisheng Zhang 2014-11-12 165 writel_relaxed(~0, iobase + APB_INT_MASK_L); 8876ce7d1cbaca4 Jisheng Zhang 2014-11-12 166 writel_relaxed(~0, iobase + APB_INT_MASK_H); 8876ce7d1cbaca4 Jisheng Zhang 2014-11-12 167 writel_relaxed(~0, iobase + APB_INT_ENABLE_L); 8876ce7d1cbaca4 Jisheng Zhang 2014-11-12 168 writel_relaxed(~0, iobase + APB_INT_ENABLE_H); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 169 8876ce7d1cbaca4 Jisheng Zhang 2014-11-12 170 reg = readl_relaxed(iobase + APB_INT_ENABLE_H); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 171 if (reg) 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 172 nrirqs = 32 + fls(reg); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 173 else 8876ce7d1cbaca4 Jisheng Zhang 2014-11-12 174 nrirqs = fls(readl_relaxed(iobase + APB_INT_ENABLE_L)); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 175 d59f7d159891466 Zhen Lei 2020-09-24 176 domain = irq_domain_add_linear(np, nrirqs, domain_ops, NULL); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 177 if (!domain) { e81f54c668d89e5 Rob Herring 2017-07-18 178 pr_err("%pOF: unable to add irq domain\n", np); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 179 ret = -ENOMEM; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 180 goto err_unmap; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 181 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 182 b66231183a8542d Thomas Gleixner 2015-07-06 183 ret = irq_alloc_domain_generic_chips(domain, 32, 1, np->name, b66231183a8542d Thomas Gleixner 2015-07-06 184 handle_level_irq, clr, 0, 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 185 IRQ_GC_INIT_MASK_CACHE); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 186 if (ret) { e81f54c668d89e5 Rob Herring 2017-07-18 187 pr_err("%pOF: unable to alloc irq domain gc\n", np); 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 188 goto err_unmap; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 189 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 190 b66231183a8542d Thomas Gleixner 2015-07-06 191 for (i = 0; i < DIV_ROUND_UP(nrirqs, 32); i++) { b66231183a8542d Thomas Gleixner 2015-07-06 192 gc = irq_get_domain_generic_chip(domain, i * 32); b66231183a8542d Thomas Gleixner 2015-07-06 193 gc->reg_base = iobase + i * APB_INT_BASE_OFFSET; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 194 gc->chip_types[0].regs.mask = APB_INT_MASK_L; 1655b0530d9502e Jisheng Zhang 2014-11-12 195 gc->chip_types[0].regs.enable = APB_INT_ENABLE_L; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 196 gc->chip_types[0].chip.irq_mask = irq_gc_mask_set_bit; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 197 gc->chip_types[0].chip.irq_unmask = irq_gc_mask_clr_bit; 1655b0530d9502e Jisheng Zhang 2014-11-12 198 gc->chip_types[0].chip.irq_resume = dw_apb_ictl_resume; 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 199 } 350d71b94fc9ed4 Sebastian Hesselbarth 2013-09-09 200 54a38440b84f893 Zhen Lei 2020-09-24 201 if (parent_irq) { d59f7d159891466 Zhen Lei 2020-09-24 202 irq_set_chained_handler_and_data(parent_irq, d59f7d159891466 Zhen Lei 2020-09-24 203 dw_apb_ictl_handle_irq_cascaded, domain); 54a38440b84f893 Zhen Lei 2020-09-24 204 } else { 54a38440b84f893 Zhen Lei 2020-09-24 205 dw_apb_ictl_irq_domain = domain; 54a38440b84f893 Zhen Lei 2020-09-24 @206 set_handle_irq(dw_apb_ictl_handle_irq); :::::: The code at line 33 was first introduced by commit :::::: 54a38440b84f8933b555c23273deca6a396f6708 irqchip/dw-apb-ictl: Add primary interrupt controller support :::::: TO: Zhen Lei :::::: CC: Marc Zyngier -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki . From: Bartosz Golaszewski To: Marcel Holtmann , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Dmitry Baryshkov Subject: [PATCH] Bluetooth: qca: don't disable power management for QCA6390 Date: Mon, 24 Jun 2024 21:45:18 +0200 Message-ID: <20240624194518.37458-1-brgl@bgdev.pl> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257344 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-bluetooth Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Bartosz Golaszewski We unnecessarily fallthrough the case for QCA6390 when initializing the device and hit the condition where - due to the lack of the enable-gpio - we disable power management despite using the power sequencer. We don't need to look for clocks on this model so it makes more sense to just register the hci device and break the switch. Reported-by: Dmitry Baryshkov Fixes: 4029dba6b6f1 ("Bluetooth: qca: use the power sequencer for QCA6390") Signed-off-by: Bartosz Golaszewski --- drivers/bluetooth/hci_qca.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 2b31f3dc33a9..bc6a49ba26f9 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2402,7 +2402,13 @@ static int qca_serdev_probe(struct serdev_device *serdev) "bluetooth"); if (IS_ERR(qcadev->bt_power->pwrseq)) return PTR_ERR(qcadev->bt_power->pwrseq); - fallthrough; + + err = hci_uart_register_device(&qcadev->serdev_hu, &qca_proto); + if (err) { + BT_ERR("qca6390 serdev registration failed"); + return err; + } + break; default: qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", -- 2.43.0 . From: Thorsten Blum To: martin.lau@linux.dev, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org, yonghong.song@linux.dev, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thorsten Blum Subject: [PATCH] bpf, btf: Make if test explicit to fix Coccinelle error Date: Mon, 24 Jun 2024 21:54:27 +0200 Message-ID: <20240624195426.176827-2-thorsten.blum@toblux.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257348 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.bpf Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Explicitly test the iterator variable i > 0 to fix the following Coccinelle/coccicheck error reported by itnull.cocci: ERROR: iterator variable bound on line 4688 cannot be NULL Compile-tested only. Signed-off-by: Thorsten Blum --- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 821063660d9f..7720f8967814 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -4687,7 +4687,7 @@ static void btf_datasec_show(const struct btf *btf, __btf_name_by_offset(btf, t->name_off)); for_each_vsi(i, t, vsi) { var = btf_type_by_id(btf, vsi->type); - if (i) + if (i > 0) btf_show(show, ","); btf_type_ops(var)->show(btf, var, vsi->type, data + vsi->offset, bits_offset, show); -- 2.45.2 . From: Christophe JAILLET To: Helge Deller Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH] fbdev: mmp: Constify struct mmp_overlay_ops Date: Mon, 24 Jun 2024 21:59:42 +0200 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257349 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-fbdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail 'struct mmp_overlay_ops' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 11798 555 16 12369 3051 drivers/video/fbdev/mmp/hw/mmp_ctrl.o After: ===== text data bss dec hex filename 11834 507 16 12357 3045 drivers/video/fbdev/mmp/hw/mmp_ctrl.o Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +- include/video/mmp_disp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index 76b50b6c98ad..a20a2c408127 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -313,7 +313,7 @@ static void path_set_mode(struct mmp_path *path, struct mmp_mode *mode) mutex_unlock(&path->access_ok); } -static struct mmp_overlay_ops mmphw_overlay_ops = { +static const struct mmp_overlay_ops mmphw_overlay_ops = { .set_fetch = overlay_set_fetch, .set_onoff = overlay_set_onoff, .set_win = overlay_set_win, diff --git a/include/video/mmp_disp.h b/include/video/mmp_disp.h index a722dcbf5073..41354bd49895 100644 --- a/include/video/mmp_disp.h +++ b/include/video/mmp_disp.h @@ -156,7 +156,7 @@ struct mmp_overlay { int status; struct mutex access_ok; - struct mmp_overlay_ops *ops; + const struct mmp_overlay_ops *ops; }; /* panel type */ @@ -299,7 +299,7 @@ struct mmp_path_info { int overlay_num; void (*set_mode)(struct mmp_path *path, struct mmp_mode *mode); void (*set_onoff)(struct mmp_path *path, int status); - struct mmp_overlay_ops *overlay_ops; + const struct mmp_overlay_ops *overlay_ops; void *plat_data; }; -- 2.45.2 . From: David Lechner To: Mark Brown , Jonathan Cameron Cc: David Lechner , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Marcelo Schmitt , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-iio@vger.kernel.org Subject: [PATCH v2 0/2] spi: add devm_spi_optimize_message() helper Date: Mon, 24 Jun 2024 15:10:29 -0500 Message-ID: <20240624-devm_spi_optimize_message-v2-0-58155c0180c2@baylibre.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257354 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-iio,org.kernel.vger.linux-spi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail In the IIO subsystem, we are finding that it is common to call spi_optimize_message() during driver probe since the SPI message doesn't change for the lifetime of the driver. This patch adds a devm_spi_optimize_message() helper to simplify this common pattern. --- Changes in v2: - Dropped already applied SPI patches. - Added patch to fix missing EXPORT_SYMBOL_GPL. - Link to v1: https://lore.kernel.org/r/20240621-devm_spi_optimize_message-v1-0-3f9dcba6e95e@baylibre.com --- David Lechner (2): spi: add EXPORT_SYMBOL_GPL(devm_spi_optimize_message) iio: adc: ad7944: use devm_spi_optimize_message() drivers/iio/adc/ad7944.c | 26 +++----------------------- drivers/spi/spi.c | 1 + 2 files changed, 4 insertions(+), 23 deletions(-) --- base-commit: 17436001a6bc42c7f55dc547ca5b1a873208d91d change-id: 20240621-devm_spi_optimize_message-ebbde029dd7a Best regards, -- David Lechner . From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, H Peter Anvin , Mark Rutland , Alexander Shishkin , Marco Cavenati , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , Kan Liang , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH 0/7] perf: Intel PT and 64-bit AUX area size fixes Date: Mon, 24 Jun 2024 23:10:54 +0300 Message-Id: <20240624201101.60186-1-adrian.hunter@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257356 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi Here are some fixes. I have taken the liberty of re-posting Marco Cavenati's patch from: https://lore.kernel.org/lkml/20240618110617.22626-1-cavenati.marco@gmail.com/ with updated commit suggested by Dave Hansen. Adrian Hunter (6): perf/x86/intel/pt: Fix a topa_entry base address calculation perf/x86/intel/pt: Fix pt_topa_entry_for_page() address calculation perf: Fix perf_aux_size() for greater-than 32-bit size perf: Prevent passing zero nr_pages to rb_alloc_aux() perf: Fix default aux_watermark calculation perf: Make rb_alloc_aux() return an error immediately if nr_pages <= 0 Marco Cavenati (1): perf/x86/intel/pt: Fix topa_entry base length arch/x86/events/intel/pt.c | 4 ++-- arch/x86/events/intel/pt.h | 4 ++-- kernel/events/core.c | 2 ++ kernel/events/internal.h | 2 +- kernel/events/ring_buffer.c | 7 ++++++- 5 files changed, 13 insertions(+), 6 deletions(-) Regards Adrian . From: Christophe JAILLET To: Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/hfi1: Constify struct mmu_rb_ops Date: Mon, 24 Jun 2024 22:13:27 +0200 Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257367 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-rdma Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail 'struct mmu_rb_ops' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 10879 164 0 11043 2b23 drivers/infiniband/hw/hfi1/pin_system.o After: ===== text data bss dec hex filename 10907 140 0 11047 2b27 drivers/infiniband/hw/hfi1/pin_system.o Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/infiniband/hw/hfi1/mmu_rb.c | 2 +- drivers/infiniband/hw/hfi1/mmu_rb.h | 4 ++-- drivers/infiniband/hw/hfi1/pin_system.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c index d4a6acad0e65..67a5c410fb5e 100644 --- a/drivers/infiniband/hw/hfi1/mmu_rb.c +++ b/drivers/infiniband/hw/hfi1/mmu_rb.c @@ -40,7 +40,7 @@ static unsigned long mmu_node_last(struct mmu_rb_node *node) } int hfi1_mmu_rb_register(void *ops_arg, - struct mmu_rb_ops *ops, + const struct mmu_rb_ops *ops, struct workqueue_struct *wq, struct mmu_rb_handler **handler) { diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.h b/drivers/infiniband/hw/hfi1/mmu_rb.h index 8e5d05454d70..3fa50dd64db6 100644 --- a/drivers/infiniband/hw/hfi1/mmu_rb.h +++ b/drivers/infiniband/hw/hfi1/mmu_rb.h @@ -42,7 +42,7 @@ struct mmu_rb_handler { /* Begin on a new cachline boundary here */ struct rb_root_cached root ____cacheline_aligned_in_smp; void *ops_arg; - struct mmu_rb_ops *ops; + const struct mmu_rb_ops *ops; struct list_head lru_list; struct work_struct del_work; struct list_head del_list; @@ -51,7 +51,7 @@ struct mmu_rb_handler { }; int hfi1_mmu_rb_register(void *ops_arg, - struct mmu_rb_ops *ops, + const struct mmu_rb_ops *ops, struct workqueue_struct *wq, struct mmu_rb_handler **handler); void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler); diff --git a/drivers/infiniband/hw/hfi1/pin_system.c b/drivers/infiniband/hw/hfi1/pin_system.c index 384f722093e0..cce56134519b 100644 --- a/drivers/infiniband/hw/hfi1/pin_system.c +++ b/drivers/infiniband/hw/hfi1/pin_system.c @@ -26,7 +26,7 @@ static int sdma_rb_evict(void *arg, struct mmu_rb_node *mnode, void *arg2, bool *stop); static void sdma_rb_remove(void *arg, struct mmu_rb_node *mnode); -static struct mmu_rb_ops sdma_rb_ops = { +static const struct mmu_rb_ops sdma_rb_ops = { .filter = sdma_rb_filter, .evict = sdma_rb_evict, .remove = sdma_rb_remove, -- 2.45.2 . From: Christophe JAILLET To: Hou Zhiqiang , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Karthikeyan Mitran Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] PCI: ls-gen4: Constify struct mobiveil_rp_ops Date: Mon, 24 Jun 2024 22:18:20 +0200 Message-ID: <189fd881cc8fd80220e74e91820e12cf3a5be114.1719260294.git.christophe.jaillet@wanadoo.fr> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257377 org.kernel.vger.linux-pci:144430 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail 'struct mobiveil_rp_ops' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 4446 336 32 4814 12ce drivers/pci/controller/mobiveil/pcie-layerscape-gen4.o After: ===== text data bss dec hex filename 4454 328 32 4814 12ce drivers/pci/controller/mobiveil/pcie-layerscape-gen4.o Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c | 2 +- drivers/pci/controller/mobiveil/pcie-mobiveil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c index d7b7350f02dd..5af22bee913b 100644 --- a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c +++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c @@ -190,7 +190,7 @@ static void ls_g4_pcie_reset(struct work_struct *work) ls_g4_pcie_enable_interrupt(pcie); } -static struct mobiveil_rp_ops ls_g4_pcie_rp_ops = { +static const struct mobiveil_rp_ops ls_g4_pcie_rp_ops = { .interrupt_init = ls_g4_pcie_interrupt_init, }; diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 6082b8afbc31..e63abb887ee3 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -151,7 +151,7 @@ struct mobiveil_rp_ops { struct mobiveil_root_port { void __iomem *config_axi_slave_base; /* endpoint config base */ struct resource *ob_io_res; - struct mobiveil_rp_ops *ops; + const struct mobiveil_rp_ops *ops; int irq; raw_spinlock_t intx_mask_lock; struct irq_domain *intx_domain; -- 2.45.2 . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 24 Jun 2024 13:23:28 -0700 Message-ID: <000000000000d8f51a061ba88d22@google.com> Subject: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in l2cap_connect (2) From: syzbot To: johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, luiz.dentz@gmail.com, marcel@holtmann.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257381 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-bluetooth Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, syzbot found the following issue on: HEAD commit: 5f583a3162ff Merge tag 'rust-fixes-6.10' of https://github.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=11170741980000 kernel config: https://syzkaller.appspot.com/x/.config?x=f413acf5b1eb4093 dashboard link: https://syzkaller.appspot.com/bug?extid=c12e2f941af1feb5632c compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/f530c7950839/disk-5f583a31.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/b4f810bbc13e/vmlinux-5f583a31.xz kernel image: https://storage.googleapis.com/syzbot-assets/a49ec6dadbad/bzImage-5f583a31.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+c12e2f941af1feb5632c@syzkaller.appspotmail.com ================================================================== BUG: KASAN: slab-use-after-free in l2cap_connect.constprop.0+0x10d8/0x1270 net/bluetooth/l2cap_core.c:3949 Read of size 8 at addr ffff88802af53000 by task kworker/u9:4/5114 CPU: 1 PID: 5114 Comm: kworker/u9:4 Not tainted 6.10.0-rc4-syzkaller-00301-g5f583a3162ff #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: hci1 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 l2cap_connect.constprop.0+0x10d8/0x1270 net/bluetooth/l2cap_core.c:3949 l2cap_connect_req net/bluetooth/l2cap_core.c:4080 [inline] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:4772 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5543 [inline] l2cap_recv_frame+0xf07/0x8e50 net/bluetooth/l2cap_core.c:6821 l2cap_recv_acldata+0x9ac/0xb60 net/bluetooth/l2cap_core.c:7510 hci_acldata_packet net/bluetooth/hci_core.c:3842 [inline] hci_rx_work+0xaa7/0x1610 net/bluetooth/hci_core.c:4079 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 4480: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] l2cap_conn_add.part.0+0x60/0xa60 net/bluetooth/l2cap_core.c:6864 l2cap_conn_add net/bluetooth/l2cap_core.c:69 [inline] l2cap_connect_cfm+0x428/0xf80 net/bluetooth/l2cap_core.c:7241 hci_connect_cfm include/net/bluetooth/hci_core.h:1970 [inline] hci_remote_features_evt+0x548/0x9e0 net/bluetooth/hci_event.c:3721 hci_event_func net/bluetooth/hci_event.c:7417 [inline] hci_event_packet+0x9e3/0x1170 net/bluetooth/hci_event.c:7469 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4074 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 5112: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4437 [inline] kfree+0x12a/0x3b0 mm/slub.c:4558 l2cap_conn_free net/bluetooth/l2cap_core.c:1810 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_conn_put net/bluetooth/l2cap_core.c:1822 [inline] l2cap_conn_del+0x59d/0x740 net/bluetooth/l2cap_core.c:1802 l2cap_connect_cfm+0x9e6/0xf80 net/bluetooth/l2cap_core.c:7237 hci_connect_cfm include/net/bluetooth/hci_core.h:1970 [inline] hci_conn_failed+0x1c3/0x370 net/bluetooth/hci_conn.c:1257 hci_abort_conn_sync+0x75a/0xb50 net/bluetooth/hci_sync.c:5450 abort_conn_sync+0x197/0x360 net/bluetooth/hci_conn.c:2909 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:310 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 insert_work+0x36/0x230 kernel/workqueue.c:2207 __queue_work+0x944/0x1020 kernel/workqueue.c:2359 call_timer_fn+0x1a0/0x610 kernel/time/timer.c:1792 expire_timers kernel/time/timer.c:1838 [inline] __run_timers+0x567/0xaf0 kernel/time/timer.c:2417 __run_timer_base kernel/time/timer.c:2428 [inline] __run_timer_base kernel/time/timer.c:2421 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2437 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2447 handle_softirqs+0x216/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Second to last potentially related work creation: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:541 insert_work+0x36/0x230 kernel/workqueue.c:2207 __queue_work+0x525/0x1020 kernel/workqueue.c:2363 queue_work_on+0x11a/0x140 kernel/workqueue.c:2410 queue_work include/linux/workqueue.h:621 [inline] l2cap_conn_ready net/bluetooth/l2cap_core.c:1640 [inline] l2cap_connect_cfm+0x9c9/0xf80 net/bluetooth/l2cap_core.c:7282 hci_connect_cfm include/net/bluetooth/hci_core.h:1970 [inline] hci_remote_features_evt+0x548/0x9e0 net/bluetooth/hci_event.c:3721 hci_event_func net/bluetooth/hci_event.c:7417 [inline] hci_event_packet+0x9e3/0x1170 net/bluetooth/hci_event.c:7469 hci_rx_work+0x2c4/0x1610 net/bluetooth/hci_core.c:4074 process_one_work+0x9fb/0x1b60 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88802af53000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of freed 1024-byte region [ffff88802af53000, ffff88802af53400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2af50 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888015441dc0 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888015441dc0 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000003 ffffea0000abd401 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4752, tgid 4752 (dhcpcd), ts 66098690934, free_ts 66038999175 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] __do_kmalloc_node mm/slub.c:4121 [inline] kmalloc_node_track_caller_noprof+0x355/0x430 mm/slub.c:4142 kmemdup_noprof+0x29/0x60 mm/util.c:131 kmemdup_noprof include/linux/fortify-string.h:757 [inline] bpf_migrate_filter+0xc6/0x390 net/core/filter.c:1268 bpf_prepare_filter+0x183/0x380 net/core/filter.c:1354 bpf_prog_create_from_user+0x1e4/0x2d0 net/core/filter.c:1448 seccomp_prepare_filter kernel/seccomp.c:680 [inline] seccomp_prepare_user_filter kernel/seccomp.c:717 [inline] seccomp_set_mode_filter kernel/seccomp.c:1935 [inline] do_seccomp+0x7b6/0x2580 kernel/seccomp.c:2055 prctl_set_seccomp+0x4b/0x70 kernel/seccomp.c:2108 __do_sys_prctl+0xc83/0x1e40 kernel/sys.c:2539 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 page last free pid 4747 tgid 4747 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2583 __put_partials+0x14c/0x170 mm/slub.c:2995 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_lru_noprof+0x121/0x2f0 mm/slub.c:4020 shmem_alloc_inode+0x25/0x50 mm/shmem.c:4468 alloc_inode+0x5d/0x230 fs/inode.c:261 new_inode_pseudo fs/inode.c:1007 [inline] new_inode+0x22/0x270 fs/inode.c:1033 __shmem_get_inode mm/shmem.c:2503 [inline] shmem_get_inode+0x194/0xe80 mm/shmem.c:2574 shmem_mknod+0x66/0x240 mm/shmem.c:3268 shmem_mkdir+0x31/0x60 mm/shmem.c:3329 vfs_mkdir+0x57d/0x860 fs/namei.c:4131 do_mkdirat+0x301/0x3a0 fs/namei.c:4154 __do_sys_mkdir fs/namei.c:4174 [inline] __se_sys_mkdir fs/namei.c:4172 [inline] __x64_sys_mkdir+0xf1/0x140 fs/namei.c:4172 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 Memory state around the buggy address: ffff88802af52f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802af52f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802af53000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802af53080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802af53100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup . From: Xi Pardee To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/9] LTR ignore feature improvement Date: Mon, 24 Jun 2024 13:32:09 -0700 Message-Id: <20240624203218.2428475-1-xi.pardee@linux.intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257387 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.platform-driver-x86 Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patch series contains six patches to improve LTR ignore feature, one patch to modify the usage of pmc_core_send_msg and two patches to improve PMC Core driver in general. Improve LTR ignore feature: platform/x86:intel/pmc: Add support to undo ltr_ignore platform/x86:intel/pmc: Use the Elvis operator platform/x86:intel/pmc: Use DEFINE_SHOW_STORE_ATTRIBUTE macro platform/x86:intel/pmc: Remove unneeded min_t check platform/x86:intel/pmc: Add support to show ltr_ignore value platform/x86:intel/pmc: Move pmc assignment closer to first usage Modify the usage of pmc_core_send_msg: platform/x86:intel/pmc: Use the return value of pmc_core_send_msg Improve PMC Core driver: platform/x86:intel/pmc: Convert index variables to be unsigned platform/x86:intel/pmc: Simplify mutex usage with cleanup helpers Xi Pardee (9): platform/x86:intel/pmc: Use the return value of pmc_core_send_msg platform/x86:intel/pmc: Simplify mutex usage with cleanup helpers platform/x86:intel/pmc: Convert index variables to be unsigned platform/x86:intel/pmc: Move pmc assignment closer to first usage platform/x86:intel/pmc: Add support to show ltr_ignore value platform/x86:intel/pmc: Remove unneeded min_t check platform/x86:intel/pmc: Use DEFINE_SHOW_STORE_ATTRIBUTE macro platform/x86:intel/pmc: Use the Elvis operator platform/x86:intel/pmc: Add support to undo ltr_ignore drivers/platform/x86/intel/pmc/core.c | 214 +++++++++++++------------- 1 file changed, 109 insertions(+), 105 deletions(-) -- 2.34.1 . Date: Mon, 24 Jun 2024 20:37:28 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Message-ID: <20240624203729.1094506-1-smostafa@google.com> Subject: [PATCH v2] PCI/MSI: Fix UAF in msi_capability_init From: Mostafa Saleh To: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ilpo.jarvinen@linux.intel.com, tglx@linutronix.de, kernel-team@android.com, Mostafa Saleh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257399 org.kernel.vger.linux-pci:144431 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail While running Android15-6.6 and hacking on latest Qemu, I observed the following with KFENCE: [ 10.761992][ T81] pcieport 0000:00:03.0: Adding to iommu group 0 [ 10.782536][ T81] pcieport 0000:00:03.0: enabling device (0000 -> 0003= ) [ 10.814259][ T81] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ 10.816534][ T81] BUG: KFENCE: use-after-free read in __pci_enable_msi= _range+0x2c0/0x488 [ 10.816534][ T81] [ 10.820189][ T81] Use-after-free read at 0x0000000024629571 (in kfence= -#12): [ 10.822652][ T81] __pci_enable_msi_range+0x2c0/0x488 [ 10.824304][ T81] pci_alloc_irq_vectors_affinity+0xec/0x14c [ 10.826129][ T81] pci_alloc_irq_vectors+0x18/0x28 [ 10.827606][ T81] pcie_portdrv_probe+0x1e0/0x608 [ 10.828979][ T81] pci_device_probe+0xa8/0x174 [ 10.830316][ T81] really_probe+0x150/0x2b8 [ 10.831717][ T81] __driver_probe_device+0x7c/0x130 [ 10.833368][ T81] driver_probe_device+0x40/0x118 [ 10.834899][ T81] __device_attach_driver+0xc4/0x108 [ 10.836464][ T81] bus_for_each_drv+0x8c/0xf0 [ 10.837915][ T81] __device_attach+0xa4/0x198 [ 10.839260][ T81] device_initial_probe+0x18/0x28 [ 10.840684][ T81] bus_probe_device+0xb0/0xb4 [ 10.842174][ T81] deferred_probe_work_func+0xac/0xf8 [ 10.843760][ T81] process_one_work+0x18c/0x414 [ 10.845129][ T81] worker_thread+0x41c/0x53c [ 10.846611][ T81] kthread+0x114/0x118 [ 10.847841][ T81] ret_from_fork+0x10/0x20 [ 10.849298][ T81] [ 10.850435][ T81] kfence-#12: 0x0000000008614900-0x00000000e06c228d, s= ize=3D104, cache=3Dkmalloc-128 [ 10.850435][ T81] [ 10.853455][ T81] allocated by task 81 on cpu 7 at 10.808142s: [ 10.856329][ T81] __kmem_cache_alloc_node+0x1f0/0x2bc [ 10.857988][ T81] kmalloc_trace+0x44/0x138 [ 10.859299][ T81] msi_alloc_desc+0x3c/0x9c [ 10.860582][ T81] msi_domain_insert_msi_desc+0x30/0x78 [ 10.862058][ T81] msi_setup_msi_desc+0x13c/0x184 [ 10.862942][ T81] __pci_enable_msi_range+0x258/0x488 [ 10.863847][ T81] pci_alloc_irq_vectors_affinity+0xec/0x14c [ 10.864821][ T81] pci_alloc_irq_vectors+0x18/0x28 [ 10.866011][ T81] pcie_portdrv_probe+0x1e0/0x608 [ 10.867047][ T81] pci_device_probe+0xa8/0x174 [ 10.867937][ T81] really_probe+0x150/0x2b8 [ 10.868774][ T81] __driver_probe_device+0x7c/0x130 [ 10.869755][ T81] driver_probe_device+0x40/0x118 [ 10.870665][ T81] __device_attach_driver+0xc4/0x108 [ 10.871654][ T81] bus_for_each_drv+0x8c/0xf0 [ 10.872585][ T81] __device_attach+0xa4/0x198 [ 10.873581][ T81] device_initial_probe+0x18/0x28 [ 10.874645][ T81] bus_probe_device+0xb0/0xb4 [ 10.875610][ T81] deferred_probe_work_func+0xac/0xf8 [ 10.876696][ T81] process_one_work+0x18c/0x414 [ 10.877573][ T81] worker_thread+0x41c/0x53c [ 10.878468][ T81] kthread+0x114/0x118 [ 10.879331][ T81] ret_from_fork+0x10/0x20 [ 10.880238][ T81] [ 10.880767][ T81] freed by task 81 on cpu 7 at 10.811436s: [ 10.882311][ T81] msi_domain_free_descs+0xd4/0x10c [ 10.883318][ T81] msi_domain_free_locked.part.0+0xc0/0x1d8 [ 10.884401][ T81] msi_domain_alloc_irqs_all_locked+0xb4/0xbc [ 10.885519][ T81] pci_msi_setup_msi_irqs+0x30/0x4c [ 10.886549][ T81] __pci_enable_msi_range+0x2a8/0x488 [ 10.887537][ T81] pci_alloc_irq_vectors_affinity+0xec/0x14c [ 10.888576][ T81] pci_alloc_irq_vectors+0x18/0x28 [ 10.889693][ T81] pcie_portdrv_probe+0x1e0/0x608 [ 10.890719][ T81] pci_device_probe+0xa8/0x174 [ 10.891623][ T81] really_probe+0x150/0x2b8 [ 10.892534][ T81] __driver_probe_device+0x7c/0x130 [ 10.893541][ T81] driver_probe_device+0x40/0x118 [ 10.894491][ T81] __device_attach_driver+0xc4/0x108 [ 10.895433][ T81] bus_for_each_drv+0x8c/0xf0 [ 10.896381][ T81] __device_attach+0xa4/0x198 [ 10.897359][ T81] device_initial_probe+0x18/0x28 [ 10.898401][ T81] bus_probe_device+0xb0/0xb4 [ 10.899268][ T81] deferred_probe_work_func+0xac/0xf8 [ 10.900314][ T81] process_one_work+0x18c/0x414 [ 10.901279][ T81] worker_thread+0x41c/0x53c [ 10.902138][ T81] kthread+0x114/0x118 [ 10.902916][ T81] ret_from_fork+0x10/0x20 [ 10.903816][ T81] [ 10.904429][ T81] CPU: 7 PID: 81 Comm: kworker/u16:2 Not tainted 6.6.2= 3mostafa+ #224 [ 10.906362][ T81] Hardware name: linux,dummy-virt (DT) [ 10.907934][ T81] Workqueue: events_unbound deferred_probe_work_func [ 10.909959][ T81] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Looking at the upstream code, it seems to have the same issue where: Descriptor allocation done in: __pci_enable_msi_range msi_capability_init msi_setup_msi_desc msi_insert_msi_desc msi_domain_insert_msi_desc msi_alloc_desc ... Freed in case of failure in __msi_domain_alloc_locked() __pci_enable_msi_range msi_capability_init pci_msi_setup_msi_irqs msi_domain_alloc_irqs_all_locked msi_domain_alloc_locked __msi_domain_alloc_locked =3D> fails msi_domain_free_locked ... That failure would propagate back till pci_msi_setup_msi_irqs() call in msi_capability_init() which have "goto err" which would access the descriptor to clear the mask. However, we can=E2=80=99t make assumptions if the descriptor is freed or no= t as it depends on the failure location and on MSI_FLAG_FREE_MSI_DESCS, so we copy it and use the copy to mask it in case of error. Also, calling pci_free_msi_irqs() after will trigger msi_domain_free_locked() again, however it re-iterates through the xa array, which should be safe. I hit this only once, but I can confirm the bug(and verify the fix) for the upstream kernel through stubbing return of __msi_domain_alloc_locked() to fail and with KASAN enabled. bf6e054e0e3f ("genirq/msi: Provide msi_device_populate/destroy_sysfs()") is the first commit that introduced the free logic from the context of pci_msi_setup_msi_irqs() Suggested-by: Thomas Gleixner Signed-off-by: Mostafa Saleh --- v2: - Copy descriptor as suggested by tglx to unmaks freed msis --- drivers/pci/msi/msi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index c5625dd9bf49..3a45879d85db 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -352,7 +352,7 @@ static int msi_capability_init(struct pci_dev *dev, int= nvec, struct irq_affinity *affd) { struct irq_affinity_desc *masks =3D NULL; - struct msi_desc *entry; + struct msi_desc *entry, desc; int ret; =20 /* Reject multi-MSI early on irq domain enabled architectures */ @@ -377,6 +377,12 @@ static int msi_capability_init(struct pci_dev *dev, in= t nvec, /* All MSIs are unmasked by default; mask them all */ entry =3D msi_first_desc(&dev->dev, MSI_DESC_ALL); pci_msi_mask(entry, msi_multi_mask(entry)); + /* + * Copy the MSI descriptor for the error path because + * pci_msi_setup_msi_irqs() will free it for the hierarchical + * interrupt domain case. + */ + memcpy(&desc, entry, sizeof(desc)); =20 /* Configure MSI capability structure */ ret =3D pci_msi_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSI); @@ -396,7 +402,7 @@ static int msi_capability_init(struct pci_dev *dev, int= nvec, goto unlock; =20 err: - pci_msi_unmask(entry, msi_multi_mask(entry)); + pci_msi_unmask(&desc, msi_multi_mask(&desc)); pci_free_msi_irqs(dev); fail: dev->msi_enabled =3D 0; --=20 2.45.2.741.gdbec12cfda-goog . X-Envelope-To: val@packett.cool X-Envelope-To: hjc@rock-chips.com X-Envelope-To: heiko@sntech.de X-Envelope-To: andy.yan@rock-chips.com X-Envelope-To: maarten.lankhorst@linux.intel.com X-Envelope-To: mripard@kernel.org X-Envelope-To: tzimmermann@suse.de X-Envelope-To: airlied@gmail.com X-Envelope-To: daniel@ffwll.ch X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: linux-arm-kernel@lists.infradead.org X-Envelope-To: linux-rockchip@lists.infradead.org X-Envelope-To: linux-kernel@vger.kernel.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Val Packett To: Cc: Val Packett , Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Andy Yan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/2] drm/rockchip: vop: Support internal display on RK3066 Date: Mon, 24 Jun 2024 17:40:47 -0300 Message-ID: <20240624204054.5524-1-val@packett.cool> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257401 Newsgroups: org.kernel.vger.linux-kernel,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This tiny patch series makes the changes required to enable the RGB display output on the Rockchip RK3066 SoC. Final version as discussed. Val Packett (2): drm/rockchip: vop: clear DMA stop bit on RK3066 drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB on RK3066 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++++ drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 + drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 ++ 3 files changed, 7 insertions(+) -- 2.45.2 . From: David Lechner To: Mark Brown , Jonathan Cameron Cc: David Lechner , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Marcelo Schmitt , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-iio@vger.kernel.org Subject: [PATCH v3 0/2] spi: add devm_spi_optimize_message() helper Date: Mon, 24 Jun 2024 15:46:06 -0500 Message-ID: <20240624-devm_spi_optimize_message-v3-0-912138c27b66@baylibre.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257406 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-iio,org.kernel.vger.linux-spi Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail In the IIO subsystem, we are finding that it is common to call spi_optimize_message() during driver probe since the SPI message doesn't change for the lifetime of the driver. This patch adds a devm_spi_optimize_message() helper to simplify this common pattern. --- Changes in v3: - Fix commit hash in Fixes: tag in first patch. - Link to v2: https://lore.kernel.org/r/20240624-devm_spi_optimize_message-v2-0-58155c0180c2@baylibre.com Changes in v2: - Dropped already applied SPI patches. - Added patch to fix missing EXPORT_SYMBOL_GPL. - Link to v1: https://lore.kernel.org/r/20240621-devm_spi_optimize_message-v1-0-3f9dcba6e95e@baylibre.com --- David Lechner (2): spi: add EXPORT_SYMBOL_GPL(devm_spi_optimize_message) iio: adc: ad7944: use devm_spi_optimize_message() drivers/iio/adc/ad7944.c | 26 +++----------------------- drivers/spi/spi.c | 1 + 2 files changed, 4 insertions(+), 23 deletions(-) --- base-commit: 17436001a6bc42c7f55dc547ca5b1a873208d91d change-id: 20240621-devm_spi_optimize_message-ebbde029dd7a Best regards, -- David Lechner . From: Javier Carrasco Date: Mon, 24 Jun 2024 23:10:06 +0200 Subject: [PATCH] usb: core: add missing of_node_put() in usb_of_has_devices_or_graph X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240624-usb_core_of_memleak-v1-1-af6821c1a584@gmail.com> To: Greg Kroah-Hartman , Stephen Boyd Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Javier Carrasco Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257422 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-usb,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail The for_each_child_of_node() macro requires an explicit call to of_node_put() on early exits to decrement the child refcount and avoid a memory leak. The child node is not required outsie the loop, and the resource must be released before the function returns. Add the missing of_node_put(). Cc: stable@vger.kernel.org Fixes: 82e82130a78b ("usb: core: Set connect_type of ports based on DT node") Signed-off-by: Javier Carrasco --- This bug was found while doing some code analysis, and I could not test it with real hardware. Although the issue and it solution are straightforward, any validation beyond compilation and static analysis is always welcome. --- drivers/usb/core/of.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c index f1a499ee482c..763e4122ed5b 100644 --- a/drivers/usb/core/of.c +++ b/drivers/usb/core/of.c @@ -84,9 +84,12 @@ static bool usb_of_has_devices_or_graph(const struct usb_device *hub) if (of_graph_is_present(np)) return true; - for_each_child_of_node(np, child) - if (of_property_present(child, "reg")) + for_each_child_of_node(np, child) { + if (of_property_present(child, "reg")) { + of_node_put(child); return true; + } + } return false; } --- base-commit: 62c97045b8f720c2eac807a5f38e26c9ed512371 change-id: 20240624-usb_core_of_memleak-79161623b62e Best regards, -- Javier Carrasco . From: Yazen Ghannam To: CC: , , , , , Yazen Ghannam Subject: [PATCH v2 0/5] Rework mce_setup() Date: Mon, 24 Jun 2024 16:20:03 -0500 Message-ID: <20240624212008.663832-1-yazen.ghannam@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257430 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-edac Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi all, Patches 1-2 are new in this revision. They address a comment from Boris to reuse a new helper function from the recent APIC/topology rework. Patches 3-4 are unchanged. Patch 5 is updated with the changes from the new patches. Thanks, Yazen Link: https://lkml.kernel.org/r/20240521125434.1555845-1-yazen.ghannam@amd.com Yazen Ghannam (5): x86/topology: Export helper to get CPU number from APIC ID x86/mce: Fixup APIC ID search for x86 CPER decoding x86/mce: Rename mce_setup() to mce_prep_record() x86/mce: Define mce_prep_record() helpers for common and per-CPU fields x86/mce: Use mce_prep_record() helpers for apei_smca_report_x86_error() arch/x86/include/asm/mce.h | 2 +- arch/x86/include/asm/topology.h | 6 +++++ arch/x86/kernel/cpu/mce/amd.c | 2 +- arch/x86/kernel/cpu/mce/apei.c | 23 +++++++----------- arch/x86/kernel/cpu/mce/core.c | 38 ++++++++++++++++++++---------- arch/x86/kernel/cpu/mce/internal.h | 2 ++ arch/x86/kernel/cpu/topology.c | 15 +++++++++--- 7 files changed, 55 insertions(+), 33 deletions(-) base-commit: 2db56ea9b277e1790f6a4d8fdd949ab81ba34c76 -- 2.34.1 . Date: Mon, 24 Jun 2024 23:21:22 +0200 From: Luca Ceresoli To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "devicetree@vger.kernel.org" Cc: Bartosz Golaszewski , Saravana Kannan , linux-kernel@vger.kernel.org, =?UTF-8?Q?Herv?= =?UTF-8?Q?=C3=A9?= Codina , Thomas Petazzoni Subject: Fixing property memory leaks on device tree overlay removal Message-ID: <20240624232122.3cfe03f8@booty> Organization: Bootlin X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257433 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello, device tree overlays are implemented in the kernel since a long time, but there is currently no code using them, except unittest. The largest (in terms of code lines involved) blocker for enabling it is the memory leak of properties that happen on overlay removal [0]. The kernel warns about it on overlay insertion: OF: overlay: WARNING: memory leak will occur if overlay removed, property= : /... We are working on a driver for a proprietary connector allowing a device to connect to an add-on board adding new non-discoverable hardware, and the driver is based on overlays. This has been discussed during ELC last April [1] and I sent a patch series implementing it in May [2]. The property memory leak topic was mentioned but we haven't addressed the detail so far. This e-mail is meant to present our proposed plan to fix it. Receiving comments from the kernel community would be very valuable given the amount of work involved. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Problem description =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D In the kernel every 'struct device_node' is refcounted so the OF core knows when to free it. There are of course get/put imbalance bugs around, but these are "just" bugs that need to be fixed as they are found. On the other hand, there is no refcounting for 'struct property'. Yet some of the internal kernel APIs to access properties, e.g. of_property_read_string(), return either a 'struct property' pointer or a copy of the 'char *value' field. This is not a bug, it is an API design flaw: any user (e.g. any OF driver) can take a pointer to property data that was allocated and should be deallocated by the OF core, but the OF core has no idea of when that pointer will stop being used.=20 Now, when loading a DT overlay there are three possible cases: 1. both the property and the containing node are in the base tree 2. both the property and the containing node are in the same overlay 3. the property is in an overlay and the containing node is either in the base tree or in a previously-loaded overlay Cases 1 and 2 are not problematic. In case 1 the data allocated for the properties is never removed. In case 2 the properties are removed when removing the parent node, which gets removed when removing the overlay thanks to 'struct device_node' refcounting, based on the assumption that the property lifetime is a subset of the parent node lifetime. The problem exists in case 3. Properties in case 3 are usually a small part of all the properties but there can be some (and there are some in the product we are working on), and that's what needs to be addressed. The kernel just doesn't know when to release these property structures, so the OF core code currently stores the properties loaded by overlays in a "deadprops" list within the parent node. They will be freed when the node itself is freed (based on node refcounting) in order to be safe. However it means they are memory leaks for case 3, where the node can be never removed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Approach 1: adding property refcount =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The first option we considered is the obvious one: adding a refcount to 'struct property'. However this does not look like a very good solution as every user of a DT property in the kernel would need to put the property after getting and using it: this is already cumbersome and error-prone for nodes, and properties are usually many more than nodes. Besides it would add a memory and execution overhead to all properties, while only a small fraction is affected. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D Approach 2: change the property APIs to not return pointers =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D So we went back to the API design flaw and thought what API we would invent if we had to start from scratch now with the laodable overlay requirement in mind. We concluded the property API should just not return any pointer to 'struct property' or one of its fields. In other words, this is internal data of the OF core. We think the API to access DT properties should instead do one of these: 1. check whatever is needed and return the outcome, not the internal data, e.g. like of_property_match_string() 2. if that is not possible, return a copy of the property value, that the called will be responsible of, and which can outlive the struct property if that make sense With this approach, it becomes safe to remove the overlay at any moment _unless_ one of these API functions is currently executing on any CPU core. To ensure there is no race condition we need a lock, probably using rwsem or RCU, to guard the APIs accessing properties. This can be coarse-grained (one global lock, or one lock per changeset) and needs no cooperation from callers, being all managed by the OF core. So this is is the option we plan to take. ~~~~~~~~~~~~~~~~~~~~~~~ Accessor classification ~~~~~~~~~~~~~~~~~~~~~~~ We examined and classified the various APIs that allow accessing the OF properties, which we called accessors, and counted their call sites. There are three kinds of property accessor functions in the OF APIs that need to be fixed: 1. classic accessors 2. for_each loop macros and supporting functions 3. OF reconfig notifiers ----------------- Classic accessors ----------------- Classic accessors are those that return some property value. Examples include: of_find_property() of_property_read_string() of_get_property() of_property_read_string_index() Classic accessors have lots of call sites: we counted about 1900. Many are in drivers and will need to be addressed individually, one by one. So the plan is to add new "safe" accessors and progressively convert drivers and other call sites to use them, to eventually remove the current unsafe accessors. One supporting strategy in that direction is making 'struct property' opaque, which would ensure its fields just cannot be accessed directly. I attempted it and the amount of code that gets broken and needs to be fixed is "manageable". An even stronger strategy is to move struct property completely outside in-kernel public include files (i.e. from include/linux/of.h to drivers/of/of_private.h) so even struct property pointer cannot exist anymore outside of the OF core. However this is quite extreme and very hard to apply (see the section about for_each loops). --------------------------------------------- for_each loop macros and supporting functions --------------------------------------------- Fixing the for_each iterators (about 140 call sites) is hard because they use 'struct property' pointers "internally", but being macros the iterarot is exposed to code using those macros. So we propose a mitigation strategy that is more approachable and a removal strategy. The mitigation strategy is based on the declaring variables in the for loop init clause, as allowed since the kernel has moved to C gnu11. This would allow replacing typical code like: struct device_node *node =3D <...>; struct property *prop; const __be32 *cur; u32 rate; of_property_for_each_u32(node, "my-property", prop, cur, rate) { with code like: struct device_node *node =3D <...>; u32 rate; of_property_for_each_u32(node, "my-property", rate) { This is only a mitigation strategy because it would not strictly forbid access to the struct property and the __be32 variables. But it would make it less easy and much more visible to code reviewers and possibly checkpatch, and as such it would make it hard to add my mistake. It also makes code simpler and more readable so it is an overall improvement as well. This is simple to implement and at first glance about half of the call sites can benefit. For those which cannot, an ad-hoc solution must be devised, possibly based on a full array copy as a last resort. The removal strategy involves a total removal of these looping macros, in lack of a way to implement them without giving access to the property and iterator pointers. Removal of these APIs would involve replacing them with specific accessors that internally loop and do what is needed (for common cases) or return a full copy for other cases. Passing a callback for the looping function to operate on members is also potentially doable but cumbersome for callers. Instead of the removal strategy I think there might be better tools, but I still haven't done a real evaluations so far. Note that if struct property were made internal, the removal strategy would become unavoidable. --------------------- OF reconfig notifiers --------------------- Reconfig notifiers are callbacks that can be enabled in order to be notified of changes to the device tree. The APIs themselves are not leaking internal pointers, but the notifier callbacks are passed a 'struct of_reconfig_data *' parameter which contains pointers to the old and new struct property pointers. If struct property were opaque this would not expose pointers to property name/len/value. Still the struct property pointer would be exposed. So we propose to make the entire struct of_reconfig_data opaque. The drawback is that several new (trivial) accessors would be needed to get the data from such an opaque structure. However call sites of notifiers are limited (about 10), some don=E2=80=99t even access properties= at all and others appear to use them carefully, so a fix would be relatively simple to do. ~~~~~~~~~~~~~~~ Transition plan ~~~~~~~~~~~~~~~ Transitioning to the new accessors is not going to happen quickly given the amount of call sites, so we devised a strategy to incrementally approach it while avoiding introducing new calls to the old APIs. The transition plan is based on adding a Kconfig symbol (a tentative name is CONFIG_EXPORT_UNSAFE_OF_ACCESSORS) meaning =E2=80=9Cexport old OF accessor functions returning pointers to firmware data=E2=80=9D and default= ing to =E2=80=98y=E2=80=99 to avoid breaking current usages. When this is set t= o =E2=80=98n=E2=80=99: - The old accessors returning pointers to struct property values are not built, or at least not exported outside the OF core - So any defconfig with at least one driver using the old accessors would just not build, which allows to easily find out what needs to be updated if one wants to remove overlays in their specific configuration, or to disable unneeded drivers that are not yet updated - The property leaks under discussion are not possible anymore - The deadprops list and the warning are not built - Note: we need to ensure automated test bots won=E2=80=99t set this setti= ng to =E2=80=98n=E2=80=99 or they will fail Any code using DT overlays, including the connector driver proposed in [2], can depend on CONFIG_EXPORT_UNSAFE_OF_ACCESSORS=3Dn, to ensure the leaking APIs are never called when runtime-loadable overlays are in use. Preventing new usages of old accessors will be important. Tools to achieve that: * Extend checkpatch to report an error on their usage * Add a 'K:' entry to MAINTAINERS so that patches trying to use them will be reported (to me at least) Once all call sites are updated to the new API, the old API can be removed entirely along with the deadprops list and the CONFIG_EXPORT_UNSAFE_OF_ACCESSORS Kconfig symbol. =3D=3D=3D=3D=3D=3D=3D Roadmap =3D=3D=3D=3D=3D=3D=3D We plan to address this in various steps, in order to allow an easier review process and to have the various changes tested progressively. The main steps in our roadmap are: 1. Make struct property opaque and fix code that gets broken 2. Main API transition (class 1): - Add new safe accessors - Implement CONFIG_EXPORT_UNSAFE_OF_ACCESSORS to hide leaking accessors - Document the above - OF implementation - fwnode wrapper (for ACPI+SWNODE) - rwsem/RCU synchronisation mechanism - convert a few drivers 3. Prevent new patches using old accessors from being merged (checkpatch, MAINTAINERS...) 4. Convert a significant number of drivers (enough to support a complex SoC) 5. for_each loops (class 2) mitigation strategy 6. Make struct of_reconfig_data opaque (class 3) 7. for_each loops (class 2) full removal strategy We think the necessity of the last two step is subject to discussion, while all the previous ones are required. Note there is no "convert all call sites" in the plan. The amount of drivers alone is huge, and converting all of them would not be doable entirely by us both in terms of amount of work and for lack of hardware to test the changes. However we plan to convert many drivers and we will be glad to support the community in fixing the existing code, as well as in avoiding new code using old accessors to be accepted. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Conclusion =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D So, that's our proposed plan. As stated, any comment will be appreciated. This includes both (hopefully constructive) criticism and positive feedback. This would mean starting a relevant work with a good assurance that the approach is approved by the relevant kernel maintainers. Best regards, Luca [0] https://elinux.org/Frank%27s_Evolving_Overlay_Thoughts#issues_and_what_= needs_to_be_completed_--_Not_an_exhaustive_list [1] https://lore.kernel.org/all/20240426115141.201f257a@booty/ [2] https://lore.kernel.org/all/20240510-hotplug-drm-bridge-v2-0-ec32f2c66d= 56@bootlin.com/ --=20 Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com . From: Mudit Sharma To: jic23@kernel.org, lars@metafoo.de, krzk+dt@kernel.org, conor+dt@kernel.org, robh@kernel.org Cc: ivan.orlov0322@gmail.com, Mudit Sharma , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v5 1/2] dt-bindings: iio: light: ROHM BH1745 Date: Mon, 24 Jun 2024 22:55:37 +0100 Message-ID: <20240624215543.459797-1-muditsharma.info@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257451 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Add ROHM BH1745 - 4 channel I2C colour sensor's dt-bindings. Signed-off-by: Mudit Sharma Reviewed-by: Krzysztof Kozlowski --- v4->v5: - Add power supply info v3->v4: - No changes v2->v3: - Move 'additionalProperties' after 'required' block - Remove block style indicator '|' from description v1->v2: - Fix yaml issue: Make `maintainers` a list .../bindings/iio/light/rohm,bh1745.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml diff --git a/Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml b/Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml new file mode 100644 index 000000000000..44896795c67e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/light/rohm,bh1745.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/light/rohm,bh1745.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ROHM BH1745 colour sensor + +maintainers: + - Mudit Sharma + +description: + BH1745 is an I2C colour sensor with red, green, blue and clear + channels. It has a programmable active low interrupt pin. + Interrupt occurs when the signal from the selected interrupt + source channel crosses set interrupt threshold high/low level. + +properties: + compatible: + const: rohm,bh1745 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: true + +required: + - compatible + - reg + - vdd-supply + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + colour-sensor@38 { + compatible = "rohm,bh1745"; + reg = <0x38>; + interrupt-parent = <&gpio>; + interrupts = <19 IRQ_TYPE_LEVEL_LOW>; + vdd-supply = <&vdd>; + }; + }; + +... -- 2.43.0 .