From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753115AbcFFO71 (ORCPT ); Mon, 6 Jun 2016 10:59:27 -0400 Received: from mga11.intel.com ([192.55.52.93]:50336 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbcFFO7Z (ORCPT ); Mon, 6 Jun 2016 10:59:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,427,1459839600"; d="asc'?scan'208";a="822651799" From: Felipe Balbi To: Baolin Wang , gregkh@linuxfoundation.org Cc: broonie@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org Subject: Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device In-Reply-To: <3f7a77848164a753b8918925f69aa0fd6c985850.1465192322.git.baolin.wang@linaro.org> References: <3f7a77848164a753b8918925f69aa0fd6c985850.1465192322.git.baolin.wang@linaro.org> User-Agent: Notmuch/0.22+11~g124a67e (http://notmuchmail.org) Emacs/25.0.93.2 (x86_64-pc-linux-gnu) Date: Mon, 06 Jun 2016 17:59:08 +0300 Message-ID: <8760tmcqir.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-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Baolin Wang writes: > On ARM64 platform, it will set 'dummy_dma_ops' for device dma_ops if > it did not call 'arch_setup_dma_ops' at device creation time, that will > cause failure when setting the dma mask for device. > > Thus this patch set the xhci device dma_ops from the parent device if > the xhci device dma_ops is 'dummy_dma_ops'. > > Changes since v1: > - Add CONFIG_ARM64 macro. > > Signed-off-by: Baolin Wang > --- > drivers/usb/dwc3/host.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c > index c679f63..edb666d 100644 > --- a/drivers/usb/dwc3/host.c > +++ b/drivers/usb/dwc3/host.c > @@ -32,6 +32,11 @@ int dwc3_host_init(struct dwc3 *dwc) > return -ENOMEM; > } >=20=20 > +#ifdef CONFIG_ARM64 > + if (get_dma_ops(&xhci->dev) =3D=3D get_dma_ops(NULL)) > + xhci->dev.archdata.dma_ops =3D get_dma_ops(dwc->dev); > +#endif I don't like the ifdef and also don't like that this is done in dwc3 itself. Seems like we need something like this done from the platform_bus core. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXVY+8AAoJEIaOsuA1yqREQDcP+wTLdwoos0hUlGq6FKrmryGm VKqcH/yWh7PYfMjoLrlIePqx/qd2S6YTdzKNdHjUQzr0LBPrElZ0N21TkSS31JeY Ao3B1tEC+p52GHweKt81NZ/VyK4pGgS4IaijSMQJ/HcXAA8plEsUuA7ICNAzoGFv 3FxsNJ2V2lM/Vlsc26LAFH4992ALaWhjuCJd77aQ3TYJjjT2A16XKd6boPIL2hdz bYfX+e7PM16fUzQRItg0/7y4RwTKuUvzkrlfLIfI8cxAEuxrcQBuUadVYH2K63H5 nR1HP3SRfX4UfeKYXTAxoNhzBBoTZBIfY6JU1aKMvfyo0sCMwAxOD1eUP6TH0ENS KnDd1zC0ulGM80cyZ4zPEOoF9KJxQBs7/uK7Cvud8MbdJAiRSRnEw7NgvSckcL/T XWlPmI8VQWi/ml+pp5dVTI12/zJsbVHCU5W7tpFBMFTR+DJ3dUufuuSCFUQSYYX8 MdQZnqA91Rtxm4KDU92mY2aj/UvorKIpMN4k5WZ2TqIjfRqsASMJfD6oHfZAZtEv PySrX2DNwggP2etCzN2WWl/nR+Rzd2UnVdeJJ3ChtbSN09OUBRwVWfX3ALg9WSFy RdqJrC5JvR5KLy3/ZM7ltNyMapt/I+Fftol5kyO1FacM83d0+Ra2UEXZpsb/Irob TtOTB6MYR4zlCWiTq0bA =8hL1 -----END PGP SIGNATURE----- --=-=-=--