diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2013-09-23 14:33:36 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-16 13:57:52 -0500 |
commit | 85009239477a9b0b06d068d6ead9226d5c809a82 (patch) | |
tree | fbf4f9297c6d14ab24017e4e68cee2ccecb1118e | |
parent | 702890e3b910cd14c3d0ee3b4842d7e946e66b8d (diff) |
[SCSI] hpsa: add 5 second delay after doorbell reset
The hardware guys tell us that after initiating a software
reset via the doorbell register we need to wait 5 seconds before
attempting to talk to the board *at all*. This means that we
cannot watch the board to verify it transitions from "ready" to
to "not ready" then back "ready", since this transition will
most likely happen during those 5 seconds (though we can still
verify the reset happens by watching the "driver version" field
get cleared.)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/hpsa.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index c3db9bb1c235..2a71ab903d96 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -3785,6 +3785,13 @@ static int hpsa_controller_hard_reset(struct pci_dev *pdev, | |||
3785 | */ | 3785 | */ |
3786 | dev_info(&pdev->dev, "using doorbell to reset controller\n"); | 3786 | dev_info(&pdev->dev, "using doorbell to reset controller\n"); |
3787 | writel(use_doorbell, vaddr + SA5_DOORBELL); | 3787 | writel(use_doorbell, vaddr + SA5_DOORBELL); |
3788 | |||
3789 | /* PMC hardware guys tell us we need a 5 second delay after | ||
3790 | * doorbell reset and before any attempt to talk to the board | ||
3791 | * at all to ensure that this actually works and doesn't fall | ||
3792 | * over in some weird corner cases. | ||
3793 | */ | ||
3794 | msleep(5000); | ||
3788 | } else { /* Try to do it the PCI power state way */ | 3795 | } else { /* Try to do it the PCI power state way */ |
3789 | 3796 | ||
3790 | /* Quoting from the Open CISS Specification: "The Power | 3797 | /* Quoting from the Open CISS Specification: "The Power |
@@ -3981,15 +3988,22 @@ static int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) | |||
3981 | need a little pause here */ | 3988 | need a little pause here */ |
3982 | msleep(HPSA_POST_RESET_PAUSE_MSECS); | 3989 | msleep(HPSA_POST_RESET_PAUSE_MSECS); |
3983 | 3990 | ||
3984 | /* Wait for board to become not ready, then ready. */ | 3991 | if (!use_doorbell) { |
3985 | dev_info(&pdev->dev, "Waiting for board to reset.\n"); | 3992 | /* Wait for board to become not ready, then ready. |
3986 | rc = hpsa_wait_for_board_state(pdev, vaddr, BOARD_NOT_READY); | 3993 | * (if we used the doorbell, then we already waited 5 secs |
3987 | if (rc) { | 3994 | * so the "not ready" state is already gone by so we |
3988 | dev_warn(&pdev->dev, | 3995 | * won't catch it.) |
3989 | "failed waiting for board to reset." | 3996 | */ |
3990 | " Will try soft reset.\n"); | 3997 | dev_info(&pdev->dev, "Waiting for board to reset.\n"); |
3991 | rc = -ENOTSUPP; /* Not expected, but try soft reset later */ | 3998 | rc = hpsa_wait_for_board_state(pdev, vaddr, BOARD_NOT_READY); |
3992 | goto unmap_cfgtable; | 3999 | if (rc) { |
4000 | dev_warn(&pdev->dev, | ||
4001 | "failed waiting for board to reset." | ||
4002 | " Will try soft reset.\n"); | ||
4003 | /* Not expected, but try soft reset later */ | ||
4004 | rc = -ENOTSUPP; | ||
4005 | goto unmap_cfgtable; | ||
4006 | } | ||
3993 | } | 4007 | } |
3994 | rc = hpsa_wait_for_board_state(pdev, vaddr, BOARD_READY); | 4008 | rc = hpsa_wait_for_board_state(pdev, vaddr, BOARD_READY); |
3995 | if (rc) { | 4009 | if (rc) { |