diff options
author | Kevin Barnett <kevin.barnett@microsemi.com> | 2016-08-31 15:54:53 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-09-02 06:21:38 -0400 |
commit | 5e6429df9c8b3ab9e0a8d18af5248692ebe41871 (patch) | |
tree | fb5dee267a5d7205ee77a9abcf1104378d1ae566 | |
parent | e57a1f9b2fa4326ec289f1d03c658184ed6addb8 (diff) |
scsi: smartpqi: correct event acknowledgment timeout issue
the driver no longer waits for the firmware to consume
the event ack IU.
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/smartpqi/smartpqi.h | 14 | ||||
-rw-r--r-- | drivers/scsi/smartpqi/smartpqi_init.c | 20 |
2 files changed, 7 insertions, 27 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index 5f965adfab32..07b6444d3e0a 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h | |||
@@ -634,13 +634,6 @@ struct pqi_encryption_info { | |||
634 | 634 | ||
635 | #define RAID_MAP_MAX_ENTRIES 1024 | 635 | #define RAID_MAP_MAX_ENTRIES 1024 |
636 | 636 | ||
637 | #define PQI_RESERVED_IO_SLOTS_LUN_RESET 1 | ||
638 | #define PQI_RESERVED_IO_SLOTS_EVENT_ACK 1 | ||
639 | #define PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS 3 | ||
640 | #define PQI_RESERVED_IO_SLOTS \ | ||
641 | (PQI_RESERVED_IO_SLOTS_LUN_RESET + PQI_RESERVED_IO_SLOTS_EVENT_ACK + \ | ||
642 | PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS) | ||
643 | |||
644 | #define PQI_PHYSICAL_DEVICE_BUS 0 | 637 | #define PQI_PHYSICAL_DEVICE_BUS 0 |
645 | #define PQI_RAID_VOLUME_BUS 1 | 638 | #define PQI_RAID_VOLUME_BUS 1 |
646 | #define PQI_HBA_BUS 2 | 639 | #define PQI_HBA_BUS 2 |
@@ -884,6 +877,13 @@ struct pqi_event { | |||
884 | __le32 additional_event_id; | 877 | __le32 additional_event_id; |
885 | }; | 878 | }; |
886 | 879 | ||
880 | #define PQI_RESERVED_IO_SLOTS_LUN_RESET 1 | ||
881 | #define PQI_RESERVED_IO_SLOTS_EVENT_ACK PQI_NUM_SUPPORTED_EVENTS | ||
882 | #define PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS 3 | ||
883 | #define PQI_RESERVED_IO_SLOTS \ | ||
884 | (PQI_RESERVED_IO_SLOTS_LUN_RESET + PQI_RESERVED_IO_SLOTS_EVENT_ACK + \ | ||
885 | PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS) | ||
886 | |||
887 | struct pqi_ctrl_info { | 887 | struct pqi_ctrl_info { |
888 | unsigned int ctrl_id; | 888 | unsigned int ctrl_id; |
889 | struct pci_dev *pci_dev; | 889 | struct pci_dev *pci_dev; |
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index d759703da287..ea822b19b349 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c | |||
@@ -2642,26 +2642,6 @@ static void pqi_start_event_ack(struct pqi_ctrl_info *ctrl_info, | |||
2642 | writel(iq_pi, queue_group->iq_pi[RAID_PATH]); | 2642 | writel(iq_pi, queue_group->iq_pi[RAID_PATH]); |
2643 | 2643 | ||
2644 | spin_unlock_irqrestore(&queue_group->submit_lock[RAID_PATH], flags); | 2644 | spin_unlock_irqrestore(&queue_group->submit_lock[RAID_PATH], flags); |
2645 | |||
2646 | /* | ||
2647 | * We have to special-case this type of request because the firmware | ||
2648 | * does not generate an interrupt when this type of request completes. | ||
2649 | * Therefore, we have to poll until we see that the firmware has | ||
2650 | * consumed the request before we move on. | ||
2651 | */ | ||
2652 | |||
2653 | timeout = (PQI_EVENT_ACK_TIMEOUT * HZ) + jiffies; | ||
2654 | |||
2655 | while (1) { | ||
2656 | if (*queue_group->iq_ci[RAID_PATH] == iq_pi) | ||
2657 | break; | ||
2658 | if (time_after(jiffies, timeout)) { | ||
2659 | dev_err(&ctrl_info->pci_dev->dev, | ||
2660 | "completing event acknowledge timed out\n"); | ||
2661 | break; | ||
2662 | } | ||
2663 | usleep_range(1000, 2000); | ||
2664 | } | ||
2665 | } | 2645 | } |
2666 | 2646 | ||
2667 | static void pqi_acknowledge_event(struct pqi_ctrl_info *ctrl_info, | 2647 | static void pqi_acknowledge_event(struct pqi_ctrl_info *ctrl_info, |