All of lore.kernel.org
 help / color / mirror / Atom feed
* SPARC64: Modular floppy?
@ 2005-02-28 20:07 ` Horst von Brand
  0 siblings, 0 replies; 16+ messages in thread
From: Horst von Brand @ 2005-02-28 20:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: ultralinux

As things stand today, floppy can't be modular (even though the
configuration allows it!) because drivers/block/floppy.c references stuff
in arch/sparc64/kernel/entry.S which isn't included if the floppy
isn't. But that same code references symbols in floppy.c, so it doesn't
help making it depend on floppy (modular or not).

So, either the dependencies have to get fixed so floppy can't be modular
for this architecture, or the relevant functions have to move from entry.S
to the module. Last looks like a mess, splattering .S for sparc64 into
drivers, or moving it to arch. Or is there some way of building a module
from pieces in different directories under architecture control?

Or this can be declared an endearing quirk of Linux on SPARC ;-)
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

* SPARC64: Modular floppy?
@ 2005-02-28 20:07 ` Horst von Brand
  0 siblings, 0 replies; 16+ messages in thread
From: Horst von Brand @ 2005-02-28 20:07 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: ultralinux

As things stand today, floppy can't be modular (even though the
configuration allows it!) because drivers/block/floppy.c references stuff
in arch/sparc64/kernel/entry.S which isn't included if the floppy
isn't. But that same code references symbols in floppy.c, so it doesn't
help making it depend on floppy (modular or not).

So, either the dependencies have to get fixed so floppy can't be modular
for this architecture, or the relevant functions have to move from entry.S
to the module. Last looks like a mess, splattering .S for sparc64 into
drivers, or moving it to arch. Or is there some way of building a module
from pieces in different directories under architecture control?

Or this can be declared an endearing quirk of Linux on SPARC ;-)
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

* Re: SPARC64: Modular floppy?
  2005-02-28 20:07 ` Horst von Brand
@ 2005-02-28 23:51   ` David S. Miller
  -1 siblings, 0 replies; 16+ messages in thread
From: David S. Miller @ 2005-02-28 23:51 UTC (permalink / raw)
  To: Horst von Brand; +Cc: linux-kernel, ultralinux

On Mon, 28 Feb 2005 17:07:43 -0300
Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

> So, either the dependencies have to get fixed so floppy can't be modular
> for this architecture, or the relevant functions have to move from entry.S
> to the module.

I think the former is the best solution.  The assembler code really
needs to get at floppy.c symbols.

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

* Re: SPARC64: Modular floppy?
@ 2005-02-28 23:51   ` David S. Miller
  0 siblings, 0 replies; 16+ messages in thread
From: David S. Miller @ 2005-02-28 23:51 UTC (permalink / raw)
  To: Horst von Brand; +Cc: linux-kernel, ultralinux

On Mon, 28 Feb 2005 17:07:43 -0300
Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

> So, either the dependencies have to get fixed so floppy can't be modular
> for this architecture, or the relevant functions have to move from entry.S
> to the module.

I think the former is the best solution.  The assembler code really
needs to get at floppy.c symbols.

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

* Re: SPARC64: Modular floppy?
  2005-02-28 23:51   ` David S. Miller
@ 2005-03-01  1:53     ` Horst von Brand
  -1 siblings, 0 replies; 16+ messages in thread
From: Horst von Brand @ 2005-03-01  1:53 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel, ultralinux

"David S. Miller" <davem@davemloft.net> said:
> On Mon, 28 Feb 2005 17:07:43 -0300
> Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

[...]

> > So, either the dependencies have to get fixed so floppy can't be modular
> > for this architecture, or the relevant functions have to move from entry.S
> > to the module.

> I think the former is the best solution.  The assembler code really
> needs to get at floppy.c symbols.

>From my cursory look the stuff depending on the floppy.c symbols is just
in the floppy-related code. Can't that be just included in floppy.c?
(Could be quite a mess, but it looks like short stretches).
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513


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

* Re: SPARC64: Modular floppy?
@ 2005-03-01  1:53     ` Horst von Brand
  0 siblings, 0 replies; 16+ messages in thread
From: Horst von Brand @ 2005-03-01  1:53 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel, ultralinux

"David S. Miller" <davem@davemloft.net> said:
> On Mon, 28 Feb 2005 17:07:43 -0300
> Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

[...]

> > So, either the dependencies have to get fixed so floppy can't be modular
> > for this architecture, or the relevant functions have to move from entry.S
> > to the module.

> I think the former is the best solution.  The assembler code really
> needs to get at floppy.c symbols.

From my cursory look the stuff depending on the floppy.c symbols is just
in the floppy-related code. Can't that be just included in floppy.c?
(Could be quite a mess, but it looks like short stretches).
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513


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

