RE: [PATCH 03/10] staging: dwc2: move some interrupt enabling around

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

 



Hi Matthijs,

> -----Original Message-----
> From: Matthijs Kooijman [mailto:matthijs@xxxxxxxx]
> 
> Before, the DISCONNINT interrupt was enabled in
> dwc2_enable_host_interrupts, but handled in dwc2_handle_common_intr,
> while the RXFLVL interrupt was enabled in dwc2_enable_commont_interrupts
> and handled in dwc_handle_hcd_intr.

I guess you meant dwc2_hcd_intr, not dwc_handle_hcd_intr.

> This moves the enabling of these interrupts around to match the spot
> where they are handled.

Actually, this is conceptually wrong. The DISCONNINT interrupt
is a host-only interrupt, so it _should_ be enabled in
dwc2_enable_host_interrupts().

There may be a reason why this interrupt is handled in
dwc2_handle_common_intr() instead of in dwc2_hcd_intr(). It
could be because, if the user does the disconnect by unplugging
the USB cable from the host, then the core will immediately
switch to device mode, so the dwc2_is_host_mode() test in
dwc2_hcd_intr() will fail, and the DISCONNINT will not get
cleared.

Instead of this patch, maybe it would be better to move the
handling of DISCONNINT to dwc2_hcd_intr(), but _before_ the
call to dwc2_is_host_mode(). And put a comment there that
explains this.

And, the RXFLVL interrupt is a host+device mode interrupt, so it
_should_ be enabled in dwc2_enable_common_interrupts. The only
handler for it is in dwc2_hcd_intr() because there is no device-
mode driver code yet. Once there is, there will either be two
handlers, or else a common handler with different code depending
on the mode.

-- 
Paul

--
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