2014-11-21 06:03:13

by Kiran Kumar Raparthy

[permalink] [raw]
Subject: [PATCH v1 0/3] usb: phy: hold wakeupsource on usb phy events

This patch set aims to hold wakeupsource per-PHY on usb connect/disconnect
events.

First patch introduces usb_phy_set_event which just sets
event to phy event.
In second patch, phy drivers call usb_phy_set_event for each phy event.
In third patch, wakeupsource is held when usb is enumerated in
peripheral mode and wakeupsource held temporarily on disconnect
event(to allow other parts of the system react to disconnect event).

PATCH v1:
*Author/ownership changed to Kiran Raparthy as per Todd's suggestion.

PATCH:
* use USB_PHY_DEFAULT_WAKEUP_SRC_TIMEOUT instead of TEMPORARY_HOLD_TIME

RFC v6:
* Break the patch into three sub patches
patch 1: Introduce usb_phy_set_event
patch 2: Call usb_phy_set_event from phy drivers
patch 3: Hold wakeupsource for connect events and
temporarily hold wakeupsource for disconnect events.
* Include usb_phy_wsource_init and usb_phy_wource_trash functionality
in usb_add_phy and usb_remove_phy respectively.

RFC v5:
* with the new approach,i was able to chnage only 5 phy drivers
as mentioned below to use the wakeupsource funtionality.

drivers/phy/phy-omap-control.c
drivers/usb/phy/phy-ab8500-usb.c
drivers/usb/phy/phy-tahvo.c
drivers/usb/phy/phy-mv-usb.c
drivers/usb/phy/phy-gpio-vbus-usb.c

* Notification method not used any more.
* introduced usb_phy_set_event in phy.c to hold wakeupsource
* introduced usb_phy_wsource_init/usb_phy_wsource_trash in phy.c to
initialize/relese per-PHY wakeupsource.These interfaces called from
probe/remove functions of phy drivers.
* usb_phy_set_event called from phy drivers where usb enumeration
event is handled.
* usb_phy_set_event expects usb_phy handle where as phy-omap-control.c
provides its own type(omap_control_phy), so directly called __pm_stay_awake
and __pm_awake_event from phy-omap-control.c instead of calling
usb_phy_set_event.

RFC v4:
* Temporarily hold wakeupsource patch integrated into main patch.
* As per feedback,dropped "enabled" module parameter.
* Introduced otgws_otg_usb3_notifications function to handle event
notifications from usb3 phy.
* Handled wakeupsource initialization,spinlock,registration of notifier block
per-PHY.
* Updated usb_phy structure.

RFC v3:
* As per the feedback,no global phy pointer used.
* called the one-liner wakeupsource handling calls
directly instead of indirect functions implemented in v2.
* Removed indirect function get_phy_hook and used usb_get_phy
to get the phy handle..

RFC v2:
* wakeupsource handling implemeted per-PHY
* Implemented wakeupsource handling calls in phy
* included Todd's refactoring logic.

RFC v1:
* changed to "disabled by default" from "enable by default".
* Kconfig help text modified
* Included better commit text
* otgws_nb moved to otg_wakeupsource_init function
* Introduced get_phy_hook to handle otgws_xceiv per-PHY

Initial RFC:
* Included build fix from Benoit Goby and Arve Hj?nnev?g
* Removed lock->held field in driver as this mechanism is
provided in wakeupsource driver.
* wakelock(wl) terminology replaced with wakeup_source(ws).


Kiran Raparthy (3):
usb: phy: introduce usb_phy_set_event interface
usb: phy: Handle per-PHY event for connect and disconnect events
usb: phy: hold wakeupsource when USB is enumerated in peripheral mode

drivers/usb/phy/phy-ab8500-usb.c | 15 +++++++++++++++
drivers/usb/phy/phy-gpio-vbus-usb.c | 2 ++
drivers/usb/phy/phy-mv-usb.c | 2 ++
drivers/usb/phy/phy-tahvo.c | 2 ++
drivers/usb/phy/phy.c | 37 +++++++++++++++++++++++++++++++++++++
include/linux/usb/phy.h | 10 ++++++++++
6 files changed, 68 insertions(+)

--
1.8.2.1


2014-11-21 06:04:24

by Kiran Kumar Raparthy

[permalink] [raw]
Subject: [PATCH v1 1/3] usb: phy: introduce usb_phy_set_event interface

usb: phy: introduce usb_phy_set_event interface

PHY drivers require a generic interface to handle per-PHY events.

usb_phy_set_event interface sets event to phy event.
PHY drivers call this interface for each phy event.

Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Android Kernel Team <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Arve Hj?nnev?g <[email protected]>
Cc: Benoit Goby <[email protected]>
[Original patch in Android from Todd]
Cc: Todd Poynor <[email protected]>
Signed-off-by: Kiran Raparthy <[email protected]>
---
drivers/usb/phy/phy.c | 12 ++++++++++++
include/linux/usb/phy.h | 5 +++++
2 files changed, 17 insertions(+)

diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index 045cd30..2b1039e 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -444,3 +444,15 @@ int usb_bind_phy(const char *dev_name, u8 index,
return 0;
}
EXPORT_SYMBOL_GPL(usb_bind_phy);
+
+/**
+ * usb_phy_set_event - set event to phy event
+ * @x: the phy returned by usb_get_phy();
+ *
+ * This sets event to phy event
+ */
+void usb_phy_set_event(struct usb_phy *x, unsigned long event)
+{
+ x->last_event = event;
+}
+EXPORT_SYMBOL_GPL(usb_phy_set_event);
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 353053a..3c713ff 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -210,6 +210,7 @@ extern void usb_put_phy(struct usb_phy *);
extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
extern int usb_bind_phy(const char *dev_name, u8 index,
const char *phy_dev_name);
+extern void usb_phy_set_event(struct usb_phy *x, unsigned long event);
#else
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
{
@@ -251,6 +252,10 @@ static inline int usb_bind_phy(const char *dev_name, u8 index,
{
return -EOPNOTSUPP;
}
+
+static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event)
+{
+}
#endif

static inline int
--
1.8.2.1

2014-11-21 06:04:35

by Kiran Kumar Raparthy

[permalink] [raw]
Subject: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

usb: phy: Handle per-PHY event for connnect and disconnect events

When usb is connected and enumerated in device mode or when usb is
disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.

Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Android Kernel Team <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Arve Hj?nnev?g <[email protected]>
Cc: Benoit Goby <[email protected]>
[Original patch in Android from Todd]
Cc: Todd Poynor <[email protected]>
Signed-off-by: Kiran Raparthy <[email protected]>
---
drivers/usb/phy/phy-ab8500-usb.c | 15 +++++++++++++++
drivers/usb/phy/phy-gpio-vbus-usb.c | 2 ++
drivers/usb/phy/phy-mv-usb.c | 2 ++
drivers/usb/phy/phy-tahvo.c | 2 ++
4 files changed, 21 insertions(+)

diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index 11ab2c4..d79fa3e 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -447,6 +447,7 @@ static int ab9540_usb_link_status_update(struct ab8500_usb *ab,
event = UX500_MUSB_NONE;
/* Fallback to default B_IDLE as nothing is connected. */
ab->phy.state = OTG_STATE_B_IDLE;
+ usb_phy_set_event(&ab->phy, USB_EVENT_NONE);
break;

case USB_LINK_ACA_RID_C_NM_9540:
@@ -461,12 +462,14 @@ static int ab9540_usb_link_status_update(struct ab8500_usb *ab,
ab8500_usb_peri_phy_en(ab);
atomic_notifier_call_chain(&ab->phy.notifier,
UX500_MUSB_PREPARE, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED);
}
if (ab->mode == USB_IDLE) {
ab->mode = USB_PERIPHERAL;
ab8500_usb_peri_phy_en(ab);
atomic_notifier_call_chain(&ab->phy.notifier,
UX500_MUSB_PREPARE, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED);
}
if (event != UX500_MUSB_RIDC)
event = UX500_MUSB_VBUS;
@@ -502,6 +505,7 @@ static int ab9540_usb_link_status_update(struct ab8500_usb *ab,
event = UX500_MUSB_CHARGER;
atomic_notifier_call_chain(&ab->phy.notifier,
event, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_CHARGER);
break;

case USB_LINK_PHYEN_NO_VBUS_NO_IDGND_9540:
@@ -526,6 +530,7 @@ static int ab9540_usb_link_status_update(struct ab8500_usb *ab,
ab->mode = USB_IDLE;
ab->phy.otg->default_a = false;
ab->vbus_draw = 0;
+ usb_phy_set_event(&ab->phy, USB_EVENT_NONE);
}
}
break;
@@ -585,6 +590,7 @@ static int ab8540_usb_link_status_update(struct ab8500_usb *ab,
* is connected
*/
ab->phy.state = OTG_STATE_B_IDLE;
+ usb_phy_set_event(&ab->phy, USB_EVENT_NONE);
break;

case USB_LINK_ACA_RID_C_NM_8540:
@@ -598,6 +604,7 @@ static int ab8540_usb_link_status_update(struct ab8500_usb *ab,
ab8500_usb_peri_phy_en(ab);
atomic_notifier_call_chain(&ab->phy.notifier,
UX500_MUSB_PREPARE, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED);
}
if (event != UX500_MUSB_RIDC)
event = UX500_MUSB_VBUS;
@@ -626,6 +633,7 @@ static int ab8540_usb_link_status_update(struct ab8500_usb *ab,
event = UX500_MUSB_CHARGER;
atomic_notifier_call_chain(&ab->phy.notifier,
event, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_CHARGER);
break;

case USB_LINK_PHYEN_NO_VBUS_NO_IDGND_8540:
@@ -648,6 +656,7 @@ static int ab8540_usb_link_status_update(struct ab8500_usb *ab,
ab->mode = USB_IDLE;
ab->phy.otg->default_a = false;
ab->vbus_draw = 0;
+ usb_phy_set_event(&ab->phy, USB_EVENT_NONE);
}
break;

@@ -694,6 +703,7 @@ static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
* is connected
*/
ab->phy.state = OTG_STATE_B_IDLE;
+ usb_phy_set_event(&ab->phy, USB_EVENT_NONE);
break;

case USB_LINK_ACA_RID_C_NM_8505:
@@ -707,6 +717,7 @@ static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
ab8500_usb_peri_phy_en(ab);
atomic_notifier_call_chain(&ab->phy.notifier,
UX500_MUSB_PREPARE, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED);
}
if (event != UX500_MUSB_RIDC)
event = UX500_MUSB_VBUS;
@@ -734,6 +745,7 @@ static int ab8505_usb_link_status_update(struct ab8500_usb *ab,
event = UX500_MUSB_CHARGER;
atomic_notifier_call_chain(&ab->phy.notifier,
event, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_CHARGER);
break;

default:
@@ -777,6 +789,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
event = UX500_MUSB_NONE;
/* Fallback to default B_IDLE as nothing is connected */
ab->phy.state = OTG_STATE_B_IDLE;
+ usb_phy_set_event(&ab->phy, USB_EVENT_NONE);
break;

case USB_LINK_ACA_RID_C_NM_8500:
@@ -794,6 +807,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
ab8500_usb_peri_phy_en(ab);
atomic_notifier_call_chain(&ab->phy.notifier,
UX500_MUSB_PREPARE, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED);
}
if (event != UX500_MUSB_RIDC)
event = UX500_MUSB_VBUS;
@@ -820,6 +834,7 @@ static int ab8500_usb_link_status_update(struct ab8500_usb *ab,
event = UX500_MUSB_CHARGER;
atomic_notifier_call_chain(&ab->phy.notifier,
event, &ab->vbus_draw);
+ usb_phy_set_event(&ab->phy, USB_EVENT_CHARGER);
break;

case USB_LINK_RESERVED_8500:
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c
index f4b14bd..840dc2b 100644
--- a/drivers/usb/phy/phy-gpio-vbus-usb.c
+++ b/drivers/usb/phy/phy-gpio-vbus-usb.c
@@ -134,6 +134,7 @@ static void gpio_vbus_work(struct work_struct *work)

atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
status, gpio_vbus->phy.otg->gadget);
+ usb_phy_set_event(&gpio_vbus->phy, USB_EVENT_ENUMERATED);
} else {
/* optionally disable D+ pullup */
if (gpio_is_valid(gpio))
@@ -148,6 +149,7 @@ static void gpio_vbus_work(struct work_struct *work)

atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
status, gpio_vbus->phy.otg->gadget);
+ usb_phy_set_event(&gpio_vbus->phy, USB_EVENT_NONE);
}
}

