From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933567AbcIFKva (ORCPT ); Tue, 6 Sep 2016 06:51:30 -0400 Received: from mga05.intel.com ([192.55.52.43]:36725 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933053AbcIFKv2 (ORCPT ); Tue, 6 Sep 2016 06:51:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,291,1470726000"; d="asc'?scan'208";a="1046228584" From: Felipe Balbi To: Arnd Bergmann Cc: Peter Chen , Leo Li , Grygorii Strashko , Russell King - ARM Linux , Catalin Marinas , Yoshihiro Shimoda , "linux-usb\@vger.kernel.org" , Sekhar Nori , lkml , Stuart Yoder , Scott Wood , David Fisher , "Thang Q. Nguyen" , Alan Stern , Greg Kroah-Hartman , "linux-arm-kernel\@lists.infradead.org" Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <4416687.vUjZzKWZG6@wuerfel> References: <20160906063529.GA22312@b29397-desktop> <87bn01o7jg.fsf@linux.intel.com> <4416687.vUjZzKWZG6@wuerfel> User-Agent: Notmuch/0.22.1+63~g994277e (https://notmuchmail.org) Emacs/25.1.3 (x86_64-pc-linux-gnu) Date: Tue, 06 Sep 2016 13:50:48 +0300 Message-ID: <87d1khmhdj.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, Arnd Bergmann writes: > On Tuesday, September 6, 2016 9:40:19 AM CEST Felipe Balbi wrote: >>=20 >> this only solves the problem for DT devices. Legacy devices and >> PCI-based systems will still suffer from the same problem. At least for >> dwc3, I will only be taking patches that solve the problem for all >> users, not a subset of them. > > I don't think legacy devices are a worry, because they wouldn't > have this problem. For the PCI case, you are right that it cannot > work, in particular for machines that have complex IOMMU setup. > > Some architectures (at least arm64 and sparc) check the bus_type of > a device in order to find the correct set of dma_map_ops for that > device, so there is no real way to handle this as long as you > pass a platform_device into an API that expects a pci_device. Then I guess we're left with adding a "struct device *dma_dev" to struct dwc3 and trying to figure out if we should use parent or self. Does anybody see any problems with that? Note, we would NOT be passing device pointers are platform_data, we would have dwc3.ko figure out if it should use self or its parent device for dma. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJXzp+IAAoJEMy+uJnhGpkGvswP/1Qyhlrg1DSY7LGjuP9FNxJt NsnEzc4RJfBLLR02IKBd5rgMrz4I/Phv46PJxtaPjfR3HwBdu+K0O/R560fQeRda SmZgGB38l6envxYTgSAr6YzNodO6/SFsdilIORrs41g2WelYMc6jupqOWjiCYhFx qZs/OeqjH5/PXQvjq1qrfNgqZY5IzzvOIWK9Y2QwWawWtQDcLZ2KLCe/9HtDgVQs AMOA/QRh42JgF6sumi2+7PHuEjhuhliB3TCpisFl916w1iyUrw6vx6Wcg2hp0niz yeBirJK60/XZ6+iIp41kCUpQ3G9KSM+Urd9m1IrZywoTjzZeucT7JYxD9KcQgOII aIrx1tz7t2lMPKtfGiNL+feMndz7JWb3v1NNy1FuUeTuCcycIYiU1b4NyjGvh9us JvySN0/96ddDNb22Hb9IVas8nBzNRYr1DrgGnmomjciHXwOus2zbOZ2iwK1Yuw9+ JlOJyAxyNOP1wnTS4QIekE7Xon2uir9vsaQccckLX4JwGb4ypRD0imMZozrR2Rtq rpYPDHuFFYlpftRoB91cskDpBbonNASAhZDfV3ffTF3inJIAREDnSqGj2zVL49pR IGiYICjrZlOFhFJ5VcOfc406SuiK6Ip0G4kXY1PRMOTsePyVpyf3OwYsmEiIvE9L tK0UxfIkPHC9DZiRMLsw =ERHJ -----END PGP SIGNATURE----- --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: balbi@kernel.org (Felipe Balbi) Date: Tue, 06 Sep 2016 13:50:48 +0300 Subject: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <4416687.vUjZzKWZG6@wuerfel> References: <20160906063529.GA22312@b29397-desktop> <87bn01o7jg.fsf@linux.intel.com> <4416687.vUjZzKWZG6@wuerfel> Message-ID: <87d1khmhdj.fsf@linux.intel.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, Arnd Bergmann writes: > On Tuesday, September 6, 2016 9:40:19 AM CEST Felipe Balbi wrote: >> >> this only solves the problem for DT devices. Legacy devices and >> PCI-based systems will still suffer from the same problem. At least for >> dwc3, I will only be taking patches that solve the problem for all >> users, not a subset of them. > > I don't think legacy devices are a worry, because they wouldn't > have this problem. For the PCI case, you are right that it cannot > work, in particular for machines that have complex IOMMU setup. > > Some architectures (at least arm64 and sparc) check the bus_type of > a device in order to find the correct set of dma_map_ops for that > device, so there is no real way to handle this as long as you > pass a platform_device into an API that expects a pci_device. Then I guess we're left with adding a "struct device *dma_dev" to struct dwc3 and trying to figure out if we should use parent or self. Does anybody see any problems with that? Note, we would NOT be passing device pointers are platform_data, we would have dwc3.ko figure out if it should use self or its parent device for dma. -- balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 800 bytes Desc: not available URL: