linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Brad Rosser <brad.rosser@gmail.com>
Cc: petkovbb@gmail.com, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: IDE cdrom problem with PLEXTOR DVDR PX-608AL
Date: Mon, 25 Feb 2008 14:56:17 +0100	[thread overview]
Message-ID: <200802251456.17533.bzolnier@gmail.com> (raw)
In-Reply-To: <426a98560802241758j7a9be21m5eecc120ada804e4@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

On Monday 25 February 2008, Brad Rosser wrote:

[...]

> Bart wrote:
> 
> > Does the following patch help?
> >
> > [ It makes ireason handling for REQ_TYPE_ATA_PC requests be the same as
> > for other request types so "ireason == 1" quirk is used if needed. ]
> 
> I tried to apply the patch but failed; I probably did something wrong.
> I deleted everything in your message above 'Index: b/drivers/ide/ide-cd.c'
> and ran 'patch --dry-run -b -p1 < ../bart_patch'.  This is part of my script
> log:
> 
> root:/usr/src/linux-2.6.25-rc2# pwd
> /usr/src/linux-2.6.25-rc2
> root:/usr/src/linux-2.6.25-rc2# cat ../bart_patch
> Index: b/drivers/ide/ide-cd.c
> ===================================================================
> --- a/drivers/ide/ide-cd.c
> +++ b/drivers/ide/ide-cd.c
> @@ -670,8 +670,8 @@ static void cdrom_buffer_sectors (ide_dr
>  * and attempt to recover if there are problems.  Returns  0 if everything's
> ...
> ...
> root:/usr/src/linux-2.6.25-rc2# patch --dry-run -b -p1 < ../bart_patch
> patching file drivers/ide/ide-cd.c
> Hunk #1 FAILED at 670.
> Hunk #2 FAILED at 701.
> Hunk #3 FAILED at 1074.
> Hunk #4 FAILED at 1104.
> 4 out of 4 hunks FAILED -- saving rejects to file drivers/ide/ide-cd.c.rej

Same command works just fine for me with 2.6.25-rc2/3.

It could be that the patch got damaged somewhere on the way
(to eleminate this possibility I'm attaching it to this mail).

Thanks,
Bart

[-- Attachment #2: ide-cd-fix-ireason-handling-for-req_type_ata_pc.patch --]
[-- Type: text/x-diff, Size: 1969 bytes --]

---
 drivers/ide/ide-cd.c |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -670,8 +670,8 @@ static void cdrom_buffer_sectors (ide_dr
  * and attempt to recover if there are problems.  Returns  0 if everything's
  * ok; nonzero if the request has been terminated.
  */
-static
-int ide_cd_check_ireason(ide_drive_t *drive, int len, int ireason, int rw)
+static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
+				int len, int ireason, int rw)
 {
 	/*
 	 * ireason == 0: the drive wants to receive data from us
@@ -701,6 +701,9 @@ int ide_cd_check_ireason(ide_drive_t *dr
 				drive->name, __FUNCTION__, ireason);
 	}
 
+	if (rq->cmd_type == REQ_TYPE_ATA_PC)
+		rq->cmd_flags |= REQ_FAILED;
+
 	cdrom_end_request(drive, 0);
 	return -1;
 }
@@ -1071,11 +1074,11 @@ static ide_startstop_t cdrom_newpc_intr(
 	/*
 	 * check which way to transfer data
 	 */
-	if (blk_fs_request(rq) || blk_pc_request(rq)) {
-		if (ide_cd_check_ireason(drive, len, ireason, write))
-			return ide_stopped;
+	if (ide_cd_check_ireason(drive, rq, len, ireason, write))
+		return ide_stopped;
 
-		if (blk_fs_request(rq) && write == 0) {
+	if (blk_fs_request(rq)) {
+		if (write == 0) {
 			int nskip;
 
 			if (ide_cd_check_transfer_size(drive, len)) {
@@ -1101,16 +1104,9 @@ static ide_startstop_t cdrom_newpc_intr(
 	if (ireason == 0) {
 		write = 1;
 		xferfunc = HWIF(drive)->atapi_output_bytes;
-	} else if (ireason == 2 || (ireason == 1 &&
-		   (blk_fs_request(rq) || blk_pc_request(rq)))) {
+	} else {
 		write = 0;
 		xferfunc = HWIF(drive)->atapi_input_bytes;
-	} else {
-		printk(KERN_ERR "%s: %s: The drive "
-				"appears confused (ireason = 0x%02x). "
-				"Trying to recover by ending request.\n",
-				drive->name, __FUNCTION__, ireason);
-		goto end_request;
 	}
 
 	/*

  parent reply	other threads:[~2008-02-25 13:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <426a98560802232138q41d45d52ta515f1b791e937f4@mail.gmail.com>
2008-02-24 17:34 ` IDE cdrom problem with PLEXTOR DVDR PX-608AL Borislav Petkov
2008-02-24 18:16   ` Bartlomiej Zolnierkiewicz
2008-02-25  1:58   ` Brad Rosser
2008-02-25  5:34     ` Borislav Petkov
2008-02-25  5:57       ` Brad Rosser
2008-02-25 14:45         ` Borislav Petkov
2008-02-26  8:32           ` Brad Rosser
2008-02-26 17:46             ` Borislav Petkov
2008-02-26 20:48               ` Bartlomiej Zolnierkiewicz
2008-02-25 13:56     ` Bartlomiej Zolnierkiewicz [this message]
2008-02-12  9:26 Hans-Peter Jansen
2008-02-12 17:20 ` Borislav Petkov
2008-02-13 23:37   ` Hans-Peter Jansen
2008-02-14  6:26     ` Borislav Petkov
2008-02-14 10:08       ` Hans-Peter Jansen
2008-02-14 12:24       ` Bartlomiej Zolnierkiewicz
2008-02-14 13:42         ` Boris Petkov
2008-02-15 10:50           ` Borislav Petkov

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=200802251456.17533.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=brad.rosser@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).