Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2234259imm; Thu, 18 Oct 2018 11:07:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV63RbEd9vVCWPMYCdtRvBsx+5FZC2s2F3OhcTnB5Rer3o5KchjTUNmqkCE8cPgKZPozbpkaU X-Received: by 2002:a65:57c4:: with SMTP id q4-v6mr8071999pgr.229.1539886074020; Thu, 18 Oct 2018 11:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539886073; cv=none; d=google.com; s=arc-20160816; b=xa86MMK5D7roK8G0nrARrpMDuGvfpWUL0jxFAcy2WPPqcA1HyjKsQRSma8jtABB5Yp WzF1mOymC3TWOuFjZYPa8h7lQ6jam5/n5ibq6tru6FMkZ8Eh2YUvqv6yPKsxHDml6wct K9EH0vE8pkGOpAcuJOK7j7W121BaSXlLA6Y0fGeR3XOpM1BltNWxuhuOGCI01YDNbP75 cJMKLf1SxI3RxWheRqB/BXid9UxKBZttXczyehRbU8KaFgDq4UA9pK1F0TT9MAJI8Wuy hhnrrDOsnJ5SbaKSSuQreAYRMPSxhq3aHax+yZvRynrYKbyvH8TT4Ok1o3sOfCXUHGSF jl5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JurqDiiDMOvf7ZmaDjXjvxwwzLaQJLN68Fd9QoABWoU=; b=HQ6AfEUIDgCpHKUDo9iyLoaMXycTERKTMGYuPVWGh7L7RNdzIHCmf2ysLNc9odnQcM VnTHyulL3SJPonb2+eVHbJDwzj+FHl+2SK6ZZcTGUWoMGd8joNTtZldms3Dikn1+Tshj G5Iqz1EL7EuSaA1jRW2Un3iyPLAt8tM0ooG3o3MzrW1E4dwIzNWFR4tyPstEnAI1icsY p0ryCWbltFxNj+rIPPpW0OhBsVNBe9kksC/9oa7Tx14osksOTY9Ti8+I4wUhtjKYHnFl af3JiCs/fBjV5IwXQh5LAcITQgPr/gAp664OVKR4bYwJgW2j8uYs2MBsFWt209SBUh3p q3Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qIyIQM0n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15-v6si21277392pgr.232.2018.10.18.11.07.38; Thu, 18 Oct 2018 11:07:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qIyIQM0n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730219AbeJSCHQ (ORCPT + 99 others); Thu, 18 Oct 2018 22:07:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:55824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730194AbeJSCHP (ORCPT ); Thu, 18 Oct 2018 22:07:15 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5AE121476; Thu, 18 Oct 2018 18:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539885908; bh=DNDRjR7Vdiz7w36JDes1Xl9NXCZBFrcFzKhFpVpTlHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qIyIQM0nmNaZl+r066nEh55vehIGOC8jAUL4y1wuH1vBOvAOjibSuxpkJ242qIauS ANTFhjgaQrlfOUCYDnsRsQ3Bu6YqqUS8iu/olGk+/GighF6hZVCHEeFi90mU84BoyB kEQHi45zCZlHtZAxeuTMEXOzPDrSqn/vHjkJcxgQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman , Yoshihiro Shimoda , Ross Zwisler Subject: [PATCH 4.4 15/48] xhci: Dont print a warning when setting link state for disabled ports Date: Thu, 18 Oct 2018 19:54:50 +0200 Message-Id: <20181018175428.823402836@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175427.133690306@linuxfoundation.org> References: <20181018175427.133690306@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mathias Nyman commit 1208d8a84fdcae6b395c57911cdf907450d30e70 upstream. When disabling a USB3 port the hub driver will set the port link state to U3 to prevent "ejected" or "safely removed" devices that are still physically connected from immediately re-enumerating. If the device was really unplugged, then error messages were printed as the hub tries to set the U3 link state for a port that is no longer enabled. xhci-hcd ee000000.usb: Cannot set link state. usb usb8-port1: cannot disable (err = -32) Don't print error message in xhci-hub if hub tries to set port link state for a disabled port. Return -ENODEV instead which also silences hub driver. Signed-off-by: Mathias Nyman Tested-by: Yoshihiro Shimoda Signed-off-by: Ross Zwisler Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-hub.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -1048,17 +1048,17 @@ int xhci_hub_control(struct usb_hcd *hcd temp = readl(port_array[wIndex]); break; } - - /* Software should not attempt to set - * port link state above '3' (U3) and the port - * must be enabled. - */ - if ((temp & PORT_PE) == 0 || - (link_state > USB_SS_PORT_LS_U3)) { - xhci_warn(xhci, "Cannot set link state.\n"); + /* Port must be enabled */ + if (!(temp & PORT_PE)) { + retval = -ENODEV; + break; + } + /* Can't set port link state above '3' (U3) */ + if (link_state > USB_SS_PORT_LS_U3) { + xhci_warn(xhci, "Cannot set port %d link state %d\n", + wIndex, link_state); goto error; } - if (link_state == USB_SS_PORT_LS_U3) { slot_id = xhci_find_slot_id_by_port(hcd, xhci, wIndex + 1);