Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4846617ybb; Tue, 24 Mar 2020 06:27:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtfzRWa/jAYxW2Q/DCQRQmeJ3eWQ3zHQ0IvDQIyZrz4YDpcm4c5ukHlAJhBB6Dww/+9xcTx X-Received: by 2002:a9d:355:: with SMTP id 79mr12222639otv.174.1585056439408; Tue, 24 Mar 2020 06:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585056439; cv=none; d=google.com; s=arc-20160816; b=IkWIvsW2Tb/jA4nU1boWg28pEbBSOc5c61KqQxB0O3x+IjpPp/V0lcJeg7UkZmGMKp SyWr07NT/ivSV2jgp7AFhqjGL6cPvdBg61FHAlrpM2E/xL87q4kGTh1qync2CniY2maU 7VtAqUnvg7l/6JMmIE9SlCxqUKxQ5EjOKuUkOADsWQG5GBI9mX501SNffADgqlOfpJrJ //LFHSSekT1FMd3hGE/lmZrMPySJ0o3nsvk20GPuYSfdP4VaCBcDtSPjEOrz71up+J29 xthkS2Dbok4c+mE7gRsI1AYyUpeFxuvTSdmc7rxFGhGD8NxRgGQ0JiS1WwlmGHtm5d1x XGCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=4JgEAVo+h2KzvKgD9gohdz9+sy8MG1M0rMtQ0IMKIBo=; b=U/oKlrhf95Uw5pOAi5271M6xhFETxanoC5HWiDt0wTtCjZy3gyNXZ1LTj4dZqv10ie cPh69TURUbGkhzSZppcwD/V64F3RDtTazWsKC2e0AgvJY415IMM12rPd5wbZ5KC1eBcv bHzrKa/o2Y4YVGBd4tywCkkTfIOJKP49AhNWglNC1Pj/MqoCydNRSxES6x/Yt7eBHGyK mc6UrfZmFXzFwbSs4Tc7UQLgPPdmNJsHzxLZK3RwFfobGfZ1dDH3Ru4MCXXeFAbPYpxZ Hg6uYMxrKWfjVtb419SaT87NPI6dsH4jMBk3zg/vZD0vmSyVNpAHefotR/PxVS+EWbxH c/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pL0afxlg; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13si8221088oib.268.2020.03.24.06.27.06; Tue, 24 Mar 2020 06:27:19 -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=@linaro.org header.s=google header.b=pL0afxlg; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbgCXNZv (ORCPT + 99 others); Tue, 24 Mar 2020 09:25:51 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53991 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728858AbgCXNZu (ORCPT ); Tue, 24 Mar 2020 09:25:50 -0400 Received: by mail-wm1-f66.google.com with SMTP id b12so3179917wmj.3 for ; Tue, 24 Mar 2020 06:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4JgEAVo+h2KzvKgD9gohdz9+sy8MG1M0rMtQ0IMKIBo=; b=pL0afxlgyYuxlAy2aJ2f4pMyRnBNpJaFAeGBzOfuByV8sqh7q4WkP4g9L9dsM0TrMJ MsjcFXmG1ZcLN/1ZRneJ5NM46sGAEY9HJbRecxzwaLNDu10MGoahXqm5sUL/TvCX1eVX R+4PqmQJDx1NqVV9ky4GBDsh8QeQnQmd20BtEtBp7bOOeGxgiInxgEYLbAjV6/YWUBnd rw8bOv1bzgciSgiz7TPQE5Mej8mMvDVHrRnNqZtAnRzOH1q0GNQSyQouSBwxXCHSpDEp 6hmSR5gvZrQCMnM6ZIRK3k/1R3PX/vGg0Dopc5UjbKkAZ5qVR+IgcRqv7uB0wqDPauUr iDsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4JgEAVo+h2KzvKgD9gohdz9+sy8MG1M0rMtQ0IMKIBo=; b=DD2uPfwqCo/dXNNhAJGvpT4L0OfnbarMJdRIVNGUxFUEEf1OoA08XZDw4SrdQqvMZM xsVwLN7gT1fb1PfM08bMDQWhszmrSY/+UfZu/dzSZJWkEujc7tIbaJ4V6Say3s42l6/G CSRBEhiVC67MmzAjklpCOExTC8zHDAOGFt4WVkYrdnTcj1XpE01M+rWBUmvDgzKHcGfj brF/+wkvckMAfcw97n6KaKRFO3yk5h8vau8AIYQDgAHYpTHlIumLDEvcv4EuWs1eju7r E70XSEuSxaZr3yvyClknoI6P1YicSH4ZM1nCEb492zTATJM5Ej0d0j4SXVNusxqGUkbl ckGA== X-Gm-Message-State: ANhLgQ1kWA4pqJQFYAVHZaU2PpAwBwzbLMv1IdER1WCqp8esVk3Inx1L qIJh9FDCL+whcrGgkkvqEQbE9XeKdfs= X-Received: by 2002:a7b:c004:: with SMTP id c4mr1277278wmb.108.1585056347989; Tue, 24 Mar 2020 06:25:47 -0700 (PDT) Received: from [192.168.86.34] (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.googlemail.com with ESMTPSA id i21sm4689117wmb.23.2020.03.24.06.25.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2020 06:25:47 -0700 (PDT) Subject: Re: [PATCH 5/5] nvmem: Add support for write-only instances To: Greg KH Cc: Nicholas Johnson , linux-kernel@vger.kernel.org References: <20200323150007.7487-1-srinivas.kandagatla@linaro.org> <20200323150007.7487-6-srinivas.kandagatla@linaro.org> <20200323190505.GB632476@kroah.com> <4820047d-9a99-749c-491d-dbb91a2f5447@linaro.org> <20200324122939.GA2348009@kroah.com> From: Srinivas Kandagatla Message-ID: <300e8095-3af4-15a2-069f-87ac7cbb83bb@linaro.org> Date: Tue, 24 Mar 2020 13:25:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200324122939.GA2348009@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/03/2020 12:29, Greg KH wrote: >> But the Idea here is : >> We ended up with providing different options like read-only,root-only to >> nvmem providers combined with read/write callbacks. >> With that, there are some cases which are totally invalid, existing code >> does very minimal check to ensure that before populating with correct >> attributes to sysfs file. One of such case is with thunderbolt provider >> which supports only write callback. >> >> With this new checks in place these flags and callbacks are correctly >> validated, would result in correct file attributes. > Why this crazy set of different groups? You can set the mode of a sysfs > file in the callback for when the file is about to be created, that's so > much simpler and is what it is for. This feels really hacky and almost > impossible to follow:( Thanks for the inputs, That definitely sounds much simpler to deal with. Am guessing you are referring to is_bin_visible callback? I will try to clean this up! thanks, srini > > thanks, > > greg k-h