public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Takao Indoh <indou.takao@soft.fujitsu.com>
To: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org
Subject: [PATCH 5/5][Diskdump] IPF(IA64) support
Date: Fri, 23 Jul 2004 09:58:50 +0000	[thread overview]
Message-ID: <19C4709BA75270indou.takao@soft.fujitsu.com> (raw)
In-Reply-To: <14C4709A99D341indou.takao@soft.fujitsu.com>

This is a patch for Fusion-MPT scsi driver.


diff -Nur linux-2.6.7.org/drivers/message/fusion/linux_compat.h linux-2.6.7/drivers/message/fusion/linux_compat.h
--- linux-2.6.7.org/drivers/message/fusion/linux_compat.h	2004-06-22 10:27:55.000000000 +0900
+++ linux-2.6.7/drivers/message/fusion/linux_compat.h	2004-07-23 15:10:53.110010272 +0900
@@ -192,6 +192,18 @@
 #define MPT_INIT_WORK(_task, _func, _data) INIT_WORK(_task, _func, _data)
 #define mpt_sync_irq(_irq) synchronize_irq(_irq)
 
+#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 /* _LINUX_COMPAT_H */
 
diff -Nur linux-2.6.7.org/drivers/message/fusion/mptbase.c linux-2.6.7/drivers/message/fusion/mptbase.c
--- linux-2.6.7.org/drivers/message/fusion/mptbase.c	2004-06-22 10:27:55.000000000 +0900
+++ linux-2.6.7/drivers/message/fusion/mptbase.c	2004-07-23 15:10:53.114009664 +0900
@@ -6292,6 +6292,17 @@
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+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, (void *)ioc, (struct pt_regs *)NULL);
+}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
 EXPORT_SYMBOL(mpt_adapters);
 EXPORT_SYMBOL(mpt_proc_root_dir);
@@ -6332,6 +6343,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.7.org/drivers/message/fusion/mptbase.h linux-2.6.7/drivers/message/fusion/mptbase.h
--- linux-2.6.7.org/drivers/message/fusion/mptbase.h	2004-06-22 10:27:55.000000000 +0900
+++ linux-2.6.7/drivers/message/fusion/mptbase.h	2004-07-23 15:10:53.115009512 +0900
@@ -1066,6 +1066,8 @@
 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...
  */
diff -Nur linux-2.6.7.org/drivers/message/fusion/mptscsih.c linux-2.6.7/drivers/message/fusion/mptscsih.c
--- linux-2.6.7.org/drivers/message/fusion/mptscsih.c	2004-06-22 10:27:55.000000000 +0900
+++ linux-2.6.7/drivers/message/fusion/mptscsih.c	2004-07-23 15:10:53.119008904 +0900
@@ -273,6 +273,8 @@
 	.max_sectors			= MPT_SCSI_MAX_SECTORS,
 	.cmd_per_lun			= MPT_SCSI_CMD_PER_LUN,
 	.use_clustering			= ENABLE_CLUSTERING,
+	.dump_sanity_check		= x_scsi_sanity_check,
+	.dump_poll			= x_scsi_poll,
 };
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -3053,7 +3055,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 {
@@ -3063,7 +3065,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: "
@@ -7272,6 +7274,38 @@
 }
 #endif
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+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;
+}
+
+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);
+}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
 
 module_init(mptscsih_init);
diff -Nur linux-2.6.7.org/drivers/message/fusion/mptscsih.h linux-2.6.7/drivers/message/fusion/mptscsih.h
--- linux-2.6.7.org/drivers/message/fusion/mptscsih.h	2004-06-22 10:27:55.000000000 +0900
+++ linux-2.6.7/drivers/message/fusion/mptscsih.h	2004-07-23 15:10:53.120008752 +0900
@@ -143,6 +143,9 @@
 #define x_scsi_slave_destroy	mptscsih_slave_destroy
 #define x_scsi_proc_info	mptscsih_proc_info
 
+#define x_scsi_sanity_check	mptscsih_sanity_check
+#define x_scsi_poll		mptscsih_poll
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *	MPT SCSI Host / Initiator decls...
@@ -160,6 +163,9 @@
 extern	void		 x_scsi_slave_destroy(Scsi_Device *);
 extern	int		 x_scsi_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
 
+extern	int		 x_scsi_sanity_check(struct scsi_device *);
+extern	void		 x_scsi_poll(struct scsi_device *);
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
 /*  include/scsi/scsi.h may not be quite complete...  */

      parent reply	other threads:[~2004-07-23  9:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-23  9:51 [PATCH 0/5][Diskdump] IPF(IA64) support Takao Indoh
2004-07-23  9:53 ` [PATCH 1/5][Diskdump] " Takao Indoh
2004-10-15  1:35   ` Rusty Russell
2004-10-15  2:11     ` Takao Indoh
2004-07-23  9:54 ` [PATCH 2/5][Diskdump] " Takao Indoh
2004-07-23  9:55 ` [PATCH 3/5][Diskdump] " Takao Indoh
2004-07-23  9:56 ` [PATCH 4/5][Diskdump] " Takao Indoh
2004-07-23  9:58 ` Takao Indoh [this message]

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=19C4709BA75270indou.takao@soft.fujitsu.com \
    --to=indou.takao@soft.fujitsu.com \
    --cc=linux-ia64@vger.kernel.org \
    --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