Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V4 3/3] ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names
From: Rajeshwari Birje @ 2011-10-12 12:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4E956ADB.3060604@samsung.com>

Hi Sylwester,


On Wed, Oct 12, 2011 at 3:54 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> Hi Rajeshwari,
>
> On 10/12/2011 11:43 AM, Rajeshwari Shinde wrote:
>> Add support for lookup of sdhci-s3c controller clocks using generic names
>> for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.
>>
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>> ---
>> ?arch/arm/mach-exynos4/clock.c ? ? ? ? | ? 88 ++++++++++-------
>> ?arch/arm/mach-s3c2416/clock.c ? ? ? ? | ? 68 +++++++------
>> ?arch/arm/mach-s3c64xx/clock.c ? ? ? ? | ?126 +++++++++++++++----------
>> ?arch/arm/mach-s5pc100/clock.c ? ? ? ? | ?130 ++++++++++++++++----------
>> ?arch/arm/mach-s5pv210/clock.c ? ? ? ? | ?167 ++++++++++++++++++++-------------
>> ?arch/arm/plat-s3c24xx/s3c2443-clock.c | ? 15 ++-
>> ?6 files changed, 359 insertions(+), 235 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
>> index 9f50e33..c6383b9 100644
>> --- a/arch/arm/mach-exynos4/clock.c
>> +++ b/arch/arm/mach-exynos4/clock.c
>> @@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
>> ? ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
>> ? ? ? }, {
>> ? ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
>> - ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> - ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.0",
>> - ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc0.clk,
>> - ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> - ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 0),
>> - ? ? ? ? ? ? },
>> - ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
>> - ? ? }, {
>> - ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
>> - ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> - ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.1",
>> - ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc1.clk,
>> - ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> - ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 4),
>> - ? ? ? ? ? ? },
>> - ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
>> - ? ? }, {
>> - ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
>> - ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> - ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.2",
>> - ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc2.clk,
>> - ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> - ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 8),
>> - ? ? ? ? ? ? },
>> - ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
>> - ? ? }, {
>> - ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
>> - ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> - ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.3",
>> - ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc3.clk,
>> - ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> - ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 12),
>> - ? ? ? ? ? ? },
>> - ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
>> - ? ? }, {
>> - ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
>> ? ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_dwmmc",
>> ? ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc4.clk,
>> ? ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> @@ -1250,6 +1214,50 @@ static struct clksrc_clk clk_sclk_uart3 = {
>> ? ? ? .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
>> ?};
>>
>> +static struct clksrc_clk clk_sclk_mmc0 = {
>> + ? ? .clk ? ? ? ? ? ?= {
>> + ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> + ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.0",
>
> Would it make sense to drop this 'devname' field here and others
> until sclk_mmc3 ....

*** The devname here distinguishes these clocks. So it should be okay
to have a devname for these clocks.

>
>> + ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc0.clk,
>> + ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> + ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 0),
>> + ? ? },
>> + ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
>> +};
>> +
>> +static struct clksrc_clk clk_sclk_mmc1 = {
>> + ? ? .clk ? ? ? ? ? ?= {
>> + ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> + ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.1",
>
>> + ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc1.clk,
>> + ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> + ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 4),
>> + ? ? },
>> + ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
>> +};
>> +
>> +static struct clksrc_clk clk_sclk_mmc2 = {
>> + ? ? .clk ? ? ? ? ? ?= {
>> + ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> + ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.2",
>
>> + ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc2.clk,
>> + ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> + ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 8),
>> + ? ? },
>> + ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
>> +};
>> +
>> +static struct clksrc_clk clk_sclk_mmc3 = {
>> + ? ? .clk ? ? ? ? ? ?= {
>> + ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
>> + ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.3",
>
>> + ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc3.clk,
>> + ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
>> + ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 12),
>> + ? ? },
>> + ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
>> +};
>> +
>> ?/* Clock initialization code */
>> ?static struct clksrc_clk *sysclks[] = {
>> ? ? ? &clk_mout_apll,
>> @@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
>> ? ? ? &clk_sclk_uart1,
>> ? ? ? &clk_sclk_uart2,
>> ? ? ? &clk_sclk_uart3,
>> + ? ? &clk_sclk_mmc0,
>> + ? ? &clk_sclk_mmc1,
>> + ? ? &clk_sclk_mmc2,
>> + ? ? &clk_sclk_mmc3,
>
> ..then drop the above 4 lines...

**** The registration for these clocks are important. The
s3c_register_clksrc() function sets the .ops of this clock and also
its parent. So the registration cannot be dropped.

>
>> ?};
>>
>> ?static struct clk_lookup exynos4_clk_lookup[] = {
>> @@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
>> ? ? ? CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
>> ? ? ? CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
>> ? ? ? CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
>> + ? ? CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
>> + ? ? CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
>> + ? ? CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
>> + ? ? CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
>
> ..and add something like:
>
> ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.0", "sclk_mmc", &clk_sclk_mmc0.clk),
> ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.1", "sclk_mmc", &clk_sclk_mmc1.clk),
> ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.2", "sclk_mmc", &clk_sclk_mmc2.clk),
> ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.3", "sclk_mmc", &clk_sclk_mmc3.clk),
>
> ?

**** The driver uses a common name for the possible bus clock sources,
that is ?mmc_busclk?. This keeps the clock lookup code in the driver
simple. Also, there could be SoC?s which do no use sclk_mmc as the bus
clock name as per the user manual


>
> Also I'm wondering why we're using different device names for clk_sclk_mmc0..3
> clocks, i.e. exynos4-sdhci.? and s3c-sdhci.? ?
>
> Does it all work on exynos ? I would expect the device name to be same
> across all the clock definitions, otherwise clk_get(dev, ..) will fail.

**** There was a patch submitted to rename the device name of sdhci
for Exynos to exynos4-sdhci. I will remove this change from this patch
and let that patch handle this change.

>
>> ?};
>>
>
> Regards
> --
> Sylwester Nawrocki
> Samsung Poland R&D Center
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

Regards,
Rajeshwari Shinde.

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Dave Airlie @ 2011-10-12 12:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1318325033-32688-2-git-send-email-sumit.semwal@ti.com>

On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal <sumit.semwal@ti.com> wrote:
> This is the first step in defining a dma buffer sharing mechanism.
>
> A new buffer object dma_buf is added, with operations and API to allow easy
> sharing of this buffer object across devices.
>
> The framework allows:
> - a new buffer-object to be created with fixed size.
> - different devices to 'attach' themselves to this buffer, to facilitate
> ?backing storage negotiation, using dma_buf_attach() API.
> - association of a file pointer with each user-buffer and associated
> ? allocator-defined operations on that buffer. This operation is called the
> ? 'export' operation.
> - this exported buffer-object to be shared with the other entity by asking for
> ? its 'file-descriptor (fd)', and sharing the fd across.
> - a received fd to get the buffer object back, where it can be accessed using
> ? the associated exporter-defined operations.
> - the exporter and user to share the scatterlist using get_scatterlist and
> ? put_scatterlist operations.
>
> Atleast one 'attach()' call is required to be made prior to calling the
> get_scatterlist() operation.
>
> Couple of building blocks in get_scatterlist() are added to ease introduction
> of sync'ing across exporter and users, and late allocation by the exporter.
>
> mmap() file operation is provided for the associated 'fd', as wrapper over the
> optional allocator defined mmap(), to be used by devices that might need one.

Why is this needed? it really doesn't make sense to be mmaping objects
independent of some front-end like drm or v4l.

how will you know what contents are in them, how will you synchronise
access. Unless someone has a hard use-case for this I'd say we drop it
until someone does.

Dave.

^ permalink raw reply

* [PATCH] ARM: SAMSUNG: s3c-dma-ops needs export.h for EXPORT_SYMBOL
From: Kukjin Kim @ 2011-10-12 12:42 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317961214.16109.1.camel@phoenix>

Kukjin Kim wrote:
> 
> Axel Lin wrote:
> >
> > Fix below build warning:
> >   CC      arch/arm/plat-samsung/s3c-dma-ops.o
> > arch/arm/plat-samsung/s3c-dma-ops.c:130: warning: data definition has no type
> or
> > storage class
> > arch/arm/plat-samsung/s3c-dma-ops.c:130: warning: type defaults to 'int' in
> > declaration of 'EXPORT_SYMBOL'
> > arch/arm/plat-samsung/s3c-dma-ops.c:130: warning: parameter names (without
> > types) in function declaration
> >
> > And fix the build error:
> > ERROR: "s3c_dma_get_ops" [drivers/spi/spi-s3c64xx.ko] undefined!
> > make[1]: *** [__modpost] Error 1
> > make: *** [modules] Error 2
> >
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
> > ---
> > This can be reproduced by "make s3c6400_defconfig;make" on linux-next
> > 20111006.
> >  arch/arm/plat-samsung/s3c-dma-ops.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/plat-samsung/s3c-dma-ops.c b/arch/arm/plat-samsung/s3c-
> > dma-ops.c
> > index 582333c..7814949 100644
> > --- a/arch/arm/plat-samsung/s3c-dma-ops.c
> > +++ b/arch/arm/plat-samsung/s3c-dma-ops.c
> > @@ -14,6 +14,7 @@
> >  #include <linux/errno.h>
> >  #include <linux/slab.h>
> >  #include <linux/types.h>
> > +#include <linux/export.h>
> >
> >  #include <mach/dma.h>
> >
> > --
> > 1.7.4.1
> >
> OK, will apply.
> 
> BTW, I don't know why the build error/warning was not happened in my tree with
> s3c6400_defconfig. Probably other file having it?...
> 
Hi Axel,

When I applied this in my tree, happened following error with s3c6400_defconfig.

arch/arm/plat-samsung/s3c-dma-ops.c:17: fatal error: linux/export.h: No such file or directory

Probably the <linux/export.h> file has been added from other tree.
So if required, will fix with this during upcoming merge window maybe at end of.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH v2] ARM: EXYNOS4: Add support for M-5MOLS camera on Nuri board
From: Kukjin Kim @ 2011-10-12 12:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1318238959-28012-1-git-send-email-s.nawrocki@samsung.com>

Kukjin Kim wrote:
> 
> Sylwester Nawrocki wrote:
> >
> > Add voltage regulator and platform data definition for M-5MOLS sensor
> > and MIPI-CSI receiver drivers. Add CAM power domain dependencies for
> > FIMC device and set up camera port A GPIO. Configure I2C0 bus timings.
> >
> > Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> > Signed-off-by: HeungJun Kim <riverful.kim@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > Hi Kgene,
> >
> > I have corrected the white space issues as you pointed out and removed
> > unnecessary gpio_free() in this patch.
> >
> > Thanks,
> >  Sylwester
> > ---
> >  arch/arm/mach-exynos4/Kconfig     |    8 ++
> >  arch/arm/mach-exynos4/mach-nuri.c |  156
> > +++++++++++++++++++++++++++++++++++++
> >  2 files changed, 164 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-exynos4/Kconfig
b/arch/arm/mach-exynos4/Kconfig
> > index dd660eb..4bc4b1f 100644
> > --- a/arch/arm/mach-exynos4/Kconfig
> > +++ b/arch/arm/mach-exynos4/Kconfig

(snip)

> > +static struct s5p_platform_fimc fimc_md_platdata = {
> > +	.isp_info	= nuri_camera_sensors,
> > +	.num_clients	= ARRAY_SIZE(nuri_camera_sensors),
> > +};

Hi Sylwester,

You need to move 'struct platform_device s5p_device_fimc_md' to
plat-samsung/devs.c or add 'static' because following error is happened.

arch/arm/mach-exynos4/mach-nuri.o: In function `  CC      kernel/sysctl.o
.LANCHOR1':
mach-nuri.c:(.data+0x38): multiple definition of `s5p_device_fimc_md'
arch/arm/mach-exynos4/mach-universal_c210.o:mach-universal_c210.c:(.data+0x1
8): first defined here
make[2]: *** [arch/arm/mach-exynos4/built-in.o] Error 1
make[1]: *** [arch/arm/mach-exynos4] Error 2
make[1]: *** Waiting for unfinished jobs....

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH] fixup: mm: alloc_contig_range: increase min_free_kbytes during allocation
From: Maxime Coquelin @ 2011-10-12 13:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1318417735-9199-1-git-send-email-m.szyprowski@samsung.com>

Hello Marek,

On 10/12/2011 01:08 PM, Marek Szyprowski wrote:
> Signed-off-by: Marek Szyprowski<m.szyprowski@samsung.com>
> ---
>   mm/page_alloc.c |   15 ++++++++++++---
>   1 files changed, 12 insertions(+), 3 deletions(-)
>
> Hello Maxime,
>
> Please check if this patch fixes your lockup issue. It is a bit cruel,
> but it looks that in case of real low-memory situation page allocation
> is very complex task which usually ends in waiting for the io/fs and
> free pages that really don't arrive at all.
Thanks for the reactivity.
We just tested it, we no more faced the lockup. Instead, the OOM Killer 
is triggered and contiguous allocation succeed.
I'm not familiar enough with page_alloc.c to detect any side effects 
this patch could bring.

> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
>
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 055aa4c..45473e9 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5872,6 +5872,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
>   		       gfp_t flags, unsigned migratetype)
>   {
>   	unsigned long outer_start, outer_end;
> +	unsigned int count = end - start;
>   	int ret;
>
>   	/*
> @@ -5900,7 +5901,10 @@ int alloc_contig_range(unsigned long start, unsigned long end,
>   	ret = __start_isolate_page_range(pfn_to_maxpage(start),
>   					 pfn_to_maxpage_up(end), migratetype);
>   	if (ret)
> -		goto done;
> +		return ret;
> +
> +	min_free_kbytes += count * PAGE_SIZE / 1024;
> +	setup_per_zone_wmarks();
>
>   	ret = __alloc_contig_migrate_range(start, end);
>   	if (ret)
> @@ -5922,8 +5926,10 @@ int alloc_contig_range(unsigned long start, unsigned long end,
>
>   	ret = 0;
>   	while (!PageBuddy(pfn_to_page(start&  (~0UL<<  ret))))
> -		if (WARN_ON(++ret>= MAX_ORDER))
> -			return -EINVAL;
> +		if (WARN_ON(++ret>= MAX_ORDER)) {
> +			ret = -EINVAL;
> +			goto done;
> +		}
>
>   	outer_start = start&  (~0UL<<  ret);
>   	outer_end   = alloc_contig_freed_pages(outer_start, end, flags);
> @@ -5936,6 +5942,9 @@ int alloc_contig_range(unsigned long start, unsigned long end,
>
>   	ret = 0;
>   done:
> +	min_free_kbytes -= count * PAGE_SIZE / 1024;
> +	setup_per_zone_wmarks();
> +
>   	__undo_isolate_page_range(pfn_to_maxpage(start), pfn_to_maxpage_up(end),
>   				  migratetype);
>   	return ret;

Best regards,
Maxime

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Rob Clark @ 2011-10-12 13:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPM=9tzHOa5Dbe=SQz+AURMMbio4L7qoS8kUT3Ek0+HdtkrH4g@mail.gmail.com>

On Wed, Oct 12, 2011 at 7:41 AM, Dave Airlie <airlied@gmail.com> wrote:
> On Tue, Oct 11, 2011 at 10:23 AM, Sumit Semwal <sumit.semwal@ti.com> wrote:
>> This is the first step in defining a dma buffer sharing mechanism.
>>
>> A new buffer object dma_buf is added, with operations and API to allow easy
>> sharing of this buffer object across devices.
>>
>> The framework allows:
>> - a new buffer-object to be created with fixed size.
>> - different devices to 'attach' themselves to this buffer, to facilitate
>> ?backing storage negotiation, using dma_buf_attach() API.
>> - association of a file pointer with each user-buffer and associated
>> ? allocator-defined operations on that buffer. This operation is called the
>> ? 'export' operation.
>> - this exported buffer-object to be shared with the other entity by asking for
>> ? its 'file-descriptor (fd)', and sharing the fd across.
>> - a received fd to get the buffer object back, where it can be accessed using
>> ? the associated exporter-defined operations.
>> - the exporter and user to share the scatterlist using get_scatterlist and
>> ? put_scatterlist operations.
>>
>> Atleast one 'attach()' call is required to be made prior to calling the
>> get_scatterlist() operation.
>>
>> Couple of building blocks in get_scatterlist() are added to ease introduction
>> of sync'ing across exporter and users, and late allocation by the exporter.
>>
>> mmap() file operation is provided for the associated 'fd', as wrapper over the
>> optional allocator defined mmap(), to be used by devices that might need one.
>
> Why is this needed? it really doesn't make sense to be mmaping objects
> independent of some front-end like drm or v4l.

well, the mmap is actually implemented by the buffer allocator
(v4l/drm).. although not sure if this was the point

> how will you know what contents are in them, how will you synchronise
> access. Unless someone has a hard use-case for this I'd say we drop it
> until someone does.

The intent was that this is for well defined formats.. ie. it would
need to be a format that both v4l and drm understood in the first
place for sharing to make sense at all..

Anyways, the basic reason is to handle random edge cases where you
need sw access to the buffer.  For example, you are decoding video and
pull out a frame to generate a thumbnail w/ a sw jpeg encoder..

On gstreamer 0.11 branch, for example, there is already a map/unmap
virtual method on the gst buffer for sw access (ie. same purpose as
PrepareAccess/FinishAccess in EXA).  The idea w/ dmabuf mmap() support
is that we could implement support to mmap()/munmap() before/after sw
access.

With this current scheme, synchronization could be handled in
dmabufops->mmap() and vm_ops->close()..  it is perhaps a bit heavy to
require mmap/munmap for each sw access, but I suppose this isn't
really for the high-performance use case.  It is just so that some
random bit of sw that gets passed a dmabuf handle without knowing who
allocated it can have sw access if really needed.

BR,
-R

> Dave.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

* [PATCH] gpio: exynos4: Add device tree support
From: Kukjin Kim @ 2011-10-12 13:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1318320974-9879-1-git-send-email-thomas.abraham@linaro.org>

Thomas Abraham wrote:
> 
> As gpio chips get registered, a device tree node which represents the
> gpio chip is searched and attached to it. A translate function is also
> provided to convert the gpio specifier into actual platform settings
> for pin function selection, pull up/down and driver strength settings.
> 
> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
> ---
> This patch is based on the latest consolidated Samsung GPIO driver
available
> in the following tree:
>   https://github.com/kgene/linux-samsung.git  branch: for-next
> 
>  .../devicetree/bindings/gpio/gpio-samsung.txt      |   30 +++++++++++
>  drivers/gpio/gpio-samsung.c                        |   53
> ++++++++++++++++++++
>  2 files changed, 83 insertions(+), 0 deletions(-)
>  create mode 100644
Documentation/devicetree/bindings/gpio/gpio-samsung.txt
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
> b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
> new file mode 100644
> index 0000000..883faeb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
> @@ -0,0 +1,30 @@
> +Samsung Exynos4 GPIO Controller
> +
> +Required properties:
> +- compatible: Format of compatible property value should be
> +  "samsung,exynos4-gpio-<controller_name>". Example: For GPA0 controller,
> the
> +  compatible property value should be "samsung,exynos4-gpio-gpa0".
> +
> +- reg: Physical base address of the controller and length of memory
mapped
> region.
> +
> +- #gpio-cells: Should be 4. The syntax of the gpio specifier used by
client nodes
> +  should be the following with values derived from the SoC user manual.
> +     <[phandle of the gpio controller node] <pin number within the gpio
> controller]
> +      [mux function] [pull up/down] [drive strength]>
> +
> +- gpio-controller: Specifies that the node is a gpio controller.
> +
> +- #address-cells: should be 1.
> +
> +- #size-cells: should be 1.
> +
> +Example:
> +
> +	gpa0: gpio-controller at 11400000 {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		compatible = "samsung,exynos4-gpio-gpa0";
> +		reg = <0x11400000 0x20>;
> +		#gpio-cells = <4>;
> +		gpio-controller;
> +	};
> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> index b6be77a..037d3bb 100644
> --- a/drivers/gpio/gpio-samsung.c
> +++ b/drivers/gpio/gpio-samsung.c
> @@ -24,6 +24,10 @@
>  #include <linux/interrupt.h>
>  #include <linux/sysdev.h>
>  #include <linux/ioport.h>
> +#ifdef CONFIG_OF
> +#include <linux/of.h>
> +#include <linux/slab.h>
> +#endif
> 
>  #include <asm/irq.h>
> 
> @@ -2353,6 +2357,52 @@ static struct samsung_gpio_chip exynos4_gpios_3[] =
> {
>  #endif
>  };
> 
> +#if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
> +int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np,
> +			 const void *gpio_spec, u32 *flags)
> +{
> +	const __be32 *gpio = gpio_spec;
> +	const u32 n = be32_to_cpup(gpio);
> +	unsigned int pin = gc->base + be32_to_cpu(gpio[0]);
> +
> +	if (gc->of_gpio_n_cells < 4) {
> +		WARN_ON(1);
> +		return -EINVAL;
> +	}
> +
> +	if (n > gc->ngpio)
> +		return -EINVAL;
> +
> +	s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(be32_to_cpu(gpio[1])));
> +	s3c_gpio_setpull(pin, be32_to_cpu(gpio[2]));
> +	s5p_gpio_set_drvstr(pin, be32_to_cpu(gpio[3]));
> +	return n;
> +}
> +
> +static __init void exynos4_gpiolib_attach_ofnode(struct gpio_chip *gc)
> +{
> +	const char exynos4_gpio_compat_base[] = "samsung,exynos4-gpio-";
> +	char *exynos4_gpio_compat;
> +
> +	exynos4_gpio_compat = kzalloc(strlen(exynos4_gpio_compat_base) +
> +				strlen(gc->label), GFP_KERNEL);
> +	if (!exynos4_gpio_compat)
> +		return;
> +
> +	strcpy(exynos4_gpio_compat, exynos4_gpio_compat_base);
> +	strcat(exynos4_gpio_compat, gc->label);
> +	gc->of_node = of_find_compatible_node(NULL, NULL,
> exynos4_gpio_compat);
> +	gc->of_gpio_n_cells = 4;
> +	gc->of_xlate = exynos4_gpio_xlate;
> +	kfree(exynos4_gpio_compat);
> +}
> +#else
> +static __init void exynos4_gpiolib_attach_ofnode(struct gpio_chip *chip)
> +{
> +	return;
> +}
> +#endif /* defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF) */
> +
>  /* TODO: cleanup soc_is_* */
>  static __init int samsung_gpiolib_init(void)
>  {
> @@ -2434,6 +2484,7 @@ static __init int samsung_gpiolib_init(void)
>  				chip->config = &exynos4_gpio_cfg;
>  				chip->group = group++;
>  			}
> +			exynos4_gpiolib_attach_ofnode(&chip->chip);
>  		}
>  		samsung_gpiolib_add_4bit_chips(exynos4_gpios_1, nr_chips,
> S5P_VA_GPIO1);
> 
> @@ -2446,6 +2497,7 @@ static __init int samsung_gpiolib_init(void)
>  				chip->config = &exynos4_gpio_cfg;
>  				chip->group = group++;
>  			}
> +			exynos4_gpiolib_attach_ofnode(&chip->chip);
>  		}
>  		samsung_gpiolib_add_4bit_chips(exynos4_gpios_2, nr_chips,
> S5P_VA_GPIO2);
> 
> @@ -2458,6 +2510,7 @@ static __init int samsung_gpiolib_init(void)
>  				chip->config = &exynos4_gpio_cfg;
>  				chip->group = group++;
>  			}
> +			exynos4_gpiolib_attach_ofnode(&chip->chip);
>  		}
>  		samsung_gpiolib_add_4bit_chips(exynos4_gpios_3, nr_chips,
> S5P_VA_GPIO3);
> 
> --
> 1.6.6.rc2

Hi Thomas,

You got some comments from Rob, so could you please address from him?
Others, looks ok to me.

And I need to get the ack from Grant to upstream via Samsung tree for
upcoming merge window.
Grant, is this ok for you?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Dave Airlie @ 2011-10-12 13:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAF6AEGs6kkGp85NoNVuq5W9i=WE86V8wvAtKydX=D3bQOc+6Pw@mail.gmail.com>

>
> well, the mmap is actually implemented by the buffer allocator
> (v4l/drm).. although not sure if this was the point

Then why not use the correct interface? doing some sort of not-quite
generic interface isn't really helping anyone except adding an ABI
that we have to support.

If someone wants to bypass the current kernel APIs we should add a new
API for them not shove it into this generic buffer sharing layer.

> The intent was that this is for well defined formats.. ie. it would
> need to be a format that both v4l and drm understood in the first
> place for sharing to make sense at all..

How will you know the stride to take a simple example? The userspace
had to create this buffer somehow and wants to share it with
"something", you sound like
you really needs another API that is a simple accessor API that can
handle mmaps.

> Anyways, the basic reason is to handle random edge cases where you
> need sw access to the buffer. ?For example, you are decoding video and
> pull out a frame to generate a thumbnail w/ a sw jpeg encoder..

Again, doesn't sound like it should be part of this API, and also
sounds like the sw jpeg encoder will need more info about the buffer
anyways like stride and format.

> With this current scheme, synchronization could be handled in
> dmabufops->mmap() and vm_ops->close().. ?it is perhaps a bit heavy to
> require mmap/munmap for each sw access, but I suppose this isn't
> really for the high-performance use case. ?It is just so that some
> random bit of sw that gets passed a dmabuf handle without knowing who
> allocated it can have sw access if really needed.

So I think thats fine, write a sw accessor providers, don't go
overloading the buffer sharing code.

This API will limit what people can use this buffer sharing for with
pure hw accessors, you might say, oh buts its okay to fail the mmap
then, but the chances of sw handling that I'm not so sure off.

Dave.

^ permalink raw reply

* [PATCH v6 10/16] OMAP2+: UART: Modify omap_uart_can_sleep function
From: Govindraj @ 2011-10-12 13:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <87vcrv2xox.fsf@ti.com>

On Tue, Oct 11, 2011 at 11:54 PM, Kevin Hilman <khilman@ti.com> wrote:
> "Govindraj.R" <govindraj.raja@ti.com> writes:
>
>> Modify the omap_uart_can_sleep function to check uart is active
>> or not to be used by pm code to enter low power states.
>
> Doesn't the driver now control when the UART clocks are gated (using
> runtime PM autosuspend)?
>
> IMO, this check should be completely removed and the driver should
> be managing this with the autosuspend timeout.
>
>> Removing this check can cause console response little sluggish.
>
> Sluggish in what way?
>

response is slower like when we type something or cat debugfs/pm_count
see things little slower on console, there is no character loss.

Happens even though we have not set the autosuspend timeout and uart
clocks are active,
which basically means allowing mpu to enter retention keeping uart active.

this delay in response or sluggishness is not there on my 3430SDP or
3630zoom board but I was able to see this behavior on a beagle board(xm rev c).

retaining this uart_can_sleep check in omap3_can_sleep ensures a better
console user experience. (not allowing mpu to enter retention
until uart clocks are cut)


> If the driver is runtime suspended, it should only be sluggish for the
> first character. ?After that, the autosuspend timeout should prevent it
> from feeling sluggish.
>
>> However no characters will be lost until uart clocks are gated
>> and woken up using rx-pad. UART interface clocks can be auto gated
>> this can make response on uart slower. This behaviour was observed
>> only on some of OMAP3 boards(beagleboard xm rev c).
>>
>> Reported-by: Tero Kristo <t-kristo@ti.com>
>> Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
>> ---
>> ?arch/arm/mach-omap2/serial.c | ? 21 +++++++++------------
>> ?1 files changed, 9 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>> index 6725caf..ccf3550 100644
>> --- a/arch/arm/mach-omap2/serial.c
>> +++ b/arch/arm/mach-omap2/serial.c
>> @@ -156,23 +156,20 @@ static void omap_uart_smart_idle_enable(struct omap_uart_state *uart,
>>
>> ?int omap_uart_can_sleep(void)
>> ?{
>> - ? ? struct omap_uart_state *uart;
>> - ? ? int can_sleep = 1;
>> -
>> - ? ? list_for_each_entry(uart, &uart_list, node) {
>> - ? ? ? ? ? ? if (!uart->clocked)
>> - ? ? ? ? ? ? ? ? ? ? continue;
>> + ? ? struct omap_hwmod *oh;
>> + ? ? u8 i, ret = true;
>>
>> - ? ? ? ? ? ? if (!uart->can_sleep) {
>> - ? ? ? ? ? ? ? ? ? ? can_sleep = 0;
>> + ? ? for (i = 0; i < num_uarts; i++) {
>> + ? ? ? ? ? ? oh = omap_uart_hwmod_lookup(i);
>
> This is a heavy operation to add for *every* entry into idle.
>

removing uart_list caused this ops, retaining uart_list
will ensure this will be replaced with list_for_each_entry
as done in existing code.

--
Thanks,
Govindraj.R

^ permalink raw reply

* [PATCH] ARM: SAMSUNG: s3c-dma-ops needs export.h for EXPORT_SYMBOL
From: Axel Lin @ 2011-10-12 13:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <069601cc88dc$6b9a78d0$42cf6a70$%kim@samsung.com>

2011/10/12 Kukjin Kim <kgene.kim@samsung.com>:
> Kukjin Kim wrote:
>>
>> Axel Lin wrote:
>> >
>> > Fix below build warning:
>> > ? CC ? ? ?arch/arm/plat-samsung/s3c-dma-ops.o
>> > arch/arm/plat-samsung/s3c-dma-ops.c:130: warning: data definition has no type
>> or
>> > storage class
>> > arch/arm/plat-samsung/s3c-dma-ops.c:130: warning: type defaults to 'int' in
>> > declaration of 'EXPORT_SYMBOL'
>> > arch/arm/plat-samsung/s3c-dma-ops.c:130: warning: parameter names (without
>> > types) in function declaration
>> >
>> > And fix the build error:
>> > ERROR: "s3c_dma_get_ops" [drivers/spi/spi-s3c64xx.ko] undefined!
>> > make[1]: *** [__modpost] Error 1
>> > make: *** [modules] Error 2
>> >
>> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
>> > ---
>> > This can be reproduced by "make s3c6400_defconfig;make" on linux-next
>> > 20111006.
>> > ?arch/arm/plat-samsung/s3c-dma-ops.c | ? ?1 +
>> > ?1 files changed, 1 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/arch/arm/plat-samsung/s3c-dma-ops.c b/arch/arm/plat-samsung/s3c-
>> > dma-ops.c
>> > index 582333c..7814949 100644
>> > --- a/arch/arm/plat-samsung/s3c-dma-ops.c
>> > +++ b/arch/arm/plat-samsung/s3c-dma-ops.c
>> > @@ -14,6 +14,7 @@
>> > ?#include <linux/errno.h>
>> > ?#include <linux/slab.h>
>> > ?#include <linux/types.h>
>> > +#include <linux/export.h>
>> >
>> > ?#include <mach/dma.h>
>> >
>> > --
>> > 1.7.4.1
>> >
>> OK, will apply.
>>
>> BTW, I don't know why the build error/warning was not happened in my tree with
>> s3c6400_defconfig. Probably other file having it?...
>>
> Hi Axel,
>
> When I applied this in my tree, happened following error with s3c6400_defconfig.
>
> arch/arm/plat-samsung/s3c-dma-ops.c:17: fatal error: linux/export.h: No such file or directory
>
> Probably the <linux/export.h> file has been added from other tree.
> So if required, will fix with this during upcoming merge window maybe at end of.
>
Cc Paul Gortmaker,
Maybe it is only in Paul's tree now.

Regards,
Axel

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Rob Clark @ 2011-10-12 13:50 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPM=9twft0eBEUoCD11a2gTZHwOaPzFmZvBfE032dfK10eQ27Q@mail.gmail.com>

On Wed, Oct 12, 2011 at 8:35 AM, Dave Airlie <airlied@gmail.com> wrote:
>>
>> well, the mmap is actually implemented by the buffer allocator
>> (v4l/drm).. although not sure if this was the point
>
> Then why not use the correct interface? doing some sort of not-quite
> generic interface isn't really helping anyone except adding an ABI
> that we have to support.

But what if you don't know who allocated the buffer?  How do you know
what interface to use to mmap?

> If someone wants to bypass the current kernel APIs we should add a new
> API for them not shove it into this generic buffer sharing layer.
>
>> The intent was that this is for well defined formats.. ie. it would
>> need to be a format that both v4l and drm understood in the first
>> place for sharing to make sense at all..
>
> How will you know the stride to take a simple example? The userspace
> had to create this buffer somehow and wants to share it with
> "something", you sound like
> you really needs another API that is a simple accessor API that can
> handle mmaps.

Well, things like stride, width, height, color format, userspace needs
to know all this already, even for malloc()'d sw buffers.  The
assumption is userspace already has a way to pass this information
around so it was not required to be duplicated by dmabuf.

>> Anyways, the basic reason is to handle random edge cases where you
>> need sw access to the buffer. ?For example, you are decoding video and
>> pull out a frame to generate a thumbnail w/ a sw jpeg encoder..
>
> Again, doesn't sound like it should be part of this API, and also
> sounds like the sw jpeg encoder will need more info about the buffer
> anyways like stride and format.
>
>> With this current scheme, synchronization could be handled in
>> dmabufops->mmap() and vm_ops->close().. ?it is perhaps a bit heavy to
>> require mmap/munmap for each sw access, but I suppose this isn't
>> really for the high-performance use case. ?It is just so that some
>> random bit of sw that gets passed a dmabuf handle without knowing who
>> allocated it can have sw access if really needed.
>
> So I think thats fine, write a sw accessor providers, don't go
> overloading the buffer sharing code.

But then we'd need a different set of accessors for every different
drm/v4l/etc driver, wouldn't we?

> This API will limit what people can use this buffer sharing for with
> pure hw accessors, you might say, oh buts its okay to fail the mmap
> then, but the chances of sw handling that I'm not so sure off.

I'm not entirely sure the case you are worried about.. sharing buffers
between multiple GPU's that understand same tiled formats?  I guess
that is a bit different from a case like a jpeg encoder that is passed
a dmabuf handle without any idea where it came from..

I guess if sharing a buffer between multiple drm devices, there is
nothing stopping you from having some NOT_DMABUF_MMAPABLE flag you
pass when the buffer is allocated, then you don't have to support
dmabuf->mmap(), and instead mmap via device and use some sort of
DRM_CPU_PREP/FINI ioctls for synchronization..

BR,
-R

> Dave.
>

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Dave Airlie @ 2011-10-12 14:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAF6AEGuwMt6Snq=YSN4iddTv_Cu56aR_2BY1d3hjVvTdkom5MQ@mail.gmail.com>

> But then we'd need a different set of accessors for every different
> drm/v4l/etc driver, wouldn't we?

Not any more different than you need for this, you just have a new
interface that you request a sw object from,
then mmap that object, and underneath it knows who owns it in the kernel.

mmap just feels wrong in this API, which is a buffer sharing API not a
buffer mapping API.

> I guess if sharing a buffer between multiple drm devices, there is
> nothing stopping you from having some NOT_DMABUF_MMAPABLE flag you
> pass when the buffer is allocated, then you don't have to support
> dmabuf->mmap(), and instead mmap via device and use some sort of
> DRM_CPU_PREP/FINI ioctls for synchronization..

Or we could make a generic CPU accessor that we don't have to worry about.

Dave.

^ permalink raw reply

* [PATCH v6 15/16] OMAP2+: UART: Enable back uart clocks with runtime API for early console
From: Govindraj @ 2011-10-12 14:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <87pqi3z19z.fsf@ti.com>

On Wed, Oct 12, 2011 at 2:36 AM, Kevin Hilman <khilman@ti.com> wrote:
> "Govindraj.R" <govindraj.raja@ti.com> writes:
>
>> For the early console probing we had avoided hwmod reset and idling
>> and uart was idled using hwmod API and enabled back using omap_device API
>> after omap_device registration.
>>
>> Now since we are using runtime API's to enable back uart, move hwmod
>> idling and use runtime API to enable back UART.
>>
>> Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
>
> Now that the driver is using runtime PM. ?Why do we still need
> HWMOD_INIT_NO_IDLE and HWMOD_INIT_NO_RESET?
>
> The comment in the code says:
>
> ? ? ? ? ? ? ? ?/*
> ? ? ? ? ? ? ? ? * During UART early init, device need to be probed
> ? ? ? ? ? ? ? ? * to determine SoC specific init before omap_device
> ? ? ? ? ? ? ? ? * is ready. ?Therefore, don't allow idle here
> ? ? ? ? ? ? ? ? */
>
> This was true when using the 8250 driver because it was not using
> runtime PM so could not know how to (re)enable the device.
>
> However, since the driver is now runtime PM adapted, any device access
> should be contained within a runtime PM get/put block, so there should
> no longer be a reason not allow the IP blocks to be reset during boot.
>

Forgot to add, this is still needed for
earlyprintk(CONFIG_EARLY_PRINTK) use case,

The initial boot prints until a console driver is available is from
"arch/arm/kernel/early_printk.c" which does a tx on uart console
and relies on configuration from bootloader.

during bootup earlyprink does a tx on uart console and if  uart driver
is not available yet
uart reset or idle done by hwmod layer can cause boot failures.

--> put_char from earlyprintk.c
     --> reset/idle from hwmod layer
          --> put_char from earlyprintk.c


So console_uart reset or clock gating must be done only after uart
driver is available or be prevented
using these available hwmod_flags.

omap_serial_early_init should be now be binded with CONFIG_SERIAL_OMAP macro ?

--
Thanks,
Govindraj.R

^ permalink raw reply

* [PATCH v2] ARM: EXYNOS4: Add support for M-5MOLS camera on Nuri board
From: Sylwester Nawrocki @ 2011-10-12 14:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <069701cc88dc$7a484100$6ed8c300$%kim@samsung.com>

Hi Kgene,

On 10/12/2011 02:43 PM, Kukjin Kim wrote:
> Kukjin Kim wrote:
>> Sylwester Nawrocki wrote:
>>>
>>> Add voltage regulator and platform data definition for M-5MOLS sensor
>>> and MIPI-CSI receiver drivers. Add CAM power domain dependencies for
>>> FIMC device and set up camera port A GPIO. Configure I2C0 bus timings.
>>>
>>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>>> Signed-off-by: HeungJun Kim <riverful.kim@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>> Hi Kgene,
>>>
>>> I have corrected the white space issues as you pointed out and removed
>>> unnecessary gpio_free() in this patch.
>>>
>>> Thanks,
>>>  Sylwester
>>> ---
>>>  arch/arm/mach-exynos4/Kconfig     |    8 ++
>>>  arch/arm/mach-exynos4/mach-nuri.c |  156
>>> +++++++++++++++++++++++++++++++++++++
>>>  2 files changed, 164 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-exynos4/Kconfig
> b/arch/arm/mach-exynos4/Kconfig
>>> index dd660eb..4bc4b1f 100644
>>> --- a/arch/arm/mach-exynos4/Kconfig
>>> +++ b/arch/arm/mach-exynos4/Kconfig
> 
> (snip)
> 
>>> +static struct s5p_platform_fimc fimc_md_platdata = {
>>> +	.isp_info	= nuri_camera_sensors,
>>> +	.num_clients	= ARRAY_SIZE(nuri_camera_sensors),
>>> +};
> 
> Hi Sylwester,
> 
> You need to move 'struct platform_device s5p_device_fimc_md' to
> plat-samsung/devs.c or add 'static' because following error is happened.

Yes, indeed there is an issue with multiple device definition, and the
boards should really not create their own instance.
I'll prepare a patch moving s5p_fimc_device_md to plat-samsung/devs.c
This device instance is also needed for the aggregate FIMC driver to be
initialized on other boards, even if they use only video mem-to-mem.
So the patch should fix the driver initialization issue on these boards.

Sorry about the trouble.

> 
> arch/arm/mach-exynos4/mach-nuri.o: In function `  CC      kernel/sysctl.o
> .LANCHOR1':
> mach-nuri.c:(.data+0x38): multiple definition of `s5p_device_fimc_md'
> arch/arm/mach-exynos4/mach-universal_c210.o:mach-universal_c210.c:(.data+0x1
> 8): first defined here
> make[2]: *** [arch/arm/mach-exynos4/built-in.o] Error 1
> make[1]: *** [arch/arm/mach-exynos4] Error 2
> make[1]: *** Waiting for unfinished jobs....

Regards,
-- 
Sylwester Nawrocki
Samsung Poland R&D Center

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Rob Clark @ 2011-10-12 14:24 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPM=9tyKjodxf9MKjG=5bBDZTuqOx4Nu31L5iNN9LrO9fsp+FA@mail.gmail.com>

On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie <airlied@gmail.com> wrote:
>> But then we'd need a different set of accessors for every different
>> drm/v4l/etc driver, wouldn't we?
>
> Not any more different than you need for this, you just have a new
> interface that you request a sw object from,
> then mmap that object, and underneath it knows who owns it in the kernel.

oh, ok, so you are talking about a kernel level interface, rather than
userspace..

but I guess in this case I don't quite see the difference.  It amounts
to which fd you call mmap (or ioctl[*]) on..  If you use the dmabuf fd
directly then you don't have to pass around a 2nd fd.

[*] there is nothing stopping defining some dmabuf ioctls (such as for
synchronization).. although the thinking was to keep it simple for
first version of dmabuf

BR,
-R

> mmap just feels wrong in this API, which is a buffer sharing API not a
> buffer mapping API.
>
>> I guess if sharing a buffer between multiple drm devices, there is
>> nothing stopping you from having some NOT_DMABUF_MMAPABLE flag you
>> pass when the buffer is allocated, then you don't have to support
>> dmabuf->mmap(), and instead mmap via device and use some sort of
>> DRM_CPU_PREP/FINI ioctls for synchronization..
>
> Or we could make a generic CPU accessor that we don't have to worry about.
>
> Dave.
>

^ permalink raw reply

* [PATCH] Add platform driver support to the CS890x driver
From: Domenico Andreoli @ 2011-10-12 14:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20111001171340.GN11710@n2100.arm.linux.org.uk>

On Sat, Oct 01, 2011 at 06:13:40PM +0100, Russell King - ARM Linux wrote:
> On Fri, Sep 30, 2011 at 11:01:10AM +0200, Jaccon Bastiaansen wrote:
> > Hello Domenico,
> > 
> > 2011/9/28 Domenico Andreoli <cavokz@gmail.com>:
> > > Hi Jaccon,
> > >
> > > On Mon, Sep 12, 2011 at 12:52:52PM +0200, Jaccon Bastiaansen wrote:
> > >>
> > >> Ok, so you would like to see the #ifdefs for the IXDP2351, IXDP2X01,
> > >> QQ2440 and MX31ADS in the cs890x driver replaced by platform_device
> > >> definitions in the platform specific code of those platforms (in the
> > >> same way as I have done for the i.MX21ADS platform)? Is this correct?
> > >
> > > Feel free to completely dump the QQ2440 thing, the QQ2440 board support
> > > is not in mainline and will not until it can be implemented mostly with
> > > DT, I guess. ?At that time I will be happy to use your platform device
> > > conversion - with the OF initialization that sombody will write ;)
> 
> I don't have Domenico's original mail...

yes, there was a problem on my side that I hope is now fixed.

> It's now up to the SoC maintainers whether they want to accept this stuff,
> and if so how to get it into mainline (probably via Arnd) - be that in
> their current form or if they think that a DT based implementation is
> better.
> 
> I'll be discarding the four 'new' platforms (of which QQ2440 is one) which
> have been sitting in the patch system since March in the next few days.

thank you.

Regards,
Domenico

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Dave Airlie @ 2011-10-12 14:34 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAF6AEGsK25wk28YmiwsZTenecKqCt6irx66nR-8nOFMo6Z=Dkw@mail.gmail.com>

On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark <robdclark@gmail.com> wrote:
> On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie <airlied@gmail.com> wrote:
>>> But then we'd need a different set of accessors for every different
>>> drm/v4l/etc driver, wouldn't we?
>>
>> Not any more different than you need for this, you just have a new
>> interface that you request a sw object from,
>> then mmap that object, and underneath it knows who owns it in the kernel.
>
> oh, ok, so you are talking about a kernel level interface, rather than
> userspace..
>
> but I guess in this case I don't quite see the difference. ?It amounts
> to which fd you call mmap (or ioctl[*]) on.. ?If you use the dmabuf fd
> directly then you don't have to pass around a 2nd fd.
>
> [*] there is nothing stopping defining some dmabuf ioctls (such as for
> synchronization).. although the thinking was to keep it simple for
> first version of dmabuf
>

Yes a separate kernel level interface.

Well I'd like to keep it even simpler. dmabuf is a buffer sharing API,
shoehorning in a sw mapping API isn't making it simpler.

The problem I have with implementing mmap on the sharing fd, is that
nothing says this should be purely optional and userspace shouldn't
rely on it.

In the Intel GEM space alone you have two types of mapping, one direct
to shmem one via GTT, the GTT could be even be a linear view. The
intel guys initially did GEM mmaps direct to the shmem pages because
it seemed simple, up until they
had to do step two which was do mmaps on the GTT copy and ended up
having two separate mmap methods. I think the problem here is it seems
deceptively simple to add this to the API now because the API is
simple, however I think in the future it'll become a burden that we'll
have to workaround.

Dave.

^ permalink raw reply

* [PATCH] ARM: zImage: Use $(CROSS_COMPILE)size to get .bss size
From: Nicolas Pitre @ 2011-10-12 14:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1318419203-27165-1-git-send-email-weber@corscience.de>

On Wed, 12 Oct 2011, Thomas Weber wrote:

> Use $(CROSS_COMPILE)size to determine the bss size
> from vmlinux.
> 
> The problem is introduced in:
> commit 8738646c02064d38f6fb056eb039ebf9138c5434
> 
> ARM: zImage: make sure appended DTB doesn't get
> overwritten by kernel .bss
> 
> This fixes following error message:
> 
> size: arch/arm/boot/compressed/../../../../vmlinux:
> File format is ambiguous
> 
> size: Matching formats:
> elf32-littlearm
> elf32-littlearm-symbian
> elf32-littlearm-vxworks
> 
> Signed-off-by: Thomas Weber <weber@corscience.de>

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>

However I don't know where you picked up a reference to commit 
8738646c02 which is nonexistent in any of my repositories.  The right 
reference from RMK's devel-stable branch would be commit 5ffb04f669.  
Please fix that and send to the patch system.


Nicolas

^ permalink raw reply

* [PATCH 4/9] ARM: SPMP8000: Add ADC driver
From: Mark Brown @ 2011-10-12 14:42 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201110111724.48069.arnd@arndb.de>

On Tue, Oct 11, 2011 at 05:24:47PM +0200, Arnd Bergmann wrote:
> On Tuesday 11 October 2011, Mark Brown wrote:

> > I'm not sure that IIO isn't the kernel subsystem we're looking for here
> > - as I keep saying when this comes up it's just representing bare DACs
> > and ADCs pretty directly which looks like a generic subsystem to me.

> Possible, yes. Until now, IIO is a subsystem for user-level access
> not for kernel access though, so it's not the right place yet.
> If we decide to let IIO handle all ADC input, do you think it would
> also be the right place to do PWM output, rather than having a
> separate subsystem for that?

Off the top of my head I'd expect PWM to be a separate thing which could
optionally synthesize stuff onto an IIO device (bitbanging the PWM
essentially).  The specialized PWM stuff tends to be "output this steady
state for an indefinite period" type interface rather than "here's a
batch of samples, output them".

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Daniel Vetter @ 2011-10-12 14:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPM=9tyAiUZ9tNaer=_52WmiLKpJKG+3EXvZzotwGwvqkJFmOQ@mail.gmail.com>

On Wed, Oct 12, 2011 at 03:34:54PM +0100, Dave Airlie wrote:
> On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark <robdclark@gmail.com> wrote:
> > On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie <airlied@gmail.com> wrote:
> >>> But then we'd need a different set of accessors for every different
> >>> drm/v4l/etc driver, wouldn't we?
> >>
> >> Not any more different than you need for this, you just have a new
> >> interface that you request a sw object from,
> >> then mmap that object, and underneath it knows who owns it in the kernel.
> >
> > oh, ok, so you are talking about a kernel level interface, rather than
> > userspace..
> >
> > but I guess in this case I don't quite see the difference. ?It amounts
> > to which fd you call mmap (or ioctl[*]) on.. ?If you use the dmabuf fd
> > directly then you don't have to pass around a 2nd fd.
> >
> > [*] there is nothing stopping defining some dmabuf ioctls (such as for
> > synchronization).. although the thinking was to keep it simple for
> > first version of dmabuf
> >
> 
> Yes a separate kernel level interface.
> 
> Well I'd like to keep it even simpler. dmabuf is a buffer sharing API,
> shoehorning in a sw mapping API isn't making it simpler.
> 
> The problem I have with implementing mmap on the sharing fd, is that
> nothing says this should be purely optional and userspace shouldn't
> rely on it.
> 
> In the Intel GEM space alone you have two types of mapping, one direct
> to shmem one via GTT, the GTT could be even be a linear view. The
> intel guys initially did GEM mmaps direct to the shmem pages because
> it seemed simple, up until they
> had to do step two which was do mmaps on the GTT copy and ended up
> having two separate mmap methods. I think the problem here is it seems
> deceptively simple to add this to the API now because the API is
> simple, however I think in the future it'll become a burden that we'll
> have to workaround.

Yeah, that's my feeling, too. Adding mmap sounds like a neat, simple idea,
that could simplify things for simple devices like v4l. But as soon as
you're dealing with a real gpu, nothing is simple. Those who don't believe
this, just take a look at the data upload/download paths in the
open-source i915,nouveau,radeon drivers. Making this fast (and for gpus,
it needs to be fast) requires tons of tricks, special-cases and jumping
through loops.

You absolutely want the device-specific ioctls to do that. Adding a
generic mmap just makes matters worse, especially if userspace expects
this to work synchronized with everything else that is going on.

Cheers, Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply

* [PATCH v2 4/7] clk: Add simple gated clock
From: Turquette, Mike @ 2011-10-12 14:59 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20111012064646.GA31037@b20223-02.ap.freescale.net>

On Tue, Oct 11, 2011 at 11:46 PM, Richard Zhao
<richard.zhao@freescale.com> wrote:
> On Thu, Sep 22, 2011 at 03:26:59PM -0700, Mike Turquette wrote:
>> From: Jeremy Kerr <jeremy.kerr@canonical.com>
>>
>> Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
>> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>> Signed-off-by: Jamie Iles <jamie@jamieiles.com>
>> Signed-off-by: Mike Turquette <mturquette@ti.com>
>> ---
>> Changes since v1:
>> Add copyright header
>> Fold in Jamie's patch for set-to-disable clks
>> Use BIT macro instead of shift
>>
>> ?drivers/clk/Kconfig ? ?| ? ?4 ++
>> ?drivers/clk/Makefile ? | ? ?1 +
>> ?drivers/clk/clk-gate.c | ? 78 ++++++++++++++++++++++++++++++++++++++++++++++++
>> ?include/linux/clk.h ? ?| ? 13 ++++++++
>> ?4 files changed, 96 insertions(+), 0 deletions(-)
>> ?create mode 100644 drivers/clk/clk-gate.c
>
> I feel hard to tell the tree the clk parent, at register/init time. For the
> simple gate clk, the only way is to set .get_parent. But normally, for clk
> without any divider we set .get_parent to NULL. Maybe we can put .parent to
> struct clk_hw?

For non-mux clocks, whose parent is *always* going to be the same, you
should create a duplicate .parent in the clk_hw_* structure and then
have .get_parent return clk_hw_*->parent.

This is analogous to the way clk_hw_fixed returns clk_hw_fixed->rate
when .recalc is called on it.

Regards,
Mike

> Thanks
> Richard
>>
>> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
>> index d8313d7..a78967c 100644
>> --- a/drivers/clk/Kconfig
>> +++ b/drivers/clk/Kconfig
>> @@ -12,3 +12,7 @@ config GENERIC_CLK
>> ?config GENERIC_CLK_FIXED
>> ? ? ? bool
>> ? ? ? depends on GENERIC_CLK
>> +
>> +config GENERIC_CLK_GATE
>> + ? ? bool
>> + ? ? depends on GENERIC_CLK
>> diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
>> index 9a3325a..d186446 100644
>> --- a/drivers/clk/Makefile
>> +++ b/drivers/clk/Makefile
>> @@ -2,3 +2,4 @@
>> ?obj-$(CONFIG_CLKDEV_LOOKUP) ?+= clkdev.o
>> ?obj-$(CONFIG_GENERIC_CLK) ? ?+= clk.o
>> ?obj-$(CONFIG_GENERIC_CLK_FIXED) ? ? ?+= clk-fixed.o
>> +obj-$(CONFIG_GENERIC_CLK_GATE) ? ? ? += clk-gate.o
>> diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
>> new file mode 100644
>> index 0000000..a1d8e79
>> --- /dev/null
>> +++ b/drivers/clk/clk-gate.c
>> @@ -0,0 +1,78 @@
>> +/*
>> + * Copyright (C) 2010-2011 Canonical Ltd <jeremy.kerr@canonical.com>
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + *
>> + * Simple clk gate implementation
>> + */
>> +
>> +#include <linux/clk.h>
>> +#include <linux/module.h>
>> +#include <asm/io.h>
>> +
>> +#define to_clk_gate(clk) container_of(clk, struct clk_gate, hw)
>> +
>> +static unsigned long clk_gate_get_rate(struct clk_hw *clk)
>> +{
>> + ? ? return clk_get_rate(clk_get_parent(clk->clk));
>> +}
>> +
>> +static void clk_gate_set_bit(struct clk_hw *clk)
>> +{
>> + ? ? struct clk_gate *gate = to_clk_gate(clk);
>> + ? ? u32 reg;
>> +
>> + ? ? reg = __raw_readl(gate->reg);
>> + ? ? reg |= BIT(gate->bit_idx);
>> + ? ? __raw_writel(reg, gate->reg);
>> +}
>> +
>> +static void clk_gate_clear_bit(struct clk_hw *clk)
>> +{
>> + ? ? struct clk_gate *gate = to_clk_gate(clk);
>> + ? ? u32 reg;
>> +
>> + ? ? reg = __raw_readl(gate->reg);
>> + ? ? reg &= ~BIT(gate->bit_idx);
>> + ? ? __raw_writel(reg, gate->reg);
>> +}
>> +
>> +static int clk_gate_enable_set(struct clk_hw *clk)
>> +{
>> + ? ? clk_gate_set_bit(clk);
>> +
>> + ? ? return 0;
>> +}
>> +
>> +static void clk_gate_disable_clear(struct clk_hw *clk)
>> +{
>> + ? ? clk_gate_clear_bit(clk);
>> +}
>> +
>> +struct clk_hw_ops clk_gate_set_enable_ops = {
>> + ? ? .recalc_rate = clk_gate_get_rate,
>> + ? ? .enable = clk_gate_enable_set,
>> + ? ? .disable = clk_gate_disable_clear,
>> +};
>> +EXPORT_SYMBOL_GPL(clk_gate_set_enable_ops);
>> +
>> +static int clk_gate_enable_clear(struct clk_hw *clk)
>> +{
>> + ? ? clk_gate_clear_bit(clk);
>> +
>> + ? ? return 0;
>> +}
>> +
>> +static void clk_gate_disable_set(struct clk_hw *clk)
>> +{
>> + ? ? clk_gate_set_bit(clk);
>> +}
>> +
>> +struct clk_hw_ops clk_gate_set_disable_ops = {
>> + ? ? .recalc_rate = clk_gate_get_rate,
>> + ? ? .enable = clk_gate_enable_clear,
>> + ? ? .disable = clk_gate_disable_set,
>> +};
>> +EXPORT_SYMBOL_GPL(clk_gate_set_disable_ops);
>> diff --git a/include/linux/clk.h b/include/linux/clk.h
>> index 1903dd8..626fd0d 100644
>> --- a/include/linux/clk.h
>> +++ b/include/linux/clk.h
>> @@ -124,6 +124,19 @@ extern struct clk_hw_ops clk_fixed_ops;
>>
>> ?#endif /* CONFIG_GENERIC_CLK_FIXED */
>>
>> +#ifdef CONFIG_GENERIC_CLK_GATE
>> +
>> +struct clk_gate {
>> + ? ? struct clk_hw ? hw;
>> + ? ? void __iomem ? ?*reg;
>> + ? ? u8 ? ? ? ? ? ? ?bit_idx;
>> +};
>> +
>> +extern struct clk_hw_ops clk_gate_set_enable_ops;
>> +extern struct clk_hw_ops clk_gate_set_disable_ops;
>> +
>> +#endif /* CONFIG_GENERIC_CLK_GATE */
>> +
>> ?/**
>> ? * clk_register - register and initialize a new clock
>> ? *
>> --
>> 1.7.4.1
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>
>

^ permalink raw reply

* Update: ARM Sub-Architecture Maintainers workshop at Kernel Summit 2011
From: Nicolas Pitre @ 2011-10-12 15:00 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20111012100109.GB13134@arm.com>

On Wed, 12 Oct 2011, Catalin Marinas wrote:

> Hi Grant,
> 
> On Tue, Aug 30, 2011 at 07:00:16AM +0100, Grant Likely wrote:
> > Agenda proposals (Thanks to Nicolas and Olof):
> > - DT bindings for GPIO and pin mux
> > - the pin mux subsystem from linusw (especially if it is still RFC by
> >  then)
> > - progress with the single zImage work
> > - presentation/status of the DMA and memory management work wrt CMA
> >  (some SOC specific hacks should go away once this is available)
> > - DT porting progress
> > - boot architecture status
> > - Report from Arnd on experiences from first arm-soc merge window
> >   - what worked well and where's room for improvement?
> >   - Any particular SoC workflow that should be tuned to make his life easier?
> >   - Where are the gaps where he needs help right now?
> >   - How did it work out for the SoC maintainers?
> 
> Some more thoughts, probably under some of the above topics like single
> zImage or boot architecture if there is time on the agenda:
> 
> - Errata (CPU, cache controller etc.) workarounds - do we need some
>   common way to register workarounds that individual SoCs need to be
>   enabled during boot? With a single zImage platform, we need to enable
>   as many (CPU) errata workarounds as possible but, even though we check
>   the CPU revision, we may find that some undocumented bits cannot be
>   set because Linux is running in non-secure mode (and the secure code
>   on the SoC doesn't set the bit either) or the SoC already implemented
>   an ECO fix and the workaround is no longer needed.

Yes, that would be good to cover during single zImage discussions.

> - CPU topology - Vincent Guittot proposed patches to automatically
>   generate a CPU topology based on the MPIDR. I think we should be able
>   to override this using some DT description (and also be able to
>   describe the mapping between GIC CPU interfaces and the CPU numbering
>   via DT).

I think some discussion around DT bindings is planned.  That would fit 
there.

> Unrelated to the above
> 
> - Different DMA coherency requirements within the same SoC - this is
>   linked to the work already started by Marek on dma_map_ops (though the
>   focus was mainly IOMMU). Basically there are SoCs where some device
>   requires non-cacheable memory while another device is connected via a
>   coherency port and can snoop the CPU caches. The arch_is_coherent()
>   that we currently have is not fine-grained enough for this task.

If you have actual example use cases and solution proposals then this 
could certainly be brought up during DMA oriented discussions.


Nicolas

^ permalink raw reply

* [PATCH] gpio: exynos4: Add device tree support
From: Rob Herring @ 2011-10-12 15:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAJuYYwQWUjVf9Z5Rdw4fTK70=B1aw-5x_wjYm_fq+zHyQAWJvg@mail.gmail.com>

On 10/11/2011 11:06 AM, Thomas Abraham wrote:
> On 11 October 2011 21:00, Rob Herring <robherring2@gmail.com> wrote:
>> On 10/11/2011 10:19 AM, Thomas Abraham wrote:
>>> Hi Rob,
>>>
>>> On 11 October 2011 20:41, Rob Herring <robherring2@gmail.com> wrote:
>>>> Thomas,
>>>>
>>>> On 10/11/2011 03:16 AM, Thomas Abraham wrote:
>>>>> As gpio chips get registered, a device tree node which represents the
>>>>> gpio chip is searched and attached to it. A translate function is also
>>>>> provided to convert the gpio specifier into actual platform settings
>>>>> for pin function selection, pull up/down and driver strength settings.
>>>>>
>>>>> Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
>>>>> ---
>>>>> This patch is based on the latest consolidated Samsung GPIO driver available
>>>>> in the following tree:
>>>>>   https://github.com/kgene/linux-samsung.git  branch: for-next
>>>>>
>>>>>  .../devicetree/bindings/gpio/gpio-samsung.txt      |   30 +++++++++++
>>>>>  drivers/gpio/gpio-samsung.c                        |   53 ++++++++++++++++++++
>>>>>  2 files changed, 83 insertions(+), 0 deletions(-)
>>>>>  create mode 100644 Documentation/devicetree/bindings/gpio/gpio-samsung.txt
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
>>>>> new file mode 100644
>>>>> index 0000000..883faeb
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
>>>>> @@ -0,0 +1,30 @@
>>>>> +Samsung Exynos4 GPIO Controller
>>>>> +
>>>>> +Required properties:
>>>>> +- compatible: Format of compatible property value should be
>>>>> +  "samsung,exynos4-gpio-<controller_name>". Example: For GPA0 controller, the
>>>>> +  compatible property value should be "samsung,exynos4-gpio-gpa0".
>>>>
>>>> Isn't gpa0 an instance of the h/w, not a version?
>>>
>>> GPA0 is a instance of the gpio controller. There are several such
>>> instances and there could be differences in those instances such as
>>> the number of GPIO lines managed by that gpio controller instance.
>>>
>>
>> That doesn't seem like a reason to have different compatible strings.
>> Does that affect the programming model of the controller? Unused lines
>> whether at the board level or SOC level shouldn't really matter.
> 
> 
> No, that does not affect the programming of the controller. The reason
> for the instance name extension in compatible string is to match the
> gpio_chip with a gpio controller node. When matched, the of_node
> pointer of the gpio_chip is set to point to that controller node.
> 
> This might not be the best possible implementation but the device tree
> support code in this patch is dictated by the structure of the
> existing gpio driver code. As you suggested previously, I will look at
> reworking the gpio driver a little later but for now, there was a need
> for working gpio dt solution to make progress on dt support for other
> controllers.

Linux should provide clues about what's needed in a binding, but the
binding should not be defined based on current Linux code. Doing the
binding one way and changing it later is not a good plan.

I think you need to convert all users of gpio over as well so you can
move to dynamic gpio_chip creation and gpio numbering. Or maybe you can
match based on base address? This is going to be a common problem as
gpio is converted over to DT. Perhaps Grant or others have suggestions
on the approach to use.

Rob

^ permalink raw reply

* [Linaro-mm-sig] [RFC 1/2] dma-buf: Introduce dma buffer sharing mechanism
From: Rob Clark @ 2011-10-12 15:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAPM=9tyAiUZ9tNaer=_52WmiLKpJKG+3EXvZzotwGwvqkJFmOQ@mail.gmail.com>

On Wed, Oct 12, 2011 at 9:34 AM, Dave Airlie <airlied@gmail.com> wrote:
> On Wed, Oct 12, 2011 at 3:24 PM, Rob Clark <robdclark@gmail.com> wrote:
>> On Wed, Oct 12, 2011 at 9:01 AM, Dave Airlie <airlied@gmail.com> wrote:
>>>> But then we'd need a different set of accessors for every different
>>>> drm/v4l/etc driver, wouldn't we?
>>>
>>> Not any more different than you need for this, you just have a new
>>> interface that you request a sw object from,
>>> then mmap that object, and underneath it knows who owns it in the kernel.
>>
>> oh, ok, so you are talking about a kernel level interface, rather than
>> userspace..
>>
>> but I guess in this case I don't quite see the difference. ?It amounts
>> to which fd you call mmap (or ioctl[*]) on.. ?If you use the dmabuf fd
>> directly then you don't have to pass around a 2nd fd.
>>
>> [*] there is nothing stopping defining some dmabuf ioctls (such as for
>> synchronization).. although the thinking was to keep it simple for
>> first version of dmabuf
>>
>
> Yes a separate kernel level interface.

I'm not against it, but if it is a device-independent interface, it
just seems like six of one, half-dozen of the other..

Ie. how does it differ if the dmabuf fd is the fd used for ioctl/mmap,
vs if some other /dev/buffer-sharer file that you open?

But I think maybe I'm misunderstanding what you have in mind?

BR,
-R

> Well I'd like to keep it even simpler. dmabuf is a buffer sharing API,
> shoehorning in a sw mapping API isn't making it simpler.
>
> The problem I have with implementing mmap on the sharing fd, is that
> nothing says this should be purely optional and userspace shouldn't
> rely on it.
>
> In the Intel GEM space alone you have two types of mapping, one direct
> to shmem one via GTT, the GTT could be even be a linear view. The
> intel guys initially did GEM mmaps direct to the shmem pages because
> it seemed simple, up until they
> had to do step two which was do mmaps on the GTT copy and ended up
> having two separate mmap methods. I think the problem here is it seems
> deceptively simple to add this to the API now because the API is
> simple, however I think in the future it'll become a burden that we'll
> have to workaround.
>
> Dave.
>

^ permalink raw reply

* [PATCH] ARM: Samsung: Move fimc plat. device from board files to plat-samsung
From: Sylwester Nawrocki @ 2011-10-12 15:31 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <039b01cc8730$594ab530$0be01f90$%kim@samsung.com>

Move the platform device definitions from boards code to plat-samsung
to avoid multiple instances when multiple board support is compiled in.
The boards should select at least S5P_DEV_FIMC0 to enable FIMC support.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Hi Kgene,

To decrease overall diff size, if it's not too late yet, you might want to
squash parts of this patch with previous commits:

0513218 ARM: S5PV210: Add support for M-5MOLS image sensor on UNIVERSAL_C210
39aefab ARM: S5PV210: Add support for NOON010PC30 sensor on GONI board

Here is the optional new patch summary:

ARM: Samsung: Add fimc platform device for s5p-fimc media device driver

The s5p-fimc driver now creates an aggregate media device which is bound
to "s5p-fimc-md" platform device. This patch adds such a platform device
instance to be registered by each board that requires FIMC device support.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Sorry for the noise. 

Regards,
Sylwester
---
 arch/arm/mach-exynos4/mach-universal_c210.c |    5 -----
 arch/arm/mach-s5pv210/mach-goni.c           |    5 -----
 arch/arm/plat-samsung/devs.c                |    5 +++++
 arch/arm/plat-samsung/include/plat/devs.h   |    1 +
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
index 18cf5c7..2096c8b 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -920,11 +920,6 @@ static struct s5p_platform_fimc fimc_md_platdata = {
 	.num_clients	= ARRAY_SIZE(universal_camera_sensors),
 };
 
-struct platform_device s5p_device_fimc_md = {
-	.name	= "s5p-fimc-md",
-	.id	= -1,
-};
-
 static struct gpio universal_camera_gpios[] = {
 	{ GPIO_CAM_LEVEL_EN(1),	GPIOF_OUT_INIT_HIGH, "CAM_LVL_EN1" },
 	{ GPIO_CAM_LEVEL_EN(2),	GPIOF_OUT_INIT_LOW,  "CAM_LVL_EN2" },
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 01e4867..61da205 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -849,11 +849,6 @@ struct s5p_platform_fimc goni_fimc_md_platdata __initdata = {
 	.num_clients	= ARRAY_SIZE(goni_camera_sensors),
 };
 
-struct platform_device s5p_device_fimc_md = {
-	.name		= "s5p-fimc-md",
-	.id		= -1,
-};
-
 static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_fb,
 	&s5p_device_onenand,
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index cb6fd9e..4ca8b57 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -204,6 +204,11 @@ struct platform_device s5p_device_fimc0 = {
 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 	},
 };
+
+struct platform_device s5p_device_fimc_md = {
+	.name	= "s5p-fimc-md",
+	.id	= -1,
+};
 #endif /* CONFIG_S5P_DEV_FIMC0 */
 
 #ifdef CONFIG_S5P_DEV_FIMC1
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 8f19241..ab633c9 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -77,6 +77,7 @@ extern struct platform_device s5p_device_fimc0;
 extern struct platform_device s5p_device_fimc1;
 extern struct platform_device s5p_device_fimc2;
 extern struct platform_device s5p_device_fimc3;
+extern struct platform_device s5p_device_fimc_md;
 extern struct platform_device s5p_device_fimd0;
 extern struct platform_device s5p_device_hdmi;
 extern struct platform_device s5p_device_i2c_hdmiphy;
-- 
1.7.7

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox