All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörg-Volker Peetz" <jvpeetz@web.de>
To: linux-kernel@vger.kernel.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [BISECTED] (?) since 3.16: USB video cam of an HP Pavilion dv7 laptop not working
Date: Tue, 09 Sep 2014 13:36:02 +0200	[thread overview]
Message-ID: <540EE622.4030203@web.de> (raw)
In-Reply-To: <540DC871.7040901@web.de>

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

Jörg-Volker Peetz wrote on 09/08/2014 17:17:
> Since 3.16 the builtin USB video cam of an HP Pavilion dv7 laptop shows only a
> black screen with the application guvcview although the video LED is turned on.
> There is no hint in dmesg. Also the output of guvcview shows no conspicuousness.
> 
> With kernel version 3.15.9 the camera works.
> 
> I tried to bisect between good v3.15 and bad v3.16, which identified
> 
> commit 9262c19d14c433a6a1ba25c3ff897cb89e412309
> Author: Dan Williams <dan.j.williams@intel.com>
> Date:   Tue May 20 18:08:12 2014 -0700
> 
>     usb: disable port power control if not supported in wHubCharacteristics
> 
>     A hub indicates whether it supports per-port power control via the
>     wHubCharacteristics field in its descriptor.  If it is not supported
>     a hub will still emulate ClearPortPower(PORT_POWER) requests by
>     stopping the link state machine.  However, since this does not save
>     power do not bother suspending.
> 
>     This also consolidates support checks into a
>     hub_is_port_power_switchable() helper.
> 
>     Acked-by: Alan Stern <stern@rowland.harvard.edu>
>     Signed-off-by: Dan Williams <dan.j.williams@intel.com>
>     Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> In the bad bisection steps the video device even was not found. Therefore, I'm
> not sure if I identified the right culprit.
> 

As you suggested Dan, I reverted this commit on top of 3.16.0 (the commit could
not be reverted cleanly, I had to do it manually, patch appended). But still I
see a black picture from the camera. So this commit is not the culprit.

How to proceed with the bisection?
-- 
Regards,
Jörg-Volker.


[-- Attachment #2: my-patch --]
[-- Type: text/plain, Size: 2926 bytes --]

--- hub.c.orig	2014-08-04 00:25:02.000000000 +0200
+++ hub.c	2014-09-09 11:56:24.721312469 +0200
@@ -820,6 +820,8 @@ EXPORT_SYMBOL_GPL(usb_hub_clear_tt_buffe
 static void hub_power_on(struct usb_hub *hub, bool do_delay)
 {
 	int port1;
+	u16 wHubCharacteristics =
+			le16_to_cpu(hub->descriptor->wHubCharacteristics);
 
 	/* Enable power on each port.  Some hubs have reserved values
 	 * of LPSM (> 2) in their descriptors, even though they are
@@ -827,7 +829,7 @@ static void hub_power_on(struct usb_hub
 	 * but only emulate it.  In all cases, the ports won't work
 	 * unless we send these messages to the hub.
 	 */
-	if (hub_is_port_power_switchable(hub))
+	if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2)
 		dev_dbg(hub->intfdev, "enabling power on all ports\n");
 	else
 		dev_dbg(hub->intfdev, "trying to enable port power on "
@@ -4548,6 +4550,8 @@ static void hub_port_connect(struct usb_
 	unsigned unit_load;
 	struct usb_device *hdev = hub->hdev;
 	struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
+	unsigned wHubCharacteristics =
+			le16_to_cpu(hub->descriptor->wHubCharacteristics);
 	struct usb_port *port_dev = hub->ports[port1 - 1];
 	struct usb_device *udev = port_dev->child;
 
@@ -4586,7 +4590,7 @@ static void hub_port_connect(struct usb_
 			test_bit(port1, hub->removed_bits)) {
 
 		/* maybe switch power back on (e.g. root hub was reset) */
-		if (hub_is_port_power_switchable(hub)
+		if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2
 				&& !port_is_power_on(hub, portstatus))
 			set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);
 
--- hub.h.orig	2014-08-04 00:25:02.000000000 +0200
+++ hub.h	2014-09-09 12:52:40.027903791 +0200
@@ -119,16 +119,6 @@ extern int hub_port_debounce(struct usb_
 extern int usb_clear_port_feature(struct usb_device *hdev,
 		int port1, int feature);
 
-static inline bool hub_is_port_power_switchable(struct usb_hub *hub)
-{
-	__le16 hcs;
-
-	if (!hub)
-		return false;
-	hcs = hub->descriptor->wHubCharacteristics;
-	return (le16_to_cpu(hcs) & HUB_CHAR_LPSM) < HUB_CHAR_NO_LPSM;
-}
-
 static inline int hub_is_superspeed(struct usb_device *hdev)
 {
 	return hdev->descriptor.bDeviceProtocol == USB_HUB_PR_SS;
--- port.c.orig	2014-08-04 00:25:02.000000000 +0200
+++ port.c	2014-09-09 12:58:46.521229430 +0200
@@ -445,16 +445,11 @@ int usb_hub_create_port_device(struct us
 	 */
 	pm_runtime_set_active(&port_dev->dev);
 	pm_runtime_get_noresume(&port_dev->dev);
-	pm_runtime_enable(&port_dev->dev);
+	if (!dev_pm_qos_expose_flags(&port_dev->dev,
+			PM_QOS_FLAG_NO_POWER_OFF))
+		pm_runtime_enable(&port_dev->dev);
 	device_enable_async_suspend(&port_dev->dev);
 
-	/*
-	 * Keep hidden the ability to enable port-poweroff if the hub
-	 * does not support power switching.
-	 */
-	if (!hub_is_port_power_switchable(hub))
-		return 0;
-
 	/* Attempt to let userspace take over the policy. */
 	retval = dev_pm_qos_expose_flags(&port_dev->dev,
 			PM_QOS_FLAG_NO_POWER_OFF);

  reply	other threads:[~2014-09-09 11:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 15:17 [BISECTED] (?) since 3.16: USB video cam of an HP Pavilion dv7 laptop not working Jörg-Volker Peetz
2014-09-09 11:36 ` Jörg-Volker Peetz [this message]
2014-10-01 20:51 ` Dominik Kopp

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=540EE622.4030203@web.de \
    --to=jvpeetz@web.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.