Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread Randy.Dunlap
On Tue, 30 Aug 2005, David Hollis wrote:

> On Tue, 2005-08-30 at 01:55 +0200, Diego Calleja wrote:
> > El Tue, 30 Aug 2005 01:34:25 +0200,
> > Jesper Juhl <[EMAIL PROTECTED]> escribió:
> >
> > > I don't see why we should break a bunch of drivers by doing that.
> > > Much better, in my oppinion, to fix the few remaining drivers still
> > > using check_region and *then* kill it. Even unmaintained drivers may
> >
> > I'd usually agree with you, but check_region has been deprecated for so many
> > time; I was just wondering myself if people will bother to fix the remaining
> > drivers without some "incentive"
>
> Shouldn't it be (or have been) added to the
> Documentation/feature-removal-schedule.txt then so it could be
> deprecated and removed through the proper mechanisms.

It should be (or have been) if there were a hard plan and
deadline to remove it, but there isn't, and there needn't be,
so it's not missing from there IMO.

-- 
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread Adrian Bunk
On Tue, Aug 30, 2005 at 10:28:37AM -0400, David Hollis wrote:
> On Tue, 2005-08-30 at 01:55 +0200, Diego Calleja wrote:
> > El Tue, 30 Aug 2005 01:34:25 +0200,
> > Jesper Juhl <[EMAIL PROTECTED]> escribió:
> > 
> > > I don't see why we should break a bunch of drivers by doing that.
> > > Much better, in my oppinion, to fix the few remaining drivers still
> > > using check_region and *then* kill it. Even unmaintained drivers may
> > 
> > I'd usually agree with you, but check_region has been deprecated for so many
> > time; I was just wondering myself if people will bother to fix the remaining
> > drivers without some "incentive" 
> 
> Shouldn't it be (or have been) added to the
> Documentation/feature-removal-schedule.txt then so it could be
> deprecated and removed through the proper mechanisms.

Why?

Although there is a possible (but not very likely) race condition the 
drivers usually work fine (they shouldn't work worse than at the time 
when they were added).

> David Hollis <[EMAIL PROTECTED]>

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread David Hollis
On Tue, 2005-08-30 at 01:55 +0200, Diego Calleja wrote:
> El Tue, 30 Aug 2005 01:34:25 +0200,
> Jesper Juhl <[EMAIL PROTECTED]> escribió:
> 
> > I don't see why we should break a bunch of drivers by doing that.
> > Much better, in my oppinion, to fix the few remaining drivers still
> > using check_region and *then* kill it. Even unmaintained drivers may
> 
> I'd usually agree with you, but check_region has been deprecated for so many
> time; I was just wondering myself if people will bother to fix the remaining
> drivers without some "incentive" 

Shouldn't it be (or have been) added to the
Documentation/feature-removal-schedule.txt then so it could be
deprecated and removed through the proper mechanisms.

-- 
David Hollis <[EMAIL PROTECTED]>


signature.asc
Description: This is a digitally signed message part


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread Stephane Wirtel
Le Tuesday 30 August 2005 a 01:08, Stephane Wirtel ecrivait: 
> Hi, 
> 
> By compiling my kernel, I can see that the __check_region function (in
> kernel/resource.c) is deprecated.
> 
> With a grep on the source code of the last release, I get this result.
> 
> drivers/pnp/resource.c:255: if (__check_region(_resource, 
> *port, length(port,end))) 
> include/linux/ioport.h:117:#define check_mem_region(start,n) 
> __check_region(_resource, (start), (n))
> include/linux/ioport.h:120:extern int __check_region(struct resource *, 
> unsigned long, unsigned long);
> include/linux/ioport.h:125: return __check_region(_resource, s, n);
> kernel/resource.c:468:int __deprecated __check_region(struct resource 
> *parent, unsigned long start, unsigned long n)
> kernel/resource.c:481:EXPORT_SYMBOL(__check_region);


This morning, I worked on a patch to remove this deprecated function,
there are three patchs, 
patch for kernel/resource.c
patch for include/linux/ioport.h
patch for drivers/pnp/resource.c

I go to my job, but after, I will check my patches.

Best Regards, 

