From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [RFC 09/10] drm/tegra: Add IOMMU support Date: Wed, 5 Nov 2014 10:50:05 +0100 Message-ID: <20141105095003.GA12458@ulmo.nvidia.com> References: <1403815790-8548-1-git-send-email-thierry.reding@gmail.com> <1403815790-8548-10-git-send-email-thierry.reding@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5277356299868273657==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Sean Paul Cc: Mark Rutland , Will Deacon , Paul Walmsley , Pawel Moll , Ian Campbell , Marc Zyngier , Dave Martin , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Arnd Bergmann , Stephen Warren , Grant Grundler , Allen Martin , Rob Herring , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Cho KyongHo , Linux ARM Kernel , =?utf-8?B?U3TDqXBoYW5l?= Marchesin , Linux Kernel Mailing List , Linux IOMMU , Kumar Gala , Rhyland Klein List-Id: devicetree@vger.kernel.org --===============5277356299868273657== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 01, 2014 at 11:54:11AM -0400, Sean Paul wrote: > On Tue, Sep 30, 2014 at 2:48 PM, Sean Paul wrote: > > On Thu, Jun 26, 2014 at 4:49 PM, Thierry Reding wrote: > >> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c [...] > >> static void tegra_bo_destroy(struct drm_device *drm, struct tegra_bo = *bo) > >> { > >> - dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr, bo->p= addr); > >> + if (!bo->pages) > >> + dma_free_writecombine(drm->dev, bo->gem.size, bo->vadd= r, > >> + bo->paddr); >=20 > One more thing. If tegra_bo_alloc fails, we'll have bo->vaddr =3D=3D NULL > and bo->paddr =3D=3D ~0 here, which causes a crash. >=20 > I posted https://lkml.org/lkml/2014/9/30/659 to check for the error > condition in the mm code, but it seems like reviewer consensus is to > check for this before calling free. >=20 > As such, we'll need to make sure bo->vaddr !=3D NULL before calling > dma_free_writecombine to avoid this situation. >=20 > Would you prefer I send a patch up to fix this separately, or would > you like to roll this into your next version? I've rolled this check into my series because I touch that area of code anyway. Thanks for bringing it up. Thierry --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUWfLLAAoJEN0jrNd/PrOhGdMP/jgzGHvv3uBF15GkJMhy8wdT 5DdyMqhvriyDDD3JykETF/i2O++tGUIGzZH4fZNwtJE/UGRASu8Qxiuk7e8MecFv lxEWpRCUiVsDs8HC4Aw2E9s8pKKZ9a9PBTuLcxCoqUj5sIK/ds35Fmnuzsx2usft H5cQ6Yu4ASajJL3bsTjX9+9BWh5okF6NvfnVqu3xF5QwB8MeJaSg2WIZf9FSLOc5 /TtunrbukX8HjJXygQcNZMYOM8cxhzcBrDGerHhXGPMNRVnprbXDkdN4CrRvHhcu 0kI0ig5DVqYJL2UJfFZodoTHy2fnskvf1QTZRxLtEBcqdR3YN885mKEP0F0Dvdw+ F2SFtj3HB2NwF7fX5omWwYWUa6FwOGbScXApGXQYH6nSvrSfvYfBopOTj9cfsoHb LCQm1qxQJEIz0B83AYqi7EJ5UsPdaHo7xWOKAPsyYUUD0Gjttv49ICZAH92xyr2G L1l2SbV6dXctvupjfszn5pkzpH2x2lvUyIooaEbDxr+LFUl+mDZ0RiEYG+hq2GGT ht2nOR74nr80bq3PhyT/WfPBsm7k2BCTKVk2G/0ozNV8MVD//k8FvmSTXIr7Cgah tDxrwz8Rg63AIDCbHSgkGERmXAhCCiJa+V2fzXNziRsdVlyBGLs3y8pK3j2Z0U0A m70Q9GfLzPbbYQ5KpMoe =bxPN -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD-- --===============5277356299868273657== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5277356299868273657==--