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]
Message-Id: <1364978713-19612-10-git-send-email-fabio.baltieri@linaro.org>
Date:	Wed,  3 Apr 2013 10:45:10 +0200
From:	Fabio Baltieri <fabio.baltieri@...aro.org>
To:	Felipe Balbi <balbi@...com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	Praveena Nadahally <praveen.nadahally@...ricsson.com>,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	Fabio Baltieri <fabio.baltieri@...aro.org>
Subject: [PATCH 09/12] usb: phy: ab8500-usb: fix last notifier arguments

Fix last ab->phy.notifier call to use vbus_draw as notifier argument, as
that's used in ab8500_charger to control charging current.

Also drop a related TODO comment, and the additional
ux500_musb_set_vbus(musb, 0), as with this patch it was causing an
erratic behaviour of gadget ep0 state machine.

Acked-by: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@...aro.org>
---
 drivers/usb/musb/ux500.c         |  1 -
 drivers/usb/phy/phy-ab8500-usb.c | 10 +++-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index 88795f5..2c80004 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -114,7 +114,6 @@ static int musb_otg_notifications(struct notifier_block *nb,
 		break;
 	case UX500_MUSB_VBUS:
 		dev_dbg(musb->controller, "VBUS Connect\n");
-		ux500_musb_set_vbus(musb, 0);
 		break;
 	case UX500_MUSB_NONE:
 		dev_dbg(musb->controller, "VBUS Disconnect\n");
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index b7f6639..ff27058 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -577,16 +577,12 @@ static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
 
 	ab->vbus_draw = mA;
 
-	if (mA)
-		atomic_notifier_call_chain(&ab->phy.notifier,
-				UX500_MUSB_ENUMERATED, ab->phy.otg->gadget);
+	atomic_notifier_call_chain(&ab->phy.notifier,
+			UX500_MUSB_VBUS, &ab->vbus_draw);
+
 	return 0;
 }
 
-/* TODO: Implement some way for charging or other drivers to read
- * ab->vbus_draw.
- */
-
 static int ab8500_usb_set_suspend(struct usb_phy *x, int suspend)
 {
 	/* TODO */
-- 
1.8.1.3

--
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