Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5396619ima; Tue, 5 Feb 2019 11:03:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbGhJS6r/yR+en+fyVWJ8PJF1htE7nODtRf4UwRe10+BF7/1SfeuvNgHU1qldrG4pftipLM X-Received: by 2002:a65:514c:: with SMTP id g12mr5810151pgq.169.1549393396029; Tue, 05 Feb 2019 11:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549393396; cv=none; d=google.com; s=arc-20160816; b=d/XGvvfbo0wTrW11LHTmdGooF02Dk4U7vo2LbG/M3HMN2O2y078gkxAiLL4sUKwQyE gmhWdKJR4FYprbVdETtm1duoaKBDMLbnb191Wv1e2nvQFEzy+sqvZAyqiXfmdkpykVrU tkGLSjisoK5tuSQStidyvA3xKynEBm0LXlrdIGHIwe/YrehuGq52I+rse6eJRMAicInS f38OYip4MO7fmJpJVmtNAcco1pCCzJ5fk9JcJEX8Dsavrufjl4BapJFqBCwjpxZT807o AbgvqxBX9tLEme4b5FKhB/izf529ggPPO08PQ+wgX391h4PMOQGZq4tvofQfC6zWA8EP Pi2A== 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=nVDImCZ2g4hkqdVMUX6Af0heXI1XiHEO+GWN70aTdjs=; b=0go8xo10fX2unVkZ9nVAPjR97RoZkrnU0IvAFdU5OZnnObkQWCZMGE7Er/o73V4qxu sYso8+fv+B9wFBLXEtP9DNF1NN0n2m8zYIQcFCNTe61fzQaOooxnfpTsqRDg3p/srFIa zDJhfhCSZbdlYTjc0kfSG47L9WhRrjcj4ujldbAcRcMfZNw16Ncu169WllKtxGFnnwMV 9wPeSQsBf7eI1mBEFpM9VBrxFNesiCiE7xfxtSfLzb4K0VOL1LLiZJeuVacV3LYSbRlO KuSLpqESso+BOvia+frLiKh63tLXxipSRfo3umELidsKasMUWw5faL4ZHjO3+d6TFEU/ gFmQ== 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 b11si3894639pla.405.2019.02.05.11.03.00; Tue, 05 Feb 2019 11:03:16 -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 S1730524AbfBESr3 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 5 Feb 2019 13:47:29 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41213 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727509AbfBESr3 (ORCPT ); Tue, 5 Feb 2019 13:47:29 -0500 X-Originating-IP: 91.224.148.103 Received: from xps13 (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id BD6B320002; Tue, 5 Feb 2019 18:47:24 +0000 (UTC) Date: Tue, 5 Feb 2019 19:47:23 +0100 From: Miquel Raynal To: Vivien Didelot Cc: Andrew Lunn , 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 v3] net: dsa: mv88e6xxx: Prevent suspend to RAM Message-ID: <20190205194723.6d567b4e@xps13> In-Reply-To: <20190205112857.GB13620@t480s.localdomain> References: <20190205110728.11451-1-miquel.raynal@bootlin.com> <20190205112857.GB13620@t480s.localdomain> 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 Vivien, Vivien Didelot wrote on Tue, 5 Feb 2019 11:28:57 -0500: > Hi Miquel, > > On Tue, 5 Feb 2019 12:07:28 +0100, Miquel Raynal wrote: > > > +/* There is no suspend to RAM support at DSA level yet, the switch configuration > > + * would be lost after a power cycle so prevent it to be suspended. > > + */ > > +static int __maybe_unused mv88e6xxx_suspend(struct device *dev) > > +{ > > + return -EOPNOTSUPP; > > +} > > + > > +static int __maybe_unused mv88e6xxx_resume(struct device *dev) > > +{ > > + return 0; > > +} > > The code looks good but my only concern is -EOPNOTSUPP. In this > context this code is specific to callbacks targeting bridge and > switchdev, while the dev_pm_ops are completely parallel to DSA. > > It is intuitive but given Documentation/power/runtime_pm.txt, this > will default to being interpreted as a fatal error, while -EBUSY > seems to keep the device in an 'active' state in a saner way. > > I don't understand yet how to properly tell PM core that suspend to RAM > isn't supported. If an error code different from -EAGAIN or -EBUSY > is the way to go, I'm good with it: I do share your concern and I went through the Documentation but I did not find a unified way to tell the PM core the feature is unsupported. By grepping code, I realized returning -EOPNOTSUPP was a recurrent alternative so here we are. I also considered -EBUSY but it seems more like a "I cannot right now" and -EAGAIN which is more a "try again soon". Anyway, no matter the error code returned, I'm not sure if the PM core actually cares? > Reviewed-by: Vivien Didelot > > > Thanks, > > Vivien Thanks, Miquèl