Received: by 10.213.65.68 with SMTP id h4csp2119238imn; Sun, 8 Apr 2018 20:10:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Ql6p8NSkbK3iRhSvSNwYqpmIoHPyglY7lGsCNaOkJxBDTx+Io8mVKJ9yey+pJDqYBePcT X-Received: by 2002:a17:902:9a44:: with SMTP id x4-v6mr37098391plv.312.1523243449801; Sun, 08 Apr 2018 20:10:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243449; cv=none; d=google.com; s=arc-20160816; b=s+hOuCJ8G5ON1Cj+evn96yc6qsb8xOdsa8lB2l/cS7s3f6Be+qTy3CeQ7NKvPHn5x/ Vcmmyw33VXxmQJqTukRDmA/VwI9baVQGGMP1Qh+Y50eP7W4tyJrdcjgVUyVDEYxMMjMO +tmUPs8iXfKuASgC13CvS9ZjpzLZmLtNFczeWJbJayZx7bRpIr6koRj0Pl/zdi3GwJyp ZIruAMRHUmpuUvtCaCRoL3P7UU/p3HCxJ/5WQNFgkkkTXpH1WudNJTc4fRV51iSkcwBG rAN+xsQ1GXUM9uMamDZetZKcG3xM1ZrTmyvoFytzxqG954ZFPY+5rMuraWw99nDMtoBv YvDQ== 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=teDfW+mtQgUXusCUDglP+y8Amw5KgALguuS2ElwCF8sqQrrQd8tHlGB9EbvQNZf0ZR RVX4lMXUcOJkIV0/2SytSuHGxH7s5NQQqyXstJghl+FbXN9HYl0l8cn4JRXPEK9fQosa G5NR5RjnBhBIgZpQNuzly5Fcy/BgYlmup5PwLMpssaNm613xDKNK7ZJHjtLMK3/YBn5y P5LVefxIZGXEEKFC4uQ6DaEe4wO+Q4XZCFMfhYg1sEw4+JL132otqhvhq+W2CUgZNO7k TDwkBwfzVV9fPL5yHm35tHv+qU9dyKc5sPpJx+rD1PbL8FkSPu94PV39tExXtR7Dpsmp iqKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WGW4kGLY; 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 t26si11966246pfg.414.2018.04.08.20.10.13; Sun, 08 Apr 2018 20:10:49 -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=WGW4kGLY; 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 S1757430AbeDIB6o (ORCPT + 98 others); Sun, 8 Apr 2018 21:58:44 -0400 Received: from mail-by2nam01on0107.outbound.protection.outlook.com ([104.47.34.107]:56905 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756493AbeDIAcs (ORCPT ); Sun, 8 Apr 2018 20:32:48 -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=WGW4kGLYuSuaSMlpwRjamDoYhmBTR5at/6zUCP6kKyfwCPxd/bZTES/nojvsmNAdYnsQ+2RPh1OmpU1YSfYFM++FM52gew2NHuXF9ellMuQKgI7Fu1gzg12YB9zaU5cKLuVcA1RaOJC0BcFvcygiE7QrYHG3ozvsaTnyiUC10zw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0806.namprd21.prod.outlook.com (10.167.107.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:32:47 +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:32:46 +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.9 214/293] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Thread-Topic: [PATCH AUTOSEL for 4.9 214/293] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Thread-Index: AQHTz5lK8DPN/1kHCEahPKfiCXOVoA== Date: Mon, 9 Apr 2018 00:25:41 +0000 Message-ID: <20180409002239.163177-214-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0806;7:Xh9HWE+ljP+k0pnx6LS87TuhpcZa0RFYWmUhQOLQgytMalPhhRLTuWEw7LW66SdycVc6ar0R6Cbq0FzTmhVm+HmzArfgdJjVEMFepkFVjJpkEVKuheEQJYrdc6Hk9HTy9nSU74scxQ12l8k3k6377RDSWBT95pHfGfcY1zbk2tyhL/S4KteHojNYVqpQuwk1vDU7diae85nhqiDRWg1sTU9EEZ+n8jgoiJLBXVV439hwiNn7rOUtcU1eHWAyHoUP;20:ijdSBI1yIWP6jDMvKC8TiCilqZCgYl5G1Khg3GeXK/2+lwplAokxGlPBXC40UrBpH1KpAUPrOE2+vtaEPXG4zeLhR2X2N25w9UvkvTT3j0sh3s3/iQOkiPN4uPQOizFpIYzMPkNU9PXWlfjr1AF6rV6Erd6Iyz1B29OHrnC5Wh8= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: bfbaef20-db72-4b79-62ac-08d59db16ad0 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0806; x-ms-traffictypediagnostic: DM5PR2101MB0806: 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)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0806;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0806; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(376002)(396003)(366004)(39380400002)(199004)(189003)(2906002)(25786009)(2501003)(10290500003)(476003)(11346002)(446003)(97736004)(5250100002)(68736007)(2616005)(102836004)(6506007)(59450400001)(3846002)(3660700001)(486006)(3280700002)(305945005)(6666003)(99286004)(5660300001)(76176011)(1076002)(186003)(15760500003)(26005)(7736002)(6116002)(81156014)(81166006)(86612001)(4326008)(105586002)(10090500001)(2900100001)(54906003)(22452003)(316002)(36756003)(110136005)(107886003)(8676002)(6436002)(478600001)(53936002)(66066001)(6486002)(6512007)(86362001)(14454004)(72206003)(8936002)(106356001)(22906009)(32563001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0806;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Pdg/mOQ2Azzd5QAXRuPdRsvQlSDfvrE+st6OMRP7XDLLeLuYyNC+hMsEDJmEKtDXvB7hWawtUEAaCYagP+BVGRRHr0jyoDJJ0FE4EiShYHqv6rJj/SbHIxe8zyNUVAsrlIvdG0DErA5rLWoNqANyeXlvPbVSaAXjbjqf0UFdlNqkA4SISf0+4VUMe6aY9NAuQUvOv7C6YjOJmD6y/WNMbSsneV8LtfSjQhs8NhgvkMGVT4sOZwDyn3qmTMUhmEqJeSSPaNr2yFSh2MAFMqT0c99JavYSQAOTGRB/YKrjTMPC+hPsSIaKmE54G4Aw3X7D6mXgqAQQCdv5KWFvlFm0bT7eh0PRNMweAdv5sRiO4FRfUnuk9Ahcrmcs6hJupZa2Mp/okvLT8e++JR31GO6IQTO7w/6X/bHRi4403zeaviI= 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: bfbaef20-db72-4b79-62ac-08d59db16ad0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:41.3316 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0806 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