public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: srinivas.kandagatla@linaro•org (Srinivas Kandagatla)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 2/4] nvmem: NXP LPC18xx EEPROM memory NVMEM driver
Date: Mon, 16 Nov 2015 15:37:58 +0000	[thread overview]
Message-ID: <5649F856.9000101@linaro.org> (raw)
In-Reply-To: <5649F74A.9020706@vanguardiasur.com.ar>



On 16/11/15 15:33, Ariel D'Alessandro wrote:
>>> >>-------------------------------->cut<----------------------------------
>>> >> From 8cae10eff8ea8da9c5a8058ff75abeeddd8a8224 Mon Sep 17 00:00:00 2001
>>> >>From: Srinivas Kandagatla<srinivas.kandagatla@linaro•org>
>>> >>Date: Mon, 26 Oct 2015 13:30:24 +0000
>>> >>Subject: [PATCH] nvmem: core: return error for non word aligned bytes
>>> >>
>>> >>nvmem providers have restrictions on register strides, so return error
>>> >>code when users attempt to read/write buffers with sizes which are not
>>> >>aligned to the word boundary.
>>> >>
>>> >>Without this patch the userspace would continue to try as it does not
>>> >>get any error from the nvmem core, resulting in a hang.
>>> >>
>>> >>Signed-off-by: Srinivas Kandagatla<srinivas.kandagatla@linaro•org>
>>> >>---
>>> >>  drivers/nvmem/core.c | 6 ++++++
>>> >>  1 file changed, 6 insertions(+)
>>> >>
>>> >>diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
>>> >>index 6fd4e5a..9d11d98 100644
>>> >>--- a/drivers/nvmem/core.c
>>> >>+++ b/drivers/nvmem/core.c
>>> >>@@ -70,6 +70,9 @@ static ssize_t bin_attr_nvmem_read(struct file *filp,
>>> >>struct kobject *kobj,
>>> >>      if (pos >= nvmem->size)
>>> >>          return 0;
>>> >>
>>> >>+    if (count < nvmem->word_size)
>>> >>+        return -EINVAL;
>>> >>+
>>> >>      if (pos + count > nvmem->size)
>>> >>          count = nvmem->size - pos;
>>> >>
>>> >>@@ -95,6 +98,9 @@ static ssize_t bin_attr_nvmem_write(struct file *filp,
>>> >>struct kobject *kobj,
>>> >>      if (pos >= nvmem->size)
>>> >>          return 0;
>>> >>
>>> >>+    if (count < nvmem->word_size)
>>> >>+        return -EINVAL;
>>> >>+
>>> >>      if (pos + count > nvmem->size)
>>> >>          count = nvmem->size - pos;
>>> >>
>> >
>> >Patch looks good to me. I think that it solves the issue.
>> >I don't have the board here right now, so I'll check it ASAP and give
>> >some feedback.
> Finally tested this. As it seemed, it solved the issue.
> Are you submitting a patch for this?
Yes, I will send a patch to the mailing list.

--srini
>
> Thanks again.

  reply	other threads:[~2015-11-16 15:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 17:32 [PATCH v2 0/4] Add support for NXP LPC18xx EEPROM using nvmem Ariel D'Alessandro
2015-10-19 17:32 ` [PATCH v2 1/4] DT: nvmem: Add NXP LPC18xx EEPROM memory binding documentation Ariel D'Alessandro
2015-10-24 21:44   ` Joachim Eastwood
2015-10-30 12:45     ` Ariel D'Alessandro
2015-10-27  7:49   ` Rob Herring
2015-10-19 17:32 ` [PATCH v2 2/4] nvmem: NXP LPC18xx EEPROM memory NVMEM driver Ariel D'Alessandro
2015-10-24 22:04   ` Joachim Eastwood
2015-10-26 13:37     ` Srinivas Kandagatla
2015-10-30 14:58       ` Ariel D'Alessandro
2015-11-16 15:33         ` Ariel D'Alessandro
2015-11-16 15:37           ` Srinivas Kandagatla [this message]
2015-12-03 18:39             ` Ezequiel Garcia
2015-10-30 14:55     ` Ariel D'Alessandro
2015-11-16 15:24       ` Ariel D'Alessandro
2015-10-26 14:23   ` Srinivas Kandagatla
2015-10-30 15:42     ` Ariel D'Alessandro
2015-10-30 16:00       ` Ezequiel Garcia
2015-11-03  8:20   ` Stefan Wahren
2015-11-16 15:29     ` Ariel D'Alessandro
2015-11-17 10:01       ` Stefan Wahren
2015-11-17 19:53         ` Ariel D'Alessandro
2015-10-19 17:32 ` [PATCH v2 3/4] ARM: dts: lpc18xx: add EEPROM memory node Ariel D'Alessandro
2015-10-24 21:42   ` Joachim Eastwood
2015-10-19 17:32 ` [PATCH v2 4/4] ARM: configs: lpc18xx: enable EEPROM NVMEM driver Ariel D'Alessandro
2015-10-24 21:41   ` Joachim Eastwood

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=5649F856.9000101@linaro.org \
    --to=srinivas.kandagatla@linaro$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox