From patchwork Mon Nov 23 12:19:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 330659 Delivered-To: patch@linaro.org Received: by 2002:a92:ae0b:0:0:0:0:0 with SMTP id s11csp1964870ilh; Mon, 23 Nov 2020 04:44:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcMiHG62G3Yi+IuUFa3DBHJrFBar5YAj8rHI4uEcS4oyA5MkJ4MmoN72xYBGWhgwiwkvqe X-Received: by 2002:aa7:cc8f:: with SMTP id p15mr49157069edt.240.1606135494757; Mon, 23 Nov 2020 04:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135494; cv=none; d=google.com; s=arc-20160816; b=krE/lHcU3DrUG1g+vSszs4KtGjPmyDnjkRfHJ1p4kf8dsUdE3g/0CBBm4j1l/ZhojG 62Vt7PX9nDyttZ307nusrk7hfG9yvTjqqI3Tzw5mns59SKPzYxhpOt35ACYtd5hqnGiS TYOpkt7QPkAuPwRD7CQbirySm8c/LU3L1/jJrdXpEgx1rncMAxen7+3AyTNbtWoFBl8I jAAZ0yGfdRvKjg83pcQTAkmA4rMfXF4E7ZG/AESWk0kMtKh8bGc/g7i/B1mBBgzH8zqT 5KGgynD9tpZI9Wkl3eMxrGCl2mcUSTVHjIef8Emdz9KSTvg/q8DVjkIEx2Zyxwi47qKD zkAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DldQBGYxb3pk6oLCwSKtTsgzr+iclsOG0iimjpd0p58=; b=BQtQcu5AiPI33kmuN5wJzAuMP0vZHyxfZ+VscXwmmpu7oNfG82FLc6jTm0hfDn0mmO NB5Sa+ZenG8iqjUrSnQEy0wNEB0yDMz6T6Rl8VlmEbH7nCsW9Vz2EJzjdXr0f71djwMB ISUduDkNxWuIL5epXQbY9ceI0GyluPtpac+7Slf43BwkdMHpZsJLLSANQCbtby436p4u zZNgNdqKXavmid+hLethPzS7lHZy1s7W+er+3fU3aVgyofFcTufrra8TdPgz3x0uOXIh /2sIDSghtdfleGp3PQFLVlMipxHG1wf6dtQ/FtaJCaqqMq52G/2k3nsroytFgik82cwS +qbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xf0LmW49; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si6338215ejc.256.2020.11.23.04.44.54; Mon, 23 Nov 2020 04:44:54 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xf0LmW49; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733016AbgKWMnH (ORCPT + 14 others); Mon, 23 Nov 2020 07:43:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:56262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733010AbgKWMnG (ORCPT ); Mon, 23 Nov 2020 07:43:06 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 49D8C208FE; Mon, 23 Nov 2020 12:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135385; bh=0Afm/hazu4H8kER2bdocDreFZSyhKFRbDTBuhtrpynE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xf0LmW49PqL70ZAnPuqZKl4WtpM9+zoVmxzie8Y2VvtQnD9J5B4GNkm/SnDS2MUK9 qiv1SMdx2E6QiI8Ylw8Dz4WNX/1CBCzaWCxpGRaO/sfJ0ju5cuhn80Q6MibUpQ0k1R dhiPEPVqOopjGOPhfHu2sAfa72pkYIlzASS3193g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Lindgren , Grygorii Strashko , Jakub Kicinski Subject: [PATCH 5.9 019/252] net: ethernet: ti: cpsw: fix cpts irq after suspend Date: Mon, 23 Nov 2020 13:19:29 +0100 Message-Id: <20201123121836.521892556@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121835.580259631@linuxfoundation.org> References: <20201123121835.580259631@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Grygorii Strashko [ Upstream commit 2b5668733050fca85f0ab458c5b91732f9496a38 ] Depending on the SoC/platform the CPSW can completely lose context after a suspend/resume cycle, including CPSW wrapper (WR) which will cause reset of WR_C0_MISC_EN register, so CPTS IRQ will became disabled. Fix it by moving CPTS IRQ enabling in cpsw_ndo_open() where CPTS is actually started. Fixes: 84ea9c0a95d7 ("net: ethernet: ti: cpsw: enable cpts irq") Reported-by: Tony Lindgren Signed-off-by: Grygorii Strashko Tested-by: Tony Lindgren Link: https://lore.kernel.org/r/20201112111546.20343-1-grygorii.strashko@ti.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ti/cpsw.c | 10 ++++++---- drivers/net/ethernet/ti/cpsw_new.c | 9 ++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -838,9 +838,12 @@ static int cpsw_ndo_open(struct net_devi if (ret < 0) goto err_cleanup; - if (cpts_register(cpsw->cpts)) - dev_err(priv->dev, "error registering cpts device\n"); - + if (cpsw->cpts) { + if (cpts_register(cpsw->cpts)) + dev_err(priv->dev, "error registering cpts device\n"); + else + writel(0x10, &cpsw->wr_regs->misc_en); + } } cpsw_restore(priv); @@ -1722,7 +1725,6 @@ static int cpsw_probe(struct platform_de /* Enable misc CPTS evnt_pend IRQ */ cpts_set_irqpoll(cpsw->cpts, false); - writel(0x10, &cpsw->wr_regs->misc_en); skip_cpts: cpsw_notice(priv, probe, --- a/drivers/net/ethernet/ti/cpsw_new.c +++ b/drivers/net/ethernet/ti/cpsw_new.c @@ -873,8 +873,12 @@ static int cpsw_ndo_open(struct net_devi if (ret < 0) goto err_cleanup; - if (cpts_register(cpsw->cpts)) - dev_err(priv->dev, "error registering cpts device\n"); + if (cpsw->cpts) { + if (cpts_register(cpsw->cpts)) + dev_err(priv->dev, "error registering cpts device\n"); + else + writel(0x10, &cpsw->wr_regs->misc_en); + } napi_enable(&cpsw->napi_rx); napi_enable(&cpsw->napi_tx); @@ -2009,7 +2013,6 @@ static int cpsw_probe(struct platform_de /* Enable misc CPTS evnt_pend IRQ */ cpts_set_irqpoll(cpsw->cpts, false); - writel(0x10, &cpsw->wr_regs->misc_en); skip_cpts: ret = cpsw_register_notifiers(cpsw);