lkml.org 
[lkml]   [1999]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] 2.3.30pre3 alpha updates
2.3.30pre3 doesn't boot anymore on my Alpha.

There are two showstoppers:

o sysdata is not set for PCI bridges
o the IO address space is larger than 0xffff with the 21272
Tsunami PCI chip (precisely it's 32mbyte large) so some device gets
booted by the SRM with an I/O base address after 0xffff and so our
pdev_assign_unassigned_resources() can't find a root for the
device via pci_find_parent_resource() and so the resources
gets not allocated for the device

The sysdata gets fixed by allowing the the devices and bridges of a bus to
inerith the bus->sysdata that we provided to pci_scan_bus(). This avoid us
to do ugly stuff too. I don't see why sparc gets broken by this as sparc
always overwrite all the sysdata and it seems it never check for null
after reading it. So IMHO sparc and sparc64 should be just fine even with
the natural way to set the sysdata inside pci.c. Setting the sysdata in
the common code make sense to me as the sysdata should be a per-PCI bus
information and as all pci devices and bridges that we find in the
pci_scan_bus path are effectively beloging to such pci bus it make sense
they also share the same sysdata info. And if somebody needs different
sysdata per device and per bridge he can simply overwrite it in the arch
spec section. Actually the sysdata remains NULL. Having a NULL sysdata or
a sysdata set to the `void * sysdata' that we passed as parameter to
pci_scan_bus() make no difference at all as he knows the `void * sysdata'
value in the arch section. Can somebody with a Sparc try to run 2.3.30pre3
+ my patch attached and see if it works fine or not?

IMHO in the worst case an #ifndef __sparc__ (or an #ifdef __alpha__)
around the two sysdata assignment in pci.c would be less ugly that what
alpha is doing in 2.3.30pre3 to overcome the lack of sysdata assignment
before calling the pci controler operations.

The iospace problem gets fixed by setting correctly the iospace range of
the tsunami chip. I quote the specs:

-------------------------------------------------------------------------
Pchip0 PCI I/O 32MB 801.FC00.0000-801.FDFF.FFFF Linear Addressing
-------------------------------------------------------------------------

With this patch against 2.3.30pre3 I can boot the machine again:

diff -urN 2.3.30pre3/arch/alpha/kernel/core_mcpcia.c 2.3.30pre3-alpha/arch/alpha/kernel/core_mcpcia.c
--- 2.3.30pre3/arch/alpha/kernel/core_mcpcia.c Sun Nov 28 02:18:59 1999
+++ 2.3.30pre3-alpha/arch/alpha/kernel/core_mcpcia.c Sun Nov 28 02:19:05 1999
@@ -205,7 +205,7 @@
static int
mcpcia_read_config_byte(struct pci_dev *dev, int where, u8 *value)
{
- struct pci_controler *hose = dev->sysdata ? : probing_hose;
+ struct pci_controler *hose = dev->sysdata;
unsigned long addr, w;
unsigned char type1;

@@ -221,7 +221,7 @@
static int
mcpcia_read_config_word(struct pci_dev *dev, int where, u16 *value)
{
- struct pci_controler *hose = dev->sysdata ? : probing_hose;
+ struct pci_controler *hose = dev->sysdata;
unsigned long addr, w;
unsigned char type1;

@@ -237,7 +237,7 @@
static int
mcpcia_read_config_dword(struct pci_dev *dev, int where, u32 *value)
{
- struct pci_controler *hose = dev->sysdata ? : probing_hose;
+ struct pci_controler *hose = dev->sysdata;
unsigned long addr;
unsigned char type1;

@@ -252,7 +252,7 @@
static int
mcpcia_write_config(struct pci_dev *dev, int where, u32 value, long mask)
{
- struct pci_controler *hose = dev->sysdata ? : probing_hose;
+ struct pci_controler *hose = dev->sysdata;
unsigned long addr;
unsigned char type1;

diff -urN 2.3.30pre3/arch/alpha/kernel/core_tsunami.c 2.3.30pre3-alpha/arch/alpha/kernel/core_tsunami.c
--- 2.3.30pre3/arch/alpha/kernel/core_tsunami.c Sun Nov 28 02:18:59 1999
+++ 2.3.30pre3-alpha/arch/alpha/kernel/core_tsunami.c Sun Nov 28 03:31:12 1999
@@ -84,7 +84,7 @@
mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
unsigned char *type1)
{
- struct pci_controler *hose = dev->sysdata ? : probing_hose;
+ struct pci_controler *hose = dev->sysdata;
unsigned long addr;
u8 bus = dev->bus->number;
u8 device_fn = dev->devfn;
@@ -264,7 +264,7 @@
hose->index = index;

hose->io_space->start = TSUNAMI_IO(index) - TSUNAMI_IO_BIAS;
- hose->io_space->end = hose->io_space->start + 0xffff;
+ hose->io_space->end = hose->io_space->start + TSUNAMI_IO_SPACE;
hose->io_space->name = pci_io_names[index];
hose->io_space->flags = IORESOURCE_IO;

diff -urN 2.3.30pre3/arch/alpha/kernel/pci.c 2.3.30pre3-alpha/arch/alpha/kernel/pci.c
--- 2.3.30pre3/arch/alpha/kernel/pci.c Sun Nov 28 01:53:25 1999
+++ 2.3.30pre3-alpha/arch/alpha/kernel/pci.c Sun Nov 28 02:48:03 1999
@@ -40,7 +40,6 @@
*/

struct pci_controler *hose_head, **hose_tail = &hose_head;
-struct pci_controler *probing_hose;

/*
* Quirks.
@@ -213,13 +212,12 @@
{
/* Propogate hose info into the subordinate devices. */

- struct pci_controler *hose = probing_hose;
+ struct pci_controler *hose = (struct pci_controler *) bus->sysdata;
struct pci_dev *dev;

bus->resource[0] = hose->io_space;
bus->resource[1] = hose->mem_space;
for (dev = bus->devices; dev; dev = dev->sibling) {
- dev->sysdata = hose;
if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
pcibios_fixup_device_resources(dev, bus);
}
@@ -297,13 +295,11 @@
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
hose->first_busno = next_busno;
hose->last_busno = 0xff;
- probing_hose = hose;
bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);
hose->bus = bus;
next_busno = hose->last_busno = bus->subordinate;
next_busno += 1;
}
- probing_hose = NULL;

pci_assign_unassigned_resources(alpha_mv.min_io_address,
alpha_mv.min_mem_address);
diff -urN 2.3.30pre3/arch/alpha/kernel/pci_impl.h 2.3.30pre3-alpha/arch/alpha/kernel/pci_impl.h
--- 2.3.30pre3/arch/alpha/kernel/pci_impl.h Sun Nov 28 01:53:25 1999
+++ 2.3.30pre3-alpha/arch/alpha/kernel/pci_impl.h Sun Nov 28 02:18:37 1999
@@ -125,7 +125,6 @@

/* The hose list. */
extern struct pci_controler *hose_head, **hose_tail;
-extern struct pci_controler *probing_hose;

extern void common_init_pci(void);
extern u8 common_swizzle(struct pci_dev *, u8 *);
diff -urN 2.3.30pre3/drivers/pci/pci.c 2.3.30pre3-alpha/drivers/pci/pci.c
--- 2.3.30pre3/drivers/pci/pci.c Sun Nov 28 02:18:59 1999
+++ 2.3.30pre3-alpha/drivers/pci/pci.c Sun Nov 28 02:19:05 1999
@@ -437,6 +437,7 @@
dev = dev_cache;
memset(dev, 0, sizeof(*dev));
dev->bus = bus;
+ dev->sysdata = bus->sysdata;
dev->devfn = devfn;

if (pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type))
@@ -556,6 +557,7 @@
child->self = dev;
child->parent = bus;
child->ops = bus->ops;
+ child->sysdata = bus->sysdata;

/*
* Set up the primary, secondary and subordinate
diff -urN 2.3.30pre3/include/asm-alpha/core_tsunami.h 2.3.30pre3-alpha/include/asm-alpha/core_tsunami.h
--- 2.3.30pre3/include/asm-alpha/core_tsunami.h Sun Nov 28 01:53:26 1999
+++ 2.3.30pre3-alpha/include/asm-alpha/core_tsunami.h Sun Nov 28 03:30:57 1999
@@ -291,6 +291,8 @@
#define TSUNAMI_IO_BIAS TSUNAMI_IO(0)
#define TSUNAMI_MEM_BIAS TSUNAMI_MEM(0)

+/* The IO address space is larger than 0xffff */
+#define TSUNAMI_IO_SPACE (TSUNAMI_CONF(0) - TSUNAMI_IO(0))

/*
* Data structure for handling TSUNAMI machine checks:
Downloadable from here too:

ftp://ftp.*.kernel.org/pub/linux/kernel/people/andrea/patches/v2.3/2.3.30pre3/alpha-1.gz

Andrea


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

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.546 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site