History log of /linux/drivers/acpi/utils.c (Results 1 – 25 of 90)
Revision Date Author Comments
# 1269b6d7 13-Feb-2024 Sakari Ailus <sakari.ailus@linux.intel.com>

ACPI: utils: Make acpi_handle_path() not static

acpi_handle_path() will soon be required for node name comparison
elsewhere in ACPI framework. Remove the static keyword and add the
prototype to incl

ACPI: utils: Make acpi_handle_path() not static

acpi_handle_path() will soon be required for node name comparison
elsewhere in ACPI framework. Remove the static keyword and add the
prototype to include/linux/acpi.h.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# d70d141b 14-Dec-2023 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Introduce helper for _DEP list lookup

The ACPI LPSS driver and the Surface platform driver code use almost the
same code pattern for checking if one ACPI device is present in the list
r

ACPI: utils: Introduce helper for _DEP list lookup

The ACPI LPSS driver and the Surface platform driver code use almost the
same code pattern for checking if one ACPI device is present in the list
returned by _DEP for another ACPI device.

To reduce the resulting code duplication, introduce a helper for that
called acpi_device_dep() and invoke it from both places.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

show more ...


# 1feb042d 08-Dec-2023 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Refine acpi_handle_list_equal() slightly

It is somewhat better to use the size of the first array element for
computing the size of the entire array than to rely on the array
element da

ACPI: utils: Refine acpi_handle_list_equal() slightly

It is somewhat better to use the size of the first array element for
computing the size of the entire array than to rely on the array
element data type definition knowledge and the former is also
consistent with the array allocation in acpi_evaluate_reference(),
so modify the code accordingly.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 6909e0f3 08-Dec-2023 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Return bool from acpi_evaluate_reference()

There are only 4 users of acpi_evaluate_reference() and none of them
actually cares about the reason why it fails. All of them are only
inter

ACPI: utils: Return bool from acpi_evaluate_reference()

There are only 4 users of acpi_evaluate_reference() and none of them
actually cares about the reason why it fails. All of them are only
interested in whether or not it is successful, so it can return a bool
value indicating that.

Modify acpi_evaluate_reference() as per the observation above and update
its callers accordingly so as to get rid of useless code and local
variables.

The observable behavior of the kernel is not expected to change after
this modification of the code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 87824da2 08-Dec-2023 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Rearrange in acpi_evaluate_reference()

The code in acpi_evaluate_reference() can be improved in some ways
without changing its observable behavior. Among other things:

* None of the

ACPI: utils: Rearrange in acpi_evaluate_reference()

The code in acpi_evaluate_reference() can be improved in some ways
without changing its observable behavior. Among other things:

* None of the local variables in that function except for buffer
needs to be initialized.

* The element local variable is only used in the for () loop block,
so it can be defined there.

* Multiple checks can be combined.

* Code duplication related to error handling can be eliminated.

* Redundant inner parens can be dropped.

Modify the function as per the above.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 8f0b960a 07-Dec-2023 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Fix error path in acpi_evaluate_reference()

If a pointer to an uninitialized struct acpi_handle_list is passed to
acpi_evaluate_reference() and it decides to bail out early, either
beca

ACPI: utils: Fix error path in acpi_evaluate_reference()

If a pointer to an uninitialized struct acpi_handle_list is passed to
acpi_evaluate_reference() and it decides to bail out early, either
because acpi_evaluate_object() fails, or because it produces invalid
data, the handles pointer from the struct acpi_handle_list will be
passed to kfree() and if it is not NULL, the kernel will crash on an
attempt to free unallocated memory.

Address this by moving the "end" label in acpi_evaluate_reference() to
the end of the function, which is sufficient, because no cleanup is
needed in that case.

Fixes: 2e57d10a6591 ("ACPI: utils: Dynamically determine acpi_handle_list size")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Woody Suwalski <terraluna977@gmail.com>

show more ...


# b2b32a17 23-Nov-2023 Raag Jadav <raag.jadav@intel.com>

ACPI: bus: update acpi_dev_hid_uid_match() to support multiple types

Now that we have _UID matching support for both integer and string types,
we can support them into acpi_dev_hid_uid_match() helpe

ACPI: bus: update acpi_dev_hid_uid_match() to support multiple types

Now that we have _UID matching support for both integer and string types,
we can support them into acpi_dev_hid_uid_match() helper as well.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 57b8543c 23-Nov-2023 Raag Jadav <raag.jadav@intel.com>

ACPI: bus: update acpi_dev_uid_match() to support multiple types

According to the ACPI specification, a _UID object can evaluate to
either a numeric value or a string.

Update acpi_dev_uid_match() t

ACPI: bus: update acpi_dev_uid_match() to support multiple types

According to the ACPI specification, a _UID object can evaluate to
either a numeric value or a string.

Update acpi_dev_uid_match() to support _UID matching for both integer
and string types.

Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
[ rjw: Rename auxiliary macros, relocate kerneldoc comment ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 3a3cc546 24-Oct-2023 Raag Jadav <raag.jadav@intel.com>

ACPI: utils: use acpi_dev_uid_match() for matching _UID

Convert manual _UID references to use the standard ACPI helper.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Signed-off-by: Rafael J. Wys

ACPI: utils: use acpi_dev_uid_match() for matching _UID

Convert manual _UID references to use the standard ACPI helper.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# a3a62ca2 24-Oct-2023 Raag Jadav <raag.jadav@intel.com>

ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID

Introduce acpi_dev_uid_match() helper that matches the device with
supplied _UID string.

Signed-off-by: Raag Jadav <raag.jadav@intel.co

ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID

Introduce acpi_dev_uid_match() helper that matches the device with
supplied _UID string.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 6b54bdd1 28-Sep-2023 Jonathan Bergh <bergh.jonathan@gmail.com>

ACPI: utils: Remove redundant braces around individual statement

Remove braces that are not required for a one-line statement which
follows a control statement.

Signed-off-by: Jonathan Bergh <bergh

ACPI: utils: Remove redundant braces around individual statement

Remove braces that are not required for a one-line statement which
follows a control statement.

Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 6c766f7a 28-Sep-2023 Jonathan Bergh <bergh.jonathan@gmail.com>

ACPI: utils: Fix up white space in a few places

Fix up the following formatting issues flagged by checkpatch:
* Remove indentation before goto label
* Remove whitespace ahead of a comma in paramet

ACPI: utils: Fix up white space in a few places

Fix up the following formatting issues flagged by checkpatch:
* Remove indentation before goto label
* Remove whitespace ahead of a comma in parameter list

Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 2e57d10a 27-Sep-2023 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Dynamically determine acpi_handle_list size

Address a long-standing "TBD" comment in the ACPI headers regarding the
number of handles in struct acpi_handle_list.

The number 10, which a

ACPI: utils: Dynamically determine acpi_handle_list size

Address a long-standing "TBD" comment in the ACPI headers regarding the
number of handles in struct acpi_handle_list.

The number 10, which along with the comment dates back to 2.4.23, seems
like it may have been arbitrarily chosen and isn't sufficient in all
cases [1].

Finally change the code to dynamically determine the size of the handles
table in struct acpi_handle_list and allocate it accordingly.

Update the users of to struct acpi_handle_list to take the additional
dynamic allocation into account.

Link: https://lore.kernel.org/linux-acpi/20230809094451.15473-1-ivan.hu@canonical.com # [1]
Co-developed-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 5db72fdb 13-Sep-2022 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as integer

Some users interpret _UID only as integer and for them it's easier to
have an integer representation of _UID. Add respective

ACPI: utils: Add acpi_dev_uid_to_integer() helper to get _UID as integer

Some users interpret _UID only as integer and for them it's easier to
have an integer representation of _UID. Add respective helper for that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# b75d2cd0 18-Aug-2022 Wolfram Sang <wsa+renesas@sang-engineering.com>

ACPI: move from strlcpy() with unused retval to strscpy()

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generate

ACPI: move from strlcpy() with unused retval to strscpy()

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 93064e15 07-Jul-2022 Stefan Binding <sbinding@opensource.cirrus.com>

ACPI: utils: Add api to read _SUB from ACPI

Add a wrapper function to read the _SUB string from ACPI.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Acked-by: Rafael J. Wysocki <raf

ACPI: utils: Add api to read _SUB from ACPI

Add a wrapper function to read the _SUB string from ACPI.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20220707151037.3901050-2-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

show more ...


# 06eb8dc0 17-May-2022 Michael Niewöhner <linux@mniewoehner.de>

ACPI: utils: include UUID in _DSM evaluation warning

The _DSM evaluation warning in its current form is not very helpful, as
it lacks any specific information:
ACPI: \: failed to evaluate _DSM (0x

ACPI: utils: include UUID in _DSM evaluation warning

The _DSM evaluation warning in its current form is not very helpful, as
it lacks any specific information:
ACPI: \: failed to evaluate _DSM (0x1001)

Thus, include the UUID of the missing _DSM:
ACPI: \: failed to evaluate _DSM bf0212f2-... (0x1001)

Signed-off-by: Michael Niewöhner <linux@mniewoehner.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 71f64283 12-Jul-2021 Andy Shevchenko <andy.shevchenko@gmail.com>

ACPI: utils: Fix reference counting in for_each_acpi_dev_match()

Currently it's possible to iterate over the dangling pointer in case the device
suddenly disappears. This may happen becase callers p

ACPI: utils: Fix reference counting in for_each_acpi_dev_match()

Currently it's possible to iterate over the dangling pointer in case the device
suddenly disappears. This may happen becase callers put it at the end of a loop.

Instead, let's move that call inside acpi_dev_get_next_match_dev().

Fixes: 803abec64ef9 ("media: ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver")
Fixes: bf263f64e804 ("media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro")
Fixes: edbd1bc4951e ("efi/dev-path-parser: Switch to use for_each_acpi_dev_match()")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Daniel Scally <djrscally@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 7ec16433 11-Jun-2021 Calvin Johnson <calvin.johnson@oss.nxp.com>

ACPI: utils: Introduce acpi_get_local_address()

Introduce a wrapper around the _ADR evaluation.

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevche

ACPI: utils: Introduce acpi_get_local_address()

Introduce a wrapper around the _ADR evaluation.

Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Acked-by: Grant Likely <grant.likely@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

show more ...


# e7b07d3e 12-Apr-2021 Andy Shevchenko <andy.shevchenko@gmail.com>

ACPI: utils: Capitalize abbreviations in the comments

The DSDT and ACPI should be capitalized.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.

ACPI: utils: Capitalize abbreviations in the comments

The DSDT and ACPI should be capitalized.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 81eeb2f5 12-Apr-2021 Andy Shevchenko <andy.shevchenko@gmail.com>

ACPI: utils: Document for_each_acpi_dev_match() macro

The macro requires to call acpi_dev_put() on each iteration.
Due to this it doesn't tolerate sudden disappearence of the devices.

Document all

ACPI: utils: Document for_each_acpi_dev_match() macro

The macro requires to call acpi_dev_put() on each iteration.
Due to this it doesn't tolerate sudden disappearence of the devices.

Document all these nuances to prevent users blindly call it without
understanding the possible issues.

While at it, add the note to the acpi_dev_get_next_match_dev() and
advertise acpi_dev_put() instead of put_device() in the whole family
of the helper functions.

Fixes: bf263f64e804 ("media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 8eb99e9a 07-Apr-2021 Hans de Goede <hdegoede@redhat.com>

ACPI: utils: Add acpi_reduced_hardware() helper

Add a getter for the acpi_gbl_reduced_hardware variable so that modules
can check if they are running on an ACPI reduced-hw platform or not.

Signed-o

ACPI: utils: Add acpi_reduced_hardware() helper

Add a getter for the acpi_gbl_reduced_hardware variable so that modules
can check if they are running on an ACPI reduced-hw platform or not.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# 4c324548 05-Mar-2021 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Introduce acpi_evaluation_failure_warn()

Quite a few users of ACPI objects want to log a warning message if
the evaluation fails which is a repeating pattern, so introduce a
helper func

ACPI: utils: Introduce acpi_evaluation_failure_warn()

Quite a few users of ACPI objects want to log a warning message if
the evaluation fails which is a repeating pattern, so introduce a
helper function for that purpose and convert some code where it is
open-coded to using it.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# fba2ae30 20-Jan-2021 Rafael J. Wysocki <rafael.j.wysocki@intel.com>

ACPI: utils: Clean up printing messages

Replace all of the ACPI_DEBUG_PRINT() instances in utils.c with
pr_debug() and acpi_handle_debug(), drop the _COMPONENT and
ACPI_MODULE_NAME() definitions tha

ACPI: utils: Clean up printing messages

Replace all of the ACPI_DEBUG_PRINT() instances in utils.c with
pr_debug() and acpi_handle_debug(), drop the _COMPONENT and
ACPI_MODULE_NAME() definitions that are not used any more and
replace direct printk() invocations with pr_debug() calls (the log
level in there is way excessive).

Also add a special pr_fmt() definition, but this only affects the
pr_debug() messages mentioned above.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

show more ...


# bf263f64 07-Jan-2021 Daniel Scally <djrscally@gmail.com>

media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro

To ensure we handle situations in which multiple sensors of the same
model (and therefore _HID) are present in a system, we need

media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro

To ensure we handle situations in which multiple sensors of the same
model (and therefore _HID) are present in a system, we need to be able
to iterate over devices matching a known _HID but unknown _UID and _HRV
- add acpi_dev_get_next_match_dev() to accommodate that possibility and
change acpi_dev_get_first_match_dev() to simply call the new function
with a NULL starting point. Add an iterator macro for convenience.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

show more ...


1234