Magellan Linux

Annotation of /trunk/kernel-lts/patches-3.4/0160-3.4.61-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2280 - (hide annotations) (download)
Tue Sep 10 10:50:05 2013 UTC (10 years, 9 months ago) by niro
File size: 14218 byte(s)
-linux-3.4.61
1 niro 2280 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
2     index feab3ba..b17dd69 100644
3     --- a/arch/powerpc/Kconfig
4     +++ b/arch/powerpc/Kconfig
5     @@ -979,6 +979,7 @@ config RELOCATABLE
6     must live at a different physical address than the primary
7     kernel.
8    
9     +# This value must have zeroes in the bottom 60 bits otherwise lots will break
10     config PAGE_OFFSET
11     hex
12     default "0xc000000000000000"
13     diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
14     index f072e97..2e6c4e5a 100644
15     --- a/arch/powerpc/include/asm/page.h
16     +++ b/arch/powerpc/include/asm/page.h
17     @@ -211,9 +211,19 @@ extern long long virt_phys_offset;
18     #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + VIRT_PHYS_OFFSET))
19     #define __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET)
20     #else
21     +#ifdef CONFIG_PPC64
22     +/*
23     + * gcc miscompiles (unsigned long)(&static_var) - PAGE_OFFSET
24     + * with -mcmodel=medium, so we use & and | instead of - and + on 64-bit.
25     + */
26     +#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) | PAGE_OFFSET))
27     +#define __pa(x) ((unsigned long)(x) & 0x0fffffffffffffffUL)
28     +
29     +#else /* 32-bit, non book E */
30     #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) + PAGE_OFFSET - MEMORY_START))
31     #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET + MEMORY_START)
32     #endif
33     +#endif
34    
35     /*
36     * Unfortunately the PLT is in the BSS in the PPC32 ELF ABI,
37     diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
38     index 3251d4b..d1a9674 100644
39     --- a/drivers/acpi/ec.c
40     +++ b/drivers/acpi/ec.c
41     @@ -978,6 +978,10 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
42     ec_skip_dsdt_scan, "HP Folio 13", {
43     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
44     DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13"),}, NULL},
45     + {
46     + ec_validate_ecdt, "ASUS hardware", {
47     + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTek Computer Inc."),
48     + DMI_MATCH(DMI_PRODUCT_NAME, "L4R"),}, NULL},
49     {},
50     };
51    
52     diff --git a/drivers/base/memory.c b/drivers/base/memory.c
53     index 7dda4f7..d63a06b 100644
54     --- a/drivers/base/memory.c
55     +++ b/drivers/base/memory.c
56     @@ -154,6 +154,8 @@ static ssize_t show_mem_removable(struct device *dev,
57     container_of(dev, struct memory_block, dev);
58    
59     for (i = 0; i < sections_per_block; i++) {
60     + if (!present_section_nr(mem->start_section_nr + i))
61     + continue;
62     pfn = section_nr_to_pfn(mem->start_section_nr + i);
63     ret &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
64     }
65     diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
66     index bb80853..ca72d1f 100644
67     --- a/drivers/base/regmap/regmap.c
68     +++ b/drivers/base/regmap/regmap.c
69     @@ -69,7 +69,7 @@ bool regmap_precious(struct regmap *map, unsigned int reg)
70     }
71    
72     static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
73     - unsigned int num)
74     + size_t num)
75     {
76     unsigned int i;
77    
78     diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
79     index d031932..6884d01 100644
80     --- a/drivers/gpu/drm/i915/i915_reg.h
81     +++ b/drivers/gpu/drm/i915/i915_reg.h
82     @@ -3741,7 +3741,7 @@
83     #define EDP_LINK_TRAIN_600MV_0DB_IVB (0x30 <<22)
84     #define EDP_LINK_TRAIN_600MV_3_5DB_IVB (0x36 <<22)
85     #define EDP_LINK_TRAIN_800MV_0DB_IVB (0x38 <<22)
86     -#define EDP_LINK_TRAIN_800MV_3_5DB_IVB (0x33 <<22)
87     +#define EDP_LINK_TRAIN_800MV_3_5DB_IVB (0x3e <<22)
88    
89     /* legacy values */
90     #define EDP_LINK_TRAIN_500MV_0DB_IVB (0x00 <<22)
91     diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
92     index 21ee782..e1978a2 100644
93     --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
94     +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
95     @@ -29,7 +29,9 @@
96     #include "drmP.h"
97     #include "ttm/ttm_bo_driver.h"
98    
99     -#define VMW_PPN_SIZE sizeof(unsigned long)
100     +#define VMW_PPN_SIZE (sizeof(unsigned long))
101     +/* A future safe maximum remap size. */
102     +#define VMW_PPN_PER_REMAP ((31 * 1024) / VMW_PPN_SIZE)
103    
104     static int vmw_gmr2_bind(struct vmw_private *dev_priv,
105     struct page *pages[],
106     @@ -38,43 +40,61 @@ static int vmw_gmr2_bind(struct vmw_private *dev_priv,
107     {
108     SVGAFifoCmdDefineGMR2 define_cmd;
109     SVGAFifoCmdRemapGMR2 remap_cmd;
110     - uint32_t define_size = sizeof(define_cmd) + 4;
111     - uint32_t remap_size = VMW_PPN_SIZE * num_pages + sizeof(remap_cmd) + 4;
112     uint32_t *cmd;
113     uint32_t *cmd_orig;
114     + uint32_t define_size = sizeof(define_cmd) + sizeof(*cmd);
115     + uint32_t remap_num = num_pages / VMW_PPN_PER_REMAP + ((num_pages % VMW_PPN_PER_REMAP) > 0);
116     + uint32_t remap_size = VMW_PPN_SIZE * num_pages + (sizeof(remap_cmd) + sizeof(*cmd)) * remap_num;
117     + uint32_t remap_pos = 0;
118     + uint32_t cmd_size = define_size + remap_size;
119     uint32_t i;
120    
121     - cmd_orig = cmd = vmw_fifo_reserve(dev_priv, define_size + remap_size);
122     + cmd_orig = cmd = vmw_fifo_reserve(dev_priv, cmd_size);
123     if (unlikely(cmd == NULL))
124     return -ENOMEM;
125    
126     define_cmd.gmrId = gmr_id;
127     define_cmd.numPages = num_pages;
128    
129     + *cmd++ = SVGA_CMD_DEFINE_GMR2;
130     + memcpy(cmd, &define_cmd, sizeof(define_cmd));
131     + cmd += sizeof(define_cmd) / sizeof(*cmd);
132     +
133     + /*
134     + * Need to split the command if there are too many
135     + * pages that goes into the gmr.
136     + */
137     +
138     remap_cmd.gmrId = gmr_id;
139     remap_cmd.flags = (VMW_PPN_SIZE > sizeof(*cmd)) ?
140     SVGA_REMAP_GMR2_PPN64 : SVGA_REMAP_GMR2_PPN32;
141     - remap_cmd.offsetPages = 0;
142     - remap_cmd.numPages = num_pages;
143    
144     - *cmd++ = SVGA_CMD_DEFINE_GMR2;
145     - memcpy(cmd, &define_cmd, sizeof(define_cmd));
146     - cmd += sizeof(define_cmd) / sizeof(uint32);
147     + while (num_pages > 0) {
148     + unsigned long nr = min(num_pages, (unsigned long)VMW_PPN_PER_REMAP);
149     +
150     + remap_cmd.offsetPages = remap_pos;
151     + remap_cmd.numPages = nr;
152    
153     - *cmd++ = SVGA_CMD_REMAP_GMR2;
154     - memcpy(cmd, &remap_cmd, sizeof(remap_cmd));
155     - cmd += sizeof(remap_cmd) / sizeof(uint32);
156     + *cmd++ = SVGA_CMD_REMAP_GMR2;
157     + memcpy(cmd, &remap_cmd, sizeof(remap_cmd));
158     + cmd += sizeof(remap_cmd) / sizeof(*cmd);
159    
160     - for (i = 0; i < num_pages; ++i) {
161     - if (VMW_PPN_SIZE <= 4)
162     - *cmd = page_to_pfn(*pages++);
163     - else
164     - *((uint64_t *)cmd) = page_to_pfn(*pages++);
165     + for (i = 0; i < nr; ++i) {
166     + if (VMW_PPN_SIZE <= 4)
167     + *cmd = page_to_pfn(*pages++);
168     + else
169     + *((uint64_t *)cmd) = page_to_pfn(*pages++);
170    
171     - cmd += VMW_PPN_SIZE / sizeof(*cmd);
172     + cmd += VMW_PPN_SIZE / sizeof(*cmd);
173     + }
174     +
175     + num_pages -= nr;
176     + remap_pos += nr;
177     }
178    
179     - vmw_fifo_commit(dev_priv, define_size + remap_size);
180     + BUG_ON(cmd != cmd_orig + cmd_size / sizeof(*cmd));
181     +
182     + vmw_fifo_commit(dev_priv, cmd_size);
183    
184     return 0;
185     }
186     diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
187     index 3e40a64..b290a8e 100644
188     --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
189     +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
190     @@ -448,6 +448,7 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
191     struct ieee80211_conf *cur_conf = &priv->hw->conf;
192     bool txok;
193     int slot;
194     + int hdrlen, padsize;
195    
196     slot = strip_drv_header(priv, skb);
197     if (slot < 0) {
198     @@ -504,6 +505,15 @@ send_mac80211:
199    
200     ath9k_htc_tx_clear_slot(priv, slot);
201    
202     + /* Remove padding before handing frame back to mac80211 */
203     + hdrlen = ieee80211_get_hdrlen_from_skb(skb);
204     +
205     + padsize = hdrlen & 3;
206     + if (padsize && skb->len > hdrlen + padsize) {
207     + memmove(skb->data + padsize, skb->data, hdrlen);
208     + skb_pull(skb, padsize);
209     + }
210     +
211     /* Send status to mac80211 */
212     ieee80211_tx_status(priv->hw, skb);
213     }
214     diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
215     index 409ed06..3223daa 100644
216     --- a/drivers/net/wireless/iwlegacy/4965-mac.c
217     +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
218     @@ -4415,9 +4415,9 @@ il4965_irq_tasklet(struct il_priv *il)
219     set_bit(S_RFKILL, &il->status);
220     } else {
221     clear_bit(S_RFKILL, &il->status);
222     - wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
223     il_force_reset(il, true);
224     }
225     + wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
226    
227     handled |= CSR_INT_BIT_RF_KILL;
228     }
229     diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
230     index 52a5f62..2d88ce8 100644
231     --- a/drivers/target/target_core_cdb.c
232     +++ b/drivers/target/target_core_cdb.c
233     @@ -97,9 +97,12 @@ target_emulate_inquiry_std(struct se_cmd *cmd, char *buf)
234    
235     buf[7] = 0x2; /* CmdQue=1 */
236    
237     - snprintf(&buf[8], 8, "LIO-ORG");
238     - snprintf(&buf[16], 16, "%s", dev->se_sub_dev->t10_wwn.model);
239     - snprintf(&buf[32], 4, "%s", dev->se_sub_dev->t10_wwn.revision);
240     + memcpy(&buf[8], "LIO-ORG ", 8);
241     + memset(&buf[16], 0x20, 16);
242     + memcpy(&buf[16], dev->se_sub_dev->t10_wwn.model,
243     + min_t(size_t, strlen(dev->se_sub_dev->t10_wwn.model), 16));
244     + memcpy(&buf[32], dev->se_sub_dev->t10_wwn.revision,
245     + min_t(size_t, strlen(dev->se_sub_dev->t10_wwn.revision), 4));
246     buf[4] = 31; /* Set additional length to 31 */
247    
248     return 0;
249     diff --git a/drivers/tty/hvc/hvsi_lib.c b/drivers/tty/hvc/hvsi_lib.c
250     index 6f4dd83..3749688 100644
251     --- a/drivers/tty/hvc/hvsi_lib.c
252     +++ b/drivers/tty/hvc/hvsi_lib.c
253     @@ -341,8 +341,8 @@ void hvsilib_establish(struct hvsi_priv *pv)
254    
255     pr_devel("HVSI@%x: ... waiting handshake\n", pv->termno);
256    
257     - /* Try for up to 200s */
258     - for (timeout = 0; timeout < 20; timeout++) {
259     + /* Try for up to 400ms */
260     + for (timeout = 0; timeout < 40; timeout++) {
261     if (pv->established)
262     goto established;
263     if (!hvsi_get_packet(pv))
264     diff --git a/fs/bio.c b/fs/bio.c
265     index 84da885..c0e5a4e 100644
266     --- a/fs/bio.c
267     +++ b/fs/bio.c
268     @@ -787,12 +787,22 @@ static int __bio_copy_iov(struct bio *bio, struct bio_vec *iovecs,
269     int bio_uncopy_user(struct bio *bio)
270     {
271     struct bio_map_data *bmd = bio->bi_private;
272     - int ret = 0;
273     + struct bio_vec *bvec;
274     + int ret = 0, i;
275    
276     - if (!bio_flagged(bio, BIO_NULL_MAPPED))
277     - ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs,
278     - bmd->nr_sgvecs, bio_data_dir(bio) == READ,
279     - 0, bmd->is_our_pages);
280     + if (!bio_flagged(bio, BIO_NULL_MAPPED)) {
281     + /*
282     + * if we're in a workqueue, the request is orphaned, so
283     + * don't copy into a random user address space, just free.
284     + */
285     + if (current->mm)
286     + ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs,
287     + bmd->nr_sgvecs, bio_data_dir(bio) == READ,
288     + 0, bmd->is_our_pages);
289     + else if (bmd->is_our_pages)
290     + __bio_for_each_segment(bvec, bio, i, 0)
291     + __free_page(bvec->bv_page);
292     + }
293     bio_free_map_data(bmd);
294     bio_put(bio);
295     return ret;
296     diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
297     index 9197a1b..b6f17c0 100644
298     --- a/fs/jfs/jfs_dtree.c
299     +++ b/fs/jfs/jfs_dtree.c
300     @@ -3047,6 +3047,14 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
301    
302     dir_index = (u32) filp->f_pos;
303    
304     + /*
305     + * NFSv4 reserves cookies 1 and 2 for . and .. so we add
306     + * the value we return to the vfs is one greater than the
307     + * one we use internally.
308     + */
309     + if (dir_index)
310     + dir_index--;
311     +
312     if (dir_index > 1) {
313     struct dir_table_slot dirtab_slot;
314    
315     @@ -3086,7 +3094,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
316     if (p->header.flag & BT_INTERNAL) {
317     jfs_err("jfs_readdir: bad index table");
318     DT_PUTPAGE(mp);
319     - filp->f_pos = -1;
320     + filp->f_pos = DIREND;
321     return 0;
322     }
323     } else {
324     @@ -3094,7 +3102,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
325     /*
326     * self "."
327     */
328     - filp->f_pos = 0;
329     + filp->f_pos = 1;
330     if (filldir(dirent, ".", 1, 0, ip->i_ino,
331     DT_DIR))
332     return 0;
333     @@ -3102,7 +3110,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
334     /*
335     * parent ".."
336     */
337     - filp->f_pos = 1;
338     + filp->f_pos = 2;
339     if (filldir(dirent, "..", 2, 1, PARENT(ip), DT_DIR))
340     return 0;
341    
342     @@ -3123,24 +3131,25 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
343     /*
344     * Legacy filesystem - OS/2 & Linux JFS < 0.3.6
345     *
346     - * pn = index = 0: First entry "."
347     - * pn = 0; index = 1: Second entry ".."
348     + * pn = 0; index = 1: First entry "."
349     + * pn = 0; index = 2: Second entry ".."
350     * pn > 0: Real entries, pn=1 -> leftmost page
351     * pn = index = -1: No more entries
352     */
353     dtpos = filp->f_pos;
354     - if (dtpos == 0) {
355     + if (dtpos < 2) {
356     /* build "." entry */
357    
358     + filp->f_pos = 1;
359     if (filldir(dirent, ".", 1, filp->f_pos, ip->i_ino,
360     DT_DIR))
361     return 0;
362     - dtoffset->index = 1;
363     + dtoffset->index = 2;
364     filp->f_pos = dtpos;
365     }
366    
367     if (dtoffset->pn == 0) {
368     - if (dtoffset->index == 1) {
369     + if (dtoffset->index == 2) {
370     /* build ".." entry */
371    
372     if (filldir(dirent, "..", 2, filp->f_pos,
373     @@ -3233,6 +3242,12 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
374     }
375     jfs_dirent->position = unique_pos++;
376     }
377     + /*
378     + * We add 1 to the index because we may
379     + * use a value of 2 internally, and NFSv4
380     + * doesn't like that.
381     + */
382     + jfs_dirent->position++;
383     } else {
384     jfs_dirent->position = dtpos;
385     len = min(d_namleft, DTLHDRDATALEN_LEGACY);
386     diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
387     index b97a3dd..6997cdd 100644
388     --- a/net/sunrpc/xdr.c
389     +++ b/net/sunrpc/xdr.c
390     @@ -233,10 +233,13 @@ _shift_data_right_pages(struct page **pages, size_t pgto_base,
391     pgfrom_base -= copy;
392    
393     vto = kmap_atomic(*pgto);
394     - vfrom = kmap_atomic(*pgfrom);
395     - memmove(vto + pgto_base, vfrom + pgfrom_base, copy);
396     + if (*pgto != *pgfrom) {
397     + vfrom = kmap_atomic(*pgfrom);
398     + memcpy(vto + pgto_base, vfrom + pgfrom_base, copy);
399     + kunmap_atomic(vfrom);
400     + } else
401     + memmove(vto + pgto_base, vto + pgfrom_base, copy);
402     flush_dcache_page(*pgto);
403     - kunmap_atomic(vfrom);
404     kunmap_atomic(vto);
405    
406     } while ((len -= copy) != 0);
407     diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
408     index d7ccf28..4589acd 100644
409     --- a/sound/isa/opti9xx/opti92x-ad1848.c
410     +++ b/sound/isa/opti9xx/opti92x-ad1848.c
411     @@ -173,11 +173,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_opti9xx_pnpids);
412    
413     #endif /* CONFIG_PNP */
414    
415     -#ifdef OPTi93X
416     -#define DEV_NAME "opti93x"
417     -#else
418     -#define DEV_NAME "opti92x"
419     -#endif
420     +#define DEV_NAME KBUILD_MODNAME
421    
422     static char * snd_opti9xx_names[] = {
423     "unknown",
424     @@ -1126,7 +1122,7 @@ static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard)
425    
426     static struct pnp_card_driver opti9xx_pnpc_driver = {
427     .flags = PNP_DRIVER_RES_DISABLE,
428     - .name = "opti9xx",
429     + .name = DEV_NAME,
430     .id_table = snd_opti9xx_pnpids,
431     .probe = snd_opti9xx_pnp_probe,
432     .remove = __devexit_p(snd_opti9xx_pnp_remove),