Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933903AbcDLM6O (ORCPT ); Tue, 12 Apr 2016 08:58:14 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:34993 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932441AbcDLM6M (ORCPT ); Tue, 12 Apr 2016 08:58:12 -0400 Subject: Re: [PATCH v4 2/2] usb: dwc3: add debugfs node to dump FIFO/Queue available space To: changbin.du@intel.com, balbi@kernel.org References: <1460459419-9487-1-git-send-email-changbin.du@intel.com> <1460459419-9487-3-git-send-email-changbin.du@intel.com> Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Sergei Shtylyov Message-ID: <570CF0E1.1010601@cogentembedded.com> Date: Tue, 12 Apr 2016 15:58:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1460459419-9487-3-git-send-email-changbin.du@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1346 Lines: 45 Hello. On 4/12/2016 2:10 PM, changbin.du@intel.com wrote: > From: "Du, Changbin" > > For DWC3 USB controller, the Global Debug Queue/FIFO Space Available > Register(GDBGFIFOSPACE) can be used to dump FIFO/Queue available space. Space needed before (. > This can be used to check some special issues, like whether data is > successfully copied from memory to fifo when a trb is blocked. > > Signed-off-by: Du, Changbin > --- > v4: > Do not fail silently, but print error. [...] > diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c > index 615d4dc..83e5bc1 100644 > --- a/drivers/usb/dwc3/debugfs.c > +++ b/drivers/usb/dwc3/debugfs.c [...] > @@ -642,10 +681,15 @@ void dwc3_debugfs_init(struct dwc3 *dwc) > dwc->regset->nregs = ARRAY_SIZE(dwc3_regs); > dwc->regset->base = dwc->regs; > > + Why? > file = debugfs_create_regset32("regdump", S_IRUGO, root, dwc->regset); > if (!file) > dev_err(dwc->dev, "Can't create debugfs regdump\n"); > > + file = debugfs_create_file("fifo", S_IRUGO, root, dwc, &dwc3_fifo_fops); > + if (!file) > + dev_err(dwc->dev, "Can't create debugfs fifo\n"); > + > if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)) { > file = debugfs_create_file("mode", S_IRUGO | S_IWUSR, root, > dwc, &dwc3_mode_fops); MBR, Sergei