From patchwork Wed Nov 30 09:19:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 13059606 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3757C4321E for ; Wed, 30 Nov 2022 09:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232866AbiK3JSX (ORCPT ); Wed, 30 Nov 2022 04:18:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232592AbiK3JSR (ORCPT ); Wed, 30 Nov 2022 04:18:17 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 751CE45A17 for ; Wed, 30 Nov 2022 01:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669799895; x=1701335895; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fJQn3D72sF42Pp4iqj6Q9yeVh0aYs2iEo1400Wtpams=; b=Tqg4UwZwAw2G8LBtHCtHAMzF7NGX2yFMZHeNChegQHvZy6e6ZyyIH+fI 8LKtwSK0aVRdr22NnhPhwM9f60vECGJzQFJYhfTZBKE0nVZOHRzsEhory 8scNr5sebeFhe4Csj0BGRD61ctBlZGNsWVoAKoerGRFD6wahS1CVuZWxz 0smiKsu0Yo2hikE+beYiK8y+tSvi0mQrq89GKAv60D5sSwfG8bn439EMb tIKDDj5ZjTNdQmg/PiebS1s60zPStrIEw7HnqXvY0p4U7c4QueGcd8gVv NdfmT0u+I1NU/z05kr2R5dbt5fCNJm0R8o/8LDhau/qRKDWk8tdB1Cqnh w==; X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="295711258" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="295711258" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2022 01:18:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10546"; a="674962686" X-IronPort-AV: E=Sophos;i="5.96,205,1665471600"; d="scan'208";a="674962686" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by orsmga008.jf.intel.com with ESMTP; 30 Nov 2022 01:18:13 -0800 From: Mathias Nyman To: Cc: , Longfang Liu , Mathias Nyman Subject: [PATCH 1/6] xhci: print warning when HCE was set Date: Wed, 30 Nov 2022 11:19:39 +0200 Message-Id: <20221130091944.2171610-2-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221130091944.2171610-1-mathias.nyman@linux.intel.com> References: <20221130091944.2171610-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Longfang Liu When HCE(Host Controller Error) is set, it means that the xhci hardware controller has an error at this time, but the current xhci driver software does not log this event. By adding an HCE event detection in the xhci interrupt processing interface, a warning log is output to the system, which is convenient for system device status tracking. Signed-off-by: Longfang Liu Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index ad81e9a508b1..f6af479188e8 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -3031,6 +3031,11 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) if (!(status & STS_EINT)) goto out; + if (status & STS_HCE) { + xhci_warn(xhci, "WARNING: Host Controller Error\n"); + goto out; + } + if (status & STS_FATAL) { xhci_warn(xhci, "WARNING: Host System Error\n"); xhci_halt(xhci);