Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Jan 2013 16:20:15 +0000 (08:20 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Jan 2013 16:20:15 +0000 (08:20 -0800)
Pull s390 patches from Martin Schwidefsky:
 "Add the finit_module system call, fix the irq statistics in
  /proc/stat, fix a s390dbf lockdep problem, a patch revert for a
  problem that is not 100% understood yet, and a few patches to
  fix warnings."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/pci: define read*_relaxed functions
  s390/topology: export cpu_topology
  s390/pm: export pm_power_off
  s390/pci: define isa_dma_bridge_buggy
  s390/3215: partially revert tty close handling fix
  s390/irq: count cpu restart events
  s390/irq: remove split irq fields from /proc/stat
  s390/irq: enable irq sum accounting for /proc/stat again
  s390/syscalls: wire up finit_module syscall
  s390/pci: remove dead code
  s390/smp: fix section mismatch for smp_add_present_cpu()
  s390/debug: Fix s390dbf lockdep problem in debug_(un)register_view()

164 files changed:
Documentation/devicetree/bindings/clock/imx23-clock.txt
Documentation/devicetree/bindings/clock/imx25-clock.txt
Documentation/devicetree/bindings/clock/imx28-clock.txt
Documentation/devicetree/bindings/clock/imx6q-clock.txt
Documentation/devicetree/bindings/gpio/gpio-poweroff.txt
Documentation/networking/ip-sysctl.txt
Makefile
arch/arm/Kconfig
arch/arm/boot/dts/armada-370-xp.dtsi
arch/arm/boot/dts/armada-xp-mv78230.dtsi
arch/arm/boot/dts/armada-xp-mv78260.dtsi
arch/arm/boot/dts/armada-xp-mv78460.dtsi
arch/arm/boot/dts/armada-xp.dtsi
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/ecx-2000.dts
arch/arm/boot/dts/exynos4210-smdkv310.dts
arch/arm/boot/dts/exynos5250.dtsi
arch/arm/boot/dts/exynos5440-ssdk5440.dts
arch/arm/boot/dts/highbank.dts
arch/arm/boot/dts/imx23-olinuxino.dts
arch/arm/boot/dts/imx31-bug.dts
arch/arm/boot/dts/imx53.dtsi
arch/arm/boot/dts/kirkwood-6282.dtsi
arch/arm/boot/dts/kirkwood-topkick.dts
arch/arm/boot/dts/kirkwood.dtsi
arch/arm/common/vic.c
arch/arm/configs/mvebu_defconfig
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/common.c
arch/arm/mach-highbank/highbank.c
arch/arm/mach-highbank/hotplug.c
arch/arm/mach-highbank/platsmp.c
arch/arm/mach-highbank/pm.c
arch/arm/mach-highbank/sysregs.h
arch/arm/mach-highbank/system.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/board-usi_topkick.c
arch/arm/mach-nomadik/board-nhk8815.c
arch/arm/mach-nomadik/include/mach/irqs.h
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/usb.c
arch/arm/mach-omap2/cclock3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
arch/arm/mach-omap2/prm2xxx.c
arch/arm/mach-omap2/prm2xxx_3xxx.c
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-omap2/prm44xx.h
arch/arm/mach-versatile/include/mach/irqs.h
arch/arm/mach-vexpress/Kconfig
arch/arm/mm/cache-l2x0.c
arch/arm/mm/proc-v7.S
arch/arm/plat-omap/counter_32k.c
arch/arm/plat-omap/sram.c
arch/arm/plat-samsung/include/plat/cpu.h
drivers/bcma/Kconfig
drivers/bcma/driver_chipcommon_sflash.c
drivers/clk/mvebu/clk-gating-ctrl.c
drivers/dma/mv_xor.c
drivers/edac/Kconfig
drivers/edac/edac_mc_sysfs.c
drivers/gpu/drm/exynos/exynos_drm_buf.c
drivers/gpu/drm/exynos/exynos_drm_buf.h
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_connector.h
drivers/gpu/drm/exynos/exynos_drm_core.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_crtc.h
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
drivers/gpu/drm/exynos/exynos_drm_dmabuf.h
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_encoder.h
drivers/gpu/drm/exynos/exynos_drm_fb.c
drivers/gpu/drm/exynos/exynos_drm_fb.h
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.h
drivers/gpu/drm/exynos/exynos_drm_fimc.c
drivers/gpu/drm/exynos/exynos_drm_fimc.h
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_gem.c
drivers/gpu/drm/exynos/exynos_drm_gem.h
drivers/gpu/drm/exynos/exynos_drm_gsc.c
drivers/gpu/drm/exynos/exynos_drm_gsc.h
drivers/gpu/drm/exynos/exynos_drm_hdmi.h
drivers/gpu/drm/exynos/exynos_drm_iommu.c
drivers/gpu/drm/exynos/exynos_drm_iommu.h
drivers/gpu/drm/exynos/exynos_drm_ipp.c
drivers/gpu/drm/exynos/exynos_drm_ipp.h
drivers/gpu/drm/exynos/exynos_drm_rotator.c
drivers/gpu/drm/exynos/exynos_drm_rotator.h
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_drm_vidi.h
drivers/gpu/drm/exynos/exynos_hdmi.h
drivers/gpu/drm/exynos/exynos_mixer.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/nouveau/nouveau_prime.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600_cs.c
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/radeon_asic.h
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_prime.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/net/ethernet/nvidia/forcedeth.c
drivers/net/usb/qmi_wwan.c
drivers/net/vxlan.c
drivers/net/wireless/ath/ath9k/Kconfig
drivers/net/wireless/ath/ath9k/ar9003_hw.c
drivers/net/wireless/ath/carl9170/fw.c
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
drivers/net/wireless/brcm80211/brcmsmac/debug.h
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
drivers/net/wireless/p54/p54usb.c
drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
drivers/net/wireless/rtlwifi/rtl8192de/trx.c
drivers/net/wireless/rtlwifi/rtl8192se/trx.c
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
drivers/net/wireless/rtlwifi/usb.c
drivers/net/xen-netfront.c
drivers/pinctrl/mvebu/pinctrl-dove.c
drivers/power/reset/gpio-poweroff.c
drivers/ssb/Kconfig
drivers/staging/omapdrm/omap_gem_dmabuf.c
drivers/video/mxsfb.c
fs/splice.c
include/drm/exynos_drm.h
include/linux/cred.h
include/net/netns/conntrack.h
include/net/netns/x_tables.h
include/uapi/drm/exynos_drm.h
mm/memory.c
net/bridge/br_multicast.c
net/bridge/br_netlink.c
net/bridge/br_private.h
net/ipv4/devinet.c
net/ipv4/ipconfig.c
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/iptable_nat.c
net/ipv6/netfilter/ip6t_NPT.c
net/ipv6/netfilter/ip6t_REJECT.c
net/ipv6/netfilter/ip6table_nat.c
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/mac802154/wpan.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nfnetlink_log.c
net/netfilter/xt_CT.c
net/netfilter/xt_hashlimit.c
net/netfilter/xt_recent.c
sound/oss/pas2_card.c
sound/pci/au88x0/au88x0_synth.c
sound/pci/hda/hda_codec.c
sound/pci/hda/patch_realtek.c
sound/usb/midi.c
sound/usb/quirks-table.h
sound/usb/quirks.c
sound/usb/usbaudio.h

index baadbb11fe98c226a269bd374edf43ae6f9de828..5083c0b834b25094fe7d5159cc51238cc37ef921 100644 (file)
@@ -60,11 +60,6 @@ clks: clkctrl@80040000 {
        compatible = "fsl,imx23-clkctrl";
        reg = <0x80040000 0x2000>;
        #clock-cells = <1>;
-       clock-output-names =
-               ...
-               "uart",         /* 32 */
-               ...
-               "end_of_list";
 };
 
 auart0: serial@8006c000 {
index c2a3525ecb4e59e0b781b95e42d173a1a1e29c2d..db4f2f05c4d0f15b32f354a7629e7a0c5a0556b4 100644 (file)
@@ -146,10 +146,6 @@ clks: ccm@53f80000 {
        compatible = "fsl,imx25-ccm";
        reg = <0x53f80000 0x4000>;
        interrupts = <31>;
-       clock-output-names = ...
-                       "uart_ipg",
-                       "uart_serial",
-                       ...;
 };
 
 uart1: serial@43f90000 {
index 52a49a4a50b33e0add4586516b880685da728cb3..e6587af62ff0fe6e740ee8bdeb3f4b32d851c5de 100644 (file)
@@ -83,11 +83,6 @@ clks: clkctrl@80040000 {
        compatible = "fsl,imx28-clkctrl";
        reg = <0x80040000 0x2000>;
        #clock-cells = <1>;
-       clock-output-names =
-               ...
-               "uart",         /* 45 */
-               ...
-               "end_of_list";
 };
 
 auart0: serial@8006a000 {
index d77b4e68dc42b306f22a472c5216623be0ed9a3d..f73fdf595568e30d9e79f0c0ee60d2799b8a5c0d 100644 (file)
@@ -211,10 +211,6 @@ clks: ccm@020c4000 {
        reg = <0x020c4000 0x4000>;
        interrupts = <0 87 0x04 0 88 0x04>;
        #clock-cells = <1>;
-       clock-output-names = ...
-                            "uart_ipg",
-                            "uart_serial",
-                            ...;
 };
 
 uart1: serial@02020000 {
index 558cdf3c9abc8e10539c894a4387fc72c1b32ff3..d4eab9227ea4451bb0eefbd511c22288d5fe336b 100644 (file)
@@ -1,4 +1,19 @@
-GPIO line that should be set high/low to power off a device
+Driver a GPIO line that can be used to turn the power off.
+
+The driver supports both level triggered and edge triggered power off.
+At driver load time, the driver will request the given gpio line and
+install a pm_power_off handler. If the optional properties 'input' is
+not found, the GPIO line will be driven in the inactive
+state. Otherwise its configured as an input.
+
+When the pm_power_off is called, the gpio is configured as an output,
+and drive active, so triggering a level triggered power off
+condition. This will also cause an inactive->active edge condition, so
+triggering positive edge triggered power off. After a delay of 100ms,
+the GPIO is set to inactive, thus causing an active->inactive edge,
+triggering negative edge triggered power off. After another 100ms
+delay the GPIO is driver active again. If the power is still on and
+the CPU still running after a 3000ms delay, a WARN_ON(1) is emitted.
 
 Required properties:
 - compatible : should be "gpio-poweroff".
@@ -13,10 +28,9 @@ Optional properties:
   property is not specified, the GPIO is initialized as an output in its
   inactive state.
 
-
 Examples:
 
 gpio-poweroff {
        compatible = "gpio-poweroff";
-       gpios = <&gpio 4 0>; /* GPIO 4 Active Low */
+       gpios = <&gpio 4 0>;
 };
index dd52d516cb8902da098bbb21a5006cea81b66a74..dbca6618208935505c00d193abccbe8e63962eee 100644 (file)
@@ -36,7 +36,7 @@ neigh/default/unres_qlen_bytes - INTEGER
        The maximum number of bytes which may be used by packets
        queued for each unresolved address by other network layers.
        (added in linux 3.3)
-       Seting negative value is meaningless and will retrun error.
+       Setting negative value is meaningless and will return error.
        Default: 65536 Bytes(64KB)
 
 neigh/default/unres_qlen - INTEGER
@@ -215,7 +215,7 @@ tcp_ecn - INTEGER
        Possible values are:
                0 Disable ECN.  Neither initiate nor accept ECN.
                1 Always request ECN on outgoing connection attempts.
-               2 Enable ECN when requested by incomming connections
+               2 Enable ECN when requested by incoming connections
                  but do not request ECN on outgoing connections.
        Default: 2
 
@@ -503,7 +503,7 @@ tcp_fastopen - INTEGER
 tcp_syn_retries - INTEGER
        Number of times initial SYNs for an active TCP connection attempt
        will be retransmitted. Should not be higher than 255. Default value
-       is 6, which corresponds to 63seconds till the last restransmission
+       is 6, which corresponds to 63seconds till the last retransmission
        with the current initial RTO of 1second. With this the final timeout
        for an active TCP connection attempt will happen after 127seconds.
 
@@ -1331,6 +1331,12 @@ force_tllao - BOOLEAN
        race condition where the sender deletes the cached link-layer address
        prior to receiving a response to a previous solicitation."
 
+ndisc_notify - BOOLEAN
+       Define mode for notification of address and device changes.
+       0 - (default): do nothing
+       1 - Generate unsolicited neighbour advertisements when device is brought
+           up or hardware address changes.
+
 icmp/*:
 ratelimit - INTEGER
        Limit the maximal rates for sending ICMPv6 packets.
@@ -1530,7 +1536,7 @@ cookie_hmac_alg - STRING
        * sha1
        * none
        Ability to assign md5 or sha1 as the selected alg is predicated on the
-       configuarion of those algorithms at build time (CONFIG_CRYPTO_MD5 and
+       configuration of those algorithms at build time (CONFIG_CRYPTO_MD5 and
        CONFIG_CRYPTO_SHA1).
 
        Default: Dependent on configuration.  MD5 if available, else SHA1 if
@@ -1548,7 +1554,7 @@ rcvbuf_policy - INTEGER
        blocking.
 
        1: rcvbuf space is per association
-       0: recbuf space is per socket
+       0: rcvbuf space is per socket
 
        Default: 0
 
index 80c5694b29fdd37ebd71c95932ea6bc74d3927c6..a1667c4bcce580a25e141672daf44b550f4ee5e9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 3
 PATCHLEVEL = 8
 SUBLEVEL = 0
-EXTRAVERSION = -rc2
+EXTRAVERSION = -rc3
 NAME = Terrified Chipmunk
 
 # *DOCUMENTATION*
index f95ba14ae3d067c7ddfbd139e4207c0ee24bd82c..67874b82a4edf318ae3718ae6137393140405586 100644 (file)
@@ -371,7 +371,6 @@ config ARCH_CNS3XXX
 config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
        select ARCH_REQUIRE_GPIOLIB
-       select ARCH_USES_GETTIMEOFFSET
        select AUTO_ZRELADDR
        select CLKDEV_LOOKUP
        select COMMON_CLK
@@ -1230,6 +1229,7 @@ config ARM_ERRATA_430973
 config ARM_ERRATA_458693
        bool "ARM errata: Processor deadlock when a false hazard is created"
        depends on CPU_V7
+       depends on !ARCH_MULTIPLATFORM
        help
          This option enables the workaround for the 458693 Cortex-A8 (r2p0)
          erratum. For very specific sequences of memory operations, it is
@@ -1243,6 +1243,7 @@ config ARM_ERRATA_458693
 config ARM_ERRATA_460075
        bool "ARM errata: Data written to the L2 cache can be overwritten with stale data"
        depends on CPU_V7
+       depends on !ARCH_MULTIPLATFORM
        help
          This option enables the workaround for the 460075 Cortex-A8 (r2p0)
          erratum. Any asynchronous access to the L2 cache may encounter a
@@ -1255,6 +1256,7 @@ config ARM_ERRATA_460075
 config ARM_ERRATA_742230
        bool "ARM errata: DMB operation may be faulty"
        depends on CPU_V7 && SMP
+       depends on !ARCH_MULTIPLATFORM
        help
          This option enables the workaround for the 742230 Cortex-A9
          (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction
@@ -1267,6 +1269,7 @@ config ARM_ERRATA_742230
 config ARM_ERRATA_742231
        bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"
        depends on CPU_V7 && SMP
+       depends on !ARCH_MULTIPLATFORM
        help
          This option enables the workaround for the 742231 Cortex-A9
          (r2p0..r2p2) erratum. Under certain conditions, specific to the
@@ -1317,6 +1320,7 @@ config PL310_ERRATA_727915
 config ARM_ERRATA_743622
        bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption"
        depends on CPU_V7
+       depends on !ARCH_MULTIPLATFORM
        help
          This option enables the workaround for the 743622 Cortex-A9
          (r2p*) erratum. Under very rare conditions, a faulty
@@ -1330,6 +1334,7 @@ config ARM_ERRATA_743622
 config ARM_ERRATA_751472
        bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"
        depends on CPU_V7
+       depends on !ARCH_MULTIPLATFORM
        help
          This option enables the workaround for the 751472 Cortex-A9 (prior
          to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the
index cf6c48a09eacf36e84b4caf4b83be0c35d0b22e8..4c0abe85405fe533ba0cedd41c95d4b9de4b4dc7 100644 (file)
                ranges;
 
                serial@d0012000 {
-                               compatible = "ns16550";
+                               compatible = "snps,dw-apb-uart";
                                reg = <0xd0012000 0x100>;
                                reg-shift = <2>;
                                interrupts = <41>;
+                               reg-io-width = <4>;
                                status = "disabled";
                };
                serial@d0012100 {
-                               compatible = "ns16550";
+                               compatible = "snps,dw-apb-uart";
                                reg = <0xd0012100 0x100>;
                                reg-shift = <2>;
                                interrupts = <42>;
+                               reg-io-width = <4>;
                                status = "disabled";
                };
 
index c45c7b4dc35230c52957fb1d32054a261e66e2ad..271855a6e224758800f1146f02dd992786dab801 100644 (file)
                reg = <0>;
                clocks = <&cpuclk 0>;
            };
-       }
+
+           cpu@1 {
+               device_type = "cpu";
+               compatible = "marvell,sheeva-v7";
+               reg = <1>;
+               clocks = <&cpuclk 1>;
+           };
+       };
 
        soc {
                pinctrl {
index a2aee5707377c3886a51217d40c102ed5e68c1e1..1c1937dbce73c1d320f9689fd62fe9a05c851fd2 100644 (file)
                        #interrupts-cells = <2>;
                        interrupts = <24>;
                };
+
+               ethernet@d0034000 {
+                               compatible = "marvell,armada-370-neta";
+                               reg = <0xd0034000 0x2500>;
+                               interrupts = <14>;
+                               clocks = <&gateclk 1>;
+                               status = "disabled";
+               };
        };
 };
index da03a129243a548853e5afa611b84f1b5fd73ebe..4905cf3a5ef85edc82dee68e0fafe978bd919f5c 100644 (file)
                        #interrupts-cells = <2>;
                        interrupts = <24>;
                };
+
+               ethernet@d0034000 {
+                               compatible = "marvell,armada-370-neta";
+                               reg = <0xd0034000 0x2500>;
+                               interrupts = <14>;
+                               clocks = <&gateclk 1>;
+                               status = "disabled";
+               };
        };
  };
index 367aa3f94912ac9d78a35d22321c64667af406cf..2e37ef101c9035d65efefa83854ba79c742a8d94 100644 (file)
 
        soc {
                serial@d0012200 {
-                               compatible = "ns16550";
+                               compatible = "snps,dw-apb-uart";
                                reg = <0xd0012200 0x100>;
                                reg-shift = <2>;
                                interrupts = <43>;
+                               reg-io-width = <4>;
                                status = "disabled";
                };
                serial@d0012300 {
-                               compatible = "ns16550";
+                               compatible = "snps,dw-apb-uart";
                                reg = <0xd0012300 0x100>;
                                reg-shift = <2>;
                                interrupts = <44>;
+                               reg-io-width = <4>;
                                status = "disabled";
                };
 
                                status = "disabled";
                };
 
-               ethernet@d0034000 {
-                               compatible = "marvell,armada-370-neta";
-                               reg = <0xd0034000 0x2500>;
-                               interrupts = <14>;
-                               clocks = <&gateclk 1>;
-                               status = "disabled";
-               };
-
                xor@d0060900 {
                        compatible = "marvell,orion-xor";
                        reg = <0xd0060900 0x100
index f3f7e9d8adca4862c92cd22d00eb6d15267a8a8c..42eac1ff3cc82a02c5f52fddba478e76d83548d8 100644 (file)
                pinctrl: pinctrl@d0200 {
                        compatible = "marvell,dove-pinctrl";
                        reg = <0xd0200 0x10>;
+                       clocks = <&gate_clk 22>;
                };
 
                spi0: spi@10600 {
index 46477ac1de99fd4e148c6b8593c1c6f2502eff98..139b40cc3a23e63087fc6154ca6e7f79ed828fae 100644 (file)
@@ -32,6 +32,7 @@
 
                cpu@0 {
                        compatible = "arm,cortex-a15";
+                       device_type = "cpu";
                        reg = <0>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
@@ -39,6 +40,7 @@
 
                cpu@1 {
                        compatible = "arm,cortex-a15";
+                       device_type = "cpu";
                        reg = <1>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
@@ -46,6 +48,7 @@
 
                cpu@2 {
                        compatible = "arm,cortex-a15";
+                       device_type = "cpu";
                        reg = <2>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
@@ -53,6 +56,7 @@
 
                cpu@3 {
                        compatible = "arm,cortex-a15";
+                       device_type = "cpu";
                        reg = <3>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
index 9b23a8255e39a148eecdd18e04391f4a2f6529f0..f63490707f3a56646c8cc09edd471009d6644b14 100644 (file)
@@ -26,7 +26,7 @@
        };
 
        chosen {
-               bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
+               bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
        };
 
        sdhci@12530000 {
index 2e3b6efaf1a2632062fd93a8ca7d0eec792a9c0c..3acf594ea60bda97bc5e53187011455bf86b0c5b 100644 (file)
 
        hdmi {
                compatible = "samsung,exynos5-hdmi";
-               reg = <0x14530000 0x100000>;
+               reg = <0x14530000 0x70000>;
                interrupts = <0 95 0>;
        };
 
index 921c83cf694f57fe7138fb8a703e022133f5f480..81e2c964a900f8a74d5efbac4aca73491bcc719a 100644 (file)
@@ -21,7 +21,7 @@
        };
 
        chosen {
-               bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x81000000,8M console=ttySAC2,115200 init=/linuxrc";
+               bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x81000000,8M console=ttySAC0,115200 init=/linuxrc";
        };
 
        spi {
index a9ae5d32e80dfa057f01bb49dacb728035480e19..5927a8df562536550b101669f45978f33907e0ac 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
-               cpu@0 {
+               cpu@900 {
                        compatible = "arm,cortex-a9";
-                       reg = <0>;
+                       device_type = "cpu";
+                       reg = <0x900>;
                        next-level-cache = <&L2>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
                };
 
-               cpu@1 {
+               cpu@901 {
                        compatible = "arm,cortex-a9";
-                       reg = <1>;
+                       device_type = "cpu";
+                       reg = <0x901>;
                        next-level-cache = <&L2>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
                };
 
-               cpu@2 {
+               cpu@902 {
                        compatible = "arm,cortex-a9";
-                       reg = <2>;
+                       device_type = "cpu";
+                       reg = <0x902>;
                        next-level-cache = <&L2>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
                };
 
-               cpu@3 {
+               cpu@903 {
                        compatible = "arm,cortex-a9";
-                       reg = <3>;
+                       device_type = "cpu";
+                       reg = <0x903>;
                        next-level-cache = <&L2>;
                        clocks = <&a9pll>;
                        clock-names = "cpu";
index 7c43b8e70b9fcb1c29da27a059f658440ddec246..e7484e4ea659ca261149476a6e7fc6c07dd85690 100644 (file)
                                hog_pins_a: hog@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
-                                               0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
+                                               0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
                                        fsl,pull-up = <0>;
                                };
 
-                               led_pin_gpio0_17: led_gpio0_17@0 {
+                               led_pin_gpio2_1: led_gpio2_1@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
-                                               0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */
+                                               0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
-               pinctrl-0 = <&led_pin_gpio0_17>;
+               pinctrl-0 = <&led_pin_gpio2_1>;
 
                user {
                        label = "green";
index 24731cb78e8ecd72616d272aaeff0e224807e0cc..7f67402328d377aa213a579860ff934db4e2483f 100644 (file)
@@ -14,7 +14,7 @@
 
 / {
        model = "Buglabs i.MX31 Bug 1.x";
-       compatible = "fsl,imx31-bug", "fsl,imx31";
+       compatible = "buglabs,imx31-bug", "fsl,imx31";
 
        memory {
                reg = <0x80000000 0x8000000>; /* 128M */
index 552aed4ff9823e63bdfdca1df059cff82b7f2baa..edc3f1eb6699238b776a1affc9f647103dfdc4ca 100644 (file)
                                compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";
                                reg = <0x53fcc000 0x4000>;
                                interrupts = <83>;
-                               clocks = <&clks 158>, <&clks 157>;
+                               clocks = <&clks 87>, <&clks 86>;
                                clock-names = "ipg", "per";
                                status = "disabled";
                        };
index 9ae2004d567531422ad64c4321e97849da0714e6..4ccea2130a6cd2b42029522ac2c8c527fba2728f 100644 (file)
@@ -39,6 +39,7 @@
                        #size-cells = <0>;
                        interrupts = <32>;
                        clock-frequency = <100000>;
+                       clocks = <&gate_clk 7>;
                        status = "disabled";
                };
        };
index c0de5a7f660d976269087e7f8e888b141adf8468..cd15452a52a62024f9518a5abdb677ab8292fd9c 100644 (file)
                        gpios = <&gpio1 16 1>;
                };
        };
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               sata0_power: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "SATA0 Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 4 0>;
+               };
+       };
 };
