Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756256AbbDOP6M (ORCPT ); Wed, 15 Apr 2015 11:58:12 -0400 Received: from mail-yk0-f176.google.com ([209.85.160.176]:35524 "EHLO mail-yk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896AbbDOP6E (ORCPT ); Wed, 15 Apr 2015 11:58:04 -0400 MIME-Version: 1.0 In-Reply-To: References: <1428568436-9134-1-git-send-email-ivan.ivanov@linaro.org> Date: Wed, 15 Apr 2015 21:28:04 +0530 Message-ID: Subject: Re: [PATCH] usb: ehci-msm: Don't ioremap configuration space exclusively From: Vivek Gautam To: Alan Stern Cc: "Ivan T. Ivanov" , Vivek Gautam , Greg Kroah-Hartman , USB list , Kernel development list , linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2590 Lines: 81 On Thu, Apr 9, 2015 at 8:19 PM, Alan Stern 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 ? Will ehci controller registers overlap with the Device controller's register region ? > > You really should CC the person who wrote the code you are changing. > This is almost exactly the same as reverting commit 70843f623b58 (usb: > host: ehci-msm: Use devm_ioremap_resource instead of devm_ioremap). > > Vivek, what do you think? Yea, the idea was to prevent any unintentional overlapping of ioremapped regions by two device drivers. I still believe that the register region used by ehci-msm may not be overlapping with the device-controller's register memory region. > > Alan Stern > >> Signed-off-by: Ivan T. Ivanov >> --- >> drivers/usb/host/ehci-msm.c | 10 +++++++--- >> 1 file changed, 7 insertions(+), 3 deletions(-) >> >> 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, >> -- >> 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/ -- Best Regards Vivek Gautam Samsung R&D Institute, Bangalore India -- 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/