Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp349957iog; Thu, 30 Jun 2022 02:00:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sopbsOyJJ688SQMhkpsjrxaEALNoIm3JrdWwqLnxUl6VRzcUw4uPS3t2SV8eqzzHD6SR61 X-Received: by 2002:a17:902:d411:b0:169:2eb:1b79 with SMTP id b17-20020a170902d41100b0016902eb1b79mr14692232ple.61.1656579644241; Thu, 30 Jun 2022 02:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656579644; cv=none; d=google.com; s=arc-20160816; b=YkpuCrlZazeLDZuQdlXt9z1n6eToop5FHBj+Ol9Gx/bmRm8GSYn7gwNfSrtA1U6nAO H7gBQudVLzUYtjuQQF8E5U/PhaDi3k4GZ9Hi0+PgGG08KN2UoSmZupFsGzZRsnEyK0sT SB/HhNP6y1VxP0NhMjKV7bsy3VE4cE7D9ODAMtuxvxS96x69F2KAOGjitSpbV6n1bdFn QKuBXE3A3vpbXfueTCoG+kGclbFk/Ivk4fKIjcS2Q+aGcdNwJr1fD/FG2LsitGfb+CY8 hOCGhcOTS1vaEjPQVhCbxJJRCdKIoS1JcB+DH9IBgihqRthrkk8r3uz/ww9ATPBRSNXm 8mIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date :dkim-signature; bh=8HyTVBLAUfpwlyXYrVPEtcPS7gJ1O8fJkaJWfQT+/QQ=; b=Gvjw8O63TANkW02D40FFr2297Pv5hPeRVBJsKA3u+Zb178QYSggOMEdk/MNumJFqhR BT9RDy2xM382pGvsbH8/0X202ldhkQvY1yQpms6jIhPLxpueHOlAD+t+sHdT1sUGDpPQ QDHP5jfMkqanBd4FjJo4FrrKldmPN22ut9v7GohitU1OdOcNyAGNAmh6f5/uxX9IS5YJ 9O98IyNyTl/Zb7py2h9+qHBGTGTOcVyxASAGeaPyGgCDLSCAGaG+N4UA/imDyxBRCDjQ Uf1xMA2s57R1xsbebodoPSna8xUAxHWw7VSZH6MfuHXhT+sYSOmLxq39ze1/hpEiLXjT 2wfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=ccAzyIa2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a056a00218800b0052532423856si5922077pfi.262.2022.06.30.02.00.33; Thu, 30 Jun 2022 02:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=ccAzyIa2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233582AbiF3IoW (ORCPT + 99 others); Thu, 30 Jun 2022 04:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbiF3IoU (ORCPT ); Thu, 30 Jun 2022 04:44:20 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61DAC1AF29; Thu, 30 Jun 2022 01:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1656578656; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8HyTVBLAUfpwlyXYrVPEtcPS7gJ1O8fJkaJWfQT+/QQ=; b=ccAzyIa2trLv5mLPWTwyQSxfCZ/snogaVMnuutpQPPZrY745ccZqReeaPE1NahngbImc4t 7xy7aRn8cNh2QGYIiWYmUHyNufoE3ZGyP/Iqy4EEU26zBWf7VJHgRdktXI0EjHsuXEIO0n GxpQ1n+TRk6tDIopXVH9aKrDgnpqEBw= Date: Thu, 30 Jun 2022 09:44:07 +0100 From: Paul Cercueil Subject: Re: [PATCH v1 1/1] serial: 8250_dw: Drop PM ifdeffery To: Ilpo =?iso-8859-1?q?J=E4rvinen?= Cc: Andy Shevchenko , Greg Kroah-Hartman , linux-serial , LKML , Jiri Slaby Message-Id: In-Reply-To: <4ae74f48-c51c-cb74-548d-46ff9a9a7a7b@linux.intel.com> References: <20220628214511.37373-1-andriy.shevchenko@linux.intel.com> <4ae74f48-c51c-cb74-548d-46ff9a9a7a7b@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ilpo, Le jeu., juin 30 2022 at 10:41:40 +0300, Ilpo J=E4rvinen=20 a =E9crit : > On Wed, 29 Jun 2022, Andy Shevchenko wrote: >=20 >> Drop CONFIG_PM and CONFIG_PM_SLEEP ifdeffery while converting=20 >> dw8250_pm_ops >> to use new PM macros. >>=20 >> Signed-off-by: Andy Shevchenko >=20 > Reviewed-by: Ilpo J=E4rvinen >=20 > Not directily related to the patch itself but do you have any idea why > 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") > didn't wrap RUNTIME_PM_OPS() pointers with pm_ptr()? I'm asking this > because in SET_RUNTIME_PM_OPS() the callbacks are only created with > #ifdef CONFIG_PM so I'd have expected RUNTIME_PM_OPS() to maintain=20 > that > behavior but it didn't? Was it just an oversight that should be fixed? The RUNTIME_PM_OPS() does not wrap pointers with pm_ptr(), because the=20 pointer to the dev_pm_ops should only ever be used wrapped with=20 pm_ptr() or pm_sleep_ptr(). Which is not done here. Andy: The deference of dw8250_pm_ops should be pm_ptr(&dw8250_pm_ops). If you=20 only had system suspend/resume functions, you'd use pm_sleep_ptr()=20 there. Cheers, -Paul > -- > i. >=20 >> --- >> drivers/tty/serial/8250/8250_dw.c | 8 ++------ >> 1 file changed, 2 insertions(+), 6 deletions(-) >>=20 >> diff --git a/drivers/tty/serial/8250/8250_dw.c=20 >> b/drivers/tty/serial/8250/8250_dw.c >> index f71428c85562..adcc869352b1 100644 >> --- a/drivers/tty/serial/8250/8250_dw.c >> +++ b/drivers/tty/serial/8250/8250_dw.c >> @@ -691,7 +691,6 @@ static int dw8250_remove(struct platform_device=20 >> *pdev) >> return 0; >> } >>=20 >> -#ifdef CONFIG_PM_SLEEP >> static int dw8250_suspend(struct device *dev) >> { >> struct dw8250_data *data =3D dev_get_drvdata(dev); >> @@ -709,9 +708,7 @@ static int dw8250_resume(struct device *dev) >>=20 >> return 0; >> } >> -#endif /* CONFIG_PM_SLEEP */ >>=20 >> -#ifdef CONFIG_PM >> static int dw8250_runtime_suspend(struct device *dev) >> { >> struct dw8250_data *data =3D dev_get_drvdata(dev); >> @@ -733,11 +730,10 @@ static int dw8250_runtime_resume(struct=20 >> device *dev) >>=20 >> return 0; >> } >> -#endif >>=20 >> static const struct dev_pm_ops dw8250_pm_ops =3D { >> - SET_SYSTEM_SLEEP_PM_OPS(dw8250_suspend, dw8250_resume) >> - SET_RUNTIME_PM_OPS(dw8250_runtime_suspend, dw8250_runtime_resume,=20 >> NULL) >> + SYSTEM_SLEEP_PM_OPS(dw8250_suspend, dw8250_resume) >> + RUNTIME_PM_OPS(dw8250_runtime_suspend, dw8250_runtime_resume,=20 >> NULL) >> }; >>=20 >> static const struct dw8250_platform_data dw8250_dw_apb =3D { >>=20