From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbdKWKpA (ORCPT ); Thu, 23 Nov 2017 05:45:00 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:49429 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328AbdKWKo6 (ORCPT ); Thu, 23 Nov 2017 05:44:58 -0500 Date: Thu, 23 Nov 2017 13:44:09 +0300 From: Dan Carpenter To: Ching Huang Cc: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jthumshirn@suse.de, hare@suse.de, hch@infradead.org Subject: Re: [PATCH 1/3] scsi: arcmsr: Add driver module parameter msi_enable Message-ID: <20171123104408.jkslvj2axy4svt4a@mwanda> References: <1511400439.9832.19.camel@Centos6.3-64> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1511400439.9832.19.camel@Centos6.3-64> User-Agent: NeoMutt/20170609 (1.8.3) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 23, 2017 at 09:27:19AM +0800, Ching Huang wrote: > From: Ching Huang > > Add module parameter msi_enable to has a chance to disable msi interrupt if it does not work properly. > > Signed-off-by: Ching Huang > --- > > diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c > --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-23 14:29:26.000000000 +0800 > +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-23 16:02:28.000000000 +0800 > @@ -75,6 +75,10 @@ MODULE_DESCRIPTION("Areca ARC11xx/12xx/1 > MODULE_LICENSE("Dual BSD/GPL"); > MODULE_VERSION(ARCMSR_DRIVER_VERSION); > > +static int msi_enable = 1; > +module_param(msi_enable, int, S_IRUGO); ^^^^^^^ checkpatch.pl will complain that this should be 0444 > +MODULE_PARM_DESC(msi_enable, " Enable MSI interrupt(0 ~ 1), msi_enable=1(enable), =0(disable)"); ^ Remove the extra space > + > static int host_can_queue = ARCMSR_DEFAULT_OUTSTANDING_CMD; > module_param(host_can_queue, int, S_IRUGO); > MODULE_PARM_DESC(host_can_queue, " adapter queue depth(32 ~ 1024), default is 128"); > @@ -831,11 +835,15 @@ arcmsr_request_irq(struct pci_dev *pdev, > pr_info("arcmsr%d: msi-x enabled\n", acb->host->host_no); > flags = 0; > } else { > - nvec = pci_alloc_irq_vectors(pdev, 1, 1, > - PCI_IRQ_MSI | PCI_IRQ_LEGACY); > + if (msi_enable == 1) > + nvec = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI); > + else > + nvec = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY); > if (nvec < 1) > return FAILED; I feel like we should try PCI_IRQ_MSI then if it fails we could fall back to PCI_IRQ_LEGACY. Originally, it worked like this and now it just fails unless you toggle the module param. It's a regression. > > + if (msi_enable == 1) > + pr_info("arcmsr%d: msi enabled\n", acb->host->host_no); This printk could be improved. Use dev_info(&pdev->dev, for a start. I know that the other prints don't use this, but we could use it one time then slowly add more users until more are using dev_info() than pr_info() and then someone will decide to clean up the old users. regards, dan carpenter