From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Paul Zimmerman <Paul.Zimmerman-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Cc: "balbi-l0cyMroinI0@public.gmane.org"
<balbi-l0cyMroinI0@public.gmane.org>,
"Ivan T. Ivanov"
<iivanov-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>,
"gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org"
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-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: Fri, 26 Jul 2013 23:32:26 +0300 [thread overview]
Message-ID: <20130726203226.GC14077@radagast> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E030458DE178C-Yu2iAY70zvrYN67daEjeMPufCSb+aD3WLzEdoUbNIic@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]
Hi,
On Fri, Jul 26, 2013 at 06:44:23PM +0000, Paul Zimmerman wrote:
> > From: Felipe Balbi [mailto:balbi-l0cyMroinI0@public.gmane.org]
> > Sent: Friday, July 26, 2013 2:54 AM
> > > > > Also, this is not *modifying* what was passed, just skipping the xHCI
> > > > > address space so we don't request_mem_region() an area we won't really
> > > > > handle and prevent xhci-hcd.ko from probing.
> > > >
> > > > Hmm? platform_get_resource() returns a pointer to an entry in the
> > > > platform_device's resource[] array. And "res->start +=" modifies the
> > > > entry pointed at. If it didn't, the bug fixed by this patch wouldn't
> > > > have happened.
> > > >
> > > > Are you sure this code will work OK if you build the driver as a module,
> > > > modprobe it, rmmod it, and then modprobe it again? Seems like it won't,
> > > > unless the dev->resource[] array gets reinitialized in between somehow.
> >
> > gotta try that one... Perhaps the correct way would be to copy the
> > resource to a private struct resource and modify that one, leaving
> > pdev->resources untouched.
>
> Maybe this is a dumb question, but why can't the driver that is going
> to use the resource after this just "know" that it has to add
> DWC3_GLOBALS_REGS_START to the start address? Are there some versions
> of the core where that is not the case?
that won't work, because dwc3.ko will already have request_mem_region()
the entire region and a subsequent request_mem_region() for xHCI space
only would fail.
> Or, maybe there should be two sets of resources?
maybe we should require two sets of resources, yes... but then there's
no point in having any host initialization whatsoever in dwc3.ko.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Cc: "balbi@ti.com" <balbi@ti.com>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: core: modify IO memory resource after deferred probe completes
Date: Fri, 26 Jul 2013 23:32:26 +0300 [thread overview]
Message-ID: <20130726203226.GC14077@radagast> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E030458DE178C@US01WEMBX2.internal.synopsys.com>
[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]
Hi,
On Fri, Jul 26, 2013 at 06:44:23PM +0000, Paul Zimmerman wrote:
> > From: Felipe Balbi [mailto:balbi@ti.com]
> > Sent: Friday, July 26, 2013 2:54 AM
> > > > > Also, this is not *modifying* what was passed, just skipping the xHCI
> > > > > address space so we don't request_mem_region() an area we won't really
> > > > > handle and prevent xhci-hcd.ko from probing.
> > > >
> > > > Hmm? platform_get_resource() returns a pointer to an entry in the
> > > > platform_device's resource[] array. And "res->start +=" modifies the
> > > > entry pointed at. If it didn't, the bug fixed by this patch wouldn't
> > > > have happened.
> > > >
> > > > Are you sure this code will work OK if you build the driver as a module,
> > > > modprobe it, rmmod it, and then modprobe it again? Seems like it won't,
> > > > unless the dev->resource[] array gets reinitialized in between somehow.
> >
> > gotta try that one... Perhaps the correct way would be to copy the
> > resource to a private struct resource and modify that one, leaving
> > pdev->resources untouched.
>
> Maybe this is a dumb question, but why can't the driver that is going
> to use the resource after this just "know" that it has to add
> DWC3_GLOBALS_REGS_START to the start address? Are there some versions
> of the core where that is not the case?
that won't work, because dwc3.ko will already have request_mem_region()
the entire region and a subsequent request_mem_region() for xHCI space
only would fail.
> Or, maybe there should be two sets of resources?
maybe we should require two sets of resources, yes... but then there's
no point in having any host initialization whatsoever in dwc3.ko.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-07-26 20:32 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
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 [this message]
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=20130726203226.GC14077@radagast \
--to=balbi-l0cymroini0@public.gmane.org \
--cc=Paul.Zimmerman-HKixBCOQz3hWk0Htik3J/w@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.