* Re: SPARC64: Modular floppy?
  2005-03-01  1:53     ` Horst von Brand
@ 2005-03-01 17:25       ` Randy.Dunlap
  -1 siblings, 0 replies; 16+ messages in thread
From: Randy.Dunlap @ 2005-03-01 17:25 UTC (permalink / raw)
  To: Horst von Brand; +Cc: David S. Miller, linux-kernel, ultralinux

Horst von Brand wrote:
> "David S. Miller" <davem@davemloft.net> said:
> 
>>On Mon, 28 Feb 2005 17:07:43 -0300
>>Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
> 
> 
> [...]
> 
> 
>>>So, either the dependencies have to get fixed so floppy can't be modular
>>>for this architecture, or the relevant functions have to move from entry.S
>>>to the module.
> 
> 
>>I think the former is the best solution.  The assembler code really
>>needs to get at floppy.c symbols.
> 
> 
>>From my cursory look the stuff depending on the floppy.c symbols is just
> in the floppy-related code. Can't that be just included in floppy.c?
> (Could be quite a mess, but it looks like short stretches).

The code in entry.S looks self-contained (to me:), so moving it
somewhere else should just be a SMOP (mostly kbuild stuff)....

-- 
~Randy

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

* Re: SPARC64: Modular floppy?
@ 2005-03-01 17:25       ` Randy.Dunlap
  0 siblings, 0 replies; 16+ messages in thread
From: Randy.Dunlap @ 2005-03-01 17:25 UTC (permalink / raw)
  To: Horst von Brand; +Cc: David S. Miller, linux-kernel, ultralinux

Horst von Brand wrote:
> "David S. Miller" <davem@davemloft.net> said:
> 
>>On Mon, 28 Feb 2005 17:07:43 -0300
>>Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
> 
> 
> [...]
> 
> 
>>>So, either the dependencies have to get fixed so floppy can't be modular
>>>for this architecture, or the relevant functions have to move from entry.S
>>>to the module.
> 
> 
>>I think the former is the best solution.  The assembler code really
>>needs to get at floppy.c symbols.
> 
> 
>>From my cursory look the stuff depending on the floppy.c symbols is just
> in the floppy-related code. Can't that be just included in floppy.c?
> (Could be quite a mess, but it looks like short stretches).

The code in entry.S looks self-contained (to me:), so moving it
somewhere else should just be a SMOP (mostly kbuild stuff)....

-- 
~Randy

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

* Re: SPARC64: Modular floppy?
  2005-03-01 17:25       ` Randy.Dunlap
@ 2005-03-01 19:26         ` Horst von Brand
  -1 siblings, 0 replies; 16+ messages in thread
From: Horst von Brand @ 2005-03-01 19:26 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: David S. Miller, linux-kernel, ultralinux

"Randy.Dunlap" <rddunlap@osdl.org> said:
> Horst von Brand wrote:
> > "David S. Miller" <davem@davemloft.net> said:
> >>On Mon, 28 Feb 2005 17:07:43 -0300
> >>Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

> > [...]

> >>>So, either the dependencies have to get fixed so floppy can't be modular
> >>>for this architecture, or the relevant functions have to move from entry.S
> >>>to the module.

> >>I think the former is the best solution.  The assembler code really
> >>needs to get at floppy.c symbols.

> >>From my cursory look the stuff depending on the floppy.c symbols is just
> > in the floppy-related code. Can't that be just included in floppy.c?
> > (Could be quite a mess, but it looks like short stretches).

> The code in entry.S looks self-contained (to me:), so moving it
> somewhere else should just be a SMOP (mostly kbuild stuff)....

Right. But where? I was thinking under arch/sparc64/drivers/floppy.S or
such. And then there would need to be some make magic for it to get picked
up and included only for sparc64. Sounds doable, if somewhat messy.

But thinking a bit farther, if every arch and random driver starts playing
this kind of games, we'll soon be in a world of hurt. Not sure if it is
worth it.

Other solution was to #ifdef that stuff into floppy.c, but again at the
end of that way lies madness.

I'll see what I come up with. Recomended reading on the whole kbuild stuff?
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

* Re: SPARC64: Modular floppy?
@ 2005-03-01 19:26         ` Horst von Brand
  0 siblings, 0 replies; 16+ messages in thread
From: Horst von Brand @ 2005-03-01 19:26 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: David S. Miller, linux-kernel, ultralinux

"Randy.Dunlap" <rddunlap@osdl.org> said:
> Horst von Brand wrote:
> > "David S. Miller" <davem@davemloft.net> said:
> >>On Mon, 28 Feb 2005 17:07:43 -0300
> >>Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

> > [...]

> >>>So, either the dependencies have to get fixed so floppy can't be modular
> >>>for this architecture, or the relevant functions have to move from entry.S
> >>>to the module.

> >>I think the former is the best solution.  The assembler code really
> >>needs to get at floppy.c symbols.

> >>From my cursory look the stuff depending on the floppy.c symbols is just
> > in the floppy-related code. Can't that be just included in floppy.c?
> > (Could be quite a mess, but it looks like short stretches).

> The code in entry.S looks self-contained (to me:), so moving it
> somewhere else should just be a SMOP (mostly kbuild stuff)....

Right. But where? I was thinking under arch/sparc64/drivers/floppy.S or
such. And then there would need to be some make magic for it to get picked
up and included only for sparc64. Sounds doable, if somewhat messy.

But thinking a bit farther, if every arch and random driver starts playing
this kind of games, we'll soon be in a world of hurt. Not sure if it is
worth it.

Other solution was to #ifdef that stuff into floppy.c, but again at the
end of that way lies madness.

I'll see what I come up with. Recomended reading on the whole kbuild stuff?
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

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

* Re: SPARC64: Modular floppy?
  2005-03-01 19:26         ` Horst von Brand
@ 2005-03-01 19:34           ` Randy.Dunlap
  -1 siblings, 0 replies; 16+ messages in thread
From: Randy.Dunlap @ 2005-03-01 19:34 UTC (permalink / raw)
  To: Horst von Brand; +Cc: David S. Miller, linux-kernel, ultralinux

Horst von Brand wrote:
> "Randy.Dunlap" <rddunlap@osdl.org> said:
> 
>>Horst von Brand wrote:
>>
>>>"David S. Miller" <davem@davemloft.net> said:
>>>
>>>>On Mon, 28 Feb 2005 17:07:43 -0300
>>>>Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
> 
> 
>>>[...]
> 
> 
>>>>>So, either the dependencies have to get fixed so floppy can't be modular
>>>>>for this architecture, or the relevant functions have to move from entry.S
>>>>>to the module.
> 
> 
>>>>I think the former is the best solution.  The assembler code really
>>>>needs to get at floppy.c symbols.
> 
> 
>>>>From my cursory look the stuff depending on the floppy.c symbols is just
>>>in the floppy-related code. Can't that be just included in floppy.c?
>>>(Could be quite a mess, but it looks like short stretches).
> 
> 
>>The code in entry.S looks self-contained (to me:), so moving it
>>somewhere else should just be a SMOP (mostly kbuild stuff)....
> 
> 
> Right. But where? I was thinking under arch/sparc64/drivers/floppy.S or
> such. And then there would need to be some make magic for it to get picked
> up and included only for sparc64. Sounds doable, if somewhat messy.
> 
> But thinking a bit farther, if every arch and random driver starts playing
> this kind of games, we'll soon be in a world of hurt. Not sure if it is
> worth it.

Then go with Dave's suggestion:  don't allow modular floppy
in Kconfig.

> Other solution was to #ifdef that stuff into floppy.c, but again at the
> end of that way lies madness.
> 
> I'll see what I come up with. Recomended reading on the whole kbuild stuff?

It's all in Documentation/kbuild/

-- 
~Randy

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

* Re: SPARC64: Modular floppy?
@ 2005-03-01 19:34           ` Randy.Dunlap
  0 siblings, 0 replies; 16+ messages in thread
From: Randy.Dunlap @ 2005-03-01 19:34 UTC (permalink / raw)
  To: Horst von Brand; +Cc: David S. Miller, linux-kernel, ultralinux

Horst von Brand wrote:
> "Randy.Dunlap" <rddunlap@osdl.org> said:
> 
>>Horst von Brand wrote:
>>
>>>"David S. Miller" <davem@davemloft.net> said:
>>>
>>>>On Mon, 28 Feb 2005 17:07:43 -0300
>>>>Horst von Brand <vonbrand@inf.utfsm.cl> wrote:
> 
> 
>>>[...]
> 
> 
>>>>>So, either the dependencies have to get fixed so floppy can't be modular
>>>>>for this architecture, or the relevant functions have to move from entry.S
>>>>>to the module.
> 
> 
>>>>I think the former is the best solution.  The assembler code really
>>>>needs to get at floppy.c symbols.
> 
> 
>>>>From my cursory look the stuff depending on the floppy.c symbols is just
>>>in the floppy-related code. Can't that be just included in floppy.c?
>>>(Could be quite a mess, but it looks like short stretches).
> 
> 
>>The code in entry.S looks self-contained (to me:), so moving it
>>somewhere else should just be a SMOP (mostly kbuild stuff)....
> 
> 
> Right. But where? I was thinking under arch/sparc64/drivers/floppy.S or
> such. And then there would need to be some make magic for it to get picked
> up and included only for sparc64. Sounds doable, if somewhat messy.
> 
> But thinking a bit farther, if every arch and random driver starts playing
> this kind of games, we'll soon be in a world of hurt. Not sure if it is
> worth it.

Then go with Dave's suggestion:  don't allow modular floppy
in Kconfig.

> Other solution was to #ifdef that stuff into floppy.c, but again at the
> end of that way lies madness.
> 
> I'll see what I come up with. Recomended reading on the whole kbuild stuff?

It's all in Documentation/kbuild/

-- 
~Randy

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

* Re: SPARC64: Modular floppy?
  2005-02-28 20:07 ` Horst von Brand
@ 2005-03-01 19:49 ` Randy.Dunlap
  -1 siblings, 0 replies; 16+ messages in thread
From: Randy.Dunlap @ 2005-03-01 19:49 UTC (permalink / raw)
  To: sam, David S. Miller, linux-kernel, ultralinux; +Cc: Horst von Brand

(Sam, your From: From: Sam Ravnborg <>  really trips thunderbird.)

Sam wrote:
Documentation/kbuild/makefiles.txt is a good start.
For specific questions I can help out.

For this specific case the problem seems to me that you in the ppc64
case want to include floppy-ppc64.S in the build for the PPC64 case.
So something as simple as:

1) rename floppy.c to floppy-core.c

2) Change Makefile to look like:
floppy-y        := floppy-core.o
floppy-$(PPC64) += floppy-ppc64.o
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Minor detail, This is for sparc64 (see Subject).

I also see that arch/arm[26]/lib/ has special handling for
floppydma.S, so there'a a model to consider also.

-- 
~Randy

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

* Re: SPARC64: Modular floppy?
@ 2005-03-01 19:49 ` Randy.Dunlap
  0 siblings, 0 replies; 16+ messages in thread
From: Randy.Dunlap @ 2005-03-01 19:49 UTC (permalink / raw)
  To: sam, David S. Miller, linux-kernel, ultralinux; +Cc: Horst von Brand

(Sam, your From: From: Sam Ravnborg <>  really trips thunderbird.)

Sam wrote:
Documentation/kbuild/makefiles.txt is a good start.
For specific questions I can help out.

For this specific case the problem seems to me that you in the ppc64
case want to include floppy-ppc64.S in the build for the PPC64 case.
So something as simple as:

1) rename floppy.c to floppy-core.c

2) Change Makefile to look like:
floppy-y        := floppy-core.o
floppy-$(PPC64) += floppy-ppc64.o
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Minor detail, This is for sparc64 (see Subject).

I also see that arch/arm[26]/lib/ has special handling for
floppydma.S, so there'a a model to consider also.

-- 
~Randy

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

* Re: SPARC64: Modular floppy?
  2005-03-01 19:26         ` Horst von Brand
@ 2005-03-01 23:04           ` David S. Miller
  -1 siblings, 0 replies; 16+ messages in thread
From: David S. Miller @ 2005-03-01 23:04 UTC (permalink / raw)
  To: Horst von Brand; +Cc: rddunlap, linux-kernel, ultralinux

On Tue, 01 Mar 2005 16:26:05 -0300
Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

> Right. But where? I was thinking under arch/sparc64/drivers/floppy.S or
> such. And then there would need to be some make magic for it to get picked
> up and included only for sparc64. Sounds doable, if somewhat messy.

Sparc 32-bit has the same problem btw.  It's a direct IRQ handler that
doesn't need to save any trap state.

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

* Re: SPARC64: Modular floppy?
@ 2005-03-01 23:04           ` David S. Miller
  0 siblings, 0 replies; 16+ messages in thread
From: David S. Miller @ 2005-03-01 23:04 UTC (permalink / raw)
  To: Horst von Brand; +Cc: rddunlap, linux-kernel, ultralinux

On Tue, 01 Mar 2005 16:26:05 -0300
Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

> Right. But where? I was thinking under arch/sparc64/drivers/floppy.S or
> such. And then there would need to be some make magic for it to get picked
> up and included only for sparc64. Sounds doable, if somewhat messy.

Sparc 32-bit has the same problem btw.  It's a direct IRQ handler that
doesn't need to save any trap state.

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

end of thread, other threads:[~2005-03-01 23:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 19:49 SPARC64: Modular floppy? Randy.Dunlap
2005-03-01 19:49 ` Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2005-02-28 20:07 Horst von Brand
2005-02-28 20:07 ` Horst von Brand
2005-02-28 23:51 ` David S. Miller
2005-02-28 23:51   ` David S. Miller
2005-03-01  1:53   ` Horst von Brand
2005-03-01  1:53     ` Horst von Brand
2005-03-01 17:25     ` Randy.Dunlap
2005-03-01 17:25       ` Randy.Dunlap
2005-03-01 19:26       ` Horst von Brand
2005-03-01 19:26         ` Horst von Brand
2005-03-01 19:34         ` Randy.Dunlap
2005-03-01 19:34           ` Randy.Dunlap
2005-03-01 23:04         ` David S. Miller
2005-03-01 23:04           ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.