diff options
49 files changed, 382 insertions, 382 deletions
diff --git a/Documentation/networking/phy.txt b/Documentation/networking/phy.txt index 8df6a7b0e66c..88bb71b46da4 100644 --- a/Documentation/networking/phy.txt +++ b/Documentation/networking/phy.txt | |||
| @@ -96,7 +96,7 @@ Letting the PHY Abstraction Layer do Everything | |||
| 96 | static void adjust_link(struct net_device *dev); | 96 | static void adjust_link(struct net_device *dev); |
| 97 | 97 | ||
| 98 | Next, you need to know the device name of the PHY connected to this device. | 98 | Next, you need to know the device name of the PHY connected to this device. |
| 99 | The name will look something like, "phy0:0", where the first number is the | 99 | The name will look something like, "0:00", where the first number is the |
| 100 | bus id, and the second is the PHY's address on that bus. Typically, | 100 | bus id, and the second is the PHY's address on that bus. Typically, |
| 101 | the bus is responsible for making its ID unique. | 101 | the bus is responsible for making its ID unique. |
| 102 | 102 | ||
diff --git a/arch/mips/include/asm/mach-rc32434/gpio.h b/arch/mips/include/asm/mach-rc32434/gpio.h index c8e554eafce3..b5cf6457305a 100644 --- a/arch/mips/include/asm/mach-rc32434/gpio.h +++ b/arch/mips/include/asm/mach-rc32434/gpio.h | |||
| @@ -84,5 +84,7 @@ extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned | |||
| 84 | extern unsigned get_434_reg(unsigned reg_offs); | 84 | extern unsigned get_434_reg(unsigned reg_offs); |
| 85 | extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask); | 85 | extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask); |
| 86 | extern unsigned char get_latch_u5(void); | 86 | extern unsigned char get_latch_u5(void); |
| 87 | extern void rb532_gpio_set_ilevel(int bit, unsigned gpio); | ||
| 88 | extern void rb532_gpio_set_istat(int bit, unsigned gpio); | ||
| 87 | 89 | ||
| 88 | #endif /* _RC32434_GPIO_H_ */ | 90 | #endif /* _RC32434_GPIO_H_ */ |
diff --git a/arch/mips/include/asm/mach-rc32434/rb.h b/arch/mips/include/asm/mach-rc32434/rb.h index 79e8ef67d0d3..f25a84916703 100644 --- a/arch/mips/include/asm/mach-rc32434/rb.h +++ b/arch/mips/include/asm/mach-rc32434/rb.h | |||
| @@ -40,12 +40,14 @@ | |||
| 40 | #define BTCS 0x010040 | 40 | #define BTCS 0x010040 |
| 41 | #define BTCOMPARE 0x010044 | 41 | #define BTCOMPARE 0x010044 |
| 42 | #define GPIOBASE 0x050000 | 42 | #define GPIOBASE 0x050000 |
| 43 | #define GPIOCFG 0x050004 | 43 | /* Offsets relative to GPIOBASE */ |
| 44 | #define GPIOD 0x050008 | 44 | #define GPIOFUNC 0x00 |
| 45 | #define GPIOILEVEL 0x05000C | 45 | #define GPIOCFG 0x04 |
| 46 | #define GPIOISTAT 0x050010 | 46 | #define GPIOD 0x08 |
| 47 | #define GPIONMIEN 0x050014 | 47 | #define GPIOILEVEL 0x0C |
| 48 | #define IMASK6 0x038038 | 48 | #define GPIOISTAT 0x10 |
| 49 | #define GPIONMIEN 0x14 | ||
| 50 | #define IMASK6 0x38 | ||
| 49 | #define LO_WPX (1 << 0) | 51 | #define LO_WPX (1 << 0) |
| 50 | #define LO_ALE (1 << 1) | 52 | #define LO_ALE (1 << 1) |
| 51 | #define LO_CLE (1 << 2) | 53 | #define LO_CLE (1 << 2) |
diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h index d3bd5c5aa2ec..9601ea950542 100644 --- a/arch/mips/include/asm/time.h +++ b/arch/mips/include/asm/time.h | |||
| @@ -63,7 +63,7 @@ static inline int mips_clockevent_init(void) | |||
| 63 | /* | 63 | /* |
| 64 | * Initialize the count register as a clocksource | 64 | * Initialize the count register as a clocksource |
| 65 | */ | 65 | */ |
| 66 | #ifdef CONFIG_CEVT_R4K | 66 | #ifdef CONFIG_CSRC_R4K |
| 67 | extern int init_mips_clocksource(void); | 67 | extern int init_mips_clocksource(void); |
| 68 | #else | 68 | #else |
| 69 | static inline int init_mips_clocksource(void) | 69 | static inline int init_mips_clocksource(void) |
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index 86e026f067bc..74fb74583b4e 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c | |||
| @@ -27,7 +27,7 @@ int __init init_mips_clocksource(void) | |||
| 27 | if (!cpu_has_counter || !mips_hpt_frequency) | 27 | if (!cpu_has_counter || !mips_hpt_frequency) |
| 28 | return -ENXIO; | 28 | return -ENXIO; |
| 29 | 29 | ||
| 30 | /* Calclate a somewhat reasonable rating value */ | 30 | /* Calculate a somewhat reasonable rating value */ |
| 31 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; | 31 | clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; |
| 32 | 32 | ||
| 33 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); | 33 | clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); |
diff --git a/arch/mips/mm/sc-ip22.c b/arch/mips/mm/sc-ip22.c index 1f602a110e10..13adb5782110 100644 --- a/arch/mips/mm/sc-ip22.c +++ b/arch/mips/mm/sc-ip22.c | |||
| @@ -161,7 +161,7 @@ static inline int __init indy_sc_probe(void) | |||
| 161 | 161 | ||
| 162 | /* XXX Check with wje if the Indy caches can differenciate between | 162 | /* XXX Check with wje if the Indy caches can differenciate between |
| 163 | writeback + invalidate and just invalidate. */ | 163 | writeback + invalidate and just invalidate. */ |
| 164 | struct bcache_ops indy_sc_ops = { | 164 | static struct bcache_ops indy_sc_ops = { |
| 165 | .bc_enable = indy_sc_enable, | 165 | .bc_enable = indy_sc_enable, |
| 166 | .bc_disable = indy_sc_disable, | 166 | .bc_disable = indy_sc_disable, |
| 167 | .bc_wback_inv = indy_sc_wback_invalidate, | 167 | .bc_wback_inv = indy_sc_wback_invalidate, |
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c index 96236bf33838..df9e526312a2 100644 --- a/arch/mips/mti-malta/malta-amon.c +++ b/arch/mips/mti-malta/malta-amon.c | |||
| @@ -22,9 +22,9 @@ | |||
| 22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 23 | #include <linux/smp.h> | 23 | #include <linux/smp.h> |
| 24 | 24 | ||
| 25 | #include <asm-mips/addrspace.h> | 25 | #include <asm/addrspace.h> |
| 26 | #include <asm-mips/mips-boards/launch.h> | 26 | #include <asm/mips-boards/launch.h> |
| 27 | #include <asm-mips/mipsmtregs.h> | 27 | #include <asm/mipsmtregs.h> |
| 28 | 28 | ||
| 29 | int amon_cpu_avail(int cpu) | 29 | int amon_cpu_avail(int cpu) |
| 30 | { | 30 | { |
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c index 2f22d714d5b0..c1c29181bd46 100644 --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c | |||
| @@ -118,7 +118,7 @@ static struct platform_device cf_slot0 = { | |||
| 118 | /* Resources and device for NAND */ | 118 | /* Resources and device for NAND */ |
| 119 | static int rb532_dev_ready(struct mtd_info *mtd) | 119 | static int rb532_dev_ready(struct mtd_info *mtd) |
| 120 | { | 120 | { |
| 121 | return readl(IDT434_REG_BASE + GPIOD) & GPIO_RDY; | 121 | return gpio_get_value(GPIO_RDY); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | 124 | static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c index 70c4a6726377..0e84c8ab6a39 100644 --- a/arch/mips/rb532/gpio.c +++ b/arch/mips/rb532/gpio.c | |||
| @@ -39,10 +39,6 @@ | |||
| 39 | struct rb532_gpio_chip { | 39 | struct rb532_gpio_chip { |
| 40 | struct gpio_chip chip; | 40 | struct gpio_chip chip; |
| 41 | void __iomem *regbase; | 41 | void __iomem *regbase; |
| 42 | void (*set_int_level)(struct gpio_chip *chip, unsigned offset, int value); | ||
| 43 | int (*get_int_level)(struct gpio_chip *chip, unsigned offset); | ||
| 44 | void (*set_int_status)(struct gpio_chip *chip, unsigned offset, int value); | ||
| 45 | int (*get_int_status)(struct gpio_chip *chip, unsigned offset); | ||
| 46 | }; | 42 | }; |
| 47 | 43 | ||
| 48 | struct mpmc_device dev3; | 44 | struct mpmc_device dev3; |
| @@ -111,15 +107,47 @@ unsigned char get_latch_u5(void) | |||
| 111 | } | 107 | } |
| 112 | EXPORT_SYMBOL(get_latch_u5); | 108 | EXPORT_SYMBOL(get_latch_u5); |
| 113 | 109 | ||
| 110 | /* rb532_set_bit - sanely set a bit | ||
| 111 | * | ||
| 112 | * bitval: new value for the bit | ||
| 113 | * offset: bit index in the 4 byte address range | ||
| 114 | * ioaddr: 4 byte aligned address being altered | ||
| 115 | */ | ||
| 116 | static inline void rb532_set_bit(unsigned bitval, | ||
| 117 | unsigned offset, void __iomem *ioaddr) | ||
| 118 | { | ||
| 119 | unsigned long flags; | ||
| 120 | u32 val; | ||
| 121 | |||
| 122 | bitval = !!bitval; /* map parameter to {0,1} */ | ||
| 123 | |||
| 124 | local_irq_save(flags); | ||
| 125 | |||
| 126 | val = readl(ioaddr); | ||
| 127 | val &= ~( ~bitval << offset ); /* unset bit if bitval == 0 */ | ||
| 128 | val |= ( bitval << offset ); /* set bit if bitval == 1 */ | ||
| 129 | writel(val, ioaddr); | ||
| 130 | |||
| 131 | local_irq_restore(flags); | ||
| 132 | } | ||
| 133 | |||
| 134 | /* rb532_get_bit - read a bit | ||
| 135 | * | ||
| 136 | * returns the boolean state of the bit, which may be > 1 | ||
| 137 | */ | ||
| 138 | static inline int rb532_get_bit(unsigned offset, void __iomem *ioaddr) | ||
| 139 | { | ||
| 140 | return (readl(ioaddr) & (1 << offset)); | ||
| 141 | } | ||
| 142 | |||
| 114 | /* | 143 | /* |
| 115 | * Return GPIO level */ | 144 | * Return GPIO level */ |
| 116 | static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) | 145 | static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) |
| 117 | { | 146 | { |
| 118 | u32 mask = 1 << offset; | ||
| 119 | struct rb532_gpio_chip *gpch; | 147 | struct rb532_gpio_chip *gpch; |
| 120 | 148 | ||
| 121 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 149 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
| 122 | return readl(gpch->regbase + GPIOD) & mask; | 150 | return rb532_get_bit(offset, gpch->regbase + GPIOD); |
| 123 | } | 151 | } |
| 124 | 152 | ||
| 125 | /* | 153 | /* |
| @@ -128,23 +156,10 @@ static int rb532_gpio_get(struct gpio_chip *chip, unsigned offset) | |||
| 128 | static void rb532_gpio_set(struct gpio_chip *chip, | 156 | static void rb532_gpio_set(struct gpio_chip *chip, |
| 129 | unsigned offset, int value) | 157 | unsigned offset, int value) |
| 130 | { | 158 | { |
| 131 | unsigned long flags; | ||
| 132 | u32 mask = 1 << offset; | ||
| 133 | u32 tmp; | ||
| 134 | struct rb532_gpio_chip *gpch; | 159 | struct rb532_gpio_chip *gpch; |
| 135 | void __iomem *gpvr; | ||
| 136 | 160 | ||
| 137 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 161 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
| 138 | gpvr = gpch->regbase + GPIOD; | 162 | rb532_set_bit(value, offset, gpch->regbase + GPIOD); |
| 139 | |||
| 140 | local_irq_save(flags); | ||
| 141 | tmp = readl(gpvr); | ||
| 142 | if (value) | ||
| 143 | tmp |= mask; | ||
| 144 | else | ||
| 145 | tmp &= ~mask; | ||
| 146 | writel(tmp, gpvr); | ||
| 147 | local_irq_restore(flags); | ||
| 148 | } | 163 | } |
| 149 | 164 | ||
| 150 | /* | 165 | /* |
| @@ -152,21 +167,14 @@ static void rb532_gpio_set(struct gpio_chip *chip, | |||
| 152 | */ | 167 | */ |
| 153 | static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 168 | static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
| 154 | { | 169 | { |
| 155 | unsigned long flags; | ||
| 156 | u32 mask = 1 << offset; | ||
| 157 | u32 value; | ||
| 158 | struct rb532_gpio_chip *gpch; | 170 | struct rb532_gpio_chip *gpch; |
| 159 | void __iomem *gpdr; | ||
| 160 | 171 | ||
| 161 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 172 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
| 162 | gpdr = gpch->regbase + GPIOCFG; | ||
| 163 | 173 | ||
| 164 | local_irq_save(flags); | 174 | if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC)) |
| 165 | value = readl(gpdr); | 175 | return 1; /* alternate function, GPIOCFG is ignored */ |
| 166 | value &= ~mask; | ||
| 167 | writel(value, gpdr); | ||
| 168 | local_irq_restore(flags); | ||
| 169 | 176 | ||
| 177 | rb532_set_bit(0, offset, gpch->regbase + GPIOCFG); | ||
| 170 | return 0; | 178 | return 0; |
| 171 | } | 179 | } |
| 172 | 180 | ||
| @@ -176,117 +184,60 @@ static int rb532_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | |||
| 176 | static int rb532_gpio_direction_output(struct gpio_chip *chip, | 184 | static int rb532_gpio_direction_output(struct gpio_chip *chip, |
| 177 | unsigned offset, int value) | 185 | unsigned offset, int value) |
| 178 | { | 186 | { |
| 179 | unsigned long flags; | ||
| 180 | u32 mask = 1 << offset; | ||
| 181 | u32 tmp; | ||
| 182 | struct rb532_gpio_chip *gpch; | 187 | struct rb532_gpio_chip *gpch; |
| 183 | void __iomem *gpdr; | ||
| 184 | 188 | ||
| 185 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 189 | gpch = container_of(chip, struct rb532_gpio_chip, chip); |
| 186 | writel(mask, gpch->regbase + GPIOD); | ||
| 187 | gpdr = gpch->regbase + GPIOCFG; | ||
| 188 | 190 | ||
| 189 | local_irq_save(flags); | 191 | if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC)) |
| 190 | tmp = readl(gpdr); | 192 | return 1; /* alternate function, GPIOCFG is ignored */ |
| 191 | tmp |= mask; | ||
| 192 | writel(tmp, gpdr); | ||
| 193 | local_irq_restore(flags); | ||
| 194 | 193 | ||
| 194 | /* set the initial output value */ | ||
| 195 | rb532_set_bit(value, offset, gpch->regbase + GPIOD); | ||
| 196 | |||
| 197 | rb532_set_bit(1, offset, gpch->regbase + GPIOCFG); | ||
| 195 | return 0; | 198 | return 0; |
| 196 | } | 199 | } |
| 197 | 200 | ||
| 198 | /* | 201 | static struct rb532_gpio_chip rb532_gpio_chip[] = { |
| 199 | * Set the GPIO interrupt level | 202 | [0] = { |
| 200 | */ | 203 | .chip = { |
| 201 | static void rb532_gpio_set_int_level(struct gpio_chip *chip, | 204 | .label = "gpio0", |
| 202 | unsigned offset, int value) | 205 | .direction_input = rb532_gpio_direction_input, |
| 203 | { | 206 | .direction_output = rb532_gpio_direction_output, |
| 204 | unsigned long flags; | 207 | .get = rb532_gpio_get, |
| 205 | u32 mask = 1 << offset; | 208 | .set = rb532_gpio_set, |
| 206 | u32 tmp; | 209 | .base = 0, |
| 207 | struct rb532_gpio_chip *gpch; | 210 | .ngpio = 32, |
| 208 | void __iomem *gpil; | 211 | }, |
| 209 | 212 | }, | |
| 210 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | 213 | }; |
| 211 | gpil = gpch->regbase + GPIOILEVEL; | ||
| 212 | |||
| 213 | local_irq_save(flags); | ||
| 214 | tmp = readl(gpil); | ||
| 215 | if (value) | ||
| 216 | tmp |= mask; | ||
| 217 | else | ||
| 218 | tmp &= ~mask; | ||
| 219 | writel(tmp, gpil); | ||
| 220 | local_irq_restore(flags); | ||
| 221 | } | ||
| 222 | 214 | ||
| 223 | /* | 215 | /* |
| 224 | * Get the GPIO interrupt level | 216 | * Set GPIO interrupt level |
| 225 | */ | 217 | */ |
| 226 | static int rb532_gpio_get_int_level(struct gpio_chip *chip, unsigned offset) | 218 | void rb532_gpio_set_ilevel(int bit, unsigned gpio) |
| 227 | { | 219 | { |
| 228 | u32 mask = 1 << offset; | 220 | rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOILEVEL); |
| 229 | struct rb532_gpio_chip *gpch; | ||
| 230 | |||
| 231 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | ||
| 232 | return readl(gpch->regbase + GPIOILEVEL) & mask; | ||
| 233 | } | 221 | } |
| 222 | EXPORT_SYMBOL(rb532_gpio_set_ilevel); | ||
| 234 | 223 | ||
| 235 | /* | 224 | /* |
| 236 | * Set the GPIO interrupt status | 225 | * Set GPIO interrupt status |
| 237 | */ | 226 | */ |
| 238 | static void rb532_gpio_set_int_status(struct gpio_chip *chip, | 227 | void rb532_gpio_set_istat(int bit, unsigned gpio) |
| 239 | unsigned offset, int value) | ||
| 240 | { | 228 | { |
| 241 | unsigned long flags; | 229 | rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOISTAT); |
| 242 | u32 mask = 1 << offset; | ||
| 243 | u32 tmp; | ||
| 244 | struct rb532_gpio_chip *gpch; | ||
| 245 | void __iomem *gpis; | ||
| 246 | |||
| 247 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | ||
| 248 | gpis = gpch->regbase + GPIOISTAT; | ||
| 249 | |||
| 250 | local_irq_save(flags); | ||
| 251 | tmp = readl(gpis); | ||
| 252 | if (value) | ||
| 253 | tmp |= mask; | ||
| 254 | else | ||
| 255 | tmp &= ~mask; | ||
| 256 | writel(tmp, gpis); | ||
| 257 | local_irq_restore(flags); | ||
| 258 | } | 230 | } |
| 231 | EXPORT_SYMBOL(rb532_gpio_set_istat); | ||
| 259 | 232 | ||
| 260 | /* | 233 | /* |
| 261 | * Get the GPIO interrupt status | 234 | * Configure GPIO alternate function |
| 262 | */ | 235 | */ |
| 263 | static int rb532_gpio_get_int_status(struct gpio_chip *chip, unsigned offset) | 236 | static void rb532_gpio_set_func(int bit, unsigned gpio) |
| 264 | { | 237 | { |
| 265 | u32 mask = 1 << offset; | 238 | rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOFUNC); |
| 266 | struct rb532_gpio_chip *gpch; | ||
| 267 | |||
| 268 | gpch = container_of(chip, struct rb532_gpio_chip, chip); | ||
| 269 | return readl(gpch->regbase + GPIOISTAT) & mask; | ||
| 270 | } | 239 | } |
| 271 | 240 | ||
| 272 | static struct rb532_gpio_chip rb532_gpio_chip[] = { | ||
| 273 | [0] = { | ||
| 274 | .chip = { | ||
| 275 | .label = "gpio0", | ||
| 276 | .direction_input = rb532_gpio_direction_input, | ||
| 277 | .direction_output = rb532_gpio_direction_output, | ||
| 278 | .get = rb532_gpio_get, | ||
| 279 | .set = rb532_gpio_set, | ||
| 280 | .base = 0, | ||
| 281 | .ngpio = 32, | ||
| 282 | }, | ||
| 283 | .get_int_level = rb532_gpio_get_int_level, | ||
| 284 | .set_int_level = rb532_gpio_set_int_level, | ||
| 285 | .get_int_status = rb532_gpio_get_int_status, | ||
| 286 | .set_int_status = rb532_gpio_set_int_status, | ||
| 287 | }, | ||
| 288 | }; | ||
| 289 | |||
| 290 | int __init rb532_gpio_init(void) | 241 | int __init rb532_gpio_init(void) |
| 291 | { | 242 | { |
| 292 | struct resource *r; | 243 | struct resource *r; |
| @@ -310,9 +261,11 @@ int __init rb532_gpio_init(void) | |||
| 310 | return -ENXIO; | 261 | return -ENXIO; |
| 311 | } | 262 | } |
| 312 | 263 | ||
| 313 | /* Set the interrupt status and level for the CF pin */ | 264 | /* configure CF_GPIO_NUM as CFRDY IRQ source */ |
| 314 | rb532_gpio_set_int_level(&rb532_gpio_chip->chip, CF_GPIO_NUM, 1); | 265 | rb532_gpio_set_func(0, CF_GPIO_NUM); |
| 315 | rb532_gpio_set_int_status(&rb532_gpio_chip->chip, CF_GPIO_NUM, 0); | 266 | rb532_gpio_direction_input(&rb532_gpio_chip->chip, CF_GPIO_NUM); |
| 267 | rb532_gpio_set_ilevel(1, CF_GPIO_NUM); | ||
| 268 | rb532_gpio_set_istat(0, CF_GPIO_NUM); | ||
| 316 | 269 | ||
| 317 | return 0; | 270 | return 0; |
| 318 | } | 271 | } |
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c index 90904f9dfc50..927db3668b6f 100644 --- a/arch/parisc/kernel/ptrace.c +++ b/arch/parisc/kernel/ptrace.c | |||
| @@ -183,10 +183,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
| 183 | * being 64 bit in both cases. | 183 | * being 64 bit in both cases. |
| 184 | */ | 184 | */ |
| 185 | 185 | ||
| 186 | static long translate_usr_offset(long offset) | 186 | static compat_ulong_t translate_usr_offset(compat_ulong_t offset) |
| 187 | { | 187 | { |
| 188 | if (offset < 0) | 188 | if (offset < 0) |
| 189 | return -1; | 189 | return sizeof(struct pt_regs); |
| 190 | else if (offset <= 32*4) /* gr[0..31] */ | 190 | else if (offset <= 32*4) /* gr[0..31] */ |
| 191 | return offset * 2 + 4; | 191 | return offset * 2 + 4; |
| 192 | else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */ | 192 | else if (offset <= 32*4+32*8) /* gr[0..31] + fr[0..31] */ |
| @@ -194,7 +194,7 @@ static long translate_usr_offset(long offset) | |||
| 194 | else if (offset < sizeof(struct pt_regs)/2 + 32*4) | 194 | else if (offset < sizeof(struct pt_regs)/2 + 32*4) |
| 195 | return offset * 2 + 4 - 32*8; | 195 | return offset * 2 + 4 - 32*8; |
| 196 | else | 196 | else |
| 197 | return -1; | 197 | return sizeof(struct pt_regs); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | 200 | long compat_arch_ptrace(struct task_struct *child, compat_long_t request, |
| @@ -209,7 +209,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
| 209 | if (addr & (sizeof(compat_uint_t)-1)) | 209 | if (addr & (sizeof(compat_uint_t)-1)) |
| 210 | break; | 210 | break; |
| 211 | addr = translate_usr_offset(addr); | 211 | addr = translate_usr_offset(addr); |
| 212 | if (addr < 0) | 212 | if (addr >= sizeof(struct pt_regs)) |
| 213 | break; | 213 | break; |
| 214 | 214 | ||
| 215 | tmp = *(compat_uint_t *) ((char *) task_regs(child) + addr); | 215 | tmp = *(compat_uint_t *) ((char *) task_regs(child) + addr); |
| @@ -236,7 +236,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
| 236 | if (addr & (sizeof(compat_uint_t)-1)) | 236 | if (addr & (sizeof(compat_uint_t)-1)) |
| 237 | break; | 237 | break; |
| 238 | addr = translate_usr_offset(addr); | 238 | addr = translate_usr_offset(addr); |
| 239 | if (addr < 0) | 239 | if (addr >= sizeof(struct pt_regs)) |
| 240 | break; | 240 | break; |
| 241 | if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { | 241 | if (addr >= PT_FR0 && addr <= PT_FR31 + 4) { |
| 242 | /* Special case, fp regs are 64 bits anyway */ | 242 | /* Special case, fp regs are 64 bits anyway */ |
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h index 664f15280f14..f8cfd00db450 100644 --- a/arch/x86/include/asm/uaccess_64.h +++ b/arch/x86/include/asm/uaccess_64.h | |||
| @@ -46,7 +46,7 @@ int __copy_from_user(void *dst, const void __user *src, unsigned size) | |||
| 46 | return ret; | 46 | return ret; |
| 47 | case 10: | 47 | case 10: |
| 48 | __get_user_asm(*(u64 *)dst, (u64 __user *)src, | 48 | __get_user_asm(*(u64 *)dst, (u64 __user *)src, |
| 49 | ret, "q", "", "=r", 16); | 49 | ret, "q", "", "=r", 10); |
| 50 | if (unlikely(ret)) | 50 | if (unlikely(ret)) |
| 51 | return ret; | 51 | return ret; |
| 52 | __get_user_asm(*(u16 *)(8 + (char *)dst), | 52 | __get_user_asm(*(u16 *)(8 + (char *)dst), |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 7a3f2028e2eb..c9513e1ff28d 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
| @@ -1140,6 +1140,20 @@ static void __clear_irq_vector(int irq) | |||
| 1140 | 1140 | ||
| 1141 | cfg->vector = 0; | 1141 | cfg->vector = 0; |
| 1142 | cpus_clear(cfg->domain); | 1142 | cpus_clear(cfg->domain); |
| 1143 | |||
| 1144 | if (likely(!cfg->move_in_progress)) | ||
| 1145 | return; | ||
| 1146 | cpus_and(mask, cfg->old_domain, cpu_online_map); | ||
| 1147 | for_each_cpu_mask_nr(cpu, mask) { | ||
| 1148 | for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; | ||
| 1149 | vector++) { | ||
| 1150 | if (per_cpu(vector_irq, cpu)[vector] != irq) | ||
| 1151 | continue; | ||
| 1152 | per_cpu(vector_irq, cpu)[vector] = -1; | ||
| 1153 | break; | ||
| 1154 | } | ||
| 1155 | } | ||
| 1156 | cfg->move_in_progress = 0; | ||
| 1143 | } | 1157 | } |
| 1144 | 1158 | ||
| 1145 | void __setup_vector_irq(int cpu) | 1159 | void __setup_vector_irq(int cpu) |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 724adfc63cb9..cc5a2545dd41 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -169,6 +169,15 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
| 169 | DMI_MATCH(DMI_BOARD_NAME, "0KW626"), | 169 | DMI_MATCH(DMI_BOARD_NAME, "0KW626"), |
| 170 | }, | 170 | }, |
| 171 | }, | 171 | }, |
| 172 | { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */ | ||
| 173 | .callback = set_bios_reboot, | ||
| 174 | .ident = "Dell OptiPlex 330", | ||
| 175 | .matches = { | ||
| 176 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 177 | DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"), | ||
| 178 | DMI_MATCH(DMI_BOARD_NAME, "0KP561"), | ||
| 179 | }, | ||
| 180 | }, | ||
| 172 | { /* Handle problems with rebooting on Dell 2400's */ | 181 | { /* Handle problems with rebooting on Dell 2400's */ |
| 173 | .callback = set_bios_reboot, | 182 | .callback = set_bios_reboot, |
| 174 | .ident = "Dell PowerEdge 2400", | 183 | .ident = "Dell PowerEdge 2400", |
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index f5bdc92c1a65..8571e8c0bc67 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
| @@ -1690,9 +1690,11 @@ static int atl2_resume(struct pci_dev *pdev) | |||
| 1690 | 1690 | ||
| 1691 | ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); | 1691 | ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); |
| 1692 | 1692 | ||
| 1693 | err = atl2_request_irq(adapter); | 1693 | if (netif_running(netdev)) { |
| 1694 | if (netif_running(netdev) && err) | 1694 | err = atl2_request_irq(adapter); |
| 1695 | return err; | 1695 | if (err) |
| 1696 | return err; | ||
| 1697 | } | ||
| 1696 | 1698 | ||
| 1697 | atl2_reset_hw(&adapter->hw); | 1699 | atl2_reset_hw(&adapter->hw); |
| 1698 | 1700 | ||
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 7373dafbb3f7..059369885be1 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c | |||
| @@ -1112,7 +1112,7 @@ static void ipg_nic_rx_free_skb(struct net_device *dev) | |||
| 1112 | struct ipg_rx *rxfd = sp->rxd + entry; | 1112 | struct ipg_rx *rxfd = sp->rxd + entry; |
| 1113 | 1113 | ||
| 1114 | pci_unmap_single(sp->pdev, | 1114 | pci_unmap_single(sp->pdev, |
| 1115 | le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1115 | le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
| 1116 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1116 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
| 1117 | dev_kfree_skb_irq(sp->rx_buff[entry]); | 1117 | dev_kfree_skb_irq(sp->rx_buff[entry]); |
| 1118 | sp->rx_buff[entry] = NULL; | 1118 | sp->rx_buff[entry] = NULL; |
| @@ -1179,7 +1179,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev) | |||
| 1179 | */ | 1179 | */ |
| 1180 | if (sp->rx_buff[entry]) { | 1180 | if (sp->rx_buff[entry]) { |
| 1181 | pci_unmap_single(sp->pdev, | 1181 | pci_unmap_single(sp->pdev, |
| 1182 | le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1182 | le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
| 1183 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1183 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
| 1184 | 1184 | ||
| 1185 | dev_kfree_skb_irq(sp->rx_buff[entry]); | 1185 | dev_kfree_skb_irq(sp->rx_buff[entry]); |
| @@ -1246,7 +1246,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev, | |||
| 1246 | if (jumbo->found_start) | 1246 | if (jumbo->found_start) |
| 1247 | dev_kfree_skb_irq(jumbo->skb); | 1247 | dev_kfree_skb_irq(jumbo->skb); |
| 1248 | 1248 | ||
| 1249 | pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), | 1249 | pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN, |
| 1250 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1250 | sp->rx_buf_sz, PCI_DMA_FROMDEVICE); |
| 1251 | 1251 | ||
| 1252 | skb_put(skb, sp->rxfrag_size); | 1252 | skb_put(skb, sp->rxfrag_size); |
| @@ -1349,7 +1349,7 @@ static int ipg_nic_rx_jumbo(struct net_device *dev) | |||
| 1349 | unsigned int entry = curr % IPG_RFDLIST_LENGTH; | 1349 | unsigned int entry = curr % IPG_RFDLIST_LENGTH; |
| 1350 | struct ipg_rx *rxfd = sp->rxd + entry; | 1350 | struct ipg_rx *rxfd = sp->rxd + entry; |
| 1351 | 1351 | ||
| 1352 | if (!(rxfd->rfs & le64_to_cpu(IPG_RFS_RFDDONE))) | 1352 | if (!(rxfd->rfs & cpu_to_le64(IPG_RFS_RFDDONE))) |
| 1353 | break; | 1353 | break; |
| 1354 | 1354 | ||
| 1355 | switch (ipg_nic_rx_check_frame_type(dev)) { | 1355 | switch (ipg_nic_rx_check_frame_type(dev)) { |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7548fb7360d9..36f2bb666bf7 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -1287,7 +1287,34 @@ static void ixgbe_set_itr(struct ixgbe_adapter *adapter) | |||
| 1287 | return; | 1287 | return; |
| 1288 | } | 1288 | } |
| 1289 | 1289 | ||
| 1290 | static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter); | 1290 | /** |
| 1291 | * ixgbe_irq_disable - Mask off interrupt generation on the NIC | ||
| 1292 | * @adapter: board private structure | ||
| 1293 | **/ | ||
| 1294 | static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) | ||
| 1295 | { | ||
| 1296 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); | ||
| 1297 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
| 1298 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | ||
| 1299 | int i; | ||
| 1300 | for (i = 0; i < adapter->num_msix_vectors; i++) | ||
| 1301 | synchronize_irq(adapter->msix_entries[i].vector); | ||
| 1302 | } else { | ||
| 1303 | synchronize_irq(adapter->pdev->irq); | ||
| 1304 | } | ||
| 1305 | } | ||
| 1306 | |||
| 1307 | /** | ||
| 1308 | * ixgbe_irq_enable - Enable default interrupt generation settings | ||
| 1309 | * @adapter: board private structure | ||
| 1310 | **/ | ||
| 1311 | static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) | ||
| 1312 | { | ||
| 1313 | u32 mask; | ||
| 1314 | mask = IXGBE_EIMS_ENABLE_MASK; | ||
| 1315 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); | ||
| 1316 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
| 1317 | } | ||
| 1291 | 1318 | ||
| 1292 | /** | 1319 | /** |
| 1293 | * ixgbe_intr - legacy mode Interrupt Handler | 1320 | * ixgbe_intr - legacy mode Interrupt Handler |
| @@ -1394,35 +1421,6 @@ static void ixgbe_free_irq(struct ixgbe_adapter *adapter) | |||
| 1394 | } | 1421 | } |
| 1395 | 1422 | ||
| 1396 | /** | 1423 | /** |
| 1397 | * ixgbe_irq_disable - Mask off interrupt generation on the NIC | ||
| 1398 | * @adapter: board private structure | ||
| 1399 | **/ | ||
| 1400 | static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter) | ||
| 1401 | { | ||
| 1402 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0); | ||
| 1403 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
| 1404 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | ||
| 1405 | int i; | ||
| 1406 | for (i = 0; i < adapter->num_msix_vectors; i++) | ||
| 1407 | synchronize_irq(adapter->msix_entries[i].vector); | ||
| 1408 | } else { | ||
| 1409 | synchronize_irq(adapter->pdev->irq); | ||
| 1410 | } | ||
| 1411 | } | ||
| 1412 | |||
| 1413 | /** | ||
| 1414 | * ixgbe_irq_enable - Enable default interrupt generation settings | ||
| 1415 | * @adapter: board private structure | ||
| 1416 | **/ | ||
| 1417 | static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter) | ||
| 1418 | { | ||
| 1419 | u32 mask; | ||
| 1420 | mask = IXGBE_EIMS_ENABLE_MASK; | ||
| 1421 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); | ||
| 1422 | IXGBE_WRITE_FLUSH(&adapter->hw); | ||
| 1423 | } | ||
| 1424 | |||
| 1425 | /** | ||
| 1426 | * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts | 1424 | * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts |
| 1427 | * | 1425 | * |
| 1428 | **/ | 1426 | **/ |
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 81c6cdc3851f..665e70d620fc 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
| @@ -912,23 +912,23 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx) | |||
| 912 | skb_put(skb, framesize); | 912 | skb_put(skb, framesize); |
| 913 | skb->protocol = eth_type_trans(skb, jme->dev); | 913 | skb->protocol = eth_type_trans(skb, jme->dev); |
| 914 | 914 | ||
| 915 | if (jme_rxsum_ok(jme, rxdesc->descwb.flags)) | 915 | if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags))) |
| 916 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 916 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
| 917 | else | 917 | else |
| 918 | skb->ip_summed = CHECKSUM_NONE; | 918 | skb->ip_summed = CHECKSUM_NONE; |
| 919 | 919 | ||
| 920 | if (rxdesc->descwb.flags & RXWBFLAG_TAGON) { | 920 | if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) { |
| 921 | if (jme->vlgrp) { | 921 | if (jme->vlgrp) { |
| 922 | jme->jme_vlan_rx(skb, jme->vlgrp, | 922 | jme->jme_vlan_rx(skb, jme->vlgrp, |
| 923 | le32_to_cpu(rxdesc->descwb.vlan)); | 923 | le16_to_cpu(rxdesc->descwb.vlan)); |
| 924 | NET_STAT(jme).rx_bytes += 4; | 924 | NET_STAT(jme).rx_bytes += 4; |
| 925 | } | 925 | } |
| 926 | } else { | 926 | } else { |
| 927 | jme->jme_rx(skb); | 927 | jme->jme_rx(skb); |
| 928 | } | 928 | } |
| 929 | 929 | ||
| 930 | if ((le16_to_cpu(rxdesc->descwb.flags) & RXWBFLAG_DEST) == | 930 | if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_DEST)) == |
| 931 | RXWBFLAG_DEST_MUL) | 931 | cpu_to_le16(RXWBFLAG_DEST_MUL)) |
| 932 | ++(NET_STAT(jme).multicast); | 932 | ++(NET_STAT(jme).multicast); |
| 933 | 933 | ||
| 934 | jme->dev->last_rx = jiffies; | 934 | jme->dev->last_rx = jiffies; |
| @@ -961,7 +961,7 @@ jme_process_receive(struct jme_adapter *jme, int limit) | |||
| 961 | rxdesc = rxring->desc; | 961 | rxdesc = rxring->desc; |
| 962 | rxdesc += i; | 962 | rxdesc += i; |
| 963 | 963 | ||
| 964 | if ((rxdesc->descwb.flags & RXWBFLAG_OWN) || | 964 | if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || |
| 965 | !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) | 965 | !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) |
| 966 | goto out; | 966 | goto out; |
| 967 | 967 | ||
| @@ -1763,10 +1763,9 @@ jme_expand_header(struct jme_adapter *jme, struct sk_buff *skb) | |||
| 1763 | } | 1763 | } |
| 1764 | 1764 | ||
| 1765 | static int | 1765 | static int |
| 1766 | jme_tx_tso(struct sk_buff *skb, | 1766 | jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags) |
| 1767 | u16 *mss, u8 *flags) | ||
| 1768 | { | 1767 | { |
| 1769 | *mss = skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT; | 1768 | *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT); |
| 1770 | if (*mss) { | 1769 | if (*mss) { |
| 1771 | *flags |= TXFLAG_LSEN; | 1770 | *flags |= TXFLAG_LSEN; |
| 1772 | 1771 | ||
| @@ -1826,11 +1825,11 @@ jme_tx_csum(struct jme_adapter *jme, struct sk_buff *skb, u8 *flags) | |||
| 1826 | } | 1825 | } |
| 1827 | 1826 | ||
| 1828 | static inline void | 1827 | static inline void |
| 1829 | jme_tx_vlan(struct sk_buff *skb, u16 *vlan, u8 *flags) | 1828 | jme_tx_vlan(struct sk_buff *skb, __le16 *vlan, u8 *flags) |
| 1830 | { | 1829 | { |
| 1831 | if (vlan_tx_tag_present(skb)) { | 1830 | if (vlan_tx_tag_present(skb)) { |
| 1832 | *flags |= TXFLAG_TAGON; | 1831 | *flags |= TXFLAG_TAGON; |
| 1833 | *vlan = vlan_tx_tag_get(skb); | 1832 | *vlan = cpu_to_le16(vlan_tx_tag_get(skb)); |
| 1834 | } | 1833 | } |
| 1835 | } | 1834 | } |
| 1836 | 1835 | ||
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index b9dcdbd369f8..e513f76f2a9f 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
| @@ -899,7 +899,8 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) | |||
| 899 | if (skb != NULL) { | 899 | if (skb != NULL) { |
| 900 | if (skb_queue_len(&mp->rx_recycle) < | 900 | if (skb_queue_len(&mp->rx_recycle) < |
| 901 | mp->default_rx_ring_size && | 901 | mp->default_rx_ring_size && |
| 902 | skb_recycle_check(skb, mp->skb_size)) | 902 | skb_recycle_check(skb, mp->skb_size + |
| 903 | dma_get_cache_alignment() - 1)) | ||
| 903 | __skb_queue_head(&mp->rx_recycle, skb); | 904 | __skb_queue_head(&mp->rx_recycle, skb); |
| 904 | else | 905 | else |
| 905 | dev_kfree_skb(skb); | 906 | dev_kfree_skb(skb); |
| @@ -2435,8 +2436,8 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev) | |||
| 2435 | struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; | 2436 | struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; |
| 2436 | 2437 | ||
| 2437 | if (pd == NULL || pd->shared_smi == NULL) { | 2438 | if (pd == NULL || pd->shared_smi == NULL) { |
| 2438 | mdiobus_free(msp->smi_bus); | ||
| 2439 | mdiobus_unregister(msp->smi_bus); | 2439 | mdiobus_unregister(msp->smi_bus); |
| 2440 | mdiobus_free(msp->smi_bus); | ||
| 2440 | } | 2441 | } |
| 2441 | if (msp->err_interrupt != NO_IRQ) | 2442 | if (msp->err_interrupt != NO_IRQ) |
| 2442 | free_irq(msp->err_interrupt, msp); | 2443 | free_irq(msp->err_interrupt, msp); |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 8fb1faca883a..55bc24b234e3 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -564,20 +564,32 @@ EXPORT_SYMBOL(genphy_restart_aneg); | |||
| 564 | */ | 564 | */ |
| 565 | int genphy_config_aneg(struct phy_device *phydev) | 565 | int genphy_config_aneg(struct phy_device *phydev) |
| 566 | { | 566 | { |
| 567 | int result = 0; | 567 | int result; |
| 568 | 568 | ||
| 569 | if (AUTONEG_ENABLE == phydev->autoneg) { | 569 | if (AUTONEG_ENABLE != phydev->autoneg) |
| 570 | int result = genphy_config_advert(phydev); | 570 | return genphy_setup_forced(phydev); |
| 571 | |||
| 572 | result = genphy_config_advert(phydev); | ||
| 573 | |||
| 574 | if (result < 0) /* error */ | ||
| 575 | return result; | ||
| 571 | 576 | ||
| 572 | if (result < 0) /* error */ | 577 | if (result == 0) { |
| 573 | return result; | 578 | /* Advertisment hasn't changed, but maybe aneg was never on to |
| 579 | * begin with? Or maybe phy was isolated? */ | ||
| 580 | int ctl = phy_read(phydev, MII_BMCR); | ||
| 581 | |||
| 582 | if (ctl < 0) | ||
| 583 | return ctl; | ||
| 584 | |||
| 585 | if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE)) | ||
| 586 | result = 1; /* do restart aneg */ | ||
| 587 | } | ||
| 574 | 588 | ||
| 575 | /* Only restart aneg if we are advertising something different | 589 | /* Only restart aneg if we are advertising something different |
| 576 | * than we were before. */ | 590 | * than we were before. */ |
| 577 | if (result > 0) | 591 | if (result > 0) |
| 578 | result = genphy_restart_aneg(phydev); | 592 | result = genphy_restart_aneg(phydev); |
| 579 | } else | ||
| 580 | result = genphy_setup_forced(phydev); | ||
| 581 | 593 | ||
| 582 | return result; | 594 | return result; |
| 583 | } | 595 | } |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index a24bb68887ab..59f242a67714 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
| @@ -927,7 +927,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
| 927 | struct sh_eth_private *mdp = netdev_priv(ndev); | 927 | struct sh_eth_private *mdp = netdev_priv(ndev); |
| 928 | struct sh_eth_txdesc *txdesc; | 928 | struct sh_eth_txdesc *txdesc; |
| 929 | u32 entry; | 929 | u32 entry; |
| 930 | int flags; | 930 | unsigned long flags; |
| 931 | 931 | ||
| 932 | spin_lock_irqsave(&mdp->lock, flags); | 932 | spin_lock_irqsave(&mdp->lock, flags); |
| 933 | if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) { | 933 | if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) { |
| @@ -1141,7 +1141,7 @@ static int sh_mdio_init(struct net_device *ndev, int id) | |||
| 1141 | /* Hook up MII support for ethtool */ | 1141 | /* Hook up MII support for ethtool */ |
| 1142 | mdp->mii_bus->name = "sh_mii"; | 1142 | mdp->mii_bus->name = "sh_mii"; |
| 1143 | mdp->mii_bus->parent = &ndev->dev; | 1143 | mdp->mii_bus->parent = &ndev->dev; |
| 1144 | mdp->mii_bus->id[0] = id; | 1144 | snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%x", id); |
| 1145 | 1145 | ||
| 1146 | /* PHY IRQ */ | 1146 | /* PHY IRQ */ |
| 1147 | mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); | 1147 | mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); |
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 1f26ab0e7986..b185cd12269c 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
| @@ -1813,7 +1813,7 @@ static int __init smc911x_probe(struct net_device *dev) | |||
| 1813 | val = SMC_GET_BYTE_TEST(lp); | 1813 | val = SMC_GET_BYTE_TEST(lp); |
| 1814 | DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val); | 1814 | DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val); |
| 1815 | if (val != 0x87654321) { | 1815 | if (val != 0x87654321) { |
| 1816 | printk(KERN_ERR "Invalid chip endian 0x08%x\n",val); | 1816 | printk(KERN_ERR "Invalid chip endian 0x%08x\n",val); |
| 1817 | retval = -ENODEV; | 1817 | retval = -ENODEV; |
| 1818 | goto err_out; | 1818 | goto err_out; |
| 1819 | } | 1819 | } |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index e12cdb4543b4..de57490103fc 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
| @@ -1102,12 +1102,14 @@ static int ax88178_link_reset(struct usbnet *dev) | |||
| 1102 | mode = AX88178_MEDIUM_DEFAULT; | 1102 | mode = AX88178_MEDIUM_DEFAULT; |
| 1103 | 1103 | ||
| 1104 | if (ecmd.speed == SPEED_1000) | 1104 | if (ecmd.speed == SPEED_1000) |
| 1105 | mode |= AX_MEDIUM_GM | AX_MEDIUM_ENCK; | 1105 | mode |= AX_MEDIUM_GM; |
| 1106 | else if (ecmd.speed == SPEED_100) | 1106 | else if (ecmd.speed == SPEED_100) |
| 1107 | mode |= AX_MEDIUM_PS; | 1107 | mode |= AX_MEDIUM_PS; |
| 1108 | else | 1108 | else |
| 1109 | mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM); | 1109 | mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM); |
| 1110 | 1110 | ||
| 1111 | mode |= AX_MEDIUM_ENCK; | ||
| 1112 | |||
| 1111 | if (ecmd.duplex == DUPLEX_FULL) | 1113 | if (ecmd.duplex == DUPLEX_FULL) |
| 1112 | mode |= AX_MEDIUM_FD; | 1114 | mode |= AX_MEDIUM_FD; |
| 1113 | else | 1115 | else |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 8d690a0eb1a9..444c5cc05f03 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
| @@ -1384,7 +1384,7 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
| 1384 | 1384 | ||
| 1385 | rxq->queue[i] = NULL; | 1385 | rxq->queue[i] = NULL; |
| 1386 | 1386 | ||
| 1387 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, | 1387 | pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->aligned_dma_addr, |
| 1388 | priv->hw_params.rx_buf_size, | 1388 | priv->hw_params.rx_buf_size, |
| 1389 | PCI_DMA_FROMDEVICE); | 1389 | PCI_DMA_FROMDEVICE); |
| 1390 | pkt = (struct iwl_rx_packet *)rxb->skb->data; | 1390 | pkt = (struct iwl_rx_packet *)rxb->skb->data; |
| @@ -1436,8 +1436,8 @@ void iwl_rx_handle(struct iwl_priv *priv) | |||
| 1436 | rxb->skb = NULL; | 1436 | rxb->skb = NULL; |
| 1437 | } | 1437 | } |
| 1438 | 1438 | ||
| 1439 | pci_unmap_single(priv->pci_dev, rxb->dma_addr, | 1439 | pci_unmap_single(priv->pci_dev, rxb->real_dma_addr, |
| 1440 | priv->hw_params.rx_buf_size, | 1440 | priv->hw_params.rx_buf_size + 256, |
| 1441 | PCI_DMA_FROMDEVICE); | 1441 | PCI_DMA_FROMDEVICE); |
| 1442 | spin_lock_irqsave(&rxq->lock, flags); | 1442 | spin_lock_irqsave(&rxq->lock, flags); |
| 1443 | list_add_tail(&rxb->list, &priv->rxq.rx_used); | 1443 | list_add_tail(&rxb->list, &priv->rxq.rx_used); |
| @@ -2341,7 +2341,6 @@ static void iwl_bg_alive_start(struct work_struct *data) | |||
| 2341 | mutex_lock(&priv->mutex); | 2341 | mutex_lock(&priv->mutex); |
| 2342 | iwl_alive_start(priv); | 2342 | iwl_alive_start(priv); |
| 2343 | mutex_unlock(&priv->mutex); | 2343 | mutex_unlock(&priv->mutex); |
| 2344 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
| 2345 | } | 2344 | } |
| 2346 | 2345 | ||
| 2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) | 2346 | static void iwl4965_bg_rf_kill(struct work_struct *work) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index c018121085e9..9966d4e384ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
| @@ -89,7 +89,8 @@ extern struct iwl_cfg iwl5100_abg_cfg; | |||
| 89 | #define DEFAULT_LONG_RETRY_LIMIT 4U | 89 | #define DEFAULT_LONG_RETRY_LIMIT 4U |
| 90 | 90 | ||
| 91 | struct iwl_rx_mem_buffer { | 91 | struct iwl_rx_mem_buffer { |
| 92 | dma_addr_t dma_addr; | 92 | dma_addr_t real_dma_addr; |
| 93 | dma_addr_t aligned_dma_addr; | ||
| 93 | struct sk_buff *skb; | 94 | struct sk_buff *skb; |
| 94 | struct list_head list; | 95 | struct list_head list; |
| 95 | }; | 96 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index 7cde9d76ff5d..0509c16dbe75 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
| @@ -204,7 +204,7 @@ int iwl_rx_queue_restock(struct iwl_priv *priv) | |||
| 204 | list_del(element); | 204 | list_del(element); |
| 205 | 205 | ||
| 206 | /* Point to Rx buffer via next RBD in circular buffer */ | 206 | /* Point to Rx buffer via next RBD in circular buffer */ |
| 207 | rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->dma_addr); | 207 | rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->aligned_dma_addr); |
| 208 | rxq->queue[rxq->write] = rxb; | 208 | rxq->queue[rxq->write] = rxb; |
| 209 | rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; | 209 | rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; |
| 210 | rxq->free_count--; | 210 | rxq->free_count--; |
| @@ -251,7 +251,7 @@ void iwl_rx_allocate(struct iwl_priv *priv) | |||
| 251 | rxb = list_entry(element, struct iwl_rx_mem_buffer, list); | 251 | rxb = list_entry(element, struct iwl_rx_mem_buffer, list); |
| 252 | 252 | ||
| 253 | /* Alloc a new receive buffer */ | 253 | /* Alloc a new receive buffer */ |
| 254 | rxb->skb = alloc_skb(priv->hw_params.rx_buf_size, | 254 | rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256, |
| 255 | __GFP_NOWARN | GFP_ATOMIC); | 255 | __GFP_NOWARN | GFP_ATOMIC); |
| 256 | if (!rxb->skb) { | 256 | if (!rxb->skb) { |
| 257 | if (net_ratelimit()) | 257 | if (net_ratelimit()) |
| @@ -266,9 +266,17 @@ void iwl_rx_allocate(struct iwl_priv *priv) | |||
| 266 | list_del(element); | 266 | list_del(element); |
| 267 | 267 | ||
| 268 | /* Get physical address of RB/SKB */ | 268 | /* Get physical address of RB/SKB */ |
| 269 | rxb->dma_addr = | 269 | rxb->real_dma_addr = pci_map_single( |
| 270 | pci_map_single(priv->pci_dev, rxb->skb->data, | 270 | priv->pci_dev, |
| 271 | priv->hw_params.rx_buf_size, PCI_DMA_FROMDEVICE); | 271 | rxb->skb->data, |
| 272 | priv->hw_params.rx_buf_size + 256, | ||
| 273 | PCI_DMA_FROMDEVICE); | ||
| 274 | /* dma address must be no more than 36 bits */ | ||
| 275 | BUG_ON(rxb->real_dma_addr & ~DMA_BIT_MASK(36)); | ||
| 276 | /* and also 256 byte aligned! */ | ||
| 277 | rxb->aligned_dma_addr = ALIGN(rxb->real_dma_addr, 256); | ||
| 278 | skb_reserve(rxb->skb, rxb->aligned_dma_addr - rxb->real_dma_addr); | ||
| 279 | |||
| 272 | list_add_tail(&rxb->list, &rxq->rx_free); | 280 | list_add_tail(&rxb->list, &rxq->rx_free); |
| 273 | rxq->free_count++; | 281 | rxq->free_count++; |
| 274 | } | 282 | } |
| @@ -300,8 +308,8 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
| 300 | for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { | 308 | for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { |
| 301 | if (rxq->pool[i].skb != NULL) { | 309 | if (rxq->pool[i].skb != NULL) { |
| 302 | pci_unmap_single(priv->pci_dev, | 310 | pci_unmap_single(priv->pci_dev, |
| 303 | rxq->pool[i].dma_addr, | 311 | rxq->pool[i].real_dma_addr, |
| 304 | priv->hw_params.rx_buf_size, | 312 | priv->hw_params.rx_buf_size + 256, |
| 305 | PCI_DMA_FROMDEVICE); | 313 | PCI_DMA_FROMDEVICE); |
| 306 | dev_kfree_skb(rxq->pool[i].skb); | 314 | dev_kfree_skb(rxq->pool[i].skb); |
| 307 | } | 315 | } |
| @@ -354,8 +362,8 @@ void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
| 354 | * to an SKB, so we need to unmap and free potential storage */ | 362 | * to an SKB, so we need to unmap and free potential storage */ |
| 355 | if (rxq->pool[i].skb != NULL) { | 363 | if (rxq->pool[i].skb != NULL) { |
| 356 | pci_unmap_single(priv->pci_dev, | 364 | pci_unmap_single(priv->pci_dev, |
| 357 | rxq->pool[i].dma_addr, | 365 | rxq->pool[i].real_dma_addr, |
| 358 | priv->hw_params.rx_buf_size, | 366 | priv->hw_params.rx_buf_size + 256, |
| 359 | PCI_DMA_FROMDEVICE); | 367 | PCI_DMA_FROMDEVICE); |
| 360 | priv->alloc_rxb_skb--; | 368 | priv->alloc_rxb_skb--; |
| 361 | dev_kfree_skb(rxq->pool[i].skb); | 369 | dev_kfree_skb(rxq->pool[i].skb); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 285b53e7e261..45a6b0c35695 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
| @@ -6012,7 +6012,6 @@ static void iwl3945_bg_alive_start(struct work_struct *data) | |||
| 6012 | mutex_lock(&priv->mutex); | 6012 | mutex_lock(&priv->mutex); |
| 6013 | iwl3945_alive_start(priv); | 6013 | iwl3945_alive_start(priv); |
| 6014 | mutex_unlock(&priv->mutex); | 6014 | mutex_unlock(&priv->mutex); |
| 6015 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
| 6016 | } | 6015 | } |
| 6017 | 6016 | ||
| 6018 | static void iwl3945_bg_rf_kill(struct work_struct *work) | 6017 | static void iwl3945_bg_rf_kill(struct work_struct *work) |
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c index 1cc03a8dd67a..59634c33b1f9 100644 --- a/drivers/net/wireless/libertas_tf/if_usb.c +++ b/drivers/net/wireless/libertas_tf/if_usb.c | |||
| @@ -331,7 +331,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp, | |||
| 331 | /* Fill the receive configuration URB and initialise the Rx call back */ | 331 | /* Fill the receive configuration URB and initialise the Rx call back */ |
| 332 | usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, | 332 | usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, |
| 333 | usb_rcvbulkpipe(cardp->udev, cardp->ep_in), | 333 | usb_rcvbulkpipe(cardp->udev, cardp->ep_in), |
| 334 | (void *) (skb->tail), | 334 | skb_tail_pointer(skb), |
| 335 | MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, cardp); | 335 | MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, cardp); |
| 336 | 336 | ||
| 337 | cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; | 337 | cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index a2692724b68f..5c8baa43ac9c 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
| @@ -1655,12 +1655,14 @@ int __init init_dmars(void) | |||
| 1655 | iommu->flush.flush_context = __iommu_flush_context; | 1655 | iommu->flush.flush_context = __iommu_flush_context; |
| 1656 | iommu->flush.flush_iotlb = __iommu_flush_iotlb; | 1656 | iommu->flush.flush_iotlb = __iommu_flush_iotlb; |
| 1657 | printk(KERN_INFO "IOMMU 0x%Lx: using Register based " | 1657 | printk(KERN_INFO "IOMMU 0x%Lx: using Register based " |
| 1658 | "invalidation\n", drhd->reg_base_addr); | 1658 | "invalidation\n", |
| 1659 | (unsigned long long)drhd->reg_base_addr); | ||
| 1659 | } else { | 1660 | } else { |
| 1660 | iommu->flush.flush_context = qi_flush_context; | 1661 | iommu->flush.flush_context = qi_flush_context; |
| 1661 | iommu->flush.flush_iotlb = qi_flush_iotlb; | 1662 | iommu->flush.flush_iotlb = qi_flush_iotlb; |
| 1662 | printk(KERN_INFO "IOMMU 0x%Lx: using Queued " | 1663 | printk(KERN_INFO "IOMMU 0x%Lx: using Queued " |
| 1663 | "invalidation\n", drhd->reg_base_addr); | 1664 | "invalidation\n", |
| 1665 | (unsigned long long)drhd->reg_base_addr); | ||
| 1664 | } | 1666 | } |
| 1665 | } | 1667 | } |
| 1666 | 1668 | ||
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 8855331b2fba..e078b7aea143 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
| @@ -8,7 +8,11 @@ handling fcntl(F_SETLEASE). Convert cifs to using blocking tcp | |||
| 8 | sends, and also let tcp autotune the socket send and receive buffers. | 8 | sends, and also let tcp autotune the socket send and receive buffers. |
| 9 | This reduces the number of EAGAIN errors returned by TCP/IP in | 9 | This reduces the number of EAGAIN errors returned by TCP/IP in |
| 10 | high stress workloads (and the number of retries on socket writes | 10 | high stress workloads (and the number of retries on socket writes |
| 11 | when sending large SMBWriteX requests). | 11 | when sending large SMBWriteX requests). Fix case in which a portion of |
| 12 | data can in some cases not get written to the file on the server before the | ||
| 13 | file is closed. Fix DFS parsing to properly handle path consumed field, | ||
| 14 | and to handle certain codepage conversions better. Fix mount and | ||
| 15 | umount race that can cause oops in mount or umount or reconnect. | ||
| 12 | 16 | ||
| 13 | Version 1.54 | 17 | Version 1.54 |
| 14 | ------------ | 18 | ------------ |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index f1ae1f57c30d..c57c0565547f 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
| @@ -606,7 +606,15 @@ GLOBAL_EXTERN struct list_head cifs_tcp_ses_list; | |||
| 606 | * changes to the tcon->tidStatus should be done while holding this lock. | 606 | * changes to the tcon->tidStatus should be done while holding this lock. |
| 607 | */ | 607 | */ |
| 608 | GLOBAL_EXTERN rwlock_t cifs_tcp_ses_lock; | 608 | GLOBAL_EXTERN rwlock_t cifs_tcp_ses_lock; |
| 609 | GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */ | 609 | |
| 610 | /* | ||
| 611 | * This lock protects the cifs_file->llist and cifs_file->flist | ||
| 612 | * list operations, and updates to some flags (cifs_file->invalidHandle) | ||
| 613 | * It will be moved to either use the tcon->stat_lock or equivalent later. | ||
| 614 | * If cifs_tcp_ses_lock and the lock below are both needed to be held, then | ||
| 615 | * the cifs_tcp_ses_lock must be grabbed first and released last. | ||
| 616 | */ | ||
| 617 | GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; | ||
| 610 | 618 | ||
| 611 | GLOBAL_EXTERN struct list_head GlobalOplock_Q; | 619 | GLOBAL_EXTERN struct list_head GlobalOplock_Q; |
| 612 | 620 | ||
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index bdda46dd435a..2af8626ced43 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -295,7 +295,7 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, | |||
| 295 | check for tcp and smb session status done differently | 295 | check for tcp and smb session status done differently |
| 296 | for those three - in the calling routine */ | 296 | for those three - in the calling routine */ |
| 297 | if (tcon) { | 297 | if (tcon) { |
| 298 | if (tcon->need_reconnect) { | 298 | if (tcon->tidStatus == CifsExiting) { |
| 299 | /* only tree disconnect, open, and write, | 299 | /* only tree disconnect, open, and write, |
| 300 | (and ulogoff which does not have tcon) | 300 | (and ulogoff which does not have tcon) |
| 301 | are allowed as we start force umount */ | 301 | are allowed as we start force umount */ |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 6449e1aae621..b691b893a848 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
| @@ -488,12 +488,13 @@ int cifs_close(struct inode *inode, struct file *file) | |||
| 488 | pTcon = cifs_sb->tcon; | 488 | pTcon = cifs_sb->tcon; |
| 489 | if (pSMBFile) { | 489 | if (pSMBFile) { |
| 490 | struct cifsLockInfo *li, *tmp; | 490 | struct cifsLockInfo *li, *tmp; |
| 491 | 491 | write_lock(&GlobalSMBSeslock); | |
| 492 | pSMBFile->closePend = true; | 492 | pSMBFile->closePend = true; |
| 493 | if (pTcon) { | 493 | if (pTcon) { |
| 494 | /* no sense reconnecting to close a file that is | 494 | /* no sense reconnecting to close a file that is |
| 495 | already closed */ | 495 | already closed */ |
| 496 | if (!pTcon->need_reconnect) { | 496 | if (!pTcon->need_reconnect) { |
| 497 | write_unlock(&GlobalSMBSeslock); | ||
| 497 | timeout = 2; | 498 | timeout = 2; |
| 498 | while ((atomic_read(&pSMBFile->wrtPending) != 0) | 499 | while ((atomic_read(&pSMBFile->wrtPending) != 0) |
| 499 | && (timeout <= 2048)) { | 500 | && (timeout <= 2048)) { |
| @@ -510,12 +511,15 @@ int cifs_close(struct inode *inode, struct file *file) | |||
| 510 | timeout *= 4; | 511 | timeout *= 4; |
| 511 | } | 512 | } |
| 512 | if (atomic_read(&pSMBFile->wrtPending)) | 513 | if (atomic_read(&pSMBFile->wrtPending)) |
| 513 | cERROR(1, | 514 | cERROR(1, ("close with pending write")); |
| 514 | ("close with pending writes")); | 515 | if (!pTcon->need_reconnect && |
| 515 | rc = CIFSSMBClose(xid, pTcon, | 516 | !pSMBFile->invalidHandle) |
| 517 | rc = CIFSSMBClose(xid, pTcon, | ||
| 516 | pSMBFile->netfid); | 518 | pSMBFile->netfid); |
| 517 | } | 519 | } else |
| 518 | } | 520 | write_unlock(&GlobalSMBSeslock); |
| 521 | } else | ||
| 522 | write_unlock(&GlobalSMBSeslock); | ||
| 519 | 523 | ||
| 520 | /* Delete any outstanding lock records. | 524 | /* Delete any outstanding lock records. |
| 521 | We'll lose them when the file is closed anyway. */ | 525 | We'll lose them when the file is closed anyway. */ |
| @@ -587,15 +591,18 @@ int cifs_closedir(struct inode *inode, struct file *file) | |||
| 587 | pTcon = cifs_sb->tcon; | 591 | pTcon = cifs_sb->tcon; |
| 588 | 592 | ||
| 589 | cFYI(1, ("Freeing private data in close dir")); | 593 | cFYI(1, ("Freeing private data in close dir")); |
| 594 | write_lock(&GlobalSMBSeslock); | ||
| 590 | if (!pCFileStruct->srch_inf.endOfSearch && | 595 | if (!pCFileStruct->srch_inf.endOfSearch && |
| 591 | !pCFileStruct->invalidHandle) { | 596 | !pCFileStruct->invalidHandle) { |
| 592 | pCFileStruct->invalidHandle = true; | 597 | pCFileStruct->invalidHandle = true; |
| 598 | write_unlock(&GlobalSMBSeslock); | ||
| 593 | rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); | 599 | rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); |
| 594 | cFYI(1, ("Closing uncompleted readdir with rc %d", | 600 | cFYI(1, ("Closing uncompleted readdir with rc %d", |
| 595 | rc)); | 601 | rc)); |
| 596 | /* not much we can do if it fails anyway, ignore rc */ | 602 | /* not much we can do if it fails anyway, ignore rc */ |
| 597 | rc = 0; | 603 | rc = 0; |
| 598 | } | 604 | } else |
| 605 | write_unlock(&GlobalSMBSeslock); | ||
| 599 | ptmp = pCFileStruct->srch_inf.ntwrk_buf_start; | 606 | ptmp = pCFileStruct->srch_inf.ntwrk_buf_start; |
| 600 | if (ptmp) { | 607 | if (ptmp) { |
| 601 | cFYI(1, ("closedir free smb buf in srch struct")); | 608 | cFYI(1, ("closedir free smb buf in srch struct")); |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index addd1dcc2d79..9ee3f689c2b0 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
| @@ -555,12 +555,14 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
| 555 | continue; | 555 | continue; |
| 556 | 556 | ||
| 557 | cifs_stats_inc(&tcon->num_oplock_brks); | 557 | cifs_stats_inc(&tcon->num_oplock_brks); |
| 558 | write_lock(&GlobalSMBSeslock); | ||
| 558 | list_for_each(tmp2, &tcon->openFileList) { | 559 | list_for_each(tmp2, &tcon->openFileList) { |
| 559 | netfile = list_entry(tmp2, struct cifsFileInfo, | 560 | netfile = list_entry(tmp2, struct cifsFileInfo, |
| 560 | tlist); | 561 | tlist); |
| 561 | if (pSMB->Fid != netfile->netfid) | 562 | if (pSMB->Fid != netfile->netfid) |
| 562 | continue; | 563 | continue; |
| 563 | 564 | ||
| 565 | write_unlock(&GlobalSMBSeslock); | ||
| 564 | read_unlock(&cifs_tcp_ses_lock); | 566 | read_unlock(&cifs_tcp_ses_lock); |
| 565 | cFYI(1, ("file id match, oplock break")); | 567 | cFYI(1, ("file id match, oplock break")); |
| 566 | pCifsInode = CIFS_I(netfile->pInode); | 568 | pCifsInode = CIFS_I(netfile->pInode); |
| @@ -576,6 +578,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
| 576 | 578 | ||
| 577 | return true; | 579 | return true; |
| 578 | } | 580 | } |
| 581 | write_unlock(&GlobalSMBSeslock); | ||
| 579 | read_unlock(&cifs_tcp_ses_lock); | 582 | read_unlock(&cifs_tcp_ses_lock); |
| 580 | cFYI(1, ("No matching file for oplock break")); | 583 | cFYI(1, ("No matching file for oplock break")); |
| 581 | return true; | 584 | return true; |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 58d57299f2a0..9f51f9bf0292 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
| @@ -741,11 +741,14 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon, | |||
| 741 | (index_to_find < first_entry_in_buffer)) { | 741 | (index_to_find < first_entry_in_buffer)) { |
| 742 | /* close and restart search */ | 742 | /* close and restart search */ |
| 743 | cFYI(1, ("search backing up - close and restart search")); | 743 | cFYI(1, ("search backing up - close and restart search")); |
| 744 | write_lock(&GlobalSMBSeslock); | ||
| 744 | if (!cifsFile->srch_inf.endOfSearch && | 745 | if (!cifsFile->srch_inf.endOfSearch && |
| 745 | !cifsFile->invalidHandle) { | 746 | !cifsFile->invalidHandle) { |
| 746 | cifsFile->invalidHandle = true; | 747 | cifsFile->invalidHandle = true; |
| 748 | write_unlock(&GlobalSMBSeslock); | ||
| 747 | CIFSFindClose(xid, pTcon, cifsFile->netfid); | 749 | CIFSFindClose(xid, pTcon, cifsFile->netfid); |
| 748 | } | 750 | } else |
| 751 | write_unlock(&GlobalSMBSeslock); | ||
| 749 | if (cifsFile->srch_inf.ntwrk_buf_start) { | 752 | if (cifsFile->srch_inf.ntwrk_buf_start) { |
| 750 | cFYI(1, ("freeing SMB ff cache buf on search rewind")); | 753 | cFYI(1, ("freeing SMB ff cache buf on search rewind")); |
| 751 | if (cifsFile->srch_inf.smallBuf) | 754 | if (cifsFile->srch_inf.smallBuf) |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 8856e2d60e9f..73d81bc6aa75 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -74,14 +74,6 @@ | |||
| 74 | */ | 74 | */ |
| 75 | 75 | ||
| 76 | /** | 76 | /** |
| 77 | * enum ieee80211_notification_type - Low level driver notification | ||
| 78 | * @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence | ||
| 79 | */ | ||
| 80 | enum ieee80211_notification_types { | ||
| 81 | IEEE80211_NOTIFY_RE_ASSOC, | ||
| 82 | }; | ||
| 83 | |||
| 84 | /** | ||
| 85 | * struct ieee80211_ht_bss_info - describing BSS's HT characteristics | 77 | * struct ieee80211_ht_bss_info - describing BSS's HT characteristics |
| 86 | * | 78 | * |
| 87 | * This structure describes most essential parameters needed | 79 | * This structure describes most essential parameters needed |
| @@ -1798,18 +1790,6 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
| 1798 | u16 tid); | 1790 | u16 tid); |
| 1799 | 1791 | ||
| 1800 | /** | 1792 | /** |
| 1801 | * ieee80211_notify_mac - low level driver notification | ||
| 1802 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | ||
| 1803 | * @notif_type: enum ieee80211_notification_types | ||
| 1804 | * | ||
| 1805 | * This function must be called by low level driver to inform mac80211 of | ||
| 1806 | * low level driver status change or force mac80211 to re-assoc for low | ||
| 1807 | * level driver internal error that require re-assoc. | ||
| 1808 | */ | ||
| 1809 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | ||
| 1810 | enum ieee80211_notification_types notif_type); | ||
| 1811 | |||
| 1812 | /** | ||
| 1813 | * ieee80211_find_sta - find a station | 1793 | * ieee80211_find_sta - find a station |
| 1814 | * | 1794 | * |
| 1815 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 1795 | * @hw: pointer as obtained from ieee80211_alloc_hw() |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index e60205722d0c..78db083390f0 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -326,96 +326,89 @@ ftrace_record_ip(unsigned long ip) | |||
| 326 | 326 | ||
| 327 | static int | 327 | static int |
| 328 | __ftrace_replace_code(struct dyn_ftrace *rec, | 328 | __ftrace_replace_code(struct dyn_ftrace *rec, |
| 329 | unsigned char *old, unsigned char *new, int enable) | 329 | unsigned char *nop, int enable) |
| 330 | { | 330 | { |
| 331 | unsigned long ip, fl; | 331 | unsigned long ip, fl; |
| 332 | unsigned char *call, *old, *new; | ||
| 332 | 333 | ||
| 333 | ip = rec->ip; | 334 | ip = rec->ip; |
| 334 | 335 | ||
| 335 | if (ftrace_filtered && enable) { | 336 | /* |
| 337 | * If this record is not to be traced and | ||
| 338 | * it is not enabled then do nothing. | ||
| 339 | * | ||
| 340 | * If this record is not to be traced and | ||
| 341 | * it is enabled then disabled it. | ||
| 342 | * | ||
| 343 | */ | ||
| 344 | if (rec->flags & FTRACE_FL_NOTRACE) { | ||
| 345 | if (rec->flags & FTRACE_FL_ENABLED) | ||
| 346 | rec->flags &= ~FTRACE_FL_ENABLED; | ||
| 347 | else | ||
| 348 | return 0; | ||
| 349 | |||
| 350 | } else if (ftrace_filtered && enable) { | ||
| 336 | /* | 351 | /* |
| 337 | * If filtering is on: | 352 | * Filtering is on: |
| 338 | * | ||
| 339 | * If this record is set to be filtered and | ||
| 340 | * is enabled then do nothing. | ||
| 341 | * | ||
| 342 | * If this record is set to be filtered and | ||
| 343 | * it is not enabled, enable it. | ||
| 344 | * | ||
| 345 | * If this record is not set to be filtered | ||
| 346 | * and it is not enabled do nothing. | ||
| 347 | * | ||
| 348 | * If this record is set not to trace then | ||
| 349 | * do nothing. | ||
| 350 | * | ||
| 351 | * If this record is set not to trace and | ||
| 352 | * it is enabled then disable it. | ||
| 353 | * | ||
| 354 | * If this record is not set to be filtered and | ||
| 355 | * it is enabled, disable it. | ||
| 356 | */ | 353 | */ |
| 357 | 354 | ||
| 358 | fl = rec->flags & (FTRACE_FL_FILTER | FTRACE_FL_NOTRACE | | 355 | fl = rec->flags & (FTRACE_FL_FILTER | FTRACE_FL_ENABLED); |
| 359 | FTRACE_FL_ENABLED); | ||
| 360 | 356 | ||
| 361 | if ((fl == (FTRACE_FL_FILTER | FTRACE_FL_ENABLED)) || | 357 | /* Record is filtered and enabled, do nothing */ |
| 362 | (fl == (FTRACE_FL_FILTER | FTRACE_FL_NOTRACE)) || | 358 | if (fl == (FTRACE_FL_FILTER | FTRACE_FL_ENABLED)) |
| 363 | !fl || (fl == FTRACE_FL_NOTRACE)) | ||
| 364 | return 0; | 359 | return 0; |
| 365 | 360 | ||
| 366 | /* | 361 | /* Record is not filtered and is not enabled do nothing */ |
| 367 | * If it is enabled disable it, | 362 | if (!fl) |
| 368 | * otherwise enable it! | 363 | return 0; |
| 369 | */ | 364 | |
| 370 | if (fl & FTRACE_FL_ENABLED) { | 365 | /* Record is not filtered but enabled, disable it */ |
| 371 | /* swap new and old */ | 366 | if (fl == FTRACE_FL_ENABLED) |
| 372 | new = old; | ||
| 373 | old = ftrace_call_replace(ip, FTRACE_ADDR); | ||
| 374 | rec->flags &= ~FTRACE_FL_ENABLED; | 367 | rec->flags &= ~FTRACE_FL_ENABLED; |
| 375 | } else { | 368 | else |
| 376 | new = ftrace_call_replace(ip, FTRACE_ADDR); | 369 | /* Otherwise record is filtered but not enabled, enable it */ |
| 377 | rec->flags |= FTRACE_FL_ENABLED; | 370 | rec->flags |= FTRACE_FL_ENABLED; |
| 378 | } | ||
| 379 | } else { | 371 | } else { |
| 372 | /* Disable or not filtered */ | ||
| 380 | 373 | ||
| 381 | if (enable) { | 374 | if (enable) { |
| 382 | /* | 375 | /* if record is enabled, do nothing */ |
| 383 | * If this record is set not to trace and is | ||
| 384 | * not enabled, do nothing. | ||
| 385 | */ | ||
| 386 | fl = rec->flags & (FTRACE_FL_NOTRACE | FTRACE_FL_ENABLED); | ||
| 387 | if (fl == FTRACE_FL_NOTRACE) | ||
| 388 | return 0; | ||
| 389 | |||
| 390 | new = ftrace_call_replace(ip, FTRACE_ADDR); | ||
| 391 | } else | ||
| 392 | old = ftrace_call_replace(ip, FTRACE_ADDR); | ||
| 393 | |||
| 394 | if (enable) { | ||
| 395 | if (rec->flags & FTRACE_FL_ENABLED) | 376 | if (rec->flags & FTRACE_FL_ENABLED) |
| 396 | return 0; | 377 | return 0; |
| 378 | |||
| 397 | rec->flags |= FTRACE_FL_ENABLED; | 379 | rec->flags |= FTRACE_FL_ENABLED; |
| 380 | |||
| 398 | } else { | 381 | } else { |
| 382 | |||
| 383 | /* if record is not enabled do nothing */ | ||
| 399 | if (!(rec->flags & FTRACE_FL_ENABLED)) | 384 | if (!(rec->flags & FTRACE_FL_ENABLED)) |
| 400 | return 0; | 385 | return 0; |
| 386 | |||
| 401 | rec->flags &= ~FTRACE_FL_ENABLED; | 387 | rec->flags &= ~FTRACE_FL_ENABLED; |
| 402 | } | 388 | } |
| 403 | } | 389 | } |
| 404 | 390 | ||
| 391 | call = ftrace_call_replace(ip, FTRACE_ADDR); | ||
| 392 | |||
| 393 | if (rec->flags & FTRACE_FL_ENABLED) { | ||
| 394 | old = nop; | ||
| 395 | new = call; | ||
| 396 | } else { | ||
| 397 | old = call; | ||
| 398 | new = nop; | ||
| 399 | } | ||
| 400 | |||
| 405 | return ftrace_modify_code(ip, old, new); | 401 | return ftrace_modify_code(ip, old, new); |
| 406 | } | 402 | } |
| 407 | 403 | ||
| 408 | static void ftrace_replace_code(int enable) | 404 | static void ftrace_replace_code(int enable) |
| 409 | { | 405 | { |
| 410 | int i, failed; | 406 | int i, failed; |
| 411 | unsigned char *new = NULL, *old = NULL; | 407 | unsigned char *nop = NULL; |
| 412 | struct dyn_ftrace *rec; | 408 | struct dyn_ftrace *rec; |
| 413 | struct ftrace_page *pg; | 409 | struct ftrace_page *pg; |
| 414 | 410 | ||
| 415 | if (enable) | 411 | nop = ftrace_nop_replace(); |
| 416 | old = ftrace_nop_replace(); | ||
| 417 | else | ||
| 418 | new = ftrace_nop_replace(); | ||
| 419 | 412 | ||
| 420 | for (pg = ftrace_pages_start; pg; pg = pg->next) { | 413 | for (pg = ftrace_pages_start; pg; pg = pg->next) { |
| 421 | for (i = 0; i < pg->index; i++) { | 414 | for (i = 0; i < pg->index; i++) { |
| @@ -433,7 +426,7 @@ static void ftrace_replace_code(int enable) | |||
| 433 | unfreeze_record(rec); | 426 | unfreeze_record(rec); |
| 434 | } | 427 | } |
| 435 | 428 | ||
| 436 | failed = __ftrace_replace_code(rec, old, new, enable); | 429 | failed = __ftrace_replace_code(rec, nop, enable); |
| 437 | if (failed && (rec->flags & FTRACE_FL_CONVERTED)) { | 430 | if (failed && (rec->flags & FTRACE_FL_CONVERTED)) { |
| 438 | rec->flags |= FTRACE_FL_FAILED; | 431 | rec->flags |= FTRACE_FL_FAILED; |
| 439 | if ((system_state == SYSTEM_BOOTING) || | 432 | if ((system_state == SYSTEM_BOOTING) || |
| @@ -534,8 +527,7 @@ static void ftrace_startup(void) | |||
| 534 | 527 | ||
| 535 | mutex_lock(&ftrace_start_lock); | 528 | mutex_lock(&ftrace_start_lock); |
| 536 | ftrace_start++; | 529 | ftrace_start++; |
| 537 | if (ftrace_start == 1) | 530 | command |= FTRACE_ENABLE_CALLS; |
| 538 | command |= FTRACE_ENABLE_CALLS; | ||
| 539 | 531 | ||
| 540 | if (saved_ftrace_func != ftrace_trace_function) { | 532 | if (saved_ftrace_func != ftrace_trace_function) { |
| 541 | saved_ftrace_func = ftrace_trace_function; | 533 | saved_ftrace_func = ftrace_trace_function; |
| @@ -734,6 +726,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos) | |||
| 734 | ((iter->flags & FTRACE_ITER_FAILURES) && | 726 | ((iter->flags & FTRACE_ITER_FAILURES) && |
| 735 | !(rec->flags & FTRACE_FL_FAILED)) || | 727 | !(rec->flags & FTRACE_FL_FAILED)) || |
| 736 | 728 | ||
| 729 | ((iter->flags & FTRACE_ITER_FILTER) && | ||
| 730 | !(rec->flags & FTRACE_FL_FILTER)) || | ||
| 731 | |||
| 737 | ((iter->flags & FTRACE_ITER_NOTRACE) && | 732 | ((iter->flags & FTRACE_ITER_NOTRACE) && |
| 738 | !(rec->flags & FTRACE_FL_NOTRACE))) { | 733 | !(rec->flags & FTRACE_FL_NOTRACE))) { |
| 739 | rec = NULL; | 734 | rec = NULL; |
| @@ -1186,7 +1181,7 @@ ftrace_regex_release(struct inode *inode, struct file *file, int enable) | |||
| 1186 | 1181 | ||
| 1187 | mutex_lock(&ftrace_sysctl_lock); | 1182 | mutex_lock(&ftrace_sysctl_lock); |
| 1188 | mutex_lock(&ftrace_start_lock); | 1183 | mutex_lock(&ftrace_start_lock); |
| 1189 | if (iter->filtered && ftrace_start && ftrace_enabled) | 1184 | if (ftrace_start && ftrace_enabled) |
| 1190 | ftrace_run_update_code(FTRACE_ENABLE_CALLS); | 1185 | ftrace_run_update_code(FTRACE_ENABLE_CALLS); |
| 1191 | mutex_unlock(&ftrace_start_lock); | 1186 | mutex_unlock(&ftrace_start_lock); |
| 1192 | mutex_unlock(&ftrace_sysctl_lock); | 1187 | mutex_unlock(&ftrace_sysctl_lock); |
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 036456cbb4f7..f780e9552f91 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
| @@ -617,6 +617,7 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size) | |||
| 617 | list_del_init(&page->list); | 617 | list_del_init(&page->list); |
| 618 | free_buffer_page(page); | 618 | free_buffer_page(page); |
| 619 | } | 619 | } |
| 620 | mutex_unlock(&buffer->mutex); | ||
| 620 | return -ENOMEM; | 621 | return -ENOMEM; |
| 621 | } | 622 | } |
| 622 | 623 | ||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 697eda36b86a..d86e3252f300 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -1936,6 +1936,7 @@ __tracing_open(struct inode *inode, struct file *file, int *ret) | |||
| 1936 | ring_buffer_read_finish(iter->buffer_iter[cpu]); | 1936 | ring_buffer_read_finish(iter->buffer_iter[cpu]); |
| 1937 | } | 1937 | } |
| 1938 | mutex_unlock(&trace_types_lock); | 1938 | mutex_unlock(&trace_types_lock); |
| 1939 | kfree(iter); | ||
| 1939 | 1940 | ||
| 1940 | return ERR_PTR(-ENOMEM); | 1941 | return ERR_PTR(-ENOMEM); |
| 1941 | } | 1942 | } |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index a47f5bad110d..8997e912aaaf 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -1973,13 +1973,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
| 1973 | 1973 | ||
| 1974 | /* make sure that we don't pick a non-existing transmit queue */ | 1974 | /* make sure that we don't pick a non-existing transmit queue */ |
| 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; | 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; |
| 1976 | if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | 1976 | |
| 1977 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " | ||
| 1978 | "disabled because CPU count (%d) exceeds number " | ||
| 1979 | "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, | ||
| 1980 | pkt_dev->odev->name); | ||
| 1981 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; | ||
| 1982 | } | ||
| 1983 | if (ntxq <= pkt_dev->queue_map_min) { | 1977 | if (ntxq <= pkt_dev->queue_map_min) { |
| 1984 | printk(KERN_WARNING "pktgen: WARNING: Requested " | 1978 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
| 1985 | "queue_map_min (zero-based) (%d) exceeds valid range " | 1979 | "queue_map_min (zero-based) (%d) exceeds valid range " |
| @@ -2202,6 +2196,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev) | |||
| 2202 | } | 2196 | } |
| 2203 | pkt_dev->cur_queue_map = t; | 2197 | pkt_dev->cur_queue_map = t; |
| 2204 | } | 2198 | } |
| 2199 | pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues; | ||
| 2205 | } | 2200 | } |
| 2206 | 2201 | ||
| 2207 | /* Increment/randomize headers according to flags and current values | 2202 | /* Increment/randomize headers according to flags and current values |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1fbff5fa4241..1aa2dc9e380e 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
| @@ -1117,6 +1117,7 @@ int inet_sk_rebuild_header(struct sock *sk) | |||
| 1117 | }, | 1117 | }, |
| 1118 | }, | 1118 | }, |
| 1119 | .proto = sk->sk_protocol, | 1119 | .proto = sk->sk_protocol, |
| 1120 | .flags = inet_sk_flowi_flags(sk), | ||
| 1120 | .uli_u = { | 1121 | .uli_u = { |
| 1121 | .ports = { | 1122 | .ports = { |
| 1122 | .sport = inet->sport, | 1123 | .sport = inet->sport, |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index b42e082cc170..25924b1eb2ef 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
| @@ -1945,13 +1945,14 @@ int __init ip_mr_init(void) | |||
| 1945 | goto proc_cache_fail; | 1945 | goto proc_cache_fail; |
| 1946 | #endif | 1946 | #endif |
| 1947 | return 0; | 1947 | return 0; |
| 1948 | reg_notif_fail: | ||
| 1949 | kmem_cache_destroy(mrt_cachep); | ||
| 1950 | #ifdef CONFIG_PROC_FS | 1948 | #ifdef CONFIG_PROC_FS |
| 1951 | proc_vif_fail: | ||
| 1952 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
| 1953 | proc_cache_fail: | 1949 | proc_cache_fail: |
| 1954 | proc_net_remove(&init_net, "ip_mr_vif"); | 1950 | proc_net_remove(&init_net, "ip_mr_vif"); |
| 1951 | proc_vif_fail: | ||
| 1952 | unregister_netdevice_notifier(&ip_mr_notifier); | ||
| 1955 | #endif | 1953 | #endif |
| 1954 | reg_notif_fail: | ||
| 1955 | del_timer(&ipmr_expire_timer); | ||
| 1956 | kmem_cache_destroy(mrt_cachep); | ||
| 1956 | return err; | 1957 | return err; |
| 1957 | } | 1958 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index cf02701ced48..98c1fd09be88 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 633 | .saddr = saddr, | 633 | .saddr = saddr, |
| 634 | .tos = tos } }, | 634 | .tos = tos } }, |
| 635 | .proto = sk->sk_protocol, | 635 | .proto = sk->sk_protocol, |
| 636 | .flags = inet_sk_flowi_flags(sk), | ||
| 636 | .uli_u = { .ports = | 637 | .uli_u = { .ports = |
| 637 | { .sport = inet->sport, | 638 | { .sport = inet->sport, |
| 638 | .dport = dport } } }; | 639 | .dport = dport } } }; |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 52a7eb0e2c2c..0524769632e7 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
| @@ -224,7 +224,7 @@ static struct file_operations ip6mr_vif_fops = { | |||
| 224 | .open = ip6mr_vif_open, | 224 | .open = ip6mr_vif_open, |
| 225 | .read = seq_read, | 225 | .read = seq_read, |
| 226 | .llseek = seq_lseek, | 226 | .llseek = seq_lseek, |
| 227 | .release = seq_release, | 227 | .release = seq_release_private, |
| 228 | }; | 228 | }; |
| 229 | 229 | ||
| 230 | static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) | 230 | static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) |
| @@ -338,7 +338,7 @@ static struct file_operations ip6mr_mfc_fops = { | |||
| 338 | .open = ipmr_mfc_open, | 338 | .open = ipmr_mfc_open, |
| 339 | .read = seq_read, | 339 | .read = seq_read, |
| 340 | .llseek = seq_lseek, | 340 | .llseek = seq_lseek, |
| 341 | .release = seq_release, | 341 | .release = seq_release_private, |
| 342 | }; | 342 | }; |
| 343 | #endif | 343 | #endif |
| 344 | 344 | ||
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 07f0b76e7427..97c17fdd6f75 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
| @@ -132,7 +132,7 @@ static struct snmp_mib snmp6_udplite6_list[] = { | |||
| 132 | 132 | ||
| 133 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | 133 | static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) |
| 134 | { | 134 | { |
| 135 | static char name[32]; | 135 | char name[32]; |
| 136 | int i; | 136 | int i; |
| 137 | 137 | ||
| 138 | /* print by name -- deprecated items */ | 138 | /* print by name -- deprecated items */ |
| @@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
| 144 | p = icmp6type2name[icmptype]; | 144 | p = icmp6type2name[icmptype]; |
| 145 | if (!p) /* don't print un-named types here */ | 145 | if (!p) /* don't print un-named types here */ |
| 146 | continue; | 146 | continue; |
| 147 | (void) snprintf(name, sizeof(name)-1, "Icmp6%s%s", | 147 | snprintf(name, sizeof(name), "Icmp6%s%s", |
| 148 | i & 0x100 ? "Out" : "In", p); | 148 | i & 0x100 ? "Out" : "In", p); |
| 149 | seq_printf(seq, "%-32s\t%lu\n", name, | 149 | seq_printf(seq, "%-32s\t%lu\n", name, |
| 150 | snmp_fold_field(mib, i)); | 150 | snmp_fold_field(mib, i)); |
| @@ -157,7 +157,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
| 157 | val = snmp_fold_field(mib, i); | 157 | val = snmp_fold_field(mib, i); |
| 158 | if (!val) | 158 | if (!val) |
| 159 | continue; | 159 | continue; |
| 160 | (void) snprintf(name, sizeof(name)-1, "Icmp6%sType%u", | 160 | snprintf(name, sizeof(name), "Icmp6%sType%u", |
| 161 | i & 0x100 ? "Out" : "In", i & 0xff); | 161 | i & 0x100 ? "Out" : "In", i & 0xff); |
| 162 | seq_printf(seq, "%-32s\t%lu\n", name, val); | 162 | seq_printf(seq, "%-32s\t%lu\n", name, val); |
| 163 | } | 163 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 14d165f0df75..409bb7716236 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -2560,25 +2560,3 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local) | |||
| 2560 | ieee80211_restart_sta_timer(sdata); | 2560 | ieee80211_restart_sta_timer(sdata); |
| 2561 | rcu_read_unlock(); | 2561 | rcu_read_unlock(); |
| 2562 | } | 2562 | } |
| 2563 | |||
| 2564 | /* driver notification call */ | ||
| 2565 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | ||
| 2566 | enum ieee80211_notification_types notif_type) | ||
| 2567 | { | ||
| 2568 | struct ieee80211_local *local = hw_to_local(hw); | ||
| 2569 | struct ieee80211_sub_if_data *sdata; | ||
| 2570 | |||
| 2571 | switch (notif_type) { | ||
| 2572 | case IEEE80211_NOTIFY_RE_ASSOC: | ||
| 2573 | rtnl_lock(); | ||
| 2574 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
| 2575 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | ||
| 2576 | continue; | ||
| 2577 | |||
| 2578 | ieee80211_sta_req_auth(sdata, &sdata->u.sta); | ||
| 2579 | } | ||
| 2580 | rtnl_unlock(); | ||
| 2581 | break; | ||
| 2582 | } | ||
| 2583 | } | ||
| 2584 | EXPORT_SYMBOL(ieee80211_notify_mac); | ||
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index 7ab30f668b5a..9d211f12582b 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
| @@ -33,9 +33,30 @@ | |||
| 33 | #include <net/phonet/phonet.h> | 33 | #include <net/phonet/phonet.h> |
| 34 | #include <net/phonet/pn_dev.h> | 34 | #include <net/phonet/pn_dev.h> |
| 35 | 35 | ||
| 36 | static struct net_proto_family phonet_proto_family; | 36 | /* Transport protocol registration */ |
| 37 | static struct phonet_protocol *phonet_proto_get(int protocol); | 37 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; |
| 38 | static inline void phonet_proto_put(struct phonet_protocol *pp); | 38 | static DEFINE_SPINLOCK(proto_tab_lock); |
| 39 | |||
| 40 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
| 41 | { | ||
| 42 | struct phonet_protocol *pp; | ||
| 43 | |||
| 44 | if (protocol >= PHONET_NPROTO) | ||
| 45 | return NULL; | ||
| 46 | |||
| 47 | spin_lock(&proto_tab_lock); | ||
| 48 | pp = proto_tab[protocol]; | ||
| 49 | if (pp && !try_module_get(pp->prot->owner)) | ||
| 50 | pp = NULL; | ||
| 51 | spin_unlock(&proto_tab_lock); | ||
| 52 | |||
| 53 | return pp; | ||
| 54 | } | ||
| 55 | |||
| 56 | static inline void phonet_proto_put(struct phonet_protocol *pp) | ||
| 57 | { | ||
| 58 | module_put(pp->prot->owner); | ||
| 59 | } | ||
| 39 | 60 | ||
| 40 | /* protocol family functions */ | 61 | /* protocol family functions */ |
| 41 | 62 | ||
| @@ -375,10 +396,6 @@ static struct packet_type phonet_packet_type = { | |||
| 375 | .func = phonet_rcv, | 396 | .func = phonet_rcv, |
| 376 | }; | 397 | }; |
| 377 | 398 | ||
| 378 | /* Transport protocol registration */ | ||
| 379 | static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly; | ||
| 380 | static DEFINE_SPINLOCK(proto_tab_lock); | ||
| 381 | |||
| 382 | int __init_or_module phonet_proto_register(int protocol, | 399 | int __init_or_module phonet_proto_register(int protocol, |
| 383 | struct phonet_protocol *pp) | 400 | struct phonet_protocol *pp) |
| 384 | { | 401 | { |
| @@ -412,27 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp) | |||
| 412 | } | 429 | } |
| 413 | EXPORT_SYMBOL(phonet_proto_unregister); | 430 | EXPORT_SYMBOL(phonet_proto_unregister); |
| 414 | 431 | ||
| 415 | static struct phonet_protocol *phonet_proto_get(int protocol) | ||
| 416 | { | ||
| 417 | struct phonet_protocol *pp; | ||
| 418 | |||
| 419 | if (protocol >= PHONET_NPROTO) | ||
| 420 | return NULL; | ||
| 421 | |||
| 422 | spin_lock(&proto_tab_lock); | ||
| 423 | pp = proto_tab[protocol]; | ||
| 424 | if (pp && !try_module_get(pp->prot->owner)) | ||
| 425 | pp = NULL; | ||
| 426 | spin_unlock(&proto_tab_lock); | ||
| 427 | |||
| 428 | return pp; | ||
| 429 | } | ||
| 430 | |||
| 431 | static inline void phonet_proto_put(struct phonet_protocol *pp) | ||
| 432 | { | ||
| 433 | module_put(pp->prot->owner); | ||
| 434 | } | ||
| 435 | |||
| 436 | /* Module registration */ | 432 | /* Module registration */ |
| 437 | static int __init phonet_init(void) | 433 | static int __init phonet_init(void) |
| 438 | { | 434 | { |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b16ad2972c6b..6ab4a2f92ca0 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
| @@ -417,6 +417,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) | |||
| 417 | struct nlattr *nest; | 417 | struct nlattr *nest; |
| 418 | 418 | ||
| 419 | nest = nla_nest_start(skb, TCA_STAB); | 419 | nest = nla_nest_start(skb, TCA_STAB); |
| 420 | if (nest == NULL) | ||
| 421 | goto nla_put_failure; | ||
| 420 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); | 422 | NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); |
| 421 | nla_nest_end(skb, nest); | 423 | nla_nest_end(skb, nest); |
| 422 | 424 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 93cd30ce6501..cdcd16fcfeda 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
| @@ -270,6 +270,8 @@ static void dev_watchdog_down(struct net_device *dev) | |||
| 270 | void netif_carrier_on(struct net_device *dev) | 270 | void netif_carrier_on(struct net_device *dev) |
| 271 | { | 271 | { |
| 272 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { | 272 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { |
| 273 | if (dev->reg_state == NETREG_UNINITIALIZED) | ||
| 274 | return; | ||
| 273 | linkwatch_fire_event(dev); | 275 | linkwatch_fire_event(dev); |
| 274 | if (netif_running(dev)) | 276 | if (netif_running(dev)) |
| 275 | __netdev_watchdog_up(dev); | 277 | __netdev_watchdog_up(dev); |
| @@ -285,8 +287,11 @@ EXPORT_SYMBOL(netif_carrier_on); | |||
| 285 | */ | 287 | */ |
| 286 | void netif_carrier_off(struct net_device *dev) | 288 | void netif_carrier_off(struct net_device *dev) |
| 287 | { | 289 | { |
| 288 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) | 290 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) { |
| 291 | if (dev->reg_state == NETREG_UNINITIALIZED) | ||
| 292 | return; | ||
| 289 | linkwatch_fire_event(dev); | 293 | linkwatch_fire_event(dev); |
| 294 | } | ||
| 290 | } | 295 | } |
| 291 | EXPORT_SYMBOL(netif_carrier_off); | 296 | EXPORT_SYMBOL(netif_carrier_off); |
| 292 | 297 | ||
diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index 744b79fdcb19..4028502f0528 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c | |||
| @@ -133,13 +133,29 @@ static int | |||
| 133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) | 133 | generic_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) |
| 134 | { | 134 | { |
| 135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); | 135 | struct generic_cred *gcred = container_of(cred, struct generic_cred, gc_base); |
| 136 | int i; | ||
| 136 | 137 | ||
| 137 | if (gcred->acred.uid != acred->uid || | 138 | if (gcred->acred.uid != acred->uid || |
| 138 | gcred->acred.gid != acred->gid || | 139 | gcred->acred.gid != acred->gid || |
| 139 | gcred->acred.group_info != acred->group_info || | ||
| 140 | gcred->acred.machine_cred != acred->machine_cred) | 140 | gcred->acred.machine_cred != acred->machine_cred) |
| 141 | return 0; | 141 | goto out_nomatch; |
| 142 | |||
| 143 | /* Optimisation in the case where pointers are identical... */ | ||
| 144 | if (gcred->acred.group_info == acred->group_info) | ||
| 145 | goto out_match; | ||
| 146 | |||
| 147 | /* Slow path... */ | ||
| 148 | if (gcred->acred.group_info->ngroups != acred->group_info->ngroups) | ||
| 149 | goto out_nomatch; | ||
| 150 | for (i = 0; i < gcred->acred.group_info->ngroups; i++) { | ||
| 151 | if (GROUP_AT(gcred->acred.group_info, i) != | ||
| 152 | GROUP_AT(acred->group_info, i)) | ||
| 153 | goto out_nomatch; | ||
| 154 | } | ||
| 155 | out_match: | ||
| 142 | return 1; | 156 | return 1; |
| 157 | out_nomatch: | ||
| 158 | return 0; | ||
| 143 | } | 159 | } |
| 144 | 160 | ||
| 145 | void __init rpc_init_generic_auth(void) | 161 | void __init rpc_init_generic_auth(void) |
