From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: wxt@rock-chips.com, linux-api@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
p.zabel@pengutronix.de, Andrew Lunn <andrew@lunn.ch>,
sboyd@codeaurora.org, arnd@arndb.de,
linux-arm-kernel@lists.infradead.org, khilman@kernel.org,
maitysanchayan@gmail.com, s.hauer@pengutronix.de,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
mporter@konsulko.com, pantelis.antoniou@konsulko.com,
devicetree@vger.kernel.org, Mark Brown <broonie@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH RFC 3/3] nvmem: add permission flags in nvmem_config
Date: Mon, 17 Aug 2015 13:31:34 +0100 [thread overview]
Message-ID: <55D1D426.8020504@linaro.org> (raw)
In-Reply-To: <1634428787.18822.1439623316281.JavaMail.open-xchange@oxbsltgw04.schlund.de>
On 15/08/15 08:21, Stefan Wahren wrote:
> Hi Srinivas,
>
>> Srinivas Kandagatla <srinivas.kandagatla@linaro.org> hat am 11. August 2015 um
>> 13:03 geschrieben:
>>
>>
>> This patch adds perm variable to nvmem_config structure which will allow
>> providers to specify the permissions required for the sysfs binary file.
>> This permission is applied on top of root-only access permissions set by
>> the core.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>> drivers/nvmem/core.c | 1 +
>> include/linux/nvmem-provider.h | 1 +
>> 2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
>> index 414ed23..7481387 100644
>> --- a/drivers/nvmem/core.c
>> +++ b/drivers/nvmem/core.c
>> @@ -312,6 +312,7 @@ struct nvmem_device *nvmem_register(const struct
>> nvmem_config *config)
>> config->read_only;
>> nvmem->bin = bin_attr_template;
>> nvmem->bin.attr.mode = nvmem->read_only ? : (S_IRUSR | S_IWUSR);
>> + nvmem->bin.attr.mode |= config->perm;
>> nvmem->bin.size = nvmem->size;
>> device_initialize(&nvmem->dev);
>>
>> diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
>> index 0b68caf..de9a61f 100644
>> --- a/include/linux/nvmem-provider.h
>> +++ b/include/linux/nvmem-provider.h
>> @@ -23,6 +23,7 @@ struct nvmem_config {
>> const struct nvmem_cell_info *cells;
>> int ncells;
>> bool read_only;
>> + u16 perm; /* visibility in sysfs */
>
> how about "umode_t mode" or "umode_t sysfs_mode"?
>
Yep, "umode_t mode" sounds much better.
I will use it that.
--srini
> Beside that the whole series looks good to me.
>
> Thanks Stefan
>
WARNING: multiple messages have this Message-ID (diff)
From: srinivas.kandagatla@linaro.org (Srinivas Kandagatla)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 3/3] nvmem: add permission flags in nvmem_config
Date: Mon, 17 Aug 2015 13:31:34 +0100 [thread overview]
Message-ID: <55D1D426.8020504@linaro.org> (raw)
In-Reply-To: <1634428787.18822.1439623316281.JavaMail.open-xchange@oxbsltgw04.schlund.de>
On 15/08/15 08:21, Stefan Wahren wrote:
> Hi Srinivas,
>
>> Srinivas Kandagatla <srinivas.kandagatla@linaro.org> hat am 11. August 2015 um
>> 13:03 geschrieben:
>>
>>
>> This patch adds perm variable to nvmem_config structure which will allow
>> providers to specify the permissions required for the sysfs binary file.
>> This permission is applied on top of root-only access permissions set by
>> the core.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>> drivers/nvmem/core.c | 1 +
>> include/linux/nvmem-provider.h | 1 +
>> 2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
>> index 414ed23..7481387 100644
>> --- a/drivers/nvmem/core.c
>> +++ b/drivers/nvmem/core.c
>> @@ -312,6 +312,7 @@ struct nvmem_device *nvmem_register(const struct
>> nvmem_config *config)
>> config->read_only;
>> nvmem->bin = bin_attr_template;
>> nvmem->bin.attr.mode = nvmem->read_only ? : (S_IRUSR | S_IWUSR);
>> + nvmem->bin.attr.mode |= config->perm;
>> nvmem->bin.size = nvmem->size;
>> device_initialize(&nvmem->dev);
>>
>> diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
>> index 0b68caf..de9a61f 100644
>> --- a/include/linux/nvmem-provider.h
>> +++ b/include/linux/nvmem-provider.h
>> @@ -23,6 +23,7 @@ struct nvmem_config {
>> const struct nvmem_cell_info *cells;
>> int ncells;
>> bool read_only;
>> + u16 perm; /* visibility in sysfs */
>
> how about "umode_t mode" or "umode_t sysfs_mode"?
>
Yep, "umode_t mode" sounds much better.
I will use it that.
--srini
> Beside that the whole series looks good to me.
>
> Thanks Stefan
>
next prev parent reply other threads:[~2015-08-17 12:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 11:02 [PATCH RFC 0/3] nvmem: make sysfs binary file permissions more flexible Srinivas Kandagatla
2015-08-11 11:02 ` Srinivas Kandagatla
2015-08-11 11:03 ` [PATCH RFC 1/3] nvmem: make default user binary file root-access only Srinivas Kandagatla
2015-08-11 11:03 ` Srinivas Kandagatla
2015-08-11 11:03 ` [PATCH RFC 2/3] nvmem: set the size for the nvmem binary file Srinivas Kandagatla
2015-08-11 11:03 ` Srinivas Kandagatla
2015-08-11 11:03 ` [PATCH RFC 3/3] nvmem: add permission flags in nvmem_config Srinivas Kandagatla
2015-08-11 11:03 ` Srinivas Kandagatla
2015-08-11 11:03 ` Srinivas Kandagatla
[not found] ` <1439291024-18375-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-08-15 7:21 ` Stefan Wahren
2015-08-15 7:21 ` Stefan Wahren
2015-08-15 7:21 ` Stefan Wahren
2015-08-17 12:31 ` Srinivas Kandagatla [this message]
2015-08-17 12:31 ` Srinivas Kandagatla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55D1D426.8020504@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maitysanchayan@gmail.com \
--cc=mporter@konsulko.com \
--cc=p.zabel@pengutronix.de \
--cc=pantelis.antoniou@konsulko.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@codeaurora.org \
--cc=stefan.wahren@i2se.com \
--cc=wxt@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.