system.devel and kernel rebuild
This commit is contained in:
@@ -36,6 +36,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="19">
|
||||
<Date>2018-07-15</Date>
|
||||
<Version>0.8</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="18">
|
||||
<Date>2018-07-12</Date>
|
||||
<Version>0.8</Version>
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="19">
|
||||
<Date>2018-07-15</Date>
|
||||
<Version>6.30.223.271</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="18">
|
||||
<Date>2018-07-12</Date>
|
||||
<Version>6.30.223.271</Version>
|
||||
|
||||
@@ -52,6 +52,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="29">
|
||||
<Date>2018-07-15</Date>
|
||||
<Version>5.2.12</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="28">
|
||||
<Date>2018-07-12</Date>
|
||||
<Version>5.2.12</Version>
|
||||
|
||||
@@ -50,6 +50,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="29">
|
||||
<Date>2018-07-15</Date>
|
||||
<Version>5.2.12</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="28">
|
||||
<Date>2018-07-12</Date>
|
||||
<Version>5.2.12</Version>
|
||||
|
||||
@@ -43,6 +43,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="18">
|
||||
<Date>2018-07-15</Date>
|
||||
<Version>1.61</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="17">
|
||||
<Date>2018-07-12</Date>
|
||||
<Version>1.61</Version>
|
||||
|
||||
@@ -93,6 +93,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="20">
|
||||
<Date>2018-07-15</Date>
|
||||
<Version>4.14.55</Version>
|
||||
<Comment>Rebuild</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="19">
|
||||
<Date>2018-07-12</Date>
|
||||
<Version>4.14.55</Version>
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,181 @@
|
||||
|
||||
3rdparty/mkbuild.pl | 92 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
Documentation/3rdparty.txt | 76 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 168 insertions(+)
|
||||
|
||||
diff -Nurp linux-2.6.37/3rdparty/mkbuild.pl linux-2.6.37.3rdparty/3rdparty/mkbuild.pl
|
||||
--- linux-2.6.37/3rdparty/mkbuild.pl 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/mkbuild.pl 2004-04-23 14:59:03.000000000 +0300
|
||||
@@ -0,0 +1,92 @@
|
||||
+#!/usr/bin/perl -w
|
||||
+#
|
||||
+# Version 1.0
|
||||
+#
|
||||
+# Copyright 2001 Jeff Garzik <jgarzik@mandrakesoft.com>
|
||||
+# Copyright 2002 Juan Quintela <quintela@mandrakesoft.com>
|
||||
+# Copyright 2003 Nicolas Planel <nplanel@mandrakesoft.com>
|
||||
+#
|
||||
+# This software may be used and distributed according to the terms
|
||||
+# of the GNU General Public License, incorporated herein by reference.
|
||||
+#
|
||||
+#
|
||||
+# Run "mkbuild.pl"
|
||||
+#
|
||||
+# This program generates the following files
|
||||
+# Makefile
|
||||
+# Makefile.drivers
|
||||
+# Config.in
|
||||
+# using the information in the subdirs of this directory.
|
||||
+#
|
||||
+# subdirs need to have:
|
||||
+# a Config.in file
|
||||
+# a Makefile with a O_TARGET/L_TARGET targets
|
||||
+# The config.in should set a CONFIG_<module_dir_name> to m/y.
|
||||
+
|
||||
+use strict;
|
||||
+
|
||||
+opendir(THISDIR, ".");
|
||||
+# get dirs without . and .. garbage
|
||||
+my (@modules) = grep(!/\.\.?$/,grep(-d, readdir(THISDIR)));
|
||||
+closedir(THISDIR);
|
||||
+
|
||||
+generate_kconfig(@modules);
|
||||
+generate_makefile(@modules);
|
||||
+exit(0);
|
||||
+
|
||||
+##########################################################################
|
||||
+
|
||||
+sub generate_makefile {
|
||||
+ my (@modules) = @_;
|
||||
+
|
||||
+ local *F;
|
||||
+ open F, "> Makefile" or die "Cannot create new Makefile: $!\n";
|
||||
+ print F <<'EOM';
|
||||
+#
|
||||
+# THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT.
|
||||
+#
|
||||
+
|
||||
+EOM
|
||||
+ printf F "obj- := 3rdparty.o # Dummy rule to force built-in.o to be made\n";
|
||||
+ printf F "obj-\$(%s) += %s\n", to_CONFIG($_), $_ . '/' foreach @modules;
|
||||
+}
|
||||
+
|
||||
+sub generate_kconfig {
|
||||
+ my (@modules) = @_;
|
||||
+
|
||||
+ local *F;
|
||||
+ open F, "> Kconfig" or die "Cannot create Kconfig: $!\n";
|
||||
+ print F <<"EOM";
|
||||
+#
|
||||
+# THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT.
|
||||
+#
|
||||
+
|
||||
+menu "Unofficial 3rd party kernel additions"
|
||||
+
|
||||
+EOM
|
||||
+
|
||||
+ foreach (@modules) {
|
||||
+ die "No Kconfig in $_.\n" if ! -r "$_/Kconfig";
|
||||
+ print F "source 3rdparty/$_/Kconfig\n";
|
||||
+ }
|
||||
+ print F "\n\nendmenu\n";
|
||||
+}
|
||||
+
|
||||
+sub to_CONFIG {
|
||||
+ local $_ = $_[0];
|
||||
+ tr/a-z/A-Z/;
|
||||
+ s/[\-\. ]/_/g;
|
||||
+ "CONFIG_$_";
|
||||
+}
|
||||
+
|
||||
+sub find_target {
|
||||
+ my ($module_dir) = @_;
|
||||
+
|
||||
+ local *F;
|
||||
+ open(F, "$module_dir/Makefile") or die "$module_dir/Makefile: $!\n";
|
||||
+ while (<F>) {
|
||||
+ chomp;
|
||||
+ return $1 if (/[LO]_TARGET.*:=\s+(\S+)/);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
diff -Nurp linux-2.6.37/Documentation/3rdparty.txt linux-2.6.37.3rdparty/Documentation/3rdparty.txt
|
||||
--- linux-2.6.37/Documentation/3rdparty.txt 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/Documentation/3rdparty.txt 2003-11-22 01:07:26.000000000 +0200
|
||||
@@ -0,0 +1,76 @@
|
||||
+
|
||||
+Third-Party Kernel Source Module Support, or
|
||||
+an easy way to add modules to your kernel build.
|
||||
+
|
||||
+
|
||||
+
|
||||
+Vendors quite often add additional drivers and features to the kernel
|
||||
+which require nothing more than modifying Kconfig, Makefile, and
|
||||
+adding one or more files to a sub-directory. As a single discrete task,
|
||||
+this is not a problem. However, using patches to add modules to the
|
||||
+kernel very often results in patch conflicts, resulting in needless time
|
||||
+wastage as developers regenerate an otherwise working kernel patch.
|
||||
+
|
||||
+This is designed as a solution to these problems. It is NOT designed as
|
||||
+a replacement for the kernel build system, but merely as a tool for
|
||||
+vendors and system administrators to ease the pain of patch management.
|
||||
+
|
||||
+The key feature of this system is the distinct lack of patches. Drivers
|
||||
+are installed via unpacking a tarball.
|
||||
+
|
||||
+
|
||||
+
|
||||
+Adding a directory to the build (usually from a tarball)
|
||||
+--------------------------------------------------------
|
||||
+If a directory exists inside the 3rdparty sub-directory that contains a
|
||||
+proper Makefile, it can be added to the build. It also needs a
|
||||
+Kconfig file.
|
||||
+
|
||||
+ cd /usr/src/linux-2.4.3/3rdparty
|
||||
+ bzcat /tmp/my-driver2.tar.bz2 | tar xf - # creates "my2" dir
|
||||
+
|
||||
+
|
||||
+Limitations
|
||||
+-----------
|
||||
+There are some limitations to this system. This system is only
|
||||
+designed to support a very common case. If you find yourself running
|
||||
+into limitations (kernel build experts can spot them right off),
|
||||
+then you should probably be patching the kernel instead of using
|
||||
+mkbuild.pl for that particular module.
|
||||
+
|
||||
+FIXME: actually list the limitations
|
||||
+
|
||||
+
|
||||
+
|
||||
+Other notes
|
||||
+-----------
|
||||
+Link order is controlled by the order of mkbuild.pl executions.
|
||||
+
|
||||
+"make mrproper" will erase Makefile.meta, and empty Kconfig, Makefile,
|
||||
+and Makefile.drivers.
|
||||
+
|
||||
+IMPORTANT NOTE: Because this feature modifies the kernel's makefiles and
|
||||
+configuration system, you MUST complete all mkbuild.pl runs before
|
||||
+running any "make" command.
|
||||
+
|
||||
+Building in the 3rdparty dir
|
||||
+----------------------------
|
||||
+
|
||||
+If you use modules that:
|
||||
+ - are contained in one subdir with the name of the module
|
||||
+ - has a Makefile
|
||||
+ - has a Kconfig file
|
||||
+
|
||||
+The system calls the ./mkbuild.pl script. It will search for
|
||||
+subdirectories, and will try to build each of them as a module.
|
||||
+Things to note:
|
||||
+
|
||||
+ The dependencies will be done in a module called:
|
||||
+
|
||||
+ 3rdparty/<module_dir_name>/<module_name>
|
||||
+
|
||||
+depending of CONFIG_<module_name_in_uppercase>.
|
||||
+
|
||||
+<module_name> is the value of O_TARGET/L_TARGET.
|
||||
+
|
||||
+
|
||||
@@ -0,0 +1,191 @@
|
||||
|
||||
Include 3rdparty directory into the main build-system.
|
||||
|
||||
Original author is unknown.
|
||||
(Was either Juan Quintela or Jeff Garzik)
|
||||
|
||||
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
Makefile | 2 +-
|
||||
arch/alpha/Kconfig | 1 +
|
||||
arch/ia64/Kconfig | 2 ++
|
||||
arch/mips/Kconfig | 2 ++
|
||||
arch/powerpc/Kconfig | 2 ++
|
||||
arch/sparc/Kconfig | 2 ++
|
||||
arch/x86/Kconfig | 2 ++
|
||||
scripts/kconfig/Makefile | 33 ++++++++++++++++++---------------
|
||||
8 files changed, 30 insertions(+), 16 deletions(-)
|
||||
|
||||
diff -Nurp linux-4.2.2/arch/alpha/Kconfig linux-4.2.2-3rd/arch/alpha/Kconfig
|
||||
--- linux-4.2.2/arch/alpha/Kconfig 2015-08-30 21:34:09.000000000 +0300
|
||||
+++ linux-4.2.2-3rd/arch/alpha/Kconfig 2015-09-29 23:02:44.024347272 +0300
|
||||
@@ -750,3 +750,4 @@ source "crypto/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
||||
|
||||
+source "3rdparty/Kconfig"
|
||||
diff -Nurp linux-4.2.2/arch/ia64/Kconfig linux-4.2.2-3rd/arch/ia64/Kconfig
|
||||
--- linux-4.2.2/arch/ia64/Kconfig 2015-08-30 21:34:09.000000000 +0300
|
||||
+++ linux-4.2.2-3rd/arch/ia64/Kconfig 2015-09-29 23:02:44.024347272 +0300
|
||||
@@ -613,3 +613,5 @@ source "lib/Kconfig"
|
||||
|
||||
config IOMMU_HELPER
|
||||
def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
|
||||
+
|
||||
+source "3rdparty/Kconfig"
|
||||
diff -Nurp linux-4.2.2/arch/mips/Kconfig linux-4.2.2-3rd/arch/mips/Kconfig
|
||||
--- linux-4.2.2/arch/mips/Kconfig 2015-08-30 21:34:09.000000000 +0300
|
||||
+++ linux-4.2.2-3rd/arch/mips/Kconfig 2015-09-29 23:02:44.024347272 +0300
|
||||
@@ -2944,3 +2944,5 @@ source "crypto/Kconfig"
|
||||
source "lib/Kconfig"
|
||||
|
||||
source "arch/mips/kvm/Kconfig"
|
||||
+
|
||||
+source "3rdparty/Kconfig"
|
||||
diff -Nurp linux-4.2.2/arch/powerpc/Kconfig linux-4.2.2-3rd/arch/powerpc/Kconfig
|
||||
--- linux-4.2.2/arch/powerpc/Kconfig 2015-08-30 21:34:09.000000000 +0300
|
||||
+++ linux-4.2.2-3rd/arch/powerpc/Kconfig 2015-09-29 23:02:44.025347276 +0300
|
||||
@@ -1112,3 +1112,5 @@ config PPC_LIB_RHEAP
|
||||
source "arch/powerpc/kvm/Kconfig"
|
||||
|
||||
source "kernel/livepatch/Kconfig"
|
||||
+
|
||||
+source "3rdparty/Kconfig"
|
||||
diff -Nurp linux-4.2.2/arch/sparc/Kconfig linux-4.2.2-3rd/arch/sparc/Kconfig
|
||||
--- linux-4.2.2/arch/sparc/Kconfig 2015-08-30 21:34:09.000000000 +0300
|
||||
+++ linux-4.2.2-3rd/arch/sparc/Kconfig 2015-09-29 23:02:44.025347276 +0300
|
||||
@@ -569,3 +569,5 @@ source "security/Kconfig"
|
||||
source "crypto/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
||||
+
|
||||
+source "3rdparty/Kconfig"
|
||||
diff -Nurp linux-4.2.2/arch/x86/Kconfig linux-4.2.2-3rd/arch/x86/Kconfig
|
||||
--- linux-4.2.2/arch/x86/Kconfig 2015-08-30 21:34:09.000000000 +0300
|
||||
+++ linux-4.2.2-3rd/arch/x86/Kconfig 2015-09-29 23:02:44.025347276 +0300
|
||||
@@ -2601,3 +2601,5 @@ source "crypto/Kconfig"
|
||||
source "arch/x86/kvm/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
||||
+
|
||||
+source "3rdparty/Kconfig"
|
||||
diff -Nurp linux-4.2.2/Makefile linux-4.2.2-3rd/Makefile
|
||||
--- linux-4.2.2/Makefile 2015-09-29 22:13:44.743650710 +0300
|
||||
+++ linux-4.2.2-3rd/Makefile 2015-09-29 23:02:44.026347280 +0300
|
||||
@@ -546,7 +546,7 @@ scripts: scripts_basic include/config/au
|
||||
|
||||
# Objects we will link into vmlinux / subdirs we need to visit
|
||||
init-y := init/
|
||||
-drivers-y := drivers/ sound/ firmware/
|
||||
+drivers-y := drivers/ sound/ firmware/ 3rdparty/
|
||||
net-y := net/
|
||||
libs-y := lib/
|
||||
core-y := usr/
|
||||
diff -Nurp linux-4.9/scripts/kconfig/Makefile linux-4.9-3rd/scripts/kconfig/Makefile
|
||||
--- linux-4.9/scripts/kconfig/Makefile
|
||||
+++ linux-4.9-3rd/scripts/kconfig/Makefile
|
||||
@@ -18,28 +18,28 @@ endif
|
||||
# We need this, in case the user has it in its environment
|
||||
unexport CONFIG_
|
||||
|
||||
-xconfig: $(obj)/qconf
|
||||
+xconfig: $(obj)/qconf 3rdparty/Makefile
|
||||
$< $(silent) $(Kconfig)
|
||||
|
||||
-gconfig: $(obj)/gconf
|
||||
+gconfig: $(obj)/gconf 3rdparty/Makefile
|
||||
$< $(silent) $(Kconfig)
|
||||
|
||||
-menuconfig: $(obj)/mconf
|
||||
+menuconfig: $(obj)/mconf 3rdparty/Makefile
|
||||
$< $(silent) $(Kconfig)
|
||||
|
||||
-config: $(obj)/conf
|
||||
+config: $(obj)/conf 3rdparty/Makefile
|
||||
$< $(silent) --oldaskconfig $(Kconfig)
|
||||
|
||||
-nconfig: $(obj)/nconf
|
||||
+nconfig: $(obj)/nconf 3rdparty/Makefile
|
||||
$< $(silent) $(Kconfig)
|
||||
|
||||
-silentoldconfig: $(obj)/conf
|
||||
+silentoldconfig: $(obj)/conf 3rdparty/Makefile
|
||||
$(Q)mkdir -p include/config include/generated
|
||||
$(Q)test -e include/generated/autoksyms.h || \
|
||||
touch include/generated/autoksyms.h
|
||||
$< $(silent) --$@ $(Kconfig)
|
||||
|
||||
-localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
|
||||
+localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 3rdparty/Makefile
|
||||
$(Q)mkdir -p include/config include/generated
|
||||
$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
|
||||
$(Q)if [ -f .config ]; then \
|
||||
@@ -82,7 +82,7 @@ simple-targets := oldconfig allnoconfig
|
||||
alldefconfig randconfig listnewconfig olddefconfig
|
||||
PHONY += $(simple-targets)
|
||||
|
||||
-$(simple-targets): $(obj)/conf
|
||||
+$(simple-targets): $(obj)/conf 3rdparty/Makefile
|
||||
$< $(silent) --$@ $(Kconfig)
|
||||
|
||||
PHONY += oldnoconfig savedefconfig defconfig
|
||||
@@ -90,12 +90,12 @@ PHONY += oldnoconfig savedefconfig defco
|
||||
# oldnoconfig is an alias of olddefconfig, because people already are dependent
|
||||
# on its behavior (sets new symbols to their default value but not 'n') with the
|
||||
# counter-intuitive name.
|
||||
-oldnoconfig: olddefconfig
|
||||
+oldnoconfig: olddefconfig 3rdparty/Makefile
|
||||
|
||||
-savedefconfig: $(obj)/conf
|
||||
+savedefconfig: $(obj)/conf 3rdparty/Makefile
|
||||
$< $(silent) --$@=defconfig $(Kconfig)
|
||||
|
||||
-defconfig: $(obj)/conf
|
||||
+defconfig: $(obj)/conf 3rdparty/Makefile
|
||||
ifeq ($(KBUILD_DEFCONFIG),)
|
||||
$< $(silent) --defconfig $(Kconfig)
|
||||
else
|
||||
@@ -108,26 +108,26 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
-%_defconfig: $(obj)/conf
|
||||
+%_defconfig: $(obj)/conf 3rdparty/Makefile
|
||||
$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
|
||||
|
||||
configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)
|
||||
|
||||
-%.config: $(obj)/conf
|
||||
+%.config: $(obj)/conf 3rdparty/Makefile
|
||||
$(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
|
||||
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
|
||||
|
||||
PHONY += kvmconfig
|
||||
-kvmconfig: kvm_guest.config
|
||||
+kvmconfig: kvm_guest.config 3rdparty/Makefile
|
||||
@:
|
||||
|
||||
PHONY += xenconfig
|
||||
-xenconfig: xen.config
|
||||
+xenconfig: xen.config 3rdparty/Makefile
|
||||
@:
|
||||
|
||||
PHONY += tinyconfig
|
||||
-tinyconfig:
|
||||
+tinyconfig:
|
||||
$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
|
||||
|
||||
# Help text used by make help
|
||||
@@ -190,6 +190,9 @@ gconf-objs := gconf.o zconf.tab.o
|
||||
|
||||
hostprogs-y := conf nconf mconf kxgettext qconf gconf
|
||||
|
||||
+3rdparty/Makefile:
|
||||
+ pushd $(srctree)/3rdparty ; $(PERL) ./mkbuild.pl ; popd
|
||||
+
|
||||
clean-files := qconf.moc .tmp_qtcheck .tmp_gtkcheck
|
||||
clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
|
||||
clean-files += config.pot linux.pot
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
--- linux-2.6.35/3rdparty/acerhk/acerhk.c.orig 2010-10-03 12:50:33.000000000 +0000
|
||||
+++ linux-2.6.35/3rdparty/acerhk/acerhk.c 2010-10-03 13:13:22.093868410 +0000
|
||||
@@ -2730,7 +2730,7 @@ static void acerhk_proc_cleanup(void)
|
||||
|
||||
/* {{{ file operations */
|
||||
|
||||
-static int acerhk_ioctl( struct inode *inode, struct file *file,
|
||||
+static long acerhk_ioctl( struct inode *inode, struct file *file,
|
||||
unsigned int cmd, unsigned long arg )
|
||||
{
|
||||
int retval;
|
||||
@@ -2827,7 +2827,7 @@ static int acerhk_release( struct inode
|
||||
|
||||
static struct file_operations acerhk_fops = {
|
||||
owner: THIS_MODULE,
|
||||
- ioctl: acerhk_ioctl,
|
||||
+ unlocked_ioctl: acerhk_ioctl,
|
||||
open: acerhk_open,
|
||||
#ifdef ACERDEBUG
|
||||
write: acerhk_write,
|
||||
@@ -0,0 +1,33 @@
|
||||
CFLAGS use isn't allowed anymore with 2.6.24, we must use EXTRA_CFLAGS
|
||||
in its place
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com>
|
||||
|
||||
--- linux-2.6.23/3rdparty/acerhk/Makefile.orig 2007-11-08 21:32:43.000000000 -0200
|
||||
+++ linux-2.6.23/3rdparty/acerhk/Makefile 2007-11-08 21:33:28.000000000 -0200
|
||||
@@ -14,7 +14,7 @@
|
||||
CONFIG_ACERHK?=m
|
||||
obj-$(CONFIG_ACERHK) += acerhk.o
|
||||
|
||||
-CFLAGS+=-c -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
|
||||
+EXTRA_CFLAGS+=-c -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
|
||||
INCLUDE=-I$(KERNELSRC)/include
|
||||
|
||||
ifeq ($(KERNELMAJOR), 2.6)
|
||||
@@ -41,13 +41,13 @@ acerhk.ko: $(SOURCE) acerhk.h
|
||||
$(MAKE) -C $(KERNELSRC) SUBDIRS=$(PWD) modules
|
||||
|
||||
acerhk.o: $(SOURCE) acerhk.h
|
||||
- $(CC) $(INCLUDE) $(CFLAGS) -DMODVERSIONS -DMODULE -D__KERNEL__ -o $(TARGET) $(SOURCE)
|
||||
+ $(CC) $(INCLUDE) $(EXTRA_CFLAGS) -DMODVERSIONS -DMODULE -D__KERNEL__ -o $(TARGET) $(SOURCE)
|
||||
|
||||
asm: $(SOURCE)
|
||||
ifeq ($(KERNELMAJOR), 2.6)
|
||||
- $(CC) $(INCLUDE) $(INCLUDE)/asm-i386/mach-default $(CFLAGS) -fverbose-asm -S -DMODVERSIONS -DMODULE -D__KERNEL__ $(SOURCE)
|
||||
+ $(CC) $(INCLUDE) $(INCLUDE)/asm-i386/mach-default $(EXTRA_CFLAGS) -fverbose-asm -S -DMODVERSIONS -DMODULE -D__KERNEL__ $(SOURCE)
|
||||
else
|
||||
- $(CC) $(INCLUDE) $(CFLAGS) -fverbose-asm -S -DMODVERSIONS -DMODULE -D__KERNEL__ $(SOURCE)
|
||||
+ $(CC) $(INCLUDE) $(EXTRA_CFLAGS) -fverbose-asm -S -DMODVERSIONS -DMODULE -D__KERNEL__ $(SOURCE)
|
||||
endif
|
||||
|
||||
clean:
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
Fix acerhk build with FUNCTION_TRACER enabled.
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
---
|
||||
3rdparty/acerhk/Makefile | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff -p -up linux-2.6.31/3rdparty/acerhk/Makefile.orig linux-2.6.31/3rdparty/acerhk/Makefile
|
||||
--- linux-2.6.31/3rdparty/acerhk/Makefile.orig 2009-10-02 16:39:06.000000000 -0300
|
||||
+++ linux-2.6.31/3rdparty/acerhk/Makefile 2009-10-02 16:45:13.000000000 -0300
|
||||
@@ -14,7 +14,10 @@
|
||||
CONFIG_ACERHK?=m
|
||||
obj-$(CONFIG_ACERHK) += acerhk.o
|
||||
|
||||
-EXTRA_CFLAGS+=-c -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
|
||||
+CFLAGS_acerhk.o += -c -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe
|
||||
+ifdef CONFIG_FUNCTION_TRACER
|
||||
+CFLAGS_REMOVE_acerhk.o = -pg
|
||||
+endif
|
||||
INCLUDE=-I$(KERNELSRC)/include
|
||||
|
||||
ifeq ($(KERNELMAJOR), 2.6)
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
AUTOCONF_INCLUDED is not defined anymore in 2.6.38, so old include got exposed.
|
||||
|
||||
Fix by removing the offending bits.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
3rdparty/acerhk/acerhk.c | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
--- linux-2.6.38/3rdparty/acerhk/acerhk.c.orig 2011-03-20 13:57:32.000000000 +0200
|
||||
+++ linux-2.6.38/3rdparty/acerhk/acerhk.c 2011-03-20 15:00:45.768659568 +0200
|
||||
@@ -35,10 +35,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
-#ifndef AUTOCONF_INCLUDED
|
||||
-#include <linux/config.h>
|
||||
-#endif
|
||||
-
|
||||
/* This driver is heavily dependent on the architecture, don't let
|
||||
* anyone without an X86 machine use it. On laptops with AMD64
|
||||
* architecture this driver is only useable in 32 bit mode.
|
||||
@@ -0,0 +1,37 @@
|
||||
Fix Makefile and add Kconfig for the acerhk driver
|
||||
---
|
||||
3rdparty/acerhk/Kconfig | 8 8 + 0 - 0 !
|
||||
3rdparty/acerhk/Makefile | 6 3 + 3 - 0 !
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: linux-2.6.21/3rdparty/acerhk/Makefile
|
||||
===================================================================
|
||||
--- linux-2.6.21.orig/3rdparty/acerhk/Makefile 2007-05-15 15:34:48.000000000 +0200
|
||||
+++ linux-2.6.21/3rdparty/acerhk/Makefile 2007-05-15 15:37:17.000000000 +0200
|
||||
@@ -1,10 +1,10 @@
|
||||
# change KERNELSRC to the location of your kernel build tree only if
|
||||
# autodetection does not work
|
||||
#KERNELSRC=/usr/src/linux
|
||||
-KERNELSRC?=/lib/modules/`uname -r`/build
|
||||
+#KERNELSRC?=/lib/modules/`uname -r`/build
|
||||
# Starting with 2.6.18, the kernel version is in utsrelease.h instead of version.h, accomodate both cases
|
||||
-KERNELVERSION=$(shell awk -F\" '/REL/ {print $$2}' $(shell grep -s -l REL $(KERNELSRC)/include/linux/version.h $(KERNELSRC)/include/linux/utsrelease.h))
|
||||
-KERNELMAJOR=$(shell echo $(KERNELVERSION)|head -c3)
|
||||
+#KERNELVERSION=$(shell awk -F\" '/REL/ {print $$2}' $(shell grep -s -l REL $(KERNELSRC)/include/linux/version.h $(KERNELSRC)/include/linux/utsrelease.h))
|
||||
+#KERNELMAJOR=$(shell echo $(KERNELVERSION)|head -c3)
|
||||
|
||||
# next line is for kernel 2.6, if you integrate the driver in the kernel tree
|
||||
# /usr/src/linux/drivers/acerhk - or something similar
|
||||
Index: linux-2.6.21/3rdparty/acerhk/Kconfig
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-2.6.21/3rdparty/acerhk/Kconfig 2007-05-15 15:39:30.000000000 +0200
|
||||
@@ -0,0 +1,8 @@
|
||||
+config ACERHK
|
||||
+ tristate "Acerhk driver"
|
||||
+ depends on EXPERIMENTAL && X86
|
||||
+ ---help---
|
||||
+ This is an experimental acer keyboard driver for
|
||||
+ acer laptops. If you have a notebook with a ipw2X00
|
||||
+ wireless card, it allows you to turn off the rf_kill
|
||||
+
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
Updated for owner removal from struct proc_dir_entry (2.6.30)
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
|
||||
---
|
||||
3rdparty/acerhk/acerhk.c | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff -p -up linux-2.6.29/3rdparty/acerhk/acerhk.c.orig linux-2.6.29/3rdparty/acerhk/acerhk.c
|
||||
--- linux-2.6.29/3rdparty/acerhk/acerhk.c.orig 2009-05-22 02:42:44.000000000 -0300
|
||||
+++ linux-2.6.29/3rdparty/acerhk/acerhk.c 2009-05-22 02:43:45.000000000 -0300
|
||||
@@ -2626,7 +2626,6 @@ static int acerhk_proc_init(void)
|
||||
printk(KERN_INFO"acerhk: could not create /proc/driver/acerhk\n");
|
||||
}
|
||||
else {
|
||||
- proc_acer_dir->owner = THIS_MODULE;
|
||||
/* now create several files, first general info ... */
|
||||
entry = create_proc_read_entry("info",
|
||||
0444, proc_acer_dir, acerhk_proc_info, NULL);
|
||||
@@ -2635,7 +2634,6 @@ static int acerhk_proc_init(void)
|
||||
remove_proc_entry("driver/acerhk", NULL);
|
||||
retval = 0;
|
||||
} else {
|
||||
- entry->owner = THIS_MODULE;
|
||||
/* ... last pressed key ... */
|
||||
entry = create_proc_read_entry("key",
|
||||
0444, proc_acer_dir, acerhk_proc_key, NULL);
|
||||
@@ -2645,7 +2643,6 @@ static int acerhk_proc_init(void)
|
||||
remove_proc_entry("driver/acerhk", NULL);
|
||||
retval = 0;
|
||||
} else {
|
||||
- entry->owner = THIS_MODULE;
|
||||
/* ... and led control file */
|
||||
entry = create_proc_entry("led", 0222, proc_acer_dir);
|
||||
if (entry == NULL) {
|
||||
@@ -2657,7 +2654,6 @@ static int acerhk_proc_init(void)
|
||||
}
|
||||
else {
|
||||
entry->write_proc = acerhk_proc_led;
|
||||
- entry->owner = THIS_MODULE;
|
||||
/* ... and wireless led controll file */
|
||||
entry = create_proc_entry("wirelessled", 0222, proc_acer_dir);
|
||||
if (entry == NULL) {
|
||||
@@ -2670,7 +2666,6 @@ static int acerhk_proc_init(void)
|
||||
}
|
||||
else {
|
||||
entry->write_proc = acerhk_proc_wirelessled;
|
||||
- entry->owner = THIS_MODULE;
|
||||
/* ... and bluetooth led controll file */
|
||||
entry = create_proc_entry("blueled", 0222, proc_acer_dir);
|
||||
if (entry == NULL) {
|
||||
@@ -2683,7 +2678,6 @@ static int acerhk_proc_init(void)
|
||||
retval = 0;
|
||||
} else {
|
||||
entry->write_proc = acerhk_proc_blueled;
|
||||
- entry->owner = THIS_MODULE;
|
||||
retval = 1;
|
||||
#ifdef ACERDEBUG
|
||||
/* add extra file for debugging purposes */
|
||||
@@ -2700,7 +2694,6 @@ static int acerhk_proc_init(void)
|
||||
}
|
||||
else {
|
||||
entry->write_proc = acerhk_proc_debug;
|
||||
- entry->owner = THIS_MODULE;
|
||||
retval = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
Fix Makefile and add Kconfig for the aes2501 driver.
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com>
|
||||
|
||||
---
|
||||
linux-2.6.23/3rdparty/aes2501/Kconfig | 10 ++++++++++
|
||||
linux-2.6.23/3rdparty/aes2501/Makefile | 19 +------------------
|
||||
2 files changed, 11 insertions(+), 18 deletions(-)
|
||||
|
||||
diff -p -up linux-2.6.23/3rdparty/aes2501/Kconfig.orig linux-2.6.23/3rdparty/aes2501/Kconfig
|
||||
--- linux-2.6.23/3rdparty/aes2501/Kconfig.orig 2008-01-13 23:14:47.000000000 -0200
|
||||
+++ linux-2.6.23/3rdparty/aes2501/Kconfig 2008-01-13 23:35:21.000000000 -0200
|
||||
@@ -0,0 +1,10 @@
|
||||
+config AES2501
|
||||
+ tristate "AuthenTec AES2501 Fingerprint Sensor Driver"
|
||||
+ depends on USB
|
||||
+ default m
|
||||
+ ---help---
|
||||
+ Say Y here if you have a AuthenTec AES2501 Fingerprint
|
||||
+ Sensor device.
|
||||
+
|
||||
+ To compile this driver as a module, choose M here: the
|
||||
+ module will be called aes2501.
|
||||
diff -p -up linux-2.6.23/3rdparty/aes2501/Makefile.orig linux-2.6.23/3rdparty/aes2501/Makefile
|
||||
--- linux-2.6.23/3rdparty/aes2501/Makefile.orig 2008-01-13 23:14:36.000000000 -0200
|
||||
+++ linux-2.6.23/3rdparty/aes2501/Makefile 2008-01-13 23:21:33.000000000 -0200
|
||||
@@ -1,19 +1,2 @@
|
||||
-
|
||||
-obj-m := aes2501.o
|
||||
-
|
||||
-KERNELDIR ?= /lib/modules/$(shell uname -r)/build
|
||||
-
|
||||
-PWD := $(shell pwd)
|
||||
-
|
||||
-all: usertest
|
||||
- $(MAKE) -C $(KERNELDIR) M=$(PWD)
|
||||
-
|
||||
-usertest:
|
||||
- gcc -I. -o usertest usertest.c
|
||||
-
|
||||
-clean:
|
||||
- rm -f *.o *~ aes2501.ko aes2501.mod.c Module.symvers usertest
|
||||
- rm -rf .tmp_versions
|
||||
- rm -f .*.cmd
|
||||
-
|
||||
+obj-$(CONFIG_AES2501) := aes2501.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
Prevent oops on module removal when we don't have the device available.
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com>
|
||||
|
||||
---
|
||||
linux-2.6.23/3rdparty/aes2501/aes2501.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff -p -up linux-2.6.23/3rdparty/aes2501/aes2501.c.orig linux-2.6.23/3rdparty/aes2501/aes2501.c
|
||||
--- linux-2.6.23/3rdparty/aes2501/aes2501.c.orig 2008-01-13 23:37:38.000000000 -0200
|
||||
+++ linux-2.6.23/3rdparty/aes2501/aes2501.c 2008-01-13 23:38:26.000000000 -0200
|
||||
@@ -1616,7 +1616,8 @@ static int __init aes2501_init(void)
|
||||
|
||||
static void __exit aes2501_exit(void)
|
||||
{
|
||||
- _dev->stop_scan = 1;
|
||||
+ if (_dev)
|
||||
+ _dev->stop_scan = 1;
|
||||
destroy_workqueue(comm_queue);
|
||||
usb_deregister(&aes2501_driver);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+20
@@ -0,0 +1,20 @@
|
||||
|
||||
Add supprto for 4.7 series kernels.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -urp linux/3rdparty/ndiswrapper.orig/wrapndis.c linux/3rdparty/ndiswrapper/wrapndis.c
|
||||
--- linux/3rdparty/ndiswrapper.orig/wrapndis.c 2016-07-04 20:00:13.000000000 +0300
|
||||
+++ linux/3rdparty/ndiswrapper/wrapndis.c 2016-07-04 20:23:29.454819702 +0300
|
||||
@@ -704,7 +704,11 @@ static void tx_worker(struct work_struct
|
||||
n = wnd->max_tx_packets;
|
||||
n = mp_tx_packets(wnd, wnd->tx_ring_start, n);
|
||||
if (n) {
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
|
||||
wnd->net_dev->trans_start = jiffies;
|
||||
+#else
|
||||
+ netif_trans_update(wnd->net_dev);
|
||||
+#endif
|
||||
wnd->tx_ring_start =
|
||||
(wnd->tx_ring_start + n) % TX_RING_SIZE;
|
||||
wnd->is_tx_ring_full = 0;
|
||||
@@ -0,0 +1,7 @@
|
||||
--- linux-2.6.24.orig/3rdparty/ndiswrapper/Kconfig 1969-12-31 21:00:00.000000000 -0300
|
||||
+++ linux-2.6.24/3rdparty/ndiswrapper/Kconfig 2007-11-26 15:11:31.000000000 -0200
|
||||
@@ -0,0 +1,4 @@
|
||||
+
|
||||
+config NDISWRAPPER
|
||||
+ tristate "NDIS driver wrapper support"
|
||||
+ depends on PCI && USB && !X86_64_XEN
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
--- linux-3.12.2-ndiswrapper-1.59/3rdparty/ndiswrapper/Makefile.orig 2013-11-28 21:42:10.000000000 +0200
|
||||
+++ linux-3.12.2-ndiswrapper-1.59/3rdparty/ndiswrapper/Makefile 2013-11-30 21:41:19.550504380 +0200
|
||||
@@ -9,24 +9,10 @@ DISTFILES = \
|
||||
winnt_types.h workqueue.c wrapmem.c wrapmem.h wrapndis.c wrapndis.h \
|
||||
wrapper.c wrapper.h
|
||||
|
||||
-# By default, we try to compile the modules for the currently running
|
||||
-# kernel. But it's the first approximation, as we will re-read the
|
||||
-# version from the kernel sources.
|
||||
-KVERS_UNAME ?= $(shell uname -r)
|
||||
-
|
||||
# KBUILD is the path to the Linux kernel build tree. It is usually the
|
||||
# same as the kernel source tree, except when the kernel was compiled in
|
||||
# a separate directory.
|
||||
-KBUILD ?= $(shell readlink -f /lib/modules/$(KVERS_UNAME)/build)
|
||||
-
|
||||
-ifeq (,$(KBUILD))
|
||||
-$(error Kernel build tree not found - please set KBUILD to configured kernel)
|
||||
-endif
|
||||
-
|
||||
-KCONFIG := $(KBUILD)/.config
|
||||
-ifeq (,$(wildcard $(KCONFIG)))
|
||||
-$(error No .config found in $(KBUILD), please set KBUILD to configured kernel)
|
||||
-endif
|
||||
+KBUILD ?= $(srctree)
|
||||
|
||||
ifneq (,$(wildcard $(KBUILD)/include/linux/version.h))
|
||||
ifneq (,$(wildcard $(KBUILD)/include/generated/uapi/linux/version.h))
|
||||
@@ -43,16 +29,9 @@ endif
|
||||
ifeq (,$(wildcard $(VERSION_H)))
|
||||
VERSION_H := $(KBUILD)/include/linux/version.h
|
||||
endif
|
||||
-ifeq (,$(wildcard $(VERSION_H)))
|
||||
-$(error Please run 'make modules_prepare' in $(KBUILD))
|
||||
-endif
|
||||
|
||||
KVERS := $(shell sed -ne 's/"//g;s/^\#define UTS_RELEASE //p' $(VERSION_H))
|
||||
|
||||
-ifeq (,$(KVERS))
|
||||
-$(error Cannot find UTS_RELEASE in $(VERSION_H), please report)
|
||||
-endif
|
||||
-
|
||||
INST_DIR = /lib/modules/$(KVERS)/misc
|
||||
|
||||
SRC_DIR=$(shell pwd)
|
||||
@@ -0,0 +1,978 @@
|
||||
3rdparty/rfswitch/FILES | 6
|
||||
3rdparty/rfswitch/ISSUES | 28 +++
|
||||
3rdparty/rfswitch/Kconfig | 22 ++
|
||||
3rdparty/rfswitch/LICENSE | 339 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
3rdparty/rfswitch/Makefile | 119 +++++++++++++++
|
||||
3rdparty/rfswitch/README | 44 +++++
|
||||
3rdparty/rfswitch/av5100.c | 174 +++++++++++++++++++++++
|
||||
3rdparty/rfswitch/pbe5.c | 205 +++++++++++++++++++++++++++
|
||||
8 files changed, 937 insertions(+)
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/av5100.c linux-2.6.37.3rdparty/3rdparty/rfswitch/av5100.c
|
||||
--- linux-2.6.37/3rdparty/rfswitch/av5100.c 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/av5100.c 2008-03-28 05:25:28.000000000 +0200
|
||||
@@ -0,0 +1,174 @@
|
||||
+/*******************************************************************************
|
||||
+
|
||||
+ Copyright(c) 2003 - 2004 Intel Corporation. All rights reserved.
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of version 2 of the GNU General Public License as
|
||||
+ published by the Free Software Foundation.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License along with
|
||||
+ this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ The full GNU General Public License is included in this distribution in the
|
||||
+ file called LICENSE.
|
||||
+
|
||||
+ Contact Information:
|
||||
+ James P. Ketrenos <ipw2100-admin@linux.intel.com>
|
||||
+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
+
|
||||
+*******************************************************************************/
|
||||
+#include <linux/compiler.h>
|
||||
+#include <linux/errno.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/netdevice.h>
|
||||
+#include <linux/version.h>
|
||||
+#include <linux/proc_fs.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <asm/uaccess.h>
|
||||
+#include <asm/io.h>
|
||||
+
|
||||
+
|
||||
+#define DRV_NAME "av5100"
|
||||
+#define DRV_VERSION "1.3"
|
||||
+#define DRV_DESCRIPTION "SW RF kill switch for Averatec 5100P"
|
||||
+#define DRV_COPYRIGHT "Copyright(c) 2003-2004 Intel Corporation"
|
||||
+
|
||||
+static int radio = 1;
|
||||
+
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
+
|
||||
+MODULE_PARM(radio, "i");
|
||||
+
|
||||
+#else /* LINUX_VERSION_CODE < 2.6.0 */
|
||||
+
|
||||
+#include <linux/moduleparam.h>
|
||||
+module_param(radio, int, 1);
|
||||
+
|
||||
+#endif /* LINUX_VERSION_CODE < 2.6.0 */
|
||||
+
|
||||
+MODULE_PARM_DESC(radio, "controls state of radio (1=on, 0=off)");
|
||||
+
|
||||
+MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
+MODULE_AUTHOR(DRV_COPYRIGHT);
|
||||
+MODULE_LICENSE("GPL");
|
||||
+
|
||||
+#define AV5100_RADIO_ON (0xe0)
|
||||
+#define AV5100_RADIO_OFF (0xe1)
|
||||
+
|
||||
+static int av5100_radio = AV5100_RADIO_OFF;
|
||||
+
|
||||
+static void av5100_set_radio(int state)
|
||||
+{
|
||||
+ printk(KERN_INFO DRV_NAME ": Radio being turned %s\n",
|
||||
+ (state == AV5100_RADIO_ON) ? "ON" : "OFF");
|
||||
+ outl(0x80020800, 0xcf8);
|
||||
+ outb(0x6f, 0x0072);
|
||||
+ outl(0x1800ffff, 0x1184);
|
||||
+ outb(state, 0x00b2);
|
||||
+ av5100_radio = state;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * proc stuff
|
||||
+ */
|
||||
+static struct proc_dir_entry *dir_base = NULL;
|
||||
+
|
||||
+static int proc_set_radio(struct file *file, const char *buffer,
|
||||
+ unsigned long count, void *data)
|
||||
+{
|
||||
+ av5100_set_radio(buffer[0] == '0' ? AV5100_RADIO_OFF : AV5100_RADIO_ON);
|
||||
+
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static int proc_get_radio(char *page, char **start, off_t offset,
|
||||
+ int count, int *eof, void *data)
|
||||
+{
|
||||
+ int len = 0;
|
||||
+
|
||||
+ len += snprintf(page, count, DRV_NAME ": %d\n",
|
||||
+ av5100_radio == AV5100_RADIO_OFF ? 0 : 1);
|
||||
+
|
||||
+ *eof = 1;
|
||||
+ return len;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void av5100_proc_cleanup(void)
|
||||
+{
|
||||
+ if (dir_base) {
|
||||
+ remove_proc_entry("radio", dir_base);
|
||||
+ remove_proc_entry(DRV_NAME, &proc_root);
|
||||
+ dir_base = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int av5100_proc_init(void)
|
||||
+{
|
||||
+ struct proc_dir_entry *ent;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ dir_base = create_proc_entry(DRV_NAME, S_IFDIR, &proc_root);
|
||||
+ if (dir_base == NULL) {
|
||||
+ printk(KERN_ERR DRV_NAME ": Unable to initialise /proc/"
|
||||
+ DRV_NAME "\n");
|
||||
+ err = -ENOMEM;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ ent = create_proc_entry("radio", S_IFREG | S_IRUGO | S_IWUSR,
|
||||
+ dir_base);
|
||||
+ if (ent) {
|
||||
+ ent->read_proc = proc_get_radio;
|
||||
+ ent->write_proc = proc_set_radio;
|
||||
+ } else {
|
||||
+ printk(KERN_ERR
|
||||
+ "Unable to initialize /proc/" DRV_NAME "/radio\n");
|
||||
+ err = -ENOMEM;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+ fail:
|
||||
+ av5100_proc_cleanup();
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * module stuff
|
||||
+ */
|
||||
+static int __init av5100_init(void)
|
||||
+{
|
||||
+ av5100_proc_init();
|
||||
+
|
||||
+ av5100_set_radio((radio == 1) ? AV5100_RADIO_ON : AV5100_RADIO_OFF);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __exit av5100_exit(void)
|
||||
+{
|
||||
+ av5100_set_radio(AV5100_RADIO_OFF);
|
||||
+
|
||||
+ av5100_proc_cleanup();
|
||||
+}
|
||||
+
|
||||
+module_init(av5100_init);
|
||||
+module_exit(av5100_exit);
|
||||
+
|
||||
+/*
|
||||
+ 1 2 3 4 5 6 7
|
||||
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
+*/
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/FILES linux-2.6.37.3rdparty/3rdparty/rfswitch/FILES
|
||||
--- linux-2.6.37/3rdparty/rfswitch/FILES 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/FILES 2004-07-09 07:44:19.000000000 +0300
|
||||
@@ -0,0 +1,6 @@
|
||||
+Makefile Used for building on 2.4, 2.6, internally and exteranlly
|
||||
+
|
||||
+FILES This file
|
||||
+
|
||||
+av5100.c Averatec 5100P SW Switch Module
|
||||
+pbe5.c Packard Bell Easynote SW Switch Module
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/ISSUES linux-2.6.37.3rdparty/3rdparty/rfswitch/ISSUES
|
||||
--- linux-2.6.37/3rdparty/rfswitch/ISSUES 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/ISSUES 2004-07-09 07:43:22.000000000 +0300
|
||||
@@ -0,0 +1,28 @@
|
||||
+
|
||||
+ISSUES
|
||||
+------------ ----- ----- ---- --- -- -
|
||||
+
|
||||
+No packets! - RF kill switch
|
||||
+
|
||||
+If the module loads, but no packets are transferred you may have a SW based
|
||||
+radio kill switch. All laptops have some capability to disable the radio
|
||||
+via a button or switch. On some laptops that switch is physically tied to the
|
||||
+IPW2100; simply toggling the switch should enable the radio.
|
||||
+
|
||||
+On other laptops, the switch is a button that when pressed requires some
|
||||
+software driver to send some hardware command to some other piece of hardware
|
||||
+on the laptop, that then controls the radio. The driver currently has support
|
||||
+for the Averatec 5100P laptop's SW switch. Support will be added for other
|
||||
+laptop vendors as we become aware of them and figure out how to enable the
|
||||
+radio.
|
||||
+
|
||||
+To know if the radio is being disabled via the RF switch, perform the following:
|
||||
+
|
||||
+% cat /proc/net/ipw2100/eth1/state
|
||||
+Radio is disabled by RF switch
|
||||
+
|
||||
+If it says that, then your RF switch is currently disabling the radio. The
|
||||
+driver doesn't currently support switching back to the on state if you have a
|
||||
+physical RF switch (the radio may turn on and packets will work, but the proc
|
||||
+entry won't be updated)
|
||||
+
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/Kconfig linux-2.6.37.3rdparty/3rdparty/rfswitch/Kconfig
|
||||
--- linux-2.6.37/3rdparty/rfswitch/Kconfig 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/Kconfig 2008-05-27 23:39:10.000000000 +0300
|
||||
@@ -0,0 +1,22 @@
|
||||
+menu "RF Switch"
|
||||
+ depends on EXPERIMENTAL
|
||||
+
|
||||
+config RFSWITCH
|
||||
+ tristate "RF Switch"
|
||||
+ depends on EXPERIMENTAL
|
||||
+
|
||||
+config AVERATEC_5100P
|
||||
+ tristate "averatec 5100P driver"
|
||||
+ depends on RFSWITCH
|
||||
+ ---help---
|
||||
+ This is an experimental driver for the wireless switch
|
||||
+ of some laptops (usefull with some ipw2x00 cards)
|
||||
+
|
||||
+config PACKARDBELL_E5
|
||||
+ tristate "pbe5 driver"
|
||||
+ depends on RFSWITCH
|
||||
+ ---help---
|
||||
+ This is an experimental driver for the wireless switch
|
||||
+ of some laptops (usefull with some ipw2x00 cards)
|
||||
+
|
||||
+endmenu
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/LICENSE linux-2.6.37.3rdparty/3rdparty/rfswitch/LICENSE
|
||||
--- linux-2.6.37/3rdparty/rfswitch/LICENSE 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/LICENSE 2004-07-09 07:43:22.000000000 +0300
|
||||
@@ -0,0 +1,339 @@
|
||||
+
|
||||
+"This software program is licensed subject to the GNU General Public License
|
||||
+(GPL). Version 2, June 1991, available at
|
||||
+<http://www.fsf.org/copyleft/gpl.html>"
|
||||
+
|
||||
+GNU General Public License
|
||||
+
|
||||
+Version 2, June 1991
|
||||
+
|
||||
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
+
|
||||
+Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
+document, but changing it is not allowed.
|
||||
+
|
||||
+Preamble
|
||||
+
|
||||
+The licenses for most software are designed to take away your freedom to
|
||||
+share and change it. By contrast, the GNU General Public License is intended
|
||||
+to guarantee your freedom to share and change free software--to make sure
|
||||
+the software is free for all its users. This General Public License applies
|
||||
+to most of the Free Software Foundation's software and to any other program
|
||||
+whose authors commit to using it. (Some other Free Software Foundation
|
||||
+software is covered by the GNU Library General Public License instead.) You
|
||||
+can apply it to your programs, too.
|
||||
+
|
||||
+When we speak of free software, we are referring to freedom, not price. Our
|
||||
+General Public Licenses are designed to make sure that you have the freedom
|
||||
+to distribute copies of free software (and charge for this service if you
|
||||
+wish), that you receive source code or can get it if you want it, that you
|
||||
+can change the software or use pieces of it in new free programs; and that
|
||||
+you know you can do these things.
|
||||
+
|
||||
+To protect your rights, we need to make restrictions that forbid anyone to
|
||||
+deny you these rights or to ask you to surrender the rights. These
|
||||
+restrictions translate to certain responsibilities for you if you distribute
|
||||
+copies of the software, or if you modify it.
|
||||
+
|
||||
+For example, if you distribute copies of such a program, whether gratis or
|
||||
+for a fee, you must give the recipients all the rights that you have. You
|
||||
+must make sure that they, too, receive or can get the source code. And you
|
||||
+must show them these terms so they know their rights.
|
||||
+
|
||||
+We protect your rights with two steps: (1) copyright the software, and (2)
|
||||
+offer you this license which gives you legal permission to copy, distribute
|
||||
+and/or modify the software.
|
||||
+
|
||||
+Also, for each author's protection and ours, we want to make certain that
|
||||
+everyone understands that there is no warranty for this free software. If
|
||||
+the software is modified by someone else and passed on, we want its
|
||||
+recipients to know that what they have is not the original, so that any
|
||||
+problems introduced by others will not reflect on the original authors'
|
||||
+reputations.
|
||||
+
|
||||
+Finally, any free program is threatened constantly by software patents. We
|
||||
+wish to avoid the danger that redistributors of a free program will
|
||||
+individually obtain patent licenses, in effect making the program
|
||||
+proprietary. To prevent this, we have made it clear that any patent must be
|
||||
+licensed for everyone's free use or not licensed at all.
|
||||
+
|
||||
+The precise terms and conditions for copying, distribution and modification
|
||||
+follow.
|
||||
+
|
||||
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
+
|
||||
+0. This License applies to any program or other work which contains a notice
|
||||
+ placed by the copyright holder saying it may be distributed under the
|
||||
+ terms of this General Public License. The "Program", below, refers to any
|
||||
+ such program or work, and a "work based on the Program" means either the
|
||||
+ Program or any derivative work under copyright law: that is to say, a
|
||||
+ work containing the Program or a portion of it, either verbatim or with
|
||||
+ modifications and/or translated into another language. (Hereinafter,
|
||||
+ translation is included without limitation in the term "modification".)
|
||||
+ Each licensee is addressed as "you".
|
||||
+
|
||||
+ Activities other than copying, distribution and modification are not
|
||||
+ covered by this License; they are outside its scope. The act of running
|
||||
+ the Program is not restricted, and the output from the Program is covered
|
||||
+ only if its contents constitute a work based on the Program (independent
|
||||
+ of having been made by running the Program). Whether that is true depends
|
||||
+ on what the Program does.
|
||||
+
|
||||
+1. You may copy and distribute verbatim copies of the Program's source code
|
||||
+ as you receive it, in any medium, provided that you conspicuously and
|
||||
+ appropriately publish on each copy an appropriate copyright notice and
|
||||
+ disclaimer of warranty; keep intact all the notices that refer to this
|
||||
+ License and to the absence of any warranty; and give any other recipients
|
||||
+ of the Program a copy of this License along with the Program.
|
||||
+
|
||||
+ You may charge a fee for the physical act of transferring a copy, and you
|
||||
+ may at your option offer warranty protection in exchange for a fee.
|
||||
+
|
||||
+2. You may modify your copy or copies of the Program or any portion of it,
|
||||
+ thus forming a work based on the Program, and copy and distribute such
|
||||
+ modifications or work under the terms of Section 1 above, provided that
|
||||
+ you also meet all of these conditions:
|
||||
+
|
||||
+ * a) You must cause the modified files to carry prominent notices stating
|
||||
+ that you changed the files and the date of any change.
|
||||
+
|
||||
+ * b) You must cause any work that you distribute or publish, that in
|
||||
+ whole or in part contains or is derived from the Program or any part
|
||||
+ thereof, to be licensed as a whole at no charge to all third parties
|
||||
+ under the terms of this License.
|
||||
+
|
||||
+ * c) If the modified program normally reads commands interactively when
|
||||
+ run, you must cause it, when started running for such interactive
|
||||
+ use in the most ordinary way, to print or display an announcement
|
||||
+ including an appropriate copyright notice and a notice that there is
|
||||
+ no warranty (or else, saying that you provide a warranty) and that
|
||||
+ users may redistribute the program under these conditions, and
|
||||
+ telling the user how to view a copy of this License. (Exception: if
|
||||
+ the Program itself is interactive but does not normally print such
|
||||
+ an announcement, your work based on the Program is not required to
|
||||
+ print an announcement.)
|
||||
+
|
||||
+ These requirements apply to the modified work as a whole. If identifiable
|
||||
+ sections of that work are not derived from the Program, and can be
|
||||
+ reasonably considered independent and separate works in themselves, then
|
||||
+ this License, and its terms, do not apply to those sections when you
|
||||
+ distribute them as separate works. But when you distribute the same
|
||||
+ sections as part of a whole which is a work based on the Program, the
|
||||
+ distribution of the whole must be on the terms of this License, whose
|
||||
+ permissions for other licensees extend to the entire whole, and thus to
|
||||
+ each and every part regardless of who wrote it.
|
||||
+
|
||||
+ Thus, it is not the intent of this section to claim rights or contest
|
||||
+ your rights to work written entirely by you; rather, the intent is to
|
||||
+ exercise the right to control the distribution of derivative or
|
||||
+ collective works based on the Program.
|
||||
+
|
||||
+ In addition, mere aggregation of another work not based on the Program
|
||||
+ with the Program (or with a work based on the Program) on a volume of a
|
||||
+ storage or distribution medium does not bring the other work under the
|
||||
+ scope of this License.
|
||||
+
|
||||
+3. You may copy and distribute the Program (or a work based on it, under
|
||||
+ Section 2) in object code or executable form under the terms of Sections
|
||||
+ 1 and 2 above provided that you also do one of the following:
|
||||
+
|
||||
+ * a) Accompany it with the complete corresponding machine-readable source
|
||||
+ code, which must be distributed under the terms of Sections 1 and 2
|
||||
+ above on a medium customarily used for software interchange; or,
|
||||
+
|
||||
+ * b) Accompany it with a written offer, valid for at least three years,
|
||||
+ to give any third party, for a charge no more than your cost of
|
||||
+ physically performing source distribution, a complete machine-
|
||||
+ readable copy of the corresponding source code, to be distributed
|
||||
+ under the terms of Sections 1 and 2 above on a medium customarily
|
||||
+ used for software interchange; or,
|
||||
+
|
||||
+ * c) Accompany it with the information you received as to the offer to
|
||||
+ distribute corresponding source code. (This alternative is allowed
|
||||
+ only for noncommercial distribution and only if you received the
|
||||
+ program in object code or executable form with such an offer, in
|
||||
+ accord with Subsection b above.)
|
||||
+
|
||||
+ The source code for a work means the preferred form of the work for
|
||||
+ making modifications to it. For an executable work, complete source code
|
||||
+ means all the source code for all modules it contains, plus any
|
||||
+ associated interface definition files, plus the scripts used to control
|
||||
+ compilation and installation of the executable. However, as a special
|
||||
+ exception, the source code distributed need not include anything that is
|
||||
+ normally distributed (in either source or binary form) with the major
|
||||
+ components (compiler, kernel, and so on) of the operating system on which
|
||||
+ the executable runs, unless that component itself accompanies the
|
||||
+ executable.
|
||||
+
|
||||
+ If distribution of executable or object code is made by offering access
|
||||
+ to copy from a designated place, then offering equivalent access to copy
|
||||
+ the source code from the same place counts as distribution of the source
|
||||
+ code, even though third parties are not compelled to copy the source
|
||||
+ along with the object code.
|
||||
+
|
||||
+4. You may not copy, modify, sublicense, or distribute the Program except as
|
||||
+ expressly provided under this License. Any attempt otherwise to copy,
|
||||
+ modify, sublicense or distribute the Program is void, and will
|
||||
+ automatically terminate your rights under this License. However, parties
|
||||
+ who have received copies, or rights, from you under this License will not
|
||||
+ have their licenses terminated so long as such parties remain in full
|
||||
+ compliance.
|
||||
+
|
||||
+5. You are not required to accept this License, since you have not signed
|
||||
+ it. However, nothing else grants you permission to modify or distribute
|
||||
+ the Program or its derivative works. These actions are prohibited by law
|
||||
+ if you do not accept this License. Therefore, by modifying or
|
||||
+ distributing the Program (or any work based on the Program), you
|
||||
+ indicate your acceptance of this License to do so, and all its terms and
|
||||
+ conditions for copying, distributing or modifying the Program or works
|
||||
+ based on it.
|
||||
+
|
||||
+6. Each time you redistribute the Program (or any work based on the
|
||||
+ Program), the recipient automatically receives a license from the
|
||||
+ original licensor to copy, distribute or modify the Program subject to
|
||||
+ these terms and conditions. You may not impose any further restrictions
|
||||
+ on the recipients' exercise of the rights granted herein. You are not
|
||||
+ responsible for enforcing compliance by third parties to this License.
|
||||
+
|
||||
+7. If, as a consequence of a court judgment or allegation of patent
|
||||
+ infringement or for any other reason (not limited to patent issues),
|
||||
+ conditions are imposed on you (whether by court order, agreement or
|
||||
+ otherwise) that contradict the conditions of this License, they do not
|
||||
+ excuse you from the conditions of this License. If you cannot distribute
|
||||
+ so as to satisfy simultaneously your obligations under this License and
|
||||
+ any other pertinent obligations, then as a consequence you may not
|
||||
+ distribute the Program at all. For example, if a patent license would
|
||||
+ not permit royalty-free redistribution of the Program by all those who
|
||||
+ receive copies directly or indirectly through you, then the only way you
|
||||
+ could satisfy both it and this License would be to refrain entirely from
|
||||
+ distribution of the Program.
|
||||
+
|
||||
+ If any portion of this section is held invalid or unenforceable under any
|
||||
+ particular circumstance, the balance of the section is intended to apply
|
||||
+ and the section as a whole is intended to apply in other circumstances.
|
||||
+
|
||||
+ It is not the purpose of this section to induce you to infringe any
|
||||
+ patents or other property right claims or to contest validity of any
|
||||
+ such claims; this section has the sole purpose of protecting the
|
||||
+ integrity of the free software distribution system, which is implemented
|
||||
+ by public license practices. Many people have made generous contributions
|
||||
+ to the wide range of software distributed through that system in
|
||||
+ reliance on consistent application of that system; it is up to the
|
||||
+ author/donor to decide if he or she is willing to distribute software
|
||||
+ through any other system and a licensee cannot impose that choice.
|
||||
+
|
||||
+ This section is intended to make thoroughly clear what is believed to be
|
||||
+ a consequence of the rest of this License.
|
||||
+
|
||||
+8. If the distribution and/or use of the Program is restricted in certain
|
||||
+ countries either by patents or by copyrighted interfaces, the original
|
||||
+ copyright holder who places the Program under this License may add an
|
||||
+ explicit geographical distribution limitation excluding those countries,
|
||||
+ so that distribution is permitted only in or among countries not thus
|
||||
+ excluded. In such case, this License incorporates the limitation as if
|
||||
+ written in the body of this License.
|
||||
+
|
||||
+9. The Free Software Foundation may publish revised and/or new versions of
|
||||
+ the General Public License from time to time. Such new versions will be
|
||||
+ similar in spirit to the present version, but may differ in detail to
|
||||
+ address new problems or concerns.
|
||||
+
|
||||
+ Each version is given a distinguishing version number. If the Program
|
||||
+ specifies a version number of this License which applies to it and "any
|
||||
+ later version", you have the option of following the terms and
|
||||
+ conditions either of that version or of any later version published by
|
||||
+ the Free Software Foundation. If the Program does not specify a version
|
||||
+ number of this License, you may choose any version ever published by the
|
||||
+ Free Software Foundation.
|
||||
+
|
||||
+10. If you wish to incorporate parts of the Program into other free programs
|
||||
+ whose distribution conditions are different, write to the author to ask
|
||||
+ for permission. For software which is copyrighted by the Free Software
|
||||
+ Foundation, write to the Free Software Foundation; we sometimes make
|
||||
+ exceptions for this. Our decision will be guided by the two goals of
|
||||
+ preserving the free status of all derivatives of our free software and
|
||||
+ of promoting the sharing and reuse of software generally.
|
||||
+
|
||||
+ NO WARRANTY
|
||||
+
|
||||
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
+ EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
+ ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
|
||||
+ YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
+ NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
+
|
||||
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
|
||||
+ DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
|
||||
+ DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
|
||||
+ (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
|
||||
+ INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
|
||||
+ THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
|
||||
+ OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
+
|
||||
+END OF TERMS AND CONDITIONS
|
||||
+
|
||||
+How to Apply These Terms to Your New Programs
|
||||
+
|
||||
+If you develop a new program, and you want it to be of the greatest
|
||||
+possible use to the public, the best way to achieve this is to make it free
|
||||
+software which everyone can redistribute and change under these terms.
|
||||
+
|
||||
+To do so, attach the following notices to the program. It is safest to
|
||||
+attach them to the start of each source file to most effectively convey the
|
||||
+exclusion of warranty; and each file should have at least the "copyright"
|
||||
+line and a pointer to where the full notice is found.
|
||||
+
|
||||
+one line to give the program's name and an idea of what it does.
|
||||
+Copyright (C) yyyy name of author
|
||||
+
|
||||
+This program is free software; you can redistribute it and/or modify it
|
||||
+under the terms of the GNU General Public License as published by the Free
|
||||
+Software Foundation; either version 2 of the License, or (at your option)
|
||||
+any later version.
|
||||
+
|
||||
+This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+more details.
|
||||
+
|
||||
+You should have received a copy of the GNU General Public License along with
|
||||
+this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
+Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+Also add information on how to contact you by electronic and paper mail.
|
||||
+
|
||||
+If the program is interactive, make it output a short notice like this when
|
||||
+it starts in an interactive mode:
|
||||
+
|
||||
+Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
|
||||
+with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free
|
||||
+software, and you are welcome to redistribute it under certain conditions;
|
||||
+type 'show c' for details.
|
||||
+
|
||||
+The hypothetical commands 'show w' and 'show c' should show the appropriate
|
||||
+parts of the General Public License. Of course, the commands you use may be
|
||||
+called something other than 'show w' and 'show c'; they could even be
|
||||
+mouse-clicks or menu items--whatever suits your program.
|
||||
+
|
||||
+You should also get your employer (if you work as a programmer) or your
|
||||
+school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
+necessary. Here is a sample; alter the names:
|
||||
+
|
||||
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
+'Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
+
|
||||
+signature of Ty Coon, 1 April 1989
|
||||
+Ty Coon, President of Vice
|
||||
+
|
||||
+This General Public License does not permit incorporating your program into
|
||||
+proprietary programs. If your program is a subroutine library, you may
|
||||
+consider it more useful to permit linking proprietary applications with the
|
||||
+library. If this is what you want to do, use the GNU Library General Public
|
||||
+License instead of this License.
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/Makefile linux-2.6.37.3rdparty/3rdparty/rfswitch/Makefile
|
||||
--- linux-2.6.37/3rdparty/rfswitch/Makefile 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/Makefile 2008-03-28 05:17:16.000000000 +0200
|
||||
@@ -0,0 +1,119 @@
|
||||
+#
|
||||
+# Makefile for the SW RF Switch kernel modules
|
||||
+#
|
||||
+# NOTE: This make file can serve as both an external Makefile (launched
|
||||
+# directly by the user), or as the sub-dir Makefile used by the kernel
|
||||
+# build system.
|
||||
+
|
||||
+
|
||||
+CONFIG_AVERATEC_5100P=m
|
||||
+CONFIG_PACKARDBELL_E5=m
|
||||
+
|
||||
+
|
||||
+
|
||||
+list-m :=
|
||||
+list-$(CONFIG_AVERATEC_5100P) += av5100
|
||||
+list-$(CONFIG_PACKARDBELL_E5) += pbe5
|
||||
+
|
||||
+
|
||||
+obj-$(CONFIG_AVERATEC_5100P) += av5100.o
|
||||
+obj-$(CONFIG_PACKARDBELL_E5) += pbe5.o
|
||||
+
|
||||
+#
|
||||
+# Begin dual Makefile mode here. First we provide support for when we
|
||||
+# are being invoked by the kernel build system
|
||||
+#
|
||||
+ifneq ($(KERNELRELEASE),)
|
||||
+
|
||||
+ifneq ($(PATCHLEVEL),6) # If we are not on a 2.6, then do 2.4 specific things
|
||||
+
|
||||
+O_TARGET := rfswitch.o
|
||||
+
|
||||
+include $(TOPDIR)/Rules.make
|
||||
+
|
||||
+endif # End if 2.4 specific settings
|
||||
+
|
||||
+else
|
||||
+# Here we begin the portion that is executed if the user invoked this Makefile
|
||||
+# directly.
|
||||
+
|
||||
+# KSRC should be set to the path to your sources
|
||||
+# modules are installed into KMISC
|
||||
+KVER := $(shell uname -r)
|
||||
+KSRC := /lib/modules/$(KVER)/build
|
||||
+KMISC := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
||||
+
|
||||
+# KSRC_OUTPUT should be overridden if you are using a 2.6 kernel that
|
||||
+# has it's output sent elsewhere via KBUILD_OUTPUT= or O=
|
||||
+KSRC_OUTPUT := $(KSRC)
|
||||
+
|
||||
+# If we find Rules.make, we can assume we're using the old 2.4 style building
|
||||
+OLDMAKE=$(wildcard $(KSRC)/Rules.make)
|
||||
+PWD=$(shell pwd)
|
||||
+
|
||||
+VERFILE := $(KSRC_OUTPUT)/include/linux/version.h
|
||||
+KERNELRELEASE := $(shell \
|
||||
+ if [ -r $(VERFILE) ]; then \
|
||||
+ (cat $(VERFILE); echo UTS_RELEASE) | \
|
||||
+ $(CC) -I$(KSRC_OUTPUT) $(CFLAGS) -E - | \
|
||||
+ tail -n 1 | \
|
||||
+ xargs echo; \
|
||||
+ else \
|
||||
+ uname -r; \
|
||||
+ fi)
|
||||
+
|
||||
+MODPATH := $(DESTDIR)/lib/modules/$(KERNELRELEASE)
|
||||
+
|
||||
+all: modules
|
||||
+
|
||||
+clean:
|
||||
+ rm -f *.mod.c *.mod *.o *.ko .*.cmd .*.flags Modules.symvers
|
||||
+ rm -rf $(PWD)/tmp
|
||||
+
|
||||
+
|
||||
+ifeq ($(OLDMAKE),)
|
||||
+
|
||||
+TMP=$(PWD)/tmp
|
||||
+MODVERDIR=$(TMP)/.tmp_versions
|
||||
+
|
||||
+modules:
|
||||
+ifdef ($(KSRC_OUTPUT)/.tmp_versions)
|
||||
+ mkdir -p $(MODVERDIR)
|
||||
+ -cp $(KSRC_OUTPUT)/.tmp_versions/*.mod $(MODVERDIR)
|
||||
+endif
|
||||
+ifeq ($(KSRC),$(KSRC_OUTPUT)) # We're not outputting elsewhere
|
||||
+ifdef ($(KSRC)/.tmp_versions)
|
||||
+ -cp $(KSRC)/.tmp_versions/*.mod $(MODVERDIR)
|
||||
+endif
|
||||
+ $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) MODVERDIR=$(MODVERDIR) modules
|
||||
+else # We've got a kernel with seperate output, copy the config, and use O=
|
||||
+ mkdir -p $(TMP)
|
||||
+ cp $(KSRC_OUTPUT)/.config $(TMP)
|
||||
+ $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) MODVERDIR=$(MODVERDIR) O=$(PWD)/tmp modules
|
||||
+endif
|
||||
+
|
||||
+install: modules
|
||||
+ install -d $(KMISC)
|
||||
+ install -m 644 -c $(addsuffix .ko,$(list-m)) $(KMISC)
|
||||
+ /sbin/depmod -a
|
||||
+
|
||||
+
|
||||
+else # We're on 2.4, and things are slightly different
|
||||
+
|
||||
+modules:
|
||||
+ $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) BUILD_DIR=$(PWD) modules
|
||||
+
|
||||
+install: modules
|
||||
+ install -d $(KMISC)
|
||||
+ install -m 644 -c $(addsuffix .o,$(list-m)) $(KMISC)
|
||||
+ /sbin/depmod -a
|
||||
+
|
||||
+endif
|
||||
+
|
||||
+uninstall:
|
||||
+ cd $(KMISC)
|
||||
+ rm -rf $(addsuffix .ko,$(list-m))
|
||||
+ cd -
|
||||
+ /sbin/depmod -a
|
||||
+
|
||||
+endif
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/pbe5.c linux-2.6.37.3rdparty/3rdparty/rfswitch/pbe5.c
|
||||
--- linux-2.6.37/3rdparty/rfswitch/pbe5.c 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/pbe5.c 2008-03-28 05:25:16.000000000 +0200
|
||||
@@ -0,0 +1,205 @@
|
||||
+/*******************************************************************************
|
||||
+
|
||||
+ This program is free software; you can redistribute it and/or modify it
|
||||
+ under the terms of version 2 of the GNU General Public License as
|
||||
+ published by the Free Software Foundation.
|
||||
+
|
||||
+ This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
+ more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU General Public License along with
|
||||
+ this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
+ Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+
|
||||
+ The full GNU General Public License is included in this distribution in the
|
||||
+ file called LICENSE.
|
||||
+
|
||||
+ Author:
|
||||
+ Pedro Ramalhais <pmr09313@students.fct.unl.pt>
|
||||
+
|
||||
+ Based on:
|
||||
+ av5100.c from http://ipw2100.sourceforge.net/
|
||||
+
|
||||
+*******************************************************************************/
|
||||
+
|
||||
+#include <linux/compiler.h>
|
||||
+#include <linux/errno.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/netdevice.h>
|
||||
+#include <linux/version.h>
|
||||
+#include <linux/proc_fs.h>
|
||||
+#include <linux/ioport.h>
|
||||
+#include <asm/uaccess.h>
|
||||
+#include <asm/io.h>
|
||||
+
|
||||
+#define DRV_NAME "pbe5"
|
||||
+#define DRV_VERSION "1.3"
|
||||
+#define DRV_DESCRIPTION "SW RF kill switch for Packard Bell EasyNote E5"
|
||||
+#define DRV_AUTHOR "Pedro Ramalhais"
|
||||
+#define DRV_LICENSE "GPL"
|
||||
+
|
||||
+static int radio = 1;
|
||||
+
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
|
||||
+
|
||||
+MODULE_PARM(radio, "i");
|
||||
+
|
||||
+#else /* LINUX_VERSION_CODE < 2.6.0 */
|
||||
+
|
||||
+#include <linux/moduleparam.h>
|
||||
+module_param(radio, int, 1);
|
||||
+
|
||||
+#endif /* LINUX_VERSION_CODE < 2.6.0 */
|
||||
+
|
||||
+MODULE_PARM_DESC(radio, "controls state of radio (1=on, 0=off)");
|
||||
+
|
||||
+MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
+MODULE_AUTHOR(DRV_AUTHOR);
|
||||
+MODULE_LICENSE(DRV_LICENSE);
|
||||
+
|
||||
+/*
|
||||
+ * NOTE: These values were obtained from disassembling the Icon.exe program
|
||||
+ * installed in the Packard Bell EasyNote E5 laptop. The names were guessed,
|
||||
+ * so don't rely on them.
|
||||
+ */
|
||||
+#define PBE5_PORT_TOGGLE 0x0b3
|
||||
+#define PBE5_VALUE_TOGGLE_ON 0x01
|
||||
+#define PBE5_VALUE_TOGGLE_OFF 0x00
|
||||
+#define PBE5_PORT_APPLY 0x0b2
|
||||
+#define PBE5_VALUE_APPLY 0xef
|
||||
+
|
||||
+// Some "booleans" =;-)
|
||||
+#define PBE5_RADIO_OFF 0
|
||||
+#define PBE5_RADIO_ON 1
|
||||
+
|
||||
+static int pbe5_radio_status = PBE5_RADIO_ON;
|
||||
+
|
||||
+unsigned char pbe5_get_radio(void)
|
||||
+{
|
||||
+ unsigned char val = 0x00;
|
||||
+
|
||||
+ val = inb(PBE5_PORT_TOGGLE);
|
||||
+
|
||||
+ return val;
|
||||
+}
|
||||
+
|
||||
+static void pbe5_set_radio(int state_set)
|
||||
+{
|
||||
+ pbe5_radio_status = pbe5_get_radio();
|
||||
+
|
||||
+ if (pbe5_radio_status != state_set) {
|
||||
+ // Set the radio toggle register
|
||||
+ outb(PBE5_VALUE_TOGGLE_ON, PBE5_PORT_TOGGLE);
|
||||
+ // Commit the radio toggle register value
|
||||
+ outb(PBE5_VALUE_APPLY, PBE5_PORT_APPLY);
|
||||
+ // Update the radio status
|
||||
+ pbe5_radio_status = pbe5_get_radio();
|
||||
+
|
||||
+ printk(KERN_INFO DRV_NAME ": Radio turned %s\n",
|
||||
+ (state_set == PBE5_RADIO_ON) ? "ON" : "OFF");
|
||||
+ } else {
|
||||
+ printk(KERN_INFO DRV_NAME ": Radio already %s\n",
|
||||
+ (state_set == PBE5_RADIO_ON) ? "ON" : "OFF");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * proc stuff
|
||||
+ */
|
||||
+static struct proc_dir_entry *dir_base = NULL;
|
||||
+
|
||||
+static int proc_set_radio(struct file *file, const char *buffer,
|
||||
+ unsigned long count, void *data)
|
||||
+{
|
||||
+ pbe5_set_radio(buffer[0] == '0' ? PBE5_RADIO_OFF : PBE5_RADIO_ON);
|
||||
+
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static int proc_get_radio(char *page, char **start, off_t offset,
|
||||
+ int count, int *eof, void *data)
|
||||
+{
|
||||
+ int len = 0;
|
||||
+
|
||||
+ len += snprintf(page, count, DRV_NAME ": %d\n",
|
||||
+ pbe5_radio_status == PBE5_RADIO_OFF ? 0 : 1);
|
||||
+
|
||||
+ *eof = 1;
|
||||
+ return len;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static void pbe5_proc_cleanup(void)
|
||||
+{
|
||||
+ if (dir_base) {
|
||||
+ remove_proc_entry("radio", dir_base);
|
||||
+ remove_proc_entry(DRV_NAME, &proc_root);
|
||||
+ dir_base = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int pbe5_proc_init(void)
|
||||
+{
|
||||
+ struct proc_dir_entry *ent;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ dir_base = create_proc_entry(DRV_NAME, S_IFDIR, &proc_root);
|
||||
+ if (dir_base == NULL) {
|
||||
+ printk(KERN_ERR DRV_NAME ": Unable to initialise /proc/"
|
||||
+ DRV_NAME "\n");
|
||||
+ err = -ENOMEM;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ ent = create_proc_entry("radio", S_IFREG | S_IRUGO | S_IWUSR,
|
||||
+ dir_base);
|
||||
+ if (ent) {
|
||||
+ ent->read_proc = proc_get_radio;
|
||||
+ ent->write_proc = proc_set_radio;
|
||||
+ } else {
|
||||
+ printk(KERN_ERR
|
||||
+ "Unable to initialize /proc/" DRV_NAME "/radio\n");
|
||||
+ err = -ENOMEM;
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+ fail:
|
||||
+ pbe5_proc_cleanup();
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * module stuff
|
||||
+ */
|
||||
+static int __init pbe5_init(void)
|
||||
+{
|
||||
+ pbe5_proc_init();
|
||||
+
|
||||
+ pbe5_set_radio((radio == 1) ? PBE5_RADIO_ON : PBE5_RADIO_OFF);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __exit pbe5_exit(void)
|
||||
+{
|
||||
+ pbe5_set_radio(PBE5_RADIO_OFF);
|
||||
+
|
||||
+ pbe5_proc_cleanup();
|
||||
+}
|
||||
+
|
||||
+module_init(pbe5_init);
|
||||
+module_exit(pbe5_exit);
|
||||
+
|
||||
+/*
|
||||
+ 1 2 3 4 5 6 7
|
||||
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
+*/
|
||||
diff -Nurp linux-2.6.37/3rdparty/rfswitch/README linux-2.6.37.3rdparty/3rdparty/rfswitch/README
|
||||
--- linux-2.6.37/3rdparty/rfswitch/README 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/rfswitch/README 2004-07-09 17:26:20.000000000 +0300
|
||||
@@ -0,0 +1,44 @@
|
||||
+Radio Kill Switch
|
||||
+------------ ----- ----- ---- --- -- -
|
||||
+Most laptops provide the ability for the user to physically disable the radio.
|
||||
+Some vendors have implemented this as a physical switch that requires no
|
||||
+software to turn the radio off and on. On other laptops, however, the switch
|
||||
+is controlled through a button being pressed and a software driver then making
|
||||
+calls to turn the radio off and on. This is referred to as a "software based
|
||||
+RF kill switch"
|
||||
+
|
||||
+Currently this project provides modules for controlling the software RF kill
|
||||
+switch on the Averatec 5100P and Packard Bell EasyNote E5. The code may work
|
||||
+on other laptops, but these are the only models on which it has been tested.
|
||||
+
|
||||
+To determine if you have a system that might be compatible with one of the
|
||||
+provided SW RF Kill switch modules, you can run:
|
||||
+
|
||||
+
|
||||
+ To check for the Packard Bell (to use module pbe) --
|
||||
+
|
||||
+ % dd if=/dev/mem bs=1 skip=983040 count=65535 2>/dev/null | strings | egrep "NEW-PC|Insyde Software MobilePRO BIOS"
|
||||
+
|
||||
+ To check for the Averatec (to use module av5100) --
|
||||
+
|
||||
+ % dd if=/dev/mem bs=1 skip=983040 count=65535 2>/dev/null | strings | egrep "AVERATEC"
|
||||
+
|
||||
+If you have one of those laptop models you can imply loading the av5100/pbe5
|
||||
+module and the radio will be toggled on and off. In addition, you can turn
|
||||
+the driver on and off by writing either a 1 or 0 to /proc/av5100/radio or
|
||||
+/proc/pbe5/radio. If you automatically load the av5100/pbe5 module when your
|
||||
+system boots, you may wish to use the radio module parameter to control the
|
||||
+state of the radio upon loading:
|
||||
+
|
||||
+ modprobe av5100 radio=0
|
||||
+ modprobe pbe5 radio=0
|
||||
+
|
||||
+results in the module loading with the radio turned off. You can then turn the
|
||||
+radio on by:
|
||||
+
|
||||
+ echo 1 > /proc/av5100/radio
|
||||
+ echo 1 > /proc/pbe5/radio
|
||||
+
|
||||
+If you have a SW RF kill switch and can not use one of the above modules,
|
||||
+please join us on IRC (irc.freenode.net) on channel #ipw2100 and someone may
|
||||
+be able to help.
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
fix build with 3.0
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
3rdparty/rfswitch/Makefile | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
--- a/3rdparty/rfswitch/Makefile.orig 2011-07-15 02:37:27.000000000 +0300
|
||||
+++ a/3rdparty/rfswitch/Makefile 2011-07-15 13:47:10.463914526 +0300
|
||||
@@ -29,8 +29,6 @@ ifneq ($(PATCHLEVEL),6) # If we are not
|
||||
|
||||
O_TARGET := rfswitch.o
|
||||
|
||||
-include $(TOPDIR)/Rules.make
|
||||
-
|
||||
endif # End if 2.4 specific settings
|
||||
|
||||
else
|
||||
@@ -0,0 +1,51 @@
|
||||
Remove 'proc_root' usage
|
||||
|
||||
Commit c74c120a21d87b0b6925ada5830d8cac21e852d9 (Linus's tree) removed
|
||||
the export of 'proc_root' variable, because you can create on the proc's
|
||||
root directory by passing NULL where you would pass 'proc_root'.
|
||||
|
||||
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
|
||||
Index: linux-2.6.25/3rdparty/rfswitch/av5100.c
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/3rdparty/rfswitch/av5100.c
|
||||
+++ linux-2.6.25/3rdparty/rfswitch/av5100.c
|
||||
@@ -107,7 +107,7 @@ static void av5100_proc_cleanup(void)
|
||||
{
|
||||
if (dir_base) {
|
||||
remove_proc_entry("radio", dir_base);
|
||||
- remove_proc_entry(DRV_NAME, &proc_root);
|
||||
+ remove_proc_entry(DRV_NAME, NULL);
|
||||
dir_base = NULL;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ static int av5100_proc_init(void)
|
||||
struct proc_dir_entry *ent;
|
||||
int err = 0;
|
||||
|
||||
- dir_base = create_proc_entry(DRV_NAME, S_IFDIR, &proc_root);
|
||||
+ dir_base = create_proc_entry(DRV_NAME, S_IFDIR, NULL);
|
||||
if (dir_base == NULL) {
|
||||
printk(KERN_ERR DRV_NAME ": Unable to initialise /proc/"
|
||||
DRV_NAME "\n");
|
||||
Index: linux-2.6.25/3rdparty/rfswitch/pbe5.c
|
||||
===================================================================
|
||||
--- linux-2.6.25.orig/3rdparty/rfswitch/pbe5.c
|
||||
+++ linux-2.6.25/3rdparty/rfswitch/pbe5.c
|
||||
@@ -138,7 +138,7 @@ static void pbe5_proc_cleanup(void)
|
||||
{
|
||||
if (dir_base) {
|
||||
remove_proc_entry("radio", dir_base);
|
||||
- remove_proc_entry(DRV_NAME, &proc_root);
|
||||
+ remove_proc_entry(DRV_NAME, NULL);
|
||||
dir_base = NULL;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ static int pbe5_proc_init(void)
|
||||
struct proc_dir_entry *ent;
|
||||
int err = 0;
|
||||
|
||||
- dir_base = create_proc_entry(DRV_NAME, S_IFDIR, &proc_root);
|
||||
+ dir_base = create_proc_entry(DRV_NAME, S_IFDIR, NULL);
|
||||
if (dir_base == NULL) {
|
||||
printk(KERN_ERR DRV_NAME ": Unable to initialise /proc/"
|
||||
DRV_NAME "\n");
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,189 @@
|
||||
3rdparty/viahss/Kconfig | 14 +++++++
|
||||
3rdparty/viahss/Makefile | 3 +
|
||||
3rdparty/viahss/README.html | 68 ++++++++++++++++++++++++++++++++++++
|
||||
3rdparty/viahss/viahss.c | 83 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
4 files changed, 168 insertions(+)
|
||||
diff -Nurp linux-2.6.37/3rdparty/viahss/Kconfig linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig
|
||||
--- linux-2.6.37/3rdparty/viahss/Kconfig 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Kconfig 2003-12-01 01:53:51.000000000 +0200
|
||||
@@ -0,0 +1,14 @@
|
||||
+config VIAHSS
|
||||
+ tristate "VIA High Speed Serial"
|
||||
+ depends on SERIAL_CORE && m
|
||||
+ ---help---
|
||||
+ VIA High Speed Serial is a little kernel module (1 KB) which enables
|
||||
+ high speed serial port modes of VIA VT82C686A or VT82C686B
|
||||
+ southbridge-equipped motherboards. With this module, you can use the
|
||||
+ serial port at 230400 bit/s so that you can get the full 128000 bit/s
|
||||
+ from ISDN-TA. The module has been tested with both 686A and 686B
|
||||
+ chipsets.
|
||||
+
|
||||
+ To compile this driver as a module, choose M here: the
|
||||
+ module will be called viahss.
|
||||
+
|
||||
diff -Nurp linux-2.6.37/3rdparty/viahss/Makefile linux-2.6.37.3rdparty/3rdparty/viahss/Makefile
|
||||
--- linux-2.6.37/3rdparty/viahss/Makefile 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/viahss/Makefile 2003-12-01 01:43:23.000000000 +0200
|
||||
@@ -0,0 +1,3 @@
|
||||
+
|
||||
+obj-$(CONFIG_VIAHSS) += viahss.o
|
||||
+
|
||||
diff -Nurp linux-2.6.37/3rdparty/viahss/README.html linux-2.6.37.3rdparty/3rdparty/viahss/README.html
|
||||
--- linux-2.6.37/3rdparty/viahss/README.html 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/viahss/README.html 2003-12-01 01:58:23.000000000 +0200
|
||||
@@ -0,0 +1,68 @@
|
||||
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
+<html>
|
||||
+<head>
|
||||
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
+ <title>High speed serial port for VIA VT82C686 chipsets for linux</title>
|
||||
+</head>
|
||||
+<body>
|
||||
+<H3>Setting the serial port speed over 115,200bps</H3>
|
||||
+<br>
|
||||
+If you have motherboard which has VIA VT82C686A or VT82C686B chipset
|
||||
+you can set serial ports in high speed mode with this kernel module.
|
||||
+I use module with external ISDN-TA and haven't had any problems
|
||||
+so far but I cannot guarantee that you won't have buffer overflows if
|
||||
+you use full 230K or 460K speed all the time (FIFO's are still 16550A size).
|
||||
+ISDN with two channels maxes out at 128 Kb which means that it doesn't
|
||||
+really stress serial ports at 230400. Unlike SHSMOD-patches you don't have
|
||||
+to patch serial driver and module takes only 1KB of memory when it's
|
||||
+loaded which should leave enough room for other programs. It should
|
||||
+be also possible to make this work from userspace but accessing
|
||||
+pci devices is so much easier from kernel.
|
||||
+
|
||||
+<H3>How to use module</H3>
|
||||
+Get the <A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>package</A>
|
||||
+and compile it using included makefiles.
|
||||
+<H3>For 2.4</H3>
|
||||
+If you have kernel in some other location than /usr/src/linux edit Makefile
|
||||
+before compiling. You can also install module with "make install". After
|
||||
+you have loaded module in kernel (use modprobe or insmod) you can set serial
|
||||
+ports to use high speed modes with setserial.<br>
|
||||
+<H3>For 2.5/2.6</H3>
|
||||
+Copy Makefile-2.6 on top of Makefile and do make. After loading module set
|
||||
+serial speed with setserial. (NOTE: This gives a warning on depracated
|
||||
+method).
|
||||
+
|
||||
+<br>
|
||||
+# setserial /dev/ttyS0 spd_cust divisor 0x8002
|
||||
+<br><br>
|
||||
+which sets COM1: speed to 230400. With 0x8001 you should get 460800
|
||||
+but I haven't tested it. If you want to use COM2: use ttyS1 instead of ttyS0.
|
||||
+
|
||||
+After this you should set program which you are using to use 38400 bps
|
||||
+speed which is now actually 230K or 460K. For more information check
|
||||
+setserial man page (spd_cust).
|
||||
+
|
||||
+You can use serial port work as normal if you do<br>
|
||||
+<br>
|
||||
+# setserial /dev/ttyS0 spd_normal <br><br>
|
||||
+After this you can also remove viahss module with rmmod if you need to. Module doesn't intefere with normal serial port usage so you can leave
|
||||
+it loaded if you don't need that extra 1KB which module uses.
|
||||
+<H3>Download</H3>
|
||||
+<A href=http://www.kati.fi/viahss/viahss-0.92.tar.gz>viahss-0.92.tar.gz</A>
|
||||
+
|
||||
+<H3>Acknowledgments</H3>
|
||||
+
|
||||
+Thanks to Kimmo Rintala for help with divisor settings.<br>
|
||||
+I also like to thank Jeff Garzik for help with VIA datasheets.<br>
|
||||
+Port to 2.5/2.6 by Kingsly John with the help of <A href=http://lwn.net>LWN</A>
|
||||
+
|
||||
+<H3>Version History</H3>
|
||||
+0.90 First release<br>
|
||||
+0.91 Fixed Makefile <br>
|
||||
+0.92 Fixed for 2.5/2.6<br>
|
||||
+
|
||||
+<H3>Contact</H3>
|
||||
+
|
||||
+You can reach me by email: <A href=mailto:jrauti@iki.fi>jrauti@iki.fi</A>
|
||||
+</body>
|
||||
+</html>
|
||||
diff -Nurp linux-2.6.37/3rdparty/viahss/viahss.c linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c
|
||||
--- linux-2.6.37/3rdparty/viahss/viahss.c 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ linux-2.6.37.3rdparty/3rdparty/viahss/viahss.c 2003-07-17 09:49:59.000000000 +0300
|
||||
@@ -0,0 +1,83 @@
|
||||
+/*
|
||||
+ * VIA VT 82c686[AB] high speed serial port enabler
|
||||
+ * Version 0.92
|
||||
+ * Copyright (c) 2000-2001 Juhani Rautiainen <jrauti@iki.fi>
|
||||
+ *
|
||||
+ * 0.92:
|
||||
+ * Ported to 2.5/2.6 by Kingsly John
|
||||
+ * - Corrected locking (no more cli() and sti())
|
||||
+ * - New makefile
|
||||
+ *
|
||||
+ * Can be freely distributed and used under the terms of the GNU GPL.
|
||||
+*/
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/config.h>
|
||||
+#include <linux/version.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/pci.h>
|
||||
+
|
||||
+const unsigned short confindex=0x3F0,confdata=0x3F1;
|
||||
+const unsigned char spcidx=0xEE;
|
||||
+
|
||||
+spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
|
||||
+
|
||||
+static int __init viahss_init(void)
|
||||
+{
|
||||
+ struct pci_dev *pcidev = NULL;
|
||||
+ unsigned char confval,val;
|
||||
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
||||
+ if (pcidev) {
|
||||
+ spin_lock_irq(&driver_lock);
|
||||
+ /* start config */
|
||||
+ pci_read_config_byte(pcidev,0x85,&confval);
|
||||
+ confval |= 0x2;
|
||||
+ pci_write_config_byte (pcidev, 0x85,confval);
|
||||
+ /* activate high speed bits */
|
||||
+ outb(spcidx,confindex); /* set index */
|
||||
+ val = (unsigned char) inb(confdata);
|
||||
+ val |= 0xC0; /* both ports on high speed*/
|
||||
+ outb (spcidx,confindex);
|
||||
+ outb (val,confdata);
|
||||
+ /*stop config*/
|
||||
+ confval &= ~0x2;
|
||||
+ pci_write_config_byte(pcidev, 0x85, confval);
|
||||
+ spin_unlock_irq(&driver_lock);
|
||||
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed enabled\n");
|
||||
+ }
|
||||
+ else {
|
||||
+ printk (KERN_INFO "Couldn't locate VIA chipset\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void __exit viahss_exit(void)
|
||||
+{
|
||||
+ struct pci_dev *pcidev = NULL;
|
||||
+ unsigned char confval,val;
|
||||
+ pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
||||
+ if (pcidev) {
|
||||
+ spin_lock_irq(&driver_lock);
|
||||
+ /* start config */
|
||||
+ pci_read_config_byte(pcidev,0x85,&confval);
|
||||
+ confval |= 0x2;
|
||||
+ pci_write_config_byte (pcidev, 0x85,confval);
|
||||
+ /* activate high speed bits */
|
||||
+ outb(spcidx,confindex); /* set index */
|
||||
+ val = (unsigned char) inb(confdata);
|
||||
+ val &= ~0xC0; /* both ports off high speed*/
|
||||
+ outb (spcidx,confindex);
|
||||
+ outb (val,confdata);
|
||||
+ /*stop config*/
|
||||
+ confval &= ~0x2;
|
||||
+ pci_write_config_byte(pcidev, 0x85, confval);
|
||||
+ spin_unlock_irq(&driver_lock);
|
||||
+ printk (KERN_INFO "VIA VT82C686[AB] serial port high speed disabled\n");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+module_init(viahss_init);
|
||||
+module_exit(viahss_exit);
|
||||
+MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
|
||||
+MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
|
||||
@@ -0,0 +1,20 @@
|
||||
--- linux-2.6.35-rc6-git-mnb0.1/3rdparty/viahss/viahss.c.orig 2010-07-30 21:17:30.000000000 +0300
|
||||
+++ linux-2.6.35-rc6-git-mnb0.1/3rdparty/viahss/viahss.c 2010-07-30 23:10:21.324978822 +0300
|
||||
@@ -25,7 +25,7 @@ static int __init viahss_init(void)
|
||||
{
|
||||
struct pci_dev *pcidev = NULL;
|
||||
unsigned char confval,val;
|
||||
- pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
||||
+ pcidev = pci_get_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
||||
if (pcidev) {
|
||||
spin_lock_irq(&driver_lock);
|
||||
/* start config */
|
||||
@@ -55,7 +55,7 @@ static void __exit viahss_exit(void)
|
||||
{
|
||||
struct pci_dev *pcidev = NULL;
|
||||
unsigned char confval,val;
|
||||
- pcidev = pci_find_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
||||
+ pcidev = pci_get_device (PCI_VENDOR_ID_VIA,PCI_DEVICE_ID_VIA_82C686,NULL);
|
||||
if (pcidev) {
|
||||
spin_lock_irq(&driver_lock);
|
||||
/* start config */
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
fix build with 3.0
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
3rdparty/viahss/viahss.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/3rdparty/viahss/viahss.c.orig 2011-07-15 02:37:27.000000000 +0300
|
||||
+++ a/3rdparty/viahss/viahss.c 2011-07-15 13:48:13.204291256 +0300
|
||||
@@ -19,7 +19,7 @@
|
||||
const unsigned short confindex=0x3F0,confdata=0x3F1;
|
||||
const unsigned char spcidx=0xEE;
|
||||
|
||||
-spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
|
||||
+DEFINE_SPINLOCK(driver_lock);
|
||||
|
||||
static int __init viahss_init(void)
|
||||
{
|
||||
@@ -0,0 +1,18 @@
|
||||
linux/config.h is gone in 2.6.21
|
||||
|
||||
---
|
||||
3rdparty/viahss/viahss.c | 1 0 + 1 - 0 !
|
||||
1 files changed, 1 deletion(-)
|
||||
|
||||
Index: linux-2.6.21/3rdparty/viahss/viahss.c
|
||||
===================================================================
|
||||
--- linux-2.6.21.orig/3rdparty/viahss/viahss.c 2003-07-17 08:49:59.000000000 +0200
|
||||
+++ linux-2.6.21/3rdparty/viahss/viahss.c 2007-05-14 17:06:56.000000000 +0200
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
-#include <linux/config.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/pci.h>
|
||||
@@ -0,0 +1,7 @@
|
||||
--- linux-2.6.25/3rdparty/viahss/viahss.c.orig 2008-06-28 22:50:05.000000000 +0300
|
||||
+++ linux-2.6.25/3rdparty/viahss/viahss.c 2008-06-29 14:26:55.000000000 +0300
|
||||
@@ -80,3 +80,4 @@ module_init(viahss_init);
|
||||
module_exit(viahss_exit);
|
||||
MODULE_DESCRIPTION("VIA VT82C686[AB] high speed serial port enabler");
|
||||
MODULE_AUTHOR("Juhani Rautiainen <jrauti@iki.fi>");
|
||||
+MODULE_LICENSE("GPL");
|
||||
@@ -0,0 +1,3 @@
|
||||
# Mageia SVN does not like binaries in /packages tree
|
||||
# it can still be used for out ov svn builds
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
From 61f9738d65094a6b18d22c7beb6bb8c3dc0606b9 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Mon, 26 Oct 2015 15:20:46 +0100
|
||||
Subject: [PATCH] ACPI / video: Add a quirk to force acpi-video backlight on
|
||||
Dell XPS L421X
|
||||
|
||||
Just like the Dell XPS 15 (L521X) the Dell XPS 14 (L421X) needs to use
|
||||
the acpi-video backlight interface rather then the native one for backlight
|
||||
control to work, add a quirk for this.
|
||||
|
||||
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1272633
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
---
|
||||
drivers/acpi/video_detect.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
|
||||
index 0d3a384..daaf1c4 100644
|
||||
--- a/drivers/acpi/video_detect.c
|
||||
+++ b/drivers/acpi/video_detect.c
|
||||
@@ -233,6 +233,15 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
|
||||
},
|
||||
},
|
||||
{
|
||||
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1272633 */
|
||||
+ .callback = video_detect_force_video,
|
||||
+ .ident = "Dell XPS14 L421X",
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "XPS L421X"),
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
/* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */
|
||||
.callback = video_detect_force_video,
|
||||
.ident = "Dell XPS15 L521X",
|
||||
--
|
||||
2.3.10
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
From 88299efb05387c2c94120fdc9661aab2ec3a1ad8 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Backlund <tmb@mageia.org>
|
||||
Date: Fri, 3 Apr 2015 00:10:34 +0259
|
||||
Subject: [PATCH] Revert "cpufreq: pcc: Enable autoload of pcc-cpufreq for ACPI
|
||||
processors"
|
||||
|
||||
This reverts commit 7e7e8fe69820c6fa31395dbbd8e348e3c69cd2a9.
|
||||
---
|
||||
drivers/cpufreq/pcc-cpufreq.c | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
|
||||
index 2a0d589..4d2c8e8 100644
|
||||
--- a/drivers/cpufreq/pcc-cpufreq.c
|
||||
+++ b/drivers/cpufreq/pcc-cpufreq.c
|
||||
@@ -603,13 +603,6 @@ static void __exit pcc_cpufreq_exit(void)
|
||||
free_percpu(pcc_cpu_info);
|
||||
}
|
||||
|
||||
-static const struct acpi_device_id processor_device_ids[] = {
|
||||
- {ACPI_PROCESSOR_OBJECT_HID, },
|
||||
- {ACPI_PROCESSOR_DEVICE_HID, },
|
||||
- {},
|
||||
-};
|
||||
-MODULE_DEVICE_TABLE(acpi, processor_device_ids);
|
||||
-
|
||||
MODULE_AUTHOR("Matthew Garrett, Naga Chumbalkar");
|
||||
MODULE_VERSION(PCC_VERSION);
|
||||
MODULE_DESCRIPTION("Processor Clocking Control interface driver");
|
||||
--
|
||||
2.3.1
|
||||
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
From 43034bc4606f1f21186ca6fe27bc0448159d5e00 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Backlund <tmb@mageia.org>
|
||||
Date: Thu, 10 Mar 2016 15:44:13 +0200
|
||||
Subject: [PATCH] Revert "ipmi: Start the timer and thread on internal msgs"
|
||||
|
||||
This reverts commit 0cfec916e86d881e209de4b4ae9959a6271e6660.
|
||||
|
||||
It's reported on ipmi list that Dell R720xd servers will always panic
|
||||
on dell ipmi services load
|
||||
|
||||
Reverting this fixes the issue.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
---
|
||||
drivers/char/ipmi/ipmi_si_intf.c | 73 ++++++++++++++++------------------------
|
||||
1 file changed, 29 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
|
||||
index 4cc72fa..f667be8 100644
|
||||
--- a/drivers/char/ipmi/ipmi_si_intf.c
|
||||
+++ b/drivers/char/ipmi/ipmi_si_intf.c
|
||||
@@ -412,42 +412,18 @@ static enum si_sm_result start_next_msg(struct smi_info *smi_info)
|
||||
return rv;
|
||||
}
|
||||
|
||||
-static void smi_mod_timer(struct smi_info *smi_info, unsigned long new_val)
|
||||
-{
|
||||
- smi_info->last_timeout_jiffies = jiffies;
|
||||
- mod_timer(&smi_info->si_timer, new_val);
|
||||
- smi_info->timer_running = true;
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
- * Start a new message and (re)start the timer and thread.
|
||||
- */
|
||||
-static void start_new_msg(struct smi_info *smi_info, unsigned char *msg,
|
||||
- unsigned int size)
|
||||
-{
|
||||
- smi_mod_timer(smi_info, jiffies + SI_TIMEOUT_JIFFIES);
|
||||
-
|
||||
- if (smi_info->thread)
|
||||
- wake_up_process(smi_info->thread);
|
||||
-
|
||||
- smi_info->handlers->start_transaction(smi_info->si_sm, msg, size);
|
||||
-}
|
||||
-
|
||||
-static void start_check_enables(struct smi_info *smi_info, bool start_timer)
|
||||
+static void start_check_enables(struct smi_info *smi_info)
|
||||
{
|
||||
unsigned char msg[2];
|
||||
|
||||
msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
|
||||
msg[1] = IPMI_GET_BMC_GLOBAL_ENABLES_CMD;
|
||||
|
||||
- if (start_timer)
|
||||
- start_new_msg(smi_info, msg, 2);
|
||||
- else
|
||||
- smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);
|
||||
+ smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2);
|
||||
smi_info->si_state = SI_CHECKING_ENABLES;
|
||||
}
|
||||
|
||||
-static void start_clear_flags(struct smi_info *smi_info, bool start_timer)
|
||||
+static void start_clear_flags(struct smi_info *smi_info)
|
||||
{
|
||||
unsigned char msg[3];
|
||||
|
||||
@@ -456,10 +432,7 @@ static void start_clear_flags(struct smi_info *smi_info, bool start_timer)
|
||||
msg[1] = IPMI_CLEAR_MSG_FLAGS_CMD;
|
||||
msg[2] = WDT_PRE_TIMEOUT_INT;
|
||||
|
||||
- if (start_timer)
|
||||
- start_new_msg(smi_info, msg, 3);
|
||||
- else
|
||||
- smi_info->handlers->start_transaction(smi_info->si_sm, msg, 3);
|
||||
+ smi_info->handlers->start_transaction(smi_info->si_sm, msg, 3);
|
||||
smi_info->si_state = SI_CLEARING_FLAGS;
|
||||
}
|
||||
|
||||
@@ -469,8 +442,10 @@ static void start_getting_msg_queue(struct smi_info *smi_info)
|
||||
smi_info->curr_msg->data[1] = IPMI_GET_MSG_CMD;
|
||||
smi_info->curr_msg->data_size = 2;
|
||||
|
||||
- start_new_msg(smi_info, smi_info->curr_msg->data,
|
||||
- smi_info->curr_msg->data_size);
|
||||
+ smi_info->handlers->start_transaction(
|
||||
+ smi_info->si_sm,
|
||||
+ smi_info->curr_msg->data,
|
||||
+ smi_info->curr_msg->data_size);
|
||||
smi_info->si_state = SI_GETTING_MESSAGES;
|
||||
}
|
||||
|
||||
@@ -480,11 +455,20 @@ static void start_getting_events(struct smi_info *smi_info)
|
||||
smi_info->curr_msg->data[1] = IPMI_READ_EVENT_MSG_BUFFER_CMD;
|
||||
smi_info->curr_msg->data_size = 2;
|
||||
|
||||
- start_new_msg(smi_info, smi_info->curr_msg->data,
|
||||
- smi_info->curr_msg->data_size);
|
||||
+ smi_info->handlers->start_transaction(
|
||||
+ smi_info->si_sm,
|
||||
+ smi_info->curr_msg->data,
|
||||
+ smi_info->curr_msg->data_size);
|
||||
smi_info->si_state = SI_GETTING_EVENTS;
|
||||
}
|
||||
|
||||
+static void smi_mod_timer(struct smi_info *smi_info, unsigned long new_val)
|
||||
+{
|
||||
+ smi_info->last_timeout_jiffies = jiffies;
|
||||
+ mod_timer(&smi_info->si_timer, new_val);
|
||||
+ smi_info->timer_running = true;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* When we have a situtaion where we run out of memory and cannot
|
||||
* allocate messages, we just leave them in the BMC and run the system
|
||||
@@ -494,11 +478,11 @@ static void start_getting_events(struct smi_info *smi_info)
|
||||
* Note that we cannot just use disable_irq(), since the interrupt may
|
||||
* be shared.
|
||||
*/
|
||||
-static inline bool disable_si_irq(struct smi_info *smi_info, bool start_timer)
|
||||
+static inline bool disable_si_irq(struct smi_info *smi_info)
|
||||
{
|
||||
if ((smi_info->irq) && (!smi_info->interrupt_disabled)) {
|
||||
smi_info->interrupt_disabled = true;
|
||||
- start_check_enables(smi_info, start_timer);
|
||||
+ start_check_enables(smi_info);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -508,7 +492,7 @@ static inline bool enable_si_irq(struct smi_info *smi_info)
|
||||
{
|
||||
if ((smi_info->irq) && (smi_info->interrupt_disabled)) {
|
||||
smi_info->interrupt_disabled = false;
|
||||
- start_check_enables(smi_info, true);
|
||||
+ start_check_enables(smi_info);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -526,7 +510,7 @@ static struct ipmi_smi_msg *alloc_msg_handle_irq(struct smi_info *smi_info)
|
||||
|
||||
msg = ipmi_alloc_smi_msg();
|
||||
if (!msg) {
|
||||
- if (!disable_si_irq(smi_info, true))
|
||||
+ if (!disable_si_irq(smi_info))
|
||||
smi_info->si_state = SI_NORMAL;
|
||||
} else if (enable_si_irq(smi_info)) {
|
||||
ipmi_free_smi_msg(msg);
|
||||
@@ -542,7 +526,7 @@ static void handle_flags(struct smi_info *smi_info)
|
||||
/* Watchdog pre-timeout */
|
||||
smi_inc_stat(smi_info, watchdog_pretimeouts);
|
||||
|
||||
- start_clear_flags(smi_info, true);
|
||||
+ start_clear_flags(smi_info);
|
||||
smi_info->msg_flags &= ~WDT_PRE_TIMEOUT_INT;
|
||||
if (smi_info->intf)
|
||||
ipmi_smi_watchdog_pretimeout(smi_info->intf);
|
||||
@@ -895,7 +879,8 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
|
||||
msg[0] = (IPMI_NETFN_APP_REQUEST << 2);
|
||||
msg[1] = IPMI_GET_MSG_FLAGS_CMD;
|
||||
|
||||
- start_new_msg(smi_info, msg, 2);
|
||||
+ smi_info->handlers->start_transaction(
|
||||
+ smi_info->si_sm, msg, 2);
|
||||
smi_info->si_state = SI_GETTING_FLAGS;
|
||||
goto restart;
|
||||
}
|
||||
@@ -925,7 +910,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
|
||||
* disable and messages disabled.
|
||||
*/
|
||||
if (smi_info->supports_event_msg_buff || smi_info->irq) {
|
||||
- start_check_enables(smi_info, true);
|
||||
+ start_check_enables(smi_info);
|
||||
} else {
|
||||
smi_info->curr_msg = alloc_msg_handle_irq(smi_info);
|
||||
if (!smi_info->curr_msg)
|
||||
@@ -3635,7 +3620,7 @@ static int try_smi_init(struct smi_info *new_smi)
|
||||
* Start clearing the flags before we enable interrupts or the
|
||||
* timer to avoid racing with the timer.
|
||||
*/
|
||||
- start_clear_flags(new_smi, false);
|
||||
+ start_clear_flags(new_smi);
|
||||
|
||||
/*
|
||||
* IRQ is defined to be set when non-zero. req_events will
|
||||
@@ -3930,7 +3915,7 @@ static void cleanup_one_si(struct smi_info *to_clean)
|
||||
poll(to_clean);
|
||||
schedule_timeout_uninterruptible(1);
|
||||
}
|
||||
- disable_si_irq(to_clean, false);
|
||||
+ disable_si_irq(to_clean);
|
||||
while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) {
|
||||
poll(to_clean);
|
||||
schedule_timeout_uninterruptible(1);
|
||||
--
|
||||
2.7.2
|
||||
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
From 760235cd6ca8ae0d7509055d75a0f1d8b3c60668 Mon Sep 17 00:00:00 2001
|
||||
From: Lv Zheng <lv.zheng@intel.com>
|
||||
Date: Wed, 30 Nov 2016 15:21:12 +0800
|
||||
Subject: [PATCH] ACPICA: Events: Fix acpi_ev_initialize_region() return value
|
||||
|
||||
ACPICA commit 543342ab7a676f4eb0c9f100d349388a84dff0e8
|
||||
|
||||
This patch changes acpi_ev_initialize_region(), stop returning AE_NOT_EXIST
|
||||
from it so that, not only in acpi_ds_load2_end_op(), but all places invoking
|
||||
this function won't emit exceptions. The exception can be seen in
|
||||
acpi_ds_initialize_objects() when certain table loading mode is chosen.
|
||||
|
||||
This patch also removes useless acpi_ns_locked from acpi_ev_initialize_region()
|
||||
as this function will always be invoked with interpreter lock held now, and
|
||||
the lock granularity has been tuned to lock around _REG execution, thus it
|
||||
is now handled by acpi_ex_exit_interpreter(). Lv Zheng.
|
||||
|
||||
Link: https://github.com/acpica/acpica/commit/543342ab
|
||||
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
|
||||
Signed-off-by: Bob Moore <robert.moore@intel.com>
|
||||
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
---
|
||||
drivers/acpi/acpica/acevents.h | 4 +--
|
||||
drivers/acpi/acpica/dsopcode.c | 2 +-
|
||||
drivers/acpi/acpica/dswload2.c | 13 +---------
|
||||
drivers/acpi/acpica/evrgnini.c | 59 +++++++++++++++++-------------------------
|
||||
4 files changed, 27 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
|
||||
index 92fa47c..8a0049d 100644
|
||||
--- a/drivers/acpi/acpica/acevents.h
|
||||
+++ b/drivers/acpi/acpica/acevents.h
|
||||
@@ -243,9 +243,7 @@ acpi_ev_default_region_setup(acpi_handle handle,
|
||||
u32 function,
|
||||
void *handler_context, void **region_context);
|
||||
|
||||
-acpi_status
|
||||
-acpi_ev_initialize_region(union acpi_operand_object *region_obj,
|
||||
- u8 acpi_ns_locked);
|
||||
+acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj);
|
||||
|
||||
/*
|
||||
* evsci - SCI (System Control Interrupt) handling/dispatch
|
||||
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
|
||||
index 4cc9d98..77fd7c8 100644
|
||||
--- a/drivers/acpi/acpica/dsopcode.c
|
||||
+++ b/drivers/acpi/acpica/dsopcode.c
|
||||
@@ -84,7 +84,7 @@ acpi_status acpi_ds_initialize_region(acpi_handle obj_handle)
|
||||
|
||||
/* Namespace is NOT locked */
|
||||
|
||||
- status = acpi_ev_initialize_region(obj_desc, FALSE);
|
||||
+ status = acpi_ev_initialize_region(obj_desc);
|
||||
return (status);
|
||||
}
|
||||
|
||||
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
|
||||
index e362182..651f35a 100644
|
||||
--- a/drivers/acpi/acpica/dswload2.c
|
||||
+++ b/drivers/acpi/acpica/dswload2.c
|
||||
@@ -609,18 +609,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
||||
|
||||
status =
|
||||
acpi_ev_initialize_region
|
||||
- (acpi_ns_get_attached_object(node), FALSE);
|
||||
-
|
||||
- if (ACPI_FAILURE(status)) {
|
||||
- /*
|
||||
- * If AE_NOT_EXIST is returned, it is not fatal
|
||||
- * because many regions get created before a handler
|
||||
- * is installed for said region.
|
||||
- */
|
||||
- if (AE_NOT_EXIST == status) {
|
||||
- status = AE_OK;
|
||||
- }
|
||||
- }
|
||||
+ (acpi_ns_get_attached_object(node));
|
||||
break;
|
||||
|
||||
case AML_NAME_OP:
|
||||
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
|
||||
index 75ddd16..a909225 100644
|
||||
--- a/drivers/acpi/acpica/evrgnini.c
|
||||
+++ b/drivers/acpi/acpica/evrgnini.c
|
||||
@@ -479,7 +479,6 @@ acpi_ev_default_region_setup(acpi_handle handle,
|
||||
* FUNCTION: acpi_ev_initialize_region
|
||||
*
|
||||
* PARAMETERS: region_obj - Region we are initializing
|
||||
- * acpi_ns_locked - Is namespace locked?
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -497,19 +496,28 @@ acpi_ev_default_region_setup(acpi_handle handle,
|
||||
* MUTEX: Interpreter should be unlocked, because we may run the _REG
|
||||
* method for this region.
|
||||
*
|
||||
+ * NOTE: Possible incompliance:
|
||||
+ * There is a behavior conflict in automatic _REG execution:
|
||||
+ * 1. When the interpreter is evaluating a method, we can only
|
||||
+ * automatically run _REG for the following case:
|
||||
+ * operation_region (OPR1, 0x80, 0x1000010, 0x4)
|
||||
+ * 2. When the interpreter is loading a table, we can also
|
||||
+ * automatically run _REG for the following case:
|
||||
+ * operation_region (OPR1, 0x80, 0x1000010, 0x4)
|
||||
+ * Though this may not be compliant to the de-facto standard, the
|
||||
+ * logic is kept in order not to trigger regressions. And keeping
|
||||
+ * this logic should be taken care by the caller of this function.
|
||||
+ *
|
||||
******************************************************************************/
|
||||
|
||||
-acpi_status
|
||||
-acpi_ev_initialize_region(union acpi_operand_object *region_obj,
|
||||
- u8 acpi_ns_locked)
|
||||
+acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj)
|
||||
{
|
||||
union acpi_operand_object *handler_obj;
|
||||
union acpi_operand_object *obj_desc;
|
||||
acpi_adr_space_type space_id;
|
||||
struct acpi_namespace_node *node;
|
||||
- acpi_status status;
|
||||
|
||||
- ACPI_FUNCTION_TRACE_U32(ev_initialize_region, acpi_ns_locked);
|
||||
+ ACPI_FUNCTION_TRACE(ev_initialize_region);
|
||||
|
||||
if (!region_obj) {
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
@@ -580,39 +588,17 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
|
||||
handler_obj, region_obj,
|
||||
obj_desc));
|
||||
|
||||
- status =
|
||||
- acpi_ev_attach_region(handler_obj,
|
||||
- region_obj,
|
||||
- acpi_ns_locked);
|
||||
+ (void)acpi_ev_attach_region(handler_obj,
|
||||
+ region_obj, FALSE);
|
||||
|
||||
/*
|
||||
* Tell all users that this region is usable by
|
||||
* running the _REG method
|
||||
*/
|
||||
- if (acpi_ns_locked) {
|
||||
- status =
|
||||
- acpi_ut_release_mutex
|
||||
- (ACPI_MTX_NAMESPACE);
|
||||
- if (ACPI_FAILURE(status)) {
|
||||
- return_ACPI_STATUS(status);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
acpi_ex_exit_interpreter();
|
||||
- status =
|
||||
- acpi_ev_execute_reg_method(region_obj,
|
||||
- ACPI_REG_CONNECT);
|
||||
+ (void)acpi_ev_execute_reg_method(region_obj,
|
||||
+ ACPI_REG_CONNECT);
|
||||
acpi_ex_enter_interpreter();
|
||||
-
|
||||
- if (acpi_ns_locked) {
|
||||
- status =
|
||||
- acpi_ut_acquire_mutex
|
||||
- (ACPI_MTX_NAMESPACE);
|
||||
- if (ACPI_FAILURE(status)) {
|
||||
- return_ACPI_STATUS(status);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
}
|
||||
@@ -622,12 +608,15 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
|
||||
node = node->parent;
|
||||
}
|
||||
|
||||
- /* If we get here, there is no handler for this region */
|
||||
-
|
||||
+ /*
|
||||
+ * If we get here, there is no handler for this region. This is not
|
||||
+ * fatal because many regions get created before a handler is installed
|
||||
+ * for said region.
|
||||
+ */
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
|
||||
"No handler for RegionType %s(%X) (RegionObj %p)\n",
|
||||
acpi_ut_get_region_name(space_id), space_id,
|
||||
region_obj));
|
||||
|
||||
- return_ACPI_STATUS(AE_NOT_EXIST);
|
||||
+ return_ACPI_STATUS(AE_OK);
|
||||
}
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
Subject: CLEVO M360S acpi irq workaround
|
||||
|
||||
Some Hardware vendor use CLEVO M360S Laptop OEM.
|
||||
This acpi IRQ routing is not correct. we use normal IRQ routing for default.
|
||||
|
||||
Signed-off-by: Go Taniguchi <go@turbolinux.co.jp>
|
||||
|
||||
---
|
||||
arch/x86/kernel/acpi/boot.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/arch/x86/kernel/acpi/boot.c
|
||||
+++ b/arch/x86/kernel/acpi/boot.c
|
||||
@@ -1615,6 +1615,14 @@ static struct dmi_system_id __initdata a
|
||||
},
|
||||
},
|
||||
{
|
||||
+ .callback = disable_acpi_irq,
|
||||
+ .ident = "CLEVO M360S",
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "M360S"),
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
/*
|
||||
* Latest BIOS for IBM 600E (1.16) has bad pcinum
|
||||
* for LPC bridge, which is needed for the PCI
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
From 7020bcb82838006e23d058ff07b063b393ed3f10 Mon Sep 17 00:00:00 2001
|
||||
From: Zhang Rui <rui.zhang@intel.com>
|
||||
Date: Tue, 29 Nov 2016 23:19:46 +0100
|
||||
Subject: [PATCH] ACPI: do not warn if _BQC does not exist
|
||||
|
||||
Starting from ACPI spec 3.0, it's only clarified that _BCM control
|
||||
method is required if _BCL is implemented. There is no word
|
||||
saying _BQC is required.
|
||||
|
||||
And in ACPI spec 6.1 B.5.4, for _BQC, it is explicitly stated that
|
||||
"This optional method returns the current brightness level of a
|
||||
built-in display output device. If present, it must be set by
|
||||
the platform for initial brightness."
|
||||
|
||||
Thus remove the obsolete warning message.
|
||||
|
||||
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
|
||||
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
---
|
||||
drivers/acpi/scan.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
|
||||
index 3d1856f..07aa2e6 100644
|
||||
--- a/drivers/acpi/scan.c
|
||||
+++ b/drivers/acpi/scan.c
|
||||
@@ -1119,9 +1119,6 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context,
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight "
|
||||
"support\n"));
|
||||
*cap |= ACPI_VIDEO_BACKLIGHT;
|
||||
- if (!acpi_has_method(handle, "_BQC"))
|
||||
- printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, "
|
||||
- "cannot determine initial brightness\n");
|
||||
/* We have backlight support, no need to scan further */
|
||||
return AE_CTRL_TERMINATE;
|
||||
}
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
Limit Clevo M720SR to C2, going to C3 makes the machine freeze. This
|
||||
needs more investigation, sis chipset/bios problem may be?
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com>
|
||||
|
||||
---
|
||||
drivers/acpi/processor_idle.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- linux-2.6.33-rc8-git4-t2/drivers/acpi/processor_idle.c.orig 2010-02-20 12:45:35.000000000 +0200
|
||||
+++ linux-2.6.33-rc8-git4-t2/drivers/acpi/processor_idle.c 2010-02-20 12:53:39.679099592 +0200
|
||||
@@ -110,6 +110,9 @@ static struct dmi_system_id __cpuinitdat
|
||||
DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
|
||||
DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")},
|
||||
(void *)2},
|
||||
+ { set_max_cstate, "Clevo M720SR", {
|
||||
+ DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME,"M720SR")}, (void *)2},
|
||||
{ set_max_cstate, "Pavilion zv5000", {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME,"Pavilion zv5000 (DS502A#ABA)")},
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
>From 9f04e51293b130474504216a477bb2a73cbf59e1 Mon Sep 17 00:00:00 2001
|
||||
From: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
Date: Thu, 22 Mar 2012 22:29:11 +0200
|
||||
Subject: [PATCH] ata: prefer ata drivers over ide drivers when both are built
|
||||
|
||||
Currently the old IDE drivers are preferred over ATA drivers when both
|
||||
are built, since ide/ is listed first in drivers/Makefile and therefore
|
||||
the IDE drivers end up before ATA drivers in modules.order which is used
|
||||
by depmod/modprobe for module ordering.
|
||||
|
||||
Change it so that ATA drivers are preferred over IDE driver by moving
|
||||
the ide/ entry under ata/ in drivers/Makefile.
|
||||
|
||||
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
|
||||
---
|
||||
drivers/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/Makefile b/drivers/Makefile
|
||||
index 932e8bf..e8df3d0 100644
|
||||
--- a/drivers/Makefile
|
||||
+++ b/drivers/Makefile
|
||||
@@ -69,10 +69,10 @@ obj-$(CONFIG_LIBNVDIMM) += nvdimm/
|
||||
obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
|
||||
obj-$(CONFIG_NUBUS) += nubus/
|
||||
obj-y += macintosh/
|
||||
-obj-$(CONFIG_IDE) += ide/
|
||||
obj-$(CONFIG_SCSI) += scsi/
|
||||
obj-y += nvme/
|
||||
obj-$(CONFIG_ATA) += ata/
|
||||
+obj-$(CONFIG_IDE) += ide/
|
||||
obj-$(CONFIG_TARGET_CORE) += target/
|
||||
obj-$(CONFIG_MTD) += mtd/
|
||||
obj-$(CONFIG_SPI) += spi/
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
|
||||
Devicetree is enabled on 32bit kernels for OLPC support,
|
||||
but this causes error messages:
|
||||
|
||||
'Failed to find cpu0 device node' that breaks bootsplash.
|
||||
|
||||
https://bugs.mageia.org/show_bug.cgi?id=16655#c39
|
||||
https://bugs.mageia.org/show_bug.cgi?id=17010
|
||||
|
||||
So hide them behind debug for cleaner boot.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
|
||||
--- linux/drivers/base/cacheinfo.c.orig
|
||||
+++ linux/drivers/base/cacheinfo.c
|
||||
@@ -53,12 +53,12 @@
|
||||
return 0;
|
||||
|
||||
if (!cpu_dev) {
|
||||
- pr_err("No cpu device for CPU %d\n", cpu);
|
||||
+ pr_debug("No cpu device for CPU %d\n", cpu);
|
||||
return -ENODEV;
|
||||
}
|
||||
np = cpu_dev->of_node;
|
||||
if (!np) {
|
||||
- pr_err("Failed to find cpu%d device node\n", cpu);
|
||||
+ pr_debug("Failed to find cpu%d device node\n", cpu);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
*/
|
||||
ret = cache_shared_cpu_map_setup(cpu);
|
||||
if (ret) {
|
||||
- pr_warn("Unable to detect cache hierarchy from DT for CPU %d\n",
|
||||
+ pr_debug("Unable to detect cache hierarchy from DT for CPU %d\n",
|
||||
cpu);
|
||||
goto free_ci;
|
||||
}
|
||||
@@ -540,7 +540,7 @@
|
||||
rc = cache_add_dev(cpu);
|
||||
if (rc) {
|
||||
free_cache_attributes(cpu);
|
||||
- pr_err("error populating cacheinfo..cpu%d\n", cpu);
|
||||
+ pr_debug("error populating cacheinfo..cpu%d\n", cpu);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
From 41c0126b3f22ef36b97b3c38b8f29569848a5ce2 Mon Sep 17 00:00:00 2001
|
||||
From: Tahsin Erdogan <tahsin@google.com>
|
||||
Date: Tue, 19 May 2015 13:55:21 -0700
|
||||
Subject: block: Make CFQ default to IOPS mode on SSDs
|
||||
|
||||
CFQ idling causes reduced IOPS throughput on non-rotational disks.
|
||||
Since disk head seeking is not applicable to SSDs, it doesn't really
|
||||
help performance by anticipating future near-by IO requests.
|
||||
|
||||
By turning off idling (and switching to IOPS mode), we allow other
|
||||
processes to dispatch IO requests down to the driver and so increase IO
|
||||
throughput.
|
||||
|
||||
Following FIO benchmark results were taken on a cloud SSD offering with
|
||||
idling on and off:
|
||||
|
||||
Idling iops avg-lat(ms) stddev bw
|
||||
------------------------------------------------------
|
||||
On 7054 90.107 38.697 28217KB/s
|
||||
Off 29255 21.836 11.730 117022KB/s
|
||||
|
||||
fio --name=temp --size=100G --time_based --ioengine=libaio \
|
||||
--randrepeat=0 --direct=1 --invalidate=1 --verify=0 \
|
||||
--verify_fatal=0 --rw=randread --blocksize=4k --group_reporting=1 \
|
||||
--filename=/dev/sdb --runtime=10 --iodepth=64 --numjobs=10
|
||||
|
||||
And the following is from a local SSD run:
|
||||
|
||||
Idling iops avg-lat(ms) stddev bw
|
||||
------------------------------------------------------
|
||||
On 19320 33.043 14.068 77281KB/s
|
||||
Off 21626 29.465 12.662 86507KB/s
|
||||
|
||||
fio --name=temp --size=5G --time_based --ioengine=libaio \
|
||||
--randrepeat=0 --direct=1 --invalidate=1 --verify=0 \
|
||||
--verify_fatal=0 --rw=randread --blocksize=4k --group_reporting=1 \
|
||||
--filename=/fio_data --runtime=10 --iodepth=64 --numjobs=10
|
||||
|
||||
Reviewed-by: Nauman Rafique <nauman@google.com>
|
||||
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
|
||||
Signed-off-by: Jens Axboe <axboe@fb.com>
|
||||
|
||||
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
|
||||
index 5da8e6e..402be01 100644
|
||||
--- a/block/cfq-iosched.c
|
||||
+++ b/block/cfq-iosched.c
|
||||
@@ -4460,7 +4460,7 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e)
|
||||
cfqd->cfq_slice[1] = cfq_slice_sync;
|
||||
cfqd->cfq_target_latency = cfq_target_latency;
|
||||
cfqd->cfq_slice_async_rq = cfq_slice_async_rq;
|
||||
- cfqd->cfq_slice_idle = cfq_slice_idle;
|
||||
+ cfqd->cfq_slice_idle = blk_queue_nonrot(q) ? 0 : cfq_slice_idle;
|
||||
cfqd->cfq_group_idle = cfq_group_idle;
|
||||
cfqd->cfq_latency = 1;
|
||||
cfqd->hw_tag = -1;
|
||||
--
|
||||
cgit v0.10.2
|
||||
|
||||
+9128
File diff suppressed because it is too large
Load Diff
+1101
File diff suppressed because it is too large
Load Diff
+103
@@ -0,0 +1,103 @@
|
||||
From 465ed48c05de63f5bdd34d83915f1b8998a62134 Mon Sep 17 00:00:00 2001
|
||||
From: Paolo Valente <paolo.valente@unimore.it>
|
||||
Date: Tue, 7 Apr 2015 13:39:12 +0200
|
||||
Subject: [PATCH 1/4] block: cgroups, kconfig, build bits for BFQ-v7r11-4.5.0
|
||||
|
||||
Update Kconfig.iosched and do the related Makefile changes to include
|
||||
kernel configuration options for BFQ. Also increase the number of
|
||||
policies supported by the blkio controller so that BFQ can add its
|
||||
own.
|
||||
|
||||
Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
|
||||
Signed-off-by: Arianna Avanzini <avanzini@google.com>
|
||||
---
|
||||
block/Kconfig.iosched | 32 ++++++++++++++++++++++++++++++++
|
||||
block/Makefile | 1 +
|
||||
include/linux/blkdev.h | 2 +-
|
||||
3 files changed, 34 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched
|
||||
index 421bef9..0ee5f0f 100644
|
||||
--- a/block/Kconfig.iosched
|
||||
+++ b/block/Kconfig.iosched
|
||||
@@ -39,6 +39,27 @@ config CFQ_GROUP_IOSCHED
|
||||
---help---
|
||||
Enable group IO scheduling in CFQ.
|
||||
|
||||
+config IOSCHED_BFQ
|
||||
+ tristate "BFQ I/O scheduler"
|
||||
+ default n
|
||||
+ ---help---
|
||||
+ The BFQ I/O scheduler tries to distribute bandwidth among
|
||||
+ all processes according to their weights.
|
||||
+ It aims at distributing the bandwidth as desired, independently of
|
||||
+ the disk parameters and with any workload. It also tries to
|
||||
+ guarantee low latency to interactive and soft real-time
|
||||
+ applications. If compiled built-in (saying Y here), BFQ can
|
||||
+ be configured to support hierarchical scheduling.
|
||||
+
|
||||
+config CGROUP_BFQIO
|
||||
+ bool "BFQ hierarchical scheduling support"
|
||||
+ depends on CGROUPS && IOSCHED_BFQ=y
|
||||
+ default n
|
||||
+ ---help---
|
||||
+ Enable hierarchical scheduling in BFQ, using the cgroups
|
||||
+ filesystem interface. The name of the subsystem will be
|
||||
+ bfqio.
|
||||
+
|
||||
choice
|
||||
prompt "Default I/O scheduler"
|
||||
default DEFAULT_CFQ
|
||||
@@ -52,6 +73,16 @@ choice
|
||||
config DEFAULT_CFQ
|
||||
bool "CFQ" if IOSCHED_CFQ=y
|
||||
|
||||
+ config DEFAULT_BFQ
|
||||
+ bool "BFQ" if IOSCHED_BFQ=y
|
||||
+ help
|
||||
+ Selects BFQ as the default I/O scheduler which will be
|
||||
+ used by default for all block devices.
|
||||
+ The BFQ I/O scheduler aims at distributing the bandwidth
|
||||
+ as desired, independently of the disk parameters and with
|
||||
+ any workload. It also tries to guarantee low latency to
|
||||
+ interactive and soft real-time applications.
|
||||
+
|
||||
config DEFAULT_NOOP
|
||||
bool "No-op"
|
||||
|
||||
@@ -61,6 +92,7 @@ config DEFAULT_IOSCHED
|
||||
string
|
||||
default "deadline" if DEFAULT_DEADLINE
|
||||
default "cfq" if DEFAULT_CFQ
|
||||
+ default "bfq" if DEFAULT_BFQ
|
||||
default "noop" if DEFAULT_NOOP
|
||||
|
||||
endmenu
|
||||
diff --git a/block/Makefile b/block/Makefile
|
||||
index 36acdd7..736e91a 100644
|
||||
--- a/block/Makefile
|
||||
+++ b/block/Makefile
|
||||
@@ -18,6 +18,7 @@ obj-$(CONFIG_BLK_DEV_THROTTLING) += blk-throttle.o
|
||||
obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o
|
||||
obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
|
||||
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o
|
||||
+obj-$(CONFIG_IOSCHED_BFQ) += bfq-iosched.o
|
||||
|
||||
obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
|
||||
obj-$(CONFIG_BLK_CMDLINE_PARSER) += cmdline-parser.o
|
||||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
|
||||
index c47c358..1047d99 100644
|
||||
--- a/include/linux/blkdev.h
|
||||
+++ b/include/linux/blkdev.h
|
||||
@@ -45,7 +45,7 @@ struct pr_ops;
|
||||
* Maximum number of blkcg policies allowed to be registered concurrently.
|
||||
* Defined here to simplify include dependency.
|
||||
*/
|
||||
-#define BLKCG_MAX_POLS 2
|
||||
+#define BLKCG_MAX_POLS 3
|
||||
|
||||
typedef void (rq_end_io_fn)(struct request *, int);
|
||||
|
||||
--
|
||||
2.10.0
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
|
||||
Disable floppy autoloading as it makes systems without real hw,
|
||||
but that has the pnp headers hang.
|
||||
|
||||
See https://bugs.mageia.org/show_bug.cgi?id=4696
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -Nurp linux-3.3.3-rc1/drivers/block/floppy.c.orig linux-3.3.3-rc1/drivers/block/floppy.c
|
||||
--- linux-3.3.3-rc1/drivers/block/floppy.c.orig 2012-03-19 01:15:34.000000000 +0200
|
||||
+++ linux-3.3.3-rc1/drivers/block/floppy.c 2012-04-22 02:58:10.238498303 +0300
|
||||
@@ -4621,8 +4621,7 @@ static const struct pnp_device_id floppy
|
||||
{"PNP0700", 0},
|
||||
{}
|
||||
};
|
||||
-
|
||||
-MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
|
||||
+/* MODULE_DEVICE_TABLE(pnp, floppy_pnpids); */
|
||||
|
||||
#else
|
||||
|
||||
+7109
File diff suppressed because it is too large
Load Diff
+34
@@ -0,0 +1,34 @@
|
||||
From 124298bd03acebd9c9da29a794718aca31bec1f7 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Roschka <danielroschka@phoenitydawn.de>
|
||||
Date: Wed, 22 Feb 2017 15:17:29 -0700
|
||||
Subject: [PATCH] nvme: detect NVMe controller in recent MacBooks
|
||||
|
||||
Adds support for detection of the NVMe controller found in the
|
||||
following recent MacBooks:
|
||||
- Retina MacBook 2016 (MacBook9,1)
|
||||
- 13" MacBook Pro 2016 without Touch Bar (MacBook13,1)
|
||||
- 13" MacBook Pro 2016 with Touch Bar (MacBook13,2)
|
||||
|
||||
Signed-off-by: Daniel Roschka <danielroschka@phoenitydawn.de>
|
||||
Reviewed-by: Christoph Hellwig <hch@lst.de>
|
||||
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
|
||||
Signed-off-by: Jens Axboe <axboe@fb.com>
|
||||
---
|
||||
drivers/nvme/host/pci.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
|
||||
index d38dae9..319f5c5 100644
|
||||
--- a/drivers/nvme/host/pci.c
|
||||
+++ b/drivers/nvme/host/pci.c
|
||||
@@ -2120,6 +2120,7 @@ static const struct pci_device_id nvme_id_table[] = {
|
||||
.driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
|
||||
{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
|
||||
+ { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
|
||||
{ 0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, nvme_id_table);
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
block/bfq-iosched.c | 4 +++-
|
||||
block/bfq-sched.c | 15 ++++++++++++---
|
||||
block/bfq.h | 2 +-
|
||||
3 files changed, 16 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
|
||||
index 96b79a0dae9f..158628392d92 100644
|
||||
--- a/block/bfq-iosched.c
|
||||
+++ b/block/bfq-iosched.c
|
||||
@@ -4572,6 +4572,8 @@ static int bfq_set_request(struct request_queue *q, struct request *rq,
|
||||
if (!bic)
|
||||
goto queue_fail;
|
||||
|
||||
+ bfq_check_ioprio_change(bic, bio);
|
||||
+
|
||||
bfq_bic_update_cgroup(bic, bio);
|
||||
|
||||
new_queue:
|
||||
@@ -5268,7 +5270,7 @@ static struct blkcg_policy blkcg_policy_bfq = {
|
||||
static int __init bfq_init(void)
|
||||
{
|
||||
int ret;
|
||||
- char msg[60] = "BFQ I/O-scheduler: v8r10";
|
||||
+ char msg[60] = "BFQ I/O-scheduler: v8r11";
|
||||
|
||||
#ifdef CONFIG_BFQ_GROUP_IOSCHED
|
||||
ret = blkcg_policy_register(&blkcg_policy_bfq);
|
||||
diff --git a/block/bfq-sched.c b/block/bfq-sched.c
|
||||
index 70aac56b02ef..8311bdbeceea 100644
|
||||
--- a/block/bfq-sched.c
|
||||
+++ b/block/bfq-sched.c
|
||||
@@ -1280,14 +1280,23 @@ static bool __bfq_deactivate_entity(struct bfq_entity *entity,
|
||||
bool ins_into_idle_tree)
|
||||
{
|
||||
struct bfq_sched_data *sd = entity->sched_data;
|
||||
- struct bfq_service_tree *st = bfq_entity_service_tree(entity);
|
||||
- bool is_in_service = entity == sd->in_service_entity;
|
||||
+ struct bfq_service_tree *st;
|
||||
+ bool is_in_service;
|
||||
|
||||
if (!entity->on_st) { /* entity never activated, or already inactive */
|
||||
- BUG_ON(entity == entity->sched_data->in_service_entity);
|
||||
+ BUG_ON(sd && entity == sd->in_service_entity);
|
||||
return false;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * If we get here, then entity is active, which implies that
|
||||
+ * bfq_group_set_parent has already been invoked for the group
|
||||
+ * represented by entity. Therefore, the field
|
||||
+ * entity->sched_data has been set, and we can safely use it.
|
||||
+ */
|
||||
+ st = bfq_entity_service_tree(entity);
|
||||
+ is_in_service = entity == sd->in_service_entity;
|
||||
+
|
||||
BUG_ON(is_in_service && entity->tree && entity->tree != &st->active);
|
||||
|
||||
if (is_in_service)
|
||||
diff --git a/block/bfq.h b/block/bfq.h
|
||||
index e3855af1211b..a521ac40cac0 100644
|
||||
--- a/block/bfq.h
|
||||
+++ b/block/bfq.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * BFQ v8r10 for 4.9.0: data structures and common functions prototypes.
|
||||
+ * BFQ v8r11 for 4.9.0: data structures and common functions prototypes.
|
||||
*
|
||||
* Based on ideas and code from CFQ:
|
||||
* Copyright (C) 2003 Jens Axboe <axboe@kernel.dk>
|
||||
+729
@@ -0,0 +1,729 @@
|
||||
block/bfq-cgroup.c | 12 +--
|
||||
block/bfq-iosched.c | 211 +++++++++++++++++++++++++++++++---------------------
|
||||
block/bfq-sched.c | 73 ++++++++++++------
|
||||
block/bfq.h | 4 +-
|
||||
4 files changed, 180 insertions(+), 120 deletions(-)
|
||||
|
||||
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
|
||||
index bbaecd0..a66a723 100644
|
||||
--- a/block/bfq-cgroup.c
|
||||
+++ b/block/bfq-cgroup.c
|
||||
@@ -771,7 +771,6 @@ static void bfq_pd_offline(struct blkg_policy_data *pd)
|
||||
|
||||
__bfq_deactivate_entity(entity, false);
|
||||
bfq_put_async_queues(bfqd, bfqg);
|
||||
- BUG_ON(entity->tree);
|
||||
|
||||
/*
|
||||
* @blkg is going offline and will be ignored by
|
||||
@@ -1140,6 +1139,9 @@ static inline void bfqg_stats_update_idle_time(struct bfq_group *bfqg) { }
|
||||
static inline void bfqg_stats_set_start_idle_time(struct bfq_group *bfqg) { }
|
||||
static inline void bfqg_stats_update_avg_queue_size(struct bfq_group *bfqg) { }
|
||||
|
||||
+static void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
+ struct bfq_group *bfqg) {}
|
||||
+
|
||||
static void bfq_init_entity(struct bfq_entity *entity,
|
||||
struct bfq_group *bfqg)
|
||||
{
|
||||
@@ -1154,13 +1156,7 @@ static void bfq_init_entity(struct bfq_entity *entity,
|
||||
entity->sched_data = &bfqg->sched_data;
|
||||
}
|
||||
|
||||
-static struct bfq_group *
|
||||
-bfq_bic_update_cgroup(struct bfq_io_cq *bic, struct bio *bio)
|
||||
-{
|
||||
- struct bfq_data *bfqd = bic_to_bfqd(bic);
|
||||
-
|
||||
- return bfqd->root_group;
|
||||
-}
|
||||
+static void bfq_bic_update_cgroup(struct bfq_io_cq *bic, struct bio *bio) {}
|
||||
|
||||
static void bfq_end_wr_async(struct bfq_data *bfqd)
|
||||
{
|
||||
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
|
||||
index 78baa07..96b79a0 100644
|
||||
--- a/block/bfq-iosched.c
|
||||
+++ b/block/bfq-iosched.c
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* Copyright (C) 2015 Paolo Valente <paolo.valente@unimore.it>
|
||||
*
|
||||
- * Copyright (C) 2016 Paolo Valente <paolo.valente@linaro.org>
|
||||
+ * Copyright (C) 2017 Paolo Valente <paolo.valente@linaro.org>
|
||||
*
|
||||
* Licensed under the GPL-2 as detailed in the accompanying COPYING.BFQ
|
||||
* file.
|
||||
@@ -107,7 +107,7 @@ static const int bfq_async_charge_factor = 10;
|
||||
/* Default timeout values, in jiffies, approximating CFQ defaults. */
|
||||
static const int bfq_timeout = (HZ / 8);
|
||||
|
||||
-struct kmem_cache *bfq_pool;
|
||||
+static struct kmem_cache *bfq_pool;
|
||||
|
||||
/* Below this threshold (in ns), we consider thinktime immediate. */
|
||||
#define BFQ_MIN_TT (2 * NSEC_PER_MSEC)
|
||||
@@ -483,6 +483,22 @@ static void bfq_weights_tree_add(struct bfq_data *bfqd,
|
||||
|
||||
entity->weight_counter = kzalloc(sizeof(struct bfq_weight_counter),
|
||||
GFP_ATOMIC);
|
||||
+
|
||||
+ /*
|
||||
+ * In the unlucky event of an allocation failure, we just
|
||||
+ * exit. This will cause the weight of entity to not be
|
||||
+ * considered in bfq_differentiated_weights, which, in its
|
||||
+ * turn, causes the scenario to be deemed wrongly symmetric in
|
||||
+ * case entity's weight would have been the only weight making
|
||||
+ * the scenario asymmetric. On the bright side, no unbalance
|
||||
+ * will however occur when entity becomes inactive again (the
|
||||
+ * invocation of this function is triggered by an activation
|
||||
+ * of entity). In fact, bfq_weights_tree_remove does nothing
|
||||
+ * if !entity->weight_counter.
|
||||
+ */
|
||||
+ if (unlikely(!entity->weight_counter))
|
||||
+ return;
|
||||
+
|
||||
entity->weight_counter->weight = entity->weight;
|
||||
rb_link_node(&entity->weight_counter->weights_node, parent, new);
|
||||
rb_insert_color(&entity->weight_counter->weights_node, root);
|
||||
@@ -519,13 +535,45 @@ static void bfq_weights_tree_remove(struct bfq_data *bfqd,
|
||||
entity->weight_counter = NULL;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Return expired entry, or NULL to just start from scratch in rbtree.
|
||||
+ */
|
||||
+static struct request *bfq_check_fifo(struct bfq_queue *bfqq,
|
||||
+ struct request *last)
|
||||
+{
|
||||
+ struct request *rq;
|
||||
+
|
||||
+ if (bfq_bfqq_fifo_expire(bfqq))
|
||||
+ return NULL;
|
||||
+
|
||||
+ bfq_mark_bfqq_fifo_expire(bfqq);
|
||||
+
|
||||
+ rq = rq_entry_fifo(bfqq->fifo.next);
|
||||
+
|
||||
+ if (rq == last || ktime_get_ns() < rq->fifo_time)
|
||||
+ return NULL;
|
||||
+
|
||||
+ bfq_log_bfqq(bfqq->bfqd, bfqq, "check_fifo: returned %p", rq);
|
||||
+ BUG_ON(RB_EMPTY_NODE(&rq->rb_node));
|
||||
+ return rq;
|
||||
+}
|
||||
+
|
||||
static struct request *bfq_find_next_rq(struct bfq_data *bfqd,
|
||||
struct bfq_queue *bfqq,
|
||||
struct request *last)
|
||||
{
|
||||
struct rb_node *rbnext = rb_next(&last->rb_node);
|
||||
struct rb_node *rbprev = rb_prev(&last->rb_node);
|
||||
- struct request *next = NULL, *prev = NULL;
|
||||
+ struct request *next, *prev = NULL;
|
||||
+
|
||||
+ BUG_ON(list_empty(&bfqq->fifo));
|
||||
+
|
||||
+ /* Follow expired path, else get first next available. */
|
||||
+ next = bfq_check_fifo(bfqq, last);
|
||||
+ if (next) {
|
||||
+ BUG_ON(next == last);
|
||||
+ return next;
|
||||
+ }
|
||||
|
||||
BUG_ON(RB_EMPTY_NODE(&last->rb_node));
|
||||
|
||||
@@ -1359,7 +1407,6 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd,
|
||||
|
||||
bfq_bfqq_expire(bfqd, bfqd->in_service_queue,
|
||||
false, BFQ_BFQQ_PREEMPTED);
|
||||
- BUG_ON(in_serv->entity.budget < 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1523,12 +1570,15 @@ static void bfq_remove_request(struct request *rq)
|
||||
elv_rb_del(&bfqq->sort_list, rq);
|
||||
|
||||
if (RB_EMPTY_ROOT(&bfqq->sort_list)) {
|
||||
+ bfqq->next_rq = NULL;
|
||||
+
|
||||
BUG_ON(bfqq->entity.budget < 0);
|
||||
|
||||
if (bfq_bfqq_busy(bfqq) && bfqq != bfqd->in_service_queue) {
|
||||
+ BUG_ON(bfqq->ref < 2); /* referred by rq and on tree */
|
||||
bfq_del_bfqq_busy(bfqd, bfqq, false);
|
||||
-
|
||||
- /* bfqq emptied. In normal operation, when
|
||||
+ /*
|
||||
+ * bfqq emptied. In normal operation, when
|
||||
* bfqq is empty, bfqq->entity.service and
|
||||
* bfqq->entity.budget must contain,
|
||||
* respectively, the service received and the
|
||||
@@ -1537,7 +1587,8 @@ static void bfq_remove_request(struct request *rq)
|
||||
* this last removal occurred while bfqq is
|
||||
* not in service. To avoid inconsistencies,
|
||||
* reset both bfqq->entity.service and
|
||||
- * bfqq->entity.budget.
|
||||
+ * bfqq->entity.budget, if bfqq has still a
|
||||
+ * process that may issue I/O requests to it.
|
||||
*/
|
||||
bfqq->entity.budget = bfqq->entity.service = 0;
|
||||
}
|
||||
@@ -1868,7 +1919,7 @@ static bool bfq_may_be_close_cooperator(struct bfq_queue *bfqq,
|
||||
* positives. In case bfqq is weight-raised, such false positives
|
||||
* would evidently degrade latency guarantees for bfqq.
|
||||
*/
|
||||
-bool wr_from_too_long(struct bfq_queue *bfqq)
|
||||
+static bool wr_from_too_long(struct bfq_queue *bfqq)
|
||||
{
|
||||
return bfqq->wr_coeff > 1 &&
|
||||
time_is_before_jiffies(bfqq->last_wr_start_finish +
|
||||
@@ -2029,7 +2080,8 @@ bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
|
||||
new_bfqq->wr_coeff = bfqq->wr_coeff;
|
||||
new_bfqq->wr_cur_max_time = bfqq->wr_cur_max_time;
|
||||
new_bfqq->last_wr_start_finish = bfqq->last_wr_start_finish;
|
||||
- new_bfqq->wr_start_at_switch_to_srt = bfqq->wr_start_at_switch_to_srt;
|
||||
+ new_bfqq->wr_start_at_switch_to_srt =
|
||||
+ bfqq->wr_start_at_switch_to_srt;
|
||||
if (bfq_bfqq_busy(new_bfqq))
|
||||
bfqd->wr_busy_queues++;
|
||||
new_bfqq->entity.prio_changed = 1;
|
||||
@@ -2072,6 +2124,7 @@ bfq_merge_bfqqs(struct bfq_data *bfqd, struct bfq_io_cq *bic,
|
||||
*/
|
||||
new_bfqq->bic = NULL;
|
||||
bfqq->bic = NULL;
|
||||
+ /* release process reference to bfqq */
|
||||
bfq_put_queue(bfqq);
|
||||
}
|
||||
|
||||
@@ -2298,7 +2351,7 @@ static unsigned long bfq_calc_max_budget(struct bfq_data *bfqd)
|
||||
* function of the estimated peak rate. See comments on
|
||||
* bfq_calc_max_budget(), and on T_slow and T_fast arrays.
|
||||
*/
|
||||
-void update_thr_responsiveness_params(struct bfq_data *bfqd)
|
||||
+static void update_thr_responsiveness_params(struct bfq_data *bfqd)
|
||||
{
|
||||
int dev_type = blk_queue_nonrot(bfqd->queue);
|
||||
|
||||
@@ -2333,7 +2386,7 @@ void update_thr_responsiveness_params(struct bfq_data *bfqd)
|
||||
BFQ_RATE_SHIFT);
|
||||
}
|
||||
|
||||
-void bfq_reset_rate_computation(struct bfq_data *bfqd, struct request *rq)
|
||||
+static void bfq_reset_rate_computation(struct bfq_data *bfqd, struct request *rq)
|
||||
{
|
||||
if (rq != NULL) { /* new rq dispatch now, reset accordingly */
|
||||
bfqd->last_dispatch = bfqd->first_dispatch = ktime_get_ns() ;
|
||||
@@ -2350,7 +2403,7 @@ void bfq_reset_rate_computation(struct bfq_data *bfqd, struct request *rq)
|
||||
bfqd->tot_sectors_dispatched);
|
||||
}
|
||||
|
||||
-void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
|
||||
+static void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
|
||||
{
|
||||
u32 rate, weight, divisor;
|
||||
|
||||
@@ -2400,7 +2453,7 @@ void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
|
||||
* total, and rate is below the current estimated peak rate
|
||||
* - rate is unreasonably high (> 20M sectors/sec)
|
||||
*/
|
||||
- if ((bfqd->peak_rate_samples > (3 * bfqd->sequential_samples)>>2 &&
|
||||
+ if ((bfqd->sequential_samples < (3 * bfqd->peak_rate_samples)>>2 &&
|
||||
rate <= bfqd->peak_rate) ||
|
||||
rate > 20<<BFQ_RATE_SHIFT) {
|
||||
bfq_log(bfqd,
|
||||
@@ -2515,7 +2568,7 @@ void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
|
||||
* of the observed dispatch rate. The function assumes to be invoked
|
||||
* on every request dispatch.
|
||||
*/
|
||||
-void bfq_update_peak_rate(struct bfq_data *bfqd, struct request *rq)
|
||||
+static void bfq_update_peak_rate(struct bfq_data *bfqd, struct request *rq)
|
||||
{
|
||||
u64 now_ns = ktime_get_ns();
|
||||
|
||||
@@ -2616,29 +2669,6 @@ static void bfq_dispatch_insert(struct request_queue *q, struct request *rq)
|
||||
elv_dispatch_sort(q, rq);
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Return expired entry, or NULL to just start from scratch in rbtree.
|
||||
- */
|
||||
-static struct request *bfq_check_fifo(struct bfq_queue *bfqq)
|
||||
-{
|
||||
- struct request *rq = NULL;
|
||||
-
|
||||
- if (bfq_bfqq_fifo_expire(bfqq))
|
||||
- return NULL;
|
||||
-
|
||||
- bfq_mark_bfqq_fifo_expire(bfqq);
|
||||
-
|
||||
- if (list_empty(&bfqq->fifo))
|
||||
- return NULL;
|
||||
-
|
||||
- rq = rq_entry_fifo(bfqq->fifo.next);
|
||||
-
|
||||
- if (ktime_get_ns() < rq->fifo_time)
|
||||
- return NULL;
|
||||
-
|
||||
- return rq;
|
||||
-}
|
||||
-
|
||||
static void __bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq)
|
||||
{
|
||||
BUG_ON(bfqq != bfqd->in_service_queue);
|
||||
@@ -2904,8 +2934,8 @@ static bool bfq_bfqq_is_slow(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
delta_ktime = ktime_sub(delta_ktime, bfqd->last_budget_start);
|
||||
delta_usecs = ktime_to_us(delta_ktime);
|
||||
|
||||
- /* don't trust short/unrealistic values. */
|
||||
- if (delta_usecs < 1000 || delta_usecs >= LONG_MAX) {
|
||||
+ /* don't use too short time intervals */
|
||||
+ if (delta_usecs < 1000) {
|
||||
if (blk_queue_nonrot(bfqd->queue))
|
||||
/*
|
||||
* give same worst-case guarantees as idling
|
||||
@@ -2915,7 +2945,7 @@ static bool bfq_bfqq_is_slow(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
else /* charge at least one seek */
|
||||
*delta_ms = bfq_slice_idle / NSEC_PER_MSEC;
|
||||
|
||||
- bfq_log(bfqd, "bfq_bfqq_is_slow: unrealistic %u", delta_usecs);
|
||||
+ bfq_log(bfqd, "bfq_bfqq_is_slow: too short %u", delta_usecs);
|
||||
|
||||
return slow;
|
||||
}
|
||||
@@ -3067,6 +3097,7 @@ static void bfq_bfqq_expire(struct bfq_data *bfqd,
|
||||
bool slow;
|
||||
unsigned long delta = 0;
|
||||
struct bfq_entity *entity = &bfqq->entity;
|
||||
+ int ref;
|
||||
|
||||
BUG_ON(bfqq != bfqd->in_service_queue);
|
||||
|
||||
@@ -3174,12 +3205,15 @@ static void bfq_bfqq_expire(struct bfq_data *bfqd,
|
||||
__bfq_bfqq_recalc_budget(bfqd, bfqq, reason);
|
||||
BUG_ON(bfqq->next_rq == NULL &&
|
||||
bfqq->entity.budget < bfqq->entity.service);
|
||||
+ ref = bfqq->ref;
|
||||
__bfq_bfqq_expire(bfqd, bfqq);
|
||||
|
||||
- BUG_ON(!bfq_bfqq_busy(bfqq) && reason == BFQ_BFQQ_BUDGET_EXHAUSTED &&
|
||||
+ BUG_ON(ref > 1 &&
|
||||
+ !bfq_bfqq_busy(bfqq) && reason == BFQ_BFQQ_BUDGET_EXHAUSTED &&
|
||||
!bfq_class_idle(bfqq));
|
||||
|
||||
- if (!bfq_bfqq_busy(bfqq) &&
|
||||
+ /* mark bfqq as waiting a request only if a bic still points to it */
|
||||
+ if (ref > 1 && !bfq_bfqq_busy(bfqq) &&
|
||||
reason != BFQ_BFQQ_BUDGET_TIMEOUT &&
|
||||
reason != BFQ_BFQQ_BUDGET_EXHAUSTED)
|
||||
bfq_mark_bfqq_non_blocking_wait_rq(bfqq);
|
||||
@@ -3504,14 +3538,29 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
|
||||
!bfq_bfqq_must_idle(bfqq))
|
||||
goto expire;
|
||||
|
||||
+check_queue:
|
||||
+ /*
|
||||
+ * This loop is rarely executed more than once. Even when it
|
||||
+ * happens, it is much more convenient to re-execute this loop
|
||||
+ * than to return NULL and trigger a new dispatch to get a
|
||||
+ * request served.
|
||||
+ */
|
||||
next_rq = bfqq->next_rq;
|
||||
/*
|
||||
* If bfqq has requests queued and it has enough budget left to
|
||||
* serve them, keep the queue, otherwise expire it.
|
||||
*/
|
||||
if (next_rq) {
|
||||
+ BUG_ON(RB_EMPTY_ROOT(&bfqq->sort_list));
|
||||
+
|
||||
if (bfq_serv_to_charge(next_rq, bfqq) >
|
||||
bfq_bfqq_budget_left(bfqq)) {
|
||||
+ /*
|
||||
+ * Expire the queue for budget exhaustion,
|
||||
+ * which makes sure that the next budget is
|
||||
+ * enough to serve the next request, even if
|
||||
+ * it comes from the fifo expired path.
|
||||
+ */
|
||||
reason = BFQ_BFQQ_BUDGET_EXHAUSTED;
|
||||
goto expire;
|
||||
} else {
|
||||
@@ -3559,9 +3608,16 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
|
||||
bfq_bfqq_expire(bfqd, bfqq, false, reason);
|
||||
new_queue:
|
||||
bfqq = bfq_set_in_service_queue(bfqd);
|
||||
- bfq_log(bfqd, "select_queue: new queue %d returned",
|
||||
- bfqq ? bfqq->pid : 0);
|
||||
+ if (bfqq) {
|
||||
+ bfq_log_bfqq(bfqd, bfqq, "select_queue: checking new queue");
|
||||
+ goto check_queue;
|
||||
+ }
|
||||
keep_queue:
|
||||
+ if (bfqq)
|
||||
+ bfq_log_bfqq(bfqd, bfqq, "select_queue: returned this queue");
|
||||
+ else
|
||||
+ bfq_log(bfqd, "select_queue: no queue returned");
|
||||
+
|
||||
return bfqq;
|
||||
}
|
||||
|
||||
@@ -3627,45 +3683,17 @@ static int bfq_dispatch_request(struct bfq_data *bfqd,
|
||||
struct bfq_queue *bfqq)
|
||||
{
|
||||
int dispatched = 0;
|
||||
- struct request *rq;
|
||||
+ struct request *rq = bfqq->next_rq;
|
||||
unsigned long service_to_charge;
|
||||
|
||||
BUG_ON(RB_EMPTY_ROOT(&bfqq->sort_list));
|
||||
-
|
||||
- /* Follow expired path, else get first next available. */
|
||||
- rq = bfq_check_fifo(bfqq);
|
||||
- if (!rq)
|
||||
- rq = bfqq->next_rq;
|
||||
+ BUG_ON(!rq);
|
||||
service_to_charge = bfq_serv_to_charge(rq, bfqq);
|
||||
|
||||
- if (service_to_charge > bfq_bfqq_budget_left(bfqq)) {
|
||||
- /*
|
||||
- * This may happen if the next rq is chosen in fifo order
|
||||
- * instead of sector order. The budget is properly
|
||||
- * dimensioned to be always sufficient to serve the next
|
||||
- * request only if it is chosen in sector order. The reason
|
||||
- * is that it would be quite inefficient and little useful
|
||||
- * to always make sure that the budget is large enough to
|
||||
- * serve even the possible next rq in fifo order.
|
||||
- * In fact, requests are seldom served in fifo order.
|
||||
- *
|
||||
- * Expire the queue for budget exhaustion, and make sure
|
||||
- * that the next act_budget is enough to serve the next
|
||||
- * request, even if it comes from the fifo expired path.
|
||||
- */
|
||||
- bfqq->next_rq = rq;
|
||||
- /*
|
||||
- * Since this dispatch is failed, make sure that
|
||||
- * a new one will be performed
|
||||
- */
|
||||
- if (!bfqd->rq_in_driver)
|
||||
- bfq_schedule_dispatch(bfqd);
|
||||
- BUG_ON(bfqq->entity.budget < bfqq->entity.service);
|
||||
- goto expire;
|
||||
- }
|
||||
+ BUG_ON(service_to_charge > bfq_bfqq_budget_left(bfqq));
|
||||
|
||||
BUG_ON(bfqq->entity.budget < bfqq->entity.service);
|
||||
- /* Finally, insert request into driver dispatch list. */
|
||||
+
|
||||
bfq_bfqq_served(bfqq, service_to_charge);
|
||||
|
||||
BUG_ON(bfqq->entity.budget < bfqq->entity.service);
|
||||
@@ -3805,7 +3833,8 @@ static int bfq_dispatch_requests(struct request_queue *q, int force)
|
||||
* Task holds one reference to the queue, dropped when task exits. Each rq
|
||||
* in-flight on this queue also holds a reference, dropped when rq is freed.
|
||||
*
|
||||
- * Queue lock must be held here.
|
||||
+ * Queue lock must be held here. Recall not to use bfqq after calling
|
||||
+ * this function on it.
|
||||
*/
|
||||
static void bfq_put_queue(struct bfq_queue *bfqq)
|
||||
{
|
||||
@@ -3874,7 +3903,7 @@ static void bfq_exit_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq)
|
||||
|
||||
bfq_put_cooperator(bfqq);
|
||||
|
||||
- bfq_put_queue(bfqq);
|
||||
+ bfq_put_queue(bfqq); /* release process reference */
|
||||
}
|
||||
|
||||
static void bfq_init_icq(struct io_cq *icq)
|
||||
@@ -3973,6 +4002,7 @@ static void bfq_check_ioprio_change(struct bfq_io_cq *bic, struct bio *bio)
|
||||
|
||||
bfqq = bic_to_bfqq(bic, false);
|
||||
if (bfqq) {
|
||||
+ /* release process reference on this queue */
|
||||
bfq_put_queue(bfqq);
|
||||
bfqq = bfq_get_queue(bfqd, bio, BLK_RW_ASYNC, bic);
|
||||
bic_set_bfqq(bic, bfqq, false);
|
||||
@@ -4093,14 +4123,20 @@ static struct bfq_queue *bfq_get_queue(struct bfq_data *bfqd,
|
||||
* prune it.
|
||||
*/
|
||||
if (async_bfqq) {
|
||||
- bfqq->ref++;
|
||||
+ bfqq->ref++; /*
|
||||
+ * Extra group reference, w.r.t. sync
|
||||
+ * queue. This extra reference is removed
|
||||
+ * only if bfqq->bfqg disappears, to
|
||||
+ * guarantee that this queue is not freed
|
||||
+ * until its group goes away.
|
||||
+ */
|
||||
bfq_log_bfqq(bfqd, bfqq, "get_queue, bfqq not in async: %p, %d",
|
||||
bfqq, bfqq->ref);
|
||||
*async_bfqq = bfqq;
|
||||
}
|
||||
|
||||
out:
|
||||
- bfqq->ref++;
|
||||
+ bfqq->ref++; /* get a process reference to this queue */
|
||||
bfq_log_bfqq(bfqd, bfqq, "get_queue, at end: %p, %d", bfqq, bfqq->ref);
|
||||
rcu_read_unlock();
|
||||
return bfqq;
|
||||
@@ -4274,10 +4310,14 @@ static void bfq_insert_request(struct request_queue *q, struct request *rq)
|
||||
bfqq->allocated[rq_data_dir(rq)]--;
|
||||
new_bfqq->ref++;
|
||||
bfq_clear_bfqq_just_created(bfqq);
|
||||
- bfq_put_queue(bfqq);
|
||||
if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq)
|
||||
bfq_merge_bfqqs(bfqd, RQ_BIC(rq),
|
||||
bfqq, new_bfqq);
|
||||
+ /*
|
||||
+ * rq is about to be enqueued into new_bfqq,
|
||||
+ * release rq reference on bfqq
|
||||
+ */
|
||||
+ bfq_put_queue(bfqq);
|
||||
rq->elv.priv[1] = new_bfqq;
|
||||
bfqq = new_bfqq;
|
||||
}
|
||||
@@ -4697,9 +4737,8 @@ static void bfq_shutdown_timer_wq(struct bfq_data *bfqd)
|
||||
cancel_work_sync(&bfqd->unplug_work);
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_BFQ_GROUP_IOSCHED
|
||||
static void __bfq_put_async_bfqq(struct bfq_data *bfqd,
|
||||
- struct bfq_queue **bfqq_ptr)
|
||||
+ struct bfq_queue **bfqq_ptr)
|
||||
{
|
||||
struct bfq_group *root_group = bfqd->root_group;
|
||||
struct bfq_queue *bfqq = *bfqq_ptr;
|
||||
@@ -4730,7 +4769,6 @@ static void bfq_put_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg)
|
||||
|
||||
__bfq_put_async_bfqq(bfqd, &bfqg->async_idle_bfqq);
|
||||
}
|
||||
-#endif
|
||||
|
||||
static void bfq_exit_queue(struct elevator_queue *e)
|
||||
{
|
||||
@@ -4755,6 +4793,7 @@ static void bfq_exit_queue(struct elevator_queue *e)
|
||||
#ifdef CONFIG_BFQ_GROUP_IOSCHED
|
||||
blkcg_deactivate_policy(q, &blkcg_policy_bfq);
|
||||
#else
|
||||
+ bfq_put_async_queues(bfqd, bfqd->root_group);
|
||||
kfree(bfqd->root_group);
|
||||
#endif
|
||||
|
||||
@@ -5229,7 +5268,7 @@ static struct blkcg_policy blkcg_policy_bfq = {
|
||||
static int __init bfq_init(void)
|
||||
{
|
||||
int ret;
|
||||
- char msg[60] = "BFQ I/O-scheduler: v8r7";
|
||||
+ char msg[60] = "BFQ I/O-scheduler: v8r10";
|
||||
|
||||
#ifdef CONFIG_BFQ_GROUP_IOSCHED
|
||||
ret = blkcg_policy_register(&blkcg_policy_bfq);
|
||||
@@ -5255,7 +5294,7 @@ static int __init bfq_init(void)
|
||||
* be run for a long time.
|
||||
*/
|
||||
T_slow[0] = msecs_to_jiffies(3500); /* actually 4 sec */
|
||||
- T_slow[1] = msecs_to_jiffies(1000); /* actually 1.5 sec */
|
||||
+ T_slow[1] = msecs_to_jiffies(6000); /* actually 6.5 sec */
|
||||
T_fast[0] = msecs_to_jiffies(7000); /* actually 8 sec */
|
||||
T_fast[1] = msecs_to_jiffies(2500); /* actually 3 sec */
|
||||
|
||||
diff --git a/block/bfq-sched.c b/block/bfq-sched.c
|
||||
index 797bce7..70aac56 100644
|
||||
--- a/block/bfq-sched.c
|
||||
+++ b/block/bfq-sched.c
|
||||
@@ -154,7 +154,13 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
|
||||
#define for_each_entity(entity) \
|
||||
for (; entity ; entity = entity->parent)
|
||||
|
||||
-#define for_each_entity_safe(entity, parent) \
|
||||
+/*
|
||||
+ * For each iteration, compute parent in advance, so as to be safe if
|
||||
+ * entity is deallocated during the iteration. Such a deallocation may
|
||||
+ * happen as a consequence of a bfq_put_queue that frees the bfq_queue
|
||||
+ * containing entity.
|
||||
+ */
|
||||
+#define for_each_entity_safe(entity, parent) \
|
||||
for (; entity && ({ parent = entity->parent; 1; }); entity = parent)
|
||||
|
||||
/*
|
||||
@@ -691,27 +697,31 @@ static void bfq_idle_insert(struct bfq_service_tree *st,
|
||||
}
|
||||
|
||||
/**
|
||||
- * bfq_forget_entity - remove an entity from the wfq trees.
|
||||
+ * bfq_forget_entity - do not consider entity any longer for scheduling
|
||||
* @st: the service tree.
|
||||
* @entity: the entity being removed.
|
||||
+ * @is_in_service: true if entity is currently the in-service entity.
|
||||
*
|
||||
- * Update the device status and forget everything about @entity, putting
|
||||
- * the device reference to it, if it is a queue. Entities belonging to
|
||||
- * groups are not refcounted.
|
||||
+ * Forget everything about @entity. In addition, if entity represents
|
||||
+ * a queue, and the latter is not in service, then release the service
|
||||
+ * reference to the queue (the one taken through bfq_get_entity). In
|
||||
+ * fact, in this case, there is really no more service reference to
|
||||
+ * the queue, as the latter is also outside any service tree. If,
|
||||
+ * instead, the queue is in service, then __bfq_bfqd_reset_in_service
|
||||
+ * will take care of putting the reference when the queue finally
|
||||
+ * stops being served.
|
||||
*/
|
||||
static void bfq_forget_entity(struct bfq_service_tree *st,
|
||||
- struct bfq_entity *entity)
|
||||
+ struct bfq_entity *entity,
|
||||
+ bool is_in_service)
|
||||
{
|
||||
struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity);
|
||||
- struct bfq_sched_data *sd;
|
||||
-
|
||||
BUG_ON(!entity->on_st);
|
||||
|
||||
entity->on_st = false;
|
||||
st->wsum -= entity->weight;
|
||||
- if (bfqq) {
|
||||
- sd = entity->sched_data;
|
||||
- bfq_log_bfqq(bfqq->bfqd, bfqq, "forget_entity: %p %d",
|
||||
+ if (bfqq && !is_in_service) {
|
||||
+ bfq_log_bfqq(bfqq->bfqd, bfqq, "forget_entity (before): %p %d",
|
||||
bfqq, bfqq->ref);
|
||||
bfq_put_queue(bfqq);
|
||||
}
|
||||
@@ -726,7 +736,8 @@ static void bfq_put_idle_entity(struct bfq_service_tree *st,
|
||||
struct bfq_entity *entity)
|
||||
{
|
||||
bfq_idle_extract(st, entity);
|
||||
- bfq_forget_entity(st, entity);
|
||||
+ bfq_forget_entity(st, entity,
|
||||
+ entity == entity->sched_data->in_service_entity);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1082,6 +1093,12 @@ static void __bfq_activate_entity(struct bfq_entity *entity,
|
||||
*/
|
||||
entity->start = min_vstart;
|
||||
st->wsum += entity->weight;
|
||||
+ /*
|
||||
+ * entity is about to be inserted into a service tree,
|
||||
+ * and then set in service: get a reference to make
|
||||
+ * sure entity does not disappear until it is no
|
||||
+ * longer in service or scheduled for service.
|
||||
+ */
|
||||
bfq_get_entity(entity);
|
||||
|
||||
BUG_ON(entity->on_st && bfqq);
|
||||
@@ -1264,27 +1281,27 @@ static bool __bfq_deactivate_entity(struct bfq_entity *entity,
|
||||
{
|
||||
struct bfq_sched_data *sd = entity->sched_data;
|
||||
struct bfq_service_tree *st = bfq_entity_service_tree(entity);
|
||||
- bool was_in_service = entity == sd->in_service_entity;
|
||||
+ bool is_in_service = entity == sd->in_service_entity;
|
||||
|
||||
if (!entity->on_st) { /* entity never activated, or already inactive */
|
||||
BUG_ON(entity == entity->sched_data->in_service_entity);
|
||||
return false;
|
||||
}
|
||||
|
||||
- BUG_ON(was_in_service && entity->tree && entity->tree != &st->active);
|
||||
+ BUG_ON(is_in_service && entity->tree && entity->tree != &st->active);
|
||||
|
||||
- if (was_in_service)
|
||||
+ if (is_in_service)
|
||||
bfq_calc_finish(entity, entity->service);
|
||||
|
||||
if (entity->tree == &st->active)
|
||||
bfq_active_extract(st, entity);
|
||||
- else if (!was_in_service && entity->tree == &st->idle)
|
||||
+ else if (!is_in_service && entity->tree == &st->idle)
|
||||
bfq_idle_extract(st, entity);
|
||||
else if (entity->tree)
|
||||
BUG();
|
||||
|
||||
if (!ins_into_idle_tree || !bfq_gt(entity->finish, st->vtime))
|
||||
- bfq_forget_entity(st, entity);
|
||||
+ bfq_forget_entity(st, entity, is_in_service);
|
||||
else
|
||||
bfq_idle_insert(st, entity);
|
||||
|
||||
@@ -1301,7 +1318,7 @@ static void bfq_deactivate_entity(struct bfq_entity *entity,
|
||||
bool expiration)
|
||||
{
|
||||
struct bfq_sched_data *sd;
|
||||
- struct bfq_entity *parent;
|
||||
+ struct bfq_entity *parent = NULL;
|
||||
|
||||
for_each_entity_safe(entity, parent) {
|
||||
sd = entity->sched_data;
|
||||
@@ -1320,8 +1337,8 @@ static void bfq_deactivate_entity(struct bfq_entity *entity,
|
||||
|
||||
if (!__bfq_deactivate_entity(entity, ins_into_idle_tree)) {
|
||||
/*
|
||||
- * Entity is not any tree any more, so, this
|
||||
- * deactivation is a no-op, and there is
|
||||
+ * entity is not in any tree any more, so
|
||||
+ * this deactivation is a no-op, and there is
|
||||
* nothing to change for upper-level entities
|
||||
* (in case of expiration, this can never
|
||||
* happen).
|
||||
@@ -1821,14 +1838,16 @@ static struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd)
|
||||
|
||||
static void __bfq_bfqd_reset_in_service(struct bfq_data *bfqd)
|
||||
{
|
||||
- struct bfq_entity *entity = &bfqd->in_service_queue->entity;
|
||||
+ struct bfq_queue *in_serv_bfqq = bfqd->in_service_queue;
|
||||
+ struct bfq_entity *in_serv_entity = &in_serv_bfqq->entity;
|
||||
+ struct bfq_entity *entity = in_serv_entity;
|
||||
|
||||
if (bfqd->in_service_bic) {
|
||||
put_io_context(bfqd->in_service_bic->icq.ioc);
|
||||
bfqd->in_service_bic = NULL;
|
||||
}
|
||||
|
||||
- bfq_clear_bfqq_wait_request(bfqd->in_service_queue);
|
||||
+ bfq_clear_bfqq_wait_request(in_serv_bfqq);
|
||||
hrtimer_try_to_cancel(&bfqd->idle_slice_timer);
|
||||
bfqd->in_service_queue = NULL;
|
||||
|
||||
@@ -1840,6 +1859,14 @@ static void __bfq_bfqd_reset_in_service(struct bfq_data *bfqd)
|
||||
*/
|
||||
for_each_entity(entity)
|
||||
entity->sched_data->in_service_entity = NULL;
|
||||
+
|
||||
+ /*
|
||||
+ * in_serv_entity is no longer in service, so, if it is in no
|
||||
+ * service tree either, then release the service reference to
|
||||
+ * the queue it represents (taken with bfq_get_entity).
|
||||
+ */
|
||||
+ if (!in_serv_entity->on_st)
|
||||
+ bfq_put_queue(in_serv_bfqq);
|
||||
}
|
||||
|
||||
static void bfq_deactivate_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
@@ -1904,8 +1931,6 @@ static void bfq_del_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq,
|
||||
BUG_ON(bfqq->entity.budget < 0);
|
||||
|
||||
bfq_deactivate_bfqq(bfqd, bfqq, true, expiration);
|
||||
-
|
||||
- BUG_ON(bfqq->entity.budget < 0);
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/block/bfq.h b/block/bfq.h
|
||||
index a9da002..e3855af 100644
|
||||
--- a/block/bfq.h
|
||||
+++ b/block/bfq.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * BFQ v8r7 for 4.9.0: data structures and common functions prototypes.
|
||||
+ * BFQ v8r10 for 4.9.0: data structures and common functions prototypes.
|
||||
*
|
||||
* Based on ideas and code from CFQ:
|
||||
* Copyright (C) 2003 Jens Axboe <axboe@kernel.dk>
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* Copyright (C) 2015 Paolo Valente <paolo.valente@unimore.it>
|
||||
*
|
||||
- * Copyright (C) 2016 Paolo Valente <paolo.valente@linaro.org>
|
||||
+ * Copyright (C) 2017 Paolo Valente <paolo.valente@linaro.org>
|
||||
*/
|
||||
|
||||
#ifndef _BFQ_H
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
agp/intel: add new host bridge id for Q57 system
|
||||
|
||||
Add new Host Bridge ID found on a Q57 based system from Positivo. I
|
||||
don't know what abbreviation id for this would be best, may be Q_HB
|
||||
instead of UNKNOWN currently used would be better.
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
|
||||
[ rebased for 3.8-rc3 /tmb ]
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
Removed the parts of the patch that are already applied in the kernel by
|
||||
the commit 67384fe3fd450536342330f684ea1f7dcaef8130:
|
||||
"char/agp: add another Ironlake host bridge"
|
||||
|
||||
Rediffed for kernel 3.10.24.
|
||||
|
||||
Signed-off-by: Eugene A. Shatokhin <eugene.shatokhin@rosalab.ru>
|
||||
|
||||
drivers/char/agp/intel-gtt.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff -Nurp linux-3.8-rc3/drivers/char/agp/intel-gtt.c linux-3.8-rc3.q57/drivers/char/agp/intel-gtt.c
|
||||
--- linux-3.8-rc3/drivers/char/agp/intel-gtt.c 2013-01-10 08:17:09.690594184 +0200
|
||||
+++ linux-3.8-rc3.q57/drivers/char/agp/intel-gtt.c 2013-01-10 08:38:56.649888839 +0200
|
||||
@@ -1303,6 +1303,8 @@ static const struct intel_gtt_driver_des
|
||||
&g4x_gtt_driver },
|
||||
{ PCI_DEVICE_ID_INTEL_IRONLAKE_D_IG,
|
||||
"HD Graphics", &ironlake_gtt_driver },
|
||||
+ { PCI_DEVICE_ID_INTEL_IRONLAKE_D2_HB,
|
||||
+ "HD Graphics", &ironlake_gtt_driver },
|
||||
{ PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG,
|
||||
"HD Graphics", &ironlake_gtt_driver },
|
||||
{ 0, NULL, NULL }
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
From bc33c5df710c0aae6db396146194108634ef6f60 Mon Sep 17 00:00:00 2001
|
||||
From: "Winkler, Tomas" <tomas.winkler@intel.com>
|
||||
Date: Mon, 12 Sep 2016 16:04:19 +0300
|
||||
Subject: [PATCH] tmp/tpm_crb: fix Intel PTT hw bug during idle state
|
||||
|
||||
There is a HW bug in Skylake, and Broxton PCH Intel PTT device, where
|
||||
most of the registers in the control area except START, REQUEST, CANCEL,
|
||||
and LOC_CTRL lost retention when the device is in the idle state. Hence
|
||||
we need to bring the device to ready state before accessing the other
|
||||
registers. The fix brings device to ready state before trying to read
|
||||
command and response buffer addresses in order to remap the for access.
|
||||
|
||||
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
|
||||
Tested-by: Jarkko Sakkinen <jarkko.sakkinn@linux.intel.com>
|
||||
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinn@linux.intel.com>
|
||||
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
---
|
||||
drivers/char/tpm/tpm_crb.c | 47 ++++++++++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 39 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
|
||||
index 8dd0f20..ff0d505 100644
|
||||
--- a/drivers/char/tpm/tpm_crb.c
|
||||
+++ b/drivers/char/tpm/tpm_crb.c
|
||||
@@ -315,6 +315,7 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
|
||||
struct list_head resources;
|
||||
struct resource io_res;
|
||||
struct device *dev = &device->dev;
|
||||
+ u32 pa_high, pa_low;
|
||||
u64 cmd_pa;
|
||||
u32 cmd_size;
|
||||
u64 rsp_pa;
|
||||
@@ -342,12 +343,27 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
|
||||
if (IS_ERR(priv->cca))
|
||||
return PTR_ERR(priv->cca);
|
||||
|
||||
- cmd_pa = ((u64) ioread32(&priv->cca->cmd_pa_high) << 32) |
|
||||
- (u64) ioread32(&priv->cca->cmd_pa_low);
|
||||
+ /*
|
||||
+ * PTT HW bug w/a: wake up the device to access
|
||||
+ * possibly not retained registers.
|
||||
+ */
|
||||
+ ret = crb_cmd_ready(dev, priv);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ pa_high = ioread32(&priv->cca->cmd_pa_high);
|
||||
+ pa_low = ioread32(&priv->cca->cmd_pa_low);
|
||||
+ cmd_pa = ((u64)pa_high << 32) | pa_low;
|
||||
cmd_size = ioread32(&priv->cca->cmd_size);
|
||||
+
|
||||
+ dev_dbg(dev, "cmd_hi = %X cmd_low = %X cmd_size %X\n",
|
||||
+ pa_high, pa_low, cmd_size);
|
||||
+
|
||||
priv->cmd = crb_map_res(dev, priv, &io_res, cmd_pa, cmd_size);
|
||||
- if (IS_ERR(priv->cmd))
|
||||
- return PTR_ERR(priv->cmd);
|
||||
+ if (IS_ERR(priv->cmd)) {
|
||||
+ ret = PTR_ERR(priv->cmd);
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
memcpy_fromio(&rsp_pa, &priv->cca->rsp_pa, 8);
|
||||
rsp_pa = le64_to_cpu(rsp_pa);
|
||||
@@ -355,7 +371,8 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
|
||||
|
||||
if (cmd_pa != rsp_pa) {
|
||||
priv->rsp = crb_map_res(dev, priv, &io_res, rsp_pa, rsp_size);
|
||||
- return PTR_ERR_OR_ZERO(priv->rsp);
|
||||
+ ret = PTR_ERR_OR_ZERO(priv->rsp);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
/* According to the PTP specification, overlapping command and response
|
||||
@@ -363,12 +380,18 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,
|
||||
*/
|
||||
if (cmd_size != rsp_size) {
|
||||
dev_err(dev, FW_BUG "overlapping command and response buffer sizes are not identical");
|
||||
- return -EINVAL;
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
}
|
||||
+
|
||||
priv->cmd_size = cmd_size;
|
||||
|
||||
priv->rsp = priv->cmd;
|
||||
- return 0;
|
||||
+
|
||||
+out:
|
||||
+ crb_go_idle(dev, priv);
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int crb_acpi_add(struct acpi_device *device)
|
||||
@@ -412,7 +435,15 @@ static int crb_acpi_add(struct acpi_device *device)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
- return crb_init(device, priv);
|
||||
+ rc = crb_cmd_ready(dev, priv);
|
||||
+ if (rc)
|
||||
+ return rc;
|
||||
+
|
||||
+ rc = crb_init(device, priv);
|
||||
+ if (rc)
|
||||
+ crb_go_idle(dev, priv);
|
||||
+
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
static int crb_acpi_remove(struct acpi_device *device)
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
From e74f2f76c13770bb8e004475a933923e9c92723d Mon Sep 17 00:00:00 2001
|
||||
From: "Winkler, Tomas" <tomas.winkler@intel.com>
|
||||
Date: Sat, 8 Oct 2016 14:59:39 +0300
|
||||
Subject: [PATCH] tmp/tpm_crb: implement runtime pm for tpm_crb
|
||||
|
||||
Utilize runtime_pm for driving tpm crb idle states.
|
||||
The framework calls cmd_ready from the pm_runtime_resume handler
|
||||
and go idle from the pm_runtime_suspend handler.
|
||||
The TPM framework should wake the device before transmit and receive.
|
||||
In case the runtime_pm framework is not compiled in or enabled, the device
|
||||
will be in the permanent ready state.
|
||||
|
||||
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
|
||||
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
---
|
||||
drivers/char/tpm/tpm-interface.c | 5 +++++
|
||||
drivers/char/tpm/tpm_crb.c | 42 ++++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 43 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
|
||||
index 3a9149c..cb0e57e 100644
|
||||
--- a/drivers/char/tpm/tpm-interface.c
|
||||
+++ b/drivers/char/tpm/tpm-interface.c
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/freezer.h>
|
||||
+#include <linux/pm_runtime.h>
|
||||
|
||||
#include "tpm.h"
|
||||
#include "tpm_eventlog.h"
|
||||
@@ -356,6 +357,8 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
|
||||
if (!(flags & TPM_TRANSMIT_UNLOCKED))
|
||||
mutex_lock(&chip->tpm_mutex);
|
||||
|
||||
+ pm_runtime_get_sync(chip->dev.parent);
|
||||
+
|
||||
rc = chip->ops->send(chip, (u8 *) buf, count);
|
||||
if (rc < 0) {
|
||||
dev_err(&chip->dev,
|
||||
@@ -397,6 +400,8 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
|
||||
dev_err(&chip->dev,
|
||||
"tpm_transmit: tpm_recv: error %zd\n", rc);
|
||||
out:
|
||||
+ pm_runtime_put_sync(chip->dev.parent);
|
||||
+
|
||||
if (!(flags & TPM_TRANSMIT_UNLOCKED))
|
||||
mutex_unlock(&chip->tpm_mutex);
|
||||
return rc;
|
||||
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
|
||||
index f579f1a..717b6b4 100644
|
||||
--- a/drivers/char/tpm/tpm_crb.c
|
||||
+++ b/drivers/char/tpm/tpm_crb.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/rculist.h>
|
||||
#include <linux/module.h>
|
||||
+#include <linux/pm_runtime.h>
|
||||
#include "tpm.h"
|
||||
|
||||
#define ACPI_SIG_TPM2 "TPM2"
|
||||
@@ -149,8 +150,6 @@ static int __maybe_unused crb_cmd_ready(struct device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static SIMPLE_DEV_PM_OPS(crb_pm, tpm_pm_suspend, tpm_pm_resume);
|
||||
-
|
||||
static u8 crb_status(struct tpm_chip *chip)
|
||||
{
|
||||
struct crb_priv *priv = dev_get_drvdata(&chip->dev);
|
||||
@@ -433,11 +432,21 @@ static int crb_acpi_add(struct acpi_device *device)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
+ pm_runtime_get_noresume(dev);
|
||||
+ pm_runtime_set_active(dev);
|
||||
+ pm_runtime_enable(dev);
|
||||
+
|
||||
rc = tpm_chip_register(chip);
|
||||
- if (rc)
|
||||
+ if (rc) {
|
||||
crb_go_idle(dev, priv);
|
||||
+ pm_runtime_put_noidle(dev);
|
||||
+ pm_runtime_disable(dev);
|
||||
+ return rc;
|
||||
+ }
|
||||
|
||||
- return rc;
|
||||
+ pm_runtime_put(dev);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static int crb_acpi_remove(struct acpi_device *device)
|
||||
@@ -447,9 +456,34 @@ static int crb_acpi_remove(struct acpi_device *device)
|
||||
|
||||
tpm_chip_unregister(chip);
|
||||
|
||||
+ pm_runtime_disable(dev);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_PM
|
||||
+static int crb_pm_runtime_suspend(struct device *dev)
|
||||
+{
|
||||
+ struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||
+ struct crb_priv *priv = dev_get_drvdata(&chip->dev);
|
||||
+
|
||||
+ return crb_go_idle(dev, priv);
|
||||
+}
|
||||
+
|
||||
+static int crb_pm_runtime_resume(struct device *dev)
|
||||
+{
|
||||
+ struct tpm_chip *chip = dev_get_drvdata(dev);
|
||||
+ struct crb_priv *priv = dev_get_drvdata(&chip->dev);
|
||||
+
|
||||
+ return crb_cmd_ready(dev, priv);
|
||||
+}
|
||||
+#endif /* CONFIG_PM */
|
||||
+
|
||||
+static const struct dev_pm_ops crb_pm = {
|
||||
+ SET_SYSTEM_SLEEP_PM_OPS(tpm_pm_suspend, tpm_pm_resume)
|
||||
+ SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
|
||||
+};
|
||||
+
|
||||
static struct acpi_device_id crb_device_ids[] = {
|
||||
{"MSFT0101", 0},
|
||||
{"", 0},
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
From ba5287b6ef6a2ee91dc6cc0829649cecf7b70253 Mon Sep 17 00:00:00 2001
|
||||
From: "Winkler, Tomas" <tomas.winkler@intel.com>
|
||||
Date: Thu, 15 Sep 2016 10:27:38 +0300
|
||||
Subject: [PATCH] tpm/tpm_crb: implement tpm crb idle state
|
||||
|
||||
The register TPM_CRB_CTRL_REQ_x contains bits goIdle and cmdReady for
|
||||
SW to indicate that the device can enter or should exit the idle state.
|
||||
|
||||
The legacy ACPI-start (SMI + DMA) based devices do not support these
|
||||
bits and the idle state management is not exposed to the host SW.
|
||||
Thus, this functionality only is enabled only for a CRB start (MMIO)
|
||||
based devices.
|
||||
|
||||
Based on Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
original patch:
|
||||
'tpm_crb: implement power tpm crb power management'
|
||||
|
||||
To keep the implementation local to the hw we don't use wait_for_tpm_stat
|
||||
for polling the TPM_CRB_CTRL_REQ.
|
||||
|
||||
[jarkko.sakkinen@linux.intel.com: removed cmdReady debug trace on a
|
||||
success case due the heavy amount of log traffic it causes.]
|
||||
|
||||
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
|
||||
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
---
|
||||
drivers/char/tpm/tpm_crb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 66 insertions(+)
|
||||
|
||||
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
|
||||
index a7c870a..8dd0f20 100644
|
||||
--- a/drivers/char/tpm/tpm_crb.c
|
||||
+++ b/drivers/char/tpm/tpm_crb.c
|
||||
@@ -83,6 +83,72 @@ struct crb_priv {
|
||||
u32 cmd_size;
|
||||
};
|
||||
|
||||
+/**
|
||||
+ * crb_go_idle - request tpm crb device to go the idle state
|
||||
+ *
|
||||
+ * @dev: crb device
|
||||
+ * @priv: crb private data
|
||||
+ *
|
||||
+ * Write CRB_CTRL_REQ_GO_IDLE to TPM_CRB_CTRL_REQ
|
||||
+ * The device should respond within TIMEOUT_C by clearing the bit.
|
||||
+ * Anyhow, we do not wait here as a consequent CMD_READY request
|
||||
+ * will be handled correctly even if idle was not completed.
|
||||
+ *
|
||||
+ * The function does nothing for devices with ACPI-start method.
|
||||
+ *
|
||||
+ * Return: 0 always
|
||||
+ */
|
||||
+static int __maybe_unused crb_go_idle(struct device *dev, struct crb_priv *priv)
|
||||
+{
|
||||
+ if (priv->flags & CRB_FL_ACPI_START)
|
||||
+ return 0;
|
||||
+
|
||||
+ iowrite32(CRB_CTRL_REQ_GO_IDLE, &priv->cca->req);
|
||||
+ /* we don't really care when this settles */
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * crb_cmd_ready - request tpm crb device to enter ready state
|
||||
+ *
|
||||
+ * @dev: crb device
|
||||
+ * @priv: crb private data
|
||||
+ *
|
||||
+ * Write CRB_CTRL_REQ_CMD_READY to TPM_CRB_CTRL_REQ
|
||||
+ * and poll till the device acknowledge it by clearing the bit.
|
||||
+ * The device should respond within TIMEOUT_C.
|
||||
+ *
|
||||
+ * The function does nothing for devices with ACPI-start method
|
||||
+ *
|
||||
+ * Return: 0 on success -ETIME on timeout;
|
||||
+ */
|
||||
+static int __maybe_unused crb_cmd_ready(struct device *dev,
|
||||
+ struct crb_priv *priv)
|
||||
+{
|
||||
+ ktime_t stop, start;
|
||||
+
|
||||
+ if (priv->flags & CRB_FL_ACPI_START)
|
||||
+ return 0;
|
||||
+
|
||||
+ iowrite32(CRB_CTRL_REQ_CMD_READY, &priv->cca->req);
|
||||
+
|
||||
+ start = ktime_get();
|
||||
+ stop = ktime_add(start, ms_to_ktime(TPM2_TIMEOUT_C));
|
||||
+ do {
|
||||
+ if (!(ioread32(&priv->cca->req) & CRB_CTRL_REQ_CMD_READY))
|
||||
+ return 0;
|
||||
+ usleep_range(50, 100);
|
||||
+ } while (ktime_before(ktime_get(), stop));
|
||||
+
|
||||
+ if (ioread32(&priv->cca->req) & CRB_CTRL_REQ_CMD_READY) {
|
||||
+ dev_warn(dev, "cmdReady timed out\n");
|
||||
+ return -ETIME;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static SIMPLE_DEV_PM_OPS(crb_pm, tpm_pm_suspend, tpm_pm_resume);
|
||||
|
||||
static u8 crb_status(struct tpm_chip *chip)
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
From c58bd34cec4c05f8e3362a79ae94de9f405c39b5 Mon Sep 17 00:00:00 2001
|
||||
From: "Winkler, Tomas" <tomas.winkler@intel.com>
|
||||
Date: Mon, 12 Sep 2016 16:04:20 +0300
|
||||
Subject: [PATCH] tpm/tpm_crb: open code the crb_init into acpi_add
|
||||
|
||||
This is preparation step for implementing tpm crb
|
||||
runtime pm. We need to have tpm chip allocated
|
||||
and populated before we access the runtime handlers.
|
||||
|
||||
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
|
||||
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
|
||||
---
|
||||
drivers/char/tpm/tpm_crb.c | 26 ++++++++++----------------
|
||||
1 file changed, 10 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
|
||||
index ff0d505..f579f1a 100644
|
||||
--- a/drivers/char/tpm/tpm_crb.c
|
||||
+++ b/drivers/char/tpm/tpm_crb.c
|
||||
@@ -262,21 +262,6 @@ static const struct tpm_class_ops tpm_crb = {
|
||||
.req_complete_val = CRB_DRV_STS_COMPLETE,
|
||||
};
|
||||
|
||||
-static int crb_init(struct acpi_device *device, struct crb_priv *priv)
|
||||
-{
|
||||
- struct tpm_chip *chip;
|
||||
-
|
||||
- chip = tpmm_chip_alloc(&device->dev, &tpm_crb);
|
||||
- if (IS_ERR(chip))
|
||||
- return PTR_ERR(chip);
|
||||
-
|
||||
- dev_set_drvdata(&chip->dev, priv);
|
||||
- chip->acpi_dev_handle = device->handle;
|
||||
- chip->flags = TPM_CHIP_FLAG_TPM2;
|
||||
-
|
||||
- return tpm_chip_register(chip);
|
||||
-}
|
||||
-
|
||||
static int crb_check_resource(struct acpi_resource *ares, void *data)
|
||||
{
|
||||
struct resource *io_res = data;
|
||||
@@ -398,6 +383,7 @@ static int crb_acpi_add(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_table_tpm2 *buf;
|
||||
struct crb_priv *priv;
|
||||
+ struct tpm_chip *chip;
|
||||
struct device *dev = &device->dev;
|
||||
acpi_status status;
|
||||
u32 sm;
|
||||
@@ -435,11 +421,19 @@ static int crb_acpi_add(struct acpi_device *device)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
+ chip = tpmm_chip_alloc(dev, &tpm_crb);
|
||||
+ if (IS_ERR(chip))
|
||||
+ return PTR_ERR(chip);
|
||||
+
|
||||
+ dev_set_drvdata(&chip->dev, priv);
|
||||
+ chip->acpi_dev_handle = device->handle;
|
||||
+ chip->flags = TPM_CHIP_FLAG_TPM2;
|
||||
+
|
||||
rc = crb_cmd_ready(dev, priv);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
- rc = crb_init(device, priv);
|
||||
+ rc = tpm_chip_register(chip);
|
||||
if (rc)
|
||||
crb_go_idle(dev, priv);
|
||||
|
||||
--
|
||||
2.10.2
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
This patch adds module aliases for matching the old dm-raid45 patch
|
||||
by heinzm@redhat.com carried by kernel-tmb series in order to make
|
||||
sure there is an upgrade path.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
drivers/md/dm-raid.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- linux/drivers/md/dm-raid.c.orig
|
||||
+++ linux/drivers/md/dm-raid.c
|
||||
@@ -3689,6 +3689,8 @@ MODULE_ALIAS("dm-raid10");
|
||||
MODULE_ALIAS("dm-raid4");
|
||||
MODULE_ALIAS("dm-raid5");
|
||||
MODULE_ALIAS("dm-raid6");
|
||||
+MODULE_ALIAS("dm-raid45");
|
||||
+MODULE_ALIAS("dm-raid4-5");
|
||||
MODULE_AUTHOR("Neil Brown <dm-devel@redhat.com>");
|
||||
MODULE_AUTHOR("Heinz Mauelshagen <dm-devel@redhat.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
|
||||
This patch adds missing module aliases for the old ieee1394 stack
|
||||
to make it easier for endusers.
|
||||
|
||||
Note: firewire-sbp2 and firewire-ohci already contains the needed aliases.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -Nurp linux-2.6.38.4/drivers/firewire/core-transaction.c linux-2.6.38.4.fw/drivers/firewire/core-transaction.c
|
||||
--- linux-2.6.38.4/drivers/firewire/core-transaction.c 2011-03-15 03:20:32.000000000 +0200
|
||||
+++ linux-2.6.38.4.fw/drivers/firewire/core-transaction.c 2011-04-22 16:22:28.461386738 +0300
|
||||
@@ -1174,6 +1174,9 @@ static struct fw_address_handler registe
|
||||
MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
|
||||
MODULE_DESCRIPTION("Core IEEE1394 transaction logic");
|
||||
MODULE_LICENSE("GPL");
|
||||
+MODULE_ALIAS("ieee1394");
|
||||
+MODULE_ALIAS("raw1394");
|
||||
+MODULE_ALIAS("video1394");
|
||||
|
||||
static const u32 vendor_textual_descriptor[] = {
|
||||
/* textual descriptor leaf () */
|
||||
diff -Nurp linux-2.6.38.4/drivers/firewire/net.c linux-2.6.38.4.fw/drivers/firewire/net.c
|
||||
--- linux-2.6.38.4/drivers/firewire/net.c 2011-03-15 03:20:32.000000000 +0200
|
||||
+++ linux-2.6.38.4.fw/drivers/firewire/net.c 2011-04-22 16:20:34.008883920 +0300
|
||||
@@ -1719,3 +1719,4 @@ MODULE_AUTHOR("Jay Fenlason <fenlason@re
|
||||
MODULE_DESCRIPTION("IP over IEEE1394 as per RFC 2734/3146");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DEVICE_TABLE(ieee1394, fwnet_id_table);
|
||||
+MODULE_ALIAS("eth1394");
|
||||
@@ -0,0 +1,402 @@
|
||||
|
||||
fs/aufs/Kconfig | 2 +-
|
||||
fs/dcache.c | 2 ++
|
||||
fs/exec.c | 1 +
|
||||
fs/fcntl.c | 1 +
|
||||
fs/file_table.c | 4 ++++
|
||||
fs/inode.c | 1 +
|
||||
fs/namespace.c | 2 ++
|
||||
fs/notify/group.c | 4 ++++
|
||||
fs/notify/mark.c | 4 ++++
|
||||
fs/open.c | 2 ++
|
||||
fs/read_write.c | 2 ++
|
||||
fs/splice.c | 2 ++
|
||||
fs/xattr.c | 1 +
|
||||
kernel/task_work.c | 1 +
|
||||
security/commoncap.c | 2 ++
|
||||
security/device_cgroup.c | 2 ++
|
||||
security/security.c | 10 ++++++++++
|
||||
17 files changed, 42 insertions(+), 1 deletion(-)
|
||||
|
||||
diff -Nurp linux-4.9-aufs/fs/aufs/Kconfig linux-4.9-aufs-mod/fs/aufs/Kconfig
|
||||
--- linux-4.9-aufs/fs/aufs/Kconfig 2016-12-31 00:31:52.367789380 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/aufs/Kconfig 2016-12-31 00:32:35.153785422 +0200
|
||||
@@ -1,5 +1,5 @@
|
||||
config AUFS_FS
|
||||
- bool "Aufs (Advanced multi layered unification filesystem) support"
|
||||
+ tristate "Aufs (Advanced multi layered unification filesystem) support"
|
||||
help
|
||||
Aufs is a stackable unification filesystem such as Unionfs,
|
||||
which unifies several directories and provides a merged single
|
||||
diff -Nurp linux-4.9-aufs/fs/dcache.c linux-4.9-aufs-mod/fs/dcache.c
|
||||
--- linux-4.9-aufs/fs/dcache.c 2016-12-31 00:31:52.379789379 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/dcache.c 2016-12-31 01:49:12.324360147 +0200
|
||||
@@ -1272,6 +1272,7 @@ rename_retry:
|
||||
seq = 1;
|
||||
goto again;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(d_walk);
|
||||
|
||||
/*
|
||||
* Search for at least 1 mount point in the dentry's subdirs.
|
||||
@@ -2855,6 +2856,7 @@ void d_exchange(struct dentry *dentry1,
|
||||
|
||||
write_sequnlock(&rename_lock);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(d_exchange);
|
||||
|
||||
/**
|
||||
* d_ancestor - search for an ancestor
|
||||
diff -Nurp linux-4.9-aufs/fs/exec.c linux-4.9-aufs-mod/fs/exec.c
|
||||
--- linux-4.9-aufs/fs/exec.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/exec.c 2016-12-31 00:32:35.153785422 +0200
|
||||
@@ -104,6 +104,7 @@ bool path_noexec(const struct path *path
|
||||
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
|
||||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(path_noexec);
|
||||
|
||||
#ifdef CONFIG_USELIB
|
||||
/*
|
||||
diff -Nurp linux-4.9-aufs/fs/fcntl.c linux-4.9-aufs-mod/fs/fcntl.c
|
||||
--- linux-4.9-aufs/fs/fcntl.c 2016-12-31 00:31:52.379789379 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/fcntl.c 2016-12-31 00:32:35.154785422 +0200
|
||||
@@ -82,6 +82,7 @@ int setfl(int fd, struct file * filp, un
|
||||
out:
|
||||
return error;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(setfl);
|
||||
|
||||
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
|
||||
int force)
|
||||
diff -Nurp linux-4.9-aufs/fs/file_table.c linux-4.9-aufs-mod/fs/file_table.c
|
||||
--- linux-4.9-aufs/fs/file_table.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/file_table.c 2016-12-31 00:32:35.154785422 +0200
|
||||
@@ -147,6 +147,7 @@ over:
|
||||
}
|
||||
return ERR_PTR(-ENFILE);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(get_empty_filp);
|
||||
|
||||
/**
|
||||
* alloc_file - allocate and initialize a 'struct file'
|
||||
@@ -258,6 +259,7 @@ void flush_delayed_fput(void)
|
||||
{
|
||||
delayed_fput(NULL);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(flush_delayed_fput);
|
||||
|
||||
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
|
||||
|
||||
@@ -300,6 +302,7 @@ void __fput_sync(struct file *file)
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(fput);
|
||||
+EXPORT_SYMBOL_GPL(__fput_sync);
|
||||
|
||||
void put_filp(struct file *file)
|
||||
{
|
||||
@@ -308,6 +311,7 @@ void put_filp(struct file *file)
|
||||
file_free(file);
|
||||
}
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(put_filp);
|
||||
|
||||
void __init files_init(void)
|
||||
{
|
||||
diff -Nurp linux-4.9-aufs/fs/inode.c linux-4.9-aufs-mod/fs/inode.c
|
||||
--- linux-4.9-aufs/fs/inode.c 2016-12-31 00:31:52.379789379 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/inode.c 2016-12-31 00:32:35.154785422 +0200
|
||||
@@ -1651,6 +1651,7 @@ int update_time(struct inode *inode, str
|
||||
|
||||
return update_time(inode, time, flags);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(update_time);
|
||||
|
||||
/**
|
||||
* touch_atime - update the access time
|
||||
diff -Nurp linux-4.9-aufs/fs/namespace.c linux-4.9-aufs-mod/fs/namespace.c
|
||||
--- linux-4.9-aufs/fs/namespace.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/namespace.c 2016-12-31 00:32:35.154785422 +0200
|
||||
@@ -466,6 +466,7 @@ void __mnt_drop_write(struct vfsmount *m
|
||||
mnt_dec_writers(real_mount(mnt));
|
||||
preempt_enable();
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(__mnt_drop_write);
|
||||
|
||||
/**
|
||||
* mnt_drop_write - give up write access to a mount
|
||||
@@ -1823,6 +1824,7 @@ int iterate_mounts(int (*f)(struct vfsmo
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(iterate_mounts);
|
||||
|
||||
static void cleanup_group_ids(struct mount *mnt, struct mount *end)
|
||||
{
|
||||
diff -Nurp linux-4.9-aufs/fs/notify/group.c linux-4.9-aufs-mod/fs/notify/group.c
|
||||
--- linux-4.9-aufs/fs/notify/group.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/notify/group.c 2016-12-31 00:32:35.155785422 +0200
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <linux/srcu.h>
|
||||
#include <linux/rculist.h>
|
||||
#include <linux/wait.h>
|
||||
+#include <linux/module.h>
|
||||
|
||||
#include <linux/fsnotify_backend.h>
|
||||
#include "fsnotify.h"
|
||||
@@ -100,6 +101,7 @@ void fsnotify_get_group(struct fsnotify_
|
||||
{
|
||||
atomic_inc(&group->refcnt);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_get_group);
|
||||
|
||||
/*
|
||||
* Drop a reference to a group. Free it if it's through.
|
||||
@@ -109,6 +111,7 @@ void fsnotify_put_group(struct fsnotify_
|
||||
if (atomic_dec_and_test(&group->refcnt))
|
||||
fsnotify_final_destroy_group(group);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_put_group);
|
||||
|
||||
/*
|
||||
* Create a new fsnotify_group and hold a reference for the group returned.
|
||||
@@ -137,6 +140,7 @@ struct fsnotify_group *fsnotify_alloc_gr
|
||||
|
||||
return group;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
|
||||
|
||||
int fsnotify_fasync(int fd, struct file *file, int on)
|
||||
{
|
||||
diff -Nurp linux-4.9-aufs/fs/notify/mark.c linux-4.9-aufs-mod/fs/notify/mark.c
|
||||
--- linux-4.9-aufs/fs/notify/mark.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/notify/mark.c 2016-12-31 00:32:35.155785422 +0200
|
||||
@@ -113,6 +113,7 @@ void fsnotify_put_mark(struct fsnotify_m
|
||||
mark->free_mark(mark);
|
||||
}
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_put_mark);
|
||||
|
||||
/* Calculate mask of events for a list of marks */
|
||||
u32 fsnotify_recalc_mask(struct hlist_head *head)
|
||||
@@ -230,6 +231,7 @@ void fsnotify_destroy_mark(struct fsnoti
|
||||
mutex_unlock(&group->mark_mutex);
|
||||
fsnotify_free_mark(mark);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
|
||||
|
||||
void fsnotify_destroy_marks(struct hlist_head *head, spinlock_t *lock)
|
||||
{
|
||||
@@ -415,6 +417,7 @@ err:
|
||||
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_add_mark);
|
||||
|
||||
int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
|
||||
struct inode *inode, struct vfsmount *mnt, int allow_dups)
|
||||
@@ -521,6 +524,7 @@ void fsnotify_duplicate_mark(struct fsno
|
||||
new->mask = old->mask;
|
||||
new->free_mark = old->free_mark;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
|
||||
|
||||
/*
|
||||
* Nothing fancy, just initialize lists and locks and counters.
|
||||
diff -Nurp linux-4.9-aufs/fs/open.c linux-4.9-aufs-mod/fs/open.c
|
||||
--- linux-4.9-aufs/fs/open.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/open.c 2016-12-31 00:32:35.155785422 +0200
|
||||
@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, l
|
||||
inode_unlock(dentry->d_inode);
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(do_truncate);
|
||||
|
||||
long vfs_truncate(const struct path *path, loff_t length)
|
||||
{
|
||||
@@ -695,6 +696,7 @@ int open_check_o_direct(struct file *f)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(open_check_o_direct);
|
||||
|
||||
static int do_dentry_open(struct file *f,
|
||||
struct inode *inode,
|
||||
diff -Nurp linux-4.9-aufs/fs/read_write.c linux-4.9-aufs-mod/fs/read_write.c
|
||||
--- linux-4.9-aufs/fs/read_write.c 2016-12-31 00:31:52.380789379 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/read_write.c 2016-12-31 00:32:35.155785422 +0200
|
||||
@@ -525,6 +525,7 @@ vfs_readf_t vfs_readf(struct file *file)
|
||||
return new_sync_read;
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(vfs_readf);
|
||||
|
||||
vfs_writef_t vfs_writef(struct file *file)
|
||||
{
|
||||
@@ -536,6 +537,7 @@ vfs_writef_t vfs_writef(struct file *fil
|
||||
return new_sync_write;
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(vfs_writef);
|
||||
|
||||
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
|
||||
{
|
||||
diff -Nurp linux-4.9-aufs/fs/splice.c linux-4.9-aufs-mod/fs/splice.c
|
||||
--- linux-4.9-aufs/fs/splice.c 2016-12-31 00:31:52.380789379 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/splice.c 2016-12-31 00:32:35.156785422 +0200
|
||||
@@ -868,6 +868,7 @@ long do_splice_from(struct pipe_inode_in
|
||||
|
||||
return splice_write(pipe, out, ppos, len, flags);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(do_splice_from);
|
||||
|
||||
/*
|
||||
* Attempt to initiate a splice from a file to a pipe.
|
||||
@@ -897,6 +898,7 @@ long do_splice_to(struct file *in, loff_
|
||||
|
||||
return splice_read(in, ppos, pipe, len, flags);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(do_splice_to);
|
||||
|
||||
/**
|
||||
* splice_direct_to_actor - splices data directly between two non-pipes
|
||||
diff -Nurp linux-4.9-aufs/fs/xattr.c linux-4.9-aufs-mod/fs/xattr.c
|
||||
--- linux-4.9-aufs/fs/xattr.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/fs/xattr.c 2016-12-31 00:32:35.156785422 +0200
|
||||
@@ -296,6 +296,7 @@ vfs_getxattr_alloc(struct dentry *dentry
|
||||
*xattr_value = value;
|
||||
return error;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
|
||||
|
||||
ssize_t
|
||||
__vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
|
||||
diff -Nurp linux-4.9-aufs/kernel/task_work.c linux-4.9-aufs-mod/kernel/task_work.c
|
||||
--- linux-4.9-aufs/kernel/task_work.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/kernel/task_work.c 2016-12-31 00:32:35.156785422 +0200
|
||||
@@ -119,3 +119,4 @@ void task_work_run(void)
|
||||
} while (work);
|
||||
}
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(task_work_run);
|
||||
diff -Nurp linux-4.9-aufs/security/commoncap.c linux-4.9-aufs-mod/security/commoncap.c
|
||||
--- linux-4.9-aufs/security/commoncap.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/security/commoncap.c 2016-12-31 00:32:35.156785422 +0200
|
||||
@@ -1061,12 +1061,14 @@ int cap_mmap_addr(unsigned long addr)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(cap_mmap_addr);
|
||||
|
||||
int cap_mmap_file(struct file *file, unsigned long reqprot,
|
||||
unsigned long prot, unsigned long flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(cap_mmap_file);
|
||||
|
||||
#ifdef CONFIG_SECURITY
|
||||
|
||||
diff -Nurp linux-4.9-aufs/security/device_cgroup.c linux-4.9-aufs-mod/security/device_cgroup.c
|
||||
--- linux-4.9-aufs/security/device_cgroup.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/security/device_cgroup.c 2016-12-31 00:32:35.156785422 +0200
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <linux/device_cgroup.h>
|
||||
#include <linux/cgroup.h>
|
||||
#include <linux/ctype.h>
|
||||
+#include <linux/export.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/seq_file.h>
|
||||
@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct
|
||||
return __devcgroup_check_permission(type, imajor(inode), iminor(inode),
|
||||
access);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(__devcgroup_inode_permission);
|
||||
|
||||
int devcgroup_inode_mknod(int mode, dev_t dev)
|
||||
{
|
||||
diff -Nurp linux-4.9-aufs/security/security.c linux-4.9-aufs-mod/security/security.c
|
||||
--- linux-4.9-aufs/security/security.c 2016-12-11 21:17:54.000000000 +0200
|
||||
+++ linux-4.9-aufs-mod/security/security.c 2016-12-31 00:32:35.157785422 +0200
|
||||
@@ -443,6 +443,7 @@ int security_path_rmdir(const struct pat
|
||||
return 0;
|
||||
return call_int_hook(path_rmdir, 0, dir, dentry);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_path_rmdir);
|
||||
|
||||
int security_path_unlink(const struct path *dir, struct dentry *dentry)
|
||||
{
|
||||
@@ -459,6 +460,7 @@ int security_path_symlink(const struct p
|
||||
return 0;
|
||||
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_path_symlink);
|
||||
|
||||
int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
|
||||
struct dentry *new_dentry)
|
||||
@@ -467,6 +469,7 @@ int security_path_link(struct dentry *ol
|
||||
return 0;
|
||||
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_path_link);
|
||||
|
||||
int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
|
||||
const struct path *new_dir, struct dentry *new_dentry,
|
||||
@@ -494,6 +497,7 @@ int security_path_truncate(const struct
|
||||
return 0;
|
||||
return call_int_hook(path_truncate, 0, path);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_path_truncate);
|
||||
|
||||
int security_path_chmod(const struct path *path, umode_t mode)
|
||||
{
|
||||
@@ -501,6 +505,7 @@ int security_path_chmod(const struct pat
|
||||
return 0;
|
||||
return call_int_hook(path_chmod, 0, path, mode);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_path_chmod);
|
||||
|
||||
int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
|
||||
{
|
||||
@@ -508,6 +513,7 @@ int security_path_chown(const struct pat
|
||||
return 0;
|
||||
return call_int_hook(path_chown, 0, path, uid, gid);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_path_chown);
|
||||
|
||||
int security_path_chroot(const struct path *path)
|
||||
{
|
||||
@@ -593,6 +599,7 @@ int security_inode_readlink(struct dentr
|
||||
return 0;
|
||||
return call_int_hook(inode_readlink, 0, dentry);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_inode_readlink);
|
||||
|
||||
int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
|
||||
bool rcu)
|
||||
@@ -608,6 +615,7 @@ int security_inode_permission(struct ino
|
||||
return 0;
|
||||
return call_int_hook(inode_permission, 0, inode, mask);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_inode_permission);
|
||||
|
||||
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
{
|
||||
@@ -779,6 +787,7 @@ int security_file_permission(struct file
|
||||
|
||||
return fsnotify_perm(file, mask);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_file_permission);
|
||||
|
||||
int security_file_alloc(struct file *file)
|
||||
{
|
||||
@@ -838,6 +847,7 @@ int security_mmap_file(struct file *file
|
||||
return ret;
|
||||
return ima_file_mmap(file, prot);
|
||||
}
|
||||
+EXPORT_SYMBOL_GPL(security_mmap_file);
|
||||
|
||||
int security_mmap_addr(unsigned long addr)
|
||||
{
|
||||
File diff suppressed because it is too large
Load Diff
+39
@@ -0,0 +1,39 @@
|
||||
From: Jan Kara <jack@suse.cz>
|
||||
Subject: [PATCH] jbd2: Fix dbench4 performance regression for 'nobarrier' mounts
|
||||
Date: Fri, 28 Apr 2017 11:59:34 +0200
|
||||
|
||||
Commit b685d3d65ac7 "block: treat REQ_FUA and REQ_PREFLUSH as
|
||||
synchronous" removed REQ_SYNC flag from WRITE_FUA implementation. Since
|
||||
JBD2 strips REQ_FUA and REQ_FLUSH flags from submitted IO when the
|
||||
filesystem is mounted with nobarrier mount option, journal superblock
|
||||
writes ended up being async writes after this patch and that caused
|
||||
heavy performance regression for dbench4 benchmark with high number of
|
||||
processes. In my test setup with HP RAID array with non-volatile write
|
||||
cache and 32 GB ram, dbench4 runs with 8 processes regressed by ~25%.
|
||||
|
||||
Fix the problem by making sure journal superblock writes are always
|
||||
treated as synchronous since they generally block progress of the
|
||||
journalling machinery and thus the whole filesystem.
|
||||
|
||||
Fixes: b685d3d65ac791406e0dfd8779cc9b3707fea5a3
|
||||
CC: stable@vger.kernel.org
|
||||
Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
---
|
||||
fs/jbd2/journal.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
|
||||
index 5adc2fb62b0f..e768126f6a72 100644
|
||||
--- a/fs/jbd2/journal.c
|
||||
+++ b/fs/jbd2/journal.c
|
||||
@@ -1348,7 +1348,7 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags)
|
||||
jbd2_superblock_csum_set(journal, sb);
|
||||
get_bh(bh);
|
||||
bh->b_end_io = end_buffer_write_sync;
|
||||
- ret = submit_bh(REQ_OP_WRITE, write_flags, bh);
|
||||
+ ret = submit_bh(REQ_OP_WRITE, write_flags | REQ_SYNC, bh);
|
||||
wait_on_buffer(bh);
|
||||
if (buffer_write_io_error(bh)) {
|
||||
clear_buffer_write_io_error(bh);
|
||||
--
|
||||
2.12.0
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
From e522751d605d99a81508e58390a8f51ee96fb662 Mon Sep 17 00:00:00 2001
|
||||
From: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
|
||||
Date: Tue, 29 Nov 2016 15:18:20 +0100
|
||||
Subject: [PATCH] seq_file: reset iterator to first record for zero offset
|
||||
|
||||
If kernfs file is empty on a first read, successive read operations
|
||||
using the same file descriptor will return no data, even when data is
|
||||
available. Default kernfs 'seq_next' implementation advances iterator
|
||||
position even when next object is not there. Kernfs 'seq_start' for
|
||||
following requests will not return iterator as position is already on
|
||||
the second object.
|
||||
|
||||
This defect doesn't allow to monitor badblocks sysfs files from MD raid.
|
||||
They are initially empty but if data appears at some stage, userspace is
|
||||
not able to read it.
|
||||
|
||||
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
|
||||
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
|
||||
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
||||
---
|
||||
fs/seq_file.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/fs/seq_file.c b/fs/seq_file.c
|
||||
index 368bfb9..a11f271 100644
|
||||
--- a/fs/seq_file.c
|
||||
+++ b/fs/seq_file.c
|
||||
@@ -190,6 +190,13 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
|
||||
*/
|
||||
m->version = file->f_version;
|
||||
|
||||
+ /*
|
||||
+ * if request is to read from zero offset, reset iterator to first
|
||||
+ * record as it might have been already advanced by previous requests
|
||||
+ */
|
||||
+ if (*ppos == 0)
|
||||
+ m->index = 0;
|
||||
+
|
||||
/* Don't assume *ppos is where we left it */
|
||||
if (unlikely(*ppos != m->read_pos)) {
|
||||
while ((err = traverse(m, *ppos)) == -EAGAIN)
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
From cf8c73afb3abf0f8905efbaddd4ce11a0deec9da Mon Sep 17 00:00:00 2001
|
||||
From: Evan Quan <evan.quan@amd.com>
|
||||
Date: Fri, 17 Mar 2017 10:22:51 +0800
|
||||
Subject: [PATCH] drm/amd/amdgpu: add POLARIS12 PCI ID
|
||||
|
||||
Signed-off-by: Evan Quan <evan.quan@amd.com>
|
||||
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Cc: stable@vger.kernel.org
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
index f7adbac..b76cd69 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
@@ -421,6 +421,7 @@ static const struct pci_device_id pciidlist[] = {
|
||||
{0x1002, 0x6985, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
{0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
{0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
{0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
|
||||
{0, 0, 0}
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
From fc8e9c54699e42754094ff475da46440778d8f19 Mon Sep 17 00:00:00 2001
|
||||
From: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Date: Thu, 4 Aug 2016 12:54:22 +0800
|
||||
Subject: [PATCH] drm/amd/amdgpu: add Polaris12 PCI ID
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Reviewed-by: Christian König <christian.koenig@amd.com>
|
||||
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
index 8cb937b..2534ada 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
@@ -418,6 +418,13 @@ static const struct pci_device_id pciidlist[] = {
|
||||
{0x1002, 0x67CA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
|
||||
{0x1002, 0x67CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
|
||||
{0x1002, 0x67CF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
|
||||
+ /* Polaris12 */
|
||||
+ {0x1002, 0x6980, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x6981, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x6985, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
|
||||
{0, 0, 0}
|
||||
};
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+469
@@ -0,0 +1,469 @@
|
||||
From c4642a479fac9f5c224ff7425d86c427b94011af Mon Sep 17 00:00:00 2001
|
||||
From: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Date: Wed, 14 Dec 2016 15:32:28 -0500
|
||||
Subject: [PATCH] drm/amd/amdgpu: add Polaris12 support (v3)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
v2: agd: squash in various fixes
|
||||
v3: agd: squash in:
|
||||
drm/amdgpu: remove unnecessary smc sk firmware for polaris12
|
||||
|
||||
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Reviewed-by: Christian König <christian.koenig@amd.com>
|
||||
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
[ rebased for 4.9 / tmb ]
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | 3 +++
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 5 +++++
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 5 +++++
|
||||
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 13 ++++++++++---
|
||||
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 31 +++++++++++++++++++++++++-----
|
||||
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 5 +++++
|
||||
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 6 ++++++
|
||||
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 5 +++--
|
||||
drivers/gpu/drm/amd/amdgpu/vi.c | 10 ++++++++++
|
||||
drivers/gpu/drm/amd/include/amd_shared.h | 1 +
|
||||
11 files changed, 76 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
|
||||
index 9ada56c..4c851fde 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
|
||||
@@ -840,6 +840,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
|
||||
else if (type == CGS_UCODE_ID_SMU_SK)
|
||||
strcpy(fw_name, "amdgpu/polaris10_smc_sk.bin");
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ strcpy(fw_name, "amdgpu/polaris12_smc.bin");
|
||||
+ break;
|
||||
default:
|
||||
DRM_ERROR("SMC firmware not supported\n");
|
||||
return -EINVAL;
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
|
||||
index 60bd4af..fe3bb94 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
|
||||
@@ -73,6 +73,7 @@ static const char *amdgpu_asic_name[] = {
|
||||
"STONEY",
|
||||
"POLARIS10",
|
||||
"POLARIS11",
|
||||
+ "POLARIS12",
|
||||
"LAST",
|
||||
};
|
||||
|
||||
@@ -1277,6 +1278,7 @@ static int amdgpu_early_init(struct amdgpu_device *adev)
|
||||
case CHIP_FIJI:
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
case CHIP_CARRIZO:
|
||||
case CHIP_STONEY:
|
||||
if (adev->asic_type == CHIP_CARRIZO || adev->asic_type == CHIP_STONEY)
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
|
||||
index a81dfae..1d564be 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
|
||||
@@ -65,6 +65,7 @@
|
||||
#define FIRMWARE_STONEY "amdgpu/stoney_uvd.bin"
|
||||
#define FIRMWARE_POLARIS10 "amdgpu/polaris10_uvd.bin"
|
||||
#define FIRMWARE_POLARIS11 "amdgpu/polaris11_uvd.bin"
|
||||
+#define FIRMWARE_POLARIS12 "amdgpu/polaris12_uvd.bin"
|
||||
|
||||
/**
|
||||
* amdgpu_uvd_cs_ctx - Command submission parser context
|
||||
@@ -98,6 +99,7 @@ MODULE_FIRMWARE(FIRMWARE_FIJI);
|
||||
MODULE_FIRMWARE(FIRMWARE_STONEY);
|
||||
MODULE_FIRMWARE(FIRMWARE_POLARIS10);
|
||||
MODULE_FIRMWARE(FIRMWARE_POLARIS11);
|
||||
+MODULE_FIRMWARE(FIRMWARE_POLARIS12);
|
||||
|
||||
static void amdgpu_uvd_idle_work_handler(struct work_struct *work);
|
||||
|
||||
@@ -149,6 +151,9 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
|
||||
case CHIP_POLARIS11:
|
||||
fw_name = FIRMWARE_POLARIS11;
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ fw_name = FIRMWARE_POLARIS12;
|
||||
+ break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
|
||||
index 69b66b9..8fec802 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
|
||||
@@ -52,6 +52,7 @@
|
||||
#define FIRMWARE_STONEY "amdgpu/stoney_vce.bin"
|
||||
#define FIRMWARE_POLARIS10 "amdgpu/polaris10_vce.bin"
|
||||
#define FIRMWARE_POLARIS11 "amdgpu/polaris11_vce.bin"
|
||||
+#define FIRMWARE_POLARIS12 "amdgpu/polaris12_vce.bin"
|
||||
|
||||
#ifdef CONFIG_DRM_AMDGPU_CIK
|
||||
MODULE_FIRMWARE(FIRMWARE_BONAIRE);
|
||||
@@ -66,6 +67,7 @@ MODULE_FIRMWARE(FIRMWARE_FIJI);
|
||||
MODULE_FIRMWARE(FIRMWARE_STONEY);
|
||||
MODULE_FIRMWARE(FIRMWARE_POLARIS10);
|
||||
MODULE_FIRMWARE(FIRMWARE_POLARIS11);
|
||||
+MODULE_FIRMWARE(FIRMWARE_POLARIS12);
|
||||
|
||||
static void amdgpu_vce_idle_work_handler(struct work_struct *work);
|
||||
|
||||
@@ -121,6 +123,9 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size)
|
||||
case CHIP_POLARIS11:
|
||||
fw_name = FIRMWARE_POLARIS11;
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ fw_name = FIRMWARE_POLARIS12;
|
||||
+ break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
|
||||
index b3d62b9..2006abb 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
|
||||
@@ -167,6 +167,7 @@ static void dce_v11_0_init_golden_registers(struct amdgpu_device *adev)
|
||||
(const u32)ARRAY_SIZE(stoney_golden_settings_a11));
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
amdgpu_program_register_sequence(adev,
|
||||
polaris11_golden_settings_a11,
|
||||
(const u32)ARRAY_SIZE(polaris11_golden_settings_a11));
|
||||
@@ -608,6 +609,7 @@ static int dce_v11_0_get_num_crtc (struct amdgpu_device *adev)
|
||||
num_crtc = 6;
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
num_crtc = 5;
|
||||
break;
|
||||
default:
|
||||
@@ -1589,6 +1591,7 @@ static int dce_v11_0_audio_init(struct amdgpu_device *adev)
|
||||
adev->mode_info.audio.num_pins = 8;
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
adev->mode_info.audio.num_pins = 6;
|
||||
break;
|
||||
default:
|
||||
@@ -2388,7 +2391,8 @@ static u32 dce_v11_0_pick_pll(struct drm_crtc *crtc)
|
||||
int pll;
|
||||
|
||||
if ((adev->asic_type == CHIP_POLARIS10) ||
|
||||
- (adev->asic_type == CHIP_POLARIS11)) {
|
||||
+ (adev->asic_type == CHIP_POLARIS11) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS12)) {
|
||||
struct amdgpu_encoder *amdgpu_encoder =
|
||||
to_amdgpu_encoder(amdgpu_crtc->encoder);
|
||||
struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv;
|
||||
@@ -2822,7 +2826,8 @@ static int dce_v11_0_crtc_mode_set(struct drm_crtc *crtc,
|
||||
return -EINVAL;
|
||||
|
||||
if ((adev->asic_type == CHIP_POLARIS10) ||
|
||||
- (adev->asic_type == CHIP_POLARIS11)) {
|
||||
+ (adev->asic_type == CHIP_POLARIS11) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS12)) {
|
||||
struct amdgpu_encoder *amdgpu_encoder =
|
||||
to_amdgpu_encoder(amdgpu_crtc->encoder);
|
||||
int encoder_mode =
|
||||
@@ -2992,6 +2997,7 @@ static int dce_v11_0_early_init(void *handle)
|
||||
adev->mode_info.num_dig = 6;
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
adev->mode_info.num_hpd = 5;
|
||||
adev->mode_info.num_dig = 5;
|
||||
break;
|
||||
@@ -3101,7 +3107,8 @@ static int dce_v11_0_hw_init(void *handle)
|
||||
amdgpu_atombios_crtc_powergate_init(adev);
|
||||
amdgpu_atombios_encoder_init_dig(adev);
|
||||
if ((adev->asic_type == CHIP_POLARIS10) ||
|
||||
- (adev->asic_type == CHIP_POLARIS11)) {
|
||||
+ (adev->asic_type == CHIP_POLARIS11) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS12)) {
|
||||
amdgpu_atombios_crtc_set_dce_clock(adev, adev->clock.default_dispclk,
|
||||
DCE_CLOCK_TYPE_DISPCLK, ATOM_GCK_DFS);
|
||||
amdgpu_atombios_crtc_set_dce_clock(adev, 0,
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
|
||||
index d0ec009..3733741 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
|
||||
@@ -138,6 +138,13 @@ MODULE_FIRMWARE("amdgpu/polaris10_mec.bi
|
||||
MODULE_FIRMWARE("amdgpu/polaris10_mec2.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris10_rlc.bin");
|
||||
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_ce.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_pfp.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_me.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_mec.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_mec2.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_rlc.bin");
|
||||
+
|
||||
static const struct amdgpu_gds_reg_offset amdgpu_gds_reg_offset[] =
|
||||
{
|
||||
{mmGDS_VMID0_BASE, mmGDS_VMID0_SIZE, mmGDS_GWS_VMID0, mmGDS_OA_VMID0},
|
||||
@@ -687,6 +694,7 @@ static void gfx_v8_0_init_golden_registe
|
||||
(const u32)ARRAY_SIZE(tonga_golden_common_all));
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
amdgpu_program_register_sequence(adev,
|
||||
golden_settings_polaris11_a11,
|
||||
(const u32)ARRAY_SIZE(golden_settings_polaris11_a11));
|
||||
@@ -901,6 +909,9 @@ static int gfx_v8_0_init_microcode(struc
|
||||
case CHIP_POLARIS10:
|
||||
chip_name = "polaris10";
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ chip_name = "polaris12";
|
||||
+ break;
|
||||
case CHIP_STONEY:
|
||||
chip_name = "stoney";
|
||||
break;
|
||||
@@ -1777,6 +1788,7 @@ static int gfx_v8_0_gpu_early_init(struc
|
||||
gb_addr_config = TONGA_GB_ADDR_CONFIG_GOLDEN;
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
ret = amdgpu_atombios_get_gfx_info(adev);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -2695,6 +2707,7 @@ static void gfx_v8_0_tiling_mode_table_i
|
||||
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
modearray[0] = (ARRAY_MODE(ARRAY_2D_TILED_THIN1) |
|
||||
PIPE_CONFIG(ADDR_SURF_P4_16x16) |
|
||||
TILE_SPLIT(ADDR_SURF_TILE_SPLIT_64B) |
|
||||
@@ -3516,6 +3529,7 @@ gfx_v8_0_raster_config(struct amdgpu_dev
|
||||
*rconf1 |= 0x0;
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
*rconf |= RB_MAP_PKR0(2) | RB_XSEL2(1) | SE_MAP(2) |
|
||||
SE_XSEL(1) | SE_YSEL(1);
|
||||
*rconf1 |= 0x0;
|
||||
@@ -4029,7 +4043,8 @@ static void gfx_v8_0_init_pg(struct amdg
|
||||
cz_enable_cp_power_gating(adev, true);
|
||||
else
|
||||
cz_enable_cp_power_gating(adev, false);
|
||||
- } else if (adev->asic_type == CHIP_POLARIS11) {
|
||||
+ } else if ((adev->asic_type == CHIP_POLARIS11) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS11)) {
|
||||
gfx_v8_0_init_power_gating(adev);
|
||||
}
|
||||
}
|
||||
@@ -4100,7 +4115,8 @@ static int gfx_v8_0_rlc_resume(struct am
|
||||
RLC_CGCG_CGLS_CTRL__CGLS_EN_MASK);
|
||||
WREG32(mmRLC_CGCG_CGLS_CTRL, tmp);
|
||||
if (adev->asic_type == CHIP_POLARIS11 ||
|
||||
- adev->asic_type == CHIP_POLARIS10) {
|
||||
+ adev->asic_type == CHIP_POLARIS10 ||
|
||||
+ adev->asic_type == CHIP_POLARIS12) {
|
||||
tmp = RREG32(mmRLC_CGCG_CGLS_CTRL_3D);
|
||||
tmp &= ~0x3;
|
||||
WREG32(mmRLC_CGCG_CGLS_CTRL_3D, tmp);
|
||||
@@ -4288,6 +4304,7 @@ static int gfx_v8_0_cp_gfx_start(struct
|
||||
amdgpu_ring_write(ring, 0x0000002A);
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
amdgpu_ring_write(ring, 0x16000012);
|
||||
amdgpu_ring_write(ring, 0x00000000);
|
||||
break;
|
||||
@@ -4938,7 +4955,8 @@ static int gfx_v8_0_cp_compute_resume(st
|
||||
(adev->asic_type == CHIP_FIJI) ||
|
||||
(adev->asic_type == CHIP_STONEY) ||
|
||||
(adev->asic_type == CHIP_POLARIS11) ||
|
||||
- (adev->asic_type == CHIP_POLARIS10)) {
|
||||
+ (adev->asic_type == CHIP_POLARIS10) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS12)) {
|
||||
WREG32(mmCP_MEC_DOORBELL_RANGE_LOWER,
|
||||
AMDGPU_DOORBELL_KIQ << 2);
|
||||
WREG32(mmCP_MEC_DOORBELL_RANGE_UPPER,
|
||||
@@ -4974,7 +4992,8 @@ static int gfx_v8_0_cp_compute_resume(st
|
||||
mqd->cp_hqd_persistent_state = tmp;
|
||||
if (adev->asic_type == CHIP_STONEY ||
|
||||
adev->asic_type == CHIP_POLARIS11 ||
|
||||
- adev->asic_type == CHIP_POLARIS10) {
|
||||
+ adev->asic_type == CHIP_POLARIS10 ||
|
||||
+ adev->asic_type == CHIP_POLARIS12) {
|
||||
tmp = RREG32(mmCP_ME1_PIPE3_INT_CNTL);
|
||||
tmp = REG_SET_FIELD(tmp, CP_ME1_PIPE3_INT_CNTL, GENERIC2_INT_ENABLE, 1);
|
||||
WREG32(mmCP_ME1_PIPE3_INT_CNTL, tmp);
|
||||
@@ -5488,7 +5507,8 @@ static int gfx_v8_0_late_init(void *hand
|
||||
static void gfx_v8_0_enable_gfx_static_mg_power_gating(struct amdgpu_device *adev,
|
||||
bool enable)
|
||||
{
|
||||
- if (adev->asic_type == CHIP_POLARIS11)
|
||||
+ if ((adev->asic_type == CHIP_POLARIS11) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS12))
|
||||
/* Send msg to SMU via Powerplay */
|
||||
amdgpu_set_powergating_state(adev,
|
||||
AMD_IP_BLOCK_TYPE_SMC,
|
||||
@@ -5565,6 +5585,7 @@ static int gfx_v8_0_set_powergating_stat
|
||||
gfx_v8_0_enable_gfx_dynamic_mg_power_gating(adev, false);
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
if ((adev->pg_flags & AMD_PG_SUPPORT_GFX_SMG) && enable)
|
||||
gfx_v8_0_enable_gfx_static_mg_power_gating(adev, true);
|
||||
else
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
|
||||
index 0daac3a..476bc9f 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
|
||||
@@ -46,6 +46,7 @@ static int gmc_v8_0_wait_for_idle(void *handle);
|
||||
MODULE_FIRMWARE("amdgpu/tonga_mc.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris11_mc.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris10_mc.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_mc.bin");
|
||||
|
||||
static const u32 golden_settings_tonga_a11[] =
|
||||
{
|
||||
@@ -130,6 +131,7 @@ static void gmc_v8_0_init_golden_registers(struct amdgpu_device *adev)
|
||||
(const u32)ARRAY_SIZE(golden_settings_tonga_a11));
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
amdgpu_program_register_sequence(adev,
|
||||
golden_settings_polaris11_a11,
|
||||
(const u32)ARRAY_SIZE(golden_settings_polaris11_a11));
|
||||
@@ -225,6 +227,9 @@ static int gmc_v8_0_init_microcode(struct amdgpu_device *adev)
|
||||
case CHIP_POLARIS10:
|
||||
chip_name = "polaris10";
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ chip_name = "polaris12";
|
||||
+ break;
|
||||
case CHIP_FIJI:
|
||||
case CHIP_CARRIZO:
|
||||
case CHIP_STONEY:
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
|
||||
index 1170a64..034ace7 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
|
||||
@@ -60,6 +60,8 @@ MODULE_FIRMWARE("amdgpu/polaris10_sdma.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris10_sdma1.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris11_sdma.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris11_sdma1.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_sdma.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_sdma1.bin");
|
||||
|
||||
|
||||
static const u32 sdma_offsets[SDMA_MAX_INSTANCE] =
|
||||
@@ -206,6 +208,7 @@ static void sdma_v3_0_init_golden_registers(struct amdgpu_device *adev)
|
||||
(const u32)ARRAY_SIZE(golden_settings_tonga_a11));
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
amdgpu_program_register_sequence(adev,
|
||||
golden_settings_polaris11_a11,
|
||||
(const u32)ARRAY_SIZE(golden_settings_polaris11_a11));
|
||||
@@ -278,6 +281,9 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev)
|
||||
case CHIP_POLARIS10:
|
||||
chip_name = "polaris10";
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ chip_name = "polaris12";
|
||||
+ break;
|
||||
case CHIP_CARRIZO:
|
||||
chip_name = "carrizo";
|
||||
break;
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
|
||||
index 6b3293a..5fb0b7f 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
|
||||
@@ -320,11 +320,12 @@ static unsigned vce_v3_0_get_harvest_config(struct amdgpu_device *adev)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
- /* Fiji, Stoney, Polaris10, Polaris11 are single pipe */
|
||||
+ /* Fiji, Stoney, Polaris10, Polaris11, Polaris12 are single pipe */
|
||||
if ((adev->asic_type == CHIP_FIJI) ||
|
||||
(adev->asic_type == CHIP_STONEY) ||
|
||||
(adev->asic_type == CHIP_POLARIS10) ||
|
||||
- (adev->asic_type == CHIP_POLARIS11))
|
||||
+ (adev->asic_type == CHIP_POLARIS11) ||
|
||||
+ (adev->asic_type == CHIP_POLARIS12))
|
||||
return AMDGPU_VCE_HARVEST_VCE1;
|
||||
|
||||
/* Tonga and CZ are dual or single pipe */
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
|
||||
index bf088d6..c2ac54f 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
|
||||
@@ -88,6 +88,7 @@ MODULE_FIRMWARE("amdgpu/polaris10_smc.bi
|
||||
MODULE_FIRMWARE("amdgpu/polaris10_smc_sk.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris11_smc.bin");
|
||||
MODULE_FIRMWARE("amdgpu/polaris11_smc_sk.bin");
|
||||
+MODULE_FIRMWARE("amdgpu/polaris12_smc.bin");
|
||||
|
||||
/*
|
||||
* Indirect registers accessor
|
||||
@@ -312,6 +313,7 @@ static void vi_init_golden_registers(str
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -592,6 +594,7 @@ static int vi_read_register(struct amdgp
|
||||
case CHIP_TONGA:
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
case CHIP_CARRIZO:
|
||||
case CHIP_STONEY:
|
||||
asic_register_table = cz_allowed_read_registers;
|
||||
@@ -1465,6 +1468,7 @@ int vi_set_ip_blocks(struct amdgpu_devic
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
adev->ip_blocks = polaris11_ip_blocks_vd;
|
||||
adev->num_ip_blocks = ARRAY_SIZE(polaris11_ip_blocks_vd);
|
||||
break;
|
||||
@@ -1608,6 +1612,11 @@ static int vi_common_early_init(void *ha
|
||||
adev->pg_flags = 0;
|
||||
adev->external_rev_id = adev->rev_id + 0x50;
|
||||
break;
|
||||
+ case CHIP_POLARIS12:
|
||||
+ adev->cg_flags = AMD_CG_SUPPORT_UVD_MGCG;
|
||||
+ adev->pg_flags = 0;
|
||||
+ adev->external_rev_id = adev->rev_id + 0x64;
|
||||
+ break;
|
||||
case CHIP_CARRIZO:
|
||||
adev->cg_flags = AMD_CG_SUPPORT_UVD_MGCG |
|
||||
AMD_CG_SUPPORT_GFX_MGCG |
|
||||
@@ -1897,6 +1906,7 @@ static int vi_common_set_clockgating_sta
|
||||
case CHIP_TONGA:
|
||||
case CHIP_POLARIS10:
|
||||
case CHIP_POLARIS11:
|
||||
+ case CHIP_POLARIS12:
|
||||
vi_common_set_clockgating_state_by_smu(adev, state);
|
||||
default:
|
||||
break;
|
||||
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
|
||||
index c02469a..5f59117 100644
|
||||
--- a/drivers/gpu/drm/amd/include/amd_shared.h
|
||||
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
|
||||
@@ -46,6 +46,7 @@ enum amd_asic_type {
|
||||
CHIP_STONEY,
|
||||
CHIP_POLARIS10,
|
||||
CHIP_POLARIS11,
|
||||
+ CHIP_POLARIS12,
|
||||
CHIP_LAST,
|
||||
};
|
||||
|
||||
--
|
||||
2.10.2
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
From 6e88491cf2a3b17199c78bd53348b39dc6a88275 Mon Sep 17 00:00:00 2001
|
||||
From: Junshan Fang <Junshan.Fang@amd.com>
|
||||
Date: Thu, 15 Jun 2017 14:02:20 +0800
|
||||
Subject: [PATCH] drm/amdgpu: add Polaris12 DID
|
||||
|
||||
Signed-off-by: Junshan Fang <Junshan.Fang@amd.com>
|
||||
Reviewed-by: Roger.He <Hongbo.He@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
|
||||
index f2d705e6a75a..ab6b0d0febab 100644
|
||||
@@ -418,6 +418,7 @@ static const struct pci_device_id pciidl
|
||||
{0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
{0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
{0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
+ {0x1002, 0x6997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
{0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
|
||||
|
||||
{0, 0, 0}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
From c10c8f7c27103bd7ac02d041d9d6e97296d48fc1 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Deucher <alexander.deucher@amd.com>
|
||||
Date: Fri, 10 Feb 2017 18:09:32 -0500
|
||||
Subject: [PATCH] drm/amdgpu/pm: check for headless before calling
|
||||
compute_clocks
|
||||
|
||||
Don't update display bandwidth on headless asics.
|
||||
|
||||
bug:
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=99387
|
||||
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Cc: stable@vger.kernel.org
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
|
||||
index 95e026a..346e80a 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
|
||||
@@ -1283,7 +1283,9 @@ void amdgpu_pm_compute_clocks(struct amd
|
||||
if (adev->pp_enabled) {
|
||||
int i = 0;
|
||||
|
||||
- amdgpu_display_bandwidth_update(adev);
|
||||
+ if (adev->mode_info.num_crtc)
|
||||
+ amdgpu_display_bandwidth_update(adev);
|
||||
+
|
||||
for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
|
||||
struct amdgpu_ring *ring = adev->rings[i];
|
||||
if (ring && ring->ready)
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
From f4309526576db325264b6dc9ee150ee70b330a42 Mon Sep 17 00:00:00 2001
|
||||
From: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Date: Wed, 14 Dec 2016 15:40:48 -0500
|
||||
Subject: [PATCH] drm/amdgpu/powerplay: add Polaris12 support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
|
||||
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Reviewed-by: Christian König <christian.koenig@amd.com>
|
||||
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
---
|
||||
drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 1 +
|
||||
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 ++-
|
||||
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 2 +-
|
||||
drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | 1 +
|
||||
4 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
|
||||
index fc592c2..95a568d 100644
|
||||
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
|
||||
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
|
||||
@@ -98,6 +98,7 @@ static int amdgpu_pp_early_init(void *handle)
|
||||
switch (adev->asic_type) {
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
case CHIP_TONGA:
|
||||
case CHIP_FIJI:
|
||||
case CHIP_TOPAZ:
|
||||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
|
||||
index dc6700a..b036064 100644
|
||||
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
|
||||
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
|
||||
@@ -95,6 +95,7 @@ int hwmgr_init(struct amd_pp_init *pp_init, struct pp_instance *handle)
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
polaris_set_asic_special_caps(hwmgr);
|
||||
hwmgr->feature_mask &= ~(PP_UVD_HANDSHAKE_MASK);
|
||||
break;
|
||||
@@ -745,7 +746,7 @@ int polaris_set_asic_special_caps(struct pp_hwmgr *hwmgr)
|
||||
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
|
||||
PHM_PlatformCaps_TablelessHardwareInterface);
|
||||
|
||||
- if (hwmgr->chip_id == CHIP_POLARIS11)
|
||||
+ if ((hwmgr->chip_id == CHIP_POLARIS11) || (hwmgr->chip_id == CHIP_POLARIS12))
|
||||
phm_cap_set(hwmgr->platform_descriptor.platformCaps,
|
||||
PHM_PlatformCaps_SPLLShutdownSupport);
|
||||
return 0;
|
||||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c
|
||||
index 26477f0..6cd1287 100644
|
||||
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c
|
||||
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c
|
||||
@@ -521,7 +521,7 @@ int smu7_enable_didt_config(struct pp_hwmgr *hwmgr)
|
||||
PP_ASSERT_WITH_CODE((result == 0), "DIDT Config failed.", return result);
|
||||
result = smu7_program_pt_config_registers(hwmgr, DIDTConfig_Polaris10);
|
||||
PP_ASSERT_WITH_CODE((result == 0), "DIDT Config failed.", return result);
|
||||
- } else if (hwmgr->chip_id == CHIP_POLARIS11) {
|
||||
+ } else if ((hwmgr->chip_id == CHIP_POLARIS11) || (hwmgr->chip_id == CHIP_POLARIS12)) {
|
||||
result = smu7_program_pt_config_registers(hwmgr, GCCACConfig_Polaris11);
|
||||
PP_ASSERT_WITH_CODE((result == 0), "DIDT Config failed.", return result);
|
||||
result = smu7_program_pt_config_registers(hwmgr, DIDTConfig_Polaris11);
|
||||
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c
|
||||
index e5812aa..6e618aa 100644
|
||||
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c
|
||||
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c
|
||||
@@ -65,6 +65,7 @@ int smum_init(struct amd_pp_init *pp_init, struct pp_instance *handle)
|
||||
break;
|
||||
case CHIP_POLARIS11:
|
||||
case CHIP_POLARIS10:
|
||||
+ case CHIP_POLARIS12:
|
||||
polaris10_smum_init(smumgr);
|
||||
break;
|
||||
default:
|
||||
--
|
||||
2.10.2
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
From 853277481178fdf14d1a4e9e6ac7174d6046176f Mon Sep 17 00:00:00 2001
|
||||
From: Jani Nikula <jani.nikula@intel.com>
|
||||
Date: Wed, 1 Feb 2017 15:46:09 +0200
|
||||
Subject: [PATCH] drm/i915: don't warn about Skylake CPU - KabyPoint PCH combo
|
||||
|
||||
Apparently there are machines out there with Skylake CPU and KabyPoint
|
||||
PCH. Judging from our driver code, there doesn't seem to be any code
|
||||
paths that would do anything different between SunrisePoint and
|
||||
KabyPoint PCHs, so it would seem okay to accept the combo without
|
||||
warnings.
|
||||
|
||||
Fixes: 22dea0be50b2 ("drm/i915: Introduce Kabypoint PCH for Kabylake H/DT.")
|
||||
References: https://lists.freedesktop.org/archives/intel-gfx/2017-February/118611.html
|
||||
Reported-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
|
||||
Cc: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
|
||||
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
|
||||
Cc: <stable@vger.kernel.org> # v4.8+
|
||||
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Link: http://patchwork.freedesktop.org/patch/msgid/1485956769-26015-1-git-send-email-jani.nikula@intel.com
|
||||
(cherry picked from commit 3aac4acb89710fe782c9e78e7b1febf76e112c6c)
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
[ rebased for 4.9 / tmb ]
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
---
|
||||
drivers/gpu/drm/i915/i915_drv.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
|
||||
index b2c4a0b..8d63098 100644
|
||||
--- a/drivers/gpu/drm/i915/i915_drv.c
|
||||
+++ b/drivers/gpu/drm/i915/i915_drv.c
|
||||
@@ -207,7 +207,8 @@ static void intel_detect_pch(struct drm_
|
||||
} else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) {
|
||||
dev_priv->pch_type = PCH_KBP;
|
||||
DRM_DEBUG_KMS("Found KabyPoint PCH\n");
|
||||
- WARN_ON(!IS_KABYLAKE(dev));
|
||||
+ WARN_ON(!IS_SKYLAKE(dev) &&
|
||||
+ !IS_KABYLAKE(dev));
|
||||
} else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) ||
|
||||
(id == INTEL_PCH_P3X_DEVICE_ID_TYPE) ||
|
||||
((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) &&
|
||||
@@ -0,0 +1,100 @@
|
||||
Adapt mach64 to build with 2.6.31 series kernels
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mandriva.org>
|
||||
|
||||
diff -urp linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_dma.c linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_dma.c
|
||||
--- linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_dma.c 2009-07-23 00:24:12.000000000 +0300
|
||||
+++ linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_dma.c 2009-07-23 02:28:21.000000000 +0300
|
||||
@@ -1006,7 +1006,7 @@ static int mach64_do_dma_init(struct drm
|
||||
|
||||
DRM_DEBUG("\n");
|
||||
|
||||
- dev_priv = drm_alloc(sizeof(drm_mach64_private_t), DRM_MEM_DRIVER);
|
||||
+ dev_priv = kmalloc(sizeof(drm_mach64_private_t), GFP_KERNEL);
|
||||
if (dev_priv == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1386,8 +1386,7 @@ int mach64_do_cleanup_dma(struct drm_dev
|
||||
|
||||
mach64_destroy_freelist(dev);
|
||||
|
||||
- drm_free(dev_priv, sizeof(drm_mach64_private_t),
|
||||
- DRM_MEM_DRIVER);
|
||||
+ kfree(dev_priv);
|
||||
dev->dev_private = NULL;
|
||||
}
|
||||
|
||||
@@ -1476,8 +1475,8 @@ int mach64_init_freelist(struct drm_devi
|
||||
for (i = 0; i < dma->buf_count; i++) {
|
||||
if ((entry =
|
||||
(drm_mach64_freelist_t *)
|
||||
- drm_alloc(sizeof(drm_mach64_freelist_t),
|
||||
- DRM_MEM_BUFLISTS)) == NULL)
|
||||
+ kmalloc(sizeof(drm_mach64_freelist_t),
|
||||
+ GFP_KERNEL)) == NULL)
|
||||
return -ENOMEM;
|
||||
memset(entry, 0, sizeof(drm_mach64_freelist_t));
|
||||
entry->buf = dma->buflist[i];
|
||||
@@ -1500,18 +1499,18 @@ void mach64_destroy_freelist(struct drm_
|
||||
list_for_each_safe(ptr, tmp, &dev_priv->pending) {
|
||||
list_del(ptr);
|
||||
entry = list_entry(ptr, drm_mach64_freelist_t, list);
|
||||
- drm_free(entry, sizeof(*entry), DRM_MEM_BUFLISTS);
|
||||
+ kfree(entry);
|
||||
}
|
||||
list_for_each_safe(ptr, tmp, &dev_priv->placeholders) {
|
||||
list_del(ptr);
|
||||
entry = list_entry(ptr, drm_mach64_freelist_t, list);
|
||||
- drm_free(entry, sizeof(*entry), DRM_MEM_BUFLISTS);
|
||||
+ kfree(entry);
|
||||
}
|
||||
|
||||
list_for_each_safe(ptr, tmp, &dev_priv->free_list) {
|
||||
list_del(ptr);
|
||||
entry = list_entry(ptr, drm_mach64_freelist_t, list);
|
||||
- drm_free(entry, sizeof(*entry), DRM_MEM_BUFLISTS);
|
||||
+ kfree(entry);
|
||||
}
|
||||
}
|
||||
|
||||
diff -urp linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_state.c linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_state.c
|
||||
--- linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64/mach64_state.c 2009-07-23 00:24:12.000000000 +0300
|
||||
+++ linux-2.6.31-rc3-git5-mnb1/drivers/gpu/drm/mach64.fixed/mach64_state.c 2009-07-23 02:29:24.000000000 +0300
|
||||
@@ -490,12 +490,12 @@ static __inline__ int copy_from_user_ver
|
||||
unsigned long n = bytes; /* dwords remaining in buffer */
|
||||
u32 *from, *orig_from;
|
||||
|
||||
- from = drm_alloc(bytes, DRM_MEM_DRIVER);
|
||||
+ from = kmalloc(bytes, GFP_KERNEL);
|
||||
if (from == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
if (DRM_COPY_FROM_USER(from, ufrom, bytes)) {
|
||||
- drm_free(from, bytes, DRM_MEM_DRIVER);
|
||||
+ kfree(from);
|
||||
return -EFAULT;
|
||||
}
|
||||
orig_from = from; /* we'll be modifying the "from" ptr, so save it */
|
||||
@@ -526,19 +526,19 @@ static __inline__ int copy_from_user_ver
|
||||
to += count;
|
||||
} else {
|
||||
DRM_ERROR("Got bad command: 0x%04x\n", reg);
|
||||
- drm_free(orig_from, bytes, DRM_MEM_DRIVER);
|
||||
+ kfree(orig_from);
|
||||
return -EACCES;
|
||||
}
|
||||
} else {
|
||||
DRM_ERROR
|
||||
("Got bad command count(=%u) dwords remaining=%lu\n",
|
||||
count, n);
|
||||
- drm_free(orig_from, bytes, DRM_MEM_DRIVER);
|
||||
+ kfree(orig_from);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
- drm_free(orig_from, bytes, DRM_MEM_DRIVER);
|
||||
+ kfree(orig_from);
|
||||
if (n == 0)
|
||||
return 0;
|
||||
else {
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
--- linux-2.6.35/drivers/gpu/drm/mach64/mach64_state.c.orig 2010-10-03 13:29:10.000000000 +0300
|
||||
+++ linux-2.6.35/drivers/gpu/drm/mach64/mach64_state.c 2010-10-03 14:04:45.991164007 +0300
|
||||
@@ -41,15 +41,15 @@
|
||||
*
|
||||
*/
|
||||
struct drm_ioctl_desc mach64_ioctls[] = {
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_INIT, mach64_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_CLEAR, mach64_dma_clear, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_SWAP, mach64_dma_swap, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_IDLE, mach64_dma_idle, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_RESET, mach64_engine_reset, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_VERTEX, mach64_dma_vertex, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_BLIT, mach64_dma_blit, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_FLUSH, mach64_dma_flush, DRM_AUTH),
|
||||
- DRM_IOCTL_DEF(DRM_MACH64_GETPARAM, mach64_get_param, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_INIT, mach64_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_CLEAR, mach64_dma_clear, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_SWAP, mach64_dma_swap, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_IDLE, mach64_dma_idle, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_RESET, mach64_engine_reset, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_VERTEX, mach64_dma_vertex, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_BLIT, mach64_dma_blit, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_FLUSH, mach64_dma_flush, DRM_AUTH),
|
||||
+ DRM_IOCTL_DEF_DRV(MACH64_GETPARAM, mach64_get_param, DRM_AUTH),
|
||||
};
|
||||
|
||||
int mach64_max_ioctl = DRM_ARRAY_SIZE(mach64_ioctls);
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
|
||||
Fix build for 2.6.37
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mandriva.org>
|
||||
|
||||
--- a/drivers/gpu/drm/mach64/mach64_drv.c.orig 2011-01-02 16:55:48.000000000 +0200
|
||||
+++ a/drivers/gpu/drm/mach64/mach64_drv.c 2011-01-02 17:53:54.808775632 +0200
|
||||
@@ -51,8 +51,6 @@ static struct drm_driver driver = {
|
||||
.irq_uninstall = mach64_driver_irq_uninstall,
|
||||
.irq_handler = mach64_driver_irq_handler,
|
||||
.reclaim_buffers = drm_core_reclaim_buffers,
|
||||
- .get_map_ofs = drm_core_get_map_ofs,
|
||||
- .get_reg_ofs = drm_core_get_reg_ofs,
|
||||
.ioctls = mach64_ioctls,
|
||||
.dma_ioctl = mach64_dma_buffers,
|
||||
.fops = {
|
||||
@@ -63,6 +61,7 @@ static struct drm_driver driver = {
|
||||
.mmap = drm_mmap,
|
||||
.poll = drm_poll,
|
||||
.fasync = drm_fasync,
|
||||
+ .llseek = noop_llseek,
|
||||
},
|
||||
.pci_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
fix build with linux-3.0
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
drivers/gpu/drm/mach64/mach64_drv.c | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/mach64/mach64_drv.c.orig 2011-07-15 02:48:40.000000000 +0300
|
||||
+++ a/drivers/gpu/drm/mach64/mach64_drv.c 2011-07-15 13:24:41.454753025 +0300
|
||||
@@ -63,10 +63,6 @@ static struct drm_driver driver = {
|
||||
.fasync = drm_fasync,
|
||||
.llseek = noop_llseek,
|
||||
},
|
||||
- .pci_driver = {
|
||||
- .name = DRIVER_NAME,
|
||||
- .id_table = pciidlist,
|
||||
- },
|
||||
|
||||
.name = DRIVER_NAME,
|
||||
.desc = DRIVER_DESC,
|
||||
@@ -76,15 +72,20 @@ static struct drm_driver driver = {
|
||||
.patchlevel = DRIVER_PATCHLEVEL,
|
||||
};
|
||||
|
||||
+static struct pci_driver mach64_pci_driver = {
|
||||
+ .name = DRIVER_NAME,
|
||||
+ .id_table = pciidlist,
|
||||
+};
|
||||
+
|
||||
static int __init mach64_init(void)
|
||||
{
|
||||
driver.num_ioctls = mach64_max_ioctl;
|
||||
- return drm_init(&driver);
|
||||
+ return drm_pci_init(&driver, &mach64_pci_driver);
|
||||
}
|
||||
|
||||
static void __exit mach64_exit(void)
|
||||
{
|
||||
- drm_exit(&driver);
|
||||
+ drm_pci_exit(&driver, &mach64_pci_driver);
|
||||
}
|
||||
|
||||
module_init(mach64_init);
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
--- linux/drivers/gpu/drm/mach64/mach64_drv.c.orig 2013-10-13 12:19:41.000000000 +0300
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_drv.c 2013-10-13 14:27:25.684247911 +0300
|
||||
@@ -46,13 +46,12 @@ static const struct file_operations mach
|
||||
.unlocked_ioctl = drm_ioctl,
|
||||
.mmap = drm_mmap,
|
||||
.poll = drm_poll,
|
||||
- .fasync = drm_fasync,
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
|
||||
static struct drm_driver driver = {
|
||||
.driver_features =
|
||||
- DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
|
||||
+ DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
|
||||
| DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
|
||||
.lastclose = mach64_driver_lastclose,
|
||||
.get_vblank_counter = mach64_get_vblank_counter,
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
|
||||
Adapt for kernel-3.17
|
||||
|
||||
DRM_ARRAY_SIZE is a duplicate of ARRAY_SIZE and have been dropped.
|
||||
|
||||
drm_dev_to_irq has been dropped, so call dev->pdev->irq directly
|
||||
for code simplicity.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -urp linux/drivers/gpu/drm/mach64/mach64_state.c.orig linux/drivers/gpu/drm/mach64/mach64_state.c
|
||||
--- linux/drivers/gpu/drm/mach64/mach64_state.c.orig
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_state.c
|
||||
@@ -52,7 +52,7 @@ struct drm_ioctl_desc mach64_ioctls[] =
|
||||
DRM_IOCTL_DEF_DRV(MACH64_GETPARAM, mach64_get_param, DRM_AUTH),
|
||||
};
|
||||
|
||||
-int mach64_max_ioctl = DRM_ARRAY_SIZE(mach64_ioctls);
|
||||
+int mach64_max_ioctl = ARRAY_SIZE(mach64_ioctls);
|
||||
|
||||
/* ================================================================
|
||||
* DMA hardware state programming functions
|
||||
@@ -895,7 +895,7 @@ int mach64_get_param(struct drm_device *
|
||||
value = mach64_do_get_frames_queued(dev_priv);
|
||||
break;
|
||||
case MACH64_PARAM_IRQ_NR:
|
||||
- value = drm_dev_to_irq(dev);
|
||||
+ value = dev->pdev->irq;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
|
||||
Fix build with kernel 3.18
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_dma.c linux/drivers/gpu/drm/mach64/mach64_dma.c
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_dma.c 2014-11-29 22:01:54.000000000 +0200
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_dma.c 2014-11-30 00:02:06.906821818 +0200
|
||||
@@ -1038,21 +1038,21 @@ static int mach64_do_dma_init(struct drm
|
||||
INIT_LIST_HEAD(&dev_priv->placeholders);
|
||||
INIT_LIST_HEAD(&dev_priv->pending);
|
||||
|
||||
- dev_priv->sarea = drm_getsarea(dev);
|
||||
+ dev_priv->sarea = drm_legacy_getsarea(dev);
|
||||
if (!dev_priv->sarea) {
|
||||
DRM_ERROR("can not find sarea!\n");
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
mach64_do_cleanup_dma(dev);
|
||||
return -EINVAL;
|
||||
}
|
||||
- dev_priv->fb = drm_core_findmap(dev, init->fb_offset);
|
||||
+ dev_priv->fb = drm_legacy_findmap(dev, init->fb_offset);
|
||||
if (!dev_priv->fb) {
|
||||
DRM_ERROR("can not find frame buffer map!\n");
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
mach64_do_cleanup_dma(dev);
|
||||
return -EINVAL;
|
||||
}
|
||||
- dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
|
||||
+ dev_priv->mmio = drm_legacy_findmap(dev, init->mmio_offset);
|
||||
if (!dev_priv->mmio) {
|
||||
DRM_ERROR("can not find mmio map!\n");
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
@@ -1060,7 +1060,7 @@ static int mach64_do_dma_init(struct drm
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- dev_priv->ring_map = drm_core_findmap(dev, init->ring_offset);
|
||||
+ dev_priv->ring_map = drm_legacy_findmap(dev, init->ring_offset);
|
||||
if (!dev_priv->ring_map) {
|
||||
DRM_ERROR("can not find ring map!\n");
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
@@ -1072,7 +1072,7 @@ static int mach64_do_dma_init(struct drm
|
||||
((u8 *) dev_priv->sarea->handle + init->sarea_priv_offset);
|
||||
|
||||
if (!dev_priv->is_pci) {
|
||||
- drm_core_ioremap(dev_priv->ring_map, dev);
|
||||
+ drm_legacy_ioremap(dev_priv->ring_map, dev);
|
||||
if (!dev_priv->ring_map->handle) {
|
||||
DRM_ERROR("can not ioremap virtual address for"
|
||||
" descriptor ring\n");
|
||||
@@ -1082,7 +1082,7 @@ static int mach64_do_dma_init(struct drm
|
||||
}
|
||||
dev->agp_buffer_token = init->buffers_offset;
|
||||
dev->agp_buffer_map =
|
||||
- drm_core_findmap(dev, init->buffers_offset);
|
||||
+ drm_legacy_findmap(dev, init->buffers_offset);
|
||||
if (!dev->agp_buffer_map) {
|
||||
DRM_ERROR("can not find dma buffer map!\n");
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
@@ -1093,7 +1093,7 @@ static int mach64_do_dma_init(struct drm
|
||||
dev isn't passed all the way though the mach64 - DA */
|
||||
dev_priv->dev_buffers = dev->agp_buffer_map;
|
||||
|
||||
- drm_core_ioremap(dev->agp_buffer_map, dev);
|
||||
+ drm_legacy_ioremap(dev->agp_buffer_map, dev);
|
||||
if (!dev->agp_buffer_map->handle) {
|
||||
DRM_ERROR("can not ioremap virtual address for"
|
||||
" dma buffer\n");
|
||||
@@ -1102,7 +1102,7 @@ static int mach64_do_dma_init(struct drm
|
||||
return -ENOMEM;
|
||||
}
|
||||
dev_priv->agp_textures =
|
||||
- drm_core_findmap(dev, init->agp_textures_offset);
|
||||
+ drm_legacy_findmap(dev, init->agp_textures_offset);
|
||||
if (!dev_priv->agp_textures) {
|
||||
DRM_ERROR("can not find agp texture region!\n");
|
||||
dev->dev_private = (void *)dev_priv;
|
||||
@@ -1376,10 +1376,10 @@ int mach64_do_cleanup_dma(struct drm_dev
|
||||
|
||||
if (!dev_priv->is_pci) {
|
||||
if (dev_priv->ring_map)
|
||||
- drm_core_ioremapfree(dev_priv->ring_map, dev);
|
||||
+ drm_legacy_ioremapfree(dev_priv->ring_map, dev);
|
||||
|
||||
if (dev->agp_buffer_map) {
|
||||
- drm_core_ioremapfree(dev->agp_buffer_map, dev);
|
||||
+ drm_legacy_ioremapfree(dev->agp_buffer_map, dev);
|
||||
dev->agp_buffer_map = NULL;
|
||||
}
|
||||
}
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_drv.c linux/drivers/gpu/drm/mach64/mach64_drv.c
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_drv.c 2014-11-29 22:01:54.000000000 +0200
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_drv.c 2014-11-29 23:14:21.918009653 +0200
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "mach64_drv.h"
|
||||
|
||||
#include <drm/drm_pciids.h>
|
||||
+#include <drm/drm_legacy.h>
|
||||
|
||||
static struct pci_device_id pciidlist[] = {
|
||||
mach64_PCI_IDS
|
||||
@@ -44,7 +45,7 @@ static const struct file_operations mach
|
||||
.open = drm_open,
|
||||
.release = drm_release,
|
||||
.unlocked_ioctl = drm_ioctl,
|
||||
- .mmap = drm_mmap,
|
||||
+ .mmap = drm_legacy_mmap,
|
||||
.poll = drm_poll,
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_drv.h linux/drivers/gpu/drm/mach64/mach64_drv.h
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_drv.h 2014-11-29 22:01:54.000000000 +0200
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_drv.h 2014-11-29 23:58:20.111491646 +0200
|
||||
@@ -35,6 +35,8 @@
|
||||
#ifndef __MACH64_DRV_H__
|
||||
#define __MACH64_DRV_H__
|
||||
|
||||
+#include <drm/drm_legacy.h>
|
||||
+
|
||||
/* General customization:
|
||||
*/
|
||||
|
||||
@@ -102,12 +104,12 @@ typedef struct drm_mach64_private {
|
||||
u32 back_offset_pitch;
|
||||
u32 depth_offset_pitch;
|
||||
|
||||
- drm_local_map_t *sarea;
|
||||
- drm_local_map_t *fb;
|
||||
- drm_local_map_t *mmio;
|
||||
- drm_local_map_t *ring_map;
|
||||
- drm_local_map_t *dev_buffers; /* this is a pointer to a structure in dev */
|
||||
- drm_local_map_t *agp_textures;
|
||||
+ struct drm_local_map *sarea;
|
||||
+ struct drm_local_map *fb;
|
||||
+ struct drm_local_map *mmio;
|
||||
+ struct drm_local_map *ring_map;
|
||||
+ struct drm_local_map *dev_buffers; /* this is a pointer to a structure in dev */
|
||||
+ struct drm_local_map *agp_textures;
|
||||
} drm_mach64_private_t;
|
||||
|
||||
extern struct drm_ioctl_desc mach64_ioctls[];
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
This moves the .fops to a separate struct as required by kernel-3.3
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
b/drivers/gpu/drm/mach64/mach64_drv.c | 23 ++++++++++++-----------
|
||||
1 file changed, 12 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/mach64/mach64_drv.c
|
||||
+++ b/drivers/gpu/drm/mach64/mach64_drv.c
|
||||
@@ -39,6 +39,17 @@ static struct pci_device_id pciidlist[]
|
||||
mach64_PCI_IDS
|
||||
};
|
||||
|
||||
+static const struct file_operations mach64_driver_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .open = drm_open,
|
||||
+ .release = drm_release,
|
||||
+ .unlocked_ioctl = drm_ioctl,
|
||||
+ .mmap = drm_mmap,
|
||||
+ .poll = drm_poll,
|
||||
+ .fasync = drm_fasync,
|
||||
+ .llseek = noop_llseek,
|
||||
+};
|
||||
+
|
||||
static struct drm_driver driver = {
|
||||
.driver_features =
|
||||
DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
|
||||
@@ -54,17 +65,7 @@ static struct drm_driver driver = {
|
||||
.reclaim_buffers = drm_core_reclaim_buffers,
|
||||
.ioctls = mach64_ioctls,
|
||||
.dma_ioctl = mach64_dma_buffers,
|
||||
- .fops = {
|
||||
- .owner = THIS_MODULE,
|
||||
- .open = drm_open,
|
||||
- .release = drm_release,
|
||||
- .unlocked_ioctl = drm_ioctl,
|
||||
- .mmap = drm_mmap,
|
||||
- .poll = drm_poll,
|
||||
- .fasync = drm_fasync,
|
||||
- .llseek = noop_llseek,
|
||||
- },
|
||||
-
|
||||
+ .fops = &mach64_driver_fops,
|
||||
.name = DRIVER_NAME,
|
||||
.desc = DRIVER_DESC,
|
||||
.date = DRIVER_DATE,
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
reclaim_buffers is gone in 3.6
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
--- linux/drivers/gpu/drm/mach64/mach64_drv.c.orig 2012-10-17 22:26:58.000000000 +0300
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_drv.c 2012-10-17 23:05:10.212566630 +0300
|
||||
@@ -62,7 +62,6 @@ static struct drm_driver driver = {
|
||||
.irq_postinstall = mach64_driver_irq_postinstall,
|
||||
.irq_uninstall = mach64_driver_irq_uninstall,
|
||||
.irq_handler = mach64_driver_irq_handler,
|
||||
- .reclaim_buffers = drm_core_reclaim_buffers,
|
||||
.ioctls = mach64_ioctls,
|
||||
.dma_ioctl = mach64_dma_buffers,
|
||||
.fops = &mach64_driver_fops,
|
||||
@@ -0,0 +1,61 @@
|
||||
diff -Nurp linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_dma.c linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_dma.c
|
||||
--- linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_dma.c 2012-12-06 19:50:10.000000000 +0200
|
||||
+++ linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_dma.c 2012-12-06 20:19:10.590681644 +0200
|
||||
@@ -34,8 +34,8 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
-#include "drmP.h"
|
||||
-#include "drm.h"
|
||||
+#include <drm/drmP.h>
|
||||
+#include <drm/drm.h>
|
||||
#include "mach64_drm.h"
|
||||
#include "mach64_drv.h"
|
||||
|
||||
diff -Nurp linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_drv.c linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_drv.c
|
||||
--- linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_drv.c 2012-12-06 19:50:10.000000000 +0200
|
||||
+++ linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_drv.c 2012-12-06 20:20:13.062073838 +0200
|
||||
@@ -28,12 +28,12 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
-#include "drmP.h"
|
||||
-#include "drm.h"
|
||||
+#include <drm/drmP.h>
|
||||
+#include <drm/drm.h>
|
||||
#include "mach64_drm.h"
|
||||
#include "mach64_drv.h"
|
||||
|
||||
-#include "drm_pciids.h"
|
||||
+#include <drm/drm_pciids.h>
|
||||
|
||||
static struct pci_device_id pciidlist[] = {
|
||||
mach64_PCI_IDS
|
||||
diff -Nurp linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_irq.c linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_irq.c
|
||||
--- linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_irq.c 2012-12-06 19:50:10.000000000 +0200
|
||||
+++ linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_irq.c 2012-12-06 20:20:40.192678476 +0200
|
||||
@@ -35,8 +35,8 @@
|
||||
* Leif Delgass <ldelgass@retinalburn.net>
|
||||
*/
|
||||
|
||||
-#include "drmP.h"
|
||||
-#include "drm.h"
|
||||
+#include <drm/drmP.h>
|
||||
+#include <drm/drm.h>
|
||||
#include "mach64_drm.h"
|
||||
#include "mach64_drv.h"
|
||||
|
||||
diff -Nurp linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_state.c linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_state.c
|
||||
--- linux-3.7-rc8/drivers/gpu/drm/mach64.orig/mach64_state.c 2012-12-06 19:50:10.000000000 +0200
|
||||
+++ linux-3.7-rc8/drivers/gpu/drm/mach64/mach64_state.c 2012-12-06 20:21:00.783137370 +0200
|
||||
@@ -30,8 +30,8 @@
|
||||
* José Fonseca <j_r_fonseca@yahoo.co.uk>
|
||||
*/
|
||||
|
||||
-#include "drmP.h"
|
||||
-#include "drm.h"
|
||||
+#include <drm/drmP.h>
|
||||
+#include <drm/drm.h>
|
||||
#include "mach64_drm.h"
|
||||
#include "mach64_drv.h"
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
Update mach64 for changes in drm_ioctl done in 2.6.33:
|
||||
"drm: convert drm_ioctl to unlocked_ioctl" (commit ed8b670)
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
---
|
||||
drivers/gpu/drm/mach64/mach64_drv.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff -p -up linux-2.6.33/drivers/gpu/drm/mach64/mach64_drv.c.orig linux-2.6.33/drivers/gpu/drm/mach64/mach64_drv.c
|
||||
--- linux-2.6.33/drivers/gpu/drm/mach64/mach64_drv.c.orig 2010-03-16 19:27:22.517068880 -0300
|
||||
+++ linux-2.6.33/drivers/gpu/drm/mach64/mach64_drv.c 2010-03-16 19:27:54.890318416 -0300
|
||||
@@ -59,7 +59,7 @@ static struct drm_driver driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = drm_open,
|
||||
.release = drm_release,
|
||||
- .ioctl = drm_ioctl,
|
||||
+ .unlocked_ioctl = drm_ioctl,
|
||||
.mmap = drm_mmap,
|
||||
.poll = drm_poll,
|
||||
.fasync = drm_fasync,
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
diff -p -up linux-2.6.32/drivers/gpu/drm/mach64/mach64_dma.c.orig linux-2.6.32/drivers/gpu/drm/mach64/mach64_dma.c
|
||||
--- linux-2.6.32/drivers/gpu/drm/mach64/mach64_dma.c.orig 2010-01-06 11:35:13.784843304 -0200
|
||||
+++ linux-2.6.32/drivers/gpu/drm/mach64/mach64_dma.c 2010-01-06 11:37:50.793843502 -0200
|
||||
@@ -835,7 +835,7 @@ static int mach64_bm_dma_test(struct drm
|
||||
/* FIXME: get a dma buffer from the freelist here */
|
||||
DRM_DEBUG("Allocating data memory ...\n");
|
||||
cpu_addr_dmah =
|
||||
- drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful);
|
||||
+ drm_pci_alloc(dev, 0x1000, 0x1000);
|
||||
if (!cpu_addr_dmah) {
|
||||
DRM_INFO("data-memory allocation failed!\n");
|
||||
return -ENOMEM;
|
||||
@@ -0,0 +1,97 @@
|
||||
Fix/cleanup mach64 drm module for building with current kernel.
|
||||
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/mach64/mach64_dma.c | 9 +--------
|
||||
drivers/gpu/drm/mach64/mach64_drv.c | 11 +----------
|
||||
drivers/gpu/drm/mach64/mach64_state.c | 4 ++--
|
||||
3 files changed, 4 insertions(+), 20 deletions(-)
|
||||
|
||||
diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c.orig linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c
|
||||
--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c.orig 2008-12-10 12:19:14.000000000 -0500
|
||||
+++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c 2008-12-10 13:34:19.000000000 -0500
|
||||
@@ -834,14 +834,8 @@ static int mach64_bm_dma_test(struct drm
|
||||
|
||||
/* FIXME: get a dma buffer from the freelist here */
|
||||
DRM_DEBUG("Allocating data memory ...\n");
|
||||
-#ifdef __FreeBSD__
|
||||
- DRM_UNLOCK();
|
||||
-#endif
|
||||
cpu_addr_dmah =
|
||||
drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful);
|
||||
-#ifdef __FreeBSD__
|
||||
- DRM_LOCK();
|
||||
-#endif
|
||||
if (!cpu_addr_dmah) {
|
||||
DRM_INFO("data-memory allocation failed!\n");
|
||||
return -ENOMEM;
|
||||
@@ -1375,8 +1369,7 @@ int mach64_do_cleanup_dma(struct drm_dev
|
||||
* may not have been called from userspace and after dev_private
|
||||
* is freed, it's too late.
|
||||
*/
|
||||
- if (dev->irq)
|
||||
- drm_irq_uninstall(dev);
|
||||
+ drm_irq_uninstall(dev);
|
||||
|
||||
if (dev->dev_private) {
|
||||
drm_mach64_private_t *dev_priv = dev->dev_private;
|
||||
diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c.orig linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c
|
||||
--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c.orig 2008-12-10 12:13:13.000000000 -0500
|
||||
+++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c 2008-12-10 12:16:54.000000000 -0500
|
||||
@@ -38,7 +38,6 @@ static struct pci_device_id pciidlist[]
|
||||
mach64_PCI_IDS
|
||||
};
|
||||
|
||||
-static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
|
||||
static struct drm_driver driver = {
|
||||
.driver_features =
|
||||
DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
|
||||
@@ -68,8 +67,6 @@ static struct drm_driver driver = {
|
||||
.pci_driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.id_table = pciidlist,
|
||||
- .probe = probe,
|
||||
- .remove = __devexit_p(drm_cleanup_pci),
|
||||
},
|
||||
|
||||
.name = DRIVER_NAME,
|
||||
@@ -80,16 +77,10 @@ static struct drm_driver driver = {
|
||||
.patchlevel = DRIVER_PATCHLEVEL,
|
||||
};
|
||||
|
||||
-static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
-{
|
||||
- return drm_get_dev(pdev, ent, &driver);
|
||||
-}
|
||||
-
|
||||
-
|
||||
static int __init mach64_init(void)
|
||||
{
|
||||
driver.num_ioctls = mach64_max_ioctl;
|
||||
- return drm_init(&driver, pciidlist);
|
||||
+ return drm_init(&driver);
|
||||
}
|
||||
|
||||
static void __exit mach64_exit(void)
|
||||
diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c.orig linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c
|
||||
--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c.orig 2008-12-10 12:13:13.000000000 -0500
|
||||
+++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c 2008-12-10 13:38:54.000000000 -0500
|
||||
@@ -455,7 +455,7 @@ static int mach64_do_get_frames_queued(d
|
||||
head = ring->head;
|
||||
|
||||
start = (MACH64_MAX_QUEUED_FRAMES -
|
||||
- DRM_MIN(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
|
||||
+ min(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
|
||||
|
||||
if (head == tail) {
|
||||
sarea_priv->frames_queued = 0;
|
||||
@@ -895,7 +895,7 @@ int mach64_get_param(struct drm_device *
|
||||
value = mach64_do_get_frames_queued(dev_priv);
|
||||
break;
|
||||
case MACH64_PARAM_IRQ_NR:
|
||||
- value = dev->irq;
|
||||
+ value = drm_dev_to_irq(dev);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
--- linux/drivers/gpu/drm/mach64/mach64_drv.c.orig 2011-12-25 00:48:42.814932355 +0200
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_drv.c 2011-12-25 00:47:43.393625260 +0200
|
||||
@@ -27,6 +27,7 @@
|
||||
* Leif Delgass <ldelgass@retinalburn.net>
|
||||
*/
|
||||
|
||||
+#include <linux/module.h>
|
||||
#include "drmP.h"
|
||||
#include "drm.h"
|
||||
#include "mach64_drm.h"
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
|
||||
Fix build with kernel-3.14
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
drivers/gpu/drm/mach64/mach64_dma.c | 10 +++++-----
|
||||
drivers/gpu/drm/mach64/mach64_drv.h | 2 +-
|
||||
drivers/gpu/drm/mach64/mach64_irq.c | 2 +-
|
||||
drivers/gpu/drm/mach64/mach64_state.c | 6 +++---
|
||||
4 files changed, 10 insertions(+), 10 deletions(-)
|
||||
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_dma.c linux/drivers/gpu/drm/mach64/mach64_dma.c
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_dma.c 2014-04-26 19:10:55.000000000 +0300
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_dma.c 2014-04-26 20:26:05.263501325 +0300
|
||||
@@ -696,9 +696,9 @@ do { \
|
||||
DRM_INFO( "ADVANCE_RING() wr=0x%06x tail=0x%06x\n", \
|
||||
_ring_write, _ring_tail ); \
|
||||
} \
|
||||
- DRM_MEMORYBARRIER(); \
|
||||
+ mb(); \
|
||||
mach64_clear_dma_eol( &_ring[(_ring_tail - 2) & _ring_mask] ); \
|
||||
- DRM_MEMORYBARRIER(); \
|
||||
+ mb(); \
|
||||
dev_priv->ring.tail = _ring_write; \
|
||||
mach64_ring_tick( dev_priv, &(dev_priv)->ring ); \
|
||||
} while (0)
|
||||
@@ -912,7 +912,7 @@ static int mach64_bm_dma_test(struct drm
|
||||
DRM_DEBUG(" data[%d] = 0x%08x\n", i, data[i]);
|
||||
}
|
||||
|
||||
- DRM_MEMORYBARRIER();
|
||||
+ mb();
|
||||
|
||||
DRM_DEBUG("waiting for idle...\n");
|
||||
if ((i = mach64_do_wait_for_idle(dev_priv))) {
|
||||
@@ -1716,10 +1716,10 @@ static int mach64_dma_get_buffers(struct
|
||||
|
||||
buf->file_priv = file_priv;
|
||||
|
||||
- if (DRM_COPY_TO_USER(&d->request_indices[i], &buf->idx,
|
||||
+ if (copy_to_user(&d->request_indices[i], &buf->idx,
|
||||
sizeof(buf->idx)))
|
||||
return -EFAULT;
|
||||
- if (DRM_COPY_TO_USER(&d->request_sizes[i], &buf->total,
|
||||
+ if (copy_to_user(&d->request_sizes[i], &buf->total,
|
||||
sizeof(buf->total)))
|
||||
return -EFAULT;
|
||||
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_drv.h linux/drivers/gpu/drm/mach64/mach64_drv.h
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_drv.h 2014-04-26 19:10:55.000000000 +0300
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_drv.h 2014-04-26 20:28:43.693457652 +0300
|
||||
@@ -166,7 +166,7 @@ extern int mach64_get_param(struct drm_d
|
||||
extern u32 mach64_get_vblank_counter(struct drm_device *dev, int crtc);
|
||||
extern int mach64_enable_vblank(struct drm_device *dev, int crtc);
|
||||
extern void mach64_disable_vblank(struct drm_device *dev, int crtc);
|
||||
-extern irqreturn_t mach64_driver_irq_handler(DRM_IRQ_ARGS);
|
||||
+extern irqreturn_t mach64_driver_irq_handler(int irq, void *arg);
|
||||
extern void mach64_driver_irq_preinstall(struct drm_device *dev);
|
||||
extern int mach64_driver_irq_postinstall(struct drm_device *dev);
|
||||
extern void mach64_driver_irq_uninstall(struct drm_device *dev);
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_irq.c linux/drivers/gpu/drm/mach64/mach64_irq.c
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_irq.c 2014-04-26 19:10:55.000000000 +0300
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_irq.c 2014-04-26 20:32:01.464898140 +0300
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "mach64_drm.h"
|
||||
#include "mach64_drv.h"
|
||||
|
||||
-irqreturn_t mach64_driver_irq_handler(DRM_IRQ_ARGS)
|
||||
+irqreturn_t mach64_driver_irq_handler(int irq, void *arg)
|
||||
{
|
||||
struct drm_device *dev = arg;
|
||||
drm_mach64_private_t *dev_priv = dev->dev_private;
|
||||
diff -urp linux/drivers/gpu/drm/mach64.orig/mach64_state.c linux/drivers/gpu/drm/mach64/mach64_state.c
|
||||
--- linux/drivers/gpu/drm/mach64.orig/mach64_state.c 2014-04-26 19:10:55.000000000 +0300
|
||||
+++ linux/drivers/gpu/drm/mach64/mach64_state.c 2014-04-26 20:07:16.701527488 +0300
|
||||
@@ -494,7 +494,7 @@ static __inline__ int copy_from_user_ver
|
||||
if (from == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
- if (DRM_COPY_FROM_USER(from, ufrom, bytes)) {
|
||||
+ if (copy_from_user(from, ufrom, bytes)) {
|
||||
kfree(from);
|
||||
return -EFAULT;
|
||||
}
|
||||
@@ -640,7 +640,7 @@ static __inline__ int copy_from_user_bli
|
||||
{
|
||||
to = (u32 *)((char *)to + MACH64_HOSTDATA_BLIT_OFFSET);
|
||||
|
||||
- if (DRM_COPY_FROM_USER(to, ufrom, bytes)) {
|
||||
+ if (copy_from_user(to, ufrom, bytes)) {
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
@@ -901,7 +901,7 @@ int mach64_get_param(struct drm_device *
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- if (DRM_COPY_TO_USER(param->value, &value, sizeof(int))) {
|
||||
+ if (copy_to_user(param->value, &value, sizeof(int))) {
|
||||
DRM_ERROR("copy_to_user\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
Theese got dropped in 3.12-rc
|
||||
|
||||
Restore for now to get the mach64 driver to build
|
||||
|
||||
TODO: Need to check mesa & drm if it's dropped there too...
|
||||
|
||||
--- linux/include/drm/drm_pciids.h.orig 2013-10-13 11:05:33.000000000 +0300
|
||||
+++ linux/include/drm/drm_pciids.h 2013-10-13 14:30:43.625995248 +0300
|
||||
@@ -711,6 +711,29 @@
|
||||
{0x102b, 0x2527, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MGA_CARD_TYPE_G550}, \
|
||||
{0, 0, 0}
|
||||
|
||||
+#define mach64_PCI_IDS \
|
||||
+ {0x1002, 0x4749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4742, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4744, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c51, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x474c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x474f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4753, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x474d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x474e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c52, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c53, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0x1002, 0x4c4e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
+ {0, 0, 0}
|
||||
+
|
||||
#define sisdrv_PCI_IDS \
|
||||
{0x1039, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
{0x1039, 0x5300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
|
||||
File diff suppressed because it is too large
Load Diff
+37
@@ -0,0 +1,37 @@
|
||||
Subject: Add blacklist of usb hid modules
|
||||
|
||||
IBM Blade Center HS20 can connect PS2 kerboard and mouse, It is USB emulation.
|
||||
This devices need HID_QUIRK_IGNORE option.
|
||||
|
||||
This patch is workaround.
|
||||
|
||||
[ rediffed for 2.6.28 -- herton ]
|
||||
Signed-off-by: Go Taniguchi <go@turbolinux.co.jp>
|
||||
|
||||
---
|
||||
drivers/hid/hid-core.c | 2 ++
|
||||
drivers/hid/hid-ids.h | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/hid/hid-core.c
|
||||
+++ b/drivers/hid/hid-core.c
|
||||
@@ -2062,6 +2062,8 @@ static const struct hid_device_id hid_ig
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1007) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_IBM, 0x4001) },
|
||||
+ { HID_USB_DEVICE(USB_VENDOR_ID_IBM, 0x4002) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_JABRA, USB_DEVICE_ID_JABRA_SPEAK_410) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_JABRA, USB_DEVICE_ID_JABRA_SPEAK_510) },
|
||||
--- a/drivers/hid/hid-ids.h
|
||||
+++ b/drivers/hid/hid-ids.h
|
||||
@@ -46,6 +46,8 @@
|
||||
#define USB_VENDOR_ID_AFATECH 0x15a4
|
||||
#define USB_DEVICE_ID_AFATECH_AF9016 0x9016
|
||||
|
||||
+#define USB_VENDOR_ID_IBM 0x04b3
|
||||
+
|
||||
#define USB_VENDOR_ID_AIPTEK 0x08ca
|
||||
#define USB_DEVICE_ID_AIPTEK_01 0x0001
|
||||
#define USB_DEVICE_ID_AIPTEK_10 0x0010
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
drivers/ide/sis5513.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff -p -up linux-2.6.28/drivers/ide/sis5513.c.orig linux-2.6.28/drivers/ide/sis5513.c
|
||||
--- linux-2.6.28/drivers/ide/sis5513.c.orig 2008-12-08 12:41:13.000000000 -0500
|
||||
+++ linux-2.6.28/drivers/ide/sis5513.c 2008-12-08 12:51:32.000000000 -0500
|
||||
@@ -412,6 +412,15 @@ static int __devinit sis_find_family(str
|
||||
pci_name(dev));
|
||||
}
|
||||
}
|
||||
+ else if (trueid == 0x180) { /* sis965L */
|
||||
+ u16 pci_command;
|
||||
+ pci_read_config_word(dev, PCI_COMMAND, &pci_command);
|
||||
+ pci_command &= ~PCI_COMMAND_INTX_DISABLE;
|
||||
+ pci_write_config_word(dev, PCI_COMMAND, pci_command);
|
||||
+ chipset_family = ATA_133;
|
||||
+ printk(KERN_INFO DRV_NAME " %s: SiS 965 IDE UDMA133 controller\n",
|
||||
+ pci_name(dev));
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!chipset_family) { /* Belongs to pci-quirks */
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
From Thierry Vignaud <tvignaud@mandriva.com> (Mandriva)
|
||||
|
||||
We now lacks /usr/include/linux/pci_ids.h which break ldetect build...
|
||||
Can you readd it please?
|
||||
Thanks
|
||||
---
|
||||
include/linux/Kbuild | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- linux/include/uapi/linux/Kbuild.include-kbuild-export-pci_ids.orig
|
||||
+++ linux/include/uapi/linux/Kbuild
|
||||
@@ -277,6 +277,7 @@ header-y += param.h
|
||||
header-y += parport.h
|
||||
header-y += patchkey.h
|
||||
header-y += pci.h
|
||||
+header-y += pci_ids.h
|
||||
header-y += pci_regs.h
|
||||
header-y += perf_event.h
|
||||
header-y += personality.h
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
From 993b3a3f80a7842a48cd46c2b41e1b3ef6302468 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Fri, 24 Oct 2014 14:55:24 -0700
|
||||
Subject: [PATCH] Input: i8042 - quirks for Fujitsu Lifebook A544 and Lifebook
|
||||
AH544
|
||||
|
||||
These models need i8042.notimeout, otherwise the touchpad will not work.
|
||||
|
||||
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=69731
|
||||
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1111138
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
||||
---
|
||||
drivers/input/serio/i8042-x86ia64io.h | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
|
||||
index a0bcbb6..aa9b299 100644
|
||||
--- a/drivers/input/serio/i8042-x86ia64io.h
|
||||
+++ b/drivers/input/serio/i8042-x86ia64io.h
|
||||
@@ -364,6 +364,22 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
|
||||
},
|
||||
},
|
||||
{
|
||||
+ /* Fujitsu A544 laptop */
|
||||
+ /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
+ /* Fujitsu AH544 laptop */
|
||||
+ /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
|
||||
+ .matches = {
|
||||
+ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
|
||||
+ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
|
||||
+ },
|
||||
+ },
|
||||
+ {
|
||||
/* Fujitsu U574 laptop */
|
||||
/* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
|
||||
.matches = {
|
||||
--
|
||||
2.1.2
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
From: Arindam Nath <arindam.nath@amd.com>
|
||||
|
||||
Change History
|
||||
--------------
|
||||
|
||||
v3:
|
||||
- add Fixes and CC tags
|
||||
- add link to Bugzilla
|
||||
|
||||
v2: changes suggested by Joerg
|
||||
- add flush flag to improve efficiency of flush operation
|
||||
|
||||
v1:
|
||||
- The idea behind flush queues is to defer the IOTLB flushing
|
||||
for domains for which the mappings are no longer valid. We
|
||||
add such domains in queue_add(), and when the queue size
|
||||
reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
|
||||
|
||||
Since we have already taken lock before __queue_flush()
|
||||
is called, we need to make sure the IOTLB flushing is
|
||||
performed as quickly as possible.
|
||||
|
||||
In the current implementation, we perform IOTLB flushing
|
||||
for all domains irrespective of which ones were actually
|
||||
added in the flush queue initially. This can be quite
|
||||
expensive especially for domains for which unmapping is
|
||||
not required at this point of time.
|
||||
|
||||
This patch makes use of domain information in
|
||||
'struct flush_queue_entry' to make sure we only flush
|
||||
IOTLBs for domains who need it, skipping others.
|
||||
|
||||
Bugzilla: https://bugs.freedesktop.org/101029
|
||||
Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
|
||||
Cc: stable@vger.kernel.org
|
||||
Suggested-by: Joerg Roedel <joro@8bytes.org>
|
||||
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
|
||||
---
|
||||
drivers/iommu/amd_iommu.c | 27 ++++++++++++++++++++-------
|
||||
drivers/iommu/amd_iommu_types.h | 2 ++
|
||||
2 files changed, 22 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
|
||||
index 63cacf5..1edeebec 100644
|
||||
--- a/drivers/iommu/amd_iommu.c
|
||||
+++ b/drivers/iommu/amd_iommu.c
|
||||
@@ -2227,15 +2227,26 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
|
||||
|
||||
static void __queue_flush(struct flush_queue *queue)
|
||||
{
|
||||
- struct protection_domain *domain;
|
||||
- unsigned long flags;
|
||||
int idx;
|
||||
|
||||
- /* First flush TLB of all known domains */
|
||||
- spin_lock_irqsave(&amd_iommu_pd_lock, flags);
|
||||
- list_for_each_entry(domain, &amd_iommu_pd_list, list)
|
||||
- domain_flush_tlb(domain);
|
||||
- spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
|
||||
+ /* First flush TLB of all domains which were added to flush queue */
|
||||
+ for (idx = 0; idx < queue->next; ++idx) {
|
||||
+ struct flush_queue_entry *entry;
|
||||
+
|
||||
+ entry = queue->entries + idx;
|
||||
+
|
||||
+ /*
|
||||
+ * There might be cases where multiple IOVA entries for the
|
||||
+ * same domain are queued in the flush queue. To avoid
|
||||
+ * flushing the same domain again, we check whether the
|
||||
+ * flag is set or not. This improves the efficiency of
|
||||
+ * flush operation.
|
||||
+ */
|
||||
+ if (!entry->dma_dom->domain.already_flushed) {
|
||||
+ entry->dma_dom->domain.already_flushed = true;
|
||||
+ domain_flush_tlb(&entry->dma_dom->domain);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* Wait until flushes have completed */
|
||||
domain_flush_complete(NULL);
|
||||
@@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain *dma_dom,
|
||||
pages = __roundup_pow_of_two(pages);
|
||||
address >>= PAGE_SHIFT;
|
||||
|
||||
+ dma_dom->domain.already_flushed = false;
|
||||
+
|
||||
queue = get_cpu_ptr(&flush_queue);
|
||||
spin_lock_irqsave(&queue->lock, flags);
|
||||
|
||||
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
|
||||
index 4de8f41..4f5519d 100644
|
||||
--- a/drivers/iommu/amd_iommu_types.h
|
||||
+++ b/drivers/iommu/amd_iommu_types.h
|
||||
@@ -454,6 +454,8 @@ struct protection_domain {
|
||||
bool updated; /* complete domain flush required */
|
||||
unsigned dev_cnt; /* devices assigned to this domain */
|
||||
unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
|
||||
+ bool already_flushed; /* flag to avoid flushing the same domain again
|
||||
+ in a single invocation of __queue_flush() */
|
||||
};
|
||||
|
||||
/*
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
|
||||
index f976df4..32c883b 100644
|
||||
--- a/drivers/media/usb/pwc/pwc-if.c
|
||||
+++ b/drivers/media/usb/pwc/pwc-if.c
|
||||
@@ -119,7 +119,7 @@ static void usb_pwc_disconnect(struct us
|
||||
static void pwc_isoc_cleanup(struct pwc_device *pdev);
|
||||
|
||||
static struct usb_driver pwc_driver = {
|
||||
- .name = "Philips webcam", /* name */
|
||||
+ .name = "pwc", /* name */
|
||||
.id_table = pwc_device_table,
|
||||
.probe = usb_pwc_probe, /* probe() */
|
||||
.disconnect = usb_pwc_disconnect, /* disconnect() */
|
||||
@@ -0,0 +1,49 @@
|
||||
Subject: mpt scsi modules for VMWare's emulated
|
||||
|
||||
The attached patch is a workaround for a bug in VMWare's emulated LSI
|
||||
Fusion SCSI HBA. The emulated firmware returns zero for the maximum
|
||||
number of attached devices; the real firmware returns a positive
|
||||
number. Therefore, the kernel that boots and works fine on bare metal
|
||||
will fail on VMWare because this firmware value is handed to the SCSI
|
||||
midlayer, which then skips the entire bus scan.
|
||||
|
||||
F7 bz 241935
|
||||
|
||||
The patch below was submitted by Eric Moore of LSI to the linux-scsi
|
||||
mailing list:
|
||||
|
||||
http://marc.info/?l=linux-scsi&m=117432237404247
|
||||
|
||||
then immediately rejected by Christoph Hellwig, who prefers that
|
||||
VMWare fix their emulation instead.
|
||||
|
||||
This patch is workaround.
|
||||
|
||||
---
|
||||
drivers/message/fusion/mptbase.c | 15 +++++++++++++--
|
||||
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/message/fusion/mptbase.c
|
||||
+++ b/drivers/message/fusion/mptbase.c
|
||||
@@ -3051,8 +3051,19 @@ GetPortFacts(MPT_ADAPTER *ioc, int portn
|
||||
pfacts->MaxPersistentIDs = le16_to_cpu(pfacts->MaxPersistentIDs);
|
||||
pfacts->MaxLanBuckets = le16_to_cpu(pfacts->MaxLanBuckets);
|
||||
|
||||
- max_id = (ioc->bus_type == SAS) ? pfacts->PortSCSIID :
|
||||
- pfacts->MaxDevices;
|
||||
+ switch (ioc->bus_type) {
|
||||
+ case SAS:
|
||||
+ max_id = pfacts->PortSCSIID;
|
||||
+ break;
|
||||
+ case FC:
|
||||
+ max_id = pfacts->MaxDevices;
|
||||
+ break;
|
||||
+ case SPI:
|
||||
+ default:
|
||||
+ max_id = MPT_MAX_SCSI_DEVICES;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
ioc->devices_per_bus = (max_id > 255) ? 256 : max_id;
|
||||
ioc->number_of_buses = (ioc->devices_per_bus < 256) ? 1 : max_id/256;
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
|
||||
Adapt to netlink changes in 3.6
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
--- linux/net/ipv4/netfilter/ipt_IFWLOG.c.orig 2012-10-17 22:44:57.000000000 +0300
|
||||
+++ linux/net/ipv4/netfilter/ipt_IFWLOG.c 2012-10-17 23:17:10.012725918 +0300
|
||||
@@ -56,9 +56,9 @@ static void send_packet(const struct nl_
|
||||
return;
|
||||
}
|
||||
|
||||
- nlh = NLMSG_PUT(skb, 0, 0, 0, size - sizeof(*nlh));
|
||||
+ nlh = nlmsg_put(skb, 0, 0, 0, size - sizeof(*nlh), 0);
|
||||
|
||||
- memcpy(NLMSG_DATA(nlh), (const void *) msg, sizeof(*msg));
|
||||
+ memcpy(nlmsg_data(nlh), (const void *) msg, sizeof(*msg));
|
||||
|
||||
NETLINK_CB(skb).pid = 0; /* from kernel */
|
||||
NETLINK_CB(skb).dst_group = IFWLOGNLGRP_DEF;
|
||||
@@ -169,9 +169,11 @@ static struct xt_target ipt_IFWLOG = {
|
||||
static int __init ipt_ifwlog_init(void)
|
||||
{
|
||||
int err;
|
||||
+ struct netlink_kernel_cfg cfg = {
|
||||
+ .groups = IFWLOGNLGRP_MAX,
|
||||
+ };
|
||||
|
||||
- nl = netlink_kernel_create(&init_net, NETLINK_IFWLOG, IFWLOGNLGRP_MAX,
|
||||
- NULL, NULL, THIS_MODULE);
|
||||
+ nl = netlink_kernel_create(&init_net, NETLINK_IFWLOG, THIS_MODULE, &cfg);
|
||||
if (!nl) {
|
||||
PRINTR(KERN_WARNING "IFWLOG: cannot create netlink socket\n");
|
||||
return -ENOMEM;
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
--- linux-2.6.35-rc6-git-mnb0.1/net/ipv4/netfilter/ipt_IFWLOG.c.orig 2010-07-30 21:17:30.000000000 +0300
|
||||
+++ linux-2.6.35-rc6-git-mnb0.1/net/ipv4/netfilter/ipt_IFWLOG.c 2010-07-31 13:46:33.834611944 +0300
|
||||
@@ -135,7 +135,7 @@ static void ipt_IFWLOG_packet(const stru
|
||||
}
|
||||
|
||||
static unsigned int ipt_IFWLOG_target(struct sk_buff *skb,
|
||||
- const struct xt_target_param *target_param)
|
||||
+ const struct xt_action_param *target_param)
|
||||
{
|
||||
const struct ipt_IFWLOG_info *info = target_param->targinfo;
|
||||
|
||||
@@ -144,17 +144,17 @@ static unsigned int ipt_IFWLOG_target(st
|
||||
return IPT_CONTINUE;
|
||||
}
|
||||
|
||||
-static bool ipt_IFWLOG_checkentry(const struct xt_tgchk_param *tgchk_param)
|
||||
+static int ipt_IFWLOG_checkentry(const struct xt_tgchk_param *tgchk_param)
|
||||
{
|
||||
const struct ipt_IFWLOG_info *info = tgchk_param->targinfo;
|
||||
|
||||
if (info->prefix[sizeof(info->prefix)-1] != '\0') {
|
||||
DEBUGP("IFWLOG: prefix term %i\n",
|
||||
info->prefix[sizeof(info->prefix)-1]);
|
||||
- return false;
|
||||
+ return -EINVAL;
|
||||
}
|
||||
|
||||
- return true;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static struct xt_target ipt_IFWLOG = {
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
net/ipv4/netfilter/ipt_IFWLOG.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- linux-2.6.37-rc3-git1-tmb0.3/net/ipv4/netfilter/ipt_IFWLOG.c.orig 2010-11-24 21:58:36.000000000 +0200
|
||||
+++ linux-2.6.37-rc3-git1-tmb0.3/net/ipv4/netfilter/ipt_IFWLOG.c 2010-11-25 13:08:55.719379646 +0200
|
||||
@@ -141,7 +141,7 @@ static unsigned int ipt_IFWLOG_target(st
|
||||
|
||||
ipt_IFWLOG_packet(skb, target_param->in, target_param->out, info);
|
||||
|
||||
- return IPT_CONTINUE;
|
||||
+ return XT_CONTINUE;
|
||||
}
|
||||
|
||||
static int ipt_IFWLOG_checkentry(const struct xt_tgchk_param *tgchk_param)
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
--- linux-3.7-rc8/net/ipv4/netfilter/ipt_IFWLOG.c.orig 2012-12-06 19:50:10.000000000 +0200
|
||||
+++ linux-3.7-rc8/net/ipv4/netfilter/ipt_IFWLOG.c 2012-12-06 20:55:23.669152916 +0200
|
||||
@@ -60,7 +60,7 @@ static void send_packet(const struct nl_
|
||||
|
||||
memcpy(nlmsg_data(nlh), (const void *) msg, sizeof(*msg));
|
||||
|
||||
- NETLINK_CB(skb).pid = 0; /* from kernel */
|
||||
+ NETLINK_CB(skb).portid = 0; /* from kernel */
|
||||
NETLINK_CB(skb).dst_group = IFWLOGNLGRP_DEF;
|
||||
|
||||
if (nl) {
|
||||
@@ -173,7 +173,7 @@ static int __init ipt_ifwlog_init(void)
|
||||
.groups = IFWLOGNLGRP_MAX,
|
||||
};
|
||||
|
||||
- nl = netlink_kernel_create(&init_net, NETLINK_IFWLOG, THIS_MODULE, &cfg);
|
||||
+ nl = netlink_kernel_create(&init_net, NETLINK_IFWLOG, &cfg);
|
||||
if (!nl) {
|
||||
PRINTR(KERN_WARNING "IFWLOG: cannot create netlink socket\n");
|
||||
return -ENOMEM;
|
||||
@@ -0,0 +1,264 @@
|
||||
ipt_IFWLOG: Mandriva changes
|
||||
|
||||
This patch holds all the Mandriva changes done in ipt_IFWLOG
|
||||
netfilter module.
|
||||
|
||||
This work is mostly done by Thomas Backlund, Herton R. Krzesinski
|
||||
and Luiz Fernando N. Capitulino.
|
||||
|
||||
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
|
||||
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
|
||||
|
||||
---
|
||||
include/linux/netfilter_ipv4/Kbuild | 1
|
||||
include/linux/netfilter_ipv4/ipt_IFWLOG.h | 23 +++++-
|
||||
net/ipv4/netfilter/ipt_IFWLOG.c | 108 +++++++++++++++---------------
|
||||
3 files changed, 77 insertions(+), 55 deletions(-)
|
||||
|
||||
diff -p -up linux-2.6.28/include/linux/netfilter_ipv4/ipt_IFWLOG.h.orig linux-2.6.28/include/linux/netfilter_ipv4/ipt_IFWLOG.h
|
||||
--- linux-2.6.28/include/linux/netfilter_ipv4/ipt_IFWLOG.h.orig 2008-12-12 10:55:07.000000000 -0500
|
||||
+++ linux-2.6.28/include/linux/netfilter_ipv4/ipt_IFWLOG.h 2008-12-12 10:56:30.000000000 -0500
|
||||
@@ -1,10 +1,25 @@
|
||||
-#ifndef _IPT_IFWLOG_H
|
||||
-#define _IPT_IFWLOG_H
|
||||
+#ifndef _LINUX_IPT_IFWLOG_H
|
||||
+#define _LINUX_IPT_IFWLOG_H
|
||||
|
||||
#ifndef NETLINK_IFWLOG
|
||||
-#define NETLINK_IFWLOG 19
|
||||
+#define NETLINK_IFWLOG 20
|
||||
#endif
|
||||
|
||||
+#ifndef __KERNEL__
|
||||
+/* Multicast groups - backwards compatiblility for userspace */
|
||||
+#define IFWLOG_NLGRP_NONE 0x00000000
|
||||
+#define IFWLOG_NLGRP_DEF 0x00000001 /* default message group */
|
||||
+#endif
|
||||
+
|
||||
+enum {
|
||||
+ IFWLOGNLGRP_NONE,
|
||||
+#define IFWLOGNLGRP_NONE IFWLOGNLGRP_NONE
|
||||
+ IFWLOGNLGRP_DEF,
|
||||
+#define IFWLOGNLGRP_DEF IFWLOGNLGRP_DEF
|
||||
+ __IFWLOGNLGRP_MAX
|
||||
+};
|
||||
+#define IFWLOGNLGRP_MAX (__IFWLOGNLGRP_MAX - 1)
|
||||
+
|
||||
#define PREFSIZ 32
|
||||
|
||||
struct nl_msg { /* Netlink message */
|
||||
@@ -23,4 +38,4 @@ struct ipt_IFWLOG_info {
|
||||
char prefix[PREFSIZ];
|
||||
};
|
||||
|
||||
-#endif /* _IPT_IFWLOG_H */
|
||||
+#endif /* _LINUX_IPT_IFWLOG_H */
|
||||
diff -p -up linux-2.6.28/net/ipv4/netfilter/ipt_IFWLOG.c.orig linux-2.6.28/net/ipv4/netfilter/ipt_IFWLOG.c
|
||||
--- linux-2.6.28/net/ipv4/netfilter/ipt_IFWLOG.c.orig 2008-12-12 10:55:07.000000000 -0500
|
||||
+++ linux-2.6.28/net/ipv4/netfilter/ipt_IFWLOG.c 2008-12-12 10:57:16.000000000 -0500
|
||||
@@ -4,6 +4,14 @@
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * 2007-10-10 Thomas Backlund <tmb@mandriva.org>: build fixes for 2.6.22.9
|
||||
+ * 2007-11-11 Herton Krzesinski <herton@mandriva.com>: build fixes for 2.6.24-rc
|
||||
+ * 2007-12-03 Luiz Capitulino <lcapitulino@mandriva.com.br>: v1.1
|
||||
+ * - Better multicast group usage
|
||||
+ * - Coding style fixes
|
||||
+ * - Do not return -EINVAL by default in ipt_ifwlog_init()
|
||||
+ * - Minor refinements
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -19,12 +27,10 @@
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <linux/netfilter.h>
|
||||
+#include <linux/netfilter/x_tables.h>
|
||||
#include <linux/netfilter_ipv4/ip_tables.h>
|
||||
#include <linux/netfilter_ipv4/ipt_IFWLOG.h>
|
||||
|
||||
-MODULE_LICENSE("GPL");
|
||||
-MODULE_AUTHOR("Samir Bellabes <sbellabes@mandriva.com>");
|
||||
-MODULE_DESCRIPTION("Interactive firewall logging and module");
|
||||
|
||||
#if 0
|
||||
#define DEBUGP PRINTR
|
||||
@@ -36,44 +42,41 @@ MODULE_DESCRIPTION("Interactive firewall
|
||||
|
||||
static struct sock *nl;
|
||||
|
||||
-#define GROUP 10
|
||||
-
|
||||
/* send struct to userspace */
|
||||
-static void send_packet(struct nl_msg msg)
|
||||
+static void send_packet(const struct nl_msg *msg)
|
||||
{
|
||||
struct sk_buff *skb = NULL;
|
||||
struct nlmsghdr *nlh;
|
||||
+ unsigned int size;
|
||||
|
||||
- skb = alloc_skb(NLMSG_SPACE(sizeof(struct nl_msg)), GFP_ATOMIC);
|
||||
+ size = NLMSG_SPACE(sizeof(*msg));
|
||||
+ skb = alloc_skb(size, GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
PRINTR(KERN_WARNING "IFWLOG: OOM can't allocate skb\n");
|
||||
- return ;
|
||||
+ return;
|
||||
}
|
||||
|
||||
- nlh = NLMSG_PUT(skb, 0, 0, 0, sizeof(struct nl_msg) - sizeof(*nlh));
|
||||
+ nlh = NLMSG_PUT(skb, 0, 0, 0, size - sizeof(*nlh));
|
||||
|
||||
- memcpy(NLMSG_DATA(nlh), (const void*)&msg, sizeof(struct nl_msg));
|
||||
+ memcpy(NLMSG_DATA(nlh), (const void *) msg, sizeof(*msg));
|
||||
|
||||
NETLINK_CB(skb).pid = 0; /* from kernel */
|
||||
- NETLINK_CB(skb).dst_pid = 0; /* multicast */
|
||||
- NETLINK_CB(skb).dst_group = 10;
|
||||
+ NETLINK_CB(skb).dst_group = IFWLOGNLGRP_DEF;
|
||||
|
||||
if (nl) {
|
||||
DEBUGP(KERN_WARNING
|
||||
"IFWLOG: nlmsg_len=%ld\nnlmsg_type=%d nlmsg_flags=%d\nnlmsg_seq=%ld nlmsg_pid = %ld\n",
|
||||
(long)nlh->nlmsg_len, nlh->nlmsg_type, nlh->nlmsg_flags,
|
||||
(long)nlh->nlmsg_seq, (long)nlh->nlmsg_pid);
|
||||
- DEBUGP(KERN_WARNING "prefix : %s\n", msg.prefix);
|
||||
+ DEBUGP(KERN_WARNING "prefix : %s\n", msg->prefix);
|
||||
|
||||
- netlink_broadcast(nl, skb, 0, 10, GFP_ATOMIC);
|
||||
- return ;
|
||||
+ netlink_broadcast(nl, skb, 0, IFWLOGNLGRP_DEF, GFP_ATOMIC);
|
||||
+ return;
|
||||
}
|
||||
|
||||
- nlmsg_failure:
|
||||
- if (skb)
|
||||
- kfree_skb(skb);
|
||||
- PRINTR(KERN_WARNING "IFWLOG: Error sending netlink packet\n");
|
||||
- return ;
|
||||
+nlmsg_failure:
|
||||
+ kfree_skb(skb);
|
||||
+ PRINTR(KERN_WARNING "IFWLOG: Error sending netlink packet\n");
|
||||
}
|
||||
|
||||
/* fill struct for userspace */
|
||||
@@ -128,73 +131,76 @@ static void ipt_IFWLOG_packet(const stru
|
||||
do_gettimeofday((struct timeval *)&tv);
|
||||
msg.timestamp_sec = tv.tv_sec;
|
||||
|
||||
- send_packet(msg);
|
||||
+ send_packet(&msg);
|
||||
}
|
||||
|
||||
-static unsigned int ipt_IFWLOG_target(struct sk_buff **pskb,
|
||||
- const struct net_device *in,
|
||||
- const struct net_device *out,
|
||||
- unsigned int hooknum,
|
||||
- const void *targinfo,
|
||||
- void *userinfo)
|
||||
+static unsigned int ipt_IFWLOG_target(struct sk_buff *skb,
|
||||
+ const struct xt_target_param *target_param)
|
||||
{
|
||||
- const struct ipt_IFWLOG_info *info = targinfo;
|
||||
+ const struct ipt_IFWLOG_info *info = target_param->targinfo;
|
||||
|
||||
- ipt_IFWLOG_packet(*pskb, in, out, info);
|
||||
+ ipt_IFWLOG_packet(skb, target_param->in, target_param->out, info);
|
||||
|
||||
return IPT_CONTINUE;
|
||||
}
|
||||
|
||||
-static int ipt_IFWLOG_checkentry(const char *tablename,
|
||||
- const struct ipt_entry *e,
|
||||
- void *targinfo,
|
||||
- unsigned int targinfosize,
|
||||
- unsigned int hook_mask)
|
||||
+static bool ipt_IFWLOG_checkentry(const struct xt_tgchk_param *tgchk_param)
|
||||
{
|
||||
- const struct ipt_IFWLOG_info *info = targinfo;
|
||||
+ const struct ipt_IFWLOG_info *info = tgchk_param->targinfo;
|
||||
|
||||
if (info->prefix[sizeof(info->prefix)-1] != '\0') {
|
||||
DEBUGP("IFWLOG: prefix term %i\n",
|
||||
info->prefix[sizeof(info->prefix)-1]);
|
||||
- return 0;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
- return 1;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
-static struct ipt_target ipt_IFWLOG = {
|
||||
+static struct xt_target ipt_IFWLOG = {
|
||||
.name = "IFWLOG",
|
||||
+ .family = AF_INET,
|
||||
.target = ipt_IFWLOG_target,
|
||||
.targetsize = sizeof(struct ipt_IFWLOG_info),
|
||||
.checkentry = ipt_IFWLOG_checkentry,
|
||||
.me = THIS_MODULE,
|
||||
};
|
||||
|
||||
-static int __init init(void)
|
||||
+static int __init ipt_ifwlog_init(void)
|
||||
{
|
||||
- nl = (struct sock*) netlink_kernel_create(NETLINK_IFWLOG, GROUP, NULL, THIS_MODULE);
|
||||
- if (!nl) {
|
||||
- PRINTR(KERN_WARNING "IFWLOG: cannot create netlink socket\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
+ int err;
|
||||
|
||||
- if (ipt_register_target(&ipt_IFWLOG)) {
|
||||
+ nl = netlink_kernel_create(&init_net, NETLINK_IFWLOG, IFWLOGNLGRP_MAX,
|
||||
+ NULL, NULL, THIS_MODULE);
|
||||
+ if (!nl) {
|
||||
+ PRINTR(KERN_WARNING "IFWLOG: cannot create netlink socket\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ err = xt_register_target(&ipt_IFWLOG);
|
||||
+ if (err) {
|
||||
if (nl && nl->sk_socket)
|
||||
sock_release(nl->sk_socket);
|
||||
- return -EINVAL;
|
||||
+ return err;
|
||||
}
|
||||
|
||||
PRINTR(KERN_INFO "IFWLOG: register target\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void __exit fini(void)
|
||||
+static void __exit ipt_ifwlog_fini(void)
|
||||
{
|
||||
if (nl && nl->sk_socket)
|
||||
- sock_release(nl->sk_socket);
|
||||
+ sock_release(nl->sk_socket);
|
||||
PRINTR(KERN_INFO "IFWLOG: unregister target\n");
|
||||
- ipt_unregister_target(&ipt_IFWLOG);
|
||||
+ xt_unregister_target(&ipt_IFWLOG);
|
||||
}
|
||||
|
||||
-module_init(init);
|
||||
-module_exit(fini);
|
||||
+module_init(ipt_ifwlog_init);
|
||||
+module_exit(ipt_ifwlog_fini);
|
||||
+
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_AUTHOR("Samir Bellabes <sbellabes@mandriva.com>");
|
||||
+MODULE_AUTHOR("Luiz Capitulino <lcapitulino@mandriva.com.br>");
|
||||
+MODULE_DESCRIPTION("Interactive firewall logging and module");
|
||||
+MODULE_VERSION("v1.1");
|
||||
--- linux/include/uapi/linux/netfilter_ipv4/Kbuild.net-netfilter-IFWLOG-mdv.orig
|
||||
+++ linux/include/uapi/linux/netfilter_ipv4/Kbuild
|
||||
@@ -2,6 +2,7 @@ header-y += ip_queue.h
|
||||
header-y += ip_tables.h
|
||||
header-y += ipt_CLUSTERIP.h
|
||||
header-y += ipt_ECN.h
|
||||
+header-y += ipt_IFWLOG.h
|
||||
header-y += ipt_LOG.h
|
||||
header-y += ipt_REJECT.h
|
||||
header-y += ipt_TTL.h
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
--- linux-4.4/net/ipv4/netfilter/ipt_IFWLOG.c~ 2016-01-24 13:19:13.233713998 +0100
|
||||
+++ linux-4.4/net/ipv4/netfilter/ipt_IFWLOG.c 2016-01-24 20:49:10.145823623 +0100
|
||||
@@ -74,7 +74,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
-nlmsg_failure:
|
||||
kfree_skb(skb);
|
||||
PRINTR(KERN_WARNING "IFWLOG: Error sending netlink packet\n");
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user