Magellan Linux

Annotation of /trunk/kernel-lts/patches-3.4/0163-3.4.64-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2305 - (hide annotations) (download)
Mon Oct 14 07:15:29 2013 UTC (10 years, 8 months ago) by niro
File size: 23493 byte(s)
-linux-3.4.64
1 niro 2305 diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
2     index 505f27e..8d1724c 100644
3     --- a/drivers/gpu/drm/radeon/atombios_dp.c
4     +++ b/drivers/gpu/drm/radeon/atombios_dp.c
5     @@ -51,7 +51,7 @@ static char *pre_emph_names[] = {
6     * or from atom. Note that atom operates on
7     * dw units.
8     */
9     -static void radeon_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le)
10     +void radeon_atom_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le)
11     {
12     #ifdef __BIG_ENDIAN
13     u8 src_tmp[20], dst_tmp[20]; /* used for byteswapping */
14     @@ -101,7 +101,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan,
15    
16     base = (unsigned char *)(rdev->mode_info.atom_context->scratch + 1);
17    
18     - radeon_copy_swap(base, send, send_bytes, true);
19     + radeon_atom_copy_swap(base, send, send_bytes, true);
20    
21     args.v1.lpAuxRequest = cpu_to_le16((u16)(0 + 4));
22     args.v1.lpDataOut = cpu_to_le16((u16)(16 + 4));
23     @@ -138,7 +138,7 @@ static int radeon_process_aux_ch(struct radeon_i2c_chan *chan,
24     recv_bytes = recv_size;
25    
26     if (recv && recv_size)
27     - radeon_copy_swap(recv, base + 16, recv_bytes, false);
28     + radeon_atom_copy_swap(recv, base + 16, recv_bytes, false);
29    
30     return recv_bytes;
31     }
32     diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
33     index ced9370..2f755e2 100644
34     --- a/drivers/gpu/drm/radeon/atombios_encoders.c
35     +++ b/drivers/gpu/drm/radeon/atombios_encoders.c
36     @@ -1425,8 +1425,12 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
37     atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
38     atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
39     atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
40     - /* some early dce3.2 boards have a bug in their transmitter control table */
41     - if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))
42     + /* some dce3.x boards have a bug in their transmitter control table.
43     + * ACTION_ENABLE_OUTPUT can probably be dropped since ACTION_ENABLE
44     + * does the same thing and more.
45     + */
46     + if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) &&
47     + (rdev->family != CHIP_RS880))
48     atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
49     }
50     if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
51     diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c
52     index 44d87b6..9ed94a8 100644
53     --- a/drivers/gpu/drm/radeon/atombios_i2c.c
54     +++ b/drivers/gpu/drm/radeon/atombios_i2c.c
55     @@ -27,6 +27,8 @@
56     #include "radeon.h"
57     #include "atom.h"
58    
59     +extern void radeon_atom_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le);
60     +
61     #define TARGET_HW_I2C_CLOCK 50
62    
63     /* these are a limitation of ProcessI2cChannelTransaction not the hw */
64     @@ -77,7 +79,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
65     }
66    
67     if (!(flags & HW_I2C_WRITE))
68     - memcpy(buf, base, num);
69     + radeon_atom_copy_swap(buf, base, num, false);
70    
71     return 0;
72     }
73     diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
74     index 300099d..15d1f08 100644
75     --- a/drivers/gpu/drm/radeon/evergreen.c
76     +++ b/drivers/gpu/drm/radeon/evergreen.c
77     @@ -534,7 +534,8 @@ static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev,
78     struct drm_display_mode *mode,
79     struct drm_display_mode *other_mode)
80     {
81     - u32 tmp;
82     + u32 tmp, buffer_alloc, i;
83     + u32 pipe_offset = radeon_crtc->crtc_id * 0x20;
84     /*
85     * Line Buffer Setup
86     * There are 3 line buffers, each one shared by 2 display controllers.
87     @@ -557,18 +558,34 @@ static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev,
88     * non-linked crtcs for maximum line buffer allocation.
89     */
90     if (radeon_crtc->base.enabled && mode) {
91     - if (other_mode)
92     + if (other_mode) {
93     tmp = 0; /* 1/2 */
94     - else
95     + buffer_alloc = 1;
96     + } else {
97     tmp = 2; /* whole */
98     - } else
99     + buffer_alloc = 2;
100     + }
101     + } else {
102     tmp = 0;
103     + buffer_alloc = 0;
104     + }
105    
106     /* second controller of the pair uses second half of the lb */
107     if (radeon_crtc->crtc_id % 2)
108     tmp += 4;
109     WREG32(DC_LB_MEMORY_SPLIT + radeon_crtc->crtc_offset, tmp);
110    
111     + if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE5(rdev)) {
112     + WREG32(PIPE0_DMIF_BUFFER_CONTROL + pipe_offset,
113     + DMIF_BUFFERS_ALLOCATED(buffer_alloc));
114     + for (i = 0; i < rdev->usec_timeout; i++) {
115     + if (RREG32(PIPE0_DMIF_BUFFER_CONTROL + pipe_offset) &
116     + DMIF_BUFFERS_ALLOCATED_COMPLETED)
117     + break;
118     + udelay(1);
119     + }
120     + }
121     +
122     if (radeon_crtc->base.enabled && mode) {
123     switch (tmp) {
124     case 0:
125     diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
126     index 81e744f..52aabf2 100644
127     --- a/drivers/gpu/drm/radeon/evergreend.h
128     +++ b/drivers/gpu/drm/radeon/evergreend.h
129     @@ -472,6 +472,10 @@
130     # define LATENCY_LOW_WATERMARK(x) ((x) << 0)
131     # define LATENCY_HIGH_WATERMARK(x) ((x) << 16)
132    
133     +#define PIPE0_DMIF_BUFFER_CONTROL 0x0ca0
134     +# define DMIF_BUFFERS_ALLOCATED(x) ((x) << 0)
135     +# define DMIF_BUFFERS_ALLOCATED_COMPLETED (1 << 4)
136     +
137     #define IH_RB_CNTL 0x3e00
138     # define IH_RB_ENABLE (1 << 0)
139     # define IH_IB_SIZE(x) ((x) << 1) /* log2 */
140     diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
141     index 38d87e1..c54d295 100644
142     --- a/drivers/gpu/drm/radeon/radeon_atombios.c
143     +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
144     @@ -715,13 +715,16 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
145     (ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT *)
146     (ctx->bios + data_offset +
147     le16_to_cpu(router_obj->asObjects[k].usSrcDstTableOffset));
148     + u8 *num_dst_objs = (u8 *)
149     + ((u8 *)router_src_dst_table + 1 +
150     + (router_src_dst_table->ucNumberOfSrc * 2));
151     + u16 *dst_objs = (u16 *)(num_dst_objs + 1);
152     int enum_id;
153    
154     router.router_id = router_obj_id;
155     - for (enum_id = 0; enum_id < router_src_dst_table->ucNumberOfDst;
156     - enum_id++) {
157     + for (enum_id = 0; enum_id < (*num_dst_objs); enum_id++) {
158     if (le16_to_cpu(path->usConnObjectId) ==
159     - le16_to_cpu(router_src_dst_table->usDstObjectID[enum_id]))
160     + le16_to_cpu(dst_objs[enum_id]))
161     break;
162     }
163    
164     @@ -1622,7 +1625,9 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
165     kfree(edid);
166     }
167     }
168     - record += sizeof(ATOM_FAKE_EDID_PATCH_RECORD);
169     + record += fake_edid_record->ucFakeEDIDLength ?
170     + fake_edid_record->ucFakeEDIDLength + 2 :
171     + sizeof(ATOM_FAKE_EDID_PATCH_RECORD);
172     break;
173     case LCD_PANEL_RESOLUTION_RECORD_TYPE:
174     panel_res_record = (ATOM_PANEL_RESOLUTION_PATCH_RECORD *)record;
175     diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
176     index 5099bd3..b367d1d 100644
177     --- a/drivers/gpu/drm/radeon/rs400.c
178     +++ b/drivers/gpu/drm/radeon/rs400.c
179     @@ -174,10 +174,13 @@ int rs400_gart_enable(struct radeon_device *rdev)
180     /* FIXME: according to doc we should set HIDE_MMCFG_BAR=0,
181     * AGPMODE30=0 & AGP30ENHANCED=0 in NB_CNTL */
182     if ((rdev->family == CHIP_RS690) || (rdev->family == CHIP_RS740)) {
183     - WREG32_MC(RS480_MC_MISC_CNTL,
184     - (RS480_GART_INDEX_REG_EN | RS690_BLOCK_GFX_D3_EN));
185     + tmp = RREG32_MC(RS480_MC_MISC_CNTL);
186     + tmp |= RS480_GART_INDEX_REG_EN | RS690_BLOCK_GFX_D3_EN;
187     + WREG32_MC(RS480_MC_MISC_CNTL, tmp);
188     } else {
189     - WREG32_MC(RS480_MC_MISC_CNTL, RS480_GART_INDEX_REG_EN);
190     + tmp = RREG32_MC(RS480_MC_MISC_CNTL);
191     + tmp |= RS480_GART_INDEX_REG_EN;
192     + WREG32_MC(RS480_MC_MISC_CNTL, tmp);
193     }
194     /* Enable gart */
195     WREG32_MC(RS480_AGP_ADDRESS_SPACE_SIZE, (RS480_GART_EN | size_reg));
196     diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
197     index e22b460..bd1f18c 100644
198     --- a/drivers/gpu/drm/radeon/si.c
199     +++ b/drivers/gpu/drm/radeon/si.c
200     @@ -411,7 +411,8 @@ static u32 dce6_line_buffer_adjust(struct radeon_device *rdev,
201     struct drm_display_mode *mode,
202     struct drm_display_mode *other_mode)
203     {
204     - u32 tmp;
205     + u32 tmp, buffer_alloc, i;
206     + u32 pipe_offset = radeon_crtc->crtc_id * 0x20;
207     /*
208     * Line Buffer Setup
209     * There are 3 line buffers, each one shared by 2 display controllers.
210     @@ -426,16 +427,30 @@ static u32 dce6_line_buffer_adjust(struct radeon_device *rdev,
211     * non-linked crtcs for maximum line buffer allocation.
212     */
213     if (radeon_crtc->base.enabled && mode) {
214     - if (other_mode)
215     + if (other_mode) {
216     tmp = 0; /* 1/2 */
217     - else
218     + buffer_alloc = 1;
219     + } else {
220     tmp = 2; /* whole */
221     - } else
222     + buffer_alloc = 2;
223     + }
224     + } else {
225     tmp = 0;
226     + buffer_alloc = 0;
227     + }
228    
229     WREG32(DC_LB_MEMORY_SPLIT + radeon_crtc->crtc_offset,
230     DC_LB_MEMORY_CONFIG(tmp));
231    
232     + WREG32(PIPE0_DMIF_BUFFER_CONTROL + pipe_offset,
233     + DMIF_BUFFERS_ALLOCATED(buffer_alloc));
234     + for (i = 0; i < rdev->usec_timeout; i++) {
235     + if (RREG32(PIPE0_DMIF_BUFFER_CONTROL + pipe_offset) &
236     + DMIF_BUFFERS_ALLOCATED_COMPLETED)
237     + break;
238     + udelay(1);
239     + }
240     +
241     if (radeon_crtc->base.enabled && mode) {
242     switch (tmp) {
243     case 0:
244     diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h
245     index 45e240d..1767ae7 100644
246     --- a/drivers/gpu/drm/radeon/sid.h
247     +++ b/drivers/gpu/drm/radeon/sid.h
248     @@ -57,6 +57,10 @@
249    
250     #define DMIF_ADDR_CALC 0xC00
251    
252     +#define PIPE0_DMIF_BUFFER_CONTROL 0x0ca0
253     +# define DMIF_BUFFERS_ALLOCATED(x) ((x) << 0)
254     +# define DMIF_BUFFERS_ALLOCATED_COMPLETED (1 << 4)
255     +
256     #define SRBM_STATUS 0xE50
257    
258     #define CC_SYS_RB_BACKEND_DISABLE 0xe80
259     diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
260     index fa09daf..ea10bbe 100644
261     --- a/drivers/gpu/drm/ttm/ttm_tt.c
262     +++ b/drivers/gpu/drm/ttm/ttm_tt.c
263     @@ -170,7 +170,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
264     ttm_tt_unbind(ttm);
265     }
266    
267     - if (likely(ttm->pages != NULL)) {
268     + if (ttm->state == tt_unbound) {
269     ttm->bdev->driver->ttm_tt_unpopulate(ttm);
270     }
271    
272     diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
273     index ab59fdf..e937a58 100644
274     --- a/drivers/hid/hid-core.c
275     +++ b/drivers/hid/hid-core.c
276     @@ -821,6 +821,64 @@ static int search(__s32 *array, __s32 value, unsigned n)
277     return -1;
278     }
279    
280     +static const char * const hid_report_names[] = {
281     + "HID_INPUT_REPORT",
282     + "HID_OUTPUT_REPORT",
283     + "HID_FEATURE_REPORT",
284     +};
285     +/**
286     + * hid_validate_values - validate existing device report's value indexes
287     + *
288     + * @device: hid device
289     + * @type: which report type to examine
290     + * @id: which report ID to examine (0 for first)
291     + * @field_index: which report field to examine
292     + * @report_counts: expected number of values
293     + *
294     + * Validate the number of values in a given field of a given report, after
295     + * parsing.
296     + */
297     +struct hid_report *hid_validate_values(struct hid_device *hid,
298     + unsigned int type, unsigned int id,
299     + unsigned int field_index,
300     + unsigned int report_counts)
301     +{
302     + struct hid_report *report;
303     +
304     + if (type > HID_FEATURE_REPORT) {
305     + hid_err(hid, "invalid HID report type %u\n", type);
306     + return NULL;
307     + }
308     +
309     + if (id >= HID_MAX_IDS) {
310     + hid_err(hid, "invalid HID report id %u\n", id);
311     + return NULL;
312     + }
313     +
314     + /*
315     + * Explicitly not using hid_get_report() here since it depends on
316     + * ->numbered being checked, which may not always be the case when
317     + * drivers go to access report values.
318     + */
319     + report = hid->report_enum[type].report_id_hash[id];
320     + if (!report) {
321     + hid_err(hid, "missing %s %u\n", hid_report_names[type], id);
322     + return NULL;
323     + }
324     + if (report->maxfield <= field_index) {
325     + hid_err(hid, "not enough fields in %s %u\n",
326     + hid_report_names[type], id);
327     + return NULL;
328     + }
329     + if (report->field[field_index]->report_count < report_counts) {
330     + hid_err(hid, "not enough values in %s %u field %u\n",
331     + hid_report_names[type], id, field_index);
332     + return NULL;
333     + }
334     + return report;
335     +}
336     +EXPORT_SYMBOL_GPL(hid_validate_values);
337     +
338     /**
339     * hid_match_report - check if driver's raw_event should be called
340     *
341     diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
342     index 73b67ab..2652846 100644
343     --- a/drivers/hid/hid-logitech-dj.c
344     +++ b/drivers/hid/hid-logitech-dj.c
345     @@ -454,7 +454,7 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
346     struct hid_report *report;
347     struct hid_report_enum *output_report_enum;
348     u8 *data = (u8 *)(&dj_report->device_index);
349     - int i;
350     + unsigned int i;
351    
352     output_report_enum = &hdev->report_enum[HID_OUTPUT_REPORT];
353     report = output_report_enum->report_id_hash[REPORT_ID_DJ_SHORT];
354     @@ -464,7 +464,7 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
355     return -ENODEV;
356     }
357    
358     - for (i = 0; i < report->field[0]->report_count; i++)
359     + for (i = 0; i < DJREPORT_SHORT_LENGTH - 1; i++)
360     report->field[0]->value[i] = data[i];
361    
362     usbhid_submit_report(hdev, report, USB_DIR_OUT);
363     @@ -783,6 +783,12 @@ static int logi_dj_probe(struct hid_device *hdev,
364     goto hid_parse_fail;
365     }
366    
367     + if (!hid_validate_values(hdev, HID_OUTPUT_REPORT, REPORT_ID_DJ_SHORT,
368     + 0, DJREPORT_SHORT_LENGTH - 1)) {
369     + retval = -ENODEV;
370     + goto hid_parse_fail;
371     + }
372     +
373     /* Starts the usb device and connects to upper interfaces hiddev and
374     * hidraw */
375     retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
376     diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c
377     index f6ba81d..f348f7f 100644
378     --- a/drivers/hid/hid-zpff.c
379     +++ b/drivers/hid/hid-zpff.c
380     @@ -70,21 +70,13 @@ static int zpff_init(struct hid_device *hid)
381     struct hid_report *report;
382     struct hid_input *hidinput = list_entry(hid->inputs.next,
383     struct hid_input, list);
384     - struct list_head *report_list =
385     - &hid->report_enum[HID_OUTPUT_REPORT].report_list;
386     struct input_dev *dev = hidinput->input;
387     - int error;
388     + int i, error;
389    
390     - if (list_empty(report_list)) {
391     - hid_err(hid, "no output report found\n");
392     - return -ENODEV;
393     - }
394     -
395     - report = list_entry(report_list->next, struct hid_report, list);
396     -
397     - if (report->maxfield < 4) {
398     - hid_err(hid, "not enough fields in report\n");
399     - return -ENODEV;
400     + for (i = 0; i < 4; i++) {
401     + report = hid_validate_values(hid, HID_OUTPUT_REPORT, 0, i, 1);
402     + if (!report)
403     + return -ENODEV;
404     }
405    
406     zpff = kzalloc(sizeof(struct zpff_device), GFP_KERNEL);
407     diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
408     index 7b3c068..62311ad 100644
409     --- a/drivers/net/ethernet/sfc/rx.c
410     +++ b/drivers/net/ethernet/sfc/rx.c
411     @@ -311,8 +311,9 @@ static void efx_resurrect_rx_buffer(struct efx_rx_queue *rx_queue,
412    
413     index = rx_queue->added_count & rx_queue->ptr_mask;
414     new_buf = efx_rx_buffer(rx_queue, index);
415     - new_buf->dma_addr = rx_buf->dma_addr ^ (PAGE_SIZE >> 1);
416     new_buf->u.page = rx_buf->u.page;
417     + new_buf->page_offset = rx_buf->page_offset ^ (PAGE_SIZE >> 1);
418     + new_buf->dma_addr = state->dma_addr + new_buf->page_offset;
419     new_buf->len = rx_buf->len;
420     new_buf->flags = EFX_RX_BUF_PAGE;
421     ++rx_queue->added_count;
422     diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
423     index 425e201..1db819b 100644
424     --- a/drivers/net/usb/cdc_ether.c
425     +++ b/drivers/net/usb/cdc_ether.c
426     @@ -618,6 +618,11 @@ static const struct usb_device_id products [] = {
427     .bInterfaceProtocol = USB_CDC_PROTO_NONE,
428     .driver_info = (unsigned long)&wwan_info,
429     }, {
430     + /* Telit modules */
431     + USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,
432     + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
433     + .driver_info = (kernel_ulong_t) &wwan_info,
434     +}, {
435     USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
436     USB_CDC_PROTO_NONE),
437     .driver_info = (unsigned long) &cdc_info,
438     diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
439     index 72cb121..8ff177d 100644
440     --- a/drivers/net/wireless/rt2x00/rt2800lib.c
441     +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
442     @@ -2161,6 +2161,13 @@ static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev)
443     int i;
444    
445     /*
446     + * First check if temperature compensation is supported.
447     + */
448     + rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom);
449     + if (!rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX_ALC))
450     + return 0;
451     +
452     + /*
453     * Read TSSI boundaries for temperature compensation from
454     * the EEPROM.
455     *
456     diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
457     index a506360..0c2f912 100644
458     --- a/fs/notify/fanotify/fanotify.c
459     +++ b/fs/notify/fanotify/fanotify.c
460     @@ -18,6 +18,12 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new)
461     old->tgid == new->tgid) {
462     switch (old->data_type) {
463     case (FSNOTIFY_EVENT_PATH):
464     +#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
465     + /* dont merge two permission events */
466     + if ((old->mask & FAN_ALL_PERM_EVENTS) &&
467     + (new->mask & FAN_ALL_PERM_EVENTS))
468     + return false;
469     +#endif
470     if ((old->path.mnt == new->path.mnt) &&
471     (old->path.dentry == new->path.dentry))
472     return true;
473     diff --git a/include/linux/hid.h b/include/linux/hid.h
474     index 8c933a8..3572ecd 100644
475     --- a/include/linux/hid.h
476     +++ b/include/linux/hid.h
477     @@ -737,6 +737,10 @@ void hid_output_report(struct hid_report *report, __u8 *data);
478     struct hid_device *hid_allocate_device(void);
479     struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
480     int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
481     +struct hid_report *hid_validate_values(struct hid_device *hid,
482     + unsigned int type, unsigned int id,
483     + unsigned int field_index,
484     + unsigned int report_counts);
485     int hid_check_keys_pressed(struct hid_device *hid);
486     int hid_connect(struct hid_device *hid, unsigned int connect_mask);
487     void hid_disconnect(struct hid_device *hid);
488     diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
489     index 89fb74e..e45ffad 100644
490     --- a/include/linux/perf_event.h
491     +++ b/include/linux/perf_event.h
492     @@ -1063,7 +1063,7 @@ struct perf_cpu_context {
493     int exclusive;
494     struct list_head rotation_list;
495     int jiffies_interval;
496     - struct pmu *active_pmu;
497     + struct pmu *unique_pmu;
498     struct perf_cgroup *cgrp;
499     };
500    
501     diff --git a/kernel/cgroup.c b/kernel/cgroup.c
502     index 4eb1ed3..519c252 100644
503     --- a/kernel/cgroup.c
504     +++ b/kernel/cgroup.c
505     @@ -3476,6 +3476,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
506     const char *buffer)
507     {
508     struct cgroup_event *event = NULL;
509     + struct cgroup *cgrp_cfile;
510     unsigned int efd, cfd;
511     struct file *efile = NULL;
512     struct file *cfile = NULL;
513     @@ -3531,6 +3532,16 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
514     goto fail;
515     }
516    
517     + /*
518     + * The file to be monitored must be in the same cgroup as
519     + * cgroup.event_control is.
520     + */
521     + cgrp_cfile = __d_cgrp(cfile->f_dentry->d_parent);
522     + if (cgrp_cfile != cgrp) {
523     + ret = -EINVAL;
524     + goto fail;
525     + }
526     +
527     if (!event->cft->register_event || !event->cft->unregister_event) {
528     ret = -EINVAL;
529     goto fail;
530     diff --git a/kernel/events/core.c b/kernel/events/core.c
531     index 8e810ba..8e82398 100644
532     --- a/kernel/events/core.c
533     +++ b/kernel/events/core.c
534     @@ -368,6 +368,8 @@ void perf_cgroup_switch(struct task_struct *task, int mode)
535    
536     list_for_each_entry_rcu(pmu, &pmus, entry) {
537     cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
538     + if (cpuctx->unique_pmu != pmu)
539     + continue; /* ensure we process each cpuctx once */
540    
541     /*
542     * perf_cgroup_events says at least one
543     @@ -391,9 +393,10 @@ void perf_cgroup_switch(struct task_struct *task, int mode)
544    
545     if (mode & PERF_CGROUP_SWIN) {
546     WARN_ON_ONCE(cpuctx->cgrp);
547     - /* set cgrp before ctxsw in to
548     - * allow event_filter_match() to not
549     - * have to pass task around
550     + /*
551     + * set cgrp before ctxsw in to allow
552     + * event_filter_match() to not have to pass
553     + * task around
554     */
555     cpuctx->cgrp = perf_cgroup_from_task(task);
556     cpu_ctx_sched_in(cpuctx, EVENT_ALL, task);
557     @@ -4332,7 +4335,7 @@ static void perf_event_task_event(struct perf_task_event *task_event)
558     rcu_read_lock();
559     list_for_each_entry_rcu(pmu, &pmus, entry) {
560     cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
561     - if (cpuctx->active_pmu != pmu)
562     + if (cpuctx->unique_pmu != pmu)
563     goto next;
564     perf_event_task_ctx(&cpuctx->ctx, task_event);
565    
566     @@ -4478,7 +4481,7 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)
567     rcu_read_lock();
568     list_for_each_entry_rcu(pmu, &pmus, entry) {
569     cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
570     - if (cpuctx->active_pmu != pmu)
571     + if (cpuctx->unique_pmu != pmu)
572     goto next;
573     perf_event_comm_ctx(&cpuctx->ctx, comm_event);
574    
575     @@ -4674,7 +4677,7 @@ got_name:
576     rcu_read_lock();
577     list_for_each_entry_rcu(pmu, &pmus, entry) {
578     cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
579     - if (cpuctx->active_pmu != pmu)
580     + if (cpuctx->unique_pmu != pmu)
581     goto next;
582     perf_event_mmap_ctx(&cpuctx->ctx, mmap_event,
583     vma->vm_flags & VM_EXEC);
584     @@ -5750,8 +5753,8 @@ static void update_pmu_context(struct pmu *pmu, struct pmu *old_pmu)
585    
586     cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu);
587    
588     - if (cpuctx->active_pmu == old_pmu)
589     - cpuctx->active_pmu = pmu;
590     + if (cpuctx->unique_pmu == old_pmu)
591     + cpuctx->unique_pmu = pmu;
592     }
593     }
594    
595     @@ -5886,7 +5889,7 @@ skip_type:
596     cpuctx->ctx.pmu = pmu;
597     cpuctx->jiffies_interval = 1;
598     INIT_LIST_HEAD(&cpuctx->rotation_list);
599     - cpuctx->active_pmu = pmu;
600     + cpuctx->unique_pmu = pmu;
601     }
602    
603     got_cpu_context:
604     diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
605     index da4512f..33c8b60 100644
606     --- a/kernel/sched/fair.c
607     +++ b/kernel/sched/fair.c
608     @@ -5190,11 +5190,15 @@ static void task_fork_fair(struct task_struct *p)
609     cfs_rq = task_cfs_rq(current);
610     curr = cfs_rq->curr;
611    
612     - if (unlikely(task_cpu(p) != this_cpu)) {
613     - rcu_read_lock();
614     - __set_task_cpu(p, this_cpu);
615     - rcu_read_unlock();
616     - }
617     + /*
618     + * Not only the cpu but also the task_group of the parent might have
619     + * been changed after parent->se.parent,cfs_rq were copied to
620     + * child->se.parent,cfs_rq. So call __set_task_cpu() to make those
621     + * of child point to valid ones.
622     + */
623     + rcu_read_lock();
624     + __set_task_cpu(p, this_cpu);
625     + rcu_read_unlock();
626    
627     update_curr(cfs_rq);
628    
629     diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
630     index 2fdb05d..1ff51c9 100644
631     --- a/net/sctp/sm_sideeffect.c
632     +++ b/net/sctp/sm_sideeffect.c
633     @@ -1610,9 +1610,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
634     asoc->outqueue.outstanding_bytes;
635     sackh.num_gap_ack_blocks = 0;
636     sackh.num_dup_tsns = 0;
637     - chunk->subh.sack_hdr = &sackh;
638     sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK,
639     - SCTP_CHUNK(chunk));
640     + SCTP_SACKH(&sackh));
641     break;
642    
643     case SCTP_CMD_DISCARD_PACKET:
644     diff --git a/scripts/kernel-doc b/scripts/kernel-doc
645     index 9b0c0b8..55ab5e4 100755
646     --- a/scripts/kernel-doc
647     +++ b/scripts/kernel-doc
648     @@ -2045,6 +2045,9 @@ sub process_file($) {
649    
650     $section_counter = 0;
651     while (<IN>) {
652     + while (s/\\\s*$//) {
653     + $_ .= <IN>;
654     + }
655     if ($state == 0) {
656     if (/$doc_start/o) {
657     $state = 1; # next line is always the function name
658     diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
659     index 9593f27..5f5080f 100644
660     --- a/tools/perf/util/map.c
661     +++ b/tools/perf/util/map.c
662     @@ -16,6 +16,7 @@ const char *map_type__name[MAP__NR_TYPES] = {
663     static inline int is_anon_memory(const char *filename)
664     {
665     return !strcmp(filename, "//anon") ||
666     + !strcmp(filename, "/dev/zero (deleted)") ||
667     !strcmp(filename, "/anon_hugepage (deleted)");
668     }
669