]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 18:44:36 +0000 (11:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 18:44:36 +0000 (11:44 -0700)
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (30 commits)
  PCI: update for owner removal from struct device_attribute
  PCI: Fix warnings when CONFIG_DMI unset
  PCI: Do not run NVidia quirks related to MSI with MSI disabled
  x86/PCI: use for_each_pci_dev()
  PCI: use for_each_pci_dev()
  PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc()
  PCI: export SMBIOS provided firmware instance and label to sysfs
  PCI: Allow read/write access to sysfs I/O port resources
  x86/PCI: use host bridge _CRS info on ASRock ALiveSATA2-GLAN
  PCI: remove unused HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_{SIZE|BOUNDARY}
  PCI: disable mmio during bar sizing
  PCI: MSI: Remove unsafe and unnecessary hardware access
  PCI: Default PCIe ASPM control to on and require !EMBEDDED to disable
  PCI: kernel oops on access to pci proc file while hot-removal
  PCI: pci-sysfs: remove casts from void*
  ACPI: Disable ASPM if the platform won't provide _OSC control for PCIe
  PCI hotplug: make sure child bridges are enabled at hotplug time
  PCI hotplug: shpchp: Removed check for hotplug of display devices
  PCI hotplug: pciehp: Fixed return value sign for pciehp_unconfigure_device
  PCI: Don't enable aspm before drivers have had a chance to veto it
  ...

1  2 
Documentation/kernel-parameters.txt
drivers/net/e1000e/netdev.c
drivers/net/r8169.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/quirks.c

index f20c7abc0329ca520d524a5c135a5597a8484086,4fac69beeb4fe6bdd0279cc92b9fbba3de479e13..cbd4059305228a95a1c3a46399ecc7b861da1f77
@@@ -93,7 -93,6 +93,7 @@@ parameter is applicable
                        Documentation/scsi/.
        SECURITY Different security models are enabled.
        SELINUX SELinux support is enabled.
 +      APPARMOR AppArmor support is enabled.
        SERIAL  Serial support is enabled.
        SH      SuperH architecture is enabled.
        SMP     The kernel is an SMP kernel.
                        More X86-64 boot options can be found in
                        Documentation/x86/x86_64/boot-options.txt .
        X86     Either 32bit or 64bit x86 (same as X86-32+X86-64)
 +      XEN     Xen support is enabled
  
  In addition, the following text indicates that the option:
  
@@@ -1145,12 -1143,9 +1145,12 @@@ and is between 256 and 4096 characters
        kgdboc=         [KGDB,HW] kgdb over consoles.
                        Requires a tty driver that supports console polling,
                        or a supported polling keyboard driver (non-usb).
 -                      Serial only format: <serial_device>[,baud]
 -                      keyboard only format: kbd
 -                      keyboard and serial format: kbd,<serial_device>[,baud]
 +                       Serial only format: <serial_device>[,baud]
 +                       keyboard only format: kbd
 +                       keyboard and serial format: kbd,<serial_device>[,baud]
 +                      Optional Kernel mode setting:
 +                       kms, kbd format: kms,kbd
 +                       kms, kbd and serial format: kms,kbd,<ser_dev>[,baud]
  
        kgdbwait        [KGDB] Stop kernel execution and enter the
                        kernel debugger at the earliest opportunity.
                        [NETFILTER] Enable connection tracking flow accounting
                        0 to disable accounting
                        1 to enable accounting
 -                      Default value depends on CONFIG_NF_CT_ACCT that is
 -                      going to be removed in 2.6.29.
 +                      Default value is 0.
  
        nfsaddrs=       [NFS]
                        See Documentation/filesystems/nfs/nfsroot.txt.
  
        nousb           [USB] Disable the USB subsystem
  
 +      nowatchdog      [KNL] Disable the lockup detector.
 +
        nowb            [ARM]
  
        nox2apic        [X86-64,APIC] Do not enable x2APIC mode.
                norom           [X86] Do not assign address space to
                                expansion ROMs that do not already have
                                BIOS assigned address ranges.
+               nobar           [X86] Do not assign address space to the
+                               BARs that weren't assigned by the BIOS.
                irqmask=0xMMMM  [X86] Set a bit mask of IRQs allowed to be
                                assigned automatically to PCI devices. You can
                                make the kernel exclude IRQs of your ISA cards
                        If enabled at boot time, /selinux/disable can be used
                        later to disable prior to initial policy load.
  
 +      apparmor=       [APPARMOR] Disable or enable AppArmor at boot time
 +                      Format: { "0" | "1" }
 +                      See security/apparmor/Kconfig help text
 +                      0 -- disable.
 +                      1 -- enable.
 +                      Default value is set via kernel config option.
 +
        serialnumber    [BUGS=X86-32]
  
        shapers=        [NET]
        xd=             [HW,XT] Original XT pre-IDE (RLL encoded) disks.
        xd_geo=         See header of drivers/block/xd.c.
  
 +      xen_emul_unplug=                [HW,X86,XEN]
 +                      Unplug Xen emulated devices
 +                      Format: [unplug0,][unplug1]
 +                      ide-disks -- unplug primary master IDE devices
 +                      aux-ide-disks -- unplug non-primary-master IDE devices
 +                      nics -- unplug network devices
 +                      all -- unplug all emulated devices (NICs and IDE disks)
 +                      ignore -- continue loading the Xen platform PCI driver even
 +                              if the version check failed
 +
        xirc2ps_cs=     [NET,PCMCIA]
                        Format:
                        <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
index 36d31a41632050f7e75d8f79a4ad16e79a02e59c,4afc8dd9b9353639ecd706f66ea79c6d26082a35..521c6ee1f32af75a0abb5950d10c941376d60116
@@@ -1,7 -1,7 +1,7 @@@
  /*******************************************************************************
  
    Intel PRO/1000 Linux driver
 -  Copyright(c) 1999 - 2009 Intel Corporation.
 +  Copyright(c) 1999 - 2010 Intel Corporation.
  
    This program is free software; you can redistribute it and/or modify it
    under the terms and conditions of the GNU General Public License,
@@@ -52,9 -52,7 +52,9 @@@
  
  #include "e1000.h"
  
 -#define DRV_VERSION "1.0.2-k4"
 +#define DRV_EXTRAVERSION "-k2"
 +
 +#define DRV_VERSION "1.2.7" DRV_EXTRAVERSION
  char e1000e_driver_name[] = "e1000e";
  const char e1000e_driver_version[] = DRV_VERSION;
  
@@@ -69,7 -67,6 +69,7 @@@ static const struct e1000_info *e1000_i
        [board_ich9lan]         = &e1000_ich9_info,
        [board_ich10lan]        = &e1000_ich10_info,
        [board_pchlan]          = &e1000_pch_info,
 +      [board_pch2lan]         = &e1000_pch2_info,
  };
  
  struct e1000_reg_info {
@@@ -224,10 -221,10 +224,10 @@@ static void e1000e_dump(struct e1000_ad
        buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean];
        printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n",
                0, tx_ring->next_to_use, tx_ring->next_to_clean,
 -              (u64)buffer_info->dma,
 +              (unsigned long long)buffer_info->dma,
                buffer_info->length,
                buffer_info->next_to_watch,
 -              (u64)buffer_info->time_stamp);
 +              (unsigned long long)buffer_info->time_stamp);
  
        /* Print TX Rings */
        if (!netif_msg_tx_done(adapter))
                        "%04X  %3X %016llX %p",
                       (!(le64_to_cpu(u0->b) & (1<<29)) ? 'l' :
                        ((le64_to_cpu(u0->b) & (1<<20)) ? 'd' : 'c')), i,
 -                     le64_to_cpu(u0->a), le64_to_cpu(u0->b),
 -                     (u64)buffer_info->dma, buffer_info->length,
 -                     buffer_info->next_to_watch, (u64)buffer_info->time_stamp,
 +                     (unsigned long long)le64_to_cpu(u0->a),
 +                     (unsigned long long)le64_to_cpu(u0->b),
 +                     (unsigned long long)buffer_info->dma,
 +                     buffer_info->length, buffer_info->next_to_watch,
 +                     (unsigned long long)buffer_info->time_stamp,
                       buffer_info->skb);
                if (i == tx_ring->next_to_use && i == tx_ring->next_to_clean)
                        printk(KERN_CONT " NTC/U\n");
@@@ -358,19 -353,19 +358,19 @@@ rx_ring_summary
                                printk(KERN_INFO "RWB[0x%03X]     %016llX "
                                        "%016llX %016llX %016llX "
                                        "---------------- %p", i,
 -                                      le64_to_cpu(u1->a),
 -                                      le64_to_cpu(u1->b),
 -                                      le64_to_cpu(u1->c),
 -                                      le64_to_cpu(u1->d),
 +                                      (unsigned long long)le64_to_cpu(u1->a),
 +                                      (unsigned long long)le64_to_cpu(u1->b),
 +                                      (unsigned long long)le64_to_cpu(u1->c),
 +                                      (unsigned long long)le64_to_cpu(u1->d),
                                        buffer_info->skb);
                        } else {
                                printk(KERN_INFO "R  [0x%03X]     %016llX "
                                        "%016llX %016llX %016llX %016llX %p", i,
 -                                      le64_to_cpu(u1->a),
 -                                      le64_to_cpu(u1->b),
 -                                      le64_to_cpu(u1->c),
 -                                      le64_to_cpu(u1->d),
 -                                      (u64)buffer_info->dma,
 +                                      (unsigned long long)le64_to_cpu(u1->a),
 +                                      (unsigned long long)le64_to_cpu(u1->b),
 +                                      (unsigned long long)le64_to_cpu(u1->c),
 +                                      (unsigned long long)le64_to_cpu(u1->d),
 +                                      (unsigned long long)buffer_info->dma,
                                        buffer_info->skb);
  
                                if (netif_msg_pktdata(adapter))
                        buffer_info = &rx_ring->buffer_info[i];
                        u0 = (struct my_u0 *)rx_desc;
                        printk(KERN_INFO "Rl[0x%03X]    %016llX %016llX "
 -                              "%016llX %p",
 -                              i, le64_to_cpu(u0->a), le64_to_cpu(u0->b),
 -                              (u64)buffer_info->dma, buffer_info->skb);
 +                              "%016llX %p", i,
 +                              (unsigned long long)le64_to_cpu(u0->a),
 +                              (unsigned long long)le64_to_cpu(u0->b),
 +                              (unsigned long long)buffer_info->dma,
 +                              buffer_info->skb);
                        if (i == rx_ring->next_to_use)
                                printk(KERN_CONT " NTU\n");
                        else if (i == rx_ring->next_to_clean)
