Skip to content

Commit 2fec5b8

Browse files
committed
Merge branches 'acpi-dptf', 'acpi-processor', 'acpi-tables' and 'acpi-platform'
* acpi-dptf: ACPI: DPTF: Add new PCH FIVR methods * acpi-processor: ACPI: processor: Replace deprecated CPU-hotplug functions * acpi-tables: ACPI: tables: FPDT: Do not print FW_BUG message if record types are reserved ACPI: SPCR: Add support for the new 16550-compatible Serial Port Subtype * acpi-platform: ACPI: platform-profile: call sysfs_notify() from platform_profile_store()
5 parents 7c85154 + 7a6226d + 95ac706 + 97e0341 + b25d5a1 commit 2fec5b8

File tree

9 files changed

+71
-12
lines changed

9 files changed

+71
-12
lines changed

Documentation/ABI/testing/sysfs-platform-dptf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,43 @@ Contact: [email protected]
111111
Description:
112112
(RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz,
113113
when FIVR clock is 38.4MHz.
114+
115+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_freq_mhz
116+
Date: September, 2021
117+
KernelVersion: v5.15
118+
119+
Description:
120+
(RO) Get the FIVR switching control frequency in MHz.
121+
122+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_fault_status
123+
Date: September, 2021
124+
KernelVersion: v5.15
125+
126+
Description:
127+
(RO) Read the FIVR switching frequency control fault status.
128+
129+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/ssc_clock_info
130+
Date: September, 2021
131+
KernelVersion: v5.15
132+
133+
Description:
134+
(RO) Presents SSC (spread spectrum clock) information for EMI
135+
(Electro magnetic interference) control. This is a bit mask.
136+
Bits Description
137+
[7:0] Sets clock spectrum spread percentage:
138+
0x00=0.2% , 0x3F=10%
139+
1 LSB = 0.1% increase in spread (for
140+
settings 0x01 thru 0x1C)
141+
1 LSB = 0.2% increase in spread (for
142+
settings 0x1E thru 0x3F)
143+
[8] When set to 1, enables spread
144+
spectrum clock
145+
[9] 0: Triangle mode. FFC frequency
146+
walks around the Fcenter in a linear
147+
fashion
148+
1: Random walk mode. FFC frequency
149+
changes randomly within the SSC
150+
(Spread spectrum clock) range
151+
[10] 0: No white noise. 1: Add white noise
152+
to spread waveform
153+
[11] When 1, future writes are ignored.

Documentation/ABI/testing/sysfs-platform_profile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ Contact: Hans de Goede <[email protected]>
2626
Description: Reading this file gives the current selected profile for this
2727
device. Writing this file with one of the strings from
2828
platform_profile_choices changes the profile to the new value.
29+
30+
This file can be monitored for changes by polling for POLLPRI,
31+
POLLPRI will be signalled on any changes, independent of those
32+
changes coming from a userspace write; or coming from another
33+
source such as e.g. a hotkey triggered profile change handled
34+
either directly by the embedded-controller or fully handled
35+
inside the kernel.

drivers/acpi/acpi_fpdt.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type)
220220
break;
221221

222222
default:
223-
pr_err(FW_BUG "Invalid record %d found.\n", record_header->type);
224-
return -EINVAL;
223+
/* Other types are reserved in ACPI 6.4 spec. */
224+
break;
225225
}
226226
}
227227
return 0;
@@ -254,8 +254,7 @@ static int __init acpi_init_fpdt(void)
254254
subtable->type);
255255
break;
256256
default:
257-
pr_info(FW_BUG "Invalid subtable type %d found.\n",
258-
subtable->type);
257+
/* Other types are reserved in ACPI 6.4 spec. */
259258
break;
260259
}
261260
offset += sizeof(*subtable);

drivers/acpi/acpi_pad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)
249249

250250
static void acpi_pad_idle_cpus(unsigned int num_cpus)
251251
{
252-
get_online_cpus();
252+
cpus_read_lock();
253253

254254
num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());
255255
set_power_saving_task_num(num_cpus);
256256

