Marc Gonzalez
eba68bd456
scsi: ufs: Use explicit access size in ufshcd_dump_regs
commit d672475664 upstream.
memcpy_fromio() doesn't provide any control over access size. For example,
on arm64, it is implemented using readb and readq. This may trigger a
synchronous external abort:
[ 3.729943] Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP
[ 3.737000] Modules linked in:
[ 3.744371] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G S 4.20.0-rc4 #16
[ 3.747413] Hardware name: Qualcomm Technologies, Inc. MSM8998 v1 MTP (DT)
[ 3.755295] pstate: 00000005 (nzcv daif -PAN -UAO)
[ 3.761978] pc : __memcpy_fromio+0x68/0x80
[ 3.766718] lr : ufshcd_dump_regs+0x50/0xb0
[ 3.770767] sp : ffff00000807ba00
[ 3.774830] x29: ffff00000807ba00 x28: 00000000fffffffb
[ 3.778344] x27: ffff0000089db068 x26: ffff8000f6e58000
[ 3.783728] x25: 000000000000000e x24: 0000000000000800
[ 3.789023] x23: ffff8000f6e587c8 x22: 0000000000000800
[ 3.794319] x21: ffff000008908368 x20: ffff8000f6e1ab80
[ 3.799615] x19: 000000000000006c x18: ffffffffffffffff
[ 3.804910] x17: 0000000000000000 x16: 0000000000000000
[ 3.810206] x15: ffff000009199648 x14: ffff000089244187
[ 3.815502] x13: ffff000009244195 x12: ffff0000091ab000
[ 3.820797] x11: 0000000005f5e0ff x10: ffff0000091998a0
[ 3.826093] x9 : 0000000000000000 x8 : ffff8000f6e1ac00
[ 3.831389] x7 : 0000000000000000 x6 : 0000000000000068
[ 3.836676] x5 : ffff8000f6e1abe8 x4 : 0000000000000000
[ 3.841971] x3 : ffff00000928c868 x2 : ffff8000f6e1abec
[ 3.847267] x1 : ffff00000928c868 x0 : ffff8000f6e1abe8
[ 3.852567] Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____))
[ 3.857900] Call trace:
[ 3.864473] __memcpy_fromio+0x68/0x80
[ 3.866683] ufs_qcom_dump_dbg_regs+0x1c0/0x370
[ 3.870522] ufshcd_print_host_regs+0x168/0x190
[ 3.874946] ufshcd_init+0xd4c/0xde0
[ 3.879459] ufshcd_pltfrm_init+0x3c8/0x550
[ 3.883264] ufs_qcom_probe+0x24/0x60
[ 3.887188] platform_drv_probe+0x50/0xa0
Assuming aligned 32-bit registers, let's use readl, after making sure
that 'offset' and 'len' are indeed multiples of 4.
Fixes: ba80917d99 ("scsi: ufs: ufshcd_dump_regs to use memcpy_fromio")
Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-31 08:14:38 +01:00
..
2018-08-27 13:17:00 -04:00
2018-06-14 16:35:32 +09:00
2018-08-08 21:17:56 -04:00
2018-07-12 22:34:59 -04:00
2018-06-12 16:19:22 -07:00
2018-06-19 22:02:25 -04:00
2018-07-10 22:42:47 -04:00
2019-01-13 09:50:58 +01:00
2018-06-19 22:02:25 -04:00
2018-08-27 12:26:10 -04:00
2018-04-09 21:32:45 -04:00
2018-08-15 22:06:26 -07:00
2018-04-03 17:38:39 -07:00
2018-06-12 16:19:22 -07:00
2018-08-15 22:06:26 -07:00
2018-06-12 16:19:22 -07:00
2018-12-01 09:37:31 +01:00
2018-07-30 23:17:53 -04:00
2018-09-17 02:50:37 -04:00
2018-06-12 16:19:22 -07:00
2018-08-15 22:06:26 -07:00
2018-06-26 12:53:26 -04:00
2019-01-13 09:51:03 +01:00
2019-01-26 09:32:43 +01:00
2019-01-26 09:32:42 +01:00
2018-03-01 21:07:48 -05:00
2018-08-21 23:54:17 -04:00
2018-03-19 22:54:47 -04:00
2018-06-12 16:19:22 -07:00
2018-07-10 22:25:23 -04:00
2019-01-26 09:32:36 +01:00
2019-01-13 09:50:58 +01:00
2018-06-12 16:19:22 -07:00
2019-01-26 09:32:43 +01:00
2018-07-12 23:01:16 -04:00
2018-08-02 16:23:26 -04:00
2019-01-31 08:14:38 +01:00
2018-07-30 23:17:53 -04:00
2017-12-04 20:32:53 -05:00
2018-07-30 23:17:53 -04:00
2018-07-30 23:17:53 -04:00
2018-07-30 23:17:53 -04:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2018-06-12 16:19:22 -07:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-05-01 23:29:41 -04:00
2018-07-30 23:17:53 -04:00
2018-06-12 16:19:22 -07:00
2018-06-26 12:27:06 -04:00
2018-06-26 12:27:06 -04:00
2018-05-18 12:03:51 -04:00
2018-03-15 00:25:37 -04:00
2018-11-13 11:08:32 -08:00
2018-11-13 11:08:32 -08:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-08-27 13:17:00 -04:00
2018-08-27 12:26:10 -04:00
2018-07-10 22:25:03 -04:00
2018-06-26 12:27:07 -04:00
2018-09-21 12:35:39 -04:00
2018-09-21 12:35:39 -04:00
2018-04-20 19:40:17 -04:00
2018-04-20 19:40:17 -04:00
2018-04-19 00:00:44 -04:00
2018-03-12 22:05:43 -04:00
2018-08-27 12:26:10 -04:00
2018-06-19 22:02:25 -04:00
2018-12-21 14:15:13 +01:00
2018-06-12 16:19:22 -07:00
2018-11-13 11:08:32 -08:00
2018-08-15 22:06:26 -07:00
2018-06-19 22:02:25 -04:00
2018-06-19 22:02:25 -04:00
2018-06-26 12:27:07 -04:00
2018-03-19 22:54:47 -04:00
2018-06-10 13:01:12 -07:00
2018-07-10 22:42:47 -04:00
2018-06-19 22:02:25 -04:00
2018-06-12 16:19:22 -07:00
2018-06-12 16:19:22 -07:00
2018-02-13 21:49:15 -05:00
2017-12-04 20:32:52 -05:00
2018-06-26 12:53:26 -04:00
2018-12-19 19:19:49 +01:00
2017-12-11 21:39:39 -05:00
2018-08-15 22:06:26 -07:00
2018-04-20 19:14:28 -04:00
2018-04-20 19:14:36 -04:00
2018-04-18 19:34:08 -04:00
2018-08-15 22:06:26 -07:00
2018-06-26 12:27:06 -04:00
2018-11-21 09:19:18 +01:00
2019-01-22 21:40:32 +01:00
2017-12-07 21:13:45 -05:00
2018-06-26 12:27:06 -04:00
2018-08-02 15:53:36 -04:00
2018-08-15 22:06:26 -07:00
2018-05-29 13:00:25 -06:00
2018-06-10 13:01:12 -07:00
2018-06-26 12:27:06 -04:00
2018-06-04 07:58:06 -07:00
2018-06-26 12:53:26 -04:00
2018-06-19 22:02:25 -04:00
2018-07-30 08:27:02 -06:00
2018-08-15 22:06:26 -07:00
2019-01-22 21:40:32 +01:00
2018-07-30 08:27:02 -06:00
2018-06-12 16:19:22 -07:00
2018-08-15 22:06:26 -07:00
2018-08-02 15:22:13 -06:00
2018-08-03 13:53:51 -04:00
2018-08-08 21:15:54 -04:00
2018-07-03 13:02:28 +02:00
2018-03-12 22:05:43 -04:00
2018-07-26 15:49:43 -06:00
2018-12-21 14:15:13 +01:00
2018-05-01 23:30:12 -04:00
2018-06-19 14:54:41 +02:00
2018-04-19 00:00:44 -04:00