Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp894178ybh; Wed, 22 Jul 2020 16:29:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBOxWvpwd9vCwhpaA32Cxwvv+OEFxJLZtqJPdhbe9Z4KLnH0Xgvh3eAVvQibwA1zO+i5AO X-Received: by 2002:a17:907:405e:: with SMTP id ns22mr1839251ejb.6.1595460544928; Wed, 22 Jul 2020 16:29:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595460544; cv=pass; d=google.com; s=arc-20160816; b=IqBQ1Iv4NAc9X3swgDG9gXEQbldXQgvCxbWJlC9vl5c/mq3n4IOX6DYRHBmjaaKR3c ObxghJogb17YNWD7onXsjzf5xe40eHueOiBDUqiTJ2oZ+Uw5evSWbev6+Ykz8YagPKqm OGU3WXyMSmXXvp7muM4vdkVy8oKvArmAf4m7a2QrHTbLlLYKPgMlxctYhldUXYbVpAyM BeYiAXvTmymgjPZMkEyoro5rQIAX1zlqzI/EAIfyOxvsM1COZAGaDkYIPQfBTVPpaZ7p Vy2Cp+IvGqz+NprNHQujtWuHRvdYH37aeJpl8avMsSPNFR0qi52QiEHus0itwjvzQnd9 WnuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=o88HONAvYczZcYSNTG60tYJIGieR9ZY/CEg/UWL1ePs=; b=0q8Z0BhYcgiiwyO5Ba0utEnvp1+G3oWKiW25FN1psInShgFgOnSF1I/d84QtOoZAKl k/F/mwxNW4KhxrTHSRDQ0GBzxJKun6oHoByHDp1ZaNMKm7ywInUueUvveG3uIjm5jFoD TNXt2V45QuPfu15dsA7sVlHxzTELf5km0l0csCUsDsyJZUFRwt2FppB2qzJ1vucYeyui V7nYzgriwXQN56DJoTL4Kc+s1EoywNo1WpIr/IwlsTFQ+Cof/1C7CVh8vfKpkQikjckP w4s03nw7RD0REhfx6utkHENitNmWHTamkSA8ol7ry1oYNE9EwzAT6K07iC65LvM3p1Ye AdVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=Zh4ahZeL; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr17si1243799ejc.520.2020.07.22.16.28.42; Wed, 22 Jul 2020 16:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=Zh4ahZeL; arc=pass (i=1 spf=pass spfdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733157AbgGVX0R (ORCPT + 99 others); Wed, 22 Jul 2020 19:26:17 -0400 Received: from mail-eopbgr770042.outbound.protection.outlook.com ([40.107.77.42]:22925 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726447AbgGVX0Q (ORCPT ); Wed, 22 Jul 2020 19:26:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W293ufAuZSJg9+kKbMpeKdgWb+Eg02bknTLf5jtfxxybeA5OUbfmoLd4R0C1s8L2AtMSa5dRdkWP9GOJQwwKTu/qq1aV89ru9tFwU6ZzAMmbnOULiHvGHxEYoC1hyKBFWdSZRlHO1BaNAa7jMjPOXgRTMFdvijWb0/ewiu870j+ELmduIHjHy5Rxv7hJtAu61K9OjsWF1KIaXizLCaBpWs0m+00+nYUem0kz/DmYBzqGAAPbTBA9zpNZ78xb2KWV0US5i1UqRrKHmjOxsKyoQ5OG3XZHEFxRTjXIln1rtGqAQY1LA1pCqXllQkielJwEd5gyOpVyirSXGkNDC8Zpqg== 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-SenderADCheck; bh=o88HONAvYczZcYSNTG60tYJIGieR9ZY/CEg/UWL1ePs=; b=EOj/Vb/np7eyy3/UvcOqwNGDDKc+YnlzGZ3tSS1dOVgHpW4KLNeW/XFqqNgr4lRonOzZPTvcGdgsieopCQFHWrSGRqRQWL36JPJCZerjK42eIFHZsW4IFqwjEVdwUjuHOuAUizjmCASVn5KkFHhIhgi7906YBl4yEFPP9peZCstZczGm3TWh9KB4QYBeoijV9fjwIGudomfldr89pceIDM1E/f7wZSTuWRRviWH+6ZV1K32OqBoNeCFQDy0P7hGXMDjMcskwk+x5GCtbVzIXjjTCDezRKqka29WawHUrDECl//CguwxGWKTh6v0MwSzVwkMIc+uUe1IthEc7L/bHag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=linaro.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o88HONAvYczZcYSNTG60tYJIGieR9ZY/CEg/UWL1ePs=; b=Zh4ahZeLiIvMtYOj8EWQJbIXqhH5oGjUa48+gHhxGdQJWoE0jFaxelDJF8HFc/tC/dmXAn9XpvLDtR8OE7OtOoZkkuwgw+vZ1YkOAVgJ2jcihQCnYGATWdH6yumotIKnuX3L6Mh+wlFLx6NpmY+hJ6ZCVixgMvJpZBhKEB9rXSc= Received: from MN2PR18CA0025.namprd18.prod.outlook.com (2603:10b6:208:23c::30) by CY4PR02MB2279.namprd02.prod.outlook.com (2603:10b6:903:a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21; Wed, 22 Jul 2020 23:26:13 +0000 Received: from BL2NAM02FT024.eop-nam02.prod.protection.outlook.com (2603:10b6:208:23c:cafe::61) by MN2PR18CA0025.outlook.office365.com (2603:10b6:208:23c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21 via Frontend Transport; Wed, 22 Jul 2020 23:26:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT024.mail.protection.outlook.com (10.152.77.62) with Microsoft SMTP Server id 15.20.3216.10 via Frontend Transport; Wed, 22 Jul 2020 23:26:13 +0000 Received: from [149.199.38.66] (port=33167 helo=smtp.xilinx.com) by xsj-pvapsmtpgw01 with esmtp (Exim 4.90) (envelope-from ) id 1jyO5z-0005t0-Q7; Wed, 22 Jul 2020 16:24:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jyO7o-0005fc-VN; Wed, 22 Jul 2020 16:26:13 -0700 Received: from [10.18.5.8] (helo=xsjamitsuni51.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jyO7k-0005e7-Mh; Wed, 22 Jul 2020 16:26:08 -0700 From: Amit Sunil Dhamne To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Cc: rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tejasp@xilinx.com, jollys@xilinx.com, Rajan Vaja , Amit Sunil Dhamne Subject: [PATCH] drivers: soc: xilinx: Call InitFinalize from late_initcall_sync instead of probe Date: Wed, 22 Jul 2020 16:25:51 -0700 Message-Id: <20200722232551.29549-1-amit.sunil.dhamne@xilinx.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ff19ef54-f700-4dfa-0ec9-08d82e969fc8 X-MS-TrafficTypeDiagnostic: CY4PR02MB2279: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: viiACrkmksHhrJVvU/VeEvwWEfDyzHJ4PPiPIeOTU4ZKOOKhH1nCs4AXU+uuY3E4krFaFTBsy4abrUxbuMfEw2qch4EEbqkq2+mCEgEAwGC/b4OzDh+WRdpZCM7XOJMyEjIAZ88xOqYv/fteKLKyQUekTVfhISwcBFdkwOK4iTocG5LUhIduRDQP/z7aTc/MBhLd5DUQiIHzpBdVvDfRiEHviiAS/2xMs0RKiui2R5jfD8UhBAvtmS36bsmMx3nMw0kVyb6tDIt0Hj6VZaa7FGY1lSYAzTsiHoa5oli6wam/x0uXyyHsh9eirdhk+RaCTY9WFQbUcJ+t2X5G+CJCIAaGOTP0fEbaBZlI1EhVYIIad63YtwFDdWsZmyxgpkPxoo21iS6ViaI9Sf5l8UdTGw== X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapsmtpgw01;PTR:unknown-60-83.xilinx.com;CAT:NONE;SFTY:;SFS:(396003)(346002)(39860400002)(136003)(376002)(46966005)(82740400003)(47076004)(336012)(36756003)(478600001)(6636002)(7696005)(426003)(107886003)(81166007)(7416002)(316002)(2616005)(6666004)(54906003)(1076003)(4326008)(82310400002)(83380400001)(26005)(5660300002)(70206006)(70586007)(186003)(103116003)(9786002)(2906002)(8676002)(356005)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2020 23:26:13.3455 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff19ef54-f700-4dfa-0ec9-08d82e969fc8 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-AuthSource: BL2NAM02FT024.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB2279 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajan Vaja Initially all devices are in power up state. Firmware expect that processor should call InitFinalize API once it have requested devices which are required so that it can turn off all unused devices and save power. From Linux, PM driver calls InitFinalize to inform the firmware that it can power down the unused devices. Upon InitFinalize() call firmware power downs all unused devices. There are chances that PM driver is probed along with or before other device drivers. So in that case some of the devices may not be requested from firmware which is done by genpd driver. Due to that firmware will consider those devices as unused and firmware will power down those devices. Later when any device driver is probed, genpd driver will ask firmware to power up that device using request node API. So for those devices, power transition will be like on->off->on which creates unnecessary power glitch to those devices. To avoid such unnecessary power transitions and as ideal behavior InitFinalize should be called after all drivers are probed. So call InitFinalize from late_initcall_sync. Signed-off-by: Rajan Vaja Signed-off-by: Amit Sunil Dhamne --- drivers/soc/xilinx/zynqmp_power.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_= power.c index 31ff49fcd078..fa05cf12d5f3 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -178,7 +178,6 @@ static int zynqmp_pm_probe(struct platform_device *pdev= ) u32 pm_api_version; struct mbox_client *client; - zynqmp_pm_init_finalize(); zynqmp_pm_get_api_version(&pm_api_version); /* Check PM API version number */ @@ -246,6 +245,13 @@ static int zynqmp_pm_remove(struct platform_device *pd= ev) return 0; } +static int __init do_init_finalize(void) +{ + return zynqmp_pm_init_finalize(); +} + +late_initcall_sync(do_init_finalize); + static const struct of_device_id pm_of_match[] =3D { { .compatible =3D "xlnx,zynqmp-power", }, { /* end of table */ }, -- 2.23.0 This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.