All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Evgeniy Polyakov <zbr@ioremap.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	YueHaibing <yuehaibing@huawei.com>,
	linux-kernel@vger.kernel.org, kernel@pyra-handheld.com,
	letux-kernel@openphoenux.org, linux-omap@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 3/4] w1: omap-hdq: fix interrupt handling which did show spurious timeouts
Date: Wed, 27 May 2020 09:46:33 -0700	[thread overview]
Message-ID: <20200527164633.GJ37466@atomide.com> (raw)
In-Reply-To: <68fc8623ae741878beef049273696d2377526165.1590255176.git.hns@goldelico.com>

* H. Nikolaus Schaller <hns@goldelico.com> [200523 17:34]:
> Since
> 
> commit 27d13da8782a ("w1: omap-hdq: Simplify driver with PM runtime autosuspend")
> 
> was applied,
> 
> I did see timeouts and wrong values when reading a bq27000 connected
> to hdq of the omap3. This occurred mainly after boot but remained and
> only sometimes settled down after several reads.
> 
> root@letux:~# time cat /sys/class/power_supply/bq27000-battery/uevent
> POWER_SUPPLY_NAME=bq27000-battery
> POWER_SUPPLY_STATUS=Discharging
> POWER_SUPPLY_PRESENT=1
> POWER_SUPPLY_VOLTAGE_NOW=0
> POWER_SUPPLY_CURRENT_NOW=0
> POWER_SUPPLY_CAPACITY=0
> POWER_SUPPLY_CAPACITY_LEVEL=Normal
> POWER_SUPPLY_TEMP=-2731
> POWER_SUPPLY_TIME_TO_EMPTY_NOW=0
> POWER_SUPPLY_TIME_TO_EMPTY_AVG=0
> POWER_SUPPLY_TIME_TO_FULL_NOW=0
> POWER_SUPPLY_TECHNOLOGY=Li-ion
> POWER_SUPPLY_CHARGE_FULL=0
> POWER_SUPPLY_CHARGE_NOW=0
> POWER_SUPPLY_CHARGE_FULL_DESIGN=0
> POWER_SUPPLY_CYCLE_COUNT=0
> POWER_SUPPLY_ENERGY_NOW=0
> POWER_SUPPLY_POWER_AVG=0
> POWER_SUPPLY_HEALTH=Good
> POWER_SUPPLY_MANUFACTURER=Texas Instruments
> 
> real    0m15.761s
> user    0m0.001s
> sys     0m0.025s
> root@letux:~#
> 
> Sometimes the effect did disappear after accessing
> the device multiple times, speed went up and results
> became correct.
> 
> All this indicates that some interrupts from the hdq
> controller are lost by the driver.
> 
> Enabling debugging revealed that there were spurious tx
> and rx timeouts, i.e. the driver does not always recognise
> interrupts. The main problem is that rx and tx interrupts
> share a single variable which was sometimes reset to
> 0 wiping out other interrupts. And it was overwritten
> by a second interrupt, independent of whether the
> previous interrupt was already processed or not.
> 
> This patch improves interrupt handling to avoid such
> races and loss of interrupt flags.

Good to hear you got it figured out :) Looks OK to me:

Acked-by: Tony Lindgren <tony@atomide.com>

  reply	other threads:[~2020-05-27 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 17:32 [PATCH 0/4] w1: omap: fix some regressions/bugs (some were introduced in v5.6 but some are older) H. Nikolaus Schaller
2020-05-23 17:32 ` [PATCH 1/4] w1: omap-hdq: cleanup to add missing newline for some dev_dbg H. Nikolaus Schaller
2020-05-23 18:09   ` Tony Lindgren
2020-05-23 17:32 ` [PATCH 2/4] w1: omap-hdq: fix return value to be -1 if there is a timeout H. Nikolaus Schaller
2020-05-23 18:11   ` Tony Lindgren
2020-05-23 17:32 ` [PATCH 3/4] w1: omap-hdq: fix interrupt handling which did show spurious timeouts H. Nikolaus Schaller
2020-05-27 16:46   ` Tony Lindgren [this message]
2020-05-23 17:32 ` [PATCH 4/4] w1: omap-hdq: print dev_err if irq flags are not cleared H. Nikolaus Schaller
2020-05-27 16:46   ` Tony Lindgren

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=20200527164633.GJ37466@atomide.com \
    --to=tony@atomide.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hns@goldelico.com \
    --cc=kernel@pyra-handheld.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    --cc=zbr@ioremap.net \
    /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.