Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2012003imm; Thu, 24 May 2018 04:30:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqrN7Go+XsqD6EKAyyIACgfR5bzL9Ow03hh65Cu84Zq1ucc0evQlEM0y5AygvJCgl2EmacS X-Received: by 2002:a65:5ac9:: with SMTP id d9-v6mr5634508pgt.342.1527161412950; Thu, 24 May 2018 04:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161412; cv=none; d=google.com; s=arc-20160816; b=gqgXfZEVncSVobsErC32PxoYWJyl8xkEWTSHAj1fJPtQDilOcvd0e3AtvLunNq8sUR 7pJGqRCFxMZCqcxGGYRhA/03i1nvBi7232T7Z5kS2v5RRuYKfWrzFm6MFTxR6zaj1Qsh 7yRpvPRxTcE9dMD91Kqj64aHTdKE6bzCs6IR6CmeHsJ/2E0I2YnPQdDzGGGFiayb7XQp vf3XBdEZCXSCsTN6ACNVixIaDsWISNjTaQZYvqGCVMRXvmqsosWaS55HoW2AfE4H14l9 IEtM/ixqZjYs9MKW+gfNfjiZua3T5XFLdzMNG/3OcuGmQpdoMKIqWTBqhzfwzSCOpiwZ I1hw== 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:dkim-signature :arc-authentication-results; bh=XIeyi1lFw1C1f2MbnLPCqi/82IDgrfjKQJ7xBiw3Uq0=; b=MR09LWHt8qZJfCLK7dpUoYPt4FsIoE5ohQ6ekwy64r0n8XUS7Z+RQ0VqDWh8t4GkkF c7s36x+442DORKS4trHBnh2HvzKxoNEClLs9KkGW/H8f/YBI3bHa2K8GT7cgayfPtklV wRpIdmAmHlaCzEuATBOylnF16P5A+o/VqzT8KlIHZ8fknjqfQgm+QavvkCSn9YoinaCx N4JcTYwzVU05GUWM0s67Ht1xvm5A42Fm1w+XJEVIG/Kt7HKHq1oBRuxW5TcjREJrVG8g cqe9NXl/HqvORQ9p6CS1zHi3ewL7UyOTDyfSXz+4wVX74PLQDaRrMcHifYovAf+a7EjD Yhiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sv86i0X3; 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 n1-v6si20725654pld.188.2018.05.24.04.29.58; Thu, 24 May 2018 04:30:12 -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=@kernel.org header.s=default header.b=sv86i0X3; 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 S968821AbeEXL2D (ORCPT + 99 others); Thu, 24 May 2018 07:28:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:46692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967383AbeEXJvY (ORCPT ); Thu, 24 May 2018 05:51:24 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB48E20891; Thu, 24 May 2018 09:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155484; bh=PqnyB1LL020FKD1OQcaxwJ3RTslHtPaVE82bgtZ/Aew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sv86i0X3uS2npgbgnwIMyzadjONKiogOt1IjR6Qa8qtCaUbHDR8mE3raJ1VXM/RYy kOv708VIAkLmNZvcgLE3I6IcTNK/gCyPKXdNtwYJERfWYWaNxAT/a9tW2C0TXjHmRu SOddeCjJvIS6CSyFmjJTxyUZ5EfX79ccWOweRZUA= 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.9 67/96] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Date: Thu, 24 May 2018 11:38:50 +0200 Message-Id: <20180524093609.279067444@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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);