mmc: cmdq_hci: Add cyclic buffer to keep history of last 32 tasks

Keep track of task history for the last 32 tasks and dump it
along with registers in case of any error for debugging.

The log is of the following format:
[index] <DATA|DCMD> Task: <lower 32bits> | Args: <upper 32bits>
of the task descriptor structure. The values need to be decoded
accordingly depending on the data or dcmd task descriptor.
The last entry index denotes the latest entry in this list.

---- Circular Task History ----
cmdq-host: Last entry index: 1
cmdq-host: [00]DATA Task: 0x0400002f | Args: 0x00d37d18
cmdq-host: [01]DATA Task: 0x0400002f | Args: 0x00d38118
cmdq-host: [02]DCMD Task: 0x0186402f | Args: 0x03200101

Add a debugfs entry to enable/disable this dynamically. It is
disabled by default. This applies only to eMMC devices.

Usage: echo Y > /sys/kernel/debug/mmcX/cmdq_task_history
X - denotes the slot id

Change-Id: I6abf29aa928d3d8270405cfc104241043dadfe45
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed compilation error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
4 files changed