Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5252975ima; Tue, 5 Feb 2019 08:41:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IalvD4CM55NA8JIvcfwHkdVtjX8La0jx1ZAMYP1/3HNRXxrY9fjLTnL9Vj/kVi1O367A3i+ X-Received: by 2002:a63:2a89:: with SMTP id q131mr2068898pgq.216.1549384913869; Tue, 05 Feb 2019 08:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549384913; cv=none; d=google.com; s=arc-20160816; b=DJU9R2w2CXnF/1B4+cM9UNXkRJ03qSnFWj31PA5Q2pvpcSGcrvbvrKyregAeTHWMMR +9ZjRIrTE+c+XxBjD22du9ePOcNYDA1kzIomoxUUTJmYn4MyeKImiHQPOEQ1cJS3YoHr EKbvfFisvs0DF0VKmXCG3hJwFJIe7Lm3+lU48Y+MIGYKlNPabcFip5lGwxjo1jJPah3l e5EDPXZMuAdRUIi0t2mRCbaHhrDBxhBdwTZGeTEOvMOFw5AAG9QU0m10fbmt1rt8rAnO m0l2zN/FFH1P3VOsTgIB5XT3il8pct0yqWIsnQqueAMPm9nTW+l6sL17UmqR0b2EGkov ArYQ== 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 :content-disposition:mime-version:references:in-reply-to:subject:cc :to:from:message-id:date:dkim-signature; bh=HjIkJD3qTvEXKFWD+xgGyJCRFRHNQeOjkCOjAm2uAvk=; b=rtBNjJfI7hXHYFZehVP8HpBfZ3HT41AlvmjgNxa/ve00fwTpRfEN80dn+hAHNDpJzn o3XpDLzafEe0Vyj6xYx9tRAvcBC0jXrvhsyuMCDmtSXqQlPrRP9HIKHMyk+6v8RRoNhY pwL4GVLk5akB631vN2K4toqDPfxe3tUk4CgVbSrr4stKMolJGNPzEyMPZTrtNpdDTixJ CgQK7GKEieadHiCc7GtWeQmBF7MzMWDPkmwoESrb+Zg17b7LCLJCClHPPQh5r1jwcXaj /UhhdYeK2r+aOq2wJPS0u5gw4GKB52X2PIdk4kYPs6QpGsIWyAo6hIz+VHcepcg3O1Lw e84g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="vOQ28/1g"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh5si3490777plb.42.2019.02.05.08.41.38; Tue, 05 Feb 2019 08:41:53 -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=@gmail.com header.s=20161025 header.b="vOQ28/1g"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730568AbfBEQ3B (ORCPT + 99 others); Tue, 5 Feb 2019 11:29:01 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:39220 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726456AbfBEQ3B (ORCPT ); Tue, 5 Feb 2019 11:29:01 -0500 Received: by mail-qt1-f194.google.com with SMTP id u47so4468458qtj.6; Tue, 05 Feb 2019 08:29:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:from:to:cc:subject:in-reply-to:references :mime-version:content-disposition:content-transfer-encoding; bh=HjIkJD3qTvEXKFWD+xgGyJCRFRHNQeOjkCOjAm2uAvk=; b=vOQ28/1gFg7uqq/DRwzRsWTY2BP0SCFDCx3KiU5YHqBYzl/O/z6IaVcUtN+WGJYMhN SNrT8forxxjhSC87GtG+LOb+EJOYcS1IEv0K85wXtuGhDeKsBZSq/bzIN9olbWXviwBs tl2+6TtNEEsOdfYdpmaG7ewhpdCB33URg0+bgwtpOFOUgKZdhl3MKj9LOfS/yle3fuXz ihRoKB89S7Lh+81pIK2CsXl7TJQvMiebImNBKUfmlxRE7xGA/sumFDrgmohAHmvOSjX5 Yw/RtV2U7xsHYLYv3bZdIP3fyQbnbGAZ3EPGcYhT6/MBdlxQSuLWr4cd5W3+Ado5H2Vm e2qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:to:cc:subject:in-reply-to :references:mime-version:content-disposition :content-transfer-encoding; bh=HjIkJD3qTvEXKFWD+xgGyJCRFRHNQeOjkCOjAm2uAvk=; b=j5MIghn6w2jxv+lSnqslxWxx9TTqWU8gPgrIwBYYzcP8OId8NB/Xje/XFAPw81GZ64 RR1ZN5zJObkBojUJzmb3/MaQn+3vL4/PK6LxayPFkiHkxRf7ej+pNEm39+/lpdn70Sdj jQ3S5h2Q2o2YpN/fOdG2kf2vnIa9nVMHc2FrTkaMDct+md8K//KNBua+ziFJS1LNofph x7MZT/X1twh4X+ym+k2EgJ2glSrN49VrjQ30rVhjx4zdopg6Yh2gTD7ZU/TSOe7/T0Dj oKfI8C0uXRnbNlOUjy0YDTBQWhbH74TrwU7WRRZlNL2GhE8E69z1OOmvpvJHHvTkAsQK 71Pw== X-Gm-Message-State: AHQUAuYEzUXQ+kRPLumvvhIvAiPe42kkMhVO8k8OYG9NH35l8H1HP+Hg WLllrb8LxOjKbXgCuN9Y2ms= X-Received: by 2002:ac8:7215:: with SMTP id a21mr4131707qtp.327.1549384139555; Tue, 05 Feb 2019 08:28:59 -0800 (PST) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id 32sm18499067qto.55.2019.02.05.08.28.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Feb 2019 08:28:58 -0800 (PST) Date: Tue, 5 Feb 2019 11:28:57 -0500 Message-ID: <20190205112857.GB13620@t480s.localdomain> From: Vivien Didelot To: Miquel Raynal 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 , Miquel Raynal Subject: Re: [PATCH net-next v3] net: dsa: mv88e6xxx: Prevent suspend to RAM In-Reply-To: <20190205110728.11451-1-miquel.raynal@bootlin.com> References: <20190205110728.11451-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Reviewed-by: Vivien Didelot Thanks, Vivien