LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ramdisk driver: make rd_size non-static
@ 2008-01-18  2:02 Byron Bradley
  2008-01-18  2:28 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Byron Bradley @ 2008-01-18  2:02 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, akpm, Byron Bradley, Nick Piggin, Russell King

In arch/arm/kernel/setup.c:setup_ramdisk(), rd_size is set from the
boot tags. The replacement ramdisk driver has rd_size as static
which causes linking to fail when ramdisk is built-in.

Signed-off-by: Byron Bradley <byron.bbradley@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Russell King <rmk@arm.linux.org.uk>
---

This patch applies against 2.6.24-rc8-mm1 and has not been tested,
it is only know to compile. I'm not sure if there is a better way
to set rd_size or if this is OK.

 drivers/block/brd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 5ef1d26..8536480 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -385,7 +385,7 @@ static struct block_device_operations brd_fops = {
  * And now the modules code and kernel interface.
  */
 static int rd_nr;
-static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
+int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
 module_param(rd_nr, int, 0);
 MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
 module_param(rd_size, int, 0);
-- 
1.5.4.rc2.38.gd6da3



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ramdisk driver: make rd_size non-static
  2008-01-18  2:02 [PATCH] ramdisk driver: make rd_size non-static Byron Bradley
@ 2008-01-18  2:28 ` Andrew Morton
  2008-01-18  2:39   ` Matt Mackall
  2008-01-18 19:28   ` Russell King - ARM Linux
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2008-01-18  2:28 UTC (permalink / raw)
  To: Byron Bradley; +Cc: linux-arm-kernel, linux-kernel, Nick Piggin, Russell King

On Fri, 18 Jan 2008 02:02:17 +0000 Byron Bradley <byron.bbradley@gmail.com> wrote:

> In arch/arm/kernel/setup.c:setup_ramdisk(), rd_size is set from the
> boot tags. The replacement ramdisk driver has rd_size as static
> which causes linking to fail when ramdisk is built-in.
> 

but...

> diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> index 5ef1d26..8536480 100644
> --- a/drivers/block/brd.c
> +++ b/drivers/block/brd.c
> @@ -385,7 +385,7 @@ static struct block_device_operations brd_fops = {
>   * And now the modules code and kernel interface.
>   */
>  static int rd_nr;
> -static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> +int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
>  module_param(rd_nr, int, 0);
>  MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
>  module_param(rd_size, int, 0);

rd_size is a module parameter so it is settable via the
syntax-which-i-can-never-remember.  rd.rd_size=1024 or something like that.

If that's all sane, do we have some back-compat reason to continue to
support the special and duplicative rd_size parameter?


(If we never did crap like this:

arch/arm/kernel/setup.c:        extern int rd_size, rd_image_start, rd_prompt, rd_doload;

then this sort of problem wouldn't occur so often)

MIPS has the same problem.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ramdisk driver: make rd_size non-static
  2008-01-18  2:28 ` Andrew Morton
@ 2008-01-18  2:39   ` Matt Mackall
  2008-01-18 11:29     ` Nick Piggin
  2008-01-18 19:28   ` Russell King - ARM Linux
  1 sibling, 1 reply; 5+ messages in thread
From: Matt Mackall @ 2008-01-18  2:39 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Byron Bradley, linux-arm-kernel, linux-kernel, Nick Piggin, Russell King


On Thu, 2008-01-17 at 18:28 -0800, Andrew Morton wrote:
> On Fri, 18 Jan 2008 02:02:17 +0000 Byron Bradley <byron.bbradley@gmail.com> wrote:
> 
> > In arch/arm/kernel/setup.c:setup_ramdisk(), rd_size is set from the
> > boot tags. The replacement ramdisk driver has rd_size as static
> > which causes linking to fail when ramdisk is built-in.
> > 
> 
> but...
> 
> > diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> > index 5ef1d26..8536480 100644
> > --- a/drivers/block/brd.c
> > +++ b/drivers/block/brd.c
> > @@ -385,7 +385,7 @@ static struct block_device_operations brd_fops = {
> >   * And now the modules code and kernel interface.
> >   */
> >  static int rd_nr;
> > -static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> > +int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> >  module_param(rd_nr, int, 0);
> >  MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
> >  module_param(rd_size, int, 0);
> 
> rd_size is a module parameter so it is settable via the
> syntax-which-i-can-never-remember.  rd.rd_size=1024 or something like that.
> 
> If that's all sane, do we have some back-compat reason to continue to
> support the special and duplicative rd_size parameter?

Only insofar as we're still supporting ramdisks in the first place.

-- 
Mathematics is the supreme nostalgia of our time.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ramdisk driver: make rd_size non-static
  2008-01-18  2:39   ` Matt Mackall
@ 2008-01-18 11:29     ` Nick Piggin
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Piggin @ 2008-01-18 11:29 UTC (permalink / raw)
  To: Matt Mackall
  Cc: Andrew Morton, Byron Bradley, linux-arm-kernel, linux-kernel,
	Russell King

On Thu, Jan 17, 2008 at 08:39:23PM -0600, Matt Mackall wrote:
> 
> On Thu, 2008-01-17 at 18:28 -0800, Andrew Morton wrote:
> > On Fri, 18 Jan 2008 02:02:17 +0000 Byron Bradley <byron.bbradley@gmail.com> wrote:
> > 
> > > In arch/arm/kernel/setup.c:setup_ramdisk(), rd_size is set from the
> > > boot tags. The replacement ramdisk driver has rd_size as static
> > > which causes linking to fail when ramdisk is built-in.
> > > 
> > 
> > but...
> > 
> > > diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> > > index 5ef1d26..8536480 100644
> > > --- a/drivers/block/brd.c
> > > +++ b/drivers/block/brd.c
> > > @@ -385,7 +385,7 @@ static struct block_device_operations brd_fops = {
> > >   * And now the modules code and kernel interface.
> > >   */
> > >  static int rd_nr;
> > > -static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> > > +int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> > >  module_param(rd_nr, int, 0);
> > >  MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
> > >  module_param(rd_size, int, 0);
> > 
> > rd_size is a module parameter so it is settable via the
> > syntax-which-i-can-never-remember.  rd.rd_size=1024 or something like that.
> > 
> > If that's all sane, do we have some back-compat reason to continue to
> > support the special and duplicative rd_size parameter?
> 
> Only insofar as we're still supporting ramdisks in the first place.

I don't care about initrd or even a backward compatible API myself, I
do have my own reason want this new rd driver in the tree...

Would be nice to get rid of the arch stuff, but it's not too terrible
(at least from the POV of drivers/block/brd.c. So thanks for the patch,
Byron.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ramdisk driver: make rd_size non-static
  2008-01-18  2:28 ` Andrew Morton
  2008-01-18  2:39   ` Matt Mackall
@ 2008-01-18 19:28   ` Russell King - ARM Linux
  1 sibling, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2008-01-18 19:28 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Byron Bradley, Nick Piggin, linux-arm-kernel, Russell King, linux-kernel

On Thu, Jan 17, 2008 at 06:28:51PM -0800, Andrew Morton wrote:
> On Fri, 18 Jan 2008 02:02:17 +0000 Byron Bradley <byron.bbradley@gmail.com> wrote:
> 
> > In arch/arm/kernel/setup.c:setup_ramdisk(), rd_size is set from the
> > boot tags. The replacement ramdisk driver has rd_size as static
> > which causes linking to fail when ramdisk is built-in.
> > 
> 
> but...
> 
> > diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> > index 5ef1d26..8536480 100644
> > --- a/drivers/block/brd.c
> > +++ b/drivers/block/brd.c
> > @@ -385,7 +385,7 @@ static struct block_device_operations brd_fops = {
> >   * And now the modules code and kernel interface.
> >   */
> >  static int rd_nr;
> > -static int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> > +int rd_size = CONFIG_BLK_DEV_RAM_SIZE;
> >  module_param(rd_nr, int, 0);
> >  MODULE_PARM_DESC(rd_nr, "Maximum number of brd devices");
> >  module_param(rd_size, int, 0);
> 
> rd_size is a module parameter so it is settable via the
> syntax-which-i-can-never-remember.  rd.rd_size=1024 or something like that.
> 
> If that's all sane, do we have some back-compat reason to continue to
> support the special and duplicative rd_size parameter?
> 
> 
> (If we never did crap like this:
> 
> arch/arm/kernel/setup.c:        extern int rd_size, rd_image_start, rd_prompt, rd_doload;
> 
> then this sort of problem wouldn't occur so often)

We do "crap like this" because x86 did, and people wanted to set these
parameters at boot time, and in the old days of Linux (eg, 2.0), these
parameters were never available as command line arguments.  So the only
way to set them from boot loaders via architecture code is for architecture
code to reference the variable directly.

It looks like things have moved on in x86 land, but because there's an
utter lack of communication about these changes, the "planned obsolescence"
of rd_size hasn't been noticed.  So, I recommend that we keep rd_size
visible and take it through the now established feature-removal cycle,
including issuing kernel warnings about it if it gets used.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-18 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-18  2:02 [PATCH] ramdisk driver: make rd_size non-static Byron Bradley
2008-01-18  2:28 ` Andrew Morton
2008-01-18  2:39   ` Matt Mackall
2008-01-18 11:29     ` Nick Piggin
2008-01-18 19:28   ` Russell King - ARM Linux

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).