Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6428822pxb; Wed, 17 Feb 2021 04:29:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxD2WoXjJX+/L5G127KDBeSmLKWuDJBXyO3yc1M4OQsMpS8a4cqASMpz426m0J2YjlG0kbJ X-Received: by 2002:a17:907:96aa:: with SMTP id hd42mr25077060ejc.526.1613564949403; Wed, 17 Feb 2021 04:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613564949; cv=none; d=google.com; s=arc-20160816; b=O2UpU83AR8IBCrLugUgt2g583wCRv3h4lKQFxTVDUEP+zMWyrCQfEm0G0Niu26DfcH 4Y/k71Au+Nq8QRDp4EjrgqVs8w2OIqjJvOcDi7ynVzvcyX9GVnWPfnQsNaqyC22sqfOI lBgQMb2eNquDswS3+9/J/z3mQG4U6mZm4Tkqb5vAP2WOByFObf78CgReGSbj3bpCMXiF iCPHgQYABuoDsnK6/jp8H1LAaWT0fpXbp+c3v2LF7hBswbitVkupDt/59IwDaHmgYk3+ XbDfSi5Z9DaqJ/XXSDBFPXUKup3rrCtrD6WHHh2Cvjzui0GRdMuQltehdq4AFsC9UP7N 6HXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=xK/twD79/SCAiVYvslFUrKNT2MFBzV6BongVgg0hK4E=; b=Tb+5jVZgodeDwjvMhUG6xKIYQZBe3u2EiczDeDdBpHEF1CDBvzch/Fq88iIRBZVPX0 /+wRQZjzg/CwphTvHc3A3GLGvwdeCViWK82I5/NAn5g9rAbnRmZ1z9JHzxnDrZGPG71d HsZM6PsOpE2SHx7yITs7p37TVm8feSSTu2mVCcvEOs5n47iU3a6bScR8EthgYXdnl+X4 MTZWvBDaj5CuHMnDuXH+zp3Dd8UdzDLzGF/VN0c9k3MM2BIbTnCpZO/26ZgXlF1gjFIV atcMeu894r81oy0L3C1JDDerV375nzlEcGK9BSw/6EXr0F+9Ge3/rtgfDyCxC3EgsYPG 26hQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si1186643ejc.473.2021.02.17.04.28.44; Wed, 17 Feb 2021 04:29:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232556AbhBQMYo (ORCPT + 99 others); Wed, 17 Feb 2021 07:24:44 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2580 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbhBQMYn (ORCPT ); Wed, 17 Feb 2021 07:24:43 -0500 Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DgcMF4f0Yz67q1Q; Wed, 17 Feb 2021 20:18:49 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 17 Feb 2021 13:24:00 +0100 Received: from localhost (10.47.29.73) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Wed, 17 Feb 2021 12:23:59 +0000 Date: Wed, 17 Feb 2021 12:22:53 +0000 From: Jonathan Cameron To: Ben Widawsky CC: , , , , , Bjorn Helgaas , "Chris Browy" , Christoph Hellwig , "Dan Williams" , David Hildenbrand , David Rientjes , Ira Weiny , "Jon Masters" , Rafael Wysocki , Randy Dunlap , Vishal Verma , "John Groves (jgroves)" , "Kelley, Sean V" , Colin Ian King , Dan Carpenter Subject: Re: [PATCH v5 2/9] cxl/mem: Find device capabilities Message-ID: <20210217122253.00007bc2@Huawei.com> In-Reply-To: <20210217040958.1354670-3-ben.widawsky@intel.com> References: <20210217040958.1354670-1-ben.widawsky@intel.com> <20210217040958.1354670-3-ben.widawsky@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.29.73] X-ClientProxiedBy: lhreml704-chm.china.huawei.com (10.201.108.53) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Feb 2021 20:09:51 -0800 Ben Widawsky wrote: > Provide enough functionality to utilize the mailbox of a memory device. > The mailbox is used to interact with the firmware running on the memory > device. The flow is proven with one implemented command, "identify". > Because the class code has already told the driver this is a memory > device and the identify command is mandatory. > > CXL devices contain an array of capabilities that describe the > interactions software can have with the device or firmware running on > the device. A CXL compliant device must implement the device status and > the mailbox capability. Additionally, a CXL compliant memory device must > implement the memory device capability. Each of the capabilities can > [will] provide an offset within the MMIO region for interacting with the > CXL device. > > The capabilities tell the driver how to find and map the register space > for CXL Memory Devices. The registers are required to utilize the CXL > spec defined mailbox interface. The spec outlines two mailboxes, primary > and secondary. The secondary mailbox is earmarked for system firmware, > and not handled in this driver. > > Primary mailboxes are capable of generating an interrupt when submitting > a background command. That implementation is saved for a later time. > > Reported-by: Colin Ian King (coverity) > Reported-by: Dan Carpenter (smatch) > Link: https://www.computeexpresslink.org/download-the-specification > Signed-off-by: Ben Widawsky > Reviewed-by: Dan Williams (v2) Looks good to me. Reviewed-by: Jonathan Cameron