All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
@ 2015-04-21  7:11 Ivan T. Ivanov
  2015-04-21 11:16 ` Vivek Gautam
       [not found] ` <1429600263-4366-1-git-send-email-ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-21  7:11 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam

This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
devm_ioremap_resource instead of devm_ioremap"), because msm_otg
and this driver are using same address space to access AHB mode
and USB command registers.

Cc: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
 drivers/usb/host/ehci-msm.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 9db74ca..275c92e 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device *pdev)
 	}

 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hcd->regs = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(hcd->regs)) {
-		ret = PTR_ERR(hcd->regs);
+	if (!res) {
+		dev_err(&pdev->dev, "Unable to get memory resource\n");
+		ret = -ENODEV;
 		goto put_hcd;
 	}
+
 	hcd->rsrc_start = res->start;
 	hcd->rsrc_len = resource_size(res);
+	hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
+	if (!hcd->regs) {
+		dev_err(&pdev->dev, "ioremap failed\n");
+		ret = -ENOMEM;
+		goto put_hcd;
+	}

 	/*
 	 * OTG driver takes care of PHY initialization, clock management,
--
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
  2015-04-21  7:11 [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap" Ivan T. Ivanov
@ 2015-04-21 11:16 ` Vivek Gautam
  2015-04-21 11:18   ` Ivan T. Ivanov
       [not found] ` <1429600263-4366-1-git-send-email-ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Vivek Gautam @ 2015-04-21 11:16 UTC (permalink / raw)
  To: Ivan T. Ivanov, Alan Stern
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm

Hi,

On Tuesday, April 21, 2015 12:41 PM "Ivan T. Ivanov"
<ivan.ivanov@linaro.org> wrote:
> This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> and this driver are using same address space to access AHB mode
> and USB command registers.
>
> Cc: Vivek Gautam <gautam.vivek@samsung.com>

Since ehci-msm and msm_otg both want to control few USB registers,
it makes sense to request ioremap'ed region in both drivers.

Acked-by: Vivek Gautam <gautam.vivek@samsung.com>

I can see a patch in mailing list for adding both ehci-host and otg on msm 
[1].
But I think it has not yet made it to mainline kernel.

[1] [v3,04/11] ARM: dts: apq8064: Add USB OTG support
https://patches.linaro.org/47067/

> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---
> drivers/usb/host/ehci-msm.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
> index 9db74ca..275c92e 100644
> --- a/drivers/usb/host/ehci-msm.c
> +++ b/drivers/usb/host/ehci-msm.c
> @@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device
> *pdev)
>  }
>
>  res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> - if (IS_ERR(hcd->regs)) {
> - ret = PTR_ERR(hcd->regs);
> + if (!res) {
> + dev_err(&pdev->dev, "Unable to get memory resource\n");
> + ret = -ENODEV;
>  goto put_hcd;
>  }
> +
>  hcd->rsrc_start = res->start;
>  hcd->rsrc_len = resource_size(res);
> + hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
> + if (!hcd->regs) {
> + dev_err(&pdev->dev, "ioremap failed\n");
> + ret = -ENOMEM;
> + goto put_hcd;
> + }
>
>  /*
>  * OTG driver takes care of PHY initialization, clock management,
> --
> 1.9.1
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
  2015-04-21 11:16 ` Vivek Gautam
@ 2015-04-21 11:18   ` Ivan T. Ivanov
  0 siblings, 0 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-21 11:18 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Alan Stern, Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm


On Tue, 2015-04-21 at 16:46 +0530, Vivek Gautam wrote:
> Hi,
> 
> On Tuesday, April 21, 2015 12:41 PM "Ivan T. Ivanov"
> ivanov@linaro.org> wrote:
> > This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> > devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> > and this driver are using same address space to access AHB mode
> > and USB command registers.
> > 
> > Cc: Vivek Gautam vivek@samsung.com>
> 
> Since ehci-msm and msm_otg both want to control few USB registers,
> it makes sense to request ioremap'ed region in both drivers.
> 
> Acked-by: Vivek Gautam vivek@samsung.com>
> 
> I can see a patch in mailing list for adding both ehci-host and otg on msm
> [1].
> But I think it has not yet made it to mainline kernel.
> 
> [1] [v3,04/11] ARM: dts: apq8064: Add USB OTG support
> https://patches.linaro.org/47067/

Thanks. Ivan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
  2015-04-21  7:11 [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap" Ivan T. Ivanov
@ 2015-04-21 15:04     ` Alan Stern
       [not found] ` <1429600263-4366-1-git-send-email-ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Alan Stern @ 2015-04-21 15:04 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Vivek Gautam

On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:

> This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> and this driver are using same address space to access AHB mode
> and USB command registers.

Um, this patch is in fact _not_ a reversion of 70843f623b58.  That
commit removed 4 lines of code and added 3.  If this were truly a
reversion, it would remove 3 lines and add 4.  Instead it adds 10.

Please make this a true reversion.

Alan Stern

> Cc: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  drivers/usb/host/ehci-msm.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
> index 9db74ca..275c92e 100644
> --- a/drivers/usb/host/ehci-msm.c
> +++ b/drivers/usb/host/ehci-msm.c
> @@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device *pdev)
>  	}
> 
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(hcd->regs)) {
> -		ret = PTR_ERR(hcd->regs);
> +	if (!res) {
> +		dev_err(&pdev->dev, "Unable to get memory resource\n");
> +		ret = -ENODEV;
>  		goto put_hcd;
>  	}
> +
>  	hcd->rsrc_start = res->start;
>  	hcd->rsrc_len = resource_size(res);
> +	hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
> +	if (!hcd->regs) {
> +		dev_err(&pdev->dev, "ioremap failed\n");
> +		ret = -ENOMEM;
> +		goto put_hcd;
> +	}
> 
>  	/*
>  	 * OTG driver takes care of PHY initialization, clock management,
> --
> 1.9.1
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
@ 2015-04-21 15:04     ` Alan Stern
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Stern @ 2015-04-21 15:04 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam

On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:

> This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> and this driver are using same address space to access AHB mode
> and USB command registers.

Um, this patch is in fact _not_ a reversion of 70843f623b58.  That
commit removed 4 lines of code and added 3.  If this were truly a
reversion, it would remove 3 lines and add 4.  Instead it adds 10.

Please make this a true reversion.

Alan Stern

> Cc: Vivek Gautam <gautam.vivek@samsung.com>
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---
>  drivers/usb/host/ehci-msm.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
> index 9db74ca..275c92e 100644
> --- a/drivers/usb/host/ehci-msm.c
> +++ b/drivers/usb/host/ehci-msm.c
> @@ -88,13 +88,20 @@ static int ehci_msm_probe(struct platform_device *pdev)
>  	}
> 
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(hcd->regs)) {
> -		ret = PTR_ERR(hcd->regs);
> +	if (!res) {
> +		dev_err(&pdev->dev, "Unable to get memory resource\n");
> +		ret = -ENODEV;
>  		goto put_hcd;
>  	}
> +
>  	hcd->rsrc_start = res->start;
>  	hcd->rsrc_len = resource_size(res);
> +	hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
> +	if (!hcd->regs) {
> +		dev_err(&pdev->dev, "ioremap failed\n");
> +		ret = -ENOMEM;
> +		goto put_hcd;
> +	}
> 
>  	/*
>  	 * OTG driver takes care of PHY initialization, clock management,
> --
> 1.9.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
  2015-04-21 15:04     ` Alan Stern
@ 2015-04-21 15:57         ` Ivan T. Ivanov
  -1 siblings, 0 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-21 15:57 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Vivek Gautam


On Tue, 2015-04-21 at 11:04 -0400, Alan Stern wrote:
> On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:
> 
> > This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> > devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> > and this driver are using same address space to access AHB mode
> > and USB command registers.
> 
> Um, this patch is in fact _not_ a reversion of 70843f623b58.  That
> commit removed 4 lines of code and added 3.  If this were truly a
> reversion, it would remove 3 lines and add 4.  Instead it adds 10.
> 
> Please make this a true reversion.

Right, but I will have to revert 2 commits then, is this ok?

Ivan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
@ 2015-04-21 15:57         ` Ivan T. Ivanov
  0 siblings, 0 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-21 15:57 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam


On Tue, 2015-04-21 at 11:04 -0400, Alan Stern wrote:
> On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:
> 
> > This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> > devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> > and this driver are using same address space to access AHB mode
> > and USB command registers.
> 
> Um, this patch is in fact _not_ a reversion of 70843f623b58.  That
> commit removed 4 lines of code and added 3.  If this were truly a
> reversion, it would remove 3 lines and add 4.  Instead it adds 10.
> 
> Please make this a true reversion.

Right, but I will have to revert 2 commits then, is this ok?

Ivan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
  2015-04-21 15:57         ` Ivan T. Ivanov
@ 2015-04-21 16:56           ` Alan Stern
  -1 siblings, 0 replies; 9+ messages in thread
From: Alan Stern @ 2015-04-21 16:56 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam

On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:

> 
> On Tue, 2015-04-21 at 11:04 -0400, Alan Stern wrote:
> > On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:
> > 
> > > This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> > > devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> > > and this driver are using same address space to access AHB mode
> > > and USB command registers.
> > 
> > Um, this patch is in fact _not_ a reversion of 70843f623b58.  That
> > commit removed 4 lines of code and added 3.  If this were truly a
> > reversion, it would remove 3 lines and add 4.  Instead it adds 10.
> > 
> > Please make this a true reversion.
> 
> Right, but I will have to revert 2 commits then, is this ok?

Yes, that's okay.  I hadn't noticed that e507bf577e5a touched the same 
code.  Just mention them both in the patch description.

Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap"
@ 2015-04-21 16:56           ` Alan Stern
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Stern @ 2015-04-21 16:56 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-arm-msm, Vivek Gautam

On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:

> 
> On Tue, 2015-04-21 at 11:04 -0400, Alan Stern wrote:
> > On Tue, 21 Apr 2015, Ivan T. Ivanov wrote:
> > 
> > > This reverts commit 70843f623b58 ("usb: host: ehci-msm: Use
> > > devm_ioremap_resource instead of devm_ioremap"), because msm_otg
> > > and this driver are using same address space to access AHB mode
> > > and USB command registers.
> > 
> > Um, this patch is in fact _not_ a reversion of 70843f623b58.  That
> > commit removed 4 lines of code and added 3.  If this were truly a
> > reversion, it would remove 3 lines and add 4.  Instead it adds 10.
> > 
> > Please make this a true reversion.
> 
> Right, but I will have to revert 2 commits then, is this ok?

Yes, that's okay.  I hadn't noticed that e507bf577e5a touched the same 
code.  Just mention them both in the patch description.

Alan Stern


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-04-21 16:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21  7:11 [PATCH] Revert "usb: host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap" Ivan T. Ivanov
2015-04-21 11:16 ` Vivek Gautam
2015-04-21 11:18   ` Ivan T. Ivanov
     [not found] ` <1429600263-4366-1-git-send-email-ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-04-21 15:04   ` Alan Stern
2015-04-21 15:04     ` Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.1504211052110.1518-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2015-04-21 15:57       ` Ivan T. Ivanov
2015-04-21 15:57         ` Ivan T. Ivanov
2015-04-21 16:56         ` Alan Stern
2015-04-21 16:56           ` Alan Stern

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.