From patchwork Tue Jul 26 16:40:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Noever X-Patchwork-Id: 9248425 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B642607F2 for ; Tue, 26 Jul 2016 16:40:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C85526223 for ; Tue, 26 Jul 2016 16:40:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 412C3271FD; Tue, 26 Jul 2016 16:40:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C55FC26223 for ; Tue, 26 Jul 2016 16:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757152AbcGZQk4 (ORCPT ); Tue, 26 Jul 2016 12:40:56 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34766 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757129AbcGZQkz (ORCPT ); Tue, 26 Jul 2016 12:40:55 -0400 Received: by mail-wm0-f67.google.com with SMTP id q128so2538938wma.1; Tue, 26 Jul 2016 09:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=quT4j0ehffBxyDYKQr6CHAc3ShQrgGIruIbHHCodHds=; b=uz+drKZ+o0ZPo2GoDTup+g4ZfD9A3t4VcHA2PoRmv8P9R9aYOmMQqHPWPhAuXVbS5l byZDmdNG+sVInlevuneh2aghRvjiRKqzuaNq8ZiStKXsQ1n7hjTrlgObrYh9IQfsU1s1 1XsNyCsJbw2QJ2vIHmeUjAED8/zQ4oPyL8hfjqcuC9spCsV0a4AFxZbYcJ7kFXqefwye fEM/qsveYAjIKPC7pFz2hxsBJ17W2PWuUIFBtyp0sT4sgA4c4JRR8tQFSFzL0Pt+YW2M W6W86qKsxC6K4+28ZoL6aSCYh5Pn+ohj81p0EjCYMyv/P+mWl/vsRPoCHn15wdp1rRcd zgbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=quT4j0ehffBxyDYKQr6CHAc3ShQrgGIruIbHHCodHds=; b=Oc2leWbZGL7KHTABom3paYewo9AczVN0QHUrkZWnifD/iKPiANtAKCyhbErULzC+c0 IeJprT5t/+4GGB2BUyLoAZWpp5VemK+PIVaCRZoNnA3s5vsaLvyhGr74T1XkUEr1QDOJ YG8B1S0pFt8/phKByI/S70B5CFC1vm7u+TEF50IHtJJsqhuCFpwKwn2Lma0OZUblW+SX UsH+s2fr3ZHc0iGvWlR6eUiN60J3Nr9D/lvmje4MDaZzabEZ9En6eViE/oFsxwYz5WXe Z385mVffg8HTIo5PiNaMPQfpILdIn2bSTzcKnWYgIv9JxUKbcJrxCPkNzTDNfWYYEXaC z0aA== X-Gm-Message-State: AEkoousBGH1iDC2vzmLbI/U7kV2ttZgyfClfsjt5XtfJVC3WfKLGQLgDeYZqpan74HU79Q== X-Received: by 10.194.77.174 with SMTP id t14mr23719784wjw.146.1469551248891; Tue, 26 Jul 2016 09:40:48 -0700 (PDT) Received: from localhost.localdomain (anoever.inf.ethz.ch. [129.132.153.240]) by smtp.gmail.com with ESMTPSA id g7sm1848177wjx.10.2016.07.26.09.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 09:40:47 -0700 (PDT) From: Andreas Noever To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, xavier.gnata@gmail.com, gregkh@linuxfoundation.org Cc: lukas@wunner.de, helgaas@kernel.org, Andreas Noever Subject: [PATCH 1/2] thunderbolt: Fix resume quirk for Falcon Ridge 4C. Date: Tue, 26 Jul 2016 18:40:37 +0200 Message-Id: <20160726164038.1481-1-andreas.noever@gmail.com> X-Mailer: git-send-email 2.9.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The quirk 'quirk_apple_wait_for_thunderbolt' did not fire on Falcon Ridge 4C controllers with subdevice/subvendor set to zero. This lead to lost pci devices on system resume. Older thunderbolt controllers (pre Falcon Ridge) used the same device id for bridges and for the controller. On Apple hardware the subvendor- & subdevice-ids were set for the controller, but not for bridges. So that is what was used to differentiate between the two. Starting with Falcon Ridge bridges and controllers received different device ids. Additionally on some MacBookPro models (but not all) the subvendor/subdevice was zeroed. Starting with a42fb351c (thunderbolt: Allow loading of module on recent Apple MacBooks with thunderbolt 2 controller) the thunderbolt driver binds to all Falcon Ridge 4C controllers (irregardless of subvendor/subdevice). The corresponding quirk was not updated. This commit changes the quirk to check the device class instead of its subvendor-/subdeviceids. This works for all generations of Thunderbolt controllers. Signed-off-by: Andreas Noever Reviewed-by: Lukas Wunner --- drivers/pci/quirks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index ee72ebe..75b2105 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3326,8 +3326,7 @@ static void quirk_apple_wait_for_thunderbolt(struct pci_dev *dev) || (nhi->device != PCI_DEVICE_ID_INTEL_LIGHT_RIDGE && nhi->device != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C && nhi->device != PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI) - || nhi->subsystem_vendor != 0x2222 - || nhi->subsystem_device != 0x1111) + || nhi->class != PCI_CLASS_SYSTEM_OTHER << 8) goto out; dev_info(&dev->dev, "quirk: waiting for thunderbolt to reestablish PCI tunnels...\n"); device_pm_wait_for_dev(&dev->dev, &nhi->dev);