Message ID | 20230919164535.128125-2-ben.wolsieffer@hefring.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3787289vqi; Tue, 19 Sep 2023 17:57:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzlIMjV+e4Td+xXrMc4RY0tmYM0cKMWizj/Rq2ZflXeLUDRa/I6R1PB0UA4CuIuH8igsHW X-Received: by 2002:a05:6a00:c91:b0:68e:4834:4b25 with SMTP id a17-20020a056a000c9100b0068e48344b25mr1317708pfv.13.1695171449974; Tue, 19 Sep 2023 17:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695171449; cv=none; d=google.com; s=arc-20160816; b=C28UqXRLPJYrtEgzScfqzRF8l/omnQDFNBepAWPIY9iGRmOl0e7FiSMl0pPslX48dk YcJ912HiC3NGyV8uuiwHzmPfLwVDqyVTxTkCYMuXLJXjTLBkLTo7LQcGB6cC3eyjuLav hpUoc904E/L3gw4NJQbAUdYH/sg/VkjidxCwLfpBirrrTkPKpJsYcQUP9ygD+AUXdBJW NhBKZaXOPRNIc0RGUTpEgUGK1/sZH6KkZGjgPb9UafPv0CuOiIAzbiuVQAuxzHXl7VIQ Vhuld6NqrbkoMkK06cAxs3LCZ2rmwFaaiVbxXYHM58XnboAAz6DeUbo5d9ZriYGlmn4b KBYg== 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:dkim-signature; bh=Eyh1KouBtG7Iy09LS9HXsGpQo6L9jAzzmaZyqdFSGZk=; fh=f9safSkw/SQVr0kEtPvUiqQf5kZ6gbwV4tr+WhykmK8=; b=jiNiQcvUFyY48bt1PSsrFzS0L+Ah9VULwe863HZ8HnLKvHnfL5A1VmDtG02gM8dLp9 y/XK/rS9HRVam0GZwAP5ctgiGAwgiIky1UR6nTxZXUPkR1hLQOxCg5oHMnqZJiIQIA0l Asg3BtJBIbJkvE2bNLEgGGZaZEMpdIw5K0lNLAwqEM5GcOrcWsYUg0tKIhJcaBiUeYWd x2WHn6WSyMK+wDmMHBqgBGIY6XEijhcohbvVX9p1aI5buKs+/PNq/9XoG78UtyzkqprX umGWGfcWZk491IM9PLAKKKuSoRcvJ7Hk8W5viytqelD6AMiHULvV9LvIdAZPpuVdSHov ShbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hefring-com.20230601.gappssmtp.com header.s=20230601 header.b=wQENy8GF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 22-20020a631756000000b00573fc1f288csi1773440pgx.569.2023.09.19.17.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@hefring-com.20230601.gappssmtp.com header.s=20230601 header.b=wQENy8GF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E4E1480D8FFD; Tue, 19 Sep 2023 12:20:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232606AbjISTUI (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Tue, 19 Sep 2023 15:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232400AbjISTUH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 19 Sep 2023 15:20:07 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AE83B3 for <linux-kernel@vger.kernel.org>; Tue, 19 Sep 2023 12:20:01 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-76ee895a3cbso394913585a.0 for <linux-kernel@vger.kernel.org>; Tue, 19 Sep 2023 12:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hefring-com.20230601.gappssmtp.com; s=20230601; t=1695151200; x=1695756000; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Eyh1KouBtG7Iy09LS9HXsGpQo6L9jAzzmaZyqdFSGZk=; b=wQENy8GFdhsQiOt1ngnbQNxDbaIvyzEL3MhCXzSgkxo8VSm8JBj0XvGQgZ6EeLg2JM pAkeAhs8lmfnrLsVHWU4hZ2scje9lZqNPE2AJQGrg4EKW6Ejb2pDBMLiVnNchmi+liZT fcki+wUn7UgMXKfyorjFedsRdkb2q9jLdD70fB9mi2LmmivvirXcWaqgdNvVOFA1O/jJ TrTYe4kcbHl39qG0IxKX7imiKZmmRhdzKN/NygsEkoOCgmFR40adnYgKlILoRuty0LOj x0rt5G5TCj8l75QR0DTMBkCmFsku6emjqF8RQanOckUYGith1YA1KNO6TIaUWemmR9PT wWVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695151200; x=1695756000; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Eyh1KouBtG7Iy09LS9HXsGpQo6L9jAzzmaZyqdFSGZk=; b=vRNHy8UQaOozXeotBiyJIr49kWgfmwtkVvV/Zy/NkFIt4e+IZWk1WTsWRT7osweqbs hWzn0xHUpXsNGx+j1H04bUSXEwukqcSh1KLTObN8lX4JOJ7eS4/+WWORT1SKw75ZvKeM 90XZ4PELWb1e8NjLjhXAD5Kt/69Ym7L2fRyhNvCWYL6EJxFQ6HR+scAfeznDdrdBvja8 gqBni4K0Hwt0rZIHCrjtB1q/EhWYX2NCawgFigh7O1Mdo5BJRxse1nY+Yk9rPf2F5cZ5 QQkjbNitlShPxakH3T9HL19KhSC+0FPuAG0aiX3bD7F7eFXf5c5etk1IEfWOqwCreYZY 8pkg== X-Gm-Message-State: AOJu0YwsJcu2Dd5bZrGZdImWA+1shlDnxGtfR1rsXEOcmYbsku8GU+xi vegyFeucCY0TIXWNRjHZAL6oyg== X-Received: by 2002:a05:620a:ec7:b0:76e:fea0:3f40 with SMTP id x7-20020a05620a0ec700b0076efea03f40mr562362qkm.8.1695151200597; Tue, 19 Sep 2023 12:20:00 -0700 (PDT) Received: from dell-precision-5540.lan ([2601:18c:8002:3d40:df77:9915:c17e:79]) by smtp.gmail.com with ESMTPSA id x12-20020ae9f80c000000b0076c60b95b87sm4179704qkh.96.2023.09.19.12.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 12:20:00 -0700 (PDT) From: Ben Wolsieffer <ben.wolsieffer@hefring.com> To: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>, Jose Abreu <joabreu@synopsys.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Christophe Roullier <christophe.roullier@st.com>, Ben Wolsieffer <ben.wolsieffer@hefring.com> Subject: [PATCH 0/2] net: stmmac: dwmac-stm32: fix resume on STM32 MCU Date: Tue, 19 Sep 2023 12:45:34 -0400 Message-ID: <20230919164535.128125-2-ben.wolsieffer@hefring.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 12:20:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777515673222998608 X-GMAIL-MSGID: 1777516098697433725 |
Series |
net: stmmac: dwmac-stm32: fix resume on STM32 MCU
|
|
Message
Ben Wolsieffer
Sept. 19, 2023, 4:45 p.m. UTC
On STM32 MCUs, Ethernet fails to come up after resume and the following errors appear in dmesg: [ 17.451148] stm32-dwmac 40028000.ethernet: Failed to reset the dma [ 17.451266] stm32-dwmac 40028000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed This occurs because clk_rx is never re-enabled during resume. On the STM32MP1, clk_rx is left running during suspend, and therefore doesn't need to be enabled during resume, but this code was mistakenly applied to the STM32 MCUs as well. The first patch in this series applies a minimal fix for the bug, while the second refactors the clock configuration to make it easier to spot such bugs in the future. I have tested that this series allows Ethernet to come back up correctly after resuming from s2idle on an STM32F746. I don't have STM32MP1 hardware to test. Ben Wolsieffer (2): net: stmmac: dwmac-stm32: fix resume on STM32 MCU net: stmmac: dwmac-stm32: refactor clock config .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 116 ++++++++---------- 1 file changed, 48 insertions(+), 68 deletions(-)