linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: James Bottomley <jbottomley@parallels.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Ondrey Zary <linux@rainbow-software.org>,
	Doug Gilberg <dgilbert@interlog.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 01/23] advansys: use host_reset
Date: Fri, 24 Apr 2015 13:18:20 +0200	[thread overview]
Message-ID: <1429874322-85488-3-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1429874322-85488-1-git-send-email-hare@suse.de>

The advansys_reset() function is actually a host reset, not a
bus reset. And there is no need to have a 'last_reset'
value; the same value exists in struct Scsi_Host.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/advansys.c | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index ae95e34..e936f48 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -2366,7 +2366,6 @@ struct asc_board {
 		ADVEEP_38C0800_CONFIG adv_38C0800_eep;	/* 38C0800 EEPROM config. */
 		ADVEEP_38C1600_CONFIG adv_38C1600_eep;	/* 38C1600 EEPROM config. */
 	} eep_config;
-	ulong last_reset;	/* Saved last reset time */
 	/* /proc/scsi/advansys/[0...] */
 #ifdef ADVANSYS_STATS
 	struct asc_stats asc_stats;	/* Board statistics */
@@ -3350,7 +3349,7 @@ static void asc_prt_driver_conf(struct seq_file *m, struct Scsi_Host *shost)
 
 	seq_printf(m,
 		   " flags 0x%x, last_reset 0x%lx, jiffies 0x%lx, asc_n_io_port 0x%x\n",
-		   boardp->flags, boardp->last_reset, jiffies,
+		   boardp->flags, shost->last_reset, jiffies,
 		   boardp->asc_n_io_port);
 
 	seq_printf(m, " io_port 0x%lx\n", shost->io_port);
@@ -7453,7 +7452,7 @@ static int AscISR(ASC_DVC_VAR *asc_dvc)
 /*
  * advansys_reset()
  *
- * Reset the bus associated with the command 'scp'.
+ * Reset the host associated with the command 'scp'.
  *
  * This function runs its own thread. Interrupts must be blocked but
  * sleeping is allowed and no locking other than for host structures is
@@ -7471,7 +7470,7 @@ static int advansys_reset(struct scsi_cmnd *scp)
 
 	ASC_STATS(shost, reset);
 
-	scmd_printk(KERN_INFO, scp, "SCSI bus reset started...\n");
+	scmd_printk(KERN_INFO, scp, "SCSI host reset started...\n");
 
 	if (ASC_NARROW_BOARD(boardp)) {
 		ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
@@ -7482,20 +7481,19 @@ static int advansys_reset(struct scsi_cmnd *scp)
 
 		/* Refer to ASC_IERR_* definitions for meaning of 'err_code'. */
 		if (asc_dvc->err_code || !asc_dvc->overrun_dma) {
-			scmd_printk(KERN_INFO, scp, "SCSI bus reset error: "
+			scmd_printk(KERN_INFO, scp, "SCSI host reset error: "
 				    "0x%x, status: 0x%x\n", asc_dvc->err_code,
 				    status);
 			ret = FAILED;
 		} else if (status) {
-			scmd_printk(KERN_INFO, scp, "SCSI bus reset warning: "
+			scmd_printk(KERN_INFO, scp, "SCSI host reset warning: "
 				    "0x%x\n", status);
 		} else {
-			scmd_printk(KERN_INFO, scp, "SCSI bus reset "
+			scmd_printk(KERN_INFO, scp, "SCSI host reset "
 				    "successful\n");
 		}
 
 		ASC_DBG(1, "after AscInitAsc1000Driver()\n");
-		spin_lock_irqsave(shost->host_lock, flags);
 	} else {
 		/*
 		 * If the suggest reset bus flags are set, then reset the bus.
@@ -7504,28 +7502,25 @@ static int advansys_reset(struct scsi_cmnd *scp)
 		ADV_DVC_VAR *adv_dvc = &boardp->dvc_var.adv_dvc_var;
 
 		/*
-		 * Reset the target's SCSI bus.
+		 * Reset the chip and SCSI bus.
 		 */
 		ASC_DBG(1, "before AdvResetChipAndSB()\n");
 		switch (AdvResetChipAndSB(adv_dvc)) {
 		case ASC_TRUE:
-			scmd_printk(KERN_INFO, scp, "SCSI bus reset "
+			scmd_printk(KERN_INFO, scp, "SCSI host reset "
 				    "successful\n");
 			break;
 		case ASC_FALSE:
 		default:
-			scmd_printk(KERN_INFO, scp, "SCSI bus reset error\n");
+			scmd_printk(KERN_INFO, scp, "SCSI host reset error\n");
 			ret = FAILED;
 			break;
 		}
 		spin_lock_irqsave(shost->host_lock, flags);
 		AdvISR(adv_dvc);
+		spin_unlock_irqrestore(shost->host_lock, flags);
 	}
 
-	/* Save the time of the most recently completed reset. */
-	boardp->last_reset = jiffies;
-	spin_unlock_irqrestore(shost->host_lock, flags);
-
 	ASC_DBG(1, "ret %d\n", ret);
 
 	return ret;
@@ -11232,7 +11227,7 @@ static struct scsi_host_template advansys_template = {
 	.name = DRV_NAME,
 	.info = advansys_info,
 	.queuecommand = advansys_queuecommand,
-	.eh_bus_reset_handler = advansys_reset,
+	.eh_host_reset_handler = advansys_reset,
 	.bios_param = advansys_biosparam,
 	.slave_configure = advansys_slave_configure,
 	/*
-- 
1.8.5.2


  parent reply	other threads:[~2015-04-24 11:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 11:18 [PATCHv3 00/23] Nobody loves the advansys driver Hannes Reinecke
2015-04-24 11:18 ` [PATCH 1/2] advansys: Update to version 3.5 and remove compilation warning Hannes Reinecke
2015-04-24 11:19   ` Hannes Reinecke
2015-04-24 11:18 ` Hannes Reinecke [this message]
2015-04-24 11:18 ` [PATCH 02/23] advansys: use shared host tag map for command lookup Hannes Reinecke
2015-04-24 11:18 ` [PATCH 03/23] advansys: use DMA-API for mapping sense buffer Hannes Reinecke
2015-04-24 11:18 ` [PATCH 04/23] advansys: Use DMA-API for carrier buffer Hannes Reinecke
2015-04-24 11:18 ` [PATCH 05/23] advansys: Use DMA-API for mapping request blocks Hannes Reinecke
2015-04-24 11:18 ` [PATCH 06/23] advansys: Use dma_pool for sg elements Hannes Reinecke
2015-04-24 11:18 ` [PATCH 07/23] advansys: use 'bool' instead of 'int' Hannes Reinecke
2015-04-24 11:18 ` [PATCH 08/23] advansys: use standard data types Hannes Reinecke
2015-04-24 11:18 ` [PATCH 09/23] advansys: Remove 'TRUE' and 'FALSE' definitions Hannes Reinecke
2015-04-24 11:18 ` [PATCH 10/23] advansys: remove 'ERR' definition Hannes Reinecke
2015-04-24 11:18 ` [PATCH 11/23] advansys: Make AscIsrChipHalted() a void function Hannes Reinecke
2015-04-24 11:18 ` [PATCH 12/23] advansys: cleanup function return codes Hannes Reinecke
2015-04-24 11:18 ` [PATCH 13/23] advansys: scsi_q1->data_addr is little endian Hannes Reinecke
2015-04-24 11:18 ` [PATCH 14/23] advansys: Remove ASC_SCSI_REQ_Q Hannes Reinecke
2015-04-24 11:18 ` [PATCH 15/23] advansys: Remove CC_VERY_LONG_SG_LIST Hannes Reinecke
2015-04-24 11:18 ` [PATCH 16/23] advansys: rename 'ASC_RQ_XX' to 'ADV_RQ_XX' Hannes Reinecke
2015-04-24 11:18 ` [PATCH 17/23] advansys: Remove 'a_flag' Hannes Reinecke
2015-04-24 11:18 ` [PATCH 18/23] advansys: Remove obsolete virtual memory mapping comment Hannes Reinecke
2015-04-24 11:18 ` [PATCH 19/23] advansys: Remove cmd_per_lun setting Hannes Reinecke
2015-04-26 14:57   ` Ondrej Zary
2015-04-26 16:55     ` Christoph Hellwig
2015-04-26 18:23       ` Ondrej Zary
2015-04-26 18:52     ` James Bottomley
2015-04-27  7:02       ` Hannes Reinecke
2015-04-28 21:15         ` James Bottomley
2015-04-24 11:18 ` [PATCH 20/23] advansys: Check for DMA mapping errors Hannes Reinecke
2015-04-24 11:18 ` [PATCH 21/23] advansys: use spin_lock_irqsave() in interrupt handler Hannes Reinecke
2015-04-24 11:18 ` [PATCH 22/23] advansys: Remove call to dma_cache_sync() Hannes Reinecke
2015-04-24 11:18 ` [PATCH 23/23] advansys: Update to version 3.5 and remove compilation warning Hannes Reinecke

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=1429874322-85488-3-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=dgilbert@interlog.com \
    --cc=hch@lst.de \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@rainbow-software.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).