Message ID | 20200221032720.33893-22-alastair@au1.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add support for OpenCAPI Persistent Memory devices | expand |
On 21/2/20 2:27 pm, Alastair D'Silva wrote: > From: Alastair D'Silva <alastair@d-silva.org> > > When health & performance data is requested from the controller, > it responds with an error log containing the requested information. > > This patch allows the request to me issued via an IOCTL. A better explanation would be good - this IOCTL triggers a request to the controller to collect controller health/perf data, and the controller will later respond with an error log that can be picked up via the error log IOCTL that you've defined earlier.
On Fri, 2020-02-28 at 17:12 +1100, Andrew Donnellan wrote: > On 21/2/20 2:27 pm, Alastair D'Silva wrote: > > From: Alastair D'Silva <alastair@d-silva.org> > > > > When health & performance data is requested from the controller, > > it responds with an error log containing the requested information. > > > > This patch allows the request to me issued via an IOCTL. > > A better explanation would be good - this IOCTL triggers a request > to > the controller to collect controller health/perf data, and the > controller will later respond with an error log that can be picked > up > via the error log IOCTL that you've defined earlier. > > Ok
Le 28/02/2020 à 07:12, Andrew Donnellan a écrit : > On 21/2/20 2:27 pm, Alastair D'Silva wrote: >> From: Alastair D'Silva <alastair@d-silva.org> >> >> When health & performance data is requested from the controller, >> it responds with an error log containing the requested information. >> >> This patch allows the request to me issued via an IOCTL. > > A better explanation would be good - this IOCTL triggers a request to > the controller to collect controller health/perf data, and the > controller will later respond with an error log that can be picked up > via the error log IOCTL that you've defined earlier. And even more precisely (to also check my understanding): > this IOCTL triggers a request to > the controller to collect controller health/perf data, and the > controller will later respond by raising an interrupt to let the user app know that > an error log that can be picked up > via the error log IOCTL that you've defined earlier. The rest of the patch looks ok to me. Fred
On Wed, 2020-03-04 at 12:06 +0100, Frederic Barrat wrote: > > Le 28/02/2020 à 07:12, Andrew Donnellan a écrit : > > On 21/2/20 2:27 pm, Alastair D'Silva wrote: > > > From: Alastair D'Silva <alastair@d-silva.org> > > > > > > When health & performance data is requested from the controller, > > > it responds with an error log containing the requested > > > information. > > > > > > This patch allows the request to me issued via an IOCTL. > > > > A better explanation would be good - this IOCTL triggers a request > > to > > the controller to collect controller health/perf data, and the > > controller will later respond with an error log that can be picked > > up > > via the error log IOCTL that you've defined earlier. > > And even more precisely (to also check my understanding): > > > this IOCTL triggers a request to > > the controller to collect controller health/perf data, and the > > controller will later respond > > by raising an interrupt to let the user app know that > > > an error log that can be picked up > > via the error log IOCTL that you've defined earlier. > > > The rest of the patch looks ok to me. > > Fred Ok
diff --git a/arch/powerpc/platforms/powernv/pmem/ocxl.c b/arch/powerpc/platforms/powernv/pmem/ocxl.c index e46696d3cc36..081883a8247a 100644 --- a/arch/powerpc/platforms/powernv/pmem/ocxl.c +++ b/arch/powerpc/platforms/powernv/pmem/ocxl.c @@ -1000,6 +1000,18 @@ static int ioctl_event_check(struct ocxlpmem *ocxlpmem, u64 __user *uarg) return rc; } +/** + * req_controller_health_perf() - Request controller health & performance data + * @ocxlpmem: the device metadata + * Return: 0 on success, negative on failure + */ +int req_controller_health_perf(struct ocxlpmem *ocxlpmem) +{ + return ocxl_global_mmio_set64(ocxlpmem->ocxl_afu, GLOBAL_MMIO_HCI, + OCXL_LITTLE_ENDIAN, + GLOBAL_MMIO_HCI_REQ_HEALTH_PERF); +} + static long file_ioctl(struct file *file, unsigned int cmd, unsigned long args) { struct ocxlpmem *ocxlpmem = file->private_data; @@ -1037,6 +1049,10 @@ static long file_ioctl(struct file *file, unsigned int cmd, unsigned long args) case IOCTL_OCXL_PMEM_EVENT_CHECK: rc = ioctl_event_check(ocxlpmem, (u64 __user *)args); break; + + case IOCTL_OCXL_PMEM_REQUEST_HEALTH: + rc = req_controller_health_perf(ocxlpmem); + break; } return rc; diff --git a/include/uapi/nvdimm/ocxl-pmem.h b/include/uapi/nvdimm/ocxl-pmem.h index 988eb0bc413d..0d03abb44001 100644 --- a/include/uapi/nvdimm/ocxl-pmem.h +++ b/include/uapi/nvdimm/ocxl-pmem.h @@ -90,5 +90,6 @@ struct ioctl_ocxl_pmem_eventfd { #define IOCTL_OCXL_PMEM_CONTROLLER_STATS _IO(OCXL_PMEM_MAGIC, 0x05) #define IOCTL_OCXL_PMEM_EVENTFD _IOW(OCXL_PMEM_MAGIC, 0x06, struct ioctl_ocxl_pmem_eventfd) #define IOCTL_OCXL_PMEM_EVENT_CHECK _IOR(OCXL_PMEM_MAGIC, 0x07, __u64) +#define IOCTL_OCXL_PMEM_REQUEST_HEALTH _IO(OCXL_PMEM_MAGIC, 0x08) #endif /* _UAPI_OCXL_SCM_H */