KIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Ricardo Ribalda [ Upstream commit 71fe80364a6584f404556ac9a6a4aca4ab80fb5b ] iris_venc_s_param() uses do_div to divide two 64 bits operators, this is wrong. Luckily for us, both of the operators fit in 32 bits, so we can use a normal division. Now that we are at it, mark the fps smaller than 1 as invalid, the code does not seem to handle them properly. The following cocci warning is fixed with this patch: ./platform/qcom/iris/iris_venc.c:378:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead Fixes: 4ff586ff28e3 ("media: iris: Add support for G/S_PARM for encoder video device") Reviewed-by: Dikshita Agarwal Cc: stable@vger.kernel.org Signed-off-by: Ricardo Ribalda Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/iris/iris_venc.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c index 099bd5ed4ae02..c11ed778cc9e9 100644 --- a/drivers/media/platform/qcom/iris/iris_venc.c +++ b/drivers/media/platform/qcom/iris/iris_venc.c @@ -345,8 +345,7 @@ int iris_venc_s_param(struct iris_inst *inst, struct v4l2_streamparm *s_parm) struct v4l2_fract *timeperframe = NULL; u32 default_rate = DEFAULT_FPS; bool is_frame_rate = false; - u64 us_per_frame, fps; - u32 max_rate; + u32 fps, max_rate; int ret = 0; @@ -368,23 +367,19 @@ int iris_venc_s_param(struct iris_inst *inst, struct v4l2_streamparm *s_parm) timeperframe->denominator = default_rate; } - us_per_frame = timeperframe->numerator * (u64)USEC_PER_SEC; - do_div(us_per_frame, timeperframe->denominator); - - if (!us_per_frame) + fps = timeperframe->denominator / timeperframe->numerator; + if (!fps) return -EINVAL; - fps = (u64)USEC_PER_SEC; - do_div(fps, us_per_frame); if (fps > max_rate) { ret = -ENOMEM; goto reset_rate; } if (is_frame_rate) - inst->frame_rate = (u32)fps; + inst->frame_rate = fps; else - inst->operating_rate = (u32)fps; + inst->operating_rate = fps; if ((s_parm->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && vb2_is_streaming(src_q)) || (s_parm->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && vb2_is_streaming(dst_q))) { -- 2.51.0 From - Sat Feb 28 20:01:20 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id YOhqH4tJo2mrTwEAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:15 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:15 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQV1-00000000ZP1-0pzX for hi@josie.lol; Sat, 28 Feb 2026 20:01:15 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 0EED0321830C for ; Sat, 28 Feb 2026 19:46:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C809336ECF; Sat, 28 Feb 2026 17:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jrs79DPH" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A121175A7E; Sat, 28 Feb 2026 17:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301393; cv=none; b=LcekX2m51cNtNNoN/YBp/oQKLF/M9INXtMaqdYtulhVkoWG3hefOLra54bQib7cphbnM3XPjELF+RuuzB7nliPVm3UmOYQIFGn9sJqiXspegb7stmQA7K37+sYvJQXfWw5Hn7B5AVCl2si+dEbZlQspTkBEmMO1S+cxk4a2qKJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301393; c=relaxed/simple; bh=3N2WL6347zenZWHoCxHm+ZIceA41zQD5jFthGbV551c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TOU5Ng5rv6DTiI9TD9tupk8XiFlB8yLsCs4qRtKDz1sKtZuRTjWKBOJ7e2m4eLRBYU7lyNg0NRFuuUPcXGVLB/hIBfpGYgF8o4p1n4FCAYP7U7qgk95T1v133Rpm6/ODLnxWCqlOaqzeQC/SQ69cbdaaWI5oEE0K3pTI9JifzFQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jrs79DPH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 852B1C116D0; Sat, 28 Feb 2026 17:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301393; bh=3N2WL6347zenZWHoCxHm+ZIceA41zQD5jFthGbV551c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jrs79DPHHjnu6GCvuNhQtVJXcCMSpFZfOs9WQgOddp9pK1eh548osfEANu7cFpERh OQHuoYcX74OZxSQnepnnh7gGcAC6134eX8SS738ztfj4/W2oYXo6VwDzl040TLqudB kqDipvzTIjQwAafEWA5g97UJvOkTg8OWsUJoG8dDd4+ykmvmBmXhf2zLXrY847mPrI NoLLFN9f1ri2l8DffFmOxI3fMEOMiOMiq1TpCRidGsMEWxg50MVYrF0REKn87Nygm9 44LSU1suoFWrnRjfEBQ5TlJR2RRFsaHPcRQB18SHCWX1lIzo70JLiarTUGxv6MZSzH pPEfuKUzvOwvA== From: Sasha Levin To: patches@lists.linux.dev Cc: Xu Yang , stable@vger.kernel.org, Frank Li , Vinod Koul , Sasha Levin Subject: [PATCH 6.18 581/752] phy: fsl-imx8mq-usb: set platform driver data Date: Sat, 28 Feb 2026 12:44:52 -0500 Message-ID: <20260228174750.1542406-581-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: msgid.link] 0.0 URIBL_DBL_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to dbl.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.0 URIBL_ZEN_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Xu Yang [ Upstream commit debf8326a435ac746f48173e4742a574810f1ff4 ] Add missing platform_set_drvdata() as the data will be used in remove(). Fixes: b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95") Cc: stable@vger.kernel.org Signed-off-by: Xu Yang Reviewed-by: Frank Li Link: https://patch.msgid.link/20260120111646.3159766-1-xu.yang_2@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c index bd37b6cb69cdc..8e7b6e10e1f0b 100644 --- a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c +++ b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c @@ -662,6 +662,8 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev) if (!imx_phy) return -ENOMEM; + platform_set_drvdata(pdev, imx_phy); + imx_phy->clk = devm_clk_get(dev, "phy"); if (IS_ERR(imx_phy->clk)) { dev_err(dev, "failed to get imx8mq usb phy clock\n"); -- 2.51.0 From - Sat Feb 28 20:01:28 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id MADNKpNJo2ltBgIAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:23 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:23 +0000 Received: from sea.lore.kernel.org ([172.234.253.10]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQV8-00000000ZeL-3GHr for hi@josie.lol; Sat, 28 Feb 2026 20:01:23 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 000A334A1746 for ; Sat, 28 Feb 2026 19:52:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4687739B976; Sat, 28 Feb 2026 18:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LicmB6bK" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2123A39B974; Sat, 28 Feb 2026 18:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772302655; cv=none; b=mZ5oPCcXzVDO++nwnQ3TvILDErUqjPUkmmcNX/HMJbwQ8ZH1uzOHJHZizc3nzrDLTs/pl1H9fka1tkLeqQrxNEIR56gB/BqEoE7zVUEsaI6ZcHxFjpIh4QDS4Y6lm43FV5N0woNiucjb7Rn6IHnX9oKaB7NnrHzxX8jx6ahC/aw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772302655; c=relaxed/simple; bh=CbIyEBX78UQaO8emwkQjJLhw1FVuiDuI9253snAJ7Rs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZL7Si3DaAQ3J1DLV+CpSXAWIpa78dtFaI6OXgI70gxUefOUTuHQJtovJBWASC24N/wWvS/reIqgsaXXJ3F6rsI5DM61SUjRwdTf0C3cqVrJvKDadikcHj1iWj/xSRlGRmM4ZwrpoxWTx0mPG3d08Lz3JbZwL4ScOSR7orastvMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LicmB6bK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0F81C116D0; Sat, 28 Feb 2026 18:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772302655; bh=CbIyEBX78UQaO8emwkQjJLhw1FVuiDuI9253snAJ7Rs=; h=From:To:Cc:Subject:Date:From; b=LicmB6bKfx3tqYC1Oyc5tyWsh97NjZrpUm5sYw5eFRwPyefcqAsEWMYoF8XeheHg0 8dG6NHW6vWi7Ahw4n9x38GZ6pDnzhMThQwxnncgFg3E7HZcljbE6RUeHNhQj9bFJ3c yTHNSGMryyyCNWmZqfm7/a34ABWq8B5/d1hBjRHIrXEEIY1Cs9Uf/wRNKVGCcLGZny r1o0tTt2lYjDgZpzWnhqwvJTn25loifBDz42/UakUkS/kfmVOPD4oeyu+9KMpdZzVo TzFwnOjECQrCbzs5zXhWTc8w73RFYb09cf1YpmvKZg3mtQ5IVy7WGBomYJldLbasTS 06LNWDjATXAzQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sasha Levin , gregkh@linuxfoundation.org, patches@lists.linux.dev, torvalds@linux-foundation.org, akpm@linux-foundation.org, linux@roeck-us.net, shuah@kernel.org, patches@kernelci.org, lkft-triage@lists.linaro.org, pavel@nabladev.com, jonathanh@nvidia.com, f.fainelli@gmail.com, sudipm.mukherjee@gmail.com, rwarsow@gmx.de, conor@kernel.org, hargar@microsoft.com, broonie@kernel.org, achill@achill.org, sr@sladewatkins.com Subject: [PATCH 5.10 000/147] 5.10.252-rc1 review Date: Sat, 28 Feb 2026 13:17:31 -0500 Message-ID: <20260228181731.1605473-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.252-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.252-rc1 X-KernelTest-Deadline: 2026-03-02T18:17+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.234.253.10 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.234.253.10 listed in list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 This is the start of the stable review cycle for the 5.10.252 release. There are 147 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know. Responses should be made by Mon Mar 2 06:17:30 PM UTC 2026. Anything received after that time might be too late. The whole patch series can be found in one patch at: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=linux-5.10.y&id2=v5.10.251 or in the git tree and branch at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y and the diffstat can be found below. Thanks, Sasha ------------- Pseudo-Shortlog of commits: Aboorva Devarajan (1): cpuidle: Skip governor when only one idle state is available Aleksei Oladko (1): selftests: forwarding: vxlan_bridge_1d: fix test failure with br_netfilter enabled Alexander Koskovich (1): power: reset: nvmem-reboot-mode: respect cell size for nvmem_cell_write Allison Henderson (1): net/rds: rds_sendmsg should not discard payload_len Alok Tiwari (1): mtd: rawnand: cadence: Fix return type of CDMA send-and-wait helper Alper Ak (2): tpm: tpm_i2c_infineon: Fix locality leak on get_burstcount() failure tpm: st33zp24: Fix missing cleanup on get_burstcount() error Andreas Gruenbacher (6): gfs2: Add new gfs2_iomap_get helper gfs2: Turn gfs2_extent_map into gfs2_{get,alloc}_extent gfs2: Replace gfs2_lblk_to_dblk with gfs2_get_extent gfs2: Add wrapper for iomap_file_buffered_write gfs2: Move the inode glock locking to gfs2_file_buffered_write gfs2: Add metapath_dibh helper André Draszik (1): regulator: core: move supply check earlier in set_machine_constraints() AngeloGioacchino Del Regno (2): arm64: dts: qcom: sdm630: Add qfprom subnodes dmaengine: mediatek: uart-apdma: Fix above 4G addressing TX/RX Anshumali Gaur (1): octeontx2-af: Fix PF driver crash with kexec kernel booting Anthony Iliopoulos (1): nfsd: never defer requests during idmap lookup Antonio Borneo (1): coresight: etm3x: Fix cpulocked warning on cpuhp Ben Dooks (1): fs: add for 'init_fs' Billy Tsai (1): i3c: Move device name assignment after i3c_bus_init Chaitanya Mishra (1): staging: greybus: lights: avoid NULL deref Chen Jinghuang (1): sched/rt: Skip currently executing CPU in rto_next_cpu() Chen-Yu Tsai (1): ARM: dts: allwinner: sun5i-a13-utoo-p66: delete "power-gpios" property Christian Kohlschütter (1): regulator: core: Fix off-on-delay-us for always-on/boot-on regulators Christoph Hellwig (1): iomap: fix submission side handling of completion side errors Chuck Lever (9): svcrdma: Add a batch Receive posting mechanism svcrdma: Use svc_rdma_refresh_recvs() in wc_receive svcrdma: Maintain a Receive water mark RDMA/core: Fix a couple of obvious typos in comments svcrdma: Remove queue-shortening warnings svcrdma: Clean up comment in svc_rdma_accept() svcrdma: Increase the per-transport rw_ctx count svcrdma: Reduce the number of rdma_rw contexts per-QP RDMA/core: add rdma_rw_max_sge() helper for SQ sizing Colin Ian King (1): scsi: csiostor: Fix dereference of null pointer rn Dan Carpenter (2): EDAC/i5000: Fix snprintf() size calculation in calculate_dimm_size() EDAC/i5400: Fix snprintf() limit calculation in calculate_dimm_size() Davide Caratti (1): selftests: forwarding: tc_actions: cleanup temporary files when test is aborted Deepanshu Kartikey (1): gfs2: Fix use-after-free in iomap inline data write path Dmitry Baryshkov (3): arm64: dts: qcom: sdm630: fix gpu_speed_bin size arm64: dts: qcom: sdm845-db845c: specify power for WiFi CH1 clk: qcom: dispcc-sdm845: convert to parent data Dmytro Maluka (1): iommu/vt-d: Flush cache for PASID table before using it Douglas Anderson (1): regulator: core: Shorten off-on-delay-us for always-on/boot-on by time since booted Eric Dumazet (2): tcp: tcp_tx_timestamp() must look at the rtx queue ipv6: fix a race in ip6_sock_set_v6only() Eric Joyner (1): ionic: Rate limit unknown xcvr type messages Felix Gu (2): fbdev: au1200fb: Fix a memory leak in au1200fb_drv_probe() pinctrl: equilibrium: Fix device node reference leak in pinbank_init() Fernando Fernandez Mancera (3): netfilter: nf_conncount: make nf_conncount_gc_list() to disable BH netfilter: nf_conncount: increase the connection clean up limit to 64 netfilter: nf_conncount: fix tracking of connections from localhost Filipe Manana (1): btrfs: qgroup: return correct error when deleting qgroup relation item Florian Westphal (2): netfilter: nft_set_hash: fix get operation on big endian netfilter: nf_conntrack_h323: don't pass uninitialised l3num value Francesco Lavra (1): spi: tools: Add include folder to .gitignore Geert Uytterhoeven (1): clk: Move clk_{save,restore}_context() to COMMON_CLK section Greg Kroah-Hartman (1): Revert "mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms" Guenter Roeck (1): Revert "hwmon: (ibmpex) fix use-after-free in high/low store" Gui-Dong Han (1): PM: sleep: wakeirq: harden dev_pm_clear_wake_irq() against races Haotian Zhang (5): clk: qcom: Return correct error code in qcom_cc_probe_by_index() soc: qcom: cmd-db: Use devm_memremap() to fix memory leak in cmd_db_dev_probe PCI: mediatek: Fix IRQ domain leak when MSI allocation fails power: supply: bq27xxx: fix wrong errno when bus ops are unsupported mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer() failure Harshit Mogalapalli (1): iio: sca3000: Fix a resource leak in sca3000_probe() Honggang LI (1): RDMA/rtrs: server: remove dead code Håkon Bugge (2): PCI: Do not attempt to set ExtTag for VFs PCI: Initialize RCB from pci_configure_device() Ido Schimmel (2): selftests: mlxsw: tc_restrictions: Fix test failure with new iproute2 selftests: forwarding: tc_actions: Use ncat instead of nc Jamie Iles (1): i3c: remove i2c board info from i2c_dev_desc Jerome Brunet (4): arm64: dts: amlogic: axg: assign the MMC signal clocks arm64: dts: amlogic: gx: assign the MMC signal clocks arm64: dts: amlogic: g12: assign the MMC B and C signal clocks arm64: dts: amlogic: g12: assign the MMC A signal clock Jiasheng Jiang (1): RDMA/rxe: Fix double free in rxe_srq_from_init Jiayuan Chen (2): net: atm: fix crash due to unvalidated vcc pointer in sigd_send() serial: caif: fix use-after-free in caif_serial ldisc_close() Jinliang Zheng (1): procfs: fix missing RCU protection when reading real_parent in do_task_stat() Justin Chen (1): usb: bdc: fix sleep during atomic Jörg Wedekind (1): PCI: Mark 3ware-9650SA Root Port Extended Tags as broken Konstantin Andreev (2): smack: /smack/doi must be > 0 smack: /smack/doi: accept previously used values Krzysztof Kozlowski (1): arm64: dts: qcom: sdm630: correct QFPROM byte offsets Li Chen (1): nvdimm: virtio_pmem: serialize flush requests Li Nan (1): md/raid10: fix any_working flag handling in raid10_sync_request Linus Walleij (1): power: supply: wm97xx_battery: Convert to GPIO descriptor Mario Limonciello (AMD) (1): crypto: ccp - Add an S4 restore flow Mark Brown (1): regulator: Flag uncontrollable regulators as always_on Martin Blumenstingl (1): clk: meson: gxbb: Limit the HDMI PLL OD to /4 on GXL/GXM SoCs Matthew Schwartz (1): mmc: rtsx_pci_sdmmc: increase power-on settling delay to 5ms Matthias Kaehlcke (1): regulator: core: Use ktime_get_boottime() to determine how long a regulator was off Miri Korenblit (1): wifi: cfg80211: stop NAN and P2P in cfg80211_leave Narayana Murty N (1): powerpc/eeh: fix recursive pci_lock_rescan_remove locking in EEH event handling Nuno Sá (1): dma: dma-axi-dmac: fix SW cyclic transfers Olga Kornievskaia (1): pNFS: fix a missing wake up while waiting on NFS_LAYOUT_DRAIN Oliver Neukum (1): usbb: catc: use correct API for MAC addresses Ondrej Mosnacek (1): ucount: check for CAP_SYS_RESOURCE using ns_capable_noaudit() Pablo Neira Ayuso (1): netfilter: nft_set_rbtree: check for partial overlaps in anonymous sets Paul Cercueil (2): PM: core: Redefine pm_ptr() macro PM: core: Add new *_PM_OPS macros, deprecate old ones Petr Hodina (1): clk: qcom: dispcc-sdm845: Enable parents for pixel clocks Qing Wang (1): ovl: Fix uninit-value in ovl_fill_real Randy Dunlap (2): serial: imx: change SERIAL_IMX_CONSOLE to bool serial: SH_SCI: improve "DMA support" prompt Rui Feng (1): misc: rtsx: Add SD Express mode support for RTS5261 Sai Ritvik Tanksalkar (1): pstore/ram: fix buffer overflow in persistent_ram_save_old() Salah Triki (1): s390/cio: Fix device lifecycle handling in css_alloc_subchannel() Samuel Wu (1): PM: wakeup: Handle empty list in wakeup_sources_walk_start() Sasha Levin (1): Linux 5.10.252-rc1 Sebastian Andrzej Siewior (2): EDAC/altera: Remove IRQF_ONESHOT mfd: wm8350-core: Use IRQF_ONESHOT Shardul Bankar (1): hfsplus: return error when node already exists in hfs_bnode_create Srinivasan Shanmugam (1): drm/amdgpu: Use explicit VCN instance 0 in SR-IOV init Steven Rostedt (1): tracing: Remove duplicate ENABLE_EVENT_STR and DISABLE_EVENT_STR macros Svyatoslav Ryhel (1): drivers: iio: mpu3050: use dev_err_probe for regulator request Thomas Bogendoerfer (1): bonding: only set speed/duplex to unknown, if getting speed failed Thomas Fourier (3): auxdisplay: arm-charlcd: fix release_mem_region() size crypto: cavium - fix dma_free_coherent() size crypto: octeontx - fix dma_free_coherent() size Thomas Gleixner (1): hrtimer: Fix trace oddity Thomas Weißschuh (1): ARM: VDSO: Patch out __vdso_clock_getres() if unavailable Tzung-Bi Shih (1): platform/chrome: cros_ec_lightbar: Fix response size initialization Ulf Hansson (1): mmc: core: Initial support for SD express card/host Uwe Kleine-König (1): PCI/portdrv: Fix potential resource leak Vincent Whitchurch (2): regulator: core: Respect off_on_delay at startup regulator: core: Fix off_on_delay handling Vladimir Zapolskiy (2): ARM: dts: lpc32xx: Set motor PWM #pwm-cells property value to 3 cells arm: dts: lpc32xx: add clocks property to Motor Control PWM device tree node Waqar Hameed (7): power: supply: act8945a: Fix use-after-free in power_supply_changed() power: supply: bq25980: Fix use-after-free in power_supply_changed() power: supply: cpcap-battery: Fix use-after-free in power_supply_changed() power: supply: goldfish: Fix use-after-free in power_supply_changed() power: supply: rt9455: Fix use-after-free in power_supply_changed() power: supply: sbs-battery: Fix use-after-free in power_supply_changed() power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed() Wei Li (1): pinctrl: single: fix refcount leak in pcs_add_gpio_func() Yi Liu (2): RDMA/uverbs: Validate wqe_size before using it in ib_uverbs_post_send RDMA/uverbs: Add __GFP_NOWARN to ib_uverbs_unmarshall_recv() kmalloc YunJe Shin (2): RDMA/siw: Fix potential NULL pointer dereference in header processing RDMA/umad: Reject negative data_len in ib_umad_write Zhiyu Zhang (1): fat: avoid parent link count underflow in rmdir Ziyi Guo (3): wifi: ath10k: sdio: add missing lock protection in ath10k_sdio_fw_crashed_dump() net: usb: catc: enable basic endpoint checking xen-netback: reject zero-queue configuration from guest Makefile | 4 +- arch/arm/boot/dts/lpc32xx.dtsi | 3 +- arch/arm/boot/dts/sun5i-a13-utoo-p66.dts | 1 + arch/arm/kernel/vdso.c | 1 + arch/arm/mach-pxa/mioa701.c | 1 - arch/arm/mach-pxa/palm27x.c | 1 - arch/arm/mach-pxa/palmte2.c | 1 - arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 6 + .../boot/dts/amlogic/meson-g12-common.dtsi | 9 + arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 9 + arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 9 + arch/arm64/boot/dts/qcom/sdm630.dtsi | 10 + arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 7 + arch/powerpc/include/asm/eeh.h | 2 + arch/powerpc/kernel/eeh_driver.c | 11 +- arch/powerpc/kernel/eeh_pe.c | 74 +++++- drivers/auxdisplay/arm-charlcd.c | 2 +- drivers/base/power/wakeirq.c | 9 +- drivers/base/power/wakeup.c | 4 +- drivers/char/tpm/st33zp24/st33zp24.c | 6 +- drivers/char/tpm/tpm_i2c_infineon.c | 6 +- drivers/clk/meson/gxbb.c | 17 +- drivers/clk/qcom/common.c | 2 +- drivers/clk/qcom/dispcc-sdm845.c | 220 ++++++++--------- drivers/cpuidle/cpuidle.c | 10 + drivers/crypto/cavium/cpt/cptvf_main.c | 3 +- drivers/crypto/ccp/psp-dev.c | 11 + drivers/crypto/ccp/sp-dev.c | 12 + drivers/crypto/ccp/sp-dev.h | 3 + drivers/crypto/ccp/sp-pci.c | 16 +- drivers/crypto/ccp/tee-dev.c | 5 + drivers/crypto/ccp/tee-dev.h | 1 + .../crypto/marvell/octeontx/otx_cptvf_main.c | 3 +- drivers/dma/dma-axi-dmac.c | 3 +- drivers/dma/mediatek/mtk-uart-apdma.c | 10 +- drivers/edac/altera_edac.c | 11 +- drivers/edac/i5000_edac.c | 1 + drivers/edac/i5400_edac.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 45 ++-- drivers/hwmon/ibmpex.c | 9 +- .../coresight/coresight-etm3x-core.c | 12 +- drivers/i3c/master.c | 21 +- drivers/iio/accel/sca3000.c | 6 +- drivers/iio/gyro/mpu3050-core.c | 6 +- drivers/infiniband/core/rw.c | 53 ++-- drivers/infiniband/core/user_mad.c | 8 +- drivers/infiniband/core/uverbs_cmd.c | 7 +- drivers/infiniband/sw/rxe/rxe_srq.c | 3 + drivers/infiniband/sw/siw/siw_qp_rx.c | 3 +- drivers/infiniband/ulp/rtrs/rtrs-srv.c | 8 +- drivers/iommu/intel/pasid.c | 7 +- drivers/md/raid10.c | 2 +- drivers/mfd/arizona-core.c | 2 +- drivers/misc/cardreader/rts5261.c | 4 + drivers/misc/cardreader/rts5261.h | 23 -- drivers/misc/cardreader/rtsx_pcr.c | 5 + drivers/mmc/core/core.c | 15 +- drivers/mmc/core/host.h | 6 + drivers/mmc/core/sd_ops.c | 49 +++- drivers/mmc/core/sd_ops.h | 1 + .../mtd/nand/raw/cadence-nand-controller.c | 2 +- drivers/net/bonding/bond_main.c | 15 +- drivers/net/caif/caif_serial.c | 5 +- .../net/ethernet/marvell/octeontx2/af/rvu.c | 11 + .../ethernet/pensando/ionic/ionic_ethtool.c | 7 +- drivers/net/usb/catc.c | 59 ++++- drivers/net/wireless/ath/ath10k/sdio.c | 6 + drivers/net/xen-netback/xenbus.c | 5 +- drivers/nvdimm/nd_virtio.c | 3 +- drivers/nvdimm/virtio_pmem.c | 1 + drivers/nvdimm/virtio_pmem.h | 4 + drivers/pci/controller/pcie-mediatek.c | 4 +- drivers/pci/pcie/portdrv_core.c | 6 +- drivers/pci/probe.c | 35 ++- drivers/pci/quirks.c | 1 + drivers/pinctrl/pinctrl-equilibrium.c | 1 + drivers/pinctrl/pinctrl-single.c | 2 + drivers/platform/chrome/cros_ec_lightbar.c | 2 +- drivers/power/reset/nvmem-reboot-mode.c | 15 +- drivers/power/supply/act8945a_charger.c | 16 +- drivers/power/supply/bq25980_charger.c | 12 +- drivers/power/supply/bq27xxx_battery.c | 6 +- drivers/power/supply/cpcap-battery.c | 8 +- drivers/power/supply/goldfish_battery.c | 12 +- drivers/power/supply/rt9455_charger.c | 17 +- drivers/power/supply/sbs-battery.c | 36 +-- drivers/power/supply/wm97xx_battery.c | 69 +++--- drivers/regulator/core.c | 68 +++--- drivers/s390/cio/css.c | 2 +- drivers/scsi/csiostor/csio_scsi.c | 3 +- drivers/soc/qcom/cmd-db.c | 7 +- drivers/staging/greybus/light.c | 8 +- drivers/tty/serial/Kconfig | 8 +- drivers/usb/gadget/udc/bdc/bdc_core.c | 4 +- drivers/video/fbdev/au1200fb.c | 6 +- fs/btrfs/qgroup.c | 4 +- fs/fat/namei_msdos.c | 7 +- fs/fat/namei_vfat.c | 7 +- fs/fs_struct.c | 1 + fs/gfs2/bmap.c | 227 +++++++----------- fs/gfs2/bmap.h | 13 +- fs/gfs2/dir.c | 13 +- fs/gfs2/file.c | 59 ++++- fs/gfs2/log.c | 6 +- fs/gfs2/quota.c | 4 +- fs/gfs2/recovery.c | 4 +- fs/hfsplus/bnode.c | 2 +- fs/iomap/direct-io.c | 10 +- fs/nfs/pnfs.c | 3 +- fs/nfsd/nfs4idmap.c | 48 +++- fs/nfsd/nfs4proc.c | 2 - fs/nfsd/nfs4xdr.c | 16 ++ fs/overlayfs/readdir.c | 2 +- fs/proc/array.c | 2 +- fs/pstore/ram_core.c | 11 + include/linux/clk.h | 48 ++-- include/linux/i3c/master.h | 1 - include/linux/mfd/wm8350/core.h | 2 +- include/linux/mmc/host.h | 7 + include/linux/pm.h | 80 +++--- include/linux/regulator/driver.h | 2 +- include/linux/rtsx_pci.h | 23 ++ include/linux/sunrpc/svc_rdma.h | 2 + include/linux/wm97xx.h | 1 - include/net/ipv6.h | 11 +- include/net/netfilter/nf_conntrack_count.h | 1 + include/rdma/ib_verbs.h | 2 +- include/rdma/rw.h | 2 + kernel/sched/rt.c | 5 + kernel/time/hrtimer.c | 2 +- kernel/trace/trace_events.c | 5 - kernel/ucount.c | 2 +- net/atm/signaling.c | 56 ++++- net/ipv4/tcp.c | 3 + net/netfilter/nf_conncount.c | 54 +++-- net/netfilter/nf_conntrack_h323_main.c | 10 +- net/netfilter/nft_connlimit.c | 7 +- net/netfilter/nft_set_hash.c | 9 +- net/netfilter/nft_set_rbtree.c | 30 ++- net/rds/send.c | 6 +- net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 89 ++++--- net/sunrpc/xprtrdma/svc_rdma_transport.c | 46 ++-- net/wireless/core.c | 4 +- security/smack/smackfs.c | 79 +++--- tools/spi/.gitignore | 1 + .../drivers/net/mlxsw/tc_restrictions.sh | 4 +- .../selftests/net/forwarding/tc_actions.sh | 18 +- .../net/forwarding/vxlan_bridge_1d.sh | 26 +- 148 files changed, 1523 insertions(+), 823 deletions(-) -- 2.51.0 From - Sat Feb 28 20:01:33 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id WEctGpVJo2kz6D0AYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:25 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:25 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVA-00000000ZgD-3viJ for hi@josie.lol; Sat, 28 Feb 2026 20:01:25 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 93799315FB64 for ; Sat, 28 Feb 2026 19:46:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AACB4301EEC; Sat, 28 Feb 2026 17:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sa5MazW1" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 841D5301EE2; Sat, 28 Feb 2026 17:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301402; cv=none; b=L+3dkW2WBbuSbsdDBeCEzANMV2IGxwQRuTs1ykVMYb+kTGmCQHY6wt9v3hWWQFHtyp2yL/q6dlhxp63BqMc/HcYg1DJCS/wW/KPaZZ+hboIeUJ/qH2Ids6Asfmi9UCpME5q3ZVN5WJQP1yaDD+iOLmgLAzHQDHtb76gpLvnxECo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301402; c=relaxed/simple; bh=D69dLqnG4kE0GPvxaIQ4APaQPnLIBI7aapXZ5ZXWLI0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tUw48fRdSqfkL1N1kNF3t4PQoP3RLzJ7KS9Vx3pRmEzvd0fD71EbUT14Zi0tGWi2Scc6rbxmsPSFtPknhHWbcTBFQ14kH5qVSxGRMN7KjJtcoYWMN4mKGxWN312IBS9C4TMR5cYZqPewQilBBWm6s5SYiEp7kXLvwxdUrayCwjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sa5MazW1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D23B7C116D0; Sat, 28 Feb 2026 17:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301402; bh=D69dLqnG4kE0GPvxaIQ4APaQPnLIBI7aapXZ5ZXWLI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sa5MazW1ig8DQVC1GygWjT9Yjzyy2dj3u+dTfOjXoYzoutCle3qfGjTzU2rEGe00j 3Iv1vwxNLE2nlrqvIPvLa6fKeA/bbujYnFcf69/97kiq4c854NBtHiUOSs3GjjucuF TahmdcBb3GX8tKaZcFabedkx06hdCoss7CZlNBgEkGESUA87j+v8xkhwZGFKkwr1kp niHTvd+rXuVF32Pt7cKibu6IovtDBTMSkmjjLoWuxGMRdKFT+DJsTg/QoRywsKEZ1D XSgTcBcOjLec5jl0e4zObpjaFH5JgiBjv05q5aF5qblUcgTbykfL6/NBCKdp/G4c4a Qp50cz5xlT9cw== From: Sasha Levin To: patches@lists.linux.dev Cc: Douglas Anderson , stable@vger.kernel.org, Lee Jones , Sasha Levin Subject: [PATCH 6.18 591/752] mfd: core: Add locking around 'mfd_of_node_list' Date: Sat, 28 Feb 2026 12:45:02 -0500 Message-ID: <20260228174750.1542406-591-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: msgid.link] 0.0 URIBL_DBL_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to dbl.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.0 URIBL_ZEN_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Douglas Anderson [ Upstream commit 20117c92bcf9c11afd64d7481d8f94fdf410726e ] Manipulating a list in the kernel isn't safe without some sort of mutual exclusion. Add a mutex any time we access / modify 'mfd_of_node_list' to prevent possible crashes. Cc: stable@vger.kernel.org Fixes: 466a62d7642f ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes") Signed-off-by: Douglas Anderson Link: https://patch.msgid.link/20251210113002.1.I6ceaca2cfb7eb25737012b166671f516696be4fd@changeid Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/mfd-core.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 7d14a1e7631ee..c55223ce4327a 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -22,6 +22,7 @@ #include static LIST_HEAD(mfd_of_node_list); +static DEFINE_MUTEX(mfd_of_node_mutex); struct mfd_of_node_entry { struct list_head list; @@ -105,9 +106,11 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev, u64 of_node_addr; /* Skip if OF node has previously been allocated to a device */ - list_for_each_entry(of_entry, &mfd_of_node_list, list) - if (of_entry->np == np) - return -EAGAIN; + scoped_guard(mutex, &mfd_of_node_mutex) { + list_for_each_entry(of_entry, &mfd_of_node_list, list) + if (of_entry->np == np) + return -EAGAIN; + } if (!cell->use_of_reg) /* No of_reg defined - allocate first free compatible match */ @@ -129,7 +132,8 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev, of_entry->dev = &pdev->dev; of_entry->np = np; - list_add_tail(&of_entry->list, &mfd_of_node_list); + scoped_guard(mutex, &mfd_of_node_mutex) + list_add_tail(&of_entry->list, &mfd_of_node_list); of_node_get(np); device_set_node(&pdev->dev, of_fwnode_handle(np)); @@ -286,11 +290,13 @@ static int mfd_add_device(struct device *parent, int id, if (cell->swnode) device_remove_software_node(&pdev->dev); fail_of_entry: - list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) - if (of_entry->dev == &pdev->dev) { - list_del(&of_entry->list); - kfree(of_entry); - } + scoped_guard(mutex, &mfd_of_node_mutex) { + list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) + if (of_entry->dev == &pdev->dev) { + list_del(&of_entry->list); + kfree(of_entry); + } + } fail_alias: regulator_bulk_unregister_supply_alias(&pdev->dev, cell->parent_supplies, @@ -360,11 +366,13 @@ static int mfd_remove_devices_fn(struct device *dev, void *data) if (cell->swnode) device_remove_software_node(&pdev->dev); - list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) - if (of_entry->dev == &pdev->dev) { - list_del(&of_entry->list); - kfree(of_entry); - } + scoped_guard(mutex, &mfd_of_node_mutex) { + list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) + if (of_entry->dev == &pdev->dev) { + list_del(&of_entry->list); + kfree(of_entry); + } + } regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, cell->num_parent_supplies); -- 2.51.0 From - Sat Feb 28 20:01:33 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id OKHDJpVJo2l6BQIAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:25 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:25 +0000 Received: from sin.lore.kernel.org ([104.64.211.4]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVA-00000000Zex-2Lny for hi@josie.lol; Sat, 28 Feb 2026 20:01:25 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 20A3D30E41EC for ; Sat, 28 Feb 2026 18:28:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 144983B4CF5; Sat, 28 Feb 2026 17:38:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YFJ7xapw" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E64D73B4CED; Sat, 28 Feb 2026 17:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300326; cv=none; b=UTutuvb1IoUJazXqHqBReH3elDqh+E87F95xP9PYzJBz79KXxYiRGMSu+vIkfoWOqKOB3zc4UnWOMsho5RHkZzBS44reVSdf6rzwlHPiBZ5mB5kOphR4SKaZkStrFttBseM4KRDjYLWs/lyrH3HrsBuDYhLEJGmZOVquYJpqQpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300326; c=relaxed/simple; bh=/xayTRITuOFmRiReUOG1S0Z7no1I7nxm+HbPt9IU6NM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AkXGTvRGy/Vgo/wEYRgPvN8pHNlY+548GYD2iDJlKWDKl9Wniz7aedZReqOZjyvDO/Xctv+U1VF0CrQ9EWPM8W4LDGpe9vyV4ABWV3p716PlUW38FQL+y9fbpYqPvMa/V604DK9qfmzMN97vTBoc1z6SOiA0atd2kzIoEevQCEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YFJ7xapw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF99AC19424; Sat, 28 Feb 2026 17:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772300325; bh=/xayTRITuOFmRiReUOG1S0Z7no1I7nxm+HbPt9IU6NM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YFJ7xapw0Sd8NRcdsiA891uGwqvdpV4mwMCIlbYgufhQgV4Kgip2FcW16L+dZqj5a xR9jyeE0u8C0y7zKIhVADzr+yAqPKM9nuDETMQyqnDJd1ZnDjUMXnTOoCjpNBX14L7 k/nVVGNt7fuhxbuV7g7051B/upLCY7H+EEqrOH9VIO4xyiJY6wSi1peuEAB6bSFvAC 3eoXR7sZe0jdkrw+884WNUAwQtalTsI+7P6cOPwkiXRUZgz7+xcfL+tfRSPCY8hQBl HzRLzx4MZW7SSeIuEJQVpEH8DQugVfkxWBWAgj4jCvnvL3+QjxmI6j9A5DSIcpgqbD Nnvhttuuy5Mkg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tzung-Bi Shih , Chen-Yu Tsai , Mathieu Poirier , Sasha Levin Subject: [PATCH 6.19 357/844] remoteproc: mediatek: Break lock dependency to `prepare_lock` Date: Sat, 28 Feb 2026 12:24:30 -0500 Message-ID: <20260228173244.1509663-358-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228173244.1509663-1-sashal@kernel.org> References: <20260228173244.1509663-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [104.64.211.4 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [104.64.211.4 listed in list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Tzung-Bi Shih [ Upstream commit d935187cfb27fc4168f78f3959aef4eafaae76bb ] A potential circular locking dependency (ABBA deadlock) exists between `ec_dev->lock` and the clock framework's `prepare_lock`. The first order (A -> B) occurs when scp_ipi_send() is called while `ec_dev->lock` is held (e.g., within cros_ec_cmd_xfer()): 1. cros_ec_cmd_xfer() acquires `ec_dev->lock` and calls scp_ipi_send(). 2. scp_ipi_send() calls clk_prepare_enable(), which acquires `prepare_lock`. See #0 in the following example calling trace. (Lock Order: `ec_dev->lock` -> `prepare_lock`) The reverse order (B -> A) is more complex and has been observed (learned) by lockdep. It involves the clock prepare operation triggering power domain changes, which then propagates through sysfs and power supply uevents, eventually calling back into the ChromeOS EC driver and attempting to acquire `ec_dev->lock`: 1. Something calls clk_prepare(), which acquires `prepare_lock`. It then triggers genpd operations like genpd_runtime_resume(), which takes `&genpd->mlock`. 2. Power domain changes can trigger regulator changes; regulator changes can then trigger device link changes; device link changes can then trigger sysfs changes. Eventually, power_supply_uevent() is called. 3. This leads to calls like cros_usbpd_charger_get_prop(), which calls cros_ec_cmd_xfer_status(), which then attempts to acquire `ec_dev->lock`. See #1 ~ #6 in the following example calling trace. (Lock Order: `prepare_lock` -> `&genpd->mlock` -> ... -> `&ec_dev->lock`) Move the clk_prepare()/clk_unprepare() operations for `scp->clk` to the remoteproc prepare()/unprepare() callbacks. This ensures `prepare_lock` is only acquired in prepare()/unprepare() callbacks. Since `ec_dev->lock` is not involved in the callbacks, the dependency loop is broken. This means the clock is always "prepared" when the SCP is running. The prolonged "prepared time" for the clock should be acceptable as SCP is designed to be a very power efficient processor. The power consumption impact can be negligible. A simplified calling trace reported by lockdep: > -> #6 (&ec_dev->lock) > cros_ec_cmd_xfer > cros_ec_cmd_xfer_status > cros_usbpd_charger_get_port_status > cros_usbpd_charger_get_prop > power_supply_get_property > power_supply_show_property > power_supply_uevent > dev_uevent > uevent_show > dev_attr_show > sysfs_kf_seq_show > kernfs_seq_show > -> #5 (kn->active#2) > kernfs_drain > __kernfs_remove > kernfs_remove_by_name_ns > sysfs_remove_file_ns > device_del > __device_link_del > device_links_driver_bound > -> #4 (device_links_lock) > device_link_remove > _regulator_put > regulator_put > -> #3 (regulator_list_mutex) > regulator_lock_dependent > regulator_disable > scpsys_power_off > _genpd_power_off > genpd_power_off > -> #2 (&genpd->mlock/1) > genpd_add_subdomain > pm_genpd_add_subdomain > scpsys_add_subdomain > scpsys_probe > -> #1 (&genpd->mlock) > genpd_runtime_resume > __rpm_callback > rpm_callback > rpm_resume > __pm_runtime_resume > clk_core_prepare > clk_prepare > -> #0 (prepare_lock) > clk_prepare > scp_ipi_send > scp_send_ipi > mtk_rpmsg_send > rpmsg_send > cros_ec_pkt_xfer_rpmsg Signed-off-by: Tzung-Bi Shih Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20260112110755.2435899-1-tzungbi@kernel.org Signed-off-by: Mathieu Poirier Signed-off-by: Sasha Levin --- drivers/remoteproc/mtk_scp.c | 39 +++++++++++++++++++++++--------- drivers/remoteproc/mtk_scp_ipi.c | 4 ++-- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index db8fd045468d9..98d00bd5200cc 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -283,7 +283,7 @@ static irqreturn_t scp_irq_handler(int irq, void *priv) struct mtk_scp *scp = priv; int ret; - ret = clk_prepare_enable(scp->clk); + ret = clk_enable(scp->clk); if (ret) { dev_err(scp->dev, "failed to enable clocks\n"); return IRQ_NONE; @@ -291,7 +291,7 @@ static irqreturn_t scp_irq_handler(int irq, void *priv) scp->data->scp_irq_handler(scp); - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); return IRQ_HANDLED; } @@ -665,7 +665,7 @@ static int scp_load(struct rproc *rproc, const struct firmware *fw) struct device *dev = scp->dev; int ret; - ret = clk_prepare_enable(scp->clk); + ret = clk_enable(scp->clk); if (ret) { dev_err(dev, "failed to enable clocks\n"); return ret; @@ -680,7 +680,7 @@ static int scp_load(struct rproc *rproc, const struct firmware *fw) ret = scp_elf_load_segments(rproc, fw); leave: - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); return ret; } @@ -691,14 +691,14 @@ static int scp_parse_fw(struct rproc *rproc, const struct firmware *fw) struct device *dev = scp->dev; int ret; - ret = clk_prepare_enable(scp->clk); + ret = clk_enable(scp->clk); if (ret) { dev_err(dev, "failed to enable clocks\n"); return ret; } ret = scp_ipi_init(scp, fw); - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); return ret; } @@ -709,7 +709,7 @@ static int scp_start(struct rproc *rproc) struct scp_run *run = &scp->run; int ret; - ret = clk_prepare_enable(scp->clk); + ret = clk_enable(scp->clk); if (ret) { dev_err(dev, "failed to enable clocks\n"); return ret; @@ -734,14 +734,14 @@ static int scp_start(struct rproc *rproc) goto stop; } - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); dev_info(dev, "SCP is ready. FW version %s\n", run->fw_ver); return 0; stop: scp->data->scp_reset_assert(scp); - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); return ret; } @@ -909,7 +909,7 @@ static int scp_stop(struct rproc *rproc) struct mtk_scp *scp = rproc->priv; int ret; - ret = clk_prepare_enable(scp->clk); + ret = clk_enable(scp->clk); if (ret) { dev_err(scp->dev, "failed to enable clocks\n"); return ret; @@ -917,12 +917,29 @@ static int scp_stop(struct rproc *rproc) scp->data->scp_reset_assert(scp); scp->data->scp_stop(scp); - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); return 0; } +static int scp_prepare(struct rproc *rproc) +{ + struct mtk_scp *scp = rproc->priv; + + return clk_prepare(scp->clk); +} + +static int scp_unprepare(struct rproc *rproc) +{ + struct mtk_scp *scp = rproc->priv; + + clk_unprepare(scp->clk); + return 0; +} + static const struct rproc_ops scp_ops = { + .prepare = scp_prepare, + .unprepare = scp_unprepare, .start = scp_start, .stop = scp_stop, .load = scp_load, diff --git a/drivers/remoteproc/mtk_scp_ipi.c b/drivers/remoteproc/mtk_scp_ipi.c index c068227e251e7..7a37e273b3af8 100644 --- a/drivers/remoteproc/mtk_scp_ipi.c +++ b/drivers/remoteproc/mtk_scp_ipi.c @@ -171,7 +171,7 @@ int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len, WARN_ON(len > scp_sizes->ipi_share_buffer_size) || WARN_ON(!buf)) return -EINVAL; - ret = clk_prepare_enable(scp->clk); + ret = clk_enable(scp->clk); if (ret) { dev_err(scp->dev, "failed to enable clock\n"); return ret; @@ -211,7 +211,7 @@ int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len, unlock_mutex: mutex_unlock(&scp->send_lock); - clk_disable_unprepare(scp->clk); + clk_disable(scp->clk); return ret; } -- 2.51.0 From - Sat Feb 28 20:01:33 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id yF8qF5lJo2ltBgIAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:29 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:29 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVE-00000000Zmw-2zUK for hi@josie.lol; Sat, 28 Feb 2026 20:01:29 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 640BD337B48A for ; Sat, 28 Feb 2026 19:46:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D567301EF5; Sat, 28 Feb 2026 17:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M5baiLJW" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79528301EEF; Sat, 28 Feb 2026 17:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301405; cv=none; b=QjhskAqXzqjd96DrJWJAoNQtc5NwNeBeuoHgRTfmqCjD/dGFYlrYODjaXGnUtwCdwnxJxmWJNXONoQbFVpBHCzOVp6oJICGXinB57QQZTDAMgqyFj6LmpVU2Jgf+yegaVUqHCt3Th/pb3DKyMefi4GeqB/7QiVNyKCjqB0DLxg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301405; c=relaxed/simple; bh=YwH7ocqVR6BTEcFleyAorSaH1+d3lxPTj54krC2x6Lo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m2qYC8LDVVc9z47WNep/l60PbZXzFOHFTJmJOyMgCFQKUfQ/bXVLn9U4qzK3JQstd8MVIQa0/rIen6IQzYmiQV/+ot30Qz9wpQ+d0jTO8Uw0BPDBULlqHkMdrEyVFfreW9Ukszze+jlkclfnol7OcjqnPJ7Tb7KNvqD2s0sWH1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M5baiLJW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AD93C19423; Sat, 28 Feb 2026 17:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301405; bh=YwH7ocqVR6BTEcFleyAorSaH1+d3lxPTj54krC2x6Lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5baiLJWDZbwOwLVBtY/otjq8P+Ghw9ueZl/mrv5arcnQrQdaign7YwVyif1GhoSA XouyT+o0wVvvZhkHIP0KY/xYSY1JcwFov2OOS+Q6kJ+dIaqUKMnOuokP/0j5lOWbV2 2YiCq7/UvA/gCeksSnTmL0OnPNxUqiyQlJ8fAB8/Xkmwt41peFbRuYtIfOtyQiCPEC /MEwehe9OfzmLEN7HOH+P6GyhvgblD4+nxrCFsukk6lndgdz8CJnw7YJ11diJfWdS+ LzrvjNahmmJdAbsa8eQLuyQ06ytcixQ91OJsT/O/KPJ1f0ELjZP0Kzn1L83vHPFeal RynI5GycmQBng== From: Sasha Levin To: patches@lists.linux.dev Cc: Johan Hovold , stable@vger.kernel.org, Dmitry Baryshkov , Konrad Dybcio , Lee Jones , Sasha Levin Subject: [PATCH 6.18 594/752] mfd: qcom-pm8xxx: Fix OF populate on driver rebind Date: Sat, 28 Feb 2026 12:45:05 -0500 Message-ID: <20260228174750.1542406-594-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: msgid.link] 0.0 URIBL_DBL_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to dbl.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.0 URIBL_ZEN_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Johan Hovold [ Upstream commit 27a8acea47a93fea6ad0e2df4c20a9b51490e4d9 ] Since commit c6e126de43e7 ("of: Keep track of populated platform devices") child devices will not be created by of_platform_populate() if the devices had previously been deregistered individually so that the OF_POPULATED flag is still set in the corresponding OF nodes. Switch to using of_platform_depopulate() instead of open coding so that the child devices are created if the driver is rebound. Fixes: c6e126de43e7 ("of: Keep track of populated platform devices") Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://patch.msgid.link/20251219110947.24101-1-johan@kernel.org Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/qcom-pm8xxx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mfd/qcom-pm8xxx.c b/drivers/mfd/qcom-pm8xxx.c index 1149f7102a365..0cf374c015ce7 100644 --- a/drivers/mfd/qcom-pm8xxx.c +++ b/drivers/mfd/qcom-pm8xxx.c @@ -577,17 +577,11 @@ static int pm8xxx_probe(struct platform_device *pdev) return rc; } -static int pm8xxx_remove_child(struct device *dev, void *unused) -{ - platform_device_unregister(to_platform_device(dev)); - return 0; -} - static void pm8xxx_remove(struct platform_device *pdev) { struct pm_irq_chip *chip = platform_get_drvdata(pdev); - device_for_each_child(&pdev->dev, NULL, pm8xxx_remove_child); + of_platform_depopulate(&pdev->dev); irq_domain_remove(chip->irqdomain); } -- 2.51.0 From - Sat Feb 28 20:01:37 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id aJ1vJppJo2ltBgIAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:30 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:30 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVF-00000000Zpg-3i4F for hi@josie.lol; Sat, 28 Feb 2026 20:01:30 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 1EB5F320C908 for ; Sat, 28 Feb 2026 19:46:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49724301EF6; Sat, 28 Feb 2026 17:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sPDbgzfZ" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25E49301EE6; Sat, 28 Feb 2026 17:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301410; cv=none; b=VHd3clX6GbXnJoeQQz09g6nE+L4hQ5dnmjCPFMAPH3lUtjnI95NBK5c0lALTpdO4JSo7zWo9M7Ruq91meqijZlIt8qR2CcbOiI69mXTguo1DcuQM2gWaskbBdRx/Fkps1PpvJ9aLaBTHGdwZQPGrITtsxozHdPX9xHyAG448kGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301410; c=relaxed/simple; bh=MenJfSJBb9oAi44ExVGtxlUCrnQXJC9zI93xwrmb4rA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fcsnKSwEiMggD8boA6fraAanly4Ovqm90FiOoALdY1bJgZjP+uxrNm6J/9Qns0afwfVE3IlG+NvA63Q0CQIYIDGFg/kCAqmVLclN9h0CkLCNoFmp6DFBSEP+0UBrbUPovf0riLy9gfBwP5qh5qokmJ/YNuvtJ/Jts3FVixQarf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sPDbgzfZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62246C116D0; Sat, 28 Feb 2026 17:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301410; bh=MenJfSJBb9oAi44ExVGtxlUCrnQXJC9zI93xwrmb4rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sPDbgzfZAxLuL99O1TF5yYnISP38sxYOJxc4pGa7bYqxJ7Wpjyq0MzRle1yNmNor1 rBwJirbDy9M+nmnBiy/LL+XfUo2VToF13KFMt198Q5vmRfFIxaMds1uSr/wnI4d7gV RXuCIE4KaDxDjOXF4240+th8hTaXW43gbWLwdJ9mzCDUkpU0RuCkmg+5m+Q9Y0zgEd wF3+2AQJQG3uvZzqpUV20foi3L/9xWkWe78ypa+LoAv9WKDXpQFi44KHmekEocO3v+ Ngu8Xe/SLFIGyaf1Rxd+U1BJ7N0UBqnY5YLI72g0rzUSUWtubb+lYtRWlmgMVJoTZR /2vj2dbt/rpCg== From: Sasha Levin To: patches@lists.linux.dev Cc: Brian Norris , Bjorn Helgaas , Marek Szyprowski , stable@vger.kernel.org, Sasha Levin Subject: [PATCH 6.18 599/752] PCI/PM: Prevent runtime suspend until devices are fully initialized Date: Sat, 28 Feb 2026 12:45:10 -0500 Message-ID: <20260228174750.1542406-599-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: msgid.link] 0.0 URIBL_DBL_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to dbl.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.0 URIBL_ZEN_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Brian Norris [ Upstream commit 51c0996dadaea20d73eb0495aeda9cb0422243e8 ] Previously, it was possible for a PCI device to be runtime-suspended before it was fully initialized. When that happened, the suspend process could save invalid device state, for example, before BAR assignment. Restoring the invalid state during resume may leave the device non-functional. Prevent runtime suspend for PCI devices until they are fully initialized by deferring pm_runtime_enable(). More details on how exactly this may occur: 1. PCI device is created by pci_scan_slot() or similar 2. As part of pci_scan_slot(), pci_pm_init() puts the device in D0 and prevents runtime suspend prevented via pm_runtime_forbid() 3. pci_device_add() adds the underlying 'struct device' via device_add(), which means user space can allow runtime suspend, e.g., echo auto > /sys/bus/pci/devices/.../power/control 4. PCI device receives BAR configuration (pci_assign_unassigned_bus_resources(), etc.) 5. pci_bus_add_device() applies final fixups, saves device state, and tries to attach a driver The device may potentially be suspended between #3 and #5, so this is racy with user space (udev or similar). Many PCI devices are enumerated at subsys_initcall time and so will not race with user space, but devices created later by hotplug or modular pwrctrl or host controller drivers are susceptible to this race. More runtime PM details at the first Link: below. Link: https://lore.kernel.org/all/0e35a4e1-894a-47c1-9528-fc5ffbafd9e2@samsung.com/ Signed-off-by: Brian Norris [bhelgaas: update comments per https://lore.kernel.org/r/CAJZ5v0iBNOmMtqfqEbrYyuK2u+2J2+zZ-iQd1FvyCPjdvU2TJg@mail.gmail.com] Signed-off-by: Bjorn Helgaas Tested-by: Marek Szyprowski Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260122094815.v5.1.I60a53c170a8596661883bd2b4ef475155c7aa72b@changeid Signed-off-by: Sasha Levin --- drivers/pci/bus.c | 8 ++++++++ drivers/pci/pci.c | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 9daf13ed3714e..81a6d356729ef 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -378,6 +379,13 @@ void pci_bus_add_device(struct pci_dev *dev) put_device(&pdev->dev); } + /* + * Enable runtime PM, which potentially allows the device to + * suspend immediately, only after the PCI state has been + * configured completely. + */ + pm_runtime_enable(&dev->dev); + if (!dn || of_device_is_available(dn)) pci_dev_allow_binding(dev); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d147e412668bf..7858121344655 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3225,8 +3225,14 @@ void pci_pm_init(struct pci_dev *dev) poweron: pci_pm_power_up_and_verify_state(dev); pm_runtime_forbid(&dev->dev); + + /* + * Runtime PM will be enabled for the device when it has been fully + * configured, but since its parent and suppliers may suspend in + * the meantime, prevent them from doing so by changing the + * device's runtime PM status to "active". + */ pm_runtime_set_active(&dev->dev); - pm_runtime_enable(&dev->dev); } static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop) -- 2.51.0 From - Sat Feb 28 20:01:37 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id 6FHOGpxJo2mrTwEAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:32 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:32 +0000 Received: from sto.lore.kernel.org ([172.232.135.74]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVH-00000000ZqU-27zD for hi@josie.lol; Sat, 28 Feb 2026 20:01:32 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id EEC813024B07 for ; Sat, 28 Feb 2026 19:44:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FED34657E8; Sat, 28 Feb 2026 17:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VdB+A5mT" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F13CE4611C5; Sat, 28 Feb 2026 17:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301291; cv=none; b=oY1ddCXPD/xQKnK+myIdsnNlCQT3lI4aUVbn7xuAsarhHLBPqAisTNQKGy7//TZ3d/YgaeP4s6LmB4BSEdYjGeF1nsNOtPynHHEeor3dvGEmuarMu65hHImgRmQgA7/Qoa5ayOVuuYPD5V7rzMFXQHsaMwHC+BGga7cqTrsE8E8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301291; c=relaxed/simple; bh=7ZwGx+93lPb0rVonwyk0KqPq2j7B9ASFnIlDJgrzlNc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VwhFgtEc1xXxNu4ITsjOF2HM3aAzPijTYNVgYgk5RcVC/SOeCfazsJlTZ8RjTQaysWc0wqo1ZkdXRpv/pXD9GVpsheKxL++YXnh5xMznLN8pei5VfrDBm46WD+XIaHiXvl4rVCbik8BwgVXS/hg8A+OFv4AAQZghTkmdTVy+Znc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VdB+A5mT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D741C19425; Sat, 28 Feb 2026 17:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301290; bh=7ZwGx+93lPb0rVonwyk0KqPq2j7B9ASFnIlDJgrzlNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VdB+A5mT08yiL2JmBbzhDmX40PmhQec5jMzd6I8kBWoc4iHYbFLfklrOmtl9qxYwT 450qfwi73Dt6p16Y8GJ52Ee04TXWJjVO0WW2LPYm2NT5PMrBT6r++QRn8xqTye/xrR l0k6J7fZp+PhMLfZBTXe4F03CEGLIYoL2TW9Ouzcl8gv4uGMMcP1eDPzmpHH0VTgeg Kf6tjIHRbKLFJaRZ+O/uGHgVkpRNIoRwMtsK8cCPvXVpLADqLixK/n6utIivJOAmip SVnMaxF7p+wVAZkW7TZMsSQzyhDFMBdG7RNZ1xKN4LX+vSaAIMNB/bLbK13MNphfEQ sIxmht5zOxN7Q== From: Sasha Levin To: patches@lists.linux.dev Cc: Niklas Cassel , Manivannan Sadhasivam , Shawn Lin , stable@vger.kernel.org, Sasha Levin Subject: [PATCH 6.18 475/752] Revert "PCI: qcom: Enumerate endpoints based on Link up event in 'global_irq' interrupt" Date: Sat, 28 Feb 2026 12:43:06 -0500 Message-ID: <20260228174750.1542406-475-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: msgid.link] 0.0 URIBL_DBL_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to dbl.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.232.135.74 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.232.135.74 listed in list.dnswl.org] 0.0 URIBL_ZEN_BLOCKED_OPENDNS ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [URIs: msgid.link] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Niklas Cassel [ Upstream commit 9a9793b55854422652ea92625e48277c4651c0fd ] This reverts commit 4581403f67929d02c197cb187c4e1e811c9e762a. While this fake hotplugging was a nice idea, it has shown that this feature does not handle PCIe switches correctly: pci_bus 0004:43: busn_res: can not insert [bus 43-41] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci_bus 0004:43: busn_res: [bus 43-41] end is updated to 43 pci_bus 0004:43: busn_res: can not insert [bus 43] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci 0004:42:00.0: devices behind bridge are unusable because [bus 43] cannot be assigned for them pci_bus 0004:44: busn_res: can not insert [bus 44-41] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci_bus 0004:44: busn_res: [bus 44-41] end is updated to 44 pci_bus 0004:44: busn_res: can not insert [bus 44] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci 0004:42:02.0: devices behind bridge are unusable because [bus 44] cannot be assigned for them pci_bus 0004:45: busn_res: can not insert [bus 45-41] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci_bus 0004:45: busn_res: [bus 45-41] end is updated to 45 pci_bus 0004:45: busn_res: can not insert [bus 45] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci 0004:42:06.0: devices behind bridge are unusable because [bus 45] cannot be assigned for them pci_bus 0004:46: busn_res: can not insert [bus 46-41] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci_bus 0004:46: busn_res: [bus 46-41] end is updated to 46 pci_bus 0004:46: busn_res: can not insert [bus 46] under [bus 42-41] (conflicts with (null) [bus 42-41]) pci 0004:42:0e.0: devices behind bridge are unusable because [bus 46] cannot be assigned for them pci_bus 0004:42: busn_res: [bus 42-41] end is updated to 46 pci_bus 0004:42: busn_res: can not insert [bus 42-46] under [bus 41] (conflicts with (null) [bus 41]) pci 0004:41:00.0: devices behind bridge are unusable because [bus 42-46] cannot be assigned for them pcieport 0004:40:00.0: bridge has subordinate 41 but max busn 46 During the initial scan, PCI core doesn't see the switch and since the Root Port is not hot plug capable, the secondary bus number gets assigned as the subordinate bus number. This means, the PCI core assumes that only one bus will appear behind the Root Port since the Root Port is not hot plug capable. This works perfectly fine for PCIe endpoints connected to the Root Port, since they don't extend the bus. However, if a PCIe switch is connected, then there is a problem when the downstream busses starts showing up and the PCI core doesn't extend the subordinate bus number and bridge resources after initial scan during boot. The long term plan is to migrate this driver to the upcoming pwrctrl APIs that are supposed to handle this problem elegantly. Suggested-by: Manivannan Sadhasivam Signed-off-by: Niklas Cassel Signed-off-by: Manivannan Sadhasivam Tested-by: Shawn Lin Acked-by: Shawn Lin Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20251222064207.3246632-13-cassel@kernel.org Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pcie-qcom.c | 58 +------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 2779b09dfe3ec..5311cd5d96372 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -55,9 +55,6 @@ #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8 #define PARF_Q2A_FLUSH 0x1ac #define PARF_LTSSM 0x1b0 -#define PARF_INT_ALL_STATUS 0x224 -#define PARF_INT_ALL_CLEAR 0x228 -#define PARF_INT_ALL_MASK 0x22c #define PARF_SID_OFFSET 0x234 #define PARF_BDF_TRANSLATE_CFG 0x24c #define PARF_DBI_BASE_ADDR_V2 0x350 @@ -134,9 +131,6 @@ /* PARF_LTSSM register fields */ #define LTSSM_EN BIT(8) -/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */ -#define PARF_INT_ALL_LINK_UP BIT(13) - /* PARF_NO_SNOOP_OVERRIDE register fields */ #define WR_NO_SNOOP_OVERRIDE_EN BIT(1) #define RD_NO_SNOOP_OVERRIDE_EN BIT(3) @@ -1606,32 +1600,6 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie) qcom_pcie_link_transition_count); } -static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data) -{ - struct qcom_pcie *pcie = data; - struct dw_pcie_rp *pp = &pcie->pci->pp; - struct device *dev = pcie->pci->dev; - u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS); - - writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR); - - if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) { - msleep(PCIE_RESET_CONFIG_WAIT_MS); - dev_dbg(dev, "Received Link up event. Starting enumeration!\n"); - /* Rescan the bus to enumerate endpoint devices */ - pci_lock_rescan_remove(); - pci_rescan_bus(pp->bridge->bus); - pci_unlock_rescan_remove(); - - qcom_pcie_icc_opp_update(pcie); - } else { - dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n", - status); - } - - return IRQ_HANDLED; -} - static void qcom_pci_free_msi(void *ptr) { struct dw_pcie_rp *pp = (struct dw_pcie_rp *)ptr; @@ -1776,8 +1744,7 @@ static int qcom_pcie_probe(struct platform_device *pdev) struct dw_pcie_rp *pp; struct resource *res; struct dw_pcie *pci; - int ret, irq; - char *name; + int ret; pcie_cfg = of_device_get_match_data(dev); if (!pcie_cfg) { @@ -1934,27 +1901,6 @@ static int qcom_pcie_probe(struct platform_device *pdev) goto err_phy_exit; } - name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_global_irq%d", - pci_domain_nr(pp->bridge->bus)); - if (!name) { - ret = -ENOMEM; - goto err_host_deinit; - } - - irq = platform_get_irq_byname_optional(pdev, "global"); - if (irq > 0) { - ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, - qcom_pcie_global_irq_thread, - IRQF_ONESHOT, name, pcie); - if (ret) { - dev_err_probe(&pdev->dev, ret, - "Failed to request Global IRQ\n"); - goto err_host_deinit; - } - - writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK); - } - qcom_pcie_icc_opp_update(pcie); if (pcie->mhi) @@ -1962,8 +1908,6 @@ static int qcom_pcie_probe(struct platform_device *pdev) return 0; -err_host_deinit: - dw_pcie_host_deinit(pp); err_phy_exit: list_for_each_entry_safe(port, tmp, &pcie->ports, list) { phy_exit(port->phy); -- 2.51.0 From - Sat Feb 28 20:01:37 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id 8I++OZxJo2kE6D0AYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:32 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:33 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVI-00000000Zt6-20vz for hi@josie.lol; Sat, 28 Feb 2026 20:01:32 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 9260F337B7DD for ; Sat, 28 Feb 2026 19:46:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C17E301F0E; Sat, 28 Feb 2026 17:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HxjsZ2u5" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 690F8301F0D; Sat, 28 Feb 2026 17:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301414; cv=none; b=Nsh3VelUnVxnqcyy9pQhdtBzSYRlKMUsEJh+/s31XMaBimWZSMO4W+0pqQTMsm1tXmlYamkXunDo1Y/WuYcvBqyf3/imO/cV8U6/nJb2/S8a/Gf5C1jmnRsniQTgmCSAlUl8CV2yh+65GZMLS+C+n9S4UZx6p84V7pYSCD+a+eI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301414; c=relaxed/simple; bh=rwpnN65rYIVoqLu8TfEfLFo5uFAQg+Ke2vYqkzMDlU0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XcN/uVy6vVWA3jwvHaVn8V2IJBRfOV7Pv6iddQ0YYVfPXeeY8oQAabaLd9ByBOpCVBXXP5ntw7Q4/veWwd6WByhRm+sKwhzxz2NEzJZIXIGIgsmgFOsThFpUBWMZUKc1HQZMxBmFoTZUfhPXc2Q0CPUE8lzZn4q84yqx32HODWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HxjsZ2u5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F1FFC19423; Sat, 28 Feb 2026 17:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301414; bh=rwpnN65rYIVoqLu8TfEfLFo5uFAQg+Ke2vYqkzMDlU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HxjsZ2u5fUyKFG3wP59tLJzDj9/lcS2Pvdfe6Bh194eAg+fytPMYsNkLrC+lZaKPc g5rCpBwcRh/dd8m2eKwM0J+igz8Nv0jGhDS4zs/IHJ1i2LsGMD50eeZhzT9BFjeA7+ 6fKS98/OYo2Xda5yjQlAGyVnVFrJXmPp2S/a6KWKSbc8g9pDg9jtB+Mpk3mBU8fhPe rnQ1Jk7D3QqouQrOvDpXrbM52DmAcO4Ul2yXg4R0QcFVUIo3kbLffqe1/SvDsFQao+ ZjHrQx6yBJLoaBiwVpNxMKPtK8swA2Qbm9Xnr9NqBl7WS8F/e+SEZj5ymxMmFn2/QZ H1GZR+YsQ3FlA== From: Sasha Levin To: patches@lists.linux.dev Cc: Jason Gunthorpe , stable@vger.kernel.org, Shuai Xue , Nicolin Chen , Will Deacon , Sasha Levin Subject: [PATCH 6.18 603/752] iommu/arm-smmu-v3: Mark EATS_TRANS safe when computing the update sequence Date: Sat, 28 Feb 2026 12:45:14 -0500 Message-ID: <20260228174750.1542406-603-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Jason Gunthorpe [ Upstream commit 7cad800485956a263318930613f8f4a084af8c70 ] If VM wants to toggle EATS_TRANS off at the same time as changing the CFG, hypervisor will see EATS change to 0 and insert a V=0 breaking update into the STE even though the VM did not ask for that. In bare metal, EATS_TRANS is ignored by CFG=ABORT/BYPASS, which is why this does not cause a problem until we have the nested case where CFG is always a variation of S2 trans that does use EATS_TRANS. Relax the rules for EATS_TRANS sequencing, we don't need it to be exact as the enclosing code will always disable ATS at the PCI device when changing EATS_TRANS. This ensures there are no ATS transactions that can race with an EATS_TRANS change so we don't need to carefully sequence these bits. Fixes: 1e8be08d1c91 ("iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED") Cc: stable@vger.kernel.org Signed-off-by: Jason Gunthorpe Reviewed-by: Shuai Xue Signed-off-by: Nicolin Chen Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index bb755c7ef9a79..1e47da0ce6b9b 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1097,6 +1097,32 @@ VISIBLE_IF_KUNIT void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target, __le64 *safe_bits) { + const __le64 eats_s1chk = + FIELD_PREP(STRTAB_STE_1_EATS, STRTAB_STE_1_EATS_S1CHK); + const __le64 eats_trans = + FIELD_PREP(STRTAB_STE_1_EATS, STRTAB_STE_1_EATS_TRANS); + + /* + * When an STE changes EATS_TRANS, the sequencing code in the attach + * logic already will have the PCI cap for ATS disabled. Thus at this + * moment we can expect that the device will not generate ATS queries + * and so we don't care about the sequencing of EATS. The purpose of + * EATS_TRANS is to protect the system from hostile untrusted devices + * that issue ATS when the PCI config space is disabled. However, if + * EATS_TRANS is being changed, then we must have already trusted the + * device as the EATS_TRANS security block is being disabled. + * + * Note: now the EATS_TRANS update is moved to the first entry_set(). + * Changing S2S and EATS might transiently result in S2S=1 and EATS=1 + * which is a bad STE (see "5.2 Stream Table Entry"). In such a case, + * we can't do a hitless update. Also, it should not be added to the + * safe bits with STRTAB_STE_1_EATS_S1CHK, because EATS=0b11 would be + * effectively an errant 0b00 configuration. + */ + if (!((cur[1] | target[1]) & cpu_to_le64(eats_s1chk)) && + !((cur[2] | target[2]) & cpu_to_le64(STRTAB_STE_2_S2S))) + safe_bits[1] |= cpu_to_le64(eats_trans); + /* * MEV does not meaningfully impact the operation of the HW, it only * changes how many fault events are generated, thus we can relax it -- 2.51.0 From - Sat Feb 28 20:01:37 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id KLSEIZ1Jo2mrTwEAYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:33 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:33 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVJ-00000000ZuX-0FlR for hi@josie.lol; Sat, 28 Feb 2026 20:01:33 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id CD079316116E for ; Sat, 28 Feb 2026 19:46:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A3CE301F01; Sat, 28 Feb 2026 17:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XaHRsdRb" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36CC9301EFA; Sat, 28 Feb 2026 17:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301412; cv=none; b=kzQ4YB3ReXdFoBd2zpqFMcdkhXKoWr8AO1Js4daC4CfkvQYTRjEyfGbAxDn4V6kD63UDQ+XS1Q6Aifx5Q1iNxrzYdeFsPZWqWxzmK86eWewM9g8rhi2aveOgkB/DMExpGZh9I0dsBv74DQtrQFFxI40KpOvNxwey5ikndtt1iBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301412; c=relaxed/simple; bh=BmlDgvG1YOB0tmrHFKQnhdgR3QT4GDO9xiyEQvTEmJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lkgdv8qOTPgZnvJhNyjPdyuqY0xagMyHQU2OG5Mfxt6gjigzt0et72KbpsxnakVgnwSi4zXNP/SDc0KUgDR4G0Iz6rilwDnGGwPb45tkYsDGz05f5x5VUeHmhRoyPVJ1ntty8/H61RomEtI9jI24VnOdDUAxJt1rb8u+Mk2ZX1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XaHRsdRb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AC35C19423; Sat, 28 Feb 2026 17:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301412; bh=BmlDgvG1YOB0tmrHFKQnhdgR3QT4GDO9xiyEQvTEmJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XaHRsdRb11D+H1NrtTk4M6jzdVRzLKBC3j1sNcJ/ZK6lWN2dbBiMf5lyj5m+90xOy zUhm07VXO8JWiEPjAj7WAtD1pLeitMLQuiIOICSGaFPX88GGbi+4//PE5r62B0MgD0 /I27eg82Ve3pkStzXy4gZ8qe/V4VOboj/9rPnc399YNO+4EGginXSM0tZW143cFBpy DlPuageQfTvNkX3+qKBlpGw8fjP372QIgTH5zTjIW+8kIjyNJTHgSIleEGvZS+evR+ yoRCkkdRi9Px4QTPCwSYB/laeajSCR1ftAbJ5A6SJdCiSQ7/0GgNFiXOpJmDKzBAx1 n4iBV61Xz+qZA== From: Sasha Levin To: patches@lists.linux.dev Cc: Jason Gunthorpe , stable@vger.kernel.org, Shuai Xue , Mostafa Saleh , Pranjal Shrivastava , Nicolin Chen , Will Deacon , Sasha Levin Subject: [PATCH 6.18 601/752] iommu/arm-smmu-v3: Add update_safe bits to fix STE update sequence Date: Sat, 28 Feb 2026 12:45:12 -0500 Message-ID: <20260228174750.1542406-601-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Jason Gunthorpe [ Upstream commit 2781f2a930abb5d27f80b8afbabfa19684833b65 ] C_BAD_STE was observed when updating nested STE from an S1-bypass mode to an S1DSS-bypass mode. As both modes enabled S2, the used bit is slightly different than the normal S1-bypass and S1DSS-bypass modes. As a result, fields like MEV and EATS in S2's used list marked the word1 as a critical word that requested a STE.V=0. This breaks a hitless update. However, both MEV and EATS aren't critical in terms of STE update. One controls the merge of the events and the other controls the ATS that is managed by the driver at the same time via pci_enable_ats(). Add an arm_smmu_get_ste_update_safe() to allow STE update algorithm to relax those fields, avoiding the STE update breakages. After this change, entry_set has no caller checking its return value, so change it to void. Note that this change is required by both MEV and EATS fields, which were introduced in different kernel versions. So add get_update_safe() first. MEV and EATS will be added to arm_smmu_get_ste_update_safe() separately. Fixes: 1e8be08d1c91 ("iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED") Cc: stable@vger.kernel.org Signed-off-by: Jason Gunthorpe Reviewed-by: Shuai Xue Reviewed-by: Mostafa Saleh Reviewed-by: Pranjal Shrivastava Signed-off-by: Nicolin Chen Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- .../iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 31 +++++++++++++++++-- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 28 ++++++++++++----- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 4 +++ 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c index d2671bfd37981..b254a94b2003d 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c @@ -38,13 +38,16 @@ enum arm_smmu_test_master_feat { static bool arm_smmu_entry_differs_in_used_bits(const __le64 *entry, const __le64 *used_bits, const __le64 *target, + const __le64 *safe, unsigned int length) { bool differs = false; unsigned int i; for (i = 0; i < length; i++) { - if ((entry[i] & used_bits[i]) != target[i]) + __le64 used = used_bits[i] & ~safe[i]; + + if ((entry[i] & used) != (target[i] & used)) differs = true; } return differs; @@ -56,12 +59,24 @@ arm_smmu_test_writer_record_syncs(struct arm_smmu_entry_writer *writer) struct arm_smmu_test_writer *test_writer = container_of(writer, struct arm_smmu_test_writer, writer); __le64 *entry_used_bits; + __le64 *safe_target; + __le64 *safe_init; entry_used_bits = kunit_kzalloc( test_writer->test, sizeof(*entry_used_bits) * NUM_ENTRY_QWORDS, GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test_writer->test, entry_used_bits); + safe_target = kunit_kzalloc(test_writer->test, + sizeof(*safe_target) * NUM_ENTRY_QWORDS, + GFP_KERNEL); + KUNIT_ASSERT_NOT_NULL(test_writer->test, safe_target); + + safe_init = kunit_kzalloc(test_writer->test, + sizeof(*safe_init) * NUM_ENTRY_QWORDS, + GFP_KERNEL); + KUNIT_ASSERT_NOT_NULL(test_writer->test, safe_init); + pr_debug("STE value is now set to: "); print_hex_dump_debug(" ", DUMP_PREFIX_NONE, 16, 8, test_writer->entry, @@ -79,14 +94,23 @@ arm_smmu_test_writer_record_syncs(struct arm_smmu_entry_writer *writer) * configuration. */ writer->ops->get_used(test_writer->entry, entry_used_bits); + if (writer->ops->get_update_safe) + writer->ops->get_update_safe(test_writer->entry, + test_writer->init_entry, + safe_init); + if (writer->ops->get_update_safe) + writer->ops->get_update_safe(test_writer->entry, + test_writer->target_entry, + safe_target); KUNIT_EXPECT_FALSE( test_writer->test, arm_smmu_entry_differs_in_used_bits( test_writer->entry, entry_used_bits, - test_writer->init_entry, NUM_ENTRY_QWORDS) && + test_writer->init_entry, safe_init, + NUM_ENTRY_QWORDS) && arm_smmu_entry_differs_in_used_bits( test_writer->entry, entry_used_bits, - test_writer->target_entry, + test_writer->target_entry, safe_target, NUM_ENTRY_QWORDS)); } } @@ -106,6 +130,7 @@ arm_smmu_v3_test_debug_print_used_bits(struct arm_smmu_entry_writer *writer, static const struct arm_smmu_entry_writer_ops test_ste_ops = { .sync = arm_smmu_test_writer_record_syncs, .get_used = arm_smmu_get_ste_used, + .get_update_safe = arm_smmu_get_ste_update_safe, }; static const struct arm_smmu_entry_writer_ops test_cd_ops = { diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index b4f757e1f105f..e7d62acb4b779 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1093,6 +1093,13 @@ void arm_smmu_get_ste_used(const __le64 *ent, __le64 *used_bits) } EXPORT_SYMBOL_IF_KUNIT(arm_smmu_get_ste_used); +VISIBLE_IF_KUNIT +void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target, + __le64 *safe_bits) +{ +} +EXPORT_SYMBOL_IF_KUNIT(arm_smmu_get_ste_update_safe); + /* * Figure out if we can do a hitless update of entry to become target. Returns a * bit mask where 1 indicates that qword needs to be set disruptively. @@ -1105,13 +1112,22 @@ static u8 arm_smmu_entry_qword_diff(struct arm_smmu_entry_writer *writer, { __le64 target_used[NUM_ENTRY_QWORDS] = {}; __le64 cur_used[NUM_ENTRY_QWORDS] = {}; + __le64 safe[NUM_ENTRY_QWORDS] = {}; u8 used_qword_diff = 0; unsigned int i; writer->ops->get_used(entry, cur_used); writer->ops->get_used(target, target_used); + if (writer->ops->get_update_safe) + writer->ops->get_update_safe(entry, target, safe); for (i = 0; i != NUM_ENTRY_QWORDS; i++) { + /* + * Safe is only used for bits that are used by both entries, + * otherwise it is sequenced according to the unused entry. + */ + safe[i] &= target_used[i] & cur_used[i]; + /* * Check that masks are up to date, the make functions are not * allowed to set a bit to 1 if the used function doesn't say it @@ -1120,6 +1136,7 @@ static u8 arm_smmu_entry_qword_diff(struct arm_smmu_entry_writer *writer, WARN_ON_ONCE(target[i] & ~target_used[i]); /* Bits can change because they are not currently being used */ + cur_used[i] &= ~safe[i]; unused_update[i] = (entry[i] & cur_used[i]) | (target[i] & ~cur_used[i]); /* @@ -1132,7 +1149,7 @@ static u8 arm_smmu_entry_qword_diff(struct arm_smmu_entry_writer *writer, return used_qword_diff; } -static bool entry_set(struct arm_smmu_entry_writer *writer, __le64 *entry, +static void entry_set(struct arm_smmu_entry_writer *writer, __le64 *entry, const __le64 *target, unsigned int start, unsigned int len) { @@ -1148,7 +1165,6 @@ static bool entry_set(struct arm_smmu_entry_writer *writer, __le64 *entry, if (changed) writer->ops->sync(writer); - return changed; } /* @@ -1218,12 +1234,9 @@ void arm_smmu_write_entry(struct arm_smmu_entry_writer *writer, __le64 *entry, entry_set(writer, entry, target, 0, 1); } else { /* - * No inuse bit changed. Sanity check that all unused bits are 0 - * in the entry. The target was already sanity checked by - * compute_qword_diff(). + * No inuse bit changed, though safe bits may have changed. */ - WARN_ON_ONCE( - entry_set(writer, entry, target, 0, NUM_ENTRY_QWORDS)); + entry_set(writer, entry, target, 0, NUM_ENTRY_QWORDS); } } EXPORT_SYMBOL_IF_KUNIT(arm_smmu_write_entry); @@ -1554,6 +1567,7 @@ static void arm_smmu_ste_writer_sync_entry(struct arm_smmu_entry_writer *writer) static const struct arm_smmu_entry_writer_ops arm_smmu_ste_writer_ops = { .sync = arm_smmu_ste_writer_sync_entry, .get_used = arm_smmu_get_ste_used, + .get_update_safe = arm_smmu_get_ste_update_safe, }; static void arm_smmu_write_ste(struct arm_smmu_master *master, u32 sid, diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h index ae23aacc38402..287e223c054d1 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -900,6 +900,8 @@ struct arm_smmu_entry_writer { struct arm_smmu_entry_writer_ops { void (*get_used)(const __le64 *entry, __le64 *used); + void (*get_update_safe)(const __le64 *cur, const __le64 *target, + __le64 *safe_bits); void (*sync)(struct arm_smmu_entry_writer *writer); }; @@ -911,6 +913,8 @@ void arm_smmu_make_s2_domain_ste(struct arm_smmu_ste *target, #if IS_ENABLED(CONFIG_KUNIT) void arm_smmu_get_ste_used(const __le64 *ent, __le64 *used_bits); +void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target, + __le64 *safe_bits); void arm_smmu_write_entry(struct arm_smmu_entry_writer *writer, __le64 *cur, const __le64 *target); void arm_smmu_get_cd_used(const __le64 *ent, __le64 *used_bits); -- 2.51.0 From - Sat Feb 28 20:01:41 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id AP2zK55Jo2kE6D0AYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:34 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:34 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVK-00000000ZxI-1GBP for hi@josie.lol; Sat, 28 Feb 2026 20:01:34 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id BDE8F316140D for ; Sat, 28 Feb 2026 19:46:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92895301F05; Sat, 28 Feb 2026 17:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OGQ7uQLC" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F706301EE9; Sat, 28 Feb 2026 17:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301413; cv=none; b=IeH4PtSej8j+K6ir79493rtc7TYFiwkGOt+kSCpCGLDD1N71Re2UYx9zcAubmGrih9IM4WxMwlmuD/BWuYhO0LN0on7vlpLHQS1sw8fQzKrYt+r/s4ua2fgkljpKyjQhyWrOUVx+AbVgJNw4qo1508OTH5NFzlv7+p/obju8X9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301413; c=relaxed/simple; bh=LFso4gGWa0HLTFJsEh6cRF2qUDdp2Q2CBEykfE4/CpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NP7pYKEFjlq8TaJceK586m+PRW5O+ZvWSESKBzXFIdwYMLZbC/4FCytH6eP+hNLtng/SbALjQEqNiZAJlSggUyaBWezhDeEhmqMBOkGsWGFunKLcxHRpvZuhhJd9LXWgSQJS+L2587/F0bxEqAaqVGt15lZy6BhubhMiUWoIvX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OGQ7uQLC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DA19C19423; Sat, 28 Feb 2026 17:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301413; bh=LFso4gGWa0HLTFJsEh6cRF2qUDdp2Q2CBEykfE4/CpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OGQ7uQLCIl3iOo1ygop+23MMx2GSGnYU9jsALwRTFT93TxCkRjBl2tai+iVrZXZ3C Sc4DghYtTdrDt+OgPIsOettC+sUDGmGb/orQZ/J3pQ+NDUhUcco3vFzmrpTziPf6mk Na7JFe2rRM61DVFQF33/1lFLdbrcDasKABdHBEqiNyrOY3p9LrCeat5W0D9NQIm9xS w4QzOmp7GvimWlGvnKfxWFweUwvtI+pH1+bAP/4mHBJnl4stFYz1seV8BoeVIpyOSD z52X+K3TvC3SAj7SW7Agc//gfiubm4AIbEAWM8FqIbYSkEMPzHed2oQKiy2iUpV8AG wLCXLXM42hpDw== From: Sasha Levin To: patches@lists.linux.dev Cc: Jason Gunthorpe , stable@vger.kernel.org, Shuai Xue , Mostafa Saleh , Pranjal Shrivastava , Nicolin Chen , Will Deacon , Sasha Levin Subject: [PATCH 6.18 602/752] iommu/arm-smmu-v3: Mark STE MEV safe when computing the update sequence Date: Sat, 28 Feb 2026 12:45:13 -0500 Message-ID: <20260228174750.1542406-602-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [172.105.105.114 listed in list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: Jason Gunthorpe [ Upstream commit f3c1d372dbb8e5a86923f20db66deabef42bfc9d ] Nested CD tables set the MEV bit to try to reduce multi-fault spamming on the hypervisor. Since MEV is in STE word 1 this causes a breaking update sequence that is not required and impacts real workloads. For the purposes of STE updates the value of MEV doesn't matter, if it is set/cleared early or late it just results in a change to the fault reports that must be supported by the kernel anyhow. The spec says: Note: Software must expect, and be able to deal with, coalesced fault records even when MEV == 0. So mark STE MEV safe when computing the update sequence, to avoid creating a breaking update. Fixes: da0c56520e88 ("iommu/arm-smmu-v3: Set MEV bit in nested STE for DoS mitigations") Cc: stable@vger.kernel.org Signed-off-by: Jason Gunthorpe Reviewed-by: Shuai Xue Reviewed-by: Mostafa Saleh Reviewed-by: Pranjal Shrivastava Signed-off-by: Nicolin Chen Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index e7d62acb4b779..bb755c7ef9a79 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1097,6 +1097,16 @@ VISIBLE_IF_KUNIT void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target, __le64 *safe_bits) { + /* + * MEV does not meaningfully impact the operation of the HW, it only + * changes how many fault events are generated, thus we can relax it + * when computing the ordering. The spec notes the device can act like + * MEV=1 anyhow: + * + * Note: Software must expect, and be able to deal with, coalesced + * fault records even when MEV == 0. + */ + safe_bits[1] |= cpu_to_le64(STRTAB_STE_1_MEV); } EXPORT_SYMBOL_IF_KUNIT(arm_smmu_get_ste_update_safe); -- 2.51.0 From - Sat Feb 28 20:01:41 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 Return-Path: Delivered-To: hi@josie.lol Received: from witcher.mxrouting.net by witcher.mxrouting.net with LMTP id aEH9A6BJo2kE6D0AYBR5ng (envelope-from ) for ; Sat, 28 Feb 2026 20:01:36 +0000 Return-path: Envelope-to: hi@josie.lol Delivery-date: Sat, 28 Feb 2026 20:01:36 +0000 Received: from tor.lore.kernel.org ([172.105.105.114]) by witcher.mxrouting.net with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1vwQVL-00000000ZxI-2Y5I for hi@josie.lol; Sat, 28 Feb 2026 20:01:35 +0000 Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 78ADD30D1FA6 for ; Sat, 28 Feb 2026 19:46:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8ADFB301F13; Sat, 28 Feb 2026 17:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l4lsS0l1" X-Original-To: stable@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66F36175A62; Sat, 28 Feb 2026 17:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301417; cv=none; b=bTEo9MPn94DZwRSkOgTRvnK697BwaoRP0M7Ss+SsPokLZ+jqUuOFOFXtxk8E8xitRqjaOfrWmeOQIRO/Ny9ob5sgE8qmM1K8Ze1mA5jL5beFWPz438YIqpCVbhluaP+Xy883DqWAuMWyMvSCsl+9PwE6tfpz6xGR2HESwC8vmdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772301417; c=relaxed/simple; bh=YHuZmIjUa2BPlEXI0I2i4kyZQxQRN6TdlgoXeGuLW00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CMC5Q04BtveI1DXbOZrsrI5+WXdAT1XAYU95rQYpjWF9kVXZQlcIgeYxHXInEM4ML6kLv4pPZQc2ToS5eXD4VypiAxOnpGwRDu+FXMaVwmNsDKdaqdcc37h4OqKQoRjVmW/QaILKEkGBx34eUdJUG4VgiORJqwZBZExMhKIfRZw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l4lsS0l1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82702C116D0; Sat, 28 Feb 2026 17:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772301417; bh=YHuZmIjUa2BPlEXI0I2i4kyZQxQRN6TdlgoXeGuLW00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4lsS0l1kB/8Zs6/zh1z8v7pLJJX1SHG+YyLQFjuyzcEtNVUzD0xsFjzdkhGttjMB +NEJQ7VkU9ASaUE6bxrTUhhqAgXr1Rz7C5t30Uj7GwWqq8NO5BNiiZZ3SXxaekdWD6 YjJITttoBy/u4Q++Neav6NL0+cA/+mBLC3VC+AXXYYRaIHoYkJpE2dDrkV3x/+2ysJ 7lERtkpEMI1Ln79qNeg7P5WiB0xIaQbeGcryxpCudmZTd3fOmh390QF1Uni7UzdpoK NFLvUf/JHquN8y8QygxHnwBeyk0JYk0vD/ugoOVn6GRJoRZzy8i5rvZ9q/TOuEuj6/ gOPg237TuyCJA== From: Sasha Levin To: patches@lists.linux.dev Cc: "Darrick J. Wong" , stable@vger.kernel.org, Christoph Hellwig , Sasha Levin Subject: [PATCH 6.18 606/752] xfs: delete attr leaf freemap entries when empty Date: Sat, 28 Feb 2026 12:45:17 -0500 Message-ID: <20260228174750.1542406-606-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228174750.1542406-1-sashal@kernel.org> References: <20260228174750.1542406-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-DKIM: signer='kernel.org' status='pass' reason='' DKIMCheck: Server passes DKIM test, 0 Spam score X-Spam-Score: -1.2 (-) X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has performed the tests listed below against this email. Information: https://docs.mxroute.com/docs/expert-spam-filtering.html --- Content analysis details: (-1.2 points) --- pts rule name description ---- ---------------------- ----------------------------------------- 0.0 RCVD_IN_ZEN_BLOCKED_OPENDNS RBL: ADMINISTRATOR NOTICE: The query to zen.spamhaus.org was blocked due to usage of an open resolver. See https://www.spamhaus.org/returnc/pub/ [172.105.105.114 listed in zen.spamhaus.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender SpamTally: Final spam score: -11 From: "Darrick J. Wong" [ Upstream commit 6f13c1d2a6271c2e73226864a0e83de2770b6f34 ] Back in commit 2a2b5932db6758 ("xfs: fix attr leaf header freemap.size underflow"), Brian Foster observed that it's possible for a small freemap at the end of the end of the xattr entries array to experience a size underflow when subtracting the space consumed by an expansion of the entries array. There are only three freemap entries, which means that it is not a complete index of all free space in the leaf block. This code can leave behind a zero-length freemap entry with a nonzero base. Subsequent setxattr operations can increase the base up to the point that it overlaps with another freemap entry. This isn't in and of itself a problem because the code in _leaf_add that finds free space ignores any freemap entry with zero size. However, there's another bug in the freemap update code in _leaf_add, which is that it fails to update a freemap entry that begins midway through the xattr entry that was just appended to the array. That can result in the freemap containing two entries with the same base but different sizes (0 for the "pushed-up" entry, nonzero for the entry that's actually tracking free space). A subsequent _leaf_add can then allocate xattr namevalue entries on top of the entries array, leading to data loss. But fixing that is for later. For now, eliminate the possibility of confusion by zeroing out the base of any freemap entry that has zero size. Because the freemap is not intended to be a complete index of free space, a subsequent failure to find any free space for a new xattr will trigger block compaction, which regenerates the freemap. It looks like this bug has been in the codebase for quite a long time. Cc: # v2.6.12 Fixes: 1da177e4c3f415 ("Linux-2.6.12-rc2") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig Signed-off-by: Sasha Levin --- fs/xfs/libxfs/xfs_attr_leaf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index 91c1b30ebaab3..33c6c468ad8d5 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -1580,6 +1580,19 @@ xfs_attr3_leaf_add_work( min_t(uint16_t, ichdr->freemap[i].size, sizeof(xfs_attr_leaf_entry_t)); } + + /* + * Don't leave zero-length freemaps with nonzero base lying + * around, because we don't want the code in _remove that + * matches on base address to get confused and create + * overlapping freemaps. If we end up with no freemap entries + * then the next _add will compact the leaf block and + * regenerate the freemaps. + */ + if (ichdr->freemap[i].size == 0 && ichdr->freemap[i].base > 0) { + ichdr->freemap[i].base = 0; + ichdr->holes = 1; + } } ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); } -- 2.51.0 From - Sat Feb 28 20:01:41 2026 X-Mozilla-Status: 0001 X-Mozilla-Status2: 000000