* [PATCH] Revert "usb: musb: convert to devm_platform_ioremap_resource_byname"
@ 2020-11-12 13:59 Geert Uytterhoeven
2020-11-13 13:31 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-11-12 13:59 UTC (permalink / raw)
To: Chunfeng Yun, Bin Liu, Greg Kroah-Hartman
Cc: Drew Fustini, linux-usb, linux-kernel, Geert Uytterhoeven
This reverts commit 2d30e408a2a6b3443d3232593e3d472584a3e9f8.
On Beaglebone Black, where each interface has 2 children:
musb-dsps 47401c00.usb: can't request region for resource [mem 0x47401800-0x474019ff]
musb-hdrc musb-hdrc.1: musb_init_controller failed with status -16
musb-hdrc: probe of musb-hdrc.1 failed with error -16
musb-dsps 47401400.usb: can't request region for resource [mem 0x47401000-0x474011ff]
musb-hdrc musb-hdrc.0: musb_init_controller failed with status -16
musb-hdrc: probe of musb-hdrc.0 failed with error -16
Before, devm_ioremap_resource() was called on "dev" ("musb-hdrc.0" or
"musb-hdrc.1"), after it is called on "&pdev->dev" ("47401400.usb" or
"47401c00.usb"), leading to a duplicate region request, which fails.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/usb/musb/musb_dsps.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 30085b2be7b90bf1..5892f3ce0cdc824d 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -429,10 +429,12 @@ static int dsps_musb_init(struct musb *musb)
struct platform_device *parent = to_platform_device(dev->parent);
const struct dsps_musb_wrapper *wrp = glue->wrp;
void __iomem *reg_base;
+ struct resource *r;
u32 rev, val;
int ret;
- reg_base = devm_platform_ioremap_resource_byname(parent, "control");
+ r = platform_get_resource_byname(parent, IORESOURCE_MEM, "control");
+ reg_base = devm_ioremap_resource(dev, r);
if (IS_ERR(reg_base))
return PTR_ERR(reg_base);
musb->ctrl_base = reg_base;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Revert "usb: musb: convert to devm_platform_ioremap_resource_byname"
2020-11-12 13:59 [PATCH] Revert "usb: musb: convert to devm_platform_ioremap_resource_byname" Geert Uytterhoeven
@ 2020-11-13 13:31 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2020-11-13 13:31 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Chunfeng Yun, Bin Liu, Drew Fustini, linux-usb, linux-kernel
On Thu, Nov 12, 2020 at 02:59:00PM +0100, Geert Uytterhoeven wrote:
> This reverts commit 2d30e408a2a6b3443d3232593e3d472584a3e9f8.
>
> On Beaglebone Black, where each interface has 2 children:
>
> musb-dsps 47401c00.usb: can't request region for resource [mem 0x47401800-0x474019ff]
> musb-hdrc musb-hdrc.1: musb_init_controller failed with status -16
> musb-hdrc: probe of musb-hdrc.1 failed with error -16
> musb-dsps 47401400.usb: can't request region for resource [mem 0x47401000-0x474011ff]
> musb-hdrc musb-hdrc.0: musb_init_controller failed with status -16
> musb-hdrc: probe of musb-hdrc.0 failed with error -16
>
> Before, devm_ioremap_resource() was called on "dev" ("musb-hdrc.0" or
> "musb-hdrc.1"), after it is called on "&pdev->dev" ("47401400.usb" or
> "47401c00.usb"), leading to a duplicate region request, which fails.
>
Thanks for this, I'll go queue it up now.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-13 13:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 13:59 [PATCH] Revert "usb: musb: convert to devm_platform_ioremap_resource_byname" Geert Uytterhoeven
2020-11-13 13:31 ` Greg Kroah-Hartman
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).