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 X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 906C9C433F5 for ; Mon, 13 Sep 2021 10:32:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 719D360FBF for ; Mon, 13 Sep 2021 10:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239097AbhIMKdu (ORCPT ); Mon, 13 Sep 2021 06:33:50 -0400 Received: from mout.gmx.net ([212.227.17.21]:42875 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238846AbhIMKdr (ORCPT ); Mon, 13 Sep 2021 06:33:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1631529134; bh=wo/zYNHbmwqWHPTYaD4fECkvZkCdNhbPCdSJYZnhq6o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=XpChBSD8F91ysTehBQS9ZVLVLeuttaE6lxQw5AZ6qcN9tI1ADR1TugDgtH9FO6f5f tNF160UTMI7xOBPklUVo3gqQk2HC24f0ZeHypSm8AfZfyU2b1PrOin2H7PcGNIUWSi 6qDqlbU0mh2aq1CqHn1Xxfh9MIlPWzLBA8Vu9WCQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [46.223.119.124] ([46.223.119.124]) by web-mail.gmx.net (3c-app-gmx-bs55.server.lan [172.19.170.139]) (via HTTP); Mon, 13 Sep 2021 12:32:14 +0200 MIME-Version: 1.0 Message-ID: From: Lino Sanfilippo To: Vladimir Oltean Cc: Andrew Lunn , Florian Fainelli , Saravana Kannan , "Rafael J. Wysocki" , p.rosenberger@kunbus.com, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, vivien.didelot@gmail.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Aw: Re: [PATCH 0/3] Fix for KSZ DSA switch shutdown Content-Type: text/plain; charset=UTF-8 Date: Mon, 13 Sep 2021 12:32:14 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <20210912202913.mu3o5u2l64j7mpwe@skbuf> References: <20210909154734.ujfnzu6omcjuch2a@skbuf> <8498b0ce-99bb-aef9-05e1-d359f1cad6cf@gmx.de> <2b316d9f-1249-9008-2901-4ab3128eed81@gmail.com> <5b899bb3-ed37-19ae-8856-3dabce534cc6@gmx.de> <20210909225457.figd5e5o3yw76mcs@skbuf> <35466c02-16da-0305-6d53-1c3bbf326418@gmail.com> <20210910145852.4te2zjkchnajb3qw@skbuf> <53f2509f-b648-b33d-1542-17a2c9d69966@gmx.de> <20210912202913.mu3o5u2l64j7mpwe@skbuf> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:9oyu16jnUSyREoZM3DFHQ81KHcXAKv+ezBse+F+2s8njgqcNEidH7YPK94rsaGpBqTc4M eHWPiVCZt2WWQqAz7bO59hMV3OFQWuhiqce5awapeJNnT0KN807f68c3UuI8xKWY4u55/Yf+lkAW OiXy/vnDE3dLFMk36MB8ZFLXfSaMADXCemI130mH0RW7S6hzDSYQl8o9O8l7orCp59BfKs7cp2in 0poA/W3psH/+EOR+s+Xy/zB7CIabsipG+gVBStVlaC8RZ+03nP25yZFdm56gpfuOajynPw9KsORz ew= X-UI-Out-Filterresults: notjunk:1;V03:K0:qZAHdwE3Gvk=:zHS5T2l3cjgNEzayb01Ueu kRo65Suo8OYlAyylZ3xyVbPBJx/KFplBZuyOR3Qoxpx/GnYY4d8OT2Xf6C/U2yu1iguL8nKAc jYFhBzQoflC7bvnpkWpNMf2xn20FPzoW+jo8Pl0MvdiH2c421OZVfyejX29Qi+PVRVMBc1dqx L0S9LP2gZFBooatvelmO1z+2fQgtJFlFnKeKGL24hYpyTr/ILSWu1XMcU6V8bK18ON+kX2fAN PY/HbvPUB1Cgyy4iYNn41AdG//K6cjQNORfVtBcviSxkwV5hWmEEnH9grsBExg377CiNEhw5/ PSS637nUP5R/2AVuZZ3r4TLZRJVnvuzzpEULwqDRFJmBK0hZbvTIi/f6AAP+bjjPcq4A8pXkg tzgb2E2FVh2CN2J8QFVDR2xMKdKKhhHka/wSBt5rwfQR+auZaYC5cYKCV2h9JW+DW+Qtw7AJH oR8xk3HMJThCJvc2LkfnYj9XSBI7gMZCBWDf0HeAwDwCYz6vYMy9awlnB6SY+te8hfqkkHjoK s11XFbBP21xWhjg/s88b5UVFZo/P5sksmlBXVwXUoZKzGsgqAWjZNzoNhgqGldBPRcjQlt4h7 LLDo3Xz5sm0Dj6j/Cq+nvQ7uy1slEyct33jc+6Ob4jynwnOGHsgnXBGToJtU30SKb1Kmo56l9 3KeAPMlPjB1bOZOOeuCQL4S4eDUycOUNY7S5Y6bODnJIz9InzWk5zu/gTFJToecDSX3T4iVmU 0uInVsHjoCiaGXUgrtCa2WB51OkLz3PGZLj9x6cYxj3yYhsaQ25fNe3ncEIMQwjfgIe/RniHr YsVMo2Z Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > Gesendet: Sonntag, 12. September 2021 um 22:29 Uhr > Von: "Vladimir Oltean" > An: "Lino Sanfilippo" > Cc: "Andrew Lunn" , "Florian Fainelli" , "Saravana Kannan" , "Rafael J. Wysocki" , p.rosenberger@kunbus.com, woojung.huh@microchip.com, UNGLi= nuxDriver@microchip.com, vivien.didelot@gmail.com, davem@davemloft.net, ku= ba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org > Betreff: Re: [PATCH 0/3] Fix for KSZ DSA switch shutdown > > On Sun, Sep 12, 2021 at 10:19:24PM +0200, Lino Sanfilippo wrote: > > > > Hi, > > > > On 10.09.21 at 16:58, Vladimir Oltean wrote: > > > On Fri, Sep 10, 2021 at 01:51:56PM +0200, Andrew Lunn wrote: > > >>> It does not really scale but we also don't have that many DSA mast= ers to > > >>> support, I believe I can name them all: bcmgenet, stmmac, bcmsyspo= rt, enetc, > > >>> mv643xx_eth, cpsw, macb. > > >> > > >> fec, mvneta, mvpp2, i210/igb. > > > > > > I can probably double that list only with Freescale/NXP Ethernet > > > drivers, some of which are not even submitted to mainline. To name s= ome > > > mainline drivers: gianfar, dpaa-eth, dpaa2-eth, dpaa2-switch, ucc_ge= th. > > > Also consider that DSA/switchdev drivers can also be DSA masters of > > > their own, we have boards doing that too. > > > > > > Anyway, I've decided to at least try and accept the fact that DSA > > > masters will unregister their net_device on shutdown, and attempt to= do > > > something sane for all DSA switches in that case. > > > > > > Attached are two patches (they are fairly big so I won't paste them > > > inline, and I would like initial feedback before posting them to the > > > list). > > > > > > As mentioned in those patches, the shutdown ordering guarantee is st= ill > > > very important, I still have no clue what goes on there, what we nee= d to > > > do, etc. > > > > > > > I tested these patches with my 5.10 kernel (based on Gregs 5.10.27 sta= ble > > kernel) and while I do not see the message "unregister_netdevice: wait= ing > > for eth0 to become free. Usage count =3D 2." any more the shutdown/reb= oot hangs, too. > > After a few attempts without any error messages on the console I was a= ble to get a > > stack trace. Something still seems to go wrong in bcm2835_spi_shutdow= n() (see attachment). > > I have not had the time yet to investigate this further (or to test th= e patches > > with a newer kernel). > > Could you post the full kernel output? The picture you've posted is > truncated and only shows a WARN_ON in rpi_firmware_transaction and is > probably a symptom and not the issue (which is above and not shown). > Unfortunately I dont see anything in the kernel log. The console output is= all I get, thats why I made the photo. Regards, Lino