From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] ata: add new-style AHCI platform driver for DaVinci DA850 AHCI controller
Date: Thu, 20 Mar 2014 18:53:09 +0530 [thread overview]
Message-ID: <532AEBBD.80707@ti.com> (raw)
In-Reply-To: <2662651.GJX9HVKij5@amdc1032>
On Thursday 20 March 2014 06:27 PM, Bartlomiej Zolnierkiewicz wrote:
>>> diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
>>> +extern void __iomem *da8xx_syscfg1_base;
>>
>> This platform specific extern symbol should not be used in drivers and
>> in fact checkpatch complains about it too. Can you instead get the
>> addresses you need as part of the device resources?
>
> This is problematic because it is system resource not particular device
> resource. I would prefer to wait with fixing it until the conversion to
> the device tree.
The way you have it now, module build will fail because the symbol isn't
exported from platform code (and it should not be). The register is
"system level" but it is SATA specific and I see no problem in passing
it to the driver.
Conversion to device tree will not change anything until we throw out
the platform device code. That may or may not ever happen.
>>> +static int da850_sata_init(struct device *dev, void __iomem *addr)
>>> +{
>>> + int i, ret;
>>> + unsigned int val;
>>> +
>>> + da850_sata_clk = clk_get(dev, NULL);
>>> + if (IS_ERR(da850_sata_clk))
>>> + return PTR_ERR(da850_sata_clk);
>>> +
>>> + ret = clk_prepare_enable(da850_sata_clk);
>>> + if (ret)
>>> + goto err0;
>>
>> Please switch to pm_runtime instead of using the clock APIs directly.
>
> Could you please elaborate a bit more on this?
I meant using pm_runtime_get_sync() to enable the clocks. There are many
examples in the kernel. drivers/watchdog/omap_wdt.c is one.
Documentation is available in Documentation/power/runtime_pm.txt
>>> +static struct platform_device_id ahci_da850_platform_ids[] = {
>>> + { .name = "ahci" },
>>
>> I was not able to get this driver probed with this name (I guess that
>> was because the generic driver was picked instead?). Can you please
>
> Yes, the generic driver should be disabled to use this one.
>> change it to "da850-sata"?
>
> I prefer to remove the ids table (so the "ahci_da850" driver name is
> used) and update the platform device name accordingly. This would also
> allow me to remove the old ahci_platform_data code in this patch.
>
> Is this OK with you?
Fine with me. Sounds good.
Thanks,
Sekhar
next prev parent reply other threads:[~2014-03-20 13:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 18:31 [PATCH 0/4] ata: add remaining new-style AHCI platform drivers Bartlomiej Zolnierkiewicz
2014-03-17 18:31 ` [PATCH 1/4] ata: ahci_platform: fix ahci_platform_data->suspend method handling Bartlomiej Zolnierkiewicz
2014-03-17 18:31 ` [PATCH 2/4] ata: move library code from ahci_platform.c to libahci_platform.c Bartlomiej Zolnierkiewicz
2014-03-17 18:31 ` [PATCH 3/4] ata: add new-style AHCI platform driver for DaVinci DA850 AHCI controller Bartlomiej Zolnierkiewicz
2014-03-20 8:11 ` Sekhar Nori
2014-03-20 12:57 ` Bartlomiej Zolnierkiewicz
2014-03-20 13:23 ` Sekhar Nori [this message]
2014-03-20 14:24 ` Bartlomiej Zolnierkiewicz
2014-03-20 15:07 ` Bartlomiej Zolnierkiewicz
2014-03-17 18:31 ` [PATCH 4/4] ata: add new-style AHCI platform driver for ST SPEAr1340 " Bartlomiej Zolnierkiewicz
2014-03-20 8:57 ` Pratyush Anand
2014-03-20 11:51 ` Bartlomiej Zolnierkiewicz
2014-03-17 18:57 ` [PATCH 0/4] ata: add remaining new-style AHCI platform drivers Tejun Heo
2014-03-17 19:18 ` Hans de Goede
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=532AEBBD.80707@ti.com \
--to=nsekhar@ti.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).