257-
put_online_cpus();
257+
cpus_read_unlock();
258258
}
259259

260260
static uint32_t acpi_pad_idle_cpus_num(void)

drivers/acpi/acpi_processor.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
182182
return -ENODEV;
183183

184184
cpu_maps_update_begin();
185-
cpu_hotplug_begin();
185+
cpus_write_lock();
186186

187187
ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id);
188188
if (ret)
@@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
203203
pr->flags.need_hotplug_init = 1;
204204

205205
out:
206-
cpu_hotplug_done();
206+
cpus_write_unlock();
207207
cpu_maps_update_done();
208208
return ret;
209209
}
@@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)
454454
per_cpu(processors, pr->id) = NULL;
455455

456456
cpu_maps_update_begin();
457-
cpu_hotplug_begin();
457+
cpus_write_lock();
458458

459459
/* Remove the CPU. */
460460
arch_unregister_cpu(pr->id);
461461
acpi_unmap_cpu(pr->id);
462462

463-
cpu_hotplug_done();
463+
cpus_write_unlock();
464464
cpu_maps_update_done();
465465

466466
try_offline_node(cpu_to_node(pr->id));

drivers/acpi/dptf/dptf_pch_fivr.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,24 @@ static ssize_t name##_store(struct device *dev,\
9090

9191
PCH_FIVR_SHOW(freq_mhz_low_clock, GFC0)
9292
PCH_FIVR_SHOW(freq_mhz_high_clock, GFC1)
93+
PCH_FIVR_SHOW(ssc_clock_info, GEMI)
94+
PCH_FIVR_SHOW(fivr_switching_freq_mhz, GFCS)
95+
PCH_FIVR_SHOW(fivr_switching_fault_status, GFFS)
9396
PCH_FIVR_STORE(freq_mhz_low_clock, RFC0)
9497
PCH_FIVR_STORE(freq_mhz_high_clock, RFC1)
9598

9699
static DEVICE_ATTR_RW(freq_mhz_low_clock);
97100
static DEVICE_ATTR_RW(freq_mhz_high_clock);
101+
static DEVICE_ATTR_RO(ssc_clock_info);
102+
static DEVICE_ATTR_RO(fivr_switching_freq_mhz);
103+
static DEVICE_ATTR_RO(fivr_switching_fault_status);
98104

99105
static struct attribute *fivr_attrs[] = {
100106
&dev_attr_freq_mhz_low_clock.attr,
101107
&dev_attr_freq_mhz_high_clock.attr,
108+
&dev_attr_ssc_clock_info.attr,
109+
&dev_attr_fivr_switching_freq_mhz.attr,
110+
&dev_attr_fivr_switching_fault_status.attr,
102111
NULL
103112
};
104113

drivers/acpi/platform_profile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ static ssize_t platform_profile_store(struct device *dev,
106106
}
107107

108108
err = cur_profile->profile_set(cur_profile, i);
109+
if (!err)
110+
sysfs_notify(acpi_kobj, NULL, "platform_profile");
111+
109112
mutex_unlock(&profile_lock);
110113
if (err)
111114
return err;

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
13011301
if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
13021302

13031303
/* Protect against cpu-hotplug */
1304-
get_online_cpus();
1304+
cpus_read_lock();
13051305
cpuidle_pause_and_lock();
13061306

13071307
/* Disable all cpuidle devices */
@@ -1330,7 +1330,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
13301330
}
13311331
}
13321332
cpuidle_resume_and_unlock();
1333-
put_online_cpus();
1333+
cpus_read_unlock();
13341334
}
13351335

13361336
return 0;

drivers/acpi/spcr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
136136
break;
137137
case ACPI_DBG2_16550_COMPATIBLE:
138138
case ACPI_DBG2_16550_SUBSET:
139+
case ACPI_DBG2_16550_WITH_GAS:
139140
uart = "uart";
140141
break;
141142
default:

0 commit comments

Comments
 (0)