linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcin Dalecki <dalecki@evision.ag>
To: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@transmeta.com>
Subject: [PATCH] 2.5.30 IDE 114
Date: Tue, 06 Aug 2002 14:28:14 +0200	[thread overview]
Message-ID: <3D4FC0DE.9050608@evision.ag> (raw)

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

- Fix allocation problem introduced in 113 as suggested by Jens.
   (Thanks go to  Jens for providing info how to use properly
    blk_get_request in  this case. Nevermind I just got confused by
    __blk_get_request in TCQ  code, which made me worry about queue depth
    strain.)
   (Note: SCSI should propably be using the same mechanism instead of
    sr_request. At least we should check the code in question there.)

[-- Attachment #2: ide-114.diff --]
[-- Type: text/plain, Size: 1871 bytes --]

diff -durNp -X /tmp/diff.WY9PFG linux-2.5.30/drivers/ide/ide-taskfile.c linux/drivers/ide/ide-taskfile.c
--- linux-2.5.30/drivers/ide/ide-taskfile.c	2002-08-06 14:15:07.000000000 +0200
+++ linux/drivers/ide/ide-taskfile.c	2002-08-06 14:02:37.000000000 +0200
@@ -188,18 +188,20 @@ static ide_startstop_t special_intr(stru
 
 int ide_raw_taskfile(struct ata_device *drive, struct ata_taskfile *ar, char *buf)
 {
-	struct request *rq = &drive->srequest;
+	struct request *rq;
+	int errors;
 	struct ata_channel *ch = drive->channel;
 	request_queue_t *q = &drive->queue;
 	DECLARE_COMPLETION(wait);
 
 #ifdef CONFIG_BLK_DEV_PDC4030
+	/* special drive cmds not supported */
 	if (ch->chipset == ide_pdc4030 && buf)
-		return -ENOSYS;  /* special drive cmds not supported */
+		return -ENOSYS;
 #endif
 
+	rq = blk_get_request(q, READ, __GFP_WAIT);
 	memset(rq, 0, sizeof(*rq));
-
 	rq->buffer = buf;
 	rq->rq_status = RQ_ACTIVE;
 	rq->waiting = &wait;
@@ -208,9 +210,12 @@ int ide_raw_taskfile(struct ata_device *
 	ar->command_type = IDE_DRIVE_TASK_NO_DATA;
 
 	blk_insert_request(q, rq, 1, ar);
-	wait_for_completion(&wait);	/* wait for it to be serviced */
+	wait_for_completion(&wait);
 
-	return rq->errors ? -EIO : 0;	/* return -EIO if errors */
+	errors = rq->errors;
+	blk_put_request(rq);
+
+	return errors ? -EIO : 0;
 }
 
 EXPORT_SYMBOL(ata_read);
diff -durNp -X /tmp/diff.WY9PFG linux-2.5.30/include/linux/ide.h linux/include/linux/ide.h
--- linux-2.5.30/include/linux/ide.h	2002-08-06 14:15:07.000000000 +0200
+++ linux/include/linux/ide.h	2002-08-06 14:04:32.000000000 +0200
@@ -763,7 +763,6 @@ struct ata_device {
 
 	request_queue_t	queue;		/* per device request queue */
 	struct request *rq;		/* current request */
-	struct request srequest;	/* special requests */
 
 	u8	 retry_pio;		/* retrying dma capable host in pio */
 	u8	 state;			/* retry state */

                 reply	other threads:[~2002-08-06 12:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3D4FC0DE.9050608@evision.ag \
    --to=dalecki@evision.ag \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@dalecki.de \
    --cc=torvalds@transmeta.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).