From: Bart Van Assche <bvanassche@acm.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
kbuild test robot <fengguang.wu@intel.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Stable <stable@vger.kernel.org>
Subject: Re: [PATCH] ACPICA: Fix dispatcher timeout mechanism
Date: Mon, 15 Oct 2018 16:01:35 -0700 [thread overview]
Message-ID: <1539644495.129692.8.camel@acm.org> (raw)
In-Reply-To: <CAJZ5v0jDv3ufH+MOXmrygHkBgu4CgT6DZL38xq1ViGiju8VxqQ@mail.gmail.com>
On Tue, 2018-10-16 at 00:44 +0200, Rafael J. Wysocki wrote:
> On Tue, Oct 16, 2018 at 12:19 AM Bart Van Assche <bvanassche@acm.org> wrote:
> >
> > This patch avoids that the following warning is reported during hibernation:
>
> Well, what exactly is the problem and why is the patch the right way
> to address it?
It is not safe to call ktime_get() after having called timekeeping_suspend().
> > /*
> > diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c
> > index 0da96268deb5..9dbea4549484 100644
> > --- a/drivers/acpi/acpica/dscontrol.c
> > +++ b/drivers/acpi/acpica/dscontrol.c
> > @@ -84,8 +84,8 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
> > control_state->control.package_end =
> > walk_state->parser_state.pkg_end;
> > control_state->control.opcode = op->common.aml_opcode;
> > - control_state->control.loop_timeout = acpi_os_get_timer() +
> > - (u64)(acpi_gbl_max_loop_iterations * ACPI_100NSEC_PER_SEC);
> > + control_state->control.loop_timeout = jiffies +
> > + acpi_gbl_max_loop_iterations * HZ;
>
> jiffies is Linux-specific and so it should not be used in the ACPICA code.
Really? There is plenty of other ACPI code that uses the jiffies counter directly.
Why wouldn't it be allowed to use the jiffies counter in this context since there
is so much other ACPI code that uses that counter?
$ git grep -nHw jiffies drivers/acpi
drivers/acpi/acpi_pad.c:158: if (time_before(expire_time, jiffies)) {
drivers/acpi/acpi_pad.c:159: last_jiffies = jiffies;
drivers/acpi/acpi_pad.c:165: expire_time = jiffies + HZ * (100 - idle_pct) / 100;
drivers/acpi/acpi_pad.c:184: if (time_before(expire_time, jiffies)) {
drivers/acpi/apei/ghes.c:744: expire = jiffies + msecs_to_jiffies(g->notify.poll_interval);
drivers/acpi/battery.c:29:#include <linux/jiffies.h>
drivers/acpi/battery.c:567: time_before(jiffies, battery->update_time +
drivers/acpi/battery.c:583: battery->update_time = jiffies;
drivers/acpi/dock.c:30:#include <linux/jiffies.h>
drivers/acpi/dock.c:365: ds->last_dock_time = jiffies;
drivers/acpi/dock.c:389: time_before(jiffies, (ds->last_dock_time + HZ)))
drivers/acpi/dock.c:621: dock_station->last_dock_time = jiffies - HZ;
drivers/acpi/ec.c:304: ec->timestamp = jiffies;
drivers/acpi/ec.c:313: ec->timestamp = jiffies;
drivers/acpi/ec.c:320: ec->timestamp = jiffies;
drivers/acpi/ec.c:752: } while (time_before(jiffies, timeout));
drivers/acpi/ec.c:762: unsigned long delay = jiffies +
drivers/acpi/ec.c:770: } while (time_before(jiffies, delay));
drivers/acpi/ec.c:1350: ec->timestamp = jiffies;
drivers/acpi/osl.c:41:#include <linux/jiffies.h>
drivers/acpi/osl.c:1230: long jiffies;
drivers/acpi/osl.c:1246: jiffies = MAX_SCHEDULE_TIMEOUT;
drivers/acpi/osl.c:1248: jiffies = msecs_to_jiffies(timeout);
drivers/acpi/osl.c:1250: ret = down_timeout(sem, jiffies);
drivers/acpi/sbs.c:31:#include <linux/jiffies.h>
drivers/acpi/sbs.c:377: time_before(jiffies, battery->update_time +
drivers/acpi/sbs.c:391: battery->update_time = jiffies;
drivers/acpi/thermal.c:36:#include <linux/jiffies.h>
Bart.
next prev parent reply other threads:[~2018-10-16 6:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20181015221848.256323-1-bvanassche@acm.org>
2018-10-15 22:44 ` [PATCH] ACPICA: Fix dispatcher timeout mechanism Rafael J. Wysocki
2018-10-15 23:01 ` Bart Van Assche [this message]
2018-10-16 5:04 ` Greg KH
2018-10-16 15:03 ` Bart Van Assche
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=1539644495.129692.8.camel@acm.org \
--to=bvanassche@acm.org \
--cc=fengguang.wu@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=stable@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