From: Anatolij Gustschin <agust@denx.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] powerpc/5200: Fix size to request_mem_region() call
Date: Tue, 22 Jan 2013 22:10:49 +0100 [thread overview]
Message-ID: <20130122221049.0bc73953@crub> (raw)
In-Reply-To: <1358473200-17886-1-git-send-email-grant.likely@secretlab.ca>
Hi Grant,
On Fri, 18 Jan 2013 01:39:59 +0000
Grant Likely <grant.likely@secretlab.ca> wrote:
> The Bestcomm driver requests a memory region larger than the one
> described in the device tree. This is due to an extra undocumented field
> in the bestcomm register structure. This hasn't been a problem up to
> now, but there is a patch pending to make the DT platform_bus support
> code use platform_device_add() which tightens the rules and provides
> extra checks for drivers to stay within the specified register regions.
>
> Alternately, I could have removed the extra field from the structure,
> but I'm not sure if it is still needed for resume to work. Better be
> safe and leave it in.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
> arch/powerpc/sysdev/bestcomm/bestcomm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
There is a patch moving this driver to drivers/dma,
http://patchwork.ozlabs.org/patch/191153/
I've applied it to my 5xxx next branch.
> diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c
> index d913063..81c3314 100644
> --- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
> +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
> @@ -414,7 +414,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op)
> goto error_sramclean;
> }
>
> - if (!request_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma),
> + if (!request_mem_region(res_bcom.start, resource_size(&res_bcom),
> DRIVER_NAME)) {
> printk(KERN_ERR DRIVER_NAME ": "
> "Can't request registers region\n");
similar change is needed for release_mem_region() in error path
and in driver's remove() function.
Thanks,
Anatolij
WARNING: multiple messages have this Message-ID (diff)
From: Anatolij Gustschin <agust@denx.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [PATCH 1/2] powerpc/5200: Fix size to request_mem_region() call
Date: Tue, 22 Jan 2013 22:10:49 +0100 [thread overview]
Message-ID: <20130122221049.0bc73953@crub> (raw)
In-Reply-To: <1358473200-17886-1-git-send-email-grant.likely@secretlab.ca>
Hi Grant,
On Fri, 18 Jan 2013 01:39:59 +0000
Grant Likely <grant.likely@secretlab.ca> wrote:
> The Bestcomm driver requests a memory region larger than the one
> described in the device tree. This is due to an extra undocumented field
> in the bestcomm register structure. This hasn't been a problem up to
> now, but there is a patch pending to make the DT platform_bus support
> code use platform_device_add() which tightens the rules and provides
> extra checks for drivers to stay within the specified register regions.
>
> Alternately, I could have removed the extra field from the structure,
> but I'm not sure if it is still needed for resume to work. Better be
> safe and leave it in.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
> arch/powerpc/sysdev/bestcomm/bestcomm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
There is a patch moving this driver to drivers/dma,
http://patchwork.ozlabs.org/patch/191153/
I've applied it to my 5xxx next branch.
> diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c
> index d913063..81c3314 100644
> --- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
> +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
> @@ -414,7 +414,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op)
> goto error_sramclean;
> }
>
> - if (!request_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma),
> + if (!request_mem_region(res_bcom.start, resource_size(&res_bcom),
> DRIVER_NAME)) {
> printk(KERN_ERR DRIVER_NAME ": "
> "Can't request registers region\n");
similar change is needed for release_mem_region() in error path
and in driver's remove() function.
Thanks,
Anatolij
next prev parent reply other threads:[~2013-01-22 21:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 1:39 [PATCH 1/2] powerpc/5200: Fix size to request_mem_region() call Grant Likely
2013-01-18 1:39 ` Grant Likely
2013-01-18 1:40 ` [PATCH 2/2] of: use platform_device_add Grant Likely
2013-01-18 1:40 ` Grant Likely
2013-02-17 3:03 ` Shawn Guo
2013-02-17 3:03 ` Shawn Guo
2013-02-17 3:03 ` Shawn Guo
2013-02-17 7:43 ` Shawn Guo
2013-02-17 7:43 ` Shawn Guo
2013-02-17 7:43 ` Shawn Guo
2013-02-17 10:19 ` Russell King - ARM Linux
2013-02-17 10:19 ` Russell King - ARM Linux
2013-02-17 10:19 ` Russell King - ARM Linux
2013-02-17 10:49 ` Grant Likely
2013-02-17 10:49 ` Grant Likely
2013-02-17 10:49 ` Grant Likely
2013-02-19 19:03 ` Jason Gunthorpe
2013-02-19 19:03 ` Jason Gunthorpe
2013-02-19 19:03 ` Jason Gunthorpe
2013-02-17 13:18 ` Fabio Estevam
2013-02-17 13:18 ` Fabio Estevam
2013-02-17 13:18 ` Fabio Estevam
2013-01-22 21:10 ` Anatolij Gustschin [this message]
2013-01-22 21:10 ` [PATCH 1/2] powerpc/5200: Fix size to request_mem_region() call Anatolij Gustschin
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=20130122221049.0bc73953@crub \
--to=agust@denx.de \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.