Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from torvalds:master #776

Merged
merged 10 commits into from
Dec 24, 2021
Merged
8 changes: 3 additions & 5 deletions arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,9 @@ call_fpe:
tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
reteq lr
and r8, r0, #0x00000f00 @ mask out CP number
THUMB( lsr r8, r8, #8 )
mov r7, #1
add r6, r10, #TI_USED_CP
ARM( strb r7, [r6, r8, lsr #8] ) @ set appropriate used_cp[]
THUMB( strb r7, [r6, r8] ) @ set appropriate used_cp[]
add r6, r10, r8, lsr #8 @ add used_cp[] array offset first
strb r7, [r6, #TI_USED_CP] @ set appropriate used_cp[]
#ifdef CONFIG_IWMMXT
@ Test if we need to give access to iWMMXt coprocessors
ldr r5, [r10, #TI_FLAGS]
Expand All @@ -609,7 +607,7 @@ call_fpe:
bcs iwmmxt_task_enable
#endif
ARM( add pc, pc, r8, lsr #6 )
THUMB( lsl r8, r8, #2 )
THUMB( lsr r8, r8, #6 )
THUMB( add pc, r8 )
nop

Expand Down
1 change: 1 addition & 0 deletions arch/arm/kernel/head-nommu.S
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ ENTRY(secondary_startup)
add r12, r12, r10
ret r12
1: bl __after_proc_init
ldr r7, __secondary_data @ reload r7
ldr sp, [r7, #12] @ set up the stack pointer
ldr r0, [r7, #16] @ set up task pointer
mov fp, #0
Expand Down
4 changes: 2 additions & 2 deletions drivers/platform/mellanox/mlxbf-pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,8 +1374,8 @@ static int mlxbf_pmc_map_counters(struct device *dev)
pmc->block[i].counters = info[2];
pmc->block[i].type = info[3];

if (IS_ERR(pmc->block[i].mmio_base))
return PTR_ERR(pmc->block[i].mmio_base);
if (!pmc->block[i].mmio_base)
return -ENOMEM;

ret = mlxbf_pmc_create_groups(dev, i);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/x86/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o
obj-$(CONFIG_THINKPAD_LMI) += think-lmi.o

# Intel
obj-$(CONFIG_X86_PLATFORM_DRIVERS_INTEL) += intel/
obj-y += intel/

# MSI
obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o
Expand Down
3 changes: 2 additions & 1 deletion drivers/platform/x86/amd-pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ static int __maybe_unused amd_pmc_resume(struct device *dev)
}

static const struct dev_pm_ops amd_pmc_pm_ops = {
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(amd_pmc_suspend, amd_pmc_resume)
.suspend_noirq = amd_pmc_suspend,
.resume_noirq = amd_pmc_resume,
};

static const struct pci_device_id pmc_pci_ids[] = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/platform/x86/apple-gmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
}

gmux_data->iostart = res->start;
gmux_data->iolen = res->end - res->start;
gmux_data->iolen = resource_size(res);

if (gmux_data->iolen < GMUX_MIN_IO_LEN) {
pr_err("gmux I/O region too small (%lu < %u)\n",
Expand Down
15 changes: 0 additions & 15 deletions drivers/platform/x86/intel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@
# Intel x86 Platform Specific Drivers
#

menuconfig X86_PLATFORM_DRIVERS_INTEL
bool "Intel x86 Platform Specific Device Drivers"
default y
help
Say Y here to get to see options for device drivers for
various Intel x86 platforms, including vendor-specific
drivers. This option alone does not add any kernel code.

If you say N, all options in this submenu will be skipped
and disabled.

if X86_PLATFORM_DRIVERS_INTEL

source "drivers/platform/x86/intel/atomisp2/Kconfig"
source "drivers/platform/x86/intel/int1092/Kconfig"
source "drivers/platform/x86/intel/int33fe/Kconfig"
Expand Down Expand Up @@ -183,5 +170,3 @@ config INTEL_UNCORE_FREQ_CONTROL

To compile this driver as a module, choose M here: the module
will be called intel-uncore-frequency.

endif # X86_PLATFORM_DRIVERS_INTEL
2 changes: 1 addition & 1 deletion drivers/platform/x86/intel/pmc/pltdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int __init pmc_core_platform_init(void)

retval = platform_device_register(pmc_core_device);
if (retval)
kfree(pmc_core_device);
platform_device_put(pmc_core_device);

return retval;
}
Expand Down
58 changes: 30 additions & 28 deletions drivers/platform/x86/system76_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct system76_data {
union acpi_object *nfan;
union acpi_object *ntmp;
struct input_dev *input;
bool has_open_ec;
};

static const struct acpi_device_id device_ids[] = {
Expand Down Expand Up @@ -279,20 +280,12 @@ static struct acpi_battery_hook system76_battery_hook = {

static void system76_battery_init(void)
{
acpi_handle handle;

handle = ec_get_handle();
if (handle && acpi_has_method(handle, "GBCT"))
battery_hook_register(&system76_battery_hook);
battery_hook_register(&system76_battery_hook);
}

static void system76_battery_exit(void)
{
acpi_handle handle;

handle = ec_get_handle();
if (handle && acpi_has_method(handle, "GBCT"))
battery_hook_unregister(&system76_battery_hook);
battery_hook_unregister(&system76_battery_hook);
}

// Get the airplane mode LED brightness
Expand Down Expand Up @@ -673,6 +666,10 @@ static int system76_add(struct acpi_device *acpi_dev)
acpi_dev->driver_data = data;
data->acpi_dev = acpi_dev;

// Some models do not run open EC firmware. Check for an ACPI method
// that only exists on open EC to guard functionality specific to it.
data->has_open_ec = acpi_has_method(acpi_device_handle(data->acpi_dev), "NFAN");

err = system76_get(data, "INIT");
if (err)
return err;
Expand Down Expand Up @@ -718,27 +715,31 @@ static int system76_add(struct acpi_device *acpi_dev)
if (err)
goto error;

err = system76_get_object(data, "NFAN", &data->nfan);
if (err)
goto error;
if (data->has_open_ec) {
err = system76_get_object(data, "NFAN", &data->nfan);
if (err)
goto error;

err = system76_get_object(data, "NTMP", &data->ntmp);
if (err)
goto error;
err = system76_get_object(data, "NTMP", &data->ntmp);
if (err)
goto error;

data->therm = devm_hwmon_device_register_with_info(&acpi_dev->dev,
"system76_acpi", data, &thermal_chip_info, NULL);
err = PTR_ERR_OR_ZERO(data->therm);
if (err)
goto error;
data->therm = devm_hwmon_device_register_with_info(&acpi_dev->dev,
"system76_acpi", data, &thermal_chip_info, NULL);
err = PTR_ERR_OR_ZERO(data->therm);
if (err)
goto error;

system76_battery_init();
system76_battery_init();
}

return 0;

error:
kfree(data->ntmp);
kfree(data->nfan);
if (data->has_open_ec) {
kfree(data->ntmp);
kfree(data->nfan);
}
return err;
}

Expand All @@ -749,14 +750,15 @@ static int system76_remove(struct acpi_device *acpi_dev)

data = acpi_driver_data(acpi_dev);

system76_battery_exit();
if (data->has_open_ec) {
system76_battery_exit();
kfree(data->nfan);
kfree(data->ntmp);
}

devm_led_classdev_unregister(&acpi_dev->dev, &data->ap_led);
devm_led_classdev_unregister(&acpi_dev->dev, &data->kb_led);

kfree(data->nfan);
kfree(data->ntmp);

system76_get(data, "FINI");

return 0;
Expand Down