]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'driver-core/driver-core-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 03:36:09 +0000 (14:36 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 5 Nov 2015 03:36:09 +0000 (14:36 +1100)
14 files changed:
1  2 
arch/arm64/kernel/debug-monitors.c
drivers/acpi/internal.h
drivers/base/dma-contiguous.c
drivers/base/regmap/internal.h
drivers/bluetooth/hci_qca.c
drivers/iommu/amd_iommu_init.c
drivers/iommu/amd_iommu_types.h
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/iwlwifi/mvm/mvm.h
include/linux/edac.h
kernel/futex.c

index cd9ea8f078b39e048a466e861d9b17936aa8cdfc,1c4cd4a0d7cc1222841c1e06d1eb6ff3192bb4cd..8aee3aeec3e687edde6f5be67233299e7a4f7d4f
  #include <linux/stat.h>
  #include <linux/uaccess.h>
  
 -#include <asm/debug-monitors.h>
 +#include <asm/cpufeature.h>
  #include <asm/cputype.h>
 +#include <asm/debug-monitors.h>
  #include <asm/system_misc.h>
  
  /* Determine debug architecture. */
  u8 debug_monitors_arch(void)
  {
 -      return read_cpuid(ID_AA64DFR0_EL1) & 0xf;
 +      return cpuid_feature_extract_field(read_system_reg(SYS_ID_AA64DFR0_EL1),
 +                                              ID_AA64DFR0_DEBUGVER_SHIFT);
  }
  
  /*
@@@ -60,7 -58,7 +60,7 @@@ static u32 mdscr_read(void
   * Allow root to disable self-hosted debug from userspace.
   * This is useful if you want to connect an external JTAG debugger.
   */
- static u32 debug_enabled = 1;
+ static bool debug_enabled = true;
  
  static int create_debug_debugfs_entry(void)
  {
@@@ -71,7 -69,7 +71,7 @@@ fs_initcall(create_debug_debugfs_entry)
  
  static int __init early_debug_disable(char *buf)
  {
-       debug_enabled = 0;
+       debug_enabled = false;
        return 0;
  }
  
@@@ -203,7 -201,7 +203,7 @@@ void unregister_step_hook(struct step_h
  }
  
  /*
 - * Call registered single step handers
 + * Call registered single step handlers
   * There is no Syndrome info to check for determining the handler.
   * So we call all the registered handlers, until the right handler is
   * found which returns zero.
@@@ -273,21 -271,20 +273,21 @@@ static int single_step_handler(unsigne
   * Use reader/writer locks instead of plain spinlock.
   */
  static LIST_HEAD(break_hook);
 -static DEFINE_RWLOCK(break_hook_lock);
 +static DEFINE_SPINLOCK(break_hook_lock);
  
  void register_break_hook(struct break_hook *hook)
  {
 -      write_lock(&break_hook_lock);
 -      list_add(&hook->node, &break_hook);
 -      write_unlock(&break_hook_lock);
 +      spin_lock(&break_hook_lock);
 +      list_add_rcu(&hook->node, &break_hook);
 +      spin_unlock(&break_hook_lock);
  }
  
  void unregister_break_hook(struct break_hook *hook)
  {
 -      write_lock(&break_hook_lock);
 -      list_del(&hook->node);
 -      write_unlock(&break_hook_lock);
 +      spin_lock(&break_hook_lock);
 +      list_del_rcu(&hook->node);
 +      spin_unlock(&break_hook_lock);
 +      synchronize_rcu();
  }
  
  static int call_break_hook(struct pt_regs *regs, unsigned int esr)
        struct break_hook *hook;
        int (*fn)(struct pt_regs *regs, unsigned int esr) = NULL;
  
 -      read_lock(&break_hook_lock);
 -      list_for_each_entry(hook, &break_hook, node)
 +      rcu_read_lock();
 +      list_for_each_entry_rcu(hook, &break_hook, node)
                if ((esr & hook->esr_mask) == hook->esr_val)
                        fn = hook->fn;
 -      read_unlock(&break_hook_lock);
 +      rcu_read_unlock();
  
        return fn ? fn(regs, esr) : DBG_HOOK_ERROR;
  }
diff --combined drivers/acpi/internal.h
index c31787bef2d323145f38b6a5b6884713a953df20,5a72e2b140fce7d609baacbb11ca9d8a7689fef3..11d87bf67e738ce7e7a07541993b92bbb66e423a
@@@ -21,7 -21,7 +21,7 @@@
  #define PREFIX "ACPI: "
  
  acpi_status acpi_os_initialize1(void);
 -int init_acpi_device_notify(void);
 +void init_acpi_device_notify(void);
  int acpi_scan_init(void);
  void acpi_pci_root_init(void);
  void acpi_pci_link_init(void);
@@@ -138,7 -138,7 +138,7 @@@ struct acpi_ec 
        unsigned long gpe;
        unsigned long command_addr;
        unsigned long data_addr;
-       unsigned long global_lock;
+       bool global_lock;
        unsigned long flags;
        unsigned long reference_count;
        struct mutex mutex;
@@@ -179,13 -179,13 +179,13 @@@ static inline int acpi_sleep_init(void
  #endif
  
  #ifdef CONFIG_ACPI_SLEEP
 -int acpi_sleep_proc_init(void);
 +void acpi_sleep_proc_init(void);
  int suspend_nvs_alloc(void);
  void suspend_nvs_free(void);
  int suspend_nvs_save(void);
  void suspend_nvs_restore(void);
  #else
 -static inline int acpi_sleep_proc_init(void) { return 0; }
 +static inline void acpi_sleep_proc_init(void) {}
  static inline int suspend_nvs_alloc(void) { return 0; }
  static inline void suspend_nvs_free(void) {}
  static inline int suspend_nvs_save(void) { return 0; }
index a12ff9863d7e116ba9f15e21fe9c6fa4070b0f22,426ba2772fe62af466e8a9fd94c83a6c7bb91648..e167a1e1bccb062efef2595fcd5299301a97df80
@@@ -46,7 -46,7 +46,7 @@@ struct cma *dma_contiguous_default_area
   * Users, who want to set the size of global CMA area for their system
   * should use cma= kernel parameter.
   */
- static const phys_addr_t size_bytes = CMA_SIZE_MBYTES * SZ_1M;
+ static const phys_addr_t size_bytes = (phys_addr_t)CMA_SIZE_MBYTES * SZ_1M;
  static phys_addr_t size_cmdline = -1;
  static phys_addr_t base_cmdline;
  static phys_addr_t limit_cmdline;
@@@ -187,7 -187,7 +187,7 @@@ int __init dma_contiguous_reserve_area(
   * global one. Requires architecture specific dev_get_cma_area() helper
   * function.
   */
 -struct page *dma_alloc_from_contiguous(struct device *dev, int count,
 +struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
                                       unsigned int align)
  {
        if (align > CONFIG_CMA_ALIGNMENT)
index 3250e53473a38957ecd12899612b6acaa5590283,5b907f2c62b9bd0d43ead816e7bf99629b458e24..3df977054781bcf4d836abf128268da70952436c
@@@ -59,7 -59,6 +59,7 @@@ struct regmap 
        regmap_lock lock;
        regmap_unlock unlock;
        void *lock_arg; /* This is passed to lock/unlock functions */
 +      gfp_t alloc_flags;
  
        struct device *dev; /* Device we do I/O on */
        void *work_buf;     /* Scratch buffer used to format I/O */
@@@ -99,8 -98,6 +99,8 @@@
  
        int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
        int (*reg_write)(void *context, unsigned int reg, unsigned int val);
 +      int (*reg_update_bits)(void *context, unsigned int reg,
 +                             unsigned int mask, unsigned int val);
  
        bool defer_caching;
  
        unsigned int num_reg_defaults_raw;
  
        /* if set, only the cache is modified not the HW */
-       u32 cache_only;
+       bool cache_only;
        /* if set, only the HW is modified not the cache */
-       u32 cache_bypass;
+       bool cache_bypass;
        /* if set, remember to free reg_defaults_raw */
        bool cache_free;
  
        const void *reg_defaults_raw;
        void *cache;
        /* if set, the cache contains newer data than the HW */
-       u32 cache_dirty;
+       bool cache_dirty;
        /* if set, the HW registers are known to match map->reg_defaults */
        bool no_sync_defaults;
  
index 77eae64000b398bd1501dae92135b880bd18bcbc,50947768166191162bfbfa4e1e307eeade6e45b5..71325e443e4631e732c457134cf99822f2610700
  #define HCI_IBS_SLEEP_IND     0xFE
  #define HCI_IBS_WAKE_IND      0xFD
  #define HCI_IBS_WAKE_ACK      0xFC
 -#define HCI_MAX_IBS_SIZE      10
 +#define HCI_MAX_IBS_SIZE      10
  
  /* Controller states */
  #define STATE_IN_BAND_SLEEP_ENABLED   1
  
 -#define IBS_WAKE_RETRANS_TIMEOUT_MS   100
 -#define IBS_TX_IDLE_TIMEOUT_MS                2000
 +#define IBS_WAKE_RETRANS_TIMEOUT_MS   100
 +#define IBS_TX_IDLE_TIMEOUT_MS                2000
  #define BAUDRATE_SETTLE_TIMEOUT_MS    300
  
  /* HCI_IBS transmit side sleep protocol states */
@@@ -80,8 -80,8 +80,8 @@@ struct qca_data 
        spinlock_t hci_ibs_lock;        /* HCI_IBS state lock   */
        u8 tx_ibs_state;        /* HCI_IBS transmit side power state*/
        u8 rx_ibs_state;        /* HCI_IBS receive side power state */
-       u32 tx_vote;            /* Clock must be on for TX */
-       u32 rx_vote;            /* Clock must be on for RX */
+       bool tx_vote;           /* Clock must be on for TX */
+       bool rx_vote;           /* Clock must be on for RX */
        struct timer_list tx_idle_timer;
        u32 tx_idle_delay;
        struct timer_list wake_retrans_timer;
@@@ -181,8 -181,8 +181,8 @@@ static void serial_clock_vote(unsigned 
                else
                        __serial_clock_off(hu->tty);
  
 -              BT_DBG("Vote serial clock %s(%s)", new_vote? "true" : "false",
 -                     vote? "true" : "false");
 +              BT_DBG("Vote serial clock %s(%s)", new_vote ? "true" : "false",
 +                     vote ? "true" : "false");
  
                diff = jiffies_to_msecs(jiffies - qca->vote_last_jif);
  
@@@ -347,7 -347,7 +347,7 @@@ static void hci_ibs_wake_retrans_timeou
        struct hci_uart *hu = (struct hci_uart *)arg;
        struct qca_data *qca = hu->priv;
        unsigned long flags, retrans_delay;
 -      unsigned long retransmit = 0;
 +      bool retransmit = false;
  
        BT_DBG("hu %p wake retransmit timeout in %d state",
                hu, qca->tx_ibs_state);
        switch (qca->tx_ibs_state) {
        case HCI_IBS_TX_WAKING:
                /* No WAKE_ACK, retransmit WAKE */
 -              retransmit = 1;
 +              retransmit = true;
                if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0) {
                        BT_ERR("Failed to acknowledge device wake up");
                        break;
@@@ -821,7 -821,7 +821,7 @@@ static struct sk_buff *qca_dequeue(stru
  
  static uint8_t qca_get_baudrate_value(int speed)
  {
 -      switch(speed) {
 +      switch (speed) {
        case 9600:
                return QCA_BAUDRATE_9600;
        case 19200:
@@@ -947,7 -947,6 +947,7 @@@ static int qca_setup(struct hci_uart *h
  static struct hci_uart_proto qca_proto = {
        .id             = HCI_UART_QCA,
        .name           = "QCA",
 +      .manufacturer   = 29,
        .init_speed     = 115200,
        .oper_speed     = 3000000,
        .open           = qca_open,
index a7cc3996d3b6d6e5e7978b61b8939dafd433a4f7,c59314523f4cab4b42f138f22b3891ce238c9824..013bdfff2d4d023c30a57baf4c833788bfd7dbee
@@@ -138,7 -138,7 +138,7 @@@ u16 amd_iommu_last_bdf;                    /* largest PC
                                           to handle */
  LIST_HEAD(amd_iommu_unity_map);               /* a list of required unity mappings
                                           we find in ACPI */
u32 amd_iommu_unmap_flush;            /* if true, flush on every unmap */
bool amd_iommu_unmap_flush;           /* if true, flush on every unmap */
  
  LIST_HEAD(amd_iommu_list);            /* list of all AMD IOMMUs in the
                                           system */
@@@ -407,6 -407,20 +407,6 @@@ static inline int ivhd_entry_length(u8 
        return 0x04 << (*ivhd >> 6);
  }
  
 -/*
 - * This function reads the last device id the IOMMU has to handle from the PCI
 - * capability header for this IOMMU
 - */
 -static int __init find_last_devid_on_pci(int bus, int dev, int fn, int cap_ptr)
 -{
 -      u32 cap;
 -
 -      cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET);
 -      update_last_devid(PCI_DEVID(MMIO_GET_BUS(cap), MMIO_GET_LD(cap)));
 -
 -      return 0;
 -}
 -
  /*
   * After reading the highest device id from the IOMMU PCI capability header
   * this function looks if there is a higher device id defined in the ACPI table
@@@ -419,13 -433,14 +419,13 @@@ static int __init find_last_devid_from_
        p += sizeof(*h);
        end += h->length;
  
 -      find_last_devid_on_pci(PCI_BUS_NUM(h->devid),
 -                      PCI_SLOT(h->devid),
 -                      PCI_FUNC(h->devid),
 -                      h->cap_ptr);
 -
        while (p < end) {
                dev = (struct ivhd_entry *)p;
                switch (dev->type) {
 +              case IVHD_DEV_ALL:
 +                      /* Use maximum BDF value for DEV_ALL */
 +                      update_last_devid(0xffff);
 +                      break;
                case IVHD_DEV_SELECT:
                case IVHD_DEV_RANGE_END:
                case IVHD_DEV_ALIAS:
@@@ -498,12 -513,17 +498,12 @@@ static int __init find_last_devid_acpi(
   * write commands to that buffer later and the IOMMU will execute them
   * asynchronously
   */
 -static u8 * __init alloc_command_buffer(struct amd_iommu *iommu)
 +static int __init alloc_command_buffer(struct amd_iommu *iommu)
  {
 -      u8 *cmd_buf = (u8 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
 -                      get_order(CMD_BUFFER_SIZE));
 -
 -      if (cmd_buf == NULL)
 -              return NULL;
 -
 -      iommu->cmd_buf_size = CMD_BUFFER_SIZE | CMD_BUFFER_UNINITIALIZED;
 +      iommu->cmd_buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
 +                                                get_order(CMD_BUFFER_SIZE));
  
 -      return cmd_buf;
 +      return iommu->cmd_buf ? 0 : -ENOMEM;
  }
  
  /*
@@@ -537,20 -557,27 +537,20 @@@ static void iommu_enable_command_buffer
                    &entry, sizeof(entry));
  
        amd_iommu_reset_cmd_buffer(iommu);
 -      iommu->cmd_buf_size &= ~(CMD_BUFFER_UNINITIALIZED);
  }
  
  static void __init free_command_buffer(struct amd_iommu *iommu)
  {
 -      free_pages((unsigned long)iommu->cmd_buf,
 -                 get_order(iommu->cmd_buf_size & ~(CMD_BUFFER_UNINITIALIZED)));
 +      free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE));
  }
  
  /* allocates the memory where the IOMMU will log its events to */
 -static u8 * __init alloc_event_buffer(struct amd_iommu *iommu)
 +static int __init alloc_event_buffer(struct amd_iommu *iommu)
  {
 -      iommu->evt_buf = (u8 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
 -                                              get_order(EVT_BUFFER_SIZE));
 +      iommu->evt_buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
 +                                                get_order(EVT_BUFFER_SIZE));
  
 -      if (iommu->evt_buf == NULL)
 -              return NULL;
 -
 -      iommu->evt_buf_size = EVT_BUFFER_SIZE;
 -
 -      return iommu->evt_buf;
 +      return iommu->evt_buf ? 0 : -ENOMEM;
  }
  
  static void iommu_enable_event_buffer(struct amd_iommu *iommu)
@@@ -577,12 -604,15 +577,12 @@@ static void __init free_event_buffer(st
  }
  
  /* allocates the memory where the IOMMU will log its events to */
 -static u8 * __init alloc_ppr_log(struct amd_iommu *iommu)
 +static int __init alloc_ppr_log(struct amd_iommu *iommu)
  {
 -      iommu->ppr_log = (u8 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
 -                                              get_order(PPR_LOG_SIZE));
 -
 -      if (iommu->ppr_log == NULL)
 -              return NULL;
 +      iommu->ppr_log = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
 +                                                get_order(PPR_LOG_SIZE));
  
 -      return iommu->ppr_log;
 +      return iommu->ppr_log ? 0 : -ENOMEM;
  }
  
  static void iommu_enable_ppr_log(struct amd_iommu *iommu)
@@@ -805,10 -835,20 +805,10 @@@ static int __init init_iommu_from_acpi(
                switch (e->type) {
                case IVHD_DEV_ALL:
  
 -                      DUMP_printk("  DEV_ALL\t\t\t first devid: %02x:%02x.%x"
 -                                  " last device %02x:%02x.%x flags: %02x\n",
 -                                  PCI_BUS_NUM(iommu->first_device),
 -                                  PCI_SLOT(iommu->first_device),
 -                                  PCI_FUNC(iommu->first_device),
 -                                  PCI_BUS_NUM(iommu->last_device),
 -                                  PCI_SLOT(iommu->last_device),
 -                                  PCI_FUNC(iommu->last_device),
 -                                  e->flags);
 +                      DUMP_printk("  DEV_ALL\t\t\tflags: %02x\n", e->flags);
  
 -                      for (dev_i = iommu->first_device;
 -                                      dev_i <= iommu->last_device; ++dev_i)
 -                              set_dev_entry_from_acpi(iommu, dev_i,
 -                                                      e->flags, 0);
 +                      for (dev_i = 0; dev_i <= amd_iommu_last_bdf; ++dev_i)
 +                              set_dev_entry_from_acpi(iommu, dev_i, e->flags, 0);
                        break;
                case IVHD_DEV_SELECT:
  
        return 0;
  }
  
 -/* Initializes the device->iommu mapping for the driver */
 -static int __init init_iommu_devices(struct amd_iommu *iommu)
 -{
 -      u32 i;
 -
 -      for (i = iommu->first_device; i <= iommu->last_device; ++i)
 -              set_iommu_for_device(iommu, i);
 -
 -      return 0;
 -}
 -
  static void __init free_iommu_one(struct amd_iommu *iommu)
  {
        free_command_buffer(iommu);
@@@ -1060,10 -1111,12 +1060,10 @@@ static int __init init_iommu_one(struc
        if (!iommu->mmio_base)
                return -ENOMEM;
  
 -      iommu->cmd_buf = alloc_command_buffer(iommu);
 -      if (!iommu->cmd_buf)
 +      if (alloc_command_buffer(iommu))
                return -ENOMEM;
  
 -      iommu->evt_buf = alloc_event_buffer(iommu);
 -      if (!iommu->evt_buf)
 +      if (alloc_event_buffer(iommu))
                return -ENOMEM;
  
        iommu->int_enabled = false;
         */
        amd_iommu_rlookup_table[iommu->devid] = NULL;
  
 -      init_iommu_devices(iommu);
 -
        return 0;
  }
  
@@@ -1201,9 -1256,6 +1201,9 @@@ static int iommu_init_pci(struct amd_io
        if (!iommu->dev)
                return -ENODEV;
  
 +      /* Prevent binding other PCI device drivers to IOMMU devices */
 +      iommu->dev->match_driver = false;
 +
        pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET,
                              &iommu->cap);
        pci_read_config_dword(iommu->dev, cap_ptr + MMIO_RANGE_OFFSET,
        pci_read_config_dword(iommu->dev, cap_ptr + MMIO_MISC_OFFSET,
                              &misc);
  
 -      iommu->first_device = PCI_DEVID(MMIO_GET_BUS(range),
 -                                       MMIO_GET_FD(range));
 -      iommu->last_device = PCI_DEVID(MMIO_GET_BUS(range),
 -                                      MMIO_GET_LD(range));
 -
        if (!(iommu->cap & (1 << IOMMU_CAP_IOTLB)))
                amd_iommu_iotlb_sup = false;
  
                amd_iommu_v2_present = true;
        }
  
 -      if (iommu_feature(iommu, FEATURE_PPR)) {
 -              iommu->ppr_log = alloc_ppr_log(iommu);
 -              if (!iommu->ppr_log)
 -                      return -ENOMEM;
 -      }
 +      if (iommu_feature(iommu, FEATURE_PPR) && alloc_ppr_log(iommu))
 +              return -ENOMEM;
  
        if (iommu->cap & (1UL << IOMMU_CAP_NPCACHE))
                amd_iommu_np_cache = true;
@@@ -1695,8 -1755,11 +1695,8 @@@ static void __init free_on_init_error(v
        free_pages((unsigned long)irq_lookup_table,
                   get_order(rlookup_table_size));
  
 -      if (amd_iommu_irq_cache) {
 -              kmem_cache_destroy(amd_iommu_irq_cache);
 -              amd_iommu_irq_cache = NULL;
 -
 -      }
 +      kmem_cache_destroy(amd_iommu_irq_cache);
 +      amd_iommu_irq_cache = NULL;
  
        free_pages((unsigned long)amd_iommu_rlookup_table,
                   get_order(rlookup_table_size));
@@@ -2135,7 -2198,7 +2135,7 @@@ int __init amd_iommu_detect(void
        iommu_detected = 1;
        x86_init.iommu.iommu_init = amd_iommu_init;
  
 -      return 0;
 +      return 1;
  }
  
  /****************************************************************************
index 08166ae3b6a4b3c6170e70d7cd3e23353e2ba6ab,861550a1ad1f4f45b4abbd9e098ed93f6e95e842..b08cf57bf4554a0a71313d15617e85752f50a8ab
  #define IOMMU_PTE_IR (1ULL << 61)
  #define IOMMU_PTE_IW (1ULL << 62)
  
 -#define DTE_FLAG_IOTLB        (0x01UL << 32)
 -#define DTE_FLAG_GV   (0x01ULL << 55)
 +#define DTE_FLAG_IOTLB        (1ULL << 32)
 +#define DTE_FLAG_GV   (1ULL << 55)
 +#define DTE_FLAG_MASK (0x3ffULL << 32)
  #define DTE_GLX_SHIFT (56)
  #define DTE_GLX_MASK  (3)
  
@@@ -517,6 -516,11 +517,6 @@@ struct amd_iommu 
        /* pci domain of this IOMMU */
        u16 pci_seg;
  
 -      /* first device this IOMMU handles. read from PCI */
 -      u16 first_device;
 -      /* last device this IOMMU handles. read from PCI */
 -      u16 last_device;
 -
        /* start of exclusion range of that IOMMU */
        u64 exclusion_start;
        /* length of exclusion range of that IOMMU */
  
        /* command buffer virtual address */
        u8 *cmd_buf;
 -      /* size of command buffer */
 -      u32 cmd_buf_size;
  
 -      /* size of event buffer */
 -      u32 evt_buf_size;
        /* event buffer virtual address */
        u8 *evt_buf;
  
@@@ -666,7 -674,7 +666,7 @@@ extern unsigned long *amd_iommu_pd_allo
   * If true, the addresses will be flushed on unmap time, not when
   * they are reused
   */
- extern u32 amd_iommu_unmap_flush;
+ extern bool amd_iommu_unmap_flush;
  
  /* Smallest max PASID supported by any IOMMU in the system */
  extern u32 amd_iommu_max_pasid;
index 6f268518b37f0ec160d0fe6998942b6042823489,5384f999c24b75f151c8c8c4d44d850c3f43302c..55a47de544ea297bb7dc8b00091ac4f15cb83954
@@@ -47,9 -47,7 +47,9 @@@
  #include <linux/timer.h>
  #include <linux/vmalloc.h>
  #include <linux/etherdevice.h>
 +#include <linux/net_tstamp.h>
  #include <asm/io.h>
 +#include "t4_chip_type.h"
  #include "cxgb4_uld.h"
  
  #define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
@@@ -292,6 -290,31 +292,6 @@@ struct pci_params 
        unsigned char width;
  };
  
 -#define CHELSIO_CHIP_CODE(version, revision) (((version) << 4) | (revision))
 -#define CHELSIO_CHIP_FPGA          0x100
 -#define CHELSIO_CHIP_VERSION(code) (((code) >> 4) & 0xf)
 -#define CHELSIO_CHIP_RELEASE(code) ((code) & 0xf)
 -
 -#define CHELSIO_T4            0x4
 -#define CHELSIO_T5            0x5
 -#define CHELSIO_T6            0x6
 -
 -enum chip_type {
 -      T4_A1 = CHELSIO_CHIP_CODE(CHELSIO_T4, 1),
 -      T4_A2 = CHELSIO_CHIP_CODE(CHELSIO_T4, 2),
 -      T4_FIRST_REV    = T4_A1,
 -      T4_LAST_REV     = T4_A2,
 -
 -      T5_A0 = CHELSIO_CHIP_CODE(CHELSIO_T5, 0),
 -      T5_A1 = CHELSIO_CHIP_CODE(CHELSIO_T5, 1),
 -      T5_FIRST_REV    = T5_A0,
 -      T5_LAST_REV     = T5_A1,
 -
 -      T6_A0 = CHELSIO_CHIP_CODE(CHELSIO_T6, 0),
 -      T6_FIRST_REV    = T6_A0,
 -      T6_LAST_REV     = T6_A0,
 -};
 -
  struct devlog_params {
        u32 memtype;                    /* which memory (EDC0, EDC1, MC) */
        u32 start;                      /* start of log in firmware memory */
@@@ -455,8 -478,6 +455,8 @@@ struct port_info 
  #ifdef CONFIG_CHELSIO_T4_FCOE
        struct cxgb_fcoe fcoe;
  #endif /* CONFIG_CHELSIO_T4_FCOE */
 +      bool rxtstamp;  /* Enable TS */
 +      struct hwtstamp_config tstamp_config;
  };
  
  struct dentry;
@@@ -496,7 -517,6 +496,7 @@@ struct sge_fl {                     /* 
  
  /* A packet gather list */
  struct pkt_gl {
 +      u64 sgetstamp;              /* SGE Time Stamp for Ingress Packet */
        struct page_frag frags[MAX_SKB_FRAGS];
        void *va;                         /* virtual address of first byte */
        unsigned int nfrags;              /* # of fragments */
@@@ -747,8 -767,8 +747,8 @@@ struct adapter 
        bool tid_release_task_busy;
  
        struct dentry *debugfs_root;
-       u32 use_bd;     /* Use SGE Back Door intfc for reading SGE Contexts */
-       u32 trace_rss;  /* 1 implies that different RSS flit per filter is
+       bool use_bd;     /* Use SGE Back Door intfc for reading SGE Contexts */
+       bool trace_rss; /* 1 implies that different RSS flit per filter is
                         * used per filter else if 0 default RSS flit is
                         * used for all 4 filters.
                         */
@@@ -885,6 -905,21 +885,6 @@@ static inline int is_offload(const stru
        return adap->params.offload;
  }
  
 -static inline int is_t6(enum chip_type chip)
 -{
 -      return CHELSIO_CHIP_VERSION(chip) == CHELSIO_T6;
 -}
 -
 -static inline int is_t5(enum chip_type chip)
 -{
 -      return CHELSIO_CHIP_VERSION(chip) == CHELSIO_T5;
 -}
 -
 -static inline int is_t4(enum chip_type chip)
 -{
 -      return CHELSIO_CHIP_VERSION(chip) == CHELSIO_T4;
 -}
 -
  static inline u32 t4_read_reg(struct adapter *adap, u32 reg_addr)
  {
        return readl(adap->regs + reg_addr);
index 4a230158990241f1a6ab27659f9a2817791c85d8,b6a08177b6ee6d8ff4a0d7a1847c0dc43f3668f7..018c64f4fd25b8cf1ab8db0f3b21e65962a5f45e
@@@ -214,7 -214,6 +214,7 @@@ struct ath10k_fw_stats_pdev 
        s32 hw_queued;
        s32 hw_reaped;
        s32 underrun;
 +      u32 hw_paused;
        s32 tx_abort;
        s32 mpdus_requed;
        u32 tx_ko;
        u32 pdev_resets;
        u32 phy_underrun;
        u32 txop_ovf;
 +      u32 seq_posted;
 +      u32 seq_failed_queueing;
 +      u32 seq_completed;
 +      u32 seq_restarted;
 +      u32 mu_seq_posted;
 +      u32 mpdus_sw_flush;
 +      u32 mpdus_hw_filter;
 +      u32 mpdus_truncated;
 +      u32 mpdus_ack_failed;
 +      u32 mpdus_expired;
  
        /* PDEV RX stats */
        s32 mid_ppdu_route_change;
        s32 phy_errs;
        s32 phy_err_drop;
        s32 mpdu_errs;
 +      s32 rx_ovfl_errs;
  };
  
  struct ath10k_fw_stats {
        struct list_head peers;
  };
  
 +#define ATH10K_TPC_TABLE_TYPE_FLAG    1
 +#define ATH10K_TPC_PREAM_TABLE_END    0xFFFF
 +
 +struct ath10k_tpc_table {
 +      u32 pream_idx[WMI_TPC_RATE_MAX];
 +      u8 rate_code[WMI_TPC_RATE_MAX];
 +      char tpc_value[WMI_TPC_RATE_MAX][WMI_TPC_TX_N_CHAIN * WMI_TPC_BUF_SIZE];
 +};
 +
 +struct ath10k_tpc_stats {
 +      u32 reg_domain;
 +      u32 chan_freq;
 +      u32 phy_mode;
 +      u32 twice_antenna_reduction;
 +      u32 twice_max_rd_power;
 +      s32 twice_antenna_gain;
 +      u32 power_limit;
 +      u32 num_tx_chain;
 +      u32 ctl;
 +      u32 rate_max;
 +      u8 flag[WMI_TPC_FLAG];
 +      struct ath10k_tpc_table tpc_table[WMI_TPC_FLAG];
 +};
 +
  struct ath10k_dfs_stats {
        u32 phy_errors;
        u32 pulses_total;
@@@ -414,11 -378,6 +414,11 @@@ struct ath10k_debug 
        struct ath10k_dfs_stats dfs_stats;
        struct ath_dfs_pool_stats dfs_pool_stats;
  
 +      /* used for tpc-dump storage, protected by data-lock */
 +      struct ath10k_tpc_stats *tpc_stats;
 +
 +      struct completion tpc_complete;
 +
        /* protected by conf_mutex */
        u32 fw_dbglog_mask;
        u32 fw_dbglog_level;
@@@ -509,9 -468,6 +509,9 @@@ enum ath10k_fw_features 
         */
        ATH10K_FW_FEATURE_RAW_MODE_SUPPORT = 10,
  
 +      /* Firmware Supports Adaptive CCA*/
 +      ATH10K_FW_FEATURE_SUPPORTS_ADAPTIVE_CCA = 11,
 +
        /* keep last */
        ATH10K_FW_FEATURE_COUNT,
  };
@@@ -656,11 -612,6 +656,11 @@@ struct ath10k 
  
                u32 channel_counters_freq_hz;
  
 +              /* Mgmt tx descriptors threshold for limiting probe response
 +               * frames.
 +               */
 +              u32 max_probe_resp_desc_thres;
 +
                struct ath10k_hw_params_fw {
                        const char *dir;
                        const char *fw;
                struct ath10k_swap_code_seg_info *firmware_swap_code_seg_info;
        } swap;
  
 -      char spec_board_id[100];
 -      bool spec_board_loaded;
 +      struct {
 +              u32 vendor;
 +              u32 device;
 +              u32 subsystem_vendor;
 +              u32 subsystem_device;
 +
 +              bool bmi_ids_valid;
 +              u8 bmi_board_id;
 +              u8 bmi_chip_id;
 +      } id;
  
        int fw_api;
 +      int bd_api;
        enum ath10k_cal_mode cal_mode;
  
        struct {
        bool monitor_started;
        unsigned int filter_flags;
        unsigned long dev_flags;
-       u32 dfs_block_radar_events;
+       bool dfs_block_radar_events;
  
        /* protected by conf_mutex */
        bool radar_enabled;
        int num_started_vdevs;
  
        /* Protected by conf-mutex */
 -      u8 supp_tx_chainmask;
 -      u8 supp_rx_chainmask;
        u8 cfg_tx_chainmask;
        u8 cfg_rx_chainmask;
  
        struct {
                /* protected by conf_mutex */
                const struct firmware *utf;
 +              char utf_version[32];
 +              const void *utf_firmware_data;
 +              size_t utf_firmware_len;
                DECLARE_BITMAP(orig_fw_features, ATH10K_FW_FEATURE_COUNT);
                enum ath10k_fw_wmi_op_version orig_wmi_op_version;
 -
 +              enum ath10k_fw_wmi_op_version op_version;
                /* protected by data_lock */
                bool utf_monitor;
        } testmode;
index bdfff46419313955aaafc0b37063fe9e4b63e270,8823fadada8906de20b289a18daf11be4e428b5e..41382f89abe1dcbfdb3e226854a312f7ad95809a
@@@ -385,7 -385,7 +385,7 @@@ static void ath9k_hw_init_config(struc
  
        ah->config.dma_beacon_response_time = 1;
        ah->config.sw_beacon_response_time = 6;
-       ah->config.cwm_ignore_extcca = 0;
+       ah->config.cwm_ignore_extcca = false;
        ah->config.analog_shiftreg = 1;
  
        ah->config.rx_intr_mitigation = true;
@@@ -1241,7 -1241,6 +1241,7 @@@ static void ath9k_hw_set_operating_mode
                        break;
                }
                /* fall through */
 +      case NL80211_IFTYPE_OCB:
        case NL80211_IFTYPE_MESH_POINT:
        case NL80211_IFTYPE_AP:
                set |= AR_STA_ID1_STA_AP;
index 4f0a3f6b0c52bab025b332332ef4e30f0a63b343,52971b48ab6af46758b0df02e41f4fc93173191c..831a54415a2512fe890832dcd6ec688d160b1a7c
@@@ -332,14 -332,14 +332,14 @@@ enum ath9k_hw_hang_checks 
  struct ath9k_ops_config {
        int dma_beacon_response_time;
        int sw_beacon_response_time;
-       u32 cwm_ignore_extcca;
+       bool cwm_ignore_extcca;
        u32 pcie_waen;
        u8 analog_shiftreg;
        u32 ofdm_trig_low;
        u32 ofdm_trig_high;
        u32 cck_trig_high;
        u32 cck_trig_low;
-       u32 enable_paprd;
+       bool enable_paprd;
        int serialize_regmode;
        bool rx_intr_mitigation;
        bool tx_intr_mitigation;
@@@ -919,7 -919,7 +919,7 @@@ struct ath_hw 
        struct ar5416IniArray iniCckfirJapan2484;
        struct ar5416IniArray iniModes_9271_ANI_reg;
        struct ar5416IniArray ini_radio_post_sys2ant;
 -      struct ar5416IniArray ini_modes_rxgain_5g_xlna;
 +      struct ar5416IniArray ini_modes_rxgain_xlna;
        struct ar5416IniArray ini_modes_rxgain_bb_core;
        struct ar5416IniArray ini_modes_rxgain_bb_postamble;
  
index c6327cd1d071a862a61fced402b1376e5812d86c,72e8a03a5293fcfcecf0edc93f3da4b760da3966..4bde2d027dcd34ce710722af8416e9c3a1159461
@@@ -82,6 -82,7 +82,6 @@@
  #include "constants.h"
  #include "tof.h"
  
 -#define IWL_INVALID_MAC80211_QUEUE    0xff
  #define IWL_MVM_MAX_ADDRESSES         5
  /* RSSI offset for WkP */
  #define IWL_RSSI_OFFSET 50
@@@ -322,11 -323,11 +322,11 @@@ enum iwl_bt_force_ant_mode 
  struct iwl_mvm_vif_bf_data {
        bool bf_enabled;
        bool ba_enabled;
 -      s8 ave_beacon_signal;
 -      s8 last_cqm_event;
 -      s8 bt_coex_min_thold;
 -      s8 bt_coex_max_thold;
 -      s8 last_bt_coex_event;
 +      int ave_beacon_signal;
 +      int last_cqm_event;
 +      int bt_coex_min_thold;
 +      int bt_coex_max_thold;
 +      int last_bt_coex_event;
  };
  
  /**
   * @bssid: BSSID for this (client) interface
   * @associated: indicates that we're currently associated, used only for
   *    managing the firmware state in iwl_mvm_bss_info_changed_station()
 + * @ap_assoc_sta_count: count of stations associated to us - valid only
 + *    if VIF type is AP
   * @uploaded: indicates the MAC context has been added to the device
   * @ap_ibss_active: indicates that AP/IBSS is configured and that the interface
   *    should get quota etc.
@@@ -368,7 -367,6 +368,7 @@@ struct iwl_mvm_vif 
  
        u8 bssid[ETH_ALEN];
        bool associated;
 +      u8 ap_assoc_sta_count;
  
        bool uploaded;
        bool ap_ibss_active;
@@@ -604,14 -602,7 +604,14 @@@ struct iwl_mvm 
                u64 on_time_scan;
        } radio_stats, accu_radio_stats;
  
 -      u8 queue_to_mac80211[IWL_MAX_HW_QUEUES];
 +      struct {
 +              /* Map to HW queue */
 +              u32 hw_queue_to_mac80211;
 +              u8 hw_queue_refcount;
 +              bool setup_reserved;
 +              u16 tid_bitmap; /* Bitmap of the TIDs mapped to this queue */
 +      } queue_info[IWL_MAX_HW_QUEUES];
 +      spinlock_t queue_info_lock; /* For syncing queue mgmt operations */
        atomic_t mac80211_queue_stop_count[IEEE80211_MAX_QUEUES];
  
        const char *nvm_file_name;
        const struct iwl_fw_bcast_filter *bcast_filters;
  #ifdef CONFIG_IWLWIFI_DEBUGFS
        struct {
-               u32 override; /* u32 for debugfs_create_bool */
+               bool override;
                struct iwl_bcast_filter_cmd cmd;
        } dbgfs_bcast_filtering;
  #endif
        bool disable_power_off;
        bool disable_power_off_d3;
  
-       u32 scan_iter_notif_enabled; /* must be u32 for debugfs_create_bool */
+       bool scan_iter_notif_enabled;
  
        struct debugfs_blob_wrapper nvm_hw_blob;
        struct debugfs_blob_wrapper nvm_sw_blob;
        struct debugfs_blob_wrapper nvm_calib_blob;
        struct debugfs_blob_wrapper nvm_prod_blob;
 +      struct debugfs_blob_wrapper nvm_phy_sku_blob;
  
        struct iwl_mvm_frame_stats drv_rx_stats;
        spinlock_t drv_stats_lock;
        int n_nd_channels;
        bool net_detect;
  #ifdef CONFIG_IWLWIFI_DEBUGFS
-       u32 d3_wake_sysassert; /* must be u32 for debugfs_create_bool */
+       bool d3_wake_sysassert;
        bool d3_test_active;
        bool store_d3_resume_sram;
        void *d3_resume_sram;
@@@ -870,11 -860,6 +870,11 @@@ static inline bool iwl_mvm_is_radio_kil
               test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status);
  }
  
 +static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm)
 +{
 +      return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
 +}
 +
  /* Must be called with rcu_read_lock() held and it can only be
   * released when mvmsta is not needed anymore.
   */
@@@ -922,12 -907,6 +922,12 @@@ static inline bool iwl_mvm_is_d0i3_supp
                           IWL_UCODE_TLV_CAPA_D0I3_SUPPORT);
  }
  
 +static inline bool iwl_mvm_is_dqa_supported(struct iwl_mvm *mvm)
 +{
 +      return fw_has_capa(&mvm->fw->ucode_capa,
 +                         IWL_UCODE_TLV_CAPA_DQA_SUPPORT);
 +}
 +
  static inline bool iwl_mvm_is_lar_supported(struct iwl_mvm *mvm)
  {
        bool nvm_lar = mvm->nvm_data->lar_enabled;
@@@ -955,6 -934,11 +955,6 @@@ static inline bool iwl_mvm_is_wifi_mcc_
                           IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC);
  }
  
 -static inline bool iwl_mvm_is_scd_cfg_supported(struct iwl_mvm *mvm)
 -{
 -      return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_SCD_CFG);
 -}
 -
  static inline bool iwl_mvm_bt_is_plcr_supported(struct iwl_mvm *mvm)
  {
        return fw_has_capa(&mvm->fw->ucode_capa,
@@@ -975,12 -959,6 +975,12 @@@ static inline bool iwl_mvm_is_csum_supp
                           IWL_UCODE_TLV_CAPA_CSUM_SUPPORT);
  }
  
 +static inline bool iwl_mvm_has_new_rx_api(struct iwl_mvm *mvm)
 +{
 +      /* firmware flag isn't defined yet */
 +      return false;
 +}
 +
  extern const u8 iwl_mvm_ac_to_tx_fifo[];
  
  struct iwl_rate_info {
@@@ -1036,7 -1014,7 +1036,7 @@@ const char *iwl_mvm_get_tx_fail_reason(
  #else
  static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; }
  #endif
 -int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, bool sync);
 +int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, u32 flags);
  void iwl_mvm_async_handlers_purge(struct iwl_mvm *mvm);
  
  static inline void iwl_mvm_set_tx_cmd_ccmp(struct ieee80211_tx_info *info,
@@@ -1153,6 -1131,7 +1153,6 @@@ void iwl_mvm_mac_ctxt_recalc_tsf_id(str
                                    struct ieee80211_vif *vif);
  unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm,
                                         struct ieee80211_vif *exclude_vif);
 -
  /* Bindings */
  int iwl_mvm_binding_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
  int iwl_mvm_binding_remove_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
@@@ -1365,20 -1344,14 +1365,20 @@@ static inline bool iwl_mvm_vif_low_late
  }
  
  /* hw scheduler queue config */
 -void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, u16 ssn,
 -                      const struct iwl_trans_txq_scd_cfg *cfg,
 +void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 +                      u16 ssn, const struct iwl_trans_txq_scd_cfg *cfg,
                        unsigned int wdg_timeout);
 -void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, u8 flags);
 +/*
 + * Disable a TXQ.
 + * Note that in non-DQA mode the %mac80211_queue and %tid params are ignored.
 + */
 +void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 +                       u8 tid, u8 flags);
 +int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 minq, u8 maxq);
  
  static inline
 -void iwl_mvm_enable_ac_txq(struct iwl_mvm *mvm, int queue,
 -                         u8 fifo, unsigned int wdg_timeout)
 +void iwl_mvm_enable_ac_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,
 +                         u8 fifo, u16 ssn, unsigned int wdg_timeout)
  {
        struct iwl_trans_txq_scd_cfg cfg = {
                .fifo = fifo,
                .frame_limit = IWL_FRAME_LIMIT,
        };
  
 -      iwl_mvm_enable_txq(mvm, queue, 0, &cfg, wdg_timeout);
 +      iwl_mvm_enable_txq(mvm, queue, mac80211_queue, ssn, &cfg, wdg_timeout);
  }
  
  static inline void iwl_mvm_enable_agg_txq(struct iwl_mvm *mvm, int queue,
 -                                        int fifo, int sta_id, int tid,
 -                                        int frame_limit, u16 ssn,
 -                                        unsigned int wdg_timeout)
 +                                        int mac80211_queue, int fifo,
 +                                        int sta_id, int tid, int frame_limit,
 +                                        u16 ssn, unsigned int wdg_timeout)
  {
        struct iwl_trans_txq_scd_cfg cfg = {
                .fifo = fifo,
                .aggregate = true,
        };
  
 -      iwl_mvm_enable_txq(mvm, queue, ssn, &cfg, wdg_timeout);
 +      iwl_mvm_enable_txq(mvm, queue, mac80211_queue, ssn, &cfg, wdg_timeout);
  }
  
  /* Thermal management and CT-kill */
