Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1799580ybt; Sat, 27 Jun 2020 21:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza/lhqEkArUt6s9OIvLFWYJ5QliyrV9zHCj2JkKHXG8C0hYt8e/cZmk+9N6X48UZVJbXYR X-Received: by 2002:a17:906:4a44:: with SMTP id a4mr1124393ejv.486.1593318772151; Sat, 27 Jun 2020 21:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593318772; cv=none; d=google.com; s=arc-20160816; b=hA1UdQpnFcK96aza+XzyI0ct+GbLNhxKzW/4UOdggTHml01GugboM/1PCSsezeh5cS JrONHzkyGl2yrLhZrBUAQs6rQHrvQjOSY1fNig+ltJKDOXmOSM2PQF0RuT1Z3YZMLIbv 2IV4Oig/5amXqiXa6Qtjtzs/iDPixyzqx93nMtlxzDzmlK354loVZPd1hk/8qiKUKx8B OX9ixuLZqebGacw7IovWa+2kJ8pzdRTB92uA+FK4UAk2uvwidRGjUXxjCCKxxTa588ra tdZk4j7LgyAfPuov5EQTrjJ7rdvhuLXs9cQWswxmRmK0MQGFh9Tpf175mDg5VWs+WCGI VBPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:date:subject:from:message-id; bh=gWV+H6uTO8ksG9h7qshSeGZUbZUcU2PSRF18ChBGFxE=; b=rPEVXYmM2ArjxaAzzDEofCo0k86sLgIbcn/3zSr+vTrW7WZUYV1BZjKysNu/8GhSvt S7Cl48CMnpEtWg+WnSGg6nlgJlXPkDnl/AdFVB21iqr0Dte97KRtZIlLOdwKNdUXt8lO VTIm6QZqsR9ZKwkwW0VgpXrY7iu/+2UBHbA9D8nGWveYSOCyNKyzeec4R38iee42fH6j o5trfsLt/JZbCUro8E6zN6fKtTrgE5A1DggO5Sv7Tf0Cdf4axU9XUyhzvhAhjkLz8Ya+ QUSVJQ4JKy+BZQ62GHV74wFd1smoSHVJ/QXZyR0ATHj1dxAz02eb3QDvuLPFTV4t0fIX BqAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si11028596ejy.594.2020.06.27.21.32.29; Sat, 27 Jun 2020 21:32:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726104AbgF1Ebt (ORCPT + 99 others); Sun, 28 Jun 2020 00:31:49 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34176 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgF1Ebq (ORCPT ); Sun, 28 Jun 2020 00:31:46 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 35E9C296F9; Sun, 28 Jun 2020 00:31:42 -0400 (EDT) Message-Id: From: Finn Thain Subject: [PATCH 0/9] Macintosh II ADB driver fixes Date: Sun, 28 Jun 2020 14:23:12 +1000 To: Benjamin Herrenschmidt Cc: Joshua Thompson , Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Laurent Vivier , Mark Cave-Ayland , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Various issues with the via-macii driver have become apparent over the years. Some examples: - A Talk command response can be lost. This can result in phantom devices being probed or an incorrect device handler ID being retrieved. - A reply packet containing a null byte can get truncated. Such packets are sometimes generated by ADB keyboards. - A Talk Register 3 reply from device 15 (that is, command byte 0xFF) can be mistaken for a bus timeout (empty packet). This patch series contains fixes for all known bugs in the via-macii driver, plus a few code style improvements. It has been successfully tested on an Apple Centris 650 and qemu-system-m68k. The patched kernel does regress on past QEMU releases, due to ADB transceiver emulation bugs. Those bugs have been fixed in mainline QEMU. My thanks go to Mark Cave-Ayland for that effort and for figuring out the improvements to the signalling between the VIA and the transceiver. Note to -stable maintainers: these fixes can be cherry-picked without difficulty, if you have the 5 commits that appeared in v5.0: b52dce8738938 macintosh/via-macii: Synchronous bus reset 5f93d7081a47e macintosh/via-macii: Remove BUG_ON assertions 5ce6185c2ef4e macintosh/via-macii: Simplify locking 351e5ad327d07 macintosh/via-macii, macintosh/adb-iop: Modernize printk calls 47fd2060660e6 macintosh/via-macii, macintosh/adb-iop: Clean up whitespace Just for the sake of simplicity, the 'fixes' tags in this series limit backporting to 'v5.0+'. Finn Thain (9): macintosh/via-macii: Access autopoll_devs when inside lock macintosh/via-macii: Poll the device most likely to respond macintosh/via-macii: Handle /CTLR_IRQ signal correctly macintosh/via-macii: Remove read_done state macintosh/via-macii: Handle poll replies correctly macintosh/via-macii: Use bool type for reading_reply variable macintosh/via-macii: Use unsigned type for autopoll_devs variable macintosh/via-macii: Use the stack for reset request storage macintosh/via-macii: Clarify definition of macii_init() drivers/macintosh/via-macii.c | 324 +++++++++++++++++++--------------- 1 file changed, 179 insertions(+), 145 deletions(-) -- 2.26.2