Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212AbcKJLCv (ORCPT ); Thu, 10 Nov 2016 06:02:51 -0500 Received: from mga01.intel.com ([192.55.52.88]:57778 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754601AbcKJLCu (ORCPT ); Thu, 10 Nov 2016 06:02:50 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,618,1473145200"; d="asc'?scan'208";a="1057806979" From: Felipe Balbi To: Sriram Dash , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org, suresh.gupta@nxp.com, stern@rowland.harvard.edu, pku.leo@gmail.com, Arnd Bergmann , Sriram Dash Subject: Re: [PATCH v3 5/6] usb: dwc3: use bus->sysdev for DMA configuration In-Reply-To: <1478766001-26463-6-git-send-email-sriram.dash@nxp.com> References: <1478766001-26463-1-git-send-email-sriram.dash@nxp.com> <1478766001-26463-6-git-send-email-sriram.dash@nxp.com> Date: Thu, 10 Nov 2016 13:02:11 +0200 Message-ID: <87fumzha30.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: 3520 Lines: 112 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Sriram Dash writes: > From: Arnd Bergmann > > The dma ops for dwc3 devices are not set properly. So, use a > physical device sysdev, which will be inherited from parent, > to set the hardware / firmware parameters like dma. > > Signed-off-by: Arnd Bergmann > Signed-off-by: Sriram Dash > --- > Changes in v3: > - No update > > Changes in v2: > - integrate dwc3 driver changes together > > drivers/usb/dwc3/core.c | 28 +++++++++++++++------------- > drivers/usb/dwc3/core.h | 1 + > drivers/usb/dwc3/ep0.c | 8 ++++---- > drivers/usb/dwc3/gadget.c | 37 +++++++++++++++++++------------------ > drivers/usb/dwc3/host.c | 12 ++++-------- > 5 files changed, 43 insertions(+), 43 deletions(-) > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 7287a76..0af0dc0 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include I'd prefer to add a device property instead of checking for PCI bus type. > @@ -943,6 +944,13 @@ static int dwc3_probe(struct platform_device *pdev) > dwc =3D PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1); > dwc->mem =3D mem; > dwc->dev =3D dev; > +#ifdef CONFIG_PCI > + /* TODO: or some other way of detecting this? */ > + if (dwc->dev->parent && dwc->dev->parent->bus =3D=3D &pci_bus_type) > + dwc->sysdev =3D dwc->dev->parent; > + else > +#endif IOW: dwc->sysdev_is_parent =3D device_property_read_bool(dev, "linux,sysdev_is_parent"); [...] if (dwc->sysdev_is_parent) dwc->sysdev =3D dwc->dev->parent; else dwc->sysdev =3D dwc->dev; > @@ -112,9 +108,9 @@ int dwc3_host_init(struct dwc3 *dwc) > return 0; > err2: > phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy", > - dev_name(&xhci->dev)); > + dev_name(dwc->dev)); > phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy", > - dev_name(&xhci->dev)); > + dev_name(dwc->dev)); > err1: > platform_device_put(xhci); > return ret; > @@ -123,8 +119,8 @@ int dwc3_host_init(struct dwc3 *dwc) > void dwc3_host_exit(struct dwc3 *dwc) > { > phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy", > - dev_name(&dwc->xhci->dev)); > + dev_name(dwc->dev)); > phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy", > - dev_name(&dwc->xhci->dev)); > + dev_name(dwc->dev)); this looks unrelated to $subject. Care to explain? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYJFOzAAoJEMy+uJnhGpkGaQAP/02qoXOXgKr+MupEHIR1mb6s 9pkUCvaUypHB8/G6BnvNAABZZZlSyeZheeb+jnGKTtPGw4sEdj3QEi59xPv0prHL pGisXm2lVihWiHzuC1TgqgIj+pujzEB1zb1h1qMkFPrwOVaOTjBV1qjd2CMHtD1h WZP5bENYlzkBvbBoWKeA6m9xsRDvBa+rrEoarGLyhXvLFF8AO2qBHqdRqZ14g4Sv f4SQBUCFfafCyvbJ8LcQQFWNInsBSbBxCWrZQuIvvvflrHN1kc6Fx2IuBnEyJvk5 qkXu1Feh3kAhVhxNvdbr0G/0VNrXPffEkOaoI38ujDQbdQFx6w0347p4fknDPcj0 0Gn9cz2bH1WUZBu3xAxcdgZxKnJyUSOlBUr58krZhBhsPSvPTYDngvOuUEPfvqIm 6EI/O+SzbhJ2w7Whnqc+LxjXD8ZmE5aGrDue8BtrXodfvDu6pEGc0apRE+PbmgHm Rc5aOqJ7utCaQUonFBVKGhNVoftmpY3p2jNeFwecp6XTSIQCjJHQQ/8K4vvIeKBi chBqKAmJC4G7UAjbIkUn0SqVRmqd7TckO7lau/hAxY6F2PKquwiw9I813HaPMJ7q 6hfZecY5yYqty55ObsALhmqJjdET2YGLip+cWWi7cO27KBFIalSRz594pkAiI3Sh 5A8nt9Ih31CzFVj7DK0j =CwJy -----END PGP SIGNATURE----- --=-=-=--