Skip to content

Conversation

@frank-w
Copy link
Owner

@frank-w frank-w commented Dec 12, 2017

Merge actual kernel-repo

KAGA-KOKO and others added 30 commits November 27, 2017 08:48
Remove circular dependency deadlock in a scenario where hotplug of CPU is
being done while there is updation in cgroup and cpuset triggered from
userspace.

Process A => kthreadd => Process B => Process C => Process A

Process A
cpu_subsys_offline();
  cpu_down();
    _cpu_down();
      percpu_down_write(&cpu_hotplug_lock); //held
      cpuhp_invoke_callback();
	     workqueue_offline_cpu();
            queue_work_on(); // unbind_work on system_highpri_wq
               __queue_work();
                 insert_work();
                    wake_up_worker();
            flush_work();
               wait_for_completion();

worker_thread();
   manage_workers();
      create_worker();
	     kthread_create_on_node();
		    wake_up_process(kthreadd_task);

kthreadd
kthreadd();
  kernel_thread();
    do_fork();
      copy_process();
        percpu_down_read(&cgroup_threadgroup_rwsem);
          __rwsem_down_read_failed_common(); //waiting

Process B
kernfs_fop_write();
  cgroup_file_write();
    cgroup_procs_write();
      percpu_down_write(&cgroup_threadgroup_rwsem); //held
      cgroup_attach_task();
        cgroup_migrate();
          cgroup_migrate_execute();
            cpuset_can_attach();
              mutex_lock(&cpuset_mutex); //waiting

Process C
kernfs_fop_write();
  cgroup_file_write();
    cpuset_write_resmask();
      mutex_lock(&cpuset_mutex); //held
      update_cpumask();
        update_cpumasks_hier();
          rebuild_sched_domains_locked();
            get_online_cpus();
              percpu_down_read(&cpu_hotplug_lock); //waiting

Eliminating deadlock by reversing the locking order for cpuset_mutex and
cpu_hotplug_lock.

Signed-off-by: Prateek Sood <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Convert cpuset_hotplug_workfn() into synchronous call for cpu hotplug
path. For memory hotplug path it still gets queued as a work item.

Since cpuset_hotplug_workfn() can be made synchronous for cpu hotplug
path, it is not required to wait for cpuset hotplug while thawing
processes.

Signed-off-by: Prateek Sood <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
…rly()

This is needed in order to allow the unbound workqueue to take
housekeeping cpus into accounty

Signed-off-by: Tal Shorer <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Initialize wq_unbound_cpumask to exclude cpus that were isolated by
the cmdline's isolcpus parameter.

Signed-off-by: Tal Shorer <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Signed-off-by: Albert Pool <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
This macro `task_css_set` verifies that the caller is
inside proper critical section if the kernel set CONFIG_PROVE_RCU=y.

