Skip to content

Commit

Permalink
macintosh/via-cuda: Don't rely on Cuda to end a transfer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Finn Thain <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Finn Thain authored and gregkh committed Jan 22, 2019
1 parent aefcb74 commit 458c77f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/macintosh/via-cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 458c77f

Please sign in to comment.