Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] i2c: tegra: Add i2c support
From: Olof Johansson @ 2011-02-21  4:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298250861-27094-1-git-send-email-ccross@android.com>

Hi,

Just a couple of minor nits. I wouldn't worry about respinning just
for these comments, but if you end up doing it for other feedback, see
below.


-Olof

On Sun, Feb 20, 2011 at 5:14 PM, Colin Cross <ccross@android.com> wrote:

> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> new file mode 100644
> index 0000000..3921f66
> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -0,0 +1,700 @@
> +/*
> + * drivers/i2c/busses/i2c-tegra.c
> + *
> + * Copyright (C) 2010 Google, Inc.

2011?

[..]

> +/*
> + * i2c_writel and i2c_readl will offset the register if necessary to talk
> + * to the I2C block inside the DVC block
> + */
> +static unsigned long tegra_i2c_reg_addr(struct tegra_i2c_dev *i2c_dev,
> + ? ? ? unsigned long reg)
> +{
> + ? ? ? if (i2c_dev->is_dvc)
> + ? ? ? ? ? ? ? reg += (reg >= I2C_TX_FIFO) ? 0x10 : 0x40;
> + ? ? ? return reg;
> +}
> +
> +static void i2c_writel(struct tegra_i2c_dev *i2c_dev, u32 val,
> + ? ? ? unsigned long reg)
> +{
> + ? ? ? writel(val, i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg));
> +}
> +
> +static u32 i2c_readl(struct tegra_i2c_dev *i2c_dev, unsigned long reg)
> +{
> + ? ? ? return readl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg));
> +}
> +
> +static void i2c_writesl(struct tegra_i2c_dev *i2c_dev, void *data,
> + ? ? ? unsigned long reg, int len)
> +{
> + ? ? ? writesl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg), data, len);
> +}
> +
> +static void i2c_readsl(struct tegra_i2c_dev *i2c_dev, void *data,
> + ? ? ? unsigned long reg, int len)
> +{
> + ? ? ? readsl(i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg), data, len);
> +}


All of the above pass in i2c_dev to tegra_i2c_reg_addr, might as well
do the base addition in there.

> diff --git a/include/linux/i2c-tegra.h b/include/linux/i2c-tegra.h
> new file mode 100644
> index 0000000..9c85da4
> --- /dev/null
> +++ b/include/linux/i2c-tegra.h
> @@ -0,0 +1,25 @@
> +/*
> + * drivers/i2c/busses/i2c-tegra.c
> + *
> + * Copyright (C) 2010 Google, Inc.

2011?

^ permalink raw reply

* [PATCH v2 21/21] ARM: tegra: clock: Miscellaneous clock updates
From: Olof Johansson @ 2011-02-21  4:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-23-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> Correct max rates for pclk and sclk (Originally fixed by
> ?Dima Zavin <dima@android.com>)
>
> Correct max rate for plla (Originally fixed by
> ?Stephen Warren <swarren@nvidia.com>)
>
> Remove unnecessary no-op set_rate on audio clocks
>
> Add clock lookup entries for grhost, bsea, and vde clocks
>
> Update clock clookup entries for vcp, bsea, and vde clocks
>
> Add shared clock entries for sclk and emc
>
> Add a virtual cop clock to provide a reset op (Originally fixed by
> ?Dima Zavin <dima@android.com>)
>
> Pass set_rate on super clocks through to parent
>
> Fix pllx frequency table entry for 608 MHz
>
> Remove incorrect plla frequency table entries
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 20/21] ARM: tegra: clock: Fix clock issues in suspend
From: Olof Johansson @ 2011-02-21  4:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-22-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> The PLLP registers are now being restored by the low-level resume code,
> and the CPU may be running off PLLP, so don't touch them during clock
> resume.
>
> Save plld, plls, pllu, and audio clock during suspend (originally
> fixed by Mayuresh Kulkarni <mkulkarni@nvidia.com>)
>
> The lock time for plld is 1000 us, so increase the delay after
> setting the PLLs.
>
> Add a BUG_ON to ensure the size of the suspend context area is
> correct.

It's a bummer that this can't be done (easily) at build time, it'd be
more useful. Oh well, still good to catch at runtime at least.


> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 19/21] ARM: tegra: clock: Add function to set SDMMC tap delay
From: Olof Johansson @ 2011-02-21  4:26 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-21-git-send-email-ccross@android.com>

Hi,

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> The SDMMC controllers have extra bits in the clock source
> register that adjust the delay between the clock and data
> to compenstate for delays on the PCB. ?The values need to
> be set from the clock code so the clock can be locked
> during the read-modify-write on the clock source register.
>
> Signed-off-by: Colin Cross <ccross@android.com>

This is going in without any in-tree consumers of the functions.
Still, it'll likely be added shortly, so:

Acked-by: Olof Johansson <olof@lixom.net>

(If they don't show up, it'll be easy to drop it again if need be).



-Olof

^ permalink raw reply

* [PATCH v2 18/21] ARM: tegra: cpufreq: Adjust memory frequency with cpu frequency
From: Olof Johansson @ 2011-02-21  4:23 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-20-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Patch description please. Besides that:

Acked-by: Olof Johansson <olof@lixom.net>

But note for future work:


> + ? ? ? /*
> + ? ? ? ?* Vote on memory bus frequency based on cpu frequency
> + ? ? ? ?* This sets the minimum frequency, display or avp may request higher
> + ? ? ? ?*/
> + ? ? ? if (rate >= 816000)
> + ? ? ? ? ? ? ? clk_set_rate(emc_clk, 600000000); /* cpu 816 MHz, emc max */
> + ? ? ? else if (rate >= 456000)
> + ? ? ? ? ? ? ? clk_set_rate(emc_clk, 300000000); /* cpu 456 MHz, emc 150Mhz */
> + ? ? ? else
> + ? ? ? ? ? ? ? clk_set_rate(emc_clk, 100000000); ?/* emc 50Mhz */
> +


