* [PATCH] remove check_region from PnPWakeUp routine of Eepro ISA driver
@ 2005-09-22 6:00 Borislav Petkov
2005-09-22 6:09 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2005-09-22 6:00 UTC (permalink / raw)
To: netdev; +Cc: akpm, linux-kernel
Hi,
The following patch removes the check_region call in the PnPWakeUp
path in the Eepro /10 ISA driver. Instead, now it calls request_region
for the PnP wake up routine and, after succeeding, it calls release_region
for the actual reservation of I/O ports takes place in the eepro_probe1()
function straight afterwards.
Signed-off-by: Borislav Petkov <petkov@uni-muenster.de>
--- drivers/net/eepro.c.orig 2005-09-22 06:20:28.000000000 +0200
+++ drivers/net/eepro.c 2005-09-22 07:20:16.000000000 +0200
@@ -552,7 +552,7 @@ static int __init do_eepro_probe(struct
{
unsigned short int WS[32]=WakeupSeq;
- if (check_region(WakeupPort, 2)==0) {
+ if (request_region(WakeupPort, 2, DRV_NAME)) {
if (net_debug>5)
printk(KERN_DEBUG "Waking UP\n");
@@ -563,6 +563,8 @@ static int __init do_eepro_probe(struct
outb_p(WS[i],WakeupPort);
if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]);
}
+ release_region(WakeupPort, 2);
+
} else printk(KERN_WARNING "Checkregion Failed!\n");
}
#endif
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] remove check_region from PnPWakeUp routine of Eepro ISA driver
2005-09-22 6:00 [PATCH] remove check_region from PnPWakeUp routine of Eepro ISA driver Borislav Petkov
@ 2005-09-22 6:09 ` Andrew Morton
2005-09-22 6:29 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2005-09-22 6:09 UTC (permalink / raw)
To: Borislav Petkov; +Cc: netdev, linux-kernel
Borislav Petkov <petkov@uni-muenster.de> wrote:
>
> Hi,
>
> The following patch removes the check_region call in the PnPWakeUp
> path in the Eepro /10 ISA driver. Instead, now it calls request_region
> for the PnP wake up routine and, after succeeding, it calls release_region
> for the actual reservation of I/O ports takes place in the eepro_probe1()
> function straight afterwards.
>
> Signed-off-by: Borislav Petkov <petkov@uni-muenster.de>
>
>
> --- drivers/net/eepro.c.orig 2005-09-22 06:20:28.000000000 +0200
> +++ drivers/net/eepro.c 2005-09-22 07:20:16.000000000 +0200
> @@ -552,7 +552,7 @@ static int __init do_eepro_probe(struct
> {
> unsigned short int WS[32]=WakeupSeq;
>
> - if (check_region(WakeupPort, 2)==0) {
> + if (request_region(WakeupPort, 2, DRV_NAME)) {
>
> if (net_debug>5)
> printk(KERN_DEBUG "Waking UP\n");
> @@ -563,6 +563,8 @@ static int __init do_eepro_probe(struct
> outb_p(WS[i],WakeupPort);
> if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]);
> }
> + release_region(WakeupPort, 2);
> +
> } else printk(KERN_WARNING "Checkregion Failed!\n");
> }
> #endif
hm, that's all a bit strange. It would be better to do the
request_region() just once and if that works, retain the reservation rather
than releasing and reacquiring it.
That being said, the code you've modified is disabled due to
!defined(PnPWakeup), and the chances of anyone ever changing that are close
to zero.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] remove check_region from PnPWakeUp routine of Eepro ISA driver
2005-09-22 6:09 ` Andrew Morton
@ 2005-09-22 6:29 ` Borislav Petkov
2005-09-22 6:37 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2005-09-22 6:29 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, linux-kernel
On Wed, Sep 21, 2005 at 11:09:15PM -0700, Andrew Morton wrote:
> Borislav Petkov <petkov@uni-muenster.de> wrote:
> >
> > Hi,
> >
> > The following patch removes the check_region call in the PnPWakeUp
> > path in the Eepro /10 ISA driver. Instead, now it calls request_region
> > for the PnP wake up routine and, after succeeding, it calls release_region
> > for the actual reservation of I/O ports takes place in the eepro_probe1()
> > function straight afterwards.
> >
> > Signed-off-by: Borislav Petkov <petkov@uni-muenster.de>
> >
> >
> > --- drivers/net/eepro.c.orig 2005-09-22 06:20:28.000000000 +0200
> > +++ drivers/net/eepro.c 2005-09-22 07:20:16.000000000 +0200
> > @@ -552,7 +552,7 @@ static int __init do_eepro_probe(struct
> > {
> > unsigned short int WS[32]=WakeupSeq;
> >
> > - if (check_region(WakeupPort, 2)==0) {
> > + if (request_region(WakeupPort, 2, DRV_NAME)) {
> >
> > if (net_debug>5)
> > printk(KERN_DEBUG "Waking UP\n");
> > @@ -563,6 +563,8 @@ static int __init do_eepro_probe(struct
> > outb_p(WS[i],WakeupPort);
> > if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]);
> > }
> > + release_region(WakeupPort, 2);
> > +
> > } else printk(KERN_WARNING "Checkregion Failed!\n");
> > }
> > #endif
>
> hm, that's all a bit strange. It would be better to do the
> request_region() just once and if that works, retain the reservation rather
> than releasing and reacquiring it.
I thought so at first too but was having problems with the call to
eepro_probe1() a bit further down where request_region() is called a second time
and this would have resulted in two consecutive calls to request_region for the
same region without freeing it. I guess in the actual __request_region() in the
while loop, during the second call IORESOURCE_BUSY will be returned meaning that
the region is already reserved?
>
> That being said, the code you've modified is disabled due to
> !defined(PnPWakeup), and the chances of anyone ever changing that are close
> to zero.
should I remove it then altogether?
Regards,
Boris.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] remove check_region from PnPWakeUp routine of Eepro ISA driver
2005-09-22 6:29 ` Borislav Petkov
@ 2005-09-22 6:37 ` Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2005-09-22 6:37 UTC (permalink / raw)
To: Borislav Petkov; +Cc: netdev, linux-kernel
Borislav Petkov <petkov@uni-muenster.de> wrote:
>
> > That being said, the code you've modified is disabled due to
> > !defined(PnPWakeup), and the chances of anyone ever changing that are close
> > to zero.
> should I remove it then altogether?
We might as well leave it there in case someone is inspired to reenable the
feature and work on the driver a bit. The chances of that are near zero -
it's ancient. I don't think there's much point in spending time on this
driver.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-22 6:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-22 6:00 [PATCH] remove check_region from PnPWakeUp routine of Eepro ISA driver Borislav Petkov
2005-09-22 6:09 ` Andrew Morton
2005-09-22 6:29 ` Borislav Petkov
2005-09-22 6:37 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox