Skip to content

Commit d75f665

Browse files
committed
Merge Linux 4.4.257 into 11
Changes in 4.4.257 net_sched: reject silly cell_log in qdisc_get_rtab() futex,rt_mutex: Provide futex specific rt_mutex API futex: Remove rt_mutex_deadlock_account_*() futex: Rework inconsistent rt_mutex/futex_q state futex: Avoid violating the 10th rule of futex futex: Replace pointless printk in fixup_owner() futex: Provide and use pi_state_update_owner() rtmutex: Remove unused argument from rt_mutex_proxy_unlock() futex: Use pi_state_update_owner() in put_pi_state() futex: Simplify fixup_pi_state_owner() futex: Handle faults correctly for PI futexes usb: udc: core: Use lock when write to soft_connect scsi: libfc: Avoid invoking response handler twice if ep is already completed scsi: ibmvfc: Set default timeout to avoid crash during migration stable: clamp SUBLEVEL in 4.4 and 4.9 USB: serial: cp210x: add pid/vid for WSDA-200-USB USB: serial: cp210x: add new VID/PID for supporting Teraoka AD2000 USB: serial: option: Adding support for Cinterion MV31 Input: i8042 - unbreak Pegatron C15B net: lapb: Copy the skb before sending a packet ELF/MIPS build fix elfcore: fix building with clang USB: gadget: legacy: fix an error code in eth_bind() USB: usblp: don't call usb_set_interface if there's a single alt usb: dwc2: Fix endpoint direction check in ep_from_windex mac80211: fix station rate table updates on assoc kretprobe: Avoid re-registration of the same kretprobe earlier cifs: report error instead of invalid when revalidating a dentry fails mmc: core: Limit retries when analyse of SDIO tuples fails ARM: footbridge: fix dc21285 PCI configuration accessors mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page mm: hugetlb: fix a race between isolating and freeing page mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active x86/build: Disable CET instrumentation in the kernel x86/apic: Add extra serialization for non-serializing MSRs Input: xpad - sync supported devices with fork on GitHub ACPI: thermal: Do not call acpi_thermal_check() directly ALSA: hda/realtek - Fix typo of pincfg for Dell quirk Linux 4.4.257
2 parents cd98287 + 831b119 commit d75f665

File tree

41 files changed

+468
-293
lines changed

Some content is hidden

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

41 files changed

+468
-293
lines changed

Makefile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = 4
22
PATCHLEVEL = 4
3-
SUBLEVEL = 256
3+
SUBLEVEL = 257
44
EXTRAVERSION =
55
NAME = Blurry Fish Butt
66

@@ -856,12 +856,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
856856
# Prohibit date/time macros, which would make the build non-deterministic
857857
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
858858

859-
# ensure -fcf-protection is disabled when using retpoline as it is
860-
# incompatible with -mindirect-branch=thunk-extern
861-
ifdef CONFIG_RETPOLINE
862-
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
863-
endif
864-
865859
# use the deterministic mode of AR if available
866860
KBUILD_ARFLAGS := $(call ar-option,D)
867861

@@ -1100,7 +1094,7 @@ endef
11001094

11011095
define filechk_version.h
11021096
(echo \#define LINUX_VERSION_CODE $(shell \
1103-
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
1097+
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255); \
11041098
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
11051099
endef
11061100

arch/arm/mach-footbridge/dc21285.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ dc21285_read_config(struct pci_bus *bus, unsigned int devfn, int where,
6969
if (addr)
7070
switch (size) {
7171
case 1:
72-
asm("ldrb %0, [%1, %2]"
72+
asm volatile("ldrb %0, [%1, %2]"
7373
: "=r" (v) : "r" (addr), "r" (where) : "cc");
7474
break;
7575
case 2:
76-
asm("ldrh %0, [%1, %2]"
76+
asm volatile("ldrh %0, [%1, %2]"
7777
: "=r" (v) : "r" (addr), "r" (where) : "cc");
7878
break;
7979
case 4:
80-
asm("ldr %0, [%1, %2]"
80+
asm volatile("ldr %0, [%1, %2]"
8181
: "=r" (v) : "r" (addr), "r" (where) : "cc");
8282
break;
8383
}
@@ -103,17 +103,17 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where,
103103
if (addr)
104104
switch (size) {
105105
case 1:
106-
asm("strb %0, [%1, %2]"
106+
asm volatile("strb %0, [%1, %2]"
107107
: : "r" (value), "r" (addr), "r" (where)
108108
: "cc");
109109
break;
110110
case 2:
111-
asm("strh %0, [%1, %2]"
111+
asm volatile("strh %0, [%1, %2]"
112112
: : "r" (value), "r" (addr), "r" (where)
113113
: "cc");
114114
break;
115115
case 4:
116-
asm("str %0, [%1, %2]"
116+
asm volatile("str %0, [%1, %2]"
117117
: : "r" (value), "r" (addr), "r" (where)
118118
: "cc");
119119
break;

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,6 +3049,7 @@ config MIPS32_N32
30493049
config BINFMT_ELF32
30503050
bool
30513051
default y if MIPS32_O32 || MIPS32_N32
3052+
select ELFCORE
30523053

30533054
endmenu
30543055

arch/x86/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ else
139139
KBUILD_CFLAGS += -mno-red-zone
140140
KBUILD_CFLAGS += -mcmodel=kernel
141141

142+
# Intel CET isn't enabled in the kernel
143+
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
144+
142145
# -funit-at-a-time shrinks the kernel .text considerably
143146
# unfortunately it makes reading oopses harder.
144147
KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)

arch/x86/include/asm/apic.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@ static inline void disable_local_APIC(void) { }
168168
#endif /* !CONFIG_X86_LOCAL_APIC */
169169

170170
#ifdef CONFIG_X86_X2APIC
171-
/*
172-
* Make previous memory operations globally visible before
173-
* sending the IPI through x2apic wrmsr. We need a serializing instruction or
174-
* mfence for this.
175-
*/
176-
static inline void x2apic_wrmsr_fence(void)
177-
{
178-
asm volatile("mfence" : : : "memory");
179-
}
180-
181171
static inline void native_apic_msr_write(u32 reg, u32 v)
182172
{
183173
if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||

arch/x86/include/asm/barrier.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,22 @@ do { \
119119
#define smp_mb__before_atomic() do { } while (0)
120120
#define smp_mb__after_atomic() do { } while (0)
121121

122+
/*
123+
* Make previous memory operations globally visible before
124+
* a WRMSR.
125+
*
126+
* MFENCE makes writes visible, but only affects load/store
127+
* instructions. WRMSR is unfortunately not a load/store
128+
* instruction and is unaffected by MFENCE. The LFENCE ensures
129+
* that the WRMSR is not reordered.
130+
*
131+
* Most WRMSRs are full serializing instructions themselves and
132+
* do not require this barrier. This is only required for the
133+
* IA32_TSC_DEADLINE and X2APIC MSRs.
134+
*/
135+
static inline void weak_wrmsr_fence(void)
136+
{
137+
asm volatile("mfence; lfence" : : : "memory");
138+
}
139+
122140
#endif /* _ASM_X86_BARRIER_H */

arch/x86/kernel/apic/apic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <asm/x86_init.h>
4242
#include <asm/pgalloc.h>
4343
#include <linux/atomic.h>
44+
#include <asm/barrier.h>
4445
#include <asm/mpspec.h>
4546
#include <asm/i8259.h>
4647
#include <asm/proto.h>
@@ -464,6 +465,9 @@ static int lapic_next_deadline(unsigned long delta,
464465
{
465466
u64 tsc;
466467

468+
/* This MSR is special and need a special fence: */
469+
weak_wrmsr_fence();
470+
467471
tsc = rdtsc();
468472
wrmsrl(MSR_IA32_TSC_DEADLINE, tsc + (((u64) delta) * TSC_DIVISOR));
469473
return 0;

arch/x86/kernel/apic/x2apic_cluster.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
3232
unsigned long flags;
3333
u32 dest;
3434

35-
x2apic_wrmsr_fence();
35+
/* x2apic MSRs are special and need a special fence: */
36+
weak_wrmsr_fence();
3637

3738
local_irq_save(flags);
3839

arch/x86/kernel/apic/x2apic_phys.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
4343
unsigned long this_cpu;
4444
unsigned long flags;
4545

46-
x2apic_wrmsr_fence();
46+
/* x2apic MSRs are special and need a special fence: */
47+
weak_wrmsr_fence();
4748

4849
local_irq_save(flags);
4950

drivers/acpi/thermal.c

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ struct acpi_thermal {
188188
int tz_enabled;
189189
int kelvin_offset;
190190
struct work_struct thermal_check_work;
191+
struct mutex thermal_check_lock;
192+
atomic_t thermal_check_count;
191193
};
192194

193195
/* --------------------------------------------------------------------------
@@ -513,16 +515,6 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
513515
return 0;
514516
}
515517

516-
static void acpi_thermal_check(void *data)
517-
{
518-
struct acpi_thermal *tz = data;
519-
520-
if (!tz->tz_enabled)
521-
return;
522-
523-
thermal_zone_device_update(tz->thermal_zone);
524-
}
525-
526518
/* sys I/F for generic thermal sysfs support */
527519

528520
static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
@@ -556,6 +548,8 @@ static int thermal_get_mode(struct thermal_zone_device *thermal,
556548
return 0;
557549
}
558550

551+
static void acpi_thermal_check_fn(struct work_struct *work);
552+
559553
static int thermal_set_mode(struct thermal_zone_device *thermal,
560554
enum thermal_device_mode mode)
561555
{
@@ -581,7 +575,7 @@ static int thermal_set_mode(struct thermal_zone_device *thermal,
581575
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
582576
"%s kernel ACPI thermal control\n",
583577
tz->tz_enabled ? "Enable" : "Disable"));
584-
acpi_thermal_check(tz);
578+
acpi_thermal_check_fn(&tz->thermal_check_work);
585579
}
586580
return 0;
587581
}
@@ -950,6 +944,12 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
950944
Driver Interface
951945
-------------------------------------------------------------------------- */
952946

947+
static void acpi_queue_thermal_check(struct acpi_thermal *tz)
948+
{
949+
if (!work_pending(&tz->thermal_check_work))
950+
queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
951+
}
952+
953953
static void acpi_thermal_notify(struct acpi_device *device, u32 event)
954954
{
955955
struct acpi_thermal *tz = acpi_driver_data(device);
@@ -960,17 +960,17 @@ static void acpi_thermal_notify(struct acpi_device *device, u32 event)
960960

961961
switch (event) {
962962
case ACPI_THERMAL_NOTIFY_TEMPERATURE:
963-
acpi_thermal_check(tz);
963+
acpi_queue_thermal_check(tz);
964964
break;
965965
case ACPI_THERMAL_NOTIFY_THRESHOLDS:
966966
acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS);
967-
acpi_thermal_check(tz);
967+
acpi_queue_thermal_check(tz);
968968
acpi_bus_generate_netlink_event(device->pnp.device_class,
969969
dev_name(&device->dev), event, 0);
970970
break;
971971
case ACPI_THERMAL_NOTIFY_DEVICES:
972972
acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES);
973-
acpi_thermal_check(tz);
973+
acpi_queue_thermal_check(tz);
974974
acpi_bus_generate_netlink_event(device->pnp.device_class,
975975
dev_name(&device->dev), event, 0);
976976
break;
@@ -1070,7 +1070,27 @@ static void acpi_thermal_check_fn(struct work_struct *work)
10701070
{
10711071
struct acpi_thermal *tz = container_of(work, struct acpi_thermal,
10721072
thermal_check_work);
1073-
acpi_thermal_check(tz);
1073+
1074+
if (!tz->tz_enabled)
1075+
return;
1076+
/*
1077+
* In general, it is not sufficient to check the pending bit, because
1078+
* subsequent instances of this function may be queued after one of them
1079+
* has started running (e.g. if _TMP sleeps). Avoid bailing out if just
1080+
* one of them is running, though, because it may have done the actual
1081+
* check some time ago, so allow at least one of them to block on the
1082+
* mutex while another one is running the update.
1083+
*/
1084+
if (!atomic_add_unless(&tz->thermal_check_count, -1, 1))
1085+
return;
1086+
1087+
mutex_lock(&tz->thermal_check_lock);
1088+
1089+
thermal_zone_device_update(tz->thermal_zone);
1090+
1091+
atomic_inc(&tz->thermal_check_count);
1092+
1093+
mutex_unlock(&tz->thermal_check_lock);
10741094
}
10751095

10761096
static int acpi_thermal_add(struct acpi_device *device)
@@ -1102,6 +1122,8 @@ static int acpi_thermal_add(struct acpi_device *device)
11021122
if (result)
11031123
goto free_memory;
11041124

1125+
atomic_set(&tz->thermal_check_count, 3);
1126+
mutex_init(&tz->thermal_check_lock);
11051127
INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn);
11061128

11071129
pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device),
@@ -1167,7 +1189,7 @@ static int acpi_thermal_resume(struct device *dev)
11671189
tz->state.active |= tz->trips.active[i].flags.enabled;
11681190
}
11691191

1170-
queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work);
1192+
acpi_queue_thermal_check(tz);
11711193

11721194
return AE_OK;
11731195
}

0 commit comments

Comments
 (0)