From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5913610E5; Thu, 12 Jun 2025 16:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749746779; cv=none; b=EC0xxuuNzSo9wSXD9lx9XXta93/vAAAnkFoctfqfUNnTqlEvmLU5SXbfHWF/Z+ijLIQ+R72hH6VKlCGIAS3CW6YAc3gU8PZKRVM1ZCqS5cfo99imad2L2+65eqRAF7PDDNv97pJK2BwFp1WAagVX6Nu0IeMNk7RA/3KWWSVI8PQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749746779; c=relaxed/simple; bh=CCMK8tQR+66JGqZmkhzAeLW9ppNB/XXNey6niuwUvSY=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W+TyBEMuMSBLj9HuaeBXnEttqwUsOFmizGF51/3Ep5xSk/M50OhNX1aVjntpXEilU4v+sZumkuQHi19WZt+XaEWWokj6fqXUcWMCEmXEd6SXUtUcrrgd8d6QAxZUvjd18X5oQyiNbmqAQcHBkNcqtDpAVfg2przNsREYrcvMHAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4bJ7f94VrMz6K9Bc; Fri, 13 Jun 2025 00:44:17 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 818B7140136; Fri, 13 Jun 2025 00:46:13 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 12 Jun 2025 18:46:12 +0200 Date: Thu, 12 Jun 2025 17:46:10 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v9 11/16] cxl/pci: Update __cxl_handle_cor_ras() to return early if no RAS errors Message-ID: <20250612174610.000035ee@huawei.com> In-Reply-To: <20250603172239.159260-12-terry.bowman@amd.com> References: <20250603172239.159260-1-terry.bowman@amd.com> <20250603172239.159260-12-terry.bowman@amd.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500003.china.huawei.com (7.191.162.67) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 3 Jun 2025 12:22:34 -0500 Terry Bowman wrote: > __cxl_handle_cor_ras() is missing logic to leave the function early in the > case there is no RAS error. Update __cxl_handle_cor_ras() to exit early in > the case there is no RAS errors detected after applying the mask. I'm all for this as sensible cleanup, but the 'missing' kind of suggest a bug to me whereas I don't see one. Perhaps reword? > > Signed-off-by: Terry Bowman > --- > drivers/cxl/core/pci.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c > index 0f4c07fd64a5..f5f87c2c3fd5 100644 > --- a/drivers/cxl/core/pci.c > +++ b/drivers/cxl/core/pci.c > @@ -677,10 +677,11 @@ static void __cxl_handle_cor_ras(struct device *dev, u64 serial, > > addr = ras_base + CXL_RAS_CORRECTABLE_STATUS_OFFSET; > status = readl(addr); > - if (status & CXL_RAS_CORRECTABLE_STATUS_MASK) { > - writel(status & CXL_RAS_CORRECTABLE_STATUS_MASK, addr); > - trace_cxl_aer_correctable_error(dev, serial, status); > - } > + if (!(status & CXL_RAS_CORRECTABLE_STATUS_MASK)) > + return; > + writel(status & CXL_RAS_CORRECTABLE_STATUS_MASK, addr); > + > + trace_cxl_aer_correctable_error(dev, serial, status); > } > > static void cxl_handle_endpoint_cor_ras(struct cxl_dev_state *cxlds)