Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1446135rdh; Fri, 27 Oct 2023 14:52:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEx4f2qYvM0OwqQbaxsVgRhlKBaifOrpoFqlR6bpbS+W/nlFCPJ+wiYYCtYKtYU8cQKN9E+ X-Received: by 2002:a81:b659:0:b0:5a8:f9fa:aba4 with SMTP id h25-20020a81b659000000b005a8f9faaba4mr4388578ywk.2.1698443556137; Fri, 27 Oct 2023 14:52:36 -0700 (PDT) Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v5-20020a81a545000000b0058b15a314c0si3621142ywg.431.2023.10.27.14.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 14:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EpmleVaJ; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 35E038374E6D; Fri, 27 Oct 2023 14:52:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346583AbjJ0Vvv (ORCPT + 99 others); Fri, 27 Oct 2023 17:51:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjJ0Vvs (ORCPT ); Fri, 27 Oct 2023 17:51:48 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0ADE5; Fri, 27 Oct 2023 14:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698443506; x=1729979506; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=tcMnJVuRhVNF+LO7qtA9I97LVNepV/bORXUUVNU6AfY=; b=EpmleVaJ15ro5Mkl6943v+4wQeVs9Dki5bBRL0/0x+3MfiarKLui0VOp BeXe7/igGhTAYCcE51WwlJBGocf3ZPVkXUZpAFPWJ2gfz30XBlWpN0lk7 l4MSbd0hl4pCynF+6aYvq5iqSysvOtNOxmbulzy8Rz64Dxwacmbjah4eg BT4kHrirVzv4f/pLGsnEl+78oOsHVcaeBwl8F68Jm7v2YB2rzyJRYwO1h 1wDao5EwOXo58PR+JwykiXD++oWoYTAONQtJj8IwtbuIHWKnz+dIdur5g Mtm5MPVQ/j5OvkbSQ/M6Bz9z+lXfQEuBj8Fb/Bg83c6eqczKKQDQ4mOZ6 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="9393100" X-IronPort-AV: E=Sophos;i="6.03,257,1694761200"; d="scan'208";a="9393100" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 14:51:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="763346779" X-IronPort-AV: E=Sophos;i="6.03,257,1694761200"; d="scan'208";a="763346779" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Oct 2023 14:51:45 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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 14:51:45 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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 14:51:45 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) by edgegateway.intel.com (192.55.55.70) 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 14:51:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2boGpcPc9j+ZKXhKdTg6siuxBXfhzp8HqtgVXfYga9GPKdmn3WUc158PYIaJahyK3onYs3jk1Wz98GP9ipDRwKXmtzHDOmpQqe3JR1tphA4hfr6t9chxTzvmI71XL+Ro8Ebz1DOYFx0BrbuugXiYHUYi78+/9xMeIiROc0GuM4HGwQ+SVRsSTdbE+x717eyywOYj8BWysZYNDgVuxBBeHv/ZBqcZDPdsLTtEcLTLpoXMd/YY/wvB64SwB6uOGg+PAbHZSfw8f+nlb6Ljh022fmPz4TROUXKuSQAYQ4EcZD8h0zwokJQenWf9M5hUlMBZzWTYSRCYrNe69/Cw/B73Q== 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=VabL5PbJq11dBLQVjVEJ5EhgQpJwHwpO7TbLKAXJdZI=; b=NYYNzQ3x+N5YlJIsUEjdGehD7nJHf4v++y5eWztWKCwZaQgk9GS1S0m7lwGOW1CBsxN84A/A+VQRKuhT/1iMrs9vysXXsszyG+09yjp0K4u4yQXiMB+3dDDZU9MHVXICzul2QVYhSiO75KPaA2lS8oLNqbUBHVBI4ZzqWY01RMMupZ8Xizb1sBoxp+/rgZuOowG384ky2BNcheZb+qBY+v13ATv1MX3hCjV2OB4JaQn4qEzAgaz51sBfIRQUVPgd9SWrFENDCOd5w60zO1KqzeI8WSbYFECaIfARbzdUoHztGmqbDjBLwbtkZ65oilVhETG5MYGoFC4PXoxtkTLWhg== 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 LV3PR11MB8744.namprd11.prod.outlook.com (2603:10b6:408:215::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.24; Fri, 27 Oct 2023 21:51:37 +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 21:51:37 +0000 Date: Fri, 27 Oct 2023 14:51:34 -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 Subject: RE: [PATCH v12 07/20] cxl/hdm: Use stored Component Register mappings to map HDM decoder capability Message-ID: <653c30e67e848_244c8f29462@dwillia2-xfh.jf.intel.com.notmuch> References: <20231018171713.1883517-1-rrichter@amd.com> <20231018171713.1883517-8-rrichter@amd.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231018171713.1883517-8-rrichter@amd.com> X-ClientProxiedBy: MW4P221CA0017.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::22) To PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR11MB8107:EE_|LV3PR11MB8744:EE_ X-MS-Office365-Filtering-Correlation-Id: 5eb232d5-4967-412b-0f5a-08dbd736e4bf 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: PJOQRlyA5wXNBCuySGyR64IupwlC84UzFLc+ZiCH2+k7I7Yj3OK/vzkGpUp4Dp16o7aHCwlA84TLeA8lrWZ2OohcsZGq1ei6Suppw8n6qAYomuHGLpTMt63JZ+L0nvY4DNA29L7ceIzu/TVfWyaP5dWPz88Mve2AdMVeAS+riPhokvmDPXF63lKe3M73R+Nthndo/XWmcAEt9uQMM5OwV/nXo177pQ07G9HCj33DwA8Uv7CLyvJkz3DJShYB3cpyKOEYFoniwZ1LDSSmuryjvtg4OWN4D+LgOSclNcQjbyHdn5E+nPNr8lpObSyOwTmmzgUD3rEr5Tudhqd0tdKVJxnxyywm0rR7n99onQ9Wc79iVUvmEjeeQlGMAeQwGeB5GPC4zxHjRelQ5p5qFURYWS4+tKJ342ZFam7A7GczWCQ+eVF4fpOemeh9rGdMCBnnEITvOIJ0LaPq6xXTCSxdn5idMNjjLAqeIuKJ+mYhWH68UcP1ygNJZ+YaHWHgl/j2jyKYFRnuulDqKiChOO0bGRAHc2B/6i9ibc+kTvR4XlcigvTaHuEyruP4iJYJ9Zgd 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)(39860400002)(366004)(136003)(396003)(346002)(376002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(86362001)(41300700001)(5660300002)(8936002)(4326008)(8676002)(2906002)(9686003)(6512007)(83380400001)(26005)(6486002)(6666004)(6506007)(478600001)(66556008)(38100700002)(82960400001)(110136005)(66946007)(66476007)(316002)(54906003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jkLKGQ53WtAI/kgadHqLUvjUXpkq+UGFHmc5YmSSwHaQXIq6bEE9Ve7uppaQ?= =?us-ascii?Q?PQ8NPJt2/JJNOuWBIcdBeDliKO1DXbcPUQJDvAzfWIsaN0l/K4HUXjE5sZrv?= =?us-ascii?Q?GUj2oWWfXCgl58x1llbebIJIIrnDNd0PTQ1IJXKSd2r8N4SKwXcC9fbA1qDM?= =?us-ascii?Q?Krpt0v4Y6floLsVCIWHTczhs/VXm8rwFM9jFCe5Nvp8UvG/+mtnBQSCvqb1w?= =?us-ascii?Q?um6n/kYVqSWesQ9wBksGgm+vhaa6y0Jytk+GSQv6oAOP1JWw8DvZ2z0KEh02?= =?us-ascii?Q?kYNK+fkPgYXUhEUdqAAuT1YBGbEl8Nedj7r41tL5pwmKLKdhtazUgr7xdrQx?= =?us-ascii?Q?CB7s4/629eD5JP87Kjhjs+zyLOcK3Q5iIvDD6TUUSnR+NUaZYlrF9+7+2SCm?= =?us-ascii?Q?fZXcl2uDNn5e2B78VEPlkvAEjZ7M861Wovcu4kEpXBbA9SQEwUdUFDVA1xz5?= =?us-ascii?Q?Zma8AXbEA0y44FzdC5gdX7EPTEL2a+A54A/fXGMs0YQohSWuHv45NbKjk8Ac?= =?us-ascii?Q?ZEaP0KJ3bYAU9cI2ZwEviOWWMmDYE/amEFf76oNpnIuyQod29f9p2dT+7hth?= =?us-ascii?Q?N24l7VmflyIrRxtQ7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MvuK?= =?us-ascii?Q?hPoCD8KmI7Mva36CNOQBygIriiYB8Yku+zfmLGKO8bybH56XvMLABXW34zUm?= =?us-ascii?Q?J/x/4R3GzcIIPy4W9wHUHrkyYatTuoE1QsJ3LpIyI2TvsY3aMJtOeW72IhVE?= =?us-ascii?Q?qA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5eb232d5-4967-412b-0f5a-08dbd736e4bf X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB8107.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2023 21:51:37.0325 (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: d38Ch0Wu7Q0N/0Nv0Xzq8Q6635AR+t2xb2bltUIfTFH2g71oed6/3AsfiGPBPxjklOn55Db81pw8M0GJt5LXC3DqMIanm82abS+kpeEXJPU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR11MB8744 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 14:52:00 -0700 (PDT) Robert Richter wrote: > Now, that the Component Register mappings are stored, use them to > enable and map the HDM decoder capabilities. The Component Registers > do not need to be probed again for this, remove probing code. > > The HDM capability applies to Endpoints, USPs and VH Host Bridges. The > Endpoint's component register mappings are located in the cxlds and > else in the port's structure. Duplicate the cxlds->reg_map in > port->reg_map for endpoint ports. > > Signed-off-by: Terry Bowman > Signed-off-by: Robert Richter > Reviewed-by: Dave Jiang > [rework to drop cxl_port_get_comp_map()] > Signed-off-by: Dan Williams [..] > @@ -164,19 +144,30 @@ struct cxl_hdm *devm_cxl_setup_hdm(struct cxl_port *port, > cxlhdm->port = port; > dev_set_drvdata(dev, cxlhdm); > > - crb = ioremap(port->component_reg_phys, CXL_COMPONENT_REG_BLOCK_SIZE); > - if (!crb && info && info->mem_enabled) { > + /* Memory devices can configure device HDM using DVSEC range regs. */ > + if (reg_map->resource == CXL_RESOURCE_NONE) { > + if (!info && !info->mem_enabled) { > + WARN_ON(1); This new WARN() is not documented in the changelog, it needs to be justified as a valid reason to panic the kernel in case panic_on_warn conservatism is being applied. Even if it could be justified on those grounds it should be combined with the following error message as a dev_WARN(). For now, I'll delete it. > + dev_err(dev, "No component registers mapped\n"); > + return ERR_PTR(-ENXIO); > + } > +