All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pat LaVarre <p.lavarre@ieee.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH] atapi request sense work
Date: 27 May 2004 18:13:25 -0600	[thread overview]
Message-ID: <1085703205.5890.1.camel@patibmrh9> (raw)
In-Reply-To: <40B67A79.9000706@pobox.com>

Jeff G:

> As a first step, ...
> create a patch versus mainline, that does
> nothing but add this function (and uses it)?

Here you go.

"Here I chose { inline } over { static inline } because lately I saw you
counting libata.ko bytes."

"Here I chose u8 over int because lxr.linux.no/source/ suggests Linux
readb and inb return u8."

This patch names the repeated five lines without changing where they are
called.  I have included it inline but not also attached.  I confirmed
the lines repeat via diff -b.  I compiled, linked, cleared unit
attentions by unsolicited sense, read, and wrote.

Sorry I have not yet understood all your English.  I think/ hope this is
close enough to help.  I of course look forward to discovering if/ how I
can help more.

Pat LaVarre

diff -Nurp linux-2.6.7-rc1-bk4/include/linux/ata.h linux-2.6.7-rc1-bk4-pel/include/linux/ata.h
diff -Nurp linux-2.6.7-rc1-bk4/include/linux/libata.h linux-2.6.7-rc1-bk4-pel/include/linux/libata.h
diff -Nurp linux-2.6.7-rc1-bk4/drivers/scsi/libata-core.c linux-2.6.7-rc1-bk4-pel/drivers/scsi/libata-core.c
--- linux-2.6.7-rc1-bk4/drivers/scsi/libata-core.c	2004-05-27 16:40:42.000000000 -0600
+++ linux-2.6.7-rc1-bk4-pel/drivers/scsi/libata-core.c	2004-05-27 17:56:57.192826736 -0600
@@ -2146,6 +2146,22 @@ static void ata_pio_task(void *_data)
 }
 
 /**
+ *	ata_check_bmdma - read PCI IDE BMDMA status
+ *	@ap: struct ata_port
+ */
+
+static u8 ata_check_bmdma(struct ata_port *ap)
+{
+	u8 host_stat;
+	if (ap->flags & ATA_FLAG_MMIO) {
+		void *mmio = (void *) ap->ioaddr.bmdma_addr;
+		host_stat = readb(mmio + ATA_DMA_STATUS);
+	} else
+		host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+	return host_stat;
+}
+
+/**
  *	ata_eng_timeout - Handle timeout of queued command
  *	@ap: Port on which timed-out command is active
  *
@@ -2188,11 +2204,7 @@ void ata_eng_timeout(struct ata_port *ap
 
 	switch (qc->tf.protocol) {
 	case ATA_PROT_DMA:
-		if (ap->flags & ATA_FLAG_MMIO) {
-			void *mmio = (void *) ap->ioaddr.bmdma_addr;
-			host_stat = readb(mmio + ATA_DMA_STATUS);
-		} else
-			host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+		host_stat = ata_check_bmdma(ap);
 
 		printk(KERN_ERR "ata%u: DMA timeout, stat 0x%x\n",
 		       ap->id, host_stat);
@@ -2622,11 +2634,7 @@ inline unsigned int ata_host_intr (struc
 	/* BMDMA completion */
 	case ATA_PROT_DMA:
 	case ATA_PROT_ATAPI_DMA:
-		if (ap->flags & ATA_FLAG_MMIO) {
-			void *mmio = (void *) ap->ioaddr.bmdma_addr;
-			host_stat = readb(mmio + ATA_DMA_STATUS);
-		} else
-			host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+		host_stat = ata_check_bmdma(ap);
 		VPRINTK("BUS_DMA (host_stat 0x%X)\n", host_stat);
 
 		if (!(host_stat & ATA_DMA_INTR)) {
diff -Nurp linux-2.6.7-rc1-bk4/drivers/scsi/libata-scsi.c linux-2.6.7-rc1-bk4-pel/drivers/scsi/libata-scsi.c



  parent reply	other threads:[~2004-05-28  0:13 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-16 14:19 [PATCH] libata DMADIR support Pat LaVarre
2004-05-16 23:16 ` Jeff Garzik
2004-05-17 18:48   ` Pat LaVarre
2004-05-17 19:08     ` Jeff Garzik
2004-05-17 21:06       ` Pat LaVarre
2004-05-17 21:40         ` Jeff Garzik
2004-05-17 21:20       ` Pat LaVarre
2004-05-17 21:32         ` Jeff Garzik
2004-05-17 21:34           ` Jeff Garzik
2004-05-17 22:05           ` Pat LaVarre
2004-05-17 22:36             ` Jeff Garzik
2004-05-17 23:04               ` Pat LaVarre
2004-05-18 22:40               ` Pat LaVarre
2004-05-18 23:07                 ` Pat LaVarre
2004-05-18 23:50                   ` Jeff Garzik
2004-05-19 22:47                     ` Pat LaVarre
2004-05-18 23:48                 ` [PATCH] atapi request sense work Jeff Garzik
2004-05-19 20:35                   ` Pat LaVarre
2004-05-19 22:19                     ` Jeff Garzik
2004-05-19 22:24                   ` Pat LaVarre
2004-05-19 22:27                     ` Pat LaVarre
2004-05-19 22:54                   ` Pat LaVarre
2004-05-21  1:58                     ` Pat LaVarre
     [not found]                       ` <6 E36A 11B-AACB-11D8-8B8A-003065635034@ieee.org>
2004-05-21  2:06                       ` Pat LaVarre
2004-05-21  3:05                         ` Pat LaVarre
2004-05-21  4:04                           ` Jeff Garzik
     [not found]                             ` <1 085153750.6103.33.camel@patibmrh9>
2004-05-21 15:35                             ` Pat LaVarre
2004-05-21 15:46                               ` Bartlomiej Zolnierkiewicz
2004-05-21 17:59                                 ` Pat LaVarre
2004-05-21 20:07                                   ` Pat LaVarre
2004-05-21 21:51                                     ` Jeff Garzik
2004-05-21 23:12                                       ` Pat LaVarre
2004-05-21 23:24                                       ` Pat LaVarre
2004-05-21 23:55                                         ` Jeff Garzik
2004-05-21 23:57                                           ` Pat LaVarre
2004-05-21 23:39                                       ` Pat LaVarre
2004-05-21 23:45                                         ` Jeff Garzik
2004-05-22  0:06                                           ` Pat LaVarre
2004-05-22  0:12                                             ` Pat LaVarre
2004-05-22  0:33                                           ` Pat LaVarre
2004-05-22  1:11                                             ` Pat LaVarre
2004-05-26 21:49                                               ` Pat LaVarre
2004-05-27 23:12                                                 ` Pat LaVarre
2004-05-27 23:32                                                   ` Jeff Garzik
2004-05-27 23:38                                                     ` Pat LaVarre
2004-05-27 23:41                                                       ` Jeff Garzik
2004-05-28  0:13                                                     ` Pat LaVarre [this message]
2004-05-28  1:28                                                   ` Pat LaVarre
2004-05-24 15:27                                             ` Pat LaVarre
2004-05-21 21:59                                   ` Pat LaVarre
2004-05-21 18:23                                 ` Danny Cox
2004-05-21 18:39                                   ` Bartlomiej Zolnierkiewicz
2004-05-21 18:55                                     ` [PATCH] kmalloc old_hwif Danny Cox
2004-05-21 19:00                                     ` [PATCH] atapi request sense work Danny Cox
2004-05-21 19:08                                       ` Bartlomiej Zolnierkiewicz
  -- strict thread matches above, loose matches on Subject: below --
2004-05-21 18:45 dwm
2004-05-21 20:44 ` Pat LaVarre
2004-05-30 12:44 Pat LaVarre
2004-05-30 15:15 ` Pat LaVarre
2004-05-31 16:09   ` Pat LaVarre
2004-06-02  0:01     ` Pat LaVarre
2004-06-02 20:52       ` Pat LaVarre
2004-06-02 22:36         ` Pat LaVarre
2004-06-02 22:55           ` Jeff Garzik
2004-06-02 23:53           ` Pat LaVarre
2004-06-03  0:30             ` Pat LaVarre
2004-06-03  0:52               ` Jeff Garzik

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=1085703205.5890.1.camel@patibmrh9 \
    --to=p.lavarre@ieee.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /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.