diff options
133 files changed, 883 insertions, 659 deletions
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index 66389c1c6f62..7c95f76398de 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi | |||
| @@ -104,6 +104,7 @@ | |||
| 104 | #gpio-cells = <2>; | 104 | #gpio-cells = <2>; |
| 105 | gpio-controller; | 105 | gpio-controller; |
| 106 | interrupt-controller; | 106 | interrupt-controller; |
| 107 | #interrupt-cells = <2>; | ||
| 107 | }; | 108 | }; |
| 108 | 109 | ||
| 109 | pioB: gpio@fffff600 { | 110 | pioB: gpio@fffff600 { |
| @@ -113,6 +114,7 @@ | |||
| 113 | #gpio-cells = <2>; | 114 | #gpio-cells = <2>; |
| 114 | gpio-controller; | 115 | gpio-controller; |
| 115 | interrupt-controller; | 116 | interrupt-controller; |
| 117 | #interrupt-cells = <2>; | ||
| 116 | }; | 118 | }; |
| 117 | 119 | ||
| 118 | pioC: gpio@fffff800 { | 120 | pioC: gpio@fffff800 { |
| @@ -122,6 +124,7 @@ | |||
| 122 | #gpio-cells = <2>; | 124 | #gpio-cells = <2>; |
| 123 | gpio-controller; | 125 | gpio-controller; |
| 124 | interrupt-controller; | 126 | interrupt-controller; |
| 127 | #interrupt-cells = <2>; | ||
| 125 | }; | 128 | }; |
| 126 | 129 | ||
| 127 | dbgu: serial@fffff200 { | 130 | dbgu: serial@fffff200 { |
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index b460d6ce9eb5..195019b7ca0e 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
| @@ -95,6 +95,7 @@ | |||
| 95 | #gpio-cells = <2>; | 95 | #gpio-cells = <2>; |
| 96 | gpio-controller; | 96 | gpio-controller; |
| 97 | interrupt-controller; | 97 | interrupt-controller; |
| 98 | #interrupt-cells = <2>; | ||
| 98 | }; | 99 | }; |
| 99 | 100 | ||
| 100 | pioB: gpio@fffff400 { | 101 | pioB: gpio@fffff400 { |
| @@ -104,6 +105,7 @@ | |||
| 104 | #gpio-cells = <2>; | 105 | #gpio-cells = <2>; |
| 105 | gpio-controller; | 106 | gpio-controller; |
| 106 | interrupt-controller; | 107 | interrupt-controller; |
| 108 | #interrupt-cells = <2>; | ||
| 107 | }; | 109 | }; |
| 108 | 110 | ||
| 109 | pioC: gpio@fffff600 { | 111 | pioC: gpio@fffff600 { |
| @@ -113,6 +115,7 @@ | |||
| 113 | #gpio-cells = <2>; | 115 | #gpio-cells = <2>; |
| 114 | gpio-controller; | 116 | gpio-controller; |
| 115 | interrupt-controller; | 117 | interrupt-controller; |
| 118 | #interrupt-cells = <2>; | ||
| 116 | }; | 119 | }; |
| 117 | 120 | ||
| 118 | pioD: gpio@fffff800 { | 121 | pioD: gpio@fffff800 { |
| @@ -122,6 +125,7 @@ | |||
| 122 | #gpio-cells = <2>; | 125 | #gpio-cells = <2>; |
| 123 | gpio-controller; | 126 | gpio-controller; |
| 124 | interrupt-controller; | 127 | interrupt-controller; |
| 128 | #interrupt-cells = <2>; | ||
| 125 | }; | 129 | }; |
| 126 | 130 | ||
| 127 | pioE: gpio@fffffa00 { | 131 | pioE: gpio@fffffa00 { |
| @@ -131,6 +135,7 @@ | |||
| 131 | #gpio-cells = <2>; | 135 | #gpio-cells = <2>; |
| 132 | gpio-controller; | 136 | gpio-controller; |
| 133 | interrupt-controller; | 137 | interrupt-controller; |
| 138 | #interrupt-cells = <2>; | ||
| 134 | }; | 139 | }; |
| 135 | 140 | ||
| 136 | dbgu: serial@ffffee00 { | 141 | dbgu: serial@ffffee00 { |
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi index bafa8806fc17..63751b1e744b 100644 --- a/arch/arm/boot/dts/at91sam9g45.dtsi +++ b/arch/arm/boot/dts/at91sam9g45.dtsi | |||
| @@ -113,6 +113,7 @@ | |||
| 113 | #gpio-cells = <2>; | 113 | #gpio-cells = <2>; |
| 114 | gpio-controller; | 114 | gpio-controller; |
| 115 | interrupt-controller; | 115 | interrupt-controller; |
| 116 | #interrupt-cells = <2>; | ||
| 116 | }; | 117 | }; |
| 117 | 118 | ||
| 118 | pioB: gpio@fffff400 { | 119 | pioB: gpio@fffff400 { |
| @@ -122,6 +123,7 @@ | |||
| 122 | #gpio-cells = <2>; | 123 | #gpio-cells = <2>; |
| 123 | gpio-controller; | 124 | gpio-controller; |
| 124 | interrupt-controller; | 125 | interrupt-controller; |
| 126 | #interrupt-cells = <2>; | ||
| 125 | }; | 127 | }; |
| 126 | 128 | ||
| 127 | pioC: gpio@fffff600 { | 129 | pioC: gpio@fffff600 { |
| @@ -131,6 +133,7 @@ | |||
| 131 | #gpio-cells = <2>; | 133 | #gpio-cells = <2>; |
| 132 | gpio-controller; | 134 | gpio-controller; |
| 133 | interrupt-controller; | 135 | interrupt-controller; |
| 136 | #interrupt-cells = <2>; | ||
| 134 | }; | 137 | }; |
| 135 | 138 | ||
| 136 | pioD: gpio@fffff800 { | 139 | pioD: gpio@fffff800 { |
| @@ -140,6 +143,7 @@ | |||
| 140 | #gpio-cells = <2>; | 143 | #gpio-cells = <2>; |
| 141 | gpio-controller; | 144 | gpio-controller; |
| 142 | interrupt-controller; | 145 | interrupt-controller; |
| 146 | #interrupt-cells = <2>; | ||
| 143 | }; | 147 | }; |
| 144 | 148 | ||
| 145 | pioE: gpio@fffffa00 { | 149 | pioE: gpio@fffffa00 { |
| @@ -149,6 +153,7 @@ | |||
| 149 | #gpio-cells = <2>; | 153 | #gpio-cells = <2>; |
| 150 | gpio-controller; | 154 | gpio-controller; |
| 151 | interrupt-controller; | 155 | interrupt-controller; |
| 156 | #interrupt-cells = <2>; | ||
| 152 | }; | 157 | }; |
| 153 | 158 | ||
| 154 | dbgu: serial@ffffee00 { | 159 | dbgu: serial@ffffee00 { |
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index bfac0dfc332c..ef9336ae9614 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi | |||
| @@ -107,6 +107,7 @@ | |||
| 107 | #gpio-cells = <2>; | 107 | #gpio-cells = <2>; |
| 108 | gpio-controller; | 108 | gpio-controller; |
| 109 | interrupt-controller; | 109 | interrupt-controller; |
| 110 | #interrupt-cells = <2>; | ||
| 110 | }; | 111 | }; |
| 111 | 112 | ||
| 112 | pioB: gpio@fffff600 { | 113 | pioB: gpio@fffff600 { |
| @@ -116,6 +117,7 @@ | |||
| 116 | #gpio-cells = <2>; | 117 | #gpio-cells = <2>; |
| 117 | gpio-controller; | 118 | gpio-controller; |
| 118 | interrupt-controller; | 119 | interrupt-controller; |
| 120 | #interrupt-cells = <2>; | ||
| 119 | }; | 121 | }; |
| 120 | 122 | ||
| 121 | pioC: gpio@fffff800 { | 123 | pioC: gpio@fffff800 { |
| @@ -125,6 +127,7 @@ | |||
| 125 | #gpio-cells = <2>; | 127 | #gpio-cells = <2>; |
| 126 | gpio-controller; | 128 | gpio-controller; |
| 127 | interrupt-controller; | 129 | interrupt-controller; |
| 130 | #interrupt-cells = <2>; | ||
| 128 | }; | 131 | }; |
| 129 | 132 | ||
| 130 | pioD: gpio@fffffa00 { | 133 | pioD: gpio@fffffa00 { |
| @@ -134,6 +137,7 @@ | |||
| 134 | #gpio-cells = <2>; | 137 | #gpio-cells = <2>; |
| 135 | gpio-controller; | 138 | gpio-controller; |
| 136 | interrupt-controller; | 139 | interrupt-controller; |
| 140 | #interrupt-cells = <2>; | ||
| 137 | }; | 141 | }; |
| 138 | 142 | ||
| 139 | dbgu: serial@fffff200 { | 143 | dbgu: serial@fffff200 { |
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index 4a18c393b136..8a387a8d61b7 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi | |||
| @@ -115,6 +115,7 @@ | |||
| 115 | #gpio-cells = <2>; | 115 | #gpio-cells = <2>; |
| 116 | gpio-controller; | 116 | gpio-controller; |
| 117 | interrupt-controller; | 117 | interrupt-controller; |
| 118 | #interrupt-cells = <2>; | ||
| 118 | }; | 119 | }; |
| 119 | 120 | ||
| 120 | pioB: gpio@fffff600 { | 121 | pioB: gpio@fffff600 { |
| @@ -124,6 +125,7 @@ | |||
| 124 | #gpio-cells = <2>; | 125 | #gpio-cells = <2>; |
| 125 | gpio-controller; | 126 | gpio-controller; |
| 126 | interrupt-controller; | 127 | interrupt-controller; |
| 128 | #interrupt-cells = <2>; | ||
| 127 | }; | 129 | }; |
| 128 | 130 | ||
| 129 | pioC: gpio@fffff800 { | 131 | pioC: gpio@fffff800 { |
| @@ -133,6 +135,7 @@ | |||
| 133 | #gpio-cells = <2>; | 135 | #gpio-cells = <2>; |
| 134 | gpio-controller; | 136 | gpio-controller; |
| 135 | interrupt-controller; | 137 | interrupt-controller; |
| 138 | #interrupt-cells = <2>; | ||
| 136 | }; | 139 | }; |
| 137 | 140 | ||
| 138 | pioD: gpio@fffffa00 { | 141 | pioD: gpio@fffffa00 { |
| @@ -142,6 +145,7 @@ | |||
| 142 | #gpio-cells = <2>; | 145 | #gpio-cells = <2>; |
| 143 | gpio-controller; | 146 | gpio-controller; |
| 144 | interrupt-controller; | 147 | interrupt-controller; |
| 148 | #interrupt-cells = <2>; | ||
| 145 | }; | 149 | }; |
| 146 | 150 | ||
| 147 | dbgu: serial@fffff200 { | 151 | dbgu: serial@fffff200 { |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index 4431a62fff5b..d20d4795f4ea 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
| @@ -241,6 +241,6 @@ int __init mx25_clocks_init(void) | |||
| 241 | clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); | 241 | clk_register_clkdev(clk[sdma_ahb], "ahb", "imx35-sdma"); |
| 242 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); | 242 | clk_register_clkdev(clk[iim_ipg], "iim", NULL); |
| 243 | 243 | ||
| 244 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); | 244 | mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1); |
| 245 | return 0; | 245 | return 0; |
| 246 | } | 246 | } |
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index 2c6ab3273f9e..5985ed1b8c98 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c | |||
| @@ -526,7 +526,8 @@ static void __init armadillo5x0_init(void) | |||
| 526 | imx31_add_mxc_nand(&armadillo5x0_nand_board_info); | 526 | imx31_add_mxc_nand(&armadillo5x0_nand_board_info); |
| 527 | 527 | ||
| 528 | /* set NAND page size to 2k if not configured via boot mode pins */ | 528 | /* set NAND page size to 2k if not configured via boot mode pins */ |
| 529 | __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); | 529 | __raw_writel(__raw_readl(mx3_ccm_base + MXC_CCM_RCSR) | |
| 530 | (1 << 30), mx3_ccm_base + MXC_CCM_RCSR); | ||
| 530 | 531 | ||
| 531 | /* RTC */ | 532 | /* RTC */ |
| 532 | /* Get RTC IRQ and register the chip */ | 533 | /* Get RTC IRQ and register the chip */ |
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index 53b7ea92c32c..3b8a0171c3cb 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
| @@ -346,11 +346,11 @@ static struct resource sh_mmcif_resources[] = { | |||
| 346 | .flags = IORESOURCE_MEM, | 346 | .flags = IORESOURCE_MEM, |
| 347 | }, | 347 | }, |
| 348 | [1] = { | 348 | [1] = { |
| 349 | .start = gic_spi(141), | 349 | .start = gic_spi(140), |
| 350 | .flags = IORESOURCE_IRQ, | 350 | .flags = IORESOURCE_IRQ, |
| 351 | }, | 351 | }, |
| 352 | [2] = { | 352 | [2] = { |
| 353 | .start = gic_spi(140), | 353 | .start = gic_spi(141), |
| 354 | .flags = IORESOURCE_IRQ, | 354 | .flags = IORESOURCE_IRQ, |
| 355 | }, | 355 | }, |
| 356 | }; | 356 | }; |
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h index 627d94f1b010..ec466400a200 100644 --- a/arch/arm/plat-mxc/include/mach/mx25.h +++ b/arch/arm/plat-mxc/include/mach/mx25.h | |||
| @@ -98,6 +98,7 @@ | |||
| 98 | #define MX25_INT_UART1 (NR_IRQS_LEGACY + 45) | 98 | #define MX25_INT_UART1 (NR_IRQS_LEGACY + 45) |
| 99 | #define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51) | 99 | #define MX25_INT_GPIO2 (NR_IRQS_LEGACY + 51) |
| 100 | #define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52) | 100 | #define MX25_INT_GPIO1 (NR_IRQS_LEGACY + 52) |
| 101 | #define MX25_INT_GPT1 (NR_IRQS_LEGACY + 54) | ||
| 101 | #define MX25_INT_FEC (NR_IRQS_LEGACY + 57) | 102 | #define MX25_INT_FEC (NR_IRQS_LEGACY + 57) |
| 102 | 103 | ||
| 103 | #define MX25_DMA_REQ_SSI2_RX1 22 | 104 | #define MX25_DMA_REQ_SSI2_RX1 22 |
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 65c5eca475e7..d1116e2dfbea 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
| @@ -144,6 +144,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate) | |||
| 144 | 144 | ||
| 145 | int clk_set_rate(struct clk *clk, unsigned long rate) | 145 | int clk_set_rate(struct clk *clk, unsigned long rate) |
| 146 | { | 146 | { |
| 147 | unsigned long flags; | ||
| 147 | int ret; | 148 | int ret; |
| 148 | 149 | ||
| 149 | if (IS_ERR(clk)) | 150 | if (IS_ERR(clk)) |
| @@ -159,9 +160,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
| 159 | if (clk->ops == NULL || clk->ops->set_rate == NULL) | 160 | if (clk->ops == NULL || clk->ops->set_rate == NULL) |
| 160 | return -EINVAL; | 161 | return -EINVAL; |
| 161 | 162 | ||
| 162 | spin_lock(&clocks_lock); | 163 | spin_lock_irqsave(&clocks_lock, flags); |
| 163 | ret = (clk->ops->set_rate)(clk, rate); | 164 | ret = (clk->ops->set_rate)(clk, rate); |
| 164 | spin_unlock(&clocks_lock); | 165 | spin_unlock_irqrestore(&clocks_lock, flags); |
| 165 | 166 | ||
| 166 | return ret; | 167 | return ret; |
| 167 | } | 168 | } |
| @@ -173,17 +174,18 @@ struct clk *clk_get_parent(struct clk *clk) | |||
| 173 | 174 | ||
| 174 | int clk_set_parent(struct clk *clk, struct clk *parent) | 175 | int clk_set_parent(struct clk *clk, struct clk *parent) |
| 175 | { | 176 | { |
| 177 | unsigned long flags; | ||
| 176 | int ret = 0; | 178 | int ret = 0; |
| 177 | 179 | ||
| 178 | if (IS_ERR(clk)) | 180 | if (IS_ERR(clk)) |
| 179 | return -EINVAL; | 181 | return -EINVAL; |
| 180 | 182 | ||
| 181 | spin_lock(&clocks_lock); | 183 | spin_lock_irqsave(&clocks_lock, flags); |
| 182 | 184 | ||
| 183 | if (clk->ops && clk->ops->set_parent) | 185 | if (clk->ops && clk->ops->set_parent) |
| 184 | ret = (clk->ops->set_parent)(clk, parent); | 186 | ret = (clk->ops->set_parent)(clk, parent); |
| 185 | 187 | ||
| 186 | spin_unlock(&clocks_lock); | 188 | spin_unlock_irqrestore(&clocks_lock, flags); |
| 187 | 189 | ||
| 188 | return ret; | 190 | return ret; |
| 189 | } | 191 | } |
diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h index 799ed0f1643d..2d6e6e380564 100644 --- a/arch/s390/include/asm/hugetlb.h +++ b/arch/s390/include/asm/hugetlb.h | |||
| @@ -66,16 +66,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep) | |||
| 66 | return pte; | 66 | return pte; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | ||
| 70 | unsigned long addr, pte_t *ptep) | ||
| 71 | { | ||
| 72 | pte_t pte = huge_ptep_get(ptep); | ||
| 73 | |||
| 74 | mm->context.flush_mm = 1; | ||
| 75 | pmd_clear((pmd_t *) ptep); | ||
| 76 | return pte; | ||
| 77 | } | ||
| 78 | |||
| 79 | static inline void __pmd_csp(pmd_t *pmdp) | 69 | static inline void __pmd_csp(pmd_t *pmdp) |
| 80 | { | 70 | { |
| 81 | register unsigned long reg2 asm("2") = pmd_val(*pmdp); | 71 | register unsigned long reg2 asm("2") = pmd_val(*pmdp); |
| @@ -117,6 +107,15 @@ static inline void huge_ptep_invalidate(struct mm_struct *mm, | |||
| 117 | __pmd_csp(pmdp); | 107 | __pmd_csp(pmdp); |
| 118 | } | 108 | } |
| 119 | 109 | ||
| 110 | static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | ||
| 111 | unsigned long addr, pte_t *ptep) | ||
| 112 | { | ||
| 113 | pte_t pte = huge_ptep_get(ptep); | ||
| 114 | |||
| 115 | huge_ptep_invalidate(mm, addr, ptep); | ||
| 116 | return pte; | ||
| 117 | } | ||
| 118 | |||
| 120 | #define huge_ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ | 119 | #define huge_ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ |
| 121 | ({ \ | 120 | ({ \ |
| 122 | int __changed = !pte_same(huge_ptep_get(__ptep), __entry); \ | 121 | int __changed = !pte_same(huge_ptep_get(__ptep), __entry); \ |
| @@ -131,10 +130,7 @@ static inline void huge_ptep_invalidate(struct mm_struct *mm, | |||
| 131 | ({ \ | 130 | ({ \ |
| 132 | pte_t __pte = huge_ptep_get(__ptep); \ | 131 | pte_t __pte = huge_ptep_get(__ptep); \ |
| 133 | if (pte_write(__pte)) { \ | 132 | if (pte_write(__pte)) { \ |
| 134 | (__mm)->context.flush_mm = 1; \ | 133 | huge_ptep_invalidate(__mm, __addr, __ptep); \ |
| 135 | if (atomic_read(&(__mm)->context.attach_count) > 1 || \ | ||
| 136 | (__mm) != current->active_mm) \ | ||
| 137 | huge_ptep_invalidate(__mm, __addr, __ptep); \ | ||
| 138 | set_huge_pte_at(__mm, __addr, __ptep, \ | 134 | set_huge_pte_at(__mm, __addr, __ptep, \ |
| 139 | huge_pte_wrprotect(__pte)); \ | 135 | huge_pte_wrprotect(__pte)); \ |
| 140 | } \ | 136 | } \ |
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h index 9fde315f3a7c..1d8fe2b17ef6 100644 --- a/arch/s390/include/asm/tlbflush.h +++ b/arch/s390/include/asm/tlbflush.h | |||
| @@ -90,12 +90,10 @@ static inline void __tlb_flush_mm(struct mm_struct * mm) | |||
| 90 | 90 | ||
| 91 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) | 91 | static inline void __tlb_flush_mm_cond(struct mm_struct * mm) |
| 92 | { | 92 | { |
| 93 | spin_lock(&mm->page_table_lock); | ||
| 94 | if (mm->context.flush_mm) { | 93 | if (mm->context.flush_mm) { |
| 95 | __tlb_flush_mm(mm); | 94 | __tlb_flush_mm(mm); |
| 96 | mm->context.flush_mm = 0; | 95 | mm->context.flush_mm = 0; |
| 97 | } | 96 | } |
| 98 | spin_unlock(&mm->page_table_lock); | ||
| 99 | } | 97 | } |
| 100 | 98 | ||
| 101 | /* | 99 | /* |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index f86c81e13c37..40b57693de38 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -974,11 +974,13 @@ static void __init setup_hwcaps(void) | |||
| 974 | if (MACHINE_HAS_HPAGE) | 974 | if (MACHINE_HAS_HPAGE) |
| 975 | elf_hwcap |= HWCAP_S390_HPAGE; | 975 | elf_hwcap |= HWCAP_S390_HPAGE; |
| 976 | 976 | ||
| 977 | #if defined(CONFIG_64BIT) | ||
| 977 | /* | 978 | /* |
| 978 | * 64-bit register support for 31-bit processes | 979 | * 64-bit register support for 31-bit processes |
| 979 | * HWCAP_S390_HIGH_GPRS is bit 9. | 980 | * HWCAP_S390_HIGH_GPRS is bit 9. |
| 980 | */ | 981 | */ |
| 981 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; | 982 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; |
| 983 | #endif | ||
| 982 | 984 | ||
| 983 | get_cpu_id(&cpu_id); | 985 | get_cpu_id(&cpu_id); |
| 984 | switch (cpu_id.machine) { | 986 | switch (cpu_id.machine) { |
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 60ee2b883797..2d37bb861faf 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
| @@ -2,69 +2,82 @@ | |||
| 2 | * User access functions based on page table walks for enhanced | 2 | * User access functions based on page table walks for enhanced |
| 3 | * system layout without hardware support. | 3 | * system layout without hardware support. |
| 4 | * | 4 | * |
| 5 | * Copyright IBM Corp. 2006 | 5 | * Copyright IBM Corp. 2006, 2012 |
| 6 | * Author(s): Gerald Schaefer (gerald.schaefer@de.ibm.com) | 6 | * Author(s): Gerald Schaefer (gerald.schaefer@de.ibm.com) |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
| 10 | #include <linux/hardirq.h> | 10 | #include <linux/hardirq.h> |
| 11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
| 12 | #include <linux/hugetlb.h> | ||
| 12 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
| 13 | #include <asm/futex.h> | 14 | #include <asm/futex.h> |
| 14 | #include "uaccess.h" | 15 | #include "uaccess.h" |
| 15 | 16 | ||
| 16 | static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr) | 17 | |
| 18 | /* | ||
| 19 | * Returns kernel address for user virtual address. If the returned address is | ||
| 20 | * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occured and the address | ||
| 21 | * contains the (negative) exception code. | ||
| 22 | */ | ||
| 23 | static __always_inline unsigned long follow_table(struct mm_struct *mm, | ||
| 24 | unsigned long addr, int write) | ||
| 17 | { | 25 | { |
| 18 | pgd_t *pgd; | 26 | pgd_t *pgd; |
| 19 | pud_t *pud; | 27 | pud_t *pud; |
| 20 | pmd_t *pmd; | 28 | pmd_t *pmd; |
| 29 | pte_t *ptep; | ||
| 21 | 30 | ||
| 22 | pgd = pgd_offset(mm, addr); | 31 | pgd = pgd_offset(mm, addr); |
| 23 | if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) | 32 | if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd))) |
| 24 | return (pte_t *) 0x3a; | 33 | return -0x3aUL; |
| 25 | 34 | ||
| 26 | pud = pud_offset(pgd, addr); | 35 | pud = pud_offset(pgd, addr); |
| 27 | if (pud_none(*pud) || unlikely(pud_bad(*pud))) | 36 | if (pud_none(*pud) || unlikely(pud_bad(*pud))) |
| 28 | return (pte_t *) 0x3b; | 37 | return -0x3bUL; |
| 29 | 38 | ||
| 30 | pmd = pmd_offset(pud, addr); | 39 | pmd = pmd_offset(pud, addr); |
| 31 | if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd))) | 40 | if (pmd_none(*pmd)) |
| 32 | return (pte_t *) 0x10; | 41 | return -0x10UL; |
| 42 | if (pmd_huge(*pmd)) { | ||
| 43 | if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO)) | ||
| 44 | return -0x04UL; | ||
| 45 | return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK); | ||
| 46 | } | ||
| 47 | if (unlikely(pmd_bad(*pmd))) | ||
| 48 | return -0x10UL; | ||
| 49 | |||
| 50 | ptep = pte_offset_map(pmd, addr); | ||
| 51 | if (!pte_present(*ptep)) | ||
| 52 | return -0x11UL; | ||
| 53 | if (write && !pte_write(*ptep)) | ||
| 54 | return -0x04UL; | ||
| 33 | 55 | ||
| 34 | return pte_offset_map(pmd, addr); | 56 | return (pte_val(*ptep) & PAGE_MASK) + (addr & ~PAGE_MASK); |
| 35 | } | 57 | } |
| 36 | 58 | ||
| 37 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, | 59 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, |
| 38 | size_t n, int write_user) | 60 | size_t n, int write_user) |
| 39 | { | 61 | { |
| 40 | struct mm_struct *mm = current->mm; | 62 | struct mm_struct *mm = current->mm; |
| 41 | unsigned long offset, pfn, done, size; | 63 | unsigned long offset, done, size, kaddr; |
| 42 | pte_t *pte; | ||
| 43 | void *from, *to; | 64 | void *from, *to; |
| 44 | 65 | ||
| 45 | done = 0; | 66 | done = 0; |
| 46 | retry: | 67 | retry: |
| 47 | spin_lock(&mm->page_table_lock); | 68 | spin_lock(&mm->page_table_lock); |
| 48 | do { | 69 | do { |
| 49 | pte = follow_table(mm, uaddr); | 70 | kaddr = follow_table(mm, uaddr, write_user); |
| 50 | if ((unsigned long) pte < 0x1000) | 71 | if (IS_ERR_VALUE(kaddr)) |
| 51 | goto fault; | 72 | goto fault; |
| 52 | if (!pte_present(*pte)) { | ||
| 53 | pte = (pte_t *) 0x11; | ||
| 54 | goto fault; | ||
| 55 | } else if (write_user && !pte_write(*pte)) { | ||
| 56 | pte = (pte_t *) 0x04; | ||
| 57 | goto fault; | ||
| 58 | } | ||
| 59 | 73 | ||
| 60 | pfn = pte_pfn(*pte); | 74 | offset = uaddr & ~PAGE_MASK; |
| 61 | offset = uaddr & (PAGE_SIZE - 1); | ||
| 62 | size = min(n - done, PAGE_SIZE - offset); | 75 | size = min(n - done, PAGE_SIZE - offset); |
| 63 | if (write_user) { | 76 | if (write_user) { |
| 64 | to = (void *)((pfn << PAGE_SHIFT) + offset); | 77 | to = (void *) kaddr; |
| 65 | from = kptr + done; | 78 | from = kptr + done; |
| 66 | } else { | 79 | } else { |
| 67 | from = (void *)((pfn << PAGE_SHIFT) + offset); | 80 | from = (void *) kaddr; |
| 68 | to = kptr + done; | 81 | to = kptr + done; |
| 69 | } | 82 | } |
| 70 | memcpy(to, from, size); | 83 | memcpy(to, from, size); |
| @@ -75,7 +88,7 @@ retry: | |||
| 75 | return n - done; | 88 | return n - done; |
| 76 | fault: | 89 | fault: |
| 77 | spin_unlock(&mm->page_table_lock); | 90 | spin_unlock(&mm->page_table_lock); |
| 78 | if (__handle_fault(uaddr, (unsigned long) pte, write_user)) | 91 | if (__handle_fault(uaddr, -kaddr, write_user)) |
| 79 | return n - done; | 92 | return n - done; |
| 80 | goto retry; | 93 | goto retry; |
| 81 | } | 94 | } |
| @@ -84,27 +97,22 @@ fault: | |||
| 84 | * Do DAT for user address by page table walk, return kernel address. | 97 | * Do DAT for user address by page table walk, return kernel address. |
| 85 | * This function needs to be called with current->mm->page_table_lock held. | 98 | * This function needs to be called with current->mm->page_table_lock held. |
| 86 | */ | 99 | */ |
| 87 | static __always_inline unsigned long __dat_user_addr(unsigned long uaddr) | 100 | static __always_inline unsigned long __dat_user_addr(unsigned long uaddr, |
| 101 | int write) | ||
| 88 | { | 102 | { |
| 89 | struct mm_struct *mm = current->mm; | 103 | struct mm_struct *mm = current->mm; |
| 90 | unsigned long pfn; | 104 | unsigned long kaddr; |
| 91 | pte_t *pte; | ||
| 92 | int rc; | 105 | int rc; |
| 93 | 106 | ||
| 94 | retry: | 107 | retry: |
| 95 | pte = follow_table(mm, uaddr); | 108 | kaddr = follow_table(mm, uaddr, write); |
| 96 | if ((unsigned long) pte < 0x1000) | 109 | if (IS_ERR_VALUE(kaddr)) |
| 97 | goto fault; | ||
| 98 | if (!pte_present(*pte)) { | ||
| 99 | pte = (pte_t *) 0x11; | ||
| 100 | goto fault; | 110 | goto fault; |
| 101 | } | ||
| 102 | 111 | ||
| 103 | pfn = pte_pfn(*pte); | 112 | return kaddr; |
| 104 | return (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1)); | ||
| 105 | fault: | 113 | fault: |
| 106 | spin_unlock(&mm->page_table_lock); | 114 | spin_unlock(&mm->page_table_lock); |
| 107 | rc = __handle_fault(uaddr, (unsigned long) pte, 0); | 115 | rc = __handle_fault(uaddr, -kaddr, write); |
| 108 | spin_lock(&mm->page_table_lock); | 116 | spin_lock(&mm->page_table_lock); |
| 109 | if (!rc) | 117 | if (!rc) |
| 110 | goto retry; | 118 | goto retry; |
| @@ -159,11 +167,9 @@ static size_t clear_user_pt(size_t n, void __user *to) | |||
| 159 | 167 | ||
| 160 | static size_t strnlen_user_pt(size_t count, const char __user *src) | 168 | static size_t strnlen_user_pt(size_t count, const char __user *src) |
| 161 | { | 169 | { |
| 162 | char *addr; | ||
| 163 | unsigned long uaddr = (unsigned long) src; | 170 | unsigned long uaddr = (unsigned long) src; |
| 164 | struct mm_struct *mm = current->mm; | 171 | struct mm_struct *mm = current->mm; |
| 165 | unsigned long offset, pfn, done, len; | 172 | unsigned long offset, done, len, kaddr; |
| 166 | pte_t *pte; | ||
| 167 | size_t len_str; | 173 | size_t len_str; |
| 168 | 174 | ||
| 169 | if (segment_eq(get_fs(), KERNEL_DS)) | 175 | if (segment_eq(get_fs(), KERNEL_DS)) |
| @@ -172,19 +178,13 @@ static size_t strnlen_user_pt(size_t count, const char __user *src) | |||
| 172 | retry: | 178 | retry: |
| 173 | spin_lock(&mm->page_table_lock); | 179 | spin_lock(&mm->page_table_lock); |
| 174 | do { | 180 | do { |
| 175 | pte = follow_table(mm, uaddr); | 181 | kaddr = follow_table(mm, uaddr, 0); |
| 176 | if ((unsigned long) pte < 0x1000) | 182 | if (IS_ERR_VALUE(kaddr)) |
| 177 | goto fault; | ||
| 178 | if (!pte_present(*pte)) { | ||
| 179 | pte = (pte_t *) 0x11; | ||
| 180 | goto fault; | 183 | goto fault; |
| 181 | } | ||
| 182 | 184 | ||
| 183 | pfn = pte_pfn(*pte); | 185 | offset = uaddr & ~PAGE_MASK; |
| 184 | offset = uaddr & (PAGE_SIZE-1); | ||
| 185 | addr = (char *)(pfn << PAGE_SHIFT) + offset; | ||
| 186 | len = min(count - done, PAGE_SIZE - offset); | 186 | len = min(count - done, PAGE_SIZE - offset); |
| 187 | len_str = strnlen(addr, len); | 187 | len_str = strnlen((char *) kaddr, len); |
| 188 | done += len_str; | 188 | done += len_str; |
| 189 | uaddr += len_str; | 189 | uaddr += len_str; |
| 190 | } while ((len_str == len) && (done < count)); | 190 | } while ((len_str == len) && (done < count)); |
| @@ -192,7 +192,7 @@ retry: | |||
| 192 | return done + 1; | 192 | return done + 1; |
| 193 | fault: | 193 | fault: |
| 194 | spin_unlock(&mm->page_table_lock); | 194 | spin_unlock(&mm->page_table_lock); |
| 195 | if (__handle_fault(uaddr, (unsigned long) pte, 0)) | 195 | if (__handle_fault(uaddr, -kaddr, 0)) |
| 196 | return 0; | 196 | return 0; |
| 197 | goto retry; | 197 | goto retry; |
| 198 | } | 198 | } |
| @@ -225,11 +225,10 @@ static size_t copy_in_user_pt(size_t n, void __user *to, | |||
| 225 | const void __user *from) | 225 | const void __user *from) |
| 226 | { | 226 | { |
| 227 | struct mm_struct *mm = current->mm; | 227 | struct mm_struct *mm = current->mm; |
| 228 | unsigned long offset_from, offset_to, offset_max, pfn_from, pfn_to, | 228 | unsigned long offset_max, uaddr, done, size, error_code; |
| 229 | uaddr, done, size, error_code; | ||
| 230 | unsigned long uaddr_from = (unsigned long) from; | 229 | unsigned long uaddr_from = (unsigned long) from; |
| 231 | unsigned long uaddr_to = (unsigned long) to; | 230 | unsigned long uaddr_to = (unsigned long) to; |
| 232 | pte_t *pte_from, *pte_to; | 231 | unsigned long kaddr_to, kaddr_from; |
| 233 | int write_user; | 232 | int write_user; |
| 234 | 233 | ||
| 235 | if (segment_eq(get_fs(), KERNEL_DS)) { | 234 | if (segment_eq(get_fs(), KERNEL_DS)) { |
| @@ -242,38 +241,23 @@ retry: | |||
| 242 | do { | 241 | do { |
| 243 | write_user = 0; | 242 | write_user = 0; |
| 244 | uaddr = uaddr_from; | 243 | uaddr = uaddr_from; |
| 245 | pte_from = follow_table(mm, uaddr_from); | 244 | kaddr_from = follow_table(mm, uaddr_from, 0); |
| 246 | error_code = (unsigned long) pte_from; | 245 | error_code = kaddr_from; |
| 247 | if (error_code < 0x1000) | 246 | if (IS_ERR_VALUE(error_code)) |
| 248 | goto fault; | ||
| 249 | if (!pte_present(*pte_from)) { | ||
| 250 | error_code = 0x11; | ||
| 251 | goto fault; | 247 | goto fault; |
| 252 | } | ||
| 253 | 248 | ||
| 254 | write_user = 1; | 249 | write_user = 1; |
| 255 | uaddr = uaddr_to; | 250 | uaddr = uaddr_to; |
| 256 | pte_to = follow_table(mm, uaddr_to); | 251 | kaddr_to = follow_table(mm, uaddr_to, 1); |
| 257 | error_code = (unsigned long) pte_to; | 252 | error_code = (unsigned long) kaddr_to; |
| 258 | if (error_code < 0x1000) | 253 | if (IS_ERR_VALUE(error_code)) |
| 259 | goto fault; | ||
| 260 | if (!pte_present(*pte_to)) { | ||
| 261 | error_code = 0x11; | ||
| 262 | goto fault; | 254 | goto fault; |
| 263 | } else if (!pte_write(*pte_to)) { | ||
| 264 | error_code = 0x04; | ||
| 265 | goto fault; | ||
| 266 | } | ||
| 267 | 255 | ||
| 268 | pfn_from = pte_pfn(*pte_from); | 256 | offset_max = max(uaddr_from & ~PAGE_MASK, |
| 269 | pfn_to = pte_pfn(*pte_to); | 257 | uaddr_to & ~PAGE_MASK); |
| 270 | offset_from = uaddr_from & (PAGE_SIZE-1); | ||
| 271 | offset_to = uaddr_from & (PAGE_SIZE-1); | ||
| 272 | offset_max = max(offset_from, offset_to); | ||
| 273 | size = min(n - done, PAGE_SIZE - offset_max); | 258 | size = min(n - done, PAGE_SIZE - offset_max); |
| 274 | 259 | ||
| 275 | memcpy((void *)(pfn_to << PAGE_SHIFT) + offset_to, | 260 | memcpy((void *) kaddr_to, (void *) kaddr_from, size); |
| 276 | (void *)(pfn_from << PAGE_SHIFT) + offset_from, size); | ||
| 277 | done += size; | 261 | done += size; |
| 278 | uaddr_from += size; | 262 | uaddr_from += size; |
| 279 | uaddr_to += size; | 263 | uaddr_to += size; |
| @@ -282,7 +266,7 @@ retry: | |||
| 282 | return n - done; | 266 | return n - done; |
| 283 | fault: | 267 | fault: |
| 284 | spin_unlock(&mm->page_table_lock); | 268 | spin_unlock(&mm->page_table_lock); |
| 285 | if (__handle_fault(uaddr, error_code, write_user)) | 269 | if (__handle_fault(uaddr, -error_code, write_user)) |
| 286 | return n - done; | 270 | return n - done; |
| 287 | goto retry; | 271 | goto retry; |
| 288 | } | 272 | } |
| @@ -341,7 +325,7 @@ int futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old) | |||
| 341 | return __futex_atomic_op_pt(op, uaddr, oparg, old); | 325 | return __futex_atomic_op_pt(op, uaddr, oparg, old); |
| 342 | spin_lock(¤t->mm->page_table_lock); | 326 | spin_lock(¤t->mm->page_table_lock); |
| 343 | uaddr = (u32 __force __user *) | 327 | uaddr = (u32 __force __user *) |
| 344 | __dat_user_addr((__force unsigned long) uaddr); | 328 | __dat_user_addr((__force unsigned long) uaddr, 1); |
| 345 | if (!uaddr) { | 329 | if (!uaddr) { |
| 346 | spin_unlock(¤t->mm->page_table_lock); | 330 | spin_unlock(¤t->mm->page_table_lock); |
| 347 | return -EFAULT; | 331 | return -EFAULT; |
| @@ -378,7 +362,7 @@ int futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr, | |||
| 378 | return __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval); | 362 | return __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval); |
| 379 | spin_lock(¤t->mm->page_table_lock); | 363 | spin_lock(¤t->mm->page_table_lock); |
| 380 | uaddr = (u32 __force __user *) | 364 | uaddr = (u32 __force __user *) |
| 381 | __dat_user_addr((__force unsigned long) uaddr); | 365 | __dat_user_addr((__force unsigned long) uaddr, 1); |
| 382 | if (!uaddr) { | 366 | if (!uaddr) { |
| 383 | spin_unlock(¤t->mm->page_table_lock); | 367 | spin_unlock(¤t->mm->page_table_lock); |
| 384 | return -EFAULT; | 368 | return -EFAULT; |
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S index b7cf6a547f11..7e605b95592a 100644 --- a/arch/sh/kernel/cpu/sh5/entry.S +++ b/arch/sh/kernel/cpu/sh5/entry.S | |||
| @@ -933,7 +933,7 @@ ret_with_reschedule: | |||
| 933 | 933 | ||
| 934 | pta restore_all, tr1 | 934 | pta restore_all, tr1 |
| 935 | 935 | ||
| 936 | movi _TIF_SIGPENDING, r8 | 936 | movi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), r8 |
| 937 | and r8, r7, r8 | 937 | and r8, r7, r8 |
| 938 | pta work_notifysig, tr0 | 938 | pta work_notifysig, tr0 |
| 939 | bne r8, ZERO, tr0 | 939 | bne r8, ZERO, tr0 |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index f67601cb3f1f..b96489d8b27d 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
| @@ -139,7 +139,7 @@ work_pending: | |||
| 139 | ! r8: current_thread_info | 139 | ! r8: current_thread_info |
| 140 | ! t: result of "tst #_TIF_NEED_RESCHED, r0" | 140 | ! t: result of "tst #_TIF_NEED_RESCHED, r0" |
| 141 | bf/s work_resched | 141 | bf/s work_resched |
| 142 | tst #_TIF_SIGPENDING, r0 | 142 | tst #(_TIF_SIGPENDING | _TIF_NOTIFY_RESUME), r0 |
| 143 | work_notifysig: | 143 | work_notifysig: |
| 144 | bt/s __restore_all | 144 | bt/s __restore_all |
| 145 | mov r15, r4 | 145 | mov r15, r4 |
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index 15e0a1693976..f1ddc0d23679 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
| @@ -48,9 +48,7 @@ void *module_alloc(unsigned long size) | |||
| 48 | return NULL; | 48 | return NULL; |
| 49 | 49 | ||
| 50 | ret = module_map(size); | 50 | ret = module_map(size); |
| 51 | if (!ret) | 51 | if (ret) |
| 52 | ret = ERR_PTR(-ENOMEM); | ||
| 53 | else | ||
| 54 | memset(ret, 0, size); | 52 | memset(ret, 0, size); |
| 55 | 53 | ||
| 56 | return ret; | 54 | return ret; |
| @@ -116,6 +114,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
| 116 | v = sym->st_value + rel[i].r_addend; | 114 | v = sym->st_value + rel[i].r_addend; |
| 117 | 115 | ||
| 118 | switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { | 116 | switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { |
| 117 | case R_SPARC_DISP32: | ||
| 118 | v -= (Elf_Addr) location; | ||
| 119 | *loc32 = v; | ||
| 120 | break; | ||
| 119 | #ifdef CONFIG_SPARC64 | 121 | #ifdef CONFIG_SPARC64 |
| 120 | case R_SPARC_64: | 122 | case R_SPARC_64: |
| 121 | location[0] = v >> 56; | 123 | location[0] = v >> 56; |
| @@ -128,11 +130,6 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
| 128 | location[7] = v >> 0; | 130 | location[7] = v >> 0; |
| 129 | break; | 131 | break; |
| 130 | 132 | ||
| 131 | case R_SPARC_DISP32: | ||
| 132 | v -= (Elf_Addr) location; | ||
| 133 | *loc32 = v; | ||
| 134 | break; | ||
| 135 | |||
| 136 | case R_SPARC_WDISP19: | 133 | case R_SPARC_WDISP19: |
| 137 | v -= (Elf_Addr) location; | 134 | v -= (Elf_Addr) location; |
| 138 | *loc32 = (*loc32 & ~0x7ffff) | | 135 | *loc32 = (*loc32 & ~0x7ffff) | |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8ec3a1aa4abd..50a1d1f9b6d3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -746,10 +746,10 @@ config SWIOTLB | |||
| 746 | def_bool y if X86_64 | 746 | def_bool y if X86_64 |
| 747 | ---help--- | 747 | ---help--- |
| 748 | Support for software bounce buffers used on x86-64 systems | 748 | Support for software bounce buffers used on x86-64 systems |
| 749 | which don't have a hardware IOMMU (e.g. the current generation | 749 | which don't have a hardware IOMMU. Using this PCI devices |
| 750 | of Intel's x86-64 CPUs). Using this PCI devices which can only | 750 | which can only access 32-bits of memory can be used on systems |
| 751 | access 32-bits of memory can be used on systems with more than | 751 | with more than 3 GB of memory. |
| 752 | 3 GB of memory. If unsure, say Y. | 752 | If unsure, say Y. |
| 753 | 753 | ||
| 754 | config IOMMU_HELPER | 754 | config IOMMU_HELPER |
| 755 | def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU) | 755 | def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU) |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 93971e841dd5..472b9b783019 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
| @@ -51,7 +51,8 @@ extern unsigned long set_phys_range_identity(unsigned long pfn_s, | |||
| 51 | 51 | ||
| 52 | extern int m2p_add_override(unsigned long mfn, struct page *page, | 52 | extern int m2p_add_override(unsigned long mfn, struct page *page, |
| 53 | struct gnttab_map_grant_ref *kmap_op); | 53 | struct gnttab_map_grant_ref *kmap_op); |
| 54 | extern int m2p_remove_override(struct page *page, bool clear_pte); | 54 | extern int m2p_remove_override(struct page *page, |
| 55 | struct gnttab_map_grant_ref *kmap_op); | ||
| 55 | extern struct page *m2p_find_override(unsigned long mfn); | 56 | extern struct page *m2p_find_override(unsigned long mfn); |
| 56 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); | 57 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); |
| 57 | 58 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index 6605a81ba339..8b6defe7eefc 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
| @@ -586,6 +586,8 @@ extern struct event_constraint intel_westmere_pebs_event_constraints[]; | |||
| 586 | 586 | ||
| 587 | extern struct event_constraint intel_snb_pebs_event_constraints[]; | 587 | extern struct event_constraint intel_snb_pebs_event_constraints[]; |
| 588 | 588 | ||
| 589 | extern struct event_constraint intel_ivb_pebs_event_constraints[]; | ||
| 590 | |||
| 589 | struct event_constraint *intel_pebs_constraints(struct perf_event *event); | 591 | struct event_constraint *intel_pebs_constraints(struct perf_event *event); |
| 590 | 592 | ||
| 591 | void intel_pmu_pebs_enable(struct perf_event *event); | 593 | void intel_pmu_pebs_enable(struct perf_event *event); |
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c index 7bfb5bec8630..eebd5ffe1bba 100644 --- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c +++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c | |||
| @@ -209,6 +209,15 @@ static int perf_ibs_precise_event(struct perf_event *event, u64 *config) | |||
| 209 | return -EOPNOTSUPP; | 209 | return -EOPNOTSUPP; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | static const struct perf_event_attr ibs_notsupp = { | ||
| 213 | .exclude_user = 1, | ||
| 214 | .exclude_kernel = 1, | ||
| 215 | .exclude_hv = 1, | ||
| 216 | .exclude_idle = 1, | ||
| 217 | .exclude_host = 1, | ||
| 218 | .exclude_guest = 1, | ||
| 219 | }; | ||
| 220 | |||
| 212 | static int perf_ibs_init(struct perf_event *event) | 221 | static int perf_ibs_init(struct perf_event *event) |
| 213 | { | 222 | { |
| 214 | struct hw_perf_event *hwc = &event->hw; | 223 | struct hw_perf_event *hwc = &event->hw; |
| @@ -229,6 +238,9 @@ static int perf_ibs_init(struct perf_event *event) | |||
| 229 | if (event->pmu != &perf_ibs->pmu) | 238 | if (event->pmu != &perf_ibs->pmu) |
| 230 | return -ENOENT; | 239 | return -ENOENT; |
| 231 | 240 | ||
| 241 | if (perf_flags(&event->attr) & perf_flags(&ibs_notsupp)) | ||
| 242 | return -EINVAL; | ||
| 243 | |||
| 232 | if (config & ~perf_ibs->config_mask) | 244 | if (config & ~perf_ibs->config_mask) |
| 233 | return -EINVAL; | 245 | return -EINVAL; |
| 234 | 246 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 0d3d63afa76a..6bca492b8547 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
| @@ -2048,7 +2048,6 @@ __init int intel_pmu_init(void) | |||
| 2048 | case 42: /* SandyBridge */ | 2048 | case 42: /* SandyBridge */ |
| 2049 | case 45: /* SandyBridge, "Romely-EP" */ | 2049 | case 45: /* SandyBridge, "Romely-EP" */ |
| 2050 | x86_add_quirk(intel_sandybridge_quirk); | 2050 | x86_add_quirk(intel_sandybridge_quirk); |
| 2051 | case 58: /* IvyBridge */ | ||
| 2052 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | 2051 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, |
| 2053 | sizeof(hw_cache_event_ids)); | 2052 | sizeof(hw_cache_event_ids)); |
| 2054 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, | 2053 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, |
| @@ -2073,6 +2072,29 @@ __init int intel_pmu_init(void) | |||
| 2073 | 2072 | ||
| 2074 | pr_cont("SandyBridge events, "); | 2073 | pr_cont("SandyBridge events, "); |
| 2075 | break; | 2074 | break; |
| 2075 | case 58: /* IvyBridge */ | ||
| 2076 | memcpy(hw_cache_event_ids, snb_hw_cache_event_ids, | ||
| 2077 | sizeof(hw_cache_event_ids)); | ||
| 2078 | memcpy(hw_cache_extra_regs, snb_hw_cache_extra_regs, | ||
| 2079 | sizeof(hw_cache_extra_regs)); | ||
| 2080 | |||
| 2081 | intel_pmu_lbr_init_snb(); | ||
| 2082 | |||
| 2083 | x86_pmu.event_constraints = intel_snb_event_constraints; | ||
| 2084 | x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; | ||
| 2085 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; | ||
| 2086 | x86_pmu.extra_regs = intel_snb_extra_regs; | ||
| 2087 | /* all extra regs are per-cpu when HT is on */ | ||
| 2088 | x86_pmu.er_flags |= ERF_HAS_RSP_1; | ||
| 2089 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; | ||
| 2090 | |||
| 2091 | /* UOPS_ISSUED.ANY,c=1,i=1 to count stall cycles */ | ||
| 2092 | intel_perfmon_event_map[PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = | ||
| 2093 | X86_CONFIG(.event=0x0e, .umask=0x01, .inv=1, .cmask=1); | ||
| 2094 | |||
| 2095 | pr_cont("IvyBridge events, "); | ||
| 2096 | break; | ||
| 2097 | |||
| 2076 | 2098 | ||
| 2077 | default: | 2099 | default: |
| 2078 | switch (x86_pmu.version) { | 2100 | switch (x86_pmu.version) { |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c index e38d97bf4259..826054a4f2ee 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c | |||
| @@ -407,6 +407,20 @@ struct event_constraint intel_snb_pebs_event_constraints[] = { | |||
| 407 | EVENT_CONSTRAINT_END | 407 | EVENT_CONSTRAINT_END |
| 408 | }; | 408 | }; |
| 409 | 409 | ||
| 410 | struct event_constraint intel_ivb_pebs_event_constraints[] = { | ||
| 411 | INTEL_UEVENT_CONSTRAINT(0x01c0, 0x2), /* INST_RETIRED.PRECDIST */ | ||
| 412 | INTEL_UEVENT_CONSTRAINT(0x01c2, 0xf), /* UOPS_RETIRED.ALL */ | ||
| 413 | INTEL_UEVENT_CONSTRAINT(0x02c2, 0xf), /* UOPS_RETIRED.RETIRE_SLOTS */ | ||
| 414 | INTEL_EVENT_CONSTRAINT(0xc4, 0xf), /* BR_INST_RETIRED.* */ | ||
| 415 | INTEL_EVENT_CONSTRAINT(0xc5, 0xf), /* BR_MISP_RETIRED.* */ | ||
| 416 | INTEL_EVENT_CONSTRAINT(0xcd, 0x8), /* MEM_TRANS_RETIRED.* */ | ||
| 417 | INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_UOP_RETIRED.* */ | ||
| 418 | INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */ | ||
| 419 | INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */ | ||
| 420 | INTEL_EVENT_CONSTRAINT(0xd3, 0xf), /* MEM_LOAD_UOPS_LLC_MISS_RETIRED.* */ | ||
| 421 | EVENT_CONSTRAINT_END | ||
| 422 | }; | ||
| 423 | |||
| 410 | struct event_constraint *intel_pebs_constraints(struct perf_event *event) | 424 | struct event_constraint *intel_pebs_constraints(struct perf_event *event) |
| 411 | { | 425 | { |
| 412 | struct event_constraint *c; | 426 | struct event_constraint *c; |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 0a5571080e74..38e4894165b9 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
| @@ -661,6 +661,11 @@ static void snb_uncore_msr_init_box(struct intel_uncore_box *box) | |||
| 661 | } | 661 | } |
| 662 | } | 662 | } |
| 663 | 663 | ||
| 664 | static struct uncore_event_desc snb_uncore_events[] = { | ||
| 665 | INTEL_UNCORE_EVENT_DESC(clockticks, "event=0xff,umask=0x00"), | ||
| 666 | { /* end: all zeroes */ }, | ||
| 667 | }; | ||
| 668 | |||
| 664 | static struct attribute *snb_uncore_formats_attr[] = { | 669 | static struct attribute *snb_uncore_formats_attr[] = { |
| 665 | &format_attr_event.attr, | 670 | &format_attr_event.attr, |
| 666 | &format_attr_umask.attr, | 671 | &format_attr_umask.attr, |
| @@ -704,6 +709,7 @@ static struct intel_uncore_type snb_uncore_cbox = { | |||
| 704 | .constraints = snb_uncore_cbox_constraints, | 709 | .constraints = snb_uncore_cbox_constraints, |
| 705 | .ops = &snb_uncore_msr_ops, | 710 | .ops = &snb_uncore_msr_ops, |
| 706 | .format_group = &snb_uncore_format_group, | 711 | .format_group = &snb_uncore_format_group, |
| 712 | .event_descs = snb_uncore_events, | ||
| 707 | }; | 713 | }; |
| 708 | 714 | ||
| 709 | static struct intel_uncore_type *snb_msr_uncores[] = { | 715 | static struct intel_uncore_type *snb_msr_uncores[] = { |
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index e0e6990723e9..ab1f6a93b527 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
| @@ -319,7 +319,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
| 319 | */ | 319 | */ |
| 320 | int devmem_is_allowed(unsigned long pagenr) | 320 | int devmem_is_allowed(unsigned long pagenr) |
| 321 | { | 321 | { |
| 322 | if (pagenr <= 256) | 322 | if (pagenr < 256) |
| 323 | return 1; | 323 | return 1; |
| 324 | if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) | 324 | if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) |
| 325 | return 0; | 325 | return 0; |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 9642d4a38602..1fbe75a95f15 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -1452,6 +1452,10 @@ asmlinkage void __init xen_start_kernel(void) | |||
| 1452 | pci_request_acs(); | 1452 | pci_request_acs(); |
| 1453 | 1453 | ||
| 1454 | xen_acpi_sleep_register(); | 1454 | xen_acpi_sleep_register(); |
| 1455 | |||
| 1456 | /* Avoid searching for BIOS MP tables */ | ||
| 1457 | x86_init.mpparse.find_smp_config = x86_init_noop; | ||
| 1458 | x86_init.mpparse.get_smp_config = x86_init_uint_noop; | ||
| 1455 | } | 1459 | } |
| 1456 | #ifdef CONFIG_PCI | 1460 | #ifdef CONFIG_PCI |
| 1457 | /* PCI BIOS service won't work from a PV guest. */ | 1461 | /* PCI BIOS service won't work from a PV guest. */ |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 76ba0e97e530..72213da605f5 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
| @@ -828,9 +828,6 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
| 828 | 828 | ||
| 829 | xen_mc_issue(PARAVIRT_LAZY_MMU); | 829 | xen_mc_issue(PARAVIRT_LAZY_MMU); |
| 830 | } | 830 | } |
| 831 | /* let's use dev_bus_addr to record the old mfn instead */ | ||
| 832 | kmap_op->dev_bus_addr = page->index; | ||
| 833 | page->index = (unsigned long) kmap_op; | ||
| 834 | } | 831 | } |
| 835 | spin_lock_irqsave(&m2p_override_lock, flags); | 832 | spin_lock_irqsave(&m2p_override_lock, flags); |
| 836 | list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]); | 833 | list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]); |
| @@ -857,7 +854,8 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
| 857 | return 0; | 854 | return 0; |
| 858 | } | 855 | } |
| 859 | EXPORT_SYMBOL_GPL(m2p_add_override); | 856 | EXPORT_SYMBOL_GPL(m2p_add_override); |
| 860 | int m2p_remove_override(struct page *page, bool clear_pte) | 857 | int m2p_remove_override(struct page *page, |
| 858 | struct gnttab_map_grant_ref *kmap_op) | ||
| 861 | { | 859 | { |
| 862 | unsigned long flags; | 860 | unsigned long flags; |
| 863 | unsigned long mfn; | 861 | unsigned long mfn; |
| @@ -887,10 +885,8 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
| 887 | WARN_ON(!PagePrivate(page)); | 885 | WARN_ON(!PagePrivate(page)); |
| 888 | ClearPagePrivate(page); | 886 | ClearPagePrivate(page); |
| 889 | 887 | ||
| 890 | if (clear_pte) { | 888 | set_phys_to_machine(pfn, page->index); |
| 891 | struct gnttab_map_grant_ref *map_op = | 889 | if (kmap_op != NULL) { |
| 892 | (struct gnttab_map_grant_ref *) page->index; | ||
| 893 | set_phys_to_machine(pfn, map_op->dev_bus_addr); | ||
| 894 | if (!PageHighMem(page)) { | 890 | if (!PageHighMem(page)) { |
| 895 | struct multicall_space mcs; | 891 | struct multicall_space mcs; |
| 896 | struct gnttab_unmap_grant_ref *unmap_op; | 892 | struct gnttab_unmap_grant_ref *unmap_op; |
| @@ -902,13 +898,13 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
| 902 | * issued. In this case handle is going to -1 because | 898 | * issued. In this case handle is going to -1 because |
| 903 | * it hasn't been modified yet. | 899 | * it hasn't been modified yet. |
| 904 | */ | 900 | */ |
| 905 | if (map_op->handle == -1) | 901 | if (kmap_op->handle == -1) |
| 906 | xen_mc_flush(); | 902 | xen_mc_flush(); |
| 907 | /* | 903 | /* |
| 908 | * Now if map_op->handle is negative it means that the | 904 | * Now if kmap_op->handle is negative it means that the |
| 909 | * hypercall actually returned an error. | 905 | * hypercall actually returned an error. |
| 910 | */ | 906 | */ |
| 911 | if (map_op->handle == GNTST_general_error) { | 907 | if (kmap_op->handle == GNTST_general_error) { |
| 912 | printk(KERN_WARNING "m2p_remove_override: " | 908 | printk(KERN_WARNING "m2p_remove_override: " |
| 913 | "pfn %lx mfn %lx, failed to modify kernel mappings", | 909 | "pfn %lx mfn %lx, failed to modify kernel mappings", |
| 914 | pfn, mfn); | 910 | pfn, mfn); |
| @@ -918,8 +914,8 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
| 918 | mcs = xen_mc_entry( | 914 | mcs = xen_mc_entry( |
| 919 | sizeof(struct gnttab_unmap_grant_ref)); | 915 | sizeof(struct gnttab_unmap_grant_ref)); |
| 920 | unmap_op = mcs.args; | 916 | unmap_op = mcs.args; |
| 921 | unmap_op->host_addr = map_op->host_addr; | 917 | unmap_op->host_addr = kmap_op->host_addr; |
| 922 | unmap_op->handle = map_op->handle; | 918 | unmap_op->handle = kmap_op->handle; |
| 923 | unmap_op->dev_bus_addr = 0; | 919 | unmap_op->dev_bus_addr = 0; |
| 924 | 920 | ||
| 925 | MULTI_grant_table_op(mcs.mc, | 921 | MULTI_grant_table_op(mcs.mc, |
| @@ -930,10 +926,9 @@ int m2p_remove_override(struct page *page, bool clear_pte) | |||
| 930 | set_pte_at(&init_mm, address, ptep, | 926 | set_pte_at(&init_mm, address, ptep, |
| 931 | pfn_pte(pfn, PAGE_KERNEL)); | 927 | pfn_pte(pfn, PAGE_KERNEL)); |
| 932 | __flush_tlb_single(address); | 928 | __flush_tlb_single(address); |
| 933 | map_op->host_addr = 0; | 929 | kmap_op->host_addr = 0; |
| 934 | } | 930 | } |
| 935 | } else | 931 | } |
| 936 | set_phys_to_machine(pfn, page->index); | ||
| 937 | 932 | ||
| 938 | /* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present | 933 | /* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present |
| 939 | * somewhere in this domain, even before being added to the | 934 | * somewhere in this domain, even before being added to the |
diff --git a/block/blk-core.c b/block/blk-core.c index 4b4dbdfbca89..ee3cb3a5e278 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -2254,9 +2254,11 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes) | |||
| 2254 | error_type = "I/O"; | 2254 | error_type = "I/O"; |
| 2255 | break; | 2255 | break; |
| 2256 | } | 2256 | } |
| 2257 | printk(KERN_ERR "end_request: %s error, dev %s, sector %llu\n", | 2257 | printk_ratelimited(KERN_ERR "end_request: %s error, dev %s, sector %llu\n", |
| 2258 | error_type, req->rq_disk ? req->rq_disk->disk_name : "?", | 2258 | error_type, req->rq_disk ? |
| 2259 | (unsigned long long)blk_rq_pos(req)); | 2259 | req->rq_disk->disk_name : "?", |
| 2260 | (unsigned long long)blk_rq_pos(req)); | ||
| 2261 | |||
| 2260 | } | 2262 | } |
| 2261 | 2263 | ||
| 2262 | blk_account_io_completion(req, nr_bytes); | 2264 | blk_account_io_completion(req, nr_bytes); |
diff --git a/block/ioctl.c b/block/ioctl.c index 4476e0e85d16..4a85096f5410 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
| @@ -41,7 +41,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user | |||
| 41 | sizeof(long long) > sizeof(long)) { | 41 | sizeof(long long) > sizeof(long)) { |
| 42 | long pstart = start, plength = length; | 42 | long pstart = start, plength = length; |
| 43 | if (pstart != start || plength != length | 43 | if (pstart != start || plength != length |
| 44 | || pstart < 0 || plength < 0) | 44 | || pstart < 0 || plength < 0 || partno > 65535) |
| 45 | return -EINVAL; | 45 | return -EINVAL; |
| 46 | } | 46 | } |
| 47 | 47 | ||
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index de0435e63b02..887f68f6d79a 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
| @@ -35,6 +35,7 @@ new_skb(ulong len) | |||
| 35 | skb_reset_mac_header(skb); | 35 | skb_reset_mac_header(skb); |
| 36 | skb_reset_network_header(skb); | 36 | skb_reset_network_header(skb); |
| 37 | skb->protocol = __constant_htons(ETH_P_AOE); | 37 | skb->protocol = __constant_htons(ETH_P_AOE); |
| 38 | skb_checksum_none_assert(skb); | ||
| 38 | } | 39 | } |
| 39 | return skb; | 40 | return skb; |
| 40 | } | 41 | } |
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 38aa6dda6b81..da3311129a0c 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
| @@ -795,6 +795,7 @@ static void complete_scsi_command(CommandList_struct *c, int timeout, | |||
| 795 | } | 795 | } |
| 796 | break; | 796 | break; |
| 797 | case CMD_PROTOCOL_ERR: | 797 | case CMD_PROTOCOL_ERR: |
| 798 | cmd->result = DID_ERROR << 16; | ||
| 798 | dev_warn(&h->pdev->dev, | 799 | dev_warn(&h->pdev->dev, |
| 799 | "%p has protocol error\n", c); | 800 | "%p has protocol error\n", c); |
| 800 | break; | 801 | break; |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index a8fddeb3d638..f946d31d6917 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
| @@ -1148,11 +1148,15 @@ static bool mtip_pause_ncq(struct mtip_port *port, | |||
| 1148 | reply = port->rxfis + RX_FIS_D2H_REG; | 1148 | reply = port->rxfis + RX_FIS_D2H_REG; |
| 1149 | task_file_data = readl(port->mmio+PORT_TFDATA); | 1149 | task_file_data = readl(port->mmio+PORT_TFDATA); |
| 1150 | 1150 | ||
| 1151 | if ((task_file_data & 1) || (fis->command == ATA_CMD_SEC_ERASE_UNIT)) | 1151 | if (fis->command == ATA_CMD_SEC_ERASE_UNIT) |
| 1152 | clear_bit(MTIP_DDF_SEC_LOCK_BIT, &port->dd->dd_flag); | ||
| 1153 | |||
| 1154 | if ((task_file_data & 1)) | ||
| 1152 | return false; | 1155 | return false; |
| 1153 | 1156 | ||
| 1154 | if (fis->command == ATA_CMD_SEC_ERASE_PREP) { | 1157 | if (fis->command == ATA_CMD_SEC_ERASE_PREP) { |
| 1155 | set_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags); | 1158 | set_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags); |
| 1159 | set_bit(MTIP_DDF_SEC_LOCK_BIT, &port->dd->dd_flag); | ||
| 1156 | port->ic_pause_timer = jiffies; | 1160 | port->ic_pause_timer = jiffies; |
| 1157 | return true; | 1161 | return true; |
| 1158 | } else if ((fis->command == ATA_CMD_DOWNLOAD_MICRO) && | 1162 | } else if ((fis->command == ATA_CMD_DOWNLOAD_MICRO) && |
| @@ -1900,7 +1904,7 @@ static int exec_drive_command(struct mtip_port *port, u8 *command, | |||
| 1900 | int rv = 0, xfer_sz = command[3]; | 1904 | int rv = 0, xfer_sz = command[3]; |
| 1901 | 1905 | ||
| 1902 | if (xfer_sz) { | 1906 | if (xfer_sz) { |
| 1903 | if (user_buffer) | 1907 | if (!user_buffer) |
| 1904 | return -EFAULT; | 1908 | return -EFAULT; |
| 1905 | 1909 | ||
| 1906 | buf = dmam_alloc_coherent(&port->dd->pdev->dev, | 1910 | buf = dmam_alloc_coherent(&port->dd->pdev->dev, |
| @@ -2043,7 +2047,7 @@ static void mtip_set_timeout(struct host_to_dev_fis *fis, unsigned int *timeout) | |||
| 2043 | *timeout = 240000; /* 4 minutes */ | 2047 | *timeout = 240000; /* 4 minutes */ |
| 2044 | break; | 2048 | break; |
| 2045 | case ATA_CMD_STANDBYNOW1: | 2049 | case ATA_CMD_STANDBYNOW1: |
| 2046 | *timeout = 10000; /* 10 seconds */ | 2050 | *timeout = 120000; /* 2 minutes */ |
| 2047 | break; | 2051 | break; |
| 2048 | case 0xF7: | 2052 | case 0xF7: |
| 2049 | case 0xFA: | 2053 | case 0xFA: |
| @@ -2588,9 +2592,6 @@ static ssize_t mtip_hw_read_registers(struct file *f, char __user *ubuf, | |||
| 2588 | if (!len || size) | 2592 | if (!len || size) |
| 2589 | return 0; | 2593 | return 0; |
| 2590 | 2594 | ||
| 2591 | if (size < 0) | ||
| 2592 | return -EINVAL; | ||
| 2593 | |||
| 2594 | size += sprintf(&buf[size], "H/ S ACTive : [ 0x"); | 2595 | size += sprintf(&buf[size], "H/ S ACTive : [ 0x"); |
| 2595 | 2596 | ||
| 2596 | for (n = dd->slot_groups-1; n >= 0; n--) | 2597 | for (n = dd->slot_groups-1; n >= 0; n--) |
| @@ -2660,9 +2661,6 @@ static ssize_t mtip_hw_read_flags(struct file *f, char __user *ubuf, | |||
| 2660 | if (!len || size) | 2661 | if (!len || size) |
| 2661 | return 0; | 2662 | return 0; |
| 2662 | 2663 | ||
| 2663 | if (size < 0) | ||
| 2664 | return -EINVAL; | ||
| 2665 | |||
| 2666 | size += sprintf(&buf[size], "Flag-port : [ %08lX ]\n", | 2664 | size += sprintf(&buf[size], "Flag-port : [ %08lX ]\n", |
| 2667 | dd->port->flags); | 2665 | dd->port->flags); |
| 2668 | size += sprintf(&buf[size], "Flag-dd : [ %08lX ]\n", | 2666 | size += sprintf(&buf[size], "Flag-dd : [ %08lX ]\n", |
| @@ -3214,8 +3212,8 @@ static int mtip_hw_init(struct driver_data *dd) | |||
| 3214 | "Unable to check write protect progress\n"); | 3212 | "Unable to check write protect progress\n"); |
| 3215 | else | 3213 | else |
| 3216 | dev_info(&dd->pdev->dev, | 3214 | dev_info(&dd->pdev->dev, |
| 3217 | "Write protect progress: %d%% (%d blocks)\n", | 3215 | "Write protect progress: %u%% (%u blocks)\n", |
| 3218 | attr242.cur, attr242.data); | 3216 | attr242.cur, le32_to_cpu(attr242.data)); |
| 3219 | return rv; | 3217 | return rv; |
| 3220 | 3218 | ||
| 3221 | out3: | 3219 | out3: |
| @@ -3619,6 +3617,10 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) | |||
| 3619 | bio_endio(bio, -ENODATA); | 3617 | bio_endio(bio, -ENODATA); |
| 3620 | return; | 3618 | return; |
| 3621 | } | 3619 | } |
| 3620 | if (unlikely(test_bit(MTIP_DDF_SEC_LOCK_BIT, &dd->dd_flag))) { | ||
| 3621 | bio_endio(bio, -ENODATA); | ||
| 3622 | return; | ||
| 3623 | } | ||
| 3622 | } | 3624 | } |
| 3623 | 3625 | ||
| 3624 | if (unlikely(!bio_has_data(bio))) { | 3626 | if (unlikely(!bio_has_data(bio))) { |
| @@ -4168,7 +4170,13 @@ static void mtip_pci_shutdown(struct pci_dev *pdev) | |||
| 4168 | 4170 | ||
| 4169 | /* Table of device ids supported by this driver. */ | 4171 | /* Table of device ids supported by this driver. */ |
| 4170 | static DEFINE_PCI_DEVICE_TABLE(mtip_pci_tbl) = { | 4172 | static DEFINE_PCI_DEVICE_TABLE(mtip_pci_tbl) = { |
| 4171 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320_DEVICE_ID) }, | 4173 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320H_DEVICE_ID) }, |
| 4174 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320M_DEVICE_ID) }, | ||
| 4175 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P320S_DEVICE_ID) }, | ||
| 4176 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P325M_DEVICE_ID) }, | ||
| 4177 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P420H_DEVICE_ID) }, | ||
| 4178 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P420M_DEVICE_ID) }, | ||
| 4179 | { PCI_DEVICE(PCI_VENDOR_ID_MICRON, P425M_DEVICE_ID) }, | ||
| 4172 | { 0 } | 4180 | { 0 } |
| 4173 | }; | 4181 | }; |
| 4174 | 4182 | ||
| @@ -4199,12 +4207,12 @@ static int __init mtip_init(void) | |||
| 4199 | { | 4207 | { |
| 4200 | int error; | 4208 | int error; |
| 4201 | 4209 | ||
| 4202 | printk(KERN_INFO MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); | 4210 | pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); |
| 4203 | 4211 | ||
| 4204 | /* Allocate a major block device number to use with this driver. */ | 4212 | /* Allocate a major block device number to use with this driver. */ |
| 4205 | error = register_blkdev(0, MTIP_DRV_NAME); | 4213 | error = register_blkdev(0, MTIP_DRV_NAME); |
| 4206 | if (error <= 0) { | 4214 | if (error <= 0) { |
| 4207 | printk(KERN_ERR "Unable to register block device (%d)\n", | 4215 | pr_err("Unable to register block device (%d)\n", |
| 4208 | error); | 4216 | error); |
| 4209 | return -EBUSY; | 4217 | return -EBUSY; |
| 4210 | } | 4218 | } |
| @@ -4213,7 +4221,7 @@ static int __init mtip_init(void) | |||
| 4213 | if (!dfs_parent) { | 4221 | if (!dfs_parent) { |
| 4214 | dfs_parent = debugfs_create_dir("rssd", NULL); | 4222 | dfs_parent = debugfs_create_dir("rssd", NULL); |
| 4215 | if (IS_ERR_OR_NULL(dfs_parent)) { | 4223 | if (IS_ERR_OR_NULL(dfs_parent)) { |
| 4216 | printk(KERN_WARNING "Error creating debugfs parent\n"); | 4224 | pr_warn("Error creating debugfs parent\n"); |
| 4217 | dfs_parent = NULL; | 4225 | dfs_parent = NULL; |
| 4218 | } | 4226 | } |
| 4219 | } | 4227 | } |
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index f51fc23d17bb..18627a1d04c5 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h | |||
| @@ -76,7 +76,13 @@ | |||
| 76 | 76 | ||
| 77 | /* Micron Vendor ID & P320x SSD Device ID */ | 77 | /* Micron Vendor ID & P320x SSD Device ID */ |
| 78 | #define PCI_VENDOR_ID_MICRON 0x1344 | 78 | #define PCI_VENDOR_ID_MICRON 0x1344 |
| 79 | #define P320_DEVICE_ID 0x5150 | 79 | #define P320H_DEVICE_ID 0x5150 |
| 80 | #define P320M_DEVICE_ID 0x5151 | ||
| 81 | #define P320S_DEVICE_ID 0x5152 | ||
| 82 | #define P325M_DEVICE_ID 0x5153 | ||
| 83 | #define P420H_DEVICE_ID 0x5160 | ||
| 84 | #define P420M_DEVICE_ID 0x5161 | ||
| 85 | #define P425M_DEVICE_ID 0x5163 | ||
| 80 | 86 | ||
| 81 | /* Driver name and version strings */ | 87 | /* Driver name and version strings */ |
| 82 | #define MTIP_DRV_NAME "mtip32xx" | 88 | #define MTIP_DRV_NAME "mtip32xx" |
| @@ -131,10 +137,12 @@ enum { | |||
| 131 | MTIP_PF_SVC_THD_STOP_BIT = 8, | 137 | MTIP_PF_SVC_THD_STOP_BIT = 8, |
| 132 | 138 | ||
| 133 | /* below are bit numbers in 'dd_flag' defined in driver_data */ | 139 | /* below are bit numbers in 'dd_flag' defined in driver_data */ |
| 140 | MTIP_DDF_SEC_LOCK_BIT = 0, | ||
| 134 | MTIP_DDF_REMOVE_PENDING_BIT = 1, | 141 | MTIP_DDF_REMOVE_PENDING_BIT = 1, |
| 135 | MTIP_DDF_OVER_TEMP_BIT = 2, | 142 | MTIP_DDF_OVER_TEMP_BIT = 2, |
| 136 | MTIP_DDF_WRITE_PROTECT_BIT = 3, | 143 | MTIP_DDF_WRITE_PROTECT_BIT = 3, |
| 137 | MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \ | 144 | MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \ |
| 145 | (1 << MTIP_DDF_SEC_LOCK_BIT) | \ | ||
| 138 | (1 << MTIP_DDF_OVER_TEMP_BIT) | \ | 146 | (1 << MTIP_DDF_OVER_TEMP_BIT) | \ |
| 139 | (1 << MTIP_DDF_WRITE_PROTECT_BIT)), | 147 | (1 << MTIP_DDF_WRITE_PROTECT_BIT)), |
| 140 | 148 | ||
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 73f196ca713f..c6decb901e5e 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
| @@ -337,7 +337,7 @@ static void xen_blkbk_unmap(struct pending_req *req) | |||
| 337 | invcount++; | 337 | invcount++; |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | ret = gnttab_unmap_refs(unmap, pages, invcount, false); | 340 | ret = gnttab_unmap_refs(unmap, NULL, pages, invcount); |
| 341 | BUG_ON(ret); | 341 | BUG_ON(ret); |
| 342 | } | 342 | } |
| 343 | 343 | ||
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index c0e816468e30..1a40935c85fd 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
| 36 | #include <linux/string.h> | 36 | #include <linux/string.h> |
| 37 | #include <linux/cpumask.h> | 37 | #include <linux/cpumask.h> |
| 38 | #include <linux/sched.h> /* for current / set_cpus_allowed() */ | ||
| 39 | #include <linux/io.h> | 38 | #include <linux/io.h> |
| 40 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
| 41 | 40 | ||
| @@ -1139,16 +1138,23 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, | |||
| 1139 | return res; | 1138 | return res; |
| 1140 | } | 1139 | } |
| 1141 | 1140 | ||
| 1142 | /* Driver entry point to switch to the target frequency */ | 1141 | struct powernowk8_target_arg { |
| 1143 | static int powernowk8_target(struct cpufreq_policy *pol, | 1142 | struct cpufreq_policy *pol; |
| 1144 | unsigned targfreq, unsigned relation) | 1143 | unsigned targfreq; |
| 1144 | unsigned relation; | ||
| 1145 | }; | ||
| 1146 | |||
| 1147 | static long powernowk8_target_fn(void *arg) | ||
| 1145 | { | 1148 | { |
| 1146 | cpumask_var_t oldmask; | 1149 | struct powernowk8_target_arg *pta = arg; |
| 1150 | struct cpufreq_policy *pol = pta->pol; | ||
| 1151 | unsigned targfreq = pta->targfreq; | ||
| 1152 | unsigned relation = pta->relation; | ||
| 1147 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); | 1153 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
| 1148 | u32 checkfid; | 1154 | u32 checkfid; |
| 1149 | u32 checkvid; | 1155 | u32 checkvid; |
| 1150 | unsigned int newstate; | 1156 | unsigned int newstate; |
| 1151 | int ret = -EIO; | 1157 | int ret; |
| 1152 | 1158 | ||
| 1153 | if (!data) | 1159 | if (!data) |
| 1154 | return -EINVAL; | 1160 | return -EINVAL; |
| @@ -1156,29 +1162,16 @@ static int powernowk8_target(struct cpufreq_policy *pol, | |||
| 1156 | checkfid = data->currfid; | 1162 | checkfid = data->currfid; |
| 1157 | checkvid = data->currvid; | 1163 | checkvid = data->currvid; |
| 1158 | 1164 | ||
| 1159 | /* only run on specific CPU from here on. */ | ||
| 1160 | /* This is poor form: use a workqueue or smp_call_function_single */ | ||
| 1161 | if (!alloc_cpumask_var(&oldmask, GFP_KERNEL)) | ||
| 1162 | return -ENOMEM; | ||
| 1163 | |||
| 1164 | cpumask_copy(oldmask, tsk_cpus_allowed(current)); | ||
| 1165 | set_cpus_allowed_ptr(current, cpumask_of(pol->cpu)); | ||
| 1166 | |||
| 1167 | if (smp_processor_id() != pol->cpu) { | ||
| 1168 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); | ||
| 1169 | goto err_out; | ||
| 1170 | } | ||
| 1171 | |||
| 1172 | if (pending_bit_stuck()) { | 1165 | if (pending_bit_stuck()) { |
| 1173 | printk(KERN_ERR PFX "failing targ, change pending bit set\n"); | 1166 | printk(KERN_ERR PFX "failing targ, change pending bit set\n"); |
| 1174 | goto err_out; | 1167 | return -EIO; |
| 1175 | } | 1168 | } |
| 1176 | 1169 | ||
| 1177 | pr_debug("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n", | 1170 | pr_debug("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n", |
| 1178 | pol->cpu, targfreq, pol->min, pol->max, relation); | 1171 | pol->cpu, targfreq, pol->min, pol->max, relation); |
| 1179 | 1172 | ||
| 1180 | if (query_current_values_with_pending_wait(data)) | 1173 | if (query_current_values_with_pending_wait(data)) |
| 1181 | goto err_out; | 1174 | return -EIO; |
| 1182 | 1175 | ||
| 1183 | if (cpu_family != CPU_HW_PSTATE) { | 1176 | if (cpu_family != CPU_HW_PSTATE) { |
| 1184 | pr_debug("targ: curr fid 0x%x, vid 0x%x\n", | 1177 | pr_debug("targ: curr fid 0x%x, vid 0x%x\n", |
| @@ -1196,7 +1189,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, | |||
| 1196 | 1189 | ||
| 1197 | if (cpufreq_frequency_table_target(pol, data->powernow_table, | 1190 | if (cpufreq_frequency_table_target(pol, data->powernow_table, |
| 1198 | targfreq, relation, &newstate)) | 1191 | targfreq, relation, &newstate)) |
| 1199 | goto err_out; | 1192 | return -EIO; |
| 1200 | 1193 | ||
| 1201 | mutex_lock(&fidvid_mutex); | 1194 | mutex_lock(&fidvid_mutex); |
| 1202 | 1195 | ||
| @@ -1209,9 +1202,8 @@ static int powernowk8_target(struct cpufreq_policy *pol, | |||
| 1209 | ret = transition_frequency_fidvid(data, newstate); | 1202 | ret = transition_frequency_fidvid(data, newstate); |
| 1210 | if (ret) { | 1203 | if (ret) { |
| 1211 | printk(KERN_ERR PFX "transition frequency failed\n"); | 1204 | printk(KERN_ERR PFX "transition frequency failed\n"); |
| 1212 | ret = 1; | ||
| 1213 | mutex_unlock(&fidvid_mutex); | 1205 | mutex_unlock(&fidvid_mutex); |
| 1214 | goto err_out; | 1206 | return 1; |
| 1215 | } | 1207 | } |
| 1216 | mutex_unlock(&fidvid_mutex); | 1208 | mutex_unlock(&fidvid_mutex); |
| 1217 | 1209 | ||
| @@ -1220,12 +1212,25 @@ static int powernowk8_target(struct cpufreq_policy *pol, | |||
| 1220 | data->powernow_table[newstate].index); | 1212 | data->powernow_table[newstate].index); |
| 1221 | else | 1213 | else |
| 1222 | pol->cur = find_khz_freq_from_fid(data->currfid); | 1214 | pol->cur = find_khz_freq_from_fid(data->currfid); |
| 1223 | ret = 0; | ||
| 1224 | 1215 | ||
| 1225 | err_out: | 1216 | return 0; |
| 1226 | set_cpus_allowed_ptr(current, oldmask); | 1217 | } |
| 1227 | free_cpumask_var(oldmask); | 1218 | |
| 1228 | return ret; | 1219 | /* Driver entry point to switch to the target frequency */ |
| 1220 | static int powernowk8_target(struct cpufreq_policy *pol, | ||
| 1221 | unsigned targfreq, unsigned relation) | ||
| 1222 | { | ||
| 1223 | struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq, | ||
| 1224 | .relation = relation }; | ||
| 1225 | |||
| 1226 | /* | ||
| 1227 | * Must run on @pol->cpu. cpufreq core is responsible for ensuring | ||
| 1228 | * that we're bound to the current CPU and pol->cpu stays online. | ||
| 1229 | */ | ||
| 1230 | if (smp_processor_id() == pol->cpu) | ||
| 1231 | return powernowk8_target_fn(&pta); | ||
| 1232 | else | ||
| 1233 | return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta); | ||
| 1229 | } | 1234 | } |
| 1230 | 1235 | ||
| 1231 | /* Driver entry point to verify the policy and range of frequencies */ | 1236 | /* Driver entry point to verify the policy and range of frequencies */ |
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 3934fcc4e00b..7ab6e26664a7 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
| @@ -661,7 +661,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
| 661 | flags); | 661 | flags); |
| 662 | 662 | ||
| 663 | if (unlikely(!atslave || !sg_len)) { | 663 | if (unlikely(!atslave || !sg_len)) { |
| 664 | dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n"); | 664 | dev_dbg(chan2dev(chan), "prep_slave_sg: sg length is zero!\n"); |
| 665 | return NULL; | 665 | return NULL; |
| 666 | } | 666 | } |
| 667 | 667 | ||
| @@ -689,6 +689,11 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
| 689 | 689 | ||
| 690 | mem = sg_dma_address(sg); | 690 | mem = sg_dma_address(sg); |
| 691 | len = sg_dma_len(sg); | 691 | len = sg_dma_len(sg); |
| 692 | if (unlikely(!len)) { | ||
| 693 | dev_dbg(chan2dev(chan), | ||
| 694 | "prep_slave_sg: sg(%d) data length is zero\n", i); | ||
| 695 | goto err; | ||
| 696 | } | ||
| 692 | mem_width = 2; | 697 | mem_width = 2; |
| 693 | if (unlikely(mem & 3 || len & 3)) | 698 | if (unlikely(mem & 3 || len & 3)) |
| 694 | mem_width = 0; | 699 | mem_width = 0; |
| @@ -724,6 +729,11 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
| 724 | 729 | ||
| 725 | mem = sg_dma_address(sg); | 730 | mem = sg_dma_address(sg); |
| 726 | len = sg_dma_len(sg); | 731 | len = sg_dma_len(sg); |
| 732 | if (unlikely(!len)) { | ||
| 733 | dev_dbg(chan2dev(chan), | ||
| 734 | "prep_slave_sg: sg(%d) data length is zero\n", i); | ||
| 735 | goto err; | ||
| 736 | } | ||
| 727 | mem_width = 2; | 737 | mem_width = 2; |
| 728 | if (unlikely(mem & 3 || len & 3)) | 738 | if (unlikely(mem & 3 || len & 3)) |
| 729 | mem_width = 0; | 739 | mem_width = 0; |
| @@ -757,6 +767,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
| 757 | 767 | ||
| 758 | err_desc_get: | 768 | err_desc_get: |
| 759 | dev_err(chan2dev(chan), "not enough descriptors available\n"); | 769 | dev_err(chan2dev(chan), "not enough descriptors available\n"); |
| 770 | err: | ||
| 760 | atc_desc_put(atchan, first); | 771 | atc_desc_put(atchan, first); |
| 761 | return NULL; | 772 | return NULL; |
| 762 | } | 773 | } |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index e4feba6b03c0..f5843bc80baa 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
| @@ -1567,17 +1567,19 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r) | |||
| 1567 | goto xfer_exit; | 1567 | goto xfer_exit; |
| 1568 | } | 1568 | } |
| 1569 | 1569 | ||
| 1570 | /* Prefer Secure Channel */ | ||
| 1571 | if (!_manager_ns(thrd)) | ||
| 1572 | r->cfg->nonsecure = 0; | ||
| 1573 | else | ||
| 1574 | r->cfg->nonsecure = 1; | ||
| 1575 | 1570 | ||
| 1576 | /* Use last settings, if not provided */ | 1571 | /* Use last settings, if not provided */ |
| 1577 | if (r->cfg) | 1572 | if (r->cfg) { |
| 1573 | /* Prefer Secure Channel */ | ||
| 1574 | if (!_manager_ns(thrd)) | ||
| 1575 | r->cfg->nonsecure = 0; | ||
| 1576 | else | ||
| 1577 | r->cfg->nonsecure = 1; | ||
| 1578 | |||
| 1578 | ccr = _prepare_ccr(r->cfg); | 1579 | ccr = _prepare_ccr(r->cfg); |
| 1579 | else | 1580 | } else { |
| 1580 | ccr = readl(regs + CC(thrd->id)); | 1581 | ccr = readl(regs + CC(thrd->id)); |
| 1582 | } | ||
| 1581 | 1583 | ||
| 1582 | /* If this req doesn't have valid xfer settings */ | 1584 | /* If this req doesn't have valid xfer settings */ |
| 1583 | if (!_is_valid(ccr)) { | 1585 | if (!_is_valid(ccr)) { |
| @@ -2928,6 +2930,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
| 2928 | num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan); | 2930 | num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan); |
| 2929 | 2931 | ||
| 2930 | pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); | 2932 | pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); |
| 2933 | if (!pdmac->peripherals) { | ||
| 2934 | ret = -ENOMEM; | ||
| 2935 | dev_err(&adev->dev, "unable to allocate pdmac->peripherals\n"); | ||
| 2936 | goto probe_err5; | ||
| 2937 | } | ||
| 2931 | 2938 | ||
| 2932 | for (i = 0; i < num_chan; i++) { | 2939 | for (i = 0; i < num_chan; i++) { |
| 2933 | pch = &pdmac->peripherals[i]; | 2940 | pch = &pdmac->peripherals[i]; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 489e2b162b27..274d25de521e 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -3242,7 +3242,8 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj, | |||
| 3242 | { | 3242 | { |
| 3243 | int ret; | 3243 | int ret; |
| 3244 | 3244 | ||
| 3245 | BUG_ON(obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT); | 3245 | if (WARN_ON(obj->pin_count == DRM_I915_GEM_OBJECT_MAX_PIN_COUNT)) |
| 3246 | return -EBUSY; | ||
| 3246 | 3247 | ||
| 3247 | if (obj->gtt_space != NULL) { | 3248 | if (obj->gtt_space != NULL) { |
| 3248 | if ((alignment && obj->gtt_offset & (alignment - 1)) || | 3249 | if ((alignment && obj->gtt_offset & (alignment - 1)) || |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bc2ad348e5d8..c040aee1341c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -4191,12 +4191,6 @@ static void i8xx_update_pll(struct drm_crtc *crtc, | |||
| 4191 | POSTING_READ(DPLL(pipe)); | 4191 | POSTING_READ(DPLL(pipe)); |
| 4192 | udelay(150); | 4192 | udelay(150); |
| 4193 | 4193 | ||
| 4194 | I915_WRITE(DPLL(pipe), dpll); | ||
| 4195 | |||
| 4196 | /* Wait for the clocks to stabilize. */ | ||
| 4197 | POSTING_READ(DPLL(pipe)); | ||
| 4198 | udelay(150); | ||
| 4199 | |||
| 4200 | /* The LVDS pin pair needs to be on before the DPLLs are enabled. | 4194 | /* The LVDS pin pair needs to be on before the DPLLs are enabled. |
| 4201 | * This is an exception to the general rule that mode_set doesn't turn | 4195 | * This is an exception to the general rule that mode_set doesn't turn |
| 4202 | * things on. | 4196 | * things on. |
| @@ -4204,6 +4198,12 @@ static void i8xx_update_pll(struct drm_crtc *crtc, | |||
| 4204 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) | 4198 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) |
| 4205 | intel_update_lvds(crtc, clock, adjusted_mode); | 4199 | intel_update_lvds(crtc, clock, adjusted_mode); |
| 4206 | 4200 | ||
| 4201 | I915_WRITE(DPLL(pipe), dpll); | ||
| 4202 | |||
| 4203 | /* Wait for the clocks to stabilize. */ | ||
| 4204 | POSTING_READ(DPLL(pipe)); | ||
| 4205 | udelay(150); | ||
| 4206 | |||
| 4207 | /* The pixel multiplier can only be updated once the | 4207 | /* The pixel multiplier can only be updated once the |
| 4208 | * DPLL is enabled and the clocks are stable. | 4208 | * DPLL is enabled and the clocks are stable. |
| 4209 | * | 4209 | * |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 98f602427eb8..12dc3308ab8c 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
| @@ -609,7 +609,7 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode) | |||
| 609 | u32 temp; | 609 | u32 temp; |
| 610 | u32 enable_bits = SDVO_ENABLE; | 610 | u32 enable_bits = SDVO_ENABLE; |
| 611 | 611 | ||
| 612 | if (intel_hdmi->has_audio) | 612 | if (intel_hdmi->has_audio || mode != DRM_MODE_DPMS_ON) |
| 613 | enable_bits |= SDVO_AUDIO_ENABLE; | 613 | enable_bits |= SDVO_AUDIO_ENABLE; |
| 614 | 614 | ||
| 615 | temp = I915_READ(intel_hdmi->sdvox_reg); | 615 | temp = I915_READ(intel_hdmi->sdvox_reg); |
diff --git a/drivers/gpu/drm/nouveau/nv50_gpio.c b/drivers/gpu/drm/nouveau/nv50_gpio.c index f03490534893..c399d510b27a 100644 --- a/drivers/gpu/drm/nouveau/nv50_gpio.c +++ b/drivers/gpu/drm/nouveau/nv50_gpio.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/dmi.h> | ||
| 25 | #include "drmP.h" | 26 | #include "drmP.h" |
| 26 | #include "nouveau_drv.h" | 27 | #include "nouveau_drv.h" |
| 27 | #include "nouveau_hw.h" | 28 | #include "nouveau_hw.h" |
| @@ -110,13 +111,25 @@ nv50_gpio_isr(struct drm_device *dev) | |||
| 110 | nv_wr32(dev, 0xe074, intr1); | 111 | nv_wr32(dev, 0xe074, intr1); |
| 111 | } | 112 | } |
| 112 | 113 | ||
| 114 | static struct dmi_system_id gpio_reset_ids[] = { | ||
| 115 | { | ||
| 116 | .ident = "Apple Macbook 10,1", | ||
| 117 | .matches = { | ||
| 118 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
| 119 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro10,1"), | ||
| 120 | } | ||
| 121 | }, | ||
| 122 | { } | ||
| 123 | }; | ||
| 124 | |||
| 113 | int | 125 | int |
| 114 | nv50_gpio_init(struct drm_device *dev) | 126 | nv50_gpio_init(struct drm_device *dev) |
| 115 | { | 127 | { |
| 116 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 128 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 117 | 129 | ||
| 118 | /* initialise gpios and routing to vbios defaults */ | 130 | /* initialise gpios and routing to vbios defaults */ |
| 119 | nouveau_gpio_reset(dev); | 131 | if (dmi_check_system(gpio_reset_ids)) |
| 132 | nouveau_gpio_reset(dev); | ||
| 120 | 133 | ||
| 121 | /* disable, and ack any pending gpio interrupts */ | 134 | /* disable, and ack any pending gpio interrupts */ |
| 122 | nv_wr32(dev, 0xe050, 0x00000000); | 135 | nv_wr32(dev, 0xe050, 0x00000000); |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index e721e3087b99..2817101fb167 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -1479,98 +1479,14 @@ static void radeon_legacy_atom_fixup(struct drm_crtc *crtc) | |||
| 1479 | } | 1479 | } |
| 1480 | } | 1480 | } |
| 1481 | 1481 | ||
| 1482 | /** | ||
| 1483 | * radeon_get_pll_use_mask - look up a mask of which pplls are in use | ||
| 1484 | * | ||
| 1485 | * @crtc: drm crtc | ||
| 1486 | * | ||
| 1487 | * Returns the mask of which PPLLs (Pixel PLLs) are in use. | ||
| 1488 | */ | ||
| 1489 | static u32 radeon_get_pll_use_mask(struct drm_crtc *crtc) | ||
| 1490 | { | ||
| 1491 | struct drm_device *dev = crtc->dev; | ||
| 1492 | struct drm_crtc *test_crtc; | ||
| 1493 | struct radeon_crtc *radeon_test_crtc; | ||
| 1494 | u32 pll_in_use = 0; | ||
| 1495 | |||
| 1496 | list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { | ||
| 1497 | if (crtc == test_crtc) | ||
| 1498 | continue; | ||
| 1499 | |||
| 1500 | radeon_test_crtc = to_radeon_crtc(test_crtc); | ||
| 1501 | if (radeon_test_crtc->pll_id != ATOM_PPLL_INVALID) | ||
| 1502 | pll_in_use |= (1 << radeon_test_crtc->pll_id); | ||
| 1503 | } | ||
| 1504 | return pll_in_use; | ||
| 1505 | } | ||
| 1506 | |||
| 1507 | /** | ||
| 1508 | * radeon_get_shared_dp_ppll - return the PPLL used by another crtc for DP | ||
| 1509 | * | ||
| 1510 | * @crtc: drm crtc | ||
| 1511 | * | ||
| 1512 | * Returns the PPLL (Pixel PLL) used by another crtc/encoder which is | ||
| 1513 | * also in DP mode. For DP, a single PPLL can be used for all DP | ||
| 1514 | * crtcs/encoders. | ||
| 1515 | */ | ||
| 1516 | static int radeon_get_shared_dp_ppll(struct drm_crtc *crtc) | ||
| 1517 | { | ||
| 1518 | struct drm_device *dev = crtc->dev; | ||
| 1519 | struct drm_encoder *test_encoder; | ||
| 1520 | struct radeon_crtc *radeon_test_crtc; | ||
| 1521 | |||
| 1522 | list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { | ||
| 1523 | if (test_encoder->crtc && (test_encoder->crtc != crtc)) { | ||
| 1524 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { | ||
| 1525 | /* for DP use the same PLL for all */ | ||
| 1526 | radeon_test_crtc = to_radeon_crtc(test_encoder->crtc); | ||
| 1527 | if (radeon_test_crtc->pll_id != ATOM_PPLL_INVALID) | ||
| 1528 | return radeon_test_crtc->pll_id; | ||
| 1529 | } | ||
| 1530 | } | ||
| 1531 | } | ||
| 1532 | return ATOM_PPLL_INVALID; | ||
| 1533 | } | ||
| 1534 | |||
| 1535 | /** | ||
| 1536 | * radeon_atom_pick_pll - Allocate a PPLL for use by the crtc. | ||
| 1537 | * | ||
| 1538 | * @crtc: drm crtc | ||
| 1539 | * | ||
| 1540 | * Returns the PPLL (Pixel PLL) to be used by the crtc. For DP monitors | ||
| 1541 | * a single PPLL can be used for all DP crtcs/encoders. For non-DP | ||
| 1542 | * monitors a dedicated PPLL must be used. If a particular board has | ||
| 1543 | * an external DP PLL, return ATOM_PPLL_INVALID to skip PLL programming | ||
| 1544 | * as there is no need to program the PLL itself. If we are not able to | ||
| 1545 | * allocate a PLL, return ATOM_PPLL_INVALID to skip PLL programming to | ||
| 1546 | * avoid messing up an existing monitor. | ||
| 1547 | * | ||
| 1548 | * Asic specific PLL information | ||
| 1549 | * | ||
| 1550 | * DCE 6.1 | ||
| 1551 | * - PPLL2 is only available to UNIPHYA (both DP and non-DP) | ||
| 1552 | * - PPLL0, PPLL1 are available for UNIPHYB/C/D/E/F (both DP and non-DP) | ||
| 1553 | * | ||
| 1554 | * DCE 6.0 | ||
| 1555 | * - PPLL0 is available to all UNIPHY (DP only) | ||
| 1556 | * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC | ||
| 1557 | * | ||
| 1558 | * DCE 5.0 | ||
| 1559 | * - DCPLL is available to all UNIPHY (DP only) | ||
| 1560 | * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC | ||
| 1561 | * | ||
| 1562 | * DCE 3.0/4.0/4.1 | ||
| 1563 | * - PPLL1, PPLL2 are available for all UNIPHY (both DP and non-DP) and DAC | ||
| 1564 | * | ||
| 1565 | */ | ||
| 1566 | static int radeon_atom_pick_pll(struct drm_crtc *crtc) | 1482 | static int radeon_atom_pick_pll(struct drm_crtc *crtc) |
| 1567 | { | 1483 | { |
| 1568 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 1484 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
| 1569 | struct drm_device *dev = crtc->dev; | 1485 | struct drm_device *dev = crtc->dev; |
| 1570 | struct radeon_device *rdev = dev->dev_private; | 1486 | struct radeon_device *rdev = dev->dev_private; |
| 1571 | struct drm_encoder *test_encoder; | 1487 | struct drm_encoder *test_encoder; |
| 1572 | u32 pll_in_use; | 1488 | struct drm_crtc *test_crtc; |
| 1573 | int pll; | 1489 | uint32_t pll_in_use = 0; |
| 1574 | 1490 | ||
| 1575 | if (ASIC_IS_DCE61(rdev)) { | 1491 | if (ASIC_IS_DCE61(rdev)) { |
| 1576 | list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { | 1492 | list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { |
| @@ -1582,40 +1498,32 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc) | |||
| 1582 | 1498 | ||
| 1583 | if ((test_radeon_encoder->encoder_id == | 1499 | if ((test_radeon_encoder->encoder_id == |
| 1584 | ENCODER_OBJECT_ID_INTERNAL_UNIPHY) && | 1500 | ENCODER_OBJECT_ID_INTERNAL_UNIPHY) && |
| 1585 | (dig->linkb == false)) | 1501 | (dig->linkb == false)) /* UNIPHY A uses PPLL2 */ |
| 1586 | /* UNIPHY A uses PPLL2 */ | ||
| 1587 | return ATOM_PPLL2; | 1502 | return ATOM_PPLL2; |
| 1588 | else if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { | ||
| 1589 | /* UNIPHY B/C/D/E/F */ | ||
| 1590 | if (rdev->clock.dp_extclk) | ||
| 1591 | /* skip PPLL programming if using ext clock */ | ||
| 1592 | return ATOM_PPLL_INVALID; | ||
| 1593 | else { | ||
| 1594 | /* use the same PPLL for all DP monitors */ | ||
| 1595 | pll = radeon_get_shared_dp_ppll(crtc); | ||
| 1596 | if (pll != ATOM_PPLL_INVALID) | ||
| 1597 | return pll; | ||
| 1598 | } | ||
| 1599 | } | ||
| 1600 | break; | ||
| 1601 | } | 1503 | } |
| 1602 | } | 1504 | } |
| 1603 | /* UNIPHY B/C/D/E/F */ | 1505 | /* UNIPHY B/C/D/E/F */ |
| 1604 | pll_in_use = radeon_get_pll_use_mask(crtc); | 1506 | list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { |
| 1605 | if (!(pll_in_use & (1 << ATOM_PPLL0))) | 1507 | struct radeon_crtc *radeon_test_crtc; |
| 1508 | |||
| 1509 | if (crtc == test_crtc) | ||
| 1510 | continue; | ||
| 1511 | |||
| 1512 | radeon_test_crtc = to_radeon_crtc(test_crtc); | ||
| 1513 | if ((radeon_test_crtc->pll_id == ATOM_PPLL0) || | ||
| 1514 | (radeon_test_crtc->pll_id == ATOM_PPLL1)) | ||
| 1515 | pll_in_use |= (1 << radeon_test_crtc->pll_id); | ||
| 1516 | } | ||
| 1517 | if (!(pll_in_use & 4)) | ||
| 1606 | return ATOM_PPLL0; | 1518 | return ATOM_PPLL0; |
| 1607 | if (!(pll_in_use & (1 << ATOM_PPLL1))) | 1519 | return ATOM_PPLL1; |
| 1608 | return ATOM_PPLL1; | ||
| 1609 | DRM_ERROR("unable to allocate a PPLL\n"); | ||
| 1610 | return ATOM_PPLL_INVALID; | ||
| 1611 | } else if (ASIC_IS_DCE4(rdev)) { | 1520 | } else if (ASIC_IS_DCE4(rdev)) { |
| 1612 | list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { | 1521 | list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { |
| 1613 | if (test_encoder->crtc && (test_encoder->crtc == crtc)) { | 1522 | if (test_encoder->crtc && (test_encoder->crtc == crtc)) { |
| 1614 | /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock, | 1523 | /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock, |
| 1615 | * depending on the asic: | 1524 | * depending on the asic: |
| 1616 | * DCE4: PPLL or ext clock | 1525 | * DCE4: PPLL or ext clock |
| 1617 | * DCE5: PPLL, DCPLL, or ext clock | 1526 | * DCE5: DCPLL or ext clock |
| 1618 | * DCE6: PPLL, PPLL0, or ext clock | ||
| 1619 | * | 1527 | * |
| 1620 | * Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip | 1528 | * Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip |
| 1621 | * PPLL/DCPLL programming and only program the DP DTO for the | 1529 | * PPLL/DCPLL programming and only program the DP DTO for the |
| @@ -1623,34 +1531,31 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc) | |||
| 1623 | */ | 1531 | */ |
| 1624 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { | 1532 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(test_encoder))) { |
| 1625 | if (rdev->clock.dp_extclk) | 1533 | if (rdev->clock.dp_extclk) |
| 1626 | /* skip PPLL programming if using ext clock */ | ||
| 1627 | return ATOM_PPLL_INVALID; | 1534 | return ATOM_PPLL_INVALID; |
| 1628 | else if (ASIC_IS_DCE6(rdev)) | 1535 | else if (ASIC_IS_DCE6(rdev)) |
| 1629 | /* use PPLL0 for all DP */ | ||
| 1630 | return ATOM_PPLL0; | 1536 | return ATOM_PPLL0; |
| 1631 | else if (ASIC_IS_DCE5(rdev)) | 1537 | else if (ASIC_IS_DCE5(rdev)) |
| 1632 | /* use DCPLL for all DP */ | ||
| 1633 | return ATOM_DCPLL; | 1538 | return ATOM_DCPLL; |
| 1634 | else { | ||
| 1635 | /* use the same PPLL for all DP monitors */ | ||
| 1636 | pll = radeon_get_shared_dp_ppll(crtc); | ||
| 1637 | if (pll != ATOM_PPLL_INVALID) | ||
| 1638 | return pll; | ||
| 1639 | } | ||
| 1640 | } | 1539 | } |
| 1641 | break; | ||
| 1642 | } | 1540 | } |
| 1643 | } | 1541 | } |
| 1644 | /* all other cases */ | 1542 | |
| 1645 | pll_in_use = radeon_get_pll_use_mask(crtc); | 1543 | /* otherwise, pick one of the plls */ |
| 1646 | if (!(pll_in_use & (1 << ATOM_PPLL2))) | 1544 | list_for_each_entry(test_crtc, &dev->mode_config.crtc_list, head) { |
| 1647 | return ATOM_PPLL2; | 1545 | struct radeon_crtc *radeon_test_crtc; |
| 1648 | if (!(pll_in_use & (1 << ATOM_PPLL1))) | 1546 | |
| 1547 | if (crtc == test_crtc) | ||
| 1548 | continue; | ||
| 1549 | |||
| 1550 | radeon_test_crtc = to_radeon_crtc(test_crtc); | ||
| 1551 | if ((radeon_test_crtc->pll_id >= ATOM_PPLL1) && | ||
| 1552 | (radeon_test_crtc->pll_id <= ATOM_PPLL2)) | ||
| 1553 | pll_in_use |= (1 << radeon_test_crtc->pll_id); | ||
| 1554 | } | ||
| 1555 | if (!(pll_in_use & 1)) | ||
| 1649 | return ATOM_PPLL1; | 1556 | return ATOM_PPLL1; |
| 1650 | DRM_ERROR("unable to allocate a PPLL\n"); | 1557 | return ATOM_PPLL2; |
| 1651 | return ATOM_PPLL_INVALID; | ||
| 1652 | } else | 1558 | } else |
| 1653 | /* use PPLL1 or PPLL2 */ | ||
| 1654 | return radeon_crtc->crtc_id; | 1559 | return radeon_crtc->crtc_id; |
| 1655 | 1560 | ||
| 1656 | } | 1561 | } |
| @@ -1792,7 +1697,7 @@ static void atombios_crtc_disable(struct drm_crtc *crtc) | |||
| 1792 | break; | 1697 | break; |
| 1793 | } | 1698 | } |
| 1794 | done: | 1699 | done: |
| 1795 | radeon_crtc->pll_id = ATOM_PPLL_INVALID; | 1700 | radeon_crtc->pll_id = -1; |
| 1796 | } | 1701 | } |
| 1797 | 1702 | ||
| 1798 | static const struct drm_crtc_helper_funcs atombios_helper_funcs = { | 1703 | static const struct drm_crtc_helper_funcs atombios_helper_funcs = { |
| @@ -1841,6 +1746,6 @@ void radeon_atombios_init_crtc(struct drm_device *dev, | |||
| 1841 | else | 1746 | else |
| 1842 | radeon_crtc->crtc_offset = 0; | 1747 | radeon_crtc->crtc_offset = 0; |
| 1843 | } | 1748 | } |
| 1844 | radeon_crtc->pll_id = ATOM_PPLL_INVALID; | 1749 | radeon_crtc->pll_id = -1; |
| 1845 | drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs); | 1750 | drm_crtc_helper_add(&radeon_crtc->base, &atombios_helper_funcs); |
| 1846 | } | 1751 | } |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 8acb34fd3fd5..8d7e33a0b243 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -1182,7 +1182,8 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size) | |||
| 1182 | ring->ready = true; | 1182 | ring->ready = true; |
| 1183 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); | 1183 | radeon_ttm_set_active_vram_size(rdev, rdev->mc.real_vram_size); |
| 1184 | 1184 | ||
| 1185 | if (radeon_ring_supports_scratch_reg(rdev, ring)) { | 1185 | if (!ring->rptr_save_reg /* not resuming from suspend */ |
| 1186 | && radeon_ring_supports_scratch_reg(rdev, ring)) { | ||
| 1186 | r = radeon_scratch_get(rdev, &ring->rptr_save_reg); | 1187 | r = radeon_scratch_get(rdev, &ring->rptr_save_reg); |
| 1187 | if (r) { | 1188 | if (r) { |
| 1188 | DRM_ERROR("failed to get scratch reg for rptr save (%d).\n", r); | 1189 | DRM_ERROR("failed to get scratch reg for rptr save (%d).\n", r); |
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c index cfec802cf9ca..f915eb1c29f7 100644 --- a/drivers/hwmon/ad7314.c +++ b/drivers/hwmon/ad7314.c | |||
| @@ -87,10 +87,18 @@ static ssize_t ad7314_show_temperature(struct device *dev, | |||
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | static ssize_t ad7314_show_name(struct device *dev, | ||
| 91 | struct device_attribute *devattr, char *buf) | ||
| 92 | { | ||
| 93 | return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); | ||
| 94 | } | ||
| 95 | |||
| 96 | static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); | ||
| 90 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, | 97 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, |
| 91 | ad7314_show_temperature, NULL, 0); | 98 | ad7314_show_temperature, NULL, 0); |
| 92 | 99 | ||
| 93 | static struct attribute *ad7314_attributes[] = { | 100 | static struct attribute *ad7314_attributes[] = { |
| 101 | &dev_attr_name.attr, | ||
| 94 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 102 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
| 95 | NULL, | 103 | NULL, |
| 96 | }; | 104 | }; |
diff --git a/drivers/hwmon/ads7871.c b/drivers/hwmon/ads7871.c index e65c6e45d36b..7bf4ce3d405e 100644 --- a/drivers/hwmon/ads7871.c +++ b/drivers/hwmon/ads7871.c | |||
| @@ -139,6 +139,12 @@ static ssize_t show_voltage(struct device *dev, | |||
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static ssize_t ads7871_show_name(struct device *dev, | ||
| 143 | struct device_attribute *devattr, char *buf) | ||
| 144 | { | ||
| 145 | return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); | ||
| 146 | } | ||
| 147 | |||
| 142 | static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_voltage, NULL, 0); | 148 | static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_voltage, NULL, 0); |
| 143 | static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 1); | 149 | static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 1); |
| 144 | static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_voltage, NULL, 2); | 150 | static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_voltage, NULL, 2); |
| @@ -148,6 +154,8 @@ static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, show_voltage, NULL, 5); | |||
| 148 | static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_voltage, NULL, 6); | 154 | static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_voltage, NULL, 6); |
| 149 | static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, show_voltage, NULL, 7); | 155 | static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, show_voltage, NULL, 7); |
| 150 | 156 | ||
| 157 | static DEVICE_ATTR(name, S_IRUGO, ads7871_show_name, NULL); | ||
| 158 | |||
| 151 | static struct attribute *ads7871_attributes[] = { | 159 | static struct attribute *ads7871_attributes[] = { |
| 152 | &sensor_dev_attr_in0_input.dev_attr.attr, | 160 | &sensor_dev_attr_in0_input.dev_attr.attr, |
| 153 | &sensor_dev_attr_in1_input.dev_attr.attr, | 161 | &sensor_dev_attr_in1_input.dev_attr.attr, |
| @@ -157,6 +165,7 @@ static struct attribute *ads7871_attributes[] = { | |||
| 157 | &sensor_dev_attr_in5_input.dev_attr.attr, | 165 | &sensor_dev_attr_in5_input.dev_attr.attr, |
| 158 | &sensor_dev_attr_in6_input.dev_attr.attr, | 166 | &sensor_dev_attr_in6_input.dev_attr.attr, |
| 159 | &sensor_dev_attr_in7_input.dev_attr.attr, | 167 | &sensor_dev_attr_in7_input.dev_attr.attr, |
| 168 | &dev_attr_name.attr, | ||
| 160 | NULL | 169 | NULL |
| 161 | }; | 170 | }; |
| 162 | 171 | ||
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 282708860517..8f3f6f2c45fd 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
| @@ -53,10 +53,10 @@ | |||
| 53 | 53 | ||
| 54 | #define APPLESMC_MAX_DATA_LENGTH 32 | 54 | #define APPLESMC_MAX_DATA_LENGTH 32 |
| 55 | 55 | ||
| 56 | /* wait up to 32 ms for a status change. */ | 56 | /* wait up to 128 ms for a status change. */ |
| 57 | #define APPLESMC_MIN_WAIT 0x0010 | 57 | #define APPLESMC_MIN_WAIT 0x0010 |
| 58 | #define APPLESMC_RETRY_WAIT 0x0100 | 58 | #define APPLESMC_RETRY_WAIT 0x0100 |
| 59 | #define APPLESMC_MAX_WAIT 0x8000 | 59 | #define APPLESMC_MAX_WAIT 0x20000 |
| 60 | 60 | ||
| 61 | #define APPLESMC_READ_CMD 0x10 | 61 | #define APPLESMC_READ_CMD 0x10 |
| 62 | #define APPLESMC_WRITE_CMD 0x11 | 62 | #define APPLESMC_WRITE_CMD 0x11 |
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index 1201a15784c3..db713c0dfba4 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c | |||
| @@ -552,7 +552,7 @@ EXPORT_SYMBOL_GPL(hwspin_lock_request_specific); | |||
| 552 | */ | 552 | */ |
| 553 | int hwspin_lock_free(struct hwspinlock *hwlock) | 553 | int hwspin_lock_free(struct hwspinlock *hwlock) |
| 554 | { | 554 | { |
| 555 | struct device *dev = hwlock->bank->dev; | 555 | struct device *dev; |
| 556 | struct hwspinlock *tmp; | 556 | struct hwspinlock *tmp; |
| 557 | int ret; | 557 | int ret; |
| 558 | 558 | ||
| @@ -561,6 +561,7 @@ int hwspin_lock_free(struct hwspinlock *hwlock) | |||
| 561 | return -EINVAL; | 561 | return -EINVAL; |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | dev = hwlock->bank->dev; | ||
| 564 | mutex_lock(&hwspinlock_tree_lock); | 565 | mutex_lock(&hwspinlock_tree_lock); |
| 565 | 566 | ||
| 566 | /* make sure the hwspinlock is used */ | 567 | /* make sure the hwspinlock is used */ |
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index ce68e361558c..cdc252612c0b 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c | |||
| @@ -516,9 +516,9 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev) | |||
| 516 | input_set_drvdata(input_dev, keypad); | 516 | input_set_drvdata(input_dev, keypad); |
| 517 | 517 | ||
| 518 | /* Ensure that the keypad will stay dormant until opened */ | 518 | /* Ensure that the keypad will stay dormant until opened */ |
| 519 | clk_enable(keypad->clk); | 519 | clk_prepare_enable(keypad->clk); |
| 520 | imx_keypad_inhibit(keypad); | 520 | imx_keypad_inhibit(keypad); |
| 521 | clk_disable(keypad->clk); | 521 | clk_disable_unprepare(keypad->clk); |
| 522 | 522 | ||
| 523 | error = request_irq(irq, imx_keypad_irq_handler, 0, | 523 | error = request_irq(irq, imx_keypad_irq_handler, 0, |
| 524 | pdev->name, keypad); | 524 | pdev->name, keypad); |
diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index f06231b7cab1..84ec691c05aa 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c | |||
| @@ -74,8 +74,8 @@ static int __devinit ab8500_ponkey_probe(struct platform_device *pdev) | |||
| 74 | 74 | ||
| 75 | ponkey->idev = input; | 75 | ponkey->idev = input; |
| 76 | ponkey->ab8500 = ab8500; | 76 | ponkey->ab8500 = ab8500; |
| 77 | ponkey->irq_dbf = ab8500_irq_get_virq(ab8500, irq_dbf); | 77 | ponkey->irq_dbf = irq_dbf; |
| 78 | ponkey->irq_dbr = ab8500_irq_get_virq(ab8500, irq_dbr); | 78 | ponkey->irq_dbr = irq_dbr; |
| 79 | 79 | ||
| 80 | input->name = "AB8500 POn(PowerOn) Key"; | 80 | input->name = "AB8500 POn(PowerOn) Key"; |
| 81 | input->dev.parent = &pdev->dev; | 81 | input->dev.parent = &pdev->dev; |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index 3f5649f19082..a261d8576919 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
| @@ -721,6 +721,17 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) | |||
| 721 | 721 | ||
| 722 | switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) { | 722 | switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) { |
| 723 | case FSP_PKT_TYPE_ABS: | 723 | case FSP_PKT_TYPE_ABS: |
| 724 | |||
| 725 | if ((packet[0] == 0x48 || packet[0] == 0x49) && | ||
| 726 | packet[1] == 0 && packet[2] == 0) { | ||
| 727 | /* | ||
| 728 | * Ignore coordinate noise when finger leaving the | ||
| 729 | * surface, otherwise cursor may jump to upper-left | ||
| 730 | * corner. | ||
| 731 | */ | ||
| 732 | packet[3] &= 0xf0; | ||
| 733 | } | ||
| 734 | |||
| 724 | abs_x = GET_ABS_X(packet); | 735 | abs_x = GET_ABS_X(packet); |
| 725 | abs_y = GET_ABS_Y(packet); | 736 | abs_y = GET_ABS_Y(packet); |
| 726 | 737 | ||
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 2ffd110bd5bc..2e77246c2e5a 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c | |||
| @@ -72,7 +72,7 @@ static int amba_kmi_open(struct serio *io) | |||
| 72 | unsigned int divisor; | 72 | unsigned int divisor; |
| 73 | int ret; | 73 | int ret; |
| 74 | 74 | ||
| 75 | ret = clk_enable(kmi->clk); | 75 | ret = clk_prepare_enable(kmi->clk); |
| 76 | if (ret) | 76 | if (ret) |
| 77 | goto out; | 77 | goto out; |
| 78 | 78 | ||
| @@ -92,7 +92,7 @@ static int amba_kmi_open(struct serio *io) | |||
| 92 | return 0; | 92 | return 0; |
| 93 | 93 | ||
| 94 | clk_disable: | 94 | clk_disable: |
| 95 | clk_disable(kmi->clk); | 95 | clk_disable_unprepare(kmi->clk); |
| 96 | out: | 96 | out: |
| 97 | return ret; | 97 | return ret; |
| 98 | } | 98 | } |
| @@ -104,7 +104,7 @@ static void amba_kmi_close(struct serio *io) | |||
| 104 | writeb(0, KMICR); | 104 | writeb(0, KMICR); |
| 105 | 105 | ||
| 106 | free_irq(kmi->irq, kmi); | 106 | free_irq(kmi->irq, kmi); |
| 107 | clk_disable(kmi->clk); | 107 | clk_disable_unprepare(kmi->clk); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static int __devinit amba_kmi_probe(struct amba_device *dev, | 110 | static int __devinit amba_kmi_probe(struct amba_device *dev, |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 6918773ce024..d6cc77a53c7e 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
| @@ -335,6 +335,12 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { | |||
| 335 | }, | 335 | }, |
| 336 | { | 336 | { |
| 337 | .matches = { | 337 | .matches = { |
| 338 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 339 | DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"), | ||
| 340 | }, | ||
| 341 | }, | ||
| 342 | { | ||
| 343 | .matches = { | ||
| 338 | DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), | 344 | DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), |
| 339 | DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), | 345 | DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), |
| 340 | }, | 346 | }, |
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index b06a5e3a665e..64957770b522 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c | |||
| @@ -566,9 +566,12 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, | |||
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | read = min_t(size_t, count, tsdata->raw_bufsize - *off); | 568 | read = min_t(size_t, count, tsdata->raw_bufsize - *off); |
| 569 | error = copy_to_user(buf, tsdata->raw_buffer + *off, read); | 569 | if (copy_to_user(buf, tsdata->raw_buffer + *off, read)) { |
| 570 | if (!error) | 570 | error = -EFAULT; |
| 571 | *off += read; | 571 | goto out; |
| 572 | } | ||
| 573 | |||
| 574 | *off += read; | ||
| 572 | out: | 575 | out: |
| 573 | mutex_unlock(&tsdata->mutex); | 576 | mutex_unlock(&tsdata->mutex); |
| 574 | return error ?: read; | 577 | return error ?: read; |
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index e32709e0dd65..721fdb3597ca 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
| @@ -304,6 +304,45 @@ static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
| 304 | #define EGALAX_PKT_TYPE_REPT 0x80 | 304 | #define EGALAX_PKT_TYPE_REPT 0x80 |
| 305 | #define EGALAX_PKT_TYPE_DIAG 0x0A | 305 | #define EGALAX_PKT_TYPE_DIAG 0x0A |
| 306 | 306 | ||
| 307 | static int egalax_init(struct usbtouch_usb *usbtouch) | ||
| 308 | { | ||
| 309 | int ret, i; | ||
| 310 | unsigned char *buf; | ||
| 311 | struct usb_device *udev = interface_to_usbdev(usbtouch->interface); | ||
| 312 | |||
| 313 | /* | ||
| 314 | * An eGalax diagnostic packet kicks the device into using the right | ||
| 315 | * protocol. We send a "check active" packet. The response will be | ||
| 316 | * read later and ignored. | ||
| 317 | */ | ||
| 318 | |||
| 319 | buf = kmalloc(3, GFP_KERNEL); | ||
| 320 | if (!buf) | ||
| 321 | return -ENOMEM; | ||
| 322 | |||
| 323 | buf[0] = EGALAX_PKT_TYPE_DIAG; | ||
| 324 | buf[1] = 1; /* length */ | ||
| 325 | buf[2] = 'A'; /* command - check active */ | ||
| 326 | |||
| 327 | for (i = 0; i < 3; i++) { | ||
| 328 | ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | ||
| 329 | 0, | ||
| 330 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
| 331 | 0, 0, buf, 3, | ||
| 332 | USB_CTRL_SET_TIMEOUT); | ||
| 333 | if (ret >= 0) { | ||
| 334 | ret = 0; | ||
| 335 | break; | ||
| 336 | } | ||
| 337 | if (ret != -EPIPE) | ||
| 338 | break; | ||
| 339 | } | ||
| 340 | |||
| 341 | kfree(buf); | ||
| 342 | |||
| 343 | return ret; | ||
| 344 | } | ||
| 345 | |||
| 307 | static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | 346 | static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
| 308 | { | 347 | { |
| 309 | if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) | 348 | if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) |
| @@ -1056,6 +1095,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { | |||
| 1056 | .process_pkt = usbtouch_process_multi, | 1095 | .process_pkt = usbtouch_process_multi, |
| 1057 | .get_pkt_len = egalax_get_pkt_len, | 1096 | .get_pkt_len = egalax_get_pkt_len, |
| 1058 | .read_data = egalax_read_data, | 1097 | .read_data = egalax_read_data, |
| 1098 | .init = egalax_init, | ||
| 1059 | }, | 1099 | }, |
| 1060 | #endif | 1100 | #endif |
| 1061 | 1101 | ||
diff --git a/drivers/md/md.c b/drivers/md/md.c index 3f6203a4c7ea..308e87b417e0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -7619,6 +7619,8 @@ static int remove_and_add_spares(struct mddev *mddev) | |||
| 7619 | } | 7619 | } |
| 7620 | } | 7620 | } |
| 7621 | } | 7621 | } |
| 7622 | if (removed) | ||
| 7623 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | ||
| 7622 | return spares; | 7624 | return spares; |
| 7623 | } | 7625 | } |
| 7624 | 7626 | ||
| @@ -7632,9 +7634,11 @@ static void reap_sync_thread(struct mddev *mddev) | |||
| 7632 | !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { | 7634 | !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { |
| 7633 | /* success...*/ | 7635 | /* success...*/ |
| 7634 | /* activate any spares */ | 7636 | /* activate any spares */ |
| 7635 | if (mddev->pers->spare_active(mddev)) | 7637 | if (mddev->pers->spare_active(mddev)) { |
| 7636 | sysfs_notify(&mddev->kobj, NULL, | 7638 | sysfs_notify(&mddev->kobj, NULL, |
| 7637 | "degraded"); | 7639 | "degraded"); |
| 7640 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | ||
| 7641 | } | ||
| 7638 | } | 7642 | } |
| 7639 | if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && | 7643 | if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && |
| 7640 | mddev->pers->finish_reshape) | 7644 | mddev->pers->finish_reshape) |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index adda94df5eb2..7031b865b3a0 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
| @@ -393,6 +393,8 @@ static int calc_degraded(struct r5conf *conf) | |||
| 393 | degraded = 0; | 393 | degraded = 0; |
| 394 | for (i = 0; i < conf->previous_raid_disks; i++) { | 394 | for (i = 0; i < conf->previous_raid_disks; i++) { |
| 395 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); | 395 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); |
| 396 | if (rdev && test_bit(Faulty, &rdev->flags)) | ||
| 397 | rdev = rcu_dereference(conf->disks[i].replacement); | ||
| 396 | if (!rdev || test_bit(Faulty, &rdev->flags)) | 398 | if (!rdev || test_bit(Faulty, &rdev->flags)) |
| 397 | degraded++; | 399 | degraded++; |
| 398 | else if (test_bit(In_sync, &rdev->flags)) | 400 | else if (test_bit(In_sync, &rdev->flags)) |
| @@ -417,6 +419,8 @@ static int calc_degraded(struct r5conf *conf) | |||
| 417 | degraded2 = 0; | 419 | degraded2 = 0; |
| 418 | for (i = 0; i < conf->raid_disks; i++) { | 420 | for (i = 0; i < conf->raid_disks; i++) { |
| 419 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); | 421 | struct md_rdev *rdev = rcu_dereference(conf->disks[i].rdev); |
| 422 | if (rdev && test_bit(Faulty, &rdev->flags)) | ||
| 423 | rdev = rcu_dereference(conf->disks[i].replacement); | ||
| 420 | if (!rdev || test_bit(Faulty, &rdev->flags)) | 424 | if (!rdev || test_bit(Faulty, &rdev->flags)) |
| 421 | degraded2++; | 425 | degraded2++; |
| 422 | else if (test_bit(In_sync, &rdev->flags)) | 426 | else if (test_bit(In_sync, &rdev->flags)) |
| @@ -4192,7 +4196,7 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
| 4192 | finish_wait(&conf->wait_for_overlap, &w); | 4196 | finish_wait(&conf->wait_for_overlap, &w); |
| 4193 | set_bit(STRIPE_HANDLE, &sh->state); | 4197 | set_bit(STRIPE_HANDLE, &sh->state); |
| 4194 | clear_bit(STRIPE_DELAYED, &sh->state); | 4198 | clear_bit(STRIPE_DELAYED, &sh->state); |
| 4195 | if ((bi->bi_rw & REQ_NOIDLE) && | 4199 | if ((bi->bi_rw & REQ_SYNC) && |
| 4196 | !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) | 4200 | !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) |
| 4197 | atomic_inc(&conf->preread_active_stripes); | 4201 | atomic_inc(&conf->preread_active_stripes); |
| 4198 | release_stripe_plug(mddev, sh); | 4202 | release_stripe_plug(mddev, sh); |
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index 98ee43819911..7edadee487ba 100644 --- a/drivers/net/can/janz-ican3.c +++ b/drivers/net/can/janz-ican3.c | |||
| @@ -1391,7 +1391,6 @@ static irqreturn_t ican3_irq(int irq, void *dev_id) | |||
| 1391 | */ | 1391 | */ |
| 1392 | static int ican3_reset_module(struct ican3_dev *mod) | 1392 | static int ican3_reset_module(struct ican3_dev *mod) |
| 1393 | { | 1393 | { |
| 1394 | u8 val = 1 << mod->num; | ||
| 1395 | unsigned long start; | 1394 | unsigned long start; |
| 1396 | u8 runold, runnew; | 1395 | u8 runold, runnew; |
| 1397 | 1396 | ||
| @@ -1405,8 +1404,7 @@ static int ican3_reset_module(struct ican3_dev *mod) | |||
| 1405 | runold = ioread8(mod->dpm + TARGET_RUNNING); | 1404 | runold = ioread8(mod->dpm + TARGET_RUNNING); |
| 1406 | 1405 | ||
| 1407 | /* reset the module */ | 1406 | /* reset the module */ |
| 1408 | iowrite8(val, &mod->ctrl->reset_assert); | 1407 | iowrite8(0x00, &mod->dpmctrl->hwreset); |
| 1409 | iowrite8(val, &mod->ctrl->reset_deassert); | ||
| 1410 | 1408 | ||
| 1411 | /* wait until the module has finished resetting and is running */ | 1409 | /* wait until the module has finished resetting and is running */ |
| 1412 | start = jiffies; | 1410 | start = jiffies; |
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c index 527dbcf95335..9ded21e79db5 100644 --- a/drivers/net/can/ti_hecc.c +++ b/drivers/net/can/ti_hecc.c | |||
| @@ -984,12 +984,12 @@ static int __devexit ti_hecc_remove(struct platform_device *pdev) | |||
| 984 | struct net_device *ndev = platform_get_drvdata(pdev); | 984 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 985 | struct ti_hecc_priv *priv = netdev_priv(ndev); | 985 | struct ti_hecc_priv *priv = netdev_priv(ndev); |
| 986 | 986 | ||
| 987 | unregister_candev(ndev); | ||
| 987 | clk_disable(priv->clk); | 988 | clk_disable(priv->clk); |
| 988 | clk_put(priv->clk); | 989 | clk_put(priv->clk); |
| 989 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 990 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 990 | iounmap(priv->base); | 991 | iounmap(priv->base); |
| 991 | release_mem_region(res->start, resource_size(res)); | 992 | release_mem_region(res->start, resource_size(res)); |
| 992 | unregister_candev(ndev); | ||
| 993 | free_candev(ndev); | 993 | free_candev(ndev); |
| 994 | platform_set_drvdata(pdev, NULL); | 994 | platform_set_drvdata(pdev, NULL); |
| 995 | 995 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index af20c6ee2cd9..e8e97a7d1d06 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
| @@ -662,14 +662,16 @@ void bnx2x_csum_validate(struct sk_buff *skb, union eth_rx_cqe *cqe, | |||
| 662 | struct bnx2x_fastpath *fp, | 662 | struct bnx2x_fastpath *fp, |
| 663 | struct bnx2x_eth_q_stats *qstats) | 663 | struct bnx2x_eth_q_stats *qstats) |
| 664 | { | 664 | { |
| 665 | /* Do nothing if no IP/L4 csum validation was done */ | 665 | /* Do nothing if no L4 csum validation was done. |
| 666 | 666 | * We do not check whether IP csum was validated. For IPv4 we assume | |
| 667 | * that if the card got as far as validating the L4 csum, it also | ||
| 668 | * validated the IP csum. IPv6 has no IP csum. | ||
| 669 | */ | ||
| 667 | if (cqe->fast_path_cqe.status_flags & | 670 | if (cqe->fast_path_cqe.status_flags & |
| 668 | (ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG | | 671 | ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG) |
| 669 | ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG)) | ||
| 670 | return; | 672 | return; |
| 671 | 673 | ||
| 672 | /* If both IP/L4 validation were done, check if an error was found. */ | 674 | /* If L4 validation was done, check if an error was found. */ |
| 673 | 675 | ||
| 674 | if (cqe->fast_path_cqe.type_error_flags & | 676 | if (cqe->fast_path_cqe.type_error_flags & |
| 675 | (ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG | | 677 | (ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG | |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 211753e01f81..0875ecfe3372 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
| @@ -9831,12 +9831,13 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) | |||
| 9831 | } | 9831 | } |
| 9832 | 9832 | ||
| 9833 | #ifdef CONFIG_PCI_MSI | 9833 | #ifdef CONFIG_PCI_MSI |
| 9834 | /* | 9834 | /* Due to new PF resource allocation by MFW T7.4 and above, it's |
| 9835 | * It's expected that number of CAM entries for this functions is equal | 9835 | * optional that number of CAM entries will not be equal to the value |
| 9836 | * to the number evaluated based on the MSI-X table size. We want a | 9836 | * advertised in PCI. |
| 9837 | * harsh warning if these values are different! | 9837 | * Driver should use the minimal value of both as the actual status |
| 9838 | * block count | ||
| 9838 | */ | 9839 | */ |
| 9839 | WARN_ON(bp->igu_sb_cnt != igu_sb_cnt); | 9840 | bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt); |
| 9840 | #endif | 9841 | #endif |
| 9841 | 9842 | ||
| 9842 | if (igu_sb_cnt == 0) | 9843 | if (igu_sb_cnt == 0) |
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c index 77884191a8c6..4e980a7886fb 100644 --- a/drivers/net/ethernet/cadence/at91_ether.c +++ b/drivers/net/ethernet/cadence/at91_ether.c | |||
| @@ -1086,7 +1086,7 @@ static int __init at91ether_probe(struct platform_device *pdev) | |||
| 1086 | /* Clock */ | 1086 | /* Clock */ |
| 1087 | lp->ether_clk = clk_get(&pdev->dev, "ether_clk"); | 1087 | lp->ether_clk = clk_get(&pdev->dev, "ether_clk"); |
| 1088 | if (IS_ERR(lp->ether_clk)) { | 1088 | if (IS_ERR(lp->ether_clk)) { |
| 1089 | res = -ENODEV; | 1089 | res = PTR_ERR(lp->ether_clk); |
| 1090 | goto err_ioumap; | 1090 | goto err_ioumap; |
| 1091 | } | 1091 | } |
| 1092 | clk_enable(lp->ether_clk); | 1092 | clk_enable(lp->ether_clk); |
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 8971921cc1c8..ab6762caa957 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c | |||
| @@ -1773,6 +1773,7 @@ static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, | |||
| 1773 | } | 1773 | } |
| 1774 | 1774 | ||
| 1775 | int gfar_phc_index = -1; | 1775 | int gfar_phc_index = -1; |
| 1776 | EXPORT_SYMBOL(gfar_phc_index); | ||
| 1776 | 1777 | ||
| 1777 | static int gfar_get_ts_info(struct net_device *dev, | 1778 | static int gfar_get_ts_info(struct net_device *dev, |
| 1778 | struct ethtool_ts_info *info) | 1779 | struct ethtool_ts_info *info) |
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c index c08e5d40fecb..0daa66b8eca0 100644 --- a/drivers/net/ethernet/freescale/gianfar_ptp.c +++ b/drivers/net/ethernet/freescale/gianfar_ptp.c | |||
| @@ -515,7 +515,7 @@ static int gianfar_ptp_probe(struct platform_device *dev) | |||
| 515 | err = PTR_ERR(etsects->clock); | 515 | err = PTR_ERR(etsects->clock); |
| 516 | goto no_clock; | 516 | goto no_clock; |
| 517 | } | 517 | } |
| 518 | gfar_phc_clock = ptp_clock_index(etsects->clock); | 518 | gfar_phc_index = ptp_clock_index(etsects->clock); |
| 519 | 519 | ||
| 520 | dev_set_drvdata(&dev->dev, etsects); | 520 | dev_set_drvdata(&dev->dev, etsects); |
| 521 | 521 | ||
| @@ -539,7 +539,7 @@ static int gianfar_ptp_remove(struct platform_device *dev) | |||
| 539 | gfar_write(&etsects->regs->tmr_temask, 0); | 539 | gfar_write(&etsects->regs->tmr_temask, 0); |
| 540 | gfar_write(&etsects->regs->tmr_ctrl, 0); | 540 | gfar_write(&etsects->regs->tmr_ctrl, 0); |
| 541 | 541 | ||
| 542 | gfar_phc_clock = -1; | 542 | gfar_phc_index = -1; |
| 543 | ptp_clock_unregister(etsects->clock); | 543 | ptp_clock_unregister(etsects->clock); |
| 544 | iounmap(etsects->regs); | 544 | iounmap(etsects->regs); |
| 545 | release_resource(etsects->rsrc); | 545 | release_resource(etsects->rsrc); |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 3bfbb8df8989..bde337ee1a34 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
| @@ -3149,6 +3149,17 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
| 3149 | return NETDEV_TX_OK; | 3149 | return NETDEV_TX_OK; |
| 3150 | } | 3150 | } |
| 3151 | 3151 | ||
| 3152 | /* On PCI/PCI-X HW, if packet size is less than ETH_ZLEN, | ||
| 3153 | * packets may get corrupted during padding by HW. | ||
| 3154 | * To WA this issue, pad all small packets manually. | ||
| 3155 | */ | ||
| 3156 | if (skb->len < ETH_ZLEN) { | ||
| 3157 | if (skb_pad(skb, ETH_ZLEN - skb->len)) | ||
| 3158 | return NETDEV_TX_OK; | ||
| 3159 | skb->len = ETH_ZLEN; | ||
| 3160 | skb_set_tail_pointer(skb, ETH_ZLEN); | ||
| 3161 | } | ||
| 3162 | |||
| 3152 | mss = skb_shinfo(skb)->gso_size; | 3163 | mss = skb_shinfo(skb)->gso_size; |
| 3153 | /* The controller does a simple calculation to | 3164 | /* The controller does a simple calculation to |
| 3154 | * make sure there is enough room in the FIFO before | 3165 | * make sure there is enough room in the FIFO before |
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index 342b3a79bd0f..a77c558d8f40 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | |||
| @@ -1378,6 +1378,10 @@ static void netxen_mask_aer_correctable(struct netxen_adapter *adapter) | |||
| 1378 | struct pci_dev *root = pdev->bus->self; | 1378 | struct pci_dev *root = pdev->bus->self; |
| 1379 | u32 aer_pos; | 1379 | u32 aer_pos; |
| 1380 | 1380 | ||
| 1381 | /* root bus? */ | ||
| 1382 | if (!root) | ||
| 1383 | return; | ||
| 1384 | |||
| 1381 | if (adapter->ahw.board_type != NETXEN_BRDTYPE_P3_4_GB_MM && | 1385 | if (adapter->ahw.board_type != NETXEN_BRDTYPE_P3_4_GB_MM && |
| 1382 | adapter->ahw.board_type != NETXEN_BRDTYPE_P3_10G_TP) | 1386 | adapter->ahw.board_type != NETXEN_BRDTYPE_P3_10G_TP) |
| 1383 | return; | 1387 | return; |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index c136162e6473..3be88331d17a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
| @@ -1066,7 +1066,7 @@ static int stmmac_open(struct net_device *dev) | |||
| 1066 | } else | 1066 | } else |
| 1067 | priv->tm->enable = 1; | 1067 | priv->tm->enable = 1; |
| 1068 | #endif | 1068 | #endif |
| 1069 | clk_enable(priv->stmmac_clk); | 1069 | clk_prepare_enable(priv->stmmac_clk); |
| 1070 | 1070 | ||
| 1071 | stmmac_check_ether_addr(priv); | 1071 | stmmac_check_ether_addr(priv); |
| 1072 | 1072 | ||
| @@ -1188,7 +1188,7 @@ open_error: | |||
| 1188 | if (priv->phydev) | 1188 | if (priv->phydev) |
| 1189 | phy_disconnect(priv->phydev); | 1189 | phy_disconnect(priv->phydev); |
| 1190 | 1190 | ||
| 1191 | clk_disable(priv->stmmac_clk); | 1191 | clk_disable_unprepare(priv->stmmac_clk); |
| 1192 | 1192 | ||
| 1193 | return ret; | 1193 | return ret; |
| 1194 | } | 1194 | } |
| @@ -1246,7 +1246,7 @@ static int stmmac_release(struct net_device *dev) | |||
| 1246 | #ifdef CONFIG_STMMAC_DEBUG_FS | 1246 | #ifdef CONFIG_STMMAC_DEBUG_FS |
| 1247 | stmmac_exit_fs(); | 1247 | stmmac_exit_fs(); |
| 1248 | #endif | 1248 | #endif |
| 1249 | clk_disable(priv->stmmac_clk); | 1249 | clk_disable_unprepare(priv->stmmac_clk); |
| 1250 | 1250 | ||
| 1251 | return 0; | 1251 | return 0; |
| 1252 | } | 1252 | } |
| @@ -2178,7 +2178,7 @@ int stmmac_suspend(struct net_device *ndev) | |||
| 2178 | else { | 2178 | else { |
| 2179 | stmmac_set_mac(priv->ioaddr, false); | 2179 | stmmac_set_mac(priv->ioaddr, false); |
| 2180 | /* Disable clock in case of PWM is off */ | 2180 | /* Disable clock in case of PWM is off */ |
| 2181 | clk_disable(priv->stmmac_clk); | 2181 | clk_disable_unprepare(priv->stmmac_clk); |
| 2182 | } | 2182 | } |
| 2183 | spin_unlock_irqrestore(&priv->lock, flags); | 2183 | spin_unlock_irqrestore(&priv->lock, flags); |
| 2184 | return 0; | 2184 | return 0; |
| @@ -2203,7 +2203,7 @@ int stmmac_resume(struct net_device *ndev) | |||
| 2203 | priv->hw->mac->pmt(priv->ioaddr, 0); | 2203 | priv->hw->mac->pmt(priv->ioaddr, 0); |
| 2204 | else | 2204 | else |
| 2205 | /* enable the clk prevously disabled */ | 2205 | /* enable the clk prevously disabled */ |
| 2206 | clk_enable(priv->stmmac_clk); | 2206 | clk_prepare_enable(priv->stmmac_clk); |
| 2207 | 2207 | ||
| 2208 | netif_device_attach(ndev); | 2208 | netif_device_attach(ndev); |
| 2209 | 2209 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c index 2a0e1abde7e7..4ccd4e2977b7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c | |||
| @@ -97,19 +97,19 @@ static struct clk *timer_clock; | |||
| 97 | static void stmmac_tmu_start(unsigned int new_freq) | 97 | static void stmmac_tmu_start(unsigned int new_freq) |
| 98 | { | 98 | { |
| 99 | clk_set_rate(timer_clock, new_freq); | 99 | clk_set_rate(timer_clock, new_freq); |
| 100 | clk_enable(timer_clock); | 100 | clk_prepare_enable(timer_clock); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | static void stmmac_tmu_stop(void) | 103 | static void stmmac_tmu_stop(void) |
| 104 | { | 104 | { |
| 105 | clk_disable(timer_clock); | 105 | clk_disable_unprepare(timer_clock); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) | 108 | int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) |
| 109 | { | 109 | { |
| 110 | timer_clock = clk_get(NULL, TMU_CHANNEL); | 110 | timer_clock = clk_get(NULL, TMU_CHANNEL); |
| 111 | 111 | ||
| 112 | if (timer_clock == NULL) | 112 | if (IS_ERR(timer_clock)) |
| 113 | return -1; | 113 | return -1; |
| 114 | 114 | ||
| 115 | if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) { | 115 | if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) { |
| @@ -126,7 +126,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) | |||
| 126 | 126 | ||
| 127 | int stmmac_close_ext_timer(void) | 127 | int stmmac_close_ext_timer(void) |
| 128 | { | 128 | { |
| 129 | clk_disable(timer_clock); | 129 | clk_disable_unprepare(timer_clock); |
| 130 | tmu2_unregister_user(); | 130 | tmu2_unregister_user(); |
| 131 | clk_put(timer_clock); | 131 | clk_put(timer_clock); |
| 132 | return 0; | 132 | return 0; |
diff --git a/drivers/net/irda/sh_sir.c b/drivers/net/irda/sh_sir.c index 256eddf1f75a..795109425568 100644 --- a/drivers/net/irda/sh_sir.c +++ b/drivers/net/irda/sh_sir.c | |||
| @@ -280,7 +280,7 @@ static int sh_sir_set_baudrate(struct sh_sir_self *self, u32 baudrate) | |||
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | clk = clk_get(NULL, "irda_clk"); | 282 | clk = clk_get(NULL, "irda_clk"); |
| 283 | if (!clk) { | 283 | if (IS_ERR(clk)) { |
| 284 | dev_err(dev, "can not get irda_clk\n"); | 284 | dev_err(dev, "can not get irda_clk\n"); |
| 285 | return -EIO; | 285 | return -EIO; |
| 286 | } | 286 | } |
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index 4fd48df6b989..32e31c5c5dc6 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c | |||
| @@ -962,6 +962,10 @@ static const struct usb_device_id products [] = { | |||
| 962 | USB_DEVICE (0x2001, 0x3c05), | 962 | USB_DEVICE (0x2001, 0x3c05), |
| 963 | .driver_info = (unsigned long) &ax88772_info, | 963 | .driver_info = (unsigned long) &ax88772_info, |
| 964 | }, { | 964 | }, { |
| 965 | // DLink DUB-E100 H/W Ver C1 | ||
| 966 | USB_DEVICE (0x2001, 0x1a02), | ||
| 967 | .driver_info = (unsigned long) &ax88772_info, | ||
| 968 | }, { | ||
| 965 | // Linksys USB1000 | 969 | // Linksys USB1000 |
| 966 | USB_DEVICE (0x1737, 0x0039), | 970 | USB_DEVICE (0x1737, 0x0039), |
| 967 | .driver_info = (unsigned long) &ax88178_info, | 971 | .driver_info = (unsigned long) &ax88178_info, |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b1ba68f1a049..3543c9e57824 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -366,16 +366,20 @@ static const struct usb_device_id products[] = { | |||
| 366 | }, | 366 | }, |
| 367 | 367 | ||
| 368 | /* 2. Combined interface devices matching on class+protocol */ | 368 | /* 2. Combined interface devices matching on class+protocol */ |
| 369 | { /* Huawei E367 and possibly others in "Windows mode" */ | ||
| 370 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 7), | ||
| 371 | .driver_info = (unsigned long)&qmi_wwan_info, | ||
| 372 | }, | ||
| 369 | { /* Huawei E392, E398 and possibly others in "Windows mode" */ | 373 | { /* Huawei E392, E398 and possibly others in "Windows mode" */ |
| 370 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17), | 374 | USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17), |
| 371 | .driver_info = (unsigned long)&qmi_wwan_shared, | 375 | .driver_info = (unsigned long)&qmi_wwan_shared, |
| 372 | }, | 376 | }, |
| 373 | { /* Pantech UML290 */ | 377 | { /* Pantech UML290, P4200 and more */ |
| 374 | USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff), | 378 | USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff), |
| 375 | .driver_info = (unsigned long)&qmi_wwan_shared, | 379 | .driver_info = (unsigned long)&qmi_wwan_shared, |
| 376 | }, | 380 | }, |
| 377 | { /* Pantech UML290 - newer firmware */ | 381 | { /* Pantech UML290 - newer firmware */ |
| 378 | USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff), | 382 | USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff), |
| 379 | .driver_info = (unsigned long)&qmi_wwan_shared, | 383 | .driver_info = (unsigned long)&qmi_wwan_shared, |
| 380 | }, | 384 | }, |
| 381 | 385 | ||
| @@ -383,6 +387,7 @@ static const struct usb_device_id products[] = { | |||
| 383 | {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */ | 387 | {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */ |
| 384 | {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */ | 388 | {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */ |
| 385 | {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */ | 389 | {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */ |
| 390 | {QMI_FIXED_INTF(0x19d2, 0x0157, 5)}, /* ZTE MF683 */ | ||
| 386 | {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */ | 391 | {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */ |
| 387 | {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */ | 392 | {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */ |
| 388 | {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */ | 393 | {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */ |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 2588848f4a82..d066f2516e47 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
| @@ -2982,6 +2982,10 @@ static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah, | |||
| 2982 | case EEP_RX_MASK: | 2982 | case EEP_RX_MASK: |
| 2983 | return pBase->txrxMask & 0xf; | 2983 | return pBase->txrxMask & 0xf; |
| 2984 | case EEP_PAPRD: | 2984 | case EEP_PAPRD: |
| 2985 | if (AR_SREV_9462(ah)) | ||
| 2986 | return false; | ||
| 2987 | if (!ah->config.enable_paprd); | ||
| 2988 | return false; | ||
| 2985 | return !!(pBase->featureEnable & BIT(5)); | 2989 | return !!(pBase->featureEnable & BIT(5)); |
| 2986 | case EEP_CHAIN_MASK_REDUCE: | 2990 | case EEP_CHAIN_MASK_REDUCE: |
| 2987 | return (pBase->miscConfiguration >> 0x3) & 0x1; | 2991 | return (pBase->miscConfiguration >> 0x3) & 0x1; |
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 68b643c8943c..c8ef30127adb 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
| @@ -1577,6 +1577,8 @@ int ath9k_init_debug(struct ath_hw *ah) | |||
| 1577 | sc->debug.debugfs_phy, sc, &fops_tx_chainmask); | 1577 | sc->debug.debugfs_phy, sc, &fops_tx_chainmask); |
| 1578 | debugfs_create_file("disable_ani", S_IRUSR | S_IWUSR, | 1578 | debugfs_create_file("disable_ani", S_IRUSR | S_IWUSR, |
| 1579 | sc->debug.debugfs_phy, sc, &fops_disable_ani); | 1579 | sc->debug.debugfs_phy, sc, &fops_disable_ani); |
| 1580 | debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | ||
| 1581 | &sc->sc_ah->config.enable_paprd); | ||
| 1580 | debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | 1582 | debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, |
| 1581 | sc, &fops_regidx); | 1583 | sc, &fops_regidx); |
| 1582 | debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | 1584 | debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 48af40151d23..4faf0a395876 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
| @@ -2497,10 +2497,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
| 2497 | pCap->rx_status_len = sizeof(struct ar9003_rxs); | 2497 | pCap->rx_status_len = sizeof(struct ar9003_rxs); |
| 2498 | pCap->tx_desc_len = sizeof(struct ar9003_txc); | 2498 | pCap->tx_desc_len = sizeof(struct ar9003_txc); |
| 2499 | pCap->txs_len = sizeof(struct ar9003_txs); | 2499 | pCap->txs_len = sizeof(struct ar9003_txs); |
| 2500 | if (!ah->config.paprd_disable && | ||
| 2501 | ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && | ||
| 2502 | !AR_SREV_9462(ah)) | ||
| 2503 | pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; | ||
| 2504 | } else { | 2500 | } else { |
| 2505 | pCap->tx_desc_len = sizeof(struct ath_desc); | 2501 | pCap->tx_desc_len = sizeof(struct ath_desc); |
| 2506 | if (AR_SREV_9280_20(ah)) | 2502 | if (AR_SREV_9280_20(ah)) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 6599a75f01fe..de6968fc64f4 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
| @@ -236,7 +236,6 @@ enum ath9k_hw_caps { | |||
| 236 | ATH9K_HW_CAP_LDPC = BIT(6), | 236 | ATH9K_HW_CAP_LDPC = BIT(6), |
| 237 | ATH9K_HW_CAP_FASTCLOCK = BIT(7), | 237 | ATH9K_HW_CAP_FASTCLOCK = BIT(7), |
| 238 | ATH9K_HW_CAP_SGI_20 = BIT(8), | 238 | ATH9K_HW_CAP_SGI_20 = BIT(8), |
| 239 | ATH9K_HW_CAP_PAPRD = BIT(9), | ||
| 240 | ATH9K_HW_CAP_ANT_DIV_COMB = BIT(10), | 239 | ATH9K_HW_CAP_ANT_DIV_COMB = BIT(10), |
| 241 | ATH9K_HW_CAP_2GHZ = BIT(11), | 240 | ATH9K_HW_CAP_2GHZ = BIT(11), |
| 242 | ATH9K_HW_CAP_5GHZ = BIT(12), | 241 | ATH9K_HW_CAP_5GHZ = BIT(12), |
| @@ -287,12 +286,12 @@ struct ath9k_ops_config { | |||
| 287 | u8 pcie_clock_req; | 286 | u8 pcie_clock_req; |
| 288 | u32 pcie_waen; | 287 | u32 pcie_waen; |
| 289 | u8 analog_shiftreg; | 288 | u8 analog_shiftreg; |
| 290 | u8 paprd_disable; | ||
| 291 | u32 ofdm_trig_low; | 289 | u32 ofdm_trig_low; |
| 292 | u32 ofdm_trig_high; | 290 | u32 ofdm_trig_high; |
| 293 | u32 cck_trig_high; | 291 | u32 cck_trig_high; |
| 294 | u32 cck_trig_low; | 292 | u32 cck_trig_low; |
| 295 | u32 enable_ani; | 293 | u32 enable_ani; |
| 294 | u32 enable_paprd; | ||
| 296 | int serialize_regmode; | 295 | int serialize_regmode; |
| 297 | bool rx_intr_mitigation; | 296 | bool rx_intr_mitigation; |
| 298 | bool tx_intr_mitigation; | 297 | bool tx_intr_mitigation; |
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c index 825a29cc9313..7b88b9c39ccd 100644 --- a/drivers/net/wireless/ath/ath9k/link.c +++ b/drivers/net/wireless/ath/ath9k/link.c | |||
| @@ -423,7 +423,7 @@ set_timer: | |||
| 423 | cal_interval = min(cal_interval, (u32)short_cal_interval); | 423 | cal_interval = min(cal_interval, (u32)short_cal_interval); |
| 424 | 424 | ||
| 425 | mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); | 425 | mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); |
| 426 | if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_PAPRD) && ah->caldata) { | 426 | if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && ah->caldata) { |
| 427 | if (!ah->caldata->paprd_done) | 427 | if (!ah->caldata->paprd_done) |
| 428 | ieee80211_queue_work(sc->hw, &sc->paprd_work); | 428 | ieee80211_queue_work(sc->hw, &sc->paprd_work); |
| 429 | else if (!ah->paprd_table_write_done) | 429 | else if (!ah->paprd_table_write_done) |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 49765d34b4e0..7c4ee72f9d56 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | |||
| @@ -638,6 +638,8 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev) | |||
| 638 | 638 | ||
| 639 | oobirq_entry = kzalloc(sizeof(struct brcmf_sdio_oobirq), | 639 | oobirq_entry = kzalloc(sizeof(struct brcmf_sdio_oobirq), |
| 640 | GFP_KERNEL); | 640 | GFP_KERNEL); |
| 641 | if (!oobirq_entry) | ||
| 642 | return -ENOMEM; | ||
| 641 | oobirq_entry->irq = res->start; | 643 | oobirq_entry->irq = res->start; |
| 642 | oobirq_entry->flags = res->flags & IRQF_TRIGGER_MASK; | 644 | oobirq_entry->flags = res->flags & IRQF_TRIGGER_MASK; |
| 643 | list_add_tail(&oobirq_entry->list, &oobirq_lh); | 645 | list_add_tail(&oobirq_entry->list, &oobirq_lh); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c index 2621dd3d7dcd..6f70953f0bad 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | |||
| @@ -764,8 +764,11 @@ static void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode) | |||
| 764 | { | 764 | { |
| 765 | char iovbuf[32]; | 765 | char iovbuf[32]; |
| 766 | int retcode; | 766 | int retcode; |
| 767 | __le32 arp_mode_le; | ||
| 767 | 768 | ||
| 768 | brcmf_c_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf)); | 769 | arp_mode_le = cpu_to_le32(arp_mode); |
| 770 | brcmf_c_mkiovar("arp_ol", (char *)&arp_mode_le, 4, iovbuf, | ||
| 771 | sizeof(iovbuf)); | ||
| 769 | retcode = brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, | 772 | retcode = brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, |
| 770 | iovbuf, sizeof(iovbuf)); | 773 | iovbuf, sizeof(iovbuf)); |
| 771 | retcode = retcode >= 0 ? 0 : retcode; | 774 | retcode = retcode >= 0 ? 0 : retcode; |
| @@ -781,8 +784,11 @@ static void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable) | |||
| 781 | { | 784 | { |
| 782 | char iovbuf[32]; | 785 | char iovbuf[32]; |
| 783 | int retcode; | 786 | int retcode; |
| 787 | __le32 arp_enable_le; | ||
| 784 | 788 | ||
| 785 | brcmf_c_mkiovar("arpoe", (char *)&arp_enable, 4, | 789 | arp_enable_le = cpu_to_le32(arp_enable); |
| 790 | |||
| 791 | brcmf_c_mkiovar("arpoe", (char *)&arp_enable_le, 4, | ||
| 786 | iovbuf, sizeof(iovbuf)); | 792 | iovbuf, sizeof(iovbuf)); |
| 787 | retcode = brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, | 793 | retcode = brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, |
| 788 | iovbuf, sizeof(iovbuf)); | 794 | iovbuf, sizeof(iovbuf)); |
| @@ -800,10 +806,10 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr) | |||
| 800 | char iovbuf[BRCMF_EVENTING_MASK_LEN + 12]; /* Room for | 806 | char iovbuf[BRCMF_EVENTING_MASK_LEN + 12]; /* Room for |
| 801 | "event_msgs" + '\0' + bitvec */ | 807 | "event_msgs" + '\0' + bitvec */ |
| 802 | char buf[128], *ptr; | 808 | char buf[128], *ptr; |
| 803 | u32 roaming = 1; | 809 | __le32 roaming_le = cpu_to_le32(1); |
| 804 | uint bcn_timeout = 3; | 810 | __le32 bcn_timeout_le = cpu_to_le32(3); |
| 805 | int scan_assoc_time = 40; | 811 | __le32 scan_assoc_time_le = cpu_to_le32(40); |
| 806 | int scan_unassoc_time = 40; | 812 | __le32 scan_unassoc_time_le = cpu_to_le32(40); |
| 807 | int i; | 813 | int i; |
| 808 | struct brcmf_bus_dcmd *cmdlst; | 814 | struct brcmf_bus_dcmd *cmdlst; |
| 809 | struct list_head *cur, *q; | 815 | struct list_head *cur, *q; |
| @@ -829,14 +835,14 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr) | |||
| 829 | 835 | ||
| 830 | /* Setup timeout if Beacons are lost and roam is off to report | 836 | /* Setup timeout if Beacons are lost and roam is off to report |
| 831 | link down */ | 837 | link down */ |
| 832 | brcmf_c_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, | 838 | brcmf_c_mkiovar("bcn_timeout", (char *)&bcn_timeout_le, 4, iovbuf, |
| 833 | sizeof(iovbuf)); | 839 | sizeof(iovbuf)); |
| 834 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, iovbuf, | 840 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, iovbuf, |
| 835 | sizeof(iovbuf)); | 841 | sizeof(iovbuf)); |
| 836 | 842 | ||
| 837 | /* Enable/Disable build-in roaming to allowed ext supplicant to take | 843 | /* Enable/Disable build-in roaming to allowed ext supplicant to take |
| 838 | of romaing */ | 844 | of romaing */ |
| 839 | brcmf_c_mkiovar("roam_off", (char *)&roaming, 4, | 845 | brcmf_c_mkiovar("roam_off", (char *)&roaming_le, 4, |
| 840 | iovbuf, sizeof(iovbuf)); | 846 | iovbuf, sizeof(iovbuf)); |
| 841 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, iovbuf, | 847 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR, iovbuf, |
| 842 | sizeof(iovbuf)); | 848 | sizeof(iovbuf)); |
| @@ -848,9 +854,9 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr) | |||
| 848 | sizeof(iovbuf)); | 854 | sizeof(iovbuf)); |
| 849 | 855 | ||
| 850 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME, | 856 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME, |
| 851 | (char *)&scan_assoc_time, sizeof(scan_assoc_time)); | 857 | (char *)&scan_assoc_time_le, sizeof(scan_assoc_time_le)); |
| 852 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME, | 858 | brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME, |
| 853 | (char *)&scan_unassoc_time, sizeof(scan_unassoc_time)); | 859 | (char *)&scan_unassoc_time_le, sizeof(scan_unassoc_time_le)); |
| 854 | 860 | ||
| 855 | /* Set and enable ARP offload feature */ | 861 | /* Set and enable ARP offload feature */ |
| 856 | brcmf_c_arp_offload_set(drvr, BRCMF_ARPOL_MODE); | 862 | brcmf_c_arp_offload_set(drvr, BRCMF_ARPOL_MODE); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index c36e92312443..50b5553b6964 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
| @@ -500,8 +500,10 @@ static void wl_iscan_prep(struct brcmf_scan_params_le *params_le, | |||
| 500 | params_le->active_time = cpu_to_le32(-1); | 500 | params_le->active_time = cpu_to_le32(-1); |
| 501 | params_le->passive_time = cpu_to_le32(-1); | 501 | params_le->passive_time = cpu_to_le32(-1); |
| 502 | params_le->home_time = cpu_to_le32(-1); | 502 | params_le->home_time = cpu_to_le32(-1); |
| 503 | if (ssid && ssid->SSID_len) | 503 | if (ssid && ssid->SSID_len) { |
| 504 | memcpy(¶ms_le->ssid_le, ssid, sizeof(struct brcmf_ssid)); | 504 | params_le->ssid_le.SSID_len = cpu_to_le32(ssid->SSID_len); |
| 505 | memcpy(¶ms_le->ssid_le.SSID, ssid->SSID, ssid->SSID_len); | ||
| 506 | } | ||
| 505 | } | 507 | } |
| 506 | 508 | ||
| 507 | static s32 | 509 | static s32 |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c index 7ed7d7577024..64a48f06d68b 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c | |||
| @@ -77,7 +77,7 @@ | |||
| 77 | NL80211_RRF_NO_IBSS) | 77 | NL80211_RRF_NO_IBSS) |
| 78 | 78 | ||
| 79 | static const struct ieee80211_regdomain brcms_regdom_x2 = { | 79 | static const struct ieee80211_regdomain brcms_regdom_x2 = { |
| 80 | .n_reg_rules = 7, | 80 | .n_reg_rules = 6, |
| 81 | .alpha2 = "X2", | 81 | .alpha2 = "X2", |
| 82 | .reg_rules = { | 82 | .reg_rules = { |
| 83 | BRCM_2GHZ_2412_2462, | 83 | BRCM_2GHZ_2412_2462, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h index 04c3aef8a4f6..2925094b2d91 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h | |||
| @@ -117,6 +117,7 @@ | |||
| 117 | 117 | ||
| 118 | #define CHIP_VER_B BIT(4) | 118 | #define CHIP_VER_B BIT(4) |
| 119 | #define CHIP_92C_BITMASK BIT(0) | 119 | #define CHIP_92C_BITMASK BIT(0) |
| 120 | #define CHIP_UNKNOWN BIT(7) | ||
| 120 | #define CHIP_92C_1T2R 0x03 | 121 | #define CHIP_92C_1T2R 0x03 |
| 121 | #define CHIP_92C 0x01 | 122 | #define CHIP_92C 0x01 |
| 122 | #define CHIP_88C 0x00 | 123 | #define CHIP_88C 0x00 |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c index bd0da7ef290b..dd4bb0950a57 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | |||
| @@ -994,8 +994,16 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw) | |||
| 994 | version = (value32 & TYPE_ID) ? VERSION_A_CHIP_92C : | 994 | version = (value32 & TYPE_ID) ? VERSION_A_CHIP_92C : |
| 995 | VERSION_A_CHIP_88C; | 995 | VERSION_A_CHIP_88C; |
| 996 | } else { | 996 | } else { |
| 997 | version = (value32 & TYPE_ID) ? VERSION_B_CHIP_92C : | 997 | version = (enum version_8192c) (CHIP_VER_B | |
| 998 | VERSION_B_CHIP_88C; | 998 | ((value32 & TYPE_ID) ? CHIP_92C_BITMASK : 0) | |
| 999 | ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : 0)); | ||
| 1000 | if ((!IS_CHIP_VENDOR_UMC(version)) && (value32 & | ||
| 1001 | CHIP_VER_RTL_MASK)) { | ||
| 1002 | version = (enum version_8192c)(version | | ||
| 1003 | ((((value32 & CHIP_VER_RTL_MASK) == BIT(12)) | ||
| 1004 | ? CHIP_VENDOR_UMC_B_CUT : CHIP_UNKNOWN) | | ||
| 1005 | CHIP_VENDOR_UMC)); | ||
| 1006 | } | ||
| 999 | } | 1007 | } |
| 1000 | 1008 | ||
| 1001 | switch (version) { | 1009 | switch (version) { |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c index 3aa927f8b9b9..7d8f96405f42 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | |||
| @@ -162,10 +162,12 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw) | |||
| 162 | 162 | ||
| 163 | /* request fw */ | 163 | /* request fw */ |
| 164 | if (IS_VENDOR_UMC_A_CUT(rtlhal->version) && | 164 | if (IS_VENDOR_UMC_A_CUT(rtlhal->version) && |
| 165 | !IS_92C_SERIAL(rtlhal->version)) | 165 | !IS_92C_SERIAL(rtlhal->version)) { |
| 166 | rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU.bin"; | 166 | rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU.bin"; |
| 167 | else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version)) | 167 | } else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version)) { |
| 168 | rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU_B.bin"; | 168 | rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU_B.bin"; |
| 169 | pr_info("****** This B_CUT device may not work with kernels 3.6 and earlier\n"); | ||
| 170 | } | ||
| 169 | 171 | ||
| 170 | rtlpriv->max_fw_size = 0x4000; | 172 | rtlpriv->max_fw_size = 0x4000; |
| 171 | pr_info("Using firmware %s\n", rtlpriv->cfg->fw_name); | 173 | pr_info("Using firmware %s\n", rtlpriv->cfg->fw_name); |
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 590cfafc7c17..1859f71372e2 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c | |||
| @@ -1008,8 +1008,8 @@ static int rpmsg_probe(struct virtio_device *vdev) | |||
| 1008 | return 0; | 1008 | return 0; |
| 1009 | 1009 | ||
| 1010 | free_coherent: | 1010 | free_coherent: |
| 1011 | dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, bufs_va, | 1011 | dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE, |
| 1012 | vrp->bufs_dma); | 1012 | bufs_va, vrp->bufs_dma); |
| 1013 | vqs_del: | 1013 | vqs_del: |
| 1014 | vdev->config->del_vqs(vrp->vdev); | 1014 | vdev->config->del_vqs(vrp->vdev); |
| 1015 | free_vrp: | 1015 | free_vrp: |
| @@ -1043,7 +1043,7 @@ static void __devexit rpmsg_remove(struct virtio_device *vdev) | |||
| 1043 | 1043 | ||
| 1044 | vdev->config->del_vqs(vrp->vdev); | 1044 | vdev->config->del_vqs(vrp->vdev); |
| 1045 | 1045 | ||
| 1046 | dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, | 1046 | dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE, |
| 1047 | vrp->rbufs, vrp->bufs_dma); | 1047 | vrp->rbufs, vrp->bufs_dma); |
| 1048 | 1048 | ||
| 1049 | kfree(vrp); | 1049 | kfree(vrp); |
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 15370a2c5ff0..0595c763dafd 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
| @@ -534,11 +534,11 @@ static void dasd_change_state(struct dasd_device *device) | |||
| 534 | if (rc) | 534 | if (rc) |
| 535 | device->target = device->state; | 535 | device->target = device->state; |
| 536 | 536 | ||
| 537 | if (device->state == device->target) | ||
| 538 | wake_up(&dasd_init_waitq); | ||
| 539 | |||
| 540 | /* let user-space know that the device status changed */ | 537 | /* let user-space know that the device status changed */ |
| 541 | kobject_uevent(&device->cdev->dev.kobj, KOBJ_CHANGE); | 538 | kobject_uevent(&device->cdev->dev.kobj, KOBJ_CHANGE); |
| 539 | |||
| 540 | if (device->state == device->target) | ||
| 541 | wake_up(&dasd_init_waitq); | ||
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | /* | 544 | /* |
| @@ -2157,6 +2157,7 @@ static int _dasd_sleep_on(struct dasd_ccw_req *maincqr, int interruptible) | |||
| 2157 | test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && | 2157 | test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && |
| 2158 | (!dasd_eer_enabled(device))) { | 2158 | (!dasd_eer_enabled(device))) { |
| 2159 | cqr->status = DASD_CQR_FAILED; | 2159 | cqr->status = DASD_CQR_FAILED; |
| 2160 | cqr->intrc = -EAGAIN; | ||
| 2160 | continue; | 2161 | continue; |
| 2161 | } | 2162 | } |
| 2162 | /* Don't try to start requests if device is stopped */ | 2163 | /* Don't try to start requests if device is stopped */ |
| @@ -3270,6 +3271,16 @@ void dasd_generic_path_event(struct ccw_device *cdev, int *path_event) | |||
| 3270 | dasd_schedule_device_bh(device); | 3271 | dasd_schedule_device_bh(device); |
| 3271 | } | 3272 | } |
| 3272 | if (path_event[chp] & PE_PATHGROUP_ESTABLISHED) { | 3273 | if (path_event[chp] & PE_PATHGROUP_ESTABLISHED) { |
| 3274 | if (!(device->path_data.opm & eventlpm) && | ||
| 3275 | !(device->path_data.tbvpm & eventlpm)) { | ||
| 3276 | /* | ||
| 3277 | * we can not establish a pathgroup on an | ||
| 3278 | * unavailable path, so trigger a path | ||
| 3279 | * verification first | ||
| 3280 | */ | ||
| 3281 | device->path_data.tbvpm |= eventlpm; | ||
| 3282 | dasd_schedule_device_bh(device); | ||
| 3283 | } | ||
| 3273 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", | 3284 | DBF_DEV_EVENT(DBF_WARNING, device, "%s", |
| 3274 | "Pathgroup re-established\n"); | 3285 | "Pathgroup re-established\n"); |
| 3275 | if (device->discipline->kick_validate) | 3286 | if (device->discipline->kick_validate) |
diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index 157defe5e069..6b556995bb33 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c | |||
| @@ -384,6 +384,29 @@ static void _remove_device_from_lcu(struct alias_lcu *lcu, | |||
| 384 | group->next = NULL; | 384 | group->next = NULL; |
| 385 | }; | 385 | }; |
| 386 | 386 | ||
| 387 | static int | ||
| 388 | suborder_not_supported(struct dasd_ccw_req *cqr) | ||
| 389 | { | ||
| 390 | char *sense; | ||
| 391 | char reason; | ||
| 392 | char msg_format; | ||
| 393 | char msg_no; | ||
| 394 | |||
| 395 | sense = dasd_get_sense(&cqr->irb); | ||
| 396 | if (!sense) | ||
| 397 | return 0; | ||
| 398 | |||
| 399 | reason = sense[0]; | ||
| 400 | msg_format = (sense[7] & 0xF0); | ||
| 401 | msg_no = (sense[7] & 0x0F); | ||
| 402 | |||
| 403 | /* command reject, Format 0 MSG 4 - invalid parameter */ | ||
| 404 | if ((reason == 0x80) && (msg_format == 0x00) && (msg_no == 0x04)) | ||
| 405 | return 1; | ||
| 406 | |||
| 407 | return 0; | ||
| 408 | } | ||
| 409 | |||
| 387 | static int read_unit_address_configuration(struct dasd_device *device, | 410 | static int read_unit_address_configuration(struct dasd_device *device, |
| 388 | struct alias_lcu *lcu) | 411 | struct alias_lcu *lcu) |
| 389 | { | 412 | { |
| @@ -435,6 +458,8 @@ static int read_unit_address_configuration(struct dasd_device *device, | |||
| 435 | 458 | ||
| 436 | do { | 459 | do { |
| 437 | rc = dasd_sleep_on(cqr); | 460 | rc = dasd_sleep_on(cqr); |
| 461 | if (rc && suborder_not_supported(cqr)) | ||
| 462 | return -EOPNOTSUPP; | ||
| 438 | } while (rc && (cqr->retries > 0)); | 463 | } while (rc && (cqr->retries > 0)); |
| 439 | if (rc) { | 464 | if (rc) { |
| 440 | spin_lock_irqsave(&lcu->lock, flags); | 465 | spin_lock_irqsave(&lcu->lock, flags); |
| @@ -521,7 +546,7 @@ static void lcu_update_work(struct work_struct *work) | |||
| 521 | * processing the data | 546 | * processing the data |
| 522 | */ | 547 | */ |
| 523 | spin_lock_irqsave(&lcu->lock, flags); | 548 | spin_lock_irqsave(&lcu->lock, flags); |
| 524 | if (rc || (lcu->flags & NEED_UAC_UPDATE)) { | 549 | if ((rc && (rc != -EOPNOTSUPP)) || (lcu->flags & NEED_UAC_UPDATE)) { |
| 525 | DBF_DEV_EVENT(DBF_WARNING, device, "could not update" | 550 | DBF_DEV_EVENT(DBF_WARNING, device, "could not update" |
| 526 | " alias data in lcu (rc = %d), retry later", rc); | 551 | " alias data in lcu (rc = %d), retry later", rc); |
| 527 | schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ); | 552 | schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ); |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 2fb2b9ea97ec..c48c72abbefc 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
| @@ -1507,7 +1507,8 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device, | |||
| 1507 | * call might change behaviour of DASD devices. | 1507 | * call might change behaviour of DASD devices. |
| 1508 | */ | 1508 | */ |
| 1509 | static int | 1509 | static int |
| 1510 | dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav) | 1510 | dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav, |
| 1511 | unsigned long flags) | ||
| 1511 | { | 1512 | { |
| 1512 | struct dasd_ccw_req *cqr; | 1513 | struct dasd_ccw_req *cqr; |
| 1513 | int rc; | 1514 | int rc; |
| @@ -1516,10 +1517,19 @@ dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav) | |||
| 1516 | if (IS_ERR(cqr)) | 1517 | if (IS_ERR(cqr)) |
| 1517 | return PTR_ERR(cqr); | 1518 | return PTR_ERR(cqr); |
| 1518 | 1519 | ||
| 1520 | /* | ||
| 1521 | * set flags e.g. turn on failfast, to prevent blocking | ||
| 1522 | * the calling function should handle failed requests | ||
| 1523 | */ | ||
| 1524 | cqr->flags |= flags; | ||
| 1525 | |||
| 1519 | rc = dasd_sleep_on(cqr); | 1526 | rc = dasd_sleep_on(cqr); |
| 1520 | if (!rc) | 1527 | if (!rc) |
| 1521 | /* trigger CIO to reprobe devices */ | 1528 | /* trigger CIO to reprobe devices */ |
| 1522 | css_schedule_reprobe(); | 1529 | css_schedule_reprobe(); |
| 1530 | else if (cqr->intrc == -EAGAIN) | ||
| 1531 | rc = -EAGAIN; | ||
| 1532 | |||
| 1523 | dasd_sfree_request(cqr, cqr->memdev); | 1533 | dasd_sfree_request(cqr, cqr->memdev); |
| 1524 | return rc; | 1534 | return rc; |
| 1525 | } | 1535 | } |
| @@ -1527,7 +1537,8 @@ dasd_eckd_psf_ssc(struct dasd_device *device, int enable_pav) | |||
| 1527 | /* | 1537 | /* |
| 1528 | * Valide storage server of current device. | 1538 | * Valide storage server of current device. |
| 1529 | */ | 1539 | */ |
| 1530 | static void dasd_eckd_validate_server(struct dasd_device *device) | 1540 | static int dasd_eckd_validate_server(struct dasd_device *device, |
| 1541 | unsigned long flags) | ||
| 1531 | { | 1542 | { |
| 1532 | int rc; | 1543 | int rc; |
| 1533 | struct dasd_eckd_private *private; | 1544 | struct dasd_eckd_private *private; |
| @@ -1536,17 +1547,18 @@ static void dasd_eckd_validate_server(struct dasd_device *device) | |||
| 1536 | private = (struct dasd_eckd_private *) device->private; | 1547 | private = (struct dasd_eckd_private *) device->private; |
| 1537 | if (private->uid.type == UA_BASE_PAV_ALIAS || | 1548 | if (private->uid.type == UA_BASE_PAV_ALIAS || |
| 1538 | private->uid.type == UA_HYPER_PAV_ALIAS) | 1549 | private->uid.type == UA_HYPER_PAV_ALIAS) |
| 1539 | return; | 1550 | return 0; |
| 1540 | if (dasd_nopav || MACHINE_IS_VM) | 1551 | if (dasd_nopav || MACHINE_IS_VM) |
| 1541 | enable_pav = 0; | 1552 | enable_pav = 0; |
| 1542 | else | 1553 | else |
| 1543 | enable_pav = 1; | 1554 | enable_pav = 1; |
| 1544 | rc = dasd_eckd_psf_ssc(device, enable_pav); | 1555 | rc = dasd_eckd_psf_ssc(device, enable_pav, flags); |
| 1545 | 1556 | ||
| 1546 | /* may be requested feature is not available on server, | 1557 | /* may be requested feature is not available on server, |
| 1547 | * therefore just report error and go ahead */ | 1558 | * therefore just report error and go ahead */ |
| 1548 | DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "PSF-SSC for SSID %04x " | 1559 | DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "PSF-SSC for SSID %04x " |
| 1549 | "returned rc=%d", private->uid.ssid, rc); | 1560 | "returned rc=%d", private->uid.ssid, rc); |
| 1561 | return rc; | ||
| 1550 | } | 1562 | } |
| 1551 | 1563 | ||
| 1552 | /* | 1564 | /* |
| @@ -1556,7 +1568,13 @@ static void dasd_eckd_do_validate_server(struct work_struct *work) | |||
| 1556 | { | 1568 | { |
| 1557 | struct dasd_device *device = container_of(work, struct dasd_device, | 1569 | struct dasd_device *device = container_of(work, struct dasd_device, |
| 1558 | kick_validate); | 1570 | kick_validate); |
| 1559 | dasd_eckd_validate_server(device); | 1571 | if (dasd_eckd_validate_server(device, DASD_CQR_FLAGS_FAILFAST) |
| 1572 | == -EAGAIN) { | ||
| 1573 | /* schedule worker again if failed */ | ||
| 1574 | schedule_work(&device->kick_validate); | ||
| 1575 | return; | ||
| 1576 | } | ||
| 1577 | |||
| 1560 | dasd_put_device(device); | 1578 | dasd_put_device(device); |
| 1561 | } | 1579 | } |
| 1562 | 1580 | ||
| @@ -1685,7 +1703,7 @@ dasd_eckd_check_characteristics(struct dasd_device *device) | |||
| 1685 | if (rc) | 1703 | if (rc) |
| 1686 | goto out_err2; | 1704 | goto out_err2; |
| 1687 | 1705 | ||
| 1688 | dasd_eckd_validate_server(device); | 1706 | dasd_eckd_validate_server(device, 0); |
| 1689 | 1707 | ||
| 1690 | /* device may report different configuration data after LCU setup */ | 1708 | /* device may report different configuration data after LCU setup */ |
| 1691 | rc = dasd_eckd_read_conf(device); | 1709 | rc = dasd_eckd_read_conf(device); |
| @@ -4153,7 +4171,7 @@ static int dasd_eckd_restore_device(struct dasd_device *device) | |||
| 4153 | rc = dasd_alias_make_device_known_to_lcu(device); | 4171 | rc = dasd_alias_make_device_known_to_lcu(device); |
| 4154 | if (rc) | 4172 | if (rc) |
| 4155 | return rc; | 4173 | return rc; |
| 4156 | dasd_eckd_validate_server(device); | 4174 | dasd_eckd_validate_server(device, DASD_CQR_FLAGS_FAILFAST); |
| 4157 | 4175 | ||
| 4158 | /* RE-Read Configuration Data */ | 4176 | /* RE-Read Configuration Data */ |
| 4159 | rc = dasd_eckd_read_conf(device); | 4177 | rc = dasd_eckd_read_conf(device); |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index ed25c8740a9c..fc916f5d7314 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
| @@ -1426,6 +1426,8 @@ static enum io_sch_action sch_get_action(struct subchannel *sch) | |||
| 1426 | return IO_SCH_REPROBE; | 1426 | return IO_SCH_REPROBE; |
| 1427 | if (cdev->online) | 1427 | if (cdev->online) |
| 1428 | return IO_SCH_VERIFY; | 1428 | return IO_SCH_VERIFY; |
| 1429 | if (cdev->private->state == DEV_STATE_NOT_OPER) | ||
| 1430 | return IO_SCH_UNREG_ATTACH; | ||
| 1429 | return IO_SCH_NOP; | 1431 | return IO_SCH_NOP; |
| 1430 | } | 1432 | } |
| 1431 | 1433 | ||
| @@ -1519,11 +1521,14 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process) | |||
| 1519 | goto out; | 1521 | goto out; |
| 1520 | break; | 1522 | break; |
| 1521 | case IO_SCH_UNREG_ATTACH: | 1523 | case IO_SCH_UNREG_ATTACH: |
| 1524 | spin_lock_irqsave(sch->lock, flags); | ||
| 1522 | if (cdev->private->flags.resuming) { | 1525 | if (cdev->private->flags.resuming) { |
| 1523 | /* Device will be handled later. */ | 1526 | /* Device will be handled later. */ |
| 1524 | rc = 0; | 1527 | rc = 0; |
| 1525 | goto out; | 1528 | goto out_unlock; |
| 1526 | } | 1529 | } |
| 1530 | sch_set_cdev(sch, NULL); | ||
| 1531 | spin_unlock_irqrestore(sch->lock, flags); | ||
| 1527 | /* Unregister ccw device. */ | 1532 | /* Unregister ccw device. */ |
| 1528 | ccw_device_unregister(cdev); | 1533 | ccw_device_unregister(cdev); |
| 1529 | break; | 1534 | break; |
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index 32c26d795ed0..8f32a1323a79 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c | |||
| @@ -355,7 +355,7 @@ int __init register_intc_controller(struct intc_desc *desc) | |||
| 355 | if (unlikely(res)) { | 355 | if (unlikely(res)) { |
| 356 | if (res == -EEXIST) { | 356 | if (res == -EEXIST) { |
| 357 | res = irq_domain_associate(d->domain, | 357 | res = irq_domain_associate(d->domain, |
| 358 | irq, irq); | 358 | irq2, irq2); |
| 359 | if (unlikely(res)) { | 359 | if (unlikely(res)) { |
| 360 | pr_err("domain association " | 360 | pr_err("domain association " |
| 361 | "failure\n"); | 361 | "failure\n"); |
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c index 2804eaae804e..a3ac39b79192 100644 --- a/drivers/sh/pfc/pinctrl.c +++ b/drivers/sh/pfc/pinctrl.c | |||
| @@ -211,7 +211,8 @@ static int sh_pfc_gpio_request_enable(struct pinctrl_dev *pctldev, | |||
| 211 | break; | 211 | break; |
| 212 | default: | 212 | default: |
| 213 | pr_err("Unsupported mux type (%d), bailing...\n", pinmux_type); | 213 | pr_err("Unsupported mux type (%d), bailing...\n", pinmux_type); |
| 214 | return -ENOTSUPP; | 214 | ret = -ENOTSUPP; |
| 215 | goto err; | ||
| 215 | } | 216 | } |
| 216 | 217 | ||
| 217 | ret = 0; | 218 | ret = 0; |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 1eff743ec497..ae60406ea8a1 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
| @@ -814,6 +814,9 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev, | |||
| 814 | hpwdt_timer_reg = pci_mem_addr + 0x70; | 814 | hpwdt_timer_reg = pci_mem_addr + 0x70; |
| 815 | hpwdt_timer_con = pci_mem_addr + 0x72; | 815 | hpwdt_timer_con = pci_mem_addr + 0x72; |
| 816 | 816 | ||
| 817 | /* Make sure that timer is disabled until /dev/watchdog is opened */ | ||
| 818 | hpwdt_stop(); | ||
| 819 | |||
| 817 | /* Make sure that we have a valid soft_margin */ | 820 | /* Make sure that we have a valid soft_margin */ |
| 818 | if (hpwdt_change_timer(soft_margin)) | 821 | if (hpwdt_change_timer(soft_margin)) |
| 819 | hpwdt_change_timer(DEFAULT_MARGIN); | 822 | hpwdt_change_timer(DEFAULT_MARGIN); |
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 6aa46a90ff02..3796434991fa 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c | |||
| @@ -128,11 +128,12 @@ EXPORT_SYMBOL_GPL(watchdog_register_device); | |||
| 128 | void watchdog_unregister_device(struct watchdog_device *wdd) | 128 | void watchdog_unregister_device(struct watchdog_device *wdd) |
| 129 | { | 129 | { |
| 130 | int ret; | 130 | int ret; |
| 131 | int devno = wdd->cdev.dev; | 131 | int devno; |
| 132 | 132 | ||
| 133 | if (wdd == NULL) | 133 | if (wdd == NULL) |
| 134 | return; | 134 | return; |
| 135 | 135 | ||
| 136 | devno = wdd->cdev.dev; | ||
| 136 | ret = watchdog_dev_unregister(wdd); | 137 | ret = watchdog_dev_unregister(wdd); |
| 137 | if (ret) | 138 | if (ret) |
| 138 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); | 139 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); |
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 1ffd03bf8e10..7f1241608489 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c | |||
| @@ -314,8 +314,9 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages) | |||
| 314 | } | 314 | } |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | err = gnttab_unmap_refs(map->unmap_ops + offset, map->pages + offset, | 317 | err = gnttab_unmap_refs(map->unmap_ops + offset, |
| 318 | pages, true); | 318 | use_ptemod ? map->kmap_ops + offset : NULL, map->pages + offset, |
| 319 | pages); | ||
| 319 | if (err) | 320 | if (err) |
| 320 | return err; | 321 | return err; |
| 321 | 322 | ||
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 0bfc1ef11259..006726688baf 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
| @@ -870,7 +870,8 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
| 870 | EXPORT_SYMBOL_GPL(gnttab_map_refs); | 870 | EXPORT_SYMBOL_GPL(gnttab_map_refs); |
| 871 | 871 | ||
| 872 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | 872 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
| 873 | struct page **pages, unsigned int count, bool clear_pte) | 873 | struct gnttab_map_grant_ref *kmap_ops, |
| 874 | struct page **pages, unsigned int count) | ||
| 874 | { | 875 | { |
| 875 | int i, ret; | 876 | int i, ret; |
| 876 | bool lazy = false; | 877 | bool lazy = false; |
| @@ -888,7 +889,8 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | |||
| 888 | } | 889 | } |
| 889 | 890 | ||
| 890 | for (i = 0; i < count; i++) { | 891 | for (i = 0; i < count; i++) { |
| 891 | ret = m2p_remove_override(pages[i], clear_pte); | 892 | ret = m2p_remove_override(pages[i], kmap_ops ? |
| 893 | &kmap_ops[i] : NULL); | ||
| 892 | if (ret) | 894 | if (ret) |
| 893 | return ret; | 895 | return ret; |
| 894 | } | 896 | } |
diff --git a/fs/dcache.c b/fs/dcache.c index 8086636bf796..16521a9f2038 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
| @@ -389,7 +389,7 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) | |||
| 389 | * Inform try_to_ascend() that we are no longer attached to the | 389 | * Inform try_to_ascend() that we are no longer attached to the |
| 390 | * dentry tree | 390 | * dentry tree |
| 391 | */ | 391 | */ |
| 392 | dentry->d_flags |= DCACHE_DISCONNECTED; | 392 | dentry->d_flags |= DCACHE_DENTRY_KILLED; |
| 393 | if (parent) | 393 | if (parent) |
| 394 | spin_unlock(&parent->d_lock); | 394 | spin_unlock(&parent->d_lock); |
| 395 | dentry_iput(dentry); | 395 | dentry_iput(dentry); |
| @@ -1048,7 +1048,7 @@ static struct dentry *try_to_ascend(struct dentry *old, int locked, unsigned seq | |||
| 1048 | * or deletion | 1048 | * or deletion |
| 1049 | */ | 1049 | */ |
| 1050 | if (new != old->d_parent || | 1050 | if (new != old->d_parent || |
| 1051 | (old->d_flags & DCACHE_DISCONNECTED) || | 1051 | (old->d_flags & DCACHE_DENTRY_KILLED) || |
| 1052 | (!locked && read_seqretry(&rename_lock, seq))) { | 1052 | (!locked && read_seqretry(&rename_lock, seq))) { |
| 1053 | spin_unlock(&new->d_lock); | 1053 | spin_unlock(&new->d_lock); |
| 1054 | new = NULL; | 1054 | new = NULL; |
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 2340f6978d6e..c5ca6ae5a30c 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
| @@ -526,73 +526,51 @@ struct array_data { | |||
| 526 | u32 elements; | 526 | u32 elements; |
| 527 | }; | 527 | }; |
| 528 | 528 | ||
| 529 | static int u32_array_open(struct inode *inode, struct file *file) | 529 | static size_t u32_format_array(char *buf, size_t bufsize, |
| 530 | { | 530 | u32 *array, int array_size) |
| 531 | file->private_data = NULL; | ||
| 532 | return nonseekable_open(inode, file); | ||
| 533 | } | ||
| 534 | |||
| 535 | static size_t format_array(char *buf, size_t bufsize, const char *fmt, | ||
| 536 | u32 *array, u32 array_size) | ||
| 537 | { | 531 | { |
| 538 | size_t ret = 0; | 532 | size_t ret = 0; |
| 539 | u32 i; | ||
| 540 | 533 | ||
| 541 | for (i = 0; i < array_size; i++) { | 534 | while (--array_size >= 0) { |
| 542 | size_t len; | 535 | size_t len; |
| 536 | char term = array_size ? ' ' : '\n'; | ||
| 543 | 537 | ||
| 544 | len = snprintf(buf, bufsize, fmt, array[i]); | 538 | len = snprintf(buf, bufsize, "%u%c", *array++, term); |
| 545 | len++; /* ' ' or '\n' */ | ||
| 546 | ret += len; | 539 | ret += len; |
| 547 | 540 | ||
| 548 | if (buf) { | 541 | buf += len; |
| 549 | buf += len; | 542 | bufsize -= len; |
| 550 | bufsize -= len; | ||
| 551 | buf[-1] = (i == array_size-1) ? '\n' : ' '; | ||
| 552 | } | ||
| 553 | } | 543 | } |
| 554 | |||
| 555 | ret++; /* \0 */ | ||
| 556 | if (buf) | ||
| 557 | *buf = '\0'; | ||
| 558 | |||
| 559 | return ret; | 544 | return ret; |
| 560 | } | 545 | } |
| 561 | 546 | ||
| 562 | static char *format_array_alloc(const char *fmt, u32 *array, | 547 | static int u32_array_open(struct inode *inode, struct file *file) |
| 563 | u32 array_size) | ||
| 564 | { | 548 | { |
| 565 | size_t len = format_array(NULL, 0, fmt, array, array_size); | 549 | struct array_data *data = inode->i_private; |
| 566 | char *ret; | 550 | int size, elements = data->elements; |
| 567 | 551 | char *buf; | |
| 568 | ret = kmalloc(len, GFP_KERNEL); | 552 | |
| 569 | if (ret == NULL) | 553 | /* |
| 570 | return NULL; | 554 | * Max size: |
| 555 | * - 10 digits + ' '/'\n' = 11 bytes per number | ||
| 556 | * - terminating NUL character | ||
| 557 | */ | ||
| 558 | size = elements*11; | ||
| 559 | buf = kmalloc(size+1, GFP_KERNEL); | ||
| 560 | if (!buf) | ||
| 561 | return -ENOMEM; | ||
| 562 | buf[size] = 0; | ||
| 563 | |||
| 564 | file->private_data = buf; | ||
| 565 | u32_format_array(buf, size, data->array, data->elements); | ||
| 571 | 566 | ||
| 572 | format_array(ret, len, fmt, array, array_size); | 567 | return nonseekable_open(inode, file); |
| 573 | return ret; | ||
| 574 | } | 568 | } |
| 575 | 569 | ||
| 576 | static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, | 570 | static ssize_t u32_array_read(struct file *file, char __user *buf, size_t len, |
| 577 | loff_t *ppos) | 571 | loff_t *ppos) |
| 578 | { | 572 | { |
| 579 | struct inode *inode = file->f_path.dentry->d_inode; | 573 | size_t size = strlen(file->private_data); |
| 580 | struct array_data *data = inode->i_private; | ||
| 581 | size_t size; | ||
| 582 | |||
| 583 | if (*ppos == 0) { | ||
| 584 | if (file->private_data) { | ||
| 585 | kfree(file->private_data); | ||
| 586 | file->private_data = NULL; | ||
| 587 | } | ||
| 588 | |||
| 589 | file->private_data = format_array_alloc("%u", data->array, | ||
| 590 | data->elements); | ||
| 591 | } | ||
| 592 | |||
| 593 | size = 0; | ||
| 594 | if (file->private_data) | ||
| 595 | size = strlen(file->private_data); | ||
| 596 | 574 | ||
| 597 | return simple_read_from_buffer(buf, len, ppos, | 575 | return simple_read_from_buffer(buf, len, ppos, |
| 598 | file->private_data, size); | 576 | file->private_data, size); |
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index d7a9dd735e1e..933b7930b863 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
| @@ -96,6 +96,7 @@ xfs_buf_lru_add( | |||
| 96 | atomic_inc(&bp->b_hold); | 96 | atomic_inc(&bp->b_hold); |
| 97 | list_add_tail(&bp->b_lru, &btp->bt_lru); | 97 | list_add_tail(&bp->b_lru, &btp->bt_lru); |
| 98 | btp->bt_lru_nr++; | 98 | btp->bt_lru_nr++; |
| 99 | bp->b_lru_flags &= ~_XBF_LRU_DISPOSE; | ||
| 99 | } | 100 | } |
| 100 | spin_unlock(&btp->bt_lru_lock); | 101 | spin_unlock(&btp->bt_lru_lock); |
| 101 | } | 102 | } |
| @@ -154,7 +155,8 @@ xfs_buf_stale( | |||
| 154 | struct xfs_buftarg *btp = bp->b_target; | 155 | struct xfs_buftarg *btp = bp->b_target; |
| 155 | 156 | ||
| 156 | spin_lock(&btp->bt_lru_lock); | 157 | spin_lock(&btp->bt_lru_lock); |
| 157 | if (!list_empty(&bp->b_lru)) { | 158 | if (!list_empty(&bp->b_lru) && |
| 159 | !(bp->b_lru_flags & _XBF_LRU_DISPOSE)) { | ||
| 158 | list_del_init(&bp->b_lru); | 160 | list_del_init(&bp->b_lru); |
| 159 | btp->bt_lru_nr--; | 161 | btp->bt_lru_nr--; |
| 160 | atomic_dec(&bp->b_hold); | 162 | atomic_dec(&bp->b_hold); |
| @@ -1501,6 +1503,7 @@ xfs_buftarg_shrink( | |||
| 1501 | */ | 1503 | */ |
| 1502 | list_move(&bp->b_lru, &dispose); | 1504 | list_move(&bp->b_lru, &dispose); |
| 1503 | btp->bt_lru_nr--; | 1505 | btp->bt_lru_nr--; |
| 1506 | bp->b_lru_flags |= _XBF_LRU_DISPOSE; | ||
| 1504 | } | 1507 | } |
| 1505 | spin_unlock(&btp->bt_lru_lock); | 1508 | spin_unlock(&btp->bt_lru_lock); |
| 1506 | 1509 | ||
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index d03b73b9604e..7c0b6a0a1557 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h | |||
| @@ -38,27 +38,28 @@ typedef enum { | |||
| 38 | XBRW_ZERO = 3, /* Zero target memory */ | 38 | XBRW_ZERO = 3, /* Zero target memory */ |
| 39 | } xfs_buf_rw_t; | 39 | } xfs_buf_rw_t; |
| 40 | 40 | ||
| 41 | #define XBF_READ (1 << 0) /* buffer intended for reading from device */ | 41 | #define XBF_READ (1 << 0) /* buffer intended for reading from device */ |
| 42 | #define XBF_WRITE (1 << 1) /* buffer intended for writing to device */ | 42 | #define XBF_WRITE (1 << 1) /* buffer intended for writing to device */ |
| 43 | #define XBF_READ_AHEAD (1 << 2) /* asynchronous read-ahead */ | 43 | #define XBF_READ_AHEAD (1 << 2) /* asynchronous read-ahead */ |
| 44 | #define XBF_ASYNC (1 << 4) /* initiator will not wait for completion */ | 44 | #define XBF_ASYNC (1 << 4) /* initiator will not wait for completion */ |
| 45 | #define XBF_DONE (1 << 5) /* all pages in the buffer uptodate */ | 45 | #define XBF_DONE (1 << 5) /* all pages in the buffer uptodate */ |
| 46 | #define XBF_STALE (1 << 6) /* buffer has been staled, do not find it */ | 46 | #define XBF_STALE (1 << 6) /* buffer has been staled, do not find it */ |
| 47 | 47 | ||
| 48 | /* I/O hints for the BIO layer */ | 48 | /* I/O hints for the BIO layer */ |
| 49 | #define XBF_SYNCIO (1 << 10)/* treat this buffer as synchronous I/O */ | 49 | #define XBF_SYNCIO (1 << 10)/* treat this buffer as synchronous I/O */ |
| 50 | #define XBF_FUA (1 << 11)/* force cache write through mode */ | 50 | #define XBF_FUA (1 << 11)/* force cache write through mode */ |
| 51 | #define XBF_FLUSH (1 << 12)/* flush the disk cache before a write */ | 51 | #define XBF_FLUSH (1 << 12)/* flush the disk cache before a write */ |
| 52 | 52 | ||
| 53 | /* flags used only as arguments to access routines */ | 53 | /* flags used only as arguments to access routines */ |
| 54 | #define XBF_TRYLOCK (1 << 16)/* lock requested, but do not wait */ | 54 | #define XBF_TRYLOCK (1 << 16)/* lock requested, but do not wait */ |
| 55 | #define XBF_UNMAPPED (1 << 17)/* do not map the buffer */ | 55 | #define XBF_UNMAPPED (1 << 17)/* do not map the buffer */ |
| 56 | 56 | ||
| 57 | /* flags used only internally */ | 57 | /* flags used only internally */ |
| 58 | #define _XBF_PAGES (1 << 20)/* backed by refcounted pages */ | 58 | #define _XBF_PAGES (1 << 20)/* backed by refcounted pages */ |
| 59 | #define _XBF_KMEM (1 << 21)/* backed by heap memory */ | 59 | #define _XBF_KMEM (1 << 21)/* backed by heap memory */ |
| 60 | #define _XBF_DELWRI_Q (1 << 22)/* buffer on a delwri queue */ | 60 | #define _XBF_DELWRI_Q (1 << 22)/* buffer on a delwri queue */ |
| 61 | #define _XBF_COMPOUND (1 << 23)/* compound buffer */ | 61 | #define _XBF_COMPOUND (1 << 23)/* compound buffer */ |
| 62 | #define _XBF_LRU_DISPOSE (1 << 24)/* buffer being discarded */ | ||
| 62 | 63 | ||
| 63 | typedef unsigned int xfs_buf_flags_t; | 64 | typedef unsigned int xfs_buf_flags_t; |
| 64 | 65 | ||
| @@ -72,12 +73,13 @@ typedef unsigned int xfs_buf_flags_t; | |||
| 72 | { XBF_SYNCIO, "SYNCIO" }, \ | 73 | { XBF_SYNCIO, "SYNCIO" }, \ |
| 73 | { XBF_FUA, "FUA" }, \ | 74 | { XBF_FUA, "FUA" }, \ |
| 74 | { XBF_FLUSH, "FLUSH" }, \ | 75 | { XBF_FLUSH, "FLUSH" }, \ |
| 75 | { XBF_TRYLOCK, "TRYLOCK" }, /* should never be set */\ | 76 | { XBF_TRYLOCK, "TRYLOCK" }, /* should never be set */\ |
| 76 | { XBF_UNMAPPED, "UNMAPPED" }, /* ditto */\ | 77 | { XBF_UNMAPPED, "UNMAPPED" }, /* ditto */\ |
| 77 | { _XBF_PAGES, "PAGES" }, \ | 78 | { _XBF_PAGES, "PAGES" }, \ |
| 78 | { _XBF_KMEM, "KMEM" }, \ | 79 | { _XBF_KMEM, "KMEM" }, \ |
| 79 | { _XBF_DELWRI_Q, "DELWRI_Q" }, \ | 80 | { _XBF_DELWRI_Q, "DELWRI_Q" }, \ |
| 80 | { _XBF_COMPOUND, "COMPOUND" } | 81 | { _XBF_COMPOUND, "COMPOUND" }, \ |
| 82 | { _XBF_LRU_DISPOSE, "LRU_DISPOSE" } | ||
| 81 | 83 | ||
| 82 | typedef struct xfs_buftarg { | 84 | typedef struct xfs_buftarg { |
| 83 | dev_t bt_dev; | 85 | dev_t bt_dev; |
| @@ -124,7 +126,12 @@ typedef struct xfs_buf { | |||
| 124 | xfs_buf_flags_t b_flags; /* status flags */ | 126 | xfs_buf_flags_t b_flags; /* status flags */ |
| 125 | struct semaphore b_sema; /* semaphore for lockables */ | 127 | struct semaphore b_sema; /* semaphore for lockables */ |
| 126 | 128 | ||
| 129 | /* | ||
| 130 | * concurrent access to b_lru and b_lru_flags are protected by | ||
| 131 | * bt_lru_lock and not by b_sema | ||
| 132 | */ | ||
| 127 | struct list_head b_lru; /* lru list */ | 133 | struct list_head b_lru; /* lru list */ |
| 134 | xfs_buf_flags_t b_lru_flags; /* internal lru status flags */ | ||
| 128 | wait_queue_head_t b_waiters; /* unpin waiters */ | 135 | wait_queue_head_t b_waiters; /* unpin waiters */ |
| 129 | struct list_head b_list; | 136 | struct list_head b_list; |
| 130 | struct xfs_perag *b_pag; /* contains rbtree root */ | 137 | struct xfs_perag *b_pag; /* contains rbtree root */ |
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index bdaf4cb9f4a2..19e2380fb867 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
| @@ -919,6 +919,7 @@ xfs_fs_put_super( | |||
| 919 | struct xfs_mount *mp = XFS_M(sb); | 919 | struct xfs_mount *mp = XFS_M(sb); |
| 920 | 920 | ||
| 921 | xfs_filestream_unmount(mp); | 921 | xfs_filestream_unmount(mp); |
| 922 | cancel_delayed_work_sync(&mp->m_sync_work); | ||
| 922 | xfs_unmountfs(mp); | 923 | xfs_unmountfs(mp); |
| 923 | xfs_syncd_stop(mp); | 924 | xfs_syncd_stop(mp); |
| 924 | xfs_freesb(mp); | 925 | xfs_freesb(mp); |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index caa34e50537e..59200795482e 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -206,6 +206,8 @@ struct dentry_operations { | |||
| 206 | #define DCACHE_MANAGED_DENTRY \ | 206 | #define DCACHE_MANAGED_DENTRY \ |
| 207 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) | 207 | (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) |
| 208 | 208 | ||
| 209 | #define DCACHE_DENTRY_KILLED 0x100000 | ||
| 210 | |||
| 209 | extern seqlock_t rename_lock; | 211 | extern seqlock_t rename_lock; |
| 210 | 212 | ||
| 211 | static inline int dname_external(struct dentry *dentry) | 213 | static inline int dname_external(struct dentry *dentry) |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 594b419b7d20..2451f1f7a1d9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -91,7 +91,7 @@ | |||
| 91 | { \ | 91 | { \ |
| 92 | typeof(x) __x = x; \ | 92 | typeof(x) __x = x; \ |
| 93 | typeof(divisor) __d = divisor; \ | 93 | typeof(divisor) __d = divisor; \ |
| 94 | (((typeof(x))-1) >= 0 || (__x) >= 0) ? \ | 94 | (((typeof(x))-1) > 0 || (__x) > 0) ? \ |
| 95 | (((__x) + ((__d) / 2)) / (__d)) : \ | 95 | (((__x) + ((__d) / 2)) / (__d)) : \ |
| 96 | (((__x) - ((__d) / 2)) / (__d)); \ | 96 | (((__x) - ((__d) / 2)) / (__d)); \ |
| 97 | } \ | 97 | } \ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 33ed9d605f91..bdb41612bfec 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -274,6 +274,8 @@ struct perf_event_attr { | |||
| 274 | __u64 branch_sample_type; /* enum branch_sample_type */ | 274 | __u64 branch_sample_type; /* enum branch_sample_type */ |
| 275 | }; | 275 | }; |
| 276 | 276 | ||
| 277 | #define perf_flags(attr) (*(&(attr)->read_format + 1)) | ||
| 278 | |||
| 277 | /* | 279 | /* |
| 278 | * Ioctls that can be done on a perf event fd: | 280 | * Ioctls that can be done on a perf event fd: |
| 279 | */ | 281 | */ |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 22e61fdf75a2..28e493b5b94c 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
| @@ -84,6 +84,8 @@ struct xfrm_replay_state { | |||
| 84 | __u32 bitmap; | 84 | __u32 bitmap; |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | #define XFRMA_REPLAY_ESN_MAX 4096 | ||
| 88 | |||
| 87 | struct xfrm_replay_state_esn { | 89 | struct xfrm_replay_state_esn { |
| 88 | unsigned int bmp_len; | 90 | unsigned int bmp_len; |
| 89 | __u32 oseq; | 91 | __u32 oseq; |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 0fedbd8d747a..9fc7114159e8 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -111,9 +111,8 @@ struct rt6_info { | |||
| 111 | struct inet6_dev *rt6i_idev; | 111 | struct inet6_dev *rt6i_idev; |
| 112 | unsigned long _rt6i_peer; | 112 | unsigned long _rt6i_peer; |
| 113 | 113 | ||
| 114 | #ifdef CONFIG_XFRM | 114 | u32 rt6i_genid; |
| 115 | u32 rt6i_flow_cache_genid; | 115 | |
| 116 | #endif | ||
| 117 | /* more non-fragment space at head required */ | 116 | /* more non-fragment space at head required */ |
| 118 | unsigned short rt6i_nfheader_len; | 117 | unsigned short rt6i_nfheader_len; |
| 119 | 118 | ||
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ae1cd6c9ba52..fd87963a0ea5 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -102,6 +102,7 @@ struct net { | |||
| 102 | #endif | 102 | #endif |
| 103 | struct netns_ipvs *ipvs; | 103 | struct netns_ipvs *ipvs; |
| 104 | struct sock *diag_nlsk; | 104 | struct sock *diag_nlsk; |
| 105 | atomic_t rt_genid; | ||
| 105 | }; | 106 | }; |
| 106 | 107 | ||
| 107 | 108 | ||
| @@ -300,5 +301,14 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header) | |||
| 300 | } | 301 | } |
| 301 | #endif | 302 | #endif |
| 302 | 303 | ||
| 304 | static inline int rt_genid(struct net *net) | ||
| 305 | { | ||
| 306 | return atomic_read(&net->rt_genid); | ||
| 307 | } | ||
| 308 | |||
| 309 | static inline void rt_genid_bump(struct net *net) | ||
| 310 | { | ||
| 311 | atomic_inc(&net->rt_genid); | ||
| 312 | } | ||
| 303 | 313 | ||
| 304 | #endif /* __NET_NET_NAMESPACE_H */ | 314 | #endif /* __NET_NET_NAMESPACE_H */ |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 1474dd65c66f..eb24dbccd81e 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -65,7 +65,6 @@ struct netns_ipv4 { | |||
| 65 | unsigned int sysctl_ping_group_range[2]; | 65 | unsigned int sysctl_ping_group_range[2]; |
| 66 | long sysctl_tcp_mem[3]; | 66 | long sysctl_tcp_mem[3]; |
| 67 | 67 | ||
| 68 | atomic_t rt_genid; | ||
| 69 | atomic_t dev_addr_genid; | 68 | atomic_t dev_addr_genid; |
| 70 | 69 | ||
| 71 | #ifdef CONFIG_IP_MROUTE | 70 | #ifdef CONFIG_IP_MROUTE |
diff --git a/include/net/route.h b/include/net/route.h index 776a27f1ab78..da22243d2760 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -108,7 +108,7 @@ extern struct ip_rt_acct __percpu *ip_rt_acct; | |||
| 108 | 108 | ||
| 109 | struct in_device; | 109 | struct in_device; |
| 110 | extern int ip_rt_init(void); | 110 | extern int ip_rt_init(void); |
| 111 | extern void rt_cache_flush(struct net *net, int how); | 111 | extern void rt_cache_flush(struct net *net); |
| 112 | extern void rt_flush_dev(struct net_device *dev); | 112 | extern void rt_flush_dev(struct net_device *dev); |
| 113 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); | 113 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
| 114 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 114 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 5f889f16b0c8..08fa27244da7 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
| @@ -214,7 +214,7 @@ TRACE_EVENT(mm_page_alloc, | |||
| 214 | 214 | ||
| 215 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", | 215 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", |
| 216 | __entry->page, | 216 | __entry->page, |
| 217 | page_to_pfn(__entry->page), | 217 | __entry->page ? page_to_pfn(__entry->page) : 0, |
| 218 | __entry->order, | 218 | __entry->order, |
| 219 | __entry->migratetype, | 219 | __entry->migratetype, |
| 220 | show_gfp_flags(__entry->gfp_flags)) | 220 | show_gfp_flags(__entry->gfp_flags)) |
| @@ -240,7 +240,7 @@ DECLARE_EVENT_CLASS(mm_page, | |||
| 240 | 240 | ||
| 241 | TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", | 241 | TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", |
| 242 | __entry->page, | 242 | __entry->page, |
| 243 | page_to_pfn(__entry->page), | 243 | __entry->page ? page_to_pfn(__entry->page) : 0, |
| 244 | __entry->order, | 244 | __entry->order, |
| 245 | __entry->migratetype, | 245 | __entry->migratetype, |
| 246 | __entry->order == 0) | 246 | __entry->order == 0) |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index 11e27c3af3cb..f19fff8650e9 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
| @@ -187,6 +187,7 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, | |||
| 187 | struct gnttab_map_grant_ref *kmap_ops, | 187 | struct gnttab_map_grant_ref *kmap_ops, |
| 188 | struct page **pages, unsigned int count); | 188 | struct page **pages, unsigned int count); |
| 189 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, | 189 | int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, |
| 190 | struct page **pages, unsigned int count, bool clear_pte); | 190 | struct gnttab_map_grant_ref *kunmap_ops, |
| 191 | struct page **pages, unsigned int count); | ||
| 191 | 192 | ||
| 192 | #endif /* __ASM_GNTTAB_H__ */ | 193 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 34e5eac81424..d3b91e75cecd 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
| @@ -303,10 +303,11 @@ void getnstimeofday(struct timespec *ts) | |||
| 303 | seq = read_seqbegin(&tk->lock); | 303 | seq = read_seqbegin(&tk->lock); |
| 304 | 304 | ||
| 305 | ts->tv_sec = tk->xtime_sec; | 305 | ts->tv_sec = tk->xtime_sec; |
| 306 | ts->tv_nsec = timekeeping_get_ns(tk); | 306 | nsecs = timekeeping_get_ns(tk); |
| 307 | 307 | ||
| 308 | } while (read_seqretry(&tk->lock, seq)); | 308 | } while (read_seqretry(&tk->lock, seq)); |
| 309 | 309 | ||
| 310 | ts->tv_nsec = 0; | ||
| 310 | timespec_add_ns(ts, nsecs); | 311 | timespec_add_ns(ts, nsecs); |
| 311 | } | 312 | } |
| 312 | EXPORT_SYMBOL(getnstimeofday); | 313 | EXPORT_SYMBOL(getnstimeofday); |
| @@ -345,6 +346,7 @@ void ktime_get_ts(struct timespec *ts) | |||
| 345 | { | 346 | { |
| 346 | struct timekeeper *tk = &timekeeper; | 347 | struct timekeeper *tk = &timekeeper; |
| 347 | struct timespec tomono; | 348 | struct timespec tomono; |
| 349 | s64 nsec; | ||
| 348 | unsigned int seq; | 350 | unsigned int seq; |
| 349 | 351 | ||
| 350 | WARN_ON(timekeeping_suspended); | 352 | WARN_ON(timekeeping_suspended); |
| @@ -352,13 +354,14 @@ void ktime_get_ts(struct timespec *ts) | |||
| 352 | do { | 354 | do { |
| 353 | seq = read_seqbegin(&tk->lock); | 355 | seq = read_seqbegin(&tk->lock); |
| 354 | ts->tv_sec = tk->xtime_sec; | 356 | ts->tv_sec = tk->xtime_sec; |
| 355 | ts->tv_nsec = timekeeping_get_ns(tk); | 357 | nsec = timekeeping_get_ns(tk); |
| 356 | tomono = tk->wall_to_monotonic; | 358 | tomono = tk->wall_to_monotonic; |
| 357 | 359 | ||
| 358 | } while (read_seqretry(&tk->lock, seq)); | 360 | } while (read_seqretry(&tk->lock, seq)); |
| 359 | 361 | ||
| 360 | set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec, | 362 | ts->tv_sec += tomono.tv_sec; |
| 361 | ts->tv_nsec + tomono.tv_nsec); | 363 | ts->tv_nsec = 0; |
| 364 | timespec_add_ns(ts, nsec + tomono.tv_nsec); | ||
| 362 | } | 365 | } |
| 363 | EXPORT_SYMBOL_GPL(ktime_get_ts); | 366 | EXPORT_SYMBOL_GPL(ktime_get_ts); |
| 364 | 367 | ||
| @@ -1244,6 +1247,7 @@ void get_monotonic_boottime(struct timespec *ts) | |||
| 1244 | { | 1247 | { |
| 1245 | struct timekeeper *tk = &timekeeper; | 1248 | struct timekeeper *tk = &timekeeper; |
| 1246 | struct timespec tomono, sleep; | 1249 | struct timespec tomono, sleep; |
| 1250 | s64 nsec; | ||
| 1247 | unsigned int seq; | 1251 | unsigned int seq; |
| 1248 | 1252 | ||
| 1249 | WARN_ON(timekeeping_suspended); | 1253 | WARN_ON(timekeeping_suspended); |
| @@ -1251,14 +1255,15 @@ void get_monotonic_boottime(struct timespec *ts) | |||
| 1251 | do { | 1255 | do { |
| 1252 | seq = read_seqbegin(&tk->lock); | 1256 | seq = read_seqbegin(&tk->lock); |
| 1253 | ts->tv_sec = tk->xtime_sec; | 1257 | ts->tv_sec = tk->xtime_sec; |
| 1254 | ts->tv_nsec = timekeeping_get_ns(tk); | 1258 | nsec = timekeeping_get_ns(tk); |
| 1255 | tomono = tk->wall_to_monotonic; | 1259 | tomono = tk->wall_to_monotonic; |
| 1256 | sleep = tk->total_sleep_time; | 1260 | sleep = tk->total_sleep_time; |
| 1257 | 1261 | ||
| 1258 | } while (read_seqretry(&tk->lock, seq)); | 1262 | } while (read_seqretry(&tk->lock, seq)); |
| 1259 | 1263 | ||
| 1260 | set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec, | 1264 | ts->tv_sec += tomono.tv_sec + sleep.tv_sec; |
| 1261 | ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec); | 1265 | ts->tv_nsec = 0; |
| 1266 | timespec_add_ns(ts, nsec + tomono.tv_nsec + sleep.tv_nsec); | ||
| 1262 | } | 1267 | } |
| 1263 | EXPORT_SYMBOL_GPL(get_monotonic_boottime); | 1268 | EXPORT_SYMBOL_GPL(get_monotonic_boottime); |
| 1264 | 1269 | ||
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b80065a2450a..3c5a79e2134c 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -3576,18 +3576,17 @@ static int __devinit workqueue_cpu_down_callback(struct notifier_block *nfb, | |||
| 3576 | #ifdef CONFIG_SMP | 3576 | #ifdef CONFIG_SMP |
| 3577 | 3577 | ||
| 3578 | struct work_for_cpu { | 3578 | struct work_for_cpu { |
| 3579 | struct completion completion; | 3579 | struct work_struct work; |
| 3580 | long (*fn)(void *); | 3580 | long (*fn)(void *); |
| 3581 | void *arg; | 3581 | void *arg; |
| 3582 | long ret; | 3582 | long ret; |
| 3583 | }; | 3583 | }; |
| 3584 | 3584 | ||
| 3585 | static int do_work_for_cpu(void *_wfc) | 3585 | static void work_for_cpu_fn(struct work_struct *work) |
| 3586 | { | 3586 | { |
| 3587 | struct work_for_cpu *wfc = _wfc; | 3587 | struct work_for_cpu *wfc = container_of(work, struct work_for_cpu, work); |
| 3588 | |||
| 3588 | wfc->ret = wfc->fn(wfc->arg); | 3589 | wfc->ret = wfc->fn(wfc->arg); |
| 3589 | complete(&wfc->completion); | ||
| 3590 | return 0; | ||
| 3591 | } | 3590 | } |
| 3592 | 3591 | ||
| 3593 | /** | 3592 | /** |
| @@ -3602,19 +3601,11 @@ static int do_work_for_cpu(void *_wfc) | |||
| 3602 | */ | 3601 | */ |
| 3603 | long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) | 3602 | long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) |
| 3604 | { | 3603 | { |
| 3605 | struct task_struct *sub_thread; | 3604 | struct work_for_cpu wfc = { .fn = fn, .arg = arg }; |
| 3606 | struct work_for_cpu wfc = { | ||
| 3607 | .completion = COMPLETION_INITIALIZER_ONSTACK(wfc.completion), | ||
| 3608 | .fn = fn, | ||
| 3609 | .arg = arg, | ||
| 3610 | }; | ||
| 3611 | 3605 | ||
| 3612 | sub_thread = kthread_create(do_work_for_cpu, &wfc, "work_for_cpu"); | 3606 | INIT_WORK_ONSTACK(&wfc.work, work_for_cpu_fn); |
| 3613 | if (IS_ERR(sub_thread)) | 3607 | schedule_work_on(cpu, &wfc.work); |
| 3614 | return PTR_ERR(sub_thread); | 3608 | flush_work(&wfc.work); |
| 3615 | kthread_bind(sub_thread, cpu); | ||
| 3616 | wake_up_process(sub_thread); | ||
| 3617 | wait_for_completion(&wfc.completion); | ||
| 3618 | return wfc.ret; | 3609 | return wfc.ret; |
| 3619 | } | 3610 | } |
| 3620 | EXPORT_SYMBOL_GPL(work_on_cpu); | 3611 | EXPORT_SYMBOL_GPL(work_on_cpu); |
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h index a081ce1c0514..cebaae7e148b 100644 --- a/net/batman-adv/bitarray.h +++ b/net/batman-adv/bitarray.h | |||
| @@ -20,8 +20,8 @@ | |||
| 20 | #ifndef _NET_BATMAN_ADV_BITARRAY_H_ | 20 | #ifndef _NET_BATMAN_ADV_BITARRAY_H_ |
| 21 | #define _NET_BATMAN_ADV_BITARRAY_H_ | 21 | #define _NET_BATMAN_ADV_BITARRAY_H_ |
| 22 | 22 | ||
| 23 | /* returns true if the corresponding bit in the given seq_bits indicates true | 23 | /* Returns 1 if the corresponding bit in the given seq_bits indicates true |
| 24 | * and curr_seqno is within range of last_seqno | 24 | * and curr_seqno is within range of last_seqno. Otherwise returns 0. |
| 25 | */ | 25 | */ |
| 26 | static inline int batadv_test_bit(const unsigned long *seq_bits, | 26 | static inline int batadv_test_bit(const unsigned long *seq_bits, |
| 27 | uint32_t last_seqno, uint32_t curr_seqno) | 27 | uint32_t last_seqno, uint32_t curr_seqno) |
| @@ -32,7 +32,7 @@ static inline int batadv_test_bit(const unsigned long *seq_bits, | |||
| 32 | if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) | 32 | if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) |
| 33 | return 0; | 33 | return 0; |
| 34 | else | 34 | else |
| 35 | return test_bit(diff, seq_bits); | 35 | return test_bit(diff, seq_bits) != 0; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | /* turn corresponding bit on, so we can remember that we got the packet */ | 38 | /* turn corresponding bit on, so we can remember that we got the packet */ |
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index 5e5f5b410e0b..1eaacf10d19d 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c | |||
| @@ -58,7 +58,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
| 58 | switch (cmd) { | 58 | switch (cmd) { |
| 59 | case BNEPCONNADD: | 59 | case BNEPCONNADD: |
| 60 | if (!capable(CAP_NET_ADMIN)) | 60 | if (!capable(CAP_NET_ADMIN)) |
| 61 | return -EACCES; | 61 | return -EPERM; |
| 62 | 62 | ||
| 63 | if (copy_from_user(&ca, argp, sizeof(ca))) | 63 | if (copy_from_user(&ca, argp, sizeof(ca))) |
| 64 | return -EFAULT; | 64 | return -EFAULT; |
| @@ -84,7 +84,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
| 84 | 84 | ||
| 85 | case BNEPCONNDEL: | 85 | case BNEPCONNDEL: |
| 86 | if (!capable(CAP_NET_ADMIN)) | 86 | if (!capable(CAP_NET_ADMIN)) |
| 87 | return -EACCES; | 87 | return -EPERM; |
| 88 | 88 | ||
| 89 | if (copy_from_user(&cd, argp, sizeof(cd))) | 89 | if (copy_from_user(&cd, argp, sizeof(cd))) |
| 90 | return -EFAULT; | 90 | return -EFAULT; |
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c index 311668d14571..32dc83dcb6b2 100644 --- a/net/bluetooth/cmtp/sock.c +++ b/net/bluetooth/cmtp/sock.c | |||
| @@ -72,7 +72,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
| 72 | switch (cmd) { | 72 | switch (cmd) { |
| 73 | case CMTPCONNADD: | 73 | case CMTPCONNADD: |
| 74 | if (!capable(CAP_NET_ADMIN)) | 74 | if (!capable(CAP_NET_ADMIN)) |
| 75 | return -EACCES; | 75 | return -EPERM; |
| 76 | 76 | ||
| 77 | if (copy_from_user(&ca, argp, sizeof(ca))) | 77 | if (copy_from_user(&ca, argp, sizeof(ca))) |
| 78 | return -EFAULT; | 78 | return -EFAULT; |
| @@ -97,7 +97,7 @@ static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
| 97 | 97 | ||
| 98 | case CMTPCONNDEL: | 98 | case CMTPCONNDEL: |
| 99 | if (!capable(CAP_NET_ADMIN)) | 99 | if (!capable(CAP_NET_ADMIN)) |
| 100 | return -EACCES; | 100 | return -EPERM; |
| 101 | 101 | ||
| 102 | if (copy_from_user(&cd, argp, sizeof(cd))) | 102 | if (copy_from_user(&cd, argp, sizeof(cd))) |
| 103 | return -EFAULT; | 103 | return -EFAULT; |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 19fdac78e555..d5ace1eda3ed 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
| @@ -490,7 +490,7 @@ static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, | |||
| 490 | switch (cmd) { | 490 | switch (cmd) { |
| 491 | case HCISETRAW: | 491 | case HCISETRAW: |
| 492 | if (!capable(CAP_NET_ADMIN)) | 492 | if (!capable(CAP_NET_ADMIN)) |
| 493 | return -EACCES; | 493 | return -EPERM; |
| 494 | 494 | ||
| 495 | if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) | 495 | if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks)) |
| 496 | return -EPERM; | 496 | return -EPERM; |
| @@ -510,12 +510,12 @@ static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd, | |||
| 510 | 510 | ||
| 511 | case HCIBLOCKADDR: | 511 | case HCIBLOCKADDR: |
| 512 | if (!capable(CAP_NET_ADMIN)) | 512 | if (!capable(CAP_NET_ADMIN)) |
| 513 | return -EACCES; | 513 | return -EPERM; |
| 514 | return hci_sock_blacklist_add(hdev, (void __user *) arg); | 514 | return hci_sock_blacklist_add(hdev, (void __user *) arg); |
| 515 | 515 | ||
| 516 | case HCIUNBLOCKADDR: | 516 | case HCIUNBLOCKADDR: |
| 517 | if (!capable(CAP_NET_ADMIN)) | 517 | if (!capable(CAP_NET_ADMIN)) |
| 518 | return -EACCES; | 518 | return -EPERM; |
| 519 | return hci_sock_blacklist_del(hdev, (void __user *) arg); | 519 | return hci_sock_blacklist_del(hdev, (void __user *) arg); |
| 520 | 520 | ||
| 521 | default: | 521 | default: |
| @@ -546,22 +546,22 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, | |||
| 546 | 546 | ||
| 547 | case HCIDEVUP: | 547 | case HCIDEVUP: |
| 548 | if (!capable(CAP_NET_ADMIN)) | 548 | if (!capable(CAP_NET_ADMIN)) |
| 549 | return -EACCES; | 549 | return -EPERM; |
| 550 | return hci_dev_open(arg); | 550 | return hci_dev_open(arg); |
| 551 | 551 | ||
| 552 | case HCIDEVDOWN: | 552 | case HCIDEVDOWN: |
| 553 | if (!capable(CAP_NET_ADMIN)) | 553 | if (!capable(CAP_NET_ADMIN)) |
| 554 | return -EACCES; | 554 | return -EPERM; |
| 555 | return hci_dev_close(arg); | 555 | return hci_dev_close(arg); |
| 556 | 556 | ||
| 557 | case HCIDEVRESET: | 557 | case HCIDEVRESET: |
| 558 | if (!capable(CAP_NET_ADMIN)) | 558 | if (!capable(CAP_NET_ADMIN)) |
| 559 | return -EACCES; | 559 | return -EPERM; |
| 560 | return hci_dev_reset(arg); | 560 | return hci_dev_reset(arg); |
| 561 | 561 | ||
| 562 | case HCIDEVRESTAT: | 562 | case HCIDEVRESTAT: |
| 563 | if (!capable(CAP_NET_ADMIN)) | 563 | if (!capable(CAP_NET_ADMIN)) |
| 564 | return -EACCES; | 564 | return -EPERM; |
| 565 | return hci_dev_reset_stat(arg); | 565 | return hci_dev_reset_stat(arg); |
| 566 | 566 | ||
| 567 | case HCISETSCAN: | 567 | case HCISETSCAN: |
| @@ -573,7 +573,7 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, | |||
| 573 | case HCISETACLMTU: | 573 | case HCISETACLMTU: |
| 574 | case HCISETSCOMTU: | 574 | case HCISETSCOMTU: |
| 575 | if (!capable(CAP_NET_ADMIN)) | 575 | if (!capable(CAP_NET_ADMIN)) |
| 576 | return -EACCES; | 576 | return -EPERM; |
| 577 | return hci_dev_cmd(cmd, argp); | 577 | return hci_dev_cmd(cmd, argp); |
| 578 | 578 | ||
| 579 | case HCIINQUIRY: | 579 | case HCIINQUIRY: |
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c index 18b3f6892a36..b24fb3bd8625 100644 --- a/net/bluetooth/hidp/sock.c +++ b/net/bluetooth/hidp/sock.c | |||
| @@ -56,7 +56,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
| 56 | switch (cmd) { | 56 | switch (cmd) { |
| 57 | case HIDPCONNADD: | 57 | case HIDPCONNADD: |
| 58 | if (!capable(CAP_NET_ADMIN)) | 58 | if (!capable(CAP_NET_ADMIN)) |
| 59 | return -EACCES; | 59 | return -EPERM; |
| 60 | 60 | ||
| 61 | if (copy_from_user(&ca, argp, sizeof(ca))) | 61 | if (copy_from_user(&ca, argp, sizeof(ca))) |
| 62 | return -EFAULT; | 62 | return -EFAULT; |
| @@ -91,7 +91,7 @@ static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long | |||
| 91 | 91 | ||
| 92 | case HIDPCONNDEL: | 92 | case HIDPCONNDEL: |
| 93 | if (!capable(CAP_NET_ADMIN)) | 93 | if (!capable(CAP_NET_ADMIN)) |
| 94 | return -EACCES; | 94 | return -EPERM; |
| 95 | 95 | ||
| 96 | if (copy_from_user(&cd, argp, sizeof(cd))) | 96 | if (copy_from_user(&cd, argp, sizeof(cd))) |
| 97 | return -EFAULT; | 97 | return -EFAULT; |
diff --git a/net/core/dev.c b/net/core/dev.c index d7fe32c946c1..89e33a5d4d93 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2134,7 +2134,8 @@ static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) | |||
| 2134 | static netdev_features_t harmonize_features(struct sk_buff *skb, | 2134 | static netdev_features_t harmonize_features(struct sk_buff *skb, |
| 2135 | __be16 protocol, netdev_features_t features) | 2135 | __be16 protocol, netdev_features_t features) |
| 2136 | { | 2136 | { |
| 2137 | if (!can_checksum_protocol(features, protocol)) { | 2137 | if (skb->ip_summed != CHECKSUM_NONE && |
| 2138 | !can_checksum_protocol(features, protocol)) { | ||
| 2138 | features &= ~NETIF_F_ALL_CSUM; | 2139 | features &= ~NETIF_F_ALL_CSUM; |
| 2139 | features &= ~NETIF_F_SG; | 2140 | features &= ~NETIF_F_SG; |
| 2140 | } else if (illegal_highdma(skb->dev, skb)) { | 2141 | } else if (illegal_highdma(skb->dev, skb)) { |
| @@ -3322,7 +3323,7 @@ ncls: | |||
| 3322 | 3323 | ||
| 3323 | if (pt_prev) { | 3324 | if (pt_prev) { |
| 3324 | if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) | 3325 | if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) |
| 3325 | ret = -ENOMEM; | 3326 | goto drop; |
| 3326 | else | 3327 | else |
| 3327 | ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); | 3328 | ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); |
| 3328 | } else { | 3329 | } else { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index fe00d1208167..e33ebae519c8 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -3502,7 +3502,9 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from, | |||
| 3502 | if (!skb_cloned(from)) | 3502 | if (!skb_cloned(from)) |
| 3503 | skb_shinfo(from)->nr_frags = 0; | 3503 | skb_shinfo(from)->nr_frags = 0; |
| 3504 | 3504 | ||
| 3505 | /* if the skb is cloned this does nothing since we set nr_frags to 0 */ | 3505 | /* if the skb is not cloned this does nothing |
| 3506 | * since we set nr_frags to 0. | ||
| 3507 | */ | ||
| 3506 | for (i = 0; i < skb_shinfo(from)->nr_frags; i++) | 3508 | for (i = 0; i < skb_shinfo(from)->nr_frags; i++) |
| 3507 | skb_frag_ref(from, i); | 3509 | skb_frag_ref(from, i); |
| 3508 | 3510 | ||
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 77e87aff419a..47800459e4cb 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
| @@ -1225,7 +1225,7 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, | |||
| 1225 | switch (event) { | 1225 | switch (event) { |
| 1226 | case NETDEV_CHANGEADDR: | 1226 | case NETDEV_CHANGEADDR: |
| 1227 | neigh_changeaddr(&arp_tbl, dev); | 1227 | neigh_changeaddr(&arp_tbl, dev); |
| 1228 | rt_cache_flush(dev_net(dev), 0); | 1228 | rt_cache_flush(dev_net(dev)); |
| 1229 | break; | 1229 | break; |
| 1230 | default: | 1230 | default: |
| 1231 | break; | 1231 | break; |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 44bf82e3aef7..e12fad773852 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
| @@ -725,7 +725,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
| 725 | break; | 725 | break; |
| 726 | 726 | ||
| 727 | case SIOCSIFFLAGS: | 727 | case SIOCSIFFLAGS: |
| 728 | ret = -EACCES; | 728 | ret = -EPERM; |
| 729 | if (!capable(CAP_NET_ADMIN)) | 729 | if (!capable(CAP_NET_ADMIN)) |
| 730 | goto out; | 730 | goto out; |
| 731 | break; | 731 | break; |
| @@ -733,7 +733,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
| 733 | case SIOCSIFBRDADDR: /* Set the broadcast address */ | 733 | case SIOCSIFBRDADDR: /* Set the broadcast address */ |
| 734 | case SIOCSIFDSTADDR: /* Set the destination address */ | 734 | case SIOCSIFDSTADDR: /* Set the destination address */ |
| 735 | case SIOCSIFNETMASK: /* Set the netmask for the interface */ | 735 | case SIOCSIFNETMASK: /* Set the netmask for the interface */ |
| 736 | ret = -EACCES; | 736 | ret = -EPERM; |
| 737 | if (!capable(CAP_NET_ADMIN)) | 737 | if (!capable(CAP_NET_ADMIN)) |
| 738 | goto out; | 738 | goto out; |
| 739 | ret = -EINVAL; | 739 | ret = -EINVAL; |
| @@ -1503,7 +1503,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write, | |||
| 1503 | if (i == IPV4_DEVCONF_ACCEPT_LOCAL - 1 || | 1503 | if (i == IPV4_DEVCONF_ACCEPT_LOCAL - 1 || |
| 1504 | i == IPV4_DEVCONF_ROUTE_LOCALNET - 1) | 1504 | i == IPV4_DEVCONF_ROUTE_LOCALNET - 1) |
| 1505 | if ((new_value == 0) && (old_value != 0)) | 1505 | if ((new_value == 0) && (old_value != 0)) |
| 1506 | rt_cache_flush(net, 0); | 1506 | rt_cache_flush(net); |
| 1507 | } | 1507 | } |
| 1508 | 1508 | ||
| 1509 | return ret; | 1509 | return ret; |
| @@ -1537,7 +1537,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, | |||
| 1537 | dev_disable_lro(idev->dev); | 1537 | dev_disable_lro(idev->dev); |
| 1538 | } | 1538 | } |
| 1539 | rtnl_unlock(); | 1539 | rtnl_unlock(); |
| 1540 | rt_cache_flush(net, 0); | 1540 | rt_cache_flush(net); |
| 1541 | } | 1541 | } |
| 1542 | } | 1542 | } |
| 1543 | 1543 | ||
| @@ -1554,7 +1554,7 @@ static int ipv4_doint_and_flush(ctl_table *ctl, int write, | |||
| 1554 | struct net *net = ctl->extra2; | 1554 | struct net *net = ctl->extra2; |
| 1555 | 1555 | ||
| 1556 | if (write && *valp != val) | 1556 | if (write && *valp != val) |
| 1557 | rt_cache_flush(net, 0); | 1557 | rt_cache_flush(net); |
| 1558 | 1558 | ||
| 1559 | return ret; | 1559 | return ret; |
| 1560 | } | 1560 | } |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index c43ae3fba792..8e2b475da9fa 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
| @@ -148,7 +148,7 @@ static void fib_flush(struct net *net) | |||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | if (flushed) | 150 | if (flushed) |
| 151 | rt_cache_flush(net, -1); | 151 | rt_cache_flush(net); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | /* | 154 | /* |
| @@ -999,11 +999,11 @@ static void nl_fib_lookup_exit(struct net *net) | |||
| 999 | net->ipv4.fibnl = NULL; | 999 | net->ipv4.fibnl = NULL; |
| 1000 | } | 1000 | } |
| 1001 | 1001 | ||
| 1002 | static void fib_disable_ip(struct net_device *dev, int force, int delay) | 1002 | static void fib_disable_ip(struct net_device *dev, int force) |
| 1003 | { | 1003 | { |
| 1004 | if (fib_sync_down_dev(dev, force)) | 1004 | if (fib_sync_down_dev(dev, force)) |
| 1005 | fib_flush(dev_net(dev)); | 1005 | fib_flush(dev_net(dev)); |
| 1006 | rt_cache_flush(dev_net(dev), delay); | 1006 | rt_cache_flush(dev_net(dev)); |
| 1007 | arp_ifdown(dev); | 1007 | arp_ifdown(dev); |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| @@ -1020,7 +1020,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
| 1020 | fib_sync_up(dev); | 1020 | fib_sync_up(dev); |
| 1021 | #endif | 1021 | #endif |
| 1022 | atomic_inc(&net->ipv4.dev_addr_genid); | 1022 | atomic_inc(&net->ipv4.dev_addr_genid); |
| 1023 | rt_cache_flush(dev_net(dev), -1); | 1023 | rt_cache_flush(dev_net(dev)); |
| 1024 | break; | 1024 | break; |
| 1025 | case NETDEV_DOWN: | 1025 | case NETDEV_DOWN: |
| 1026 | fib_del_ifaddr(ifa, NULL); | 1026 | fib_del_ifaddr(ifa, NULL); |
| @@ -1029,9 +1029,9 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
| 1029 | /* Last address was deleted from this interface. | 1029 | /* Last address was deleted from this interface. |
| 1030 | * Disable IP. | 1030 | * Disable IP. |
| 1031 | */ | 1031 | */ |
| 1032 | fib_disable_ip(dev, 1, 0); | 1032 | fib_disable_ip(dev, 1); |
| 1033 | } else { | 1033 | } else { |
| 1034 | rt_cache_flush(dev_net(dev), -1); | 1034 | rt_cache_flush(dev_net(dev)); |
| 1035 | } | 1035 | } |
| 1036 | break; | 1036 | break; |
| 1037 | } | 1037 | } |
| @@ -1045,7 +1045,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo | |||
| 1045 | struct net *net = dev_net(dev); | 1045 | struct net *net = dev_net(dev); |
| 1046 | 1046 | ||
| 1047 | if (event == NETDEV_UNREGISTER) { | 1047 | if (event == NETDEV_UNREGISTER) { |
| 1048 | fib_disable_ip(dev, 2, -1); | 1048 | fib_disable_ip(dev, 2); |
| 1049 | rt_flush_dev(dev); | 1049 | rt_flush_dev(dev); |
| 1050 | return NOTIFY_DONE; | 1050 | return NOTIFY_DONE; |
| 1051 | } | 1051 | } |
| @@ -1062,14 +1062,14 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo | |||
| 1062 | fib_sync_up(dev); | 1062 | fib_sync_up(dev); |
| 1063 | #endif | 1063 | #endif |
| 1064 | atomic_inc(&net->ipv4.dev_addr_genid); | 1064 | atomic_inc(&net->ipv4.dev_addr_genid); |
| 1065 | rt_cache_flush(dev_net(dev), -1); | 1065 | rt_cache_flush(dev_net(dev)); |
| 1066 | break; | 1066 | break; |
| 1067 | case NETDEV_DOWN: | 1067 | case NETDEV_DOWN: |
| 1068 | fib_disable_ip(dev, 0, 0); | 1068 | fib_disable_ip(dev, 0); |
| 1069 | break; | 1069 | break; |
| 1070 | case NETDEV_CHANGEMTU: | 1070 | case NETDEV_CHANGEMTU: |
| 1071 | case NETDEV_CHANGE: | 1071 | case NETDEV_CHANGE: |
| 1072 | rt_cache_flush(dev_net(dev), 0); | 1072 | rt_cache_flush(dev_net(dev)); |
| 1073 | break; | 1073 | break; |
| 1074 | case NETDEV_UNREGISTER_BATCH: | 1074 | case NETDEV_UNREGISTER_BATCH: |
| 1075 | break; | 1075 | break; |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index a83d74e498d2..274309d3aded 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
| @@ -259,7 +259,7 @@ static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule) | |||
| 259 | 259 | ||
| 260 | static void fib4_rule_flush_cache(struct fib_rules_ops *ops) | 260 | static void fib4_rule_flush_cache(struct fib_rules_ops *ops) |
| 261 | { | 261 | { |
| 262 | rt_cache_flush(ops->fro_net, -1); | 262 | rt_cache_flush(ops->fro_net); |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | static const struct fib_rules_ops __net_initdata fib4_rules_ops_template = { | 265 | static const struct fib_rules_ops __net_initdata fib4_rules_ops_template = { |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 57bd978483e1..d1b93595b4a7 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
| @@ -1286,7 +1286,7 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg) | |||
| 1286 | 1286 | ||
| 1287 | fib_release_info(fi_drop); | 1287 | fib_release_info(fi_drop); |
| 1288 | if (state & FA_S_ACCESSED) | 1288 | if (state & FA_S_ACCESSED) |
| 1289 | rt_cache_flush(cfg->fc_nlinfo.nl_net, -1); | 1289 | rt_cache_flush(cfg->fc_nlinfo.nl_net); |
| 1290 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, | 1290 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, |
| 1291 | tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE); | 1291 | tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE); |
| 1292 | 1292 | ||
| @@ -1333,7 +1333,7 @@ int fib_table_insert(struct fib_table *tb, struct fib_config *cfg) | |||
| 1333 | list_add_tail_rcu(&new_fa->fa_list, | 1333 | list_add_tail_rcu(&new_fa->fa_list, |
| 1334 | (fa ? &fa->fa_list : fa_head)); | 1334 | (fa ? &fa->fa_list : fa_head)); |
| 1335 | 1335 | ||
| 1336 | rt_cache_flush(cfg->fc_nlinfo.nl_net, -1); | 1336 | rt_cache_flush(cfg->fc_nlinfo.nl_net); |
| 1337 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id, | 1337 | rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen, tb->tb_id, |
| 1338 | &cfg->fc_nlinfo, 0); | 1338 | &cfg->fc_nlinfo, 0); |
| 1339 | succeeded: | 1339 | succeeded: |
| @@ -1708,7 +1708,7 @@ int fib_table_delete(struct fib_table *tb, struct fib_config *cfg) | |||
| 1708 | trie_leaf_remove(t, l); | 1708 | trie_leaf_remove(t, l); |
| 1709 | 1709 | ||
| 1710 | if (fa->fa_state & FA_S_ACCESSED) | 1710 | if (fa->fa_state & FA_S_ACCESSED) |
| 1711 | rt_cache_flush(cfg->fc_nlinfo.nl_net, -1); | 1711 | rt_cache_flush(cfg->fc_nlinfo.nl_net); |
| 1712 | 1712 | ||
| 1713 | fib_release_info(fa->fa_info); | 1713 | fib_release_info(fa->fa_info); |
| 1714 | alias_free_mem_rcu(fa); | 1714 | alias_free_mem_rcu(fa); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 82cf2a722b23..fd9af60397b5 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -202,11 +202,6 @@ EXPORT_SYMBOL(ip_tos2prio); | |||
| 202 | static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); | 202 | static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); |
| 203 | #define RT_CACHE_STAT_INC(field) __this_cpu_inc(rt_cache_stat.field) | 203 | #define RT_CACHE_STAT_INC(field) __this_cpu_inc(rt_cache_stat.field) |
| 204 | 204 | ||
| 205 | static inline int rt_genid(struct net *net) | ||
| 206 | { | ||
| 207 | return atomic_read(&net->ipv4.rt_genid); | ||
| 208 | } | ||
| 209 | |||
| 210 | #ifdef CONFIG_PROC_FS | 205 | #ifdef CONFIG_PROC_FS |
| 211 | static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) | 206 | static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) |
| 212 | { | 207 | { |
| @@ -447,27 +442,9 @@ static inline bool rt_is_expired(const struct rtable *rth) | |||
| 447 | return rth->rt_genid != rt_genid(dev_net(rth->dst.dev)); | 442 | return rth->rt_genid != rt_genid(dev_net(rth->dst.dev)); |
| 448 | } | 443 | } |
| 449 | 444 | ||
| 450 | /* | 445 | void rt_cache_flush(struct net *net) |
| 451 | * Perturbation of rt_genid by a small quantity [1..256] | ||
| 452 | * Using 8 bits of shuffling ensure we can call rt_cache_invalidate() | ||
| 453 | * many times (2^24) without giving recent rt_genid. | ||
| 454 | * Jenkins hash is strong enough that litle changes of rt_genid are OK. | ||
| 455 | */ | ||
| 456 | static void rt_cache_invalidate(struct net *net) | ||
| 457 | { | 446 | { |
| 458 | unsigned char shuffle; | 447 | rt_genid_bump(net); |
| 459 | |||
| 460 | get_random_bytes(&shuffle, sizeof(shuffle)); | ||
| 461 | atomic_add(shuffle + 1U, &net->ipv4.rt_genid); | ||
| 462 | } | ||
| 463 | |||
| 464 | /* | ||
| 465 | * delay < 0 : invalidate cache (fast : entries will be deleted later) | ||
| 466 | * delay >= 0 : invalidate & flush cache (can be long) | ||
| 467 | */ | ||
| 468 | void rt_cache_flush(struct net *net, int delay) | ||
| 469 | { | ||
| 470 | rt_cache_invalidate(net); | ||
| 471 | } | 448 | } |
| 472 | 449 | ||
| 473 | static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, | 450 | static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, |
| @@ -2345,7 +2322,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 2345 | 2322 | ||
| 2346 | void ip_rt_multicast_event(struct in_device *in_dev) | 2323 | void ip_rt_multicast_event(struct in_device *in_dev) |
| 2347 | { | 2324 | { |
| 2348 | rt_cache_flush(dev_net(in_dev->dev), 0); | 2325 | rt_cache_flush(dev_net(in_dev->dev)); |
| 2349 | } | 2326 | } |
| 2350 | 2327 | ||
| 2351 | #ifdef CONFIG_SYSCTL | 2328 | #ifdef CONFIG_SYSCTL |
| @@ -2354,16 +2331,7 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write, | |||
| 2354 | size_t *lenp, loff_t *ppos) | 2331 | size_t *lenp, loff_t *ppos) |
| 2355 | { | 2332 | { |
| 2356 | if (write) { | 2333 | if (write) { |
| 2357 | int flush_delay; | 2334 | rt_cache_flush((struct net *)__ctl->extra1); |
| 2358 | ctl_table ctl; | ||
| 2359 | struct net *net; | ||
| 2360 | |||
| 2361 | memcpy(&ctl, __ctl, sizeof(ctl)); | ||
| 2362 | ctl.data = &flush_delay; | ||
| 2363 | proc_dointvec(&ctl, write, buffer, lenp, ppos); | ||
| 2364 | |||
| 2365 | net = (struct net *)__ctl->extra1; | ||
| 2366 | rt_cache_flush(net, flush_delay); | ||
| 2367 | return 0; | 2335 | return 0; |
| 2368 | } | 2336 | } |
| 2369 | 2337 | ||
| @@ -2533,8 +2501,7 @@ static __net_initdata struct pernet_operations sysctl_route_ops = { | |||
| 2533 | 2501 | ||
| 2534 | static __net_init int rt_genid_init(struct net *net) | 2502 | static __net_init int rt_genid_init(struct net *net) |
| 2535 | { | 2503 | { |
| 2536 | get_random_bytes(&net->ipv4.rt_genid, | 2504 | atomic_set(&net->rt_genid, 0); |
| 2537 | sizeof(net->ipv4.rt_genid)); | ||
| 2538 | get_random_bytes(&net->ipv4.dev_addr_genid, | 2505 | get_random_bytes(&net->ipv4.dev_addr_genid, |
| 2539 | sizeof(net->ipv4.dev_addr_genid)); | 2506 | sizeof(net->ipv4.dev_addr_genid)); |
| 2540 | return 0; | 2507 | return 0; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 2109ff4a1daf..5f6419341821 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -1762,8 +1762,14 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 1762 | } | 1762 | } |
| 1763 | 1763 | ||
| 1764 | #ifdef CONFIG_NET_DMA | 1764 | #ifdef CONFIG_NET_DMA |
| 1765 | if (tp->ucopy.dma_chan) | 1765 | if (tp->ucopy.dma_chan) { |
| 1766 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | 1766 | if (tp->rcv_wnd == 0 && |
| 1767 | !skb_queue_empty(&sk->sk_async_wait_queue)) { | ||
| 1768 | tcp_service_net_dma(sk, true); | ||
| 1769 | tcp_cleanup_rbuf(sk, copied); | ||
| 1770 | } else | ||
| 1771 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
| 1772 | } | ||
| 1767 | #endif | 1773 | #endif |
| 1768 | if (copied >= target) { | 1774 | if (copied >= target) { |
| 1769 | /* Do not sleep, just process backlog. */ | 1775 | /* Do not sleep, just process backlog. */ |
| @@ -2325,10 +2331,17 @@ static int tcp_repair_options_est(struct tcp_sock *tp, | |||
| 2325 | tp->rx_opt.mss_clamp = opt.opt_val; | 2331 | tp->rx_opt.mss_clamp = opt.opt_val; |
| 2326 | break; | 2332 | break; |
| 2327 | case TCPOPT_WINDOW: | 2333 | case TCPOPT_WINDOW: |
| 2328 | if (opt.opt_val > 14) | 2334 | { |
| 2329 | return -EFBIG; | 2335 | u16 snd_wscale = opt.opt_val & 0xFFFF; |
| 2336 | u16 rcv_wscale = opt.opt_val >> 16; | ||
| 2337 | |||
| 2338 | if (snd_wscale > 14 || rcv_wscale > 14) | ||
| 2339 | return -EFBIG; | ||
| 2330 | 2340 | ||
| 2331 | tp->rx_opt.snd_wscale = opt.opt_val; | 2341 | tp->rx_opt.snd_wscale = snd_wscale; |
| 2342 | tp->rx_opt.rcv_wscale = rcv_wscale; | ||
| 2343 | tp->rx_opt.wscale_ok = 1; | ||
| 2344 | } | ||
| 2332 | break; | 2345 | break; |
| 2333 | case TCPOPT_SACK_PERM: | 2346 | case TCPOPT_SACK_PERM: |
| 2334 | if (opt.opt_val != 0) | 2347 | if (opt.opt_val != 0) |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 6e38c6c23caa..d377f4854cb8 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -4661,7 +4661,7 @@ queue_and_out: | |||
| 4661 | 4661 | ||
| 4662 | if (eaten > 0) | 4662 | if (eaten > 0) |
| 4663 | kfree_skb_partial(skb, fragstolen); | 4663 | kfree_skb_partial(skb, fragstolen); |
| 4664 | else if (!sock_flag(sk, SOCK_DEAD)) | 4664 | if (!sock_flag(sk, SOCK_DEAD)) |
| 4665 | sk->sk_data_ready(sk, 0); | 4665 | sk->sk_data_ready(sk, 0); |
| 4666 | return; | 4666 | return; |
| 4667 | } | 4667 | } |
| @@ -5556,8 +5556,7 @@ no_ack: | |||
| 5556 | #endif | 5556 | #endif |
| 5557 | if (eaten) | 5557 | if (eaten) |
| 5558 | kfree_skb_partial(skb, fragstolen); | 5558 | kfree_skb_partial(skb, fragstolen); |
| 5559 | else | 5559 | sk->sk_data_ready(sk, 0); |
| 5560 | sk->sk_data_ready(sk, 0); | ||
| 5561 | return 0; | 5560 | return 0; |
| 5562 | } | 5561 | } |
| 5563 | } | 5562 | } |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 0251a6005be8..c4f934176cab 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
| @@ -175,33 +175,12 @@ void __inet6_csk_dst_store(struct sock *sk, struct dst_entry *dst, | |||
| 175 | const struct in6_addr *saddr) | 175 | const struct in6_addr *saddr) |
| 176 | { | 176 | { |
| 177 | __ip6_dst_store(sk, dst, daddr, saddr); | 177 | __ip6_dst_store(sk, dst, daddr, saddr); |
| 178 | |||
| 179 | #ifdef CONFIG_XFRM | ||
| 180 | { | ||
| 181 | struct rt6_info *rt = (struct rt6_info *)dst; | ||
| 182 | rt->rt6i_flow_cache_genid = atomic_read(&flow_cache_genid); | ||
| 183 | } | ||
| 184 | #endif | ||
| 185 | } | 178 | } |
| 186 | 179 | ||
| 187 | static inline | 180 | static inline |
| 188 | struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie) | 181 | struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie) |
| 189 | { | 182 | { |
| 190 | struct dst_entry *dst; | 183 | return __sk_dst_check(sk, cookie); |
| 191 | |||
| 192 | dst = __sk_dst_check(sk, cookie); | ||
| 193 | |||
| 194 | #ifdef CONFIG_XFRM | ||
| 195 | if (dst) { | ||
| 196 | struct rt6_info *rt = (struct rt6_info *)dst; | ||
| 197 | if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) { | ||
| 198 | __sk_dst_reset(sk); | ||
| 199 | dst = NULL; | ||
| 200 | } | ||
| 201 | } | ||
| 202 | #endif | ||
| 203 | |||
| 204 | return dst; | ||
| 205 | } | 184 | } |
| 206 | 185 | ||
| 207 | static struct dst_entry *inet6_csk_route_socket(struct sock *sk, | 186 | static struct dst_entry *inet6_csk_route_socket(struct sock *sk, |
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 13690d650c3e..286acfc21250 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
| @@ -819,6 +819,10 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) | |||
| 819 | offsetof(struct rt6_info, rt6i_src), | 819 | offsetof(struct rt6_info, rt6i_src), |
| 820 | allow_create, replace_required); | 820 | allow_create, replace_required); |
| 821 | 821 | ||
| 822 | if (IS_ERR(sn)) { | ||
| 823 | err = PTR_ERR(sn); | ||
| 824 | sn = NULL; | ||
| 825 | } | ||
| 822 | if (!sn) { | 826 | if (!sn) { |
| 823 | /* If it is failed, discard just allocated | 827 | /* If it is failed, discard just allocated |
| 824 | root, and then (in st_failure) stale node | 828 | root, and then (in st_failure) stale node |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 8e80fd279100..854e4018d205 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -226,7 +226,7 @@ static struct rt6_info ip6_null_entry_template = { | |||
| 226 | .dst = { | 226 | .dst = { |
| 227 | .__refcnt = ATOMIC_INIT(1), | 227 | .__refcnt = ATOMIC_INIT(1), |
| 228 | .__use = 1, | 228 | .__use = 1, |
| 229 | .obsolete = -1, | 229 | .obsolete = DST_OBSOLETE_FORCE_CHK, |
| 230 | .error = -ENETUNREACH, | 230 | .error = -ENETUNREACH, |
| 231 | .input = ip6_pkt_discard, | 231 | .input = ip6_pkt_discard, |
| 232 | .output = ip6_pkt_discard_out, | 232 | .output = ip6_pkt_discard_out, |
| @@ -246,7 +246,7 @@ static struct rt6_info ip6_prohibit_entry_template = { | |||
| 246 | .dst = { | 246 | .dst = { |
| 247 | .__refcnt = ATOMIC_INIT(1), | 247 | .__refcnt = ATOMIC_INIT(1), |
| 248 | .__use = 1, | 248 | .__use = 1, |
| 249 | .obsolete = -1, | 249 | .obsolete = DST_OBSOLETE_FORCE_CHK, |
| 250 | .error = -EACCES, | 250 | .error = -EACCES, |
| 251 | .input = ip6_pkt_prohibit, | 251 | .input = ip6_pkt_prohibit, |
| 252 | .output = ip6_pkt_prohibit_out, | 252 | .output = ip6_pkt_prohibit_out, |
| @@ -261,7 +261,7 @@ static struct rt6_info ip6_blk_hole_entry_template = { | |||
| 261 | .dst = { | 261 | .dst = { |
| 262 | .__refcnt = ATOMIC_INIT(1), | 262 | .__refcnt = ATOMIC_INIT(1), |
| 263 | .__use = 1, | 263 | .__use = 1, |
| 264 | .obsolete = -1, | 264 | .obsolete = DST_OBSOLETE_FORCE_CHK, |
| 265 | .error = -EINVAL, | 265 | .error = -EINVAL, |
| 266 | .input = dst_discard, | 266 | .input = dst_discard, |
| 267 | .output = dst_discard, | 267 | .output = dst_discard, |
| @@ -281,13 +281,14 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net, | |||
| 281 | struct fib6_table *table) | 281 | struct fib6_table *table) |
| 282 | { | 282 | { |
| 283 | struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, | 283 | struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev, |
| 284 | 0, DST_OBSOLETE_NONE, flags); | 284 | 0, DST_OBSOLETE_FORCE_CHK, flags); |
| 285 | 285 | ||
| 286 | if (rt) { | 286 | if (rt) { |
| 287 | struct dst_entry *dst = &rt->dst; | 287 | struct dst_entry *dst = &rt->dst; |
| 288 | 288 | ||
| 289 | memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); | 289 | memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); |
| 290 | rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); | 290 | rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); |
| 291 | rt->rt6i_genid = rt_genid(net); | ||
| 291 | } | 292 | } |
| 292 | return rt; | 293 | return rt; |
| 293 | } | 294 | } |
| @@ -1031,6 +1032,13 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) | |||
| 1031 | 1032 | ||
| 1032 | rt = (struct rt6_info *) dst; | 1033 | rt = (struct rt6_info *) dst; |
| 1033 | 1034 | ||
| 1035 | /* All IPV6 dsts are created with ->obsolete set to the value | ||
| 1036 | * DST_OBSOLETE_FORCE_CHK which forces validation calls down | ||
| 1037 | * into this function always. | ||
| 1038 | */ | ||
| 1039 | if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev))) | ||
| 1040 | return NULL; | ||
| 1041 | |||
| 1034 | if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) { | 1042 | if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) { |
| 1035 | if (rt->rt6i_peer_genid != rt6_peer_genid()) { | 1043 | if (rt->rt6i_peer_genid != rt6_peer_genid()) { |
| 1036 | if (!rt6_has_peer(rt)) | 1044 | if (!rt6_has_peer(rt)) |
| @@ -1397,8 +1405,6 @@ int ip6_route_add(struct fib6_config *cfg) | |||
| 1397 | goto out; | 1405 | goto out; |
| 1398 | } | 1406 | } |
| 1399 | 1407 | ||
| 1400 | rt->dst.obsolete = -1; | ||
| 1401 | |||
| 1402 | if (cfg->fc_flags & RTF_EXPIRES) | 1408 | if (cfg->fc_flags & RTF_EXPIRES) |
| 1403 | rt6_set_expires(rt, jiffies + | 1409 | rt6_set_expires(rt, jiffies + |
| 1404 | clock_t_to_jiffies(cfg->fc_expires)); | 1410 | clock_t_to_jiffies(cfg->fc_expires)); |
| @@ -2080,7 +2086,6 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
| 2080 | rt->dst.input = ip6_input; | 2086 | rt->dst.input = ip6_input; |
| 2081 | rt->dst.output = ip6_output; | 2087 | rt->dst.output = ip6_output; |
| 2082 | rt->rt6i_idev = idev; | 2088 | rt->rt6i_idev = idev; |
| 2083 | rt->dst.obsolete = -1; | ||
| 2084 | 2089 | ||
| 2085 | rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; | 2090 | rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; |
| 2086 | if (anycast) | 2091 | if (anycast) |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 1b9024ee963c..7261eb81974f 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
| @@ -601,7 +601,7 @@ static int nr_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
| 601 | if (!capable(CAP_NET_BIND_SERVICE)) { | 601 | if (!capable(CAP_NET_BIND_SERVICE)) { |
| 602 | dev_put(dev); | 602 | dev_put(dev); |
| 603 | release_sock(sk); | 603 | release_sock(sk); |
| 604 | return -EACCES; | 604 | return -EPERM; |
| 605 | } | 605 | } |
| 606 | nr->user_addr = addr->fsa_digipeater[0]; | 606 | nr->user_addr = addr->fsa_digipeater[0]; |
| 607 | nr->source_addr = addr->fsa_ax25.sax25_call; | 607 | nr->source_addr = addr->fsa_ax25.sax25_call; |
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index e4723d31fdd5..211a21217045 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c | |||
| @@ -865,7 +865,10 @@ static void qfq_update_start(struct qfq_sched *q, struct qfq_class *cl) | |||
| 865 | if (mask) { | 865 | if (mask) { |
| 866 | struct qfq_group *next = qfq_ffs(q, mask); | 866 | struct qfq_group *next = qfq_ffs(q, mask); |
| 867 | if (qfq_gt(roundedF, next->F)) { | 867 | if (qfq_gt(roundedF, next->F)) { |
| 868 | cl->S = next->F; | 868 | if (qfq_gt(limit, next->F)) |
| 869 | cl->S = next->F; | ||
| 870 | else /* preserve timestamp correctness */ | ||
| 871 | cl->S = limit; | ||
| 869 | return; | 872 | return; |
| 870 | } | 873 | } |
| 871 | } | 874 | } |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 5a2aa17e4d3c..387848e90078 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -585,6 +585,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) | |||
| 585 | xfrm_pol_hold(policy); | 585 | xfrm_pol_hold(policy); |
| 586 | net->xfrm.policy_count[dir]++; | 586 | net->xfrm.policy_count[dir]++; |
| 587 | atomic_inc(&flow_cache_genid); | 587 | atomic_inc(&flow_cache_genid); |
| 588 | rt_genid_bump(net); | ||
| 588 | if (delpol) | 589 | if (delpol) |
| 589 | __xfrm_policy_unlink(delpol, dir); | 590 | __xfrm_policy_unlink(delpol, dir); |
| 590 | policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir); | 591 | policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir); |
| @@ -1763,7 +1764,7 @@ static struct dst_entry *make_blackhole(struct net *net, u16 family, | |||
| 1763 | 1764 | ||
| 1764 | if (!afinfo) { | 1765 | if (!afinfo) { |
| 1765 | dst_release(dst_orig); | 1766 | dst_release(dst_orig); |
| 1766 | ret = ERR_PTR(-EINVAL); | 1767 | return ERR_PTR(-EINVAL); |
| 1767 | } else { | 1768 | } else { |
| 1768 | ret = afinfo->blackhole_route(net, dst_orig); | 1769 | ret = afinfo->blackhole_route(net, dst_orig); |
| 1769 | } | 1770 | } |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e75d8e47f35c..289f4bf18ff0 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
| @@ -123,9 +123,21 @@ static inline int verify_replay(struct xfrm_usersa_info *p, | |||
| 123 | struct nlattr **attrs) | 123 | struct nlattr **attrs) |
| 124 | { | 124 | { |
| 125 | struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL]; | 125 | struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL]; |
| 126 | struct xfrm_replay_state_esn *rs; | ||
| 126 | 127 | ||
| 127 | if ((p->flags & XFRM_STATE_ESN) && !rt) | 128 | if (p->flags & XFRM_STATE_ESN) { |
| 128 | return -EINVAL; | 129 | if (!rt) |
| 130 | return -EINVAL; | ||
| 131 | |||
| 132 | rs = nla_data(rt); | ||
| 133 | |||
| 134 | if (rs->bmp_len > XFRMA_REPLAY_ESN_MAX / sizeof(rs->bmp[0]) / 8) | ||
| 135 | return -EINVAL; | ||
| 136 | |||
| 137 | if (nla_len(rt) < xfrm_replay_state_esn_len(rs) && | ||
| 138 | nla_len(rt) != sizeof(*rs)) | ||
| 139 | return -EINVAL; | ||
| 140 | } | ||
| 129 | 141 | ||
| 130 | if (!rt) | 142 | if (!rt) |
| 131 | return 0; | 143 | return 0; |
| @@ -370,14 +382,15 @@ static inline int xfrm_replay_verify_len(struct xfrm_replay_state_esn *replay_es | |||
| 370 | struct nlattr *rp) | 382 | struct nlattr *rp) |
| 371 | { | 383 | { |
| 372 | struct xfrm_replay_state_esn *up; | 384 | struct xfrm_replay_state_esn *up; |
| 385 | int ulen; | ||
| 373 | 386 | ||
| 374 | if (!replay_esn || !rp) | 387 | if (!replay_esn || !rp) |
| 375 | return 0; | 388 | return 0; |
| 376 | 389 | ||
| 377 | up = nla_data(rp); | 390 | up = nla_data(rp); |
| 391 | ulen = xfrm_replay_state_esn_len(up); | ||
| 378 | 392 | ||
| 379 | if (xfrm_replay_state_esn_len(replay_esn) != | 393 | if (nla_len(rp) < ulen || xfrm_replay_state_esn_len(replay_esn) != ulen) |
| 380 | xfrm_replay_state_esn_len(up)) | ||
| 381 | return -EINVAL; | 394 | return -EINVAL; |
| 382 | 395 | ||
| 383 | return 0; | 396 | return 0; |
| @@ -388,22 +401,28 @@ static int xfrm_alloc_replay_state_esn(struct xfrm_replay_state_esn **replay_esn | |||
| 388 | struct nlattr *rta) | 401 | struct nlattr *rta) |
| 389 | { | 402 | { |
| 390 | struct xfrm_replay_state_esn *p, *pp, *up; | 403 | struct xfrm_replay_state_esn *p, *pp, *up; |
| 404 | int klen, ulen; | ||
| 391 | 405 | ||
| 392 | if (!rta) | 406 | if (!rta) |
| 393 | return 0; | 407 | return 0; |
| 394 | 408 | ||
| 395 | up = nla_data(rta); | 409 | up = nla_data(rta); |
| 410 | klen = xfrm_replay_state_esn_len(up); | ||
| 411 | ulen = nla_len(rta) >= klen ? klen : sizeof(*up); | ||
| 396 | 412 | ||
| 397 | p = kmemdup(up, xfrm_replay_state_esn_len(up), GFP_KERNEL); | 413 | p = kzalloc(klen, GFP_KERNEL); |
| 398 | if (!p) | 414 | if (!p) |
| 399 | return -ENOMEM; | 415 | return -ENOMEM; |
| 400 | 416 | ||
| 401 | pp = kmemdup(up, xfrm_replay_state_esn_len(up), GFP_KERNEL); | 417 | pp = kzalloc(klen, GFP_KERNEL); |
| 402 | if (!pp) { | 418 | if (!pp) { |
| 403 | kfree(p); | 419 | kfree(p); |
| 404 | return -ENOMEM; | 420 | return -ENOMEM; |
| 405 | } | 421 | } |
| 406 | 422 | ||
| 423 | memcpy(p, up, ulen); | ||
| 424 | memcpy(pp, up, ulen); | ||
| 425 | |||
| 407 | *replay_esn = p; | 426 | *replay_esn = p; |
| 408 | *preplay_esn = pp; | 427 | *preplay_esn = pp; |
| 409 | 428 | ||
| @@ -442,10 +461,11 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * | |||
| 442 | * somehow made shareable and move it to xfrm_state.c - JHS | 461 | * somehow made shareable and move it to xfrm_state.c - JHS |
| 443 | * | 462 | * |
| 444 | */ | 463 | */ |
| 445 | static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs) | 464 | static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs, |
| 465 | int update_esn) | ||
| 446 | { | 466 | { |
| 447 | struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; | 467 | struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; |
| 448 | struct nlattr *re = attrs[XFRMA_REPLAY_ESN_VAL]; | 468 | struct nlattr *re = update_esn ? attrs[XFRMA_REPLAY_ESN_VAL] : NULL; |
| 449 | struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; | 469 | struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; |
| 450 | struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; | 470 | struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; |
| 451 | struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; | 471 | struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; |
| @@ -555,7 +575,7 @@ static struct xfrm_state *xfrm_state_construct(struct net *net, | |||
| 555 | goto error; | 575 | goto error; |
| 556 | 576 | ||
| 557 | /* override default values from above */ | 577 | /* override default values from above */ |
| 558 | xfrm_update_ae_params(x, attrs); | 578 | xfrm_update_ae_params(x, attrs, 0); |
| 559 | 579 | ||
| 560 | return x; | 580 | return x; |
| 561 | 581 | ||
| @@ -689,6 +709,7 @@ out: | |||
| 689 | 709 | ||
| 690 | static void copy_to_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p) | 710 | static void copy_to_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p) |
| 691 | { | 711 | { |
| 712 | memset(p, 0, sizeof(*p)); | ||
| 692 | memcpy(&p->id, &x->id, sizeof(p->id)); | 713 | memcpy(&p->id, &x->id, sizeof(p->id)); |
| 693 | memcpy(&p->sel, &x->sel, sizeof(p->sel)); | 714 | memcpy(&p->sel, &x->sel, sizeof(p->sel)); |
| 694 | memcpy(&p->lft, &x->lft, sizeof(p->lft)); | 715 | memcpy(&p->lft, &x->lft, sizeof(p->lft)); |
| @@ -742,7 +763,7 @@ static int copy_to_user_auth(struct xfrm_algo_auth *auth, struct sk_buff *skb) | |||
| 742 | return -EMSGSIZE; | 763 | return -EMSGSIZE; |
| 743 | 764 | ||
| 744 | algo = nla_data(nla); | 765 | algo = nla_data(nla); |
| 745 | strcpy(algo->alg_name, auth->alg_name); | 766 | strncpy(algo->alg_name, auth->alg_name, sizeof(algo->alg_name)); |
| 746 | memcpy(algo->alg_key, auth->alg_key, (auth->alg_key_len + 7) / 8); | 767 | memcpy(algo->alg_key, auth->alg_key, (auth->alg_key_len + 7) / 8); |
| 747 | algo->alg_key_len = auth->alg_key_len; | 768 | algo->alg_key_len = auth->alg_key_len; |
| 748 | 769 | ||
| @@ -878,6 +899,7 @@ static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb, | |||
| 878 | { | 899 | { |
| 879 | struct xfrm_dump_info info; | 900 | struct xfrm_dump_info info; |
| 880 | struct sk_buff *skb; | 901 | struct sk_buff *skb; |
| 902 | int err; | ||
| 881 | 903 | ||
| 882 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); | 904 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
| 883 | if (!skb) | 905 | if (!skb) |
| @@ -888,9 +910,10 @@ static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb, | |||
| 888 | info.nlmsg_seq = seq; | 910 | info.nlmsg_seq = seq; |
| 889 | info.nlmsg_flags = 0; | 911 | info.nlmsg_flags = 0; |
| 890 | 912 | ||
| 891 | if (dump_one_state(x, 0, &info)) { | 913 | err = dump_one_state(x, 0, &info); |
| 914 | if (err) { | ||
| 892 | kfree_skb(skb); | 915 | kfree_skb(skb); |
| 893 | return NULL; | 916 | return ERR_PTR(err); |
| 894 | } | 917 | } |
| 895 | 918 | ||
| 896 | return skb; | 919 | return skb; |
| @@ -1317,6 +1340,7 @@ static void copy_from_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy | |||
| 1317 | 1340 | ||
| 1318 | static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_info *p, int dir) | 1341 | static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_info *p, int dir) |
| 1319 | { | 1342 | { |
| 1343 | memset(p, 0, sizeof(*p)); | ||
| 1320 | memcpy(&p->sel, &xp->selector, sizeof(p->sel)); | 1344 | memcpy(&p->sel, &xp->selector, sizeof(p->sel)); |
| 1321 | memcpy(&p->lft, &xp->lft, sizeof(p->lft)); | 1345 | memcpy(&p->lft, &xp->lft, sizeof(p->lft)); |
| 1322 | memcpy(&p->curlft, &xp->curlft, sizeof(p->curlft)); | 1346 | memcpy(&p->curlft, &xp->curlft, sizeof(p->curlft)); |
| @@ -1421,6 +1445,7 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) | |||
| 1421 | struct xfrm_user_tmpl *up = &vec[i]; | 1445 | struct xfrm_user_tmpl *up = &vec[i]; |
| 1422 | struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; | 1446 | struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; |
| 1423 | 1447 | ||
| 1448 | memset(up, 0, sizeof(*up)); | ||
| 1424 | memcpy(&up->id, &kp->id, sizeof(up->id)); | 1449 | memcpy(&up->id, &kp->id, sizeof(up->id)); |
| 1425 | up->family = kp->encap_family; | 1450 | up->family = kp->encap_family; |
| 1426 | memcpy(&up->saddr, &kp->saddr, sizeof(up->saddr)); | 1451 | memcpy(&up->saddr, &kp->saddr, sizeof(up->saddr)); |
| @@ -1546,6 +1571,7 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, | |||
| 1546 | { | 1571 | { |
| 1547 | struct xfrm_dump_info info; | 1572 | struct xfrm_dump_info info; |
| 1548 | struct sk_buff *skb; | 1573 | struct sk_buff *skb; |
| 1574 | int err; | ||
| 1549 | 1575 | ||
| 1550 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); | 1576 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
| 1551 | if (!skb) | 1577 | if (!skb) |
| @@ -1556,9 +1582,10 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, | |||
| 1556 | info.nlmsg_seq = seq; | 1582 | info.nlmsg_seq = seq; |
| 1557 | info.nlmsg_flags = 0; | 1583 | info.nlmsg_flags = 0; |
| 1558 | 1584 | ||
| 1559 | if (dump_one_policy(xp, dir, 0, &info) < 0) { | 1585 | err = dump_one_policy(xp, dir, 0, &info); |
| 1586 | if (err) { | ||
| 1560 | kfree_skb(skb); | 1587 | kfree_skb(skb); |
| 1561 | return NULL; | 1588 | return ERR_PTR(err); |
| 1562 | } | 1589 | } |
| 1563 | 1590 | ||
| 1564 | return skb; | 1591 | return skb; |
| @@ -1822,7 +1849,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
| 1822 | goto out; | 1849 | goto out; |
| 1823 | 1850 | ||
| 1824 | spin_lock_bh(&x->lock); | 1851 | spin_lock_bh(&x->lock); |
| 1825 | xfrm_update_ae_params(x, attrs); | 1852 | xfrm_update_ae_params(x, attrs, 1); |
| 1826 | spin_unlock_bh(&x->lock); | 1853 | spin_unlock_bh(&x->lock); |
| 1827 | 1854 | ||
| 1828 | c.event = nlh->nlmsg_type; | 1855 | c.event = nlh->nlmsg_type; |
diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h index c220f314709c..65f67cb0aefb 100644 --- a/security/selinux/include/xfrm.h +++ b/security/selinux/include/xfrm.h | |||
| @@ -51,6 +51,7 @@ int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall); | |||
| 51 | static inline void selinux_xfrm_notify_policyload(void) | 51 | static inline void selinux_xfrm_notify_policyload(void) |
| 52 | { | 52 | { |
| 53 | atomic_inc(&flow_cache_genid); | 53 | atomic_inc(&flow_cache_genid); |
| 54 | rt_genid_bump(&init_net); | ||
| 54 | } | 55 | } |
| 55 | #else | 56 | #else |
| 56 | static inline int selinux_xfrm_enabled(void) | 57 | static inline int selinux_xfrm_enabled(void) |
