Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1078116rdb; Wed, 1 Nov 2023 10:36:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWnQ7NcdpxyaYMwKO7dGRE+D+AWxB6rwCDmY+oBla14wqWUNgC30OnahTVmawofDZSs8Mo X-Received: by 2002:a05:6358:d09b:b0:168:e6dd:25ee with SMTP id jc27-20020a056358d09b00b00168e6dd25eemr17467957rwb.16.1698860206002; Wed, 01 Nov 2023 10:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698860205; cv=none; d=google.com; s=arc-20160816; b=xagZ8D0Jz8bSucj0OIOvuILJ8Ahs6PCBk+NNqPVz8dQ+olQxyKAFgvgAPdLV/KOBCn QsSNwmae+8MeXR22hILLPVu6nn7FQVxafUBsPuZXgtwMSU44u5oXB73irC4Mbk7lMd9f f/MgCmV1A1/Ro+h14S7UOyPBf+s6EQMidiMIywnakWvHGg/iOcPgk5W8JjpNoF0shIfM smmIzh1TjzdN/9N4EaKGQtpAHSNw00ufSR8JdjJNQChrQA47toUmlkQD4wP1YBODtAFF 9pjGZsEqGJp7rPxeH6tFctEZ5H8PZ1FqV2EWMxCiDn9Gje8VMR0WnKvNopbjmd8NAMc0 EZgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=v1l515YAbwaRpRgUgrw+aZJlWeoALlBZntzoKP0wJXk=; fh=qqJ0UNRNjZ1ay1RO00R0vBkdqENwkzbwMjQE5Vxp9t4=; b=ikq81B0pYsfpHsnBm9z5NU6WmJXG0XL0uOQkEGQFl5UnH8dhB8Lp3j2uFjzidVvB4k cxxLaABZXtiaTC4JPUIQDWF7xgKlwsWah9aMxYcdFThvNfff7WqsZO5s1sTP/kxkEYLy ZVzTkvEVto+XCpFhpGv75LiUmdilLc/FNNOJ07SH77ebR6IN5cJ8XT5TxwDY16XLFNNf RKVxx99+PUpg1PzvYk8Rt9eiPVG5M5Lg7z8D//wt9qyVfh3AK6KLmoQqYpGREZYLppIt 8jNNZetLEs+nQ2tbj/XfeaiJHQ2hXIee3ldnGgaEqE5uCETgpgVIr9NYzRxa13xtWy2b N77g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u184-20020a6385c1000000b005af7c6a2212si287807pgd.648.2023.11.01.10.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 10:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EC4B380B1FBE; Wed, 1 Nov 2023 10:36:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344526AbjKARgI (ORCPT + 99 others); Wed, 1 Nov 2023 13:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344449AbjKARgH (ORCPT ); Wed, 1 Nov 2023 13:36:07 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D926C1; Wed, 1 Nov 2023 10:36:03 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4SLDfh1WTxz6K8xG; Thu, 2 Nov 2023 01:35:08 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 1 Nov 2023 17:36:00 +0000 Date: Wed, 1 Nov 2023 17:35:59 +0000 From: Jonathan Cameron To: Ira Weiny CC: Dan Williams , Smita Koralahalli , Yazen Ghannam , Davidlohr Bueso , Dave Jiang , Alison Schofield , Vishal Verma , Ard Biesheuvel , , , Subject: Re: [PATCH RFC v2 3/3] cxl/memdev: Register for and process CPER events Message-ID: <20231101173559.0000112c@Huawei.com> In-Reply-To: <654135c4f3e0_2e75b2949e@iweiny-mobl.notmuch> References: <20230601-cxl-cper-v2-0-314d9c36ab02@intel.com> <20230601-cxl-cper-v2-3-314d9c36ab02@intel.com> <653aee8ad2717_780ef29418@dwillia2-xfh.jf.intel.com.notmuch> <654135c4f3e0_2e75b2949e@iweiny-mobl.notmuch> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 10:36:14 -0700 (PDT) On Tue, 31 Oct 2023 10:13:40 -0700 Ira Weiny wrote: > Dan Williams wrote: > > Ira Weiny wrote: > > > If the firmware has configured CXL event support to be firmware first > > > the OS can process those events through CPER records. Matching memory > > > devices to the CPER records can be done via the serial number which is > > > part of the CPER record header. > > > > > > Detect firmware first, register a notifier callback for each memdev, and > > > trace events when they match a device registered. > > > > > > Signed-off-by: Ira Weiny > > > > > [..] > > > > The changes requested in patch2 cover all of the comments I currently > > have on this patch, just one more cleanup below: > > > > > +#define CXL_EVENT_HDR_FLAGS_REC_SEVERITY GENMASK(1, 0) > > > +int cxl_cper_event_call(struct notifier_block *nb, unsigned long action, void *data) > > > +{ > > > + struct cxl_cper_notifier_data *nd = data; > > > + struct cxl_event_record_raw record = (struct cxl_event_record_raw) { > > > + .hdr.id = UUID_INIT(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), > > > + }; > > > > Just do: > > > > struct cxl_event_record_raw record = { 0 }; FWIW (I'm in a pedantic mood), unless you care about that specific 0 = {}; equally valid. c99 "If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate ... the remainder of the aggregate shall be initiali\ed implicitly the same as objects that have static storage duration." i.e. to 0. Nothing says that fewer != 0 ;) > > > > ...and the compiler will take care of the rest as initializing any field > > automatically initializes everything else to zero. > > Not quite sure what I was thinking. > > This works better but I think I can avoid needing this initialization all > together by reworking the structures. For now I have made the change and > I'll see how it falls out. > > Thanks, > Ira >