On Thu, 19 Jul 2001, Cameron, Steve wrote:

...
> Or, is this just normal behavior for linux for now? That is, one
> cannot expect to be able to safely rmmod a low-level scsi driver
> in 100% of the attempts?
>
I don't think what you see is normal. The high level SCSI drivers
increment the module use count of the host driver they are using when the
device is opened and decrease the count when it is closed. This means that
you should not be able to rmmod the host adapter driver while a device
using it is opened by some process.

The st driver uses the following code in st_open()

        if (STp->device->host->hostt->module)
                __MOD_INC_USE_COUNT(STp->device->host->hostt->module);

(Similar code is used to decrement the use count. The sd, sr, and sg
drivers use similar constructs.)

I tested this with my system (a tape drive attached to aic7850). lsmod
shows that the use counts is zero when the drive is idle:

Module                  Size  Used by
st                     40448   0
aic7xxx               101600   0

When the tape drive is opened, the use counts are incremented:

Module                  Size  Used by
st                     40448   1
aic7xxx               101600   1

I tried to rmmod the aic7xxx driver when in use but this failed as
expected.

Is there something in your combined driver that causes it to ignore the
non-zero module count in the SCSI driver "instance"?

        Kai



-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to