From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940975AbcLWJti (ORCPT ); Fri, 23 Dec 2016 04:49:38 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:35335 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938681AbcLWJtf (ORCPT ); Fri, 23 Dec 2016 04:49:35 -0500 Subject: Re: [PATCH 4/4] usb: xhci: warn on command timeout in stopped command ring To: Lu Baolu , Mathias Nyman References: <1482475978-18203-1-git-send-email-baolu.lu@linux.intel.com> <1482475978-18203-5-git-send-email-baolu.lu@linux.intel.com> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Sergei Shtylyov Message-ID: Date: Fri, 23 Dec 2016 12:49:32 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482475978-18203-5-git-send-email-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 12/23/2016 9:52 AM, Lu Baolu wrote: > If xhci host fails to response to a command, the command s/response/respond/. > watchdog timer will be fired. The callback function will > abort and clear current command and restart the command > execution. If driver fails to restart command execution, > it will assume there is a larger problem in host and > report the situation to the upper layer. In rare cases, > if the driver sees a command timeout in a stopped command > ring, driver should let the user know it. > > Signed-off-by: Lu Baolu > --- > drivers/usb/host/xhci-ring.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c > index 6a23c37..16baefc 100644 > --- a/drivers/usb/host/xhci-ring.c > +++ b/drivers/usb/host/xhci-ring.c > @@ -1308,8 +1308,12 @@ void xhci_handle_command_timeout(struct work_struct *work) > goto time_out_completed; > } > > - /* command timeout on stopped ring, ring can't be aborted */ > - xhci_dbg(xhci, "Command timeout on stopped ring\n"); > + /* > + * We should never reach here until a command times out on a stopped > + * ring and xhci driver has no idea about the reason why the command > + * ring was stopped. > + */ > + xhci_warn(xhci, "WARN command timeout on stopped ring\n"); WARNING, maybe? [...] MBR, Sergei