Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp53927rwe; Thu, 13 Apr 2023 22:05:35 -0700 (PDT) X-Google-Smtp-Source: AKy350ZFRJMV7oU/dL8zKU2aO1Q1Sd56Co2hkz1Vii0PnAX5zNee8HNrb+OcEdDYEm/QItzAP0SK X-Received: by 2002:a05:6a20:b38a:b0:eb:876f:6078 with SMTP id eg10-20020a056a20b38a00b000eb876f6078mr4991740pzb.25.1681448735445; Thu, 13 Apr 2023 22:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681448735; cv=none; d=google.com; s=arc-20160816; b=yqznzOmo83J3VmIIMnQVzHGFFMEPgqUIitmVB/kbiX+NWfXFA7mgW4KWu96FlOheqb gs4pWydhwP4n6Gpckd6xZx6B2Io5K5zd1BlPShnl9kjAWBFeNceY0G+BvcxR+/G4ft3W DlVGqnACJC1MFZMuSmN6l2QE53sfCAer0+1WXIaz1LmPcfccfNSdmxXUvxnJ3m1I/W9y THuTba4aZJBlkDujKn7c2sueEjjjL5umB16pe8zXaRmA3ykCU6cAtpGruPuM4DNYZ/Ql RDuwRSBrzAHHA6VL9RVRB0UetReZobXRXRG5U5DJ7D2YqKXUOm5ORm4OSNQSgzC/0Mxp Z8xw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=pZ/sqUN6AGYKSVbmu6fZh+k89xiwchh/JMHibg8iWUM=; b=bvkO+TftyJXWyqLh9SOd+YxbGMmgFVu4I3bXVKtjjyZHri9tBgquLeDWWsuD7XYUCF kEGWsY7HL3bJfI03dIGOisW+vXlNgoEdxrr1d+4TFjltIrKc8JNMY41cTOygKUo6/0C8 2RPc+mAugHvYq5KjPgcBGLrZ8NVlc3yWAGzezcRGX9PY1eD7G2tWTkGF+QINoverz+bW eGtLayNUBrzMKRt+B1MIKvJSoWfSJL2oAFRqcdbIFcWQcCOv1kU7NS5PihELCgD1avo8 b8fQAHMKb0YSB2oKWrQDUhN8VdojabbXvxP8qC10PlcKQXJ8DD9B8mDVd2wjXoL8VdSP uSnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OtxFy53i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q38-20020a635c26000000b00513cc8d1736si3681981pgb.746.2023.04.13.22.05.22; Thu, 13 Apr 2023 22:05:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OtxFy53i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbjDNFAv (ORCPT + 99 others); Fri, 14 Apr 2023 01:00:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjDNFAu (ORCPT ); Fri, 14 Apr 2023 01:00:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A5DA10EC; Thu, 13 Apr 2023 22:00:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA0306439C; Fri, 14 Apr 2023 05:00:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2B95C433D2; Fri, 14 Apr 2023 05:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681448448; bh=CXO10PjY2/zG6b2bRTZgyHaMtJBiQFKnOvBLnoXwp3E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OtxFy53iprI5S3FaCLu1j1YLT0nHaMG8mq5nDd6a6av6Sq5yXeJBsgN9vYA7zZuaS yz6zr5CmXoNY59Km5LDmkHHECjVlUacCK6Dgj3qa6JRFVdxfxE5VxO2wXTa2DeNlH7 Kwwb9OQbNnLbyZCZWmLKQWtxGT9dpnk7C6zJRIFDvNPjsz1jLBj8bnOSyU2oHprzWj eCNTwFxRbqkUoT+zuIiCKFvBwbeOXI5p8cmM5ZR5jMD3rzKM7FCcw36Em1r2/uGoMX gGkEpypLzQaO0I4uAcgiNtuT7dqAKj1TxFOoJSMH6TZvIqwpXqTIm3a/vXCe3sUH5X ANM9oT9ucXZQA== Date: Thu, 13 Apr 2023 22:00:46 -0700 From: Jakub Kicinski To: Yan Wang Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, mcoquelin.stm32@gmail.com, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Joakim Zhang , netdev@vger.kernel.org (open list:STMMAC ETHERNET DRIVER), linux-stm32@st-md-mailman.stormreply.com (moderated list:ARM/STM32 ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/STM32 ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH net-next v3] net: stmmac:fix system hang when setting up tag_8021q VLAN for DSA ports Message-ID: <20230413220046.267fdc31@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Apr 2023 11:07:10 +0800 Yan Wang wrote: > The system hang because of dsa_tag_8021q_port_setup()-> > stmmac_vlan_rx_add_vid(). > > I found in stmmac_drv_probe() that cailing pm_runtime_put() > disabled the clock. > > First, when the kernel is compiled with CONFIG_PM=y,The stmmac's > resume/suspend is active. > > Secondly,stmmac as DSA master,the dsa_tag_8021q_port_setup() function > will callback stmmac_vlan_rx_add_vid when DSA dirver starts. However, > The system is hanged for the stmmac_vlan_rx_add_vid() accesses its > registers after stmmac's clock is closed. > > I would suggest adding the pm_runtime_resume_and_get() to the > stmmac_vlan_rx_add_vid().This guarantees that resuming clock output > while in use. > > Fixes: b3dcb3127786 ("net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()") > Signed-off-by: Yan Wang Happy to see you managed to work around the email server problems! Please make sure to read this doc before posting the next version: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html