Received: by 10.223.185.116 with SMTP id b49csp360998wrg; Tue, 13 Feb 2018 23:36:04 -0800 (PST) X-Google-Smtp-Source: AH8x225PI0/vBBmXbVwQEziJb5KvdQ0FERZJF1XlBlEb3sZlHMHjtghjE9wzKFMaUNBygN9x6qI1 X-Received: by 2002:a17:902:5854:: with SMTP id f20-v6mr3660124plj.374.1518593763979; Tue, 13 Feb 2018 23:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518593763; cv=none; d=google.com; s=arc-20160816; b=v/mRxCIaLVaHNrzP2/dfGf/8NyNRmOoM0omUZtWU4FZTkR2lBHdBN44u9KspIbA+zB WAdemzoPSJSJY3odsLymq9hnDe5OvnmweTllu0Zf6IPHT0LA2rDxC0bV7oTAzgFT2kof VCACfmVtSd4ARGLjauDNQ14/oQB7WWzJxjtD6BA1USfKBxR2WNPIeZm1RUDbWr4He0db DB3WpnoQES/6QFv1eF4N3yMVU9v/ivBpaXbFUfD8bY6qPlM2Xs2VPSZhRrxI0kvEGYrp R9U8Rq/BIjETExEzDCB2UEKfwIjT9LlEAnFRzrNOvLBRyrCsQqX+oLBMlBdhyC5I4VDw zgxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=XHEtzGNdAYJCj52FyMKDOfMkX3XqqE9faWdS8160RPY=; b=ef2zlectQxl0VrvdkJ7E9qyLXdmD/sH6sVM+Yq95K5E7N5KDyNRQerSKSCR66LYgL6 kiDWbk3RBZDViR3XwdzZoH/XGyUh8xIEmlxQwzszgw6aBr7vnRSdnmxbtksTV3mNB4FE afuUnFlN4REI2fLibl5O0QBQAw+ghkxOD3pV7UUZ/RHlHT1viEitNueTsaHoRz8k1saZ N5tXQPXZi/tntShRAWqM94Fj6WunIBS6+1hviBNC6tar4XsYWkF0CLbeYlRnNSnFd4Fx Sbw47D/HW5NYbHSip/4zMO1nFV2RQ4O4me8lJv306xDKhMexRrTdhM40Sh2QAs1qf14n XBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=i5eo20KT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si1176336pgo.193.2018.02.13.23.35.48; Tue, 13 Feb 2018 23:36:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=i5eo20KT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754538AbeBNHfJ (ORCPT + 99 others); Wed, 14 Feb 2018 02:35:09 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:49868 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754469AbeBNHfI (ORCPT ); Wed, 14 Feb 2018 02:35:08 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1E7XKjQ181156; Wed, 14 Feb 2018 07:34:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=XHEtzGNdAYJCj52FyMKDOfMkX3XqqE9faWdS8160RPY=; b=i5eo20KTW5ms967c9/bky4jhtpVvkolMFKm9MmbhcwTXltn2x3XzgaMqpRC+fn/MV8Wh 3ScjRe8nJOFi6H6oW20yOg63zKCbq+wIMRGESWpTwx2nTptK2Lr7BMTRwe8qH5xx/WpG wBubVYDd1CZ6G+3M6V2lfqNpmFn3pZiewtkIO+jgJwKQmPy2rMxK4ideyV3bpX4gQlOj 5mPIuhauyPAjWALDm0ejlnd5gj5B9aslfuhmz2QYHEBZ82wutXPaIW8AqS11JObNhTLO 1DWN+01gAgDsNNbqiFAfwievfGOUQzTUOS9fqyDIvILgzW+Wx6um74Qc8JFrHZneLzPH aw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2g4g4183sq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2018 07:34:46 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1E7YkVD020633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Feb 2018 07:34:46 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1E7YinK026294; Wed, 14 Feb 2018 07:34:44 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 13 Feb 2018 23:34:43 -0800 Date: Wed, 14 Feb 2018 10:34:34 +0300 From: Dan Carpenter To: "Michael Kelley (EOSG)" Cc: KY Srinivasan , Stephen Hemminger , "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 Subject: Re: [PATCH 08/12] Drivers: hv: vmbus: Implement Direct Mode for stimer0 Message-ID: <20180214073434.3u7l7nnncvujstyp@mwanda> References: <20180212002958.6679-1-kys@exchange.microsoft.com> <20180212003320.6748-1-kys@exchange.microsoft.com> <20180212003320.6748-8-kys@exchange.microsoft.com> <20180212084205.idjf2lwrdn2nprw7@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8804 signatures=668670 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=816 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802140090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 14, 2018 at 02:58:41AM +0000, Michael Kelley (EOSG) wrote: > > -----Original Message----- > > From: Dan Carpenter > > Sent: Monday, February 12, 2018 12:42 AM > > To: KY Srinivasan ; Stephen Hemminger > > > > 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 > > ; Michael Kelley (EOSG) > > 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