[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <eaa37ee8-8d16-95a5-c1b3-360fb8af58b5@gmail.com>
Date: Tue, 31 Mar 2020 20:06:03 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Tianyu Lan <Tianyu.Lan@...rosoft.com>,
devel@...uxdriverproject.org, linux-kernel@...r.kernel.org,
kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
x86@...nel.org, michael.h.kelley@...rosoft.com, wei.liu@...nel.org
Subject: Re: [PATCH V2] x86/Hyper-V: don't allocate clockevent device when
synthetic timer is unavailable
On 3/31/2020 7:20 PM, Vitaly Kuznetsov wrote:
> ltykernel@...il.com writes:
>
>> From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>>
>> Current code initializes clock event data structure for syn timer
>> even when it's unavailable. Fix it.
>>
>> Signed-off-by: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>> ---
>> Change since v1:
>> Update title and commit log.
>>
>> drivers/hv/hv.c | 15 +++++++++------
>> 1 file changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
>> index 632d25674e7f..2e893768fc76 100644
>> --- a/drivers/hv/hv.c
>> +++ b/drivers/hv/hv.c
>> @@ -212,13 +212,16 @@ int hv_synic_alloc(void)
>> tasklet_init(&hv_cpu->msg_dpc,
>> vmbus_on_msg_dpc, (unsigned long) hv_cpu);
>>
>> - hv_cpu->clk_evt = kzalloc(sizeof(struct clock_event_device),
>> - GFP_KERNEL);
>> - if (hv_cpu->clk_evt == NULL) {
>> - pr_err("Unable to allocate clock event device\n");
>> - goto err;
>> + if (ms_hyperv.features & HV_MSR_SYNTIMER_AVAILABLE) {
>> + hv_cpu->clk_evt =
>> + kzalloc(sizeof(struct clock_event_device),
>> + GFP_KERNEL);
>> + if (hv_cpu->clk_evt == NULL) {
>> + pr_err("Unable to allocate clock event device\n");
>> + goto err;
>> + }
>> + hv_init_clockevent_device(hv_cpu->clk_evt, cpu);
>> }
>> - hv_init_clockevent_device(hv_cpu->clk_evt, cpu);
>>
>> hv_cpu->synic_message_page =
>> (void *)get_zeroed_page(GFP_ATOMIC);
>
> Thank you for fixing the subject! I had one more question on the
> previous version which still stands: which tree is this patch for?
> Upstream, clockevent allocation has moved to
> drivers/clocksource/hyperv_timer.c and the code there is different.
>
Yes, I just noticed I fixed an issue on the old code after Michael
reminded me. Sorry for noise. Please ignore it.
Powered by blists - more mailing lists