* Re: PCI Cleanup
@ 2002-08-20 17:58 Hanna Linder
2002-08-20 18:00 ` David Mosberger
0 siblings, 1 reply; 13+ messages in thread
From: Hanna Linder @ 2002-08-20 17:58 UTC (permalink / raw)
To: gregkh, greg; +Cc: Hanna Linder, linux-kernel
Here is the ia64 port of Mat Dobson's PCI Cleanup
changes (changed again by Greg KH subtly) to support
the new pci_ops structure. This will apply cleanly
to bk://linuxusb.bkbits.net/pci_hp-2.5.
I have not compiled or run this code. The most recent
ia64 port for 2.5 is 2.5.18 if there is one for 2.5.31
please let me know. Otherwise, if there are any problems
let me know and I will be happy to resubmit.
Hanna Linder
hannal@us.ibm.com
---------
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.556 -> 1.557
# arch/ia64/kernel/pci.c 1.14 -> 1.15
# include/asm-ia64/pci.h 1.10 -> 1.11
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/19 hlinder@w-hlinder.beaverton.ibm.com 1.557
# Combination of ia64 port of pci_ops changes.
# --------------------------------------------
#
diff -Nru a/arch/ia64/kernel/pci.c b/arch/ia64/kernel/pci.c
--- a/arch/ia64/kernel/pci.c Tue Aug 20 10:49:06 2002
+++ b/arch/ia64/kernel/pci.c Tue Aug 20 10:49:06 2002
@@ -46,9 +46,6 @@
struct pci_ops *pci_root_ops;
-int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
-int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
-
/*
* Low-level SAL-based PCI configuration access functions. Note that SAL
@@ -60,7 +57,7 @@
((u64)(bus << 16) | (u64)(dev << 11) | (u64)(fn << 8) | (u64)(reg))
static int
-pci_sal_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+__pci_sal_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
int result = 0;
u64 data = 0;
@@ -76,7 +73,7 @@
}
static int
-pci_sal_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+__pci_sal_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
return -EINVAL;
@@ -86,77 +83,22 @@
static int
-pci_sal_read_config_byte (struct pci_dev *dev, int where, u8 *value)
-{
- int result = 0;
- u32 data = 0;
-
- if (!value)
- return -EINVAL;
-
- result = pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
-
- *value = (u8) data;
-
- return result;
-}
-
-static int
-pci_sal_read_config_word (struct pci_dev *dev, int where, u16 *value)
-{
- int result = 0;
- u32 data = 0;
-
- if (!value)
- return -EINVAL;
-
- result = pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
-
- *value = (u16) data;
-
- return result;
-}
-
-static int
-pci_sal_read_config_dword (struct pci_dev *dev, int where, u32 *value)
-{
- if (!value)
- return -EINVAL;
-
- return pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int
-pci_sal_write_config_byte (struct pci_dev *dev, int where, u8 value)
-{
- return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
-}
-
-static int
-pci_sal_write_config_word (struct pci_dev *dev, int where, u16 value)
+pci_sal_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
+ return __pci_sal_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
static int
-pci_sal_write_config_dword (struct pci_dev *dev, int where, u32 value)
+pci_sal_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_sal_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
struct pci_ops pci_sal_ops = {
- pci_sal_read_config_byte,
- pci_sal_read_config_word,
- pci_sal_read_config_dword,
- pci_sal_write_config_byte,
- pci_sal_write_config_word,
- pci_sal_write_config_dword
+ .read = pci_sal_read,
+ .write = pci_sal_write,
};
@@ -193,8 +135,6 @@
printk("PCI: Using SAL to access configuration space\n");
pci_root_ops = &pci_sal_ops;
- pci_config_read = pci_sal_read;
- pci_config_write = pci_sal_write;
return;
}
diff -Nru a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
--- a/include/asm-ia64/pci.h Tue Aug 20 10:49:06 2002
+++ b/include/asm-ia64/pci.h Tue Aug 20 10:49:06 2002
@@ -22,8 +22,6 @@
void pcibios_config_init(void);
struct pci_bus * pcibios_scan_root(int bus);
-extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
-extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
struct pci_dev;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-20 17:58 PCI Cleanup Hanna Linder
@ 2002-08-20 18:00 ` David Mosberger
2002-08-20 18:30 ` Hanna Linder
0 siblings, 1 reply; 13+ messages in thread
From: David Mosberger @ 2002-08-20 18:00 UTC (permalink / raw)
To: Hanna Linder; +Cc: gregkh, greg, linux-kernel
>>>>> On Tue, 20 Aug 2002 10:58:35 -0700, Hanna Linder <hannal@us.ibm.com> said:
Hanna> I have not compiled or run this code. The most recent ia64
Hanna> port for 2.5 is 2.5.18 if there is one for 2.5.31 please let
Hanna> me know. Otherwise, if there are any problems let me know and
Hanna> I will be happy to resubmit.
For later patches, please see the test-patches that I sent on the
linux-ia64 mailing list (and please cc that list for matters related
to ia64).
Thanks,
--david
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-20 18:00 ` David Mosberger
@ 2002-08-20 18:30 ` Hanna Linder
2002-08-20 18:44 ` David Mosberger
0 siblings, 1 reply; 13+ messages in thread
From: Hanna Linder @ 2002-08-20 18:30 UTC (permalink / raw)
To: davidm; +Cc: Hanna Linder, gregkh, greg, linux-kernel
Thanks for your quick reply. I found your 2.5.30 test patch and
I will give it a try on a system here. They are all MP but I
will configure it as UP.
Thanks,
Hanna
--On Tuesday, August 20, 2002 11:00:13 -0700 David Mosberger <davidm@napali.hpl.hp.com> wrote:
>>>>>> On Tue, 20 Aug 2002 10:58:35 -0700, Hanna Linder <hannal@us.ibm.com> said:
>
> Hanna> I have not compiled or run this code. The most recent ia64
> Hanna> port for 2.5 is 2.5.18 if there is one for 2.5.31 please let
> Hanna> me know. Otherwise, if there are any problems let me know and
> Hanna> I will be happy to resubmit.
>
> For later patches, please see the test-patches that I sent on the
> linux-ia64 mailing list (and please cc that list for matters related
> to ia64).
>
> Thanks,
>
> --david
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-20 18:30 ` Hanna Linder
@ 2002-08-20 18:44 ` David Mosberger
2002-08-20 22:14 ` Hanna Linder
0 siblings, 1 reply; 13+ messages in thread
From: David Mosberger @ 2002-08-20 18:44 UTC (permalink / raw)
To: Hanna Linder; +Cc: davidm, gregkh, greg, linux-kernel
>>>>> On Tue, 20 Aug 2002 11:30:58 -0700, Hanna Linder <hannal@us.ibm.com> said:
Hanna> Thanks for your quick reply. I found your 2.5.30 test patch
Hanna> and I will give it a try on a system here. They are all MP
Hanna> but I will configure it as UP.
Just a caveat: don't use the CMD649 IDE driver. It seems to like to
eat your filesystem. Other than that, I haven't had any problems.
--david
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-20 22:14 ` Hanna Linder
@ 2002-08-20 22:13 ` David Mosberger
2002-08-20 22:45 ` Hanna Linder
0 siblings, 1 reply; 13+ messages in thread
From: David Mosberger @ 2002-08-20 22:13 UTC (permalink / raw)
To: Hanna Linder; +Cc: linux-kernel, linux-ia64
Hanna> Should there have been another patch that would go before the
Hanna> 2.5.30 test patch on top of a kernel.org clean 2.5.30 kernel?
Hanna> It is not applying cleanly and before I dig into code Im not
Hanna> very familiar with I thought I would ask here. Yes, this is
Hanna> my first time on an ia64 system.
The patch should be self-contained. Can you check whether your mailer
perhaps auto-wrapped long lines?
--david
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-20 18:44 ` David Mosberger
@ 2002-08-20 22:14 ` Hanna Linder
2002-08-20 22:13 ` David Mosberger
0 siblings, 1 reply; 13+ messages in thread
From: Hanna Linder @ 2002-08-20 22:14 UTC (permalink / raw)
To: davidm; +Cc: Hanna Linder, linux-kernel, linux-ia64
--On Tuesday, August 20, 2002 11:44:47 -0700 David Mosberger <davidm@napali.hpl.hp.com> wrote:
>>>>>> On Tue, 20 Aug 2002 11:30:58 -0700, Hanna Linder <hannal@us.ibm.com> said:
>
> Hanna> Thanks for your quick reply. I found your 2.5.30 test patch
> Hanna> and I will give it a try on a system here. They are all MP
> Hanna> but I will configure it as UP.
>
> Just a caveat: don't use the CMD649 IDE driver. It seems to like to
> eat your filesystem. Other than that, I haven't had any problems.
>
> --david
>
Should there have been another patch that would go before the 2.5.30
test patch on top of a kernel.org clean 2.5.30 kernel? It is not
applying cleanly and before I dig into code Im not very familiar
with I thought I would ask here. Yes, this is my first time on
an ia64 system.
Thanks,
Hanna Linder
hannal@us.ibm.com
----------
Here are the results from patch:
> [root@elm3a75 linux-2.5.30]# patch -p1 <ia64-2.5.30.patch
> patching file Documentation/mmio_barrier.txt
> patching file Makefile
> patching file arch/i386/mm/fault.c
> patching file arch/ia64/Makefile
> Hunk #2 succeeded at 26 with fuzz 1.
> patching file arch/ia64/boot/Makefile
> patching file arch/ia64/config.in
> Hunk #1 FAILED at 64.
> Hunk #2 FAILED at 100.
> Hunk #3 FAILED at 123.
> Hunk #4 FAILED at 155.
> 4 out of 5 hunks FAILED -- saving rejects to file arch/ia64/config.in.rej
> patching file arch/ia64/hp/Config.in
> Reversed (or previously applied) patch detected! Assume -R? [n] n
> Apply anyway? [n] n
> Skipping patch.
> 1 out of 1 hunk ignored -- saving rejects to file arch/ia64/hp/Config.in.rej
> patching file arch/ia64/hp/common/sba_iommu.c
> Hunk #2 succeeded at 111 with fuzz 2.
> Hunk #3 FAILED at 217.
> Hunk #7 FAILED at 362.
> Hunk #8 FAILED at 406.
> Hunk #10 FAILED at 450.
> Hunk #14 FAILED at 624.
> Hunk #16 FAILED at 693.
> Hunk #17 FAILED at 709.
> Hunk #19 FAILED at 747.
> Hunk #20 FAILED at 758.
> Hunk #21 succeeded at 792 with fuzz 2.
> Hunk #22 FAILED at 806.
> Hunk #23 FAILED at 860.
> Hunk #24 FAILED at 908.
> Hunk #25 FAILED at 964.
> Hunk #27 FAILED at 1085.
> Hunk #28 succeeded at 1141 with fuzz 2.
> Hunk #29 FAILED at 1157.
> Hunk #30 FAILED at 1180.
> Hunk #31 succeeded at 1199 with fuzz 1.
> Hunk #32 FAILED at 1207.
> Hunk #33 FAILED at 1268.
> Hunk #34 FAILED at 1291.
> Hunk #35 succeeded at 1301 with fuzz 1.
> Hunk #36 succeeded at 1314 with fuzz 2.
> Hunk #37 FAILED at 1455.
> Hunk #38 FAILED at 1463.
> Hunk #39 succeeded at 1586 with fuzz 2.
> Hunk #40 FAILED at 1595.
> 22 out of 40 hunks FAILED -- saving rejects to file arch/ia64/hp/common/sba_iommu.c.rejpatching file arch/ia64/hp/sim/Config.in
> patching file arch/ia64/hp/sim/hpsim_console.c
> Hunk #1 FAILED at 30.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/hp/sim/hpsim_console.c.rej
> patching file arch/ia64/hp/sim/hpsim_irq.c
> Hunk #1 FAILED at 22.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/hp/sim/hpsim_irq.c.rej
> patching file arch/ia64/hp/sim/hpsim_setup.c
> Hunk #1 FAILED at 1.
> Hunk #2 FAILED at 56.
> 2 out of 2 hunks FAILED -- saving rejects to file arch/ia64/hp/sim/hpsim_setup.c.rej
> patching file arch/ia64/hp/sim/simscsi.c
> Hunk #2 FAILED at 150.
> Hunk #3 succeeded at 231 with fuzz 1.
> Hunk #4 succeeded at 272 with fuzz 1.
> Hunk #5 FAILED at 284.
> Hunk #6 succeeded at 345 with fuzz 2.
> 2 out of 6 hunks FAILED -- saving rejects to file arch/ia64/hp/sim/simscsi.c.rej
> patching file arch/ia64/hp/sim/simserial.c
> Hunk #1 succeeded at 13 with fuzz 1.
> Hunk #2 FAILED at 32.
> Hunk #3 FAILED at 63.
> Hunk #4 FAILED at 235.
> Hunk #5 succeeded at 250 with fuzz 2.
> Hunk #6 succeeded at 293 with fuzz 1.
> Hunk #7 succeeded at 317 with fuzz 2.
> Hunk #8 FAILED at 333.
> Hunk #10 FAILED at 398.
> Hunk #11 FAILED at 573.
> Hunk #12 FAILED at 634.
> Hunk #13 FAILED at 665.
> Hunk #14 succeeded at 777 with fuzz 2.
> Hunk #15 FAILED at 858.
> 9 out of 15 hunks FAILED -- saving rejects to file arch/ia64/hp/sim/simserial.c.rej
> patching file arch/ia64/hp/zx1/hpzx1_machvec.c
> Reversed (or previously applied) patch detected! Assume -R? [n] n
> Apply anyway? [n] n
> Skipping patch.
> 1 out of 1 hunk ignored -- saving rejects to file arch/ia64/hp/zx1/hpzx1_machvec.c.rej patching file arch/ia64/hp/zx1/hpzx1_misc.c
> Hunk #1 FAILED at 12.
> Hunk #2 FAILED at 89.
> Hunk #4 FAILED at 202.
> Hunk #5 FAILED at 243.
> Hunk #6 FAILED at 256.
> Hunk #7 FAILED at 267.
> Hunk #9 FAILED at 310.
> Hunk #10 FAILED at 324.
> 8 out of 11 hunks FAILED -- saving rejects to file arch/ia64/hp/zx1/hpzx1_misc.c.rej
> patching file arch/ia64/ia32/binfmt_elf32.c
> patching file arch/ia64/ia32/ia32_ioctl.c
> Hunk #1 FAILED at 30.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/ia32/ia32_ioctl.c.rej
> patching file arch/ia64/kernel/acpi.c
> Hunk #1 FAILED at 56.
> Hunk #2 FAILED at 102.
> Hunk #3 succeeded at 135 with fuzz 1.
> Hunk #5 FAILED at 194.
> Hunk #7 succeeded at 227 with fuzz 2.
> Hunk #13 FAILED at 361.
> Hunk #14 FAILED at 370.
> Hunk #16 FAILED at 401.
> Hunk #19 FAILED at 430.
> Hunk #20 FAILED at 500.
> Hunk #21 FAILED at 509.
> Hunk #22 FAILED at 550.
> Hunk #24 FAILED at 606.
> Hunk #26 FAILED at 628.
> Hunk #27 FAILED at 643.
> 13 out of 28 hunks FAILED -- saving rejects to file arch/ia64/kernel/acpi.c.rej
> patching file arch/ia64/kernel/efi.c
> Hunk #1 succeeded at 125 with fuzz 1.
> Hunk #2 succeeded at 207 with fuzz 2.
> Hunk #3 FAILED at 217.
> Hunk #5 FAILED at 366.
> Hunk #6 FAILED at 446.
> Hunk #7 FAILED at 478.
> 4 out of 7 hunks FAILED -- saving rejects to file arch/ia64/kernel/efi.c.rej
> patching file arch/ia64/kernel/entry.S
> Hunk #1 FAILED at 175.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/kernel/entry.S.rej
> patching file arch/ia64/kernel/ia64_ksyms.c
> Reversed (or previously applied) patch detected! Assume -R? [n] n
> Apply anyway? [n] n
> Skipping patch.
> 1 out of 1 hunk ignored -- saving rejects to file arch/ia64/kernel/ia64_ksyms.c.rej
> patching file arch/ia64/kernel/init_task.c
> Hunk #1 FAILED at 34.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/kernel/init_task.c.rej
> patching file arch/ia64/kernel/iosapic.c
> Hunk #1 FAILED at 88.
> Hunk #3 succeeded at 160 with fuzz 2.
> Hunk #4 FAILED at 326.
> Hunk #5 FAILED at 370.
> Hunk #6 FAILED at 410.
> Hunk #8 FAILED at 645.
> Hunk #9 FAILED at 684.
> Hunk #10 FAILED at 761.
> 7 out of 10 hunks FAILED -- saving rejects to file arch/ia64/kernel/iosapic.c.rej
> patching file arch/ia64/kernel/irq.c
> Hunk #1 FAILED at 200.
> Hunk #2 FAILED at 217.
> Hunk #4 FAILED at 282.
> Hunk #5 succeeded at 345 with fuzz 1.
> Hunk #6 FAILED at 368.
> Hunk #8 FAILED at 403.
> Hunk #9 succeeded at 412 with fuzz 2.
> Hunk #10 FAILED at 542.
> 6 out of 12 hunks FAILED -- saving rejects to file arch/ia64/kernel/irq.c.rej
> patching file arch/ia64/kernel/irq_ia64.c
> Hunk #1 succeeded at 36 with fuzz 2.
> Hunk #3 FAILED at 153.
> Hunk #4 FAILED at 181.
> 2 out of 4 hunks FAILED -- saving rejects to file arch/ia64/kernel/irq_ia64.c.rej
> patching file arch/ia64/kernel/irq_lsapic.c
> Hunk #1 FAILED at 27.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/kernel/irq_lsapic.c.rej
> patching file arch/ia64/kernel/machvec.c
> patching file arch/ia64/kernel/mca.c
> Hunk #1 FAILED at 82.
> 1 out of 3 hunks FAILED -- saving rejects to file arch/ia64/kernel/mca.c.rej
> patching file arch/ia64/kernel/mca_asm.S
> patching file arch/ia64/kernel/pci.c
> Hunk #2 FAILED at 174.
> Hunk #3 FAILED at 265.
> 2 out of 3 hunks FAILED -- saving rejects to file arch/ia64/kernel/pci.c.rej
> patching file arch/ia64/kernel/perfmon.c
> Hunk #1 succeeded at 106 with fuzz 2.
> Hunk #4 FAILED at 908.
> Hunk #5 FAILED at 931.
> Hunk #6 succeeded at 975 with fuzz 2.
> Hunk #7 FAILED at 1287.
> Hunk #8 FAILED at 1378.
> Hunk #9 succeeded at 1401 with fuzz 1.
> Hunk #10 FAILED at 1447.
> Hunk #11 FAILED at 1471.
> Hunk #12 FAILED at 1493.
> Hunk #13 FAILED at 1502.
> Hunk #14 FAILED at 1510.
> Hunk #15 succeeded at 1559 with fuzz 2.
> Hunk #17 FAILED at 1964.
> Hunk #18 succeeded at 1974 with fuzz 2.
> Hunk #19 FAILED at 1982.
> Hunk #20 FAILED at 2370.
> Hunk #21 FAILED at 2402.
> Hunk #22 FAILED at 2418.
> Hunk #23 FAILED at 2965.
> Hunk #24 FAILED at 4125.
> Hunk #25 FAILED at 4157.
> 17 out of 26 hunks FAILED -- saving rejects to file arch/ia64/kernel/perfmon.c.rej
> patching file arch/ia64/kernel/perfmon_itanium.h
> patching file arch/ia64/kernel/perfmon_mckinley.h
> patching file arch/ia64/kernel/process.c
> Hunk #1 FAILED at 325.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/kernel/process.c.rej
> patching file arch/ia64/kernel/setup.c
> Hunk #1 succeeded at 347 with fuzz 1.
> Hunk #2 FAILED at 444.
> Hunk #4 succeeded at 550 with fuzz 1.
> 1 out of 4 hunks FAILED -- saving rejects to file arch/ia64/kernel/setup.c.rej
> patching file arch/ia64/kernel/signal.c
> Hunk #1 succeeded at 146 with fuzz 1.
> patching file arch/ia64/kernel/smpboot.c
> Hunk #1 FAILED at 1.
> Hunk #3 FAILED at 88.
> Hunk #5 FAILED at 278.
> Hunk #7 FAILED at 398.
> Hunk #9 FAILED at 459.
> Hunk #10 FAILED at 510.
> Hunk #12 FAILED at 567.
> 7 out of 12 hunks FAILED -- saving rejects to file arch/ia64/kernel/smpboot.c.rej
> patching file arch/ia64/kernel/sys_ia64.c
> Hunk #1 FAILED at 82.
> Hunk #2 FAILED at 135.
> 2 out of 2 hunks FAILED -- saving rejects to file arch/ia64/kernel/sys_ia64.c.rej
> patching file arch/ia64/kernel/time.c
> Hunk #1 FAILED at 41.
> Hunk #2 FAILED at 286.
> 2 out of 2 hunks FAILED -- saving rejects to file arch/ia64/kernel/time.c.rej
> patching file arch/ia64/kernel/traps.c
> Hunk #1 FAILED at 62.
> Hunk #3 succeeded at 130 with fuzz 2.
> Hunk #4 succeeded at 436 with fuzz 2.
> Hunk #6 FAILED at 516.
> Hunk #7 succeeded at 533 with fuzz 2.
> 2 out of 7 hunks FAILED -- saving rejects to file arch/ia64/kernel/traps.c.rej
> patching file arch/ia64/kernel/unwind.c
> Hunk #1 FAILED at 140.
> Hunk #2 FAILED at 189.
> Hunk #3 FAILED at 634.
> Hunk #4 FAILED at 814.
> 4 out of 4 hunks FAILED -- saving rejects to file arch/ia64/kernel/unwind.c.rej
> patching file arch/ia64/lib/Makefile
> Hunk #1 FAILED at 6.
> 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/lib/Makefile.rej
> patching file arch/ia64/lib/copy_user.S
> patching file arch/ia64/lib/io.c
> Hunk #1 succeeded at 87 with fuzz 1.
> Hunk #2 FAILED at 104.
> 1 out of 2 hunks FAILED -- saving rejects to file arch/ia64/lib/io.c.rej
> patching file arch/ia64/lib/memcpy_mck.S
> patching file arch/ia64/lib/swiotlb.c
> Hunk #1 FAILED at 415.
> Hunk #2 FAILED at 447.
> Hunk #3 FAILED at 469.
> 3 out of 3 hunks FAILED -- saving rejects to file arch/ia64/lib/swiotlb.c.rej
> patching file arch/ia64/mm/init.c
> Hunk #1 FAILED at 10.
> Hunk #3 succeeded at 86 with fuzz 2.
> Hunk #4 FAILED at 108.
> Hunk #5 FAILED at 162.
> 3 out of 5 hunks FAILED -- saving rejects to file arch/ia64/mm/init.c.rej
> patching file arch/ia64/mm/tlb.c
> Hunk #1 FAILED at 35.
> Hunk #2 succeeded at 51 with fuzz 2.
> Hunk #3 FAILED at 80.
> 2 out of 3 hunks FAILED -- saving rejects to file arch/ia64/mm/tlb.c.rej
> patching file arch/ia64/sn/io/ifconfig_net.c
> patching file arch/ia64/sn/io/pciba.c
> patching file arch/ia64/sn/io/sn1/hubcounters.c
> patching file arch/ia64/sn/io/sn1/pcibr.c
> patching file arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c
> patching file arch/ia64/sn/kernel/setup.c
> Hunk #2 FAILED at 170.
> 1 out of 2 hunks FAILED -- saving rejects to file arch/ia64/sn/kernel/setup.c.rej
> patching file arch/ia64/tools/Makefile
> patching file arch/ia64/vmlinux.lds.S
> patching file arch/parisc/kernel/traps.c
> patching file drivers/acpi/bus.c
> Hunk #1 succeeded at 2167 with fuzz 2.
> patching file drivers/acpi/osl.c
> Hunk #1 succeeded at 80 with fuzz 2.
> Hunk #2 FAILED at 177.
> Hunk #3 succeeded at 352 with fuzz 2.
> Hunk #4 succeeded at 397 with fuzz 2.
> 1 out of 4 hunks FAILED -- saving rejects to file drivers/acpi/osl.c.rej
> patching file drivers/acpi/pci_irq.c
> Hunk #1 FAILED at 33.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/acpi/pci_irq.c.rej
> patching file drivers/char/agp/agp.c
> Hunk #1 FAILED at 25.
> Hunk #2 FAILED at 34.
> Hunk #4 FAILED at 151.
> Hunk #6 FAILED at 205.
> Hunk #7 FAILED at 655.
> 5 out of 9 hunks FAILED -- saving rejects to file drivers/char/agp/agp.c.rej
> patching file drivers/char/agp/agp.h
> patching file drivers/char/agp/amd-agp.c
> Hunk #1 FAILED at 330.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/char/agp/amd-agp.c.rej
> patching file drivers/char/agp/hp-agp.c
> Hunk #1 FAILED at 43.
> Hunk #2 FAILED at 356.
> 2 out of 4 hunks FAILED -- saving rejects to file drivers/char/agp/hp-agp.c.rej
> patching file drivers/char/agp/i460-agp.c
> Hunk #1 succeeded at 4 with fuzz 2.
> Hunk #2 FAILED at 20.
> Hunk #3 FAILED at 126.
> Hunk #4 FAILED at 148.
> Hunk #5 FAILED at 165.
> Hunk #8 FAILED at 200.
> Hunk #9 FAILED at 242.
> 6 out of 9 hunks FAILED -- saving rejects to file drivers/char/agp/i460-agp.c.rej
> patching file drivers/char/agp/i810-agp.c
> Hunk #1 FAILED at 179.
> Hunk #2 FAILED at 247.
> Hunk #3 FAILED at 484.
> Hunk #4 FAILED at 545.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/char/agp/i810-agp.c.rej
> patching file drivers/char/agp/sworks-agp.c
> Hunk #1 FAILED at 405.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/char/agp/sworks-agp.c.rej
> patching file drivers/char/drm/ati_pcigart.h
> Hunk #1 FAILED at 30.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/char/drm/ati_pcigart.h.rej
> patching file drivers/char/drm/drmP.h
> Hunk #1 FAILED at 199.
> Hunk #2 FAILED at 226.
> 2 out of 3 hunks FAILED -- saving rejects to file drivers/char/drm/drmP.h.rej
> patching file drivers/char/drm/drm_bufs.h
> Hunk #1 FAILED at 107.
> Hunk #2 FAILED at 124.
> Hunk #3 FAILED at 245.
> 3 out of 3 hunks FAILED -- saving rejects to file drivers/char/drm/drm_bufs.h.rej
> patching file drivers/char/drm/drm_drv.h
> Hunk #1 FAILED at 423.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/char/drm/drm_drv.h.rej
> patching file drivers/char/drm/drm_memory.h
> Hunk #1 FAILED at 33.
> Hunk #2 FAILED at 294.
> Hunk #4 FAILED at 411.
> Hunk #6 FAILED at 444.
> 4 out of 6 hunks FAILED -- saving rejects to file drivers/char/drm/drm_memory.h.rej
> patching file drivers/char/drm/drm_vm.h
> Hunk #1 FAILED at 108.
> Hunk #2 FAILED at 207.
> Hunk #3 FAILED at 421.
> Hunk #4 FAILED at 441.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/char/drm/drm_vm.h.rej
> patching file drivers/char/drm/gamma_dma.c
> Hunk #1 FAILED at 638.
> Hunk #2 FAILED at 668.
> 2 out of 2 hunks FAILED -- saving rejects to file drivers/char/drm/gamma_dma.c.rej
> patching file drivers/char/drm/i810_dma.c
> Hunk #1 FAILED at 309.
> Hunk #2 FAILED at 323.
> Hunk #3 FAILED at 395.
> Hunk #4 FAILED at 448.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/char/drm/i810_dma.c.rej
> patching file drivers/char/drm/i830_dma.c
> Hunk #1 FAILED at 340.
> Hunk #2 FAILED at 354.
> Hunk #3 FAILED at 426.
> Hunk #4 FAILED at 483.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/char/drm/i830_dma.c.rej
> patching file drivers/char/drm/mga_dma.c
> Hunk #1 FAILED at 559.
> Hunk #2 FAILED at 649.
> 2 out of 2 hunks FAILED -- saving rejects to file drivers/char/drm/mga_dma.c.rej
> patching file drivers/char/drm/mga_drv.h
> Hunk #1 FAILED at 213.
> Hunk #2 FAILED at 224.
> Hunk #3 FAILED at 247.
> Hunk #4 FAILED at 276.
> Hunk #5 FAILED at 297.
> 5 out of 5 hunks FAILED -- saving rejects to file drivers/char/drm/mga_drv.h.rej
> patching file drivers/char/drm/mga_state.c
> Hunk #1 FAILED at 523.
> Hunk #2 FAILED at 617.
> Hunk #3 FAILED at 826.
> Hunk #4 FAILED at 1029.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/char/drm/mga_state.c.rej
> patching file drivers/char/drm/r128_cce.c
> Hunk #1 FAILED at 354.
> Hunk #2 FAILED at 552.
> Hunk #3 FAILED at 626.
> 3 out of 3 hunks FAILED -- saving rejects to file drivers/char/drm/r128_cce.c.rej
> patching file drivers/char/drm/r128_drv.h
> Hunk #1 succeeded at 436 with fuzz 1.
> patching file drivers/char/drm/radeon_cp.c
> Hunk #1 FAILED at 627.
> Hunk #2 FAILED at 844.
> Hunk #3 FAILED at 989.
> 3 out of 3 hunks FAILED -- saving rejects to file drivers/char/drm/radeon_cp.c.rej
> patching file drivers/char/drm/radeon_drv.h
> Hunk #1 succeeded at 657 with fuzz 1.
> patching file drivers/char/drm/radeon_state.c
> Hunk #1 FAILED at 327.
> Hunk #2 FAILED at 1507.
> Hunk #3 FAILED at 1759.
> Hunk #4 FAILED at 1870.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/char/drm/radeon_state.c.rej
> patching file drivers/char/mem.c
> Hunk #1 FAILED at 510.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/char/mem.c.rej
> patching file drivers/media/radio/Makefile
> patching file drivers/media/radio/dummy.c
> patching file drivers/media/video/Makefile
> patching file drivers/media/video/dummy.c
> patching file drivers/message/fusion/mptscsih.c
> Hunk #1 succeeded at 99 with fuzz 1.
> Hunk #2 FAILED at 1158.
> Hunk #3 succeeded at 1222 with fuzz 2.
> 1 out of 3 hunks FAILED -- saving rejects to file drivers/message/fusion/mptscsih.c.rejpatching file drivers/net/eepro100.c
> Hunk #1 succeeded at 25 with fuzz 2.
> Hunk #5 FAILED at 1240.
> Hunk #6 FAILED at 1634.
> Hunk #7 succeeded at 2320 with fuzz 1.
> 2 out of 7 hunks FAILED -- saving rejects to file drivers/net/eepro100.c.rej
> patching file drivers/net/tulip/media.c
> Hunk #1 FAILED at 278.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/net/tulip/media.c.rej
> patching file drivers/scsi/megaraid.c
> Hunk #1 FAILED at 2047.
> Hunk #2 FAILED at 3356.
> 2 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/megaraid.c.rej
> patching file drivers/scsi/scsi_ioctl.c
> Hunk #2 FAILED at 212.
> 1 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/scsi_ioctl.c.rej
> patching file drivers/scsi/sym53c8xx_2/sym_glue.c
> Reversed (or previously applied) patch detected! Assume -R? [n] n
> Apply anyway? [n] n
> Skipping patch.
> 1 out of 1 hunk ignored -- saving rejects to file drivers/scsi/sym53c8xx_2/sym_glue.c.rej
> patching file drivers/scsi/sym53c8xx_2/sym_malloc.c
> Hunk #1 succeeded at 143 with fuzz 2.
> patching file drivers/serial/8250.c
> patching file drivers/serial/Config.in
> patching file drivers/serial/Makefile
> patching file drivers/video/radeonfb.c
> Hunk #2 FAILED at 727.
> Hunk #3 FAILED at 857.
> 2 out of 3 hunks FAILED -- saving rejects to file drivers/video/radeonfb.c.rej
> patching file fs/fcntl.c
> Hunk #1 FAILED at 303.
> 1 out of 1 hunk FAILED -- saving rejects to file fs/fcntl.c.rej
> patching file fs/proc/base.c
> patching file include/asm-i386/hw_irq.h
> patching file include/asm-i386/ptrace.h
> Hunk #1 succeeded at 58 with fuzz 2.
> patching file include/asm-ia64/acpi.h
> patching file include/asm-ia64/agp.h
> patching file include/asm-ia64/bitops.h
> patching file include/asm-ia64/cacheflush.h
> Hunk #1 FAILED at 6.
> Hunk #2 FAILED at 25.
> 2 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/cacheflush.h.rej
> patching file include/asm-ia64/delay.h
> Hunk #1 FAILED at 53.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/delay.h.rej
> patching file include/asm-ia64/efi.h
> patching file include/asm-ia64/elf.h
> Hunk #1 succeeded at 2 with fuzz 1.
> patching file include/asm-ia64/hardirq.h
> Hunk #1 FAILED at 17.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/hardirq.h.rej
> patching file include/asm-ia64/hw_irq.h
> Hunk #1 FAILED at 2.
> 1 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/hw_irq.h.rej
> patching file include/asm-ia64/keyboard.h
> patching file include/asm-ia64/kregs.h
> Hunk #1 succeeded at 64 with fuzz 2.
> Hunk #2 FAILED at 94.
> Hunk #3 FAILED at 105.
> 2 out of 3 hunks FAILED -- saving rejects to file include/asm-ia64/kregs.h.rej
> patching file include/asm-ia64/machvec.h
> patching file include/asm-ia64/machvec_init.h
> Hunk #1 succeeded at 16 with fuzz 1.
> patching file include/asm-ia64/mmu_context.h
> Hunk #1 FAILED at 2.
> Hunk #2 FAILED at 13.
> Hunk #3 FAILED at 21.
> Hunk #6 FAILED at 72.
> 4 out of 7 hunks FAILED -- saving rejects to file include/asm-ia64/mmu_context.h.rej
> patching file include/asm-ia64/module.h
> Hunk #1 FAILED at 75.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/module.h.rej
> patching file include/asm-ia64/offsets.h
> patching file include/asm-ia64/page.h
> Hunk #1 FAILED at 87.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/page.h.rej
> patching file include/asm-ia64/param.h
> Hunk #1 FAILED at 4.
> 1 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/param.h.rej
> patching file include/asm-ia64/pci.h
> Hunk #2 FAILED at 90.
> 1 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/pci.h.rej
> patching file include/asm-ia64/perfmon.h
> patching file include/asm-ia64/pgalloc.h
> Hunk #1 FAILED at 15.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/pgalloc.h.rej
> patching file include/asm-ia64/processor.h
> Hunk #1 FAILED at 270.
> Hunk #2 FAILED at 280.
> 2 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/processor.h.rej
> patching file include/asm-ia64/rmap.h
> Hunk #1 FAILED at 1.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/rmap.h.rej
> patching file include/asm-ia64/scatterlist.h
> patching file include/asm-ia64/serial.h
> patching file include/asm-ia64/smp.h
> Hunk #1 FAILED at 17.
> Hunk #3 FAILED at 47.
> 2 out of 4 hunks FAILED -- saving rejects to file include/asm-ia64/smp.h.rej
> patching file include/asm-ia64/smplock.h
> Hunk #1 FAILED at 14.
> Hunk #2 FAILED at 21.
> 2 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/smplock.h.rej
> patching file include/asm-ia64/softirq.h
> Hunk #1 FAILED at 4.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/softirq.h.rej
> patching file include/asm-ia64/system.h
> Hunk #1 FAILED at 13.
> Hunk #2 succeeded at 104 with fuzz 2.
> Hunk #3 FAILED at 172.
> Hunk #5 FAILED at 368.
> Hunk #6 FAILED at 396.
> 4 out of 6 hunks FAILED -- saving rejects to file include/asm-ia64/system.h.rej
> patching file include/asm-ia64/tlb.h
> Hunk #1 FAILED at 1.
> 1 out of 1 hunk FAILED -- saving rejects to file include/asm-ia64/tlb.h.rej
> patching file include/asm-ia64/tlbflush.h
> Hunk #1 FAILED at 60.
> Hunk #2 FAILED at 72.
> 2 out of 2 hunks FAILED -- saving rejects to file include/asm-ia64/tlbflush.h.rej
> patching file include/asm-ia64/unistd.h
> Hunk #1 succeeded at 223 with fuzz 2.
> patching file include/linux/acpi_serial.h
> patching file include/linux/agp_backend.h
> patching file include/linux/fs.h
> Hunk #1 FAILED at 513.
> 1 out of 1 hunk FAILED -- saving rejects to file include/linux/fs.h.rej
> patching file include/linux/highmem.h
> Hunk #1 FAILED at 3.
> 1 out of 1 hunk FAILED -- saving rejects to file include/linux/highmem.h.rej
> patching file include/linux/irq.h
> Hunk #1 succeeded at 56 with fuzz 2.
> patching file include/linux/irq_cpustat.h
> patching file include/linux/kernel.h
> Hunk #1 succeeded at 37 with fuzz 2.
> patching file include/linux/mm.h
> patching file include/linux/mmzone.h
> patching file include/linux/page-flags.h
> Hunk #1 succeeded at 42 with fuzz 1.
> Hunk #2 FAILED at 230.
> 1 out of 2 hunks FAILED -- saving rejects to file include/linux/page-flags.h.rej
> patching file include/linux/percpu.h
> Hunk #1 FAILED at 2.
> 1 out of 1 hunk FAILED -- saving rejects to file include/linux/percpu.h.rej
> patching file include/linux/sched.h
> patching file include/linux/serial.h
> patching file include/linux/smp.h
> Hunk #1 FAILED at 57.
> 1 out of 2 hunks FAILED -- saving rejects to file include/linux/smp.h.rej
> patching file include/linux/vmalloc.h
> Hunk #1 succeeded at 8 with fuzz 1.
> patching file kernel/exec_domain.c
> Hunk #1 FAILED at 196.
> 1 out of 1 hunk FAILED -- saving rejects to file kernel/exec_domain.c.rej
> patching file kernel/fork.c
> Hunk #2 succeeded at 132 with fuzz 1.
> patching file kernel/ksyms.c
> patching file kernel/printk.c
> Hunk #1 FAILED at 16.
> Hunk #4 succeeded at 699 with fuzz 1.
> 1 out of 4 hunks FAILED -- saving rejects to file kernel/printk.c.rej
> patching file kernel/softirq.c
> Hunk #4 FAILED at 96.
> Hunk #7 FAILED at 416.
> 2 out of 7 hunks FAILED -- saving rejects to file kernel/softirq.c.rej
> patching file kernel/timer.c
> Hunk #1 FAILED at 886.
> Hunk #2 succeeded at 899 with fuzz 2.
> 1 out of 2 hunks FAILED -- saving rejects to file kernel/timer.c.rej
> patching file mm/bootmem.c
> Hunk #2 FAILED at 169.
> Hunk #3 FAILED at 183.
> Hunk #4 FAILED at 203.
> Hunk #5 FAILED at 263.
> 4 out of 5 hunks FAILED -- saving rejects to file mm/bootmem.c.rej
> patching file mm/memory.c
> Hunk #1 FAILED at 110.
> 1 out of 1 hunk FAILED -- saving rejects to file mm/memory.c.rej
> patching file mm/page_alloc.c
> Hunk #1 FAILED at 47.
> Hunk #2 FAILED at 497.
> Hunk #3 FAILED at 637.
> Hunk #4 FAILED at 684.
> Hunk #5 FAILED at 692.
> Hunk #6 FAILED at 807.
> 6 out of 6 hunks FAILED -- saving rejects to file mm/page_alloc.c.rej
> patching file mm/vmalloc.c
> Hunk #1 succeeded at 367 with fuzz 1.
> patching file sound/oss/cs4281/cs4281m.c
> Hunk #1 FAILED at 1942.
> Hunk #2 FAILED at 1978.
> Hunk #3 FAILED at 2011.
> Hunk #4 FAILED at 2045.
> Hunk #5 FAILED at 2177.
> Hunk #6 FAILED at 2742.
> Hunk #7 FAILED at 2823.
> Hunk #8 FAILED at 2870.
> Hunk #9 FAILED at 2893.
> Hunk #10 FAILED at 2950.
> Hunk #11 FAILED at 2969.
> Hunk #12 FAILED at 2985.
> Hunk #13 FAILED at 3041.
> Hunk #14 FAILED at 3162.
> Hunk #15 FAILED at 3198.
> Hunk #16 FAILED at 3206.
> Hunk #17 FAILED at 3592.
> Hunk #18 FAILED at 3627.
> Hunk #19 FAILED at 4337.
> Hunk #20 FAILED at 4385.
> Hunk #21 FAILED at 4441.
> 21 out of 21 hunks FAILED -- saving rejects to file sound/oss/cs4281/cs4281m.c.rej
> patching file sound/oss/cs4281/cs4281pm-24.c
> Hunk #1 FAILED at 38.
> 1 out of 2 hunks FAILED -- saving rejects to file sound/oss/cs4281/cs4281pm-24.c.rej
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-20 22:13 ` David Mosberger
@ 2002-08-20 22:45 ` Hanna Linder
0 siblings, 0 replies; 13+ messages in thread
From: Hanna Linder @ 2002-08-20 22:45 UTC (permalink / raw)
To: davidm; +Cc: David Mosberger, linux-kernel, linux-ia64
--On Tuesday, August 20, 2002 15:13:54 -0700 David Mosberger <davidm@napali.hpl.hp.com> wrote:
>
> Hanna> Should there have been another patch that would go before the
> Hanna> 2.5.30 test patch on top of a kernel.org clean 2.5.30 kernel?
> Hanna> It is not applying cleanly and before I dig into code Im not
> Hanna> very familiar with I thought I would ask here. Yes, this is
> Hanna> my first time on an ia64 system.
>
> The patch should be self-contained. Can you check whether your mailer
> perhaps auto-wrapped long lines?
>
> --david
>
I got it off the archives web site, that must have line wrapped.
Is there a place I could ftp it or could you mail it to me?
Thanks a lot.
Hanna
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
@ 2002-08-21 22:14 Hanna Linder
0 siblings, 0 replies; 13+ messages in thread
From: Hanna Linder @ 2002-08-21 22:14 UTC (permalink / raw)
To: greg, gregkh; +Cc: linux-kernel, linux-ia64, Hanna Linder
Included is the snia64 portion of the ia64 port of the
pci_ops structure cleanup change that Matt Dobson
originally did for i386.
Thanks to David Mosberger for sending me the 2.5.30
version of the ia64 port I have been able to compile
this patch and the previous one to verify they compile.
This applies cleanly to bk://linuxusb.bkbits.net/pci_hp-2.5
Hanna
---------
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.558 -> 1.559
# arch/ia64/sn/io/pci.c 1.3 -> 1.4
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/21 hlinder@w-hlinder.beaverton.ibm.com 1.559
# Port to ia64 of pci_ops cleanup
# --------------------------------------------
#
diff -Nru a/arch/ia64/sn/io/pci.c b/arch/ia64/sn/io/pci.c
--- a/arch/ia64/sn/io/pci.c Wed Aug 21 13:49:06 2002
+++ b/arch/ia64/sn/io/pci.c Wed Aug 21 13:49:06 2002
@@ -44,22 +44,21 @@
extern devfs_handle_t devfn_to_vertex(unsigned char bus, unsigned char devfn);
/*
- * snia64_read_config_byte - Read a byte from the config area of the device.
+ * snia64_read - Read from the config area of the device.
*/
-static int snia64_read_config_byte (struct pci_dev *dev,
- int where, unsigned char *val)
+static int snia64_read (struct pci_bus *bus, unsigned char devfn,
+ int where, int size, unsigned char *val)
{
unsigned long res = 0;
- unsigned size = 1;
devfs_handle_t device_vertex;
- if ( (dev == (struct pci_dev *)0) || (val == (unsigned char *)0) ) {
+ if ( (bus->dev == (struct pci_dev *)0) || (val == (unsigned char *)0) ) {
return PCIBIOS_DEVICE_NOT_FOUND;
}
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
+ device_vertex = devfn_to_vertex(bus->number, devfn);
if (!device_vertex) {
DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+ __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
return(-1);
}
res = pciio_config_get(device_vertex, (unsigned) where, size);
@@ -68,160 +67,38 @@
}
/*
- * snia64_read_config_word - Read 2 bytes from the config area of the device.
+ * snia64_write - Writes to the config area of the device.
*/
-static int snia64_read_config_word (struct pci_dev *dev,
- int where, unsigned short *val)
+static int snia64_write (struct pci_bus *bus, unsigned char devfn,
+ int where, int size, unsigned char val)
{
- unsigned long res = 0;
- unsigned size = 2; /* 2 bytes */
- devfs_handle_t device_vertex;
-
- if ( (dev == (struct pci_dev *)0) || (val == (unsigned short *)0) ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- res = pciio_config_get(device_vertex, (unsigned) where, size);
- *val = (unsigned short) res;
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_read_config_dword - Read 4 bytes from the config area of the device.
- */
-static int snia64_read_config_dword (struct pci_dev *dev,
- int where, unsigned int *val)
-{
- unsigned long res = 0;
- unsigned size = 4; /* 4 bytes */
devfs_handle_t device_vertex;
- if (where & 3) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if ( (dev == (struct pci_dev *)0) || (val == (unsigned int *)0) ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
-
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- res = pciio_config_get(device_vertex, (unsigned) where, size);
- *val = (unsigned int) res;
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_write_config_byte - Writes 1 byte to the config area of the device.
- */
-static int snia64_write_config_byte (struct pci_dev *dev,
- int where, unsigned char val)
-{
- devfs_handle_t device_vertex;
-
- if ( dev == (struct pci_dev *)0 ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- /*
- * if it's an IOC3 then we bail out, we special
- * case them with pci_fixup_ioc3
- */
- if (dev->vendor == PCI_VENDOR_ID_SGI &&
- dev->device == PCI_DEVICE_ID_SGI_IOC3 )
- return PCIBIOS_SUCCESSFUL;
-
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- pciio_config_set( device_vertex, (unsigned)where, 1, (uint64_t) val);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_write_config_word - Writes 2 bytes to the config area of the device.
- */
-static int snia64_write_config_word (struct pci_dev *dev,
- int where, unsigned short val)
-{
- devfs_handle_t device_vertex = NULL;
-
- if (where & 1) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if ( dev == (struct pci_dev *)0 ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- /*
- * if it's an IOC3 then we bail out, we special
- * case them with pci_fixup_ioc3
- */
- if (dev->vendor == PCI_VENDOR_ID_SGI &&
- dev->device == PCI_DEVICE_ID_SGI_IOC3)
- return PCIBIOS_SUCCESSFUL;
-
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- pciio_config_set( device_vertex, (unsigned)where, 2, (uint64_t) val);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_write_config_dword - Writes 4 bytes to the config area of the device.
- */
-static int snia64_write_config_dword (struct pci_dev *dev,
- int where, unsigned int val)
-{
- devfs_handle_t device_vertex;
-
- if (where & 3) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if ( dev == (struct pci_dev *)0 ) {
+ if ( bus->dev == (struct pci_dev *)0 ) {
return PCIBIOS_DEVICE_NOT_FOUND;
}
/*
* if it's an IOC3 then we bail out, we special
* case them with pci_fixup_ioc3
*/
- if (dev->vendor == PCI_VENDOR_ID_SGI &&
- dev->device == PCI_DEVICE_ID_SGI_IOC3)
+ if (bus->dev->vendor == PCI_VENDOR_ID_SGI &&
+ bus->dev->device == PCI_DEVICE_ID_SGI_IOC3 )
return PCIBIOS_SUCCESSFUL;
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
+ device_vertex = devfn_to_vertex(bus->number, devfn);
if (!device_vertex) {
DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+ __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
return(-1);
}
- pciio_config_set( device_vertex, (unsigned)where, 4, (uint64_t) val);
+ pciio_config_set( device_vertex, (unsigned)where, size, (uint64_t) val);
return PCIBIOS_SUCCESSFUL;
}
static struct pci_ops snia64_pci_ops = {
- snia64_read_config_byte,
- snia64_read_config_word,
- snia64_read_config_dword,
- snia64_write_config_byte,
- snia64_write_config_word,
- snia64_write_config_dword
+ .read = snia64_read,
+ .write = snia64_write,
};
/*
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
@ 2002-08-22 0:59 Hanna Linder
2002-08-22 3:10 ` Greg KH
2002-08-22 10:11 ` Gérard Roudier
0 siblings, 2 replies; 13+ messages in thread
From: Hanna Linder @ 2002-08-22 0:59 UTC (permalink / raw)
To: gregkh, greg; +Cc: linux-kernel, Hanna Linder
Here is the first part of the sh port of the pci_ops
changes. If anyone can compile this for Sega let me
know if there are any problems.
Thanks.
Hanna Linder
hannal@us.ibm.com
ps -this patches against bk://linuxusb.bkbits.net/pci_hp-2.5
-----
diff -Nru a/arch/sh/kernel/pci-dc.c b/arch/sh/kernel/pci-dc.c
--- a/arch/sh/kernel/pci-dc.c Wed Aug 21 17:55:02 2002
+++ b/arch/sh/kernel/pci-dc.c Wed Aug 21 17:55:02 2002
@@ -31,76 +31,58 @@
{0, 0, 0, NULL}
};
-#define BBA_SELECTED(dev) (dev->bus->number==0 && dev->devfn==0)
+#define BBA_SELECTED(bus,devfn) (bus->number==0 && devfn==0)
-static int gapspci_read_config_byte(struct pci_dev *dev, int where,
- u8 * val)
+static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
{
- if (BBA_SELECTED(dev))
- *val = inb(GAPSPCI_BBA_CONFIG+where);
- else
- *val = 0xff;
-
+ switch (size) {
+ case 1:
+ if (BBA_SELECTED(bus, devfn))
+ *val = (u8)inb(GAPSPCI_BBA_CONFIG+where);
+ else
+ *val = (u8)0xff;
+ break;
+ case 2:
+ if (BBA_SELECTED(bus, devfn))
+ *val = (u16)inw(GAPSPCI_BBA_CONFIG+where);
+ else
+ *val = (u16)0xffff;
+ break;
+ case 4:
+ if (BBA_SELECTED(bus, devfn))
+ *val = inl(GAPSPCI_BBA_CONFIG+where);
+ else
+ *val = 0xffffffff;
+ break;
+ }
return PCIBIOS_SUCCESSFUL;
}
-static int gapspci_read_config_word(struct pci_dev *dev, int where,
- u16 * val)
-{
- if (BBA_SELECTED(dev))
- *val = inw(GAPSPCI_BBA_CONFIG+where);
- else
- *val = 0xffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_read_config_dword(struct pci_dev *dev, int where,
- u32 * val)
-{
- if (BBA_SELECTED(dev))
- *val = inl(GAPSPCI_BBA_CONFIG+where);
- else
- *val = 0xffffffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_write_config_byte(struct pci_dev *dev, int where,
- u8 val)
-{
- if (BBA_SELECTED(dev))
- outb(val, GAPSPCI_BBA_CONFIG+where);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int gapspci_write_config_word(struct pci_dev *dev, int where,
- u16 val)
-{
- if (BBA_SELECTED(dev))
- outw(val, GAPSPCI_BBA_CONFIG+where);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_write_config_dword(struct pci_dev *dev, int where,
- u32 val)
+static int gapspci_write(struct pci_bus *bus, unsigned int devfn,
+ int where, u32 val)
{
- if (BBA_SELECTED(dev))
- outl(val, GAPSPCI_BBA_CONFIG+where);
-
- return PCIBIOS_SUCCESSFUL;
+ if (BBA_SELECTED(bus, devfn)) {
+ switch (size) {
+ case 1:
+ if (BBA_SELECTED(bus, devfn))
+ outb((u8)val, GAPSPCI_BBA_CONFIG+where);
+ break;
+ case 2:
+ if (BBA_SELECTED(bus, devfn))
+ outw((u16)val, GAPSPCI_BBA_CONFIG+where);
+ break;
+ case 4:
+ if (BBA_SELECTED(bus, devfn))
+ outl(val, GAPSPCI_BBA_CONFIG+where);
+ break;
+ }
+ }
+ return PCIBIOS_SUCCESSFUL;
}
static struct pci_ops pci_config_ops = {
- gapspci_read_config_byte,
- gapspci_read_config_word,
- gapspci_read_config_dword,
- gapspci_write_config_byte,
- gapspci_write_config_word,
- gapspci_write_config_dword
+ .read = gapspci_read,
+ .write = gapspci_write,
};
@@ -143,7 +125,7 @@
for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
dev = pci_dev_b(ln);
- if (!BBA_SELECTED(dev)) continue;
+ if (!BBA_SELECTED(bus, dev->devfn)) continue;
printk("PCI: MMIO fixup to %s\n", dev->name);
dev->resource[1].start=0x01001700;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-22 0:59 Hanna Linder
@ 2002-08-22 3:10 ` Greg KH
2002-08-22 10:11 ` Gérard Roudier
1 sibling, 0 replies; 13+ messages in thread
From: Greg KH @ 2002-08-22 3:10 UTC (permalink / raw)
To: Hanna Linder; +Cc: gregkh, linux-kernel
Minor comments:
On Wed, Aug 21, 2002 at 05:59:31PM -0700, Hanna Linder wrote:
> +static int gapspci_write(struct pci_bus *bus, unsigned int devfn,
> + int where, u32 val)
You forgot the size parameter.
> {
> - if (BBA_SELECTED(dev))
> - outl(val, GAPSPCI_BBA_CONFIG+where);
> -
> - return PCIBIOS_SUCCESSFUL;
> + if (BBA_SELECTED(bus, devfn)) {
> + switch (size) {
> + case 1:
> + if (BBA_SELECTED(bus, devfn))
> + outb((u8)val, GAPSPCI_BBA_CONFIG+where);
> + break;
> + case 2:
> + if (BBA_SELECTED(bus, devfn))
> + outw((u16)val, GAPSPCI_BBA_CONFIG+where);
> + break;
> + case 4:
> + if (BBA_SELECTED(bus, devfn))
> + outl(val, GAPSPCI_BBA_CONFIG+where);
> + break;
> + }
> + }
> + return PCIBIOS_SUCCESSFUL;
Your formatting is a bit off here (the case statements should be one
level to the right.)
Other than that, looks good.
thanks,
greg k-h
> }
>
> static struct pci_ops pci_config_ops = {
> - gapspci_read_config_byte,
> - gapspci_read_config_word,
> - gapspci_read_config_dword,
> - gapspci_write_config_byte,
> - gapspci_write_config_word,
> - gapspci_write_config_dword
> + .read = gapspci_read,
> + .write = gapspci_write,
> };
>
>
> @@ -143,7 +125,7 @@
>
> for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
> dev = pci_dev_b(ln);
> - if (!BBA_SELECTED(dev)) continue;
> + if (!BBA_SELECTED(bus, dev->devfn)) continue;
>
> printk("PCI: MMIO fixup to %s\n", dev->name);
> dev->resource[1].start=0x01001700;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-22 0:59 Hanna Linder
2002-08-22 3:10 ` Greg KH
@ 2002-08-22 10:11 ` Gérard Roudier
2002-08-22 15:42 ` Greg KH
1 sibling, 1 reply; 13+ messages in thread
From: Gérard Roudier @ 2002-08-22 10:11 UTC (permalink / raw)
To: Hanna Linder; +Cc: gregkh, greg, linux-kernel
On Wed, 21 Aug 2002, Hanna Linder wrote:
> Here is the first part of the sh port of the pci_ops
> changes. If anyone can compile this for Sega let me
> know if there are any problems.
The 'val' pointer is declared 'u32 *', then casted 'u8 *' or 'u16 *' if
needed. The compiler will not warn you. But user that wants to operate on
u8 or u16 has to cast the 'val' argument to 'u32 *' and should get a
warning from any decent C compiler. The normal C-way for such
'sorry-typed' argument is 'void *val', IMO.
Gérard.
> Thanks.
>
> Hanna Linder
> hannal@us.ibm.com
>
> ps -this patches against bk://linuxusb.bkbits.net/pci_hp-2.5
>
> -----
>
> diff -Nru a/arch/sh/kernel/pci-dc.c b/arch/sh/kernel/pci-dc.c
> --- a/arch/sh/kernel/pci-dc.c Wed Aug 21 17:55:02 2002
> +++ b/arch/sh/kernel/pci-dc.c Wed Aug 21 17:55:02 2002
> @@ -31,76 +31,58 @@
> {0, 0, 0, NULL}
> };
>
> -#define BBA_SELECTED(dev) (dev->bus->number==0 && dev->devfn==0)
> +#define BBA_SELECTED(bus,devfn) (bus->number==0 && devfn==0)
>
> -static int gapspci_read_config_byte(struct pci_dev *dev, int where,
> - u8 * val)
> +static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
> {
> - if (BBA_SELECTED(dev))
> - *val = inb(GAPSPCI_BBA_CONFIG+where);
> - else
> - *val = 0xff;
> -
> + switch (size) {
> + case 1:
> + if (BBA_SELECTED(bus, devfn))
> + *val = (u8)inb(GAPSPCI_BBA_CONFIG+where);
> + else
> + *val = (u8)0xff;
> + break;
> + case 2:
> + if (BBA_SELECTED(bus, devfn))
> + *val = (u16)inw(GAPSPCI_BBA_CONFIG+where);
> + else
> + *val = (u16)0xffff;
> + break;
> + case 4:
> + if (BBA_SELECTED(bus, devfn))
> + *val = inl(GAPSPCI_BBA_CONFIG+where);
> + else
> + *val = 0xffffffff;
> + break;
> + }
> return PCIBIOS_SUCCESSFUL;
> }
>
> -static int gapspci_read_config_word(struct pci_dev *dev, int where,
> - u16 * val)
> -{
> - if (BBA_SELECTED(dev))
> - *val = inw(GAPSPCI_BBA_CONFIG+where);
> - else
> - *val = 0xffff;
> -
> - return PCIBIOS_SUCCESSFUL;
> -}
> -
> -static int gapspci_read_config_dword(struct pci_dev *dev, int where,
> - u32 * val)
> -{
> - if (BBA_SELECTED(dev))
> - *val = inl(GAPSPCI_BBA_CONFIG+where);
> - else
> - *val = 0xffffffff;
> -
> - return PCIBIOS_SUCCESSFUL;
> -}
> -
> -static int gapspci_write_config_byte(struct pci_dev *dev, int where,
> - u8 val)
> -{
> - if (BBA_SELECTED(dev))
> - outb(val, GAPSPCI_BBA_CONFIG+where);
> -
> - return PCIBIOS_SUCCESSFUL;
> -}
> -
> -
> -static int gapspci_write_config_word(struct pci_dev *dev, int where,
> - u16 val)
> -{
> - if (BBA_SELECTED(dev))
> - outw(val, GAPSPCI_BBA_CONFIG+where);
> -
> - return PCIBIOS_SUCCESSFUL;
> -}
> -
> -static int gapspci_write_config_dword(struct pci_dev *dev, int where,
> - u32 val)
> +static int gapspci_write(struct pci_bus *bus, unsigned int devfn,
> + int where, u32 val)
> {
> - if (BBA_SELECTED(dev))
> - outl(val, GAPSPCI_BBA_CONFIG+where);
> -
> - return PCIBIOS_SUCCESSFUL;
> + if (BBA_SELECTED(bus, devfn)) {
> + switch (size) {
> + case 1:
> + if (BBA_SELECTED(bus, devfn))
> + outb((u8)val, GAPSPCI_BBA_CONFIG+where);
> + break;
> + case 2:
> + if (BBA_SELECTED(bus, devfn))
> + outw((u16)val, GAPSPCI_BBA_CONFIG+where);
> + break;
> + case 4:
> + if (BBA_SELECTED(bus, devfn))
> + outl(val, GAPSPCI_BBA_CONFIG+where);
> + break;
> + }
> + }
> + return PCIBIOS_SUCCESSFUL;
> }
>
> static struct pci_ops pci_config_ops = {
> - gapspci_read_config_byte,
> - gapspci_read_config_word,
> - gapspci_read_config_dword,
> - gapspci_write_config_byte,
> - gapspci_write_config_word,
> - gapspci_write_config_dword
> + .read = gapspci_read,
> + .write = gapspci_write,
> };
>
>
> @@ -143,7 +125,7 @@
>
> for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
> dev = pci_dev_b(ln);
> - if (!BBA_SELECTED(dev)) continue;
> + if (!BBA_SELECTED(bus, dev->devfn)) continue;
>
> printk("PCI: MMIO fixup to %s\n", dev->name);
> dev->resource[1].start=0x01001700;
>
> -
> 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/
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
2002-08-22 10:11 ` Gérard Roudier
@ 2002-08-22 15:42 ` Greg KH
0 siblings, 0 replies; 13+ messages in thread
From: Greg KH @ 2002-08-22 15:42 UTC (permalink / raw)
To: Gérard Roudier; +Cc: Hanna Linder, greg, linux-kernel
On Thu, Aug 22, 2002 at 12:11:41PM +0200, Gérard Roudier wrote:
>
>
> On Wed, 21 Aug 2002, Hanna Linder wrote:
>
> > Here is the first part of the sh port of the pci_ops
> > changes. If anyone can compile this for Sega let me
> > know if there are any problems.
>
> The 'val' pointer is declared 'u32 *', then casted 'u8 *' or 'u16 *' if
> needed. The compiler will not warn you. But user that wants to operate on
> u8 or u16 has to cast the 'val' argument to 'u32 *' and should get a
> warning from any decent C compiler. The normal C-way for such
> 'sorry-typed' argument is 'void *val', IMO.
We are filling up a u32 here (see the previous patches), so leaving this
as a u32 * and casting for the other sizes makes sense in this
situation.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: PCI Cleanup
@ 2002-08-22 23:54 Hanna Linder
0 siblings, 0 replies; 13+ messages in thread
From: Hanna Linder @ 2002-08-22 23:54 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Hanna Linder
One more file in sh arch ported to the new pci_ops changes.
This will apply agains bk://linuxusb.bkbits.net/pci_hp-2.5
(roughly 2.5.31).
Hanna
-----
diff -Nru a/arch/sh/kernel/pci-sh7751.c b/arch/sh/kernel/pci-sh7751.c
--- a/arch/sh/kernel/pci-sh7751.c Thu Aug 22 16:49:52 2002
+++ b/arch/sh/kernel/pci-sh7751.c Thu Aug 22 16:49:52 2002
@@ -41,14 +41,14 @@
#ifdef CONFIG_PCI_DIRECT
-#define CONFIG_CMD(dev, where) (0x80000000 | (dev->bus->number << 16) | (dev->devfn << 8) | (where & ~3))
+#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
#define PCI_REG(reg) (SH7751_PCIREG_BASE+reg)
/*
* Functions for accessing PCI configuration space with type 1 accesses
*/
-static int pci_conf1_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+static int pci_conf1_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
u32 word;
unsigned long flags;
@@ -57,144 +57,88 @@
* so we must do byte alignment by hand
*/
save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
+ outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
word = inl(PCI_REG(SH7751_PCIPDR));
restore_flags(flags);
- switch (where & 0x3) {
- case 3:
- *value = (u8)(word >> 24);
- break;
- case 2:
- *value = (u8)(word >> 16);
- break;
- case 1:
- *value = (u8)(word >> 8);
- break;
- default:
- *value = (u8)word;
- break;
- }
- PCIDBG(4,"pci_conf1_read_config_byte@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),*value);
- return PCIBIOS_SUCCESSFUL;
-}
-static int pci_conf1_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- u32 word;
- unsigned long flags;
-
- /* PCIPDR may only be accessed as 32 bit words,
- * so we must do word alignment by hand
- */
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- word = inl(PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- switch (where & 0x3) {
- case 3:
- // This should never happen...
- printk(KERN_ERR "PCI BIOS: read_config_word: Illegal u16 alignment");
- return PCIBIOS_BAD_REGISTER_NUMBER;
- case 2:
- *value = (u16)(word >> 16);
- break;
+ switch (size) {
case 1:
- *value = (u16)(word >> 8);
- break;
- default:
- *value = (u16)word;
+ switch (where & 0x3) {
+ case 3:
+ *value = (u8)(word >> 24);
+ break;
+ case 2:
+ *value = (u8)(word >> 16);
+ break;
+ case 1:
+ *value = (u8)(word >> 8);
+ break;
+ default:
+ *value = (u8)word;
+ break;
+ }
+ case 2:
+ switch (where & 0x3) {
+ case 3: /*This should never happen.*/
+ printk(KERN_ERR "PCI BIOS: read_config: Illegal u16 alignment");
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ case 2:
+ *value = (u16)(word >> 16);
+ break;
+ case 1:
+ *value = (u16)(word >> 8);
+ break;
+ default:
+ *value = (u16)word;
+ break;
+ }
+ case 4:
+ *value = word;
break;
- }
- PCIDBG(4,"pci_conf1_read_config_word@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),*value);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_conf1_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long flags;
-
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- *value = inl(PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- PCIDBG(4,"pci_conf1_read_config_dword@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),*value);
+ }
+ PCIDBG(4,"pci_conf1_read@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),*value);
return PCIBIOS_SUCCESSFUL;
}
-static int pci_conf1_write_config_byte(struct pci_dev *dev, int where, u8 value)
+/*
+ * Since SH7751 only does 32bit access we'll have to do a read,mask,write operation.
+ * We'll allow an odd byte offset, though it should be illegal.
+ */
+static int pci_conf1_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- u32 word;
- u32 shift = (where & 3) * 8;
- u32 mask = ((1 << 8) - 1) << shift; // create the byte mask
+ u32 word,mask;
unsigned long flags;
-
- /* Since SH7751 only does 32bit access we'll have to do a
- * read,mask,write operation
- */
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- word = inl(PCI_REG(SH7751_PCIPDR)) ;
- word &= ~mask;
- word |= value << shift;
-
- outl(word, PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- PCIDBG(4,"pci_conf1_write_config_byte@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),word);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_conf1_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- u32 word;
u32 shift = (where & 3) * 8;
- u32 mask = ((1 << 16) - 1) << shift; // create the word mask
- unsigned long flags;
- /* Since SH7751 only does 32bit access we'll have to do a
- * read,mask,write operation. We'll allow an odd byte offset,
- * though it should be illegal.
- */
- if (shift == 24)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
+ if(size == 1) {
+ mask = ((1 << 8) - 1) << shift; // create the byte mask
+ } else if(size == 2){
+ if(shift == 24)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ mask = ((1 << 16) - 1) << shift; // create the word mask
+ }
+ save_and_cli(flags);
+ outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
+ if(size == 4){
+ outl(value, PCI_REG(SH7751_PCIPDR));
+ restore_flags(flags);
+ PCIDBG(4,"pci_conf1_write@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),value);
+ return PCIBIOS_SUCCESSFUL;
+ }
word = inl(PCI_REG(SH7751_PCIPDR)) ;
word &= ~mask;
word |= value << shift;
-
- outl(value, PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- PCIDBG(4,"pci_conf1_write_config_word@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),word);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_conf1_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- unsigned long flags;
-
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- outl(value, PCI_REG(SH7751_PCIPDR));
+ outl(word, PCI_REG(SH7751_PCIPDR));
restore_flags(flags);
- PCIDBG(4,"pci_conf1_write_config_dword@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),value);
+ PCIDBG(4,"pci_conf1_write@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),word);
return PCIBIOS_SUCCESSFUL;
}
#undef CONFIG_CMD
static struct pci_ops pci_direct_conf1 = {
- pci_conf1_read_config_byte,
- pci_conf1_read_config_word,
- pci_conf1_read_config_dword,
- pci_conf1_write_config_byte,
- pci_conf1_write_config_word,
- pci_conf1_write_config_dword
+ .read = pci_conf1_read,
+ .write = pci_conf1_write,
};
struct pci_ops * __init pci_check_direct(void)
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2002-08-22 23:45 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-20 17:58 PCI Cleanup Hanna Linder
2002-08-20 18:00 ` David Mosberger
2002-08-20 18:30 ` Hanna Linder
2002-08-20 18:44 ` David Mosberger
2002-08-20 22:14 ` Hanna Linder
2002-08-20 22:13 ` David Mosberger
2002-08-20 22:45 ` Hanna Linder
-- strict thread matches above, loose matches on Subject: below --
2002-08-21 22:14 Hanna Linder
2002-08-22 0:59 Hanna Linder
2002-08-22 3:10 ` Greg KH
2002-08-22 10:11 ` Gérard Roudier
2002-08-22 15:42 ` Greg KH
2002-08-22 23:54 Hanna Linder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox