Re: [PATCH v7 2/3] hwspinlock: add list of locks to debugfs

From: Wolfram Sang

Date: Wed Sep 16 2026 - 17:43:33 EST


> > +static void *hwspin_lock_seq_next(struct seq_file *s, void *v, loff_t *ppos)
> > +{
> > + /* Increase ppos here to avoid endless loops. Don't use xa_find_after() */
>
> Do you mean xa_find_after() may loop forever?

Ehrm, it's been a while, I need to look this up. Which means the comment
is not explanationary enough :/

> > +static int hwspin_lock_seq_show(struct seq_file *s, void *v)
> > +{
> > + struct hwspinlock *hwlock = v;
> > + bool unused = xa_get_mark(&hwspinlocks, s->index, HWSPINLOCK_UNUSED);
> > +
> > + seq_printf(s, "%4llu:\t%s\t%s\n", s->index, unused ? "free" : "in use",
>
> For easier parsing the output, you may want to use a string without
> spaces, e.g. "busy", "active", ...

I get the idea, but haven't found a nice word yet. "Busy" could be
interpreted as "lock taken". I'll think some more about it.

Attachment: signature.asc
Description: PGP signature