Re: [PATCH] USB: Documentation: Update description of completion callback context
From: Sebastian Andrzej Siewior
Date: Fri Oct 16 2026 - 15:07:18 EST
On 2026-10-15 14:35:56 [-0400], Alan Stern wrote:
> On Thu, Oct 15, 2026 at 08:26:43PM +0200, Sebastian Andrzej Siewior wrote:
> > On 2026-10-15 12:00:46 [-0400], Alan Stern wrote:
> > > The existing kerneldoc documentation for URB completion callbacks is
> > > incorrect about the context in which the callbacks occur; it is not
> > > always in_interrupt. State explicitly that a callback may occur in
> > > any context with no guarantees, and likewise for the status of
> > > CPU-local interrupts.
> > >
> > > Documentation update only; no code changes.
> > >
> > > Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> >
> > Reviewed-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> >
> > usb_hcd_giveback_urb() kernel doc says:
> >
> > | * Context: atomic. The completion callback is invoked either in a work queue
> > | * (BH) context or in the caller's context, depending on whether the HCD_BH
> > | * flag is set in the @hcd structure, except that URBs submitted to the
> > | * root hub always complete in BH context.
> >
> > Do you think this deserves an update?
>
> I think that's okay as is. It describes the current implementation
> pretty well, even though it doesn't mention the lack of guarantees. If
> you feel it should be changed, let me know.
It reads as it is always atomic. Maybe removing parts of the description
and adding a pointer to your initial documentation would be better.
> Alan Stern
Sebastian