Signed-off-by: Wang Long <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Here, The function pdc_hardware_init always return zero. So it is not
necessary to check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Make these pdc2027x_*_timing structures const as it is never modified.

Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Commit 438a506 ("percpu: don't forget to free the temporary struct
pcpu_alloc_info") uncovered a problem on the CRIS architecture where
the bootmem allocator is initialized with virtual addresses. Given it
has:

    #define __va(x) ((void *)((unsigned long)(x) | 0x80000000))

then things just work out because the end result is the same whether you
give this a physical or a virtual address.

Untill you call memblock_free_early(__pa(address)) that is, because
values from __pa() don't match with the virtual addresses stuffed in the
bootmem allocator anymore.

Avoid freeing the temporary pcpu_alloc_info memory on that architecture
until they fix things up to let the kernel boot like it did before.

Signed-off-by: Nicolas Pitre <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Fixes: 438a506 ("percpu: don't forget to free the temporary struct pcpu_alloc_info")
Lockdep complains that the stats update is trying to register a non-static
key. This is because u64_stats are using a seqlock on 32bit arches, which
needs to be initialized before usage.

Fixes: 041cd64 (cgroup: Implement cgroup2 basic CPU usage accounting)
Signed-off-by: Lucas Stach <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
In rsa_get_n(), if the buffer contained all 0's and "FIPS mode" is
enabled, we would read one byte past the end of the buffer while
scanning the leading zeroes.  Fix it by checking 'n_sz' before '!*ptr'.

This bug was reachable by adding a specially crafted key of type
"asymmetric" (requires CONFIG_RSA and CONFIG_X509_CERTIFICATE_PARSER).

KASAN report:

    BUG: KASAN: slab-out-of-bounds in rsa_get_n+0x19e/0x1d0 crypto/rsa_helper.c:33
    Read of size 1 at addr ffff88003501a708 by task keyctl/196

    CPU: 1 PID: 196 Comm: keyctl Not tainted 4.14.0-09238-g1d3b78bbc6e9 #26
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-20171110_100015-anatol 04/01/2014
    Call Trace:
     rsa_get_n+0x19e/0x1d0 crypto/rsa_helper.c:33
     asn1_ber_decoder+0x82a/0x1fd0 lib/asn1_decoder.c:328
     rsa_set_pub_key+0xd3/0x320 crypto/rsa.c:278
     crypto_akcipher_set_pub_key ./include/crypto/akcipher.h:364 [inline]
     pkcs1pad_set_pub_key+0xae/0x200 crypto/rsa-pkcs1pad.c:117
     crypto_akcipher_set_pub_key ./include/crypto/akcipher.h:364 [inline]
     public_key_verify_signature+0x270/0x9d0 crypto/asymmetric_keys/public_key.c:106
     x509_check_for_self_signed+0x2ea/0x480 crypto/asymmetric_keys/x509_public_key.c:141
     x509_cert_parse+0x46a/0x620 crypto/asymmetric_keys/x509_cert_parser.c:129
     x509_key_preparse+0x61/0x750 crypto/asymmetric_keys/x509_public_key.c:174
     asymmetric_key_preparse+0xa4/0x150 crypto/asymmetric_keys/asymmetric_type.c:388
     key_create_or_update+0x4d4/0x10a0 security/keys/key.c:850
     SYSC_add_key security/keys/keyctl.c:122 [inline]
     SyS_add_key+0xe8/0x290 security/keys/keyctl.c:62
     entry_SYSCALL_64_fastpath+0x1f/0x96

    Allocated by task 196:
     __do_kmalloc mm/slab.c:3711 [inline]
     __kmalloc_track_caller+0x118/0x2e0 mm/slab.c:3726
     kmemdup+0x17/0x40 mm/util.c:118
     kmemdup ./include/linux/string.h:414 [inline]
     x509_cert_parse+0x2cb/0x620 crypto/asymmetric_keys/x509_cert_parser.c:106
     x509_key_preparse+0x61/0x750 crypto/asymmetric_keys/x509_public_key.c:174
     asymmetric_key_preparse+0xa4/0x150 crypto/asymmetric_keys/asymmetric_type.c:388
     key_create_or_update+0x4d4/0x10a0 security/keys/key.c:850
     SYSC_add_key security/keys/keyctl.c:122 [inline]
     SyS_add_key+0xe8/0x290 security/keys/keyctl.c:62
     entry_SYSCALL_64_fastpath+0x1f/0x96

Fixes: 5a7de97 ("crypto: rsa - return raw integers for the ASN.1 parser")
Cc: <[email protected]> # v4.8+
Cc: Tudor Ambarus <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: James Morris <[email protected]>
Reviewed-by: David Howells <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
In the AEAD interface for AF_ALG, the reference to the "null skcipher"
held by each tfm was being dropped in the wrong place -- when each
af_alg_ctx was freed instead of when the aead_tfm was freed.  As
discovered by syzkaller, a specially crafted program could use this to
cause the null skcipher to be freed while it is still in use.

Fix it by dropping the reference in the right place.

Fixes: 72548b0 ("crypto: algif_aead - copy AAD from src to dst")
Reported-by: syzbot <[email protected]>
Cc: <[email protected]> # v4.14+
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
 af_alg_free_areq_sgls()

If allocating the ->tsgl member of 'struct af_alg_async_req' failed,
during cleanup we dereferenced the NULL ->tsgl pointer in
af_alg_free_areq_sgls(), because ->tsgl_entries was nonzero.

Fix it by only freeing the ->tsgl list if it is non-NULL.

This affected both algif_skcipher and algif_aead.

Fixes: e870456 ("crypto: algif_skcipher - overhaul memory management")
Fixes: d887c52 ("crypto: algif_aead - overhaul memory management")
Reported-by: syzbot <[email protected]>
Cc: <[email protected]> # v4.14+
Signed-off-by: Eric Biggers <[email protected]>
Reviewed-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Because the HMAC template didn't check that its underlying hash
algorithm is unkeyed, trying to use "hmac(hmac(sha3-512-generic))"
through AF_ALG or through KEYCTL_DH_COMPUTE resulted in the inner HMAC
being used without having been keyed, resulting in sha3_update() being
called without sha3_init(), causing a stack buffer overflow.

This is a very old bug, but it seems to have only started causing real
problems when SHA-3 support was added (requires CONFIG_CRYPTO_SHA3)
because the innermost hash's state is ->import()ed from a zeroed buffer,
and it just so happens that other hash algorithms are fine with that,
but SHA-3 is not.  However, there could be arch or hardware-dependent
hash algorithms also affected; I couldn't test everything.

Fix the bug by introducing a function crypto_shash_alg_has_setkey()
which tests whether a shash algorithm is keyed.  Then update the HMAC
template to require that its underlying hash algorithm is unkeyed.

Here is a reproducer:

    #include <linux/if_alg.h>
    #include <sys/socket.h>

    int main()
    {
        int algfd;
        struct sockaddr_alg addr = {
            .salg_type = "hash",
            .salg_name = "hmac(hmac(sha3-512-generic))",
        };
        char key[4096] = { 0 };

        algfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
        bind(algfd, (const struct sockaddr *)&addr, sizeof(addr));
        setsockopt(algfd, SOL_ALG, ALG_SET_KEY, key, sizeof(key));
    }

Here was the KASAN report from syzbot:

    BUG: KASAN: stack-out-of-bounds in memcpy include/linux/string.h:341  [inline]
    BUG: KASAN: stack-out-of-bounds in sha3_update+0xdf/0x2e0  crypto/sha3_generic.c:161
    Write of size 4096 at addr ffff8801cca07c40 by task syzkaller076574/3044

    CPU: 1 PID: 3044 Comm: syzkaller076574 Not tainted 4.14.0-mm1+ #25
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  Google 01/01/2011
    Call Trace:
      __dump_stack lib/dump_stack.c:17 [inline]
      dump_stack+0x194/0x257 lib/dump_stack.c:53
      print_address_description+0x73/0x250 mm/kasan/report.c:252
      kasan_report_error mm/kasan/report.c:351 [inline]
      kasan_report+0x25b/0x340 mm/kasan/report.c:409
      check_memory_region_inline mm/kasan/kasan.c:260 [inline]
      check_memory_region+0x137/0x190 mm/kasan/kasan.c:267
      memcpy+0x37/0x50 mm/kasan/kasan.c:303
      memcpy include/linux/string.h:341 [inline]
      sha3_update+0xdf/0x2e0 crypto/sha3_generic.c:161
      crypto_shash_update+0xcb/0x220 crypto/shash.c:109
      shash_finup_unaligned+0x2a/0x60 crypto/shash.c:151
      crypto_shash_finup+0xc4/0x120 crypto/shash.c:165
      hmac_finup+0x182/0x330 crypto/hmac.c:152
      crypto_shash_finup+0xc4/0x120 crypto/shash.c:165
      shash_digest_unaligned+0x9e/0xd0 crypto/shash.c:172
      crypto_shash_digest+0xc4/0x120 crypto/shash.c:186
      hmac_setkey+0x36a/0x690 crypto/hmac.c:66
      crypto_shash_setkey+0xad/0x190 crypto/shash.c:64
      shash_async_setkey+0x47/0x60 crypto/shash.c:207
      crypto_ahash_setkey+0xaf/0x180 crypto/ahash.c:200
      hash_setkey+0x40/0x90 crypto/algif_hash.c:446
      alg_setkey crypto/af_alg.c:221 [inline]
      alg_setsockopt+0x2a1/0x350 crypto/af_alg.c:254
      SYSC_setsockopt net/socket.c:1851 [inline]
      SyS_setsockopt+0x189/0x360 net/socket.c:1830
      entry_SYSCALL_64_fastpath+0x1f/0x96

Reported-by: syzbot <[email protected]>
Cc: <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
When asked to encrypt or decrypt 0 bytes, both the generic and x86
implementations of Salsa20 crash in blkcipher_walk_done(), either when
doing 'kfree(walk->buffer)' or 'free_page((unsigned long)walk->page)',
because walk->buffer and walk->page have not been initialized.

The bug is that Salsa20 is calling blkcipher_walk_done() even when
nothing is in 'walk.nbytes'.  But blkcipher_walk_done() is only meant to
be called when a nonzero number of bytes have been provided.

The broken code is part of an optimization that tries to make only one
call to salsa20_encrypt_bytes() to process inputs that are not evenly
divisible by 64 bytes.  To fix the bug, just remove this "optimization"
and use the blkcipher_walk API the same way all the other users do.

Reproducer:

    #include <linux/if_alg.h>
    #include <sys/socket.h>
    #include <unistd.h>

    int main()
    {
            int algfd, reqfd;
            struct sockaddr_alg addr = {
                    .salg_type = "skcipher",
                    .salg_name = "salsa20",
            };
            char key[16] = { 0 };

            algfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
            bind(algfd, (void *)&addr, sizeof(addr));
            reqfd = accept(algfd, 0, 0);
            setsockopt(algfd, SOL_ALG, ALG_SET_KEY, key, sizeof(key));
            read(reqfd, key, sizeof(key));
    }

Reported-by: syzbot <[email protected]>
Fixes: eb6f13e ("[CRYPTO] salsa20_generic: Fix multi-page processing")
Cc: <[email protected]> # v2.6.25+
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
These PP2C and PP3C registers control the configuration of the PHY
control OOB timing for the COMINIT/COMWAKE parameters respectively
for sata port. Overwrite default values with calculated ones to get
better OOB timing.

Signed-off-by: Tang Yuantian <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
The driver name "ahci" is already used by the ahci platform driver.
This leads to the following error:
Error: Driver 'ahci' is already registered, aborting...

Change the name to ahci-mtk to fix this.

Signed-off-by: Matthias Brugger <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
…sstatus speed

During hotplug, it is possible for 6Gbps link speed to be limited all
the way down to 1.5 Gbps which may lead to a slower link speed when
drive is re-connected.

This behavior has been seen on a Intel Lewisburg SATA controller
(8086:a1d2) with HGST HUH728080ALE600 drive where SATA link speed was
limited to 1.5 Gbps and when re-connected the link came up 3.0 Gbps.

This patch was retested on above configuration and showed the
hotplugged link to come back online at max speed (6Gbps). I did not
see the downgrade when testing on Intel C600/X79, but retested patched
linux-4.14-rc5 kernel and didn't see any side effects from this
change. Also, successfully retested hotplug on port multiplier 3Gbps
link.

tj: Minor comment updates.

Signed-off-by: David Milburn <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
This reverts commit 1599a18.

This and the previous commit led to another circular locking scenario
and the scenario which is fixed by this commit no longer exists after
e8b3f8d ("workqueue/hotplug: simplify workqueue_offline_cpu()")
which removes work item flushing from hotplug path.

Revert it for now.

Signed-off-by: Tejun Heo <[email protected]>
Since the recent cpu/hotplug refactoring, workqueue_offline_cpu() is
guaranteed to run on the local cpu which is going offline.

This also fixes the following deadlock by removing work item
scheduling and flushing from CPU hotplug path.

 http://lkml.kernel.org/r/[email protected]

tj: Description update.

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Since the cpu/hotplug refactoring, DOWN_FAILED is never called without
preceding DOWN_PREPARE making the workaround unnecessary.  Remove it.

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
This reverts commit aa24163.

This and the following commit led to another circular locking scenario
and the scenario which is fixed by this commit no longer exists after
e8b3f8d ("workqueue/hotplug: simplify workqueue_offline_cpu()")
which removes work item flushing from hotplug path.

Revert it for now.

Signed-off-by: Tejun Heo <[email protected]>
We haven't yet figured out what to do with RT threads on cgroup2.
Document the limitation.

v2: Included the warning about system management software behavior as
    suggested by Michael.

Signed-off-by: Tejun Heo <[email protected]>
Reported-by: "Michael Kerrisk (man-pages)" <[email protected]>
System may crash after unloading ipmi_si.ko module
because a timer may remain and fire after the module cleaned up resources.

cleanup_one_si() contains the following processing.

        /*
         * Make sure that interrupts, the timer and the thread are
         * stopped and will not run again.
         */
        if (to_clean->irq_cleanup)
                to_clean->irq_cleanup(to_clean);
        wait_for_timer_and_thread(to_clean);

        /*
         * Timeouts are stopped, now make sure the interrupts are off
         * in the BMC.  Note that timers and CPU interrupts are off,
         * so no need for locks.
         */
        while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) {
                poll(to_clean);
                schedule_timeout_uninterruptible(1);
        }

