Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751923AbbD3Aia (ORCPT ); Wed, 29 Apr 2015 20:38:30 -0400 Received: from ozlabs.org ([103.22.144.67]:36087 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750986AbbD3Ai3 (ORCPT ); Wed, 29 Apr 2015 20:38:29 -0400 Date: Thu, 30 Apr 2015 10:13:27 +1000 From: David Gibson To: Alexey Kardashevskiy Cc: linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras , Alex Williamson , Gavin Shan , linux-kernel@vger.kernel.org Subject: Re: [PATCH kernel v9 17/32] powerpc/powernv: Implement accessor to TCE entry Message-ID: <20150430001327.GZ32589@voom.redhat.com> References: <1429964096-11524-1-git-send-email-aik@ozlabs.ru> <1429964096-11524-18-git-send-email-aik@ozlabs.ru> <20150429040436.GN32589@voom.redhat.com> <55409E19.3090204@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3rx43rDlPB5nB2+S" Content-Disposition: inline In-Reply-To: <55409E19.3090204@ozlabs.ru> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3734 Lines: 102 --3rx43rDlPB5nB2+S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 29, 2015 at 07:02:17PM +1000, Alexey Kardashevskiy wrote: > On 04/29/2015 02:04 PM, David Gibson wrote: > >On Sat, Apr 25, 2015 at 10:14:41PM +1000, Alexey Kardashevskiy wrote: > >>This replaces direct accesses to TCE table with a helper which > >>returns an TCE entry address. This does not make difference now but will > >>when multi-level TCE tables get introduces. > >> > >>No change in behavior is expected. > >> > >>Signed-off-by: Alexey Kardashevskiy > > > >Reviewed-by: David Gibson > > > > > >>--- > >>Changes: > >>v9: > >>* new patch in the series to separate this mechanical change from > >>functional changes; this is not right before > >>"powerpc/powernv: Implement multilevel TCE tables" but here in order > >>to let the next patch - "powerpc/iommu/powernv: Release replaced TCE" - > >>use pnv_tce() and avoid changing the same code twice > >>--- > >> arch/powerpc/platforms/powernv/pci.c | 34 +++++++++++++++++++++------= ------- > >> 1 file changed, 21 insertions(+), 13 deletions(-) > >> > >>diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platfo= rms/powernv/pci.c > >>index 84b4ea4..ba75aa5 100644 > >>--- a/arch/powerpc/platforms/powernv/pci.c > >>+++ b/arch/powerpc/platforms/powernv/pci.c > >>@@ -572,38 +572,46 @@ struct pci_ops pnv_pci_ops =3D { > >> .write =3D pnv_pci_write_config, > >> }; > >> > >>+static __be64 *pnv_tce(struct iommu_table *tbl, long idx) > >>+{ > >>+ __be64 *tmp =3D ((__be64 *)tbl->it_base); > >>+ > >>+ return tmp + idx; > >>+} > >>+ > >> int pnv_tce_build(struct iommu_table *tbl, long index, long npages, > >> unsigned long uaddr, enum dma_data_direction direction, > >> struct dma_attrs *attrs) > >> { > >> u64 proto_tce =3D iommu_direction_to_tce_perm(direction); > >>- __be64 *tcep; > >>- u64 rpn; > >>+ u64 rpn =3D __pa(uaddr) >> tbl->it_page_shift; > > > >I guess this was a problem in the existing code, not this patch. But > >"uaddr" is a really bad name (and unsigned long is a bad type) for > >what must actually be a kernel linear mapping address. >=20 >=20 > Yes and may be one day I'll clean this up. s/uaddr/linear/ and s/hwaddr/h= pa/ > are the first things to do globally but not in this patchset. Ok. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --3rx43rDlPB5nB2+S Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVQXOnAAoJEGw4ysog2bOSrQMP/1Ar5IePUlCg1JjlkWDqe7ab AJlizBRTnjgdKo7Mf53y6kBx/uZe3mgr5QQNnLcXl+KoWlXOiCI5yX83qeDGsbc6 RteWzju76A6373beQA1YKXXRraMnWY/sted0h8flaMB/NPHFgWIcZOByNaiPscyO eDNIbU+8SslCFHNc1/d+r7gTxhQnq8t0R/MLabKsVz594/D3xg4ehY0RV9ZZep+s UhsO29o0VGGlgRScj9N8ZCiu4Hmrs9L86lE2s3x9ZkODulJ4xgRcvuEMsS2/1RVf +rmWbdE7VVtL3XeSkcK2plaleOrT/Suw16wI3fRxDyJbhtKVnRhJdEf9BJ1/Hr6u 1ceVCo+VI7xVv8ltZ8mZ4uBhlWW2xjYcj2NVXV4uK7HkvV6famdVhfuZTbTpLIJB 8vkyCX3nQaOwHnHzKr/BUjxPnQXFibsEpn7+w2jFsYwmpwnaSGzR1/JoBB52qZ72 ZXpw0uU6LbumacG7PUYYaqB109oziTYY0zhcuQUv0Ia6TUcJDMzp4rbav7NLYaFc tA0vO7/SSWE9CWfXGcuqtRyB3biXNryWG70EuJ8QBBE8HsFK4xz8LPR57Q/v10Dx gQO2E3j5IE2RSMeJ8xxTczsuaz6XuWi6KhrUgX12EzReVlMDu29tk80s9TYDVLRo aKgODyOqFRq/DiTYzyky =1jJK -----END PGP SIGNATURE----- --3rx43rDlPB5nB2+S-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/