Therefore, this should trigger a `dev_err()` and be considered a BIOS bug. Thanks, Shyam > >> Â Â Â Â Â Â Â Â Â return -EINVAL; >> Â Â Â Â Â } >> Â diff --git a/drivers/platform/x86/amd/pmf/pmf.h >> b/drivers/platform/x86/amd/pmf/pmf.h >> index 8ce8816da9c1..a79808fda1d8 100644 >> --- a/drivers/platform/x86/amd/pmf/pmf.h >> +++ b/drivers/platform/x86/amd/pmf/pmf.h >> @@ -13,6 +13,7 @@ >> Â Â #include <linux/acpi.h> >> Â #include <linux/input.h> >> +#include <linux/platform_device.h> >> Â #include <linux/platform_profile.h> >> Â Â #define POLICY_BUF_MAX_SZÂ Â Â Â Â Â Â 0x4b000 >> @@ -355,19 +356,20 @@ struct amd_pmf_dev { >> Â Â Â Â Â /* Smart PC solution builder */ >> Â Â Â Â Â struct dentry *esbin; >> Â Â Â Â Â unsigned char *policy_buf; >> -Â Â Â u32 policy_sz; >> +Â Â Â resource_size_t policy_sz; >> Â Â Â Â Â struct tee_context *tee_ctx; >> Â Â Â Â Â struct tee_shm *fw_shm_pool; >> Â Â Â Â Â u32 session_id; >> Â Â Â Â Â void *shbuf; >> Â Â Â Â Â struct delayed_work pb_work; >> Â Â Â Â Â struct pmf_action_table *prev_data; >> -Â Â Â u64 policy_addr; >> +Â Â Â resource_size_t policy_addr; >> Â Â Â Â Â void __iomem *policy_base; >> Â Â Â Â Â bool smart_pc_enabled; >> Â Â Â Â Â u16 pmf_if_version; >> Â Â Â Â Â struct input_dev *pmf_idev; >> Â Â Â Â Â size_t mtable_size; >> +Â Â Â struct resource *res; >> Â }; >> Â Â struct apmf_sps_prop_granular_v2 { >> diff --git a/drivers/platform/x86/amd/pmf/tee-if.c >> b/drivers/platform/x86/amd/pmf/tee-if.c >> index 19c27b6e4666..555b8d6314e0 100644 >> --- a/drivers/platform/x86/amd/pmf/tee-if.c >> +++ b/drivers/platform/x86/amd/pmf/tee-if.c >> @@ -257,7 +257,7 @@ static int amd_pmf_invoke_cmd_init(struct >> amd_pmf_dev *dev) >> Â Â Â Â Â Â Â Â Â return -ENODEV; >> Â Â Â Â Â } >> Â -Â Â Â dev_dbg(dev->dev, "Policy Binary size: %u bytes\n", >> dev->policy_sz); >> +Â Â Â dev_dbg(dev->dev, "Policy Binary size: %llu bytes\n", >> dev->policy_sz); >> Â Â Â Â Â memset(dev->shbuf, 0, dev->policy_sz); >> Â Â Â Â Â ta_sm = dev->shbuf; >> Â Â Â Â Â in = &ta_sm->pmf_input.init_table; >> @@ -512,9 +512,9 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev) >> Â Â Â Â Â if (ret) >> Â Â Â Â Â Â Â Â Â goto error; >> Â -Â Â Â dev->policy_base = devm_ioremap(dev->dev, dev->policy_addr, >> dev->policy_sz); >> -Â Â Â if (!dev->policy_base) { >> -Â Â Â Â Â Â Â ret = -ENOMEM; >> +Â Â Â dev->policy_base = devm_ioremap_resource(dev->dev, dev->res); >> +Â Â Â if (IS_ERR(dev->policy_base)) { >> +Â Â Â Â Â Â Â ret = PTR_ERR(dev->policy_base); >> Â Â Â Â Â Â Â Â Â goto error; >> Â Â Â Â Â } >> Â >