Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2480962pxb; Mon, 18 Jan 2021 20:40:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrTtKkG3v1l6i+d1coVcuyghVW2JkOIm+3XfSXnDAfaJo3m61nVncqBwnwN/vFrHJRl27/ X-Received: by 2002:a17:906:194b:: with SMTP id b11mr1835328eje.541.1611031208580; Mon, 18 Jan 2021 20:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611031208; cv=none; d=google.com; s=arc-20160816; b=IjYkTTkNAKeVz/HyEpkKCxyl5EdtzqgRWQXxqiwozertCZ5we1QMoUq1MsyCGxHhta WQqytRsLQpRuj3RRPBj2r59qTkWgeXp9lWbJpVYhaGItPzZMRvjnsJq7I0DRIU3+20PI EYogbE3h2JpJtGPd0KBTteC8DqHLkwfpA3e8cVRXFmKXWZPJEjKemG8p53ujOZduhEP7 nvLqwAgUr6KpACIiq/wFyRWNLwj46Y2Jbhg1iosqzt4FIISvIlpp6dJYDDZsl5rbN3AJ x/h3dyUF8ZY2ILwdx/RjyguAsOuSB37J/aCh7/pajUdadZ3XpJDZ21RIpQPUQJDRz5FS MOXQ== 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 :message-id:date:subject:cc:to:from; bh=1WwWgTmIIaCVW3gskJjqcONZ7GlN6I1aV1wxHNBfYr4=; b=FBn1gFieopHY7Jw+PRUptVJHxaPanNPn+nCOuYOPDU3iTfXajCdVPmcJxmPLU1urws gGx9lNopHwl3r1yynvdVe/uU30qhV/0xyK2XRdjgzjYdthwrQQZVLS8eEFEpIW0q8KdC juw4hxfXVyAyndFonkmNeuNgYvYB7UFnyULGuBZ7fCvIHUEPYw/W3RMhleC4aP9hco6I pWBX/WIit6iOjEtfwyE8xSSl4B3gPknT/TjB93RlcJVHpGBZjxc4BvQLthp01qO7VwLW c5LRB44MRklENHThqJjaPE2otW1YBwuV93TPedf5KeJrBnRMDXl8x/3qWt51c7qKQg7O 3cFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj13si4569813ejb.41.2021.01.18.20.39.45; Mon, 18 Jan 2021 20:40:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405541AbhARPRy (ORCPT + 99 others); Mon, 18 Jan 2021 10:17:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405391AbhARPI5 (ORCPT ); Mon, 18 Jan 2021 10:08:57 -0500 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43EE3C061757 for ; Mon, 18 Jan 2021 07:08:17 -0800 (PST) Received: from ramsan.of.borg ([84.195.186.194]) by michel.telenet-ops.be with bizsmtp id JF8E2400b4C55Sk06F8Es0; Mon, 18 Jan 2021 16:08:15 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1l1W8c-004cqS-8S; Mon, 18 Jan 2021 16:08:14 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1l1W8b-003LIE-FR; Mon, 18 Jan 2021 16:08:13 +0100 From: Geert Uytterhoeven To: Sergei Shtylyov , "David S . Miller" , Jakub Kicinski , Simon Horman Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] sh_eth: Fix power down vs. is_opened flag ordering Date: Mon, 18 Jan 2021 16:08:12 +0100 Message-Id: <20210118150812.796791-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sh_eth_close() does a synchronous power down of the device before marking it closed. Revert the order, to make sure the device is never marked opened while suspended. While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as there is no reason to do a synchronous power down. Fixes: 7fa2955ff70ce453 ("sh_eth: Fix sleeping function called from invalid context") Signed-off-by: Geert Uytterhoeven --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 9b52d350e21a9f2b..590b088bc4c7f3e2 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2606,10 +2606,10 @@ static int sh_eth_close(struct net_device *ndev) /* Free all the skbuffs in the Rx queue and the DMA buffer. */ sh_eth_ring_free(ndev); - pm_runtime_put_sync(&mdp->pdev->dev); - mdp->is_opened = 0; + pm_runtime_put(&mdp->pdev->dev); + return 0; } -- 2.25.1