Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2007946pxb; Mon, 13 Sep 2021 09:56:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwubAVgq1UZCTtWtqA7ETMQUNswS2jsKxTNTLSUa1j2frNQ7TGOihBrWilLJgLz9uz1fQpa X-Received: by 2002:a17:906:4fd6:: with SMTP id i22mr13691656ejw.92.1631552193516; Mon, 13 Sep 2021 09:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631552193; cv=none; d=google.com; s=arc-20160816; b=BuYeF86G5i1JEbVoKjuKCWB9muhSp1KnYV/pyvAsI3GCgH4UgW0oFojv2KKFy1FqTc w8MV5awxlWjjShyQxEcUud/FV4FbaqfOdEjOJdpQHFk4w0aKvBJOFnpNgwFHATGWL/Bh y1ppgMjSot0XoHlKgWAfw6Hj+1Su2QgCqIvperUZC1m+sB1A+iFaldoeqKpjayoXxKI/ uCPdBuvbyOAxgRE7HSR/PdjXuvN5ZkzZT/7gQN3vTs5pw2UlhsYnepIUydXTv+PoxhCk BhNyTQC840y1xNFaB1FUGol47RFRj8jM9nH8viafjTdMFEZYv25r9W2Tl85mNRtjq4R5 ygbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=u8LSn204FDqhGyF0mRHlJ+uof8bjln9ACZwGJ4VJX/Q=; b=EYvcjbg37Gx0wKG/pAI90o6673yPowYd5K2qa/ncGCkkb/WdBL9XDPsgyT2rLI8xyh 6yoIyDgdeD0hp/n6Ydhu9dPETD9+syCqrY7hVdX0Fjb6CqMlkY+ZQCKqej1esI8ursjw 2M+iZtIXApQft3bIj0CQ4kmak+TBmjCFHAhNo0pfaDFW1Lghpqpk8/lLGUQhtfJxxNqU IWrLI7XwR/pCMi+lDiJ+nTPdwdxQRfrMoaBm0Ie0USR52O8rCBJG0TBU2XTXQelQeM5J AKbNIherOlbQcGNpZcD+FPHtvIgPtFoaExxcL3McabTfEsCfCs2TwZnzWdGIiBSczILQ uulg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ilq7JmMn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si9386394ejg.118.2021.09.13.09.56.09; Mon, 13 Sep 2021 09:56:33 -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=@gmail.com header.s=20210112 header.b=ilq7JmMn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239914AbhIMQwV (ORCPT + 99 others); Mon, 13 Sep 2021 12:52:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239698AbhIMQwU (ORCPT ); Mon, 13 Sep 2021 12:52:20 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C7AC061760; Mon, 13 Sep 2021 09:51:04 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id u18so10062551pgf.0; Mon, 13 Sep 2021 09:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=u8LSn204FDqhGyF0mRHlJ+uof8bjln9ACZwGJ4VJX/Q=; b=ilq7JmMnDjs41l5IclgdcW1Z9freZdaRf+3oq0i6Qet/fxHzA1mxEv62jZdGc887or J6tCtrBXyQZUYUqXNoh1IYCjNoRIoB+/sar4zeOnxSvp+ppk2NDc4WwX+RzZtkKS+ZKa DZaOijUuOBfdVZcg4BHr9lavDRCjYp1HH++4Qf4+W+ScdynyF1SVi9+ppm+uRiXpc4sV D4kd+0A3TFVUyTjTtSwAmZpVNBtKL3xNkQ5feex8wsGB4rI6w2QrZgZLsq632cLZKWB0 oB3naggJovqO0tgQ5x4VN/C+A6d7S082F4Q+gtPMxO2z7i3mLKRzKH1oHl2Je8P0qi1A HHfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=u8LSn204FDqhGyF0mRHlJ+uof8bjln9ACZwGJ4VJX/Q=; b=6h1luUtjbX+evg7gXBVGkLSocqagvla7vacuPUPgNbTOsvAHl30VMlgc1sw4Rbe9ti j3wjcmNFn5GW+Mlhw+p6j7WNYpKhTIR19EthIyeoOlwtbWkUe0CD8EZ46IALn2aV3KZr gB7uyhPdxTUwaK6zpcGBOFmI3dlWH10THL+pHT5GsXpcaqPhVNJZ3JCy2m6JajAaDYL4 /WTjC3UPHJ68irKCCs18M1r59VRhvzCJ4B/twCQT0FfMKgwSTPLt10BlzDOqdB7ZzcxY UBQIy10jJTGF3fvV1RQJqP9iW+g8xeog7uCnh8D8iEd/JN/8ghgvFAvtYKl1SEB99kym 4JLg== X-Gm-Message-State: AOAM532r7r22P6TXtgoFKx7BLIYrjhWI/up6K2xXQ3vAtgpYvDPQgWXH OO5P88/YdFOxavOHL57eaSs= X-Received: by 2002:a62:8281:0:b0:3f6:3b92:3698 with SMTP id w123-20020a628281000000b003f63b923698mr331543pfd.55.1631551863939; Mon, 13 Sep 2021 09:51:03 -0700 (PDT) Received: from [192.168.1.121] (99-44-17-11.lightspeed.irvnca.sbcglobal.net. [99.44.17.11]) by smtp.gmail.com with ESMTPSA id w11sm8570713pgf.5.2021.09.13.09.51.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 09:51:03 -0700 (PDT) Message-ID: Date: Mon, 13 Sep 2021 09:51:00 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [RFC PATCH net 4/5] net: dsa: microchip: ksz8863: be compatible with masters which unregister on shutdown Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org Cc: Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com, Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , Linus Walleij , George McCollister , Heiner Kallweit , Russell King , Oleksij Rempel , Michael Grzeschik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Lino Sanfilippo References: <20210912120932.993440-1-vladimir.oltean@nxp.com> <20210912120932.993440-5-vladimir.oltean@nxp.com> From: Florian Fainelli In-Reply-To: <20210912120932.993440-5-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/12/2021 5:09 AM, Vladimir Oltean wrote: > Since commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA > master to get rid of lockdep warnings"), DSA gained a requirement which > it did not fulfill, which is to unlink itself from the DSA master at > shutdown time. > > Since the Microchip sub-driver for KSZ8863 was introduced after the bad > commit, it has never worked with DSA masters which decide to unregister > their net_device on shutdown, effectively hanging the reboot process. > To fix that, we need to call dsa_switch_shutdown. > > Since this driver expects the MDIO bus to be backed by mdio_bitbang, I > don't think there is currently any MDIO bus driver which implements its > ->shutdown by redirecting it to ->remove, but in any case, to be > compatible with that pattern, it is necessary to implement an "if this > then not that" scheme, to avoid ->remove and ->shutdown from being > called both for the same struct device. > > Fixes: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support") > Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ > Reported-by: Lino Sanfilippo > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian