[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6549643e8d8a1_90fed2941f@iweiny-mobl.notmuch>
Date: Mon, 6 Nov 2023 14:10:06 -0800
From: Ira Weiny <ira.weiny@...el.com>
To: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>,
Ira Weiny <ira.weiny@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
"Jonathan Cameron" <jonathan.cameron@...wei.com>
CC: Yazen Ghannam <yazen.ghannam@....com>,
Davidlohr Bueso <dave@...olabs.net>,
Dave Jiang <dave.jiang@...el.com>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
"Ard Biesheuvel" <ardb@...nel.org>, <linux-efi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-cxl@...r.kernel.org>
Subject: Re: [PATCH RFC v3 6/6] cxl/memdev: Register for and process CPER
events
Smita Koralahalli wrote:
> On 11/1/2023 2:11 PM, Ira Weiny wrote:
>
[snip]
> > +#define CXL_EVENT_HDR_FLAGS_REC_SEVERITY GENMASK(1, 0)
> > +static int cxl_cper_event_call(struct notifier_block *nb, unsigned long action,
> > + void *data)
> > +{
> > + struct cxl_cper_notifier_data *nd = data;
> > + struct cper_cxl_event_devid *device_id = &nd->rec->hdr.device_id;
> > + enum cxl_event_log_type log_type;
> > + struct cxl_memdev_state *mds;
> > + struct cxl_dev_state *cxlds;
> > + struct pci_dev *pdev;
> > + unsigned int devfn;
> > + u32 hdr_flags;
> > +
> > + mds = container_of(nb, struct cxl_memdev_state, cxl_cper_nb);
> > +
> > + /* PCI_DEVFN() would require 2 extra bit shifts; skip those */
> > + devfn = (device_id->slot_num & 0xfff8) | (device_id->func_num & 0x07);
>
> devfn = PCI_DEVFN(device_id->device_num, device_id->func_num) should
> also work correct?
Device num is the slot number right shifted? If so then yes. I'm not an
expert on the PCIe nomenclature.
>
> > + pdev = pci_get_domain_bus_and_slot(device_id->segment_num,
> > + device_id->bus_num, devfn);
> > + cxlds = pci_get_drvdata(pdev);
> > + if (cxlds != &mds->cxlds) {
>
> Do we need a error message here?
No, it is just that this event is not for this device. Another device
will process it. Or if there is no driver loaded for the device it will
be ignored. (Same as would happen if the events were coming through the
log because the driver is not monitoring the log.)
Ira
Powered by blists - more mailing lists