From: viresh.kumar@st.com (Viresh KUMAR)
To: linux-arm-kernel@lists.infradead.org
Subject: Should we pass amba device peripheral id with device structure or not?
Date: Wed, 26 May 2010 13:57:05 +0530 [thread overview]
Message-ID: <4BFCDB59.5060304@st.com> (raw)
In-Reply-To: <20100524213237.GH21117@n2100.arm.linux.org.uk>
On 5/25/2010 3:02 AM, Russell King - ARM Linux wrote:
> On Mon, May 24, 2010 at 10:08:52AM +0530, Viresh KUMAR wrote:
>> On 5/22/2010 1:08 AM, Russell King - ARM Linux wrote:
>>> On Fri, May 14, 2010 at 12:32:18PM +0530, Viresh KUMAR wrote:
>>>> amba_device_register function reads and updates peripheral id from
>>>> hardware registers, whenever we register any amba device. If clock
>>>> to device is disabled, then amba_device_register will not be able
>>>> to read and update this value.
>>>
>>> This is a potential problem - if the drivers are already initialized
>>> in the kernel, then the drivers will try to initialize as soon as
>>> amba_device_register() is called. If the registers aren't accessible
>>> at amba_device_register() time, the driver initialization could fail.
>>>
>>> I think it's better to understand what's going on here before making
>>> suggestions.
>>>
>>> The clks in the primecell drivers are for the external side clocks
>>> only; these drivers all make the assumption that the AMBA bus clock
>>> is always enabled. Does your SoC turn the AMBA bus clock to peripherals
>>> on and off?
>>
>> There is only one bit per peripheral to enable/disable clock.
>> So with clocks disabled, we get 0x00000000 on read from device registers.
>
> So... that must mean your hardware gates both the peripheral clock and
> the per-primecell bus clock together. Let's hope that the bus clock
> control takes notice of any in-progress bus transaction...
>
> However, I'm still concerned - the driver's use of clk_enable/clk_disable
> is based on the assumption that these calls do not affect the bus clock -
> we expect to be able to write to registers before the first clk_enable()
> call.
>
> And as I've said (and you cut off of the quote) if we have SoCs where the
> bus clock is controllable, we need amba/bus.c to deal with that situation.
>
> Okay, I'll look at addressing that _after_ this merge window has closed.
>
OK.
next prev parent reply other threads:[~2010-05-26 8:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 7:02 Should we pass amba device peripheral id with device structure or not? Viresh KUMAR
2010-05-14 14:25 ` Catalin Marinas
2010-05-21 19:38 ` Russell King - ARM Linux
2010-05-24 4:38 ` Viresh KUMAR
2010-05-24 21:32 ` Russell King - ARM Linux
2010-05-24 22:17 ` Linus Walleij
2010-05-24 22:32 ` Russell King - ARM Linux
2010-05-26 8:27 ` Viresh KUMAR [this message]
2010-05-24 21:51 ` Linus Walleij
2010-05-24 20:14 ` Linus Walleij
2010-05-26 8:30 ` Viresh KUMAR
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BFCDB59.5060304@st.com \
--to=viresh.kumar@st.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).