Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp691545img; Wed, 20 Mar 2019 08:53:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhZWol2hY9kVOrI5zntO9PcaFLsWbYITqqyYeyRkrTEpnqhdk+7JzBHhuE05/AuGAqJDNb X-Received: by 2002:a65:65c5:: with SMTP id y5mr8102772pgv.192.1553097211639; Wed, 20 Mar 2019 08:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553097211; cv=none; d=google.com; s=arc-20160816; b=jcE8ZIgFs7ygKrXQ5USeXKYOjcT6eb43FeyN+pgsd+K3FsUiyaHIHwsz2sN1cju3Cb rG2NEqtWutTVEgfNd1gWhpH1GtL00eLtI3tcyRHfJdy/dV4I8ncFlvJd5cBvV0QKPsvg bbG+db/qK3NddSLydVGob2kDIow2/Ys7BSzxRxMEUoDu/2inAivHL1ou8dl+vwCsFhzX 4onr81lDUVMpgN8L6ka6w/eDd1pxAFiXKR+p1X9Cscb+5IodwpNrRdkxro46JjRdzB+w rVSgAN6Z6b8OhCFQxyoY9IBAfJ9iWdXwD32+k4CHXPtMen4t3QHFBUYHF+APHJfqsVip v4iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=DbzB0rOFQmd5JSSYux94CTAZohBTS7U7KHEbjQ7ZzgU=; b=VjCJOERLmHFG9nXVYX9pILbpWZ5UKhO2aVX2iNglgtoP/HjszwbSqb5643sAculjMt rZOSz+tc2G27I8b+VONvaLLVm46IMaUShAxHhrpBf+v1m4XNDtZ/hRhhDy+KlG8WW0fp JEQ2bi8TgqkTXicpXcJlRN7/6ocTQueR/KjfzKZQKCq74MzOkK6b1PQV9pnhM2GEpkat HvePFbg0Xv1Qsfax7C+mjbNbrz5c/pAK7tq2jHvT4FOG2UMZCw4XnT4QxtCV8biQ3i3j 03g6M1mWT9Soz+Bm+22DREdAw2RzYipn5ixAkOjKrnNclJgblrOjBdoQirNtsj7CkctU lWzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=oSK1tnCQ; dkim=pass header.i=@codeaurora.org header.s=default header.b=NdS78cv6; 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 m10si2122497pls.65.2019.03.20.08.53.16; Wed, 20 Mar 2019 08:53:31 -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=@codeaurora.org header.s=default header.b=oSK1tnCQ; dkim=pass header.i=@codeaurora.org header.s=default header.b=NdS78cv6; 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 S1727404AbfCTPue (ORCPT + 99 others); Wed, 20 Mar 2019 11:50:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33582 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbfCTPud (ORCPT ); Wed, 20 Mar 2019 11:50:33 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1D1D4608BA; Wed, 20 Mar 2019 15:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1553097033; bh=/62Emp41/7n5hL2ZaGhpjwhqfjK28miXuyHNGDPfAyU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oSK1tnCQhTKhPOyjmsnZS5hqvI11cuuCRRR+xsp7Aw88OrbmdCubMOOjeReI1N32b 4pjmMtIzswh2Y6kZqQc3rHXr9n/5XOC1hhPT/sBzv4ZaEelsP7iRlm5rp4FHmt7c7E U5Lh6x9iJDSkTYQESLoJxksve3zh+jk2r08+aOPU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.4] (unknown [122.175.119.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gkohli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7B7B36030B; Wed, 20 Mar 2019 15:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1553097032; bh=/62Emp41/7n5hL2ZaGhpjwhqfjK28miXuyHNGDPfAyU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=NdS78cv6gc087QxLXU9HZo7UkmloJLaXFODXr0db/gaRUNeM3hOg61V8ZvX3+Kh01 0pLaD/IhOkruq05fjzNuNID20PEb9Fb5xIhktdmwO6lgwYduuQsO375nWvGD6Qx2LG 73DbKXJfZ0VXHVv+mvCKIJrZFIwmrXIxmkiaUrXw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7B7B36030B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=gkohli@codeaurora.org Subject: Re: [PATCH v2] nvmem: core: Set no-read-write provider to avoid userspace read/write To: Srinivas Kandagatla , linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org References: <1552831940-7327-1-git-send-email-gkohli@codeaurora.org> <48a71861-c60b-7fe7-d4af-5269cd7c20eb@linaro.org> From: Gaurav Kohli Message-ID: <5f11070f-bf9b-c313-9a78-e412a2fb2908@codeaurora.org> Date: Wed, 20 Mar 2019 21:20:28 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <48a71861-c60b-7fe7-d4af-5269cd7c20eb@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/20/2019 8:04 PM, Srinivas Kandagatla wrote: > > > On 17/03/2019 14:12, Gaurav Kohli wrote: >> Current nvmem framework allows user space to read all register space >> populated by nvmem binary file, In case we don't want to expose value >> of registers to userspace and only want kernel space to read cell >> value from nvmem_cell_read_u32. >> >> To protect the same, Add no-read-write property to prevent read >> from userspace. >> > > Can you explain the real need of this? > Is there any issue you are noticing while reading nvmem content from > userspace? > Hi Srinivas, No, We are not observing any issue, nvmem is dumping the data properly. But there are certain register, which we don't want to expose to user space and want kernel space can only read via nvmem_cell_read. In existing design, even if we read cell from kernel space, nvmem binary files is still populated to user space unconditionally. Regards Gaurav > I don't think this is the right way to do this, its misleading in many > ways. Also this should not be a part of DT binding. > > If we decide that we need this feature, then better way to do this > using a new Kernel config. > > thanks, > srini -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.