From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH #upstream-fixes] libata: clear PIO pad area Date: Tue, 06 Sep 2011 21:28:43 +0400 Message-ID: <4E66584B.1000109@mvista.com> References: <20110906040905.GD18425@mtj.dyndns.org> <4E65F09F.6020508@ru.mvista.com> <20110906165854.GK18425@mtj.dyndns.org> <4E6656F5.1050901@ru.mvista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:57818 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752978Ab1IFRaB (ORCPT ); Tue, 6 Sep 2011 13:30:01 -0400 Received: by wwf5 with SMTP id 5so6488221wwf.1 for ; Tue, 06 Sep 2011 10:30:00 -0700 (PDT) In-Reply-To: <4E6656F5.1050901@ru.mvista.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Sergei Shtylyov Cc: Tejun Heo , Jeff Garzik , Alan Cox , linux-ide@vger.kernel.org, tom.leiming@gmail.com Hello. On 09/06/2011 09:23 PM, Sergei Shtylyov wrote: >>>> ata_sff_data_xfer[32]() use pad area if the transfer size isn't >>>> multiple of transfer size; however, this area wasn't cleared and >>>> garbage data in pad area could be transferred to the device. Make >>>> sure the pad area is cleared. >>>> Signed-off-by: Tejun Heo >>>> Cc: Lei Ming >>> And what's the problem with garbage data? Why it's worse than 0s? >> There were devices which puke on random garbage at the end of CDB and > Note that ATAPI CDBs are always aligned to 4 bytes, so this path should never be > hit when sending them. >> in general sending indeterministic garbage to external device is a bad >> idea. It increases chance of problems which can be difficult to >> reproduce and track down while gaining nothing. > Problems with "don't care" padding bytes? Dunno... >> It really is a stupid thing to do. > Well, at least the old code was equally stupid before I patched it. :-) Only in ata_sff_data_xfer32(). It was I who removed the padding buffer initialization in ata_sff_data_xfer()... >> Thanks. WBR, Sergei