From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0AD1BC77B6E for ; Thu, 13 Apr 2023 17:42:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/YT3/aymJfn4/efbTKWHmKNK4xMfcsAc/SmGVJd5elk=; b=CpoRCUeU+695Jk TYn3cp+t3j7AYq0oka6/0m7t0mXlWgGIENV72PnF04dDP3Ms+joLbIB5imJECOVFYQuDzXXbKKZz1 swHvKE8+ZTNFRJUuT+SNFBscRlxBarjPzQKwMGQDe4D7qHo90Hd3QoVXRWAtK8dLAoZgi6UVhmAA/ xnhSixMRtGYC17IqUqXNtqQ8uHGuZElkvPR2BRh3ddOc0NEAwI7LTAMWNU75NXNIZwPGIJxkp5KYv 99kkAKZ8pJAQQry8AYN/q7rjmwlrKMRtjsao0SVr0trk2kD2WWgEDmzDNfQa1+M74Up9Fkl5Z9Kln UbcuZ5v9vwGsNff8Hdew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pn0x6-006qLZ-0w; Thu, 13 Apr 2023 17:41:44 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pn0x2-006qKE-2V for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 17:41:42 +0000 Received: by mail-ej1-x629.google.com with SMTP id xd13so5456938ejb.4 for ; Thu, 13 Apr 2023 10:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681407692; x=1683999692; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eIiirAaDA9eFVxHe7848A9thDVoy/Iisyo0XYKsmV0o=; b=HgLQzS6hpyE1ox3/UQZbfYrUg+fXCMocSiDRxSrIGBjrPBzPqXOJUbiMV8NCUVxh/B 1ymadqD5jQ6I+DzdMmfxZ/1JSADwiCoWjOLc9jTx86dHwt7ABINegcDwoHOxFAzepYUx nt+Erld+cUwRDlzVbA1hjCpP/78cRv00dJ9th0mrTJOSsERaGQIejvqWPW+5iWjaCMdv Mkbew89xglCbWfDmOcgGVZzCUwVeFEA1mN0JQweGzgjZp0xe7TtWRm5ByRJbFKznJ289 b13iy7mAKHNwbh8MdouO8Bk7Umt9DbFZF/B3gCjQOwhE5dJkMvpoWU51k4cWmX8Sv0vH loHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681407692; x=1683999692; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eIiirAaDA9eFVxHe7848A9thDVoy/Iisyo0XYKsmV0o=; b=krSXPJWoBnFVdLSWDahJqQIxyOPfU7plhVb86yqGzIBxvJF5kWYDcv0AMhGIVBEilm fmiMqKG85HIEtb5MuJ+zT+3ucJl0SO565WTaoDno0uWDezj2KFsndwvQ4cSbVI3+JUcT L/NNwsq0Dp6SWLs3+movJ0M59ycQYQn3i9I2tp+HjFsr660CcwZJTBsRswWEVRccwneO JNKqSZbEeyfNjTqgWQxzbZDD9wqwgAtQB0ysyMjOWyVMNuNWqV0PQNzaqg2wW7va5/N6 MkjvV0A20nqRQMTXPYZdNxysUxa/VybijhkDVo1+nvq3se+/cqQjGD4qzkap4j8lSUAo F9EA== X-Gm-Message-State: AAQBX9e8PNZ3CvtQ16SCFORq9Nc16//KTO91FO7Fw4yNDNGjOK6eArI8 Cf1DKT9x0IDk0Ek5j4sr/v8= X-Google-Smtp-Source: AKy350ZE2BCCFRavI9mkoSpNE4Y8ZHG9SeqJOo39sTOdjgfl+1wMePHFAuxOqUolWX+bSNK8+peFVA== X-Received: by 2002:a17:906:cf9c:b0:932:f88c:c2ff with SMTP id um28-20020a170906cf9c00b00932f88cc2ffmr6641850ejb.34.1681407692066; Thu, 13 Apr 2023 10:41:32 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id mf12-20020a170906cb8c00b00947a40ded80sm1253991ejb.104.2023.04.13.10.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 10:41:31 -0700 (PDT) Date: Thu, 13 Apr 2023 20:41:29 +0300 From: Vladimir Oltean To: Florian Fainelli Cc: Jacob Keller , Yan Wang , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, mcoquelin.stm32@gmail.com, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "open list:STMMAC ETHERNET DRIVER" , "moderated list:ARM/STM32 ARCHITECTURE" , "moderated list:ARM/STM32 ARCHITECTURE" , open list Subject: Re: [PATCH net-next v4] net: stmmac:fix system hang when setting up tag_8021q VLAN for DSA ports Message-ID: <20230413174129.dafmlq57a3pc2ppn@skbuf> References: <01ef9d4f-d2dc-d584-4733-798cffda49a1@intel.com> <298c045a-5438-6761-46d8-c46c57989812@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <298c045a-5438-6761-46d8-c46c57989812@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_104140_817693_2E916F27 X-CRM114-Status: GOOD ( 21.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 13, 2023 at 10:15:55AM -0700, Florian Fainelli wrote: > On 4/13/23 10:07, Jacob Keller wrote: > > On 4/13/2023 8:06 AM, 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. > > > > > > Signed-off-by: Yan Wang > > > > This looks identical to the net fix you posted at [1]. I don't think we > > need both? > > > > [1]: > > https://lore.kernel.org/netdev/KL1PR01MB5448020DE191340AE64530B0E6989@KL1PR01MB5448.apcprd01.prod.exchangelabs.com/ > > Unfortunately both still lack a proper Fixes: tag, and this is bug fix. > -- > Florian > I guess that would be: Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver") although in this case, that would be only part of the story. That commit split the runtime PM handling between stmmac_vlan_rx_add_vid() and stmmac_vlan_rx_kill_vid() in a strange way, where an added VLAN RX filter takes a refcount on the device, and a deleted filter one drops the refcount. That is... strange?! but it worked in a way, I guess. Then commit b3dcb3127786 ("net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid()") came a few months later and blamed that oddity on a bad merge conflict resolution... ?! Basically, from what I can tell, it's this later commit the one that broke things, for using runtime PM only for stmmac_vlan_rx_kill_vid() but not for stmmac_vlan_rx_add_vid(). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel