[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLgV6lcxvs5JLUdk@smile.fi.intel.com>
Date: Wed, 3 Sep 2025 13:18:18 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Jean-François Lessard <jefflessard3@...il.com>
Cc: Andy Shevchenko <andy@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] auxdisplay: linedisp: support attribute attachment
to auxdisplay devices
On Tue, Sep 02, 2025 at 01:37:52PM -0400, Jean-François Lessard wrote:
> Le 2 septembre 2025 06 h 18 min 24 s HAE, Andy Shevchenko <andriy.shevchenko@...el.com> a écrit :
> >On Sun, Aug 31, 2025 at 10:00:28PM -0400, Jean-François Lessard wrote:
...
> >> +static DEFINE_SPINLOCK(linedisp_attachments_lock);
> >
> >Why spin lock and not mutex?
>
> The attachment list operations are extremely lightweight (just adding/removing
> list entries), making spinlock the optimal choice because:
> - Very short critical sections: Only list traversal and pointer assignments;
> avoids context switching overhead for brief operations
> - No sleeping operations: No memory allocation or I/O within locked sections
> - Future-proof atomic context safety: Can be safely called from interrupt
> handlers if needed
To me it sounds like solving non-existing problem. I am sure we will see no
driver that tries to call this API in an atomic context.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists