Skip to content

Commit abb02a8

Browse files
committed
Merge tag 'acpi-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These add some new quirks, fix PPTT handling, fix an ACPI utility and correct a mistake in the ACPI documentation. Specifics: - Fix ACPI PPTT handling to avoid sleep in the atomic context when it is not present (Sudeep Holla) - Add 'backlight=native' DMI quirk for Dell Vostro 15 3535 to the ACPI video driver (Chia-Lin Kao) - Add ACPI quirks for I2C device enumeration on Lenovo Yoga Book X90 and Acer Iconia One 7 B1-750 (Hans de Goede) - Fix handling of invalid command line option values in the ACPI pfrut utility (Chen Yu) - Fix references to I2C device data type in the ACPI documentation for device enumeration (Andy Shevchenko)" * tag 'acpi-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: tools: pfrut: Check if the input of level and type is in the right numeric range ACPI: PPTT: Fix to avoid sleep in the atomic context when PPTT is absent ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Book X90 ACPI: x86: Add skip i2c clients quirk for Acer Iconia One 7 B1-750 ACPI: x86: Introduce an acpi_quirk_skip_gpio_event_handlers() helper ACPI: video: Add backlight=native DMI quirk for Dell Vostro 15 3535 ACPI: docs: enumeration: Correct reference to the I²C device data type
2 parents ba9c779 + f36cc6c commit abb02a8

File tree

7 files changed

+77
-8
lines changed

7 files changed

+77
-8
lines changed

Documentation/firmware-guide/acpi/enumeration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ possible we decided to do following:
1919
platform devices.
2020

2121
- Devices behind real busses where there is a connector resource
22-
are represented as struct spi_device or struct i2c_device. Note
22+
are represented as struct spi_device or struct i2c_client. Note
2323
that standard UARTs are not busses so there is no struct uart_device,
2424
although some of them may be represented by struct serdev_device.
2525

drivers/acpi/pptt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,16 +536,19 @@ static int topology_get_acpi_cpu_tag(struct acpi_table_header *table,
536536
static struct acpi_table_header *acpi_get_pptt(void)
537537
{
538538
static struct acpi_table_header *pptt;
539+
static bool is_pptt_checked;
539540
acpi_status status;
540541

541542
/*
542543
* PPTT will be used at runtime on every CPU hotplug in path, so we
543544
* don't need to call acpi_put_table() to release the table mapping.
544545
*/
545-
if (!pptt) {
546+
if (!pptt && !is_pptt_checked) {
546547
status = acpi_get_table(ACPI_SIG_PPTT, 0, &pptt);
547548
if (ACPI_FAILURE(status))
548549
acpi_pptt_warn_missing();
550+
551+
is_pptt_checked = true;
549552
}
550553

551554
return pptt;

drivers/acpi/video_detect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,13 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
716716
DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
717717
},
718718
},
719+
{
720+
.callback = video_detect_force_native,
721+
.matches = {
722+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
723+
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 15 3535"),
724+
},
725+
},
719726

720727
/*
721728
* Desktops which falsely report a backlight and which our heuristics

drivers/acpi/x86/utils.c

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ bool force_storage_d3(void)
251251
#define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(1)
252252
#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(2)
253253
#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(3)
254+
#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(4)
254255

255256
static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
256257
/*
@@ -279,22 +280,45 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
279280
* need the x86-android-tablets module to properly work.
280281
*/
281282
#if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS)
283+
{
284+
/* Acer Iconia One 7 B1-750 */
285+
.matches = {
286+
DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
287+
DMI_MATCH(DMI_PRODUCT_NAME, "VESPA2"),
288+
},
289+
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
290+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
291+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
292+
},
282293
{
283294
.matches = {
284295
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
285296
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ME176C"),
286297
},
287298
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
288299
ACPI_QUIRK_UART1_TTY_UART2_SKIP |
289-
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
300+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
301+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
302+
},
303+
{
304+
/* Lenovo Yoga Book X90F/L */
305+
.matches = {
306+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
307+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
308+
DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
309+
},
310+
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
311+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
312+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
290313
},
291314
{
292315
.matches = {
293316
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
294317
DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
295318
},
296319
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
297-
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
320+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
321+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
298322
},
299323
{
300324
/* Lenovo Yoga Tablet 2 1050F/L */
@@ -336,7 +360,8 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
336360
DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
337361
},
338362
.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
339-
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
363+
ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY |
364+
ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS),
340365
},
341366
{
342367
/* Whitelabel (sold as various brands) TM800A550L */
@@ -413,6 +438,20 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s
413438
return 0;
414439
}
415440
EXPORT_SYMBOL_GPL(acpi_quirk_skip_serdev_enumeration);
441+
442+
bool acpi_quirk_skip_gpio_event_handlers(void)
443+
{
444+
const struct dmi_system_id *dmi_id;
445+
long quirks;
446+
447+
dmi_id = dmi_first_match(acpi_quirk_skip_dmi_ids);
448+
if (!dmi_id)
449+
return false;
450+
451+
quirks = (unsigned long)dmi_id->driver_data;
452+
return (quirks & ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS);
453+
}
454+
EXPORT_SYMBOL_GPL(acpi_quirk_skip_gpio_event_handlers);
416455
#endif
417456

