Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760011AbcLPJSZ (ORCPT ); Fri, 16 Dec 2016 04:18:25 -0500 Received: from mga07.intel.com ([134.134.136.100]:14239 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759928AbcLPJSO (ORCPT ); Fri, 16 Dec 2016 04:18:14 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,356,1477983600"; d="asc'?scan'208";a="798643732" From: Felipe Balbi To: Jerry Huang , Jerry Huang , "gregkh\@linuxfoundation.org" Cc: "linux-usb\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , Rajesh Bhagat Subject: RE: [PATCH] USB3/DWC3: Enable undefined length INCR burst type In-Reply-To: References: <1481619983-4782-1-git-send-email-jerry.huang@nxp.com> Date: Fri, 16 Dec 2016 11:16:52 +0200 Message-ID: <87k2b0fd2z.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4147 Lines: 111 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Jerry Huang 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 >> ; Rajesh Bhagat >> Subject: [PATCH] USB3/DWC3: Enable undefined length INCR burst type >>=20 >> While enabling undefined length INCR burst type and INCR16 burst type, g= et >> better write performance on NXP Layerscape platform: >> around 3% improvement (from 364MB/s to 375MB/s). >>=20 >> Signed-off-by: Changming Huang >> Signed-off-by: Rajesh Bhagat >> --- >> drivers/usb/dwc3/core.c | 6 ++++++ >> drivers/usb/dwc3/core.h | 13 +++++++++++++ >> 2 files changed, 19 insertions(+) >>=20 >> 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; >> } >>=20 >> + /* Enable Undefined Length INCR Burst Type and Enable INCR16 >> Burst */ >> + reg =3D dwc3_readl(dwc->regs, DWC3_GSBUSCFG0); >> + reg &=3D ~DWC3_GSBUSCFG0_INCRBRSTMASK; >> + reg |=3D 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 @@ >>=20 >> /* Bit fields */ >>=20 >> +/* 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 =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlhTsQQACgkQzL64meEa mQZe8Q/+PSczBg89BrK1aIfq4n9yH3vorNyk9gpUH8PsPE6IQHLEMfKqSybzfrvn j6dWqXqx2PRfu0YnEvbN9omY9AY6Q83RcOEEpxrgM2ddWk+R72iMBhBxt+pAJ2HI WNHRgE8uYU4ueID3/D5a1s/UPkiJqjAayIVACZBrZT7FSbh3eWJt1TB28Kyd9y8z w/947WvfFW+LzUxnHasbTIDUqqmU8/wH5jnk+YT8ZBkZed/OipEe7kzRa4y1Hjw+ uY6g0G/FHpB3+69UmDwlwkmU2dIeBWoVCx8L0vc7eFMa+dkySi4m8vv/LRhcV5Vp uVgri/onD726r1SUNuXFcKYQM9muTu2gLUldmt1IFJVtBJ+ayR80xyMXRkM0qA3L Htp3IJuVAjnzCOr/ssKVgAxRoSmRAohcfSP9iwkDl/JnUcW4JfPr2n/gnes8KPI3 NxP2ThzFN6QQesnkIuHIwNE4gPSea52C+JkAo0nNBr/phTfKj39q2gmIDVbJ0opm k1O7MzP+V2u06ELMxD4ra26Q9J36r6PO9tijahwD5MpGZ7w7O8Qwus5McwrEyzbc sfU/Qnm52lxQQ0IN42mpaxg3nRlx1SXQ4c6PGJVo7fLamnyo8Ig24RGnSYGQpyiM gEiMp7oXn5DOiX6NqL/txOV79l37tblOHTK5yAtt8hEQIYM0Hdc= =zVjS -----END PGP SIGNATURE----- --=-=-=--