Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1457257rdh; Fri, 27 Oct 2023 15:16:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKD3KmloOkcE9Bg2s4MpuLyBp0fzFqjIeZQGW2l8BOaRkmTFcCRutgtcSKyQ7zjyfFLKE3 X-Received: by 2002:a05:690c:f8e:b0:5a7:af65:4ec6 with SMTP id df14-20020a05690c0f8e00b005a7af654ec6mr4733230ywb.32.1698445014553; Fri, 27 Oct 2023 15:16:54 -0700 (PDT) Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o184-20020a0de5c1000000b005a88b1c3dcasi3152432ywe.368.2023.10.27.15.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 15:16:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QQsrva4h; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EF76F80F66A4; Fri, 27 Oct 2023 15:16:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346623AbjJ0WQp (ORCPT + 99 others); Fri, 27 Oct 2023 18:16:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232134AbjJ0WQo (ORCPT ); Fri, 27 Oct 2023 18:16:44 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8B3AB; Fri, 27 Oct 2023 15:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698445002; x=1729981002; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=S/6jlToaQ6jHH7sK5e3d4N02hVJImJytWM/Zcs04MWk=; b=QQsrva4hvJnSmO/jfUOScgeLclU7Ahbsh47m/n9mGaftli3pZlX3kzJa n/nt9yB8IlU4e3Ux9JXars5Tx7auhzWfypK9o0Hud2jWH4570sS0L0IQp BvdsH6ab7tD0u1L36dnZF/gqJquBR57WgFpKIMOeIRRKAaG9pihPMxmk9 ceFwkcBjgZ2bSsN7BIHPLdCuM9FSBEgNoQeBh3OOKyiLcBLjW4u4XzdTp y6jwVjGKvb4mhuS6AFOxfEPWi2pmj10GSVza2VGcelluAMFV21R77KIB+ zGbX+u+KvWNYwaID7IEPGZjwevzyNTGr/b8sgEhgs9evdMZyuQzbdtjMV A==; X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="454326247" X-IronPort-AV: E=Sophos;i="6.03,257,1694761200"; d="scan'208";a="454326247" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 15:16:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="794713927" X-IronPort-AV: E=Sophos;i="6.03,257,1694761200"; d="scan'208";a="794713927" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Oct 2023 15:16:41 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 27 Oct 2023 15:16:40 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 27 Oct 2023 15:16:40 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 27 Oct 2023 15:16:40 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 27 Oct 2023 15:16:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CXsZURVrKc/zXMlci09Li6qO7099r0JqTVK0BLVzMxmG6GfjQDtT9GsfuXtTJEyQO4fcNm0GrrsfS2Fqn6lXjOKlzUZaced+vrEzXE/eQ4c7G/KLqhpSybNIpxGV7hkRSYePOnBAI9YVcxQeTlfmeIDoa1Jhjjebou1lJ91IVW+XcS/Ig6tHDKJ+S/jS/U7H4CFBPuQdCwU/iun02Yo6wVgN/F4icooS6uXPcIXHrDTeVNi8m0oiUXTizEtOFcAobD88gg0zDDOwx4Rjvk0IYP6tfXbClXV5FMh5emkZq5dOQ3pIfLaiF1pL2lT2RcjntY6fPZNY72gdr8lWx8E5Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dQ5qcG3n/85ZeR1OJF5XB2KNqcDR8DLh5C1a5vQtPrc=; b=iOYvHKd96Y7IMxlQSB+tLNqsea8cjO+XP3xisQfHiL+CsYBLqmuK1+S8WIAcCKHlOiKLn54yNyDcCb/HJ+UcBQAEoLWsyTUv3PqdA2tUFqYHkAuE8txTc+8bqpcc+ElB8WqI9vLpd8f73h0iLSFnHPuMYXlwKyP+ngGw71GDyPw7pmiFFRivtw4uJWSK6YwMSsgxPWYVczyx0aZV+SDLJ+ZOwl7PoFB+qO/vGXiY0pvSIbPhF1juReKh/Tj3CBIW0xLrMgprqINW0VZ+/sH3qiv4cUZPgn6se4NVCT2sryue353PMwe7hEnz3t4PdUmd3NI0H91jAzmQDOhg6F/xFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) by SJ0PR11MB4832.namprd11.prod.outlook.com (2603:10b6:a03:2dd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Fri, 27 Oct 2023 22:16:33 +0000 Received: from PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::e75f:ec47:9be1:e9e4]) by PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::e75f:ec47:9be1:e9e4%4]) with mapi id 15.20.6907.032; Fri, 27 Oct 2023 22:16:33 +0000 Date: Fri, 27 Oct 2023 15:16:30 -0700 From: Dan Williams To: Robert Richter , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams CC: , , Bjorn Helgaas , Terry Bowman , Robert Richter , Jonathan Cameron Subject: RE: [PATCH v12 14/20] cxl/pci: Map RCH downstream AER registers for logging protocol errors Message-ID: <653c36be4b5bf_244c782942e@dwillia2-xfh.jf.intel.com.notmuch> References: <20231018171713.1883517-1-rrichter@amd.com> <20231018171713.1883517-15-rrichter@amd.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231018171713.1883517-15-rrichter@amd.com> X-ClientProxiedBy: MW4PR03CA0046.namprd03.prod.outlook.com (2603:10b6:303:8e::21) To PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR11MB8107:EE_|SJ0PR11MB4832:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f352df0-95fe-4e6e-9dc2-08dbd73a6082 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mFGcYFxTnwlBnTGX/KsKj7FCYcrXE67VSS0IDNYZJyfBP5WhMBSuKlN7pUxvxXJuYFO7mHS/JFS5VwwRH9yGENBoITTmR9QaIyyRz1n46l9i8Ammez5u1g05NFeNEUWi+tQHqYV2hjobO7/t2hMHRwWMtLB6Z7Se6eeNfLiqZFIj6bouCUZRKquIDTZb+EJxRrSK+7fANrpplSijW+KF3Q+ChOvxpioZ1jhXw2X14lPKHS5D7KMDQyu3GoygQbjQiVAbmPifrlgjxnHcf53YwmS09xdlaKLfmNLozcvaw8nvkI1d/zdC0I1VJLuvfk6uku8+X6thl57mXAqJv9SlCYArRJgIIvxg6xA1TnfDdl+RKPmRGVW3VBnBduZl72mhtQPGbb1VdpjRMEFwGVHJP0dxlIRkd2FEvsMt6wumM5XlHYaRPgtmwxYFCSinMJ3tGJKPnYJvCsqdBTEcK2GJiU0/8ljG2hd/92rdvCyEG1ApqETyd3WWD/TcorIitFgy5wo7MLyB8MPKIb0Rh7SmWEfQSiaCBjjAPTRQ5YpMG6J6gymXcK0+QhV/Kg97clE4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB8107.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(376002)(396003)(39860400002)(366004)(346002)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(478600001)(6486002)(66476007)(9686003)(6506007)(66556008)(6512007)(316002)(66946007)(54906003)(5660300002)(8676002)(4326008)(8936002)(110136005)(41300700001)(2906002)(82960400001)(38100700002)(83380400001)(26005)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Wdj1fKGOqYvJzl0KY86WlSmTbdDt79MWl/bnUIwoACLU40MmQ2dQdg5dqtzO?= =?us-ascii?Q?JlfH+SRNNcHoGt4RXgXFzthRy7LCnkrItD2Lgr5mhVOm0Qnr1WGgHa9sscz0?= =?us-ascii?Q?pedu67G+BU677b0MKfp9imWBLxVnISNd1QwL4nQQo5mEjQ0lr2d566O/wbvV?= =?us-ascii?Q?24oQTJMocialuf8xFc3cI8f3EzBrsy3MkPRAP6uPOaCoZuQCgfnTXWUVIoZU?= =?us-ascii?Q?MHSIwc9vL/8VCuanA5Hsl7vharJBY2i3Z4xOd8YWj+ez2fu0coEvDGqBi9SL?= =?us-ascii?Q?vNWzoTQY9voBk8WBrigbzrmshamExuxLAnrtQ0P07b4yuMqhvnd1mCKFa/jw?= =?us-ascii?Q?V0uL/p6ZMvyASDpDWOiGTb/7x+fPV719XxPvZ+8tibuKCxD7J2b8hESMZKFN?= =?us-ascii?Q?3EuDzMAwkIu0gaicwbq3VSzgviVRbDYr9B0lizkvXBoYXLOCfx97X4Wc29sx?= =?us-ascii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mUP/FjDR8TJzXU?= =?us-ascii?Q?s1MTqh9Kj/5h/ftiFXOTZ/8CnMwxjB4h9j0QiJOn5qd+fJSWru0sI0Qnp4xR?= =?us-ascii?Q?QP+6BnAzgxkGtAzK/q/Aolcpq20pdZigJU+pjqmwi/HKS8A8m8DQoDzODqwB?= =?us-ascii?Q?5t6lY3LZIFyJvextjtvzIEsH84pLTgV7QVMjrIi/uMJsMa/rnR7YIfnTDk3E?= =?us-ascii?Q?tPP10AKlwcINbWXRrVyg1KrKioMVunZDCc0nenZRfXrrNYWq405MexkrKQ1X?= =?us-ascii?Q?ng=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2f352df0-95fe-4e6e-9dc2-08dbd73a6082 X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB8107.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2023 22:16:33.1836 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VNeaf9F/FWMa3EsRbEsbcq+XH/U6cIiWG5VGI0R7/hDzZei8XLhlxqgssBQ3GcNSAFhgvjNGsBzKk/DpFRl/k9kPZBOwFNI9cmXtFoG56cE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4832 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 27 Oct 2023 15:16:52 -0700 (PDT) Robert Richter wrote: > From: Terry Bowman > > The restricted CXL host (RCH) error handler will log protocol errors > using AER and RAS status registers. The AER and RAS registers need to > be virtually memory mapped before enabling interrupts. Create the > initializer function devm_cxl_setup_parent_dport() for this when the > endpoint is connected with the dport. The initialization sets up the > RCH RAS and AER mappings. > > Add 'struct cxl_regs' to 'struct cxl_dport' for saving a pointer to > the RCH downstream port's AER and RAS registers. > > Signed-off-by: Terry Bowman > Co-developed-by: Robert Richter > Signed-off-by: Robert Richter > Reviewed-by: Jonathan Cameron > --- > drivers/cxl/core/pci.c | 36 ++++++++++++++++++++++++++++++++++++ > drivers/cxl/cxl.h | 10 ++++++++++ > 2 files changed, 46 insertions(+) > > diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c > index d101fdafb07c..3b4bb8d05035 100644 > --- a/drivers/cxl/core/pci.c > +++ b/drivers/cxl/core/pci.c > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -730,6 +731,38 @@ static bool cxl_handle_endpoint_ras(struct cxl_dev_state *cxlds) > > #ifdef CONFIG_PCIEAER_CXL Here is more code in an ifdef block that has no compile time dependency on the config symbol. Please do not use ifdef blocks for runtime dependencies. Again, this will need to be a post -rc1 cleanup.