Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Oct 2021 02:33:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 259541] [smartpqi] panic: Segment size is not aligned, in a call to bus_dmamap_load_ccb() from smartpqi_cam_action.
Message-ID:  <bug-259541-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259541

            Bug ID: 259541
           Summary: [smartpqi] panic: Segment size is not aligned, in a
                    call to bus_dmamap_load_ccb() from
                    smartpqi_cam_action.
           Product: Base System
           Version: Unspecified
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: khng@freebsd.org

The following is a stack trace and ddb(4) show pcpu output:
----
db> show pcpu
cpuid        =3D 151
dynamic pcpu =3D 0xfffffe020877ca40
curthread    =3D 0xfffffe019120a1e0: pid 571 tid 106262 critnest 1 "fsck_ms=
dosfs"
curpcb       =3D 0xfffffe019120a6f0
fpcurthread  =3D 0xfffffe019120a1e0: pid 571 "fsck_msdosfs"
idlethread   =3D 0xfffffe01a0eb9900: tid 100154 "idle: cpu151"
self         =3D 0xffffffff82ea7000
curpmap      =3D 0xfffffe019120f518
tssp         =3D 0xffffffff82ea7384
rsp0         =3D 0xfffffe03dda97000
kcr3         =3D 0xffffffffffffffff
ucr3         =3D 0xffffffffffffffff
scr3         =3D 0x0
gs32p        =3D 0xffffffff82ea7404
ldt          =3D 0xffffffff82ea7444
tss          =3D 0xffffffff82ea7434
curvnet      =3D 0
spin locks held:
db> bt
Tracing pid 571 tid 106262 td 0xfffffe019120a1e0
kdb_enter() at kdb_enter+0x37/frame 0xfffffe03dda966d0
vpanic() at vpanic+0x1b8/frame 0xfffffe03dda96730
panic() at panic+0x43/frame 0xfffffe03dda96790
bounce_bus_dmamap_load_ma() at bounce_bus_dmamap_load_ma+0x3a9/frame
0xfffffe03dda96810
_bus_dmamap_load_bio() at _bus_dmamap_load_bio+0x113/frame 0xfffffe03dda968=
70
bus_dmamap_load_ccb() at bus_dmamap_load_ccb+0x92/frame 0xfffffe03dda968d0
smartpqi_cam_action() at smartpqi_cam_action+0xdb9/frame 0xfffffe03dda96940
xpt_run_devq() at xpt_run_devq+0x2f9/frame 0xfffffe03dda969a0
xpt_action_default() at xpt_action_default+0x471/frame 0xfffffe03dda969f0
dastart() at dastart+0x336/frame 0xfffffe03dda96a40
xpt_run_allocq() at xpt_run_allocq+0xb3/frame 0xfffffe03dda96a90
dastrategy() at dastrategy+0x6f/frame 0xfffffe03dda96ac0
g_disk_start() at g_disk_start+0x31c/frame 0xfffffe03dda96b30
g_io_request() at g_io_request+0x2d7/frame 0xfffffe03dda96b60
g_part_start() at g_part_start+0x289/frame 0xfffffe03dda96be0
g_io_request() at g_io_request+0x2d7/frame 0xfffffe03dda96c10
g_dev_strategy() at g_dev_strategy+0x155/frame 0xfffffe03dda96c40
physio() at physio+0x49b/frame 0xfffffe03dda96ce0
devfs_read_f() at devfs_read_f+0xe5/frame 0xfffffe03dda96d40
dofileread() at dofileread+0x81/frame 0xfffffe03dda96d90
sys_read() at sys_read+0xc0/frame 0xfffffe03dda96e00
amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe03dda96f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe03dda96f30
--- syscall (3, FreeBSD ELF64, sys_read), rip =3D 0x8011c4cca, rsp =3D
0x7fffffffdac8, rbp =3D 0x7fffffffdb00 ---
db>
----

I git-bisected and found the offending commits to be
9fac68fc3853b696c8479bb3a8181d62cb9f59c9 in main, and
1569aab1cb38a38fb619f343ed1e47d4b4070ffe in stable/13. The following change=
s in
the commits look suspicious in my eye:
----
@@ -313,27 +347,31 @@ smartpqi_attach(device_t dev)
...
-
-        /*
-         * Create DMA tag for mapping buffers into controller-addressable
space.
-         */
-        if (bus_dma_tag_create(softs->os_specific.pqi_parent_dmat,/* paren=
t */
-                               1, 0,                   /* algnmnt, boundar=
y */
+    /*
+     * Create DMA tag for mapping buffers into controller-addressable spac=
e.
+     */
+    if (bus_dma_tag_create(softs->os_specific.pqi_parent_dmat,/* parent */
+                               PAGE_SIZE, 0,           /* algnmnt, boundar=
y */
                                BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
                                BUS_SPACE_MAXADDR,      /* highaddr */
                                NULL, NULL,             /* filter, filterar=
g */
-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20
softs->pqi_cap.max_sg_elem*PAGE_SIZE,/*maxsize*/
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20
(bus_size_t)softs->pqi_cap.max_sg_elem*PAGE_SIZE,/* maxsize */
                                softs->pqi_cap.max_sg_elem,     /* nsegment=
s */
                                BUS_SPACE_MAXSIZE_32BIT,        /* maxsegsi=
ze
*/
                                BUS_DMA_ALLOCNOW,               /* flags */
----

Reverting the change on algnmnt param worked around the issue.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259541-227>