si_state changes as following in the while loop calling poll(to_clean).

  SI_GETTING_MESSAGES
    => SI_CHECKING_ENABLES
     => SI_SETTING_ENABLES
      => SI_GETTING_EVENTS
       => SI_NORMAL

As written in the code comments above,
timers are expected to stop before the polling loop and not to run again.
But the timer is set again in the following process
when si_state becomes SI_SETTING_ENABLES.

  => poll
     => smi_event_handler
       => handle_transaction_done
          // smi_info->si_state == SI_SETTING_ENABLES
         => start_getting_events
           => start_new_msg
            => smi_mod_timer
              => mod_timer

As a result, before the timer set in start_new_msg() expires,
the polling loop may see si_state becoming SI_NORMAL
and the module clean-up finishes.

For example, hard LOCKUP and panic occurred as following.
smi_timeout was called after smi_event_handler,
kcs_event and hangs at port_inb()
trying to access I/O port after release.

    [exception RIP: port_inb+19]
    RIP: ffffffffc0473053  RSP: ffff88069fdc3d80  RFLAGS: 00000006
    RAX: ffff8806800f8e00  RBX: ffff880682bd9400  RCX: 0000000000000000
    RDX: 0000000000000ca3  RSI: 0000000000000ca3  RDI: ffff8806800f8e40
    RBP: ffff88069fdc3d80   R8: ffffffff81d86dfc   R9: ffffffff81e36426
    R10: 00000000000509f0  R11: 0000000000100000  R12: 0000000000]:000000
    R13: 0000000000000000  R14: 0000000000000246  R15: ffff8806800f8e00
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0000
 --- <NMI exception stack> ---

To fix the problem I defined a flag, timer_can_start,
as member of struct smi_info.
The flag is enabled immediately after initializing the timer
and disabled immediately before waiting for timer deletion.

Fixes: 0cfec91 ("ipmi: Start the timer and thread on internal msgs")
Signed-off-by: Yamazaki Masamitsu <[email protected]>
[Adjusted for recent changes in the driver.]
Signed-off-by: Corey Minyard <[email protected]>
When the IPMI PCI code was split out, some code was consolidated for
setting the io_setup field in the io structure.  The PCI code needed
this set before registration to probe register spacing, though, so
restore the old code for that function.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197999
Signed-off-by: Corey Minyard <[email protected]>
Tested-by: Meelis Roos <[email protected]>
This patch fixes ipmi crash on parisc introduced in the kernel 4.15-rc.
The pointer io.io_setup is not initialized and thus it causes crash in
try_smi_init when attempting to call new_smi->io.io_setup.

Signed-off-by: Mikulas Patocka <[email protected]>
Signed-off-by: Corey Minyard <[email protected]>
The filw was converted from print_symbol() to %pf some time
ago (044c782 "workqueue: fix checkpatch issues").
kallsyms does not seem to be needed anymore.

Signed-off-by: Sergey Senozhatsky <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
…/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This push fixes the following issues:

   - buffer overread in RSA

   - potential use after free in algif_aead.

   - error path null pointer dereference in af_alg

   - forbid combinations such as hmac(hmac(sha3)) which may crash

   - crash in salsa20 due to incorrect API usage"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: salsa20 - fix blkcipher_walk API usage
  crypto: hmac - require that the underlying hash algorithm is unkeyed
  crypto: af_alg - fix NULL pointer dereference in
  crypto: algif_aead - fix reference counting of null skcipher
  crypto: rsa - fix buffer overread when stripping leading zeroes
