Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1022426yba; Thu, 4 Apr 2019 02:38:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqztl9gdYRTvP53F9N8Rn5vct4yzoUGR7Eqx5H82a29fyT05MGD21qTqsESGctwzOXL5McpA X-Received: by 2002:a63:460a:: with SMTP id t10mr4664046pga.354.1554370686616; Thu, 04 Apr 2019 02:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370686; cv=none; d=google.com; s=arc-20160816; b=dj/AxTbcKClxtoG+5himNBR3VRqCzvOD5MdgQZ6g/zdoxD0S/DXmaZWpaS2L7kiV3V 11G0NJ3Dcj+m91Xb2jUtBfRIH9iTcAS+5lcRpug8YaLlSvbCcxUtnqKmnJemDJly7oMf +MYdUOrrZ90Tpy+cJnvG4ZxKEj08ipyhAyFFVwS8BWDQ0FjiM4NDkkDsRxqoCe12dvCa t+V87XXJ0RBvEMWwGepsJOJfVPFw+GfMdaIYysu+gXmDGOcxVn0jz4HcyvX5c8OsQRL3 vnY09TFV4DXGGxxo47nnYiN0UAHMlFgdwSzvYToFXrb0uhwm9J4vIg4hTkQZSrhJvsFZ 4QuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2BPLbH2awyaHmiFqyfqBgeFixIUX/1+s6Swt+yfZe04=; b=kCAM3sNBAgObXeufrAccnw2nt5Vs0Q6An8s7jp3K+ZUjLtcok/b8p4sw/XCrqAIeN3 BJSnIBkL7n1SBb4qprr5xwxTPZ8ZvFZOfzyGB1fsT1saEasbXm8ClIkKp7Hf0B0dlfaM Ili7mLjsAel9pHOPNQS0cI3wtmPz+LUzICtWI6veHFY1JBt+RJ5eAPrqT//1wSbEKxbj 2QSGtmFZiqiMae+AahSSE+pu/CCjWvxCYZByeZVSkxs5myp/5CSGhvcGnfYYAn1Ed7N7 HxoVMFGamlblmtwlNlW2yzl5SDoOuaZZXbrUF1HZs++kQ2R+tVkRJTlepP+f2EYqvW5j +7fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LoTwzovI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si16654549pgl.36.2019.04.04.02.37.51; Thu, 04 Apr 2019 02:38:06 -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=LoTwzovI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731538AbfDDJGB (ORCPT + 99 others); Thu, 4 Apr 2019 05:06:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:44306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732214AbfDDJF7 (ORCPT ); Thu, 4 Apr 2019 05:05:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 59C762183E; Thu, 4 Apr 2019 09:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368758; bh=iPEhfL/WfMkx7co8c/fi+HxHTlALBqf2zg2VQ+DWeyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LoTwzovIYmuRYCDkmG7kaokHwcJYdHPbqZduMoerVF9kcnWT0O015o4QQpwutfHdp 0oyzihk8yXABuhLVppZN3Czg6Xpz+73HeKcK7TTymAe9o7qyXyFU9ZD215qMgcpc33 3oFXHPGz5FtmPQluFsctV1RW7Tc03JfXptvEAwq4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Song Hongyan , Srinivas Pandruvada , Jiri Kosina , Sasha Levin Subject: [PATCH 4.19 159/187] HID: intel-ish: ipc: handle PIMR before ish_wakeup also clear PISR busy_clear bit Date: Thu, 4 Apr 2019 10:48:16 +0200 Message-Id: <20190404084610.606163235@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 2edefc056e4f0e6ec9508dd1aca2c18fa320efef ] Host driver should handle interrupt mask register earlier than wake up ish FW else there will be conditions when FW interrupt comes, host PIMR register still not set ready, so move the interrupt mask setting before ish_wakeup. Clear PISR busy_clear bit in ish_irq_handler. If not clear, there will be conditions host driver received a busy_clear interrupt (before the busy_clear mask bit is ready), it will return IRQ_NONE after check_generated_interrupt, the interrupt will never be cleared, causing the DEVICE not sending following IRQ. Since PISR clear should not be called for the CHV device we do this change. After the change, both ISH2HOST interrupt and busy_clear interrupt will be considered as interrupt from ISH, busy_clear interrupt will return IRQ_HANDLED from IPC_IS_BUSY check. Signed-off-by: Song Hongyan Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/intel-ish-hid/ipc/ipc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c index bfbca7ec54ce..e00b9dbe220f 100644 --- a/drivers/hid/intel-ish-hid/ipc/ipc.c +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c @@ -91,7 +91,10 @@ static bool check_generated_interrupt(struct ishtp_device *dev) IPC_INT_FROM_ISH_TO_HOST_CHV_AB(pisr_val); } else { pisr_val = ish_reg_read(dev, IPC_REG_PISR_BXT); - interrupt_generated = IPC_INT_FROM_ISH_TO_HOST_BXT(pisr_val); + interrupt_generated = !!pisr_val; + /* only busy-clear bit is RW, others are RO */ + if (pisr_val) + ish_reg_write(dev, IPC_REG_PISR_BXT, pisr_val); } return interrupt_generated; @@ -843,11 +846,11 @@ int ish_hw_start(struct ishtp_device *dev) { ish_set_host_rdy(dev); + set_host_ready(dev); + /* After that we can enable ISH DMA operation and wakeup ISHFW */ ish_wakeup(dev); - set_host_ready(dev); - /* wait for FW-initiated reset flow */ if (!dev->recvd_hw_ready) wait_event_interruptible_timeout(dev->wait_hw_ready, -- 2.19.1