Commit 27b9e257 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: interface: do not read DME during reactivation

It will soon be possible to reactivate an interface that has been
powered down after already having been activated. In that case there's
no need to re-read the DME attributes as part of activation as the
values are already cached.
Reviewed-by: default avatarSandeep Patil <sspatil@google.com>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarPatrick Titiano <ptitiano@baylibre.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent a212b758
...@@ -95,6 +95,10 @@ static int gb_interface_read_dme(struct gb_interface *intf) ...@@ -95,6 +95,10 @@ static int gb_interface_read_dme(struct gb_interface *intf)
{ {
int ret; int ret;
/* DME attributes have already been read */
if (intf->dme_read)
return 0;
ret = gb_interface_dme_attr_get(intf, DME_DDBL1_MANUFACTURERID, ret = gb_interface_dme_attr_get(intf, DME_DDBL1_MANUFACTURERID,
&intf->ddbl1_manufacturer_id); &intf->ddbl1_manufacturer_id);
if (ret) if (ret)
...@@ -111,7 +115,13 @@ static int gb_interface_read_dme(struct gb_interface *intf) ...@@ -111,7 +115,13 @@ static int gb_interface_read_dme(struct gb_interface *intf)
intf->quirks |= GB_INTERFACE_QUIRK_NO_INIT_STATUS; intf->quirks |= GB_INTERFACE_QUIRK_NO_INIT_STATUS;
} }
return gb_interface_read_ara_dme(intf); ret = gb_interface_read_ara_dme(intf);
if (ret)
return ret;
intf->dme_read = true;
return 0;
} }
static int gb_interface_route_create(struct gb_interface *intf) static int gb_interface_route_create(struct gb_interface *intf)
......
...@@ -56,6 +56,7 @@ struct gb_interface { ...@@ -56,6 +56,7 @@ struct gb_interface {
bool active; bool active;
bool enabled; bool enabled;
bool mode_switch; bool mode_switch;
bool dme_read;
struct work_struct mode_switch_work; struct work_struct mode_switch_work;
struct completion mode_switch_completion; struct completion mode_switch_completion;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment