diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2026-02-25 13:23:04 +0200 |
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2026-02-25 13:23:04 +0200 |
| commit | f09812b85fa6f41058bcc46e70ac406bf9b0493a (patch) | |
| tree | 3c9b679b33a85434ea937b6e74d3be3b6f9629ff /drivers/resctrl | |
| parent | 24e2e6581d602f75174010b32bf3e96ec39465ab (diff) | |
| parent | 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f (diff) | |
Merge drm/drm-next into drm-intel-next
Sync with v7.0-rc1 which contains a few treewide changes affecting i915.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/resctrl')
| -rw-r--r-- | drivers/resctrl/mpam_devices.c | 20 | ||||
| -rw-r--r-- | drivers/resctrl/mpam_internal.h | 9 |
2 files changed, 16 insertions, 13 deletions
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c index 0b5b158e1aaf..1eebc2602187 100644 --- a/drivers/resctrl/mpam_devices.c +++ b/drivers/resctrl/mpam_devices.c @@ -295,7 +295,7 @@ mpam_class_alloc(u8 level_idx, enum mpam_class_types type) lockdep_assert_held(&mpam_list_lock); - class = kzalloc(sizeof(*class), GFP_KERNEL); + class = kzalloc_obj(*class); if (!class) return ERR_PTR(-ENOMEM); init_garbage(&class->garbage); @@ -343,7 +343,7 @@ mpam_component_alloc(struct mpam_class *class, int id) lockdep_assert_held(&mpam_list_lock); - comp = kzalloc(sizeof(*comp), GFP_KERNEL); + comp = kzalloc_obj(*comp); if (!comp) return ERR_PTR(-ENOMEM); init_garbage(&comp->garbage); @@ -398,7 +398,7 @@ mpam_vmsc_alloc(struct mpam_component *comp, struct mpam_msc *msc) lockdep_assert_held(&mpam_list_lock); - vmsc = kzalloc(sizeof(*vmsc), GFP_KERNEL); + vmsc = kzalloc_obj(*vmsc); if (!vmsc) return ERR_PTR(-ENOMEM); init_garbage(&vmsc->garbage); @@ -1072,7 +1072,7 @@ static void __ris_msmon_read(void *arg) u64 now; bool nrdy = false; bool config_mismatch; - bool overflow; + bool overflow = false; struct mon_read *m = arg; struct mon_cfg *ctx = m->ctx; bool reset_on_next_read = false; @@ -1176,10 +1176,11 @@ static void __ris_msmon_read(void *arg) } mpam_mon_sel_unlock(msc); - if (nrdy) { + if (nrdy) m->err = -EBUSY; + + if (m->err) return; - } *m->val += now; } @@ -2418,7 +2419,7 @@ static int __allocate_component_cfg(struct mpam_component *comp) if (comp->cfg) return 0; - comp->cfg = kcalloc(mpam_partid_max + 1, sizeof(*comp->cfg), GFP_KERNEL); + comp->cfg = kzalloc_objs(*comp->cfg, mpam_partid_max + 1); if (!comp->cfg) return -ENOMEM; @@ -2443,9 +2444,8 @@ static int __allocate_component_cfg(struct mpam_component *comp) if (!ris->props.num_mbwu_mon) continue; - mbwu_state = kcalloc(ris->props.num_mbwu_mon, - sizeof(*ris->mbwu_state), - GFP_KERNEL); + mbwu_state = kzalloc_objs(*ris->mbwu_state, + ris->props.num_mbwu_mon); if (!mbwu_state) { __destroy_component_cfg(comp); return -ENOMEM; diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h index e79c3c47259c..e8971842b124 100644 --- a/drivers/resctrl/mpam_internal.h +++ b/drivers/resctrl/mpam_internal.h @@ -12,7 +12,6 @@ #include <linux/jump_label.h> #include <linux/llist.h> #include <linux/mutex.h> -#include <linux/srcu.h> #include <linux/spinlock.h> #include <linux/srcu.h> #include <linux/types.h> @@ -201,8 +200,12 @@ struct mpam_props { } PACKED_FOR_KUNIT; #define mpam_has_feature(_feat, x) test_bit(_feat, (x)->features) -#define mpam_set_feature(_feat, x) set_bit(_feat, (x)->features) -#define mpam_clear_feature(_feat, x) clear_bit(_feat, (x)->features) +/* + * The non-atomic get/set operations are used because if struct mpam_props is + * packed, the alignment requirements for atomics aren't met. + */ +#define mpam_set_feature(_feat, x) __set_bit(_feat, (x)->features) +#define mpam_clear_feature(_feat, x) __clear_bit(_feat, (x)->features) /* The values for MSMON_CFG_MBWU_FLT.RWBW */ enum mon_filter_options { |