index 7735cee4a9c6fb8a34ffb001eed617137a0fef6c..110d6cbb795b384aa330c422d6409057839bb3ee 100644 (file)
                        compatible = "marvell,orion-ehci";
                        reg = <0x50000 0x1000>;
                        interrupts = <19>;
+                       clocks = <&gate_clk 3>;
                        status = "okay";
                };
 
index e4df17ca90c7114efaca806977d153a87b7ad5ba..8f324b99416e46548ce2bdb9a02edac2340835bd 100644 (file)
@@ -206,6 +206,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
                                struct device_node *node)
 {
        struct vic_device *v;
+       int i;
 
        if (vic_id >= ARRAY_SIZE(vic_devices)) {
                printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
@@ -220,6 +221,10 @@ static void __init vic_register(void __iomem *base, unsigned int irq,
        vic_id++;
        v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
                                          &vic_irqdomain_ops, v);
+       /* create an IRQ mapping for each valid IRQ */
+       for (i = 0; i < fls(valid_sources); i++)
+               if (valid_sources & (1 << i))
+                       irq_create_mapping(v->domain, i);
 }
 
 static void vic_ack_irq(struct irq_data *d)
@@ -416,9 +421,9 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
                return -EIO;
 
        /*
-        * Passing -1 as first IRQ makes the simple domain allocate descriptors
+        * Passing 0 as first IRQ makes the simple domain allocate descriptors
         */
-       __vic_init(regs, -1, ~0, ~0, node);
+       __vic_init(regs, 0, ~0, ~0, node);
 
        return 0;
 }
index a702fb345c01e5693d82f22d0eeb5fc2d7c88b2a..b5bc96cb65a79d87c2f65814e9cc4fecd69e4df1 100644 (file)
@@ -33,9 +33,7 @@ CONFIG_MVNETA=y
 CONFIG_MARVELL_PHY=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_I2C=y
-CONFIG_I2C_MV64XXX=y
+CONFIG_SERIAL_8250_DW=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_USB_SUPPORT is not set
index 91d5b6f1d5afa80c6c0fbb5d35a88af1a2750838..e103c290bc9e37ca5871d8e8182493e9fa0447c5 100644 (file)
@@ -74,6 +74,8 @@ config SOC_EXYNOS5440
        depends on ARCH_EXYNOS5
        select ARM_ARCH_TIMER
        select AUTO_ZRELADDR
+       select PINCTRL
+       select PINCTRL_EXYNOS5440
        help
          Enable EXYNOS5440 SoC support
 
index d6d0dc651089a4a253d473783c156d453eda55be..1a89824a5f781bfef84f7afc9167c41874198798 100644 (file)
@@ -424,11 +424,18 @@ static void __init exynos5_init_clocks(int xtal)
 {
        printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
 
+       /* EXYNOS5440 can support only common clock framework */
+
+       if (soc_is_exynos5440())
+               return;
+
+#ifdef CONFIG_SOC_EXYNOS5250
        s3c24xx_register_baseclocks(xtal);
        s5p_register_clocks(xtal);
 
        exynos5_register_clocks();
        exynos5_setup_clocks();
+#endif
 }
 
 #define COMBINER_ENABLE_SET    0x0
index dc248167d206c7072864cda37c01df675fcef50f..981dc1e1da518b1ddf5f6340085837ad07d7e444 100644 (file)
@@ -135,7 +135,7 @@ static struct sys_timer highbank_timer = {
 
 static void highbank_power_off(void)
 {
-       hignbank_set_pwr_shutdown();
+       highbank_set_pwr_shutdown();
 
        while (1)
                cpu_do_idle();
index 7b60faccd5518da90c6bc404e32636cb3631be49..f30c528433967e43b1f1afa1050c13feefbbe914 100644 (file)
@@ -30,7 +30,7 @@ void __ref highbank_cpu_die(unsigned int cpu)
 {
        flush_cache_all();
 
-       highbank_set_cpu_jump(cpu, secondary_startup);
+       highbank_set_cpu_jump(cpu, phys_to_virt(0));
        highbank_set_core_pwr();
 
        cpu_do_idle();
index 1129957f6c1df90cdc10a90a4b6b0f4c6e5a2c37..4ecc864ac8b95dbe63283c4c0637c9436558d8a7 100644 (file)
@@ -32,6 +32,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)
 
 static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+       highbank_set_cpu_jump(cpu, secondary_startup);
        gic_raise_softirq(cpumask_of(cpu), 0);
        return 0;
 }
@@ -61,19 +62,8 @@ static void __init highbank_smp_init_cpus(void)
 
 static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
 {
-       int i;
-
        if (scu_base_addr)
                scu_enable(scu_base_addr);
-
-       /*
-        * Write the address of secondary startup into the jump table
-        * The cores are in wfi and wait until they receive a soft interrupt
-        * and a non-zero value to jump to. Then the secondary CPU branches
-        * to this address.
-        */
-       for (i = 1; i < max_cpus; i++)
-               highbank_set_cpu_jump(i, secondary_startup);
 }
 
 struct smp_operations highbank_smp_ops __initdata = {
index 74aa135966f00c87716ca537df45e65c825d3273..04eddb4f438095da0fff7caee5f4561b7fe2c1f3 100644 (file)
  * this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/cpu_pm.h>
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/suspend.h>
 
+#include <asm/cacheflush.h>
 #include <asm/proc-fns.h>
 #include <asm/suspend.h>
 
 
 static int highbank_suspend_finish(unsigned long val)
 {
+       outer_flush_all();
+       outer_disable();
+
+       highbank_set_pwr_suspend();
+
        cpu_do_idle();
+
+       highbank_clear_pwr_request();
        return 0;
 }
 
 static int highbank_pm_enter(suspend_state_t state)
 {
-       hignbank_set_pwr_suspend();
+       cpu_pm_enter();
+       cpu_cluster_pm_enter();
+
        highbank_set_cpu_jump(0, cpu_resume);
        cpu_suspend(0, highbank_suspend_finish);
 
+       cpu_cluster_pm_exit();
+       cpu_pm_exit();
+
+       highbank_smc1(0x102, 0x1);
+       if (scu_base_addr)
+               scu_enable(scu_base_addr);
        return 0;
 }
 
index e13e8ea7c6cb30fdf5863c668765d39904984754..70af9d13fcefefb1fad252c1a8c8a2bffa71ef3b 100644 (file)
@@ -44,28 +44,43 @@ static inline void highbank_set_core_pwr(void)
                writel_relaxed(1, sregs_base + SREG_CPU_PWR_CTRL(cpu));
 }
 
-static inline void hignbank_set_pwr_suspend(void)
+static inline void highbank_clear_core_pwr(void)
+{
+       int cpu = cpu_logical_map(smp_processor_id());
+       if (scu_base_addr)
+               scu_power_mode(scu_base_addr, SCU_PM_NORMAL);
+       else
+               writel_relaxed(0, sregs_base + SREG_CPU_PWR_CTRL(cpu));
+}
+
+static inline void highbank_set_pwr_suspend(void)
 {
        writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
        highbank_set_core_pwr();
 }
 
-static inline void hignbank_set_pwr_shutdown(void)
+static inline void highbank_set_pwr_shutdown(void)
 {
        writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
        highbank_set_core_pwr();
 }
 
-static inline void hignbank_set_pwr_soft_reset(void)
+static inline void highbank_set_pwr_soft_reset(void)
 {
        writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
        highbank_set_core_pwr();
 }
 
-static inline void hignbank_set_pwr_hard_reset(void)
+static inline void highbank_set_pwr_hard_reset(void)
 {
        writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
        highbank_set_core_pwr();
 }
 
+static inline void highbank_clear_pwr_request(void)
+{
+       writel(~0UL, sregs_base + HB_SREG_A9_PWR_REQ);
+       highbank_clear_core_pwr();
+}
+
 #endif
index aed96ad9bd4a7ddf8a7f2f544ca03e6d3f14a5bb..37d8384dcf1923bbae0d21a812784bc8037df8b8 100644 (file)
@@ -22,9 +22,9 @@
 void highbank_restart(char mode, const char *cmd)
 {
        if (mode == 'h')
-               hignbank_set_pwr_hard_reset();
+               highbank_set_pwr_hard_reset();
        else
-               hignbank_set_pwr_soft_reset();
+               highbank_set_pwr_soft_reset();
 
        while (1)
                cpu_do_idle();
index 1ad0d76de8c7b57029faccb9c88dda430a93bab7..3e628fd7a674d3b5f6b4782b32ef03f7548c43a2 100644 (file)
@@ -841,8 +841,6 @@ config SOC_IMX6Q
        select ARCH_HAS_CPUFREQ
        select ARCH_HAS_OPP
        select ARM_CPU_SUSPEND if PM
-       select ARM_ERRATA_743622
-       select ARM_ERRATA_751472
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
        select ARM_ERRATA_775420
index ff4150a2ad05259383d147626fbae49648e1a256..de4fd2bb1e27960a36d4301792a072bee90409f3 100644 (file)
@@ -67,6 +67,10 @@ static void __init kirkwood_legacy_clk_init(void)
        orion_clkdev_add(NULL, "mv643xx_eth_port.1",
                         of_clk_get_from_provider(&clkspec));
 
+       clkspec.args[0] = CGC_BIT_SDIO;
+       orion_clkdev_add(NULL, "mvsdio",
+                        of_clk_get_from_provider(&clkspec));
+
 }
 
 static void __init kirkwood_of_clk_init(void)
index 15e69fcde9f4d262f80d749938ce8c477130e0d9..23d2dd1b1b1ed4079d61d20fd60ec898d9901de9 100644 (file)
@@ -64,8 +64,6 @@ static unsigned int topkick_mpp_config[] __initdata = {
        0
 };
 
-#define TOPKICK_SATA0_PWR_ENABLE 36
-
 void __init usi_topkick_init(void)
 {
        /*
@@ -73,8 +71,6 @@ void __init usi_topkick_init(void)
         */
        kirkwood_mpp_conf(topkick_mpp_config);
 
-       /* SATA0 power enable */
-       gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
 
        kirkwood_ge00_init(&topkick_ge00_data);
        kirkwood_sdio_init(&topkick_mvsdio_data);
index 98167a4319f72d3735adf6ab4e277d68da8790b8..9f19069248da2341e643f1c6161fc8576c5803c3 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/pinctrl-nomadik.h>
 #include <linux/platform_data/clocksource-nomadik-mtu.h>
-#include <linux/platform_data/mtd-nomadik-nand.h>
 #include <asm/hardware/vic.h>
 #include <asm/sizes.h>
 #include <asm/mach-types.h>
index b549d0571548ed8d3682e6946e2bce6f0e2fb4ed..215f8cdb400430b7e21f98c6271cdea71313f3f5 100644 (file)
 
 #include <mach/hardware.h>
 
-#define IRQ_VIC_START                /* first VIC interrupt is 1 */
+#define IRQ_VIC_START          32      /* first VIC interrupt is 1 */
 
 /*
  * Interrupt numbers generic for all Nomadik Chip cuts
  */
-#define IRQ_WATCHDOG                   1
-#define IRQ_SOFTINT                    2
-#define IRQ_CRYPTO                     3
-#define IRQ_OWM                                4
-#define IRQ_MTU0                       5
-#define IRQ_MTU1                       6
-#define IRQ_GPIO0                      7
-#define IRQ_GPIO1                      8
-#define IRQ_GPIO2                      9
-#define IRQ_GPIO3                      10
-#define IRQ_RTC_RTT                    11
-#define IRQ_SSP                                12
-#define IRQ_UART0                      13
-#define IRQ_DMA1                       14
-#define IRQ_CLCD_MDIF                  15
-#define IRQ_DMA0                       16
-#define IRQ_PWRFAIL                    17
-#define IRQ_UART1                      18
-#define IRQ_FIRDA                      19
-#define IRQ_MSP0                       20
-#define IRQ_I2C0                       21
-#define IRQ_I2C1                       22
-#define IRQ_SDMMC                      23
-#define IRQ_USBOTG                     24
-#define IRQ_SVA_IT0                    25
-#define IRQ_SVA_IT1                    26
-#define IRQ_SAA_IT0                    27
-#define IRQ_SAA_IT1                    28
-#define IRQ_UART2                      29
-#define IRQ_MSP2                       30
-#define IRQ_L2CC                       49
-#define IRQ_HPI                                50
-#define IRQ_SKE                                51
-#define IRQ_KP                         52
-#define IRQ_MEMST                      55
-#define IRQ_SGA_IT                     59
-#define IRQ_USBM                       61
-#define IRQ_MSP1                       63
+#define IRQ_WATCHDOG                   (IRQ_VIC_START+0)
+#define IRQ_SOFTINT                    (IRQ_VIC_START+1)
+#define IRQ_CRYPTO                     (IRQ_VIC_START+2)
+#define IRQ_OWM                                (IRQ_VIC_START+3)
+#define IRQ_MTU0                       (IRQ_VIC_START+4)
+#define IRQ_MTU1                       (IRQ_VIC_START+5)
+#define IRQ_GPIO0                      (IRQ_VIC_START+6)
+#define IRQ_GPIO1                      (IRQ_VIC_START+7)
+#define IRQ_GPIO2                      (IRQ_VIC_START+8)
+#define IRQ_GPIO3                      (IRQ_VIC_START+9)
+#define IRQ_RTC_RTT                    (IRQ_VIC_START+10)
+#define IRQ_SSP                                (IRQ_VIC_START+11)
+#define IRQ_UART0                      (IRQ_VIC_START+12)
+#define IRQ_DMA1                       (IRQ_VIC_START+13)
+#define IRQ_CLCD_MDIF                  (IRQ_VIC_START+14)
+#define IRQ_DMA0                       (IRQ_VIC_START+15)
+#define IRQ_PWRFAIL                    (IRQ_VIC_START+16)
+#define IRQ_UART1                      (IRQ_VIC_START+17)
+#define IRQ_FIRDA                      (IRQ_VIC_START+18)
+#define IRQ_MSP0                       (IRQ_VIC_START+19)
+#define IRQ_I2C0                       (IRQ_VIC_START+20)
+#define IRQ_I2C1                       (IRQ_VIC_START+21)
+#define IRQ_SDMMC                      (IRQ_VIC_START+22)
+#define IRQ_USBOTG                     (IRQ_VIC_START+23)
+#define IRQ_SVA_IT0                    (IRQ_VIC_START+24)
+#define IRQ_SVA_IT1                    (IRQ_VIC_START+25)
+#define IRQ_SAA_IT0                    (IRQ_VIC_START+26)
+#define IRQ_SAA_IT1                    (IRQ_VIC_START+27)
+#define IRQ_UART2                      (IRQ_VIC_START+28)
+#define IRQ_MSP2                       (IRQ_VIC_START+29)
+#define IRQ_L2CC                       (IRQ_VIC_START+30)
+#define IRQ_HPI                                (IRQ_VIC_START+31)
+#define IRQ_SKE                                (IRQ_VIC_START+32)
+#define IRQ_KP                         (IRQ_VIC_START+33)
+#define IRQ_MEMST                      (IRQ_VIC_START+34)
+#define IRQ_SGA_IT                     (IRQ_VIC_START+35)
+#define IRQ_USBM                       (IRQ_VIC_START+36)
+#define IRQ_MSP1                       (IRQ_VIC_START+37)
 
 #define NOMADIK_GPIO_OFFSET            (IRQ_VIC_START+64)
 
index a8fce3ccc707fcea16c27f9edd8a47ef8961d2a0..2e98a3ac7c5e1f5fdc56046507bda4b61aa1b3ae 100644 (file)
@@ -160,7 +160,7 @@ static struct omap_lcd_config ams_delta_lcd_config __initdata = {
        .ctrl_name      = "internal",
 };
 
-static struct omap_usb_config ams_delta_usb_config = {
+static struct omap_usb_config ams_delta_usb_config __initdata = {
        .register_host  = 1,
        .hmc_mode       = 16,
        .pins[0]        = 2,
index 104fed366b8f4877f79d05b325f7e3b835f1b5c6..1a1db5971cd9e6e412b7c8151040f6c907c2868f 100644 (file)
@@ -629,8 +629,14 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)
 static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
 #endif
 
-void __init omap1_usb_init(struct omap_usb_config *pdata)
+void __init omap1_usb_init(struct omap_usb_config *_pdata)
 {
+       struct omap_usb_config *pdata;
+
+       pdata = kmemdup(_pdata, sizeof(*pdata), GFP_KERNEL);
+       if (!pdata)
+               return;
+
        pdata->usb0_init = omap1_usb0_init;
        pdata->usb1_init = omap1_usb1_init;
        pdata->usb2_init = omap1_usb2_init;
index bdf39481fbd6022d96af89e54a44e5bf402fb62f..6ef87580c33f6772a1fed5445b1bb2344fb96a6d 100644 (file)
@@ -1167,6 +1167,8 @@ static const struct clk_ops emu_src_ck_ops = {
        .recalc_rate    = &omap2_clksel_recalc,
        .get_parent     = &omap2_clksel_find_parent_index,
        .set_parent     = &omap2_clksel_set_parent,
+       .enable         = &omap2_clkops_enable_clkdm,
+       .disable        = &omap2_clkops_disable_clkdm,
 };
 
 static struct clk emu_src_ck;
index 081c71edddf4562797c632fc8f19bb86a8bac07d..646c14d9fdb9dfbe656437b45c6757c8db4d1b15 100644 (file)
@@ -2070,7 +2070,7 @@ static struct omap_hwmod_irq_info am33xx_usbss_mpu_irqs[] = {
        { .name = "usbss-irq", .irq = 17 + OMAP_INTC_START, },
        { .name = "musb0-irq", .irq = 18 + OMAP_INTC_START, },
        { .name = "musb1-irq", .irq = 19 + OMAP_INTC_START, },
-       { .irq = -1 + OMAP_INTC_START, },
+       { .irq = -1, },
 };
 
 static struct omap_hwmod am33xx_usbss_hwmod = {
@@ -2515,7 +2515,7 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = {
        .user           = OCP_USER_MPU,
 };
 
-struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
+static struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
        {
                .pa_start       = 0x4A101000,
                .pa_end         = 0x4A101000 + SZ_256 - 1,
@@ -2523,7 +2523,7 @@ struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
        { }
 };
 
-struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
+static struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
        .master         = &am33xx_cpgmac0_hwmod,
        .slave          = &am33xx_mdio_hwmod,
        .addr           = am33xx_mdio_addr_space,
index cc0e71430af1d05f30c0a25298a2a929cac66e62..418de9c3b3195e0ccc283fc90a70a486beafa3b3 100644 (file)
 #include "cm2xxx_3xxx.h"
 #include "prm-regbits-24xx.h"
 
+/*
+ * OMAP24xx PM_PWSTCTRL_*.POWERSTATE and PM_PWSTST_*.LASTSTATEENTERED bits -
+ * these are reversed from the bits used on OMAP3+
+ */
+#define OMAP24XX_PWRDM_POWER_ON                        0x0
+#define OMAP24XX_PWRDM_POWER_RET               0x1
+#define OMAP24XX_PWRDM_POWER_OFF               0x3
+
 /*
  * omap2xxx_prm_reset_src_map - map from bits in the PRM_RSTST_WKUP
  *   hardware register (which are specific to the OMAP2xxx SoCs) to
@@ -67,6 +75,34 @@ static u32 omap2xxx_prm_read_reset_sources(void)
        return r;
 }
 
+/**
+ * omap2xxx_pwrst_to_common_pwrst - convert OMAP2xxx pwrst to common pwrst
+ * @omap2xxx_pwrst: OMAP2xxx hardware power state to convert
+ *
+ * Return the common power state bits corresponding to the OMAP2xxx
+ * hardware power state bits @omap2xxx_pwrst, or -EINVAL upon error.
+ */
+static int omap2xxx_pwrst_to_common_pwrst(u8 omap2xxx_pwrst)
+{
+       u8 pwrst;
+
+       switch (omap2xxx_pwrst) {
+       case OMAP24XX_PWRDM_POWER_OFF:
+               pwrst = PWRDM_POWER_OFF;
+               break;
+       case OMAP24XX_PWRDM_POWER_RET:
+               pwrst = PWRDM_POWER_RET;
+               break;
+       case OMAP24XX_PWRDM_POWER_ON:
+               pwrst = PWRDM_POWER_ON;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return pwrst;
+}
+
 /**
  * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC
  *
@@ -97,10 +133,56 @@ int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm)
        return 0;
 }
 
+static int omap2xxx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
+{
+       u8 omap24xx_pwrst;
+
+       switch (pwrst) {
+       case PWRDM_POWER_OFF:
+               omap24xx_pwrst = OMAP24XX_PWRDM_POWER_OFF;
+               break;
+       case PWRDM_POWER_RET:
+               omap24xx_pwrst = OMAP24XX_PWRDM_POWER_RET;
+               break;
+       case PWRDM_POWER_ON:
+               omap24xx_pwrst = OMAP24XX_PWRDM_POWER_ON;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
+                                  (omap24xx_pwrst << OMAP_POWERSTATE_SHIFT),
+                                  pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
+       return 0;
+}
+
+static int omap2xxx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
+{
+       u8 omap2xxx_pwrst;
+
+       omap2xxx_pwrst = omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                                      OMAP2_PM_PWSTCTRL,
+                                                      OMAP_POWERSTATE_MASK);
+
+       return omap2xxx_pwrst_to_common_pwrst(omap2xxx_pwrst);
+}
+
+static int omap2xxx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
+{
+       u8 omap2xxx_pwrst;
+
+       omap2xxx_pwrst = omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                                      OMAP2_PM_PWSTST,
+                                                      OMAP_POWERSTATEST_MASK);
+
+       return omap2xxx_pwrst_to_common_pwrst(omap2xxx_pwrst);
+}
+
 struct pwrdm_ops omap2_pwrdm_operations = {
-       .pwrdm_set_next_pwrst   = omap2_pwrdm_set_next_pwrst,
-       .pwrdm_read_next_pwrst  = omap2_pwrdm_read_next_pwrst,
-       .pwrdm_read_pwrst       = omap2_pwrdm_read_pwrst,
+       .pwrdm_set_next_pwrst   = omap2xxx_pwrdm_set_next_pwrst,
+       .pwrdm_read_next_pwrst  = omap2xxx_pwrdm_read_next_pwrst,
+       .pwrdm_read_pwrst       = omap2xxx_pwrdm_read_pwrst,
        .pwrdm_set_logic_retst  = omap2_pwrdm_set_logic_retst,
        .pwrdm_set_mem_onst     = omap2_pwrdm_set_mem_onst,
        .pwrdm_set_mem_retst    = omap2_pwrdm_set_mem_retst,
index 30517f5af70708e360c140ef22374adc7560ec89..a3e121f94a864e63108ba1c54522aeb904395918 100644 (file)
@@ -103,28 +103,6 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
 /* Powerdomain low-level functions */
 
 /* Common functions across OMAP2 and OMAP3 */
-int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
-{
-       omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
-                                  (pwrst << OMAP_POWERSTATE_SHIFT),
-                                  pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
-       return 0;
-}
-
-int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
-{
-       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
-                                            OMAP2_PM_PWSTCTRL,
-                                            OMAP_POWERSTATE_MASK);
-}
-
-int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
-{
-       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
-                                            OMAP2_PM_PWSTST,
-                                            OMAP_POWERSTATEST_MASK);
-}
-
 int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
                                                                u8 pwrst)
 {
index 39822aabcff3215e66eb85358f5a86bc3d7c8d46..e648bd55b0729a6b1023e1cc7b04b8f0c786e0fe 100644 (file)
@@ -277,6 +277,28 @@ static u32 omap3xxx_prm_read_reset_sources(void)
 
 /* Powerdomain low-level functions */
 
+static int omap3_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
+{
+       omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
+                                  (pwrst << OMAP_POWERSTATE_SHIFT),
+                                  pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
+       return 0;
+}
+
+static int omap3_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
+{
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTCTRL,
+                                            OMAP_POWERSTATE_MASK);
+}
+
+static int omap3_pwrdm_read_pwrst(struct powerdomain *pwrdm)
+{
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTST,
+                                            OMAP_POWERSTATEST_MASK);
+}
+
 /* Applicable only for OMAP3. Not supported on OMAP2 */
 static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 {
@@ -355,9 +377,9 @@ static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
 }
 
 struct pwrdm_ops omap3_pwrdm_operations = {
-       .pwrdm_set_next_pwrst   = omap2_pwrdm_set_next_pwrst,
-       .pwrdm_read_next_pwrst  = omap2_pwrdm_read_next_pwrst,
-       .pwrdm_read_pwrst       = omap2_pwrdm_read_pwrst,
+       .pwrdm_set_next_pwrst   = omap3_pwrdm_set_next_pwrst,
+       .pwrdm_read_next_pwrst  = omap3_pwrdm_read_next_pwrst,
+       .pwrdm_read_pwrst       = omap3_pwrdm_read_pwrst,
        .pwrdm_read_prev_pwrst  = omap3_pwrdm_read_prev_pwrst,
        .pwrdm_set_logic_retst  = omap2_pwrdm_set_logic_retst,
        .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
index 7498bc77fe8b8e69e5dbfe106dd24861c3a2c203..c05a343d465dcc1374a7c3a19142ca2e75d77517 100644 (file)
@@ -56,9 +56,9 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
  *   enumeration)
  */
 static struct prm_reset_src_map omap44xx_prm_reset_src_map[] = {
-       { OMAP4430_RST_GLOBAL_WARM_SW_SHIFT,
+       { OMAP4430_GLOBAL_WARM_SW_RST_SHIFT,
          OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT },
-       { OMAP4430_RST_GLOBAL_COLD_SW_SHIFT,
+       { OMAP4430_GLOBAL_COLD_RST_SHIFT,
          OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT },
        { OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT,
          OMAP_SECU_VIOL_RST_SRC_ID_SHIFT },
@@ -333,7 +333,7 @@ static u32 omap44xx_prm_read_reset_sources(void)
        u32 r = 0;
        u32 v;
 
-       v = omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST,
+       v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
                                    OMAP4_RM_RSTST);
 
        p = omap44xx_prm_reset_src_map;
index 22b0979206ca08b7cd929eee361607f802561af2..8ee1fbdec5615c47c9345c88eb689249e8ea90ae 100644 (file)
@@ -62,8 +62,8 @@
 
 /* OMAP4 specific register offsets */
 #define OMAP4_RM_RSTCTRL                               0x0000
-#define OMAP4_RM_RSTTIME                               0x0004
-#define OMAP4_RM_RSTST                                 0x0008
+#define OMAP4_RM_RSTST                                 0x0004
+#define OMAP4_RM_RSTTIME                               0x0008
 #define OMAP4_PM_PWSTCTRL                              0x0000
 #define OMAP4_PM_PWSTST                                        0x0004
 
index bf44c61bd1f682f203d1169528542a93b6482404..0fd771ca617b00ddf71bd676e7e3834ec87b0b6b 100644 (file)
@@ -25,7 +25,7 @@
  *  IRQ interrupts definitions are the same as the INT definitions
  *  held within platform.h
  */
-#define IRQ_VIC_START          0
+#define IRQ_VIC_START          32
 #define IRQ_WDOGINT            (IRQ_VIC_START + INT_WDOGINT)
 #define IRQ_SOFTINT            (IRQ_VIC_START + INT_SOFTINT)
 #define IRQ_COMMRx             (IRQ_VIC_START + INT_COMMRx)
 /*
  * Secondary interrupt controller
  */
-#define IRQ_SIC_START          32
+#define IRQ_SIC_START          64
 #define IRQ_SIC_MMCI0B                 (IRQ_SIC_START + SIC_INT_MMCI0B)
 #define IRQ_SIC_MMCI1B                 (IRQ_SIC_START + SIC_INT_MMCI1B)
 #define IRQ_SIC_KMI0           (IRQ_SIC_START + SIC_INT_KMI0)
 #define IRQ_SIC_PCI1           (IRQ_SIC_START + SIC_INT_PCI1)
 #define IRQ_SIC_PCI2           (IRQ_SIC_START + SIC_INT_PCI2)
 #define IRQ_SIC_PCI3           (IRQ_SIC_START + SIC_INT_PCI3)
-#define IRQ_SIC_END            63
+#define IRQ_SIC_END            95
 
 #define IRQ_GPIO0_START                (IRQ_SIC_END + 1)
 #define IRQ_GPIO0_END          (IRQ_GPIO0_START + 31)
index 99e63f5f99d179eeeafbae428bd82444adbee747..52d315b792c8e8bb1561b4ae703194a724e865e0 100644 (file)
@@ -42,7 +42,6 @@ config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA
        bool "Enable A5 and A9 only errata work-arounds"
        default y
        select ARM_ERRATA_720789
-       select ARM_ERRATA_751472
        select PL310_ERRATA_753970 if CACHE_PL310
        help
          Provides common dependencies for Versatile Express platforms
index 6911b8b2745c5345ca2a5f4498c702ddd1bc6aad..c2f37390308a20b835d653dfbb0f64f28cc8ce40 100644 (file)
@@ -352,7 +352,8 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
                /* Unmapped register. */
                sync_reg_offset = L2X0_DUMMY_REG;
 #endif
-               outer_cache.set_debug = pl310_set_debug;
+               if ((cache_id & L2X0_CACHE_ID_RTL_MASK) <= L2X0_CACHE_ID_RTL_R3P0)
+                       outer_cache.set_debug = pl310_set_debug;
                break;
        case L2X0_CACHE_ID_PART_L210:
                ways = (aux >> 13) & 0xf;
@@ -459,8 +460,8 @@ static void aurora_pa_range(unsigned long start, unsigned long end,
        unsigned long flags;
 
        raw_spin_lock_irqsave(&l2x0_lock, flags);
-       writel(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG);
-       writel(end, l2x0_base + offset);
+       writel_relaxed(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG);
+       writel_relaxed(end, l2x0_base + offset);
        raw_spin_unlock_irqrestore(&l2x0_lock, flags);
 
        cache_sync();
@@ -505,15 +506,21 @@ static void aurora_clean_range(unsigned long start, unsigned long end)
 
 static void aurora_flush_range(unsigned long start, unsigned long end)
 {
-       if (!l2_wt_override) {
-               start &= ~(CACHE_LINE_SIZE - 1);
-               end = ALIGN(end, CACHE_LINE_SIZE);
-               while (start != end) {
-                       unsigned long range_end = calc_range_end(start, end);
+       start &= ~(CACHE_LINE_SIZE - 1);
+       end = ALIGN(end, CACHE_LINE_SIZE);
+       while (start != end) {
+               unsigned long range_end = calc_range_end(start, end);
+               /*
+                * If L2 is forced to WT, the L2 will always be clean and we
+                * just need to invalidate.
+                */
+               if (l2_wt_override)
                        aurora_pa_range(start, range_end - CACHE_LINE_SIZE,
-                                       AURORA_FLUSH_RANGE_REG);
-                       start = range_end;
-               }
+                                                       AURORA_INVAL_RANGE_REG);
+               else
+                       aurora_pa_range(start, range_end - CACHE_LINE_SIZE,
+                                                       AURORA_FLUSH_RANGE_REG);
+               start = range_end;
        }
 }
 
@@ -668,8 +675,9 @@ static void pl310_resume(void)
 static void aurora_resume(void)
 {
        if (!(readl(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
-               writel(l2x0_saved_regs.aux_ctrl, l2x0_base + L2X0_AUX_CTRL);
-               writel(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL);
+               writel_relaxed(l2x0_saved_regs.aux_ctrl,
+                               l2x0_base + L2X0_AUX_CTRL);
+               writel_relaxed(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL);
        }
 }
 
index 350f6a74992b9200618e52ed07a2ec9dd1bde407..3a3c015f8d5c33cb99357995b6d35790037e7f94 100644 (file)
@@ -169,6 +169,7 @@ __v7_ca15mp_setup:
        orreq   r0, r0, r10                     @ Enable CPU-specific SMP bits
        mcreq   p15, 0, r0, c1, c0, 1
 #endif
+       b       __v7_setup
 
 __v7_pj4b_setup:
 #ifdef CONFIG_CPU_PJ4B
@@ -245,7 +246,8 @@ __v7_setup:
        ldr     r10, =0x00000c08                @ Cortex-A8 primary part number
        teq     r0, r10
        bne     2f
-#ifdef CONFIG_ARM_ERRATA_430973
+#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+
        teq     r5, #0x00100000                 @ only present in r1p*
        mrceq   p15, 0, r10, c1, c0, 1          @ read aux control register
        orreq   r10, r10, #(1 << 6)             @ set IBE to 1
index f3771cdb98385917f95526e1fa0b69f443620f13..5b0b86bb34bb8d8ab22466e9f7a54c4937fddd5e 100644 (file)
@@ -22,6 +22,8 @@
 #include <asm/mach/time.h>
 #include <asm/sched_clock.h>
 
+#include <plat/counter-32k.h>
+
 /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
 #define OMAP2_32KSYNCNT_REV_OFF                0x0
 #define OMAP2_32KSYNCNT_REV_SCHEME     (0x3 << 30)
index 743fc2836f7aaa8877349cd47fe98669351e11d2..a5bc92d7e4765b81315379c41618fff7f84cbec2 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <asm/mach/map.h>
 
+#include <plat/sram.h>
+
 #define ROUND_DOWN(value,boundary)     ((value) & (~((boundary)-1)))
 
 static void __iomem *omap_sram_base;
index e0072ce8d6e9c016d78d89c23cba639fa6732186..b69e11dc679da60d8c800c0658a30c84b47437e8 100644 (file)
@@ -43,7 +43,7 @@ extern unsigned long samsung_cpu_id;
 #define EXYNOS4_CPU_MASK       0xFFFE0000
 
 #define EXYNOS5250_SOC_ID      0x43520000
-#define EXYNOS5440_SOC_ID      0x54400000
+#define EXYNOS5440_SOC_ID      0xE5440000
 #define EXYNOS5_SOC_MASK       0xFFFFF000
 
 #define IS_SAMSUNG_CPU(name, id, mask)         \
index d7b56a88c9f4d7211317484f441864263e4b0a20..8b4221cfd118bdb390fea9fa5e6bbfdfe37060f7 100644 (file)
@@ -67,8 +67,7 @@ config BCMA_DRIVER_GMAC_CMN
 
 config BCMA_DRIVER_GPIO
        bool "BCMA GPIO driver"
-       depends on BCMA
-       select GPIOLIB
+       depends on BCMA && GPIOLIB
        help
          Driver to provide access to the GPIO pins of the bcma bus.
 
index 63e688393825539b5f2c64537cbefb1659c579c3..1e694db4532dd7aa41f95fc207b5bb0adea1556b 100644 (file)
@@ -35,7 +35,7 @@ static struct bcma_sflash_tbl_e bcma_sflash_st_tbl[] = {
        { "M25P40", 0x12, 0x10000, 8, },
 
        { "M25P16", 0x14, 0x10000, 32, },
-       { "M25P32", 0x14, 0x10000, 64, },
+       { "M25P32", 0x15, 0x10000, 64, },
        { "M25P64", 0x16, 0x10000, 128, },
        { "M25FL128", 0x17, 0x10000, 256, },
        { 0 },
index c6d3c263b070cc2a66303fc09a861dfae2560c8f..8fa5408b6c7dfeef356ec102d6bf0eab3662835e 100644 (file)
@@ -32,7 +32,7 @@ struct mvebu_soc_descr {
 
 #define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
 
-static struct clk __init *mvebu_clk_gating_get_src(
+static struct clk *mvebu_clk_gating_get_src(
        struct of_phandle_args *clkspec, void *data)
 {
        struct mvebu_gating_ctrl *ctrl = (struct mvebu_gating_ctrl *)data;
index ac71f555dd729cd0a234f02b473f06271f36ae89..e17fad03cb804b7d538bd2928923a50928475d4f 100644 (file)
@@ -1361,13 +1361,16 @@ static int mv_xor_probe(struct platform_device *pdev)
 err_channel_add:
        for (i = 0; i < MV_XOR_MAX_CHANNELS; i++)
                if (xordev->channels[i]) {
+                       mv_xor_channel_remove(xordev->channels[i]);
                        if (pdev->dev.of_node)
                                irq_dispose_mapping(xordev->channels[i]->irq);
-                       mv_xor_channel_remove(xordev->channels[i]);
                }
 
-       clk_disable_unprepare(xordev->clk);
-       clk_put(xordev->clk);
+       if (!IS_ERR(xordev->clk)) {
+               clk_disable_unprepare(xordev->clk);
+               clk_put(xordev->clk);
+       }
+
        return ret;
 }
 
index 4c6c876d9dc3f0fa949352c89039a00b3c0bc79a..66719925970f74755865320e81a83fb43a5d8992 100644 (file)
@@ -4,6 +4,9 @@
 #      Licensed and distributed under the GPL
 #
 
+config EDAC_SUPPORT
+       bool
+
 menuconfig EDAC
        bool "EDAC (Error Detection And Correction) reporting"
        depends on HAS_IOMEM
@@ -27,13 +30,8 @@ menuconfig EDAC
          There is also a mailing list for the EDAC project, which can
          be found via the sourceforge page.
 
-config EDAC_SUPPORT
-       bool
-
 if EDAC
 
-comment "Reporting subsystems"
-
 config EDAC_LEGACY_SYSFS
        bool "EDAC legacy sysfs"
        default y
index de2df92f9c77126709d2c8388b2d88ba7f6ed55c..0ca1ca71157f2b7320e418d13deceeb63965c030 100644 (file)
@@ -472,8 +472,7 @@ static void edac_delete_csrow_objects(struct mem_ctl_info *mci)
                        device_remove_file(&csrow->dev,
                                                dynamic_csrow_ce_count_attr[chan]);
                }
-               put_device(&mci->csrows[i]->dev);
-               device_del(&mci->csrows[i]->dev);
+               device_unregister(&mci->csrows[i]->dev);
        }
 }
 #endif
@@ -1055,11 +1054,9 @@ fail:
                struct dimm_info *dimm = mci->dimms[i];
                if (dimm->nr_pages == 0)
                        continue;
-               put_device(&dimm->dev);
-               device_del(&dimm->dev);
+               device_unregister(&dimm->dev);
        }
-       put_device(&mci->dev);
-       device_del(&mci->dev);
+       device_unregister(&mci->dev);
        bus_unregister(&mci->bus);
        kfree(mci->bus.name);
        return err;
@@ -1086,16 +1083,14 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
                if (dimm->nr_pages == 0)
                        continue;
                edac_dbg(0, "removing device %s\n", dev_name(&dimm->dev));
-               put_device(&dimm->dev);
-               device_del(&dimm->dev);
+               device_unregister(&dimm->dev);
        }
 }
 
 void edac_unregister_sysfs(struct mem_ctl_info *mci)
 {
        edac_dbg(1, "Unregistering device %s\n", dev_name(&mci->dev));
-       put_device(&mci->dev);
-       device_del(&mci->dev);
+       device_unregister(&mci->dev);
        bus_unregister(&mci->bus);
        kfree(mci->bus.name);
 }
@@ -1159,8 +1154,6 @@ int __init edac_mc_sysfs_init(void)
 
 void __exit edac_mc_sysfs_exit(void)
 {
-       put_device(mci_pdev);
-       device_del(mci_pdev);
+       device_unregister(mci_pdev);
        edac_put_sysfs_subsys();
-       kfree(mci_pdev);
 }
index 9601bad47a2e6d5a2bd04deffec5ec5744bfbcee..57affae9568b22c1b4713fb0fe330a33ffe6ca01 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
@@ -29,6 +15,7 @@
 #include "exynos_drm_drv.h"
 #include "exynos_drm_gem.h"
 #include "exynos_drm_buf.h"
+#include "exynos_drm_iommu.h"
 
 static int lowlevel_buffer_allocate(struct drm_device *dev,
                unsigned int flags, struct exynos_drm_gem_buf *buf)
@@ -51,7 +38,7 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
         * region will be allocated else physically contiguous
         * as possible.
         */
-       if (flags & EXYNOS_BO_CONTIG)
+       if (!(flags & EXYNOS_BO_NONCONTIG))
                dma_set_attr(DMA_ATTR_FORCE_CONTIGUOUS, &buf->dma_attrs);
 
        /*
@@ -66,14 +53,45 @@ static int lowlevel_buffer_allocate(struct drm_device *dev,
        dma_set_attr(attr, &buf->dma_attrs);
        dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &buf->dma_attrs);
 
-       buf->pages = dma_alloc_attrs(dev->dev, buf->size,
-                       &buf->dma_addr, GFP_KERNEL, &buf->dma_attrs);
-       if (!buf->pages) {
-               DRM_ERROR("failed to allocate buffer.\n");
-               return -ENOMEM;
+       nr_pages = buf->size >> PAGE_SHIFT;
+
+       if (!is_drm_iommu_supported(dev)) {
+               dma_addr_t start_addr;
+               unsigned int i = 0;
+
+               buf->pages = kzalloc(sizeof(struct page) * nr_pages,
+                                       GFP_KERNEL);
+               if (!buf->pages) {
+                       DRM_ERROR("failed to allocate pages.\n");
+                       return -ENOMEM;
+               }
+
+               buf->kvaddr = dma_alloc_attrs(dev->dev, buf->size,
+                                       &buf->dma_addr, GFP_KERNEL,
+                                       &buf->dma_attrs);
+               if (!buf->kvaddr) {
+                       DRM_ERROR("failed to allocate buffer.\n");
+                       kfree(buf->pages);
+                       return -ENOMEM;
+               }
+
+               start_addr = buf->dma_addr;
+               while (i < nr_pages) {
+                       buf->pages[i] = phys_to_page(start_addr);
+                       start_addr += PAGE_SIZE;
+                       i++;
+               }
+       } else {
+
+               buf->pages = dma_alloc_attrs(dev->dev, buf->size,
+                                       &buf->dma_addr, GFP_KERNEL,
+                                       &buf->dma_attrs);
+               if (!buf->pages) {
+                       DRM_ERROR("failed to allocate buffer.\n");
+                       return -ENOMEM;
+               }
        }
 
-       nr_pages = buf->size >> PAGE_SHIFT;
        buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
        if (!buf->sgt) {
                DRM_ERROR("failed to get sg table.\n");
@@ -92,6 +110,9 @@ err_free_attrs:
                        (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
        buf->dma_addr = (dma_addr_t)NULL;
 
+       if (!is_drm_iommu_supported(dev))
+               kfree(buf->pages);
+
        return ret;
 }
 
@@ -114,8 +135,14 @@ static void lowlevel_buffer_deallocate(struct drm_device *dev,
        kfree(buf->sgt);
        buf->sgt = NULL;
 
-       dma_free_attrs(dev->dev, buf->size, buf->pages,
+       if (!is_drm_iommu_supported(dev)) {
+               dma_free_attrs(dev->dev, buf->size, buf->kvaddr,
                                (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
+               kfree(buf->pages);
+       } else
+               dma_free_attrs(dev->dev, buf->size, buf->pages,
+                               (dma_addr_t)buf->dma_addr, &buf->dma_attrs);
+
        buf->dma_addr = (dma_addr_t)NULL;
 }
 
index 25cf162850330457fd977779157f34b304e91a8d..a6412f19673cb3277ad17137700b006f024b8c84 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_BUF_H_
index 0f68a28726739dd6b795ad066edb645799cfc6d2..ab37437bad8a9f0f5baa8b0425584ba95f5eb2c0 100644 (file)
@@ -5,24 +5,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
index 22f6cc442c3d94e816d9302faa2cef12b25f7fa6..547c6b590357609a2c4f1e6811cb018ea75b1cff 100644 (file)
@@ -5,24 +5,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_CONNECTOR_H_
index 94026ad76a775d9cfb826fa65f9e2da74d14660f..4667c9f67acdf0a03b68a3e717b8c56cda4d127b 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
index 2efa4b031d7340d075e86f9f4136d7f8d2a2a40c..e8894bc9e6d5edf0ecf07cea5078f3961191030d 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
@@ -407,3 +393,33 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc)
        exynos_drm_fn_encoder(private->crtc[crtc], &crtc,
                        exynos_drm_disable_vblank);
 }
+
+void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc)
+{
+       struct exynos_drm_private *dev_priv = dev->dev_private;
+       struct drm_pending_vblank_event *e, *t;
+       struct timeval now;
+       unsigned long flags;
+
+       DRM_DEBUG_KMS("%s\n", __FILE__);
+
+       spin_lock_irqsave(&dev->event_lock, flags);
+
+       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
+                       base.link) {
+               /* if event's pipe isn't same as crtc then ignore it. */
+               if (crtc != e->pipe)
+                       continue;
+
+               do_gettimeofday(&now);
+               e->event.sequence = 0;
+               e->event.tv_sec = now.tv_sec;
+               e->event.tv_usec = now.tv_usec;
+
+               list_move_tail(&e->base.link, &e->base.file_priv->event_list);
+               wake_up_interruptible(&e->base.file_priv->event_wait);
+               drm_vblank_put(dev, crtc);
+       }
+
+       spin_unlock_irqrestore(&dev->event_lock, flags);
+}
index 6bae8d8c250ec7d6cd84c85268d99cf5f40669b6..3e197e6ae7d938f23c98a88c66a09478aa97f60b 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_CRTC_H_
@@ -32,5 +18,6 @@
 int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr);
 int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int crtc);
 void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc);
