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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 28B31C282C3 for ; Tue, 22 Jan 2019 13:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0036E20879 for ; Tue, 22 Jan 2019 13:42:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728624AbfAVNms convert rfc822-to-8bit (ORCPT ); Tue, 22 Jan 2019 08:42:48 -0500 Received: from mail.bootlin.com ([62.4.15.54]:36790 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728463AbfAVNmr (ORCPT ); Tue, 22 Jan 2019 08:42:47 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id D477120A7D; Tue, 22 Jan 2019 14:42:44 +0100 (CET) Received: from xps13 (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) by mail.bootlin.com (Postfix) with ESMTPSA id 77534209BF; Tue, 22 Jan 2019 14:42:34 +0100 (CET) Date: Tue, 22 Jan 2019 14:42:34 +0100 From: Miquel Raynal To: Andrew Lunn Cc: Florian Fainelli , Vivien Didelot , "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: <20190122144234.54e2edc1@xps13> In-Reply-To: <20190122132005.GA3634@lunn.ch> References: <20190116153419.3208-1-miquel.raynal@bootlin.com> <20190116155651.GC29244@lunn.ch> <20190116222329.GP29244@lunn.ch> <20190117104641.GD13242@t480s.localdomain> <20190117165052.6d1f1a58@xps13> <20190122110435.5eaab82a@xps13> <20190122132005.GA3634@lunn.ch> 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 Andrew, Andrew Lunn wrote on Tue, 22 Jan 2019 14:20:05 +0100: > > 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. > > Hi Miquèl > > Is the power removed from the switch? If so, you need to restore the > full switch configuration. The current code might be sufficient for > runtime suspend, where the switch is put into a low power mode, but it > is kept powered. It is not sufficient for a full power cycle. > > > 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(). > > Here are some commands to try before you suspend: > > ip link add name br0 type bridge > ip link set br0 up > ip link set lan1 up > ip link set lan1 master br0 > ip link set lan2 up > ip link set lan2 master br0 > > At this point, you should be able to pass traffic between lan1 and > lan2. > > bridge fdb add 00:42:42:42:42:42 lan1 > bridge fdb add 00:24:24:24:24:24 lan2 > > That adds two static forwarding database entries. You can show these using > > bridge fdb show > > There are likely to be additional dynamic FDB entries. It is O.K. to > loose the dynamic entries over a suspend/resume cycle, but the static > ones must remain. Thank you very much for this, it is really helpful. > > > 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. > > MTU and queue length have nothing to do with the actual switch. Your > tests need to actually program the hardware. I didn't checked the hw was programmed indeed. Well, I'll try with the test described above and will propose something. Thanks, Miquèl