diff options
Diffstat (limited to 'drivers')
33 files changed, 268 insertions, 140 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c index 9764045428ce..b7e7b49d8f62 100644 --- a/drivers/gpu/drm/gma500/cdv_device.c +++ b/drivers/gpu/drm/gma500/cdv_device.c | |||
| @@ -78,21 +78,6 @@ static int cdv_backlight_combination_mode(struct drm_device *dev) | |||
| 78 | return REG_READ(BLC_PWM_CTL2) & PWM_LEGACY_MODE; | 78 | return REG_READ(BLC_PWM_CTL2) & PWM_LEGACY_MODE; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static int cdv_get_brightness(struct backlight_device *bd) | ||
| 82 | { | ||
| 83 | struct drm_device *dev = bl_get_data(bd); | ||
| 84 | u32 val = REG_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | ||
| 85 | |||
| 86 | if (cdv_backlight_combination_mode(dev)) { | ||
| 87 | u8 lbpc; | ||
| 88 | |||
| 89 | val &= ~1; | ||
| 90 | pci_read_config_byte(dev->pdev, 0xF4, &lbpc); | ||
| 91 | val *= lbpc; | ||
| 92 | } | ||
| 93 | return val; | ||
| 94 | } | ||
| 95 | |||
| 96 | static u32 cdv_get_max_backlight(struct drm_device *dev) | 81 | static u32 cdv_get_max_backlight(struct drm_device *dev) |
| 97 | { | 82 | { |
| 98 | u32 max = REG_READ(BLC_PWM_CTL); | 83 | u32 max = REG_READ(BLC_PWM_CTL); |
| @@ -110,6 +95,22 @@ static u32 cdv_get_max_backlight(struct drm_device *dev) | |||
| 110 | return max; | 95 | return max; |
| 111 | } | 96 | } |
| 112 | 97 | ||
| 98 | static int cdv_get_brightness(struct backlight_device *bd) | ||
| 99 | { | ||
| 100 | struct drm_device *dev = bl_get_data(bd); | ||
| 101 | u32 val = REG_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | ||
| 102 | |||
| 103 | if (cdv_backlight_combination_mode(dev)) { | ||
| 104 | u8 lbpc; | ||
| 105 | |||
| 106 | val &= ~1; | ||
| 107 | pci_read_config_byte(dev->pdev, 0xF4, &lbpc); | ||
| 108 | val *= lbpc; | ||
| 109 | } | ||
| 110 | return (val * 100)/cdv_get_max_backlight(dev); | ||
| 111 | |||
| 112 | } | ||
| 113 | |||
| 113 | static int cdv_set_brightness(struct backlight_device *bd) | 114 | static int cdv_set_brightness(struct backlight_device *bd) |
| 114 | { | 115 | { |
| 115 | struct drm_device *dev = bl_get_data(bd); | 116 | struct drm_device *dev = bl_get_data(bd); |
| @@ -120,6 +121,9 @@ static int cdv_set_brightness(struct backlight_device *bd) | |||
| 120 | if (level < 1) | 121 | if (level < 1) |
| 121 | level = 1; | 122 | level = 1; |
| 122 | 123 | ||
| 124 | level *= cdv_get_max_backlight(dev); | ||
| 125 | level /= 100; | ||
| 126 | |||
| 123 | if (cdv_backlight_combination_mode(dev)) { | 127 | if (cdv_backlight_combination_mode(dev)) { |
| 124 | u32 max = cdv_get_max_backlight(dev); | 128 | u32 max = cdv_get_max_backlight(dev); |
| 125 | u8 lbpc; | 129 | u8 lbpc; |
| @@ -157,7 +161,6 @@ static int cdv_backlight_init(struct drm_device *dev) | |||
| 157 | 161 | ||
| 158 | cdv_backlight_device->props.brightness = | 162 | cdv_backlight_device->props.brightness = |
| 159 | cdv_get_brightness(cdv_backlight_device); | 163 | cdv_get_brightness(cdv_backlight_device); |
| 160 | cdv_backlight_device->props.max_brightness = cdv_get_max_backlight(dev); | ||
| 161 | backlight_update_status(cdv_backlight_device); | 164 | backlight_update_status(cdv_backlight_device); |
| 162 | dev_priv->backlight_device = cdv_backlight_device; | 165 | dev_priv->backlight_device = cdv_backlight_device; |
| 163 | return 0; | 166 | return 0; |
diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.c index 4f186eca3a30..c430bd424681 100644 --- a/drivers/gpu/drm/gma500/opregion.c +++ b/drivers/gpu/drm/gma500/opregion.c | |||
| @@ -144,6 +144,8 @@ struct opregion_asle { | |||
| 144 | 144 | ||
| 145 | #define ASLE_CBLV_VALID (1<<31) | 145 | #define ASLE_CBLV_VALID (1<<31) |
| 146 | 146 | ||
| 147 | static struct psb_intel_opregion *system_opregion; | ||
| 148 | |||
| 147 | static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) | 149 | static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) |
| 148 | { | 150 | { |
| 149 | struct drm_psb_private *dev_priv = dev->dev_private; | 151 | struct drm_psb_private *dev_priv = dev->dev_private; |
| @@ -205,7 +207,7 @@ void psb_intel_opregion_enable_asle(struct drm_device *dev) | |||
| 205 | struct drm_psb_private *dev_priv = dev->dev_private; | 207 | struct drm_psb_private *dev_priv = dev->dev_private; |
| 206 | struct opregion_asle *asle = dev_priv->opregion.asle; | 208 | struct opregion_asle *asle = dev_priv->opregion.asle; |
| 207 | 209 | ||
| 208 | if (asle) { | 210 | if (asle && system_opregion ) { |
| 209 | /* Don't do this on Medfield or other non PC like devices, they | 211 | /* Don't do this on Medfield or other non PC like devices, they |
| 210 | use the bit for something different altogether */ | 212 | use the bit for something different altogether */ |
| 211 | psb_enable_pipestat(dev_priv, 0, PIPE_LEGACY_BLC_EVENT_ENABLE); | 213 | psb_enable_pipestat(dev_priv, 0, PIPE_LEGACY_BLC_EVENT_ENABLE); |
| @@ -221,7 +223,6 @@ void psb_intel_opregion_enable_asle(struct drm_device *dev) | |||
| 221 | #define ACPI_EV_LID (1<<1) | 223 | #define ACPI_EV_LID (1<<1) |
| 222 | #define ACPI_EV_DOCK (1<<2) | 224 | #define ACPI_EV_DOCK (1<<2) |
| 223 | 225 | ||
| 224 | static struct psb_intel_opregion *system_opregion; | ||
| 225 | 226 | ||
| 226 | static int psb_intel_opregion_video_event(struct notifier_block *nb, | 227 | static int psb_intel_opregion_video_event(struct notifier_block *nb, |
| 227 | unsigned long val, void *data) | 228 | unsigned long val, void *data) |
| @@ -266,9 +267,6 @@ void psb_intel_opregion_init(struct drm_device *dev) | |||
| 266 | system_opregion = opregion; | 267 | system_opregion = opregion; |
| 267 | register_acpi_notifier(&psb_intel_opregion_notifier); | 268 | register_acpi_notifier(&psb_intel_opregion_notifier); |
| 268 | } | 269 | } |
| 269 | |||
| 270 | if (opregion->asle) | ||
| 271 | psb_intel_opregion_enable_asle(dev); | ||
| 272 | } | 270 | } |
| 273 | 271 | ||
| 274 | void psb_intel_opregion_fini(struct drm_device *dev) | 272 | void psb_intel_opregion_fini(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/gma500/opregion.h b/drivers/gpu/drm/gma500/opregion.h index 72dc6b921265..4a90f8b0e16c 100644 --- a/drivers/gpu/drm/gma500/opregion.h +++ b/drivers/gpu/drm/gma500/opregion.h | |||
| @@ -27,6 +27,7 @@ extern void psb_intel_opregion_asle_intr(struct drm_device *dev); | |||
| 27 | extern void psb_intel_opregion_init(struct drm_device *dev); | 27 | extern void psb_intel_opregion_init(struct drm_device *dev); |
| 28 | extern void psb_intel_opregion_fini(struct drm_device *dev); | 28 | extern void psb_intel_opregion_fini(struct drm_device *dev); |
| 29 | extern int psb_intel_opregion_setup(struct drm_device *dev); | 29 | extern int psb_intel_opregion_setup(struct drm_device *dev); |
| 30 | extern void psb_intel_opregion_enable_asle(struct drm_device *dev); | ||
| 30 | 31 | ||
| 31 | #else | 32 | #else |
| 32 | 33 | ||
| @@ -46,4 +47,8 @@ extern inline int psb_intel_opregion_setup(struct drm_device *dev) | |||
| 46 | { | 47 | { |
| 47 | return 0; | 48 | return 0; |
| 48 | } | 49 | } |
| 50 | |||
| 51 | extern inline void psb_intel_opregion_enable_asle(struct drm_device *dev) | ||
| 52 | { | ||
| 53 | } | ||
| 49 | #endif | 54 | #endif |
diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c index eff039bf92d4..5971bc82b765 100644 --- a/drivers/gpu/drm/gma500/psb_device.c +++ b/drivers/gpu/drm/gma500/psb_device.c | |||
| @@ -144,6 +144,10 @@ static int psb_backlight_init(struct drm_device *dev) | |||
| 144 | psb_backlight_device->props.max_brightness = 100; | 144 | psb_backlight_device->props.max_brightness = 100; |
| 145 | backlight_update_status(psb_backlight_device); | 145 | backlight_update_status(psb_backlight_device); |
| 146 | dev_priv->backlight_device = psb_backlight_device; | 146 | dev_priv->backlight_device = psb_backlight_device; |
| 147 | |||
| 148 | /* This must occur after the backlight is properly initialised */ | ||
| 149 | psb_lid_timer_init(dev_priv); | ||
| 150 | |||
| 147 | return 0; | 151 | return 0; |
| 148 | } | 152 | } |
| 149 | 153 | ||
| @@ -354,13 +358,6 @@ static int psb_chip_setup(struct drm_device *dev) | |||
| 354 | return 0; | 358 | return 0; |
| 355 | } | 359 | } |
| 356 | 360 | ||
| 357 | /* Not exactly an erratum more an irritation */ | ||
| 358 | static void psb_chip_errata(struct drm_device *dev) | ||
| 359 | { | ||
| 360 | struct drm_psb_private *dev_priv = dev->dev_private; | ||
| 361 | psb_lid_timer_init(dev_priv); | ||
| 362 | } | ||
| 363 | |||
| 364 | static void psb_chip_teardown(struct drm_device *dev) | 361 | static void psb_chip_teardown(struct drm_device *dev) |
| 365 | { | 362 | { |
| 366 | struct drm_psb_private *dev_priv = dev->dev_private; | 363 | struct drm_psb_private *dev_priv = dev->dev_private; |
| @@ -379,7 +376,6 @@ const struct psb_ops psb_chip_ops = { | |||
| 379 | .sgx_offset = PSB_SGX_OFFSET, | 376 | .sgx_offset = PSB_SGX_OFFSET, |
| 380 | .chip_setup = psb_chip_setup, | 377 | .chip_setup = psb_chip_setup, |
| 381 | .chip_teardown = psb_chip_teardown, | 378 | .chip_teardown = psb_chip_teardown, |
| 382 | .errata = psb_chip_errata, | ||
| 383 | 379 | ||
| 384 | .crtc_helper = &psb_intel_helper_funcs, | 380 | .crtc_helper = &psb_intel_helper_funcs, |
| 385 | .crtc_funcs = &psb_intel_crtc_funcs, | 381 | .crtc_funcs = &psb_intel_crtc_funcs, |
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index caba6e08693c..a8858a907f47 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c | |||
| @@ -374,6 +374,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 374 | 374 | ||
| 375 | if (ret) | 375 | if (ret) |
| 376 | return ret; | 376 | return ret; |
| 377 | psb_intel_opregion_enable_asle(dev); | ||
| 377 | #if 0 | 378 | #if 0 |
| 378 | /*enable runtime pm at last*/ | 379 | /*enable runtime pm at last*/ |
| 379 | pm_runtime_enable(&dev->pdev->dev); | 380 | pm_runtime_enable(&dev->pdev->dev); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 5c1bc995e560..f10221f40803 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
| @@ -123,7 +123,7 @@ static void ipoib_ud_skb_put_frags(struct ipoib_dev_priv *priv, | |||
| 123 | 123 | ||
| 124 | skb_frag_size_set(frag, size); | 124 | skb_frag_size_set(frag, size); |
| 125 | skb->data_len += size; | 125 | skb->data_len += size; |
| 126 | skb->truesize += size; | 126 | skb->truesize += PAGE_SIZE; |
| 127 | } else | 127 | } else |
| 128 | skb_put(skb, length); | 128 | skb_put(skb, length); |
| 129 | 129 | ||
| @@ -156,14 +156,18 @@ static struct sk_buff *ipoib_alloc_rx_skb(struct net_device *dev, int id) | |||
| 156 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 156 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
| 157 | struct sk_buff *skb; | 157 | struct sk_buff *skb; |
| 158 | int buf_size; | 158 | int buf_size; |
| 159 | int tailroom; | ||
| 159 | u64 *mapping; | 160 | u64 *mapping; |
| 160 | 161 | ||
| 161 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) | 162 | if (ipoib_ud_need_sg(priv->max_ib_mtu)) { |
| 162 | buf_size = IPOIB_UD_HEAD_SIZE; | 163 | buf_size = IPOIB_UD_HEAD_SIZE; |
| 163 | else | 164 | tailroom = 128; /* reserve some tailroom for IP/TCP headers */ |
| 165 | } else { | ||
| 164 | buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); | 166 | buf_size = IPOIB_UD_BUF_SIZE(priv->max_ib_mtu); |
| 167 | tailroom = 0; | ||
| 168 | } | ||
| 165 | 169 | ||
| 166 | skb = dev_alloc_skb(buf_size + 4); | 170 | skb = dev_alloc_skb(buf_size + tailroom + 4); |
| 167 | if (unlikely(!skb)) | 171 | if (unlikely(!skb)) |
| 168 | return NULL; | 172 | return NULL; |
| 169 | 173 | ||
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index 1a0ae4445ff2..5f21f629b7ae 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c | |||
| @@ -135,8 +135,8 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb) | |||
| 135 | skb = NULL; | 135 | skb = NULL; |
| 136 | else if (*debug & DEBUG_SEND_ERR) | 136 | else if (*debug & DEBUG_SEND_ERR) |
| 137 | printk(KERN_DEBUG | 137 | printk(KERN_DEBUG |
| 138 | "%s ch%d mgr prim(%x) addr(%x) err %d\n", | 138 | "%s mgr prim(%x) err %d\n", |
| 139 | __func__, ch->nr, hh->prim, ch->addr, ret); | 139 | __func__, hh->prim, ret); |
| 140 | } | 140 | } |
| 141 | out: | 141 | out: |
| 142 | mutex_unlock(&st->lmutex); | 142 | mutex_unlock(&st->lmutex); |
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 3680aa251dea..2cf084eb9d52 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "bonding.h" | 6 | #include "bonding.h" |
| 7 | #include "bond_alb.h" | 7 | #include "bond_alb.h" |
| 8 | 8 | ||
| 9 | #ifdef CONFIG_DEBUG_FS | 9 | #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS) |
| 10 | 10 | ||
| 11 | #include <linux/debugfs.h> | 11 | #include <linux/debugfs.h> |
| 12 | #include <linux/seq_file.h> | 12 | #include <linux/seq_file.h> |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b9c2ae62166d..2ee76993f052 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -3227,6 +3227,12 @@ static int bond_master_netdev_event(unsigned long event, | |||
| 3227 | switch (event) { | 3227 | switch (event) { |
| 3228 | case NETDEV_CHANGENAME: | 3228 | case NETDEV_CHANGENAME: |
| 3229 | return bond_event_changename(event_bond); | 3229 | return bond_event_changename(event_bond); |
| 3230 | case NETDEV_UNREGISTER: | ||
| 3231 | bond_remove_proc_entry(event_bond); | ||
| 3232 | break; | ||
| 3233 | case NETDEV_REGISTER: | ||
| 3234 | bond_create_proc_entry(event_bond); | ||
| 3235 | break; | ||
| 3230 | default: | 3236 | default: |
| 3231 | break; | 3237 | break; |
| 3232 | } | 3238 | } |
| @@ -4411,8 +4417,6 @@ static void bond_uninit(struct net_device *bond_dev) | |||
| 4411 | 4417 | ||
| 4412 | bond_work_cancel_all(bond); | 4418 | bond_work_cancel_all(bond); |
| 4413 | 4419 | ||
| 4414 | bond_remove_proc_entry(bond); | ||
| 4415 | |||
| 4416 | bond_debug_unregister(bond); | 4420 | bond_debug_unregister(bond); |
| 4417 | 4421 | ||
| 4418 | __hw_addr_flush(&bond->mc_list); | 4422 | __hw_addr_flush(&bond->mc_list); |
| @@ -4814,7 +4818,6 @@ static int bond_init(struct net_device *bond_dev) | |||
| 4814 | 4818 | ||
| 4815 | bond_set_lockdep_class(bond_dev); | 4819 | bond_set_lockdep_class(bond_dev); |
| 4816 | 4820 | ||
| 4817 | bond_create_proc_entry(bond); | ||
| 4818 | list_add_tail(&bond->bond_list, &bn->dev_list); | 4821 | list_add_tail(&bond->bond_list, &bn->dev_list); |
| 4819 | 4822 | ||
| 4820 | bond_prepare_sysfs_group(bond); | 4823 | bond_prepare_sysfs_group(bond); |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 9cc15701101b..1f78b63d5efe 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
| @@ -261,7 +261,6 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter) | |||
| 261 | if ((phy_data & BMSR_LSTATUS) == 0) { | 261 | if ((phy_data & BMSR_LSTATUS) == 0) { |
| 262 | /* link down */ | 262 | /* link down */ |
| 263 | netif_carrier_off(netdev); | 263 | netif_carrier_off(netdev); |
| 264 | netif_stop_queue(netdev); | ||
| 265 | hw->hibernate = true; | 264 | hw->hibernate = true; |
| 266 | if (atl1c_reset_mac(hw) != 0) | 265 | if (atl1c_reset_mac(hw) != 0) |
| 267 | if (netif_msg_hw(adapter)) | 266 | if (netif_msg_hw(adapter)) |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 46b8b7d81633..d09c6b583d17 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
| @@ -656,7 +656,7 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
| 656 | dma_unmap_single(bp->sdev->dma_dev, mapping, | 656 | dma_unmap_single(bp->sdev->dma_dev, mapping, |
| 657 | RX_PKT_BUF_SZ, DMA_FROM_DEVICE); | 657 | RX_PKT_BUF_SZ, DMA_FROM_DEVICE); |
| 658 | dev_kfree_skb_any(skb); | 658 | dev_kfree_skb_any(skb); |
| 659 | skb = __netdev_alloc_skb(bp->dev, RX_PKT_BUF_SZ, GFP_ATOMIC|GFP_DMA); | 659 | skb = alloc_skb(RX_PKT_BUF_SZ, GFP_ATOMIC | GFP_DMA); |
| 660 | if (skb == NULL) | 660 | if (skb == NULL) |
| 661 | return -ENOMEM; | 661 | return -ENOMEM; |
| 662 | mapping = dma_map_single(bp->sdev->dma_dev, skb->data, | 662 | mapping = dma_map_single(bp->sdev->dma_dev, skb->data, |
| @@ -967,7 +967,7 @@ static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 967 | dma_unmap_single(bp->sdev->dma_dev, mapping, len, | 967 | dma_unmap_single(bp->sdev->dma_dev, mapping, len, |
| 968 | DMA_TO_DEVICE); | 968 | DMA_TO_DEVICE); |
| 969 | 969 | ||
| 970 | bounce_skb = __netdev_alloc_skb(dev, len, GFP_ATOMIC | GFP_DMA); | 970 | bounce_skb = alloc_skb(len, GFP_ATOMIC | GFP_DMA); |
| 971 | if (!bounce_skb) | 971 | if (!bounce_skb) |
| 972 | goto err_out; | 972 | goto err_out; |
| 973 | 973 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index ac7b74488531..1fa4927a45b1 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c | |||
| @@ -5372,7 +5372,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp) | |||
| 5372 | int k, last; | 5372 | int k, last; |
| 5373 | 5373 | ||
| 5374 | if (skb == NULL) { | 5374 | if (skb == NULL) { |
| 5375 | j++; | 5375 | j = NEXT_TX_BD(j); |
| 5376 | continue; | 5376 | continue; |
| 5377 | } | 5377 | } |
| 5378 | 5378 | ||
| @@ -5384,8 +5384,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp) | |||
| 5384 | tx_buf->skb = NULL; | 5384 | tx_buf->skb = NULL; |
| 5385 | 5385 | ||
| 5386 | last = tx_buf->nr_frags; | 5386 | last = tx_buf->nr_frags; |
| 5387 | j++; | 5387 | j = NEXT_TX_BD(j); |
| 5388 | for (k = 0; k < last; k++, j++) { | 5388 | for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) { |
| 5389 | tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; | 5389 | tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)]; |
| 5390 | dma_unmap_page(&bp->pdev->dev, | 5390 | dma_unmap_page(&bp->pdev->dev, |
| 5391 | dma_unmap_addr(tx_buf, mapping), | 5391 | dma_unmap_addr(tx_buf, mapping), |
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index c95e7b5e2b85..2c89d17cbb29 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
| @@ -534,7 +534,8 @@ int cnic_unregister_driver(int ulp_type) | |||
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | if (atomic_read(&ulp_ops->ref_count) != 0) | 536 | if (atomic_read(&ulp_ops->ref_count) != 0) |
| 537 | netdev_warn(dev->netdev, "Failed waiting for ref count to go to zero\n"); | 537 | pr_warn("%s: Failed waiting for ref count to go to zero\n", |
| 538 | __func__); | ||
| 538 | return 0; | 539 | return 0; |
| 539 | 540 | ||
| 540 | out_unlock: | 541 | out_unlock: |
| @@ -1053,12 +1054,13 @@ static int cnic_init_uio(struct cnic_dev *dev) | |||
| 1053 | 1054 | ||
| 1054 | uinfo = &udev->cnic_uinfo; | 1055 | uinfo = &udev->cnic_uinfo; |
| 1055 | 1056 | ||
| 1056 | uinfo->mem[0].addr = dev->netdev->base_addr; | 1057 | uinfo->mem[0].addr = pci_resource_start(dev->pcidev, 0); |
| 1057 | uinfo->mem[0].internal_addr = dev->regview; | 1058 | uinfo->mem[0].internal_addr = dev->regview; |
| 1058 | uinfo->mem[0].size = dev->netdev->mem_end - dev->netdev->mem_start; | ||
| 1059 | uinfo->mem[0].memtype = UIO_MEM_PHYS; | 1059 | uinfo->mem[0].memtype = UIO_MEM_PHYS; |
| 1060 | 1060 | ||
| 1061 | if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) { | 1061 | if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) { |
| 1062 | uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID + | ||
| 1063 | TX_MAX_TSS_RINGS + 1); | ||
| 1062 | uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & | 1064 | uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & |
| 1063 | PAGE_MASK; | 1065 | PAGE_MASK; |
| 1064 | if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) | 1066 | if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) |
| @@ -1068,6 +1070,8 @@ static int cnic_init_uio(struct cnic_dev *dev) | |||
| 1068 | 1070 | ||
| 1069 | uinfo->name = "bnx2_cnic"; | 1071 | uinfo->name = "bnx2_cnic"; |
| 1070 | } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) { | 1072 | } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) { |
| 1073 | uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0); | ||
| 1074 | |||
| 1071 | uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & | 1075 | uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & |
| 1072 | PAGE_MASK; | 1076 | PAGE_MASK; |
| 1073 | uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); | 1077 | uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index f2db8fca46a1..ab1d80ff0791 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
| @@ -2063,10 +2063,9 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 2063 | return NETDEV_TX_OK; | 2063 | return NETDEV_TX_OK; |
| 2064 | } | 2064 | } |
| 2065 | 2065 | ||
| 2066 | /* Steal sock reference for processing TX time stamps */ | 2066 | if (skb->sk) |
| 2067 | swap(skb_new->sk, skb->sk); | 2067 | skb_set_owner_w(skb_new, skb->sk); |
| 2068 | swap(skb_new->destructor, skb->destructor); | 2068 | consume_skb(skb); |
| 2069 | kfree_skb(skb); | ||
| 2070 | skb = skb_new; | 2069 | skb = skb_new; |
| 2071 | } | 2070 | } |
| 2072 | 2071 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c index 36db4df09aed..1f063dcd8f85 100644 --- a/drivers/net/ethernet/intel/e1000e/82571.c +++ b/drivers/net/ethernet/intel/e1000e/82571.c | |||
| @@ -1572,6 +1572,9 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) | |||
| 1572 | ctrl = er32(CTRL); | 1572 | ctrl = er32(CTRL); |
| 1573 | status = er32(STATUS); | 1573 | status = er32(STATUS); |
| 1574 | rxcw = er32(RXCW); | 1574 | rxcw = er32(RXCW); |
| 1575 | /* SYNCH bit and IV bit are sticky */ | ||
| 1576 | udelay(10); | ||
| 1577 | rxcw = er32(RXCW); | ||
| 1575 | 1578 | ||
| 1576 | if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { | 1579 | if ((rxcw & E1000_RXCW_SYNCH) && !(rxcw & E1000_RXCW_IV)) { |
| 1577 | 1580 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 238ab2f8a5e7..e3a7b07df629 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
| @@ -325,24 +325,46 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) | |||
| 325 | **/ | 325 | **/ |
| 326 | static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) | 326 | static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) |
| 327 | { | 327 | { |
| 328 | u16 phy_reg; | 328 | u16 phy_reg = 0; |
| 329 | u32 phy_id; | 329 | u32 phy_id = 0; |
| 330 | s32 ret_val; | ||
| 331 | u16 retry_count; | ||
| 332 | |||
| 333 | for (retry_count = 0; retry_count < 2; retry_count++) { | ||
| 334 | ret_val = e1e_rphy_locked(hw, PHY_ID1, &phy_reg); | ||
| 335 | if (ret_val || (phy_reg == 0xFFFF)) | ||
| 336 | continue; | ||
| 337 | phy_id = (u32)(phy_reg << 16); | ||
| 330 | 338 | ||
| 331 | e1e_rphy_locked(hw, PHY_ID1, &phy_reg); | 339 | ret_val = e1e_rphy_locked(hw, PHY_ID2, &phy_reg); |
| 332 | phy_id = (u32)(phy_reg << 16); | 340 | if (ret_val || (phy_reg == 0xFFFF)) { |
| 333 | e1e_rphy_locked(hw, PHY_ID2, &phy_reg); | 341 | phy_id = 0; |
| 334 | phy_id |= (u32)(phy_reg & PHY_REVISION_MASK); | 342 | continue; |
| 343 | } | ||
| 344 | phy_id |= (u32)(phy_reg & PHY_REVISION_MASK); | ||
| 345 | break; | ||
| 346 | } | ||
| 335 | 347 | ||
| 336 | if (hw->phy.id) { | 348 | if (hw->phy.id) { |
| 337 | if (hw->phy.id == phy_id) | 349 | if (hw->phy.id == phy_id) |
| 338 | return true; | 350 | return true; |
| 339 | } else { | 351 | } else if (phy_id) { |
| 340 | if ((phy_id != 0) && (phy_id != PHY_REVISION_MASK)) | 352 | hw->phy.id = phy_id; |
| 341 | hw->phy.id = phy_id; | 353 | hw->phy.revision = (u32)(phy_reg & ~PHY_REVISION_MASK); |
| 342 | return true; | 354 | return true; |
| 343 | } | 355 | } |
| 344 | 356 | ||
| 345 | return false; | 357 | /* |
| 358 | * In case the PHY needs to be in mdio slow mode, | ||
| 359 | * set slow mode and try to get the PHY id again. | ||
| 360 | */ | ||
| 361 | hw->phy.ops.release(hw); | ||
| 362 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
| 363 | if (!ret_val) | ||
| 364 | ret_val = e1000e_get_phy_id(hw); | ||
| 365 | hw->phy.ops.acquire(hw); | ||
| 366 | |||
| 367 | return !ret_val; | ||
| 346 | } | 368 | } |
| 347 | 369 | ||
| 348 | /** | 370 | /** |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 18ca3bcadf0c..e242104ab471 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
| @@ -6647,6 +6647,11 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc) | |||
| 6647 | return -EINVAL; | 6647 | return -EINVAL; |
| 6648 | } | 6648 | } |
| 6649 | 6649 | ||
| 6650 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { | ||
| 6651 | e_err(drv, "Enable failed, SR-IOV enabled\n"); | ||
| 6652 | return -EINVAL; | ||
| 6653 | } | ||
| 6654 | |||
| 6650 | /* Hardware supports up to 8 traffic classes */ | 6655 | /* Hardware supports up to 8 traffic classes */ |
| 6651 | if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || | 6656 | if (tc > adapter->dcb_cfg.num_tcs.pg_tcs || |
| 6652 | (hw->mac.type == ixgbe_mac_82598EB && | 6657 | (hw->mac.type == ixgbe_mac_82598EB && |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index f69ec4288b10..41e32257a4e8 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
| @@ -201,6 +201,9 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_adapter *adapter, | |||
| 201 | unsigned int i, eop, count = 0; | 201 | unsigned int i, eop, count = 0; |
| 202 | unsigned int total_bytes = 0, total_packets = 0; | 202 | unsigned int total_bytes = 0, total_packets = 0; |
| 203 | 203 | ||
| 204 | if (test_bit(__IXGBEVF_DOWN, &adapter->state)) | ||
| 205 | return true; | ||
| 206 | |||
| 204 | i = tx_ring->next_to_clean; | 207 | i = tx_ring->next_to_clean; |
| 205 | eop = tx_ring->tx_buffer_info[i].next_to_watch; | 208 | eop = tx_ring->tx_buffer_info[i].next_to_watch; |
| 206 | eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); | 209 | eop_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); |
| @@ -969,8 +972,6 @@ static irqreturn_t ixgbevf_msix_clean_tx(int irq, void *data) | |||
| 969 | r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues); | 972 | r_idx = find_first_bit(q_vector->txr_idx, adapter->num_tx_queues); |
| 970 | for (i = 0; i < q_vector->txr_count; i++) { | 973 | for (i = 0; i < q_vector->txr_count; i++) { |
| 971 | tx_ring = &(adapter->tx_ring[r_idx]); | 974 | tx_ring = &(adapter->tx_ring[r_idx]); |
| 972 | tx_ring->total_bytes = 0; | ||
| 973 | tx_ring->total_packets = 0; | ||
| 974 | ixgbevf_clean_tx_irq(adapter, tx_ring); | 975 | ixgbevf_clean_tx_irq(adapter, tx_ring); |
| 975 | r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, | 976 | r_idx = find_next_bit(q_vector->txr_idx, adapter->num_tx_queues, |
| 976 | r_idx + 1); | 977 | r_idx + 1); |
| @@ -994,16 +995,6 @@ static irqreturn_t ixgbevf_msix_clean_rx(int irq, void *data) | |||
| 994 | struct ixgbe_hw *hw = &adapter->hw; | 995 | struct ixgbe_hw *hw = &adapter->hw; |
| 995 | struct ixgbevf_ring *rx_ring; | 996 | struct ixgbevf_ring *rx_ring; |
| 996 | int r_idx; | 997 | int r_idx; |
| 997 | int i; | ||
| 998 | |||
| 999 | r_idx = find_first_bit(q_vector->rxr_idx, adapter->num_rx_queues); | ||
| 1000 | for (i = 0; i < q_vector->rxr_count; i++) { | ||
| 1001 | rx_ring = &(adapter->rx_ring[r_idx]); | ||
| 1002 | rx_ring->total_bytes = 0; | ||
| 1003 | rx_ring->total_packets = 0; | ||
| 1004 | r_idx = find_next_bit(q_vector->rxr_idx, adapter->num_rx_queues, | ||
| 1005 | r_idx + 1); | ||
| 1006 | } | ||
| 1007 | 998 | ||
| 1008 | if (!q_vector->rxr_count) | 999 | if (!q_vector->rxr_count) |
| 1009 | return IRQ_HANDLED; | 1000 | return IRQ_HANDLED; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c index fb8377da1687..4b785e10f2ed 100644 --- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c +++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c | |||
| @@ -51,7 +51,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) | |||
| 51 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; | 51 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
| 52 | priv->hw->desc->prepare_tx_desc(desc, 1, bmax, | 52 | priv->hw->desc->prepare_tx_desc(desc, 1, bmax, |
| 53 | csum); | 53 | csum); |
| 54 | 54 | wmb(); | |
| 55 | entry = (++priv->cur_tx) % txsize; | 55 | entry = (++priv->cur_tx) % txsize; |
| 56 | desc = priv->dma_tx + entry; | 56 | desc = priv->dma_tx + entry; |
| 57 | 57 | ||
| @@ -59,6 +59,7 @@ static unsigned int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) | |||
| 59 | len, DMA_TO_DEVICE); | 59 | len, DMA_TO_DEVICE); |
| 60 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; | 60 | desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
| 61 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); | 61 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum); |
| 62 | wmb(); | ||
| 62 | priv->hw->desc->set_tx_owner(desc); | 63 | priv->hw->desc->set_tx_owner(desc); |
| 63 | priv->tx_skbuff[entry] = NULL; | 64 | priv->tx_skbuff[entry] = NULL; |
| 64 | } else { | 65 | } else { |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 51b3b68528ee..ea3003edde18 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
| @@ -1212,6 +1212,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1212 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); | 1212 | priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion); |
| 1213 | wmb(); | 1213 | wmb(); |
| 1214 | priv->hw->desc->set_tx_owner(desc); | 1214 | priv->hw->desc->set_tx_owner(desc); |
| 1215 | wmb(); | ||
| 1215 | } | 1216 | } |
| 1216 | 1217 | ||
| 1217 | /* Interrupt on completition only for the latest segment */ | 1218 | /* Interrupt on completition only for the latest segment */ |
| @@ -1227,6 +1228,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1227 | 1228 | ||
| 1228 | /* To avoid raise condition */ | 1229 | /* To avoid raise condition */ |
| 1229 | priv->hw->desc->set_tx_owner(first); | 1230 | priv->hw->desc->set_tx_owner(first); |
| 1231 | wmb(); | ||
| 1230 | 1232 | ||
| 1231 | priv->cur_tx++; | 1233 | priv->cur_tx++; |
| 1232 | 1234 | ||
| @@ -1290,6 +1292,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) | |||
| 1290 | } | 1292 | } |
| 1291 | wmb(); | 1293 | wmb(); |
| 1292 | priv->hw->desc->set_rx_owner(p + entry); | 1294 | priv->hw->desc->set_rx_owner(p + entry); |
| 1295 | wmb(); | ||
| 1293 | } | 1296 | } |
| 1294 | } | 1297 | } |
| 1295 | 1298 | ||
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c index 39ea0674dcde..5c120189ec86 100644 --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c | |||
| @@ -46,7 +46,13 @@ static int mdio_mux_read(struct mii_bus *bus, int phy_id, int regnum) | |||
| 46 | struct mdio_mux_parent_bus *pb = cb->parent; | 46 | struct mdio_mux_parent_bus *pb = cb->parent; |
| 47 | int r; | 47 | int r; |
| 48 | 48 | ||
| 49 | mutex_lock(&pb->mii_bus->mdio_lock); | 49 | /* In theory multiple mdio_mux could be stacked, thus creating |
| 50 | * more than a single level of nesting. But in practice, | ||
| 51 | * SINGLE_DEPTH_NESTING will cover the vast majority of use | ||
| 52 | * cases. We use it, instead of trying to handle the general | ||
| 53 | * case. | ||
| 54 | */ | ||
| 55 | mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING); | ||
| 50 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); | 56 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); |
| 51 | if (r) | 57 | if (r) |
| 52 | goto out; | 58 | goto out; |
| @@ -71,7 +77,7 @@ static int mdio_mux_write(struct mii_bus *bus, int phy_id, | |||
| 71 | 77 | ||
| 72 | int r; | 78 | int r; |
| 73 | 79 | ||
| 74 | mutex_lock(&pb->mii_bus->mdio_lock); | 80 | mutex_lock_nested(&pb->mii_bus->mdio_lock, SINGLE_DEPTH_NESTING); |
| 75 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); | 81 | r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); |
| 76 | if (r) | 82 | if (r) |
| 77 | goto out; | 83 | goto out; |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b01960fcfbc9..a051cedd64bd 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -346,6 +346,15 @@ static const struct driver_info qmi_wwan_force_int1 = { | |||
| 346 | .data = BIT(1), /* interface whitelist bitmap */ | 346 | .data = BIT(1), /* interface whitelist bitmap */ |
| 347 | }; | 347 | }; |
| 348 | 348 | ||
| 349 | static const struct driver_info qmi_wwan_force_int2 = { | ||
| 350 | .description = "Qualcomm WWAN/QMI device", | ||
| 351 | .flags = FLAG_WWAN, | ||
| 352 | .bind = qmi_wwan_bind_shared, | ||
| 353 | .unbind = qmi_wwan_unbind_shared, | ||
| 354 | .manage_power = qmi_wwan_manage_power, | ||
| 355 | .data = BIT(2), /* interface whitelist bitmap */ | ||
| 356 | }; | ||
| 357 | |||
| 349 | static const struct driver_info qmi_wwan_force_int3 = { | 358 | static const struct driver_info qmi_wwan_force_int3 = { |
| 350 | .description = "Qualcomm WWAN/QMI device", | 359 | .description = "Qualcomm WWAN/QMI device", |
| 351 | .flags = FLAG_WWAN, | 360 | .flags = FLAG_WWAN, |
| @@ -498,6 +507,15 @@ static const struct usb_device_id products[] = { | |||
| 498 | .bInterfaceProtocol = 0xff, | 507 | .bInterfaceProtocol = 0xff, |
| 499 | .driver_info = (unsigned long)&qmi_wwan_force_int4, | 508 | .driver_info = (unsigned long)&qmi_wwan_force_int4, |
| 500 | }, | 509 | }, |
| 510 | { /* ZTE MF60 */ | ||
| 511 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | ||
| 512 | .idVendor = 0x19d2, | ||
| 513 | .idProduct = 0x1402, | ||
| 514 | .bInterfaceClass = 0xff, | ||
| 515 | .bInterfaceSubClass = 0xff, | ||
| 516 | .bInterfaceProtocol = 0xff, | ||
| 517 | .driver_info = (unsigned long)&qmi_wwan_force_int2, | ||
| 518 | }, | ||
| 501 | { /* Sierra Wireless MC77xx in QMI mode */ | 519 | { /* Sierra Wireless MC77xx in QMI mode */ |
| 502 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | 520 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, |
| 503 | .idVendor = 0x1199, | 521 | .idVendor = 0x1199, |
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index f1f8bd09bd87..c8baf020c20f 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
| @@ -1072,7 +1072,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
| 1072 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1072 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
| 1073 | /* create a bounce buffer in zone_dma on mapping failure. */ | 1073 | /* create a bounce buffer in zone_dma on mapping failure. */ |
| 1074 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { | 1074 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
| 1075 | bounce_skb = __dev_alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); | 1075 | bounce_skb = alloc_skb(skb->len, GFP_ATOMIC | GFP_DMA); |
| 1076 | if (!bounce_skb) { | 1076 | if (!bounce_skb) { |
| 1077 | ring->current_slot = old_top_slot; | 1077 | ring->current_slot = old_top_slot; |
| 1078 | ring->used_slots = old_used_slots; | 1078 | ring->used_slots = old_used_slots; |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 509301a5e7e2..ff5d689e13f3 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
| @@ -3405,7 +3405,7 @@ il4965_remove_dynamic_key(struct il_priv *il, | |||
| 3405 | return 0; | 3405 | return 0; |
| 3406 | } | 3406 | } |
| 3407 | 3407 | ||
| 3408 | if (il->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET) { | 3408 | if (il->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_INVALID) { |
| 3409 | IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, | 3409 | IL_WARN("Removing wrong key %d 0x%x\n", keyconf->keyidx, |
| 3410 | key_flags); | 3410 | key_flags); |
| 3411 | spin_unlock_irqrestore(&il->sta_lock, flags); | 3411 | spin_unlock_irqrestore(&il->sta_lock, flags); |
| @@ -3420,7 +3420,7 @@ il4965_remove_dynamic_key(struct il_priv *il, | |||
| 3420 | memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); | 3420 | memset(&il->stations[sta_id].sta.key, 0, sizeof(struct il4965_keyinfo)); |
| 3421 | il->stations[sta_id].sta.key.key_flags = | 3421 | il->stations[sta_id].sta.key.key_flags = |
| 3422 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; | 3422 | STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; |
| 3423 | il->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; | 3423 | il->stations[sta_id].sta.key.key_offset = keyconf->hw_key_idx; |
| 3424 | il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 3424 | il->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
| 3425 | il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 3425 | il->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
| 3426 | 3426 | ||
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index cbf2dc18341f..5d4807c2b56d 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
| @@ -4767,14 +4767,12 @@ il_bg_watchdog(unsigned long data) | |||
| 4767 | return; | 4767 | return; |
| 4768 | 4768 | ||
| 4769 | /* monitor and check for other stuck queues */ | 4769 | /* monitor and check for other stuck queues */ |
| 4770 | if (il_is_any_associated(il)) { | 4770 | for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { |
| 4771 | for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) { | 4771 | /* skip as we already checked the command queue */ |
| 4772 | /* skip as we already checked the command queue */ | 4772 | if (cnt == il->cmd_queue) |
| 4773 | if (cnt == il->cmd_queue) | 4773 | continue; |
| 4774 | continue; | 4774 | if (il_check_stuck_queue(il, cnt)) |
| 4775 | if (il_check_stuck_queue(il, cnt)) | 4775 | return; |
| 4776 | return; | ||
| 4777 | } | ||
| 4778 | } | 4776 | } |
| 4779 | 4777 | ||
| 4780 | mod_timer(&il->watchdog, | 4778 | mod_timer(&il->watchdog, |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index ce61b6fae1c9..5c7fd185373c 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
| @@ -958,6 +958,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
| 958 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: | 958 | case NL80211_HIDDEN_SSID_ZERO_CONTENTS: |
| 959 | /* firmware doesn't support this type of hidden SSID */ | 959 | /* firmware doesn't support this type of hidden SSID */ |
| 960 | default: | 960 | default: |
| 961 | kfree(bss_cfg); | ||
| 961 | return -EINVAL; | 962 | return -EINVAL; |
| 962 | } | 963 | } |
| 963 | 964 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index d357d1ed92f6..74ecc33fdd90 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
| @@ -436,8 +436,8 @@ void rt2x00usb_kick_queue(struct data_queue *queue) | |||
| 436 | case QID_RX: | 436 | case QID_RX: |
| 437 | if (!rt2x00queue_full(queue)) | 437 | if (!rt2x00queue_full(queue)) |
| 438 | rt2x00queue_for_each_entry(queue, | 438 | rt2x00queue_for_each_entry(queue, |
| 439 | Q_INDEX_DONE, | ||
| 440 | Q_INDEX, | 439 | Q_INDEX, |
| 440 | Q_INDEX_DONE, | ||
| 441 | NULL, | 441 | NULL, |
| 442 | rt2x00usb_kick_rx_entry); | 442 | rt2x00usb_kick_rx_entry); |
| 443 | break; | 443 | break; |
diff --git a/drivers/pinctrl/pinctrl-imx.c b/drivers/pinctrl/pinctrl-imx.c index dd6d93aa5334..90c837f469a6 100644 --- a/drivers/pinctrl/pinctrl-imx.c +++ b/drivers/pinctrl/pinctrl-imx.c | |||
| @@ -474,7 +474,9 @@ static int __devinit imx_pinctrl_parse_groups(struct device_node *np, | |||
| 474 | grp->configs[j] = config & ~IMX_PAD_SION; | 474 | grp->configs[j] = config & ~IMX_PAD_SION; |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | #ifdef DEBUG | ||
| 477 | IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins); | 478 | IMX_PMX_DUMP(info, grp->pins, grp->mux_mode, grp->configs, grp->npins); |
| 479 | #endif | ||
| 478 | 480 | ||
| 479 | return 0; | 481 | return 0; |
| 480 | } | 482 | } |
diff --git a/drivers/pinctrl/pinctrl-imx6q.c b/drivers/pinctrl/pinctrl-imx6q.c index 7737d4d71a3c..e9bf71fbedca 100644 --- a/drivers/pinctrl/pinctrl-imx6q.c +++ b/drivers/pinctrl/pinctrl-imx6q.c | |||
| @@ -1950,6 +1950,8 @@ static struct imx_pin_reg imx6q_pin_regs[] = { | |||
| 1950 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 5, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__GPIO_1_12 */ | 1950 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 5, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__GPIO_1_12 */ |
| 1951 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 6, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__SJC_DONE */ | 1951 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 6, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__SJC_DONE */ |
| 1952 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 7, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__ANATOP_TESTO_3 */ | 1952 | IMX_PIN_REG(MX6Q_PAD_SD2_DAT3, 0x0744, 0x035C, 7, 0x0000, 0), /* MX6Q_PAD_SD2_DAT3__ANATOP_TESTO_3 */ |
| 1953 | IMX_PIN_REG(MX6Q_PAD_ENET_RX_ER, 0x04EC, 0x01D8, 0, 0x0000, 0), /* MX6Q_PAD_ENET_RX_ER__ANATOP_USBOTG_ID */ | ||
| 1954 | IMX_PIN_REG(MX6Q_PAD_GPIO_1, 0x05F4, 0x0224, 3, 0x0000, 0), /* MX6Q_PAD_GPIO_1__ANATOP_USBOTG_ID */ | ||
| 1953 | }; | 1955 | }; |
| 1954 | 1956 | ||
| 1955 | /* Pad names for the pinmux subsystem */ | 1957 | /* Pad names for the pinmux subsystem */ |
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 4f20f8dd3d7c..17f6dfd8dbfb 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c | |||
| @@ -694,10 +694,10 @@ MODULE_DEVICE_TABLE(acpi, ideapad_device_ids); | |||
| 694 | static int __devinit ideapad_acpi_add(struct acpi_device *adevice) | 694 | static int __devinit ideapad_acpi_add(struct acpi_device *adevice) |
| 695 | { | 695 | { |
| 696 | int ret, i; | 696 | int ret, i; |
| 697 | unsigned long cfg; | 697 | int cfg; |
| 698 | struct ideapad_private *priv; | 698 | struct ideapad_private *priv; |
| 699 | 699 | ||
| 700 | if (read_method_int(adevice->handle, "_CFG", (int *)&cfg)) | 700 | if (read_method_int(adevice->handle, "_CFG", &cfg)) |
| 701 | return -ENODEV; | 701 | return -ENODEV; |
| 702 | 702 | ||
| 703 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 703 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
| @@ -721,7 +721,7 @@ static int __devinit ideapad_acpi_add(struct acpi_device *adevice) | |||
| 721 | goto input_failed; | 721 | goto input_failed; |
| 722 | 722 | ||
| 723 | for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { | 723 | for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++) { |
| 724 | if (test_bit(ideapad_rfk_data[i].cfgbit, &cfg)) | 724 | if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg)) |
| 725 | ideapad_register_rfkill(adevice, i); | 725 | ideapad_register_rfkill(adevice, i); |
| 726 | else | 726 | else |
| 727 | priv->rfk[i] = NULL; | 727 | priv->rfk[i] = NULL; |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 0ffdb3cde2bb..9af4257d4901 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
| @@ -72,6 +72,7 @@ | |||
| 72 | #include <linux/string.h> | 72 | #include <linux/string.h> |
| 73 | #include <linux/tick.h> | 73 | #include <linux/tick.h> |
| 74 | #include <linux/timer.h> | 74 | #include <linux/timer.h> |
| 75 | #include <linux/dmi.h> | ||
| 75 | #include <drm/i915_drm.h> | 76 | #include <drm/i915_drm.h> |
| 76 | #include <asm/msr.h> | 77 | #include <asm/msr.h> |
| 77 | #include <asm/processor.h> | 78 | #include <asm/processor.h> |
| @@ -1485,6 +1486,24 @@ static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { | |||
| 1485 | 1486 | ||
| 1486 | MODULE_DEVICE_TABLE(pci, ips_id_table); | 1487 | MODULE_DEVICE_TABLE(pci, ips_id_table); |
| 1487 | 1488 | ||
| 1489 | static int ips_blacklist_callback(const struct dmi_system_id *id) | ||
| 1490 | { | ||
| 1491 | pr_info("Blacklisted intel_ips for %s\n", id->ident); | ||
| 1492 | return 1; | ||
| 1493 | } | ||
| 1494 | |||
| 1495 | static const struct dmi_system_id ips_blacklist[] = { | ||
| 1496 | { | ||
| 1497 | .callback = ips_blacklist_callback, | ||
| 1498 | .ident = "HP ProBook", | ||
| 1499 | .matches = { | ||
| 1500 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 1501 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook"), | ||
| 1502 | }, | ||
| 1503 | }, | ||
| 1504 | { } /* terminating entry */ | ||
| 1505 | }; | ||
| 1506 | |||
| 1488 | static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | 1507 | static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) |
| 1489 | { | 1508 | { |
| 1490 | u64 platform_info; | 1509 | u64 platform_info; |
| @@ -1494,6 +1513,9 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1494 | u16 htshi, trc, trc_required_mask; | 1513 | u16 htshi, trc, trc_required_mask; |
| 1495 | u8 tse; | 1514 | u8 tse; |
| 1496 | 1515 | ||
| 1516 | if (dmi_check_system(ips_blacklist)) | ||
| 1517 | return -ENODEV; | ||
| 1518 | |||
| 1497 | ips = kzalloc(sizeof(struct ips_driver), GFP_KERNEL); | 1519 | ips = kzalloc(sizeof(struct ips_driver), GFP_KERNEL); |
| 1498 | if (!ips) | 1520 | if (!ips) |
| 1499 | return -ENOMEM; | 1521 | return -ENOMEM; |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 210d4ae547c2..d456ff0c73b7 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
| @@ -973,7 +973,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
| 973 | struct device_attribute *attr, | 973 | struct device_attribute *attr, |
| 974 | const char *buffer, size_t count) | 974 | const char *buffer, size_t count) |
| 975 | { | 975 | { |
| 976 | unsigned long value = 0; | 976 | int value; |
| 977 | int ret = 0; | 977 | int ret = 0; |
| 978 | struct sony_nc_value *item = | 978 | struct sony_nc_value *item = |
| 979 | container_of(attr, struct sony_nc_value, devattr); | 979 | container_of(attr, struct sony_nc_value, devattr); |
| @@ -984,7 +984,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
| 984 | if (count > 31) | 984 | if (count > 31) |
| 985 | return -EINVAL; | 985 | return -EINVAL; |
| 986 | 986 | ||
| 987 | if (kstrtoul(buffer, 10, &value)) | 987 | if (kstrtoint(buffer, 10, &value)) |
| 988 | return -EINVAL; | 988 | return -EINVAL; |
| 989 | 989 | ||
| 990 | if (item->validate) | 990 | if (item->validate) |
| @@ -994,7 +994,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
| 994 | return value; | 994 | return value; |
| 995 | 995 | ||
| 996 | ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiset, | 996 | ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiset, |
| 997 | (int *)&value, NULL); | 997 | &value, NULL); |
| 998 | if (ret < 0) | 998 | if (ret < 0) |
| 999 | return -EIO; | 999 | return -EIO; |
| 1000 | 1000 | ||
| @@ -1010,6 +1010,7 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, | |||
| 1010 | struct sony_backlight_props { | 1010 | struct sony_backlight_props { |
| 1011 | struct backlight_device *dev; | 1011 | struct backlight_device *dev; |
| 1012 | int handle; | 1012 | int handle; |
| 1013 | int cmd_base; | ||
| 1013 | u8 offset; | 1014 | u8 offset; |
| 1014 | u8 maxlvl; | 1015 | u8 maxlvl; |
| 1015 | }; | 1016 | }; |
| @@ -1037,7 +1038,7 @@ static int sony_nc_get_brightness_ng(struct backlight_device *bd) | |||
| 1037 | struct sony_backlight_props *sdev = | 1038 | struct sony_backlight_props *sdev = |
| 1038 | (struct sony_backlight_props *)bl_get_data(bd); | 1039 | (struct sony_backlight_props *)bl_get_data(bd); |
| 1039 | 1040 | ||
| 1040 | sony_call_snc_handle(sdev->handle, 0x0200, &result); | 1041 | sony_call_snc_handle(sdev->handle, sdev->cmd_base + 0x100, &result); |
| 1041 | 1042 | ||
| 1042 | return (result & 0xff) - sdev->offset; | 1043 | return (result & 0xff) - sdev->offset; |
| 1043 | } | 1044 | } |
| @@ -1049,7 +1050,8 @@ static int sony_nc_update_status_ng(struct backlight_device *bd) | |||
| 1049 | (struct sony_backlight_props *)bl_get_data(bd); | 1050 | (struct sony_backlight_props *)bl_get_data(bd); |
| 1050 | 1051 | ||
| 1051 | value = bd->props.brightness + sdev->offset; | 1052 | value = bd->props.brightness + sdev->offset; |
| 1052 | if (sony_call_snc_handle(sdev->handle, 0x0100 | (value << 16), &result)) | 1053 | if (sony_call_snc_handle(sdev->handle, sdev->cmd_base | (value << 0x10), |
| 1054 | &result)) | ||
| 1053 | return -EIO; | 1055 | return -EIO; |
| 1054 | 1056 | ||
| 1055 | return value; | 1057 | return value; |
| @@ -1172,6 +1174,11 @@ static int sony_nc_hotkeys_decode(u32 event, unsigned int handle) | |||
| 1172 | /* | 1174 | /* |
| 1173 | * ACPI callbacks | 1175 | * ACPI callbacks |
| 1174 | */ | 1176 | */ |
| 1177 | enum event_types { | ||
| 1178 | HOTKEY = 1, | ||
| 1179 | KILLSWITCH, | ||
| 1180 | GFX_SWITCH | ||
| 1181 | }; | ||
| 1175 | static void sony_nc_notify(struct acpi_device *device, u32 event) | 1182 | static void sony_nc_notify(struct acpi_device *device, u32 event) |
| 1176 | { | 1183 | { |
| 1177 | u32 real_ev = event; | 1184 | u32 real_ev = event; |
| @@ -1196,7 +1203,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
| 1196 | /* hotkey event */ | 1203 | /* hotkey event */ |
| 1197 | case 0x0100: | 1204 | case 0x0100: |
| 1198 | case 0x0127: | 1205 | case 0x0127: |
| 1199 | ev_type = 1; | 1206 | ev_type = HOTKEY; |
| 1200 | real_ev = sony_nc_hotkeys_decode(event, handle); | 1207 | real_ev = sony_nc_hotkeys_decode(event, handle); |
| 1201 | 1208 | ||
| 1202 | if (real_ev > 0) | 1209 | if (real_ev > 0) |
| @@ -1216,7 +1223,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
| 1216 | * update the rfkill device status when the | 1223 | * update the rfkill device status when the |
| 1217 | * switch is moved. | 1224 | * switch is moved. |
| 1218 | */ | 1225 | */ |
| 1219 | ev_type = 2; | 1226 | ev_type = KILLSWITCH; |
| 1220 | sony_call_snc_handle(handle, 0x0100, &result); | 1227 | sony_call_snc_handle(handle, 0x0100, &result); |
| 1221 | real_ev = result & 0x03; | 1228 | real_ev = result & 0x03; |
| 1222 | 1229 | ||
| @@ -1226,6 +1233,24 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
| 1226 | 1233 | ||
| 1227 | break; | 1234 | break; |
| 1228 | 1235 | ||
| 1236 | case 0x0128: | ||
| 1237 | case 0x0146: | ||
| 1238 | /* Hybrid GFX switching */ | ||
| 1239 | sony_call_snc_handle(handle, 0x0000, &result); | ||
| 1240 | dprintk("GFX switch event received (reason: %s)\n", | ||
| 1241 | (result & 0x01) ? | ||
| 1242 | "switch change" : "unknown"); | ||
| 1243 | |||
| 1244 | /* verify the switch state | ||
| 1245 | * 1: discrete GFX | ||
| 1246 | * 0: integrated GFX | ||
| 1247 | */ | ||
| 1248 | sony_call_snc_handle(handle, 0x0100, &result); | ||
| 1249 | |||
| 1250 | ev_type = GFX_SWITCH; | ||
| 1251 | real_ev = result & 0xff; | ||
| 1252 | break; | ||
| 1253 | |||
| 1229 | default: | 1254 | default: |
| 1230 | dprintk("Unknown event 0x%x for handle 0x%x\n", | 1255 | dprintk("Unknown event 0x%x for handle 0x%x\n", |
| 1231 | event, handle); | 1256 | event, handle); |
| @@ -1238,7 +1263,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) | |||
| 1238 | 1263 | ||
| 1239 | } else { | 1264 | } else { |
| 1240 | /* old style event */ | 1265 | /* old style event */ |
| 1241 | ev_type = 1; | 1266 | ev_type = HOTKEY; |
| 1242 | sony_laptop_report_input_event(real_ev); | 1267 | sony_laptop_report_input_event(real_ev); |
| 1243 | } | 1268 | } |
| 1244 | 1269 | ||
| @@ -1893,32 +1918,33 @@ static ssize_t sony_nc_battery_care_limit_store(struct device *dev, | |||
| 1893 | * bits 4,5: store the limit into the EC | 1918 | * bits 4,5: store the limit into the EC |
| 1894 | * bits 6,7: store the limit into the battery | 1919 | * bits 6,7: store the limit into the battery |
| 1895 | */ | 1920 | */ |
| 1921 | cmd = 0; | ||
| 1896 | 1922 | ||
| 1897 | /* | 1923 | if (value > 0) { |
| 1898 | * handle 0x0115 should allow storing on battery too; | 1924 | if (value <= 50) |
| 1899 | * handle 0x0136 same as 0x0115 + health status; | 1925 | cmd = 0x20; |
| 1900 | * handle 0x013f, same as 0x0136 but no storing on the battery | ||
| 1901 | * | ||
| 1902 | * Store only inside the EC for now, regardless the handle number | ||
| 1903 | */ | ||
| 1904 | if (value == 0) | ||
| 1905 | /* disable limits */ | ||
| 1906 | cmd = 0x0; | ||
| 1907 | 1926 | ||
| 1908 | else if (value <= 50) | 1927 | else if (value <= 80) |
| 1909 | cmd = 0x21; | 1928 | cmd = 0x10; |
| 1910 | 1929 | ||
| 1911 | else if (value <= 80) | 1930 | else if (value <= 100) |
| 1912 | cmd = 0x11; | 1931 | cmd = 0x30; |
| 1913 | 1932 | ||
| 1914 | else if (value <= 100) | 1933 | else |
| 1915 | cmd = 0x31; | 1934 | return -EINVAL; |
| 1916 | 1935 | ||
| 1917 | else | 1936 | /* |
| 1918 | return -EINVAL; | 1937 | * handle 0x0115 should allow storing on battery too; |
| 1938 | * handle 0x0136 same as 0x0115 + health status; | ||
| 1939 | * handle 0x013f, same as 0x0136 but no storing on the battery | ||
| 1940 | */ | ||
| 1941 | if (bcare_ctl->handle != 0x013f) | ||
| 1942 | cmd = cmd | (cmd << 2); | ||
| 1919 | 1943 | ||
| 1920 | if (sony_call_snc_handle(bcare_ctl->handle, (cmd << 0x10) | 0x0100, | 1944 | cmd = (cmd | 0x1) << 0x10; |
| 1921 | &result)) | 1945 | } |
| 1946 | |||
| 1947 | if (sony_call_snc_handle(bcare_ctl->handle, cmd | 0x0100, &result)) | ||
| 1922 | return -EIO; | 1948 | return -EIO; |
| 1923 | 1949 | ||
| 1924 | return count; | 1950 | return count; |
| @@ -2113,7 +2139,7 @@ static ssize_t sony_nc_thermal_mode_show(struct device *dev, | |||
| 2113 | struct device_attribute *attr, char *buffer) | 2139 | struct device_attribute *attr, char *buffer) |
| 2114 | { | 2140 | { |
| 2115 | ssize_t count = 0; | 2141 | ssize_t count = 0; |
| 2116 | unsigned int mode = sony_nc_thermal_mode_get(); | 2142 | int mode = sony_nc_thermal_mode_get(); |
| 2117 | 2143 | ||
| 2118 | if (mode < 0) | 2144 | if (mode < 0) |
| 2119 | return mode; | 2145 | return mode; |
| @@ -2472,6 +2498,7 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
| 2472 | { | 2498 | { |
| 2473 | u64 offset; | 2499 | u64 offset; |
| 2474 | int i; | 2500 | int i; |
| 2501 | int lvl_table_len = 0; | ||
| 2475 | u8 min = 0xff, max = 0x00; | 2502 | u8 min = 0xff, max = 0x00; |
| 2476 | unsigned char buffer[32] = { 0 }; | 2503 | unsigned char buffer[32] = { 0 }; |
| 2477 | 2504 | ||
| @@ -2480,8 +2507,6 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
| 2480 | props->maxlvl = 0xff; | 2507 | props->maxlvl = 0xff; |
| 2481 | 2508 | ||
| 2482 | offset = sony_find_snc_handle(handle); | 2509 | offset = sony_find_snc_handle(handle); |
| 2483 | if (offset < 0) | ||
| 2484 | return; | ||
| 2485 | 2510 | ||
| 2486 | /* try to read the boundaries from ACPI tables, if we fail the above | 2511 | /* try to read the boundaries from ACPI tables, if we fail the above |
| 2487 | * defaults should be reasonable | 2512 | * defaults should be reasonable |
| @@ -2491,11 +2516,21 @@ static void sony_nc_backlight_ng_read_limits(int handle, | |||
| 2491 | if (i < 0) | 2516 | if (i < 0) |
| 2492 | return; | 2517 | return; |
| 2493 | 2518 | ||
| 2519 | switch (handle) { | ||
| 2520 | case 0x012f: | ||
| 2521 | case 0x0137: | ||
| 2522 | lvl_table_len = 9; | ||
| 2523 | break; | ||
| 2524 | case 0x143: | ||
| 2525 | lvl_table_len = 16; | ||
| 2526 | break; | ||
| 2527 | } | ||
| 2528 | |||
| 2494 | /* the buffer lists brightness levels available, brightness levels are | 2529 | /* the buffer lists brightness levels available, brightness levels are |
| 2495 | * from position 0 to 8 in the array, other values are used by ALS | 2530 | * from position 0 to 8 in the array, other values are used by ALS |
| 2496 | * control. | 2531 | * control. |
| 2497 | */ | 2532 | */ |
| 2498 | for (i = 0; i < 9 && i < ARRAY_SIZE(buffer); i++) { | 2533 | for (i = 0; i < lvl_table_len && i < ARRAY_SIZE(buffer); i++) { |
| 2499 | 2534 | ||
| 2500 | dprintk("Brightness level: %d\n", buffer[i]); | 2535 | dprintk("Brightness level: %d\n", buffer[i]); |
| 2501 | 2536 | ||
| @@ -2520,16 +2555,24 @@ static void sony_nc_backlight_setup(void) | |||
| 2520 | const struct backlight_ops *ops = NULL; | 2555 | const struct backlight_ops *ops = NULL; |
| 2521 | struct backlight_properties props; | 2556 | struct backlight_properties props; |
| 2522 | 2557 | ||
| 2523 | if (sony_find_snc_handle(0x12f) != -1) { | 2558 | if (sony_find_snc_handle(0x12f) >= 0) { |
| 2524 | ops = &sony_backlight_ng_ops; | 2559 | ops = &sony_backlight_ng_ops; |
| 2560 | sony_bl_props.cmd_base = 0x0100; | ||
| 2525 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); | 2561 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); |
| 2526 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2562 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
| 2527 | 2563 | ||
| 2528 | } else if (sony_find_snc_handle(0x137) != -1) { | 2564 | } else if (sony_find_snc_handle(0x137) >= 0) { |
| 2529 | ops = &sony_backlight_ng_ops; | 2565 | ops = &sony_backlight_ng_ops; |
| 2566 | sony_bl_props.cmd_base = 0x0100; | ||
| 2530 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); | 2567 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); |
| 2531 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2568 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
| 2532 | 2569 | ||
| 2570 | } else if (sony_find_snc_handle(0x143) >= 0) { | ||
| 2571 | ops = &sony_backlight_ng_ops; | ||
| 2572 | sony_bl_props.cmd_base = 0x3000; | ||
| 2573 | sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props); | ||
| 2574 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | ||
| 2575 | |||
| 2533 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", | 2576 | } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", |
| 2534 | &unused))) { | 2577 | &unused))) { |
| 2535 | ops = &sony_backlight_ops; | 2578 | ops = &sony_backlight_ops; |
| @@ -2597,6 +2640,12 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2597 | } | 2640 | } |
| 2598 | } | 2641 | } |
| 2599 | 2642 | ||
| 2643 | result = sony_laptop_setup_input(device); | ||
| 2644 | if (result) { | ||
| 2645 | pr_err("Unable to create input devices\n"); | ||
| 2646 | goto outplatform; | ||
| 2647 | } | ||
| 2648 | |||
| 2600 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", | 2649 | if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "ECON", |
| 2601 | &handle))) { | 2650 | &handle))) { |
| 2602 | int arg = 1; | 2651 | int arg = 1; |
| @@ -2614,12 +2663,6 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2614 | } | 2663 | } |
| 2615 | 2664 | ||
| 2616 | /* setup input devices and helper fifo */ | 2665 | /* setup input devices and helper fifo */ |
| 2617 | result = sony_laptop_setup_input(device); | ||
| 2618 | if (result) { | ||
| 2619 | pr_err("Unable to create input devices\n"); | ||
| 2620 | goto outsnc; | ||
| 2621 | } | ||
| 2622 | |||
| 2623 | if (acpi_video_backlight_support()) { | 2666 | if (acpi_video_backlight_support()) { |
| 2624 | pr_info("brightness ignored, must be controlled by ACPI video driver\n"); | 2667 | pr_info("brightness ignored, must be controlled by ACPI video driver\n"); |
| 2625 | } else { | 2668 | } else { |
| @@ -2667,22 +2710,21 @@ static int sony_nc_add(struct acpi_device *device) | |||
| 2667 | 2710 | ||
| 2668 | return 0; | 2711 | return 0; |
| 2669 | 2712 | ||
| 2670 | out_sysfs: | 2713 | out_sysfs: |
| 2671 | for (item = sony_nc_values; item->name; ++item) { | 2714 | for (item = sony_nc_values; item->name; ++item) { |
| 2672 | device_remove_file(&sony_pf_device->dev, &item->devattr); | 2715 | device_remove_file(&sony_pf_device->dev, &item->devattr); |
| 2673 | } | 2716 | } |
| 2674 | sony_nc_backlight_cleanup(); | 2717 | sony_nc_backlight_cleanup(); |
| 2675 | |||
| 2676 | sony_laptop_remove_input(); | ||
| 2677 | |||
| 2678 | outsnc: | ||
| 2679 | sony_nc_function_cleanup(sony_pf_device); | 2718 | sony_nc_function_cleanup(sony_pf_device); |
| 2680 | sony_nc_handles_cleanup(sony_pf_device); | 2719 | sony_nc_handles_cleanup(sony_pf_device); |
| 2681 | 2720 | ||
| 2682 | outpresent: | 2721 | outplatform: |
| 2722 | sony_laptop_remove_input(); | ||
| 2723 | |||
| 2724 | outpresent: | ||
| 2683 | sony_pf_remove(); | 2725 | sony_pf_remove(); |
| 2684 | 2726 | ||
| 2685 | outwalk: | 2727 | outwalk: |
| 2686 | sony_nc_rfkill_cleanup(); | 2728 | sony_nc_rfkill_cleanup(); |
| 2687 | return result; | 2729 | return result; |
| 2688 | } | 2730 | } |
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 39d3aa41adda..f56c8ba3a861 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c | |||
| @@ -1085,7 +1085,7 @@ static int __init rpmsg_init(void) | |||
| 1085 | 1085 | ||
| 1086 | return ret; | 1086 | return ret; |
| 1087 | } | 1087 | } |
| 1088 | module_init(rpmsg_init); | 1088 | subsys_initcall(rpmsg_init); |
| 1089 | 1089 | ||
| 1090 | static void __exit rpmsg_fini(void) | 1090 | static void __exit rpmsg_fini(void) |
| 1091 | { | 1091 | { |
