Re: [PATCH v2 3/6] usb: musb: use is_host_active() to distinguish between host and gadget mode

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

 



On 05/23/2014 03:32 PM, George Cherian wrote:
> On 5/23/2014 3:00 PM, Daniel Mack wrote:
>> On AM33xx platforms, unplugging a device in the middle of an active
>> transfer leads to a drop of MUSB_DEVCTL_HM in MUSB_DEVCTL before the
>> system is informed about a disconnect. This consequently makes the musb
>> core call the gadget code to handle the interrupt request, which then
>> crashes the kernel because the relevant pointers haven't been set up
>> for gadget mode.
>>
>> To fix this, use is_host_active() rather than (devctl & MUSB_DEVCTL_HM)
>> in musb_interrupt() and musb_dma_completion() to detect whether the
>> controller is in host or peripheral mode. This information is provided
>> by the driver logic and does not rely on register contents.
> 
> Yes w.r.t AM33xx platform this looks okay. But since its a core file 
> used by different
> implementations am not sure of any possible issues.

I thought about that, too. But then again, musb->is_host should never
change its state while there are active users, and it generally seems
like a more reliably source of information than the register set.

In any way, it fixes a NULL pointer Ooops when hot-plugging devices.


Thanks,
Daniel

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