Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4955324ybb; Tue, 24 Mar 2020 08:19:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs0s1fqqXABEQ73xptW3NRZwsOyOZZ++CUSXewvMUjBbDXFal5RVj2E3vWphb+TycDTNo7M X-Received: by 2002:a9d:6d82:: with SMTP id x2mr12810016otp.50.1585063180131; Tue, 24 Mar 2020 08:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585063180; cv=none; d=google.com; s=arc-20160816; b=XkZv3ELzAHpaYDUUJ54dstr1teX2PYlQyJdSD6xtkFya/pxzv+pOwekQldh+aDfvtc bf29xA7svWfcrqwyYqoPq114M1OBznOKAmN1ALavGAbe+8ynkNme6WEYdI+T4VwbFiOZ TyqaSyoDWkUdBwjLCfpYilN1Z3VlH8Vy8U5Rzc5nSJcnewUs36nJSgTRn5GVIEY2bMG7 vpzoRCbWyqGbuSVFzdm+71izO4OvRNb+An4VkzvLjhWgrozdh6gs4HHES442t21E/9q4 cS05n18cKZ6A5etpl6r6HuAhajzY2Crsgj83voAO4hqGM+doJd/w5kpUs01DIlKwtTYh mMSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zX4B8MbzZ4iAR++dxFNGYgiThhjkDG0R0+19Nk04E3g=; b=M5j/wZXNdlYP8WLiCpX1SUYefGELCy2KQ1VJW3NTchI1FJQIwTnysshEY4R1EbSzj2 d/FEINpu4WS1A8NUpHXEo9g1WEF2uapfHqANG/f57/IOlj2rR09zA1R5iEAGRHKHYyt7 e944ynN1moAGoGnDaUGWJ4ZZEIH1Ty4WquoOijp52JzAsckXM+3m6igX/lvw+ZmSjwM4 J3Xg9OH39QTGkRew66HuKpcgZacS8kFbS7YJocSsJjTf6DvIUm/ADBhc0BCf2Nbka9iT f6E9ev7DkgUfNiXHWkYUtWoyRUFNsYtOnxjSUGNFtih/W+lqH31mpNFXuxn0fgsXgtFJ VZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QIQUsxff; 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 t7si5272575otd.115.2020.03.24.08.19.26; Tue, 24 Mar 2020 08:19:40 -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=@kernel.org header.s=default header.b=QIQUsxff; 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 S1727668AbgCXPSe (ORCPT + 99 others); Tue, 24 Mar 2020 11:18:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:54014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727561AbgCXPSd (ORCPT ); Tue, 24 Mar 2020 11:18:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01B202076F; Tue, 24 Mar 2020 15:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585063113; bh=0oO4R6Fq55pS68Lzl3lvAUhpi/VkW0U9z/riyIu9OD4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QIQUsxffWxV+ZptxFl4tdp0yoU+K2wKOyGp3Wy7pPzEtWprI5ziuSFpGGSvDtKUmz M/FqAgZj3S4JTIHlniRlPfNvIf8ggk8WZ807KjvMzcMDSTTLHlH209rtwBWp+mIjtA 9ASVSJcvc4/LLcpgp+pEGEpENRxYf8ISCWExKh4Q= Date: Tue, 24 Mar 2020 16:18:31 +0100 From: Greg KH To: Nicholas Johnson Cc: Srinivas Kandagatla , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 5/5] nvmem: Add support for write-only instances Message-ID: <20200324151831.GA2510993@kroah.com> 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> <300e8095-3af4-15a2-069f-87ac7cbb83bb@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 02:24:21PM +0000, Nicholas Johnson wrote: > On Tue, Mar 24, 2020 at 01:25:46PM +0000, Srinivas Kandagatla wrote: > > > > > > 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! > I am still onboard and willing do the work, but we may need to discuss > to be on the same page with new plans. How do you wish to do this? > > Does this new approach still allow us to abort if we receive an invalid > configuration? Or do we still need to have something in nvmem_register() > to abort in invalid case? > > The documentation of is_bin_visible says only read/write permissions are > accepted. Does this mean that it will not take read-only or write-only? > That is one way of interpreting it. That's a funny way of interpreting it :) Please be sane, you pass back the permissions of the file, look at all of the places in the kernel is it used for examples... thanks, greg k-h