From patchwork Tue Aug 27 09:44:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 2850098 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F8219F2F4 for ; Tue, 27 Aug 2013 09:44:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD56E20563 for ; Tue, 27 Aug 2013 09:44:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E8C320547 for ; Tue, 27 Aug 2013 09:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753503Ab3H0JoY (ORCPT ); Tue, 27 Aug 2013 05:44:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60671 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753437Ab3H0JoX (ORCPT ); Tue, 27 Aug 2013 05:44:23 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D1B9CA51CB; Tue, 27 Aug 2013 11:44:21 +0200 (CEST) Date: Tue, 27 Aug 2013 11:44:19 +0200 (CEST) From: Jiri Kosina To: Bjorn Helgaas , Adam Radford Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH] PCI: add quirk for 3ware 9650SE controller Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit d5dea7d95 ("PCI: msi: Disable msi interrupts when we initialize a pci device") makes MSIs be forcibly disabled at boot time. It turns out that this breaks 3ware controller -- if MSIs are disabled during PCI discovery of this controller, the device doesn't work properly (it doesn't respond to any commands that are being sent to it after initialization). Reverting d5dea7d95 or not force-disabling MSIs in pci_msi_init_pci_dev() makes the device work properly again. Signed-off-by: Jiri Kosina --- I am adding Adam Radford as a recepient as well, to see whether he is able to provide some more explanation why this device would expose this behavior. Thanks. drivers/pci/msi.c | 3 +++ drivers/pci/quirks.c | 10 ++++++++++ include/linux/pci.h | 1 + 3 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index aca7578..4f36b8b 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -1040,6 +1040,9 @@ void pci_msi_init_pci_dev(struct pci_dev *dev) { INIT_LIST_HEAD(&dev->msi_list); + if (dev->broken_msi_disable) + return; + /* Disable the msi hardware to avoid screaming interrupts * during boot. This is the power on reset default so * usually this should be a noop. diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e85d230..4ba3400 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2890,6 +2890,16 @@ static void quirk_intel_ntb(struct pci_dev *dev) DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); +/* + * 3ware 9650SE controller doesn't properly initialize if MSI are + * disabled on it during PCI device discovery + */ +static void quirk_broken_msi_disable(struct pci_dev *dev) +{ + dev->broken_msi_disable = 1; +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_3WARE, 0x1004, quirk_broken_msi_disable); + static ktime_t fixup_debug_start(struct pci_dev *dev, void (*fn)(struct pci_dev *dev)) { diff --git a/include/linux/pci.h b/include/linux/pci.h index 0fd1f15..c327d74 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -341,6 +341,7 @@ struct pci_dev { #ifdef CONFIG_PCI_MSI struct list_head msi_list; struct kset *msi_kset; + unsigned int broken_msi_disable:1; #endif struct pci_vpd *vpd; #ifdef CONFIG_PCI_ATS