From patchwork Thu Jun 6 16:41:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 2682231 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id D70DD40077 for ; Thu, 6 Jun 2013 16:45:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B6E2E671E for ; Thu, 6 Jun 2013 09:45:00 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) by gabe.freedesktop.org (Postfix) with ESMTP id C9426E5C1E for ; Thu, 6 Jun 2013 09:44:47 -0700 (PDT) Received: by mail-qc0-f174.google.com with SMTP id m15so596817qcq.33 for ; Thu, 06 Jun 2013 09:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=3KGR57CgFax5qJ3XqCP9EoPOxaFsDTgjSPykDEB1xZc=; b=HDOI0mNRo2aS5xcGVN6x+iLIAzc5HM+JjTyrKFaVHUXNVXjO6wJoGTAKzcG3AzAL2H sqzIz8sJTr8QiRbd4VtRJEV6CCg+A+QLH2AcLxxuQLLZOit875tXUmCL3jVXgRqb/Wda bWifpnoaNJAqvWiKpiHipRPhZvO6Arpio2RHSxJ2I8Ymw+81coFpqsdLdwsQ0jx5wtFm Ce95UEXDfhiFj4lnuRN51Qu4lJ9B6j+oiIqsXY8NvAboOvlo2s3iVuURiGf9SDvF5o/D GDUPTf/rrOS8/0mKFS8ap7+pRWew+q7f6a+Ws0OUCNVoJcajdH2d7zOTnJp57i6Wphz8 4dIw== X-Received: by 10.49.71.46 with SMTP id r14mr40643688qeu.37.1370537087265; Thu, 06 Jun 2013 09:44:47 -0700 (PDT) Received: from localhost.boston.devel.redhat.com ([66.187.233.206]) by mx.google.com with ESMTPSA id 7sm2182067qad.6.2013.06.06.09.44.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Jun 2013 09:44:46 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: do not try to uselessly update virtual memory pagetable Date: Thu, 6 Jun 2013 12:41:17 -0400 Message-Id: <1370536877-2440-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.11.7 Cc: Jerome Glisse , stable@kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Jerome Glisse If a buffer is never bind to a virtual memory pagetable than don't try to unbind it. Only drawback is that we don't update the pagetable when unbinding the ib pool buffer which is fine because it only happens at suspend or module unload/shutdown. Cc: stable@kernel.org Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_gart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 6e24f84..daf9710 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -1209,11 +1209,13 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev, int radeon_vm_bo_rmv(struct radeon_device *rdev, struct radeon_bo_va *bo_va) { - int r; + int r = 0; mutex_lock(&rdev->vm_manager.lock); mutex_lock(&bo_va->vm->mutex); - r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL); + if (bo_va->soffset) { + r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL); + } mutex_unlock(&rdev->vm_manager.lock); list_del(&bo_va->vm_list); mutex_unlock(&bo_va->vm->mutex);