+void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc);
 
 #endif
index 61d5a8402eb8be71857a4b119f3647dfa5975807..9df97714b6c0b8a2244fa1f61da5eb4a76c774dd 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
@@ -222,7 +208,7 @@ struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev,
        struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
 
        return dma_buf_export(exynos_gem_obj, &exynos_dmabuf_ops,
-                               exynos_gem_obj->base.size, 0600);
+                               exynos_gem_obj->base.size, flags);
 }
 
 struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
@@ -246,7 +232,12 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
 
                /* is it from our device? */
                if (obj->dev == drm_dev) {
+                       /*
+                        * Importing dmabuf exported from out own gem increases
+                        * refcount on gem itself instead of f_count of dmabuf.
+                        */
                        drm_gem_object_reference(obj);
+                       dma_buf_put(dma_buf);
                        return obj;
                }
        }
index 662a8f98ccdbebc82cc7bfcdddd90beade422fc3..49acfafb4fdb60852139fc5745fdbad867193ad4 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_DMABUF_H_
index 1713e53d4751b7b9a6c7e168adafecc8dc126bc2..3da5c2d214d88777b2dd550295c8e939673289dd 100644 (file)
@@ -5,24 +5,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
index f5a97745bf93b44a6872f8daaca88642d2912c54..b9e51bc09e81ad3ba81943e860ebb7a2580e0f2d 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_DRV_H_
index 301485215a70d782aa28e182633ca0f1b1592afc..c63721f64aecd15518392d254b9857cfc6c2ab54 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
index 88bb25a2a917119d102104aa613ea9745fadfbbd..89e2fb0770af12ba7405ba8b116edb831b67c4fd 100644 (file)
@@ -5,24 +5,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_ENCODER_H_
index 5426cc5a5e8d53b30409a980aa5e8878a30e7c83..294c0513f587901a15fdd9e57de8c3c48fdf3d34 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
index 96262e54f76dc212183702fe4ab2027ff4e97820..517471b37566cd8b5224720954113865549cf12d 100644 (file)
@@ -5,24 +5,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_FB_H_
index f433eb7533a97e9550f86f2f94c4f5fa173d0427..71f867340a88b43a98572c1b84c6776528e919fc 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
@@ -34,6 +20,7 @@
 #include "exynos_drm_drv.h"
 #include "exynos_drm_fb.h"
 #include "exynos_drm_gem.h"
+#include "exynos_drm_iommu.h"
 
 #define MAX_CONNECTOR          4
 #define PREFERRED_BPP          32
@@ -111,9 +98,18 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
 
        /* map pages with kernel virtual space. */
        if (!buffer->kvaddr) {
-               unsigned int nr_pages = buffer->size >> PAGE_SHIFT;
-               buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP,
+               if (is_drm_iommu_supported(dev)) {
+                       unsigned int nr_pages = buffer->size >> PAGE_SHIFT;
+
+                       buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP,
                                        pgprot_writecombine(PAGE_KERNEL));
+               } else {
+                       phys_addr_t dma_addr = buffer->dma_addr;
+                       if (dma_addr)
+                               buffer->kvaddr = phys_to_virt(dma_addr);
+                       else
+                               buffer->kvaddr = (void __iomem *)NULL;
+               }
                if (!buffer->kvaddr) {
                        DRM_ERROR("failed to map pages to kernel space.\n");
                        return -EIO;
@@ -128,8 +124,12 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
 
        dev->mode_config.fb_base = (resource_size_t)buffer->dma_addr;
        fbi->screen_base = buffer->kvaddr + offset;
-       fbi->fix.smem_start = (unsigned long)
+       if (is_drm_iommu_supported(dev))
+               fbi->fix.smem_start = (unsigned long)
                        (page_to_phys(sg_page(buffer->sgt->sgl)) + offset);
+       else
+               fbi->fix.smem_start = (unsigned long)buffer->dma_addr;
+
        fbi->screen_size = size;
        fbi->fix.smem_len = size;
 
@@ -320,7 +320,7 @@ static void exynos_drm_fbdev_destroy(struct drm_device *dev,
        struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
        struct drm_framebuffer *fb;
 
-       if (exynos_gem_obj->buffer->kvaddr)
+       if (is_drm_iommu_supported(dev) && exynos_gem_obj->buffer->kvaddr)
                vunmap(exynos_gem_obj->buffer->kvaddr);
 
        /* release drm framebuffer and real buffer */
index ccfce8a1a4519c9bdd142eb1d5c3200b7314fcc6..e16d7f0ae1920eb944364747b3f009e7976654f4 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_FBDEV_H_
index d9963171fd0b92d793bd9e044372b6d815e5363a..67a83e69544bb4e285088be9227c3ed2176ebcb6 100644 (file)
@@ -25,7 +25,7 @@
 #include "exynos_drm_fimc.h"
 
 /*
- * FIMC is stand for Fully Interactive Mobile Camera and
+ * FIMC stands for Fully Interactive Mobile Camera and
  * supports image scaler/rotator and input/output DMA operations.
  * input DMA reads image data from the memory.
  * output DMA writes image data to memory.
@@ -163,19 +163,29 @@ struct fimc_context {
        bool    suspended;
 };
 
-static void fimc_sw_reset(struct fimc_context *ctx, bool pattern)
+static void fimc_sw_reset(struct fimc_context *ctx)
 {
        u32 cfg;
 
-       DRM_DEBUG_KMS("%s:pattern[%d]\n", __func__, pattern);
+       DRM_DEBUG_KMS("%s\n", __func__);
+
+       /* stop dma operation */
+       cfg = fimc_read(EXYNOS_CISTATUS);
+       if (EXYNOS_CISTATUS_GET_ENVID_STATUS(cfg)) {
+               cfg = fimc_read(EXYNOS_MSCTRL);
+               cfg &= ~EXYNOS_MSCTRL_ENVID;
+               fimc_write(cfg, EXYNOS_MSCTRL);
+       }
 
        cfg = fimc_read(EXYNOS_CISRCFMT);
        cfg |= EXYNOS_CISRCFMT_ITU601_8BIT;
-       if (pattern)
-               cfg |= EXYNOS_CIGCTRL_TESTPATTERN_COLOR_BAR;
-
        fimc_write(cfg, EXYNOS_CISRCFMT);
 
+       /* disable image capture */
+       cfg = fimc_read(EXYNOS_CIIMGCPT);
+       cfg &= ~(EXYNOS_CIIMGCPT_IMGCPTEN_SC | EXYNOS_CIIMGCPT_IMGCPTEN);
+       fimc_write(cfg, EXYNOS_CIIMGCPT);
+
        /* s/w reset */
        cfg = fimc_read(EXYNOS_CIGCTRL);
        cfg |= (EXYNOS_CIGCTRL_SWRST);
@@ -695,7 +705,7 @@ static int fimc_src_set_addr(struct device *dev,
 {
        struct fimc_context *ctx = get_fimc_context(dev);
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_property *property;
        struct drm_exynos_ipp_config *config;
 
@@ -705,10 +715,6 @@ static int fimc_src_set_addr(struct device *dev,
        }
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EINVAL;
-       }
 
        DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
                property->prop_id, buf_id, buf_type);
@@ -1206,7 +1212,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
        }
 
        /* sequence id */
-       cfg &= (~mask);
+       cfg &= ~mask;
        cfg |= (enable << buf_id);
        fimc_write(cfg, EXYNOS_CIFCNTSEQ);
 
@@ -1231,7 +1237,7 @@ static int fimc_dst_set_addr(struct device *dev,
 {
        struct fimc_context *ctx = get_fimc_context(dev);
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_property *property;
        struct drm_exynos_ipp_config *config;
 
@@ -1241,10 +1247,6 @@ static int fimc_dst_set_addr(struct device *dev,
        }
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EINVAL;
-       }
 
        DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
                property->prop_id, buf_id, buf_type);
@@ -1317,7 +1319,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
 {
        struct fimc_context *ctx = dev_id;
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_event_work *event_work =
                c_node->event_work;
        int buf_id;
@@ -1395,6 +1397,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip)
        case EXYNOS_DRM_FLIP_NONE:
        case EXYNOS_DRM_FLIP_VERTICAL:
        case EXYNOS_DRM_FLIP_HORIZONTAL:
+       case EXYNOS_DRM_FLIP_BOTH:
                return true;
        default:
                DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -1543,7 +1546,7 @@ static int fimc_ippdrv_reset(struct device *dev)
        DRM_DEBUG_KMS("%s\n", __func__);
 
        /* reset h/w block */
-       fimc_sw_reset(ctx, false);
+       fimc_sw_reset(ctx);
 
        /* reset scaler capability */
        memset(&ctx->sc, 0x0, sizeof(ctx->sc));
@@ -1557,7 +1560,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
 {
        struct fimc_context *ctx = get_fimc_context(dev);
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_property *property;
        struct drm_exynos_ipp_config *config;
        struct drm_exynos_pos   img_pos[EXYNOS_DRM_OPS_MAX];
@@ -1573,10 +1576,6 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
        }
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EINVAL;
-       }
 
        fimc_handle_irq(ctx, true, false, true);
 
@@ -1739,93 +1738,64 @@ static int fimc_probe(struct platform_device *pdev)
                platform_get_device_id(pdev)->driver_data;
 
        /* clock control */
-       ctx->sclk_fimc_clk = clk_get(dev, "sclk_fimc");
+       ctx->sclk_fimc_clk = devm_clk_get(dev, "sclk_fimc");
        if (IS_ERR(ctx->sclk_fimc_clk)) {
                dev_err(dev, "failed to get src fimc clock.\n");
-               ret = PTR_ERR(ctx->sclk_fimc_clk);
-               goto err_ctx;
+               return PTR_ERR(ctx->sclk_fimc_clk);
        }
        clk_enable(ctx->sclk_fimc_clk);
 
-       ctx->fimc_clk = clk_get(dev, "fimc");
+       ctx->fimc_clk = devm_clk_get(dev, "fimc");
        if (IS_ERR(ctx->fimc_clk)) {
                dev_err(dev, "failed to get fimc clock.\n");
-               ret = PTR_ERR(ctx->fimc_clk);
                clk_disable(ctx->sclk_fimc_clk);
-               clk_put(ctx->sclk_fimc_clk);
-               goto err_ctx;
+               return PTR_ERR(ctx->fimc_clk);
        }
 
-       ctx->wb_clk = clk_get(dev, "pxl_async0");
+       ctx->wb_clk = devm_clk_get(dev, "pxl_async0");
        if (IS_ERR(ctx->wb_clk)) {
                dev_err(dev, "failed to get writeback a clock.\n");
-               ret = PTR_ERR(ctx->wb_clk);
                clk_disable(ctx->sclk_fimc_clk);
-               clk_put(ctx->sclk_fimc_clk);
-               clk_put(ctx->fimc_clk);
-               goto err_ctx;
+               return PTR_ERR(ctx->wb_clk);
        }
 
-       ctx->wb_b_clk = clk_get(dev, "pxl_async1");
+       ctx->wb_b_clk = devm_clk_get(dev, "pxl_async1");
        if (IS_ERR(ctx->wb_b_clk)) {
                dev_err(dev, "failed to get writeback b clock.\n");
-               ret = PTR_ERR(ctx->wb_b_clk);
                clk_disable(ctx->sclk_fimc_clk);
-               clk_put(ctx->sclk_fimc_clk);
-               clk_put(ctx->fimc_clk);
-               clk_put(ctx->wb_clk);
-               goto err_ctx;
+               return PTR_ERR(ctx->wb_b_clk);
        }
 
-       parent_clk = clk_get(dev, ddata->parent_clk);
+       parent_clk = devm_clk_get(dev, ddata->parent_clk);
 
        if (IS_ERR(parent_clk)) {
                dev_err(dev, "failed to get parent clock.\n");
-               ret = PTR_ERR(parent_clk);
                clk_disable(ctx->sclk_fimc_clk);
-               clk_put(ctx->sclk_fimc_clk);
-               clk_put(ctx->fimc_clk);
-               clk_put(ctx->wb_clk);
-               clk_put(ctx->wb_b_clk);
-               goto err_ctx;
+               return PTR_ERR(parent_clk);
        }
 
        if (clk_set_parent(ctx->sclk_fimc_clk, parent_clk)) {
                dev_err(dev, "failed to set parent.\n");
-               ret = -EINVAL;
-               clk_put(parent_clk);
                clk_disable(ctx->sclk_fimc_clk);
-               clk_put(ctx->sclk_fimc_clk);
-               clk_put(ctx->fimc_clk);
-               clk_put(ctx->wb_clk);
-               clk_put(ctx->wb_b_clk);
-               goto err_ctx;
+               return -EINVAL;
        }
 
-       clk_put(parent_clk);
+       devm_clk_put(dev, parent_clk);
        clk_set_rate(ctx->sclk_fimc_clk, pdata->clk_rate);
 
        /* resource memory */
        ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!ctx->regs_res) {
-               dev_err(dev, "failed to find registers.\n");
-               ret = -ENOENT;
-               goto err_clk;
-       }
-
        ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res);
        if (!ctx->regs) {
                dev_err(dev, "failed to map registers.\n");
-               ret = -ENXIO;
-               goto err_clk;
+               return -ENXIO;
        }
 
        /* resource irq */
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!res) {
                dev_err(dev, "failed to request irq resource.\n");
-               ret = -ENOENT;
-               goto err_get_regs;
+               return -ENOENT;
        }
 
        ctx->irq = res->start;
@@ -1833,7 +1803,7 @@ static int fimc_probe(struct platform_device *pdev)
                IRQF_ONESHOT, "drm_fimc", ctx);
        if (ret < 0) {
                dev_err(dev, "failed to request irq.\n");
-               goto err_get_regs;
+               return ret;
        }
 
        /* context initailization */
@@ -1879,15 +1849,7 @@ err_ippdrv_register:
        pm_runtime_disable(dev);
 err_get_irq:
        free_irq(ctx->irq, ctx);
-err_get_regs:
-       devm_iounmap(dev, ctx->regs);
-err_clk:
-       clk_put(ctx->sclk_fimc_clk);
-       clk_put(ctx->fimc_clk);
-       clk_put(ctx->wb_clk);
-       clk_put(ctx->wb_b_clk);
-err_ctx:
-       devm_kfree(dev, ctx);
+
        return ret;
 }
 
@@ -1905,14 +1867,6 @@ static int fimc_remove(struct platform_device *pdev)
        pm_runtime_disable(dev);
 
        free_irq(ctx->irq, ctx);
-       devm_iounmap(dev, ctx->regs);
-
-       clk_put(ctx->sclk_fimc_clk);
-       clk_put(ctx->fimc_clk);
-       clk_put(ctx->wb_clk);
-       clk_put(ctx->wb_b_clk);
-
-       devm_kfree(dev, ctx);
 
        return 0;
 }
index dc970fa0d8886f228edac1ba00ad46338d4fad80..127a424c5fdfb9e5ca7948bdeba607e452f50b1d 100644 (file)
@@ -6,24 +6,10 @@
  *     Jinyoung Jeon <jy0.jeon@samsung.com>
  *     Sangmin Lee <lsmin.lee@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_FIMC_H_
index 3ac911894dc7203c4aeda628d2dfa2969cefd64c..9537761931ee297fb33c8cf8888a2842b1e4fc1a 100644 (file)
@@ -663,34 +663,6 @@ static struct exynos_drm_manager fimd_manager = {
        .display_ops    = &fimd_display_ops,
 };
 
-static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc)
-{
-       struct exynos_drm_private *dev_priv = drm_dev->dev_private;
-       struct drm_pending_vblank_event *e, *t;
-       struct timeval now;
-       unsigned long flags;
-
-       spin_lock_irqsave(&drm_dev->event_lock, flags);
-
-       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-                       base.link) {
-               /* if event's pipe isn't same as crtc then ignore it. */
-               if (crtc != e->pipe)
-                       continue;
-
-               do_gettimeofday(&now);
-               e->event.sequence = 0;
-               e->event.tv_sec = now.tv_sec;
-               e->event.tv_usec = now.tv_usec;
-
-               list_move_tail(&e->base.link, &e->base.file_priv->event_list);
-               wake_up_interruptible(&e->base.file_priv->event_wait);
-               drm_vblank_put(drm_dev, crtc);
-       }
-
-       spin_unlock_irqrestore(&drm_dev->event_lock, flags);
-}
-
 static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
 {
        struct fimd_context *ctx = (struct fimd_context *)dev_id;
@@ -710,7 +682,7 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
                goto out;
 
        drm_handle_vblank(drm_dev, manager->pipe);
-       fimd_finish_pageflip(drm_dev, manager->pipe);
+       exynos_drm_crtc_finish_pageflip(drm_dev, manager->pipe);
 
        /* set wait vsync event to zero and wake up queue. */
        if (atomic_read(&ctx->wait_vsync_event)) {
@@ -1046,7 +1018,7 @@ static int fimd_resume(struct device *dev)
         * of pm runtime would still be 1 so in this case, fimd driver
         * should be on directly not drawing on pm runtime interface.
         */
-       if (pm_runtime_suspended(dev)) {
+       if (!pm_runtime_suspended(dev)) {
                int ret;
 
                ret = fimd_activate(ctx, true);
index d48183e7e056d56a8932ae06baf1bc172ce02893..4731807765287a35ce2bb5ea087fc6bc3844eac8 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drm/drmP.h>
index f11f2afd5bfc58254eb0b064535ae4b8131b91c3..35ebac47dc2bacfec928d54001b6065aa9e75564 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  * Authoer: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_GEM_H_
index 4b0e8589bd194f1afeb8fdcd551a286b8b23dddd..8140753ec9c824202173e631bfc1f4ba711c9ef7 100644 (file)
@@ -25,7 +25,7 @@
 #include "exynos_drm_gsc.h"
 
 /*
- * GSC is stand for General SCaler and
+ * GSC stands for General SCaler and
  * supports image scaler/rotator and input/output DMA operations.
  * input DMA reads image data from the memory.
  * output DMA writes image data to memory.
@@ -711,7 +711,7 @@ static int gsc_src_set_addr(struct device *dev,
 {
        struct gsc_context *ctx = get_gsc_context(dev);
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_property *property;
 
        if (!c_node) {
@@ -720,10 +720,6 @@ static int gsc_src_set_addr(struct device *dev,
        }
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EFAULT;
-       }
 
        DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
                property->prop_id, buf_id, buf_type);
@@ -1171,7 +1167,7 @@ static int gsc_dst_set_addr(struct device *dev,
 {
        struct gsc_context *ctx = get_gsc_context(dev);
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_property *property;
 
        if (!c_node) {
@@ -1180,10 +1176,6 @@ static int gsc_dst_set_addr(struct device *dev,
        }
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EFAULT;
-       }
 
        DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
                property->prop_id, buf_id, buf_type);
@@ -1312,7 +1304,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
 {
        struct gsc_context *ctx = dev_id;
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_event_work *event_work =
                c_node->event_work;
        u32 status;
@@ -1399,7 +1391,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip)
        case EXYNOS_DRM_FLIP_NONE:
        case EXYNOS_DRM_FLIP_VERTICAL:
        case EXYNOS_DRM_FLIP_HORIZONTAL:
-       case EXYNOS_DRM_FLIP_VERTICAL | EXYNOS_DRM_FLIP_HORIZONTAL:
+       case EXYNOS_DRM_FLIP_BOTH:
                return true;
        default:
                DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -1549,7 +1541,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
 {
        struct gsc_context *ctx = get_gsc_context(dev);
        struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_property *property;
        struct drm_exynos_ipp_config *config;
        struct drm_exynos_pos   img_pos[EXYNOS_DRM_OPS_MAX];
@@ -1565,10 +1557,6 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
        }
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property.\n");
-               return -EINVAL;
-       }
 
        gsc_handle_irq(ctx, true, false, true);
 
@@ -1604,7 +1592,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
                exynos_drm_ippnb_send_event(IPP_SET_WRITEBACK, (void *)&set_wb);
 
                /* src local path */
-               cfg = readl(GSC_IN_CON);
+               cfg = gsc_read(GSC_IN_CON);
                cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK);
                cfg |= (GSC_IN_PATH_LOCAL | GSC_IN_LOCAL_FIMD_WB);
                gsc_write(cfg, GSC_IN_CON);
@@ -1696,34 +1684,25 @@ static int gsc_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        /* clock control */
-       ctx->gsc_clk = clk_get(dev, "gscl");
+       ctx->gsc_clk = devm_clk_get(dev, "gscl");
        if (IS_ERR(ctx->gsc_clk)) {
                dev_err(dev, "failed to get gsc clock.\n");
-               ret = PTR_ERR(ctx->gsc_clk);
-               goto err_ctx;
+               return PTR_ERR(ctx->gsc_clk);
        }
 
        /* resource memory */
        ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!ctx->regs_res) {
-               dev_err(dev, "failed to find registers.\n");
-               ret = -ENOENT;
-               goto err_clk;
-       }
-
        ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res);
        if (!ctx->regs) {
                dev_err(dev, "failed to map registers.\n");
-               ret = -ENXIO;
-               goto err_clk;
+               return -ENXIO;
        }
 
        /* resource irq */
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!res) {
                dev_err(dev, "failed to request irq resource.\n");
-               ret = -ENOENT;
-               goto err_get_regs;
+               return -ENOENT;
        }
 
        ctx->irq = res->start;