@@@ -1785,25 -1778,25 +1785,25 @@@ void e1000e_reset_interrupt_capability(
  void e1000e_set_interrupt_capability(struct e1000_adapter *adapter)
  {
        int err;
 -      int numvecs, i;
 -
 +      int i;
  
        switch (adapter->int_mode) {
        case E1000E_INT_MODE_MSIX:
                if (adapter->flags & FLAG_HAS_MSIX) {
 -                      numvecs = 3; /* RxQ0, TxQ0 and other */
 -                      adapter->msix_entries = kcalloc(numvecs,
 +                      adapter->num_vectors = 3; /* RxQ0, TxQ0 and other */
 +                      adapter->msix_entries = kcalloc(adapter->num_vectors,
                                                      sizeof(struct msix_entry),
                                                      GFP_KERNEL);
                        if (adapter->msix_entries) {
 -                              for (i = 0; i < numvecs; i++)
 +                              for (i = 0; i < adapter->num_vectors; i++)
                                        adapter->msix_entries[i].entry = i;
  
                                err = pci_enable_msix(adapter->pdev,
                                                      adapter->msix_entries,
 -                                                    numvecs);
 -                              if (err == 0)
 +                                                    adapter->num_vectors);
 +                              if (err == 0) {
                                        return;
 +                              }
                        }
                        /* MSI-X failed, so fall through and try MSI */
                        e_err("Failed to initialize MSI-X interrupts.  "
                /* Don't do anything; this is the system default */
                break;
        }
 +
 +      /* store the number of vectors being used */
 +      adapter->num_vectors = 1;
  }
  
  /**
@@@ -1949,14 -1939,7 +1949,14 @@@ static void e1000_irq_disable(struct e1
        if (adapter->msix_entries)
                ew32(EIAC_82574, 0);
        e1e_flush();
 -      synchronize_irq(adapter->pdev->irq);
 +
 +      if (adapter->msix_entries) {
 +              int i;
 +              for (i = 0; i < adapter->num_vectors; i++)
 +                      synchronize_irq(adapter->msix_entries[i].vector);
 +      } else {
 +              synchronize_irq(adapter->pdev->irq);
 +      }
  }
  
  /**
@@@ -2740,16 -2723,6 +2740,16 @@@ static void e1000_setup_rctl(struct e10
                e1e_wphy(hw, 22, phy_data);
        }
  
 +      /* Workaround Si errata on 82579 - configure jumbo frame flow */
 +      if (hw->mac.type == e1000_pch2lan) {
 +              s32 ret_val;
 +
 +              if (rctl & E1000_RCTL_LPE)
 +                      ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
 +              else
 +                      ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
 +      }
 +
        /* Setup buffer sizes */
        rctl &= ~E1000_RCTL_SZ_4096;
        rctl |= E1000_RCTL_BSEX;
         * per packet.
         */
        pages = PAGE_USE_COUNT(adapter->netdev->mtu);
 -      if (!(adapter->flags & FLAG_IS_ICH) && (pages <= 3) &&
 +      if (!(adapter->flags & FLAG_HAS_ERT) && (pages <= 3) &&
            (PAGE_SIZE <= 16384) && (rctl & E1000_RCTL_LPE))
                adapter->rx_ps_pages = pages;
        else
@@@ -2928,10 -2901,10 +2928,10 @@@ static void e1000_configure_rx(struct e
                         * dropped transactions.
                         */
                        pm_qos_update_request(
 -                              adapter->netdev->pm_qos_req, 55);
 +                              &adapter->netdev->pm_qos_req, 55);
                } else {
                        pm_qos_update_request(
 -                              adapter->netdev->pm_qos_req,
 +                              &adapter->netdev->pm_qos_req,
                                PM_QOS_DEFAULT_VALUE);
                }
        }
@@@ -3145,27 -3118,7 +3145,27 @@@ void e1000e_reset(struct e1000_adapter 
         *   with ERT support assuming ERT set to E1000_ERT_2048), or
         * - the full Rx FIFO size minus one full frame
         */
 -      if (hw->mac.type == e1000_pchlan) {
 +      if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
 +              fc->pause_time = 0xFFFF;
 +      else
 +              fc->pause_time = E1000_FC_PAUSE_TIME;
 +      fc->send_xon = 1;
 +      fc->current_mode = fc->requested_mode;
 +
 +      switch (hw->mac.type) {
 +      default:
 +              if ((adapter->flags & FLAG_HAS_ERT) &&
 +                  (adapter->netdev->mtu > ETH_DATA_LEN))
 +                      hwm = min(((pba << 10) * 9 / 10),
 +                                ((pba << 10) - (E1000_ERT_2048 << 3)));
 +              else
 +                      hwm = min(((pba << 10) * 9 / 10),
 +                                ((pba << 10) - adapter->max_frame_size));
 +
 +              fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
 +              fc->low_water = fc->high_water - 8;
 +              break;
 +      case e1000_pchlan:
                /*
                 * Workaround PCH LOM adapter hangs with certain network
                 * loads.  If hangs persist, try disabling Tx flow control.
                        fc->low_water  = 0x3000;
                }
                fc->refresh_time = 0x1000;
 -      } else {
 -              if ((adapter->flags & FLAG_HAS_ERT) &&
 -                  (adapter->netdev->mtu > ETH_DATA_LEN))
 -                      hwm = min(((pba << 10) * 9 / 10),
 -                                ((pba << 10) - (E1000_ERT_2048 << 3)));
 -              else
 -                      hwm = min(((pba << 10) * 9 / 10),
 -                                ((pba << 10) - adapter->max_frame_size));
 -
 -              fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
 -              fc->low_water = fc->high_water - 8;
 +              break;
 +      case e1000_pch2lan:
 +              fc->high_water = 0x05C20;
 +              fc->low_water = 0x05048;
 +              fc->pause_time = 0x0650;
 +              fc->refresh_time = 0x0400;
 +              break;
        }
  
 -      if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
 -              fc->pause_time = 0xFFFF;
 -      else
 -              fc->pause_time = E1000_FC_PAUSE_TIME;
 -      fc->send_xon = 1;
 -      fc->current_mode = fc->requested_mode;
 -
        /* Allow time for pending master requests to run */
        mac->ops.reset_hw(hw);
  
                e1000_get_hw_control(adapter);
  
        ew32(WUC, 0);
 -      if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP)
 -              e1e_wphy(&adapter->hw, BM_WUC, 0);
  
        if (mac->ops.init_hw(hw))
                e_err("Hardware Error\n");
@@@ -3228,6 -3194,12 +3228,6 @@@ int e1000e_up(struct e1000_adapter *ada
  {
        struct e1000_hw *hw = &adapter->hw;
  
 -      /* DMA latency requirement to workaround early-receive/jumbo issue */
 -      if (adapter->flags & FLAG_HAS_ERT)
 -              adapter->netdev->pm_qos_req =
 -                      pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
 -                                     PM_QOS_DEFAULT_VALUE);
 -
        /* hardware has been reset, we need to reload some things */
        e1000_configure(adapter);
  
@@@ -3291,6 -3263,12 +3291,6 @@@ void e1000e_down(struct e1000_adapter *
        e1000_clean_tx_ring(adapter);
        e1000_clean_rx_ring(adapter);
  
 -      if (adapter->flags & FLAG_HAS_ERT) {
 -              pm_qos_remove_request(
 -                            adapter->netdev->pm_qos_req);
 -              adapter->netdev->pm_qos_req = NULL;
 -      }
 -
        /*
         * TODO: for power management, we could drop the link and
         * pci_disable_device here.
@@@ -3441,18 -3419,13 +3441,18 @@@ static int e1000_test_msi(struct e1000_
  
        /* disable SERR in case the MSI write causes a master abort */
        pci_read_config_word(adapter->pdev, PCI_COMMAND, &pci_cmd);
 -      pci_write_config_word(adapter->pdev, PCI_COMMAND,
 -                            pci_cmd & ~PCI_COMMAND_SERR);
 +      if (pci_cmd & PCI_COMMAND_SERR)
 +              pci_write_config_word(adapter->pdev, PCI_COMMAND,
 +                                    pci_cmd & ~PCI_COMMAND_SERR);
  
        err = e1000_test_msi_interrupt(adapter);
  
 -      /* restore previous setting of command word */
 -      pci_write_config_word(adapter->pdev, PCI_COMMAND, pci_cmd);
 +      /* re-enable SERR */
 +      if (pci_cmd & PCI_COMMAND_SERR) {
 +              pci_read_config_word(adapter->pdev, PCI_COMMAND, &pci_cmd);
 +              pci_cmd |= PCI_COMMAND_SERR;
 +              pci_write_config_word(adapter->pdev, PCI_COMMAND, pci_cmd);
 +      }
  
        /* success ! */
        if (!err)
@@@ -3525,12 -3498,6 +3525,12 @@@ static int e1000_open(struct net_devic
             E1000_MNG_DHCP_COOKIE_STATUS_VLAN))
                e1000_update_mng_vlan(adapter);
  
 +      /* DMA latency requirement to workaround early-receive/jumbo issue */
 +      if (adapter->flags & FLAG_HAS_ERT)
 +              pm_qos_add_request(&adapter->netdev->pm_qos_req,
 +                                 PM_QOS_CPU_DMA_LATENCY,
 +                                 PM_QOS_DEFAULT_VALUE);
 +
        /*
         * before we allocate an interrupt, we must be ready to handle it.
         * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
@@@ -3635,9 -3602,6 +3635,9 @@@ static int e1000_close(struct net_devic
        if (adapter->flags & FLAG_HAS_AMT)
                e1000_release_hw_control(adapter);
  
 +      if (adapter->flags & FLAG_HAS_ERT)
 +              pm_qos_remove_request(&adapter->netdev->pm_qos_req);
 +
        pm_runtime_put_sync(&pdev->dev);
  
        return 0;
@@@ -3707,110 -3671,6 +3707,110 @@@ static void e1000_update_phy_info(unsig
        schedule_work(&adapter->update_phy_task);
  }
  
 +/**
 + * e1000e_update_phy_stats - Update the PHY statistics counters
 + * @adapter: board private structure
 + **/
 +static void e1000e_update_phy_stats(struct e1000_adapter *adapter)
 +{
 +      struct e1000_hw *hw = &adapter->hw;
 +      s32 ret_val;
 +      u16 phy_data;
 +
 +      ret_val = hw->phy.ops.acquire(hw);
 +      if (ret_val)
 +              return;
 +
 +      hw->phy.addr = 1;
 +
 +#define HV_PHY_STATS_PAGE     778
 +      /*
 +       * A page set is expensive so check if already on desired page.
 +       * If not, set to the page with the PHY status registers.
 +       */
 +      ret_val = e1000e_read_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT,
 +                                         &phy_data);
 +      if (ret_val)
 +              goto release;
 +      if (phy_data != (HV_PHY_STATS_PAGE << IGP_PAGE_SHIFT)) {
 +              ret_val = e1000e_write_phy_reg_mdic(hw,
 +                                                  IGP01E1000_PHY_PAGE_SELECT,
 +                                                  (HV_PHY_STATS_PAGE <<
 +                                                   IGP_PAGE_SHIFT));
 +              if (ret_val)
 +                      goto release;
 +      }
 +
 +      /* Read/clear the upper 16-bit registers and read/accumulate lower */
 +
 +      /* Single Collision Count */
 +      e1000e_read_phy_reg_mdic(hw, HV_SCC_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_SCC_LOWER & MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              adapter->stats.scc += phy_data;
 +
 +      /* Excessive Collision Count */
 +      e1000e_read_phy_reg_mdic(hw, HV_ECOL_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_ECOL_LOWER & MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              adapter->stats.ecol += phy_data;
 +
 +      /* Multiple Collision Count */
 +      e1000e_read_phy_reg_mdic(hw, HV_MCC_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_MCC_LOWER & MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              adapter->stats.mcc += phy_data;
 +
 +      /* Late Collision Count */
 +      e1000e_read_phy_reg_mdic(hw, HV_LATECOL_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_LATECOL_LOWER &
 +                                         MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              adapter->stats.latecol += phy_data;
 +
 +      /* Collision Count - also used for adaptive IFS */
 +      e1000e_read_phy_reg_mdic(hw, HV_COLC_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_COLC_LOWER & MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              hw->mac.collision_delta = phy_data;
 +
 +      /* Defer Count */
 +      e1000e_read_phy_reg_mdic(hw, HV_DC_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_DC_LOWER & MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              adapter->stats.dc += phy_data;
 +
 +      /* Transmit with no CRS */
 +      e1000e_read_phy_reg_mdic(hw, HV_TNCRS_UPPER & MAX_PHY_REG_ADDRESS,
 +                               &phy_data);
 +      ret_val = e1000e_read_phy_reg_mdic(hw,
 +                                         HV_TNCRS_LOWER & MAX_PHY_REG_ADDRESS,
 +                                         &phy_data);
 +      if (!ret_val)
 +              adapter->stats.tncrs += phy_data;
 +
 +release:
 +      hw->phy.ops.release(hw);
 +}
 +
  /**
   * e1000e_update_stats - Update the board statistics counters
   * @adapter: board private structure
@@@ -3820,6 -3680,7 +3820,6 @@@ void e1000e_update_stats(struct e1000_a
        struct net_device *netdev = adapter->netdev;
        struct e1000_hw *hw = &adapter->hw;
        struct pci_dev *pdev = adapter->pdev;
 -      u16 phy_data;
  
        /*
         * Prevent stats update while adapter is being reset, or if the pci
        adapter->stats.roc += er32(ROC);
  
        adapter->stats.mpc += er32(MPC);
 -      if ((hw->phy.type == e1000_phy_82578) ||
 -          (hw->phy.type == e1000_phy_82577)) {
 -              e1e_rphy(hw, HV_SCC_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_SCC_LOWER, &phy_data))
 -                      adapter->stats.scc += phy_data;
 -
 -              e1e_rphy(hw, HV_ECOL_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_ECOL_LOWER, &phy_data))
 -                      adapter->stats.ecol += phy_data;
 -
 -              e1e_rphy(hw, HV_MCC_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_MCC_LOWER, &phy_data))
 -                      adapter->stats.mcc += phy_data;
 -
 -              e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data))
 -                      adapter->stats.latecol += phy_data;
 -
 -              e1e_rphy(hw, HV_DC_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_DC_LOWER, &phy_data))
 -                      adapter->stats.dc += phy_data;
 -      } else {
 -              adapter->stats.scc += er32(SCC);
 -              adapter->stats.ecol += er32(ECOL);
 -              adapter->stats.mcc += er32(MCC);
 -              adapter->stats.latecol += er32(LATECOL);
 -              adapter->stats.dc += er32(DC);
 +
 +      /* Half-duplex statistics */
 +      if (adapter->link_duplex == HALF_DUPLEX) {
 +              if (adapter->flags2 & FLAG2_HAS_PHY_STATS) {
 +                      e1000e_update_phy_stats(adapter);
 +              } else {
 +                      adapter->stats.scc += er32(SCC);
 +                      adapter->stats.ecol += er32(ECOL);
 +                      adapter->stats.mcc += er32(MCC);
 +                      adapter->stats.latecol += er32(LATECOL);
 +                      adapter->stats.dc += er32(DC);
 +
 +                      hw->mac.collision_delta = er32(COLC);
 +
 +                      if ((hw->mac.type != e1000_82574) &&
 +                          (hw->mac.type != e1000_82583))
 +                              adapter->stats.tncrs += er32(TNCRS);
 +              }
 +              adapter->stats.colc += hw->mac.collision_delta;
        }
 +
        adapter->stats.xonrxc += er32(XONRXC);
        adapter->stats.xontxc += er32(XONTXC);
        adapter->stats.xoffrxc += er32(XOFFRXC);
  
        hw->mac.tx_packet_delta = er32(TPT);
        adapter->stats.tpt += hw->mac.tx_packet_delta;
 -      if ((hw->phy.type == e1000_phy_82578) ||
 -          (hw->phy.type == e1000_phy_82577)) {
 -              e1e_rphy(hw, HV_COLC_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_COLC_LOWER, &phy_data))
 -                      hw->mac.collision_delta = phy_data;
 -      } else {
 -              hw->mac.collision_delta = er32(COLC);
 -      }
 -      adapter->stats.colc += hw->mac.collision_delta;
  
        adapter->stats.algnerrc += er32(ALGNERRC);
        adapter->stats.rxerrc += er32(RXERRC);
 -      if ((hw->phy.type == e1000_phy_82578) ||
 -          (hw->phy.type == e1000_phy_82577)) {
 -              e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data);
 -              if (!e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data))
 -                      adapter->stats.tncrs += phy_data;
 -      } else {
 -              if ((hw->mac.type != e1000_82574) &&
 -                  (hw->mac.type != e1000_82583))
 -                      adapter->stats.tncrs += er32(TNCRS);
 -      }
        adapter->stats.cexterr += er32(CEXTERR);
        adapter->stats.tsctc += er32(TSCTC);
        adapter->stats.tsctfc += er32(TSCTFC);
@@@ -3978,7 -3865,7 +3978,7 @@@ static void e1000_print_link_info(struc
               ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
  }
  
 -bool e1000e_has_link(struct e1000_adapter *adapter)
 +static bool e1000e_has_link(struct e1000_adapter *adapter)
  {
        struct e1000_hw *hw = &adapter->hw;
        bool link_active = 0;
@@@ -4954,7 -4841,14 +4954,7 @@@ static int e1000_init_phy_wakeup(struc
        int retval = 0;
  
        /* copy MAC RARs to PHY RARs */
 -      for (i = 0; i < adapter->hw.mac.rar_entry_count; i++) {
 -              mac_reg = er32(RAL(i));
 -              e1e_wphy(hw, BM_RAR_L(i), (u16)(mac_reg & 0xFFFF));
 -              e1e_wphy(hw, BM_RAR_M(i), (u16)((mac_reg >> 16) & 0xFFFF));
 -              mac_reg = er32(RAH(i));
 -              e1e_wphy(hw, BM_RAR_H(i), (u16)(mac_reg & 0xFFFF));
 -              e1e_wphy(hw, BM_RAR_CTRL(i), (u16)((mac_reg >> 16) & 0xFFFF));
 -      }
 +      e1000_copy_rx_addrs_to_phy_ich8lan(hw);
  
        /* copy MAC MTA to PHY MTA */
        for (i = 0; i < adapter->hw.mac.mta_reg_count; i++) {
@@@ -5657,6 -5551,8 +5657,6 @@@ static int __devinit e1000_probe(struc
        if (err)
                goto err_sw_init;
  
 -      err = -EIO;
 -
        memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
        memcpy(&hw->nvm.ops, ei->nvm_ops, sizeof(hw->nvm.ops));
        memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
  
        e1000_print_device_info(adapter);
  
-       if (pci_dev_run_wake(pdev)) {
-               pm_runtime_set_active(&pdev->dev);
-               pm_runtime_enable(&pdev->dev);
-       }
-       pm_schedule_suspend(&pdev->dev, MSEC_PER_SEC);
+       if (pci_dev_run_wake(pdev))
+               pm_runtime_put_noidle(&pdev->dev);
  
        return 0;
  
@@@ -5875,8 -5768,6 +5872,6 @@@ static void __devexit e1000_remove(stru
        struct e1000_adapter *adapter = netdev_priv(netdev);
        bool down = test_bit(__E1000_DOWN, &adapter->state);
  
-       pm_runtime_get_sync(&pdev->dev);
        /*
         * flush_scheduled work may reschedule our watchdog task, so
         * explicitly disable watchdog tasks from being rescheduled
                clear_bit(__E1000_DOWN, &adapter->state);
        unregister_netdev(netdev);
  
-       if (pci_dev_run_wake(pdev)) {
-               pm_runtime_disable(&pdev->dev);
-               pm_runtime_set_suspended(&pdev->dev);
-       }
-       pm_runtime_put_noidle(&pdev->dev);
+       if (pci_dev_run_wake(pdev))
+               pm_runtime_get_noresume(&pdev->dev);
  
        /*
         * Release control of h/w to f/w.  If f/w is AMT enabled, this
@@@ -6003,9 -5891,6 +5995,9 @@@ static DEFINE_PCI_DEVICE_TABLE(e1000_pc
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DM), board_pchlan },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DC), board_pchlan },
  
 +      { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_LM), board_pch2lan },
 +      { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_V), board_pch2lan },
 +
        { }     /* terminate list */
  };
  MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
@@@ -6042,7 -5927,7 +6034,7 @@@ static int __init e1000_init_module(voi
        int ret;
        pr_info("Intel(R) PRO/1000 Network Driver - %s\n",
                e1000e_driver_version);
 -      pr_info("Copyright (c) 1999 - 2009 Intel Corporation.\n");
 +      pr_info("Copyright (c) 1999 - 2010 Intel Corporation.\n");
        ret = pci_register_driver(&e1000_driver);
  
        return ret;
diff --combined drivers/net/r8169.c
index 35540411990d5867f1ed9d44164fc8b7e47a8a11,c982a4763befbdbf26ad60b1284b0efd69c2e057..078bbf4e6f1933f3ee1e95e2c0dccfea92157088
@@@ -88,7 -88,7 +88,7 @@@ static const int multicast_filter_limi
  #define RTL_W32(reg, val32)   writel ((val32), ioaddr + (reg))
  #define RTL_R8(reg)           readb (ioaddr + (reg))
  #define RTL_R16(reg)          readw (ioaddr + (reg))
 -#define RTL_R32(reg)          ((unsigned long) readl (ioaddr + (reg)))
 +#define RTL_R32(reg)          readl (ioaddr + (reg))
  
  enum mac_version {
        RTL_GIGA_MAC_NONE   = 0x00,
@@@ -3219,11 -3219,8 +3219,8 @@@ rtl8169_init_one(struct pci_dev *pdev, 
  
        device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL);
  
-       if (pci_dev_run_wake(pdev)) {
-               pm_runtime_set_active(&pdev->dev);
-               pm_runtime_enable(&pdev->dev);
-       }
-       pm_runtime_idle(&pdev->dev);
+       if (pci_dev_run_wake(pdev))
+               pm_runtime_put_noidle(&pdev->dev);
  
  out:
        return rc;
@@@ -3246,17 -3243,12 +3243,12 @@@ static void __devexit rtl8169_remove_on
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rtl8169_private *tp = netdev_priv(dev);
  
-       pm_runtime_get_sync(&pdev->dev);
        flush_scheduled_work();
  
        unregister_netdev(dev);
  
-       if (pci_dev_run_wake(pdev)) {
-               pm_runtime_disable(&pdev->dev);
-               pm_runtime_set_suspended(&pdev->dev);
-       }
-       pm_runtime_put_noidle(&pdev->dev);
+       if (pci_dev_run_wake(pdev))
+               pm_runtime_get_noresume(&pdev->dev);
  
        /* restore original MAC address */
        rtl_rar_set(tp, dev->perm_addr);
diff --combined drivers/pci/pci.c
index 130ed1daf0f8db10637649cd47d6c2c5a4673dd7,9afad0faa9b65b117c2b096ab979602e7b9a92fa..7fa3cbd742c53bd34a871355320cecc56906277f
@@@ -1275,22 -1275,6 +1275,22 @@@ bool pci_check_pme_status(struct pci_de
        return ret;
  }
  
 +/*
 + * Time to wait before the system can be put into a sleep state after reporting
 + * a wakeup event signaled by a PCI device.
 + */
 +#define PCI_WAKEUP_COOLDOWN   100
 +
 +/**
 + * pci_wakeup_event - Report a wakeup event related to a given PCI device.
 + * @dev: Device to report the wakeup event for.
 + */
 +void pci_wakeup_event(struct pci_dev *dev)
 +{
 +      if (device_may_wakeup(&dev->dev))
 +              pm_wakeup_event(&dev->dev, PCI_WAKEUP_COOLDOWN);
 +}
 +
  /**
   * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set.
   * @dev: Device to handle.
   */
  static int pci_pme_wakeup(struct pci_dev *dev, void *ign)
  {
 -      if (pci_check_pme_status(dev))
 +      if (pci_check_pme_status(dev)) {
                pm_request_resume(&dev->dev);
 +              pci_wakeup_event(dev);
 +      }
        return 0;
  }
  
@@@ -2312,21 -2294,17 +2312,17 @@@ void pci_msi_off(struct pci_dev *dev
  }
  EXPORT_SYMBOL_GPL(pci_msi_off);
  
- #ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE
  int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size)
  {
        return dma_set_max_seg_size(&dev->dev, size);
  }
  EXPORT_SYMBOL(pci_set_dma_max_seg_size);
- #endif
  
- #ifndef HAVE_ARCH_PCI_SET_DMA_SEGMENT_BOUNDARY
  int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask)
  {
        return dma_set_seg_boundary(&dev->dev, mask);
  }
  EXPORT_SYMBOL(pci_set_dma_seg_boundary);
- #endif
  
  static int pcie_flr(struct pci_dev *dev, int probe)
  {
diff --combined drivers/pci/pci.h
index c8b7fd056ccdc3fbd53c798e02b0e89c90d13076,95186caa149277759506ab8eb2d0b028457852ef..679c39de6a89124e96a36252f32e8ff45991b7aa
  extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
  extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
  extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
+ #ifndef CONFIG_DMI
+ static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
+ { return; }
+ static inline void pci_remove_firmware_label_files(struct pci_dev *pdev)
+ { return; }
+ #else
+ extern void pci_create_firmware_label_files(struct pci_dev *pdev);
+ extern void pci_remove_firmware_label_files(struct pci_dev *pdev);
+ #endif
  extern void pci_cleanup_rom(struct pci_dev *dev);
  #ifdef HAVE_PCI_MMAP
  extern int pci_mmap_fits(struct pci_dev *pdev, int resno,
@@@ -56,7 -65,6 +65,7 @@@ extern void pci_update_current_state(st
  extern void pci_disable_enabled_device(struct pci_dev *dev);
  extern bool pci_check_pme_status(struct pci_dev *dev);
  extern int pci_finish_runtime_suspend(struct pci_dev *dev);
 +extern void pci_wakeup_event(struct pci_dev *dev);
  extern int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
  extern void pci_pme_wakeup_bus(struct pci_bus *bus);
  extern void pci_pm_init(struct pci_dev *dev);
diff --combined drivers/pci/quirks.c
index a0c20d9e83966af1a4c5b72bffcc2247ea568535,a1682f19bcb0d83890917f4bdf1a4a1f46cd2673..89ed181cd90cd9cd68506a212eb423ba60f9c8e2
@@@ -91,6 -91,19 +91,19 @@@ static void __devinit quirk_resource_al
  }
  DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_resource_alignment);
  
+ /*
+  * Decoding should be disabled for a PCI device during BAR sizing to avoid
+  * conflict. But doing so may cause problems on host bridge and perhaps other
+  * key system devices. For devices that need to have mmio decoding always-on,
+  * we need to set the dev->mmio_always_on bit.
+  */
+ static void __devinit quirk_mmio_always_on(struct pci_dev *dev)
+ {
+       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST)
+               dev->mmio_always_on = 1;
+ }
+ DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, quirk_mmio_always_on);
  /* The Mellanox Tavor device gives false positive parity errors
   * Mark this device with a broken_parity_status, to allow
   * PCI scanning code to "skip" this now blacklisted device.
@@@ -1459,7 -1472,6 +1472,7 @@@ static void quirk_jmicron_ata(struct pc
        switch (pdev->device) {
        case PCI_DEVICE_ID_JMICRON_JMB360: /* SATA single port */
        case PCI_DEVICE_ID_JMICRON_JMB362: /* SATA dual ports */
 +      case PCI_DEVICE_ID_JMICRON_JMB364: /* SATA dual ports */
                /* The controller should be in single function ahci mode */
                conf1 |= 0x0002A100; /* Set 8, 13, 15, 17 */
                break;
                /* Fall through */
        case PCI_DEVICE_ID_JMICRON_JMB361:
        case PCI_DEVICE_ID_JMICRON_JMB363:
 +      case PCI_DEVICE_ID_JMICRON_JMB369:
                /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
                /* Set the class codes correctly and then direct IDE 0 */
                conf1 |= 0x00C2A1B3; /* Set 0, 1, 4, 5, 7, 8, 13, 15, 17, 22, 23 */
@@@ -1498,20 -1509,16 +1511,20 @@@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_J
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB364, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata);
 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB369, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
 +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB364, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
  DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata);
 +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB369, quirk_jmicron_ata);
  
  #endif
  
@@@ -2121,6 -2128,7 +2134,7 @@@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_A
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3336, quirk_disable_all_msi);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3364, quirk_disable_all_msi);
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8380_0, quirk_disable_all_msi);
  
  /* Disable MSI on chipsets that are known to not support it */
  static void __devinit quirk_disable_msi(struct pci_dev *dev)
        }
  }
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
- DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9602, quirk_disable_msi);
- DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASUSTEK, 0x9602, quirk_disable_msi);
- DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AI, 0x9602, quirk_disable_msi);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x5a3f, quirk_disable_msi);
  
+ /*
+  * The APC bridge device in AMD 780 family northbridges has some random
+  * OEM subsystem ID in its vendor ID register (erratum 18), so instead
+  * we use the possible vendor/device IDs of the host bridge for the
+  * declared quirk, and search for the APC bridge by slot number.
+  */
+ static void __devinit quirk_amd_780_apc_msi(struct pci_dev *host_bridge)
+ {
+       struct pci_dev *apc_bridge;
+       apc_bridge = pci_get_slot(host_bridge->bus, PCI_DEVFN(1, 0));
+       if (apc_bridge) {
+               if (apc_bridge->device == 0x9602)
+                       quirk_disable_msi(apc_bridge);
+               pci_dev_put(apc_bridge);
+       }
+ }
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9600, quirk_amd_780_apc_msi);
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x9601, quirk_amd_780_apc_msi);
  /* Go through the list of Hypertransport capabilities and
   * return 1 if a HT MSI capability is found and enabled */
  static int __devinit msi_ht_cap_enabled(struct pci_dev *dev)
@@@ -2396,6 -2421,9 +2427,9 @@@ static void __devinit __nv_msi_ht_cap_q
        int pos;
        int found;
  
+       if (!pci_msi_enabled())
+               return;
        /* check if there is HT MSI cap or enabled on this device */
        found = ht_check_msi_mapping(dev);
  
@@@ -2748,7 -2776,7 +2782,7 @@@ static int __init pci_apply_final_quirk
                printk(KERN_DEBUG "PCI: CLS %u bytes\n",
                       pci_cache_line_size << 2);
  
-       while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       for_each_pci_dev(dev) {
                pci_fixup_device(pci_fixup_final, dev);
                /*
                 * If arch hasn't set it explicitly yet, use the CLS