From e0b3ad15a40a2554672efc9d01c22ebf34b50aaa Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 9 Feb 2015 06:57:36 +0000 Subject: [PATCH 01/32] [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) svn path=/dists/sid/linux/; revision=22355 --- debian/changelog | 7 + ...-Add-support-for-A20-OLinuXino-Lime2.patch | 255 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 263 insertions(+) create mode 100644 debian/patches/features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch diff --git a/debian/changelog b/debian/changelog index 53b40aa47..d2fb27e59 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium + + [ Ian Campbell ] + * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) + + -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 + linux (3.16.7-ckt4-3) unstable; urgency=medium [ Ben Hutchings ] diff --git a/debian/patches/features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch b/debian/patches/features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch new file mode 100644 index 000000000..b9033bf21 --- /dev/null +++ b/debian/patches/features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch @@ -0,0 +1,255 @@ +From 518478811c95fafcbef64cf20172a3d6c8dceb27 Mon Sep 17 00:00:00 2001 +From: Iain Paton +Date: Fri, 10 Oct 2014 14:15:24 +0100 +Subject: ARM: sun7i: add support for A20-OLinuXino-Lime2 +Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=518478811c95fafcbef64cf20172a3d6c8dceb27 + +This adds support for the Olimex A20-OLinuXino-Lime2 +https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2 + +Differences to previous Lime boards are 1GB RAM and gigabit ethernet + +Signed-off-by: Iain Paton +Signed-off-by: Maxime Ripard + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -381,6 +381,7 @@ + sun7i-a20-cubietruck.dtb \ + sun7i-a20-i12-tvbox.dtb \ + sun7i-a20-olinuxino-lime.dtb \ ++ sun7i-a20-olinuxino-lime2.dtb \ + sun7i-a20-olinuxino-micro.dtb \ + sun7i-a20-pcduino3.dtb + dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +@@ -0,0 +1,228 @@ ++/* ++ * Copyright 2014 - Iain Paton ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This library 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 library 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 library; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++/include/ "sun7i-a20.dtsi" ++/include/ "sunxi-common-regulators.dtsi" ++ ++/ { ++ model = "Olimex A20-OLinuXino-LIME2"; ++ compatible = "olimex,a20-olinuxino-lime2", "allwinner,sun7i-a20"; ++ ++ soc@01c00000 { ++ mmc0: mmc@01c0f000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 7 1 0>; /* PH1 */ ++ cd-inverted; ++ status = "okay"; ++ }; ++ ++ usbphy: phy@01c13400 { ++ usb1_vbus-supply = <®_usb1_vbus>; ++ usb2_vbus-supply = <®_usb2_vbus>; ++ status = "okay"; ++ }; ++ ++ ehci0: usb@01c14000 { ++ status = "okay"; ++ }; ++ ++ ohci0: usb@01c14400 { ++ status = "okay"; ++ }; ++ ++ ahci: sata@01c18000 { ++ target-supply = <®_ahci_5v>; ++ status = "okay"; ++ }; ++ ++ ehci1: usb@01c1c000 { ++ status = "okay"; ++ }; ++ ++ ohci1: usb@01c1c400 { ++ status = "okay"; ++ }; ++ ++ pinctrl@01c20800 { ++ ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 { ++ allwinner,pins = "PC3"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <0>; ++ allwinner,pull = <0>; ++ }; ++ ++ led_pins_olinuxinolime: led_pins@0 { ++ allwinner,pins = "PH2"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <1>; ++ allwinner,pull = <0>; ++ }; ++ }; ++ ++ uart0: serial@01c28000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++ }; ++ ++ i2c0: i2c@01c2ac00 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "okay"; ++ ++ axp209: pmic@34 { ++ compatible = "x-powers,axp209"; ++ reg = <0x34>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 8>; ++ ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ ++ acin-supply = <®_axp_ipsout>; ++ vin2-supply = <®_axp_ipsout>; ++ vin3-supply = <®_axp_ipsout>; ++ ldo24in-supply = <®_axp_ipsout>; ++ ldo3in-supply = <®_axp_ipsout>; ++ ++ regulators { ++ vdd_rtc: ldo1 { ++ regulator-min-microvolt = <1300000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-always-on; ++ }; ++ ++ avcc: ldo2 { ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ ++ vcc_csi0: ldo3 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <3500000>; ++ regulator-always-on; ++ }; ++ ++ vcc_csi1: ldo4 { ++ regulator-min-microvolt = <1250000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ ++ vdd_cpu: dcdc2 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <2275000>; ++ regulator-always-on; ++ }; ++ ++ vdd_int: dcdc3 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <3500000>; ++ regulator-always-on; ++ }; ++ }; ++ }; ++ }; ++ ++ i2c1: i2c@01c2b000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++ }; ++ ++ gmac: ethernet@01c50000 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac_pins_rgmii_a>; ++ phy = <&phy1>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&led_pins_olinuxinolime>; ++ ++ green { ++ label = "a20-olinuxino-lime2:green:usr"; ++ gpios = <&pio 7 2 0>; ++ default-state = "on"; ++ }; ++ }; ++ ++ reg_ahci_5v: ahci-5v { ++ pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>; ++ gpio = <&pio 2 3 0>; ++ status = "okay"; ++ }; ++ ++ reg_usb1_vbus: usb1-vbus { ++ status = "okay"; ++ }; ++ ++ reg_usb2_vbus: usb2-vbus { ++ status = "okay"; ++ }; ++ ++ reg_axp_ipsout: axp_ipsout { ++ compatible = "regulator-fixed"; ++ regulator-name = "axp-ipsout"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++}; diff --git a/debian/patches/series b/debian/patches/series index 1e826345f..194c30682 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -107,6 +107,7 @@ features/arm/dts-sunxi-Banana-Pi-increase-startup-delay-for-the-GMAC-PHY-regulat features/arm/dts-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME.patch features/arm/dts-sun7i-Add-board-support-for-LinkSprite-pcDuino-V3.patch features/arm/dts-sun7i-pcduino3-Relicense-the-device-tree-under-GPLv2-X11.patch +features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch features/arm64/drivers-net-Add-APM-X-Gene-SoC-ethernet-driver-suppo.patch features/arm64/drivers-net-NET_XGENE-should-depend-on-HAS_DMA.patch features/arm64/net-xgene-Check-negative-return-value-of-xgene_enet_.patch From f410c9e025d1505eb59bca73b27893121cb08b9a Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 10 Feb 2015 04:17:23 +0000 Subject: [PATCH 02/32] Try and avoid nuking people's debian dir ... provide less rope at least. svn path=/dists/sid/linux/; revision=22363 --- debian/changelog | 1 + debian/patches/debian/no-clean.patch | 19 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 21 insertions(+) create mode 100644 debian/patches/debian/no-clean.patch diff --git a/debian/changelog b/debian/changelog index d2fb27e59..d41df3705 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) + * Don't delete debian dir on make clean/mrproper/etc. -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 diff --git a/debian/patches/debian/no-clean.patch b/debian/patches/debian/no-clean.patch new file mode 100644 index 000000000..280cbb0d6 --- /dev/null +++ b/debian/patches/debian/no-clean.patch @@ -0,0 +1,19 @@ +From: Ian Campbell +Subject: Do not clean (remove) /debian/ dir +Date: Tue, 10 Feb 2015 03:51:27 +0000 +Forwarded: not-needed + +When running "make clean" in the root of an actual Debian source package we +don't want to remove the debian dir. + +--- a/scripts/package/Makefile ++++ b/scripts/package/Makefile +@@ -90,8 +90,6 @@ + $(MAKE) KBUILD_SRC= + $(call cmd,builddeb) + +-clean-dirs += $(objtree)/debian/ +- + + # tarball targets + # --------------------------------------------------------------------------- diff --git a/debian/patches/series b/debian/patches/series index 194c30682..9542c9809 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,6 +6,7 @@ debian/ia64-hardcode-arch-script-output.patch debian/mips-disable-werror.patch debian/arch-sh4-fix-uimage-build.patch debian/powerpcspe-omit-uimage.patch +debian/no-clean.patch features/all/Kbuild-kconfig-Verbose-version-of-listnewconfig.patch # Fixes/improvements to firmware loading From 032085e954bb172efd7c01473f49aedd003ad683 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 12 Feb 2015 21:16:56 +0000 Subject: [PATCH 03/32] shm: add memfd.h to UAPI export list, so kdbus will build svn path=/dists/sid/linux/; revision=22384 --- debian/changelog | 3 +++ .../shm-add-memfd.h-to-uapi-export-list.patch | 27 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 31 insertions(+) create mode 100644 debian/patches/features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch diff --git a/debian/changelog b/debian/changelog index d41df3705..012d81452 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) * Don't delete debian dir on make clean/mrproper/etc. + [ Ben Hutchings ] + * shm: add memfd.h to UAPI export list, so kdbus will build + -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 linux (3.16.7-ckt4-3) unstable; urgency=medium diff --git a/debian/patches/features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch b/debian/patches/features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch new file mode 100644 index 000000000..35ac68df8 --- /dev/null +++ b/debian/patches/features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch @@ -0,0 +1,27 @@ +From: David Drysdale +Date: Tue, 9 Sep 2014 14:50:57 -0700 +Subject: shm: add memfd.h to UAPI export list +Origin: https://git.kernel.org/linus/b01d072065b6f36550f486fe77f05b092225ba1b + +The new header file memfd.h from commit 9183df25fe7b ("shm: add +memfd_create() syscall") should be exported. + +Signed-off-by: David Drysdale +Reviewed-by: David Herrmann +Cc: Hugh Dickins +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + include/uapi/linux/Kbuild | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/uapi/linux/Kbuild ++++ b/include/uapi/linux/Kbuild +@@ -241,6 +241,7 @@ header-y += matroxfb.h + header-y += mdio.h + header-y += media.h + header-y += mei.h ++header-y += memfd.h + header-y += mempolicy.h + header-y += meye.h + header-y += mic_common.h diff --git a/debian/patches/series b/debian/patches/series index 9542c9809..ede41205a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -502,3 +502,4 @@ bugfix/sh4/scripts-recordmcount.pl-there-is-no-m32-option-on-super-h.patch bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch +features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch From d2327664ce5dbb9fd3d895fe122a1e17b587e66f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 12 Feb 2015 21:20:24 +0000 Subject: [PATCH 04/32] Revert "Try and avoid nuking people's debian dir" The patched source is also used (via linux-source-) for building custom kernel packages, and 'make clean' definitely should remove the debian directory there. svn path=/dists/sid/linux/; revision=22385 --- debian/changelog | 1 - debian/patches/debian/no-clean.patch | 19 ------------------- debian/patches/series | 1 - 3 files changed, 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index 012d81452..b636191e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,7 +2,6 @@ linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) - * Don't delete debian dir on make clean/mrproper/etc. [ Ben Hutchings ] * shm: add memfd.h to UAPI export list, so kdbus will build diff --git a/debian/patches/debian/no-clean.patch b/debian/patches/debian/no-clean.patch index 280cbb0d6..e69de29bb 100644 --- a/debian/patches/debian/no-clean.patch +++ b/debian/patches/debian/no-clean.patch @@ -1,19 +0,0 @@ -From: Ian Campbell -Subject: Do not clean (remove) /debian/ dir -Date: Tue, 10 Feb 2015 03:51:27 +0000 -Forwarded: not-needed - -When running "make clean" in the root of an actual Debian source package we -don't want to remove the debian dir. - ---- a/scripts/package/Makefile -+++ b/scripts/package/Makefile -@@ -90,8 +90,6 @@ - $(MAKE) KBUILD_SRC= - $(call cmd,builddeb) - --clean-dirs += $(objtree)/debian/ -- - - # tarball targets - # --------------------------------------------------------------------------- diff --git a/debian/patches/series b/debian/patches/series index ede41205a..66f9a7e71 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,7 +6,6 @@ debian/ia64-hardcode-arch-script-output.patch debian/mips-disable-werror.patch debian/arch-sh4-fix-uimage-build.patch debian/powerpcspe-omit-uimage.patch -debian/no-clean.patch features/all/Kbuild-kconfig-Verbose-version-of-listnewconfig.patch # Fixes/improvements to firmware loading From bda3d7b1ef6548e09dcf91d8b2548170437d1b83 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 16 Feb 2015 03:35:17 +0000 Subject: [PATCH 05/32] [x86] HPET force enable for e6xx based systems (Closes: #772951) svn path=/dists/sid/linux/; revision=22390 --- debian/changelog | 1 + ...-force-enable-for-e6xx-based-systems.patch | 63 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 65 insertions(+) create mode 100644 debian/patches/bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch diff --git a/debian/changelog b/debian/changelog index b636191e8..edc342d28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium [ Ben Hutchings ] * shm: add memfd.h to UAPI export list, so kdbus will build + * [x86] HPET force enable for e6xx based systems (Closes: #772951) -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 diff --git a/debian/patches/bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch b/debian/patches/bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch new file mode 100644 index 000000000..3fcca286d --- /dev/null +++ b/debian/patches/bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch @@ -0,0 +1,63 @@ +From: Peter Neubauer +Date: Fri, 12 Sep 2014 13:06:13 +0200 +Subject: x86: HPET force enable for e6xx based systems +Origin: https://git.kernel.org/linus/2e151c70dfb0075ff83bec305c52a9da1ba49089 + +As the Soekris net6501 and other e6xx based systems do not have +any ACPI implementation, HPET won't get enabled. +This patch enables HPET on such platforms. + +[ 0.430149] pci 0000:00:01.0: Force enabled HPET at 0xfed00000 +[ 0.644838] HPET: 3 timers in total, 0 timers will be used for per-cpu timer + +Original patch by Peter Neubauer (http://www.mail-archive.com/soekris-tech@lists.soekris.com/msg06462.html) +slightly modified by Conrad Kostecki and massaged +accoring to Thomas Gleixners by me. + +Suggested-by: Conrad Kostecki +Signed-off-by: Eric Sesterhenn +Cc: Peter Neubauer +Link: http://lkml.kernel.org/r/5412D3A5.2030909@lsexperts.de +Signed-off-by: Thomas Gleixner +--- + arch/x86/kernel/quirks.c | 18 ++++++++++++++++++ + include/linux/pci_ids.h | 1 + + 2 files changed, 19 insertions(+) + +--- a/arch/x86/kernel/quirks.c ++++ b/arch/x86/kernel/quirks.c +@@ -498,6 +498,24 @@ void force_hpet_resume(void) + } + + /* ++ * According to the datasheet e6xx systems have the HPET hardwired to ++ * 0xfed00000 ++ */ ++static void e6xx_force_enable_hpet(struct pci_dev *dev) ++{ ++ if (hpet_address || force_hpet_address) ++ return; ++ ++ force_hpet_address = 0xFED00000; ++ force_hpet_resume_type = NONE_FORCE_HPET_RESUME; ++ dev_printk(KERN_DEBUG, &dev->dev, "Force enabled HPET at " ++ "0x%lx\n", force_hpet_address); ++ return; ++} ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E6XX_CU, ++ e6xx_force_enable_hpet); ++ ++/* + * HPET MSI on some boards (ATI SB700/SB800) has side effect on + * floppy DMA. Disable HPET MSI on such platforms. + * See erratum #27 (Misinterpreted MSI Requests May Result in +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -2859,6 +2859,7 @@ + #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 + #define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119 + #define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a ++#define PCI_DEVICE_ID_INTEL_E6XX_CU 0x8183 + #define PCI_DEVICE_ID_INTEL_ITC_LPC 0x8186 + #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 + #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 diff --git a/debian/patches/series b/debian/patches/series index 66f9a7e71..27b609d2e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -502,3 +502,4 @@ bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch +bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch From dfd470cb06a0608da732d704ded154a670763de5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 17 Feb 2015 05:19:56 +0000 Subject: [PATCH 06/32] vfs: read file_handle only once in handle_to_path (CVE-2015-1420) svn path=/dists/sid/linux/; revision=22398 --- debian/changelog | 1 + ...e_handle-only-once-in-handle_to_path.patch | 37 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 39 insertions(+) create mode 100644 debian/patches/bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch diff --git a/debian/changelog b/debian/changelog index edc342d28..65398b910 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium [ Ben Hutchings ] * shm: add memfd.h to UAPI export list, so kdbus will build * [x86] HPET force enable for e6xx based systems (Closes: #772951) + * vfs: read file_handle only once in handle_to_path (CVE-2015-1420) -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 diff --git a/debian/patches/bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch b/debian/patches/bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch new file mode 100644 index 000000000..ecc1bbb52 --- /dev/null +++ b/debian/patches/bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch @@ -0,0 +1,37 @@ +From: Sasha Levin +Subject: vfs: read file_handle only once in handle_to_path +Date: Wed, 28 Jan 2015 15:30:43 -0500 +Origin: http://article.gmane.org/gmane.linux.file-systems/92438 + +We used to read file_handle twice. Once to get the amount of extra bytes, and +once to fetch the entire structure. + +This may be problematic since we do size verifications only after the first +read, so if the number of extra bytes changes in userspace between the first +and second calls, we'll have an incoherent view of file_handle. + +Instead, read the constant size once, and copy that over to the final +structure without having to re-read it again. + +Signed-off-by: Sasha Levin +--- +Change in v2: + - Use the f_handle pointer rather than size of struct + + fs/fhandle.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/fs/fhandle.c ++++ b/fs/fhandle.c +@@ -195,8 +195,9 @@ static int handle_to_path(int mountdirfd + goto out_err; + } + /* copy the full handle */ +- if (copy_from_user(handle, ufh, +- sizeof(struct file_handle) + ++ *handle = f_handle; ++ if (copy_from_user(&handle->f_handle, ++ &ufh->f_handle, + f_handle.handle_bytes)) { + retval = -EFAULT; + goto out_handle; diff --git a/debian/patches/series b/debian/patches/series index 27b609d2e..c157bc78c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -503,3 +503,4 @@ bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch +bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch From ef31d8f0b0f0108c904c3f36dbd1fd3e8d54b5b0 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 17 Feb 2015 05:25:56 +0000 Subject: [PATCH 07/32] ASLR: fix stack randomization on 64-bit systems (CVE-2015-1593) svn path=/dists/sid/linux/; revision=22399 --- debian/changelog | 1 + ...tack-randomization-on-64-bit-systems.patch | 98 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 100 insertions(+) create mode 100644 debian/patches/bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch diff --git a/debian/changelog b/debian/changelog index 65398b910..3dbbd2e61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium * shm: add memfd.h to UAPI export list, so kdbus will build * [x86] HPET force enable for e6xx based systems (Closes: #772951) * vfs: read file_handle only once in handle_to_path (CVE-2015-1420) + * ASLR: fix stack randomization on 64-bit systems (CVE-2015-1593) -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 diff --git a/debian/patches/bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch b/debian/patches/bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch new file mode 100644 index 000000000..ee8e97a2d --- /dev/null +++ b/debian/patches/bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch @@ -0,0 +1,98 @@ +From: Hector Marco-Gisbert +Date: Sat, 14 Feb 2015 09:33:50 -0800 +Subject: ASLR: fix stack randomization on 64-bit systems +Origin: http://article.gmane.org/gmane.linux.kernel/1888210 + +The issue is that the stack for processes is not properly randomized on 64 bit +architectures due to an integer overflow. + +The affected function is randomize_stack_top() in file "fs/binfmt_elf.c": + +static unsigned long randomize_stack_top(unsigned long stack_top) +{ + unsigned int random_variable = 0; + + if ((current->flags & PF_RANDOMIZE) && + !(current->personality & ADDR_NO_RANDOMIZE)) { + random_variable = get_random_int() & STACK_RND_MASK; + random_variable <<= PAGE_SHIFT; + } + return PAGE_ALIGN(stack_top) + random_variable; + return PAGE_ALIGN(stack_top) - random_variable; +} + +Note that, it declares the "random_variable" variable as "unsigned int". Since +the result of the shifting operation between STACK_RND_MASK (which is +0x3fffff on x86_64, 22 bits) and PAGE_SHIFT (which is 12 on x86_64): + +random_variable <<= PAGE_SHIFT; + +then the two leftmost bits are dropped when storing the result in the +"random_variable". This variable shall be at least 34 bits long to hold the +(22+12) result. + +These two dropped bits have an impact on the entropy of process stack. +Concretely, the total stack entropy is reduced by four: from 2^28 to 2^30 (One +fourth of expected entropy). + +This patch restores back the entropy by correcting the types involved in the +operations in the functions randomize_stack_top() and stack_maxrandom_size(). + +The successful fix can be tested with: +$ for i in `seq 1 10`; do cat /proc/self/maps | grep stack; done +7ffeda566000-7ffeda587000 rw-p 00000000 00:00 0 [stack] +7fff5a332000-7fff5a353000 rw-p 00000000 00:00 0 [stack] +7ffcdb7a1000-7ffcdb7c2000 rw-p 00000000 00:00 0 [stack] +7ffd5e2c4000-7ffd5e2e5000 rw-p 00000000 00:00 0 [stack] +... + +Once corrected, the leading bytes should be between 7ffc and 7fff, rather +than always being 7fff. + +CVE-2015-1593 + +Signed-off-by: Hector Marco-Gisbert +Signed-off-by: Ismael Ripoll +[kees: rebase, fix 80 char, clean up commit message, add test example, cve] +Signed-off-by: Kees Cook +Cc: stable@vger.kernel.org +--- + arch/x86/mm/mmap.c | 6 +++--- + fs/binfmt_elf.c | 5 +++-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +--- a/arch/x86/mm/mmap.c ++++ b/arch/x86/mm/mmap.c +@@ -35,12 +35,12 @@ struct __read_mostly va_alignment va_ali + .flags = -1, + }; + +-static unsigned int stack_maxrandom_size(void) ++static unsigned long stack_maxrandom_size(void) + { +- unsigned int max = 0; ++ unsigned long max = 0; + if ((current->flags & PF_RANDOMIZE) && + !(current->personality & ADDR_NO_RANDOMIZE)) { +- max = ((-1U) & STACK_RND_MASK) << PAGE_SHIFT; ++ max = ((-1UL) & STACK_RND_MASK) << PAGE_SHIFT; + } + + return max; +--- a/fs/binfmt_elf.c ++++ b/fs/binfmt_elf.c +@@ -554,11 +554,12 @@ out: + + static unsigned long randomize_stack_top(unsigned long stack_top) + { +- unsigned int random_variable = 0; ++ unsigned long random_variable = 0; + + if ((current->flags & PF_RANDOMIZE) && + !(current->personality & ADDR_NO_RANDOMIZE)) { +- random_variable = get_random_int() & STACK_RND_MASK; ++ random_variable = (unsigned long) get_random_int(); ++ random_variable &= STACK_RND_MASK; + random_variable <<= PAGE_SHIFT; + } + #ifdef CONFIG_STACK_GROWSUP diff --git a/debian/patches/series b/debian/patches/series index c157bc78c..3bdef52fd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -504,3 +504,4 @@ bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch +bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch From 0568c0df1e3d37b3defad1da44488d5591b510cd Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Feb 2015 05:08:16 +0000 Subject: [PATCH 08/32] Update to 3.16.7-ckt6 Drop/refresh patches as necessary. ABI changes still need to be resolved. svn path=/dists/sid/linux/; revision=22412 --- debian/changelog | 130 ++- ...en-pass-dev_addr-to-swiotlb_tbl_unma.patch | 35 - ...to-add-missing-crypto-module-aliases.patch | 223 ---- ...ude-crypto-module-prefix-in-template.patch | 215 ---- ...refix-module-autoloading-with-crypto.patch | 995 ------------------ ...b-corruption-from-use-after-free-on-.patch | 126 --- ...ack-disable-generic-tracking-for-kno.patch | 87 -- ..._timer-Only-use-the-virtual-counter-.patch | 40 - ...pl-there-is-no-m32-option-on-super-h.patch | 40 - ...kvm-x86-sysenter-emulation-is-broken.patch | 78 -- ...t-an-all-zero-struct-user_desc-as-no.patch | 112 -- ...ls-ldt-stop-checking-lm-in-ldt_empty.patch | 49 - ...the-vdso-address-randomization-algor.patch | 124 --- .../features/all/aufs3/aufs3-mmap.patch | 77 +- ...-resume-quirks-for-apple-thunderbolt.patch | 8 +- debian/patches/series | 12 - 16 files changed, 155 insertions(+), 2196 deletions(-) delete mode 100644 debian/patches/bugfix/all/Revert-swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unma.patch delete mode 100644 debian/patches/bugfix/all/crypto-add-missing-crypto-module-aliases.patch delete mode 100644 debian/patches/bugfix/all/crypto-include-crypto-module-prefix-in-template.patch delete mode 100644 debian/patches/bugfix/all/crypto-prefix-module-autoloading-with-crypto.patch delete mode 100644 debian/patches/bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch delete mode 100644 debian/patches/bugfix/all/netfilter-conntrack-disable-generic-tracking-for-kno.patch delete mode 100644 debian/patches/bugfix/arm64/clocksource-arch_timer-Only-use-the-virtual-counter-.patch delete mode 100644 debian/patches/bugfix/sh4/scripts-recordmcount.pl-there-is-no-m32-option-on-super-h.patch delete mode 100644 debian/patches/bugfix/x86/kvm-x86-sysenter-emulation-is-broken.patch delete mode 100644 debian/patches/bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch delete mode 100644 debian/patches/bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch delete mode 100644 debian/patches/bugfix/x86/x86_64-vdso-fix-the-vdso-address-randomization-algor.patch diff --git a/debian/changelog b/debian/changelog index 3dbbd2e61..f14688ec9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,132 @@ -linux (3.16.7-ckt4-4) UNRELEASED; urgency=medium +linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium + + * New upstream stable update: + http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt5 + - [x86] vdso: Use asm volatile in __getcpu + - SCSI: fix regression in scsi_send_eh_cmnd() (regression in 3.16) + - Btrfs: don't delay inode ref updates during log replay + (regression in 3.16.7) + - mm: propagate error from stack expansion even for guard page + - vfio-pci: Fix the check on pci device type in vfio_pci_probe() + - rpc: fix xdr_truncate_encode to handle buffer ending on page boundary + (regression in 3.16) + - [arm64] efi: add missing call to early_ioremap_reset() + (regression in 3.16) + - exit: fix race between wait_consider_task() and wait_task_zombie() + (regression in 3.15) + - mm: prevent endless growth of anon_vma hierarchy + - mm: protect set_page_dirty() from ongoing truncation + - mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process + being killed + - sched/deadline: Fix migration of SCHED_DEADLINE tasks + - HID: roccat: potential out of bounds in pyra_sysfs_write_settings() + - mm: Don't count the stack guard page towards RLIMIT_STACK + - mm: fix corner case in anon_vma endless growing prevention + - [arm*][xen] introduce xen_arch_need_swiotlb + - fsnotify: next_i is freed during fsnotify_unmount_inodes. + - [armhf] ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized + object (regression in 3.15) + - HID: i2c-hid: Do not free buffers in i2c_hid_stop() (regression in 3.15) + - ALSA: fireworks: fix an endianness bug for transaction length + (regression in 3.16) + - [armhf] mtd: nand: omap: Fix NAND enumeration on 3430 LDP + (regression in 3.13) + - ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() + when link file (regression in 3.14) + - [powerpc*] Fix bad NULL pointer check in udbg_uart_getc_poll() + (regression in 3.12) + - nilfs2: fix the nilfs_iget() vs. nilfs_new_inode() races + - [armhf] OMAP4: PM: Only do static dependency configuration in + omap4_init_static_deps (regression in 3.11) + - [armel,armhf] Revert "ARM: 7830/1: delay: don't bother reporting bogomips + in /proc/cpuinfo" (regression in 3.12) + - gre: fix the inner mac header in nbma tunnel xmit path + (regression in 3.16.7-ckt3) + - netlink: Always copy on mmap TX. + - netlink: Don't reorder loads/stores before marking mmap netlink frame as + available + - batman-adv: Unify fragment size calculation (regression in 3.13) + - batman-adv: avoid NULL dereferences and fix if check (regression in 3.13) + - net: Fix stacked vlan offload features computation + - net: Reset secmark when scrubbing packet + - xen-netback: fixing the propagation of the transmit shaper timeout + (regression in 3.16) + - team: avoid possible underflow of count_pending value for notify_peers + and mcast_rejoin (regression in 3.12) + - usb: gadget: gadgetfs: Free memory allocated by memdup_user() + (regression in 3.15) + - iwlwifi: mvm: fix Rx with both chains (regression in 3.16) + - LOCKD: Fix a race when initialising nlmsvc_timeout (regression in 3.11) + - NFSv4.1: Fix client id trunking on Linux + - vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion + - xhci: Check if slot is already in default state before moving it there + (regression in 3.14) + - USB: console: fix uninitialised ldisc semaphore (regression in 3.12) + - USB: console: fix potential use after free + - [armhf] usb: dwc3: gadget: Fix TRB preparation during SG + - [x86] ftrace/jprobes: Fix conflict between jprobes and function graph + tracing + - clk: Don't try to use a struct clk* after it could have been freed + - [x86] drm/i915: Evict CS TLBs between batches + - [xen] Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single" + (regression in 3.16.7-ckt4) + http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt6 + - ipvs: uninitialized data with IP_VS_IPV6 + - netfilter: nfnetlink: validate nfnetlink header from batch + - time: settimeofday: Validate the values of tv from user + - drm/radeon: fix VM flush on cayman/aruba (v3) + - drm/radeon: fix VM flush on SI (v3) + - drm/radeon: fix VM flush on CIK (v3) + - drm/radeon: add a dpm quirk list (regression around 3.14) + - can: dev: fix crtlmode_supported check + - can: kvaser_usb: Don't free packets when tight on URBs + - drm/radeon: use rv515_ring_start on r5xx (regression in 3.12) + - PCI: Mark Atheros AR93xx to avoid bus reset (regression in 3.14) + - [x86] PCI: Clip bridge windows to fit in upstream windows + (regression in 3.16) + - [armhf] mvebu: completely disable hardware I/O coherency + - cifs: fix deadlock in cifs_ioctl_clone() + - ipr: wait for aborted command responses + - libata: allow sata_sil24 to opt-out of tag ordered submission + (regression in 3.14.4, 3.15) + - [media] vb2: fix vb2_thread_stop race conditions + - [i386/586] apic: Re-enable PCI_MSI support for non-SMP X86_32 + (regression in 3.12) + - dm cache: share cache-metadata object across inactive and active DM + tables + - dm cache: fix problematic dual use of a single migration count variable + - Input: evdev - fix EVIOCG{type} ioctl + - tty: Fix pty master poll() after slave closes v2 (regression in 3.12) + - [armhf] bus: omap_l3_noc: Add resume hook to restore context + (regression in 3.16) + - decompress_bunzip2: off by one in get_next_block() + - kbuild: Fix removal of the debian/ directory (regression in 3.16) + - mm: get rid of radix tree gfp mask for pagecache_get_page + (regression in 3.16) + - regulator: core: fix race condition in regulator_put() + - ASoC: simple-card: Fix crash in asoc_simple_card_unref() + (regression in 3.15) + - [ppc64el] xmon: Fix another endiannes issue in RTAS call from xmon + - nfs: fix dio deadlock when O_DIRECT flag is flipped + - mac80211: properly set CCK flag in radiotap (regression in 3.12) + - [x86] drm/i915: Only fence tiled region of object. + - can: kvaser_usb: Do not sleep in atomic context + - can: kvaser_usb: Send correct context to URB completion + - rbd: fix rbd_dev_parent_get() when parent_overlap == 0 + - rbd: drop parent_ref in rbd_dev_unprobe() unconditionally + - dm cache: fix missing ERR_PTR returns and handling + - dm thin: don't allow messages to be sent to a pool target in READ_ONLY + or FAIL mode + - [armhf] mvebu: don't set the PL310 in I/O coherency mode when I/O + coherency is disabled + - vm: add VM_FAULT_SIGSEGV handling support + - vm: make stack guard page errors return VM_FAULT_SIGSEGV rather than + SIGBUS + - perf: Tighten (and fix) the grouping condition + - iwlwifi: mvm: drop non VO frames when flushing (regression in 3.16) + - memcg: remove extra newlines from memcg oom kill log (regression in 3.15) + - ipv4: try to cache dst_entries which would cause a redirect + (regression in 3.16) [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) diff --git a/debian/patches/bugfix/all/Revert-swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unma.patch b/debian/patches/bugfix/all/Revert-swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unma.patch deleted file mode 100644 index 77a9bc78d..000000000 --- a/debian/patches/bugfix/all/Revert-swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unma.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c3d92e076c01e257d0cac339e1942f1217ba279b Mon Sep 17 00:00:00 2001 -From: David Vrabel -Date: Wed, 10 Dec 2014 14:48:43 +0000 -Subject: [PATCH] Revert "swiotlb-xen: pass dev_addr to - swiotlb_tbl_unmap_single" - -This reverts commit 2c3fc8d26dd09b9d7069687eead849ee81c78e46. - -This commit broke on x86 PV because entries in the generic SWIOTLB are -indexed using (pseudo-)physical address not DMA address and these are -not the same in a x86 PV guest. - -Signed-off-by: David Vrabel -Reviewed-by: Stefano Stabellini -(cherry picked from commit dbdd74763f1faf799fbb9ed30423182e92919378) ---- - drivers/xen/swiotlb-xen.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c -index 5ea1e3c..810ad41 100644 ---- a/drivers/xen/swiotlb-xen.c -+++ b/drivers/xen/swiotlb-xen.c -@@ -451,7 +451,7 @@ static void xen_unmap_single(struct device *hwdev, dma_addr_t dev_addr, - - /* NOTE: We use dev_addr here, not paddr! */ - if (is_xen_swiotlb_buffer(dev_addr)) { -- swiotlb_tbl_unmap_single(hwdev, dev_addr, size, dir); -+ swiotlb_tbl_unmap_single(hwdev, paddr, size, dir); - return; - } - --- -1.7.10.4 - diff --git a/debian/patches/bugfix/all/crypto-add-missing-crypto-module-aliases.patch b/debian/patches/bugfix/all/crypto-add-missing-crypto-module-aliases.patch deleted file mode 100644 index 687b374f9..000000000 --- a/debian/patches/bugfix/all/crypto-add-missing-crypto-module-aliases.patch +++ /dev/null @@ -1,223 +0,0 @@ -From: Mathias Krause -Date: Sun, 11 Jan 2015 18:17:42 +0100 -Subject: crypto: add missing crypto module aliases -Origin: https://git.kernel.org/linus/3e14dcf7cb80b34a1f38b55bc96f02d23fdaaaaf - -Commit 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"") -changed the automatic module loading when requesting crypto algorithms -to prefix all module requests with "crypto-". This requires all crypto -modules to have a crypto specific module alias even if their file name -would otherwise match the requested crypto algorithm. - -Even though commit 5d26a105b5a7 added those aliases for a vast amount of -modules, it was missing a few. Add the required MODULE_ALIAS_CRYPTO -annotations to those files to make them get loaded automatically, again. -This fixes, e.g., requesting 'ecb(blowfish-generic)', which used to work -with kernels v3.18 and below. - -Also change MODULE_ALIAS() lines to MODULE_ALIAS_CRYPTO(). The former -won't work for crypto modules any more. - -Fixes: 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"") -Cc: Kees Cook -Signed-off-by: Mathias Krause -Signed-off-by: Herbert Xu -[bwh: Backported to 3.16: drop changes to x86 sha1_mb which we don't have] ---- - arch/powerpc/crypto/sha1.c | 1 + - crypto/aes_generic.c | 1 + - crypto/ansi_cprng.c | 1 + - crypto/blowfish_generic.c | 1 + - crypto/camellia_generic.c | 1 + - crypto/cast5_generic.c | 1 + - crypto/cast6_generic.c | 1 + - crypto/crc32c_generic.c | 1 + - crypto/crct10dif_generic.c | 1 + - crypto/des_generic.c | 7 ++++--- - crypto/ghash-generic.c | 1 + - crypto/krng.c | 1 + - crypto/salsa20_generic.c | 1 + - crypto/serpent_generic.c | 1 + - crypto/sha1_generic.c | 1 + - crypto/sha256_generic.c | 2 ++ - crypto/sha512_generic.c | 2 ++ - crypto/tea.c | 1 + - crypto/tgr192.c | 1 + - crypto/twofish_generic.c | 1 + - crypto/wp512.c | 1 + - ---- a/arch/powerpc/crypto/sha1.c -+++ b/arch/powerpc/crypto/sha1.c -@@ -154,4 +154,5 @@ module_exit(sha1_powerpc_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); - -+MODULE_ALIAS_CRYPTO("sha1"); - MODULE_ALIAS_CRYPTO("sha1-powerpc"); ---- a/crypto/aes_generic.c -+++ b/crypto/aes_generic.c -@@ -1475,3 +1475,4 @@ module_exit(aes_fini); - MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); - MODULE_LICENSE("Dual BSD/GPL"); - MODULE_ALIAS_CRYPTO("aes"); -+MODULE_ALIAS_CRYPTO("aes-generic"); ---- a/crypto/ansi_cprng.c -+++ b/crypto/ansi_cprng.c -@@ -477,3 +477,4 @@ MODULE_PARM_DESC(dbg, "Boolean to enable - module_init(prng_mod_init); - module_exit(prng_mod_fini); - MODULE_ALIAS_CRYPTO("stdrng"); -+MODULE_ALIAS_CRYPTO("ansi_cprng"); ---- a/crypto/blowfish_generic.c -+++ b/crypto/blowfish_generic.c -@@ -139,3 +139,4 @@ module_exit(blowfish_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Blowfish Cipher Algorithm"); - MODULE_ALIAS_CRYPTO("blowfish"); -+MODULE_ALIAS_CRYPTO("blowfish-generic"); ---- a/crypto/camellia_generic.c -+++ b/crypto/camellia_generic.c -@@ -1099,3 +1099,4 @@ module_exit(camellia_fini); - MODULE_DESCRIPTION("Camellia Cipher Algorithm"); - MODULE_LICENSE("GPL"); - MODULE_ALIAS_CRYPTO("camellia"); -+MODULE_ALIAS_CRYPTO("camellia-generic"); ---- a/crypto/cast5_generic.c -+++ b/crypto/cast5_generic.c -@@ -550,3 +550,4 @@ module_exit(cast5_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); - MODULE_ALIAS_CRYPTO("cast5"); -+MODULE_ALIAS_CRYPTO("cast5-generic"); ---- a/crypto/cast6_generic.c -+++ b/crypto/cast6_generic.c -@@ -292,3 +292,4 @@ module_exit(cast6_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); - MODULE_ALIAS_CRYPTO("cast6"); -+MODULE_ALIAS_CRYPTO("cast6-generic"); ---- a/crypto/crc32c_generic.c -+++ b/crypto/crc32c_generic.c -@@ -171,4 +171,5 @@ MODULE_AUTHOR("Clay Haapala "); --MODULE_ALIAS("des"); -+MODULE_ALIAS_CRYPTO("des"); -+MODULE_ALIAS_CRYPTO("des-generic"); -+MODULE_ALIAS_CRYPTO("des3_ede"); -+MODULE_ALIAS_CRYPTO("des3_ede-generic"); ---- a/crypto/ghash-generic.c -+++ b/crypto/ghash-generic.c -@@ -173,3 +173,4 @@ module_exit(ghash_mod_exit); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("GHASH Message Digest Algorithm"); - MODULE_ALIAS_CRYPTO("ghash"); -+MODULE_ALIAS_CRYPTO("ghash-generic"); ---- a/crypto/krng.c -+++ b/crypto/krng.c -@@ -63,3 +63,4 @@ module_exit(krng_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Kernel Random Number Generator"); - MODULE_ALIAS_CRYPTO("stdrng"); -+MODULE_ALIAS_CRYPTO("krng"); ---- a/crypto/salsa20_generic.c -+++ b/crypto/salsa20_generic.c -@@ -249,3 +249,4 @@ module_exit(salsa20_generic_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm"); - MODULE_ALIAS_CRYPTO("salsa20"); -+MODULE_ALIAS_CRYPTO("salsa20-generic"); ---- a/crypto/serpent_generic.c -+++ b/crypto/serpent_generic.c -@@ -667,3 +667,4 @@ MODULE_DESCRIPTION("Serpent and tnepres - MODULE_AUTHOR("Dag Arne Osvik "); - MODULE_ALIAS_CRYPTO("tnepres"); - MODULE_ALIAS_CRYPTO("serpent"); -+MODULE_ALIAS_CRYPTO("serpent-generic"); ---- a/crypto/sha1_generic.c -+++ b/crypto/sha1_generic.c -@@ -154,3 +154,4 @@ MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); - - MODULE_ALIAS_CRYPTO("sha1"); -+MODULE_ALIAS_CRYPTO("sha1-generic"); ---- a/crypto/sha256_generic.c -+++ b/crypto/sha256_generic.c -@@ -385,4 +385,6 @@ MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); - - MODULE_ALIAS_CRYPTO("sha224"); -+MODULE_ALIAS_CRYPTO("sha224-generic"); - MODULE_ALIAS_CRYPTO("sha256"); -+MODULE_ALIAS_CRYPTO("sha256-generic"); ---- a/crypto/sha512_generic.c -+++ b/crypto/sha512_generic.c -@@ -288,4 +288,6 @@ MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); - - MODULE_ALIAS_CRYPTO("sha384"); -+MODULE_ALIAS_CRYPTO("sha384-generic"); - MODULE_ALIAS_CRYPTO("sha512"); -+MODULE_ALIAS_CRYPTO("sha512-generic"); ---- a/crypto/tea.c -+++ b/crypto/tea.c -@@ -270,6 +270,7 @@ static void __exit tea_mod_fini(void) - crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs)); - } - -+MODULE_ALIAS_CRYPTO("tea"); - MODULE_ALIAS_CRYPTO("xtea"); - MODULE_ALIAS_CRYPTO("xeta"); - ---- a/crypto/tgr192.c -+++ b/crypto/tgr192.c -@@ -676,6 +676,7 @@ static void __exit tgr192_mod_fini(void) - crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); - } - -+MODULE_ALIAS_CRYPTO("tgr192"); - MODULE_ALIAS_CRYPTO("tgr160"); - MODULE_ALIAS_CRYPTO("tgr128"); - ---- a/crypto/twofish_generic.c -+++ b/crypto/twofish_generic.c -@@ -212,3 +212,4 @@ module_exit(twofish_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION ("Twofish Cipher Algorithm"); - MODULE_ALIAS_CRYPTO("twofish"); -+MODULE_ALIAS_CRYPTO("twofish-generic"); ---- a/crypto/wp512.c -+++ b/crypto/wp512.c -@@ -1167,6 +1167,7 @@ static void __exit wp512_mod_fini(void) - crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs)); - } - -+MODULE_ALIAS_CRYPTO("wp512"); - MODULE_ALIAS_CRYPTO("wp384"); - MODULE_ALIAS_CRYPTO("wp256"); - diff --git a/debian/patches/bugfix/all/crypto-include-crypto-module-prefix-in-template.patch b/debian/patches/bugfix/all/crypto-include-crypto-module-prefix-in-template.patch deleted file mode 100644 index df6004ec4..000000000 --- a/debian/patches/bugfix/all/crypto-include-crypto-module-prefix-in-template.patch +++ /dev/null @@ -1,215 +0,0 @@ -From: Kees Cook -Date: Mon, 24 Nov 2014 16:32:38 -0800 -Subject: crypto: include crypto- module prefix in template -Origin: https://git.kernel.org/linus/4943ba16bbc2db05115707b3ff7b4874e9e3c560 - -This adds the module loading prefix "crypto-" to the template lookup -as well. - -For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly -includes the "crypto-" prefix at every level, correctly rejecting "vfat": - - net-pf-38 - algif-hash - crypto-vfat(blowfish) - crypto-vfat(blowfish)-all - crypto-vfat - -Reported-by: Mathias Krause -Signed-off-by: Kees Cook -Acked-by: Mathias Krause -Signed-off-by: Herbert Xu -[bwh: Backported to 3.16: drop changes to mcryptd which we don't have] ---- - arch/x86/crypto/fpu.c | 3 +++ - crypto/algapi.c | 4 ++-- - crypto/authenc.c | 1 + - crypto/authencesn.c | 1 + - crypto/cbc.c | 1 + - crypto/ccm.c | 1 + - crypto/chainiv.c | 1 + - crypto/cmac.c | 1 + - crypto/cryptd.c | 1 + - crypto/ctr.c | 1 + - crypto/cts.c | 1 + - crypto/ecb.c | 1 + - crypto/eseqiv.c | 1 + - crypto/gcm.c | 1 + - crypto/hmac.c | 1 + - crypto/lrw.c | 1 + - crypto/pcbc.c | 1 + - crypto/pcrypt.c | 1 + - crypto/seqiv.c | 1 + - crypto/vmac.c | 1 + - crypto/xcbc.c | 1 + - crypto/xts.c | 1 + - ---- a/arch/x86/crypto/fpu.c -+++ b/arch/x86/crypto/fpu.c -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include - - struct crypto_fpu_ctx { -@@ -159,3 +160,5 @@ void __exit crypto_fpu_exit(void) - { - crypto_unregister_template(&crypto_fpu_tmpl); - } -+ -+MODULE_ALIAS_CRYPTO("fpu"); ---- a/crypto/algapi.c -+++ b/crypto/algapi.c -@@ -495,8 +495,8 @@ static struct crypto_template *__crypto_ - - struct crypto_template *crypto_lookup_template(const char *name) - { -- return try_then_request_module(__crypto_lookup_template(name), "%s", -- name); -+ return try_then_request_module(__crypto_lookup_template(name), -+ "crypto-%s", name); - } - EXPORT_SYMBOL_GPL(crypto_lookup_template); - ---- a/crypto/authenc.c -+++ b/crypto/authenc.c -@@ -721,3 +721,4 @@ module_exit(crypto_authenc_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Simple AEAD wrapper for IPsec"); -+MODULE_ALIAS_CRYPTO("authenc"); ---- a/crypto/authencesn.c -+++ b/crypto/authencesn.c -@@ -814,3 +814,4 @@ module_exit(crypto_authenc_esn_module_ex - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Steffen Klassert "); - MODULE_DESCRIPTION("AEAD wrapper for IPsec with extended sequence numbers"); -+MODULE_ALIAS_CRYPTO("authencesn"); ---- a/crypto/cbc.c -+++ b/crypto/cbc.c -@@ -289,3 +289,4 @@ module_exit(crypto_cbc_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("CBC block cipher algorithm"); -+MODULE_ALIAS_CRYPTO("cbc"); ---- a/crypto/ccm.c -+++ b/crypto/ccm.c -@@ -881,3 +881,4 @@ MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Counter with CBC MAC"); - MODULE_ALIAS_CRYPTO("ccm_base"); - MODULE_ALIAS_CRYPTO("rfc4309"); -+MODULE_ALIAS_CRYPTO("ccm"); ---- a/crypto/chainiv.c -+++ b/crypto/chainiv.c -@@ -359,3 +359,4 @@ module_exit(chainiv_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Chain IV Generator"); -+MODULE_ALIAS_CRYPTO("chainiv"); ---- a/crypto/cmac.c -+++ b/crypto/cmac.c -@@ -313,3 +313,4 @@ module_exit(crypto_cmac_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("CMAC keyed hash algorithm"); -+MODULE_ALIAS_CRYPTO("cmac"); ---- a/crypto/cryptd.c -+++ b/crypto/cryptd.c -@@ -955,3 +955,4 @@ module_exit(cryptd_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Software async crypto daemon"); -+MODULE_ALIAS_CRYPTO("cryptd"); ---- a/crypto/ctr.c -+++ b/crypto/ctr.c -@@ -467,3 +467,4 @@ module_exit(crypto_ctr_module_exit); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("CTR Counter block mode"); - MODULE_ALIAS_CRYPTO("rfc3686"); -+MODULE_ALIAS_CRYPTO("ctr"); ---- a/crypto/cts.c -+++ b/crypto/cts.c -@@ -350,3 +350,4 @@ module_exit(crypto_cts_module_exit); - - MODULE_LICENSE("Dual BSD/GPL"); - MODULE_DESCRIPTION("CTS-CBC CipherText Stealing for CBC"); -+MODULE_ALIAS_CRYPTO("cts"); ---- a/crypto/ecb.c -+++ b/crypto/ecb.c -@@ -185,3 +185,4 @@ module_exit(crypto_ecb_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("ECB block cipher algorithm"); -+MODULE_ALIAS_CRYPTO("ecb"); ---- a/crypto/eseqiv.c -+++ b/crypto/eseqiv.c -@@ -267,3 +267,4 @@ module_exit(eseqiv_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Encrypted Sequence Number IV Generator"); -+MODULE_ALIAS_CRYPTO("eseqiv"); ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -1444,3 +1444,4 @@ MODULE_AUTHOR("Mikko Herranen "); - MODULE_DESCRIPTION("Parallel crypto wrapper"); -+MODULE_ALIAS_CRYPTO("pcrypt"); ---- a/crypto/seqiv.c -+++ b/crypto/seqiv.c -@@ -362,3 +362,4 @@ module_exit(seqiv_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Sequence Number IV Generator"); -+MODULE_ALIAS_CRYPTO("seqiv"); ---- a/crypto/vmac.c -+++ b/crypto/vmac.c -@@ -713,3 +713,4 @@ module_exit(vmac_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("VMAC hash algorithm"); -+MODULE_ALIAS_CRYPTO("vmac"); ---- a/crypto/xcbc.c -+++ b/crypto/xcbc.c -@@ -286,3 +286,4 @@ module_exit(crypto_xcbc_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("XCBC keyed hash algorithm"); -+MODULE_ALIAS_CRYPTO("xcbc"); ---- a/crypto/xts.c -+++ b/crypto/xts.c -@@ -362,3 +362,4 @@ module_exit(crypto_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("XTS block cipher mode"); -+MODULE_ALIAS_CRYPTO("xts"); diff --git a/debian/patches/bugfix/all/crypto-prefix-module-autoloading-with-crypto.patch b/debian/patches/bugfix/all/crypto-prefix-module-autoloading-with-crypto.patch deleted file mode 100644 index 127601af8..000000000 --- a/debian/patches/bugfix/all/crypto-prefix-module-autoloading-with-crypto.patch +++ /dev/null @@ -1,995 +0,0 @@ -From: Kees Cook -Date: Thu, 20 Nov 2014 17:05:53 -0800 -Subject: crypto: prefix module autoloading with "crypto-" -Origin: https://git.kernel.org/linus/5d26a105b5a73e5635eae0629b42fa0a90e07b7b - -This prefixes all crypto module loading with "crypto-" so we never run -the risk of exposing module auto-loading to userspace via a crypto API, -as demonstrated by Mathias Krause: - -https://lkml.org/lkml/2013/3/4/70 - -Signed-off-by: Kees Cook -Signed-off-by: Herbert Xu -[bwh: Backported to 3.16: drop changes to drivers we don't have] ---- - arch/arm/crypto/aes_glue.c | 4 ++-- - arch/arm/crypto/sha1_glue.c | 2 +- - arch/arm64/crypto/aes-ce-ccm-glue.c | 2 +- - arch/arm64/crypto/aes-glue.c | 8 ++++---- - arch/powerpc/crypto/sha1.c | 2 +- - arch/s390/crypto/aes_s390.c | 2 +- - arch/s390/crypto/des_s390.c | 4 ++-- - arch/s390/crypto/ghash_s390.c | 2 +- - arch/s390/crypto/sha1_s390.c | 2 +- - arch/s390/crypto/sha256_s390.c | 4 ++-- - arch/s390/crypto/sha512_s390.c | 4 ++-- - arch/sparc/crypto/aes_glue.c | 2 +- - arch/sparc/crypto/camellia_glue.c | 2 +- - arch/sparc/crypto/crc32c_glue.c | 2 +- - arch/sparc/crypto/des_glue.c | 2 +- - arch/sparc/crypto/md5_glue.c | 2 +- - arch/sparc/crypto/sha1_glue.c | 2 +- - arch/sparc/crypto/sha256_glue.c | 4 ++-- - arch/sparc/crypto/sha512_glue.c | 4 ++-- - arch/x86/crypto/aes_glue.c | 4 ++-- - arch/x86/crypto/aesni-intel_glue.c | 2 +- - arch/x86/crypto/blowfish_glue.c | 4 ++-- - arch/x86/crypto/camellia_aesni_avx2_glue.c | 4 ++-- - arch/x86/crypto/camellia_aesni_avx_glue.c | 4 ++-- - arch/x86/crypto/camellia_glue.c | 4 ++-- - arch/x86/crypto/cast5_avx_glue.c | 2 +- - arch/x86/crypto/cast6_avx_glue.c | 2 +- - arch/x86/crypto/crc32-pclmul_glue.c | 4 ++-- - arch/x86/crypto/crc32c-intel_glue.c | 4 ++-- - arch/x86/crypto/crct10dif-pclmul_glue.c | 4 ++-- - arch/x86/crypto/ghash-clmulni-intel_glue.c | 2 +- - arch/x86/crypto/salsa20_glue.c | 4 ++-- - arch/x86/crypto/serpent_avx2_glue.c | 4 ++-- - arch/x86/crypto/serpent_avx_glue.c | 2 +- - arch/x86/crypto/serpent_sse2_glue.c | 2 +- - arch/x86/crypto/sha1_ssse3_glue.c | 2 +- - arch/x86/crypto/sha256_ssse3_glue.c | 4 ++-- - arch/x86/crypto/sha512_ssse3_glue.c | 4 ++-- - arch/x86/crypto/twofish_avx_glue.c | 2 +- - arch/x86/crypto/twofish_glue.c | 4 ++-- - arch/x86/crypto/twofish_glue_3way.c | 4 ++-- - crypto/842.c | 1 + - crypto/aes_generic.c | 2 +- - crypto/ansi_cprng.c | 2 +- - crypto/anubis.c | 1 + - crypto/api.c | 4 ++-- - crypto/arc4.c | 1 + - crypto/blowfish_generic.c | 2 +- - crypto/camellia_generic.c | 2 +- - crypto/cast5_generic.c | 2 +- - crypto/cast6_generic.c | 2 +- - crypto/ccm.c | 4 ++-- - crypto/crc32.c | 1 + - crypto/crc32c_generic.c | 2 +- - crypto/crct10dif_generic.c | 2 +- - crypto/crypto_null.c | 6 +++--- - crypto/ctr.c | 2 +- - crypto/deflate.c | 2 +- - crypto/des_generic.c | 2 +- - crypto/fcrypt.c | 1 + - crypto/gcm.c | 6 +++--- - crypto/ghash-generic.c | 2 +- - crypto/khazad.c | 1 + - crypto/krng.c | 2 +- - crypto/lz4.c | 1 + - crypto/lz4hc.c | 1 + - crypto/lzo.c | 1 + - crypto/md4.c | 2 +- - crypto/md5.c | 1 + - crypto/michael_mic.c | 1 + - crypto/rmd128.c | 1 + - crypto/rmd160.c | 1 + - crypto/rmd256.c | 1 + - crypto/rmd320.c | 1 + - crypto/salsa20_generic.c | 2 +- - crypto/seed.c | 1 + - crypto/serpent_generic.c | 4 ++-- - crypto/sha1_generic.c | 2 +- - crypto/sha256_generic.c | 4 ++-- - crypto/sha512_generic.c | 4 ++-- - crypto/tea.c | 4 ++-- - crypto/tgr192.c | 4 ++-- - crypto/twofish_generic.c | 2 +- - crypto/wp512.c | 4 ++-- - crypto/zlib.c | 1 + - drivers/crypto/padlock-aes.c | 2 +- - drivers/crypto/padlock-sha.c | 8 ++++---- - drivers/crypto/ux500/cryp/cryp_core.c | 4 ++-- - drivers/crypto/ux500/hash/hash_core.c | 8 ++++---- - drivers/s390/crypto/ap_bus.c | 3 ++- - include/linux/crypto.h | 13 +++++++++++++ - ---- a/arch/arm/crypto/aes_glue.c -+++ b/arch/arm/crypto/aes_glue.c -@@ -93,6 +93,6 @@ module_exit(aes_fini); - - MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm (ASM)"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("aes"); --MODULE_ALIAS("aes-asm"); -+MODULE_ALIAS_CRYPTO("aes"); -+MODULE_ALIAS_CRYPTO("aes-asm"); - MODULE_AUTHOR("David McCullough "); ---- a/arch/arm/crypto/sha1_glue.c -+++ b/arch/arm/crypto/sha1_glue.c -@@ -175,5 +175,5 @@ module_exit(sha1_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm (ARM)"); --MODULE_ALIAS("sha1"); -+MODULE_ALIAS_CRYPTO("sha1"); - MODULE_AUTHOR("David McCullough "); ---- a/arch/arm64/crypto/aes-ce-ccm-glue.c -+++ b/arch/arm64/crypto/aes-ce-ccm-glue.c -@@ -294,4 +294,4 @@ module_exit(aes_mod_exit); - MODULE_DESCRIPTION("Synchronous AES in CCM mode using ARMv8 Crypto Extensions"); - MODULE_AUTHOR("Ard Biesheuvel "); - MODULE_LICENSE("GPL v2"); --MODULE_ALIAS("ccm(aes)"); -+MODULE_ALIAS_CRYPTO("ccm(aes)"); ---- a/arch/arm64/crypto/aes-glue.c -+++ b/arch/arm64/crypto/aes-glue.c -@@ -38,10 +38,10 @@ MODULE_DESCRIPTION("AES-ECB/CBC/CTR/XTS - #define aes_xts_encrypt neon_aes_xts_encrypt - #define aes_xts_decrypt neon_aes_xts_decrypt - MODULE_DESCRIPTION("AES-ECB/CBC/CTR/XTS using ARMv8 NEON"); --MODULE_ALIAS("ecb(aes)"); --MODULE_ALIAS("cbc(aes)"); --MODULE_ALIAS("ctr(aes)"); --MODULE_ALIAS("xts(aes)"); -+MODULE_ALIAS_CRYPTO("ecb(aes)"); -+MODULE_ALIAS_CRYPTO("cbc(aes)"); -+MODULE_ALIAS_CRYPTO("ctr(aes)"); -+MODULE_ALIAS_CRYPTO("xts(aes)"); - #endif - - MODULE_AUTHOR("Ard Biesheuvel "); ---- a/arch/powerpc/crypto/sha1.c -+++ b/arch/powerpc/crypto/sha1.c -@@ -154,4 +154,4 @@ module_exit(sha1_powerpc_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); - --MODULE_ALIAS("sha1-powerpc"); -+MODULE_ALIAS_CRYPTO("sha1-powerpc"); ---- a/arch/s390/crypto/aes_s390.c -+++ b/arch/s390/crypto/aes_s390.c -@@ -979,7 +979,7 @@ static void __exit aes_s390_fini(void) - module_init(aes_s390_init); - module_exit(aes_s390_fini); - --MODULE_ALIAS("aes-all"); -+MODULE_ALIAS_CRYPTO("aes-all"); - - MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); - MODULE_LICENSE("GPL"); ---- a/arch/s390/crypto/des_s390.c -+++ b/arch/s390/crypto/des_s390.c -@@ -619,8 +619,8 @@ static void __exit des_s390_exit(void) - module_init(des_s390_init); - module_exit(des_s390_exit); - --MODULE_ALIAS("des"); --MODULE_ALIAS("des3_ede"); -+MODULE_ALIAS_CRYPTO("des"); -+MODULE_ALIAS_CRYPTO("des3_ede"); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms"); ---- a/arch/s390/crypto/ghash_s390.c -+++ b/arch/s390/crypto/ghash_s390.c -@@ -160,7 +160,7 @@ static void __exit ghash_mod_exit(void) - module_init(ghash_mod_init); - module_exit(ghash_mod_exit); - --MODULE_ALIAS("ghash"); -+MODULE_ALIAS_CRYPTO("ghash"); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("GHASH Message Digest Algorithm, s390 implementation"); ---- a/arch/s390/crypto/sha1_s390.c -+++ b/arch/s390/crypto/sha1_s390.c -@@ -103,6 +103,6 @@ static void __exit sha1_s390_fini(void) - module_init(sha1_s390_init); - module_exit(sha1_s390_fini); - --MODULE_ALIAS("sha1"); -+MODULE_ALIAS_CRYPTO("sha1"); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); ---- a/arch/s390/crypto/sha256_s390.c -+++ b/arch/s390/crypto/sha256_s390.c -@@ -143,7 +143,7 @@ static void __exit sha256_s390_fini(void - module_init(sha256_s390_init); - module_exit(sha256_s390_fini); - --MODULE_ALIAS("sha256"); --MODULE_ALIAS("sha224"); -+MODULE_ALIAS_CRYPTO("sha256"); -+MODULE_ALIAS_CRYPTO("sha224"); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA256 and SHA224 Secure Hash Algorithm"); ---- a/arch/s390/crypto/sha512_s390.c -+++ b/arch/s390/crypto/sha512_s390.c -@@ -86,7 +86,7 @@ static struct shash_alg sha512_alg = { - } - }; - --MODULE_ALIAS("sha512"); -+MODULE_ALIAS_CRYPTO("sha512"); - - static int sha384_init(struct shash_desc *desc) - { -@@ -126,7 +126,7 @@ static struct shash_alg sha384_alg = { - } - }; - --MODULE_ALIAS("sha384"); -+MODULE_ALIAS_CRYPTO("sha384"); - - static int __init init(void) - { ---- a/arch/sparc/crypto/aes_glue.c -+++ b/arch/sparc/crypto/aes_glue.c -@@ -499,6 +499,6 @@ module_exit(aes_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("AES Secure Hash Algorithm, sparc64 aes opcode accelerated"); - --MODULE_ALIAS("aes"); -+MODULE_ALIAS_CRYPTO("aes"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/camellia_glue.c -+++ b/arch/sparc/crypto/camellia_glue.c -@@ -322,6 +322,6 @@ module_exit(camellia_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated"); - --MODULE_ALIAS("aes"); -+MODULE_ALIAS_CRYPTO("aes"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/crc32c_glue.c -+++ b/arch/sparc/crypto/crc32c_glue.c -@@ -176,6 +176,6 @@ module_exit(crc32c_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated"); - --MODULE_ALIAS("crc32c"); -+MODULE_ALIAS_CRYPTO("crc32c"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/des_glue.c -+++ b/arch/sparc/crypto/des_glue.c -@@ -532,6 +532,6 @@ module_exit(des_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated"); - --MODULE_ALIAS("des"); -+MODULE_ALIAS_CRYPTO("des"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/md5_glue.c -+++ b/arch/sparc/crypto/md5_glue.c -@@ -185,6 +185,6 @@ module_exit(md5_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated"); - --MODULE_ALIAS("md5"); -+MODULE_ALIAS_CRYPTO("md5"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/sha1_glue.c -+++ b/arch/sparc/crypto/sha1_glue.c -@@ -180,6 +180,6 @@ module_exit(sha1_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated"); - --MODULE_ALIAS("sha1"); -+MODULE_ALIAS_CRYPTO("sha1"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/sha256_glue.c -+++ b/arch/sparc/crypto/sha256_glue.c -@@ -237,7 +237,7 @@ module_exit(sha256_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm, sparc64 sha256 opcode accelerated"); - --MODULE_ALIAS("sha224"); --MODULE_ALIAS("sha256"); -+MODULE_ALIAS_CRYPTO("sha224"); -+MODULE_ALIAS_CRYPTO("sha256"); - - #include "crop_devid.c" ---- a/arch/sparc/crypto/sha512_glue.c -+++ b/arch/sparc/crypto/sha512_glue.c -@@ -222,7 +222,7 @@ module_exit(sha512_sparc64_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 opcode accelerated"); - --MODULE_ALIAS("sha384"); --MODULE_ALIAS("sha512"); -+MODULE_ALIAS_CRYPTO("sha384"); -+MODULE_ALIAS_CRYPTO("sha512"); - - #include "crop_devid.c" ---- a/arch/x86/crypto/aes_glue.c -+++ b/arch/x86/crypto/aes_glue.c -@@ -66,5 +66,5 @@ module_exit(aes_fini); - - MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, asm optimized"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("aes"); --MODULE_ALIAS("aes-asm"); -+MODULE_ALIAS_CRYPTO("aes"); -+MODULE_ALIAS_CRYPTO("aes-asm"); ---- a/arch/x86/crypto/aesni-intel_glue.c -+++ b/arch/x86/crypto/aesni-intel_glue.c -@@ -1514,4 +1514,4 @@ module_exit(aesni_exit); - - MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("aes"); -+MODULE_ALIAS_CRYPTO("aes"); ---- a/arch/x86/crypto/blowfish_glue.c -+++ b/arch/x86/crypto/blowfish_glue.c -@@ -478,5 +478,5 @@ module_exit(fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Blowfish Cipher Algorithm, asm optimized"); --MODULE_ALIAS("blowfish"); --MODULE_ALIAS("blowfish-asm"); -+MODULE_ALIAS_CRYPTO("blowfish"); -+MODULE_ALIAS_CRYPTO("blowfish-asm"); ---- a/arch/x86/crypto/camellia_aesni_avx2_glue.c -+++ b/arch/x86/crypto/camellia_aesni_avx2_glue.c -@@ -582,5 +582,5 @@ module_exit(camellia_aesni_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Camellia Cipher Algorithm, AES-NI/AVX2 optimized"); --MODULE_ALIAS("camellia"); --MODULE_ALIAS("camellia-asm"); -+MODULE_ALIAS_CRYPTO("camellia"); -+MODULE_ALIAS_CRYPTO("camellia-asm"); ---- a/arch/x86/crypto/camellia_aesni_avx_glue.c -+++ b/arch/x86/crypto/camellia_aesni_avx_glue.c -@@ -574,5 +574,5 @@ module_exit(camellia_aesni_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Camellia Cipher Algorithm, AES-NI/AVX optimized"); --MODULE_ALIAS("camellia"); --MODULE_ALIAS("camellia-asm"); -+MODULE_ALIAS_CRYPTO("camellia"); -+MODULE_ALIAS_CRYPTO("camellia-asm"); ---- a/arch/x86/crypto/camellia_glue.c -+++ b/arch/x86/crypto/camellia_glue.c -@@ -1725,5 +1725,5 @@ module_exit(fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Camellia Cipher Algorithm, asm optimized"); --MODULE_ALIAS("camellia"); --MODULE_ALIAS("camellia-asm"); -+MODULE_ALIAS_CRYPTO("camellia"); -+MODULE_ALIAS_CRYPTO("camellia-asm"); ---- a/arch/x86/crypto/cast5_avx_glue.c -+++ b/arch/x86/crypto/cast5_avx_glue.c -@@ -491,4 +491,4 @@ module_exit(cast5_exit); - - MODULE_DESCRIPTION("Cast5 Cipher Algorithm, AVX optimized"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("cast5"); -+MODULE_ALIAS_CRYPTO("cast5"); ---- a/arch/x86/crypto/cast6_avx_glue.c -+++ b/arch/x86/crypto/cast6_avx_glue.c -@@ -611,4 +611,4 @@ module_exit(cast6_exit); - - MODULE_DESCRIPTION("Cast6 Cipher Algorithm, AVX optimized"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("cast6"); -+MODULE_ALIAS_CRYPTO("cast6"); ---- a/arch/x86/crypto/crc32-pclmul_glue.c -+++ b/arch/x86/crypto/crc32-pclmul_glue.c -@@ -197,5 +197,5 @@ module_exit(crc32_pclmul_mod_fini); - MODULE_AUTHOR("Alexander Boyko "); - MODULE_LICENSE("GPL"); - --MODULE_ALIAS("crc32"); --MODULE_ALIAS("crc32-pclmul"); -+MODULE_ALIAS_CRYPTO("crc32"); -+MODULE_ALIAS_CRYPTO("crc32-pclmul"); ---- a/arch/x86/crypto/crc32c-intel_glue.c -+++ b/arch/x86/crypto/crc32c-intel_glue.c -@@ -280,5 +280,5 @@ MODULE_AUTHOR("Austin Zhang "); -+MODULE_ALIAS_CRYPTO("arc4"); ---- a/crypto/blowfish_generic.c -+++ b/crypto/blowfish_generic.c -@@ -138,4 +138,4 @@ module_exit(blowfish_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Blowfish Cipher Algorithm"); --MODULE_ALIAS("blowfish"); -+MODULE_ALIAS_CRYPTO("blowfish"); ---- a/crypto/camellia_generic.c -+++ b/crypto/camellia_generic.c -@@ -1098,4 +1098,4 @@ module_exit(camellia_fini); - - MODULE_DESCRIPTION("Camellia Cipher Algorithm"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("camellia"); -+MODULE_ALIAS_CRYPTO("camellia"); ---- a/crypto/cast5_generic.c -+++ b/crypto/cast5_generic.c -@@ -549,4 +549,4 @@ module_exit(cast5_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); --MODULE_ALIAS("cast5"); -+MODULE_ALIAS_CRYPTO("cast5"); ---- a/crypto/cast6_generic.c -+++ b/crypto/cast6_generic.c -@@ -291,4 +291,4 @@ module_exit(cast6_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); --MODULE_ALIAS("cast6"); -+MODULE_ALIAS_CRYPTO("cast6"); ---- a/crypto/ccm.c -+++ b/crypto/ccm.c -@@ -879,5 +879,5 @@ module_exit(crypto_ccm_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Counter with CBC MAC"); --MODULE_ALIAS("ccm_base"); --MODULE_ALIAS("rfc4309"); -+MODULE_ALIAS_CRYPTO("ccm_base"); -+MODULE_ALIAS_CRYPTO("rfc4309"); ---- a/crypto/crc32.c -+++ b/crypto/crc32.c -@@ -156,3 +156,4 @@ module_exit(crc32_mod_fini); - MODULE_AUTHOR("Alexander Boyko "); - MODULE_DESCRIPTION("CRC32 calculations wrapper for lib/crc32"); - MODULE_LICENSE("GPL"); -+MODULE_ALIAS_CRYPTO("crc32"); ---- a/crypto/crc32c_generic.c -+++ b/crypto/crc32c_generic.c -@@ -170,5 +170,5 @@ module_exit(crc32c_mod_fini); - MODULE_AUTHOR("Clay Haapala "); - MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("crc32c"); -+MODULE_ALIAS_CRYPTO("crc32c"); - MODULE_SOFTDEP("pre: crc32c"); ---- a/crypto/crct10dif_generic.c -+++ b/crypto/crct10dif_generic.c -@@ -124,4 +124,4 @@ module_exit(crct10dif_mod_fini); - MODULE_AUTHOR("Tim Chen "); - MODULE_DESCRIPTION("T10 DIF CRC calculation."); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("crct10dif"); -+MODULE_ALIAS_CRYPTO("crct10dif"); ---- a/crypto/crypto_null.c -+++ b/crypto/crypto_null.c -@@ -145,9 +145,9 @@ static struct crypto_alg null_algs[3] = - .coa_decompress = null_compress } } - } }; - --MODULE_ALIAS("compress_null"); --MODULE_ALIAS("digest_null"); --MODULE_ALIAS("cipher_null"); -+MODULE_ALIAS_CRYPTO("compress_null"); -+MODULE_ALIAS_CRYPTO("digest_null"); -+MODULE_ALIAS_CRYPTO("cipher_null"); - - static int __init crypto_null_mod_init(void) - { ---- a/crypto/ctr.c -+++ b/crypto/ctr.c -@@ -466,4 +466,4 @@ module_exit(crypto_ctr_module_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("CTR Counter block mode"); --MODULE_ALIAS("rfc3686"); -+MODULE_ALIAS_CRYPTO("rfc3686"); ---- a/crypto/deflate.c -+++ b/crypto/deflate.c -@@ -222,4 +222,4 @@ module_exit(deflate_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Deflate Compression Algorithm for IPCOMP"); - MODULE_AUTHOR("James Morris "); -- -+MODULE_ALIAS_CRYPTO("deflate"); ---- a/crypto/des_generic.c -+++ b/crypto/des_generic.c -@@ -971,7 +971,7 @@ static struct crypto_alg des_algs[2] = { - .cia_decrypt = des3_ede_decrypt } } - } }; - --MODULE_ALIAS("des3_ede"); -+MODULE_ALIAS_CRYPTO("des3_ede"); - - static int __init des_generic_mod_init(void) - { ---- a/crypto/fcrypt.c -+++ b/crypto/fcrypt.c -@@ -420,3 +420,4 @@ module_exit(fcrypt_mod_fini); - MODULE_LICENSE("Dual BSD/GPL"); - MODULE_DESCRIPTION("FCrypt Cipher Algorithm"); - MODULE_AUTHOR("David Howells "); -+MODULE_ALIAS_CRYPTO("fcrypt"); ---- a/crypto/gcm.c -+++ b/crypto/gcm.c -@@ -1441,6 +1441,6 @@ module_exit(crypto_gcm_module_exit); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Galois/Counter Mode"); - MODULE_AUTHOR("Mikko Herranen "); --MODULE_ALIAS("gcm_base"); --MODULE_ALIAS("rfc4106"); --MODULE_ALIAS("rfc4543"); -+MODULE_ALIAS_CRYPTO("gcm_base"); -+MODULE_ALIAS_CRYPTO("rfc4106"); -+MODULE_ALIAS_CRYPTO("rfc4543"); ---- a/crypto/ghash-generic.c -+++ b/crypto/ghash-generic.c -@@ -172,4 +172,4 @@ module_exit(ghash_mod_exit); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("GHASH Message Digest Algorithm"); --MODULE_ALIAS("ghash"); -+MODULE_ALIAS_CRYPTO("ghash"); ---- a/crypto/khazad.c -+++ b/crypto/khazad.c -@@ -880,3 +880,4 @@ module_exit(khazad_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Khazad Cryptographic Algorithm"); -+MODULE_ALIAS_CRYPTO("khazad"); ---- a/crypto/krng.c -+++ b/crypto/krng.c -@@ -62,4 +62,4 @@ module_exit(krng_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Kernel Random Number Generator"); --MODULE_ALIAS("stdrng"); -+MODULE_ALIAS_CRYPTO("stdrng"); ---- a/crypto/lz4.c -+++ b/crypto/lz4.c -@@ -104,3 +104,4 @@ module_exit(lz4_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("LZ4 Compression Algorithm"); -+MODULE_ALIAS_CRYPTO("lz4"); ---- a/crypto/lz4hc.c -+++ b/crypto/lz4hc.c -@@ -104,3 +104,4 @@ module_exit(lz4hc_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("LZ4HC Compression Algorithm"); -+MODULE_ALIAS_CRYPTO("lz4hc"); ---- a/crypto/lzo.c -+++ b/crypto/lzo.c -@@ -103,3 +103,4 @@ module_exit(lzo_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("LZO Compression Algorithm"); -+MODULE_ALIAS_CRYPTO("lzo"); ---- a/crypto/md4.c -+++ b/crypto/md4.c -@@ -255,4 +255,4 @@ module_exit(md4_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("MD4 Message Digest Algorithm"); -- -+MODULE_ALIAS_CRYPTO("md4"); ---- a/crypto/md5.c -+++ b/crypto/md5.c -@@ -168,3 +168,4 @@ module_exit(md5_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("MD5 Message Digest Algorithm"); -+MODULE_ALIAS_CRYPTO("md5"); ---- a/crypto/michael_mic.c -+++ b/crypto/michael_mic.c -@@ -184,3 +184,4 @@ module_exit(michael_mic_exit); - MODULE_LICENSE("GPL v2"); - MODULE_DESCRIPTION("Michael MIC"); - MODULE_AUTHOR("Jouni Malinen "); -+MODULE_ALIAS_CRYPTO("michael_mic"); ---- a/crypto/rmd128.c -+++ b/crypto/rmd128.c -@@ -327,3 +327,4 @@ module_exit(rmd128_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Adrian-Ken Rueegsegger "); - MODULE_DESCRIPTION("RIPEMD-128 Message Digest"); -+MODULE_ALIAS_CRYPTO("rmd128"); ---- a/crypto/rmd160.c -+++ b/crypto/rmd160.c -@@ -371,3 +371,4 @@ module_exit(rmd160_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Adrian-Ken Rueegsegger "); - MODULE_DESCRIPTION("RIPEMD-160 Message Digest"); -+MODULE_ALIAS_CRYPTO("rmd160"); ---- a/crypto/rmd256.c -+++ b/crypto/rmd256.c -@@ -346,3 +346,4 @@ module_exit(rmd256_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Adrian-Ken Rueegsegger "); - MODULE_DESCRIPTION("RIPEMD-256 Message Digest"); -+MODULE_ALIAS_CRYPTO("rmd256"); ---- a/crypto/rmd320.c -+++ b/crypto/rmd320.c -@@ -395,3 +395,4 @@ module_exit(rmd320_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Adrian-Ken Rueegsegger "); - MODULE_DESCRIPTION("RIPEMD-320 Message Digest"); -+MODULE_ALIAS_CRYPTO("rmd320"); ---- a/crypto/salsa20_generic.c -+++ b/crypto/salsa20_generic.c -@@ -248,4 +248,4 @@ module_exit(salsa20_generic_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm"); --MODULE_ALIAS("salsa20"); -+MODULE_ALIAS_CRYPTO("salsa20"); ---- a/crypto/seed.c -+++ b/crypto/seed.c -@@ -476,3 +476,4 @@ module_exit(seed_fini); - MODULE_DESCRIPTION("SEED Cipher Algorithm"); - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Hye-Shik Chang , Kim Hyun "); -+MODULE_ALIAS_CRYPTO("seed"); ---- a/crypto/serpent_generic.c -+++ b/crypto/serpent_generic.c -@@ -665,5 +665,5 @@ module_exit(serpent_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Cipher Algorithm"); - MODULE_AUTHOR("Dag Arne Osvik "); --MODULE_ALIAS("tnepres"); --MODULE_ALIAS("serpent"); -+MODULE_ALIAS_CRYPTO("tnepres"); -+MODULE_ALIAS_CRYPTO("serpent"); ---- a/crypto/sha1_generic.c -+++ b/crypto/sha1_generic.c -@@ -153,4 +153,4 @@ module_exit(sha1_generic_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); - --MODULE_ALIAS("sha1"); -+MODULE_ALIAS_CRYPTO("sha1"); ---- a/crypto/sha256_generic.c -+++ b/crypto/sha256_generic.c -@@ -384,5 +384,5 @@ module_exit(sha256_generic_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); - --MODULE_ALIAS("sha224"); --MODULE_ALIAS("sha256"); -+MODULE_ALIAS_CRYPTO("sha224"); -+MODULE_ALIAS_CRYPTO("sha256"); ---- a/crypto/sha512_generic.c -+++ b/crypto/sha512_generic.c -@@ -287,5 +287,5 @@ module_exit(sha512_generic_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); - --MODULE_ALIAS("sha384"); --MODULE_ALIAS("sha512"); -+MODULE_ALIAS_CRYPTO("sha384"); -+MODULE_ALIAS_CRYPTO("sha512"); ---- a/crypto/tea.c -+++ b/crypto/tea.c -@@ -270,8 +270,8 @@ static void __exit tea_mod_fini(void) - crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs)); - } - --MODULE_ALIAS("xtea"); --MODULE_ALIAS("xeta"); -+MODULE_ALIAS_CRYPTO("xtea"); -+MODULE_ALIAS_CRYPTO("xeta"); - - module_init(tea_mod_init); - module_exit(tea_mod_fini); ---- a/crypto/tgr192.c -+++ b/crypto/tgr192.c -@@ -676,8 +676,8 @@ static void __exit tgr192_mod_fini(void) - crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); - } - --MODULE_ALIAS("tgr160"); --MODULE_ALIAS("tgr128"); -+MODULE_ALIAS_CRYPTO("tgr160"); -+MODULE_ALIAS_CRYPTO("tgr128"); - - module_init(tgr192_mod_init); - module_exit(tgr192_mod_fini); ---- a/crypto/twofish_generic.c -+++ b/crypto/twofish_generic.c -@@ -211,4 +211,4 @@ module_exit(twofish_mod_fini); - - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION ("Twofish Cipher Algorithm"); --MODULE_ALIAS("twofish"); -+MODULE_ALIAS_CRYPTO("twofish"); ---- a/crypto/wp512.c -+++ b/crypto/wp512.c -@@ -1167,8 +1167,8 @@ static void __exit wp512_mod_fini(void) - crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs)); - } - --MODULE_ALIAS("wp384"); --MODULE_ALIAS("wp256"); -+MODULE_ALIAS_CRYPTO("wp384"); -+MODULE_ALIAS_CRYPTO("wp256"); - - module_init(wp512_mod_init); - module_exit(wp512_mod_fini); ---- a/crypto/zlib.c -+++ b/crypto/zlib.c -@@ -378,3 +378,4 @@ module_exit(zlib_mod_fini); - MODULE_LICENSE("GPL"); - MODULE_DESCRIPTION("Zlib Compression Algorithm"); - MODULE_AUTHOR("Sony Corporation"); -+MODULE_ALIAS_CRYPTO("zlib"); ---- a/drivers/crypto/padlock-aes.c -+++ b/drivers/crypto/padlock-aes.c -@@ -563,4 +563,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algo - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Michal Ludvig"); - --MODULE_ALIAS("aes"); -+MODULE_ALIAS_CRYPTO("aes"); ---- a/drivers/crypto/padlock-sha.c -+++ b/drivers/crypto/padlock-sha.c -@@ -593,7 +593,7 @@ MODULE_DESCRIPTION("VIA PadLock SHA1/SHA - MODULE_LICENSE("GPL"); - MODULE_AUTHOR("Michal Ludvig"); - --MODULE_ALIAS("sha1-all"); --MODULE_ALIAS("sha256-all"); --MODULE_ALIAS("sha1-padlock"); --MODULE_ALIAS("sha256-padlock"); -+MODULE_ALIAS_CRYPTO("sha1-all"); -+MODULE_ALIAS_CRYPTO("sha256-all"); -+MODULE_ALIAS_CRYPTO("sha1-padlock"); -+MODULE_ALIAS_CRYPTO("sha256-padlock"); ---- a/drivers/crypto/ux500/cryp/cryp_core.c -+++ b/drivers/crypto/ux500/cryp/cryp_core.c -@@ -1810,7 +1810,7 @@ module_exit(ux500_cryp_mod_fini); - module_param(cryp_mode, int, 0); - - MODULE_DESCRIPTION("Driver for ST-Ericsson UX500 CRYP crypto engine."); --MODULE_ALIAS("aes-all"); --MODULE_ALIAS("des-all"); -+MODULE_ALIAS_CRYPTO("aes-all"); -+MODULE_ALIAS_CRYPTO("des-all"); - - MODULE_LICENSE("GPL"); ---- a/drivers/crypto/ux500/hash/hash_core.c -+++ b/drivers/crypto/ux500/hash/hash_core.c -@@ -1995,7 +1995,7 @@ module_exit(ux500_hash_mod_fini); - MODULE_DESCRIPTION("Driver for ST-Ericsson UX500 HASH engine."); - MODULE_LICENSE("GPL"); - --MODULE_ALIAS("sha1-all"); --MODULE_ALIAS("sha256-all"); --MODULE_ALIAS("hmac-sha1-all"); --MODULE_ALIAS("hmac-sha256-all"); -+MODULE_ALIAS_CRYPTO("sha1-all"); -+MODULE_ALIAS_CRYPTO("sha256-all"); -+MODULE_ALIAS_CRYPTO("hmac-sha1-all"); -+MODULE_ALIAS_CRYPTO("hmac-sha256-all"); ---- a/drivers/s390/crypto/ap_bus.c -+++ b/drivers/s390/crypto/ap_bus.c -@@ -44,6 +44,7 @@ - #include - #include - #include -+#include - - #include "ap_bus.h" - -@@ -71,7 +72,7 @@ MODULE_AUTHOR("IBM Corporation"); - MODULE_DESCRIPTION("Adjunct Processor Bus driver, " \ - "Copyright IBM Corp. 2006, 2012"); - MODULE_LICENSE("GPL"); --MODULE_ALIAS("z90crypt"); -+MODULE_ALIAS_CRYPTO("z90crypt"); - - /* - * Module parameter ---- a/include/linux/crypto.h -+++ b/include/linux/crypto.h -@@ -26,6 +26,19 @@ - #include - - /* -+ * Autoloaded crypto modules should only use a prefixed name to avoid allowing -+ * arbitrary modules to be loaded. Loading from userspace may still need the -+ * unprefixed names, so retains those aliases as well. -+ * This uses __MODULE_INFO directly instead of MODULE_ALIAS because pre-4.3 -+ * gcc (e.g. avr32 toolchain) uses __LINE__ for uniqueness, and this macro -+ * expands twice on the same line. Instead, use a separate base name for the -+ * alias. -+ */ -+#define MODULE_ALIAS_CRYPTO(name) \ -+ __MODULE_INFO(alias, alias_userspace, name); \ -+ __MODULE_INFO(alias, alias_crypto, "crypto-" name) -+ -+/* - * Algorithm masks and types. - */ - #define CRYPTO_ALG_TYPE_MASK 0x0000000f diff --git a/debian/patches/bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch b/debian/patches/bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch deleted file mode 100644 index c48658eda..000000000 --- a/debian/patches/bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch +++ /dev/null @@ -1,126 +0,0 @@ -From: Daniel Borkmann -Date: Thu, 22 Jan 2015 18:26:54 +0100 -Subject: net: sctp: fix slab corruption from use after free on INIT collisions -Origin: https://git.kernel.org/linus/600ddd6825543962fb807884169e57b580dba208 - -When hitting an INIT collision case during the 4WHS with AUTH enabled, as -already described in detail in commit 1be9a950c646 ("net: sctp: inherit -auth_capable on INIT collisions"), it can happen that we occasionally -still remotely trigger the following panic on server side which seems to -have been uncovered after the fix from commit 1be9a950c646 ... - -[ 533.876389] BUG: unable to handle kernel paging request at 00000000ffffffff -[ 533.913657] IP: [] __kmalloc+0x95/0x230 -[ 533.940559] PGD 5030f2067 PUD 0 -[ 533.957104] Oops: 0000 [#1] SMP -[ 533.974283] Modules linked in: sctp mlx4_en [...] -[ 534.939704] Call Trace: -[ 534.951833] [] ? crypto_init_shash_ops+0x60/0xf0 -[ 534.984213] [] crypto_init_shash_ops+0x60/0xf0 -[ 535.015025] [] __crypto_alloc_tfm+0x6d/0x170 -[ 535.045661] [] crypto_alloc_base+0x4c/0xb0 -[ 535.074593] [] ? _raw_spin_lock_bh+0x12/0x50 -[ 535.105239] [] sctp_inet_listen+0x161/0x1e0 [sctp] -[ 535.138606] [] SyS_listen+0x9d/0xb0 -[ 535.166848] [] system_call_fastpath+0x16/0x1b - -... or depending on the the application, for example this one: - -[ 1370.026490] BUG: unable to handle kernel paging request at 00000000ffffffff -[ 1370.026506] IP: [] kmem_cache_alloc+0x75/0x1d0 -[ 1370.054568] PGD 633c94067 PUD 0 -[ 1370.070446] Oops: 0000 [#1] SMP -[ 1370.085010] Modules linked in: sctp kvm_amd kvm [...] -[ 1370.963431] Call Trace: -[ 1370.974632] [] ? SyS_epoll_ctl+0x53f/0x960 -[ 1371.000863] [] SyS_epoll_ctl+0x53f/0x960 -[ 1371.027154] [] ? anon_inode_getfile+0xd3/0x170 -[ 1371.054679] [] ? __alloc_fd+0xa7/0x130 -[ 1371.080183] [] system_call_fastpath+0x16/0x1b - -With slab debugging enabled, we can see that the poison has been overwritten: - -[ 669.826368] BUG kmalloc-128 (Tainted: G W ): Poison overwritten -[ 669.826385] INFO: 0xffff880228b32e50-0xffff880228b32e50. First byte 0x6a instead of 0x6b -[ 669.826414] INFO: Allocated in sctp_auth_create_key+0x23/0x50 [sctp] age=3 cpu=0 pid=18494 -[ 669.826424] __slab_alloc+0x4bf/0x566 -[ 669.826433] __kmalloc+0x280/0x310 -[ 669.826453] sctp_auth_create_key+0x23/0x50 [sctp] -[ 669.826471] sctp_auth_asoc_create_secret+0xcb/0x1e0 [sctp] -[ 669.826488] sctp_auth_asoc_init_active_key+0x68/0xa0 [sctp] -[ 669.826505] sctp_do_sm+0x29d/0x17c0 [sctp] [...] -[ 669.826629] INFO: Freed in kzfree+0x31/0x40 age=1 cpu=0 pid=18494 -[ 669.826635] __slab_free+0x39/0x2a8 -[ 669.826643] kfree+0x1d6/0x230 -[ 669.826650] kzfree+0x31/0x40 -[ 669.826666] sctp_auth_key_put+0x19/0x20 [sctp] -[ 669.826681] sctp_assoc_update+0x1ee/0x2d0 [sctp] -[ 669.826695] sctp_do_sm+0x674/0x17c0 [sctp] - -Since this only triggers in some collision-cases with AUTH, the problem at -heart is that sctp_auth_key_put() on asoc->asoc_shared_key is called twice -when having refcnt 1, once directly in sctp_assoc_update() and yet again -from within sctp_auth_asoc_init_active_key() via sctp_assoc_update() on -the already kzfree'd memory, which is also consistent with the observation -of the poison decrease from 0x6b to 0x6a (note: the overwrite is detected -at a later point in time when poison is checked on new allocation). - -Reference counting of auth keys revisited: - -Shared keys for AUTH chunks are being stored in endpoints and associations -in endpoint_shared_keys list. On endpoint creation, a null key is being -added; on association creation, all endpoint shared keys are being cached -and thus cloned over to the association. struct sctp_shared_key only holds -a pointer to the actual key bytes, that is, struct sctp_auth_bytes which -keeps track of users internally through refcounting. Naturally, on assoc -or enpoint destruction, sctp_shared_key are being destroyed directly and -the reference on sctp_auth_bytes dropped. - -User space can add keys to either list via setsockopt(2) through struct -sctp_authkey and by passing that to sctp_auth_set_key() which replaces or -adds a new auth key. There, sctp_auth_create_key() creates a new sctp_auth_bytes -with refcount 1 and in case of replacement drops the reference on the old -sctp_auth_bytes. A key can be set active from user space through setsockopt() -on the id via sctp_auth_set_active_key(), which iterates through either -endpoint_shared_keys and in case of an assoc, invokes (one of various places) -sctp_auth_asoc_init_active_key(). - -sctp_auth_asoc_init_active_key() computes the actual secret from local's -and peer's random, hmac and shared key parameters and returns a new key -directly as sctp_auth_bytes, that is asoc->asoc_shared_key, plus drops -the reference if there was a previous one. The secret, which where we -eventually double drop the ref comes from sctp_auth_asoc_set_secret() with -intitial refcount of 1, which also stays unchanged eventually in -sctp_assoc_update(). This key is later being used for crypto layer to -set the key for the hash in crypto_hash_setkey() from sctp_auth_calculate_hmac(). - -To close the loop: asoc->asoc_shared_key is freshly allocated secret -material and independant of the sctp_shared_key management keeping track -of only shared keys in endpoints and assocs. Hence, also commit 4184b2a79a76 -("net: sctp: fix memory leak in auth key management") is independant of -this bug here since it concerns a different layer (though same structures -being used eventually). asoc->asoc_shared_key is reference dropped correctly -on assoc destruction in sctp_association_free() and when active keys are -being replaced in sctp_auth_asoc_init_active_key(), it always has a refcount -of 1. Hence, it's freed prematurely in sctp_assoc_update(). Simple fix is -to remove that sctp_auth_key_put() from there which fixes these panics. - -Fixes: 730fc3d05cd4 ("[SCTP]: Implete SCTP-AUTH parameter processing") -Signed-off-by: Daniel Borkmann -Acked-by: Vlad Yasevich -Acked-by: Neil Horman -Signed-off-by: David S. Miller ---- - net/sctp/associola.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/net/sctp/associola.c -+++ b/net/sctp/associola.c -@@ -1181,7 +1181,6 @@ void sctp_assoc_update(struct sctp_assoc - asoc->peer.peer_hmacs = new->peer.peer_hmacs; - new->peer.peer_hmacs = NULL; - -- sctp_auth_key_put(asoc->asoc_shared_key); - sctp_auth_asoc_init_active_key(asoc, GFP_ATOMIC); - } - diff --git a/debian/patches/bugfix/all/netfilter-conntrack-disable-generic-tracking-for-kno.patch b/debian/patches/bugfix/all/netfilter-conntrack-disable-generic-tracking-for-kno.patch deleted file mode 100644 index ede639194..000000000 --- a/debian/patches/bugfix/all/netfilter-conntrack-disable-generic-tracking-for-kno.patch +++ /dev/null @@ -1,87 +0,0 @@ -From: Florian Westphal -Date: Fri, 26 Sep 2014 11:35:42 +0200 -Subject: netfilter: conntrack: disable generic tracking for known protocols -Origin: https://git.kernel.org/linus/db29a9508a9246e77087c5531e45b2c88ec6988b - -Given following iptables ruleset: - --P FORWARD DROP --A FORWARD -m sctp --dport 9 -j ACCEPT --A FORWARD -p tcp --dport 80 -j ACCEPT --A FORWARD -p tcp -m conntrack -m state ESTABLISHED,RELATED -j ACCEPT - -One would assume that this allows SCTP on port 9 and TCP on port 80. -Unfortunately, if the SCTP conntrack module is not loaded, this allows -*all* SCTP communication, to pass though, i.e. -p sctp -j ACCEPT, -which we think is a security issue. - -This is because on the first SCTP packet on port 9, we create a dummy -"generic l4" conntrack entry without any port information (since -conntrack doesn't know how to extract this information). - -All subsequent packets that are unknown will then be in established -state since they will fallback to proto_generic and will match the -'generic' entry. - -Our originally proposed version [1] completely disabled generic protocol -tracking, but Jozsef suggests to not track protocols for which a more -suitable helper is available, hence we now mitigate the issue for in -tree known ct protocol helpers only, so that at least NAT and direction -information will still be preserved for others. - - [1] http://www.spinics.net/lists/netfilter-devel/msg33430.html - -Joint work with Daniel Borkmann. - -Signed-off-by: Florian Westphal -Signed-off-by: Daniel Borkmann -Acked-by: Jozsef Kadlecsik -Signed-off-by: Pablo Neira Ayuso ---- - net/netfilter/nf_conntrack_proto_generic.c | 26 +++++++++++++++++++++++++- - 1 file changed, 25 insertions(+), 1 deletion(-) - -diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c -index d25f293..957c1db 100644 ---- a/net/netfilter/nf_conntrack_proto_generic.c -+++ b/net/netfilter/nf_conntrack_proto_generic.c -@@ -14,6 +14,30 @@ - - static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ; - -+static bool nf_generic_should_process(u8 proto) -+{ -+ switch (proto) { -+#ifdef CONFIG_NF_CT_PROTO_SCTP_MODULE -+ case IPPROTO_SCTP: -+ return false; -+#endif -+#ifdef CONFIG_NF_CT_PROTO_DCCP_MODULE -+ case IPPROTO_DCCP: -+ return false; -+#endif -+#ifdef CONFIG_NF_CT_PROTO_GRE_MODULE -+ case IPPROTO_GRE: -+ return false; -+#endif -+#ifdef CONFIG_NF_CT_PROTO_UDPLITE_MODULE -+ case IPPROTO_UDPLITE: -+ return false; -+#endif -+ default: -+ return true; -+ } -+} -+ - static inline struct nf_generic_net *generic_pernet(struct net *net) - { - return &net->ct.nf_ct_proto.generic; -@@ -67,7 +91,7 @@ static int generic_packet(struct nf_conn *ct, - static bool generic_new(struct nf_conn *ct, const struct sk_buff *skb, - unsigned int dataoff, unsigned int *timeouts) - { -- return true; -+ return nf_generic_should_process(nf_ct_protonum(ct)); - } - - #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) diff --git a/debian/patches/bugfix/arm64/clocksource-arch_timer-Only-use-the-virtual-counter-.patch b/debian/patches/bugfix/arm64/clocksource-arch_timer-Only-use-the-virtual-counter-.patch deleted file mode 100644 index 95c77de92..000000000 --- a/debian/patches/bugfix/arm64/clocksource-arch_timer-Only-use-the-virtual-counter-.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 53a2dd7f567cebda868b0765e2659f7930ba958f Mon Sep 17 00:00:00 2001 -From: Catalin Marinas -Date: Wed, 10 Dec 2014 11:02:09 +0000 -Subject: [PATCH] clocksource: arch_timer: Only use the virtual counter - (CNTVCT) on arm64 -Origin: https://git.kernel.org/linus/d6ad36913083d683aad4e02e53580c995f1a6ede - -Commit 0b46b8a718c6 (clocksource: arch_timer: Fix code to use physical -timers when requested) introduces the use of physical counters in the -ARM architected timer driver. However, he arm64 kernel uses CNTVCT in -VDSO. When booting in EL2, the kernel switches to the physical timers to -make things easier for KVM but it continues to use the virtual counter -both in user and kernel. While in such scenario CNTVCT == CNTPCT (since -CNTVOFF is initialised by the kernel to 0), we want to spot firmware -bugs corrupting CNTVOFF early (which would affect CNTVCT). - -Signed-off-by: Catalin Marinas -Tested-by: Yingjoe Chen -Cc: Daniel Lezcano -Signed-off-by: Arnd Bergmann ---- - drivers/clocksource/arm_arch_timer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c -index 506949d..499cb1d 100644 ---- a/drivers/clocksource/arm_arch_timer.c -+++ b/drivers/clocksource/arm_arch_timer.c -@@ -430,7 +430,7 @@ static void __init arch_counter_register(unsigned type) - - /* Register the CP15 based counter if we have one */ - if (type & ARCH_CP15_TIMER) { -- if (arch_timer_use_virtual) -+ if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual) - arch_timer_read_counter = arch_counter_get_cntvct; - else - arch_timer_read_counter = arch_counter_get_cntpct; --- -1.7.10.4 - diff --git a/debian/patches/bugfix/sh4/scripts-recordmcount.pl-there-is-no-m32-option-on-super-h.patch b/debian/patches/bugfix/sh4/scripts-recordmcount.pl-there-is-no-m32-option-on-super-h.patch deleted file mode 100644 index 1a74ca0bd..000000000 --- a/debian/patches/bugfix/sh4/scripts-recordmcount.pl-there-is-no-m32-option-on-super-h.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Michael Karcher -Date: Sun, 18 Jan 2015 00:36:15 +0100 -Subject: scripts/recordmcount.pl: There is no -m32 gcc option on Super-H - anymore -Origin: https://git.kernel.org/linus/1caf6aaaa47471831d77c75f094d4e00ad1ec808 - -Compiling SH with gcc-4.8 fails due to the -m32 option not being -supported. - -From http://buildd.debian-ports.org/status/fetch.php?pkg=linux&arch=sh4&ver=3.16.7-ckt4-1&stamp=1421425783 - - CC init/main.o - gcc-4.8: error: unrecognized command line option '-m32' - ld: cannot find init/.tmp_mc_main.o: No such file or directory - objcopy: 'init/.tmp_mx_main.o': No such file - rm: cannot remove 'init/.tmp_mx_main.o': No such file or directory - rm: cannot remove 'init/.tmp_mc_main.o': No such file or directory - -Link: http://lkml.kernel.org/r/1421537778-29001-1-git-send-email-kernel@mkarcher.dialup.fu-berlin.de -Link: http://lkml.kernel.org/r/54BCBDD4.10102@physik.fu-berlin.de - -Cc: stable@vger.kernel.org -Cc: Matt Fleming -Reported-by: John Paul Adrian Glaubitz -Signed-off-by: Michael Karcher -Signed-off-by: Steven Rostedt ---- - scripts/recordmcount.pl | 1 - - 1 file changed, 1 deletion(-) - ---- a/scripts/recordmcount.pl -+++ b/scripts/recordmcount.pl -@@ -262,7 +262,6 @@ if ($arch eq "x86_64") { - # force flags for this arch - $ld .= " -m shlelf_linux"; - $objcopy .= " -O elf32-sh-linux"; -- $cc .= " -m32"; - - } elsif ($arch eq "powerpc") { - $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; diff --git a/debian/patches/bugfix/x86/kvm-x86-sysenter-emulation-is-broken.patch b/debian/patches/bugfix/x86/kvm-x86-sysenter-emulation-is-broken.patch deleted file mode 100644 index 3d7d7dd89..000000000 --- a/debian/patches/bugfix/x86/kvm-x86-sysenter-emulation-is-broken.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: Nadav Amit -Date: Thu, 1 Jan 2015 23:11:11 +0200 -Subject: KVM: x86: SYSENTER emulation is broken -Origin: https://git.kernel.org/linus/f3747379accba8e95d70cec0eae0582c8c182050 - -SYSENTER emulation is broken in several ways: -1. It misses the case of 16-bit code segments completely (CVE-2015-0239). -2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can - still be set without causing #GP). -3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSENTER_ESP are not masked in - legacy-mode. -4. There is some unneeded code. - -Fix it. - -Cc: stable@vger.linux.org -Signed-off-by: Nadav Amit -Signed-off-by: Paolo Bonzini -[bwh: Backported to 3.16: adjust context] ---- - arch/x86/kvm/emulate.c | 27 ++++++++------------------- - 1 file changed, 8 insertions(+), 19 deletions(-) - ---- a/arch/x86/kvm/emulate.c -+++ b/arch/x86/kvm/emulate.c -@@ -2302,7 +2302,7 @@ static int em_sysenter(struct x86_emulat - * Not recognized on AMD in compat mode (but is recognized in legacy - * mode). - */ -- if ((ctxt->mode == X86EMUL_MODE_PROT32) && (efer & EFER_LMA) -+ if ((ctxt->mode != X86EMUL_MODE_PROT64) && (efer & EFER_LMA) - && !vendor_intel(ctxt)) - return emulate_ud(ctxt); - -@@ -2315,25 +2315,13 @@ static int em_sysenter(struct x86_emulat - setup_syscalls_segments(ctxt, &cs, &ss); - - ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data); -- switch (ctxt->mode) { -- case X86EMUL_MODE_PROT32: -- if ((msr_data & 0xfffc) == 0x0) -- return emulate_gp(ctxt, 0); -- break; -- case X86EMUL_MODE_PROT64: -- if (msr_data == 0x0) -- return emulate_gp(ctxt, 0); -- break; -- default: -- break; -- } -+ if ((msr_data & 0xfffc) == 0x0) -+ return emulate_gp(ctxt, 0); - - ctxt->eflags &= ~(EFLG_VM | EFLG_IF | EFLG_RF); -- cs_sel = (u16)msr_data; -- cs_sel &= ~SELECTOR_RPL_MASK; -+ cs_sel = (u16)msr_data & ~SELECTOR_RPL_MASK; - ss_sel = cs_sel + 8; -- ss_sel &= ~SELECTOR_RPL_MASK; -- if (ctxt->mode == X86EMUL_MODE_PROT64 || (efer & EFER_LMA)) { -+ if (efer & EFER_LMA) { - cs.d = 0; - cs.l = 1; - } -@@ -2342,10 +2330,11 @@ static int em_sysenter(struct x86_emulat - ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS); - - ops->get_msr(ctxt, MSR_IA32_SYSENTER_EIP, &msr_data); -- ctxt->_eip = msr_data; -+ ctxt->_eip = (efer & EFER_LMA) ? msr_data : (u32)msr_data; - - ops->get_msr(ctxt, MSR_IA32_SYSENTER_ESP, &msr_data); -- *reg_write(ctxt, VCPU_REGS_RSP) = msr_data; -+ *reg_write(ctxt, VCPU_REGS_RSP) = (efer & EFER_LMA) ? msr_data : -+ (u32)msr_data; - - return X86EMUL_CONTINUE; - } diff --git a/debian/patches/bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch b/debian/patches/bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch deleted file mode 100644 index dfb9b68e6..000000000 --- a/debian/patches/bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch +++ /dev/null @@ -1,112 +0,0 @@ -From: Andy Lutomirski -Date: Thu, 22 Jan 2015 11:27:59 -0800 -Subject: x86, tls: Interpret an all-zero struct user_desc as "no segment" -Origin: https://git.kernel.org/linus/3669ef9fa7d35f573ec9c0e0341b29251c2734a7 - -The Witcher 2 did something like this to allocate a TLS segment index: - - struct user_desc u_info; - bzero(&u_info, sizeof(u_info)); - u_info.entry_number = (uint32_t)-1; - - syscall(SYS_set_thread_area, &u_info); - -Strictly speaking, this code was never correct. It should have set -read_exec_only and seg_not_present to 1 to indicate that it wanted -to find a free slot without putting anything there, or it should -have put something sensible in the TLS slot if it wanted to allocate -a TLS entry for real. The actual effect of this code was to -allocate a bogus segment that could be used to exploit espfix. - -The set_thread_area hardening patches changed the behavior, causing -set_thread_area to return -EINVAL and crashing the game. - -This changes set_thread_area to interpret this as a request to find -a free slot and to leave it empty, which isn't *quite* what the game -expects but should be close enough to keep it working. In -particular, using the code above to allocate two segments will -allocate the same segment both times. - -According to FrostbittenKing on Github, this fixes The Witcher 2. - -If this somehow still causes problems, we could instead allocate -a limit==0 32-bit data segment, but that seems rather ugly to me. - -Fixes: 41bdc78544b8 x86/tls: Validate TLS entries to protect espfix -Signed-off-by: Andy Lutomirski -Cc: stable@vger.kernel.org -Cc: torvalds@linux-foundation.org -Link: http://lkml.kernel.org/r/0cb251abe1ff0958b8e468a9a9a905b80ae3a746.1421954363.git.luto@amacapital.net -Signed-off-by: Thomas Gleixner ---- - arch/x86/include/asm/desc.h | 13 +++++++++++++ - arch/x86/kernel/tls.c | 25 +++++++++++++++++++++++-- - 2 files changed, 36 insertions(+), 2 deletions(-) - -diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h -index fc237fd..a94b82e 100644 ---- a/arch/x86/include/asm/desc.h -+++ b/arch/x86/include/asm/desc.h -@@ -262,6 +262,19 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) - (info)->seg_not_present == 1 && \ - (info)->useable == 0) - -+/* Lots of programs expect an all-zero user_desc to mean "no segment at all". */ -+static inline bool LDT_zero(const struct user_desc *info) -+{ -+ return (info->base_addr == 0 && -+ info->limit == 0 && -+ info->contents == 0 && -+ info->read_exec_only == 0 && -+ info->seg_32bit == 0 && -+ info->limit_in_pages == 0 && -+ info->seg_not_present == 0 && -+ info->useable == 0); -+} -+ - static inline void clear_LDT(void) - { - set_ldt(NULL, 0); -diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c -index 4e942f3..7fc5e84 100644 ---- a/arch/x86/kernel/tls.c -+++ b/arch/x86/kernel/tls.c -@@ -29,7 +29,28 @@ static int get_free_idx(void) - - static bool tls_desc_okay(const struct user_desc *info) - { -- if (LDT_empty(info)) -+ /* -+ * For historical reasons (i.e. no one ever documented how any -+ * of the segmentation APIs work), user programs can and do -+ * assume that a struct user_desc that's all zeros except for -+ * entry_number means "no segment at all". This never actually -+ * worked. In fact, up to Linux 3.19, a struct user_desc like -+ * this would create a 16-bit read-write segment with base and -+ * limit both equal to zero. -+ * -+ * That was close enough to "no segment at all" until we -+ * hardened this function to disallow 16-bit TLS segments. Fix -+ * it up by interpreting these zeroed segments the way that they -+ * were almost certainly intended to be interpreted. -+ * -+ * The correct way to ask for "no segment at all" is to specify -+ * a user_desc that satisfies LDT_empty. To keep everything -+ * working, we accept both. -+ * -+ * Note that there's a similar kludge in modify_ldt -- look at -+ * the distinction between modes 1 and 0x11. -+ */ -+ if (LDT_empty(info) || LDT_zero(info)) - return true; - - /* -@@ -71,7 +92,7 @@ static void set_tls_desc(struct task_struct *p, int idx, - cpu = get_cpu(); - - while (n-- > 0) { -- if (LDT_empty(info)) -+ if (LDT_empty(info) || LDT_zero(info)) - desc->a = desc->b = 0; - else - fill_ldt(desc, info); diff --git a/debian/patches/bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch b/debian/patches/bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch deleted file mode 100644 index c543a87fc..000000000 --- a/debian/patches/bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Andy Lutomirski -Date: Thu, 22 Jan 2015 11:27:58 -0800 -Subject: x86, tls, ldt: Stop checking lm in LDT_empty -Origin: https://git.kernel.org/linus/e30ab185c490e9a9381385529e0fd32f0a399495 - -32-bit programs don't have an lm bit in their ABI, so they can't -reliably cause LDT_empty to return true without resorting to memset. -They shouldn't need to do this. - -This should fix a longstanding, if minor, issue in all 64-bit kernels -as well as a potential regression in the TLS hardening code. - -Fixes: 41bdc78544b8 x86/tls: Validate TLS entries to protect espfix -Cc: stable@vger.kernel.org -Signed-off-by: Andy Lutomirski -Cc: torvalds@linux-foundation.org -Link: http://lkml.kernel.org/r/72a059de55e86ad5e2935c80aa91880ddf19d07c.1421954363.git.luto@amacapital.net -Signed-off-by: Thomas Gleixner ---- - arch/x86/include/asm/desc.h | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - -diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h -index 50d033a..fc237fd 100644 ---- a/arch/x86/include/asm/desc.h -+++ b/arch/x86/include/asm/desc.h -@@ -251,7 +251,8 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) - gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]; - } - --#define _LDT_empty(info) \ -+/* This intentionally ignores lm, since 32-bit apps don't have that field. */ -+#define LDT_empty(info) \ - ((info)->base_addr == 0 && \ - (info)->limit == 0 && \ - (info)->contents == 0 && \ -@@ -261,12 +262,6 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu) - (info)->seg_not_present == 1 && \ - (info)->useable == 0) - --#ifdef CONFIG_X86_64 --#define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0)) --#else --#define LDT_empty(info) (_LDT_empty(info)) --#endif -- - static inline void clear_LDT(void) - { - set_ldt(NULL, 0); diff --git a/debian/patches/bugfix/x86/x86_64-vdso-fix-the-vdso-address-randomization-algor.patch b/debian/patches/bugfix/x86/x86_64-vdso-fix-the-vdso-address-randomization-algor.patch deleted file mode 100644 index 76a33ae26..000000000 --- a/debian/patches/bugfix/x86/x86_64-vdso-fix-the-vdso-address-randomization-algor.patch +++ /dev/null @@ -1,124 +0,0 @@ -From: Andy Lutomirski -Date: Fri, 19 Dec 2014 16:04:11 -0800 -Subject: x86_64, vdso: Fix the vdso address randomization algorithm -Origin: https://git.kernel.org/linus/394f56fe480140877304d342dec46d50dc823d46 - -The theory behind vdso randomization is that it's mapped at a random -offset above the top of the stack. To avoid wasting a page of -memory for an extra page table, the vdso isn't supposed to extend -past the lowest PMD into which it can fit. Other than that, the -address should be a uniformly distributed address that meets all of -the alignment requirements. - -The current algorithm is buggy: the vdso has about a 50% probability -of being at the very end of a PMD. The current algorithm also has a -decent chance of failing outright due to incorrect handling of the -case where the top of the stack is near the top of its PMD. - -This fixes the implementation. The paxtest estimate of vdso -"randomisation" improves from 11 bits to 18 bits. (Disclaimer: I -don't know what the paxtest code is actually calculating.) - -It's worth noting that this algorithm is inherently biased: the vdso -is more likely to end up near the end of its PMD than near the -beginning. Ideally we would either nix the PMD sharing requirement -or jointly randomize the vdso and the stack to reduce the bias. - -In the mean time, this is a considerable improvement with basically -no risk of compatibility issues, since the allowed outputs of the -algorithm are unchanged. - -As an easy test, doing this: - -for i in `seq 10000` - do grep -P vdso /proc/self/maps |cut -d- -f1 -done |sort |uniq -d - -used to produce lots of output (1445 lines on my most recent run). -A tiny subset looks like this: - -7fffdfffe000 -7fffe01fe000 -7fffe05fe000 -7fffe07fe000 -7fffe09fe000 -7fffe0bfe000 -7fffe0dfe000 - -Note the suspicious fe000 endings. With the fix, I get a much more -palatable 76 repeated addresses. - -Reviewed-by: Kees Cook -Cc: stable@vger.kernel.org -Signed-off-by: Andy Lutomirski ---- - arch/x86/vdso/vma.c | 45 +++++++++++++++++++++++++++++---------------- - 1 file changed, 29 insertions(+), 16 deletions(-) - ---- a/arch/x86/vdso/vma.c -+++ b/arch/x86/vdso/vma.c -@@ -54,12 +54,17 @@ subsys_initcall(init_vdso); - - struct linux_binprm; - --/* Put the vdso above the (randomized) stack with another randomized offset. -- This way there is no hole in the middle of address space. -- To save memory make sure it is still in the same PTE as the stack top. -- This doesn't give that many random bits. -- -- Only used for the 64-bit and x32 vdsos. */ -+/* -+ * Put the vdso above the (randomized) stack with another randomized -+ * offset. This way there is no hole in the middle of address space. -+ * To save memory make sure it is still in the same PTE as the stack -+ * top. This doesn't give that many random bits. -+ * -+ * Note that this algorithm is imperfect: the distribution of the vdso -+ * start address within a PMD is biased toward the end. -+ * -+ * Only used for the 64-bit and x32 vdsos. -+ */ - static unsigned long vdso_addr(unsigned long start, unsigned len) - { - #ifdef CONFIG_X86_32 -@@ -67,22 +72,30 @@ static unsigned long vdso_addr(unsigned - #else - unsigned long addr, end; - unsigned offset; -- end = (start + PMD_SIZE - 1) & PMD_MASK; -+ -+ /* -+ * Round up the start address. It can start out unaligned as a result -+ * of stack start randomization. -+ */ -+ start = PAGE_ALIGN(start); -+ -+ /* Round the lowest possible end address up to a PMD boundary. */ -+ end = (start + len + PMD_SIZE - 1) & PMD_MASK; - if (end >= TASK_SIZE_MAX) - end = TASK_SIZE_MAX; - end -= len; -- /* This loses some more bits than a modulo, but is cheaper */ -- offset = get_random_int() & (PTRS_PER_PTE - 1); -- addr = start + (offset << PAGE_SHIFT); -- if (addr >= end) -- addr = end; -+ -+ if (end > start) { -+ offset = get_random_int() % (((end - start) >> PAGE_SHIFT) + 1); -+ addr = start + (offset << PAGE_SHIFT); -+ } else { -+ addr = start; -+ } - - /* -- * page-align it here so that get_unmapped_area doesn't -- * align it wrongfully again to the next page. addr can come in 4K -- * unaligned here as a result of stack start randomization. -+ * Forcibly align the final address in case we have a hardware -+ * issue that requires alignment for performance reasons. - */ -- addr = PAGE_ALIGN(addr); - addr = align_vdso_addr(addr); - - return addr; diff --git a/debian/patches/features/all/aufs3/aufs3-mmap.patch b/debian/patches/features/all/aufs3/aufs3-mmap.patch index 8b1266602..c8c399486 100644 --- a/debian/patches/features/all/aufs3/aufs3-mmap.patch +++ b/debian/patches/features/all/aufs3/aufs3-mmap.patch @@ -8,11 +8,9 @@ Patch headers added by debian/patches/features/all/aufs3/gen-patch aufs3.16 mmap patch -diff --git a/fs/buffer.c b/fs/buffer.c -index eba6e4f..31f0b2d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c -@@ -2460,7 +2460,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, +@@ -2470,7 +2470,7 @@ int block_page_mkwrite(struct vm_area_st * Update file times before taking page lock. We may end up failing the * fault so this update may be superfluous but who really cares... */ @@ -21,11 +19,9 @@ index eba6e4f..31f0b2d 100644 ret = __block_page_mkwrite(vma, vmf, get_block); sb_end_pagefault(sb); -diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c -index d4a3574..1397181 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c -@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) +@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_ file = region->vm_file; if (file) { @@ -37,11 +33,9 @@ index d4a3574..1397181 100644 dev = inode->i_sb->s_dev; ino = inode->i_ino; } -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index cfa63ee..bf4919e 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c -@@ -265,7 +265,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) +@@ -265,7 +265,10 @@ show_map_vma(struct seq_file *m, struct const char *name = NULL; if (file) { @@ -53,7 +47,7 @@ index cfa63ee..bf4919e 100644 dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; -@@ -1390,7 +1393,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid) +@@ -1390,7 +1393,7 @@ static int show_numa_map(struct seq_file struct proc_maps_private *proc_priv = &numa_priv->proc_maps; struct vm_area_struct *vma = v; struct numa_maps *md = &numa_priv->md; @@ -62,11 +56,9 @@ index cfa63ee..bf4919e 100644 struct task_struct *task = proc_priv->task; struct mm_struct *mm = vma->vm_mm; struct mm_walk walk = {}; -diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c -index 678455d..0ef7ef4 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c -@@ -141,7 +141,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, +@@ -141,7 +141,10 @@ static int nommu_vma_show(struct seq_fil file = vma->vm_file; if (file) { @@ -78,11 +70,9 @@ index 678455d..0ef7ef4 100644 dev = inode->i_sb->s_dev; ino = inode->i_ino; pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; -diff --git a/include/linux/mm.h b/include/linux/mm.h -index e03dd29..dd32624 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h -@@ -1184,6 +1184,28 @@ static inline int fixup_user_fault(struct task_struct *tsk, +@@ -1187,6 +1187,28 @@ static inline int fixup_user_fault(struc } #endif @@ -111,8 +101,6 @@ index e03dd29..dd32624 100644 extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, int len, int write); -diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index 96c5750..a087ecd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -232,6 +232,7 @@ struct vm_region { @@ -131,11 +119,9 @@ index 96c5750..a087ecd 100644 void * vm_private_data; /* was vm_pte (shared mem) */ #ifndef CONFIG_MMU -diff --git a/kernel/fork.c b/kernel/fork.c -index 6a13c46..714302c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -416,7 +416,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) +@@ -416,7 +416,7 @@ static int dup_mmap(struct mm_struct *mm struct inode *inode = file_inode(file); struct address_space *mapping = file->f_mapping; @@ -144,11 +130,9 @@ index 6a13c46..714302c 100644 if (tmp->vm_flags & VM_DENYWRITE) atomic_dec(&inode->i_writecount); mutex_lock(&mapping->i_mmap_mutex); -diff --git a/mm/Makefile b/mm/Makefile -index 4064f3e..0003fdf 100644 --- a/mm/Makefile +++ b/mm/Makefile -@@ -18,7 +18,7 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \ +@@ -18,7 +18,7 @@ obj-y := filemap.o mempool.o oom_kill. mm_init.o mmu_context.o percpu.o slab_common.o \ compaction.o balloon_compaction.o vmacache.o \ interval_tree.o list_lru.o workingset.o \ @@ -157,11 +141,9 @@ index 4064f3e..0003fdf 100644 obj-y += init-mm.o -diff --git a/mm/filemap.c b/mm/filemap.c -index 900edfa..f4dda0c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c -@@ -2040,7 +2040,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) +@@ -2036,7 +2036,7 @@ int filemap_page_mkwrite(struct vm_area_ int ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); @@ -170,8 +152,6 @@ index 900edfa..f4dda0c 100644 lock_page(page); if (page->mapping != inode->i_mapping) { unlock_page(page); -diff --git a/mm/fremap.c b/mm/fremap.c -index 72b8fa3..a00bbf0 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -224,16 +224,28 @@ get_write_lock: @@ -205,11 +185,9 @@ index 72b8fa3..a00bbf0 100644 err = 0; } goto out_freed; -diff --git a/mm/madvise.c b/mm/madvise.c -index a402f8f..134e15d 100644 --- a/mm/madvise.c +++ b/mm/madvise.c -@@ -327,12 +327,12 @@ static long madvise_remove(struct vm_area_struct *vma, +@@ -327,12 +327,12 @@ static long madvise_remove(struct vm_are * vma's reference to the file) can go away as soon as we drop * mmap_sem. */ @@ -224,12 +202,10 @@ index a402f8f..134e15d 100644 down_read(¤t->mm->mmap_sem); return error; } -diff --git a/mm/memory.c b/mm/memory.c -index 8b44f76..69a72bf 100644 --- a/mm/memory.c +++ b/mm/memory.c -@@ -2161,7 +2161,7 @@ reuse: - set_page_dirty_balance(dirty_page); +@@ -2168,7 +2168,7 @@ reuse: + /* file_update_time outside page_lock */ if (vma->vm_file) - file_update_time(vma->vm_file); @@ -237,11 +213,9 @@ index 8b44f76..69a72bf 100644 } put_page(dirty_page); if (page_mkwrite) { -diff --git a/mm/mmap.c b/mm/mmap.c -index 129b847..869d1d7 100644 --- a/mm/mmap.c +++ b/mm/mmap.c -@@ -253,7 +253,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) +@@ -253,7 +253,7 @@ static struct vm_area_struct *remove_vma if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -250,7 +224,7 @@ index 129b847..869d1d7 100644 mpol_put(vma_policy(vma)); kmem_cache_free(vm_area_cachep, vma); return next; -@@ -863,7 +863,7 @@ again: remove_next = 1 + (end > next->vm_end); +@@ -868,7 +868,7 @@ again: remove_next = 1 + (end > next-> if (remove_next) { if (file) { uprobe_munmap(next, next->vm_start, next->vm_end); @@ -259,7 +233,7 @@ index 129b847..869d1d7 100644 } if (next->anon_vma) anon_vma_merge(vma, next); -@@ -1643,8 +1643,8 @@ out: +@@ -1648,8 +1648,8 @@ out: unmap_and_free_vma: if (vm_flags & VM_DENYWRITE) allow_write_access(file); @@ -269,7 +243,7 @@ index 129b847..869d1d7 100644 /* Undo any partial mapping done by a device driver. */ unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end); -@@ -2434,7 +2434,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, +@@ -2443,7 +2443,7 @@ static int __split_vma(struct mm_struct goto out_free_mpol; if (new->vm_file) @@ -278,7 +252,7 @@ index 129b847..869d1d7 100644 if (new->vm_ops && new->vm_ops->open) new->vm_ops->open(new); -@@ -2453,7 +2453,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, +@@ -2462,7 +2462,7 @@ static int __split_vma(struct mm_struct if (new->vm_ops && new->vm_ops->close) new->vm_ops->close(new); if (new->vm_file) @@ -287,7 +261,7 @@ index 129b847..869d1d7 100644 unlink_anon_vmas(new); out_free_mpol: mpol_put(vma_policy(new)); -@@ -2842,7 +2842,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, +@@ -2851,7 +2851,7 @@ struct vm_area_struct *copy_vma(struct v if (anon_vma_clone(new_vma, vma)) goto out_free_mempol; if (new_vma->vm_file) @@ -296,11 +270,9 @@ index 129b847..869d1d7 100644 if (new_vma->vm_ops && new_vma->vm_ops->open) new_vma->vm_ops->open(new_vma); vma_link(mm, new_vma, prev, rb_link, rb_parent); -diff --git a/mm/msync.c b/mm/msync.c -index 992a167..ce1915b 100644 --- a/mm/msync.c +++ b/mm/msync.c -@@ -84,13 +84,13 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags) +@@ -84,13 +84,13 @@ SYSCALL_DEFINE3(msync, unsigned long, st start = vma->vm_end; if ((flags & MS_SYNC) && file && (vma->vm_flags & VM_SHARED)) { @@ -316,11 +288,9 @@ index 992a167..ce1915b 100644 if (error || start >= end) goto out; down_read(&mm->mmap_sem); -diff --git a/mm/nommu.c b/mm/nommu.c -index 4a852f6..b369644 100644 --- a/mm/nommu.c +++ b/mm/nommu.c -@@ -658,7 +658,7 @@ static void __put_nommu_region(struct vm_region *region) +@@ -658,7 +658,7 @@ static void __put_nommu_region(struct vm up_write(&nommu_region_sem); if (region->vm_file) @@ -329,7 +299,7 @@ index 4a852f6..b369644 100644 /* IO memory and memory shared directly out of the pagecache * from ramfs/tmpfs mustn't be released here */ -@@ -823,7 +823,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma) +@@ -823,7 +823,7 @@ static void delete_vma(struct mm_struct if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); if (vma->vm_file) @@ -338,7 +308,7 @@ index 4a852f6..b369644 100644 put_nommu_region(vma->vm_region); kmem_cache_free(vm_area_cachep, vma); } -@@ -1385,7 +1385,7 @@ unsigned long do_mmap_pgoff(struct file *file, +@@ -1385,7 +1385,7 @@ unsigned long do_mmap_pgoff(struct file goto error_just_free; } } @@ -360,9 +330,6 @@ index 4a852f6..b369644 100644 kmem_cache_free(vm_area_cachep, vma); kleave(" = %d", ret); return ret; -diff --git a/mm/prfile.c b/mm/prfile.c -new file mode 100644 -index 0000000..fc708d2 --- /dev/null +++ b/mm/prfile.c @@ -0,0 +1,86 @@ diff --git a/debian/patches/features/x86/apple-tb/pci-suspend-resume-quirks-for-apple-thunderbolt.patch b/debian/patches/features/x86/apple-tb/pci-suspend-resume-quirks-for-apple-thunderbolt.patch index 6936d33db..f09a3b1d9 100644 --- a/debian/patches/features/x86/apple-tb/pci-suspend-resume-quirks-for-apple-thunderbolt.patch +++ b/debian/patches/features/x86/apple-tb/pci-suspend-resume-quirks-for-apple-thunderbolt.patch @@ -30,9 +30,9 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -3006,6 +3006,103 @@ DECLARE_PCI_FIXUP_HEADER(0x1814, 0x0601, - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x8169, - quirk_broken_intx_masking); +@@ -3020,6 +3020,103 @@ static void quirk_no_bus_reset(struct pc + */ + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset); +#ifdef CONFIG_ACPI +/* @@ -136,7 +136,7 @@ Signed-off-by: Greg Kroah-Hartman { --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1485,7 +1485,9 @@ enum pci_fixup_pass { +@@ -1489,7 +1489,9 @@ enum pci_fixup_pass { pci_fixup_resume, /* pci_device_resume() */ pci_fixup_suspend, /* pci_device_suspend() */ pci_fixup_resume_early, /* pci_device_resume_early() */ diff --git a/debian/patches/series b/debian/patches/series index 3bdef52fd..838b6f368 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -56,7 +56,6 @@ bugfix/x86/drm-i915-Add-some-L3-registers-to-the-parser-whiteli.patch bugfix/parisc/parisc-reduce-sigrtmin-from-37-to-32-to-behave-like-.patch bugfix/arm64/arm64-add-missing-dts-entry-for-X-Gene-platform.patch bugfix/arm64/arm64-removed-using-of-the-mask-attribute-in-the-dts.patch -bugfix/arm64/clocksource-arch_timer-Only-use-the-virtual-counter-.patch bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch # Arch features @@ -154,7 +153,6 @@ bugfix/all/netback-don-t-store-invalid-vif-pointer.patch bugfix/all/xen-netback-support-frontends-without-feature-rx-not.patch bugfix/all/aufs-move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch bugfix/all/net-mv643xx-disable-tso-by-default.patch -bugfix/all/Revert-swiotlb-xen-pass-dev_addr-to-swiotlb_tbl_unma.patch bugfix/all/xen-balloon-cancel-ballooning-if-adding-new-memory-f.patch bugfix/all/xen-balloon-Don-t-continue-ballooning-when-BP_ECANCE.patch @@ -491,16 +489,6 @@ debian/arm-thread_info-fix-abi-change-in-3.16.7-ckt3.patch debian/pci-fix-abi-change-in-3.16.7-ckt3.patch debian/vfs-avoid-abi-change-for-dentry-union-changes.patch debian/userns-fix-abi-change-in-3.16.7-ckt4.patch -bugfix/all/netfilter-conntrack-disable-generic-tracking-for-kno.patch -bugfix/x86/x86_64-vdso-fix-the-vdso-address-randomization-algor.patch -bugfix/all/crypto-prefix-module-autoloading-with-crypto.patch -bugfix/all/crypto-include-crypto-module-prefix-in-template.patch -bugfix/all/crypto-add-missing-crypto-module-aliases.patch -bugfix/x86/kvm-x86-sysenter-emulation-is-broken.patch -bugfix/sh4/scripts-recordmcount.pl-there-is-no-m32-option-on-super-h.patch -bugfix/x86/x86-tls-ldt-stop-checking-lm-in-ldt_empty.patch -bugfix/x86/x86-tls-interpret-an-all-zero-struct-user_desc-as-no.patch -bugfix/all/net-sctp-fix-slab-corruption-from-use-after-free-on-.patch features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch From 2ff6a942baaef41b8452ebc700bc9ee70f7ca15c Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 22 Feb 2015 05:12:52 +0000 Subject: [PATCH 09/32] Note fix for CVE-2015-1465 svn path=/dists/sid/linux/; revision=22413 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f14688ec9..e56264c4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -126,7 +126,7 @@ linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium - iwlwifi: mvm: drop non VO frames when flushing (regression in 3.16) - memcg: remove extra newlines from memcg oom kill log (regression in 3.15) - ipv4: try to cache dst_entries which would cause a redirect - (regression in 3.16) + (regression in 3.16) (CVE-2015-1465) [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) From c16cd7ca9fe421ecd1b25ce6d73808835b976024 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 22 Feb 2015 09:52:38 +0000 Subject: [PATCH 10/32] [alpha] build debian-installer udeb packages svn path=/dists/sid/linux/; revision=22414 --- debian/changelog | 3 +++ debian/installer/alpha/kernel-versions | 2 ++ .../alpha/modules/alpha-generic/ata-modules | 2 ++ .../alpha/modules/alpha-generic/btrfs-modules | 1 + .../modules/alpha-generic/cdrom-core-modules | 1 + .../alpha/modules/alpha-generic/core-modules | 1 + .../alpha/modules/alpha-generic/crc-modules | 1 + .../modules/alpha-generic/crypto-dm-modules | 1 + .../alpha/modules/alpha-generic/crypto-modules | 1 + .../alpha/modules/alpha-generic/event-modules | 1 + .../alpha/modules/alpha-generic/ext4-modules | 1 + .../alpha/modules/alpha-generic/fat-modules | 1 + .../alpha/modules/alpha-generic/fb-modules | 4 ++++ .../alpha/modules/alpha-generic/fuse-modules | 1 + .../alpha/modules/alpha-generic/input-modules | 1 + .../alpha/modules/alpha-generic/isofs-modules | 1 + .../alpha/modules/alpha-generic/jfs-modules | 1 + .../alpha/modules/alpha-generic/kernel-image | 1 + .../alpha/modules/alpha-generic/loop-modules | 1 + .../alpha/modules/alpha-generic/md-modules | 1 + .../alpha/modules/alpha-generic/mouse-modules | 1 + .../modules/alpha-generic/multipath-modules | 1 + .../alpha/modules/alpha-generic/nbd-modules | 1 + .../alpha/modules/alpha-generic/nic-modules | 1 + .../modules/alpha-generic/nic-shared-modules | 1 + .../modules/alpha-generic/nic-usb-modules | 1 + .../alpha/modules/alpha-generic/pata-modules | 1 + .../alpha/modules/alpha-generic/ppp-modules | 1 + .../alpha/modules/alpha-generic/sata-modules | 1 + .../modules/alpha-generic/scsi-common-modules | 1 + .../modules/alpha-generic/scsi-core-modules | 1 + .../alpha/modules/alpha-generic/scsi-modules | 1 + .../alpha/modules/alpha-generic/serial-modules | 1 + .../modules/alpha-generic/squashfs-modules | 1 + .../alpha/modules/alpha-generic/srm-modules | 1 + .../alpha/modules/alpha-generic/usb-modules | 1 + .../modules/alpha-generic/usb-serial-modules | 1 + .../modules/alpha-generic/usb-storage-modules | 1 + .../alpha/modules/alpha-generic/xfs-modules | 1 + .../alpha/modules/alpha-generic/zlib-modules | 1 + debian/installer/alpha/package-list | 18 ++++++++++++++++++ 41 files changed, 65 insertions(+) create mode 100644 debian/installer/alpha/kernel-versions create mode 100644 debian/installer/alpha/modules/alpha-generic/ata-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/btrfs-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/cdrom-core-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/core-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/crc-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/crypto-dm-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/crypto-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/event-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/ext4-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/fat-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/fb-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/fuse-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/input-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/isofs-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/jfs-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/kernel-image create mode 100644 debian/installer/alpha/modules/alpha-generic/loop-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/md-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/mouse-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/multipath-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/nbd-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/nic-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/nic-shared-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/nic-usb-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/pata-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/ppp-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/sata-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/scsi-common-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/scsi-core-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/scsi-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/serial-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/squashfs-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/srm-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/usb-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/usb-serial-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/usb-storage-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/xfs-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/zlib-modules create mode 100644 debian/installer/alpha/package-list diff --git a/debian/changelog b/debian/changelog index e56264c4f..83093fe02 100644 --- a/debian/changelog +++ b/debian/changelog @@ -137,6 +137,9 @@ linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium * vfs: read file_handle only once in handle_to_path (CVE-2015-1420) * ASLR: fix stack randomization on 64-bit systems (CVE-2015-1593) + [ Helge Deller ] + * [alpha] build debian-installer udeb packages + -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 linux (3.16.7-ckt4-3) unstable; urgency=medium diff --git a/debian/installer/alpha/kernel-versions b/debian/installer/alpha/kernel-versions new file mode 100644 index 000000000..1a479fb20 --- /dev/null +++ b/debian/installer/alpha/kernel-versions @@ -0,0 +1,2 @@ +# arch version flavour installedname suffix build-depends +alpha - alpha-generic - y - diff --git a/debian/installer/alpha/modules/alpha-generic/ata-modules b/debian/installer/alpha/modules/alpha-generic/ata-modules new file mode 100644 index 000000000..be78de0c1 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/ata-modules @@ -0,0 +1,2 @@ +#include +libata - diff --git a/debian/installer/alpha/modules/alpha-generic/btrfs-modules b/debian/installer/alpha/modules/alpha-generic/btrfs-modules new file mode 100644 index 000000000..e261e1388 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/btrfs-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/cdrom-core-modules b/debian/installer/alpha/modules/alpha-generic/cdrom-core-modules new file mode 100644 index 000000000..3ff69b48f --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/cdrom-core-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/core-modules b/debian/installer/alpha/modules/alpha-generic/core-modules new file mode 100644 index 000000000..f05d06298 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/core-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/crc-modules b/debian/installer/alpha/modules/alpha-generic/crc-modules new file mode 100644 index 000000000..7e00de705 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/crc-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/crypto-dm-modules b/debian/installer/alpha/modules/alpha-generic/crypto-dm-modules new file mode 100644 index 000000000..4c8f2354c --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/crypto-dm-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/crypto-modules b/debian/installer/alpha/modules/alpha-generic/crypto-modules new file mode 100644 index 000000000..3a1e862b4 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/crypto-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/event-modules b/debian/installer/alpha/modules/alpha-generic/event-modules new file mode 100644 index 000000000..f8819afd3 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/event-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/ext4-modules b/debian/installer/alpha/modules/alpha-generic/ext4-modules new file mode 100644 index 000000000..394c577ce --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/ext4-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/fat-modules b/debian/installer/alpha/modules/alpha-generic/fat-modules new file mode 100644 index 000000000..274584eb6 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/fat-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/fb-modules b/debian/installer/alpha/modules/alpha-generic/fb-modules new file mode 100644 index 000000000..11d549730 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/fb-modules @@ -0,0 +1,4 @@ +fbcon ? +lxfb ? +vesafb ? +vga16fb ? diff --git a/debian/installer/alpha/modules/alpha-generic/fuse-modules b/debian/installer/alpha/modules/alpha-generic/fuse-modules new file mode 100644 index 000000000..0b6ba0c8c --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/fuse-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/input-modules b/debian/installer/alpha/modules/alpha-generic/input-modules new file mode 100644 index 000000000..5ecb595a4 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/input-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/isofs-modules b/debian/installer/alpha/modules/alpha-generic/isofs-modules new file mode 100644 index 000000000..da4fa9a3c --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/isofs-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/jfs-modules b/debian/installer/alpha/modules/alpha-generic/jfs-modules new file mode 100644 index 000000000..7e4d912b9 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/jfs-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/kernel-image b/debian/installer/alpha/modules/alpha-generic/kernel-image new file mode 100644 index 000000000..1bb8bf6d7 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/kernel-image @@ -0,0 +1 @@ +# empty diff --git a/debian/installer/alpha/modules/alpha-generic/loop-modules b/debian/installer/alpha/modules/alpha-generic/loop-modules new file mode 100644 index 000000000..c1c948fa3 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/loop-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/md-modules b/debian/installer/alpha/modules/alpha-generic/md-modules new file mode 100644 index 000000000..26115e10b --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/md-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/mouse-modules b/debian/installer/alpha/modules/alpha-generic/mouse-modules new file mode 100644 index 000000000..15fcb00ea --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/mouse-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/multipath-modules b/debian/installer/alpha/modules/alpha-generic/multipath-modules new file mode 100644 index 000000000..a8b69b253 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/multipath-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/nbd-modules b/debian/installer/alpha/modules/alpha-generic/nbd-modules new file mode 100644 index 000000000..3c9b3e5d4 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/nbd-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/nic-modules b/debian/installer/alpha/modules/alpha-generic/nic-modules new file mode 100644 index 000000000..2512e8395 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/nic-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/nic-shared-modules b/debian/installer/alpha/modules/alpha-generic/nic-shared-modules new file mode 100644 index 000000000..cc84b14dc --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/nic-shared-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/nic-usb-modules b/debian/installer/alpha/modules/alpha-generic/nic-usb-modules new file mode 100644 index 000000000..c479669b4 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/nic-usb-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/pata-modules b/debian/installer/alpha/modules/alpha-generic/pata-modules new file mode 100644 index 000000000..b0cd6337a --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/pata-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/ppp-modules b/debian/installer/alpha/modules/alpha-generic/ppp-modules new file mode 100644 index 000000000..1f26aa1ee --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/ppp-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/sata-modules b/debian/installer/alpha/modules/alpha-generic/sata-modules new file mode 100644 index 000000000..01318c258 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/sata-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/scsi-common-modules b/debian/installer/alpha/modules/alpha-generic/scsi-common-modules new file mode 100644 index 000000000..71103dd60 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/scsi-common-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/scsi-core-modules b/debian/installer/alpha/modules/alpha-generic/scsi-core-modules new file mode 100644 index 000000000..dd65d6614 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/scsi-core-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/scsi-modules b/debian/installer/alpha/modules/alpha-generic/scsi-modules new file mode 100644 index 000000000..8909dfb79 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/scsi-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/serial-modules b/debian/installer/alpha/modules/alpha-generic/serial-modules new file mode 100644 index 000000000..6ab8b8c35 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/serial-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/squashfs-modules b/debian/installer/alpha/modules/alpha-generic/squashfs-modules new file mode 100644 index 000000000..42d77887a --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/squashfs-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/srm-modules b/debian/installer/alpha/modules/alpha-generic/srm-modules new file mode 100644 index 000000000..016011997 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/srm-modules @@ -0,0 +1 @@ +srm_env diff --git a/debian/installer/alpha/modules/alpha-generic/usb-modules b/debian/installer/alpha/modules/alpha-generic/usb-modules new file mode 100644 index 000000000..c598dedd8 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/usb-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/usb-serial-modules b/debian/installer/alpha/modules/alpha-generic/usb-serial-modules new file mode 100644 index 000000000..c0a0dc3bd --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/usb-serial-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/usb-storage-modules b/debian/installer/alpha/modules/alpha-generic/usb-storage-modules new file mode 100644 index 000000000..8c5e81b55 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/usb-storage-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/xfs-modules b/debian/installer/alpha/modules/alpha-generic/xfs-modules new file mode 100644 index 000000000..98374e2bb --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/xfs-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/zlib-modules b/debian/installer/alpha/modules/alpha-generic/zlib-modules new file mode 100644 index 000000000..e02ad64bf --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/zlib-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/package-list b/debian/installer/alpha/package-list new file mode 100644 index 000000000..0f8a2d22f --- /dev/null +++ b/debian/installer/alpha/package-list @@ -0,0 +1,18 @@ +# This file is used to build up the control file. The kernel version and +# "-di" are appended to the package names. Section can be left out. So can +# architecture, which is derived from the files in the modules directory. +# It overwrites specifications from /usr/share/kernel-wedge/package-list. +# +Package: kernel-image + +Package: usb-storage-modules +Depends: kernel-image, ide-modules, scsi-modules, usb-modules + +Package: ide-modules +Depends: kernel-image, ide-core-modules, nls-core-modules + +Package: pata-modules +Depends: kernel-image, ata-modules, scsi-core-modules + +Package: fb-modules +Depends: kernel-image, i2c-modules From c66d67f134ed500aff671645e48648236233ac09 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 22 Feb 2015 15:01:33 +0000 Subject: [PATCH 11/32] [alpha] add missing nic-wireless-modules udeb svn path=/dists/sid/linux/; revision=22415 --- .../installer/alpha/modules/alpha-generic/nic-wireless-modules | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/installer/alpha/modules/alpha-generic/nic-wireless-modules diff --git a/debian/installer/alpha/modules/alpha-generic/nic-wireless-modules b/debian/installer/alpha/modules/alpha-generic/nic-wireless-modules new file mode 100644 index 000000000..53fd18d7f --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/nic-wireless-modules @@ -0,0 +1 @@ +#include From d9a20151a4401ef495f563ff0fbb4d0f8d23ac31 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sun, 22 Feb 2015 17:06:56 +0000 Subject: [PATCH 12/32] [armhf] Enable CONFIG_BACKLIGHT_GPIO as a module. (Closes: #778783) svn path=/dists/sid/linux/; revision=22416 --- debian/changelog | 1 + debian/config/armhf/config.armmp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 83093fe02..1a075c754 100644 --- a/debian/changelog +++ b/debian/changelog @@ -130,6 +130,7 @@ linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) + * [armhf] Enable CONFIG_BACKLIGHT_GPIO as a module. (Closes: #778783) [ Ben Hutchings ] * shm: add memfd.h to UAPI export list, so kdbus will build diff --git a/debian/config/armhf/config.armmp b/debian/config/armhf/config.armmp index 62e512f0c..03302a01c 100644 --- a/debian/config/armhf/config.armmp +++ b/debian/config/armhf/config.armmp @@ -831,6 +831,11 @@ CONFIG_AM335X_PHY_USB=m CONFIG_TWL6030_USB=m CONFIG_USB_MXS_PHY=m +## +## file: drivers/video/backlight/Kconfig +## +CONFIG_BACKLIGHT_GPIO=m + ## ## file: drivers/video/console/Kconfig ## From fdbdbd5de360f5d2dd1a892858ddacf7f14387fc Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 24 Feb 2015 16:29:31 +0000 Subject: [PATCH 13/32] [alpha] add udeb packages: nic-pcmcia-modules, pcmcia-modules svn path=/dists/sid/linux/; revision=22418 --- debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules | 1 + debian/installer/alpha/modules/alpha-generic/pcmcia-modules | 1 + 2 files changed, 2 insertions(+) create mode 100644 debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules create mode 100644 debian/installer/alpha/modules/alpha-generic/pcmcia-modules diff --git a/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules b/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules new file mode 100644 index 000000000..7a0702cd5 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/pcmcia-modules b/debian/installer/alpha/modules/alpha-generic/pcmcia-modules new file mode 100644 index 000000000..2bb5350fe --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/pcmcia-modules @@ -0,0 +1 @@ +#include From 6bedef46e3d4226320ea016753df62a07e2e72f4 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 24 Feb 2015 21:07:23 +0000 Subject: [PATCH 14/32] Fix module ABI changes from 3.16.7-ckt{5,6} Revert the quota ops change as it will take some effort to avoid an ABI change. All the others can be fixed or ignored. svn path=/dists/sid/linux/; revision=22419 --- debian/changelog | 5 + ...e_get_page-abi-change-in-3.16.7-ckt6.patch | 46 + .../perf-fix-abi-change-in-3.16.7-ckt6.patch | 32 + ...tch-get_dqblk-and-set_dqblk-to-use-b.patch | 940 ++++++++++++++++++ .../rmap-fix-abi-change-in-3.16.7-ckt5.patch | 50 + debian/patches/series | 4 + 6 files changed, 1077 insertions(+) create mode 100644 debian/patches/debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch create mode 100644 debian/patches/debian/perf-fix-abi-change-in-3.16.7-ckt6.patch create mode 100644 debian/patches/debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch create mode 100644 debian/patches/debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch diff --git a/debian/changelog b/debian/changelog index 1a075c754..410cf9779 100644 --- a/debian/changelog +++ b/debian/changelog @@ -137,6 +137,11 @@ linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium * [x86] HPET force enable for e6xx based systems (Closes: #772951) * vfs: read file_handle only once in handle_to_path (CVE-2015-1420) * ASLR: fix stack randomization on 64-bit systems (CVE-2015-1593) + * Revert "quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as + space units" to avoid ABI change + * rmap: Fix ABI change in 3.16.7-ckt5 + * perf: Fix ABI change in 3.16.7-ckt6 + * mm: Fix pagecache_get_page() ABI change in 3.16.7-ckt6 [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/patches/debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch b/debian/patches/debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch new file mode 100644 index 000000000..2234330ef --- /dev/null +++ b/debian/patches/debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch @@ -0,0 +1,46 @@ +From: Ben Hutchings +Date: Tue, 24 Feb 2015 20:05:05 +0000 +Subject: mm: Fix pagecache_get_page() ABI change in 3.16.7-ckt6 +Forwarded: not-needed + +The last parameter to pagecache_get_page() was dropped, as some +callers passed the wrong value and it is really redundant. + +As most filesystems need this function, we should keep the old +function signature for OOT modules. Rename the function, add a +wrapper with the old name and parameters, and add a macro to make all +new callers use the new function. + +--- +--- a/include/linux/pagemap.h ++++ b/include/linux/pagemap.h +@@ -267,7 +267,12 @@ pgoff_t page_cache_prev_hole(struct addr + #define FGP_NOWAIT 0x00000020 + + struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset, +- int fgp_flags, gfp_t cache_gfp_mask); ++ int fgp_flags, gfp_t cache_gfp_mask, ++ gfp_t radix_gfp_mask); ++struct page * ++pagecache_get_page_fixed(struct address_space *mapping, pgoff_t offset, ++ int fgp_flags, gfp_t cache_gfp_mask); ++#define pagecache_get_page pagecache_get_page_fixed + + /** + * find_get_page - find and get a page reference +--- a/mm/filemap.c ++++ b/mm/filemap.c +@@ -2674,3 +2674,13 @@ int try_to_release_page(struct page *pag + } + + EXPORT_SYMBOL(try_to_release_page); ++ ++#undef pagecache_get_page ++struct page *pagecache_get_page(struct address_space *mapping, pgoff_t offset, ++ int fgp_flags, gfp_t cache_gfp_mask, ++ gfp_t radix_gfp_mask __always_unused) ++{ ++ return pagecache_get_page_fixed(mapping, offset, fgp_flags, ++ cache_gfp_mask); ++} ++EXPORT_SYMBOL(pagecache_get_page); diff --git a/debian/patches/debian/perf-fix-abi-change-in-3.16.7-ckt6.patch b/debian/patches/debian/perf-fix-abi-change-in-3.16.7-ckt6.patch new file mode 100644 index 000000000..0d76e890a --- /dev/null +++ b/debian/patches/debian/perf-fix-abi-change-in-3.16.7-ckt6.patch @@ -0,0 +1,32 @@ +From: Ben Hutchings +Date: Tue, 24 Feb 2015 09:53:48 +0000 +Subject: perf: Fix ABI change in 3.16.7-ckt6 +Forwarded: not-needed + +Commit c3c87e770458 ('perf: Tighten (and fix) the grouping condition') +removed perf_event_context::type and its type definition. Add them +back. + +--- a/include/linux/perf_event.h ++++ b/include/linux/perf_event.h +@@ -453,6 +453,12 @@ struct perf_event { + #endif /* CONFIG_PERF_EVENTS */ + }; + ++/* now unused */ ++enum perf_event_context_type { ++ task_context, ++ cpu_context, ++}; ++ + /** + * struct perf_event_context - event context structure + * +@@ -460,6 +466,7 @@ struct perf_event { + */ + struct perf_event_context { + struct pmu *pmu; ++ enum perf_event_context_type type; /* now unused */ + /* + * Protect the states of the events in the list, + * nr_active, and the list: diff --git a/debian/patches/debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch b/debian/patches/debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch new file mode 100644 index 000000000..5ac628ac1 --- /dev/null +++ b/debian/patches/debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch @@ -0,0 +1,940 @@ +From: Ben Hutchings +Date: Tue, 24 Feb 2015 06:11:44 +0000 +Subject: Revert "quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units" +Forwarded: not-needed + +This reverts commit e5c1cda088832f58c8477ac993ed70ec98fa1221. based +on commit 14bf61ffe6ac54afcd1e888a4407fe16054483db upstream. It makes +a module ABI change and doesn't seem worth the trouble. We can +probably fix the issue later in a somewhat uglier way without the ABI +change. +--- + fs/gfs2/quota.c | 49 +++++++------- + fs/quota/dquot.c | 83 ++++++++++++------------ + fs/quota/quota.c | 162 ++++++++--------------------------------------- + fs/xfs/xfs_qm.h | 4 +- + fs/xfs/xfs_qm_syscalls.c | 156 ++++++++++++++++++++++++++------------------- + fs/xfs/xfs_quotaops.c | 8 +-- + include/linux/quota.h | 47 +------------- + include/linux/quotaops.h | 4 +- + 8 files changed, 195 insertions(+), 318 deletions(-) + +diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c +index dc482ff..64b29f7 100644 +--- a/fs/gfs2/quota.c ++++ b/fs/gfs2/quota.c +@@ -667,7 +667,7 @@ static void do_qc(struct gfs2_quota_data *qd, s64 change) + + static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, + s64 change, struct gfs2_quota_data *qd, +- struct qc_dqblk *fdq) ++ struct fs_disk_quota *fdq) + { + struct inode *inode = &ip->i_inode; + struct gfs2_sbd *sdp = GFS2_SB(inode); +@@ -697,16 +697,16 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, + be64_add_cpu(&q.qu_value, change); + qd->qd_qb.qb_value = q.qu_value; + if (fdq) { +- if (fdq->d_fieldmask & QC_SPC_SOFT) { +- q.qu_warn = cpu_to_be64(fdq->d_spc_softlimit >> sdp->sd_sb.sb_bsize_shift); ++ if (fdq->d_fieldmask & FS_DQ_BSOFT) { ++ q.qu_warn = cpu_to_be64(fdq->d_blk_softlimit >> sdp->sd_fsb2bb_shift); + qd->qd_qb.qb_warn = q.qu_warn; + } +- if (fdq->d_fieldmask & QC_SPC_HARD) { +- q.qu_limit = cpu_to_be64(fdq->d_spc_hardlimit >> sdp->sd_sb.sb_bsize_shift); ++ if (fdq->d_fieldmask & FS_DQ_BHARD) { ++ q.qu_limit = cpu_to_be64(fdq->d_blk_hardlimit >> sdp->sd_fsb2bb_shift); + qd->qd_qb.qb_limit = q.qu_limit; + } +- if (fdq->d_fieldmask & QC_SPACE) { +- q.qu_value = cpu_to_be64(fdq->d_space >> sdp->sd_sb.sb_bsize_shift); ++ if (fdq->d_fieldmask & FS_DQ_BCOUNT) { ++ q.qu_value = cpu_to_be64(fdq->d_bcount >> sdp->sd_fsb2bb_shift); + qd->qd_qb.qb_value = q.qu_value; + } + } +@@ -1502,7 +1502,7 @@ static int gfs2_quota_get_xstate(struct super_block *sb, + } + + static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid, +- struct qc_dqblk *fdq) ++ struct fs_disk_quota *fdq) + { + struct gfs2_sbd *sdp = sb->s_fs_info; + struct gfs2_quota_lvb *qlvb; +@@ -1510,7 +1510,7 @@ static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid, + struct gfs2_holder q_gh; + int error; + +- memset(fdq, 0, sizeof(*fdq)); ++ memset(fdq, 0, sizeof(struct fs_disk_quota)); + + if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) + return -ESRCH; /* Crazy XFS error code */ +@@ -1527,9 +1527,12 @@ static int gfs2_get_dqblk(struct super_block *sb, struct kqid qid, + goto out; + + qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lksb.sb_lvbptr; +- fdq->d_spc_hardlimit = be64_to_cpu(qlvb->qb_limit) << sdp->sd_sb.sb_bsize_shift; +- fdq->d_spc_softlimit = be64_to_cpu(qlvb->qb_warn) << sdp->sd_sb.sb_bsize_shift; +- fdq->d_space = be64_to_cpu(qlvb->qb_value) << sdp->sd_sb.sb_bsize_shift; ++ fdq->d_version = FS_DQUOT_VERSION; ++ fdq->d_flags = (qid.type == USRQUOTA) ? FS_USER_QUOTA : FS_GROUP_QUOTA; ++ fdq->d_id = from_kqid_munged(current_user_ns(), qid); ++ fdq->d_blk_hardlimit = be64_to_cpu(qlvb->qb_limit) << sdp->sd_fsb2bb_shift; ++ fdq->d_blk_softlimit = be64_to_cpu(qlvb->qb_warn) << sdp->sd_fsb2bb_shift; ++ fdq->d_bcount = be64_to_cpu(qlvb->qb_value) << sdp->sd_fsb2bb_shift; + + gfs2_glock_dq_uninit(&q_gh); + out: +@@ -1538,10 +1541,10 @@ out: + } + + /* GFS2 only supports a subset of the XFS fields */ +-#define GFS2_FIELDMASK (QC_SPC_SOFT|QC_SPC_HARD|QC_SPACE) ++#define GFS2_FIELDMASK (FS_DQ_BSOFT|FS_DQ_BHARD|FS_DQ_BCOUNT) + + static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid, +- struct qc_dqblk *fdq) ++ struct fs_disk_quota *fdq) + { + struct gfs2_sbd *sdp = sb->s_fs_info; + struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); +@@ -1585,17 +1588,17 @@ static int gfs2_set_dqblk(struct super_block *sb, struct kqid qid, + goto out_i; + + /* If nothing has changed, this is a no-op */ +- if ((fdq->d_fieldmask & QC_SPC_SOFT) && +- ((fdq->d_spc_softlimit >> sdp->sd_sb.sb_bsize_shift) == be64_to_cpu(qd->qd_qb.qb_warn))) +- fdq->d_fieldmask ^= QC_SPC_SOFT; ++ if ((fdq->d_fieldmask & FS_DQ_BSOFT) && ++ ((fdq->d_blk_softlimit >> sdp->sd_fsb2bb_shift) == be64_to_cpu(qd->qd_qb.qb_warn))) ++ fdq->d_fieldmask ^= FS_DQ_BSOFT; + +- if ((fdq->d_fieldmask & QC_SPC_HARD) && +- ((fdq->d_spc_hardlimit >> sdp->sd_sb.sb_bsize_shift) == be64_to_cpu(qd->qd_qb.qb_limit))) +- fdq->d_fieldmask ^= QC_SPC_HARD; ++ if ((fdq->d_fieldmask & FS_DQ_BHARD) && ++ ((fdq->d_blk_hardlimit >> sdp->sd_fsb2bb_shift) == be64_to_cpu(qd->qd_qb.qb_limit))) ++ fdq->d_fieldmask ^= FS_DQ_BHARD; + +- if ((fdq->d_fieldmask & QC_SPACE) && +- ((fdq->d_space >> sdp->sd_sb.sb_bsize_shift) == be64_to_cpu(qd->qd_qb.qb_value))) +- fdq->d_fieldmask ^= QC_SPACE; ++ if ((fdq->d_fieldmask & FS_DQ_BCOUNT) && ++ ((fdq->d_bcount >> sdp->sd_fsb2bb_shift) == be64_to_cpu(qd->qd_qb.qb_value))) ++ fdq->d_fieldmask ^= FS_DQ_BCOUNT; + + if (fdq->d_fieldmask == 0) + goto out_i; +diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c +index 6a35035..f56a357 100644 +--- a/fs/quota/dquot.c ++++ b/fs/quota/dquot.c +@@ -2407,25 +2407,30 @@ static inline qsize_t stoqb(qsize_t space) + } + + /* Generic routine for getting common part of quota structure */ +-static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di) ++static void do_get_dqblk(struct dquot *dquot, struct fs_disk_quota *di) + { + struct mem_dqblk *dm = &dquot->dq_dqb; + + memset(di, 0, sizeof(*di)); ++ di->d_version = FS_DQUOT_VERSION; ++ di->d_flags = dquot->dq_id.type == USRQUOTA ? ++ FS_USER_QUOTA : FS_GROUP_QUOTA; ++ di->d_id = from_kqid_munged(current_user_ns(), dquot->dq_id); ++ + spin_lock(&dq_data_lock); +- di->d_spc_hardlimit = dm->dqb_bhardlimit; +- di->d_spc_softlimit = dm->dqb_bsoftlimit; ++ di->d_blk_hardlimit = stoqb(dm->dqb_bhardlimit); ++ di->d_blk_softlimit = stoqb(dm->dqb_bsoftlimit); + di->d_ino_hardlimit = dm->dqb_ihardlimit; + di->d_ino_softlimit = dm->dqb_isoftlimit; +- di->d_space = dm->dqb_curspace + dm->dqb_rsvspace; +- di->d_ino_count = dm->dqb_curinodes; +- di->d_spc_timer = dm->dqb_btime; +- di->d_ino_timer = dm->dqb_itime; ++ di->d_bcount = dm->dqb_curspace + dm->dqb_rsvspace; ++ di->d_icount = dm->dqb_curinodes; ++ di->d_btimer = dm->dqb_btime; ++ di->d_itimer = dm->dqb_itime; + spin_unlock(&dq_data_lock); + } + + int dquot_get_dqblk(struct super_block *sb, struct kqid qid, +- struct qc_dqblk *di) ++ struct fs_disk_quota *di) + { + struct dquot *dquot; + +@@ -2439,70 +2444,70 @@ int dquot_get_dqblk(struct super_block *sb, struct kqid qid, + } + EXPORT_SYMBOL(dquot_get_dqblk); + +-#define VFS_QC_MASK \ +- (QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \ +- QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \ +- QC_SPC_TIMER | QC_INO_TIMER) ++#define VFS_FS_DQ_MASK \ ++ (FS_DQ_BCOUNT | FS_DQ_BSOFT | FS_DQ_BHARD | \ ++ FS_DQ_ICOUNT | FS_DQ_ISOFT | FS_DQ_IHARD | \ ++ FS_DQ_BTIMER | FS_DQ_ITIMER) + + /* Generic routine for setting common part of quota structure */ +-static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) ++static int do_set_dqblk(struct dquot *dquot, struct fs_disk_quota *di) + { + struct mem_dqblk *dm = &dquot->dq_dqb; + int check_blim = 0, check_ilim = 0; + struct mem_dqinfo *dqi = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; + +- if (di->d_fieldmask & ~VFS_QC_MASK) ++ if (di->d_fieldmask & ~VFS_FS_DQ_MASK) + return -EINVAL; + +- if (((di->d_fieldmask & QC_SPC_SOFT) && +- stoqb(di->d_spc_softlimit) > dqi->dqi_maxblimit) || +- ((di->d_fieldmask & QC_SPC_HARD) && +- stoqb(di->d_spc_hardlimit) > dqi->dqi_maxblimit) || +- ((di->d_fieldmask & QC_INO_SOFT) && ++ if (((di->d_fieldmask & FS_DQ_BSOFT) && ++ (di->d_blk_softlimit > dqi->dqi_maxblimit)) || ++ ((di->d_fieldmask & FS_DQ_BHARD) && ++ (di->d_blk_hardlimit > dqi->dqi_maxblimit)) || ++ ((di->d_fieldmask & FS_DQ_ISOFT) && + (di->d_ino_softlimit > dqi->dqi_maxilimit)) || +- ((di->d_fieldmask & QC_INO_HARD) && ++ ((di->d_fieldmask & FS_DQ_IHARD) && + (di->d_ino_hardlimit > dqi->dqi_maxilimit))) + return -ERANGE; + + spin_lock(&dq_data_lock); +- if (di->d_fieldmask & QC_SPACE) { +- dm->dqb_curspace = di->d_space - dm->dqb_rsvspace; ++ if (di->d_fieldmask & FS_DQ_BCOUNT) { ++ dm->dqb_curspace = di->d_bcount - dm->dqb_rsvspace; + check_blim = 1; + set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); + } + +- if (di->d_fieldmask & QC_SPC_SOFT) +- dm->dqb_bsoftlimit = di->d_spc_softlimit; +- if (di->d_fieldmask & QC_SPC_HARD) +- dm->dqb_bhardlimit = di->d_spc_hardlimit; +- if (di->d_fieldmask & (QC_SPC_SOFT | QC_SPC_HARD)) { ++ if (di->d_fieldmask & FS_DQ_BSOFT) ++ dm->dqb_bsoftlimit = qbtos(di->d_blk_softlimit); ++ if (di->d_fieldmask & FS_DQ_BHARD) ++ dm->dqb_bhardlimit = qbtos(di->d_blk_hardlimit); ++ if (di->d_fieldmask & (FS_DQ_BSOFT | FS_DQ_BHARD)) { + check_blim = 1; + set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); + } + +- if (di->d_fieldmask & QC_INO_COUNT) { +- dm->dqb_curinodes = di->d_ino_count; ++ if (di->d_fieldmask & FS_DQ_ICOUNT) { ++ dm->dqb_curinodes = di->d_icount; + check_ilim = 1; + set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); + } + +- if (di->d_fieldmask & QC_INO_SOFT) ++ if (di->d_fieldmask & FS_DQ_ISOFT) + dm->dqb_isoftlimit = di->d_ino_softlimit; +- if (di->d_fieldmask & QC_INO_HARD) ++ if (di->d_fieldmask & FS_DQ_IHARD) + dm->dqb_ihardlimit = di->d_ino_hardlimit; +- if (di->d_fieldmask & (QC_INO_SOFT | QC_INO_HARD)) { ++ if (di->d_fieldmask & (FS_DQ_ISOFT | FS_DQ_IHARD)) { + check_ilim = 1; + set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); + } + +- if (di->d_fieldmask & QC_SPC_TIMER) { +- dm->dqb_btime = di->d_spc_timer; ++ if (di->d_fieldmask & FS_DQ_BTIMER) { ++ dm->dqb_btime = di->d_btimer; + check_blim = 1; + set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); + } + +- if (di->d_fieldmask & QC_INO_TIMER) { +- dm->dqb_itime = di->d_ino_timer; ++ if (di->d_fieldmask & FS_DQ_ITIMER) { ++ dm->dqb_itime = di->d_itimer; + check_ilim = 1; + set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); + } +@@ -2512,7 +2517,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) + dm->dqb_curspace < dm->dqb_bsoftlimit) { + dm->dqb_btime = 0; + clear_bit(DQ_BLKS_B, &dquot->dq_flags); +- } else if (!(di->d_fieldmask & QC_SPC_TIMER)) ++ } else if (!(di->d_fieldmask & FS_DQ_BTIMER)) + /* Set grace only if user hasn't provided his own... */ + dm->dqb_btime = get_seconds() + dqi->dqi_bgrace; + } +@@ -2521,7 +2526,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) + dm->dqb_curinodes < dm->dqb_isoftlimit) { + dm->dqb_itime = 0; + clear_bit(DQ_INODES_B, &dquot->dq_flags); +- } else if (!(di->d_fieldmask & QC_INO_TIMER)) ++ } else if (!(di->d_fieldmask & FS_DQ_ITIMER)) + /* Set grace only if user hasn't provided his own... */ + dm->dqb_itime = get_seconds() + dqi->dqi_igrace; + } +@@ -2537,7 +2542,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) + } + + int dquot_set_dqblk(struct super_block *sb, struct kqid qid, +- struct qc_dqblk *di) ++ struct fs_disk_quota *di) + { + struct dquot *dquot; + int rc; +diff --git a/fs/quota/quota.c b/fs/quota/quota.c +index 47bd897..ff3f0b3 100644 +--- a/fs/quota/quota.c ++++ b/fs/quota/quota.c +@@ -115,27 +115,17 @@ static int quota_setinfo(struct super_block *sb, int type, void __user *addr) + return sb->s_qcop->set_info(sb, type, &info); + } + +-static inline qsize_t qbtos(qsize_t blocks) +-{ +- return blocks << QIF_DQBLKSIZE_BITS; +-} +- +-static inline qsize_t stoqb(qsize_t space) +-{ +- return (space + QIF_DQBLKSIZE - 1) >> QIF_DQBLKSIZE_BITS; +-} +- +-static void copy_to_if_dqblk(struct if_dqblk *dst, struct qc_dqblk *src) ++static void copy_to_if_dqblk(struct if_dqblk *dst, struct fs_disk_quota *src) + { + memset(dst, 0, sizeof(*dst)); +- dst->dqb_bhardlimit = stoqb(src->d_spc_hardlimit); +- dst->dqb_bsoftlimit = stoqb(src->d_spc_softlimit); +- dst->dqb_curspace = src->d_space; ++ dst->dqb_bhardlimit = src->d_blk_hardlimit; ++ dst->dqb_bsoftlimit = src->d_blk_softlimit; ++ dst->dqb_curspace = src->d_bcount; + dst->dqb_ihardlimit = src->d_ino_hardlimit; + dst->dqb_isoftlimit = src->d_ino_softlimit; +- dst->dqb_curinodes = src->d_ino_count; +- dst->dqb_btime = src->d_spc_timer; +- dst->dqb_itime = src->d_ino_timer; ++ dst->dqb_curinodes = src->d_icount; ++ dst->dqb_btime = src->d_btimer; ++ dst->dqb_itime = src->d_itimer; + dst->dqb_valid = QIF_ALL; + } + +@@ -143,7 +133,7 @@ static int quota_getquota(struct super_block *sb, int type, qid_t id, + void __user *addr) + { + struct kqid qid; +- struct qc_dqblk fdq; ++ struct fs_disk_quota fdq; + struct if_dqblk idq; + int ret; + +@@ -161,36 +151,36 @@ static int quota_getquota(struct super_block *sb, int type, qid_t id, + return 0; + } + +-static void copy_from_if_dqblk(struct qc_dqblk *dst, struct if_dqblk *src) ++static void copy_from_if_dqblk(struct fs_disk_quota *dst, struct if_dqblk *src) + { +- dst->d_spc_hardlimit = qbtos(src->dqb_bhardlimit); +- dst->d_spc_softlimit = qbtos(src->dqb_bsoftlimit); +- dst->d_space = src->dqb_curspace; ++ dst->d_blk_hardlimit = src->dqb_bhardlimit; ++ dst->d_blk_softlimit = src->dqb_bsoftlimit; ++ dst->d_bcount = src->dqb_curspace; + dst->d_ino_hardlimit = src->dqb_ihardlimit; + dst->d_ino_softlimit = src->dqb_isoftlimit; +- dst->d_ino_count = src->dqb_curinodes; +- dst->d_spc_timer = src->dqb_btime; +- dst->d_ino_timer = src->dqb_itime; ++ dst->d_icount = src->dqb_curinodes; ++ dst->d_btimer = src->dqb_btime; ++ dst->d_itimer = src->dqb_itime; + + dst->d_fieldmask = 0; + if (src->dqb_valid & QIF_BLIMITS) +- dst->d_fieldmask |= QC_SPC_SOFT | QC_SPC_HARD; ++ dst->d_fieldmask |= FS_DQ_BSOFT | FS_DQ_BHARD; + if (src->dqb_valid & QIF_SPACE) +- dst->d_fieldmask |= QC_SPACE; ++ dst->d_fieldmask |= FS_DQ_BCOUNT; + if (src->dqb_valid & QIF_ILIMITS) +- dst->d_fieldmask |= QC_INO_SOFT | QC_INO_HARD; ++ dst->d_fieldmask |= FS_DQ_ISOFT | FS_DQ_IHARD; + if (src->dqb_valid & QIF_INODES) +- dst->d_fieldmask |= QC_INO_COUNT; ++ dst->d_fieldmask |= FS_DQ_ICOUNT; + if (src->dqb_valid & QIF_BTIME) +- dst->d_fieldmask |= QC_SPC_TIMER; ++ dst->d_fieldmask |= FS_DQ_BTIMER; + if (src->dqb_valid & QIF_ITIME) +- dst->d_fieldmask |= QC_INO_TIMER; ++ dst->d_fieldmask |= FS_DQ_ITIMER; + } + + static int quota_setquota(struct super_block *sb, int type, qid_t id, + void __user *addr) + { +- struct qc_dqblk fdq; ++ struct fs_disk_quota fdq; + struct if_dqblk idq; + struct kqid qid; + +@@ -254,78 +244,10 @@ static int quota_getxstatev(struct super_block *sb, void __user *addr) + return ret; + } + +-/* +- * XFS defines BBTOB and BTOBB macros inside fs/xfs/ and we cannot move them +- * out of there as xfsprogs rely on definitions being in that header file. So +- * just define same functions here for quota purposes. +- */ +-#define XFS_BB_SHIFT 9 +- +-static inline u64 quota_bbtob(u64 blocks) +-{ +- return blocks << XFS_BB_SHIFT; +-} +- +-static inline u64 quota_btobb(u64 bytes) +-{ +- return (bytes + (1 << XFS_BB_SHIFT) - 1) >> XFS_BB_SHIFT; +-} +- +-static void copy_from_xfs_dqblk(struct qc_dqblk *dst, struct fs_disk_quota *src) +-{ +- dst->d_spc_hardlimit = quota_bbtob(src->d_blk_hardlimit); +- dst->d_spc_softlimit = quota_bbtob(src->d_blk_softlimit); +- dst->d_ino_hardlimit = src->d_ino_hardlimit; +- dst->d_ino_softlimit = src->d_ino_softlimit; +- dst->d_space = quota_bbtob(src->d_bcount); +- dst->d_ino_count = src->d_icount; +- dst->d_ino_timer = src->d_itimer; +- dst->d_spc_timer = src->d_btimer; +- dst->d_ino_warns = src->d_iwarns; +- dst->d_spc_warns = src->d_bwarns; +- dst->d_rt_spc_hardlimit = quota_bbtob(src->d_rtb_hardlimit); +- dst->d_rt_spc_softlimit = quota_bbtob(src->d_rtb_softlimit); +- dst->d_rt_space = quota_bbtob(src->d_rtbcount); +- dst->d_rt_spc_timer = src->d_rtbtimer; +- dst->d_rt_spc_warns = src->d_rtbwarns; +- dst->d_fieldmask = 0; +- if (src->d_fieldmask & FS_DQ_ISOFT) +- dst->d_fieldmask |= QC_INO_SOFT; +- if (src->d_fieldmask & FS_DQ_IHARD) +- dst->d_fieldmask |= QC_INO_HARD; +- if (src->d_fieldmask & FS_DQ_BSOFT) +- dst->d_fieldmask |= QC_SPC_SOFT; +- if (src->d_fieldmask & FS_DQ_BHARD) +- dst->d_fieldmask |= QC_SPC_HARD; +- if (src->d_fieldmask & FS_DQ_RTBSOFT) +- dst->d_fieldmask |= QC_RT_SPC_SOFT; +- if (src->d_fieldmask & FS_DQ_RTBHARD) +- dst->d_fieldmask |= QC_RT_SPC_HARD; +- if (src->d_fieldmask & FS_DQ_BTIMER) +- dst->d_fieldmask |= QC_SPC_TIMER; +- if (src->d_fieldmask & FS_DQ_ITIMER) +- dst->d_fieldmask |= QC_INO_TIMER; +- if (src->d_fieldmask & FS_DQ_RTBTIMER) +- dst->d_fieldmask |= QC_RT_SPC_TIMER; +- if (src->d_fieldmask & FS_DQ_BWARNS) +- dst->d_fieldmask |= QC_SPC_WARNS; +- if (src->d_fieldmask & FS_DQ_IWARNS) +- dst->d_fieldmask |= QC_INO_WARNS; +- if (src->d_fieldmask & FS_DQ_RTBWARNS) +- dst->d_fieldmask |= QC_RT_SPC_WARNS; +- if (src->d_fieldmask & FS_DQ_BCOUNT) +- dst->d_fieldmask |= QC_SPACE; +- if (src->d_fieldmask & FS_DQ_ICOUNT) +- dst->d_fieldmask |= QC_INO_COUNT; +- if (src->d_fieldmask & FS_DQ_RTBCOUNT) +- dst->d_fieldmask |= QC_RT_SPACE; +-} +- + static int quota_setxquota(struct super_block *sb, int type, qid_t id, + void __user *addr) + { + struct fs_disk_quota fdq; +- struct qc_dqblk qdq; + struct kqid qid; + + if (copy_from_user(&fdq, addr, sizeof(fdq))) +@@ -335,44 +257,13 @@ static int quota_setxquota(struct super_block *sb, int type, qid_t id, + qid = make_kqid(current_user_ns(), type, id); + if (!qid_valid(qid)) + return -EINVAL; +- copy_from_xfs_dqblk(&qdq, &fdq); +- return sb->s_qcop->set_dqblk(sb, qid, &qdq); +-} +- +-static void copy_to_xfs_dqblk(struct fs_disk_quota *dst, struct qc_dqblk *src, +- int type, qid_t id) +-{ +- memset(dst, 0, sizeof(*dst)); +- dst->d_version = FS_DQUOT_VERSION; +- dst->d_id = id; +- if (type == USRQUOTA) +- dst->d_flags = FS_USER_QUOTA; +- else if (type == PRJQUOTA) +- dst->d_flags = FS_PROJ_QUOTA; +- else +- dst->d_flags = FS_GROUP_QUOTA; +- dst->d_blk_hardlimit = quota_btobb(src->d_spc_hardlimit); +- dst->d_blk_softlimit = quota_btobb(src->d_spc_softlimit); +- dst->d_ino_hardlimit = src->d_ino_hardlimit; +- dst->d_ino_softlimit = src->d_ino_softlimit; +- dst->d_bcount = quota_btobb(src->d_space); +- dst->d_icount = src->d_ino_count; +- dst->d_itimer = src->d_ino_timer; +- dst->d_btimer = src->d_spc_timer; +- dst->d_iwarns = src->d_ino_warns; +- dst->d_bwarns = src->d_spc_warns; +- dst->d_rtb_hardlimit = quota_btobb(src->d_rt_spc_hardlimit); +- dst->d_rtb_softlimit = quota_btobb(src->d_rt_spc_softlimit); +- dst->d_rtbcount = quota_btobb(src->d_rt_space); +- dst->d_rtbtimer = src->d_rt_spc_timer; +- dst->d_rtbwarns = src->d_rt_spc_warns; ++ return sb->s_qcop->set_dqblk(sb, qid, &fdq); + } + + static int quota_getxquota(struct super_block *sb, int type, qid_t id, + void __user *addr) + { + struct fs_disk_quota fdq; +- struct qc_dqblk qdq; + struct kqid qid; + int ret; + +@@ -381,11 +272,8 @@ static int quota_getxquota(struct super_block *sb, int type, qid_t id, + qid = make_kqid(current_user_ns(), type, id); + if (!qid_valid(qid)) + return -EINVAL; +- ret = sb->s_qcop->get_dqblk(sb, qid, &qdq); +- if (ret) +- return ret; +- copy_to_xfs_dqblk(&fdq, &qdq, type, id); +- if (copy_to_user(addr, &fdq, sizeof(fdq))) ++ ret = sb->s_qcop->get_dqblk(sb, qid, &fdq); ++ if (!ret && copy_to_user(addr, &fdq, sizeof(fdq))) + return -EFAULT; + return ret; + } +diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h +index f251bed..797fd46 100644 +--- a/fs/xfs/xfs_qm.h ++++ b/fs/xfs/xfs_qm.h +@@ -167,9 +167,9 @@ extern void xfs_qm_dqrele_all_inodes(struct xfs_mount *, uint); + /* quota ops */ + extern int xfs_qm_scall_trunc_qfiles(struct xfs_mount *, uint); + extern int xfs_qm_scall_getquota(struct xfs_mount *, xfs_dqid_t, +- uint, struct qc_dqblk *); ++ uint, struct fs_disk_quota *); + extern int xfs_qm_scall_setqlim(struct xfs_mount *, xfs_dqid_t, uint, +- struct qc_dqblk *); ++ struct fs_disk_quota *); + extern int xfs_qm_scall_getqstat(struct xfs_mount *, + struct fs_quota_stat *); + extern int xfs_qm_scall_getqstatv(struct xfs_mount *, +diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c +index 670882e..bbc813c 100644 +--- a/fs/xfs/xfs_qm_syscalls.c ++++ b/fs/xfs/xfs_qm_syscalls.c +@@ -40,6 +40,7 @@ STATIC int xfs_qm_log_quotaoff(xfs_mount_t *, xfs_qoff_logitem_t **, uint); + STATIC int xfs_qm_log_quotaoff_end(xfs_mount_t *, xfs_qoff_logitem_t *, + uint); + STATIC uint xfs_qm_export_flags(uint); ++STATIC uint xfs_qm_export_qtype_flags(uint); + + /* + * Turn off quota accounting and/or enforcement for all udquots and/or +@@ -573,8 +574,8 @@ xfs_qm_scall_getqstatv( + return 0; + } + +-#define XFS_QC_MASK \ +- (QC_LIMIT_MASK | QC_TIMER_MASK | QC_WARNS_MASK) ++#define XFS_DQ_MASK \ ++ (FS_DQ_LIMIT_MASK | FS_DQ_TIMER_MASK | FS_DQ_WARNS_MASK) + + /* + * Adjust quota limits, and start/stop timers accordingly. +@@ -584,7 +585,7 @@ xfs_qm_scall_setqlim( + struct xfs_mount *mp, + xfs_dqid_t id, + uint type, +- struct qc_dqblk *newlim) ++ fs_disk_quota_t *newlim) + { + struct xfs_quotainfo *q = mp->m_quotainfo; + struct xfs_disk_dquot *ddq; +@@ -593,9 +594,9 @@ xfs_qm_scall_setqlim( + int error; + xfs_qcnt_t hard, soft; + +- if (newlim->d_fieldmask & ~XFS_QC_MASK) ++ if (newlim->d_fieldmask & ~XFS_DQ_MASK) + return EINVAL; +- if ((newlim->d_fieldmask & XFS_QC_MASK) == 0) ++ if ((newlim->d_fieldmask & XFS_DQ_MASK) == 0) + return 0; + + /* +@@ -633,11 +634,11 @@ xfs_qm_scall_setqlim( + /* + * Make sure that hardlimits are >= soft limits before changing. + */ +- hard = (newlim->d_fieldmask & QC_SPC_HARD) ? +- (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_hardlimit) : ++ hard = (newlim->d_fieldmask & FS_DQ_BHARD) ? ++ (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_hardlimit) : + be64_to_cpu(ddq->d_blk_hardlimit); +- soft = (newlim->d_fieldmask & QC_SPC_SOFT) ? +- (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_softlimit) : ++ soft = (newlim->d_fieldmask & FS_DQ_BSOFT) ? ++ (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_softlimit) : + be64_to_cpu(ddq->d_blk_softlimit); + if (hard == 0 || hard >= soft) { + ddq->d_blk_hardlimit = cpu_to_be64(hard); +@@ -650,11 +651,11 @@ xfs_qm_scall_setqlim( + } else { + xfs_debug(mp, "blkhard %Ld < blksoft %Ld", hard, soft); + } +- hard = (newlim->d_fieldmask & QC_RT_SPC_HARD) ? +- (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_hardlimit) : ++ hard = (newlim->d_fieldmask & FS_DQ_RTBHARD) ? ++ (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_hardlimit) : + be64_to_cpu(ddq->d_rtb_hardlimit); +- soft = (newlim->d_fieldmask & QC_RT_SPC_SOFT) ? +- (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_softlimit) : ++ soft = (newlim->d_fieldmask & FS_DQ_RTBSOFT) ? ++ (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_softlimit) : + be64_to_cpu(ddq->d_rtb_softlimit); + if (hard == 0 || hard >= soft) { + ddq->d_rtb_hardlimit = cpu_to_be64(hard); +@@ -667,10 +668,10 @@ xfs_qm_scall_setqlim( + xfs_debug(mp, "rtbhard %Ld < rtbsoft %Ld", hard, soft); + } + +- hard = (newlim->d_fieldmask & QC_INO_HARD) ? ++ hard = (newlim->d_fieldmask & FS_DQ_IHARD) ? + (xfs_qcnt_t) newlim->d_ino_hardlimit : + be64_to_cpu(ddq->d_ino_hardlimit); +- soft = (newlim->d_fieldmask & QC_INO_SOFT) ? ++ soft = (newlim->d_fieldmask & FS_DQ_ISOFT) ? + (xfs_qcnt_t) newlim->d_ino_softlimit : + be64_to_cpu(ddq->d_ino_softlimit); + if (hard == 0 || hard >= soft) { +@@ -687,12 +688,12 @@ xfs_qm_scall_setqlim( + /* + * Update warnings counter(s) if requested + */ +- if (newlim->d_fieldmask & QC_SPC_WARNS) +- ddq->d_bwarns = cpu_to_be16(newlim->d_spc_warns); +- if (newlim->d_fieldmask & QC_INO_WARNS) +- ddq->d_iwarns = cpu_to_be16(newlim->d_ino_warns); +- if (newlim->d_fieldmask & QC_RT_SPC_WARNS) +- ddq->d_rtbwarns = cpu_to_be16(newlim->d_rt_spc_warns); ++ if (newlim->d_fieldmask & FS_DQ_BWARNS) ++ ddq->d_bwarns = cpu_to_be16(newlim->d_bwarns); ++ if (newlim->d_fieldmask & FS_DQ_IWARNS) ++ ddq->d_iwarns = cpu_to_be16(newlim->d_iwarns); ++ if (newlim->d_fieldmask & FS_DQ_RTBWARNS) ++ ddq->d_rtbwarns = cpu_to_be16(newlim->d_rtbwarns); + + if (id == 0) { + /* +@@ -702,24 +703,24 @@ xfs_qm_scall_setqlim( + * soft and hard limit values (already done, above), and + * for warnings. + */ +- if (newlim->d_fieldmask & QC_SPC_TIMER) { +- q->qi_btimelimit = newlim->d_spc_timer; +- ddq->d_btimer = cpu_to_be32(newlim->d_spc_timer); ++ if (newlim->d_fieldmask & FS_DQ_BTIMER) { ++ q->qi_btimelimit = newlim->d_btimer; ++ ddq->d_btimer = cpu_to_be32(newlim->d_btimer); + } +- if (newlim->d_fieldmask & QC_INO_TIMER) { +- q->qi_itimelimit = newlim->d_ino_timer; +- ddq->d_itimer = cpu_to_be32(newlim->d_ino_timer); ++ if (newlim->d_fieldmask & FS_DQ_ITIMER) { ++ q->qi_itimelimit = newlim->d_itimer; ++ ddq->d_itimer = cpu_to_be32(newlim->d_itimer); + } +- if (newlim->d_fieldmask & QC_RT_SPC_TIMER) { +- q->qi_rtbtimelimit = newlim->d_rt_spc_timer; +- ddq->d_rtbtimer = cpu_to_be32(newlim->d_rt_spc_timer); ++ if (newlim->d_fieldmask & FS_DQ_RTBTIMER) { ++ q->qi_rtbtimelimit = newlim->d_rtbtimer; ++ ddq->d_rtbtimer = cpu_to_be32(newlim->d_rtbtimer); + } +- if (newlim->d_fieldmask & QC_SPC_WARNS) +- q->qi_bwarnlimit = newlim->d_spc_warns; +- if (newlim->d_fieldmask & QC_INO_WARNS) +- q->qi_iwarnlimit = newlim->d_ino_warns; +- if (newlim->d_fieldmask & QC_RT_SPC_WARNS) +- q->qi_rtbwarnlimit = newlim->d_rt_spc_warns; ++ if (newlim->d_fieldmask & FS_DQ_BWARNS) ++ q->qi_bwarnlimit = newlim->d_bwarns; ++ if (newlim->d_fieldmask & FS_DQ_IWARNS) ++ q->qi_iwarnlimit = newlim->d_iwarns; ++ if (newlim->d_fieldmask & FS_DQ_RTBWARNS) ++ q->qi_rtbwarnlimit = newlim->d_rtbwarns; + } else { + /* + * If the user is now over quota, start the timelimit. +@@ -830,7 +831,7 @@ xfs_qm_scall_getquota( + struct xfs_mount *mp, + xfs_dqid_t id, + uint type, +- struct qc_dqblk *dst) ++ struct fs_disk_quota *dst) + { + struct xfs_dquot *dqp; + int error; +@@ -854,25 +855,28 @@ xfs_qm_scall_getquota( + } + + memset(dst, 0, sizeof(*dst)); +- dst->d_spc_hardlimit = +- XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_hardlimit)); +- dst->d_spc_softlimit = +- XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); ++ dst->d_version = FS_DQUOT_VERSION; ++ dst->d_flags = xfs_qm_export_qtype_flags(dqp->q_core.d_flags); ++ dst->d_id = be32_to_cpu(dqp->q_core.d_id); ++ dst->d_blk_hardlimit = ++ XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_blk_hardlimit)); ++ dst->d_blk_softlimit = ++ XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); + dst->d_ino_hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit); + dst->d_ino_softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit); +- dst->d_space = XFS_FSB_TO_B(mp, dqp->q_res_bcount); +- dst->d_ino_count = dqp->q_res_icount; +- dst->d_spc_timer = be32_to_cpu(dqp->q_core.d_btimer); +- dst->d_ino_timer = be32_to_cpu(dqp->q_core.d_itimer); +- dst->d_ino_warns = be16_to_cpu(dqp->q_core.d_iwarns); +- dst->d_spc_warns = be16_to_cpu(dqp->q_core.d_bwarns); +- dst->d_rt_spc_hardlimit = +- XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); +- dst->d_rt_spc_softlimit = +- XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); +- dst->d_rt_space = XFS_FSB_TO_B(mp, dqp->q_res_rtbcount); +- dst->d_rt_spc_timer = be32_to_cpu(dqp->q_core.d_rtbtimer); +- dst->d_rt_spc_warns = be16_to_cpu(dqp->q_core.d_rtbwarns); ++ dst->d_bcount = XFS_FSB_TO_BB(mp, dqp->q_res_bcount); ++ dst->d_icount = dqp->q_res_icount; ++ dst->d_btimer = be32_to_cpu(dqp->q_core.d_btimer); ++ dst->d_itimer = be32_to_cpu(dqp->q_core.d_itimer); ++ dst->d_iwarns = be16_to_cpu(dqp->q_core.d_iwarns); ++ dst->d_bwarns = be16_to_cpu(dqp->q_core.d_bwarns); ++ dst->d_rtb_hardlimit = ++ XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); ++ dst->d_rtb_softlimit = ++ XFS_FSB_TO_BB(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); ++ dst->d_rtbcount = XFS_FSB_TO_BB(mp, dqp->q_res_rtbcount); ++ dst->d_rtbtimer = be32_to_cpu(dqp->q_core.d_rtbtimer); ++ dst->d_rtbwarns = be16_to_cpu(dqp->q_core.d_rtbwarns); + + /* + * Internally, we don't reset all the timers when quota enforcement +@@ -885,23 +889,23 @@ xfs_qm_scall_getquota( + dqp->q_core.d_flags == XFS_DQ_GROUP) || + (!XFS_IS_PQUOTA_ENFORCED(mp) && + dqp->q_core.d_flags == XFS_DQ_PROJ)) { +- dst->d_spc_timer = 0; +- dst->d_ino_timer = 0; +- dst->d_rt_spc_timer = 0; ++ dst->d_btimer = 0; ++ dst->d_itimer = 0; ++ dst->d_rtbtimer = 0; + } + + #ifdef DEBUG +- if (((XFS_IS_UQUOTA_ENFORCED(mp) && type == XFS_DQ_USER) || +- (XFS_IS_GQUOTA_ENFORCED(mp) && type == XFS_DQ_GROUP) || +- (XFS_IS_PQUOTA_ENFORCED(mp) && type == XFS_DQ_PROJ)) && +- id != 0) { +- if ((dst->d_space > dst->d_spc_softlimit) && +- (dst->d_spc_softlimit > 0)) { +- ASSERT(dst->d_spc_timer != 0); ++ if (((XFS_IS_UQUOTA_ENFORCED(mp) && dst->d_flags == FS_USER_QUOTA) || ++ (XFS_IS_GQUOTA_ENFORCED(mp) && dst->d_flags == FS_GROUP_QUOTA) || ++ (XFS_IS_PQUOTA_ENFORCED(mp) && dst->d_flags == FS_PROJ_QUOTA)) && ++ dst->d_id != 0) { ++ if ((dst->d_bcount > dst->d_blk_softlimit) && ++ (dst->d_blk_softlimit > 0)) { ++ ASSERT(dst->d_btimer != 0); + } +- if ((dst->d_ino_count > dst->d_ino_softlimit) && ++ if ((dst->d_icount > dst->d_ino_softlimit) && + (dst->d_ino_softlimit > 0)) { +- ASSERT(dst->d_ino_timer != 0); ++ ASSERT(dst->d_itimer != 0); + } + } + #endif +@@ -911,6 +915,26 @@ out_put: + } + + STATIC uint ++xfs_qm_export_qtype_flags( ++ uint flags) ++{ ++ /* ++ * Can't be more than one, or none. ++ */ ++ ASSERT((flags & (FS_PROJ_QUOTA | FS_USER_QUOTA)) != ++ (FS_PROJ_QUOTA | FS_USER_QUOTA)); ++ ASSERT((flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)) != ++ (FS_PROJ_QUOTA | FS_GROUP_QUOTA)); ++ ASSERT((flags & (FS_USER_QUOTA | FS_GROUP_QUOTA)) != ++ (FS_USER_QUOTA | FS_GROUP_QUOTA)); ++ ASSERT((flags & (FS_PROJ_QUOTA|FS_USER_QUOTA|FS_GROUP_QUOTA)) != 0); ++ ++ return (flags & XFS_DQ_USER) ? ++ FS_USER_QUOTA : (flags & XFS_DQ_PROJ) ? ++ FS_PROJ_QUOTA : FS_GROUP_QUOTA; ++} ++ ++STATIC uint + xfs_qm_export_flags( + uint flags) + { +diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c +index ece0f31..2ad1b98 100644 +--- a/fs/xfs/xfs_quotaops.c ++++ b/fs/xfs/xfs_quotaops.c +@@ -133,7 +133,7 @@ STATIC int + xfs_fs_get_dqblk( + struct super_block *sb, + struct kqid qid, +- struct qc_dqblk *qdq) ++ struct fs_disk_quota *fdq) + { + struct xfs_mount *mp = XFS_M(sb); + +@@ -143,14 +143,14 @@ xfs_fs_get_dqblk( + return -ESRCH; + + return -xfs_qm_scall_getquota(mp, from_kqid(&init_user_ns, qid), +- xfs_quota_type(qid.type), qdq); ++ xfs_quota_type(qid.type), fdq); + } + + STATIC int + xfs_fs_set_dqblk( + struct super_block *sb, + struct kqid qid, +- struct qc_dqblk *qdq) ++ struct fs_disk_quota *fdq) + { + struct xfs_mount *mp = XFS_M(sb); + +@@ -162,7 +162,7 @@ xfs_fs_set_dqblk( + return -ESRCH; + + return -xfs_qm_scall_setqlim(mp, from_kqid(&init_user_ns, qid), +- xfs_quota_type(qid.type), qdq); ++ xfs_quota_type(qid.type), fdq); + } + + const struct quotactl_ops xfs_quotactl_operations = { +diff --git a/include/linux/quota.h b/include/linux/quota.h +index 6724c12..0f3c5d3 100644 +--- a/include/linux/quota.h ++++ b/include/linux/quota.h +@@ -316,49 +316,6 @@ struct dquot_operations { + + struct path; + +-/* Structure for communicating via ->get_dqblk() & ->set_dqblk() */ +-struct qc_dqblk { +- int d_fieldmask; /* mask of fields to change in ->set_dqblk() */ +- u64 d_spc_hardlimit; /* absolute limit on used space */ +- u64 d_spc_softlimit; /* preferred limit on used space */ +- u64 d_ino_hardlimit; /* maximum # allocated inodes */ +- u64 d_ino_softlimit; /* preferred inode limit */ +- u64 d_space; /* Space owned by the user */ +- u64 d_ino_count; /* # inodes owned by the user */ +- s64 d_ino_timer; /* zero if within inode limits */ +- /* if not, we refuse service */ +- s64 d_spc_timer; /* similar to above; for space */ +- int d_ino_warns; /* # warnings issued wrt num inodes */ +- int d_spc_warns; /* # warnings issued wrt used space */ +- u64 d_rt_spc_hardlimit; /* absolute limit on realtime space */ +- u64 d_rt_spc_softlimit; /* preferred limit on RT space */ +- u64 d_rt_space; /* realtime space owned */ +- s64 d_rt_spc_timer; /* similar to above; for RT space */ +- int d_rt_spc_warns; /* # warnings issued wrt RT space */ +-}; +- +-/* Field specifiers for ->set_dqblk() in struct qc_dqblk */ +-#define QC_INO_SOFT (1<<0) +-#define QC_INO_HARD (1<<1) +-#define QC_SPC_SOFT (1<<2) +-#define QC_SPC_HARD (1<<3) +-#define QC_RT_SPC_SOFT (1<<4) +-#define QC_RT_SPC_HARD (1<<5) +-#define QC_LIMIT_MASK (QC_INO_SOFT | QC_INO_HARD | QC_SPC_SOFT | QC_SPC_HARD | \ +- QC_RT_SPC_SOFT | QC_RT_SPC_HARD) +-#define QC_SPC_TIMER (1<<6) +-#define QC_INO_TIMER (1<<7) +-#define QC_RT_SPC_TIMER (1<<8) +-#define QC_TIMER_MASK (QC_SPC_TIMER | QC_INO_TIMER | QC_RT_SPC_TIMER) +-#define QC_SPC_WARNS (1<<9) +-#define QC_INO_WARNS (1<<10) +-#define QC_RT_SPC_WARNS (1<<11) +-#define QC_WARNS_MASK (QC_SPC_WARNS | QC_INO_WARNS | QC_RT_SPC_WARNS) +-#define QC_SPACE (1<<12) +-#define QC_INO_COUNT (1<<13) +-#define QC_RT_SPACE (1<<14) +-#define QC_ACCT_MASK (QC_SPACE | QC_INO_COUNT | QC_RT_SPACE) +- + /* Operations handling requests from userspace */ + struct quotactl_ops { + int (*quota_on)(struct super_block *, int, int, struct path *); +@@ -367,8 +324,8 @@ struct quotactl_ops { + int (*quota_sync)(struct super_block *, int); + int (*get_info)(struct super_block *, int, struct if_dqinfo *); + int (*set_info)(struct super_block *, int, struct if_dqinfo *); +- int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); +- int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); ++ int (*get_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); ++ int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); + int (*get_xstate)(struct super_block *, struct fs_quota_stat *); + int (*set_xstate)(struct super_block *, unsigned int, int); + int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); +diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h +index bfaf713..1d3eee5 100644 +--- a/include/linux/quotaops.h ++++ b/include/linux/quotaops.h +@@ -98,9 +98,9 @@ int dquot_quota_sync(struct super_block *sb, int type); + int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); + int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); + int dquot_get_dqblk(struct super_block *sb, struct kqid id, +- struct qc_dqblk *di); ++ struct fs_disk_quota *di); + int dquot_set_dqblk(struct super_block *sb, struct kqid id, +- struct qc_dqblk *di); ++ struct fs_disk_quota *di); + + int __dquot_transfer(struct inode *inode, struct dquot **transfer_to); + int dquot_transfer(struct inode *inode, struct iattr *iattr); diff --git a/debian/patches/debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch b/debian/patches/debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch new file mode 100644 index 000000000..20f4e685d --- /dev/null +++ b/debian/patches/debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch @@ -0,0 +1,50 @@ +From: Ben Hutchings +Date: Mon, 23 Feb 2015 05:09:41 +0000 +Subject: rmap: Fix ABI change in 3.16.7-ckt5 +Forwarded: not-needed + +'mm: prevent endless growth of anon_vma hierarchy' in 3.16.7-ckt5 +added two new members to struct anon_vma. + +This structure is always allocated by anon_vma_alloc() so it is OK to +add members, but we need to add them at the end and hide them from +genksyms. + +--- a/include/linux/rmap.h ++++ b/include/linux/rmap.h +@@ -37,16 +37,6 @@ struct anon_vma { + atomic_t refcount; + + /* +- * Count of child anon_vmas and VMAs which points to this anon_vma. +- * +- * This counter is used for making decision about reusing anon_vma +- * instead of forking new one. See comments in function anon_vma_clone. +- */ +- unsigned degree; +- +- struct anon_vma *parent; /* Parent of this anon_vma */ +- +- /* + * NOTE: the LSB of the rb_root.rb_node is set by + * mm_take_all_locks() _after_ taking the above lock. So the + * rb_root must only be read/written after taking the above lock +@@ -55,6 +45,18 @@ struct anon_vma { + * mm_take_all_locks() (mm_all_locks_mutex). + */ + struct rb_root rb_root; /* Interval tree of private "related" vmas */ ++ ++#ifndef __GENKSYMS__ ++ /* ++ * Count of child anon_vmas and VMAs which points to this anon_vma. ++ * ++ * This counter is used for making decision about reusing anon_vma ++ * instead of forking new one. See comments in function anon_vma_clone. ++ */ ++ unsigned degree; ++ ++ struct anon_vma *parent; /* Parent of this anon_vma */ ++#endif + }; + + /* diff --git a/debian/patches/series b/debian/patches/series index 838b6f368..8c34c6200 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -493,3 +493,7 @@ features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch +debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch +debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch +debian/perf-fix-abi-change-in-3.16.7-ckt6.patch +debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch From 4cb54efeb94f526c88aef47fa90266e7bc126ee9 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 24 Feb 2015 22:24:10 +0000 Subject: [PATCH 15/32] [alpha] add package description for srm-modules udev package svn path=/dists/sid/linux/; revision=22420 --- debian/installer/alpha/package-list | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/installer/alpha/package-list b/debian/installer/alpha/package-list index 0f8a2d22f..3001ff12e 100644 --- a/debian/installer/alpha/package-list +++ b/debian/installer/alpha/package-list @@ -16,3 +16,10 @@ Depends: kernel-image, ata-modules, scsi-core-modules Package: fb-modules Depends: kernel-image, i2c-modules + +Package: srm-modules +Depends: kernel-image +Priority: standard +Description: SRM modules + This package contains the srm_env module which provides access to the SRM + environment. From 559d534a3848b91f23a316431fa564470cd15ae3 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 25 Feb 2015 01:21:31 +0000 Subject: [PATCH 16/32] Update to 3.16.7-ckt7 Fix/ignore ABI changes as appropriate. svn path=/dists/sid/linux/; revision=22422 --- debian/changelog | 34 +++++++- debian/config/defines | 2 + .../tcp-fix-abi-change-in-3.16.7-ckt7.patch | 84 +++++++++++++++++++ debian/patches/series | 1 + 4 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 debian/patches/debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch diff --git a/debian/changelog b/debian/changelog index 410cf9779..0f64f6011 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium +linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium * New upstream stable update: http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt5 @@ -127,6 +127,37 @@ linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium - memcg: remove extra newlines from memcg oom kill log (regression in 3.15) - ipv4: try to cache dst_entries which would cause a redirect (regression in 3.16) (CVE-2015-1465) + http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt7 + - [ppc64el] powerpc: add little endian flag to syscall_get_arch() + - [arm64] Fix up /proc/cpuinfo + - cifs: Complete oplock break jobs before closing file handle + (regression in 3.15) + - [arm64,or1k] lib/checksum.c: fix carry in csum_tcpudp_nofold + - [mips*] Fix kernel lockup or crash after CPU offline/online + - md/raid5: fix another livelock caused by non-aligned writes. + (regression in 3.16) + - drm/radeon: fix PLLs on RS880 and older v2 (regression in 3.15) + - [armhf/armmp-lpae] 8299/1: mm: ensure local active ASID is marked as + allocated on rollover + - PCI: Handle read-only BARs on AMD CS553x devices + (regression in 3.16.7-ckt4) + - mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range + - nilfs2: fix deadlock of segment constructor over I_SYNC flag + - ip: zero sockaddr returned on error queue + - net: rps: fix cpu unplug + - ipv6: stop sending PTB packets for MTU < 1280 + - udp_diag: Fix socket skipping within chain + - ping: Fix race in free in receive path + - net: don't OOPS on socket aio + - ipv4: tcp: get rid of ugly unicast_sock + - ppp: deflate: never return len larger than output buffer + - [x86] hyperv: Fix the error processing in netvsc_send() + - Bluetooth: ath3k: workaround the compatibility issue with xHCI controller + - ceph: introduce global empty snap context + - drm/vmwgfx: Don't use memory accounting for kernel-side fence objects + - net:socket: set msg_namelen to 0 if msg_name is passed as NULL in msghdr + struct from userland. + - virtio_pci: defer kfree until release callback [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) @@ -142,6 +173,7 @@ linux (3.16.7-ckt6-1) UNRELEASED; urgency=medium * rmap: Fix ABI change in 3.16.7-ckt5 * perf: Fix ABI change in 3.16.7-ckt6 * mm: Fix pagecache_get_page() ABI change in 3.16.7-ckt6 + * tcp: Fix ABI change in 3.16.7-ckt7 [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/config/defines b/debian/config/defines index 1e81d7559..f04e1cded 100644 --- a/debian/config/defines +++ b/debian/config/defines @@ -5,6 +5,8 @@ ignore-changes: module:arch/x86/kvm/kvm module:drivers/mtd/spi-nor/spi-nor module:drivers/net/wireless/iwlwifi/iwlwifi + module:sound/i2c/other/snd-ak4113 + module:sound/i2c/other/snd-ak4114 # Apparently not used OOT __add_pages __remove_pages diff --git a/debian/patches/debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch b/debian/patches/debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch new file mode 100644 index 000000000..31e4096eb --- /dev/null +++ b/debian/patches/debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch @@ -0,0 +1,84 @@ +From: Ben Hutchings +Date: Wed, 25 Feb 2015 00:29:03 +0000 +Subject: tcp: Fix ABI change in 3.16.7-ckt7 +Forwarded: not-needed + +Commit bdbbb8527b6f ('ipv4: tcp: get rid of ugly unicast_sock') +added netns_ipv4::tcp_sk. As struct netns_ipv4 is embedded in +struct net, we can't add any members there. Instead, move it +to the end of the containing structure and adjust its users +accordingly. + +--- +--- a/include/net/net_namespace.h ++++ b/include/net/net_namespace.h +@@ -130,6 +130,9 @@ struct net { + #endif + struct sock *diag_nlsk; + atomic_t fnhe_genid; ++#ifndef __GENKSYMS__ ++ struct sock * __percpu *tcp_sk; ++#endif + }; + + #include +--- a/include/net/netns/ipv4.h ++++ b/include/net/netns/ipv4.h +@@ -52,7 +52,6 @@ struct netns_ipv4 { + struct inet_peer_base *peers; + struct tcpm_hash_bucket *tcp_metrics_hash; + unsigned int tcp_metrics_hash_log; +- struct sock * __percpu *tcp_sk; + struct netns_frags frags; + #ifdef CONFIG_NETFILTER + struct xt_table *iptable_filter; +--- a/net/ipv4/tcp_ipv4.c ++++ b/net/ipv4/tcp_ipv4.c +@@ -684,7 +684,7 @@ static void tcp_v4_send_reset(struct soc + + net = dev_net(skb_dst(skb)->dev); + arg.tos = ip_hdr(skb)->tos; +- ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk), ++ ip_send_unicast_reply(*this_cpu_ptr(net->tcp_sk), + skb, ip_hdr(skb)->saddr, + ip_hdr(skb)->daddr, &arg, arg.iov[0].iov_len); + +@@ -768,7 +768,7 @@ static void tcp_v4_send_ack(struct sk_bu + if (oif) + arg.bound_dev_if = oif; + arg.tos = tos; +- ip_send_unicast_reply(*this_cpu_ptr(net->ipv4.tcp_sk), ++ ip_send_unicast_reply(*this_cpu_ptr(net->tcp_sk), + skb, ip_hdr(skb)->saddr, + ip_hdr(skb)->daddr, &arg, arg.iov[0].iov_len); + +@@ -2539,16 +2539,16 @@ static void __net_exit tcp_sk_exit(struc + int cpu; + + for_each_possible_cpu(cpu) +- inet_ctl_sock_destroy(*per_cpu_ptr(net->ipv4.tcp_sk, cpu)); +- free_percpu(net->ipv4.tcp_sk); ++ inet_ctl_sock_destroy(*per_cpu_ptr(net->tcp_sk, cpu)); ++ free_percpu(net->tcp_sk); + } + + static int __net_init tcp_sk_init(struct net *net) + { + int res, cpu; + +- net->ipv4.tcp_sk = alloc_percpu(struct sock *); +- if (!net->ipv4.tcp_sk) ++ net->tcp_sk = alloc_percpu(struct sock *); ++ if (!net->tcp_sk) + return -ENOMEM; + + for_each_possible_cpu(cpu) { +@@ -2558,7 +2558,7 @@ static int __net_init tcp_sk_init(struct + IPPROTO_TCP, net); + if (res) + goto fail; +- *per_cpu_ptr(net->ipv4.tcp_sk, cpu) = sk; ++ *per_cpu_ptr(net->tcp_sk, cpu) = sk; + } + net->ipv4.sysctl_tcp_ecn = 2; + return 0; diff --git a/debian/patches/series b/debian/patches/series index 8c34c6200..044b502b4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -497,3 +497,4 @@ debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch debian/perf-fix-abi-change-in-3.16.7-ckt6.patch debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch +debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch From 91c690d9b11fbd8f6e3835212b3584ec1ad1a000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 26 Feb 2015 21:34:04 +0000 Subject: [PATCH 17/32] Add support for Banana Pro, patch by Karsten Merker Taken as is from the bug report (#779311), just added a comment about the symbolic constants that are missing in 3.16. Verified that the three patches match the indicated upstream commits (apart from the above changes) svn path=/dists/sid/linux/; revision=22424 --- debian/changelog | 4 + ...n7i-Add-dts-file-for-Bananapro-board.patch | 296 ++++++++++++++++++ ...-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch | 39 +++ ...xi-Add-IR-controllers-on-A20-to-dtsi.patch | 41 +++ debian/patches/series | 3 + 5 files changed, 383 insertions(+) create mode 100644 debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch create mode 100644 debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch create mode 100644 debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch diff --git a/debian/changelog b/debian/changelog index 0f64f6011..37a53d649 100644 --- a/debian/changelog +++ b/debian/changelog @@ -178,6 +178,10 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium [ Helge Deller ] * [alpha] build debian-installer udeb packages + [ Uwe Kleine-König ] + * Add support for Bananapro board, thanks Karsten Merker for the patch. + (Closes: 779311) + -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 linux (3.16.7-ckt4-3) unstable; urgency=medium diff --git a/debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch b/debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch new file mode 100644 index 000000000..fdc0a5677 --- /dev/null +++ b/debian/patches/features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch @@ -0,0 +1,296 @@ +From 10662a33dcd97f27004779df7e9188c124bc7076 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 18 Jan 2015 13:08:19 +0100 +Subject: ARM: dts: sun7i: Add dts file for Bananapro board +Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=10662a33dcd97f27004779df7e9188c124bc7076 + +Add support for the new Bananapro A20 development board from lemaker.org. +This board features 1G RAM, 2 USB A receptacles, 1 micro USB receptacle for +OTG, 1 micro USB receptacle for power, HDMI, sata, Gbit ethernet, ir receiver, +3.5 mm jack for a/v out, on board microphone, 40 gpio pins and sdio wifi. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +[Karsten Merker: replace SUN4I_PINCTRL_10_MA, SUN4I_PINCTRL_NO_PULL and +SUN4I_PINCTRL_PULL_UP with their corresponding values as these symbols are not +yet defined in 3.16.] + +Index: linux-3.16.7-ckt7/arch/arm/boot/dts/Makefile +=================================================================== +--- linux-3.16.7-ckt7.orig/arch/arm/boot/dts/Makefile ++++ linux-3.16.7-ckt7/arch/arm/boot/dts/Makefile +@@ -377,6 +377,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ + sun6i-a31-m9.dtb + dtb-$(CONFIG_MACH_SUN7I) += \ + sun7i-a20-bananapi.dtb \ ++ sun7i-a20-bananapro.dtb \ + sun7i-a20-cubieboard2.dtb \ + sun7i-a20-cubietruck.dtb \ + sun7i-a20-i12-tvbox.dtb \ +Index: linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20-bananapro.dts +=================================================================== +--- /dev/null ++++ linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20-bananapro.dts +@@ -0,0 +1,262 @@ ++/* ++ * Copyright 2015 Hans de Goede ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file 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 file 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 file; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun7i-a20.dtsi" ++#include "sunxi-common-regulators.dtsi" ++#include ++#include ++ ++/ { ++ model = "LeMaker Banana Pro"; ++ compatible = "lemaker,bananapro", "allwinner,sun7i-a20"; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&led_pins_bananapro>; ++ ++ blue { ++ label = "bananapro:blue:usr"; ++ gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ green { ++ label = "bananapro:green:usr"; ++ gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac_power_pin_bananapro>; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vmmc3: vmmc3 { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vmmc3_pin_bananapro>; ++ regulator-name = "vmmc3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ enable-active-high; ++ gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++&ahci { ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&gmac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac_pins_rgmii_a>; ++ phy = <&phy1>; ++ phy-mode = "rgmii"; ++ phy-supply = <®_gmac_3v3>; ++ status = "okay"; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "okay"; ++ ++ axp209: pmic@34 { ++ compatible = "x-powers,axp209"; ++ reg = <0x34>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ }; ++}; ++ ++&i2c2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c2_pins_a>; ++ status = "okay"; ++}; ++ ++&ir0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir0_pins_a>; ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapro>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc3_pins_a>; ++ vmmc-supply = <®_vmmc3>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&pio { ++ gmac_power_pin_bananapro: gmac_power_pin@0 { ++ allwinner,pins = "PH23"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <0>; ++ allwinner,pull = <0>; ++ }; ++ ++ led_pins_bananapro: led_pins@0 { ++ allwinner,pins = "PH24", "PG2"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <0>; ++ allwinner,pull = <0>; ++ }; ++ ++ mmc0_cd_pin_bananapro: mmc0_cd_pin@0 { ++ allwinner,pins = "PH10"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = <0>; ++ allwinner,pull = <1>; ++ }; ++ ++ usb1_vbus_pin_bananapro: usb1_vbus_pin@0 { ++ allwinner,pins = "PH0"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <0>; ++ allwinner,pull = <0>; ++ }; ++ ++ usb2_vbus_pin_bananapro: usb2_vbus_pin@0 { ++ allwinner,pins = "PH1"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <0>; ++ allwinner,pull = <0>; ++ }; ++ ++ vmmc3_pin_bananapro: vmmc3_pin@0 { ++ allwinner,pins = "PH22"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = <0>; ++ allwinner,pull = <0>; ++ }; ++}; ++ ++®_usb1_vbus { ++ pinctrl-0 = <&usb1_vbus_pin_bananapro>; ++ gpio = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ ++ status = "okay"; ++}; ++ ++®_usb2_vbus { ++ pinctrl-0 = <&usb2_vbus_pin_bananapro>; ++ gpio = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ ++ status = "okay"; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins_a>; ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pins_a>; ++ status = "okay"; ++}; ++ ++&uart7 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart7_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_usb1_vbus>; ++ usb2_vbus-supply = <®_usb2_vbus>; ++ status = "okay"; ++}; diff --git a/debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch b/debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch new file mode 100644 index 000000000..4613091a5 --- /dev/null +++ b/debian/patches/features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch @@ -0,0 +1,39 @@ +From 1715a389949a4a3f03192268dfb3ac5710f2dd3c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 30 Jun 2014 23:57:54 +0200 +Subject: ARM: dts: sun7i: Rename sun7i-a20-ir to sun4i-a10-ir +Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=1715a389949a4a3f03192268dfb3ac5710f2dd3c + +The sun7i block is the same as the one in the sun4i, rename the compatible +to reflect this. + +Signed-off-by: Hans de Goede + +-- + +I've already included the matching change to sunxi-cir.c in my pull-req to +Mauro. +Signed-off-by: Maxime Ripard + +Index: linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi +=================================================================== +--- linux-3.16.7-ckt7.orig/arch/arm/boot/dts/sun7i-a20.dtsi ++++ linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -800,7 +800,7 @@ + }; + + ir0: ir@01c21800 { +- compatible = "allwinner,sun7i-a20-ir"; ++ compatible = "allwinner,sun4i-a10-ir"; + clocks = <&apb0_gates 6>, <&ir0_clk>; + clock-names = "apb", "ir"; + interrupts = <0 5 4>; +@@ -809,7 +809,7 @@ + }; + + ir1: ir@01c21c00 { +- compatible = "allwinner,sun7i-a20-ir"; ++ compatible = "allwinner,sun4i-a10-ir"; + clocks = <&apb0_gates 7>, <&ir1_clk>; + clock-names = "apb", "ir"; + interrupts = <0 6 4>; diff --git a/debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch b/debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch new file mode 100644 index 000000000..e2c4e4071 --- /dev/null +++ b/debian/patches/features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch @@ -0,0 +1,41 @@ +From c1a0ee3d5322d488c539e20d40db88b181628670 Mon Sep 17 00:00:00 2001 +From: Alexander Bersenev +Date: Sat, 21 Jun 2014 17:04:05 +0600 +Subject: ARM: sunxi: Add IR controllers on A20 to dtsi +Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=c1a0ee3d5322d488c539e20d40db88b181628670 + +This patch adds records for two IR controllers on A20 + +Signed-off-by: Alexander Bersenev +Signed-off-by: Alexsey Shestacov +Signed-off-by: Maxime Ripard + +Index: linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi +=================================================================== +--- linux-3.16.7-ckt7.orig/arch/arm/boot/dts/sun7i-a20.dtsi ++++ linux-3.16.7-ckt7/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -799,6 +799,24 @@ + status = "disabled"; + }; + ++ ir0: ir@01c21800 { ++ compatible = "allwinner,sun7i-a20-ir"; ++ clocks = <&apb0_gates 6>, <&ir0_clk>; ++ clock-names = "apb", "ir"; ++ interrupts = <0 5 4>; ++ reg = <0x01c21800 0x40>; ++ status = "disabled"; ++ }; ++ ++ ir1: ir@01c21c00 { ++ compatible = "allwinner,sun7i-a20-ir"; ++ clocks = <&apb0_gates 7>, <&ir1_clk>; ++ clock-names = "apb", "ir"; ++ interrupts = <0 6 4>; ++ reg = <0x01c21c00 0x40>; ++ status = "disabled"; ++ }; ++ + sid: eeprom@01c23800 { + compatible = "allwinner,sun7i-a20-sid"; + reg = <0x01c23800 0x200>; diff --git a/debian/patches/series b/debian/patches/series index 044b502b4..fceef9096 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -107,6 +107,9 @@ features/arm/dts-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME.patch features/arm/dts-sun7i-Add-board-support-for-LinkSprite-pcDuino-V3.patch features/arm/dts-sun7i-pcduino3-Relicense-the-device-tree-under-GPLv2-X11.patch features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch +features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch +features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch +features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch features/arm64/drivers-net-Add-APM-X-Gene-SoC-ethernet-driver-suppo.patch features/arm64/drivers-net-NET_XGENE-should-depend-on-HAS_DMA.patch features/arm64/net-xgene-Check-negative-return-value-of-xgene_enet_.patch From fdb3e959b0b96a60a11f430dbc39c4bc5e820980 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 27 Feb 2015 08:54:43 +0000 Subject: [PATCH 18/32] [alpha] udeb: drop vmxnet3 and pcmcia, add virtio modules svn path=/dists/sid/linux/; revision=22425 --- debian/installer/alpha/modules/alpha-generic/nic-modules | 1 + debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules | 1 - debian/installer/alpha/modules/alpha-generic/pcmcia-modules | 1 - debian/installer/alpha/modules/alpha-generic/virtio-modules | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 debian/installer/alpha/modules/alpha-generic/virtio-modules diff --git a/debian/installer/alpha/modules/alpha-generic/nic-modules b/debian/installer/alpha/modules/alpha-generic/nic-modules index 2512e8395..851f0ac36 100644 --- a/debian/installer/alpha/modules/alpha-generic/nic-modules +++ b/debian/installer/alpha/modules/alpha-generic/nic-modules @@ -1 +1,2 @@ #include +vmxnet3 - diff --git a/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules b/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules index 7a0702cd5..e69de29bb 100644 --- a/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules +++ b/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules @@ -1 +0,0 @@ -#include diff --git a/debian/installer/alpha/modules/alpha-generic/pcmcia-modules b/debian/installer/alpha/modules/alpha-generic/pcmcia-modules index 2bb5350fe..e69de29bb 100644 --- a/debian/installer/alpha/modules/alpha-generic/pcmcia-modules +++ b/debian/installer/alpha/modules/alpha-generic/pcmcia-modules @@ -1 +0,0 @@ -#include diff --git a/debian/installer/alpha/modules/alpha-generic/virtio-modules b/debian/installer/alpha/modules/alpha-generic/virtio-modules new file mode 100644 index 000000000..61da39659 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/virtio-modules @@ -0,0 +1 @@ +#include From b999cc5ba46b7b03e6c619a2666347775b16b795 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 27 Feb 2015 09:20:25 +0000 Subject: [PATCH 19/32] [hppa] build virtio udeb packages svn path=/dists/sid/linux/; revision=22426 --- debian/changelog | 1 + debian/installer/hppa/modules/hppa-parisc64-smp/virtio-modules | 1 + debian/installer/hppa/modules/hppa/virtio-modules | 1 + 3 files changed, 3 insertions(+) create mode 100644 debian/installer/hppa/modules/hppa-parisc64-smp/virtio-modules create mode 100644 debian/installer/hppa/modules/hppa/virtio-modules diff --git a/debian/changelog b/debian/changelog index 37a53d649..9c9cdfdfa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -177,6 +177,7 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium [ Helge Deller ] * [alpha] build debian-installer udeb packages + * [hppa] build virtio udeb packages [ Uwe Kleine-König ] * Add support for Bananapro board, thanks Karsten Merker for the patch. diff --git a/debian/installer/hppa/modules/hppa-parisc64-smp/virtio-modules b/debian/installer/hppa/modules/hppa-parisc64-smp/virtio-modules new file mode 100644 index 000000000..2f4e67a8a --- /dev/null +++ b/debian/installer/hppa/modules/hppa-parisc64-smp/virtio-modules @@ -0,0 +1 @@ +#include "../hppa/virtio-modules" diff --git a/debian/installer/hppa/modules/hppa/virtio-modules b/debian/installer/hppa/modules/hppa/virtio-modules new file mode 100644 index 000000000..61da39659 --- /dev/null +++ b/debian/installer/hppa/modules/hppa/virtio-modules @@ -0,0 +1 @@ +#include From 4e740c6b04f673231f4a26d5314e36f3b614b95c Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 27 Feb 2015 09:44:33 +0000 Subject: [PATCH 20/32] [alpha] drop alpha-legacy kernel svn path=/dists/sid/linux/; revision=22427 --- debian/config/alpha/config.alpha-legacy | 10 ---------- debian/config/alpha/defines | 6 +----- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 debian/config/alpha/config.alpha-legacy diff --git a/debian/config/alpha/config.alpha-legacy b/debian/config/alpha/config.alpha-legacy deleted file mode 100644 index 256ad21e0..000000000 --- a/debian/config/alpha/config.alpha-legacy +++ /dev/null @@ -1,10 +0,0 @@ -## -## file: arch/alpha/Kconfig -## -# CONFIG_SMP is not set - -## -## file: arch/alpha/Kconfig.debug -## -CONFIG_ALPHA_LEGACY_START_ADDRESS=y - diff --git a/debian/config/alpha/defines b/debian/config/alpha/defines index f9b61ffa0..971b7f0dd 100644 --- a/debian/config/alpha/defines +++ b/debian/config/alpha/defines @@ -1,5 +1,5 @@ [base] -flavours: alpha-generic alpha-smp alpha-legacy +flavours: alpha-generic alpha-smp kernel-arch: alpha [build] @@ -16,7 +16,3 @@ hardware-long: DEC Alpha systems with extended kernel start address (Wildfire, T [alpha-smp_description] hardware: Alpha SMP hardware-long: DEC Alpha SMP systems with extended kernel start address (Wildfire, Titan, Marvel) - -[alpha-legacy_description] -hardware: Alpha Legacy -hardware-long: DEC Alpha systems with legacy kernel start address From be95361530d5b403f266c19ca3713306de34dfaa Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 27 Feb 2015 13:31:54 +0000 Subject: [PATCH 21/32] [alpha] fix pcmcia modules, add scsi-extra-modules svn path=/dists/sid/linux/; revision=22428 --- debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules | 1 + debian/installer/alpha/modules/alpha-generic/pcmcia-modules | 1 + debian/installer/alpha/modules/alpha-generic/scsi-extra-modules | 1 + 3 files changed, 3 insertions(+) create mode 100644 debian/installer/alpha/modules/alpha-generic/scsi-extra-modules diff --git a/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules b/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules index e69de29bb..7a0702cd5 100644 --- a/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules +++ b/debian/installer/alpha/modules/alpha-generic/nic-pcmcia-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/pcmcia-modules b/debian/installer/alpha/modules/alpha-generic/pcmcia-modules index e69de29bb..2bb5350fe 100644 --- a/debian/installer/alpha/modules/alpha-generic/pcmcia-modules +++ b/debian/installer/alpha/modules/alpha-generic/pcmcia-modules @@ -0,0 +1 @@ +#include diff --git a/debian/installer/alpha/modules/alpha-generic/scsi-extra-modules b/debian/installer/alpha/modules/alpha-generic/scsi-extra-modules new file mode 100644 index 000000000..cd13edec5 --- /dev/null +++ b/debian/installer/alpha/modules/alpha-generic/scsi-extra-modules @@ -0,0 +1 @@ +#include From 30d5866ed621cc83553ba2301e89f166ac85701a Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sat, 28 Feb 2015 16:17:12 +0000 Subject: [PATCH 22/32] [armhf] Enable FB_SIMPLE on sunxi platform, backporting fixes and DTS entries. svn path=/dists/sid/linux/; revision=22429 --- debian/changelog | 2 + ...port-for-enumerating-simplefb-dt-nod.patch | 60 ++++++ ...simplefb_init-from-module_init-to-fs.patch | 36 ++++ ...ld-errors-when-CONFIG_COMMON_CLK-is-.patch | 39 ++++ .../simplefb-Fix-build-failure-on-Sparc.patch | 33 ++++ .../simplefb-add-clock-handling-code.patch | 185 ++++++++++++++++++ ...implefb-add-goto-error-path-to-probe.patch | 75 +++++++ ...fb-formalize-pseudo-palette-handling.patch | 90 +++++++++ ...d-simplefb-node-with-de_fe0-de_be0-l.patch | 44 +++++ .../arm/ARM-dts-sun4i-Add-simplefb-node.patch | 40 ++++ .../arm/ARM-dts-sun5i-Add-simplefb-node.patch | 40 ++++ .../arm/ARM-dts-sun6i-Add-simplefb-node.patch | 38 ++++ .../arm/ARM-dts-sun7i-Add-simplefb-node.patch | 40 ++++ ...d-de_be0-clk-parent-pll-to-simplefb-.patch | 80 ++++++++ ...d-simplefb-nodes-for-de_be0-lcd0-de_.patch | 149 ++++++++++++++ ...date-simplefb-nodes-so-that-u-boot-c.patch | 93 +++++++++ debian/patches/series | 15 ++ 17 files changed, 1059 insertions(+) create mode 100644 debian/patches/features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch create mode 100644 debian/patches/features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch create mode 100644 debian/patches/features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch create mode 100644 debian/patches/features/all/simplefb-Fix-build-failure-on-Sparc.patch create mode 100644 debian/patches/features/all/simplefb-add-clock-handling-code.patch create mode 100644 debian/patches/features/all/simplefb-add-goto-error-path-to-probe.patch create mode 100644 debian/patches/features/all/simplefb-formalize-pseudo-palette-handling.patch create mode 100644 debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node-with-de_fe0-de_be0-l.patch create mode 100644 debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node.patch create mode 100644 debian/patches/features/arm/ARM-dts-sun5i-Add-simplefb-node.patch create mode 100644 debian/patches/features/arm/ARM-dts-sun6i-Add-simplefb-node.patch create mode 100644 debian/patches/features/arm/ARM-dts-sun7i-Add-simplefb-node.patch create mode 100644 debian/patches/features/arm/ARM-dts-sunxi-Add-de_be0-clk-parent-pll-to-simplefb-.patch create mode 100644 debian/patches/features/arm/ARM-dts-sunxi-Add-simplefb-nodes-for-de_be0-lcd0-de_.patch create mode 100644 debian/patches/features/arm/ARM-dts-sunxi-Update-simplefb-nodes-so-that-u-boot-c.patch diff --git a/debian/changelog b/debian/changelog index 9c9cdfdfa..c023294f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -162,6 +162,8 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium [ Ian Campbell ] * [armhf] Add DTB for Olimex A20-OLinuXino-LIME2. (Closes: #777455) * [armhf] Enable CONFIG_BACKLIGHT_GPIO as a module. (Closes: #778783) + * [armhf] Enable FB_SIMPLE on sunxi platform, backporting fixes and DTS + entries. [ Ben Hutchings ] * shm: add memfd.h to UAPI export list, so kdbus will build diff --git a/debian/patches/features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch b/debian/patches/features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch new file mode 100644 index 000000000..6d057d67a --- /dev/null +++ b/debian/patches/features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch @@ -0,0 +1,60 @@ +From f819ccbe992cfec6081acef7c5a06d770178b03e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 14 Nov 2014 13:26:53 +0100 +Subject: [PATCH 04/15] simplefb: Add support for enumerating simplefb dt nodes + in /chosen +Origin: https://git.kernel.org/linus/89c95001c00089836415aa7a78848ec2dec9f922 + +Update simplefb to support the new preferred location for simplefb dt nodes +under /chosen. + +Signed-off-by: Hans de Goede +Signed-off-by: Tomi Valkeinen +--- + drivers/video/fbdev/simplefb.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index d192946..74c5edd 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + static struct fb_fix_screeninfo simplefb_fix = { + .id = "simple", +@@ -392,7 +393,27 @@ static struct platform_driver simplefb_driver = { + .probe = simplefb_probe, + .remove = simplefb_remove, + }; +-module_platform_driver(simplefb_driver); ++ ++static int __init simplefb_init(void) ++{ ++ int ret; ++ struct device_node *np; ++ ++ ret = platform_driver_register(&simplefb_driver); ++ if (ret) ++ return ret; ++ ++ if (IS_ENABLED(CONFIG_OF) && of_chosen) { ++ for_each_child_of_node(of_chosen, np) { ++ if (of_device_is_compatible(np, "simple-framebuffer")) ++ of_platform_device_create(np, NULL, NULL); ++ } ++ } ++ ++ return 0; ++} ++ ++module_init(simplefb_init); + + MODULE_AUTHOR("Stephen Warren "); + MODULE_DESCRIPTION("Simple framebuffer driver"); +-- +2.1.4 + diff --git a/debian/patches/features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch b/debian/patches/features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch new file mode 100644 index 000000000..6a2b34a07 --- /dev/null +++ b/debian/patches/features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch @@ -0,0 +1,36 @@ +From 4fe57f1608272587892d50c524d98f96d311b115 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 14 Nov 2014 13:26:55 +0100 +Subject: [PATCH 05/15] simplefb: Change simplefb_init from module_init to + fs_initcall +Origin: https://git.kernel.org/linus/0c5b240c7e0a7af56afd24db6570fa84d67728c2 + +One of the reasons for having the simplefb nodes in /chosen, and doing +explicit enumeration of the nodes there, is too allow enumerating them sooner, +so that we get a console earlier on. + +Doing this earlier then fs_initcall is not useful, since the fb only turns +into a console when fbcon intializes, which is a fs_initcall too. + +Signed-off-by: Hans de Goede +Signed-off-by: Tomi Valkeinen +--- + drivers/video/fbdev/simplefb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index 74c5edd..8be9754 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -413,7 +413,7 @@ static int __init simplefb_init(void) + return 0; + } + +-module_init(simplefb_init); ++fs_initcall(simplefb_init); + + MODULE_AUTHOR("Stephen Warren "); + MODULE_DESCRIPTION("Simple framebuffer driver"); +-- +2.1.4 + diff --git a/debian/patches/features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch b/debian/patches/features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch new file mode 100644 index 000000000..e580de10c --- /dev/null +++ b/debian/patches/features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch @@ -0,0 +1,39 @@ +From b516039bf5ce5464bc9a6eefac50c87415c9f318 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 25 Nov 2014 12:13:30 +0100 +Subject: [PATCH 06/15] simplefb: Fix build errors when CONFIG_COMMON_CLK is + not defined +Origin: https://git.kernel.org/linus/8284731eb59e843a0608baf18828e0ad0d7f9d79 + +Both CONFIG_OF and CONFIG_COMMON_CLK must be defined to be able to use of +clocks. + +Signed-off-by: Hans de Goede +Signed-off-by: Tomi Valkeinen +--- + drivers/video/fbdev/simplefb.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index 8be9754..b2ae925 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -169,13 +169,13 @@ static int simplefb_parse_pd(struct platform_device *pdev, + + struct simplefb_par { + u32 palette[PSEUDO_PALETTE_SIZE]; +-#ifdef CONFIG_OF ++#if defined CONFIG_OF && defined CONFIG_COMMON_CLK + int clk_count; + struct clk **clks; + #endif + }; + +-#ifdef CONFIG_OF ++#if defined CONFIG_OF && defined CONFIG_COMMON_CLK + /* + * Clock handling code. + * +-- +2.1.4 + diff --git a/debian/patches/features/all/simplefb-Fix-build-failure-on-Sparc.patch b/debian/patches/features/all/simplefb-Fix-build-failure-on-Sparc.patch new file mode 100644 index 000000000..f8be3228b --- /dev/null +++ b/debian/patches/features/all/simplefb-Fix-build-failure-on-Sparc.patch @@ -0,0 +1,33 @@ +From 28f3658954b8a749d9c7109b20f69019dd671252 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 5 Jan 2015 09:15:16 +0100 +Subject: [PATCH 07/15] simplefb: Fix build failure on Sparc +Origin: https://git.kernel.org/linus/d9e020197d371c90ad56cc4be388fc95e0c08e6f + +of_platform_device_create is only defined when CONFIG_OF_ADDRESS is set, +which is normally always the case when CONFIG_OF is defined, except on Sparc, +so explicitly check for CONFIG_OF_ADDRESS rather then for CONFIG_OF. + +Reported-by: kbuild test robot +Signed-off-by: Hans de Goede +Signed-off-by: Tomi Valkeinen +--- + drivers/video/fbdev/simplefb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index b2ae925..c90503c 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -403,7 +403,7 @@ static int __init simplefb_init(void) + if (ret) + return ret; + +- if (IS_ENABLED(CONFIG_OF) && of_chosen) { ++ if (IS_ENABLED(CONFIG_OF_ADDRESS) && of_chosen) { + for_each_child_of_node(of_chosen, np) { + if (of_device_is_compatible(np, "simple-framebuffer")) + of_platform_device_create(np, NULL, NULL); +-- +2.1.4 + diff --git a/debian/patches/features/all/simplefb-add-clock-handling-code.patch b/debian/patches/features/all/simplefb-add-clock-handling-code.patch new file mode 100644 index 000000000..e3f05d1fe --- /dev/null +++ b/debian/patches/features/all/simplefb-add-clock-handling-code.patch @@ -0,0 +1,185 @@ +From 26007c1238d7923f0ef8ff7aed10ed89ee5ef5c5 Mon Sep 17 00:00:00 2001 +From: Luc Verhaegen +Date: Fri, 14 Nov 2014 13:26:50 +0100 +Subject: [PATCH 03/15] simplefb: add clock handling code +Origin: https://git.kernel.org/linus/fc219bfd5b2e488e3c246990869cfde5ca235c89 + +This claims and enables clocks listed in the simple framebuffer dt node. +This is needed so that the display engine, in case the required clocks +are known by the kernel code and are described in the dt, will remain +properly enabled. + +Signed-off-by: Luc Verhaegen +[hdegoede@redhat.com: Change clks from list to dynamic array] +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Acked-by: Geert Uytterhoeven +Reviewed-by: Maxime Ripard +Reviewed-by: David Herrmann +Acked-by: Grant Likely +Signed-off-by: Tomi Valkeinen + +--- + drivers/video/fbdev/simplefb.c | 108 ++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 107 insertions(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index cdcf1fe..d192946 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + static struct fb_fix_screeninfo simplefb_fix = { + .id = "simple", +@@ -167,8 +168,105 @@ static int simplefb_parse_pd(struct platform_device *pdev, + + struct simplefb_par { + u32 palette[PSEUDO_PALETTE_SIZE]; ++#ifdef CONFIG_OF ++ int clk_count; ++ struct clk **clks; ++#endif + }; + ++#ifdef CONFIG_OF ++/* ++ * Clock handling code. ++ * ++ * Here we handle the clocks property of our "simple-framebuffer" dt node. ++ * This is necessary so that we can make sure that any clocks needed by ++ * the display engine that the bootloader set up for us (and for which it ++ * provided a simplefb dt node), stay up, for the life of the simplefb ++ * driver. ++ * ++ * When the driver unloads, we cleanly disable, and then release the clocks. ++ * ++ * We only complain about errors here, no action is taken as the most likely ++ * error can only happen due to a mismatch between the bootloader which set ++ * up simplefb, and the clock definitions in the device tree. Chances are ++ * that there are no adverse effects, and if there are, a clean teardown of ++ * the fb probe will not help us much either. So just complain and carry on, ++ * and hope that the user actually gets a working fb at the end of things. ++ */ ++static int simplefb_clocks_init(struct simplefb_par *par, ++ struct platform_device *pdev) ++{ ++ struct device_node *np = pdev->dev.of_node; ++ struct clk *clock; ++ int i, ret; ++ ++ if (dev_get_platdata(&pdev->dev) || !np) ++ return 0; ++ ++ par->clk_count = of_clk_get_parent_count(np); ++ if (par->clk_count <= 0) ++ return 0; ++ ++ par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL); ++ if (!par->clks) ++ return -ENOMEM; ++ ++ for (i = 0; i < par->clk_count; i++) { ++ clock = of_clk_get(np, i); ++ if (IS_ERR(clock)) { ++ if (PTR_ERR(clock) == -EPROBE_DEFER) { ++ while (--i >= 0) { ++ if (par->clks[i]) ++ clk_put(par->clks[i]); ++ } ++ kfree(par->clks); ++ return -EPROBE_DEFER; ++ } ++ dev_err(&pdev->dev, "%s: clock %d not found: %ld\n", ++ __func__, i, PTR_ERR(clock)); ++ continue; ++ } ++ par->clks[i] = clock; ++ } ++ ++ for (i = 0; i < par->clk_count; i++) { ++ if (par->clks[i]) { ++ ret = clk_prepare_enable(par->clks[i]); ++ if (ret) { ++ dev_err(&pdev->dev, ++ "%s: failed to enable clock %d: %d\n", ++ __func__, i, ret); ++ clk_put(par->clks[i]); ++ par->clks[i] = NULL; ++ } ++ } ++ } ++ ++ return 0; ++} ++ ++static void simplefb_clocks_destroy(struct simplefb_par *par) ++{ ++ int i; ++ ++ if (!par->clks) ++ return; ++ ++ for (i = 0; i < par->clk_count; i++) { ++ if (par->clks[i]) { ++ clk_disable_unprepare(par->clks[i]); ++ clk_put(par->clks[i]); ++ } ++ } ++ ++ kfree(par->clks); ++} ++#else ++static int simplefb_clocks_init(struct simplefb_par *par, ++ struct platform_device *pdev) { return 0; } ++static void simplefb_clocks_destroy(struct simplefb_par *par) { } ++#endif ++ + static int simplefb_probe(struct platform_device *pdev) + { + int ret; +@@ -236,6 +334,10 @@ static int simplefb_probe(struct platform_device *pdev) + } + info->pseudo_palette = par->palette; + ++ ret = simplefb_clocks_init(par, pdev); ++ if (ret < 0) ++ goto error_unmap; ++ + dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n", + info->fix.smem_start, info->fix.smem_len, + info->screen_base); +@@ -247,13 +349,15 @@ static int simplefb_probe(struct platform_device *pdev) + ret = register_framebuffer(info); + if (ret < 0) { + dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret); +- goto error_unmap; ++ goto error_clocks; + } + + dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node); + + return 0; + ++error_clocks: ++ simplefb_clocks_destroy(par); + error_unmap: + iounmap(info->screen_base); + error_fb_release: +@@ -264,8 +368,10 @@ error_fb_release: + static int simplefb_remove(struct platform_device *pdev) + { + struct fb_info *info = platform_get_drvdata(pdev); ++ struct simplefb_par *par = info->par; + + unregister_framebuffer(info); ++ simplefb_clocks_destroy(par); + framebuffer_release(info); + + return 0; +-- +2.1.4 + diff --git a/debian/patches/features/all/simplefb-add-goto-error-path-to-probe.patch b/debian/patches/features/all/simplefb-add-goto-error-path-to-probe.patch new file mode 100644 index 000000000..b2897a9d6 --- /dev/null +++ b/debian/patches/features/all/simplefb-add-goto-error-path-to-probe.patch @@ -0,0 +1,75 @@ +From e57f8f9adc3d2924c8bf312a66786885c84cd06c Mon Sep 17 00:00:00 2001 +From: Luc Verhaegen +Date: Fri, 14 Nov 2014 13:26:49 +0100 +Subject: [PATCH 02/15] simplefb: add goto error path to probe +Origin: https://git.kernel.org/linus/bf2fda157a9ab50f65da60a365ede3a5b529d025 + +Use the usual kernel style of goto error_foo to free resources on probe +error. This is a preparation patch for adding clocks support. + +While at it also update ioremap_wc error return from ENODEV to ENOMEM. + +Signed-off-by: Luc Verhaegen +Acked-by: Stephen Warren +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Acked-by: Geert Uytterhoeven +Reviewed-by: Maxime Ripard +Reviewed-by: David Herrmann +Acked-by: Grant Likely +Signed-off-by: Tomi Valkeinen +--- + drivers/video/fbdev/simplefb.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index ec112c1..cdcf1fe 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -220,8 +220,8 @@ static int simplefb_probe(struct platform_device *pdev) + + info->apertures = alloc_apertures(1); + if (!info->apertures) { +- framebuffer_release(info); +- return -ENOMEM; ++ ret = -ENOMEM; ++ goto error_fb_release; + } + info->apertures->ranges[0].base = info->fix.smem_start; + info->apertures->ranges[0].size = info->fix.smem_len; +@@ -231,8 +231,8 @@ static int simplefb_probe(struct platform_device *pdev) + info->screen_base = ioremap_wc(info->fix.smem_start, + info->fix.smem_len); + if (!info->screen_base) { +- framebuffer_release(info); +- return -ENODEV; ++ ret = -ENOMEM; ++ goto error_fb_release; + } + info->pseudo_palette = par->palette; + +@@ -247,14 +247,18 @@ static int simplefb_probe(struct platform_device *pdev) + ret = register_framebuffer(info); + if (ret < 0) { + dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret); +- iounmap(info->screen_base); +- framebuffer_release(info); +- return ret; ++ goto error_unmap; + } + + dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node); + + return 0; ++ ++error_unmap: ++ iounmap(info->screen_base); ++error_fb_release: ++ framebuffer_release(info); ++ return ret; + } + + static int simplefb_remove(struct platform_device *pdev) +-- +2.1.4 + diff --git a/debian/patches/features/all/simplefb-formalize-pseudo-palette-handling.patch b/debian/patches/features/all/simplefb-formalize-pseudo-palette-handling.patch new file mode 100644 index 000000000..6a88d2870 --- /dev/null +++ b/debian/patches/features/all/simplefb-formalize-pseudo-palette-handling.patch @@ -0,0 +1,90 @@ +From a3bf3921e8e032943cf39f17daa30d35f412e365 Mon Sep 17 00:00:00 2001 +From: Luc Verhaegen +Date: Fri, 14 Nov 2014 13:26:48 +0100 +Subject: [PATCH 01/15] simplefb: formalize pseudo palette handling +Origin: https://git.kernel.org/linus/1270be4a4fb852630280638cbb169b67c485b3e3 + +Add a proper struct describing simplefb private data, with the palette in there, +instead of directly storing the palette in the fb_info->par pointer. + +Signed-off-by: Luc Verhaegen +Acked-by: Stephen Warren +[hdegoede@redhat.com: drop unnecessary void * cast] +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Acked-by: Geert Uytterhoeven +Reviewed-by: Maxime Ripard +Reviewed-by: David Herrmann +Acked-by: Grant Likely +Signed-off-by: Tomi Valkeinen + +--- + drivers/video/fbdev/simplefb.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c +index 210f3a0..ec112c1 100644 +--- a/drivers/video/fbdev/simplefb.c ++++ b/drivers/video/fbdev/simplefb.c +@@ -41,6 +41,8 @@ static struct fb_var_screeninfo simplefb_var = { + .vmode = FB_VMODE_NONINTERLACED, + }; + ++#define PSEUDO_PALETTE_SIZE 16 ++ + static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, + u_int transp, struct fb_info *info) + { +@@ -50,7 +52,7 @@ static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, + u32 cb = blue >> (16 - info->var.blue.length); + u32 value; + +- if (regno >= 16) ++ if (regno >= PSEUDO_PALETTE_SIZE) + return -EINVAL; + + value = (cr << info->var.red.offset) | +@@ -163,11 +165,16 @@ static int simplefb_parse_pd(struct platform_device *pdev, + return 0; + } + ++struct simplefb_par { ++ u32 palette[PSEUDO_PALETTE_SIZE]; ++}; ++ + static int simplefb_probe(struct platform_device *pdev) + { + int ret; + struct simplefb_params params; + struct fb_info *info; ++ struct simplefb_par *par; + struct resource *mem; + + if (fb_get_options("simplefb", NULL)) +@@ -188,11 +195,13 @@ static int simplefb_probe(struct platform_device *pdev) + return -EINVAL; + } + +- info = framebuffer_alloc(sizeof(u32) * 16, &pdev->dev); ++ info = framebuffer_alloc(sizeof(struct simplefb_par), &pdev->dev); + if (!info) + return -ENOMEM; + platform_set_drvdata(pdev, info); + ++ par = info->par; ++ + info->fix = simplefb_fix; + info->fix.smem_start = mem->start; + info->fix.smem_len = resource_size(mem); +@@ -225,7 +234,7 @@ static int simplefb_probe(struct platform_device *pdev) + framebuffer_release(info); + return -ENODEV; + } +- info->pseudo_palette = (void *)(info + 1); ++ info->pseudo_palette = par->palette; + + dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n", + info->fix.smem_start, info->fix.smem_len, +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node-with-de_fe0-de_be0-l.patch b/debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node-with-de_fe0-de_be0-l.patch new file mode 100644 index 000000000..5f7c0faf0 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node-with-de_fe0-de_be0-l.patch @@ -0,0 +1,44 @@ +From 5429cd33ae8abeada683b08bab6d13f6227e2734 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 19 Jan 2015 14:01:17 +0100 +Subject: [PATCH 14/15] ARM: dts: sun4i: Add simplefb node with + de_fe0-de_be0-lcd0-hdmi pipeline +Origin: https://git.kernel.org/linus/8cedd6628472aa2d8f2f54dfcc36633e46a59db8 + +Testing has shown that on sun4i the display backend engine does not have +deep enough fifo-s causing flickering / tearing in full-hd mode due to +fifo underruns. This can be avoided by letting the display frontend engine +do the dma from memory, and then letting it feed the data directly into +the backend unmodified, as the frontend does have deep enough fifo-s. + +Note since u-boot-v2015.01 has been released using the de_be0-lcd0-hdmi +pipeline on sun4i, we need to keep that one around too (unfortunately). + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi +index a9a657c..7e3e5dd 100644 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -39,6 +39,14 @@ + <&ahb_gates 44>; + status = "disabled"; + }; ++ ++ framebuffer@1 { ++ compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; ++ allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, ++ <&ahb_gates 44>, <&ahb_gates 46>; ++ status = "disabled"; ++ }; + }; + + cpus { +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node.patch b/debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node.patch new file mode 100644 index 000000000..c55edba58 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun4i-Add-simplefb-node.patch @@ -0,0 +1,40 @@ +From 1924660efb8ad8b0dfe6c16e3f9b865489617bc1 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 14 Nov 2014 16:34:34 +0100 +Subject: [PATCH 08/15] ARM: dts: sun4i: Add simplefb node +Origin: https://git.kernel.org/linus/5790d4ee1e425fefef0e012d1415c25baeb9dae8 + +Add a simplefb template node for u-boot to further fill and activate. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi +index d96e179..8aa412f 100644 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -27,6 +27,18 @@ + serial7 = &uart7; + }; + ++ chosen { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ framebuffer0-hdmi { ++ compatible = "simple-framebuffer"; ++ clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; ++ status = "disabled"; ++ }; ++ }; ++ + cpus { + #address-cells = <1>; + #size-cells = <0>; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun5i-Add-simplefb-node.patch b/debian/patches/features/arm/ARM-dts-sun5i-Add-simplefb-node.patch new file mode 100644 index 000000000..f2fd66741 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun5i-Add-simplefb-node.patch @@ -0,0 +1,40 @@ +From 8b6ded18e0b025919bf6f99f2ec0cb579a40e099 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 14 Nov 2014 16:34:35 +0100 +Subject: [PATCH 09/15] ARM: dts: sun5i: Add simplefb node +Origin: https://git.kernel.org/linus/d501841fc42a97a8b69449135eadf6e9c4589a87 + +Add a simplefb template node for u-boot to further fill and activate. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun5i-a10s.dtsi | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi +index b64f705..3b0ea26 100644 +--- a/arch/arm/boot/dts/sun5i-a10s.dtsi ++++ b/arch/arm/boot/dts/sun5i-a10s.dtsi +@@ -24,6 +24,18 @@ + serial3 = &uart3; + }; + ++ chosen { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ framebuffer0-hdmi { ++ compatible = "simple-framebuffer"; ++ clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; ++ status = "disabled"; ++ }; ++ }; ++ + cpus { + cpu@0 { + compatible = "arm,cortex-a8"; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun6i-Add-simplefb-node.patch b/debian/patches/features/arm/ARM-dts-sun6i-Add-simplefb-node.patch new file mode 100644 index 000000000..482748584 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun6i-Add-simplefb-node.patch @@ -0,0 +1,38 @@ +From 81d90d6cc2132414c9af30c49b487651a03f4c82 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 14 Nov 2014 16:34:36 +0100 +Subject: [PATCH 10/15] ARM: dts: sun6i: Add simplefb node +Origin: https://git.kernel.org/linus/e53a8b2201384ee1a2cfd1609c9ffdf951b041a1 + +Add a simplefb template node for u-boot to further fill and activate. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun6i-a31.dtsi | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi +index a9dfa12..eedb1e0 100644 +--- a/arch/arm/boot/dts/sun6i-a31.dtsi ++++ b/arch/arm/boot/dts/sun6i-a31.dtsi +@@ -25,6 +25,16 @@ + serial5 = &uart5; + }; + ++ chosen { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ framebuffer0-hdmi { ++ compatible = "simple-framebuffer"; ++ status = "disabled"; ++ }; ++ }; + + cpus { + enable-method = "allwinner,sun6i-a31"; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun7i-Add-simplefb-node.patch b/debian/patches/features/arm/ARM-dts-sun7i-Add-simplefb-node.patch new file mode 100644 index 000000000..a27e60a58 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun7i-Add-simplefb-node.patch @@ -0,0 +1,40 @@ +From 0c484cbb0f590f457abbe6616d817cd623b382fa Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 14 Nov 2014 16:34:37 +0100 +Subject: [PATCH 11/15] ARM: dts: sun7i: Add simplefb node +Origin: https://git.kernel.org/linus/8efc5c2be5b29f7ceec83bb471da81690273e141 + +Add a simplefb template node for u-boot to further fill and activate. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun7i-a20.dtsi | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi +index 01e9466..bb01f9b 100644 +--- a/arch/arm/boot/dts/sun7i-a20.dtsi ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -28,6 +28,18 @@ + serial7 = &uart7; + }; + ++ chosen { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ framebuffer0-hdmi { ++ compatible = "simple-framebuffer"; ++ clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; ++ status = "disabled"; ++ }; ++ }; ++ + cpus { + #address-cells = <1>; + #size-cells = <0>; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sunxi-Add-de_be0-clk-parent-pll-to-simplefb-.patch b/debian/patches/features/arm/ARM-dts-sunxi-Add-de_be0-clk-parent-pll-to-simplefb-.patch new file mode 100644 index 000000000..5abef53f0 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sunxi-Add-de_be0-clk-parent-pll-to-simplefb-.patch @@ -0,0 +1,80 @@ +From 0c9c7408537a543b10035434d79842651f540d7d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 16 Nov 2014 17:09:32 +0100 +Subject: [PATCH 12/15] ARM: dts: sunxi: Add de_be0 clk parent pll to simplefb + node +Origin: https://git.kernel.org/linus/678e75d3e5526bee1b09f0e916096ec7f7d35c8e + +Avoid the parent pll for the mod-clk for de_be0 getting disabled when non of +the other users are enabled (which can happen when none of i2c, spi and mmc +are in use). + +Note for now we point directly to the parent rather then to the de_be0 mod-clk +as that is not modelled in our devicetree yet. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 3 ++- + arch/arm/boot/dts/sun5i-a10s.dtsi | 3 ++- + arch/arm/boot/dts/sun6i-a31.dtsi | 1 + + arch/arm/boot/dts/sun7i-a20.dtsi | 3 ++- + 4 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi +index 8aa412f..e6aaad6 100644 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -34,7 +34,8 @@ + + framebuffer0-hdmi { + compatible = "simple-framebuffer"; +- clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, ++ <&ahb_gates 44>; + status = "disabled"; + }; + }; +diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi +index 3b0ea26..7b9bb3f 100644 +--- a/arch/arm/boot/dts/sun5i-a10s.dtsi ++++ b/arch/arm/boot/dts/sun5i-a10s.dtsi +@@ -31,7 +31,8 @@ + + framebuffer0-hdmi { + compatible = "simple-framebuffer"; +- clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, ++ <&ahb_gates 44>; + status = "disabled"; + }; + }; +diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi +index eedb1e0..842d2e6 100644 +--- a/arch/arm/boot/dts/sun6i-a31.dtsi ++++ b/arch/arm/boot/dts/sun6i-a31.dtsi +@@ -32,6 +32,7 @@ + + framebuffer0-hdmi { + compatible = "simple-framebuffer"; ++ clocks = <&pll6 0>; + status = "disabled"; + }; + }; +diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi +index bb01f9b..c120b4f 100644 +--- a/arch/arm/boot/dts/sun7i-a20.dtsi ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -35,7 +35,8 @@ + + framebuffer0-hdmi { + compatible = "simple-framebuffer"; +- clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, ++ <&ahb_gates 44>; + status = "disabled"; + }; + }; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sunxi-Add-simplefb-nodes-for-de_be0-lcd0-de_.patch b/debian/patches/features/arm/ARM-dts-sunxi-Add-simplefb-nodes-for-de_be0-lcd0-de_.patch new file mode 100644 index 000000000..b0a36ac56 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sunxi-Add-simplefb-nodes-for-de_be0-lcd0-de_.patch @@ -0,0 +1,149 @@ +From fc020448ed2abd7d649153e248e3ec08d17ae1f5 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 19 Jan 2015 14:05:12 +0100 +Subject: [PATCH 15/15] ARM: dts: sunxi: Add simplefb nodes for de_be0-lcd0, + de_be0-lcd0-tve0 pipelines +Origin: https://git.kernel.org/linus/fd18c7eac03540654abdbfedd52e6dfb3718b489 + +Add simplefb nodes for "[de_fe0-]de_be0-lcd0" and "[de_fe0-]de_be0-lcd0-tve0" +display pipelines for when u-boot has set up a pipeline to drive a LCD panel / +VGA output rather then the HDMI output. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard + +Conflicts: + arch/arm/boot/dts/sun8i-a23.dtsi + +[ ijc -- dropped arch/arm/boot/dts/sun8i-a23.dtsi changes, not in baseline ] +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 18 ++++++++++++++++++ + arch/arm/boot/dts/sun5i-a10s.dtsi | 8 ++++++++ + arch/arm/boot/dts/sun5i-a13.dtsi | 14 ++++++++++++++ + arch/arm/boot/dts/sun6i-a31.dtsi | 8 ++++++++ + arch/arm/boot/dts/sun7i-a20.dtsi | 17 +++++++++++++++++ + 5 files changed, 65 insertions(+) + +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi +index 7e3e5dd..eae8bfd 100644 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -47,6 +47,24 @@ + <&ahb_gates 44>, <&ahb_gates 46>; + status = "disabled"; + }; ++ ++ framebuffer@2 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_fe0-de_be0-lcd0"; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, ++ <&ahb_gates 46>; ++ status = "disabled"; ++ }; ++ ++ framebuffer@3 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; ++ clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, ++ <&ahb_gates 44>, <&ahb_gates 46>; ++ status = "disabled"; ++ }; + }; + + cpus { +diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi +index 245a25b..95bbfea 100644 +--- a/arch/arm/boot/dts/sun5i-a10s.dtsi ++++ b/arch/arm/boot/dts/sun5i-a10s.dtsi +@@ -36,6 +36,14 @@ + <&ahb_gates 44>; + status = "disabled"; + }; ++ ++ framebuffer@1 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0"; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; ++ status = "disabled"; ++ }; + }; + + cpus { +diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi +index 3b2a94c..a194c1e 100644 +--- a/arch/arm/boot/dts/sun5i-a13.dtsi ++++ b/arch/arm/boot/dts/sun5i-a13.dtsi +@@ -21,6 +21,20 @@ + serial1 = &uart3; + }; + ++ chosen { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ ++ framebuffer@0 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0"; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; ++ status = "disabled"; ++ }; ++ }; ++ + cpus { + #address-cells = <1>; + #size-cells = <0>; +diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi +index fe2c938..90cc322 100644 +--- a/arch/arm/boot/dts/sun6i-a31.dtsi ++++ b/arch/arm/boot/dts/sun6i-a31.dtsi +@@ -36,6 +36,14 @@ + clocks = <&pll6 0>; + status = "disabled"; + }; ++ ++ framebuffer@1 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0"; ++ clocks = <&pll6 0>; ++ status = "disabled"; ++ }; + }; + + cpus { +diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi +index e31ae3a..7d47914 100644 +--- a/arch/arm/boot/dts/sun7i-a20.dtsi ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -40,6 +40,23 @@ + <&ahb_gates 44>; + status = "disabled"; + }; ++ ++ framebuffer@1 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0"; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; ++ status = "disabled"; ++ }; ++ ++ framebuffer@2 { ++ compatible = "allwinner,simple-framebuffer", ++ "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0-tve0"; ++ clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, ++ <&ahb_gates 44>; ++ status = "disabled"; ++ }; + }; + + cpus { +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sunxi-Update-simplefb-nodes-so-that-u-boot-c.patch b/debian/patches/features/arm/ARM-dts-sunxi-Update-simplefb-nodes-so-that-u-boot-c.patch new file mode 100644 index 000000000..9ea913398 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sunxi-Update-simplefb-nodes-so-that-u-boot-c.patch @@ -0,0 +1,93 @@ +From cba654240791a0ac72310f0ba840f48a377277a3 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 18 Nov 2014 12:07:13 +0100 +Subject: [PATCH 13/15] ARM: dts: sunxi: Update simplefb nodes so that u-boot + can find them +Origin: https://git.kernel.org/linus/a9f8cda32a3acc3150755fe973f7fa1867a7a5d6 + +Review of the u-boot sunxi simplefb patches has led to the decision that +u-boot should not use a specific path to find the nodes as this goes contrary +to how devicetree usually works. + +Instead a platform specific compatible + properties should be used for this. + +The simplefb bindings have already been updated to reflect this, this patch +brings the sunxi devicetree files in line with the new binding, and the +actual u-boot implementation as it is going upstream. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 5 +++-- + arch/arm/boot/dts/sun5i-a10s.dtsi | 5 +++-- + arch/arm/boot/dts/sun6i-a31.dtsi | 5 +++-- + arch/arm/boot/dts/sun7i-a20.dtsi | 5 +++-- + 4 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi +index e6aaad6..a9a657c 100644 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -32,8 +32,9 @@ + #size-cells = <1>; + ranges; + +- framebuffer0-hdmi { +- compatible = "simple-framebuffer"; ++ framebuffer@0 { ++ compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0-hdmi"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, + <&ahb_gates 44>; + status = "disabled"; +diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi +index 7b9bb3f..245a25b 100644 +--- a/arch/arm/boot/dts/sun5i-a10s.dtsi ++++ b/arch/arm/boot/dts/sun5i-a10s.dtsi +@@ -29,8 +29,9 @@ + #size-cells = <1>; + ranges; + +- framebuffer0-hdmi { +- compatible = "simple-framebuffer"; ++ framebuffer@0 { ++ compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0-hdmi"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, + <&ahb_gates 44>; + status = "disabled"; +diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi +index 842d2e6..fe2c938 100644 +--- a/arch/arm/boot/dts/sun6i-a31.dtsi ++++ b/arch/arm/boot/dts/sun6i-a31.dtsi +@@ -30,8 +30,9 @@ + #size-cells = <1>; + ranges; + +- framebuffer0-hdmi { +- compatible = "simple-framebuffer"; ++ framebuffer@0 { ++ compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0-hdmi"; + clocks = <&pll6 0>; + status = "disabled"; + }; +diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi +index c120b4f..e31ae3a 100644 +--- a/arch/arm/boot/dts/sun7i-a20.dtsi ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -33,8 +33,9 @@ + #size-cells = <1>; + ranges; + +- framebuffer0-hdmi { +- compatible = "simple-framebuffer"; ++ framebuffer@0 { ++ compatible = "allwinner,simple-framebuffer", "simple-framebuffer"; ++ allwinner,pipeline = "de_be0-lcd0-hdmi"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, + <&ahb_gates 44>; + status = "disabled"; +-- +2.1.4 + diff --git a/debian/patches/series b/debian/patches/series index fceef9096..142844a83 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -110,6 +110,14 @@ features/arm/dts-sun7i-Add-support-for-A20-OLinuXino-Lime2.patch features/arm/dts-sunxi-Add-IR-controllers-on-A20-to-dtsi.patch features/arm/dts-sun7i-Rename-sun7i-a20-ir-to-sun4i-a10-ir.patch features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch +features/arm/ARM-dts-sun4i-Add-simplefb-node.patch +features/arm/ARM-dts-sun5i-Add-simplefb-node.patch +features/arm/ARM-dts-sun6i-Add-simplefb-node.patch +features/arm/ARM-dts-sun7i-Add-simplefb-node.patch +features/arm/ARM-dts-sunxi-Add-de_be0-clk-parent-pll-to-simplefb-.patch +features/arm/ARM-dts-sunxi-Update-simplefb-nodes-so-that-u-boot-c.patch +features/arm/ARM-dts-sun4i-Add-simplefb-node-with-de_fe0-de_be0-l.patch +features/arm/ARM-dts-sunxi-Add-simplefb-nodes-for-de_be0-lcd0-de_.patch features/arm64/drivers-net-Add-APM-X-Gene-SoC-ethernet-driver-suppo.patch features/arm64/drivers-net-NET_XGENE-should-depend-on-HAS_DMA.patch features/arm64/net-xgene-Check-negative-return-value-of-xgene_enet_.patch @@ -190,6 +198,13 @@ features/all/of-correct-of_console_check-s-return-value.patch features/all/of-add-optional-options-parameter-to-of_find_node_by.patch features/all/of-support-passing-console-options-with-stdout-path.patch features/all/efi-expose-underlying-uefi-firmware-platform-size-to.patch +features/all/simplefb-formalize-pseudo-palette-handling.patch +features/all/simplefb-add-goto-error-path-to-probe.patch +features/all/simplefb-add-clock-handling-code.patch +features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch +features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch +features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch +features/all/simplefb-Fix-build-failure-on-Sparc.patch # Update r8723au to 3.17 features/all/r8723au/0001-staging-rtl8723au-rtw_get_wps_ie23a-Remove-unused-de.patch From 2826e488d1dea19e0465c7b55fefc5b47ce2ba3d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 03:14:33 +0000 Subject: [PATCH 23/32] [x86] ACPI / video: Add disable_native_backlight quirk for various Samsung models and Dell XPS15 L521X (Closes: #772440) svn path=/dists/sid/linux/; revision=22431 --- debian/changelog | 2 + ...ative_backlight-quirk-for-dell-xps15.patch | 34 ++++++++++++ ...ive_backlight-quirk-for-samsung-510r.patch | 35 +++++++++++++ ...ight-quirk-for-samsung-730u3e-740u3e.patch | 34 ++++++++++++ ...ome-samsung-models-to-disable_native.patch | 52 +++++++++++++++++++ ...native-backlight-on-samsung-series-9.patch | 46 ++++++++++++++++ debian/patches/series | 5 ++ 7 files changed, 208 insertions(+) create mode 100644 debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch create mode 100644 debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch create mode 100644 debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch create mode 100644 debian/patches/bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch create mode 100644 debian/patches/bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch diff --git a/debian/changelog b/debian/changelog index c023294f0..7ff851b2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -176,6 +176,8 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium * perf: Fix ABI change in 3.16.7-ckt6 * mm: Fix pagecache_get_page() ABI change in 3.16.7-ckt6 * tcp: Fix ABI change in 3.16.7-ckt7 + * [x86] ACPI / video: Add disable_native_backlight quirk for various + Samsung models and Dell XPS15 L521X (Closes: #772440) [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch b/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch new file mode 100644 index 000000000..541c3b5fd --- /dev/null +++ b/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch @@ -0,0 +1,34 @@ +From: Hans de Goede +Date: Mon, 5 Jan 2015 08:57:04 +0100 +Subject: ACPI / video: Add disable_native_backlight quirk for Dell XPS15 L521X +Origin: https://git.kernel.org/linus/6a3ef10bacb08860805e9053f919786dc34760ba + +The L521X variant of the Dell XPS15 has integrated nvidia graphics, and +backlight control does not work properly when using the native interfaces. + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1163574 +Signed-off-by: Hans de Goede +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/video.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -711,6 +711,16 @@ static struct dmi_system_id video_dmi_ta + DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"), + }, + }, ++ ++ { ++ /* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */ ++ .callback = video_disable_native_backlight, ++ .ident = "Dell XPS15 L521X", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "XPS L521X"), ++ }, ++ }, + {} + }; + diff --git a/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch b/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch new file mode 100644 index 000000000..b76698b5e --- /dev/null +++ b/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch @@ -0,0 +1,35 @@ +From: Hans de Goede +Date: Sat, 7 Feb 2015 09:53:53 +0100 +Subject: ACPI / video: Add disable_native_backlight quirk for Samsung 510R +Origin: https://git.kernel.org/linus/e77a16355a29230b99bafe55834a8252e55308ec + +Backlight control through the native intel interface does not work properly +on the Samsung 510R, where as using the acpi_video interface does work, add +a quirk for this. + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1186097 +Cc: All applicable +Signed-off-by: Hans de Goede +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/video.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -712,6 +712,15 @@ static struct dmi_system_id video_dmi_ta + }, + }, + { ++ /* https://bugzilla.redhat.com/show_bug.cgi?id=1186097 */ ++ .callback = video_disable_native_backlight, ++ .ident = "SAMSUNG 3570R/370R/470R/450R/510R/4450RV", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "3570R/370R/470R/450R/510R/4450RV"), ++ }, ++ }, ++ { + /* https://bugzilla.redhat.com/show_bug.cgi?id=1094948 */ + .callback = video_disable_native_backlight, + .ident = "SAMSUNG 730U3E/740U3E", diff --git a/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch b/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch new file mode 100644 index 000000000..f47242159 --- /dev/null +++ b/debian/patches/bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch @@ -0,0 +1,34 @@ +From: Hans de Goede +Date: Fri, 9 Jan 2015 16:22:57 +0100 +Subject: ACPI / video: Add disable_native_backlight quirk for Samsung + 730U3E/740U3E +Origin: https://git.kernel.org/linus/3295d73002f4be341069a000aec4b8d7e5ea8d2c + +The Samsung 730U3E/740U3E has integrated ATI Radeon graphics, and backlight +control does not work properly when using the native interfaces. + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1094948 +Signed-off-by: Hans de Goede +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/video.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -711,6 +711,15 @@ static struct dmi_system_id video_dmi_ta + DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"), + }, + }, ++ { ++ /* https://bugzilla.redhat.com/show_bug.cgi?id=1094948 */ ++ .callback = video_disable_native_backlight, ++ .ident = "SAMSUNG 730U3E/740U3E", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "730U3E/740U3E"), ++ }, ++ }, + + { + /* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */ diff --git a/debian/patches/bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch b/debian/patches/bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch new file mode 100644 index 000000000..08901e29b --- /dev/null +++ b/debian/patches/bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch @@ -0,0 +1,52 @@ +From: Aaron Lu +Date: Mon, 22 Dec 2014 15:18:05 +0800 +Subject: ACPI / video: Add some Samsung models to disable_native_backlight + list +Origin: https://git.kernel.org/linus/7d0b93499f4879ddbc75d594f4ea216ba964f78e + +Several Samsung laptop models (SAMSUNG 870Z5E/880Z5E/680Z5E and +SAMSUNG 370R4E/370R4V/370R5E/3570RE/370R5V) do not have a working +native backlight control interface so restore their acpi_videoX +interface. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=84221 +Link: https://bugzilla.kernel.org/show_bug.cgi?id=84651 +For SAMSUNG 870Z5E/880Z5E/680Z5E: +Reported-and-tested-by: Brent Saner +Reported-by: Vitaliy Filippov +Reported-by: Laszlo KREKACS +For SAMSUNG 370R4E/370R4V/370R5E/3570RE/370R5V: +Reported-by: Vladimir Perepechin +Cc: 3.17+ # 3.17+ +Signed-off-by: Aaron Lu +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/video.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -694,6 +694,23 @@ static struct dmi_system_id video_dmi_ta + DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY 15 Notebook PC"), + }, + }, ++ ++ { ++ .callback = video_disable_native_backlight, ++ .ident = "SAMSUNG 870Z5E/880Z5E/680Z5E", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "870Z5E/880Z5E/680Z5E"), ++ }, ++ }, ++ { ++ .callback = video_disable_native_backlight, ++ .ident = "SAMSUNG 370R4E/370R4V/370R5E/3570RE/370R5V", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"), ++ }, ++ }, + {} + }; + diff --git a/debian/patches/bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch b/debian/patches/bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch new file mode 100644 index 000000000..28b4282be --- /dev/null +++ b/debian/patches/bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch @@ -0,0 +1,46 @@ +From: Jens Reyer +Date: Tue, 17 Feb 2015 19:07:29 +0100 +Subject: ACPI / video: Disable native backlight on Samsung Series 9 laptops +Origin: https://git.kernel.org/linus/3120d03cf64d7f9fd71231827af2c1550aa4caa7 + +Add video_disable_native_backlight quirk for SAMSUNG 900X3C/900X3D/ +900X3E/900X4C/900X4D laptops. + +The native intel backlight controls do not work correctly on SAMSUNG +Series 9 (900X3C/900X3D/900X3E/900X4C/900X4D) laptops: +One machine has an completely dimmed (= black) display after boot at the +GDM login screen and brightness controls work only between 0 and 5% +(= no effect). +Another machine has the same brightness control issues if an external +HDMI monitor is or gets connected, although the initial brightness is +ok. +After login to Gnome both machines always work fine. + +Tested on both machines. + +Link: https://bugs.freedesktop.org/show_bug.cgi?id=87286 +Link: https://bugs.debian.org/772440 +Signed-off-by: Jens Reyer +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/video.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -729,6 +729,15 @@ static struct dmi_system_id video_dmi_ta + DMI_MATCH(DMI_PRODUCT_NAME, "730U3E/740U3E"), + }, + }, ++ { ++ /* https://bugs.freedesktop.org/show_bug.cgi?id=87286 */ ++ .callback = video_disable_native_backlight, ++ .ident = "SAMSUNG 900X3C/900X3D/900X3E/900X4C/900X4D", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "900X3C/900X3D/900X3E/900X4C/900X4D"), ++ }, ++ }, + + { + /* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */ diff --git a/debian/patches/series b/debian/patches/series index 142844a83..d60fc6369 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -516,3 +516,8 @@ debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch debian/perf-fix-abi-change-in-3.16.7-ckt6.patch debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch +bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch +bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch +bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch +bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch +bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch From 8869a3e33e85def7dcd0c22d2689038afa4807b6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 03:35:59 +0000 Subject: [PATCH 24/32] [x86] ALSA: Enable SND_SOC, SND_SOC_INTEL_SST, SND_SOC_INTEL_HASWELL_MACH, SND_SOC_INTEL_BYT_RT5640_MACH, SND_SOC_INTEL_BYT_MAX98090_MACH as modules (Closes: #773835) svn path=/dists/sid/linux/; revision=22432 --- debian/changelog | 3 +++ debian/config/kernelarch-x86/config | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7ff851b2a..eb2ad8227 100644 --- a/debian/changelog +++ b/debian/changelog @@ -178,6 +178,9 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium * tcp: Fix ABI change in 3.16.7-ckt7 * [x86] ACPI / video: Add disable_native_backlight quirk for various Samsung models and Dell XPS15 L521X (Closes: #772440) + * [x86] ALSA: Enable SND_SOC, SND_SOC_INTEL_SST, SND_SOC_INTEL_HASWELL_MACH, + SND_SOC_INTEL_BYT_RT5640_MACH, SND_SOC_INTEL_BYT_MAX98090_MACH as modules + (Closes: #773835) [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/config/kernelarch-x86/config b/debian/config/kernelarch-x86/config index b85540e33..57e02c8f6 100644 --- a/debian/config/kernelarch-x86/config +++ b/debian/config/kernelarch-x86/config @@ -1914,3 +1914,16 @@ CONFIG_SND_YMFPCI=m ## CONFIG_SND_HDA_INTEL=m +## +## file: sound/soc/Kconfig +## +CONFIG_SND_SOC=m + +## +## file: sound/soc/intel/Kconfig +## +CONFIG_SND_SOC_INTEL_SST=m +CONFIG_SND_SOC_INTEL_HASWELL_MACH=m +CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH=m +CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH=m + From 61ae6ff2c9debec83d4185c0371d39d10eebe392 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 03:59:22 +0000 Subject: [PATCH 25/32] arcmsr: Backport changes up to Linux 3.18 (Closes: #698821) svn path=/dists/sid/linux/; revision=22433 --- debian/changelog | 1 + ...fix-command-timeout-under-heavy-load.patch | 281 ++++ ...e-to-support-msi-x-and-msi-interrupt.patch | 215 +++ ...cmsr-add-code-to-support-hibernation.patch | 121 ++ ...-max.-number-of-scsi-command-request.patch | 108 ++ ...rcmsr-return-status-of-abort-command.patch | 79 ++ ...r-store-adapter-type-in-pci-id-table.patch | 123 ++ ...ssage_isr_bh_fn-to-remove-duplicate-.patch | 194 +++ ...alling-arcmsr_hbb_enable_driver_mode.patch | 52 + ...inting-adapter-model-number-and-f-w-.patch | 61 + ...-outbound-doorbell-buffer-completely.patch | 57 + ...rcmsr-rename-functions-and-variables.patch | 857 +++++++++++ ...location-of-second-dma_coherent_hand.patch | 134 ++ ...-data-read-write-error-for-adapter-t.patch | 962 +++++++++++++ ...rcmsr-fix-sparse-warnings-and-errors.patch | 316 +++++ ...arcmsr-modify-some-character-strings.patch | 75 + ...d-support-new-adapter-arc12x4-series.patch | 1257 +++++++++++++++++ ..._scan_host-at-the-end-of-host-initia.patch | 63 + ...of-updating-doneq_index-and-postq_in.patch | 232 +++ ...rcmsr-simplify-ioctl-data-read-write.patch | 606 ++++++++ debian/patches/series | 19 + 21 files changed, 5813 insertions(+) create mode 100644 debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch create mode 100644 debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch create mode 100644 debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch create mode 100644 debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch create mode 100644 debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch create mode 100644 debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch create mode 100644 debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch create mode 100644 debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch create mode 100644 debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch create mode 100644 debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch create mode 100644 debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch create mode 100644 debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch create mode 100644 debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch create mode 100644 debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch create mode 100644 debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch create mode 100644 debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch create mode 100644 debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch create mode 100644 debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch create mode 100644 debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch diff --git a/debian/changelog b/debian/changelog index eb2ad8227..1696d1b4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -181,6 +181,7 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium * [x86] ALSA: Enable SND_SOC, SND_SOC_INTEL_SST, SND_SOC_INTEL_HASWELL_MACH, SND_SOC_INTEL_BYT_RT5640_MACH, SND_SOC_INTEL_BYT_MAX98090_MACH as modules (Closes: #773835) + * arcmsr: Backport changes up to Linux 3.18 (Closes: #698821) [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch b/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch new file mode 100644 index 000000000..0a3cd497d --- /dev/null +++ b/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch @@ -0,0 +1,281 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:18:24 +0800 +Subject: [01/19] arcmsr: fix command timeout under heavy load +Origin: https://git.kernel.org/linus/6b3937227479e50032112faf74bd913f36dba2c6 +Bug-Debian: https://bugs.debian.org/698821 + +This patch rewrites the interrupt service routine relate function to fix +a command timeout under heavy controller load. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 2 +- + drivers/scsi/arcmsr/arcmsr_hba.c | 198 +++++++++++++++++++-------------------- + 2 files changed, 98 insertions(+), 102 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 77b26f5..8f35793 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -51,7 +51,7 @@ struct device_attribute; + #else + #define ARCMSR_MAX_FREECCB_NUM 320 + #endif +-#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2010/08/05" ++#define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140428" + #define ARCMSR_SCSI_INITIATOR_ID 255 + #define ARCMSR_MAX_XFER_SECTORS 512 + #define ARCMSR_MAX_XFER_SECTORS_B 4096 +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index b13764c..506fe7b 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -1441,14 +1441,15 @@ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) + uint32_t outbound_doorbell; + struct MessageUnit_A __iomem *reg = acb->pmuA; + outbound_doorbell = readl(®->outbound_doorbell); +- writel(outbound_doorbell, ®->outbound_doorbell); +- if (outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) { +- arcmsr_iop2drv_data_wrote_handle(acb); +- } +- +- if (outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) { +- arcmsr_iop2drv_data_read_handle(acb); +- } ++ do { ++ writel(outbound_doorbell, ®->outbound_doorbell); ++ if (outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK) ++ arcmsr_iop2drv_data_wrote_handle(acb); ++ if (outbound_doorbell & ARCMSR_OUTBOUND_IOP331_DATA_READ_OK) ++ arcmsr_iop2drv_data_read_handle(acb); ++ outbound_doorbell = readl(®->outbound_doorbell); ++ } while (outbound_doorbell & (ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK ++ | ARCMSR_OUTBOUND_IOP331_DATA_READ_OK)); + } + static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *pACB) + { +@@ -1462,17 +1463,19 @@ static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *pACB) + ******************************************************************* + */ + outbound_doorbell = readl(®->outbound_doorbell); +- writel(outbound_doorbell, ®->outbound_doorbell_clear);/*clear interrupt*/ +- if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { +- arcmsr_iop2drv_data_wrote_handle(pACB); +- } +- if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) { +- arcmsr_iop2drv_data_read_handle(pACB); +- } +- if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) { +- arcmsr_hbc_message_isr(pACB); /* messenger of "driver to iop commands" */ +- } +- return; ++ do { ++ writel(outbound_doorbell, ®->outbound_doorbell_clear); ++ readl(®->outbound_doorbell_clear); ++ if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) ++ arcmsr_iop2drv_data_wrote_handle(pACB); ++ if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) ++ arcmsr_iop2drv_data_read_handle(pACB); ++ if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) ++ arcmsr_hbc_message_isr(pACB); ++ outbound_doorbell = readl(®->outbound_doorbell); ++ } while (outbound_doorbell & (ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK ++ | ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK ++ | ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE)); + } + static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) + { +@@ -1521,21 +1524,23 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb) + /* areca cdb command done */ + /* Use correct offset and size for syncing */ + +- while (readl(&phbcmu->host_int_status) & +- ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR){ +- /* check if command done with no error*/ +- flag_ccb = readl(&phbcmu->outbound_queueport_low); +- ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0);/*frame must be 32 bytes aligned*/ +- arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy); +- ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); +- error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1) ? true : false; +- /* check if command done with no error */ +- arcmsr_drain_donequeue(acb, ccb, error); +- if (throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { +- writel(ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING, &phbcmu->inbound_doorbell); +- break; +- } +- throttling++; ++ while ((flag_ccb = readl(&phbcmu->outbound_queueport_low)) != ++ 0xFFFFFFFF) { ++ ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); ++ arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset ++ + ccb_cdb_phy); ++ ccb = container_of(arcmsr_cdb, struct CommandControlBlock, ++ arcmsr_cdb); ++ error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1) ++ ? true : false; ++ /* check if command done with no error */ ++ arcmsr_drain_donequeue(acb, ccb, error); ++ throttling++; ++ if (throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { ++ writel(ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING, ++ &phbcmu->inbound_doorbell); ++ throttling = 0; ++ } + } + } + /* +@@ -1584,21 +1589,22 @@ static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) + struct MessageUnit_A __iomem *reg = acb->pmuA; + outbound_intstatus = readl(®->outbound_intstatus) & + acb->outbound_int_enable; +- if (!(outbound_intstatus & ARCMSR_MU_OUTBOUND_HANDLE_INT)) { +- return 1; +- } +- writel(outbound_intstatus, ®->outbound_intstatus); +- if (outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) { +- arcmsr_hba_doorbell_isr(acb); +- } +- if (outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) { +- arcmsr_hba_postqueue_isr(acb); +- } +- if(outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) { +- /* messenger of "driver to iop commands" */ +- arcmsr_hba_message_isr(acb); +- } +- return 0; ++ if (!(outbound_intstatus & ARCMSR_MU_OUTBOUND_HANDLE_INT)) ++ return IRQ_NONE; ++ do { ++ writel(outbound_intstatus, ®->outbound_intstatus); ++ if (outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) ++ arcmsr_hba_doorbell_isr(acb); ++ if (outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) ++ arcmsr_hba_postqueue_isr(acb); ++ if (outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) ++ arcmsr_hba_message_isr(acb); ++ outbound_intstatus = readl(®->outbound_intstatus) & ++ acb->outbound_int_enable; ++ } while (outbound_intstatus & (ARCMSR_MU_OUTBOUND_DOORBELL_INT ++ | ARCMSR_MU_OUTBOUND_POSTQUEUE_INT ++ | ARCMSR_MU_OUTBOUND_MESSAGE0_INT)); ++ return IRQ_HANDLED; + } + + static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) +@@ -1608,27 +1614,25 @@ static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) + outbound_doorbell = readl(reg->iop2drv_doorbell) & + acb->outbound_int_enable; + if (!outbound_doorbell) +- return 1; +- +- writel(~outbound_doorbell, reg->iop2drv_doorbell); +- /*in case the last action of doorbell interrupt clearance is cached, +- this action can push HW to write down the clear bit*/ +- readl(reg->iop2drv_doorbell); +- writel(ARCMSR_DRV2IOP_END_OF_INTERRUPT, reg->drv2iop_doorbell); +- if (outbound_doorbell & ARCMSR_IOP2DRV_DATA_WRITE_OK) { +- arcmsr_iop2drv_data_wrote_handle(acb); +- } +- if (outbound_doorbell & ARCMSR_IOP2DRV_DATA_READ_OK) { +- arcmsr_iop2drv_data_read_handle(acb); +- } +- if (outbound_doorbell & ARCMSR_IOP2DRV_CDB_DONE) { +- arcmsr_hbb_postqueue_isr(acb); +- } +- if(outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) { +- /* messenger of "driver to iop commands" */ +- arcmsr_hbb_message_isr(acb); +- } +- return 0; ++ return IRQ_NONE; ++ do { ++ writel(~outbound_doorbell, reg->iop2drv_doorbell); ++ writel(ARCMSR_DRV2IOP_END_OF_INTERRUPT, reg->drv2iop_doorbell); ++ if (outbound_doorbell & ARCMSR_IOP2DRV_DATA_WRITE_OK) ++ arcmsr_iop2drv_data_wrote_handle(acb); ++ if (outbound_doorbell & ARCMSR_IOP2DRV_DATA_READ_OK) ++ arcmsr_iop2drv_data_read_handle(acb); ++ if (outbound_doorbell & ARCMSR_IOP2DRV_CDB_DONE) ++ arcmsr_hbb_postqueue_isr(acb); ++ if (outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) ++ arcmsr_hbb_message_isr(acb); ++ outbound_doorbell = readl(reg->iop2drv_doorbell) & ++ acb->outbound_int_enable; ++ } while (outbound_doorbell & (ARCMSR_IOP2DRV_DATA_WRITE_OK ++ | ARCMSR_IOP2DRV_DATA_READ_OK ++ | ARCMSR_IOP2DRV_CDB_DONE ++ | ARCMSR_IOP2DRV_MESSAGE_CMD_DONE)); ++ return IRQ_HANDLED; + } + + static int arcmsr_handle_hbc_isr(struct AdapterControlBlock *pACB) +@@ -1640,44 +1644,36 @@ static int arcmsr_handle_hbc_isr(struct AdapterControlBlock *pACB) + ** check outbound intstatus + ********************************************* + */ +- host_interrupt_status = readl(&phbcmu->host_int_status); +- if (!host_interrupt_status) { +- /*it must be share irq*/ +- return 1; +- } +- /* MU ioctl transfer doorbell interrupts*/ +- if (host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) { +- arcmsr_hbc_doorbell_isr(pACB); /* messenger of "ioctl message read write" */ +- } +- /* MU post queue interrupts*/ +- if (host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) { +- arcmsr_hbc_postqueue_isr(pACB); /* messenger of "scsi commands" */ +- } +- return 0; ++ host_interrupt_status = readl(&phbcmu->host_int_status) & ++ (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | ++ ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR); ++ if (!host_interrupt_status) ++ return IRQ_NONE; ++ do { ++ if (host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) ++ arcmsr_hbc_doorbell_isr(pACB); ++ /* MU post queue interrupts*/ ++ if (host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) ++ arcmsr_hbc_postqueue_isr(pACB); ++ host_interrupt_status = readl(&phbcmu->host_int_status); ++ } while (host_interrupt_status & (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | ++ ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); ++ return IRQ_HANDLED; + } + static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +- case ACB_ADAPTER_TYPE_A: { +- if (arcmsr_handle_hba_isr(acb)) { +- return IRQ_NONE; +- } +- } ++ case ACB_ADAPTER_TYPE_A: ++ return arcmsr_handle_hba_isr(acb); + break; +- +- case ACB_ADAPTER_TYPE_B: { +- if (arcmsr_handle_hbb_isr(acb)) { +- return IRQ_NONE; +- } +- } ++ case ACB_ADAPTER_TYPE_B: ++ return arcmsr_handle_hbb_isr(acb); + break; +- case ACB_ADAPTER_TYPE_C: { +- if (arcmsr_handle_hbc_isr(acb)) { +- return IRQ_NONE; +- } +- } ++ case ACB_ADAPTER_TYPE_C: ++ return arcmsr_handle_hbc_isr(acb); ++ default: ++ return IRQ_NONE; + } +- return IRQ_HANDLED; + } + + static void arcmsr_iop_parking(struct AdapterControlBlock *acb) diff --git a/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch b/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch new file mode 100644 index 000000000..ffcebf157 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch @@ -0,0 +1,215 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:23:31 +0800 +Subject: [02/19] arcmsr: add code to support MSI-X and MSI interrupt +Origin: https://git.kernel.org/linus/1d1166ea16ac7047a1b01f20dcbcc6f7754c3c23 +Bug-Debian: https://bugs.debian.org/698821 + +This patch adds code to support MSI and MSI-X interrupt. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 5 +++ + drivers/scsi/arcmsr/arcmsr_hba.c | 83 ++++++++++++++++++++++++++++++++++------ + 2 files changed, 76 insertions(+), 12 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 8f35793..1c64b60 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -64,6 +64,7 @@ struct device_attribute; + #define ARCMSR_MAX_HBB_POSTQUEUE 264 + #define ARCMSR_MAX_XFER_LEN 0x26000 /* 152K */ + #define ARCMSR_CDB_SG_PAGE_LENGTH 256 ++#define ARCMST_NUM_MSIX_VECTORS 4 + #ifndef PCI_DEVICE_ID_ARECA_1880 + #define PCI_DEVICE_ID_ARECA_1880 0x1880 + #endif +@@ -508,6 +509,7 @@ struct AdapterControlBlock + struct pci_dev * pdev; + struct Scsi_Host * host; + unsigned long vir2phy_offset; ++ struct msix_entry entries[ARCMST_NUM_MSIX_VECTORS]; + /* Offset is used in making arc cdb physical to virtual calculations */ + uint32_t outbound_int_enable; + uint32_t cdb_phyaddr_hi32; +@@ -544,6 +546,8 @@ struct AdapterControlBlock + /* iop init */ + #define ACB_F_ABORT 0x0200 + #define ACB_F_FIRMWARE_TRAP 0x0400 ++ #define ACB_F_MSI_ENABLED 0x1000 ++ #define ACB_F_MSIX_ENABLED 0x2000 + struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM]; + /* used for memory free */ + struct list_head ccb_free_list; +@@ -594,6 +598,7 @@ struct AdapterControlBlock + #define FW_DEADLOCK 0x0010 + atomic_t rq_map_token; + atomic_t ante_token_value; ++ int msix_vector_count; + };/* HW_DEVICE_EXTENSION */ + /* + ******************************************************************************* +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 506fe7b..60227d56 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -603,6 +603,56 @@ static void arcmsr_message_isr_bh_fn(struct work_struct *work) + } + } + ++static int ++arcmsr_request_irq(struct pci_dev *pdev, struct AdapterControlBlock *acb) ++{ ++ int i, j, r; ++ struct msix_entry entries[ARCMST_NUM_MSIX_VECTORS]; ++ ++ for (i = 0; i < ARCMST_NUM_MSIX_VECTORS; i++) ++ entries[i].entry = i; ++ r = pci_enable_msix_range(pdev, entries, 1, ARCMST_NUM_MSIX_VECTORS); ++ if (r < 0) ++ goto msi_int; ++ acb->msix_vector_count = r; ++ for (i = 0; i < r; i++) { ++ if (request_irq(entries[i].vector, ++ arcmsr_do_interrupt, 0, "arcmsr", acb)) { ++ pr_warn("arcmsr%d: request_irq =%d failed!\n", ++ acb->host->host_no, entries[i].vector); ++ for (j = 0 ; j < i ; j++) ++ free_irq(entries[j].vector, acb); ++ pci_disable_msix(pdev); ++ goto msi_int; ++ } ++ acb->entries[i] = entries[i]; ++ } ++ acb->acb_flags |= ACB_F_MSIX_ENABLED; ++ pr_info("arcmsr%d: msi-x enabled\n", acb->host->host_no); ++ return SUCCESS; ++msi_int: ++ if (pci_enable_msi_exact(pdev, 1) < 0) ++ goto legacy_int; ++ if (request_irq(pdev->irq, arcmsr_do_interrupt, ++ IRQF_SHARED, "arcmsr", acb)) { ++ pr_warn("arcmsr%d: request_irq =%d failed!\n", ++ acb->host->host_no, pdev->irq); ++ pci_disable_msi(pdev); ++ goto legacy_int; ++ } ++ acb->acb_flags |= ACB_F_MSI_ENABLED; ++ pr_info("arcmsr%d: msi enabled\n", acb->host->host_no); ++ return SUCCESS; ++legacy_int: ++ if (request_irq(pdev->irq, arcmsr_do_interrupt, ++ IRQF_SHARED, "arcmsr", acb)) { ++ pr_warn("arcmsr%d: request_irq = %d failed!\n", ++ acb->host->host_no, pdev->irq); ++ return FAILED; ++ } ++ return SUCCESS; ++} ++ + static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + { + struct Scsi_Host *host; +@@ -667,16 +717,13 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + if(error){ + goto free_hbb_mu; + } +- arcmsr_iop_init(acb); + error = scsi_add_host(host, &pdev->dev); + if(error){ + goto RAID_controller_stop; + } +- error = request_irq(pdev->irq, arcmsr_do_interrupt, IRQF_SHARED, "arcmsr", acb); +- if(error){ ++ if (arcmsr_request_irq(pdev, acb) == FAILED) + goto scsi_host_remove; +- } +- host->irq = pdev->irq; ++ arcmsr_iop_init(acb); + scsi_scan_host(host); + INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn); + atomic_set(&acb->rq_map_token, 16); +@@ -710,6 +757,22 @@ pci_disable_dev: + return -ENODEV; + } + ++static void arcmsr_free_irq(struct pci_dev *pdev, ++ struct AdapterControlBlock *acb) ++{ ++ int i; ++ ++ if (acb->acb_flags & ACB_F_MSI_ENABLED) { ++ free_irq(pdev->irq, acb); ++ pci_disable_msi(pdev); ++ } else if (acb->acb_flags & ACB_F_MSIX_ENABLED) { ++ for (i = 0; i < acb->msix_vector_count; i++) ++ free_irq(acb->entries[i].vector, acb); ++ pci_disable_msix(pdev); ++ } else ++ free_irq(pdev->irq, acb); ++} ++ + static uint8_t arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -992,6 +1055,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + } + } + } ++ + static void arcmsr_remove(struct pci_dev *pdev) + { + struct Scsi_Host *host = pci_get_drvdata(pdev); +@@ -1029,7 +1093,7 @@ static void arcmsr_remove(struct pci_dev *pdev) + } + } + } +- free_irq(pdev->irq, acb); ++ arcmsr_free_irq(pdev, acb); + arcmsr_free_ccb_pool(acb); + arcmsr_free_hbb_mu(acb); + arcmsr_unmap_pciregion(acb); +@@ -1045,6 +1109,7 @@ static void arcmsr_shutdown(struct pci_dev *pdev) + (struct AdapterControlBlock *)host->hostdata; + del_timer_sync(&acb->eternal_timer); + arcmsr_disable_outbound_ints(acb); ++ arcmsr_free_irq(pdev, acb); + flush_work(&acb->arcmsr_do_message_isr_bh); + arcmsr_stop_adapter_bgrb(acb); + arcmsr_flush_adapter_cache(acb); +@@ -2516,8 +2581,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_A: { + if (cdb_phyaddr_hi32 != 0) { + struct MessageUnit_A __iomem *reg = acb->pmuA; +- uint32_t intmask_org; +- intmask_org = arcmsr_disable_outbound_ints(acb); + writel(ARCMSR_SIGNATURE_SET_CONFIG, \ + ®->message_rwbuffer[0]); + writel(cdb_phyaddr_hi32, ®->message_rwbuffer[1]); +@@ -2529,7 +2592,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + acb->host->host_no); + return 1; + } +- arcmsr_enable_outbound_ints(acb, intmask_org); + } + } + break; +@@ -2539,8 +2601,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + uint32_t __iomem *rwbuffer; + + struct MessageUnit_B *reg = acb->pmuB; +- uint32_t intmask_org; +- intmask_org = arcmsr_disable_outbound_ints(acb); + reg->postq_index = 0; + reg->doneq_index = 0; + writel(ARCMSR_MESSAGE_SET_POST_WINDOW, reg->drv2iop_doorbell); +@@ -2569,7 +2629,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + return 1; + } + arcmsr_hbb_enable_driver_mode(acb); +- arcmsr_enable_outbound_ints(acb, intmask_org); + } + break; + case ACB_ADAPTER_TYPE_C: { diff --git a/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch b/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch new file mode 100644 index 000000000..bb54dcc47 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch @@ -0,0 +1,121 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:26:09 +0800 +Subject: [03/19] arcmsr: add code to support hibernation +Origin: https://git.kernel.org/linus/61cda87f33be22828c3b52863da1c456ba108d37 +Bug-Debian: https://bugs.debian.org/698821 + +This patch adds code to support system hibernation. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 76 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 76 insertions(+) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 60227d56..b338a3b 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -89,11 +89,15 @@ static int arcmsr_bios_param(struct scsi_device *sdev, + static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); + static int arcmsr_probe(struct pci_dev *pdev, + const struct pci_device_id *id); ++static int arcmsr_suspend(struct pci_dev *pdev, pm_message_t state); ++static int arcmsr_resume(struct pci_dev *pdev); + static void arcmsr_remove(struct pci_dev *pdev); + static void arcmsr_shutdown(struct pci_dev *pdev); + static void arcmsr_iop_init(struct AdapterControlBlock *acb); + static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb); + static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb); ++static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, ++ u32 intmask_org); + static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb); + static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb); + static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb); +@@ -167,6 +171,8 @@ static struct pci_driver arcmsr_pci_driver = { + .id_table = arcmsr_device_id_table, + .probe = arcmsr_probe, + .remove = arcmsr_remove, ++ .suspend = arcmsr_suspend, ++ .resume = arcmsr_resume, + .shutdown = arcmsr_shutdown, + }; + /* +@@ -773,6 +779,76 @@ static void arcmsr_free_irq(struct pci_dev *pdev, + free_irq(pdev->irq, acb); + } + ++static int arcmsr_suspend(struct pci_dev *pdev, pm_message_t state) ++{ ++ uint32_t intmask_org; ++ struct Scsi_Host *host = pci_get_drvdata(pdev); ++ struct AdapterControlBlock *acb = ++ (struct AdapterControlBlock *)host->hostdata; ++ ++ intmask_org = arcmsr_disable_outbound_ints(acb); ++ arcmsr_free_irq(pdev, acb); ++ del_timer_sync(&acb->eternal_timer); ++ flush_work(&acb->arcmsr_do_message_isr_bh); ++ arcmsr_stop_adapter_bgrb(acb); ++ arcmsr_flush_adapter_cache(acb); ++ pci_set_drvdata(pdev, host); ++ pci_save_state(pdev); ++ pci_disable_device(pdev); ++ pci_set_power_state(pdev, pci_choose_state(pdev, state)); ++ return 0; ++} ++ ++static int arcmsr_resume(struct pci_dev *pdev) ++{ ++ int error; ++ struct Scsi_Host *host = pci_get_drvdata(pdev); ++ struct AdapterControlBlock *acb = ++ (struct AdapterControlBlock *)host->hostdata; ++ ++ pci_set_power_state(pdev, PCI_D0); ++ pci_enable_wake(pdev, PCI_D0, 0); ++ pci_restore_state(pdev); ++ if (pci_enable_device(pdev)) { ++ pr_warn("%s: pci_enable_device error\n", __func__); ++ return -ENODEV; ++ } ++ error = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); ++ if (error) { ++ error = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); ++ if (error) { ++ pr_warn("scsi%d: No suitable DMA mask available\n", ++ host->host_no); ++ goto controller_unregister; ++ } ++ } ++ pci_set_master(pdev); ++ if (arcmsr_request_irq(pdev, acb) == FAILED) ++ goto controller_stop; ++ arcmsr_iop_init(acb); ++ INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn); ++ atomic_set(&acb->rq_map_token, 16); ++ atomic_set(&acb->ante_token_value, 16); ++ acb->fw_flag = FW_NORMAL; ++ init_timer(&acb->eternal_timer); ++ acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); ++ acb->eternal_timer.data = (unsigned long) acb; ++ acb->eternal_timer.function = &arcmsr_request_device_map; ++ add_timer(&acb->eternal_timer); ++ return 0; ++controller_stop: ++ arcmsr_stop_adapter_bgrb(acb); ++ arcmsr_flush_adapter_cache(acb); ++controller_unregister: ++ scsi_remove_host(host); ++ arcmsr_free_ccb_pool(acb); ++ arcmsr_unmap_pciregion(acb); ++ pci_release_regions(pdev); ++ scsi_host_put(host); ++ pci_disable_device(pdev); ++ return -ENODEV; ++} ++ + static uint8_t arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; diff --git a/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch b/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch new file mode 100644 index 000000000..88a925134 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch @@ -0,0 +1,108 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:29:41 +0800 +Subject: [04/19] arcmsr: limit max. number of SCSI command request +Origin: https://git.kernel.org/linus/3df824aff935444601101cc329ebe3f52e126a4e +Bug-Debian: https://bugs.debian.org/698821 + +This patch limits the max. number of SCSI commmand request to avoid command +overflow. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 4 +++- + drivers/scsi/arcmsr/arcmsr_hba.c | 32 ++++++++++++++++++++++---------- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 1c64b60..0ae0ce3 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -45,11 +45,12 @@ + #include + struct device_attribute; + /*The limit of outstanding scsi command that firmware can handle*/ +-#define ARCMSR_MAX_OUTSTANDING_CMD 256 + #ifdef CONFIG_XEN + #define ARCMSR_MAX_FREECCB_NUM 160 ++#define ARCMSR_MAX_OUTSTANDING_CMD 155 + #else + #define ARCMSR_MAX_FREECCB_NUM 320 ++#define ARCMSR_MAX_OUTSTANDING_CMD 255 + #endif + #define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140428" + #define ARCMSR_SCSI_INITIATOR_ID 255 +@@ -598,6 +599,7 @@ struct AdapterControlBlock + #define FW_DEADLOCK 0x0010 + atomic_t rq_map_token; + atomic_t ante_token_value; ++ uint32_t maxOutstanding; + int msix_vector_count; + };/* HW_DEVICE_EXTENSION */ + /* +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index b338a3b..ed61ee2 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -134,7 +134,7 @@ static struct scsi_host_template arcmsr_scsi_host_template = { + .eh_bus_reset_handler = arcmsr_bus_reset, + .bios_param = arcmsr_bios_param, + .change_queue_depth = arcmsr_adjust_disk_queue_depth, +- .can_queue = ARCMSR_MAX_FREECCB_NUM, ++ .can_queue = ARCMSR_MAX_OUTSTANDING_CMD, + .this_id = ARCMSR_SCSI_INITIATOR_ID, + .sg_tablesize = ARCMSR_DEFAULT_SG_ENTRIES, + .max_sectors = ARCMSR_MAX_XFER_SECTORS_C, +@@ -693,7 +693,7 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + host->max_lun = ARCMSR_MAX_TARGETLUN; + host->max_id = ARCMSR_MAX_TARGETID; /*16:8*/ + host->max_cmd_len = 16; /*this is issue of 64bit LBA ,over 2T byte*/ +- host->can_queue = ARCMSR_MAX_FREECCB_NUM; /* max simultaneous cmds */ ++ host->can_queue = ARCMSR_MAX_OUTSTANDING_CMD; + host->cmd_per_lun = ARCMSR_MAX_CMD_PERLUN; + host->this_id = ARCMSR_SCSI_INITIATOR_ID; + host->unique_id = (bus << 8) | dev_fun; +@@ -2216,9 +2216,6 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, + arcmsr_handle_virtual_command(acb, cmd); + return 0; + } +- if (atomic_read(&acb->ccboutstandingcount) >= +- ARCMSR_MAX_OUTSTANDING_CMD) +- return SCSI_MLQUEUE_HOST_BUSY; + ccb = arcmsr_get_freeccb(acb); + if (!ccb) + return SCSI_MLQUEUE_HOST_BUSY; +@@ -2428,12 +2425,27 @@ static bool arcmsr_get_hbc_config(struct AdapterControlBlock *pACB) + } + static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) + { +- if (acb->adapter_type == ACB_ADAPTER_TYPE_A) +- return arcmsr_get_hba_config(acb); +- else if (acb->adapter_type == ACB_ADAPTER_TYPE_B) +- return arcmsr_get_hbb_config(acb); ++ bool rtn = false; ++ ++ switch (acb->adapter_type) { ++ case ACB_ADAPTER_TYPE_A: ++ rtn = arcmsr_get_hba_config(acb); ++ break; ++ case ACB_ADAPTER_TYPE_B: ++ rtn = arcmsr_get_hbb_config(acb); ++ break; ++ case ACB_ADAPTER_TYPE_C: ++ rtn = arcmsr_get_hbc_config(acb); ++ break; ++ default: ++ break; ++ } ++ if (acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) ++ acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD; + else +- return arcmsr_get_hbc_config(acb); ++ acb->maxOutstanding = acb->firm_numbers_queue - 1; ++ acb->host->can_queue = acb->maxOutstanding; ++ return rtn; + } + + static int arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb, diff --git a/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch b/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch new file mode 100644 index 000000000..c21b19034 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch @@ -0,0 +1,79 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:47:16 +0800 +Subject: [05/19] arcmsr: return status of abort command +Origin: https://git.kernel.org/linus/cab5aecee60a7930ca208ee723c18be7b400cfaf +Bug-Debian: https://bugs.debian.org/698821 + +This patch fixes the wrong return status of abort command. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +[bwh: Backported to 3.16: adjust context] +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -2477,7 +2477,7 @@ static int arcmsr_polling_hba_ccbdone(st + } + arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); + ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); +- poll_ccb_done = (ccb == poll_ccb) ? 1:0; ++ poll_ccb_done |= (ccb == poll_ccb) ? 1 : 0; + if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) { + if ((ccb->startdone == ARCMSR_CCB_ABORTED) || (ccb == poll_ccb)) { + printk(KERN_NOTICE "arcmsr%d: scsi id = %d lun = %d ccb = '0x%p'" +@@ -2541,7 +2541,7 @@ static int arcmsr_polling_hbb_ccbdone(st + /* check if command done with no error*/ + arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); + ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); +- poll_ccb_done = (ccb == poll_ccb) ? 1:0; ++ poll_ccb_done |= (ccb == poll_ccb) ? 1 : 0; + if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) { + if ((ccb->startdone == ARCMSR_CCB_ABORTED) || (ccb == poll_ccb)) { + printk(KERN_NOTICE "arcmsr%d: scsi id = %d lun = %d ccb = '0x%p'" +@@ -2597,7 +2597,7 @@ polling_hbc_ccb_retry: + ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); + arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy);/*frame must be 32 bytes aligned*/ + pCCB = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); +- poll_ccb_done = (pCCB == poll_ccb) ? 1 : 0; ++ poll_ccb_done |= (pCCB == poll_ccb) ? 1 : 0; + /* check ifcommand done with no error*/ + if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) { + if (pCCB->startdone == ARCMSR_CCB_ABORTED) { +@@ -3199,8 +3199,10 @@ static int arcmsr_abort(struct scsi_cmnd + (struct AdapterControlBlock *)cmd->device->host->hostdata; + int i = 0; + int rtn = FAILED; ++ uint32_t intmask_org; ++ + printk(KERN_NOTICE +- "arcmsr%d: abort device command of scsi id = %d lun = %d \n", ++ "arcmsr%d: abort device command of scsi id = %d lun = %d\n", + acb->host->host_no, cmd->device->id, cmd->device->lun); + acb->acb_flags |= ACB_F_ABORT; + acb->num_aborts++; +@@ -3210,9 +3212,12 @@ static int arcmsr_abort(struct scsi_cmnd + ** we need to handle it as soon as possible and exit + ************************************************ + */ +- if (!atomic_read(&acb->ccboutstandingcount)) ++ if (!atomic_read(&acb->ccboutstandingcount)) { ++ acb->acb_flags &= ~ACB_F_ABORT; + return rtn; ++ } + ++ intmask_org = arcmsr_disable_outbound_ints(acb); + for (i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++) { + struct CommandControlBlock *ccb = acb->pccb_pool[i]; + if (ccb->startdone == ARCMSR_CCB_START && ccb->pcmd == cmd) { +@@ -3222,6 +3227,7 @@ static int arcmsr_abort(struct scsi_cmnd + } + } + acb->acb_flags &= ~ACB_F_ABORT; ++ arcmsr_enable_outbound_ints(acb, intmask_org); + return rtn; + } + diff --git a/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch b/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch new file mode 100644 index 000000000..402de8bd7 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch @@ -0,0 +1,123 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:55:57 +0800 +Subject: [06/19] arcmsr: store adapter type in PCI id table +Origin: https://git.kernel.org/linus/8b7c994298d7a18f45a9cec2e9b496d9784b1135 +Bug-Debian: https://bugs.debian.org/698821 + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 81 ++++++++++++++++++++-------------------- + 1 file changed, 41 insertions(+), 40 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 87f3882..30b378c 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -143,29 +143,50 @@ static struct scsi_host_template arcmsr_scsi_host_template = { + .shost_attrs = arcmsr_host_attrs, + .no_write_same = 1, + }; ++ + static struct pci_device_id arcmsr_device_id_table[] = { +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1110)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1120)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1130)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1160)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1170)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1200)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1201)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1202)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1210)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1220)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1230)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1260)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1270)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1280)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1380)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1381)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1680)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1681)}, +- {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1880)}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1110), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1120), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1130), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1160), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1170), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1200), ++ .driver_data = ACB_ADAPTER_TYPE_B}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1201), ++ .driver_data = ACB_ADAPTER_TYPE_B}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1202), ++ .driver_data = ACB_ADAPTER_TYPE_B}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1210), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1220), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1230), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1260), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1270), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1280), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1380), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1381), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1680), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1681), ++ .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1880), ++ .driver_data = ACB_ADAPTER_TYPE_C}, + {0, 0}, /* Terminating entry */ + }; + MODULE_DEVICE_TABLE(pci, arcmsr_device_id_table); ++ + static struct pci_driver arcmsr_pci_driver = { + .name = "arcmsr", + .id_table = arcmsr_device_id_table, +@@ -295,26 +316,6 @@ static int arcmsr_bios_param(struct scsi_device *sdev, + return 0; + } + +-static void arcmsr_define_adapter_type(struct AdapterControlBlock *acb) +-{ +- struct pci_dev *pdev = acb->pdev; +- u16 dev_id; +- pci_read_config_word(pdev, PCI_DEVICE_ID, &dev_id); +- acb->dev_id = dev_id; +- switch (dev_id) { +- case 0x1880: { +- acb->adapter_type = ACB_ADAPTER_TYPE_C; +- } +- break; +- case 0x1201: { +- acb->adapter_type = ACB_ADAPTER_TYPE_B; +- } +- break; +- +- default: acb->adapter_type = ACB_ADAPTER_TYPE_A; +- } +-} +- + static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -710,7 +711,7 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + ACB_F_MESSAGE_WQBUFFER_READED); + acb->acb_flags &= ~ACB_F_SCSISTOPADAPTER; + INIT_LIST_HEAD(&acb->ccb_free_list); +- arcmsr_define_adapter_type(acb); ++ acb->adapter_type = id->driver_data; + error = arcmsr_remap_pciregion(acb); + if(!error){ + goto pci_release_regs; diff --git a/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch b/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch new file mode 100644 index 000000000..f42c9bdd8 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch @@ -0,0 +1,194 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 14:59:00 +0800 +Subject: [07/19] arcmsr: revise message_isr_bh_fn to remove duplicate code +Origin: https://git.kernel.org/linus/12aad94792718c6a79bbd395a650caff85f76ae4 +Bug-Debian: https://bugs.debian.org/698821 + +Revise message_isr_bh_fn to remove the duplicate code for each adapter type. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 160 +++++++++++++-------------------------- + 1 file changed, 54 insertions(+), 106 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 30b378c..bfe2ac4 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -493,120 +493,68 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) + + static void arcmsr_message_isr_bh_fn(struct work_struct *work) + { +- struct AdapterControlBlock *acb = container_of(work,struct AdapterControlBlock, arcmsr_do_message_isr_bh); ++ struct AdapterControlBlock *acb = container_of(work, ++ struct AdapterControlBlock, arcmsr_do_message_isr_bh); ++ char *acb_dev_map = (char *)acb->device_map; ++ uint32_t __iomem *signature = NULL; ++ char __iomem *devicemap = NULL; ++ int target, lun; ++ struct scsi_device *psdev; ++ char diff, temp; ++ + switch (acb->adapter_type) { +- case ACB_ADAPTER_TYPE_A: { ++ case ACB_ADAPTER_TYPE_A: { ++ struct MessageUnit_A __iomem *reg = acb->pmuA; + +- struct MessageUnit_A __iomem *reg = acb->pmuA; +- char *acb_dev_map = (char *)acb->device_map; +- uint32_t __iomem *signature = (uint32_t __iomem*) (®->message_rwbuffer[0]); +- char __iomem *devicemap = (char __iomem*) (®->message_rwbuffer[21]); +- int target, lun; +- struct scsi_device *psdev; +- char diff; +- +- atomic_inc(&acb->rq_map_token); +- if (readl(signature) == ARCMSR_SIGNATURE_GET_CONFIG) { +- for(target = 0; target < ARCMSR_MAX_TARGETID -1; target++) { +- diff = (*acb_dev_map)^readb(devicemap); +- if (diff != 0) { +- char temp; +- *acb_dev_map = readb(devicemap); +- temp =*acb_dev_map; +- for(lun = 0; lun < ARCMSR_MAX_TARGETLUN; lun++) { +- if((temp & 0x01)==1 && (diff & 0x01) == 1) { +- scsi_add_device(acb->host, 0, target, lun); +- }else if((temp & 0x01) == 0 && (diff & 0x01) == 1) { +- psdev = scsi_device_lookup(acb->host, 0, target, lun); +- if (psdev != NULL ) { +- scsi_remove_device(psdev); +- scsi_device_put(psdev); +- } +- } +- temp >>= 1; +- diff >>= 1; +- } +- } +- devicemap++; +- acb_dev_map++; +- } +- } +- break; +- } ++ signature = (uint32_t __iomem *)(®->message_rwbuffer[0]); ++ devicemap = (char __iomem *)(®->message_rwbuffer[21]); ++ break; ++ } ++ case ACB_ADAPTER_TYPE_B: { ++ struct MessageUnit_B *reg = acb->pmuB; + +- case ACB_ADAPTER_TYPE_B: { +- struct MessageUnit_B *reg = acb->pmuB; +- char *acb_dev_map = (char *)acb->device_map; +- uint32_t __iomem *signature = (uint32_t __iomem*)(®->message_rwbuffer[0]); +- char __iomem *devicemap = (char __iomem*)(®->message_rwbuffer[21]); +- int target, lun; +- struct scsi_device *psdev; +- char diff; +- +- atomic_inc(&acb->rq_map_token); +- if (readl(signature) == ARCMSR_SIGNATURE_GET_CONFIG) { +- for(target = 0; target < ARCMSR_MAX_TARGETID -1; target++) { +- diff = (*acb_dev_map)^readb(devicemap); +- if (diff != 0) { +- char temp; +- *acb_dev_map = readb(devicemap); +- temp =*acb_dev_map; +- for(lun = 0; lun < ARCMSR_MAX_TARGETLUN; lun++) { +- if((temp & 0x01)==1 && (diff & 0x01) == 1) { +- scsi_add_device(acb->host, 0, target, lun); +- }else if((temp & 0x01) == 0 && (diff & 0x01) == 1) { +- psdev = scsi_device_lookup(acb->host, 0, target, lun); +- if (psdev != NULL ) { +- scsi_remove_device(psdev); +- scsi_device_put(psdev); +- } +- } +- temp >>= 1; +- diff >>= 1; +- } +- } +- devicemap++; +- acb_dev_map++; +- } +- } +- } ++ signature = (uint32_t __iomem *)(®->message_rwbuffer[0]); ++ devicemap = (char __iomem *)(®->message_rwbuffer[21]); + break; +- case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *reg = acb->pmuC; +- char *acb_dev_map = (char *)acb->device_map; +- uint32_t __iomem *signature = (uint32_t __iomem *)(®->msgcode_rwbuffer[0]); +- char __iomem *devicemap = (char __iomem *)(®->msgcode_rwbuffer[21]); +- int target, lun; +- struct scsi_device *psdev; +- char diff; +- +- atomic_inc(&acb->rq_map_token); +- if (readl(signature) == ARCMSR_SIGNATURE_GET_CONFIG) { +- for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++) { +- diff = (*acb_dev_map)^readb(devicemap); +- if (diff != 0) { +- char temp; +- *acb_dev_map = readb(devicemap); +- temp = *acb_dev_map; +- for (lun = 0; lun < ARCMSR_MAX_TARGETLUN; lun++) { +- if ((temp & 0x01) == 1 && (diff & 0x01) == 1) { +- scsi_add_device(acb->host, 0, target, lun); +- } else if ((temp & 0x01) == 0 && (diff & 0x01) == 1) { +- psdev = scsi_device_lookup(acb->host, 0, target, lun); +- if (psdev != NULL) { +- scsi_remove_device(psdev); +- scsi_device_put(psdev); +- } +- } +- temp >>= 1; +- diff >>= 1; +- } ++ } ++ case ACB_ADAPTER_TYPE_C: { ++ struct MessageUnit_C __iomem *reg = acb->pmuC; ++ ++ signature = (uint32_t __iomem *)(®->msgcode_rwbuffer[0]); ++ devicemap = (char __iomem *)(®->msgcode_rwbuffer[21]); ++ break; ++ } ++ } ++ atomic_inc(&acb->rq_map_token); ++ if (readl(signature) != ARCMSR_SIGNATURE_GET_CONFIG) ++ return; ++ for (target = 0; target < ARCMSR_MAX_TARGETID - 1; ++ target++) { ++ temp = readb(devicemap); ++ diff = (*acb_dev_map) ^ temp; ++ if (diff != 0) { ++ *acb_dev_map = temp; ++ for (lun = 0; lun < ARCMSR_MAX_TARGETLUN; ++ lun++) { ++ if ((diff & 0x01) == 1 && ++ (temp & 0x01) == 1) { ++ scsi_add_device(acb->host, ++ 0, target, lun); ++ } else if ((diff & 0x01) == 1 ++ && (temp & 0x01) == 0) { ++ psdev = scsi_device_lookup(acb->host, ++ 0, target, lun); ++ if (psdev != NULL) { ++ scsi_remove_device(psdev); ++ scsi_device_put(psdev); + } +- devicemap++; +- acb_dev_map++; + } ++ temp >>= 1; ++ diff >>= 1; + } + } ++ devicemap++; ++ acb_dev_map++; + } + } + diff --git a/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch b/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch new file mode 100644 index 000000000..10aa0e8f7 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch @@ -0,0 +1,52 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:01:28 +0800 +Subject: [08/19] arcmsr: remove calling arcmsr_hbb_enable_driver_mode +Origin: https://git.kernel.org/linus/a5849726bc88506e84e5754d6bfde81ba091f24d +Bug-Debian: https://bugs.debian.org/698821 + +Remove calling arcmsr_hbb_enable_driver_mode by in-lining the code into +the caller. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index bfe2ac4..5dd520b 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -858,17 +858,6 @@ static uint8_t arcmsr_abort_allcmd(struct AdapterControlBlock *acb) + return rtnval; + } + +-static bool arcmsr_hbb_enable_driver_mode(struct AdapterControlBlock *pacb) +-{ +- struct MessageUnit_B *reg = pacb->pmuB; +- writel(ARCMSR_MESSAGE_START_DRIVER_MODE, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(pacb)) { +- printk(KERN_ERR "arcmsr%d: can't set driver mode. \n", pacb->host->host_no); +- return false; +- } +- return true; +-} +- + static void arcmsr_pci_unmap_dma(struct CommandControlBlock *ccb) + { + struct scsi_cmnd *pcmd = ccb->pcmd; +@@ -2665,7 +2654,12 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + timeout \n",acb->host->host_no); + return 1; + } +- arcmsr_hbb_enable_driver_mode(acb); ++ writel(ARCMSR_MESSAGE_START_DRIVER_MODE, reg->drv2iop_doorbell); ++ if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ pr_err("arcmsr%d: can't set driver mode.\n", ++ acb->host->host_no); ++ return 1; ++ } + } + break; + case ACB_ADAPTER_TYPE_C: { diff --git a/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch b/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch new file mode 100644 index 000000000..570296445 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch @@ -0,0 +1,61 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:03:55 +0800 +Subject: [09/19] arcmsr: modify printing adapter model number and F/W messages +Origin: https://git.kernel.org/linus/a2c89bbccac476d42a8526c0c59d081d9e56d0a8 +Bug-Debian: https://bugs.debian.org/698821 + +Adjust printing order of adapter model name and firmware version. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 5dd520b..0707677 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -2207,10 +2207,10 @@ static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) + iop_device_map++; + count--; + } +- printk(KERN_NOTICE "Areca RAID Controller%d: F/W %s & Model %s\n", ++ pr_notice("Areca RAID Controller%d: Model %s, F/W %s\n", + acb->host->host_no, +- acb->firm_version, +- acb->firm_model); ++ acb->firm_model, ++ acb->firm_version); + acb->signature = readl(®->message_rwbuffer[0]); + acb->firm_request_len = readl(®->message_rwbuffer[1]); + acb->firm_numbers_queue = readl(®->message_rwbuffer[2]); +@@ -2283,10 +2283,10 @@ static bool arcmsr_get_hbb_config(struct AdapterControlBlock *acb) + count--; + } + +- printk(KERN_NOTICE "Areca RAID Controller%d: F/W %s & Model %s\n", ++ pr_notice("Areca RAID Controller%d: Model %s, F/W %s\n", + acb->host->host_no, +- acb->firm_version, +- acb->firm_model); ++ acb->firm_model, ++ acb->firm_version); + + acb->signature = readl(®->message_rwbuffer[1]); + /*firm_signature,1,00-03*/ +@@ -2349,10 +2349,10 @@ static bool arcmsr_get_hbc_config(struct AdapterControlBlock *pACB) + iop_firm_version++; + count--; + } +- printk(KERN_NOTICE "Areca RAID Controller%d: F/W %s & Model %s\n", ++ pr_notice("Areca RAID Controller%d: Model %s, F/W %s\n", + pACB->host->host_no, +- pACB->firm_version, +- pACB->firm_model); ++ pACB->firm_model, ++ pACB->firm_version); + pACB->firm_request_len = readl(®->msgcode_rwbuffer[1]); /*firm_request_len,1,04-07*/ + pACB->firm_numbers_queue = readl(®->msgcode_rwbuffer[2]); /*firm_numbers_queue,2,08-11*/ + pACB->firm_sdram_size = readl(®->msgcode_rwbuffer[3]); /*firm_sdram_size,3,12-15*/ diff --git a/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch b/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch new file mode 100644 index 000000000..18c6b341b --- /dev/null +++ b/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch @@ -0,0 +1,57 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:07:35 +0800 +Subject: [10/19] arcmsr: clear outbound doorbell buffer completely +Origin: https://git.kernel.org/linus/5eb6bfa02a9dfecbb1f644a0b13b16cd3d23770b +Bug-Debian: https://bugs.debian.org/698821 + +Clear outbound doorbell buffer completely for adapter type C. This is to +prevent getting bad data input from IOP before ioctl command processing +starts. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 0707677..3363c31 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -2870,11 +2870,23 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_C: { + struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; +- uint32_t outbound_doorbell; ++ uint32_t outbound_doorbell, i; + /* empty doorbell Qbuffer if door bell ringed */ + outbound_doorbell = readl(®->outbound_doorbell); + writel(outbound_doorbell, ®->outbound_doorbell_clear); + writel(ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK, ®->inbound_doorbell); ++ for (i = 0; i < 200; i++) { ++ msleep(20); ++ outbound_doorbell = readl(®->outbound_doorbell); ++ if (outbound_doorbell & ++ ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) { ++ writel(outbound_doorbell, ++ ®->outbound_doorbell_clear); ++ writel(ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK, ++ ®->inbound_doorbell); ++ } else ++ break; ++ } + } + } + } +@@ -3102,9 +3114,7 @@ sleep: + arcmsr_get_firmware_spec(acb); + arcmsr_start_adapter_bgrb(acb); + /* clear Qbuffer if door bell ringed */ +- outbound_doorbell = readl(®->outbound_doorbell); +- writel(outbound_doorbell, ®->outbound_doorbell_clear); /*clear interrupt */ +- writel(ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK, ®->inbound_doorbell); ++ arcmsr_clear_doorbell_queue_buffer(acb); + /* enable outbound Post Queue,outbound doorbell Interrupt */ + arcmsr_enable_outbound_ints(acb, intmask_org); + atomic_set(&acb->rq_map_token, 16); diff --git a/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch b/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch new file mode 100644 index 000000000..c2b18f418 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch @@ -0,0 +1,857 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:10:12 +0800 +Subject: [11/19] arcmsr: rename functions and variables +Origin: https://git.kernel.org/linus/626fa32c801ed583594831051ff9fd56f2e6d261 +Bug-Debian: https://bugs.debian.org/698821 + +Rename some variable and function names for readability and consistency. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 6 +- + drivers/scsi/arcmsr/arcmsr_hba.c | 234 ++++++++++++++++++++------------------- + 2 files changed, 121 insertions(+), 119 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 0ae0ce3..6d616be 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -359,7 +359,7 @@ struct ARCMSR_CDB + #define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 + + uint8_t msgPages; +- uint32_t Context; ++ uint32_t msgContext; + uint32_t DataLength; + uint8_t Cdb[16]; + uint8_t DeviceStatus; +@@ -562,7 +562,7 @@ struct AdapterControlBlock + /* dma_coherent used for memory free */ + dma_addr_t dma_coherent_handle; + /* dma_coherent_handle used for memory free */ +- dma_addr_t dma_coherent_handle_hbb_mu; ++ dma_addr_t dma_coherent_handle2; + unsigned int uncache_size; + uint8_t rqbuffer[ARCMSR_MAX_QBUFFER]; + /* data collection buffer for read from 80331 */ +@@ -613,7 +613,7 @@ struct CommandControlBlock{ + struct list_head list; /*x32: 8byte, x64: 16byte*/ + struct scsi_cmnd *pcmd; /*8 bytes pointer of linux scsi command */ + struct AdapterControlBlock *acb; /*x32: 4byte, x64: 8byte*/ +- uint32_t cdb_phyaddr_pattern; /*x32: 4byte, x64: 4byte*/ ++ uint32_t cdb_phyaddr; /*x32: 4byte, x64: 4byte*/ + uint32_t arc_cdb_size; /*x32:4byte,x64:4byte*/ + uint16_t ccb_flags; /*x32: 2byte, x64: 2byte*/ + #define CCB_FLAG_READ 0x0000 +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 3363c31..7253323 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -99,16 +99,16 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb); + static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, + u32 intmask_org); + static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb); +-static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb); +-static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb); ++static void arcmsr_hbaA_flush_cache(struct AdapterControlBlock *acb); ++static void arcmsr_hbaB_flush_cache(struct AdapterControlBlock *acb); + static void arcmsr_request_device_map(unsigned long pacb); +-static void arcmsr_request_hba_device_map(struct AdapterControlBlock *acb); +-static void arcmsr_request_hbb_device_map(struct AdapterControlBlock *acb); +-static void arcmsr_request_hbc_device_map(struct AdapterControlBlock *acb); ++static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb); ++static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb); ++static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb); + static void arcmsr_message_isr_bh_fn(struct work_struct *work); + static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb); + static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb); +-static void arcmsr_hbc_message_isr(struct AdapterControlBlock *pACB); ++static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *pACB); + static void arcmsr_hardware_reset(struct AdapterControlBlock *acb); + static const char *arcmsr_info(struct Scsi_Host *); + static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb); +@@ -201,7 +201,7 @@ static struct pci_driver arcmsr_pci_driver = { + **************************************************************************** + */ + +-static void arcmsr_free_hbb_mu(struct AdapterControlBlock *acb) ++static void arcmsr_free_mu(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: +@@ -210,7 +210,7 @@ static void arcmsr_free_hbb_mu(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_B:{ + dma_free_coherent(&acb->pdev->dev, + sizeof(struct MessageUnit_B), +- acb->pmuB, acb->dma_coherent_handle_hbb_mu); ++ acb->pmuB, acb->dma_coherent_handle2); + } + } + } +@@ -316,7 +316,7 @@ static int arcmsr_bios_param(struct scsi_device *sdev, + return 0; + } + +-static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb) ++static uint8_t arcmsr_hbaA_wait_msgint_ready(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + int i; +@@ -334,7 +334,7 @@ static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb) + return false; + } + +-static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb) ++static uint8_t arcmsr_hbaB_wait_msgint_ready(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + int i; +@@ -354,7 +354,7 @@ static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb) + return false; + } + +-static uint8_t arcmsr_hbc_wait_msgint_ready(struct AdapterControlBlock *pACB) ++static uint8_t arcmsr_hbaC_wait_msgint_ready(struct AdapterControlBlock *pACB) + { + struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)pACB->pmuC; + int i; +@@ -372,13 +372,13 @@ static uint8_t arcmsr_hbc_wait_msgint_ready(struct AdapterControlBlock *pACB) + return false; + } + +-static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_flush_cache(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + int retry_count = 30; + writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, ®->inbound_msgaddr0); + do { +- if (arcmsr_hba_wait_msgint_ready(acb)) ++ if (arcmsr_hbaA_wait_msgint_ready(acb)) + break; + else { + retry_count--; +@@ -388,13 +388,13 @@ static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) + } while (retry_count != 0); + } + +-static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb) ++static void arcmsr_hbaB_flush_cache(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + int retry_count = 30; + writel(ARCMSR_MESSAGE_FLUSH_CACHE, reg->drv2iop_doorbell); + do { +- if (arcmsr_hbb_wait_msgint_ready(acb)) ++ if (arcmsr_hbaB_wait_msgint_ready(acb)) + break; + else { + retry_count--; +@@ -404,14 +404,14 @@ static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb) + } while (retry_count != 0); + } + +-static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *pACB) ++static void arcmsr_hbaC_flush_cache(struct AdapterControlBlock *pACB) + { + struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; + int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ + writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); + do { +- if (arcmsr_hbc_wait_msgint_ready(pACB)) { ++ if (arcmsr_hbaC_wait_msgint_ready(pACB)) { + break; + } else { + retry_count--; +@@ -426,16 +426,16 @@ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) + switch (acb->adapter_type) { + + case ACB_ADAPTER_TYPE_A: { +- arcmsr_flush_hba_cache(acb); ++ arcmsr_hbaA_flush_cache(acb); + } + break; + + case ACB_ADAPTER_TYPE_B: { +- arcmsr_flush_hbb_cache(acb); ++ arcmsr_hbaB_flush_cache(acb); + } + break; + case ACB_ADAPTER_TYPE_C: { +- arcmsr_flush_hbc_cache(acb); ++ arcmsr_hbaC_flush_cache(acb); + } + } + } +@@ -480,7 +480,9 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) + acb->vir2phy_offset = (unsigned long)dma_coherent - (unsigned long)dma_coherent_handle; + for(i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++){ + cdb_phyaddr = dma_coherent_handle + offsetof(struct CommandControlBlock, arcmsr_cdb); +- ccb_tmp->cdb_phyaddr_pattern = ((acb->adapter_type == ACB_ADAPTER_TYPE_C) ? cdb_phyaddr : (cdb_phyaddr >> 5)); ++ ccb_tmp->cdb_phyaddr = ++ ((acb->adapter_type == ACB_ADAPTER_TYPE_C) ? ++ cdb_phyaddr : (cdb_phyaddr >> 5)); + acb->pccb_pool[i] = ccb_tmp; + ccb_tmp->acb = acb; + INIT_LIST_HEAD(&ccb_tmp->list); +@@ -700,7 +702,7 @@ RAID_controller_stop: + arcmsr_flush_adapter_cache(acb); + arcmsr_free_ccb_pool(acb); + free_hbb_mu: +- arcmsr_free_hbb_mu(acb); ++ arcmsr_free_mu(acb); + unmap_pci_region: + arcmsr_unmap_pciregion(acb); + pci_release_regs: +@@ -798,40 +800,40 @@ controller_unregister: + return -ENODEV; + } + +-static uint8_t arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb) ++static uint8_t arcmsr_hbaA_abort_allcmd(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, ®->inbound_msgaddr0); +- if (!arcmsr_hba_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaA_wait_msgint_ready(acb)) { + printk(KERN_NOTICE +- "arcmsr%d: wait 'abort all outstanding command' timeout \n" ++ "arcmsr%d: wait 'abort all outstanding command' timeout\n" + , acb->host->host_no); + return false; + } + return true; + } + +-static uint8_t arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb) ++static uint8_t arcmsr_hbaB_abort_allcmd(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + + writel(ARCMSR_MESSAGE_ABORT_CMD, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE +- "arcmsr%d: wait 'abort all outstanding command' timeout \n" ++ "arcmsr%d: wait 'abort all outstanding command' timeout\n" + , acb->host->host_no); + return false; + } + return true; + } +-static uint8_t arcmsr_abort_hbc_allcmd(struct AdapterControlBlock *pACB) ++static uint8_t arcmsr_hbaC_abort_allcmd(struct AdapterControlBlock *pACB) + { + struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; + writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); +- if (!arcmsr_hbc_wait_msgint_ready(pACB)) { ++ if (!arcmsr_hbaC_wait_msgint_ready(pACB)) { + printk(KERN_NOTICE +- "arcmsr%d: wait 'abort all outstanding command' timeout \n" ++ "arcmsr%d: wait 'abort all outstanding command' timeout\n" + , pACB->host->host_no); + return false; + } +@@ -842,17 +844,17 @@ static uint8_t arcmsr_abort_allcmd(struct AdapterControlBlock *acb) + uint8_t rtnval = 0; + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: { +- rtnval = arcmsr_abort_hba_allcmd(acb); ++ rtnval = arcmsr_hbaA_abort_allcmd(acb); + } + break; + + case ACB_ADAPTER_TYPE_B: { +- rtnval = arcmsr_abort_hbb_allcmd(acb); ++ rtnval = arcmsr_hbaB_abort_allcmd(acb); + } + break; + + case ACB_ADAPTER_TYPE_C: { +- rtnval = arcmsr_abort_hbc_allcmd(acb); ++ rtnval = arcmsr_hbaC_abort_allcmd(acb); + } + } + return rtnval; +@@ -1109,7 +1111,7 @@ static void arcmsr_remove(struct pci_dev *pdev) + } + arcmsr_free_irq(pdev, acb); + arcmsr_free_ccb_pool(acb); +- arcmsr_free_hbb_mu(acb); ++ arcmsr_free_mu(acb); + arcmsr_unmap_pciregion(acb); + pci_release_regions(pdev); + scsi_host_put(host); +@@ -1194,7 +1196,7 @@ static int arcmsr_build_ccb(struct AdapterControlBlock *acb, + arcmsr_cdb->TargetID = pcmd->device->id; + arcmsr_cdb->LUN = pcmd->device->lun; + arcmsr_cdb->Function = 1; +- arcmsr_cdb->Context = 0; ++ arcmsr_cdb->msgContext = 0; + memcpy(arcmsr_cdb->Cdb, pcmd->cmnd, pcmd->cmd_len); + + nseg = scsi_dma_map(pcmd); +@@ -1235,7 +1237,7 @@ static int arcmsr_build_ccb(struct AdapterControlBlock *acb, + + static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandControlBlock *ccb) + { +- uint32_t cdb_phyaddr_pattern = ccb->cdb_phyaddr_pattern; ++ uint32_t cdb_phyaddr = ccb->cdb_phyaddr; + struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&ccb->arcmsr_cdb; + atomic_inc(&acb->ccboutstandingcount); + ccb->startdone = ARCMSR_CCB_START; +@@ -1244,13 +1246,12 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + struct MessageUnit_A __iomem *reg = acb->pmuA; + + if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) +- writel(cdb_phyaddr_pattern | ARCMSR_CCBPOST_FLAG_SGL_BSIZE, ++ writel(cdb_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE, + ®->inbound_queueport); +- else { +- writel(cdb_phyaddr_pattern, ®->inbound_queueport); +- } +- } ++ else ++ writel(cdb_phyaddr, ®->inbound_queueport); + break; ++ } + + case ACB_ADAPTER_TYPE_B: { + struct MessageUnit_B *reg = acb->pmuB; +@@ -1259,10 +1260,10 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + ending_index = ((index + 1) % ARCMSR_MAX_HBB_POSTQUEUE); + writel(0, ®->post_qbuffer[ending_index]); + if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) { +- writel(cdb_phyaddr_pattern | ARCMSR_CCBPOST_FLAG_SGL_BSIZE,\ ++ writel(cdb_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE, + ®->post_qbuffer[index]); + } else { +- writel(cdb_phyaddr_pattern, ®->post_qbuffer[index]); ++ writel(cdb_phyaddr, ®->post_qbuffer[index]); + } + index++; + index %= ARCMSR_MAX_HBB_POSTQUEUE;/*if last index number set it to 0 */ +@@ -1275,7 +1276,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + uint32_t ccb_post_stamp, arc_cdb_size; + + arc_cdb_size = (ccb->arc_cdb_size > 0x300) ? 0x300 : ccb->arc_cdb_size; +- ccb_post_stamp = (cdb_phyaddr_pattern | ((arc_cdb_size - 1) >> 6) | 1); ++ ccb_post_stamp = (cdb_phyaddr | ((arc_cdb_size - 1) >> 6) | 1); + if (acb->cdb_phyaddr_hi32) { + writel(acb->cdb_phyaddr_hi32, &phbcmu->inbound_queueport_high); + writel(ccb_post_stamp, &phbcmu->inbound_queueport_low); +@@ -1286,40 +1287,40 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + } + } + +-static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_stop_bgrb(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + acb->acb_flags &= ~ACB_F_MSG_START_BGRB; + writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, ®->inbound_msgaddr0); +- if (!arcmsr_hba_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaA_wait_msgint_ready(acb)) { + printk(KERN_NOTICE +- "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" ++ "arcmsr%d: wait 'stop adapter background rebulid' timeout\n" + , acb->host->host_no); + } + } + +-static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb) ++static void arcmsr_hbaB_stop_bgrb(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + acb->acb_flags &= ~ACB_F_MSG_START_BGRB; + writel(ARCMSR_MESSAGE_STOP_BGRB, reg->drv2iop_doorbell); + +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE +- "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" ++ "arcmsr%d: wait 'stop adapter background rebulid' timeout\n" + , acb->host->host_no); + } + } + +-static void arcmsr_stop_hbc_bgrb(struct AdapterControlBlock *pACB) ++static void arcmsr_hbaC_stop_bgrb(struct AdapterControlBlock *pACB) + { + struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; + pACB->acb_flags &= ~ACB_F_MSG_START_BGRB; + writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); +- if (!arcmsr_hbc_wait_msgint_ready(pACB)) { ++ if (!arcmsr_hbaC_wait_msgint_ready(pACB)) { + printk(KERN_NOTICE +- "arcmsr%d: wait 'stop adapter background rebulid' timeout \n" ++ "arcmsr%d: wait 'stop adapter background rebulid' timeout\n" + , pACB->host->host_no); + } + return; +@@ -1328,16 +1329,16 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: { +- arcmsr_stop_hba_bgrb(acb); ++ arcmsr_hbaA_stop_bgrb(acb); + } + break; + + case ACB_ADAPTER_TYPE_B: { +- arcmsr_stop_hbb_bgrb(acb); ++ arcmsr_hbaB_stop_bgrb(acb); + } + break; + case ACB_ADAPTER_TYPE_C: { +- arcmsr_stop_hbc_bgrb(acb); ++ arcmsr_hbaC_stop_bgrb(acb); + } + } + } +@@ -1515,7 +1516,7 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) + } + } + +-static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_doorbell_isr(struct AdapterControlBlock *acb) + { + uint32_t outbound_doorbell; + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -1530,7 +1531,7 @@ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) + } while (outbound_doorbell & (ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK + | ARCMSR_OUTBOUND_IOP331_DATA_READ_OK)); + } +-static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *pACB) ++static void arcmsr_hbaC_doorbell_isr(struct AdapterControlBlock *pACB) + { + uint32_t outbound_doorbell; + struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; +@@ -1550,13 +1551,13 @@ static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *pACB) + if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK) + arcmsr_iop2drv_data_read_handle(pACB); + if (outbound_doorbell & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) +- arcmsr_hbc_message_isr(pACB); ++ arcmsr_hbaC_message_isr(pACB); + outbound_doorbell = readl(®->outbound_doorbell); + } while (outbound_doorbell & (ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK + | ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK + | ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE)); + } +-static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_postqueue_isr(struct AdapterControlBlock *acb) + { + uint32_t flag_ccb; + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -1570,7 +1571,7 @@ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) + arcmsr_drain_donequeue(acb, pCCB, error); + } + } +-static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb) + { + uint32_t index; + uint32_t flag_ccb; +@@ -1591,7 +1592,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb) + } + } + +-static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) + { + struct MessageUnit_C *phbcmu; + struct ARCMSR_CDB *arcmsr_cdb; +@@ -1630,14 +1631,14 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb) + ** We want this in order to compare the drivemap so that we can detect newly-attached drives. + ********************************************************************************** + */ +-static void arcmsr_hba_message_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_message_isr(struct AdapterControlBlock *acb) + { + struct MessageUnit_A *reg = acb->pmuA; + /*clear interrupt and message state*/ + writel(ARCMSR_MU_OUTBOUND_MESSAGE0_INT, ®->outbound_intstatus); + schedule_work(&acb->arcmsr_do_message_isr_bh); + } +-static void arcmsr_hbb_message_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaB_message_isr(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + +@@ -1654,7 +1655,7 @@ static void arcmsr_hbb_message_isr(struct AdapterControlBlock *acb) + ** We want this in order to compare the drivemap so that we can detect newly-attached drives. + ********************************************************************************** + */ +-static void arcmsr_hbc_message_isr(struct AdapterControlBlock *acb) ++static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *acb) + { + struct MessageUnit_C *reg = acb->pmuC; + /*clear interrupt and message state*/ +@@ -1662,7 +1663,7 @@ static void arcmsr_hbc_message_isr(struct AdapterControlBlock *acb) + schedule_work(&acb->arcmsr_do_message_isr_bh); + } + +-static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) ++static int arcmsr_hbaA_handle_isr(struct AdapterControlBlock *acb) + { + uint32_t outbound_intstatus; + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -1673,11 +1674,11 @@ static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) + do { + writel(outbound_intstatus, ®->outbound_intstatus); + if (outbound_intstatus & ARCMSR_MU_OUTBOUND_DOORBELL_INT) +- arcmsr_hba_doorbell_isr(acb); ++ arcmsr_hbaA_doorbell_isr(acb); + if (outbound_intstatus & ARCMSR_MU_OUTBOUND_POSTQUEUE_INT) +- arcmsr_hba_postqueue_isr(acb); ++ arcmsr_hbaA_postqueue_isr(acb); + if (outbound_intstatus & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) +- arcmsr_hba_message_isr(acb); ++ arcmsr_hbaA_message_isr(acb); + outbound_intstatus = readl(®->outbound_intstatus) & + acb->outbound_int_enable; + } while (outbound_intstatus & (ARCMSR_MU_OUTBOUND_DOORBELL_INT +@@ -1686,7 +1687,7 @@ static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) + return IRQ_HANDLED; + } + +-static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) ++static int arcmsr_hbaB_handle_isr(struct AdapterControlBlock *acb) + { + uint32_t outbound_doorbell; + struct MessageUnit_B *reg = acb->pmuB; +@@ -1702,9 +1703,9 @@ static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) + if (outbound_doorbell & ARCMSR_IOP2DRV_DATA_READ_OK) + arcmsr_iop2drv_data_read_handle(acb); + if (outbound_doorbell & ARCMSR_IOP2DRV_CDB_DONE) +- arcmsr_hbb_postqueue_isr(acb); ++ arcmsr_hbaB_postqueue_isr(acb); + if (outbound_doorbell & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) +- arcmsr_hbb_message_isr(acb); ++ arcmsr_hbaB_message_isr(acb); + outbound_doorbell = readl(reg->iop2drv_doorbell) & + acb->outbound_int_enable; + } while (outbound_doorbell & (ARCMSR_IOP2DRV_DATA_WRITE_OK +@@ -1714,7 +1715,7 @@ static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) + return IRQ_HANDLED; + } + +-static int arcmsr_handle_hbc_isr(struct AdapterControlBlock *pACB) ++static int arcmsr_hbaC_handle_isr(struct AdapterControlBlock *pACB) + { + uint32_t host_interrupt_status; + struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)pACB->pmuC; +@@ -1730,10 +1731,10 @@ static int arcmsr_handle_hbc_isr(struct AdapterControlBlock *pACB) + return IRQ_NONE; + do { + if (host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR) +- arcmsr_hbc_doorbell_isr(pACB); ++ arcmsr_hbaC_doorbell_isr(pACB); + /* MU post queue interrupts*/ + if (host_interrupt_status & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) +- arcmsr_hbc_postqueue_isr(pACB); ++ arcmsr_hbaC_postqueue_isr(pACB); + host_interrupt_status = readl(&phbcmu->host_int_status); + } while (host_interrupt_status & (ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR | + ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); +@@ -1743,13 +1744,13 @@ static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: +- return arcmsr_handle_hba_isr(acb); ++ return arcmsr_hbaA_handle_isr(acb); + break; + case ACB_ADAPTER_TYPE_B: +- return arcmsr_handle_hbb_isr(acb); ++ return arcmsr_hbaB_handle_isr(acb); + break; + case ACB_ADAPTER_TYPE_C: +- return arcmsr_handle_hbc_isr(acb); ++ return arcmsr_hbaC_handle_isr(acb); + default: + return IRQ_NONE; + } +@@ -2168,7 +2169,7 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, + + static DEF_SCSI_QCMD(arcmsr_queue_command) + +-static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) ++static bool arcmsr_hbaA_get_config(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + char *acb_firm_model = acb->firm_model; +@@ -2179,7 +2180,7 @@ static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) + char __iomem *iop_device_map = (char __iomem *)(®->message_rwbuffer[21]); + int count; + writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); +- if (!arcmsr_hba_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaA_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \ + miscellaneous data' timeout \n", acb->host->host_no); + return false; +@@ -2219,7 +2220,7 @@ static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) + acb->firm_cfg_version = readl(®->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/ + return true; + } +-static bool arcmsr_get_hbb_config(struct AdapterControlBlock *acb) ++static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + struct pci_dev *pdev = acb->pdev; +@@ -2240,7 +2241,7 @@ static bool arcmsr_get_hbb_config(struct AdapterControlBlock *acb) + printk(KERN_NOTICE "arcmsr%d: dma_alloc_coherent got error for hbb mu\n", acb->host->host_no); + return false; + } +- acb->dma_coherent_handle_hbb_mu = dma_coherent_handle; ++ acb->dma_coherent_handle2 = dma_coherent_handle; + reg = (struct MessageUnit_B *)dma_coherent; + acb->pmuB = reg; + reg->drv2iop_doorbell= (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL); +@@ -2255,7 +2256,7 @@ static bool arcmsr_get_hbb_config(struct AdapterControlBlock *acb) + iop_device_map = (char __iomem *)(®->message_rwbuffer[21]); /*firm_version,21,84-99*/ + + writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \ + miscellaneous data' timeout \n", acb->host->host_no); + return false; +@@ -2303,7 +2304,7 @@ static bool arcmsr_get_hbb_config(struct AdapterControlBlock *acb) + return true; + } + +-static bool arcmsr_get_hbc_config(struct AdapterControlBlock *pACB) ++static bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB) + { + uint32_t intmask_org, Index, firmware_state = 0; + struct MessageUnit_C *reg = pACB->pmuC; +@@ -2367,13 +2368,13 @@ static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) + + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: +- rtn = arcmsr_get_hba_config(acb); ++ rtn = arcmsr_hbaA_get_config(acb); + break; + case ACB_ADAPTER_TYPE_B: +- rtn = arcmsr_get_hbb_config(acb); ++ rtn = arcmsr_hbaB_get_config(acb); + break; + case ACB_ADAPTER_TYPE_C: +- rtn = arcmsr_get_hbc_config(acb); ++ rtn = arcmsr_hbaC_get_config(acb); + break; + default: + break; +@@ -2386,7 +2387,7 @@ static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) + return rtn; + } + +-static int arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb, ++static int arcmsr_hbaA_polling_ccbdone(struct AdapterControlBlock *acb, + struct CommandControlBlock *poll_ccb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -2442,7 +2443,7 @@ static int arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb, + return rtn; + } + +-static int arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, ++static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, + struct CommandControlBlock *poll_ccb) + { + struct MessageUnit_B *reg = acb->pmuB; +@@ -2506,7 +2507,8 @@ static int arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, + return rtn; + } + +-static int arcmsr_polling_hbc_ccbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_ccb) ++static int arcmsr_hbaC_polling_ccbdone(struct AdapterControlBlock *acb, ++ struct CommandControlBlock *poll_ccb) + { + struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; + uint32_t flag_ccb, ccb_cdb_phy; +@@ -2569,16 +2571,16 @@ static int arcmsr_polling_ccbdone(struct AdapterControlBlock *acb, + switch (acb->adapter_type) { + + case ACB_ADAPTER_TYPE_A: { +- rtn = arcmsr_polling_hba_ccbdone(acb, poll_ccb); ++ rtn = arcmsr_hbaA_polling_ccbdone(acb, poll_ccb); + } + break; + + case ACB_ADAPTER_TYPE_B: { +- rtn = arcmsr_polling_hbb_ccbdone(acb, poll_ccb); ++ rtn = arcmsr_hbaB_polling_ccbdone(acb, poll_ccb); + } + break; + case ACB_ADAPTER_TYPE_C: { +- rtn = arcmsr_polling_hbc_ccbdone(acb, poll_ccb); ++ rtn = arcmsr_hbaC_polling_ccbdone(acb, poll_ccb); + } + } + return rtn; +@@ -2612,7 +2614,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + writel(cdb_phyaddr_hi32, ®->message_rwbuffer[1]); + writel(ARCMSR_INBOUND_MESG0_SET_CONFIG, \ + ®->inbound_msgaddr0); +- if (!arcmsr_hba_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaA_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: ""set ccb high \ + part physical address timeout\n", + acb->host->host_no); +@@ -2630,12 +2632,12 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + reg->postq_index = 0; + reg->doneq_index = 0; + writel(ARCMSR_MESSAGE_SET_POST_WINDOW, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d:can not set diver mode\n", \ + acb->host->host_no); + return 1; + } +- post_queue_phyaddr = acb->dma_coherent_handle_hbb_mu; ++ post_queue_phyaddr = acb->dma_coherent_handle2; + rwbuffer = reg->message_rwbuffer; + /* driver "set config" signature */ + writel(ARCMSR_SIGNATURE_SET_CONFIG, rwbuffer++); +@@ -2649,13 +2651,13 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + writel(1056, rwbuffer); + + writel(ARCMSR_MESSAGE_SET_CONFIG, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: 'set command Q window' \ + timeout \n",acb->host->host_no); + return 1; + } + writel(ARCMSR_MESSAGE_START_DRIVER_MODE, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + pr_err("arcmsr%d: can't set driver mode.\n", + acb->host->host_no); + return 1; +@@ -2672,7 +2674,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + writel(cdb_phyaddr_hi32, ®->msgcode_rwbuffer[1]); + writel(ARCMSR_INBOUND_MESG0_SET_CONFIG, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); +- if (!arcmsr_hbc_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaC_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: 'set command Q window' \ + timeout \n", acb->host->host_no); + return 1; +@@ -2713,7 +2715,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) + } + } + +-static void arcmsr_request_hba_device_map(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ +@@ -2735,7 +2737,7 @@ static void arcmsr_request_hba_device_map(struct AdapterControlBlock *acb) + return; + } + +-static void arcmsr_request_hbb_device_map(struct AdapterControlBlock *acb) ++static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb) + { + struct MessageUnit_B __iomem *reg = acb->pmuB; + if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ +@@ -2757,7 +2759,7 @@ static void arcmsr_request_hbb_device_map(struct AdapterControlBlock *acb) + return; + } + +-static void arcmsr_request_hbc_device_map(struct AdapterControlBlock *acb) ++static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb) + { + struct MessageUnit_C __iomem *reg = acb->pmuC; + if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0) || ((acb->acb_flags & ACB_F_ABORT) != 0)) { +@@ -2785,48 +2787,48 @@ static void arcmsr_request_device_map(unsigned long pacb) + struct AdapterControlBlock *acb = (struct AdapterControlBlock *)pacb; + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: { +- arcmsr_request_hba_device_map(acb); ++ arcmsr_hbaA_request_device_map(acb); + } + break; + case ACB_ADAPTER_TYPE_B: { +- arcmsr_request_hbb_device_map(acb); ++ arcmsr_hbaB_request_device_map(acb); + } + break; + case ACB_ADAPTER_TYPE_C: { +- arcmsr_request_hbc_device_map(acb); ++ arcmsr_hbaC_request_device_map(acb); + } + } + } + +-static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb) ++static void arcmsr_hbaA_start_bgrb(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; + acb->acb_flags |= ACB_F_MSG_START_BGRB; + writel(ARCMSR_INBOUND_MESG0_START_BGRB, ®->inbound_msgaddr0); +- if (!arcmsr_hba_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaA_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: wait 'start adapter background \ + rebulid' timeout \n", acb->host->host_no); + } + } + +-static void arcmsr_start_hbb_bgrb(struct AdapterControlBlock *acb) ++static void arcmsr_hbaB_start_bgrb(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + acb->acb_flags |= ACB_F_MSG_START_BGRB; + writel(ARCMSR_MESSAGE_START_BGRB, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "arcmsr%d: wait 'start adapter background \ + rebulid' timeout \n",acb->host->host_no); + } + } + +-static void arcmsr_start_hbc_bgrb(struct AdapterControlBlock *pACB) ++static void arcmsr_hbaC_start_bgrb(struct AdapterControlBlock *pACB) + { + struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)pACB->pmuC; + pACB->acb_flags |= ACB_F_MSG_START_BGRB; + writel(ARCMSR_INBOUND_MESG0_START_BGRB, &phbcmu->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, &phbcmu->inbound_doorbell); +- if (!arcmsr_hbc_wait_msgint_ready(pACB)) { ++ if (!arcmsr_hbaC_wait_msgint_ready(pACB)) { + printk(KERN_NOTICE "arcmsr%d: wait 'start adapter background \ + rebulid' timeout \n", pACB->host->host_no); + } +@@ -2836,13 +2838,13 @@ static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: +- arcmsr_start_hba_bgrb(acb); ++ arcmsr_hbaA_start_bgrb(acb); + break; + case ACB_ADAPTER_TYPE_B: +- arcmsr_start_hbb_bgrb(acb); ++ arcmsr_hbaB_start_bgrb(acb); + break; + case ACB_ADAPTER_TYPE_C: +- arcmsr_start_hbc_bgrb(acb); ++ arcmsr_hbaC_start_bgrb(acb); + } + } + +@@ -2900,7 +2902,7 @@ static void arcmsr_enable_eoi_mode(struct AdapterControlBlock *acb) + { + struct MessageUnit_B *reg = acb->pmuB; + writel(ARCMSR_MESSAGE_ACTIVE_EOI_MODE, reg->drv2iop_doorbell); +- if (!arcmsr_hbb_wait_msgint_ready(acb)) { ++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) { + printk(KERN_NOTICE "ARCMSR IOP enables EOI_MODE TIMEOUT"); + return; + } diff --git a/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch b/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch new file mode 100644 index 000000000..b5aeee9eb --- /dev/null +++ b/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch @@ -0,0 +1,134 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:14:14 +0800 +Subject: [12/19] arcmsr: revise allocation of second dma_coherent_handle for + type B +Origin: https://git.kernel.org/linus/6e38adfc58406e7ea6f6701c49abaf046ce076a8 +Bug-Debian: https://bugs.debian.org/698821 + +This modification is for consistency with upcoming adapter type D. +Both adapter type B and D have similar H/W and S/W structure. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 2 ++ + drivers/scsi/arcmsr/arcmsr_hba.c | 38 ++++++++++++++++++++++++-------------- + 2 files changed, 26 insertions(+), 14 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 6d616be..83c0a7d 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -507,6 +507,7 @@ struct AdapterControlBlock + #define ACB_ADAPTER_TYPE_B 0x00000002 /* hbb M IOP */ + #define ACB_ADAPTER_TYPE_C 0x00000004 /* hbc P IOP */ + #define ACB_ADAPTER_TYPE_D 0x00000008 /* hbd A IOP */ ++ u32 roundup_ccbsize; + struct pci_dev * pdev; + struct Scsi_Host * host; + unsigned long vir2phy_offset; +@@ -563,6 +564,7 @@ struct AdapterControlBlock + dma_addr_t dma_coherent_handle; + /* dma_coherent_handle used for memory free */ + dma_addr_t dma_coherent_handle2; ++ void *dma_coherent2; + unsigned int uncache_size; + uint8_t rqbuffer[ARCMSR_MAX_QBUFFER]; + /* data collection buffer for read from 80331 */ +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 7253323..fc0dfbc 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -204,13 +204,10 @@ static struct pci_driver arcmsr_pci_driver = { + static void arcmsr_free_mu(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +- case ACB_ADAPTER_TYPE_A: +- case ACB_ADAPTER_TYPE_C: +- break; + case ACB_ADAPTER_TYPE_B:{ +- dma_free_coherent(&acb->pdev->dev, +- sizeof(struct MessageUnit_B), +- acb->pmuB, acb->dma_coherent_handle2); ++ dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, ++ acb->dma_coherent2, acb->dma_coherent_handle2); ++ break; + } + } + } +@@ -2236,12 +2233,18 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) + char __iomem *iop_device_map; + /*firm_version,21,84-99*/ + int count; +- dma_coherent = dma_alloc_coherent(&pdev->dev, sizeof(struct MessageUnit_B), &dma_coherent_handle, GFP_KERNEL); ++ ++ acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_B), 32); ++ dma_coherent = dma_alloc_coherent(&pdev->dev, acb->roundup_ccbsize, ++ &dma_coherent_handle, GFP_KERNEL); + if (!dma_coherent){ +- printk(KERN_NOTICE "arcmsr%d: dma_alloc_coherent got error for hbb mu\n", acb->host->host_no); ++ printk(KERN_NOTICE ++ "arcmsr%d: dma_alloc_coherent got error for hbb mu\n", ++ acb->host->host_no); + return false; + } + acb->dma_coherent_handle2 = dma_coherent_handle; ++ acb->dma_coherent2 = dma_coherent; + reg = (struct MessageUnit_B *)dma_coherent; + acb->pmuB = reg; + reg->drv2iop_doorbell= (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL); +@@ -2589,6 +2592,7 @@ static int arcmsr_polling_ccbdone(struct AdapterControlBlock *acb, + static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + { + uint32_t cdb_phyaddr, cdb_phyaddr_hi32; ++ dma_addr_t dma_coherent_handle; + + /* + ******************************************************************** +@@ -2596,8 +2600,16 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + ** if freeccb.HighPart is not zero + ******************************************************************** + */ +- cdb_phyaddr = lower_32_bits(acb->dma_coherent_handle); +- cdb_phyaddr_hi32 = upper_32_bits(acb->dma_coherent_handle); ++ switch (acb->adapter_type) { ++ case ACB_ADAPTER_TYPE_B: ++ dma_coherent_handle = acb->dma_coherent_handle2; ++ break; ++ default: ++ dma_coherent_handle = acb->dma_coherent_handle; ++ break; ++ } ++ cdb_phyaddr = lower_32_bits(dma_coherent_handle); ++ cdb_phyaddr_hi32 = upper_32_bits(dma_coherent_handle); + acb->cdb_phyaddr_hi32 = cdb_phyaddr_hi32; + /* + *********************************************************************** +@@ -2625,7 +2637,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + break; + + case ACB_ADAPTER_TYPE_B: { +- unsigned long post_queue_phyaddr; + uint32_t __iomem *rwbuffer; + + struct MessageUnit_B *reg = acb->pmuB; +@@ -2637,16 +2648,15 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + acb->host->host_no); + return 1; + } +- post_queue_phyaddr = acb->dma_coherent_handle2; + rwbuffer = reg->message_rwbuffer; + /* driver "set config" signature */ + writel(ARCMSR_SIGNATURE_SET_CONFIG, rwbuffer++); + /* normal should be zero */ + writel(cdb_phyaddr_hi32, rwbuffer++); + /* postQ size (256 + 8)*4 */ +- writel(post_queue_phyaddr, rwbuffer++); ++ writel(cdb_phyaddr, rwbuffer++); + /* doneQ size (256 + 8)*4 */ +- writel(post_queue_phyaddr + 1056, rwbuffer++); ++ writel(cdb_phyaddr + 1056, rwbuffer++); + /* ccb maxQ size must be --> [(256 + 8)*4]*/ + writel(1056, rwbuffer); + diff --git a/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch b/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch new file mode 100644 index 000000000..426a6ff16 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch @@ -0,0 +1,962 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:17:45 +0800 +Subject: [13/19] arcmsr: fix ioctl data read/write error for adapter type C +Origin: https://git.kernel.org/linus/bb263c4ecbb186fe394c6c9acc32d8c59b6a7bdd +Bug-Debian: https://bugs.debian.org/698821 + +Rewrite ioctl entry and its relate function. This patch fix ioctl data +read/write error and change data I/O access from byte to Dword. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 8 +- + drivers/scsi/arcmsr/arcmsr_attr.c | 101 +++++-- + drivers/scsi/arcmsr/arcmsr_hba.c | 572 ++++++++++++++++++++++++-------------- + 3 files changed, 442 insertions(+), 239 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 83c0a7d..799393e 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -518,6 +518,8 @@ struct AdapterControlBlock + uint32_t reg_mu_acc_handle0; + spinlock_t eh_lock; + spinlock_t ccblist_lock; ++ spinlock_t rqbuffer_lock; ++ spinlock_t wqbuffer_lock; + union { + struct MessageUnit_A __iomem *pmuA; + struct MessageUnit_B *pmuB; +@@ -693,8 +695,10 @@ struct SENSE_DATA + #define ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE 0x01 + #define ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE 0x1F + +-extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *); +-extern void arcmsr_iop_message_read(struct AdapterControlBlock *); ++extern void arcmsr_write_ioctldata2iop(struct AdapterControlBlock *); ++extern uint32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *, ++ struct QBUFFER __iomem *); ++extern void arcmsr_clear_iop2drv_rqueue_buffer(struct AdapterControlBlock *); + extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *); + extern struct device_attribute *arcmsr_host_attrs[]; + extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *); +diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c +index acdae33..16422ad 100644 +--- a/drivers/scsi/arcmsr/arcmsr_attr.c ++++ b/drivers/scsi/arcmsr/arcmsr_attr.c +@@ -70,40 +70,75 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp, + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; + uint8_t *pQbuffer,*ptmpQbuffer; + int32_t allxfer_len = 0; ++ unsigned long flags; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + /* do message unit read. */ + ptmpQbuffer = (uint8_t *)buf; +- while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex) +- && (allxfer_len < 1031)) { ++ spin_lock_irqsave(&acb->rqbuffer_lock, flags); ++ if (acb->rqbuf_firstindex != acb->rqbuf_lastindex) { + pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex]; +- memcpy(ptmpQbuffer, pQbuffer, 1); +- acb->rqbuf_firstindex++; +- acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER; +- ptmpQbuffer++; +- allxfer_len++; ++ if (acb->rqbuf_firstindex > acb->rqbuf_lastindex) { ++ if ((ARCMSR_MAX_QBUFFER - acb->rqbuf_firstindex) >= 1032) { ++ memcpy(ptmpQbuffer, pQbuffer, 1032); ++ acb->rqbuf_firstindex += 1032; ++ acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER; ++ allxfer_len = 1032; ++ } else { ++ if (((ARCMSR_MAX_QBUFFER - acb->rqbuf_firstindex) ++ + acb->rqbuf_lastindex) > 1032) { ++ memcpy(ptmpQbuffer, pQbuffer, ++ ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex); ++ ptmpQbuffer += ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex; ++ memcpy(ptmpQbuffer, acb->rqbuffer, 1032 ++ - (ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex)); ++ acb->rqbuf_firstindex = 1032 - ++ (ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex); ++ allxfer_len = 1032; ++ } else { ++ memcpy(ptmpQbuffer, pQbuffer, ++ ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex); ++ ptmpQbuffer += ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex; ++ memcpy(ptmpQbuffer, acb->rqbuffer, ++ acb->rqbuf_lastindex); ++ allxfer_len = ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex + ++ acb->rqbuf_lastindex; ++ acb->rqbuf_firstindex = ++ acb->rqbuf_lastindex; ++ } ++ } ++ } else { ++ if ((acb->rqbuf_lastindex - acb->rqbuf_firstindex) > 1032) { ++ memcpy(ptmpQbuffer, pQbuffer, 1032); ++ acb->rqbuf_firstindex += 1032; ++ allxfer_len = 1032; ++ } else { ++ memcpy(ptmpQbuffer, pQbuffer, acb->rqbuf_lastindex ++ - acb->rqbuf_firstindex); ++ allxfer_len = acb->rqbuf_lastindex - ++ acb->rqbuf_firstindex; ++ acb->rqbuf_firstindex = acb->rqbuf_lastindex; ++ } ++ } + } + if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { + struct QBUFFER __iomem *prbuffer; +- uint8_t __iomem *iop_data; +- int32_t iop_len; +- + acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; + prbuffer = arcmsr_get_iop_rqbuffer(acb); +- iop_data = prbuffer->data; +- iop_len = readl(&prbuffer->data_len); +- while (iop_len > 0) { +- acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data); +- acb->rqbuf_lastindex++; +- acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; +- iop_data++; +- iop_len--; +- } +- arcmsr_iop_message_read(acb); ++ if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) ++ acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; + } +- return (allxfer_len); ++ spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); ++ return allxfer_len; + } + + static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, +@@ -117,6 +152,7 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; + int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; + uint8_t *pQbuffer, *ptmpuserbuffer; ++ unsigned long flags; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; +@@ -125,18 +161,19 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, + /* do message unit write. */ + ptmpuserbuffer = (uint8_t *)buf; + user_len = (int32_t)count; ++ spin_lock_irqsave(&acb->wqbuffer_lock, flags); + wqbuf_lastindex = acb->wqbuf_lastindex; + wqbuf_firstindex = acb->wqbuf_firstindex; + if (wqbuf_lastindex != wqbuf_firstindex) { +- arcmsr_post_ioctldata2iop(acb); ++ arcmsr_write_ioctldata2iop(acb); ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + return 0; /*need retry*/ + } else { + my_empty_len = (wqbuf_firstindex-wqbuf_lastindex - 1) +- &(ARCMSR_MAX_QBUFFER - 1); ++ &(ARCMSR_MAX_QBUFFER - 1); + if (my_empty_len >= user_len) { + while (user_len > 0) { +- pQbuffer = +- &acb->wqbuffer[acb->wqbuf_lastindex]; ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_lastindex]; + memcpy(pQbuffer, ptmpuserbuffer, 1); + acb->wqbuf_lastindex++; + acb->wqbuf_lastindex %= ARCMSR_MAX_QBUFFER; +@@ -146,10 +183,12 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, + if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { + acb->acb_flags &= + ~ACB_F_MESSAGE_WQBUFFER_CLEARED; +- arcmsr_post_ioctldata2iop(acb); ++ arcmsr_write_ioctldata2iop(acb); + } ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + return count; + } else { ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + return 0; /*need retry*/ + } + } +@@ -165,22 +204,24 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct file *filp, + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; + uint8_t *pQbuffer; ++ unsigned long flags; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + +- if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { +- acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; +- arcmsr_iop_message_read(acb); +- } ++ arcmsr_clear_iop2drv_rqueue_buffer(acb); + acb->acb_flags |= + (ACB_F_MESSAGE_WQBUFFER_CLEARED + | ACB_F_MESSAGE_RQBUFFER_CLEARED + | ACB_F_MESSAGE_WQBUFFER_READED); ++ spin_lock_irqsave(&acb->rqbuffer_lock, flags); + acb->rqbuf_firstindex = 0; + acb->rqbuf_lastindex = 0; ++ spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); ++ spin_lock_irqsave(&acb->wqbuffer_lock, flags); + acb->wqbuf_firstindex = 0; + acb->wqbuf_lastindex = 0; ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + pQbuffer = acb->rqbuffer; + memset(pQbuffer, 0, sizeof (struct QBUFFER)); + pQbuffer = acb->wqbuffer; +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index fc0dfbc..1576805 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -653,6 +653,8 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + } + spin_lock_init(&acb->eh_lock); + spin_lock_init(&acb->ccblist_lock); ++ spin_lock_init(&acb->rqbuffer_lock); ++ spin_lock_init(&acb->wqbuffer_lock); + acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | + ACB_F_MESSAGE_RQBUFFER_CLEARED | + ACB_F_MESSAGE_WQBUFFER_READED); +@@ -1449,68 +1451,175 @@ static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBloc + return pqbuffer; + } + +-static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb) ++static uint32_t ++arcmsr_Read_iop_rqbuffer_in_DWORD(struct AdapterControlBlock *acb, ++ struct QBUFFER __iomem *prbuffer) + { +- struct QBUFFER __iomem *prbuffer; +- struct QBUFFER *pQbuffer; +- uint8_t __iomem *iop_data; +- int32_t my_empty_len, iop_len, rqbuf_firstindex, rqbuf_lastindex; +- rqbuf_lastindex = acb->rqbuf_lastindex; +- rqbuf_firstindex = acb->rqbuf_firstindex; +- prbuffer = arcmsr_get_iop_rqbuffer(acb); +- iop_data = (uint8_t __iomem *)prbuffer->data; +- iop_len = prbuffer->data_len; +- my_empty_len = (rqbuf_firstindex - rqbuf_lastindex - 1) & (ARCMSR_MAX_QBUFFER - 1); +- +- if (my_empty_len >= iop_len) +- { +- while (iop_len > 0) { +- pQbuffer = (struct QBUFFER *)&acb->rqbuffer[rqbuf_lastindex]; +- memcpy(pQbuffer, iop_data, 1); +- rqbuf_lastindex++; +- rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; ++ uint8_t *pQbuffer; ++ uint8_t *buf1 = NULL; ++ uint32_t __iomem *iop_data; ++ uint32_t iop_len, data_len, *buf2 = NULL; ++ ++ iop_data = (uint32_t __iomem *)prbuffer->data; ++ iop_len = readl(&prbuffer->data_len); ++ if (iop_len > 0) { ++ buf1 = kmalloc(128, GFP_ATOMIC); ++ buf2 = (uint32_t *)buf1; ++ if (buf1 == NULL) ++ return 0; ++ data_len = iop_len; ++ while (data_len >= 4) { ++ *buf2++ = readl(iop_data); + iop_data++; +- iop_len--; ++ data_len -= 4; + } +- acb->rqbuf_lastindex = rqbuf_lastindex; +- arcmsr_iop_message_read(acb); ++ if (data_len) ++ *buf2 = readl(iop_data); ++ buf2 = (uint32_t *)buf1; ++ } ++ while (iop_len > 0) { ++ pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex]; ++ *pQbuffer = *buf1; ++ acb->rqbuf_lastindex++; ++ /* if last, index number set it to 0 */ ++ acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; ++ buf1++; ++ iop_len--; ++ } ++ if (buf2) ++ kfree(buf2); ++ /* let IOP know data has been read */ ++ arcmsr_iop_message_read(acb); ++ return 1; ++} ++ ++uint32_t ++arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, ++ struct QBUFFER __iomem *prbuffer) { ++ ++ uint8_t *pQbuffer; ++ uint8_t __iomem *iop_data; ++ uint32_t iop_len; ++ ++ if (acb->adapter_type & ACB_ADAPTER_TYPE_C) ++ return arcmsr_Read_iop_rqbuffer_in_DWORD(acb, prbuffer); ++ iop_data = (uint8_t __iomem *)prbuffer->data; ++ iop_len = readl(&prbuffer->data_len); ++ while (iop_len > 0) { ++ pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex]; ++ *pQbuffer = readb(iop_data); ++ acb->rqbuf_lastindex++; ++ acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; ++ iop_data++; ++ iop_len--; + } ++ arcmsr_iop_message_read(acb); ++ return 1; ++} + +- else { ++static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb) ++{ ++ unsigned long flags; ++ struct QBUFFER __iomem *prbuffer; ++ int32_t buf_empty_len; ++ ++ spin_lock_irqsave(&acb->rqbuffer_lock, flags); ++ prbuffer = arcmsr_get_iop_rqbuffer(acb); ++ buf_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) & ++ (ARCMSR_MAX_QBUFFER - 1); ++ if (buf_empty_len >= readl(&prbuffer->data_len)) { ++ if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) ++ acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; ++ } else + acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; ++ spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); ++} ++ ++static void arcmsr_write_ioctldata2iop_in_DWORD(struct AdapterControlBlock *acb) ++{ ++ uint8_t *pQbuffer; ++ struct QBUFFER __iomem *pwbuffer; ++ uint8_t *buf1 = NULL; ++ uint32_t __iomem *iop_data; ++ uint32_t allxfer_len = 0, data_len, *buf2 = NULL, data; ++ ++ if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READED) { ++ buf1 = kmalloc(128, GFP_ATOMIC); ++ buf2 = (uint32_t *)buf1; ++ if (buf1 == NULL) ++ return; ++ ++ acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); ++ pwbuffer = arcmsr_get_iop_wqbuffer(acb); ++ iop_data = (uint32_t __iomem *)pwbuffer->data; ++ while ((acb->wqbuf_firstindex != acb->wqbuf_lastindex) ++ && (allxfer_len < 124)) { ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex]; ++ *buf1 = *pQbuffer; ++ acb->wqbuf_firstindex++; ++ acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; ++ buf1++; ++ allxfer_len++; ++ } ++ data_len = allxfer_len; ++ buf1 = (uint8_t *)buf2; ++ while (data_len >= 4) { ++ data = *buf2++; ++ writel(data, iop_data); ++ iop_data++; ++ data_len -= 4; ++ } ++ if (data_len) { ++ data = *buf2; ++ writel(data, iop_data); ++ } ++ writel(allxfer_len, &pwbuffer->data_len); ++ kfree(buf1); ++ arcmsr_iop_message_wrote(acb); + } + } + +-static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) ++void ++arcmsr_write_ioctldata2iop(struct AdapterControlBlock *acb) + { +- acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED; +- if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) { +- uint8_t *pQbuffer; +- struct QBUFFER __iomem *pwbuffer; +- uint8_t __iomem *iop_data; +- int32_t allxfer_len = 0; ++ uint8_t *pQbuffer; ++ struct QBUFFER __iomem *pwbuffer; ++ uint8_t __iomem *iop_data; ++ int32_t allxfer_len = 0; + ++ if (acb->adapter_type & ACB_ADAPTER_TYPE_C) { ++ arcmsr_write_ioctldata2iop_in_DWORD(acb); ++ return; ++ } ++ if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READED) { + acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); + pwbuffer = arcmsr_get_iop_wqbuffer(acb); + iop_data = (uint8_t __iomem *)pwbuffer->data; +- +- while ((acb->wqbuf_firstindex != acb->wqbuf_lastindex) && \ +- (allxfer_len < 124)) { ++ while ((acb->wqbuf_firstindex != acb->wqbuf_lastindex) ++ && (allxfer_len < 124)) { + pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex]; +- memcpy(iop_data, pQbuffer, 1); ++ writeb(*pQbuffer, iop_data); + acb->wqbuf_firstindex++; + acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; + iop_data++; + allxfer_len++; + } +- pwbuffer->data_len = allxfer_len; +- ++ writel(allxfer_len, &pwbuffer->data_len); + arcmsr_iop_message_wrote(acb); + } ++} ++ ++static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) ++{ ++ unsigned long flags; + +- if (acb->wqbuf_firstindex == acb->wqbuf_lastindex) { ++ spin_lock_irqsave(&acb->wqbuffer_lock, flags); ++ acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED; ++ if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) ++ arcmsr_write_ioctldata2iop(acb); ++ if (acb->wqbuf_firstindex == acb->wqbuf_lastindex) + acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; +- } ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + } + + static void arcmsr_hbaA_doorbell_isr(struct AdapterControlBlock *acb) +@@ -1768,296 +1877,345 @@ static void arcmsr_iop_parking(struct AdapterControlBlock *acb) + } + } + +-void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *acb) ++ ++void arcmsr_clear_iop2drv_rqueue_buffer(struct AdapterControlBlock *acb) + { +- int32_t wqbuf_firstindex, wqbuf_lastindex; +- uint8_t *pQbuffer; +- struct QBUFFER __iomem *pwbuffer; +- uint8_t __iomem *iop_data; +- int32_t allxfer_len = 0; +- pwbuffer = arcmsr_get_iop_wqbuffer(acb); +- iop_data = (uint8_t __iomem *)pwbuffer->data; +- if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READED) { +- acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); +- wqbuf_firstindex = acb->wqbuf_firstindex; +- wqbuf_lastindex = acb->wqbuf_lastindex; +- while ((wqbuf_firstindex != wqbuf_lastindex) && (allxfer_len < 124)) { +- pQbuffer = &acb->wqbuffer[wqbuf_firstindex]; +- memcpy(iop_data, pQbuffer, 1); +- wqbuf_firstindex++; +- wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; +- iop_data++; +- allxfer_len++; ++ uint32_t i; ++ ++ if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { ++ for (i = 0; i < 15; i++) { ++ if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { ++ acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; ++ acb->rqbuf_firstindex = 0; ++ acb->rqbuf_lastindex = 0; ++ arcmsr_iop_message_read(acb); ++ mdelay(30); ++ } else if (acb->rqbuf_firstindex != ++ acb->rqbuf_lastindex) { ++ acb->rqbuf_firstindex = 0; ++ acb->rqbuf_lastindex = 0; ++ mdelay(30); ++ } else ++ break; + } +- acb->wqbuf_firstindex = wqbuf_firstindex; +- pwbuffer->data_len = allxfer_len; +- arcmsr_iop_message_wrote(acb); + } + } + + static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, +- struct scsi_cmnd *cmd) ++ struct scsi_cmnd *cmd) + { +- struct CMD_MESSAGE_FIELD *pcmdmessagefld; +- int retvalue = 0, transfer_len = 0; + char *buffer; ++ unsigned short use_sg; ++ int retvalue = 0, transfer_len = 0; ++ unsigned long flags; ++ struct CMD_MESSAGE_FIELD *pcmdmessagefld; ++ uint32_t controlcode = (uint32_t)cmd->cmnd[5] << 24 | ++ (uint32_t)cmd->cmnd[6] << 16 | ++ (uint32_t)cmd->cmnd[7] << 8 | ++ (uint32_t)cmd->cmnd[8]; + struct scatterlist *sg; +- uint32_t controlcode = (uint32_t ) cmd->cmnd[5] << 24 | +- (uint32_t ) cmd->cmnd[6] << 16 | +- (uint32_t ) cmd->cmnd[7] << 8 | +- (uint32_t ) cmd->cmnd[8]; +- /* 4 bytes: Areca io control code */ ++ ++ use_sg = scsi_sg_count(cmd); + sg = scsi_sglist(cmd); + buffer = kmap_atomic(sg_page(sg)) + sg->offset; +- if (scsi_sg_count(cmd) > 1) { ++ if (use_sg > 1) { + retvalue = ARCMSR_MESSAGE_FAIL; + goto message_out; + } + transfer_len += sg->length; +- + if (transfer_len > sizeof(struct CMD_MESSAGE_FIELD)) { + retvalue = ARCMSR_MESSAGE_FAIL; ++ pr_info("%s: ARCMSR_MESSAGE_FAIL!\n", __func__); + goto message_out; + } +- pcmdmessagefld = (struct CMD_MESSAGE_FIELD *) buffer; +- switch(controlcode) { +- ++ pcmdmessagefld = (struct CMD_MESSAGE_FIELD *)buffer; ++ switch (controlcode) { + case ARCMSR_MESSAGE_READ_RQBUFFER: { + unsigned char *ver_addr; + uint8_t *pQbuffer, *ptmpQbuffer; +- int32_t allxfer_len = 0; +- ++ uint32_t allxfer_len = 0; + ver_addr = kmalloc(1032, GFP_ATOMIC); + if (!ver_addr) { + retvalue = ARCMSR_MESSAGE_FAIL; ++ pr_info("%s: memory not enough!\n", __func__); + goto message_out; + } +- + ptmpQbuffer = ver_addr; +- while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex) +- && (allxfer_len < 1031)) { ++ spin_lock_irqsave(&acb->rqbuffer_lock, flags); ++ if (acb->rqbuf_firstindex != acb->rqbuf_lastindex) { + pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex]; +- memcpy(ptmpQbuffer, pQbuffer, 1); +- acb->rqbuf_firstindex++; +- acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER; +- ptmpQbuffer++; +- allxfer_len++; ++ if (acb->rqbuf_firstindex > acb->rqbuf_lastindex) { ++ if ((ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex) >= 1032) { ++ memcpy(ptmpQbuffer, pQbuffer, 1032); ++ acb->rqbuf_firstindex += 1032; ++ acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER; ++ allxfer_len = 1032; ++ } else { ++ if (((ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex) + ++ acb->rqbuf_lastindex) > 1032) { ++ memcpy(ptmpQbuffer, ++ pQbuffer, ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex); ++ ptmpQbuffer += ++ ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex; ++ memcpy(ptmpQbuffer, ++ acb->rqbuffer, 1032 - ++ (ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex)); ++ acb->rqbuf_firstindex = ++ 1032 - (ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex); ++ allxfer_len = 1032; ++ } else { ++ memcpy(ptmpQbuffer, ++ pQbuffer, ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex); ++ ptmpQbuffer += ++ ARCMSR_MAX_QBUFFER - ++ acb->rqbuf_firstindex; ++ memcpy(ptmpQbuffer, ++ acb->rqbuffer, ++ acb->rqbuf_lastindex); ++ allxfer_len = ARCMSR_MAX_QBUFFER ++ - acb->rqbuf_firstindex + ++ acb->rqbuf_lastindex; ++ acb->rqbuf_firstindex = ++ acb->rqbuf_lastindex; ++ } ++ } ++ } else { ++ if ((acb->rqbuf_lastindex - ++ acb->rqbuf_firstindex) > 1032) { ++ memcpy(ptmpQbuffer, pQbuffer, 1032); ++ acb->rqbuf_firstindex += 1032; ++ allxfer_len = 1032; ++ } else { ++ memcpy(ptmpQbuffer, pQbuffer, ++ acb->rqbuf_lastindex - ++ acb->rqbuf_firstindex); ++ allxfer_len = acb->rqbuf_lastindex ++ - acb->rqbuf_firstindex; ++ acb->rqbuf_firstindex = ++ acb->rqbuf_lastindex; ++ } ++ } + } ++ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, ++ allxfer_len); + if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { +- + struct QBUFFER __iomem *prbuffer; +- uint8_t __iomem *iop_data; +- int32_t iop_len; +- + acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; + prbuffer = arcmsr_get_iop_rqbuffer(acb); +- iop_data = prbuffer->data; +- iop_len = readl(&prbuffer->data_len); +- while (iop_len > 0) { +- acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data); +- acb->rqbuf_lastindex++; +- acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; +- iop_data++; +- iop_len--; +- } +- arcmsr_iop_message_read(acb); +- } +- memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len); +- pcmdmessagefld->cmdmessage.Length = allxfer_len; +- if(acb->fw_flag == FW_DEADLOCK) { +- pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ +- pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK; ++ if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) ++ acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW; + } ++ spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); + kfree(ver_addr); +- } ++ pcmdmessagefld->cmdmessage.Length = allxfer_len; ++ if (acb->fw_flag == FW_DEADLOCK) ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_OK; + break; +- ++ } + case ARCMSR_MESSAGE_WRITE_WQBUFFER: { + unsigned char *ver_addr; + int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; + uint8_t *pQbuffer, *ptmpuserbuffer; +- + ver_addr = kmalloc(1032, GFP_ATOMIC); + if (!ver_addr) { + retvalue = ARCMSR_MESSAGE_FAIL; + goto message_out; + } +- if(acb->fw_flag == FW_DEADLOCK) { +- pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ +- pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_OK; +- } + ptmpuserbuffer = ver_addr; + user_len = pcmdmessagefld->cmdmessage.Length; +- memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len); ++ memcpy(ptmpuserbuffer, ++ pcmdmessagefld->messagedatabuffer, user_len); ++ spin_lock_irqsave(&acb->wqbuffer_lock, flags); + wqbuf_lastindex = acb->wqbuf_lastindex; + wqbuf_firstindex = acb->wqbuf_firstindex; + if (wqbuf_lastindex != wqbuf_firstindex) { + struct SENSE_DATA *sensebuffer = + (struct SENSE_DATA *)cmd->sense_buffer; +- arcmsr_post_ioctldata2iop(acb); ++ arcmsr_write_ioctldata2iop(acb); + /* has error report sensedata */ +- sensebuffer->ErrorCode = 0x70; ++ sensebuffer->ErrorCode = SCSI_SENSE_CURRENT_ERRORS; + sensebuffer->SenseKey = ILLEGAL_REQUEST; + sensebuffer->AdditionalSenseLength = 0x0A; + sensebuffer->AdditionalSenseCode = 0x20; + sensebuffer->Valid = 1; + retvalue = ARCMSR_MESSAGE_FAIL; + } else { +- my_empty_len = (wqbuf_firstindex-wqbuf_lastindex - 1) +- &(ARCMSR_MAX_QBUFFER - 1); ++ my_empty_len = (wqbuf_firstindex - wqbuf_lastindex - 1) ++ & (ARCMSR_MAX_QBUFFER - 1); + if (my_empty_len >= user_len) { + while (user_len > 0) { +- pQbuffer = +- &acb->wqbuffer[acb->wqbuf_lastindex]; +- memcpy(pQbuffer, ptmpuserbuffer, 1); +- acb->wqbuf_lastindex++; +- acb->wqbuf_lastindex %= ARCMSR_MAX_QBUFFER; +- ptmpuserbuffer++; +- user_len--; ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_lastindex]; ++ if ((acb->wqbuf_lastindex + user_len) ++ > ARCMSR_MAX_QBUFFER) { ++ memcpy(pQbuffer, ptmpuserbuffer, ++ ARCMSR_MAX_QBUFFER - ++ acb->wqbuf_lastindex); ++ ptmpuserbuffer += ++ (ARCMSR_MAX_QBUFFER ++ - acb->wqbuf_lastindex); ++ user_len -= (ARCMSR_MAX_QBUFFER ++ - acb->wqbuf_lastindex); ++ acb->wqbuf_lastindex = 0; ++ } else { ++ memcpy(pQbuffer, ptmpuserbuffer, ++ user_len); ++ acb->wqbuf_lastindex += user_len; ++ acb->wqbuf_lastindex %= ++ ARCMSR_MAX_QBUFFER; ++ user_len = 0; ++ } + } +- if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { ++ if (acb->acb_flags & ++ ACB_F_MESSAGE_WQBUFFER_CLEARED) { + acb->acb_flags &= + ~ACB_F_MESSAGE_WQBUFFER_CLEARED; +- arcmsr_post_ioctldata2iop(acb); ++ arcmsr_write_ioctldata2iop(acb); + } + } else { +- /* has error report sensedata */ + struct SENSE_DATA *sensebuffer = + (struct SENSE_DATA *)cmd->sense_buffer; +- sensebuffer->ErrorCode = 0x70; ++ /* has error report sensedata */ ++ sensebuffer->ErrorCode = ++ SCSI_SENSE_CURRENT_ERRORS; + sensebuffer->SenseKey = ILLEGAL_REQUEST; + sensebuffer->AdditionalSenseLength = 0x0A; + sensebuffer->AdditionalSenseCode = 0x20; + sensebuffer->Valid = 1; + retvalue = ARCMSR_MESSAGE_FAIL; + } +- } +- kfree(ver_addr); + } ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); ++ kfree(ver_addr); ++ if (acb->fw_flag == FW_DEADLOCK) ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_OK; + break; +- ++ } + case ARCMSR_MESSAGE_CLEAR_RQBUFFER: { + uint8_t *pQbuffer = acb->rqbuffer; +- if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { +- acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; +- arcmsr_iop_message_read(acb); +- } ++ ++ arcmsr_clear_iop2drv_rqueue_buffer(acb); ++ spin_lock_irqsave(&acb->rqbuffer_lock, flags); + acb->acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; + acb->rqbuf_firstindex = 0; + acb->rqbuf_lastindex = 0; + memset(pQbuffer, 0, ARCMSR_MAX_QBUFFER); +- if(acb->fw_flag == FW_DEADLOCK) { ++ spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); ++ if (acb->fw_flag == FW_DEADLOCK) + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_OK; +- } +- } ++ ARCMSR_MESSAGE_RETURNCODE_OK; + break; +- ++ } + case ARCMSR_MESSAGE_CLEAR_WQBUFFER: { + uint8_t *pQbuffer = acb->wqbuffer; +- if(acb->fw_flag == FW_DEADLOCK) { +- pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ +- pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_OK; +- } +- +- if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { +- acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; +- arcmsr_iop_message_read(acb); +- } +- acb->acb_flags |= +- (ACB_F_MESSAGE_WQBUFFER_CLEARED | +- ACB_F_MESSAGE_WQBUFFER_READED); ++ spin_lock_irqsave(&acb->wqbuffer_lock, flags); ++ acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | ++ ACB_F_MESSAGE_WQBUFFER_READED); + acb->wqbuf_firstindex = 0; + acb->wqbuf_lastindex = 0; + memset(pQbuffer, 0, ARCMSR_MAX_QBUFFER); +- } ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); ++ if (acb->fw_flag == FW_DEADLOCK) ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_OK; + break; +- ++ } + case ARCMSR_MESSAGE_CLEAR_ALLQBUFFER: { + uint8_t *pQbuffer; +- +- if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { +- acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; +- arcmsr_iop_message_read(acb); +- } +- acb->acb_flags |= +- (ACB_F_MESSAGE_WQBUFFER_CLEARED +- | ACB_F_MESSAGE_RQBUFFER_CLEARED +- | ACB_F_MESSAGE_WQBUFFER_READED); ++ arcmsr_clear_iop2drv_rqueue_buffer(acb); ++ spin_lock_irqsave(&acb->rqbuffer_lock, flags); ++ acb->acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; + acb->rqbuf_firstindex = 0; + acb->rqbuf_lastindex = 0; +- acb->wqbuf_firstindex = 0; +- acb->wqbuf_lastindex = 0; + pQbuffer = acb->rqbuffer; + memset(pQbuffer, 0, sizeof(struct QBUFFER)); ++ spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); ++ spin_lock_irqsave(&acb->wqbuffer_lock, flags); ++ acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | ++ ACB_F_MESSAGE_WQBUFFER_READED); ++ acb->wqbuf_firstindex = 0; ++ acb->wqbuf_lastindex = 0; + pQbuffer = acb->wqbuffer; + memset(pQbuffer, 0, sizeof(struct QBUFFER)); +- if(acb->fw_flag == FW_DEADLOCK) { ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); ++ if (acb->fw_flag == FW_DEADLOCK) + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_OK; +- } +- } ++ ARCMSR_MESSAGE_RETURNCODE_OK; + break; +- ++ } + case ARCMSR_MESSAGE_RETURN_CODE_3F: { +- if(acb->fw_flag == FW_DEADLOCK) { ++ if (acb->fw_flag == FW_DEADLOCK) + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_3F; +- } ++ ARCMSR_MESSAGE_RETURNCODE_3F; + break; +- } ++ } + case ARCMSR_MESSAGE_SAY_HELLO: { + int8_t *hello_string = "Hello! I am ARCMSR"; +- if(acb->fw_flag == FW_DEADLOCK) { ++ if (acb->fw_flag == FW_DEADLOCK) + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- }else{ ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_OK; +- } +- memcpy(pcmdmessagefld->messagedatabuffer, hello_string +- , (int16_t)strlen(hello_string)); +- } ++ ARCMSR_MESSAGE_RETURNCODE_OK; ++ memcpy(pcmdmessagefld->messagedatabuffer, ++ hello_string, (int16_t)strlen(hello_string)); + break; +- +- case ARCMSR_MESSAGE_SAY_GOODBYE: +- if(acb->fw_flag == FW_DEADLOCK) { ++ } ++ case ARCMSR_MESSAGE_SAY_GOODBYE: { ++ if (acb->fw_flag == FW_DEADLOCK) + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- } ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_OK; + arcmsr_iop_parking(acb); + break; +- +- case ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE: +- if(acb->fw_flag == FW_DEADLOCK) { ++ } ++ case ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE: { ++ if (acb->fw_flag == FW_DEADLOCK) + pcmdmessagefld->cmdmessage.ReturnCode = +- ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; +- } ++ ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON; ++ else ++ pcmdmessagefld->cmdmessage.ReturnCode = ++ ARCMSR_MESSAGE_RETURNCODE_OK; + arcmsr_flush_adapter_cache(acb); + break; +- ++ } + default: + retvalue = ARCMSR_MESSAGE_FAIL; ++ pr_info("%s: unknown controlcode!\n", __func__); ++ } ++message_out: ++ if (use_sg) { ++ struct scatterlist *sg = scsi_sglist(cmd); ++ kunmap_atomic(buffer - sg->offset); + } +- message_out: +- sg = scsi_sglist(cmd); +- kunmap_atomic(buffer - sg->offset); + return retvalue; + } + diff --git a/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch b/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch new file mode 100644 index 000000000..100c1fd61 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch @@ -0,0 +1,316 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:20:31 +0800 +Subject: [14/19] arcmsr: fix sparse warnings and errors +Origin: https://git.kernel.org/linus/c10b1d544aaaf98ab1792845c106471ee1ee0c05 +Bug-Debian: https://bugs.debian.org/698821 + +Fix sparse utility checking errors and warnings. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 78 ++++++++++++++++++++-------------------- + 1 file changed, 40 insertions(+), 38 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 1576805..34a43ed 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -78,7 +78,7 @@ MODULE_VERSION(ARCMSR_DRIVER_VERSION); + #define ARCMSR_SLEEPTIME 10 + #define ARCMSR_RETRYCOUNT 12 + +-wait_queue_head_t wait_q; ++static wait_queue_head_t wait_q; + static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + struct scsi_cmnd *cmd); + static int arcmsr_iop_confirm(struct AdapterControlBlock *acb); +@@ -353,7 +353,7 @@ static uint8_t arcmsr_hbaB_wait_msgint_ready(struct AdapterControlBlock *acb) + + static uint8_t arcmsr_hbaC_wait_msgint_ready(struct AdapterControlBlock *pACB) + { +- struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *phbcmu = pACB->pmuC; + int i; + + for (i = 0; i < 2000; i++) { +@@ -403,7 +403,7 @@ static void arcmsr_hbaB_flush_cache(struct AdapterControlBlock *acb) + + static void arcmsr_hbaC_flush_cache(struct AdapterControlBlock *pACB) + { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *reg = pACB->pmuC; + int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */ + writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); +@@ -827,7 +827,7 @@ static uint8_t arcmsr_hbaB_abort_allcmd(struct AdapterControlBlock *acb) + } + static uint8_t arcmsr_hbaC_abort_allcmd(struct AdapterControlBlock *pACB) + { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *reg = pACB->pmuC; + writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); + if (!arcmsr_hbaC_wait_msgint_ready(pACB)) { +@@ -915,7 +915,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb) + } + break; + case ACB_ADAPTER_TYPE_C:{ +- struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + /* disable all outbound interrupt */ + orig_mask = readl(®->host_int_mask); /* disable outbound message0 int */ + writel(orig_mask|ARCMSR_HBCMU_ALL_INTMASKENABLE, ®->host_int_mask); +@@ -1039,8 +1039,9 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + /*clear all outbound posted Q*/ + writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); /* clear doorbell interrupt */ + for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { +- if ((flag_ccb = readl(®->done_qbuffer[i])) != 0) { +- writel(0, ®->done_qbuffer[i]); ++ flag_ccb = reg->done_qbuffer[i]; ++ if (flag_ccb != 0) { ++ reg->done_qbuffer[i] = 0; + pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+(flag_ccb << 5));/*frame must be 32 bytes aligned*/ + pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb); + error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false; +@@ -1053,7 +1054,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *reg = acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + struct ARCMSR_CDB *pARCMSR_CDB; + uint32_t flag_ccb, ccb_cdb_phy; + bool error; +@@ -1171,7 +1172,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *reg = acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + mask = ~(ARCMSR_HBCMU_UTILITY_A_ISR_MASK | ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK|ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK); + writel(intmask_org & mask, ®->host_int_mask); + acb->outbound_int_enable = ~(intmask_org & mask) & 0x0000000f; +@@ -1257,12 +1258,12 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + uint32_t ending_index, index = reg->postq_index; + + ending_index = ((index + 1) % ARCMSR_MAX_HBB_POSTQUEUE); +- writel(0, ®->post_qbuffer[ending_index]); ++ reg->post_qbuffer[ending_index] = 0; + if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) { +- writel(cdb_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE, +- ®->post_qbuffer[index]); ++ reg->post_qbuffer[index] = ++ cdb_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE; + } else { +- writel(cdb_phyaddr, ®->post_qbuffer[index]); ++ reg->post_qbuffer[index] = cdb_phyaddr; + } + index++; + index %= ARCMSR_MAX_HBB_POSTQUEUE;/*if last index number set it to 0 */ +@@ -1271,7 +1272,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *phbcmu = acb->pmuC; + uint32_t ccb_post_stamp, arc_cdb_size; + + arc_cdb_size = (ccb->arc_cdb_size > 0x300) ? 0x300 : ccb->arc_cdb_size; +@@ -1313,7 +1314,7 @@ static void arcmsr_hbaB_stop_bgrb(struct AdapterControlBlock *acb) + + static void arcmsr_hbaC_stop_bgrb(struct AdapterControlBlock *pACB) + { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *reg = pACB->pmuC; + pACB->acb_flags &= ~ACB_F_MSG_START_BGRB; + writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, ®->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); +@@ -1347,7 +1348,7 @@ static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb) + dma_free_coherent(&acb->pdev->dev, acb->uncache_size, acb->dma_coherent, acb->dma_coherent_handle); + } + +-void arcmsr_iop_message_read(struct AdapterControlBlock *acb) ++static void arcmsr_iop_message_read(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: { +@@ -1419,7 +1420,7 @@ struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb) + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *phbcmu = acb->pmuC; + qbuffer = (struct QBUFFER __iomem *)&phbcmu->message_rbuffer; + } + } +@@ -1443,7 +1444,7 @@ static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBloc + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + pqbuffer = (struct QBUFFER __iomem *)®->message_wbuffer; + } + +@@ -1640,7 +1641,7 @@ static void arcmsr_hbaA_doorbell_isr(struct AdapterControlBlock *acb) + static void arcmsr_hbaC_doorbell_isr(struct AdapterControlBlock *pACB) + { + uint32_t outbound_doorbell; +- struct MessageUnit_C *reg = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *reg = pACB->pmuC; + /* + ******************************************************************* + ** Maybe here we need to check wrqbuffer_lock is lock or not +@@ -1686,8 +1687,8 @@ static void arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb) + struct CommandControlBlock *pCCB; + bool error; + index = reg->doneq_index; +- while ((flag_ccb = readl(®->done_qbuffer[index])) != 0) { +- writel(0, ®->done_qbuffer[index]); ++ while ((flag_ccb = reg->done_qbuffer[index]) != 0) { ++ reg->done_qbuffer[index] = 0; + pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+(flag_ccb << 5));/*frame must be 32 bytes aligned*/ + pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb); + error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false; +@@ -1700,13 +1701,13 @@ static void arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb) + + static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) + { +- struct MessageUnit_C *phbcmu; ++ struct MessageUnit_C __iomem *phbcmu; + struct ARCMSR_CDB *arcmsr_cdb; + struct CommandControlBlock *ccb; + uint32_t flag_ccb, ccb_cdb_phy, throttling = 0; + int error; + +- phbcmu = (struct MessageUnit_C *)acb->pmuC; ++ phbcmu = acb->pmuC; + /* areca cdb command done */ + /* Use correct offset and size for syncing */ + +@@ -1739,7 +1740,7 @@ static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) + */ + static void arcmsr_hbaA_message_isr(struct AdapterControlBlock *acb) + { +- struct MessageUnit_A *reg = acb->pmuA; ++ struct MessageUnit_A __iomem *reg = acb->pmuA; + /*clear interrupt and message state*/ + writel(ARCMSR_MU_OUTBOUND_MESSAGE0_INT, ®->outbound_intstatus); + schedule_work(&acb->arcmsr_do_message_isr_bh); +@@ -1763,7 +1764,7 @@ static void arcmsr_hbaB_message_isr(struct AdapterControlBlock *acb) + */ + static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *acb) + { +- struct MessageUnit_C *reg = acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + /*clear interrupt and message state*/ + writel(ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR, ®->outbound_doorbell_clear); + schedule_work(&acb->arcmsr_do_message_isr_bh); +@@ -1824,7 +1825,7 @@ static int arcmsr_hbaB_handle_isr(struct AdapterControlBlock *acb) + static int arcmsr_hbaC_handle_isr(struct AdapterControlBlock *pACB) + { + uint32_t host_interrupt_status; +- struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *phbcmu = pACB->pmuC; + /* + ********************************************* + ** check outbound intstatus +@@ -2230,7 +2231,7 @@ static struct CommandControlBlock *arcmsr_get_freeccb(struct AdapterControlBlock + list_del_init(&ccb->list); + }else{ + spin_unlock_irqrestore(&acb->ccblist_lock, flags); +- return 0; ++ return NULL; + } + spin_unlock_irqrestore(&acb->ccblist_lock, flags); + return ccb; +@@ -2468,11 +2469,11 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) + static bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB) + { + uint32_t intmask_org, Index, firmware_state = 0; +- struct MessageUnit_C *reg = pACB->pmuC; ++ struct MessageUnit_C __iomem *reg = pACB->pmuC; + char *acb_firm_model = pACB->firm_model; + char *acb_firm_version = pACB->firm_version; +- char *iop_firm_model = (char *)(®->msgcode_rwbuffer[15]); /*firm_model,15,60-67*/ +- char *iop_firm_version = (char *)(®->msgcode_rwbuffer[17]); /*firm_version,17,68-83*/ ++ char __iomem *iop_firm_model = (char __iomem *)(®->msgcode_rwbuffer[15]); /*firm_model,15,60-67*/ ++ char __iomem *iop_firm_version = (char __iomem *)(®->msgcode_rwbuffer[17]); /*firm_version,17,68-83*/ + int count; + /* disable all outbound interrupt */ + intmask_org = readl(®->host_int_mask); /* disable outbound message0 int */ +@@ -2620,7 +2621,8 @@ static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, + writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); + while(1){ + index = reg->doneq_index; +- if ((flag_ccb = readl(®->done_qbuffer[index])) == 0) { ++ flag_ccb = reg->done_qbuffer[index]; ++ if (flag_ccb == 0) { + if (poll_ccb_done){ + rtn = SUCCESS; + break; +@@ -2633,7 +2635,7 @@ static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, + goto polling_hbb_ccb_retry; + } + } +- writel(0, ®->done_qbuffer[index]); ++ reg->done_qbuffer[index] = 0; + index++; + /*if last index number set it to 0 */ + index %= ARCMSR_MAX_HBB_POSTQUEUE; +@@ -2671,7 +2673,7 @@ static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, + static int arcmsr_hbaC_polling_ccbdone(struct AdapterControlBlock *acb, + struct CommandControlBlock *poll_ccb) + { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + uint32_t flag_ccb, ccb_cdb_phy; + struct ARCMSR_CDB *arcmsr_cdb; + bool error; +@@ -2834,7 +2836,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_C: { + if (cdb_phyaddr_hi32 != 0) { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + + printk(KERN_NOTICE "arcmsr%d: cdb_phyaddr_hi32=0x%x\n", + acb->adapter_index, cdb_phyaddr_hi32); +@@ -2875,7 +2877,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + do { + firmware_state = readl(®->outbound_msgaddr1); + } while ((firmware_state & ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK) == 0); +@@ -2907,7 +2909,7 @@ static void arcmsr_hbaA_request_device_map(struct AdapterControlBlock *acb) + + static void arcmsr_hbaB_request_device_map(struct AdapterControlBlock *acb) + { +- struct MessageUnit_B __iomem *reg = acb->pmuB; ++ struct MessageUnit_B *reg = acb->pmuB; + if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ + mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); + return; +@@ -2992,7 +2994,7 @@ static void arcmsr_hbaB_start_bgrb(struct AdapterControlBlock *acb) + + static void arcmsr_hbaC_start_bgrb(struct AdapterControlBlock *pACB) + { +- struct MessageUnit_C *phbcmu = (struct MessageUnit_C *)pACB->pmuC; ++ struct MessageUnit_C __iomem *phbcmu = pACB->pmuC; + pACB->acb_flags |= ACB_F_MSG_START_BGRB; + writel(ARCMSR_INBOUND_MESG0_START_BGRB, &phbcmu->inbound_msgaddr0); + writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, &phbcmu->inbound_doorbell); +@@ -3039,7 +3041,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb) + } + break; + case ACB_ADAPTER_TYPE_C: { +- struct MessageUnit_C *reg = (struct MessageUnit_C *)acb->pmuC; ++ struct MessageUnit_C __iomem *reg = acb->pmuC; + uint32_t outbound_doorbell, i; + /* empty doorbell Qbuffer if door bell ringed */ + outbound_doorbell = readl(®->outbound_doorbell); diff --git a/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch b/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch new file mode 100644 index 000000000..b974084ea --- /dev/null +++ b/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch @@ -0,0 +1,75 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:22:45 +0800 +Subject: [15/19] arcmsr: modify some character strings +Origin: https://git.kernel.org/linus/aaa64f69480bcde4e203584dfc77d7e4ffb737d6 +Bug-Debian: https://bugs.debian.org/698821 + +Revise comment and some character strings. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 24 +++++++++++------------- + 1 file changed, 11 insertions(+), 13 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 34a43ed..26bcdc0 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -2,11 +2,10 @@ + ******************************************************************************* + ** O.S : Linux + ** FILE NAME : arcmsr_hba.c +-** BY : Nick Cheng +-** Description: SCSI RAID Device Driver for +-** ARECA RAID Host adapter ++** BY : Nick Cheng, C.L. Huang ++** Description: SCSI RAID Device Driver for Areca RAID Controller + ******************************************************************************* +-** Copyright (C) 2002 - 2005, Areca Technology Corporation All rights reserved ++** Copyright (C) 2002 - 2014, Areca Technology Corporation All rights reserved + ** + ** Web site: www.areca.com.tw + ** E-mail: support@areca.com.tw +@@ -70,8 +69,8 @@ + #include + #include + #include "arcmsr.h" +-MODULE_AUTHOR("Nick Cheng "); +-MODULE_DESCRIPTION("ARECA (ARC11xx/12xx/16xx/1880) SATA/SAS RAID Host Bus Adapter"); ++MODULE_AUTHOR("Nick Cheng, C.L. Huang "); ++MODULE_DESCRIPTION("Areca ARC11xx/12xx/16xx/188x SAS/SATA RAID Controller Driver"); + MODULE_LICENSE("Dual BSD/GPL"); + MODULE_VERSION(ARCMSR_DRIVER_VERSION); + +@@ -126,8 +125,7 @@ static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, + + static struct scsi_host_template arcmsr_scsi_host_template = { + .module = THIS_MODULE, +- .name = "ARCMSR ARECA SATA/SAS RAID Controller" +- ARCMSR_DRIVER_VERSION, ++ .name = "Areca SAS/SATA RAID driver", + .info = arcmsr_info, + .queuecommand = arcmsr_queue_command, + .eh_abort_handler = arcmsr_abort, +@@ -3387,14 +3385,14 @@ static const char *arcmsr_info(struct Scsi_Host *host) + case PCI_DEVICE_ID_ARECA_1680: + case PCI_DEVICE_ID_ARECA_1681: + case PCI_DEVICE_ID_ARECA_1880: +- type = "SAS"; ++ type = "SAS/SATA"; + break; + default: +- type = "X-TYPE"; ++ type = "unknown"; ++ raid6 = 0; + break; + } +- sprintf(buf, "Areca %s Host Adapter RAID Controller%s\n %s", +- type, raid6 ? "( RAID6 capable)" : "", +- ARCMSR_DRIVER_VERSION); ++ sprintf(buf, "Areca %s RAID Controller %s\narcmsr version %s\n", ++ type, raid6 ? "(RAID6 capable)" : "", ARCMSR_DRIVER_VERSION); + return buf; + } diff --git a/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch b/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch new file mode 100644 index 000000000..3d83fe8b2 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch @@ -0,0 +1,1257 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:25:22 +0800 +Subject: [16/19] arcmsr: add support new adapter ARC12x4 series +Origin: https://git.kernel.org/linus/5b37479adee7164b17b6e2030b9a30d04583eb61 +Bug-Debian: https://bugs.debian.org/698821 + +Add code to support the new Areca Raid ARC12x4 series adapters. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 108 ++++++ + drivers/scsi/arcmsr/arcmsr_hba.c | 761 ++++++++++++++++++++++++++++++++++++++- + 2 files changed, 860 insertions(+), 9 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index 799393e..d1c78ef 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -63,12 +63,17 @@ struct device_attribute; + #define ARCMSR_MAX_QBUFFER 4096 + #define ARCMSR_DEFAULT_SG_ENTRIES 38 + #define ARCMSR_MAX_HBB_POSTQUEUE 264 ++#define ARCMSR_MAX_ARC1214_POSTQUEUE 256 ++#define ARCMSR_MAX_ARC1214_DONEQUEUE 257 + #define ARCMSR_MAX_XFER_LEN 0x26000 /* 152K */ + #define ARCMSR_CDB_SG_PAGE_LENGTH 256 + #define ARCMST_NUM_MSIX_VECTORS 4 + #ifndef PCI_DEVICE_ID_ARECA_1880 + #define PCI_DEVICE_ID_ARECA_1880 0x1880 + #endif ++#ifndef PCI_DEVICE_ID_ARECA_1214 ++ #define PCI_DEVICE_ID_ARECA_1214 0x1214 ++#endif + /* + ********************************************************************************** + ** +@@ -339,6 +344,56 @@ struct FIRMWARE_INFO + #define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000 + /* + ******************************************************************************* ++** SPEC. for Areca Type D adapter ++******************************************************************************* ++*/ ++#define ARCMSR_ARC1214_CHIP_ID 0x00004 ++#define ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION 0x00008 ++#define ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK 0x00034 ++#define ARCMSR_ARC1214_SAMPLE_RESET 0x00100 ++#define ARCMSR_ARC1214_RESET_REQUEST 0x00108 ++#define ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS 0x00200 ++#define ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE 0x0020C ++#define ARCMSR_ARC1214_INBOUND_MESSAGE0 0x00400 ++#define ARCMSR_ARC1214_INBOUND_MESSAGE1 0x00404 ++#define ARCMSR_ARC1214_OUTBOUND_MESSAGE0 0x00420 ++#define ARCMSR_ARC1214_OUTBOUND_MESSAGE1 0x00424 ++#define ARCMSR_ARC1214_INBOUND_DOORBELL 0x00460 ++#define ARCMSR_ARC1214_OUTBOUND_DOORBELL 0x00480 ++#define ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE 0x00484 ++#define ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW 0x01000 ++#define ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH 0x01004 ++#define ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER 0x01018 ++#define ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW 0x01060 ++#define ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH 0x01064 ++#define ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER 0x0106C ++#define ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER 0x01070 ++#define ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE 0x01088 ++#define ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE 0x0108C ++#define ARCMSR_ARC1214_MESSAGE_WBUFFER 0x02000 ++#define ARCMSR_ARC1214_MESSAGE_RBUFFER 0x02100 ++#define ARCMSR_ARC1214_MESSAGE_RWBUFFER 0x02200 ++/* Host Interrupt Mask */ ++#define ARCMSR_ARC1214_ALL_INT_ENABLE 0x00001010 ++#define ARCMSR_ARC1214_ALL_INT_DISABLE 0x00000000 ++/* Host Interrupt Status */ ++#define ARCMSR_ARC1214_OUTBOUND_DOORBELL_ISR 0x00001000 ++#define ARCMSR_ARC1214_OUTBOUND_POSTQUEUE_ISR 0x00000010 ++/* DoorBell*/ ++#define ARCMSR_ARC1214_DRV2IOP_DATA_IN_READY 0x00000001 ++#define ARCMSR_ARC1214_DRV2IOP_DATA_OUT_READ 0x00000002 ++/*inbound message 0 ready*/ ++#define ARCMSR_ARC1214_IOP2DRV_DATA_WRITE_OK 0x00000001 ++/*outbound DATA WRITE isr door bell clear*/ ++#define ARCMSR_ARC1214_IOP2DRV_DATA_READ_OK 0x00000002 ++/*outbound message 0 ready*/ ++#define ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE 0x02000000 ++/*outbound message cmd isr door bell clear*/ ++/*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/ ++#define ARCMSR_ARC1214_MESSAGE_FIRMWARE_OK 0x80000000 ++#define ARCMSR_ARC1214_OUTBOUND_LIST_INTERRUPT_CLEAR 0x00000001 ++/* ++******************************************************************************* + ** ARECA SCSI COMMAND DESCRIPTOR BLOCK size 0x1F8 (504) + ******************************************************************************* + */ +@@ -496,6 +551,56 @@ struct MessageUnit_C{ + uint32_t msgcode_rwbuffer[256]; /*2200 23FF*/ + }; + /* ++********************************************************************* ++** Messaging Unit (MU) of Type D processor ++********************************************************************* ++*/ ++struct InBound_SRB { ++ uint32_t addressLow; /* pointer to SRB block */ ++ uint32_t addressHigh; ++ uint32_t length; /* in DWORDs */ ++ uint32_t reserved0; ++}; ++ ++struct OutBound_SRB { ++ uint32_t addressLow; /* pointer to SRB block */ ++ uint32_t addressHigh; ++}; ++ ++struct MessageUnit_D { ++ struct InBound_SRB post_qbuffer[ARCMSR_MAX_ARC1214_POSTQUEUE]; ++ volatile struct OutBound_SRB ++ done_qbuffer[ARCMSR_MAX_ARC1214_DONEQUEUE]; ++ u16 postq_index; ++ volatile u16 doneq_index; ++ u32 __iomem *chip_id; /* 0x00004 */ ++ u32 __iomem *cpu_mem_config; /* 0x00008 */ ++ u32 __iomem *i2o_host_interrupt_mask; /* 0x00034 */ ++ u32 __iomem *sample_at_reset; /* 0x00100 */ ++ u32 __iomem *reset_request; /* 0x00108 */ ++ u32 __iomem *host_int_status; /* 0x00200 */ ++ u32 __iomem *pcief0_int_enable; /* 0x0020C */ ++ u32 __iomem *inbound_msgaddr0; /* 0x00400 */ ++ u32 __iomem *inbound_msgaddr1; /* 0x00404 */ ++ u32 __iomem *outbound_msgaddr0; /* 0x00420 */ ++ u32 __iomem *outbound_msgaddr1; /* 0x00424 */ ++ u32 __iomem *inbound_doorbell; /* 0x00460 */ ++ u32 __iomem *outbound_doorbell; /* 0x00480 */ ++ u32 __iomem *outbound_doorbell_enable; /* 0x00484 */ ++ u32 __iomem *inboundlist_base_low; /* 0x01000 */ ++ u32 __iomem *inboundlist_base_high; /* 0x01004 */ ++ u32 __iomem *inboundlist_write_pointer; /* 0x01018 */ ++ u32 __iomem *outboundlist_base_low; /* 0x01060 */ ++ u32 __iomem *outboundlist_base_high; /* 0x01064 */ ++ u32 __iomem *outboundlist_copy_pointer; /* 0x0106C */ ++ u32 __iomem *outboundlist_read_pointer; /* 0x01070 0x01072 */ ++ u32 __iomem *outboundlist_interrupt_cause; /* 0x1088 */ ++ u32 __iomem *outboundlist_interrupt_enable; /* 0x108C */ ++ u32 __iomem *message_wbuffer; /* 0x2000 */ ++ u32 __iomem *message_rbuffer; /* 0x2100 */ ++ u32 __iomem *msgcode_rwbuffer; /* 0x2200 */ ++}; ++/* + ******************************************************************************* + ** Adapter Control Block + ******************************************************************************* +@@ -518,12 +623,15 @@ struct AdapterControlBlock + uint32_t reg_mu_acc_handle0; + spinlock_t eh_lock; + spinlock_t ccblist_lock; ++ spinlock_t postq_lock; ++ spinlock_t doneq_lock; + spinlock_t rqbuffer_lock; + spinlock_t wqbuffer_lock; + union { + struct MessageUnit_A __iomem *pmuA; + struct MessageUnit_B *pmuB; + struct MessageUnit_C __iomem *pmuC; ++ struct MessageUnit_D *pmuD; + }; + /* message unit ATU inbound base address0 */ + void __iomem *mem_base0; +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 26bcdc0..b3cb969 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -108,6 +108,7 @@ static void arcmsr_message_isr_bh_fn(struct work_struct *work); + static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb); + static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb); + static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *pACB); ++static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb); + static void arcmsr_hardware_reset(struct AdapterControlBlock *acb); + static const char *arcmsr_info(struct Scsi_Host *); + static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb); +@@ -161,6 +162,8 @@ static struct pci_device_id arcmsr_device_id_table[] = { + .driver_data = ACB_ADAPTER_TYPE_B}, + {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1210), + .driver_data = ACB_ADAPTER_TYPE_A}, ++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1214), ++ .driver_data = ACB_ADAPTER_TYPE_D}, + {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1220), + .driver_data = ACB_ADAPTER_TYPE_A}, + {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1230), +@@ -202,7 +205,8 @@ static struct pci_driver arcmsr_pci_driver = { + static void arcmsr_free_mu(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +- case ACB_ADAPTER_TYPE_B:{ ++ case ACB_ADAPTER_TYPE_B: ++ case ACB_ADAPTER_TYPE_D: { + dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, + acb->dma_coherent2, acb->dma_coherent_handle2); + break; +@@ -251,6 +255,25 @@ static bool arcmsr_remap_pciregion(struct AdapterControlBlock *acb) + } + break; + } ++ case ACB_ADAPTER_TYPE_D: { ++ void __iomem *mem_base0; ++ unsigned long addr, range, flags; ++ ++ addr = (unsigned long)pci_resource_start(pdev, 0); ++ range = pci_resource_len(pdev, 0); ++ flags = pci_resource_flags(pdev, 0); ++ if (flags & IORESOURCE_CACHEABLE) ++ mem_base0 = ioremap(addr, range); ++ else ++ mem_base0 = ioremap_nocache(addr, range); ++ if (!mem_base0) { ++ pr_notice("arcmsr%d: memory mapping region fail\n", ++ acb->host->host_no); ++ return false; ++ } ++ acb->mem_base0 = mem_base0; ++ break; ++ } + } + return true; + } +@@ -271,6 +294,10 @@ static void arcmsr_unmap_pciregion(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_C:{ + iounmap(acb->pmuC); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: ++ iounmap(acb->mem_base0); ++ break; + } + } + +@@ -367,6 +394,23 @@ static uint8_t arcmsr_hbaC_wait_msgint_ready(struct AdapterControlBlock *pACB) + return false; + } + ++static bool arcmsr_hbaD_wait_msgint_ready(struct AdapterControlBlock *pACB) ++{ ++ struct MessageUnit_D *reg = pACB->pmuD; ++ int i; ++ ++ for (i = 0; i < 2000; i++) { ++ if (readl(reg->outbound_doorbell) ++ & ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE) { ++ writel(ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE, ++ reg->outbound_doorbell); ++ return true; ++ } ++ msleep(10); ++ } /* max 20 seconds */ ++ return false; ++} ++ + static void arcmsr_hbaA_flush_cache(struct AdapterControlBlock *acb) + { + struct MessageUnit_A __iomem *reg = acb->pmuA; +@@ -416,6 +460,24 @@ static void arcmsr_hbaC_flush_cache(struct AdapterControlBlock *pACB) + } while (retry_count != 0); + return; + } ++ ++static void arcmsr_hbaD_flush_cache(struct AdapterControlBlock *pACB) ++{ ++ int retry_count = 15; ++ struct MessageUnit_D *reg = pACB->pmuD; ++ ++ writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, reg->inbound_msgaddr0); ++ do { ++ if (arcmsr_hbaD_wait_msgint_ready(pACB)) ++ break; ++ ++ retry_count--; ++ pr_notice("arcmsr%d: wait 'flush adapter " ++ "cache' timeout, retry count down = %d\n", ++ pACB->host->host_no, retry_count); ++ } while (retry_count != 0); ++} ++ + static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +@@ -432,6 +494,10 @@ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_C: { + arcmsr_hbaC_flush_cache(acb); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: ++ arcmsr_hbaD_flush_cache(acb); ++ break; + } + } + +@@ -475,9 +541,16 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) + acb->vir2phy_offset = (unsigned long)dma_coherent - (unsigned long)dma_coherent_handle; + for(i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++){ + cdb_phyaddr = dma_coherent_handle + offsetof(struct CommandControlBlock, arcmsr_cdb); +- ccb_tmp->cdb_phyaddr = +- ((acb->adapter_type == ACB_ADAPTER_TYPE_C) ? +- cdb_phyaddr : (cdb_phyaddr >> 5)); ++ switch (acb->adapter_type) { ++ case ACB_ADAPTER_TYPE_A: ++ case ACB_ADAPTER_TYPE_B: ++ ccb_tmp->cdb_phyaddr = cdb_phyaddr >> 5; ++ break; ++ case ACB_ADAPTER_TYPE_C: ++ case ACB_ADAPTER_TYPE_D: ++ ccb_tmp->cdb_phyaddr = cdb_phyaddr; ++ break; ++ } + acb->pccb_pool[i] = ccb_tmp; + ccb_tmp->acb = acb; + INIT_LIST_HEAD(&ccb_tmp->list); +@@ -521,6 +594,13 @@ static void arcmsr_message_isr_bh_fn(struct work_struct *work) + devicemap = (char __iomem *)(®->msgcode_rwbuffer[21]); + break; + } ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ ++ signature = (uint32_t __iomem *)(®->msgcode_rwbuffer[0]); ++ devicemap = (char __iomem *)(®->msgcode_rwbuffer[21]); ++ break; ++ } + } + atomic_inc(&acb->rq_map_token); + if (readl(signature) != ARCMSR_SIGNATURE_GET_CONFIG) +@@ -651,6 +731,8 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + } + spin_lock_init(&acb->eh_lock); + spin_lock_init(&acb->ccblist_lock); ++ spin_lock_init(&acb->postq_lock); ++ spin_lock_init(&acb->doneq_lock); + spin_lock_init(&acb->rqbuffer_lock); + spin_lock_init(&acb->wqbuffer_lock); + acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | +@@ -836,6 +918,20 @@ static uint8_t arcmsr_hbaC_abort_allcmd(struct AdapterControlBlock *pACB) + } + return true; + } ++ ++static uint8_t arcmsr_hbaD_abort_allcmd(struct AdapterControlBlock *pACB) ++{ ++ struct MessageUnit_D *reg = pACB->pmuD; ++ ++ writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, reg->inbound_msgaddr0); ++ if (!arcmsr_hbaD_wait_msgint_ready(pACB)) { ++ pr_notice("arcmsr%d: wait 'abort all outstanding " ++ "command' timeout\n", pACB->host->host_no); ++ return false; ++ } ++ return true; ++} ++ + static uint8_t arcmsr_abort_allcmd(struct AdapterControlBlock *acb) + { + uint8_t rtnval = 0; +@@ -853,6 +949,11 @@ static uint8_t arcmsr_abort_allcmd(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_C: { + rtnval = arcmsr_hbaC_abort_allcmd(acb); + } ++ break; ++ ++ case ACB_ADAPTER_TYPE_D: ++ rtnval = arcmsr_hbaD_abort_allcmd(acb); ++ break; + } + return rtnval; + } +@@ -919,6 +1020,12 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb) + writel(orig_mask|ARCMSR_HBCMU_ALL_INTMASKENABLE, ®->host_int_mask); + } + break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ /* disable all outbound interrupt */ ++ writel(ARCMSR_ARC1214_ALL_INT_DISABLE, reg->pcief0_int_enable); ++ } ++ break; + } + return orig_mask; + } +@@ -1066,7 +1173,62 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1) ? true : false; + arcmsr_drain_donequeue(acb, pCCB, error); + } +- } ++ } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *pmu = acb->pmuD; ++ uint32_t ccb_cdb_phy, outbound_write_pointer; ++ uint32_t doneq_index, index_stripped, addressLow, residual; ++ bool error; ++ struct CommandControlBlock *pCCB; ++ ++ outbound_write_pointer = pmu->done_qbuffer[0].addressLow + 1; ++ doneq_index = pmu->doneq_index; ++ residual = atomic_read(&acb->ccboutstandingcount); ++ for (i = 0; i < residual; i++) { ++ while ((doneq_index & 0xFFF) != ++ (outbound_write_pointer & 0xFFF)) { ++ if (doneq_index & 0x4000) { ++ index_stripped = doneq_index & 0xFFF; ++ index_stripped += 1; ++ index_stripped %= ++ ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? ++ (index_stripped | 0x4000) : ++ (index_stripped + 1); ++ } else { ++ index_stripped = doneq_index; ++ index_stripped += 1; ++ index_stripped %= ++ ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? ++ index_stripped : ++ ((index_stripped | 0x4000) + 1); ++ } ++ doneq_index = pmu->doneq_index; ++ addressLow = pmu->done_qbuffer[doneq_index & ++ 0xFFF].addressLow; ++ ccb_cdb_phy = (addressLow & 0xFFFFFFF0); ++ pARCMSR_CDB = (struct ARCMSR_CDB *) ++ (acb->vir2phy_offset + ccb_cdb_phy); ++ pCCB = container_of(pARCMSR_CDB, ++ struct CommandControlBlock, arcmsr_cdb); ++ error = (addressLow & ++ ARCMSR_CCBREPLY_FLAG_ERROR_MODE1) ? ++ true : false; ++ arcmsr_drain_donequeue(acb, pCCB, error); ++ writel(doneq_index, ++ pmu->outboundlist_read_pointer); ++ } ++ mdelay(10); ++ outbound_write_pointer = ++ pmu->done_qbuffer[0].addressLow + 1; ++ doneq_index = pmu->doneq_index; ++ } ++ pmu->postq_index = 0; ++ pmu->doneq_index = 0x40FF; ++ } ++ break; + } + } + +@@ -1175,6 +1337,14 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, + writel(intmask_org & mask, ®->host_int_mask); + acb->outbound_int_enable = ~(intmask_org & mask) & 0x0000000f; + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ ++ mask = ARCMSR_ARC1214_ALL_INT_ENABLE; ++ writel(intmask_org | mask, reg->pcief0_int_enable); ++ break; ++ } + } + } + +@@ -1282,6 +1452,38 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + writel(ccb_post_stamp, &phbcmu->inbound_queueport_low); + } + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *pmu = acb->pmuD; ++ u16 index_stripped; ++ u16 postq_index; ++ unsigned long flags; ++ struct InBound_SRB *pinbound_srb; ++ ++ spin_lock_irqsave(&acb->postq_lock, flags); ++ postq_index = pmu->postq_index; ++ pinbound_srb = (struct InBound_SRB *)&(pmu->post_qbuffer[postq_index & 0xFF]); ++ pinbound_srb->addressHigh = dma_addr_hi32(cdb_phyaddr); ++ pinbound_srb->addressLow = dma_addr_lo32(cdb_phyaddr); ++ pinbound_srb->length = ccb->arc_cdb_size >> 2; ++ arcmsr_cdb->msgContext = dma_addr_lo32(cdb_phyaddr); ++ if (postq_index & 0x4000) { ++ index_stripped = postq_index & 0xFF; ++ index_stripped += 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_POSTQUEUE; ++ pmu->postq_index = index_stripped ? ++ (index_stripped | 0x4000) : index_stripped; ++ } else { ++ index_stripped = postq_index; ++ index_stripped += 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_POSTQUEUE; ++ pmu->postq_index = index_stripped ? index_stripped : ++ (index_stripped | 0x4000); ++ } ++ writel(postq_index, pmu->inboundlist_write_pointer); ++ spin_unlock_irqrestore(&acb->postq_lock, flags); ++ break; ++ } + } + } + +@@ -1323,6 +1525,18 @@ static void arcmsr_hbaC_stop_bgrb(struct AdapterControlBlock *pACB) + } + return; + } ++ ++static void arcmsr_hbaD_stop_bgrb(struct AdapterControlBlock *pACB) ++{ ++ struct MessageUnit_D *reg = pACB->pmuD; ++ ++ pACB->acb_flags &= ~ACB_F_MSG_START_BGRB; ++ writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, reg->inbound_msgaddr0); ++ if (!arcmsr_hbaD_wait_msgint_ready(pACB)) ++ pr_notice("arcmsr%d: wait 'stop adapter background rebulid' " ++ "timeout\n", pACB->host->host_no); ++} ++ + static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +@@ -1338,6 +1552,10 @@ static void arcmsr_stop_adapter_bgrb(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_C: { + arcmsr_hbaC_stop_bgrb(acb); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: ++ arcmsr_hbaD_stop_bgrb(acb); ++ break; + } + } + +@@ -1362,8 +1580,16 @@ static void arcmsr_iop_message_read(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_C: { + struct MessageUnit_C __iomem *reg = acb->pmuC; ++ + writel(ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK, ®->inbound_doorbell); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ writel(ARCMSR_ARC1214_DRV2IOP_DATA_OUT_READ, ++ reg->inbound_doorbell); ++ } ++ break; + } + } + +@@ -1398,6 +1624,12 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb) + writel(ARCMSR_HBCMU_DRV2IOP_DATA_WRITE_OK, ®->inbound_doorbell); + } + break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ writel(ARCMSR_ARC1214_DRV2IOP_DATA_IN_READY, ++ reg->inbound_doorbell); ++ } ++ break; + } + } + +@@ -1421,6 +1653,12 @@ struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb) + struct MessageUnit_C __iomem *phbcmu = acb->pmuC; + qbuffer = (struct QBUFFER __iomem *)&phbcmu->message_rbuffer; + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ qbuffer = (struct QBUFFER __iomem *)reg->message_rbuffer; ++ } ++ break; + } + return qbuffer; + } +@@ -1444,8 +1682,13 @@ static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBloc + case ACB_ADAPTER_TYPE_C: { + struct MessageUnit_C __iomem *reg = acb->pmuC; + pqbuffer = (struct QBUFFER __iomem *)®->message_wbuffer; +- } +- ++ } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ pqbuffer = (struct QBUFFER __iomem *)reg->message_wbuffer; ++ } ++ break; + } + return pqbuffer; + } +@@ -1500,7 +1743,7 @@ arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, + uint8_t __iomem *iop_data; + uint32_t iop_len; + +- if (acb->adapter_type & ACB_ADAPTER_TYPE_C) ++ if (acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) + return arcmsr_Read_iop_rqbuffer_in_DWORD(acb, prbuffer); + iop_data = (uint8_t __iomem *)prbuffer->data; + iop_len = readl(&prbuffer->data_len); +@@ -1586,7 +1829,7 @@ arcmsr_write_ioctldata2iop(struct AdapterControlBlock *acb) + uint8_t __iomem *iop_data; + int32_t allxfer_len = 0; + +- if (acb->adapter_type & ACB_ADAPTER_TYPE_C) { ++ if (acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) { + arcmsr_write_ioctldata2iop_in_DWORD(acb); + return; + } +@@ -1662,6 +1905,27 @@ static void arcmsr_hbaC_doorbell_isr(struct AdapterControlBlock *pACB) + | ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK + | ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE)); + } ++ ++static void arcmsr_hbaD_doorbell_isr(struct AdapterControlBlock *pACB) ++{ ++ uint32_t outbound_doorbell; ++ struct MessageUnit_D *pmu = pACB->pmuD; ++ ++ outbound_doorbell = readl(pmu->outbound_doorbell); ++ do { ++ writel(outbound_doorbell, pmu->outbound_doorbell); ++ if (outbound_doorbell & ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE) ++ arcmsr_hbaD_message_isr(pACB); ++ if (outbound_doorbell & ARCMSR_ARC1214_IOP2DRV_DATA_WRITE_OK) ++ arcmsr_iop2drv_data_wrote_handle(pACB); ++ if (outbound_doorbell & ARCMSR_ARC1214_IOP2DRV_DATA_READ_OK) ++ arcmsr_iop2drv_data_read_handle(pACB); ++ outbound_doorbell = readl(pmu->outbound_doorbell); ++ } while (outbound_doorbell & (ARCMSR_ARC1214_IOP2DRV_DATA_WRITE_OK ++ | ARCMSR_ARC1214_IOP2DRV_DATA_READ_OK ++ | ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE)); ++} ++ + static void arcmsr_hbaA_postqueue_isr(struct AdapterControlBlock *acb) + { + uint32_t flag_ccb; +@@ -1728,6 +1992,59 @@ static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) + } + } + } ++ ++static void arcmsr_hbaD_postqueue_isr(struct AdapterControlBlock *acb) ++{ ++ u32 outbound_write_pointer, doneq_index, index_stripped; ++ uint32_t addressLow, ccb_cdb_phy; ++ int error; ++ struct MessageUnit_D *pmu; ++ struct ARCMSR_CDB *arcmsr_cdb; ++ struct CommandControlBlock *ccb; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&acb->doneq_lock, flags); ++ pmu = acb->pmuD; ++ outbound_write_pointer = pmu->done_qbuffer[0].addressLow + 1; ++ doneq_index = pmu->doneq_index; ++ if ((doneq_index & 0xFFF) != (outbound_write_pointer & 0xFFF)) { ++ do { ++ if (doneq_index & 0x4000) { ++ index_stripped = doneq_index & 0xFFF; ++ index_stripped += 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ++ ? (index_stripped | 0x4000) : ++ (index_stripped + 1); ++ } else { ++ index_stripped = doneq_index; ++ index_stripped += 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ++ ? index_stripped : ++ ((index_stripped | 0x4000) + 1); ++ } ++ doneq_index = pmu->doneq_index; ++ addressLow = pmu->done_qbuffer[doneq_index & ++ 0xFFF].addressLow; ++ ccb_cdb_phy = (addressLow & 0xFFFFFFF0); ++ arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset ++ + ccb_cdb_phy); ++ ccb = container_of(arcmsr_cdb, ++ struct CommandControlBlock, arcmsr_cdb); ++ error = (addressLow & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1) ++ ? true : false; ++ arcmsr_drain_donequeue(acb, ccb, error); ++ writel(doneq_index, pmu->outboundlist_read_pointer); ++ } while ((doneq_index & 0xFFF) != ++ (outbound_write_pointer & 0xFFF)); ++ } ++ writel(ARCMSR_ARC1214_OUTBOUND_LIST_INTERRUPT_CLEAR, ++ pmu->outboundlist_interrupt_cause); ++ readl(pmu->outboundlist_interrupt_cause); ++ spin_unlock_irqrestore(&acb->doneq_lock, flags); ++} ++ + /* + ********************************************************************************** + ** Handle a message interrupt +@@ -1768,6 +2085,15 @@ static void arcmsr_hbaC_message_isr(struct AdapterControlBlock *acb) + schedule_work(&acb->arcmsr_do_message_isr_bh); + } + ++static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb) ++{ ++ struct MessageUnit_D *reg = acb->pmuD; ++ ++ writel(ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE, reg->outbound_doorbell); ++ readl(reg->outbound_doorbell); ++ schedule_work(&acb->arcmsr_do_message_isr_bh); ++} ++ + static int arcmsr_hbaA_handle_isr(struct AdapterControlBlock *acb) + { + uint32_t outbound_intstatus; +@@ -1845,6 +2171,32 @@ static int arcmsr_hbaC_handle_isr(struct AdapterControlBlock *pACB) + ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR)); + return IRQ_HANDLED; + } ++ ++static irqreturn_t arcmsr_hbaD_handle_isr(struct AdapterControlBlock *pACB) ++{ ++ u32 host_interrupt_status; ++ struct MessageUnit_D *pmu = pACB->pmuD; ++ ++ host_interrupt_status = readl(pmu->host_int_status) & ++ (ARCMSR_ARC1214_OUTBOUND_POSTQUEUE_ISR | ++ ARCMSR_ARC1214_OUTBOUND_DOORBELL_ISR); ++ if (!host_interrupt_status) ++ return IRQ_NONE; ++ do { ++ /* MU post queue interrupts*/ ++ if (host_interrupt_status & ++ ARCMSR_ARC1214_OUTBOUND_POSTQUEUE_ISR) ++ arcmsr_hbaD_postqueue_isr(pACB); ++ if (host_interrupt_status & ++ ARCMSR_ARC1214_OUTBOUND_DOORBELL_ISR) ++ arcmsr_hbaD_doorbell_isr(pACB); ++ host_interrupt_status = readl(pmu->host_int_status); ++ } while (host_interrupt_status & ++ (ARCMSR_ARC1214_OUTBOUND_POSTQUEUE_ISR | ++ ARCMSR_ARC1214_OUTBOUND_DOORBELL_ISR)); ++ return IRQ_HANDLED; ++} ++ + static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +@@ -1856,6 +2208,8 @@ static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_C: + return arcmsr_hbaC_handle_isr(acb); ++ case ACB_ADAPTER_TYPE_D: ++ return arcmsr_hbaD_handle_isr(acb); + default: + return IRQ_NONE; + } +@@ -2522,6 +2876,137 @@ static bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB) + /*all interrupt service will be enable at arcmsr_iop_init*/ + return true; + } ++ ++static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb) ++{ ++ char *acb_firm_model = acb->firm_model; ++ char *acb_firm_version = acb->firm_version; ++ char *acb_device_map = acb->device_map; ++ char __iomem *iop_firm_model; ++ char __iomem *iop_firm_version; ++ char __iomem *iop_device_map; ++ u32 count; ++ struct MessageUnit_D *reg ; ++ void *dma_coherent2; ++ dma_addr_t dma_coherent_handle2; ++ struct pci_dev *pdev = acb->pdev; ++ ++ acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_D), 32); ++ dma_coherent2 = dma_alloc_coherent(&pdev->dev, acb->roundup_ccbsize, ++ &dma_coherent_handle2, GFP_KERNEL); ++ if (!dma_coherent2) { ++ pr_notice("DMA allocation failed...\n"); ++ return false; ++ } ++ memset(dma_coherent2, 0, acb->roundup_ccbsize); ++ acb->dma_coherent_handle2 = dma_coherent_handle2; ++ acb->dma_coherent2 = dma_coherent2; ++ reg = (struct MessageUnit_D *)dma_coherent2; ++ acb->pmuD = reg; ++ reg->chip_id = acb->mem_base0 + ARCMSR_ARC1214_CHIP_ID; ++ reg->cpu_mem_config = acb->mem_base0 + ++ ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION; ++ reg->i2o_host_interrupt_mask = acb->mem_base0 + ++ ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK; ++ reg->sample_at_reset = acb->mem_base0 + ARCMSR_ARC1214_SAMPLE_RESET; ++ reg->reset_request = acb->mem_base0 + ARCMSR_ARC1214_RESET_REQUEST; ++ reg->host_int_status = acb->mem_base0 + ++ ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS; ++ reg->pcief0_int_enable = acb->mem_base0 + ++ ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE; ++ reg->inbound_msgaddr0 = acb->mem_base0 + ++ ARCMSR_ARC1214_INBOUND_MESSAGE0; ++ reg->inbound_msgaddr1 = acb->mem_base0 + ++ ARCMSR_ARC1214_INBOUND_MESSAGE1; ++ reg->outbound_msgaddr0 = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_MESSAGE0; ++ reg->outbound_msgaddr1 = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_MESSAGE1; ++ reg->inbound_doorbell = acb->mem_base0 + ++ ARCMSR_ARC1214_INBOUND_DOORBELL; ++ reg->outbound_doorbell = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_DOORBELL; ++ reg->outbound_doorbell_enable = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE; ++ reg->inboundlist_base_low = acb->mem_base0 + ++ ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW; ++ reg->inboundlist_base_high = acb->mem_base0 + ++ ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH; ++ reg->inboundlist_write_pointer = acb->mem_base0 + ++ ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER; ++ reg->outboundlist_base_low = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW; ++ reg->outboundlist_base_high = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH; ++ reg->outboundlist_copy_pointer = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER; ++ reg->outboundlist_read_pointer = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER; ++ reg->outboundlist_interrupt_cause = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE; ++ reg->outboundlist_interrupt_enable = acb->mem_base0 + ++ ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE; ++ reg->message_wbuffer = acb->mem_base0 + ARCMSR_ARC1214_MESSAGE_WBUFFER; ++ reg->message_rbuffer = acb->mem_base0 + ARCMSR_ARC1214_MESSAGE_RBUFFER; ++ reg->msgcode_rwbuffer = acb->mem_base0 + ++ ARCMSR_ARC1214_MESSAGE_RWBUFFER; ++ iop_firm_model = (char __iomem *)(®->msgcode_rwbuffer[15]); ++ iop_firm_version = (char __iomem *)(®->msgcode_rwbuffer[17]); ++ iop_device_map = (char __iomem *)(®->msgcode_rwbuffer[21]); ++ if (readl(acb->pmuD->outbound_doorbell) & ++ ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE) { ++ writel(ARCMSR_ARC1214_IOP2DRV_MESSAGE_CMD_DONE, ++ acb->pmuD->outbound_doorbell);/*clear interrupt*/ ++ } ++ /* post "get config" instruction */ ++ writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, reg->inbound_msgaddr0); ++ /* wait message ready */ ++ if (!arcmsr_hbaD_wait_msgint_ready(acb)) { ++ pr_notice("arcmsr%d: wait get adapter firmware " ++ "miscellaneous data timeout\n", acb->host->host_no); ++ dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize, ++ acb->dma_coherent2, acb->dma_coherent_handle2); ++ return false; ++ } ++ count = 8; ++ while (count) { ++ *acb_firm_model = readb(iop_firm_model); ++ acb_firm_model++; ++ iop_firm_model++; ++ count--; ++ } ++ count = 16; ++ while (count) { ++ *acb_firm_version = readb(iop_firm_version); ++ acb_firm_version++; ++ iop_firm_version++; ++ count--; ++ } ++ count = 16; ++ while (count) { ++ *acb_device_map = readb(iop_device_map); ++ acb_device_map++; ++ iop_device_map++; ++ count--; ++ } ++ acb->signature = readl(®->msgcode_rwbuffer[1]); ++ /*firm_signature,1,00-03*/ ++ acb->firm_request_len = readl(®->msgcode_rwbuffer[2]); ++ /*firm_request_len,1,04-07*/ ++ acb->firm_numbers_queue = readl(®->msgcode_rwbuffer[3]); ++ /*firm_numbers_queue,2,08-11*/ ++ acb->firm_sdram_size = readl(®->msgcode_rwbuffer[4]); ++ /*firm_sdram_size,3,12-15*/ ++ acb->firm_hd_channels = readl(®->msgcode_rwbuffer[5]); ++ /*firm_hd_channels,4,16-19*/ ++ acb->firm_cfg_version = readl(®->msgcode_rwbuffer[25]); ++ pr_notice("Areca RAID Controller%d: Model %s, F/W %s\n", ++ acb->host->host_no, ++ acb->firm_model, ++ acb->firm_version); ++ return true; ++} ++ + static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) + { + bool rtn = false; +@@ -2536,6 +3021,9 @@ static bool arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) + case ACB_ADAPTER_TYPE_C: + rtn = arcmsr_hbaC_get_config(acb); + break; ++ case ACB_ADAPTER_TYPE_D: ++ rtn = arcmsr_hbaD_get_config(acb); ++ break; + default: + break; + } +@@ -2725,6 +3213,89 @@ polling_hbc_ccb_retry: + } + return rtn; + } ++ ++static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb, ++ struct CommandControlBlock *poll_ccb) ++{ ++ bool error; ++ uint32_t poll_ccb_done = 0, poll_count = 0, flag_ccb, ccb_cdb_phy; ++ int rtn, doneq_index, index_stripped, outbound_write_pointer; ++ unsigned long flags; ++ struct ARCMSR_CDB *arcmsr_cdb; ++ struct CommandControlBlock *pCCB; ++ struct MessageUnit_D *pmu = acb->pmuD; ++ ++polling_hbaD_ccb_retry: ++ poll_count++; ++ while (1) { ++ outbound_write_pointer = pmu->done_qbuffer[0].addressLow + 1; ++ doneq_index = pmu->doneq_index; ++ if ((outbound_write_pointer & 0xFFF) == (doneq_index & 0xFFF)) { ++ if (poll_ccb_done) { ++ rtn = SUCCESS; ++ break; ++ } else { ++ msleep(25); ++ if (poll_count > 40) { ++ rtn = FAILED; ++ break; ++ } ++ goto polling_hbaD_ccb_retry; ++ } ++ } ++ spin_lock_irqsave(&acb->doneq_lock, flags); ++ if (doneq_index & 0x4000) { ++ index_stripped = doneq_index & 0xFFF; ++ index_stripped += 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? ++ (index_stripped | 0x4000) : ++ (index_stripped + 1); ++ } else { ++ index_stripped = doneq_index; ++ index_stripped += 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? index_stripped : ++ ((index_stripped | 0x4000) + 1); ++ } ++ spin_unlock_irqrestore(&acb->doneq_lock, flags); ++ doneq_index = pmu->doneq_index; ++ flag_ccb = pmu->done_qbuffer[doneq_index & 0xFFF].addressLow; ++ ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); ++ arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ++ ccb_cdb_phy); ++ pCCB = container_of(arcmsr_cdb, struct CommandControlBlock, ++ arcmsr_cdb); ++ poll_ccb_done |= (pCCB == poll_ccb) ? 1 : 0; ++ if ((pCCB->acb != acb) || ++ (pCCB->startdone != ARCMSR_CCB_START)) { ++ if (pCCB->startdone == ARCMSR_CCB_ABORTED) { ++ pr_notice("arcmsr%d: scsi id = %d " ++ "lun = %d ccb = '0x%p' poll command " ++ "abort successfully\n" ++ , acb->host->host_no ++ , pCCB->pcmd->device->id ++ , (u32)pCCB->pcmd->device->lun ++ , pCCB); ++ pCCB->pcmd->result = DID_ABORT << 16; ++ arcmsr_ccb_complete(pCCB); ++ continue; ++ } ++ pr_notice("arcmsr%d: polling an illegal " ++ "ccb command done ccb = '0x%p' " ++ "ccboutstandingcount = %d\n" ++ , acb->host->host_no ++ , pCCB ++ , atomic_read(&acb->ccboutstandingcount)); ++ continue; ++ } ++ error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE1) ++ ? true : false; ++ arcmsr_report_ccb_state(acb, pCCB, error); ++ } ++ return rtn; ++} ++ + static int arcmsr_polling_ccbdone(struct AdapterControlBlock *acb, + struct CommandControlBlock *poll_ccb) + { +@@ -2743,6 +3314,10 @@ static int arcmsr_polling_ccbdone(struct AdapterControlBlock *acb, + case ACB_ADAPTER_TYPE_C: { + rtn = arcmsr_hbaC_polling_ccbdone(acb, poll_ccb); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: ++ rtn = arcmsr_hbaD_polling_ccbdone(acb, poll_ccb); ++ break; + } + return rtn; + } +@@ -2760,6 +3335,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + */ + switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_B: ++ case ACB_ADAPTER_TYPE_D: + dma_coherent_handle = acb->dma_coherent_handle2; + break; + default: +@@ -2849,6 +3425,27 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) + } + } + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ uint32_t __iomem *rwbuffer; ++ struct MessageUnit_D *reg = acb->pmuD; ++ reg->postq_index = 0; ++ reg->doneq_index = 0; ++ rwbuffer = reg->msgcode_rwbuffer; ++ writel(ARCMSR_SIGNATURE_SET_CONFIG, rwbuffer++); ++ writel(cdb_phyaddr_hi32, rwbuffer++); ++ writel(cdb_phyaddr, rwbuffer++); ++ writel(cdb_phyaddr + (ARCMSR_MAX_ARC1214_POSTQUEUE * ++ sizeof(struct InBound_SRB)), rwbuffer++); ++ writel(0x100, rwbuffer); ++ writel(ARCMSR_INBOUND_MESG0_SET_CONFIG, reg->inbound_msgaddr0); ++ if (!arcmsr_hbaD_wait_msgint_ready(acb)) { ++ pr_notice("arcmsr%d: 'set command Q window' timeout\n", ++ acb->host->host_no); ++ return 1; ++ } ++ } ++ break; + } + return 0; + } +@@ -2880,6 +3477,15 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) + firmware_state = readl(®->outbound_msgaddr1); + } while ((firmware_state & ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK) == 0); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ do { ++ firmware_state = readl(reg->outbound_msgaddr1); ++ } while ((firmware_state & ++ ARCMSR_ARC1214_MESSAGE_FIRMWARE_OK) == 0); ++ } ++ break; + } + } + +@@ -2950,6 +3556,35 @@ static void arcmsr_hbaC_request_device_map(struct AdapterControlBlock *acb) + return; + } + ++static void arcmsr_hbaD_request_device_map(struct AdapterControlBlock *acb) ++{ ++ struct MessageUnit_D *reg = acb->pmuD; ++ ++ if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ++ ((acb->acb_flags & ACB_F_BUS_RESET) != 0) || ++ ((acb->acb_flags & ACB_F_ABORT) != 0)) { ++ mod_timer(&acb->eternal_timer, ++ jiffies + msecs_to_jiffies(6 * HZ)); ++ } else { ++ acb->fw_flag = FW_NORMAL; ++ if (atomic_read(&acb->ante_token_value) == ++ atomic_read(&acb->rq_map_token)) { ++ atomic_set(&acb->rq_map_token, 16); ++ } ++ atomic_set(&acb->ante_token_value, ++ atomic_read(&acb->rq_map_token)); ++ if (atomic_dec_and_test(&acb->rq_map_token)) { ++ mod_timer(&acb->eternal_timer, jiffies + ++ msecs_to_jiffies(6 * HZ)); ++ return; ++ } ++ writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ++ reg->inbound_msgaddr0); ++ mod_timer(&acb->eternal_timer, jiffies + ++ msecs_to_jiffies(6 * HZ)); ++ } ++} ++ + static void arcmsr_request_device_map(unsigned long pacb) + { + struct AdapterControlBlock *acb = (struct AdapterControlBlock *)pacb; +@@ -2965,6 +3600,10 @@ static void arcmsr_request_device_map(unsigned long pacb) + case ACB_ADAPTER_TYPE_C: { + arcmsr_hbaC_request_device_map(acb); + } ++ break; ++ case ACB_ADAPTER_TYPE_D: ++ arcmsr_hbaD_request_device_map(acb); ++ break; + } + } + +@@ -3002,6 +3641,19 @@ static void arcmsr_hbaC_start_bgrb(struct AdapterControlBlock *pACB) + } + return; + } ++ ++static void arcmsr_hbaD_start_bgrb(struct AdapterControlBlock *pACB) ++{ ++ struct MessageUnit_D *pmu = pACB->pmuD; ++ ++ pACB->acb_flags |= ACB_F_MSG_START_BGRB; ++ writel(ARCMSR_INBOUND_MESG0_START_BGRB, pmu->inbound_msgaddr0); ++ if (!arcmsr_hbaD_wait_msgint_ready(pACB)) { ++ pr_notice("arcmsr%d: wait 'start adapter " ++ "background rebulid' timeout\n", pACB->host->host_no); ++ } ++} ++ + static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb) + { + switch (acb->adapter_type) { +@@ -3013,6 +3665,10 @@ static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_C: + arcmsr_hbaC_start_bgrb(acb); ++ break; ++ case ACB_ADAPTER_TYPE_D: ++ arcmsr_hbaD_start_bgrb(acb); ++ break; + } + } + +@@ -3058,6 +3714,29 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb) + break; + } + } ++ break; ++ case ACB_ADAPTER_TYPE_D: { ++ struct MessageUnit_D *reg = acb->pmuD; ++ uint32_t outbound_doorbell, i; ++ /* empty doorbell Qbuffer if door bell ringed */ ++ outbound_doorbell = readl(reg->outbound_doorbell); ++ writel(outbound_doorbell, reg->outbound_doorbell); ++ writel(ARCMSR_ARC1214_DRV2IOP_DATA_OUT_READ, ++ reg->inbound_doorbell); ++ for (i = 0; i < 200; i++) { ++ msleep(20); ++ outbound_doorbell = readl(reg->outbound_doorbell); ++ if (outbound_doorbell & ++ ARCMSR_ARC1214_IOP2DRV_DATA_WRITE_OK) { ++ writel(outbound_doorbell, ++ reg->outbound_doorbell); ++ writel(ARCMSR_ARC1214_DRV2IOP_DATA_OUT_READ, ++ reg->inbound_doorbell); ++ } else ++ break; ++ } ++ } ++ break; + } + } + +@@ -3088,6 +3767,7 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb) + int i, count = 0; + struct MessageUnit_A __iomem *pmuA = acb->pmuA; + struct MessageUnit_C __iomem *pmuC = acb->pmuC; ++ struct MessageUnit_D *pmuD = acb->pmuD; + + /* backup pci config data */ + printk(KERN_NOTICE "arcmsr%d: executing hw bus reset .....\n", acb->host->host_no); +@@ -3108,6 +3788,8 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb) + writel(0xD, &pmuC->write_sequence); + } while (((readl(&pmuC->host_diagnostic) & ARCMSR_ARC1880_DiagWrite_ENABLE) == 0) && (count < 5)); + writel(ARCMSR_ARC1880_RESET_ADAPTER, &pmuC->host_diagnostic); ++ } else if ((acb->dev_id == 0x1214)) { ++ writel(0x20, pmuD->reset_request); + } else { + pci_write_config_byte(acb->pdev, 0x84, 0x20); + } +@@ -3304,6 +3986,66 @@ sleep: + } + break; + } ++ case ACB_ADAPTER_TYPE_D: { ++ if (acb->acb_flags & ACB_F_BUS_RESET) { ++ long timeout; ++ pr_notice("arcmsr: there is an bus reset" ++ " eh proceeding.......\n"); ++ timeout = wait_event_timeout(wait_q, (acb->acb_flags ++ & ACB_F_BUS_RESET) == 0, 220 * HZ); ++ if (timeout) ++ return SUCCESS; ++ } ++ acb->acb_flags |= ACB_F_BUS_RESET; ++ if (!arcmsr_iop_reset(acb)) { ++ struct MessageUnit_D *reg; ++ reg = acb->pmuD; ++ arcmsr_hardware_reset(acb); ++ acb->acb_flags &= ~ACB_F_IOP_INITED; ++ nap: ++ ssleep(ARCMSR_SLEEPTIME); ++ if ((readl(reg->sample_at_reset) & 0x80) != 0) { ++ pr_err("arcmsr%d: waiting for " ++ "hw bus reset return, retry=%d\n", ++ acb->host->host_no, retry_count); ++ if (retry_count > ARCMSR_RETRYCOUNT) { ++ acb->fw_flag = FW_DEADLOCK; ++ pr_err("arcmsr%d: waiting for hw bus" ++ " reset return, " ++ "RETRY TERMINATED!!\n", ++ acb->host->host_no); ++ return FAILED; ++ } ++ retry_count++; ++ goto nap; ++ } ++ acb->acb_flags |= ACB_F_IOP_INITED; ++ /* disable all outbound interrupt */ ++ intmask_org = arcmsr_disable_outbound_ints(acb); ++ arcmsr_get_firmware_spec(acb); ++ arcmsr_start_adapter_bgrb(acb); ++ arcmsr_clear_doorbell_queue_buffer(acb); ++ arcmsr_enable_outbound_ints(acb, intmask_org); ++ atomic_set(&acb->rq_map_token, 16); ++ atomic_set(&acb->ante_token_value, 16); ++ acb->fw_flag = FW_NORMAL; ++ mod_timer(&acb->eternal_timer, ++ jiffies + msecs_to_jiffies(6 * HZ)); ++ acb->acb_flags &= ~ACB_F_BUS_RESET; ++ rtn = SUCCESS; ++ pr_err("arcmsr: scsi bus reset " ++ "eh returns with success\n"); ++ } else { ++ acb->acb_flags &= ~ACB_F_BUS_RESET; ++ atomic_set(&acb->rq_map_token, 16); ++ atomic_set(&acb->ante_token_value, 16); ++ acb->fw_flag = FW_NORMAL; ++ mod_timer(&acb->eternal_timer, ++ jiffies + msecs_to_jiffies(6 * HZ)); ++ rtn = SUCCESS; ++ } ++ break; ++ } + } + return rtn; + } +@@ -3380,6 +4122,7 @@ static const char *arcmsr_info(struct Scsi_Host *host) + case PCI_DEVICE_ID_ARECA_1280: + type = "SATA"; + break; ++ case PCI_DEVICE_ID_ARECA_1214: + case PCI_DEVICE_ID_ARECA_1380: + case PCI_DEVICE_ID_ARECA_1381: + case PCI_DEVICE_ID_ARECA_1680: diff --git a/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch b/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch new file mode 100644 index 000000000..a38b6bd6e --- /dev/null +++ b/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch @@ -0,0 +1,63 @@ +From: Ching Huang +Date: Tue, 19 Aug 2014 15:28:36 +0800 +Subject: [17/19] arcmsr: call scsi_scan_host at the end of host initialization +Origin: https://git.kernel.org/linus/b4eb6ae9075a958ffe24620f985f6bd729a1b138 +Bug-Debian: https://bugs.debian.org/698821 + +Call scsi_scan_host at the end of host initialization and fix and error path +to free allocated resource. + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index b3cb969..3d3cdfe 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -112,6 +112,7 @@ static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb); + static void arcmsr_hardware_reset(struct AdapterControlBlock *acb); + static const char *arcmsr_info(struct Scsi_Host *); + static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb); ++static void arcmsr_free_irq(struct pci_dev *, struct AdapterControlBlock *); + static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, + int queue_depth, int reason) + { +@@ -755,12 +756,11 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + } + error = scsi_add_host(host, &pdev->dev); + if(error){ +- goto RAID_controller_stop; ++ goto free_ccb_pool; + } + if (arcmsr_request_irq(pdev, acb) == FAILED) + goto scsi_host_remove; + arcmsr_iop_init(acb); +- scsi_scan_host(host); + INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn); + atomic_set(&acb->rq_map_token, 16); + atomic_set(&acb->ante_token_value, 16); +@@ -772,13 +772,17 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id) + add_timer(&acb->eternal_timer); + if(arcmsr_alloc_sysfs_attr(acb)) + goto out_free_sysfs; ++ scsi_scan_host(host); + return 0; + out_free_sysfs: +-scsi_host_remove: +- scsi_remove_host(host); +-RAID_controller_stop: ++ del_timer_sync(&acb->eternal_timer); ++ flush_work(&acb->arcmsr_do_message_isr_bh); + arcmsr_stop_adapter_bgrb(acb); + arcmsr_flush_adapter_cache(acb); ++ arcmsr_free_irq(pdev, acb); ++scsi_host_remove: ++ scsi_remove_host(host); ++free_ccb_pool: + arcmsr_free_ccb_pool(acb); + free_hbb_mu: + arcmsr_free_mu(acb); diff --git a/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch b/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch new file mode 100644 index 000000000..bd6743e93 --- /dev/null +++ b/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch @@ -0,0 +1,232 @@ +From: Ching Huang +Date: Mon, 15 Sep 2014 19:05:33 +0800 +Subject: [18/19] arcmsr: simplify of updating doneq_index and postq_index +Origin: https://git.kernel.org/linus/3b8155d582968f79a62c79358d5e137f99f04407 +Bug-Debian: https://bugs.debian.org/698821 + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr_hba.c | 121 +++++++++++++-------------------------- + 1 file changed, 40 insertions(+), 81 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 3d3cdfe..0dd38cc 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -1120,7 +1120,7 @@ static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct Comma + static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + { + int i = 0; +- uint32_t flag_ccb; ++ uint32_t flag_ccb, ccb_cdb_phy; + struct ARCMSR_CDB *pARCMSR_CDB; + bool error; + struct CommandControlBlock *pCCB; +@@ -1164,10 +1164,6 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_C: { + struct MessageUnit_C __iomem *reg = acb->pmuC; +- struct ARCMSR_CDB *pARCMSR_CDB; +- uint32_t flag_ccb, ccb_cdb_phy; +- bool error; +- struct CommandControlBlock *pCCB; + while ((readl(®->host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { + /*need to do*/ + flag_ccb = readl(®->outbound_queueport_low); +@@ -1181,35 +1177,25 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + break; + case ACB_ADAPTER_TYPE_D: { + struct MessageUnit_D *pmu = acb->pmuD; +- uint32_t ccb_cdb_phy, outbound_write_pointer; +- uint32_t doneq_index, index_stripped, addressLow, residual; +- bool error; +- struct CommandControlBlock *pCCB; ++ uint32_t outbound_write_pointer; ++ uint32_t doneq_index, index_stripped, addressLow, residual, toggle; ++ unsigned long flags; + +- outbound_write_pointer = pmu->done_qbuffer[0].addressLow + 1; +- doneq_index = pmu->doneq_index; + residual = atomic_read(&acb->ccboutstandingcount); + for (i = 0; i < residual; i++) { +- while ((doneq_index & 0xFFF) != ++ spin_lock_irqsave(&acb->doneq_lock, flags); ++ outbound_write_pointer = ++ pmu->done_qbuffer[0].addressLow + 1; ++ doneq_index = pmu->doneq_index; ++ if ((doneq_index & 0xFFF) != + (outbound_write_pointer & 0xFFF)) { +- if (doneq_index & 0x4000) { +- index_stripped = doneq_index & 0xFFF; +- index_stripped += 1; +- index_stripped %= +- ARCMSR_MAX_ARC1214_DONEQUEUE; +- pmu->doneq_index = index_stripped ? +- (index_stripped | 0x4000) : +- (index_stripped + 1); +- } else { +- index_stripped = doneq_index; +- index_stripped += 1; +- index_stripped %= +- ARCMSR_MAX_ARC1214_DONEQUEUE; +- pmu->doneq_index = index_stripped ? +- index_stripped : +- ((index_stripped | 0x4000) + 1); +- } ++ toggle = doneq_index & 0x4000; ++ index_stripped = (doneq_index & 0xFFF) + 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? (index_stripped | toggle) : ++ ((toggle ^ 0x4000) + 1); + doneq_index = pmu->doneq_index; ++ spin_unlock_irqrestore(&acb->doneq_lock, flags); + addressLow = pmu->done_qbuffer[doneq_index & + 0xFFF].addressLow; + ccb_cdb_phy = (addressLow & 0xFFFFFFF0); +@@ -1223,11 +1209,10 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) + arcmsr_drain_donequeue(acb, pCCB, error); + writel(doneq_index, + pmu->outboundlist_read_pointer); ++ } else { ++ spin_unlock_irqrestore(&acb->doneq_lock, flags); ++ mdelay(10); + } +- mdelay(10); +- outbound_write_pointer = +- pmu->done_qbuffer[0].addressLow + 1; +- doneq_index = pmu->doneq_index; + } + pmu->postq_index = 0; + pmu->doneq_index = 0x40FF; +@@ -1460,7 +1445,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + case ACB_ADAPTER_TYPE_D: { + struct MessageUnit_D *pmu = acb->pmuD; + u16 index_stripped; +- u16 postq_index; ++ u16 postq_index, toggle; + unsigned long flags; + struct InBound_SRB *pinbound_srb; + +@@ -1471,19 +1456,11 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr + pinbound_srb->addressLow = dma_addr_lo32(cdb_phyaddr); + pinbound_srb->length = ccb->arc_cdb_size >> 2; + arcmsr_cdb->msgContext = dma_addr_lo32(cdb_phyaddr); +- if (postq_index & 0x4000) { +- index_stripped = postq_index & 0xFF; +- index_stripped += 1; +- index_stripped %= ARCMSR_MAX_ARC1214_POSTQUEUE; +- pmu->postq_index = index_stripped ? +- (index_stripped | 0x4000) : index_stripped; +- } else { +- index_stripped = postq_index; +- index_stripped += 1; +- index_stripped %= ARCMSR_MAX_ARC1214_POSTQUEUE; +- pmu->postq_index = index_stripped ? index_stripped : +- (index_stripped | 0x4000); +- } ++ toggle = postq_index & 0x4000; ++ index_stripped = postq_index + 1; ++ index_stripped &= (ARCMSR_MAX_ARC1214_POSTQUEUE - 1); ++ pmu->postq_index = index_stripped ? (index_stripped | toggle) : ++ (toggle ^ 0x4000); + writel(postq_index, pmu->inboundlist_write_pointer); + spin_unlock_irqrestore(&acb->postq_lock, flags); + break; +@@ -1999,7 +1976,7 @@ static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) + + static void arcmsr_hbaD_postqueue_isr(struct AdapterControlBlock *acb) + { +- u32 outbound_write_pointer, doneq_index, index_stripped; ++ u32 outbound_write_pointer, doneq_index, index_stripped, toggle; + uint32_t addressLow, ccb_cdb_phy; + int error; + struct MessageUnit_D *pmu; +@@ -2013,21 +1990,11 @@ static void arcmsr_hbaD_postqueue_isr(struct AdapterControlBlock *acb) + doneq_index = pmu->doneq_index; + if ((doneq_index & 0xFFF) != (outbound_write_pointer & 0xFFF)) { + do { +- if (doneq_index & 0x4000) { +- index_stripped = doneq_index & 0xFFF; +- index_stripped += 1; +- index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; +- pmu->doneq_index = index_stripped +- ? (index_stripped | 0x4000) : +- (index_stripped + 1); +- } else { +- index_stripped = doneq_index; +- index_stripped += 1; +- index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; +- pmu->doneq_index = index_stripped +- ? index_stripped : +- ((index_stripped | 0x4000) + 1); +- } ++ toggle = doneq_index & 0x4000; ++ index_stripped = (doneq_index & 0xFFF) + 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? (index_stripped | toggle) : ++ ((toggle ^ 0x4000) + 1); + doneq_index = pmu->doneq_index; + addressLow = pmu->done_qbuffer[doneq_index & + 0xFFF].addressLow; +@@ -2890,7 +2857,7 @@ static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb) + char __iomem *iop_firm_version; + char __iomem *iop_device_map; + u32 count; +- struct MessageUnit_D *reg ; ++ struct MessageUnit_D *reg; + void *dma_coherent2; + dma_addr_t dma_coherent_handle2; + struct pci_dev *pdev = acb->pdev; +@@ -3223,7 +3190,7 @@ static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb, + { + bool error; + uint32_t poll_ccb_done = 0, poll_count = 0, flag_ccb, ccb_cdb_phy; +- int rtn, doneq_index, index_stripped, outbound_write_pointer; ++ int rtn, doneq_index, index_stripped, outbound_write_pointer, toggle; + unsigned long flags; + struct ARCMSR_CDB *arcmsr_cdb; + struct CommandControlBlock *pCCB; +@@ -3232,9 +3199,11 @@ static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb, + polling_hbaD_ccb_retry: + poll_count++; + while (1) { ++ spin_lock_irqsave(&acb->doneq_lock, flags); + outbound_write_pointer = pmu->done_qbuffer[0].addressLow + 1; + doneq_index = pmu->doneq_index; + if ((outbound_write_pointer & 0xFFF) == (doneq_index & 0xFFF)) { ++ spin_unlock_irqrestore(&acb->doneq_lock, flags); + if (poll_ccb_done) { + rtn = SUCCESS; + break; +@@ -3247,23 +3216,13 @@ polling_hbaD_ccb_retry: + goto polling_hbaD_ccb_retry; + } + } +- spin_lock_irqsave(&acb->doneq_lock, flags); +- if (doneq_index & 0x4000) { +- index_stripped = doneq_index & 0xFFF; +- index_stripped += 1; +- index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; +- pmu->doneq_index = index_stripped ? +- (index_stripped | 0x4000) : +- (index_stripped + 1); +- } else { +- index_stripped = doneq_index; +- index_stripped += 1; +- index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; +- pmu->doneq_index = index_stripped ? index_stripped : +- ((index_stripped | 0x4000) + 1); +- } +- spin_unlock_irqrestore(&acb->doneq_lock, flags); ++ toggle = doneq_index & 0x4000; ++ index_stripped = (doneq_index & 0xFFF) + 1; ++ index_stripped %= ARCMSR_MAX_ARC1214_DONEQUEUE; ++ pmu->doneq_index = index_stripped ? (index_stripped | toggle) : ++ ((toggle ^ 0x4000) + 1); + doneq_index = pmu->doneq_index; ++ spin_unlock_irqrestore(&acb->doneq_lock, flags); + flag_ccb = pmu->done_qbuffer[doneq_index & 0xFFF].addressLow; + ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); + arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + diff --git a/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch b/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch new file mode 100644 index 000000000..bbc0834ff --- /dev/null +++ b/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch @@ -0,0 +1,606 @@ +From: Ching Huang +Date: Wed, 24 Sep 2014 17:33:34 +0800 +Subject: [19/19] arcmsr: simplify ioctl data read/write +Origin: https://git.kernel.org/linus/2e9feb434a66311f30bde2430a5609e9e24df62b +Bug-Debian: https://bugs.debian.org/698821 + +Signed-off-by: Ching Huang +Reviewed-by: Tomas Henzl +Signed-off-by: Christoph Hellwig +--- + drivers/scsi/arcmsr/arcmsr.h | 13 +-- + drivers/scsi/arcmsr/arcmsr_attr.c | 127 ++++++++--------------- + drivers/scsi/arcmsr/arcmsr_hba.c | 208 +++++++++++++------------------------- + 3 files changed, 119 insertions(+), 229 deletions(-) + +diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h +index d1c78ef..3bcaaac 100644 +--- a/drivers/scsi/arcmsr/arcmsr.h ++++ b/drivers/scsi/arcmsr/arcmsr.h +@@ -52,7 +52,7 @@ struct device_attribute; + #define ARCMSR_MAX_FREECCB_NUM 320 + #define ARCMSR_MAX_OUTSTANDING_CMD 255 + #endif +-#define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140428" ++#define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140919" + #define ARCMSR_SCSI_INITIATOR_ID 255 + #define ARCMSR_MAX_XFER_SECTORS 512 + #define ARCMSR_MAX_XFER_SECTORS_B 4096 +@@ -107,10 +107,11 @@ struct CMD_MESSAGE + ** IOP Message Transfer Data for user space + ******************************************************************************* + */ ++#define ARCMSR_API_DATA_BUFLEN 1032 + struct CMD_MESSAGE_FIELD + { + struct CMD_MESSAGE cmdmessage; +- uint8_t messagedatabuffer[1032]; ++ uint8_t messagedatabuffer[ARCMSR_API_DATA_BUFLEN]; + }; + /* IOP message transfer */ + #define ARCMSR_MESSAGE_FAIL 0x0001 +@@ -678,15 +679,15 @@ struct AdapterControlBlock + unsigned int uncache_size; + uint8_t rqbuffer[ARCMSR_MAX_QBUFFER]; + /* data collection buffer for read from 80331 */ +- int32_t rqbuf_firstindex; ++ int32_t rqbuf_getIndex; + /* first of read buffer */ +- int32_t rqbuf_lastindex; ++ int32_t rqbuf_putIndex; + /* last of read buffer */ + uint8_t wqbuffer[ARCMSR_MAX_QBUFFER]; + /* data collection buffer for write to 80331 */ +- int32_t wqbuf_firstindex; ++ int32_t wqbuf_getIndex; + /* first of write buffer */ +- int32_t wqbuf_lastindex; ++ int32_t wqbuf_putIndex; + /* last of write buffer */ + uint8_t devstate[ARCMSR_MAX_TARGETID][ARCMSR_MAX_TARGETLUN]; + /* id0 ..... id15, lun0...lun7 */ +diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c +index 16422ad..9c86481 100644 +--- a/drivers/scsi/arcmsr/arcmsr_attr.c ++++ b/drivers/scsi/arcmsr/arcmsr_attr.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -68,7 +69,7 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp, + struct device *dev = container_of(kobj,struct device,kobj); + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +- uint8_t *pQbuffer,*ptmpQbuffer; ++ uint8_t *ptmpQbuffer; + int32_t allxfer_len = 0; + unsigned long flags; + +@@ -78,57 +79,22 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp, + /* do message unit read. */ + ptmpQbuffer = (uint8_t *)buf; + spin_lock_irqsave(&acb->rqbuffer_lock, flags); +- if (acb->rqbuf_firstindex != acb->rqbuf_lastindex) { +- pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex]; +- if (acb->rqbuf_firstindex > acb->rqbuf_lastindex) { +- if ((ARCMSR_MAX_QBUFFER - acb->rqbuf_firstindex) >= 1032) { +- memcpy(ptmpQbuffer, pQbuffer, 1032); +- acb->rqbuf_firstindex += 1032; +- acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER; +- allxfer_len = 1032; +- } else { +- if (((ARCMSR_MAX_QBUFFER - acb->rqbuf_firstindex) +- + acb->rqbuf_lastindex) > 1032) { +- memcpy(ptmpQbuffer, pQbuffer, +- ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex); +- ptmpQbuffer += ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex; +- memcpy(ptmpQbuffer, acb->rqbuffer, 1032 +- - (ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex)); +- acb->rqbuf_firstindex = 1032 - +- (ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex); +- allxfer_len = 1032; +- } else { +- memcpy(ptmpQbuffer, pQbuffer, +- ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex); +- ptmpQbuffer += ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex; +- memcpy(ptmpQbuffer, acb->rqbuffer, +- acb->rqbuf_lastindex); +- allxfer_len = ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex + +- acb->rqbuf_lastindex; +- acb->rqbuf_firstindex = +- acb->rqbuf_lastindex; +- } +- } +- } else { +- if ((acb->rqbuf_lastindex - acb->rqbuf_firstindex) > 1032) { +- memcpy(ptmpQbuffer, pQbuffer, 1032); +- acb->rqbuf_firstindex += 1032; +- allxfer_len = 1032; +- } else { +- memcpy(ptmpQbuffer, pQbuffer, acb->rqbuf_lastindex +- - acb->rqbuf_firstindex); +- allxfer_len = acb->rqbuf_lastindex - +- acb->rqbuf_firstindex; +- acb->rqbuf_firstindex = acb->rqbuf_lastindex; +- } ++ if (acb->rqbuf_getIndex != acb->rqbuf_putIndex) { ++ unsigned int tail = acb->rqbuf_getIndex; ++ unsigned int head = acb->rqbuf_putIndex; ++ unsigned int cnt_to_end = CIRC_CNT_TO_END(head, tail, ARCMSR_MAX_QBUFFER); ++ ++ allxfer_len = CIRC_CNT(head, tail, ARCMSR_MAX_QBUFFER); ++ if (allxfer_len > ARCMSR_API_DATA_BUFLEN) ++ allxfer_len = ARCMSR_API_DATA_BUFLEN; ++ ++ if (allxfer_len <= cnt_to_end) ++ memcpy(ptmpQbuffer, acb->rqbuffer + tail, allxfer_len); ++ else { ++ memcpy(ptmpQbuffer, acb->rqbuffer + tail, cnt_to_end); ++ memcpy(ptmpQbuffer + cnt_to_end, acb->rqbuffer, allxfer_len - cnt_to_end); + } ++ acb->rqbuf_getIndex = (acb->rqbuf_getIndex + allxfer_len) % ARCMSR_MAX_QBUFFER; + } + if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { + struct QBUFFER __iomem *prbuffer; +@@ -150,47 +116,42 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, + struct device *dev = container_of(kobj,struct device,kobj); + struct Scsi_Host *host = class_to_shost(dev); + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; +- int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; ++ int32_t user_len, cnt2end; + uint8_t *pQbuffer, *ptmpuserbuffer; + unsigned long flags; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; +- if (count > 1032) ++ if (count > ARCMSR_API_DATA_BUFLEN) + return -EINVAL; + /* do message unit write. */ + ptmpuserbuffer = (uint8_t *)buf; + user_len = (int32_t)count; + spin_lock_irqsave(&acb->wqbuffer_lock, flags); +- wqbuf_lastindex = acb->wqbuf_lastindex; +- wqbuf_firstindex = acb->wqbuf_firstindex; +- if (wqbuf_lastindex != wqbuf_firstindex) { ++ if (acb->wqbuf_putIndex != acb->wqbuf_getIndex) { + arcmsr_write_ioctldata2iop(acb); + spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + return 0; /*need retry*/ + } else { +- my_empty_len = (wqbuf_firstindex-wqbuf_lastindex - 1) +- &(ARCMSR_MAX_QBUFFER - 1); +- if (my_empty_len >= user_len) { +- while (user_len > 0) { +- pQbuffer = &acb->wqbuffer[acb->wqbuf_lastindex]; +- memcpy(pQbuffer, ptmpuserbuffer, 1); +- acb->wqbuf_lastindex++; +- acb->wqbuf_lastindex %= ARCMSR_MAX_QBUFFER; +- ptmpuserbuffer++; +- user_len--; +- } +- if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { +- acb->acb_flags &= +- ~ACB_F_MESSAGE_WQBUFFER_CLEARED; +- arcmsr_write_ioctldata2iop(acb); +- } +- spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); +- return count; +- } else { +- spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); +- return 0; /*need retry*/ ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_putIndex]; ++ cnt2end = ARCMSR_MAX_QBUFFER - acb->wqbuf_putIndex; ++ if (user_len > cnt2end) { ++ memcpy(pQbuffer, ptmpuserbuffer, cnt2end); ++ ptmpuserbuffer += cnt2end; ++ user_len -= cnt2end; ++ acb->wqbuf_putIndex = 0; ++ pQbuffer = acb->wqbuffer; + } ++ memcpy(pQbuffer, ptmpuserbuffer, user_len); ++ acb->wqbuf_putIndex += user_len; ++ acb->wqbuf_putIndex %= ARCMSR_MAX_QBUFFER; ++ if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { ++ acb->acb_flags &= ++ ~ACB_F_MESSAGE_WQBUFFER_CLEARED; ++ arcmsr_write_ioctldata2iop(acb); ++ } ++ spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); ++ return count; + } + } + +@@ -215,12 +176,12 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct file *filp, + | ACB_F_MESSAGE_RQBUFFER_CLEARED + | ACB_F_MESSAGE_WQBUFFER_READED); + spin_lock_irqsave(&acb->rqbuffer_lock, flags); +- acb->rqbuf_firstindex = 0; +- acb->rqbuf_lastindex = 0; ++ acb->rqbuf_getIndex = 0; ++ acb->rqbuf_putIndex = 0; + spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); + spin_lock_irqsave(&acb->wqbuffer_lock, flags); +- acb->wqbuf_firstindex = 0; +- acb->wqbuf_lastindex = 0; ++ acb->wqbuf_getIndex = 0; ++ acb->wqbuf_putIndex = 0; + spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + pQbuffer = acb->rqbuffer; + memset(pQbuffer, 0, sizeof (struct QBUFFER)); +@@ -234,7 +195,7 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = { + .name = "mu_read", + .mode = S_IRUSR , + }, +- .size = 1032, ++ .size = ARCMSR_API_DATA_BUFLEN, + .read = arcmsr_sysfs_iop_message_read, + }; + +@@ -243,7 +204,7 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = { + .name = "mu_write", + .mode = S_IWUSR, + }, +- .size = 1032, ++ .size = ARCMSR_API_DATA_BUFLEN, + .write = arcmsr_sysfs_iop_message_write, + }; + +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c +index 0dd38cc..0b44fb5 100644 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c +@@ -58,6 +58,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1701,16 +1702,15 @@ arcmsr_Read_iop_rqbuffer_in_DWORD(struct AdapterControlBlock *acb, + buf2 = (uint32_t *)buf1; + } + while (iop_len > 0) { +- pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex]; ++ pQbuffer = &acb->rqbuffer[acb->rqbuf_putIndex]; + *pQbuffer = *buf1; +- acb->rqbuf_lastindex++; ++ acb->rqbuf_putIndex++; + /* if last, index number set it to 0 */ +- acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; ++ acb->rqbuf_putIndex %= ARCMSR_MAX_QBUFFER; + buf1++; + iop_len--; + } +- if (buf2) +- kfree(buf2); ++ kfree(buf2); + /* let IOP know data has been read */ + arcmsr_iop_message_read(acb); + return 1; +@@ -1729,10 +1729,10 @@ arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, + iop_data = (uint8_t __iomem *)prbuffer->data; + iop_len = readl(&prbuffer->data_len); + while (iop_len > 0) { +- pQbuffer = &acb->rqbuffer[acb->rqbuf_lastindex]; ++ pQbuffer = &acb->rqbuffer[acb->rqbuf_putIndex]; + *pQbuffer = readb(iop_data); +- acb->rqbuf_lastindex++; +- acb->rqbuf_lastindex %= ARCMSR_MAX_QBUFFER; ++ acb->rqbuf_putIndex++; ++ acb->rqbuf_putIndex %= ARCMSR_MAX_QBUFFER; + iop_data++; + iop_len--; + } +@@ -1748,7 +1748,7 @@ static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb) + + spin_lock_irqsave(&acb->rqbuffer_lock, flags); + prbuffer = arcmsr_get_iop_rqbuffer(acb); +- buf_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) & ++ buf_empty_len = (acb->rqbuf_putIndex - acb->rqbuf_getIndex - 1) & + (ARCMSR_MAX_QBUFFER - 1); + if (buf_empty_len >= readl(&prbuffer->data_len)) { + if (arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0) +@@ -1775,12 +1775,12 @@ static void arcmsr_write_ioctldata2iop_in_DWORD(struct AdapterControlBlock *acb) + acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); + pwbuffer = arcmsr_get_iop_wqbuffer(acb); + iop_data = (uint32_t __iomem *)pwbuffer->data; +- while ((acb->wqbuf_firstindex != acb->wqbuf_lastindex) ++ while ((acb->wqbuf_getIndex != acb->wqbuf_putIndex) + && (allxfer_len < 124)) { +- pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex]; ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_getIndex]; + *buf1 = *pQbuffer; +- acb->wqbuf_firstindex++; +- acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; ++ acb->wqbuf_getIndex++; ++ acb->wqbuf_getIndex %= ARCMSR_MAX_QBUFFER; + buf1++; + allxfer_len++; + } +@@ -1818,12 +1818,12 @@ arcmsr_write_ioctldata2iop(struct AdapterControlBlock *acb) + acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); + pwbuffer = arcmsr_get_iop_wqbuffer(acb); + iop_data = (uint8_t __iomem *)pwbuffer->data; +- while ((acb->wqbuf_firstindex != acb->wqbuf_lastindex) ++ while ((acb->wqbuf_getIndex != acb->wqbuf_putIndex) + && (allxfer_len < 124)) { +- pQbuffer = &acb->wqbuffer[acb->wqbuf_firstindex]; ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_getIndex]; + writeb(*pQbuffer, iop_data); +- acb->wqbuf_firstindex++; +- acb->wqbuf_firstindex %= ARCMSR_MAX_QBUFFER; ++ acb->wqbuf_getIndex++; ++ acb->wqbuf_getIndex %= ARCMSR_MAX_QBUFFER; + iop_data++; + allxfer_len++; + } +@@ -1838,9 +1838,9 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) + + spin_lock_irqsave(&acb->wqbuffer_lock, flags); + acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED; +- if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) ++ if (acb->wqbuf_getIndex != acb->wqbuf_putIndex) + arcmsr_write_ioctldata2iop(acb); +- if (acb->wqbuf_firstindex == acb->wqbuf_lastindex) ++ if (acb->wqbuf_getIndex == acb->wqbuf_putIndex) + acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_CLEARED; + spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + } +@@ -2210,14 +2210,14 @@ void arcmsr_clear_iop2drv_rqueue_buffer(struct AdapterControlBlock *acb) + for (i = 0; i < 15; i++) { + if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { + acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; +- acb->rqbuf_firstindex = 0; +- acb->rqbuf_lastindex = 0; ++ acb->rqbuf_getIndex = 0; ++ acb->rqbuf_putIndex = 0; + arcmsr_iop_message_read(acb); + mdelay(30); +- } else if (acb->rqbuf_firstindex != +- acb->rqbuf_lastindex) { +- acb->rqbuf_firstindex = 0; +- acb->rqbuf_lastindex = 0; ++ } else if (acb->rqbuf_getIndex != ++ acb->rqbuf_putIndex) { ++ acb->rqbuf_getIndex = 0; ++ acb->rqbuf_putIndex = 0; + mdelay(30); + } else + break; +@@ -2256,9 +2256,9 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + switch (controlcode) { + case ARCMSR_MESSAGE_READ_RQBUFFER: { + unsigned char *ver_addr; +- uint8_t *pQbuffer, *ptmpQbuffer; ++ uint8_t *ptmpQbuffer; + uint32_t allxfer_len = 0; +- ver_addr = kmalloc(1032, GFP_ATOMIC); ++ ver_addr = kmalloc(ARCMSR_API_DATA_BUFLEN, GFP_ATOMIC); + if (!ver_addr) { + retvalue = ARCMSR_MESSAGE_FAIL; + pr_info("%s: memory not enough!\n", __func__); +@@ -2266,66 +2266,22 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + } + ptmpQbuffer = ver_addr; + spin_lock_irqsave(&acb->rqbuffer_lock, flags); +- if (acb->rqbuf_firstindex != acb->rqbuf_lastindex) { +- pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex]; +- if (acb->rqbuf_firstindex > acb->rqbuf_lastindex) { +- if ((ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex) >= 1032) { +- memcpy(ptmpQbuffer, pQbuffer, 1032); +- acb->rqbuf_firstindex += 1032; +- acb->rqbuf_firstindex %= ARCMSR_MAX_QBUFFER; +- allxfer_len = 1032; +- } else { +- if (((ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex) + +- acb->rqbuf_lastindex) > 1032) { +- memcpy(ptmpQbuffer, +- pQbuffer, ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex); +- ptmpQbuffer += +- ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex; +- memcpy(ptmpQbuffer, +- acb->rqbuffer, 1032 - +- (ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex)); +- acb->rqbuf_firstindex = +- 1032 - (ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex); +- allxfer_len = 1032; +- } else { +- memcpy(ptmpQbuffer, +- pQbuffer, ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex); +- ptmpQbuffer += +- ARCMSR_MAX_QBUFFER - +- acb->rqbuf_firstindex; +- memcpy(ptmpQbuffer, +- acb->rqbuffer, +- acb->rqbuf_lastindex); +- allxfer_len = ARCMSR_MAX_QBUFFER +- - acb->rqbuf_firstindex + +- acb->rqbuf_lastindex; +- acb->rqbuf_firstindex = +- acb->rqbuf_lastindex; +- } +- } +- } else { +- if ((acb->rqbuf_lastindex - +- acb->rqbuf_firstindex) > 1032) { +- memcpy(ptmpQbuffer, pQbuffer, 1032); +- acb->rqbuf_firstindex += 1032; +- allxfer_len = 1032; +- } else { +- memcpy(ptmpQbuffer, pQbuffer, +- acb->rqbuf_lastindex - +- acb->rqbuf_firstindex); +- allxfer_len = acb->rqbuf_lastindex +- - acb->rqbuf_firstindex; +- acb->rqbuf_firstindex = +- acb->rqbuf_lastindex; +- } ++ if (acb->rqbuf_getIndex != acb->rqbuf_putIndex) { ++ unsigned int tail = acb->rqbuf_getIndex; ++ unsigned int head = acb->rqbuf_putIndex; ++ unsigned int cnt_to_end = CIRC_CNT_TO_END(head, tail, ARCMSR_MAX_QBUFFER); ++ ++ allxfer_len = CIRC_CNT(head, tail, ARCMSR_MAX_QBUFFER); ++ if (allxfer_len > ARCMSR_API_DATA_BUFLEN) ++ allxfer_len = ARCMSR_API_DATA_BUFLEN; ++ ++ if (allxfer_len <= cnt_to_end) ++ memcpy(ptmpQbuffer, acb->rqbuffer + tail, allxfer_len); ++ else { ++ memcpy(ptmpQbuffer, acb->rqbuffer + tail, cnt_to_end); ++ memcpy(ptmpQbuffer + cnt_to_end, acb->rqbuffer, allxfer_len - cnt_to_end); + } ++ acb->rqbuf_getIndex = (acb->rqbuf_getIndex + allxfer_len) % ARCMSR_MAX_QBUFFER; + } + memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, + allxfer_len); +@@ -2349,9 +2305,9 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + } + case ARCMSR_MESSAGE_WRITE_WQBUFFER: { + unsigned char *ver_addr; +- int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex; ++ int32_t user_len, cnt2end; + uint8_t *pQbuffer, *ptmpuserbuffer; +- ver_addr = kmalloc(1032, GFP_ATOMIC); ++ ver_addr = kmalloc(ARCMSR_API_DATA_BUFLEN, GFP_ATOMIC); + if (!ver_addr) { + retvalue = ARCMSR_MESSAGE_FAIL; + goto message_out; +@@ -2361,9 +2317,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + memcpy(ptmpuserbuffer, + pcmdmessagefld->messagedatabuffer, user_len); + spin_lock_irqsave(&acb->wqbuffer_lock, flags); +- wqbuf_lastindex = acb->wqbuf_lastindex; +- wqbuf_firstindex = acb->wqbuf_firstindex; +- if (wqbuf_lastindex != wqbuf_firstindex) { ++ if (acb->wqbuf_putIndex != acb->wqbuf_getIndex) { + struct SENSE_DATA *sensebuffer = + (struct SENSE_DATA *)cmd->sense_buffer; + arcmsr_write_ioctldata2iop(acb); +@@ -2375,48 +2329,22 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + sensebuffer->Valid = 1; + retvalue = ARCMSR_MESSAGE_FAIL; + } else { +- my_empty_len = (wqbuf_firstindex - wqbuf_lastindex - 1) +- & (ARCMSR_MAX_QBUFFER - 1); +- if (my_empty_len >= user_len) { +- while (user_len > 0) { +- pQbuffer = &acb->wqbuffer[acb->wqbuf_lastindex]; +- if ((acb->wqbuf_lastindex + user_len) +- > ARCMSR_MAX_QBUFFER) { +- memcpy(pQbuffer, ptmpuserbuffer, +- ARCMSR_MAX_QBUFFER - +- acb->wqbuf_lastindex); +- ptmpuserbuffer += +- (ARCMSR_MAX_QBUFFER +- - acb->wqbuf_lastindex); +- user_len -= (ARCMSR_MAX_QBUFFER +- - acb->wqbuf_lastindex); +- acb->wqbuf_lastindex = 0; +- } else { +- memcpy(pQbuffer, ptmpuserbuffer, +- user_len); +- acb->wqbuf_lastindex += user_len; +- acb->wqbuf_lastindex %= +- ARCMSR_MAX_QBUFFER; +- user_len = 0; +- } +- } +- if (acb->acb_flags & +- ACB_F_MESSAGE_WQBUFFER_CLEARED) { +- acb->acb_flags &= ++ pQbuffer = &acb->wqbuffer[acb->wqbuf_putIndex]; ++ cnt2end = ARCMSR_MAX_QBUFFER - acb->wqbuf_putIndex; ++ if (user_len > cnt2end) { ++ memcpy(pQbuffer, ptmpuserbuffer, cnt2end); ++ ptmpuserbuffer += cnt2end; ++ user_len -= cnt2end; ++ acb->wqbuf_putIndex = 0; ++ pQbuffer = acb->wqbuffer; ++ } ++ memcpy(pQbuffer, ptmpuserbuffer, user_len); ++ acb->wqbuf_putIndex += user_len; ++ acb->wqbuf_putIndex %= ARCMSR_MAX_QBUFFER; ++ if (acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_CLEARED) { ++ acb->acb_flags &= + ~ACB_F_MESSAGE_WQBUFFER_CLEARED; +- arcmsr_write_ioctldata2iop(acb); +- } +- } else { +- struct SENSE_DATA *sensebuffer = +- (struct SENSE_DATA *)cmd->sense_buffer; +- /* has error report sensedata */ +- sensebuffer->ErrorCode = +- SCSI_SENSE_CURRENT_ERRORS; +- sensebuffer->SenseKey = ILLEGAL_REQUEST; +- sensebuffer->AdditionalSenseLength = 0x0A; +- sensebuffer->AdditionalSenseCode = 0x20; +- sensebuffer->Valid = 1; +- retvalue = ARCMSR_MESSAGE_FAIL; ++ arcmsr_write_ioctldata2iop(acb); + } + } + spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); +@@ -2435,8 +2363,8 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + arcmsr_clear_iop2drv_rqueue_buffer(acb); + spin_lock_irqsave(&acb->rqbuffer_lock, flags); + acb->acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; +- acb->rqbuf_firstindex = 0; +- acb->rqbuf_lastindex = 0; ++ acb->rqbuf_getIndex = 0; ++ acb->rqbuf_putIndex = 0; + memset(pQbuffer, 0, ARCMSR_MAX_QBUFFER); + spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); + if (acb->fw_flag == FW_DEADLOCK) +@@ -2452,8 +2380,8 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + spin_lock_irqsave(&acb->wqbuffer_lock, flags); + acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | + ACB_F_MESSAGE_WQBUFFER_READED); +- acb->wqbuf_firstindex = 0; +- acb->wqbuf_lastindex = 0; ++ acb->wqbuf_getIndex = 0; ++ acb->wqbuf_putIndex = 0; + memset(pQbuffer, 0, ARCMSR_MAX_QBUFFER); + spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); + if (acb->fw_flag == FW_DEADLOCK) +@@ -2469,16 +2397,16 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, + arcmsr_clear_iop2drv_rqueue_buffer(acb); + spin_lock_irqsave(&acb->rqbuffer_lock, flags); + acb->acb_flags |= ACB_F_MESSAGE_RQBUFFER_CLEARED; +- acb->rqbuf_firstindex = 0; +- acb->rqbuf_lastindex = 0; ++ acb->rqbuf_getIndex = 0; ++ acb->rqbuf_putIndex = 0; + pQbuffer = acb->rqbuffer; + memset(pQbuffer, 0, sizeof(struct QBUFFER)); + spin_unlock_irqrestore(&acb->rqbuffer_lock, flags); + spin_lock_irqsave(&acb->wqbuffer_lock, flags); + acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED | + ACB_F_MESSAGE_WQBUFFER_READED); +- acb->wqbuf_firstindex = 0; +- acb->wqbuf_lastindex = 0; ++ acb->wqbuf_getIndex = 0; ++ acb->wqbuf_putIndex = 0; + pQbuffer = acb->wqbuffer; + memset(pQbuffer, 0, sizeof(struct QBUFFER)); + spin_unlock_irqrestore(&acb->wqbuffer_lock, flags); diff --git a/debian/patches/series b/debian/patches/series index d60fc6369..db81fcf0a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -521,3 +521,22 @@ bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch +features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch +features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch +features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch +features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch +features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch +features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch +features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch +features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch +features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch +features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch +features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch +features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch +features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch +features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch +features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch +features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch +features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch +features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch +features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch From 88e31fedd8c0a9e7681e0a7b1bfc051bd52b52b2 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 04:13:52 +0000 Subject: [PATCH 26/32] Note that 3.16.7-ckt7 fixed #770790 svn path=/dists/sid/linux/; revision=22434 --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 1696d1b4d..b3af006fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -137,6 +137,7 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium - md/raid5: fix another livelock caused by non-aligned writes. (regression in 3.16) - drm/radeon: fix PLLs on RS880 and older v2 (regression in 3.15) + (Closes: #770790) - [armhf/armmp-lpae] 8299/1: mm: ensure local active ASID is marked as allocated on rollover - PCI: Handle read-only BARs on AMD CS553x devices From 0b2d0179017233b27541e731250abf1a740240a7 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 05:09:52 +0000 Subject: [PATCH 27/32] [x86] drm/i915: Quietly reject attempts to create non-pagealigned stolen objects (Closes: #763155) svn path=/dists/sid/linux/; revision=22435 --- debian/changelog | 2 + ...reate-non-pagealigned-stolen-objects.patch | 52 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 55 insertions(+) create mode 100644 debian/patches/bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch diff --git a/debian/changelog b/debian/changelog index b3af006fd..d002e24eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -183,6 +183,8 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium SND_SOC_INTEL_BYT_RT5640_MACH, SND_SOC_INTEL_BYT_MAX98090_MACH as modules (Closes: #773835) * arcmsr: Backport changes up to Linux 3.18 (Closes: #698821) + * [x86] drm/i915: Quietly reject attempts to create non-pagealigned stolen + objects (Closes: #763155) [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/patches/bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch b/debian/patches/bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch new file mode 100644 index 000000000..ebefab35c --- /dev/null +++ b/debian/patches/bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch @@ -0,0 +1,52 @@ +Subject: drm/i915: Quietly reject attempts to create non-pagealigned stolen + objects +From: Chris Wilson +Date: Wed, 10 Dec 2014 08:17:11 +0000 +Origin: http://patchwork.freedesktop.org/patch/38659/ +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86883 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763155 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764528 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768027 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771227 + +This added as a BUG_ON as it considered that no one would ever request +an unaligned object. However, it turns out that some BIOSes will +allocate a scanout that is offset from 0 and not aligned to a page +boundary, and we were passing this through and hitting the BUG_ON during +boot. + +Quietly reject such a request to reserve the unaligned stolen object and +let the boot continue, restoring previous behaviour (i.e. no BIOS +framebuffer preservation). + +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86883 +Signed-off-by: Chris Wilson +Cc: stable@vger.kernel.org +Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) +Tested-by: Johannes W molb.org> +--- +drivers/gpu/drm/i915/i915_gem_stolen.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/i915/i915_gem_stolen.c ++++ b/drivers/gpu/drm/i915/i915_gem_stolen.c +@@ -431,13 +431,15 @@ i915_gem_object_create_stolen_for_preall + DRM_DEBUG_KMS("creating preallocated stolen object: stolen_offset=%x, gtt_offset=%x, size=%x\n", + stolen_offset, gtt_offset, size); + +- /* KISS and expect everything to be page-aligned */ +- BUG_ON(stolen_offset & 4095); +- BUG_ON(size & 4095); +- + if (WARN_ON(size == 0)) + return NULL; + ++ /* KISS and expect everything to be GTT page-aligned */ ++ if ((stolen_offset | size) & 4095) { ++ DRM_DEBUG_KMS("request for unaligned stolen object, denied\n"); ++ return NULL; ++ } ++ + stolen = kzalloc(sizeof(*stolen), GFP_KERNEL); + if (!stolen) + return NULL; diff --git a/debian/patches/series b/debian/patches/series index db81fcf0a..ef65d2394 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -540,3 +540,4 @@ features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch +bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch From 5b6b9def87633c19ae689eae261e129e00f29ca9 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 05:40:01 +0000 Subject: [PATCH 28/32] KEYS: request_key() should reget expired keys rather than give EKEYEXPIRED (regression in 3.13) (Closes: #758870) svn path=/dists/sid/linux/; revision=22436 --- debian/changelog | 2 + ...-should-reget-expired-keys-rather-th.patch | 102 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 105 insertions(+) create mode 100644 debian/patches/bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch diff --git a/debian/changelog b/debian/changelog index d002e24eb..919826361 100644 --- a/debian/changelog +++ b/debian/changelog @@ -185,6 +185,8 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium * arcmsr: Backport changes up to Linux 3.18 (Closes: #698821) * [x86] drm/i915: Quietly reject attempts to create non-pagealigned stolen objects (Closes: #763155) + * KEYS: request_key() should reget expired keys rather than give EKEYEXPIRED + (Closes: #758870) [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/patches/bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch b/debian/patches/bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch new file mode 100644 index 000000000..842c5803f --- /dev/null +++ b/debian/patches/bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch @@ -0,0 +1,102 @@ +From: David Howells +Date: Mon, 1 Dec 2014 22:52:53 +0000 +Subject: KEYS: request_key() should reget expired keys rather than give + EKEYEXPIRED +Origin: https://git.kernel.org/linus/0b0a84154eff56913e91df29de5c3a03a0029e38 + +Since the keyring facility can be viewed as a cache (at least in some +applications), the local expiration time on the key should probably be viewed +as a 'needs updating after this time' property rather than an absolute 'anyone +now wanting to use this object is out of luck' property. + +Since request_key() is the main interface for the usage of keys, this should +update or replace an expired key rather than issuing EKEYEXPIRED if the local +expiration has been reached (ie. it should refresh the cache). + +For absolute conditions where refreshing the cache probably doesn't help, the +key can be negatively instantiated using KEYCTL_REJECT_KEY with EKEYEXPIRED +given as the error to issue. This will still cause request_key() to return +EKEYEXPIRED as that was explicitly set. + +In the future, if the key type has an update op available, we might want to +upcall with the expired key and allow the upcall to update it. We would pass +a different operation name (the first column in /etc/request-key.conf) to the +request-key program. + +request_key() returning EKEYEXPIRED is causing an NFS problem which Chuck +Lever describes thusly: + + After about 10 minutes, my NFSv4 functional tests fail because the + ownership of the test files goes to "-2". Looking at /proc/keys + shows that the id_resolv keys that map to my test user ID have + expired. The ownership problem persists until the expired keys are + purged from the keyring, and fresh keys are obtained. + + I bisected the problem to 3.13 commit b2a4df200d57 ("KEYS: Expand + the capacity of a keyring"). This commit inadvertantly changes the + API contract of the internal function keyring_search_aux(). + + The root cause appears to be that b2a4df200d57 made "no state check" + the default behavior. "No state check" means the keyring search + iterator function skips checking the key's expiry timeout, and + returns expired keys. request_key_and_link() depends on getting + an -EAGAIN result code to know when to perform an upcall to refresh + an expired key. + +This patch can be tested directly by: + + keyctl request2 user debug:fred a @s + keyctl timeout %user:debug:fred 3 + sleep 4 + keyctl request2 user debug:fred a @s + +Without the patch, the last command gives error EKEYEXPIRED, but with the +command it gives a new key. + +Reported-by: Carl Hetherington +Reported-by: Chuck Lever +Signed-off-by: David Howells +Tested-by: Chuck Lever +[bwh: Backported to 3.16: + - Renumber KEYRING_SEARCH_SKIP_EXPIRED + - Adjust context] +--- + security/keys/internal.h | 1 + + security/keys/keyring.c | 3 ++- + security/keys/request_key.c | 3 ++- + 3 files changed, 5 insertions(+), 2 deletions(-) + +--- a/security/keys/internal.h ++++ b/security/keys/internal.h +@@ -121,6 +121,7 @@ struct keyring_search_context { + #define KEYRING_SEARCH_NO_UPDATE_TIME 0x0008 /* Don't update times */ + #define KEYRING_SEARCH_NO_CHECK_PERM 0x0010 /* Don't check permissions */ + #define KEYRING_SEARCH_DETECT_TOO_DEEP 0x0020 /* Give an error on excessive depth */ ++#define KEYRING_SEARCH_SKIP_EXPIRED 0x0040 /* Ignore expired keys (intention to replace) */ + + int (*iterator)(const void *object, void *iterator_data); + +--- a/security/keys/keyring.c ++++ b/security/keys/keyring.c +@@ -526,7 +526,8 @@ static int keyring_search_iterator(const + } + + if (key->expiry && ctx->now.tv_sec >= key->expiry) { +- ctx->result = ERR_PTR(-EKEYEXPIRED); ++ if (!(ctx->flags & KEYRING_SEARCH_SKIP_EXPIRED)) ++ ctx->result = ERR_PTR(-EKEYEXPIRED); + kleave(" = %d [expire]", ctx->skipped_ret); + goto skipped; + } +--- a/security/keys/request_key.c ++++ b/security/keys/request_key.c +@@ -533,7 +533,8 @@ struct key *request_key_and_link(struct + .cred = current_cred(), + .match = type->match, + .match_data = description, +- .flags = KEYRING_SEARCH_LOOKUP_DIRECT, ++ .flags = (KEYRING_SEARCH_LOOKUP_DIRECT | ++ KEYRING_SEARCH_SKIP_EXPIRED), + }; + struct key *key; + key_ref_t key_ref; diff --git a/debian/patches/series b/debian/patches/series index ef65d2394..7d199bfa7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -541,3 +541,4 @@ features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.pa features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch +bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch From 7c6fe99dee907c6e40c51d0de0623742892a916d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 06:22:03 +0000 Subject: [PATCH 29/32] drm: Enable DRM_BOCHS, DRM_QXL as modules qxl: Disable by default, as it is incompatible with wheezy's xserver-xorg-video-qxl. It can be forced to load with module parameter modeset=1. svn path=/dists/sid/linux/; revision=22437 --- debian/changelog | 4 ++++ debian/config/config | 10 ++++++++++ .../qxl-disable-modeset-by-default.patch | 20 +++++++++++++++++++ debian/patches/series | 1 + 4 files changed, 35 insertions(+) create mode 100644 debian/patches/debian/qxl-disable-modeset-by-default.patch diff --git a/debian/changelog b/debian/changelog index 919826361..9d7c66914 100644 --- a/debian/changelog +++ b/debian/changelog @@ -187,6 +187,10 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium objects (Closes: #763155) * KEYS: request_key() should reget expired keys rather than give EKEYEXPIRED (Closes: #758870) + * drm: Enable DRM_BOCHS, DRM_QXL as modules + - qxl: Disable by default, as it is incompatible with wheezy's + xserver-xorg-video-qxl. It can be forced to load with module + parameter modeset=1. [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/config/config b/debian/config/config index f75818fd4..4c91901f1 100644 --- a/debian/config/config +++ b/debian/config/config @@ -499,6 +499,11 @@ CONFIG_DRM_SAVAGE=m ## # CONFIG_DRM_AST is not set +## +## file: drivers/gpu/drm/bochs/Kconfig +## +CONFIG_DRM_BOCHS=m + ## ## file: drivers/gpu/drm/bridge/Kconfig ## @@ -529,6 +534,11 @@ CONFIG_NOUVEAU_DEBUG=5 CONFIG_NOUVEAU_DEBUG_DEFAULT=3 CONFIG_DRM_NOUVEAU_BACKLIGHT=y +## +## file: drivers/gpu/drm/qxl/Kconfig +## +CONFIG_DRM_QXL=m + ## ## file: drivers/gpu/drm/radeon/Kconfig ## diff --git a/debian/patches/debian/qxl-disable-modeset-by-default.patch b/debian/patches/debian/qxl-disable-modeset-by-default.patch new file mode 100644 index 000000000..b809e34c2 --- /dev/null +++ b/debian/patches/debian/qxl-disable-modeset-by-default.patch @@ -0,0 +1,20 @@ +From: Ben Hutchings +Subject: qxl: Disable by default +Forwarded: not-needed + +This kernel driver is incompatible with older versions of +xserver-xorg-video-qxl, so do not enable it by default. It should be +enabled by a modprobe configuration file installed by +xserver-xorg-video-qxl in jessie. + +--- a/drivers/gpu/drm/qxl/qxl_drv.c ++++ b/drivers/gpu/drm/qxl/qxl_drv.c +@@ -47,7 +47,7 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist + }; + MODULE_DEVICE_TABLE(pci, pciidlist); + +-static int qxl_modeset = -1; ++static int qxl_modeset = 0; + int qxl_num_crtc = 4; + + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); diff --git a/debian/patches/series b/debian/patches/series index 7d199bfa7..c9ed035dd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -542,3 +542,4 @@ features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.pa features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch +debian/qxl-disable-modeset-by-default.patch From de4bc4d36fe81ba6c27d369022954ee03efc4cc6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 06:35:19 +0000 Subject: [PATCH 30/32] Reorder recently added patches into the right sections of patch series svn path=/dists/sid/linux/; revision=22438 --- debian/patches/series | 54 ++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/debian/patches/series b/debian/patches/series index c9ed035dd..8ddb6ae33 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -45,6 +45,7 @@ debian/mgag200-disable-autoload.patch debian/cdc_ncm-cdc_mbim-use-ncm-by-default.patch debian/snd-pcsp-disable-autoload.patch bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch +debian/qxl-disable-modeset-by-default.patch # Arch bug fixes bugfix/arm/omap-musb-choice.patch @@ -57,6 +58,13 @@ bugfix/parisc/parisc-reduce-sigrtmin-from-37-to-32-to-behave-like-.patch bugfix/arm64/arm64-add-missing-dts-entry-for-X-Gene-platform.patch bugfix/arm64/arm64-removed-using-of-the-mask-attribute-in-the-dts.patch bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch +bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch +bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch +bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch +bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch +bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch +bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch +bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch # Arch features features/mips/MIPS-Support-hard-limit-of-cpu-count-nr_cpu_ids.patch @@ -166,6 +174,9 @@ bugfix/all/aufs-move-d_rcu-from-overlapping-d_child-to-overlapping-d.patch bugfix/all/net-mv643xx-disable-tso-by-default.patch bugfix/all/xen-balloon-cancel-ballooning-if-adding-new-memory-f.patch bugfix/all/xen-balloon-Don-t-continue-ballooning-when-BP_ECANCE.patch +bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch +bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch +bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch # memfd_create() & kdbus backport features/all/kdbus/mm-allow-drivers-to-prevent-new-writable-mappings.patch @@ -183,6 +194,7 @@ features/all/kdbus/asm-generic-add-memfd_create-system-call-to-unistd.h.patch features/all/kdbus/m68k-Wire-up-memfd_create.patch features/all/kdbus/MIPS-Wire-up-new-syscalls-getrandom-and-memfd_create.patch features/all/kdbus/powerpc-Wire-up-sys_seccomp-sys_getrandom-and-sys_me.patch +features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch # Miscellaneous features features/all/efi-autoload-efivars.patch @@ -498,29 +510,7 @@ features/all/iwlwifi-debug/iwlwifi-mvm-don-t-collect-logs-in-the-interrupt-threa features/all/iwlwifi-debug/iwlwifi-mvm-kill-iwl_mvm_fw_error_rxf_dump.patch features/all/iwlwifi-debug/iwlwifi-mvm-update-layout-of-firmware-error-dump.patch -# Fix ABI changes -debian/of-fix-abi-changes.patch -debian/iovec-fix-abi-change-in-3.16.7-ckt1.patch -debian/truncate-fix-abi-change-in-3.16.7-ckt1.patch -debian/perf-fix-abi-change-in-3.16.7-ckt2.patch -debian/arm-thread_info-fix-abi-change-in-3.16.7-ckt3.patch -debian/pci-fix-abi-change-in-3.16.7-ckt3.patch -debian/vfs-avoid-abi-change-for-dentry-union-changes.patch -debian/userns-fix-abi-change-in-3.16.7-ckt4.patch -features/all/kdbus/shm-add-memfd.h-to-uapi-export-list.patch -bugfix/x86/x86-hpet-force-enable-for-e6xx-based-systems.patch -bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch -bugfix/all/aslr-fix-stack-randomization-on-64-bit-systems.patch -debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch -debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch -debian/perf-fix-abi-change-in-3.16.7-ckt6.patch -debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch -debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch -bugfix/x86/acpi-video-add-some-samsung-models-to-disable_native.patch -bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-dell-xps15.patch -bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u3e.patch -bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch -bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch +# Update arcmsr to 3.18 features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch @@ -540,6 +530,18 @@ features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch -bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch -bugfix/all/keys-request_key-should-reget-expired-keys-rather-th.patch -debian/qxl-disable-modeset-by-default.patch + +# Fix ABI changes +debian/of-fix-abi-changes.patch +debian/iovec-fix-abi-change-in-3.16.7-ckt1.patch +debian/truncate-fix-abi-change-in-3.16.7-ckt1.patch +debian/perf-fix-abi-change-in-3.16.7-ckt2.patch +debian/arm-thread_info-fix-abi-change-in-3.16.7-ckt3.patch +debian/pci-fix-abi-change-in-3.16.7-ckt3.patch +debian/vfs-avoid-abi-change-for-dentry-union-changes.patch +debian/userns-fix-abi-change-in-3.16.7-ckt4.patch +debian/revert-quota-switch-get_dqblk-and-set_dqblk-to-use-b.patch +debian/rmap-fix-abi-change-in-3.16.7-ckt5.patch +debian/perf-fix-abi-change-in-3.16.7-ckt6.patch +debian/mm-fix-pagecache_get_page-abi-change-in-3.16.7-ckt6.patch +debian/tcp-fix-abi-change-in-3.16.7-ckt7.patch From c58105640323525a095b6f7404f8f106ac1377cf Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 15:13:10 +0000 Subject: [PATCH 31/32] of.h: Keep extern declaration of of_* variables when !CONFIG_OF Fixes build failure in simplefb on architectures without CONFIG_OF. svn path=/dists/sid/linux/; revision=22439 --- debian/changelog | 2 + ...-declaration-of-of_-variables-when-c.patch | 39 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 42 insertions(+) create mode 100644 debian/patches/features/all/of.h-keep-extern-declaration-of-of_-variables-when-c.patch diff --git a/debian/changelog b/debian/changelog index 9d7c66914..f33137c9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -191,6 +191,8 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium - qxl: Disable by default, as it is incompatible with wheezy's xserver-xorg-video-qxl. It can be forced to load with module parameter modeset=1. + * of.h: Keep extern declaration of of_* variables when !CONFIG_OF + (for simplefb) [ Helge Deller ] * [alpha] build debian-installer udeb packages diff --git a/debian/patches/features/all/of.h-keep-extern-declaration-of-of_-variables-when-c.patch b/debian/patches/features/all/of.h-keep-extern-declaration-of-of_-variables-when-c.patch new file mode 100644 index 000000000..d9e28b7a3 --- /dev/null +++ b/debian/patches/features/all/of.h-keep-extern-declaration-of-of_-variables-when-c.patch @@ -0,0 +1,39 @@ +From: Hans de Goede +Date: Fri, 14 Nov 2014 13:26:52 +0100 +Subject: of.h: Keep extern declaration of of_* variables when !CONFIG_OF +Origin: https://git.kernel.org/linus/6d09dc6b74caaca83e32e67f2454406041d58fb0 + +Keep the extern declaration of of_allnodes and friends, when building without +of support, this way code using them can be written like this: + + if (IS_ENABLED(CONFIG_OF_PLATFORM) && of_chosen) { + for_each_child_of_node(of_chosen, np) + ... + } + +And rely on the compiler optimizing it away, avoiding the need for #ifdef-ery. + +Signed-off-by: Hans de Goede +Signed-off-by: Tomi Valkeinen +--- + include/linux/of.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/include/linux/of.h ++++ b/include/linux/of.h +@@ -107,14 +107,13 @@ static inline struct device_node *of_nod + static inline void of_node_put(struct device_node *node) { } + #endif /* !CONFIG_OF_DYNAMIC */ + +-#ifdef CONFIG_OF +- + /* Pointer for first entry in chain of all nodes. */ + extern struct device_node *of_allnodes; + extern struct device_node *of_chosen; + extern struct device_node *of_aliases; + extern raw_spinlock_t devtree_lock; + ++#ifdef CONFIG_OF + static inline bool of_have_populated_dt(void) + { + return of_allnodes != NULL; diff --git a/debian/patches/series b/debian/patches/series index 8ddb6ae33..499b791af 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -213,6 +213,7 @@ features/all/efi-expose-underlying-uefi-firmware-platform-size-to.patch features/all/simplefb-formalize-pseudo-palette-handling.patch features/all/simplefb-add-goto-error-path-to-probe.patch features/all/simplefb-add-clock-handling-code.patch +features/all/of.h-keep-extern-declaration-of-of_-variables-when-c.patch features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch From 8a01e20b3fd54e1dd7f4c50f2d2597afb085e2b6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 1 Mar 2015 17:55:45 +0000 Subject: [PATCH 32/32] Prepare to release linux (3.16.7-ckt7-1). svn path=/dists/sid/linux/; revision=22440 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f33137c9d..622e72d3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium +linux (3.16.7-ckt7-1) unstable; urgency=medium * New upstream stable update: http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt5 @@ -202,7 +202,7 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium * Add support for Bananapro board, thanks Karsten Merker for the patch. (Closes: 779311) - -- Ian Campbell Mon, 09 Feb 2015 06:17:31 +0000 + -- Ben Hutchings Sun, 01 Mar 2015 15:13:40 +0000 linux (3.16.7-ckt4-3) unstable; urgency=medium