Received: by 10.213.65.68 with SMTP id h4csp2175937imn; Sun, 8 Apr 2018 21:43:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+kZyztIudnK5wlnnXTTWdjKppYWfspW62PTGyyIs/CIl7LyHWXE2BnH3714Jg6n6g3sjYP X-Received: by 10.98.118.130 with SMTP id r124mr27663961pfc.238.1523249038072; Sun, 08 Apr 2018 21:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523249038; cv=none; d=google.com; s=arc-20160816; b=bLhVFWtNVkuaQwiNdLDslEkdYPmdevz8TbJxdiUpOvJl2QGe3f3kjH0RfGNewjnHwp vOKmV/BF+VMS1sQUjy/k9GBOPrt0YElSv+HZmVfiXYvY0PafPncAOXGwfWzdGIxE2QGC QyWWWRZ8/k8bQDpjkamPvCpe7gIBVuSvHHqehvLwKpw8Ftdj9BtIqIOH3YHRIuA5XqvB DsCa0KdsPcK3j3vkoqBYjI0kgGMRdB3q0Q+Hyz0+vaXv1qYu++ucSAG1EHJmKjlNPB4G Pn6Tn1Q026vrquOX1N+NLQzXcw0aPKdosfypYBDSxkV0tDGqBh5rl1/pHxfoPdF8qDy+ 3DyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=c8+/r+pD+9a5kiQbSCvrJ+H/zMVyve8q4gS9Jy4WSvE=; b=N0pPiMyveoLruRReBHmJ9qjO/by9x5E+7kjYf3NzCVWvc54HWfhMwI67fGw4nUFzMN fc5dKSPYORJvcWl9D5JAtEoqv0cIAAKcFs5AFZC+llX+zJM0KAbPEbKsvaOEeIiEz4xc ZAdyASTLDtjc+GNJWrizPokG5qvZDJOB8FHOH0I3TanToIpfy9TKnF/j51Y4zM2o+cSy acpvMa/WEIsGRCYCAm5e81/Gk/CsEQIUYIbxCBCqwYom8Y1fT20WPvTgwjfqqXj1RRLM BimgQkxCSgb4VA42BAMIyspJNL2U4r9CPniQLloaKrK/Z0t1tY/R4K+mf0d6az9Zd6oC 4dpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Wd8twYXv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si10688280pgo.214.2018.04.08.21.43.21; Sun, 08 Apr 2018 21:43:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Wd8twYXv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753031AbeDIARD (ORCPT + 99 others); Sun, 8 Apr 2018 20:17:03 -0400 Received: from mail-cys01nam02on0097.outbound.protection.outlook.com ([104.47.37.97]:28800 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752892AbeDIAQy (ORCPT ); Sun, 8 Apr 2018 20:16:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=c8+/r+pD+9a5kiQbSCvrJ+H/zMVyve8q4gS9Jy4WSvE=; b=Wd8twYXvQOFFhfqlkD5Lb8J1vcI7eU1HU5U29qgAYnF3wmqs/ToHFAYtya9zHOQCuG7WVDdBWgg3hPeZC8oPaMT7K8Lu5P6I1DAUhfTLUiG6WJBk8IyefmkkX8hp/oEoK778m9K/4wIHYXOUUtfSo9u1JgPWgXn7BZtD8Bd+o0s= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0968.namprd21.prod.outlook.com (52.132.133.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:16:50 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:16:50 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Dan Carpenter , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 009/189] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Thread-Topic: [PATCH AUTOSEL for 4.15 009/189] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Thread-Index: AQHTz5gO6i1Cb24CYEGrczrMbRT3qw== Date: Mon, 9 Apr 2018 00:16:50 +0000 Message-ID: <20180409001637.162453-9-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0968;7:k7Bt9o67KnwgGkAoRanz7ZSJZz5TUuYss4/o06b8SsZ8wF+SX8eNzOBjO4G9KpjNIGWn6we6R91pOstbaBfoKMy1dV9urkjKW7ITsqMPhKKTd1NtwS6PtwC77d+xyQdeXLVz1p1YYayDsWPqXHLFrjXJUIm7Mue06g7nq3263KNcOgQJbetLzRx80OB6AxjkmUWJevi+1U0ggsQntQHoQIy4eRSFKTOnwftuFFNKSy+AtgCmipBA4WWjFU/HmEFE;20:C8KxrdLSJIxScedxj/O6Ht3PKhiWc1gY4wLobrFFwlmcsRdByk0PAXBrBlWSnYN+nLKkoKas7ulW2xrCKYRE4rnkwORdkewhTUqivNDQa7dl6fsPXT2jbJDy8+s9kyRWglDjZFX4fY9ZJcwUrAxk+xHeFTv30YDlwLAfD1zc/Vc= x-ms-exchange-antispam-srfa-diagnostics: SOS; X-MS-Office365-Filtering-Correlation-Id: d45a56b6-f674-409b-ba11-08d59daf30fc x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0968; x-ms-traffictypediagnostic: DM5PR2101MB0968: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0968;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0968; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(376002)(366004)(346002)(39380400002)(396003)(189003)(199004)(6486002)(53936002)(107886003)(81156014)(36756003)(10290500003)(6436002)(81166006)(5660300001)(478600001)(8936002)(8676002)(6512007)(106356001)(105586002)(5250100002)(2900100001)(7736002)(305945005)(2501003)(10090500001)(66066001)(25786009)(15760500003)(476003)(3846002)(6116002)(186003)(2616005)(59450400001)(68736007)(6506007)(486006)(14454004)(86362001)(99286004)(26005)(102836004)(22452003)(76176011)(11346002)(2906002)(316002)(3660700001)(110136005)(97736004)(86612001)(3280700002)(1076002)(4326008)(446003)(54906003)(72206003)(22906009)(32563001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0968;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: TH+rCNbE3lRE+n6IwRK9TfDtO1g1pPqeLMKbSQ+agSFE/0UEtS5AXFci82sv/xxDowzwkDjCgtCYsFUUYr4qmZTtynf/vxbP0Ek0W9EhASjQr7MEfQbSyXUJKMDXRhySvoSE1quI9Xqg/IXZV98aqYXoWwtIMpXY0imFphNuCLVXy/P8Wm5nNPbJ3imZvtDB4axTLCc7w3saFSsA3doqR9rQNGW2PUvkR7rCNFvvpubjNuunM/LW7chKDmOIEygby2T/RlwaVez3wjvlEISJBCynEBQP83UlW4khTQgdK1womUHhzK4JcnyKW05wW4A/4xm89qkCkjo9mDzb5owGp+YVgh9z6LEAbqHFDOIP3SIkyLD6Jiqa/PLkCawMwe1y+/JKOfiBUovj+Fd2b7OT59XMkTWd9S3tcWwz7oGSv4A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d45a56b6-f674-409b-ba11-08d59daf30fc X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:16:50.7781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0968 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 123af9043e93cb6f235207d260d50f832cdb5439 ] The loop timeout doesn't work because it's a post op and ends with "tmo" set to -1. I changed it from a post-op to a pre-op and I changed the initial the starting value from 5 to 6 so we still iterate 5 times. I left the other as it was because it's a large number. Fixes: b3c70c9ea62a ("ASoC: Alchemy AC97C/I2SC audio support") Signed-off-by: Dan Carpenter Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/au1x/ac97c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/au1x/ac97c.c b/sound/soc/au1x/ac97c.c index 29a97d52e8ad..66d6c52e7761 100644 --- a/sound/soc/au1x/ac97c.c +++ b/sound/soc/au1x/ac97c.c @@ -91,8 +91,8 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac97= *ac97, do { mutex_lock(&ctx->lock); =20 - tmo =3D 5; - while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--) + tmo =3D 6; + while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo) udelay(21); /* wait an ac97 frame time */ if (!tmo) { pr_debug("ac97rd timeout #1\n"); @@ -105,7 +105,7 @@ static unsigned short au1xac97c_ac97_read(struct snd_ac= 97 *ac97, * poll, Forrest, poll... */ tmo =3D 0x10000; - while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--) + while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo) asm volatile ("nop"); data =3D RD(ctx, AC97_CMDRESP); =20 --=20 2.15.1