Subject: linux-next: manual merge of the drivers-x86 tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Fri, 1 Mar 2024 14:14:36 +1100

Hi all,

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

  drivers/platform/x86/amd/pmf/tee-if.c

between commit:

  e70961505808 ("platform/x86/amd/pmf: Fixup error handling for amd_pmf_init_smart_pc()")

from Linus' tree and commit:

  6ed210504a18 ("platform/x86/amd/pmf: Add missing __iomem attribute to policy_base")

from the drivers-x86 tree.

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 drivers/platform/x86/amd/pmf/tee-if.c
index 8527dca9cf56,16973bebf55f..000000000000
--- a/drivers/platform/x86/amd/pmf/tee-if.c
+++ b/drivers/platform/x86/amd/pmf/tee-if.c
@@@ -436,44 -453,13 +436,44 @@@ int amd_pmf_init_smart_pc(struct amd_pm
  		return ret;
  
  	INIT_DELAYED_WORK(&dev->pb_work, amd_pmf_invoke_cmd);
 -	amd_pmf_set_dram_addr(dev, true);
 -	amd_pmf_get_bios_buffer(dev);
 +
 +	ret = amd_pmf_set_dram_addr(dev, true);
 +	if (ret)
 +		goto error;
 +
 +	dev->policy_base = devm_ioremap(dev->dev, dev->policy_addr, dev->policy_sz);
 +	if (!dev->policy_base) {
 +		ret = -ENOMEM;
 +		goto error;
 +	}
 +
 +	dev->policy_buf = kzalloc(dev->policy_sz, GFP_KERNEL);
 +	if (!dev->policy_buf) {
 +		ret = -ENOMEM;
 +		goto error;
 +	}
 +
- 	memcpy(dev->policy_buf, dev->policy_base, dev->policy_sz);
++	memcpy_fromio(dev->policy_buf, dev->policy_base, dev->policy_sz);
 +
 +	amd_pmf_hex_dump_pb(dev);
 +
  	dev->prev_data = kzalloc(sizeof(*dev->prev_data), GFP_KERNEL);
  	if (!dev->prev_data)
 -		return -ENOMEM;
 +		goto error;
  
 -	return dev->smart_pc_enabled;
 +	ret = amd_pmf_start_policy_engine(dev);
 +	if (ret)
 +		goto error;
 +
 +	if (pb_side_load)
 +		amd_pmf_open_pb(dev, dev->dbgfs_dir);
 +
 +	return 0;
 +
 +error:
 +	amd_pmf_deinit_smart_pc(dev);
 +
 +	return ret;
  }
  
  void amd_pmf_deinit_smart_pc(struct amd_pmf_dev *dev)