From mboxrd@z Thu Jan 1 00:00:00 1970 From: kernel@martin.sperl.org Subject: [PATCH V2 0/9] spi: bcm2835aux: bug fixes and improvements Date: Sun, 24 Mar 2019 17:49:53 +0000 Message-ID: <20190324175002.28969-1-kernel@martin.sperl.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Martin Sperl 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 Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-spi.vger.kernel.org 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. --- 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 Martin Sperl (9): spi: bcm2835aux: unifying code between polling and interrupt driven code spi: bcm2835aux: remove dangerous uncontrolled read of fifo spi: bcm2835aux: use BCM2835_AUX_SPI_STAT_RX_LVL 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 | 207 +++++++++++++++++++++++++++++++------------ 1 file changed, 150 insertions(+), 57 deletions(-) -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AE33C43381 for ; Sun, 24 Mar 2019 17:50:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 69B0821741 for ; Sun, 24 Mar 2019 17:50:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l7YvAU/6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69B0821741 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=martin.sperl.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=S1JRw39A592LGbDOnChICbvr1MovJFaUSAQYB6M3Lww=; b=l7Y vAU/6RquR15SZ1qXULBQfRJArspk2902/j6CcIRb9nHoYmPbzlFiu3VZO9B+QPy4X49amSW0oouuh 7XQNaNsr1dyDynrJhi4/ecflougBIFxyqbugzh02aXJV1puW3PYW1XEKdGFL0tJeRIieKOEWYhrD+ n78efWGqlgTX6t+iAvKk9+lpLCqbQy3G168wmC8pa3Scz3JvVitG1Lc01GLXdA34IoTiPnBy+c7ly pLRdMPTxADrUKQoXAB6JlfIBQiVMMQ/nNZvcjnJVdAvUByZCbn9h5S0a4TO9WAdBaS+AuH8RQZiQO lmp1PXhQM2BfyTzi4GOsXySKLgVaqmQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h87GK-0007WH-88; Sun, 24 Mar 2019 17:50:24 +0000 Received: from 212-186-180-163.static.upcbusiness.at ([212.186.180.163] helo=cgate.sperl.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h87GF-0007UD-HH; Sun, 24 Mar 2019 17:50:21 +0000 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 7759424; Sun, 24 Mar 2019 17:50:10 +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 Subject: [PATCH V2 0/9] spi: bcm2835aux: bug fixes and improvements Date: Sun, 24 Mar 2019 17:49:53 +0000 Message-Id: <20190324175002.28969-1-kernel@martin.sperl.org> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190324_105019_745427_6E4DEF3D X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Sperl MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. --- 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 Martin Sperl (9): spi: bcm2835aux: unifying code between polling and interrupt driven code spi: bcm2835aux: remove dangerous uncontrolled read of fifo spi: bcm2835aux: use BCM2835_AUX_SPI_STAT_RX_LVL 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 | 207 +++++++++++++++++++++++++++++++------------ 1 file changed, 150 insertions(+), 57 deletions(-) -- 2.11.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel