From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Oliver Schinagl
<oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>,
linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: [PATCH v2 0/4] ARM: sunxi: Add ahci-sunxi driver for Allwinner SoCs sata
Date: Sat, 4 Jan 2014 10:14:34 +0100 [thread overview]
Message-ID: <1388826878-5602-1-git-send-email-hdegoede@redhat.com> (raw)
Hi Tejun et al,
Here is the second version of the ahci-sunxi driver. Since Oliver is a bit low
on time atm, I've taken over the efforts to upstream this for now.
v1 was using the approach of having a platform device which probe method
creates a new child platform device which gets driven by ahci_platform.c,
as done by ahci_imx.c . This was rightfully frowned upon, so we've gone
looking for a better / cleaner solution.
The option of turning ahci_platform.c into a generic re-usable library to be
shared between different ahci platform drivers was considered and rejected.
Almost all functionality is already shared through libahci / ata-core,
ahci_platform.c really is just a few lines of glue-code generalized to be
shared for the simply ahci platform device case.
Modifying ahci_platform.c to be generic enough to cleanly handle more
complex platform ahci devices, results in much more complex code, which likely
will still need to be modified each time a new exotic platform device shows
up. There simply is not enough common code to share there, and making it
generic enough would grow the code to be larger then simply having stand-alone
platform drivers using libahci directly.
IOW I believe that the "last mile" of glue code simply cannot be efficiently
generalized.
So I've decided avoiding the ahci_imx.c ugliness is best done by refactoring
ahci_sunxi.c into a stand-alone platform driver, like ie sata_highbank.c.
To put this in numbers, ahci_platform.c is 353 lines, ahci_sunxi.c using
the ahci_imx.c approach (which was using ahci_platform.c as a lib) was 305
lines + 12 new lines in ahci_platform.c. ahci_sunxi.c as a standalone driver
is 351 lines. And the old ahci_sunxi.c was missing proper suspend / resume
support.
Please review and if there are no remark add patch 1 + 2 to your tree for
Linus. The dts bits will be merged through Maxime Ripard's tree.
Thanks & Regards,
Hans
next reply other threads:[~2014-01-04 9:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-04 9:14 Hans de Goede [this message]
[not found] ` <1388826878-5602-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-04 9:14 ` [PATCH v2 1/4] libahci: Add a pre ahci_start_engine hook Hans de Goede
[not found] ` <1388826878-5602-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-12 12:06 ` Tejun Heo
2014-01-04 9:14 ` [PATCH v2 2/4] ARM: sunxi: Add ahci-sunxi driver for the Allwinner SUNXi SoCs sata Hans de Goede
[not found] ` <1388826878-5602-3-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-04 21:39 ` Arnd Bergmann
2014-01-04 21:47 ` Arnd Bergmann
2014-01-05 12:42 ` Olliver Schinagl
[not found] ` <52C9534E.4000701-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
2014-01-05 13:06 ` Hans de Goede
2014-01-05 13:32 ` Hans de Goede
[not found] ` <52C95ED0.5060207-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-05 14:00 ` Olliver Schinagl
2014-01-04 23:44 ` Hans de Goede
[not found] ` <52C89CC6.3010409-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-01-05 11:35 ` Arnd Bergmann
[not found] ` <201401051235.11910.arnd-r2nGTMty4D4@public.gmane.org>
2014-01-05 13:29 ` Hans de Goede
2014-01-04 9:14 ` [PATCH v2 3/4] ARM: sun4i: dts: Add ahci / sata support Hans de Goede
2014-01-04 9:14 ` [PATCH v2 4/4] ARM: sun7i: " 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=1388826878-5602-1-git-send-email-hdegoede@redhat.com \
--to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).