linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-pm@vger.kernel.org,
	Andreas Noever <andreas.noever@gmail.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RFC 1/4] PCI: Add Thunderbolt device IDs
Date: Sun, 20 Mar 2016 14:11:35 +0100	[thread overview]
Message-ID: <20160320131135.GA29174@wunner.de> (raw)
In-Reply-To: <20160317150320.GA22769@localhost>

Hi Bjorn,

On Thu, Mar 17, 2016 at 10:03:20AM -0500, Bjorn Helgaas wrote:
> On Wed, Mar 16, 2016 at 03:50:35PM +0100, Lukas Wunner wrote:
> > Gen 1 and 2 chips use the same ID for NHI, bridges and switch.
> > Gen 3 chips and onward use a distinct ID for the NHI.
> 
> I assume this is strictly using #defines instead of bare numbers and
> hence "no functional change intended."
> 
> > Cc: Andreas Noever <andreas.noever@gmail.com>
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Thanks, I've just posted a 3 patch series to support the Light Ridge
Thunderbolt controller and included your ack for this patch.


> I assume somebody else will merge this with the rest of the series.

The maintainer of the thunderbolt driver is Andreas Noever, however
I don't think Andreas sends pull requests to Linus. Everything in
drivers/thunderbolt/ has so far been picked up by Greg KH.

I have more thunderbolt stuff in the pipeline, some of which needs
changes to drivers/pci/. Therefore it would be ideal from my perspective
if my thunderbolt patches could go in via your tree, if that is possible.

Thank you!

Lukas