This hardcodes frequencies that might or might not be used on some
systems and some parts. So it'll need to be revisited when enabling
other configurations.


-Olof

^ permalink raw reply

* [PATCH v2 17/21] ARM: tegra: clocks: Add emc scaling
From: Olof Johansson @ 2011-02-21  4:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-19-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Patch description please. Besides that:

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 16/21] ARM: tegra: Add external memory controller driver
From: Olof Johansson @ 2011-02-21  4:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-18-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Patch description requested. Besides that:

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 15/21] ARM: tegra: clock: Round rate before setting rate
From: Olof Johansson @ 2011-02-21  4:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-17-git-send-email-ccross@android.com>

Hi,

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:

> diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
> index 8d01a49..9798585 100644
> --- a/arch/arm/mach-tegra/clock.c
> +++ b/arch/arm/mach-tegra/clock.c
> @@ -86,6 +86,7 @@ static unsigned long clk_predict_rate_from_parent(struct clk *c, struct clk *p)
>
> ? ? ? ?if (c->mul != 0 && c->div != 0) {
> ? ? ? ? ? ? ? ?rate *= c->mul;
> + ? ? ? ? ? ? ? rate += c->div / 2; /* round up */

Shouldn't this be "rate += c->div - 1;"?



-Olof

^ permalink raw reply

* [PATCH v2 14/21] ARM: tegra: clock: Refcount periph clock enables
From: Olof Johansson @ 2011-02-21  4:18 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-16-git-send-email-ccross@android.com>

Hi,

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> Some peripheral clocks share enable bits. ?Refcount the enables so
> that calling clk_disable on one clock will not turn off another
> clock.
>
> Signed-off-by: Colin Cross <ccross@android.com>
> ---
> ?arch/arm/mach-tegra/tegra2_clocks.c | ? 35 +++++++++++++++++++++++++++++------
> ?1 files changed, 29 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
> index 196c249..2734889 100644
> --- a/arch/arm/mach-tegra/tegra2_clocks.c
> +++ b/arch/arm/mach-tegra/tegra2_clocks.c
> @@ -154,6 +154,12 @@ static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
> ?*/
> ?static DEFINE_SPINLOCK(clock_register_lock);
>
> +/*
> + * Some peripheral clocks share an enable bit, so refcount the enable bits
> + * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
> + */
> +static int tegra_periph_clk_enable_refcount[3 * 32];

Given that this is always locked when incrementing/decrementing,
should it just be switched to an array of atomics instead?


-Olof

^ permalink raw reply

* [PATCH v2 13/21] ARM: tegra: clock: Remove unnecessary uses of #ifdef CONFIG_DEBUG_FS
From: Olof Johansson @ 2011-02-21  4:17 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-15-git-send-email-ccross@android.com>

Hi,

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Technically, this patch does not _just_ "remove unneccessary uses of #ifdef".

I'd say "tegra: clock: minor cleanups" as patch subject, and:
* Remove unneccessary uses of #ifdef CONFIG_DEBUG_FS
* "1" -> "true" for some bool assigments

as patch description.

With that fixed:

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 12/21] ARM: tegra: clock: Add shared bus clock type
From: Olof Johansson @ 2011-02-21  4:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-1-git-send-email-ccross@android.com>

