diff options
| -rw-r--r-- | arch/um/drivers/net_kern.c | 17 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | 18 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 46 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_evict.c | 45 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 62 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 19 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 1 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 | ||||
| -rw-r--r-- | drivers/spi/spi.c | 5 | ||||
| -rw-r--r-- | drivers/spi/spi_gpio.c | 2 | ||||
| -rw-r--r-- | drivers/spi/spi_mpc8xxx.c | 10 | ||||
| -rw-r--r-- | mm/ksm.c | 6 | ||||
| -rw-r--r-- | mm/rmap.c | 8 | ||||
| -rw-r--r-- | net/8021q/vlan_core.c | 14 | ||||
| -rw-r--r-- | net/ipv4/Kconfig | 1 | ||||
| -rw-r--r-- | net/ipv4/tcp_timer.c | 24 | ||||
| -rw-r--r-- | net/mac80211/rx.c | 4 | ||||
| -rw-r--r-- | net/phonet/pep.c | 3 |
20 files changed, 165 insertions, 130 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 2ab233ba32c1..47d0c37897d5 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
| @@ -255,18 +255,6 @@ static void uml_net_tx_timeout(struct net_device *dev) | |||
| 255 | netif_wake_queue(dev); | 255 | netif_wake_queue(dev); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | static int uml_net_set_mac(struct net_device *dev, void *addr) | ||
| 259 | { | ||
| 260 | struct uml_net_private *lp = netdev_priv(dev); | ||
| 261 | struct sockaddr *hwaddr = addr; | ||
| 262 | |||
| 263 | spin_lock_irq(&lp->lock); | ||
| 264 | eth_mac_addr(dev, hwaddr->sa_data); | ||
| 265 | spin_unlock_irq(&lp->lock); | ||
| 266 | |||
| 267 | return 0; | ||
| 268 | } | ||
| 269 | |||
| 270 | static int uml_net_change_mtu(struct net_device *dev, int new_mtu) | 258 | static int uml_net_change_mtu(struct net_device *dev, int new_mtu) |
| 271 | { | 259 | { |
| 272 | dev->mtu = new_mtu; | 260 | dev->mtu = new_mtu; |
| @@ -373,7 +361,7 @@ static const struct net_device_ops uml_netdev_ops = { | |||
| 373 | .ndo_start_xmit = uml_net_start_xmit, | 361 | .ndo_start_xmit = uml_net_start_xmit, |
| 374 | .ndo_set_multicast_list = uml_net_set_multicast_list, | 362 | .ndo_set_multicast_list = uml_net_set_multicast_list, |
| 375 | .ndo_tx_timeout = uml_net_tx_timeout, | 363 | .ndo_tx_timeout = uml_net_tx_timeout, |
| 376 | .ndo_set_mac_address = uml_net_set_mac, | 364 | .ndo_set_mac_address = eth_mac_addr, |
| 377 | .ndo_change_mtu = uml_net_change_mtu, | 365 | .ndo_change_mtu = uml_net_change_mtu, |
| 378 | .ndo_validate_addr = eth_validate_addr, | 366 | .ndo_validate_addr = eth_validate_addr, |
| 379 | }; | 367 | }; |
| @@ -472,7 +460,8 @@ static void eth_configure(int n, void *init, char *mac, | |||
| 472 | ((*transport->user->init)(&lp->user, dev) != 0)) | 460 | ((*transport->user->init)(&lp->user, dev) != 0)) |
| 473 | goto out_unregister; | 461 | goto out_unregister; |
| 474 | 462 | ||
| 475 | eth_mac_addr(dev, device->mac); | 463 | /* don't use eth_mac_addr, it will not work here */ |
| 464 | memcpy(dev->dev_addr, device->mac, ETH_ALEN); | ||
| 476 | dev->mtu = transport->user->mtu; | 465 | dev->mtu = transport->user->mtu; |
| 477 | dev->netdev_ops = ¨_netdev_ops; | 466 | dev->netdev_ops = ¨_netdev_ops; |
| 478 | dev->ethtool_ops = ¨_net_ethtool_ops; | 467 | dev->ethtool_ops = ¨_net_ethtool_ops; |
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 994230d4dc4e..4f6f679f2799 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
| @@ -368,16 +368,22 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
| 368 | return -ENODEV; | 368 | return -ENODEV; |
| 369 | 369 | ||
| 370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
| 371 | if (out_obj->type != ACPI_TYPE_BUFFER) | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) { |
| 372 | return -ENODEV; | 372 | ret = -ENODEV; |
| 373 | goto out_free; | ||
| 374 | } | ||
| 373 | 375 | ||
| 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
| 375 | if (errors) | 377 | if (errors) { |
| 376 | return -ENODEV; | 378 | ret = -ENODEV; |
| 379 | goto out_free; | ||
| 380 | } | ||
| 377 | 381 | ||
| 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
| 379 | if (!(supported & 0x1)) | 383 | if (!(supported & 0x1)) { |
| 380 | return -ENODEV; | 384 | ret = -ENODEV; |
| 385 | goto out_free; | ||
| 386 | } | ||
| 381 | 387 | ||
| 382 | out_free: | 388 | out_free: |
| 383 | kfree(output.pointer); | 389 | kfree(output.pointer); |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 9d67b4853030..c74e4e8006d4 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -1787,9 +1787,9 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv) | |||
| 1787 | } | 1787 | } |
| 1788 | } | 1788 | } |
| 1789 | 1789 | ||
| 1790 | div_u64(diff, diff1); | 1790 | diff = div_u64(diff, diff1); |
| 1791 | ret = ((m * diff) + c); | 1791 | ret = ((m * diff) + c); |
| 1792 | div_u64(ret, 10); | 1792 | ret = div_u64(ret, 10); |
| 1793 | 1793 | ||
| 1794 | dev_priv->last_count1 = total_count; | 1794 | dev_priv->last_count1 = total_count; |
| 1795 | dev_priv->last_time1 = now; | 1795 | dev_priv->last_time1 = now; |
| @@ -1858,7 +1858,7 @@ void i915_update_gfx_val(struct drm_i915_private *dev_priv) | |||
| 1858 | 1858 | ||
| 1859 | /* More magic constants... */ | 1859 | /* More magic constants... */ |
| 1860 | diff = diff * 1181; | 1860 | diff = diff * 1181; |
| 1861 | div_u64(diff, diffms * 10); | 1861 | diff = div_u64(diff, diffms * 10); |
| 1862 | dev_priv->gfx_power = diff; | 1862 | dev_priv->gfx_power = diff; |
| 1863 | } | 1863 | } |
| 1864 | 1864 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 2a0025f3e98e..90b1d6753b9d 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -469,14 +469,17 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, | |||
| 469 | return -ENOENT; | 469 | return -ENOENT; |
| 470 | obj_priv = to_intel_bo(obj); | 470 | obj_priv = to_intel_bo(obj); |
| 471 | 471 | ||
| 472 | /* Bounds check source. | 472 | /* Bounds check source. */ |
| 473 | * | 473 | if (args->offset > obj->size || args->size > obj->size - args->offset) { |
| 474 | * XXX: This could use review for overflow issues... | 474 | ret = -EINVAL; |
| 475 | */ | 475 | goto err; |
| 476 | if (args->offset > obj->size || args->size > obj->size || | 476 | } |
| 477 | args->offset + args->size > obj->size) { | 477 | |
| 478 | drm_gem_object_unreference_unlocked(obj); | 478 | if (!access_ok(VERIFY_WRITE, |
| 479 | return -EINVAL; | 479 | (char __user *)(uintptr_t)args->data_ptr, |
| 480 | args->size)) { | ||
| 481 | ret = -EFAULT; | ||
| 482 | goto err; | ||
| 480 | } | 483 | } |
| 481 | 484 | ||
| 482 | if (i915_gem_object_needs_bit17_swizzle(obj)) { | 485 | if (i915_gem_object_needs_bit17_swizzle(obj)) { |
| @@ -488,8 +491,8 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, | |||
| 488 | file_priv); | 491 | file_priv); |
| 489 | } | 492 | } |
| 490 | 493 | ||
| 494 | err: | ||
| 491 | drm_gem_object_unreference_unlocked(obj); | 495 | drm_gem_object_unreference_unlocked(obj); |
| 492 | |||
| 493 | return ret; | 496 | return ret; |
| 494 | } | 497 | } |
| 495 | 498 | ||
| @@ -578,8 +581,6 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj, | |||
| 578 | 581 | ||
| 579 | user_data = (char __user *) (uintptr_t) args->data_ptr; | 582 | user_data = (char __user *) (uintptr_t) args->data_ptr; |
| 580 | remain = args->size; | 583 | remain = args->size; |
| 581 | if (!access_ok(VERIFY_READ, user_data, remain)) | ||
| 582 | return -EFAULT; | ||
| 583 | 584 | ||
| 584 | 585 | ||
| 585 | mutex_lock(&dev->struct_mutex); | 586 | mutex_lock(&dev->struct_mutex); |
| @@ -932,14 +933,17 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, | |||
| 932 | return -ENOENT; | 933 | return -ENOENT; |
| 933 | obj_priv = to_intel_bo(obj); | 934 | obj_priv = to_intel_bo(obj); |
| 934 | 935 | ||
| 935 | /* Bounds check destination. | 936 | /* Bounds check destination. */ |
| 936 | * | 937 | if (args->offset > obj->size || args->size > obj->size - args->offset) { |
| 937 | * XXX: This could use review for overflow issues... | 938 | ret = -EINVAL; |
| 938 | */ | 939 | goto err; |
| 939 | if (args->offset > obj->size || args->size > obj->size || | 940 | } |
| 940 | args->offset + args->size > obj->size) { | 941 | |
| 941 | drm_gem_object_unreference_unlocked(obj); | 942 | if (!access_ok(VERIFY_READ, |
| 942 | return -EINVAL; | 943 | (char __user *)(uintptr_t)args->data_ptr, |
| 944 | args->size)) { | ||
| 945 | ret = -EFAULT; | ||
| 946 | goto err; | ||
| 943 | } | 947 | } |
| 944 | 948 | ||
| 945 | /* We can only do the GTT pwrite on untiled buffers, as otherwise | 949 | /* We can only do the GTT pwrite on untiled buffers, as otherwise |
| @@ -973,8 +977,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, | |||
| 973 | DRM_INFO("pwrite failed %d\n", ret); | 977 | DRM_INFO("pwrite failed %d\n", ret); |
| 974 | #endif | 978 | #endif |
| 975 | 979 | ||
| 980 | err: | ||
| 976 | drm_gem_object_unreference_unlocked(obj); | 981 | drm_gem_object_unreference_unlocked(obj); |
| 977 | |||
| 978 | return ret; | 982 | return ret; |
| 979 | } | 983 | } |
| 980 | 984 | ||
| @@ -3256,6 +3260,8 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, | |||
| 3256 | (int) reloc->offset, | 3260 | (int) reloc->offset, |
| 3257 | reloc->read_domains, | 3261 | reloc->read_domains, |
| 3258 | reloc->write_domain); | 3262 | reloc->write_domain); |
| 3263 | drm_gem_object_unreference(target_obj); | ||
| 3264 | i915_gem_object_unpin(obj); | ||
| 3259 | return -EINVAL; | 3265 | return -EINVAL; |
| 3260 | } | 3266 | } |
| 3261 | if (reloc->write_domain & I915_GEM_DOMAIN_CPU || | 3267 | if (reloc->write_domain & I915_GEM_DOMAIN_CPU || |
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index e85246ef691c..5c428fa3e0b3 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c | |||
| @@ -93,7 +93,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen | |||
| 93 | { | 93 | { |
| 94 | drm_i915_private_t *dev_priv = dev->dev_private; | 94 | drm_i915_private_t *dev_priv = dev->dev_private; |
| 95 | struct list_head eviction_list, unwind_list; | 95 | struct list_head eviction_list, unwind_list; |
| 96 | struct drm_i915_gem_object *obj_priv, *tmp_obj_priv; | 96 | struct drm_i915_gem_object *obj_priv; |
| 97 | struct list_head *render_iter, *bsd_iter; | 97 | struct list_head *render_iter, *bsd_iter; |
| 98 | int ret = 0; | 98 | int ret = 0; |
| 99 | 99 | ||
| @@ -175,39 +175,34 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen | |||
| 175 | return -ENOSPC; | 175 | return -ENOSPC; |
| 176 | 176 | ||
| 177 | found: | 177 | found: |
| 178 | /* drm_mm doesn't allow any other other operations while | ||
| 179 | * scanning, therefore store to be evicted objects on a | ||
| 180 | * temporary list. */ | ||
| 178 | INIT_LIST_HEAD(&eviction_list); | 181 | INIT_LIST_HEAD(&eviction_list); |
| 179 | list_for_each_entry_safe(obj_priv, tmp_obj_priv, | 182 | while (!list_empty(&unwind_list)) { |
| 180 | &unwind_list, evict_list) { | 183 | obj_priv = list_first_entry(&unwind_list, |
| 184 | struct drm_i915_gem_object, | ||
| 185 | evict_list); | ||
| 181 | if (drm_mm_scan_remove_block(obj_priv->gtt_space)) { | 186 | if (drm_mm_scan_remove_block(obj_priv->gtt_space)) { |
| 182 | /* drm_mm doesn't allow any other other operations while | ||
| 183 | * scanning, therefore store to be evicted objects on a | ||
| 184 | * temporary list. */ | ||
| 185 | list_move(&obj_priv->evict_list, &eviction_list); | 187 | list_move(&obj_priv->evict_list, &eviction_list); |
| 186 | } else | 188 | continue; |
| 187 | drm_gem_object_unreference(&obj_priv->base); | 189 | } |
| 190 | list_del(&obj_priv->evict_list); | ||
| 191 | drm_gem_object_unreference(&obj_priv->base); | ||
| 188 | } | 192 | } |
| 189 | 193 | ||
| 190 | /* Unbinding will emit any required flushes */ | 194 | /* Unbinding will emit any required flushes */ |
| 191 | list_for_each_entry_safe(obj_priv, tmp_obj_priv, | 195 | while (!list_empty(&eviction_list)) { |
| 192 | &eviction_list, evict_list) { | 196 | obj_priv = list_first_entry(&eviction_list, |
| 193 | #if WATCH_LRU | 197 | struct drm_i915_gem_object, |
| 194 | DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base); | 198 | evict_list); |
| 195 | #endif | 199 | if (ret == 0) |
| 196 | ret = i915_gem_object_unbind(&obj_priv->base); | 200 | ret = i915_gem_object_unbind(&obj_priv->base); |
| 197 | if (ret) | 201 | list_del(&obj_priv->evict_list); |
| 198 | return ret; | ||
| 199 | |||
| 200 | drm_gem_object_unreference(&obj_priv->base); | 202 | drm_gem_object_unreference(&obj_priv->base); |
| 201 | } | 203 | } |
| 202 | 204 | ||
| 203 | /* The just created free hole should be on the top of the free stack | 205 | return ret; |
| 204 | * maintained by drm_mm, so this BUG_ON actually executes in O(1). | ||
| 205 | * Furthermore all accessed data has just recently been used, so it | ||
| 206 | * should be really fast, too. */ | ||
| 207 | BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size, | ||
| 208 | alignment, 0)); | ||
| 209 | |||
| 210 | return 0; | ||
| 211 | } | 206 | } |
| 212 | 207 | ||
| 213 | int | 208 | int |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index b5bf51a4502d..979228594599 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -1013,8 +1013,8 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) | |||
| 1013 | DRM_DEBUG_KMS("vblank wait timed out\n"); | 1013 | DRM_DEBUG_KMS("vblank wait timed out\n"); |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
| 1016 | /** | 1016 | /* |
| 1017 | * intel_wait_for_vblank_off - wait for vblank after disabling a pipe | 1017 | * intel_wait_for_pipe_off - wait for pipe to turn off |
| 1018 | * @dev: drm device | 1018 | * @dev: drm device |
| 1019 | * @pipe: pipe to wait for | 1019 | * @pipe: pipe to wait for |
| 1020 | * | 1020 | * |
| @@ -1022,25 +1022,39 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) | |||
| 1022 | * spinning on the vblank interrupt status bit, since we won't actually | 1022 | * spinning on the vblank interrupt status bit, since we won't actually |
| 1023 | * see an interrupt when the pipe is disabled. | 1023 | * see an interrupt when the pipe is disabled. |
| 1024 | * | 1024 | * |
| 1025 | * So this function waits for the display line value to settle (it | 1025 | * On Gen4 and above: |
| 1026 | * usually ends up stopping at the start of the next frame). | 1026 | * wait for the pipe register state bit to turn off |
| 1027 | * | ||
| 1028 | * Otherwise: | ||
| 1029 | * wait for the display line value to settle (it usually | ||
| 1030 | * ends up stopping at the start of the next frame). | ||
| 1031 | * | ||
| 1027 | */ | 1032 | */ |
| 1028 | void intel_wait_for_vblank_off(struct drm_device *dev, int pipe) | 1033 | static void intel_wait_for_pipe_off(struct drm_device *dev, int pipe) |
| 1029 | { | 1034 | { |
| 1030 | struct drm_i915_private *dev_priv = dev->dev_private; | 1035 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1031 | int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL); | 1036 | |
| 1032 | unsigned long timeout = jiffies + msecs_to_jiffies(100); | 1037 | if (INTEL_INFO(dev)->gen >= 4) { |
| 1033 | u32 last_line; | 1038 | int pipeconf_reg = (pipe == 0 ? PIPEACONF : PIPEBCONF); |
| 1034 | 1039 | ||
| 1035 | /* Wait for the display line to settle */ | 1040 | /* Wait for the Pipe State to go off */ |
| 1036 | do { | 1041 | if (wait_for((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) == 0, |
| 1037 | last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; | 1042 | 100, 0)) |
| 1038 | mdelay(5); | 1043 | DRM_DEBUG_KMS("pipe_off wait timed out\n"); |
| 1039 | } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && | 1044 | } else { |
| 1040 | time_after(timeout, jiffies)); | 1045 | u32 last_line; |
| 1041 | 1046 | int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL); | |
| 1042 | if (time_after(jiffies, timeout)) | 1047 | unsigned long timeout = jiffies + msecs_to_jiffies(100); |
| 1043 | DRM_DEBUG_KMS("vblank wait timed out\n"); | 1048 | |
| 1049 | /* Wait for the display line to settle */ | ||
| 1050 | do { | ||
| 1051 | last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK; | ||
| 1052 | mdelay(5); | ||
| 1053 | } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) && | ||
| 1054 | time_after(timeout, jiffies)); | ||
| 1055 | if (time_after(jiffies, timeout)) | ||
| 1056 | DRM_DEBUG_KMS("pipe_off wait timed out\n"); | ||
| 1057 | } | ||
| 1044 | } | 1058 | } |
| 1045 | 1059 | ||
| 1046 | /* Parameters have changed, update FBC info */ | 1060 | /* Parameters have changed, update FBC info */ |
| @@ -2328,13 +2342,13 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2328 | I915_READ(dspbase_reg); | 2342 | I915_READ(dspbase_reg); |
| 2329 | } | 2343 | } |
| 2330 | 2344 | ||
| 2331 | /* Wait for vblank for the disable to take effect */ | ||
| 2332 | intel_wait_for_vblank_off(dev, pipe); | ||
| 2333 | |||
| 2334 | /* Don't disable pipe A or pipe A PLLs if needed */ | 2345 | /* Don't disable pipe A or pipe A PLLs if needed */ |
| 2335 | if (pipeconf_reg == PIPEACONF && | 2346 | if (pipeconf_reg == PIPEACONF && |
| 2336 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | 2347 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) { |
| 2348 | /* Wait for vblank for the disable to take effect */ | ||
| 2349 | intel_wait_for_vblank(dev, pipe); | ||
| 2337 | goto skip_pipe_off; | 2350 | goto skip_pipe_off; |
| 2351 | } | ||
| 2338 | 2352 | ||
| 2339 | /* Next, disable display pipes */ | 2353 | /* Next, disable display pipes */ |
| 2340 | temp = I915_READ(pipeconf_reg); | 2354 | temp = I915_READ(pipeconf_reg); |
| @@ -2343,8 +2357,8 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2343 | I915_READ(pipeconf_reg); | 2357 | I915_READ(pipeconf_reg); |
| 2344 | } | 2358 | } |
| 2345 | 2359 | ||
| 2346 | /* Wait for vblank for the disable to take effect. */ | 2360 | /* Wait for the pipe to turn off */ |
| 2347 | intel_wait_for_vblank_off(dev, pipe); | 2361 | intel_wait_for_pipe_off(dev, pipe); |
| 2348 | 2362 | ||
| 2349 | temp = I915_READ(dpll_reg); | 2363 | temp = I915_READ(dpll_reg); |
| 2350 | if ((temp & DPLL_VCO_ENABLE) != 0) { | 2364 | if ((temp & DPLL_VCO_ENABLE) != 0) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1a51ee07de3e..9ab8708ac6ba 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1138,18 +1138,14 @@ static bool | |||
| 1138 | intel_dp_set_link_train(struct intel_dp *intel_dp, | 1138 | intel_dp_set_link_train(struct intel_dp *intel_dp, |
| 1139 | uint32_t dp_reg_value, | 1139 | uint32_t dp_reg_value, |
| 1140 | uint8_t dp_train_pat, | 1140 | uint8_t dp_train_pat, |
| 1141 | uint8_t train_set[4], | 1141 | uint8_t train_set[4]) |
| 1142 | bool first) | ||
| 1143 | { | 1142 | { |
| 1144 | struct drm_device *dev = intel_dp->base.enc.dev; | 1143 | struct drm_device *dev = intel_dp->base.enc.dev; |
| 1145 | struct drm_i915_private *dev_priv = dev->dev_private; | 1144 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1146 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc); | ||
| 1147 | int ret; | 1145 | int ret; |
| 1148 | 1146 | ||
| 1149 | I915_WRITE(intel_dp->output_reg, dp_reg_value); | 1147 | I915_WRITE(intel_dp->output_reg, dp_reg_value); |
| 1150 | POSTING_READ(intel_dp->output_reg); | 1148 | POSTING_READ(intel_dp->output_reg); |
| 1151 | if (first) | ||
| 1152 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
| 1153 | 1149 | ||
| 1154 | intel_dp_aux_native_write_1(intel_dp, | 1150 | intel_dp_aux_native_write_1(intel_dp, |
| 1155 | DP_TRAINING_PATTERN_SET, | 1151 | DP_TRAINING_PATTERN_SET, |
| @@ -1174,10 +1170,15 @@ intel_dp_link_train(struct intel_dp *intel_dp) | |||
| 1174 | uint8_t voltage; | 1170 | uint8_t voltage; |
| 1175 | bool clock_recovery = false; | 1171 | bool clock_recovery = false; |
| 1176 | bool channel_eq = false; | 1172 | bool channel_eq = false; |
| 1177 | bool first = true; | ||
| 1178 | int tries; | 1173 | int tries; |
| 1179 | u32 reg; | 1174 | u32 reg; |
| 1180 | uint32_t DP = intel_dp->DP; | 1175 | uint32_t DP = intel_dp->DP; |
| 1176 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc); | ||
| 1177 | |||
| 1178 | /* Enable output, wait for it to become active */ | ||
| 1179 | I915_WRITE(intel_dp->output_reg, intel_dp->DP); | ||
| 1180 | POSTING_READ(intel_dp->output_reg); | ||
| 1181 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
| 1181 | 1182 | ||
| 1182 | /* Write the link configuration data */ | 1183 | /* Write the link configuration data */ |
| 1183 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, | 1184 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, |
| @@ -1210,9 +1211,8 @@ intel_dp_link_train(struct intel_dp *intel_dp) | |||
| 1210 | reg = DP | DP_LINK_TRAIN_PAT_1; | 1211 | reg = DP | DP_LINK_TRAIN_PAT_1; |
| 1211 | 1212 | ||
| 1212 | if (!intel_dp_set_link_train(intel_dp, reg, | 1213 | if (!intel_dp_set_link_train(intel_dp, reg, |
| 1213 | DP_TRAINING_PATTERN_1, train_set, first)) | 1214 | DP_TRAINING_PATTERN_1, train_set)) |
| 1214 | break; | 1215 | break; |
| 1215 | first = false; | ||
| 1216 | /* Set training pattern 1 */ | 1216 | /* Set training pattern 1 */ |
| 1217 | 1217 | ||
| 1218 | udelay(100); | 1218 | udelay(100); |
| @@ -1266,8 +1266,7 @@ intel_dp_link_train(struct intel_dp *intel_dp) | |||
| 1266 | 1266 | ||
| 1267 | /* channel eq pattern */ | 1267 | /* channel eq pattern */ |
| 1268 | if (!intel_dp_set_link_train(intel_dp, reg, | 1268 | if (!intel_dp_set_link_train(intel_dp, reg, |
| 1269 | DP_TRAINING_PATTERN_2, train_set, | 1269 | DP_TRAINING_PATTERN_2, train_set)) |
| 1270 | false)) | ||
| 1271 | break; | 1270 | break; |
| 1272 | 1271 | ||
| 1273 | udelay(400); | 1272 | udelay(400); |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index ad312ca6b3e5..8828b3ac6414 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -229,7 +229,6 @@ extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, | |||
| 229 | struct drm_crtc *crtc); | 229 | struct drm_crtc *crtc); |
| 230 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, | 230 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, |
| 231 | struct drm_file *file_priv); | 231 | struct drm_file *file_priv); |
| 232 | extern void intel_wait_for_vblank_off(struct drm_device *dev, int pipe); | ||
| 233 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); | 232 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); |
| 234 | extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); | 233 | extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe); |
| 235 | extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, | 234 | extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 9dd9e64c2b0b..8fd00a6e5120 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
| @@ -1411,7 +1411,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
| 1411 | clear_bit(STATUS_SCAN_HW, &priv->status); | 1411 | clear_bit(STATUS_SCAN_HW, &priv->status); |
| 1412 | clear_bit(STATUS_SCANNING, &priv->status); | 1412 | clear_bit(STATUS_SCANNING, &priv->status); |
| 1413 | /* inform mac80211 scan aborted */ | 1413 | /* inform mac80211 scan aborted */ |
| 1414 | queue_work(priv->workqueue, &priv->scan_completed); | 1414 | queue_work(priv->workqueue, &priv->abort_scan); |
| 1415 | } | 1415 | } |
| 1416 | 1416 | ||
| 1417 | int iwlagn_manage_ibss_station(struct iwl_priv *priv, | 1417 | int iwlagn_manage_ibss_station(struct iwl_priv *priv, |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 59a308b02f95..d31661c1ce77 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
| @@ -3018,7 +3018,7 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
| 3018 | clear_bit(STATUS_SCANNING, &priv->status); | 3018 | clear_bit(STATUS_SCANNING, &priv->status); |
| 3019 | 3019 | ||
| 3020 | /* inform mac80211 scan aborted */ | 3020 | /* inform mac80211 scan aborted */ |
| 3021 | queue_work(priv->workqueue, &priv->scan_completed); | 3021 | queue_work(priv->workqueue, &priv->abort_scan); |
| 3022 | } | 3022 | } |
| 3023 | 3023 | ||
| 3024 | static void iwl3945_bg_restart(struct work_struct *data) | 3024 | static void iwl3945_bg_restart(struct work_struct *data) |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 0bcf4c1601a2..b5a78a1f4421 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/cache.h> | 24 | #include <linux/cache.h> |
| 25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
| 26 | #include <linux/of_device.h> | ||
| 26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 27 | #include <linux/mod_devicetable.h> | 28 | #include <linux/mod_devicetable.h> |
| 28 | #include <linux/spi/spi.h> | 29 | #include <linux/spi/spi.h> |
| @@ -86,6 +87,10 @@ static int spi_match_device(struct device *dev, struct device_driver *drv) | |||
| 86 | const struct spi_device *spi = to_spi_device(dev); | 87 | const struct spi_device *spi = to_spi_device(dev); |
| 87 | const struct spi_driver *sdrv = to_spi_driver(drv); | 88 | const struct spi_driver *sdrv = to_spi_driver(drv); |
| 88 | 89 | ||
| 90 | /* Attempt an OF style match */ | ||
| 91 | if (of_driver_match_device(dev, drv)) | ||
| 92 | return 1; | ||
| 93 | |||
| 89 | if (sdrv->id_table) | 94 | if (sdrv->id_table) |
| 90 | return !!spi_match_id(sdrv->id_table, spi); | 95 | return !!spi_match_id(sdrv->id_table, spi); |
| 91 | 96 | ||
diff --git a/drivers/spi/spi_gpio.c b/drivers/spi/spi_gpio.c index e24a63498acb..63e51b011d50 100644 --- a/drivers/spi/spi_gpio.c +++ b/drivers/spi/spi_gpio.c | |||
| @@ -350,7 +350,7 @@ static int __init spi_gpio_probe(struct platform_device *pdev) | |||
| 350 | spi_gpio->bitbang.master = spi_master_get(master); | 350 | spi_gpio->bitbang.master = spi_master_get(master); |
| 351 | spi_gpio->bitbang.chipselect = spi_gpio_chipselect; | 351 | spi_gpio->bitbang.chipselect = spi_gpio_chipselect; |
| 352 | 352 | ||
| 353 | if ((master_flags & (SPI_MASTER_NO_RX | SPI_MASTER_NO_RX)) == 0) { | 353 | if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) { |
| 354 | spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0; | 354 | spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0; |
| 355 | spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1; | 355 | spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1; |
| 356 | spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2; | 356 | spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2; |
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c index d31b57f7baaf..1dd86b835cd8 100644 --- a/drivers/spi/spi_mpc8xxx.c +++ b/drivers/spi/spi_mpc8xxx.c | |||
| @@ -408,11 +408,17 @@ static void mpc8xxx_spi_cpm_bufs_start(struct mpc8xxx_spi *mspi) | |||
| 408 | 408 | ||
| 409 | xfer_ofs = mspi->xfer_in_progress->len - mspi->count; | 409 | xfer_ofs = mspi->xfer_in_progress->len - mspi->count; |
| 410 | 410 | ||
| 411 | out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); | 411 | if (mspi->rx_dma == mspi->dma_dummy_rx) |
| 412 | out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma); | ||
| 413 | else | ||
| 414 | out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); | ||
| 412 | out_be16(&rx_bd->cbd_datlen, 0); | 415 | out_be16(&rx_bd->cbd_datlen, 0); |
| 413 | out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP); | 416 | out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP); |
| 414 | 417 | ||
| 415 | out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); | 418 | if (mspi->tx_dma == mspi->dma_dummy_tx) |
| 419 | out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma); | ||
| 420 | else | ||
| 421 | out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); | ||
| 416 | out_be16(&tx_bd->cbd_datlen, xfer_len); | 422 | out_be16(&tx_bd->cbd_datlen, xfer_len); |
| 417 | out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | | 423 | out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | |
| 418 | BD_SC_LAST); | 424 | BD_SC_LAST); |
| @@ -712,7 +712,7 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, | |||
| 712 | if (!ptep) | 712 | if (!ptep) |
| 713 | goto out; | 713 | goto out; |
| 714 | 714 | ||
| 715 | if (pte_write(*ptep)) { | 715 | if (pte_write(*ptep) || pte_dirty(*ptep)) { |
| 716 | pte_t entry; | 716 | pte_t entry; |
| 717 | 717 | ||
| 718 | swapped = PageSwapCache(page); | 718 | swapped = PageSwapCache(page); |
| @@ -735,7 +735,9 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, | |||
| 735 | set_pte_at(mm, addr, ptep, entry); | 735 | set_pte_at(mm, addr, ptep, entry); |
| 736 | goto out_unlock; | 736 | goto out_unlock; |
| 737 | } | 737 | } |
| 738 | entry = pte_wrprotect(entry); | 738 | if (pte_dirty(entry)) |
| 739 | set_page_dirty(page); | ||
| 740 | entry = pte_mkclean(pte_wrprotect(entry)); | ||
| 739 | set_pte_at_notify(mm, addr, ptep, entry); | 741 | set_pte_at_notify(mm, addr, ptep, entry); |
| 740 | } | 742 | } |
| 741 | *orig_pte = *ptep; | 743 | *orig_pte = *ptep; |
| @@ -381,7 +381,13 @@ vma_address(struct page *page, struct vm_area_struct *vma) | |||
| 381 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) | 381 | unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma) |
| 382 | { | 382 | { |
| 383 | if (PageAnon(page)) { | 383 | if (PageAnon(page)) { |
| 384 | if (vma->anon_vma->root != page_anon_vma(page)->root) | 384 | struct anon_vma *page__anon_vma = page_anon_vma(page); |
| 385 | /* | ||
| 386 | * Note: swapoff's unuse_vma() is more efficient with this | ||
| 387 | * check, and needs it to match anon_vma when KSM is active. | ||
| 388 | */ | ||
| 389 | if (!vma->anon_vma || !page__anon_vma || | ||
| 390 | vma->anon_vma->root != page__anon_vma->root) | ||
| 385 | return -EFAULT; | 391 | return -EFAULT; |
| 386 | } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { | 392 | } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) { |
| 387 | if (!vma->vm_file || | 393 | if (!vma->vm_file || |
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 01ddb0472f86..0eb96f7e44be 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
| @@ -24,8 +24,11 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
| 24 | 24 | ||
| 25 | if (vlan_dev) | 25 | if (vlan_dev) |
| 26 | skb->dev = vlan_dev; | 26 | skb->dev = vlan_dev; |
| 27 | else if (vlan_id) | 27 | else if (vlan_id) { |
| 28 | goto drop; | 28 | if (!(skb->dev->flags & IFF_PROMISC)) |
| 29 | goto drop; | ||
| 30 | skb->pkt_type = PACKET_OTHERHOST; | ||
| 31 | } | ||
| 29 | 32 | ||
| 30 | return (polling ? netif_receive_skb(skb) : netif_rx(skb)); | 33 | return (polling ? netif_receive_skb(skb) : netif_rx(skb)); |
| 31 | 34 | ||
| @@ -102,8 +105,11 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | |||
| 102 | 105 | ||
| 103 | if (vlan_dev) | 106 | if (vlan_dev) |
| 104 | skb->dev = vlan_dev; | 107 | skb->dev = vlan_dev; |
| 105 | else if (vlan_id) | 108 | else if (vlan_id) { |
| 106 | goto drop; | 109 | if (!(skb->dev->flags & IFF_PROMISC)) |
| 110 | goto drop; | ||
| 111 | skb->pkt_type = PACKET_OTHERHOST; | ||
| 112 | } | ||
| 107 | 113 | ||
| 108 | for (p = napi->gro_list; p; p = p->next) { | 114 | for (p = napi->gro_list; p; p = p->next) { |
| 109 | NAPI_GRO_CB(p)->same_flow = | 115 | NAPI_GRO_CB(p)->same_flow = |
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 571f8950ed06..72380a30d1c8 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig | |||
| @@ -217,6 +217,7 @@ config NET_IPIP | |||
| 217 | 217 | ||
| 218 | config NET_IPGRE | 218 | config NET_IPGRE |
| 219 | tristate "IP: GRE tunnels over IP" | 219 | tristate "IP: GRE tunnels over IP" |
| 220 | depends on IPV6 || IPV6=n | ||
| 220 | help | 221 | help |
| 221 | Tunneling means encapsulating data of one protocol type within | 222 | Tunneling means encapsulating data of one protocol type within |
| 222 | another protocol and sending it over a channel that understands the | 223 | another protocol and sending it over a channel that understands the |
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index c35b469e851c..74c54b30600f 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
| @@ -135,13 +135,16 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) | |||
| 135 | 135 | ||
| 136 | /* This function calculates a "timeout" which is equivalent to the timeout of a | 136 | /* This function calculates a "timeout" which is equivalent to the timeout of a |
| 137 | * TCP connection after "boundary" unsuccessful, exponentially backed-off | 137 | * TCP connection after "boundary" unsuccessful, exponentially backed-off |
| 138 | * retransmissions with an initial RTO of TCP_RTO_MIN. | 138 | * retransmissions with an initial RTO of TCP_RTO_MIN or TCP_TIMEOUT_INIT if |
| 139 | * syn_set flag is set. | ||
| 139 | */ | 140 | */ |
| 140 | static bool retransmits_timed_out(struct sock *sk, | 141 | static bool retransmits_timed_out(struct sock *sk, |
| 141 | unsigned int boundary) | 142 | unsigned int boundary, |
| 143 | bool syn_set) | ||
| 142 | { | 144 | { |
| 143 | unsigned int timeout, linear_backoff_thresh; | 145 | unsigned int timeout, linear_backoff_thresh; |
| 144 | unsigned int start_ts; | 146 | unsigned int start_ts; |
| 147 | unsigned int rto_base = syn_set ? TCP_TIMEOUT_INIT : TCP_RTO_MIN; | ||
| 145 | 148 | ||
| 146 | if (!inet_csk(sk)->icsk_retransmits) | 149 | if (!inet_csk(sk)->icsk_retransmits) |
| 147 | return false; | 150 | return false; |
| @@ -151,12 +154,12 @@ static bool retransmits_timed_out(struct sock *sk, | |||
| 151 | else | 154 | else |
| 152 | start_ts = tcp_sk(sk)->retrans_stamp; | 155 | start_ts = tcp_sk(sk)->retrans_stamp; |
| 153 | 156 | ||
| 154 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); | 157 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base); |
| 155 | 158 | ||
| 156 | if (boundary <= linear_backoff_thresh) | 159 | if (boundary <= linear_backoff_thresh) |
| 157 | timeout = ((2 << boundary) - 1) * TCP_RTO_MIN; | 160 | timeout = ((2 << boundary) - 1) * rto_base; |
| 158 | else | 161 | else |
| 159 | timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + | 162 | timeout = ((2 << linear_backoff_thresh) - 1) * rto_base + |
| 160 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; | 163 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; |
| 161 | 164 | ||
| 162 | return (tcp_time_stamp - start_ts) >= timeout; | 165 | return (tcp_time_stamp - start_ts) >= timeout; |
| @@ -167,14 +170,15 @@ static int tcp_write_timeout(struct sock *sk) | |||
| 167 | { | 170 | { |
| 168 | struct inet_connection_sock *icsk = inet_csk(sk); | 171 | struct inet_connection_sock *icsk = inet_csk(sk); |
| 169 | int retry_until; | 172 | int retry_until; |
| 170 | bool do_reset; | 173 | bool do_reset, syn_set = 0; |
| 171 | 174 | ||
| 172 | if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { | 175 | if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { |
| 173 | if (icsk->icsk_retransmits) | 176 | if (icsk->icsk_retransmits) |
| 174 | dst_negative_advice(sk); | 177 | dst_negative_advice(sk); |
| 175 | retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries; | 178 | retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries; |
| 179 | syn_set = 1; | ||
| 176 | } else { | 180 | } else { |
| 177 | if (retransmits_timed_out(sk, sysctl_tcp_retries1)) { | 181 | if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0)) { |
| 178 | /* Black hole detection */ | 182 | /* Black hole detection */ |
| 179 | tcp_mtu_probing(icsk, sk); | 183 | tcp_mtu_probing(icsk, sk); |
| 180 | 184 | ||
| @@ -187,14 +191,14 @@ static int tcp_write_timeout(struct sock *sk) | |||
| 187 | 191 | ||
| 188 | retry_until = tcp_orphan_retries(sk, alive); | 192 | retry_until = tcp_orphan_retries(sk, alive); |
| 189 | do_reset = alive || | 193 | do_reset = alive || |
| 190 | !retransmits_timed_out(sk, retry_until); | 194 | !retransmits_timed_out(sk, retry_until, 0); |
| 191 | 195 | ||
| 192 | if (tcp_out_of_resources(sk, do_reset)) | 196 | if (tcp_out_of_resources(sk, do_reset)) |
| 193 | return 1; | 197 | return 1; |
| 194 | } | 198 | } |
| 195 | } | 199 | } |
| 196 | 200 | ||
| 197 | if (retransmits_timed_out(sk, retry_until)) { | 201 | if (retransmits_timed_out(sk, retry_until, syn_set)) { |
| 198 | /* Has it gone just too far? */ | 202 | /* Has it gone just too far? */ |
| 199 | tcp_write_err(sk); | 203 | tcp_write_err(sk); |
| 200 | return 1; | 204 | return 1; |
| @@ -436,7 +440,7 @@ out_reset_timer: | |||
| 436 | icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX); | 440 | icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX); |
| 437 | } | 441 | } |
| 438 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX); | 442 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX); |
| 439 | if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1)) | 443 | if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1, 0)) |
| 440 | __sk_dst_reset(sk); | 444 | __sk_dst_reset(sk); |
| 441 | 445 | ||
| 442 | out:; | 446 | out:; |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fa0f37e4afe4..28624282c5f3 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -2199,9 +2199,6 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, | |||
| 2199 | struct net_device *prev_dev = NULL; | 2199 | struct net_device *prev_dev = NULL; |
| 2200 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 2200 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
| 2201 | 2201 | ||
| 2202 | if (status->flag & RX_FLAG_INTERNAL_CMTR) | ||
| 2203 | goto out_free_skb; | ||
| 2204 | |||
| 2205 | if (skb_headroom(skb) < sizeof(*rthdr) && | 2202 | if (skb_headroom(skb) < sizeof(*rthdr) && |
| 2206 | pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) | 2203 | pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) |
| 2207 | goto out_free_skb; | 2204 | goto out_free_skb; |
| @@ -2260,7 +2257,6 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, | |||
| 2260 | } else | 2257 | } else |
| 2261 | goto out_free_skb; | 2258 | goto out_free_skb; |
| 2262 | 2259 | ||
| 2263 | status->flag |= RX_FLAG_INTERNAL_CMTR; | ||
| 2264 | return; | 2260 | return; |
| 2265 | 2261 | ||
| 2266 | out_free_skb: | 2262 | out_free_skb: |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index b2a3ae6cad78..15003021f4f0 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
| @@ -225,12 +225,13 @@ static void pipe_grant_credits(struct sock *sk) | |||
| 225 | static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb) | 225 | static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb) |
| 226 | { | 226 | { |
| 227 | struct pep_sock *pn = pep_sk(sk); | 227 | struct pep_sock *pn = pep_sk(sk); |
| 228 | struct pnpipehdr *hdr = pnp_hdr(skb); | 228 | struct pnpipehdr *hdr; |
| 229 | int wake = 0; | 229 | int wake = 0; |
| 230 | 230 | ||
| 231 | if (!pskb_may_pull(skb, sizeof(*hdr) + 4)) | 231 | if (!pskb_may_pull(skb, sizeof(*hdr) + 4)) |
| 232 | return -EINVAL; | 232 | return -EINVAL; |
| 233 | 233 | ||
| 234 | hdr = pnp_hdr(skb); | ||
| 234 | if (hdr->data[0] != PN_PEP_TYPE_COMMON) { | 235 | if (hdr->data[0] != PN_PEP_TYPE_COMMON) { |
| 235 | LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n", | 236 | LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n", |
| 236 | (unsigned)hdr->data[0]); | 237 | (unsigned)hdr->data[0]); |
