linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Dan Williams <dan.j.williams@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Dave Jiang <dave.jiang@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Yuntao Wang <ytcoode@gmail.com>
Subject: linux-next: manual merge of the cxl tree with the pm tree
Date: Tue, 2 Jan 2024 14:55:34 +1100	[thread overview]
Message-ID: <20240102145534.5c977c95@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3298 bytes --]

Hi all,

Today's linux-next merge of the cxl tree got a conflict in:

  lib/fw_table.c

between commit:

  4b3805daaacb ("ACPI: tables: Correct and clean up the logic of acpi_parse_entries_array()")

from the pm tree and commit:

  60e43fe5285e ("lib/firmware_table: tables: Add CDAT table parsing support")

from the cxl tree.

Dan, thanks again for the heads up.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc lib/fw_table.c
index c49a09ee3853,1e5e0b2f7012..000000000000
--- a/lib/fw_table.c
+++ b/lib/fw_table.c
@@@ -85,9 -98,27 +98,22 @@@ acpi_get_subtable_type(char *id
  	return ACPI_SUBTABLE_COMMON;
  }
  
- static __init_or_acpilib int call_handler(struct acpi_subtable_proc *proc,
- 					  union acpi_subtable_headers *hdr,
- 					  unsigned long end)
+ static unsigned long __init_or_fwtbl_lib
+ acpi_table_get_length(enum acpi_subtable_type type,
+ 		      union fw_table_header *header)
+ {
+ 	if (type == CDAT_SUBTABLE) {
+ 		__le32 length = (__force __le32)header->cdat.length;
+ 
+ 		return le32_to_cpu(length);
+ 	}
+ 
+ 	return header->acpi.length;
+ }
+ 
 -static __init_or_fwtbl_lib bool has_handler(struct acpi_subtable_proc *proc)
 -{
 -	return proc->handler || proc->handler_arg;
 -}
 -
+ static __init_or_fwtbl_lib int call_handler(struct acpi_subtable_proc *proc,
+ 					    union acpi_subtable_headers *hdr,
+ 					    unsigned long end)
  {
  	if (proc->handler)
  		return proc->handler(hdr, end);
@@@ -127,10 -158,14 +153,13 @@@ acpi_parse_entries_array(char *id, unsi
  {
  	unsigned long table_end, subtable_len, entry_len;
  	struct acpi_subtable_entry entry;
+ 	enum acpi_subtable_type type;
  	int count = 0;
 -	int errs = 0;
  	int i;
  
- 	table_end = (unsigned long)table_header + table_header->length;
+ 	type = acpi_get_subtable_type(id);
+ 	table_end = (unsigned long)table_header +
+ 		    acpi_table_get_length(type, table_header);
  
  	/* Parse all entries looking for a match. */
  
@@@ -168,9 -209,31 +197,31 @@@
  	}
  
  	if (max_entries && count > max_entries) {
 -		pr_warn("[%4.4s:0x%02x] found the maximum %i entries\n",
 -			id, proc->id, count);
 +		pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n",
 +			id, proc->id, count - max_entries, count);
  	}
  
 -	return errs ? -EINVAL : count;
 +	return count;
  }
+ 
+ int __init_or_fwtbl_lib
+ cdat_table_parse(enum acpi_cdat_type type,
+ 		 acpi_tbl_entry_handler_arg handler_arg,
+ 		 void *arg,
+ 		 struct acpi_table_cdat *table_header)
+ {
+ 	struct acpi_subtable_proc proc = {
+ 		.id		= type,
+ 		.handler_arg	= handler_arg,
+ 		.arg		= arg,
+ 	};
+ 
+ 	if (!table_header)
+ 		return -EINVAL;
+ 
+ 	return acpi_parse_entries_array(ACPI_SIG_CDAT,
+ 					sizeof(struct acpi_table_cdat),
+ 					(union fw_table_header *)table_header,
+ 					&proc, 1, 0);
+ }
+ EXPORT_SYMBOL_FWTBL_LIB(cdat_table_parse);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2024-01-02  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  3:55 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-02  3:49 linux-next: manual merge of the cxl tree with the pm tree Stephen Rothwell
2023-10-30  4:05 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240102145534.5c977c95@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=ytcoode@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).