mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
arm_mpam: propagate MSC access errors for state saving function
Allow the mpam_save_mbwu_state() function to return an error, and propagate read and write errors from the lower level up. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Reviewed-by: Ben Horgan <ben.horgan@arm.com> Reviewed-by: Gavin Shan <gshan@redhat.com> Tested-by: Gavin Shan <gshan@redhat.com> # on NVIDIA Grace Hopper [morse: Fixed merge conflicts in mpam_save_mbwu_state() and __ris_msmon_read()] Signed-off-by: James Morse <james.morse@arm.com>
This commit is contained in:
parent
d326995393
commit
a3a94c13c4
|
|
@ -1859,6 +1859,7 @@ static int mpam_restore_mbwu_state(void *_ris)
|
||||||
static int mpam_save_mbwu_state(void *arg)
|
static int mpam_save_mbwu_state(void *arg)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
int ret;
|
||||||
u64 val;
|
u64 val;
|
||||||
struct mon_cfg *cfg;
|
struct mon_cfg *cfg;
|
||||||
struct mon_read mbwu_arg;
|
struct mon_read mbwu_arg;
|
||||||
|
|
@ -1877,10 +1878,18 @@ static int mpam_save_mbwu_state(void *arg)
|
||||||
|
|
||||||
mon_sel = FIELD_PREP(MSMON_CFG_MON_SEL_MON_SEL, i) |
|
mon_sel = FIELD_PREP(MSMON_CFG_MON_SEL_MON_SEL, i) |
|
||||||
FIELD_PREP(MSMON_CFG_MON_SEL_RIS, ris->ris_idx);
|
FIELD_PREP(MSMON_CFG_MON_SEL_RIS, ris->ris_idx);
|
||||||
mpam_write_monsel_reg(msc, CFG_MON_SEL, mon_sel);
|
ret = mpam_write_monsel_reg(msc, CFG_MON_SEL, mon_sel);
|
||||||
mpam_read_monsel_reg(msc, CFG_MBWU_FLT, &cur_flt);
|
if (ret)
|
||||||
mpam_read_monsel_reg(msc, CFG_MBWU_CTL, &cur_ctl);
|
return ret;
|
||||||
mpam_write_monsel_reg(msc, CFG_MBWU_CTL, 0);
|
ret = mpam_read_monsel_reg(msc, CFG_MBWU_FLT, &cur_flt);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
ret = mpam_read_monsel_reg(msc, CFG_MBWU_CTL, &cur_ctl);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
ret = mpam_write_monsel_reg(msc, CFG_MBWU_CTL, 0);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
cfg->mon = i;
|
cfg->mon = i;
|
||||||
cfg->pmg = FIELD_GET(MSMON_CFG_x_FLT_PMG, cur_flt);
|
cfg->pmg = FIELD_GET(MSMON_CFG_x_FLT_PMG, cur_flt);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user