Re: [PATCH] usb: core: hub power off when over-current detected

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

 



Hello.

On 11/08/2012 08:58 PM, Alan Stern wrote:

>>>> USB specs says that if an over-current is detected then a hub must switch off
>>>> all affected port, wait to cool down and then switch on.

>>>> There are few controllers, which does not follow it, and expects software
>>>> to switch off the port power.

>>> Can you give any examples?

>>    The example that springs to my mind is EHCI -- but the EHCI driver takes care
>> for switching the port off.

> Which EHCI implementation are you talking about?

   Former NEC (now Renesas) EC42xx SoCs seem to have such implementation,
although I'm not completely sure. At least the driver used to manually power off
the port when false positive over-current change happened after the power was
applied (OC signal from the buggy power chip changed from true to false at this
event); I have submitted patch to check for real OC condition before turning
power off (which you ACKed and Greg applied). I'm not sure we had "true"
over-current events now...

> And where does the 
> EHCI driver switch ports off when they encounter an overcurrent 
> condition?

   Look at this fragment of ehci-hub.c:

807                 if ((temp & PORT_OCC) && !ignore_oc){
808                         status |= USB_PORT_STAT_C_OVERCURRENT << 16;
809
810                         /*
811                          * Hubs should disable port power on over-current.
812                          * However, not all EHCI implementations do this
813                          * automatically, even if they _do_ support per-port
814                          * power switching; they're allowed to just limit the
815                          * current.  khubd will turn the power back on.
816                          */
817                         if ((temp & PORT_OC) && HCS_PPC(ehci->hcs_params)) {
818                                 ehci_writel(ehci,
819                                         temp & ~(PORT_RWC_BITS | PORT_POWER),
820                                         status_reg);
821                                 temp = ehci_readl(ehci, status_reg);
822                         }
823                 }

> The EHCI controllers I have used do not allow software to control the 
> port power levels at all.  It's all done in hardware.

   Apparently not our case.

> Alan Stern

WBR, Sergei

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