640877b
Path: news.gmane.org!not-for-mail
640877b
From: Borislav Petkov <borislav.petkov@amd.com>
640877b
Newsgroups: gmane.linux.kernel
640877b
Subject: [PATCH 1/2] x86, microcode: Fix sysfs warning during module unload
640877b
Date: Thu, 12 Apr 2012 18:30:38 +0200
640877b
Lines: 83
640877b
Approved: news@gmane.org
640877b
Message-ID: <20120412163038.GL24549@aftab>
640877b
References: <20120411163849.GE4794@alberich.amd.com>
640877b
 <20120411200601.GC12288@kroah.com>
640877b
 <20120411201053.GF18114@aftab>
640877b
 <20120412162351.GJ24549@aftab>
640877b
NNTP-Posting-Host: plane.gmane.org
640877b
Mime-Version: 1.0
640877b
Content-Type: text/plain; charset="us-ascii"
640877b
X-Trace: dough.gmane.org 1334248312 13759 80.91.229.3 (12 Apr 2012 16:31:52 GMT)
640877b
X-Complaints-To: usenet@dough.gmane.org
640877b
NNTP-Posting-Date: Thu, 12 Apr 2012 16:31:52 +0000 (UTC)
640877b
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>,
640877b
	Kay Sievers <kay.sievers@vrfy.org>,
640877b
	Dave Jones <davej@redhat.com>, <linux-kernel@vger.kernel.org>
640877b
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
640877b
Original-X-From: linux-kernel-owner@vger.kernel.org Thu Apr 12 18:31:50 2012
640877b
Return-path: <linux-kernel-owner@vger.kernel.org>
640877b
Envelope-to: glk-linux-kernel-3@plane.gmane.org
640877b
Original-Received: from vger.kernel.org ([209.132.180.67])
640877b
	by plane.gmane.org with esmtp (Exim 4.69)
640877b
	(envelope-from <linux-kernel-owner@vger.kernel.org>)
640877b
	id 1SIMw1-0005nm-KE
640877b
	for glk-linux-kernel-3@plane.gmane.org; Thu, 12 Apr 2012 18:31:49 +0200
