From: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: York Sun <yorksun-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: Julia.Lawall-L2FTfq7BK8M@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Need some guidance on i2c-ocores driver
Date: Tue, 21 Apr 2015 08:35:34 +0100 [thread overview]
Message-ID: <20150421073534.GK3447@x1> (raw)
In-Reply-To: <5535460B.2060309-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> >> mfd_add_devices() is called, it uses &dev->resource as the base. So the BAR will
> >> be the parent. Check the code in mfd-core.c, mfd_add_device(),
> >>
> >> if ((cell->resources[r].flags & IORESOURCE_MEM) && mem_base) {
> >> res[r].parent = mem_base;
> >> res[r].start = mem_base->start + cell->resources[r].start;
> >> res[r].end = mem_base->start + cell->resources[r].end;
> >> }
> >>
> >> So the MFD resource is within its parent. When later the device driver request a
> >> region, will it get conflict with the parent?
> >
> > I doubt you'll want to map the same memory area in both the parent and
> > the child device drivers. Only map the registers you plan to use in
> > the driver you plan to use them. If you need multiple devices to
> > access the same registers then you need to create an API, complete
> > with locking, in the MFD parent device.
>
> Thanks for pointing out. I thought at first the conflict was due to my
> pci_ioremap_bar(). I went ahead to remove the mapping but still not working.
> Your email inspired me to take a deeper look at my code and I found my error. I
> have called pci_request_regions() which reserves all BARs. I think that's my
> root cause. Thanks for helping me.
You are welcome.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2015-04-21 7:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 0:02 Need some guidance on i2c-ocores driver York Sun
[not found] ` <55304D8E.8070204-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-04-17 15:47 ` York Sun
[not found] ` <55312AF7.7070504-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-04-20 6:42 ` Lee Jones
2015-04-20 16:24 ` York Sun
2015-04-20 18:16 ` Lee Jones
2015-04-20 18:31 ` York Sun
[not found] ` <5535460B.2060309-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-04-21 7:35 ` Lee Jones [this message]
2015-05-06 21:41 ` Why isn't IRQ shared for i2c-ocore York Sun
2015-05-07 7:01 ` Lee Jones
2015-05-07 14:46 ` York Sun
2015-05-08 6:47 ` Geert Uytterhoeven
[not found] ` <CAMuHMdWXFmPWsL4QyjwV+X-mruS0pU2Uzj7aSSxTQDJ=K+32XA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-08 6:57 ` Lee Jones
2015-05-08 7:07 ` Geert Uytterhoeven
2015-05-08 7:27 ` Lee Jones
2015-05-08 8:03 ` Geert Uytterhoeven
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=20150421073534.GK3447@x1 \
--to=lee.jones-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=Julia.Lawall-L2FTfq7BK8M@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wolfram-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
--cc=yorksun-KZfg59tc24xl57MIdRCFDg@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).