Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp78776lqg; Wed, 10 Apr 2024 16:24:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4JpUbdb7hxNeHrulmGbQi1etha3xEd5Wade1Ix2HjdtqkW1tclTDgSycrk4GD2H9DxP/Z3+KYZuz2mZe/JymAwbxZCpKJEHF4FF1y9w== X-Google-Smtp-Source: AGHT+IGFHiOR1vWpc28BbzlIuTyF1Dvusef7PU1uIzFUUzhC8BVFJP5FVLKlUe7eSG/7Ly+5jfgu X-Received: by 2002:ac8:7c4e:0:b0:435:8832:dd17 with SMTP id o14-20020ac87c4e000000b004358832dd17mr3585800qtv.11.1712791444162; Wed, 10 Apr 2024 16:24:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712791444; cv=pass; d=google.com; s=arc-20160816; b=XdeBjLG30mbIkng3pa2puzDQm+AsH5r75oOy0IN9Jh8tbeqaxBkXwxgResGtosRmVw WRawCwrJ87c6G4CyMhDMvz3O5N5Rijx/tHPrtYlLYpq/oxkBKZVX3ssVetKgDIiOlZgy vNSlSD9gOADlkKfEbGudA8+OVYRgcQSSfoA8VI+sY5wgDzurDpUhL3wqlP+A+r8KlEEX a8XjAnmqS8lZxAtrqEEUiNqPgYsioKxnVhBzQMJniiuU6GZdcMK9wS8+4WFLKTJMV7V9 hEU3ENpzymc1ZHu4rJ/jjnpe9XADUAPy6AsTRbIOWkYHpnj1n0luLviiemOhdHEUibg/ j2+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G5tNScKKkfso59VZQTCkUFsfUUHwdCEYDj4uv2qtrDo=; fh=gVOaIIhWuDDe/ygQbN3vypMcOYr5FOCRyM6FilwIiLY=; b=rfuwJcgM7o+PlIbdS+jtFs0P56UxkFoVT8jw+t12pLAJdBmCUCn3oN+orWiQuvRTCG RT8lGfpFKl7NacnAi3ATXFgfEBTViXg30YFB6yAzZfvmjP3E0o9Im6I9LOHWCCYLXU2r 6NfCpBaEiFRziDc1X1UyZaEjxn5z12CH+J938e8vAHBnFahiZZJV9kE9q6TItlLEXgLS GY0oS7frTkCElPkA8Bg+Txb1KHiN1LW6Dt1wW18WqP0Q+YZGqprRigV6LGBMqpHSmmFA SNFPIGY69B4GDAVjbYnpGMeIkVmLL9fo4MfE31K8BfWVTCpEN0VpcIXC6VQ+sdKEgW+w Ssfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iUoIdMUf; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-139527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f13-20020ac87f0d000000b004347d480f00si268048qtk.797.2024.04.10.16.24.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 16:24:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iUoIdMUf; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-139527-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CCA371C21A65 for ; Wed, 10 Apr 2024 23:24:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4353738DD8; Wed, 10 Apr 2024 23:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iUoIdMUf" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 EBB7EC8DD; Wed, 10 Apr 2024 23:23:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712791435; cv=none; b=o1qGsusIT7DM5YMNIZarSpWUis20/3imHht9SRGCmULMy5rt0x8ndZ/ap3mboKKAUaSMTaeSV9yeft96aYdhMjBo/C5SU2FjwN9Abm3UUg5EwlamRwHqg64vEDJnxAcA2YIZSt/gKOl4IdZNWaljEs+WOE6h+t1BKWLJBtWuDh0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712791435; c=relaxed/simple; bh=E3Miwh3he99yG5NhScfIq3a5E86kZ8yAPEI3XNgclj8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HY2uFhomNHpinjSvuh8hGIPhKGlAr/aHSfff5P9GnLFoFYJOuYaEL+YDuH4/lMn/JSPDFwZXxGchDgi2iXxWTsKEpZAGcH5KJxwiypcs+LbRXCOvAj0rmenAEdzqYM7HWx/45E3ktgj6NGgorIawBlIjxlIlF30N2K/XChymXUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iUoIdMUf; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712791434; x=1744327434; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=E3Miwh3he99yG5NhScfIq3a5E86kZ8yAPEI3XNgclj8=; b=iUoIdMUf0/WE5F5o3qkHEgiWCdHO+dFaibeWbRcAZWHi6FywXgcnNy0h svuby1tfE04g3docv6i+6Py51d4G/sA14GEvpQj0M7r+FCENSlbwoNmAZ rbqm6CfYJCA9HbFdv1YNFhWZCl816yoFssfBxnu7NXWP8Qa9oGBIwpFr5 xY8CsAoyygPa43fVSXm6UamEzw533zyhZxh+u29vgfagHa9ouP/ra4sru g6lC8+A9U4hyUmk5yaxgHHOmXOnzzGv/G9w5GyI3ld9v3CW8R1uVpBcom wRQBYcKLFTZGGwnp87pTjRKm6PaDf4Dgx8whzCyw8lDnxL7OfzpkUbjNx g==; X-CSE-ConnectionGUID: 8hTBxfs/RJy/c5+ujvEXqA== X-CSE-MsgGUID: D+Bkb9H6TEmoECSIe/VEvQ== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="18894710" X-IronPort-AV: E=Sophos;i="6.07,191,1708416000"; d="scan'208";a="18894710" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 16:23:53 -0700 X-CSE-ConnectionGUID: LThPOoZISBepWxIsR/IWcg== X-CSE-MsgGUID: E1TlXYYZTDm/1hnZCgfFdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,191,1708416000"; d="scan'208";a="25357126" Received: from aschofie-mobl2.amr.corp.intel.com (HELO aschofie-mobl2) ([10.255.230.146]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2024 16:23:52 -0700 Date: Wed, 10 Apr 2024 16:23:51 -0700 From: Alison Schofield To: ira.weiny@intel.com Cc: Dave Jiang , Fan Ni , Jonathan Cameron , Navneet Singh , Dan Williams , Davidlohr Bueso , Vishal Verma , linux-btrfs@vger.kernel.org, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 13/26] cxl/mem: Configure dynamic capacity interrupts Message-ID: References: <20240324-dcd-type2-upstream-v1-0-b7b00d623625@intel.com> <20240324-dcd-type2-upstream-v1-13-b7b00d623625@intel.com> 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-Disposition: inline In-Reply-To: <20240324-dcd-type2-upstream-v1-13-b7b00d623625@intel.com> On Sun, Mar 24, 2024 at 04:18:16PM -0700, Ira Weiny wrote: > From: Navneet Singh > > Dynamic Capacity Devices (DCD) support extent change notifications > through the event log mechanism. The interrupt mailbox commands were > extended in CXL 3.1 to support these notifications. > > Firmware can't configure DCD events to be FW controlled but can retain > control of memory events. Split irq configuration of memory events and > DCD events to allow for FW control of memory events while DCD is host > controlled. > > Configure DCD event log interrupts on devices supporting dynamic > capacity. Disable DCD if interrupts are not supported. > > Signed-off-by: Navneet Singh > Co-developed-by: Ira Weiny > Signed-off-by: Ira Weiny > > --- snip > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index 12cd5d399230..ef482eae09e9 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c snip > > +static int cxl_irqsetup(struct cxl_memdev_state *mds, > + struct cxl_event_interrupt_policy *policy, > + bool native_cxl) > +{ > + struct cxl_dev_state *cxlds = &mds->cxlds; > + int rc; > + > + if (native_cxl) { > + rc = cxl_event_irqsetup(mds, policy); > + if (rc) > + return rc; > + } > + > + if (cxl_dcd_supported(mds)) { > + rc = cxl_event_req_irq(cxlds, policy->dcd_settings); > + if (rc) { > + dev_err(cxlds->dev, "Failed to get interrupt for DCD event log\n"); move this.. > + cxl_disable_dcd(mds); to after you've done the disabling... dev_err(cxlds->dev, "DCD disabled: failed to get interrupt for event log\n"); > + return rc; not sure I got the words right. > + } > + } > + > + return 0; > +} > + > static bool cxl_event_int_is_fw(u8 setting) > { > u8 mode = FIELD_GET(CXLDEV_EVENT_INT_MODE_MASK, setting); > @@ -757,17 +793,25 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge, > struct cxl_memdev_state *mds, bool irq_avail) > { > struct cxl_event_interrupt_policy policy = { 0 }; > + bool native_cxl = host_bridge->native_cxl_error; > int rc; > > /* > * When BIOS maintains CXL error reporting control, it will process > * event records. Only one agent can do so. > + * > + * If BIOS has control of events and DCD is not supported skip event > + * configuration. > */ > - if (!host_bridge->native_cxl_error) > + if (!native_cxl && !cxl_dcd_supported(mds)) > return 0; > > if (!irq_avail) { > dev_info(mds->cxlds.dev, "No interrupt support, disable event processing.\n"); > + if (cxl_dcd_supported(mds)) { > + dev_info(mds->cxlds.dev, "DCD requires interrupts, disable DCD\n"); Similar here - Maybe better to disable, and just say it's done because this sounds a bit like a request to the user. > + cxl_disable_dcd(mds); dev_info(mds->cxlds.dev, "DCD disabled: no interrupt support\n"); How come this one is dev_info() and prior case of disabling was a dev_err()/ snip to end -- Alison