All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Borislav Petkov <petkovbb@googlemail.com>,
	David Miller <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ide-cd: handle fragmented packet commands gracefully
Date: Mon, 22 Jun 2009 11:50:22 +0200	[thread overview]
Message-ID: <200906221150.22992.bzolnier@gmail.com> (raw)
In-Reply-To: <1245574527-2104-1-git-send-email-petkovbb@gmail.com>

On Sunday 21 June 2009 10:55:27 Borislav Petkov wrote:
> There are some devices in the wild that clear the DRQ bit during the
> last word of a packet command and therefore could use a "second chance"
> for that last word of data to be xferred instead of simply failing the
> request. Do that by attempting to suck in those last bytes in PIO mode.
> 
> In addition, the ATA_ERR bit has to be cleared for we cannot be sure the
> data is valid otherwise.
> 
> See http://bugzilla.kernel.org/show_bug.cgi?id=13399 for details.
> 
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

> ---
>  drivers/ide/ide-cd.c |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> index 4a19686..8d3f7d0 100644
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -592,9 +592,19 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
>  			}
>  		} else if (!blk_pc_request(rq)) {
>  			ide_cd_request_sense_fixup(drive, cmd);
> -			/* complain if we still have data left to transfer */
> +
>  			uptodate = cmd->nleft ? 0 : 1;
> -			if (uptodate == 0)
> +
> +			/*
> +			 * suck out the remaining bytes from the drive in an
> +			 * attempt to complete the data xfer. (see BZ#13399)
> +			 */
> +			if (!(stat & ATA_ERR) && !uptodate && thislen) {
> +				ide_pio_bytes(drive, cmd, write, thislen);
> +				uptodate = cmd->nleft ? 0 : 1;
> +			}
> +
> +			if (!uptodate)
>  				rq->cmd_flags |= REQ_FAILED;
>  		}
>  		goto out_end;

  reply	other threads:[~2009-06-22 11:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-21  8:55 [PATCH] ide-cd: handle fragmented packet commands gracefully Borislav Petkov
2009-06-21  8:55 ` Borislav Petkov
2009-06-22  9:50 ` Bartlomiej Zolnierkiewicz [this message]
2009-06-26  8:19   ` Borislav Petkov
2009-06-26 16:23     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200906221150.22992.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.