diff --git a/Makefile b/Makefile
index e891990fbf1c..7e9c23f19fe4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 4
-SUBLEVEL = 78
+SUBLEVEL = 79
 EXTRAVERSION =
 NAME = Saber-toothed Squirrel
 
diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index 99a0a1d2b7dc..b26156bf15db 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -101,7 +101,7 @@ static void sam9_smc_cs_read(void __iomem *base,
        /* Pulse register */
        val = __raw_readl(base + AT91_SMC_PULSE);
 
-       config->nwe_setup = val & AT91_SMC_NWEPULSE;
+       config->nwe_pulse = val & AT91_SMC_NWEPULSE;
        config->ncs_write_pulse = (val & AT91_SMC_NCS_WRPULSE) >> 8;
        config->nrd_pulse = (val & AT91_SMC_NRDPULSE) >> 16;
        config->ncs_read_pulse = (val & AT91_SMC_NCS_RDPULSE) >> 24;
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 92c6b008dd2b..b4437e8a7a8f 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -788,6 +788,9 @@ static void remove_cache_dir(struct cache_dir *cache_dir)
 {
        remove_index_dirs(cache_dir);
 
+       /* Remove cache dir from sysfs */
+       kobject_del(cache_dir->kobj);
+
        kobject_put(cache_dir->kobj);
 
        kfree(cache_dir);
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 2bf03a99c2f9..578613da251e 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -538,7 +538,8 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
        ASSERT(apic != NULL);
 
        /* if initial count is 0, current count should also be 0 */
-       if (apic_get_reg(apic, APIC_TMICT) == 0)
+       if (apic_get_reg(apic, APIC_TMICT) == 0 ||
+               apic->lapic_timer.period == 0)
                return 0;
 
        remaining = hrtimer_get_remaining(&apic->lapic_timer.timer);
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 41223261ede9..b73beba0aa24 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1145,9 +1145,11 @@ static int e752x_get_devs(struct pci_dev *pdev, int 
dev_idx,
        pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
                                pvt->dev_info->err_dev, pvt->bridge_ck);
 
-       if (pvt->bridge_ck == NULL)
+       if (pvt->bridge_ck == NULL) {
                pvt->bridge_ck = pci_scan_single_device(pdev->bus,
                                                        PCI_DEVFN(0, 1));
+               pci_dev_get(pvt->bridge_ck);
+       }
 
        if (pvt->bridge_ck == NULL) {
                e752x_printk(KERN_ERR, "error reporting device not found:"
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 6155c8b261a9..3aed841ce84b 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1805,6 +1805,7 @@ static void raid5_end_write_request(struct bio *bi, int 
error)
                        set_bit(R5_MadeGoodRepl, &sh->dev[i].flags);
        } else {
                if (!uptodate) {
+                       set_bit(STRIPE_DEGRADED, &sh->state);
                        set_bit(WriteErrorSeen, &rdev->flags);
                        set_bit(R5_WriteError, &sh->dev[i].flags);
                        if (!test_and_set_bit(WantReplacement, &rdev->flags))
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e45b8b6d6848..0f05cef53455 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -71,6 +71,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct 
bnx2x_fp_txdata *txdata,
        struct sk_buff *skb = tx_buf->skb;
        u16 bd_idx = TX_BD(tx_buf->first_bd), new_cons;
        int nbd;
+       u16 split_bd_len = 0;
 
        /* prefetch skb end pointer to speedup dev_kfree_skb() */
        prefetch(&skb->end);
@@ -78,10 +79,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct 
bnx2x_fp_txdata *txdata,
        DP(NETIF_MSG_TX_DONE, "fp[%d]: pkt_idx %d  buff @(%p)->skb %p\n",
           txdata->txq_index, idx, tx_buf, skb);
 
-       /* unmap first bd */
        tx_start_bd = &txdata->tx_desc_ring[bd_idx].start_bd;
-       dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd),
-                        BD_UNMAP_LEN(tx_start_bd), DMA_TO_DEVICE);
 
 
        nbd = le16_to_cpu(tx_start_bd->nbd) - 1;
@@ -100,12 +98,19 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct 
bnx2x_fp_txdata *txdata,
        --nbd;
        bd_idx = TX_BD(NEXT_TX_IDX(bd_idx));
 
-       /* ...and the TSO split header bd since they have no mapping */
+       /* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */
        if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) {
+               tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd;
+               split_bd_len = BD_UNMAP_LEN(tx_data_bd);
                --nbd;
                bd_idx = TX_BD(NEXT_TX_IDX(bd_idx));
        }
 
+       /* unmap first bd */
+       dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd),
+                        BD_UNMAP_LEN(tx_start_bd) + split_bd_len,
+                        DMA_TO_DEVICE);
+
        /* now free frags */
        while (nbd > 0) {
 
diff --git a/drivers/net/ethernet/via/via-rhine.c 
b/drivers/net/ethernet/via/via-rhine.c
index 5fa0880e342e..60f4a51153af 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -1601,6 +1601,7 @@ static void rhine_reset_task(struct work_struct *work)
                goto out_unlock;
 
        napi_disable(&rp->napi);
+       netif_tx_disable(dev);
        spin_lock_bh(&rp->lock);
 
        /* clear all descriptors */
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 05cb5f6b8d48..46389a041cee 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -719,8 +719,6 @@ enum b43_firmware_file_type {
 struct b43_request_fw_context {
        /* The device we are requesting the fw for. */
        struct b43_wldev *dev;
-       /* a completion event structure needed if this call is asynchronous */
-       struct completion fw_load_complete;
        /* a pointer to the firmware object */
        const struct firmware *blob;
        /* The type of firmware to request. */
@@ -797,6 +795,8 @@ enum {
 struct b43_wldev {
        struct b43_bus_dev *dev;
        struct b43_wl *wl;
+       /* a completion event structure needed if this call is asynchronous */
+       struct completion fw_load_complete;
 
        /* The device initialization status.
         * Use b43_status() to query. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index f8c4499cf644..b91f55965b3a 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2061,6 +2061,7 @@ void b43_do_release_fw(struct b43_firmware_file *fw)
 
 static void b43_release_firmware(struct b43_wldev *dev)
 {
+       complete(&dev->fw_load_complete);
        b43_do_release_fw(&dev->fw.ucode);
        b43_do_release_fw(&dev->fw.pcm);
        b43_do_release_fw(&dev->fw.initvals);
@@ -2086,7 +2087,7 @@ static void b43_fw_cb(const struct firmware *firmware, 
void *context)
        struct b43_request_fw_context *ctx = context;
 
        ctx->blob = firmware;
-       complete(&ctx->fw_load_complete);
+       complete(&ctx->dev->fw_load_complete);
 }
 
 int b43_do_request_fw(struct b43_request_fw_context *ctx,
@@ -2133,7 +2134,7 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
        }
        if (async) {
                /* do this part asynchronously */
-               init_completion(&ctx->fw_load_complete);
+               init_completion(&ctx->dev->fw_load_complete);
                err = request_firmware_nowait(THIS_MODULE, 1, ctx->fwname,
                                              ctx->dev->dev->dev, GFP_KERNEL,
                                              ctx, b43_fw_cb);
@@ -2141,12 +2142,11 @@ int b43_do_request_fw(struct b43_request_fw_context 
*ctx,
                        pr_err("Unable to load firmware\n");
                        return err;
                }
-               /* stall here until fw ready */
-               wait_for_completion(&ctx->fw_load_complete);
+               wait_for_completion(&ctx->dev->fw_load_complete);
                if (ctx->blob)
                        goto fw_ready;
        /* On some ARM systems, the async request will fail, but the next sync
-        * request works. For this reason, we dall through here
+        * request works. For this reason, we fall through here
         */
        }
        err = request_firmware(&ctx->blob, ctx->fwname,
@@ -2413,6 +2413,7 @@ error:
 
 static int b43_one_core_attach(struct b43_bus_dev *dev, struct b43_wl *wl);
 static void b43_one_core_detach(struct b43_bus_dev *dev);
+static int b43_rng_init(struct b43_wl *wl);
 
 static void b43_request_firmware(struct work_struct *work)
 {
@@ -2459,6 +2460,10 @@ start_ieee80211:
        if (err)
                goto err_one_core_detach;
        b43_leds_register(wl->current_dev);
+
+       /* Register HW RNG driver */
+       b43_rng_init(wl);
+
        goto out;
 
 err_one_core_detach:
@@ -4583,9 +4588,6 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
        if (!dev || b43_status(dev) != B43_STAT_INITIALIZED)
                return;
 
-       /* Unregister HW RNG driver */
-       b43_rng_exit(dev->wl);
-
        b43_set_status(dev, B43_STAT_UNINIT);
 
        /* Stop the microcode PSM. */
@@ -4728,9 +4730,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
 
        b43_set_status(dev, B43_STAT_INITIALIZED);
 
-       /* Register HW RNG driver */
-       b43_rng_init(dev->wl);
-
 out:
        return err;
 
@@ -5388,6 +5387,9 @@ static void b43_bcma_remove(struct bcma_device *core)
 
        b43_one_core_detach(wldev->dev);
 
+       /* Unregister HW RNG driver */
+       b43_rng_exit(wl);
+
        b43_leds_unregister(wl);
 
        ieee80211_free_hw(wl->hw);
@@ -5468,6 +5470,9 @@ static void b43_ssb_remove(struct ssb_device *sdev)
 
        b43_one_core_detach(dev);
 
+       /* Unregister HW RNG driver */
+       b43_rng_exit(wl);
+
        if (list_empty(&wl->devlist)) {
                b43_leds_unregister(wl);
                /* Last core on the chip unregistered.
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 2c5367884b3f..9db0f8e132e6 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -819,10 +819,10 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, 
const void *_rxhdr)
                 * channel number in b43. */
                if (chanstat & B43_RX_CHAN_5GHZ) {
                        status.band = IEEE80211_BAND_5GHZ;
-                       status.freq = b43_freq_to_channel_5ghz(chanid);
+                       status.freq = b43_channel_to_freq_5ghz(chanid);
                } else {
                        status.band = IEEE80211_BAND_2GHZ;
-                       status.freq = b43_freq_to_channel_2ghz(chanid);
+                       status.freq = b43_channel_to_freq_2ghz(chanid);
                }
                break;
        default:
diff --git a/drivers/net/wireless/b43legacy/main.c 
b/drivers/net/wireless/b43legacy/main.c
index 53696efbe155..ce7242454e95 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3915,6 +3915,7 @@ static void b43legacy_remove(struct ssb_device *dev)
         * as the ieee80211 unreg will destroy the workqueue. */
        cancel_work_sync(&wldev->restart_work);
        cancel_work_sync(&wl->firmware_load);
+       complete(&wldev->fw_load_complete);
 
        B43legacy_WARN_ON(!wl);
        if (!wldev->fw.ucode)
diff --git a/drivers/net/wireless/rtlwifi/core.c 
b/drivers/net/wireless/rtlwifi/core.c
index 278e9f957e0d..c3d325823c81 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -175,6 +175,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
                                        rtlpriv->cfg->maps
                                        [RTL_IBSS_INT_MASKS]);
                }
+               mac->link_state = MAC80211_LINKED;
                break;
        case NL80211_IFTYPE_ADHOC:
                RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
index 476342647589..bbe9a788c28b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
@@ -85,17 +85,15 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw 
*hw,
        if (mac->act_scanning) {
                tx_agc[RF90_PATH_A] = 0x3f3f3f3f;
                tx_agc[RF90_PATH_B] = 0x3f3f3f3f;
-               if (turbo_scanoff) {
-                       for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
-                               tx_agc[idx1] = ppowerlevel[idx1] |
-                                   (ppowerlevel[idx1] << 8) |
-                                   (ppowerlevel[idx1] << 16) |
-                                   (ppowerlevel[idx1] << 24);
-                               if (rtlhal->interface == INTF_USB) {
-                                       if (tx_agc[idx1] > 0x20 &&
-                                           rtlefuse->external_pa)
-                                               tx_agc[idx1] = 0x20;
-                               }
+               for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
+                       tx_agc[idx1] = ppowerlevel[idx1] |
+                           (ppowerlevel[idx1] << 8) |
+                           (ppowerlevel[idx1] << 16) |
+                           (ppowerlevel[idx1] << 24);
+                       if (rtlhal->interface == INTF_USB) {
+                               if (tx_agc[idx1] > 0x20 &&
+                                   rtlefuse->external_pa)
+                                       tx_agc[idx1] = 0x20;
                        }
                }
        } else {
@@ -107,7 +105,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw 
*hw,
                           TXHIGHPWRLEVEL_LEVEL2) {
                        tx_agc[RF90_PATH_A] = 0x00000000;
                        tx_agc[RF90_PATH_B] = 0x00000000;
-               } else{
+               } else {
                        for (idx1 = RF90_PATH_A; idx1 <= RF90_PATH_B; idx1++) {
                                tx_agc[idx1] = ppowerlevel[idx1] |
                                    (ppowerlevel[idx1] << 8) |
@@ -379,7 +377,12 @@ static void _rtl92c_write_ofdm_power_reg(struct 
ieee80211_hw *hw,
                            regoffset == RTXAGC_B_MCS07_MCS04)
                                regoffset = 0xc98;
                        for (i = 0; i < 3; i++) {
-                               writeVal = (writeVal > 6) ? (writeVal - 6) : 0;
+                               if (i != 2)
+                                       writeVal = (writeVal > 8) ?
+                                                  (writeVal - 8) : 0;
+                               else
+                                       writeVal = (writeVal > 6) ?
+                                                  (writeVal - 6) : 0;
                                rtl_write_byte(rtlpriv, (u32)(regoffset + i),
                                              (u8)writeVal);
                        }
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 3f869c9f71ee..52a9c338fa47 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -306,6 +306,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
        {RTL_USB_DEVICE(0x0bda, 0x5088, rtl92cu_hal_cfg)}, /*Thinkware-CC&C*/
        {RTL_USB_DEVICE(0x0df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
        {RTL_USB_DEVICE(0x0df6, 0x005c, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/
+       {RTL_USB_DEVICE(0x0df6, 0x0077, rtl92cu_hal_cfg)}, /*Sitecom-WLA2100V2*/
        {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
        {RTL_USB_DEVICE(0x4856, 0x0091, rtl92cu_hal_cfg)}, /*NetweeN - Feixun*/
        /* HP - Lite-On ,8188CUS Slim Combo */
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 0cb64f50cecd..a655ae2d80d3 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2875,8 +2875,6 @@ enum parport_pc_pci_cards {
        syba_2p_epp,
        syba_1p_ecp,
        titan_010l,
-       titan_1284p1,
-       titan_1284p2,
        avlab_1p,
        avlab_2p,
        oxsemi_952,
@@ -2935,8 +2933,6 @@ static struct parport_pc_pci {
        /* syba_2p_epp AP138B */        { 2, { { 0, 0x078 }, { 0, 0x178 }, } },
        /* syba_1p_ecp W83787 */        { 1, { { 0, 0x078 }, } },
        /* titan_010l */                { 1, { { 3, -1 }, } },
-       /* titan_1284p1 */              { 1, { { 0, 1 }, } },
-       /* titan_1284p2 */              { 2, { { 0, 1 }, { 2, 3 }, } },
        /* avlab_1p             */      { 1, { { 0, 1}, } },
        /* avlab_2p             */      { 2, { { 0, 1}, { 2, 3 },} },
        /* The Oxford Semi cards are unusual: 954 doesn't support ECP,
@@ -2952,8 +2948,8 @@ static struct parport_pc_pci {
        /* netmos_9705 */               { 1, { { 0, -1 }, } },
        /* netmos_9715 */               { 2, { { 0, 1 }, { 2, 3 },} },
        /* netmos_9755 */               { 2, { { 0, 1 }, { 2, 3 },} },
-       /* netmos_9805 */               { 1, { { 0, -1 }, } },
-       /* netmos_9815 */               { 2, { { 0, -1 }, { 2, -1 }, } },
+       /* netmos_9805 */               { 1, { { 0, 1 }, } },
+       /* netmos_9815 */               { 2, { { 0, 1 }, { 2, 3 }, } },
        /* netmos_9901 */               { 1, { { 0, -1 }, } },
        /* netmos_9865 */               { 1, { { 0, -1 }, } },
        /* quatech_sppxp100 */          { 1, { { 0, 1 }, } },
@@ -2997,8 +2993,6 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, syba_1p_ecp },
        { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_010L,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_010l },
-       { 0x9710, 0x9805, 0x1000, 0x0010, 0, 0, titan_1284p1 },
-       { 0x9710, 0x9815, 0x1000, 0x0020, 0, 0, titan_1284p2 },
        /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
        /* AFAVLAB_TK9902 */
        { 0x14db, 0x2120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1p},
diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index fdacfcebd175..0076feae0ce3 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -77,6 +77,7 @@ static inline void delayed_sysfs_set(struct led_classdev 
*led_cdev,
 static struct acpi_device_id lis3lv02d_device_ids[] = {
        {"HPQ0004", 0}, /* HP Mobile Data Protection System PNP */
        {"HPQ6000", 0}, /* HP Mobile Data Protection System PNP */
+       {"HPQ6007", 0}, /* HP Mobile Data Protection System PNP */
        {"", 0},
 };
 MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 404fd10ddb21..e991c61eef1d 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1615,7 +1615,7 @@ out:
 static u32 *
 bfad_load_fwimg(struct pci_dev *pdev)
 {
-       if (pdev->device == BFA_PCI_DEVICE_ID_CT2) {
+       if (bfa_asic_id_ct2(pdev->device)) {
                if (bfi_image_ct2_size == 0)
                        bfad_read_firmware(pdev, &bfi_image_ct2,
                                &bfi_image_ct2_size, BFAD_FW_FILE_CT2);
@@ -1625,12 +1625,14 @@ bfad_load_fwimg(struct pci_dev *pdev)
                        bfad_read_firmware(pdev, &bfi_image_ct,
                                &bfi_image_ct_size, BFAD_FW_FILE_CT);
                return bfi_image_ct;
-       } else {
+       } else if (bfa_asic_id_cb(pdev->device)) {
                if (bfi_image_cb_size == 0)
                        bfad_read_firmware(pdev, &bfi_image_cb,
                                &bfi_image_cb_size, BFAD_FW_FILE_CB);
                return bfi_image_cb;
        }
+
+       return NULL;
 }
 
 static void
diff --git a/drivers/staging/rtl8712/usb_intf.c 
b/drivers/staging/rtl8712/usb_intf.c
index 7b3ae00ac54a..1b1bf38e8839 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -361,6 +361,10 @@ static u8 key_2char2num(u8 hch, u8 lch)
        return (hex_to_bin(hch) << 4) | hex_to_bin(lch);
 }
 
+static const struct device_type wlan_type = {
+       .name = "wlan",
+};
+
 /*
  * drv_init() - a device potentially for us
  *
@@ -396,6 +400,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
        padapter->pusb_intf = pusb_intf;
        usb_set_intfdata(pusb_intf, pnetdev);
        SET_NETDEV_DEV(pnetdev, &pusb_intf->dev);
+       pnetdev->dev.type = &wlan_type;
        /* step 2. */
        padapter->dvobj_init = &r8712_usb_dvobj_init;
        padapter->dvobj_deinit = &r8712_usb_dvobj_deinit;
diff --git a/drivers/staging/vt6656/baseband.c 
b/drivers/staging/vt6656/baseband.c
index 858e2a8ee260..4034281efb8e 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -1634,7 +1634,6 @@ BBvUpdatePreEDThreshold(
 
             if( bScanning )
             {   // need Max sensitivity //RSSI -69, -70,....
-                if(pDevice->byBBPreEDIndex == 0) break;
                 pDevice->byBBPreEDIndex = 0;
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); 
//CR201(0xC9)
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x30); 
//CR206(0xCE)
@@ -1777,7 +1776,6 @@ BBvUpdatePreEDThreshold(
 
             if( bScanning )
             {   // need Max sensitivity  //RSSI -69, -70, ...
-                if(pDevice->byBBPreEDIndex == 0) break;
                 pDevice->byBBPreEDIndex = 0;
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); 
//CR201(0xC9)
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x24); 
//CR206(0xCE)
@@ -1929,7 +1927,6 @@ BBvUpdatePreEDThreshold(
         case RF_VT3342A0: //RobertYu:20060627, testing table
             if( bScanning )
             {   // need Max sensitivity  //RSSI -67, -68, ...
-                if(pDevice->byBBPreEDIndex == 0) break;
                 pDevice->byBBPreEDIndex = 0;
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xC9, 0x00); 
//CR201(0xC9)
                 ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xCE, 0x38); 
//CR206(0xCE)
diff --git a/drivers/target/iscsi/iscsi_target.c 
b/drivers/target/iscsi/iscsi_target.c
index 486c5dd45016..8d9100321474 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -50,7 +50,7 @@
 static LIST_HEAD(g_tiqn_list);
 static LIST_HEAD(g_np_list);
 static DEFINE_SPINLOCK(tiqn_lock);
-static DEFINE_SPINLOCK(np_lock);
+static DEFINE_MUTEX(np_lock);
 
 static struct idr tiqn_idr;
 struct idr sess_idr;
@@ -262,6 +262,9 @@ int iscsit_deaccess_np(struct iscsi_np *np, struct 
iscsi_portal_group *tpg)
        return 0;
 }
 
+/*
+ * Called with mutex np_lock held
+ */
 static struct iscsi_np *iscsit_get_np(
        struct __kernel_sockaddr_storage *sockaddr,
        int network_transport)
@@ -272,11 +275,10 @@ static struct iscsi_np *iscsit_get_np(
        int ip_match = 0;
        u16 port;
 
-       spin_lock_bh(&np_lock);
        list_for_each_entry(np, &g_np_list, np_list) {
-               spin_lock(&np->np_thread_lock);
+               spin_lock_bh(&np->np_thread_lock);
                if (np->np_thread_state != ISCSI_NP_THREAD_ACTIVE) {
-                       spin_unlock(&np->np_thread_lock);
+                       spin_unlock_bh(&np->np_thread_lock);
                        continue;
                }
 
@@ -309,13 +311,11 @@ static struct iscsi_np *iscsit_get_np(
                         * while iscsi_tpg_add_network_portal() is called.
                         */
                        np->np_exports++;
-                       spin_unlock(&np->np_thread_lock);
-                       spin_unlock_bh(&np_lock);
+                       spin_unlock_bh(&np->np_thread_lock);
                        return np;
                }
-               spin_unlock(&np->np_thread_lock);
+               spin_unlock_bh(&np->np_thread_lock);
        }
-       spin_unlock_bh(&np_lock);
 
        return NULL;
 }
@@ -329,16 +329,22 @@ struct iscsi_np *iscsit_add_np(
        struct sockaddr_in6 *sock_in6;
        struct iscsi_np *np;
        int ret;
+
+       mutex_lock(&np_lock);
+
        /*
         * Locate the existing struct iscsi_np if already active..
         */
        np = iscsit_get_np(sockaddr, network_transport);
-       if (np)
+       if (np) {
+               mutex_unlock(&np_lock);
                return np;
+       }
 
        np = kzalloc(sizeof(struct iscsi_np), GFP_KERNEL);
        if (!np) {
                pr_err("Unable to allocate memory for struct iscsi_np\n");
+               mutex_unlock(&np_lock);
                return ERR_PTR(-ENOMEM);
        }
 
@@ -361,6 +367,7 @@ struct iscsi_np *iscsit_add_np(
        ret = iscsi_target_setup_login_socket(np, sockaddr);
        if (ret != 0) {
                kfree(np);
+               mutex_unlock(&np_lock);
                return ERR_PTR(ret);
        }
 
@@ -369,6 +376,7 @@ struct iscsi_np *iscsit_add_np(
                pr_err("Unable to create kthread: iscsi_np\n");
                ret = PTR_ERR(np->np_thread);
                kfree(np);
+               mutex_unlock(&np_lock);
                return ERR_PTR(ret);
        }
        /*
@@ -379,10 +387,10 @@ struct iscsi_np *iscsit_add_np(
         * point because iscsi_np has not been added to g_np_list yet.
         */
        np->np_exports = 1;
+       np->np_thread_state = ISCSI_NP_THREAD_ACTIVE;
 
-       spin_lock_bh(&np_lock);
        list_add_tail(&np->np_list, &g_np_list);
-       spin_unlock_bh(&np_lock);
+       mutex_unlock(&np_lock);
 
        pr_debug("CORE[0] - Added Network Portal: %s:%hu on %s\n",
                np->np_ip, np->np_port, (np->np_network_transport == ISCSI_TCP) 
?
@@ -453,9 +461,9 @@ int iscsit_del_np(struct iscsi_np *np)
        }
        iscsit_del_np_comm(np);
 
-       spin_lock_bh(&np_lock);
+       mutex_lock(&np_lock);
        list_del(&np->np_list);
-       spin_unlock_bh(&np_lock);
+       mutex_unlock(&np_lock);
 
        pr_debug("CORE[0] - Removed Network Portal: %s:%hu on %s\n",
                np->np_ip, np->np_port, (np->np_network_transport == ISCSI_TCP) 
?
diff --git a/drivers/tty/serial/8250/8250_pci.c 
b/drivers/tty/serial/8250/8250_pci.c
index 40747feed34c..fdc669cbf7c5 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1142,6 +1142,7 @@ pci_xr17c154_setup(struct serial_private *priv,
 #define PCI_DEVICE_ID_TITAN_800E       0xA014
 #define PCI_DEVICE_ID_TITAN_200EI      0xA016
 #define PCI_DEVICE_ID_TITAN_200EISI    0xA017
+#define PCI_DEVICE_ID_TITAN_200V3      0xA306
 #define PCI_DEVICE_ID_TITAN_400V3      0xA310
 #define PCI_DEVICE_ID_TITAN_410V3      0xA312
 #define PCI_DEVICE_ID_TITAN_800V3      0xA314
@@ -3456,6 +3457,9 @@ static struct pci_device_id serial_pci_tbl[] = {
        {       PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200EISI,
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,
                pbn_oxsemi_2_4000000 },
+       {       PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200V3,
+               PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+               pbn_b0_bt_2_921600 },
        {       PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400V3,
                PCI_ANY_ID, PCI_ANY_ID, 0, 0,
                pbn_b0_4_921600 },
diff --git a/drivers/tty/serial/atmel_serial.c 
b/drivers/tty/serial/atmel_serial.c
index ed7cd378b838..ff58d288c9c8 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1022,12 +1022,24 @@ static int atmel_startup(struct uart_port *port)
 static void atmel_shutdown(struct uart_port *port)
 {
        struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
+
        /*
-        * Ensure everything is stopped.
+        * Clear out any scheduled tasklets before
+        * we destroy the buffers
+        */
+       tasklet_kill(&atmel_port->tasklet);
+
+       /*
+        * Ensure everything is stopped and
+        * disable all interrupts, port and break condition.
         */
        atmel_stop_rx(port);
        atmel_stop_tx(port);
 
+       UART_PUT_CR(port, ATMEL_US_RSTSTA);
+       UART_PUT_IDR(port, -1);
+
+
        /*
         * Shut-down the DMA.
         */
@@ -1054,12 +1066,6 @@ static void atmel_shutdown(struct uart_port *port)
        }
 
        /*
-        * Disable all interrupts, port and break condition.
-        */
-       UART_PUT_CR(port, ATMEL_US_RSTSTA);
-       UART_PUT_IDR(port, -1);
-
-       /*
         * Free the interrupt
         */
        free_irq(port->irq, port);
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 78609d302625..6ed7e7c787d8 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -651,10 +651,6 @@ void usb_destroy_configuration(struct usb_device *dev)
  *
  * hub-only!! ... and only in reset path, or usb_new_device()
  * (used by real hubs and virtual root hubs)
- *
- * NOTE: if this is a WUSB device and is not authorized, we skip the
- *       whole thing. A non-authorized USB device has no
- *       configurations.
  */
 int usb_get_configuration(struct usb_device *dev)
 {
@@ -666,8 +662,6 @@ int usb_get_configuration(struct usb_device *dev)
        struct usb_config_descriptor *desc;
 
        cfgno = 0;
-       if (dev->authorized == 0)       /* Not really an error */
-               goto out_not_authorized;
        result = -ENOMEM;
        if (ncfg > USB_MAXCONFIG) {
                dev_warn(ddev, "too many configurations: %d, "
@@ -749,7 +743,6 @@ int usb_get_configuration(struct usb_device *dev)
 
 err:
        kfree(desc);
-out_not_authorized:
        dev->descriptor.bNumConfigurations = cfgno;
 err2:
        if (result == -ENOMEM)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 14476faf9a00..609f5a7db3f3 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1919,18 +1919,13 @@ static int usb_enumerate_device(struct usb_device *udev)
                        goto fail;
                }
        }
-       if (udev->wusb == 1 && udev->authorized == 0) {
-               udev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-               udev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-               udev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-       }
-       else {
-               /* read the standard strings and cache them if present */
-               udev->product = usb_cache_string(udev, 
udev->descriptor.iProduct);
-               udev->manufacturer = usb_cache_string(udev,
-                                                     
udev->descriptor.iManufacturer);
-               udev->serial = usb_cache_string(udev, 
udev->descriptor.iSerialNumber);
-       }
+
+       /* read the standard strings and cache them if present */
+       udev->product = usb_cache_string(udev, udev->descriptor.iProduct);
+       udev->manufacturer = usb_cache_string(udev,
+                                             udev->descriptor.iManufacturer);
+       udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);
+
        err = usb_enumerate_device_otg(udev);
 fail:
        return err;
@@ -2084,16 +2079,6 @@ int usb_deauthorize_device(struct usb_device *usb_dev)
        usb_dev->authorized = 0;
        usb_set_configuration(usb_dev, -1);
 
-       kfree(usb_dev->product);
-       usb_dev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-       kfree(usb_dev->manufacturer);
-       usb_dev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-       kfree(usb_dev->serial);
-       usb_dev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
-
-       usb_destroy_configuration(usb_dev);
-       usb_dev->descriptor.bNumConfigurations = 0;
-
 out_unauthorized:
        usb_unlock_device(usb_dev);
        return 0;
@@ -2121,17 +2106,7 @@ int usb_authorize_device(struct usb_device *usb_dev)
                goto error_device_descriptor;
        }
 
-       kfree(usb_dev->product);
-       usb_dev->product = NULL;
-       kfree(usb_dev->manufacturer);
-       usb_dev->manufacturer = NULL;
-       kfree(usb_dev->serial);
-       usb_dev->serial = NULL;
-
        usb_dev->authorized = 1;
-       result = usb_enumerate_device(usb_dev);
-       if (result < 0)
-               goto error_enumerate;
        /* Choose and set the configuration.  This registers the interfaces
         * with the driver core and lets interface drivers bind to them.
         */
@@ -2147,7 +2122,6 @@ int usb_authorize_device(struct usb_device *usb_dev)
        }
        dev_info(&usb_dev->dev, "authorized to connect\n");
 
-error_enumerate:
 error_device_descriptor:
        usb_autosuspend_device(usb_dev);
 error_autoresume:
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index c8ea954ede9f..b98066887127 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -315,6 +315,9 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
        struct usb_hcd *hcd = xhci_to_hcd(xhci);
        struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
 
+       if (xhci->quirks & XHCI_PLAT)
+               return;
+
        xhci_free_irq(xhci);
 
        if (xhci->msix_entries) {
diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h
index b461311a2ae7..ce13e61b7d55 100644
--- a/drivers/usb/serial/cypress_m8.h
+++ b/drivers/usb/serial/cypress_m8.h
@@ -63,7 +63,7 @@
 #define UART_DSR       0x20    /* data set ready - flow control - device to 
host */
 #define CONTROL_RTS    0x10    /* request to send - flow control - host to 
device */
 #define UART_CTS       0x10    /* clear to send - flow control - device to 
host */
-#define UART_RI                0x10    /* ring indicator - modem - device to 
host */
+#define UART_RI                0x80    /* ring indicator - modem - device to 
host */
 #define UART_CD                0x40    /* carrier detect - modem - device to 
host */
 #define CYP_ERROR      0x08    /* received from input report - device to host 
*/
 /* Note - the below has nothing to do with the "feature report" reset */
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 66f5e5472c17..9d7e865a518f 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -325,6 +325,9 @@ static void option_instat_callback(struct urb *urb);
  * It seems to contain a Qualcomm QSC6240/6290 chipset            */
 #define FOUR_G_SYSTEMS_PRODUCT_W14             0x9603
 
+/* iBall 3.5G connect wireless modem */
+#define IBALL_3_5G_CONNECT                     0x9605
+
 /* Zoom */
 #define ZOOM_PRODUCT_4597                      0x9607
 
@@ -1461,6 +1464,17 @@ static const struct usb_device_id option_ids[] = {
                .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 
0xff),
                .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xffe9, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8b, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8c, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8d, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8e, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff8f, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff90, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff91, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff92, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff93, 0xff, 0xff, 
0xff) },
+       { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff94, 0xff, 0xff, 
0xff) },
 
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 
0xff, 0xff, 0xff) },
        { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 
0xff, 0xff, 0xff) },
@@ -1509,6 +1523,7 @@ static const struct usb_device_id option_ids[] = {
          .driver_info = (kernel_ulong_t)&four_g_w14_blacklist
        },
        { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
+       { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) },
        { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
        /* Pirelli  */
        { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index cf442e012da3..08d69e5fc143 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -226,6 +226,13 @@ UNUSUAL_DEV(  0x0421, 0x0495, 0x0370, 0x0370,
                USB_SC_DEVICE, USB_PR_DEVICE, NULL,
                US_FL_MAX_SECTORS_64 ),
 
+/* Patch submitted by Mikhail Zolotaryov <[email protected]> */
+UNUSUAL_DEV(  0x0421, 0x06aa, 0x1110, 0x1110,
+               "Nokia",
+               "502",
+               USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+               US_FL_MAX_SECTORS_64 ),
+
 #ifdef NO_SDDR09
 UNUSUAL_DEV(  0x0436, 0x0005, 0x0100, 0x0100,
                "Microtech",
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c4f0a9936f88..224ce21cc0ac 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7033,7 +7033,7 @@ out:
         */
        if (root_dropped == false)
                btrfs_add_dead_root(root);
-       if (err)
+       if (err && err != -EAGAIN)
                btrfs_std_error(root->fs_info, err);
        return err;
 }
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 6baa73dcfce1..4f42a9cb5604 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -24,6 +24,7 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
 void hugepage_put_subpool(struct hugepage_subpool *spool);
 
 int PageHuge(struct page *page);
+int PageHeadHuge(struct page *page_head);
 
 void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
 int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, 
loff_t *);
@@ -85,6 +86,11 @@ static inline int PageHuge(struct page *page)
        return 0;
 }
 
+static inline int PageHeadHuge(struct page *page_head)
+{
+       return 0;
+}
+
 static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
 {
 }
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index af20b77a624a..7111f2f5af68 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -679,6 +679,23 @@ int PageHuge(struct page *page)
 }
 EXPORT_SYMBOL_GPL(PageHuge);
 
+/*
+ * PageHeadHuge() only returns true for hugetlbfs head page, but not for
+ * normal or transparent huge pages.
+ */
+int PageHeadHuge(struct page *page_head)
+{
+       compound_page_dtor *dtor;
+
+       if (!PageHead(page_head))
+               return 0;
+
+       dtor = get_compound_page_dtor(page_head);
+
+       return dtor == free_huge_page;
+}
+EXPORT_SYMBOL_GPL(PageHeadHuge);
+
 pgoff_t __basepage_index(struct page *page)
 {
        struct page *page_head = compound_head(page);
diff --git a/mm/swap.c b/mm/swap.c
index f689e9a03204..a8feea68a606 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -77,18 +77,6 @@ static void __put_compound_page(struct page *page)
 
 static void put_compound_page(struct page *page)
 {
-       /*
-        * hugetlbfs pages cannot be split from under us.  If this is a
-        * hugetlbfs page, check refcount on head page and release the page if
-        * the refcount becomes zero.
-        */
-       if (PageHuge(page)) {
-               page = compound_head(page);
-               if (put_page_testzero(page))
-                       __put_compound_page(page);
-               return;
-       }
-
        if (unlikely(PageTail(page))) {
                /* __split_huge_page_refcount can run under us */
                struct page *page_head = compound_trans_head(page);
@@ -96,6 +84,35 @@ static void put_compound_page(struct page *page)
                if (likely(page != page_head &&
                           get_page_unless_zero(page_head))) {
                        unsigned long flags;
+
+                        if (PageHeadHuge(page_head)) {
+                               if (likely(PageTail(page))) {
+                                       /*
+                                        * __split_huge_page_refcount
+                                        * cannot race here.
+                                        */
+                                       VM_BUG_ON(!PageHead(page_head));
+                                       atomic_dec(&page->_mapcount);
+                                       if (put_page_testzero(page_head))
+                                               VM_BUG_ON(1);
+                                       if (put_page_testzero(page_head))
+                                               __put_compound_page(page_head);
+                                       return;
+                               } else {
+                                       /*
+                                        * __split_huge_page_refcount
+                                        * run before us, "page" was a
+                                        * THP tail. The split
+                                        * page_head has been freed
+                                        * and reallocated as slab or
+                                        * hugetlbfs page of smaller
+                                        * order (only possible if
+                                        * reallocated as slab on
+                                        * x86).
+                                        */
+                                       goto skip_lock;
+                               }
+                       }
                        /*
                         * page_head wasn't a dangling pointer but it
                         * may not be a head page anymore by the time
@@ -107,9 +124,29 @@ static void put_compound_page(struct page *page)
                                /* __split_huge_page_refcount run before us */
                                compound_unlock_irqrestore(page_head, flags);
                                VM_BUG_ON(PageHead(page_head));
-                               if (put_page_testzero(page_head))
-                                       __put_single_page(page_head);
-                       out_put_single:
+skip_lock:
+                               if (put_page_testzero(page_head)) {
+                                       /*
+                                        * The head page may have been
+                                        * freed and reallocated as a
+                                        * compound page of smaller
+                                        * order and then freed again.
+                                        * All we know is that it
+                                        * cannot have become: a THP
+                                        * page, a compound page of
+                                        * higher order, a tail page.
+                                        * That is because we still
+                                        * hold the refcount of the
+                                        * split THP tail and
+                                        * page_head was the THP head
+                                        * before the split.
+                                        */
+                                       if (PageHead(page_head))
+                                               __put_compound_page(page_head);
+                                       else
+                                               __put_single_page(page_head);
+                               }
+out_put_single:
                                if (put_page_testzero(page))
                                        __put_single_page(page);
                                return;
@@ -173,21 +210,34 @@ bool __get_page_tail(struct page *page)
         */
        unsigned long flags;
        bool got = false;
-       struct page *page_head;
+       struct page *page_head = compound_trans_head(page);
 
-       /*
-        * If this is a hugetlbfs page it cannot be split under us.  Simply
-        * increment refcount for the head page.
-        */
-       if (PageHuge(page)) {
-               page_head = compound_head(page);
-               atomic_inc(&page_head->_count);
-               got = true;
-               goto out;
-       }
-
-       page_head = compound_trans_head(page);
        if (likely(page != page_head && get_page_unless_zero(page_head))) {
+               /* Ref to put_compound_page() comment. */
+               if (PageHeadHuge(page_head)) {
+                       if (likely(PageTail(page))) {
+                               /*
+                                * This is a hugetlbfs
+                                * page. __split_huge_page_refcount
+                                * cannot race here.
+                                */
+                               VM_BUG_ON(!PageHead(page_head));
+                               __get_page_tail_foll(page, false);
+                               return true;
+                       } else {
+                               /*
+                                * __split_huge_page_refcount run
+                                * before us, "page" was a THP
+                                * tail. The split page_head has been
+                                * freed and reallocated as slab or
+                                * hugetlbfs page of smaller order
+                                * (only possible if reallocated as
+                                * slab on x86).
+                                */
+                               put_page(page_head);
+                               return false;
+                       }
+               }
                /*
                 * page_head wasn't a dangling pointer but it
                 * may not be a head page anymore by the time
@@ -204,7 +254,6 @@ bool __get_page_tail(struct page *page)
                if (unlikely(!got))
                        put_page(page_head);
        }
-out:
        return got;
 }
 EXPORT_SYMBOL(__get_page_tail);
diff --git a/net/compat.c b/net/compat.c
index 17f997e14f63..93f542335e19 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -789,21 +789,16 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct 
compat_mmsghdr __user *mmsg,
        if (flags & MSG_CMSG_COMPAT)
                return -EINVAL;
 
-       if (COMPAT_USE_64BIT_TIME)
-               return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
-                                     flags | MSG_CMSG_COMPAT,
-                                     (struct timespec *) timeout);
-
        if (timeout == NULL)
                return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                      flags | MSG_CMSG_COMPAT, NULL);
 
-       if (get_compat_timespec(&ktspec, timeout))
+       if (compat_get_timespec(&ktspec, timeout))
                return -EFAULT;
 
        datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                   flags | MSG_CMSG_COMPAT, &ktspec);
-       if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
+       if (datagrams > 0 && compat_put_timespec(&ktspec, timeout))
                datagrams = -EFAULT;
 
        return datagrams;
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 5fcc8df3f179..8cb3091c8f63 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -941,7 +941,7 @@ next_normal:
                        ++num;
                }
 
-               if (r->idiag_states & TCPF_TIME_WAIT) {
+               if (r->idiag_states & (TCPF_TIME_WAIT | TCPF_FIN_WAIT2)) {
                        struct inet_timewait_sock *tw;
 
                        inet_twsk_for_each(tw, node,
@@ -949,6 +949,8 @@ next_normal:
 
                                if (num < s_num)
                                        goto next_dying;
+                               if (!(r->idiag_states & (1 << tw->tw_substate)))
+                                       goto next_dying;
                                if (r->sdiag_family != AF_UNSPEC &&
                                                tw->tw_family != 
r->sdiag_family)
                                        goto next_dying;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index a0b7166badb0..94cd1ef1e319 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -154,9 +154,12 @@ static struct mr_table *ipmr_get_table(struct net *net, 
u32 id)
 static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4,
                           struct mr_table **mrt)
 {
-       struct ipmr_result res;
-       struct fib_lookup_arg arg = { .result = &res, };
        int err;
+       struct ipmr_result res;
+       struct fib_lookup_arg arg = {
+               .result = &res,
+               .flags = FIB_LOOKUP_NOREF,
+       };
 
        err = fib_rules_lookup(net->ipv4.mr_rules_ops,
                               flowi4_to_flowi(flp4), 0, &arg);
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index d5e4615e52c4..abe1f768b5b6 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -138,9 +138,12 @@ static struct mr6_table *ip6mr_get_table(struct net *net, 
u32 id)
 static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6,
                            struct mr6_table **mrt)
 {
-       struct ip6mr_result res;
-       struct fib_lookup_arg arg = { .result = &res, };
        int err;
+       struct ip6mr_result res;
+       struct fib_lookup_arg arg = {
+               .result = &res,
+               .flags = FIB_LOOKUP_NOREF,
+       };
 
        err = fib_rules_lookup(net->ipv6.mr6_rules_ops,
                               flowi6_to_flowi(flp6), 0, &arg);
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 5ca0939e4223..cb53e8d97ff1 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -30,6 +30,7 @@ config SND_ALS300
        select SND_PCM
        select SND_AC97_CODEC
        select SND_OPL3_LIB
+       select ZONE_DMA
        help
          Say 'Y' or 'M' to include support for Avance Logic ALS300/ALS300+
 
@@ -54,6 +55,7 @@ config SND_ALI5451
        tristate "ALi M5451 PCI Audio Controller"
        select SND_MPU401_UART
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for the integrated AC97 sound
          device on motherboards using the ALi M5451 Audio Controller
@@ -158,6 +160,7 @@ config SND_AZT3328
        select SND_PCM
        select SND_RAWMIDI
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for Aztech AZF3328 (PCI168)
          soundcards.
@@ -463,6 +466,7 @@ config SND_EMU10K1
        select SND_HWDEP
        select SND_RAWMIDI
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y to include support for Sound Blaster PCI 512, Live!,
          Audigy and E-mu APS (partially supported) soundcards.
@@ -478,6 +482,7 @@ config SND_EMU10K1X
        tristate "Emu10k1X (Dell OEM Version)"
        select SND_AC97_CODEC
        select SND_RAWMIDI
+       select ZONE_DMA
        help
          Say Y here to include support for the Dell OEM version of the
          Sound Blaster Live!.
@@ -511,6 +516,7 @@ config SND_ES1938
        select SND_OPL3_LIB
        select SND_MPU401_UART
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for soundcards based on ESS Solo-1
          (ES1938, ES1946, ES1969) chips.
@@ -522,6 +528,7 @@ config SND_ES1968
        tristate "ESS ES1968/1978 (Maestro-1/2/2E)"
        select SND_MPU401_UART
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for soundcards based on ESS Maestro
          1/2/2E chips.
@@ -602,6 +609,7 @@ config SND_ICE1712
        select SND_MPU401_UART
        select SND_AC97_CODEC
        select BITREVERSE
+       select ZONE_DMA
        help
          Say Y here to include support for soundcards based on the
          ICE1712 (Envy24) chip.
@@ -688,6 +696,7 @@ config SND_LX6464ES
 config SND_MAESTRO3
        tristate "ESS Allegro/Maestro3"
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for soundcards based on ESS Maestro 3
          (Allegro) chips.
@@ -782,6 +791,7 @@ config SND_SIS7019
        tristate "SiS 7019 Audio Accelerator"
        depends on X86 && !X86_64
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for the SiS 7019 Audio Accelerator.
 
@@ -793,6 +803,7 @@ config SND_SONICVIBES
        select SND_OPL3_LIB
        select SND_MPU401_UART
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for soundcards based on the S3
          SonicVibes chip.
@@ -804,6 +815,7 @@ config SND_TRIDENT
        tristate "Trident 4D-Wave DX/NX; SiS 7018"
        select SND_MPU401_UART
        select SND_AC97_CODEC
+       select ZONE_DMA
        help
          Say Y here to include support for soundcards based on Trident
          4D-Wave DX/NX or SiS 7018 chips.
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index b737d1619cc7..f466080b8724 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -285,7 +285,7 @@ static char channel_map_9636_ds[26] = {
        /* ADAT channels are remapped */
        1, 3, 5, 7, 9, 11, 13, 15,
        /* channels 8 and 9 are S/PDIF */
-       24, 25
+       24, 25,
        /* others don't exist */
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
 };
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 78e9ce48bb99..192fc75f1f20 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -64,7 +64,7 @@
 
 #define ADAU1701_SEROCTL_WORD_LEN_24   0x0000
 #define ADAU1701_SEROCTL_WORD_LEN_20   0x0001
-#define ADAU1701_SEROCTL_WORD_LEN_16   0x0010
+#define ADAU1701_SEROCTL_WORD_LEN_16   0x0002
 #define ADAU1701_SEROCTL_WORD_LEN_MASK 0x0003
 
 #define ADAU1701_AUXNPOW_VBPD          0x40
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to