lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 06 Oct 2006 13:05:19 -0600 From: Matthew Wilcox <matthew@....cx> To: Val Henson <val_henson@...ux.intel.com>, Greg Kroah-Hartman <gregkh@...e.de> Cc: netdev@...r.kernel.org, linux-pci@...ey.karlin.mff.cuni.cz, linux-kernel@...r.kernel.org, Matthew Wilcox <matthew@....cx> Subject: [PATCH 2/2] [TULIP] Check the return value from pci_set_mwi() We used to check whether pci_set_mwi() had succeeded by testing the hardware MWI bit. Now we need only check the return value (and failing to do so is a warning). Also, pci_set_mwi() will fail if the cache line size is 0, so we don't need to check that ourselves any more. Signed-off-by: Matthew Wilcox <matthew@....cx> diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index d11d28c..64d999b 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c @@ -1135,7 +1135,6 @@ static void __devinit tulip_mwi_config ( { struct tulip_private *tp = netdev_priv(dev); u8 cache; - u16 pci_command; u32 csr0; if (tulip_debug > 3) @@ -1153,21 +1152,15 @@ static void __devinit tulip_mwi_config ( /* set or disable MWI in the standard PCI command bit. * Check for the case where mwi is desired but not available */ - if (csr0 & MWI) pci_set_mwi(pdev); - else pci_clear_mwi(pdev); - - /* read result from hardware (in case bit refused to enable) */ - pci_read_config_word(pdev, PCI_COMMAND, &pci_command); - if ((csr0 & MWI) && (!(pci_command & PCI_COMMAND_INVALIDATE))) - csr0 &= ~MWI; - - /* if cache line size hardwired to zero, no MWI */ - pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache); - if ((csr0 & MWI) && (cache == 0)) { - csr0 &= ~MWI; + if (csr0 & MWI) { + if (pci_set_mwi(pdev)) + csr0 &= ~MWI; + } else { pci_clear_mwi(pdev); } + pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache); + /* assign per-cacheline-size cache alignment and * burst length values */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists