Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752033AbdGaWWW (ORCPT ); Mon, 31 Jul 2017 18:22:22 -0400 Received: from mga06.intel.com ([134.134.136.31]:20199 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbdGaWWU (ORCPT ); Mon, 31 Jul 2017 18:22:20 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,304,1498546800"; d="scan'208";a="1157456135" Subject: Re: [PATCH] x86/hpet: Cure interface abuse in the resume path To: Thomas Gleixner , LKML Cc: x86@kernel.org, Peter Zijlstra , Martin Peres , Tomi Sarvela , Marc Zyngier , jeffy.chen@rock-chips.com References: From: "Rafael J. Wysocki" Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego 173, 80-298 Gdansk Message-ID: <0c0aa39d-48e6-81fd-f189-79272b0e369d@intel.com> Date: Tue, 1 Aug 2017 00:22:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1471 Lines: 27 On 7/31/2017 10:07 PM, Thomas Gleixner wrote: > The HPET resume path abuses irq_domain_[de]activate_irq() to restore the > MSI message in the HPET chip for the boot CPU on resume and it relies on an > implementation detail of the interrupt core code, which magically makes the > HPET unmask call invoked via a irq_disable/enable pair. This worked as long > as the irq code did unconditionally invoke the unmask() callback. With the > recent changes which keep track of the masked state to avoid expensive > hardware access, this does not longer work. As a consequence the HPET timer > interrupts are not unmasked which breaks resume as the boot CPU waits > forever that a timer interrupt arrives. > > Make the restore of the MSI message explicit and invoke the unmask() > function directly. While at it get rid of the pointless affinity setting as > nothing can change the affinity of the interrupt and the vector across > suspend/resume. The restore of the MSI message reestablishes the previous > affinity setting which is the correct one. > > Fixes: bf22ff45bed6 ("genirq: Avoid unnecessary low level irq function calls") > Reported-by: Martin Peres > Reported-by: Tomi Sarvela > Signed-off-by: Thomas Gleixner > Cc: jeffy.chen@rock-chips.com > Cc: Marc Zyngier > Cc: Peter Ziljstra > Cc: "Rafael J. Wysocki" ACK