From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srinivas Kandagatla Subject: Re: [PATCH] nvmem: core: add NVMEM_SYSFS Kconfig Date: Tue, 16 Apr 2019 10:44:01 +0100 Message-ID: <66c3794b-ee84-f746-e686-e5477b78e981@linaro.org> References: <20190415164011.2638-1-srinivas.kandagatla@linaro.org> <3a66797d-347d-2414-14e1-edbcd7c39ae8@codeaurora.org> <20190416093454.GN2654@lahna.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190416093454.GN2654@lahna.fi.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Mika Westerberg , Gaurav Kohli Cc: gregkh@linuxfoundation.org, maxime.ripard@bootlin.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org On 16/04/2019 10:34, Mika Westerberg wrote: > On Tue, Apr 16, 2019 at 10:49:22AM +0530, Gaurav Kohli wrote: >> Hi Srinivas, >> >> Thanks for the patch, >> By default NVMEM_SYSFS should be set true, those whose don't want they can >> disable the same. >> >> If we go with disable option, there are chances of eeprom may break in below >> case: >> >> if (config->compat) { >> rval = nvmem_sysfs_setup_compat(nvmem, config); -> this will >> return error as config is disabled. >> if (rval) >> goto err_device_del; >> } > > I also think this may cause problems with Thunderbolt devices because > the upgradeable NVM is exposed to the userspace via these sysfs files > and those are being used by fwupd. If the files disappear it makes NVM > upgrade somewhat harder ;-) Thanks Mika and Kohli for input. As Kohli suggested we could make NVMEM_SYSFS default to y so that the sysfs file is available by default like before and user/board specific can decide to deselect it. Let me know if thats Okay with you, I can spin that in v2. --srini > > At least it would be good to include following as part of this series if > you plan to disable the sysfs entries by default: > > diff --git a/drivers/thunderbolt/Kconfig b/drivers/thunderbolt/Kconfig > index f4869c38c7e4..dd5facab0af2 100644 > --- a/drivers/thunderbolt/Kconfig > +++ b/drivers/thunderbolt/Kconfig > @@ -7,6 +7,7 @@ menuconfig THUNDERBOLT > select CRYPTO > select CRYPTO_HASH > select NVMEM > + select NVMEM_SYSFS > help > Thunderbolt Controller driver. This driver is required if you > want to hotplug Thunderbolt devices on Apple hardware or on PCs > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4592AC10F13 for ; Tue, 16 Apr 2019 09:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1160C20684 for ; Tue, 16 Apr 2019 09:44:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nYPQUpvy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfDPJoF (ORCPT ); Tue, 16 Apr 2019 05:44:05 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34902 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbfDPJoF (ORCPT ); Tue, 16 Apr 2019 05:44:05 -0400 Received: by mail-wm1-f66.google.com with SMTP id y197so12613276wmd.0 for ; Tue, 16 Apr 2019 02:44:03 -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=MfQ4ZPfq8jXM3q2KxZn6ZQmaur0tuEEWTcoJmqWC3do=; b=nYPQUpvyB8mDur8wr4508xK01nv48ZRydUizGGDjA5AYID2RcTOJffL0liR2C0Ko+Y cvjC05Cr2f2eRc8dpb7+JNJ1U8VZw1t/lS1YlEYMqRheTNI4/qOgu9JIRjivv0GbQJeK DLYzo0ikbU/4VMGuEyyPJ/KU8exUBUxZYN4FVRb4zbSZDPuQxYHIYp/jQKVo+cq9BDaf +y7VthHihzs6bp08/1oaF/KwtIcFU60v/lVbisc4AENFBNdwK+Qw1Itx02DZCcuUsOsn SESSRkef0x/mHDGX6gGVTAeFQMjT3WGYnP6Q3LydgxXZVDIYM7WfRLODbO266iWWj8Fu 4BRw== 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=MfQ4ZPfq8jXM3q2KxZn6ZQmaur0tuEEWTcoJmqWC3do=; b=Kg3zYOABICgUyRldwSZqIKkVN8SI85ioEfpQozB85TU4GBLlSv4SEtu79uC9yTdqhz OiDACvsUaokIWnsVM2oKuAuDS53rgGm4jec9ywJtO05jrMLqktvOe/e1DQ/U7aYHWFhT V3/P7axqAkUtbrBays+kP2Fh35gwA6jEjEszV+SN/Jrt58tY6/z2eCc+FRmIhhTAPCYW iBR9EBmbKmXSPB4AuAfx6oEd07gfKVyZnfPM35tFe3Da+epdZoPrSIaE4WKYeuQOtbpl anwLvDnOoiEt5GPIz71gHzVk0xCf6SnNCt6MysOqzY1jSIOtv6D1F5+0/jHx+rMxcWbA RFHg== X-Gm-Message-State: APjAAAUYU1QTzq1HICbhhA2cXWyDV5l2pe91b2Rvl8FnkisWkQzsaFQa Ly8pO7k6qphPSwgoCoQ7t7bAFTTVMZw= X-Google-Smtp-Source: APXvYqxAzc/tnA6WAOzdLFk8lE+cHhuUPfktIj1Iqv14flyD/lN0fctBwBn/s56g9Ykx4gD4k5Ul/Q== X-Received: by 2002:a7b:cd07:: with SMTP id f7mr26787245wmj.43.1555407843030; Tue, 16 Apr 2019 02:44:03 -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 d14sm72678469wro.79.2019.04.16.02.44.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 02:44:02 -0700 (PDT) Subject: Re: [PATCH] nvmem: core: add NVMEM_SYSFS Kconfig To: Mika Westerberg , Gaurav Kohli Cc: gregkh@linuxfoundation.org, maxime.ripard@bootlin.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190415164011.2638-1-srinivas.kandagatla@linaro.org> <3a66797d-347d-2414-14e1-edbcd7c39ae8@codeaurora.org> <20190416093454.GN2654@lahna.fi.intel.com> From: Srinivas Kandagatla Message-ID: <66c3794b-ee84-f746-e686-e5477b78e981@linaro.org> Date: Tue, 16 Apr 2019 10:44:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190416093454.GN2654@lahna.fi.intel.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Message-ID: <20190416094401.CVLy436RP2vNwQvJcQE6_34tkDlQln7RHNUxFlV3fEQ@z> On 16/04/2019 10:34, Mika Westerberg wrote: > On Tue, Apr 16, 2019 at 10:49:22AM +0530, Gaurav Kohli wrote: >> Hi Srinivas, >> >> Thanks for the patch, >> By default NVMEM_SYSFS should be set true, those whose don't want they can >> disable the same. >> >> If we go with disable option, there are chances of eeprom may break in below >> case: >> >> if (config->compat) { >> rval = nvmem_sysfs_setup_compat(nvmem, config); -> this will >> return error as config is disabled. >> if (rval) >> goto err_device_del; >> } > > I also think this may cause problems with Thunderbolt devices because > the upgradeable NVM is exposed to the userspace via these sysfs files > and those are being used by fwupd. If the files disappear it makes NVM > upgrade somewhat harder ;-) Thanks Mika and Kohli for input. As Kohli suggested we could make NVMEM_SYSFS default to y so that the sysfs file is available by default like before and user/board specific can decide to deselect it. Let me know if thats Okay with you, I can spin that in v2. --srini > > At least it would be good to include following as part of this series if > you plan to disable the sysfs entries by default: > > diff --git a/drivers/thunderbolt/Kconfig b/drivers/thunderbolt/Kconfig > index f4869c38c7e4..dd5facab0af2 100644 > --- a/drivers/thunderbolt/Kconfig > +++ b/drivers/thunderbolt/Kconfig > @@ -7,6 +7,7 @@ menuconfig THUNDERBOLT > select CRYPTO > select CRYPTO_HASH > select NVMEM > + select NVMEM_SYSFS > help > Thunderbolt Controller driver. This driver is required if you > want to hotplug Thunderbolt devices on Apple hardware or on PCs >