From: Liviu Dudau <liviu@dudau.co.uk>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
Will Deacon <Will.Deacon@arm.com>,
Jingoo Han <jg1.han@samsung.com>,
Kukjin Kim <kgene.kim@samsung.com>,
Suravee Suthikulanit <suravee.suthikulpanit@amd.com>,
linux-pci <linux-pci@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
LAKML <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] drivers: pci: convert generic host controller to DT host bridge creation API
Date: Fri, 22 Aug 2014 00:07:40 +0100 [thread overview]
Message-ID: <20140821230740.GJ13147@bart.dudau.co.uk> (raw)
In-Reply-To: <201408202139.27678.arnd@arndb.de>
On Wed, Aug 20, 2014 at 09:39:27PM +0200, Arnd Bergmann wrote:
> On Wednesday 20 August 2014, Liviu Dudau wrote:
> > That has been the general approach of my patchset up to v9. But, as Bjorn has
> > mentioned in his v8 review and I have put in my cover letter, the regular
> > aproach means that architectures that use pci_scan_root_bus() will have to
> > drop their one liner and replace it with the more verbose of_create_pci_host_bridge()
> > followed by pci_scan_child_bus() and pci_bus_add_devices() (basically, the content
> > of pci_scan_root_bus()). For those architectures it will lead to a net increase of
> > lines of code.
>
> I'll try to get hold of Bjorn here and discuss it with him in person. I'd
> rather see a few extra lines in each driver than the complexity of callback
> funtions.
>
> > The patch for pci-host-generic.c is the first to use the callback setup function, but
> > not the only one. My PCI host bridge driver for Juno has the same need, and I'm betting
> > all other host bridge controllers will use it as it will be the only opportunity to
> > finish the controller setup before we start scanning the child busses. I'm trying to
> > balance ease of read vs ease of use here and it is the best version I've come up with
> > so far.
>
> My main objection to the new approach is that it's different from most other
> subsystems doing the same thing. For a person reading the pci host driver
> implementation, when they are familiar with other device drivers, I think it's
> much clearer what is going on when smaller functions are called in sequence
> than to see one function passed into some other interface that you now have
> to read as well in order to understand when it gets called.
Would it be more clear if (when) the currently opaque sysdata becomes a structure
to be filled by the host bridge driver with a .setup member pointing to the
callback? That would be my preferred way of expressing the API, tbh, but it means
duplicating the existing pci_{create,scan}_root_bus() functions.
Best regards,
Liviu
>
> Arnd
>
--
-------------------
.oooO
( )
\ ( Oooo.
\_) ( )
) /
(_/
One small step
for me ...
next prev parent reply other threads:[~2014-08-21 23:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 16:41 Liviu Dudau
2014-08-19 12:05 ` Will Deacon
2014-08-20 11:23 ` Arnd Bergmann
2014-09-04 13:39 ` Lorenzo Pieralisi
2014-09-04 14:05 ` Arnd Bergmann
2014-09-04 16:02 ` Lorenzo Pieralisi
2014-09-04 18:56 ` Arnd Bergmann
2014-08-20 11:27 ` Arnd Bergmann
2014-08-20 12:31 ` Liviu Dudau
2014-08-20 19:39 ` Arnd Bergmann
2014-08-21 23:07 ` Liviu Dudau [this message]
2014-08-20 22:35 ` Bjorn Helgaas
2014-08-21 18:02 ` Bjorn Helgaas
2014-08-21 22:13 ` Liviu Dudau
2014-08-21 23:01 ` Liviu Dudau
2014-08-22 5:13 ` Bjorn Helgaas
2014-08-22 12:32 ` Liviu Dudau
2014-08-22 15:27 ` Bjorn Helgaas
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=20140821230740.GJ13147@bart.dudau.co.uk \
--to=liviu@dudau.co.uk \
--cc=Catalin.Marinas@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=Will.Deacon@arm.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=jg1.han@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=suravee.suthikulpanit@amd.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
Powered by JetHome