* __check_region in ide code?
@ 2003-06-06 7:34 Rusty Russell
2003-06-06 8:56 ` Bartlomiej Zolnierkiewicz
2003-06-06 11:31 ` William Lee Irwin III
0 siblings, 2 replies; 5+ messages in thread
From: Rusty Russell @ 2003-06-06 7:34 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel
Hi Bart,
I notice that drivers/ide/ide-probe.c's hwif_check_region()
still uses check_region(). If it really does want to use it to probe
and not reserve, I think we should stop it warning there.
There's nothing inherently *wrong* with check_region, it's
just deprecated to trap the old (now racy) idiom of "if
(check_region(xx)) reserve_region(xx)". There's no reason not to
introduce a probe_region if IDE really wants it.
Of course, some people will start "fixing" drivers by
s/check_region/probe_region/ when we do this, but that's the risk we
take.
It should also allow us to easily get rid of that stupid warning in
ksyms.c...
Thoughts?
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __check_region in ide code?
2003-06-06 7:34 __check_region in ide code? Rusty Russell
@ 2003-06-06 8:56 ` Bartlomiej Zolnierkiewicz
2003-06-06 15:23 ` Alan Cox
2003-06-06 11:31 ` William Lee Irwin III
1 sibling, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-06-06 8:56 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel
On Fri, 6 Jun 2003, Rusty Russell wrote:
> Hi Bart,
Hi Rusty,
> I notice that drivers/ide/ide-probe.c's hwif_check_region()
> still uses check_region(). If it really does want to use it to probe
> and not reserve, I think we should stop it warning there.
>
> There's nothing inherently *wrong* with check_region, it's
> just deprecated to trap the old (now racy) idiom of "if
> (check_region(xx)) reserve_region(xx)". There's no reason not to
> introduce a probe_region if IDE really wants it.
And ide-probe.c does exactly this racy stuff.
I did patch to convert it to request_region() some time ago,
I just need to double check it and submit.
Thanks,
--
Bartlomiej
> Of course, some people will start "fixing" drivers by
> s/check_region/probe_region/ when we do this, but that's the risk we
> take.
>
> It should also allow us to easily get rid of that stupid warning in
> ksyms.c...
>
> Thoughts?
> Rusty.
> --
> Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __check_region in ide code?
2003-06-06 7:34 __check_region in ide code? Rusty Russell
2003-06-06 8:56 ` Bartlomiej Zolnierkiewicz
@ 2003-06-06 11:31 ` William Lee Irwin III
1 sibling, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2003-06-06 11:31 UTC (permalink / raw)
To: Rusty Russell; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
On Fri, Jun 06, 2003 at 05:34:24PM +1000, Rusty Russell wrote:
> I notice that drivers/ide/ide-probe.c's hwif_check_region()
> still uses check_region(). If it really does want to use it to probe
> and not reserve, I think we should stop it warning there.
> There's nothing inherently *wrong* with check_region, it's
> just deprecated to trap the old (now racy) idiom of "if
> (check_region(xx)) reserve_region(xx)". There's no reason not to
> introduce a probe_region if IDE really wants it.
> Of course, some people will start "fixing" drivers by
> s/check_region/probe_region/ when we do this, but that's the risk we
> take.
> It should also allow us to easily get rid of that stupid warning in
> ksyms.c...
I've actually seen IDE oops doing a racy check_region()/request_region()
on 2.4.x-test*. Either the fix I brewed up never hit mainline or there's
more than the one I hit.
-- wli
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __check_region in ide code?
2003-06-06 8:56 ` Bartlomiej Zolnierkiewicz
@ 2003-06-06 15:23 ` Alan Cox
2003-06-06 16:09 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2003-06-06 15:23 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Rusty Russell, Linux Kernel Mailing List
On Gwe, 2003-06-06 at 09:56, Bartlomiej Zolnierkiewicz wrote:
> > There's nothing inherently *wrong* with check_region, it's
> > just deprecated to trap the old (now racy) idiom of "if
> > (check_region(xx)) reserve_region(xx)". There's no reason not to
> > introduce a probe_region if IDE really wants it.
>
> And ide-probe.c does exactly this racy stuff.
>
> I did patch to convert it to request_region() some time ago,
> I just need to double check it and submit.
request_region at that point doesn't actually help you. For PIO devices
its too late if you are handling PCMCIA, for PCI devices its too late
because you want to own the PCI device properly, for MMIO its completely
broken (all the mem region stuff in 2.5)
The only way I can see to fix it properly is to provide ide helpers
for resource allocation that are used by the drivers when needed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __check_region in ide code?
2003-06-06 15:23 ` Alan Cox
@ 2003-06-06 16:09 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-06-06 16:09 UTC (permalink / raw)
To: Alan Cox; +Cc: Rusty Russell, Linux Kernel Mailing List
On 6 Jun 2003, Alan Cox wrote:
> On Gwe, 2003-06-06 at 09:56, Bartlomiej Zolnierkiewicz wrote:
> > > There's nothing inherently *wrong* with check_region, it's
> > > just deprecated to trap the old (now racy) idiom of "if
> > > (check_region(xx)) reserve_region(xx)". There's no reason not to
> > > introduce a probe_region if IDE really wants it.
> >
> > And ide-probe.c does exactly this racy stuff.
> >
> > I did patch to convert it to request_region() some time ago,
> > I just need to double check it and submit.
>
> request_region at that point doesn't actually help you. For PIO devices
> its too late if you are handling PCMCIA, for PCI devices its too late
> because you want to own the PCI device properly, for MMIO its completely
> broken (all the mem region stuff in 2.5)
Yes, I am aware of that.
Patch is only to fix ide-probe.c (request_region() after check_region())
not whole ide resource allocation braindamage.
> The only way I can see to fix it properly is to provide ide helpers
> for resource allocation that are used by the drivers when needed.
Exactly, it is already on my todo.
--
Bartlomiej
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-06-06 15:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-06 7:34 __check_region in ide code? Rusty Russell
2003-06-06 8:56 ` Bartlomiej Zolnierkiewicz
2003-06-06 15:23 ` Alan Cox
2003-06-06 16:09 ` Bartlomiej Zolnierkiewicz
2003-06-06 11:31 ` William Lee Irwin III
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox