All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
To: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
Cc: balbi-l0cyMroinI0@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] usb: dwc3: core: modify IO memory resource after deferred probe completes
Date: Thu, 25 Jul 2013 21:21:09 +0400	[thread overview]
Message-ID: <51F15E85.1050808@cogentembedded.com> (raw)
In-Reply-To: <1374769590-14491-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>

On 07/25/2013 08:26 PM, Ivan T. Ivanov wrote:

> From: "Ivan T. Ivanov" <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>

> When deferred probe happens driver will try to ioremap multiple times
> and will fail. Memory resource.start variable is a global variable,
> modifications in this field will be accumulated on every probe.
> Fix this by moving the above operations after driver hold all
> required PHY's.

> Signed-off-by: Ivan T. Ivanov <iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
> ---
>   drivers/usb/dwc3/core.c |   31 ++++++++++++++++---------------
>   1 file changed, 16 insertions(+), 15 deletions(-)

> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 607bef8..50c833f 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
[...]
> @@ -452,6 +437,22 @@ static int dwc3_probe(struct platform_device *pdev)
>   		return -EPROBE_DEFER;
>   	}
>
> +	dwc->xhci_resources[0].start = res->start;
> +	dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
> +					DWC3_XHCI_REGS_END;
> +	dwc->xhci_resources[0].flags = res->flags;
> +	dwc->xhci_resources[0].name = res->name;
> +
> +	res->start += DWC3_GLOBALS_REGS_START;
> +
> +	 /*
> +	  * Request memory region but exclude xHCI regs,
> +	  * since it will be requested by the xhci-plat driver.
> +	  */

     Please remove an extra space after a tab on each comment line.
It seems like a good time to do it, while you're moving this code.

> +	regs = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
> +

WBR, Sergei

--
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

WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: balbi@ti.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: core: modify IO memory resource after deferred probe completes
Date: Thu, 25 Jul 2013 21:21:09 +0400	[thread overview]
Message-ID: <51F15E85.1050808@cogentembedded.com> (raw)
In-Reply-To: <1374769590-14491-1-git-send-email-iivanov@mm-sol.com>

On 07/25/2013 08:26 PM, Ivan T. Ivanov wrote:

> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>

> When deferred probe happens driver will try to ioremap multiple times
> and will fail. Memory resource.start variable is a global variable,
> modifications in this field will be accumulated on every probe.
> Fix this by moving the above operations after driver hold all
> required PHY's.

> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
> ---
>   drivers/usb/dwc3/core.c |   31 ++++++++++++++++---------------
>   1 file changed, 16 insertions(+), 15 deletions(-)

> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 607bef8..50c833f 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
[...]
> @@ -452,6 +437,22 @@ static int dwc3_probe(struct platform_device *pdev)
>   		return -EPROBE_DEFER;
>   	}
>
> +	dwc->xhci_resources[0].start = res->start;
> +	dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
> +					DWC3_XHCI_REGS_END;
> +	dwc->xhci_resources[0].flags = res->flags;
> +	dwc->xhci_resources[0].name = res->name;
> +
> +	res->start += DWC3_GLOBALS_REGS_START;
> +
> +	 /*
> +	  * Request memory region but exclude xHCI regs,
> +	  * since it will be requested by the xhci-plat driver.
> +	  */

     Please remove an extra space after a tab on each comment line.
It seems like a good time to do it, while you're moving this code.

> +	regs = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(regs))
> +		return PTR_ERR(regs);
> +

WBR, Sergei


  parent reply	other threads:[~2013-07-25 17:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 16:26 [PATCH] usb: dwc3: core: modify IO memory resource after deferred probe completes Ivan T. Ivanov
2013-07-25 16:26 ` Ivan T. Ivanov
     [not found] ` <1374769590-14491-1-git-send-email-iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2013-07-25 17:21   ` Sergei Shtylyov [this message]
2013-07-25 17:21     ` Sergei Shtylyov
2013-07-25 18:20     ` Ivan T. Ivanov
2013-07-25 19:46   ` Paul Zimmerman
2013-07-25 19:46     ` Paul Zimmerman
2013-07-25 20:52     ` Felipe Balbi
2013-07-26  2:06       ` Paul Zimmerman
2013-07-26  2:06         ` Paul Zimmerman
     [not found]         ` <A2CA0424C0A6F04399FB9E1CD98E030458DE12C9-Yu2iAY70zvrYN67daEjeMPufCSb+aD3WLzEdoUbNIic@public.gmane.org>
2013-07-26  6:48           ` Ivan T. Ivanov
2013-07-26  6:48             ` Ivan T. Ivanov
2013-07-26  9:53             ` Felipe Balbi
2013-07-26 18:44               ` Paul Zimmerman
2013-07-26 18:44                 ` Paul Zimmerman
     [not found]                 ` <A2CA0424C0A6F04399FB9E1CD98E030458DE178C-Yu2iAY70zvrYN67daEjeMPufCSb+aD3WLzEdoUbNIic@public.gmane.org>
2013-07-26 20:32                   ` Felipe Balbi
2013-07-26 20:32                     ` Felipe Balbi
2013-07-26 22:02                     ` Paul Zimmerman
2013-07-26 22:02                       ` Paul Zimmerman

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=51F15E85.1050808@cogentembedded.com \
    --to=sergei.shtylyov-m4dtvfq/zs1mrggop+s0pdbpr1lh4cv8@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.