From patchwork Mon Mar 21 14:27:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 648041 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2LERTw3030855 for ; Mon, 21 Mar 2011 14:27:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270Ab1CUO12 (ORCPT ); Mon, 21 Mar 2011 10:27:28 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:51087 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376Ab1CUO11 (ORCPT ); Mon, 21 Mar 2011 10:27:27 -0400 Received: by eyx24 with SMTP id 24so1521433eyx.19 for ; Mon, 21 Mar 2011 07:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=PZlaZ3Mm81hTkoEcC29735SmrQIzVjZ5Hzq2EgR8H6k=; b=YSj9A52uoqQ+WmsiXX+F0crNAcaDFzqiHM4GGCvZw8cpJDrsJY9JwW02oxVbtMna7V P4u16MVizLO4dEOXRpApbhX8232ikn9DdWpfj/4S1UOxdnzCnYeULRhBCOcVtURh6LB9 xwcbv+9eu8PBJ/r18xkgPI1hksy3dedvR9xMM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=XShVceuS2h6wHZYrZYuzBVycPca9vnnpGCOZ/knzfIo0aJunRJEpyaouOdASEvScGr bQ9X7nEfJk6wQZqX79XdoZZt4pm1wRHalNNmzN2KzjQV+N/GDWpFJStaz65fEwZYZW3x YxoeXcF6lQfJL6acSg7XDwYmdPIDRr1053bSc= Received: by 10.213.100.65 with SMTP id x1mr1747817ebn.78.1300717646358; Mon, 21 Mar 2011 07:27:26 -0700 (PDT) Received: from localhost ([194.136.136.46]) by mx.google.com with ESMTPS id v1sm1997167eeh.20.2011.03.21.07.27.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Mar 2011 07:27:25 -0700 (PDT) From: Jarkko Nikula To: spi-devel-general@lists.sourceforge.net Cc: linux-omap@vger.kernel.org, Grant Likely , Jarkko Nikula , Michael Jones Subject: [PATCH-v2.6.39] spi/omap_mcspi: Fix broken last word xfer Date: Mon, 21 Mar 2011 16:27:30 +0200 Message-Id: <1300717650-28953-1-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Mar 2011 14:27:29 +0000 (UTC) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 3a5ed06..6f86ba0 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -517,7 +517,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) dev_vdbg(&spi->dev, "read-%d %02x\n", word_len, *(rx - 1)); } - } while (c > (word_len>>3)); + } while (c); } else if (word_len <= 16) { u16 *rx; const u16 *tx; @@ -564,7 +564,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) dev_vdbg(&spi->dev, "read-%d %04x\n", word_len, *(rx - 1)); } - } while (c > (word_len>>3)); + } while (c >= 2); } else if (word_len <= 32) { u32 *rx; const u32 *tx; @@ -611,7 +611,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer) dev_vdbg(&spi->dev, "read-%d %08x\n", word_len, *(rx - 1)); } - } while (c > (word_len>>3)); + } while (c >= 4); } /* for TX_ONLY mode, be sure all words have shifted out */