Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jan 2012 20:41:38 +0530
From:      "Desai, Kashyap" <Kashyap.Desai@lsi.com>
To:        "scsi@freebsd.org" <scsi@freebsd.org>, "Kenneth D. Merry" <ken@FreeBSD.org>
Cc:        "gibbs@FreeBSD.org" <gibbs@FreeBSD.org>, "McConnell, Stephen" <Stephen.McConnell@lsi.com>
Subject:   kldunload hangs on FreeBSD with camcontrol debug on
Message-ID:  <B2FD678A64EAAD45B089B123FDFC3ED7299CF90945@inbmail01.lsi.com>

next in thread | raw e-mail | index | archive | help

While doing some sanity test on "mps" driver, I found kldunload hangs in be=
low condition.

Case-1
1. Connect LSI 2008 controller(any SAS2 card). Load there mps driver and de=
tect the controller.
2. unload driver/load driver in loop. There will not be any problem.

Case-2=20
Run above Case-1 with below settings.
"camcontorl debug -IT <bus>"

A moment I enable CAM debug level -I and -T, kldunload always hangs on "sim=
->refcount"

Here is relavent output for reference.

Jan  5 06:42:08 dhcp-135-24-192-146 kernel: mpslsi30: mps_detach_sas:754 re=
f count 2
Jan  5 06:42:08 dhcp-135-24-192-146 kernel: mpslsi30: path ID 6
Jan  5 06:42:08 dhcp-135-24-192-146 kernel: (noperiph:mpslsi30:0:-1:-1): xp=
t_compile_path
Jan  5 06:42:08 dhcp-135-24-192-146 kernel: (noperiph:mpslsi30:0:-1:-1): xp=
t_async
Jan  5 06:42:08 dhcp-135-24-192-146 kernel: (noperiph:mpslsi30:0:-1:-1): xp=
t_async
Jan  5 06:42:08 dhcp-135-24-192-146 kernel: (noperiph:mpslsi30:0:-1:-1): xp=
t_release_path
Jan  5 06:42:08 dhcp-135-24-192-146 kernel: mpslsi30: mps_detach_sas:757 re=
f count 2


I have added few prints in detach routine (mps_detach_sas) as below.

    if (sassc->sim !=3D NULL) {
        mps_dprint(sc, MPS_INFO, "%s:%d ref count %d\n", __func__,__LINE__,=
sassc->sim->refcount);
        mps_dprint(sc, MPS_INFO, "path ID %d\n",cam_sim_path(sassc->sim));
        xpt_bus_deregister(cam_sim_path(sassc->sim));
        mps_dprint(sc, MPS_INFO, "%s:%d ref count %d\n", __func__,__LINE__,=
sassc->sim->refcount);
        cam_sim_free(sassc->sim, FALSE);
    }


Before entering into " xpt_bus_deregister" sim->refcount is 2 and which nev=
er goes to 0. And eventually Driver unloading hangs at
Cam_sim_free() at below location....

error =3D msleep(sim, sim->mtx, PRIBIO, "simfree", 0);


Any idea about this issue ?


Regards, Kashyap



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