Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5458781imm; Tue, 16 Oct 2018 10:32:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV63JRSmcr8yboNRNVYn5GwI4H1ZJOIxe/g6IY8MMmYAT3z6Qb70Ok+CimmCXKuJTlHJeuGSd X-Received: by 2002:a17:902:3324:: with SMTP id a33-v6mr22365742plc.208.1539711122956; Tue, 16 Oct 2018 10:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539711122; cv=none; d=google.com; s=arc-20160816; b=RytpOvJp4xdx7IEBG9mpmrv/q3tmvUbtIey5vJs/793qAucCVDonW1cQJPgwiYGfRt J8YVheN5EUSj89rVVrpQJTHEkCjdrN/8WZ4FLaOr3Xu0vpzlCvJBxsRYvYwGYOUN4XEv iUfxkUQBJcBLAHurS6gARvAWF15x61FxdHmjQWOqlrxq1A7teDChedljIhiKrzQaVckz rl66a7TNABTsig2fRogUC6vBfP7JF1IypR+DrWNyZP+UA4IcxMBa+R2W382+VYBSv0KM JUWrYbksfe5GLZLSZmp8LKwcyph1TgJ5gZpw/7I+lTHnKy7oMbVryUNVt4HnsvuH86yF RlXg== 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=citjc7qPBrQ4wIbeanORLy+04peWu55JVgNa/Wqains=; b=Gl90g567pf2rH12vzewTlswQdAF+HVsOD3KmK2cRueCZCeB/NW/X7cHNBlHJZLKIAu EU/lQ264QLDnHWWZnmwL4LLlBWqnS2/5qw0TWsGhqcdpRL+XI4JqDxrsqH0WeLTBRgQ/ QKyPAMat2JPCeEDaa3Olxfdana4kyn2l2HyDwOh2w9vh1Uw3Mvn4P6M91ik6GNDNczpF PLo5EvfqE1k4FvQPZggMzo8KB98iyhejG0RoBqzUrGgQ7yrsCknnTkoMwIYPjtodMZiQ PQgMGcbhYJNN+sg5xYnfPzUQiKuKWcVcIUa0lafcKSEYA5OxG7vt5RLKWzNeyzL731YI uLwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zOkguE43; 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 h4-v6si15244915plr.343.2018.10.16.10.31.46; Tue, 16 Oct 2018 10:32:02 -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=zOkguE43; 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 S1731339AbeJQBOl (ORCPT + 99 others); Tue, 16 Oct 2018 21:14:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:33104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730802AbeJQBOk (ORCPT ); Tue, 16 Oct 2018 21:14:40 -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 233D320658; Tue, 16 Oct 2018 17:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539710594; bh=cPnV/Mt9njc2DORUmrId5MKjDZTccemKYaN/jqTy7QM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zOkguE43Q5zETyrZ7PefnlAlEvrKcn5DsYjD/Gc6jRdcKEunhsEPZWHCzK42pF1FH u2PIfRvUqb9cAIeuYNHZTo7mCCU5QbK44kLN0Q8eNKsLrO+k7OwID4oF2GXQaNZcVe CtIfYCcbgBoxxcC3TVRzf9ju9UgdV3x8qlODg4K8= 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.9 21/71] xhci: Dont print a warning when setting link state for disabled ports Date: Tue, 16 Oct 2018 19:09:18 +0200 Message-Id: <20181016170540.460020453@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170539.315587743@linuxfoundation.org> References: <20181016170539.315587743@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.9-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 @@ -1072,17 +1072,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);