Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3710224ybv; Mon, 10 Feb 2020 05:07:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyAGlRVg4XRGUZNb2OIXuv71ONT4bT+h2UE1OEss4tpMu+xOnFULl1NCvI0U1WNnUu6Z9g0 X-Received: by 2002:a9d:470a:: with SMTP id a10mr1007247otf.370.1581340051763; Mon, 10 Feb 2020 05:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340051; cv=none; d=google.com; s=arc-20160816; b=uvdVOBsn7FrtEDzleoJB+VX8jo+dzvsd+oY0MyUDJaLS+mPTEeYwbQjmxy4Sb4Camn elu0XOmDRCYKG52yKT9+xETPf/CAvQLuHk8HLFKX3u/0vhaHk4nF8rFmsOUtIG/OqIm3 GdtWPPqcvWPbRgiaqmT2s+ZO1Qln7XTHksWG4nPhNkH//UgkoKnVY8VIbXDFyppyvYv6 qOVtSB1gECfyun337s62gxKbdw7cwxAVprSmUxA03Z30Cs7DaUttdOLcCBWFe+Be7ckZ +SHe+/kq/xdBFlwzOqL+XeDx5I8WwHSjfC5AqO5oP4TDEz6OfUg5vKKTUedRwjyEqMvu GmIQ== 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=mKGHtdgnOQa4xLLujTyJrjhnhYkheIiN+l9w2pWWjPs=; b=nWdMhVMA5pp4myElNaavJz/eCA60JQhIytmd4PWHfuQ004dW7WxJ62SF0+jFUitx1z FHZioRJ+1/rZGdq1r/sRJCSVrhJE68u4d3VJ5SLC8h4YuJIoSWeDFBjawnj5n1fTK6Ae nDCmH8m6VPG/qT2C1nc0/khF9GZbm+PB6mHzsbLIdg1QassiAbfujS1Jw+3fWZUA+SwL kLiYbhjiNRaq5WZGIPi+d2yfl8LS1obI7wbnYw2s2vfqdkjBqQflhZNYgR6HjpjYu5Bt DaFlCPAqD6XGqnuPxAitx3iLT/djaSaiNN2z1fw29Nm5Gx55s0ooI94i/nbu14aDmbMQ il3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bVuhtMo4; 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 s128si140911oig.204.2020.02.10.05.07.20; Mon, 10 Feb 2020 05:07:31 -0800 (PST) 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=bVuhtMo4; 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 S1728927AbgBJNHQ (ORCPT + 99 others); Mon, 10 Feb 2020 08:07:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:38270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728135AbgBJMjp (ORCPT ); Mon, 10 Feb 2020 07:39:45 -0500 Received: from localhost (unknown [209.37.97.194]) (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 EA5A820733; Mon, 10 Feb 2020 12:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338385; bh=Cii59v+tE1D5Tcds59Ldt4r2lnGyvOzYXC1dTbz939M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bVuhtMo4vkw9A1ixUEYx0+/8tF34hp+4tpKROyQePewvruW/zAf0xLT5u4PQ4oQ2o eKH7UMcHo/5sBIMTrmHNgbNEreC+tAwb9B/SBxdr58QvHwwZ8YKGJ8bdEVnnjOuZUV rN9yuwpt4gVwHse09NvT8Krki2Q7kBq7cp4xeaTs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mika Westerberg , Andy Shevchenko Subject: [PATCH 5.5 067/367] platform/x86: intel_scu_ipc: Fix interrupt support Date: Mon, 10 Feb 2020 04:29:40 -0800 Message-Id: <20200210122430.296784279@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Mika Westerberg commit e48b72a568bbd641c91dad354138d3c17d03ee6f upstream. Currently the driver has disabled interrupt support for Tangier but actually interrupt works just fine if the command is not written twice in a row. Also we need to ack the interrupt in the handler. Signed-off-by: Mika Westerberg Reviewed-by: Andy Shevchenko Cc: stable@vger.kernel.org Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/intel_scu_ipc.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -67,26 +67,22 @@ struct intel_scu_ipc_pdata_t { u32 i2c_base; u32 i2c_len; - u8 irq_mode; }; static const struct intel_scu_ipc_pdata_t intel_scu_ipc_lincroft_pdata = { .i2c_base = 0xff12b000, .i2c_len = 0x10, - .irq_mode = 0, }; /* Penwell and Cloverview */ static const struct intel_scu_ipc_pdata_t intel_scu_ipc_penwell_pdata = { .i2c_base = 0xff12b000, .i2c_len = 0x10, - .irq_mode = 1, }; static const struct intel_scu_ipc_pdata_t intel_scu_ipc_tangier_pdata = { .i2c_base = 0xff00d000, .i2c_len = 0x10, - .irq_mode = 0, }; struct intel_scu_ipc_dev { @@ -99,6 +95,9 @@ struct intel_scu_ipc_dev { static struct intel_scu_ipc_dev ipcdev; /* Only one for now */ +#define IPC_STATUS 0x04 +#define IPC_STATUS_IRQ BIT(2) + /* * IPC Read Buffer (Read Only): * 16 byte buffer for receiving data from SCU, if IPC command @@ -120,11 +119,8 @@ static DEFINE_MUTEX(ipclock); /* lock us */ static inline void ipc_command(struct intel_scu_ipc_dev *scu, u32 cmd) { - if (scu->irq_mode) { - reinit_completion(&scu->cmd_complete); - writel(cmd | IPC_IOC, scu->ipc_base); - } - writel(cmd, scu->ipc_base); + reinit_completion(&scu->cmd_complete); + writel(cmd | IPC_IOC, scu->ipc_base); } /* @@ -610,9 +606,10 @@ EXPORT_SYMBOL(intel_scu_ipc_i2c_cntrl); static irqreturn_t ioc(int irq, void *dev_id) { struct intel_scu_ipc_dev *scu = dev_id; + int status = ipc_read_status(scu); - if (scu->irq_mode) - complete(&scu->cmd_complete); + writel(status | IPC_STATUS_IRQ, scu->ipc_base + IPC_STATUS); + complete(&scu->cmd_complete); return IRQ_HANDLED; } @@ -638,8 +635,6 @@ static int ipc_probe(struct pci_dev *pde if (!pdata) return -ENODEV; - scu->irq_mode = pdata->irq_mode; - err = pcim_enable_device(pdev); if (err) return err;