lkml.org 
[lkml]   [2022]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 3/9] cxl/mem: Clear events on driver load
    On Fri, 12 Aug 2022 22:32:37 -0700
    ira.weiny@intel.com wrote:

    > From: Ira Weiny <ira.weiny@intel.com>
    >
    > The information contained in the events prior to the driver loading can
    > be queried at any time through other mailbox commands.
    >
    > Ensure a clean slate of events by reading and clearing the events. The
    > events are sent to the trace buffer but it is not anticipated to have
    > anyone listening to it at driver load time.

    I'm not totally sold on it being a good idea to drop records on binding
    the device. Let's see what others think...

    >
    > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
    > ---
    > drivers/cxl/pci.c | 2 ++
    > tools/testing/cxl/test/mem.c | 2 ++
    > 2 files changed, 4 insertions(+)
    >
    > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
    > index faeb5d9d7a7a..5f1b492bd388 100644
    > --- a/drivers/cxl/pci.c
    > +++ b/drivers/cxl/pci.c
    > @@ -498,6 +498,8 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
    > if (IS_ERR(cxlmd))
    > return PTR_ERR(cxlmd);
    >
    > + cxl_mem_get_event_records(cxlds);
    > +
    > if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM))
    > rc = devm_cxl_add_nvdimm(&pdev->dev, cxlmd);
    >
    > diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
    > index aa2df3a15051..e2f5445d24ff 100644
    > --- a/tools/testing/cxl/test/mem.c
    > +++ b/tools/testing/cxl/test/mem.c
    > @@ -285,6 +285,8 @@ static int cxl_mock_mem_probe(struct platform_device *pdev)
    > if (IS_ERR(cxlmd))
    > return PTR_ERR(cxlmd);
    >
    > + cxl_mem_get_event_records(cxlds);
    > +
    > if (resource_size(&cxlds->pmem_res) && IS_ENABLED(CONFIG_CXL_PMEM))
    > rc = devm_cxl_add_nvdimm(dev, cxlmd);
    >

    \
     
     \ /
      Last update: 2022-08-24 17:58    [W:3.500 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site