Stephane
-- 
Stephane Wirtel <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread Stephane Wirtel
Le Tuesday 30 August 2005 a 01:08, Stephane Wirtel ecrivait: 
 Hi, 
 
 By compiling my kernel, I can see that the __check_region function (in
 kernel/resource.c) is deprecated.
 
 With a grep on the source code of the last release, I get this result.
 
 drivers/pnp/resource.c:255: if (__check_region(ioport_resource, 
 *port, length(port,end))) 
 include/linux/ioport.h:117:#define check_mem_region(start,n) 
 __check_region(iomem_resource, (start), (n))
 include/linux/ioport.h:120:extern int __check_region(struct resource *, 
 unsigned long, unsigned long);
 include/linux/ioport.h:125: return __check_region(ioport_resource, s, n);
 kernel/resource.c:468:int __deprecated __check_region(struct resource 
 *parent, unsigned long start, unsigned long n)
 kernel/resource.c:481:EXPORT_SYMBOL(__check_region);


This morning, I worked on a patch to remove this deprecated function,
there are three patchs, 
patch for kernel/resource.c
patch for include/linux/ioport.h
patch for drivers/pnp/resource.c

I go to my job, but after, I will check my patches.

Best Regards, 

Stephane
-- 
Stephane Wirtel [EMAIL PROTECTED]
[EMAIL PROTECTED]


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread David Hollis
On Tue, 2005-08-30 at 01:55 +0200, Diego Calleja wrote:
 El Tue, 30 Aug 2005 01:34:25 +0200,
 Jesper Juhl [EMAIL PROTECTED] escribió:
 
  I don't see why we should break a bunch of drivers by doing that.
  Much better, in my oppinion, to fix the few remaining drivers still
  using check_region and *then* kill it. Even unmaintained drivers may
 
 I'd usually agree with you, but check_region has been deprecated for so many
 time; I was just wondering myself if people will bother to fix the remaining
 drivers without some incentive 

Shouldn't it be (or have been) added to the
Documentation/feature-removal-schedule.txt then so it could be
deprecated and removed through the proper mechanisms.

-- 
David Hollis [EMAIL PROTECTED]


signature.asc
Description: This is a digitally signed message part


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread Adrian Bunk
On Tue, Aug 30, 2005 at 10:28:37AM -0400, David Hollis wrote:
 On Tue, 2005-08-30 at 01:55 +0200, Diego Calleja wrote:
  El Tue, 30 Aug 2005 01:34:25 +0200,
  Jesper Juhl [EMAIL PROTECTED] escribió:
  
   I don't see why we should break a bunch of drivers by doing that.
   Much better, in my oppinion, to fix the few remaining drivers still
   using check_region and *then* kill it. Even unmaintained drivers may
  
  I'd usually agree with you, but check_region has been deprecated for so many
  time; I was just wondering myself if people will bother to fix the remaining
  drivers without some incentive 
 
 Shouldn't it be (or have been) added to the
 Documentation/feature-removal-schedule.txt then so it could be
 deprecated and removed through the proper mechanisms.

Why?

Although there is a possible (but not very likely) race condition the 
drivers usually work fine (they shouldn't work worse than at the time 
when they were added).

 David Hollis [EMAIL PROTECTED]

cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-30 Thread Randy.Dunlap
On Tue, 30 Aug 2005, David Hollis wrote:

 On Tue, 2005-08-30 at 01:55 +0200, Diego Calleja wrote:
  El Tue, 30 Aug 2005 01:34:25 +0200,
  Jesper Juhl [EMAIL PROTECTED] escribió:
 
   I don't see why we should break a bunch of drivers by doing that.
   Much better, in my oppinion, to fix the few remaining drivers still
   using check_region and *then* kill it. Even unmaintained drivers may
 
  I'd usually agree with you, but check_region has been deprecated for so many
  time; I was just wondering myself if people will bother to fix the remaining
  drivers without some incentive

 Shouldn't it be (or have been) added to the
 Documentation/feature-removal-schedule.txt then so it could be
 deprecated and removed through the proper mechanisms.

It should be (or have been) if there were a hard plan and
deadline to remove it, but there isn't, and there needn't be,
so it's not missing from there IMO.

-- 
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Jesper Juhl
On 8/30/05, Diego Calleja <[EMAIL PROTECTED]> wrote:
> El Tue, 30 Aug 2005 01:34:25 +0200,
> Jesper Juhl <[EMAIL PROTECTED]> escribió:
> 
> > I don't see why we should break a bunch of drivers by doing that.
> > Much better, in my oppinion, to fix the few remaining drivers still
> > using check_region and *then* kill it. Even unmaintained drivers may
> 
> I'd usually agree with you, but check_region has been deprecated for so many
> time; I was just wondering myself if people will bother to fix the remaining
> drivers without some "incentive"
> 
I fixed a few a while back, without any incentive other than "this
just needs to be done".
I'm sure noone would object if you submitted a few patches yourself to
fix some of the remaining ones.

