From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Pantelis Antoniou <pantelis@embeddedalley.com>
Cc: linux-kernel@vger.kernel.org, cw@f00f.org,
Pete Popov <ppopov@embeddedalley.com>,
Matt Porter <mporter@embeddedalley.com>,
ralf@linux-mips.org
Subject: Re: [PATCH] Au1x00 8250 uart support (Updated - take #2).
Date: Wed, 21 Sep 2005 20:17:38 +0100 [thread overview]
Message-ID: <20050921191737.GA13246@flint.arm.linux.org.uk> (raw)
In-Reply-To: <200509211914.10460.pantelis@embeddedalley.com>
On Wed, Sep 21, 2005 at 07:14:09PM +0300, Pantelis Antoniou wrote:
> > This is also buggy - the problem this has is that although you're
> > unregistering the platform device, references can still remain after
> > the module has been unloaded. This means you have two options:
> >
> > 1. never allow code with statically allocated platform devices to be
> > modules.
> > 2. use something like platform_device_register_simple() (which doesn't
> > currently exist in a useful form for devices with platform data.)
> >
>
> Yes, this is stinking mess. I resorted to just not allowing a module build.
>
> BTW, the current platform_device_register_simple suffers from the same bug.
>
> ! struct platform_device *platform_device_register_simple(char *name, unsigned int id,
> ! struct resource *res, unsigned int num)
> !
>
> later on in the function body we have...
>
> ! pobj->pdev.name = name;
>
> It's clearly buggy, since the typical calling sequence passes a constant
> string as a 'name' argument, which is located in the read only segment
> of the module (.text or .rodata).
>
> To fix this space for the name must be allocated just like the resources...
Is this true? platform_device_register uses pdev.name to construct the
bus id. pdev.name is also used when matching against drivers.
However, once a platform device is unregistered, it is no longer available
to be matched against drivers, so pdev.name is unused. Therefore, I don't
think this is a problem.
> +#ifdef CONFIG_SERIAL_8250_AU1X00_MODULE
> +#error This file can not yet be compiled as a module.
> +#endif
This isn't how we prevent modular builds...
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -207,6 +207,14 @@ config SERIAL_8250_ACORN
> system, say Y to this option. The driver can handle 1, 2, or 3 port
> cards. If unsure, say N.
>
> +config SERIAL_8250_AU1X00
> + tristate "AU1X00 serial port support"
We prevent them by setting this to 'bool'.
> + depends on SOC_AU1X00 && SERIAL_8250
It doens't really depend on SERIAL_8250 - it can live independently of it.
However, it can be built in when SERIAL_8250 isn't, so this dependency
should be SERIAL_8250 != n.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2005-09-21 19:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-19 20:40 [PATCH] Au1x00 8250 uart support Pantelis Antoniou
2005-09-19 20:44 ` Christoph Hellwig
2005-09-19 20:53 ` Pantelis Antoniou
2005-09-19 20:58 ` Chris Wedgwood
2005-09-20 16:37 ` Russell King
2005-09-20 17:50 ` [PATCH] Au1x00 8250 uart support (Updated) Pantelis Antoniou
2005-09-21 7:11 ` Russell King
2005-09-21 16:14 ` [PATCH] Au1x00 8250 uart support (Updated - take #2) Pantelis Antoniou
2005-09-21 19:17 ` Russell King [this message]
2005-09-21 19:36 ` [PATCH] Au1x00 8250 uart support (Updated - take #3) Pantelis Antoniou
2005-09-22 19:11 ` [PATCH] Au1x00 8250 uart support (Updated - take #4) Pantelis Antoniou
2005-11-06 8:44 ` Russell King
2005-11-06 9:02 ` Pantelis Antoniou
2005-11-06 9:07 ` Russell King
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=20050921191737.GA13246@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=cw@f00f.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mporter@embeddedalley.com \
--cc=pantelis@embeddedalley.com \
--cc=ppopov@embeddedalley.com \
--cc=ralf@linux-mips.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