Received: by 10.223.164.202 with SMTP id h10csp4218037wrb; Mon, 20 Nov 2017 11:49:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMaWYeBAP7j+7x3ygP6WaUaMSLodvHfjpL1NFdO2XEhVy2DdB/vt7eER5zMjDdXk2VLZL3je X-Received: by 10.98.223.217 with SMTP id d86mr12616941pfl.190.1511207354905; Mon, 20 Nov 2017 11:49:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511207354; cv=none; d=google.com; s=arc-20160816; b=uBU+dvo9QPYnPylbpUSoomnDwEE6oem3Vl6aqC3KGuvFo/uXPYOmO6tJujSiql+zAv S01XD4goQF5WLd6K0m3mExF+em2gFCi1VsLA83Ur7zVVGIfsmqLBSHKGTqVBEvAHAfFT ZB4eoce6m8z3CIjrqAp+whX9T+27KpYZukxaSWzP6c4o0cu7OV0CJuKpearc/h76rxYJ oDSepTY7XtSFMjifemv4u/aoJNy1Q9XHN2DOWiThQR41IITy32M1TCYDn1k5x7GbCMpc +yVQSDlak/Ro+0MfnyM6MHmKJARklkBd+TJEN0fHAa6qpASAqF3wrFxeI5tpYbFXMykW 5Pzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lFKRKYOL9RLMCzKTCioxqoNUCsxYXkGZbJXbHLsShJM=; b=0m5QHVsjD7DM6fdQnM300mddFjPecwt5I/f5Ts7/OBTSmmUfa68V0hsZVe1h8nRZht NGaJjEsYkm59Ik8DOo+iTLjVhxS9a9S4FTfoEcRNtTCd0wBMeR/44mpapaXTWY3M4EYD nuapUitH1nZC9QpXhvnsP3KuLajP8V8Akl0pN7KKZAVDKgm6nPROl6VS8aDSpcA/PlIn zPD66czjpAg2ZIHfoCeHjYo5/gAV0prJ4q76QkZiaJeoNS5ShIq1tBsebfeZw4kcSmfB P1P7H8LSp2YIG6QdUvQ0HWBzH7J/IpPSqb7xKgDf5eihxLwQ30M/xDQkTimgADKOKhJS iuxw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24si8719046plq.427.2017.11.20.11.49.04; Mon, 20 Nov 2017 11:49:14 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbdKTTrG (ORCPT + 67 others); Mon, 20 Nov 2017 14:47:06 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60070 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752253AbdKTTrE (ORCPT ); Mon, 20 Nov 2017 14:47:04 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAKJkmvN041984 for ; Mon, 20 Nov 2017 14:47:04 -0500 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ec1jrdje4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Nov 2017 14:47:03 -0500 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Nov 2017 12:47:03 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Nov 2017 12:47:00 -0700 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAKJkxPK10027274; Mon, 20 Nov 2017 12:46:59 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B20BCC6047; Mon, 20 Nov 2017 12:46:59 -0700 (MST) Received: from oc3016140333.ibm.com (unknown [9.41.174.252]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 33DFBC603C; Mon, 20 Nov 2017 12:46:59 -0700 (MST) From: Eddie James To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, devicetree@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, bradleyb@fuzziesquirrel.com, cbostic@linux.vnet.ibm.com, joel@jms.id.au, eajames@linux.vnet.ibm.com, "Edward A. James" Subject: [PATCH v5 0/8] drivers/fsi: Add SBEFIFO and OCC client drivers Date: Mon, 20 Nov 2017 13:46:49 -0600 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17112019-8235-0000-0000-00000C99AE42 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008100; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000240; SDB=6.00948744; UDB=6.00479090; IPR=6.00729025; BA=6.00005702; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00018111; XFM=3.00000015; UTC=2017-11-20 19:47:02 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112019-8236-0000-0000-00003E86C83C Message-Id: <1511207217-14075-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-20_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711200264 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Edward A. James" This series adds two FSI-based device drivers; one for the SBEFIFO and one for the On-Chip Controller (OCC). IBM POWER9 processors contain some embedded hardware and software bits collectively referred to as the self boot engine (SBE). One role of the SBE is to act as a proxy that provides access to the registers of the POWER chip from other (embedded) systems. The POWER9 chip contains a hardware frontend for communicating with the SBE from remote systems called the SBEFIFO. The SBEFIFO logic is contained within an FSI CFAM and as such the driver implements an FSI bus device. The SBE expects to communicate using a defined wire protocol; however, the driver knows nothing of the protocol and only provides raw access to the fifo device to userspace applications wishing to communicate with the SBE using the wire protocol. The SBEFIFO consists of two hardware fifos. The upstream fifo is used by the driver to transfer data to the SBE on the POWER chip, from the system hosting the driver. The downstream fifo is used by the driver to transfer data from the SBE on the power chip to the system hosting the driver. The OCC is a device embedded on a POWER processor that collects and aggregates sensor data from the processor and system. The OCC can provide the raw sensor data as well as perform thermal and power management on the system. This driver provides an atomic communications channel between a service processor (e.g. a BMC) and the OCC. The driver is dependent on the FSI SBEFIFO driver to get hardware access through the SBE to the OCC SRAM. Commands are issued to the SBE to send or fetch data to the SRAM. The format of communications to the OCC is writing a command to SRAM, followed by a sending a "doorbell" or attention to the OCC, followed by reading the response from OCC. All of this takes place atomically so that multiple users don't collide in the SRAM. Changes since v4: * Use irqsave/irqrestore for spinlocks. * Put the OCC driver in the same patchset as it doesn't build without SBEFIFO. * Switch to reference counting for OCC clients. Changes since v3: * Add reset procedure and use it if there is data in the FIFO at probe time. * Add timeout for waiting for data to appear in the FIFO; if the SBE isn't running, then previously we would wait forever. * Fix remove() order of operations for both drivers. * Fix xfr memory leak for SBEFIFO. * Formatting fixes. Changes since v2: * Rename occ.c and occ.h to fsi-occ.c and fsi-occ.h * Improved remove() ordering in both drivers. * Added cancel functionality to OCC driver to make sure no xfrs started during remove(). * Fix spin_unlock with spin_unlock_irq in OCC driver. * Fix list_first_entry with list_first_entry_or_null in OCC worker function. * Add OCC response definitions to OCC include file. * Handle probe() failures better. Changes since v1: * Split bindings into separate patch and added SBEFIFO device binding * Fixed #includes * Fix SBEFIFO race condition between write() and poll_timer(). * Followed Rob's suggestion to just create one platform device for hwmon driver, instead of using the device tree. * Also check for "command in progress" response from OCC and try a while Edward A. James (8): dt-bindings: fsi: Add SBEFIFO documentation drivers/fsi: Add SBEFIFO FSI client device driver drivers/fsi: sbefifo: Add miscdevice drivers/fsi: sbefifo: Add in-kernel API dt-bindings: fsi: Add OCC documentation drivers/fsi: Add On-Chip Controller (OCC) driver drivers/fsi: occ: Add miscdevice drivers/fsi: occ: Add in-kernel API .../devicetree/bindings/fsi/ibm,p9-occ.txt | 18 + .../devicetree/bindings/fsi/ibm,p9-sbefifo.txt | 35 + drivers/fsi/Kconfig | 17 + drivers/fsi/Makefile | 2 + drivers/fsi/fsi-occ.c | 876 +++++++++++++++++ drivers/fsi/fsi-sbefifo.c | 1027 ++++++++++++++++++++ include/linux/fsi-occ.h | 41 + include/linux/fsi-sbefifo.h | 30 + 8 files changed, 2046 insertions(+) create mode 100644 Documentation/devicetree/bindings/fsi/ibm,p9-occ.txt create mode 100644 Documentation/devicetree/bindings/fsi/ibm,p9-sbefifo.txt create mode 100644 drivers/fsi/fsi-occ.c create mode 100644 drivers/fsi/fsi-sbefifo.c create mode 100644 include/linux/fsi-occ.h create mode 100644 include/linux/fsi-sbefifo.h -- 1.8.3.1 From 1584643918012931243@xxx Tue Nov 21 03:16:45 +0000 2017 X-GM-THRID: 1584342442584787748 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread