Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd812cfe authored by Vijay Viswanath's avatar Vijay Viswanath
Browse files

mmc: block: Error handling for WP violation in cmdq



When CQ encounters Write Protect(WP) violation, the current code resets
the card and requeue all requests. But the request which caused the error
should not be requeued as it will again cause same error and this leads to
infinite loop. So the specific request shouldn't be requeued and the
block layer informed of its failure. So added two new functions:

1)cmdq_err_check which can be used by higher layers to check if a CQ RED
error occurred.
2)cmdq_err_handle which will do error handling for CQ related errors. As
of now it handles only WP violation errors.

WP violation can be detected in following cases :
1) When a Write task being executed caused a WP violation and a command
sent in cmd line detects the error before Host Controller (HC) completes
the Write task.
2) When CMD45 of a task causes WP violation, it still gets an ok
response from card and Device Pending register sets the bit
corresponding to the task. Whichever command sent next( CMD44/46/47 and
not CMD45) will get a response error. Since we cannot always find which
task had sent the last CMD45, fail all tasks in Device Pending register.
3) If a Write task causes WP violation in card and if no commands other
than SQS commands are sent since violation occurred, the HC will
consider that write task as completed and raise completion notification.
Whichever command sent next will get response error. So fail all tasks
which are in CQ Completion Notification register. This case will not
happend if a write task is in execution while we get RED error.
4) An erase command tried to erase a WP area. In this case, remove the
DCMD command.

Change-Id: I6efaf22605081a23b7acf6baf127dff69b3be27b
Signed-off-by: default avatarVijay Viswanath <vviswana@codeaurora.org>
parent 6943048a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment