Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2168967imm; Mon, 28 May 2018 03:06:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrHZLKFnWQfT7OzV4dF9UJySWKJ0+2NA2DY8V+KlyZAfC/xevhU6OUq/DCygLB1YFIhtmjO X-Received: by 2002:a17:902:284b:: with SMTP id e69-v6mr12677213plb.240.1527501996599; Mon, 28 May 2018 03:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527501996; cv=none; d=google.com; s=arc-20160816; b=cCCbUFZh8Q+h10vIK40KN0wtnYK6uzMqez+NWQsXsjZEsYwcpY81rpsh2Q9ZboLNRY 2xCbR+ULZZI/QrTQpnN6jTI6gZa6YpfCS/luHVYYjIpnSQ+V609eXy+P93YkExD8eakj htTX4oK60vb/xR37oON/QhipBShPblo2h1zeJyA7FlGnukAJwgSK9PjWlOaQjwYXFLho BkJY0Yh4XExeGhtey6gF9zhRg5M+tTQXfmB4gHqksB14moi4RIdRi6SHk7QAXNQoWQKD i6ZlZ9sYqcElwGINGHEJLAAPIlWZgMRZmky5gA2w/j6F1Pwb4/xiVRKjGs+AA6ewNWiW zvUA== 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=21SMn2/fL2IcMPSYv6eM/e6JIPys1e4By7zjysaO5m4=; b=ztr3gxIPzmQcMSBdoymlZW/+WF8jExuIUNgPG5Q9I1bm/8LXZHTj8ovquv4XJrW6ol qOcfz3v38vs4x3bpdH7HnCogKck8kBQy75iUvBkUyF7sLGMdjLAh/nECuImgJrabi38s YJthTQ5xiJmQY21hwM49PYzffAeBxkN4bkXfNsj8IbQdQkaXLpQ8Ja7qrS9OQCZ+Sm/m RWdtHw6IhxR8ZNW9n4tuD1FR9auuoxw79CgxCVkWEBxZwYU7QBIDwJ3KZqqq6PVhDdEq 0OkbNv4cYgS8Jgj3gFg/irsf6Gaf9R1HeOosXO+x6rZRTjxN409ETqlan1CT1Vmkm0O/ VYdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ac76mP8S; 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 v7-v6si15353196pgo.135.2018.05.28.03.06.21; Mon, 28 May 2018 03:06:36 -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=Ac76mP8S; 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 S1754502AbeE1KGJ (ORCPT + 99 others); Mon, 28 May 2018 06:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:53968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754038AbeE1KGE (ORCPT ); Mon, 28 May 2018 06:06:04 -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 EF30E2089D; Mon, 28 May 2018 10:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527501963; bh=Hlzgpf5lZBG8nwSgOEbuJQH72WxRfr78Tg3n9LZLq9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ac76mP8SNieqHtEqMp6Eib/M2PTbJsVrrbf/oxk7XtmP8pgomkJNgSM1yQl4QMley Ry5S5BmHfJOeiex6m/ngR4TKNC/wyyMviWFn8pDhU4g5UWVOAM4BHhjJPqyhxzZv8E haZiMzEZaCQ3i//r7D60398KMGfglSTsz9gYR/XA= 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 3.18 011/185] ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() Date: Mon, 28 May 2018 12:00:52 +0200 Message-Id: <20180528100051.335435393@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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);