Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2068518yba; Mon, 15 Apr 2019 04:24:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrOeDDK5p4MJrB/qOWpKfpSCQHuyU1A89hVN0wQKyk9AQkA+GJOIf1P1faJzBa+rf9eN0f X-Received: by 2002:a17:902:8c97:: with SMTP id t23mr74623373plo.110.1555327453276; Mon, 15 Apr 2019 04:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555327453; cv=none; d=google.com; s=arc-20160816; b=pyW2mgYXcz6E7fUPyyU3o5ABwmWTfxC+ggLIoh5Gm0qzUM3j1X/jeOWWrlLY2XrQ5U 8UHtOiHWn8ruqsuSNYkyjaKaQWLtu9HDfIOqDwiIVwjgsfp0aF+59ueM+T04Hwai+0t4 CCTQWoHlXLdYMXD9euPxSQ9cRrP5dCZQgt1mLns7/JGcuWmw+V3lepHmtZGvavULPn2i LiBThLthwH2qM0YEknTcIqyN9Ob9F9t+miABZZef1NIg8KWxd8euF5nqw7LP41fcRNxk 4r65dkEJbKkA4mGoDz+uxLa/UhITOgdjMYGfNNQUXR+YRxKZIiy+kH/5Y9l5QvMxHJhT xjeQ== 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; bh=wapYAFR6Rv1D5DN9kyYInOCOpUc+UGEeNerMB0LeSVg=; b=yu+vlnTLBrwi08JOLY2HyF7OCmPqWnnPqpWK9ryinfsybcqJSS8DVRKsP/bO8Q/EuW KkFAUsXTLAQB9puOGMEJne3T/6NIUiksm0RvNOQ3YM5jyXawrsfYnG/5BZwVRpeUWrwj 21SsnYWFpRsEnAMCpc6uG00FwVci8Vs4ly24X1WlAMs0xviLo5RoVJoDD6s0FWxm4jiA E9MGydaP2mbfINDyTzDp0hVKL0+Al4auVzMx4wYXJXy8O3858rMJBWGbyU2PZs/X7/ml 6B2aMAiHHUbpqhCd7LZrWXhgy1dkHb5JXaEEPLvZ6R+p/nBH2eECnNOV5iOIC1Fb7UeA g3hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XjDjCatQ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k33si46443452pld.27.2019.04.15.04.23.56; Mon, 15 Apr 2019 04:24:13 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XjDjCatQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727156AbfDOLXS (ORCPT + 99 others); Mon, 15 Apr 2019 07:23:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:39274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbfDOLXS (ORCPT ); Mon, 15 Apr 2019 07:23:18 -0400 Received: from linux-8ccs (ip5f5adbb4.dynamic.kabel-deutschland.de [95.90.219.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D460A2073F; Mon, 15 Apr 2019 11:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555327397; bh=TOsxNDNb4tufRLm0bSvz5mHfP+hx6oEAUOc7J13dQ6E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XjDjCatQXhdeiib8jtliErHparazKgKQyWr8sQa/XvzIa01zFus3BC5HbpnlVFpPI 1HD6w75cL8hu76TWH06xCcB9RRdAO/N0hocuPGgvBkNCg32DpS52G9nyi5xGuO/MyM 64Z0s8fHzZ3FyLfRfnktGWwkGtUDkWwFO5Z3CCKY= Date: Mon, 15 Apr 2019 13:23:13 +0200 From: Jessica Yu To: Prarit Bhargava Cc: linux-kernel@vger.kernel.org, cavery@redhat.com Subject: Re: [PATCH] modules: Only return -EEXIST for modules that have finished loading Message-ID: <20190415112313.GA4080@linux-8ccs> References: <20190402133916.13513-1-prarit@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190402133916.13513-1-prarit@redhat.com> X-OS: Linux linux-8ccs 5.1.0-rc1-lp150.12.28-default+ x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Prarit Bhargava [02/04/19 09:39 -0400]: >Microsoft HyperV disables the X86_FEATURE_SMCA bit on AMD systems, and >linux guests boot with repeated errors: > >amd64_edac_mod: Unknown symbol amd_unregister_ecc_decoder (err -2) >amd64_edac_mod: Unknown symbol amd_register_ecc_decoder (err -2) >amd64_edac_mod: Unknown symbol amd_report_gart_errors (err -2) >amd64_edac_mod: Unknown symbol amd_unregister_ecc_decoder (err -2) >amd64_edac_mod: Unknown symbol amd_register_ecc_decoder (err -2) >amd64_edac_mod: Unknown symbol amd_report_gart_errors (err -2) > >The warnings occur because the module code erroneously returns -EEXIST >for modules that have failed to load and are in the process of being >removed from the module list. > >module amd64_edac_mod has a dependency on module edac_mce_amd. Using >modules.dep, systemd will load edac_mce_amd for every request of >amd64_edac_mod. When the edac_mce_amd module loads, the module has >state MODULE_STATE_UNFORMED and once the module load fails and the state >becomes MODULE_STATE_GOING. Another request for edac_mce_amd module >executes and add_unformed_module() will erroneously return -EEXIST even >though the previous instance of edac_mce_amd has MODULE_STATE_GOING. >Upon receiving -EEXIST, systemd attempts to load amd64_edac_mod, which >fails because of unknown symbols from edac_mce_amd. > >add_unformed_module() must wait to return for any case other than >MODULE_STATE_LIVE to prevent a race between multiple loads of >dependent modules. > >Signed-off-by: Prarit Bhargava >Reported-by: Cathy Avery >Cc: Jessica Yu Applied to modules-next. Thanks Prarit! Jessica