Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp375392imm; Tue, 19 Jun 2018 23:18:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLV6BT+QFFk5zOb+8tsrdlhdtuoaAKmF+MDvn9o0F485wZiMSN0qCMx9Sg3HYP89cXD85IV X-Received: by 2002:a17:902:4d:: with SMTP id 71-v6mr22212929pla.317.1529475535756; Tue, 19 Jun 2018 23:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529475535; cv=none; d=google.com; s=arc-20160816; b=gulPl+HPRhmuGwgK6lIoSzjT37/O4tLRa2cNQp885GFKWrUnPKuj0s/jnqtnF8jJgU UyEy14eBC01lJNqAE2oCNCes0wP67XTU9G53z2j7kk96kUH2un3k5Am9POtxAdmWzh9/ e5uQINM1PZGtpTOxVq72X8mCVBC1QR5TVPqAwkeyK2ZGCpzHPq4ltrR0DYHLXSAII/2e xEx18Z9E3ARvzlzDoq5TO8o2FBFSjKGI4ML/l2xL2AqSGPGCUBjEGRKtcV4CCC78cJOC vJtA4UU6Di7QAgvE5TZb9jNc4XLIq01Mz2cqO78WuID/Fp31slHnFD6l0yIE5uftqJWQ fy7A== 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=JbZJlkSnVeln6Y0FgufziHhOKTRMCrO2PlPpo0dE4uo=; b=VclE5BbcpUK1tajJYRJSF7xGsNHg0t7pvUizsOPeGFrshJzxrk2+3R4ewuGA8XwTrI nKfQOyNaSrQLRMK7zBdwepvXDAyXQsfnZ4C681AdC4+lOSIUk9H6ueViaJYGOF1Dlj8U jJpj/m55LgEXzHLQCAabW5BoFJxQxKc+FyNgvU4decsvCFlkm98ZoELyl+RyGdxSxJ4R byD+H7aCAGxoiPqHvZHeNHz4TakXC0b7nvo9xV4Pw6hXNN2YBc/1eOQ+0orcBMlpffQ5 VkGmBkzHERFjFxrnS5CODGZ1tP72+QPkBuIrWyk68CY33+77Pwsiifckpbf/bRTzS3Ie HoqA== 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 n3-v6si1335359pgq.693.2018.06.19.23.18.41; Tue, 19 Jun 2018 23:18:55 -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 S1754214AbeFTGQn (ORCPT + 99 others); Wed, 20 Jun 2018 02:16:43 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:14595 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752871AbeFTGPQ (ORCPT ); Wed, 20 Jun 2018 02:15:16 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Tue, 19 Jun 2018 23:14:41 -0700 Received: from sc2-haas01-esx0118.eng.vmware.com (sc2-haas01-esx0118.eng.vmware.com [10.172.44.118]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id A1AA8B0AA2; Tue, 19 Jun 2018 23:15:15 -0700 (PDT) From: Nadav Amit To: Greg Kroah-Hartman CC: Xavier Deguillard , Arnd Bergmann , , Nadav Amit , Subject: [PATCH v3 4/7] vmw_balloon: fix VMCI use when balloon built into kernel Date: Tue, 19 Jun 2018 16:00:27 -0700 Message-ID: <20180619230030.112906-5-namit@vmware.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180619230030.112906-1-namit@vmware.com> References: <20180619230030.112906-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX13-EDG-OU-001.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 Currently, when all modules, including VMCI and VMware balloon are built into the kernel, the initialization of the balloon happens before the VMCI is probed. As a result, the balloon fails to initialize the VMCI doorbell, which it uses to get asynchronous requests for balloon size changes. The problem can be seen in the logs, in the form of the following message: "vmw_balloon: failed to initialize vmci doorbell" The driver would work correctly but slightly less efficiently, probing for requests periodically. This patch changes the balloon to be initialized using late_initcall() instead of module_init() to address this issue. It does not address a situation in which VMCI is built as a module and the balloon is built into the kernel. Fixes: 48e3d668b790 ("VMware balloon: Enable notification via VMCI") Cc: stable@vger.kernel.org Reviewed-by: Xavier Deguillard Signed-off-by: Nadav Amit --- drivers/misc/vmw_balloon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index a7df4c24a28d..e7cfc85f6961 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -1297,7 +1297,14 @@ static int __init vmballoon_init(void) return 0; } -module_init(vmballoon_init); + +/* + * Using late_initcall() instead of module_init() allows the balloon to use the + * VMCI doorbell even when the balloon is built into the kernel. Otherwise the + * VMCI is probed only after the balloon is initialized. If the balloon is used + * as a module, late_initcall() is equivalent to module_init(). + */ +late_initcall(vmballoon_init); static void __exit vmballoon_exit(void) { -- 2.17.0