-- 
Jesper Juhl <[EMAIL PROTECTED]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Diego Calleja
El Tue, 30 Aug 2005 01:34:25 +0200,
Jesper Juhl <[EMAIL PROTECTED]> escribió:

> I don't see why we should break a bunch of drivers by doing that.
> Much better, in my oppinion, to fix the few remaining drivers still
> using check_region and *then* kill it. Even unmaintained drivers may

I'd usually agree with you, but check_region has been deprecated for so many
time; I was just wondering myself if people will bother to fix the remaining
drivers without some "incentive" 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Jesper Juhl
On 8/30/05, Diego Calleja <[EMAIL PROTECTED]> wrote:
[snip]
> 
> /me wonders why check_region has not been killed, it has been
> deprecated for years; killing it would force developers to fix it
> and would help to identify unmaintained drivers...

I don't see why we should break a bunch of drivers by doing that.
Much better, in my oppinion, to fix the few remaining drivers still
using check_region and *then* kill it. Even unmaintained drivers may
still be useful to a lot of people, no point in just breaking them for
the hell of it.

-- 
Jesper Juhl <[EMAIL PROTECTED]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Diego Calleja
El Tue, 30 Aug 2005 01:14:17 +0200,
Stephane Wirtel <[EMAIL PROTECTED]> escribió:

> Is there a function to replace this deprecated function ?

request_region

> Why is it deprecated ?

>From http://lists.osdl.org/pipermail/kernel-janitors/2004-January/000346.html:
"The reason that check_region() is deprecated is that it is racy.
It could report that a region is available and then another driver
could immediately reserve that region, since check_region() doesn't
have any reservation capability."


/me wonders why check_region has not been killed, it has been
deprecated for years; killing it would force developers to fix it
and would help to identify unmaintained drivers...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Jesper Juhl
On 8/30/05, Stephane Wirtel <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> By compiling my kernel, I can see that the __check_region function (in
> kernel/resource.c) is deprecated.
> 
[snip]
> 
> Is there a function to replace this deprecated function ?
> 
Yes, you just call request_region() and check its return value.


> Why is it deprecated ?
> 
In the past you first called check_region() followed by
request_region() if the region was available. That is not safe as you
could get interrupted between the two calls and something else might
have already grabbed the region you thought was free by the time you
get to calling request_region().  So, request_region() was rewritten
to do the checking internally and let the caller know via its return
value if
acquiring the region failed or succeded. 
So these days check_region should no longer be used. It's a historic
relic. request_region() should be used directly instead. That's why it
is deprecated.


-- 
Jesper Juhl <[EMAIL PROTECTED]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Randy.Dunlap
On Tue, 30 Aug 2005, Stephane Wirtel wrote:

> Hi,
>
> By compiling my kernel, I can see that the __check_region function (in
> kernel/resource.c) is deprecated.
>
> With a grep on the source code of the last release, I get this result.
>
> drivers/pnp/resource.c:255: if (__check_region(_resource, 
> *port, length(port,end)))
> include/linux/ioport.h:117:#define check_mem_region(start,n) 
> __check_region(_resource, (start), (n))
> include/linux/ioport.h:120:extern int __check_region(struct resource *, 
> unsigned long, unsigned long);
> include/linux/ioport.h:125: return __check_region(_resource, s, n);
> kernel/resource.c:468:int __deprecated __check_region(struct resource 
> *parent, unsigned long start, unsigned long n)
> kernel/resource.c:481:EXPORT_SYMBOL(__check_region);
>
> Is there a function to replace this deprecated function ?

Just restructure the code to use request_region().

> Why is it deprecated ?

because it's racy.  I.e., it's normally used as:

check_region();
if (ok)
request_region();

but between the check_region() and request_region(), the region
could have been allocated by something else.

-- 
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Randy.Dunlap
On Tue, 30 Aug 2005, Stephane Wirtel wrote:

 Hi,

 By compiling my kernel, I can see that the __check_region function (in
 kernel/resource.c) is deprecated.

 With a grep on the source code of the last release, I get this result.

 drivers/pnp/resource.c:255: if (__check_region(ioport_resource, 
 *port, length(port,end)))
 include/linux/ioport.h:117:#define check_mem_region(start,n) 
 __check_region(iomem_resource, (start), (n))
 include/linux/ioport.h:120:extern int __check_region(struct resource *, 
 unsigned long, unsigned long);
 include/linux/ioport.h:125: return __check_region(ioport_resource, s, n);
 kernel/resource.c:468:int __deprecated __check_region(struct resource 
 *parent, unsigned long start, unsigned long n)
 kernel/resource.c:481:EXPORT_SYMBOL(__check_region);

 Is there a function to replace this deprecated function ?

Just restructure the code to use request_region().

 Why is it deprecated ?

because it's racy.  I.e., it's normally used as:

check_region();
if (ok)
request_region();

but between the check_region() and request_region(), the region
could have been allocated by something else.

-- 
~Randy
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Jesper Juhl
On 8/30/05, Stephane Wirtel [EMAIL PROTECTED] wrote:
 Hi,
 
 By compiling my kernel, I can see that the __check_region function (in
 kernel/resource.c) is deprecated.
 
[snip]
 
 Is there a function to replace this deprecated function ?
 
Yes, you just call request_region() and check its return value.


 Why is it deprecated ?
 
In the past you first called check_region() followed by
request_region() if the region was available. That is not safe as you
could get interrupted between the two calls and something else might
have already grabbed the region you thought was free by the time you
get to calling request_region().  So, request_region() was rewritten
to do the checking internally and let the caller know via its return
value if
acquiring the region failed or succeded. 
So these days check_region should no longer be used. It's a historic
relic. request_region() should be used directly instead. That's why it
is deprecated.


-- 
Jesper Juhl [EMAIL PROTECTED]
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Diego Calleja
El Tue, 30 Aug 2005 01:14:17 +0200,
Stephane Wirtel [EMAIL PROTECTED] escribió:

 Is there a function to replace this deprecated function ?

request_region

 Why is it deprecated ?

From http://lists.osdl.org/pipermail/kernel-janitors/2004-January/000346.html:
The reason that check_region() is deprecated is that it is racy.
It could report that a region is available and then another driver
could immediately reserve that region, since check_region() doesn't
have any reservation capability.


/me wonders why check_region has not been killed, it has been
deprecated for years; killing it would force developers to fix it
and would help to identify unmaintained drivers...
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Jesper Juhl
On 8/30/05, Diego Calleja [EMAIL PROTECTED] wrote:
[snip]
 
 /me wonders why check_region has not been killed, it has been
 deprecated for years; killing it would force developers to fix it
 and would help to identify unmaintained drivers...

I don't see why we should break a bunch of drivers by doing that.
Much better, in my oppinion, to fix the few remaining drivers still
using check_region and *then* kill it. Even unmaintained drivers may
still be useful to a lot of people, no point in just breaking them for
the hell of it.

-- 
Jesper Juhl [EMAIL PROTECTED]
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Diego Calleja
El Tue, 30 Aug 2005 01:34:25 +0200,
Jesper Juhl [EMAIL PROTECTED] escribió:

 I don't see why we should break a bunch of drivers by doing that.
 Much better, in my oppinion, to fix the few remaining drivers still
 using check_region and *then* kill it. Even unmaintained drivers may

I'd usually agree with you, but check_region has been deprecated for so many
time; I was just wondering myself if people will bother to fix the remaining
drivers without some incentive 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux-2.6.13 : __check_region is deprecated

2005-08-29 Thread Jesper Juhl
On 8/30/05, Diego Calleja [EMAIL PROTECTED] wrote:
 El Tue, 30 Aug 2005 01:34:25 +0200,
 Jesper Juhl [EMAIL PROTECTED] escribió:
 
  I don't see why we should break a bunch of drivers by doing that.
  Much better, in my oppinion, to fix the few remaining drivers still
  using check_region and *then* kill it. Even unmaintained drivers may
 
 I'd usually agree with you, but check_region has been deprecated for so many
 time; I was just wondering myself if people will bother to fix the remaining
 drivers without some incentive
 
I fixed a few a while back, without any incentive other than this
just needs to be done.
I'm sure noone would object if you submitted a few patches yourself to
fix some of the remaining ones.

-- 
Jesper Juhl [EMAIL PROTECTED]
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/