Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp12212imu; Thu, 8 Nov 2018 13:54:45 -0800 (PST) X-Google-Smtp-Source: AJdET5f8DCfuiyi6ai477Fn2CofaLbiG8rBEQx6i9plQVSZ7zHIjezj7agSweu0MyJP/KTOVvMsa X-Received: by 2002:a17:902:6a3:: with SMTP id 32-v6mr6340566plh.337.1541714085270; Thu, 08 Nov 2018 13:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714085; cv=none; d=google.com; s=arc-20160816; b=abMGi54iPVGnCgLmWr/64Z+j+MFoygBsEoK02CqHMmwGs1MKs0Il/xdhDMs0oBgqJ9 gBdfaineoDtjI/p3WfI2itF92JpBirRTFNwsUqj1OHG9Swikc5SjTECpSzoPNLtjtqNY fBqThvLYINmF6MkWDpKj246zbzsAb2jOehhy8wpOddKbr3hgWheaeEPsBPF+9RHFBx6Q jYrHmLGCIMfgVaetqBMvPIpCOlR6hcoA6IGTzGXTIEnJFEEbav3RdJCNPwdrBM5ku/Tr atCrgdLLwJtspzKP54NZDMGQb58iSrMx+ogN2AYgNKMkOVmMG/vzy+0/H2tU3E5sr1Qd GhIg== 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=NYENSR1yQedC20Ja+5VSm3Djh72IeLeboOLEzkOVWbo=; b=BUHvw1aOhnRDXabRhjE209Lku7s4lQvAIADlx34VLKVrtLLGKRBpH25FfrYTEmv1AO n0ZtfW65fFlLeseqk4GVKkVrX9z7aJwH/DsEgwnrcFbbG/6pQWZQmRDLgil5g9VFhkDy qfEe8OxjuzXRho3aGXh/Js7LkL7KQ0Ad7LmTj+ypPDs/xcAcJMOkkCLsCakFj/NkpnA0 /5VU3oe/1p8YjPG98H4ru05oS9Zi4OmamkOJVhFxPOs5QPKBU4J81k+Q4tcoxeMOZNFK SZmmQxe93q8NMI6fEToR/OkcsYnY2+ZRpFxu0Gx+Waw3Fd9T8QjLHiJnYl1Gdxr1edUJ ShuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VM/nfZSn"; 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 p22si4551240pgl.340.2018.11.08.13.54.29; Thu, 08 Nov 2018 13:54:45 -0800 (PST) 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="VM/nfZSn"; 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 S1727655AbeKIHbH (ORCPT + 99 others); Fri, 9 Nov 2018 02:31:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:45598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbeKIHbH (ORCPT ); Fri, 9 Nov 2018 02:31:07 -0500 Received: from localhost (unknown [208.72.13.198]) (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 874CC2081C; Thu, 8 Nov 2018 21:53:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714020; bh=0/fplM3A0e8O6rFr5ZLfsvMRrwOWSaqTQSd5DmjVgm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VM/nfZSnvPxYT8NfoABPL5tQYSi44mjZ1NF/UefdY71DtLNvwLcW39Dxt6HHLeit0 Dk5D9rID9Va0FwpQlanNoR8K2DDy57vfGU9xyzXI04ti/8JbszExHLOAZtil9dZQ0m S8iZ2jMhOXn08xxOHjbs7WNdihAa2tEM3I+FRL4w= 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 3.18 006/144] xhci: Dont print a warning when setting link state for disabled ports Date: Thu, 8 Nov 2018 13:49:37 -0800 Message-Id: <20181108215055.277446882@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@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 3.18-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 @@ -926,17 +926,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);