From patchwork Tue Dec 17 20:42:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 3365241 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A3FBDC0D4A for ; Tue, 17 Dec 2013 20:43:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E59D1203AE for ; Tue, 17 Dec 2013 20:43:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C809B203B5 for ; Tue, 17 Dec 2013 20:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753812Ab3LQUnO (ORCPT ); Tue, 17 Dec 2013 15:43:14 -0500 Received: from arrakis.dune.hu ([78.24.191.176]:54931 "EHLO arrakis.dune.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753386Ab3LQUnO (ORCPT ); Tue, 17 Dec 2013 15:43:14 -0500 Received: from localhost (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8DDD128146E; Tue, 17 Dec 2013 21:40:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Virus-Scanned: at arrakis.dune.hu Received: from shaker64.lan (dslb-088-073-137-004.pools.arcor-ip.net [88.73.137.4]) by arrakis.dune.hu (Postfix) with ESMTPSA id 4A09C28A903; Tue, 17 Dec 2013 21:40:37 +0100 (CET) From: Jonas Gorski To: linux-spi@vger.kernel.org Cc: Mark Brown , Maxime Bizon , Florian Fainelli , Kevin Cernekee Subject: [PATCH 2/4] spi/bcm63xx: don't reject reads >= 256 bytes Date: Tue, 17 Dec 2013 21:42:08 +0100 Message-Id: <1387312930-22436-3-git-send-email-jogo@openwrt.org> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1387312930-22436-1-git-send-email-jogo@openwrt.org> References: <1387312930-22436-1-git-send-email-jogo@openwrt.org> 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 The rx_tail register is only 8 bit wide, so it will wrap around after 256 read bytes. This makes it rather meaningless, so drop any usage of it to not treat reads over 256 as failed. Signed-off-by: Jonas Gorski Acked-by: Florian Fainelli --- drivers/spi/spi-bcm63xx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 5693b4f..ae60731 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -203,13 +203,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first, if (!timeout) return -ETIMEDOUT; - /* read out all data */ - rx_tail = bcm_spi_readb(bs, SPI_RX_TAIL); - - if (do_rx && rx_tail != len) - return -EIO; - - if (!rx_tail) + if (!do_rx) return 0; len = 0;