From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/5] ata: Add APM X-Gene SATA driver
Date: Mon, 11 Nov 2013 09:54:32 +0100 [thread overview]
Message-ID: <201311110954.32904.arnd@arndb.de> (raw)
In-Reply-To: <CAOesGMjEpC9-i52zYb2LtmyfV7FZQQGeeo4Umg-LXOYytZ4E-A@mail.gmail.com>
On Sunday 10 November 2013, Olof Johansson wrote:
>
> > diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> > index 46518c6..022f9d1 100644
> > --- a/drivers/ata/Makefile
> > +++ b/drivers/ata/Makefile
> > @@ -11,6 +11,8 @@ obj-$(CONFIG_SATA_SIL24) += sata_sil24.o
> > obj-$(CONFIG_SATA_DWC) += sata_dwc_460ex.o
> > obj-$(CONFIG_SATA_HIGHBANK) += sata_highbank.o libahci.o
> > obj-$(CONFIG_AHCI_IMX) += ahci_imx.o
> > +sata-xgene-objs := sata_xgene.o sata_xgene_serdes.o
> > +obj-$(CONFIG_SATA_XGENE) += sata-xgene.o
>
> Why not just doing obj-$(CONFIG_SATA_XGENE) += sata_xgene.o
> sata_xgene_serdes.o
> ?
>
That wouldn't create a single module built from two files. However, if
the serdes part is moved to the more appropriate drivers/phy directory
and changed to use generic interfaces (I guess they are merged now,
need to check), then it would be two modules anyay.
>
> > +/* Flush the IOB to ensure all SATA controller writes completed before
> > + servicing the completed command. */
> > +static int xgene_ahci_iob_flush(struct xgene_ahci_context *ctx)
> > +{
> > + if (ctx->ahbc_io_base == NULL) {
> > + void *ahbc_base;
> > + u32 val;
> > +
> > + /* The AHBC address is fixed in X-Gene */
> > + ahbc_base = devm_ioremap(ctx->dev, 0x1F2A0000, 0x80000);
>
> Even if fixed, having a defined constant makes sense here and below.
I would still insist on having the address be part of the DT and described
in the binding. You never know if the HW designers change their minds
on the next generation, or if the part is actually licensed from some
other company that also licensed the same thing to someone else.
I think this ought to be put into a proper device driver. It's not clear
from the comment why this is required here, but it seems to be either
working around a bug in MSI signalling that could go away entirely with
a fixed chip revision, or it's something that would be required by every
single DMA master in the system and should not be open-coded in the
individual device drivers.
> This doesn't quite make sense for me. In the case of ACPI firmware on
> server, the firmware can setup SERDES on its own. And if you want to
> provide new override values, you need to rebuild the firmware anyway,
> so there's no way to supply the overrides separately. Thus it really
> makes no sense to do these in the ACPI case.
Agreed.
> For DT the case is slightly different since the DT is supplied
> separate from the firmware image, so it's possible to ship newer
> settings. Still, even there there's no reason to not have firmware do
> the setup in most cases.
I'd argue that you shouldn't have to ship a fixed DT to change those
values, but instead put the values into the device driver and fix the
kernel when you need to change them.
Arnd
next prev parent reply other threads:[~2013-11-11 8:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-09 7:00 [PATCH v2 0/5] ata: Add APM X-Gene SATA controller support Loc Ho
2013-11-09 7:00 ` [PATCH v2 1/5] ata: Export AHCI library functions required by APM X-Gene SATA driver Loc Ho
2013-11-09 7:00 ` [PATCH v2 2/5] arm64: Add APM X-Gene DTS entry for SATA controllers Loc Ho
2013-11-09 7:00 ` [PATCH v2 3/5] ata: Add APM X-Gene SATA driver Loc Ho
2013-11-09 7:00 ` [PATCH v2 4/5] ata: Add APM X-Gene SATA serdes functions Loc Ho
2013-11-09 7:00 ` [PATCH v2 5/5] Documentation: Add documentation for APM X-Gene SATA DTS binding Loc Ho
2013-11-10 20:39 ` Arnd Bergmann
2013-11-11 17:50 ` Loc Ho
2013-11-11 19:06 ` Arnd Bergmann
2013-11-10 21:06 ` [PATCH v2 3/5] ata: Add APM X-Gene SATA driver Arnd Bergmann
2013-11-10 22:28 ` Olof Johansson
2013-11-11 8:54 ` Arnd Bergmann [this message]
2013-11-12 5:19 ` Loc Ho
2013-11-12 13:11 ` Arnd Bergmann
2013-11-12 22:39 ` Loc Ho
2013-11-13 5:20 ` Kishon Vijay Abraham I
2013-11-13 5:33 ` Loc Ho
2013-11-13 5:55 ` Kishon Vijay Abraham I
2013-11-13 6:02 ` Loc Ho
2013-11-13 9:31 ` Kishon Vijay Abraham I
2013-11-13 16:06 ` Loc Ho
2013-11-12 15:40 ` [PATCH v2 0/5] ata: Add APM X-Gene SATA controller support Bartlomiej Zolnierkiewicz
2013-11-12 16:34 ` Sergei Shtylyov
2013-11-12 17:30 ` Bartlomiej Zolnierkiewicz
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=201311110954.32904.arnd@arndb.de \
--to=arnd@arndb.de \
--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).