Message ID | 20230602011936.231931-1-robert.hancock@calian.com |
---|---|
State | Accepted |
Commit | 635071f5fee31550e921644b2becc42b3ff1036c |
Headers | show
Return-Path: <alsa-devel-bounces@alsa-project.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80A92C77B7A for <alsa-devel@archiver.kernel.org>; Fri, 2 Jun 2023 06:32:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 28E693E8; Fri, 2 Jun 2023 08:31:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 28E693E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685687556; bh=PUbvtaVXYfAMZf7b9i428HVA0MpoELz7ykB4pJu8Avw=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=ET2LdTG3hdUZ3UkVGCVq7j42HXWJHpekYXhc3HjW/5JbCy9D4eaocBrHlyjzgPMqU q4uS3s8++F19ExzROYNmj0gPUb9SrIe9xoROoLMkN8vWrnQb6rER7+pUSHttwrCJjg KxgnkEkXZbKs4K1Pvrgv+11ZuoTUEaVobswBqr4A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3A5E0F80563; Fri, 2 Jun 2023 08:30:55 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5FEC1F80527; Fri, 2 Jun 2023 08:30:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 685B2F80149; Fri, 2 Jun 2023 03:20:18 +0200 (CEST) Received: from mx0c-0054df01.pphosted.com (mx0c-0054df01.pphosted.com [67.231.159.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8761BF800BD for <alsa-devel@alsa-project.org>; Fri, 2 Jun 2023 03:20:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8761BF800BD Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=calian.com header.i=@calian.com header.a=rsa-sha256 header.s=selector1 header.b=wHucbtLj Received: from pps.filterd (m0208999.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3520iw4T019954; Thu, 1 Jun 2023 21:20:09 -0400 Received: from can01-yt3-obe.outbound.protection.outlook.com (mail-yt3can01lp2174.outbound.protection.outlook.com [104.47.75.174]) by mx0c-0054df01.pphosted.com (PPS) with ESMTPS id 3qucyv7e89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Jun 2023 21:20:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2sNeIB97QDpVAy3jK8XXHQbG99TnkCQGkoq8Zfd9i70SyGNSR6jZTdPBFeTuU019E3C8l5gH6lLbsajCN0Sxe8r3fZJN8Y8WgD7uRjYVNhl1q5hQJDdfYOeR0XiyVkANRH+8LpDfqPOsq9nf2O+y56x7JhuqTDloXidg9qNyXwWI6m8jGO0uw1qCvFf2L3p+zc72OhtGLfojzo2dwID3nTu2WSJPg8tbIiZDSTL4FVXRkuaSGltPzIjz/0t6EKulglxw2Zs+IGoxu15yMbVTpbEYt9fiS5scO9D7cSyyTnkiJsdVa9Y6XjFl71k6fnzgLIVrp8prLnVG7+FHuAeiQ== 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=jUK1cxlr5hycbv+5K6U1RQvfhCp2WXQeQ6U0UR97oq0=; b=hA1iMg9IIYvJOTbAv9F57mQtCfIplqR3V/a21yTBmaj3/Ej2vV1sKnFYq4OIvaDhprEHSqVKf3HDJht0Z1PVY6RPVt+V7jJPj1QjhjCzz5akB229V3Uqx6GH6VZrUYPjJ/yjZ0o8Dj3DAhYHu6vQscWiioqLk6vnNS/ZGwvwsyRPQ37HLrNecPigjaIVyfQWQSBNPq9/4LD601C8xtopDBMMcsZ/fNOqA2+bQq0IWnYsIwI8cjps7ejWyHrwr9NqtEGtf++ZehAbOCHxNdpN9cApwNVQkeiucPnPECxL3E96V/EroYakRT3sZWqaWFhi4tuw3/eQwmkoNk6KIdhHjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=calian.com; dmarc=pass action=none header.from=calian.com; dkim=pass header.d=calian.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jUK1cxlr5hycbv+5K6U1RQvfhCp2WXQeQ6U0UR97oq0=; b=wHucbtLjHQGj86HUpI9uaYHbB0fCy+t9JyopLphEa0KeP8j81BO5SAzyW/8Tdm+NnkHObTMZhJLM62An4NhCudJXtHobyCrc4MnoqkqzxkJK5EUCBEJ2pGaBokbf3PkNGgSAjLklnOo7gl4k/BoBvY4cfdZvkVBud4UggokvEGM= Received: from YT2PR01MB8838.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:b9::6) by YT3PR01MB9041.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:7e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Fri, 2 Jun 2023 01:20:07 +0000 Received: from YT2PR01MB8838.CANPRD01.PROD.OUTLOOK.COM ([fe80::c059:dcd5:ca20:4a0]) by YT2PR01MB8838.CANPRD01.PROD.OUTLOOK.COM ([fe80::c059:dcd5:ca20:4a0%6]) with mapi id 15.20.6455.020; Fri, 2 Jun 2023 01:20:07 +0000 From: Robert Hancock <robert.hancock@calian.com> To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Robert Hancock <robert.hancock@calian.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: simple-card-utils: fix PCM constraint error check Date: Thu, 1 Jun 2023 19:19:35 -0600 Message-Id: <20230602011936.231931-1-robert.hancock@calian.com> X-Mailer: git-send-email 2.40.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: CY5PR15CA0105.namprd15.prod.outlook.com (2603:10b6:930:7::13) To YT2PR01MB8838.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:b9::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: YT2PR01MB8838:EE_|YT3PR01MB9041:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fde73be-5993-4e04-287e-08db6307806d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RvnWJLPIPRdCAlU61pI+bRz7oWuYAA7i/+xn+FdlkZ1TBNcn15XjZTYCNm21Y/mhMEI56NWT7QM1wsnqq7SlGYNpKu7PO5BjuJPEw7hIMVNhdImhmPxglrioz7wNOMipDvYqT1mefhqXXB9CGefzQDN8A4MvPCvAWenAas4aQdNEvwESvwegID9at9uJXMj73e3+4p1Lod4L77i+3qeIwwAjJqr9rT0ckpZOGHhlbdVkggDHqZazFD5D87iHSH4ZmeqI72LR0FgPAS3VG1HIXkwCRz4Elg1dsdpvv1XWD58RyfifoKPVAZFeZJyrkjyQGUskpBrxFWIVYIJyq5wbhVUSI68utoeYzRMsAXf5w/k7t0XZXbsVirWHQctdbHtE9p2wD1/37jq5TYzprR/E8M1uz1Q3qioINXLNGBQaVGvqjsyAht2YcDmuK3Gl2IBhsiTIULwSdEiWCO8ohht8NB7HFV2jZKIp3m4Yjw/jxLkGCArcXJcchUictygkJHGXEvPC48w1f5eE/jEuvW2JweLCo2BEgIQwgxmb3fDWboXcGenKuRgQ74snFQkqkY7mx+MFMh7IvYyDIE50TAuNpHUm/ABWu8Ci5HqzwYPS9t7wvWv4Z/bUjF/Dqt7v7cBy X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YT2PR01MB8838.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(366004)(396003)(346002)(136003)(451199021)(38100700002)(41300700001)(316002)(38350700002)(4326008)(6512007)(6666004)(6486002)(8936002)(86362001)(2906002)(8676002)(52116002)(66556008)(66946007)(2616005)(36756003)(66476007)(110136005)(44832011)(26005)(6506007)(1076003)(7049001)(478600001)(5660300002)(83380400001)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vSBIBA5wmG0NUkIeOGah9yTJ5hlby9og9iRObQ1e3uPxR+i7fO+I+FNWXlht7RH6TNWNcCpXxyUvsDwDbd1SUY7G1HIMDg3KAUz9dsLRY87xIRgEwmi5TYm/fe350TJyqQRLn/Zvry58c6nMJd6LblBzoiuzd+2nZI6qBBFFcLAYCbDwE8PHtTWqj3wGxYYUEdBvIyiXb20xqWS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Pvq72OhbqsyoxjBgYcdMv7dW4CiKnQF1Ekq6ifwT+lRGAFyQHHDntO+as0itiQq1pTb5OQWxXv1GcJmcMQmoI92LtRXCZ97sNUxXlx9vc6OU11n6fOxNYSXb+JMog/KVC1f3oT3FFp6mgf4FC5ED8Ux4rD8ZM5Ns48jSTn1mhD7VXF6qsOrWSVNCqsDvfxnXQNIuKelSQtr2jUsx1EJ0srshvj0VoSHVeJiUAXwmokjgnAAtdfqhtI52KAElAVVhq0oDyZjt9J8cTQmHC9seLtWiGM= X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fde73be-5993-4e04-287e-08db6307806d X-MS-Exchange-CrossTenant-AuthSource: YT2PR01MB8838.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 01:20:07.6058 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uTofDsJSU2rScqda0h7fQD/yV7CPWAY5OUJAYYrJYklF9MtHmtWBJmrtcnOowOnFhFn9mOf/zhvIxf5PLdB6pxf4dU31JJjqG0+rokiETWE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT3PR01MB9041 X-Proofpoint-ORIG-GUID: uzE6DDM11TCfSfKBX6rRaG6xwfWjzS1U X-Proofpoint-GUID: uzE6DDM11TCfSfKBX6rRaG6xwfWjzS1U X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-01_08,2023-05-31_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 clxscore=1011 priorityscore=1501 malwarescore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2306020009 X-MailFrom: robert.hancock@calian.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: WFHJP4WVGSZ2DBR2EH5JAVN47SO25PNQ X-Message-ID-Hash: WFHJP4WVGSZ2DBR2EH5JAVN47SO25PNQ X-Mailman-Approved-At: Fri, 02 Jun 2023 06:30:07 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" <alsa-devel.alsa-project.org> Archived-At: <https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/WFHJP4WVGSZ2DBR2EH5JAVN47SO25PNQ/> List-Archive: <https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/> List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> List-Owner: <mailto:alsa-devel-owner@alsa-project.org> List-Post: <mailto:alsa-devel@alsa-project.org> List-Subscribe: <mailto:alsa-devel-join@alsa-project.org> List-Unsubscribe: <mailto:alsa-devel-leave@alsa-project.org> |
Series |
ASoC: simple-card-utils: fix PCM constraint error check
|
expand
|
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 467edd96eae5..e5ff61c1e9d1 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -314,7 +314,7 @@ int asoc_simple_startup(struct snd_pcm_substream *substream) } ret = snd_pcm_hw_constraint_minmax(substream->runtime, SNDRV_PCM_HW_PARAM_RATE, fixed_rate, fixed_rate); - if (ret) + if (ret < 0) goto codec_err; }
The code in asoc_simple_startup was treating any non-zero return from snd_pcm_hw_constraint_minmax as an error, when this can return 1 in some normal cases and only negative values indicate an error. When this happened, it caused asoc_simple_startup to disable the clocks it just enabled and return 1, which was not treated as an error by the calling code which only checks for negative return values. Then when the PCM is eventually shut down, it causes the clock framework to complain about disabling clocks that were not enabled. Fix the check for snd_pcm_hw_constraint_minmax return value to only treat negative values as an error. Fixes: 5ca2ab459817 ("ASoC: simple-card-utils: Add new system-clock-fixed flag") Signed-off-by: Robert Hancock <robert.hancock@calian.com> --- sound/soc/generic/simple-card-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)