diff --git a/drivers/usb/phy/phy-mv-usb.c b/drivers/usb/phy/phy-mv-usb.c
index 7d80c54..8ed9f95 100644
--- a/drivers/usb/phy/phy-mv-usb.c
+++ b/drivers/usb/phy/phy-mv-usb.c
@@ -441,10 +441,12 @@ run:
mv_otg_start_periphrals(mvotg, 0);
mv_otg_reset(mvotg);
mv_otg_disable(mvotg);
+ usb_phy_set_event(&mvotg->phy, USB_EVENT_NONE);
break;
case OTG_STATE_B_PERIPHERAL:
mv_otg_enable(mvotg);
mv_otg_start_periphrals(mvotg, 1);
+ usb_phy_set_event(&mvotg->phy, USB_EVENT_ENUMERATED);
break;
case OTG_STATE_A_IDLE:
otg->default_a = 1;
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index cc61ee4..5551ef0 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -87,6 +87,7 @@ static void check_vbus_state(struct tahvo_usb *tu)
if (tu->phy.otg->gadget)
usb_gadget_vbus_connect(tu->phy.otg->gadget);
tu->phy.state = OTG_STATE_B_PERIPHERAL;
+ usb_phy_set_event(&tu->phy, USB_EVENT_ENUMERATED);
break;
case OTG_STATE_A_IDLE:
/*
@@ -105,6 +106,7 @@ static void check_vbus_state(struct tahvo_usb *tu)
if (tu->phy.otg->gadget)
usb_gadget_vbus_disconnect(tu->phy.otg->gadget);
tu->phy.state = OTG_STATE_B_IDLE;
+ usb_phy_set_event(&tu->phy, USB_EVENT_NONE);
break;
case OTG_STATE_A_HOST:
tu->phy.state = OTG_STATE_A_IDLE;
--
1.8.2.1

2014-11-21 06:04:49

by Kiran Kumar Raparthy

[permalink] [raw]
Subject: [PATCH v1 3/3] usb: phy: hold wakeupsource when USB is enumerated in peripheral mode

usb: phy: hold wakeupsource when USB is enumerated in peripheral mode

Some systems require a mechanism to prevent system to enter into suspend
state when USB is connected and enumerated in peripheral mode.

This patch provides an interface to hold a wakeupsource to prevent suspend.
PHY drivers can use this interface when USB is connected and enumerated in
peripheral mode.

A timed wakeupsource is temporarily held on USB disconnect events, to allow
the rest of the system to react to the USB disconnection (dropping host
sessions, updating charger status, etc.) prior to re-allowing suspend.

Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Android Kernel Team <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Arve Hj?nnev?g <[email protected]>
Cc: Benoit Goby <[email protected]>
[Original patch in Android from Todd]
Cc: Todd Poynor <[email protected]>
Signed-off-by: Kiran Raparthy <[email protected]>
---
drivers/usb/phy/phy.c | 29 +++++++++++++++++++++++++++--
include/linux/usb/phy.h | 5 +++++
2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index 2b1039e..b8a2d56 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -329,6 +329,7 @@ int usb_add_phy(struct usb_phy *x, enum usb_phy_type type)
int ret = 0;
unsigned long flags;
struct usb_phy *phy;
+ char wsource_name[40];

if (x->type != USB_PHY_TYPE_UNDEFINED) {
dev_err(x->dev, "not accepting initialized PHY %s\n", x->label);
@@ -351,6 +352,10 @@ int usb_add_phy(struct usb_phy *x, enum usb_phy_type type)
x->type = type;
list_add_tail(&x->head, &phy_list);

+ snprintf(wsource_name, sizeof(wsource_name), "vbus-%s",
+ dev_name(x->dev));
+ wakeup_source_init(&x->wsource, wsource_name);
+
out:
spin_unlock_irqrestore(&phy_lock, flags);
return ret;
@@ -402,6 +407,7 @@ void usb_remove_phy(struct usb_phy *x)

spin_lock_irqsave(&phy_lock, flags);
if (x) {
+ wakeup_source_trash(&x->wsource);
list_for_each_entry(phy_bind, &phy_bind_list, list)
if (phy_bind->phy == x)
phy_bind->phy = NULL;
@@ -446,13 +452,32 @@ int usb_bind_phy(const char *dev_name, u8 index,
EXPORT_SYMBOL_GPL(usb_bind_phy);

/**
- * usb_phy_set_event - set event to phy event
+ * usb_phy_set_event - set event to phy event and
+ * hold/temporarily hold wakeupsource
* @x: the phy returned by usb_get_phy();
*
- * This sets event to phy event
+ * This holds per-PHY wakeupsource/timed wakeupsource
*/
void usb_phy_set_event(struct usb_phy *x, unsigned long event)
{
+
x->last_event = event;
+
+ switch (event) {
+ case USB_EVENT_ENUMERATED:
+ __pm_stay_awake(&x->wsource);
+ break;
+
+ case USB_EVENT_NONE:
+ case USB_EVENT_ID:
+ case USB_EVENT_VBUS:
+ case USB_EVENT_CHARGER:
+ __pm_wakeup_event(&x->wsource,
+ USB_PHY_DEFAULT_WAKEUP_SRC_TIMEOUT);
+ break;
+
+ default:
+ break;
+ }
}
EXPORT_SYMBOL_GPL(usb_phy_set_event);
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 3c713ff..c593fc6 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -12,6 +12,8 @@
#include <linux/notifier.h>
#include <linux/usb.h>

+#define USB_PHY_DEFAULT_WAKEUP_SRC_TIMEOUT msecs_to_jiffies(2000)
+
enum usb_phy_interface {
USBPHY_INTERFACE_MODE_UNKNOWN,
USBPHY_INTERFACE_MODE_UTMI,
@@ -89,6 +91,9 @@ struct usb_phy {
/* for notification of usb_phy_events */
struct atomic_notifier_head notifier;

+ /* wakeup source */
+ struct wakeup_source wsource;
+
/* to pass extra port status to the root hub */
u16 port_status;
u16 port_change;
--
1.8.2.1

2014-11-21 15:11:01

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
> usb: phy: Handle per-PHY event for connnect and disconnect events
>
> When usb is connected and enumerated in device mode or when usb is
> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
>
> Cc: Felipe Balbi <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: Android Kernel Team <[email protected]>
> Cc: John Stultz <[email protected]>
> Cc: Sumit Semwal <[email protected]>
> Cc: Arve Hj�nnev�g <[email protected]>
> Cc: Benoit Goby <[email protected]>
> [Original patch in Android from Todd]
> Cc: Todd Poynor <[email protected]>
> Signed-off-by: Kiran Raparthy <[email protected]>

this patch doesn't apply, please rebase entire series on my testing/next.

--
balbi


Attachments:
(No filename) (890.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-11-21 15:43:03

by Kiran Kumar Raparthy

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

On 21 November 2014 20:41, Felipe Balbi <[email protected]> wrote:
> On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
>> usb: phy: Handle per-PHY event for connnect and disconnect events
>>
>> When usb is connected and enumerated in device mode or when usb is
>> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
>>
>> Cc: Felipe Balbi <[email protected]>
>> Cc: Greg Kroah-Hartman <[email protected]>
>> Cc: [email protected]
>> Cc: [email protected]
>> Cc: Android Kernel Team <[email protected]>
>> Cc: John Stultz <[email protected]>
>> Cc: Sumit Semwal <[email protected]>
>> Cc: Arve Hj�nnev�g <[email protected]>
>> Cc: Benoit Goby <[email protected]>
>> [Original patch in Android from Todd]
>> Cc: Todd Poynor <[email protected]>
>> Signed-off-by: Kiran Raparthy <[email protected]>
>
> this patch doesn't apply, please rebase entire series on my testing/next.
Sure,
Regards,
Kiran
>
> --
> balbi

2014-11-24 14:38:13

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

Hi,

On Fri, Nov 21, 2014 at 09:13:00PM +0530, Kiran Raparthy wrote:
> On 21 November 2014 20:41, Felipe Balbi <[email protected]> wrote:
> > On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
> >> usb: phy: Handle per-PHY event for connnect and disconnect events
> >>
> >> When usb is connected and enumerated in device mode or when usb is
> >> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
> >>
> >> Cc: Felipe Balbi <[email protected]>
> >> Cc: Greg Kroah-Hartman <[email protected]>
> >> Cc: [email protected]
> >> Cc: [email protected]
> >> Cc: Android Kernel Team <[email protected]>
> >> Cc: John Stultz <[email protected]>
> >> Cc: Sumit Semwal <[email protected]>
> >> Cc: Arve Hj�nnev�g <[email protected]>
> >> Cc: Benoit Goby <[email protected]>
> >> [Original patch in Android from Todd]
> >> Cc: Todd Poynor <[email protected]>
> >> Signed-off-by: Kiran Raparthy <[email protected]>
> >
> > this patch doesn't apply, please rebase entire series on my testing/next.

your rebased version didn't apply either. Can you make sure you're
rebasing on top of my today's testing/next branch ?

cheers

--
balbi


Attachments:
(No filename) (1.18 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-11-24 15:49:32

by Sumit Semwal

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

Hi Felipe,

On 24 November 2014 at 20:08, Felipe Balbi <[email protected]> wrote:
> Hi,
>
> On Fri, Nov 21, 2014 at 09:13:00PM +0530, Kiran Raparthy wrote:
>> On 21 November 2014 20:41, Felipe Balbi <[email protected]> wrote:
>> > On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
>> >> usb: phy: Handle per-PHY event for connnect and disconnect events
>> >>
>> >> When usb is connected and enumerated in device mode or when usb is
>> >> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
>> >>
>> >> Cc: Felipe Balbi <[email protected]>
>> >> Cc: Greg Kroah-Hartman <[email protected]>
>> >> Cc: [email protected]
>> >> Cc: [email protected]
>> >> Cc: Android Kernel Team <[email protected]>
>> >> Cc: John Stultz <[email protected]>
>> >> Cc: Sumit Semwal <[email protected]>
>> >> Cc: Arve Hj�nnev�g <[email protected]>
>> >> Cc: Benoit Goby <[email protected]>
>> >> [Original patch in Android from Todd]
>> >> Cc: Todd Poynor <[email protected]>
>> >> Signed-off-by: Kiran Raparthy <[email protected]>
>> >
>> > this patch doesn't apply, please rebase entire series on my testing/next.
>
> your rebased version didn't apply either. Can you make sure you're
> rebasing on top of my today's testing/next branch ?
>
I just verified that I am able to apply both this patch (and the next
one - so 2/3 and 3/3) on your testing/next branch - just to make sure,
this is the git/branch right?

https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
branch:testing/next

> cheers
>
> --
> balbi



--
Thanks and regards,

Sumit Semwal
Kernel Team Lead - Linaro Mobile Group
Linaro.org │ Open source software for ARM SoCs

2014-11-24 15:54:17

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

On Mon, Nov 24, 2014 at 09:19:09PM +0530, Sumit Semwal wrote:
> Hi Felipe,
>
> On 24 November 2014 at 20:08, Felipe Balbi <[email protected]> wrote:
> > Hi,
> >
> > On Fri, Nov 21, 2014 at 09:13:00PM +0530, Kiran Raparthy wrote:
> >> On 21 November 2014 20:41, Felipe Balbi <[email protected]> wrote:
> >> > On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
> >> >> usb: phy: Handle per-PHY event for connnect and disconnect events
> >> >>
> >> >> When usb is connected and enumerated in device mode or when usb is
> >> >> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
> >> >>
> >> >> Cc: Felipe Balbi <[email protected]>
> >> >> Cc: Greg Kroah-Hartman <[email protected]>
> >> >> Cc: [email protected]
> >> >> Cc: [email protected]
> >> >> Cc: Android Kernel Team <[email protected]>
> >> >> Cc: John Stultz <[email protected]>
> >> >> Cc: Sumit Semwal <[email protected]>
> >> >> Cc: Arve Hj�nnev�g <[email protected]>
> >> >> Cc: Benoit Goby <[email protected]>
> >> >> [Original patch in Android from Todd]
> >> >> Cc: Todd Poynor <[email protected]>
> >> >> Signed-off-by: Kiran Raparthy <[email protected]>
> >> >
> >> > this patch doesn't apply, please rebase entire series on my testing/next.
> >
> > your rebased version didn't apply either. Can you make sure you're
> > rebasing on top of my today's testing/next branch ?
> >
> I just verified that I am able to apply both this patch (and the next
> one - so 2/3 and 3/3) on your testing/next branch - just to make sure,
> this is the git/branch right?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
> branch:testing/next

that's the correct branch, but here's what I get:

checking file drivers/usb/phy/phy-ab8500-usb.c
Hunk #1 FAILED at 447.
Hunk #2 succeeded at 459 (offset -2 lines).
Hunk #3 succeeded at 502 (offset -2 lines).
Hunk #4 succeeded at 527 (offset -2 lines).
Hunk #5 FAILED at 589.
Hunk #6 succeeded at 600 (offset -2 lines).
Hunk #7 succeeded at 629 (offset -2 lines).
Hunk #8 succeeded at 652 (offset -2 lines).
Hunk #9 FAILED at 701.
Hunk #10 succeeded at 712 (offset -2 lines).
Hunk #11 succeeded at 740 (offset -2 lines).
Hunk #12 FAILED at 786.
Hunk #13 succeeded at 801 (offset -2 lines).
Hunk #14 succeeded at 828 (offset -2 lines).
4 out of 14 hunks FAILED
checking file drivers/usb/phy/phy-gpio-vbus-usb.c
checking file drivers/usb/phy/phy-mv-usb.c
checking file drivers/usb/phy/phy-tahvo.c
Hunk #1 FAILED at 87.
Hunk #2 FAILED at 105.
2 out of 2 hunks FAILED

cheers

--
balbi


Attachments:
(No filename) (2.52 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-11-24 16:15:59

by Sumit Semwal

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

On 24 November 2014 at 21:24, Felipe Balbi <[email protected]> wrote:
> On Mon, Nov 24, 2014 at 09:19:09PM +0530, Sumit Semwal wrote:
>> Hi Felipe,
>>
>> On 24 November 2014 at 20:08, Felipe Balbi <[email protected]> wrote:
>> > Hi,
>> >
>> > On Fri, Nov 21, 2014 at 09:13:00PM +0530, Kiran Raparthy wrote:
>> >> On 21 November 2014 20:41, Felipe Balbi <[email protected]> wrote:
>> >> > On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
>> >> >> usb: phy: Handle per-PHY event for connnect and disconnect events
>> >> >>
>> >> >> When usb is connected and enumerated in device mode or when usb is
>> >> >> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
>> >> >>
>> >> >> Cc: Felipe Balbi <[email protected]>
>> >> >> Cc: Greg Kroah-Hartman <[email protected]>
>> >> >> Cc: [email protected]
>> >> >> Cc: [email protected]
>> >> >> Cc: Android Kernel Team <[email protected]>
>> >> >> Cc: John Stultz <[email protected]>
>> >> >> Cc: Sumit Semwal <[email protected]>
>> >> >> Cc: Arve Hj�nnev�g <[email protected]>
>> >> >> Cc: Benoit Goby <[email protected]>
>> >> >> [Original patch in Android from Todd]
>> >> >> Cc: Todd Poynor <[email protected]>
>> >> >> Signed-off-by: Kiran Raparthy <[email protected]>
>> >> >
>> >> > this patch doesn't apply, please rebase entire series on my testing/next.
>> >
>> > your rebased version didn't apply either. Can you make sure you're
>> > rebasing on top of my today's testing/next branch ?
>> >
>> I just verified that I am able to apply both this patch (and the next
>> one - so 2/3 and 3/3) on your testing/next branch - just to make sure,
>> this is the git/branch right?
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
>> branch:testing/next
>
> that's the correct branch, but here's what I get:

That's very odd - I pulled your branch for the first time about 5
minutes before I sent the mail? perhaps local branch updates?
>
> checking file drivers/usb/phy/phy-ab8500-usb.c
> Hunk #1 FAILED at 447.
> Hunk #2 succeeded at 459 (offset -2 lines).
> Hunk #3 succeeded at 502 (offset -2 lines).
> Hunk #4 succeeded at 527 (offset -2 lines).
> Hunk #5 FAILED at 589.
> Hunk #6 succeeded at 600 (offset -2 lines).
> Hunk #7 succeeded at 629 (offset -2 lines).
> Hunk #8 succeeded at 652 (offset -2 lines).
> Hunk #9 FAILED at 701.
> Hunk #10 succeeded at 712 (offset -2 lines).
> Hunk #11 succeeded at 740 (offset -2 lines).
> Hunk #12 FAILED at 786.
> Hunk #13 succeeded at 801 (offset -2 lines).
> Hunk #14 succeeded at 828 (offset -2 lines).
> 4 out of 14 hunks FAILED
> checking file drivers/usb/phy/phy-gpio-vbus-usb.c
> checking file drivers/usb/phy/phy-mv-usb.c
> checking file drivers/usb/phy/phy-tahvo.c
> Hunk #1 FAILED at 87.
> Hunk #2 FAILED at 105.
> 2 out of 2 hunks FAILED
>
> cheers
>
> --
> balbi


Best,
Sumit.

2014-11-24 16:21:36

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH v1 2/3] usb: phy: Handle per-PHY event for connect and disconnect events

Hi,

On Mon, Nov 24, 2014 at 09:45:35PM +0530, Sumit Semwal wrote:
> On 24 November 2014 at 21:24, Felipe Balbi <[email protected]> wrote:
> > On Mon, Nov 24, 2014 at 09:19:09PM +0530, Sumit Semwal wrote:
> >> Hi Felipe,
> >>
> >> On 24 November 2014 at 20:08, Felipe Balbi <[email protected]> wrote:
> >> > Hi,
> >> >
> >> > On Fri, Nov 21, 2014 at 09:13:00PM +0530, Kiran Raparthy wrote:
> >> >> On 21 November 2014 20:41, Felipe Balbi <[email protected]> wrote:
> >> >> > On Fri, Nov 21, 2014 at 11:31:21AM +0530, Kiran Raparthy wrote:
> >> >> >> usb: phy: Handle per-PHY event for connnect and disconnect events
> >> >> >>
> >> >> >> When usb is connected and enumerated in device mode or when usb is
> >> >> >> disconnected,call usb_phy_set_event from phy drivers to handle per-PHY event.
> >> >> >>
> >> >> >> Cc: Felipe Balbi <[email protected]>
> >> >> >> Cc: Greg Kroah-Hartman <[email protected]>
> >> >> >> Cc: [email protected]
> >> >> >> Cc: [email protected]
> >> >> >> Cc: Android Kernel Team <[email protected]>
> >> >> >> Cc: John Stultz <[email protected]>
> >> >> >> Cc: Sumit Semwal <[email protected]>
> >> >> >> Cc: Arve Hj�nnev�g <[email protected]>
> >> >> >> Cc: Benoit Goby <[email protected]>
> >> >> >> [Original patch in Android from Todd]
> >> >> >> Cc: Todd Poynor <[email protected]>
> >> >> >> Signed-off-by: Kiran Raparthy <[email protected]>
> >> >> >
> >> >> > this patch doesn't apply, please rebase entire series on my testing/next.
> >> >
> >> > your rebased version didn't apply either. Can you make sure you're
> >> > rebasing on top of my today's testing/next branch ?
> >> >
> >> I just verified that I am able to apply both this patch (and the next
> >> one - so 2/3 and 3/3) on your testing/next branch - just to make sure,
> >> this is the git/branch right?
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
> >> branch:testing/next
> >
> > that's the correct branch, but here's what I get:
>
> That's very odd - I pulled your branch for the first time about 5
> minutes before I sent the mail? perhaps local branch updates?


$ git show
commit c9d655dccea0cb6df20ba5b39294a24be045ea4f
Author: Fabio Estevam <[email protected]>
Date: Wed Nov 19 12:37:53 2014 -0200

usb: dwc2: Fix build warning when CONFIG_PM_SLEEP=n

Building with bcm2835_defconfig, which has CONFIG_PM_SLEEP=n causes the
following build warning:

drivers/usb/dwc2/platform.c:227:12: warning: 'dwc2_suspend' defined but not used [-Wunused-function]
drivers/usb/dwc2/platform.c:237:12: warning: 'dwc2_resume' defined but not used [-Wunused-function]

Annotate these functions with '__maybe_unused' to prevent the warnings.

Reported-by: Olof's autobuilder <[email protected]>
Signed-off-by: Fabio Estevam <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index ec5658a..6a795aa 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -226,7 +226,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
return retval;
}

-static int dwc2_suspend(struct device *dev)
+static int __maybe_unused dwc2_suspend(struct device *dev)
{
struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
int ret = 0;
@@ -236,7 +236,7 @@ static int dwc2_suspend(struct device *dev)
return ret;
}

-static int dwc2_resume(struct device *dev)
+static int __maybe_unused dwc2_resume(struct device *dev)
{
struct dwc2_hsotg *dwc2 = dev_get_drvdata(dev);
int ret = 0;

that's the head of my branch, which is testing/next. And I don't have
anything in my index:

$ git diff
$ echo $?
0


--
balbi


Attachments:
(No filename) (3.65 kB)
signature.asc (819.00 B)
Digital signature
Download all attachments