Skip to content

Commit

Permalink
PATCH: kernel 4.4.189-190
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Aug 28, 2019
1 parent 1a60a6d commit d3f1be0
Show file tree
Hide file tree
Showing 78 changed files with 386 additions and 222 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 189
SUBLEVEL = 190
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-davinci/sleep.S
Expand Up @@ -37,6 +37,7 @@
#define DEEPSLEEP_SLEEPENABLE_BIT BIT(31)

.text
.arch armv5te
/*
* Move DaVinci into deep sleep state
*
Expand Down
7 changes: 4 additions & 3 deletions arch/arm64/kernel/hw_breakpoint.c
Expand Up @@ -548,13 +548,14 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
/* Aligned */
break;
case 1:
/* Allow single byte watchpoint. */
if (info->ctrl.len == ARM_BREAKPOINT_LEN_1)
break;
case 2:
/* Allow halfword watchpoints and breakpoints. */
if (info->ctrl.len == ARM_BREAKPOINT_LEN_2)
break;
case 3:
/* Allow single byte watchpoint. */
if (info->ctrl.len == ARM_BREAKPOINT_LEN_1)
break;
default:
return -EINVAL;
}
Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/hw_breakpoint.c
Expand Up @@ -160,6 +160,7 @@ int arch_bp_generic_fields(int sh_len, int sh_type,
switch (sh_type) {
case SH_BREAKPOINT_READ:
*gen_type = HW_BREAKPOINT_R;
break;
case SH_BREAKPOINT_WRITE:
*gen_type = HW_BREAKPOINT_W;
break;
Expand Down
1 change: 1 addition & 0 deletions arch/x86/boot/compressed/Makefile
Expand Up @@ -33,6 +33,7 @@ KBUILD_CFLAGS += $(cflags-y)
KBUILD_CFLAGS += -mno-mmx -mno-sse
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)

KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
GCOV_PROFILE := n
Expand Down
15 changes: 0 additions & 15 deletions arch/x86/entry/vdso/vclock_gettime.c
Expand Up @@ -13,7 +13,6 @@

#include <uapi/linux/time.h>
#include <asm/vgtod.h>
#include <asm/hpet.h>
#include <asm/vvar.h>
#include <asm/unistd.h>
#include <asm/msr.h>
Expand All @@ -26,16 +25,6 @@ extern int __vdso_clock_gettime(clockid_t clock, struct timespec *ts);
extern int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz);
extern time_t __vdso_time(time_t *t);

#ifdef CONFIG_HPET_TIMER
extern u8 hpet_page
__attribute__((visibility("hidden")));

static notrace cycle_t vread_hpet(void)
{
return *(const volatile u32 *)(&hpet_page + HPET_COUNTER);
}
#endif

#ifdef CONFIG_PARAVIRT_CLOCK
extern u8 pvclock_page
__attribute__((visibility("hidden")));
Expand Down Expand Up @@ -209,10 +198,6 @@ notrace static inline u64 vgetsns(int *mode)

if (gtod->vclock_mode == VCLOCK_TSC)
cycles = vread_tsc();
#ifdef CONFIG_HPET_TIMER
else if (gtod->vclock_mode == VCLOCK_HPET)
cycles = vread_hpet();
#endif
#ifdef CONFIG_PARAVIRT_CLOCK
else if (gtod->vclock_mode == VCLOCK_PVCLOCK)
cycles = vread_pvclock(mode);
Expand Down
5 changes: 2 additions & 3 deletions arch/x86/entry/vdso/vdso-layout.lds.S
Expand Up @@ -25,7 +25,7 @@ SECTIONS
* segment.
*/

vvar_start = . - 3 * PAGE_SIZE;
vvar_start = . - 2 * PAGE_SIZE;
vvar_page = vvar_start;

/* Place all vvars at the offsets in asm/vvar.h. */
Expand All @@ -35,8 +35,7 @@ SECTIONS
#undef __VVAR_KERNEL_LDS
#undef EMIT_VVAR

hpet_page = vvar_start + PAGE_SIZE;
pvclock_page = vvar_start + 2 * PAGE_SIZE;
pvclock_page = vvar_start + PAGE_SIZE;

. = SIZEOF_HEADERS;

Expand Down
3 changes: 1 addition & 2 deletions arch/x86/include/asm/clocksource.h
Expand Up @@ -5,8 +5,7 @@

