From patchwork Mon Apr 22 23:52:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Radford, Adam" X-Patchwork-Id: 2475041 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BF039DF23A for ; Mon, 22 Apr 2013 23:52:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530Ab3DVXwa (ORCPT ); Mon, 22 Apr 2013 19:52:30 -0400 Received: from co1ehsobe005.messaging.microsoft.com ([216.32.180.188]:33318 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151Ab3DVXw3 (ORCPT ); Mon, 22 Apr 2013 19:52:29 -0400 Received: from mail131-co1-R.bigfish.com (10.243.78.228) by CO1EHSOBE039.bigfish.com (10.243.66.104) with Microsoft SMTP Server id 14.1.225.23; Mon, 22 Apr 2013 23:52:28 +0000 Received: from mail131-co1 (localhost [127.0.0.1]) by mail131-co1-R.bigfish.com (Postfix) with ESMTP id 510AA900160; Mon, 22 Apr 2013 23:52:28 +0000 (UTC) X-Forefront-Antispam-Report: CIP:192.19.220.66; KIP:(null); UIP:(null); IPV:NLI; H:cosedge01.lsi.com; RD:cosedge01.lsi.com; EFVD:NLI X-SpamScore: -2 X-BigFish: VPS-2(zz9371I542Izz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ahzz8275bh8275dhz2fh2a8h668h839h93fhd25hf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1b0ah1155h) Received-SPF: pass (mail131-co1: domain of lsi.com designates 192.19.220.66 as permitted sender) client-ip=192.19.220.66; envelope-from=Adam.Radford@lsi.com; helo=cosedge01.lsi.com ; ge01.lsi.com ; Received: from mail131-co1 (localhost.localdomain [127.0.0.1]) by mail131-co1 (MessageSwitch) id 1366674746144362_5066; Mon, 22 Apr 2013 23:52:26 +0000 (UTC) Received: from CO1EHSMHS027.bigfish.com (unknown [10.243.78.225]) by mail131-co1.bigfish.com (Postfix) with ESMTP id 16AC5440045; Mon, 22 Apr 2013 23:52:26 +0000 (UTC) Received: from cosedge01.lsi.com (192.19.220.66) by CO1EHSMHS027.bigfish.com (10.243.66.37) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 22 Apr 2013 23:52:25 +0000 Received: from coscas03.lsi.com (135.142.2.56) by COSEDGE01.lsi.com (192.19.220.66) with Microsoft SMTP Server (TLS) id 8.3.298.1; Mon, 22 Apr 2013 17:55:15 -0600 Received: from cosmail02.lsi.com ([172.21.36.36]) by coscas03.lsi.com ([fe80::68f1:97ad:d56e:135a%14]) with mapi; Mon, 22 Apr 2013 17:52:25 -0600 From: "Radford, Adam" To: Bjorn Helgaas , "linux-pci@vger.kernel.org" CC: DL-MegaRAID Linux , Gavin Shan , "James E.J. Bottomley" Date: Mon, 22 Apr 2013 17:52:23 -0600 Subject: RE: [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability Thread-Topic: [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability Thread-Index: Ac4/rpNg46YS3H42SkqOCW9fbhu98QABdKVw Message-ID: References: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> <20130422231019.32621.25028.stgit@bhelgaas-glaptop> In-Reply-To: <20130422231019.32621.25028.stgit@bhelgaas-glaptop> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-OriginatorOrg: lsi.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Bjorn, please post this patch to linux-scsi, where I will ACK it. -Adam -----Original Message----- From: Bjorn Helgaas [mailto:bhelgaas@google.com] Sent: Monday, April 22, 2013 4:10 PM To: linux-pci@vger.kernel.org Cc: DL-MegaRAID Linux; Gavin Shan; James E.J. Bottomley Subject: [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability Previously we used PCI_MSI_FLAGS to locate a register in the MSI-X capability. This did work because the MSI and MSI-X flags happen to be at the same offsets, but was confusing. PCI_MSIX_FLAGS_ENABLE is already defined in include/uapi/linux/pci_regs.h, so no need to define it again. Signed-off-by: Bjorn Helgaas CC: Neela Syam Kolli CC: "James E.J. Bottomley" --- drivers/scsi/megaraid/megaraid_sas.h | 3 --- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 408d254..684cc34 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1488,7 +1488,4 @@ struct megasas_mgmt_info { int max_index; }; -#define msi_control_reg(base) (base + PCI_MSI_FLAGS) -#define PCI_MSIX_FLAGS_ENABLE (1 << 15) - #endif /*LSI_MEGARAID_SAS_H */ diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 9d53540..7c90d57 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -3984,12 +3984,12 @@ static int megasas_probe_one(struct pci_dev *pdev, if (reset_devices) { pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX); if (pos) { - pci_read_config_word(pdev, msi_control_reg(pos), + pci_read_config_word(pdev, pos + PCI_MSIX_FLAGS, &control); if (control & PCI_MSIX_FLAGS_ENABLE) { dev_info(&pdev->dev, "resetting MSI-X\n"); pci_write_config_word(pdev, - msi_control_reg(pos), + pos + PCI_MSIX_FLAGS, control & ~PCI_MSIX_FLAGS_ENABLE); }