From patchwork Wed Nov 11 09:54:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Nelson X-Patchwork-Id: 38129 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id A7FFFB7093 for ; Wed, 11 Nov 2009 20:54:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756512AbZKKJya (ORCPT ); Wed, 11 Nov 2009 04:54:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756538AbZKKJya (ORCPT ); Wed, 11 Nov 2009 04:54:30 -0500 Received: from ey-out-2122.google.com ([74.125.78.25]:45096 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756512AbZKKJy3 (ORCPT ); Wed, 11 Nov 2009 04:54:29 -0500 Received: by ey-out-2122.google.com with SMTP id 9so199356eyd.5 for ; Wed, 11 Nov 2009 01:54:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=/r5IrXFMIvv5Nq1QWcGEu6N7zLgX4Ux8BAfnJjJsXRc=; b=Cq/sOfZOaT4xqgUBEpnkMDEu3lOtyxg4CG3Md8hjavQtNRiW0/SwUqDrBAla+uLs8/ 9PoYY5jn96bZONsctx/ebEvG2RcU/enKu+EmO1OmnRCRwK+6BDb453rILMsXaCu2gFrA pfI4zW/wphVbjqbsMGib/uWwIRPo3NI0vBfxs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=obYw3n+8pl2hRe0xgOJtzd0NLSVqsbbN/+uoTNREea4eeY7PyCKEMKwij8mScSOXVe ybqynFOPektnbMoWMZ654kIzvvy3LOR/HeFA+/CoQAFj/jXnsEAtX3c+fzstxoU0WIZn RttE71LI3GvPNy47yZrxPHW/53vaJ67+LC14Y= MIME-Version: 1.0 Received: by 10.213.23.77 with SMTP id q13mr6376992ebb.33.1257933274284; Wed, 11 Nov 2009 01:54:34 -0800 (PST) Date: Wed, 11 Nov 2009 20:54:34 +1100 Message-ID: <65a6ef750911110154h4eff3b9cp4f5259f37834ea7a@mail.gmail.com> Subject: [PATCH] ahci: add parameter to disable ahci driver on Promise PDC42819 From: Mark Nelson To: linux-ide@vger.kernel.org Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org ahci can drive the Promise PDC42819, but obviously it can only use SATA disks connected to this controller. The controller can actually support SAS disks as well, but at the moment only with Promise's own binary t3sas driver. To allow users to use both the ahci and the t3sas drivers in the same system (with t3sas controlling the PDC42819) we add a parameter, promise_enable that can be used to disable ahci on the Promise chip (by setting it to 0). This way even if the ahci driver is loaded first the t3sas driver can grab the Promise chip and the user's SAS disks will be operational. By default the parameter is 1 so ahci drives the controller. While we're at it, add a message letting users know that with ahci driving their Promise chip they won't be able to use their SAS disks. Signed-off-by: Mark Nelson --- drivers/ata/ahci.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/ata/ahci.c =================================================================== --- linux-2.6.orig/drivers/ata/ahci.c +++ linux-2.6/drivers/ata/ahci.c @@ -700,6 +700,9 @@ static int marvell_enable = 1; module_param(marvell_enable, int, 0644); MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)"); +static int promise_enable = 1; +module_param(promise_enable, int, 0644); +MODULE_PARM_DESC(promise_enable, "Promise PDC42819 via AHCI (1 = enabled)"); static inline int ahci_nr_ports(u32 cap) { @@ -2988,6 +2991,26 @@ static int ahci_init_one(struct pci_dev if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable) return -ENODEV; + /* Promise's PDC42819 is a SAS/SATA controller that has an AHCI mode. + * At the moment, Promise's t3sas driver is required for SAS + * functionality. Disable ahci on this device if the user asked for + * it. + */ + if (pdev->vendor == PCI_VENDOR_ID_PROMISE) { + if (promise_enable) { + dev_printk(KERN_INFO, &pdev->dev, "Promise PDC42819 " + "support enabled\n"); + dev_printk(KERN_INFO, &pdev->dev, "Only SATA devices " + "will function with" + " this driver\n"); + + } else { + dev_printk(KERN_INFO, &pdev->dev, "Promise PDC42819 " + "support disabled\n"); + return -ENODEV; + } + } + /* acquire resources */ rc = pcim_enable_device(pdev); if (rc)