Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5191616rwb; Mon, 31 Jul 2023 20:49:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEfGgy0icMVv/oKRMKBhu2THP9q8a6TI3ZwSW2f9bJUT2rUMqONsunmgGSlWdJc2NBaDXxx X-Received: by 2002:a17:90b:f88:b0:268:3f4f:7bdb with SMTP id ft8-20020a17090b0f8800b002683f4f7bdbmr10672283pjb.18.1690861798607; Mon, 31 Jul 2023 20:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690861798; cv=none; d=google.com; s=arc-20160816; b=LvB/qWEiUPu/sDFMPz4WYbBAkIG0+k5TalkcWwnRtlmbR/4+hurSnYHoyLovew0M4K sUssEvxc5iPkrFm0QoTHXLCxJKyTzhzLdgTKwlThZl/DQDjyUA5hhpDT1vRXEm10V+s/ 2aV9Vzs8uS1TguygPFCrPaQe+JqYD3gE2N+3lYhDaBuoCdWBgeYJYKWxfqyAxU/qx1ae EFtNDAfoBD7KTYAvgVyJ3J0+BdbQw8B0WUOKsUfp2yJ8HFp2iR8hqNDDa3UpZvRp/OUc fGbJpaNcPOtgQp8hP1dUwpVtHMzQ6xEG1bh4/EPExKFheqO3gPhGKdpOfDV7sOdW8TKR Ndew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XDrEwdngrOAn22A13SJxL+2pUD5w0pVv5ruFO6t5rcE=; fh=6KhyV+tK1GiJCfE8RbqmdVcl+JMv0jYDX/5PZ3d12pI=; b=QaW0/WBVZQusJVE2WxO//KVkxE5Mc1uhYLWrEzNZaPLIxClq+rhxzSpnFR7vjetNTM zA29C/b9I90WX1yewAuInKUnEm+3ObjbP2zxSkeHtwtQ7DYPISHRPjkJKkt+DGDazWnn dGHAbHPS6RyJlPQ303DafjaYjL9YBC/dtdH+q27Jc6fpLSgcK3984DW3xOY/Y/keWZ86 D239PSwJD2Vimtl3rUtcLNpxZdAj6Fgsq/pZpW4iZRe9zfI6wC/WPmvDkXpDPY/zJPJ5 Cp27F/CSZTfmCEmeTeyWR162psbC9+XD5lw5rUn1lnj1Mf/irtVxuWHmRpDH+9O3/MQk BJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PpIAuttx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il5-20020a17090b164500b00262f937bf93si8599906pjb.77.2023.07.31.20.49.47; Mon, 31 Jul 2023 20:49:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PpIAuttx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231772AbjHABYL (ORCPT + 99 others); Mon, 31 Jul 2023 21:24:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231748AbjHABYG (ORCPT ); Mon, 31 Jul 2023 21:24:06 -0400 Received: from mgamail.intel.com (unknown [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE70B1707; Mon, 31 Jul 2023 18:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690853044; x=1722389044; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=KhN5AuFcQElJOP62go3wRfM0GbtP4K7iYQy+CQD//dY=; b=PpIAuttxLc/HdKFvNMW36MqxHJCSeaf1mYVtEpZ2izDjblN7d1jnMkxW fn95uX+y6gb+XBDJBXI3UqHx6P5Ex1x1KD1Fq4YTEtKFI6UM2fjtyZ+aZ 6gz5DjzaiETGrFvwY8Qn7d94C4Oirf0HaJD8wdWMA0/Vu+33ziABjB3nG lEFsxgL619HJeoOkSOAn5U6df8RWNOYXzeRVsSHCh+Y71cW/pZCTQgz8y iFkmM3k7A9ocaxVBjmkPGQrgVtRWiumHiH9C17IkYp+ig9clRBW7/uySj Iu87UjyiS6IqH4MdxvmD0Jwza9glr594Gx9m0vmhWi+YA7CWRkwBCDq4c A==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="366638749" X-IronPort-AV: E=Sophos;i="6.01,246,1684825200"; d="scan'208";a="366638749" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 18:24:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="705629549" X-IronPort-AV: E=Sophos;i="6.01,246,1684825200"; d="scan'208";a="705629549" Received: from aschofie-mobl2.amr.corp.intel.com (HELO aschofie-mobl2) ([10.255.229.233]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 18:24:03 -0700 Date: Mon, 31 Jul 2023 18:24:02 -0700 From: Alison Schofield To: Ira Weiny Cc: Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Vishal Verma , Dan Williams , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cxl/mbox: Fix debug message print Message-ID: References: <20230731-cxl-fix-clear-event-debug-print-v1-1-42c068f500d1@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731-cxl-fix-clear-event-debug-print-v1-1-42c068f500d1@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 01:52:27PM -0700, Ira Weiny wrote: Looks like this is rolling for the distro list, so.. Please be more specific than this: [PATCH] cxl/mbox: Fix debug message print Something like this is more useful to folks scanning the one-liners: [PATCH] cxl/mbox: Use correct handle in events debug message > The handle value used to report an event being cleared by dev_dbg() is > incorrect due to a post increment of the payload handle index. > > Delay the increment of the index until after the print. Also add the > debugging for event processing which was useful in finding this bug. > "Also" always smells like something that should be a separate patch. I guess you could rewrite the commit message and keep it in one patch: [PATCH] cxl/mbox: Improve event dev_dbg() messages Alison > To: Davidlohr Bueso > To: Jonathan Cameron > To: Dave Jiang > To: Alison Schofield > To: Vishal Verma > To: Dan Williams > Cc: Jonathan Cameron > Cc: linux-cxl@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Ira Weiny > --- > NOTE: This does fix a bug in the patch referenced below. However, I > don't think that warrants back porting because this is only a debug > print. > > Fixes: 6ebe28f9ec72 ("cxl/mem: Read, trace, and clear events on driver load") > --- > drivers/cxl/core/mbox.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c > index d6d067fbee97..f052d5f174ee 100644 > --- a/drivers/cxl/core/mbox.c > +++ b/drivers/cxl/core/mbox.c > @@ -882,9 +882,10 @@ static int cxl_clear_event_record(struct cxl_memdev_state *mds, > */ > i = 0; > for (cnt = 0; cnt < total; cnt++) { > - payload->handles[i++] = get_pl->records[cnt].hdr.handle; > + payload->handles[i] = get_pl->records[cnt].hdr.handle; > dev_dbg(mds->cxlds.dev, "Event log '%d': Clearing %u\n", log, > le16_to_cpu(payload->handles[i])); > + i++; > > if (i == max_handles) { > payload->nr_recs = i; > @@ -946,9 +947,13 @@ static void cxl_mem_get_records_log(struct cxl_memdev_state *mds, > if (!nr_rec) > break; > > - for (i = 0; i < nr_rec; i++) > + for (i = 0; i < nr_rec; i++) { > + dev_dbg(dev, "Event log %d: processing handle %u\n", > + type, > + le16_to_cpu(payload->records[i].hdr.handle)); > cxl_event_trace_record(cxlmd, type, > &payload->records[i]); > + } > > if (payload->flags & CXL_GET_EVENT_FLAG_OVERFLOW) > trace_cxl_overflow(cxlmd, type, payload); > > --- > base-commit: 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 > change-id: 20230731-cxl-fix-clear-event-debug-print-3b57da0e956c > > Best regards, > -- > Ira Weiny >