From patchwork Thu May 12 17:18:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 9084601 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5701BBF29F for ; Thu, 12 May 2016 17:19:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77BEE20220 for ; Thu, 12 May 2016 17:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E792320253 for ; Thu, 12 May 2016 17:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932359AbcELRSs (ORCPT ); Thu, 12 May 2016 13:18:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:57859 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752088AbcELRSq (ORCPT ); Thu, 12 May 2016 13:18:46 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 12 May 2016 10:18:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,610,1455004800"; d="scan'208";a="951956144" Received: from scymds01.sc.intel.com ([10.82.194.37]) by orsmga001.jf.intel.com with ESMTP; 12 May 2016 10:18:35 -0700 Received: from scvm10.sc.intel.com (scvm10.sc.intel.com [10.82.195.27]) by scymds01.sc.intel.com with ESMTP id u4CHIZ3B024465; Thu, 12 May 2016 10:18:35 -0700 Received: from scvm10.sc.intel.com (localhost [127.0.0.1]) by scvm10.sc.intel.com with ESMTP id u4CHIYpa008890; Thu, 12 May 2016 10:18:34 -0700 Subject: [PATCH v2 1/5] IB/hfi1: Export drivers user sw version via sysfs To: dledford@redhat.com From: Dennis Dalessandro Cc: linux-rdma@vger.kernel.org, Mitko Haralanov , linux-kernel@vger.kernel.org, jgunthorpe@obsidianresearch.com, linux-fsdevel@vger.kernel.org, Ira Weiny , Christoph Hellwig Date: Thu, 12 May 2016 10:18:34 -0700 Message-ID: <20160512171833.6198.80577.stgit@scvm10.sc.intel.com> In-Reply-To: <20160512171115.6198.77458.stgit@scvm10.sc.intel.com> References: <20160512171115.6198.77458.stgit@scvm10.sc.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP User space consumers of hfi1 will need to know what version of the driver they are dealing with. This becomes particularly important when the write() interface is removed. User's will need to be able to query the driver information but without asking the driver directly. Add the driver's software version to sysfs for this exact purpose. Reviewed-by: Christoph Hellwig Reviewed-by: Mitko Haralanov Reviewed-by: Ira Weiny Signed-off-by: Dennis Dalessandro --- drivers/staging/rdma/hfi1/sysfs.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/rdma/hfi1/sysfs.c b/drivers/staging/rdma/hfi1/sysfs.c index 8cd6df8..2ff5a14 100644 --- a/drivers/staging/rdma/hfi1/sysfs.c +++ b/drivers/staging/rdma/hfi1/sysfs.c @@ -622,6 +622,12 @@ static ssize_t show_tempsense(struct device *device, return ret; } +static ssize_t show_user_sw_version(struct device *device, + struct device_attribute *attr, char *buf) +{ + return scnprintf(buf, PAGE_SIZE, "0x%x\n", HFI1_USER_SWVERSION); +} + /* * end of per-unit (or driver, in some cases, but replicated * per unit) functions @@ -636,6 +642,7 @@ static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL); static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL); static DEVICE_ATTR(tempsense, S_IRUGO, show_tempsense, NULL); static DEVICE_ATTR(chip_reset, S_IWUSR, NULL, store_chip_reset); +static DEVICE_ATTR(user_sw_version, S_IRUGO, show_user_sw_version, NULL); static struct device_attribute *hfi1_attributes[] = { &dev_attr_hw_rev, @@ -646,6 +653,7 @@ static struct device_attribute *hfi1_attributes[] = { &dev_attr_boardversion, &dev_attr_tempsense, &dev_attr_chip_reset, + &dev_attr_user_sw_version, }; int hfi1_create_port_files(struct ib_device *ibdev, u8 port_num,