lkml.org 
[lkml]   [2018]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 08/12] Drivers: hv: vmbus: Implement Direct Mode for stimer0
On Wed, Feb 14, 2018 at 02:58:41AM +0000, Michael Kelley (EOSG) wrote:
> > -----Original Message-----
> > From: Dan Carpenter <dan.carpenter@oracle.com>
> > Sent: Monday, February 12, 2018 12:42 AM
> > To: KY Srinivasan <kys@microsoft.com>; Stephen Hemminger
> > <stephen@networkplumber.org>
> > Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org; devel@linuxdriverproject.org;
> > olaf@aepfle.de; apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com;
> > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen Hemminger
> > <sthemmin@microsoft.com>; Michael Kelley (EOSG) <Michael.H.Kelley@microsoft.com>
> > Subject: Re: [PATCH 08/12] Drivers: hv: vmbus: Implement Direct Mode for stimer0
> >
> > On Sun, Feb 11, 2018 at 05:33:16PM -0700, kys@exchange.microsoft.com wrote:
> > > @@ -116,9 +146,29 @@ static int hv_ce_set_oneshot(struct clock_event_device *evt)
> > > {
> > > union hv_timer_config timer_cfg;
> > >
> > > + timer_cfg.as_uint64 = 0;
> > > timer_cfg.enable = 1;
> > > timer_cfg.auto_enable = 1;
> > > - timer_cfg.sintx = VMBUS_MESSAGE_SINT;
> > > + if (direct_mode_enabled)
> > > + /*
> > > + * When it expires, the timer will directly interrupt
> > > + * on the specified hardware vector/IRQ.
> > > + */
> > > + {
> > > + timer_cfg.direct_mode = 1;
> > > + timer_cfg.apic_vector = stimer0_vector;
> > > + hv_enable_stimer0_percpu_irq(stimer0_irq);
> > > + }
> > > + else
> > > + /*
> > > + * When it expires, the timer will generate a VMbus message,
> > > + * to be handled by the normal VMbus interrupt handler.
> > > + */
> > > + {
> > > + timer_cfg.direct_mode = 0;
> > > + timer_cfg.sintx = VMBUS_MESSAGE_SINT;
> > > + }
> > > +
> >
> > This indenting isn't right. We should probably zero out .apic_vector
> > if .direct_mode is zero. Or maybe it's fine. I don't know if any
> > static analysis tools will complain...
>
> I'll fix the indenting. Old habits ....
>
> The " timer_cfg.as_uint64 = 0" statement already zero's out .apic_vector
> along with all the other unused fields in the 64-bit value, as required by
> the Hyper-V spec.

Ah, you're right, of course.

regards,
dan carpenter

\
 
 \ /
  Last update: 2018-02-14 08:35    [W:0.037 / U:2.348 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site