LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Takao Indoh <indou.takao@soft.fujitsu.com>
To: linux-kernel@vger.kernel.org
Subject: [3/4] [PATCH]Diskdump - yet another crash dump function
Date: Thu, 27 May 2004 21:39:12 +0900	[thread overview]
Message-ID: <1FC443E79D3948indou.takao@soft.fujitsu.com> (raw)
In-Reply-To: <1CC443CDA50AF2indou.takao@soft.fujitsu.com>

This is a patch for aic7xxx driver.

Best Regards,
Takao Indoh

diff -Nur linux-2.6.6.org/drivers/scsi/aic7xxx/aic7xxx_osm.c linux-2.6.6/drivers/scsi/aic7xxx/aic7xxx_osm.c
--- linux-2.6.6.org/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-05-20 08:58:47.000000000 +0900
+++ linux-2.6.6/drivers/scsi/aic7xxx/aic7xxx_osm.c	2004-05-27 11:06:13.000000000 +0900
@@ -774,6 +774,8 @@
 static int	   ahc_linux_bus_reset(Scsi_Cmnd *);
 static int	   ahc_linux_dev_reset(Scsi_Cmnd *);
 static int	   ahc_linux_abort(Scsi_Cmnd *);
+static int	   ahc_linux_sanity_check(Scsi_Device *);
+static void	   ahc_linux_poll(Scsi_Device *);
 
 /*
  * Calculate a safe value for AHC_NSEG (as expressed through ahc_linux_nseg).
@@ -1294,6 +1296,11 @@
 	return SUCCESS;
 }
 
+static struct scsi_dump_ops ahc_dump_ops = {
+	.sanity_check   = ahc_linux_sanity_check,
+	.poll           = ahc_linux_poll,
+};
+
 Scsi_Host_Template aic7xxx_driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "aic7xxx",
@@ -1313,6 +1320,7 @@
 	.slave_alloc		= ahc_linux_slave_alloc,
 	.slave_configure	= ahc_linux_slave_configure,
 	.slave_destroy		= ahc_linux_slave_destroy,
+	.dump_ops		= &ahc_dump_ops,
 };
 
 /**************************** Tasklet Handler *********************************/
@@ -3863,6 +3871,41 @@
 	return IRQ_RETVAL(ours);
 }
 
+static int
+ahc_linux_sanity_check(Scsi_Device *device)
+{
+	struct ahc_softc *ahc;
+	struct ahc_linux_device *dev;
+
+	ahc = *(struct ahc_softc **)device->host->hostdata;
+	dev = ahc_linux_get_device(ahc, device->channel,
+				   device->id, device->lun,
+					   /*alloc*/FALSE);
+	if (dev == NULL)
+		return -ENXIO;
+	if (ahc->platform_data->qfrozen || dev->qfrozen)
+		return -EBUSY;
+	if (spin_is_locked(&ahc->platform_data->spin_lock))
+		return -EBUSY;
+	return 0;
+}
+
+static void
+ahc_linux_poll(Scsi_Device *device)
+{
+	struct ahc_softc *ahc;
+	struct ahc_linux_device *dev;
+
+	ahc = *(struct ahc_softc **)device->host->hostdata;
+	ahc_intr(ahc);
+	while ((dev = ahc_linux_next_device_to_run(ahc)) != NULL) {
+		TAILQ_REMOVE(&ahc->platform_data->device_runq, dev, links);
+		dev->flags &= ~AHC_DEV_ON_RUN_LIST;
+		ahc_linux_check_device_queue(ahc, dev);
+	}
+	ahc_linux_run_complete_queue(ahc);
+}
+
 void
 ahc_platform_flushwork(struct ahc_softc *ahc)
 {
diff -Nur linux-2.6.6.org/drivers/scsi/aic7xxx/aic7xxx_osm.h linux-2.6.6/drivers/scsi/aic7xxx/aic7xxx_osm.h
--- linux-2.6.6.org/drivers/scsi/aic7xxx/aic7xxx_osm.h	2004-05-20 08:58:47.000000000 +0900
+++ linux-2.6.6/drivers/scsi/aic7xxx/aic7xxx_osm.h	2004-05-27 10:58:39.000000000 +0900
@@ -67,6 +67,7 @@
 #include <linux/smp_lock.h>
 #include <linux/version.h>
 #include <linux/module.h>
+#include <linux/diskdumplib.h>
 #include <asm/byteorder.h>
 #include <asm/io.h>
 
@@ -87,6 +88,8 @@
 #include "scsi.h"
 #include "hosts.h"
 
+#include "scsi_dump.h"
+
 /* Name space conflict with BSD queue macros */
 #ifdef LIST_HEAD
 #undef LIST_HEAD
@@ -253,6 +256,22 @@
  */
 #define ahc_dmamap_sync(ahc, dma_tag, dmamap, offset, len, op)
 
+
+/******************************** Disk dump ***********************************/
+#if defined(CONFIG_DISKDUMP) || defined(CONFIG_DISKDUMP_MODULE)
+#undef  add_timer
+#define add_timer       diskdump_add_timer
+#undef  del_timer_sync
+#define del_timer_sync  diskdump_del_timer
+#undef  del_timer
+#define del_timer       diskdump_del_timer
+#undef  mod_timer
+#define mod_timer       diskdump_mod_timer
+
+#define tasklet_schedule        diskdump_tasklet_schedule
+#endif
+
+
 /************************** Timer DataStructures ******************************/
 typedef struct timer_list ahc_timer_t;
 


  parent reply	other threads:[~2004-05-27 12:38 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27  9:33 [PATCH]Diskdump - yet another crash dump function Takao Indoh
2004-05-27 12:36 ` [1/4] " Takao Indoh
2004-05-27 12:37 ` [2/4] " Takao Indoh
2004-05-27 13:48   ` Christoph Hellwig
2004-05-28  2:13     ` Takao Indoh
2004-05-27 12:39 ` Takao Indoh [this message]
2004-05-27 13:51   ` [3/4] " Christoph Hellwig
2004-05-27 21:04     ` Ingo Molnar
2004-06-17 11:34       ` Takao Indoh
2004-06-17 12:00         ` Christoph Hellwig
2004-06-17 12:45           ` Takao Indoh
2004-06-17 12:13         ` Ingo Molnar
2004-06-17 12:18           ` Christoph Hellwig
2004-06-17 12:32             ` Ingo Molnar
2004-06-17 14:56               ` Jeff Moyer
2004-06-17 15:45                 ` Nobuhiro Tachino
2004-06-17 13:04           ` Takao Indoh
2004-06-17 13:10             ` Ingo Molnar
2004-06-17 13:11               ` Ingo Molnar
2004-06-17 13:15                 ` Ingo Molnar
2004-06-17 14:00                 ` Takao Indoh
2004-06-17 14:45                   ` Nobuhiro Tachino
2004-06-17 14:53                     ` Takao Indoh
2004-06-18 12:02           ` Takao Indoh
2004-06-21 20:40             ` Nobuhiro Tachino
2004-06-22 10:19               ` Ingo Molnar
2004-06-23 12:11                 ` Takao Indoh
2004-06-23 13:00                   ` Takao Indoh
2004-06-21  5:46           ` Keith Owens
2004-06-21  6:25             ` Takao Indoh
2004-06-22  4:21             ` Rob Landley
2004-06-22  7:56             ` Ingo Molnar
2004-05-28  9:38     ` Takao Indoh
2004-05-27 12:40 ` [4/4] " Takao Indoh
2004-05-27 13:34 ` [Document][PATCH]Diskdump " Takao Indoh
2004-06-03 13:10 ` [PATCH]Diskdump " Pavel Machek
2004-06-04  0:44   ` Takao Indoh
2004-06-04  9:33     ` Pavel Machek
     [not found] <20pwP-55v-5@gated-at.bofh.it>
     [not found] ` <20suK-7C5-11@gated-at.bofh.it>
     [not found]   ` <20tAB-5c-31@gated-at.bofh.it>
     [not found]     ` <20AiB-69m-17@gated-at.bofh.it>
2004-05-27 21:31       ` [3/4] " Andi Kleen
2004-05-28  7:38         ` Ingo Molnar

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=1FC443E79D3948indou.takao@soft.fujitsu.com \
    --to=indou.takao@soft.fujitsu.com \
    --cc=linux-kernel@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 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).