From patchwork Tue Dec 5 02:24:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10092649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 639396035E for ; Tue, 5 Dec 2017 10:24:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B3EE283CB for ; Tue, 5 Dec 2017 10:24:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E761287B8; Tue, 5 Dec 2017 10:24:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD86F283CB for ; Tue, 5 Dec 2017 10:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753164AbdLEKYM (ORCPT ); Tue, 5 Dec 2017 05:24:12 -0500 Received: from mail-pg0-f53.google.com ([74.125.83.53]:37727 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753266AbdLEKYK (ORCPT ); Tue, 5 Dec 2017 05:24:10 -0500 Received: by mail-pg0-f53.google.com with SMTP id y6so10382298pgp.4 for ; Tue, 05 Dec 2017 02:24:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=areca-com-tw.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:date:message-id:mime-version :content-transfer-encoding; bh=0tn8CGoTfsP+n7+xLTOoFYeLa1L1TavIBgNrRdGrW3I=; b=ZUz6mxWFcImdctNr6g1RvgVWxqsxR34XWCpLmheJTGvmSyqkXppKAoTpzJRO2qg7Gc jMe+Su7FSmsmTZOWHT58WXqYW4Pcxy6b12T2WKG+eMtaUVWHwCRiNjymT2Zs3vj/eWSZ KEIQxccklj8aqXWrRmAOPwyGAeQQxVjiuJuBUKzUelLhozLhw+t9pvkOJ6nYNafkr7u4 lSzwUg36yr0Z9hwbBiVC8TZKyubDN/9mO6fYMvLCtqZ2S9DckwB8lPDms+8Iq/uHYV8m xzk2CrI4UJdZ4RcuKU7eqKchOb53ndVTMS7IMfYKInpePFhVS4i+SPMUdRRQWglV0nTo 71HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:mime-version :content-transfer-encoding; bh=0tn8CGoTfsP+n7+xLTOoFYeLa1L1TavIBgNrRdGrW3I=; b=lOax5i1Wsa1alhXeuNGS6DHaTy/curyXLF2LAYBS5QplgMvlSEDhClJtnM1+i+B78/ PY+xsW4gKm51j9WF23XJ+ON+ULg2Ob+nFf00bLH9L3BpR6z6m4TXomu35m1BPcN/F6VA iINyPIBBt42Twje5fv4dXyFM6ylz04OrM3iXxbg17A7sHSG8MU4W15L3yCpspVYR5xfN KtFAMiuRgeM/fEki+uUWsWQzIC1NJZvKko2sWrUlgPP2Gwe+9fwsC6h7OH1ZvC0LVHyF oMWTNdBBP90WaRcejI4c/OPONeyer7HE/QpFNGpDElDIc1rYJWvN6V1zGax1HJ61U+oF vDMA== X-Gm-Message-State: AJaThX56nIy2p3ru/SswlHQJN3NZhzKQuueESY0HE8WZrO5+CJoib2w4 qW8cl86+QAmbzRSCGSrqQ0mZLw== X-Google-Smtp-Source: AGs4zMadAOSFVEDm1/TECxcff7jXeW+KAPROIMNZq7KStBM65ziWyi8oJGi1/sI4C+RIMkHzslt7vA== X-Received: by 10.159.198.4 with SMTP id f4mr17543229plo.331.1512469449517; Tue, 05 Dec 2017 02:24:09 -0800 (PST) Received: from [192.168.0.105] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id t14sm22611920pgr.37.2017.12.05.02.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 02:24:08 -0800 (PST) Subject: [PATCH 15/17] scsi: arcmsr: Add driver module parameter msi_enable From: Ching Huang To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: James.Bottomley@HansenPartnership.com, sfr@canb.auug.org.au Date: Tue, 05 Dec 2017 10:24:01 +0800 Message-ID: <1512440641.4577.80.camel@Centos6.3-64> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-37.el6) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ching Huang Add module parameter msi_enable to has a chance to disable msi interrupt if between controller and system has msi INT compatible issue. 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-12-05 11:44:36.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-12-05 16:59:58.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); +MODULE_PARM_DESC(msi_enable, "Enable MSI interrupt(0 ~ 1), msi_enable=1(enable), =0(disable)"); + 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,17 @@ 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); + if (nvec == 1) { + dev_info(&pdev->dev, "msi enabled\n"); + goto msi_int1; + } + } + nvec = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY); if (nvec < 1) return FAILED; - +msi_int1: flags = IRQF_SHARED; }