Contents of /trunk/kernel-lts/patches-3.4/0139-3.4.40-all-fixes.patch
Parent Directory | Revision Log
Revision 2199 -
(show annotations)
(download)
Thu Jun 13 10:34:56 2013 UTC (11 years, 3 months ago) by niro
File size: 27496 byte(s)
Thu Jun 13 10:34:56 2013 UTC (11 years, 3 months ago) by niro
File size: 27496 byte(s)
-linux-3.4.40
1 | diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c |
2 | index 4d4c046..1383f86 100644 |
3 | --- a/arch/alpha/kernel/sys_nautilus.c |
4 | +++ b/arch/alpha/kernel/sys_nautilus.c |
5 | @@ -188,6 +188,10 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr) |
6 | extern void free_reserved_mem(void *, void *); |
7 | extern void pcibios_claim_one_bus(struct pci_bus *); |
8 | |
9 | +static struct resource irongate_io = { |
10 | + .name = "Irongate PCI IO", |
11 | + .flags = IORESOURCE_IO, |
12 | +}; |
13 | static struct resource irongate_mem = { |
14 | .name = "Irongate PCI MEM", |
15 | .flags = IORESOURCE_MEM, |
16 | @@ -209,6 +213,7 @@ nautilus_init_pci(void) |
17 | |
18 | irongate = pci_get_bus_and_slot(0, 0); |
19 | bus->self = irongate; |
20 | + bus->resource[0] = &irongate_io; |
21 | bus->resource[1] = &irongate_mem; |
22 | |
23 | pci_bus_size_bridges(bus); |
24 | diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c |
25 | index 5f3ef87..9cfdcc9 100644 |
26 | --- a/arch/powerpc/platforms/pseries/lpar.c |
27 | +++ b/arch/powerpc/platforms/pseries/lpar.c |
28 | @@ -187,7 +187,13 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) |
29 | (0x1UL << 4), &dummy1, &dummy2); |
30 | if (lpar_rc == H_SUCCESS) |
31 | return i; |
32 | - BUG_ON(lpar_rc != H_NOT_FOUND); |
33 | + |
34 | + /* |
35 | + * The test for adjunct partition is performed before the |
36 | + * ANDCOND test. H_RESOURCE may be returned, so we need to |
37 | + * check for that as well. |
38 | + */ |
39 | + BUG_ON(lpar_rc != H_NOT_FOUND && lpar_rc != H_RESOURCE); |
40 | |
41 | slot_offset++; |
42 | slot_offset &= 0x7; |
43 | diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile |
44 | index 8a84501..5ef205c 100644 |
45 | --- a/arch/x86/boot/compressed/Makefile |
46 | +++ b/arch/x86/boot/compressed/Makefile |
47 | @@ -4,7 +4,7 @@ |
48 | # create a compressed vmlinux image from the original vmlinux |
49 | # |
50 | |
51 | -targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o |
52 | +targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo |
53 | |
54 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 |
55 | KBUILD_CFLAGS += -fno-strict-aliasing -fPIC |
56 | @@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ |
57 | $(obj)/piggy.o |
58 | |
59 | $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone |
60 | -$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone |
61 | |
62 | ifeq ($(CONFIG_EFI_STUB), y) |
63 | VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o |
64 | @@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S |
65 | $(obj)/vmlinux.bin: vmlinux FORCE |
66 | $(call if_changed,objcopy) |
67 | |
68 | -targets += vmlinux.bin.all vmlinux.relocs |
69 | +targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs |
70 | |
71 | CMD_RELOCS = arch/x86/tools/relocs |
72 | quiet_cmd_relocs = RELOCS $@ |
73 | diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h |
74 | index 386b786..1d82a11 100644 |
75 | --- a/arch/x86/include/asm/syscall.h |
76 | +++ b/arch/x86/include/asm/syscall.h |
77 | @@ -27,13 +27,13 @@ extern const unsigned long sys_call_table[]; |
78 | */ |
79 | static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) |
80 | { |
81 | - return regs->orig_ax & __SYSCALL_MASK; |
82 | + return regs->orig_ax; |
83 | } |
84 | |
85 | static inline void syscall_rollback(struct task_struct *task, |
86 | struct pt_regs *regs) |
87 | { |
88 | - regs->ax = regs->orig_ax & __SYSCALL_MASK; |
89 | + regs->ax = regs->orig_ax; |
90 | } |
91 | |
92 | static inline long syscall_get_error(struct task_struct *task, |
93 | diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c |
94 | index cf15001..262ed81 100644 |
95 | --- a/block/blk-sysfs.c |
96 | +++ b/block/blk-sysfs.c |
97 | @@ -200,6 +200,8 @@ queue_store_##name(struct request_queue *q, const char *page, size_t count) \ |
98 | unsigned long val; \ |
99 | ssize_t ret; \ |
100 | ret = queue_var_store(&val, page, count); \ |
101 | + if (ret < 0) \ |
102 | + return ret; \ |
103 | if (neg) \ |
104 | val = !val; \ |
105 | \ |
106 | diff --git a/crypto/gcm.c b/crypto/gcm.c |
107 | index 1a25263..b97b186 100644 |
108 | --- a/crypto/gcm.c |
109 | +++ b/crypto/gcm.c |
110 | @@ -44,6 +44,7 @@ struct crypto_rfc4543_ctx { |
111 | |
112 | struct crypto_rfc4543_req_ctx { |
113 | u8 auth_tag[16]; |
114 | + u8 assocbuf[32]; |
115 | struct scatterlist cipher[1]; |
116 | struct scatterlist payload[2]; |
117 | struct scatterlist assoc[2]; |
118 | @@ -1142,9 +1143,19 @@ static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req, |
119 | scatterwalk_crypto_chain(payload, dst, vdst == req->iv + 8, 2); |
120 | assoclen += 8 + req->cryptlen - (enc ? 0 : authsize); |
121 | |
122 | - sg_init_table(assoc, 2); |
123 | - sg_set_page(assoc, sg_page(req->assoc), req->assoc->length, |
124 | - req->assoc->offset); |
125 | + if (req->assoc->length == req->assoclen) { |
126 | + sg_init_table(assoc, 2); |
127 | + sg_set_page(assoc, sg_page(req->assoc), req->assoc->length, |
128 | + req->assoc->offset); |
129 | + } else { |
130 | + BUG_ON(req->assoclen > sizeof(rctx->assocbuf)); |
131 | + |
132 | + scatterwalk_map_and_copy(rctx->assocbuf, req->assoc, 0, |
133 | + req->assoclen, 0); |
134 | + |
135 | + sg_init_table(assoc, 2); |
136 | + sg_set_buf(assoc, rctx->assocbuf, req->assoclen); |
137 | + } |
138 | scatterwalk_crypto_chain(assoc, payload, 0, 2); |
139 | |
140 | aead_request_set_tfm(subreq, ctx->child); |
141 | diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c |
142 | index 47bd6ab..f67fc41 100644 |
143 | --- a/drivers/ata/ata_piix.c |
144 | +++ b/drivers/ata/ata_piix.c |
145 | @@ -150,6 +150,7 @@ enum piix_controller_ids { |
146 | tolapai_sata, |
147 | piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ |
148 | ich8_sata_snb, |
149 | + ich8_2port_sata_snb, |
150 | }; |
151 | |
152 | struct piix_map_db { |
153 | @@ -326,7 +327,7 @@ static const struct pci_device_id piix_pci_tbl[] = { |
154 | /* SATA Controller IDE (Lynx Point) */ |
155 | { 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
156 | /* SATA Controller IDE (Lynx Point) */ |
157 | - { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
158 | + { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb }, |
159 | /* SATA Controller IDE (Lynx Point) */ |
160 | { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
161 | /* SATA Controller IDE (DH89xxCC) */ |
162 | @@ -511,6 +512,7 @@ static const struct piix_map_db *piix_map_db_table[] = { |
163 | [ich8m_apple_sata] = &ich8m_apple_map_db, |
164 | [tolapai_sata] = &tolapai_map_db, |
165 | [ich8_sata_snb] = &ich8_map_db, |
166 | + [ich8_2port_sata_snb] = &ich8_2port_map_db, |
167 | }; |
168 | |
169 | static struct ata_port_info piix_port_info[] = { |
170 | @@ -652,6 +654,15 @@ static struct ata_port_info piix_port_info[] = { |
171 | .port_ops = &piix_sata_ops, |
172 | }, |
173 | |
174 | + [ich8_2port_sata_snb] = |
175 | + { |
176 | + .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR |
177 | + | PIIX_FLAG_PIO16, |
178 | + .pio_mask = ATA_PIO4, |
179 | + .mwdma_mask = ATA_MWDMA2, |
180 | + .udma_mask = ATA_UDMA6, |
181 | + .port_ops = &piix_sata_ops, |
182 | + }, |
183 | }; |
184 | |
185 | static struct pci_bits piix_enable_bits[] = { |
186 | diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c |
187 | index 4b4caa3..02dd34c 100644 |
188 | --- a/drivers/ata/libata-core.c |
189 | +++ b/drivers/ata/libata-core.c |
190 | @@ -2408,6 +2408,9 @@ int ata_dev_configure(struct ata_device *dev) |
191 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, |
192 | dev->max_sectors); |
193 | |
194 | + if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48) |
195 | + dev->max_sectors = ATA_MAX_SECTORS_LBA48; |
196 | + |
197 | if (ap->ops->dev_config) |
198 | ap->ops->dev_config(dev); |
199 | |
200 | @@ -4064,6 +4067,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { |
201 | /* Weird ATAPI devices */ |
202 | { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, |
203 | { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, |
204 | + { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, |
205 | |
206 | /* Devices we expect to fail diagnostics */ |
207 | |
208 | diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c |
209 | index 92b779e..17aa318 100644 |
210 | --- a/drivers/base/regmap/regcache-rbtree.c |
211 | +++ b/drivers/base/regmap/regcache-rbtree.c |
212 | @@ -392,7 +392,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min, |
213 | base = 0; |
214 | |
215 | if (max < rbnode->base_reg + rbnode->blklen) |
216 | - end = rbnode->base_reg + rbnode->blklen - max; |
217 | + end = max - rbnode->base_reg + 1; |
218 | else |
219 | end = rbnode->blklen; |
220 | |
221 | diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c |
222 | index cdae207..6c3fca9 100644 |
223 | --- a/drivers/eisa/pci_eisa.c |
224 | +++ b/drivers/eisa/pci_eisa.c |
225 | @@ -19,10 +19,10 @@ |
226 | /* There is only *one* pci_eisa device per machine, right ? */ |
227 | static struct eisa_root_device pci_eisa_root; |
228 | |
229 | -static int __init pci_eisa_init(struct pci_dev *pdev, |
230 | - const struct pci_device_id *ent) |
231 | +static int __init pci_eisa_init(struct pci_dev *pdev) |
232 | { |
233 | - int rc; |
234 | + int rc, i; |
235 | + struct resource *res, *bus_res = NULL; |
236 | |
237 | if ((rc = pci_enable_device (pdev))) { |
238 | printk (KERN_ERR "pci_eisa : Could not enable device %s\n", |
239 | @@ -30,9 +30,30 @@ static int __init pci_eisa_init(struct pci_dev *pdev, |
240 | return rc; |
241 | } |
242 | |
243 | + /* |
244 | + * The Intel 82375 PCI-EISA bridge is a subtractive-decode PCI |
245 | + * device, so the resources available on EISA are the same as those |
246 | + * available on the 82375 bus. This works the same as a PCI-PCI |
247 | + * bridge in subtractive-decode mode (see pci_read_bridge_bases()). |
248 | + * We assume other PCI-EISA bridges are similar. |
249 | + * |
250 | + * eisa_root_register() can only deal with a single io port resource, |
251 | + * so we use the first valid io port resource. |
252 | + */ |
253 | + pci_bus_for_each_resource(pdev->bus, res, i) |
254 | + if (res && (res->flags & IORESOURCE_IO)) { |
255 | + bus_res = res; |
256 | + break; |
257 | + } |
258 | + |
259 | + if (!bus_res) { |
260 | + dev_err(&pdev->dev, "No resources available\n"); |
261 | + return -1; |
262 | + } |
263 | + |
264 | pci_eisa_root.dev = &pdev->dev; |
265 | - pci_eisa_root.res = pdev->bus->resource[0]; |
266 | - pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; |
267 | + pci_eisa_root.res = bus_res; |
268 | + pci_eisa_root.bus_base_addr = bus_res->start; |
269 | pci_eisa_root.slots = EISA_MAX_SLOTS; |
270 | pci_eisa_root.dma_mask = pdev->dma_mask; |
271 | dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); |
272 | @@ -45,22 +66,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev, |
273 | return 0; |
274 | } |
275 | |
276 | -static struct pci_device_id pci_eisa_pci_tbl[] = { |
277 | - { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
278 | - PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, |
279 | - { 0, } |
280 | -}; |
281 | +/* |
282 | + * We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init(). |
283 | + * Otherwise pnp resource will get enabled early and could prevent eisa |
284 | + * to be initialized. |
285 | + * Also need to make sure pci_eisa_init_early() is called after |
286 | + * x86/pci_subsys_init(). |
287 | + * So need to use subsys_initcall_sync with it. |
288 | + */ |
289 | +static int __init pci_eisa_init_early(void) |
290 | +{ |
291 | + struct pci_dev *dev = NULL; |
292 | + int ret; |
293 | |
294 | -static struct pci_driver __refdata pci_eisa_driver = { |
295 | - .name = "pci_eisa", |
296 | - .id_table = pci_eisa_pci_tbl, |
297 | - .probe = pci_eisa_init, |
298 | -}; |
299 | + for_each_pci_dev(dev) |
300 | + if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) { |
301 | + ret = pci_eisa_init(dev); |
302 | + if (ret) |
303 | + return ret; |
304 | + } |
305 | |
306 | -static int __init pci_eisa_init_module (void) |
307 | -{ |
308 | - return pci_register_driver (&pci_eisa_driver); |
309 | + return 0; |
310 | } |
311 | - |
312 | -device_initcall(pci_eisa_init_module); |
313 | -MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl); |
314 | +subsys_initcall_sync(pci_eisa_init_early); |
315 | diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c |
316 | index 1201a15..08e7e72 100644 |
317 | --- a/drivers/hwspinlock/hwspinlock_core.c |
318 | +++ b/drivers/hwspinlock/hwspinlock_core.c |
319 | @@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) |
320 | ret = pm_runtime_get_sync(dev); |
321 | if (ret < 0) { |
322 | dev_err(dev, "%s: can't power on device\n", __func__); |
323 | + pm_runtime_put_noidle(dev); |
324 | + module_put(dev->driver->owner); |
325 | return ret; |
326 | } |
327 | |
328 | diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c |
329 | index f9d9aed..54bb483 100644 |
330 | --- a/drivers/net/wireless/mwifiex/init.c |
331 | +++ b/drivers/net/wireless/mwifiex/init.c |
332 | @@ -584,14 +584,6 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) |
333 | return ret; |
334 | } |
335 | |
336 | - /* cancel current command */ |
337 | - if (adapter->curr_cmd) { |
338 | - dev_warn(adapter->dev, "curr_cmd is still in processing\n"); |
339 | - del_timer(&adapter->cmd_timer); |
340 | - mwifiex_insert_cmd_to_free_q(adapter, adapter->curr_cmd); |
341 | - adapter->curr_cmd = NULL; |
342 | - } |
343 | - |
344 | /* shut down mwifiex */ |
345 | dev_dbg(adapter->dev, "info: shutdown mwifiex...\n"); |
346 | |
347 | diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c |
348 | index 17148bb..10fe07d 100644 |
349 | --- a/drivers/net/wireless/rt2x00/rt2x00pci.c |
350 | +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c |
351 | @@ -52,8 +52,8 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, |
352 | udelay(REGISTER_BUSY_DELAY); |
353 | } |
354 | |
355 | - ERROR(rt2x00dev, "Indirect register access failed: " |
356 | - "offset=0x%.08x, value=0x%.08x\n", offset, *reg); |
357 | + printk_once(KERN_ERR "%s() Indirect register access failed: " |
358 | + "offset=0x%.08x, value=0x%.08x\n", __func__, offset, *reg); |
359 | *reg = ~0; |
360 | |
361 | return 0; |
362 | diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c |
363 | index 4c63f77..2e2b04f 100644 |
364 | --- a/drivers/spi/spi-mpc512x-psc.c |
365 | +++ b/drivers/spi/spi-mpc512x-psc.c |
366 | @@ -164,7 +164,7 @@ static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi, |
367 | |
368 | for (i = count; i > 0; i--) { |
369 | data = tx_buf ? *tx_buf++ : 0; |
370 | - if (len == EOFBYTE) |
371 | + if (len == EOFBYTE && t->cs_change) |
372 | setbits32(&fifo->txcmd, MPC512x_PSC_FIFO_EOF); |
373 | out_8(&fifo->txdata_8, data); |
374 | len--; |
375 | diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c |
376 | index 972a94c..486e864 100644 |
377 | --- a/drivers/spi/spi-s3c64xx.c |
378 | +++ b/drivers/spi/spi-s3c64xx.c |
379 | @@ -889,25 +889,30 @@ static irqreturn_t s3c64xx_spi_irq(int irq, void *data) |
380 | { |
381 | struct s3c64xx_spi_driver_data *sdd = data; |
382 | struct spi_master *spi = sdd->master; |
383 | - unsigned int val; |
384 | + unsigned int val, clr = 0; |
385 | |
386 | - val = readl(sdd->regs + S3C64XX_SPI_PENDING_CLR); |
387 | + val = readl(sdd->regs + S3C64XX_SPI_STATUS); |
388 | |
389 | - val &= S3C64XX_SPI_PND_RX_OVERRUN_CLR | |
390 | - S3C64XX_SPI_PND_RX_UNDERRUN_CLR | |
391 | - S3C64XX_SPI_PND_TX_OVERRUN_CLR | |
392 | - S3C64XX_SPI_PND_TX_UNDERRUN_CLR; |
393 | - |
394 | - writel(val, sdd->regs + S3C64XX_SPI_PENDING_CLR); |
395 | - |
396 | - if (val & S3C64XX_SPI_PND_RX_OVERRUN_CLR) |
397 | + if (val & S3C64XX_SPI_ST_RX_OVERRUN_ERR) { |
398 | + clr = S3C64XX_SPI_PND_RX_OVERRUN_CLR; |
399 | dev_err(&spi->dev, "RX overrun\n"); |
400 | - if (val & S3C64XX_SPI_PND_RX_UNDERRUN_CLR) |
401 | + } |
402 | + if (val & S3C64XX_SPI_ST_RX_UNDERRUN_ERR) { |
403 | + clr |= S3C64XX_SPI_PND_RX_UNDERRUN_CLR; |
404 | dev_err(&spi->dev, "RX underrun\n"); |
405 | - if (val & S3C64XX_SPI_PND_TX_OVERRUN_CLR) |
406 | + } |
407 | + if (val & S3C64XX_SPI_ST_TX_OVERRUN_ERR) { |
408 | + clr |= S3C64XX_SPI_PND_TX_OVERRUN_CLR; |
409 | dev_err(&spi->dev, "TX overrun\n"); |
410 | - if (val & S3C64XX_SPI_PND_TX_UNDERRUN_CLR) |
411 | + } |
412 | + if (val & S3C64XX_SPI_ST_TX_UNDERRUN_ERR) { |
413 | + clr |= S3C64XX_SPI_PND_TX_UNDERRUN_CLR; |
414 | dev_err(&spi->dev, "TX underrun\n"); |
415 | + } |
416 | + |
417 | + /* Clear the pending irq by setting and then clearing it */ |
418 | + writel(clr, sdd->regs + S3C64XX_SPI_PENDING_CLR); |
419 | + writel(0, sdd->regs + S3C64XX_SPI_PENDING_CLR); |
420 | |
421 | return IRQ_HANDLED; |
422 | } |
423 | @@ -931,9 +936,13 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel) |
424 | writel(0, regs + S3C64XX_SPI_MODE_CFG); |
425 | writel(0, regs + S3C64XX_SPI_PACKET_CNT); |
426 | |
427 | - /* Clear any irq pending bits */ |
428 | - writel(readl(regs + S3C64XX_SPI_PENDING_CLR), |
429 | - regs + S3C64XX_SPI_PENDING_CLR); |
430 | + /* Clear any irq pending bits, should set and clear the bits */ |
431 | + val = S3C64XX_SPI_PND_RX_OVERRUN_CLR | |
432 | + S3C64XX_SPI_PND_RX_UNDERRUN_CLR | |
433 | + S3C64XX_SPI_PND_TX_OVERRUN_CLR | |
434 | + S3C64XX_SPI_PND_TX_UNDERRUN_CLR; |
435 | + writel(val, regs + S3C64XX_SPI_PENDING_CLR); |
436 | + writel(0, regs + S3C64XX_SPI_PENDING_CLR); |
437 | |
438 | writel(0, regs + S3C64XX_SPI_SWAP_CFG); |
439 | |
440 | diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c |
441 | index 022bacb..5c26dda 100644 |
442 | --- a/drivers/thermal/thermal_sys.c |
443 | +++ b/drivers/thermal/thermal_sys.c |
444 | @@ -1383,6 +1383,7 @@ static int __init thermal_init(void) |
445 | idr_destroy(&thermal_cdev_idr); |
446 | mutex_destroy(&thermal_idr_lock); |
447 | mutex_destroy(&thermal_list_lock); |
448 | + return result; |
449 | } |
450 | result = genetlink_init(); |
451 | return result; |
452 | diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c |
453 | index 46fc1c2..048d990 100644 |
454 | --- a/fs/reiserfs/xattr.c |
455 | +++ b/fs/reiserfs/xattr.c |
456 | @@ -187,8 +187,8 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset, |
457 | if (dbuf->count == ARRAY_SIZE(dbuf->dentries)) |
458 | return -ENOSPC; |
459 | |
460 | - if (name[0] == '.' && (name[1] == '\0' || |
461 | - (name[1] == '.' && name[2] == '\0'))) |
462 | + if (name[0] == '.' && (namelen < 2 || |
463 | + (namelen == 2 && name[1] == '.'))) |
464 | return 0; |
465 | |
466 | dentry = lookup_one_len(name, dbuf->xadir, namelen); |
467 | diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c |
468 | index 76e4e05..d867bd9 100644 |
469 | --- a/fs/ubifs/super.c |
470 | +++ b/fs/ubifs/super.c |
471 | @@ -1582,6 +1582,12 @@ static int ubifs_remount_rw(struct ubifs_info *c) |
472 | c->remounting_rw = 1; |
473 | c->ro_mount = 0; |
474 | |
475 | + if (c->space_fixup) { |
476 | + err = ubifs_fixup_free_space(c); |
477 | + if (err) |
478 | + return err; |
479 | + } |
480 | + |
481 | err = check_free_space(c); |
482 | if (err) |
483 | goto out; |
484 | @@ -1698,12 +1704,6 @@ static int ubifs_remount_rw(struct ubifs_info *c) |
485 | err = dbg_check_space_info(c); |
486 | } |
487 | |
488 | - if (c->space_fixup) { |
489 | - err = ubifs_fixup_free_space(c); |
490 | - if (err) |
491 | - goto out; |
492 | - } |
493 | - |
494 | mutex_unlock(&c->umount_mutex); |
495 | return err; |
496 | |
497 | diff --git a/include/linux/ata.h b/include/linux/ata.h |
498 | index 32df2b6..5856c9e 100644 |
499 | --- a/include/linux/ata.h |
500 | +++ b/include/linux/ata.h |
501 | @@ -937,7 +937,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) |
502 | } |
503 | } |
504 | |
505 | -static inline bool atapi_command_packet_set(const u16 *dev_id) |
506 | +static inline int atapi_command_packet_set(const u16 *dev_id) |
507 | { |
508 | return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; |
509 | } |
510 | diff --git a/include/linux/libata.h b/include/linux/libata.h |
511 | index 6e887c7..7e13eb4 100644 |
512 | --- a/include/linux/libata.h |
513 | +++ b/include/linux/libata.h |
514 | @@ -393,6 +393,7 @@ enum { |
515 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ |
516 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ |
517 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
518 | + ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ |
519 | |
520 | /* DMA mask for user DMA control: User visible values; DO NOT |
521 | renumber */ |
522 | diff --git a/include/linux/preempt.h b/include/linux/preempt.h |
523 | index 5a710b9..87a03c7 100644 |
524 | --- a/include/linux/preempt.h |
525 | +++ b/include/linux/preempt.h |
526 | @@ -93,14 +93,20 @@ do { \ |
527 | |
528 | #else /* !CONFIG_PREEMPT_COUNT */ |
529 | |
530 | -#define preempt_disable() do { } while (0) |
531 | -#define sched_preempt_enable_no_resched() do { } while (0) |
532 | -#define preempt_enable_no_resched() do { } while (0) |
533 | -#define preempt_enable() do { } while (0) |
534 | - |
535 | -#define preempt_disable_notrace() do { } while (0) |
536 | -#define preempt_enable_no_resched_notrace() do { } while (0) |
537 | -#define preempt_enable_notrace() do { } while (0) |
538 | +/* |
539 | + * Even if we don't have any preemption, we need preempt disable/enable |
540 | + * to be barriers, so that we don't have things like get_user/put_user |
541 | + * that can cause faults and scheduling migrate into our preempt-protected |
542 | + * region. |
543 | + */ |
544 | +#define preempt_disable() barrier() |
545 | +#define sched_preempt_enable_no_resched() barrier() |
546 | +#define preempt_enable_no_resched() barrier() |
547 | +#define preempt_enable() barrier() |
548 | + |
549 | +#define preempt_disable_notrace() barrier() |
550 | +#define preempt_enable_no_resched_notrace() barrier() |
551 | +#define preempt_enable_notrace() barrier() |
552 | |
553 | #endif /* CONFIG_PREEMPT_COUNT */ |
554 | |
555 | diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h |
556 | index a26e2fb..e2369c1 100644 |
557 | --- a/include/linux/spinlock_up.h |
558 | +++ b/include/linux/spinlock_up.h |
559 | @@ -16,7 +16,10 @@ |
560 | * In the debug case, 1 means unlocked, 0 means locked. (the values |
561 | * are inverted, to catch initialization bugs) |
562 | * |
563 | - * No atomicity anywhere, we are on UP. |
564 | + * No atomicity anywhere, we are on UP. However, we still need |
565 | + * the compiler barriers, because we do not want the compiler to |
566 | + * move potentially faulting instructions (notably user accesses) |
567 | + * into the locked sequence, resulting in non-atomic execution. |
568 | */ |
569 | |
570 | #ifdef CONFIG_DEBUG_SPINLOCK |
571 | @@ -25,6 +28,7 @@ |
572 | static inline void arch_spin_lock(arch_spinlock_t *lock) |
573 | { |
574 | lock->slock = 0; |
575 | + barrier(); |
576 | } |
577 | |
578 | static inline void |
579 | @@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) |
580 | { |
581 | local_irq_save(flags); |
582 | lock->slock = 0; |
583 | + barrier(); |
584 | } |
585 | |
586 | static inline int arch_spin_trylock(arch_spinlock_t *lock) |
587 | @@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) |
588 | char oldval = lock->slock; |
589 | |
590 | lock->slock = 0; |
591 | + barrier(); |
592 | |
593 | return oldval > 0; |
594 | } |
595 | |
596 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
597 | { |
598 | + barrier(); |
599 | lock->slock = 1; |
600 | } |
601 | |
602 | /* |
603 | * Read-write spinlocks. No debug version. |
604 | */ |
605 | -#define arch_read_lock(lock) do { (void)(lock); } while (0) |
606 | -#define arch_write_lock(lock) do { (void)(lock); } while (0) |
607 | -#define arch_read_trylock(lock) ({ (void)(lock); 1; }) |
608 | -#define arch_write_trylock(lock) ({ (void)(lock); 1; }) |
609 | -#define arch_read_unlock(lock) do { (void)(lock); } while (0) |
610 | -#define arch_write_unlock(lock) do { (void)(lock); } while (0) |
611 | +#define arch_read_lock(lock) do { barrier(); (void)(lock); } while (0) |
612 | +#define arch_write_lock(lock) do { barrier(); (void)(lock); } while (0) |
613 | +#define arch_read_trylock(lock) ({ barrier(); (void)(lock); 1; }) |
614 | +#define arch_write_trylock(lock) ({ barrier(); (void)(lock); 1; }) |
615 | +#define arch_read_unlock(lock) do { barrier(); (void)(lock); } while (0) |
616 | +#define arch_write_unlock(lock) do { barrier(); (void)(lock); } while (0) |
617 | |
618 | #else /* DEBUG_SPINLOCK */ |
619 | #define arch_spin_is_locked(lock) ((void)(lock), 0) |
620 | /* for sched.c and kernel_lock.c: */ |
621 | -# define arch_spin_lock(lock) do { (void)(lock); } while (0) |
622 | -# define arch_spin_lock_flags(lock, flags) do { (void)(lock); } while (0) |
623 | -# define arch_spin_unlock(lock) do { (void)(lock); } while (0) |
624 | -# define arch_spin_trylock(lock) ({ (void)(lock); 1; }) |
625 | +# define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) |
626 | +# define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0) |
627 | +# define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0) |
628 | +# define arch_spin_trylock(lock) ({ barrier(); (void)(lock); 1; }) |
629 | #endif /* DEBUG_SPINLOCK */ |
630 | |
631 | #define arch_spin_is_contended(lock) (((void)(lock), 0)) |
632 | diff --git a/kernel/panic.c b/kernel/panic.c |
633 | index 9ed023b..10b7685 100644 |
634 | --- a/kernel/panic.c |
635 | +++ b/kernel/panic.c |
636 | @@ -75,6 +75,14 @@ void panic(const char *fmt, ...) |
637 | int state = 0; |
638 | |
639 | /* |
640 | + * Disable local interrupts. This will prevent panic_smp_self_stop |
641 | + * from deadlocking the first cpu that invokes the panic, since |
642 | + * there is nothing to prevent an interrupt handler (that runs |
643 | + * after the panic_lock is acquired) from invoking panic again. |
644 | + */ |
645 | + local_irq_disable(); |
646 | + |
647 | + /* |
648 | * It's possible to come here directly from a panic-assertion and |
649 | * not have preempt disabled. Some functions called from here want |
650 | * preempt to be disabled. No point enabling it later though... |
651 | diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c |
652 | index 62f3751..e539dfa 100644 |
653 | --- a/kernel/trace/ftrace.c |
654 | +++ b/kernel/trace/ftrace.c |
655 | @@ -4381,12 +4381,8 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, |
656 | ftrace_startup_sysctl(); |
657 | |
658 | /* we are starting ftrace again */ |
659 | - if (ftrace_ops_list != &ftrace_list_end) { |
660 | - if (ftrace_ops_list->next == &ftrace_list_end) |
661 | - ftrace_trace_function = ftrace_ops_list->func; |
662 | - else |
663 | - ftrace_trace_function = ftrace_ops_list_func; |
664 | - } |
665 | + if (ftrace_ops_list != &ftrace_list_end) |
666 | + update_ftrace_function(); |
667 | |
668 | } else { |
669 | /* stopping ftrace calls (just send to ftrace_stub) */ |
670 | diff --git a/mm/mmap.c b/mm/mmap.c |
671 | index 848ef52..2add0a1 100644 |
672 | --- a/mm/mmap.c |
673 | +++ b/mm/mmap.c |
674 | @@ -1619,7 +1619,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) |
675 | if (mm) { |
676 | /* Check the cache first. */ |
677 | /* (Cache hit rate is typically around 35%.) */ |
678 | - vma = mm->mmap_cache; |
679 | + vma = ACCESS_ONCE(mm->mmap_cache); |
680 | if (!(vma && vma->vm_end > addr && vma->vm_start <= addr)) { |
681 | struct rb_node * rb_node; |
682 | |
683 | diff --git a/mm/nommu.c b/mm/nommu.c |
684 | index bb8f4f0..b0956e3 100644 |
685 | --- a/mm/nommu.c |
686 | +++ b/mm/nommu.c |
687 | @@ -807,7 +807,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) |
688 | struct vm_area_struct *vma; |
689 | |
690 | /* check the cache first */ |
691 | - vma = mm->mmap_cache; |
692 | + vma = ACCESS_ONCE(mm->mmap_cache); |
693 | if (vma && vma->vm_start <= addr && vma->vm_end > addr) |
694 | return vma; |
695 | |
696 | diff --git a/net/can/gw.c b/net/can/gw.c |
697 | index 3d79b12..f78f898 100644 |
698 | --- a/net/can/gw.c |
699 | +++ b/net/can/gw.c |
700 | @@ -436,7 +436,7 @@ static int cgw_notifier(struct notifier_block *nb, |
701 | if (gwj->src.dev == dev || gwj->dst.dev == dev) { |
702 | hlist_del(&gwj->list); |
703 | cgw_unregister_filter(gwj); |
704 | - kfree(gwj); |
705 | + kmem_cache_free(cgw_cache, gwj); |
706 | } |
707 | } |
708 | } |
709 | @@ -850,7 +850,7 @@ static void cgw_remove_all_jobs(void) |
710 | hlist_for_each_entry_safe(gwj, n, nx, &cgw_list, list) { |
711 | hlist_del(&gwj->list); |
712 | cgw_unregister_filter(gwj); |
713 | - kfree(gwj); |
714 | + kmem_cache_free(cgw_cache, gwj); |
715 | } |
716 | } |
717 | |
718 | @@ -903,7 +903,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) |
719 | |
720 | hlist_del(&gwj->list); |
721 | cgw_unregister_filter(gwj); |
722 | - kfree(gwj); |
723 | + kmem_cache_free(cgw_cache, gwj); |
724 | err = 0; |
725 | break; |
726 | } |
727 | diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c |
728 | index 28e070a..c72dce0 100644 |
729 | --- a/sound/pci/hda/hda_codec.c |
730 | +++ b/sound/pci/hda/hda_codec.c |
731 | @@ -165,7 +165,7 @@ const char *snd_hda_get_jack_type(u32 cfg) |
732 | "Line Out", "Speaker", "HP Out", "CD", |
733 | "SPDIF Out", "Digital Out", "Modem Line", "Modem Hand", |
734 | "Line In", "Aux", "Mic", "Telephony", |
735 | - "SPDIF In", "Digitial In", "Reserved", "Other" |
736 | + "SPDIF In", "Digital In", "Reserved", "Other" |
737 | }; |
738 | |
739 | return jack_types[(cfg & AC_DEFCFG_DEVICE) |
740 | diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c |
741 | index 4c054f4..86f6468 100644 |
742 | --- a/sound/pci/hda/hda_eld.c |
743 | +++ b/sound/pci/hda/hda_eld.c |
744 | @@ -322,7 +322,7 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld, |
745 | struct hda_codec *codec, hda_nid_t nid) |
746 | { |
747 | int i; |
748 | - int ret; |
749 | + int ret = 0; |
750 | int size; |
751 | unsigned char *buf; |
752 | |
753 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
754 | index adb97d6..353b32a 100644 |
755 | --- a/sound/pci/hda/patch_realtek.c |
756 | +++ b/sound/pci/hda/patch_realtek.c |
757 | @@ -6629,7 +6629,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec) |
758 | const hda_nid_t *ssids; |
759 | |
760 | if (codec->vendor_id == 0x10ec0272 || codec->vendor_id == 0x10ec0663 || |
761 | - codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670) |
762 | + codec->vendor_id == 0x10ec0665 || codec->vendor_id == 0x10ec0670 || |
763 | + codec->vendor_id == 0x10ec0671) |
764 | ssids = alc663_ssids; |
765 | else |
766 | ssids = alc662_ssids; |
767 | @@ -7056,6 +7057,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = { |
768 | { .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 }, |
769 | { .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 }, |
770 | { .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 }, |
771 | + { .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 }, |
772 | { .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 }, |
773 | { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 }, |
774 | { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 }, |
775 | diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c |
776 | index 7da2018..312715f 100644 |
777 | --- a/sound/soc/sh/dma-sh7760.c |
778 | +++ b/sound/soc/sh/dma-sh7760.c |
779 | @@ -342,8 +342,8 @@ static int camelot_pcm_new(struct snd_soc_pcm_runtime *rtd) |
780 | return 0; |
781 | } |
782 | |
783 | -static struct snd_soc_platform sh7760_soc_platform = { |
784 | - .pcm_ops = &camelot_pcm_ops, |
785 | +static struct snd_soc_platform_driver sh7760_soc_platform = { |
786 | + .ops = &camelot_pcm_ops, |
787 | .pcm_new = camelot_pcm_new, |
788 | .pcm_free = camelot_pcm_free, |
789 | }; |