Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7150215ybi; Mon, 8 Jul 2019 15:39:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq3WOfgLqwQW2AKWaBU6Kh95//vTwiRobuNuwTzfXhm9WSS0G4xm5CqqUML4w/gac6gmul X-Received: by 2002:a17:902:2808:: with SMTP id e8mr26821275plb.317.1562625557502; Mon, 08 Jul 2019 15:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625557; cv=none; d=google.com; s=arc-20160816; b=iJgnRiRv0EtdKwUZkVjl6F3V8XeN62PsP8NVY8FINTM3PVkBopfivr1tc42HalcYz7 u2+1FZtU2leHtkwPm0jN7q9LyZSGsYKkoEv4dT/Z5UcXVboV55xL+lnTDl8a0VI6Nn7A Yrhz2ZlWlBxP840uZPh6ruj1Uiys3PZuNwQG1CyWv4vO51nQTdhfj3jiwGRWKgBehs0I Sc2GC6KrRX0BCR7ah3ZjhXeJpos8xVlbG7uJh5Jrcp7BaEhgqSt05bhMbPGwkR8agVeV XurncHKv45Fcp5reWd8OD4BPpjNuCVD8HlfXh7fHrYCKBDMHIdnVHqOyI+vZS6/ij7tb McMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nL0tnGGTHutnGtkLQt1iSqp7FpUZny6wttKEJPdCXSY=; b=h1kM91NI/XZJmdIRE8VIs3Ef+jV2/eJBaqFb5q5UASI37lK+SGvLqlSzAfGBOsWrqj nSz4/fHU1eHR6zbD6xwiKmW2xzLK8BzbmFCXG0t9fzs3oEWs7fGtpd/px8QtuaD10yVd ShwW1ZjihO52khkEUpA4gkXZZXMpuowdIPxDVzn3+oOhmkZVIuRR0j/lpg+hf0skHmor K5ZLu8Gh4BXhCDZ907yN5xX0zxzAvRZf2U2phtxUi1eHwXUeskipSFi8cHz2x4sJ+KUd sHTbuS/ybxumU+g+nkvuAMcfEMi5EQq3vCrVv4OodpG7TYl+AGA1p4F0XUgvYdKG7ogQ CtJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zFxZB17C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si17392215plp.4.2019.07.08.15.39.02; Mon, 08 Jul 2019 15:39:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zFxZB17C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731979AbfGHP3V (ORCPT + 99 others); Mon, 8 Jul 2019 11:29:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:57994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbfGHP3Q (ORCPT ); Mon, 8 Jul 2019 11:29:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8553A20645; Mon, 8 Jul 2019 15:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599755; bh=ND7lbqp39s4GIPSTjVhiU1UnmlxoVFRq31gK7a+756c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zFxZB17CU5QpOtN8G7HVbNOGW/zYNZULnz1paQ6PNH8w0qwIO+S+u8QKPlns09Ydk 5Sq/Aw0RkvsQXoAGfeubUCGCjL4LCOmjPQkhMaPdMiZ5d0tdeW+fegtEb41iudEMkF nQvyDFhkSDFRCHaynmZLt6dK5ReED63ROgc0fVlI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Daniel Vetter , Sasha Levin Subject: [PATCH 4.19 67/90] drm/fb-helper: generic: Dont take module ref for fbcon Date: Mon, 8 Jul 2019 17:13:34 +0200 Message-Id: <20190708150525.748813850@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150521.829733162@linuxfoundation.org> References: <20190708150521.829733162@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6ab20a05f4c7ed45632e24d5397d6284e192567d ] It's now safe to let fbcon unbind automatically on fbdev unregister. The crash problem was fixed in commit 2122b40580dd ("fbdev: fbcon: Fix unregister crash when more than one framebuffer") Signed-off-by: Noralf Trønnes Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20190210131039.52664-13-noralf@tronnes.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_fb_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index a0663f44e218..8b546fde139d 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -2957,7 +2957,8 @@ static int drm_fbdev_fb_open(struct fb_info *info, int user) { struct drm_fb_helper *fb_helper = info->par; - if (!try_module_get(fb_helper->dev->driver->fops->owner)) + /* No need to take a ref for fbcon because it unbinds on unregister */ + if (user && !try_module_get(fb_helper->dev->driver->fops->owner)) return -ENODEV; return 0; @@ -2967,7 +2968,8 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user) { struct drm_fb_helper *fb_helper = info->par; - module_put(fb_helper->dev->driver->fops->owner); + if (user) + module_put(fb_helper->dev->driver->fops->owner); return 0; } -- 2.20.1