linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Samuel Holland <samuel@sholland.org>
Cc: Sebastian Reichel <sre@kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Oskari Lemmela <oskari@lemmela.net>,
	Quentin Schulz <quentin.schulz@bootlin.com>,
	"open list:THERMAL" <linux-pm@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>
Subject: Re: [linux-sunxi] [PATCH v2 9/9] power: supply: axp20x_usb_power: Only poll while offline
Date: Mon, 6 Jan 2020 12:27:01 +0800	[thread overview]
Message-ID: <CAGb2v66jxw5acPXEQd0KwVbL96dOjeTj=8jZsC7DFiB_-=i0MA@mail.gmail.com> (raw)
In-Reply-To: <20200105012416.23296-10-samuel@sholland.org>

On Sun, Jan 5, 2020 at 9:24 AM Samuel Holland <samuel@sholland.org> wrote:
>
> Investigation on the AXP803 shows that VBUS_PLUGIN/VBUS_REMOVAL IRQs are
> triggered on the rising/falling edge of AXP20X_PWR_STATUS_VBUS_USED. The
> reason IRQs do not arrive while N_VBUSEN/DRIVEVBUS is high is because
> AXP20X_PWR_STATUS_VBUS_USED also never goes high.
>
> This also means that if VBUS is online, a VBUS_REMOVAL IRQ is received
> immediately on setting N_VBUSEN/DRIVEVBUS high (and VBUS_PLUGIN shortly
> after it is set back low). This was also verified to be the case when
> manually offlining VBUS through AXP20X_VBUS_PATH_SELECT.
>
> As long as VBUS is online, a present->absent transition necessarily
> implies an online->offline transition. Since will cause an IRQ, there is
> no need to poll while VBUS is online.
>
> To ensure the driver's view of VBUS online status remains accurate,
> unconditionally poll once when receiving an IRQ and when resuming. If
> VBUS is still online at that time, polling will cease until the next
> VBUS_REMOVAL IRQ.
>
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Reviewed-by: Chen-Yu Tsai <wens@csie.org>

      reply	other threads:[~2020-01-06  4:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05  1:24 [PATCH v2 0/9] X-Powers Power Supply Improvements Samuel Holland
2020-01-05  1:24 ` [PATCH v2 1/9] mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile Samuel Holland
2020-01-05 10:07   ` Chen-Yu Tsai
2020-01-06  8:36   ` Lee Jones
2020-01-05  1:24 ` [PATCH v2 2/9] power: supply: axp20x_ac_power: Fix reporting online status Samuel Holland
2020-01-05 10:09   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-05 13:00   ` Julian Calaby
2020-01-05 15:27     ` Samuel Holland
2020-01-05  1:24 ` [PATCH v2 3/9] power: supply: axp20x_ac_power: Allow offlining Samuel Holland
2020-01-05 10:11   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-05  1:24 ` [PATCH v2 4/9] power: supply: axp20x_ac_power: Add wakeup control Samuel Holland
2020-01-05 10:24   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-05 10:44     ` Chen-Yu Tsai
2020-01-05  1:24 ` [PATCH v2 5/9] power: supply: axp20x_usb_power: Remove unused device_node Samuel Holland
2020-01-05 10:25   ` Chen-Yu Tsai
2020-01-05  1:24 ` [PATCH v2 6/9] power: supply: axp20x_usb_power: Use a match structure Samuel Holland
2020-01-05 10:34   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-05 17:58     ` Samuel Holland
2020-01-06  2:24       ` Chen-Yu Tsai
2020-01-05  1:24 ` [PATCH v2 7/9] power: supply: axp20x_usb_power: Allow offlining Samuel Holland
2020-01-05 10:40   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-05 17:47     ` Samuel Holland
2020-01-06  2:22       ` Chen-Yu Tsai
2020-01-05  1:24 ` [PATCH v2 8/9] power: supply: axp20x_usb_power: Add wakeup control Samuel Holland
2020-01-05 10:47   ` [linux-sunxi] " Chen-Yu Tsai
2020-01-05  1:24 ` [PATCH v2 9/9] power: supply: axp20x_usb_power: Only poll while offline Samuel Holland
2020-01-06  4:27   ` Chen-Yu Tsai [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='CAGb2v66jxw5acPXEQd0KwVbL96dOjeTj=8jZsC7DFiB_-=i0MA@mail.gmail.com' \
    --to=wens@csie.org \
    --cc=hdegoede@redhat.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=oskari@lemmela.net \
    --cc=quentin.schulz@bootlin.com \
    --cc=samuel@sholland.org \
    --cc=sre@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).