From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934755AbcIGKYq (ORCPT ); Wed, 7 Sep 2016 06:24:46 -0400 Received: from mga11.intel.com ([192.55.52.93]:60884 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756391AbcIGKYm (ORCPT ); Wed, 7 Sep 2016 06:24:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,296,1470726000"; d="asc'?scan'208";a="165354957" From: Felipe Balbi To: Arnd Bergmann , Peter Chen Cc: 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: <12021424.cItk3A7CfE@wuerfel> References: <5844875.KucAoPMrXi@wuerfel> <20160907063313.GA13903@b29397-desktop> <12021424.cItk3A7CfE@wuerfel> User-Agent: Notmuch/0.22.1+63~g994277e (https://notmuchmail.org) Emacs/25.1.3 (x86_64-pc-linux-gnu) Date: Wed, 07 Sep 2016 13:24:07 +0300 Message-ID: <87inu8kny0.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: [...] > Regarding the DMA configuration that you mention in ci_hdrc_add_device(), > I think we should replace=20 > > pdev->dev.dma_mask =3D dev->dma_mask; > pdev->dev.dma_parms =3D dev->dma_parms; > dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask); > > with of_dma_configure(), which has the chance to configure more than > just those three, as the dma API might look into different aspects: > > - iommu specific configuration > - cache coherency information > - bus type > - dma offset > - dma_map_ops pointer > > We try to handle everything in of_dma_configure() at configuration > time, and that would be the place to add anything else that we might > need in the future. There are a couple problems with this: 1) won't work for PCI-based systems. DWC3 is used in production PCI-based HW and also in Synopsys HAPS DX platform (FPGA that appears like a PCI card to host PC) 2) not very robust solution of_dma_configure() will hardcode 32-bit DMA dmask for xhci-plat because that's not created by DT. The only reason why this works at all is because of the default 32-bit dma mask thing :-) So, how is it any different than copying 32-bit dma mask from parent? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJXz+rHAAoJEMy+uJnhGpkG2KYP/37UqTd+Eu0ueWLwoDCIQaZE YbtbqeoV34O4qkkcKbDEFd3Kw29Iz02nIntUG0bsvyYNpgsmGdy8B1s8Bi/ATkiO S6UXFre8/muXU005vGzh74Eyv21fWVjjlYbxsyo6BVJj/MAibYoeYyGMR9pnyOXh AsrWyX1OgfbBfSs9Sy0ol6IM9PdRfvyHhwXSBEpr+J9Fc1ILKFAf4pWf9JY9orMj vpkGh3AeXu48Hc7i4UvpucRnvF7yWc5xqKkag3VrHV41pNzXklNF+ahVRk2wxukg +AYNk5Yztn7D2AYM7ZbMw8hBWr8vkXdOXB/sdO5g9BdqjZnIvenMRG4p1brFG1xI 1AsWNBnpasfoYpU98Cn+isD2i9ZCQIWrEur+/+G/IaNFgYWJoTLsG5DTijY/6lHi 3JgFVD87wbUvIGS7THzat1lM3pWRSbCH0VDwK+1sqBq0wT/ICTnLHxtTPtxJQHTZ WrmbUGGOgmtz2LY78LOTe1XBGKO/+Z0ONw6hDZGforE4x9cNfpvJ0oXvP9BxueCy bLFG8XWNHw1QQ02smV48Tx/HjmL4tXEaaQSuZdqQh6n9YUg47EHUs/2dPfiQXR+J W7N2IvLW/6tB8m0eTA2zbRr66B2iBGkW3T2T2DeHkARXAJI+qu5UHWxSPfRRwlGx 6AqDZRq+PbKFZTg05TBG =9Ot6 -----END PGP SIGNATURE----- --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: balbi@kernel.org (Felipe Balbi) Date: Wed, 07 Sep 2016 13:24:07 +0300 Subject: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <12021424.cItk3A7CfE@wuerfel> References: <5844875.KucAoPMrXi@wuerfel> <20160907063313.GA13903@b29397-desktop> <12021424.cItk3A7CfE@wuerfel> Message-ID: <87inu8kny0.fsf@linux.intel.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, Arnd Bergmann writes: [...] > Regarding the DMA configuration that you mention in ci_hdrc_add_device(), > I think we should replace > > pdev->dev.dma_mask = dev->dma_mask; > pdev->dev.dma_parms = dev->dma_parms; > dma_set_coherent_mask(&pdev->dev, dev->coherent_dma_mask); > > with of_dma_configure(), which has the chance to configure more than > just those three, as the dma API might look into different aspects: > > - iommu specific configuration > - cache coherency information > - bus type > - dma offset > - dma_map_ops pointer > > We try to handle everything in of_dma_configure() at configuration > time, and that would be the place to add anything else that we might > need in the future. There are a couple problems with this: 1) won't work for PCI-based systems. DWC3 is used in production PCI-based HW and also in Synopsys HAPS DX platform (FPGA that appears like a PCI card to host PC) 2) not very robust solution of_dma_configure() will hardcode 32-bit DMA dmask for xhci-plat because that's not created by DT. The only reason why this works at all is because of the default 32-bit dma mask thing :-) So, how is it any different than copying 32-bit dma mask from parent? -- balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 800 bytes Desc: not available URL: