From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56BD3C43334 for ; Wed, 1 Jun 2022 22:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbiFAWKQ (ORCPT ); Wed, 1 Jun 2022 18:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232206AbiFAWKP (ORCPT ); Wed, 1 Jun 2022 18:10:15 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEE17579BB; Wed, 1 Jun 2022 15:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654121413; x=1685657413; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/lpCuAoiby3BDlfBda3ngBvjf+tEQMORsxcOdj/4Jw4=; b=hPvtkE/8YJDLwmX+dC+qdTKLuEITkI2bu7WqdnacphFAFhwUc9whbakG ofoRWELW0SDegsvKntDFvoEfRP+ldmWjMPAKo1wbq5HjBg3U940pcriLH wMRxBA4dTCauzSQnGIQdqEbE64MIH7iWJdHHNDKF2UKFZ+sXGuyelg7bC qNrbT/WYFckS7Hp+CykxAn4chxlGi0wfC7cYCX8dg4OISr45s/y04Kd3B cojyMkdwOeO8RJ3P++YnFwvBjgQ81lv9UU3ksC71OnnjZ0lDB0pB+4mPX rEXYsoGctBK1RbwymKPMFrgE5HsEjfpw1ighJfTpLNf+LC6xlu8V4ork3 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="275471734" X-IronPort-AV: E=Sophos;i="5.91,269,1647327600"; d="scan'208";a="275471734" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 15:10:12 -0700 X-IronPort-AV: E=Sophos;i="5.91,269,1647327600"; d="scan'208";a="530277500" Received: from cwmurphy-mobl2.amr.corp.intel.com (HELO localhost) ([10.212.32.23]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2022 15:10:11 -0700 Date: Wed, 1 Jun 2022 15:10:11 -0700 From: Ira Weiny To: Alison Schofield Cc: "Williams, Dan J" , Bjorn Helgaas , Jonathan Cameron , "Verma, Vishal L" , "Jiang, Dave" , Ben Widawsky , "linux-kernel@vger.kernel.org" , "linux-cxl@vger.kernel.org" , "linux-pci@vger.kernel.org" Subject: Re: [PATCH V9 7/9] cxl/port: Introduce cxl_cdat_valid() Message-ID: References: <20220531152632.1397976-1-ira.weiny@intel.com> <20220531152632.1397976-8-ira.weiny@intel.com> <20220531172146.GB1457068@alison-desk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220531172146.GB1457068@alison-desk> Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Tue, May 31, 2022 at 10:21:46AM -0700, Alison Schofield wrote: > On Tue, May 31, 2022 at 08:26:30AM -0700, Ira Weiny wrote: > > From: Ira Weiny > > > > The CDAT data is protected by a checksum and should be the proper > > length. > > > > Introduce cxl_cdat_valid() to validate the data. While at it check and > > store the sequence number. > > > Store it for ? To see if a subsequent read shows new data. > > > > > +static bool cxl_cdat_valid(struct device *dev, struct cxl_cdat *cdat) > > +{ > > snip > > > + > > + seq = FIELD_GET(CDAT_HEADER_DW3_SEQUENCE, table[3]); > > + /* Store the sequence for now. */ > > + if (cdat->seq != seq) { > > + dev_info(dev, "CDAT seq change %x -> %x\n", cdat->seq, seq); > > + cdat->seq = seq; > > + } > > + > > Wondering when does/will this sequence number come into play? > Not until we start reacting to changes in CDAT. Ira