Pull IPMI fixes from Corey Minyard.

* tag 'for-linus-4.15-2' of git://github.com/cminyard/linux-ipmi:
  ipmi_si: fix crash on parisc
  ipmi_si: Fix oops with PCI devices
  ipmi: Stop timers before cleaning up the module
…ernel/git/tj/libata

Pull libata fixes from Tejun Heo:
 "Nothing too interesting. David Milburn improved a corner case
  misbehavior during hotplug. Other than that, minor driver-specific
  fixes"

* 'for-4.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  libata: sata_down_spd_limit should return if driver has not recorded sstatus speed
  ahci: mtk: Change driver name to ahci-mtk
  ahci: qoriq: refine port register configuration
  pata_pdc2027x : make pdc2027x_*_timing structures const
  pata_pdc2027x: Remove unnecessary error check
  ata: mediatek: Fix typo in module description
frank-w added a commit that referenced this pull request Oct 21, 2025
as i only have older firmware yet atm, i reduced the mdio speed to default
and changed the phy modes to usxgmii.

$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Wed Oct 15 19:20:01 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    3.375859] Aeonsemi AS21xxx mdio-bus:18: DEBUG as21xxx_probe:787
[    4.975260] Aeonsemi AS21xxx mdio-bus:18: Firmware Version: 1.8.2
[    5.545842] Aeonsemi AS21xxx mdio-bus:1c: DEBUG as21xxx_probe:787
[    7.140091] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.2
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f83e39300): 0x11100000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7f953db000): 0x28
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7f9a2ec100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip link set eth1 up
[   78.825998] Aeonsemi AS21xxx mdio-bus:1c: aeon_ipc_send_cmd fail to polling status failed: -110
[   78.834776] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version:
[   78.855684] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   78.872839] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   78.880688] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband

[  133.365631] rcu: INFO: rcu_sched self-detected stall on CPU
[  133.371211] rcu:     0-....: (5999 ticks this GP) idle=5494/1/0x4000000000000000 softirq=1546/1546 fqs=3000
[  133.380680] rcu:     (t=6000 jiffies g=1189 q=19 ncpus=4)
[  133.385810] CPU: 0 UID: 0 PID: 3415 Comm: ip Not tainted 6.18.0-rc1-bpi-r4 #1 NONE
[  133.385817] Hardware name: Bananapi BPI-R4 (DT)
[  133.385819] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  133.385824] pc : phylink_start+0xac/0x248
[  133.385836] lr : phylink_start+0x8c/0x248
[  133.385840] sp : ffffffc0885f34b0
[  133.385842] x29: ffffffc0885f34b0 x28: ffffff80c00e1080 x27: ffffffc080fb7268
[  133.385849] x26: ffffff80c24f2000 x25: ffffffc080fb62b8 x24: 0000000000000001
[  133.385854] x23: 0000000000001002 x22: ffffff80c24f2a00 x21: ffffff80c24f2000
[  133.385860] x20: 0000000000000000 x19: ffffff80c109b800 x18: 00000000000030b0
[  133.385865] x17: 0000000000003040 x16: 0000000000005078 x15: 0000000000003048
[  133.385869] x14: ffffff80c19241c0 x13: 0000000001e3ac80 x12: 0000000000000000
[  133.385874] x11: 00000000000000c0 x10: 0000000000000980 x9 : ffffffc0885f3110
[  133.385879] x8 : ffffff80c1924ae0 x7 : ffffff80ff754d00 x6 : 00000001308de816
[  133.385884] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
[  133.385889] x2 : ffffff80c23236b8 x1 : ffffff80c2323698 x0 : ffffff80c109b8a0
[  133.385894] Call trace:
[  133.385896]  phylink_start+0xac/0x248 (P)
[  133.385903]  mtk_open+0x45c/0xb24
[  133.385908]  __dev_open+0x110/0x228
[  133.385915]  __dev_change_flags+0x1e8/0x240
[  133.385919]  netif_change_flags+0x24/0x6c
[  133.385924]  do_setlink.isra.0+0xb50/0xe4c
[  133.385930]  rtnl_newlink+0x684/0x968
[  133.385934]  rtnetlink_rcv_msg+0x1ec/0x378
[  133.385939]  netlink_rcv_skb+0x60/0x130
[  133.385944]  rtnetlink_rcv+0x18/0x24
[  133.385949]  netlink_unicast+0x300/0x374
[  133.385952]  netlink_sendmsg+0x180/0x3b8
[  133.385956]  ____sys_sendmsg+0x110/0x2c4
[  133.385961]  ___sys_sendmsg+0x84/0xe4
[  133.385967]  __sys_sendmsg+0x84/0xf4
[  133.385971]  __arm64_sys_sendmsg+0x24/0x30
[  133.385975]  invoke_syscall+0x48/0x10c
[  133.385981]  el0_svc_common.constprop.0+0x40/0xe0
[  133.385984]  do_el0_svc+0x1c/0x28
[  133.385988]  el0_svc+0x34/0xec
[  133.385992]  el0t_64_sync_handler+0xa0/0xe4
[  133.385996]  el0t_64_sync+0x19c/0x1a0
frank-w added a commit that referenced this pull request Oct 21, 2025
also the pcs error, but no rcu stall :)

root@bpi-r4-pro:~
$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Thu Oct 16 07:26:21 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    5.257960] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f9708e300): 0x11101000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7fb56b7000): 0x20
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7fa9635100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip a a 192.168.0.19/24 dev eth1
root@bpi-r4-pro:~
$ ip l s eth1 up
[   91.444062] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
[   91.465333] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   91.482555] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   91.490439] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband
frank-w added a commit that referenced this pull request Oct 23, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 23, 2025
also the pcs error, but no rcu stall :)

root@bpi-r4-pro:~
$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Thu Oct 16 07:26:21 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    5.257960] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f9708e300): 0x11101000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7fb56b7000): 0x20
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7fa9635100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip a a 192.168.0.19/24 dev eth1
root@bpi-r4-pro:~
$ ip l s eth1 up
[   91.444062] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
[   91.465333] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   91.482555] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   91.490439] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband
frank-w added a commit that referenced this pull request Oct 23, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 23, 2025
also the pcs error, but no rcu stall :)

root@bpi-r4-pro:~
$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Thu Oct 16 07:26:21 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    5.257960] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f9708e300): 0x11101000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7fb56b7000): 0x20
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7fa9635100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip a a 192.168.0.19/24 dev eth1
root@bpi-r4-pro:~
$ ip l s eth1 up
[   91.444062] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
[   91.465333] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   91.482555] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   91.490439] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband
frank-w added a commit that referenced this pull request Oct 23, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 23, 2025
also the pcs error, but no rcu stall :)

