linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Andreas Noever <andreas.noever@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	xavier.gnata@gmail.com, gregkh@linuxfoundation.org
Subject: Re: [PATCH 1/2] thunderbolt: Fix resume quirk for Falcon Ridge 4C.
Date: Wed, 3 Aug 2016 10:43:54 +0200	[thread overview]
Message-ID: <20160803084354.GA4360@wunner.de> (raw)
In-Reply-To: <20160726164038.1481-1-andreas.noever@gmail.com>

On Tue, Jul 26, 2016 at 06:40:37PM +0200, Andreas Noever wrote:
> 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 <andreas.noever@gmail.com>

FWIW, this is
Reviewed-by: Lukas Wunner <lukas@wunner.de>

I also tested it successfully on Light Ridge. I'm sending a follow-up
patch separately so that Falcon Ridge chips are no longer declared
unsupported.

Thanks,

Lukas

> ---
>  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);
> -- 
> 2.9.0

  parent reply	other threads:[~2016-08-03  8:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 16:40 [PATCH 1/2] thunderbolt: Fix resume quirk for Falcon Ridge 4C Andreas Noever
2016-07-26 16:40 ` [PATCH 2/2] thunderbolt: Add support for INTEL_FALCON_RIDGE_2C controller Andreas Noever
     [not found]   ` <ed33043d-fe00-9478-80fa-bdca311a52f1@gmail.com>
2016-07-27 22:08     ` Andreas Noever
2016-07-27 22:15       ` Greg KH
2016-08-03  8:43 ` Lukas Wunner [this message]
2016-08-03  8:44 ` [PATCH] thunderbolt: Don't declare Falcon Ridge unsupported Lukas Wunner
2016-08-08  7:20   ` Andreas Noever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160803084354.GA4360@wunner.de \
    --to=lukas@wunner.de \
    --cc=andreas.noever@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=xavier.gnata@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).