Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp808746rdb; Tue, 19 Sep 2023 10:41:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUka4/Sob0g12ovzEmD8IzFhk7SNXB+J2xXpLtg+t/+yYgtS4llidliFSUJYjJ9F0j8XZ9 X-Received: by 2002:a17:903:1109:b0:1c1:e818:1e76 with SMTP id n9-20020a170903110900b001c1e8181e76mr452112plh.6.1695145315187; Tue, 19 Sep 2023 10:41:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695145315; cv=pass; d=google.com; s=arc-20160816; b=VYKRN8TdrvRbTVUd46brd/TKAlpr9HZwICdKZrQdG/MTomFegBXmlya43NO2NAu0yP gugIxo2clDyqEQ86HtitnfvPFFPhvjx+65Un+XvE7em3FyrIfe7GwBZ9UIF7O23qGh4C lKiroELhHvPsHCfsY8rRWIY0ptSpEqFcYGqKxyHHsh3RAk+s8kc2jcvO4sFJcL0rFxdU JqHyKpEscm3tkUWTPwqY1BHWqnOi5rnPp9vMy8YXcCrORI2/ccvPTzA0hXGhiH2i4fA8 qLxKRCmbyFJYDRtkaOcGj/OQ0l4D/e0AUySNOEkH+NAGm8tuO2Yj67LdR8s7mJSBUSq2 aciA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=pAlMbrOY1Ti72v7BGT1BXGVI3MNsaXEvV4JB6CgEC7s=; fh=aFrKlcNVYie2jQnkByiDuIvxFLiedV7VcStoH4XL3Ao=; b=BI5GNJWoRcd0G3wGBoXdZfy1xjiOHzUV/6VyNl0KByTMD+3apAF5XmGALyOMvpaVFF svGEPlaWyD1np8vF4s6IX8LWrmOzlqq8k0uemEHJiwnXsdNvD/h6AJCjAMlPvENM2nB+ TSQhY0Gtrk6Med4EVkaNLMpiUCT8ih3WBY3jZAPZ1UZ/5j0agezAz5lkBMjJ7U7SHrzV SwZ/cJ/UlWlQNFIdZlhieoxZAS5uIUkWcx8bQ4hOotPxoazHcS9M0PSGpdC0aluGsxNr ojlXtiVACe7tcHcJxqJNOW575luMTJqR73uQiiprOLBs+8Fx3egBiKUc2SerOSIwC3D5 E8Gw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hwkqxcbs; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f9-20020a170902684900b001c43cd8b2d5si7298391pln.592.2023.09.19.10.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:41:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hwkqxcbs; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 56A1D81ED068; Tue, 19 Sep 2023 08:08:24 -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 S232542AbjISPIY (ORCPT + 99 others); Tue, 19 Sep 2023 11:08:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbjISPIX (ORCPT ); Tue, 19 Sep 2023 11:08:23 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2073.outbound.protection.outlook.com [40.107.93.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84F2BE; Tue, 19 Sep 2023 08:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLdeljhtbgCK4hpZgF+WrZltIZdCYMhMNAbjjcnQeCTDjOQ6Fr+3EWCPYvQY5PXCsB2LecKPRoTpI2urQ9vlSCoXqjgjDK1xT5bNnEolsujUcJOHX/C4ilUchk8XrbXhdQh9J1NanR5W7hHrqFPUU1isQcZkgUW/WifSJ16m28tD1J+7RnSTmEc3Qppm1DvzWo/AQihxDLVWCPhkBV3nRv/jLa93mmFtww4XzdEIwzxdyPYxcRQ9yFpnR7EH8E2a2CaIixx3BsUt3Gzf8ZDqOVmQgLU6quZ+4OiLPyhq4swH4uPEw//bcItlwBJAHUYXbK3jyzQgVG9IgML6my//BQ== 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=pAlMbrOY1Ti72v7BGT1BXGVI3MNsaXEvV4JB6CgEC7s=; b=ZUcrX3EHSjz9DCreRkXXHr34QCLsP7zwIrQF6SOAI6TVu3uIWa/+MkGQ36zVnLJFGPJZRpMG/1f1IRPLj3ZpgthEeBpFzNl0JPTsPhIf2UL5+QSh6HjuMcbNR02mtuDrDZSBDjnKmWQ6zUPQMu9kpmsyL18jYmeE2MG0WLUqrfY8tsnpOrlqw7EvZHmd+sm2fUDHg8T6r3oyvd2E/Ihz/MQfEb9O82GoE2ubYMmi/t0TPHwmfOWxNjrg0sT3/3qq0YK3EGNOisFUepMSmfDySQGi666xa6Oc1wUMrwVTYS6fyj4bZbEWO82Zp0ofKJTKjLzX4wS+XDkDGo7oBY9eHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pAlMbrOY1Ti72v7BGT1BXGVI3MNsaXEvV4JB6CgEC7s=; b=hwkqxcbsa1602cEMuN0i7lt+uhCmIY3LVU5+rPOCV/TFv3OhKQi1ZbTNDGdIxl2RnUXvx/EOCLtAb+lpYdgg+SOu/l9dgB98R7uq4sfDbIxJQDRMOrfqLIaqKoZ1S8IZO8zFayP+82MQIV06aDBoJJR2nQHyjEB/WlLKH1K5isE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS0PR12MB6390.namprd12.prod.outlook.com (2603:10b6:8:ce::7) by PH7PR12MB9175.namprd12.prod.outlook.com (2603:10b6:510:2e6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20; Tue, 19 Sep 2023 15:08:13 +0000 Received: from DS0PR12MB6390.namprd12.prod.outlook.com ([fe80::5b90:dbf9:e0a5:64cc]) by DS0PR12MB6390.namprd12.prod.outlook.com ([fe80::5b90:dbf9:e0a5:64cc%6]) with mapi id 15.20.6792.026; Tue, 19 Sep 2023 15:08:13 +0000 Message-ID: Date: Tue, 19 Sep 2023 10:08:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v10 12/15] cxl/pci: Disable root port interrupts in RCH mode To: Dan Williams , alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, bwidawsk@kernel.org, dave.jiang@intel.com, Jonathan.Cameron@huawei.com, linux-cxl@vger.kernel.org Cc: rrichter@amd.com, linux-kernel@vger.kernel.org, bhelgaas@google.com References: <20230831170248.185078-1-terry.bowman@amd.com> <20230831170248.185078-5-terry.bowman@amd.com> <6504a5e23cee9_d7cc8294b7@dwillia2-xfh.jf.intel.com.notmuch> Content-Language: en-US From: Terry Bowman In-Reply-To: <6504a5e23cee9_d7cc8294b7@dwillia2-xfh.jf.intel.com.notmuch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR13CA0016.namprd13.prod.outlook.com (2603:10b6:806:21::21) To DS0PR12MB6390.namprd12.prod.outlook.com (2603:10b6:8:ce::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB6390:EE_|PH7PR12MB9175:EE_ X-MS-Office365-Filtering-Correlation-Id: f6548868-d04e-4d85-9b07-08dbb9223e58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f8Ewvv+9PeWb/Qo3mOdePzifV9UwK/1ojbLviszxXSt1ysRr9LBXg+qUgyPKLcUF6KScNEnV6oAg8ijnj2uUtbWcTXgxkF5XOMihb7uaJz0J4CMFm8mHkl9lfL4diOSCSGqg+x4QO6D3lDW3qVEjgztaE8d6z1MZT0SPeXgfEjNgv8tf+vCI51FlaIQsuBwaaoKBnwEVAzvX+0+Yw4OmaFk7L7rcxC6heQsUjWjs1QTKC3uOMdgZ/gRCchCkX/5tS+9ojxbbxc3d/9VmX/waO/tkITCMvZy/L1LrYG/HIITvze6aACOMJ+Cvw9m9jaq8+8DvOz/2a6OEbfzZym53Hwbo7vM7uCE7icCBs4uaDmVVRzf5qIcTgWILLYJfTyIUSHKcPhuZBhioRI3FFTuzpW4rh/REzIyC5r1FBCoJgcKzb65xKtzXlbnNHXyYpjS3bTqOscVI9QXMSCI1YrrNsTZoc8H5DLRVyphiOax1nredvpKsGftGSLyW5sDbTvRDy4cHZg9t8ucu85Xr7RNj8SpMXSDnY1p7juQ+YkrHxjWEb7LOik+8ax6cgywGfTYXRx65Xm+M2Q05TxvwilBc7avBEXRXqjmsJDGCVd0mkJC4BXtt+WxZrAKaI4t3GIQkYrWvJ06TvNHrhI+urBbfuw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB6390.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(366004)(376002)(39860400002)(396003)(1800799009)(186009)(451199024)(66946007)(36756003)(6486002)(2906002)(6506007)(53546011)(26005)(83380400001)(478600001)(2616005)(8676002)(8936002)(4326008)(7416002)(66556008)(66476007)(316002)(41300700001)(6512007)(38100700002)(31696002)(86362001)(5660300002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXhjTjZmUzBCM2xRa0pDa3lTdkpvQXZvZW40K3ZGOUNPdFhWbXFSOU1xTm5R?= =?utf-8?B?SERINnVyQVVJcXAxZzRHVVM1UFJpVnZINk0rT3ZzcG5RMUU3ZUFuMFUzN1dv?= =?utf-8?B?VFFQWFlSSU9xdndOOFlYaEJXR2s1eWxpWm9KQitQQStORDFrU1BMdHM3WVM0?= =?utf-8?B?SGY5R1JucWJVZ1V5MFFkL2xQM040NEFqMHgrMWdRckZySEk3ZVBaMHdmSDFD?= =?utf-8?B?R2VxUWlIZkhEbFdUUWNrZFhxV1kyRjhF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f-8?B?bTVvVnRiT0pNNjNlNVVaaGFqOWhzeVpuNDh6WWtYRDBkS2tpakJuejJlb3Vo?= =?utf-8?Q?QobCCHwwRvRddUPctaNRdDFld?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6548868-d04e-4d85-9b07-08dbb9223e58 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB6390.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2023 15:08:13.0438 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Uu+t8x2MRKosP0XNPpOEo+qLJW01Jwi43x7LArs1lhsQQtFKD2C2arI4OOPi6HBtTugxALuQlKMZ+mxPH9f7UA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9175 X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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]); Tue, 19 Sep 2023 08:08:24 -0700 (PDT) Hi Dan, I added comments below. On 9/15/23 13:43, Dan Williams wrote: > Terry Bowman wrote: >> The RCH root port contains root command AER registers that should not be >> enabled.[1] Disable these to prevent root port interrupts. >> >> [1] CXL 3.0 - 12.2.1.1 RCH Downstream Port-detected Errors >> >> Signed-off-by: Terry Bowman >> Signed-off-by: Robert Richter >> Reviewed-by: Jonathan Cameron >> Reviewed-by: Dave Jiang > [..] >> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c >> index 2a22a7ed4704..d195af72ed65 100644 >> --- a/drivers/cxl/core/port.c >> +++ b/drivers/cxl/core/port.c >> @@ -1042,6 +1042,9 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev, >> >> cxl_dport_map_regs(dport); >> >> + if (dport->rch) >> + cxl_disable_rch_root_ints(dport); >> + > > Similar to the comment about cxl_dport_map_regs() not being appropriate > in an enumeration routine, this also needs to move out of _add_dport. It > occurs to me that it should also be undone on driver detach just like > other device "enables". Ok. I will move out of enumeration. Per the 'undo' request: This is a RCH downstream port (dport) with PCIe root port capability. PCI spec states root port error reporting is disabled by default at powerup. And SW does *not* enable the root port errors because the RCH dport is *not* bound to a root port driver (missing BDF, etc). This mask is added to follow the CXL spec precisely and if the rest of the system behaves as expected should not be necessary. I don't believe masking should be 'undone' in driver detach or elsewhere. Adding the 'undo' masking would potentially introduce RCH dport root port interrupt reporting which is incorrect for the RCH/RCD mode. Only CXL components (device, uport, switch) may reside under the RCH dport and never want RCH dport reporting root port errors. RCEC reports the root complex errors in RCH/RCD mode. Regards, Terry