Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2664824pxa; Mon, 17 Aug 2020 15:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhdh0rZrs5gMDBFK+i6OTphHBqQ3iYQEpTA/L2ZP1KxIplTPCD+CU2tPzIZhUoJbws4023 X-Received: by 2002:a17:906:a109:: with SMTP id t9mr18458725ejy.134.1597705096719; Mon, 17 Aug 2020 15:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597705096; cv=none; d=google.com; s=arc-20160816; b=B4SMxnND0oGFF7Y8KFfpwb1mSysgloy6QwTrGHYSWoVx1DZpcA1G4d1ht+h6WFiFKp a4D9/TsBUr08dOn/NdQQgVcDoLJFpSJTSDfMtrp7yTv4FtgBaVPGW1Kv4DSOmn2/Bzm5 vXU67yOVYT6mrbH2jCuXxvFXd1uWeCPV3+WI2czAalTK7iyHnqswiVNr5vslTvuvJKWN 6ZU7sl59qkaIE7HOmcP135GBF3MccHiVhFZg8h2TrjQHM6fmDVnO+zNOhqQ+GLYE/6ym WYn43pcGQ+Vku38pD7d49TVi+o82CVvXCjczlxH9k9JBQO24NXqKLO8xUGVlem0ocAX3 zT2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BBmWc0uIfONd3iwwVIYG8MlHgxLarngm6+v6Jkens4U=; b=pgVYk1abvMASuWwQaLV2Y9+8vkpALAgp7gJrO6TMQuluYsYaVHz3zBtyUqQ6cmQ0WW qs0l8mRe61K2oseiXGpQewEwrI0kv9yGg7x5E52DpKtY7n55SXNhq3b/9o3tW5ErhypN J8aB1rk6+O6Wx3XGyqbNOyl/8keKXIy2uojQOhapdhTJywsCejpRv0MkzT5Bv0GnOdAo KoWsNrOLs/5ppZ7++2yYcsakSwKRVxGW9HHxGQnn82FizEk4N1P/I62Du10paD7z4qH3 jf/hz/14xZDwJz5CGHB9AsKmXUG8xXh2eDPDEhVoF9NLkc9mdvg9AxQvig2JFNf+XoSJ W5KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l9jRfQpj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si11597870edw.239.2020.08.17.15.57.53; Mon, 17 Aug 2020 15:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l9jRfQpj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404396AbgHQTt5 (ORCPT + 99 others); Mon, 17 Aug 2020 15:49:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:41234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729159AbgHQPTj (ORCPT ); Mon, 17 Aug 2020 11:19:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 A31E920716; Mon, 17 Aug 2020 15:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677579; bh=TOj5jAWqEnrMcfKk2DElEraP55ny9HKNmxrgBiO7JyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l9jRfQpj79FbF4VGeM8JY8oMb6F4sNLC8ILf0mgZj1hlUjYsvth5jEjcUnfjByxbi R23ladLPQ5e9iLif9JyBzPIqTnjmKNmwcpqKyMeW83S+/afWCs2WHLpJ6hUUfKLTXk VmE/0mFtXTTPRajgyZq2dbxtyQVf+yY6yJ7Ghh8U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Finn Thain , Stan Johnson , Joshua Thompson , Geert Uytterhoeven , Sasha Levin Subject: [PATCH 5.8 033/464] m68k: mac: Fix IOP status/control register writes Date: Mon, 17 Aug 2020 17:09:46 +0200 Message-Id: <20200817143835.341316022@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Finn Thain [ Upstream commit 931fc82a6aaf4e2e4a5490addaa6a090d78c24a7 ] When writing values to the IOP status/control register make sure those values do not have any extraneous bits that will clear interrupt flags. To place the SCC IOP into bypass mode would be desirable but this is not achieved by writing IOP_DMAINACTIVE | IOP_RUN | IOP_AUTOINC | IOP_BYPASS to the control register. Drop this ineffective register write. Remove the flawed and unused iop_bypass() function. Make use of the unused iop_stop() function. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Finn Thain Tested-by: Stan Johnson Cc: Joshua Thompson Link: https://lore.kernel.org/r/09bcb7359a1719a18b551ee515da3c4c3cf709e6.1590880333.git.fthain@telegraphics.com.au Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- arch/m68k/mac/iop.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 754f6478c30d0..bfc8daf507443 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -183,7 +183,7 @@ static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8 static __inline__ void iop_stop(volatile struct mac_iop *iop) { - iop->status_ctrl &= ~IOP_RUN; + iop->status_ctrl = IOP_AUTOINC; } static __inline__ void iop_start(volatile struct mac_iop *iop) @@ -191,14 +191,9 @@ static __inline__ void iop_start(volatile struct mac_iop *iop) iop->status_ctrl = IOP_RUN | IOP_AUTOINC; } -static __inline__ void iop_bypass(volatile struct mac_iop *iop) -{ - iop->status_ctrl |= IOP_BYPASS; -} - static __inline__ void iop_interrupt(volatile struct mac_iop *iop) { - iop->status_ctrl |= IOP_IRQ; + iop->status_ctrl = IOP_IRQ | IOP_RUN | IOP_AUTOINC; } static int iop_alive(volatile struct mac_iop *iop) @@ -244,7 +239,6 @@ void __init iop_preinit(void) } else { iop_base[IOP_NUM_SCC] = (struct mac_iop *) SCC_IOP_BASE_QUADRA; } - iop_base[IOP_NUM_SCC]->status_ctrl = 0x87; iop_scc_present = 1; } else { iop_base[IOP_NUM_SCC] = NULL; @@ -256,7 +250,7 @@ void __init iop_preinit(void) } else { iop_base[IOP_NUM_ISM] = (struct mac_iop *) ISM_IOP_BASE_QUADRA; } - iop_base[IOP_NUM_ISM]->status_ctrl = 0; + iop_stop(iop_base[IOP_NUM_ISM]); iop_ism_present = 1; } else { iop_base[IOP_NUM_ISM] = NULL; -- 2.25.1