linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC v3 10/13] ahci_imx: Adjust for ahci_platform managing the clocks
Date: Sun, 19 Jan 2014 20:38:15 +0100	[thread overview]
Message-ID: <52DC29A7.9030206@redhat.com> (raw)
In-Reply-To: <20140119193258.GT15937@n2100.arm.linux.org.uk>

Hi,

On 01/19/2014 08:32 PM, Russell King - ARM Linux wrote:
> On Sun, Jan 19, 2014 at 08:30:37PM +0100, Hans de Goede wrote:
>> Hi,
>>
>> On 01/19/2014 01:41 PM, Russell King - ARM Linux wrote:
>>> On Sun, Jan 19, 2014 at 12:48:52AM +0100, Hans de Goede wrote:
>>>> +enum {
>>>> +	CLK_SATA,
>>>> +	CLK_SATA_REF,
>>>> +	CLK_AHB
>>>> +};
>>>
>>> Err, so we now rely on the order that these clocks are specified in DT
>>> rather than their name properties to provide the correct clock... that
>>> sounds particularly fragile to me.
>>
>> Both in the ohci- / ehci-platform case, where the idea of purely addressing
>> clocks by index comes from, as well as in the ahci-platform case, people
>> have been asking me to make things more generic, so as to avoid having
>> a gazillion almost but not quite the same ehci-foo platform drivers.
>>
>> This has already happened with ohci-foo.c drivers, and the hope is that
>> with the new generalized ohci-plaform.c many of the existing ohci-foo
>> drivers can go away over time.
>>
>> The downside of this generalized approach is that we cannot use clock-names
>> since those tend to be implementation specific.
>>
>> In the specific case of the ahci-imx driver this means that certain clocks
>> must be at a specific index, since it needs to know which one is the AHB
>> clock, as documented in the bindings documentation. I don't see how mandating
>> certain indices is different and/or more fragile then mandating certain names
>> in the bindings document. I agree that is is slightly less clear to someone
>> reading the dts, but that is the price we have to pay for this desire for
>> things to be generic.
>
> So what happens if we have the same IP block appearing, but the SATA_REF
> or SATA clock isn't present - how do we still provide an AHB clock (for
> argument sake)?

Then it will not use the same compatible string, since then clearly it is not
compatible with "fsl,imx6q-ahci"

And we can document different indices for the new compatible string (and adjust
the code to match).

Regards,

Hans

  reply	other threads:[~2014-01-19 19:38 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 23:48 [RFC v3 00/13] ahci: add sunxi driver and cleanup imx driver Hans de Goede
2014-01-18 23:48 ` [RFC v3 01/13] libahci: Allow drivers to override start_engine Hans de Goede
2014-01-19  4:46   ` Tejun Heo
2014-01-19 18:48     ` Hans de Goede
2014-01-18 23:48 ` [RFC v3 02/13] sata-highbank: Remove unnecessary ahci_platform.h include Hans de Goede
2014-01-19 11:15   ` Tejun Heo
2014-01-18 23:48 ` [RFC v3 03/13] ahci-platform: Fix clk enable/disable unbalance on suspend/resume Hans de Goede
2014-01-19 11:14   ` Tejun Heo
2014-01-19 18:47     ` Hans de Goede
2014-01-19 19:15       ` Tejun Heo
2014-01-19 19:52         ` Hans de Goede
2014-01-20 12:26           ` Tejun Heo
2014-01-18 23:48 ` [RFC v3 04/13] ahci-platform: Undo pdata->resume on resume failure Hans de Goede
2014-01-19 11:27   ` Tejun Heo
2014-01-19 18:40     ` Hans de Goede
2014-01-19 19:13       ` Tejun Heo
2014-01-19 19:34         ` Hans de Goede
2014-01-19 19:42           ` Tejun Heo
2014-01-19 19:53             ` Hans de Goede
2014-01-18 23:48 ` [RFC v3 05/13] ahci-platform: Pass ahci_host_priv ptr to ahci_platform_data init method Hans de Goede
2014-01-19 11:30   ` Tejun Heo
2014-01-19 18:51     ` Hans de Goede
2014-01-19 19:17       ` Tejun Heo
2014-01-19 19:56         ` Hans de Goede
2014-01-20 12:28           ` Tejun Heo
2014-01-18 23:48 ` [RFC v3 06/13] ahci-platform: Add support for devices with more then 1 clock Hans de Goede
2014-01-19 12:38   ` Russell King - ARM Linux
2014-01-19 19:20     ` Hans de Goede
2014-01-18 23:48 ` [RFC v3 07/13] ahci-platform: Add support for an optional regulator for sata-target power Hans de Goede
2014-01-18 23:48 ` [RFC v3 08/13] ahci-platform: Allow specifying platform_data through of_device_id Hans de Goede
2014-01-19 11:38   ` Tejun Heo
2014-01-19 12:30     ` Russell King - ARM Linux
2014-01-19 13:19       ` Tejun Heo
2014-01-19 18:56     ` Hans de Goede
2014-01-19 19:22       ` Tejun Heo
2014-01-20  8:24   ` Sascha Hauer
2014-01-20  8:35     ` Hans de Goede
2014-01-20  9:09       ` Sascha Hauer
2014-01-20  9:17         ` Hans de Goede
2014-01-20  9:57           ` Sascha Hauer
2014-01-18 23:48 ` [RFC v3 09/13] ARM: sunxi: Add support for Allwinner SUNXi SoCs sata to ahci_platform Hans de Goede
2014-01-19 12:22   ` Russell King - ARM Linux
2014-01-19 19:07     ` Hans de Goede
2014-01-19 19:56       ` Russell King - ARM Linux
2014-01-19 20:01         ` Hans de Goede
2014-01-18 23:48 ` [RFC v3 10/13] ahci_imx: Adjust for ahci_platform managing the clocks Hans de Goede
2014-01-19 12:41   ` Russell King - ARM Linux
2014-01-19 19:30     ` Hans de Goede
2014-01-19 19:32       ` Russell King - ARM Linux
2014-01-19 19:38         ` Hans de Goede [this message]
2014-01-18 23:48 ` [RFC v3 11/13] ahci-imx: Don't create a nested platform device from probe Hans de Goede
2014-01-19 12:25   ` Russell King - ARM Linux
2014-01-19 19:08     ` Hans de Goede
2014-01-18 23:48 ` [RFC v3 12/13] ARM: sun4i: dts: Add ahci / sata support Hans de Goede
2014-01-18 23:48 ` [RFC v3 13/13] ARM: sun7i: " Hans de Goede
2014-01-19  9:52 ` [RFC v3 00/13] ahci: add sunxi driver and cleanup imx driver Russell King - ARM Linux

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=52DC29A7.9030206@redhat.com \
    --to=hdegoede@redhat.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).