From: Pavel Roskin <plroskin@gmail.com>
To: linux-mm@kvack.org
Subject: devm_ioremap_resource() creates duplicate resource
Date: Thu, 20 Apr 2017 18:55:22 -0700 [thread overview]
Message-ID: <CAN_72e0_725VFdq_h6bMUuBkSUi7EMnu=r6mLLzcauOyG1BS=w@mail.gmail.com> (raw)
Hello!
I'm writing a device driver for a subdevice of a PCIe multifunctional
device. It's a platform device that has its resources described in the
top-level driver for the multifuctional device.
I followed the common pattern when a memory resource is obtained by
calling platform_get_resource() and then reserved and remapped by
calling devm_ioremap_resource().
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
The problem with that approach is that the resource appears twice in
/proc/iomem:
fdc60000-fdc6000f : My Dev
fdc60000-fdc6000f : My Dev
I see that devm_ioremap_resource() takes the start address and the
size of the existing resource and reserves the region at the same
address.
Some drivers (e.g. drivers/mfd/db8500-prcmu.c) use devm_ioremap()
instead. But my concern is that the resource is not marked as busy in
that case.
Which approach is preferred? If there a good way to mark an existing
resource as busy (short of direct flag manipulation)? Would it make
sense to have an API to reserve an existing resource?
--
Regards,
Pavel Roskin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2017-04-21 1:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAN_72e0_725VFdq_h6bMUuBkSUi7EMnu=r6mLLzcauOyG1BS=w@mail.gmail.com' \
--to=plroskin@gmail.com \
--cc=linux-mm@kvack.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