Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753497AbdL1N3g (ORCPT ); Thu, 28 Dec 2017 08:29:36 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:28376 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbdL1N3e (ORCPT ); Thu, 28 Dec 2017 08:29:34 -0500 X-IronPort-AV: E=Sophos;i="5.45,471,1508774400"; d="scan'208";a="66938078" From: Stanislav Nijnikov To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Cc: alex.lemberg@wdc.com, Stanislav Nijnikov Subject: [PATCH v3 0/9] ufs: sysfs: read-only access to device descriptors, attributes and flags Date: Thu, 28 Dec 2017 15:29:05 +0200 Message-Id: <1514467754-24499-1-git-send-email-stanislav.nijnikov@wdc.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2537 Lines: 56 This patch introduces sysfs entries that will provide read-only access to device management data that could be received with UFS query requests. User-space applications will be able to read UFS device descriptors, flags and attributes. This will allow to get full UFS device configuration and its status. The descriptors are provided as set of files representing its parameters. The flags are using "true"/"false" representation of their value. The attributes are shown as hexadecimal value. The descriptors, attributes and flags are placed in separate subfolders under the UFS device sysfs entry (/sys/bus/platform/drivers/ufshcd/*/). The string descriptor subfolder contains five string descriptors defined by UFS specification 2.1. The LUN specific descriptor and attribute are placed under corresponding SCSI device sysfs entries (/sys/class/scsi_device/*/device/). In addition the patch presents an additional field in the scsi_host_template structure - struct attribute_group **sdev_group. This field allows to define groups of attributes. It will provide an ability to use binary attributes in addition to device attributes and to group them under subfolders if necessary. Changelog: v2 -> v3 The Makefile is updated to make ufs-sysfs.c part of the ufshcd module. The unnecessary EXPORT_SYMBOL were removed Added a legal info header to the new files The date in Documentation/ABI/testing/sysfs-driver-ufs was updated. v1 -> v2 Provided additional description for the changes Stanislav Nijnikov (9): ufs: sysfs: device descriptor ufs: sysfs: interconnect descriptor ufs: sysfs: geometry descriptor ufs: sysfs: health descriptor ufs: sysfs: power descriptor ufs: sysfs: string descriptors ufs: sysfs: unit descriptor ufs: sysfs: flags ufs: sysfs: attributes Documentation/ABI/testing/sysfs-driver-ufs | 804 +++++++++++++++++++++++++++++ drivers/scsi/scsi_sysfs.c | 14 + drivers/scsi/ufs/Makefile | 3 +- drivers/scsi/ufs/ufs-sysfs.c | 659 +++++++++++++++++++++++ drivers/scsi/ufs/ufs-sysfs.h | 29 ++ drivers/scsi/ufs/ufs.h | 115 ++++- drivers/scsi/ufs/ufshcd.c | 52 +- drivers/scsi/ufs/ufshcd.h | 25 + include/scsi/scsi_host.h | 6 + 9 files changed, 1674 insertions(+), 33 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-driver-ufs create mode 100644 drivers/scsi/ufs/ufs-sysfs.c create mode 100644 drivers/scsi/ufs/ufs-sysfs.h -- 2.7.4