/[linux-patches]/genpatches-2.6/tags/2.6.30-10/2500_ide-cd-handle-fragmented-patckets.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.30-10/2500_ide-cd-handle-fragmented-patckets.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1628 - (show annotations) (download)
Fri Nov 6 12:34:12 2009 UTC (8 years, 8 months ago) by mpagano
File size: 1749 byte(s)
2.6.30-10 release
1 From: Borislav Petkov <petkovbb@gmail.com>
2 Date: Fri, 26 Jun 2009 18:22:37 +0000 (-0700)
3 Subject: ide-cd: handle fragmented packet commands gracefully
4 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9c72ebef5aabf3532469d602a9d87beceea268b1
5
6 ide-cd: handle fragmented packet commands gracefully
7
8 There are some devices in the wild that clear the DRQ bit during the
9 last word of a packet command and therefore could use a "second chance"
10 for that last word of data to be xferred instead of simply failing the
11 request. Do that by attempting to suck in those last bytes in PIO mode.
12
13 In addition, the ATA_ERR bit has to be cleared for we cannot be sure the
14 data is valid otherwise.
15
16 See http://bugzilla.kernel.org/show_bug.cgi?id=13399 for details.
17
18 Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
19 Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
20 Signed-off-by: David S. Miller <davem@davemloft.net>
21 ---
22
23 diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
24 index f0ede59..6a9a769 100644
25 --- a/drivers/ide/ide-cd.c
26 +++ b/drivers/ide/ide-cd.c
27 @@ -592,9 +592,19 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
28 }
29 } else if (!blk_pc_request(rq)) {
30 ide_cd_request_sense_fixup(drive, cmd);
31 - /* complain if we still have data left to transfer */
32 +
33 uptodate = cmd->nleft ? 0 : 1;
34 - if (uptodate == 0)
35 +
36 + /*
37 + * suck out the remaining bytes from the drive in an
38 + * attempt to complete the data xfer. (see BZ#13399)
39 + */
40 + if (!(stat & ATA_ERR) && !uptodate && thislen) {
41 + ide_pio_bytes(drive, cmd, write, thislen);
42 + uptodate = cmd->nleft ? 0 : 1;
43 + }
44 +
45 + if (!uptodate)
46 rq->cmd_flags |= REQ_FAILED;
47 }
48 goto out_end;
49

  ViewVC Help
Powered by ViewVC 1.1.20