Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8769406rwl; Tue, 10 Jan 2023 19:14:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXtAgASi+xXCvErXte5yS8DUCdjQoDgj/W5adEfVvVCZqzRSbf7/9IjOJk8+akVYfHuT2aWR X-Received: by 2002:a17:907:2a06:b0:84d:12db:fd23 with SMTP id fd6-20020a1709072a0600b0084d12dbfd23mr14210370ejc.71.1673406876365; Tue, 10 Jan 2023 19:14:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673406876; cv=pass; d=google.com; s=arc-20160816; b=GlHQqvKE7SYzaIJGfB+hFWTefcuRkcYj3B90aM3o75tuWzDbXeFzxV6TG3zeZsSw5l e3ioss/2tkKu0h3K1gFH3DBim03oOYPx2MTt4MwoGrwVf4kp7J2ewG8yfy4aHrZoQUsp EixrXBsPJsnowxDHupmdD/qx2XVgMrE691+hpcoq572DtjjwStnp3bwV51Z84Z/Bybd6 Ga1Lxy2INiN0uG0ZVrxPeCK7tgVPQOdHeW4E4ESwV3ABU3tzVsuZadvmac9w9i0Fh/6m Wuye4ZPC8sXQW+EXVF6RrHBCAt7CIU6TZbFzcyqCxoD0s5Z/db/YnRG8INz5uX4r/ROq D8KA== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=NaojYCiPLq0PIgzZQ9RNXov7TzWHpN1uIXezUiZa8Ls=; b=f/C0tQqUnwGzui7ReOvRblBpKjLnacftCbYMkUxQolmbopH6cujQyA5pom7a2sJVk6 PMg4yE1he0tdm+VEWV4Kp7Ln6eA4zIa8tvT0ivSfkF5766CTpv+90Q8SQRGasUtnqkPX 2gNc9ClQ63kDofKRU2ForzXfePCMpoijjEzzP7WA7HAhSpKa1Sn7qry11yqYgkgCgVqA GbnCvi4iQTW1Ew36dN+tjIdAl0bQtjAZc416z7cxs/2twoTXI4giiw5RrvyUz/pN2qiP KTAawsCHHPD5AfW65tgD/S0FVZ9W7yAxT/Mj84sYoNW8GtHYAWJYozdK+Q7vw/6cNKcp gwsg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=iWTUYvRC; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du14-20020a17090772ce00b007c1100d2875si16801557ejc.750.2023.01.10.19.14.23; Tue, 10 Jan 2023 19:14:36 -0800 (PST) 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=@amd.com header.s=selector1 header.b=iWTUYvRC; 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 2620:137:e000::1:20 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 S230088AbjAKDC5 (ORCPT + 55 others); Tue, 10 Jan 2023 22:02:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbjAKDCy (ORCPT ); Tue, 10 Jan 2023 22:02:54 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2052.outbound.protection.outlook.com [40.107.92.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3EDB17040 for ; Tue, 10 Jan 2023 19:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rf977WbUkmkws+Tf0N7MUie0baTcjk60JL8ob/+ph9voM2ofohSKm+0tmT8mr48p8Hkimhh7hvGvo+45Wl9bYOD/BWDbfmaqGq85hrpHraNCWmChPYsjKUYB8A4dSaRQE3xlxzENpGYX61A1n3t4JxVZlcqGTFK2hxaBXkLkFY279d2aKb2PRypjVX/bwAsz0nflmqIr8G5X5raakIoqK6ihh7VGuIypXqr2iYl709ftW2DvsPCccXixRdgFI0Wdbpq4ZLlJTXMktSc4X6vbmFOcbFK5DDGVCLxeKXystIzlDji50U4IUvhwEWLrmXNVhytIh/xIsunnSH4NZ5zzCg== 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=NaojYCiPLq0PIgzZQ9RNXov7TzWHpN1uIXezUiZa8Ls=; b=B4WXrjHON4lZD9QywYWTzwc3AqMTkeKt3t/yjP7b7Do6Q8XHfkTidR5evgv+4MJ4LR9K2lLe1cR62Wz5wL93OOUo4et5++o3xQhxZmNYfT4qNIw0fzd5uBKYoreAd7McH5pI9O5Ma5O2bvLcFKYoZtVnXBjHjdsvBX2j8Qr84DsB86VUItMY34B9Bnl7wSo0cp9ArmLACJgGq89hrn10lposrkxQfmMk63j+EyPYc2fQ/UNVAXvhpbjkghBwFjIt65on3N7JhS+uZUPNYuzaBDvpLfZRCmwTh5Xgxqn+4r7DPD/xQf/zdioyZ7f/6CRqqzFH62AhPTMM3cMe/7U0+w== 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=NaojYCiPLq0PIgzZQ9RNXov7TzWHpN1uIXezUiZa8Ls=; b=iWTUYvRCQJPPEIb3AddGbC0isYf29ZTL16wpUdB4czzr7vvatcSEMSK7tINl20sxLBCA7Z4BkT30bk/tw+CKV5be12BLXIe2eTBACHiVR2c4If5NyGpKL6yNDtPWOxPcmCIQcqEXGLH3353Ryh+qmN4q6liKO1C8wC85JO6y7Ak= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) by CH2PR12MB4247.namprd12.prod.outlook.com (2603:10b6:610:7c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 03:02:48 +0000 Received: from DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::fc88:7080:445e:6866]) by DM6PR12MB4123.namprd12.prod.outlook.com ([fe80::fc88:7080:445e:6866%5]) with mapi id 15.20.5986.018; Wed, 11 Jan 2023 03:02:48 +0000 Message-ID: <6d3380db-5e21-a3e5-b1c2-8618819d1cb2@amd.com> Date: Wed, 11 Jan 2023 08:35:41 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v1 1/6] ASoC: amd: acp-es8336: Drop reference count of ACPI device after use Content-Language: en-US To: Andy Shevchenko , Mark Brown , Hans de Goede , Pierre-Louis Bossart , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen References: <20230102203014.16041-1-andriy.shevchenko@linux.intel.com> From: "Mukunda,Vijendar" In-Reply-To: <20230102203014.16041-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN0PR01CA0018.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:4f::23) To DM6PR12MB4123.namprd12.prod.outlook.com (2603:10b6:5:21f::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4123:EE_|CH2PR12MB4247:EE_ X-MS-Office365-Filtering-Correlation-Id: 8055c751-e4b0-41c9-9487-08daf3805201 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bjXzFO+FZxNUJ7nKor1veaDQki6zXKjaJTF3Z7VtdQBu8Rp8MememGB6NXQksUUbN92XJypXpeqgXPdJzQmaUSV4pJy4Lz04jo/s2OJaYofoxSKXHlregXnZioiOSWbKr/BYqkpVM6VGVkKyDhMbHLTjevRt8TJGNxXzU/FVyq4HgTf4wRIQAffJWbAhWxlwMLdZyrB7/QA78g9QjLh4UG7zQHrje9DVWev3aLrFE2oq/052SboVK2rUdkjC5euJrMnvCtB7pW3UoA/wkjHlghqJLGncI691RDs8nrGshACyQw6ONtu9c7dBQUWViz3NsZKqVO8pChiNDRV4QhShoJgO4txcU29R6gO3yeHjJCr9rnXYetXzQ5sgJuWWiSUbrn18idwb3vWBENUGC0jZwgYYMY87S9PQAdyJC40pvu0iGnHPnKI/pqyIQf1M0DgxgDSx4cYXIiaL5rYTAst8sF7FGtYBYKt1xp9wasfQgtM6ekjBVF3v4JEDVHLXkxcHoEZyrf6MFapS1MJbydUs+n/lGjtmvb+U5QjKqlj/zURYQ7fNLwVBPAyiAiMxsq1jxx3/+fdVgFe7vgwkIzAaAnSSfEUmnXW6UuUdFTGWXH/dR+VXIWq5qWon0nBZad8cZcxRcV/gKfVNhVZ0L1ec35KoF9ltLHWN27LrQLGtIHXd6EZ0HypEAxmniSFVVKptTiIGChJGR6M5Y3sRdD3iDbSKDF51OilrHb5sirpEzA4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4123.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(451199015)(53546011)(6506007)(6486002)(478600001)(6666004)(2616005)(4326008)(26005)(186003)(6512007)(66556008)(316002)(8676002)(66476007)(110136005)(54906003)(86362001)(38100700002)(83380400001)(31696002)(41300700001)(66946007)(31686004)(7416002)(5660300002)(36756003)(2906002)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?KzhPQ2dyRU9OS3dLUVFIUG5DSk51YngwNU1KUWVtcHBadWE4ak53Z3BWOEo1?= =?utf-8?B?dWQrQkVHUnBnTHFIcDRNeGx4YzZCeTJNVC9NVjRCbk1xN0xFcGZFb2taVmc1?= =?utf-8?B?ek50aEl6UmpObDNncTh0RFR1Vno3TmJybUhQcEo1Qm5lQzFJcVpzaWR1SlRr?= =?utf-8?B?aXZCZkhIUkI4YlBOWU01Nmp5WEY1MWM5bHFuK1E4L2lvL3RKc0pjNlJUMWtS?= =?utf-8?B?UUkxRWduWTMzbXFRZDl4L29FcGVoMWdYQWFEVnhiVnFRM3ZaZEF2ZERjZ2VS?= =?utf-8?B?bHZ3Y1VpRUM3RGZzQVk1Z01SMmpaV2ZWM09nTGkvN1lYdldhc2lSeVhqWmZF?= =?utf-8?B?ODMrMHdlQ1RnOWRZTWU2ODVPdDlRYlZPQ1lWbDdzcUNIM1NJSHFqVUlXY2hr?= =?utf-8?B?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9487-08daf3805201 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4123.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 03:02:48.7294 (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: eE+uzSOiW27A2n4KvDygUon1nFz6LEyI+RnVkrZUsRwOShgZ+NRwDsnQSEc1gp3m+INrlj8VmOaHUtAGc1xJ3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4247 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 On 03/01/23 02:00, Andy Shevchenko wrote: > Theoretically the device might gone if its reference count drops to 0. > This might be the case when we try to find the first physical node of > the ACPI device. We need to keep reference to it until we get a result > of the above mentioned call. Refactor the code to drop the reference > count at the correct place. > > While at it, move to acpi_dev_put() as symmetrical call to the > acpi_dev_get_first_match_dev(). > > Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform") > Signed-off-by: Andy Shevchenko Acked-by: Vijendar Mukunda > --- > sound/soc/amd/acp-es8336.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c > index 2fe8df86053a..89499542c803 100644 > --- a/sound/soc/amd/acp-es8336.c > +++ b/sound/soc/amd/acp-es8336.c > @@ -198,9 +198,11 @@ static int st_es8336_late_probe(struct snd_soc_card *card) > int ret; > > adev = acpi_dev_get_first_match_dev("ESSX8336", NULL, -1); > - if (adev) > - put_device(&adev->dev); > + if (!adev) > + return -ENODEV; > + > codec_dev = acpi_get_first_physical_node(adev); > + acpi_dev_put(adev); > if (!codec_dev) > dev_err(card->dev, "can not find codec dev\n"); >