Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp980744imm; Wed, 13 Jun 2018 11:19:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ3x5g+gIQAnLyISvLFSx1v6Uu48D+o1Tm0JbsbxXI+ohXEJGoUNMWibWIpNMlJmeFjD5Zt X-Received: by 2002:a17:902:a581:: with SMTP id az1-v6mr6335615plb.61.1528913989299; Wed, 13 Jun 2018 11:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528913989; cv=none; d=google.com; s=arc-20160816; b=xF5KRXRP6IgEe0B6XpuGvmzI04abV1JsOQHmAaMwL444U9ZY2chg6y9fvaqnJ3woD0 jo8eguHcpTdAuXV2aKvkITClJfc9sFWHYhzfp64OJGuj4X4/+8oSUAGh1FJt8zf9XQmR fHsW8WJ6tuwEcgJIMfP63shGb7gxAX1EKpjNFe7D2gWkXkDD8ttHf16yUqB+BAgzmQ5w hgMvpHmA0uHJdsBPh3psYoR3tq/VddnujKXrP9Ov2VP+EXGW0Vg0s8u5lTOBOVJCLcO1 1LUuMuV4T0n1tVcPmnBQTPTGaQDxiFctKJ+qfWaSABZDhXgC3/77SrZ6HeMeuYNC86Oe A0QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=dgEnU8Pj6xtFtesbq2IKBoPTvUdZoVNWphMCLRthRXY=; b=Kb+BEAo5Ap26seiE1Mhd0foJ1l4u0bJZ2Y2es89rnZNsw88M84Ay/TW/9bHFvtBmK1 Bg15k0zc+xMtGX5ds4bUy+rPHsMb+2/7BXFAL4fRDcoyHrzqb5SkFp4GDCPzvproBvJE xTFe6T9mUQ6bNw9S5hXcebmjOERVvIY0dZgeBUb/XlhwJNYJ0PS/gSJTvpMYY9+5624u om6HmZDAsOndi8QF1Ld7kkkjd/CHjCox7D2M/B1kD8cIg01NY10SNvV092dERROwAcWW hFe5r8GOBdn71gLFvMileIX71DyjVYfJR44dA4MOE4rTPLqjCqv+O0yiEfGAwt9RJknN ve7w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32-v6si3482058plc.252.2018.06.13.11.19.35; Wed, 13 Jun 2018 11:19:49 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935675AbeFMSTA (ORCPT + 99 others); Wed, 13 Jun 2018 14:19:00 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:19857 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935558AbeFMSS4 (ORCPT ); Wed, 13 Jun 2018 14:18:56 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 13 Jun 2018 11:18:50 -0700 Received: from sc2-haas01-esx0118.eng.vmware.com (sc2-haas01-esx0118.eng.vmware.com [10.172.44.118]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 9C54D409A5; Wed, 13 Jun 2018 11:18:54 -0700 (PDT) From: Nadav Amit To: Greg Kroah-Hartman CC: Xavier Deguillard , , Arnd Bergmann , Nadav Amit Subject: [PATCH 5/7] vmw_balloon: VMCI_DOORBELL_SET does not check status Date: Wed, 13 Jun 2018 04:03:57 -0700 Message-ID: <20180613110359.109033-6-namit@vmware.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180613110359.109033-1-namit@vmware.com> References: <20180613110359.109033-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX13-EDG-OU-002.vmware.com: namit@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When vmballoon_vmci_init() sets a doorbell using VMCI_DOORBELL_SET, for some reason it does not consider the status and looks at the result. However, the hypervisor does not update the result - it updates the status. Fixes: 48e3d668b790 ("VMware balloon: Enable notification via VMCI") Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit --- drivers/misc/vmw_balloon.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index db3cf91a515d..6e0b09b79fb5 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -1034,29 +1034,30 @@ static void vmballoon_vmci_cleanup(struct vmballoon *b) */ static int vmballoon_vmci_init(struct vmballoon *b) { - int error = 0; + unsigned long error, dummy; - if ((b->capabilities & VMW_BALLOON_SIGNALLED_WAKEUP_CMD) != 0) { - error = vmci_doorbell_create(&b->vmci_doorbell, - VMCI_FLAG_DELAYED_CB, - VMCI_PRIVILEGE_FLAG_RESTRICTED, - vmballoon_doorbell, b); - - if (error == VMCI_SUCCESS) { - VMWARE_BALLOON_CMD(VMCI_DOORBELL_SET, - b->vmci_doorbell.context, - b->vmci_doorbell.resource, error); - STATS_INC(b->stats.doorbell_set); - } - } + if ((b->capabilities & VMW_BALLOON_SIGNALLED_WAKEUP_CMD) == 0) + return 0; - if (error != 0) { - vmballoon_vmci_cleanup(b); + error = vmci_doorbell_create(&b->vmci_doorbell, VMCI_FLAG_DELAYED_CB, + VMCI_PRIVILEGE_FLAG_RESTRICTED, + vmballoon_doorbell, b); - return -EIO; - } + if (error != VMCI_SUCCESS) + goto fail; + + error = VMWARE_BALLOON_CMD(VMCI_DOORBELL_SET, b->vmci_doorbell.context, + b->vmci_doorbell.resource, dummy); + + STATS_INC(b->stats.doorbell_set); + + if (error != VMW_BALLOON_SUCCESS) + goto fail; return 0; +fail: + vmballoon_vmci_cleanup(b); + return -EIO; } /* -- 2.17.0