linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: pca953x: Fix NBANK calculation for PCA9536
Date: Mon, 13 Jun 2016 14:34:04 +0530	[thread overview]
Message-ID: <575E7704.5090503@ti.com> (raw)
In-Reply-To: <CACRpkdYZEbefjr-iHT3yahkBovFuE2Ofvr8_Mr+X++pJSVwzfA@mail.gmail.com>



On Monday 13 June 2016 12:52 PM, Linus Walleij wrote:
> On Thu, Jun 9, 2016 at 7:32 AM, Vignesh R <vigneshr@ti.com> wrote:
> 
>> NBANK() macro assumes that ngpios is a multiple of 8(BANK_SZ) and
>> hence results in 0 banks for PCA9536 which has just 4 gpios. This is
>> wrong as PCA9356 has 1 bank with 4 gpios. This results in uninitialized
>> PCA953X_INVERT register. Fix this by using DIV_ROUND_UP macro in
>> NBANK().
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Vignesh R <vigneshr@ti.com>
> 
> Patch applied.
> 
> Is this really a regression or affecting systems in development?
> 
> Which machine/device tree makes this problematic?
> 

I observed this on am335x-icev2 evm which is system in development.
Basically, variable with uninitialized value (junk) gets written to
PCA953X_INVERT register(in device_pca953x_init()) causing driver to
report wrong gpio pin status. So, this bug will affect any platform with
PCA9536 chip. Quick grep on arch/*/boot/dts/ folder shows one platform
already using pca9536 chip. Hence, I added Cc to stable kernel.

-- 
Regards
Vignesh

      reply	other threads:[~2016-06-13  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09  5:32 [PATCH] gpio: pca953x: Fix NBANK calculation for PCA9536 Vignesh R
2016-06-13  7:22 ` Linus Walleij
2016-06-13  9:04   ` Vignesh R [this message]

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=575E7704.5090503@ti.com \
    --to=vigneshr@ti.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).