From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Lin Mac <mkl0301@gmail.com>,
htejun@gmail.com, linux-arm-kernel@lists.infradead.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCH v2 0/3] add CNS3xxx AHCI support
Date: Fri, 7 Jan 2011 18:47:14 +0300 [thread overview]
Message-ID: <20110107154714.GA27055@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <4D264DA4.6040308@pobox.com>
On Thu, Jan 06, 2011 at 06:17:56PM -0500, Jeff Garzik wrote:
> >[...]
> >>>It is overkill to rename the entirety of ahci_platform just for one override
> >>>function.
> >>>This sort of thing I would have expected to be added directly to
> >>>ahci_platform.c.
> >>It might be overkill for only one controller. but it is more clean and
> >>readable to have different SoC specific changes in separate files,
> >>especially when more SoCs need to make similar changes.
> >
> >I think that renaming the file is not necessary. You can just
> >rename the module in the makefile.
> >
> >Personally I like the current approach more than putting
> >controller-specific fixups directly into ahci_platform.
>
> My main objection is the renaming. If ahci_platform wants to export
> some symbols for SoC modules like ahci_platform_cns, that's ok.
>
> In general, follow the library approach rather than linking modules
> together in strange ways.
In ahci_platform case there's almost nothing to factor out to a
library. Each platform just needs its own small "fixups" that we
normally pass via platform data.
We would happily pass them via platform data, and initially Mac
did exactly this, see:
http://ns3.spinics.net/lists/linux-ide/msg39554.html
You may notice that all platform-specific quirks are in the
platform code, which is neat. But there is a problem: once
the platform code needs to use libata, then we have to
build libata into the kernel (no modules possible), i.e.
http://ns3.spinics.net/lists/linux-ide/msg39656.html
It's not something new, we have the same "problem" with SDHCI,
USB and plenty other drivers. But the solution is simple, for
example see drivers/mmc/host/sdhci-pltfm.c and sdhci-cns3xxx.c
(and sdhci-esdhc-imx.c as another example of platform-specific
hooks for sdhci-pltfm).
Of course, we could make full-fledged platform driver just for
CNS3xxx, but that's kind of overkill. IMO, it's better to make
ahci_platform flexible and suitable for generic use.
As for renaming, I agree that ahci_platform.c file does not
need to be renamed, I still think that we could just rename
the module (so far it is used only on CNS3xxx platforms, so
no big deal even if anybody rely on the module name, which
I doubt.)
Thanks,
--
Anton Vorontsov
Email: cbouatmailru@gmail.com
next prev parent reply other threads:[~2011-01-07 15:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 5:43 [PATCH v2 0/3] add CNS3xxx AHCI support mkl0301
2011-01-05 5:43 ` [PATCH v2 1/3] ahci_platform: rename to ahci_pltfm, but keep the original module name mkl0301
2011-01-05 5:43 ` [PATCH v2 2/3] ahci_pltfm: switch to module device table matching mkl0301
2011-01-06 10:53 ` Anton Vorontsov
2011-01-05 5:43 ` [PATCH v2 3/3] ahci_platform: add support for CNS3xxx SoC devices mkl0301
2011-01-06 11:02 ` Anton Vorontsov
2011-01-05 18:15 ` [PATCH v2 0/3] add CNS3xxx AHCI support Jeff Garzik
2011-01-06 6:43 ` Lin Mac
2011-01-06 10:51 ` Anton Vorontsov
2011-01-06 16:18 ` Lin Mac
2011-01-06 23:17 ` Jeff Garzik
2011-01-07 15:47 ` Anton Vorontsov [this message]
2011-01-07 23:44 ` Lin Mac
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=20110107154714.GA27055@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=mkl0301@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).