From: Julia Lawall <julia.lawall@lip6.fr>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Himangi Saraogi <himangi774@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: ambakmi - Use managed interfaces
Date: Sun, 13 Jul 2014 20:29:56 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1407132029080.2060@localhost6.localdomain6> (raw)
In-Reply-To: <20140713182123.GM21766@n2100.arm.linux.org.uk>
On Sun, 13 Jul 2014, Russell King - ARM Linux wrote:
> On Sun, Jul 13, 2014 at 08:11:29PM +0200, Julia Lawall wrote:
> > On Sun, 13 Jul 2014, Russell King - ARM Linux wrote:
> >
> > > On Sun, Jul 13, 2014 at 11:00:51PM +0530, Himangi Saraogi wrote:
> > > > @@ -23,6 +23,7 @@
> > > > #include <linux/clk.h>
> > > >
> > > > #include <asm/io.h>
> > > > +#include <linux/io.h>
> > >
> > > NAK - please include either linux/io.h _or_ asm/io.h but not both.
> > >
> > > > @@ -112,19 +113,10 @@ static int amba_kmi_probe(struct amba_device *dev,
> > > > {
> > > > struct amba_kmi_port *kmi;
> > > > struct serio *io;
> > > > - int ret;
> > > > -
> > > > - ret = amba_request_regions(dev, NULL);
> > > > - if (ret)
> > > > - return ret;
> > >
> > > I'm /really/ not happy about that going.
> >
> > Could you explain why? I looked at the code several times, and I couldn't
> > see how it was different than request_mem_region, which is merged into
> > devm_ioremap_resource.
>
> Check what gets used for the name of the resource.
>
> Now, consider that most devices when they are registered have their
> resource names set to the device name.
>
> Then realise that devm_ioremap_resource() uses the resource name or
> the device name again. So, what you end up with in /proc/iomem is
> a load of stupidity - you don't get to see there which drivers are
> making use of the resources, only a load of duplicated information
> about what devices are using the regions.
>
> This is contary to other bus types (like PCI) where the _device_ takes
> the non-busy parent resource, and the driver takes the busy resource
> using the _driver_ name, not the device name. The exception to this
> is network drivers which have in the past used the network device
> name.
>
> Here's an example. x86:
>
> fc000000-fc01ffff : 0000:00:19.0 <--- device name
> fc000000-fc01ffff : e1000e <--- driver name
> fc020000-fc023fff : 0000:00:1b.0 <--- device name
> fc020000-fc023fff : ICH HD audio <--- driver name
> fc024000-fc024fff : 0000:00:03.3
> fc025000-fc025fff : 0000:00:19.0 <--- device name
> fc025000-fc025fff : e1000e <--- driver name
> fc226000-fc2267ff : 0000:00:1f.2 <--- device name
> fc226000-fc2267ff : ahci <--- driver name
>
> etc. When using devm_ioremap_resource() this ends up as:
>
> 02184000-021841ff : /soc/aips-bus@02100000/usb@02184000
> 02184000-021841ff : /soc/aips-bus@02100000/usb@02184000
> 02184200-021843ff : /soc/aips-bus@02100000/usb@02184200
> 02184200-021843ff : /soc/aips-bus@02100000/usb@02184200
>
> which is really pointless duplicating the resource name like that. It
> conveys no additional useful information.
OK, thanks very much.
julia
prev parent reply other threads:[~2014-07-13 18:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-13 17:30 [PATCH] Input: ambakmi - Use managed interfaces Himangi Saraogi
2014-07-13 17:53 ` Russell King - ARM Linux
2014-07-13 18:11 ` Julia Lawall
2014-07-13 18:21 ` Russell King - ARM Linux
2014-07-13 18:29 ` Julia Lawall [this message]
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=alpine.DEB.2.02.1407132029080.2060@localhost6.localdomain6 \
--to=julia.lawall@lip6.fr \
--cc=dmitry.torokhov@gmail.com \
--cc=himangi774@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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