@@ -1731,7 +1710,7 @@ static int gsc_probe(struct platform_device *pdev)
                IRQF_ONESHOT, "drm_gsc", ctx);
        if (ret < 0) {
                dev_err(dev, "failed to request irq.\n");
-               goto err_get_regs;
+               return ret;
        }
 
        /* context initailization */
@@ -1775,12 +1754,6 @@ err_ippdrv_register:
        pm_runtime_disable(dev);
 err_get_irq:
        free_irq(ctx->irq, ctx);
-err_get_regs:
-       devm_iounmap(dev, ctx->regs);
-err_clk:
-       clk_put(ctx->gsc_clk);
-err_ctx:
-       devm_kfree(dev, ctx);
        return ret;
 }
 
@@ -1798,11 +1771,6 @@ static int gsc_remove(struct platform_device *pdev)
        pm_runtime_disable(dev);
 
        free_irq(ctx->irq, ctx);
-       devm_iounmap(dev, ctx->regs);
-
-       clk_put(ctx->gsc_clk);
-
-       devm_kfree(dev, ctx);
 
        return 0;
 }
index b3c3bc618c0f24d7ca21315ecb7b97477e800477..29ec1c5efcf2913cbb44e1fda3e9a830be0d2192 100644 (file)
@@ -6,24 +6,10 @@
  *     Jinyoung Jeon <jy0.jeon@samsung.com>
  *     Sangmin Lee <lsmin.lee@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_GSC_H_
index fcc3093ec8fe3f488379e8880e194037784c56b3..784a7e9a766c4a178e2f73e628e63adce5f6c364 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  * Authoer: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_HDMI_H_
index 2482b7f96341ac196c98e10eeed359dcdc0d70ea..3799d5c2b5df746590b2952ed1a93fce2910e085 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #include <drmP.h>
index 18a0ca190b98426e7922777fecc1ab6c270ef51a..53b7deea8ab768e5b351124bf9b5968eef1e09ec 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * Authoer: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_IOMMU_H_
index c1f12301224c83ba48e6699cd9311364f33eaf23..0bda96454a02fe6e8cf31ced93c37249355a5f99 100644 (file)
@@ -27,7 +27,7 @@
 #include "exynos_drm_iommu.h"
 
 /*
- * IPP is stand for Image Post Processing and
+ * IPP stands for Image Post Processing and
  * supports image scaler/rotator and input/output DMA operations.
  * using FIMC, GSC, Rotator, so on.
  * IPP is integration device driver of same attribute h/w
@@ -1292,7 +1292,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
        DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, property->prop_id);
 
        /* store command info in ippdrv */
-       ippdrv->cmd = c_node;
+       ippdrv->c_node = c_node;
 
        if (!ipp_check_mem_list(c_node)) {
                DRM_DEBUG_KMS("%s:empty memory.\n", __func__);
@@ -1303,7 +1303,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv,
        ret = ipp_set_property(ippdrv, property);
        if (ret) {
                DRM_ERROR("failed to set property.\n");
-               ippdrv->cmd = NULL;
+               ippdrv->c_node = NULL;
                return ret;
        }
 
@@ -1487,11 +1487,6 @@ void ipp_sched_cmd(struct work_struct *work)
        mutex_lock(&c_node->cmd_lock);
 
        property = &c_node->property;
-       if (!property) {
-               DRM_ERROR("failed to get property:prop_id[%d]\n",
-                       c_node->property.prop_id);
-               goto err_unlock;
-       }
 
        switch (cmd_work->ctrl) {
        case IPP_CTRL_PLAY:
@@ -1704,7 +1699,7 @@ void ipp_sched_event(struct work_struct *work)
                return;
        }
 
-       c_node = ippdrv->cmd;
+       c_node = ippdrv->c_node;
        if (!c_node) {
                DRM_ERROR("failed to get command node.\n");
                return;
@@ -1895,7 +1890,7 @@ static int ipp_probe(struct platform_device *pdev)
        struct exynos_drm_subdrv *subdrv;
        int ret;
 
-       ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+       ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
        if (!ctx)
                return -ENOMEM;
 
@@ -1916,8 +1911,7 @@ static int ipp_probe(struct platform_device *pdev)
        ctx->event_workq = create_singlethread_workqueue("ipp_event");
        if (!ctx->event_workq) {
                dev_err(dev, "failed to create event workqueue\n");
-               ret = -EINVAL;
-               goto err_clear;
+               return -EINVAL;
        }
 
        /*
@@ -1958,8 +1952,6 @@ err_cmd_workq:
        destroy_workqueue(ctx->cmd_workq);
 err_event_workq:
        destroy_workqueue(ctx->event_workq);
-err_clear:
-       kfree(ctx);
        return ret;
 }
 
@@ -1985,8 +1977,6 @@ static int ipp_remove(struct platform_device *pdev)
        destroy_workqueue(ctx->cmd_workq);
        destroy_workqueue(ctx->event_workq);
 
-       kfree(ctx);
-
        return 0;
 }
 
index 28ffac95386cf0f8624987d57f99943232e4d335..4cadbea7dbde9d71b2011ae012b0e4c9b0b11ce3 100644 (file)
@@ -6,24 +6,10 @@
  *     Jinyoung Jeon <jy0.jeon@samsung.com>
  *     Sangmin Lee <lsmin.lee@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_IPP_H_
@@ -160,7 +146,7 @@ struct exynos_drm_ipp_ops {
  * @dedicated: dedicated ipp device.
  * @ops: source, destination operations.
  * @event_workq: event work queue.
- * @cmd: current command information.
+ * @c_node: current command information.
  * @cmd_list: list head for command information.
  * @prop_list: property informations of current ipp driver.
  * @check_property: check property about format, size, buffer.
@@ -178,7 +164,7 @@ struct exynos_drm_ippdrv {
        bool    dedicated;
        struct exynos_drm_ipp_ops       *ops[EXYNOS_DRM_OPS_MAX];
        struct workqueue_struct *event_workq;
-       struct drm_exynos_ipp_cmd_node *cmd;
+       struct drm_exynos_ipp_cmd_node *c_node;
        struct list_head        cmd_list;
        struct drm_exynos_ipp_prop_list *prop_list;
 
index c748850737a1f253513afcb97ae8aab3a979b118..e9e83ef688f0c3a4ccf0253154975eebddb1d378 100644 (file)
@@ -139,7 +139,7 @@ static irqreturn_t rotator_irq_handler(int irq, void *arg)
 {
        struct rot_context *rot = arg;
        struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv;
-       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->cmd;
+       struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
        struct drm_exynos_ipp_event_work *event_work = c_node->event_work;
        enum rot_irq_status irq_status;
        u32 val;
@@ -513,6 +513,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip)
        case EXYNOS_DRM_FLIP_NONE:
        case EXYNOS_DRM_FLIP_VERTICAL:
        case EXYNOS_DRM_FLIP_HORIZONTAL:
+       case EXYNOS_DRM_FLIP_BOTH:
                return true;
        default:
                DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
@@ -655,34 +656,26 @@ static int rotator_probe(struct platform_device *pdev)
                                platform_get_device_id(pdev)->driver_data;
 
        rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!rot->regs_res) {
-               dev_err(dev, "failed to find registers\n");
-               ret = -ENOENT;
-               goto err_get_resource;
-       }
-
        rot->regs = devm_request_and_ioremap(dev, rot->regs_res);
        if (!rot->regs) {
                dev_err(dev, "failed to map register\n");
-               ret = -ENXIO;
-               goto err_get_resource;
+               return -ENXIO;
        }
 
        rot->irq = platform_get_irq(pdev, 0);
        if (rot->irq < 0) {
                dev_err(dev, "failed to get irq\n");
-               ret = rot->irq;
-               goto err_get_irq;
+               return rot->irq;
        }
 
        ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler,
                        IRQF_ONESHOT, "drm_rotator", rot);
        if (ret < 0) {
                dev_err(dev, "failed to request irq\n");
-               goto err_get_irq;
+               return ret;
        }
 
-       rot->clock = clk_get(dev, "rotator");
+       rot->clock = devm_clk_get(dev, "rotator");
        if (IS_ERR_OR_NULL(rot->clock)) {
                dev_err(dev, "failed to get clock\n");
                ret = PTR_ERR(rot->clock);
@@ -720,13 +713,8 @@ static int rotator_probe(struct platform_device *pdev)
 err_ippdrv_register:
        devm_kfree(dev, ippdrv->prop_list);
        pm_runtime_disable(dev);
-       clk_put(rot->clock);
 err_clk_get:
        free_irq(rot->irq, rot);
-err_get_irq:
-       devm_iounmap(dev, rot->regs);
-err_get_resource:
-       devm_kfree(dev, rot);
        return ret;
 }
 
@@ -740,12 +728,8 @@ static int rotator_remove(struct platform_device *pdev)
        exynos_drm_ippdrv_unregister(ippdrv);
 
        pm_runtime_disable(dev);
-       clk_put(rot->clock);
 
        free_irq(rot->irq, rot);
-       devm_iounmap(dev, rot->regs);
-
-       devm_kfree(dev, rot);
 
        return 0;
 }
index a2d7a14a52b60dd96f4210e98346d402e00d9460..71a0b4c0c1e897ea1191a4ee06caef787f175eb1 100644 (file)
@@ -5,24 +5,10 @@
  *     YoungJun Cho <yj44.cho@samsung.com>
  *     Eunchul Kim <chulspro.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef        _EXYNOS_DRM_ROTATOR_H_
index a5c5a179e3b64789445ca2a4e730ad0c403031e9..d0ca3c4e06c60bbeca05e87b783d1e7e4b690f16 100644 (file)
@@ -372,34 +372,6 @@ static struct exynos_drm_manager vidi_manager = {
        .display_ops    = &vidi_display_ops,
 };
 
-static void vidi_finish_pageflip(struct drm_device *drm_dev, int crtc)
-{
-       struct exynos_drm_private *dev_priv = drm_dev->dev_private;
-       struct drm_pending_vblank_event *e, *t;
-       struct timeval now;
-       unsigned long flags;
-
-       spin_lock_irqsave(&drm_dev->event_lock, flags);
-
-       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-                       base.link) {
-               /* if event's pipe isn't same as crtc then ignore it. */
-               if (crtc != e->pipe)
-                       continue;
-
-               do_gettimeofday(&now);
-               e->event.sequence = 0;
-               e->event.tv_sec = now.tv_sec;
-               e->event.tv_usec = now.tv_usec;
-
-               list_move_tail(&e->base.link, &e->base.file_priv->event_list);
-               wake_up_interruptible(&e->base.file_priv->event_wait);
-               drm_vblank_put(drm_dev, crtc);
-       }
-
-       spin_unlock_irqrestore(&drm_dev->event_lock, flags);
-}
-
 static void vidi_fake_vblank_handler(struct work_struct *work)
 {
        struct vidi_context *ctx = container_of(work, struct vidi_context,
@@ -424,7 +396,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
 
        mutex_unlock(&ctx->lock);
 
-       vidi_finish_pageflip(subdrv->drm_dev, manager->pipe);
+       exynos_drm_crtc_finish_pageflip(subdrv->drm_dev, manager->pipe);
 }
 
 static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
index a4babe4e65d701f8dab8b71a2562b6bbdb6fe104..1e5fdaa36ccc203e4b91daa588895283ea1468bb 100644 (file)
@@ -3,24 +3,10 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * Author: Inki Dae <inki.dae@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_DRM_VIDI_H_
index 1c3b6d8f1fe796fac9d9b37bd341f703e740861f..0ddf3957de15943855b8bc4b2fa56c415f22520a 100644 (file)
@@ -5,24 +5,10 @@
  *     Inki Dae <inki.dae@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _EXYNOS_HDMI_H_
index 3f68b34fa1276dc34053e5f6a604b4e965a4cc59..c187ea33b748c031b91d10e45479d98368b297f6 100644 (file)
@@ -35,6 +35,7 @@
 #include <drm/exynos_drm.h>
 
 #include "exynos_drm_drv.h"
+#include "exynos_drm_crtc.h"
 #include "exynos_drm_hdmi.h"
 #include "exynos_drm_iommu.h"
 
@@ -949,35 +950,6 @@ static struct exynos_mixer_ops mixer_ops = {
        .win_disable            = mixer_win_disable,
 };
 
-/* for pageflip event */
-static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc)
-{
-       struct exynos_drm_private *dev_priv = drm_dev->dev_private;
-       struct drm_pending_vblank_event *e, *t;
-       struct timeval now;
-       unsigned long flags;
-
-       spin_lock_irqsave(&drm_dev->event_lock, flags);
-
-       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-                       base.link) {
-               /* if event's pipe isn't same as crtc then ignore it. */
-               if (crtc != e->pipe)
-                       continue;
-
-               do_gettimeofday(&now);
-               e->event.sequence = 0;
-               e->event.tv_sec = now.tv_sec;
-               e->event.tv_usec = now.tv_usec;
-
-               list_move_tail(&e->base.link, &e->base.file_priv->event_list);
-               wake_up_interruptible(&e->base.file_priv->event_wait);
-               drm_vblank_put(drm_dev, crtc);
-       }
-
-       spin_unlock_irqrestore(&drm_dev->event_lock, flags);
-}
-
 static irqreturn_t mixer_irq_handler(int irq, void *arg)
 {
        struct exynos_drm_hdmi_context *drm_hdmi_ctx = arg;
@@ -1006,7 +978,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
                }
 
                drm_handle_vblank(drm_hdmi_ctx->drm_dev, ctx->pipe);
-               mixer_finish_pageflip(drm_hdmi_ctx->drm_dev, ctx->pipe);
+               exynos_drm_crtc_finish_pageflip(drm_hdmi_ctx->drm_dev,
+                               ctx->pipe);
 
                /* set wait vsync event to zero and wake up queue. */
                if (atomic_read(&ctx->wait_vsync_event)) {
index 7be4241e824263efb8116533b680738ef74d449e..abeaafef6d7ef9986313be7ab8e0c2c5a992c065 100644 (file)
@@ -266,7 +266,12 @@ struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev,
                obj = dma_buf->priv;
                /* is it from our device? */
                if (obj->base.dev == dev) {
+                       /*
+                        * Importing dmabuf exported from out own gem increases
+                        * refcount on gem itself instead of f_count of dmabuf.
+                        */
                        drm_gem_object_reference(&obj->base);
+                       dma_buf_put(dma_buf);
                        return &obj->base;
                }
        }
index 3543fec2355e52804dc69fcf8fd695632308a7a4..b8e05ae38212db2b8912f874dc4fe5fb627e7102 100644 (file)
@@ -193,6 +193,7 @@ struct drm_gem_object *nouveau_gem_prime_import(struct drm_device *dev,
                if (nvbo->gem) {
                        if (nvbo->gem->dev == dev) {
                                drm_gem_object_reference(nvbo->gem);
+                               dma_buf_put(dma_buf);
                                return nvbo->gem;
                        }
                }
index 923f9364704235cc478903c21d444072608dcf91..537e259b383720d97bbd0b452e74a1c2688eec49 100644 (file)
@@ -2646,7 +2646,7 @@ int r600_copy_blit(struct radeon_device *rdev,
  * @num_gpu_pages: number of GPU pages to xfer
  * @fence: radeon fence object
  *
- * Copy GPU paging using the DMA engine (r6xx-r7xx).
+ * Copy GPU paging using the DMA engine (r6xx).
  * Used by the radeon ttm implementation to move pages if
  * registered as the asic copy callback.
  */
@@ -2669,8 +2669,8 @@ int r600_copy_dma(struct radeon_device *rdev,
        }
 
        size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4;
-       num_loops = DIV_ROUND_UP(size_in_dw, 0xffff);
-       r = radeon_ring_lock(rdev, ring, num_loops * 5 + 8);
+       num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFE);
+       r = radeon_ring_lock(rdev, ring, num_loops * 4 + 8);
        if (r) {
                DRM_ERROR("radeon: moving bo (%d).\n", r);
                radeon_semaphore_free(rdev, &sem, NULL);
@@ -2693,8 +2693,8 @@ int r600_copy_dma(struct radeon_device *rdev,
                radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
                radeon_ring_write(ring, dst_offset & 0xfffffffc);
                radeon_ring_write(ring, src_offset & 0xfffffffc);
-               radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
-               radeon_ring_write(ring, upper_32_bits(src_offset) & 0xff);
+               radeon_ring_write(ring, (((upper_32_bits(dst_offset) & 0xff) << 16) |
+                                        (upper_32_bits(src_offset) & 0xff)));
                src_offset += cur_size_in_dw * 4;
                dst_offset += cur_size_in_dw * 4;
        }
index 9ea13d07cc55c75fbb7df5ffff7865661a526c5f..03191a56eb443424d35ffbaa84b82ffe96fa1d8a 100644 (file)
@@ -2677,16 +2677,29 @@ int r600_dma_cs_parse(struct radeon_cs_parser *p)
                                }
                                p->idx += 7;
                        } else {
-                               src_offset = ib[idx+2];
-                               src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32;
-                               dst_offset = ib[idx+1];
-                               dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
+                               if (p->family >= CHIP_RV770) {
+                                       src_offset = ib[idx+2];
+                                       src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32;
+                                       dst_offset = ib[idx+1];
+                                       dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
 
-                               ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
-                               ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
-                               ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff;
-                               ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
-                               p->idx += 5;
+                                       ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
+                                       ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
+                                       ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff;
+                                       ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
+                                       p->idx += 5;
+                               } else {
+                                       src_offset = ib[idx+2];
+                                       src_offset |= ((u64)(ib[idx+3] & 0xff)) << 32;
+                                       dst_offset = ib[idx+1];
+                                       dst_offset |= ((u64)(ib[idx+3] & 0xff0000)) << 16;
+
+                                       ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc);
+                                       ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc);
+                                       ib[idx+3] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff;
+                                       ib[idx+3] += (upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff) << 16;
+                                       p->idx += 4;
+                               }
                        }
                        if ((src_offset + (count * 4)) > radeon_bo_size(src_reloc->robj)) {
                                dev_warn(p->dev, "DMA copy src buffer too small (%llu %lu)\n",
index 596bcbe80ed06d5a8e50c271ded50d0a9003afaf..9056fafb00ea35eda70d2a576726abf677808750 100644 (file)
@@ -1140,9 +1140,9 @@ static struct radeon_asic rv770_asic = {
        .copy = {
                .blit = &r600_copy_blit,
                .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
-               .dma = &r600_copy_dma,
+               .dma = &rv770_copy_dma,
                .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
-               .copy = &r600_copy_dma,
+               .copy = &rv770_copy_dma,
                .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
        },
        .surface = {
index 5f4882cc2152eda52e3bf25bf3bd9573bf4e610a..15d70e613076d48e89aff920becbd7e18419a7d8 100644 (file)
@@ -403,6 +403,10 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base);
 void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
 void r700_cp_stop(struct radeon_device *rdev);
 void r700_cp_fini(struct radeon_device *rdev);
+int rv770_copy_dma(struct radeon_device *rdev,
+                 uint64_t src_offset, uint64_t dst_offset,
+                 unsigned num_gpu_pages,
+                  struct radeon_fence **fence);
 
 /*
  * evergreen
index cd756262924d3f9e2f05a970613df77ac0d0af51..edfc54e41842248f4dad035c1ece973ca08837b5 100644 (file)
@@ -896,6 +896,25 @@ static void radeon_check_arguments(struct radeon_device *rdev)
        }
 }
 
+/**
+ * radeon_switcheroo_quirk_long_wakeup - return true if longer d3 delay is
+ * needed for waking up.
+ *
+ * @pdev: pci dev pointer
+ */
+static bool radeon_switcheroo_quirk_long_wakeup(struct pci_dev *pdev)
+{
+
+       /* 6600m in a macbook pro */
+       if (pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE &&
+           pdev->subsystem_device == 0x00e2) {
+               printk(KERN_INFO "radeon: quirking longer d3 wakeup delay\n");
+               return true;
+       }
+
+       return false;
+}
+
 /**
  * radeon_switcheroo_set_state - set switcheroo state
  *
@@ -910,10 +929,19 @@ static void radeon_switcheroo_set_state(struct pci_dev *pdev, enum vga_switchero
        struct drm_device *dev = pci_get_drvdata(pdev);
        pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
        if (state == VGA_SWITCHEROO_ON) {
+               unsigned d3_delay = dev->pdev->d3_delay;
+
                printk(KERN_INFO "radeon: switched on\n");
                /* don't suspend or resume card normally */
                dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
+
+               if (d3_delay < 20 && radeon_switcheroo_quirk_long_wakeup(pdev))
+                       dev->pdev->d3_delay = 20;
+
                radeon_resume_kms(dev);
+
+               dev->pdev->d3_delay = d3_delay;
+
                dev->switch_power_state = DRM_SWITCH_POWER_ON;
                drm_kms_helper_poll_enable(dev);
        } else {
index e09521858f64469cf51b7c8700576d5b6744998e..26c23bb651c6b53835a2061096bdecd4f9d47492 100644 (file)
@@ -194,6 +194,7 @@ struct drm_gem_object *radeon_gem_prime_import(struct drm_device *dev,
                bo = dma_buf->priv;
                if (bo->gem_base.dev == dev) {
                        drm_gem_object_reference(&bo->gem_base);
+                       dma_buf_put(dma_buf);
                        return &bo->gem_base;
                }
        }
index 87c979c4f721c7e3c5a6ab757a29ef07bb6e9788..1b2444f4d8f4ffa7327fd24093704a594389b151 100644 (file)
@@ -887,6 +887,80 @@ static int rv770_mc_init(struct radeon_device *rdev)
        return 0;
 }
 
+/**
+ * rv770_copy_dma - copy pages using the DMA engine
+ *
+ * @rdev: radeon_device pointer
+ * @src_offset: src GPU address
+ * @dst_offset: dst GPU address
+ * @num_gpu_pages: number of GPU pages to xfer
+ * @fence: radeon fence object
+ *
+ * Copy GPU paging using the DMA engine (r7xx).
+ * Used by the radeon ttm implementation to move pages if
+ * registered as the asic copy callback.
+ */
+int rv770_copy_dma(struct radeon_device *rdev,
+                 uint64_t src_offset, uint64_t dst_offset,
+                 unsigned num_gpu_pages,
+                 struct radeon_fence **fence)
+{
+       struct radeon_semaphore *sem = NULL;
+       int ring_index = rdev->asic->copy.dma_ring_index;
+       struct radeon_ring *ring = &rdev->ring[ring_index];
+       u32 size_in_dw, cur_size_in_dw;
+       int i, num_loops;
+       int r = 0;
+
+       r = radeon_semaphore_create(rdev, &sem);
+       if (r) {
+               DRM_ERROR("radeon: moving bo (%d).\n", r);
+               return r;
+       }
+
+       size_in_dw = (num_gpu_pages << RADEON_GPU_PAGE_SHIFT) / 4;
+       num_loops = DIV_ROUND_UP(size_in_dw, 0xFFFF);
+       r = radeon_ring_lock(rdev, ring, num_loops * 5 + 8);
+       if (r) {
+               DRM_ERROR("radeon: moving bo (%d).\n", r);
+               radeon_semaphore_free(rdev, &sem, NULL);
+               return r;
+       }
+
+       if (radeon_fence_need_sync(*fence, ring->idx)) {
+               radeon_semaphore_sync_rings(rdev, sem, (*fence)->ring,
+                                           ring->idx);
+               radeon_fence_note_sync(*fence, ring->idx);
+       } else {
+               radeon_semaphore_free(rdev, &sem, NULL);
+       }
+
+       for (i = 0; i < num_loops; i++) {
+               cur_size_in_dw = size_in_dw;
+               if (cur_size_in_dw > 0xFFFF)
+                       cur_size_in_dw = 0xFFFF;
+               size_in_dw -= cur_size_in_dw;
+               radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
+               radeon_ring_write(ring, dst_offset & 0xfffffffc);
+               radeon_ring_write(ring, src_offset & 0xfffffffc);
+               radeon_ring_write(ring, upper_32_bits(dst_offset) & 0xff);
+               radeon_ring_write(ring, upper_32_bits(src_offset) & 0xff);
+               src_offset += cur_size_in_dw * 4;
+               dst_offset += cur_size_in_dw * 4;
+       }
+
+       r = radeon_fence_emit(rdev, fence, ring->idx);
+       if (r) {
+               radeon_ring_unlock_undo(rdev, ring);
+               return r;
+       }
+
+       radeon_ring_unlock_commit(rdev, ring);
+       radeon_semaphore_free(rdev, &sem, *fence);
+
+       return r;
+}
+
 static int rv770_startup(struct radeon_device *rdev)
 {
        struct radeon_ring *ring;
index 9e9c5d2a5c748a910fcd29a856c128d25a4f8ae0..d73d6e3e17b2927c6215213e872e155a3badbfab 100644 (file)
@@ -654,11 +654,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
                 */
 
                set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
+
+               /* ttm_buffer_object_transfer accesses bo->sync_obj */
+               ret = ttm_buffer_object_transfer(bo, &ghost_obj);
                spin_unlock(&bdev->fence_lock);
                if (tmp_obj)
                        driver->sync_obj_unref(&tmp_obj);
 
-               ret = ttm_buffer_object_transfer(bo, &ghost_obj);
                if (ret)
                        return ret;
 
index 653487dc7b52c58d69f42723cd5e572dfddc90a0..87fa5919c455224f8ee6ab47a4bae742e7fc801f 100644 (file)
@@ -1821,6 +1821,11 @@ static int nv_alloc_rx(struct net_device *dev)
                                                             skb->data,
                                                             skb_tailroom(skb),
                                                             PCI_DMA_FROMDEVICE);
+                       if (pci_dma_mapping_error(np->pci_dev,
+                                                 np->put_rx_ctx->dma)) {
+                               kfree_skb(skb);
+                               goto packet_dropped;
+                       }
                        np->put_rx_ctx->dma_len = skb_tailroom(skb);
                        np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma);
                        wmb();
@@ -1830,6 +1835,7 @@ static int nv_alloc_rx(struct net_device *dev)
                        if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
                                np->put_rx_ctx = np->first_rx_ctx;
                } else {
+packet_dropped:
                        u64_stats_update_begin(&np->swstats_rx_syncp);
                        np->stat_rx_dropped++;
                        u64_stats_update_end(&np->swstats_rx_syncp);
@@ -1856,6 +1862,11 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
                                                             skb->data,
                                                             skb_tailroom(skb),
                                                             PCI_DMA_FROMDEVICE);