Hi,

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Some clocks may have multiple downstream users that need to request a
> higher clock rate. ?Shared bus clocks provide a unique shared_bus_user
> clock to each user. ?The frequency of the bus is set to the highest
> enabled shared_bus_user clock, with a minimum value set by the
> shared bus. ?Drivers can use clk_enable and clk_disable to enable
> or disable their requirement, and clk_set_rate to set the minimum rate.
>
> Signed-off-by: Colin Cross <ccross@android.com>

[...]
> diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
> index a1c86d8..dd53af3 100644
> --- a/arch/arm/mach-tegra/tegra2_clocks.c
> +++ b/arch/arm/mach-tegra/tegra2_clocks.c
[...]

> + ? ? ? c->u.shared_bus_user.rate = c->parent->max_rate;
> + ? ? ? c->state = OFF;
> +#ifdef CONFIG_DEBUG_FS
> + ? ? ? c->set = 1;
> +#endif
> +
> + ? ? ? spin_lock_irqsave(&c->parent->spinlock, flags);


A later patch in the series removes the ifdef. Might as well remove it
here. Also, should be c->set = true, which that patch also does. :)

With that fixed:

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 11/21] ARM: tegra: cpufreq: Take an extra reference to pllx
From: Olof Johansson @ 2011-02-21  4:12 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-13-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:26 PM, Colin Cross <ccross@android.com> wrote:
> During cpu frequency changes, take an extra reference to pllx so
> that it doesn't turn off and on while the cpu is temporarily on
> pllp. ?If the cpu is moved to pllp permanently, pllx will be
> turned off.
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 10/21] ARM: tegra: clock: Convert global lock to a lock per clock
From: Olof Johansson @ 2011-02-21  4:11 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-12-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Give each clock its own lock, and remove all lock traversals from
> parent to child clocks to prevent AB-BA deadlocks.
>
> This brings the locking in line with the common struct clk
> patches and should make conversion simple.
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 09/21] ARM: tegra: clock: Move unshared clk struct members into union
From: Olof Johansson @ 2011-02-21  4:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-11-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Same here, short description. With that:

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH 2/4] ARM: tegra: Prevent requeuing in-progress DMA requests
From: Colin Cross @ 2011-02-21  4:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298173137-9242-3-git-send-email-swarren@nvidia.com>

