Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1210668imu; Wed, 16 Jan 2019 14:53:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN4vtzCpuI509IhdO8pDthAChByJ1jDy4rwsO8IvWecH2rbrPxZoQSJEp+8wcYJ4kFSfNhfB X-Received: by 2002:a17:902:7588:: with SMTP id j8mr12512239pll.215.1547679231524; Wed, 16 Jan 2019 14:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547679231; cv=none; d=google.com; s=arc-20160816; b=DetK0jimwLRdd8WfHTWXHGFc2f2gY6+ai3WDFCu9LWvMyNgIHerVzRM6GjV4lBtUaP +qghCaafxLvIYbMkEoIFOpnnAASA7eTz9qSLDhrGwKB/WI7bJUAGf1FyEt8ir/kAa49R QQIsPfNaE3vJltI2amn4s01cOeHMI4s5XUYIexxgskd1s3cP5fzdnaTDsPbz9dv5JZ9w BUGnXe143HwLZbImgBY6Gepvm316/XHteAmjyHEC+mY4kuEZA3f27m2zZwLu9dZfY+tL pTeOqLe1wXeHOXibo3JjAN5UvhfgVtt1OhiDg14Qa6q8PZWEQhcMIa3mU2eXwxlxekQU gDnw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SmZmNHlZXEL4jfTuowmEiCjHV/dMTENkDuhbQDkOdbs=; b=uvugDxssqfI0R/qncT5IeCAKQePRmU8NbynwmhuRu711z4MwGSxhgo9NoEVaOkV/Cn vu3nkyi4u4PvUz4sBz/e6DppD0lvaZOvkUQ5Y57MDDSywVwB2Q6F49Mfv/ZHsp3j2my3 MruPSwnWqEnuK2wfQbalS0Mad5ABOCAG1daLlxx0V7nGbTJM8+ivOZi3/6Sh5foYxHRk a4EzA4DdiPlgC44NNolLW2NCVoGJjLv4sdh93zawzyLX5kkFJUPXJgedP5kZjUdEdCrV RZLZgR/wZkMpv2Zvd6IvcD40c6LkL7Xa7N3KEKDAuQBJNnJla7lF5GU0jPRLvsD2JrYw EAJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ld187+yf; 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 o127si8420522pfo.251.2019.01.16.14.53.35; Wed, 16 Jan 2019 14:53:51 -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=ld187+yf; 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 S2404645AbfAPP4y (ORCPT + 99 others); Wed, 16 Jan 2019 10:56:54 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:45398 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfAPP4y (ORCPT ); Wed, 16 Jan 2019 10:56:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=SmZmNHlZXEL4jfTuowmEiCjHV/dMTENkDuhbQDkOdbs=; b=ld187+yfha7ztKT3K8kMy2ynDMPt4k5LYYvYX6OQ/eQEw28wqlTuftBUqQTCzOL0Q3S4d1vCaOYnKzlkkjFEXdJTNoxqIZLffUgeTWGAM6PtZMifhoiTcQ+F2k6vfLzLGQNL/+lhik19WGB+kVRzdmeNgAeB0eylAyxLy2z+2So=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1gjnYh-0007uU-5a; Wed, 16 Jan 2019 16:56:51 +0100 Date: Wed, 16 Jan 2019 16:56:51 +0100 From: Andrew Lunn To: Miquel Raynal Cc: Vivien Didelot , Florian Fainelli , "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: <20190116155651.GC29244@lunn.ch> References: <20190116153419.3208-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190116153419.3208-1-miquel.raynal@bootlin.com> 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 On Wed, Jan 16, 2019 at 04:34:19PM +0100, Miquel Raynal wrote: > Bring S2RAM support to the mv88e6xxx DSA driver. > > The content of the *_irq_poll() helper is moved in *_do_irq_poll() so > that that the function can be called from the ->resume() callback > without using the *work pointer. > > +static int __maybe_unused mv88e6xxx_suspend(struct device *dev) > +{ > + struct dsa_switch *ds = dev_get_drvdata(dev); > + struct mv88e6xxx_chip *chip = ds->priv; > + > + kthread_cancel_delayed_work_sync(&chip->irq_poll_work); > + > + return dsa_switch_suspend(ds); > +} Hi Miquel I don't think this is sufficient. You are leaving the switch itself running. It will still be forwarding frames. And since the host is shutdown, there is nothing doing spanning tree protocol. So you are likely to cause loops in your network. Take a look at bcm_sf2: static int bcm_sf2_sw_suspend(struct dsa_switch *ds) { struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); unsigned int port; bcm_sf2_intr_disable(priv); /* Disable all ports physically present including the IMP * port, the other ones have already been disabled during * bcm_sf2_sw_setup */ for (port = 0; port < DSA_MAX_PORTS; port++) { if (dsa_is_user_port(ds, port) || dsa_is_cpu_port(ds, port)) bcm_sf2_port_disable(ds, port, NULL); } return 0; } qca8k does something similar. Andrew