root@bpi-r4-pro:~
$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Thu Oct 16 07:26:21 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    5.257960] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f9708e300): 0x11101000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7fb56b7000): 0x20
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7fa9635100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip a a 192.168.0.19/24 dev eth1
root@bpi-r4-pro:~
$ ip l s eth1 up
[   91.444062] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
[   91.465333] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   91.482555] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   91.490439] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband
frank-w added a commit that referenced this pull request Oct 23, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 23, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 26, 2025
also the pcs error, but no rcu stall :)

root@bpi-r4-pro:~
$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Thu Oct 16 07:26:21 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    5.257960] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f9708e300): 0x11101000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7fb56b7000): 0x20
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7fa9635100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip a a 192.168.0.19/24 dev eth1
root@bpi-r4-pro:~
$ ip l s eth1 up
[   91.444062] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
[   91.465333] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   91.482555] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   91.490439] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband
frank-w added a commit that referenced this pull request Oct 26, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 26, 2025
also the pcs error, but no rcu stall :)

root@bpi-r4-pro:~
$ uname -a
Linux bpi-r4-pro 6.18.0-rc1-bpi-r4 #1 SMP Thu Oct 16 07:26:21 CEST 2025 aarch64 GNU/Linux
root@bpi-r4-pro:~
$ dmesg | grep -i aeon
[    5.257960] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
root@bpi-r4-pro:~
$ ./regs m 0x1001F300 0x0 12 3
Value at 0x1001F300 (0x7f9708e300): 0x11101000
Modify 0x0[14:12]; Readback 0x11100000
root@bpi-r4-pro:~
$ ./regs m 0x1001F000 0x1 3 1
Value at 0x1001F000 (0x7fb56b7000): 0x20
Modify 0x1[3:3]; Readback 0x28
root@bpi-r4-pro:~
$ ./regs m 0x1001F100 0x0 3 1
Value at 0x1001F100 (0x7fa9635100): 0x20
Modify 0x0[3:3]; Readback 0x20
root@bpi-r4-pro:~
$ ip a a 192.168.0.19/24 dev eth1
root@bpi-r4-pro:~
$ ip l s eth1 up
[   91.444062] Aeonsemi AS21xxx mdio-bus:1c: Firmware Version: 1.8.5
[   91.465333] mtk_soc_eth 15100000.ethernet eth1: PHY [mdio-bus:1c] driver [Aeonsemi AS21xxx] (irq=POLL)
[   91.482555] mtk_soc_eth 15100000.ethernet eth1: configuring for phy/usxgmii link mode
[   91.490439] mtk_soc_eth 15100000.ethernet eth1: firmware wants phy mode, but PCS requires inband
frank-w added a commit that referenced this pull request Oct 26, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 26, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 26, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 27, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Oct 27, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w pushed a commit that referenced this pull request Oct 28, 2025
[ Upstream commit 48918ca ]

The test starts a workload and then opens events. If the events fail
to open, for example because of perf_event_paranoid, the gopipe of the
workload is leaked and the file descriptor leak check fails when the
test exits. To avoid this cancel the workload when opening the events
fails.

Before:
```
$ perf test -vv 7
  7: PERF_RECORD_* events & perf_sample fields:
 --- start ---
test child forked, pid 1189568
Using CPUID GenuineIntel-6-B7-1
 ------------------------------------------------------------
perf_event_attr:
  type                    	   0 (PERF_TYPE_HARDWARE)
  config                  	   0xa00000000 (cpu_atom/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                	   1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8
sys_perf_event_open failed, error -13
 ------------------------------------------------------------
perf_event_attr:
  type                             0 (PERF_TYPE_HARDWARE)
  config                           0xa00000000 (cpu_atom/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                         1
  exclude_kernel                   1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 3
 ------------------------------------------------------------
perf_event_attr:
  type                             0 (PERF_TYPE_HARDWARE)
  config                           0x400000000 (cpu_core/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                         1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8
sys_perf_event_open failed, error -13
 ------------------------------------------------------------
perf_event_attr:
  type                             0 (PERF_TYPE_HARDWARE)
  config                           0x400000000 (cpu_core/PERF_COUNT_HW_CPU_CYCLES/)
  disabled                         1
  exclude_kernel                   1
 ------------------------------------------------------------
sys_perf_event_open: pid 0  cpu -1  group_fd -1  flags 0x8 = 3
Attempt to add: software/cpu-clock/
..after resolving event: software/config=0/
cpu-clock -> software/cpu-clock/
 ------------------------------------------------------------
perf_event_attr:
  type                             1 (PERF_TYPE_SOFTWARE)
  size                             136
  config                           0x9 (PERF_COUNT_SW_DUMMY)
  sample_type                      IP|TID|TIME|CPU
  read_format                      ID|LOST
  disabled                         1
  inherit                          1
  mmap                             1
  comm                             1
  enable_on_exec                   1
  task                             1
  sample_id_all                    1
  mmap2                            1
  comm_exec                        1
  ksymbol                          1
  bpf_event                        1
  { wakeup_events, wakeup_watermark } 1
 ------------------------------------------------------------
sys_perf_event_open: pid 1189569  cpu 0  group_fd -1  flags 0x8
sys_perf_event_open failed, error -13
perf_evlist__open: Permission denied
 ---- end(-2) ----
Leak of file descriptor 6 that opened: 'pipe:[14200347]'
 ---- unexpected signal (6) ----
iFailed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
Failed to read build ID for //anon
    #0 0x565358f6666e in child_test_sig_handler builtin-test.c:311
    #1 0x7f29ce849df0 in __restore_rt libc_sigaction.c:0
    #2 0x7f29ce89e95c in __pthread_kill_implementation pthread_kill.c:44
    #3 0x7f29ce849cc2 in raise raise.c:27
    #4 0x7f29ce8324ac in abort abort.c:81
    #5 0x565358f662d4 in check_leaks builtin-test.c:226
    #6 0x565358f6682e in run_test_child builtin-test.c:344
    #7 0x565358ef7121 in start_command run-command.c:128
    #8 0x565358f67273 in start_test builtin-test.c:545
    #9 0x565358f6771d in __cmd_test builtin-test.c:647
    #10 0x565358f682bd in cmd_test builtin-test.c:849
    #11 0x565358ee5ded in run_builtin perf.c:349
    #12 0x565358ee6085 in handle_internal_command perf.c:401
    #13 0x565358ee61de in run_argv perf.c:448
    #14 0x565358ee6527 in main perf.c:555
    #15 0x7f29ce833ca8 in __libc_start_call_main libc_start_call_main.h:74
    #16 0x7f29ce833d65 in __libc_start_main@@GLIBC_2.34 libc-start.c:128
    #17 0x565358e391c1 in _start perf[851c1]
  7: PERF_RECORD_* events & perf_sample fields                       : FAILED!
```

