platform/surface: aggregator: Add control packet allocation caching
authorMaximilian Luz <luzmaximilian@gmail.com>
Mon, 21 Dec 2020 18:39:52 +0000 (19:39 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 6 Jan 2021 22:45:33 +0000 (23:45 +0100)
commit44b84ee7b437dd7f869341b4b671963161a34a9f
tree7faf78c2795d9c3e42590430a93b9fa345e9d407
parentc167b9c7e3d6131b4a4865c112a3dbc86d2e997d
platform/surface: aggregator: Add control packet allocation caching

Surface Serial Hub communication is, in its core, packet based. Each
sequenced packet requires to be acknowledged, via an ACK-type control
packet. In case invalid data has been received by the driver, a NAK-type
(not-acknowledge/negative acknowledge) control packet is sent,
triggering retransmission.

Control packets are therefore a core communication primitive and used
frequently enough (with every sequenced packet transmission sent by the
embedded controller, including events and request responses) that it may
warrant caching their allocations to reduce possible memory
fragmentation.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201221183959.1186143-3-luzmaximilian@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/aggregator/core.c
drivers/platform/surface/aggregator/ssh_packet_layer.c
drivers/platform/surface/aggregator/ssh_packet_layer.h