Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3752057imm; Mon, 4 Jun 2018 08:42:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI5Uf/RTDtaMBL7ZcbFRkdq8Gtm5wATqMKU9YkxylCBPqgOlMzdY7oucpevcDm2y78tHH/F X-Received: by 2002:a62:a50c:: with SMTP id v12-v6mr21900655pfm.237.1528126941483; Mon, 04 Jun 2018 08:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528126941; cv=none; d=google.com; s=arc-20160816; b=uX082y+5Y9LtEej/CcbjAN2EDe13hJcEdjQ+gx4HnrpOvnRVKXybqlpNQ1mX+J2cwj 3n6/6jLqklkyTpSqEca52EM0JvZpUX7GC5bK8F/iXId6t7nZLo111bSsglcvs4Zy+Iup etqmeF4heUlFIIrfpsZXcFe/J7FqPBwPqfcHnNYybYXZRmwV0yXbqYKHk70pc3MAGJJJ fp1lFMuCZnYtuI3w33mzFwGEl8w+PTTpg8a5WfxX+gJ+GOkczHRUbIouDX9BywYzMMbx JvO4fQqtle594ShE3Y7VPc0mD109AURwXchzKn6ifK20AvbGElLNXsg2KcFUM/LKv+dl Lcyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=OWbM2NTWM6yoJcaKBqgBY3C/hZmn2BUhFmGCLPWrphk=; b=DcGuwywS8/TC0Rzr5Dc41LBOrkNzGn71YvACbHHEv88UVA6i7b2hh0Non62kmqwtfC ttTBn20bXZXeb+KcXe+opDbRoX4hCn8fjdIejok1WKtKAPXS4Ljk6nofwUrKBGWoAnNG jmILUO8Bbq4vpVPj4XtOFS02jPU24/4ri2mEvOyS4519gTzx8J7FCOVd4LA4nVoEzPCV lewWpUI2VDn4WFuR9YyS0v5BcPORbA5jy3gUiwHWjnA/3bhCiV08GygRQBj4VgJcPx7k sKOsbwjqT00QQZn1NI8V9S9vOvYgWJpdFr89sSEJWf+Bhvft/7KzxM4jI0moWEPjnD7C AbDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fnJCpDFu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15-v6si873801pgv.452.2018.06.04.08.42.07; Mon, 04 Jun 2018 08:42:21 -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=@chromium.org header.s=google header.b=fnJCpDFu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751053AbeFDPjt (ORCPT + 99 others); Mon, 4 Jun 2018 11:39:49 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:46671 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbeFDPjs (ORCPT ); Mon, 4 Jun 2018 11:39:48 -0400 Received: by mail-oi0-f65.google.com with SMTP id h79-v6so22322446oig.13 for ; Mon, 04 Jun 2018 08:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OWbM2NTWM6yoJcaKBqgBY3C/hZmn2BUhFmGCLPWrphk=; b=fnJCpDFupVVYkWx6dRgXK9V0W3IwtOf8AbTjmhSizClt8pLfyxeZrZV/E9fWeRg1ht lHhOYzky8slMw8xNcIMERWR90FQh+8NgQrliX80hLsUcwMGFvbYG6L4LOBeRh42zwphb SrNyrfedYcLUdIKVkO2FPHwgMGhx/z9D/qfao= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OWbM2NTWM6yoJcaKBqgBY3C/hZmn2BUhFmGCLPWrphk=; b=pB0loZJqWm7ydHMBbEs+ZdxddLlTG/P0rGpszWcgS9d5sgRZclLk5xOF7g10Tp2GZ1 nZXOtRRQD751SCc01uQj8IxGaaRvBm2tMZguGXToTfqZjTmdlhyS1lA34x/T8D7t/qWe pMj7xGdG1VcaFC5NgPTTyROPqWampkg5j49qkcIhquLUFu06PdK41R4O3o7fwshexqWZ /Zz9XJRbbSH2iSfvEOXztTBwJ4xOysU1i2nEumw/2WPzN2G5ZQ0YlA6Acq+T8dZ4fzg4 Gy1BtTVFhugQKF2dfvQTlWcp9q0oD1+sbISWRoJPFCBW090SFBVn4YXHWJbrvmoKxjeu 6mMQ== X-Gm-Message-State: ALKqPwcYyeyJLRtEpoNFkCRbHBNziAIoXLdu4MIyHJKaFdlKYzDXZAbr IXCK47owA5xJh5hKVeU3gaS0+0bU3Bk= X-Received: by 2002:aca:2d86:: with SMTP id t128-v6mr12891902oit.146.1528126787323; Mon, 04 Jun 2018 08:39:47 -0700 (PDT) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id q74-v6sm2423022ota.69.2018.06.04.08.39.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 08:39:46 -0700 (PDT) Received: by mail-oi0-f48.google.com with SMTP id t133-v6so25215174oif.10 for ; Mon, 04 Jun 2018 08:39:45 -0700 (PDT) X-Received: by 2002:aca:4ad2:: with SMTP id x201-v6mr11202469oia.11.1528126785314; Mon, 04 Jun 2018 08:39:45 -0700 (PDT) MIME-Version: 1.0 References: <20180529181740.195362-1-evgreen@chromium.org> <20180529181740.195362-2-evgreen@chromium.org> In-Reply-To: From: Evan Green Date: Mon, 4 Jun 2018 08:39:08 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/7] scsi: ufs: Add Configuration Descriptor to sysfs To: Bart.VanAssche@wdc.com Cc: jejb@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, martin.petersen@oracle.com, Vinayak Holikatti , Stanislav.Nijnikov@wdc.com, Gwendal Grignou Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 4, 2018 at 1:31 AM Bart Van Assche wrote: > > On Tue, 2018-05-29 at 11:17 -0700, Evan Green wrote: > > This change adds the configuration descriptor to the UFS > > sysfs interface. This is done in preparation for making the > > interface writable, which will enable provisioning UFS devices > > via Linux. > > > > The configuration descriptor is laid out as a header, then a set of > > (usually 8) copies of the same descriptor for each unit. Rather than > > creating 8 sets of the same attribute, this interface adds a cfg_unit > > file, which can be set as an index that defines which of the 8 > > configuration unit descriptors are being shown through sysfs. > > I don't know any other example of a sysfs attribute that controls the > contents of another sysfs attribute so I don't know whether this kind > of behavior is acceptable for sysfs attributes. Additionally, how can > these two sysfs attributes be used together from concurrently running > processes without triggering a race condition? > > Bart. Hi Bart, I was following the example of rpm_lvl and spm_lvl in this driver, whose values control what is shown in rpm_target_dev_state and rpm_target_link_state (and spm equivalents). My original thinking was that provisioning the high level storage configuration of a UFS disk is by definition a single threaded one-time-only activity. However Stanislav and others have also expressed concerns about this mechanism, so it sounds like I should revise it. I'm hoping Stanislav will comment on one of two possible approaches I suggested in the cover letter. -Evan