linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: rajinikanth.pandurangan@pmcs.com
Cc: linux-scsi@vger.kernel.org, aacraid@pmc-sierra.com,
	harry.yang@pmcs.com, rich.bono@pmcs.com, achim.leubner@pmcs.com,
	murthy.bhat@pmcs.com
Subject: Re: [PATCH 2/9] [SCSI] aacraid: Add Power Management support
Date: Mon, 01 Jun 2015 08:14:55 -0700	[thread overview]
Message-ID: <1433171695.2174.4.camel@HansenPartnership.com> (raw)
In-Reply-To: <1431562378-8514-3-git-send-email-rajinikanth.pandurangan@pmcs.com>

On Wed, 2015-05-13 at 17:12 -0700, rajinikanth.pandurangan@pmcs.com
wrote:
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
> index 9eec027..be30e43 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -1317,6 +1317,149 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  	return error;
>  }
>  
> +#if (defined(CONFIG_PM))
> +void aac_release_resources(struct aac_dev *aac)
> +{
> +	int i;
> +
> +	aac_adapter_disable_int(aac);
> +	if (aac->pdev->device == PMC_DEVICE_S6 ||
> +	    aac->pdev->device == PMC_DEVICE_S7 ||
> +	    aac->pdev->device == PMC_DEVICE_S8 ||
> +	    aac->pdev->device == PMC_DEVICE_S9) {
> +		if (aac->max_msix > 1) {
> +			for (i = 0; i < aac->max_msix; i++)
> +				free_irq(aac->msixentry[i].vector,
> +					&(aac->aac_msix[i]));
> +		} else {
> +			free_irq(aac->pdev->irq, &(aac->aac_msix[0]));
> +		}
> +	} else {
> +		free_irq(aac->pdev->irq, aac);
> +	}
> +	if (aac->msi)
> +		pci_disable_msi(aac->pdev);
> +	else if (aac->max_msix > 1)
> +		pci_disable_msix(aac->pdev);
> +
> +}
> +
> +static int aac_acquire_resources(struct aac_dev *dev)
> +{
> +	int i, j;
> +	int instance = dev->id;
> +	const char *name = dev->name;
> +	unsigned long status;
> +	/*
> +	 *	First clear out all interrupts.  Then enable the one's that we
> +	 *	can handle.
> +	 */
> +	while (!((status = src_readl(dev, MUnit.OMR)) & KERNEL_UP_AND_RUNNING)
> +		|| status == 0xffffffff)
> +			msleep(1);

checkpatch would warn you not to do this.  Use msleep(20) to keep it
quiet.

> +
> +	aac_adapter_disable_int(dev);
> +	aac_adapter_enable_int(dev);
> +
> +
> +	if ((dev->pdev->device == PMC_DEVICE_S7 ||
> +	     dev->pdev->device == PMC_DEVICE_S8 ||
> +	     dev->pdev->device == PMC_DEVICE_S9))
> +		aac_define_int_mode(dev);
> +
> +	if (dev->msi_enabled)
> +		aac_src_access_devreg(dev, AAC_ENABLE_MSIX);
> +
> +	if (!dev->sync_mode && dev->msi_enabled && dev->max_msix > 1) {
> +		for (i = 0; i < dev->max_msix; i++) {
> +			dev->aac_msix[i].vector_no = i;
> +			dev->aac_msix[i].dev = dev;
> +
> +			if (request_irq(dev->msixentry[i].vector,
> +					dev->a_ops.adapter_intr,
> +					0, "aacraid", &(dev->aac_msix[i]))) {
> +				printk(KERN_ERR "%s%d: Failed to register IRQ for vector %d.\n",
> +						name, instance, i);
> +				for (j = 0 ; j < i ; j++)
> +					free_irq(dev->msixentry[j].vector,
> +						 &(dev->aac_msix[j]));
> +				pci_disable_msix(dev->pdev);
> +				goto error_iounmap;
> +			}
> +		}
> +	} else {
> +		dev->aac_msix[0].vector_no = 0;
> +		dev->aac_msix[0].dev = dev;
> +
> +		if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr,
> +			IRQF_SHARED|IRQF_DISABLED, "aacraid",
> +			&(dev->aac_msix[0])) < 0) {

And this won't compile:

drivers/scsi/aacraid/linit.c: In function ‘aac_acquire_resources’:
drivers/scsi/aacraid/linit.c:1395:16: error: ‘IRQF_DISABLED’ undeclared
(first use in this function)
    IRQF_SHARED|IRQF_DISABLED, "aacraid",

Please run checkpatch and compile against the kernel you're submitting
for.  The reason for this failure is that IRQF_DISABLED got eliminated
from the kernel somewhere in the 3.x series.

James


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

  parent reply	other threads:[~2015-06-01 15:14 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  0:12 [PATCH 0/9] aacraid: Patchset for aacraid driver version 41010 rajinikanth.pandurangan
2015-05-14  0:12 ` [PATCH 1/9] [SCSI] aacraid: Fix for logical device name and UID not exposed to the OS rajinikanth.pandurangan
2015-05-15  2:55   ` Mahesh Rajashekhara
2015-05-22 13:18   ` Tomas Henzl
2015-05-26 18:06     ` Rajinikanth Pandurangan
2015-05-27 14:41   ` Tomas Henzl
2015-05-14  0:12 ` [PATCH 2/9] [SCSI] aacraid: Add Power Management support rajinikanth.pandurangan
2015-05-15  2:56   ` Mahesh Rajashekhara
2015-05-22 13:36   ` Tomas Henzl
2015-05-27 14:41   ` Tomas Henzl
2015-06-01 15:14   ` James Bottomley [this message]
2015-06-01 21:16     ` Rajinikanth Pandurangan
2015-06-01 21:38       ` James Bottomley
2015-05-14  0:12 ` [PATCH 3/9] [SCSI] aacraid: Enable MSI interrupt for series-6 controller rajinikanth.pandurangan
2015-05-15  2:56   ` Mahesh Rajashekhara
2015-05-22 13:40   ` Tomas Henzl
2015-05-22 23:46     ` Rajinikanth Pandurangan
2015-05-24 19:31       ` Tomas Henzl
2015-05-27 14:42   ` Tomas Henzl
2015-05-14  0:12 ` [PATCH 4/9] [SCSI] aacraid: Enable 64-bit write to controller register rajinikanth.pandurangan
2015-05-15  2:57   ` Mahesh Rajashekhara
2015-05-22 14:02   ` Tomas Henzl
2015-05-22 23:52     ` Rajinikanth Pandurangan
2015-05-24 19:31       ` Tomas Henzl
2015-05-27 14:44   ` Tomas Henzl
2015-05-14  0:12 ` [PATCH 5/9] [SCSI] aacraid: Tune response path if IsFastPath bit set rajinikanth.pandurangan
2015-05-15  2:57   ` Mahesh Rajashekhara
2015-05-27 14:45   ` Tomas Henzl
2015-05-14  0:12 ` [PATCH 6/9] [SCSI] aacraid: Reset irq affinity hints before releasing irq rajinikanth.pandurangan
2015-05-15  2:57   ` Mahesh Rajashekhara
2015-05-27 14:45   ` Tomas Henzl
2015-05-14  0:12 ` [PATCH 7/9] [SCSI] aacraid: Unblock IOCTLs to controller once system resumed from suspend rajinikanth.pandurangan
2015-05-15  2:57   ` Mahesh Rajashekhara
2015-05-27 14:45   ` Tomas Henzl
2015-05-14  0:12 ` [PATCH 8/9] [SCSI] aacraid: Send commit-config to controller firmware rajinikanth.pandurangan
2015-05-15  2:57   ` Mahesh Rajashekhara
2015-05-14  0:12 ` [PATCH 9/9] [SCSI] aacraid: Update driver version rajinikanth.pandurangan
2015-05-15  2:58   ` Mahesh Rajashekhara

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=1433171695.2174.4.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=aacraid@pmc-sierra.com \
    --cc=achim.leubner@pmcs.com \
    --cc=harry.yang@pmcs.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=murthy.bhat@pmcs.com \
    --cc=rajinikanth.pandurangan@pmcs.com \
    --cc=rich.bono@pmcs.com \
    /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).