640877b
Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
640877b
	id S934534Ab2DLQbF (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
640877b
	Thu, 12 Apr 2012 12:31:05 -0400
640877b
Original-Received: from db3ehsobe004.messaging.microsoft.com ([213.199.154.142]:35401
640877b
	"EHLO db3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK)
640877b
	by vger.kernel.org with ESMTP id S934436Ab2DLQbD (ORCPT
640877b
	<rfc822;linux-kernel@vger.kernel.org>);
640877b
	Thu, 12 Apr 2012 12:31:03 -0400
640877b
Original-Received: from mail117-db3-R.bigfish.com (10.3.81.240) by
640877b
 DB3EHSOBE002.bigfish.com (10.3.84.22) with Microsoft SMTP Server id
640877b
 14.1.225.23; Thu, 12 Apr 2012 16:31:00 +0000
640877b
Original-Received: from mail117-db3 (localhost [127.0.0.1])	by
640877b
 mail117-db3-R.bigfish.com (Postfix) with ESMTP id BAA93180481;	Thu, 12 Apr
640877b
 2012 16:31:00 +0000 (UTC)
640877b
X-SpamScore: 1
640877b
X-BigFish: VPS1(zzzz1202hzz8275eh8275bh8275dha1495iz2dh668h839h944hd25hd2bh)
640877b
X-Forefront-Antispam-Report: CIP:163.181.249.109;KIP:(null);UIP:(null);IPV:NLI;H:ausb3twp02.amd.com;RD:none;EFVD:NLI
640877b
Original-Received: from mail117-db3 (localhost.localdomain [127.0.0.1]) by mail117-db3
640877b
 (MessageSwitch) id 133424825930391_28243; Thu, 12 Apr 2012 16:30:59 +0000
640877b
 (UTC)
640877b
Original-Received: from DB3EHSMHS006.bigfish.com (unknown [10.3.81.226])	by
640877b
 mail117-db3.bigfish.com (Postfix) with ESMTP id ED7022E004F;	Thu, 12 Apr 2012
640877b
 16:30:58 +0000 (UTC)
640877b
Original-Received: from ausb3twp02.amd.com (163.181.249.109) by
640877b
 DB3EHSMHS006.bigfish.com (10.3.87.106) with Microsoft SMTP Server id
640877b
 14.1.225.23; Thu, 12 Apr 2012 16:30:57 +0000
640877b
X-WSS-ID: 0M2DKJG-02-0NU-02
640877b
X-M-MSG: 
640877b
Original-Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com
640877b
 [163.181.249.72])	(using TLSv1 with cipher AES128-SHA (128/128 bits))	(No
640877b
 client certificate requested)	by ausb3twp02.amd.com (Axway MailGate 3.8.1)
640877b
 with ESMTP id 21D3FC814C;	Thu, 12 Apr 2012 11:30:50 -0500 (CDT)
640877b
Original-Received: from SAUSEXDAG01.amd.com (163.181.55.1) by sausexedgep01.amd.com
640877b
 (163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 12 Apr
640877b
 2012 11:31:09 -0500
640877b
Original-Received: from storexhtp02.amd.com (172.24.4.4) by sausexdag01.amd.com
640877b
 (163.181.55.1) with Microsoft SMTP Server (TLS) id 14.1.323.3; Thu, 12 Apr
640877b
 2012 11:30:54 -0500
640877b
Original-Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com
640877b
 (172.24.4.4) with Microsoft SMTP Server id 8.3.213.0; Thu, 12 Apr 2012
640877b
 12:30:51 -0400
640877b
Original-Received: from aftab (aftab.osrc.amd.com [165.204.15.109])	by gwo.osrc.amd.com
640877b
 (Postfix) with ESMTP id 0D00D49C58B;	Thu, 12 Apr 2012 17:30:50 +0100 (BST)
640877b
Content-Disposition: inline
640877b
In-Reply-To: <20120412162351.GJ24549@aftab>
640877b
User-Agent: Mutt/1.5.21 (2010-09-15)
640877b
X-OriginatorOrg: amd.com
640877b
Original-Sender: linux-kernel-owner@vger.kernel.org
640877b
Precedence: bulk
640877b
List-ID: <linux-kernel.vger.kernel.org>
640877b
X-Mailing-List: linux-kernel@vger.kernel.org
640877b
Xref: news.gmane.org gmane.linux.kernel:1281049
640877b
Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1281049>
640877b
640877b
From: Andreas Herrmann <andreas.herrmann3@amd.com>
640877b
Date: Thu, 12 Apr 2012 16:48:01 +0200
640877b
Subject: [PATCH 1/2] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs
640877b
640877b
Loading microcode driver on an unsupported CPU and subsequently
640877b
unloading the driver causes
640877b
640877b
 WARNING: at fs/sysfs/group.c:138 mc_device_remove+0x5f/0x70 [microcode]()
640877b
 Hardware name: 01972NG
640877b
 sysfs group ffffffffa00013d0 not found for kobject 'cpu0'
640877b
 Modules linked in: snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel btusb snd_hda_codec bluetooth thinkpad_acpi rfkill microcode(-) [last unloaded: cfg80211]
640877b
 Pid: 4560, comm: modprobe Not tainted 3.4.0-rc2-00002-g258f742 #5
640877b
 Call Trace:
640877b
  [<ffffffff8103113b>] ? warn_slowpath_common+0x7b/0xc0
640877b
  [<ffffffff81031235>] ? warn_slowpath_fmt+0x45/0x50
640877b
  [<ffffffff81120e74>] ? sysfs_remove_group+0x34/0x120
640877b
  [<ffffffffa00000ef>] ? mc_device_remove+0x5f/0x70 [microcode]
640877b
  [<ffffffff81331eb9>] ? subsys_interface_unregister+0x69/0xa0
640877b
  [<ffffffff81563526>] ? mutex_lock+0x16/0x40
640877b
  [<ffffffffa0000c3e>] ? microcode_exit+0x50/0x92 [microcode]
640877b
  [<ffffffff8107051d>] ? sys_delete_module+0x16d/0x260
640877b
  [<ffffffff810a0065>] ? wait_iff_congested+0x45/0x110
640877b
  [<ffffffff815656af>] ? page_fault+0x1f/0x30
640877b
  [<ffffffff81565ba2>] ? system_call_fastpath+0x16/0x1b
640877b
640877b
on recent kernels.
640877b
640877b
This is due to
640877b
640877b
  commit 8a25a2fd126c621f44f3aeaef80d51f00fc11639
640877b
  (cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular
640877b
  subsystem)
640877b
640877b
which renders
640877b
640877b
 commit 6c53cbfced048c421e4f72cb2183465f68fbc5e7
640877b
 (x86, microcode: Correct sysdev_add error path)
640877b
640877b
useless.
640877b
640877b
See http://marc.info/?l=linux-kernel&m=133416246406478
640877b
640877b
Avoid above warning by restoring the old driver behaviour before
640877b
commit 6c53cbfced048c421e4f72cb2183465f68fbc5e7 (x86, microcode:
640877b
Correct sysdev_add error path)
640877b
640877b
Cc: stable@vger.kernel.org
640877b
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
640877b
Cc: Borislav Petkov <borislav.petkov@amd.com>
640877b
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
640877b
---
640877b
 arch/x86/kernel/microcode_core.c |    4 +---
640877b
 1 files changed, 1 insertions(+), 3 deletions(-)
640877b
640877b
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
640877b
index 87a0f86..d389e74 100644
640877b
--- a/arch/x86/kernel/microcode_core.c
640877b
+++ b/arch/x86/kernel/microcode_core.c
640877b
@@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
640877b
 	if (err)
640877b
 		return err;
640877b
 
640877b
-	if (microcode_init_cpu(cpu) == UCODE_ERROR) {
640877b
-		sysfs_remove_group(&dev->kobj, &mc_attr_group);
640877b
+	if (microcode_init_cpu(cpu) == UCODE_ERROR)
640877b
 		return -EINVAL;
640877b
-	}
640877b
 
640877b
 	return err;
640877b
 }
640877b
-- 
640877b
1.7.8.4
640877b
640877b
-- 
640877b
Regards/Gruss,
640877b
Boris.
640877b
640877b
Advanced Micro Devices GmbH
640877b
Einsteinring 24, 85609 Dornach
640877b
GM: Alberto Bozzo
640877b
Reg: Dornach, Landkreis Muenchen
640877b
HRB Nr. 43632 WEEE Registernr: 129 19551
640877b