All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 1/1] drm/amdkfd: Remove redundant pdd validation
@ 2015-06-29  4:33 ` Maninder Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Maninder Singh @ 2015-06-29  4:33 UTC (permalink / raw)
  To: oded.gabbay, airlied, dri-devel, linux-kernel; +Cc: pankaj.m, Maninder Singh

pdd is already dereferenced before this check.
So it is redundtant to validate pdd here.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 8a1f999..4dbc4e5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -431,8 +431,7 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid)
 	 * We don't call amd_iommu_unbind_pasid() here
 	 * because the IOMMU called us.
 	 */
-	if (pdd)
-		pdd->bound = false;
+	pdd->bound = false;
 
 	mutex_unlock(&p->mutex);
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RFC][PATCH 1/1] drm/amdkfd: Remove redundant pdd validation
@ 2015-06-29  4:33 ` Maninder Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Maninder Singh @ 2015-06-29  4:33 UTC (permalink / raw)
  To: oded.gabbay, airlied, dri-devel, linux-kernel; +Cc: Maninder Singh, pankaj.m

pdd is already dereferenced before this check.
So it is redundtant to validate pdd here.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 8a1f999..4dbc4e5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -431,8 +431,7 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid)
 	 * We don't call amd_iommu_unbind_pasid() here
 	 * because the IOMMU called us.
 	 */
-	if (pdd)
-		pdd->bound = false;
+	pdd->bound = false;
 
 	mutex_unlock(&p->mutex);
 }
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 1/1] drm/amdkfd: Remove redundant pdd validation
  2015-06-29  4:33 ` Maninder Singh
@ 2015-07-09  8:47   ` Oded Gabbay
  -1 siblings, 0 replies; 4+ messages in thread
From: Oded Gabbay @ 2015-07-09  8:47 UTC (permalink / raw)
  To: Maninder Singh
  Cc: David Airlie, Maling list - DRI developers,
	Linux-Kernel@Vger. Kernel. Org, pankaj.m

On Mon, Jun 29, 2015 at 7:33 AM, Maninder Singh <maninder1.s@samsung.com> wrote:
>
> pdd is already dereferenced before this check.
> So it is redundtant to validate pdd here.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index 8a1f999..4dbc4e5 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -431,8 +431,7 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid)
>          * We don't call amd_iommu_unbind_pasid() here
>          * because the IOMMU called us.
>          */
> -       if (pdd)
> -               pdd->bound = false;
> +       pdd->bound = false;
>
>         mutex_unlock(&p->mutex);
>  }
> --
> 1.7.9.5
>
Hi Maninder,

You are correct pdd was already dereferenced so this check is
redundant. However, I think a better patch would be to move the check
to where pdd is first acquired (a few lines above it), because I don't
see there any check.

Could you please do that and resend the patch ? Use latest v4.2-rc1
label from Linus please.

Thansk,

   Oded

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC][PATCH 1/1] drm/amdkfd: Remove redundant pdd validation
@ 2015-07-09  8:47   ` Oded Gabbay
  0 siblings, 0 replies; 4+ messages in thread
From: Oded Gabbay @ 2015-07-09  8:47 UTC (permalink / raw)
  To: Maninder Singh
  Cc: Linux-Kernel@Vger. Kernel. Org, Maling list - DRI developers, pankaj.m

On Mon, Jun 29, 2015 at 7:33 AM, Maninder Singh <maninder1.s@samsung.com> wrote:
>
> pdd is already dereferenced before this check.
> So it is redundtant to validate pdd here.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index 8a1f999..4dbc4e5 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -431,8 +431,7 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid)
>          * We don't call amd_iommu_unbind_pasid() here
>          * because the IOMMU called us.
>          */
> -       if (pdd)
> -               pdd->bound = false;
> +       pdd->bound = false;
>
>         mutex_unlock(&p->mutex);
>  }
> --
> 1.7.9.5
>
Hi Maninder,

You are correct pdd was already dereferenced so this check is
redundant. However, I think a better patch would be to move the check
to where pdd is first acquired (a few lines above it), because I don't
see there any check.

Could you please do that and resend the patch ? Use latest v4.2-rc1
label from Linus please.

Thansk,

   Oded
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-09  8:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29  4:33 [RFC][PATCH 1/1] drm/amdkfd: Remove redundant pdd validation Maninder Singh
2015-06-29  4:33 ` Maninder Singh
2015-07-09  8:47 ` Oded Gabbay
2015-07-09  8:47   ` Oded Gabbay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.