Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7206703imu; Tue, 22 Jan 2019 02:06:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN58RqTnTu+PTg46cQYyUQps4O4qEW01gEInQjkOyVpk08UtjknjiN+xonjdPHM4oX4BFnoz X-Received: by 2002:a17:902:722:: with SMTP id 31mr33760973pli.271.1548151596450; Tue, 22 Jan 2019 02:06:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548151596; cv=none; d=google.com; s=arc-20160816; b=A5P8fYtwcPOUfRWuT5zX6pQeLRBoSNDZIUw4uDDAAvx8onCnGuauLQNaVf09YQ4kLu ZTDMT0tM6ameQlklQ2YRxSyYnu5uqsSsoZzYdIauLehTws/EOOrj8kk5wAmmK8hXm7C/ MP+CPYiGn6qKLLaaxrHoWyEDreLiR926XpfqE68KbF7Q5HgNyWkAv1yH7tZSXetERS6p jJiNBPJ+w+5wHOZwI9yha+xLigzHZ7HDFz+snaGNoLonPAgYwAL4zo75mc/vIS+Y9lrv f+FBWEGdHBG5jtYdEj04b3vHiC1htxwwaPpYMLR39r8vYywOqtR4OieLvNcjv4aeks/f lGuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=LHPo5UroxACCP1VnoBInhbt1eU/e3OAhKCAy2EU4SFA=; b=WyBUdhGPCeD+QA1vrfZBoUrsoq0NM+hcmSH7MMk1+kYo+9X1ZR3R/Aq2kdZKwg6zBW 1VUXAsMZg6XKv9mjCzrKpLISH/i7STrkfrqWR3/Hedxv3ok3hhLlaerlBXXq+tdREB8A GJReB/bVA4/gjfFNzxGIrVyXrudgFYtivgFoMJBKbxnCviLOr3C1sSFUzIeeme/KCntV 7/KWg+WVf3eJGNOrsVhfJsWCN3AUpe+/HanJKzbO+8v4jHoNDqdKT6cdEM4StBOb06sW FSvsth6ikhRwPKXkS9wdX3vONQE1G1usCGohWW9r2ojQRE9YgeK350I/x56UvLp9mWd9 Tw7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si14284802pgh.299.2019.01.22.02.06.20; Tue, 22 Jan 2019 02:06:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbfAVKEh convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 Jan 2019 05:04:37 -0500 Received: from mail.bootlin.com ([62.4.15.54]:58489 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727663AbfAVKEh (ORCPT ); Tue, 22 Jan 2019 05:04:37 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 724FB2078C; Tue, 22 Jan 2019 11:04:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from xps13 (aaubervilliers-681-1-37-87.w90-88.abo.wanadoo.fr [90.88.156.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 1C36B206A7; Tue, 22 Jan 2019 11:04:35 +0100 (CET) Date: Tue, 22 Jan 2019 11:04:35 +0100 From: Miquel Raynal To: Florian Fainelli Cc: Vivien Didelot , Andrew Lunn , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Gregory Clement , Antoine Tenart , Maxime Chevallier , Nadav Haklai Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: Add suspend/resume callbacks Message-ID: <20190122110435.5eaab82a@xps13> In-Reply-To: References: <20190116153419.3208-1-miquel.raynal@bootlin.com> <20190116155651.GC29244@lunn.ch> <20190116222329.GP29244@lunn.ch> <20190117104641.GD13242@t480s.localdomain> <20190117165052.6d1f1a58@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Florian, Florian Fainelli wrote on Thu, 17 Jan 2019 10:00:46 -0800: > On 1/17/19 7:50 AM, Miquel Raynal wrote: > > Hi Andrew, Vivien, > > > > Vivien Didelot wrote on Thu, 17 Jan 2019 > > 10:46:41 -0500: > > > >> Hi, > >> > >> On Wed, 16 Jan 2019 23:23:29 +0100, Andrew Lunn wrote: > >>> Hi Florian > >>> > >>>> A possible approach could be to call the port_disable, port_enable > >>>> callbacks from dsa_slave_suspend() and dsa_slave_resume(), I might have > >>>> some patches doing that already somewhere. > >>> > >>> I expect it is also on Viviens TODO list, since this really could be > >>> in the core. > >> > >> Indeed that is! > > > > So, shall I wait for Vivien's patches (adding port_disable/enable() > > in dsa_slave_suspend/resume()) and keep the driver as-is or do you want > > me to manually call port_disable/enable() from the mv88e6xxx driver? > > Up to you guys, the only thing that I an tell you is that my platform > loses its register contents during suspend/resume, therefore you must > make sure the driver re-applies the entire switch configuration, > identical to how it was prior to suspend. If you need me to test > something, please holler. I am not sure to understand what is lost. On my setup ethtool shows that everything is fine after resume but maybe I fall into a "default" working case. When I compare with the two drivers pointed out by Andrew: * qca8k resume callback: * enable ports, * call dsa_switch_resume(). * bcm_sf2 resume callback: * call dsa_switch_resume(), * reset the switch, * refresh rules (Not applicable?), * enable the PHYs, * setup the ports, * configure vlan (Not applicable?), * mv88e6xxx resume callback: * reset the switch, * enable the PHYs, * setup the ports, * enable IRQs, * call dsa_switch_resume(). This looks pretty similar. Maybe the ports setup are set to default values while I should save some parameters at suspend? I changed a few parameters (like the MTU or the queue length) but they seem to be correct across suspend cycles. Can you show a diff of what part of the configuration is lost? Anyway, I have little background working with switches, so I might miss something big. Thanks, Miquèl