From patchwork Thu Nov 8 01:55:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10673347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9440B13A4 for ; Thu, 8 Nov 2018 01:55:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FF042C945 for ; Thu, 8 Nov 2018 01:55:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7431F2CABF; Thu, 8 Nov 2018 01:55:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 135552C945 for ; Thu, 8 Nov 2018 01:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728518AbeKHL2N (ORCPT ); Thu, 8 Nov 2018 06:28:13 -0500 Received: from smtprelay4.synopsys.com ([198.182.47.9]:38962 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeKHL2M (ORCPT ); Thu, 8 Nov 2018 06:28:12 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 2F21824E03F1; Wed, 7 Nov 2018 17:55:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541642108; bh=FGrqQGQLdWbs5ytV3gRiobp/Df28YdCuisyfls0ACHI=; h=Date:In-Reply-To:References:From:Subject:To:CC:From; b=lRiOQO/0jN7VOtFPxNEUSPQsQP409z7sZpwddNek4Dd4kDvPL6QHrbclRYlF+ky8f Ti4WG296FkAJ3svqdPoGjHJaCVxwFRpldrab5r5Meel6cA7n+c+qpiVPeL7sx+1+EH YO8oL4+B4zEaW01pncCSRDmdAj61XoBlU1dORIrP2+JWCflpMgkI6dKWVuBZC3dfpV /8ZGXl0nCkd/Ah4+CdDe7dobTxo5xEEHQZpozRJ3ZDyqAcfCP7pnIuVmcjEoEIcQTK seuy1yAJ3IqS/3KUXpT3VhZFhqMezG3AQM0UzqM05YOURXagZ51MhXDNZkj3gWJwkY D1camn1NIlpdQ== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2-vip.internal.synopsys.com [10.12.239.238]) by mailhost.synopsys.com (Postfix) with ESMTP id 13DBC587A; Wed, 7 Nov 2018 17:55:08 -0800 (PST) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 17:55:08 -0800 Received: from te-lab16 (10.13.184.20) by us01wehtc1.internal.synopsys.com (10.12.239.236) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 17:55:06 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Wed, 07 Nov 2018 17:55:06 -0800 Date: Wed, 7 Nov 2018 17:55:06 -0800 Message-ID: <6a7aa15d180186cce33af5a351beb4ad0552c9f9.1541641164.git.thinhn@synopsys.com> In-Reply-To: References: From: Thinh Nguyen Subject: [PATCH v2 2/5] usb: dwc3: debugfs: Print eps Tx/RxFIFO in bytes To: Felipe Balbi , CC: John Youn MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TxFIFO and RxFIFO from GDBGFIFOSPACE are fifo depths in MDWIDTH. Convert them into bytes for easier read. Signed-off-by: Thinh Nguyen --- Change in v2: - New patch, no previous change drivers/usb/dwc3/debugfs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index 17238bbe9733..bd3d75b2f8bc 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c @@ -505,6 +505,10 @@ static int dwc3_tx_fifo_size_show(struct seq_file *s, void *unused) spin_lock_irqsave(&dwc->lock, flags); val = dwc3_core_fifo_space(dep, DWC3_TXFIFO); + + /* Convert to bytes */ + val *= DWC3_MDWIDTH(dwc->hwparams.hwparams0); + val >>= 3; seq_printf(s, "%u\n", val); spin_unlock_irqrestore(&dwc->lock, flags); @@ -520,6 +524,10 @@ static int dwc3_rx_fifo_size_show(struct seq_file *s, void *unused) spin_lock_irqsave(&dwc->lock, flags); val = dwc3_core_fifo_space(dep, DWC3_RXFIFO); + + /* Convert to bytes */ + val *= DWC3_MDWIDTH(dwc->hwparams.hwparams0); + val >>= 3; seq_printf(s, "%u\n", val); spin_unlock_irqrestore(&dwc->lock, flags);