From patchwork Thu Dec 19 18:34:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182184 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp878778iln; Thu, 19 Dec 2019 11:01:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyMW99gzlAxmgoBQxE9IsFGSSOxlBRvdSERXZO3kKuZL6v7gNh8zsx3De3oJGiorXurjk/g X-Received: by 2002:aca:1e0e:: with SMTP id m14mr2986587oic.114.1576782112866; Thu, 19 Dec 2019 11:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782112; cv=none; d=google.com; s=arc-20160816; b=IfeGJ3/kC8l1mBEiXs8LFVghB2mzRtdLJ2JGrHY1eV3f+vayzs0SC5EivGCfFWCMQX W0VIzEvhrmHUSlCiBuT2YYMtOcoiPWLhIcKNh06lIzrq6NICjLLeH3566hPugrNh4LYN x6RC8t8fadVW//I6ZvDfdGEhOd7PIIx2IQPFHYjAr4fAYbCKs31seOhmuIJnHbeZ+HTY nYY0hnARkVo5X7DPUY1JGrGa6do8Wh2+p5LH9vnckFkqLXanyefg9Sb8KAKVzM7QumYF cIUnKrq980sn17/+s5nJAHGFlMrV+e5sBd9LJaCuY7Tqy6Lwy6EwTEVUSU/WlQ5xk+hE frBA== 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=Xqi4zlcNoZmvTvQeFawnSkjTEylodBb6AekVMmdGxqs=; b=0ou+078+64aecyXMkyoFP6Z1QFj8YtEhouKR3yCPlffjSKRAhMoKu8J01dvixexyGp f0ru3SYSz7u/DVrSaXrPUeifVS4gVNvnqQyJw+Apf2nnH1cY2PebdlPGdZo/eIWlykjZ YxmmawTFQpJ6Wk2HrDLWHkX6Bcued0aqogTd9HEmphhUaXYrkcmRNHzvUAtnbE5PGatd tXFpCGuiX8QCTLyjDpIDQkBTqn5I3V+6/pq+OenWtA40LcUdXCc9l4u7B02U8Zj8up7i SYau8p2PmXSzdxLVUdneiU6xQ9C+ibsE4ezb8ixCF+g0rUKv9FI1/xDk93lEyKSX+PBH 2MaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oyUhkJDC; 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 x68si3425853oia.227.2019.12.19.11.01.49; Thu, 19 Dec 2019 11:01:52 -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=oyUhkJDC; 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 S1727791AbfLSSuW (ORCPT + 27 others); Thu, 19 Dec 2019 13:50:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:44142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729955AbfLSSuS (ORCPT ); Thu, 19 Dec 2019 13:50:18 -0500 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 9026724679; Thu, 19 Dec 2019 18:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781418; bh=ZuWPDLYkW8D6jxmnXjG+7dPj38Xobul41Vvyg5T5/Ao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oyUhkJDCz0AARijSY8p7mhOOg8xDvUnnyWCagij2Hm3sBHbz8q1R0oOb4tXYhtoXf 4Hl9xQutefXZNoWCeT017PwCin+7L1HsxQ7CBh4JTsmJL6+MiNSeLvCwHGmQUvdllq r+rhWSLv7n3bge2MO3B35XxhOc3iEnPJ+pLCyJ3g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grygorii Strashko , "David S. Miller" Subject: [PATCH 4.14 03/36] net: ethernet: ti: cpsw: fix extra rx interrupt Date: Thu, 19 Dec 2019 19:34:20 +0100 Message-Id: <20191219182853.432368154@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219182848.708141124@linuxfoundation.org> References: <20191219182848.708141124@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Grygorii Strashko [ Upstream commit 51302f77bedab8768b761ed1899c08f89af9e4e2 ] Now RX interrupt is triggered twice every time, because in cpsw_rx_interrupt() it is asked first and then disabled. So there will be pending interrupt always, when RX interrupt is enabled again in NAPI handler. Fix it by first disabling IRQ and then do ask. Fixes: 870915feabdc ("drivers: net: cpsw: remove disable_irq/enable_irq as irq can be masked from cpsw itself") Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -862,8 +862,8 @@ static irqreturn_t cpsw_rx_interrupt(int { struct cpsw_common *cpsw = dev_id; - cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX); writel(0, &cpsw->wr_regs->rx_en); + cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX); if (cpsw->quirk_irq) { disable_irq_nosync(cpsw->irqs_table[0]); From patchwork Thu Dec 19 18:34:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182174 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp866170iln; Thu, 19 Dec 2019 10:50:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwaVKc5hy6AyPWoaxtIT3Bkp7aeKROKiivYyuAayOyWKpq2NaleNaO0Em5mCCpEEFGf+NiV X-Received: by 2002:a9d:27a2:: with SMTP id c31mr10880289otb.151.1576781453806; Thu, 19 Dec 2019 10:50:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781453; cv=none; d=google.com; s=arc-20160816; b=gNkjw6FVP6SMnK/Sz16A4d8BetFSh64q8Y+Lk3TRWEuDRrGjzFzQI7Smtxh+tR0m0k dEHtHDVVNxJyl+O5XNyrd0MABP0KKnO6SdDqKu1LXtqfTV/wTNLBo9hR2iTFjUBQjsVA LlgUy1V/gMuitI2gjiTy5qy+f+qFNyEzJr/J7nCuxfvwaaf1RNlWnnRbMAVwaE/vs1e6 dOYyVtJdXMbea9hbjL45iztgovoRrLHa8qIUZ8JYUOZTk7t9mKwRvq3sQi1Hx/Yy999y WGz4zyRLrgKCiz0SeqUmW2QmdfmTbld9NJb+Q9/KPyFX5aFo5SqruSPkA0SYtJIrmOBP s8/g== 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=PJJ6duuYTJb3gCJ+lRHXC3H3uFJAaWUCDIg91pvIwzM=; b=Iw5oLYZRSqKR0tXaX4FlG3Smw9HwdDrLB2ZSJYnJlGk/ySx7b/g77tyok1aEGIiUWp YB0LOV0BhqugKmRfcT/aego/+wQ0jpwNeCLBH+Lw1pg65Bnr46/18Et0XGTrwlbyAFxn SE/JKR4PMp2FKziobVwL6N2Jqec16anvL1F3ry42Bxj9/IuU7qY3E5dZuNUJprJChIK2 LHejUgLos1TRUUBr4Zx7ey2JEWI1OwU3DecAghFRYV6i2zRU339QqfjMrQutI6dgSnbT JNbHldQvIpICmbds1krO5j33/yWCp+VifEoumO5olR2yCmfIvhHeTkox5sBh5MZ4DQyx /PAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xe1LJ0UG; 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 e18si3609134otj.99.2019.12.19.10.50.53; Thu, 19 Dec 2019 10:50:53 -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=xe1LJ0UG; 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 S1730057AbfLSSuv (ORCPT + 27 others); Thu, 19 Dec 2019 13:50:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:44712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729759AbfLSSup (ORCPT ); Thu, 19 Dec 2019 13:50:45 -0500 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 7F6512467F; Thu, 19 Dec 2019 18:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781445; bh=kYqNubHyQokemBhQ/7OuH7fwMiQPADTBVzdD2Cob9+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xe1LJ0UGNOFb08MXi88YCXW4xHExMsdU6ypDlaVQ1ps/HzfKyvnOgH68mvqUgV6Ip uUcpH5EcdPW00vDuXyaEGbUULkaU15wpwFfy9Lm7NuETRpn5aLU9X2DtLvwvvsXPdD ijL0pASKioLIYIxxhT9mSsjw9OdIz7+dy0NQPHws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Lew , Srinivas Kandagatla , Bjorn Andersson Subject: [PATCH 4.14 25/36] rpmsg: glink: Free pending deferred work on remove Date: Thu, 19 Dec 2019 19:34:42 +0100 Message-Id: <20191219182917.324506203@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219182848.708141124@linuxfoundation.org> References: <20191219182848.708141124@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson commit 278bcb7300f61785dba63840bd2a8cf79f14554c upstream. By just cancelling the deferred rx worker during GLINK instance teardown any pending deferred commands are leaked, so free them. Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver") Cc: stable@vger.kernel.org Acked-by: Chris Lew Tested-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson Signed-off-by: Greg Kroah-Hartman --- drivers/rpmsg/qcom_glink_native.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1539,6 +1539,18 @@ static void qcom_glink_work(struct work_ } } +static void qcom_glink_cancel_rx_work(struct qcom_glink *glink) +{ + struct glink_defer_cmd *dcmd; + struct glink_defer_cmd *tmp; + + /* cancel any pending deferred rx_work */ + cancel_work_sync(&glink->rx_work); + + list_for_each_entry_safe(dcmd, tmp, &glink->rx_queue, node) + kfree(dcmd); +} + struct qcom_glink *qcom_glink_native_probe(struct device *dev, unsigned long features, struct qcom_glink_pipe *rx, @@ -1611,7 +1623,7 @@ void qcom_glink_native_remove(struct qco int ret; disable_irq(glink->irq); - cancel_work_sync(&glink->rx_work); + qcom_glink_cancel_rx_work(glink); ret = device_for_each_child(glink->dev, NULL, qcom_glink_remove_device); if (ret)