From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] irq/mbigen:Fix the problem of IO remap for duplicated physical address in mbigen driver
Date: Mon, 1 Feb 2016 11:57:18 +0000 [thread overview]
Message-ID: <20160201115717.GD674@leverpostej> (raw)
In-Reply-To: <1454327094-7848-1-git-send-email-majun258@huawei.com>
On Mon, Feb 01, 2016 at 07:44:54PM +0800, MaJun wrote:
> From: Ma Jun <majun258@huawei.com>
>
> For mbigen module, there is a special case that more than one mbigen
> device nodes use the same reg definition in DTS when these devices
> exist in the same mbigen hardware module.
>
> mbigen_dev1:intc_dev1 {
> ...
> reg = <0x0 0xc0080000 0x0 0x10000>;
> ...
> };
>
> mbigen_dev2:intc_dev2 {
> ...
> reg = <0x0 0xc0080000 0x0 0x10000>;
> ...
> };
This doesn't sound right. If they exist in the same place, and have the
same reg, they _are_ the same device.
You'll need to explain this better.
> On this case, devm_ioremap_resource() returns fail with info
> "can't request region for resource" because of memory region check.
>
> Because we only need to program 1 into corresponding bit into status
> register of mbigen to clear the interrupt status during runtime,
> I think we can replace devm_ioremap_resource() by devm_ioremap().
>
> Signed-off-by: Ma Jun <majun258@huawei.com>
> ---
> drivers/irqchip/irq-mbigen.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c
> index 4dd3eb8..b19e528 100644
> --- a/drivers/irqchip/irq-mbigen.c
> +++ b/drivers/irqchip/irq-mbigen.c
> @@ -250,7 +250,7 @@ static int mbigen_device_probe(struct platform_device *pdev)
> mgn_chip->pdev = pdev;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - mgn_chip->base = devm_ioremap_resource(&pdev->dev, res);
> + mgn_chip->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
These two behaving differently doesn't seem correct either...
Mark.
> if (IS_ERR(mgn_chip->base))
> return PTR_ERR(mgn_chip->base);
>
> --
> 1.7.1
>
>
next prev parent reply other threads:[~2016-02-01 11:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-01 11:44 [RFC PATCH] irq/mbigen:Fix the problem of IO remap for duplicated physical address in mbigen driver MaJun
2016-02-01 11:57 ` Mark Rutland [this message]
2016-02-01 13:06 ` majun (F)
2016-02-01 13:25 ` Mark Rutland
2016-02-02 10:25 ` majun (F)
2016-02-02 11:43 ` Mark Rutland
2016-02-03 2:31 ` majun (F)
2016-02-03 11:16 ` Mark Rutland
2016-02-16 7:54 ` majun (F)
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=20160201115717.GD674@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).