Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3624763pxv; Mon, 12 Jul 2021 23:20:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVDjCjpF3Xj1+Kn++dpPMcvguSKHnFC5Ve1eYs8EEz9xoCYv7e8wtCUT9SDpZYa1G2oSZh X-Received: by 2002:a05:6402:190c:: with SMTP id e12mr3495054edz.176.1626157223233; Mon, 12 Jul 2021 23:20:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626157223; cv=pass; d=google.com; s=arc-20160816; b=AQFmSmtLHUZQ4wkptU8Fwa2+rBBzOXG87HRnlCH+SqD4zLMabTM0ctztAMXcDpDCSC jB7yCMXj5a40B2olInfkNK4WkGiXnt5dBnu2yrFGtUG1LWcyUcuq86hPlHmV0lj95mAA IaadcvgliSQIxl6UzIEcwsVijB2lQq+GZt+jC7vijJnvwCKeVyaoAtzqbhSS47u6NX6u 5Ph/ZH3uGLgNpveNXa4NSLupovWYdB4iVvPZVo3NVhBwrWrACFIXivkEas8jx3K1JhYd drmtg9liudz9FsbxAEXx5w5jZb7i+QTSzjkfYA/WAmBUWosSuJcxMAD++xHCoV98GSWu WsFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:references :cc:to:from:subject:dkim-signature; bh=gQi+819a9cNHGO7FNSWIaP2uSBPyWHer/AW8ZyRdyNs=; b=W3oQfTZBvisMGmAPqnZbCCWpaQmvrjvU5ls04MDrCgUFVgks8IocAKF1LcAeo+7vcn DS3benKnbKkIgd2Dd+Br4WgS+iO1+DRU7065cpJHAblmdpXbqExiR22a/s8009MiUroh gtxZasfh8QabPcXrpIphILOEjVVKGDSBGDNj6dR5BVjKIIQfgVyrelD8I35zqc8XjCU2 MZCXaxbsOEAILAKLWbtgT8pxjAVxZkovOJ7uzCXJRkzmhXpUN+W3rIdPo2MsZOFtzzrL GAgh2ewWvHRBdWy7PFECp5QWjS2qoMdV4O9u97sNbiT4fUuzaLNURKvHGsQvK3Y84Byc ADIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=AnF6SF8e; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df15si16960687edb.542.2021.07.12.23.19.59; Mon, 12 Jul 2021 23:20:23 -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=@amd.com header.s=selector1 header.b=AnF6SF8e; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233522AbhGMGVt (ORCPT + 99 others); Tue, 13 Jul 2021 02:21:49 -0400 Received: from mail-dm6nam10on2082.outbound.protection.outlook.com ([40.107.93.82]:22080 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231261AbhGMGVs (ORCPT ); Tue, 13 Jul 2021 02:21:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H/vnGM5aBzXI60qna2naGYo5g6WPjz7B7Vb0SjvyL4k4xBE7FF1QuYfP1sUEYzVlxEeAep1iYnBWkJnat4KpphTIoGonXrGu5yMIameseuqMzmn00/X5t/TZj0WtCUGPTiFahaMQgQzHsm0PO4mNpA383t48hlPqapa2VFk1fszm9o+QGURsmf6aSFe1iOJOTEk6kZeR4EqNK2M3rcRtAc7WUkeYMcwOnE1m32aSVayLSvBqkARKelU6/RGzWYGnP4d5AvZkiqnTBr4W6lcp8k8VJziyn2vOV+/vfUv4HYhPmuiy3mvdFCckjjK+R8ELt6ySQqdoWBpr6sITxr9YfQ== 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=gQi+819a9cNHGO7FNSWIaP2uSBPyWHer/AW8ZyRdyNs=; b=nXRdEjCWDG8K272sYHQO1dNi/fv8HZsNYH3WFu91Hs2Kd8SrMxSvvAhhxxWmQwo7KmGQqcPQ2b2a9p4YsroYzn5bM5V1r4nAIrlYSKq9geFX+ea4Agb53TdFrEkgxbgP4dhz1rSTDkcfZR56/9Z2NY9A8UNkDpqOpjoYL5691qq2czpBL4I87gHyMe5onHWO03AJTHoA1ksVdrTMke9GXuQv8VaVPuRFX64+fDsba1j5tXctEA5WfHg/ANFMC5In6UxwYwvNyLrY76hTxKx7esugrEu40u9wb+wsXkjGpdQD41hONfp4kQcILIjXfsKfCFh5c3IDlsvFJjbcOba19g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gQi+819a9cNHGO7FNSWIaP2uSBPyWHer/AW8ZyRdyNs=; b=AnF6SF8e0r9szk33Q5iU4Z8tLwN8QMF/241/z91f+onjrZWZnTg9piNdzdqr0yP9sbTi6bzeekwm8f9IFve68Eki4ZxNlRPvLBZ8AJ2VDV5+kYRhoeqn0SLEdNJ4Ag/FqYIp+EmBrYvLHXMHZkE3N1OgShmA5zwyy8/kRXaZ7Ac= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from MWHPR1201MB2557.namprd12.prod.outlook.com (2603:10b6:300:e4::23) by MWHPR1201MB2559.namprd12.prod.outlook.com (2603:10b6:300:e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Tue, 13 Jul 2021 06:18:57 +0000 Received: from MWHPR1201MB2557.namprd12.prod.outlook.com ([fe80::d0a9:a5f1:ca5a:b439]) by MWHPR1201MB2557.namprd12.prod.outlook.com ([fe80::d0a9:a5f1:ca5a:b439%11]) with mapi id 15.20.4308.027; Tue, 13 Jul 2021 06:18:57 +0000 Subject: Re: [PATCH 10/12] ASoC: amd: add vangogh pci driver pm ops From: "Mukunda,Vijendar" To: Pierre-Louis Bossart , broonie@kernel.org, alsa-devel@alsa-project.org Cc: Sunil-kumar.Dommati@amd.com, Liam Girdwood , open list , Takashi Iwai , Alexander.Deucher@amd.com References: <20210707055623.27371-1-vijendar.mukunda@amd.com> <20210707055623.27371-11-vijendar.mukunda@amd.com> Message-ID: <38def9e9-5161-9441-c88a-43b21edfec43@amd.com> Date: Tue, 13 Jul 2021 12:06:38 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR03CA0112.apcprd03.prod.outlook.com (2603:1096:4:91::16) To MWHPR1201MB2557.namprd12.prod.outlook.com (2603:10b6:300:e4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.252.129.29] (165.204.140.250) by SG2PR03CA0112.apcprd03.prod.outlook.com (2603:1096:4:91::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.10 via Frontend Transport; Tue, 13 Jul 2021 06:18:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0837efd-a144-4324-a4e0-08d945c61879 X-MS-TrafficTypeDiagnostic: MWHPR1201MB2559: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rh+Rpo01ndArtDpJXT3KPIyaVbHm3o9xshULJIuHZ32qkqwYB1cI7ENzEE+3wtpBJ+VzIEbswllIgmdjWJBwsDv7tXVYKbLicuJSaHAiD/Ism50EKo35+u2xBYO4yOARbD5voc7J/QH+NO9IV1JvpAiePWr9LnqN+KaYxnULybMYLmVwXk3wsG1RVYRSq7Zyu0JlYr+Plwk7O4giFWsWWAYQTbWnToViTtzkL4CRkAYKUdF9JlT99h/oa+hfDW86qPPEWMWsqY9CEMkkoH4MDH+Mg1+KX/YnnKB8idVuAt7PNUzlswB+y3I06esLTpTqdnKncTOOfXqTtNJ1waiY0G4koDw/H28rmGR2B55eIW8h34vRvCA0LAJOr3kgwUKPB6Il9wzgiPGwp+kR422DTey5kwJTlKc+NsMMtOvxDAMz0Ur7QOCHN2sEMmxS7Pjnmf5ZOnrv82V4aBLdE2Z3AXFoS+gC1AduE9Oc6Q8hqhKHWKwKIVSnHBL8upDajfG1j3JbXCCRzrRCh/r6t4PR6SYBTUC0EdYG6CNxyxsv/nESCfRqwGb5H03dioU6aSK3QzFqF9F0K9N5E7ArlOA2iwUrbs1dzrAlBg5OMlsOgFtGIxUzfppPSpCICJ8IdAwFi7pCHh4MeltpnuNBnLuxlQElkd07iwLejVZkPLhcz2UAsIolYMkkrAHYrikbeSZAqz4LB/yvUpRN35EPuhl1hdTWi768Xy/d81LZrKO3BlM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1201MB2557.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(136003)(39860400002)(396003)(346002)(31686004)(83380400001)(86362001)(186003)(66476007)(66946007)(54906003)(66556008)(4326008)(6666004)(31696002)(38100700002)(5660300002)(26005)(36756003)(316002)(478600001)(16576012)(53546011)(8936002)(6486002)(2616005)(8676002)(956004)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aUdUZmhwaFFiTkJTWThvMzcyOXF3K2czR1dCVHFUUFFWNHpGdmNoanBnUnVJ?= =?utf-8?B?ZjExOWwwb1BIcmM0ZTh1L21TOUU2dGVnMkxzVVBaaXpzaDdqUlB6SXhMUy8z?= =?utf-8?B?SXhLcjZzM2laYVNQRVZ0RXpFbEVaVVRsaThjWDVZM3puZHdmYzM3WWdxK2lR?= =?utf-8?B?enR1c0IxRktjY3FiVHM5SUc5dDJObkwvajdUS0dobzMvQzRzT2FabElYQkxB?= =?utf-8?B?YndaWFBWVHlsdlRvbTJLbytwamZ1cEFZR2F0MEltRXU3WHN4d2RreFNuaDFK?= =?utf-8?B?SjNOWi9xcGJWSGE0QytZcG9vTjFLbVNBNDF1Q1RKbllmS3U5bllhR3V4VWVW?= =?utf-8?B?SlVURW5jRlZCamdKb0ZMWkwzSVpQbVU1YlBlUFdGU1lTRW54MTVZOE5BdGlC?= =?utf-8?B?L0UvdHF6NVRLVndIMy91ay9PTjhEQ1A3bCtLMUVOVU5RNkNuYzc4ZVFybTlR?= =?utf-8?B?cHk1cXJrV1NCektDQUlkNzRHMisxRXZWQ3JYWHlMUmgxREJ2MDdYbVp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FsVW9VZGJ4bGFITUdnRWFnVWpi?= =?utf-8?B?ZDdLdE1YemxCajc0UkVyb0JnbTc5bmtTNlpiVys4OVFoblltY0JacG80N3h5?= =?utf-8?B?NWRvc1g1eWVEWUwrL0ZiQ2JkbWk3b0E0M3h5aElJRmg0ZWZncE1OcysvdEZJ?= =?utf-8?B?NENaTXVWMlh5Ty8vc2ZXU29CU0FjUTVmRUZYSk9tb01teVJLeTEyRXpEUzY2?= =?utf-8?B?M2wyNmRBU1ZSalFwa2dhSDYrVkdNWWFXWWR2VTA4ekQyU3BBV25HbHJRY0Qy?= =?utf-8?B?MG1CRjJtUk9JWXpjSXdkQjBvbWV2Qy9GRWM5NkdCUC83UDZ5ZVRodENsM0VL?= =?utf-8?Q?rrF1+HcRpJnkAtXooLW8ysRrqMHlbeWg3GTRlOc?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0837efd-a144-4324-a4e0-08d945c61879 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1201MB2557.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2021 06:18:56.9530 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5U80zAXyr5UL/fNGnjSciasjJQB5j++Sg6I2kdKi5OSw0R0oGJsx41rr0/58sqh2PZ4fIOUHZXaTqCWbpxoE4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2559 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/8/21 5:11 PM, Mukunda,Vijendar wrote: > On 7/7/21 10:04 PM, Pierre-Louis Bossart wrote: >> >>> +static int snd_acp5x_suspend(struct device *dev) >>> +{ >>> + int ret; >>> + struct acp5x_dev_data *adata; >>> + >>> + adata = dev_get_drvdata(dev); >>> + ret = acp5x_deinit(adata->acp5x_base); >>> + if (ret) >>> + dev_err(dev, "ACP de-init failed\n"); >>> + else >>> + dev_dbg(dev, "ACP de-initialized\n"); >>> + >>> + return ret; >>> +} >>> + >>> +static int snd_acp5x_resume(struct device *dev) >>> +{ >>> + int ret; >>> + struct acp5x_dev_data *adata; >>> + >>> + adata = dev_get_drvdata(dev); >>> + ret = acp5x_init(adata->acp5x_base); >>> + if (ret) { >>> + dev_err(dev, "ACP init failed\n"); >>> + return ret; >>> + } >>> + return 0; >>> +} >>> + >>> +static const struct dev_pm_ops acp5x_pm = { >>> + .runtime_suspend = snd_acp5x_suspend, >>> + .runtime_resume = snd_acp5x_resume, >>> + .resume = snd_acp5x_resume, >> >> use SET_SYSTEM_SLEEP_PM_OPS and SET_RUNTIME_PM_OPS? > suspend and resume callbacks implementation is same for runtime pm ops and system level pm ops in ACP PCI driver i.e in suspend callback acp de-init sequence will be invoked and in resume callback acp init sequence will be invoked. As per our understanding if we safeguard code with CONFIG_PM_SLEEP macro, then runtime pm ops won't work. Do we need to duplicate the same code as mentioned below? static const struct dev_pm_ops acp5x_pm = { SET_RUNTIME_PM_OPS(snd_acp5x_runtime_suspend, snd_acp5x_runtime_resume, NULL) SET_SYSTEM_SLEEP_PM_OPS(snd_acp5x_suspend, snd_acp5x_resume) }; where snd_acp5x_runtime_suspend() & snd_acp5x_suspend() API implementation is same. Similarly snd_acp5x_runtime_resume() & snd_acp5x_resume() implementation is same. > We will modify the code. >> >> also not clear why you don't have a .suspend here > It was a miss. we will add .suspend callback which invokes same callback > "snd_acp5x_suspend". >> >> And to avoid warnings use __maybe_unused for those callbacks when PM is disabled? >> > Agreed. We will modify the code and post the new version. >> >