+                       if (pci_dma_mapping_error(np->pci_dev,
+                                                 np->put_rx_ctx->dma)) {
+                               kfree_skb(skb);
+                               goto packet_dropped;
+                       }
                        np->put_rx_ctx->dma_len = skb_tailroom(skb);
                        np->put_rx.ex->bufhigh = cpu_to_le32(dma_high(np->put_rx_ctx->dma));
                        np->put_rx.ex->buflow = cpu_to_le32(dma_low(np->put_rx_ctx->dma));
@@ -1866,6 +1877,7 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
                        if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
                                np->put_rx_ctx = np->first_rx_ctx;
                } else {
+packet_dropped:
                        u64_stats_update_begin(&np->swstats_rx_syncp);
                        np->stat_rx_dropped++;
                        u64_stats_update_end(&np->swstats_rx_syncp);
@@ -2217,6 +2229,15 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
                bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
                np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
                                                PCI_DMA_TODEVICE);
+               if (pci_dma_mapping_error(np->pci_dev,
+                                         np->put_tx_ctx->dma)) {
+                       /* on DMA mapping error - drop the packet */
+                       kfree_skb(skb);
+                       u64_stats_update_begin(&np->swstats_tx_syncp);
+                       np->stat_tx_dropped++;
+                       u64_stats_update_end(&np->swstats_tx_syncp);
+                       return NETDEV_TX_OK;
+               }
                np->put_tx_ctx->dma_len = bcnt;
                np->put_tx_ctx->dma_single = 1;
                put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma);
@@ -2337,6 +2358,15 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
                bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
                np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
                                                PCI_DMA_TODEVICE);
+               if (pci_dma_mapping_error(np->pci_dev,
+                                         np->put_tx_ctx->dma)) {
+                       /* on DMA mapping error - drop the packet */
+                       kfree_skb(skb);
+                       u64_stats_update_begin(&np->swstats_tx_syncp);
+                       np->stat_tx_dropped++;
+                       u64_stats_update_end(&np->swstats_tx_syncp);
+                       return NETDEV_TX_OK;
+               }
                np->put_tx_ctx->dma_len = bcnt;
                np->put_tx_ctx->dma_single = 1;
                put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma));
@@ -5003,6 +5033,11 @@ static int nv_loopback_test(struct net_device *dev)
        test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data,
                                       skb_tailroom(tx_skb),
                                       PCI_DMA_FROMDEVICE);
+       if (pci_dma_mapping_error(np->pci_dev,
+                                 test_dma_addr)) {
+               dev_kfree_skb_any(tx_skb);
+               goto out;
+       }
        pkt_data = skb_put(tx_skb, pkt_len);
        for (i = 0; i < pkt_len; i++)
                pkt_data[i] = (u8)(i & 0xff);
index 91d7cb9728eb5998afc44c0bbaec395243524d01..6a1ca500e61267e9ba8858d3ed7405990b28e43d 100644 (file)
@@ -458,6 +458,7 @@ static const struct usb_device_id products[] = {
        {QMI_FIXED_INTF(0x1199, 0x68a2, 8)},    /* Sierra Wireless MC7710 in QMI mode */
        {QMI_FIXED_INTF(0x1199, 0x68a2, 19)},   /* Sierra Wireless MC7710 in QMI mode */
        {QMI_FIXED_INTF(0x1199, 0x901c, 8)},    /* Sierra Wireless EM7700 */
+       {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)},    /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
 
        /* 4. Gobi 1000 devices */
        {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)},    /* Acer Gobi Modem Device */
index 40f2cc135a491a32d4ee4a6059f1ead869bc876d..656230e0d18c7bb1f79892910c56a341f856d862 100644 (file)
@@ -1191,6 +1191,7 @@ static void vxlan_setup(struct net_device *dev)
 
        dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
        dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
+       dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
        spin_lock_init(&vxlan->hash_lock);
 
index 5fc15bf8be09449cffe2a7b19a47843ad615af7b..7647ed6b73d770278ca63875c314bcce9f98ddf2 100644 (file)
@@ -2,6 +2,7 @@ config ATH9K_HW
        tristate
 config ATH9K_COMMON
        tristate
+       select ATH_COMMON
 config ATH9K_DFS_DEBUGFS
        def_bool y
        depends on ATH9K_DEBUGFS && ATH9K_DFS_CERTIFIED
@@ -17,7 +18,6 @@ config ATH9K_BTCOEX_SUPPORT
 config ATH9K
        tristate "Atheros 802.11n wireless cards support"
        depends on MAC80211
-       select ATH_COMMON
        select ATH9K_HW
        select MAC80211_LEDS
        select LEDS_CLASS
@@ -56,7 +56,8 @@ config ATH9K_AHB
 
 config ATH9K_DEBUGFS
        bool "Atheros ath9k debugging"
-       depends on ATH9K && DEBUG_FS
+       depends on ATH9K
+       select MAC80211_DEBUGFS
        ---help---
          Say Y, if you need access to ath9k's statistics for
          interrupts, rate control, etc.
index 74fd3977feeb845adf93f6ed0fd650d506ca2ee1..59bf5f31e212c07bfef14251384aa3f5d2de0c8b 100644 (file)
@@ -544,7 +544,7 @@ static void ar9003_rx_gain_table_mode0(struct ath_hw *ah)
                                ar9340Common_rx_gain_table_1p0);
        else if (AR_SREV_9485_11(ah))
                INIT_INI_ARRAY(&ah->iniModesRxGain,
-                               ar9485Common_wo_xlna_rx_gain_1_1);
+                              ar9485_common_rx_gain_1_1);
        else if (AR_SREV_9550(ah)) {
                INIT_INI_ARRAY(&ah->iniModesRxGain,
                                ar955x_1p0_common_rx_gain_table);
index aaebecd19e5975f449bdd73bcc9c73411b6f37af..63fd9af3fd39dd2c1d7ddb183902ae5e587b1ada 100644 (file)
@@ -336,8 +336,12 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len)
                if (SUPP(CARL9170FW_WLANTX_CAB)) {
                        if_comb_types |=
                                BIT(NL80211_IFTYPE_AP) |
-                               BIT(NL80211_IFTYPE_MESH_POINT) |
                                BIT(NL80211_IFTYPE_P2P_GO);
+
+#ifdef CONFIG_MAC80211_MESH
+                       if_comb_types |=
+                               BIT(NL80211_IFTYPE_MESH_POINT);
+#endif /* CONFIG_MAC80211_MESH */
                }
        }
 
index 1261a9b84e04aaf348df15e8bb2ad0e00a213255..75464ad4fbd188ce1fb135302539dfa02caa3fbb 100644 (file)
@@ -3091,10 +3091,11 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie,
 
        len = wpa_ie->len + TLV_HDR_LEN;
        data = (u8 *)wpa_ie;
-       offset = 0;
+       offset = TLV_HDR_LEN;
        if (!is_rsn_ie)
                offset += VS_IE_FIXED_HDR_LEN;
-       offset += WPA_IE_VERSION_LEN;
+       else
+               offset += WPA_IE_VERSION_LEN;
 
        /* check for multicast cipher suite */
        if (offset + WPA_IE_MIN_OUI_LEN > len) {
index 796836b0f4699ccf07cdb73bc1acdd6122b60e33..822781cf15d41900aabd941fe79956191e1328ed 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012 Broadcom Corporation
+ * Copyright (c) 2012 Canonical Ltd.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
index 606b534347bc93984cb9aefb38acd6981f3af8de..21a824232478f2ac02d593495ac5fe82ff94df77 100644 (file)
@@ -1343,13 +1343,13 @@ static bool wlc_lcnphy_rx_iq_cal_gain(struct brcms_phy *pi, u16 biq1_gain,
 
        wlc_lcnphy_rx_gain_override_enable(pi, true);
        wlc_lcnphy_start_tx_tone(pi, 2000, (40 >> 1), 0);
-       usleep_range(500, 500);
+       udelay(500);
        write_radio_reg(pi, RADIO_2064_REG112, 0);
        if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_l))
                return false;
 
        wlc_lcnphy_start_tx_tone(pi, 2000, 40, 0);
-       usleep_range(500, 500);
+       udelay(500);
        write_radio_reg(pi, RADIO_2064_REG112, 0);
        if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_h))
                return false;
index e71c702e2eb18e30640cd193307bb54569410b48..800a16526c8ea548b17d67ab0f7d30a50b0cc327 100644 (file)
@@ -47,6 +47,7 @@ static struct usb_device_id p54u_table[] = {
        {USB_DEVICE(0x0411, 0x0050)},   /* Buffalo WLI2-USB2-G54 */
        {USB_DEVICE(0x045e, 0x00c2)},   /* Microsoft MN-710 */
        {USB_DEVICE(0x0506, 0x0a11)},   /* 3COM 3CRWE254G72 */
+       {USB_DEVICE(0x0675, 0x0530)},   /* DrayTek Vigor 530 */
        {USB_DEVICE(0x06b9, 0x0120)},   /* Thomson SpeedTouch 120g */
        {USB_DEVICE(0x0707, 0xee06)},   /* SMC 2862W-G */
        {USB_DEVICE(0x07aa, 0x001c)},   /* Corega CG-WLUSB2GT */
@@ -82,6 +83,8 @@ static struct usb_device_id p54u_table[] = {
        {USB_DEVICE(0x06a9, 0x000e)},   /* Westell 802.11g USB (A90-211WG-01) */
        {USB_DEVICE(0x06b9, 0x0121)},   /* Thomson SpeedTouch 121g */
        {USB_DEVICE(0x0707, 0xee13)},   /* SMC 2862W-G version 2 */
+       {USB_DEVICE(0x0803, 0x4310)},   /* Zoom 4410a */
+       {USB_DEVICE(0x083a, 0x4503)},   /* T-Com Sinus 154 data II */
        {USB_DEVICE(0x083a, 0x4521)},   /* Siemens Gigaset USB Adapter 54 version 2 */
        {USB_DEVICE(0x083a, 0xc501)},   /* Zoom Wireless-G 4410 */
        {USB_DEVICE(0x083a, 0xf503)},   /* Accton FD7050E ver 1010ec  */
@@ -101,6 +104,7 @@ static struct usb_device_id p54u_table[] = {
        {USB_DEVICE(0x13B1, 0x000C)},   /* Linksys WUSB54AG */
        {USB_DEVICE(0x1413, 0x5400)},   /* Telsey 802.11g USB2.0 Adapter */
        {USB_DEVICE(0x1435, 0x0427)},   /* Inventel UR054G */
+       /* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */
        {USB_DEVICE(0x1668, 0x1050)},   /* Actiontec 802UIG-1 */
        {USB_DEVICE(0x1740, 0x1000)},   /* Senao NUB-350 */
        {USB_DEVICE(0x2001, 0x3704)},   /* DLink DWL-G122 rev A2 */
index 3deacafdcd5ed3c33c1384a9f5e84e4cd08517e8..4261e8ecc4c382d84a9b19c40d8fed2b463d5a5a 100644 (file)
@@ -743,6 +743,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 
 done:
                bufferaddress = (*((dma_addr_t *)skb->cb));
+               if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress))
+                       return;
                tmp_one = 1;
                rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
                                            HW_DESC_RXBUFF_ADDR,
@@ -1115,6 +1117,10 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
                                           PCI_DMA_FROMDEVICE);
 
                        bufferaddress = (*((dma_addr_t *)skb->cb));
+                       if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) {
+                               dev_kfree_skb_any(skb);
+                               return 1;
+                       }
                        rtlpriv->cfg->ops->set_desc((u8 *)entry, false,
                                                    HW_DESC_RXBUFF_ADDR,
                                                    (u8 *)&bufferaddress);
index 173424756149b95d7d1bc9ea6eb9981fa6603130..c31795e379f7e16a1a5a208f10af3d994eff3b66 100644 (file)
@@ -611,8 +611,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
        dma_addr_t mapping = pci_map_single(rtlpci->pdev,
                                            skb->data, skb->len,
                                            PCI_DMA_TODEVICE);
+
        u8 bw_40 = 0;
 
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        rcu_read_lock();
        sta = get_sta(hw, mac->vif, mac->bssid);
        if (mac->opmode == NL80211_IFTYPE_STATION) {
@@ -774,6 +780,11 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
        __le16 fc = hdr->frame_control;
 
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 
        if (firstseg)
index f9f3861046c1f6c4deb0a9454b872ca260618f16..a0fbf284420ec78b2570756dc4c1edd2638be057 100644 (file)
@@ -587,6 +587,11 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
        buf_len = skb->len;
        mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
                                 PCI_DMA_TODEVICE);
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92d));
        if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) {
                firstseg = true;
@@ -740,6 +745,11 @@ void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
        __le16 fc = hdr->frame_control;
 
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
        if (firstseg)
                SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN);
index 0e9f6ebf078add38ded9595f6a454b8182148335..206561d7282f906a6662ce43610f87666362dbe3 100644 (file)
@@ -611,6 +611,11 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
                    PCI_DMA_TODEVICE);
        u8 bw_40 = 0;
 
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        if (mac->opmode == NL80211_IFTYPE_STATION) {
                bw_40 = mac->bw_40;
        } else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -763,6 +768,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
 void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
        bool firstseg, bool lastseg, struct sk_buff *skb)
 {
+       struct rtl_priv *rtlpriv = rtl_priv(hw);
        struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
        struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
        struct rtl_tcb_desc *tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
@@ -770,7 +776,12 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
        dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
                        PCI_DMA_TODEVICE);
 
-    /* Clear all status        */
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
+       /* Clear all status     */
        CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_CMDDESC_SIZE_RTL8192S);
 
        /* This bit indicate this packet is used for FW download. */
index 87331d826d73aa6bda0b4ee4a1f9a7da16dc7639..a313be8c21d28d5708fdbc34e49f0db3fa7836a2 100644 (file)
@@ -387,6 +387,11 @@ void rtl8723ae_tx_fill_desc(struct ieee80211_hw *hw,
                                            PCI_DMA_TODEVICE);
        u8 bw_40 = 0;
 
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        if (mac->opmode == NL80211_IFTYPE_STATION) {
                bw_40 = mac->bw_40;
        } else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -542,6 +547,11 @@ void rtl8723ae_tx_fill_cmddesc(struct ieee80211_hw *hw,
                                            PCI_DMA_TODEVICE);
        __le16 fc = hdr->frame_control;
 
+       if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
+               RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
+                        "DMA mapping error");
+               return;
+       }
        CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
 
        if (firstseg)
index 29f0969e4ba00cd3dd299c209ac09f594346b168..f2ecdeb3a90d441ee809af029a1db1c8dab80f48 100644 (file)
@@ -210,17 +210,16 @@ static void _usb_writeN_sync(struct rtl_priv *rtlpriv, u32 addr, void *data,
        u16 index = REALTEK_USB_VENQT_CMD_IDX;
        int pipe = usb_sndctrlpipe(udev, 0); /* write_out */
        u8 *buffer;
-       dma_addr_t dma_addr;
 
-       wvalue = (u16)(addr&0x0000ffff);
-       buffer = usb_alloc_coherent(udev, (size_t)len, GFP_ATOMIC, &dma_addr);
+       wvalue = (u16)(addr & 0x0000ffff);
+       buffer = kmalloc(len, GFP_ATOMIC);
        if (!buffer)
                return;
        memcpy(buffer, data, len);
        usb_control_msg(udev, pipe, request, reqtype, wvalue,
                        index, buffer, len, 50);
 
-       usb_free_coherent(udev, (size_t)len, buffer, dma_addr);
+       kfree(buffer);
 }
 
 static void _rtl_usb_io_handler_init(struct device *dev,
@@ -640,6 +639,7 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
                        RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
                                 "Failed to prep_rx_urb!!\n");
                        err = PTR_ERR(skb);
+                       usb_free_urb(urb);
                        goto err_out;
                }
 
index c26e28b4bd9f985a4d7c6d3307d969bb671bf6f7..7ffa43bd7cf9e9f3b1fc43f83d0ec4c53b355765 100644 (file)
@@ -1015,29 +1015,10 @@ err:
                i = xennet_fill_frags(np, skb, &tmpq);
 
                /*
-                * Truesize approximates the size of true data plus
-                * any supervisor overheads. Adding hypervisor
-                * overheads has been shown to significantly reduce
-                * achievable bandwidth with the default receive
-                * buffer size. It is therefore not wise to account
-                * for it here.
-                *
-                * After alloc_skb(RX_COPY_THRESHOLD), truesize is set
-                * to RX_COPY_THRESHOLD + the supervisor
-                * overheads. Here, we add the size of the data pulled
-                * in xennet_fill_frags().
-                *
-                * We also adjust for any unused space in the main
-                * data area by subtracting (RX_COPY_THRESHOLD -
-                * len). This is especially important with drivers
-                * which split incoming packets into header and data,
-                * using only 66 bytes of the main data area (see the
-                * e1000 driver for example.)  On such systems,
-                * without this last adjustement, our achievable
-                * receive throughout using the standard receive
-                * buffer size was cut by 25%(!!!).
-                */
-               skb->truesize += skb->data_len - RX_COPY_THRESHOLD;
+                 * Truesize is the actual allocation size, even if the
+                 * allocation is only partially used.
+                 */
+               skb->truesize += PAGE_SIZE * skb_shinfo(skb)->nr_frags;
                skb->len += skb->data_len;
 
                if (rx->flags & XEN_NETRXF_csum_blank)
