Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Thu, 25 Dec 2008
 06:34:00 -0800
Received: from ausesmta2-2.messageone.com ([64.20.241.45]) by mail.onstor.com
 with Microsoft SMTPSVC(6.0.3790.3959);	 Thu, 25 Dec 2008 06:33:59 -0800
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])	by
 ausesmta2-2.messageone.com (8.13.8/8.13.8) with ESMTP id mBPEXw5T031953	for
 <andy.sharp@onstor.com>; Thu, 25 Dec 2008 08:33:58 -0600
Received: from localhost.localdomain ([127.0.0.1]:5515 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP	id S24208040AbYLYOdE
 (ORCPT <rfc822;andy.sharp@onstor.com>);	Thu, 25 Dec 2008 14:33:04 +0000
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 25 Dec 2008 14:32:48
 +0000 (GMT)
Received: from mba.ocn.ne.jp ([122.1.235.107]:57327 "HELO smtp.mba.ocn.ne.jp")
	by ftp.linux-mips.org with SMTP id S24132650AbYLYOcp (ORCPT
	<rfc822;linux-mips@linux-mips.org>); Thu, 25 Dec 2008 14:32:45 +0000
Received: from localhost.localdomain (p5019-ipad204funabasi.chiba.ocn.ne.jp
 [222.146.92.19])	by smtp.mba.ocn.ne.jp (Postfix) with ESMTP	id 0585AA420;
 Thu, 25 Dec 2008 23:32:39 +0900 (JST)
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>
CC: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>, "sshtylyov@ru.mvista.com"
	<sshtylyov@ru.mvista.com>, "linux-mips@linux-mips.org"
	<linux-mips@linux-mips.org>, stable <stable@kernel.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Thu, 25 Dec 2008 06:32:37 -0800
Subject: [PATCH] tx4939ide: Do not use zero count PRD entry
Thread-Topic: [PATCH] tx4939ide: Do not use zero count PRD entry
Thread-Index: AclmndOq93AZ7nbRTv+W8Ku74lUq0Q==
Message-ID: <1230215558-9197-1-git-send-email-anemo@mba.ocn.ne.jp>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 25 Dec 2008 14:33:59.0756 (UTC)
 FILETIME=[D34AC0C0:01C9669D]
errors-to: linux-mips-bounce@linux-mips.org
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
x-ems-stamp: C1vgiMAB/tCBf6FEWvnPEQ==
x-messageone-virus-version: vendor=fsecure
 engine=4.65.7400:2.4.4,1.2.40,4.0.164
 definitions=2008-12-25_02:2008-12-22,2008-12-25,2008-12-24 signatures=0
x-messageone-virus-scanned: Clean
x-messageone-envelope-sender: linux-mips-bounce@linux-mips.org
x-messageone-spam-details: rule=m773emszm_notspam policy=m773emszm score=0
 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam
 adjust=0 reason=mlx engine=3.1.0-0810130000 definitions=main-0812250055
x-messageone-spam-score: 0
x-messageone-spam-bar:
x-list: linux-mips
x-archive-position: 21668
x-ecartis-version: Ecartis v1.0.0
x-original-sender: anemo@mba.ocn.ne.jp
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

This fixes data corruption on some heavy load.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
---
 drivers/ide/tx4939ide.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c
index bafb7d1..30d0d25 100644
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -259,6 +259,12 @@ static int tx4939ide_build_dmatable(ide_drive_t *drive=
, struct request *rq)
 			bcount =3D 0x10000 - (cur_addr & 0xffff);
 			if (bcount > cur_len)
 				bcount =3D cur_len;
+			/*
+			 * This workaround for zero count seems required.
+			 * (standard ide_build_dmatable do it too)
+			 */
+			if ((bcount & 0xffff) =3D=3D 0x0000)
+				bcount =3D 0x8000;
 			*table++ =3D bcount & 0xffff;
 			*table++ =3D cur_addr;
 			cur_addr +=3D bcount;
--=20
1.5.6.3


