Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3512133imm; Tue, 17 Jul 2018 06:09:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfNj4pmCt9XGKKlZ9VmkHJYSJGlbi09JEWp9xUn3xCmN01TyN2M9/MoHMfrs9lJz6QbG9Gx X-Received: by 2002:a63:7b4d:: with SMTP id k13-v6mr1565455pgn.64.1531832983529; Tue, 17 Jul 2018 06:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531832983; cv=none; d=google.com; s=arc-20160816; b=fmNahj2h1/eIhHNbLfbAOBfBibrxBqAxBtcQiGf7jyHPqsX7UQwS86sBQ9ZIVokzIz PRJLQV2fbheZkkwXnMgoUs86W6onzCCV4+TdbxpqWinD9YV55COInqmXw4UDrr9wE/J7 SLzR250sg70ud6fqEbQd39nJtojUvbqM4649jvu90fIkxdL0mfUjOxsRV+gOYCa8kzlG +QBZ+ED9lH7X8fZOLwA1B2/PhhG8yAhXMPJSTJ/Sb2gEnLzWf0iJksVv+Ps54gX8qpYW +JmRD8Vm+Ydi2kY4VOpI65VaGEbY4mSTgM1FPKYLVEiBgZ4ahd/+1V3w3q2EamVHbHWu dTRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=bfFucV2tkk3E33U6IURGyMu1JfL+tLqvUPb1wNbGZmw=; b=0fpjgR64ONZKP0X9axcUHPAk8o0FDcWWCCwDbogGApVSd3c/76pIiCP4vl15kNqwv9 jP35ZShOo66epkDhzqU8u4xgpFIZ74jsyRpdhGiyuM5N68Qa3TSG9PfBd6imDi7hYP5M KMqnVPIfLKhd83FIFG80HEj2iqqGNmbXaem76n9Mex0i9StA/TTjytY84uCk7YEcifXS ZJFFExydt6nxF8J7SD1N5lIi2yMGcDYQ8MpXrFpGYBHHxrAIKWil8wOU8Nn7wzLw8Bkd e/myp5XuN5FalRjpuP9E4aA/bPIm6CVgbw7frlp3ThBeX1MxcxUE5JjCgzdYNlmeZMJJ yb8g== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7-v6si859426pfe.291.2018.07.17.06.09.28; Tue, 17 Jul 2018 06:09:43 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731585AbeGQNkX (ORCPT + 99 others); Tue, 17 Jul 2018 09:40:23 -0400 Received: from mga14.intel.com ([192.55.52.115]:10120 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731324AbeGQNkX (ORCPT ); Tue, 17 Jul 2018 09:40:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 06:07:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,365,1526367600"; d="scan'208";a="57156688" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by orsmga007.jf.intel.com with ESMTP; 17 Jul 2018 06:07:43 -0700 Subject: Re: [PATCH V6] scsi: ufs: Add configfs support for UFS provisioning To: Sayali Lokhande , subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, asutoshd@codeaurora.org, evgreen@chromium.org, riteshh@codeaurora.org Cc: linux-scsi@vger.kernel.org, open list References: <1531734237-27421-1-git-send-email-sayalil@codeaurora.org> <1531734237-27421-2-git-send-email-sayalil@codeaurora.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Tue, 17 Jul 2018 16:06:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 MIME-Version: 1.0 In-Reply-To: <1531734237-27421-2-git-send-email-sayalil@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/07/18 12:43, Sayali Lokhande wrote: > This patch adds configfs support to provision UFS device at > runtime. This feature can be primarily useful in factory or > assembly line as some devices may be required to be configured > multiple times during initial system development phase. > Configuration Descriptors can be written multiple times until > bConfigDescrLock attribute is zero. > > Configuration descriptor buffer consists of Device and Unit > descriptor configurable parameters which are parsed from vendor > specific provisioning file and then passed via configfs node at > runtime to provision ufs device. > CONFIG_CONFIGFS_FS needs to be enabled for using this feature. > > Usage: > 1) To read current configuration descriptor : > cat /config/XXXX.ufshc/ufs_provision > 2) To provision ufs device: > echo > /config/XXXX.ufshc/ufs_provision > > Signed-off-by: Sayali Lokhande > --- > Documentation/ABI/testing/configfs-driver-ufs | 18 +++ > drivers/scsi/ufs/Kconfig | 10 ++ > drivers/scsi/ufs/Makefile | 1 + > drivers/scsi/ufs/ufs-configfs.c | 162 ++++++++++++++++++++++++++ > drivers/scsi/ufs/ufshcd.c | 2 + > drivers/scsi/ufs/ufshcd.h | 19 +++ > 6 files changed, 212 insertions(+) > create mode 100644 Documentation/ABI/testing/configfs-driver-ufs > create mode 100644 drivers/scsi/ufs/ufs-configfs.c > > diff --git a/Documentation/ABI/testing/configfs-driver-ufs b/Documentation/ABI/testing/configfs-driver-ufs > new file mode 100644 > index 0000000..eeee499c > --- /dev/null > +++ b/Documentation/ABI/testing/configfs-driver-ufs > @@ -0,0 +1,18 @@ > +What: /config/ufshcd/ufs_provision > +Date: Jun 2018 > +KernelVersion: 4.14 > +Description: > + This file shows the current ufs configuration descriptor set in device. > + This can be used to provision ufs device if bConfigDescrLock is 0. > + For more details, refer 14.1.6.3 Configuration Descriptor and > + Table 14-12 - Unit Descriptor configurable parameters from specs for > + description of each configuration descriptor parameter. > + Configuration descriptor buffer needs to be passed in space separated > + format specificied as below: > + echo > + > + > + <0Bh:0Fh_ReservedAs_0> > + > + <0Dh:0Fh_ReservedAs_0> > + > /config/XXXX.ufshc/ufs_provision > diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig > index e27b4d4..34d89c2 100644 > --- a/drivers/scsi/ufs/Kconfig > +++ b/drivers/scsi/ufs/Kconfig > @@ -100,3 +100,13 @@ config SCSI_UFS_QCOM > > Select this if you have UFS controller on QCOM chipset. > If unsure, say N. > + > +config UFS_PROVISION > + tristate "Runtime UFS Provisioning support" > + depends on SCSI_UFSHCD_PLATFORM && CONFIGFS_FS Why SCSI_UFSHCD_PLATFORM instead of SCSI_UFSHCD? Also please cc me in future revisions.