[tulip] RE: tulip digest, Vol 1 #478 - Lynksys LNE100TX

Donald Becker becker@scyld.com
Tue Feb 19 15:19:01 2002


On Tue, 19 Feb 2002, Robert Ludwig wrote:

> Date: Tue, 19 Feb 2002 12:41:58 -0600
> From: Robert Ludwig <RobertL@ekcinc.com>
> To: "Lynux Tulip Driver List (E-mail)" <tulip@scyld.com>
> Cc: motih@cisco.com
> Subject: [tulip] RE: tulip digest, Vol 1 #478 - Lynksys LNE100TX
> 
> >> >> Instead I attempted to reset the bit when the "PCI
> >> >> Fatal Error" message is issued.  Based on the way the code acted, the
> >> >> "Parity Error Response" was not set, yet the error continued to be
> posted.
> >> I'm not sure that I've  completely understood all the steps you've taken
> >> but when such an error occurs one has to clear the error bits in the PCI
> >> status
> >> register of the device (by writing "1" to the appropriate bits (same as
> when
> >> clearing
> >> CSR5 interrupt bits))and then clear CSR5. failing to do so will cause the
> >> device to reissue its PCI error "message".
> 
> >> can you please send me the changes you've done that didn't work ?
> 
> >> Moti H.
> 
> Since the change didn't work, I remove the change and didn't save it.
> Basically the changed consisted of adding code behind the:
> 
> 	printk(KERN_ERR, "%s: PCI Fatal Error ...
> 
> message to read the PCI command register.  If the "Parity Error Response"
> bit was 1, I wrote the PCI command register with the "Parity Error Response"
> bit set to 1 (all other bits set to zero) to turn off "Parity Error
> Response".  Based on the messages I included in the change, the "Parity
> Error Response" bit had to be zero at the time the "PCI Fatal Error" message
> was issued.  Unless, I used the functions to read and write the PCI
> registers incorrectly, I did nothing with the "PCI Status Register" or with
> CSR5.

The Tulip driver does this in several places:
	if (tulip_tbl[chip_idx].flags & HAS_PWRDWN)
		pci_write_config_dword(pdev, 0x40, 0x00000000);

This writes to a special, non-standard register in PCI configuration space.
You can use similar code to read and write the PCI command register on
a PCI error.

Note that I used an explicit numeric offset above.  You can use a
symbolic offset for standard registers.

	 pci_write_config_word(pdev, PCI_COMMAND, pcicmd | PCI_COMMAND_PARITY);

You should report the PCI command register state and status after a PCI error:
	  printk("%s: PCI error information: status %4.4x command %4.4x.\n",
		dev,
		pci_read_config_word(pdev, PCI_STATUS),
		pci_read_config_word(pdev, PCI_COMMAND));


Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Second Generation Beowulf Clusters
Annapolis MD 21403			410-990-9993