Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2005805pxb; Mon, 13 Sep 2021 09:53:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe7pZdug+5ft9isRM3pH5wvD3yx5pUKTJPE3IRT9/UK1azeclpJuj/JjyqDwrkO71pTaEp X-Received: by 2002:a17:906:32d9:: with SMTP id k25mr13922026ejk.290.1631552010779; Mon, 13 Sep 2021 09:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631552010; cv=none; d=google.com; s=arc-20160816; b=SCz9xruQpE+lJxCp0GWRa8UhVhckgsHyEs9bRWgmb2ulvo9W6oabiYUzbSA3eM8t8P WgIHF9otOG+xFQMVXon/HDcGsZyeMrwkporM+2ZAe5AX7NI85L2uHdsRdS4GEOXNYjQY abx6l4BKKs3tv5NxJ3tan+PT+R1RJDh1G9+dz/0kDQBNVb4A2Wbe9PwLdrcWWkceUj/Y GFsHuFakGao2n7lx6VFlC0FaLKvo+RkFPu6wK7t49wHQuqGwIl8I2MbbpbK3edt80nsB mn5qPi8gXSUvS1pfY04H6SNNd8IpneD1IOLZU4LLoAkLlbNeloYIpwHZ1R/ppbXIUhoC FukA== 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=kuABR48uUUXNiZompaszC47KST4UqyEqD5vKZv7sGis=; b=O1uE+8+R2BOeV2wuDlfVkNukpXlmgg+uPRjkO9yFCk23T43GNhVvwIFGytsHkGA3wf /j1/CkSgOaszbDKkRpKIUImWI6qyC2sDj4NHOJdpfRjyRXpBvLKq/JVGya6B/fjfwmHt vtpPNiuZbDfvD1C+zxFTRwz4KcYpDt2XDj6xBn06jeWCSkZLCcI7TYJDPHg3+rG45gED kg2/IBh5N+My7wSRj/7jDj47tOWGCa79ybl5Zts1AOHUz+nbrKelQiSEr74cRrsFAJty PsQGAb6D+KGjHkCODcnoU6qTGLtCrFE2nylNWja5+z0drXj9Vg8LfzDSlw+EJMVuTDS6 46yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ncpvpEmF; 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 p10si7705678ejo.13.2021.09.13.09.53.07; Mon, 13 Sep 2021 09:53:30 -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=ncpvpEmF; 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 S240168AbhIMQww (ORCPT + 99 others); Mon, 13 Sep 2021 12:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239698AbhIMQwv (ORCPT ); Mon, 13 Sep 2021 12:52:51 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A745CC061762; Mon, 13 Sep 2021 09:51:35 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id w19so5025058pfn.12; Mon, 13 Sep 2021 09:51:35 -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=kuABR48uUUXNiZompaszC47KST4UqyEqD5vKZv7sGis=; b=ncpvpEmFtmubH+lclgjmMMEMJU6nH4pbD8aM5zHsG+FSC4yd8KGtff43Ku5nI5qJ2O q7Y2Z5/5SmsKAzpxcm24Yepv5gpc+AkmIX/v4/PlCxNAsMRzfcU7saJkLZRd+lB/vFgZ +EUIxqSQSlqAh/aRkojoCWlq4ZXgAELDDOEbhBvxwHq+dXYAtFHEbkSCX4ZlSk2BJ4QI P5gmeJWLQ4WxwK3SNYoWeH3slNo0jn+HxC7tvoDMrDLeNab3UBrFdLLqqwwMCzfn7SRF GhIkil0aZT0DdZv3YXcA1bbc4rVsPX5NZtOYhReACGHowtcXaKX4LTNoGyiYsA7OHJwJ +85Q== 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=kuABR48uUUXNiZompaszC47KST4UqyEqD5vKZv7sGis=; b=2bZ25EMkCjA3mwviRxXSW/OXGxtaj+rEZTiM0tpQi9sCS0/hgAoH32ZyvY703kyR8M AhbhSmPS9qOE7sBvYUwr+Tb0f1Of1WFKBMI7jdAp5PGdxjdMksq7nVcV42aczUYmvWGx 3hFEjY8Jate0Ipvo0nAmfoNAcbmTSOowvGxBOuRYyjUREZTLTV9JF4VEATEgCPP8g0Cm KJADi+8cGvfK/yItwQ0Vp++Q1qJ/wSxqvYV0y3CEOgE4MyqVjocHn8lUD29wmdYia+08 2wNDY07u1yAu9MjxVv/073hbSBRxk+AbLYQ3vuSWVoxUcZ8Y3hopAwwv9PV12JdGS8/n 7sOA== X-Gm-Message-State: AOAM532tpHdOs72DjCWniRnkw0MRAo1aJZnPVC8aafWvgATJwA+3pNvL cF0fwg/SQzhwZrgLdeKdtGs= X-Received: by 2002:a63:ed4a:: with SMTP id m10mr12108087pgk.448.1631551895199; Mon, 13 Sep 2021 09:51:35 -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 g3sm7623652pfi.197.2021.09.13.09.51.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 09:51:34 -0700 (PDT) Message-ID: <4ebab581-897e-e95b-c28f-8dc9f3bc17f5@gmail.com> Date: Mon, 13 Sep 2021 09:51:31 -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 5/5] net: dsa: xrs700x: 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-6-vladimir.oltean@nxp.com> From: Florian Fainelli In-Reply-To: <20210912120932.993440-6-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 Arrow SpeedChips XRS700x driver 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. > > These devices can be connected by I2C or by MDIO, and if I search for > I2C or MDIO bus drivers that implement their ->shutdown by redirecting > it to ->remove I don't see any, however this does not mean it would not > be possible. 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: ee00b24f32eb ("net: dsa: add Arrow SpeedChips XRS700x driver") > 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