Skip to content

Commit 2e67ba5

Browse files
author
Alex Shi
committed
Merge tag 'v3.18.45' into linux-linaro-lsk-v3.18
This is the 3.18.45 stable release
2 parents e5dd309 + ac3d826 commit 2e67ba5

File tree

46 files changed

+286
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+286
-143
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 3
22
PATCHLEVEL = 18
3-
SUBLEVEL = 44
3+
SUBLEVEL = 45
44
EXTRAVERSION =
55
NAME = Diseased Newt
66

@@ -610,6 +610,8 @@ all: vmlinux
610610
include $(srctree)/arch/$(SRCARCH)/Makefile
611611

612612
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
613+
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
614+
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
613615

614616
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
615617
KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)

arch/mips/kvm/emulate.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -752,15 +752,15 @@ enum emulation_result kvm_mips_emul_eret(struct kvm_vcpu *vcpu)
752752
struct mips_coproc *cop0 = vcpu->arch.cop0;
753753
enum emulation_result er = EMULATE_DONE;
754754

755-
if (kvm_read_c0_guest_status(cop0) & ST0_EXL) {
755+
if (kvm_read_c0_guest_status(cop0) & ST0_ERL) {
756+
kvm_clear_c0_guest_status(cop0, ST0_ERL);
757+
vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0);
758+
} else if (kvm_read_c0_guest_status(cop0) & ST0_EXL) {
756759
kvm_debug("[%#lx] ERET to %#lx\n", vcpu->arch.pc,
757760
kvm_read_c0_guest_epc(cop0));
758761
kvm_clear_c0_guest_status(cop0, ST0_EXL);
759762
vcpu->arch.pc = kvm_read_c0_guest_epc(cop0);
760763

761-
} else if (kvm_read_c0_guest_status(cop0) & ST0_ERL) {
762-
kvm_clear_c0_guest_status(cop0, ST0_ERL);
763-
vcpu->arch.pc = kvm_read_c0_guest_errorepc(cop0);
764764
} else {
765765
kvm_err("[%#lx] ERET when MIPS_SR_EXL|MIPS_SR_ERL == 0\n",
766766
vcpu->arch.pc);

arch/parisc/kernel/syscall.S

+9-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ linux_gateway_entry:
106106
mtsp %r0,%sr4 /* get kernel space into sr4 */
107107
mtsp %r0,%sr5 /* get kernel space into sr5 */
108108
mtsp %r0,%sr6 /* get kernel space into sr6 */
109-
mfsp %sr7,%r1 /* save user sr7 */
110-
mtsp %r1,%sr3 /* and store it in sr3 */
111109

112110
#ifdef CONFIG_64BIT
113111
/* for now we can *always* set the W bit on entry to the syscall
@@ -133,6 +131,14 @@ linux_gateway_entry:
133131
depdi 0, 31, 32, %r21
134132
1:
135133
#endif
134+
135+
/* We use a rsm/ssm pair to prevent sr3 from being clobbered
136+
* by external interrupts.
137+
*/
138+
mfsp %sr7,%r1 /* save user sr7 */
139+
rsm PSW_SM_I, %r0 /* disable interrupts */
140+
mtsp %r1,%sr3 /* and store it in sr3 */
141+
136142
mfctl %cr30,%r1
137143
xor %r1,%r30,%r30 /* ye olde xor trick */
138144
xor %r1,%r30,%r1
@@ -147,6 +153,7 @@ linux_gateway_entry:
147153
*/
148154

149155
mtsp %r0,%sr7 /* get kernel space into sr7 */
156+
ssm PSW_SM_I, %r0 /* enable interrupts */
150157
STREGM %r1,FRAME_SIZE(%r30) /* save r1 (usp) here for now */
151158
mfctl %cr30,%r1 /* get task ptr in %r1 */
152159
LDREG TI_TASK(%r1),%r1

arch/powerpc/kernel/idle_power7.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
std r0,0(r1); \
2929
ptesync; \
3030
ld r0,0(r1); \
31-
1: cmp cr0,r0,r0; \
31+
1: cmpd cr0,r0,r0; \
3232
bne 1b; \
3333
IDLE_INST; \
3434
b .

arch/powerpc/mm/copro_fault.c

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
102102
switch (REGION_ID(ea)) {
103103
case USER_REGION_ID:
104104
pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea);
105+
if (mm == NULL)
106+
return 1;
105107
psize = get_slice_psize(mm, ea);
106108
ssize = user_segment_size(ea);
107109
vsid = get_vsid(mm->context.id, ea, ssize);

drivers/char/virtio_console.c

+16-6
Original file line numberDiff line numberDiff line change
@@ -1532,19 +1532,29 @@ static void remove_port_data(struct port *port)
15321532
spin_lock_irq(&port->inbuf_lock);
15331533
/* Remove unused data this port might have received. */
15341534
discard_port_data(port);
1535+
spin_unlock_irq(&port->inbuf_lock);
15351536

15361537
/* Remove buffers we queued up for the Host to send us data in. */
1537-
while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
1538-
free_buf(buf, true);
1539-
spin_unlock_irq(&port->inbuf_lock);
1538+
do {
1539+
spin_lock_irq(&port->inbuf_lock);
1540+
buf = virtqueue_detach_unused_buf(port->in_vq);
1541+
spin_unlock_irq(&port->inbuf_lock);
1542+
if (buf)
1543+
free_buf(buf, true);
1544+
} while (buf);
15401545

15411546
spin_lock_irq(&port->outvq_lock);
15421547
reclaim_consumed_buffers(port);
1548+
spin_unlock_irq(&port->outvq_lock);
15431549

15441550
/* Free pending buffers from the out-queue. */
1545-
while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
1546-
free_buf(buf, true);
1547-
spin_unlock_irq(&port->outvq_lock);
1551+
do {
1552+
spin_lock_irq(&port->outvq_lock);
1553+
buf = virtqueue_detach_unused_buf(port->out_vq);
1554+
spin_unlock_irq(&port->outvq_lock);
1555+
if (buf)
1556+
free_buf(buf, true);
1557+
} while (buf);
15481558
}
15491559

