Message ID | 20250220013604.263489-3-dave@stgolabs.net |
---|---|
State | Superseded |
Headers | show |
Series | cxl: Dirty shutdown followups | expand |
Davidlohr Bueso wrote: > ... to a better suited 'cxl_arm_dirty_shutdown()'. > > Reviewed-by: Dave Jiang <dave.jiang@intel.com> > Reviewed-by: Li Ming <ming.li@zohomail.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> > Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> [snip]
On Wed, 19 Feb 2025 17:36:02 -0800 Davidlohr Bueso <dave@stgolabs.net> wrote: > ... to a better suited 'cxl_arm_dirty_shutdown()'. But it works on x86 as well! I'll cope I suppose. Mind you why not let it take the state as a parameter and always pass 1? From a mailbox command point of view 0 is valid. The text in table 8-152 has me a little confused but I think it says you can set it to 1 and back to 0 and then reset at which point the dirty shutdown count will not increment. No idea why you'd do that, but just passing a 1 into this function would make a call of cxl_set_dirty_shutdown_state(mds, 1) seem reasonable, or pass a boolean. > > Reviewed-by: Dave Jiang <dave.jiang@intel.com> > Reviewed-by: Li Ming <ming.li@zohomail.com> > Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> > --- > drivers/cxl/core/mbox.c | 4 ++-- > drivers/cxl/cxlmem.h | 2 +- > drivers/cxl/pmem.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c > index c5eedcae3b02..86d13f4a1c18 100644 > --- a/drivers/cxl/core/mbox.c > +++ b/drivers/cxl/core/mbox.c > @@ -1281,7 +1281,7 @@ int cxl_mem_dpa_fetch(struct cxl_memdev_state *mds, struct cxl_dpa_info *info) > } > EXPORT_SYMBOL_NS_GPL(cxl_mem_dpa_fetch, "CXL"); > > -int cxl_dirty_shutdown_state(struct cxl_memdev_state *mds) > +int cxl_arm_dirty_shutdown(struct cxl_memdev_state *mds) > { > struct cxl_mailbox *cxl_mbox = &mds->cxlds.cxl_mbox; > struct cxl_mbox_cmd mbox_cmd; > @@ -1297,7 +1297,7 @@ int cxl_dirty_shutdown_state(struct cxl_memdev_state *mds) > > return cxl_internal_send_cmd(cxl_mbox, &mbox_cmd); > } > -EXPORT_SYMBOL_NS_GPL(cxl_dirty_shutdown_state, "CXL"); > +EXPORT_SYMBOL_NS_GPL(cxl_arm_dirty_shutdown, "CXL"); > > int cxl_set_timestamp(struct cxl_memdev_state *mds) > {
On Thu, 20 Feb 2025, Jonathan Cameron wrote: >On Wed, 19 Feb 2025 17:36:02 -0800 >Davidlohr Bueso <dave@stgolabs.net> wrote: > >> ... to a better suited 'cxl_arm_dirty_shutdown()'. > >But it works on x86 as well! I'll cope I suppose. > >Mind you why not let it take the state as a parameter >and always pass 1? From a mailbox command point of >view 0 is valid. The text in table 8-152 has me a little confused >but I think it says you can set it to 1 and back to 0 and >then reset at which point the dirty shutdown count will >not increment. > >No idea why you'd do that, but just passing a 1 into >this function would make a call of >cxl_set_dirty_shutdown_state(mds, 1) >seem reasonable, or pass a boolean. I prefer how it is now, really. No point passing the arg which will always be 1, and that "arm/setup" is in the name, so passing 0 would be counter intuitive as well. Thanks, Davidlohr
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index c5eedcae3b02..86d13f4a1c18 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -1281,7 +1281,7 @@ int cxl_mem_dpa_fetch(struct cxl_memdev_state *mds, struct cxl_dpa_info *info) } EXPORT_SYMBOL_NS_GPL(cxl_mem_dpa_fetch, "CXL"); -int cxl_dirty_shutdown_state(struct cxl_memdev_state *mds) +int cxl_arm_dirty_shutdown(struct cxl_memdev_state *mds) { struct cxl_mailbox *cxl_mbox = &mds->cxlds.cxl_mbox; struct cxl_mbox_cmd mbox_cmd; @@ -1297,7 +1297,7 @@ int cxl_dirty_shutdown_state(struct cxl_memdev_state *mds) return cxl_internal_send_cmd(cxl_mbox, &mbox_cmd); } -EXPORT_SYMBOL_NS_GPL(cxl_dirty_shutdown_state, "CXL"); +EXPORT_SYMBOL_NS_GPL(cxl_arm_dirty_shutdown, "CXL"); int cxl_set_timestamp(struct cxl_memdev_state *mds) { diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h index 8e1e46c348f5..6d60030139df 100644 --- a/drivers/cxl/cxlmem.h +++ b/drivers/cxl/cxlmem.h @@ -822,7 +822,7 @@ void cxl_event_trace_record(const struct cxl_memdev *cxlmd, enum cxl_event_log_type type, enum cxl_event_type event_type, const uuid_t *uuid, union cxl_event *evt); -int cxl_dirty_shutdown_state(struct cxl_memdev_state *mds); +int cxl_arm_dirty_shutdown(struct cxl_memdev_state *mds); int cxl_set_timestamp(struct cxl_memdev_state *mds); int cxl_poison_state_init(struct cxl_memdev_state *mds); int cxl_mem_get_poison(struct cxl_memdev *cxlmd, u64 offset, u64 len, diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c index a39e2c52d7ab..6b284962592f 100644 --- a/drivers/cxl/pmem.c +++ b/drivers/cxl/pmem.c @@ -90,7 +90,7 @@ static int cxl_nvdimm_probe(struct device *dev) * clear it upon a successful GPF flow. The exception to this * is upon Viral detection, per CXL 3.2 section 12.4.2. */ - if (cxl_dirty_shutdown_state(mds)) + if (cxl_arm_dirty_shutdown(mds)) dev_warn(dev, "GPF: could not dirty shutdown state\n"); dev_set_drvdata(dev, nvdimm);