From patchwork Mon Apr 22 23:10:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2474771 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5DC093FD40 for ; Mon, 22 Apr 2013 23:10:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753084Ab3DVXKW (ORCPT ); Mon, 22 Apr 2013 19:10:22 -0400 Received: from mail-ia0-f179.google.com ([209.85.210.179]:50995 "EHLO mail-ia0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752993Ab3DVXKV (ORCPT ); Mon, 22 Apr 2013 19:10:21 -0400 Received: by mail-ia0-f179.google.com with SMTP id p22so10546iad.10 for ; Mon, 22 Apr 2013 16:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=o+4wypahlP7TLQBYBc0OJNwVjgJE9ujbBLhQCrYYB50=; b=ffTYa3oScAsdGMZm2MBR3xOyN1SXZa+PaK2csGwk58ARtraI0FOcSEhXSrN+Pv2eo9 iKpDCYPuqRVQ8xoigftl21gYy7tRRlwrxRjTC/mXmsEmfl4vh7WufmTP4Kha6trHHMoW lH4f9hNG83yLcLl+ybzHUwfDZiKZsdtF0GY97R75GYVdcC5d54I4DLw6JcJoM42zvM7L zutzOmfveANtAj7/yaPq7Scvm39YzZI/c4CF8CxLrRx2KKNFFJ3IVt/QfmGs8D7OV9I8 0TrpTKyNtBaPG/Sw1FgPW3AnrLe6x+thlA0zYvZy0MuV2W9Q/8e/nZHFqg/ZIi0bEhfo sC6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=o+4wypahlP7TLQBYBc0OJNwVjgJE9ujbBLhQCrYYB50=; b=OF/w0inVhQ4W7O3NHRxj1E/wxlf0wOlJWCUQeRNK/ZX2mx4CSmlRyNkOdrcfWmS7fe v9Efx0FZCvpP6nM73kiVSEz1LuZUPk3zF8AznA6D6WO8hVCjxCIsjBBdam4xNfDRmm79 s4cutXKkjbIXBJsjOC52HjPpeWJ3X5B2kiJ3WsE56eosxSTsE8cQgTFp8oVV3YjOuwYI E4pP/Y35FbT8RPDM2W2/HGQAnJ3+kd8oGtMzypxfPA/aKld2yfFGVcHjxWhyP3VmmnWL 6AG8BjBTC1hCZhNf6yPvve0oy+GAhzFM87qSdXmSaNdMe0vLczm2EYGsoERclmHcBdQK tx4g== X-Received: by 10.50.164.164 with SMTP id yr4mr21980552igb.4.1366672221229; Mon, 22 Apr 2013 16:10:21 -0700 (PDT) Received: from localhost ([172.29.120.215]) by mx.google.com with ESMTPS id hi4sm19681030igc.6.2013.04.22.16.10.20 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 16:10:20 -0700 (PDT) Subject: [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Neela Syam Kolli , Gavin Shan , "James E.J. Bottomley" Date: Mon, 22 Apr 2013 17:10:19 -0600 Message-ID: <20130422231019.32621.25028.stgit@bhelgaas-glaptop> In-Reply-To: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> References: <20130422230012.32621.15224.stgit@bhelgaas-glaptop> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmIdH3HpggAjcRGt+sYuXmVpcgZ/mfMFciHFdWETjm1+tbxG78Nck2Q0hj6o+o89fWZ2TmhS/DM74rlnrAomRoeO+RAWi5Pdi61kxnflN7MtOksS+93Mo77omGpSdUhTzCKwAz2r75ZWKkMz1tSE2SbRXUmxLiP3kQIvp2umPvN5SFot8EnqRU8fAJxzoFkgBK1WGMSY1p0ITnyRpmpcfpytoVQZD4lQuYjEjVPwRuXR9+yWoI= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }