Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1367408pxb; Sun, 22 Aug 2021 14:45:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMuvntFj/T7EQZ/qkVSnaba6s2hwiOmmdBe7DmGvwHCbv2GJTwXkmdwJDOKPNp3L9mCJ/3 X-Received: by 2002:a17:906:1451:: with SMTP id q17mr32840595ejc.214.1629668732539; Sun, 22 Aug 2021 14:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629668732; cv=none; d=google.com; s=arc-20160816; b=hv7MhOdxFi75ggg/+rwadmebwi+k7p0n3z902+wSWT2ehAcuv9HpV139bYno14ccCJ s2ZNHeU9PxxLZyz+LJkoGzlRspY3U7LuJMTuaXAcUHAOxW+cDlsI0ncTO5xxjfku4x60 /GZMSMhODFB6152KDhQng/znHtICrRHQM+VgcGj8FLwH+eo0Sdo45kFOl+o19J4485tR 3Ngq7ALEXqtsRYWz9ePxMoeTrAuIKPR5zFLgzKT1u5DKiRb66Sv48D09YLYztW5LV7Il VDUxjv5xEXi7ka4eeqUpJIXAcXICt3EQm4PWRi0WAcmJVX2tWLTayTWcEABYzrsnu17i rOjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WjHgg2RoVpjMaNdEtPWxt1gfEbjLkGTCJql1tYv9138=; b=PS++WgywMIdub8uPk7QBGXCsncLa7LHQk0cdMEolJPGnG7+dwgFvQryuypBD/nHvKw FmX0liOlSbirDzY4gxttUV6ytDpr0kw3Tn6sEqDgNf6NOCKHl9YXluYRLTZJWoDsAAgq 7OPK9/aM7M6+aKzLlcE/sxCvddqk49tZzOJjeJ2PA4xlC00PTlZndK1dfB9Yhr0NFkEV E5rF7urS7/TtwlXWZ1vOjt7c7KKEkCrkoY9ZIfqGcpDwhpivKC/+i+MPs+Pl5ayYoNwe 9+Yxkn2gl/rZmgpH35HzDfRBFiRBWORo/18+6IvwpDh69LQVci80tcjMASAIJx4rlVID CkAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="k1ouKxQ/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn5si5569210ejc.567.2021.08.22.14.45.09; Sun, 22 Aug 2021 14:45:32 -0700 (PDT) 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=@lunn.ch header.s=20171124 header.b="k1ouKxQ/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233355AbhHVVlx (ORCPT + 99 others); Sun, 22 Aug 2021 17:41:53 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:35508 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230311AbhHVVlw (ORCPT ); Sun, 22 Aug 2021 17:41:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=WjHgg2RoVpjMaNdEtPWxt1gfEbjLkGTCJql1tYv9138=; b=k1 ouKxQ/NcaV6l2WRqLE/XMZc5syUMG78Jd5K/ifYD7UUvVeBL+hAaMqrhviqwVu6IZZSV/MNJ20dD9 eujAxUTrEHmbHBnt88u4LiU9dw4zNmy13iIcMAHj+wTUZYpb/GZ7aZ7q7dC/rvPawEWYx/Mr0x7/M M3FX9ti1u6ZPNjQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mHvD4-003Nb2-78; Sun, 22 Aug 2021 23:40:54 +0200 Date: Sun, 22 Aug 2021 23:40:54 +0200 From: Andrew Lunn To: Alvin =?utf-8?Q?=C5=A0ipraga?= Cc: Linus Walleij , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , mir@bang-olufsen.dk, Alvin =?utf-8?Q?=C5=A0ipraga?= , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next 1/5] net: dsa: realtek-smi: fix mdio_free bug on module unload Message-ID: References: <20210822193145.1312668-1-alvin@pqrs.dk> <20210822193145.1312668-2-alvin@pqrs.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210822193145.1312668-2-alvin@pqrs.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 22, 2021 at 09:31:39PM +0200, Alvin Šipraga wrote: > From: Alvin Šipraga > > realtek-smi-core fails to unregister the slave MII bus on module unload, > raising the following BUG warning: > > mdio_bus.c:650: BUG_ON(bus->state != MDIOBUS_UNREGISTERED); > > kernel BUG at drivers/net/phy/mdio_bus.c:650! > Internal error: Oops - BUG: 0 [#1] PREEMPT_RT SMP > Call trace: > mdiobus_free+0x4c/0x50 > devm_mdiobus_free+0x18/0x20 > release_nodes.isra.0+0x1c0/0x2b0 > devres_release_all+0x38/0x58 > device_release_driver_internal+0x124/0x1e8 > driver_detach+0x54/0xe0 > bus_remove_driver+0x60/0xd8 > driver_unregister+0x34/0x60 > platform_driver_unregister+0x18/0x20 > realtek_smi_driver_exit+0x14/0x1c [realtek_smi] > > Fix this by duly unregistering the slave MII bus with > mdiobus_unregister. We do this in the DSA teardown path, since > registration is performed in the DSA setup path. Looking at the setup code, is there anything undoing what rtl8366rb_setup_cascaded_irq() does? This patch however loos O.K. Reviewed-by: Andrew Lunn Andrew