From: Sayali Lokhande <sayalil@codeaurora.org>
To: Evan Green <evgreen@chromium.org>
Cc: subhashj@codeaurora.org, cang@codeaurora.org,
vivek.gautam@codeaurora.org,
Rajendra Nayak <rnayak@codeaurora.org>,
Vinayak Holikatti <vinholikatti@gmail.com>,
jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
asutoshd@codeaurora.org, riteshh@codeaurora.org,
stummala@codeaurora.org, adrian.hunter@intel.com,
Joel Becker <jlbec@evilplan.org>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V14 2/2] scsi: ufs: Add configfs support for UFS provisioning
Date: Thu, 4 Oct 2018 13:09:47 +0530 [thread overview]
Message-ID: <3b583d0a-8a14-9cd9-19d0-57948ab5a742@codeaurora.org> (raw)
In-Reply-To: <CAE=gft6dLW5zzrOg470kS=O8rMgPr02Nb4NL9pEtpymc83ms+w@mail.gmail.com>
Hi Evan,
On 10/3/2018 11:31 PM, Evan Green wrote:
> On Sun, Sep 23, 2018 at 11:29 PM Sayali Lokhande <sayalil@codeaurora.org> 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 and CONFIG_SCSI_UFS_PROVISION needs to be enabled
>> for using this feature.
>>
>> Usage:
>> 1) To read current configuration descriptor with index X
>> (where index X can be 0/1/2/3) :
>> cat /config/<device_name>/ufs_config_desc_X
>>
>> 2) To write configuration descriptor with index X :
>> echo <config_desc_buf> > /config/<device_name>/ufs_config_desc_X
>>
>> Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
>> ---
>> Documentation/ABI/testing/configfs-driver-ufs | 12 ++
>> drivers/scsi/ufs/Kconfig | 10 ++
>> drivers/scsi/ufs/Makefile | 1 +
>> drivers/scsi/ufs/ufs-configfs.c | 237 ++++++++++++++++++++++++++
>> drivers/scsi/ufs/ufshcd.c | 3 +-
>> drivers/scsi/ufs/ufshcd.h | 18 ++
>> 6 files changed, 280 insertions(+), 1 deletion(-)
>> 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..6743ea9
>> --- /dev/null
>> +++ b/Documentation/ABI/testing/configfs-driver-ufs
>> @@ -0,0 +1,12 @@
>> +What: /config/*/ufs_config_desc_X
>> +Date: Jun 2018
>> +KernelVersion: 4.20
>> +Description:
>> + This file shows bytes of the current ufs configuration descriptor
>> + with index X (where X = 0/1/2/3) 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 and format of each configuration descriptor parameter.
>> + Parameters of Configuration descriptor buffer for respective index
>> + needs to be passed as bytes in space separated format.
>> diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
>> index e27b4d4..6e7ff35 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 SCSI_UFS_PROVISION
>> + bool "Runtime UFS Provisioning support"
>> + depends on SCSI_UFSHCD && CONFIGFS_FS
>> + help
>> + This enables runtime UFS provisioning support. This can be used
>> + primarily during assembly line as some devices may be required to
>> + be configured multiple times during initial development phase.
>> +
>> + If unsure, say N.
>> diff --git a/drivers/scsi/ufs/Makefile b/drivers/scsi/ufs/Makefile
>> index 918f579..09880b9 100644
>> --- a/drivers/scsi/ufs/Makefile
>> +++ b/drivers/scsi/ufs/Makefile
>> @@ -5,5 +5,6 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) += tc-dwc-g210-pltfrm.o ufshcd-dwc.o tc-d
>> obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o
>> obj-$(CONFIG_SCSI_UFSHCD) += ufshcd-core.o
>> ufshcd-core-objs := ufshcd.o ufs-sysfs.o
>> +obj-$(CONFIG_SCSI_UFS_PROVISION) += ufs-configfs.o
> Hi Sayali,
> Can you try both of your patches with "make allmodconfig". There seem
> to be a few issues compiling in that configuration. Also, as it stands
> this file is either not compiled in, or baked into the kernel, where
> it really should go into the driver. Check out the patch below for how
> Guenter patched things up in our tree:
>
> shttps://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1255524
[Sayali] : the change pointed by you above looks good to me and will
update it in my patch as well. ufs-configfs should be part of ufshcd-core.
I tried using "make allmodconfig".(basically updating like below for
test) + include change pointed above and it works fine.
+CONFIG_CONFIGFS_FS=y
+CONFIG_SCSI_UFSHCD=m
+CONFIG_SCSI_UFSHCD_PLATFORM=m
+CONFIG_SCSI_UFS_PROVISION=y
prev parent reply other threads:[~2018-10-04 7:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1537770516-28410-1-git-send-email-sayalil@codeaurora.org>
2018-09-24 6:28 ` [PATCH V14 1/2] scsi: ufs: set the device reference clock setting Sayali Lokhande
2018-09-24 7:58 ` Avri Altman
2018-09-24 8:47 ` Sayali Lokhande
2018-10-12 22:50 ` Doug Anderson
2018-10-15 10:57 ` Sayali Lokhande
2018-09-24 6:28 ` [PATCH V14 2/2] scsi: ufs: Add configfs support for UFS provisioning Sayali Lokhande
2018-09-24 10:03 ` Avri Altman
2018-10-04 10:40 ` Sayali Lokhande
2018-09-24 20:38 ` Evan Green
2018-10-03 18:01 ` Evan Green
2018-10-04 7:39 ` Sayali Lokhande [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b583d0a-8a14-9cd9-19d0-57948ab5a742@codeaurora.org \
--to=sayalil@codeaurora.org \
--cc=adrian.hunter@intel.com \
--cc=asutoshd@codeaurora.org \
--cc=cang@codeaurora.org \
--cc=evgreen@chromium.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=riteshh@codeaurora.org \
--cc=rnayak@codeaurora.org \
--cc=stummala@codeaurora.org \
--cc=subhashj@codeaurora.org \
--cc=vinholikatti@gmail.com \
--cc=vivek.gautam@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox