Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

greybus: control: suppress bundle_activate() for bootrom

We always knew backward compatibility with the ES3 bootrom, which was
finalised about a year ago, would be a pain. Here we go again.

The bootrom does not support control requests added after it was burnt
into ROM for obvious reasons. This means that we need to suppress
sending the new bundle_activate() operation to any interface executing
the legacy bootrom.

Do so by adding a new NO_PM interface quirk (we can use the
control-protocol version for this later once we bump it).

Note that the interface-disable path (e.g. for power down) is already
handled by the FORCED_DISABLE quirk, and that the suspend/resume
paths are currently avoided by making sure that the bootrom bundle
never suspends.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
2358024b 350e3ac2

+11 -1
+7
drivers/staging/greybus/control.c
··· 329 329 struct gb_control_bundle_pm_response response; 330 330 int ret; 331 331 332 + if (!control->has_bundle_activate) 333 + return 0; 334 + 332 335 request.bundle_id = bundle_id; 333 336 ret = gb_operation_sync(control->connection, 334 337 GB_CONTROL_TYPE_BUNDLE_ACTIVATE, &request, ··· 530 527 531 528 if (control->protocol_major > 0 || control->protocol_minor > 1) 532 529 control->has_bundle_version = true; 530 + 531 + /* FIXME: use protocol version instead */ 532 + if (!(control->intf->quirks & GB_INTERFACE_QUIRK_NO_PM)) 533 + control->has_bundle_activate = true; 533 534 534 535 return 0; 535 536
+1
drivers/staging/greybus/control.h
··· 19 19 u8 protocol_major; 20 20 u8 protocol_minor; 21 21 22 + bool has_bundle_activate; 22 23 bool has_bundle_version; 23 24 24 25 char *vendor_string;
+2 -1
drivers/staging/greybus/interface.c
··· 411 411 */ 412 412 bootrom_quirks = GB_INTERFACE_QUIRK_NO_CPORT_FEATURES | 413 413 GB_INTERFACE_QUIRK_FORCED_DISABLE | 414 - GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH; 414 + GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH | 415 + GB_INTERFACE_QUIRK_NO_PM; 415 416 switch (init_status) { 416 417 case GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED: 417 418 case GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED:
+1
drivers/staging/greybus/interface.h
··· 23 23 #define GB_INTERFACE_QUIRK_NO_ARA_IDS BIT(2) 24 24 #define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3) 25 25 #define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4) 26 + #define GB_INTERFACE_QUIRK_NO_PM BIT(5) 26 27 27 28 struct gb_interface { 28 29 struct device dev;