linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: Cristina Ciocan <cristina.ciocan@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-gpio@vger.kernel.org,
	Andy Shevchenko <andriy.shevchenko@intel.com>
Subject: Re: Suspicious debounce handling code in pintctrl-baytrail
Date: Thu, 26 Jan 2017 15:43:41 +0200	[thread overview]
Message-ID: <20170126134341.GI17297@lahna.fi.intel.com> (raw)
In-Reply-To: <20170126142020.7bfd1229@endymion>

On Thu, Jan 26, 2017 at 02:20:20PM +0100, Jean Delvare wrote:
> Hi Cristina,
> 
> In this commit:
> 
> commit 658b476c742fe379e7020309fd590a27b457a4c1
> Date:   Fri Apr 1 14:00:07 2016 +0300
> 
>     pinctrl: baytrail: Add debounce configuration
> 
> you added support for getting and setting debounce configuration for
> the Baytrail pins. Now gcc complains about the following:
> 
>   CC [M]  drivers/pinctrl/intel/pinctrl-baytrail.o
> drivers/pinctrl/intel/pinctrl-baytrail.c: In function ‘byt_pin_config_set’:
> drivers/pinctrl/intel/pinctrl-baytrail.c:1181:17: warning: variable ‘debounce’ set but not used [-Wunused-but-set-variable]
>   u32 conf, val, debounce;
>                  ^
> 
> I looked at the code, and it indeed looks wrong. You are reading the
> BYT_DEBOUNCE_REG register, clearing the debounce time bits from it, and
> then writing the debounce time bits to the *BYT_CONF0_REG* register.
> This is certainly corrupting the chip configuration, as the
> configuration register bits 2-0 have a completely different meaning
> (mux configuration.)

Yes, you are right.

This is fixed by following commit from Andy:

https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=fixes&id=04ff5a095d662e0879f0eb04b9247e092210aeff

  reply	other threads:[~2017-01-26 13:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 13:20 Suspicious debounce handling code in pintctrl-baytrail Jean Delvare
2017-01-26 13:43 ` Mika Westerberg [this message]
2017-01-26 14:00   ` Jean Delvare
2017-01-26 14:08     ` Mika Westerberg
2017-01-26 14:24       ` Jean Delvare
2017-01-26 14:13     ` Shevchenko, Andriy
2017-01-26 14:15       ` Shevchenko, Andriy
2017-01-26 14:50         ` mika.westerberg

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=20170126134341.GI17297@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=cristina.ciocan@intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jdelvare@suse.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@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).