The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] 2.5.30 IDE 114
@ 2002-08-06 12:28 Marcin Dalecki
  0 siblings, 0 replies; only message in thread
From: Marcin Dalecki @ 2002-08-06 12:28 UTC (permalink / raw)
  To: Kernel Mailing List, Linus Torvalds

[-- 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 */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-06 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-06 12:28 [PATCH] 2.5.30 IDE 114 Marcin Dalecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox