Hello.
On 04/02/2013 06:54 PM, Christian Engelmayer wrote:
Commit 756aa6b3d536afe85e151138cb03a293998887b3 added port power cycling on
overcurrent indications as needed by the MPC8349 USB controller after
resolving of the overcurrent situation in order to have the host state machine
assert the correct port status again.
Commit 81463c1d707186adbbe534016cd1249edeab0dac solved a thus resulting issue
Please also specify the summary lines of those 2 commits in parens
(or however you like).
of endless overcurrent changes in combination with the MAX4967 USB power supply
chip that signals overcurrent when power is not enabled by only powering off
a port if the overcurrent is currently active.
Added quriks flag oc_pp_cycle in order to specify the needed behaviour as
there is no common behaviour that can comply with both requirements.
Signed-off-by: Christian Engelmayer <christian.engelmayer@xxxxxxxxxxxxxx>
---
Did I understand You correctly to add a new flag analogous to eg. ignore_oc,
or would You prefer a new quirks flag in the driver structure?
drivers/usb/host/ehci-hcd.c | 5 +++++
drivers/usb/host/ehci-hub.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 416a6dc..6550550 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -103,6 +103,11 @@ static bool ignore_oc = 0;
module_param (ignore_oc, bool, S_IRUGO);
MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications");
+/* for flakey hardware, cycle port power on overcurrent indications */
+static bool oc_pp_cycle = 0;
+module_param (oc_pp_cycle, bool, S_IRUGO);
+MODULE_PARM_DESC (oc_pp_cycle, "cycle port power on overcurrent indications");
+
#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
/*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 7d06e77..240c7db 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -839,7 +839,7 @@ static int ehci_hub_control (
* power switching; they're allowed to just limit the
* current. khubd will turn the power back on.
*/
- if ((temp & PORT_OC) && HCS_PPC(ehci->hcs_params)) {
+ if (oc_pp_cycle && HCS_PPC(ehci->hcs_params)) {
You don't preserve the current behavior when your quirk is not active.
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