From patchwork Sat May 31 23:51:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 4276871 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB556BEEA7 for ; Sat, 31 May 2014 23:51:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BE6E20340 for ; Sat, 31 May 2014 23:51:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67D8720219 for ; Sat, 31 May 2014 23:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756785AbaEaXv0 (ORCPT ); Sat, 31 May 2014 19:51:26 -0400 Received: from dns-bn1lp0143.outbound.protection.outlook.com ([207.46.163.143]:2724 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756654AbaEaXvZ (ORCPT ); Sat, 31 May 2014 19:51:25 -0400 Received: from BN1PR05MB423.namprd05.prod.outlook.com (10.141.58.146) by BN1PR05MB421.namprd05.prod.outlook.com (10.141.58.139) with Microsoft SMTP Server (TLS) id 15.0.954.9; Sat, 31 May 2014 23:51:23 +0000 Received: from BN1PR05MB423.namprd05.prod.outlook.com ([169.254.4.95]) by BN1PR05MB423.namprd05.prod.outlook.com ([169.254.4.95]) with mapi id 15.00.0954.000; Sat, 31 May 2014 23:51:22 +0000 From: Matthew Garrett To: "andreas.noever@gmail.com" CC: "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "greg@kroah.com" , "bhelgaas@google.com" Subject: Re: [PATCH v4 00/15] Thunderbolt driver for Apple MacBooks Thread-Topic: [PATCH v4 00/15] Thunderbolt driver for Apple MacBooks Thread-Index: AQHPfNyYVDcE17ZFH0KR3hCN8Vnny5tbXLiA Date: Sat, 31 May 2014 23:51:22 +0000 Message-ID: <1401580281.7663.14.camel@x230> References: <1401546480-2071-1-git-send-email-andreas.noever@gmail.com> In-Reply-To: <1401546480-2071-1-git-send-email-andreas.noever@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:470:1f07:1371:6267:20ff:fec3:2318] x-microsoft-antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: x-forefront-prvs: 0228DDDDD7 x-forefront-antispam-report: SFV:NSPM; SFS:(6009001)(428001)(189002)(199002)(51704005)(377424004)(24454002)(101416001)(92726001)(92566001)(33716001)(81342001)(19580395003)(83322001)(99286001)(99396002)(81542001)(76176999)(19580405001)(80022001)(79102001)(20776003)(54356999)(64706001)(76482001)(2656002)(87936001)(103116003)(77982001)(86362001)(33646001)(50986999)(4396001)(74502001)(74662001)(31966008)(21056001)(83072002)(85852003)(46102001)(3826001); DIR:OUT; SFP:; SCL:1; SRVR:BN1PR05MB421; H:BN1PR05MB423.namprd05.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (: nebula.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=matthew.garrett@nebula.com; Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nebula.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 On Sat, 2014-05-31 at 16:27 +0200, Andreas Noever wrote: > Hi > > This is version 4 of my Thunderbolt driver for Apple hardware (see [1] for v3). > > Changes since v3: > - Fix typos and style problems caught by Bjorn. > - Changed the #ifdef CONFIG_ACPI block to cover the whole pci quirk. Hi Andreas, This seems to be working well on my MBP. It appears to broadly work on my Mac Pro, which has Thunderbolt 2 hardware - I added the PCI ID, and loading the thunderbolt driver after the device is plugged in works, but it won't recognise hotplug events. I don't appear to get any interrupts from the Thunderbolt controller. Any idea what might be happening there? As far as the quirks go - perhaps something like this would be reasonable, rather than maintaining a list of machines? * @@ -3041,7 +3012,7 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev) { acpi_handle bridge, SXIO, SXFP, SXLV; - if (!dmi_check_system(apple_thunderbolt_whitelist)) + if (!dmi_match(DMI_BOARD_VENDOR, "Apple Inc.")) return; if (pci_pcie_type(dev) != PCI_EXP_TYPE_UPSTREAM) return; @@ -3084,7 +3055,7 @@ static void quirk_apple_wait_for_thunderbolt(struct pci_dev *dev) struct pci_dev *sibling = NULL; struct pci_dev *nhi = NULL; - if (!dmi_check_system(apple_thunderbolt_whitelist)) + if (!dmi_match(DMI_BOARD_VENDOR, "Apple Inc.")) return; if (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM) return; --- Matthew Garrett diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index c9d6b90..c3170d4 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2993,35 +2993,6 @@ DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, /* Ralink RT2800 802.11n PCI */ quirk_broken_intx_masking); #ifdef CONFIG_ACPI -/* Apple systems with a Cactus Ridge Thunderbolt controller. */ -static struct dmi_system_id apple_thunderbolt_whitelist[] = { - { - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro9"), - }, - }, - { - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro10"), - }, - }, - { - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir5"), - }, - }, - { - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir6"), - }, - }, - { } -}; - /* * Apple: Shutdown Cactus Ridge Thunderbolt controller.