From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Sekhar Nori <nsekhar@ti.com>
Cc: Tejun Heo <tj@kernel.org>,
Kevin Hilman <khilman@deeprootsystems.com>,
Viresh Kumar <viresh.linux@gmail.com>,
Shiraz Hashim <shiraz.hashim@st.com>,
linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
davinci-linux-open-source@linux.davincidsp.com,
spear-devel@list.st.com
Subject: Re: [PATCH 3/4] ata: add new-style AHCI platform driver for DaVinci DA850 AHCI controller
Date: Thu, 20 Mar 2014 15:24:41 +0100 [thread overview]
Message-ID: <4579887.D6KcuxH2bm@amdc1032> (raw)
In-Reply-To: <532AEBBD.80707@ti.com>
On Thursday, March 20, 2014 06:53:09 PM Sekhar Nori wrote:
> 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.
OK, I'll try to fix it.
> 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
What would be benefit of adding runtime PM methods (->runtime_suspend
and ->runtime_resume) just for enabling/disabling this clock on driver
->probe and ->remove methods? Wouldn't it add complexity and additonal
dependency (on runtime PM) just for no gain?
Is the driver specific clock control even needed given the resource
handling in the generic AHCI platform library code (please see
ahci_platform_get_resources(), ahci_platform_enable_resources() and
ahci_platform_disable_resources())?
[ Please also take a look at commit f1e70c2 ("ata/ahci_platform: Add
clock framework support") which on Aug 27 2012 added generic clock
control to ahci_platform driver but forgot to cleanup DA850 AHCI
platform code. The DA850 AHCI support was added much earlier by
commit cbb2c961 ("davinci: da850: add support for SATA interface")
on Jul 6 2011. ]
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
next prev parent reply other threads:[~2014-03-20 14:25 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
[not found] ` <1395081118-15248-4-git-send-email-b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-20 8:11 ` Sekhar Nori
2014-03-20 12:57 ` Bartlomiej Zolnierkiewicz
2014-03-20 13:23 ` Sekhar Nori
2014-03-20 14:24 ` Bartlomiej Zolnierkiewicz [this message]
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=4579887.D6KcuxH2bm@amdc1032 \
--to=b.zolnierkie@samsung.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=shiraz.hashim@st.com \
--cc=spear-devel@list.st.com \
--cc=tj@kernel.org \
--cc=viresh.linux@gmail.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 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).