Hi Luis, On Mon, 16 Dec 2024 11:33:56 -0300, Luis Claudio R. Goncalves wrote: >On Sun, Dec 15, 2024 at 11:13:21PM +0900, Ryo Takakura wrote: >> PCI config access is locked with pci_lock which is raw_spinlock. >> Convert cfg_lock to raw_spinlock so that the lock usage is consistent >> for RT kernel. >> >> Reported as following: >> [ 18.756807] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 >> [ 18.756810] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 1617, name: nodedev-init >> [ 18.756810] preempt_count: 1, expected: 0 >> [ 18.756811] RCU nest depth: 0, expected: 0 >> [ 18.756811] INFO: lockdep is turned off. >> [ 18.756812] irq event stamp: 0 > >This problem has been discussed in the past at: > > [PATCH v6.4-rc5-rt4] rt: vmd: make cfg_lock a raw spinlock > https://lore.kernel.org/linux-rt-users/20230608210232.056e731f@xxxxxxxxxxxxxxxxxx/T/#t > >And there was a suggestion to remove the lock altogether as (at the time) the >only two call sites of vmd_pci_read() were already protected by pci_lock. > >I wrote the patch removing the lock and it worked as expected, but never >sent it to the list. If you think that for the current code that makes >sense, please have fun removing the lock. :) I see, thanks for the link! I took a look at current the code and I think that cfg_lock can still safely be removed as explained by Sebastian [0]. I'll send another patch shortly! >Best regards, >Luis Sincerely, Ryo Takakura [0] https://lore.kernel.org/linux-rt-users/20230620154434.MosrzRUh@xxxxxxxxxxxxx/