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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 130E9C2BA1A for ; Fri, 24 Apr 2020 09:21:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E409920728 for ; Fri, 24 Apr 2020 09:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587720083; bh=oMdVEGseu3X/uVHRcbF5bwxXym0BrmbiTesm/lnUwAY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=vXpHT9/F5Rwvos46ShyjG3yPBXcQhrxKDci9acpCgaqxiv03HCzAT8Y6xL7QY0gCU WK5zssc8H9QtvKWEdG+k/kF0DQf/9PaFHQXW9uJaNsfmDQoARFaVUYunNyqenWiUbH V6vXkhwGcC5SghxuFPukgt4OFF47lhvtnYBB10vc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbgDXJVX (ORCPT ); Fri, 24 Apr 2020 05:21:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:52594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbgDXJVW (ORCPT ); Fri, 24 Apr 2020 05:21:22 -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 4E18B20724; Fri, 24 Apr 2020 09:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587720081; bh=oMdVEGseu3X/uVHRcbF5bwxXym0BrmbiTesm/lnUwAY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SUjtBfnhnrnzWa6W6RINqmGOPrcrjJv7CIwkZIfNi9fbEITE82prDj298vVf38/7u dmi7pkaadA69Zro+u4mHv91OBsx8Hzb5zPVnkkimxORXQHCQlFQZPEumUJJOrVuaeO 22yCx35mZauNiPsuor/b1+9me7fbc8DeI0NUyBHI= Date: Fri, 24 Apr 2020 11:21:19 +0200 From: Greg KH To: "Luis R. Rodriguez" Cc: akpm@linux-foundation.org, josh@joshtriplett.org, rishabhb@codeaurora.org, kubakici@wp.pl, maco@android.com, andy.gross@linaro.org, david.brown@linaro.org, bjorn.andersson@linaro.org, linux-wireless@vger.kernel.org, keescook@chromium.org, shuah@kernel.org, mfuzzey@parkeon.com, zohar@linux.vnet.ibm.com, dhowells@redhat.com, pali.rohar@gmail.com, tiwai@suse.de, arend.vanspriel@broadcom.com, zajec5@gmail.com, nbroeking@me.com, markivx@codeaurora.org, broonie@kernel.org, dmitry.torokhov@gmail.com, dwmw2@infradead.org, torvalds@linux-foundation.org, Abhay_Salunke@dell.com, jewalt@lgsinnovations.com, cantabile.desu@gmail.com, ast@fb.com, andresx7@gmail.com, dan.rue@linaro.org, brendanhiggins@google.com, yzaikin@google.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Randy Dunlap , Stephen Rothwell Subject: Re: [PATCH] firmware_loader: re-export fw_fallback_config into firmware_loader's own namespace Message-ID: <20200424092119.GA360114@kroah.com> References: <20200423203140.19510-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200423203140.19510-1-mcgrof@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 23, 2020 at 08:31:40PM +0000, Luis R. Rodriguez wrote: > From: Luis Chamberlain > > Christoph's recent patch "firmware_loader: remove unused exports", which > is not merged upstream yet, removed two exported symbols. One is fine to > remove since only built-in code uses it but the other is incorrect. > > If CONFIG_FW_LOADER=m so the firmware_loader is modular but > CONFIG_FW_LOADER_USER_HELPER=y we fail at mostpost with: > > ERROR: modpost: "fw_fallback_config" [drivers/base/firmware_loader/firmware_class.ko] undefined! > > This happens because the variable fw_fallback_config is built into the > kernel if CONFIG_FW_LOADER_USER_HELPER=y always, so we need to grant > access to the firmware loader module by exporting it. > > Instead of just exporting it as we used to, take advantage of the new > kernel symbol namespacing functionality, and export the symbol only to > the firmware loader private namespace. This would prevent misuses from > other drivers and makes it clear the goal is to keep this private to > the firmware loader alone. > > Cc: Christoph Hellwig > Cc: Randy Dunlap > Cc: Stephen Rothwell > Fixes: "firmware_loader: remove unused exports" > Reported-by: Randy Dunlap > Signed-off-by: Luis Chamberlain > --- > drivers/base/firmware_loader/fallback.c | 3 +++ > drivers/base/firmware_loader/fallback_table.c | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firmware_loader/fallback.c > index 1e9c96e3ed63..d9ac7296205e 100644 > --- a/drivers/base/firmware_loader/fallback.c > +++ b/drivers/base/firmware_loader/fallback.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > > #include "fallback.h" > #include "firmware.h" > @@ -17,6 +18,8 @@ > * firmware fallback mechanism > */ > > +MODULE_IMPORT_NS(FIRMWARE_LOADER_PRIVATE); > + > extern struct firmware_fallback_config fw_fallback_config; > > /* These getters are vetted to use int properly */ While nice, that does not fix the existing build error that people are having, right? > diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c > index 0a737349f78f..46a731dede6f 100644 > --- a/drivers/base/firmware_loader/fallback_table.c > +++ b/drivers/base/firmware_loader/fallback_table.c > @@ -21,6 +21,7 @@ struct firmware_fallback_config fw_fallback_config = { > .loading_timeout = 60, > .old_timeout = 60, > }; > +EXPORT_SYMBOL_NS_GPL(fw_fallback_config, FIRMWARE_LOADER_PRIVATE); How about you send a patch that just reverts the single symbol change first, and then a follow-on patch that does this namespace addition. I can queue the first one up now, for 5.7-final, and the second one for 5.8-rc1. thanks, greg k-h