#define VCLOCK_NONE 0 /* No vDSO clock available. */
#define VCLOCK_TSC 1 /* vDSO should use vread_tsc. */
#define VCLOCK_HPET 2 /* vDSO should use vread_hpet. */
#define VCLOCK_PVCLOCK 3 /* vDSO should use vread_pvclock. */
#define VCLOCK_PVCLOCK 2 /* vDSO should use vread_pvclock. */

struct arch_clocksource_data {
int vclock_mode;
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/hpet.c
Expand Up @@ -774,7 +774,6 @@ static struct clocksource clocksource_hpet = {
.mask = HPET_MASK,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.resume = hpet_resume_counter,
.archdata = { .vclock_mode = VCLOCK_HPET },
};

static int hpet_clocksource_register(void)
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/kvm/trace.h
Expand Up @@ -809,8 +809,7 @@ TRACE_EVENT(kvm_write_tsc_offset,

#define host_clocks \
{VCLOCK_NONE, "none"}, \
{VCLOCK_TSC, "tsc"}, \
{VCLOCK_HPET, "hpet"} \
{VCLOCK_TSC, "tsc"} \

TRACE_EVENT(kvm_update_master_clock,
TP_PROTO(bool use_master_clock, unsigned int host_clock, bool offset_matched),
Expand Down
15 changes: 6 additions & 9 deletions arch/x86/mm/fault.c
Expand Up @@ -216,13 +216,14 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)

pmd = pmd_offset(pud, address);
pmd_k = pmd_offset(pud_k, address);
if (!pmd_present(*pmd_k))
return NULL;

if (!pmd_present(*pmd))
if (pmd_present(*pmd) != pmd_present(*pmd_k))
set_pmd(pmd, *pmd_k);

if (!pmd_present(*pmd_k))
return NULL;
else
BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k));
BUG_ON(pmd_pfn(*pmd) != pmd_pfn(*pmd_k));

return pmd_k;
}
Expand All @@ -242,17 +243,13 @@ void vmalloc_sync_all(void)
spin_lock(&pgd_lock);
list_for_each_entry(page, &pgd_list, lru) {
spinlock_t *pgt_lock;
pmd_t *ret;

/* the pgt_lock only for Xen */
pgt_lock = &pgd_page_get_mm(page)->page_table_lock;

spin_lock(pgt_lock);
ret = vmalloc_sync_one(page_address(page), address);
vmalloc_sync_one(page_address(page), address);
spin_unlock(pgt_lock);

if (!ret)
break;
}
spin_unlock(&pgd_lock);
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/ata/libahci_platform.c
Expand Up @@ -300,6 +300,9 @@ static int ahci_platform_get_phy(struct ahci_host_priv *hpriv, u32 port,
hpriv->phys[port] = NULL;
rc = 0;
break;
case -EPROBE_DEFER:
/* Do not complain yet */
break;

default:
dev_err(dev,
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-zpodd.c
Expand Up @@ -55,7 +55,7 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
unsigned int ret;
struct rm_feature_desc *desc;
struct ata_taskfile tf;
static const char cdb[] = { GPCMD_GET_CONFIGURATION,
static const char cdb[ATAPI_CDB_LEN] = { GPCMD_GET_CONFIGURATION,
2, /* only 1 feature descriptor requested */
0, 3, /* 3, removable medium feature */
0, 0, 0,/* reserved */
Expand Down
23 changes: 9 additions & 14 deletions drivers/cpufreq/pasemi-cpufreq.c
Expand Up @@ -145,10 +145,18 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
int err = -ENODEV;

cpu = of_get_cpu_node(policy->cpu, NULL);
if (!cpu)
goto out;

max_freqp = of_get_property(cpu, "clock-frequency", NULL);
of_node_put(cpu);
if (!cpu)
if (!max_freqp) {
err = -EINVAL;
goto out;
}

/* we need the freq in kHz */
max_freq = *max_freqp / 1000;

dn = of_find_compatible_node(NULL, NULL, "1682m-sdc");
if (!dn)
Expand Down Expand Up @@ -185,16 +193,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
}

pr_debug("init cpufreq on CPU %d\n", policy->cpu);

max_freqp = of_get_property(cpu, "clock-frequency", NULL);
if (!max_freqp) {
err = -EINVAL;
goto out_unmap_sdcpwr;
}

/* we need the freq in kHz */
max_freq = *max_freqp / 1000;

pr_debug("max clock-frequency is at %u kHz\n", max_freq);
pr_debug("initializing frequency table\n");

Expand All @@ -212,9 +210,6 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)

return cpufreq_generic_init(policy, pas_freqs, get_gizmo_latency());

out_unmap_sdcpwr:
iounmap(sdcpwr_mapbase);

out_unmap_sdcasr:
iounmap(sdcasr_mapbase);
out:
Expand Down
5 changes: 3 additions & 2 deletions drivers/firmware/Kconfig
Expand Up @@ -135,7 +135,7 @@ config DMI_SCAN_MACHINE_NON_EFI_FALLBACK

config ISCSI_IBFT_FIND
bool "iSCSI Boot Firmware Table Attributes"
depends on X86 && ACPI
depends on X86 && ISCSI_IBFT
default n
help
This option enables the kernel to find the region of memory
Expand All @@ -146,7 +146,8 @@ config ISCSI_IBFT_FIND
config ISCSI_IBFT
tristate "iSCSI Boot Firmware Table Attributes module"
select ISCSI_BOOT_SYSFS
depends on ISCSI_IBFT_FIND && SCSI && SCSI_LOWLEVEL
select ISCSI_IBFT_FIND if X86
depends on ACPI && SCSI && SCSI_LOWLEVEL
default n
help
This option enables support for detection and exposing of iSCSI
Expand Down
4 changes: 4 additions & 0 deletions drivers/firmware/iscsi_ibft.c
Expand Up @@ -93,6 +93,10 @@ MODULE_DESCRIPTION("sysfs interface to BIOS iBFT information");
MODULE_LICENSE("GPL");
MODULE_VERSION(IBFT_ISCSI_VERSION);

#ifndef CONFIG_ISCSI_IBFT_FIND
struct acpi_table_ibft *ibft_addr;
#endif

struct ibft_hdr {
u8 id;
u8 version;
Expand Down
9 changes: 7 additions & 2 deletions drivers/hid/hid-holtek-kbd.c
Expand Up @@ -126,9 +126,14 @@ static int holtek_kbd_input_event(struct input_dev *dev, unsigned int type,

/* Locate the boot interface, to receive the LED change events */
struct usb_interface *boot_interface = usb_ifnum_to_if(usb_dev, 0);
struct hid_device *boot_hid;
struct hid_input *boot_hid_input;

struct hid_device *boot_hid = usb_get_intfdata(boot_interface);
struct hid_input *boot_hid_input = list_first_entry(&boot_hid->inputs,
if (unlikely(boot_interface == NULL))
return -ENODEV;

boot_hid = usb_get_intfdata(boot_interface);
boot_hid_input = list_first_entry(&boot_hid->inputs,
struct hid_input, list);

return boot_hid_input->input->event(boot_hid_input->input, type, code,
Expand Down
12 changes: 12 additions & 0 deletions drivers/hid/usbhid/hiddev.c
Expand Up @@ -308,6 +308,14 @@ static int hiddev_open(struct inode *inode, struct file *file)
spin_unlock_irq(&list->hiddev->list_lock);

mutex_lock(&hiddev->existancelock);
/*
* recheck exist with existance lock held to
* avoid opening a disconnected device
*/
if (!list->hiddev->exist) {
res = -ENODEV;
goto bail_unlock;
}
if (!list->hiddev->open++)
if (list->hiddev->exist) {
struct hid_device *hid = hiddev->hid;
Expand All @@ -322,6 +330,10 @@ static int hiddev_open(struct inode *inode, struct file *file)
return 0;
bail_unlock:
mutex_unlock(&hiddev->existancelock);

spin_lock_irq(&list->hiddev->list_lock);
list_del(&list->node);
spin_unlock_irq(&list->hiddev->list_lock);
bail:
file->private_data = NULL;
vfree(list);
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/nct6775.c
Expand Up @@ -696,7 +696,7 @@ static const u16 NCT6106_REG_TARGET[] = { 0x111, 0x121, 0x131 };
static const u16 NCT6106_REG_WEIGHT_TEMP_SEL[] = { 0x168, 0x178, 0x188 };
static const u16 NCT6106_REG_WEIGHT_TEMP_STEP[] = { 0x169, 0x179, 0x189 };
static const u16 NCT6106_REG_WEIGHT_TEMP_STEP_TOL[] = { 0x16a, 0x17a, 0x18a };
static const u16 NCT6106_REG_WEIGHT_DUTY_STEP[] = { 0x16b, 0x17b, 0x17c };
static const u16 NCT6106_REG_WEIGHT_DUTY_STEP[] = { 0x16b, 0x17b, 0x18b };
static const u16 NCT6106_REG_WEIGHT_TEMP_BASE[] = { 0x16c, 0x17c, 0x18c };
static const u16 NCT6106_REG_WEIGHT_DUTY_BASE[] = { 0x16d, 0x17d, 0x18d };

Expand Down Expand Up @@ -3478,6 +3478,7 @@ static int nct6775_probe(struct platform_device *pdev)
data->REG_FAN_TIME[0] = NCT6106_REG_FAN_STOP_TIME;
data->REG_FAN_TIME[1] = NCT6106_REG_FAN_STEP_UP_TIME;
data->REG_FAN_TIME[2] = NCT6106_REG_FAN_STEP_DOWN_TIME;
data->REG_TOLERANCE_H = NCT6106_REG_TOLERANCE_H;
data->REG_PWM[0] = NCT6106_REG_PWM;
data->REG_PWM[1] = NCT6106_REG_FAN_START_OUTPUT;
data->REG_PWM[2] = NCT6106_REG_FAN_STOP_OUTPUT;
Expand Down
6 changes: 3 additions & 3 deletions drivers/hwmon/nct7802.c
Expand Up @@ -768,7 +768,7 @@ static struct attribute *nct7802_in_attrs[] = {
&sensor_dev_attr_in3_alarm.dev_attr.attr,
&sensor_dev_attr_in3_beep.dev_attr.attr,

&sensor_dev_attr_in4_input.dev_attr.attr, /* 17 */
&sensor_dev_attr_in4_input.dev_attr.attr, /* 16 */
&sensor_dev_attr_in4_min.dev_attr.attr,
&sensor_dev_attr_in4_max.dev_attr.attr,
&sensor_dev_attr_in4_alarm.dev_attr.attr,
Expand All @@ -794,9 +794,9 @@ static umode_t nct7802_in_is_visible(struct kobject *kobj,

if (index >= 6 && index < 11 && (reg & 0x03) != 0x03) /* VSEN1 */
return 0;
if (index >= 11 && index < 17 && (reg & 0x0c) != 0x0c) /* VSEN2 */
if (index >= 11 && index < 16 && (reg & 0x0c) != 0x0c) /* VSEN2 */
return 0;
if (index >= 17 && (reg & 0x30) != 0x30) /* VSEN3 */
if (index >= 16 && (reg & 0x30) != 0x30) /* VSEN3 */
return 0;

return attr->mode;
Expand Down
15 changes: 7 additions & 8 deletions drivers/infiniband/core/addr.c
Expand Up @@ -481,23 +481,23 @@ int rdma_addr_find_dmac_by_grh(const union ib_gid *sgid, const union ib_gid *dgi
struct net_device *dev;

union {
struct sockaddr _sockaddr;
struct sockaddr_in _sockaddr_in;
struct sockaddr_in6 _sockaddr_in6;
} sgid_addr, dgid_addr;


rdma_gid2ip(&sgid_addr._sockaddr, sgid);
rdma_gid2ip(&dgid_addr._sockaddr, dgid);
rdma_gid2ip((struct sockaddr *)&sgid_addr, sgid);
rdma_gid2ip((struct sockaddr *)&dgid_addr, dgid);

memset(&dev_addr, 0, sizeof(dev_addr));
dev_addr.bound_dev_if = if_index;
dev_addr.net = &init_net;

ctx.addr = &dev_addr;
init_completion(&ctx.comp);
ret = rdma_resolve_ip(&self, &sgid_addr._sockaddr, &dgid_addr._sockaddr,
&dev_addr, 1000, resolve_cb, &ctx);
ret = rdma_resolve_ip(&self, (struct sockaddr *)&sgid_addr,
(struct sockaddr *)&dgid_addr, &dev_addr, 1000,
resolve_cb, &ctx);
if (ret)
return ret;

Expand All @@ -519,16 +519,15 @@ int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id)
int ret = 0;
struct rdma_dev_addr dev_addr;
union {
struct sockaddr _sockaddr;
struct sockaddr_in _sockaddr_in;
struct sockaddr_in6 _sockaddr_in6;
} gid_addr;

rdma_gid2ip(&gid_addr._sockaddr, sgid);
rdma_gid2ip((struct sockaddr *)&gid_addr, sgid);

memset(&dev_addr, 0, sizeof(dev_addr));
dev_addr.net = &init_net;
ret = rdma_translate_ip(&gid_addr._sockaddr, &dev_addr, vlan_id);
ret = rdma_translate_ip((struct sockaddr *)&gid_addr, &dev_addr, vlan_id);
if (ret)
return ret;

Expand Down

0 comments on commit d3f1be0

Please sign in to comment.