* Re: [PATCH 20/23] usb: chipidea: use platform_device_set_of_node_from_dev()
From: Andy Shevchenko @ 2026-06-05 7:31 UTC (permalink / raw)
To: Peter Chen (CIX)
Cc: Bartosz Golaszewski, Lee Jones, Mark Brown, Thierry Reding,
Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Srinivas Kandagatla,
Greg Kroah-Hartman, Vinod Koul, Rafael J. Wysocki,
Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel,
Will Deacon, Robin Murphy, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Ulf Hansson, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, Paul Cercueil, Bin Liu, Philipp Zabel,
Maximilian Luz, Hans de Goede, Ilpo Järvinen,
Krzysztof Kozlowski, Benjamin Herrenschmidt, linux-kernel, netdev,
linux-arm-msm, linux-sound, driver-core, devicetree, linuxppc-dev,
linux-i2c, iommu, linux-pm, imx, linux-arm-kernel, intel-xe,
dri-devel, linux-usb, linux-mips, platform-driver-x86,
Bartosz Golaszewski
In-Reply-To: <aiJz6Ys4gE998ULp@nchen-desktop>
On Fri, Jun 05, 2026 at 02:59:53PM +0800, Peter Chen (CIX) wrote:
> On 26-06-04 08:34:16, Bartosz Golaszewski wrote:
> > On Tue, 2 Jun 2026 23:49:29 +0200, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> said:
> > > On Thu, May 21, 2026 at 10:36:43AM +0200, Bartosz Golaszewski wrote:
...
> > >> pdev->dev.parent = dev;
> > >> - device_set_of_node_from_dev(&pdev->dev, dev);
> > >> + platform_device_set_of_node_from_dev(pdev, dev);
> > >
> > > Why do they even do that? Do they have a USB connected pin control?
> >
> > I don't know. I can't test it so I don't want to break it. If they don't need
> > it, the person who can test it, can remove it later.
>
> It was introduced by below commits:
>
> commit 0f153a1b8193ce768be4df0400aeb2c8f2a3b3da
> Author: Rob Herring <robh@kernel.org>
> Date: Wed Dec 15 16:56:46 2021 -0600
>
> usb: chipidea: Set the DT node on the child device
>
> The ChipIdea glue drivers just copy the glue resources to the "ci_hdrc"
> child device. Instead, set the child device's DT node pointer to the
> parent device's node so that platform_get_irq() can find the IRQ
> resources in the DT. This removes the need for statically populating the
> IRQ resources from the DT which has been deprecated for some time.
This doesn't explain why the node marked as reused. device_set_node() fits
the above description. Rob?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH v14 0/8] arm64: add ARCH_HAS_COPY_MC support
From: Ruidong Tian @ 2026-06-05 7:33 UTC (permalink / raw)
To: Kefeng Wang, catalin.marinas, will, rafael, tony.luck, guohanjun,
mchehab, xueshuai, tongtiangen, james.morse, robin.murphy,
andreyknvl, dvyukov, vincenzo.frascino, mpe, npiggin,
ryabinin.a.a, glider, christophe.leroy, aneesh.kumar,
naveen.n.rao, tglx, mingo
Cc: linux-arm-kernel, linux-mm, linuxppc-dev, linux-kernel, kasan-dev
In-Reply-To: <f115ceaa-4573-41c0-8c8d-5f4fb1b017f2@huawei.com>
在 2026/5/18 23:05, Kefeng Wang 写道:
>
>
> On 5/18/2026 4:49 PM, Ruidong Tian wrote:
>> This series continues Tong Tiangen's work on arm64 ARCH_HAS_COPY_MC
>> support. We encounter the same problem, and from a forward-looking
>> perspective, large-memory ARM machines such as Grace and Vera will suffer
>> more from this class of issues, which motivates us to push this feature
>> upstream.
>>
>> Problem
>> =========
>> With the increase of memory capacity and density, the probability of
>> memory
>> error also increases. The increasing size and density of server RAM in
>> data
>> centers and clouds have shown increased uncorrectable memory errors.
>>
>> Currently, more and more scenarios that can tolerate memory errors,
>> such as
>> COW[1,2], KSM copy[3], coredump copy[4], khugepaged[5,6], uaccess
>> copy[7],
>> etc.
>
> We have encountered more scenarios and have made more enhancements, eg,
>
> 658be46520ce mm: support poison recovery from copy_present_page()
> aa549f923f5e mm: support poison recovery from do_cow_fault()
> f00b295b9b61 fs: hugetlbfs: support poisoned recover from
> hugetlbfs_migrate_folio()
> 060913999d7a mm: migrate: support poisoned recover from migrate folio
>
> Hope that the architecture-related sections can receive relevant reviews
> and responses.
>
> Thanks.
Thanks for the additional examples and for bringing up these scenarios.
Ruidong.> > Solution
>> =========
>>
>> This patchset introduces a new processing framework on ARM64, which
>> enables
>> ARM64 to support error recovery in the above scenarios, and more
>> scenarios
>> can be expanded based on this in the future.
>>
>> In arm64, memory error handling in do_sea(), which is divided into two
>> cases:
>> 1. If the user state consumed the memory errors, the solution is to
>> kill
>> the user process and isolate the error page.
>> 2. If the kernel state consumed the memory errors, the solution is to
>> panic.
>>
>> For case 2, Undifferentiated panic may not be the optimal choice, as
>> it can
>> be handled better. In some scenarios, we can avoid panic, such as
>> uaccess,
>> if the uaccess fails due to memory error, only the user process will be
>> affected, returning an error to the caller and isolating the user page
>> with
>> hardware memory errors is a better choice.
>>
>> [1] commit d302c2398ba2 ("mm, hwpoison: when copy-on-write hits
>> poison, take page offline")
>> [2] commit 1cb9dc4b475c ("mm: hwpoison: support recovery from HugePage
>> copy-on-write faults")
>> [3] commit 6b970599e807 ("mm: hwpoison: support recovery from
>> ksm_might_need_to_copy()")
>> [4] commit 245f09226893 ("mm: hwpoison: coredump: support recovery
>> from dump_user_range()")
>> [5] commit 98c76c9f1ef7 ("mm/khugepaged: recover from poisoned
>> anonymous memory")
>> [6] commit 12904d953364 ("mm/khugepaged: recover from poisoned file-
>> backed memory")
>> [7] commit 278b917f8cb9 ("x86/mce: Add _ASM_EXTABLE_CPY for copy user
>> access")
>>
>> ------------------
>> Test result:
>>
>> Tested on Kunpeng 920.
>>
>> 1. copy_page(), copy_mc_page() basic function test pass, and the
>> disassembly
>> contents remains the same before and after refactor.
>>
>> 2. copy_to/from_user() access kernel NULL pointer raise translation fault
>> and dump error message then die(), test pass.
>>
>> 3. Test following scenarios: copy_from_user(), get_user(), COW.
>>
>> Before patched: trigger a hardware memory error then panic.
>> After patched: trigger a hardware memory error without panic.
>>
>> Testing step:
>> step1. start an user-process.
>> step2. poison(einj) the user-process's page.
>> step3: user-process access the poison page in kernel mode, then
>> trigger SEA.
>> step4: the kernel will not panic, only the user process is killed,
>> the poison
>> page is isolated. (before patched, the kernel will panic in
>> do_sea())
>>
>> The above tests can also be reproduced using ras-tools, which
>> provides
>> einj-based injection and validation for uaccess and COW scenarios.
>> Example usage:
>>
>> einj_mem_uc futex # get_user
>> einj_mem_uc copyin # copy_to_user
>> einj_mem_uc copy-on-write # COW
>>
>> Link: https://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-
>> tools.git
>>
>> ------------------
>>
>> Benefits
>> =========
>> According to Huawei's statistics from their storage products, memory
>> errors
>> triggered in kernel-mode by COW and page cache read (uaccess) scenarios
>> account for more than 50%. With this patchset deployed, all kernel panics
>> caused by COW and page cache memory errors are eliminated.
>> Alibaba Cloud has also observed memory errors occurring in uaccess
>> contexts.
>>
>> Since V13:
>> 1. Changed MC-safe functions to return an error rather than kill the user
>> process. When a user program invokes a syscall and the kernel
>> encounters
>> a memory error during uaccess, killing the process is unexpected; the
>> syscall should return an error.
>> 2. Added FEAT_MOPS support for the copy_page_mc paths.
>> 3. Refactored copy_page() and memcpy() on top of the shared
>> memcpy_template,
>> reducing duplicated assembly code.
>>
>> Since v12:
>> Thanks to the suggestions of Jonathan, Mark, and Mauro, the following
>> modifications
>> are made:
>> 1. Rebase to latest kernel version.
>> 2. Patch1, add Jonathan's and Mauro's review-by.
>> 3. Patch2, modified do_apei_claim_sea() according to Mark's and
>> Jonathan's suggestions,
>> and optimized the commit message according to Mark's
>> suggestions(Added description of
>> the impact on regular copy_to_user()).
>> 4. Patch3, optimized the commit message according to Mauro's
>> suggestions and add Jonathan's
>> review-by.
>> 5. Patch4, modified copy_mc_user_highpage() and Optimized the commit
>> message according to
>> Jonathan's suggestions(no functional changes).
>> 6. Patch5, optimized the commit message according to Mauro's suggestions.
>> 7. Patch4/5, FEAT_MOPS is added to the code logic. Currently, the
>> fixup is not performed
>> on the MOPS instruction.
>> 8. Remove patch6 in v12 according to Jonathan's suggestions.
>>
>> Since v11:
>> 1. Rebase to latest kernel version 6.9-rc1.
>> 2. Add patch 5, Since the problem described in "Since V10 Besides 3" has
>> been solved in a50026bdb867 ('iov_iter: get rid of 'copy_mc' flag').
>> 3. Add the benefit of applying the patch set to our company to the
>> description of patch0.
>>
>> Since V10:
>> Accroding Mark's suggestion:
>> 1. Merge V10's patch2 and patch3 to V11's patch2.
>> 2. Patch2(V11): use new fixup_type for ld* in copy_to_user(), fix fatal
>> issues (NULL kernel pointeraccess) been fixup incorrectly.
>> 3. Patch2(V11): refactoring the logic of do_sea().
>> 4. Patch4(V11): Remove duplicate assembly logic and remove do_mte().
>>
>> Besides:
>> 1. Patch2(V11): remove st* insn's fixup, st* generally not trigger
>> memory error.
>> 2. Split a part of the logic of patch2(V11) to patch5(V11), for detail,
>> see patch5(V11)'s commit msg.
>> 3. Remove patch6(v10) “arm64: introduce copy_mc_to_kernel()
>> implementation”.
>> During modification, some problems that cannot be solved in a short
>> period are found. The patch will be released after the problems are
>> solved.
>> 4. Add test result in this patch.
>> 5. Modify patchset title, do not use machine check and remove "-next".
>>
>> Since V9:
>> 1. Rebase to latest kernel version 6.8-rc2.
>> 2. Add patch 6/6 to support copy_mc_to_kernel().
>>
>> Since V8:
>> 1. Rebase to latest kernel version and fix topo in some of the patches.
>> 2. According to the suggestion of Catalin, I attempted to modify the
>> return value of function copy_mc_[user]_highpage() to bytes not
>> copied.
>> During the modification process, I found that it would be more
>> reasonable to return -EFAULT when copy error occurs (referring to
>> the
>> newly added patch 4).
>>
>> For ARM64, the implementation of copy_mc_[user]_highpage() needs to
>> consider MTE. Considering the scenario where data copying is
>> successful
>> but the MTE tag copying fails, it is also not reasonable to return
>> bytes not copied.
>> 3. Considering the recent addition of machine check safe support for
>> multiple scenarios, modify commit message for patch 5 (patch 4
>> for V8).
>>
>> Since V7:
>> Currently, there are patches supporting recover from poison
>> consumption for the cow scenario[1]. Therefore, Supporting cow
>> scenario under the arm64 architecture only needs to modify the relevant
>> code under the arch/.
>> [1]https://lore.kernel.org/lkml/20221031201029.102123-1-
>> tony.luck@intel.com/
>>
>> Since V6:
>> Resend patches that are not merged into the mainline in V6.
>>
>> Since V5:
>> 1. Add patch2/3 to add uaccess assembly helpers.
>> 2. Optimize the implementation logic of arm64_do_kernel_sea() in
>> patch8.
>> 3. Remove kernel access fixup in patch9.
>> All suggestion are from Mark.
>>
>> Since V4:
>> 1. According Michael's suggestion, add patch5.
>> 2. According Mark's suggestiog, do some restructuring to arm64
>> extable, then a new adaptation of machine check safe support is made
>> based
>> on this.
>> 3. According Mark's suggestion, support machine check safe in
>> do_mte() in
>> cow scene.
>> 4. In V4, two patches have been merged into -next, so V5 not send these
>> two patches.
>>
>> Since V3:
>> 1. According to Robin's suggestion, direct modify user_ldst and
>> user_ldp in asm-uaccess.h and modify mte.S.
>> 2. Add new macro USER_MC in asm-uaccess.h, used in copy_from_user.S
>> and copy_to_user.S.
>> 3. According to Robin's suggestion, using micro in copy_page_mc.S to
>> simplify code.
>> 4. According to KeFeng's suggestion, modify powerpc code in patch1.
>> 5. According to KeFeng's suggestion, modify mm/extable.c and some code
>> optimization.
>>
>> Since V2:
>> 1. According to Mark's suggestion, all uaccess can be recovered due to
>> memory error.
>> 2. Scenario pagecache reading is also supported as part of uaccess
>> (copy_to_user()) and duplication code problem is also solved.
>> Thanks for Robin's suggestion.
>> 3. According Mark's suggestion, update commit message of patch 2/5.
>> 4. According Borisllav's suggestion, update commit message of patch
>> 1/5.
>>
>> Since V1:
>> 1.Consistent with PPC/x86, Using CONFIG_ARCH_HAS_COPY_MC instead of
>> ARM64_UCE_KERNEL_RECOVERY.
>> 2.Add two new scenes, cow and pagecache reading.
>> 3.Fix two small bug(the first two patch).
>>
>> V1 in here:
>> https://lore.kernel.org/lkml/20220323033705.3966643-1-
>> tongtiangen@huawei.com/
>>
>> Ruidong Tian (3):
>> ACPI: APEI: GHES: use exception context to gate SIGBUS on poison
>> consumption
>> lib/test: memcpy_kunit: add copy_page() and copy_mc_page() tests
>> lib/tests: memcpy_kunit: add memcpy_mc() and memcpy_mc_large() test
>>
>> Tong Tiangen (5):
>> uaccess: add generic fallback version of copy_mc_to_user()
>> arm64: add support for ARCH_HAS_COPY_MC
>> mm/hwpoison: return -EFAULT when copy fail in
>> copy_mc_[user]_highpage()
>> arm64: support copy_mc_[user]_highpage()
>> arm64: introduce copy_mc_to_kernel() implementation
>>
>> arch/arm64/Kconfig | 1 +
>> arch/arm64/include/asm/asm-extable.h | 22 ++-
>> arch/arm64/include/asm/asm-uaccess.h | 4 +
>> arch/arm64/include/asm/extable.h | 1 +
>> arch/arm64/include/asm/mte.h | 9 +
>> arch/arm64/include/asm/page.h | 10 ++
>> arch/arm64/include/asm/string.h | 5 +
>> arch/arm64/include/asm/uaccess.h | 17 ++
>> arch/arm64/kernel/acpi.c | 2 +-
>> arch/arm64/lib/Makefile | 2 +
>> arch/arm64/lib/copy_mc_page.S | 44 +++++
>> arch/arm64/lib/copy_page.S | 62 +------
>> arch/arm64/lib/copy_page_template.S | 71 ++++++++
>> arch/arm64/lib/copy_to_user.S | 10 +-
>> arch/arm64/lib/memcpy.S | 253 ++-------------------------
>> arch/arm64/lib/memcpy_mc.S | 56 ++++++
>> arch/arm64/lib/memcpy_template.S | 249 ++++++++++++++++++++++++++
>> arch/arm64/lib/mte.S | 29 +++
>> arch/arm64/mm/copypage.c | 75 ++++++++
>> arch/arm64/mm/extable.c | 21 +++
>> arch/arm64/mm/fault.c | 30 +++-
>> arch/powerpc/include/asm/uaccess.h | 1 +
>> arch/x86/include/asm/uaccess.h | 1 +
>> drivers/acpi/apei/ghes.c | 36 ++--
>> include/acpi/ghes.h | 6 +-
>> include/linux/highmem.h | 16 +-
>> include/linux/uaccess.h | 8 +
>> lib/tests/memcpy_kunit.c | 178 ++++++++++++++++++-
>> mm/kasan/shadow.c | 12 ++
>> mm/khugepaged.c | 4 +-
>> 30 files changed, 904 insertions(+), 331 deletions(-)
>> create mode 100644 arch/arm64/lib/copy_mc_page.S
>> create mode 100644 arch/arm64/lib/copy_page_template.S
>> create mode 100644 arch/arm64/lib/memcpy_mc.S
>> create mode 100644 arch/arm64/lib/memcpy_template.S
>>
^ permalink raw reply
* Re: [PATCH v2] powerpc/entry: Disable interrupts before irqentry_exit
From: Venkat Rao Bagalkote @ 2026-06-05 7:42 UTC (permalink / raw)
To: Shrikanth Hegde, maddy, linuxppc-dev
Cc: peterz, tglx, christophe.leroy, linux-kernel, mkchauras
In-Reply-To: <20260603131054.216235-1-sshegde@linux.ibm.com>
On 03/06/26 6:40 pm, Shrikanth Hegde wrote:
> Venkat reported a panic on powerpc-next tree where GENERIC_ENTRY has
> been enabled.
>
> kernel BUG at kernel/sched/core.c:7512!
> NIP preempt_schedule_irq+0x44/0x118
> LR dynamic_irqentry_exit_cond_resched+0x40/0x1a4
> Call Trace:
> dynamic_irqentry_exit_cond_resched+0x40/0x1a4
> do_page_fault+0xc0/0x104
> data_access_common_virt+0x210/0x220
>
> This happens since __do_page_fault ends up enabling the interrupts and
> it could take significant time such that need_resched could be set. This
> leads to schedule call in irqentry_exit leading to the bug.
>
> There are many such irq handlers which enables the interrupts.
> Fix it by disabling the irq before calling irqentry_exit. The same
> pattern exists today in interrupt_exit_kernel_prepare.
>
> Fixes: bee25f97ad24 ("powerpc: Enable GENERIC_ENTRY feature")
> Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> Closes: https://lore.kernel.org/all/7904105b-9dfa-4efd-a5ef-bc0276ed255d@linux.ibm.com/
> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
> ---
I was able to reproduce this issue consistently, and confirm with this
patch, reproted issue is fixed. Hence,
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Regards,
Venkat.
> This applies on top on powerpc/next tree.
> base: 6ed60999d33d '("powerpc: Remove unused functions")'
>
> v1->v2:
> Leave those BUG_ON alone since they are tracking the register
> state of userspace (Peter Zijlstra)
> v1: https://lore.kernel.org/all/20260603095521.198267-1-sshegde@linux.ibm.com/
>
> arch/powerpc/include/asm/entry-common.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h
> index de5601282755..fc636c42e89a 100644
> --- a/arch/powerpc/include/asm/entry-common.h
> +++ b/arch/powerpc/include/asm/entry-common.h
> @@ -260,9 +260,10 @@ static inline void arch_interrupt_exit_prepare(struct pt_regs *regs)
> * AMR can only have been unlocked if we interrupted the kernel.
> */
> kuap_assert_locked();
> -
> - local_irq_disable();
> }
> +
> + /* irqentry_exit expects to be called with interrupts disabled */
> + local_irq_disable();
> }
>
> static inline void arch_interrupt_async_enter_prepare(struct pt_regs *regs)
^ permalink raw reply
* Re: [PATCH] kvm powerpc/book3s-apiv2: Add suite initialization to skip GSB tests without APIv2 support
From: Vaibhav Jain @ 2026-06-05 7:46 UTC (permalink / raw)
To: Amit Machhiwal
Cc: linuxppc-dev, kvm, kvm-ppc, Madhavan Srinivasan, Michael Ellerman,
Eric Biggers
In-Reply-To: <20260604222102.70bbd95c-47-amachhiw@linux.ibm.com>
Hi Amit,
Thanks for looking into this patch. My responses to your review comments
inline below:
Amit Machhiwal <amachhiw@linux.ibm.com> writes:
> Hi Vaibhav,
>
> Thanks for the patch. Please find my comments inline.
>
> On 2026/06/04 02:59 PM, Vaibhav Jain wrote:
>> The guest state buffer (GSB) test suite currently fails on systems that
>> do not support the PAPR APIv2 nested virtualization. This happens because
>> the tests attempt to use APIv2-specific functionality without first
>> checking if the host supports it. This was recently reported [1] when
>> test-guest-state-buffer kunit tests were being run on Qemu without enabling
>> Qemu capability 'cap-nested-papr' which enabled APIv2 nested virtualization
>> for PPC64 Pseries Qemu machine.
>>
>> Add a suite_init callback that checks for APIv2 support by calling
>> plpar_guest_get_capabilities(). If the host does not support APIv2
>> (indicated by H_SUCCESS not being returned), mark all test cases in the
>> suite as KUNIT_SKIPPED. This prevents test failures on systems without
>> APIv2 support while still allowing the tests to run on capable systems.
>>
>> [1] https://lore.kernel.org/all/20260603064225.GC18149@sol/
>>
>> Reported-by: Eric Biggers <ebiggers@kernel.org>
>> Closes: https://lore.kernel.org/all/20260603064225.GC18149@sol
>> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>> Assisted-by: Bob:Claude-3.7-Sonnet Bob-Shell
>> ---
>> arch/powerpc/kvm/test-guest-state-buffer.c | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/powerpc/kvm/test-guest-state-buffer.c b/arch/powerpc/kvm/test-guest-state-buffer.c
>> index 5ccca306997a..f84b40fa55db 100644
>> --- a/arch/powerpc/kvm/test-guest-state-buffer.c
>> +++ b/arch/powerpc/kvm/test-guest-state-buffer.c
>> @@ -521,6 +521,24 @@ static void test_gs_hostwide_counters(struct kunit *test)
>> kvmppc_gsb_free(gsb);
>> }
>>
>> +static int init_gs_test_suite(struct kunit_suite *suite)
>> +{
>> + long rc;
>> + unsigned long host_capabilities;
>> + struct kunit_case *test_case;
>> +
>> + /* Enable test suite only if APIv2 is supported */
>> + rc = plpar_guest_get_capabilities(0, &host_capabilities);
>
> I believe we don't really need an hcall overhead to check the
> availability of APIv2. We could simply check:
>
> diff --git a/arch/powerpc/kvm/test-guest-state-buffer.c b/arch/powerpc/kvm/test-guest-state-buffer.c
> index 5ccca306997a..a263e7f31e15 100644
> --- a/arch/powerpc/kvm/test-guest-state-buffer.c
> +++ b/arch/powerpc/kvm/test-guest-state-buffer.c
> @@ -521,6 +521,18 @@ static void test_gs_hostwide_counters(struct kunit *test)
> kvmppc_gsb_free(gsb);
> }
>
> +static int init_gs_test_suite(struct kunit_suite *suite)
> +{
> + struct kunit_case *test_case;
> +
> + if (!kvmhv_is_nestedv2()) {
kvmhv_is_nestedv2() depends on a static-key which is only set in
kvmhv_nested_init(). This kunit testcase however can be run before
kvmhv_nested_init() is called thereby rendering this check ineffective.
> + kunit_suite_for_each_test_case(suite, test_case)
> + WRITE_ONCE(test_case->status, KUNIT_SKIPPED);
> + }
> +
> + return 0;
> +}
> +
>
> Also, I understand that these tests exercise gsb related tests specific
> to APIv2 but I see that only 'test_gs_hostwide_counters' relies on an
> APIv2 specific 'H_GUEST_GET_STATE' hcall but rest of the tests just
> operate on in-memory gsb. So, do we really want to skip all the tests
> when APIv2 is not available?
Fair point. However the GSB related code that these test-cases are
exercising will never be executed in a non nested-papr APIv2
environment. To properly validate the GSB management it should be
exercised with a hypervisor having support for nested-papr
APIv2. Hence it makes sense to only run these test cases with the
relevant support is available.
>
> If not, we could simply skip this one test as:
>
> diff --git a/arch/powerpc/kvm/test-guest-state-buffer.c b/arch/powerpc/kvm/test-guest-state-buffer.c
> index 5ccca306997a..89999b80fdfc 100644
> --- a/arch/powerpc/kvm/test-guest-state-buffer.c
> +++ b/arch/powerpc/kvm/test-guest-state-buffer.c
> @@ -462,7 +462,10 @@ static void test_gs_hostwide_counters(struct kunit *test)
> int rc;
>
> if (!kvmhv_on_pseries())
> - kunit_skip(test, "This test need a kmv-hv guest");
> + kunit_skip(test, "This test need a kvm-hv guest");
> +
> + if (!kvmhv_is_nestedv2())
> + kunit_skip(test, "This test needs an spapr nested APIv2 support");
As mentioned previously test for 'kvmhv_is_nestedv2()' may not be
correct when this kunit test is being executed.
Also I have proposed a minor change to kunit at [1] to address
possibility of being able to skip a kunit-suite in its entirety. Will
rework this patch if the proposed kunit changes are accepted.
[1] https://lore.kernel.org/all/20260604162805.556135-1-vaibhav@linux.ibm.com/
<snip>
--
Cheers
~ Vaibhav
^ permalink raw reply
* Re: [RFC PATCH net-next 1/5] ibmvnic: Move long delayed work on system_dfl_long_wq
From: Marco Crivellari @ 2026-06-05 7:48 UTC (permalink / raw)
To: linux-kernel, netdev
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Andrew Lunn,
David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Haren Myneni, Rick Lindsley, Nick Child, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
linuxppc-dev
In-Reply-To: <20260511092846.120141-2-marco.crivellari@suse.com>
Hi,
On Mon, May 11, 2026 at 11:28 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
>
> Currently the code enqueue work items using {queue|mod}_delayed_work(),
> using system_long_wq. This workqueue should be used when long works are
> expected and it is a per-cpu workqueue.
>
> The function(s) end up calling __queue_delayed_work(), which set a global
> timer that could fire anywhere, enqueuing the work where the timer fired.
>
> Unbound works could benefit from scheduler task placement, to optimize
> performance and power consumption. Long work shouldn't stick to a single
> CPU.
>
> Recently, a new unbound workqueue specific for long running work has
> been added:
>
> c116737e972e ("workqueue: Add system_dfl_long_wq for long unbound works")
>
> Since the workqueue work doesn't rely on per-cpu variables, there is no
> obvious reason that justify the use of a per-cpu workqueue. So change
> system_long_wq with system_dfl_long_wq so that the work may benefit from
> scheduler task placement.
>
> Cc: Haren Myneni <haren@linux.ibm.com>
> Cc: Rick Lindsley <ricklind@linux.ibm.com>
> Cc: Nick Child <nnac123@linux.ibm.com>
> Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
> ---
> drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Gentle ping.
Thanks!
--
Marco Crivellari
SUSE Labs
^ permalink raw reply
* Re: [PATCH 20/23] usb: chipidea: use platform_device_set_of_node_from_dev()
From: Peter Chen (CIX) @ 2026-06-05 6:59 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Andy Shevchenko, Lee Jones, Mark Brown, Thierry Reding,
Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Srinivas Kandagatla,
Greg Kroah-Hartman, Vinod Koul, Rafael J. Wysocki,
Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel,
Will Deacon, Robin Murphy, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Ulf Hansson, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, Paul Cercueil, Bin Liu, Philipp Zabel,
Maximilian Luz, Hans de Goede, Ilpo Järvinen,
Krzysztof Kozlowski, Benjamin Herrenschmidt, linux-kernel, netdev,
linux-arm-msm, linux-sound, driver-core, devicetree, linuxppc-dev,
linux-i2c, iommu, linux-pm, imx, linux-arm-kernel, intel-xe,
dri-devel, linux-usb, linux-mips, platform-driver-x86,
Bartosz Golaszewski
In-Reply-To: <CAMRc=MdhjZhGL9tEx9WEjn2f95d=ObNM0AtBNpcevm6aHgpj+Q@mail.gmail.com>
On 26-06-04 08:34:16, Bartosz Golaszewski wrote:
> On Tue, 2 Jun 2026 23:49:29 +0200, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> said:
> > On Thu, May 21, 2026 at 10:36:43AM +0200, Bartosz Golaszewski wrote:
> >> Ahead of reworking the reference counting logic for platform devices,
> >> encapsulate the assignment of the OF node from another device for
> >> dynamically allocated platform devices with the provided helper.
> >
> > ...
> >
> >> pdev->dev.parent = dev;
> >> - device_set_of_node_from_dev(&pdev->dev, dev);
> >> + platform_device_set_of_node_from_dev(pdev, dev);
> >
> > Why do they even do that? Do they have a USB connected pin control?
> >
>
> I don't know. I can't test it so I don't want to break it. If they don't need
> it, the person who can test it, can remove it later.
>
It was introduced by below commits:
commit 0f153a1b8193ce768be4df0400aeb2c8f2a3b3da
Author: Rob Herring <robh@kernel.org>
Date: Wed Dec 15 16:56:46 2021 -0600
usb: chipidea: Set the DT node on the child device
The ChipIdea glue drivers just copy the glue resources to the "ci_hdrc"
child device. Instead, set the child device's DT node pointer to the
parent device's node so that platform_get_irq() can find the IRQ
resources in the DT. This removes the need for statically populating the
IRQ resources from the DT which has been deprecated for some time.
Acked-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211215225646.1997946-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
Best regards,
Peter
^ permalink raw reply
* Re: [PATCH 20/23] usb: chipidea: use platform_device_set_of_node_from_dev()
From: Peter Chen (CIX) @ 2026-06-05 6:57 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Lee Jones, Mark Brown, Thierry Reding, Sebastian Hesselbarth,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Srinivas Kandagatla, Greg Kroah-Hartman, Vinod Koul,
Rafael J. Wysocki, Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Andy Shevchenko,
Joerg Roedel, Will Deacon, Robin Murphy, Doug Berger,
Florian Fainelli, Broadcom internal kernel review list,
Ulf Hansson, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Matthew Brost, Thomas Hellström, Rodrigo Vivi,
David Airlie, Simona Vetter, Paul Cercueil, Bin Liu,
Philipp Zabel, Maximilian Luz, Hans de Goede, Ilpo Järvinen,
Krzysztof Kozlowski, Benjamin Herrenschmidt, brgl, linux-kernel,
netdev, linux-arm-msm, linux-sound, driver-core, devicetree,
linuxppc-dev, linux-i2c, iommu, linux-pm, imx, linux-arm-kernel,
intel-xe, dri-devel, linux-usb, linux-mips, platform-driver-x86
In-Reply-To: <20260521-pdev-fwnode-ref-v1-20-88c324a1b8d2@oss.qualcomm.com>
On 26-05-21 10:36:43, Bartosz Golaszewski wrote:
> Ahead of reworking the reference counting logic for platform devices,
> encapsulate the assignment of the OF node from another device for
> dynamically allocated platform devices with the provided helper.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Peter
> ---
> drivers/usb/chipidea/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 7cfabb04a4fb80c6db56ccb430d290dbac61b716..5dd415f42fe0dd026e8a1cc162357e42ba8ceaec 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -888,7 +888,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
> }
>
> pdev->dev.parent = dev;
> - device_set_of_node_from_dev(&pdev->dev, dev);
> + platform_device_set_of_node_from_dev(pdev, dev);
>
> ret = platform_device_add_resources(pdev, res, nres);
> if (ret)
>
> --
> 2.47.3
>
--
Best regards,
Peter
^ permalink raw reply
* [PATCH v3 0/3] powerpc: fix preempt_count imbalances in perf and kexec paths
From: Aboorva Devarajan @ 2026-06-05 8:29 UTC (permalink / raw)
To: Madhavan Srinivasan, linuxppc-dev
Cc: Athira Rajeev, Aboorva Devarajan, Christophe Leroy, linux-kernel,
Sourabh Jain, Ritesh Harjani, Shrikanth Hegde
Hi all,
This patch series fixes some minor preempt_count bookkeeping issues in
arch/powerpc/ found during a preemption leak audit prompted by the
lazy/full preemption model changes. These are get_cpu/put_cpu and
get_cpu_var/put_cpu_var pairing errors that leave preempt_count
incorrectly elevated or underflowed.
v2 -> v3:
- Patches 2 and 3: use raw_smp_processor_id() instead of
smp_processor_id(). Both paths run with interrupts
disabled, so the plain accessor is sufficient.
v2: https://lore.kernel.org/all/20260603062743.1152253-1-aboorvad@linux.ibm.com/
v1: https://lore.kernel.org/all/20260518050855.1147242-1-aboorvad@linux.ibm.com/
Testing:
- Patches 2 and 3: kexec boot-tested on PowerNV (powernv_defconfig)
and pseries (pseries_defconfig).
- Patch 1: compile-tested only (ppc64e_defconfig + CONFIG_FSL_EMB_PERFMON);
no e500/fsl_emb hardware to runtime-test.
Please let me know your comments.
Thanks,
Aboorva
Aboorva Devarajan (3):
powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del
powerpc/powernv: fix preempt count leak in
pnv_kexec_wait_secondaries_down
powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpus
arch/powerpc/kexec/core_64.c | 4 +---
arch/powerpc/perf/core-fsl-emb.c | 3 ++-
arch/powerpc/platforms/powernv/setup.c | 3 ++-
3 files changed, 5 insertions(+), 5 deletions(-)
base-commit: 03da3bc22934393e1dcc63ed3c50457b6d7e345e
--
2.54.0
^ permalink raw reply
* [PATCH v3 1/3] powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del
From: Aboorva Devarajan @ 2026-06-05 8:29 UTC (permalink / raw)
To: Madhavan Srinivasan, linuxppc-dev
Cc: Athira Rajeev, Aboorva Devarajan, Christophe Leroy, linux-kernel,
Sourabh Jain, Ritesh Harjani, Shrikanth Hegde
In-Reply-To: <20260605082912.305100-1-aboorvad@linux.ibm.com>
fsl_emb_pmu_del() unconditionally calls put_cpu_var(cpu_hw_events) at
the 'out:' label, but only calls the matching get_cpu_var() after the
'i < 0' early-return check. When event->hw.idx is negative the
function jumps to 'out:' without having taken get_cpu_var(), and the
trailing put_cpu_var() then issues an unmatched preempt_enable(),
underflowing preempt_count.
On a CONFIG_PREEMPT=y kernel preempt_count would underflow and
eventually present as a 'scheduling while atomic' BUG.
Move put_cpu_var() to pair with get_cpu_var() so the percpu access is
correctly bracketed and the 'out:' label only handles perf_pmu_enable.
Fixes: a11106544f33 ("powerpc/perf: e500 support")
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
---
arch/powerpc/perf/core-fsl-emb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
index 7120ab20cbfe..02b5dd74c187 100644
--- a/arch/powerpc/perf/core-fsl-emb.c
+++ b/arch/powerpc/perf/core-fsl-emb.c
@@ -366,9 +366,10 @@ static void fsl_emb_pmu_del(struct perf_event *event, int flags)
cpuhw->n_events--;
+ put_cpu_var(cpu_hw_events);
+
out:
perf_pmu_enable(event->pmu);
- put_cpu_var(cpu_hw_events);
}
static void fsl_emb_pmu_start(struct perf_event *event, int ef_flags)
--
2.54.0
^ permalink raw reply related
* [PATCH v3 2/3] powerpc/powernv: fix preempt count leak in pnv_kexec_wait_secondaries_down
From: Aboorva Devarajan @ 2026-06-05 8:29 UTC (permalink / raw)
To: Madhavan Srinivasan, linuxppc-dev
Cc: Athira Rajeev, Aboorva Devarajan, Christophe Leroy, linux-kernel,
Sourabh Jain, Ritesh Harjani, Shrikanth Hegde
In-Reply-To: <20260605082912.305100-1-aboorvad@linux.ibm.com>
pnv_kexec_wait_secondaries_down() calls get_cpu() to obtain the current
CPU id but never calls the matching put_cpu(), leaking one
preempt_disable() nesting level on every invocation.
In practice the imbalance does not trigger a visible splat because the
kexec teardown path is a one-way trip: IRQs are already disabled, no
schedule() occurs after the leak, and default_machine_kexec() overwrites
preempt_count with HARDIRQ_OFFSET before jumping into kexec_sequence()
which never returns. However the bookkeeping is still wrong.
The function only needs the current CPU id, and this path runs with
interrupts disabled and the CPU pinned, so the preempt_disable()
side-effect of get_cpu() is unnecessary. Replace it with
raw_smp_processor_id().
Fixes: 298b34d7d578 ("powerpc/powernv: Fix kexec races going back to OPAL")
Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
---
arch/powerpc/platforms/powernv/setup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 4dbb47ddbdcc..06ed5e2aa265 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -396,7 +396,8 @@ static void pnv_kexec_wait_secondaries_down(void)
{
int my_cpu, i, notified = -1;
- my_cpu = get_cpu();
+ /* Called with interrupts disabled, so the CPU is pinned. */
+ my_cpu = raw_smp_processor_id();
for_each_online_cpu(i) {
uint8_t status;
--
2.54.0
^ permalink raw reply related
* [PATCH v3 3/3] powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpus
From: Aboorva Devarajan @ 2026-06-05 8:29 UTC (permalink / raw)
To: Madhavan Srinivasan, linuxppc-dev
Cc: Athira Rajeev, Aboorva Devarajan, Christophe Leroy, linux-kernel,
Sourabh Jain, Ritesh Harjani, Shrikanth Hegde
In-Reply-To: <20260605082912.305100-1-aboorvad@linux.ibm.com>
kexec_prepare_cpus_wait() calls get_cpu() internally to obtain the
current CPU id. kexec_prepare_cpus() calls kexec_prepare_cpus_wait()
twice -- once for KEXEC_STATE_IRQS_OFF and once for
KEXEC_STATE_REAL_MODE -- but only issues a single put_cpu() at the end,
leaving preempt_count elevated by one extra nesting level.
In practice the imbalance does not trigger a 'scheduling while atomic'
splat because the kexec path is a one-way trip: IRQs are already
disabled, no schedule() occurs after the leak, and
default_machine_kexec() overwrites preempt_count with HARDIRQ_OFFSET
before jumping into kexec_sequence() which never returns. However the
bookkeeping is still wrong.
kexec_prepare_cpus() calls local_irq_disable()/hard_irq_disable()
before invoking kexec_prepare_cpus_wait(), so the CPU is already pinned
and the get_cpu()/put_cpu() preempt_disable() bracketing is unnecessary.
Only the current CPU id is needed, so replace get_cpu() with
raw_smp_processor_id() and drop the now-unneeded put_cpu().
Fixes: 1fc711f7ffb0 ("powerpc/kexec: Fix race in kexec shutdown")
Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
---
arch/powerpc/kexec/core_64.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/kexec/core_64.c b/arch/powerpc/kexec/core_64.c
index 825ab8a88f18..58c13a59b93b 100644
--- a/arch/powerpc/kexec/core_64.c
+++ b/arch/powerpc/kexec/core_64.c
@@ -169,7 +169,7 @@ static void kexec_prepare_cpus_wait(int wait_state)
int my_cpu, i, notified=-1;
hw_breakpoint_disable();
- my_cpu = get_cpu();
+ my_cpu = raw_smp_processor_id();
/* Make sure each CPU has at least made it to the state we need.
*
* FIXME: There is a (slim) chance of a problem if not all of the CPUs
@@ -267,8 +267,6 @@ static void kexec_prepare_cpus(void)
/* after we tell the others to go down */
if (ppc_md.kexec_cpu_down)
ppc_md.kexec_cpu_down(0, 0);
-
- put_cpu();
}
#else /* ! SMP */
--
2.54.0
^ permalink raw reply related
* Re: [kvm-unit-tests RFC PATCH 2/6] configure: Make arch_libdir a first-class entity
From: Chinmay Rath @ 2026-06-05 8:34 UTC (permalink / raw)
To: Andrew Jones, thuth; +Cc: npiggin, harshpb, lvivier, linuxppc-dev, kvm, sbhat
In-Reply-To: <emxfxob3hs2kqjmdbtucwr65dlywqapsz76ow7ebnqhf5vmrtq@i2wodbzjs5cb>
On 6/2/26 21:24, Andrew Jones wrote:
> On Tue, Jun 02, 2026 at 12:18:02PM +0530, Chinmay Rath wrote:
>> From: Nicholas Piggin <npiggin@gmail.com>
>>
>> arch_libdir was brought in to improve the heuristic determination of
>> the lib/ directory based on arch and testdir names, but it did not
>> entirely clean that mess up.
>>
>> Remove the arch_libdir->arch->testdir heuristic and just require
>> everybody sets arch_libdir correctly. Fail if the lib/arch or
>> lib/arch/asm directories can not be found.
>>
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> Signed-off-by: Chinmay Rath <rathc@linux.ibm.com>
>> ---
>> Makefile | 2 +-
>> configure | 20 ++++++++++++--------
>> 2 files changed, 13 insertions(+), 9 deletions(-)
>>
> Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Thank you Andrew !
Hi Thomas, requesting your insight on the un-reviewed patches. TIA.
-Chinmay
^ permalink raw reply
* Re: [PATCH v3 3/3] powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpus
From: Shrikanth Hegde @ 2026-06-05 11:03 UTC (permalink / raw)
To: Aboorva Devarajan, Madhavan Srinivasan, linuxppc-dev
Cc: Athira Rajeev, Christophe Leroy, linux-kernel, Sourabh Jain,
Ritesh Harjani
In-Reply-To: <20260605082912.305100-4-aboorvad@linux.ibm.com>
On 6/5/26 1:59 PM, Aboorva Devarajan wrote:
> kexec_prepare_cpus_wait() calls get_cpu() internally to obtain the
> current CPU id. kexec_prepare_cpus() calls kexec_prepare_cpus_wait()
> twice -- once for KEXEC_STATE_IRQS_OFF and once for
> KEXEC_STATE_REAL_MODE -- but only issues a single put_cpu() at the end,
> leaving preempt_count elevated by one extra nesting level.
>
> In practice the imbalance does not trigger a 'scheduling while atomic'
> splat because the kexec path is a one-way trip: IRQs are already
> disabled, no schedule() occurs after the leak, and
> default_machine_kexec() overwrites preempt_count with HARDIRQ_OFFSET
> before jumping into kexec_sequence() which never returns. However the
> bookkeeping is still wrong.
>
> kexec_prepare_cpus() calls local_irq_disable()/hard_irq_disable()
> before invoking kexec_prepare_cpus_wait(), so the CPU is already pinned
> and the get_cpu()/put_cpu() preempt_disable() bracketing is unnecessary.
> Only the current CPU id is needed, so replace get_cpu() with
> raw_smp_processor_id() and drop the now-unneeded put_cpu().
>
> Fixes: 1fc711f7ffb0 ("powerpc/kexec: Fix race in kexec shutdown")
> Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
> ---
> arch/powerpc/kexec/core_64.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kexec/core_64.c b/arch/powerpc/kexec/core_64.c
> index 825ab8a88f18..58c13a59b93b 100644
> --- a/arch/powerpc/kexec/core_64.c
> +++ b/arch/powerpc/kexec/core_64.c
> @@ -169,7 +169,7 @@ static void kexec_prepare_cpus_wait(int wait_state)
> int my_cpu, i, notified=-1;
>
> hw_breakpoint_disable();
> - my_cpu = get_cpu();
> + my_cpu = raw_smp_processor_id();
> /* Make sure each CPU has at least made it to the state we need.
> *
> * FIXME: There is a (slim) chance of a problem if not all of the CPUs
> @@ -267,8 +267,6 @@ static void kexec_prepare_cpus(void)
> /* after we tell the others to go down */
> if (ppc_md.kexec_cpu_down)
> ppc_md.kexec_cpu_down(0, 0);
> -
> - put_cpu();
> }
>
> #else /* ! SMP */
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
^ permalink raw reply
* Re: [PATCH] crypto: powerpc/aes - use min in ppc_{ecb,cbc,ctr,xts}_crypt
From: Herbert Xu @ 2026-06-05 11:42 UTC (permalink / raw)
To: Thorsten Blum
Cc: David S. Miller, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy (CS GROUP), linux-crypto,
linuxppc-dev, linux-kernel
In-Reply-To: <20260527141146.1230672-3-thorsten.blum@linux.dev>
On Wed, May 27, 2026 at 04:11:47PM +0200, Thorsten Blum wrote:
> Replace min_t() with the simpler min() macro since the values are
> unsigned and compatible.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/powerpc/crypto/aes-spe-glue.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH v3] crypto: nx: fix nx_crypto_ctx_exit argument
From: Herbert Xu @ 2026-06-05 11:40 UTC (permalink / raw)
To: Sam James
Cc: Breno Leitão, Nayna Jain, Paulo Flabiano Smorigo,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), David S. Miller, Ard Biesheuvel,
Eric Biggers, Eric Biggers, stable, Calvin Buckley, Brad Spengler,
linux-crypto, linuxppc-dev, linux-kernel
In-Reply-To: <844faa8a75585e4088c95c052dd0ecd189bc3a64.1779695779.git.sam@gentoo.org>
On Mon, May 25, 2026 at 08:56:19AM +0100, Sam James wrote:
> nx_crypto_ctx_shash_exit calls nx_crypto_ctx_exit with crypto_shash_ctx(...)
> but crypto_shash_ctx gives a nx_crypto_ctx *, not a crypto_tfm *.
>
> Fix the type in nx_crypto_ctx_exit and drop the bogus crypto_tfm_ctx
> call.
>
> This fixes the following oops:
>
> BUG: Unable to handle kernel data access at 0xc0403effffffffc8
> Faulting instruction address: 0xc000000000396cb4
> Oops: Kernel access of bad area, sig: 11 [#15]
> Call Trace:
> nx_crypto_ctx_shash_exit+0x24/0x60
> crypto_shash_exit_tfm+0x28/0x40
> crypto_destroy_tfm+0x98/0x140
> crypto_exit_ahash_using_shash+0x20/0x40
> crypto_destroy_tfm+0x98/0x140
> hash_release+0x1c/0x30
> alg_sock_destruct+0x38/0x60
> __sk_destruct+0x48/0x2b0
> af_alg_release+0x58/0xb0
> __sock_release+0x68/0x150
> sock_close+0x20/0x40
> __fput+0x110/0x3a0
> sys_close+0x48/0xa0
> system_call_exception+0x140/0x2d0
> system_call_common+0xf4/0x258
>
> .. which came from hardlink(1) opportunistically using AF_ALG.
>
> The same problem exists with nx_crypto_ctx_skcipher_exit getting a context
> it wasn't expecting, but apparently nobody hit that for years.
>
> Cc: Eric Biggers <ebiggers@kernel.org>
> Cc: stable@vger.kernel.org
> Fixes: bfd9efddf990 ("crypto: nx - convert AES-ECB to skcipher API")
> Fixes: 9420e628e7d8 ("crypto: nx - Use API partial block handling")
> Acked-by: Breno Leitao <leitao@debian.org>
> Reviewed-by: Eric Biggers <ebiggers@kernel.org>
> Reported-by: Calvin Buckley <calvin@cmpct.info>
> Tested-by: Calvin Buckley <calvin@cmpct.info>
> Suggested-by: Brad Spengler <brad.spengler@opensrcsec.com>
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
> v3: Fix doc tag.
> v2: Add stable cc, fix doc for tfm param.
>
> v1: https://lore.kernel.org/all/a3e89c1e8342ffa415b0d29725a0571a4f355d34.1779472902.git.sam@gentoo.org/
> v2: https://lore.kernel.org/all/b8b1b6fe740187c70349cd04a820d57324e0f70c.1779509289.git.sam@gentoo.org/
>
> drivers/crypto/nx/nx.c | 6 ++----
> drivers/crypto/nx/nx.h | 2 +-
> 2 files changed, 3 insertions(+), 5 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 08/23] driver core: platform: provide platform_device_set_of_node_from_dev()
From: Johan Hovold @ 2026-06-05 12:16 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Bartosz Golaszewski, Lee Jones, Mark Brown, Thierry Reding,
Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Srinivas Kandagatla,
Greg Kroah-Hartman, Vinod Koul, Rafael J. Wysocki,
Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel,
Will Deacon, Robin Murphy, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Ulf Hansson, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, Peter Chen, Paul Cercueil, Bin Liu, Philipp Zabel,
Maximilian Luz, Hans de Goede, Ilpo Järvinen,
Krzysztof Kozlowski, Benjamin Herrenschmidt, brgl, linux-kernel,
netdev, linux-arm-msm, linux-sound, driver-core, devicetree,
linuxppc-dev, linux-i2c, iommu, linux-pm, imx, linux-arm-kernel,
intel-xe, dri-devel, linux-usb, linux-mips, platform-driver-x86
In-Reply-To: <ah9O15bMlAYgSlHx@ashevche-desk.local>
On Wed, Jun 03, 2026 at 12:44:55AM +0300, Andy Shevchenko wrote:
> On Thu, May 21, 2026 at 10:36:31AM +0200, Bartosz Golaszewski wrote:
> > Provide a platform-specific variant of device_set_of_node_from_dev(). In
> > addition to bumping the reference count of the OF node being assigned,
> > it also assigns the fwnode of the platform device.
>
> Can we rather investigate the way how to make that of node reuse thingy
> (which is used solely by pin control) differently and then drop this confusing
> device_set_of_node_from_dev() call altogether?
No, that call is needed. See commit 4e75e1d7dac9 ("driver core: add
helper to reuse a device-tree node") for details.
Johan
^ permalink raw reply
* Re: [PATCH 22/23] reset: rzg2l: use platform_device_set_of_node_from_dev()
From: Johan Hovold @ 2026-06-05 12:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Philipp Zabel, Bartosz Golaszewski, Lee Jones, Mark Brown,
Thierry Reding, Sebastian Hesselbarth, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Srinivas Kandagatla, Greg Kroah-Hartman, Vinod Koul,
Rafael J. Wysocki, Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel,
Will Deacon, Robin Murphy, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Ulf Hansson, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, Peter Chen, Paul Cercueil, Bin Liu, Maximilian Luz,
Hans de Goede, Ilpo Järvinen, Krzysztof Kozlowski,
Benjamin Herrenschmidt, brgl, linux-kernel, netdev, linux-arm-msm,
linux-sound, driver-core, devicetree, linuxppc-dev, linux-i2c,
iommu, linux-pm, imx, linux-arm-kernel, intel-xe, dri-devel,
linux-usb, linux-mips, platform-driver-x86
In-Reply-To: <ah9QtExF2rUUTMNo@ashevche-desk.local>
On Wed, Jun 03, 2026 at 12:52:52AM +0300, Andy Shevchenko wrote:
> On Tue, Jun 02, 2026 at 10:24:41AM +0200, Philipp Zabel wrote:
> > On Do, 2026-05-21 at 10:36 +0200, Bartosz Golaszewski wrote:
> > > Ahead of reworking the reference counting logic for platform devices,
> > > encapsulate the assignment of the OF node from another device for
> > > dynamically allocated platform devices with the provided helper.
>
> ...
>
> > > - device_set_of_node_from_dev(&vdev->dev, dev);
> > > + platform_device_set_of_node_from_dev(vdev, dev);
>
> Same Q here, why it uses inherited call? Cargo cult?
>
> 'reused' flag is solely pin control (provider!) thingy as far as I remember.
No, it's needed for pin control *consumers*, which can be any device,
and potentially any other resource managed by driver core or bus code.
Johan
^ permalink raw reply
* [PATCH v2] powerpc/vtime: Initialize starttime at boot for native accounting
From: Shrikanth Hegde @ 2026-06-05 12:43 UTC (permalink / raw)
To: maddy, linuxppc-dev, christophe.leroy
Cc: sshegde, frederic, Christophe Leroy (CS GROUP)
It was observed that /proc/stat had very large value for one ore more
CPUs. It was more visible after recent code simplifications around
cpustats.
System has 240 CPUs.
cat /proc/uptime;
194.18 46500.55
cat /proc/stat
cpu 5966 39 837032887 4650070 164 185 100 0 0 0
cpu0 108 0 837030890 19109 24 4 23 0 0 0
Since uptime is 194s, system time of each CPU can't be more than 19400.
Sum of system time of all CPUs can't be more than 19400*240 4656000.
In fact huge value is close to mftb(). Note mftb doesn't reset on powerVM
when the LPAR restart. It only resets when whole system resets. The same
issue exists for kexec too.
This happens since starttime is not setup at init time. Once it is set
then subsequent vtime_delta will return the right delta.
Fix it by initializing the starttime during CPU initialization. This
fixes the large times seen.
cat /proc/uptime; cat /proc/stat
15.78 3694.63
cpu 6035 35 1347 369479 23 144 49 0 0 0
cpu0 19 0 38 1508 0 1 14 0 0 0
Now, system time is reported as expected.
Fixes: cf9efce0ce31 ("powerpc: Account time using timebase rather than PURR")
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Suggested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
---
Applies on top of tip/timers/nohz
at 6199f9999a9b ("sched/cputime: Handle dyntick-idle steal time correctly")
Discussion thread:
https://lore.kernel.org/all/cd10be19-e0bc-4e0c-8dac-4f1c05d0de8f@kernel.org/
Note: Backporting to earlier tags may need manual addition of
vtime_reset where needed!
v1->v2:
- Addeds tags and Fixes. (Thanks to Christophe Leroy)
v1: https://lore.kernel.org/all/20260604132429.297665-1-sshegde@linux.ibm.com/
arch/powerpc/kernel/time.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 3460d1a5a97c..11145c40183d 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -377,7 +377,6 @@ void vtime_task_switch(struct task_struct *prev)
}
}
-#ifdef CONFIG_NO_HZ_COMMON
/**
* vtime_reset - Fast forward vtime entry clocks
*
@@ -394,6 +393,7 @@ void vtime_reset(void)
#endif
}
+#ifdef CONFIG_NO_HZ_COMMON
/**
* vtime_dyntick_start - Inform vtime about entry to idle-dynticks
*
@@ -933,6 +933,7 @@ static void __init set_decrementer_max(void)
static void __init init_decrementer_clockevent(void)
{
register_decrementer_clockevent(smp_processor_id());
+ vtime_reset();
}
void secondary_cpu_time_init(void)
@@ -948,6 +949,7 @@ void secondary_cpu_time_init(void)
/* FIME: Should make unrelated change to move snapshot_timebase
* call here ! */
register_decrementer_clockevent(smp_processor_id());
+ vtime_reset();
}
/*
--
2.47.3
^ permalink raw reply related
* Re: [PATCH 08/23] driver core: platform: provide platform_device_set_of_node_from_dev()
From: Andy Shevchenko @ 2026-06-05 14:53 UTC (permalink / raw)
To: Johan Hovold
Cc: Bartosz Golaszewski, Lee Jones, Mark Brown, Thierry Reding,
Sebastian Hesselbarth, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Srinivas Kandagatla,
Greg Kroah-Hartman, Vinod Koul, Rafael J. Wysocki,
Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel,
Will Deacon, Robin Murphy, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Ulf Hansson, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, Peter Chen, Paul Cercueil, Bin Liu, Philipp Zabel,
Maximilian Luz, Hans de Goede, Ilpo Järvinen,
Krzysztof Kozlowski, Benjamin Herrenschmidt, brgl, linux-kernel,
netdev, linux-arm-msm, linux-sound, driver-core, devicetree,
linuxppc-dev, linux-i2c, iommu, linux-pm, imx, linux-arm-kernel,
intel-xe, dri-devel, linux-usb, linux-mips, platform-driver-x86
In-Reply-To: <aiK-EXwp_xhcbty9@hovoldconsulting.com>
On Fri, Jun 05, 2026 at 02:16:17PM +0200, Johan Hovold wrote:
> On Wed, Jun 03, 2026 at 12:44:55AM +0300, Andy Shevchenko wrote:
> > On Thu, May 21, 2026 at 10:36:31AM +0200, Bartosz Golaszewski wrote:
> > > Provide a platform-specific variant of device_set_of_node_from_dev(). In
> > > addition to bumping the reference count of the OF node being assigned,
> > > it also assigns the fwnode of the platform device.
> >
> > Can we rather investigate the way how to make that of node reuse thingy
> > (which is used solely by pin control) differently and then drop this confusing
> > device_set_of_node_from_dev() call altogether?
>
> No, that call is needed. See commit 4e75e1d7dac9 ("driver core: add
> helper to reuse a device-tree node") for details.
Bart fixes the problem with the platform driver. At the result this will be
the only device_set_node() + 'reused = true'. As for 'reused' flag, the need
is only for pinmux/pin control stuff. The question here is if there is a better
way to make that 'reused' be done automatically without need of setting some
flag explicitly.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH 22/23] reset: rzg2l: use platform_device_set_of_node_from_dev()
From: Andy Shevchenko @ 2026-06-05 14:54 UTC (permalink / raw)
To: Johan Hovold
Cc: Philipp Zabel, Bartosz Golaszewski, Lee Jones, Mark Brown,
Thierry Reding, Sebastian Hesselbarth, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Srinivas Kandagatla, Greg Kroah-Hartman, Vinod Koul,
Rafael J. Wysocki, Danilo Krummrich, Rob Herring, Saravana Kannan,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel,
Will Deacon, Robin Murphy, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Ulf Hansson, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, Peter Chen, Paul Cercueil, Bin Liu, Maximilian Luz,
Hans de Goede, Ilpo Järvinen, Krzysztof Kozlowski,
Benjamin Herrenschmidt, brgl, linux-kernel, netdev, linux-arm-msm,
linux-sound, driver-core, devicetree, linuxppc-dev, linux-i2c,
iommu, linux-pm, imx, linux-arm-kernel, intel-xe, dri-devel,
linux-usb, linux-mips, platform-driver-x86
In-Reply-To: <aiK-qZqpuC-OEigf@hovoldconsulting.com>
On Fri, Jun 05, 2026 at 02:18:49PM +0200, Johan Hovold wrote:
> On Wed, Jun 03, 2026 at 12:52:52AM +0300, Andy Shevchenko wrote:
> > On Tue, Jun 02, 2026 at 10:24:41AM +0200, Philipp Zabel wrote:
> > > On Do, 2026-05-21 at 10:36 +0200, Bartosz Golaszewski wrote:
...
> > > > - device_set_of_node_from_dev(&vdev->dev, dev);
> > > > + platform_device_set_of_node_from_dev(vdev, dev);
> >
> > Same Q here, why it uses inherited call? Cargo cult?
> >
> > 'reused' flag is solely pin control (provider!) thingy as far as I remember.
>
> No, it's needed for pin control *consumers*, which can be any device,
> and potentially any other resource managed by driver core or bus code.
Why don't we set it for every pin control consumer automatically?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* Re: [PATCH] dma: fsldma: convert to platform_get_irq_optional()
From: Frank Li @ 2026-06-05 18:29 UTC (permalink / raw)
To: Rosen Penev
Cc: dmaengine, Zhang Wei, Vinod Koul, Frank Li,
open list:FREESCALE DMA DRIVER, open list
In-Reply-To: <20260603191951.5729-1-rosenp@gmail.com>
tags is dmaengine: fsldma:
On Wed, Jun 03, 2026 at 12:19:51PM -0700, Rosen Penev wrote:
> Replace the per-controller irq_of_parse_and_map() call with
> platform_get_irq_optional(). The controller IRQ is optional — when
> absent (-ENXIO) the driver falls back to per-channel IRQs. Any other
> error is treated as fatal. The corresponding irq_dispose_mapping()
> calls in the probe error path and remove function are removed.
>
> The per-channel IRQ mapping in fsl_dma_chan_probe() uses a child
> device_node rather than the platform device's of_node, so it is not
> converted here.
>
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/dma/fsldma.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index 98d02809ade5..08a8090178f8 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -1239,7 +1239,16 @@ static int fsldma_of_probe(struct platform_device *op)
> }
>
> /* map the channel IRQ if it exists, but don't hookup the handler yet */
> - fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0);
> + fdev->irq = platform_get_irq_optional(op, 0);
> + if (fdev->irq < 0) {
> + if (fdev->irq != -ENXIO) {
> + err = fdev->irq;
> + iounmap(fdev->regs);
> + kfree(fdev);
should goto below error label
Frank
> + return err;
> + }
> + fdev->irq = 0;
> + }
>
> dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
> dma_cap_set(DMA_SLAVE, fdev->common.cap_mask);
> @@ -1301,7 +1310,6 @@ static int fsldma_of_probe(struct platform_device *op)
> if (fdev->chan[i])
> fsl_dma_chan_remove(fdev->chan[i]);
> }
> - irq_dispose_mapping(fdev->irq);
> iounmap(fdev->regs);
> out_free:
> kfree(fdev);
> @@ -1323,7 +1331,6 @@ static void fsldma_of_remove(struct platform_device *op)
> if (fdev->chan[i])
> fsl_dma_chan_remove(fdev->chan[i]);
> }
> - irq_dispose_mapping(fdev->irq);
>
> iounmap(fdev->regs);
> kfree(fdev);
> --
> 2.54.0
>
^ permalink raw reply
* [PATCH 01/10] dmaengine: fsldma: kill tasklet before removing channel
From: Rosen Penev @ 2026-06-05 22:01 UTC (permalink / raw)
To: dmaengine
Cc: Vinod Koul, Frank Li, Zhang Wei, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, open list,
open list:FREESCALE DMA DRIVER,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
In-Reply-To: <20260605220134.43295-1-rosenp@gmail.com>
Add tasklet_kill() in fsl_dma_chan_remove() to prevent a race
where the tasklet, scheduled by the IRQ handler, runs after
the channel has been torn down. With the recent devm conversions
the channel struct is no longer freed in the remove path, so
this is not a use-after-free crash fix, but rather correct
shutdown sequencing to avoid the tasklet operating on a
logically-removed channel.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/dma/fsldma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 22d62d958abd..0e2f84862261 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1205,6 +1205,7 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev,
static void fsl_dma_chan_remove(struct fsldma_chan *chan)
{
+ tasklet_kill(&chan->tasklet);
irq_dispose_mapping(chan->irq);
list_del(&chan->common.device_node);
iounmap(chan->regs);
--
2.54.0
^ permalink raw reply related
* [PATCH 00/10] dmaengine: fsldma: devm conversion, fixups, and cleanups
From: Rosen Penev @ 2026-06-05 22:01 UTC (permalink / raw)
To: dmaengine
Cc: Vinod Koul, Frank Li, Zhang Wei, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, open list,
open list:FREESCALE DMA DRIVER,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
Convert the Freescale Elo DMA driver to use managed device resources
(devm), simplifying probe error handling and the remove path by
dropping explicit iounmap, kfree, and free_irq calls.
While doing so, fix a few issues uncovered along the way:
- Kill the channel tasklet before removal to prevent a race with
the IRQ handler.
- Check the return value of dma_async_device_register() instead
of silently returning success.
- Replace the powerpc-specific I/O accessors with portable
generic ones so the driver can be built on non-powerpc
architectures.
Build-tested with LLVM=1 ARCH=powerpc allmodconfig.
Rosen Penev (10):
dmaengine: fsldma: kill tasklet before removing channel
dmaengine: fsldma: check dma_async_device_register() return value
dmaengine: fsldma: convert to platform_get_irq_optional()
dmaengine: fsldma: convert to devm_kzalloc and fix error path
dmaengine: fsldma: convert ioremap to devm_platform_ioremap_resource
dmaengine: fsldma: convert channel allocation to devm_kzalloc
dmaengine: fsldma: convert channel ioremap to devm_of_iomap
dmaengine: fsldma: replace irq_of_parse_and_map with of_irq_get
dmaengine: fsldma: convert to devm_request_irq
dmaengine: fsldma: replace ppc-specific accessors with portable
generic ones
drivers/dma/Kconfig | 2 +-
drivers/dma/fsldma.c | 139 +++++++++++++------------------------------
drivers/dma/fsldma.h | 35 ++++++++++-
3 files changed, 76 insertions(+), 100 deletions(-)
--
2.54.0
^ permalink raw reply
* [PATCH 02/10] dmaengine: fsldma: check dma_async_device_register() return value
From: Rosen Penev @ 2026-06-05 22:01 UTC (permalink / raw)
To: dmaengine
Cc: Vinod Koul, Frank Li, Zhang Wei, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, open list,
open list:FREESCALE DMA DRIVER,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
In-Reply-To: <20260605220134.43295-1-rosenp@gmail.com>
Check the return value of dma_async_device_register() in the probe
path and propagate errors instead of silently returning success.
Previously, a registration failure would cause a NULL pointer
dereference in list_del_rcu() during remove when
dma_async_device_unregister() tried to remove the device's
global_node from a list it was never added to.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/dma/fsldma.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 0e2f84862261..89b88447be1b 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1293,7 +1293,11 @@ static int fsldma_of_probe(struct platform_device *op)
goto out_free_fdev;
}
- dma_async_device_register(&fdev->common);
+ err = dma_async_device_register(&fdev->common);
+ if (err) {
+ dev_err(fdev->dev, "unable to register DMA device\n");
+ goto out_free_fdev;
+ }
return 0;
out_free_fdev:
--
2.54.0
^ permalink raw reply related
* [PATCH 03/10] dmaengine: fsldma: convert to platform_get_irq_optional()
From: Rosen Penev @ 2026-06-05 22:01 UTC (permalink / raw)
To: dmaengine
Cc: Vinod Koul, Frank Li, Zhang Wei, Nathan Chancellor,
Nick Desaulniers, Bill Wendling, Justin Stitt, open list,
open list:FREESCALE DMA DRIVER,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
In-Reply-To: <20260605220134.43295-1-rosenp@gmail.com>
Replace the per-controller irq_of_parse_and_map() call with
platform_get_irq_optional(). The controller IRQ is optional — when
absent (-ENXIO) the driver falls back to per-channel IRQs. Any other
error is treated as fatal. The corresponding irq_dispose_mapping()
calls in the probe error path and remove function are removed.
The per-channel IRQ mapping in fsl_dma_chan_probe() uses a child
device_node rather than the platform device's of_node, so it is not
converted here.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/dma/fsldma.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 89b88447be1b..0d28f8299bf8 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1206,7 +1206,6 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev,
static void fsl_dma_chan_remove(struct fsldma_chan *chan)
{
tasklet_kill(&chan->tasklet);
- irq_dispose_mapping(chan->irq);
list_del(&chan->common.device_node);
iounmap(chan->regs);
kfree(chan);
@@ -1239,7 +1238,14 @@ static int fsldma_of_probe(struct platform_device *op)
}
/* map the channel IRQ if it exists, but don't hookup the handler yet */
- fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0);
+ fdev->irq = platform_get_irq_optional(op, 0);
+ if (fdev->irq < 0) {
+ if (fdev->irq != -ENXIO) {
+ err = fdev->irq;
+ goto out_iounmap;
+ }
+ fdev->irq = 0;
+ }
dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
dma_cap_set(DMA_SLAVE, fdev->common.cap_mask);
@@ -1305,7 +1311,7 @@ static int fsldma_of_probe(struct platform_device *op)
if (fdev->chan[i])
fsl_dma_chan_remove(fdev->chan[i]);
}
- irq_dispose_mapping(fdev->irq);
+out_iounmap:
iounmap(fdev->regs);
out_free:
kfree(fdev);
@@ -1327,7 +1333,6 @@ static void fsldma_of_remove(struct platform_device *op)
if (fdev->chan[i])
fsl_dma_chan_remove(fdev->chan[i]);
}
- irq_dispose_mapping(fdev->irq);
iounmap(fdev->regs);
kfree(fdev);
--
2.54.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox