Module Name: src Committed By: dyoung Date: Tue Feb 23 19:28:00 UTC 2010
Modified Files: src/sys/dev/cardbus: cardbus.c cardbusvar.h src/sys/dev/pci: pci.c pcireg.h pcivar.h Log Message: Remove unused functions pci_disable_retry() and cardbus_disable_retry(). To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/sys/dev/cardbus/cardbus.c cvs rdiff -u -r1.44 -r1.45 src/sys/dev/cardbus/cardbusvar.h cvs rdiff -u -r1.125 -r1.126 src/sys/dev/pci/pci.c cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/pcireg.h cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/pcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/cardbus/cardbus.c diff -u src/sys/dev/cardbus/cardbus.c:1.99 src/sys/dev/cardbus/cardbus.c:1.100 --- src/sys/dev/cardbus/cardbus.c:1.99 Fri Jan 8 19:47:42 2010 +++ src/sys/dev/cardbus/cardbus.c Tue Feb 23 19:28:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: cardbus.c,v 1.99 2010/01/08 19:47:42 dyoung Exp $ */ +/* $NetBSD: cardbus.c,v 1.100 2010/02/23 19:28:00 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999 and 2000 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.99 2010/01/08 19:47:42 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.100 2010/02/23 19:28:00 dyoung Exp $"); #include "opt_cardbus.h" @@ -1138,22 +1138,6 @@ } } -void -cardbus_disable_retry(cardbus_chipset_tag_t cc, cardbus_function_tag_t cf, - cardbustag_t tag) -{ - /* See comment on sys/dev/pci/pci.c:pci_disable_retry() for - * the reason I comment-out this code. - */ -#if 0 - cardbusreg_t retry; - - retry = cardbus_conf_read(cc, cf, tag, PCI_RETRY_TIMEOUT_REG); - retry &= ~PCI_RETRY_TIMEOUT_REG_MASK; - cardbus_conf_write(cc, cf, tag, PCI_RETRY_TIMEOUT_REG, retry); -#endif -} - struct cardbus_child_power { struct cardbus_conf_state p_cardbusconf; cardbus_devfunc_t p_ct; Index: src/sys/dev/cardbus/cardbusvar.h diff -u src/sys/dev/cardbus/cardbusvar.h:1.44 src/sys/dev/cardbus/cardbusvar.h:1.45 --- src/sys/dev/cardbus/cardbusvar.h:1.44 Tue Dec 15 22:17:12 2009 +++ src/sys/dev/cardbus/cardbusvar.h Tue Feb 23 19:28:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: cardbusvar.h,v 1.44 2009/12/15 22:17:12 snj Exp $ */ +/* $NetBSD: cardbusvar.h,v 1.45 2010/02/23 19:28:00 dyoung Exp $ */ /* * Copyright (c) 1998, 1999 and 2000 @@ -322,9 +322,6 @@ int cardbus_function_enable(struct cardbus_softc *, int); int cardbus_function_disable(struct cardbus_softc *, int); -void cardbus_disable_retry(cardbus_chipset_tag_t, cardbus_function_tag_t, - cardbustag_t); - int cardbus_get_capability(cardbus_chipset_tag_t, cardbus_function_tag_t, cardbustag_t, int, int *, cardbusreg_t *); int cardbus_get_powerstate(cardbus_devfunc_t, cardbustag_t, cardbusreg_t *); Index: src/sys/dev/pci/pci.c diff -u src/sys/dev/pci/pci.c:1.125 src/sys/dev/pci/pci.c:1.126 --- src/sys/dev/pci/pci.c:1.125 Fri Jan 8 19:56:52 2010 +++ src/sys/dev/pci/pci.c Tue Feb 23 19:28:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pci.c,v 1.125 2010/01/08 19:56:52 dyoung Exp $ */ +/* $NetBSD: pci.c,v 1.126 2010/02/23 19:28:00 dyoung Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.125 2010/01/08 19:56:52 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.126 2010/02/23 19:28:00 dyoung Exp $"); #include "opt_pci.h" @@ -812,54 +812,6 @@ return 0; } -/* I have disabled this code for now. --dyoung - * - * Insofar as I understand what the PCI retry timeout is [1], - * I see no justification for any driver to disable when it - * attaches/resumes a device. - * - * A PCI bus bridge may tell a bus master to retry its transaction - * at a later time if the resources to complete the transaction - * are not immediately available. Taking a guess, PCI bus masters - * that implement a PCI retry timeout register count down from the - * retry timeout to 0 while it retries a delayed PCI transaction. - * When it reaches 0, it stops retrying. A PCI master is *never* - * supposed to stop retrying a delayed transaction, though. - * - * Incidentally, I initially suspected that writing 0 to the register - * would not disable *retries*, but would disable the timeout. - * That is, any device whose retry timeout was set to 0 would - * *never* timeout. However, I found out, by using PCI debug - * facilities on the AMD Elan SC520, that if I write 0 to the retry - * timeout register on an ath(4) MiniPCI card, the card really does - * not retry transactions. - * - * Some uses of this register have mentioned "interference" with - * a CPU's "C3 sleep state." It seems to me that if a bus master - * is properly put to sleep, it will neither initiate new transactions, - * nor retry delayed transactions, so disabling retries should not - * be necessary. - * - * [1] The timeout does not appear to be documented in any PCI - * standard, and we have no documentation of it for the devices by - * Atheros, and others, that supposedly implement it. - */ -void -pci_disable_retry(pci_chipset_tag_t pc, pcitag_t tag) -{ -#if 0 - pcireg_t retry; - - /* - * Disable retry timeout to keep PCI Tx retries from - * interfering with ACPI C3 CPU state. - */ - retry = pci_conf_read(pc, tag, PCI_RETRY_TIMEOUT_REG); - retry &= ~PCI_RETRY_TIMEOUT_REG_MASK; - pci_conf_write(pc, tag, PCI_RETRY_TIMEOUT_REG, retry); -#endif -} - struct pci_child_power { struct pci_conf_state p_pciconf; pci_chipset_tag_t p_pc; Index: src/sys/dev/pci/pcireg.h diff -u src/sys/dev/pci/pcireg.h:1.64 src/sys/dev/pci/pcireg.h:1.65 --- src/sys/dev/pci/pcireg.h:1.64 Fri Feb 12 04:01:07 2010 +++ src/sys/dev/pci/pcireg.h Tue Feb 23 19:28:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pcireg.h,v 1.64 2010/02/12 04:01:07 msaitoh Exp $ */ +/* $NetBSD: pcireg.h,v 1.65 2010/02/23 19:28:00 dyoung Exp $ */ /* * Copyright (c) 1995, 1996, 1999, 2000 @@ -807,12 +807,6 @@ #define PCI32_DMA_BOUNCE_THRESHOLD 0x100000000ULL /* - * Common PCI register for PCI transmit handling. - */ -#define PCI_RETRY_TIMEOUT_REG 0x40 -#define PCI_RETRY_TIMEOUT_REG_MASK 0x0000ff00 - -/* * PCI-X 2.0 Extended Capability List */ Index: src/sys/dev/pci/pcivar.h diff -u src/sys/dev/pci/pcivar.h:1.83 src/sys/dev/pci/pcivar.h:1.84 --- src/sys/dev/pci/pcivar.h:1.83 Tue Jul 22 04:52:19 2008 +++ src/sys/dev/pci/pcivar.h Tue Feb 23 19:28:00 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pcivar.h,v 1.83 2008/07/22 04:52:19 bjs Exp $ */ +/* $NetBSD: pcivar.h,v 1.84 2010/02/23 19:28:00 dyoung Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -256,7 +256,6 @@ int pci_activate(pci_chipset_tag_t, pcitag_t, device_t, int (*)(pci_chipset_tag_t, pcitag_t, device_t, pcireg_t)); int pci_activate_null(pci_chipset_tag_t, pcitag_t, device_t, pcireg_t); -void pci_disable_retry(pci_chipset_tag_t, pcitag_t); /* * Device abstraction for inheritance by elanpci(4), for example.