Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4003907pxb; Tue, 26 Jan 2021 09:51:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsdzjS8eBWCFW5td9hFD3saGJyburU81AC16+mnycrrltQpB/tTnc3BANe/kUZDXqrlMzz X-Received: by 2002:aa7:c643:: with SMTP id z3mr5829313edr.330.1611683515188; Tue, 26 Jan 2021 09:51:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611683515; cv=none; d=google.com; s=arc-20160816; b=cgbbqvYFPTQ7d7oAWehkDRKU75qNlNXxf84t4rlCXaz29E9Hy2+VsuaBH6UNrHBQ8V zRJukaA61SOeVPlGNVObOsU7h5JjjYy7CvuK8ozjID7CRGS3pTkUTJM0g2q+nVrZTXnF EBtiHYRumyGmt+kk6pvfRwzXAPGGz86UqVaZ2NOETFiS9zJ8YVnTAdrfjpa5NtYwlecE kbDIy5fZRk1zcW3P4//OPaIgflQBNsVsO3vXI99FTtJdNk7wsiacswhxM0sSKjHnyvwO mwNMiyZiftNc3whDien7kIha91v34skeSr/oZ/abVPx180YWSPcdFoe80rGYdqKkk4cu 8kUg== 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=awMgaLgeMRwIV6EZEVadugGaYQp134h4sp8HQXwgjBE=; b=qR2JGRxdtrNxZV7vYn5mFkQm8VLzsxdeb+L1CuwFIrpKZVihqeRXpVfbuOSJTCvWcX xUrPR0kXSvci9caDD1EvA8xF/vUs2q51WaOnWt9/YWIQz6qpgSXnsUNXy4PAEIVXovyZ L3QyXgt0HypdxfJiBMDRmXLe1QijTcB3rEesS0AI4jxhpcldyDfJM8JOF3+XaDtkhG/3 qlM/6hWhWrC2Zr1VgM7t0/u2Y1UAtx27kEtc+V4dIayjUYOBeaDexwwCYP20330hvQXR L0yBxjonEzQiPp7/FRnSYrvSvVVBPQHauE36zmK7s5EvK2XGbEu9gf7/95v5JCruazXQ 0cCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BINDH/bZ"; 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; 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 z20si8955793edb.95.2021.01.26.09.51.29; Tue, 26 Jan 2021 09:51:55 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BINDH/bZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390189AbhAZIda (ORCPT + 99 others); Tue, 26 Jan 2021 03:33:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:58164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728362AbhAYSnU (ORCPT ); Mon, 25 Jan 2021 13:43:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 456AC2075B; Mon, 25 Jan 2021 18:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1611600142; bh=oHxPXzKK3nFpYPADnIChqOUV0ts/0McSoAhq9TiRnyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BINDH/bZVotbGKwJACRp9UkFPl1Q5O51zcZ633Pt9od9odQQaMUPQNM3gCppGOjAx GJ/u1Nt3NBs32IQvtLW1Wxa6Q7MXieL/1UbtPX+T1HrpjnOTlIEhN+kWZEMmWk3XXs GltLPy2Vn/9nycaJYmWkWrt01QQWCeE9KrRnoULY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Sergei Shtylyov , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Jakub Kicinski Subject: [PATCH 4.19 47/58] sh_eth: Fix power down vs. is_opened flag ordering Date: Mon, 25 Jan 2021 19:39:48 +0100 Message-Id: <20210125183158.735125528@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125183156.702907356@linuxfoundation.org> References: <20210125183156.702907356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven commit f6a2e94b3f9d89cb40771ff746b16b5687650cbb upstream. 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 Reviewed-by: Sergei Shtylyov Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20210118150812.796791-1-geert+renesas@glider.be Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2620,10 +2620,10 @@ static int sh_eth_close(struct net_devic /* 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; }