Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp281340imm; Wed, 18 Jul 2018 01:57:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdMP8+koSJ90UlDHhQmTTrVX+sCREzTERDsdH5eHKRI8QmKgf48aqA/neL7P9NE4bl/K4k6 X-Received: by 2002:a63:383:: with SMTP id 125-v6mr5014376pgd.421.1531904264453; Wed, 18 Jul 2018 01:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531904264; cv=none; d=google.com; s=arc-20160816; b=xVZX2+pNcvWgM63VZo/cpDB3zpIFCzrrX34Myz9IO1EI9x/4Yn0KgybFe7XzE1efF1 6cdJ9SN3CU8SymkUoGu5NFxtqwtlfiJToNSKiMbY7OC57XnGU5u5guhSeie/iTV7JmXR M1h/vWQTBJ37tZ8T3BI+VWOe9z4km4s78qTmQFHzgCGehMPicCHjOqB+RGidDvB+ovNl j08QmZ3XAZWL/SwddGg8dYOHTiUsbUmvqNQ5re6B7XKmvvt4+CtOpKIusOCydr63evbl 3mhGM4o6+E9DNTNXQtsWoE9UBOBaWxfI11Igd4xF9TT6kRfn4EPwTW8Tz6y4W3hkshIY 46tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=mGkKAM/mWvOSlnuEVs4/o8HR3j55uiW/PftjdMQ+flE=; b=xS5fPhIZzW0lMP0Hzr0mvI3dK2+GY3E4ENgodK+HDdC31Xkfd8bk+kH0qsSqYzF95N EjXzb8WeyVGkUDJgVv6ZfEgy8y8pitGXOHCcKHQZ6ox8ueRQh0eG4zlQLdQO+lMNOH2d zSaNEihntcZfkl7mW+sIwZk7+PyvQRCdUFNDy5E0zuvGybYQBVMkVnp3khRk1PwAEKi6 Rh35jbV5XPNw+zJdEhpt77BP9Bu5RrgVwHIxVt/kkHSz9PFD2ooepGfg05r0m7tlEuPF x1/vQU1pFAXpr0XNDYXfFV1Uluoow6W7+8kLmZDdWgbPJeD2eQxUvk6FRAtwNA6S69+N pc3A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si2885938pge.521.2018.07.18.01.57.29; Wed, 18 Jul 2018 01:57: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; 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 S1730383AbeGRJdr (ORCPT + 99 others); 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