Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1143879imm; Wed, 13 Jun 2018 14:11:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKNRhZyGvbHTda3flY59X6qyaLaYDeGT0O8I//dzgAgs2AFA1AyBf1yhZd8NHMaHw4z5bHq X-Received: by 2002:a62:cc51:: with SMTP id a78-v6mr6401952pfg.219.1528924298110; Wed, 13 Jun 2018 14:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528924298; cv=none; d=google.com; s=arc-20160816; b=wlqjSgIs2rtD7vtsLaNKCx4Ef0TPcikJPgHbFAiFgFcic5P7eNOB6VamYNBqNjalei E6r1xrtpD+uG8ahAHO53tbACFzojZEREzRi2ZIrskXHUF0ZeCOX21vzwKGTsM4LHpIF8 XovTeTtiyAv2sZ8xgVsvOB1gRqmpZB1aiV886Pi73s8vYPszmsvXx+zudaXOmRnG0oSo J5QjPP71VNGRQZOh1eBNFglbMwb2gDqgBDJfWrjkYGZBvK2j77ckAeD9RBM/qYrhH/C3 ZEdZDtmz8KQgbGXg4ytnKnWXaedIUJiG6/76XitF6I6ygcsZvEDcnvvlts7d8NozN1oK G0KA== 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=bZ2EAJKrDMpoi5pNmWUN7On/RlquCFALELbeAgS3PIw=; b=FfM4+6H05Os7ahkgIJcfqAgpgl4PUZNZWnEx1bMKUsw1Qw8Ww2QP9SjzrIMb2p182l QnwQ+X853FDNOjL+A56dQssB45G9BrS36OYf1tJM0PMxZ7qlLwZU8osaegXRPuOT1jNo 2Kw1jJAE+qLDPbLvVgZougm3zYxI5hA1ch1fmebmXkTrRjdw9nEErjNEDH2+G0/s1JvO 4sl9ExlY2YcSKzbAH5YlJ6KAYdtFzHDNAK61++U9rI33RKFTbU9a7Hll5Igenoe8CRDG MiBoyQIc3C3LOFNj6dpCieqplsqpYHnCGywBwtTcMy984OoTWOtr8ER7qHop3Oj2nI1g c4ag== 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 a7-v6si3062683pgc.125.2018.06.13.14.11.24; Wed, 13 Jun 2018 14:11:38 -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 S935957AbeFMVJR (ORCPT + 99 others); Wed, 13 Jun 2018 17:09:17 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:54991 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935626AbeFMVJQ (ORCPT ); Wed, 13 Jun 2018 17:09:16 -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 14:09:11 -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 EEEFA409BF; Wed, 13 Jun 2018 14:09:15 -0700 (PDT) From: Nadav Amit To: Greg Kroah-Hartman CC: Xavier Deguillard , , Arnd Bergmann , Nadav Amit , Subject: [PATCH v2 4/7] vmw_balloon: fix VMCI use when balloon built into kernel Date: Wed, 13 Jun 2018 06:54:09 -0700 Message-ID: <20180613135412.81660-5-namit@vmware.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180613135412.81660-1-namit@vmware.com> References: <20180613135412.81660-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. 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