After:
```
$ perf test 7
  7: PERF_RECORD_* events & perf_sample fields                       : Skip (permissions)
```

Fixes: 16d00fe ("perf tests: Move test__PERF_RECORD into separate object")
Signed-off-by: Ian Rogers <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Athira Rajeev <[email protected]>
Cc: Chun-Tse Shao <[email protected]>
Cc: Howard Chu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Clark <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
frank-w pushed a commit that referenced this pull request Oct 28, 2025
[ Upstream commit 3f39f56 ]

pm_runtime_get_sync() and pm_runtime_put_autosuspend() were previously
called in cmdq_mbox_send_data(), which is under a spinlock in msg_submit()
(mailbox.c). This caused lockdep warnings such as "sleeping function
called from invalid context" when running with lockdebug enabled.

The BUG report:
  BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1164
  in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 3616, name: kworker/u17:3
    preempt_count: 1, expected: 0
    RCU nest depth: 0, expected: 0
    INFO: lockdep is turned off.
    irq event stamp: 0
    CPU: 1 PID: 3616 Comm: kworker/u17:3 Not tainted 6.1.87-lockdep-14133-g26e933aca785 #1
    Hardware name: Google Ciri sku0/unprovisioned board (DT)
    Workqueue: imgsys_runner imgsys_runner_func
    Call trace:
     dump_backtrace+0x100/0x120
     show_stack+0x20/0x2c
     dump_stack_lvl+0x84/0xb4
     dump_stack+0x18/0x48
     __might_resched+0x354/0x4c0
     __might_sleep+0x98/0xe4
     __pm_runtime_resume+0x70/0x124
     cmdq_mbox_send_data+0xe4/0xb1c
     msg_submit+0x194/0x2dc
     mbox_send_message+0x190/0x330
     imgsys_cmdq_sendtask+0x1618/0x2224
     imgsys_runner_func+0xac/0x11c
     process_one_work+0x638/0xf84
     worker_thread+0x808/0xcd0
     kthread+0x24c/0x324
     ret_from_fork+0x10/0x20

Additionally, pm_runtime_put_autosuspend() should be invoked from the
GCE IRQ handler to ensure the hardware has actually completed its work.

To resolve these issues, remove the pm_runtime calls from
cmdq_mbox_send_data() and delegate power management responsibilities
to the client driver.

Fixes: 8afe816 ("mailbox: mtk-cmdq-mailbox: Implement Runtime PM with autosuspend")
Signed-off-by: Jason-JH Lin <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
frank-w pushed a commit that referenced this pull request Oct 28, 2025
[ Upstream commit bbf0c98 ]

net/bridge/br_private.h:1627 suspicious rcu_dereference_protected() usage!
other info that might help us debug this:

rcu_scheduler_active = 2, debug_locks = 1
7 locks held by socat/410:
 #0: ffff88800d7a9c90 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_stream_connect+0x43/0xa0
 #1: ffffffff9a779900 (rcu_read_lock){....}-{1:3}, at: __ip_queue_xmit+0x62/0x1830
 [..]
 #6: ffffffff9a779900 (rcu_read_lock){....}-{1:3}, at: nf_hook.constprop.0+0x8a/0x440

Call Trace:
 lockdep_rcu_suspicious.cold+0x4f/0xb1
 br_vlan_fill_forward_path_pvid+0x32c/0x410 [bridge]
 br_fill_forward_path+0x7a/0x4d0 [bridge]

Use to correct helper, non _rcu variant requires RTNL mutex.

Fixes: bcf2766 ("net: bridge: resolve forwarding path for VLAN tag actions in bridge devices")
Signed-off-by: Eric Woudstra <[email protected]>
Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
frank-w pushed a commit that referenced this pull request Oct 28, 2025
commit 0570327 upstream.

Before disabling SR-IOV via config space accesses to the parent PF,
sriov_disable() first removes the PCI devices representing the VFs.

Since commit 9d16947 ("PCI: Add global pci_lock_rescan_remove()")
such removal operations are serialized against concurrent remove and
rescan using the pci_rescan_remove_lock. No such locking was ever added
in sriov_disable() however. In particular when commit 18f9e9d
("PCI/IOV: Factor out sriov_add_vfs()") factored out the PCI device
removal into sriov_del_vfs() there was still no locking around the
pci_iov_remove_virtfn() calls.

On s390 the lack of serialization in sriov_disable() may cause double
remove and list corruption with the below (amended) trace being observed:

  PSW:  0704c00180000000 0000000c914e4b38 (klist_put+56)
  GPRS: 000003800313fb48 0000000000000000 0000000100000001 0000000000000001
	00000000f9b520a8 0000000000000000 0000000000002fbd 00000000f4cc9480
	0000000000000001 0000000000000000 0000000000000000 0000000180692828
	00000000818e8000 000003800313fe2c 000003800313fb20 000003800313fad8
  #0 [3800313fb20] device_del at c9158ad5c
  #1 [3800313fb88] pci_remove_bus_device at c915105ba
  #2 [3800313fbd0] pci_iov_remove_virtfn at c9152f198
  #3 [3800313fc28] zpci_iov_remove_virtfn at c90fb67c0
  #4 [3800313fc60] zpci_bus_remove_device at c90fb6104
  #5 [3800313fca0] __zpci_event_availability at c90fb3dca
  #6 [3800313fd08] chsc_process_sei_nt0 at c918fe4a2
  #7 [3800313fd60] crw_collect_info at c91905822
  #8 [3800313fe10] kthread at c90feb390
  #9 [3800313fe68] __ret_from_fork at c90f6aa64
  #10 [3800313fe98] ret_from_fork at c9194f3f2.

This is because in addition to sriov_disable() removing the VFs, the
platform also generates hot-unplug events for the VFs. This being the
reverse operation to the hotplug events generated by sriov_enable() and
handled via pdev->no_vf_scan. And while the event processing takes
pci_rescan_remove_lock and checks whether the struct pci_dev still exists,
the lack of synchronization makes this checking racy.

Other races may also be possible of course though given that this lack of
locking persisted so long observable races seem very rare. Even on s390 the
list corruption was only observed with certain devices since the platform
events are only triggered by config accesses after the removal, so as long
as the removal finished synchronously they would not race. Either way the
locking is missing so fix this by adding it to the sriov_del_vfs() helper.

Just like PCI rescan-remove, locking is also missing in sriov_add_vfs()
including for the error case where pci_stop_and_remove_bus_device() is
called without the PCI rescan-remove lock being held. Even in the non-error
case, adding new PCI devices and buses should be serialized via the PCI
rescan-remove lock. Add the necessary locking.

Fixes: 18f9e9d ("PCI/IOV: Factor out sriov_add_vfs()")
Signed-off-by: Niklas Schnelle <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Benjamin Block <[email protected]>
Reviewed-by: Farhan Ali <[email protected]>
Reviewed-by: Julian Ruess <[email protected]>
Cc: [email protected]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
frank-w pushed a commit that referenced this pull request Oct 28, 2025
[ Upstream commit 399dbca ]

