Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2508577lqt; Mon, 22 Apr 2024 12:44:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5roKqKla1EEVz9rdKXOPShs+k/i1tMcjCzOAY8RmggA2RHJut0KNpzMvvA86jBV5UtMMHldxd/vBgZo62IgSf5xe6NiJ8mYSeq04tEg== X-Google-Smtp-Source: AGHT+IEcY2w/ytOJyRConl0RvXh+50NN6EfgJH6CNuAkcuT9/2B/EG5ygLTaFpOS6+dWfLwYTVyP X-Received: by 2002:a05:6a20:1ab0:b0:1aa:6100:3a87 with SMTP id ci48-20020a056a201ab000b001aa61003a87mr8529657pzb.39.1713815087652; Mon, 22 Apr 2024 12:44:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713815087; cv=pass; d=google.com; s=arc-20160816; b=RVJotyEAwRGmdCRcpyAnsPZkHqF/61M6TIhT2ZaM6OpSsDtYHsuIMW1lDcMj3kGDY0 mePfBDHe0N4A9v3yL0pnpruK1EeoXO3BJ4zmbAoiJPSae+xLI7I+8+MOiCcuYoe2bKrh BhSpjnO3MGLQBlTOMcd1KcDKuE1bibakl+ei0oUK3U3ukr16RXZulTRnwLGizjDiifAC j6CBQ9BRdMzX10y8RGAvbj/qLzyrOwDnvT/dTvI9V94Nt9gaVx2Mi+pLjM2MRVx0DVHx Q4tfxgvGiUm6rsrTJ7ni3zV6hOjob75vGAfb3/w6oGHcqTzlu5Fwl1t7y3yWCMQY171I he4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=6IkndEK8dTX+Y9Av0adoEz3HD2GQpuIN1x1p9aPlsKk=; fh=zN8JBCk1CgZrzHIab43SSACR69fRWRda/HGtP/0x/gA=; b=Ee8j6NrDOgFSdBwey6s9ULF+eoCMuLYZafLXQ7YPgi94YPuyoW/UM0zsUO+KFP/VHf gDT1cSTDpU9R/h4xgAFDpAq3GSLBjauG4HmBFfQmZDy5mE1IJq1p80D6CY8YaCS1hrL4 iMeZEMsKeRYWLXfXZZM3iX0EfLt0d7QixgyvzFl58cJpF4c0DXiO+W1qmgE/J7Dq1RCQ 8y4kwU/3pUSHFrbJ40AF6zEVwHkb5FRNQ2kf83OpArM2vL3pwDFHqXiZmGtKMsQ1fKOL rzUlGFAkZQkPThH4OuSp8PyiNATNlmun6BAuRlUikYGDAEDoup31n+JZmw48aaR3HiDB lgjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GMBO7gB5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-153932-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153932-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bx7-20020a056a02050700b005e83f4901a7si8620392pgb.457.2024.04.22.12.44.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:44:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153932-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GMBO7gB5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-153932-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153932-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4327F284892 for ; Mon, 22 Apr 2024 19:44:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDD1F155398; Mon, 22 Apr 2024 19:44:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GMBO7gB5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D33C315534B; Mon, 22 Apr 2024 19:44:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815066; cv=none; b=BLJDJmjz1aQPOqu9QNa1jl/doFa8CHOhbkn5j6tTOV9bB2IGv4TKtzglej6QTqVhDl6Qg3UIX7vMjqm53HmLErfUGGEwM3K+v8g99zeOe9MuezuLIFARkmfvbueG6NOOEeN9FXxyAVmePaPKQnPbgG+U+O4CUtjwW8QzC68KMtE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713815066; c=relaxed/simple; bh=K8WN8aubdBUdpq2B/uKYg69yANymGJsXmW3941zGW1s=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=FpqNPGh4lS60cKG1o0KxOtSbPzII9X57pTfHsri2bQSjENadhInjyIjD+aBRSWt/XkxQ56M2NaigrhbKaWmx5Vv4U+eHh/fRc04FODHLyy4/9PKk5FNCWXsVeXceAHsAVejfs4bW7ICCxk6XHmgBtxDWxkgCI2UJrbKTFFlpYOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GMBO7gB5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CFF1C116B1; Mon, 22 Apr 2024 19:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713815065; bh=K8WN8aubdBUdpq2B/uKYg69yANymGJsXmW3941zGW1s=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=GMBO7gB5pjdjM0klxQpfKSPZbshoJO0PuGP/01h9ETcM6twO2atsJALTuh+zPMT38 OtIGcuxHm2VtBWIzQNCoiOMNyr6zdoObSloYFSjblqoLnbRBLQXjyFlp/OFQ+DdYNz r6xb2t/OSk2DG5KCgZYH8sfUy7ppbw0o/lBI58Smy+QewkeKumlPSw6Ki3qLI/0N5b 26Z1hij8g8+RVqSYAYIBmo0mSuJzKVsGpo/T+n8iYgIMTk11Gw3d635aisJOwmLND7 xpQXKqIB1Q9fvJRrIL+yQyZKoPijFAg9rBtf8C8dCm213am27yKB2DXaIo5mkWT88r 8yKoVYGpWI2Ig== Date: Mon, 22 Apr 2024 14:44:23 -0500 From: Bjorn Helgaas To: Thomas Richard Cc: Andi Shyti , Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Aaro Koskinen , Janusz Krzysztofik , Vignesh R , Peter Rosin , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Siddharth Vadapalli , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Wolfram Sang Subject: Re: [PATCH v5 02/11] i2c: omap: wakeup the controller during suspend() callback Message-ID: <20240422194423.GA414623@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Apr 22, 2024 at 11:40:02AM +0200, Thomas Richard wrote: > On 4/19/24 10:47, Andi Shyti wrote: > > Hi Thomas, > > > >> +static int omap_i2c_suspend(struct device *dev) > >> +{ > >> + /* > >> + * If the controller is autosuspended, there is no way to wakeup it once > >> + * runtime pm is disabled (in suspend_late()). > >> + * But a device may need the controller up during suspend_noirq() or > >> + * resume_noirq(). > >> + * Wakeup the controller while runtime pm is enabled, so it is available > >> + * until its suspend_noirq(), and from resume_noirq(). > >> + */ > >> + return pm_runtime_resume_and_get(dev); > >> +} > >> + > >> +static int omap_i2c_resume(struct device *dev) > >> +{ > >> + pm_runtime_mark_last_busy(dev); > >> + pm_runtime_put_autosuspend(dev); > >> + > >> + return 0; > >> +} > >> + > >> static const struct dev_pm_ops omap_i2c_pm_ops = { > >> SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, > >> pm_runtime_force_resume) > >> + SET_SYSTEM_SLEEP_PM_OPS(omap_i2c_suspend, omap_i2c_resume) > > > > If you don't have CONFIG_PM_SLEEP, though, this doesn't compile. > > Hello Andi, > > Yes indeed, the __maybe_unused attribute is missing for > omap_i2c_suspend() and omap_i2c_resume(). Isn't there a way to avoid having to use the __maybe_unused attribute? E.g., use DEFINE_SIMPLE_DEV_PM_OPS() as is done by these: 82f9cefadac4 ("serial: 8250_exar: switch to DEFINE_SIMPLE_DEV_PM_OPS()") f243df0a0be0 ("media: platform: rzg2l-cru: rzg2l-csi2: Switch to RUNTIME_PM_OPS()") 6ccc22a5afcb ("net: ravb: Switch to SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() and pm_ptr()") Bjorn