From patchwork Tue Apr 16 00:35:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karol Herbst X-Patchwork-Id: 10901765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F947922 for ; Tue, 16 Apr 2019 00:35:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39CAA28958 for ; Tue, 16 Apr 2019 00:35:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E99B28961; Tue, 16 Apr 2019 00:35:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEE5928958 for ; Tue, 16 Apr 2019 00:35:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E75C8970E; Tue, 16 Apr 2019 00:35:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 886B589690 for ; Tue, 16 Apr 2019 00:35:36 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id q16so22896678wmj.3 for ; Mon, 15 Apr 2019 17:35:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7oKMEwgvFIAA8GcaSq9cBzivjNSmOSwXh+MwWZJ0IxA=; b=TuvPWWvJSlLj2GWp6ZVCBzdf4HbPCRaPt+eJB6UbUQoznPpb8Ji711mzKdpwRpMGN2 AOXknGz54KLFgAvBU41cMmvz2cujhqtSWHV5BnQtVgjfHHi8wtK9KvLPSteWbTM6+1Mq CC0etLkGAm4wZsnl4Ha0J9FTKNvfwLoelHoBzUggbQNcgg0vjfNXny85UR4ur81zqgOm K7Gmm1MeI4/KJczEnRYmXcIWgOpvuNXAMF1aScoHj7zZomYpQTGJ5TruxxeFRoImTlGu xgYlYnynmAVVC291ICrWMMESh4GxDyWhSQe5LmV15U/A+drHy5+Yl6bTWxjMlh0GrQa1 7PKg== X-Gm-Message-State: APjAAAUIk8dOHR4Byl8BPJs/fmayZtEV1jGTKEg8kjccla1oba6DL+WL msGkuPiUZ3ymyXQrN54bORypsvLolXM= X-Google-Smtp-Source: APXvYqyi4AZ3Eb6gDe7XsHLJwrh4ZT5yYHj3bCorTFDiCFpq9WJAvXBECMm+i9cw9M1LOt7Lzj8S1g== X-Received: by 2002:a7b:c923:: with SMTP id h3mr539338wml.34.1555374934828; Mon, 15 Apr 2019 17:35:34 -0700 (PDT) Received: from kherbst.pingu.com ([2a02:8308:b0be:6900:a1ae:358d:6041:7470]) by smtp.gmail.com with ESMTPSA id w2sm38801268wrm.74.2019.04.15.17.35.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 17:35:33 -0700 (PDT) From: Karol Herbst To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/6] Revert "drm/ttm: make the device list mutex static" Date: Tue, 16 Apr 2019 02:35:22 +0200 Message-Id: <20190416003523.5069-6-kherbst@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190416003523.5069-1-kherbst@redhat.com> References: <20190416003523.5069-1-kherbst@redhat.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Karol Herbst Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 56b3d20413587fab6a790cfc8bc075ca94bc8ed9. Signed-off-by: Karol Herbst --- drivers/gpu/drm/ttm/ttm_bo.c | 14 +++++--------- include/drm/ttm/ttm_bo_driver.h | 1 + 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c0efe4c89baf..99322c3d6573 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -45,11 +45,6 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj); -/** - * ttm_global_mutex - protecting the global BO state - */ -DEFINE_MUTEX(ttm_global_mutex); - static struct attribute ttm_bo_count = { .name = "bo_count", .mode = S_IRUGO @@ -1545,6 +1540,7 @@ int ttm_bo_global_init(struct ttm_bo_global *glob) if (ret) return ret; + mutex_init(&glob->device_list_mutex); spin_lock_init(&glob->lru_lock); glob->mem_glob = &ttm_mem_glob; glob->mem_glob->bo_glob = glob; @@ -1592,9 +1588,9 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev) } } - mutex_lock(&ttm_global_mutex); + mutex_lock(&glob->device_list_mutex); list_del(&bdev->device_list); - mutex_unlock(&ttm_global_mutex); + mutex_unlock(&glob->device_list_mutex); cancel_delayed_work_sync(&bdev->wq); @@ -1641,9 +1637,9 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, bdev->dev_mapping = mapping; bdev->glob = glob; bdev->need_dma32 = need_dma32; - mutex_lock(&ttm_global_mutex); + mutex_lock(&glob->device_list_mutex); list_add_tail(&bdev->device_list, &glob->device_list); - mutex_unlock(&ttm_global_mutex); + mutex_unlock(&glob->device_list_mutex); return 0; out_no_sys: diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 9cec8835b88f..4ae6fc33f761 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -407,6 +407,7 @@ struct ttm_bo_global { struct kobject kobj; struct ttm_mem_global *mem_glob; struct page *dummy_read_page; + struct mutex device_list_mutex; spinlock_t lru_lock; /**