Received: by 10.192.165.148 with SMTP id m20csp576119imm; Wed, 25 Apr 2018 04:33:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+DmOwCkpjqgqSVdhEEp8h9b+dNjjID02ifW7d3MdHXZ2C/KTzWxCLZY0A11/39/f9K/QMj X-Received: by 10.99.60.12 with SMTP id j12mr24182642pga.203.1524655995855; Wed, 25 Apr 2018 04:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655995; cv=none; d=google.com; s=arc-20160816; b=V/4IkPh7CMq+46Qnz2qxRPAbiBzECxq57RLiZ4FM1YG2fQ0vLsvMjmvG9XHCJUg2IL 0N7hIPIhIBfR6pyQ1pBGvl7SZL9Qz6tjfV+2UIESlM5gOFDa3jUy20k1ice8lkZLeEoI xX9StwTKTpAOeEr3f1gasOtyDShLHiI74yBrxXKQLn6hGq0V514+mv+0QZnihz4nT6UK Z6uBBUufBLfqX63nSusNg8QGo21KpOVPRXuvfQlHXXKR/T+aVIh71IHCjHJbL1r5Hsl5 QZLmCs7nTx9GqlzUiGXjvgRr/UeuiKknMFsR+LrOIhCV2NuBTacIbUU14RpwS8PYyMiI I8Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+BeNr2t/r6VBadvhTBAG33/Olb1JrWyQhEE1UArE1K0=; b=p2YzXYHDE7SmoCvPp7xzbmamfWA6d8VjKRZA7JMwSdzJC7Ir16ucIQdZZvmQlTbT3F /nH8DviAibBZ9V1MkSx+c0VeFzoS1eYgnD7aHj9G2N5BQKKhIixbl2Fb/TyZb09M7Wej 28VBtNwbe6y7vND2/38BNvqAxm8RIvxO98TcHwR8O6+EOCMAFWAhjPfnHm9GKeCgnprU dVK1dQBT6nfFZGWN/pZxKyEOM7BeOD8hZjm4nAQoczYhdXREDmD2iLHAsNXg9dqLy3db 4wBCMWhWJPehIoOHdIOtkeU8XaVY8XLP3M++PkR2PusHXzboxc2fuVfhxY4w8fUq10VJ uJAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si553002pfn.133.2018.04.25.04.33.01; Wed, 25 Apr 2018 04:33:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753805AbeDYLcA (ORCPT + 99 others); Wed, 25 Apr 2018 07:32:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51166 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbeDYKhh (ORCPT ); Wed, 25 Apr 2018 06:37:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 00CBE481; Wed, 25 Apr 2018 10:37:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Mark Brown , Sasha Levin Subject: [PATCH 4.14 021/183] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Date: Wed, 25 Apr 2018 12:34:01 +0200 Message-Id: <20180425103243.457111558@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- sound/soc/au1x/ac97c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/sound/soc/au1x/ac97c.c +++ b/sound/soc/au1x/ac97c.c @@ -91,8 +91,8 @@ static unsigned short au1xac97c_ac97_rea do { mutex_lock(&ctx->lock); - tmo = 5; - while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--) + tmo = 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_rea * poll, Forrest, poll... */ tmo = 0x10000; - while ((RD(ctx, AC97_STATUS) & STAT_CP) && tmo--) + while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo) asm volatile ("nop"); data = RD(ctx, AC97_CMDRESP);