diff mbox

usb: ehci-msm: Don't ioremap configuration space exclusively

Message ID 1428568436-9134-1-git-send-email-ivan.ivanov@linaro.org
State New
Headers show

Commit Message

Ivan T. Ivanov April 9, 2015, 8:33 a.m. UTC
This allow same IO space to be shared between HCD and Device
controller driver. Which can be loaded simultaneously and
started/stopped on demand by USB OTG PHY driver.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
 drivers/usb/host/ehci-msm.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Ivan T. Ivanov April 16, 2015, 7:42 a.m. UTC | #1
Hi,

On Wed, 2015-04-15 at 21:28 +0530, Vivek Gautam wrote:
> On Thu, Apr 9, 2015 at 8:19 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Thu, 9 Apr 2015, Ivan T. Ivanov wrote:
> > 
> > > This allow same IO space to be shared between HCD and Device
> > > controller driver. Which can be loaded simultaneously and
> > > started/stopped on demand by USB OTG PHY driver.
> 
> Are you sure ?

No.

> Will ehci controller registers overlap with the Device controller's register
> region ?
> 

Well, not exactly DC vs HC region, but at least USB_AHBBURST, USB_AHBMODE,
USB_USBMODE are used by both OTG phy-msm-usb and this ehci-msm driver. 
And this is broken right now. 

Ivan

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ivan T. Ivanov April 20, 2015, 8:18 a.m. UTC | #2
On Thu, 2015-04-16 at 10:42 +0300, Ivan T. Ivanov wrote:
> Hi,
> 
> On Wed, 2015-04-15 at 21:28 +0530, Vivek Gautam wrote:
> > On Thu, Apr 9, 2015 at 8:19 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > > On Thu, 9 Apr 2015, Ivan T. Ivanov wrote:
> > > 
> > > > This allow same IO space to be shared between HCD and Device
> > > > controller driver. Which can be loaded simultaneously and
> > > > started/stopped on demand by USB OTG PHY driver.
> > 
> > Are you sure ?
> 
> No.
> 
> > Will ehci controller registers overlap with the Device controller's register
> > region ?
> > 
> 
> Well, not exactly DC vs HC region, but at least USB_AHBBURST, USB_AHBMODE,
> USB_USBMODE are used by both OTG phy-msm-usb and this ehci-msm driver.
> And this is broken right now.

Hi Alan, 

Perhaps I have to resend this patch with updated commit
message? Are they any other obstacles? 

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

Patch

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 9db74ca..f059e15 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -88,13 +88,17 @@  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 (!res)
+		return -ENODEV;
+
+	hcd->rsrc_start = res->start;
+	hcd->rsrc_len = resource_size(res);
+
+	hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len);
 	if (IS_ERR(hcd->regs)) {
 		ret = PTR_ERR(hcd->regs);
 		goto put_hcd;
 	}
-	hcd->rsrc_start = res->start;
-	hcd->rsrc_len = resource_size(res);

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