From: Jan Beulich <jbeulich@suse.com>
To: Paul Durrant <paul@xen.org>
Cc: "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,
contact@puzio.waw.pl, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: Ping: [PATCH v3 1/1] x86/acpi: Use FADT flags to determine the PMTMR width
Date: Wed, 24 Jun 2020 17:31:58 +0200 [thread overview]
Message-ID: <2c3e8cd2-b74f-52b6-4df8-057e8d000455@suse.com> (raw)
In-Reply-To: <5993e716-d71d-cbc0-a186-5325e2bdeba4@suse.com>
On 22.06.2020 10:49, Jan Beulich wrote:
> On 20.06.2020 00:00, Grzegorz Uriasz wrote:
>> @@ -490,8 +497,12 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
>> */
>> if (!pmtmr_ioport) {
>> pmtmr_ioport = fadt->pm_timer_block;
>> - pmtmr_width = fadt->pm_timer_length == 4 ? 24 : 0;
>> + pmtmr_width = fadt->pm_timer_length == 4 ? 32 : 0;
>> }
>> + if (pmtmr_width < 32 && fadt->flags & ACPI_FADT_32BIT_TIMER)
>> + printk(KERN_WARNING PREFIX "PM-Timer is too short\n");
>
> Indentation is screwed up here.
>
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -457,16 +457,13 @@ static u64 read_pmtimer_count(void)
>> static s64 __init init_pmtimer(struct platform_timesource *pts)
>> {
>> u64 start;
>> - u32 count, target, mask = 0xffffff;
>> + u32 count, target, mask;
>>
>> - if ( !pmtmr_ioport || !pmtmr_width )
>> + if ( !pmtmr_ioport || (pmtmr_width != 24 && pmtmr_width != 32) )
>> return 0;
>>
>> - if ( pmtmr_width == 32 )
>> - {
>> - pts->counter_bits = 32;
>> - mask = 0xffffffff;
>> - }
>> + pts->counter_bits = pmtmr_width;
>> + mask = (1ull << pmtmr_width) - 1;
>
> "mask" being of "u32" type, the use of 1ull is certainly a little odd
> here, and one of the reasons why I think this extra "cleanup" would
> better go in a separate patch.
>
> Seeing that besides cosmetic aspects the patch looks okay now, I'd be
> willing to leave the bigger adjustment mostly as is, albeit I'd
> prefer the 1ull to go away, by instead switching to e.g.
>
> mask = 0xffffffff >> (32 - pmtmr_width);
>
> With the adjustments (which I'd be happy to make while committing,
> provided you agree)
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
> Also Cc-ing Paul for a possible release ack (considering this is a
> backporting candidate).
Paul?
Thanks, Jan
next prev parent reply other threads:[~2020-06-24 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-19 22:00 [PATCH v3 0/1] Fix broken suspend on some machines Grzegorz Uriasz
2020-06-19 22:00 ` [PATCH v3 1/1] x86/acpi: Use FADT flags to determine the PMTMR width Grzegorz Uriasz
2020-06-22 8:49 ` Jan Beulich
2020-06-24 15:31 ` Jan Beulich [this message]
2020-06-25 6:55 ` Ping: " Paul Durrant
2020-06-22 8:54 ` Roger Pau Monné
2020-06-22 8:58 ` Roger Pau Monné
2020-06-22 10:13 ` Jan Beulich
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=2c3e8cd2-b74f-52b6-4df8-057e8d000455@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=contact@puzio.waw.pl \
--cc=gorbak25@gmail.com \
--cc=j.nowak26@student.uw.edu.pl \
--cc=jakub@bartmin.ski \
--cc=marmarek@invisiblethingslab.com \
--cc=paul@xen.org \
--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 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.