From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C6F2ECDFAA for ; Wed, 18 Jul 2018 08:56:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8CF620850 for ; Wed, 18 Jul 2018 08:56:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8CF620850 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730421AbeGRJdr (ORCPT ); Wed, 18 Jul 2018 05:33:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36126 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729289AbeGRJdq (ORCPT ); Wed, 18 Jul 2018 05:33:46 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2DE69720; Wed, 18 Jul 2018 08:56:53 +0000 (UTC) Date: Wed, 18 Jul 2018 10:56:51 +0200 From: "gregkh@linuxfoundation.org" To: Bart Van Assche Cc: "evgreen@chromium.org" , "vinholikatti@gmail.com" , "linux-kernel@vger.kernel.org" , "asutoshd@codeaurora.org" , "sayalil@codeaurora.org" , "riteshh@codeaurora.org" , "cang@codeaurora.org" , "martin.petersen@oracle.com" , "subhashj@codeaurora.org" , "linux-scsi@vger.kernel.org" , "vivek.gautam@codeaurora.org" , "rnayak@codeaurora.org" , "jejb@linux.vnet.ibm.com" Subject: Re: [PATCH V5 2/2] scsi: ufs: Add configfs support for ufs provisioning Message-ID: <20180718085651.GA23599@kroah.com> References: <1530858040-13971-1-git-send-email-sayalil@codeaurora.org> <1530858040-13971-3-git-send-email-sayalil@codeaurora.org> <0dce9e9c-4f93-9857-72ee-f65ff195c41a@codeaurora.org> <4cb931e199599314829f5ff750797c88fc123f1f.camel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 17, 2018 at 09:06:35PM +0000, Bart Van Assche wrote: > On Tue, 2018-07-17 at 13:23 -0700, Evan Green wrote: > > On Mon, Jul 16, 2018 at 5:04 PM Bart Van Assche wrote: > > > > > > On Mon, 2018-07-16 at 16:46 -0700, Evan Green wrote: > > > > I see Bart has chimed in on the next series with a suggestion to break > > > > out each field into individual files within configfs. Bart, what are > > > > your feelings about converting to a binary attribute? I remember when > > > > I did my sysfs equivalent of this patch, somebody chimed in indicating > > > > a "commit" file might be needed so that the new configuration could be > > > > written in one fell swoop. One advantage of the binary attribute is > > > > that it writes the configuration atomically. > > > > > > Hello Evan, > > > > > > I may be missing some UFS background information. But since a configfs interface > > > is being added I think the same rule applies as to all Linux kernel user space > > > interfaces, namely that it should be backwards compatible. Additionally, if > > > anyone ever will want to use this interface from a shell script, I think that > > > it will be much easier to write multiple ASCII attributes than a single binary > > > attribute. > > > > > > > Hi Bart, > > I'm unsure about the compatibility aspect for binary attributes that > > essentially represent direct windows into hardware. I suppose this > > comes down to who this interface is most useful to. Hypothetically > > lets say a future revision of UFS adds fields to the configuration > > descriptor, but is otherwise backwards compatible. If this interface > > is primarily for OEMs initializing their devices in the factory, then > > I'd argue they'd want the most direct window to the configuration > > descriptor. These folks probably just have a configuration they want > > to plunk into the hardware, and would prefer being able to write all > > fields over having some sort of compatibility restriction. If, on the > > other hand, this is used by long-running scripts that stick around for > > years without modification, then yes, it seems like it would be more > > important to stay compatible, and have smarts in the kernel to make > > writes of old descriptors work in new devices. > > > > At least for myself, I fall into the category of someone who just > > needs to plunk a configuration descriptor in once, and would prefer > > not to have to submit kernel changes if the descriptor evolves > > slightly. It also seemed a little odd that this patch now spends a > > bunch of energy converting ASCII into bytes, just to write it without > > modification into the hardware, and convert back again to ASCII for > > reads. > > > > We plan to use a script for provisioning, and could easily handle > > ASCII or rawbytes: > > > > # Some bytes, ready to go with the interface today... > > some_bytes="00 01 02 03" > > > > # Same bytes, now in binary format > > bytes_fmt=$(echo " $some_bytes" | sed 's/ /\\x/g') > > /usr/bin/printf "$bytes_fmt" > /configfs/ufs_provision > > > > I'm not dead set on binary, since as above I could do it either way, > > but it seemed worth at least talking through. Let me know what you > > think. > > The configfs documentation (Documentation/filesystems/configfs/configfs.txt) > is clear about this: "Preferably only one value per file should be used." So > I would like to hear the opinion of someone who has more authority than I > with regard to configfs. Don't we have "binary" files for configfs? We have them for sysfs, they are for files that are not touched by the kernel and just "pass-through" to the hardware. Would that work here as well? thanks, greg k-h