Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1955449imw; Tue, 5 Jul 2022 19:35:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXf+1g8YvRZlqAo0nXx/UjyhfyCWJM0ZAv5OjfdpZy6sEMDoYW2Z3NavxQ8nrl4T3XZwAa X-Received: by 2002:a17:90b:1d88:b0:1ec:d5f6:f141 with SMTP id pf8-20020a17090b1d8800b001ecd5f6f141mr49323360pjb.119.1657074935275; Tue, 05 Jul 2022 19:35:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657074935; cv=pass; d=google.com; s=arc-20160816; b=MtRC2xetukKbc3ogtPnfWiX/nFC3KED2WCdf1soCJcIgG4oxhw0/17YVT4I+XFs4EV 5cFb1978YkNJiq4F7Yv2mW6PIy1pVildLIZmatpDw0fl5M9j9huKrxpFY1vPOUF5STDE vJOqFgnuVeG+DVlmwsnPycwkgsnk6f9tjP0yJ9YNInlsrUBzMcWF7SdArsyQNwitBSIx 0XZ2HCwS40YcmSimOkwfKWbOZV7gkIgiKTc5hTgd3lviJWbhleyf+bbfAsjzZiHqRzWK EnfbycdXb0TH92OTaIbLjqv9qpldfim4PX68rhYtQ6saQEIR2ELcJC8VMm+dIM9sk6CQ FkQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KmTQ9XLotVw8W/6aqe9ZBkXzMf4rPOa/Wc6pkvS/kV0=; b=PZyGUS2SfA8DYKgs8GTwTTP3SBjp7FU1J31jZAFXn4KUztJsSiYrvJmbUeTrD3QrFd Ye3wFtB1PZ8fEj65sQUnA1sCYWb/Tww/fxHgIviSQaW4wrhCK77nZoMTnmW7cU4AoLab F3ThAvRZCPToAGBqVTfSjAb917uiBMPRZmn3iJgC1HHkL2kzJrPt9vcVXJXafHhSz/Te kVM50O8kYrY/TcUXIRYx44XqUc6J8ElL1ZwILYUm4LDwQRoA1Qn2/CjO3Bm775swsI0a DDK5R7C2HkjLYuR+DCdYTyes6Us+isk0mWhj6EDXgxtlbyqGsd5Y6NkIqVmmaafpFaeT XgAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b=UIXpFkEX; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170902ea0e00b0016a38086f4asi2396490plg.297.2022.07.05.19.35.23; Tue, 05 Jul 2022 19:35:35 -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=@Analogixsemi.onmicrosoft.com header.s=selector2-Analogixsemi-onmicrosoft-com header.b=UIXpFkEX; arc=pass (i=1 spf=pass spfdomain=analogixsemi.com dkim=pass dkdomain=analogixsemi.com dmarc=pass fromdomain=analogixsemi.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=analogixsemi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230362AbiGFCaz (ORCPT + 99 others); Tue, 5 Jul 2022 22:30:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiGFCax (ORCPT ); Tue, 5 Jul 2022 22:30:53 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2090.outbound.protection.outlook.com [40.107.93.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1FB914D30 for ; Tue, 5 Jul 2022 19:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0CT6qPuuRwZWKDq9ky7FyTpvPGYl53u57MRCgqkfdAFe2CvFTF+nJfQPWT8nUSr2WkAtZXobT1mPRce0S27/J+4p1fG0vFD60P/ZSZIsB0g+ookqwqifMHwE/Ou7v2dmpsNWgi+BpQ5feMiSyFADHi45ISA0gAbV705j4Q0DOYRstxIlLgu+E78fH2mguEpFX2UgwYdDn/teBYGC9ecSpoVAg9OR2dzV1fzazkiQxxNpgc4W8KlnKLkAbHQhlwnpBgqVO/4Uo8ePMnOQiLLhJBmC+/Agw+yps6wjb+nCYTwoUaUOmhGo7aTcntVc7bHbz513oyUpEbdu+hOZfSwKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KmTQ9XLotVw8W/6aqe9ZBkXzMf4rPOa/Wc6pkvS/kV0=; b=Uj9evLMdAQfhVIygrxL8OCUdGLNhu5U+h0JuNlLeQ9ZfpVQQnhMguUTlaWRt1UljN3Bu0rZ88MSG20/a0cvxocyKjh2Vw/fSZAK/FadrOviTNQHhTbF4iWJolkitFO7FeT4+uD3982dcUwGMUJqBlixvXrVuv+d+OsEucG2sgIO5RBcYjUkrpZPE9++YXyZmnwsKTQlr7IvemJBH7V0hoscGLdO8d/nZ2yGc8WuKYI/IV9OqRwp+2y2JQBkRDoXbBGEJjkZIREVS6QrthIWz+Ykt1mN3QB17UmYGySyftlcMYNi1k2mHGjdu/ebIZhS1KVb1kbI5TKcqzSkDuCfwfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=analogixsemi.com; dmarc=pass action=none header.from=analogixsemi.com; dkim=pass header.d=analogixsemi.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Analogixsemi.onmicrosoft.com; s=selector2-Analogixsemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KmTQ9XLotVw8W/6aqe9ZBkXzMf4rPOa/Wc6pkvS/kV0=; b=UIXpFkEX75a2N2e3X4WAN+27N1n+QLKoKKPe3DUbKZTjLsltVPiMm+sP/odI8xpypydAgSv5J57UP6lZI2tszRTx0eBVT4CiZqLYQRDn31/WjeuwVy/qoGR4C6hLktjgnHdWttJCXWQSJg1YGdTv1i4N6dDbFRiXpatQJnWKNkY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=analogixsemi.com; Received: from BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) by CY4PR0401MB3523.namprd04.prod.outlook.com (2603:10b6:910:90::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Wed, 6 Jul 2022 02:30:51 +0000 Received: from BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::ec96:5112:c2d5:9377]) by BY5PR04MB6739.namprd04.prod.outlook.com ([fe80::ec96:5112:c2d5:9377%8]) with mapi id 15.20.5395.022; Wed, 6 Jul 2022 02:30:44 +0000 Date: Wed, 6 Jul 2022 10:30:40 +0800 From: Xin Ji To: Hsin-Yi Wang Cc: Robert Foss , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Sam Ravnborg , Thomas Zimmermann , Maxime Ripard , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] drm/bridge: anx7625: Use pm_runtime_force_suspend(resume) Message-ID: <20220706023040.GB2357796@anxtwsw-Precision-3640-Tower> References: <20220629160550.433980-1-hsinyi@chromium.org> <20220629160550.433980-3-hsinyi@chromium.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220629160550.433980-3-hsinyi@chromium.org> X-ClientProxiedBy: TY2PR01CA0024.jpnprd01.prod.outlook.com (2603:1096:404:a::36) To BY5PR04MB6739.namprd04.prod.outlook.com (2603:10b6:a03:229::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 252a6ac8-868a-451e-aa53-08da5ef7873d X-MS-TrafficTypeDiagnostic: CY4PR0401MB3523:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dppION7+0e5SZadecL4vq0IitaFK4NqUgkbnrO0zllDJ7tcA68jqy9HF/66gieCGUltHbWEj5Jn48beGwdrRzHAKeViUOI6376I2FWoM1EVlhcSyOAVj+qZZJA88wn544Op/ZBzYCY2a8Rf811aPYyly3Es+g95VQgCITbMy/zsDDvRPkwNqpkYCRw+SmajND+nRcjI00PHwSksWnBOT6J+wwad2ceswHrQmsRAeedFDIVRHqi1XS4ehqMN1ks+T9nilrKID0li1DU/2klrbAVJX+DEBDgF8y5EDHmg8uzehYWdryjC35cqwL5L5g8N3CLUGx91ANa21rqlLd6zV0Pmxy+Oo3xx2ymhwpL07I+TNHdUI6iDuLOF3bsh646K0WkZTlSlBfsrg/198hBJGAqUDO3Hxosci131oMzMJpOklm1n4AuYt1r0gm5LK+IMkaX2IhhSiIqWU0zoES7GzW3Fx78wdUbWeLchOaQmS/C7Fy3Wq1ES12OY1vrKLO9h+WzsdocFkyUCGYUeflq8Z3RyjqgyepIvcxe/Qf9OT+sCVpFeRzd3RL5nxbZizrpA8JVt6mcH37PXR3AnRylq3HnAi13QpJVpAnXDsxV2mBT0JMgUpL5eZyBathLLOo6QN3Cl7DgMNstVR1XSFQ+/W+Q4C/xK1SelY57RoaUkFfzDYsG6HQw1se/JN/vWq1uB8qszx+DD9dIsOqZo0wZqieI/10GW7MUXlQisGCjFr0b9qLCn+ihtq7TxoZ/lb4sosNZUSIFxaXlkuzsBiJcPUKrLeNL+IkEGX3SSep+MsyNSuw7bBnx/crWK/ZCLk857B X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR04MB6739.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(39840400004)(346002)(376002)(366004)(396003)(136003)(1076003)(186003)(26005)(6916009)(6512007)(9686003)(54906003)(83380400001)(2906002)(6666004)(52116002)(8676002)(7416002)(66946007)(55236004)(316002)(41300700001)(66476007)(6506007)(66556008)(33656002)(38350700002)(38100700002)(8936002)(5660300002)(33716001)(4326008)(6486002)(478600001)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YBL0MKwaQ0tfdyPE0eZY730+uOEXrbSG9C4hCe+FxXPXMJx+VLq8xFildcbp?= =?us-ascii?Q?ysC+V1/l0+veVmyBgvQMRtQgeVYgrs/dwA9Hc6bJHmik50qh4C9kQnIMB/sU?= =?us-ascii?Q?HV5IvvbXt6WIsyhT7NK+mCS9w+ggfzQYGtaVhgnYEQMMthSE2QLHp4QNqIfh?= =?us-ascii?Q?kNLsZm3LsF+WU7eeWtsnfY4eVJmNU7cerwDukroD2RjHEj7W/3bFhAcTr5KH?= =?us-ascii?Q?v5MIYD++B2Tx0aKugg46sLQOlRvKYD4RfQLy8uokEvF2BReC+bVgLYsRpNP9?= =?us-ascii?Q?725I3tpnep41eku911pXHZAJFQoOcG9npNhTEA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xlNLNYDxqlbXNzSPlFsoGO0dGtRysn2FZZMjpf+QeACbbH?= =?us-ascii?Q?Gu/iRljcBAbxDPZwgv2UzcIvXFMa8ZeZfKDtd6MC23MUzNxfia9MeE53kcR1?= =?us-ascii?Q?JR/9/QgiU9a5Hl9FiMTLct8wQJWlunbIyYw0vqx5uxNC4NDnyT/UFYOaUhty?= =?us-ascii?Q?AcX+6U1gA/+9+BKia3BL/oCisZKH3T0ptmfCRUkamIKXvJHp60lLx4wSTTEu?= =?us-ascii?Q?9Be5ZlVavvqYUzf7YmDAQz2SxNE+MBh90QSKIOZKMqggwXj3FX3/D18QC0FP?= =?us-ascii?Q?3cVrqgN+mDH6CkZE15E0w8xHt+0cgEyBcOcn0QfalrBP19vkVdg6Adi7+NwY?= =?us-ascii?Q?2IcAswM/hh6ZXgooJcuD11kRR/UkTb9X0R7s9MzJ?= X-OriginatorOrg: analogixsemi.com X-MS-Exchange-CrossTenant-Network-Message-Id: 252a6ac8-868a-451e-aa53-08da5ef7873d X-MS-Exchange-CrossTenant-AuthSource: BY5PR04MB6739.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 02:30:44.7757 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b099b0b4-f26c-4cf5-9a0f-d5be9acab205 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rJTh9VXihIwsmvviq8Igmi3auvP3kW95orjwof8DK8/6FIANy1q4VeHdh3YWpCwyiMOIRDDSl/68c60ecWL+/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0401MB3523 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 Hsin-Yi, thanks for your patch, looks good to me. Reviewed-by: Xin Ji Thanks, Xin On Thu, Jun 30, 2022 at 12:05:48AM +0800, Hsin-Yi Wang wrote: > There's no need to check for IRQ or disable it in suspend. > > Use pm_runtime_force_suspend(resume) to make sure anx7625 is powered off > correctly. Make the system suspend/resume and pm runtime suspend/resume > more consistant. > > Signed-off-by: Hsin-Yi Wang > --- > drivers/gpu/drm/bridge/analogix/anx7625.c | 33 ++--------------------- > 1 file changed, 2 insertions(+), 31 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > index f89e8151475f7..478f5af381c7d 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -2504,38 +2504,9 @@ static int __maybe_unused anx7625_runtime_pm_resume(struct device *dev) > return 0; > } > > -static int __maybe_unused anx7625_resume(struct device *dev) > -{ > - struct anx7625_data *ctx = dev_get_drvdata(dev); > - > - if (!ctx->pdata.intp_irq) > - return 0; > - > - if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev)) { > - enable_irq(ctx->pdata.intp_irq); > - anx7625_runtime_pm_resume(dev); > - } > - > - return 0; > -} > - > -static int __maybe_unused anx7625_suspend(struct device *dev) > -{ > - struct anx7625_data *ctx = dev_get_drvdata(dev); > - > - if (!ctx->pdata.intp_irq) > - return 0; > - > - if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev)) { > - anx7625_runtime_pm_suspend(dev); > - disable_irq(ctx->pdata.intp_irq); > - } > - > - return 0; > -} > - > static const struct dev_pm_ops anx7625_pm_ops = { > - SET_SYSTEM_SLEEP_PM_OPS(anx7625_suspend, anx7625_resume) > + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, > + pm_runtime_force_resume) > SET_RUNTIME_PM_OPS(anx7625_runtime_pm_suspend, > anx7625_runtime_pm_resume, NULL) > }; > -- > 2.37.0.rc0.161.g10f37bed90-goog