Files
android_kernel_xiaomi_sm8450/include/linux
Sascha Hauer 8385d756e1 libata: Fix retrieving of active qcs
ata_qc_complete_multiple() is called with a mask of the still active
tags.

mv_sata doesn't have this information directly and instead calculates
the still active tags from the started tags (ap->qc_active) and the
finished tags as (ap->qc_active ^ done_mask)

Since 28361c4036 the hw_tag and tag are no longer the same and the
equation is no longer valid. In ata_exec_internal_sg() ap->qc_active is
initialized as 1ULL << ATA_TAG_INTERNAL, but in hardware tag 0 is
started and this will be in done_mask on completion. ap->qc_active ^
done_mask becomes 0x100000000 ^ 0x1 = 0x100000001 and thus tag 0 used as
the internal tag will never be reported as completed.

This is fixed by introducing ata_qc_get_active() which returns the
active hardware tags and calling it where appropriate.

This is tested on mv_sata, but sata_fsl and sata_nv suffer from the same
problem. There is another case in sata_nv that most likely needs fixing
as well, but this looks a little different, so I wasn't confident enough
to change that.

Fixes: 28361c4036 ("libata: add extra internal command")
Cc: stable@vger.kernel.org
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Add missing export of ata_qc_get_active(), as per Pali.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-25 17:08:33 -07:00
..
2019-08-09 09:15:05 +02:00
2019-09-16 09:56:27 -07:00
2019-05-31 11:13:10 +02:00
2019-11-12 11:43:29 -05:00
2019-10-31 16:54:00 +05:30
2019-08-20 22:09:52 +02:00
2019-05-14 19:52:50 -07:00
2019-07-01 08:18:54 -06:00
2019-11-15 23:44:48 +01:00
2019-12-03 07:36:38 -07:00
2019-06-12 20:27:13 +02:00
2019-11-26 10:26:26 +01:00
2019-10-09 19:33:43 -07:00
2019-12-03 11:20:37 +01:00
2019-12-08 12:42:19 +01:00
2019-09-05 19:52:33 -06:00
2019-02-28 03:28:53 -05:00
2019-02-28 08:24:23 -07:00
2019-12-09 10:36:44 -08:00
2018-12-19 10:42:08 +01:00
2019-11-20 09:40:10 +01:00
2019-12-01 12:59:06 -08:00
2019-02-15 16:54:38 +01:00
2019-09-05 11:40:54 +02:00
2019-10-02 06:36:50 -07:00
2019-07-05 21:34:50 +02:00
2019-06-26 13:19:46 -07:00
2019-10-04 12:31:46 -07:00
2019-10-15 13:34:25 +02:00
2019-11-11 09:02:56 +01:00
2019-06-10 13:00:24 +02:00
2019-04-08 22:56:14 +02:00
2019-12-04 19:44:14 -08:00
2019-09-02 11:43:54 +01:00
2019-12-09 10:36:44 -08:00
2019-12-25 17:08:33 -07:00
2019-10-15 20:40:06 -07:00
2019-03-07 18:32:03 -08:00
2019-09-05 12:32:05 +02:00
2019-08-14 15:30:35 +02:00
2019-08-08 09:09:25 +02:00
2019-11-15 13:49:04 -05:00
2019-11-14 19:06:47 -08:00
2019-07-08 19:25:19 -07:00
2019-11-06 08:55:23 -05:00
2019-10-09 12:06:19 -04:00
2019-11-06 08:55:23 -05:00
2019-06-13 09:02:33 -04:00
2019-02-20 07:22:10 -07:00
2018-12-06 15:45:46 +01:00
2019-02-08 15:02:49 -08:00
2019-07-26 17:01:29 -06:00
2019-11-13 19:09:47 +08:00
2019-07-16 19:23:25 -07:00
2019-12-06 10:47:28 +01:00
2019-06-15 12:25:49 +02:00
2019-05-14 19:52:48 -07:00
2019-08-23 16:39:26 +01:00
2019-10-19 22:55:46 +02:00
2019-11-14 13:07:48 +08:00
2019-12-04 19:44:14 -08:00
2019-10-10 14:55:24 -07:00
2019-05-16 15:51:55 -07:00
2019-12-01 06:29:17 -08:00
2019-11-13 12:15:34 -08:00
2019-02-07 16:38:35 +01:00
2019-12-12 19:00:36 +01:00
2019-11-13 00:33:21 +11:00
2019-11-07 07:00:26 +01:00
2019-08-30 07:27:17 -07:00
2019-08-01 20:51:22 +02:00
2019-08-20 17:05:05 +02:00
2019-07-31 19:03:35 +02:00
2018-12-10 10:17:45 +01:00
2019-01-11 18:05:40 -08:00
2019-11-14 12:20:02 +08:00
2019-05-15 17:35:54 +01:00
2018-12-22 12:15:29 +01:00
2019-10-14 15:04:01 -07:00