Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1591346pxb; Wed, 10 Feb 2021 11:56:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIDjhcZNFmLFTJtnRRaOWeUaSDe+FAqaxI8VtYwVkmlFsxDOkyMRd1QO/+zfnNEhNrXmpl X-Received: by 2002:a50:da8b:: with SMTP id q11mr4912261edj.352.1612986980519; Wed, 10 Feb 2021 11:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612986980; cv=none; d=google.com; s=arc-20160816; b=bFah52chP5ABSPKQ1vVdTx25oYItqX93SzOkvBJhP4XuseeVw1tMewjJ6j7a1KbzCb 4J0MCgnbKMW1xaW+3308c5hdLZdsCFBjnmlEqwZ1PLXdoxppevPHhrVTk2YNsYuiRS3j z19JcQzfr3V9fvsdVGRGtNhNA+uz9jjBMDDCWtnamLibkzU1yocP/8s9q4jGQ8/WdD+G ddUVihWDYhYxRxtNjwZ0Q+Cb85ppfQkMxMN815WqLG+VzhXME44kF7gZNEQXP1LuDXp8 Pg4DAQk+BHG8mC0V4Rs26VFf1xAbEogbJ9snhz9QLnU9SAlyrM5JK4NjpEHTsRTwbgdY OGXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=r8ql4t5FN+DQ5z6SKaawhVvoEWWehqT+I1El6GCGVQ4=; b=e2d4japXlt/jqK8g0QvIeFGM6yChjn1488qCwQnvTN5Kr9bvUS9u2o1/VNEal1qmev 5C/1jc+jhicEzGLldbIQ+8rqjDpt8YF9InLDvb15pnYW3iQ1LSyGzAUxXX76vow0YW4B 9KdIa+eWbYqrgELjLmo3sSqLsGaOvJeLzC68pAXVyluE1oUkv+O0bNNMmwxDPGDj1XWQ c2q8e8KG6/nCvc+S/AlMj3zXl3y5uXIbYkzrwaaSTARxepl72DfwDdiq4psiyvP9qBd5 zwZSZKeZ49Jb8NfzcwUM4ouDCc1MUcaXH8DkWrXdl+uk3T1Hx8qPCki5x3VjkwOimBPI YA2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=UZb6WVbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si1993147edd.7.2021.02.10.11.55.57; Wed, 10 Feb 2021 11:56:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=UZb6WVbT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232633AbhBJTz0 (ORCPT + 99 others); Wed, 10 Feb 2021 14:55:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232588AbhBJTzW (ORCPT ); Wed, 10 Feb 2021 14:55:22 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90ECAC0613D6 for ; Wed, 10 Feb 2021 11:54:41 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id p20so6333688ejb.6 for ; Wed, 10 Feb 2021 11:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r8ql4t5FN+DQ5z6SKaawhVvoEWWehqT+I1El6GCGVQ4=; b=UZb6WVbTWSGdh6Bv8sJ0CZE9rE5T4V6FvNnZjV+yO5TAkRphM7kzZ4CnBzE+DtGp7T KZ8+plW5edXC0gs6ASCzCyGGBR3vCrnphh8APG2ELadQqqAiM6B+WMcvnSehEoq6sNnR J0nHzUDbHdZRZcZYKFCy1GsHkZMhkqgChpVYtn/C9TaUk4wW/raUMMFvoMwLNKNjY53p tB8hJhtHR/KBTboYiE5NKWek/XIXfGesldItsTvDTnGbmz5y37Km1pbFiJzGF+Bm1P+E BzZCe/NLem1n16h0IqP8PtixD6bbV9Z+ODchWMMICWSnZG844Zm9P0nm/K/1rPyxZkA9 kwHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r8ql4t5FN+DQ5z6SKaawhVvoEWWehqT+I1El6GCGVQ4=; b=N6yZK8+iNypsmzFqZSFlU3p5SxDZmx8Fqznhk/UhWXxcBsyRq/fPyexAmrjNM7tTqZ wbNPaXPqEd6t2utkThvl0J355uQ7uAyqdJW9ehtkKb3u7I1yYnqzw+8lDDYt7XAhooku /iOvloGpWku4L2+/Xv9nrLkRgT78RhbRwKKdUBGWNAS15xiJI1E3l2k02ykWUWsYsNqe /o9Dx1E7hzbx/LxxWmihaDe0CPdgSlvJcL6rNDF7dkz9I01FHcolyKBLt1hYh/1nT56U CM/i9PKrDVqjr+QvOn0zMe+gv3O2KoFaG8NLD4HAtmijfoEJE1hQQhTVkXFvEpenQcEh t/yQ== X-Gm-Message-State: AOAM531h4xw4DgY5nxZg/I0F/wxST2ogGhdt5BVjmhyw2goF3PnFDE3C IXBw0UXbF0IHwTfWNTbtqAx7KGc8PVxHv/hzCqO1wQ== X-Received: by 2002:a17:906:57cd:: with SMTP id u13mr4661147ejr.341.1612986880263; Wed, 10 Feb 2021 11:54:40 -0800 (PST) MIME-Version: 1.0 References: <20210210000259.635748-1-ben.widawsky@intel.com> <20210210000259.635748-3-ben.widawsky@intel.com> <20210210174104.0000710a@Huawei.com> <20210210185319.chharluce2ly4cne@intel.com> In-Reply-To: <20210210185319.chharluce2ly4cne@intel.com> From: Dan Williams Date: Wed, 10 Feb 2021 11:54:29 -0800 Message-ID: Subject: Re: [PATCH v2 2/8] cxl/mem: Find device capabilities To: Ben Widawsky Cc: Jonathan Cameron , linux-cxl@vger.kernel.org, Linux ACPI , Linux Kernel Mailing List , linux-nvdimm , Linux PCI , Bjorn Helgaas , Chris Browy , Christoph Hellwig , David Hildenbrand , David Rientjes , Ira Weiny , Jon Masters , Rafael Wysocki , Randy Dunlap , Vishal Verma , "John Groves (jgroves)" , "Kelley, Sean V" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 10:53 AM Ben Widawsky wrote: [..] > > Christoph raised this in v1, and I agree with him that his would me more compact > > and readable as > > > > struct range pmem_range; > > struct range ram_range; > > > > The discussion seemed to get lost without getting resolved that I can see. > > > > I had been waiting for Dan to chime in, since he authored it. I'll change it and > he can yell if he cares. No concerns from me. > > > > + > > > + struct { > > > + struct range range; > > > + } ram; > > > > > +}; > > > + > > > +#endif /* __CXL_H__ */ > > > diff --git a/drivers/cxl/mem.c b/drivers/cxl/mem.c > > > index 99a6571508df..0a868a15badc 100644 > > > --- a/drivers/cxl/mem.c > > > +++ b/drivers/cxl/mem.c > > > > > > ... > > > > > +static void cxl_mem_mbox_timeout(struct cxl_mem *cxlm, > > > + struct mbox_cmd *mbox_cmd) > > > +{ > > > + struct device *dev = &cxlm->pdev->dev; > > > + > > > + dev_dbg(dev, "Mailbox command (opcode: %#x size: %zub) timed out\n", > > > + mbox_cmd->opcode, mbox_cmd->size_in); > > > + > > > + if (IS_ENABLED(CONFIG_CXL_MEM_INSECURE_DEBUG)) { > > > > Hmm. Whilst I can see the advantage of this for debug, I'm not sure we want > > it upstream even under a rather evil looking CONFIG variable. > > > > Is there a bigger lock we can use to avoid chance of accidental enablement? > > Any suggestions? I'm told this functionality was extremely valuable for NVDIMM, > though I haven't personally experienced it. Yeah, there was no problem with the identical mechanism in LIBNVDIMM land. However, I notice that the useful feature for LIBNVDIMM is the option to dump all payloads. This one only fires on timeouts which is less useful. So I'd say fix it to dump all payloads on the argument that the safety mechanism was proven with the LIBNVDIMM precedent, or delete it altogether to maintain v5.12 momentum. Payload dumping can be added later. [..] > > > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > > > index e709ae8235e7..6267ca9ae683 100644 > > > --- a/include/uapi/linux/pci_regs.h > > > +++ b/include/uapi/linux/pci_regs.h > > > @@ -1080,6 +1080,7 @@ > > > > > > /* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */ > > > #define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */ > > > +#define PCI_DVSEC_HEADER1_LENGTH_MASK 0xFFF00000 > > > > Seems sensible to add the revision mask as well. > > The vendor id currently read using a word read rather than dword, but perhaps > > neater to add that as well for completeness? > > > > Having said that, given Bjorn's comment on clashes and the fact he'd rather see > > this stuff defined in drivers and combined later (see review patch 1 and follow > > the link) perhaps this series should not touch this header at all. > > I'm fine to move it back. Yeah, we're playing tennis now between Bjorn's and Christoph's comments, but I like Bjorn's suggestion of "deduplicate post merge" given the bloom of DVSEC infrastructure landing at the same time.