From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbdKWVlH (ORCPT ); Thu, 23 Nov 2017 16:41:07 -0500 Received: from vulcan.natalenko.name ([104.207.131.136]:37574 "EHLO vulcan.natalenko.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046AbdKWVlG (ORCPT ); Thu, 23 Nov 2017 16:41:06 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 vulcan.natalenko.name 5304D29A6F5 Authentication-Results: vulcan.natalenko.name; dmarc=fail (p=none dis=none) header.from=natalenko.name From: Oleksandr Natalenko To: Jonathan Buzzard Cc: Pali =?ISO-8859-1?Q?Roh=E1r?= , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Mario Limonciello Subject: i8k_smm_func() takes enormous of time to execute Date: Thu, 23 Nov 2017 22:41:03 +0100 Message-ID: <12093169.Rm9IG5ILEB@natalenko.name> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=arc-20170712; t=1511473264; h=from:subject:date:message-id:to:cc:mime-version:content-type:content-transfer-encoding; bh=gPRuCU5+Lq0b7AABfAHLoQCglzuB96f16FVCeZvLwFo=; b=ipB1JiIBPKdJhxs1d26c9B72WMr/tTQx+eNByacHlsq2DC26wXzD/jqCko2+hVPn2/wgAt ZvtBSk2CMC0ZjwQnwZExaQ1LRiU5XQlfpAU8Ofq6IQtNFiw8UtISyF9rsMb4tzkaJfCVxS hHAH8gGcsuOp9Ve9LsMhxSrN9qLkJyo= ARC-Seal: i=1; s=arc-20170712; d=natalenko.name; t=1511473264; a=rsa-sha256; cv=none; b=jrkDXfWJX60WLVuOiQ2z6JsBA33P2V3YkyVty9DjZlQTsbWfD+NTqtuqZFbQLFciXbttUDqWMv2/KV1D+jLdT62J64FDjsXuA0UMWl31rK6af5fXoj/9O2+vrifCMIMkzBPfrsz8OWn3sBIRcKkC3dQo0XVb69+zvy+8N8cSsSI= ARC-Authentication-Results: i=1; auth=pass smtp.auth=oleksandr@natalenko.name smtp.mailfrom=oleksandr@natalenko.name Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vANLfCno022278 Hi, Jonathan, Mario et al. I've noticed that querying Dell Vostro 3360 hwmon sensor freezes the system completely (like, really completely, even mouse cursor does not move, and sound playback stops) for approx. half of a second. Then, system recovers and runs as usual. Also, sensor readings are okay, for instance: === $ sensors dell_smm-virtual-0 dell_smm-virtual-0 Adapter: Virtual device Processor Fan: 5615 RPM CPU: +51.0°C Ambient: +36.0°C Other: +63.0°C SODIMM: +41.0°C === So, I've used trace-cmd to check what takes that much amount of time to execute, and got this: === # trace-cmd record -p function_graph -l i8k_smm -F sensors dell_smm-virtual-0 $ trace-cmd report ... sensors-23694 [002] 89099.214369: funcgraph_entry: # 503440.746 us | i8k_smm(); ... === Clearly, 0.5 s delay. Looking at i8k_smm(), it calls i8k_smm_func() on 0th CPU: === 232 ret = smp_call_on_cpu(0, i8k_smm_func, regs, true); === which, in turn, does some asm magic. I know that SMM is kinda "black box", and kernel has little to do with it, but I think that under Windows, for instance, it would work without freezes. So, likely, querying SMM might be done differently. I do not know how to approach this issue, thus asking for help/advice. Also, CCing Jonathan since the comment before asm magic says this: === 137 * Call the System Management Mode BIOS. Code provided by Jonathan Buzzard. === This was also reported in various places before, for instance, [1], but unfortunately, without any solution. Thanks. Regards, Oleksandr [1] https://bugs.launchpad.net/ubuntu/+source/acpi/+bug/10490