linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Alessandro Antenucci <antenucci@korg.it>,
	Bin Liu <b-liu@ti.com>, Alan Stern <stern@rowland.harvard.edu>
Subject: [PATCH 4.14 35/48] usb: core: handle hub C_PORT_OVER_CURRENT condition
Date: Fri, 27 Jul 2018 12:00:20 +0200	[thread overview]
Message-ID: <20180727095922.156556873@linuxfoundation.org> (raw)
In-Reply-To: <20180727095918.503549522@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bin Liu <b-liu@ti.com>

commit 249a32b7eeb3edb6897dd38f89651a62163ac4ed upstream.

Based on USB2.0 Spec Section 11.12.5,

  "If a hub has per-port power switching and per-port current limiting,
  an over-current on one port may still cause the power on another port
  to fall below specific minimums. In this case, the affected port is
  placed in the Power-Off state and C_PORT_OVER_CURRENT is set for the
  port, but PORT_OVER_CURRENT is not set."

so let's check C_PORT_OVER_CURRENT too for over current condition.

Fixes: 08d1dec6f405 ("usb:hub set hub->change_bits when over-current happens")
Cc: <stable@vger.kernel.org>
Tested-by: Alessandro Antenucci <antenucci@korg.it>
Signed-off-by: Bin Liu <b-liu@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/core/hub.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1141,10 +1141,14 @@ static void hub_activate(struct usb_hub
 
 		if (!udev || udev->state == USB_STATE_NOTATTACHED) {
 			/* Tell hub_wq to disconnect the device or
-			 * check for a new connection
+			 * check for a new connection or over current condition.
+			 * Based on USB2.0 Spec Section 11.12.5,
+			 * C_PORT_OVER_CURRENT could be set while
+			 * PORT_OVER_CURRENT is not. So check for any of them.
 			 */
 			if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
-			    (portstatus & USB_PORT_STAT_OVERCURRENT))
+			    (portstatus & USB_PORT_STAT_OVERCURRENT) ||
+			    (portchange & USB_PORT_STAT_C_OVERCURRENT))
 				set_bit(port1, hub->change_bits);
 
 		} else if (portstatus & USB_PORT_STAT_ENABLE) {



  parent reply	other threads:[~2018-07-27 10:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  9:59 [PATCH 4.14 00/48] 4.14.59-stable review Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 02/48] MIPS: ath79: fix register address in ath79_ddr_wb_flush() Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 03/48] MIPS: Fix off-by-one in pci_resource_to_user() Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 04/48] xen/PVH: Set up GS segment for stack canary Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 05/48] KVM: PPC: Check if IOMMU page is contained in the pinned physical page Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 06/48] drm/nouveau/drm/nouveau: Fix runtime PM leak in nv50_disp_atomic_commit() Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 07/48] drm/nouveau: Set DRIVER_ATOMIC cap earlier to fix debugfs Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 08/48] bonding: set default miimon value for non-arp modes if not set Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 09/48] ip: hash fragments consistently Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 10/48] ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 11/48] net/mlx4_core: Save the qpn from the input modifier in RST2INIT wrapper Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 12/48] net: skb_segment() should not return NULL Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 13/48] net/mlx5: Adjust clock overflow work period Greg Kroah-Hartman
2018-07-27  9:59 ` [PATCH 4.14 14/48] net/mlx5e: Dont allow aRFS for encapsulated packets Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 15/48] net/mlx5e: Fix quota counting in aRFS expire flow Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 16/48] net/ipv6: Fix linklocal to global address with VRF Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 17/48] multicast: do not restore deleted record source filter mode to new one Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 18/48] net: phy: consider PHY_IGNORE_INTERRUPT in phy_start_aneg_priv Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 19/48] sock: fix sg page frag coalescing in sk_alloc_sg Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 20/48] rtnetlink: add rtnl_link_state check in rtnl_configure_link Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 21/48] vxlan: add new fdb alloc and create helpers Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 22/48] vxlan: make netlink notify in vxlan_fdb_destroy optional Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 23/48] vxlan: fix default fdb entry netlink notify ordering during netdev create Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 24/48] tcp: fix dctcp delayed ACK schedule Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 25/48] tcp: helpers to send special DCTCP ack Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 26/48] tcp: do not cancel delay-AcK on DCTCP special ACK Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 27/48] tcp: do not delay ACK in DCTCP upon CE status change Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 28/48] tcp: free batches of packets in tcp_prune_ofo_queue() Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 29/48] tcp: avoid collapses in tcp_prune_queue() if possible Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 30/48] tcp: detect malicious patterns in tcp_collapse_ofo_queue() Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 31/48] tcp: call tcp_drop() from tcp_data_queue_ofo() Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 32/48] tcp: add tcp_ooo_try_coalesce() helper Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 33/48] staging: speakup: fix wraparound in uaccess length check Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 34/48] usb: cdc_acm: Add quirk for Castles VEGA3000 Greg Kroah-Hartman
2018-07-27 10:00 ` Greg Kroah-Hartman [this message]
2018-07-27 10:00 ` [PATCH 4.14 37/48] usb: gadget: f_fs: Only return delayed status when len is 0 Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 38/48] driver core: Partially revert "driver core: correct devices shutdown order" Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 39/48] can: xilinx_can: fix RX loop if RXNEMP is asserted without RXOK Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 40/48] can: xilinx_can: fix power management handling Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 41/48] can: xilinx_can: fix recovery from error states not being propagated Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 42/48] can: xilinx_can: fix device dropping off bus on RX overrun Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 43/48] can: xilinx_can: keep only 1-2 frames in TX FIFO to fix TX accounting Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 44/48] can: xilinx_can: fix incorrect clear of non-processed interrupts Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 45/48] can: xilinx_can: fix RX overflow interrupt not being enabled Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 46/48] can: peak_canfd: fix firmware < v3.3.0: limit allocation to 32-bit DMA addr only Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 47/48] can: m_can.c: fix setup of CCCR register: clear CCCR NISO bit before checking can.ctrlmode Greg Kroah-Hartman
2018-07-27 10:00 ` [PATCH 4.14 48/48] turn off -Wattribute-alias Greg Kroah-Hartman
2018-07-27 17:31 ` [PATCH 4.14 00/48] 4.14.59-stable review Guenter Roeck
2018-07-27 19:55 ` Shuah Khan
2018-07-28  6:54 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180727095922.156556873@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=antenucci@korg.it \
    --cc=b-liu@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).