xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: artur@puzio.waw.pl, Wei Liu <wl@xen.org>,
	jakub@bartmin.ski, Andrew Cooper <andrew.cooper3@citrix.com>,
	marmarek@invisiblethingslab.com,
	Grzegorz Uriasz <gorbak25@gmail.com>,
	j.nowak26@student.uw.edu.pl, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 1/1] x86/acpi: Use FADT flags to determine the PMTMR width
Date: Tue, 16 Jun 2020 14:31:30 +0200	[thread overview]
Message-ID: <440b1c62-e3bd-6a91-f75f-e85d8772f4e0@suse.com> (raw)
In-Reply-To: <20200616103204.GN735@Air-de-Roger>

On 16.06.2020 12:32, Roger Pau Monné wrote:
> On Tue, Jun 16, 2020 at 10:07:05AM +0200, Jan Beulich wrote:
>> On 14.06.2020 16:36, Grzegorz Uriasz wrote:
>>> --- a/xen/arch/x86/acpi/boot.c
>>> +++ b/xen/arch/x86/acpi/boot.c
>>> @@ -480,7 +480,10 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
>>>  		if (fadt->xpm_timer_block.space_id ==
>>>  		    ACPI_ADR_SPACE_SYSTEM_IO) {
>>>  			pmtmr_ioport = fadt->xpm_timer_block.address;
>>> -			pmtmr_width = fadt->xpm_timer_block.bit_width;
>>> +			if (fadt->flags & ACPI_FADT_32BIT_TIMER)
>>> +				pmtmr_width = 32;
>>> +			else
>>> +				pmtmr_width = 24;
>>
>> I think disagreement of the two wants logging, and you want to
>> default to using the smaller of the two (or even to ignoring the
>> timer altogether). Then there wants to be a way to override
>> (unless we already have one) our defaulting, in case it's wrong.
> 
> TBH, I presume timer_block will always return 32bits, because that's
> the size of the register. Then the timer can implement less bits than
> the full size of the register, and that's what gets signaled using the
> ACPI flags. What we care about here is the number of bits used by the
> timer, not the size of the register.

The first random system I checked this on reports 24 bits as bit_width
(and the flag clear, i.e. both are consistent). The flag, aiui, is
really important only in the ACPI v1 case, where the size of the
register was a byte-granular value. The spec isn't helpful in
clarifying applicability of the flag though, i.e. one can interpret it
either way imo.

Jan

> I think we should only ignore the timer if pm_timer_block.bit_width <
> pmtmr_width.
> 
> Printing a (debug) message when those values disagree is fine, but I
> bet it's going to trigger always when the implemented timer is only
> using 24bits.
> 
> Roger.
> 



  reply	other threads:[~2020-06-16 12:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 14:36 [PATCH 0/1] Fix broken suspend on some machines Grzegorz Uriasz
2020-06-14 14:36 ` [PATCH 1/1] x86/acpi: Use FADT flags to determine the PMTMR width Grzegorz Uriasz
2020-06-15  7:05   ` Roger Pau Monné
2020-06-16  8:07   ` Jan Beulich
2020-06-16 10:32     ` Roger Pau Monné
2020-06-16 12:31       ` Jan Beulich [this message]
2020-06-16 13:25       ` Jan Beulich
2020-06-16 14:59         ` Roger Pau Monné
2020-06-16 15:10           ` Grzegorz Uriasz
2020-06-16 15:13             ` Jan Beulich
2020-06-16 15:11           ` Jan Beulich
2020-06-16 15:25             ` Roger Pau Monné
2020-06-17  6:16               ` Grzegorz Uriasz

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=440b1c62-e3bd-6a91-f75f-e85d8772f4e0@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=artur@puzio.waw.pl \
    --cc=gorbak25@gmail.com \
    --cc=j.nowak26@student.uw.edu.pl \
    --cc=jakub@bartmin.ski \
    --cc=marmarek@invisiblethingslab.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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).