Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7389450imu; Tue, 22 Jan 2019 05:21:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN5t8kdUwisEmxgcuyRJL7r6Jg0DIB0vwSskylzPjKvKWaLRmW32Fvz5cIeeiT2qO7XPVkB6 X-Received: by 2002:a17:902:28c1:: with SMTP id f59mr34296242plb.37.1548163297792; Tue, 22 Jan 2019 05:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548163297; cv=none; d=google.com; s=arc-20160816; b=fzL3XpprMO86XxIrdxUjTHgaODW3IRVz0X8AA1/4StjAJ5ssmvrR+EbmAFWdW8uN0t F2AXOZlLdzTaGJKCO3J/CzQ5LTJ6tGZ00nCq+81xIr342lekhdsJwbGw/vHk71RJr6gS 6/1g/DC7gBqDMi7lrj6WJzi048CFVXdyVkVpA27aWhhqZmoE3qZIw0izgBhSPHX5skHh YFvSmPqHdgKwL1TNu0vDh/WCm/2BKVLWo0cgNljuOnoJm80ArxZIwsvnzwraBcPEVuMO 9ahU4viMKVL4HMYO3bxPxOy2VDN0gAbxvGYZxiA4lfO9DIFD70ZCN9dARIiUAUk0P9Cw Q79g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O+u0odsrSBsihdyWpnauKMfnZl0ym9tcZpZN6vfZhCw=; b=03EhP7K3eBgM+ffGM6qSSuEhNGvv0JkOBBUc3glRuk4eNAV7kjhxTEYHSREYObLkfB clNzXCdRZfL5lwouFHoiNCutdYAyej22HjPv5XOlpaaPx672yYnok7GayRYAzJNFswPc LRDbjpIlxJ/CgcsZ8nP5TheTCiQCm6RySGtJQ2pz7+0TGBFQP8LWDg3C0ZPMkUw3J4OT yD60v/TslKOKWJiH/j7XCsWl/+e41UF+K1CdWrBbOvIaKHQghXoPzChgz0Sg9dRazFCk c4jxfLtIJpL974H/S4YyUKyyG+HdTbPyn4l/foIr9D+uwnWEMB5GG5ks9gX95rnyv4Pz LcNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tq5Maxpz; 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 c125si15635697pfa.216.2019.01.22.05.21.21; Tue, 22 Jan 2019 05:21:37 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tq5Maxpz; 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 S1728482AbfAVNUM (ORCPT + 99 others); Tue, 22 Jan 2019 08:20:12 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:51529 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728239AbfAVNUM (ORCPT ); Tue, 22 Jan 2019 08:20:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=O+u0odsrSBsihdyWpnauKMfnZl0ym9tcZpZN6vfZhCw=; b=tq5MaxpzUVnaqWGPJYGhN8rHzM0H448KVyCWRUCJWrkwsjZm8iRiEPBtxOA0bBM/gunW12QztgkilRHNMBNOgk8PMZQh4joAv1pY+FMc2awYhstkGHzbsAge49NQDq4+2KOz45CLvuj/nwDg+w71R7OlKLBrhxUmznkoTtMWQW8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1glvyH-0001A2-MB; Tue, 22 Jan 2019 14:20:05 +0100 Date: Tue, 22 Jan 2019 14:20:05 +0100 From: Andrew Lunn To: Miquel Raynal 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: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190122110435.5eaab82a@xps13> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. > 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. Andrew