Received: by 10.213.65.68 with SMTP id h4csp2206027imn; Sun, 8 Apr 2018 22:29:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx49C2G86H6bc4ygD7WZGPo7V3ZW1rFuU9k4aH33RiZbbONsFnPwSjxGk2JAN2z7baPVz9ZkK X-Received: by 10.98.147.135 with SMTP id r7mr28396563pfk.31.1523251786672; Sun, 08 Apr 2018 22:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523251786; cv=none; d=google.com; s=arc-20160816; b=H4sGu0hQZ42NMFqQVRkMSVW2mPpM4dc1MZcZIS8UtV5WSPsNUY+NQtiaRH6TMC2jww U+TgtVH9gGFdN4KOKycRMa8K8GihZT8RreHfsVv91rTebChYdwWSJW2cwbEbwJghjoDW IF6GezWgT8Klh+qiP98Yzw5IytHfejgie/1Flu0MUSsUOyh1wV2UqlIdy2hspQ7Ki5Eq zFCjW6cpiCAD6aSLLKKb8V5ekZbegj+LV8zMK8JqGdRDYrvsvzPiuZP9oFeJXpT+jbFg sZBSSFacWxWnHOZcUABY58X0ER0HobOlOr2MP5k0BZycU2pInRP/qeoUWi7BAxnhjrqz QuLA== 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=TcBM+DUguHCW/4APVHBHNz67pPm2jd0bzfgWfyBHL1LykAFbH2q8uuhOtQId1YdEcy 0U1ARDZIeBgTAz50xQmwg2YFDdFGPXGW+lt4Qj1rmfGlywVQMeUe4wtCgnAElLmrt49B rW9crmdKBeDccmCFc/UVOWBcOFu8uZ5puPfqyE1oKDgcgYnrcvOZXjW7cMvcPtmd63iC Ezb+tb6IVY2YsFD1A7qKt3+Q4NqGJHT7xQ9xs9gMN15CO+fFjUgn1Eua41Q1ZaoQJrvk EeJ5QAzDa/1dCevsmtEZWnpHnAhEFeKUFSIgZNDdtu/Fb+veypmfrM/LT3ZEvmw2ykS2 fZ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=mh3t6/iS; 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 q9si10473280pgp.145.2018.04.08.22.29.06; Sun, 08 Apr 2018 22:29:46 -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=mh3t6/iS; 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 S1753840AbeDIDaG (ORCPT + 99 others); Sun, 8 Apr 2018 23:30:06 -0400 Received: from mail-sn1nam02on0111.outbound.protection.outlook.com ([104.47.36.111]:52845 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754579AbeDIAWC (ORCPT ); Sun, 8 Apr 2018 20:22:02 -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=mh3t6/iSfnowswwFtoa++dXMapBWcZqSqaS+Ss5smGinlPKCzZC3obxcVrFuvfzzk/d/2rj1qdqrgyPZkqIAiFzZbeU5yNHQ8H49NagQb9Ouna5iQsbySLuBDWLuQDmX02oG0qUpH+ODgeGMLcTB55Uac6QkBqsg2abIz2nFHMk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0936.namprd21.prod.outlook.com (52.132.131.166) 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:21:57 +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:21:57 +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.14 006/161] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Thread-Topic: [PATCH AUTOSEL for 4.14 006/161] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Thread-Index: AQHTz5h2orrgkd2P5UyDrM9wtSUTlw== Date: Mon, 9 Apr 2018 00:19:45 +0000 Message-ID: <20180409001936.162706-6-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0936;7:7yTLLlFj+hSrlizKQa7V9ORVIN4HttxFyN1InGjYGUH0wlqNbZVkLenq3wsRDW56/yriz0rtnY60SEhilEn9+l8l5zSdDgX+tD0pdWiJFiYAWO28gKdZP8B12f9Oyl6oRFxJ92RKxH96fSQD0Mb3RWpKNiPg4fo6bzEYr6n0Y8TyhvtQhC+3LLdP2ojwlOu6Xb/qgQS3paE1ZDOaeAIyfUcmdBluIrDvKkMiKotvkhSuqty6AhwMbvmYPhBaNxxu;20:+ez7ts1z1M/fQkHms7amRWoyqFQIEiCkFv+YVSr/VCzNmkxdugvC1hP3otHBNzWHAl9KS5JB5Qr56TBJnQHm3oS9BUSf11+x4kUTEOgW3H2bfzLM92g0NZ94UkS4v85dKPxwyC4rxlkEoMC84FPdGLdQViBR4WNY8JfGmBT6FlI= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 79d6d78c-2ecb-4ea6-296f-08d59dafe77e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0936; x-ms-traffictypediagnostic: DM5PR2101MB0936: 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)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0936;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0936; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39380400002)(39860400002)(396003)(376002)(366004)(199004)(189003)(3660700001)(36756003)(2501003)(76176011)(10290500003)(2616005)(5250100002)(3280700002)(478600001)(1076002)(72206003)(6436002)(53936002)(486006)(476003)(4326008)(6486002)(107886003)(5660300001)(54906003)(110136005)(102836004)(2906002)(6116002)(3846002)(86612001)(81156014)(81166006)(6666003)(8936002)(305945005)(8676002)(2900100001)(6506007)(68736007)(14454004)(106356001)(105586002)(25786009)(6512007)(86362001)(99286004)(446003)(59450400001)(10090500001)(11346002)(316002)(26005)(7736002)(66066001)(186003)(15760500003)(22452003)(97736004)(22906009)(32563001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0936;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: YG8g8kEmxnkKjFukhpzKAJlI3IcEOMarSZ/ZBcvZprSvxxmQJ99otazFmrM/VVeB8XbU/tKdKQJ0dUbEfxFfWeLPW/8vpvcFYTgMXy6WkQ6nutLpkl5WsoVk0TJApJ2KS96cVkjp26+kVdc3FxM7Q/GJ+sqRYE006OftupR1EHiT0REeet23Mzar9SRp6LRRnasuBEu4P01a6Qh/V1rc3uqsf0AyQp/6qkpuhXWwFIhbuyTlXqpGsEXAxX7g2NHnyUh7Lxmuyp/nE0XAalMn7pWH+50kDAQM+BvwN/cGKEZisjMSBPLV9zARnirI7Jo6Vzj46aPIFhDSXQkSKelA0V29Vz08xs4EQV7SojqQfYAbwGNzmXgXzGWBAvN6bjlxZUhQ6L/JpbvOAToK13FFS1T/H2IYhbZ0HDicxrQ2cxU= 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: 79d6d78c-2ecb-4ea6-296f-08d59dafe77e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:45.8952 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0936 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