Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1663579pxj; Wed, 19 May 2021 10:56:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/ox/NFUqvTKMpMfWBMnH9Qej12QxokRoPZv7BFKLofn1fRUrNSDgVlqgbdZgwPhjPVsBi X-Received: by 2002:aa7:db94:: with SMTP id u20mr230090edt.381.1621447007769; Wed, 19 May 2021 10:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447007; cv=none; d=google.com; s=arc-20160816; b=pUF46JT2yMHEvXuEIU7CPvGCQpDQeSLbBQzgynzHH1BLxlQsFZQfgy5nGeMgTEmrIG UUvF7LIkLBNlc7gn0Zt6p3wTmgtqIrKMqJQ5JykPJOYU63i1cJDRI/u4Hnk9eWit2lVw tnfiYiEJwnb5MIe/Vole0eAtGefFQmObgNZcefgnhTuM+7QSFdekgFLPhjUD1WczXNyr bCU2hblDI315HJx0g700rY7wyOddQo5bb5RXvZlM6NkLIw7LnaTdBSCxemau4QU5CNOO D/zuhJREb1JXqzfcWIboDUZ72Lb2GLOUmP1Fb9rUhe432fFpC8pAnmXzeuowyuzvBz2+ xLig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=a4vJuqUyooQzXQWxceXxxy6dGwn48upxwJ1elpesZrk=; b=gRQxgdaFkjVu0EKGzOpf0FTwV8bCOvNYkQXii1twp7pApM9rBZg5ncrc/eFPGf7M4s i/SNk3sLqsQEst9da7os/NBFvdotaaJFXBBKosv+qYRz/UtG7tybWpIx4gXNDwh5wrvB /n59tiTToFIHwkIpuL1heH9lMLWTo3VJnU//SY6dIP4LJ9OrwiSMKrhkdqteVQRAV5No /RFEAovQeqP4RfcHzR+kDAirdBV7iRm79gaeAQkke1qerRFK8xdTnkjs1IaMdy/+MqY4 gz2NsGJZlgRxmpCdWnk5EIfuhmxo76yTD5+Y8FbgSkmIQ3WAL99IUf8r1t8ihL0gZWSe LYBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id da21si12395651edb.214.2021.05.19.10.56.23; Wed, 19 May 2021 10:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348772AbhERLSJ (ORCPT + 99 others); Tue, 18 May 2021 07:18:09 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:46092 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237443AbhERLSI (ORCPT ); Tue, 18 May 2021 07:18:08 -0400 Received: from 1-171-221-38.dynamic-ip.hinet.net ([1.171.221.38] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lixiR-0005s4-P5; Tue, 18 May 2021 11:16:48 +0000 From: Kai-Heng Feng To: mathias.nyman@intel.com Cc: Kai-Heng Feng , Greg Kroah-Hartman , linux-usb@vger.kernel.org (open list:USB XHCI DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] xhci: State explicitly when the controller is inaccessible Date: Tue, 18 May 2021 19:16:40 +0800 Message-Id: <20210518111640.243559-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes the dmesg says "Controller not ready at resume" because CNR is flagged. But what actually happens is that the whole USBSTS becomes inaccessible, and the reason could be disabled PCI I/O space or faulty firmware/hardware. So state the reason explicitly to make the message more clear. Signed-off-by: Kai-Heng Feng --- drivers/usb/host/xhci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ca9385d22f68..0e6fbe1f4fcc 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1117,8 +1117,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) retval = xhci_handshake(&xhci->op_regs->status, STS_CNR, 0, 10 * 1000 * 1000); if (retval) { - xhci_warn(xhci, "Controller not ready at resume %d\n", - retval); + xhci_warn(xhci, "Controller is %s at resume %d\n", + retval == -ENODEV ? "inaccessible" : + "not ready", retval); spin_unlock_irq(&xhci->lock); return retval; } -- 2.31.1