Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4044391ybz; Tue, 28 Apr 2020 04:57:24 -0700 (PDT) X-Google-Smtp-Source: APiQypKwMvaMeZgmFtmmyq34L5IpzzP8LRLaXvPAxm8zS3CXN+/tPhs80F/m20oYBZg7QuEZOb4L X-Received: by 2002:a17:906:6c93:: with SMTP id s19mr23077136ejr.135.1588075043878; Tue, 28 Apr 2020 04:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588075043; cv=none; d=google.com; s=arc-20160816; b=jFYpR4MlEr5whuAoTWul4iBNFbH+CExeEX8NJ853Mr9qh/GJZZV9Wu6tWzljJqZI/V V7OjjgwUz1rOGDONCHGxlNtMXvgtzpzMq1bx5/plMOdwcm1WVJrlHmrnGENT1m1wq3Kd 6W4tCkZbMg5w6NXsD7uJMnVG1yxcxnaPFax/Zdvsv/GaGcjFNQ9o/+RwrwbAUFVjGzat QQ+6xnTERcJd/xhjmJeB9EK8hc0o0B4ElkH1J4TPaW0xK3XPERu5W3j/8kbhgQcY8l97 z+NEdR9iET/ajDBDW03WXbodbRlwSRu3a5gUIhG8GUI7nh9rRHBBVGaGLRGdsxhHEQjN mo8w== 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=ARhS0rwZ8Alb5Jm0pWQp/cHnoFN2jrQ1u7lV5uPkaIQ=; b=D8+NvsHE/g0McdxOVGpA8pBdev+wGcCf1VI7xBKM27RG+pfp9n8gH2wY75eFjTCSmO enWfYP0iK0x15bOknN+hCukoPUXS1XV4++DSf27LMuIxLK2bVAy6jItbAgy5S8hkUI0l MYEfgg9KRxBBoMBztvoGwgWxYTyA3xKK/w5mrqJqlBIMqjZuClYdx9kwji+VVW9hLtOj qi58GFU1cTZrhhON8gT/qPTpuWGbJZYpVViTE/EQ6x5UM6tO69n6qYax/pTnEqOqFwI1 CzWdXTKE5Kg15jCfeSSWms0NWDOlXOSLAFFGgwZ9TI7tOZ5siYkpCd/cnujG6Vn3OVW/ SI9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yqPfDDwK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id a18si1707569ejy.194.2020.04.28.04.57.00; Tue, 28 Apr 2020 04:57:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yqPfDDwK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726556AbgD1LzK (ORCPT + 99 others); Tue, 28 Apr 2020 07:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726505AbgD1LzJ (ORCPT ); Tue, 28 Apr 2020 07:55:09 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71060C03C1A9 for ; Tue, 28 Apr 2020 04:55:09 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id f13so24249141wrm.13 for ; Tue, 28 Apr 2020 04:55:09 -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=ARhS0rwZ8Alb5Jm0pWQp/cHnoFN2jrQ1u7lV5uPkaIQ=; b=yqPfDDwKZw7djhVzl5OuNoaqC8fFv5dibuLQEe4/NGADPAlpc7ia3b3xNCHs277nOD wobBmC1791F6rWiuwhRrV7BlcpsOZmcc0G0/Ghtu/3/pHzPjOyjq1H7u6J/lXXj6OFle v3jZNOLjPoTZfcyPMGwk0cOi0XLAIE5RWhhAyJ3mmMvFXr+lnUjTDaIK508DjlYcZrqU xhMFB1SFDD1sXHMgx2smoIRPKC00GOPr+XD2nD5FtI8p0M1eUq1Qswzttk87OJ7/aE3x RMU6ytLyZs3AMfJ/nP0lKwosL0Lnsy2a3A7C6RD8BQ+DDqvtGR7diSF28B6etB0H1pXZ i5Jw== 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=ARhS0rwZ8Alb5Jm0pWQp/cHnoFN2jrQ1u7lV5uPkaIQ=; b=LLAl0FAcX4pUc8Wo1sYIEwspgKNtFQKR6AsOmwr2ta1D+Fy4M7Sn7Dg0dmYJbAdijq utBjq0UGgx4HnEOtRLZARe0TPIG68i/grWpYWLCX+SuCuG2CB2ggZvLcwRAQhWU1jk5C uE7EmE+RLE6cx3OB8s3dzqvv7SJ4pcQtIotFBZid80COS5kLMVumdNStcChewZ2vh8I1 C8qWqaKj1fwaBUgR9349mp77mxIlTuQWdmM+7otvJFm4iV0gka0EIIWKekY5d47IvpoY 77UsgY/NQxNon/zUiIy46FmlHQKU2T8YSWAPWmL8154w6PKPab1n5WNv7CEfQLzKUnJN n6iw== X-Gm-Message-State: AGi0Pubd/yVZdgCPZTy6af05decwxJqc1V0z4OTkuqgj6HQhJqlBeZVY vI8hJBb5NRQAD/Wwx9kqnMheenwcSpU= X-Received: by 2002:a5d:544f:: with SMTP id w15mr35097664wrv.77.1588074907763; Tue, 28 Apr 2020 04:55:07 -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 r2sm3091066wmg.2.2020.04.28.04.55.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2020 04:55:07 -0700 (PDT) Subject: Re: [PATCH] nvmem: ensure sysfs writes handle write-protect pin To: Michael Auchter Cc: Khouloud Touil , linux-kernel@vger.kernel.org References: <20200427183914.333587-1-michael.auchter@ni.com> From: Srinivas Kandagatla Message-ID: <4fa69067-8993-1819-abb5-3ce718e17d36@linaro.org> Date: Tue, 28 Apr 2020 12:55:06 +0100 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: <20200427183914.333587-1-michael.auchter@ni.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 27/04/2020 19:39, Michael Auchter wrote: > Commit 2a127da461a9d8d97782d6e82b227041393eb4d2 added support for > handling write-protect pins to the nvmem core, and commit > 1c89074bf85068d1b86f2e0f0c2110fdd9b83c9f retrofitted the at24 driver to > use this support. > > These changes broke write() on the nvmem sysfs attribute for eeproms > which utilize a write-protect pin, as the write callback invokes the > nvmem device's reg_write callback directly which no longer handles > changing the state of the write-protect pin. > > Change the read and write callbacks for the sysfs attribute to invoke > nvmme_reg_read/nvmem_reg_write helpers which handle this, rather than > calling reg_read/reg_write directly. > > Signed-off-by: Michael Auchter > --- > drivers/nvmem/core.c | 52 ++++++++++++++++++++++---------------------- > 1 file changed, 26 insertions(+), 26 deletions(-) > Applied fixes tag: Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin") --srini