From: Takao Indoh <indou.takao@soft.fujitsu.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 4/4][diskdump] x86-64 support
Date: Sat, 28 Aug 2004 18:48:11 +0900 [thread overview]
Message-ID: <8DC48CE421568Cindou.takao@soft.fujitsu.com> (raw)
In-Reply-To: <89C48CE36A27FFindou.takao@soft.fujitsu.com>
This is a patch for Fusion-MPT scsi driver.
diff -Nur linux-2.6.8.1.org/drivers/message/fusion/mptbase.c linux-2.6.8.1/drivers/message/fusion/mptbase.c
--- linux-2.6.8.1.org/drivers/message/fusion/mptbase.c 2004-08-25 15:55:50.548987590 +0900
+++ linux-2.6.8.1/drivers/message/fusion/mptbase.c 2004-08-25 19:02:34.647483153 +0900
@@ -5950,6 +5950,22 @@
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ * mpt_poll_interrupt - Check the status of interrupt and if any interrupt
+ * are triggered, call interrupt handler.
+ * @ioc: Pointer to MPT_ADAPTER structure
+ */
+void
+mpt_poll_interrupt(MPT_ADAPTER *ioc)
+{
+ u32 intstat;
+
+ intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
+
+ if (intstat & MPI_HIS_REPLY_MESSAGE_INTERRUPT)
+ mpt_interrupt(0, ioc, NULL);
+}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
EXPORT_SYMBOL(ioc_list);
EXPORT_SYMBOL(mpt_proc_root_dir);
@@ -5988,6 +6004,7 @@
EXPORT_SYMBOL(mpt_ASCQ_TableSz);
EXPORT_SYMBOL(mpt_ScsiOpcodesPtr);
+EXPORT_SYMBOL(mpt_poll_interrupt);
static struct pci_driver mptbase_driver = {
.name = "mptbase",
diff -Nur linux-2.6.8.1.org/drivers/message/fusion/mptbase.h linux-2.6.8.1/drivers/message/fusion/mptbase.h
--- linux-2.6.8.1.org/drivers/message/fusion/mptbase.h 2004-08-25 15:55:50.546057903 +0900
+++ linux-2.6.8.1/drivers/message/fusion/mptbase.h 2004-08-25 19:03:35.213888661 +0900
@@ -1075,6 +1075,7 @@
extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);
+extern void mpt_poll_interrupt(MPT_ADAPTER *ioc);
/*
* Public data decl's...
@@ -1090,6 +1091,23 @@
extern const char **mpt_ScsiOpcodesPtr;
extern int mpt_ASCQ_TableSz;
+/*
+ * Dump stuff...
+ */
+#include <linux/diskdump.h>
+
+#define MPT_HOST_LOCK(host_lock) \
+ if (crashdump_mode()) \
+ spin_lock(host_lock); \
+ else \
+ spin_lock_irq(host_lock);
+
+#define MPT_HOST_UNLOCK(host_lock) \
+ if (crashdump_mode()) \
+ spin_unlock(host_lock); \
+ else \
+ spin_unlock_irq(host_lock);
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* } __KERNEL__ */
diff -Nur linux-2.6.8.1.org/drivers/message/fusion/mptscsih.c linux-2.6.8.1/drivers/message/fusion/mptscsih.c
--- linux-2.6.8.1.org/drivers/message/fusion/mptscsih.c 2004-08-25 15:55:50.548987590 +0900
+++ linux-2.6.8.1/drivers/message/fusion/mptscsih.c 2004-08-25 19:02:34.652365965 +0900
@@ -2892,7 +2892,7 @@
/* If our attempts to reset the host failed, then return a failed
* status. The host will be taken off line by the SCSI mid-layer.
*/
- spin_unlock_irq(host_lock);
+ MPT_HOST_UNLOCK(host_lock);
if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){
status = FAILED;
} else {
@@ -2902,7 +2902,7 @@
hd->tmPending = 0;
hd->tmState = TM_STATE_NONE;
}
- spin_lock_irq(host_lock);
+ MPT_HOST_LOCK(host_lock);
dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: "
@@ -3284,6 +3284,49 @@
return 0;
}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ * OS entry point to check whether the host drivier is sane enough
+ * to be used for saving crash dump. Called once when system crash
+ * occurs.
+ */
+int
+mptscsih_sanity_check(struct scsi_device *sdev)
+{
+ MPT_ADAPTER *ioc;
+ MPT_SCSI_HOST *hd;
+
+ hd = (MPT_SCSI_HOST *) sdev->host->hostdata;
+ if (!hd)
+ return -ENXIO;
+ ioc = hd->ioc;
+
+ /* message frame freeQ is busy */
+ if (spin_is_locked(&ioc->FreeQlock))
+ return -EBUSY;
+
+ return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ * OS entry point to poll whether the adapter issue the interrupts.
+ * Called repeatedly after I/O commands are issued to this adapter.
+ */
+void
+mptscsih_poll(struct scsi_device *sdev)
+{
+ MPT_SCSI_HOST *hd;
+
+ hd = (MPT_SCSI_HOST *) sdev->host->hostdata;
+ if (!hd)
+ return;
+
+ /* check interrupt pending */
+ mpt_poll_interrupt(hd->ioc);
+}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
@@ -3764,6 +3807,8 @@
.max_sectors = 8192,
.cmd_per_lun = 7,
.use_clustering = ENABLE_CLUSTERING,
+ .dump_sanity_check = mptscsih_sanity_check,
+ .dump_poll = mptscsih_poll,
};
@@ -5580,6 +5625,9 @@
}
spin_unlock_irqrestore(&dvtaskQ_lock, flags);
+ if (crashdump_mode())
+ return;
+
/* For this ioc, loop through all devices and do dv to each device.
* When complete with this ioc, search through the ioc list, and
* for each scsi ioc found, do dv for all devices. Exit when no
next prev parent reply other threads:[~2004-08-28 9:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-28 9:43 [PATCH 0/4][diskdump] x86-64 support Takao Indoh
2004-08-28 9:44 ` [PATCH 1/4][diskdump] " Takao Indoh
2004-08-28 9:45 ` [PATCH 2/4][diskdump] " Takao Indoh
2004-08-28 10:21 ` Christoph Hellwig
2004-08-28 9:47 ` [PATCH 3/4][diskdump] " Takao Indoh
2004-08-28 9:48 ` Takao Indoh [this message]
2004-08-28 10:23 ` [PATCH 4/4][diskdump] " Christoph Hellwig
2004-08-31 9:10 ` Takao Indoh
2004-09-04 11:11 ` Christoph Hellwig
2004-09-04 22:31 ` Lee Revell
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=8DC48CE421568Cindou.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 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.