greybus: interface: make sure type is invariant during reactivation
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 20 Jul 2016 14:40:23 +0000 (16:40 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 20 Jul 2016 17:16:54 +0000 (10:16 -0700)
commit62491622db9c9b6a51630f4c8c653f59c2c834f9
tree2b6c0ac80f4922f44036450a177a325e56957d99
parent3e93cb6abbc023aebf311618481263e000bf26fb
greybus: interface: make sure type is invariant during reactivation

An interface is not expected to change its type after a power down and
reactivation so make sure to treat that as a fatal error.

This is complicated by the current Toshiba ES3 hack which requires us
to retry activation as Greybus interfaces are sometimes misdetected as
UniPro interfaces. Handle that by only retrying activation the first
time an interface is activated, and for interfaces already detected as
having Greybus type.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Sandeep Patil <sspatil@google.com>
Reviewed-by: Patrick Titiano <ptitiano@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/interface.c