Re: Fwd: Re: [PATCH] Get rid of __check_region in drivers/pnp/resource.c [2.6.0-test1][2.5.75-kj1]

From: Adam Belay (ambx1@neo.rr.com)
Date: Sat Jul 26 2003 - 15:29:23 EST


On Sat, Jul 26, 2003 at 06:06:41PM +0200, Daniele Bellucci wrote:
>
> Hi Adam,
> could you double check this patch?
>
> tnx.
>
>
> diff -urN 1.0/drivers/pnp/resource.c 1.1/drivers/pnp/resource.c
> --- 1.0/drivers/pnp/resource.c 2003-07-26 13:56:18.000000000 +0200
> +++ 1.1/drivers/pnp/resource.c 2003-07-26 14:05:30.000000000 +0200
> @@ -258,7 +258,9 @@
> /* check if the resource is already in use, skip if the
> * device is active because it itself may be in use */
> if(!dev->active) {
> - if (__check_region(&ioport_resource, *port, length(port,end)))
> +
> + if (__request_region(&ioport_resource, *port, length(port,end),
> + dev->dev.name))
> return 0;
> }
>
>
>
>
> ---------- Forwarded Message ----------
>
> Subject: Re: [PATCH] Get rid of __check_region in drivers/pnp/resource.c
[2.6.0-test1][2.5.75-kj1]> Date: Sat, 26 Jul 2003 11:50:40 -0400
> From: Greg KH <greg@kroah.com>
> To: Daniele Bellucci <bellucda@tiscali.it>
> Cc: kernel-janitor-discuss@lists.sourceforge.net
>
> On Sat, Jul 26, 2003 at 02:10:15PM +0200, Daniele Bellucci wrote:
> > Hi all,
> > the following patch compile and boot fine but i'm not sure if this is the
> > right fix.
> >
> > Please tellme if correct.
>
> It doesn't look correct. You should also cc: the pnp maintainer about
> this.
>
> thanks,
>
> greg k-h
>
> -------------------------------------------------------
>

We only want to check if the resource is in use, not reserve it. Therefore I
see __check_region as being appropriate. As long as it isn't printing a compile
warning, I'd prefer to leave it. In this particular case it is not creating a
race condition but for most cases it should be removed.

Also simply requesting the resource without releasing it will cause many of the
drivers that actually call request_region to fail.

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



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:30 EST