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=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham 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 B3130C3A5A0 for ; Mon, 19 Aug 2019 17:32:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7805D22CE8 for ; Mon, 19 Aug 2019 17:32:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nic.cz header.i=@nic.cz header.b="sZSzpu+e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727698AbfHSRcu (ORCPT ); Mon, 19 Aug 2019 13:32:50 -0400 Received: from mail.nic.cz ([217.31.204.67]:35456 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbfHSRcu (ORCPT ); Mon, 19 Aug 2019 13:32:50 -0400 Received: from localhost (unknown [172.20.6.135]) by mail.nic.cz (Postfix) with ESMTPSA id 7599D140B70; Mon, 19 Aug 2019 19:32:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1566235968; bh=wOYX7VTyXUel+7isJ1uJ52UrgNEboML/bErym9AZf5M=; h=Date:From:To; b=sZSzpu+ee+C5Cj3zPzsPldWDUFKZJPzmT3fxN7Kg6C7a19EiMHGcJEzeleYXXRleS fsIYjnoZYV6Zm3J7CFBzG1aUCP+Tub/ErCxb+8KW33gBKJEVwL66goQDDjc+gityBW xL90KQhZZow55UppCxVCJjkoMxK6TsppXGTG9m7g= Date: Mon, 19 Aug 2019 19:32:46 +0200 From: Marek Behun To: Vivien Didelot Cc: netdev@vger.kernel.org, davem@davemloft.net, f.fainelli@gmail.com, andrew@lunn.ch Subject: Re: [PATCH net-next 3/6] net: dsa: enable and disable all ports Message-ID: <20190819193246.0e40a1d4@nic.cz> In-Reply-To: <20190818173548.19631-4-vivien.didelot@gmail.com> References: <20190818173548.19631-1-vivien.didelot@gmail.com> <20190818173548.19631-4-vivien.didelot@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz X-Virus-Status: Clean Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, 18 Aug 2019 13:35:45 -0400 Vivien Didelot wrote: > Call the .port_enable and .port_disable functions for all ports, > not only the user ports, so that drivers may optimize the power > consumption of all ports after a successful setup. > > Unused ports are now disabled on setup. CPU and DSA ports are now > enabled on setup and disabled on teardown. User ports were already > enabled at slave creation and disabled at slave destruction. > > Signed-off-by: Vivien Didelot My original reason for enabling CPU and DSA ports is that enabling serdes irq could not be done in .setup in mv88e6xxx, since the required phylink structures did not yet exists for those ports. The case after this patch would be that .port_enable is called for CPU/DSA ports right after these required phylink structures are created for this port. A thought came to me while reading this that some driver in the future can expect, in their implementation of port_enable/port_disable, that phylink structures already exist for all ports, not just the one being currently enabled/disabled. Wouldn't it be safer if CPU/DSA ports were enabled in setup after all ports are registered, and disabled in teardown before ports are unregistered? Current: ->setup() for each port dsa_port_link_register_of() dsa_port_enable() Proposed: ->setup() for each port dsa_port_link_register_of() for each port dsa_port_enable() Marek