Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp981492imm; Wed, 13 Jun 2018 11:20:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKbyMNKSF0E5FTrqB/O1Nhd4s1nIKslC7O41ix4Jux7g3hLREolnK6AaViLnQdgcxewpdH7 X-Received: by 2002:a17:902:714e:: with SMTP id u14-v6mr6296627plm.289.1528914043903; Wed, 13 Jun 2018 11:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528914043; cv=none; d=google.com; s=arc-20160816; b=ysw9c8TkMj3HitI9AwJ9qqOV/OCITC61pDso35KVdAiCk42CKwjpo/mW3EGhbOjC5Q cNZbdzv+ke74tx5xqVE4yxA18mf/ACLaXmp5ZBOZ++RZyFbgauyoL5yuW5UFIr6UC82Q enamdaVrpFftwt1vJjkYueZ6b9sFPVzQreDypaLupn2qHcye1U1/714RfjVm5BWiFULF D3pa3exryL6jRlik4mtKrTELQLFyOZwIdV5lBPGlCakhL4WDctjRQ/i35dWWh9IriEeZ r/6Hgct6KP0bwnv1ehOE3zl/1h0XpIdgvbGE1wHMgZTljsr5etQ41r/M5NW98z9EnLTx us/g== 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=O+kvZf0LwJQw9aLKsYCwpmIJ7zHhbW7FG/xAnYFI5Qw=; b=yfr4CjXoEQZv+xgrh26R5vP0w1V3MKDqcF2ugdq5Sc3/uTGxREGSmo/H0aFtIqbIvl K/Y1v9W24sgoUaiZZvOUasCr862qhHKGFtQKkGY+/sGpD2MvI59JBUTgXwkFZ5zr8CQQ 9xW5zzdn8fTgK7VvOnia7qHEZMSMe6S9UI+7ZwPZud7k1jlcfdIL/ntYm6FB/Ks9nzcQ 80WWOUmTzNeHF9euhfQ+RHFQu4UWBGT6jNWc8cqneA+/6S9sFpj4+QSWh3MV8/2OkSgf yy7aKYzPICBgCaz3EPrbDGM6qsOJefaWUyg023WgXHYgpH7wGDt7VLk9ioPU/FTL379K BgMg== 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 m28-v6si2776044pgn.197.2018.06.13.11.20.29; Wed, 13 Jun 2018 11:20:43 -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 S935502AbeFMSTg (ORCPT + 99 others); Wed, 13 Jun 2018 14:19:36 -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 S935123AbeFMSS4 (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 9FE8E409AB; 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 6/7] vmw_balloon: fix VMCI use when balloon built into kernel Date: Wed, 13 Jun 2018 04:03:58 -0700 Message-ID: <20180613110359.109033-7-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 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. 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 6e0b09b79fb5..e9502a56aa4b 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -1295,7 +1295,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