Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp649163imm; Thu, 4 Oct 2018 00:40:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV60dkWGIvVlv3trx3GBFg2pK1wM48cNkF85xlN+xCgPIYxeyWQPjot3ug5vKo59jf54sUzLl X-Received: by 2002:a62:449b:: with SMTP id m27-v6mr5449009pfi.82.1538638844473; Thu, 04 Oct 2018 00:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538638844; cv=none; d=google.com; s=arc-20160816; b=Fzm0oVadQ0+53u45rubRnDLAjOEjXQYGghbhBbHpCXyUNF4YIrpgQSUGzYaxOQXW+h ZbNjAZp0ps5ZexFXdb9sOKEcx8B8sRiqXGy2Xdv3Lk7NQtV4dGMkxJ4QrgM22cor9Mj7 fw7VItH5LCme1Zps6eBv5qUF8Q7SBSLwa3JT2999+42inB1OhK//cIh+rQsVJKffC8Vd fnn4KAltJcHNGFREPF9IBNuKLa2qnRi9n84RaJQ/jARWDVNQr1ZAzbkGFNrbdS8fsZLe 6yeKRHv+cDo05230joVDK1FZpUOeyT4/1pvreuNvZiHexngcXjvcj9zxnLlIgWA+SIuq M69w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=OCPpN7qPzYw0pojCeZSD01Z3ehWlv9x7EaUfD3zzlhs=; b=h7xPkenirU6+eS9EcWP+dxH0wb7rHi/y8KFp9P/A7kRVBur2UmdAFqaLQ4/bisGNJ7 JHjGj6IM3/xDES0a9iZWVHkikuHvN14Dpc0Vxz5eRjClL2umGhWgStynNdbv9mU5uOMq Kx7iEdyV0PNBm1+Z+aI7V+pY14Neu7J77orKYhJdYchIX0I+C9vfI3RAZxghSmV+EDDH xMWJiI+WVV99KDG+5b9FKsWOo9s2BUUnDbUc4q1IFeRSKzLQlx3+yVNF7AjMdzomOWwM JNm7zaY8k3UqI4INMHVxVJHL5oHv6Zd85lrTnYQOFjLbsPmLBte1L9wQuv2FnH4nXC4C YFqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=L43n30zU; dkim=pass header.i=@codeaurora.org header.s=default header.b=R4QfvQZc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8-v6si4146596plk.240.2018.10.04.00.40.28; Thu, 04 Oct 2018 00:40:44 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=L43n30zU; dkim=pass header.i=@codeaurora.org header.s=default header.b=R4QfvQZc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727610AbeJDObx (ORCPT + 99 others); Thu, 4 Oct 2018 10:31:53 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37912 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeJDObx (ORCPT ); Thu, 4 Oct 2018 10:31:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E0D0C60CDD; Thu, 4 Oct 2018 07:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538638798; bh=qHOWRuJ6RPSPTOSpv4fsqpgVTdcJiwP8ZbThxQk8HoM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=L43n30zUbV4fdIvL945Xw4WurQHc7y6WM762fDAW6RwJDYqjF0LAONT9fRMNkSLYn d9AFe7kln9u9wacsHfVcfcwps5e2noNVkNb5r3q3eYKgD600vGEivRZQTTDQ/Soqbb t8fOjiJdwAhRpR7OnUVJ0QS9gh1KonzptEdH3fyc= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.206.24.39] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sayalil@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8E23B60D46; Thu, 4 Oct 2018 07:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538638795; bh=qHOWRuJ6RPSPTOSpv4fsqpgVTdcJiwP8ZbThxQk8HoM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=R4QfvQZccq1EZbTD+22elx8sVzEr8r4ZHd8IxKXBu+mhC8i9VZfExfFFl4KR9q5/2 s5gd6rAKqaMJI0RLxEuhLkjGl3wkrnSRAYEeIz949aak4ctktjJ6/IG7hCWGcDqB1x IfMXTW/E99Up8PI5Iqm5t9qzc3RNJwZqpYqO4SRg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8E23B60D46 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sayalil@codeaurora.org Subject: Re: [PATCH V14 2/2] scsi: ufs: Add configfs support for UFS provisioning To: Evan Green Cc: subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, Rajendra Nayak , Vinayak Holikatti , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, asutoshd@codeaurora.org, riteshh@codeaurora.org, stummala@codeaurora.org, adrian.hunter@intel.com, Joel Becker , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <1537770516-28410-1-git-send-email-sayalil@codeaurora.org> <1537770516-28410-3-git-send-email-sayalil@codeaurora.org> From: Sayali Lokhande Message-ID: <3b583d0a-8a14-9cd9-19d0-57948ab5a742@codeaurora.org> Date: Thu, 4 Oct 2018 13:09:47 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Evan, On 10/3/2018 11:31 PM, Evan Green wrote: > On Sun, Sep 23, 2018 at 11:29 PM 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 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//ufs_config_desc_X >> >> 2) To write configuration descriptor with index X : >> echo > /config//ufs_config_desc_X >> >> Signed-off-by: Sayali Lokhande >> --- >> 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