From patchwork Sat Mar 30 09:30:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Sperl X-Patchwork-Id: 10878197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 522D815AC for ; Sat, 30 Mar 2019 09:31:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A265290CC for ; Sat, 30 Mar 2019 09:31:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D84A290D6; Sat, 30 Mar 2019 09:31:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94462290CC for ; Sat, 30 Mar 2019 09:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730384AbfC3JbQ (ORCPT ); Sat, 30 Mar 2019 05:31:16 -0400 Received: from 212-186-180-163.static.upcbusiness.at ([212.186.180.163]:55020 "EHLO cgate.sperl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730372AbfC3JbQ (ORCPT ); Sat, 30 Mar 2019 05:31:16 -0400 Received: from hc1.intern.sperl.org (account martin@sperl.org [10.10.10.59] verified) by sperl.org (CommuniGate Pro SMTP 6.2.1 _community_) with ESMTPSA id 7760017; Sat, 30 Mar 2019 09:31:12 +0000 From: kernel@martin.sperl.org To: Mark Brown , Eric Anholt , Stefan Wahren , Hubert Denkmair , linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Martin Sperl Subject: [PATCH V3 0/9] spi: bcm2835aux: bug fixes and improvements Date: Sat, 30 Mar 2019 09:30:57 +0000 Message-Id: <20190330093106.20723-1-kernel@martin.sperl.org> X-Mailer: git-send-email 2.11.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Sperl Set of patches improving the spi-bcm2835aux driver and fixing a data read corruption bug. The main motivation is a rare data corruption fix that is mostly observed in polling mode first reported by Hubert Denkmair. So this patchset first implements a means to control the parameters of when polling mode is used via module parameters and exports the corresponding statistics. As stated in original patch the driver does not support native CS. But when cs-gpios is not configured in the dt (so a buggy dt) it is still working with a lot of limitations, but the driver does not report this fact. So this patchset adds reporting and allows for a single native CS (with limited functionality) to continue working with a buggy DT. One question here remains: do we need to legacy support DTs that are not following specs in the first place? Then there is the real fix for the data-corruption which is split into 3 parts: some code cleanup with code reuse, removing "dangerous" fifo read (possibly introducing fifo data corruption) and safe fifo read. Also we remove some dead code. Acked-by: Stefan Wahren --- Changelog: V1 -> V2: reordering commits as per request of Stefan Wahren to help backporting the "essential" bugfixes go in first remove the dependency on a different patchset focused on making cs_change delay configurable V2 -> V3: incorporated feedback by Stefan Wahren Martin Sperl (9): spi: bcm2835aux: unifying code between polling and interrupt driven code spi: bcm2835aux: remove dangerous uncontrolled read of fifo spi: bcm2835aux: fix corruptions for longer spi transfers spi: bcm2835aux: remove dead code spi: bcm2835aux: fix driver to not allow 65535 (=-1) cs-gpios spi: bcm2835aux: warn in dmesg that native cs is not really supported spi: bcm2835aux: setup gpio-cs to output and correct level during setup spi: bcm2835aux: add driver stats to debugfs spi: bcm2835aux: make the polling duration limits configurable drivers/spi/spi-bcm2835aux.c | 204 +++++++++++++++++++++++++++++++------------ 1 file changed, 147 insertions(+), 57 deletions(-) -- 2.11.0