Bug 16450 - MTD drivers cannot be unloaded
Summary: MTD drivers cannot be unloaded
Status: CLOSED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: Flash/Memory Technology Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: David Woodhouse
URL:
Keywords:
Depends on:
Blocks: 16055
  Show dependency tree
 
Reported: 2010-07-24 00:17 UTC by Ben Hutchings
Modified: 2020-10-22 08:57 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.35-rc5
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description Ben Hutchings 2010-07-24 00:17:16 UTC
commit 048d87199566663e4edc4880df3703c04bcf41d9 "mtd: blktrans: Hotplug
fixes" causes the MTD and the MTD driver module's ref-counts to be
bumped for each block device that is created, whether or not it's
actually in use.

This means that before removing an MTD or driver module one must first
remove all the associated block devices.  But the block devices will
be removed only when the MTDs themselves are removed, which is no
longer possible.

I have submitted a fix for this: http://article.gmane.org/gmane.linux.drivers.mtd/30834
Comment 1 Andrew Morton 2010-07-24 01:53:05 UTC
Maxim, 048d87199566663e4edc4880df3703c04bcf41d9 was yours..
Comment 2 Maxim Levitsky 2010-07-24 13:15:13 UTC
Yes, I am aware of this problem.

It has to be done that way, because otherwise I had an impossible to solve deadlock.

The blktrans_open() doesn't use locks on purpose, this is a part of the fix of the deadlock.

I explain that better tommorow, when I finish last exam.
Comment 3 Ben Hutchings 2010-08-01 16:40:05 UTC
The parent devices of the MTDs can still be removed, and once that has been done it is possible to remove a MTD driver module. So although there is a regression here it is not as serious as I thought.

Note You need to log in before you can comment on or make changes to this bug.