2004-09-13 23:40:46

by Hanna Linder

[permalink] [raw]
Subject: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device


Here is a very simple patch to convert pci_find_device call to pci_get_device.
As I don't have an alpha box or cross compiler could someone (wli- wink wink)
please verify it compiles and doesn't break anything, thanks a lot.

Hanna Linder
IBM Linux Technology Center

Signed-off-by: Hanna Linder <[email protected]>
----------

diff -Nrup linux-2.6.9-rc1/arch/alpha/kernel/sys_alcor.c linux-2.6.9-rc1-alpha/arch/alpha/kernel/sys_alcor.c
--- linux-2.6.9-rc1/arch/alpha/kernel/sys_alcor.c 2004-08-13 22:38:08.000000000 -0700
+++ linux-2.6.9-rc1-alpha/arch/alpha/kernel/sys_alcor.c 2004-09-10 11:33:06.000000000 -0700
@@ -254,7 +254,7 @@ alcor_init_pci(void)
* motherboard, by looking for a 21040 TULIP in slot 6, which is
* built into XLT and BRET/MAVERICK, but not available on ALCOR.
*/
- dev = pci_find_device(PCI_VENDOR_ID_DEC,
+ dev = pci_get_device(PCI_VENDOR_ID_DEC,
PCI_DEVICE_ID_DEC_TULIP,
NULL);
if (dev && dev->devfn == PCI_DEVFN(6,0)) {
@@ -262,6 +262,7 @@ alcor_init_pci(void)
printk(KERN_INFO "%s: Detected AS500 or XLT motherboard.\n",
__FUNCTION__);
}
+ pci_dev_put(dev);
}





2004-09-14 02:01:47

by Richard Henderson

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

On Mon, Sep 13, 2004 at 04:37:13PM -0700, Hanna Linder wrote:
> Here is a very simple patch to convert pci_find_device call to pci_get_device.
> As I don't have an alpha box or cross compiler could someone (wli- wink wink)
> please verify it compiles and doesn't break anything, thanks a lot.

Presumably the intent is to eventually remove pci_find_device?
These routines run at the very beginning of bootup; there cannot
possibly be any races.


r~

2004-09-14 02:03:54

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

On Mon, Sep 13, 2004 at 04:37:13PM -0700, Hanna Linder wrote:
> Here is a very simple patch to convert pci_find_device call to pci_get_device.
> As I don't have an alpha box or cross compiler could someone (wli- wink wink)
> please verify it compiles and doesn't break anything, thanks a lot.

I can run it through a compiler, but I won't be able to do meaningful
runtime testing on it as I only have tincup and alphapc systems. They
look safe at first glance.


-- wli

2004-09-14 02:22:42

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

On Mon, Sep 13, 2004 at 04:37:13PM -0700, Hanna Linder wrote:
>> Here is a very simple patch to convert pci_find_device call to pci_get_device.
>> As I don't have an alpha box or cross compiler could someone (wli- wink wink)
>> please verify it compiles and doesn't break anything, thanks a lot.

On Mon, Sep 13, 2004 at 07:01:16PM -0700, Richard Henderson wrote:
> Presumably the intent is to eventually remove pci_find_device?
> These routines run at the very beginning of bootup; there cannot
> possibly be any races.

I think it's okay if the intent is to remove pci_find_device() entirely
so drivers etc. don't trip over it. The bootstrap changes are, I
suppose, only to enable the eventual removal, and not meant to resolve
races that may exist there per se.


-- wli

2004-09-14 03:20:20

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

On Mon, Sep 13, 2004 at 04:37:13PM -0700, Hanna Linder wrote:
>> Here is a very simple patch to convert pci_find_device call to
>> pci_get_device. As I don't have an alpha box or cross compiler could
>> someone (wli- wink wink) please verify it compiles and doesn't break
>> anything, thanks a lot.

On Mon, Sep 13, 2004 at 07:02:57PM -0700, William Lee Irwin III wrote:
> I can run it through a compiler, but I won't be able to do meaningful
> runtime testing on it as I only have tincup and alphapc systems. They
> look safe at first glance.

More specifically, if these were merely alpha-specific drivers, I could
do meaningful testing as they would attempt to be detected this way.
But this is system-specific initialization executed conditionally on
the system type, so as the systems I have are not the ones affected by
these patches, if I were to attempt a runtime test I would merely
discover that the code was not executed.


-- wli

2004-09-14 03:36:38

by Greg KH

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

On Mon, Sep 13, 2004 at 07:01:16PM -0700, Richard Henderson wrote:
> On Mon, Sep 13, 2004 at 04:37:13PM -0700, Hanna Linder wrote:
> > Here is a very simple patch to convert pci_find_device call to pci_get_device.
> > As I don't have an alpha box or cross compiler could someone (wli- wink wink)
> > please verify it compiles and doesn't break anything, thanks a lot.
>
> Presumably the intent is to eventually remove pci_find_device?

That is the intent.

> These routines run at the very beginning of bootup; there cannot
> possibly be any races.

I agree there isn't any races here, we just need to get rid of
pci_find_device() as people use it in an unsafe manner in lots of
different places.

thanks,

greg k-h

2004-09-14 15:56:24

by Hanna Linder

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

--On Monday, September 13, 2004 08:17:05 PM -0700 William Lee Irwin III <[email protected]> wrote:

> On Mon, Sep 13, 2004 at 07:02:57PM -0700, William Lee Irwin III wrote:
>> I can run it through a compiler, but I won't be able to do meaningful
>> runtime testing on it as I only have tincup and alphapc systems. They
>> look safe at first glance.
>
> More specifically, if these were merely alpha-specific drivers, I could
> do meaningful testing as they would attempt to be detected this way.
> But this is system-specific initialization executed conditionally on
> the system type, so as the systems I have are not the ones affected by
> these patches, if I were to attempt a runtime test I would merely
> discover that the code was not executed.

Bill,

That is fine if you could just compile it that would satisfy me.

Thanks.

Hanna

2004-09-14 17:14:34

by Herbert Poetzl

[permalink] [raw]
Subject: Re: [RFT 2.6.9-rc1 alpha sys_alcor.c] [1/2] convert pci_find_device to pci_get_device

On Tue, Sep 14, 2004 at 08:52:10AM -0700, Hanna Linder wrote:
> --On Monday, September 13, 2004 08:17:05 PM -0700 William Lee Irwin III <[email protected]> wrote:
>
> > On Mon, Sep 13, 2004 at 07:02:57PM -0700, William Lee Irwin III wrote:
> >> I can run it through a compiler, but I won't be able to do meaningful
> >> runtime testing on it as I only have tincup and alphapc systems. They
> >> look safe at first glance.
> >
> > More specifically, if these were merely alpha-specific drivers, I could
> > do meaningful testing as they would attempt to be detected this way.
> > But this is system-specific initialization executed conditionally on
> > the system type, so as the systems I have are not the ones affected by
> > these patches, if I were to attempt a runtime test I would merely
> > discover that the code was not executed.
>
> Bill,
>
> That is fine if you could just compile it that would satisfy me.

Hi Hanna!

if you need a 'quick' cross compiling solution
next time, you can use the cross compiling at

http://vserver.13thfloor.at/Stuff/Cross/
http://vserver.13thfloor.at/Stuff/Cross/howto.info

if I get around, I'll update it to recent 3.4
compilers but 3.3.3 and 3.3.4 works fine ...

HTH,
Herbert

> Thanks.
>
> Hanna
>
> -
> 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/