diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2006-11-22 18:00:42 -0500 |
---|---|---|
committer | Francois Romieu <romieu@electric-eye.fr.zoreil.com> | 2006-12-03 18:42:40 -0500 |
commit | d03902b8864d7814c938f67befade5a3bba68708 (patch) | |
tree | c68791287e5010d709ad2ff87905cb8286899c6f /drivers/net/r8169.c | |
parent | 9cb427b6ff0b3e235c518acf5c1fcbbfc95f0ae2 (diff) |
r8169: tweak the PCI data parity error recovery
The 8110SB based n2100 board signals a lot of what ought to be
PCI data parity errors durint operation of the 8169 as target.
Experiment proved that the driver can ignore the error and
process the packet as if nothing had happened.
Let's add an ad-hoc knob to enable users to fix their system while
avoiding the risks of a wholesale change.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index c8fa9b1b2290..7438049ca6d8 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -225,6 +225,7 @@ MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl); | |||
225 | 225 | ||
226 | static int rx_copybreak = 200; | 226 | static int rx_copybreak = 200; |
227 | static int use_dac; | 227 | static int use_dac; |
228 | static int ignore_parity_err; | ||
228 | static struct { | 229 | static struct { |
229 | u32 msg_enable; | 230 | u32 msg_enable; |
230 | } debug = { -1 }; | 231 | } debug = { -1 }; |
@@ -469,6 +470,8 @@ module_param(use_dac, int, 0); | |||
469 | MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot."); | 470 | MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot."); |
470 | module_param_named(debug, debug.msg_enable, int, 0); | 471 | module_param_named(debug, debug.msg_enable, int, 0); |
471 | MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)"); | 472 | MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)"); |
473 | module_param_named(ignore_parity_err, ignore_parity_err, bool, 0); | ||
474 | MODULE_PARM_DESC(ignore_parity_err, "Ignore PCI parity error as target. Default: false"); | ||
472 | MODULE_LICENSE("GPL"); | 475 | MODULE_LICENSE("GPL"); |
473 | MODULE_VERSION(RTL8169_VERSION); | 476 | MODULE_VERSION(RTL8169_VERSION); |
474 | 477 | ||
@@ -2380,12 +2383,17 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev) | |||
2380 | /* | 2383 | /* |
2381 | * The recovery sequence below admits a very elaborated explanation: | 2384 | * The recovery sequence below admits a very elaborated explanation: |
2382 | * - it seems to work; | 2385 | * - it seems to work; |
2383 | * - I did not see what else could be done. | 2386 | * - I did not see what else could be done; |
2387 | * - it makes iop3xx happy. | ||
2384 | * | 2388 | * |
2385 | * Feel free to adjust to your needs. | 2389 | * Feel free to adjust to your needs. |
2386 | */ | 2390 | */ |
2387 | pci_write_config_word(pdev, PCI_COMMAND, | 2391 | if (ignore_parity_err) |
2388 | pci_cmd | PCI_COMMAND_SERR | PCI_COMMAND_PARITY); | 2392 | pci_cmd &= ~PCI_COMMAND_PARITY; |
2393 | else | ||
2394 | pci_cmd |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY; | ||
2395 | |||
2396 | pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); | ||
2389 | 2397 | ||
2390 | pci_write_config_word(pdev, PCI_STATUS, | 2398 | pci_write_config_word(pdev, PCI_STATUS, |
2391 | pci_status & (PCI_STATUS_DETECTED_PARITY | | 2399 | pci_status & (PCI_STATUS_DETECTED_PARITY | |
@@ -2399,10 +2407,11 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev) | |||
2399 | tp->cp_cmd &= ~PCIDAC; | 2407 | tp->cp_cmd &= ~PCIDAC; |
2400 | RTL_W16(CPlusCmd, tp->cp_cmd); | 2408 | RTL_W16(CPlusCmd, tp->cp_cmd); |
2401 | dev->features &= ~NETIF_F_HIGHDMA; | 2409 | dev->features &= ~NETIF_F_HIGHDMA; |
2402 | rtl8169_schedule_work(dev, rtl8169_reinit_task); | ||
2403 | } | 2410 | } |
2404 | 2411 | ||
2405 | rtl8169_hw_reset(ioaddr); | 2412 | rtl8169_hw_reset(ioaddr); |
2413 | |||
2414 | rtl8169_schedule_work(dev, rtl8169_reinit_task); | ||
2406 | } | 2415 | } |
2407 | 2416 | ||
2408 | static void | 2417 | static void |