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

greybus: connection: add support for high-priority connections

Add connection flag to indicate that a connection has high priority.

For the SVC and control connections this may be used by the host-device
driver as a hint to allocate dedicated DMA channels or to use polling to
avoid message congestion.

We also allow drivers to set this flag on their connections, even though
we currently have no use case for this (and the host-device driver is
again free to ignore it).

Note that this mechanism can be used to indicate also high-bandwidth
connections (e.g. wanting larger buffers or dedicated endpoints), but
that that should be done using a separate high-bandwidth flag rather
than overloading the high-priority flag.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
3094f947 1ba30c33

+4 -2
+3 -2
drivers/staging/greybus/connection.c
··· 232 232 gb_request_handler_t handler) 233 233 { 234 234 return _gb_connection_create(hd, hd_cport_id, NULL, NULL, 0, handler, 235 - 0); 235 + GB_CONNECTION_FLAG_HIGH_PRIO); 236 236 } 237 237 238 238 struct gb_connection * 239 239 gb_connection_create_control(struct gb_interface *intf) 240 240 { 241 241 return _gb_connection_create(intf->hd, -1, intf, NULL, 0, NULL, 242 - GB_CONNECTION_FLAG_CONTROL); 242 + GB_CONNECTION_FLAG_CONTROL | 243 + GB_CONNECTION_FLAG_HIGH_PRIO); 243 244 } 244 245 245 246 struct gb_connection *
+1
drivers/staging/greybus/connection.h
··· 18 18 #define GB_CONNECTION_FLAG_OFFLOADED BIT(2) 19 19 #define GB_CONNECTION_FLAG_CDSI1 BIT(3) 20 20 #define GB_CONNECTION_FLAG_CONTROL BIT(4) 21 + #define GB_CONNECTION_FLAG_HIGH_PRIO BIT(5) 21 22 22 23 #define GB_CONNECTION_FLAG_CORE_MASK GB_CONNECTION_FLAG_CONTROL 23 24