From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752674AbdBIXSV (ORCPT ); Thu, 9 Feb 2017 18:18:21 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:34801 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752364AbdBIXSS (ORCPT ); Thu, 9 Feb 2017 18:18:18 -0500 From: Wei Zhang To: Logan Gunthorpe , Keith Busch , Myron Stowe , "Greg Kroah-Hartman" , Bjorn Helgaas , Geert Uytterhoeven , Jonathan Corbet , "David S. Miller" , Andrew Morton , Emil Velikov , Mauro Carvalho Chehab , Guenter Roeck , Jarkko Sakkinen , Linus Walleij , Ryusuke Konishi , Stefan Berger , Krishna Dhulipala CC: Kurt Schwemmer , Stephen Bates , "linux-pci@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Thread-Topic: [PATCH v2 0/4] New Microsemi PCI Switch Management Driver Thread-Index: AQHSfX/GnZbzFa7zI0qNsLIvCxrJ1KFg09kA Date: Thu, 9 Feb 2017 23:16:05 +0000 Message-ID: References: <1486058763-7730-1-git-send-email-logang@deltatee.com> In-Reply-To: <1486058763-7730-1-git-send-email-logang@deltatee.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/f.1c.1.161117 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:200::a:be85] x-ms-office365-filtering-correlation-id: ef0eaf04-6a00-4fc1-1b2b-08d451419f5a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR15MB1276; x-microsoft-exchange-diagnostics: 1;DM5PR15MB1276;7:J9lIMlPa0NTfOF33gCpskDvJp/ZX7Aini3ywsgwPOaEmnigPr2v7DZdDF0hd0IQZVZJoaFNsT9lSRmKvnHjwUBWSzVaCOgFiOxfMNDCpcsHn7DA/ZbbemxRu0HqeF1D1fR8/nNREVmeNFZNwlP4CM1dlnTJ+C4V2+bSxAm8Y1Wj80wGaDqw5JuplsJbaxa80m8rFBbJ2Ocknb6zD6Gfm9ynVXgS+KK0EsIJcCWMlplXjVhV7bgOgCtjMVrSsF20BLZMLkOCsFNOXthM+nDX3jun/4INm/Ak75gR3kh9qtmGPhXvuVttqNXoIyKtof09j9pPpikcLeiUgz3w18r8WoZNXQ4LD2d3A5v96y4/VR92A85yGTq8ZN9Wt0JxZ3dw28I/IfSYiF6CdYFGAAtxAdDscmGoOv2PKuOlcbZ1uSWaTRrphke72ihjVdIM1bAUlNNV488nf3EO4Ji5N4PLY3ZD8xAANiY4IXl5Jm0+uCLevrxDvkVprfsHfKZfJyG9FzyugfjeMWASgoWT3n3mrPQ==;20:7Aq9dyY6AXres5pkFfjlcW5Imu8KP9jAci6IBBZh4jq4z73y/24cGFnTXnJb/YLCWGaXicCDLtR1GeavlmFM/5P6YZq5cgODQlu46H9n1VZwsrJlpTiD6oHKGk/0RsD8Ou3QyE3fdmJTYxpk7QH9IdKTuo5/qa0JcJ4UKhj0OiE= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(10436049006162)(166708455590820)(67672495146484)(81227570615382)(211171220733660); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(20161123558025)(6072148);SRVR:DM5PR15MB1276;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1276; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39410400002)(39830400002)(39450400003)(199003)(189002)(24454002)(377454003)(6506006)(50986999)(8656002)(54906002)(25786008)(6436002)(6486002)(4001350100001)(6306002)(101416001)(97736004)(6116002)(6636002)(92566002)(76176999)(54356999)(102836003)(33656002)(2900100001)(6512007)(105586002)(106116001)(2950100002)(106356001)(5660300001)(53546003)(6246003)(36756003)(53936002)(39060400001)(189998001)(83506001)(99286003)(229853002)(77096006)(122556002)(82746002)(305945005)(7416002)(3660700001)(7736002)(81156014)(81166006)(3280700002)(2906002)(83716003)(8936002)(8676002)(86362001)(575784001)(68736007)(38730400002)(4326007)(921003)(104396002)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR15MB1276;H:BN4PR15MB0675.namprd15.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <4CB075F373EF0A47A4D40ADA0CD0B6F9@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2017 23:16:05.1967 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1276 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-09_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v19NIQJP029243 Hi, The switchtec driver patches [PATCH v2 (0-4)/4] in conjunction with the switchtec userland tool is used to communicate with the Microsemi 8536 PCIe Switch used on Facebook’s Lightning platform. The following essential driver and tool functions were successfully tested with it: · Retrieval of firmware and configuration information along with CRCs · Switch firmware and configuration upgrades · Switch PHY/Link error counter collection and the ability to reset them · Switch upstream and downstream ports’ link status reporting · Switch interface functioning · Retrieval of switch ASIC temperature · Exporting switch firmware log dump · Read the information of firmware and configuration binaries · Extract the firmware and configuration images stored in the switch EEPROM Tested-by: Krishna Dhulipala krishnad@fb.com Tested-by: Wei Zhang wzhang@fb.com Thanks, -Wei -- wei zhang | software engineer | facebook wzhang@fb.com | (408) 460-4803 On 2/2/17, 10:05 AM, "Logan Gunthorpe" wrote: Changes since v1: * Rebased onto 4.10-rc6 (cleanly) * Split the patch into a few more easily digestible patches (as suggested by Greg Kroah-Hartman) * Folded switchtec.c into switchtec.h (per Greg) * Fixed a bunch of 32bit build warnings caught by the kbuild test robot * Fixed some issues in the documentation so it has a proper reStructredText format (as noted by Jonathan Corbet) * Fixed padding and sizes in the IOCTL structures as noticed by Emil Velikov and used pahole to verify their consistency across 32 and 64 bit builds * Reworked one of the IOCTL interfaces to be more future proof (per Emil). Changes since RFC: * Fixed incorrect use of the drive model as pointed out by Greg Kroah-Hartman * Used devm functions as suggested by Keith Busch * Added a handful of sysfs attributes to the switchtec class * Added a handful of IOCTLs to the switchtec device * A number of miscellaneous bug fixes -- Hi, This is a continuation of the RFC we posted lasted month [1] which proposes a management driver for Microsemi's Switchtec line of PCI switches. This hardware is still looking to be used in the Open Compute Platform To make this entirely clear: the Switchtec products are compliant with the PCI specifications and are supported today with the standard in-kernel driver. However, these devices also expose a management endpoint on a separate PCI function address which can be used to perform some advanced operations. This is a driver for that function. See the patch for more information. Since the RFC, we've made the changes requested by Greg Kroah-Hartman and Keith Busch, and we've also fleshed out a number of features. We've added a couple of IOCTLs and sysfs attributes which are documented in the patch. Significant work has also been done on the userspace tool which is available under a GPL license at [2]. We've also had testing done by some of the interested parties. We hope to see this work included in either 4.11 or 4.12 assuming a smooth review process. The patch is based off of the v4.10-rc6 release. Thanks for your review, Logan [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__www.spinics.net_lists_linux-2Dpci_msg56897.html&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=LRFoLl92zWj5mkgkc_hRcg&m=VLDBJqzotzGkTj8-xjlfT-J0k2uFq6FcWg2nA_oKYJo&s=OkigHoSqH1Z3dnmLqN76lIQ_WxRJDj1uqIDl35SI58A&e= [2] https://github.com/sbates130272/switchtec-user -- Logan Gunthorpe (4): MicroSemi Switchtec management interface driver switchtec: Add user interface documentation switchtec: Add sysfs attributes to the Switchtec driver switchtec: Add IOCTLs to the Switchtec driver Documentation/ABI/testing/sysfs-class-switchtec | 96 ++ Documentation/ioctl/ioctl-number.txt | 1 + Documentation/switchtec.txt | 80 ++ MAINTAINERS | 11 + drivers/pci/Kconfig | 1 + drivers/pci/Makefile | 1 + drivers/pci/switch/Kconfig | 13 + drivers/pci/switch/Makefile | 1 + drivers/pci/switch/switchtec.c | 1608 +++++++++++++++++++++++ include/uapi/linux/switchtec_ioctl.h | 132 ++ 10 files changed, 1944 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-switchtec create mode 100644 Documentation/switchtec.txt create mode 100644 drivers/pci/switch/Kconfig create mode 100644 drivers/pci/switch/Makefile create mode 100644 drivers/pci/switch/switchtec.c create mode 100644 include/uapi/linux/switchtec_ioctl.h -- 2.1.4