Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2516898pxa; Mon, 17 Aug 2020 11:35:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPBQp4qvoLJTcalxpyNCXnNpRpvZfFoiKV0cAO/D+ihoujLRXzYfJ8OwLHTSyXbeN88GqB X-Received: by 2002:a05:6402:37b:: with SMTP id s27mr16467907edw.239.1597689339123; Mon, 17 Aug 2020 11:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597689339; cv=none; d=google.com; s=arc-20160816; b=MiB+cfIsKzT6MqZMOKCfliFIsxxTWljEI/kbAY9YrvvXVxPqAEtK6eo/RctZ6dd7Cv gMDXE/saUEAne38B0jqwxdN/e7C2EiaxJuhDHW9HmxUuQK651/5jXjbxcCJqCjsO+GRO BIGJ1SqiU3h9eadl3IGj9ZKQmiL3xfe/+qkPUwmIEwFkx+GnFDRnkWKBAKARWNFzeiuV mzL+qeWwjoDTnwFfLJxdq8qAOnsWN9WzPM5GHcXXbeUOKXE9/smrASDnRchQz2lsajFD Hq7a3Ru1uhKbIUPz+Jk09nc1s+rjKZ5BPct8X2GRjSaasFV0fSBFgCb6XFc2ARAJlqF7 U0xA== 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=qHt3GTnkyh8wIICppssl0REVuFHNAnQc7rXF9mJ6bfQ=; b=1E0T5fwZTla+cMnYHMhF1IF5rR6BVWnsGvQ+ai40qYWlf11+BGustBWvxcqhz4YrKR ZZae9jvV9PnmD8LCYkE78Gi+Y+2GAMdn0g3NluD//iPoRsA/2F3xtVkxqJx8gsIRWvYo ck3tj10/7aJSTIiYZ9BjIiibDVoc0k0s17Y5vTDgF8pl3aL04JlcfJITtkl34Cyc/DxS tQYUgDmouNESpiyCyAz5gMBPCO2+X/AxahAJ9mofY4Sq9LF37cUi0ro2Pv0HM1MwXYNm vSEF59euzMFWaF6vyYZdaeIkhUgxHq71CAmJ9dZX10L5rtrgdjVCUK9m4Lj5Dy8q2Ziy Pm8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QNJwoUGX; 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 ga10si11823592ejb.402.2020.08.17.11.35.15; Mon, 17 Aug 2020 11:35:39 -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=QNJwoUGX; 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 S2391215AbgHQSds (ORCPT + 99 others); Mon, 17 Aug 2020 14:33:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:47796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731014AbgHQQAZ (ORCPT ); Mon, 17 Aug 2020 12:00:25 -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 5D93520B1F; Mon, 17 Aug 2020 16:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680024; bh=TMZSxOWR4DoSRPwXZvMAnYvdUNi4BFmEtSVD2UmFTXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNJwoUGXPkRmohQlk9zq5zlI7lU3d+jXCutnLEFwriT9MNR6e07Fbz40PiHauhrfB vpajeYE0+WMyiATNd4i7xWy7BZzXh93St/FUCmWTAfRA5pdtw6MFfbpHDq4OVtgNKC TZ404fjz+wfMvPz3CwXR1Py6+0VoG2iIYWA832/A= 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.4 023/270] m68k: mac: Fix IOP status/control register writes Date: Mon, 17 Aug 2020 17:13:44 +0200 Message-Id: <20200817143756.939146048@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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 d8f2282978f9c..c432bfafe63e2 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