There is no synchronization between different code paths in the ACPI
battery driver that update its sysfs interface or its power supply
class device interface.  In some cases this results to functional
failures due to race conditions.

One example of this is when two ACPI notifications:

  - ACPI_BATTERY_NOTIFY_STATUS (0x80)
  - ACPI_BATTERY_NOTIFY_INFO   (0x81)

are triggered (by the platform firmware) in a row with a little delay
in between after removing and reinserting a laptop battery.  Both
notifications cause acpi_battery_update() to be called and if the delay
between them is sufficiently small, sysfs_add_battery() can be re-entered
before battery->bat is set which leads to a duplicate sysfs entry error:

 sysfs: cannot create duplicate filename '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT1'
 CPU: 1 UID: 0 PID: 185 Comm: kworker/1:4 Kdump: loaded Not tainted 6.12.38+deb13-amd64 #1  Debian 6.12.38-1
 Hardware name: Gateway          NV44             /SJV40-MV        , BIOS V1.3121 04/08/2009
 Workqueue: kacpi_notify acpi_os_execute_deferred
 Call Trace:
  <TASK>
  dump_stack_lvl+0x5d/0x80
  sysfs_warn_dup.cold+0x17/0x23
  sysfs_create_dir_ns+0xce/0xe0
  kobject_add_internal+0xba/0x250
  kobject_add+0x96/0xc0
  ? get_device_parent+0xde/0x1e0
  device_add+0xe2/0x870
  __power_supply_register.part.0+0x20f/0x3f0
  ? wake_up_q+0x4e/0x90
  sysfs_add_battery+0xa4/0x1d0 [battery]
  acpi_battery_update+0x19e/0x290 [battery]
  acpi_battery_notify+0x50/0x120 [battery]
  acpi_ev_notify_dispatch+0x49/0x70
  acpi_os_execute_deferred+0x1a/0x30
  process_one_work+0x177/0x330
  worker_thread+0x251/0x390
  ? __pfx_worker_thread+0x10/0x10
  kthread+0xd2/0x100
  ? __pfx_kthread+0x10/0x10
  ret_from_fork+0x34/0x50
  ? __pfx_kthread+0x10/0x10
  ret_from_fork_asm+0x1a/0x30
  </TASK>
 kobject: kobject_add_internal failed for BAT1 with -EEXIST, don't try to register things with the same name in the same directory.

There are also other scenarios in which analogous issues may occur.

Address this by using a common lock in all of the code paths leading
to updates of driver interfaces: ACPI Notify () handler, system resume
callback and post-resume notification, device addition and removal.

This new lock replaces sysfs_lock that has been used only in
sysfs_remove_battery() which now is going to be always called under
the new lock, so it doesn't need any internal locking any more.

Fixes: 1066625 ("ACPI: battery: Install Notify() handler directly")
Closes: https://lore.kernel.org/linux-acpi/[email protected]/
Reported-by: GuangFei Luo <[email protected]>
Tested-by: GuangFei Luo <[email protected]>
Cc: 6.6+ <[email protected]> # 6.6+
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
frank-w pushed a commit that referenced this pull request Oct 28, 2025
…ce tree

commit a5a51bf4e9b7354ce7cd697e610d72c1b33fd949 upstream.

Currently, when building a free space tree at populate_free_space_tree(),
if we are not using the block group tree feature, we always expect to find
block group items (either extent items or a block group item with key type
BTRFS_BLOCK_GROUP_ITEM_KEY) when we search the extent tree with
btrfs_search_slot_for_read(), so we assert that we found an item. However
this expectation is wrong since we can have a new block group created in
the current transaction which is still empty and for which we still have
not added the block group's item to the extent tree, in which case we do
not have any items in the extent tree associated to the block group.

The insertion of a new block group's block group item in the extent tree
happens at btrfs_create_pending_block_groups() when it calls the helper
insert_block_group_item(). This typically is done when a transaction
handle is released, committed or when running delayed refs (either as
part of a transaction commit or when serving tickets for space reservation
if we are low on free space).

So remove the assertion at populate_free_space_tree() even when the block
group tree feature is not enabled and update the comment to mention this
case.

Syzbot reported this with the following stack trace:

  BTRFS info (device loop3 state M): rebuilding free space tree
  assertion failed: ret == 0 :: 0, in fs/btrfs/free-space-tree.c:1115
  ------------[ cut here ]------------
  kernel BUG at fs/btrfs/free-space-tree.c:1115!
  Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
  CPU: 1 UID: 0 PID: 6352 Comm: syz.3.25 Not tainted syzkaller #0 PREEMPT(full)
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
  RIP: 0010:populate_free_space_tree+0x700/0x710 fs/btrfs/free-space-tree.c:1115
  Code: ff ff e8 d3 (...)
  RSP: 0018:ffffc9000430f780 EFLAGS: 00010246
  RAX: 0000000000000043 RBX: ffff88805b709630 RCX: fea61d0e2e79d000
  RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
  RBP: ffffc9000430f8b0 R08: ffffc9000430f4a7 R09: 1ffff92000861e94
  R10: dffffc0000000000 R11: fffff52000861e95 R12: 0000000000000001
  R13: 1ffff92000861f00 R14: dffffc0000000000 R15: 0000000000000000
  FS:  00007f424d9fe6c0(0000) GS:ffff888125afc000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007fd78ad212c0 CR3: 0000000076d68000 CR4: 00000000003526f0
  Call Trace:
   <TASK>
   btrfs_rebuild_free_space_tree+0x1ba/0x6d0 fs/btrfs/free-space-tree.c:1364
   btrfs_start_pre_rw_mount+0x128f/0x1bf0 fs/btrfs/disk-io.c:3062
   btrfs_remount_rw fs/btrfs/super.c:1334 [inline]
   btrfs_reconfigure+0xaed/0x2160 fs/btrfs/super.c:1559
   reconfigure_super+0x227/0x890 fs/super.c:1076
   do_remount fs/namespace.c:3279 [inline]
   path_mount+0xd1a/0xfe0 fs/namespace.c:4027
   do_mount fs/namespace.c:4048 [inline]
   __do_sys_mount fs/namespace.c:4236 [inline]
   __se_sys_mount+0x313/0x410 fs/namespace.c:4213
   do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
   do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   RIP: 0033:0x7f424e39066a
  Code: d8 64 89 02 (...)
  RSP: 002b:00007f424d9fde68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
  RAX: ffffffffffffffda RBX: 00007f424d9fdef0 RCX: 00007f424e39066a
  RDX: 0000200000000180 RSI: 0000200000000380 RDI: 0000000000000000
  RBP: 0000200000000180 R08: 00007f424d9fdef0 R09: 0000000000000020
  R10: 0000000000000020 R11: 0000000000000246 R12: 0000200000000380
  R13: 00007f424d9fdeb0 R14: 0000000000000000 R15: 00002000000002c0
   </TASK>
  Modules linked in:
  ---[ end trace 0000000000000000 ]---

