2019-05-29 07:12:36 -07:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-27 12:01:03 +03:00
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2024-10-01 15:35:57 -04:00
|
|
|
|
2010-11-16 14:00:24 +09:00
|
|
|
|
2011-01-06 18:04:02 +09:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2023-05-19 15:32:30 -04:00
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2010-02-15 06:45:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2023-07-15 20:51:47 +02:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
2011-07-10 00:30:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
2017-08-21 16:49:57 +02:00
|
|
|
|
2011-07-10 00:30:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2020-04-22 15:18:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-03 12:57:37 -08:00
|
|
|
|
2010-02-15 06:46:35 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:48 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:45:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:45:43 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:48 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:48 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:48 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-08 02:02:47 +03:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2010-09-05 18:29:56 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-29 12:08:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-27 14:15:58 +01:00
|
|
|
|
|
|
|
|
|
2013-04-18 08:39:47 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 18:29:56 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:47:08 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2009-06-03 14:47:08 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-07 14:50:56 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 07:00:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 18:29:56 -07:00
|
|
|
|
2010-04-03 07:00:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 18:29:56 -07:00
|
|
|
|
2010-04-03 07:00:37 +02:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2013-05-10 17:16:48 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2018-03-12 17:06:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 18:29:56 -07:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-29 12:08:33 +02:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2022-04-29 12:08:31 +02:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-29 12:08:33 +02:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2022-04-29 12:08:34 +02:00
|
|
|
|
|
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2018-07-25 15:41:54 +02:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2017-11-09 18:09:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:21 -08:00
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
2011-03-30 22:57:33 -03:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:47:08 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:15 -07:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-29 12:08:33 +02:00
|
|
|
|
2010-09-05 18:28:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
|
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
|
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 14:24:44 +02:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2020-12-15 14:30:22 +08:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:55 +02:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2018-07-25 15:41:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2018-07-25 15:41:55 +02:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-28 14:24:44 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2018-07-25 15:41:55 +02:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:10 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2009-06-03 14:47:08 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
2010-09-05 16:35:10 -07:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:10 -07:00
|
|
|
|
2009-06-10 23:02:19 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2011-08-21 13:34:11 -07:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-08-28 15:14:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 13:22:36 +05:30
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2023-08-28 15:14:18 +02:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
2023-08-28 15:14:18 +02:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:26 -08:00
|
|
|
|
2010-02-15 06:46:04 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
2026-02-21 20:03:00 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2023-04-28 14:24:44 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2013-09-25 16:59:49 +05:30
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2018-03-28 16:34:27 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2023-04-28 14:24:44 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2023-04-28 14:24:44 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
2023-04-28 14:24:44 +02:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:17 -07:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
2018-03-28 16:34:27 +02:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2011-01-06 18:04:02 +09:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2011-01-06 18:04:02 +09:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-06 18:04:02 +09:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-23 13:16:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2021-11-04 11:52:29 +00:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2021-11-04 11:52:29 +00:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2021-11-04 11:52:29 +00:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2021-11-04 11:52:29 +00:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
2024-12-15 15:55:17 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2020-08-26 22:54:05 +02:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
|
|
|
|
|
2024-12-15 15:55:17 +01:00
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
2020-08-26 22:54:05 +02:00
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2012-02-29 08:06:40 +01:00
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
|
|
|
|
|
2011-01-06 18:04:02 +09:00
|
|
|
|
2012-02-29 08:06:40 +01:00
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2012-02-29 08:06:40 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2012-02-29 08:06:40 +01:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-29 08:06:40 +01:00
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-18 19:56:40 +02:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
2010-09-05 16:35:31 -07:00
|
|
|
|
2011-01-06 18:04:02 +09:00
|
|
|
|
2025-05-30 05:54:37 +02:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-18 11:21:04 -08:00
|
|
|
|
2010-02-15 06:46:08 -08:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
|
|
|
|
|
2017-05-02 13:47:53 +02:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-19 23:11:51 +02:00
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
2023-05-19 23:11:51 +02:00
|
|
|
|
|
|
|
|
|
2017-05-02 13:47:53 +02:00
|
|
|
|
2010-02-15 06:45:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-08 02:02:47 +03:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2011-08-21 13:34:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2011-08-21 13:34:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 17:06:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-12 17:06:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-21 13:34:13 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-01 17:35:48 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2022-03-22 23:04:38 +03:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2023-05-19 15:32:30 -04:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2018-12-20 19:13:07 +01:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2023-05-19 15:32:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-22 23:04:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-22 23:04:38 +03:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-03 12:57:37 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2012-03-03 12:57:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2022-03-22 23:04:38 +03:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2022-03-22 23:04:38 +03:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:55 +02:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2019-04-01 17:46:57 +02:00
|
|
|
|
2019-04-01 17:46:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-09-05 16:35:23 -07:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2011-04-18 10:44:38 +00:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-18 10:44:38 +00:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2011-04-18 10:44:38 +00:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2011-04-18 10:44:38 +00:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
2018-12-20 19:13:07 +01:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
2012-03-01 17:35:48 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2012-03-01 17:35:48 -08:00
|
|
|
|
2018-12-20 19:13:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-01 17:35:48 -08:00
|
|
|
|
udlfb: handle unplug properly
The udlfb driver maintained an open count and cleaned up itself when the
count reached zero. But the console is also counted in the reference count
- so, if the user unplugged the device, the open count would not drop to
zero and the driver stayed loaded with console attached. If the user
re-plugged the adapter, it would create a device /dev/fb1, show green
screen and the access to the console would be lost.
The framebuffer subsystem has reference counting on its own - in order to
fix the unplug bug, we rely the framebuffer reference counting. When the
user unplugs the adapter, we call unregister_framebuffer unconditionally.
unregister_framebuffer will unbind the console, wait until all users stop
using the framebuffer and then call the fb_destroy method. The fb_destroy
cleans up the USB driver.
This patch makes the following changes:
* Drop dlfb->kref and rely on implicit framebuffer reference counting
instead.
* dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
be called by the framebuffer subsystem when no processes have the
framebuffer open or mapped.
* We don't use workqueue during initialization, but initialize directly
from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
and this racing would produce various kinds of memory corruption.
* We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
doesn't free the device under us.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
cc: Dave Airlie <airlied@redhat.com>
Cc: Bernie Thompson <bernie@plugable.com>,
Cc: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-10-08 12:57:34 +02:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-18 09:52:10 -08:00
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
udlfb: fix semaphore value leak
I observed that the performance of the udl fb driver degrades over time.
On a freshly booted machine, it takes 6 seconds to do "ls -la /usr/bin";
after some time of use, the same operation takes 14 seconds.
The reason is that the value of "limit_sem" decays over time.
The udl driver uses a semaphore "limit_set" to specify how many free urbs
are there on dlfb->urbs.list. If the count is zero, the "down" operation
will sleep until some urbs are added to the freelist.
In order to avoid some hypothetical deadlock, the driver will not call
"up" immediately, but it will offload it to a workqueue. The problem is
that if we call "schedule_delayed_work" on the same work item multiple
times, the work item may only be executed once.
This is happening:
* some urb completes
* dlfb_urb_completion adds it to the free list
* dlfb_urb_completion calls schedule_delayed_work to schedule the function
dlfb_release_urb_work to increase the semaphore count
* as the urb is on the free list, some other task grabs it and submits it
* the submitted urb completes, dlfb_urb_completion is called again
* dlfb_urb_completion calls schedule_delayed_work, but the work is already
scheduled, so it does nothing
* finally, dlfb_release_urb_work is called, it increases the semaphore
count by 1, although it should increase it by 2
So, the semaphore count is decreasing over time, and this causes gradual
performance degradation.
Note that in the current kernel, the "up" function may be called from
interrupt and it may race with the "down" function called by another
thread, so we don't have to offload the call of "up" to a workqueue at
all. This patch removes the workqueue code. The patch also changes
"down_interruptible" to "down" in dlfb_free_urb_list, so that we will
clean up the driver properly even if a signal arrives.
With this patch, the performance of udlfb no longer degrades.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
[b.zolnierkie: fix immediatelly -> immediately typo]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-07-25 15:41:54 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udlfb: fix semaphore value leak
I observed that the performance of the udl fb driver degrades over time.
On a freshly booted machine, it takes 6 seconds to do "ls -la /usr/bin";
after some time of use, the same operation takes 14 seconds.
The reason is that the value of "limit_sem" decays over time.
The udl driver uses a semaphore "limit_set" to specify how many free urbs
are there on dlfb->urbs.list. If the count is zero, the "down" operation
will sleep until some urbs are added to the freelist.
In order to avoid some hypothetical deadlock, the driver will not call
"up" immediately, but it will offload it to a workqueue. The problem is
that if we call "schedule_delayed_work" on the same work item multiple
times, the work item may only be executed once.
This is happening:
* some urb completes
* dlfb_urb_completion adds it to the free list
* dlfb_urb_completion calls schedule_delayed_work to schedule the function
dlfb_release_urb_work to increase the semaphore count
* as the urb is on the free list, some other task grabs it and submits it
* the submitted urb completes, dlfb_urb_completion is called again
* dlfb_urb_completion calls schedule_delayed_work, but the work is already
scheduled, so it does nothing
* finally, dlfb_release_urb_work is called, it increases the semaphore
count by 1, although it should increase it by 2
So, the semaphore count is decreasing over time, and this causes gradual
performance degradation.
Note that in the current kernel, the "up" function may be called from
interrupt and it may race with the "down" function called by another
thread, so we don't have to offload the call of "up" to a workqueue at
all. This patch removes the workqueue code. The patch also changes
"down_interruptible" to "down" in dlfb_free_urb_list, so that we will
clean up the driver properly even if a signal arrives.
With this patch, the performance of udlfb no longer degrades.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
[b.zolnierkie: fix immediatelly -> immediately typo]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
2018-07-25 15:41:54 +02:00
|
|
|
|
2010-09-05 16:35:19 -07:00
|
|
|
|
2018-07-25 15:41:57 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:57 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-04-29 15:36:29 -07:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-04-29 15:36:29 -07:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-19 15:32:30 -04:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:56 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2015-06-08 02:02:47 +03:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:21 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-07-25 15:41:57 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
|
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
2018-07-25 15:41:57 +02:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:21 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-15 17:04:22 +01:00
|
|
|
|
2018-01-16 16:35:20 +01:00
|
|
|
|
2010-02-15 06:45:55 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2011-08-21 13:35:39 -07:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
|
|
|
|
|
2011-08-21 13:35:38 -07:00
|
|
|
|
2010-09-05 16:35:39 -07:00
|
|
|
|
2011-08-21 13:34:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-03 12:57:37 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-11-24 15:52:21 -08:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-03 14:03:06 -07:00
|
|
|
|
2010-02-15 06:46:13 -08:00
|
|
|
|