From patchwork Wed Jul 21 15:23:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Ekstrand X-Patchwork-Id: 12391289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89636C636CA for ; Wed, 21 Jul 2021 15:25:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5BEB661019 for ; Wed, 21 Jul 2021 15:25:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BEB661019 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jlekstrand.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E76456EB5C; Wed, 21 Jul 2021 15:25:06 +0000 (UTC) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by gabe.freedesktop.org (Postfix) with ESMTPS id 182866E9A4 for ; Wed, 21 Jul 2021 15:25:05 +0000 (UTC) Received: by mail-pj1-x1032.google.com with SMTP id jx7-20020a17090b46c7b02901757deaf2c8so1267701pjb.0 for ; Wed, 21 Jul 2021 08:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jlekstrand-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BhkbkDYY5lvapWHEYykIm8DO+eSuMufmOfIOn+p1+24=; b=ICuQed88N2DSLox8+2+WLSYjWX9567etIPd6e2gZVhN5e9WAwnSsnYltZ0bOQncTA2 PDSqyDltnwfZ+8eTQNYEjRO14OClQbNt256BFV9i8zepxyvIZxA7PSkpUKoF+wMONJeE RHbke94hJmTDTWCtXDUp/HVe50qgC5PFNqzwpiZ4kAMhL2537ofK5aqZidAFl2eOQEf1 U1oXDkZToBXBqokztVEvNieliqQRpJpWBT/4u4pUtuD9chViEfVfbX8UUpkF1XYgooC8 CO5nTp8+aF1iEZvcybwx2iAYbB6OLg5cutw+jpqnkVe2TPiC3qVUamwr7Hcj1QWnIigs C3mA== 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=BhkbkDYY5lvapWHEYykIm8DO+eSuMufmOfIOn+p1+24=; b=HrTjUJC7R1U5vWU+fCjOb4fpUIjdoz0olOTfX8JWMHO1/ZHu2KdMcdfmtr7xclL+I7 2alDvqgyed1VmC3q+Hbvd2kXqSZi2urxutWcS4Ven2UeAhy96u3B6gCuGdpwYBBKm7Su BOroD6IhCFYaRrVtTFzlh9ljBY33E1b0s1yy1HHwlSggTkZV8IfIJlRgAAhhPv+P8ejH ctR9nzuJiP09PPArp3Nf4IG786yZnDRlTXLxo5pUsPCwVz1g158M+OBnj/ZtKOu9tnDF VoNSIUfNozWQ+5F8oh3mQkf10wHobjC1T4nu/WP3CLAc4pBkZy4Rvuju+jFUdNlXsKX1 l7wA== X-Gm-Message-State: AOAM5315BrFKOjoYslpXQB9KoGJSmG7TceI7g2ZfmxOXm7PuFMP627pp iEowzPASEz7fz7/N6Ul77dbqPiaZkn9tuQ== X-Google-Smtp-Source: ABdhPJx+ValW3pKWYpEKgfKlU+q31MmAziW6tzU+OAKOMBI8RQolg01wyhynj1LpxSDAxZ9wxbw0UQ== X-Received: by 2002:a17:90a:642:: with SMTP id q2mr4250208pje.205.1626881104316; Wed, 21 Jul 2021 08:25:04 -0700 (PDT) Received: from omlet.com ([134.134.137.82]) by smtp.gmail.com with ESMTPSA id e4sm32451034pgi.94.2021.07.21.08.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 08:25:03 -0700 (PDT) From: Jason Ekstrand To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Wed, 21 Jul 2021 10:23:56 -0500 Message-Id: <20210721152358.2893314-5-jason@jlekstrand.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210721152358.2893314-1-jason@jlekstrand.net> References: <20210721152358.2893314-1-jason@jlekstrand.net> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 4/6] drm/ttm: Force re-init if ttm_global_init() fails X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" If we have a failure, decrement the reference count so that the next call to ttm_global_init() will actually do something instead of assume everything is all set up. Signed-off-by: Jason Ekstrand Fixes: 62b53b37e4b1 ("drm/ttm: use a static ttm_bo_global instance") Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 5f31acec3ad76..519deea8e39b7 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -100,6 +100,8 @@ static int ttm_global_init(void) debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root, &glob->bo_count); out: + if (ret) + --ttm_glob_use_count; mutex_unlock(&ttm_global_mutex); return ret; }