index 750dea78f53a401f10800cc94bd9d9596195041b..69aba3697287d02e749fc5c27155c026518601b7 100644 (file)
@@ -595,8 +595,11 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
         * grab clk to make sure it is ticking.
         */
        clk = devm_clk_get(&pdev->dev, NULL);
-       if (!IS_ERR(clk))
-               clk_prepare_enable(clk);
+       if (IS_ERR(clk)) {
+               dev_err(&pdev->dev, "Unable to get pdma clock");
+               return PTR_RET(clk);
+       }
+       clk_prepare_enable(clk);
 
        return mvebu_pinctrl_probe(pdev);
 }
index 06074248ba7ac55fad9fbfe538f7444d8f6b65a5..e290d48ddd99cab71f1effff5ae87243a11e560a 100644 (file)
@@ -29,15 +29,16 @@ static int gpio_active_low;
 
 static void gpio_poweroff_do_poweroff(void)
 {
-       BUG_ON(gpio_num == -1);
+       BUG_ON(!gpio_is_valid(gpio_num));
 
-       /* drive it active */
+       /* drive it active, also inactive->active edge */
        gpio_direction_output(gpio_num, !gpio_active_low);
        mdelay(100);
-       /* rising edge or drive inactive */
+       /* drive inactive, also active->inactive edge */
        gpio_set_value(gpio_num, gpio_active_low);
        mdelay(100);
-       /* falling edge */
+
+       /* drive it active, also inactive->active edge */
        gpio_set_value(gpio_num, !gpio_active_low);
 
        /* give it some time */
@@ -60,15 +61,12 @@ static int gpio_poweroff_probe(struct platform_device *pdev)
        }
 
        gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
-       if (gpio_num < 0) {
-               pr_err("%s: Could not get GPIO configuration: %d",
-                      __func__, gpio_num);
-               return -ENODEV;
-       }
+       if (!gpio_is_valid(gpio_num))
+               return gpio_num;
+
        gpio_active_low = flags & OF_GPIO_ACTIVE_LOW;
 
-       if (of_get_property(pdev->dev.of_node, "input", NULL))
-               input = true;
+       input = of_property_read_bool(pdev->dev.of_node, "input");
 
        ret = gpio_request(gpio_num, "poweroff-gpio");
        if (ret) {
@@ -98,8 +96,7 @@ err:
 
 static int gpio_poweroff_remove(struct platform_device *pdev)
 {
-       if (gpio_num != -1)
-               gpio_free(gpio_num);
+       gpio_free(gpio_num);
        if (pm_power_off == &gpio_poweroff_do_poweroff)
                pm_power_off = NULL;
 
@@ -115,15 +112,15 @@ static struct platform_driver gpio_poweroff_driver = {
        .probe = gpio_poweroff_probe,
        .remove = gpio_poweroff_remove,
        .driver = {
-                  .name = "poweroff-gpio",
-                  .owner = THIS_MODULE,
-                  .of_match_table = of_gpio_poweroff_match,
-                  },
+               .name = "poweroff-gpio",
+               .owner = THIS_MODULE,
+               .of_match_table = of_gpio_poweroff_match,
+       },
 };
 
 module_platform_driver(gpio_poweroff_driver);
 
 MODULE_AUTHOR("Jamie Lentin <jm@lentin.co.uk>");
 MODULE_DESCRIPTION("GPIO poweroff driver");
-MODULE_LICENSE("GPL");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("platform:poweroff-gpio");
index ff3c8a21f10d90397dc9fda07b99dcfb08ebc9b9..5d6f2ec1c705f4ede0ced96ca75efdf8495879d6 100644 (file)
@@ -162,8 +162,7 @@ config SSB_DRIVER_GIGE
 
 config SSB_DRIVER_GPIO
        bool "SSB GPIO driver"
-       depends on SSB
-       select GPIOLIB
+       depends on SSB && GPIOLIB
        help
          Driver to provide access to the GPIO pins on the bus.
 
index 9a302062b031d4ea70d8205523aea7694dc5e54f..ea3840038250391bb3e3e0c897fc07a246b67732 100644 (file)
@@ -207,7 +207,12 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
                obj = buffer->priv;
                /* is it from our device? */
                if (obj->dev == dev) {
+                       /*
+                        * Importing dmabuf exported from out own gem increases
+                        * refcount on gem itself instead of f_count of dmabuf.
+                        */
                        drm_gem_object_reference(obj);
+                       dma_buf_put(buffer);
                        return obj;
                }
        }
index a45b37c2e88ea6845066da518d6dd485c9bdcba9..755556ca5b2d988ec68b8cc3c1f9bbe7aadf6a34 100644 (file)
@@ -369,7 +369,8 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
                loop--;
        }
 
-       writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR);
+       reg = readl(host->base + LCDC_VDCTRL4);
+       writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4);
 
        clk_disable_unprepare(host->clk);
 
index 8890604e3fcdd638d6d150ffbfc981a783467dfe..6909d89d0da56ffd929a2114b0228a03d1f35589 100644 (file)
@@ -696,8 +696,10 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
                return -EINVAL;
 
        more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
-       if (sd->len < sd->total_len)
+
+       if (sd->len < sd->total_len && pipe->nrbufs > 1)
                more |= MSG_SENDPAGE_NOTLAST;
+
        return file->f_op->sendpage(file, buf->page, buf->offset,
                                    sd->len, &pos, more);
 }
index 808dad29607a17790c0bf9b69ba5493e021e3bfd..d6aeaf3c6d6cb69ad039ec18bddd559cf32f8d62 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 #ifndef _EXYNOS_DRM_H_
 #define _EXYNOS_DRM_H_
index abb2cd50f6b26ace7da7a554527087d4685d3e76..04421e82536596c5aeb7a28b35e142556c821598 100644 (file)
@@ -128,7 +128,6 @@ struct cred {
        struct key      *process_keyring; /* keyring private to this process */
        struct key      *thread_keyring; /* keyring private to this thread */
        struct key      *request_key_auth; /* assumed request_key authority */
-       struct thread_group_cred *tgcred; /* thread-group shared credentials */
 #endif
 #ifdef CONFIG_SECURITY
        void            *security;      /* subjective LSM security */
index a1d83cc8bf859d356b9d4b437c4d03590fa25453..923cb20051edfbb93a3fb84c8c78b7dae0993c82 100644 (file)
@@ -71,6 +71,7 @@ struct netns_ct {
        struct hlist_head       *expect_hash;
        struct hlist_nulls_head unconfirmed;
        struct hlist_nulls_head dying;
+       struct hlist_nulls_head tmpl;
        struct ip_conntrack_stat __percpu *stat;
        struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
        struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
index 591db7d657a37d42107b38582cd8a45ad5838552..c24060ee411e9e15a91a0fc5bd189eef8425869b 100644 (file)
@@ -8,6 +8,7 @@ struct ebt_table;
 
 struct netns_xt {
        struct list_head tables[NFPROTO_NUMPROTO];
+       bool notrack_deprecated_warning;
 #if defined(CONFIG_BRIDGE_NF_EBTABLES) || \
     defined(CONFIG_BRIDGE_NF_EBTABLES_MODULE)
        struct ebt_table *broute_table;
index e7f52c334005bb3b461005a4be97620048053676..d5844122ff329dabf4d5c8431f138f48a86d0ed3 100644 (file)
@@ -6,24 +6,10 @@
  *     Joonyoung Shim <jy0922.shim@samsung.com>
  *     Seung-Woo Kim <sw0312.kim@samsung.com>
  *
- * 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 (including the next
- * paragraph) 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
- * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS 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.
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
  */
 
 #ifndef _UAPI_EXYNOS_DRM_H_
@@ -185,6 +171,8 @@ enum drm_exynos_flip {
        EXYNOS_DRM_FLIP_NONE = (0 << 0),
        EXYNOS_DRM_FLIP_VERTICAL = (1 << 0),
        EXYNOS_DRM_FLIP_HORIZONTAL = (1 << 1),
+       EXYNOS_DRM_FLIP_BOTH = EXYNOS_DRM_FLIP_VERTICAL |
+                       EXYNOS_DRM_FLIP_HORIZONTAL,
 };
 
 enum drm_exynos_degree {
index 49fb1cf0861172b2860538e7c48afa0279087794..bb1369f7b9b4ba8af51d90a40de8f522aa2470dc 100644 (file)
@@ -3711,6 +3711,14 @@ retry:
                if (pmd_trans_huge(orig_pmd)) {
                        unsigned int dirty = flags & FAULT_FLAG_WRITE;
 
+                       /*
+                        * If the pmd is splitting, return and retry the
+                        * the fault.  Alternative: wait until the split
+                        * is done, and goto retry.
+                        */
+                       if (pmd_trans_splitting(orig_pmd))
+                               return 0;
+
                        if (pmd_numa(orig_pmd))
                                return do_huge_pmd_numa_page(mm, vma, address,
                                                             orig_pmd, pmd);
index 5391ca43336a7d518c1640f855ecc7b739ce7226..6d6f26531de227004450456065fc51a8ee0c7c73 100644 (file)
@@ -1608,7 +1608,6 @@ void br_multicast_init(struct net_bridge *br)
                    br_multicast_querier_expired, (unsigned long)br);
        setup_timer(&br->multicast_query_timer, br_multicast_query_expired,
                    (unsigned long)br);
-       br_mdb_init();
 }
 
 void br_multicast_open(struct net_bridge *br)
@@ -1633,7 +1632,6 @@ void br_multicast_stop(struct net_bridge *br)
        del_timer_sync(&br->multicast_querier_timer);
        del_timer_sync(&br->multicast_query_timer);
 
-       br_mdb_uninit();
        spin_lock_bh(&br->multicast_lock);
        mdb = mlock_dereference(br->mdb, br);
        if (!mdb)
index 97ba0189c6f7c0cdba7c83491db620e2b409ae77..5dc66abcc9e22c93bb4f70f5a219f730bab63275 100644 (file)
@@ -299,10 +299,21 @@ struct rtnl_link_ops br_link_ops __read_mostly = {
 
 int __init br_netlink_init(void)
 {
-       return rtnl_link_register(&br_link_ops);
+       int err;
+
+       br_mdb_init();
+       err = rtnl_link_register(&br_link_ops);
+       if (err)
+               goto out;
+
+       return 0;
+out:
+       br_mdb_uninit();
+       return err;
 }
 
 void __exit br_netlink_fini(void)
 {
+       br_mdb_uninit();
        rtnl_link_unregister(&br_link_ops);
 }
index 8d83be5ffedcd8d04fdff6edf715947f56a1fbcc..711094aed41a29f967cf925c1863f569dff023d0 100644 (file)
@@ -526,6 +526,12 @@ static inline bool br_multicast_is_router(struct net_bridge *br)
 {
        return 0;
 }
+static inline void br_mdb_init(void)
+{
+}
+static inline void br_mdb_uninit(void)
+{
+}
 #endif
 
 /* br_netfilter.c */
index cc06a47f12163ad8b93cae060a8c211bb13fcc73..a8e4f2665d5e6687c28438de69586673be9b3484 100644 (file)
@@ -823,9 +823,9 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
                if (!ifa) {
                        ret = -ENOBUFS;
                        ifa = inet_alloc_ifa();
-                       INIT_HLIST_NODE(&ifa->hash);
                        if (!ifa)
                                break;
+                       INIT_HLIST_NODE(&ifa->hash);
                        if (colon)
                                memcpy(ifa->ifa_label, ifr.ifr_name, IFNAMSIZ);
                        else
index d763701cff1b4aca032e60f335a4208e054a4e06..a2e50ae80b53361ca30c718dce7e85b5e4e7c66c 100644 (file)
@@ -136,6 +136,8 @@ __be32 ic_myaddr = NONE;            /* My IP address */
 static __be32 ic_netmask = NONE;       /* Netmask for local subnet */
 __be32 ic_gateway = NONE;      /* Gateway IP address */
 
+__be32 ic_addrservaddr = NONE; /* IP Address of the IP addresses'server */
+
 __be32 ic_servaddr = NONE;     /* Boot server IP address */
 
 __be32 root_server_addr = NONE;        /* Address of NFS server */
@@ -558,6 +560,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
        if (ic_myaddr == NONE)
                ic_myaddr = tip;
        ic_servaddr = sip;
+       ic_addrservaddr = sip;
        ic_got_reply = IC_RARP;
 
 drop_unlock:
@@ -1068,7 +1071,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
                                ic_servaddr = server_id;
 #ifdef IPCONFIG_DEBUG
                                printk("DHCP: Offered address %pI4 by server %pI4\n",
-                                      &ic_myaddr, &ic_servaddr);
+                                      &ic_myaddr, &b->iph.saddr);
 #endif
                                /* The DHCP indicated server address takes
                                 * precedence over the bootp header one if
@@ -1113,6 +1116,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
        ic_dev = dev;
        ic_myaddr = b->your_ip;
        ic_servaddr = b->server_ip;
+       ic_addrservaddr = b->iph.saddr;
        if (ic_gateway == NONE && b->relay_ip)
                ic_gateway = b->relay_ip;
        if (ic_nameservers[0] == NONE)
@@ -1268,7 +1272,7 @@ static int __init ic_dynamic(void)
        printk("IP-Config: Got %s answer from %pI4, ",
                ((ic_got_reply & IC_RARP) ? "RARP"
                 : (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
-              &ic_servaddr);
+              &ic_addrservaddr);
        pr_cont("my address is %pI4\n", &ic_myaddr);
 
        return 0;
index 51f13f8ec724f8c5dad543073e8a0d82639b555a..04b18c1ac3458503a2b5d79bd7fd1547c13e76d7 100644 (file)
@@ -81,6 +81,7 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        niph->saddr     = oiph->daddr;
        niph->daddr     = oiph->saddr;
 
+       skb_reset_transport_header(nskb);
        tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
        memset(tcph, 0, sizeof(*tcph));
        tcph->source    = oth->dest;
index da2c8a368f68d9c6b72c605593aa5b83e0622344..eeaff7e4acb5c8da1c042769ac4c805579260bef 100644 (file)
@@ -124,23 +124,28 @@ nf_nat_ipv4_fn(unsigned int hooknum,
                        ret = nf_nat_rule_find(skb, hooknum, in, out, ct);
                        if (ret != NF_ACCEPT)
                                return ret;
-               } else
+               } else {
                        pr_debug("Already setup manip %s for ct %p\n",
                                 maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST",
                                 ct);
+                       if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
+                               goto oif_changed;
+               }
                break;
 
        default:
                /* ESTABLISHED */
                NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED ||
                             ctinfo == IP_CT_ESTABLISHED_REPLY);
-               if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) {
-                       nf_ct_kill_acct(ct, ctinfo, skb);
-                       return NF_DROP;
-               }
+               if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
+                       goto oif_changed;
        }
 
        return nf_nat_packet(ct, ctinfo, hooknum, skb);
+
+oif_changed:
+       nf_ct_kill_acct(ct, ctinfo, skb);
+       return NF_DROP;
 }
 
 static unsigned int
index e9486915eff6e9b8e71038e48e3bc85c483dee02..7302b0b7b642e91257b119c5b89938f4ac2846e6 100644 (file)
 #include <linux/netfilter_ipv6/ip6t_NPT.h>
 #include <linux/netfilter/x_tables.h>
 
-static __sum16 csum16_complement(__sum16 a)
-{
-       return (__force __sum16)(0xffff - (__force u16)a);
-}
-
-static __sum16 csum16_add(__sum16 a, __sum16 b)
-{
-       u16 sum;
-
-       sum = (__force u16)a + (__force u16)b;
-       sum += (__force u16)a < (__force u16)b;
-       return (__force __sum16)sum;
-}
-
-static __sum16 csum16_sub(__sum16 a, __sum16 b)
-{
-       return csum16_add(a, csum16_complement(b));
-}
-
 static int ip6t_npt_checkentry(const struct xt_tgchk_param *par)
 {
        struct ip6t_npt_tginfo *npt = par->targinfo;
-       __sum16 src_sum = 0, dst_sum = 0;
+       __wsum src_sum = 0, dst_sum = 0;
        unsigned int i;
 
        if (npt->src_pfx_len > 64 || npt->dst_pfx_len > 64)
                return -EINVAL;
 
        for (i = 0; i < ARRAY_SIZE(npt->src_pfx.in6.s6_addr16); i++) {
-               src_sum = csum16_add(src_sum,
-                               (__force __sum16)npt->src_pfx.in6.s6_addr16[i]);
-               dst_sum = csum16_add(dst_sum,
-                               (__force __sum16)npt->dst_pfx.in6.s6_addr16[i]);
+               src_sum = csum_add(src_sum,
+                               (__force __wsum)npt->src_pfx.in6.s6_addr16[i]);
+               dst_sum = csum_add(dst_sum,
+                               (__force __wsum)npt->dst_pfx.in6.s6_addr16[i]);
        }
 
-       npt->adjustment = csum16_sub(src_sum, dst_sum);
+       npt->adjustment = (__force __sum16) csum_sub(src_sum, dst_sum);
        return 0;
 }
 
@@ -85,7 +66,7 @@ static bool ip6t_npt_map_pfx(const struct ip6t_npt_tginfo *npt,
                        return false;
        }
 
-       sum = csum16_add((__force __sum16)addr->s6_addr16[idx],
+       sum = (__force __sum16) csum_add((__force __wsum)addr->s6_addr16[idx],
                         npt->adjustment);
        if (sum == CSUM_MANGLED_0)
                sum = 0;
index fd4fb34c51c7f5b9bd62294de2abb6da943ee494..029623dbd4118d18667a83d209131dc64b5ec7c4 100644 (file)
@@ -132,6 +132,7 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
        ip6h->saddr = oip6h->daddr;
        ip6h->daddr = oip6h->saddr;
 
+       skb_reset_transport_header(nskb);
        tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
        /* Truncate to length (no data) */
        tcph->doff = sizeof(struct tcphdr)/4;
index 6c8ae24b85eb15f525e2e43a1b0e7f93068e8d85..e0e788d25b1431624ae9470f0af904803fe5d92a 100644 (file)
@@ -127,23 +127,28 @@ nf_nat_ipv6_fn(unsigned int hooknum,
                        ret = nf_nat_rule_find(skb, hooknum, in, out, ct);
                        if (ret != NF_ACCEPT)
                                return ret;
-               } else
+               } else {
                        pr_debug("Already setup manip %s for ct %p\n",
                                 maniptype == NF_NAT_MANIP_SRC ? "SRC" : "DST",
                                 ct);
+                       if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
+                               goto oif_changed;
+               }
                break;
 
        default:
                /* ESTABLISHED */
                NF_CT_ASSERT(ctinfo == IP_CT_ESTABLISHED ||
                             ctinfo == IP_CT_ESTABLISHED_REPLY);
-               if (nf_nat_oif_changed(hooknum, ctinfo, nat, out)) {
-                       nf_ct_kill_acct(ct, ctinfo, skb);
-                       return NF_DROP;
-               }
+               if (nf_nat_oif_changed(hooknum, ctinfo, nat, out))
+                       goto oif_changed;
        }
 
        return nf_nat_packet(ct, ctinfo, hooknum, skb);
+
+oif_changed:
+       nf_ct_kill_acct(ct, ctinfo, skb);
+       return NF_DROP;
 }
 
 static unsigned int
index 00ee17c3e8939b1076ae2c2026ed6dfa1b3f68de..137e245860ab41a9ec923a8655f538c8cc8d4e52 100644 (file)
@@ -81,8 +81,8 @@ static int ipv6_get_l4proto(const struct sk_buff *skb, unsigned int nhoff,
        }
        protoff = ipv6_skip_exthdr(skb, extoff, &nexthdr, &frag_off);
        /*
-        * (protoff == skb->len) mean that the packet doesn't have no data
-        * except of IPv6 & ext headers. but it's tracked anyway. - YK
+        * (protoff == skb->len) means the packet has not data, just
+        * IPv6 and possibly extensions headers, but it is tracked anyway
         */
        if (protoff < 0 || (frag_off & htons(~0x7)) != 0) {
                pr_debug("ip6_conntrack_core: can't find proto in pkt\n");
index 22c8ea9511852e963b982ad68ed7066bda262ad2..3dacecc9906597e3f44fa9475dda0afb8f4981c2 100644 (file)
@@ -311,7 +311,10 @@ found:
        else
                fq->q.fragments = skb;
 
-       skb->dev = NULL;
+       if (skb->dev) {
+               fq->iif = skb->dev->ifindex;
+               skb->dev = NULL;
+       }
        fq->q.stamp = skb->tstamp;
        fq->q.meat += skb->len;
        if (payload_len > fq->q.max_size)
index 1191039c2b1bc38bda25402dd395d7e3b1bbe7b4..199b92261e94281b7f774d30ba254d0468d204bc 100644 (file)
@@ -389,7 +389,7 @@ void mac802154_wpan_setup(struct net_device *dev)
 
 static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb)
 {
-       return netif_rx(skb);
+       return netif_rx_ni(skb);
 }
 
 static int
index fefa514b99170aae55620e4007565b0ad3e814b4..49e96df5fbc4b38e842540f65c5b23309440c597 100644 (file)
@@ -680,6 +680,13 @@ config NETFILTER_XT_TARGET_NFQUEUE
 
          To compile it as a module, choose M here.  If unsure, say N.
 
+config NETFILTER_XT_TARGET_NOTRACK
+       tristate  '"NOTRACK" target support (DEPRECATED)'
+       depends on NF_CONNTRACK
+       depends on IP_NF_RAW || IP6_NF_RAW
+       depends on NETFILTER_ADVANCED
+       select NETFILTER_XT_TARGET_CT
+
 config NETFILTER_XT_TARGET_RATEEST
        tristate '"RATEEST" target support'
        depends on NETFILTER_ADVANCED
index 08cdc71d8e8714b75782379929fa6b050dafa7f4..016d95ead930cba8e6d2e9335cd2b64f473c09d1 100644 (file)
@@ -1526,6 +1526,7 @@ err_extend:
  */
 #define UNCONFIRMED_NULLS_VAL  ((1<<30)+0)
 #define DYING_NULLS_VAL                ((1<<30)+1)
+#define TEMPLATE_NULLS_VAL     ((1<<30)+2)
 
 static int nf_conntrack_init_net(struct net *net)
 {
@@ -1534,6 +1535,7 @@ static int nf_conntrack_init_net(struct net *net)
        atomic_set(&net->ct.count, 0);
        INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, UNCONFIRMED_NULLS_VAL);
        INIT_HLIST_NULLS_HEAD(&net->ct.dying, DYING_NULLS_VAL);
+       INIT_HLIST_NULLS_HEAD(&net->ct.tmpl, TEMPLATE_NULLS_VAL);
        net->ct.stat = alloc_percpu(struct ip_conntrack_stat);
        if (!net->ct.stat) {
                ret = -ENOMEM;
index 4e078cd84d83c2c15c70ab4270b87a05e590f4ad..627b0e50b2389120e86ed107a3af01d690e07a29 100644 (file)
@@ -2624,7 +2624,7 @@ ctnetlink_create_expect(struct net *net, u16 zone,
        if (!help) {
                if (!cda[CTA_EXPECT_TIMEOUT]) {
                        err = -EINVAL;
-                       goto out;
+                       goto err_out;
                }
                exp->timeout.expires =
                  jiffies + ntohl(nla_get_be32(cda[CTA_EXPECT_TIMEOUT])) * HZ;
index 9f199f2e31fae16ff667e7a1f230e6826d015794..92fd8eca0d315ff241b066e3fab3c6f9fcdaa1bb 100644 (file)
@@ -13,6 +13,7 @@
  */
 #include <linux/module.h>
 #include <linux/skbuff.h>
+#include <linux/if_arp.h>
 #include <linux/init.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
@@ -384,6 +385,7 @@ __build_packet_message(struct nfulnl_instance *inst,
        struct nfgenmsg *nfmsg;
        sk_buff_data_t old_tail = inst->skb->tail;
        struct sock *sk;
+       const unsigned char *hwhdrp;
 
        nlh = nlmsg_put(inst->skb, 0, 0,
                        NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET,
@@ -485,9 +487,17 @@ __build_packet_message(struct nfulnl_instance *inst,
        if (indev && skb_mac_header_was_set(skb)) {
                if (nla_put_be16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) ||
                    nla_put_be16(inst->skb, NFULA_HWLEN,
-                                htons(skb->dev->hard_header_len)) ||
-                   nla_put(inst->skb, NFULA_HWHEADER, skb->dev->hard_header_len,
-                           skb_mac_header(skb)))
+                                htons(skb->dev->hard_header_len)))
+                       goto nla_put_failure;
+
+               hwhdrp = skb_mac_header(skb);
+
+               if (skb->dev->type == ARPHRD_SIT)
+                       hwhdrp -= ETH_HLEN;
+
+               if (hwhdrp >= skb->head &&
+                   nla_put(inst->skb, NFULA_HWHEADER,
+                           skb->dev->hard_header_len, hwhdrp))
                        goto nla_put_failure;
        }
 
index ae7f5daeee4362bff5aee9a30a85347de70a2ccc..2a0843081840c0cd937a3fb0e749965bf9e28d0c 100644 (file)
@@ -149,6 +149,10 @@ static int xt_ct_tg_check_v0(const struct xt_tgchk_param *par)
 
        __set_bit(IPS_TEMPLATE_BIT, &ct->status);
        __set_bit(IPS_CONFIRMED_BIT, &ct->status);
+
+       /* Overload tuple linked list to put us in template list. */
+       hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
+                                &par->net->ct.tmpl);
 out:
        info->ct = ct;
        return 0;
@@ -289,6 +293,10 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
 
        __set_bit(IPS_TEMPLATE_BIT, &ct->status);
        __set_bit(IPS_CONFIRMED_BIT, &ct->status);
+
+       /* Overload tuple linked list to put us in template list. */
+       hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
+                                &par->net->ct.tmpl);
 out:
        info->ct = ct;
        return 0;
@@ -377,14 +385,60 @@ static struct xt_target xt_ct_tg_reg[] __read_mostly = {
        },
 };
 
+static unsigned int
+notrack_tg(struct sk_buff *skb, const struct xt_action_param *par)
+{
+       /* Previously seen (loopback)? Ignore. */
+       if (skb->nfct != NULL)
+               return XT_CONTINUE;
+
+       skb->nfct = &nf_ct_untracked_get()->ct_general;
+       skb->nfctinfo = IP_CT_NEW;
+       nf_conntrack_get(skb->nfct);
+
+       return XT_CONTINUE;
+}
+
+static int notrack_chk(const struct xt_tgchk_param *par)
+{
+       if (!par->net->xt.notrack_deprecated_warning) {
+               pr_info("netfilter: NOTRACK target is deprecated, "
+                       "use CT instead or upgrade iptables\n");
+               par->net->xt.notrack_deprecated_warning = true;
+       }
+       return 0;
+}
+
+static struct xt_target notrack_tg_reg __read_mostly = {
+       .name           = "NOTRACK",
+       .revision       = 0,
+       .family         = NFPROTO_UNSPEC,
+       .checkentry     = notrack_chk,
+       .target         = notrack_tg,
+       .table          = "raw",
+       .me             = THIS_MODULE,
+};
+
 static int __init xt_ct_tg_init(void)
 {
-       return xt_register_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg));
+       int ret;
+
+       ret = xt_register_target(&notrack_tg_reg);
+       if (ret < 0)
+               return ret;
+
+       ret = xt_register_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg));
+       if (ret < 0) {
+               xt_unregister_target(&notrack_tg_reg);
+               return ret;
+       }
+       return 0;
 }
 
 static void __exit xt_ct_tg_exit(void)
 {
        xt_unregister_targets(xt_ct_tg_reg, ARRAY_SIZE(xt_ct_tg_reg));
+       xt_unregister_target(&notrack_tg_reg);
 }
 
 module_init(xt_ct_tg_init);
@@ -394,3 +448,5 @@ MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Xtables: connection tracking target");
 MODULE_ALIAS("ipt_CT");
 MODULE_ALIAS("ip6t_CT");
+MODULE_ALIAS("ipt_NOTRACK");
+MODULE_ALIAS("ip6t_NOTRACK");
index 26a668a84aa288a82dc3eb243df2728a3169b2a2..a9d7af953ceb8bcd1d961eef21d0f3cb3ee22919 100644 (file)
@@ -157,11 +157,22 @@ dsthash_find(const struct xt_hashlimit_htable *ht,
 /* allocate dsthash_ent, initialize dst, put in htable and lock it */
 static struct dsthash_ent *
 dsthash_alloc_init(struct xt_hashlimit_htable *ht,
-                  const struct dsthash_dst *dst)
+                  const struct dsthash_dst *dst, bool *race)
 {
        struct dsthash_ent *ent;
 
        spin_lock(&ht->lock);
+
+       /* Two or more packets may race to create the same entry in the
+        * hashtable, double check if this packet lost race.
+        */
+       ent = dsthash_find(ht, dst);
+       if (ent != NULL) {
+               spin_unlock(&ht->lock);
+               *race = true;
+               return ent;
+       }
+
        /* initialize hash with random val at the time we allocate
         * the first hashtable entry */
        if (unlikely(!ht->rnd_initialized)) {
@@ -318,7 +329,10 @@ static void htable_destroy(struct xt_hashlimit_htable *hinfo)
                parent = hashlimit_net->ipt_hashlimit;
        else
                parent = hashlimit_net->ip6t_hashlimit;
-       remove_proc_entry(hinfo->pde->name, parent);
+
+       if(parent != NULL)
+               remove_proc_entry(hinfo->pde->name, parent);
+
        htable_selective_cleanup(hinfo, select_all);
        vfree(hinfo);
 }
@@ -585,6 +599,7 @@ hashlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
        unsigned long now = jiffies;
        struct dsthash_ent *dh;
        struct dsthash_dst dst;
+       bool race = false;
        u32 cost;
 
        if (hashlimit_init_dst(hinfo, &dst, skb, par->thoff) < 0)
@@ -593,13 +608,18 @@ hashlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
        rcu_read_lock_bh();
        dh = dsthash_find(hinfo, &dst);
        if (dh == NULL) {
-               dh = dsthash_alloc_init(hinfo, &dst);
+               dh = dsthash_alloc_init(hinfo, &dst, &race);
                if (dh == NULL) {
                        rcu_read_unlock_bh();
                        goto hotdrop;
+               } else if (race) {
+                       /* Already got an entry, update expiration timeout */
+                       dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
+                       rateinfo_recalc(dh, now, hinfo->cfg.mode);
+               } else {
+                       dh->expires = jiffies + msecs_to_jiffies(hinfo->cfg.expire);
+                       rateinfo_init(dh, hinfo);
                }
-               dh->expires = jiffies + msecs_to_jiffies(hinfo->cfg.expire);
-               rateinfo_init(dh, hinfo);
        } else {
                /* update expiration timeout */
                dh->expires = now + msecs_to_jiffies(hinfo->cfg.expire);
@@ -856,6 +876,27 @@ static int __net_init hashlimit_proc_net_init(struct net *net)
 
 static void __net_exit hashlimit_proc_net_exit(struct net *net)
 {
+       struct xt_hashlimit_htable *hinfo;
+       struct hlist_node *pos;
+       struct proc_dir_entry *pde;
+       struct hashlimit_net *hashlimit_net = hashlimit_pernet(net);
+
+       /* recent_net_exit() is called before recent_mt_destroy(). Make sure
+        * that the parent xt_recent proc entry is is empty before trying to
+        * remove it.
+        */
+       mutex_lock(&hashlimit_mutex);
+       pde = hashlimit_net->ipt_hashlimit;
+       if (pde == NULL)
+               pde = hashlimit_net->ip6t_hashlimit;
+
+       hlist_for_each_entry(hinfo, pos, &hashlimit_net->htables, node)
+               remove_proc_entry(hinfo->pde->name, pde);
+
+       hashlimit_net->ipt_hashlimit = NULL;
+       hashlimit_net->ip6t_hashlimit = NULL;
+       mutex_unlock(&hashlimit_mutex);
+
        proc_net_remove(net, "ipt_hashlimit");
 #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
        proc_net_remove(net, "ip6t_hashlimit");
@@ -872,9 +913,6 @@ static int __net_init hashlimit_net_init(struct net *net)
 
 static void __net_exit hashlimit_net_exit(struct net *net)
 {
-       struct hashlimit_net *hashlimit_net = hashlimit_pernet(net);
-
-       BUG_ON(!hlist_empty(&hashlimit_net->htables));
        hashlimit_proc_net_exit(net);
 }
 
index 4635c9b0045981d862cb3b31a34ac9ab735eb85e..978efc9b555a3e1936cb5e49c0537055e3b642f9 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/skbuff.h>
 #include <linux/inet.h>
 #include <linux/slab.h>
+#include <linux/vmalloc.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
 
@@ -310,6 +311,14 @@ out:
        return ret;
 }
 
+static void recent_table_free(void *addr)
+{
+       if (is_vmalloc_addr(addr))
+               vfree(addr);
+       else
+               kfree(addr);
+}
+
 static int recent_mt_check(const struct xt_mtchk_param *par,
                           const struct xt_recent_mtinfo_v1 *info)
 {
@@ -322,6 +331,7 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
 #endif
        unsigned int i;
        int ret = -EINVAL;
+       size_t sz;
 
        if (unlikely(!hash_rnd_inited)) {
                get_random_bytes(&hash_rnd, sizeof(hash_rnd));
@@ -360,8 +370,11 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
                goto out;
        }
 
-       t = kzalloc(sizeof(*t) + sizeof(t->iphash[0]) * ip_list_hash_size,
-                   GFP_KERNEL);
+       sz = sizeof(*t) + sizeof(t->iphash[0]) * ip_list_hash_size;
+       if (sz <= PAGE_SIZE)
+               t = kzalloc(sz, GFP_KERNEL);
+       else
+               t = vzalloc(sz);
        if (t == NULL) {
                ret = -ENOMEM;
                goto out;
@@ -377,14 +390,14 @@ static int recent_mt_check(const struct xt_mtchk_param *par,
        uid = make_kuid(&init_user_ns, ip_list_uid);
        gid = make_kgid(&init_user_ns, ip_list_gid);
        if (!uid_valid(uid) || !gid_valid(gid)) {
-               kfree(t);
+               recent_table_free(t);
                ret = -EINVAL;
                goto out;
        }
        pde = proc_create_data(t->name, ip_list_perms, recent_net->xt_recent,
                  &recent_mt_fops, t);
        if (pde == NULL) {
-               kfree(t);
+               recent_table_free(t);
                ret = -ENOMEM;
                goto out;
        }
@@ -431,10 +444,11 @@ static void recent_mt_destroy(const struct xt_mtdtor_param *par)
                list_del(&t->list);
                spin_unlock_bh(&recent_lock);
 #ifdef CONFIG_PROC_FS
-               remove_proc_entry(t->name, recent_net->xt_recent);
+               if (recent_net->xt_recent != NULL)
+                       remove_proc_entry(t->name, recent_net->xt_recent);
 #endif
                recent_table_flush(t);
-               kfree(t);
+               recent_table_free(t);
        }
        mutex_unlock(&recent_mutex);
 }
@@ -615,6 +629,20 @@ static int __net_init recent_proc_net_init(struct net *net)
 
 static void __net_exit recent_proc_net_exit(struct net *net)
 {
+       struct recent_net *recent_net = recent_pernet(net);
+       struct recent_table *t;
+
+       /* recent_net_exit() is called before recent_mt_destroy(). Make sure
+        * that the parent xt_recent proc entry is is empty before trying to
+        * remove it.
+        */
+       spin_lock_bh(&recent_lock);
+       list_for_each_entry(t, &recent_net->tables, list)
+               remove_proc_entry(t->name, recent_net->xt_recent);
+
+       recent_net->xt_recent = NULL;
+       spin_unlock_bh(&recent_lock);
+
        proc_net_remove(net, "xt_recent");
 }
 #else
@@ -638,9 +666,6 @@ static int __net_init recent_net_init(struct net *net)
 
 static void __net_exit recent_net_exit(struct net *net)
 {
-       struct recent_net *recent_net = recent_pernet(net);
-
-       BUG_ON(!list_empty(&recent_net->tables));
        recent_proc_net_exit(net);
 }
 
index dabf8a871dcc26b75166712e3ee109136f7babd6..7004e24d209f167c196e231ffc1f883033eb8d54 100644 (file)
@@ -333,6 +333,11 @@ static void __init attach_pas_card(struct address_info *hw_config)
                {
                        char            temp[100];
 
+                       if (pas_model < 0 ||
+                           pas_model >= ARRAY_SIZE(pas_model_names)) {
+                               printk(KERN_ERR "pas2 unrecognized model.\n");
+                               return;
+                       }
                        sprintf(temp,
                            "%s rev %d", pas_model_names[(int) pas_model],
                                    pas_read(0x2789));
index 2805e34bd41d715a44c3ba645165a71295260095..8bef47311e45025aeeb6552054c50dd520a8ad9d 100644 (file)
@@ -58,7 +58,7 @@ static void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en)
        if (en)
                temp |= (1 << (wt & 0x1f));
        else
-               temp &= (1 << ~(wt & 0x1f));
+               temp &= ~(1 << (wt & 0x1f));
        hwwrite(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0), temp);
 }
 
index 8353c77536ac51c0e9ed13ff6fb94732c9e80469..b8fb0a5adb9b54a67c687d5da6b142a917bcb261 100644 (file)
@@ -2531,7 +2531,7 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol,
                                  struct snd_ctl_elem_info *uinfo)
 {
        static const char * const texts[] = {
-               "Off", "On", "Follow Master"
+               "On", "Off", "Follow Master"
        };
        unsigned int index;
 
index 6ee34593774a4d155cd595ab96bbc7318f2dc6d9..71ae23dd71035edd0214fb8a4f209959cde932d1 100644 (file)
@@ -5992,6 +5992,30 @@ static void alc269_fixup_quanta_mute(struct hda_codec *codec,
        spec->automute_hook = alc269_quanta_automute;
 }
 
+/* update mute-LED according to the speaker mute state via mic1 VREF pin */
+static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled)
+{
+       struct hda_codec *codec = private_data;
+       unsigned int pinval = AC_PINCTL_IN_EN + (enabled ?
+                             AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80);
+       snd_hda_set_pin_ctl_cache(codec, 0x18, pinval);
+}
+
+static void alc269_fixup_mic1_mute(struct hda_codec *codec,
+                                  const struct alc_fixup *fix, int action)
+{
+       struct alc_spec *spec = codec->spec;
+       switch (action) {
+       case ALC_FIXUP_ACT_BUILD:
+               spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook;
+               snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
+               /* fallthru */
+       case ALC_FIXUP_ACT_INIT:
+               snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
+               break;
+       }
+}
+
 /* update mute-LED according to the speaker mute state via mic2 VREF pin */
 static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
 {
@@ -6043,6 +6067,7 @@ enum {
        ALC269_FIXUP_DMIC,
        ALC269VB_FIXUP_AMIC,
        ALC269VB_FIXUP_DMIC,
+       ALC269_FIXUP_MIC1_MUTE_LED,
        ALC269_FIXUP_MIC2_MUTE_LED,
        ALC269_FIXUP_INV_DMIC,
        ALC269_FIXUP_LENOVO_DOCK,
@@ -6171,6 +6196,10 @@ static const struct alc_fixup alc269_fixups[] = {
                        { }
                },
        },
+       [ALC269_FIXUP_MIC1_MUTE_LED] = {
+               .type = ALC_FIXUP_FUNC,
+               .v.func = alc269_fixup_mic1_mute,
+       },
        [ALC269_FIXUP_MIC2_MUTE_LED] = {
                .type = ALC_FIXUP_FUNC,
                .v.func = alc269_fixup_mic2_mute,
@@ -6215,6 +6244,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
        SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
        SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
+       SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
        SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
        SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
        SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
index c183d34842accdc69ac8b1dec5424bb4373b1bbc..34b9bb7fe87c8eabed83df8b7b77f510bedbc2b1 100644 (file)
@@ -2181,10 +2181,6 @@ int snd_usbmidi_create(struct snd_card *card,
                umidi->usb_protocol_ops = &snd_usbmidi_novation_ops;
                err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
                break;
-       case QUIRK_MIDI_MBOX2:
-               umidi->usb_protocol_ops = &snd_usbmidi_midiman_ops;
-               err = snd_usbmidi_detect_per_port_endpoints(umidi, endpoints);
-               break;
        case QUIRK_MIDI_RAW_BYTES:
                umidi->usb_protocol_ops = &snd_usbmidi_raw_ops;
                /*
index cdcf6b45e8a887746a2f087e680b2c45a3198462..78e845ec65dafabc06332de0a3e7ea3d31e8b667 100644 (file)
        }
 },
 
+{
+       /* Creative BT-D1 */
+       USB_DEVICE(0x041e, 0x0005),
+       .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+               .ifnum = 1,
+               .type = QUIRK_AUDIO_FIXED_ENDPOINT,
+               .data = &(const struct audioformat) {
+                       .formats = SNDRV_PCM_FMTBIT_S16_LE,
+                       .channels = 2,
+                       .iface = 1,
+                       .altsetting = 1,
+                       .altset_idx = 1,
+                       .endpoint = 0x03,
+                       .ep_attr = USB_ENDPOINT_XFER_ISOC,
+                       .attributes = 0,
+                       .rates = SNDRV_PCM_RATE_CONTINUOUS,
+                       .rate_min = 48000,
+                       .rate_max = 48000,
+               }
+       }
+},
+
 /* Creative/Toshiba Multimedia Center SB-0500 */
 {
        USB_DEVICE(0x041e, 0x3048),
@@ -2993,7 +3015,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
                        },
                        {
                                .ifnum = 6,
-                               .type = QUIRK_MIDI_MBOX2,
+                               .type = QUIRK_MIDI_MIDIMAN,
                                .data = &(const struct snd_usb_midi_endpoint_info) {
                                        .out_ep =  0x02,
                                        .out_cables = 0x0001,
index f104c68fe1e0546bfbc43bdb51dc635a8ad642af..acc12f004c23f05f12b21aa311f2f49dc77652d5 100644 (file)
@@ -306,7 +306,6 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
                [QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,
                [QUIRK_MIDI_MIDIMAN] = create_any_midi_quirk,
                [QUIRK_MIDI_NOVATION] = create_any_midi_quirk,
-               [QUIRK_MIDI_MBOX2] = create_any_midi_quirk,
                [QUIRK_MIDI_RAW_BYTES] = create_any_midi_quirk,
                [QUIRK_MIDI_EMAGIC] = create_any_midi_quirk,
                [QUIRK_MIDI_CME] = create_any_midi_quirk,
@@ -528,11 +527,11 @@ static void mbox2_setup_48_24_magic(struct usb_device *dev)
 #define MBOX2_BOOT_LOADING     0x01 /* Hard coded into the device */
 #define MBOX2_BOOT_READY       0x02 /* Hard coded into the device */
 
-int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
+static int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
 {
        struct usb_host_config *config = dev->actconfig;
        int err;
-       u8 bootresponse;
+       u8 bootresponse[12];
        int fwsize;
        int count;
 
@@ -546,20 +545,20 @@ int snd_usb_mbox2_boot_quirk(struct usb_device *dev)
        snd_printd("usb-audio: Sending Digidesign Mbox 2 boot sequence...\n");
 
        count = 0;
-       bootresponse = MBOX2_BOOT_LOADING;
-       while ((bootresponse == MBOX2_BOOT_LOADING) && (count < 10)) {
+       bootresponse[0] = MBOX2_BOOT_LOADING;
+       while ((bootresponse[0] == MBOX2_BOOT_LOADING) && (count < 10)) {
                msleep(500); /* 0.5 second delay */
                snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
                        /* Control magic - load onboard firmware */
                        0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012);
-               if (bootresponse == MBOX2_BOOT_READY)
+               if (bootresponse[0] == MBOX2_BOOT_READY)
                        break;
                snd_printd("usb-audio: device not ready, resending boot sequence...\n");
                count++;
        }
 
-       if (bootresponse != MBOX2_BOOT_READY) {
-               snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse);
+       if (bootresponse[0] != MBOX2_BOOT_READY) {
+               snd_printk(KERN_ERR "usb-audio: Unknown bootresponse=%d, or timed out, ignoring device.\n", bootresponse[0]);
                return -ENODEV;
        }
 
@@ -660,7 +659,6 @@ static int audiophile_skip_setting_quirk(struct snd_usb_audio *chip,
        return 0; /* keep this altsetting */
 }
 
-
 static int fasttrackpro_skip_setting_quirk(struct snd_usb_audio *chip,
                                           int iface, int altno)
 {
index a8172c119796015fa2edd0a675d4568c27f83ba7..1ac3fd9cc5a625e89cc1290ab3274ebac6982793 100644 (file)
@@ -76,7 +76,6 @@ enum quirk_type {
        QUIRK_MIDI_YAMAHA,
        QUIRK_MIDI_MIDIMAN,
        QUIRK_MIDI_NOVATION,
-       QUIRK_MIDI_MBOX2,
        QUIRK_MIDI_RAW_BYTES,
        QUIRK_MIDI_EMAGIC,
        QUIRK_MIDI_CME,