> Let me know if you need anything else from me.
> 
> > ---
> >  drivers/pci/quirks.c         | 16 ++++++++++------
> >  drivers/thunderbolt/nhi.c    |  8 +++++---
> >  drivers/thunderbolt/switch.c |  9 +++++----
> >  include/linux/pci_ids.h      | 18 ++++++++++++++++++
> >  4 files changed, 38 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> > index 0575a1e..d1e3956 100644
> > --- a/drivers/pci/quirks.c
> > +++ b/drivers/pci/quirks.c
> > @@ -3203,7 +3203,8 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)
> >  	acpi_execute_simple_method(SXIO, NULL, 0);
> >  	acpi_execute_simple_method(SXLV, NULL, 0);
> >  }
> > -DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_INTEL, 0x1547,
> > +DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_INTEL,
> > +			       PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C,
> >  			       quirk_apple_poweroff_thunderbolt);
> >  
> >  /*
> > @@ -3237,9 +3238,10 @@ static void quirk_apple_wait_for_thunderbolt(struct pci_dev *dev)
> >  	if (!nhi)
> >  		goto out;
> >  	if (nhi->vendor != PCI_VENDOR_ID_INTEL
> > -			|| (nhi->device != 0x1547 && nhi->device != 0x156c)
> > -			|| nhi->subsystem_vendor != 0x2222
> > -			|| nhi->subsystem_device != 0x1111)
> > +		    || (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)
> >  		goto out;
> >  	dev_info(&dev->dev, "quirk: waiting for thunderbolt to reestablish PCI tunnels...\n");
> >  	device_pm_wait_for_dev(&dev->dev, &nhi->dev);
> > @@ -3247,9 +3249,11 @@ out:
> >  	pci_dev_put(nhi);
> >  	pci_dev_put(sibling);
> >  }
> > -DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, 0x1547,
> > +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL,
> > +			       PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C,
> >  			       quirk_apple_wait_for_thunderbolt);
> > -DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, 0x156d,
> > +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL,
> > +			       PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE,
> >  			       quirk_apple_wait_for_thunderbolt);
> >  #endif
> >  
> > diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
> > index 20a41f7..36be23b 100644
> > --- a/drivers/thunderbolt/nhi.c
> > +++ b/drivers/thunderbolt/nhi.c
> > @@ -633,16 +633,18 @@ static const struct dev_pm_ops nhi_pm_ops = {
> >  static struct pci_device_id nhi_ids[] = {
> >  	/*
> >  	 * We have to specify class, the TB bridges use the same device and
> > -	 * vendor (sub)id.
> > +	 * vendor (sub)id on gen 1 and gen 2 controllers.
> >  	 */
> >  	{
> >  		.class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
> > -		.vendor = PCI_VENDOR_ID_INTEL, .device = 0x1547,
> > +		.vendor = PCI_VENDOR_ID_INTEL,
> > +		.device = PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C,
> >  		.subvendor = 0x2222, .subdevice = 0x1111,
> >  	},
> >  	{
> >  		.class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
> > -		.vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c,
> > +		.vendor = PCI_VENDOR_ID_INTEL,
> > +		.device = PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI,
> >  		.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
> >  	},
> >  	{ 0,}
> > diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
> > index aeb9829..db73ffe 100644
> > --- a/drivers/thunderbolt/switch.c
> > +++ b/drivers/thunderbolt/switch.c
> > @@ -293,9 +293,9 @@ static int tb_plug_events_active(struct tb_switch *sw, bool active)
> >  	if (active) {
> >  		data = data & 0xFFFFFF83;
> >  		switch (sw->config.device_id) {
> > -		case 0x1513:
> > -		case 0x151a:
> > -		case 0x1549:
> > +		case PCI_DEVICE_ID_INTEL_LIGHT_RIDGE:
> > +		case PCI_DEVICE_ID_INTEL_EAGLE_RIDGE:
> > +		case PCI_DEVICE_ID_INTEL_PORT_RIDGE:
> >  			break;
> >  		default:
> >  			data |= 4;
> > @@ -370,7 +370,8 @@ struct tb_switch *tb_switch_alloc(struct tb *tb, u64 route)
> >  		tb_sw_warn(sw, "unknown switch vendor id %#x\n",
> >  			   sw->config.vendor_id);
> >  
> > -	if (sw->config.device_id != 0x1547 && sw->config.device_id != 0x1549)
> > +	if (sw->config.device_id != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C &&
> > +	    sw->config.device_id != PCI_DEVICE_ID_INTEL_PORT_RIDGE)
> >  		tb_sw_warn(sw, "unsupported switch device id %#x\n",
> >  			   sw->config.device_id);
> >  
> > diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> > index 37f05cb..bec46b7 100644
> > --- a/include/linux/pci_ids.h
> > +++ b/include/linux/pci_ids.h
> > @@ -2599,6 +2599,24 @@
> >  #define PCI_DEVICE_ID_INTEL_82441	0x1237
> >  #define PCI_DEVICE_ID_INTEL_82380FB	0x124b
> >  #define PCI_DEVICE_ID_INTEL_82439	0x1250
> > +#define PCI_DEVICE_ID_INTEL_LIGHT_RIDGE             0x1513 /* Tbt 1 Gen 1 */
> > +#define PCI_DEVICE_ID_INTEL_EAGLE_RIDGE             0x151a
> > +#define PCI_DEVICE_ID_INTEL_LIGHT_PEAK              0x151b
> > +#define PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C         0x1547 /* Tbt 1 Gen 2 */
> > +#define PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_2C         0x1548
> > +#define PCI_DEVICE_ID_INTEL_PORT_RIDGE              0x1549
> > +#define PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_2C_NHI    0x1566 /* Tbt 1 Gen 3 */
> > +#define PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_2C_BRIDGE 0x1567
> > +#define PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_4C_NHI    0x1568
> > +#define PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_4C_BRIDGE 0x1569
> > +#define PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_NHI     0x156a /* Thunderbolt 2 */
> > +#define PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE  0x156b
> > +#define PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI     0x156c
> > +#define PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE  0x156d
> > +#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_NHI     0x1575 /* Thunderbolt 3 */
> > +#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_BRIDGE  0x1576
> > +#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_NHI     0x1577
> > +#define PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_BRIDGE  0x1578
> >  #define PCI_DEVICE_ID_INTEL_80960_RP	0x1960
> >  #define PCI_DEVICE_ID_INTEL_82840_HB	0x1a21
> >  #define PCI_DEVICE_ID_INTEL_82845_HB	0x1a30
> > -- 
> > 2.7.0
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-03-20 13:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 14:50 [RFC 0/4] Runtime pm for thunderbolt.ko Lukas Wunner
2016-03-16 14:50 ` [RFC 3/4] thunderbolt: Move pm code to separate file Lukas Wunner
2016-03-16 14:50 ` [RFC 4/4] thunderbolt: Support runtime pm Lukas Wunner
2016-03-16 15:26   ` Alan Stern
2016-03-16 16:20     ` Lukas Wunner
2016-03-17 14:54       ` Alan Stern
2016-05-13 12:10         ` Lukas Wunner
2016-03-20 13:53   ` Andreas Noever
2016-04-24 15:23     ` Lukas Wunner
2016-05-01 11:18       ` Andreas Noever
2016-03-16 14:50 ` [RFC 1/4] PCI: Add Thunderbolt device IDs Lukas Wunner
2016-03-17 15:03   ` Bjorn Helgaas
2016-03-20 13:11     ` Lukas Wunner [this message]
2016-03-20 17:12       ` Greg Kroah-Hartman
2016-04-05 23:27         ` Bjorn Helgaas
2016-04-07 22:42           ` Andreas Noever
2016-03-16 14:50 ` [RFC 2/4] thunderbolt: Fix typos and magic number Lukas Wunner
2016-03-20 13:54   ` 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=20160320131135.GA29174@wunner.de \
    --to=lukas@wunner.de \
    --cc=andreas.noever@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    /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).