Re: dwc2: Host channel not always released on dequeue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Paul,

> I would prefer to keep that part of the code as-is for now. I haven't
> quite convinced myself that the function can never be called with
> halt_status = DWC2_HC_XFER_URB_DEQUEUE.
Ok. For arguments sake, it should be easy to convince yourself:

dwc2_hc_chhltd_intr is a static function only referenced from
dwc2_hc_n_intr. The latter basically does:

static void dwc2_hc_n_intr(struct dwc2_hsotg *hsotg, int chnum)
{
	(...)
	if (chan->halt_status == DWC2_HC_XFER_URB_DEQUEUE) {
		(...)
		return;
	}

	(...)

	dwc2_hc_chhltd_intr(hsotg, chan, chnum, qtd);
	(...)
}

This of course only holds provided that halt_status doesn't get set to
DWC2_HC_XFER_URB_DEQUEUE in the meanwhile, which only happens in
dwc2_hcd_urb_enqueue. AFAIU it should be safe to assume the driver
doesn't start dequeuing urbs on its own in the interrupt handler.

> > Why change this function? AFAICS it's never called with qtd = NULL with
> > the patch?
> 
> You're probably right, but I feel better adding a little defensive
> programming here, just in case.
Absolutely right, I was just wondering :-)

Gr.

Matthijs
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux