Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp977836pxb; Fri, 15 Apr 2022 17:12:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3/u4VQYpCP1sOibamd+qz5si6uuAcNwJYclWZBppXuvTHQSO+MlH5dUdZU88DQiKIwxHk X-Received: by 2002:a17:90b:224a:b0:1cb:8bad:ec3e with SMTP id hk10-20020a17090b224a00b001cb8badec3emr1429775pjb.30.1650067975289; Fri, 15 Apr 2022 17:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650067975; cv=none; d=google.com; s=arc-20160816; b=f+tyOBcLbqdmcFj0MgfAOfeNDBsceGIO+/HgioWO3TvWsHuHuon+qIg6HKnS01P/ev 0JeTdqGzt/0uiY4WDGWfsNgaCA3ptWOqKfDykmPbWrdldoiA4+hJskWIbrozDRR4ol1P kVB9MPo+OLOnE/3avd5k+CLSCutCbI1Lu9pP913s9qx2ImsOvQFblQ+wl4AcE3zcOCKA Ef6HdZjCPLTdTn96IhDCkd2YipPdbi/tjGTR7/Dofn8k7peixvV6e4rFrBmkgumdKVm2 wKzyiJ5p88Dk6mVSgsHOcUl8LGUJg9oD1afCtn4daTvJ/BktORn2M+22Qww84pedjiOX 5z3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jjg190Yb9zONSH4JSaJBDfV6Tubxd7UZyyCcS9yfkSU=; b=OVt484EhzTshpPa7xtLXjI8Wzn5rMJ2shpo63vTXvFE9oHf/DuNIgoLuHFmfVAY84+ Et1BMBGKBsT3a+PJwH4rWMewBYFfN4ytNZzl0FfTKcQM+BKO1kHTx+Ohw/yqeySxCtpF DnnlJVa9vEUZ3VXYrwemJD2655eGcmmzL1TNnv8Kd3pi2YXGsjxT233t748pcbQO0Yow zxzWs3ttaAROwJ7mTCZ8iqdeRjKAn7t3c/Agfhk+c5b4e8mDmD9c4l0gNJE5mxtzuKjC 8ECZlFAua3b8+keda0gDInDi0RKm2xv1PJfXvV8uV+c8HjLPPxL7c9DJwogcvx0ZoltX Cyog== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=R3LSsCDk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z14-20020a1709028f8e00b00153b2d16511si2428141plo.281.2022.04.15.17.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=R3LSsCDk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7EE95D66E; Fri, 15 Apr 2022 17:12:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352670AbiDOL0O (ORCPT + 99 others); Fri, 15 Apr 2022 07:26:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243602AbiDOL0L (ORCPT ); Fri, 15 Apr 2022 07:26:11 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A47A38AE76; Fri, 15 Apr 2022 04:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jjg190Yb9zONSH4JSaJBDfV6Tubxd7UZyyCcS9yfkSU=; b=R3LSsCDkRob7+KFtLD6IP7GN0q iSDhWXxvo6t6+fQ58ZgvBcDfDvMHgBSkwHowqc2ym4dbyNos89L3d6pau0yUyiw6cduaH3yBOmZxr YYm0syhFZ2Z2+Y1yD2qeL0yF0zYpHyc3QrGMJpKX0utEP0OTK75bmtKYPKxkMjlqAC5oJJjj+S0dM jmk3f2Wi40x3CNnKVUEcA30KfFxpTfQTUzEDM37BrS2dE2ISGotWllR8sUDlw3mIpaTfhgppvUQ50 Jlo8m4zr6UYvNg3l6F4uVFtPYTou8t6RF+aPlLg1DcsUuAoK+WbGKR6jU1BSSfp5vzaPY0ZzrVKSn 0tdHXoUQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58276) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nfK32-0005aK-Ol; Fri, 15 Apr 2022 12:23:32 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nfK30-0005DJ-51; Fri, 15 Apr 2022 12:23:30 +0100 Date: Fri, 15 Apr 2022 12:23:30 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Heiner Kallweit , Thomas Petazzoni , Herve Codina , =?iso-8859-1?Q?Miqu=E8l?= Raynal , Milan Stevanovic , Jimmy Lalande , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, Jean-Pierre Geslin , Phil Edworthy Subject: Re: [PATCH net-next 06/12] net: dsa: rzn1-a5psw: add Renesas RZ/N1 advanced 5 port switch driver Message-ID: References: <20220414122250.158113-1-clement.leger@bootlin.com> <20220414122250.158113-7-clement.leger@bootlin.com> <20220414144709.tpxiiaiy2hu4n7fd@skbuf> <20220415113453.1a076746@fixe.home> <20220415105503.ztl4zhoyua2qzelt@skbuf> <20220415111419.twrlknxuto4pri63@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415111419.twrlknxuto4pri63@skbuf> Sender: Russell King (Oracle) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 15, 2022 at 02:14:19PM +0300, Vladimir Oltean wrote: > On Fri, Apr 15, 2022 at 12:02:14PM +0100, Russell King (Oracle) wrote: > > On Fri, Apr 15, 2022 at 01:55:03PM +0300, Vladimir Oltean wrote: > > > I meant that for a DSA switch driver is mandatory to call dsa_switch_shutdown() > > > from your ->shutdown method, otherwise subtle things break, sorry for being unclear. > > > > > > Please blindly copy-paste the odd pattern that all other DSA drivers use > > > in ->shutdown and ->remove (with the platform_set_drvdata(dev, NULL) calls), > > > like a normal person :) > > > > Those platform_set_drvdata(, NULL) calls should be killed - the > > driver model will set the driver data to NULL after ->remove has > > been called - so having drivers also setting the driver data to > > NULL is mere duplication. > > I can see why you say that, but the reverse is not true. > A driver can be removed from a device after said device has been shut > down, and DSA does things in dsa_unregister_switch() and in > dsa_switch_shutdown() that are incompatible with each other, so either > one or the other should be called, but not both. How would ->remove be called after ->shutdown has been called? Aren't the two calls already exclusive - if ->remove has been called, the device is no longer bound to the driver, so ->shutdown can't be called for the device. If ->shutdown has been called, the system is going down, and userspace is probably already dead. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!