Hi Matthew, thank you for your help, that is much appreciated!
On Mon, Jun 29, 2026 at 07:54:41PM +0100, Matthew Wilcox wrote: > On Mon, Jun 29, 2026 at 10:57:14AM +0200, Wolfram Sang wrote: > > Okay, seems to work so far. Thank you again! Will merge your patch into > > my series with your credits. Now I just need to wrap XArray into struct > > seq_operations. Seems no one has needed that in the kernel so far. > > Huh. I thought I had done that at some point. But it was pre-pandemic > that I was looking at it so maybe I either never did it or I never sent > it out. I grepped for all users of 'struct seq_operations' if they used xarray functionality within a seq-file. No hit, sadly. I am bit struggling with the initial approach. I would think that I need to return the current xas with start() and next() from seq_operations. That would mean dynamic allocating xas with kzalloc. However, xarray documentation says to put xas on the stack. Can't it be done dynamically? > Assuming that we don't want to call pm_runtime_get_sync() under the > spinlock (and maybe for cleanliness we shouldn't anyway?), I would clear > the HWSPINLOCK_UNUSED mark in hwspin_lock_request_specific(), drop the > lock, then if __hwspin_lock_request() fails, set the UNUSED mark again. Yes, I agree. This is also my fav solution to ensure we can use a spinlock for the xarray. Hope I can work on it later today. Happy hacking, Wolfram

