From 5e64499f3d39c633de49320e399479642c2b1743 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 19 Mar 2010 21:46:23 +0100 Subject: agp/intel: intel_845_driver is an agp driver! ... not a GTT driver. So the additional chipset flush introduced in commit 2162e6a2b0cd5acbb9bd8a3c94e1c1269b078295 Author: Dave Airlie Date: Wed Nov 21 16:36:31 2007 +1000 agp/intel: Add chipset flushing support for i8xx chipsets. to fix a GTT problem makes absolutely no sense. If this would really be needed for AGP chipsets, too, we should add it to all i8xx agp drivers, not just one. Signed-off-by: Daniel Vetter Signed-off-by: Eric Anholt --- drivers/char/agp/intel-agp.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index b78d5c381ef..a34fc9fdfc5 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -1816,8 +1816,6 @@ static int intel_845_configure(void) pci_write_config_byte(agp_bridge->dev, INTEL_I845_AGPM, temp2 | (1 << 1)); /* clear any possible error conditions */ pci_write_config_word(agp_bridge->dev, INTEL_I845_ERRSTS, 0x001c); - - intel_i830_setup_flush(); return 0; } @@ -2187,7 +2185,6 @@ static const struct agp_bridge_driver intel_845_driver = { .agp_destroy_page = agp_generic_destroy_page, .agp_destroy_pages = agp_generic_destroy_pages, .agp_type_to_mask_type = agp_generic_type_to_mask_type, - .chipset_flush = intel_i830_chipset_flush, }; static const struct agp_bridge_driver intel_850_driver = { -- cgit v1.2.3 From 5a0e3ad6af8660be21ca98a971cd00f331318c05 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Wed, 24 Mar 2010 17:04:11 +0900 Subject: 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 Guess-its-ok-by: Christoph Lameter Cc: Ingo Molnar Cc: Lee Schermerhorn --- drivers/char/agp/amd-k7-agp.c | 2 +- drivers/char/agp/backend.c | 1 + drivers/char/agp/compat_ioctl.c | 1 + drivers/char/agp/generic.c | 1 + drivers/char/agp/hp-agp.c | 1 + drivers/char/agp/intel-agp.c | 1 + drivers/char/agp/nvidia-agp.c | 1 - drivers/char/agp/sgi-agp.c | 1 + drivers/char/agp/uninorth-agp.c | 1 + drivers/char/bfin_jtag_comm.c | 1 + drivers/char/briq_panel.c | 1 - drivers/char/bsr.c | 1 + drivers/char/cyclades.c | 1 + drivers/char/dsp56k.c | 1 - drivers/char/epca.c | 1 - drivers/char/generic_serial.c | 1 + drivers/char/hpet.c | 1 + drivers/char/hvc_console.c | 1 + drivers/char/hvc_iucv.c | 1 + drivers/char/hvcs.c | 1 + drivers/char/hw_random/intel-rng.c | 1 + drivers/char/hw_random/octeon-rng.c | 1 + drivers/char/hw_random/tx4939-rng.c | 1 + drivers/char/isicom.c | 1 + drivers/char/mbcs.c | 1 + drivers/char/misc.c | 2 +- drivers/char/mmtimer.c | 1 + drivers/char/moxa.c | 1 + drivers/char/mxser.c | 2 +- drivers/char/nozomi.c | 1 + drivers/char/nvram.c | 1 - drivers/char/pcmcia/ipwireless/network.c | 1 + drivers/char/ppdev.c | 1 + drivers/char/ps3flash.c | 1 + drivers/char/pty.c | 1 + drivers/char/raw.c | 1 + drivers/char/rio/rioinit.c | 1 - drivers/char/rio/riointr.c | 1 - drivers/char/rio/rioparam.c | 1 - drivers/char/rio/rioroute.c | 1 - drivers/char/rio/riotty.c | 1 - drivers/char/serial167.c | 1 + drivers/char/snsc_event.c | 1 + drivers/char/sonypi.c | 1 + drivers/char/specialix.c | 1 + drivers/char/sysrq.c | 1 + drivers/char/tpm/tpm.c | 1 + drivers/char/tpm/tpm_bios.c | 1 + drivers/char/tpm/tpm_nsc.c | 1 + drivers/char/tpm/tpm_tis.c | 1 + drivers/char/tty_audit.c | 1 + drivers/char/viotape.c | 1 + drivers/char/virtio_console.c | 1 + drivers/char/vme_scc.c | 1 - drivers/char/xilinx_hwicap/xilinx_hwicap.c | 1 + 55 files changed, 44 insertions(+), 14 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 73dbf40c874..a7637d72cef 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -6,9 +6,9 @@ #include #include #include -#include #include #include +#include #include "agp.h" #define AMD_MMBASE 0x14 diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index c3ab46da51a..ee4f855611b 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/agp/compat_ioctl.c b/drivers/char/agp/compat_ioctl.c index 58c57cb2518..9d2c97a69cd 100644 --- a/drivers/char/agp/compat_ioctl.c +++ b/drivers/char/agp/compat_ioctl.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "agp.h" #include "compat_ioctl.h" diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index c50543966eb..fb86708e47e 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 58752b70efe..056b289a1e8 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c @@ -15,6 +15,7 @@ #include #include #include +#include #include diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index b78d5c381ef..d41331bc2aa 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index 7e36d2b4f9d..10f24e349a2 100644 --- a/drivers/char/agp/nvidia-agp.c +++ b/drivers/char/agp/nvidia-agp.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c index 0d426ae39c8..ffa888cd1c8 100644 --- a/drivers/char/agp/sgi-agp.c +++ b/drivers/char/agp/sgi-agp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index d89da4ac061..6f48931ac1c 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c @@ -3,6 +3,7 @@ */ #include #include +#include #include #include #include diff --git a/drivers/char/bfin_jtag_comm.c b/drivers/char/bfin_jtag_comm.c index 2628c7415ea..e397df3ad98 100644 --- a/drivers/char/bfin_jtag_comm.c +++ b/drivers/char/bfin_jtag_comm.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c index d8cff909001..555cd93c2ee 100644 --- a/drivers/char/briq_panel.c +++ b/drivers/char/briq_panel.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index c02db01f736..7fef305774d 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index b861c08263a..9824b416290 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -79,6 +79,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c index 85832ab924e..8a1b28a10ef 100644 --- a/drivers/char/dsp56k.c +++ b/drivers/char/dsp56k.c @@ -24,7 +24,6 @@ */ #include -#include /* for kmalloc() and kfree() */ #include #include #include diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 17b044a71e0..6f5ffe1320f 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index d400cbd280f..5954ee1dc95 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #define DEBUG diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 9c5eea3ea4d..9ded667625a 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index ba55bba151b..d3890e8d30e 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c @@ -38,6 +38,7 @@ #include #include #include +#include #include diff --git a/drivers/char/hvc_iucv.c b/drivers/char/hvc_iucv.c index 37b0542a4ee..5a80ad68ef2 100644 --- a/drivers/char/hvc_iucv.c +++ b/drivers/char/hvc_iucv.c @@ -12,6 +12,7 @@ #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt #include +#include #include #include #include diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index 266b858b8f8..bedc6c1b6fa 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c index 91b53eb1c05..86fe45c1996 100644 --- a/drivers/char/hw_random/intel-rng.c +++ b/drivers/char/hw_random/intel-rng.c @@ -30,6 +30,7 @@ #include #include #include +#include #include diff --git a/drivers/char/hw_random/octeon-rng.c b/drivers/char/hw_random/octeon-rng.c index 54b0d9ba65c..9cd0feca318 100644 --- a/drivers/char/hw_random/octeon-rng.c +++ b/drivers/char/hw_random/octeon-rng.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/hw_random/tx4939-rng.c b/drivers/char/hw_random/tx4939-rng.c index 544d9085a8e..0bc0cb70210 100644 --- a/drivers/char/hw_random/tx4939-rng.c +++ b/drivers/char/hw_random/tx4939-rng.c @@ -14,6 +14,7 @@ #include #include #include +#include #define TX4939_RNG_RCSR 0x00000000 #define TX4939_RNG_ROR(n) (0x00000018 + (n) * 8) diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index be2e8f9a27c..0fa2e4a0835 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -130,6 +130,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 87c67b42bc0..83bef4efe37 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 94a136e96c0..92ab03d2829 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -49,6 +48,7 @@ #include #include #include +#include /* * Head entry for the doubly linked miscdevice list diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index 04fd0d843b3..ea7c99fa978 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index 166495d6a1d..107b0bd58d1 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index e0c5d2a6904..95c9f54f3d3 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -33,12 +33,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c index a3f32a15fde..a6638003f53 100644 --- a/drivers/char/nozomi.c +++ b/drivers/char/nozomi.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c index 5eb83c3ca20..47e8f7b0e4c 100644 --- a/drivers/char/nvram.c +++ b/drivers/char/nvram.c @@ -100,7 +100,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/char/pcmcia/ipwireless/network.c b/drivers/char/pcmcia/ipwireless/network.c index 590762a7f21..65920163f53 100644 --- a/drivers/char/pcmcia/ipwireless/network.c +++ b/drivers/char/pcmcia/ipwireless/network.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 432655bcb04..fdd37543aa7 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index f424d394a28..606048b72bc 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c @@ -20,6 +20,7 @@ #include #include +#include #include #include diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 5ee42481726..d83a43130df 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c @@ -29,6 +29,7 @@ #include #include #include +#include #include diff --git a/drivers/char/raw.c b/drivers/char/raw.c index 64acd05f71c..d331c59b571 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -20,6 +20,7 @@ #include #include #include +#include #include diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c index be0ba401966..24a282bb89d 100644 --- a/drivers/char/rio/rioinit.c +++ b/drivers/char/rio/rioinit.c @@ -31,7 +31,6 @@ */ #include -#include #include #include #include diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c index 71f87600907..2e71aecae20 100644 --- a/drivers/char/rio/riointr.c +++ b/drivers/char/rio/riointr.c @@ -31,7 +31,6 @@ */ #include -#include #include #include #include diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c index d687c17be15..6415f3f32a7 100644 --- a/drivers/char/rio/rioparam.c +++ b/drivers/char/rio/rioparam.c @@ -31,7 +31,6 @@ */ #include -#include #include #include #include diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c index 706c2a25f7a..f9b936ac339 100644 --- a/drivers/char/rio/rioroute.c +++ b/drivers/char/rio/rioroute.c @@ -31,7 +31,6 @@ */ #include -#include #include #include #include diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c index 47fab7c3307..8a90393faf3 100644 --- a/drivers/char/rio/riotty.c +++ b/drivers/char/rio/riotty.c @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 1ec3d5cd748..8dfd24721a8 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c index 55a95892ccf..ee156948b9f 100644 --- a/drivers/char/snsc_event.c +++ b/drivers/char/snsc_event.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index bba727c3807..73f66d03624 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 07ac14d949c..2c24fcdc722 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -94,6 +94,7 @@ #include #include #include +#include #include "specialix_io8.h" #include "cd1865.h" diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 1ae2de7d8b4..59de2525d30 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index f06bb37defb..068c816e694 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c @@ -24,6 +24,7 @@ */ #include +#include #include #include diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index bf2170fb1cd..0636520fa9b 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "tpm.h" diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 70efba2ee05..a605cb7dd89 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c @@ -20,6 +20,7 @@ */ #include +#include #include "tpm.h" /* National definitions */ diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 2405f17b29d..94345994f8a 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "tpm.h" diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c index 283a15bc84e..1b8ee590b4c 100644 --- a/drivers/char/tty_audit.c +++ b/drivers/char/tty_audit.c @@ -10,6 +10,7 @@ */ #include +#include #include struct tty_audit_buf { diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index 042c8149a6d..1144a04cda6 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 44288ce0cb4..026ea6c27e0 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index 8b24729fec8..12de1202d22 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 4846d50199f..7261b8d9087 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c @@ -86,6 +86,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 6da8d866d0d39e9509ff826660f6a86a6757c966 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 2 Apr 2010 18:05:12 +0200 Subject: tty: release_one_tty() forgets to put pids release_one_tty(tty) can be called when tty still has a reference to pgrp/session. In this case we leak the pid. Signed-off-by: Oleg Nesterov Reported-by: Catalin Marinas Reported-and-tested-by: Tetsuo Handa Acked-by: Linus Torvalds Acked-by: Eric W. Biederman Signed-off-by: Linus Torvalds --- drivers/char/tty_io.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index a42c466f709..6da962c9b21 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1423,6 +1423,8 @@ static void release_one_tty(struct work_struct *work) list_del_init(&tty->tty_files); file_list_unlock(); + put_pid(tty->pgrp); + put_pid(tty->session); free_tty_struct(tty); } -- cgit v1.2.3 From c70c036f04b7b74282477d6a51bbcc8bb8897e03 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 6 Apr 2010 14:34:46 -0700 Subject: drivers/char/amiserial.c: add missing local_irq_restore rs_init() is failing to restore interrupts on two error paths, and is incorrectly calling tty_unregister_driver() with local interrupts disabled. Fix these things by disabling interrupts later, after the reauest_irq() calls. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E1; identifier f; @@ f (...) { <+... * local_irq_save (E1,...); ... when != E1 * return ...; ...+> } // [akpm@linux-foundation.org: reimplement the fix] Signed-off-by: Julia Lawall Cc: Thadeu Lima de Souza Cascardo Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/amiserial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 6c32fbf0716..56b27671adc 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -2021,8 +2021,6 @@ static int __init rs_init(void) state->baud_base = amiga_colorclock; state->xmit_fifo_size = 1; - local_irq_save(flags); - /* set ISRs, and then disable the rx interrupts */ error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); if (error) @@ -2033,6 +2031,8 @@ static int __init rs_init(void) if (error) goto fail_free_irq; + local_irq_save(flags); + /* turn off Rx and Tx interrupts */ custom.intena = IF_RBF | IF_TBE; mb(); -- cgit v1.2.3 From c6eb69acfdfe258b4a3f69fa5ced8928bbebdba9 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 6 Apr 2010 14:34:50 -0700 Subject: mxser: spin_lock() => spin_lock_irq() This should be spin_lock_irq() to match the spin_unlock_irq(). Originally it was a lock_kernel() but we switched everything to spin_lock_irq() last November. [akpm@linux-foundation.org: fix the MOXA_ASPP_MON case too (per Jiri)] Signed-off-by: Dan Carpenter Cc: Jiri Slaby Cc: Alan Cox Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/mxser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 95c9f54f3d3..47023053ee8 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -1768,7 +1768,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, int len, lsr; len = mxser_chars_in_buffer(tty); - spin_lock(&info->slock); + spin_lock_irq(&info->slock); lsr = inb(info->ioaddr + UART_LSR) & UART_LSR_THRE; spin_unlock_irq(&info->slock); len += (lsr ? 0 : 1); @@ -1778,12 +1778,12 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, case MOXA_ASPP_MON: { int mcr, status; - spin_lock(&info->slock); + spin_lock_irq(&info->slock); status = mxser_get_msr(info->ioaddr, 1, tty->index); mxser_check_modem_status(tty, info, status); mcr = inb(info->ioaddr + UART_MCR); - spin_unlock(&info->slock); + spin_unlock_irq(&info->slock); if (mcr & MOXA_MUST_MCR_XON_FLAG) info->mon_data.hold_reason &= ~NPPI_NOTIFY_XOFFHOLD; -- cgit v1.2.3 From 6e191f7bb083544dc4fa3879ff81caf97c65d197 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Apr 2010 14:34:55 -0700 Subject: devmem: handle class_create() failure I hit this when we had a bug in IDR for a few days. Basically sysfs would fail to create new inodes since it uses an IDR and therefore class_create would fail. While we are unlikely to see this fail we may as well handle it instead of oopsing. Signed-off-by: Anton Blanchard Reviewed-by: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/mem.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 1f3215ac085..47c8452f485 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -908,6 +908,9 @@ static int __init chr_dev_init(void) printk("unable to get major %d for memory devs\n", MEM_MAJOR); mem_class = class_create(THIS_MODULE, "mem"); + if (IS_ERR(mem_class)) + return PTR_ERR(mem_class); + mem_class->devnode = mem_devnode; for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { if (!devlist[minor].name) -- cgit v1.2.3 From 55ab3a1ff843e3f0e24d2da44e71bffa5d853010 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Apr 2010 14:34:58 -0700 Subject: raw: fsync method is now required Commit 148f948ba877f4d3cdef036b1ff6d9f68986706a (vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode) broke the raw driver. We now call through generic_file_aio_write -> generic_write_sync -> vfs_fsync_range. vfs_fsync_range has: if (!fop || !fop->fsync) { ret = -EINVAL; goto out; } But drivers/char/raw.c doesn't set an fsync method. We have two options: fix it or remove the raw driver completely. I'm happy to do either, the fact this has been broken for so long suggests it is rarely used. The patch below adds an fsync method to the raw driver. My knowledge of the block layer is pretty sketchy so this could do with a once over. If we instead decide to remove the raw driver, this patch might still be useful as a backport to 2.6.33 and 2.6.32. Signed-off-by: Anton Blanchard Reviewed-by: Jan Kara Cc: Christoph Hellwig Cc: Alexander Viro Cc: Jens Axboe Reviewed-by: Jeff Moyer Tested-by: Jeff Moyer Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/raw.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/char') diff --git a/drivers/char/raw.c b/drivers/char/raw.c index d331c59b571..f5a32317b75 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -248,6 +248,7 @@ static const struct file_operations raw_fops = { .aio_read = generic_file_aio_read, .write = do_sync_write, .aio_write = blkdev_aio_write, + .fsync = block_fsync, .open = raw_open, .release= raw_release, .ioctl = raw_ioctl, -- cgit v1.2.3 From b1dd3b2843b3b73b7fc2ee47d96310cd1c051371 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 6 Apr 2010 14:35:00 -0700 Subject: vfs: rename block_fsync() to blkdev_fsync() Requested by hch, for consistency now it is exported. Cc: Alexander Viro Cc: Anton Blanchard Cc: Christoph Hellwig Cc: Jan Kara Cc: Jeff Moyer Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/char') diff --git a/drivers/char/raw.c b/drivers/char/raw.c index f5a32317b75..8756ab0daa8 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -248,7 +248,7 @@ static const struct file_operations raw_fops = { .aio_read = generic_file_aio_read, .write = do_sync_write, .aio_write = blkdev_aio_write, - .fsync = block_fsync, + .fsync = blkdev_fsync, .open = raw_open, .release= raw_release, .ioctl = raw_ioctl, -- cgit v1.2.3 From ee5d2acd5ca1534f40e06d4f0d41a940b17beb54 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 6 Apr 2010 14:35:01 -0700 Subject: /dev/mem: allow rewinding commit dcefafb6 ("/dev/mem: dont allow seek to last page") inadvertently disabled rewinding on /dev/mem. This broke x86info for example. Signed-off-by: Eric Dumazet Acked-by: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/mem.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 47c8452f485..9cdbadc6860 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -710,11 +710,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig) switch (orig) { case SEEK_CUR: offset += file->f_pos; - if ((unsigned long long)offset < - (unsigned long long)file->f_pos) { - ret = -EOVERFLOW; - break; - } case SEEK_SET: /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ if ((unsigned long long)offset >= ~0xFFFULL) { -- cgit v1.2.3 From ea56f411ec2d4d8689eb7f3bcd24e860acf87c47 Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 6 Apr 2010 14:35:08 -0700 Subject: frv: hide uncached_access() when pgprot_noncached is not #defined Hide uncached_access() when pgprot_noncached is not #defined. This prevents the following warning: CC drivers/char/mem.o drivers/char/mem.c:229: warning: 'uncached_access' defined but not used Repairs d7d4d849b4e3acc405ec222884936800ffb26d48 ("drivers/char/mem.c: cleanups"). Signed-off-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/mem.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 9cdbadc6860..f54dab8acdc 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -225,6 +225,7 @@ int __weak phys_mem_access_prot_allowed(struct file *file, * outside of main memory. * */ +#ifdef pgprot_noncached static int uncached_access(struct file *file, unsigned long addr) { #if defined(CONFIG_IA64) @@ -251,6 +252,7 @@ static int uncached_access(struct file *file, unsigned long addr) return addr >= __pa(high_memory); #endif } +#endif static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t vma_prot) -- cgit v1.2.3 From 162a689a13ed61c0752726edb75427b2cd4186c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Diakhat=C3=A9?= Date: Tue, 23 Mar 2010 18:23:15 +0530 Subject: virtio: console: Fix early_put_chars usage Currently early_put_chars is not used by virtio_console because it can only be used once a port has been found, at which point it's too late because it is no longer needed. This patch should fix it. Acked-by: Christian Borntraeger Signed-off-by: Amit Shah Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 026ea6c27e0..48306bc733f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -646,13 +646,13 @@ static int put_chars(u32 vtermno, const char *buf, int count) { struct port *port; + if (unlikely(early_put_chars)) + return early_put_chars(vtermno, buf, count); + port = find_port_by_vtermno(vtermno); if (!port) return 0; - if (unlikely(early_put_chars)) - return early_put_chars(vtermno, buf, count); - return send_buf(port, (void *)buf, count); } -- cgit v1.2.3 From 9ff4cfab82d27e9fda72315f911bbaa9516e04bc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 Apr 2010 09:46:16 -0600 Subject: virtio: console makes incorrect assumption about virtio API The get_buf() API sets the second arg to the number of bytes *written* by the other side; in this case it should be zero as these are output buffers. lguest gets this right (obviously kvm's console doesn't), resulting in continual buildup of console writes. Signed-off-by: Rusty Russell Acked-by: Amit Shah --- drivers/char/virtio_console.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 48306bc733f..86e9011325d 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -416,20 +416,16 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) out_vq->vq_ops->kick(out_vq); if (ret < 0) { - len = 0; + in_count = 0; goto fail; } - /* - * Wait till the host acknowledges it pushed out the data we - * sent. Also ensure we return to userspace the number of - * bytes that were successfully consumed by the host. - */ + /* Wait till the host acknowledges it pushed out the data we sent. */ while (!out_vq->vq_ops->get_buf(out_vq, &len)) cpu_relax(); fail: /* We're expected to return the amount of data we wrote */ - return len; + return in_count; } /* -- cgit v1.2.3 From b7a413015d2986edf020fba765c906cc9cbcbfc9 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 31 Mar 2010 21:56:42 +0300 Subject: virtio: disable multiport console support. Move MULTIPORT feature and related config changes out of exported headers, and disable the feature at runtime. At this point, it seems less risky to keep code around until we can enable it than rip it out completely. Signed-off-by: Michael S. Tsirkin Signed-off-by: Rusty Russell --- drivers/char/virtio_console.c | 49 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 8 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 86e9011325d..196428c2287 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -33,6 +33,35 @@ #include #include "hvc_console.h" +/* Moved here from .h file in order to disable MULTIPORT. */ +#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ + +struct virtio_console_multiport_conf { + struct virtio_console_config config; + /* max. number of ports this device can hold */ + __u32 max_nr_ports; + /* number of ports added so far */ + __u32 nr_ports; +} __attribute__((packed)); + +/* + * A message that's passed between the Host and the Guest for a + * particular port. + */ +struct virtio_console_control { + __u32 id; /* Port number */ + __u16 event; /* The kind of control event (see below) */ + __u16 value; /* Extra information for the key */ +}; + +/* Some events for control messages */ +#define VIRTIO_CONSOLE_PORT_READY 0 +#define VIRTIO_CONSOLE_CONSOLE_PORT 1 +#define VIRTIO_CONSOLE_RESIZE 2 +#define VIRTIO_CONSOLE_PORT_OPEN 3 +#define VIRTIO_CONSOLE_PORT_NAME 4 +#define VIRTIO_CONSOLE_PORT_REMOVE 5 + /* * This is a global struct for storing common data for all the devices * this driver handles. @@ -121,7 +150,7 @@ struct ports_device { spinlock_t cvq_lock; /* The current config space is stored here */ - struct virtio_console_config config; + struct virtio_console_multiport_conf config; /* The virtio device we're associated with */ struct virtio_device *vdev; @@ -1214,7 +1243,7 @@ fail: */ static void config_work_handler(struct work_struct *work) { - struct virtio_console_config virtconconf; + struct virtio_console_multiport_conf virtconconf; struct ports_device *portdev; struct virtio_device *vdev; int err; @@ -1223,7 +1252,8 @@ static void config_work_handler(struct work_struct *work) vdev = portdev->vdev; vdev->config->get(vdev, - offsetof(struct virtio_console_config, nr_ports), + offsetof(struct virtio_console_multiport_conf, + nr_ports), &virtconconf.nr_ports, sizeof(virtconconf.nr_ports)); @@ -1415,16 +1445,19 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) multiport = false; portdev->config.nr_ports = 1; portdev->config.max_nr_ports = 1; +#if 0 /* Multiport is not quite ready yet --RR */ if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT)) { multiport = true; vdev->features[0] |= 1 << VIRTIO_CONSOLE_F_MULTIPORT; - vdev->config->get(vdev, offsetof(struct virtio_console_config, - nr_ports), + vdev->config->get(vdev, + offsetof(struct virtio_console_multiport_conf, + nr_ports), &portdev->config.nr_ports, sizeof(portdev->config.nr_ports)); - vdev->config->get(vdev, offsetof(struct virtio_console_config, - max_nr_ports), + vdev->config->get(vdev, + offsetof(struct virtio_console_multiport_conf, + max_nr_ports), &portdev->config.max_nr_ports, sizeof(portdev->config.max_nr_ports)); if (portdev->config.nr_ports > portdev->config.max_nr_ports) { @@ -1440,6 +1473,7 @@ static int __devinit virtcons_probe(struct virtio_device *vdev) /* Let the Host know we support multiple ports.*/ vdev->config->finalize_features(vdev); +#endif err = init_vqs(portdev); if (err < 0) { @@ -1522,7 +1556,6 @@ static struct virtio_device_id id_table[] = { static unsigned int features[] = { VIRTIO_CONSOLE_F_SIZE, - VIRTIO_CONSOLE_F_MULTIPORT, }; static struct virtio_driver virtio_console = { -- cgit v1.2.3 From 320718ee074acce5ffced6506cb51af1388942aa Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Apr 2010 21:42:38 +1000 Subject: hvc_console: Fix race between hvc_close and hvc_remove I don't claim to understand the tty layer, but it seems like hvc_open and hvc_close should be balanced in their kref reference counting. Right now we get a kref every call to hvc_open: if (hp->count++ > 0) { tty_kref_get(tty); <----- here spin_unlock_irqrestore(&hp->lock, flags); hvc_kick(); return 0; } /* else count == 0 */ tty->driver_data = hp; hp->tty = tty_kref_get(tty); <------ or here if hp->count was 0 But hvc_close has: tty_kref_get(tty); if (--hp->count == 0) { ... /* Put the ref obtained in hvc_open() */ tty_kref_put(tty); ... } tty_kref_put(tty); Since the outside kref get/put balance we only do a single kref_put when count reaches 0. The patch below changes things to call tty_kref_put once for every hvc_close call, and with that my machine boots fine. Signed-off-by: Anton Blanchard Acked-by: Amit Shah Signed-off-by: Rusty Russell --- drivers/char/hvc_console.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index d3890e8d30e..35cca4c7fb1 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c @@ -368,16 +368,12 @@ static void hvc_close(struct tty_struct *tty, struct file * filp) hp = tty->driver_data; spin_lock_irqsave(&hp->lock, flags); - tty_kref_get(tty); if (--hp->count == 0) { /* We are done with the tty pointer now. */ hp->tty = NULL; spin_unlock_irqrestore(&hp->lock, flags); - /* Put the ref obtained in hvc_open() */ - tty_kref_put(tty); - if (hp->ops->notifier_del) hp->ops->notifier_del(hp, hp->data); -- cgit v1.2.3 From 07a71415d5f790385695784a9b0e554412ee95c3 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 18 Apr 2010 22:07:33 +0300 Subject: pcmcia: fix error handling in cm4000_cs.c In the original code we used -ENODEV as the number of bytes to copy_to_user() and we didn't release the locks. Signed-off-by: Dan Carpenter Acked-by: Harald Welte Signed-off-by: Dominik Brodowski --- drivers/char/pcmcia/cm4000_cs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index c9bc896d68a..90b199f97be 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -1026,14 +1026,16 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count, xoutb(0, REG_FLAGS1(iobase)); /* clear detectCMM */ /* last check before exit */ - if (!io_detect_cm4000(iobase, dev)) - count = -ENODEV; + if (!io_detect_cm4000(iobase, dev)) { + rc = -ENODEV; + goto release_io; + } if (test_bit(IS_INVREV, &dev->flags) && count > 0) str_invert_revert(dev->rbuf, count); if (copy_to_user(buf, dev->rbuf, count)) - return -EFAULT; + rc = -EFAULT; release_io: clear_bit(LOCK_IO, &dev->flags); -- cgit v1.2.3