15501560
/*

drivers/firewire/net.c

+39-20
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ struct rfc2734_header {
7373

7474
#define fwnet_get_hdr_lf(h) (((h)->w0 & 0xc0000000) >> 30)
7575
#define fwnet_get_hdr_ether_type(h) (((h)->w0 & 0x0000ffff))
76-
#define fwnet_get_hdr_dg_size(h) (((h)->w0 & 0x0fff0000) >> 16)
76+
#define fwnet_get_hdr_dg_size(h) ((((h)->w0 & 0x0fff0000) >> 16) + 1)
7777
#define fwnet_get_hdr_fg_off(h) (((h)->w0 & 0x00000fff))
7878
#define fwnet_get_hdr_dgl(h) (((h)->w1 & 0xffff0000) >> 16)
7979

80-
#define fwnet_set_hdr_lf(lf) ((lf) << 30)
80+
#define fwnet_set_hdr_lf(lf) ((lf) << 30)
8181
#define fwnet_set_hdr_ether_type(et) (et)
82-
#define fwnet_set_hdr_dg_size(dgs) ((dgs) << 16)
82+
#define fwnet_set_hdr_dg_size(dgs) (((dgs) - 1) << 16)
8383
#define fwnet_set_hdr_fg_off(fgo) (fgo)
8484

8585
#define fwnet_set_hdr_dgl(dgl) ((dgl) << 16)
@@ -591,6 +591,9 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
591591
int retval;
592592
u16 ether_type;
593593

594+
if (len <= RFC2374_UNFRAG_HDR_SIZE)
595+
return 0;
596+
594597
hdr.w0 = be32_to_cpu(buf[0]);
595598
lf = fwnet_get_hdr_lf(&hdr);
596599
if (lf == RFC2374_HDR_UNFRAG) {
@@ -615,7 +618,12 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
615618
return fwnet_finish_incoming_packet(net, skb, source_node_id,
616619
is_broadcast, ether_type);
617620
}
621+
618622
/* A datagram fragment has been received, now the fun begins. */
623+
624+
if (len <= RFC2374_FRAG_HDR_SIZE)
625+
return 0;
626+
619627
hdr.w1 = ntohl(buf[1]);
620628
buf += 2;
621629
len -= RFC2374_FRAG_HDR_SIZE;
@@ -627,7 +635,10 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
627635
fg_off = fwnet_get_hdr_fg_off(&hdr);
628636
}
629637
datagram_label = fwnet_get_hdr_dgl(&hdr);
630-
dg_size = fwnet_get_hdr_dg_size(&hdr); /* ??? + 1 */
638+
dg_size = fwnet_get_hdr_dg_size(&hdr);
639+
640+
if (fg_off + len > dg_size)
641+
return 0;
631642

632643
spin_lock_irqsave(&dev->lock, flags);
633644

@@ -735,6 +746,22 @@ static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r,
735746
fw_send_response(card, r, rcode);
736747
}
737748

749+
static int gasp_source_id(__be32 *p)
750+
{
751+
return be32_to_cpu(p[0]) >> 16;
752+
}
753+
754+
static u32 gasp_specifier_id(__be32 *p)
755+
{
756+
return (be32_to_cpu(p[0]) & 0xffff) << 8 |
757+
(be32_to_cpu(p[1]) & 0xff000000) >> 24;
758+
}
759+
760+
static u32 gasp_version(__be32 *p)
761+
{
762+
return be32_to_cpu(p[1]) & 0xffffff;
763+
}
764+
738765
static void fwnet_receive_broadcast(struct fw_iso_context *context,
739766
u32 cycle, size_t header_length, void *header, void *data)
740767
{
@@ -744,9 +771,6 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
744771
__be32 *buf_ptr;
745772
int retval;
746773
u32 length;
747-
u16 source_node_id;
748-
u32 specifier_id;
749-
u32 ver;
750774
unsigned long offset;
751775
unsigned long flags;
752776

@@ -763,22 +787,17 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
763787

764788
spin_unlock_irqrestore(&dev->lock, flags);
765789

766-
specifier_id = (be32_to_cpu(buf_ptr[0]) & 0xffff) << 8
767-
| (be32_to_cpu(buf_ptr[1]) & 0xff000000) >> 24;
768-
ver = be32_to_cpu(buf_ptr[1]) & 0xffffff;
769-
source_node_id = be32_to_cpu(buf_ptr[0]) >> 16;
770-
771-
if (specifier_id == IANA_SPECIFIER_ID &&
772-
(ver == RFC2734_SW_VERSION
790+
if (length > IEEE1394_GASP_HDR_SIZE &&
791+
gasp_specifier_id(buf_ptr) == IANA_SPECIFIER_ID &&
792+
(gasp_version(buf_ptr) == RFC2734_SW_VERSION
773793
#if IS_ENABLED(CONFIG_IPV6)
774-
|| ver == RFC3146_SW_VERSION
794+
|| gasp_version(buf_ptr) == RFC3146_SW_VERSION
775795
#endif
776-
)) {
777-
buf_ptr += 2;
778-
length -= IEEE1394_GASP_HDR_SIZE;
779-
fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
796+
))
797+
fwnet_incoming_packet(dev, buf_ptr + 2,
798+
length - IEEE1394_GASP_HDR_SIZE,
799+
gasp_source_id(buf_ptr),
780800
context->card->generation, true);
781-
}
782801

783802
packet.payload_length = dev->rcv_buffer_size;
784803
packet.interrupt = 1;

drivers/gpu/drm/radeon/ni.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1339,9 +1339,7 @@ static void cayman_pcie_gart_fini(struct radeon_device *rdev)
13391339
void cayman_cp_int_cntl_setup(struct radeon_device *rdev,
13401340
int ring, u32 cp_int_cntl)
13411341
{
1342-
u32 srbm_gfx_cntl = RREG32(SRBM_GFX_CNTL) & ~3;
1343-
1344-
WREG32(SRBM_GFX_CNTL, srbm_gfx_cntl | (ring & 3));
1342+
WREG32(SRBM_GFX_CNTL, RINGID(ring));
13451343
WREG32(CP_INT_CNTL, cp_int_cntl);
13461344
}
13471345

drivers/gpu/drm/radeon/r600_dpm.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,20 @@ u32 r600_dpm_get_vblank_time(struct radeon_device *rdev)
156156
struct drm_device *dev = rdev->ddev;
157157
struct drm_crtc *crtc;
158158
struct radeon_crtc *radeon_crtc;
159-
u32 line_time_us, vblank_lines;
159+
u32 vblank_in_pixels;
160160
u32 vblank_time_us = 0xffffffff; /* if the displays are off, vblank time is max */
161161

162162
if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {
163163
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
164164
radeon_crtc = to_radeon_crtc(crtc);
165165
if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
166-
line_time_us = (radeon_crtc->hw_mode.crtc_htotal * 1000) /
167-
radeon_crtc->hw_mode.clock;
168-
vblank_lines = radeon_crtc->hw_mode.crtc_vblank_end -
169-
radeon_crtc->hw_mode.crtc_vdisplay +
170-
(radeon_crtc->v_border * 2);
171-
vblank_time_us = vblank_lines * line_time_us;
166+
vblank_in_pixels =
167+
radeon_crtc->hw_mode.crtc_htotal *
168+
(radeon_crtc->hw_mode.crtc_vblank_end -
169+
radeon_crtc->hw_mode.crtc_vdisplay +
170+
(radeon_crtc->v_border * 2));
171+
172+
vblank_time_us = vblank_in_pixels * 1000 / radeon_crtc->hw_mode.clock;
172173
break;
173174
}
174175
}

drivers/gpu/drm/radeon/si_dpm.c

+43-4
Original file line numberDiff line numberDiff line change
@@ -2945,6 +2945,49 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
29452945
int i;
29462946
struct si_dpm_quirk *p = si_dpm_quirk_list;
29472947

2948+
/* limit all SI kickers */
2949+
if (rdev->family == CHIP_PITCAIRN) {
2950+
if ((rdev->pdev->revision == 0x81) ||
2951+
(rdev->pdev->device == 0x6810) ||
2952+
(rdev->pdev->device == 0x6811) ||
2953+
(rdev->pdev->device == 0x6816) ||
2954+
(rdev->pdev->device == 0x6817) ||
2955+
(rdev->pdev->device == 0x6806))
2956+
max_mclk = 120000;
2957+
} else if (rdev->family == CHIP_VERDE) {
2958+
if ((rdev->pdev->revision == 0x81) ||
2959+
(rdev->pdev->revision == 0x83) ||
2960+
(rdev->pdev->revision == 0x87) ||
2961+
(rdev->pdev->device == 0x6820) ||
2962+
(rdev->pdev->device == 0x6821) ||
2963+
(rdev->pdev->device == 0x6822) ||
2964+
(rdev->pdev->device == 0x6823) ||
2965+
(rdev->pdev->device == 0x682A) ||
2966+
(rdev->pdev->device == 0x682B)) {
2967+
max_sclk = 75000;
2968+
max_mclk = 80000;
2969+
}
2970+
} else if (rdev->family == CHIP_OLAND) {
2971+
if ((rdev->pdev->revision == 0xC7) ||
2972+
(rdev->pdev->revision == 0x80) ||
2973+
(rdev->pdev->revision == 0x81) ||
2974+
(rdev->pdev->revision == 0x83) ||
2975+
(rdev->pdev->device == 0x6604) ||
2976+
(rdev->pdev->device == 0x6605)) {
2977+
max_sclk = 75000;
2978+
max_mclk = 80000;
2979+
}
2980+
} else if (rdev->family == CHIP_HAINAN) {
2981+
if ((rdev->pdev->revision == 0x81) ||
2982+
(rdev->pdev->revision == 0x83) ||
2983+
(rdev->pdev->revision == 0xC3) ||
2984+
(rdev->pdev->device == 0x6664) ||
2985+
(rdev->pdev->device == 0x6665) ||
2986+
(rdev->pdev->device == 0x6667)) {
2987+
max_sclk = 75000;
2988+
max_mclk = 80000;
2989+
}
2990+
}
29482991
/* Apply dpm quirks */
29492992
while (p && p->chip_device != 0) {
29502993
if (rdev->pdev->vendor == p->chip_vendor &&
@@ -2957,10 +3000,6 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
29573000
}
29583001
++p;
29593002
}
2960-
/* limit mclk on all R7 370 parts for stability */
2961-
if (rdev->pdev->device == 0x6811 &&
2962-
rdev->pdev->revision == 0x81)
2963-
max_mclk = 120000;
29643003

29653004
if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
29663005
ni_dpm_vblank_too_short(rdev))

drivers/hv/hv_util.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,14 @@ static void heartbeat_onchannelcallback(void *context)
283283
u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
284284
struct icmsg_negotiate *negop = NULL;
285285

286-
vmbus_recvpacket(channel, hbeat_txf_buf,
287-
PAGE_SIZE, &recvlen, &requestid);
286+
while (1) {
287+
288+
vmbus_recvpacket(channel, hbeat_txf_buf,
289+
PAGE_SIZE, &recvlen, &requestid);
290+
291+
if (!recvlen)
292+
break;
288293

289-
if (recvlen > 0) {
290294
icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[
291295
sizeof(struct vmbuspipe_hdr)];
292296

drivers/input/serio/i8042-x86ia64io.h

+7
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,13 @@ static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
783783
DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
784784
},
785785
},
786+
{
787+
/* Schenker XMG C504 - Elantech touchpad */
788+
.matches = {
789+
DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
790+
DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
791+
},
792+
},
786793
{ }
787794
};
788795

drivers/irqchip/irq-gic-v3.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void gic_enable_redist(bool enable)
180180
return; /* No PM support in this redistributor */
181181
}
182182

183-
while (count--) {
183+
while (--count) {
184184
val = readl_relaxed(rbase + GICR_WAKER);
185185
if (enable ^ (val & GICR_WAKER_ChildrenAsleep))
186186
break;

0 commit comments

Comments
 (0)