diff options
82 files changed, 561 insertions, 306 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx6q-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx6q-pinctrl.txt index 82b43f915857..a4119f6422d9 100644 --- a/Documentation/devicetree/bindings/pinctrl/fsl,imx6q-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/fsl,imx6q-pinctrl.txt | |||
| @@ -1626,3 +1626,5 @@ MX6Q_PAD_SD2_DAT3__PCIE_CTRL_MUX_11 1587 | |||
| 1626 | MX6Q_PAD_SD2_DAT3__GPIO_1_12 1588 | 1626 | MX6Q_PAD_SD2_DAT3__GPIO_1_12 1588 |
| 1627 | MX6Q_PAD_SD2_DAT3__SJC_DONE 1589 | 1627 | MX6Q_PAD_SD2_DAT3__SJC_DONE 1589 |
| 1628 | MX6Q_PAD_SD2_DAT3__ANATOP_TESTO_3 1590 | 1628 | MX6Q_PAD_SD2_DAT3__ANATOP_TESTO_3 1590 |
| 1629 | MX6Q_PAD_ENET_RX_ER__ANATOP_USBOTG_ID 1591 | ||
| 1630 | MX6Q_PAD_GPIO_1__ANATOP_USBOTG_ID 1592 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 1b71f6ceae0a..c82c343168e8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3433,13 +3433,14 @@ S: Supported | |||
| 3433 | F: drivers/idle/i7300_idle.c | 3433 | F: drivers/idle/i7300_idle.c |
| 3434 | 3434 | ||
| 3435 | IEEE 802.15.4 SUBSYSTEM | 3435 | IEEE 802.15.4 SUBSYSTEM |
| 3436 | M: Alexander Smirnov <alex.bluesman.smirnov@gmail.com> | ||
| 3436 | M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3437 | M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
| 3437 | M: Sergey Lapin <slapin@ossfans.org> | ||
| 3438 | L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers) | 3438 | L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers) |
| 3439 | W: http://apps.sourceforge.net/trac/linux-zigbee | 3439 | W: http://apps.sourceforge.net/trac/linux-zigbee |
| 3440 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git | 3440 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git |
| 3441 | S: Maintained | 3441 | S: Maintained |
| 3442 | F: net/ieee802154/ | 3442 | F: net/ieee802154/ |
| 3443 | F: net/mac802154/ | ||
| 3443 | F: drivers/ieee802154/ | 3444 | F: drivers/ieee802154/ |
| 3444 | 3445 | ||
| 3445 | IIO SUBSYSTEM AND DRIVERS | 3446 | IIO SUBSYSTEM AND DRIVERS |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 4044abcf6f9d..655878bcc96d 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
| @@ -1091,7 +1091,7 @@ error: | |||
| 1091 | while (--i) | 1091 | while (--i) |
| 1092 | if (pages[i]) | 1092 | if (pages[i]) |
| 1093 | __free_pages(pages[i], 0); | 1093 | __free_pages(pages[i], 0); |
| 1094 | if (array_size < PAGE_SIZE) | 1094 | if (array_size <= PAGE_SIZE) |
| 1095 | kfree(pages); | 1095 | kfree(pages); |
| 1096 | else | 1096 | else |
| 1097 | vfree(pages); | 1097 | vfree(pages); |
| @@ -1106,7 +1106,7 @@ static int __iommu_free_buffer(struct device *dev, struct page **pages, size_t s | |||
| 1106 | for (i = 0; i < count; i++) | 1106 | for (i = 0; i < count; i++) |
| 1107 | if (pages[i]) | 1107 | if (pages[i]) |
| 1108 | __free_pages(pages[i], 0); | 1108 | __free_pages(pages[i], 0); |
| 1109 | if (array_size < PAGE_SIZE) | 1109 | if (array_size <= PAGE_SIZE) |
| 1110 | kfree(pages); | 1110 | kfree(pages); |
| 1111 | else | 1111 | else |
| 1112 | vfree(pages); | 1112 | vfree(pages); |
diff --git a/arch/m32r/boot/compressed/Makefile b/arch/m32r/boot/compressed/Makefile index 177716b1d613..01729c2979ba 100644 --- a/arch/m32r/boot/compressed/Makefile +++ b/arch/m32r/boot/compressed/Makefile | |||
| @@ -43,9 +43,9 @@ endif | |||
| 43 | 43 | ||
| 44 | OBJCOPYFLAGS += -R .empty_zero_page | 44 | OBJCOPYFLAGS += -R .empty_zero_page |
| 45 | 45 | ||
| 46 | suffix_$(CONFIG_KERNEL_GZIP) = gz | 46 | suffix-$(CONFIG_KERNEL_GZIP) = gz |
| 47 | suffix_$(CONFIG_KERNEL_BZIP2) = bz2 | 47 | suffix-$(CONFIG_KERNEL_BZIP2) = bz2 |
| 48 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | 48 | suffix-$(CONFIG_KERNEL_LZMA) = lzma |
| 49 | 49 | ||
| 50 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE | 50 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE |
| 51 | $(call if_changed,ld) | 51 | $(call if_changed,ld) |
diff --git a/arch/m32r/boot/compressed/misc.c b/arch/m32r/boot/compressed/misc.c index 370d60881977..28a09529f206 100644 --- a/arch/m32r/boot/compressed/misc.c +++ b/arch/m32r/boot/compressed/misc.c | |||
| @@ -28,7 +28,7 @@ static unsigned long free_mem_ptr; | |||
| 28 | static unsigned long free_mem_end_ptr; | 28 | static unsigned long free_mem_end_ptr; |
| 29 | 29 | ||
| 30 | #ifdef CONFIG_KERNEL_BZIP2 | 30 | #ifdef CONFIG_KERNEL_BZIP2 |
| 31 | static void *memset(void *s, int c, size_t n) | 31 | void *memset(void *s, int c, size_t n) |
| 32 | { | 32 | { |
| 33 | char *ss = s; | 33 | char *ss = s; |
| 34 | 34 | ||
| @@ -39,6 +39,16 @@ static void *memset(void *s, int c, size_t n) | |||
| 39 | #endif | 39 | #endif |
| 40 | 40 | ||
| 41 | #ifdef CONFIG_KERNEL_GZIP | 41 | #ifdef CONFIG_KERNEL_GZIP |
| 42 | void *memcpy(void *dest, const void *src, size_t n) | ||
| 43 | { | ||
| 44 | char *d = dest; | ||
| 45 | const char *s = src; | ||
| 46 | while (n--) | ||
| 47 | *d++ = *s++; | ||
| 48 | |||
| 49 | return dest; | ||
| 50 | } | ||
| 51 | |||
| 42 | #define BOOT_HEAP_SIZE 0x10000 | 52 | #define BOOT_HEAP_SIZE 0x10000 |
| 43 | #include "../../../../lib/decompress_inflate.c" | 53 | #include "../../../../lib/decompress_inflate.c" |
| 44 | #endif | 54 | #endif |
diff --git a/arch/m32r/include/asm/ptrace.h b/arch/m32r/include/asm/ptrace.h index 527527584dd0..4313aa62b51b 100644 --- a/arch/m32r/include/asm/ptrace.h +++ b/arch/m32r/include/asm/ptrace.h | |||
| @@ -113,9 +113,6 @@ struct pt_regs { | |||
| 113 | 113 | ||
| 114 | #define PTRACE_OLDSETOPTIONS 21 | 114 | #define PTRACE_OLDSETOPTIONS 21 |
| 115 | 115 | ||
| 116 | /* options set using PTRACE_SETOPTIONS */ | ||
| 117 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | ||
| 118 | |||
| 119 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
| 120 | 117 | ||
| 121 | #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ | 118 | #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ |
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index 4c03361537aa..51f5e9aa4901 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c | |||
| @@ -591,17 +591,16 @@ void user_enable_single_step(struct task_struct *child) | |||
| 591 | 591 | ||
| 592 | if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) | 592 | if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0) |
| 593 | != sizeof(insn)) | 593 | != sizeof(insn)) |
| 594 | return -EIO; | 594 | return; |
| 595 | 595 | ||
| 596 | compute_next_pc(insn, pc, &next_pc, child); | 596 | compute_next_pc(insn, pc, &next_pc, child); |
| 597 | if (next_pc & 0x80000000) | 597 | if (next_pc & 0x80000000) |
| 598 | return -EIO; | 598 | return; |
| 599 | 599 | ||
| 600 | if (embed_debug_trap(child, next_pc)) | 600 | if (embed_debug_trap(child, next_pc)) |
| 601 | return -EIO; | 601 | return; |
| 602 | 602 | ||
| 603 | invalidate_cache(); | 603 | invalidate_cache(); |
| 604 | return 0; | ||
| 605 | } | 604 | } |
| 606 | 605 | ||
| 607 | void user_disable_single_step(struct task_struct *child) | 606 | void user_disable_single_step(struct task_struct *child) |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index f3fb2c029cfc..d0f60b97bbc5 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
| @@ -286,7 +286,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 286 | case -ERESTARTNOINTR: | 286 | case -ERESTARTNOINTR: |
| 287 | regs->r0 = regs->orig_r0; | 287 | regs->r0 = regs->orig_r0; |
| 288 | if (prev_insn(regs) < 0) | 288 | if (prev_insn(regs) < 0) |
| 289 | return -EFAULT; | 289 | return; |
| 290 | } | 290 | } |
| 291 | } | 291 | } |
| 292 | 292 | ||
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index 6ab0bee2a54f..4d584ae29ae1 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c | |||
| @@ -459,10 +459,11 @@ static int handle_signal(int sig, | |||
| 459 | else | 459 | else |
| 460 | ret = setup_frame(sig, ka, oldset, regs); | 460 | ret = setup_frame(sig, ka, oldset, regs); |
| 461 | if (ret) | 461 | if (ret) |
| 462 | return; | 462 | return ret; |
| 463 | 463 | ||
| 464 | signal_delivered(sig, info, ka, regs, | 464 | signal_delivered(sig, info, ka, regs, |
| 465 | test_thread_flag(TIF_SINGLESTEP)); | 465 | test_thread_flag(TIF_SINGLESTEP)); |
| 466 | return 0; | ||
| 466 | } | 467 | } |
| 467 | 468 | ||
| 468 | /* | 469 | /* |
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 | { |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 5b400730c213..4ee522b3f66f 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -86,7 +86,31 @@ static struct { | |||
| 86 | #endif /* CONFIG_CIFS_WEAK_PW_HASH */ | 86 | #endif /* CONFIG_CIFS_WEAK_PW_HASH */ |
| 87 | #endif /* CIFS_POSIX */ | 87 | #endif /* CIFS_POSIX */ |
| 88 | 88 | ||
| 89 | /* Forward declarations */ | 89 | #ifdef CONFIG_HIGHMEM |
| 90 | /* | ||
| 91 | * On arches that have high memory, kmap address space is limited. By | ||
| 92 | * serializing the kmap operations on those arches, we ensure that we don't | ||
| 93 | * end up with a bunch of threads in writeback with partially mapped page | ||
| 94 | * arrays, stuck waiting for kmap to come back. That situation prevents | ||
| 95 | * progress and can deadlock. | ||
| 96 | */ | ||
| 97 | static DEFINE_MUTEX(cifs_kmap_mutex); | ||
| 98 | |||
| 99 | static inline void | ||
| 100 | cifs_kmap_lock(void) | ||
| 101 | { | ||
| 102 | mutex_lock(&cifs_kmap_mutex); | ||
| 103 | } | ||
| 104 | |||
| 105 | static inline void | ||
| 106 | cifs_kmap_unlock(void) | ||
| 107 | { | ||
| 108 | mutex_unlock(&cifs_kmap_mutex); | ||
| 109 | } | ||
| 110 | #else /* !CONFIG_HIGHMEM */ | ||
| 111 | #define cifs_kmap_lock() do { ; } while(0) | ||
| 112 | #define cifs_kmap_unlock() do { ; } while(0) | ||
| 113 | #endif /* CONFIG_HIGHMEM */ | ||
| 90 | 114 | ||
| 91 | /* Mark as invalid, all open files on tree connections since they | 115 | /* Mark as invalid, all open files on tree connections since they |
| 92 | were closed when session to server was lost */ | 116 | were closed when session to server was lost */ |
| @@ -1503,7 +1527,9 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) | |||
| 1503 | } | 1527 | } |
| 1504 | 1528 | ||
| 1505 | /* marshal up the page array */ | 1529 | /* marshal up the page array */ |
| 1530 | cifs_kmap_lock(); | ||
| 1506 | len = rdata->marshal_iov(rdata, data_len); | 1531 | len = rdata->marshal_iov(rdata, data_len); |
| 1532 | cifs_kmap_unlock(); | ||
| 1507 | data_len -= len; | 1533 | data_len -= len; |
| 1508 | 1534 | ||
| 1509 | /* issue the read if we have any iovecs left to fill */ | 1535 | /* issue the read if we have any iovecs left to fill */ |
| @@ -2069,7 +2095,9 @@ cifs_async_writev(struct cifs_writedata *wdata) | |||
| 2069 | * and set the iov_len properly for each one. It may also set | 2095 | * and set the iov_len properly for each one. It may also set |
| 2070 | * wdata->bytes too. | 2096 | * wdata->bytes too. |
| 2071 | */ | 2097 | */ |
| 2098 | cifs_kmap_lock(); | ||
| 2072 | wdata->marshal_iov(iov, wdata); | 2099 | wdata->marshal_iov(iov, wdata); |
| 2100 | cifs_kmap_unlock(); | ||
| 2073 | 2101 | ||
| 2074 | cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); | 2102 | cFYI(1, "async write at %llu %u bytes", wdata->offset, wdata->bytes); |
| 2075 | 2103 | ||
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0ae86ddf2213..94b7788c3189 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -3445,6 +3445,18 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | |||
| 3445 | #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024) | 3445 | #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024) |
| 3446 | #define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) | 3446 | #define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) |
| 3447 | 3447 | ||
| 3448 | /* | ||
| 3449 | * On hosts with high memory, we can't currently support wsize/rsize that are | ||
| 3450 | * larger than we can kmap at once. Cap the rsize/wsize at | ||
| 3451 | * LAST_PKMAP * PAGE_SIZE. We'll never be able to fill a read or write request | ||
| 3452 | * larger than that anyway. | ||
| 3453 | */ | ||
| 3454 | #ifdef CONFIG_HIGHMEM | ||
| 3455 | #define CIFS_KMAP_SIZE_LIMIT (LAST_PKMAP * PAGE_CACHE_SIZE) | ||
| 3456 | #else /* CONFIG_HIGHMEM */ | ||
| 3457 | #define CIFS_KMAP_SIZE_LIMIT (1<<24) | ||
| 3458 | #endif /* CONFIG_HIGHMEM */ | ||
| 3459 | |||
| 3448 | static unsigned int | 3460 | static unsigned int |
| 3449 | cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | 3461 | cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) |
| 3450 | { | 3462 | { |
| @@ -3475,6 +3487,9 @@ cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | |||
| 3475 | wsize = min_t(unsigned int, wsize, | 3487 | wsize = min_t(unsigned int, wsize, |
| 3476 | server->maxBuf - sizeof(WRITE_REQ) + 4); | 3488 | server->maxBuf - sizeof(WRITE_REQ) + 4); |
| 3477 | 3489 | ||
| 3490 | /* limit to the amount that we can kmap at once */ | ||
| 3491 | wsize = min_t(unsigned int, wsize, CIFS_KMAP_SIZE_LIMIT); | ||
| 3492 | |||
| 3478 | /* hard limit of CIFS_MAX_WSIZE */ | 3493 | /* hard limit of CIFS_MAX_WSIZE */ |
| 3479 | wsize = min_t(unsigned int, wsize, CIFS_MAX_WSIZE); | 3494 | wsize = min_t(unsigned int, wsize, CIFS_MAX_WSIZE); |
| 3480 | 3495 | ||
| @@ -3516,6 +3531,9 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | |||
| 3516 | if (!(server->capabilities & CAP_LARGE_READ_X)) | 3531 | if (!(server->capabilities & CAP_LARGE_READ_X)) |
| 3517 | rsize = min_t(unsigned int, CIFSMaxBufSize, rsize); | 3532 | rsize = min_t(unsigned int, CIFSMaxBufSize, rsize); |
| 3518 | 3533 | ||
| 3534 | /* limit to the amount that we can kmap at once */ | ||
| 3535 | rsize = min_t(unsigned int, rsize, CIFS_KMAP_SIZE_LIMIT); | ||
| 3536 | |||
| 3519 | /* hard limit of CIFS_MAX_RSIZE */ | 3537 | /* hard limit of CIFS_MAX_RSIZE */ |
| 3520 | rsize = min_t(unsigned int, rsize, CIFS_MAX_RSIZE); | 3538 | rsize = min_t(unsigned int, rsize, CIFS_MAX_RSIZE); |
| 3521 | 3539 | ||
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 0a8224d1c4c5..a4217f02fab2 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
| @@ -86,9 +86,12 @@ cifs_readdir_lookup(struct dentry *parent, struct qstr *name, | |||
| 86 | 86 | ||
| 87 | dentry = d_lookup(parent, name); | 87 | dentry = d_lookup(parent, name); |
| 88 | if (dentry) { | 88 | if (dentry) { |
| 89 | /* FIXME: check for inode number changes? */ | 89 | inode = dentry->d_inode; |
| 90 | if (dentry->d_inode != NULL) | 90 | /* update inode in place if i_ino didn't change */ |
| 91 | if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) { | ||
| 92 | cifs_fattr_to_inode(inode, fattr); | ||
| 91 | return dentry; | 93 | return dentry; |
| 94 | } | ||
| 92 | d_drop(dentry); | 95 | d_drop(dentry); |
| 93 | dput(dentry); | 96 | dput(dentry); |
| 94 | } | 97 | } |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 3097ee58fd7d..f25d4ea14be4 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
| @@ -365,16 +365,14 @@ cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov, | |||
| 365 | if (mid == NULL) | 365 | if (mid == NULL) |
| 366 | return -ENOMEM; | 366 | return -ENOMEM; |
| 367 | 367 | ||
| 368 | /* put it on the pending_mid_q */ | ||
| 369 | spin_lock(&GlobalMid_Lock); | ||
| 370 | list_add_tail(&mid->qhead, &server->pending_mid_q); | ||
| 371 | spin_unlock(&GlobalMid_Lock); | ||
| 372 | |||
| 373 | rc = cifs_sign_smb2(iov, nvec, server, &mid->sequence_number); | 368 | rc = cifs_sign_smb2(iov, nvec, server, &mid->sequence_number); |
| 374 | if (rc) | 369 | if (rc) { |
| 375 | delete_mid(mid); | 370 | DeleteMidQEntry(mid); |
| 371 | return rc; | ||
| 372 | } | ||
| 373 | |||
| 376 | *ret_mid = mid; | 374 | *ret_mid = mid; |
| 377 | return rc; | 375 | return 0; |
| 378 | } | 376 | } |
| 379 | 377 | ||
| 380 | /* | 378 | /* |
| @@ -407,17 +405,21 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, | |||
| 407 | mid->callback_data = cbdata; | 405 | mid->callback_data = cbdata; |
| 408 | mid->mid_state = MID_REQUEST_SUBMITTED; | 406 | mid->mid_state = MID_REQUEST_SUBMITTED; |
| 409 | 407 | ||
| 408 | /* put it on the pending_mid_q */ | ||
| 409 | spin_lock(&GlobalMid_Lock); | ||
| 410 | list_add_tail(&mid->qhead, &server->pending_mid_q); | ||
| 411 | spin_unlock(&GlobalMid_Lock); | ||
| 412 | |||
| 413 | |||
| 410 | cifs_in_send_inc(server); | 414 | cifs_in_send_inc(server); |
| 411 | rc = smb_sendv(server, iov, nvec); | 415 | rc = smb_sendv(server, iov, nvec); |
| 412 | cifs_in_send_dec(server); | 416 | cifs_in_send_dec(server); |
| 413 | cifs_save_when_sent(mid); | 417 | cifs_save_when_sent(mid); |
| 414 | mutex_unlock(&server->srv_mutex); | 418 | mutex_unlock(&server->srv_mutex); |
| 415 | 419 | ||
| 416 | if (rc) | 420 | if (rc == 0) |
| 417 | goto out_err; | 421 | return 0; |
| 418 | 422 | ||
| 419 | return rc; | ||
| 420 | out_err: | ||
| 421 | delete_mid(mid); | 423 | delete_mid(mid); |
| 422 | add_credits(server, 1); | 424 | add_credits(server, 1); |
| 423 | wake_up(&server->request_q); | 425 | wake_up(&server->request_q); |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 74598f67efeb..1c8b55670804 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
| @@ -1710,7 +1710,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
| 1710 | goto error_tgt_fput; | 1710 | goto error_tgt_fput; |
| 1711 | 1711 | ||
| 1712 | /* Check if EPOLLWAKEUP is allowed */ | 1712 | /* Check if EPOLLWAKEUP is allowed */ |
| 1713 | if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP)) | 1713 | if ((epds.events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) |
| 1714 | epds.events &= ~EPOLLWAKEUP; | 1714 | epds.events &= ~EPOLLWAKEUP; |
| 1715 | 1715 | ||
| 1716 | /* | 1716 | /* |
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index e34deac3f366..6ec6f9ee2fec 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
| @@ -268,7 +268,6 @@ group_extend_out: | |||
| 268 | err = ext4_move_extents(filp, donor_filp, me.orig_start, | 268 | err = ext4_move_extents(filp, donor_filp, me.orig_start, |
| 269 | me.donor_start, me.len, &me.moved_len); | 269 | me.donor_start, me.len, &me.moved_len); |
| 270 | mnt_drop_write_file(filp); | 270 | mnt_drop_write_file(filp); |
| 271 | mnt_drop_write(filp->f_path.mnt); | ||
| 272 | 271 | ||
| 273 | if (copy_to_user((struct move_extent __user *)arg, | 272 | if (copy_to_user((struct move_extent __user *)arg, |
| 274 | &me, sizeof(me))) | 273 | &me, sizeof(me))) |
| @@ -14,7 +14,7 @@ | |||
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #include <linux/pipe_fs_i.h> | 15 | #include <linux/pipe_fs_i.h> |
| 16 | 16 | ||
| 17 | static void wait_for_partner(struct inode* inode, unsigned int *cnt) | 17 | static int wait_for_partner(struct inode* inode, unsigned int *cnt) |
| 18 | { | 18 | { |
| 19 | int cur = *cnt; | 19 | int cur = *cnt; |
| 20 | 20 | ||
| @@ -23,6 +23,7 @@ static void wait_for_partner(struct inode* inode, unsigned int *cnt) | |||
| 23 | if (signal_pending(current)) | 23 | if (signal_pending(current)) |
| 24 | break; | 24 | break; |
| 25 | } | 25 | } |
| 26 | return cur == *cnt ? -ERESTARTSYS : 0; | ||
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | static void wake_up_partner(struct inode* inode) | 29 | static void wake_up_partner(struct inode* inode) |
| @@ -67,8 +68,7 @@ static int fifo_open(struct inode *inode, struct file *filp) | |||
| 67 | * seen a writer */ | 68 | * seen a writer */ |
| 68 | filp->f_version = pipe->w_counter; | 69 | filp->f_version = pipe->w_counter; |
| 69 | } else { | 70 | } else { |
| 70 | wait_for_partner(inode, &pipe->w_counter); | 71 | if (wait_for_partner(inode, &pipe->w_counter)) |
| 71 | if(signal_pending(current)) | ||
| 72 | goto err_rd; | 72 | goto err_rd; |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| @@ -90,8 +90,7 @@ static int fifo_open(struct inode *inode, struct file *filp) | |||
| 90 | wake_up_partner(inode); | 90 | wake_up_partner(inode); |
| 91 | 91 | ||
| 92 | if (!pipe->readers) { | 92 | if (!pipe->readers) { |
| 93 | wait_for_partner(inode, &pipe->r_counter); | 93 | if (wait_for_partner(inode, &pipe->r_counter)) |
| 94 | if (signal_pending(current)) | ||
| 95 | goto err_wr; | 94 | goto err_wr; |
| 96 | } | 95 | } |
| 97 | break; | 96 | break; |
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 9d1aeb7e2734..4f33c32affe3 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
| @@ -1074,13 +1074,13 @@ restart: | |||
| 1074 | * If we couldn't get anything, give up. | 1074 | * If we couldn't get anything, give up. |
| 1075 | */ | 1075 | */ |
| 1076 | if (bno_cur_lt == NULL && bno_cur_gt == NULL) { | 1076 | if (bno_cur_lt == NULL && bno_cur_gt == NULL) { |
| 1077 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | ||
| 1078 | |||
| 1077 | if (!forced++) { | 1079 | if (!forced++) { |
| 1078 | trace_xfs_alloc_near_busy(args); | 1080 | trace_xfs_alloc_near_busy(args); |
| 1079 | xfs_log_force(args->mp, XFS_LOG_SYNC); | 1081 | xfs_log_force(args->mp, XFS_LOG_SYNC); |
| 1080 | goto restart; | 1082 | goto restart; |
| 1081 | } | 1083 | } |
| 1082 | |||
| 1083 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | ||
| 1084 | trace_xfs_alloc_size_neither(args); | 1084 | trace_xfs_alloc_size_neither(args); |
| 1085 | args->agbno = NULLAGBLOCK; | 1085 | args->agbno = NULLAGBLOCK; |
| 1086 | return 0; | 1086 | return 0; |
| @@ -2434,13 +2434,22 @@ xfs_alloc_vextent_worker( | |||
| 2434 | current_restore_flags_nested(&pflags, PF_FSTRANS); | 2434 | current_restore_flags_nested(&pflags, PF_FSTRANS); |
| 2435 | } | 2435 | } |
| 2436 | 2436 | ||
| 2437 | 2437 | /* | |
| 2438 | int /* error */ | 2438 | * Data allocation requests often come in with little stack to work on. Push |
| 2439 | * them off to a worker thread so there is lots of stack to use. Metadata | ||
| 2440 | * requests, OTOH, are generally from low stack usage paths, so avoid the | ||
| 2441 | * context switch overhead here. | ||
| 2442 | */ | ||
| 2443 | int | ||
| 2439 | xfs_alloc_vextent( | 2444 | xfs_alloc_vextent( |
| 2440 | xfs_alloc_arg_t *args) /* allocation argument structure */ | 2445 | struct xfs_alloc_arg *args) |
| 2441 | { | 2446 | { |
| 2442 | DECLARE_COMPLETION_ONSTACK(done); | 2447 | DECLARE_COMPLETION_ONSTACK(done); |
| 2443 | 2448 | ||
| 2449 | if (!args->userdata) | ||
| 2450 | return __xfs_alloc_vextent(args); | ||
| 2451 | |||
| 2452 | |||
| 2444 | args->done = &done; | 2453 | args->done = &done; |
| 2445 | INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); | 2454 | INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); |
| 2446 | queue_work(xfs_alloc_wq, &args->work); | 2455 | queue_work(xfs_alloc_wq, &args->work); |
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index a4beb421018a..269b35c084da 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
| @@ -989,27 +989,6 @@ xfs_buf_ioerror_alert( | |||
| 989 | (__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length); | 989 | (__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length); |
| 990 | } | 990 | } |
| 991 | 991 | ||
| 992 | int | ||
| 993 | xfs_bwrite( | ||
| 994 | struct xfs_buf *bp) | ||
| 995 | { | ||
| 996 | int error; | ||
| 997 | |||
| 998 | ASSERT(xfs_buf_islocked(bp)); | ||
| 999 | |||
| 1000 | bp->b_flags |= XBF_WRITE; | ||
| 1001 | bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q); | ||
| 1002 | |||
| 1003 | xfs_bdstrat_cb(bp); | ||
| 1004 | |||
| 1005 | error = xfs_buf_iowait(bp); | ||
| 1006 | if (error) { | ||
| 1007 | xfs_force_shutdown(bp->b_target->bt_mount, | ||
| 1008 | SHUTDOWN_META_IO_ERROR); | ||
| 1009 | } | ||
| 1010 | return error; | ||
| 1011 | } | ||
| 1012 | |||
| 1013 | /* | 992 | /* |
| 1014 | * Called when we want to stop a buffer from getting written or read. | 993 | * Called when we want to stop a buffer from getting written or read. |
| 1015 | * We attach the EIO error, muck with its flags, and call xfs_buf_ioend | 994 | * We attach the EIO error, muck with its flags, and call xfs_buf_ioend |
| @@ -1079,14 +1058,7 @@ xfs_bioerror_relse( | |||
| 1079 | return EIO; | 1058 | return EIO; |
| 1080 | } | 1059 | } |
| 1081 | 1060 | ||
| 1082 | 1061 | STATIC int | |
| 1083 | /* | ||
| 1084 | * All xfs metadata buffers except log state machine buffers | ||
| 1085 | * get this attached as their b_bdstrat callback function. | ||
| 1086 | * This is so that we can catch a buffer | ||
| 1087 | * after prematurely unpinning it to forcibly shutdown the filesystem. | ||
| 1088 | */ | ||
| 1089 | int | ||
| 1090 | xfs_bdstrat_cb( | 1062 | xfs_bdstrat_cb( |
| 1091 | struct xfs_buf *bp) | 1063 | struct xfs_buf *bp) |
| 1092 | { | 1064 | { |
| @@ -1107,6 +1079,27 @@ xfs_bdstrat_cb( | |||
| 1107 | return 0; | 1079 | return 0; |
| 1108 | } | 1080 | } |
| 1109 | 1081 | ||
| 1082 | int | ||
| 1083 | xfs_bwrite( | ||
| 1084 | struct xfs_buf *bp) | ||
| 1085 | { | ||
| 1086 | int error; | ||
| 1087 | |||
| 1088 | ASSERT(xfs_buf_islocked(bp)); | ||
| 1089 | |||
| 1090 | bp->b_flags |= XBF_WRITE; | ||
| 1091 | bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q); | ||
| 1092 | |||
| 1093 | xfs_bdstrat_cb(bp); | ||
| 1094 | |||
| 1095 | error = xfs_buf_iowait(bp); | ||
| 1096 | if (error) { | ||
| 1097 | xfs_force_shutdown(bp->b_target->bt_mount, | ||
| 1098 | SHUTDOWN_META_IO_ERROR); | ||
| 1099 | } | ||
| 1100 | return error; | ||
| 1101 | } | ||
| 1102 | |||
| 1110 | /* | 1103 | /* |
| 1111 | * Wrapper around bdstrat so that we can stop data from going to disk in case | 1104 | * Wrapper around bdstrat so that we can stop data from going to disk in case |
| 1112 | * we are shutting down the filesystem. Typically user data goes thru this | 1105 | * we are shutting down the filesystem. Typically user data goes thru this |
| @@ -1243,7 +1236,7 @@ xfs_buf_iorequest( | |||
| 1243 | */ | 1236 | */ |
| 1244 | atomic_set(&bp->b_io_remaining, 1); | 1237 | atomic_set(&bp->b_io_remaining, 1); |
| 1245 | _xfs_buf_ioapply(bp); | 1238 | _xfs_buf_ioapply(bp); |
| 1246 | _xfs_buf_ioend(bp, 0); | 1239 | _xfs_buf_ioend(bp, 1); |
| 1247 | 1240 | ||
| 1248 | xfs_buf_rele(bp); | 1241 | xfs_buf_rele(bp); |
| 1249 | } | 1242 | } |
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 7f1d1392ce37..79344c48008e 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h | |||
| @@ -180,7 +180,6 @@ extern void xfs_buf_unlock(xfs_buf_t *); | |||
| 180 | extern int xfs_bwrite(struct xfs_buf *bp); | 180 | extern int xfs_bwrite(struct xfs_buf *bp); |
| 181 | 181 | ||
| 182 | extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); | 182 | extern void xfsbdstrat(struct xfs_mount *, struct xfs_buf *); |
| 183 | extern int xfs_bdstrat_cb(struct xfs_buf *); | ||
| 184 | 183 | ||
| 185 | extern void xfs_buf_ioend(xfs_buf_t *, int); | 184 | extern void xfs_buf_ioend(xfs_buf_t *, int); |
| 186 | extern void xfs_buf_ioerror(xfs_buf_t *, int); | 185 | extern void xfs_buf_ioerror(xfs_buf_t *, int); |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 45df2b857d48..d9e451115f98 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
| @@ -954,7 +954,7 @@ xfs_buf_iodone_callbacks( | |||
| 954 | 954 | ||
| 955 | if (!XFS_BUF_ISSTALE(bp)) { | 955 | if (!XFS_BUF_ISSTALE(bp)) { |
| 956 | bp->b_flags |= XBF_WRITE | XBF_ASYNC | XBF_DONE; | 956 | bp->b_flags |= XBF_WRITE | XBF_ASYNC | XBF_DONE; |
| 957 | xfs_bdstrat_cb(bp); | 957 | xfs_buf_iorequest(bp); |
| 958 | } else { | 958 | } else { |
| 959 | xfs_buf_relse(bp); | 959 | xfs_buf_relse(bp); |
| 960 | } | 960 | } |
diff --git a/include/asm-generic/dma-contiguous.h b/include/asm-generic/dma-contiguous.h index c544356b374b..294b1e755ab2 100644 --- a/include/asm-generic/dma-contiguous.h +++ b/include/asm-generic/dma-contiguous.h | |||
| @@ -18,7 +18,7 @@ static inline void dev_set_cma_area(struct device *dev, struct cma *cma) | |||
| 18 | { | 18 | { |
| 19 | if (dev) | 19 | if (dev) |
| 20 | dev->cma_area = cma; | 20 | dev->cma_area = cma; |
| 21 | if (!dev || !dma_contiguous_default_area) | 21 | if (!dev && !dma_contiguous_default_area) |
| 22 | dma_contiguous_default_area = cma; | 22 | dma_contiguous_default_area = cma; |
| 23 | } | 23 | } |
| 24 | 24 | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index 68d56effc328..d10b7ed595b1 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -360,11 +360,11 @@ struct cpu_vfs_cap_data { | |||
| 360 | 360 | ||
| 361 | #define CAP_WAKE_ALARM 35 | 361 | #define CAP_WAKE_ALARM 35 |
| 362 | 362 | ||
| 363 | /* Allow preventing system suspends while epoll events are pending */ | 363 | /* Allow preventing system suspends */ |
| 364 | 364 | ||
| 365 | #define CAP_EPOLLWAKEUP 36 | 365 | #define CAP_BLOCK_SUSPEND 36 |
| 366 | 366 | ||
| 367 | #define CAP_LAST_CAP CAP_EPOLLWAKEUP | 367 | #define CAP_LAST_CAP CAP_BLOCK_SUSPEND |
| 368 | 368 | ||
| 369 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | 369 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) |
| 370 | 370 | ||
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 6f8be328770a..f4bb378ccf6a 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | * re-allowed until epoll_wait is called again after consuming the wakeup | 34 | * re-allowed until epoll_wait is called again after consuming the wakeup |
| 35 | * event(s). | 35 | * event(s). |
| 36 | * | 36 | * |
| 37 | * Requires CAP_EPOLLWAKEUP | 37 | * Requires CAP_BLOCK_SUSPEND |
| 38 | */ | 38 | */ |
| 39 | #define EPOLLWAKEUP (1 << 29) | 39 | #define EPOLLWAKEUP (1 << 29) |
| 40 | 40 | ||
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d6146b4811c2..95374d1696a1 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -1425,7 +1425,7 @@ static inline void ip_vs_notrack(struct sk_buff *skb) | |||
| 1425 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); | 1425 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); |
| 1426 | 1426 | ||
| 1427 | if (!ct || !nf_ct_is_untracked(ct)) { | 1427 | if (!ct || !nf_ct_is_untracked(ct)) { |
| 1428 | nf_reset(skb); | 1428 | nf_conntrack_put(skb->nfct); |
| 1429 | skb->nfct = &nf_ct_untracked_get()->ct_general; | 1429 | skb->nfct = &nf_ct_untracked_get()->ct_general; |
| 1430 | skb->nfctinfo = IP_CT_NEW; | 1430 | skb->nfctinfo = IP_CT_NEW; |
| 1431 | nf_conntrack_get(skb->nfct); | 1431 | nf_conntrack_get(skb->nfct); |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index a88fb6939387..e1ce1048fe5f 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
| @@ -78,7 +78,7 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
| 78 | struct net *net = nf_ct_net(ct); | 78 | struct net *net = nf_ct_net(ct); |
| 79 | struct nf_conntrack_ecache *e; | 79 | struct nf_conntrack_ecache *e; |
| 80 | 80 | ||
| 81 | if (net->ct.nf_conntrack_event_cb == NULL) | 81 | if (!rcu_access_pointer(net->ct.nf_conntrack_event_cb)) |
| 82 | return; | 82 | return; |
| 83 | 83 | ||
| 84 | e = nf_ct_ecache_find(ct); | 84 | e = nf_ct_ecache_find(ct); |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 269b1fe5f2ae..3447cfaf11e7 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
| @@ -717,6 +717,7 @@ static void timekeeping_resume(void) | |||
| 717 | timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); | 717 | timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); |
| 718 | timekeeper.ntp_error = 0; | 718 | timekeeper.ntp_error = 0; |
| 719 | timekeeping_suspended = 0; | 719 | timekeeping_suspended = 0; |
| 720 | timekeeping_update(false); | ||
| 720 | write_sequnlock_irqrestore(&timekeeper.lock, flags); | 721 | write_sequnlock_irqrestore(&timekeeper.lock, flags); |
| 721 | 722 | ||
| 722 | touch_softlockup_watchdog(); | 723 | touch_softlockup_watchdog(); |
diff --git a/mm/bootmem.c b/mm/bootmem.c index 73096630cb35..bcb63ac48cc5 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c | |||
| @@ -710,6 +710,10 @@ again: | |||
| 710 | if (ptr) | 710 | if (ptr) |
| 711 | return ptr; | 711 | return ptr; |
| 712 | 712 | ||
| 713 | /* do not panic in alloc_bootmem_bdata() */ | ||
| 714 | if (limit && goal + size > limit) | ||
| 715 | limit = 0; | ||
| 716 | |||
| 713 | ptr = alloc_bootmem_bdata(pgdat->bdata, size, align, goal, limit); | 717 | ptr = alloc_bootmem_bdata(pgdat->bdata, size, align, goal, limit); |
| 714 | if (ptr) | 718 | if (ptr) |
| 715 | return ptr; | 719 | return ptr; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 44030096da63..4a4f9219683f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -5635,7 +5635,12 @@ static struct page * | |||
| 5635 | __alloc_contig_migrate_alloc(struct page *page, unsigned long private, | 5635 | __alloc_contig_migrate_alloc(struct page *page, unsigned long private, |
| 5636 | int **resultp) | 5636 | int **resultp) |
| 5637 | { | 5637 | { |
| 5638 | return alloc_page(GFP_HIGHUSER_MOVABLE); | 5638 | gfp_t gfp_mask = GFP_USER | __GFP_MOVABLE; |
| 5639 | |||
| 5640 | if (PageHighMem(page)) | ||
| 5641 | gfp_mask |= __GFP_HIGHMEM; | ||
| 5642 | |||
| 5643 | return alloc_page(gfp_mask); | ||
| 5639 | } | 5644 | } |
| 5640 | 5645 | ||
| 5641 | /* [start, end) must belong to a single zone. */ | 5646 | /* [start, end) must belong to a single zone. */ |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 661576324c7f..66e431060c05 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -2688,7 +2688,10 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, int classzone_idx) | |||
| 2688 | * them before going back to sleep. | 2688 | * them before going back to sleep. |
| 2689 | */ | 2689 | */ |
| 2690 | set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); | 2690 | set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); |
| 2691 | schedule(); | 2691 | |
| 2692 | if (!kthread_should_stop()) | ||
| 2693 | schedule(); | ||
| 2694 | |||
| 2692 | set_pgdat_percpu_threshold(pgdat, calculate_pressure_threshold); | 2695 | set_pgdat_percpu_threshold(pgdat, calculate_pressure_threshold); |
| 2693 | } else { | 2696 | } else { |
| 2694 | if (remaining) | 2697 | if (remaining) |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 6089f0cf23b4..9096bcb08132 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -403,6 +403,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
| 403 | break; | 403 | break; |
| 404 | 404 | ||
| 405 | case NETDEV_DOWN: | 405 | case NETDEV_DOWN: |
| 406 | if (dev->features & NETIF_F_HW_VLAN_FILTER) | ||
| 407 | vlan_vid_del(dev, 0); | ||
| 408 | |||
| 406 | /* Put all VLANs for this dev in the down state too. */ | 409 | /* Put all VLANs for this dev in the down state too. */ |
| 407 | for (i = 0; i < VLAN_N_VID; i++) { | 410 | for (i = 0; i < VLAN_N_VID; i++) { |
| 408 | vlandev = vlan_group_get_device(grp, i); | 411 | vlandev = vlan_group_get_device(grp, i); |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 051f7abae66d..779095ded689 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
| @@ -842,6 +842,7 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol, | |||
| 842 | case AX25_P_NETROM: | 842 | case AX25_P_NETROM: |
| 843 | if (ax25_protocol_is_registered(AX25_P_NETROM)) | 843 | if (ax25_protocol_is_registered(AX25_P_NETROM)) |
| 844 | return -ESOCKTNOSUPPORT; | 844 | return -ESOCKTNOSUPPORT; |
| 845 | break; | ||
| 845 | #endif | 846 | #endif |
| 846 | #ifdef CONFIG_ROSE_MODULE | 847 | #ifdef CONFIG_ROSE_MODULE |
| 847 | case AX25_P_ROSE: | 848 | case AX25_P_ROSE: |
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 8bf97515a77d..c5863f499133 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
| @@ -1351,6 +1351,7 @@ void bla_free(struct bat_priv *bat_priv) | |||
| 1351 | * @bat_priv: the bat priv with all the soft interface information | 1351 | * @bat_priv: the bat priv with all the soft interface information |
| 1352 | * @skb: the frame to be checked | 1352 | * @skb: the frame to be checked |
| 1353 | * @vid: the VLAN ID of the frame | 1353 | * @vid: the VLAN ID of the frame |
| 1354 | * @is_bcast: the packet came in a broadcast packet type. | ||
| 1354 | * | 1355 | * |
| 1355 | * bla_rx avoidance checks if: | 1356 | * bla_rx avoidance checks if: |
| 1356 | * * we have to race for a claim | 1357 | * * we have to race for a claim |
| @@ -1361,7 +1362,8 @@ void bla_free(struct bat_priv *bat_priv) | |||
| 1361 | * process the skb. | 1362 | * process the skb. |
| 1362 | * | 1363 | * |
| 1363 | */ | 1364 | */ |
| 1364 | int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | 1365 | int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid, |
| 1366 | bool is_bcast) | ||
| 1365 | { | 1367 | { |
| 1366 | struct ethhdr *ethhdr; | 1368 | struct ethhdr *ethhdr; |
| 1367 | struct claim search_claim, *claim = NULL; | 1369 | struct claim search_claim, *claim = NULL; |
| @@ -1380,7 +1382,7 @@ int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | |||
| 1380 | 1382 | ||
| 1381 | if (unlikely(atomic_read(&bat_priv->bla_num_requests))) | 1383 | if (unlikely(atomic_read(&bat_priv->bla_num_requests))) |
| 1382 | /* don't allow broadcasts while requests are in flight */ | 1384 | /* don't allow broadcasts while requests are in flight */ |
| 1383 | if (is_multicast_ether_addr(ethhdr->h_dest)) | 1385 | if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) |
| 1384 | goto handled; | 1386 | goto handled; |
| 1385 | 1387 | ||
| 1386 | memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); | 1388 | memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); |
| @@ -1406,8 +1408,13 @@ int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) | |||
| 1406 | } | 1408 | } |
| 1407 | 1409 | ||
| 1408 | /* if it is a broadcast ... */ | 1410 | /* if it is a broadcast ... */ |
| 1409 | if (is_multicast_ether_addr(ethhdr->h_dest)) { | 1411 | if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) { |
| 1410 | /* ... drop it. the responsible gateway is in charge. */ | 1412 | /* ... drop it. the responsible gateway is in charge. |
| 1413 | * | ||
| 1414 | * We need to check is_bcast because with the gateway | ||
| 1415 | * feature, broadcasts (like DHCP requests) may be sent | ||
| 1416 | * using a unicast packet type. | ||
| 1417 | */ | ||
| 1411 | goto handled; | 1418 | goto handled; |
| 1412 | } else { | 1419 | } else { |
| 1413 | /* seems the client considers us as its best gateway. | 1420 | /* seems the client considers us as its best gateway. |
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h index e39f93acc28f..dc5227b398d4 100644 --- a/net/batman-adv/bridge_loop_avoidance.h +++ b/net/batman-adv/bridge_loop_avoidance.h | |||
| @@ -23,7 +23,8 @@ | |||
| 23 | #define _NET_BATMAN_ADV_BLA_H_ | 23 | #define _NET_BATMAN_ADV_BLA_H_ |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_BATMAN_ADV_BLA | 25 | #ifdef CONFIG_BATMAN_ADV_BLA |
| 26 | int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); | 26 | int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid, |
| 27 | bool is_bcast); | ||
| 27 | int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); | 28 | int bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid); |
| 28 | int bla_is_backbone_gw(struct sk_buff *skb, | 29 | int bla_is_backbone_gw(struct sk_buff *skb, |
| 29 | struct orig_node *orig_node, int hdr_size); | 30 | struct orig_node *orig_node, int hdr_size); |
| @@ -41,7 +42,7 @@ void bla_free(struct bat_priv *bat_priv); | |||
| 41 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ | 42 | #else /* ifdef CONFIG_BATMAN_ADV_BLA */ |
| 42 | 43 | ||
| 43 | static inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, | 44 | static inline int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, |
| 44 | short vid) | 45 | short vid, bool is_bcast) |
| 45 | { | 46 | { |
| 46 | return 0; | 47 | return 0; |
| 47 | } | 48 | } |
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 6e2530b02043..a0ec0e4ada4c 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
| @@ -256,7 +256,11 @@ void interface_rx(struct net_device *soft_iface, | |||
| 256 | struct bat_priv *bat_priv = netdev_priv(soft_iface); | 256 | struct bat_priv *bat_priv = netdev_priv(soft_iface); |
| 257 | struct ethhdr *ethhdr; | 257 | struct ethhdr *ethhdr; |
| 258 | struct vlan_ethhdr *vhdr; | 258 | struct vlan_ethhdr *vhdr; |
| 259 | struct batman_header *batadv_header = (struct batman_header *)skb->data; | ||
| 259 | short vid __maybe_unused = -1; | 260 | short vid __maybe_unused = -1; |
| 261 | bool is_bcast; | ||
| 262 | |||
| 263 | is_bcast = (batadv_header->packet_type == BAT_BCAST); | ||
| 260 | 264 | ||
| 261 | /* check if enough space is available for pulling, and pull */ | 265 | /* check if enough space is available for pulling, and pull */ |
| 262 | if (!pskb_may_pull(skb, hdr_size)) | 266 | if (!pskb_may_pull(skb, hdr_size)) |
| @@ -302,7 +306,7 @@ void interface_rx(struct net_device *soft_iface, | |||
| 302 | /* Let the bridge loop avoidance check the packet. If will | 306 | /* Let the bridge loop avoidance check the packet. If will |
| 303 | * not handle it, we can safely push it up. | 307 | * not handle it, we can safely push it up. |
| 304 | */ | 308 | */ |
| 305 | if (bla_rx(bat_priv, skb, vid)) | 309 | if (bla_rx(bat_priv, skb, vid, is_bcast)) |
| 306 | goto out; | 310 | goto out; |
| 307 | 311 | ||
| 308 | netif_rx(skb); | 312 | netif_rx(skb); |
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 554b31289607..8c83c175b03a 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c | |||
| @@ -561,9 +561,9 @@ static int __init caif_device_init(void) | |||
| 561 | 561 | ||
| 562 | static void __exit caif_device_exit(void) | 562 | static void __exit caif_device_exit(void) |
| 563 | { | 563 | { |
| 564 | unregister_pernet_subsys(&caif_net_ops); | ||
| 565 | unregister_netdevice_notifier(&caif_device_notifier); | 564 | unregister_netdevice_notifier(&caif_device_notifier); |
| 566 | dev_remove_pack(&caif_packet_type); | 565 | dev_remove_pack(&caif_packet_type); |
| 566 | unregister_pernet_subsys(&caif_net_ops); | ||
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | module_init(caif_device_init); | 569 | module_init(caif_device_init); |
diff --git a/net/core/dev.c b/net/core/dev.c index 84f01ba81a34..0f28a9e0b8ad 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2444,8 +2444,12 @@ static void skb_update_prio(struct sk_buff *skb) | |||
| 2444 | { | 2444 | { |
| 2445 | struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); | 2445 | struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap); |
| 2446 | 2446 | ||
| 2447 | if ((!skb->priority) && (skb->sk) && map) | 2447 | if (!skb->priority && skb->sk && map) { |
| 2448 | skb->priority = map->priomap[skb->sk->sk_cgrp_prioidx]; | 2448 | unsigned int prioidx = skb->sk->sk_cgrp_prioidx; |
| 2449 | |||
| 2450 | if (prioidx < map->priomap_len) | ||
| 2451 | skb->priority = map->priomap[prioidx]; | ||
| 2452 | } | ||
| 2449 | } | 2453 | } |
| 2450 | #else | 2454 | #else |
| 2451 | #define skb_update_prio(skb) | 2455 | #define skb_update_prio(skb) |
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 5b8aa2fae48b..b2e9caa1ad1a 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c | |||
| @@ -49,8 +49,9 @@ static int get_prioidx(u32 *prio) | |||
| 49 | return -ENOSPC; | 49 | return -ENOSPC; |
| 50 | } | 50 | } |
| 51 | set_bit(prioidx, prioidx_map); | 51 | set_bit(prioidx, prioidx_map); |
| 52 | if (atomic_read(&max_prioidx) < prioidx) | ||
| 53 | atomic_set(&max_prioidx, prioidx); | ||
| 52 | spin_unlock_irqrestore(&prioidx_map_lock, flags); | 54 | spin_unlock_irqrestore(&prioidx_map_lock, flags); |
| 53 | atomic_set(&max_prioidx, prioidx); | ||
| 54 | *prio = prioidx; | 55 | *prio = prioidx; |
| 55 | return 0; | 56 | return 0; |
| 56 | } | 57 | } |
| @@ -64,7 +65,7 @@ static void put_prioidx(u32 idx) | |||
| 64 | spin_unlock_irqrestore(&prioidx_map_lock, flags); | 65 | spin_unlock_irqrestore(&prioidx_map_lock, flags); |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | static void extend_netdev_table(struct net_device *dev, u32 new_len) | 68 | static int extend_netdev_table(struct net_device *dev, u32 new_len) |
| 68 | { | 69 | { |
| 69 | size_t new_size = sizeof(struct netprio_map) + | 70 | size_t new_size = sizeof(struct netprio_map) + |
| 70 | ((sizeof(u32) * new_len)); | 71 | ((sizeof(u32) * new_len)); |
| @@ -76,7 +77,7 @@ static void extend_netdev_table(struct net_device *dev, u32 new_len) | |||
| 76 | 77 | ||
| 77 | if (!new_priomap) { | 78 | if (!new_priomap) { |
| 78 | pr_warn("Unable to alloc new priomap!\n"); | 79 | pr_warn("Unable to alloc new priomap!\n"); |
| 79 | return; | 80 | return -ENOMEM; |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | for (i = 0; | 83 | for (i = 0; |
| @@ -89,46 +90,79 @@ static void extend_netdev_table(struct net_device *dev, u32 new_len) | |||
| 89 | rcu_assign_pointer(dev->priomap, new_priomap); | 90 | rcu_assign_pointer(dev->priomap, new_priomap); |
| 90 | if (old_priomap) | 91 | if (old_priomap) |
| 91 | kfree_rcu(old_priomap, rcu); | 92 | kfree_rcu(old_priomap, rcu); |
| 93 | return 0; | ||
| 92 | } | 94 | } |
| 93 | 95 | ||
| 94 | static void update_netdev_tables(void) | 96 | static int write_update_netdev_table(struct net_device *dev) |
| 95 | { | 97 | { |
| 98 | int ret = 0; | ||
| 99 | u32 max_len; | ||
| 100 | struct netprio_map *map; | ||
| 101 | |||
| 102 | rtnl_lock(); | ||
| 103 | max_len = atomic_read(&max_prioidx) + 1; | ||
| 104 | map = rtnl_dereference(dev->priomap); | ||
| 105 | if (!map || map->priomap_len < max_len) | ||
| 106 | ret = extend_netdev_table(dev, max_len); | ||
| 107 | rtnl_unlock(); | ||
| 108 | |||
| 109 | return ret; | ||
| 110 | } | ||
| 111 | |||
| 112 | static int update_netdev_tables(void) | ||
| 113 | { | ||
| 114 | int ret = 0; | ||
| 96 | struct net_device *dev; | 115 | struct net_device *dev; |
| 97 | u32 max_len = atomic_read(&max_prioidx) + 1; | 116 | u32 max_len; |
| 98 | struct netprio_map *map; | 117 | struct netprio_map *map; |
| 99 | 118 | ||
| 100 | rtnl_lock(); | 119 | rtnl_lock(); |
| 120 | max_len = atomic_read(&max_prioidx) + 1; | ||
| 101 | for_each_netdev(&init_net, dev) { | 121 | for_each_netdev(&init_net, dev) { |
| 102 | map = rtnl_dereference(dev->priomap); | 122 | map = rtnl_dereference(dev->priomap); |
| 103 | if ((!map) || | 123 | /* |
| 104 | (map->priomap_len < max_len)) | 124 | * don't allocate priomap if we didn't |
| 105 | extend_netdev_table(dev, max_len); | 125 | * change net_prio.ifpriomap (map == NULL), |
| 126 | * this will speed up skb_update_prio. | ||
| 127 | */ | ||
| 128 | if (map && map->priomap_len < max_len) { | ||
| 129 | ret = extend_netdev_table(dev, max_len); | ||
| 130 | if (ret < 0) | ||
| 131 | break; | ||
| 132 | } | ||
| 106 | } | 133 | } |
| 107 | rtnl_unlock(); | 134 | rtnl_unlock(); |
| 135 | return ret; | ||
| 108 | } | 136 | } |
| 109 | 137 | ||
| 110 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp) | 138 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp) |
| 111 | { | 139 | { |
| 112 | struct cgroup_netprio_state *cs; | 140 | struct cgroup_netprio_state *cs; |
| 113 | int ret; | 141 | int ret = -EINVAL; |
| 114 | 142 | ||
| 115 | cs = kzalloc(sizeof(*cs), GFP_KERNEL); | 143 | cs = kzalloc(sizeof(*cs), GFP_KERNEL); |
| 116 | if (!cs) | 144 | if (!cs) |
| 117 | return ERR_PTR(-ENOMEM); | 145 | return ERR_PTR(-ENOMEM); |
| 118 | 146 | ||
| 119 | if (cgrp->parent && cgrp_netprio_state(cgrp->parent)->prioidx) { | 147 | if (cgrp->parent && cgrp_netprio_state(cgrp->parent)->prioidx) |
| 120 | kfree(cs); | 148 | goto out; |
| 121 | return ERR_PTR(-EINVAL); | ||
| 122 | } | ||
| 123 | 149 | ||
| 124 | ret = get_prioidx(&cs->prioidx); | 150 | ret = get_prioidx(&cs->prioidx); |
| 125 | if (ret != 0) { | 151 | if (ret < 0) { |
| 126 | pr_warn("No space in priority index array\n"); | 152 | pr_warn("No space in priority index array\n"); |
| 127 | kfree(cs); | 153 | goto out; |
| 128 | return ERR_PTR(ret); | 154 | } |
| 155 | |||
| 156 | ret = update_netdev_tables(); | ||
| 157 | if (ret < 0) { | ||
| 158 | put_prioidx(cs->prioidx); | ||
| 159 | goto out; | ||
| 129 | } | 160 | } |
| 130 | 161 | ||
| 131 | return &cs->css; | 162 | return &cs->css; |
| 163 | out: | ||
| 164 | kfree(cs); | ||
| 165 | return ERR_PTR(ret); | ||
| 132 | } | 166 | } |
| 133 | 167 | ||
| 134 | static void cgrp_destroy(struct cgroup *cgrp) | 168 | static void cgrp_destroy(struct cgroup *cgrp) |
| @@ -141,7 +175,7 @@ static void cgrp_destroy(struct cgroup *cgrp) | |||
| 141 | rtnl_lock(); | 175 | rtnl_lock(); |
| 142 | for_each_netdev(&init_net, dev) { | 176 | for_each_netdev(&init_net, dev) { |
| 143 | map = rtnl_dereference(dev->priomap); | 177 | map = rtnl_dereference(dev->priomap); |
| 144 | if (map) | 178 | if (map && cs->prioidx < map->priomap_len) |
| 145 | map->priomap[cs->prioidx] = 0; | 179 | map->priomap[cs->prioidx] = 0; |
| 146 | } | 180 | } |
| 147 | rtnl_unlock(); | 181 | rtnl_unlock(); |
| @@ -165,7 +199,7 @@ static int read_priomap(struct cgroup *cont, struct cftype *cft, | |||
| 165 | rcu_read_lock(); | 199 | rcu_read_lock(); |
| 166 | for_each_netdev_rcu(&init_net, dev) { | 200 | for_each_netdev_rcu(&init_net, dev) { |
| 167 | map = rcu_dereference(dev->priomap); | 201 | map = rcu_dereference(dev->priomap); |
| 168 | priority = map ? map->priomap[prioidx] : 0; | 202 | priority = (map && prioidx < map->priomap_len) ? map->priomap[prioidx] : 0; |
| 169 | cb->fill(cb, dev->name, priority); | 203 | cb->fill(cb, dev->name, priority); |
| 170 | } | 204 | } |
| 171 | rcu_read_unlock(); | 205 | rcu_read_unlock(); |
| @@ -220,13 +254,17 @@ static int write_priomap(struct cgroup *cgrp, struct cftype *cft, | |||
| 220 | if (!dev) | 254 | if (!dev) |
| 221 | goto out_free_devname; | 255 | goto out_free_devname; |
| 222 | 256 | ||
| 223 | update_netdev_tables(); | 257 | ret = write_update_netdev_table(dev); |
| 224 | ret = 0; | 258 | if (ret < 0) |
| 259 | goto out_put_dev; | ||
| 260 | |||
| 225 | rcu_read_lock(); | 261 | rcu_read_lock(); |
| 226 | map = rcu_dereference(dev->priomap); | 262 | map = rcu_dereference(dev->priomap); |
| 227 | if (map) | 263 | if (map) |
| 228 | map->priomap[prioidx] = priority; | 264 | map->priomap[prioidx] = priority; |
| 229 | rcu_read_unlock(); | 265 | rcu_read_unlock(); |
| 266 | |||
| 267 | out_put_dev: | ||
| 230 | dev_put(dev); | 268 | dev_put(dev); |
| 231 | 269 | ||
| 232 | out_free_devname: | 270 | out_free_devname: |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 46a3d23d259e..d124306b81fd 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -353,7 +353,7 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | |||
| 353 | unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) + | 353 | unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) + |
| 354 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); | 354 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); |
| 355 | 355 | ||
| 356 | if (fragsz <= PAGE_SIZE && !(gfp_mask & __GFP_WAIT)) { | 356 | if (fragsz <= PAGE_SIZE && !(gfp_mask & (__GFP_WAIT | GFP_DMA))) { |
| 357 | void *data = netdev_alloc_frag(fragsz); | 357 | void *data = netdev_alloc_frag(fragsz); |
| 358 | 358 | ||
| 359 | if (likely(data)) { | 359 | if (likely(data)) { |
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 6fbb2ad7bb6d..16705611589a 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
| @@ -230,6 +230,12 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
| 230 | mtu = dev->mtu; | 230 | mtu = dev->mtu; |
| 231 | pr_debug("name = %s, mtu = %u\n", dev->name, mtu); | 231 | pr_debug("name = %s, mtu = %u\n", dev->name, mtu); |
| 232 | 232 | ||
| 233 | if (size > mtu) { | ||
| 234 | pr_debug("size = %Zu, mtu = %u\n", size, mtu); | ||
| 235 | err = -EINVAL; | ||
| 236 | goto out_dev; | ||
| 237 | } | ||
| 238 | |||
| 233 | hlen = LL_RESERVED_SPACE(dev); | 239 | hlen = LL_RESERVED_SPACE(dev); |
| 234 | tlen = dev->needed_tailroom; | 240 | tlen = dev->needed_tailroom; |
| 235 | skb = sock_alloc_send_skb(sk, hlen + tlen + size, | 241 | skb = sock_alloc_send_skb(sk, hlen + tlen + size, |
| @@ -258,12 +264,6 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
| 258 | if (err < 0) | 264 | if (err < 0) |
| 259 | goto out_skb; | 265 | goto out_skb; |
| 260 | 266 | ||
| 261 | if (size > mtu) { | ||
| 262 | pr_debug("size = %Zu, mtu = %u\n", size, mtu); | ||
| 263 | err = -EINVAL; | ||
| 264 | goto out_skb; | ||
| 265 | } | ||
| 266 | |||
| 267 | skb->dev = dev; | 267 | skb->dev = dev; |
| 268 | skb->sk = sk; | 268 | skb->sk = sk; |
| 269 | skb->protocol = htons(ETH_P_IEEE802154); | 269 | skb->protocol = htons(ETH_P_IEEE802154); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a4bb856de08f..0db5d34a06b6 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -2174,15 +2174,13 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
| 2174 | sdata->name, mgmt->sa, status_code); | 2174 | sdata->name, mgmt->sa, status_code); |
| 2175 | ieee80211_destroy_assoc_data(sdata, false); | 2175 | ieee80211_destroy_assoc_data(sdata, false); |
| 2176 | } else { | 2176 | } else { |
| 2177 | printk(KERN_DEBUG "%s: associated\n", sdata->name); | ||
| 2178 | |||
| 2179 | if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { | 2177 | if (!ieee80211_assoc_success(sdata, *bss, mgmt, len)) { |
| 2180 | /* oops -- internal error -- send timeout for now */ | 2178 | /* oops -- internal error -- send timeout for now */ |
| 2181 | ieee80211_destroy_assoc_data(sdata, true); | 2179 | ieee80211_destroy_assoc_data(sdata, false); |
| 2182 | sta_info_destroy_addr(sdata, mgmt->bssid); | ||
| 2183 | cfg80211_put_bss(*bss); | 2180 | cfg80211_put_bss(*bss); |
| 2184 | return RX_MGMT_CFG80211_ASSOC_TIMEOUT; | 2181 | return RX_MGMT_CFG80211_ASSOC_TIMEOUT; |
| 2185 | } | 2182 | } |
| 2183 | printk(KERN_DEBUG "%s: associated\n", sdata->name); | ||
| 2186 | 2184 | ||
| 2187 | /* | 2185 | /* |
| 2188 | * destroy assoc_data afterwards, as otherwise an idle | 2186 | * destroy assoc_data afterwards, as otherwise an idle |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 2d1acc6c5445..f9e51ef8dfa2 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
| @@ -809,7 +809,7 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp) | |||
| 809 | max_rates = sband->n_bitrates; | 809 | max_rates = sband->n_bitrates; |
| 810 | } | 810 | } |
| 811 | 811 | ||
| 812 | msp = kzalloc(sizeof(struct minstrel_ht_sta), gfp); | 812 | msp = kzalloc(sizeof(*msp), gfp); |
| 813 | if (!msp) | 813 | if (!msp) |
| 814 | return NULL; | 814 | return NULL; |
| 815 | 815 | ||
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index d43e3c122f7b..84444dda194b 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
| @@ -1521,11 +1521,12 @@ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, | |||
| 1521 | { | 1521 | { |
| 1522 | struct net_device *dev = ptr; | 1522 | struct net_device *dev = ptr; |
| 1523 | struct net *net = dev_net(dev); | 1523 | struct net *net = dev_net(dev); |
| 1524 | struct netns_ipvs *ipvs = net_ipvs(net); | ||
| 1524 | struct ip_vs_service *svc; | 1525 | struct ip_vs_service *svc; |
| 1525 | struct ip_vs_dest *dest; | 1526 | struct ip_vs_dest *dest; |
| 1526 | unsigned int idx; | 1527 | unsigned int idx; |
| 1527 | 1528 | ||
| 1528 | if (event != NETDEV_UNREGISTER) | 1529 | if (event != NETDEV_UNREGISTER || !ipvs) |
| 1529 | return NOTIFY_DONE; | 1530 | return NOTIFY_DONE; |
| 1530 | IP_VS_DBG(3, "%s() dev=%s\n", __func__, dev->name); | 1531 | IP_VS_DBG(3, "%s() dev=%s\n", __func__, dev->name); |
| 1531 | EnterFunction(2); | 1532 | EnterFunction(2); |
| @@ -1551,7 +1552,7 @@ static int ip_vs_dst_event(struct notifier_block *this, unsigned long event, | |||
| 1551 | } | 1552 | } |
| 1552 | } | 1553 | } |
| 1553 | 1554 | ||
| 1554 | list_for_each_entry(dest, &net_ipvs(net)->dest_trash, n_list) { | 1555 | list_for_each_entry(dest, &ipvs->dest_trash, n_list) { |
| 1555 | __ip_vs_dev_reset(dest, dev); | 1556 | __ip_vs_dev_reset(dest, dev); |
| 1556 | } | 1557 | } |
| 1557 | mutex_unlock(&__ip_vs_mutex); | 1558 | mutex_unlock(&__ip_vs_mutex); |
diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c index 035960ec5cb9..c6f7db720d84 100644 --- a/net/netfilter/xt_set.c +++ b/net/netfilter/xt_set.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | #include <linux/netfilter/x_tables.h> | 17 | #include <linux/netfilter/x_tables.h> |
| 18 | #include <linux/netfilter/xt_set.h> | 18 | #include <linux/netfilter/xt_set.h> |
| 19 | #include <linux/netfilter/ipset/ip_set_timeout.h> | ||
| 19 | 20 | ||
| 20 | MODULE_LICENSE("GPL"); | 21 | MODULE_LICENSE("GPL"); |
| 21 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); | 22 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); |
| @@ -310,7 +311,8 @@ set_target_v2(struct sk_buff *skb, const struct xt_action_param *par) | |||
| 310 | info->del_set.flags, 0, UINT_MAX); | 311 | info->del_set.flags, 0, UINT_MAX); |
| 311 | 312 | ||
| 312 | /* Normalize to fit into jiffies */ | 313 | /* Normalize to fit into jiffies */ |
| 313 | if (add_opt.timeout > UINT_MAX/MSEC_PER_SEC) | 314 | if (add_opt.timeout != IPSET_NO_TIMEOUT && |
| 315 | add_opt.timeout > UINT_MAX/MSEC_PER_SEC) | ||
| 314 | add_opt.timeout = UINT_MAX/MSEC_PER_SEC; | 316 | add_opt.timeout = UINT_MAX/MSEC_PER_SEC; |
| 315 | if (info->add_set.index != IPSET_INVALID_ID) | 317 | if (info->add_set.index != IPSET_INVALID_ID) |
| 316 | ip_set_add(info->add_set.index, skb, par, &add_opt); | 318 | ip_set_add(info->add_set.index, skb, par, &add_opt); |
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index 17a707db40eb..e06d458fc719 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c | |||
| @@ -292,7 +292,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *addr, | |||
| 292 | 292 | ||
| 293 | pr_debug("%p\n", sk); | 293 | pr_debug("%p\n", sk); |
| 294 | 294 | ||
| 295 | if (llcp_sock == NULL) | 295 | if (llcp_sock == NULL || llcp_sock->dev == NULL) |
| 296 | return -EBADFD; | 296 | return -EBADFD; |
| 297 | 297 | ||
| 298 | addr->sa_family = AF_NFC; | 298 | addr->sa_family = AF_NFC; |
diff --git a/net/rxrpc/ar-peer.c b/net/rxrpc/ar-peer.c index 2754f098d436..bebaa43484bc 100644 --- a/net/rxrpc/ar-peer.c +++ b/net/rxrpc/ar-peer.c | |||
| @@ -229,7 +229,7 @@ found_UDP_peer: | |||
| 229 | return peer; | 229 | return peer; |
| 230 | 230 | ||
| 231 | new_UDP_peer: | 231 | new_UDP_peer: |
| 232 | _net("Rx UDP DGRAM from NEW peer %d", peer->debug_id); | 232 | _net("Rx UDP DGRAM from NEW peer"); |
| 233 | read_unlock_bh(&rxrpc_peer_lock); | 233 | read_unlock_bh(&rxrpc_peer_lock); |
| 234 | _leave(" = -EBUSY [new]"); | 234 | _leave(" = -EBUSY [new]"); |
| 235 | return ERR_PTR(-EBUSY); | 235 | return ERR_PTR(-EBUSY); |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index a2a95aabf9c2..c412ad0d0308 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
| @@ -331,29 +331,22 @@ static psched_time_t packet_len_2_sched_time(unsigned int len, struct netem_sche | |||
| 331 | return PSCHED_NS2TICKS(ticks); | 331 | return PSCHED_NS2TICKS(ticks); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) | 334 | static void tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) |
| 335 | { | 335 | { |
| 336 | struct sk_buff_head *list = &sch->q; | 336 | struct sk_buff_head *list = &sch->q; |
| 337 | psched_time_t tnext = netem_skb_cb(nskb)->time_to_send; | 337 | psched_time_t tnext = netem_skb_cb(nskb)->time_to_send; |
| 338 | struct sk_buff *skb; | 338 | struct sk_buff *skb = skb_peek_tail(list); |
| 339 | |||
| 340 | if (likely(skb_queue_len(list) < sch->limit)) { | ||
| 341 | skb = skb_peek_tail(list); | ||
| 342 | /* Optimize for add at tail */ | ||
| 343 | if (likely(!skb || tnext >= netem_skb_cb(skb)->time_to_send)) | ||
| 344 | return qdisc_enqueue_tail(nskb, sch); | ||
| 345 | 339 | ||
| 346 | skb_queue_reverse_walk(list, skb) { | 340 | /* Optimize for add at tail */ |
| 347 | if (tnext >= netem_skb_cb(skb)->time_to_send) | 341 | if (likely(!skb || tnext >= netem_skb_cb(skb)->time_to_send)) |
| 348 | break; | 342 | return __skb_queue_tail(list, nskb); |
| 349 | } | ||
| 350 | 343 | ||
| 351 | __skb_queue_after(list, skb, nskb); | 344 | skb_queue_reverse_walk(list, skb) { |
| 352 | sch->qstats.backlog += qdisc_pkt_len(nskb); | 345 | if (tnext >= netem_skb_cb(skb)->time_to_send) |
| 353 | return NET_XMIT_SUCCESS; | 346 | break; |
| 354 | } | 347 | } |
| 355 | 348 | ||
| 356 | return qdisc_reshape_fail(nskb, sch); | 349 | __skb_queue_after(list, skb, nskb); |
| 357 | } | 350 | } |
| 358 | 351 | ||
| 359 | /* | 352 | /* |
| @@ -368,7 +361,6 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 368 | /* We don't fill cb now as skb_unshare() may invalidate it */ | 361 | /* We don't fill cb now as skb_unshare() may invalidate it */ |
| 369 | struct netem_skb_cb *cb; | 362 | struct netem_skb_cb *cb; |
| 370 | struct sk_buff *skb2; | 363 | struct sk_buff *skb2; |
| 371 | int ret; | ||
| 372 | int count = 1; | 364 | int count = 1; |
| 373 | 365 | ||
| 374 | /* Random duplication */ | 366 | /* Random duplication */ |
| @@ -419,6 +411,11 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 419 | skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); | 411 | skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); |
| 420 | } | 412 | } |
| 421 | 413 | ||
| 414 | if (unlikely(skb_queue_len(&sch->q) >= sch->limit)) | ||
| 415 | return qdisc_reshape_fail(skb, sch); | ||
| 416 | |||
| 417 | sch->qstats.backlog += qdisc_pkt_len(skb); | ||
| 418 | |||
| 422 | cb = netem_skb_cb(skb); | 419 | cb = netem_skb_cb(skb); |
| 423 | if (q->gap == 0 || /* not doing reordering */ | 420 | if (q->gap == 0 || /* not doing reordering */ |
| 424 | q->counter < q->gap - 1 || /* inside last reordering gap */ | 421 | q->counter < q->gap - 1 || /* inside last reordering gap */ |
| @@ -450,7 +447,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 450 | 447 | ||
| 451 | cb->time_to_send = now + delay; | 448 | cb->time_to_send = now + delay; |
| 452 | ++q->counter; | 449 | ++q->counter; |
| 453 | ret = tfifo_enqueue(skb, sch); | 450 | tfifo_enqueue(skb, sch); |
| 454 | } else { | 451 | } else { |
| 455 | /* | 452 | /* |
| 456 | * Do re-ordering by putting one out of N packets at the front | 453 | * Do re-ordering by putting one out of N packets at the front |
| @@ -460,16 +457,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 460 | q->counter = 0; | 457 | q->counter = 0; |
| 461 | 458 | ||
| 462 | __skb_queue_head(&sch->q, skb); | 459 | __skb_queue_head(&sch->q, skb); |
| 463 | sch->qstats.backlog += qdisc_pkt_len(skb); | ||
| 464 | sch->qstats.requeues++; | 460 | sch->qstats.requeues++; |
| 465 | ret = NET_XMIT_SUCCESS; | ||
| 466 | } | ||
| 467 | |||
| 468 | if (ret != NET_XMIT_SUCCESS) { | ||
| 469 | if (net_xmit_drop_count(ret)) { | ||
| 470 | sch->qstats.drops++; | ||
| 471 | return ret; | ||
| 472 | } | ||
| 473 | } | 461 | } |
| 474 | 462 | ||
| 475 | return NET_XMIT_SUCCESS; | 463 | return NET_XMIT_SUCCESS; |
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c index 74305c883bd3..30ea4674cabd 100644 --- a/net/sched/sch_sfb.c +++ b/net/sched/sch_sfb.c | |||
| @@ -570,6 +570,8 @@ static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
| 570 | 570 | ||
| 571 | sch->qstats.backlog = q->qdisc->qstats.backlog; | 571 | sch->qstats.backlog = q->qdisc->qstats.backlog; |
| 572 | opts = nla_nest_start(skb, TCA_OPTIONS); | 572 | opts = nla_nest_start(skb, TCA_OPTIONS); |
| 573 | if (opts == NULL) | ||
| 574 | goto nla_put_failure; | ||
| 573 | if (nla_put(skb, TCA_SFB_PARMS, sizeof(opt), &opt)) | 575 | if (nla_put(skb, TCA_SFB_PARMS, sizeof(opt), &opt)) |
| 574 | goto nla_put_failure; | 576 | goto nla_put_failure; |
| 575 | return nla_nest_end(skb, opts); | 577 | return nla_nest_end(skb, opts); |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 80564fe03024..8b9b6790a3df 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
| @@ -736,15 +736,12 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep) | |||
| 736 | 736 | ||
| 737 | epb = &ep->base; | 737 | epb = &ep->base; |
| 738 | 738 | ||
| 739 | if (hlist_unhashed(&epb->node)) | ||
| 740 | return; | ||
| 741 | |||
| 742 | epb->hashent = sctp_ep_hashfn(epb->bind_addr.port); | 739 | epb->hashent = sctp_ep_hashfn(epb->bind_addr.port); |
| 743 | 740 | ||
| 744 | head = &sctp_ep_hashtable[epb->hashent]; | 741 | head = &sctp_ep_hashtable[epb->hashent]; |
| 745 | 742 | ||
| 746 | sctp_write_lock(&head->lock); | 743 | sctp_write_lock(&head->lock); |
| 747 | __hlist_del(&epb->node); | 744 | hlist_del_init(&epb->node); |
| 748 | sctp_write_unlock(&head->lock); | 745 | sctp_write_unlock(&head->lock); |
| 749 | } | 746 | } |
| 750 | 747 | ||
| @@ -825,7 +822,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc) | |||
| 825 | head = &sctp_assoc_hashtable[epb->hashent]; | 822 | head = &sctp_assoc_hashtable[epb->hashent]; |
| 826 | 823 | ||
| 827 | sctp_write_lock(&head->lock); | 824 | sctp_write_lock(&head->lock); |
| 828 | __hlist_del(&epb->node); | 825 | hlist_del_init(&epb->node); |
| 829 | sctp_write_unlock(&head->lock); | 826 | sctp_write_unlock(&head->lock); |
| 830 | } | 827 | } |
| 831 | 828 | ||
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index b3b8a8d813eb..31c7bfcd9b58 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -1231,8 +1231,14 @@ out_free: | |||
| 1231 | SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p" | 1231 | SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p" |
| 1232 | " kaddrs: %p err: %d\n", | 1232 | " kaddrs: %p err: %d\n", |
| 1233 | asoc, kaddrs, err); | 1233 | asoc, kaddrs, err); |
| 1234 | if (asoc) | 1234 | if (asoc) { |
| 1235 | /* sctp_primitive_ASSOCIATE may have added this association | ||
| 1236 | * To the hash table, try to unhash it, just in case, its a noop | ||
| 1237 | * if it wasn't hashed so we're safe | ||
| 1238 | */ | ||
| 1239 | sctp_unhash_established(asoc); | ||
| 1235 | sctp_association_free(asoc); | 1240 | sctp_association_free(asoc); |
| 1241 | } | ||
| 1236 | return err; | 1242 | return err; |
| 1237 | } | 1243 | } |
| 1238 | 1244 | ||
| @@ -1942,8 +1948,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
| 1942 | goto out_unlock; | 1948 | goto out_unlock; |
| 1943 | 1949 | ||
| 1944 | out_free: | 1950 | out_free: |
| 1945 | if (new_asoc) | 1951 | if (new_asoc) { |
| 1952 | sctp_unhash_established(asoc); | ||
| 1946 | sctp_association_free(asoc); | 1953 | sctp_association_free(asoc); |
| 1954 | } | ||
| 1947 | out_unlock: | 1955 | out_unlock: |
| 1948 | sctp_release_sock(sk); | 1956 | sctp_release_sock(sk); |
| 1949 | 1957 | ||