On Sat, Feb 19, 2011 at 7:38 PM, Stephen Warren <swarren@nvidia.com> wrote:
> If a request already in the queue is passed to tegra_dma_enqueue_req,
> tegra_dma_req.node->{next,prev} will end up pointing to itself instead
> of at tegra_dma_channel.list, which is the way a the end-of-list
> should be set up. When the DMA request completes and is list_del'd,
> the list head will still point at it, yet the node's next/prev will
> contain the list poison values. When the next DMA request completes,
> a kernel panic will occur when those poison values are dereferenced.
>
> This makes the DMA driver more robust in the face of buggy clients.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> ?arch/arm/mach-tegra/dma.c | ? ?8 ++++++++
> ?1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
> index 250bc7b..f3b869b 100644
> --- a/arch/arm/mach-tegra/dma.c
> +++ b/arch/arm/mach-tegra/dma.c
> @@ -311,6 +311,7 @@ int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
> ? ? ? ?struct tegra_dma_req *req)
> ?{
> ? ? ? ?unsigned long irq_flags;
> + ? ? ? struct tegra_dma_req *_req;
> ? ? ? ?int start_dma = 0;
>
> ? ? ? ?if (req->size > NV_DMA_MAX_TRASFER_SIZE ||
> @@ -321,6 +322,13 @@ int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
>
> ? ? ? ?spin_lock_irqsave(&ch->lock, irq_flags);
>
> + ? ? ? list_for_each_entry(_req, &ch->list, node) {
> + ? ? ? ? ? ? ? if (req == _req) {
> + ? ? ? ? ? ? ? ? ? ? ? spin_unlock_irqrestore(&ch->lock, irq_flags);
> + ? ? ? ? ? ? ? ? ? ? ? return -EEXIST;
> + ? ? ? ? ? ? ? }
> + ? ? ? }
> +
> ? ? ? ?req->bytes_transferred = 0;
> ? ? ? ?req->status = 0;
> ? ? ? ?req->buffer_status = 0;
> --
> 1.7.1
>
>

Pushed to tegra for-next

^ permalink raw reply

* [PATCH v2 08/21] ARM: tegra: clock: Rearrange static clock tables
From: Olof Johansson @ 2011-02-21  4:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-10-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Make the static clocks look more like the array of clocks
> so they can all be initalized with the same helper function.
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 07/21] ARM: tegra: clock: Drop CPU dvfs
From: Olof Johansson @ 2011-02-21  4:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-9-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> The existing version did not extend well to core dvfs, drop it
> for now until the new clk api with clk_prepare and clk_unprepare
> is ready and non-atomic clocks are possible.
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 06/21] ARM: tegra: clock: Initialize clocks that have no enable
From: Olof Johansson @ 2011-02-21  4:08 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-8-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Assume that any clock that has no enable op is always on.
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 04/21] ARM: tegra: clock: Don't use PLL lock bits
From: Olof Johansson @ 2011-02-21  4:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-6-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> The PLL lock bits are not reliable, use per-PLL timeouts instead.
>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 03/21] ARM: tegra: clock: Drop debugging
From: Olof Johansson @ 2011-02-21  4:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-5-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Same here, I know the patch is obvious but just a one-liner in the
patch description is common practice.

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 02/21] ARM: tegra: clock: Don't BUG on changing an enabled PLL
From: Olof Johansson @ 2011-02-21  4:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-4-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> Signed-off-by: Colin Cross <ccross@android.com>

Please add a 1-line description of why bugging doesn't make sense.

Patch itself:

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 01/21] ARM: tegra: clock: enable clk reset for non-peripheral clocks
From: Olof Johansson @ 2011-02-21  4:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1298154371-5641-3-git-send-email-ccross@android.com>

On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
> From: Dima Zavin <dima@android.com>
>
> Add a new 'reset' clk op. This can be provided for any clock,
> not just peripherals.
>
> Signed-off-by: Dima Zavin <dima@android.com>
> Signed-off-by: Colin Cross <ccross@android.com>

Acked-by: Olof Johansson <olof@lixom.net>

^ permalink raw reply

* [PATCH v2 05/21] ARM: tegra: clock: Disable clocks left on by bootloader
From: Olof Johansson @ 2011-02-21  4:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <AANLkTin_4AfAgfWu=Qq_rO2T6o=u=JX9YKHquX85HrWe@mail.gmail.com>

On Sun, Feb 20, 2011 at 7:43 PM, Colin Cross <ccross@android.com> wrote:
> On Sun, Feb 20, 2011 at 4:40 PM, Olof Johansson <olof@lixom.net> wrote:
>> Hi,
>>
>> On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
>>> Adds CONFIG_TEGRA_DISABLE_BOOTLOADER_CLOCKS that iterates
>>> through all clocks, disabling any for which the refcount
>>> is 0 but the clock init detected the bootloader left the
>>> clock on.
>>
>>
>> I would argue that any kernel functionality that relies on clocks
>> being left on my bootloader is buggy, and/or should at least have
>> those clocks enabled in the static clock tables for the boards in
>> question, since it creates an undocumented dependency on firmware.
>>
>> I would prefer if it disabled the clocks by default (after warning),
>> but that there was a runtime way to override while debugging (i.e. add
>> a bootarg 'keep_fwclocks' or similar to keep the firmware-enabled
>> clocks running and just warn about them).
>
> That was the plan, but since many of the drivers are missing I didn't
> want to enable it by default yet. ?However, it turns out the problems
> I was seeing at boot from this patch were actually due to a bug in the
> clock code causing the cpu clock to be disabled for clocks that have
> no disable. ?I will drop this patch, and post a separate series after
> these that fixes the bug and turns off clocks by default, with a
> runtime argument like you suggested.


