From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Date: Mon, 19 Nov 2018 00:20:23 +0000 Subject: Re: [PATCH kernel v3 15/22] powerpc/powernv: Reference iommu_table while it is linked to a group Message-Id: <20181119002023.GB4878@umbus> MIME-Version: 1 Content-Type: multipart/mixed; boundary="IiVenqGWf+H9Y6IX" List-Id: References: <20181113082823.2440-1-aik@ozlabs.ru> <20181113082823.2440-16-aik@ozlabs.ru> In-Reply-To: <20181113082823.2440-16-aik@ozlabs.ru> To: Alexey Kardashevskiy Cc: Alex Williamson , Jose Ricardo Ziviani , Sam Bobroff , Alistair Popple , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, Piotr Jaroszynski , Oliver O'Halloran , Andrew Donnellan , Leonardo Augusto =?iso-8859-1?Q?Guimar=E3es?= Garcia , Reza Arbab --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 13, 2018 at 07:28:16PM +1100, Alexey Kardashevskiy wrote: > The iommu_table pointer stored in iommu_table_group may get stale > by accident, this adds referencing and removes a redundant comment > about this. >=20 > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson > --- > arch/powerpc/platforms/powernv/pci-ioda-tce.c | 3 ++- > arch/powerpc/platforms/powernv/pci-ioda.c | 4 ---- > 2 files changed, 2 insertions(+), 5 deletions(-) >=20 > diff --git a/arch/powerpc/platforms/powernv/pci-ioda-tce.c b/arch/powerpc= /platforms/powernv/pci-ioda-tce.c > index 7639b21..697449a 100644 > --- a/arch/powerpc/platforms/powernv/pci-ioda-tce.c > +++ b/arch/powerpc/platforms/powernv/pci-ioda-tce.c > @@ -368,6 +368,7 @@ void pnv_pci_unlink_table_and_group(struct iommu_tabl= e *tbl, > found =3D false; > for (i =3D 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) { > if (table_group->tables[i] =3D=3D tbl) { > + iommu_tce_table_put(tbl); > table_group->tables[i] =3D NULL; > found =3D true; > break; > @@ -393,7 +394,7 @@ long pnv_pci_link_table_and_group(int node, int num, > tgl->table_group =3D table_group; > list_add_rcu(&tgl->next, &tbl->it_group_list); > =20 > - table_group->tables[num] =3D tbl; > + table_group->tables[num] =3D iommu_tce_table_get(tbl); > =20 > return 0; > } > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/pla= tforms/powernv/pci-ioda.c > index 7f4904a..7caf373 100644 > --- a/arch/powerpc/platforms/powernv/pci-ioda.c > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c > @@ -2716,10 +2716,6 @@ static long pnv_pci_ioda2_npu_unset_window( > =20 > static void pnv_ioda2_npu_take_ownership(struct iommu_table_group *table= _group) > { > - /* > - * Detach NPU first as pnv_ioda2_take_ownership() will destroy > - * the iommu_table if 32bit DMA is enabled. > - */ > pnv_npu_take_ownership(gpe_table_group_to_npe(table_group)); > pnv_ioda2_take_ownership(table_group); > } --=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 --IiVenqGWf+H9Y6IX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlvyAccACgkQbDjKyiDZ s5IVpxAA1SXEVSeIKnLBOYgRXmPUn5QY5sjTW3oqzhOuqR7UcWLrcytN2j9o/SR2 4RGJBObyj/vg34I5og6MVXP3wQjBKdZRbTBQ79+0jopPgXf/yZvnb1QwMT5sKmjQ 11MDZe6KafIzZE1FTsWbhuEDtsnmAmW4NBptI7DG6c8iwoMq0SIBvOcG5X6+otSV dB3mUYWeR/BPNkn98H6rP/6g1WDX6kO+z8qiUnLzS0ncDWCZl6PW+1urURYDV3sF PA8B35/GnTNDJTtm5lm/rUdlOk43X1iOIcRM+ZWW76Cu22GqPCWifZ1fIqj70mII Kb56czskvDIsiMtGMMr+/Zd3u2b7lzj9CMAbTYmYN1/Aj4LZzU3IgGYOpS21mxo+ k6twPCA6fJ/HH87Eqyzm+tWmivsSiFlPDeRxCZEKFNcdZBf3IM26cBSb1VcJ8fiI W9XTLgRlhxwm+hnQhTnjqQjr6SDnByXqdsj6LCC+XJbjotW4hqLLHcz54JKqNXVf /zLsytHIgfBCqQpC/dIuq7+pkOKsr8+VJ5OkWQJe8f8vkGo/5WIO1hEGuy05EZ0L Pd2BJWU9/3TpElXe8oKOWR50f8Jg0/JTilcysxUVi/lDqglLSZVGfMnCHNGAFxes xLNOeUzUCd/ocTaLU957144w/lCNDJo4v+g4WLUt23u3H2AaScQ= =K+nv -----END PGP SIGNATURE----- --IiVenqGWf+H9Y6IX--