Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5387564imm; Wed, 12 Sep 2018 05:27:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYRehJarHb0P8SQEYgYFhQqE3XZlxaGATLpEJw6oO+aEYZNpJKe3/Qec15LDuNmSV13UjWE X-Received: by 2002:a62:3001:: with SMTP id w1-v6mr2049419pfw.19.1536755235442; Wed, 12 Sep 2018 05:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536755235; cv=none; d=google.com; s=arc-20160816; b=xLDrgd+PkPOhAOClQLGGjzi9kBBD7IipBCgqwVD6nFc4dsEJifkBCWmiv6RCAAFMBi hyeAO7RgorJcHVNWQiC0pDonQ+xj8U0S7+ZswL6gvP62POTwzbBucgGMDT3HZid3nQxY 72aEoPcRZOmGQfAeHJ0SmQar0m/F42qLtdSz53NO5phA8wlIoEikhU/GGB+y0VFRpfUs hRsaQ6xBCj/1/U16Umzgg+aC/Y57Ck1+rGd6lt6cQ1a4eOHDP9bwHX9jj3DoHpd3Jdt+ GtZ+RyPdviuNpE42cx9wVYjSv0a6u+/vf78o5xC5bMEoDLIg2r0FlqSZq3UsAwUejXli XT+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MZngcynI0w9BBRt67egaubHya/P6YVMYoyPcUnnQb0k=; b=Mnin/qU6dMCYZDM5Cspb+tC3RyWAeoQTO/sqoLaiJHsDz64UiXjRwrv5Opq7BZ1w4a AUVYHa/qMXPUGDHhvBic2ASo9E5wktfWlK8q3OJ8HX0sJtBfiPzY9Hw3qp+5PJIQp9Bp 7EBtdzOMsj+ZYfkWaWrUaAZKICObqEItZVA1/tk25wgprO/lexfYcrmHUSD/xPj4vtuW /5zIoqL2o/mfIr8fSA+Eqnkqz/bfKJq66i6Z9ebv8qbnAPGlpg476yziLjDpGb7WsYAz RTmVV4Hqm0MqOza6tvTQ1oRVvMGZ97nSskU9ge0krKdeuQrbks9Tmcfh6TSRkNt0vQU5 Ofzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="as2/hFXl"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c33-v6si996109pgl.23.2018.09.12.05.26.58; Wed, 12 Sep 2018 05:27:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="as2/hFXl"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727566AbeILRaq (ORCPT + 99 others); Wed, 12 Sep 2018 13:30:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbeILRaq (ORCPT ); Wed, 12 Sep 2018 13:30:46 -0400 Received: from localhost (173-25-171-118.client.mchsi.com [173.25.171.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 032EE20866; Wed, 12 Sep 2018 12:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536755187; bh=8vjHUP7PA4K77HDWZaX13FBIXYbImM2TVptfyoY60ac=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=as2/hFXlYC/doG+uWBTNPHHhYZWNHd1I0eI3FYoWXpL4zvMkybUOkqRaSeASeg2LM 4oe6RmAoPvwPiOF+jQd10mdfww8d0v0pEo/ZucNppzDNXxKQkkGyoRxyyYAnOo8RWr JqQtFj2FwrTI0Ea8DPYTxiIa3UrHjxK1pXCdTt5k= Date: Wed, 12 Sep 2018 07:26:25 -0500 From: Bjorn Helgaas To: Wesley.Sheng@microchip.com Cc: kurt.schwemmer@microsemi.com, logang@deltatee.com, bhelgaas@google.com, corbet@lwn.net, linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] NTB: ntb_hw_switchtec: add pre-requisites for NTB driver and misc updates Message-ID: <20180912122625.GF118330@bhelgaas-glaptop.roam.corp.google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 12, 2018 at 08:55:18AM +0000, Wesley.Sheng@microchip.com wrote: > From: Wesley Sheng > > 1.add pre-requisites for NTB driver > 2.misc updates > change ntb hardware driver name to ntb_hw_switchtec s/ ntb / NTB / > update the description of 2 partitions limit > add reference to Linux Documentation/ntb.txt > add use of term 'Command ID' > add use of term 'Command Return Value' > add a missing ')' > > Signed-off-by: Kelvin Cao > Signed-off-by: Wesley Yung I assume Kurt or Logan will take care of this. > --- > Documentation/switchtec.txt | 30 ++++++++++++++-------- > 1 file changed, 20 insertions(+), 10 deletions(-) > > diff --git a/Documentation/switchtec.txt b/Documentation/switchtec.txt index f788264..40e839d 100644 > --- a/Documentation/switchtec.txt > +++ b/Documentation/switchtec.txt > @@ -23,7 +23,7 @@ The primary means of communicating with the Switchtec management firmware is through the Memory-mapped Remote Procedure Call (MRPC) interface. > Commands are submitted to the interface with a 4-byte command identifier and up to 1KB of command specific data. The firmware will -respond with a 4 bytes return code and up to 1KB of command specific > +respond with a 4-byte return code and up to 1KB of command specific This hunk looks malformed ("-" buried in middle of line above). "Patch" complained that this patch was corrupted. > data. The interface only processes a single command at a time. > > > @@ -36,8 +36,8 @@ device: /dev/switchtec#, one for each management endpoint in the system. > The char device has the following semantics: > > * A write must consist of at least 4 bytes and no more than 1028 bytes. > - The first four bytes will be interpreted as the command to run and > - the remainder will be used as the input data. A write will send the > + The first 4 bytes will be interpreted as the Command ID and the > + remainder will be used as the input data. A write will send the Looks like whitespace at beginning of line is wrong here. > command to the firmware to begin processing. > > * Each write must be followed by exactly one read. Any double write will @@ -45,9 +45,9 @@ The char device has the following semantics: > produce an error. > > * A read will block until the firmware completes the command and return > - the four bytes of status plus up to 1024 bytes of output data. (The > - length will be specified by the size parameter of the read call -- > - reading less than 4 bytes will produce an error. > + the 4-byte Command Return Value plus up to 1024 bytes of output > + data. (The length will be specified by the size parameter of the read > + call -- reading less than 4 bytes will produce an error.) Also here. > * The poll call will also be supported for userspace applications that > need to do other things while waiting for the command to complete. > @@ -83,10 +83,20 @@ The following IOCTLs are also supported by the device: > Non-Transparent Bridge (NTB) Driver > =================================== > > -An NTB driver is provided for the switchtec hardware in switchtec_ntb. > -Currently, it only supports switches configured with exactly 2 -partitions. It also requires the following configuration settings: > +An NTB hardware driver is provided for the switchtec hardware in "Switchtec" should be capitalized when used as a proper adjective like this. When used as the name of the driver, the lower-case "switchtec" is appropriate. > +ntb_hw_switchtec. Currently, it only supports switches configured with > +exactly 2 NT partitions and zero or more non-NT partitions. It also > +requires the following configuration settings: > > -* Both partitions must be able to access each other's GAS spaces. > +* Both NT partitions must be able to access each other's GAS spaces. > Thus, the bits in the GAS Access Vector under Management Settings > must be set to support this. > +* Kernel configuration MUST include support for NTB (CONFIG_NTB needs > + to be set) > + > +NT EP BAR 2 will be dynamically configured as a Direct Window, and the > +configuration file does not need to configure it explicitly. > + > +Please refer to Documentation/ntb.txt in Linux source tree for an > +overall understanding of the Linux NTB stack. ntb_hw_switchtec works as > +an NTB Hardware Driver in this stack.