Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4379986imu; Mon, 14 Jan 2019 21:59:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN6KAUnUU1vRQ+WWoTpATmgexvF19EVwzhZi0bLIPMKi5dcNj9MxJmMgFlC7q18Hf5anFH1L X-Received: by 2002:a63:cd4c:: with SMTP id a12mr2335711pgj.252.1547531982855; Mon, 14 Jan 2019 21:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547531982; cv=none; d=google.com; s=arc-20160816; b=YdJpB4NRAykGtcLCiqt09JfzijA5DG4DYL96eZp5hbFDhBU44T4GcQJyAKVwwcvCB6 BtTon7a9YyNfhp36i6BQl1h0rtgF6zOZwSHTNt46gCv/JU7CS0M+3U3nSUT68SXcp6hP HJeHkq7SVD7GsY+zQXooSNphivou3ya9+LLpz3DfnCozsDQU49dXTosBU/JQqZvnFh3C AQlbIAcbLFASvhuSx0KJfbt7oFGIkJnhnAIpdJZeBTgjrYiQcj7HqoGnz5FM9Q0iXJ1N ulRTzihPO5Y5Gf5RczjHJaEAJG85Rb3LZc1nBE7Inh+CQRD0xd/xzsGmo6w+NnHo27LP r7mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=cV3ycUwQrereuPgWmnBQDAjQsZ474lKJFkbC+U7gKG4=; b=dngIIzly0+VmfVJeVyN7xipyuXwa4ToOo9qNK2ZxBMmw206NyEkvCDfeA0OfM2G/H9 XEOzadJ0R8apOTl/6PJGAwIH0N2TwFfySIY4uYCZAoECFUfKk8eV1YHA4iXnfsw+EAyw S5e4G465EGFOhRABn43vSUHXqGNou2nDg5yv4HUwvxN57Grvc+9nkr8UU16gThxJx9pv 1fz2YimnEhe+irwgWStToL/XuyPejmMtM9JwU6oqnqmCL3y9QiixRs+LOrjTUfhCr+WF 0mdWguev/NHDEu65CZmFaOwMo4FClxPtTj/CjiyddaPnhilJ0x3K7KaRYn77TxWhnA9c UdEA== 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 u28si2302772pgn.436.2019.01.14.21.59.26; Mon, 14 Jan 2019 21:59:42 -0800 (PST) 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 S1728377AbfAOEXc (ORCPT + 99 others); Mon, 14 Jan 2019 23:23:32 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:37572 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728223AbfAOEW3 (ORCPT ); Mon, 14 Jan 2019 23:22:29 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 7F60529E7C; Mon, 14 Jan 2019 23:22:24 -0500 (EST) To: Arnd Bergmann , Greg Kroah-Hartman , Benjamin Herrenschmidt Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org Message-Id: <7c2b0db81b7778a4f90b007a968d1af09b1a63bf.1547525936.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v9 14/22] macintosh/via-cuda: Don't rely on Cuda to end a transfer Date: Tue, 15 Jan 2019 15:18:56 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Certain Cuda transfers have to be ended by the driver. According to Apple's open source Cuda driver, as found in mkLinux and XNU, this applies to any "open ended request such as PRAM read". This fixes an infinite polling loop in cuda_pram_read_byte(). Tested-by: Stan Johnson Signed-off-by: Finn Thain --- drivers/macintosh/via-cuda.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index bbec6ac0a966..3581abfb0c6a 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c @@ -569,6 +569,7 @@ cuda_interrupt(int irq, void *arg) unsigned char ibuf[16]; int ibuf_len = 0; int complete = 0; + bool full; spin_lock_irqsave(&cuda_lock, flags); @@ -656,12 +657,13 @@ cuda_interrupt(int irq, void *arg) break; case reading: - if (reading_reply ? ARRAY_FULL(current_req->reply, reply_ptr) - : ARRAY_FULL(cuda_rbuf, reply_ptr)) + full = reading_reply ? ARRAY_FULL(current_req->reply, reply_ptr) + : ARRAY_FULL(cuda_rbuf, reply_ptr); + if (full) (void)in_8(&via[SR]); else *reply_ptr++ = in_8(&via[SR]); - if (!TREQ_asserted(status)) { + if (!TREQ_asserted(status) || full) { if (mcu_is_egret) assert_TACK(); /* that's all folks */ -- 2.19.2