diff options
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 536cd5a80422..82031e00b2e9 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -3638,7 +3638,7 @@ static struct device_attribute ipr_ioa_reset_attr = { | |||
3638 | .store = ipr_store_reset_adapter | 3638 | .store = ipr_store_reset_adapter |
3639 | }; | 3639 | }; |
3640 | 3640 | ||
3641 | static int ipr_iopoll(struct blk_iopoll *iop, int budget); | 3641 | static int ipr_iopoll(struct irq_poll *iop, int budget); |
3642 | /** | 3642 | /** |
3643 | * ipr_show_iopoll_weight - Show ipr polling mode | 3643 | * ipr_show_iopoll_weight - Show ipr polling mode |
3644 | * @dev: class device struct | 3644 | * @dev: class device struct |
@@ -3681,34 +3681,33 @@ static ssize_t ipr_store_iopoll_weight(struct device *dev, | |||
3681 | int i; | 3681 | int i; |
3682 | 3682 | ||
3683 | if (!ioa_cfg->sis64) { | 3683 | if (!ioa_cfg->sis64) { |
3684 | dev_info(&ioa_cfg->pdev->dev, "blk-iopoll not supported on this adapter\n"); | 3684 | dev_info(&ioa_cfg->pdev->dev, "irq_poll not supported on this adapter\n"); |
3685 | return -EINVAL; | 3685 | return -EINVAL; |
3686 | } | 3686 | } |
3687 | if (kstrtoul(buf, 10, &user_iopoll_weight)) | 3687 | if (kstrtoul(buf, 10, &user_iopoll_weight)) |
3688 | return -EINVAL; | 3688 | return -EINVAL; |
3689 | 3689 | ||
3690 | if (user_iopoll_weight > 256) { | 3690 | if (user_iopoll_weight > 256) { |
3691 | dev_info(&ioa_cfg->pdev->dev, "Invalid blk-iopoll weight. It must be less than 256\n"); | 3691 | dev_info(&ioa_cfg->pdev->dev, "Invalid irq_poll weight. It must be less than 256\n"); |
3692 | return -EINVAL; | 3692 | return -EINVAL; |
3693 | } | 3693 | } |
3694 | 3694 | ||
3695 | if (user_iopoll_weight == ioa_cfg->iopoll_weight) { | 3695 | if (user_iopoll_weight == ioa_cfg->iopoll_weight) { |
3696 | dev_info(&ioa_cfg->pdev->dev, "Current blk-iopoll weight has the same weight\n"); | 3696 | dev_info(&ioa_cfg->pdev->dev, "Current irq_poll weight has the same weight\n"); |
3697 | return strlen(buf); | 3697 | return strlen(buf); |
3698 | } | 3698 | } |
3699 | 3699 | ||
3700 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { | 3700 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { |
3701 | for (i = 1; i < ioa_cfg->hrrq_num; i++) | 3701 | for (i = 1; i < ioa_cfg->hrrq_num; i++) |
3702 | blk_iopoll_disable(&ioa_cfg->hrrq[i].iopoll); | 3702 | irq_poll_disable(&ioa_cfg->hrrq[i].iopoll); |
3703 | } | 3703 | } |
3704 | 3704 | ||
3705 | spin_lock_irqsave(shost->host_lock, lock_flags); | 3705 | spin_lock_irqsave(shost->host_lock, lock_flags); |
3706 | ioa_cfg->iopoll_weight = user_iopoll_weight; | 3706 | ioa_cfg->iopoll_weight = user_iopoll_weight; |
3707 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { | 3707 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { |
3708 | for (i = 1; i < ioa_cfg->hrrq_num; i++) { | 3708 | for (i = 1; i < ioa_cfg->hrrq_num; i++) { |
3709 | blk_iopoll_init(&ioa_cfg->hrrq[i].iopoll, | 3709 | irq_poll_init(&ioa_cfg->hrrq[i].iopoll, |
3710 | ioa_cfg->iopoll_weight, ipr_iopoll); | 3710 | ioa_cfg->iopoll_weight, ipr_iopoll); |
3711 | blk_iopoll_enable(&ioa_cfg->hrrq[i].iopoll); | ||
3712 | } | 3711 | } |
3713 | } | 3712 | } |
3714 | spin_unlock_irqrestore(shost->host_lock, lock_flags); | 3713 | spin_unlock_irqrestore(shost->host_lock, lock_flags); |
@@ -5569,7 +5568,7 @@ static int ipr_process_hrrq(struct ipr_hrr_queue *hrr_queue, int budget, | |||
5569 | return num_hrrq; | 5568 | return num_hrrq; |
5570 | } | 5569 | } |
5571 | 5570 | ||
5572 | static int ipr_iopoll(struct blk_iopoll *iop, int budget) | 5571 | static int ipr_iopoll(struct irq_poll *iop, int budget) |
5573 | { | 5572 | { |
5574 | struct ipr_ioa_cfg *ioa_cfg; | 5573 | struct ipr_ioa_cfg *ioa_cfg; |
5575 | struct ipr_hrr_queue *hrrq; | 5574 | struct ipr_hrr_queue *hrrq; |
@@ -5585,7 +5584,7 @@ static int ipr_iopoll(struct blk_iopoll *iop, int budget) | |||
5585 | completed_ops = ipr_process_hrrq(hrrq, budget, &doneq); | 5584 | completed_ops = ipr_process_hrrq(hrrq, budget, &doneq); |
5586 | 5585 | ||
5587 | if (completed_ops < budget) | 5586 | if (completed_ops < budget) |
5588 | blk_iopoll_complete(iop); | 5587 | irq_poll_complete(iop); |
5589 | spin_unlock_irqrestore(hrrq->lock, hrrq_flags); | 5588 | spin_unlock_irqrestore(hrrq->lock, hrrq_flags); |
5590 | 5589 | ||
5591 | list_for_each_entry_safe(ipr_cmd, temp, &doneq, queue) { | 5590 | list_for_each_entry_safe(ipr_cmd, temp, &doneq, queue) { |
@@ -5693,8 +5692,7 @@ static irqreturn_t ipr_isr_mhrrq(int irq, void *devp) | |||
5693 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { | 5692 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { |
5694 | if ((be32_to_cpu(*hrrq->hrrq_curr) & IPR_HRRQ_TOGGLE_BIT) == | 5693 | if ((be32_to_cpu(*hrrq->hrrq_curr) & IPR_HRRQ_TOGGLE_BIT) == |
5695 | hrrq->toggle_bit) { | 5694 | hrrq->toggle_bit) { |
5696 | if (!blk_iopoll_sched_prep(&hrrq->iopoll)) | 5695 | irq_poll_sched(&hrrq->iopoll); |
5697 | blk_iopoll_sched(&hrrq->iopoll); | ||
5698 | spin_unlock_irqrestore(hrrq->lock, hrrq_flags); | 5696 | spin_unlock_irqrestore(hrrq->lock, hrrq_flags); |
5699 | return IRQ_HANDLED; | 5697 | return IRQ_HANDLED; |
5700 | } | 5698 | } |
@@ -10405,9 +10403,8 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) | |||
10405 | 10403 | ||
10406 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { | 10404 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { |
10407 | for (i = 1; i < ioa_cfg->hrrq_num; i++) { | 10405 | for (i = 1; i < ioa_cfg->hrrq_num; i++) { |
10408 | blk_iopoll_init(&ioa_cfg->hrrq[i].iopoll, | 10406 | irq_poll_init(&ioa_cfg->hrrq[i].iopoll, |
10409 | ioa_cfg->iopoll_weight, ipr_iopoll); | 10407 | ioa_cfg->iopoll_weight, ipr_iopoll); |
10410 | blk_iopoll_enable(&ioa_cfg->hrrq[i].iopoll); | ||
10411 | } | 10408 | } |
10412 | } | 10409 | } |
10413 | 10410 | ||
@@ -10436,7 +10433,7 @@ static void ipr_shutdown(struct pci_dev *pdev) | |||
10436 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { | 10433 | if (ioa_cfg->iopoll_weight && ioa_cfg->sis64 && ioa_cfg->nvectors > 1) { |
10437 | ioa_cfg->iopoll_weight = 0; | 10434 | ioa_cfg->iopoll_weight = 0; |
10438 | for (i = 1; i < ioa_cfg->hrrq_num; i++) | 10435 | for (i = 1; i < ioa_cfg->hrrq_num; i++) |
10439 | blk_iopoll_disable(&ioa_cfg->hrrq[i].iopoll); | 10436 | irq_poll_disable(&ioa_cfg->hrrq[i].iopoll); |
10440 | } | 10437 | } |
10441 | 10438 | ||
10442 | while (ioa_cfg->in_reset_reload) { | 10439 | while (ioa_cfg->in_reset_reload) { |