Re: About the hibernation feature implementation in dwc3 driver

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

 



Hi,

no top-posting please, limit your lines to 80-characters

On Fri, Aug 02, 2013 at 09:25:39AM +0000, Wang, Yu Y wrote:
> Thanks the quick response.
> Actually, our solution is familiar with your thinking.
> 
> Due to we have to do "Power-On or Soft Reset" for disconnect and
> re-connect case, so driver need re-initialized all hardware registers.

you don't need a full Soft-reset when disconnecting the cable. Read the
driver and you'll we don't soft-reset the IP at every disconnect.

> That's why we want to separate register initialization operation from
> software part (like sw structure init and endpoint initialization)

register initialization is also SW, so I don't know what you want to
split here.

> However, we find that the hardware registers initialization is located
> in dwc3_gadget_init and 'dwc->gadget_driver' initialization is handled
> in dwc3_gadget_start.() So we can't full re-use these two functions.

this is wrong. dwc3_gadget_init() does nothing more than allocate
memory.

> If all the hardware initialization can be extract into a new function
> which call by udc_start callback and also can be called for
> hibernation disconnect case, then it is fine.

that's already how it works. Just read the code.

> And for disconnect, our driver need to do some hardware clear work.
> For example, disable irq, clear events which haven't handled, and
> disable endpoints and so on.

that's already how it works. Just read the code.

> BTW: Besides that. In our design, we also support host mode, and also
> have one OTG driver to maintain the role switch and USB charger
> detection.

right, Ido from codeaurora had some design to support but the work was
lost since he stopped sending newer versions.

> For role switch, our implementation is not only set GCTL.PORTCAP. Also
> we implemented some API for OTG driver, for example:
> start_host/stop_host and start_peripheral/stop_peripheral.

alright, now go ahead and remove those since they're likely not needed.

> All device and host hardware initialization will be done in these API.
> So for connect/disconnect case, the driver will re-initialization the
> host or device stack.

this wastes too much time and is usually unnecessary.

> I saw your design is do all hardware initialization during kernel
> boot. And just use GCTL.PORTCAP to do the role switch. I haven't try
> this solution on intel platform. And not sure if is working with
> hibernation feature.

right, then test and let me know the results. Also, instead of spending
so much time telling me what kind of changes Intel has in their own
hidden tree, why don't you go ahead and send patches for review ? That
would be so much easier for both of us...

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux