[folded] hpsa-remove-sendcmd-in-no-case-are-we-required-to-poll-for-completions.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     hpsa: Remove sendcmd, in no case are we required to poll for completions.
has been removed from the -mm tree.  Its filename was
     hpsa-remove-sendcmd-in-no-case-are-we-required-to-poll-for-completions.patch

This patch was dropped because it was folded into scsi-add-hpsa-driver-for-hp-smart-array-controllers.patch

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: hpsa: Remove sendcmd, in no case are we required to poll for completions.
From: "Stephen M. Cameron" <scameron@xxxxxxxxxxxxxxxxxx>

hpsa: Remove sendcmd, there are no instances in which we must poll for
command completion.  This means sendcmd_core() and pollcomplete()
can be removed as well.

Signed-off-by: Stephen M. Cameron <scameron@xxxxxxxxxxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
Cc: Jens Axboe <jens.axboe@xxxxxxxxxx>
Cc: Mike Miller <mikem@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/scsi/hpsa.c |  156 ------------------------------------------
 1 file changed, 156 deletions(-)

diff -puN drivers/scsi/hpsa.c~hpsa-remove-sendcmd-in-no-case-are-we-required-to-poll-for-completions drivers/scsi/hpsa.c
--- a/drivers/scsi/hpsa.c~hpsa-remove-sendcmd-in-no-case-are-we-required-to-poll-for-completions
+++ a/drivers/scsi/hpsa.c
@@ -117,8 +117,6 @@ static int number_of_controllers;
 static irqreturn_t do_hpsa_intr(int irq, void *dev_id);
 static int hpsa_ioctl(struct scsi_device *dev, int cmd, void *arg);
 static void start_io(struct ctlr_info *h);
-static int sendcmd(__u8 cmd, struct ctlr_info *h, void *buff, size_t size,
-		   __u8 page_code, unsigned char *scsi3addr, int cmd_type);
 
 #ifdef CONFIG_COMPAT
 static int hpsa_compat_ioctl(struct scsi_device *dev, int cmd, void *arg);
@@ -131,7 +129,6 @@ static struct CommandList *cmd_special_a
 static int fill_cmd(struct CommandList *c, __u8 cmd, struct ctlr_info *h,
 	void *buff, size_t size, __u8 page_code, unsigned char *scsi3addr,
 	int cmd_type);
-static int sendcmd_core(struct ctlr_info *h, struct CommandList *c);
 
 static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd,
 		void (*done)(struct scsi_cmnd *));
@@ -2685,159 +2682,6 @@ static int fill_cmd(struct CommandList *
 }
 
 /*
- *   Wait polling for a command to complete.
- *   The memory mapped FIFO is polled for the completion.
- *   Used only at init time, interrupts from the HBA are disabled.
- */
-static unsigned long pollcomplete(struct ctlr_info *h)
-{
-	unsigned long done;
-	int i;
-
-	/* Wait (up to HPSA_MAX_POLL_TIME_SECS) for a command to complete */
-	for (i = HPSA_MAX_POLL_TIME_SECS * HZ; i > 0; i--) {
-		done = h->access.command_completed(h);
-		if (done == FIFO_EMPTY)
-			schedule_timeout_uninterruptible(1);
-		else
-			return done;
-	}
-	/* Invalid address to tell caller we ran out of time */
-	dev_warn(&h->pdev->dev, "pollcomplete(): returning 1\n");
-	return 1;
-}
-
-/* Send command c to controller h and poll for it to complete.
- * Turns interrupts off on the board.  Used at driver init time
- * and during SCSI error recovery.
- */
-static int sendcmd_core(struct ctlr_info *h, struct CommandList *c)
-{
-	int i;
-	unsigned long complete;
-	int status = IO_ERROR;
-
-resend_cmd1:
-	/*
-	 * Disable interrupt
-	 */
-	h->access.set_intr_mask(h, HPSA_INTR_OFF);
-
-	/* Make sure there is room in the command FIFO
-	 * Actually it should be completely empty at this time
-	 * unless we are in here doing error handling for the scsi
-	 * side of the driver.
-	 */
-	for (i = 200000; i > 0; i--) {
-		/* if fifo isn't full go */
-		if (!(h->access.fifo_full(h)))
-			break;
-		udelay(10);
-		dev_warn(&h->pdev->dev, "sendcmd FIFO full, waiting!\n");
-	}
-	h->access.submit_command(h, c); /* Send the cmd */
-	do {
-		complete = pollcomplete(h);
-
-		if (complete == 1) {
-			dev_warn(&h->pdev->dev,
-			       "sendcmd timeout, no command list address "
-				"returned!\n");
-			status = IO_ERROR;
-			break;
-		}
-
-		/* If it's not the cmd we're looking for, save it for later */
-		if ((complete & ~HPSA_ERROR_BIT) != c->busaddr) {
-			dev_warn(&h->pdev->dev, "unexpected command "
-				"completion.\n");
-			continue;
-		}
-
-		/* It is our command.  If no error, we're done. */
-		if (!(complete & HPSA_ERROR_BIT)) {
-			status = IO_OK;
-			break;
-		}
-
-		/* There is an error... */
-
-		/* if data overrun or underun on Report command ignore it */
-		if (((c->Request.CDB[0] == HPSA_REPORT_LOG) ||
-			(c->Request.CDB[0] == HPSA_REPORT_PHYS) ||
-			(c->Request.CDB[0] == HPSA_INQUIRY)) &&
-			((c->err_info->CommandStatus == CMD_DATA_OVERRUN) ||
-			(c->err_info->CommandStatus == CMD_DATA_UNDERRUN))) {
-			complete = c->busaddr;
-			status = IO_OK;
-			break;
-		}
-		if (c->err_info->CommandStatus == CMD_UNSOLICITED_ABORT) {
-			dev_warn(&h->pdev->dev, "unsolicited abort %p\n", c);
-			if (c->retry_count < MAX_CMD_RETRIES) {
-				dev_warn(&h->pdev->dev, "retrying %p\n", c);
-				c->retry_count++;
-				/* erase the old error information */
-				memset(c->err_info, 0, sizeof(c->err_info));
-				goto resend_cmd1;
-			}
-			dev_warn(&h->pdev->dev,
-				"retried %p too many times\n", c);
-			status = IO_ERROR;
-			goto cleanup1;
-		}
-		if (c->err_info->CommandStatus == CMD_UNABORTABLE) {
-			dev_warn(&h->pdev->dev,
-				"command could not be aborted.\n");
-			status = IO_ERROR;
-			goto cleanup1;
-		}
-		dev_warn(&h->pdev->dev, "sendcmd error\n");
-		dev_warn(&h->pdev->dev,
-			"cmd = 0x%02x, CommandStatus = 0x%02x\n",
-			c->Request.CDB[0], c->err_info->CommandStatus);
-		if (c->err_info->CommandStatus == CMD_TARGET_STATUS) {
-			dev_warn(&h->pdev->dev, "target status = 0x%02x\n",
-				c->err_info->ScsiStatus);
-			if (c->err_info->ScsiStatus == 2) /* chk cond */
-				dev_warn(&h->pdev->dev, "sense key = 0x%02x\n",
-					0xf & c->err_info->SenseInfo[2]);
-		}
-
-		status = IO_ERROR;
-		goto cleanup1;
-
-	} while (1);
-
-cleanup1:
-	hpsa_pci_unmap(h->pdev, c, 1, PCI_DMA_BIDIRECTIONAL);
-	return status;
-}
-
-/*
- * Send a command to the controller, and wait for it to complete.
- * Used at init time, and during SCSI error recovery.
- */
-static int sendcmd(__u8 cmd, struct ctlr_info *h, void *buff, size_t size,
-		   __u8 page_code, unsigned char *scsi3addr, int cmd_type)
-{
-	struct CommandList *c;
-	int status;
-
-	c = cmd_alloc(h);
-	if (c == NULL) {
-		dev_warn(&h->pdev->dev, "unable to get memory");
-		return IO_ERROR;
-	}
-	status = fill_cmd(c, cmd, h, buff, size, page_code,
-		scsi3addr, cmd_type);
-	if (status == IO_OK)
-		status = sendcmd_core(h, c);
-	cmd_free(h, c);
-	return status;
-}
-
-/*
  * Map (physical) PCI mem into (virtual) kernel space
  */
 static void __iomem *remap_pci_mem(ulong base, ulong size)
_

Patches currently in -mm which might be from scameron@xxxxxxxxxxxxxxxxxx are

linux-next.patch
scsi-add-hpsa-driver-for-hp-smart-array-controllers.patch
hpsa-remove-sendcmd-in-no-case-are-we-required-to-poll-for-completions.patch
hpsa-make-fill_cmd-return-void.patch
hpsa-fix-typo-that-causes-scsi-status-to-be-lost.patch
hpsa-make-device-attrs-static.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux