linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] ARM: add EXPORT_SYMBOL of hook_fault_code for PCI host modularization
Date: Mon, 8 Feb 2016 17:34:04 +0000	[thread overview]
Message-ID: <20160208173403.GS10826@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1454889644-27830-2-git-send-email-paul.gortmaker@windriver.com>

On Sun, Feb 07, 2016 at 07:00:40PM -0500, Paul Gortmaker wrote:
> In a discussion of a previous patch set[1], it was suggested that
> modularizing some of the PCI host support would be good to keep
> multi platform bzImage sizes smaller.
> 
> Two of the files that are candidates for conversion to tristate
> from bool are:
> 
> drivers/pci/host/pci-imx6.c
> drivers/pci/host/pci-keystone.c
> 
> However, doing the conversion reveals that they are going to fail
> at modpost time since hook_fault_code isn't currently exported.
> 
> Since we are now going to export it we also need to remove the
> __init tag, as the fcn needs to be present at insmod time.
> 
> [1] https://lkml.kernel.org/r/20160108203102.GH5354 at localhost
> 
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Ley Foon Tan <lftan@altera.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  arch/arm/mm/fault.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
> index daafcf121ce0..e0696a5ecc9b 100644
> --- a/arch/arm/mm/fault.c
> +++ b/arch/arm/mm/fault.c
> @@ -525,7 +525,7 @@ struct fsr_info {
>  #include "fsr-2level.c"
>  #endif
>  
> -void __init
> +void
>  hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *),
>  		int sig, int code, const char *name)
>  {
> @@ -537,6 +537,7 @@ hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *)
>  	fsr_info[nr].code = code;
>  	fsr_info[nr].name = name;
>  }
> +EXPORT_SYMBOL(hook_fault_code);

I'm really not a fan of this change - the hooks are supposed to remain
mostly static once the system is up and running, and should not change
at runtime (since there is no locking on these - see my previous reply.)
There's no protection (or support) for more than one function - iow, if
we have two modules trying to hook into the same fault code, the last
taker gets it (although the previous owner may get called given the
right timing.)

While it may be limited to two drivers at the moment, I'd like it to
remain that way.

If we really must have this, then please use EXPORT_SYMBOL_GPL() - I
don't want this interface to be used by code which isn't GPL compliant.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  parent reply	other threads:[~2016-02-08 17:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08  0:00 [PATCH 0/5] Modularize PCI_DW related drivers Paul Gortmaker
2016-02-08  0:00 ` [PATCH 1/5] ARM: add EXPORT_SYMBOL of hook_fault_code for PCI host modularization Paul Gortmaker
2016-02-08  9:53   ` Arnd Bergmann
2016-02-08 16:39     ` Paul Gortmaker
2016-02-08 17:27     ` Russell King - ARM Linux
2016-02-08 17:34   ` Russell King - ARM Linux [this message]
2016-02-08  0:00 ` [PATCH 4/5] drivers/pci: make host/pci-keystone-dw.c modular Paul Gortmaker
2016-02-08  9:59   ` Arnd Bergmann
2016-02-08 15:53     ` Paul Gortmaker
2016-02-08 19:03       ` Murali Karicheri
2016-02-24  6:09 ` [PATCH 0/5] Modularize PCI_DW related drivers Kishon Vijay Abraham I
2016-02-24  9:04   ` Arnd Bergmann
2016-02-25  8:13     ` Kishon Vijay Abraham I
2016-02-25  8:35       ` Arnd Bergmann
2016-02-29  9:29         ` Kishon Vijay Abraham I
2016-03-01 21:35           ` Arnd Bergmann
2016-03-15 20:50             ` Murali Karicheri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160208173403.GS10826@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).