lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Mar 2015 15:55:59 +0200
From:	Roger Quadros <rogerq@...com>
To:	<gregkh@...uxfoundation.org>, <balbi@...com>,
	<stern@...land.harvard.edu>
CC:	<dan.j.williams@...el.com>, <peter.chen@...escale.com>,
	<jun.li@...escale.com>, <mathias.nyman@...ux.intel.com>,
	<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-omap@...r.kernel.org>, Roger Quadros <rogerq@...com>
Subject: [RFC][PATCH 5/9] usb: hcd: adapt to OTG

Register with OTG core as part of usb_add_hcd() and
unregister from it in usb_remove_hcd().

For OTG device the HCD is actually started or stopped
from the OTG FSM.

Signed-off-by: Roger Quadros <rogerq@...com>
---
 drivers/usb/core/hcd.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index e28bd9d..9e8ecc9 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -46,6 +46,7 @@
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
 #include <linux/usb/phy.h>
+#include <linux/usb/usb-otg.h>
 
 #include "usb.h"
 
@@ -2826,9 +2827,12 @@ int usb_add_hcd(struct usb_hcd *hcd,
 			goto err_request_irq;
 	}
 
-	retval = usb_start_hcd(hcd);
-	if (retval)
-		goto err_hcd_driver_start;
+	/* If OTG device, OTG core takes care of starting HCD */
+	if (usb_otg_register_hcd(hcd)) {
+		retval = usb_start_hcd(hcd);
+		if (retval)
+			goto err_hcd_driver_start;
+	}
 
 	return 0;
 
@@ -2936,7 +2940,9 @@ void usb_remove_hcd(struct usb_hcd *hcd)
 {
 	dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);
 
-	usb_stop_hcd(hcd);
+	/* If OTG device, OTG core takes care of stopping HCD */
+	if (usb_otg_unregister_hcd(hcd))
+		usb_stop_hcd(hcd);
 
 	if (usb_hcd_is_primary_hcd(hcd)) {
 		if (hcd->irq > 0)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