Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp395712pxb; Mon, 16 Aug 2021 07:55:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcN6vW+nNd6lcXKCYGUevpLWGSRkZ3JQ7WwGwgEQTPvQIMRXyJidJ5z6uOiUP90Uxbrppn X-Received: by 2002:a17:907:f86:: with SMTP id kb6mr16735956ejc.138.1629125727341; Mon, 16 Aug 2021 07:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629125727; cv=none; d=google.com; s=arc-20160816; b=ivi059MAEfqJJGtV39dPRvvV2nejFV+8sFDAxx8ZHqJekIBm2LYWwI70KqUcRX0beI N+XJ2bXSg12wGan+UaJ7wgkK7solkZdK4i5zzC9Dsta1RBudi0lGZCagCUUMnePi7Q0C 3RvaKp3QxUmO/JSbZAzrW65iNJu9EndSAvzk6Ou1oyzxqG0HyGxvjmrfKGmD6B0iwkuS t/ToTLwXCsMhkhZFHKf14M/oLmgwfv7VOZwTXP3WNDwoDUmf9lI0SMoFbXPYsMkz6pH7 GQjjDKtYhb6ah6FMJq9UYeJ8QRdTabbA0s6CtLKKboEMPqI7NZ/NiS9H5wHQTGsTiE0H rSCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eLQYMMz0CluCtWGgDPOvxIf0ym6QLpqRpYmB5sXLSRQ=; b=GfEVtj5/IRTnzu9+BzJUR+DA5dk20uPJfqc3inxFZNz5CxMa2LoOy3qLJgXofm1vyq z/m28fJjQjLtaHY6tEdKxfJ7lBMyiHbW42QdjZnfcnMtAf6byvCz64WjQJNWQgYsIo0B rTok6MEB3MPo72+I0b78ghg1Lajg0Vil5LxSEg/7KUHZDXp7BLZlhrpaX00uDLBGwlFx VOPBTGDWJErggqjdsdev4zHhHrQInj00pMUcUJJx+3pzDUX1+ZJ9PCUN7c4jVtEP1Izd 4FFdv1PZp8QEAk9rPSz2sJm2hDwQIhxHazWMYgT+5nAGj6rz9zuvOty750W8yop7X/9L jggg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gregdf.com header.s=mail header.b=ojf9VPbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=gregdf.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho43si11896440ejc.615.2021.08.16.07.55.04; Mon, 16 Aug 2021 07:55:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gregdf.com header.s=mail header.b=ojf9VPbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=gregdf.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232555AbhHPOwC (ORCPT + 99 others); Mon, 16 Aug 2021 10:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231971AbhHPOv5 (ORCPT ); Mon, 16 Aug 2021 10:51:57 -0400 X-Greylist: delayed 593 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 16 Aug 2021 07:40:50 PDT Received: from gregdf.com (gregdf.com [IPv6:2001:41d0:304:200::b62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DEFC061796 for ; Mon, 16 Aug 2021 07:40:50 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:2c9:7bb0:47f6:13d5:48e6:af34]) by mail.gregdf.com (Postfix) with ESMTPSA id CEAB830A0AF; Mon, 16 Aug 2021 16:30:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gregdf.com; s=mail; t=1629124252; bh=eLQYMMz0CluCtWGgDPOvxIf0ym6QLpqRpYmB5sXLSRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ojf9VPbTWDlE3MkJMGYFcgu9b1LH8N6yNKO9Dl3zM+9Ae93byP6RuK+RS6sFFq7BJ hTinfBcDH70yIsWbYb5+jMJkFCjhPvhGfXFuX6qnf9mr23CQqXPm06pvaFxCsKlkI2 BOYot8AtZjTHWQJ0yMUDi1F6jmt8ZEvqlRojVVHY= From: lnx7586@gregdf.com To: mikpelinux@gmail.com Cc: daniel.vetter@ffwll.ch, dri-devel@lists.freedesktop.org, jason@jlekstrand.net, linux-kernel@vger.kernel.org, Greg Depoire--Ferrer , Duncan Subject: [PATCH] drm/ttm: allow debugfs_create_file() to fail in ttm_global_init() Date: Mon, 16 Aug 2021 16:30:46 +0200 Message-Id: <20210816143046.3320-1-lnx7586@gregdf.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Depoire--Ferrer Commit 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()") unintentionally made ttm_global_init() return early with an error when debugfs_create_file() fails. When CONFIG_DEBUG_FS is disabled, debugfs_create_file() returns a ENODEV error so the TTM device would fail to initialize. Instead of returning early with the error, print it and continue. ENODEV can be ignored because it just means that CONFIG_DEBUG_FS is disabled. Fixes: 69de4421bb4c ("drm/ttm: Initialize debugfs from ttm_global_init()") Reported-by: Mikael Pettersson Reported-by: Duncan Signed-off-by: Greg Depoire--Ferrer --- Hi, I had this bug as well with the nouveau driver after updating. This patch fixes it for me. drivers/gpu/drm/ttm/ttm_device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index 74e3b460132b..12b73979c798 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -69,6 +69,7 @@ static int ttm_global_init(void) unsigned long num_pages, num_dma32; struct sysinfo si; int ret = 0; + int tmp; mutex_lock(&ttm_global_mutex); if (++ttm_glob_use_count > 1) @@ -78,9 +79,9 @@ static int ttm_global_init(void) ttm_debugfs_root = debugfs_create_dir("ttm", NULL); if (IS_ERR(ttm_debugfs_root)) { - ret = PTR_ERR(ttm_debugfs_root); - ttm_debugfs_root = NULL; - goto out; + tmp = PTR_ERR(ttm_debugfs_root); + if (tmp != -ENODEV) + pr_err("failed to create debugfs: %d", tmp); } /* Limit the number of pages in the pool to about 50% of the total -- 2.31.1