OSDN Git Service

mmc: card: Service RPMB requests with priority over other requests
authorVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Mon, 9 Oct 2017 17:19:49 +0000 (22:49 +0530)
committerVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Mon, 16 Apr 2018 14:58:51 +0000 (20:28 +0530)
commitd3643ee7ff29a469859977d70a13ca641e52c323
tree032357da337c9fd4b7d759e3537a7eb20fe86cf0
parent1920040bec3e84b49b2f7a8435f9c5227ee8c9e3
mmc: card: Service RPMB requests with priority over other requests

RPMB requests are initiated from TZ and TZ gets blocked from servicing
other tasks/requests till it completes RPMB request. Delays in
servicing RPMB request may result in system-level stability/performance
issues.

Below is the issue observed:
1. TZ rpmb API is called to update TA rollback information. TZ forwards
   the request to HLOS mmc driver via rpmb-service.
2. mmc driver services the rpmb requests only after finishing the
   outstanding IO requests.
3. As part of handling an IO requests, mmc driver makes ICE call
   for getting encryption keys, which in-turn makes call to TZ.
4. Since ICE driver finds TZ is busy/blocked it returns ice request
   with -EBUSY error.
5. The failed requests with -EBUSY error would re-queued back.
6. The IO requests keep getting failed and keep getting re-queued
   and mmc driver never gets a chance to service rpmb requests.
7. This results in a deadlock senario.

So RPMB requests need to be serviced immediately.
If there is any outstanding RPMB request, then mmc driver should stop
pulling any more new requests. The moment its done with serving
ongoing requests, It should start processing RPMB request.

Change-Id: I2d0f98a11716ef946551cc1a967e70a38e91d6ac
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
drivers/mmc/card/block.c
drivers/mmc/card/queue.c
drivers/mmc/core/host.c
include/linux/mmc/host.h