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 43DB34D8C8; Fri, 14 Feb 2025 15:15:34 +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=1739546136; cv=none; b=Kc7wOFuhYs9qg+T4ZasbAAh13JZdnNRB5FIT7uqw7u2lG3ckUW8MP23qEAZPuPo9SOCf/7wRBNdqXqj4sDkQil00xlq9G0xUSq6bE+nr7/1pqGq6+LiJlomOK+STGA7+IrknRd51Hllze8KnaX2xAtUZh6Lln4GTdur8EoqvqlE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739546136; c=relaxed/simple; bh=SztRzIL12XfUnzyrrWI4wNNCOSUQZIO3IhlDCPAhm1E=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T2LTSPEhZwEe5joJaQ7Fc+ndie5Y+vf06vyPdDFNJ1aXjMOrBaH+6ustzG22XrHt9jhRbw2ilQNACbFCwzjL+E3TRwI68VxUGImihW7jYWR7L4LKGtJF3TVIfC9NEjetCXN9xVKjLQseoqPpvFToWt0fCA4vh5D61Q1gwU8ttFM= 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.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4YvbDg4qTwz6HJfj; Fri, 14 Feb 2025 23:14:11 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 4B45D1404F5; Fri, 14 Feb 2025 23:15:33 +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; Fri, 14 Feb 2025 16:15:32 +0100 Date: Fri, 14 Feb 2025 15:15:31 +0000 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v7 08/17] cxl/pci: Map CXL PCIe Upstream Switch Port RAS registers Message-ID: <20250214151531.000007d1@huawei.com> In-Reply-To: <20250211192444.2292833-9-terry.bowman@amd.com> References: <20250211192444.2292833-1-terry.bowman@amd.com> <20250211192444.2292833-9-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-kernel@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: lhrpeml100004.china.huawei.com (7.191.162.219) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 11 Feb 2025 13:24:35 -0600 Terry Bowman wrote: > Add logic to map CXL PCIe Upstream Switch Port (USP) RAS registers. > > Introduce 'struct cxl_regs' member into 'struct cxl_port' to cache a > pointer to the CXL Upstream Port's mapped RAS registers. > > Also, introduce cxl_uport_init_ras_reporting() to perform the USP RAS > register mapping. This is similar to the existing > cxl_dport_init_ras_reporting() but for USP devices. > > The USP may have multiple downstream endpoints. Before mapping RAS > registers check if the registers are already mapped. > > Introduce a mutex for synchronizing accesses to the cached RAS > mapping. > > Signed-off-by: Terry Bowman > Reviewed-by: Gregory Price > /** > * cxl_dport_init_ras_reporting - Setup CXL RAS report on this dport > * @dport: the cxl_dport that needs to be initialized > @@ -801,7 +819,6 @@ void cxl_dport_init_ras_reporting(struct cxl_dport *dport) > BIT(CXL_CM_CAP_CAP_ID_RAS))) > dev_err(dport_dev, "Failed to map RAS capability\n"); > mutex_unlock(&ras_init_mutex); > - Grumpy hat (it is Friday afternoon). Shouldn't be in this patch! > } > EXPORT_SYMBOL_NS_GPL(cxl_dport_init_ras_reporting, "CXL");