All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@opensource.altera.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <dan.j.williams@intel.com>, Dinh Nguyen <dinh.linux@gmail.com>,
	<vinod.koul@intel.com>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, olof Johansson <olof@lixom.net>
Subject: Re: [PATCH] dmaengine: pl300: enable the clock to PL330 dma
Date: Mon, 4 May 2015 09:06:36 -0500	[thread overview]
Message-ID: <55477CEC.1050600@opensource.altera.com> (raw)
In-Reply-To: <CAJKOXPe5aLLqfDPDKF7AK4jS1bpgHptWZbrtJ8Q12SQkR0Cq4w@mail.gmail.com>

+CC Olof

On 5/4/15 8:50 AM, Krzysztof Kozlowski wrote:
> 2015-05-04 22:28 GMT+09:00 Dinh Nguyen <dinguyen@opensource.altera.com>:
>> Hi Krzystof,
>>
>> On 5/4/15 12:30 AM, Krzysztof Kozlowski wrote:
>>> 2015-05-04 13:28 GMT+09:00  <dinguyen@opensource.altera.com>:
>>>> From: Dinh Nguyen <dinguyen@opensource.altera.com>
>>>>
>>>> Turn on the clock to the PL330 DMA if there is a clock node provided.
>>>
>>> Why? There is no explanation in the patch for this important question - why?
>>>
>>> Amba bus already does this and provide a wrapper function.
>>> Additionally that would mess up with runtime PM and clock
>>> enable/disable.
>>
>> I don't see the clock for the DMA getting turned on at all, which is why
>> after the kernel has booted, the filesystem tries to open up a serial
>> port using DMA and the system hangs. The failure is seen here:
>>
>> http://arm-soc.lixom.net/bootlogs/next/next-20150504/socfpga-arm-multi_v7_defconfig.html
> 
> Thanks!
> 
> The amba bus and pl330 should enable the clock and then disable it
> after probing:
> static int amba_probe(struct device *dev)
> {
> ...
>         ret = amba_get_enable_pclk(pcdev);
> ...
> 
> I wonder why do you think it is not enabled at all?

I've checked it down to the register level that the gate for this clock
does not get set.

> 
>>
>> This only happens with the multi_v7_defconfig, because the PL330 DMA is
>> getting built into the kernel, while the socfpga_defconfig does not
>> enable the PL330.
> 
> It makes sense. If pl330 driver is not enabled then necessary clocks
> are turned on by bootloader. Probing pl330 effectively disables the
> clock (if DMA is not used).
> 
>> The DTS for the socfpga platform looks like this:
>>
>> pdma: pdma@ffe01000 {
>>         compatible = "arm,pl330", "arm,primecell";
>>         reg = <0xffe01000 0x1000>;
>>         interrupts = <0 104 4>,
>>                     <0 105 4>,
>>                 ...
>>                 #dma-cells = <1>;
>>                 #dma-channels = <8>;
>>                 #dma-requests = <32>;
>>                 clocks = <&l4_main_clk>;
>>                 clock-names = "apb_pclk";
>> };
>>
>> Perhaps I have the wrong designation for clock-names and the amba bus is
>> not able to pick up the correct clock?
> 
> I have two ideas:
> 1. Is this really the clock for the DMA? If DMA is not used then
> disabling it should be OK.

Yes, this is the clock for the DMA. Yeah, leaving this clock off is
fine, until the DMA gets used. Up until v4.0, SoCFPGA was not using the
DMA at all, but in v4.0, there was a patch to assign the UARTs to it's
DMA channel.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/socfpga.dtsi?id=78c03c7af89721bd8a4428408a8cc7b53972e4b8

> 2. Disabling the clock may effectively disable its parent or
> grandparent if there are not more users. Maybe some other driver needs
> these parents to be enabled? This was the issue for at least one
> similar error (on Exynos boards).
> 

I'll check up on these issues. When I was debugging this issue, the
l4_main_clk is only used by the DMA, so it was not getting turned on by
an other drivers.

Thanks,
Dinh

  reply	other threads:[~2015-05-04 14:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04  4:28 [PATCH] dmaengine: pl300: enable the clock to PL330 dma dinguyen
2015-05-04  5:30 ` Krzysztof Kozlowski
2015-05-04 13:28   ` Dinh Nguyen
2015-05-04 13:50     ` Krzysztof Kozlowski
2015-05-04 14:06       ` Dinh Nguyen [this message]
2015-05-04 19:52         ` Dinh Nguyen
2015-05-05  3:55           ` Krzysztof Kozlowski
2015-05-05 14:56             ` Dinh Nguyen
2015-05-05 19:22               ` Dinh Nguyen
2015-05-20 20:30                 ` Dinh Nguyen
2015-05-21  0:16                   ` Krzysztof Kozlowski
2015-05-21  0:35                     ` Krzysztof Kozlowski
2015-05-21 16:12                       ` Dinh Nguyen

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=55477CEC.1050600@opensource.altera.com \
    --to=dinguyen@opensource.altera.com \
    --cc=dan.j.williams@intel.com \
    --cc=dinh.linux@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=vinod.koul@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.