Reported-by: [email protected]
Link: https://lore.kernel.org/linux-btrfs/[email protected]/
Fixes: a5ed918 ("Btrfs: implement the free space B-tree")
CC: <[email protected]> # 6.1.x: 1961d20: btrfs: fix assertion when building free space tree
CC: <[email protected]> # 6.1.x
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
frank-w pushed a commit that referenced this pull request Oct 28, 2025
commit f04aad3 upstream.

syzkaller discovered the following crash: (kernel BUG)

[   44.607039] ------------[ cut here ]------------
[   44.607422] kernel BUG at mm/userfaultfd.c:2067!
[   44.608148] Oops: invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN NOPTI
[   44.608814] CPU: 1 UID: 0 PID: 2475 Comm: reproducer Not tainted 6.16.0-rc6 #1 PREEMPT(none)
[   44.609635] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
[   44.610695] RIP: 0010:userfaultfd_release_all+0x3a8/0x460

<snip other registers, drop unreliable trace>

[   44.617726] Call Trace:
[   44.617926]  <TASK>
[   44.619284]  userfaultfd_release+0xef/0x1b0
[   44.620976]  __fput+0x3f9/0xb60
[   44.621240]  fput_close_sync+0x110/0x210
[   44.622222]  __x64_sys_close+0x8f/0x120
[   44.622530]  do_syscall_64+0x5b/0x2f0
[   44.622840]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   44.623244] RIP: 0033:0x7f365bb3f227

Kernel panics because it detects UFFD inconsistency during
userfaultfd_release_all().  Specifically, a VMA which has a valid pointer
to vma->vm_userfaultfd_ctx, but no UFFD flags in vma->vm_flags.

The inconsistency is caused in ksm_madvise(): when user calls madvise()
with MADV_UNMEARGEABLE on a VMA that is registered for UFFD in MINOR mode,
it accidentally clears all flags stored in the upper 32 bits of
vma->vm_flags.

Assuming x86_64 kernel build, unsigned long is 64-bit and unsigned int and
int are 32-bit wide.  This setup causes the following mishap during the &=
~VM_MERGEABLE assignment.

VM_MERGEABLE is a 32-bit constant of type unsigned int, 0x8000'0000.
After ~ is applied, it becomes 0x7fff'ffff unsigned int, which is then
promoted to unsigned long before the & operation.  This promotion fills
upper 32 bits with leading 0s, as we're doing unsigned conversion (and
even for a signed conversion, this wouldn't help as the leading bit is 0).
& operation thus ends up AND-ing vm_flags with 0x0000'0000'7fff'ffff
instead of intended 0xffff'ffff'7fff'ffff and hence accidentally clears
the upper 32-bits of its value.

Fix it by changing `VM_MERGEABLE` constant to unsigned long, using the
BIT() macro.

Note: other VM_* flags are not affected: This only happens to the
VM_MERGEABLE flag, as the other VM_* flags are all constants of type int
and after ~ operation, they end up with leading 1 and are thus converted
to unsigned long with leading 1s.

Note 2:
After commit 31defc3 ("userfaultfd: remove (VM_)BUG_ON()s"), this is
no longer a kernel BUG, but a WARNING at the same place:

[   45.595973] WARNING: CPU: 1 PID: 2474 at mm/userfaultfd.c:2067

but the root-cause (flag-drop) remains the same.

[[email protected]: rust bindgen wasn't able to handle BIT(), from Miguel]
  Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 7677f7f ("userfaultfd: add minor fault registration mode")
Signed-off-by: Jakub Acs <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Acked-by: SeongJae Park <[email protected]>
Tested-by: Alice Ryhl <[email protected]>
Tested-by: Miguel Ojeda <[email protected]>
Cc: Xu Xin <[email protected]>
Cc: Chengming Zhou <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
[[email protected]: adjust context in bindgings_helper.h]
Signed-off-by: Jakub Acs <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
frank-w added a commit that referenced this pull request Oct 29, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Nov 7, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Nov 7, 2025
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Nov 8, 2025
The initconst statement causes memory to be freed after init
resulting in non-working devices.

Signed-off-by: Frank Wunderlich <[email protected]>
---
clk: mediatek: clk-gate: fix crash since 6.18-rc1

[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
frank-w added a commit that referenced this pull request Nov 8, 2025
The initconst statement causes memory to be freed after init
resulting in non-working devices.

Signed-off-by: Frank Wunderlich <[email protected]>
---
clk: mediatek: clk-gate: fix crash since 6.18-rc1

[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---
[    5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock
[    5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare
[    5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388
[    5.300166] Mem abort info:
[    5.302948]   ESR = 0x0000000096000007
[    5.306684]   EC = 0x25: DABT (current EL), IL = 32 bits
[    5.311983]   SET = 0, FnV = 0
[    5.315025]   EA = 0, S1PTW = 0
[    5.318154]   FSC = 0x07: level 3 translation fault
[    5.323020] Data abort info:
[    5.325888]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[    5.331359]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    5.336397]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000
[    5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000
[    5.360895] Internal error: Oops: 0000000096000007 [#1]  SMP
[    5.366543] Modules linked in:
[    5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE
[    5.378882] Hardware name: Bananapi BPI-R4-LITE (DT)
[    5.383834] Workqueue: pm pm_runtime_work
[    5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.394792] pc : mtk_cg_disable+0x18/0x38
[    5.398795] lr : clk_core_disable+0x7c/0x150
[    5.403057] sp : ffffffc081bb3bc0
[    5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000
[    5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0
[    5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738
[    5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff
[    5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532
[    5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0
[    5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8
[    5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8
[    5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001
[    5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400
[    5.477605] Call trace:
[    5.480041]  mtk_cg_disable+0x18/0x38 (P)
[    5.484043]  clk_core_disable+0x7c/0x150
[    5.487956]  clk_disable+0x30/0x4c
[    5.491350]  clk_bulk_disable+0x3c/0x58
[    5.495177]  msdc_gate_clock+0x48/0x15c
[    5.499005]  msdc_runtime_suspend+0x2a0/0x2e4
[    5.503352]  pm_generic_runtime_suspend+0x2c/0x44
[    5.508047]  __rpm_callback+0x40/0x228
[    5.511788]  rpm_callback+0x38/0x80
[    5.515268]  rpm_suspend+0xd8/0x630
[    5.518748]  pm_runtime_work+0x114/0x118
[    5.522662]  process_one_work+0x164/0x3ac
[    5.526665]  worker_thread+0x284/0x46c
[    5.530404]  kthread+0x114/0x1c8
[    5.533623]  ret_from_fork+0x10/0x20
[    5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24)
[    5.543272] ---[ end trace 0000000000000000 ]---

Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct")
Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.