Linux-ACPI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1] usb: core: Add ACPI support for USB interfaces
@ 2020-03-23 19:55 Andy Shevchenko
  2020-03-24  6:26 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-03-23 19:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb, Rafael J. Wysocki, linux-acpi
  Cc: Andy Shevchenko

The ACPI companion of the device has to be set for USB interfaces
in order to read and attach the properties described in the ACPI table.
Use ACPI_COMPANION_SET macro to set this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/core/message.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 5adf489428aa..d5f834f16993 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -5,6 +5,7 @@
  * Released under the GPLv2 only.
  */
 
+#include <linux/acpi.h>
 #include <linux/pci.h>	/* for scatterlist macros */
 #include <linux/usb.h>
 #include <linux/module.h>
@@ -1941,6 +1942,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
 			intf->dev.of_node = usb_of_get_interface_node(dev,
 					configuration, ifnum);
 		}
+		ACPI_COMPANION_SET(&intf->dev, ACPI_COMPANION(&dev->dev));
 		intf->dev.driver = NULL;
 		intf->dev.bus = &usb_bus_type;
 		intf->dev.type = &usb_if_device_type;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] usb: core: Add ACPI support for USB interfaces
  2020-03-23 19:55 [PATCH v1] usb: core: Add ACPI support for USB interfaces Andy Shevchenko
@ 2020-03-24  6:26 ` Greg Kroah-Hartman
  2020-03-24  9:00   ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2020-03-24  6:26 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-usb, Rafael J. Wysocki, linux-acpi

On Mon, Mar 23, 2020 at 09:55:43PM +0200, Andy Shevchenko wrote:
> The ACPI companion of the device has to be set for USB interfaces
> in order to read and attach the properties described in the ACPI table.
> Use ACPI_COMPANION_SET macro to set this.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/usb/core/message.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
> index 5adf489428aa..d5f834f16993 100644
> --- a/drivers/usb/core/message.c
> +++ b/drivers/usb/core/message.c
> @@ -5,6 +5,7 @@
>   * Released under the GPLv2 only.
>   */
>  
> +#include <linux/acpi.h>
>  #include <linux/pci.h>	/* for scatterlist macros */
>  #include <linux/usb.h>
>  #include <linux/module.h>
> @@ -1941,6 +1942,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
>  			intf->dev.of_node = usb_of_get_interface_node(dev,
>  					configuration, ifnum);
>  		}
> +		ACPI_COMPANION_SET(&intf->dev, ACPI_COMPANION(&dev->dev));
>  		intf->dev.driver = NULL;
>  		intf->dev.bus = &usb_bus_type;
>  		intf->dev.type = &usb_if_device_type;

And what does this "fix"?

Is this a new feature, what isn't working today without this change?

And if it is a fix, should it be backported to older kernels, how far?

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] usb: core: Add ACPI support for USB interfaces
  2020-03-24  6:26 ` Greg Kroah-Hartman
@ 2020-03-24  9:00   ` Andy Shevchenko
  2020-03-24  9:13     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-03-24  9:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, Rafael J. Wysocki, linux-acpi

On Tue, Mar 24, 2020 at 07:26:35AM +0100, Greg Kroah-Hartman wrote:
> On Mon, Mar 23, 2020 at 09:55:43PM +0200, Andy Shevchenko wrote:
> > The ACPI companion of the device has to be set for USB interfaces
> > in order to read and attach the properties described in the ACPI table.
> > Use ACPI_COMPANION_SET macro to set this.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/usb/core/message.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
> > index 5adf489428aa..d5f834f16993 100644
> > --- a/drivers/usb/core/message.c
> > +++ b/drivers/usb/core/message.c
> > @@ -5,6 +5,7 @@
> >   * Released under the GPLv2 only.
> >   */
> >  
> > +#include <linux/acpi.h>
> >  #include <linux/pci.h>	/* for scatterlist macros */
> >  #include <linux/usb.h>
> >  #include <linux/module.h>
> > @@ -1941,6 +1942,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
> >  			intf->dev.of_node = usb_of_get_interface_node(dev,
> >  					configuration, ifnum);
> >  		}
> > +		ACPI_COMPANION_SET(&intf->dev, ACPI_COMPANION(&dev->dev));
> >  		intf->dev.driver = NULL;
> >  		intf->dev.bus = &usb_bus_type;
> >  		intf->dev.type = &usb_if_device_type;
> 

> And what does this "fix"?

It links the firmware node of physical USB device to USB interface.
Otherwise it will be no firmware nodes under a corresponding folder.

It mimics what is done for OF in couple of lines above.

> Is this a new feature, what isn't working today without this change?

Yes, it is a new feature. I can't tell it fixes anything, because no complains
so far. I doubt it previously works.

> And if it is a fix, should it be backported to older kernels, how far?

No, no need for that. Usually I put Fixes tag when I would like change to be
considered for backporting.

I'll probably update the commit message to clarify all this. Would it be enough?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] usb: core: Add ACPI support for USB interfaces
  2020-03-24  9:00   ` Andy Shevchenko
@ 2020-03-24  9:13     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2020-03-24  9:13 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-usb, Rafael J. Wysocki, linux-acpi

On Tue, Mar 24, 2020 at 11:00:37AM +0200, Andy Shevchenko wrote:
> On Tue, Mar 24, 2020 at 07:26:35AM +0100, Greg Kroah-Hartman wrote:
> > On Mon, Mar 23, 2020 at 09:55:43PM +0200, Andy Shevchenko wrote:
> > > The ACPI companion of the device has to be set for USB interfaces
> > > in order to read and attach the properties described in the ACPI table.
> > > Use ACPI_COMPANION_SET macro to set this.
> > > 
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > ---
> > >  drivers/usb/core/message.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
> > > index 5adf489428aa..d5f834f16993 100644
> > > --- a/drivers/usb/core/message.c
> > > +++ b/drivers/usb/core/message.c
> > > @@ -5,6 +5,7 @@
> > >   * Released under the GPLv2 only.
> > >   */
> > >  
> > > +#include <linux/acpi.h>
> > >  #include <linux/pci.h>	/* for scatterlist macros */
> > >  #include <linux/usb.h>
> > >  #include <linux/module.h>
> > > @@ -1941,6 +1942,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
> > >  			intf->dev.of_node = usb_of_get_interface_node(dev,
> > >  					configuration, ifnum);
> > >  		}
> > > +		ACPI_COMPANION_SET(&intf->dev, ACPI_COMPANION(&dev->dev));
> > >  		intf->dev.driver = NULL;
> > >  		intf->dev.bus = &usb_bus_type;
> > >  		intf->dev.type = &usb_if_device_type;
> > 
> 
> > And what does this "fix"?
> 
> It links the firmware node of physical USB device to USB interface.
> Otherwise it will be no firmware nodes under a corresponding folder.
> 
> It mimics what is done for OF in couple of lines above.
> 
> > Is this a new feature, what isn't working today without this change?
> 
> Yes, it is a new feature. I can't tell it fixes anything, because no complains
> so far. I doubt it previously works.
> 
> > And if it is a fix, should it be backported to older kernels, how far?
> 
> No, no need for that. Usually I put Fixes tag when I would like change to be
> considered for backporting.
> 
> I'll probably update the commit message to clarify all this. Would it be enough?

Please do so, what you have now is insufficient :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 19:55 [PATCH v1] usb: core: Add ACPI support for USB interfaces Andy Shevchenko
2020-03-24  6:26 ` Greg Kroah-Hartman
2020-03-24  9:00   ` Andy Shevchenko
2020-03-24  9:13     ` Greg Kroah-Hartman

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org
	public-inbox-index linux-acpi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git