418457
/* Lists of PMIC ACPI HIDs with an (often better) native charger driver */

drivers/gpio/gpiolib-acpi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip)
536536
if (ACPI_FAILURE(status))
537537
return;
538538

539+
if (acpi_quirk_skip_gpio_event_handlers())
540+
return;
541+
539542
acpi_walk_resources(handle, METHOD_NAME__AEI,
540543
acpi_gpiochip_alloc_event, acpi_gpio);
541544

include/acpi/acpi_bus.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ static inline bool acpi_quirk_skip_acpi_ac_and_battery(void)
657657
#if IS_ENABLED(CONFIG_X86_ANDROID_TABLETS)
658658
bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev);
659659
int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip);
660+
bool acpi_quirk_skip_gpio_event_handlers(void);
660661
#else
661662
static inline bool acpi_quirk_skip_i2c_client_enumeration(struct acpi_device *adev)
662663
{
@@ -668,6 +669,10 @@ acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *skip)
668669
*skip = false;
669670
return 0;
670671
}
672+
static inline bool acpi_quirk_skip_gpio_event_handlers(void)
673+
{
674+
return false;
675+
}
671676
#endif
672677

673678
#ifdef CONFIG_PM

tools/power/acpi/tools/pfrut/pfrut.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static struct option long_options[] = {
9797
static void parse_options(int argc, char **argv)
9898
{
9999
int option_index = 0;
100-
char *pathname;
100+
char *pathname, *endptr;
101101
int opt;
102102

103103
pathname = strdup(argv[0]);
@@ -125,11 +125,23 @@ static void parse_options(int argc, char **argv)
125125
log_getinfo = 1;
126126
break;
127127
case 'T':
128-
log_type = atoi(optarg);
128+
log_type = strtol(optarg, &endptr, 0);
129+
if (*endptr || (log_type != 0 && log_type != 1)) {
130+
printf("Number expected: type(0:execution, 1:history) - Quit.\n");
131+
exit(1);
132+
}
133+
129134
set_log_type = 1;
130135
break;
131136
case 'L':
132-
log_level = atoi(optarg);
137+
log_level = strtol(optarg, &endptr, 0);
138+
if (*endptr ||
139+
(log_level != 0 && log_level != 1 &&
140+
log_level != 2 && log_level != 4)) {
141+
printf("Number expected: level(0, 1, 2, 4) - Quit.\n");
142+
exit(1);
143+
}
144+
133145
set_log_level = 1;
134146
break;
135147
case 'R':

0 commit comments

Comments
 (0)