linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Jerry Huang <jerry.huang@nxp.com>,
	Jerry Huang <jerry.huang@nxp.com>,
	"gregkh\@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-usb\@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rajesh Bhagat <rajesh.bhagat@nxp.com>
Subject: RE: [PATCH] USB3/DWC3: Enable undefined length INCR burst type
Date: Fri, 16 Dec 2016 11:16:52 +0200	[thread overview]
Message-ID: <87k2b0fd2z.fsf@linux.intel.com> (raw)
In-Reply-To: <DB5PR0401MB1813A701FA460CA2D5C19C4FFE9C0@DB5PR0401MB1813.eurprd04.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3215 bytes --]


Hi,

Jerry Huang <jerry.huang@nxp.com> writes:
>> -----Original Message-----
>> From: Changming Huang [mailto:jerry.huang@nxp.com]
>> Sent: Tuesday, December 13, 2016 5:06 PM
>> To: balbi@kernel.org; gregkh@linuxfoundation.org
>> Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org; Jerry Huang
>> <jerry.huang@nxp.com>; Rajesh Bhagat <rajesh.bhagat@nxp.com>
>> Subject: [PATCH] USB3/DWC3: Enable undefined length INCR burst type
>> 
>> While enabling undefined length INCR burst type and INCR16 burst type, get
>> better write performance on NXP Layerscape platform:
>> around 3% improvement (from 364MB/s to 375MB/s).
>> 
>> Signed-off-by: Changming Huang <jerry.huang@nxp.com>
>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
>> ---
>>  drivers/usb/dwc3/core.c |    6 ++++++
>>  drivers/usb/dwc3/core.h |   13 +++++++++++++
>>  2 files changed, 19 insertions(+)
>> 
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index
>> fea4469..0e11891 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>> @@ -621,6 +621,12 @@ static int dwc3_core_init(struct dwc3 *dwc)
>>  		goto err0;
>>  	}
>> 
>> +	/* Enable Undefined Length INCR Burst Type and Enable INCR16
>> Burst */
>> +	reg = dwc3_readl(dwc->regs, DWC3_GSBUSCFG0);
>> +	reg &= ~DWC3_GSBUSCFG0_INCRBRSTMASK;
>> +	reg |= DWC3_GSBUSCFG0_INCR16BRSTENA |
>> DWC3_GSBUSCFG0_INCRBRSTENA;
>> +	dwc3_writel(dwc->regs, DWC3_GSBUSCFG0, reg);
>> +
>>  	/*
>>  	 * Write Linux Version Code to our GUID register so it's easy to figure
>>  	 * out which kernel version a bug was found.
>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index
>> 6b60e42..8bfdb77 100644
>> --- a/drivers/usb/dwc3/core.h
>> +++ b/drivers/usb/dwc3/core.h
>> @@ -156,6 +156,19 @@
>> 
>>  /* Bit fields */
>> 
>> +/* Global SoC Bus Configuration Register 0 */
>> +#define DWC3_GSBUSCFG0_DATABIGEND	(1 << 11)
>> +#define DWC3_GSBUSCFG0_DESCBIGEND	(1 << 10)
>> +#define DWC3_GSBUSCFG0_INCR256BRSTENA	(1 << 7)
>> +#define DWC3_GSBUSCFG0_INCR128BRSTENA	(1 << 6)
>> +#define DWC3_GSBUSCFG0_INCR64BRSTENA	(1 << 5)
>> +#define DWC3_GSBUSCFG0_INCR32BRSTENA	(1 << 4)
>> +#define DWC3_GSBUSCFG0_INCR16BRSTENA	(1 << 3)
>> +#define DWC3_GSBUSCFG0_INCR8BRSTENA	(1 << 2)
>> +#define DWC3_GSBUSCFG0_INCR4BRSTENA	(1 << 1)
>> +#define DWC3_GSBUSCFG0_INCRBRSTENA	(1 << 0)
>> +#define DWC3_GSBUSCFG0_INCRBRSTMASK	0xff
>> +
>>  /* Global Debug Queue/FIFO Space Available Register */
>>  #define DWC3_GDBGFIFOSPACE_NUM(n)	((n) & 0x1f)
>>  #define DWC3_GDBGFIFOSPACE_TYPE(n)	(((n) << 5) & 0x1e0)
>> --
> I will split this patch to two, one is for the performance tune, the
> other for macro definition in header file.

there's no need for that. This patch is in good format. I do have a
question, however: how do you know this will work for all users? Burst
size is a function of how wide the interconnect where dwc3 is attached
to, is.

You could very well be degrading performance for some users here. Can
you send me the result of the following commands *without* this patch
applied?

# mkdir -p /d
# mount -t debugfs none /d
# cat /d/*dwc3*/regdump

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2016-12-16  9:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  9:06 [PATCH] USB3/DWC3: Enable undefined length INCR burst type Changming Huang
2016-12-16  3:07 ` Jerry Huang
2016-12-16  9:16   ` Felipe Balbi [this message]
2016-12-16  9:58     ` Jerry Huang
2016-12-16 11:44       ` Felipe Balbi
2016-12-16 16:18         ` Jerry Huang
2016-12-16 17:02           ` Felipe Balbi
2016-12-19  9:16             ` Jerry Huang
2016-12-19  9:19               ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k2b0fd2z.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jerry.huang@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rajesh.bhagat@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).