diff --combined include/linux/edac.h
index b3d87e5822f8aaba74dfe54a0730dffac499d990,7c6b7ba55589439ed09b1a6bde868bc1b82fa3f2..4fe67b853de042d3fcc45910ab929fb320aab33f
@@@ -769,10 -769,12 +769,10 @@@ struct mem_ctl_info 
        /* the internal state of this controller instance */
        int op_state;
  
 -#ifdef CONFIG_EDAC_DEBUG
        struct dentry *debugfs;
        u8 fake_inject_layer[EDAC_MAX_LAYERS];
-       u32 fake_inject_ue;
+       bool fake_inject_ue;
        u16 fake_inject_count;
 -#endif
  };
  
  /*
diff --combined kernel/futex.c
index dfc86e93c31d4a3b8d5e9b0f70ae1c3720411f25,395b967841b4af2870b63892b97b920fac2eb015..684d7549825a4300ced2002a3fbec0a5698a18d1
@@@ -255,18 -255,9 +255,18 @@@ struct futex_hash_bucket 
        struct plist_head chain;
  } ____cacheline_aligned_in_smp;
  
 -static unsigned long __read_mostly futex_hashsize;
 +/*
 + * The base of the bucket array and its size are always used together
 + * (after initialization only in hash_futex()), so ensure that they
 + * reside in the same cacheline.
 + */
 +static struct {
 +      struct futex_hash_bucket *queues;
 +      unsigned long            hashsize;
 +} __futex_data __read_mostly __aligned(2*sizeof(long));
 +#define futex_queues   (__futex_data.queues)
 +#define futex_hashsize (__futex_data.hashsize)
  
 -static struct futex_hash_bucket *futex_queues;
  
  /*
   * Fault injections for futexes.
  static struct {
        struct fault_attr attr;
  
-       u32 ignore_private;
+       bool ignore_private;
  } fail_futex = {
        .attr = FAULT_ATTR_INITIALIZER,
-       .ignore_private = 0,
+       .ignore_private = false,
  };
  
  static int __init setup_fail_futex(char *str)