Skip to content

Commit 2160f1c

Browse files
committed
Merge branch 'fixes' into linux-next
* fixes: ACPI: bus: Fix MFD child automatic modprobe issue ACPI: processor: Fix previous acpi_processor_errata_piix4() fix ACPICA: Update the format of Arg3 of _DSM PM: runtime: Fix a race condition related to device removal sched: idle: Consolidate the handling of two special cases
2 parents c2c8ab1 + 9898464 commit 2160f1c

5 files changed

Lines changed: 31 additions & 20 deletions

File tree

drivers/acpi/acpi_processor.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
113113
PCI_ANY_ID, PCI_ANY_ID, NULL);
114114
if (ide_dev) {
115115
errata.piix4.bmisx = pci_resource_start(ide_dev, 4);
116+
if (errata.piix4.bmisx)
117+
dev_dbg(&ide_dev->dev,
118+
"Bus master activity detection (BM-IDE) erratum enabled\n");
119+
116120
pci_dev_put(ide_dev);
117121
}
118122

@@ -131,20 +135,17 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
131135
if (isa_dev) {
132136
pci_read_config_byte(isa_dev, 0x76, &value1);
133137
pci_read_config_byte(isa_dev, 0x77, &value2);
134-
if ((value1 & 0x80) || (value2 & 0x80))
138+
if ((value1 & 0x80) || (value2 & 0x80)) {
135139
errata.piix4.fdma = 1;
140+
dev_dbg(&isa_dev->dev,
141+
"Type-F DMA livelock erratum (C3 disabled)\n");
142+
}
136143
pci_dev_put(isa_dev);
137144
}
138145

139146
break;
140147
}
141148

142-
if (ide_dev)
143-
dev_dbg(&ide_dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
144-
145-
if (isa_dev)
146-
dev_dbg(&isa_dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
147-
148149
return 0;
149150
}
150151

drivers/acpi/acpica/acpredef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
451451

452452
{{"_DSM",
453453
METHOD_4ARGS(ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER,
454-
ACPI_TYPE_ANY | ACPI_TYPE_PACKAGE) |
454+
ACPI_TYPE_PACKAGE | ACPI_TYPE_ANY) |
455455
ARG_COUNT_IS_MINIMUM,
456456
METHOD_RETURNS(ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
457457

drivers/acpi/bus.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,6 @@ const struct acpi_device *acpi_companion_match(const struct device *dev)
818818
if (list_empty(&adev->pnp.ids))
819819
return NULL;
820820

821-
if (adev->pnp.type.backlight)
822-
return adev;
823-
824821
return acpi_primary_dev_companion(adev, dev);
825822
}
826823

drivers/base/power/runtime.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,7 @@ void pm_runtime_reinit(struct device *dev)
18951895
void pm_runtime_remove(struct device *dev)
18961896
{
18971897
__pm_runtime_disable(dev, false);
1898+
flush_work(&dev->power.work);
18981899
pm_runtime_reinit(dev);
18991900
}
19001901

kernel/sched/idle.c

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
161161
return cpuidle_enter(drv, dev, next_state);
162162
}
163163

164+
static void idle_call_stop_or_retain_tick(bool stop_tick)
165+
{
166+
if (stop_tick || tick_nohz_tick_stopped())
167+
tick_nohz_idle_stop_tick();
168+
else
169+
tick_nohz_idle_retain_tick();
170+
}
171+
164172
/**
165173
* cpuidle_idle_call - the main idle function
166174
*
@@ -170,7 +178,7 @@ static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
170178
* set, and it returns with polling set. If it ever stops polling, it
171179
* must clear the polling bit.
172180
*/
173-
static void cpuidle_idle_call(void)
181+
static void cpuidle_idle_call(bool stop_tick)
174182
{
175183
struct cpuidle_device *dev = cpuidle_get_device();
176184
struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
@@ -186,7 +194,7 @@ static void cpuidle_idle_call(void)
186194
}
187195

188196
if (cpuidle_not_available(drv, dev)) {
189-
tick_nohz_idle_stop_tick();
197+
idle_call_stop_or_retain_tick(stop_tick);
190198

191199
default_idle_call();
192200
goto exit_idle;
@@ -222,25 +230,27 @@ static void cpuidle_idle_call(void)
222230
next_state = cpuidle_find_deepest_state(drv, dev, max_latency_ns);
223231
call_cpuidle(drv, dev, next_state);
224232
} else if (drv->state_count > 1) {
225-
bool stop_tick = true;
233+
/*
234+
* stop_tick is expected to be true by default by cpuidle
235+
* governors, which allows them to select idle states with
236+
* target residency above the tick period length.
237+
*/
238+
stop_tick = true;
226239

227240
/*
228241
* Ask the cpuidle framework to choose a convenient idle state.
229242
*/
230243
next_state = cpuidle_select(drv, dev, &stop_tick);
231244

232-
if (stop_tick || tick_nohz_tick_stopped())
233-
tick_nohz_idle_stop_tick();
234-
else
235-
tick_nohz_idle_retain_tick();
245+
idle_call_stop_or_retain_tick(stop_tick);
236246

237247
entered_state = call_cpuidle(drv, dev, next_state);
238248
/*
239249
* Give the governor an opportunity to reflect on the outcome
240250
*/
241251
cpuidle_reflect(dev, entered_state);
242252
} else {
243-
tick_nohz_idle_retain_tick();
253+
idle_call_stop_or_retain_tick(stop_tick);
244254

245255
/*
246256
* If there is only a single idle state (or none), there is
@@ -268,6 +278,7 @@ static void cpuidle_idle_call(void)
268278
static void do_idle(void)
269279
{
270280
int cpu = smp_processor_id();
281+
bool got_tick = false;
271282

272283
/*
273284
* Check if we need to update blocked load
@@ -338,8 +349,9 @@ static void do_idle(void)
338349
tick_nohz_idle_restart_tick();
339350
cpu_idle_poll();
340351
} else {
341-
cpuidle_idle_call();
352+
cpuidle_idle_call(got_tick);
342353
}
354+
got_tick = tick_nohz_idle_got_tick();
343355
arch_cpu_idle_exit();
344356
}
345357

0 commit comments

Comments
 (0)