From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 2663AC433DB for ; Wed, 3 Feb 2021 10:35:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA56064E38 for ; Wed, 3 Feb 2021 10:35:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233771AbhBCKfi (ORCPT ); Wed, 3 Feb 2021 05:35:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233587AbhBCKff (ORCPT ); Wed, 3 Feb 2021 05:35:35 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E1B7C06174A for ; Wed, 3 Feb 2021 02:34:55 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id j11so4130546wmi.3 for ; Wed, 03 Feb 2021 02:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=ucutE9tVrKg8bG1XX/lcHYR1DORerY7wTTSfiDErO4Y=; b=M75pCStwd1CD5X+AE8fVhstTS+X4mKfTg66UmMyLV/4dbGEYA6QHxZzUVBaPMOz7xx F9+edfLoc2Vlmx1emXKW6xZgu7oWNOjz1WTgd2M5J2gnXE54FmGLbHHBb8oKBNcpCTS4 6/gH/3v5zILbDOnuxcfqarN4OjvcB8d9ja9AA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=ucutE9tVrKg8bG1XX/lcHYR1DORerY7wTTSfiDErO4Y=; b=YCZ3QaJf93AvObKsTFh4pFJoDx/fqbP8SM9ZU8OGu2/8R2SszhBxCExmwiHZt3JFZp Vp1xV3ZyWfPNyPWt30+r2woKdmQm7hNOOcRwg5hAA3rc/NkC5RHCapRotooJrH1k5U63 RAt0XveepoWlUjTrPPdMmde0thzcT6xHF+GsocpTqIqQ0/32yEB6o1TLy4MM8HRc2NtW s76GHq4K9RhEIhz27Yaq03h+svxx6FyfLkLlQDiHgw3NNbejZkAUL8XKxNs4b1zGjbkh 3bxMJRAQsu7iIipLyJwwSBJTV3anIeCIfrpzDwSbr1td/+KFaw7QuRl404HRo2QBrc2Z GHtg== X-Gm-Message-State: AOAM53262LLxCVpnbyBOlASejpQ6jgsSSVY/RRCVgwKyIyAiCxMZvEvn 0qGj9Kci7kysb/dnjvRnNcJ6WA== X-Google-Smtp-Source: ABdhPJz4SARPNc66CChB2hShzHi2iGX8D1M1gjyOuRd3fn77dLJW2FXa5gHf0Q6IrbHt0pXvjzsdvQ== X-Received: by 2002:a1c:a90f:: with SMTP id s15mr2203893wme.154.1612348493733; Wed, 03 Feb 2021 02:34:53 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id b11sm2957419wrp.60.2021.02.03.02.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 02:34:53 -0800 (PST) Date: Wed, 3 Feb 2021 11:34:50 +0100 From: Daniel Vetter To: Christoph Hellwig Cc: Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 02/13] drm: remove drm_fb_helper_modinit Message-ID: Mail-Followup-To: Christoph Hellwig , Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org References: <20210128181421.2279-1-hch@lst.de> <20210128181421.2279-3-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128181421.2279-3-hch@lst.de> X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2021 at 07:14:10PM +0100, Christoph Hellwig wrote: > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE, and skip the find_module check as a > request_module is harmless if the module is already loaded (and not > other caller has this find_module check either). > > Signed-off-by: Christoph Hellwig Hm I thought I've acked this one already somewhere for merging through your tree. Acked-by: Daniel Vetter > --- > drivers/gpu/drm/drm_crtc_helper_internal.h | 10 --------- > drivers/gpu/drm/drm_fb_helper.c | 21 ------------------ > drivers/gpu/drm/drm_kms_helper_common.c | 25 +++++++++++----------- > 3 files changed, 12 insertions(+), 44 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h > index 25ce42e799952c..61e09f8a8d0ff0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper_internal.h > +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h > @@ -32,16 +32,6 @@ > #include > #include > > -/* drm_fb_helper.c */ > -#ifdef CONFIG_DRM_FBDEV_EMULATION > -int drm_fb_helper_modinit(void); > -#else > -static inline int drm_fb_helper_modinit(void) > -{ > - return 0; > -} > -#endif > - > /* drm_dp_aux_dev.c */ > #ifdef CONFIG_DRM_DP_AUX_CHARDEV > int drm_dp_aux_dev_init(void); > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 4b81195106875d..0b9f1ae1b7864c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2499,24 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev, > drm_client_register(&fb_helper->client); > } > EXPORT_SYMBOL(drm_fbdev_generic_setup); > - > -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > - * but the module doesn't depend on any fb console symbols. At least > - * attempt to load fbcon to avoid leaving the system without a usable console. > - */ > -int __init drm_fb_helper_modinit(void) > -{ > -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) > - const char name[] = "fbcon"; > - struct module *fbcon; > - > - mutex_lock(&module_mutex); > - fbcon = find_module(name); > - mutex_unlock(&module_mutex); > - > - if (!fbcon) > - request_module_nowait(name); > -#endif > - return 0; > -} > -EXPORT_SYMBOL(drm_fb_helper_modinit); > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c > index 221a8528c9937a..f933da1656eb52 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -64,19 +64,18 @@ MODULE_PARM_DESC(edid_firmware, > > static int __init drm_kms_helper_init(void) > { > - int ret; > - > - /* Call init functions from specific kms helpers here */ > - ret = drm_fb_helper_modinit(); > - if (ret < 0) > - goto out; > - > - ret = drm_dp_aux_dev_init(); > - if (ret < 0) > - goto out; > - > -out: > - return ret; > + /* > + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > + * but the module doesn't depend on any fb console symbols. At least > + * attempt to load fbcon to avoid leaving the system without a usable > + * console. > + */ > + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && > + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && > + !IS_ENABLED(CONFIG_EXPERT)) > + request_module_nowait("fbcon"); > + > + return drm_dp_aux_dev_init(); > } > > static void __exit drm_kms_helper_exit(void) > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.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,URIBL_BLOCKED autolearn=unavailable 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 504DDC433DB for ; Wed, 3 Feb 2021 10:36:33 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 601C564E30 for ; Wed, 3 Feb 2021 10:36:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 601C564E30 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DVylc25w7zDx1J for ; Wed, 3 Feb 2021 21:36:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=ffwll.ch (client-ip=2a00:1450:4864:20::32c; helo=mail-wm1-x32c.google.com; envelope-from=daniel@ffwll.ch; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=ffwll.ch header.i=@ffwll.ch header.a=rsa-sha256 header.s=google header.b=M75pCStw; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DVyk04H13zDqMy for ; Wed, 3 Feb 2021 21:34:58 +1100 (AEDT) Received: by mail-wm1-x32c.google.com with SMTP id f16so4934313wmq.5 for ; Wed, 03 Feb 2021 02:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=ucutE9tVrKg8bG1XX/lcHYR1DORerY7wTTSfiDErO4Y=; b=M75pCStwd1CD5X+AE8fVhstTS+X4mKfTg66UmMyLV/4dbGEYA6QHxZzUVBaPMOz7xx F9+edfLoc2Vlmx1emXKW6xZgu7oWNOjz1WTgd2M5J2gnXE54FmGLbHHBb8oKBNcpCTS4 6/gH/3v5zILbDOnuxcfqarN4OjvcB8d9ja9AA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=ucutE9tVrKg8bG1XX/lcHYR1DORerY7wTTSfiDErO4Y=; b=YSH8j5fSfZGnXk4T2jvN5yDHoLssj3cYDJ7UNFtuFHZOwF4YBz9VO64e4lIZgvFRLJ g3KdLuuTAla7zdP1DnNXiJRAvZsaLR8Eujas/dpQflSDnHFK3B+Q+EWoJBu1gWsonSAr zhtJ6ZE13bwZ1789RmXH+TL5Cn89wbqAYtduh5PluFe+4a9mzMfbDGOa6eUqGO2jpNKI VwwPxJvSbZv5F89gLq2+GwtOJ3e9iCvzm4P6SBJJqT0aCGSL/2pTtg5DYLs9gWQJcYWQ MYz531wwXmFqeqahoLYjegu8RjkLfp6tp1Ll5btjHB53uIt0EDfGZgNW5OLzOYxBng5M +1Wg== X-Gm-Message-State: AOAM531dYL34CnjHKqaqWMk1gihc2JEtmcjh5kk2CuZeG7+OnWH1+Jb+ X3iREHtx59OoI/5mG+PeJ7Egqw== X-Google-Smtp-Source: ABdhPJz4SARPNc66CChB2hShzHi2iGX8D1M1gjyOuRd3fn77dLJW2FXa5gHf0Q6IrbHt0pXvjzsdvQ== X-Received: by 2002:a1c:a90f:: with SMTP id s15mr2203893wme.154.1612348493733; Wed, 03 Feb 2021 02:34:53 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id b11sm2957419wrp.60.2021.02.03.02.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 02:34:53 -0800 (PST) Date: Wed, 3 Feb 2021 11:34:50 +0100 From: Daniel Vetter To: Christoph Hellwig Subject: Re: [PATCH 02/13] drm: remove drm_fb_helper_modinit Message-ID: Mail-Followup-To: Christoph Hellwig , Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org References: <20210128181421.2279-1-hch@lst.de> <20210128181421.2279-3-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210128181421.2279-3-hch@lst.de> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , Jiri Kosina , Andrew Donnellan , linux-kbuild@vger.kernel.org, David Airlie , Masahiro Yamada , Josh Poimboeuf , Maarten Lankhorst , linux-kernel@vger.kernel.org, Maxime Ripard , live-patching@vger.kernel.org, Michal Marek , Joe Lawrence , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Jessica Yu , Frederic Barrat , Daniel Vetter , Miroslav Benes , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Jan 28, 2021 at 07:14:10PM +0100, Christoph Hellwig wrote: > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE, and skip the find_module check as a > request_module is harmless if the module is already loaded (and not > other caller has this find_module check either). > > Signed-off-by: Christoph Hellwig Hm I thought I've acked this one already somewhere for merging through your tree. Acked-by: Daniel Vetter > --- > drivers/gpu/drm/drm_crtc_helper_internal.h | 10 --------- > drivers/gpu/drm/drm_fb_helper.c | 21 ------------------ > drivers/gpu/drm/drm_kms_helper_common.c | 25 +++++++++++----------- > 3 files changed, 12 insertions(+), 44 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h > index 25ce42e799952c..61e09f8a8d0ff0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper_internal.h > +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h > @@ -32,16 +32,6 @@ > #include > #include > > -/* drm_fb_helper.c */ > -#ifdef CONFIG_DRM_FBDEV_EMULATION > -int drm_fb_helper_modinit(void); > -#else > -static inline int drm_fb_helper_modinit(void) > -{ > - return 0; > -} > -#endif > - > /* drm_dp_aux_dev.c */ > #ifdef CONFIG_DRM_DP_AUX_CHARDEV > int drm_dp_aux_dev_init(void); > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 4b81195106875d..0b9f1ae1b7864c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2499,24 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev, > drm_client_register(&fb_helper->client); > } > EXPORT_SYMBOL(drm_fbdev_generic_setup); > - > -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > - * but the module doesn't depend on any fb console symbols. At least > - * attempt to load fbcon to avoid leaving the system without a usable console. > - */ > -int __init drm_fb_helper_modinit(void) > -{ > -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) > - const char name[] = "fbcon"; > - struct module *fbcon; > - > - mutex_lock(&module_mutex); > - fbcon = find_module(name); > - mutex_unlock(&module_mutex); > - > - if (!fbcon) > - request_module_nowait(name); > -#endif > - return 0; > -} > -EXPORT_SYMBOL(drm_fb_helper_modinit); > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c > index 221a8528c9937a..f933da1656eb52 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -64,19 +64,18 @@ MODULE_PARM_DESC(edid_firmware, > > static int __init drm_kms_helper_init(void) > { > - int ret; > - > - /* Call init functions from specific kms helpers here */ > - ret = drm_fb_helper_modinit(); > - if (ret < 0) > - goto out; > - > - ret = drm_dp_aux_dev_init(); > - if (ret < 0) > - goto out; > - > -out: > - return ret; > + /* > + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > + * but the module doesn't depend on any fb console symbols. At least > + * attempt to load fbcon to avoid leaving the system without a usable > + * console. > + */ > + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && > + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && > + !IS_ENABLED(CONFIG_EXPERT)) > + request_module_nowait("fbcon"); > + > + return drm_dp_aux_dev_init(); > } > > static void __exit drm_kms_helper_exit(void) > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.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,URIBL_BLOCKED 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 27D3CC433E0 for ; Wed, 3 Feb 2021 10:34:57 +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 C589664E38 for ; Wed, 3 Feb 2021 10:34:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C589664E38 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13A486E239; Wed, 3 Feb 2021 10:34:56 +0000 (UTC) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E5696E239 for ; Wed, 3 Feb 2021 10:34:55 +0000 (UTC) Received: by mail-wm1-x329.google.com with SMTP id 190so4958168wmz.0 for ; Wed, 03 Feb 2021 02:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=ucutE9tVrKg8bG1XX/lcHYR1DORerY7wTTSfiDErO4Y=; b=M75pCStwd1CD5X+AE8fVhstTS+X4mKfTg66UmMyLV/4dbGEYA6QHxZzUVBaPMOz7xx F9+edfLoc2Vlmx1emXKW6xZgu7oWNOjz1WTgd2M5J2gnXE54FmGLbHHBb8oKBNcpCTS4 6/gH/3v5zILbDOnuxcfqarN4OjvcB8d9ja9AA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=ucutE9tVrKg8bG1XX/lcHYR1DORerY7wTTSfiDErO4Y=; b=rpL69/lGXkWPVB3sDygDvf7/SbDzV2lke7cNriqX3QVxXYi8VSOedsT5t0IEUma4D5 kwnW2ptp05ffUYnJbVM8u7xQ2gncmQLN88Kpt3kiRKBmMmfAR1/VDU09Zi8JPUQB5BFs kz4VS5ovOexA6oxgLOWuwY+rgAbCrOybnpF7DC3yTjhdXnB7lJYQn4fu/cCg9UK03WnL jPYuyt2sUaF2fPU9mBOLTxE2SrmymkjAmHOp5GxLfHA5kjkMoZnKNlgF9SG6zRaKMz4w Z3CLMOKXhNy51x7gS7vR1ZMQNLm0N79XRR1WnZB/8F1em1iWutO8cQZ2xxSDfXY8glHU x4tw== X-Gm-Message-State: AOAM5304XnZE4jvnXVq55OPlViT3TEQdAo2yi2ymRaRXhtH5CURnORT9 1tBlybMOj0YazTS4akasEg3RTw== X-Google-Smtp-Source: ABdhPJz4SARPNc66CChB2hShzHi2iGX8D1M1gjyOuRd3fn77dLJW2FXa5gHf0Q6IrbHt0pXvjzsdvQ== X-Received: by 2002:a1c:a90f:: with SMTP id s15mr2203893wme.154.1612348493733; Wed, 03 Feb 2021 02:34:53 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id b11sm2957419wrp.60.2021.02.03.02.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 02:34:53 -0800 (PST) Date: Wed, 3 Feb 2021 11:34:50 +0100 From: Daniel Vetter To: Christoph Hellwig Subject: Re: [PATCH 02/13] drm: remove drm_fb_helper_modinit Message-ID: Mail-Followup-To: Christoph Hellwig , Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org References: <20210128181421.2279-1-hch@lst.de> <20210128181421.2279-3-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210128181421.2279-3-hch@lst.de> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , Jiri Kosina , Andrew Donnellan , linux-kbuild@vger.kernel.org, David Airlie , Masahiro Yamada , Josh Poimboeuf , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Michal Marek , Joe Lawrence , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Jessica Yu , Frederic Barrat , Miroslav Benes , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jan 28, 2021 at 07:14:10PM +0100, Christoph Hellwig wrote: > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE, and skip the find_module check as a > request_module is harmless if the module is already loaded (and not > other caller has this find_module check either). > > Signed-off-by: Christoph Hellwig Hm I thought I've acked this one already somewhere for merging through your tree. Acked-by: Daniel Vetter > --- > drivers/gpu/drm/drm_crtc_helper_internal.h | 10 --------- > drivers/gpu/drm/drm_fb_helper.c | 21 ------------------ > drivers/gpu/drm/drm_kms_helper_common.c | 25 +++++++++++----------- > 3 files changed, 12 insertions(+), 44 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h > index 25ce42e799952c..61e09f8a8d0ff0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper_internal.h > +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h > @@ -32,16 +32,6 @@ > #include > #include > > -/* drm_fb_helper.c */ > -#ifdef CONFIG_DRM_FBDEV_EMULATION > -int drm_fb_helper_modinit(void); > -#else > -static inline int drm_fb_helper_modinit(void) > -{ > - return 0; > -} > -#endif > - > /* drm_dp_aux_dev.c */ > #ifdef CONFIG_DRM_DP_AUX_CHARDEV > int drm_dp_aux_dev_init(void); > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index 4b81195106875d..0b9f1ae1b7864c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2499,24 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev, > drm_client_register(&fb_helper->client); > } > EXPORT_SYMBOL(drm_fbdev_generic_setup); > - > -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > - * but the module doesn't depend on any fb console symbols. At least > - * attempt to load fbcon to avoid leaving the system without a usable console. > - */ > -int __init drm_fb_helper_modinit(void) > -{ > -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) > - const char name[] = "fbcon"; > - struct module *fbcon; > - > - mutex_lock(&module_mutex); > - fbcon = find_module(name); > - mutex_unlock(&module_mutex); > - > - if (!fbcon) > - request_module_nowait(name); > -#endif > - return 0; > -} > -EXPORT_SYMBOL(drm_fb_helper_modinit); > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c > index 221a8528c9937a..f933da1656eb52 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -64,19 +64,18 @@ MODULE_PARM_DESC(edid_firmware, > > static int __init drm_kms_helper_init(void) > { > - int ret; > - > - /* Call init functions from specific kms helpers here */ > - ret = drm_fb_helper_modinit(); > - if (ret < 0) > - goto out; > - > - ret = drm_dp_aux_dev_init(); > - if (ret < 0) > - goto out; > - > -out: > - return ret; > + /* > + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > + * but the module doesn't depend on any fb console symbols. At least > + * attempt to load fbcon to avoid leaving the system without a usable > + * console. > + */ > + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && > + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && > + !IS_ENABLED(CONFIG_EXPERT)) > + request_module_nowait("fbcon"); > + > + return drm_dp_aux_dev_init(); > } > > static void __exit drm_kms_helper_exit(void) > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel