From: Jaswinder Singh Rajput on
Hello Paul,

On Tue, May 18, 2010 at 2:55 PM, Paul Mundt <lethal(a)linux-sh.org> wrote:
> Please pull from:
>
> � � � �master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6.git
>
> Which contains:
>
...
> �drivers/dma/shdma.c � � � � � � � � � � � � | � 52 ++-
> �drivers/dma/shdma.h � � � � � � � � � � � � | � �4 +-
> �drivers/serial/sh-sci.c � � � � � � � � � � | �189 ++++++---
> �drivers/sh/Kconfig � � � � � � � � � � � � �| � 24 +
> �drivers/sh/Makefile � � � � � � � � � � � � | � �2 +
> �drivers/sh/clk-cpg.c � � � � � � � � � � � �| �298 +++++++++++++
> �drivers/sh/clk.c � � � � � � � � � � � � � �| �545 ++++++++++++++++++++++
> �drivers/sh/intc.c � � � � � � � � � � � � � | �333 +++++++++++++--
> �include/linux/device.h � � � � � � � � � � �| � �4 +
> �include/linux/serial_sci.h � � � � � � � � �| � �4 +-
> �include/linux/sh_clk.h � � � � � � � � � � �| �150 +++++++
> �include/linux/sh_dma.h � � � � � � � � � � �| �102 +++++
> �include/linux/sh_intc.h � � � � � � � � � � | � 26 +-
...
> �create mode 100644 drivers/sh/Kconfig
> �create mode 100644 drivers/sh/clk-cpg.c
> �create mode 100644 drivers/sh/clk.c
> �create mode 100644 include/linux/sh_clk.h
> �create mode 100644 include/linux/sh_dma.h

I have few doubts :

1. Which other architectures are using :
include/linux/sh_clk.h, include/linux/sh_dma.h and include/linux/sh_intc.h

2. If you think, in future some architecture will going to use these
files, then do you think sh_*.h name is appropriate.

3. Can we move :
include/linux/sh_clk.h -> drivers/sh/sh_clk.h
include/linux/sh_dma.h -> drivers/dma/sh_dma.h
include/linux/sh_intc.h -> drivers/sh/sh_intc.h
So that if someone want to use these file they can use it from here.

Thanks,
--
Jaswinder Singh.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Paul Mundt on
On Tue, May 18, 2010 at 03:15:31PM +0530, Jaswinder Singh Rajput wrote:
> I have few doubts :
>
> 1. Which other architectures are using :
> include/linux/sh_clk.h, include/linux/sh_dma.h and include/linux/sh_intc.h
>
ARM for starters, and there are likely to be others in the future, too.
Grepping would have made this pretty apparent.

> 2. If you think, in future some architecture will going to use these
> files, then do you think sh_*.h name is appropriate.
>
Yes, given that they're all SH IP blocks. Although if there's many more
of them then of course putting them in their own subdirectory is an
option, too.

> 3. Can we move :
> include/linux/sh_clk.h -> drivers/sh/sh_clk.h
> include/linux/sh_dma.h -> drivers/dma/sh_dma.h
> include/linux/sh_intc.h -> drivers/sh/sh_intc.h
> So that if someone want to use these file they can use it from here.
>
No.

The alternative is creating a shared architecture directory, which
doesn't really scale well given how these blocks can be arbitrarily
reused across different architectures -- but it's still something we
might have to look at depending on what else pops up that can't be
cleanly shared through the current scheme. You're of course welcome to
dig up the discussions in the archives when the ARM SH-Mobile code was
introduced in the first place.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Paul Mundt on
On Tue, May 18, 2010 at 04:21:37PM +0530, Jaswinder Singh Rajput wrote:
> On Tue, May 18, 2010 at 3:45 PM, Paul Mundt <lethal(a)linux-sh.org> wrote:
> Hmm, so still it is between ARM and SH, so better option will be :
>
Those were examples, we already have cases where blocks are shared across
more architectures than that.

> include/linux/sh_clk.h -> include/sh/clk.h
> include/linux/sh_dma.h -> include/sh/dma.h
> include/linux/sh_intc.h -> include/sh/intc.h
>
> So when arm files will come then, then we can make it like this :
>
The ARM use case is already there, today.

> include/arm/clk.h
> include/arm/dma.h
> include/arm/intc.h
>
Did you even bother looking at the files and how they are used? We are
not going to duplicate identical files for each architecture.

> There are no doubts in future we will have asymmetrical processing,
> where we will use multiple architectures, so better make different
> directory for them instead of putting load on include/linux which
> already over-loaded.
>
You seem to be ignoring the fact that we've had these use cases for years
already and that the current scheme has so far served us pretty well in
that regard. If we have headers for drivers that are used across multiple
architectures, then include/linux is ultimately the proper place for
them. We could shoe-horn them in to some sort of pseudo-architecture
thing in include/ but for what purpose?

Until you've actually read through the background mail on this and
actually looked at the code in question I see very little point in
continuing this thread. I'm of course open to suggestions on how to make
this sort of abstraction cleaner, but so far none of your suggestions are
relevant to the problem at hand.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jaswinder Singh Rajput on
Hello Paul,

On Tue, May 18, 2010 at 3:45 PM, Paul Mundt <lethal(a)linux-sh.org> wrote:
> On Tue, May 18, 2010 at 03:15:31PM +0530, Jaswinder Singh Rajput wrote:
>> I have few doubts :
>>
>> 1. Which other architectures are using :
>> include/linux/sh_clk.h, include/linux/sh_dma.h and include/linux/sh_intc.h
>>
> ARM for starters, and there are likely to be others in the future, too.
> Grepping would have made this pretty apparent.
>
>> 2. If you think, in future some architecture will going to use these
>> files, then do you think sh_*.h name is appropriate.
>>
> Yes, given that they're all SH IP blocks. Although if there's many more
> of them then of course putting them in their own subdirectory is an
> option, too.
>
>> 3. Can we move :
>> include/linux/sh_clk.h -> drivers/sh/sh_clk.h
>> include/linux/sh_dma.h -> drivers/dma/sh_dma.h
>> include/linux/sh_intc.h -> drivers/sh/sh_intc.h
>> So that if someone want to use these file they can use it from here.
>>
> No.
>
> The alternative is creating a shared architecture directory, which
> doesn't really scale well given how these blocks can be arbitrarily
> reused across different architectures -- but it's still something we
> might have to look at depending on what else pops up that can't be
> cleanly shared through the current scheme. You're of course welcome to
> dig up the discussions in the archives when the ARM SH-Mobile code was
> introduced in the first place.
>

Hmm, so still it is between ARM and SH, so better option will be :

include/linux/sh_clk.h -> include/sh/clk.h
include/linux/sh_dma.h -> include/sh/dma.h
include/linux/sh_intc.h -> include/sh/intc.h

So when arm files will come then, then we can make it like this :

include/arm/clk.h
include/arm/dma.h
include/arm/intc.h

So user will program like this :

#include <arm/dma.h>
#include <sh/dma.h>


There are no doubts in future we will have asymmetrical processing,
where we will use multiple architectures, so better make different
directory for them instead of putting load on include/linux which
already over-loaded.

Thanks,
--
Jaswinder Singh.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Magnus Damm on
Hi Jaswinder,

On Tue, May 18, 2010 at 7:51 PM, Jaswinder Singh Rajput
<jaswinderlinux(a)gmail.com> wrote:
> Hmm, so still it is between ARM and SH, so better option will be :
>
> include/linux/sh_clk.h -> include/sh/clk.h
> include/linux/sh_dma.h -> include/sh/dma.h
> include/linux/sh_intc.h -> include/sh/intc.h
>
> So when arm files will come then, then we can make it like this :
>
> include/arm/clk.h
> include/arm/dma.h
> include/arm/intc.h
>
> So user will program like this :
>
> #include <arm/dma.h>
> #include <sh/dma.h>

Right now the SH code does

#include <linux/sh_intc.h>

and the ARM code does

#include <linux/sh_intc.h>

Hope this clarifies!

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/