lkml.org 
[lkml]   [1999]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 2.2.0-pre7ac2 PCI probing fails


On 14 Jan 1999, Frode Vatvedt Fjeld wrote:

>
> As I have previously reported, probing the PCI bus with direct access
> enabled fails on a machine we have here. The problem appears to be a
> particular device that causes everything to hang when probed. This
> occurs in pci.c/pci_scan_bus() under the comment "non-destructively
> determine if device can be a master:". The second
> pcibios_read_config_byte() never returns, for some reason.

I would suspect that byte writes to the PCI command register (which is
defined as 16 bit word register) end up locking the PCI bus and/or the
device, so the sequence is probably the following:

pcibios_read_config_byte works
pcibios_write_config_byte is posted/queued/retried/whatever but never
actually performed
then the following read_config_byte can't be performed

Does the following patch (use 16 bit access to the PCI command register
solve your problems), I'm not sure it is the solution but it sounds
as a reasonable workaround (still waiting for my PCI specs).

Gabriel.

--- linux-2.2.0/drivers/pci/pci.c.pristine Thu Jan 14 23:05:04 1999
+++ linux-2.2.0/drivers/pci/pci.c Thu Jan 14 23:11:16 1999
@@ -159,7 +159,8 @@
__initfunc(unsigned int pci_scan_bus(struct pci_bus *bus))
{
unsigned int devfn, l, max, class;
- unsigned char cmd, irq, tmp, hdr_type, is_multi = 0;
+ unsigned char irq, hdr_type, is_multi = 0;
+ unsigned short cmd, tmp;
struct pci_dev *dev, **bus_last;
struct pci_bus *child;

@@ -191,11 +192,11 @@
dev->device = (l >> 16) & 0xffff;

/* non-destructively determine if device can be a master: */
- pcibios_read_config_byte(bus->number, devfn, PCI_COMMAND, &cmd);
- pcibios_write_config_byte(bus->number, devfn, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
- pcibios_read_config_byte(bus->number, devfn, PCI_COMMAND, &tmp);
+ pcibios_read_config_word(bus->number, devfn, PCI_COMMAND, &cmd);
+ pcibios_write_config_word(bus->number, devfn, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
+ pcibios_read_config_word(bus->number, devfn, PCI_COMMAND, &tmp);
dev->master = ((tmp & PCI_COMMAND_MASTER) != 0);
- pcibios_write_config_byte(bus->number, devfn, PCI_COMMAND, cmd);
+ pcibios_write_config_word(bus->number, devfn, PCI_COMMAND, cmd);

pcibios_read_config_dword(bus->number, devfn, PCI_CLASS_REVISION, &class);
class >>= 8; /* upper 3 bytes */



-
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:49    [W:0.133 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site