/[linux-patches]/genpatches-2.6/trunk/3.4/1023_linux-3.4.24.patch
Gentoo

Contents of /genpatches-2.6/trunk/3.4/1023_linux-3.4.24.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2254 - (hide annotations) (download)
Wed Dec 19 19:51:16 2012 UTC (5 years, 10 months ago) by mpagano
File size: 39338 byte(s)
Linux patches 3.4.12 through and including 3.4.24
1 mpagano 2254 diff --git a/Makefile b/Makefile
2     index bf1df55..a3e12e6 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 3
7     PATCHLEVEL = 4
8     -SUBLEVEL = 23
9     +SUBLEVEL = 24
10     EXTRAVERSION =
11     NAME = Saber-toothed Squirrel
12    
13     diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
14     index 9176261..a2fe893 100644
15     --- a/arch/arm/include/asm/hwcap.h
16     +++ b/arch/arm/include/asm/hwcap.h
17     @@ -18,11 +18,12 @@
18     #define HWCAP_THUMBEE (1 << 11)
19     #define HWCAP_NEON (1 << 12)
20     #define HWCAP_VFPv3 (1 << 13)
21     -#define HWCAP_VFPv3D16 (1 << 14)
22     +#define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */
23     #define HWCAP_TLS (1 << 15)
24     #define HWCAP_VFPv4 (1 << 16)
25     #define HWCAP_IDIVA (1 << 17)
26     #define HWCAP_IDIVT (1 << 18)
27     +#define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */
28     #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
29    
30     #if defined(__KERNEL__)
31     diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
32     index bf53047..c49c8f7 100644
33     --- a/arch/arm/include/asm/vfpmacros.h
34     +++ b/arch/arm/include/asm/vfpmacros.h
35     @@ -27,9 +27,9 @@
36     #if __LINUX_ARM_ARCH__ <= 6
37     ldr \tmp, =elf_hwcap @ may not have MVFR regs
38     ldr \tmp, [\tmp, #0]
39     - tst \tmp, #HWCAP_VFPv3D16
40     - ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
41     - addne \base, \base, #32*4 @ step over unused register space
42     + tst \tmp, #HWCAP_VFPD32
43     + ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
44     + addeq \base, \base, #32*4 @ step over unused register space
45     #else
46     VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
47     and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
48     @@ -51,9 +51,9 @@
49     #if __LINUX_ARM_ARCH__ <= 6
50     ldr \tmp, =elf_hwcap @ may not have MVFR regs
51     ldr \tmp, [\tmp, #0]
52     - tst \tmp, #HWCAP_VFPv3D16
53     - stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
54     - addne \base, \base, #32*4 @ step over unused register space
55     + tst \tmp, #HWCAP_VFPD32
56     + stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
57     + addeq \base, \base, #32*4 @ step over unused register space
58     #else
59     VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
60     and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
61     diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
62     index 1f8241d..3b36062 100644
63     --- a/arch/arm/vfp/vfpmodule.c
64     +++ b/arch/arm/vfp/vfpmodule.c
65     @@ -701,11 +701,14 @@ static int __init vfp_init(void)
66     elf_hwcap |= HWCAP_VFPv3;
67    
68     /*
69     - * Check for VFPv3 D16. CPUs in this configuration
70     - * only have 16 x 64bit registers.
71     + * Check for VFPv3 D16 and VFPv4 D16. CPUs in
72     + * this configuration only have 16 x 64bit
73     + * registers.
74     */
75     if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1)
76     - elf_hwcap |= HWCAP_VFPv3D16;
77     + elf_hwcap |= HWCAP_VFPv3D16; /* also v4-D16 */
78     + else
79     + elf_hwcap |= HWCAP_VFPD32;
80     }
81     #endif
82     /*
83     diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
84     index ad0de0c..2861b4c 100644
85     --- a/arch/x86/kernel/hpet.c
86     +++ b/arch/x86/kernel/hpet.c
87     @@ -431,7 +431,7 @@ void hpet_msi_unmask(struct irq_data *data)
88    
89     /* unmask it */
90     cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
91     - cfg |= HPET_TN_FSB;
92     + cfg |= HPET_TN_ENABLE | HPET_TN_FSB;
93     hpet_writel(cfg, HPET_Tn_CFG(hdev->num));
94     }
95    
96     @@ -442,7 +442,7 @@ void hpet_msi_mask(struct irq_data *data)
97    
98     /* mask it */
99     cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
100     - cfg &= ~HPET_TN_FSB;
101     + cfg &= ~(HPET_TN_ENABLE | HPET_TN_FSB);
102     hpet_writel(cfg, HPET_Tn_CFG(hdev->num));
103     }
104    
105     diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
106     index 7dd3f9f..6ea287e2 100644
107     --- a/drivers/acpi/battery.c
108     +++ b/drivers/acpi/battery.c
109     @@ -34,6 +34,7 @@
110     #include <linux/dmi.h>
111     #include <linux/slab.h>
112     #include <linux/suspend.h>
113     +#include <asm/unaligned.h>
114    
115     #ifdef CONFIG_ACPI_PROCFS_POWER
116     #include <linux/proc_fs.h>
117     @@ -95,6 +96,18 @@ enum {
118     ACPI_BATTERY_ALARM_PRESENT,
119     ACPI_BATTERY_XINFO_PRESENT,
120     ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY,
121     + /* On Lenovo Thinkpad models from 2010 and 2011, the power unit
122     + switches between mWh and mAh depending on whether the system
123     + is running on battery or not. When mAh is the unit, most
124     + reported values are incorrect and need to be adjusted by
125     + 10000/design_voltage. Verified on x201, t410, t410s, and x220.
126     + Pre-2010 and 2012 models appear to always report in mWh and
127     + are thus unaffected (tested with t42, t61, t500, x200, x300,
128     + and x230). Also, in mid-2012 Lenovo issued a BIOS update for
129     + the 2011 models that fixes the issue (tested on x220 with a
130     + post-1.29 BIOS), but as of Nov. 2012, no such update is
131     + available for the 2010 models. */
132     + ACPI_BATTERY_QUIRK_THINKPAD_MAH,
133     };
134    
135     struct acpi_battery {
136     @@ -429,6 +442,21 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
137     kfree(buffer.pointer);
138     if (test_bit(ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY, &battery->flags))
139     battery->full_charge_capacity = battery->design_capacity;
140     + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
141     + battery->power_unit && battery->design_voltage) {
142     + battery->design_capacity = battery->design_capacity *
143     + 10000 / battery->design_voltage;
144     + battery->full_charge_capacity = battery->full_charge_capacity *
145     + 10000 / battery->design_voltage;
146     + battery->design_capacity_warning =
147     + battery->design_capacity_warning *
148     + 10000 / battery->design_voltage;
149     + /* Curiously, design_capacity_low, unlike the rest of them,
150     + is correct. */
151     + /* capacity_granularity_* equal 1 on the systems tested, so
152     + it's impossible to tell if they would need an adjustment
153     + or not if their values were higher. */
154     + }
155     return result;
156     }
157    
158     @@ -477,6 +505,11 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
159     && battery->capacity_now >= 0 && battery->capacity_now <= 100)
160     battery->capacity_now = (battery->capacity_now *
161     battery->full_charge_capacity) / 100;
162     + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&
163     + battery->power_unit && battery->design_voltage) {
164     + battery->capacity_now = battery->capacity_now *
165     + 10000 / battery->design_voltage;
166     + }
167     return result;
168     }
169    
170     @@ -586,6 +619,24 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
171     mutex_unlock(&battery->sysfs_lock);
172     }
173    
174     +static void find_battery(const struct dmi_header *dm, void *private)
175     +{
176     + struct acpi_battery *battery = (struct acpi_battery *)private;
177     + /* Note: the hardcoded offsets below have been extracted from
178     + the source code of dmidecode. */
179     + if (dm->type == DMI_ENTRY_PORTABLE_BATTERY && dm->length >= 8) {
180     + const u8 *dmi_data = (const u8 *)(dm + 1);
181     + int dmi_capacity = get_unaligned((const u16 *)(dmi_data + 6));
182     + if (dm->length >= 18)
183     + dmi_capacity *= dmi_data[17];
184     + if (battery->design_capacity * battery->design_voltage / 1000
185     + != dmi_capacity &&
186     + battery->design_capacity * 10 == dmi_capacity)
187     + set_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
188     + &battery->flags);
189     + }
190     +}
191     +
192     /*
193     * According to the ACPI spec, some kinds of primary batteries can
194     * report percentage battery remaining capacity directly to OS.
195     @@ -611,6 +662,32 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
196     battery->capacity_now = (battery->capacity_now *
197     battery->full_charge_capacity) / 100;
198     }
199     +
200     + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags))
201     + return ;
202     +
203     + if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
204     + const char *s;
205     + s = dmi_get_system_info(DMI_PRODUCT_VERSION);
206     + if (s && !strnicmp(s, "ThinkPad", 8)) {
207     + dmi_walk(find_battery, battery);
208     + if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
209     + &battery->flags) &&
210     + battery->design_voltage) {
211     + battery->design_capacity =
212     + battery->design_capacity *
213     + 10000 / battery->design_voltage;
214     + battery->full_charge_capacity =
215     + battery->full_charge_capacity *
216     + 10000 / battery->design_voltage;
217     + battery->design_capacity_warning =
218     + battery->design_capacity_warning *
219     + 10000 / battery->design_voltage;
220     + battery->capacity_now = battery->capacity_now *
221     + 10000 / battery->design_voltage;
222     + }
223     + }
224     + }
225     }
226    
227     static int acpi_battery_update(struct acpi_battery *battery)
228     diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
229     index 2377445..480b648 100644
230     --- a/drivers/acpi/sleep.c
231     +++ b/drivers/acpi/sleep.c
232     @@ -508,6 +508,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
233     },
234     {
235     .callback = init_nvs_nosave,
236     + .ident = "Sony Vaio VPCEB1S1E",
237     + .matches = {
238     + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
239     + DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
240     + },
241     + },
242     + {
243     + .callback = init_nvs_nosave,
244     .ident = "Sony Vaio VGN-FW520F",
245     .matches = {
246     DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
247     diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
248     index 62d9ee6..91357e1 100644
249     --- a/drivers/acpi/video.c
250     +++ b/drivers/acpi/video.c
251     @@ -389,6 +389,12 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d)
252     return 0;
253     }
254    
255     +static int video_ignore_initial_backlight(const struct dmi_system_id *d)
256     +{
257     + use_bios_initial_backlight = 0;
258     + return 0;
259     +}
260     +
261     static struct dmi_system_id video_dmi_table[] __initdata = {
262     /*
263     * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
264     @@ -433,6 +439,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
265     DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"),
266     },
267     },
268     + {
269     + .callback = video_ignore_initial_backlight,
270     + .ident = "HP Folio 13-2000",
271     + .matches = {
272     + DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
273     + DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13 - 2000 Notebook PC"),
274     + },
275     + },
276     {}
277     };
278    
279     diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
280     index b48fc2a..3fe0524 100644
281     --- a/drivers/gpu/drm/i915/intel_bios.c
282     +++ b/drivers/gpu/drm/i915/intel_bios.c
283     @@ -459,12 +459,8 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
284    
285     edp = find_section(bdb, BDB_EDP);
286     if (!edp) {
287     - if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support) {
288     - DRM_DEBUG_KMS("No eDP BDB found but eDP panel "
289     - "supported, assume %dbpp panel color "
290     - "depth.\n",
291     - dev_priv->edp.bpp);
292     - }
293     + if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support)
294     + DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported.\n");
295     return;
296     }
297    
298     @@ -617,9 +613,6 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
299     dev_priv->lvds_use_ssc = 1;
300     dev_priv->lvds_ssc_freq = intel_bios_ssc_frequency(dev, 1);
301     DRM_DEBUG_KMS("Set default to SSC at %dMHz\n", dev_priv->lvds_ssc_freq);
302     -
303     - /* eDP data */
304     - dev_priv->edp.bpp = 18;
305     }
306    
307     static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
308     diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
309     index f3b06f0..dd3e7e4 100644
310     --- a/drivers/gpu/drm/i915/intel_display.c
311     +++ b/drivers/gpu/drm/i915/intel_display.c
312     @@ -4996,6 +4996,17 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc,
313     }
314     }
315    
316     + if (intel_encoder->type == INTEL_OUTPUT_EDP) {
317     + /* Use VBT settings if we have an eDP panel */
318     + unsigned int edp_bpc = dev_priv->edp.bpp / 3;
319     +
320     + if (edp_bpc && edp_bpc < display_bpc) {
321     + DRM_DEBUG_KMS("clamping display bpc (was %d) to eDP (%d)\n", display_bpc, edp_bpc);
322     + display_bpc = edp_bpc;
323     + }
324     + continue;
325     + }
326     +
327     /*
328     * HDMI is either 12 or 8, so if the display lets 10bpc sneak
329     * through, clamp it down. (Note: >12bpc will be caught below.)
330     diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
331     index ac2d6cb..770e959 100644
332     --- a/drivers/hwmon/fam15h_power.c
333     +++ b/drivers/hwmon/fam15h_power.c
334     @@ -31,6 +31,9 @@ MODULE_DESCRIPTION("AMD Family 15h CPU processor power monitor");
335     MODULE_AUTHOR("Andreas Herrmann <andreas.herrmann3@amd.com>");
336     MODULE_LICENSE("GPL");
337    
338     +/* Family 16h Northbridge's function 4 PCI ID */
339     +#define PCI_DEVICE_ID_AMD_16H_NB_F4 0x1534
340     +
341     /* D18F3 */
342     #define REG_NORTHBRIDGE_CAP 0xe8
343    
344     @@ -256,6 +259,7 @@ static void __devexit fam15h_power_remove(struct pci_dev *pdev)
345    
346     static DEFINE_PCI_DEVICE_TABLE(fam15h_power_id_table) = {
347     { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
348     + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
349     {}
350     };
351     MODULE_DEVICE_TABLE(pci, fam15h_power_id_table);
352     diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
353     index 3b8236b..a5786a8 100644
354     --- a/drivers/mmc/host/sh_mmcif.c
355     +++ b/drivers/mmc/host/sh_mmcif.c
356     @@ -1066,7 +1066,6 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
357     {
358     struct sh_mmcif_host *host = dev_id;
359     struct mmc_request *mrq = host->mrq;
360     - struct mmc_data *data = mrq->data;
361    
362     cancel_delayed_work_sync(&host->timeout_work);
363    
364     @@ -1114,13 +1113,14 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
365     case MMCIF_WAIT_FOR_READ_END:
366     case MMCIF_WAIT_FOR_WRITE_END:
367     if (host->sd_error)
368     - data->error = sh_mmcif_error_manage(host);
369     + mrq->data->error = sh_mmcif_error_manage(host);
370     break;
371     default:
372     BUG();
373     }
374    
375     if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
376     + struct mmc_data *data = mrq->data;
377     if (!mrq->cmd->error && data && !data->error)
378     data->bytes_xfered =
379     data->blocks * data->blksz;
380     @@ -1191,10 +1191,6 @@ static irqreturn_t sh_mmcif_intr(int irq, void *dev_id)
381     host->sd_error = true;
382     dev_dbg(&host->pd->dev, "int err state = %08x\n", state);
383     }
384     - if (host->state == STATE_IDLE) {
385     - dev_info(&host->pd->dev, "Spurious IRQ status 0x%x", state);
386     - return IRQ_HANDLED;
387     - }
388     if (state & ~(INT_CMD12RBE | INT_CMD12CRE)) {
389     if (!host->dma_active)
390     return IRQ_WAKE_THREAD;
391     diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
392     index d21e8f5..e353788 100644
393     --- a/drivers/pnp/pnpacpi/core.c
394     +++ b/drivers/pnp/pnpacpi/core.c
395     @@ -95,6 +95,9 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
396     return -ENODEV;
397     }
398    
399     + if (WARN_ON_ONCE(acpi_dev != dev->data))
400     + dev->data = acpi_dev;
401     +
402     ret = pnpacpi_build_resource_template(dev, &buffer);
403     if (ret)
404     return ret;
405     diff --git a/drivers/staging/telephony/ixj.c b/drivers/staging/telephony/ixj.c
406     index f960279..638d2b8 100644
407     --- a/drivers/staging/telephony/ixj.c
408     +++ b/drivers/staging/telephony/ixj.c
409     @@ -3190,12 +3190,12 @@ static void ixj_write_cid(IXJ *j)
410    
411     ixj_fsk_alloc(j);
412    
413     - strcpy(sdmf1, j->cid_send.month);
414     - strcat(sdmf1, j->cid_send.day);
415     - strcat(sdmf1, j->cid_send.hour);
416     - strcat(sdmf1, j->cid_send.min);
417     - strcpy(sdmf2, j->cid_send.number);
418     - strcpy(sdmf3, j->cid_send.name);
419     + strlcpy(sdmf1, j->cid_send.month, sizeof(sdmf1));
420     + strlcat(sdmf1, j->cid_send.day, sizeof(sdmf1));
421     + strlcat(sdmf1, j->cid_send.hour, sizeof(sdmf1));
422     + strlcat(sdmf1, j->cid_send.min, sizeof(sdmf1));
423     + strlcpy(sdmf2, j->cid_send.number, sizeof(sdmf2));
424     + strlcpy(sdmf3, j->cid_send.name, sizeof(sdmf3));
425    
426     len1 = strlen(sdmf1);
427     len2 = strlen(sdmf2);
428     @@ -3340,12 +3340,12 @@ static void ixj_write_cidcw(IXJ *j)
429     ixj_pre_cid(j);
430     }
431     j->flags.cidcw_ack = 0;
432     - strcpy(sdmf1, j->cid_send.month);
433     - strcat(sdmf1, j->cid_send.day);
434     - strcat(sdmf1, j->cid_send.hour);
435     - strcat(sdmf1, j->cid_send.min);
436     - strcpy(sdmf2, j->cid_send.number);
437     - strcpy(sdmf3, j->cid_send.name);
438     + strlcpy(sdmf1, j->cid_send.month, sizeof(sdmf1));
439     + strlcat(sdmf1, j->cid_send.day, sizeof(sdmf1));
440     + strlcat(sdmf1, j->cid_send.hour, sizeof(sdmf1));
441     + strlcat(sdmf1, j->cid_send.min, sizeof(sdmf1));
442     + strlcpy(sdmf2, j->cid_send.number, sizeof(sdmf2));
443     + strlcpy(sdmf3, j->cid_send.name, sizeof(sdmf3));
444    
445     len1 = strlen(sdmf1);
446     len2 = strlen(sdmf2);
447     diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
448     index c5f7eae..b4e87cf 100644
449     --- a/drivers/usb/class/cdc-acm.c
450     +++ b/drivers/usb/class/cdc-acm.c
451     @@ -788,6 +788,10 @@ static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
452     tmp.flags = ASYNC_LOW_LATENCY;
453     tmp.xmit_fifo_size = acm->writesize;
454     tmp.baud_base = le32_to_cpu(acm->line.dwDTERate);
455     + tmp.close_delay = acm->port.close_delay / 10;
456     + tmp.closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
457     + ASYNC_CLOSING_WAIT_NONE :
458     + acm->port.closing_wait / 10;
459    
460     if (copy_to_user(info, &tmp, sizeof(tmp)))
461     return -EFAULT;
462     @@ -795,6 +799,37 @@ static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
463     return 0;
464     }
465    
466     +static int set_serial_info(struct acm *acm,
467     + struct serial_struct __user *newinfo)
468     +{
469     + struct serial_struct new_serial;
470     + unsigned int closing_wait, close_delay;
471     + int retval = 0;
472     +
473     + if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
474     + return -EFAULT;
475     +
476     + close_delay = new_serial.close_delay * 10;
477     + closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
478     + ASYNC_CLOSING_WAIT_NONE : new_serial.closing_wait * 10;
479     +
480     + mutex_lock(&acm->port.mutex);
481     +
482     + if (!capable(CAP_SYS_ADMIN)) {
483     + if ((close_delay != acm->port.close_delay) ||
484     + (closing_wait != acm->port.closing_wait))
485     + retval = -EPERM;
486     + else
487     + retval = -EOPNOTSUPP;
488     + } else {
489     + acm->port.close_delay = close_delay;
490     + acm->port.closing_wait = closing_wait;
491     + }
492     +
493     + mutex_unlock(&acm->port.mutex);
494     + return retval;
495     +}
496     +
497     static int acm_tty_ioctl(struct tty_struct *tty,
498     unsigned int cmd, unsigned long arg)
499     {
500     @@ -805,6 +840,9 @@ static int acm_tty_ioctl(struct tty_struct *tty,
501     case TIOCGSERIAL: /* gets serial port data */
502     rv = get_serial_info(acm, (struct serial_struct __user *) arg);
503     break;
504     + case TIOCSSERIAL:
505     + rv = set_serial_info(acm, (struct serial_struct __user *) arg);
506     + break;
507     }
508    
509     return rv;
510     diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
511     index c5a1ea9..9d00d47 100644
512     --- a/drivers/usb/host/ohci-q.c
513     +++ b/drivers/usb/host/ohci-q.c
514     @@ -1128,6 +1128,25 @@ dl_done_list (struct ohci_hcd *ohci)
515    
516     while (td) {
517     struct td *td_next = td->next_dl_td;
518     + struct ed *ed = td->ed;
519     +
520     + /*
521     + * Some OHCI controllers (NVIDIA for sure, maybe others)
522     + * occasionally forget to add TDs to the done queue. Since
523     + * TDs for a given endpoint are always processed in order,
524     + * if we find a TD on the donelist then all of its
525     + * predecessors must be finished as well.
526     + */
527     + for (;;) {
528     + struct td *td2;
529     +
530     + td2 = list_first_entry(&ed->td_list, struct td,
531     + td_list);
532     + if (td2 == td)
533     + break;
534     + takeback_td(ohci, td2);
535     + }
536     +
537     takeback_td(ohci, td);
538     td = td_next;
539     }
540     diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
541     index 4211017..84e82dc 100644
542     --- a/drivers/usb/host/xhci-pci.c
543     +++ b/drivers/usb/host/xhci-pci.c
544     @@ -29,6 +29,7 @@
545     /* Device for a quirk */
546     #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73
547     #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000
548     +#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400
549    
550     #define PCI_VENDOR_ID_ETRON 0x1b6f
551     #define PCI_DEVICE_ID_ASROCK_P67 0x7023
552     @@ -58,8 +59,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
553    
554     /* Look for vendor-specific quirks */
555     if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC &&
556     - pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) {
557     - if (pdev->revision == 0x0) {
558     + (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK ||
559     + pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) {
560     + if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
561     + pdev->revision == 0x0) {
562     xhci->quirks |= XHCI_RESET_EP_QUIRK;
563     xhci_dbg(xhci, "QUIRK: Fresco Logic xHC needs configure"
564     " endpoint cmd after reset endpoint\n");
565     diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
566     index 53e7e69..f38a278 100644
567     --- a/drivers/usb/serial/cp210x.c
568     +++ b/drivers/usb/serial/cp210x.c
569     @@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = {
570     { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
571     { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
572     { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
573     + { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
574     { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
575     { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
576     { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
577     diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
578     index 25bb935..25903f5 100644
579     --- a/drivers/usb/serial/ftdi_sio.c
580     +++ b/drivers/usb/serial/ftdi_sio.c
581     @@ -197,6 +197,7 @@ static struct usb_device_id id_table_combined [] = {
582     { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
583     { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
584     { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
585     + { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) },
586     { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
587     { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
588     { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
589     @@ -1810,7 +1811,7 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
590     dbg("%s", __func__);
591    
592     if ((udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) ||
593     - (udev->product && !strcmp(udev->product, "BeagleBone/XDS100")))
594     + (udev->product && !strcmp(udev->product, "BeagleBone/XDS100V2")))
595     return ftdi_jtag_probe(serial);
596    
597     return 0;
598     diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
599     index 57c12ef..049b6e7 100644
600     --- a/drivers/usb/serial/ftdi_sio_ids.h
601     +++ b/drivers/usb/serial/ftdi_sio_ids.h
602     @@ -752,6 +752,12 @@
603     #define TTI_VID 0x103E /* Vendor Id */
604     #define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
605    
606     +/*
607     + * Newport Cooperation (www.newport.com)
608     + */
609     +#define NEWPORT_VID 0x104D
610     +#define NEWPORT_AGILIS_PID 0x3000
611     +
612     /* Interbiometrics USB I/O Board */
613     /* Developed for Interbiometrics by Rudolf Gugler */
614     #define INTERBIOMETRICS_VID 0x1209
615     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
616     index 43aa36b..0c3d290 100644
617     --- a/drivers/usb/serial/option.c
618     +++ b/drivers/usb/serial/option.c
619     @@ -80,6 +80,7 @@ static void option_instat_callback(struct urb *urb);
620     #define OPTION_PRODUCT_GTM380_MODEM 0x7201
621    
622     #define HUAWEI_VENDOR_ID 0x12D1
623     +#define HUAWEI_PRODUCT_E173 0x140C
624     #define HUAWEI_PRODUCT_K4505 0x1464
625     #define HUAWEI_PRODUCT_K3765 0x1465
626     #define HUAWEI_PRODUCT_K4605 0x14C6
627     @@ -552,6 +553,8 @@ static const struct usb_device_id option_ids[] = {
628     { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
629     { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) },
630     { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) },
631     + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
632     + .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
633     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
634     .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
635     { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
636     @@ -883,6 +886,10 @@ static const struct usb_device_id option_ids[] = {
637     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff),
638     .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
639     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) },
640     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0135, 0xff, 0xff, 0xff) },
641     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0136, 0xff, 0xff, 0xff) },
642     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0137, 0xff, 0xff, 0xff) },
643     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0139, 0xff, 0xff, 0xff) },
644     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) },
645     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
646     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) },
647     @@ -903,20 +910,34 @@ static const struct usb_device_id option_ids[] = {
648     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
649     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
650     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
651     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff) },
652     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */
653     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
654     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) },
655     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0197, 0xff, 0xff, 0xff) },
656     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0199, 0xff, 0xff, 0xff), /* ZTE MF820S */
657     .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
658     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0200, 0xff, 0xff, 0xff) },
659     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0201, 0xff, 0xff, 0xff) },
660     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0254, 0xff, 0xff, 0xff) },
661     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
662     .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
663     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
664     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) },
665     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
666     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
667     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
668     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0330, 0xff, 0xff, 0xff) },
669     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0395, 0xff, 0xff, 0xff) },
670     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) },
671     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) },
672     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
673     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
674     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff),
675     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
676     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff),
677     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
678     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1018, 0xff, 0xff, 0xff) },
679     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1021, 0xff, 0xff, 0xff),
680     .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
681     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
682     @@ -1096,6 +1117,10 @@ static const struct usb_device_id option_ids[] = {
683     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
684     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
685     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
686     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1301, 0xff, 0xff, 0xff) },
687     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1302, 0xff, 0xff, 0xff) },
688     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1303, 0xff, 0xff, 0xff) },
689     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1333, 0xff, 0xff, 0xff) },
690     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff),
691     .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
692     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff),
693     diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
694     index 7691c86..685edc8 100644
695     --- a/drivers/usb/storage/Kconfig
696     +++ b/drivers/usb/storage/Kconfig
697     @@ -203,7 +203,7 @@ config USB_STORAGE_ENE_UB6250
698    
699     config USB_UAS
700     tristate "USB Attached SCSI"
701     - depends on USB && SCSI
702     + depends on USB && SCSI && BROKEN
703     help
704     The USB Attached SCSI protocol is supported by some USB
705     storage devices. It permits higher performance by supporting
706     diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
707     index 0abf1d4..fe07e5a 100644
708     --- a/include/linux/mempolicy.h
709     +++ b/include/linux/mempolicy.h
710     @@ -137,16 +137,6 @@ static inline void mpol_cond_put(struct mempolicy *pol)
711     __mpol_put(pol);
712     }
713    
714     -extern struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol,
715     - struct mempolicy *frompol);
716     -static inline struct mempolicy *mpol_cond_copy(struct mempolicy *tompol,
717     - struct mempolicy *frompol)
718     -{
719     - if (!frompol)
720     - return frompol;
721     - return __mpol_cond_copy(tompol, frompol);
722     -}
723     -
724     extern struct mempolicy *__mpol_dup(struct mempolicy *pol);
725     static inline struct mempolicy *mpol_dup(struct mempolicy *pol)
726     {
727     @@ -270,12 +260,6 @@ static inline void mpol_cond_put(struct mempolicy *pol)
728     {
729     }
730    
731     -static inline struct mempolicy *mpol_cond_copy(struct mempolicy *to,
732     - struct mempolicy *from)
733     -{
734     - return from;
735     -}
736     -
737     static inline void mpol_get(struct mempolicy *pol)
738     {
739     }
740     diff --git a/kernel/rcutree.c b/kernel/rcutree.c
741     index 4eec66e..62c5e9c 100644
742     --- a/kernel/rcutree.c
743     +++ b/kernel/rcutree.c
744     @@ -202,13 +202,13 @@ DEFINE_PER_CPU(struct rcu_dynticks, rcu_dynticks) = {
745     .dynticks = ATOMIC_INIT(1),
746     };
747    
748     -static int blimit = 10; /* Maximum callbacks per rcu_do_batch. */
749     -static int qhimark = 10000; /* If this many pending, ignore blimit. */
750     -static int qlowmark = 100; /* Once only this many pending, use blimit. */
751     +static long blimit = 10; /* Maximum callbacks per rcu_do_batch. */
752     +static long qhimark = 10000; /* If this many pending, ignore blimit. */
753     +static long qlowmark = 100; /* Once only this many pending, use blimit. */
754    
755     -module_param(blimit, int, 0);
756     -module_param(qhimark, int, 0);
757     -module_param(qlowmark, int, 0);
758     +module_param(blimit, long, 0);
759     +module_param(qhimark, long, 0);
760     +module_param(qlowmark, long, 0);
761    
762     int rcu_cpu_stall_suppress __read_mostly; /* 1 = suppress stall warnings. */
763     int rcu_cpu_stall_timeout __read_mostly = CONFIG_RCU_CPU_STALL_TIMEOUT;
764     @@ -1476,7 +1476,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
765     {
766     unsigned long flags;
767     struct rcu_head *next, *list, **tail;
768     - int bl, count, count_lazy;
769     + long bl, count, count_lazy;
770    
771     /* If no callbacks are ready, just return.*/
772     if (!cpu_has_callbacks_ready_to_invoke(rdp)) {
773     diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
774     index 0fa92f6..100b7fd 100644
775     --- a/kernel/trace/ftrace.c
776     +++ b/kernel/trace/ftrace.c
777     @@ -2368,7 +2368,7 @@ static void reset_iter_read(struct ftrace_iterator *iter)
778     {
779     iter->pos = 0;
780     iter->func_pos = 0;
781     - iter->flags &= ~(FTRACE_ITER_PRINTALL & FTRACE_ITER_HASH);
782     + iter->flags &= ~(FTRACE_ITER_PRINTALL | FTRACE_ITER_HASH);
783     }
784    
785     static void *t_start(struct seq_file *m, loff_t *pos)
786     diff --git a/kernel/workqueue.c b/kernel/workqueue.c
787     index bcb9d34..a64b94e 100644
788     --- a/kernel/workqueue.c
789     +++ b/kernel/workqueue.c
790     @@ -1141,8 +1141,8 @@ int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
791     if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) {
792     unsigned int lcpu;
793    
794     - BUG_ON(timer_pending(timer));
795     - BUG_ON(!list_empty(&work->entry));
796     + WARN_ON_ONCE(timer_pending(timer));
797     + WARN_ON_ONCE(!list_empty(&work->entry));
798    
799     timer_stats_timer_set_start_info(&dwork->timer);
800    
801     diff --git a/mm/dmapool.c b/mm/dmapool.c
802     index c5ab33b..da1b0f0 100644
803     --- a/mm/dmapool.c
804     +++ b/mm/dmapool.c
805     @@ -50,7 +50,6 @@ struct dma_pool { /* the pool */
806     size_t allocation;
807     size_t boundary;
808     char name[32];
809     - wait_queue_head_t waitq;
810     struct list_head pools;
811     };
812    
813     @@ -62,8 +61,6 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
814     unsigned int offset;
815     };
816    
817     -#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000)
818     -
819     static DEFINE_MUTEX(pools_lock);
820    
821     static ssize_t
822     @@ -172,7 +169,6 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
823     retval->size = size;
824     retval->boundary = boundary;
825     retval->allocation = allocation;
826     - init_waitqueue_head(&retval->waitq);
827    
828     if (dev) {
829     int ret;
830     @@ -227,7 +223,6 @@ static struct dma_page *pool_alloc_page(struct dma_pool *pool, gfp_t mem_flags)
831     memset(page->vaddr, POOL_POISON_FREED, pool->allocation);
832     #endif
833     pool_initialise_page(pool, page);
834     - list_add(&page->page_list, &pool->page_list);
835     page->in_use = 0;
836     page->offset = 0;
837     } else {
838     @@ -315,30 +310,21 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
839     might_sleep_if(mem_flags & __GFP_WAIT);
840    
841     spin_lock_irqsave(&pool->lock, flags);
842     - restart:
843     list_for_each_entry(page, &pool->page_list, page_list) {
844     if (page->offset < pool->allocation)
845     goto ready;
846     }
847     - page = pool_alloc_page(pool, GFP_ATOMIC);
848     - if (!page) {
849     - if (mem_flags & __GFP_WAIT) {
850     - DECLARE_WAITQUEUE(wait, current);
851    
852     - __set_current_state(TASK_UNINTERRUPTIBLE);
853     - __add_wait_queue(&pool->waitq, &wait);
854     - spin_unlock_irqrestore(&pool->lock, flags);
855     + /* pool_alloc_page() might sleep, so temporarily drop &pool->lock */
856     + spin_unlock_irqrestore(&pool->lock, flags);
857    
858     - schedule_timeout(POOL_TIMEOUT_JIFFIES);
859     + page = pool_alloc_page(pool, mem_flags);
860     + if (!page)
861     + return NULL;
862    
863     - spin_lock_irqsave(&pool->lock, flags);
864     - __remove_wait_queue(&pool->waitq, &wait);
865     - goto restart;
866     - }
867     - retval = NULL;
868     - goto done;
869     - }
870     + spin_lock_irqsave(&pool->lock, flags);
871    
872     + list_add(&page->page_list, &pool->page_list);
873     ready:
874     page->in_use++;
875     offset = page->offset;
876     @@ -348,7 +334,6 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
877     #ifdef DMAPOOL_DEBUG
878     memset(retval, POOL_POISON_ALLOCATED, pool->size);
879     #endif
880     - done:
881     spin_unlock_irqrestore(&pool->lock, flags);
882     return retval;
883     }
884     @@ -435,8 +420,6 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
885     page->in_use--;
886     *(int *)vaddr = page->offset;
887     page->offset = offset;
888     - if (waitqueue_active(&pool->waitq))
889     - wake_up_locked(&pool->waitq);
890     /*
891     * Resist a temptation to do
892     * if (!is_page_busy(page)) pool_free_page(pool, page);
893     diff --git a/mm/mempolicy.c b/mm/mempolicy.c
894     index d1e4bef..458dede 100644
895     --- a/mm/mempolicy.c
896     +++ b/mm/mempolicy.c
897     @@ -2009,28 +2009,6 @@ struct mempolicy *__mpol_dup(struct mempolicy *old)
898     return new;
899     }
900    
901     -/*
902     - * If *frompol needs [has] an extra ref, copy *frompol to *tompol ,
903     - * eliminate the * MPOL_F_* flags that require conditional ref and
904     - * [NOTE!!!] drop the extra ref. Not safe to reference *frompol directly
905     - * after return. Use the returned value.
906     - *
907     - * Allows use of a mempolicy for, e.g., multiple allocations with a single
908     - * policy lookup, even if the policy needs/has extra ref on lookup.
909     - * shmem_readahead needs this.
910     - */
911     -struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol,
912     - struct mempolicy *frompol)
913     -{
914     - if (!mpol_needs_cond_ref(frompol))
915     - return frompol;
916     -
917     - *tompol = *frompol;
918     - tompol->flags &= ~MPOL_F_SHARED; /* copy doesn't need unref */
919     - __mpol_put(frompol);
920     - return tompol;
921     -}
922     -
923     /* Slow path of a mempolicy comparison */
924     bool __mpol_equal(struct mempolicy *a, struct mempolicy *b)
925     {
926     diff --git a/mm/shmem.c b/mm/shmem.c
927     index a859b06..a409bd8 100644
928     --- a/mm/shmem.c
929     +++ b/mm/shmem.c
930     @@ -798,24 +798,28 @@ static struct mempolicy *shmem_get_sbmpol(struct shmem_sb_info *sbinfo)
931     static struct page *shmem_swapin(swp_entry_t swap, gfp_t gfp,
932     struct shmem_inode_info *info, pgoff_t index)
933     {
934     - struct mempolicy mpol, *spol;
935     struct vm_area_struct pvma;
936     -
937     - spol = mpol_cond_copy(&mpol,
938     - mpol_shared_policy_lookup(&info->policy, index));
939     + struct page *page;
940    
941     /* Create a pseudo vma that just contains the policy */
942     pvma.vm_start = 0;
943     pvma.vm_pgoff = index;
944     pvma.vm_ops = NULL;
945     - pvma.vm_policy = spol;
946     - return swapin_readahead(swap, gfp, &pvma, 0);
947     + pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index);
948     +
949     + page = swapin_readahead(swap, gfp, &pvma, 0);
950     +
951     + /* Drop reference taken by mpol_shared_policy_lookup() */
952     + mpol_cond_put(pvma.vm_policy);
953     +
954     + return page;
955     }
956    
957     static struct page *shmem_alloc_page(gfp_t gfp,
958     struct shmem_inode_info *info, pgoff_t index)
959     {
960     struct vm_area_struct pvma;
961     + struct page *page;
962    
963     /* Create a pseudo vma that just contains the policy */
964     pvma.vm_start = 0;
965     @@ -823,10 +827,12 @@ static struct page *shmem_alloc_page(gfp_t gfp,
966     pvma.vm_ops = NULL;
967     pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, index);
968    
969     - /*
970     - * alloc_page_vma() will drop the shared policy reference
971     - */
972     - return alloc_page_vma(gfp, &pvma, 0);
973     + page = alloc_page_vma(gfp, &pvma, 0);
974     +
975     + /* Drop reference taken by mpol_shared_policy_lookup() */
976     + mpol_cond_put(pvma.vm_policy);
977     +
978     + return page;
979     }
980     #else /* !CONFIG_NUMA */
981     #ifdef CONFIG_TMPFS
982     diff --git a/sound/soc/Makefile b/sound/soc/Makefile
983     index 2feaf37..0f37086 100644
984     --- a/sound/soc/Makefile
985     +++ b/sound/soc/Makefile
986     @@ -1,8 +1,9 @@
987     snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
988     snd-soc-core-objs += soc-pcm.o soc-io.o
989    
990     -snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o
991     -obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o
992     +ifneq ($(CONFIG_SND_SOC_DMAENGINE_PCM),)
993     +snd-soc-core-objs += soc-dmaengine-pcm.o
994     +endif
995    
996     obj-$(CONFIG_SND_SOC) += snd-soc-core.o
997     obj-$(CONFIG_SND_SOC) += codecs/
998     diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
999     index 223ffdc..3487b4b 100644
1000     --- a/tools/perf/builtin-test.c
1001     +++ b/tools/perf/builtin-test.c
1002     @@ -1154,19 +1154,13 @@ static int test__parse_events(void)
1003     return ret;
1004     }
1005    
1006     -static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t **maskp,
1007     - size_t *sizep)
1008     +static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp)
1009     {
1010     - cpu_set_t *mask;
1011     - size_t size;
1012     int i, cpu = -1, nrcpus = 1024;
1013     realloc:
1014     - mask = CPU_ALLOC(nrcpus);
1015     - size = CPU_ALLOC_SIZE(nrcpus);
1016     - CPU_ZERO_S(size, mask);
1017     + CPU_ZERO(maskp);
1018    
1019     - if (sched_getaffinity(pid, size, mask) == -1) {
1020     - CPU_FREE(mask);
1021     + if (sched_getaffinity(pid, sizeof(*maskp), maskp) == -1) {
1022     if (errno == EINVAL && nrcpus < (1024 << 8)) {
1023     nrcpus = nrcpus << 2;
1024     goto realloc;
1025     @@ -1176,19 +1170,14 @@ realloc:
1026     }
1027    
1028     for (i = 0; i < nrcpus; i++) {
1029     - if (CPU_ISSET_S(i, size, mask)) {
1030     - if (cpu == -1) {
1031     + if (CPU_ISSET(i, maskp)) {
1032     + if (cpu == -1)
1033     cpu = i;
1034     - *maskp = mask;
1035     - *sizep = size;
1036     - } else
1037     - CPU_CLR_S(i, size, mask);
1038     + else
1039     + CPU_CLR(i, maskp);
1040     }
1041     }
1042    
1043     - if (cpu == -1)
1044     - CPU_FREE(mask);
1045     -
1046     return cpu;
1047     }
1048    
1049     @@ -1199,8 +1188,8 @@ static int test__PERF_RECORD(void)
1050     .freq = 10,
1051     .mmap_pages = 256,
1052     };
1053     - cpu_set_t *cpu_mask = NULL;
1054     - size_t cpu_mask_size = 0;
1055     + cpu_set_t cpu_mask;
1056     + size_t cpu_mask_size = sizeof(cpu_mask);
1057     struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
1058     struct perf_evsel *evsel;
1059     struct perf_sample sample;
1060     @@ -1265,8 +1254,7 @@ static int test__PERF_RECORD(void)
1061     evsel->attr.sample_type |= PERF_SAMPLE_TIME;
1062     perf_evlist__config_attrs(evlist, &opts);
1063    
1064     - err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask,
1065     - &cpu_mask_size);
1066     + err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask);
1067     if (err < 0) {
1068     pr_debug("sched__get_first_possible_cpu: %s\n", strerror(errno));
1069     goto out_delete_evlist;
1070     @@ -1277,9 +1265,9 @@ static int test__PERF_RECORD(void)
1071     /*
1072     * So that we can check perf_sample.cpu on all the samples.
1073     */
1074     - if (sched_setaffinity(evlist->workload.pid, cpu_mask_size, cpu_mask) < 0) {
1075     + if (sched_setaffinity(evlist->workload.pid, cpu_mask_size, &cpu_mask) < 0) {
1076     pr_debug("sched_setaffinity: %s\n", strerror(errno));
1077     - goto out_free_cpu_mask;
1078     + goto out_delete_evlist;
1079     }
1080    
1081     /*
1082     @@ -1472,8 +1460,6 @@ found_exit:
1083     }
1084     out_err:
1085     perf_evlist__munmap(evlist);
1086     -out_free_cpu_mask:
1087     - CPU_FREE(cpu_mask);
1088     out_delete_evlist:
1089     perf_evlist__delete(evlist);
1090     out:

  ViewVC Help
Powered by ViewVC 1.1.20