Sounds good. Alternatively, this can go in and be revisited with the
above proposed changes; both approaches would be OK with me.


-Olof

^ permalink raw reply

* [PATCH 1/2] PRUSS UIO driver support
From: TK, Pratheesh Gangadhar @ 2011-02-21  3:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20110219183427.GG4684@local>

Hi Hans,

> -----Original Message-----
> From: Hans J. Koch [mailto:hjk at hansjkoch.de]
> Sent: Sunday, February 20, 2011 12:04 AM
> To: TK, Pratheesh Gangadhar
> Cc: Thomas Gleixner; Arnd Bergmann; linux-arm-kernel at lists.infradead.org;
> davinci-linux-open-source at linux.davincidsp.com; gregkh at suse.de;
> Chatterjee, Amit; Hans J. Koch; LKML
> Subject: Re: [PATCH 1/2] PRUSS UIO driver support
> 
> On Sat, Feb 19, 2011 at 09:10:23PM +0530, TK, Pratheesh Gangadhar wrote:
> >
> > For my understanding - if the interrupt is not shared and not level
> triggered -
> > is this okay to have empty handler?
> 
> Greg already said he won't accept that. And I'm quite sure these
> interrupts
> are level triggered, since that is the default on arch/omap.
> 
> E.g. in arch/arm/mach-omap1/irq.c, a loop sets all irqs to level triggered
> handling: set_irq_handler(j, handle_level_irq); (line 234)

You should be looking at arch/arm/mach-davinci/irq.c and all interrupts except IRQ_TINT1_TINT34 is set to edge trigger mode (line 160).
> 
> > In this specific case, these interrupt lines are internal to SOC and
> hooked to ARM INTC from PRUSS. PRUSS has another INTC to handle system
> events to PRUSS as well as to generate system events to host ARM. These
> generated events are used for IPC between user application and PRU
> firmware and for async notifications from PRU firmware to user space. I
> don't see a reason to make it shared as we have 8 lines available for use.
> As mentioned before ARM INTC interrupt processing logic converts
> interrupts to active high pulses.
> 
> What's a "pulse triggered interrupt"? I know level and edge triggered
> ones.

Basically it's same as edge triggered.

Thanks,
Pratheesh

^ permalink raw reply

* [PATCH v2 05/21] ARM: tegra: clock: Disable clocks left on by bootloader
From: Colin Cross @ 2011-02-21  3:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <AANLkTim8i5vvizBViqFCyq9i+7Uo2E1BrNRf_gtnMb-v@mail.gmail.com>

On Sun, Feb 20, 2011 at 4:40 PM, Olof Johansson <olof@lixom.net> wrote:
> Hi,
>
> On Sat, Feb 19, 2011 at 2:25 PM, Colin Cross <ccross@android.com> wrote:
>> Adds CONFIG_TEGRA_DISABLE_BOOTLOADER_CLOCKS that iterates
>> through all clocks, disabling any for which the refcount
>> is 0 but the clock init detected the bootloader left the
>> clock on.
>
>
> I would argue that any kernel functionality that relies on clocks
> being left on my bootloader is buggy, and/or should at least have
> those clocks enabled in the static clock tables for the boards in
> question, since it creates an undocumented dependency on firmware.
>
> I would prefer if it disabled the clocks by default (after warning),
> but that there was a runtime way to override while debugging (i.e. add
> a bootarg 'keep_fwclocks' or similar to keep the firmware-enabled
> clocks running and just warn about them).

That was the plan, but since many of the drivers are missing I didn't
want to enable it by default yet.  However, it turns out the problems
I was seeing at boot from this patch were actually due to a bug in the
clock code causing the cpu clock to be disabled for clocks that have
no disable.  I will drop this patch, and post a separate series after
these that fixes the bug and turns off clocks by default, with a
runtime argument like you suggested.

^ permalink raw reply


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