Commit 13f4eb6b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'acpica'

Merge ACPICA updates for 6.12-rc1:

 - Check return value in acpi_db_convert_to_package() (Pei Xiao).

 - Detect FACS and allow setting the waking vector on reduced-hardware
   ACPI platforms (Jiaqing Zhao).

 - Allow ACPICA to represent semaphores as integers (Adrien Destugues).

 - Complete CXL 3.0 CXIMS structures support in ACPICA (Zhang Rui).

 - Make ACPICA support SPCR version 4 and add RISC-V SBI Subtype to
   DBG2 (Sia Jee Heng).

 - Implement the Dword_PCC Resource Descriptor Macro in ACPICA (Jose
   Marinho).

 - Correct the typo in struct acpi_mpam_msc_node member (Punit Agrawal).

 - Implement ACPI_WARNING_ONCE() and ACPI_ERROR_ONCE() and use them to
   prevent a Stall() violation warning from being printed every time
   this takes place (Vasily Khoruzhick).

 - Allow PCC Data Type in MCTP resource (Adam Young).

 - Fix memory leaks on acpi_ps_get_next_namepath()
   and acpi_ps_get_next_field() failures  (Armin Wolf).

 - Add support for supressing leading zeros in hex strings when
   converting them to integers and update integer-to-hex-string
   conversions in ACPICA (Armin Wolf).

 - Add support for Windows 11 22H2 _OSI string (Armin Wolf).

 - Avoid warning for Dump Functions in ACPICA (Adam Lackorzynski).

 - Add extended linear address mode to HMAT MSCIS in ACPICA (Dave
   Jiang).

 - Handle empty connection_node in iasl (Aleksandrs Vinarskis).

 - Allow for more flexibility in _DSM args (Saket Dumbre).

 - Setup for ACPICA release 20240827 (Saket Dumbre).

* acpica: (23 commits)
  ACPICA: Setup for ACPICA release 20240827
  ACPICA: Allow for more flexibility in _DSM args
  ACPICA: iasl: handle empty connection_node
  ACPICA: HMAT: Add extended linear address mode to MSCIS
  ACPICA: Avoid warning for Dump Functions
  ACPICA: Add support for Windows 11 22H2 _OSI string
  ACPICA: Update integer-to-hex-string conversions
  ACPICA: Add support for supressing leading zeros in hex strings
  ACPICA: Allow for supressing leading zeros when using acpi_ex_convert_to_ascii()
  ACPICA: Fix memory leak if acpi_ps_get_next_field() fails
  ACPICA: Fix memory leak if acpi_ps_get_next_namepath() fails
  ACPICA: Allow PCC Data Type in MCTP resource.
  ACPICA: executer/exsystem: Don't nag user about every Stall() violating the spec
  ACPICA: Implement ACPI_WARNING_ONCE and ACPI_ERROR_ONCE
  ACPICA: MPAM: Correct the typo in struct acpi_mpam_msc_node member
  ACPICA: Implement the Dword_PCC Resource Descriptor Macro
  ACPICA: Headers: Add RISC-V SBI Subtype to DBG2
  ACPICA: SPCR: Update the SPCR table to version 4
  ACPICA: Complete CXL 3.0 CXIMS structures
  ACPICA: haiku: Fix invalid value used for semaphores
  ...
parents 6924e9b2 9af32b4a
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -29,11 +29,7 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX);

#if (!ACPI_REDUCED_HARDWARE)
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);

#endif				/* !ACPI_REDUCED_HARDWARE */
ACPI_INIT_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS, NULL);

/* These addresses are calculated from the FADT Event Block addresses */

+2 −0
Original line number Diff line number Diff line
@@ -1090,6 +1090,8 @@ struct acpi_port_info {
#define ACPI_ADDRESS_TYPE_IO_RANGE              1
#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE      2

#define ACPI_ADDRESS_TYPE_PCC_NUMBER            0xA

/* Resource descriptor types and masks */

#define ACPI_RESOURCE_NAME_LARGE                0x80
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {

	{{"_DSM",
	  METHOD_4ARGS(ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER,
		       ACPI_TYPE_PACKAGE),
		       ACPI_TYPE_ANY) | ARG_COUNT_IS_MINIMUM,
	  METHOD_RETURNS(ACPI_RTYPE_ALL)}},	/* Must return a value, but it can be of any type */

	{{"_DSS", METHOD_1ARGS(ACPI_TYPE_INTEGER),
+2 −0
Original line number Diff line number Diff line
@@ -174,6 +174,8 @@ acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object)
	elements =
	    ACPI_ALLOCATE_ZEROED(DB_DEFAULT_PKG_ELEMENTS *
				 sizeof(union acpi_object));
	if (!elements)
		return (AE_NO_MEMORY);

	this = string;
	for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++) {
+51 −7
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@ ACPI_MODULE_NAME("exconvrt")

/* Local prototypes */
static u32
acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);
acpi_ex_convert_to_ascii(u64 integer,
			 u16 base, u8 *string, u8 max_length, u8 leading_zeros);

/*******************************************************************************
 *
@@ -249,6 +250,7 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
 *              base            - ACPI_STRING_DECIMAL or ACPI_STRING_HEX
 *              string          - Where the string is returned
 *              data_width      - Size of data item to be converted, in bytes
 *              leading_zeros   - Allow leading zeros
 *
 * RETURN:      Actual string length
 *
@@ -257,7 +259,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
 ******************************************************************************/

static u32
acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
acpi_ex_convert_to_ascii(u64 integer,
			 u16 base, u8 *string, u8 data_width, u8 leading_zeros)
{
	u64 digit;
	u32 i;
@@ -266,7 +269,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
	u32 hex_length;
	u32 decimal_length;
	u32 remainder;
	u8 supress_zeros;
	u8 supress_zeros = !leading_zeros;
	u8 hex_char;

	ACPI_FUNCTION_ENTRY();

@@ -293,7 +297,6 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
			break;
		}

		supress_zeros = TRUE;	/* No leading zeros */
		remainder = 0;

		for (i = decimal_length; i > 0; i--) {
@@ -328,8 +331,17 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)

			/* Get one hex digit, most significant digits first */

			string[k] = (u8)
			hex_char = (u8)
			    acpi_ut_hex_to_ascii_char(integer, ACPI_MUL_4(j));

			/* Supress leading zeros until the first non-zero character */

			if (hex_char == ACPI_ASCII_ZERO && supress_zeros) {
				continue;
			}

			supress_zeros = FALSE;
			string[k] = hex_char;
			k++;
		}
		break;
@@ -379,6 +391,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
	u32 string_length = 0;
	u16 base = 16;
	u8 separator = ',';
	u8 leading_zeros;

	ACPI_FUNCTION_TRACE_PTR(ex_convert_to_string, obj_desc);

@@ -400,14 +413,26 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
			 * Make room for the maximum decimal number size
			 */
			string_length = ACPI_MAX_DECIMAL_DIGITS;
			leading_zeros = FALSE;
			base = 10;
			break;

		case ACPI_EXPLICIT_CONVERT_HEX:
			/*
			 * From to_hex_string.
			 *
			 * Supress leading zeros and append "0x"
			 */
			string_length =
			    ACPI_MUL_2(acpi_gbl_integer_byte_width) + 2;
			leading_zeros = FALSE;
			break;
		default:

			/* Two hex string characters for each integer byte */

			string_length = ACPI_MUL_2(acpi_gbl_integer_byte_width);
			leading_zeros = TRUE;
			break;
		}

@@ -422,17 +447,32 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
		}

		new_buf = return_desc->buffer.pointer;
		if (type == ACPI_EXPLICIT_CONVERT_HEX) {

			/* Append "0x" prefix for explicit hex conversion */

			*new_buf++ = '0';
			*new_buf++ = 'x';
		}

		/* Convert integer to string */

		string_length =
		    acpi_ex_convert_to_ascii(obj_desc->integer.value, base,
					     new_buf,
					     acpi_gbl_integer_byte_width);
					     acpi_gbl_integer_byte_width,
					     leading_zeros);

		/* Null terminate at the correct place */

		return_desc->string.length = string_length;
		if (type == ACPI_EXPLICIT_CONVERT_HEX) {

			/* Take "0x" prefix into account */

			return_desc->string.length += 2;
		}

		new_buf[string_length] = 0;
		break;

@@ -448,6 +488,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
			 * From ACPI: "If the input is a buffer, it is converted to a
			 * a string of decimal values separated by commas."
			 */
			leading_zeros = FALSE;
			base = 10;

			/*
@@ -475,6 +516,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
			 *
			 * Each hex number is prefixed with 0x (11/2018)
			 */
			leading_zeros = TRUE;
			separator = ' ';
			string_length = (obj_desc->buffer.length * 5);
			break;
@@ -488,6 +530,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
			 *
			 * Each hex number is prefixed with 0x (11/2018)
			 */
			leading_zeros = TRUE;
			separator = ',';
			string_length = (obj_desc->buffer.length * 5);
			break;
@@ -528,7 +571,8 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,

			new_buf += acpi_ex_convert_to_ascii((u64) obj_desc->
							    buffer.pointer[i],
							    base, new_buf, 1);
							    base, new_buf, 1,
							    leading_zeros);

			/* Each digit is separated by either a comma or space */

Loading