diff --git a/debian/changelog b/debian/changelog index 3992984db..ddcef30de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -250,6 +250,212 @@ linux (3.17~rc5-1~exp1) experimental; urgency=medium -- maximilian attems Thu, 18 Sep 2014 23:50:00 +0200 +linux (3.16.7-ckt9-1) unstable; urgency=medium + + * New upstream stable update: + http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt8 + - usb: core: buffer: smallest buffer should start at ARCH_DMA_MINALIGN + - btrfs: fix leak of path in btrfs_find_item + - tpm_tis: verify interrupt during init + - xfs: ensure buffer types are set correctly + - xfs: inode unlink does not set AGI buffer type + - xfs: set buf types when converting extent formats + - xfs: set superblock buffer type correctly + - [s390*] KVM: avoid memory leaks if __inject_vm() fails + - samsung-laptop: Add use_native_backlight quirk, and enable it on some + models (regression in 3.14) + - staging: comedi: comedi_compat32.c: fix COMEDI_CMD copy back + - nfs: don't call blocking operations while !TASK_RUNNING + - cdc-acm: add sanity checks + - USB: fix use-after-free bug in usb_hcd_unlink_urb() + - iwlwifi: mvm: fix failure path when power_update fails in add_interface + - tty: Prevent untrappable signals from malicious program + - cpufreq: Set cpufreq_cpu_data to NULL before putting kobject + - nfs41: .init_read and .init_write can be called with valid pg_lseg + (regression in 3.15) + - mei: mask interrupt set bit on clean reset bit (regression in + 3.16.7-ckt5) + - [s390*] KVM: floating irqs: fix user triggerable endless loop + - cfq-iosched: handle failure of cfq group allocation + - tracing: Fix unmapping loop in tracing_mark_write + - fsnotify: fix handling of renames in audit + - blk-mq: fix double-free in error path + - NFSv4.1: Fix a kfree() of uninitialised pointers in + decode_cb_sequence_args + - mm/hugetlb: pmd_huge() returns true for non-present hugepage + - mm/hugetlb: take page table lock in follow_huge_pmd() + - mm/hugetlb: fix getting refcount 0 page in hugetlb_fault() + - mm/hugetlb: add migration/hwpoisoned entry check in + hugetlb_change_protection + - mm/hugetlb: add migration entry check in __unmap_hugepage_range + - iscsi-target: Drop problematic active_ts_list usage + - mm/memory.c: actually remap enough memory + - mm: hwpoison: drop lru_add_drain_all() in __soft_offline_page() + (regression in 3.11) + - jffs2: fix handling of corrupted summary length + - dm mirror: do not degrade the mirror on discard error + - dm io: reject unsupported DISCARD requests with EOPNOTSUPP + - NFS: struct nfs_commit_info.lock must always point to inode->i_lock + (regression in 3.16.4) + - target: Add missing WRITE_SAME end-of-device sanity check + - target: Check for LBA + sectors wrap-around in sbc_parse_cdb + - Btrfs: fix fsync data loss after adding hard link to inode + - sg: fix read() error reporting + - IB/qib: Do not write EEPROM + - [amd64] EDAC, amd64_edac: Prevent OOPS with >16 memory controllers + (regression in 3.11) + - md/raid5: Fix livelock when array is both resyncing and degraded. + - locking/rtmutex: Avoid a NULL pointer dereference on deadlock + (regression in 3.16) + - time: adjtimex: Validate the ADJ_FREQUENCY values + - ntp: Fixup adjtimex freq validation on 32-bit systems + - dm: fix a race condition in dm_get_md + - dm snapshot: fix a possible invalid memory access on unload + - libceph: fix double __remove_osd() problem + - blk-throttle: check stats_cpu before reading it from sysfs + - debugfs: leave freeing a symlink body until inode eviction + - procfs: fix race between symlink removals and traversals + - autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for + allocation + - clk-gate: fix bit # check in clk_register_gate() (regression in 3.11) + - [powerpc*] kernel: Avoid memory corruption at early stage + (regression in 3.14) + - GFS2: Fix crash during ACL deletion in acl max entry check in + gfs2_set_acl() (regression in 3.14) + - net: llc: use correct size for sysctl timeout entries (CVE-2015-2041) + - net: rds: use correct size for max unacked packets and bytes + (CVE-2015-2042) + - HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events + (regression in 3.16.7-ckt4) + - net: sctp: fix race for one-to-many sockets in sendmsg's auto associate + - ipv6: mld: fix add_grhead skb_over_panic for devs with large MTUs + - IB/core: When marshaling ucma path from user-space, clear unused fields + (regression in 3.14) + - IB/core: Fix deadlock on uverbs modify_qp error flow (regression in 3.14) + - IB/mlx4: Fix wrong usage of IPv4 protocol for multicast attach/detach + (regression in 3.14) + - IB/iser: Use correct dma direction when unmapping SGs + (regression in 3.15) + - staging: comedi: cb_pcidas64: fix incorrect AI range code handling + - target: Fix R_HOLDER bit usage for AllRegistrants + - target: Avoid dropping AllRegistrants reservation during unregister + - target: Allow AllRegistrants to re-RESERVE existing reservation + - target: Allow Write Exclusive non-reservation holders to READ + - vhost/scsi: potential memory corruption + - mm: softdirty: unmapped addresses between VMAs are clean + - proc/pagemap: walk page tables under pte lock + http://kernel.ubuntu.com/stable/ChangeLog-3.16.7-ckt9 + - netfilter: nft_compat: fix module refcount underflow + - netfilter: xt_socket: fix a stack corruption bug + - ipvs: add missing ip_vs_pe_put in sync code + - flowcache: Fix kernel panic in flow_cache_flush_task (regression in 3.15) + - tcp: make sure skb is not shared before using skb_get() + (regression in 3.16) + - gen_stats.c: Duplicate xstats buffer for later use + - ematch: Fix auto-loading of ematch modules. + - openvswitch: Fix net exit. + - net: reject creation of netdev names with colons + - macvtap: make sure neighbour code can push ethernet header + - udp: only allow UFO for packets from SOCK_DGRAM sockets + - gpiolib: of: allow of_gpiochip_find_and_xlate to find more than one chip + per node (regression in 3.16.7-ckt6) + - [x86] drm/i915: Check obj->vma_list under the struct_mutex + (regression in 3.15) + - ALSA: hda - Disable runtime PM for Panther Point again + (regression in 3.14) + - nilfs2: fix potential memory overrun on inode + - [armhf] usb: dwc3: dwc3-omap: Fix disable IRQ + - [i386] KVM: emulate: fix CMPXCHG8B on 32-bit hosts + - xhci: Allocate correct amount of scratchpad buffers + - USB: usbfs: don't leak kernel data in siginfo + - efi/libstub: Fix boundary checking in efi_high_alloc() + - USB: serial: fix potential use-after-free after failed probe + - USB: serial: fix tty-device error handling at probe + - staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel + - mei: make device disabled on stop unconditionally + - NFSv4: Don't call put_rpccred() under the rcu_read_lock() + - btrfs: fix lost return value due to variable shadowing + - eCryptfs: don't pass fs-specific ioctl commands through + - drm/radeon: fix DRM_IOCTL_RADEON_CS oops + - [armhf] ASoC: omap-pcm: Correct dma mask + - [amd64] x86/asm/entry/64: Remove a bogus 'ret_from_fork' optimization + (CVE-2015-2830) + - Btrfs: fix data loss in the fast fsync path + - Btrfs:__add_inode_ref: out of bounds memory read when looking for + extended ref. + - svcrpc: fix memory leak in gssp_accept_sec_context_upcall + (regression in 3.12) + - SUNRPC: Always manipulate rpc_rqst::rq_bc_pa_list under xprt->bc_pa_lock + (regression in 3.15) + - net: cls_bpf: fix size mismatch on filter preparation + - net: cls_bpf: fix auto generation of per list handles + - qlge: Fix qlge_update_hw_vlan_features to handle if interface is down + (regression in 3.13) + - libsas: Fix Kernel Crash in smp_execute_task + - ALSA: hda - Fix regression of HD-audio controller fallback modes + (regression in 3.11) + - can: add missing initialisations in CAN related skbuffs + - ftrace: Fix en(dis)able graph caller when en(dis)abling record via sysctl + - ftrace: Fix ftrace enable ordering of sysctl ftrace_enabled + - [armhf] imx6qdl-sabresd: set swbst_reg as vbus's parent reg + - [armhf] imx6sl-evk: set swbst_reg as vbus's parent reg + - xen-pciback: limit guest control of command register (CVE-2015-2150) + - drm/vmwgfx: Reorder device takedown somewhat + - ALSA: control: Add sanity checks for user ctl id name string + - Revert "i2c: core: Dispose OF IRQ mapping at client removal time" + (regression in 3.16.7-ckt2) + - nilfs2: fix deadlock of segment constructor during recovery + (regression in 3.16.7-ckt7) + - clk: divider: fix calculation of maximal parent rate for a given divider + (regression in 3.15) + - [sparc*] Fix several bugs in memmove(). + - net: sysctl_net_core: check SNDBUF and RCVBUF for min length + - inet_diag: fix possible overflow in inet_diag_dump_one_icsk() + - caif: fix MSG_OOB test in caif_seqpkt_recvmsg() + - rxrpc: bogus MSG_PEEK test in rxrpc_recvmsg() + - tcp: fix tcp fin memory accounting + - net: compat: Update get_compat_msghdr() to match copy_msghdr_from_user() + behaviour (regression in 3.13) + - tcp: make connect() mem charging friendly + + [ Ian Campbell ] + * Initialise framebuffer console earlier. (Closes: #779935) + * [xen] Enable Xen MCE log support. (Closes: #779698) + * [armhf] mvebu: do not register custom DMA operations when coherency is + disabled (Closes: #780858) + * [armhf] Enable power control on various sunxi platforms, enable MFD_AXP20X + and REGULATOR_AXP20X and adding the necessary DTB nodes. (Closes: #781576) + + [ Ben Hutchings ] + * [armel/kirkwood] linux-image: Add versioned Breaks against flash-kernel, + to ensure that an FDT is appended to the image if needed (Closes: #781193) + * Revert "quota: Store maximum space limit in bytes" to avoid ABI change + * IB/core: Prevent integer overflow in ib_umem_get address arithmetic + (CVE-2014-8159) + * Btrfs: make xattr replace operations atomic (CVE-2014-9710) + * ext4: fix ZERO_RANGE bug hidden by flag aliasing + * ext4: fix accidental flag aliasing in ext4_map_blocks flags + * ext4: allocate entire range in zero range (CVE-2015-0275) + * [x86] microcode/intel: Guard against stack overflow in the loader + (CVE-2015-2666) + * ipv6: Don't reduce hop limit for an interface (CVE-2015-2922) + * [powerpc/powerpc64,ppc64] Disable THERM_PM72 and enable its replacements + WINDFARM_PM72 and WINDFARM_RM31 as modules. Update the udeb config + accordingly. Thanks to Milan Kupcevic. (Closes: #781934) + * psmouse: Add support for FocalTech touchpads, thanks to Rafal Ramocki + (Closes: #780971) + * [x86] drm/i915: Add limited color range readout for HDMI/DP ports on + g4x/vlv/chv (Closes: #775217) + * HID: thingm: fix workqueue race on remove (Closes: #780055) + * [x86] Disable X86_VERBOSE_BOOTUP (Closes: #781953) + * eMMC: Don't initialize partitions on RPMB flagged areas (Closes: #782038) + * [x86] powercap / RAPL: change domain detection message (Closes: #781418) + * procfs: Avoid ABI change in 3.16.7-ckt8 + * [powerpc/powerpc] udeb: Add fb-modules package containing radeonfb driver + (Closes: #782058) + + -- Ben Hutchings Wed, 08 Apr 2015 01:03:08 +0100 + linux (3.16.7-ckt7-1) unstable; urgency=medium * New upstream stable update: diff --git a/debian/config/armhf/config.armmp b/debian/config/armhf/config.armmp index 2bcb18c79..0b567a59a 100644 --- a/debian/config/armhf/config.armmp +++ b/debian/config/armhf/config.armmp @@ -406,6 +406,7 @@ CONFIG_TI_EMIF=m ## file: drivers/mfd/Kconfig ## CONFIG_MFD_AS3722=y +CONFIG_MFD_AXP20X=y CONFIG_MFD_DA9052_SPI=y CONFIG_MFD_DA9052_I2C=y CONFIG_MFD_MC13XXX_SPI=m @@ -684,6 +685,7 @@ CONFIG_PWM_VT8500=m CONFIG_REGULATOR=y CONFIG_REGULATOR_ANATOP=m CONFIG_REGULATOR_AS3722=y +CONFIG_REGULATOR_AXP20X=m CONFIG_REGULATOR_DA9052=m CONFIG_REGULATOR_GPIO=m CONFIG_REGULATOR_MC13783=m diff --git a/debian/config/config b/debian/config/config index a0b4bd776..f8ee8e7c6 100644 --- a/debian/config/config +++ b/debian/config/config @@ -429,12 +429,6 @@ CONFIG_ASYNC_TX_DMA=y ## CONFIG_EDAC_LEGACY_SYSFS=y # CONFIG_EDAC_MCE_INJ is not set -CONFIG_EDAC_I82975X=m -CONFIG_EDAC_I3200=m -CONFIG_EDAC_X38=m -CONFIG_EDAC_I5400=m -CONFIG_EDAC_I7CORE=m -CONFIG_EDAC_I5100=m ## ## file: drivers/extcon/Kconfig @@ -4535,6 +4529,7 @@ CONFIG_XEN_GNTDEV=m CONFIG_XEN_GRANT_DEV_ALLOC=m CONFIG_XEN_PCIDEV_BACKEND=m CONFIG_XEN_SCSI_BACKEND=m +CONFIG_XEN_MCE_LOG=y ## ## file: fs/Kconfig diff --git a/debian/config/kernelarch-powerpc/config b/debian/config/kernelarch-powerpc/config index 17933766c..8fd324ddb 100644 --- a/debian/config/kernelarch-powerpc/config +++ b/debian/config/kernelarch-powerpc/config @@ -389,12 +389,7 @@ CONFIG_INPUT_ADBHID=y CONFIG_MAC_EMUMOUSEBTN=y CONFIG_THERM_WINDTUNNEL=m CONFIG_THERM_ADT746X=m -CONFIG_THERM_PM72=m CONFIG_WINDFARM=m -CONFIG_WINDFARM_PM81=m -CONFIG_WINDFARM_PM91=m -CONFIG_WINDFARM_PM112=m -CONFIG_WINDFARM_PM121=m CONFIG_ANSLCD=m CONFIG_PMAC_RACKMETER=m diff --git a/debian/config/kernelarch-powerpc/config-arch-64-be b/debian/config/kernelarch-powerpc/config-arch-64-be index 7210101f1..f23ad8fd2 100644 --- a/debian/config/kernelarch-powerpc/config-arch-64-be +++ b/debian/config/kernelarch-powerpc/config-arch-64-be @@ -65,10 +65,13 @@ CONFIG_I2C_PASEMI=m ## ## file: drivers/macintosh/Kconfig ## -CONFIG_WINDFARM=m +# CONFIG_THERM_PM72 is not set +CONFIG_WINDFARM_RM31=m +CONFIG_WINDFARM_PM72=m CONFIG_WINDFARM_PM81=m CONFIG_WINDFARM_PM91=m CONFIG_WINDFARM_PM112=m +CONFIG_WINDFARM_PM121=m ## ## file: drivers/net/ethernet/pasemi/Kconfig diff --git a/debian/config/kernelarch-x86/config b/debian/config/kernelarch-x86/config index 8f0e91aa5..1906b7ff7 100644 --- a/debian/config/kernelarch-x86/config +++ b/debian/config/kernelarch-x86/config @@ -77,7 +77,7 @@ CONFIG_IA32_AOUT=y ## file: arch/x86/Kconfig.debug ## CONFIG_STRICT_DEVMEM=y -CONFIG_X86_VERBOSE_BOOTUP=y +# CONFIG_X86_VERBOSE_BOOTUP is not set CONFIG_EARLY_PRINTK=y # CONFIG_EARLY_PRINTK_DBGP is not set CONFIG_EARLY_PRINTK_EFI=y @@ -402,11 +402,17 @@ CONFIG_EDAC_AMD76X=m CONFIG_EDAC_E7XXX=m CONFIG_EDAC_E752X=m CONFIG_EDAC_I82875P=m +CONFIG_EDAC_I82975X=m CONFIG_EDAC_I3000=m +CONFIG_EDAC_I3200=m CONFIG_EDAC_IE31200=m +CONFIG_EDAC_X38=m +CONFIG_EDAC_I5400=m +CONFIG_EDAC_I7CORE=m CONFIG_EDAC_I82860=m CONFIG_EDAC_R82600=m CONFIG_EDAC_I5000=m +CONFIG_EDAC_I5100=m CONFIG_EDAC_I7300=m CONFIG_EDAC_AMD8131=m CONFIG_EDAC_AMD8111=m diff --git a/debian/installer/powerpc/modules/powerpc-powerpc64/fancontrol-modules b/debian/installer/powerpc/modules/powerpc-powerpc64/fancontrol-modules index f069ca199..a3fc55cca 100644 --- a/debian/installer/powerpc/modules/powerpc-powerpc64/fancontrol-modules +++ b/debian/installer/powerpc/modules/powerpc-powerpc64/fancontrol-modules @@ -1,5 +1,4 @@ i2c-powermac ? -therm_pm72 ? windfarm_core ? windfarm_cpufreq_clamp ? windfarm_lm75_sensor ? @@ -9,6 +8,12 @@ windfarm_pm121 ? windfarm_pm112 ? windfarm_pm81 ? windfarm_pm91 ? +windfarm_pm72 ? +windfarm_rm31 ? windfarm_smu_controls ? windfarm_smu_sat ? windfarm_smu_sensors ? +windfarm_ad7417_sensor ? +windfarm_fcu_controls ? +windfarm_lm87_sensor ? +windfarm_pid ? diff --git a/debian/installer/powerpc/modules/powerpc/fb-modules b/debian/installer/powerpc/modules/powerpc/fb-modules new file mode 100644 index 000000000..29bfc4c39 --- /dev/null +++ b/debian/installer/powerpc/modules/powerpc/fb-modules @@ -0,0 +1,5 @@ +# 32-bit PowerMacs mostly have either ATI Rage 128 or Radeon graphics +# chips for which the offb driver doesn't work properly. aty128fb is +# currently built-in but that could plausibly change in future. +aty128fb +radeonfb diff --git a/debian/patches/bugfix/all/ext4-allocate-entire-range-in-zero-range.patch b/debian/patches/bugfix/all/ext4-allocate-entire-range-in-zero-range.patch new file mode 100644 index 000000000..99bcc3248 --- /dev/null +++ b/debian/patches/bugfix/all/ext4-allocate-entire-range-in-zero-range.patch @@ -0,0 +1,72 @@ +From: Lukas Czerner +Date: Fri, 3 Apr 2015 00:09:13 -0400 +Subject: ext4: allocate entire range in zero range +Origin: https://git.kernel.org/cgit/linux/kernel/git/tytso/ext4.git/commit/?id=0f2af21aae11972fa924374ddcf52e88347cf5a8 + +Currently there is a bug in zero range code which causes zero range +calls to only allocate block aligned portion of the range, while +ignoring the rest in some cases. + +In some cases, namely if the end of the range is past i_size, we do +attempt to preallocate the last nonaligned block. However this might +cause kernel to BUG() in some carefully designed zero range requests +on setups where page size > block size. + +Fix this problem by first preallocating the entire range, including +the nonaligned edges and converting the written extents to unwritten +in the next step. This approach will also give us the advantage of +having the range to be as linearly contiguous as possible. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -4795,12 +4795,6 @@ static long ext4_zero_range(struct file + else + max_blocks -= lblk; + +- flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT | +- EXT4_GET_BLOCKS_CONVERT_UNWRITTEN | +- EXT4_EX_NOCACHE; +- if (mode & FALLOC_FL_KEEP_SIZE) +- flags |= EXT4_GET_BLOCKS_KEEP_SIZE; +- + mutex_lock(&inode->i_mutex); + + /* +@@ -4817,15 +4811,28 @@ static long ext4_zero_range(struct file + ret = inode_newsize_ok(inode, new_size); + if (ret) + goto out_mutex; +- /* +- * If we have a partial block after EOF we have to allocate +- * the entire block. +- */ +- if (partial_end) +- max_blocks += 1; + } + ++ flags = EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT; ++ if (mode & FALLOC_FL_KEEP_SIZE) ++ flags |= EXT4_GET_BLOCKS_KEEP_SIZE; ++ ++ /* Preallocate the range including the unaligned edges */ ++ if (partial_begin || partial_end) { ++ ret = ext4_alloc_file_blocks(file, ++ round_down(offset, 1 << blkbits) >> blkbits, ++ (round_up((offset + len), 1 << blkbits) - ++ round_down(offset, 1 << blkbits)) >> blkbits, ++ new_size, flags, mode); ++ if (ret) ++ goto out_mutex; ++ ++ } ++ ++ /* Zero range excluding the unaligned edges */ + if (max_blocks > 0) { ++ flags |= (EXT4_GET_BLOCKS_CONVERT_UNWRITTEN | ++ EXT4_EX_NOCACHE); + + /* Now release the pages and zero block aligned part of pages*/ + truncate_pagecache_range(inode, start, end - 1); diff --git a/debian/patches/bugfix/all/ib-core-prevent-integer-overflow-in-ib_umem_get.patch b/debian/patches/bugfix/all/ib-core-prevent-integer-overflow-in-ib_umem_get.patch new file mode 100644 index 000000000..99ac0f3cf --- /dev/null +++ b/debian/patches/bugfix/all/ib-core-prevent-integer-overflow-in-ib_umem_get.patch @@ -0,0 +1,38 @@ +From: Shachar Raindel +Date: Sun, 04 Jan 2015 18:30:32 +0200 +Subject: IB/core: Prevent integer overflow in ib_umem_get address arithmetic +Origin: https://marc.info/?l=oss-security&m=142672196502144&w=2 + +Properly verify that the resulting page aligned end address is larger +than both the start address and the length of the memory area +requested. + +Both the start and length arguments for ib_umem_get are controlled by +the user. A misbehaving user can provide values which will cause an +integer overflow when calculating the page aligned end address. + +This overflow can cause also miscalculation of the number of pages +mapped, and additional logic issues. + +Signed-off-by: Shachar Raindel +Signed-off-by: Jack Morgenstein +Signed-off-by: Or Gerlitz +--- + +--- a/drivers/infiniband/core/umem.c ++++ b/drivers/infiniband/core/umem.c +@@ -94,6 +94,14 @@ struct ib_umem *ib_umem_get(struct ib_uc + if (dmasync) + dma_set_attr(DMA_ATTR_WRITE_BARRIER, &attrs); + ++ /* ++ * If the combination of the addr and size requested for this memory ++ * region causes an integer overflow, return error. ++ */ ++ if ((PAGE_ALIGN(addr + size) <= size) || ++ (PAGE_ALIGN(addr + size) <= addr)) ++ return ERR_PTR(-EINVAL); ++ + if (!can_do_mlock()) + return ERR_PTR(-EPERM); + diff --git a/debian/patches/bugfix/all/ipv6-don-t-reduce-hop-limit-for-an-interface.patch b/debian/patches/bugfix/all/ipv6-don-t-reduce-hop-limit-for-an-interface.patch new file mode 100644 index 000000000..c07ca3532 --- /dev/null +++ b/debian/patches/bugfix/all/ipv6-don-t-reduce-hop-limit-for-an-interface.patch @@ -0,0 +1,43 @@ +From: "D.S. Ljungmark" +Date: Wed, 25 Mar 2015 09:28:15 +0100 +Subject: ipv6: Don't reduce hop limit for an interface +Origin: https://git.kernel.org/linus/6fd99094de2b83d1d4c8457f2c83483b2828e75a + +A local route may have a lower hop_limit set than global routes do. + +RFC 3756, Section 4.2.7, "Parameter Spoofing" + +> 1. The attacker includes a Current Hop Limit of one or another small +> number which the attacker knows will cause legitimate packets to +> be dropped before they reach their destination. + +> As an example, one possible approach to mitigate this threat is to +> ignore very small hop limits. The nodes could implement a +> configurable minimum hop limit, and ignore attempts to set it below +> said limit. + +Signed-off-by: D.S. Ljungmark +Acked-by: Hannes Frederic Sowa +Signed-off-by: David S. Miller +--- + net/ipv6/ndisc.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/net/ipv6/ndisc.c ++++ b/net/ipv6/ndisc.c +@@ -1190,7 +1190,14 @@ static void ndisc_router_discovery(struc + if (rt) + rt6_set_expires(rt, jiffies + (HZ * lifetime)); + if (ra_msg->icmph.icmp6_hop_limit) { +- in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; ++ /* Only set hop_limit on the interface if it is higher than ++ * the current hop_limit. ++ */ ++ if (in6_dev->cnf.hop_limit < ra_msg->icmph.icmp6_hop_limit) { ++ in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; ++ } else { ++ ND_PRINTK(2, warn, "RA: Got route advertisement with lower hop_limit than current\n"); ++ } + if (rt) + dst_metric_set(&rt->dst, RTAX_HOPLIMIT, + ra_msg->icmph.icmp6_hop_limit); diff --git a/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch b/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch index 5ceb7a47b..f4d0735f0 100644 --- a/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch +++ b/debian/patches/bugfix/all/net-mv643xx-disable-tso-by-default.patch @@ -13,6 +13,7 @@ Cc: Thomas Petazzoni , Nadav Haklai , Ezequiel Garcia Date: Sat, 1 Nov 2014 12:30:20 -0300 +Origin: http://lkml.kernel.org/g/<1414855820-15094-2-git-send-email-ezequiel.garcia@free-electrons.com> Data corruption has been observed to be produced by TSO. For instance, accessing files on a NFS-server with TSO enabled results in different data diff --git a/debian/patches/bugfix/x86/x86-microcode-intel-guard-against-stack-overflow-in-.patch b/debian/patches/bugfix/x86/x86-microcode-intel-guard-against-stack-overflow-in-.patch new file mode 100644 index 000000000..fb53206cd --- /dev/null +++ b/debian/patches/bugfix/x86/x86-microcode-intel-guard-against-stack-overflow-in-.patch @@ -0,0 +1,32 @@ +From: Quentin Casasnovas +Date: Tue, 3 Feb 2015 13:00:22 +0100 +Subject: x86/microcode/intel: Guard against stack overflow in the loader +Origin: https://git.kernel.org/linus/f84598bd7c851f8b0bf8cd0d7c3be0d73c432ff4 + +mc_saved_tmp is a static array allocated on the stack, we need to make +sure mc_saved_count stays within its bounds, otherwise we're overflowing +the stack in _save_mc(). A specially crafted microcode header could lead +to a kernel crash or potentially kernel execution. + +Signed-off-by: Quentin Casasnovas +Cc: "H. Peter Anvin" +Cc: Fenghua Yu +Link: http://lkml.kernel.org/r/1422964824-22056-1-git-send-email-quentin.casasnovas@oracle.com +Signed-off-by: Borislav Petkov +--- + arch/x86/kernel/cpu/microcode/intel_early.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c +index ec9df6f..5e109a3 100644 +--- a/arch/x86/kernel/cpu/microcode/intel_early.c ++++ b/arch/x86/kernel/cpu/microcode/intel_early.c +@@ -321,7 +321,7 @@ get_matching_model_microcode(int cpu, unsigned long start, + unsigned int mc_saved_count = mc_saved_data->mc_saved_count; + int i; + +- while (leftover) { ++ while (leftover && mc_saved_count < ARRAY_SIZE(mc_saved_tmp)) { + mc_header = (struct microcode_header_intel *)ucode_ptr; + + mc_size = get_totalsize(mc_header); diff --git a/debian/patches/debian/emmc-don-t-initialize-partitions-on-rpmb-flagged-areas.patch b/debian/patches/debian/emmc-don-t-initialize-partitions-on-rpmb-flagged-areas.patch new file mode 100644 index 000000000..5495a30f8 --- /dev/null +++ b/debian/patches/debian/emmc-don-t-initialize-partitions-on-rpmb-flagged-areas.patch @@ -0,0 +1,27 @@ +From: Nell Hardcastle +Date: Thu, 29 May 2014 22:06:50 -0700 +Subject: [PATCH] eMMC: Don't initialize partitions on RPMB flagged areas. +Origin: https://dev-nell.com/rpmb-emmc-errors-under-linux.html +Bug-Debian: https://bugs.debian.org/782038 + +Prevents a lot of pointless hanging at boot on some devices. +--- +[bwh: An RPMB is unlikely to be useful on any platform supported by a Debian +kernel, so I think it's best to hide them for now. Once we are confident +that userland will ignore them or the kernel does a better job of avoiding +hanging reads, we can drop this patch.] + + drivers/mmc/card/block.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -2258,7 +2258,7 @@ static int mmc_blk_alloc_parts(struct mm + return 0; + + for (idx = 0; idx < card->nr_parts; idx++) { +- if (card->part[idx].size) { ++ if (card->part[idx].size && !(card->part[idx].area_type & MMC_BLK_DATA_AREA_RPMB)) { + ret = mmc_blk_alloc_part(card, md, + card->part[idx].part_cfg, + card->part[idx].size >> 9, diff --git a/debian/patches/features/all/psmouse/input-psmouse-disable-changing-resolution-rate-scale.patch b/debian/patches/features/all/psmouse/input-psmouse-disable-changing-resolution-rate-scale.patch new file mode 100644 index 000000000..dc896eba9 --- /dev/null +++ b/debian/patches/features/all/psmouse/input-psmouse-disable-changing-resolution-rate-scale.patch @@ -0,0 +1,119 @@ +From: Mathias Gottschlag +Date: Sat, 7 Mar 2015 13:32:10 -0800 +Subject: [5/6] Input: psmouse - disable changing resolution/rate/scale for + FocalTech +Origin: https://git.kernel.org/linus/4ec212f003d2430b0b2748b8a3008255f39cfe13 + +These PS/2 commands make some touchpads stop responding, so this commit +adds some dummy functions to replace the generic implementation. Because +scale changes were not encapsulated in a method of struct psmouse yet, this +commit adds a method set_scale to psmouse. + +Signed-off-by: Mathias Gottschlag +Signed-off-by: Dmitry Torokhov +--- + drivers/input/mouse/focaltech.c | 25 +++++++++++++++++++++++++ + drivers/input/mouse/psmouse-base.c | 14 +++++++++++++- + drivers/input/mouse/psmouse.h | 6 ++++++ + 3 files changed, 44 insertions(+), 1 deletion(-) + +--- a/drivers/input/mouse/focaltech.c ++++ b/drivers/input/mouse/focaltech.c +@@ -386,6 +386,23 @@ static int focaltech_read_size(struct ps + + return 0; + } ++ ++void focaltech_set_resolution(struct psmouse *psmouse, unsigned int resolution) ++{ ++ /* not supported yet */ ++} ++ ++static void focaltech_set_rate(struct psmouse *psmouse, unsigned int rate) ++{ ++ /* not supported yet */ ++} ++ ++static void focaltech_set_scale(struct psmouse *psmouse, ++ enum psmouse_scale scale) ++{ ++ /* not supported yet */ ++} ++ + int focaltech_init(struct psmouse *psmouse) + { + struct focaltech_data *priv; +@@ -420,6 +437,14 @@ int focaltech_init(struct psmouse *psmou + psmouse->cleanup = focaltech_reset; + /* resync is not supported yet */ + psmouse->resync_time = 0; ++ /* ++ * rate/resolution/scale changes are not supported yet, and ++ * the generic implementations of these functions seem to ++ * confuse some touchpads ++ */ ++ psmouse->set_resolution = focaltech_set_resolution; ++ psmouse->set_rate = focaltech_set_rate; ++ psmouse->set_scale = focaltech_set_scale; + + return 0; + +--- a/drivers/input/mouse/psmouse-base.c ++++ b/drivers/input/mouse/psmouse-base.c +@@ -454,6 +454,17 @@ static void psmouse_set_rate(struct psmo + } + + /* ++ * Here we set the mouse scaling. ++ */ ++ ++static void psmouse_set_scale(struct psmouse *psmouse, enum psmouse_scale scale) ++{ ++ ps2_command(&psmouse->ps2dev, NULL, ++ scale == PSMOUSE_SCALE21 ? PSMOUSE_CMD_SETSCALE21 : ++ PSMOUSE_CMD_SETSCALE11); ++} ++ ++/* + * psmouse_poll() - default poll handler. Everyone except for ALPS uses it. + */ + +@@ -687,6 +698,7 @@ static void psmouse_apply_defaults(struc + + psmouse->set_rate = psmouse_set_rate; + psmouse->set_resolution = psmouse_set_resolution; ++ psmouse->set_scale = psmouse_set_scale; + psmouse->poll = psmouse_poll; + psmouse->protocol_handler = psmouse_process_byte; + psmouse->pktsize = 3; +@@ -1158,7 +1170,7 @@ static void psmouse_initialize(struct ps + if (psmouse_max_proto != PSMOUSE_PS2) { + psmouse->set_rate(psmouse, psmouse->rate); + psmouse->set_resolution(psmouse, psmouse->resolution); +- ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSCALE11); ++ psmouse->set_scale(psmouse, PSMOUSE_SCALE11); + } + } + +--- a/drivers/input/mouse/psmouse.h ++++ b/drivers/input/mouse/psmouse.h +@@ -36,6 +36,11 @@ typedef enum { + PSMOUSE_FULL_PACKET + } psmouse_ret_t; + ++enum psmouse_scale { ++ PSMOUSE_SCALE11, ++ PSMOUSE_SCALE21 ++}; ++ + struct psmouse { + void *private; + struct input_dev *dev; +@@ -67,6 +72,7 @@ struct psmouse { + psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse); + void (*set_rate)(struct psmouse *psmouse, unsigned int rate); + void (*set_resolution)(struct psmouse *psmouse, unsigned int resolution); ++ void (*set_scale)(struct psmouse *psmouse, enum psmouse_scale scale); + + int (*reconnect)(struct psmouse *psmouse); + void (*disconnect)(struct psmouse *psmouse); diff --git a/debian/patches/features/all/psmouse/input-psmouse-disable-palm-detection-in-the-focaltec.patch b/debian/patches/features/all/psmouse/input-psmouse-disable-palm-detection-in-the-focaltec.patch new file mode 100644 index 000000000..86820deca --- /dev/null +++ b/debian/patches/features/all/psmouse/input-psmouse-disable-palm-detection-in-the-focaltec.patch @@ -0,0 +1,38 @@ +From: Mathias Gottschlag +Date: Sat, 7 Mar 2015 13:38:52 -0800 +Subject: [6/6] Input: psmouse - disable "palm detection" in the focaltech + driver +Origin: https://git.kernel.org/linus/4eb8d6e7e5aa14572bc389e554aad9869188cdcd + +Apparently, the threshold for large contact area seems to be rather low on +some devices, causing the touchpad to frequently freeze during normal +usage. Because we do now know how we are supposed to use the value in +question, this commit just drops the related code completely. + +Signed-off-by: Mathias Gottschlag +Signed-off-by: Dmitry Torokhov +--- + drivers/input/mouse/focaltech.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c +index 891a271..23d2594 100644 +--- a/drivers/input/mouse/focaltech.c ++++ b/drivers/input/mouse/focaltech.c +@@ -185,16 +185,6 @@ static void focaltech_process_abs_packet(struct psmouse *psmouse, + + state->pressed = (packet[0] >> 4) & 1; + +- /* +- * packet[5] contains some kind of tool size in the most +- * significant nibble. 0xff is a special value (latching) that +- * signals a large contact area. +- */ +- if (packet[5] == 0xff) { +- state->fingers[finger].valid = false; +- return; +- } +- + state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2]; + state->fingers[finger].y = (packet[3] << 8) | packet[4]; + state->fingers[finger].valid = true; diff --git a/debian/patches/features/all/psmouse/input-psmouse-ensure-that-focaltech-reports-consiste.patch b/debian/patches/features/all/psmouse/input-psmouse-ensure-that-focaltech-reports-consiste.patch new file mode 100644 index 000000000..a0b5a7ec0 --- /dev/null +++ b/debian/patches/features/all/psmouse/input-psmouse-ensure-that-focaltech-reports-consiste.patch @@ -0,0 +1,41 @@ +From: Mathias Gottschlag +Date: Sat, 7 Mar 2015 13:27:08 -0800 +Subject: [4/6] Input: psmouse - ensure that focaltech reports consistent + coordinates +Origin: https://git.kernel.org/linus/679d83ea9390636ded518f533af0cefbade317c7 + +We don't know whether x_max or y_max really hold the maximum possible +coordinates, and we don't know for sure whether we correctly interpret the +coordinates sent by the touchpad, so we clamp the reported values to +prevent confusion in userspace code. + +Signed-off-by: Mathias Gottschlag +Signed-off-by: Dmitry Torokhov +--- + drivers/input/mouse/focaltech.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c +index e8fafe8..c66e0e0 100644 +--- a/drivers/input/mouse/focaltech.c ++++ b/drivers/input/mouse/focaltech.c +@@ -126,9 +126,17 @@ static void focaltech_report_state(struct psmouse *psmouse) + input_mt_slot(dev, i); + input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); + if (active) { +- input_report_abs(dev, ABS_MT_POSITION_X, finger->x); ++ unsigned int clamped_x, clamped_y; ++ /* ++ * The touchpad might report invalid data, so we clamp ++ * the resulting values so that we do not confuse ++ * userspace. ++ */ ++ clamped_x = clamp(finger->x, 0U, priv->x_max); ++ clamped_y = clamp(finger->y, 0U, priv->y_max); ++ input_report_abs(dev, ABS_MT_POSITION_X, clamped_x); + input_report_abs(dev, ABS_MT_POSITION_Y, +- priv->y_max - finger->y); ++ priv->y_max - clamped_y); + } + } + input_mt_report_pointer_emulation(dev, true); diff --git a/debian/patches/features/all/psmouse/input-psmouse-remove-hardcoded-touchpad-size-from-th.patch b/debian/patches/features/all/psmouse/input-psmouse-remove-hardcoded-touchpad-size-from-th.patch new file mode 100644 index 000000000..55fc46ba8 --- /dev/null +++ b/debian/patches/features/all/psmouse/input-psmouse-remove-hardcoded-touchpad-size-from-th.patch @@ -0,0 +1,38 @@ +From: Mathias Gottschlag +Date: Sat, 7 Mar 2015 13:26:31 -0800 +Subject: [3/6] Input: psmouse - remove hardcoded touchpad size from the + focaltech driver +Origin: https://git.kernel.org/linus/3e9845251926723319fb60c9e546fe42d3d11687 + +The size has in most cases already been fetched from the touchpad, the +hardcoded values should have been removed. + +Signed-off-by: Mathias Gottschlag +Signed-off-by: Dmitry Torokhov +--- + drivers/input/mouse/focaltech.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c +index 757f78a..e8fafe8 100644 +--- a/drivers/input/mouse/focaltech.c ++++ b/drivers/input/mouse/focaltech.c +@@ -67,9 +67,6 @@ static void focaltech_reset(struct psmouse *psmouse) + + #define FOC_MAX_FINGERS 5 + +-#define FOC_MAX_X 2431 +-#define FOC_MAX_Y 1663 +- + /* + * Current state of a single finger on the touchpad. + */ +@@ -131,7 +128,7 @@ static void focaltech_report_state(struct psmouse *psmouse) + if (active) { + input_report_abs(dev, ABS_MT_POSITION_X, finger->x); + input_report_abs(dev, ABS_MT_POSITION_Y, +- FOC_MAX_Y - finger->y); ++ priv->y_max - finger->y); + } + } + input_mt_report_pointer_emulation(dev, true); diff --git a/debian/patches/features/all/psmouse/input-psmouse-support-for-the-focaltech-ps-2-protoco.patch b/debian/patches/features/all/psmouse/input-psmouse-support-for-the-focaltech-ps-2-protoco.patch new file mode 100644 index 000000000..5af42e8fb --- /dev/null +++ b/debian/patches/features/all/psmouse/input-psmouse-support-for-the-focaltech-ps-2-protoco.patch @@ -0,0 +1,572 @@ +From: Mathias Gottschlag +Date: Mon, 29 Dec 2014 09:26:35 -0800 +Subject: [2/6] Input: psmouse - support for the FocalTech PS/2 protocol + extensions +Origin: https://git.kernel.org/linus/05be1d079ec0b3691783e4384b1ada82149ff7d2 + +Most of the protocol for these touchpads has been reverse engineered. This +commit adds a basic multitouch-capable driver. + +A lot of the protocol is still unknown. Especially, we don't know how to +identify the device yet apart from the PNP ID. + +The previous workaround for these devices has been left in place in case +the driver is not compiled into the kernel or in case some other device +with the same PNP ID is not recognized by the driver yet still has the same +problems with the device probing code. + +Signed-off-by: Mathias Gottschlag +Reviewed-by: Hans de Goede +Signed-off-by: Dmitry Torokhov +--- + drivers/input/mouse/Kconfig | 10 + + drivers/input/mouse/focaltech.c | 408 ++++++++++++++++++++++++++++++++++++- + drivers/input/mouse/focaltech.h | 2 + + drivers/input/mouse/psmouse-base.c | 32 ++- + drivers/input/mouse/psmouse.h | 1 + + 5 files changed, 436 insertions(+), 17 deletions(-) + +--- a/drivers/input/mouse/Kconfig ++++ b/drivers/input/mouse/Kconfig +@@ -146,6 +146,16 @@ config MOUSE_PS2_OLPC + + If unsure, say N. + ++config MOUSE_PS2_FOCALTECH ++ bool "FocalTech PS/2 mouse protocol extension" if EXPERT ++ default y ++ depends on MOUSE_PS2 ++ help ++ Say Y here if you have a FocalTech PS/2 TouchPad connected to ++ your system. ++ ++ If unsure, say Y. ++ + config MOUSE_SERIAL + tristate "Serial mouse" + select SERIO +--- a/drivers/input/mouse/focaltech.c ++++ b/drivers/input/mouse/focaltech.c +@@ -2,6 +2,7 @@ + * Focaltech TouchPad PS/2 mouse driver + * + * Copyright (c) 2014 Red Hat Inc. ++ * Copyright (c) 2014 Mathias Gottschlag + * + * 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 +@@ -13,15 +14,14 @@ + * Hans de Goede + */ + +-/* +- * The Focaltech PS/2 touchpad protocol is unknown. This drivers deals with +- * detection only, to avoid further detection attempts confusing the touchpad +- * this way it at least works in PS/2 mouse compatibility mode. +- */ + + #include + #include ++#include ++#include ++#include + #include "psmouse.h" ++#include "focaltech.h" + + static const char * const focaltech_pnp_ids[] = { + "FLT0101", +@@ -30,6 +30,12 @@ static const char * const focaltech_pnp_ + NULL + }; + ++/* ++ * Even if the kernel is built without support for Focaltech PS/2 touchpads (or ++ * when the real driver fails to recognize the device), we still have to detect ++ * them in order to avoid further detection attempts confusing the touchpad. ++ * This way it at least works in PS/2 mouse compatibility mode. ++ */ + int focaltech_detect(struct psmouse *psmouse, bool set_properties) + { + if (!psmouse_matches_pnp_id(psmouse, focaltech_pnp_ids)) +@@ -37,16 +43,404 @@ int focaltech_detect(struct psmouse *psm + + if (set_properties) { + psmouse->vendor = "FocalTech"; +- psmouse->name = "FocalTech Touchpad in mouse emulation mode"; ++ psmouse->name = "FocalTech Touchpad"; + } + + return 0; + } + +-int focaltech_init(struct psmouse *psmouse) ++static void focaltech_reset(struct psmouse *psmouse) + { + ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS); + psmouse_reset(psmouse); ++} ++ ++#ifdef CONFIG_MOUSE_PS2_FOCALTECH ++ ++/* ++ * Packet types - the numbers are not consecutive, so we might be missing ++ * something here. ++ */ ++#define FOC_TOUCH 0x3 /* bitmap of active fingers */ ++#define FOC_ABS 0x6 /* absolute position of one finger */ ++#define FOC_REL 0x9 /* relative position of 1-2 fingers */ ++ ++#define FOC_MAX_FINGERS 5 ++ ++#define FOC_MAX_X 2431 ++#define FOC_MAX_Y 1663 ++ ++/* ++ * Current state of a single finger on the touchpad. ++ */ ++struct focaltech_finger_state { ++ /* The touchpad has generated a touch event for the finger */ ++ bool active; ++ ++ /* ++ * The touchpad has sent position data for the finger. The ++ * flag is 0 when the finger is not active, and there is a ++ * time between the first touch event for the finger and the ++ * following absolute position packet for the finger where the ++ * touchpad has declared the finger to be valid, but we do not ++ * have any valid position yet. ++ */ ++ bool valid; ++ ++ /* ++ * Absolute position (from the bottom left corner) of the ++ * finger. ++ */ ++ unsigned int x; ++ unsigned int y; ++}; ++ ++/* ++ * Description of the current state of the touchpad hardware. ++ */ ++struct focaltech_hw_state { ++ /* ++ * The touchpad tracks the positions of the fingers for us, ++ * the array indices correspond to the finger indices returned ++ * in the report packages. ++ */ ++ struct focaltech_finger_state fingers[FOC_MAX_FINGERS]; ++ ++ /* True if the clickpad has been pressed. */ ++ bool pressed; ++}; ++ ++struct focaltech_data { ++ unsigned int x_max, y_max; ++ struct focaltech_hw_state state; ++}; ++ ++static void focaltech_report_state(struct psmouse *psmouse) ++{ ++ struct focaltech_data *priv = psmouse->private; ++ struct focaltech_hw_state *state = &priv->state; ++ struct input_dev *dev = psmouse->dev; ++ int i; ++ ++ for (i = 0; i < FOC_MAX_FINGERS; i++) { ++ struct focaltech_finger_state *finger = &state->fingers[i]; ++ bool active = finger->active && finger->valid; ++ ++ input_mt_slot(dev, i); ++ input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); ++ if (active) { ++ input_report_abs(dev, ABS_MT_POSITION_X, finger->x); ++ input_report_abs(dev, ABS_MT_POSITION_Y, ++ FOC_MAX_Y - finger->y); ++ } ++ } ++ input_mt_report_pointer_emulation(dev, true); ++ ++ input_report_key(psmouse->dev, BTN_LEFT, state->pressed); ++ input_sync(psmouse->dev); ++} ++ ++static void focaltech_process_touch_packet(struct psmouse *psmouse, ++ unsigned char *packet) ++{ ++ struct focaltech_data *priv = psmouse->private; ++ struct focaltech_hw_state *state = &priv->state; ++ unsigned char fingers = packet[1]; ++ int i; ++ ++ state->pressed = (packet[0] >> 4) & 1; ++ ++ /* the second byte contains a bitmap of all fingers touching the pad */ ++ for (i = 0; i < FOC_MAX_FINGERS; i++) { ++ state->fingers[i].active = fingers & 0x1; ++ if (!state->fingers[i].active) { ++ /* ++ * Even when the finger becomes active again, we still ++ * will have to wait for the first valid position. ++ */ ++ state->fingers[i].valid = false; ++ } ++ fingers >>= 1; ++ } ++} ++ ++static void focaltech_process_abs_packet(struct psmouse *psmouse, ++ unsigned char *packet) ++{ ++ struct focaltech_data *priv = psmouse->private; ++ struct focaltech_hw_state *state = &priv->state; ++ unsigned int finger; ++ ++ finger = (packet[1] >> 4) - 1; ++ if (finger >= FOC_MAX_FINGERS) { ++ psmouse_err(psmouse, "Invalid finger in abs packet: %d\n", ++ finger); ++ return; ++ } ++ ++ state->pressed = (packet[0] >> 4) & 1; ++ ++ /* ++ * packet[5] contains some kind of tool size in the most ++ * significant nibble. 0xff is a special value (latching) that ++ * signals a large contact area. ++ */ ++ if (packet[5] == 0xff) { ++ state->fingers[finger].valid = false; ++ return; ++ } ++ ++ state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2]; ++ state->fingers[finger].y = (packet[3] << 8) | packet[4]; ++ state->fingers[finger].valid = true; ++} ++ ++static void focaltech_process_rel_packet(struct psmouse *psmouse, ++ unsigned char *packet) ++{ ++ struct focaltech_data *priv = psmouse->private; ++ struct focaltech_hw_state *state = &priv->state; ++ int finger1, finger2; ++ ++ state->pressed = packet[0] >> 7; ++ finger1 = ((packet[0] >> 4) & 0x7) - 1; ++ if (finger1 < FOC_MAX_FINGERS) { ++ state->fingers[finger1].x += (char)packet[1]; ++ state->fingers[finger1].y += (char)packet[2]; ++ } else { ++ psmouse_err(psmouse, "First finger in rel packet invalid: %d\n", ++ finger1); ++ } ++ ++ /* ++ * If there is an odd number of fingers, the last relative ++ * packet only contains one finger. In this case, the second ++ * finger index in the packet is 0 (we subtract 1 in the lines ++ * above to create array indices, so the finger will overflow ++ * and be above FOC_MAX_FINGERS). ++ */ ++ finger2 = ((packet[3] >> 4) & 0x7) - 1; ++ if (finger2 < FOC_MAX_FINGERS) { ++ state->fingers[finger2].x += (char)packet[4]; ++ state->fingers[finger2].y += (char)packet[5]; ++ } ++} ++ ++static void focaltech_process_packet(struct psmouse *psmouse) ++{ ++ unsigned char *packet = psmouse->packet; ++ ++ switch (packet[0] & 0xf) { ++ case FOC_TOUCH: ++ focaltech_process_touch_packet(psmouse, packet); ++ break; ++ ++ case FOC_ABS: ++ focaltech_process_abs_packet(psmouse, packet); ++ break; ++ ++ case FOC_REL: ++ focaltech_process_rel_packet(psmouse, packet); ++ break; ++ ++ default: ++ psmouse_err(psmouse, "Unknown packet type: %02x\n", packet[0]); ++ break; ++ } ++ ++ focaltech_report_state(psmouse); ++} ++ ++static psmouse_ret_t focaltech_process_byte(struct psmouse *psmouse) ++{ ++ if (psmouse->pktcnt >= 6) { /* Full packet received */ ++ focaltech_process_packet(psmouse); ++ return PSMOUSE_FULL_PACKET; ++ } ++ ++ /* ++ * We might want to do some validation of the data here, but ++ * we do not know the protocol well enough ++ */ ++ return PSMOUSE_GOOD_DATA; ++} ++ ++static int focaltech_switch_protocol(struct psmouse *psmouse) ++{ ++ struct ps2dev *ps2dev = &psmouse->ps2dev; ++ unsigned char param[3]; ++ ++ param[0] = 0; ++ if (ps2_command(ps2dev, param, 0x10f8)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, 0x10f8)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, 0x10f8)) ++ return -EIO; ++ ++ param[0] = 1; ++ if (ps2_command(ps2dev, param, 0x10f8)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETSCALE11)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_ENABLE)) ++ return -EIO; ++ ++ return 0; ++} ++ ++static void focaltech_disconnect(struct psmouse *psmouse) ++{ ++ focaltech_reset(psmouse); ++ kfree(psmouse->private); ++ psmouse->private = NULL; ++} ++ ++static int focaltech_reconnect(struct psmouse *psmouse) ++{ ++ int error; ++ ++ focaltech_reset(psmouse); ++ ++ error = focaltech_switch_protocol(psmouse); ++ if (error) { ++ psmouse_err(psmouse, "Unable to initialize the device\n"); ++ return error; ++ } ++ ++ return 0; ++} ++ ++static void focaltech_set_input_params(struct psmouse *psmouse) ++{ ++ struct input_dev *dev = psmouse->dev; ++ struct focaltech_data *priv = psmouse->private; ++ ++ /* ++ * Undo part of setup done for us by psmouse core since touchpad ++ * is not a relative device. ++ */ ++ __clear_bit(EV_REL, dev->evbit); ++ __clear_bit(REL_X, dev->relbit); ++ __clear_bit(REL_Y, dev->relbit); ++ __clear_bit(BTN_RIGHT, dev->keybit); ++ __clear_bit(BTN_MIDDLE, dev->keybit); ++ ++ /* ++ * Now set up our capabilities. ++ */ ++ __set_bit(EV_ABS, dev->evbit); ++ input_set_abs_params(dev, ABS_MT_POSITION_X, 0, priv->x_max, 0, 0); ++ input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, priv->y_max, 0, 0); ++ input_mt_init_slots(dev, 5, INPUT_MT_POINTER); ++ __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); ++} ++ ++static int focaltech_read_register(struct ps2dev *ps2dev, int reg, ++ unsigned char *param) ++{ ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETSCALE11)) ++ return -EIO; ++ ++ param[0] = 0; ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) ++ return -EIO; ++ ++ param[0] = reg; ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES)) ++ return -EIO; ++ ++ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) ++ return -EIO; ++ ++ return 0; ++} ++ ++static int focaltech_read_size(struct psmouse *psmouse) ++{ ++ struct ps2dev *ps2dev = &psmouse->ps2dev; ++ struct focaltech_data *priv = psmouse->private; ++ char param[3]; ++ ++ if (focaltech_read_register(ps2dev, 2, param)) ++ return -EIO; ++ ++ /* not sure whether this is 100% correct */ ++ priv->x_max = (unsigned char)param[1] * 128; ++ priv->y_max = (unsigned char)param[2] * 128; ++ ++ return 0; ++} ++int focaltech_init(struct psmouse *psmouse) ++{ ++ struct focaltech_data *priv; ++ int error; ++ ++ psmouse->private = priv = kzalloc(sizeof(struct focaltech_data), ++ GFP_KERNEL); ++ if (!priv) ++ return -ENOMEM; ++ ++ focaltech_reset(psmouse); ++ ++ error = focaltech_read_size(psmouse); ++ if (error) { ++ psmouse_err(psmouse, ++ "Unable to read the size of the touchpad\n"); ++ goto fail; ++ } ++ ++ error = focaltech_switch_protocol(psmouse); ++ if (error) { ++ psmouse_err(psmouse, "Unable to initialize the device\n"); ++ goto fail; ++ } ++ ++ focaltech_set_input_params(psmouse); ++ ++ psmouse->protocol_handler = focaltech_process_byte; ++ psmouse->pktsize = 6; ++ psmouse->disconnect = focaltech_disconnect; ++ psmouse->reconnect = focaltech_reconnect; ++ psmouse->cleanup = focaltech_reset; ++ /* resync is not supported yet */ ++ psmouse->resync_time = 0; + + return 0; ++ ++fail: ++ focaltech_reset(psmouse); ++ kfree(priv); ++ return error; + } ++ ++bool focaltech_supported(void) ++{ ++ return true; ++} ++ ++#else /* CONFIG_MOUSE_PS2_FOCALTECH */ ++ ++int focaltech_init(struct psmouse *psmouse) ++{ ++ focaltech_reset(psmouse); ++ ++ return 0; ++} ++ ++bool focaltech_supported(void) ++{ ++ return false; ++} ++ ++#endif /* CONFIG_MOUSE_PS2_FOCALTECH */ +--- a/drivers/input/mouse/focaltech.h ++++ b/drivers/input/mouse/focaltech.h +@@ -2,6 +2,7 @@ + * Focaltech TouchPad PS/2 mouse driver + * + * Copyright (c) 2014 Red Hat Inc. ++ * Copyright (c) 2014 Mathias Gottschlag + * + * 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 +@@ -18,5 +19,6 @@ + + int focaltech_detect(struct psmouse *psmouse, bool set_properties); + int focaltech_init(struct psmouse *psmouse); ++bool focaltech_supported(void); + + #endif +--- a/drivers/input/mouse/psmouse-base.c ++++ b/drivers/input/mouse/psmouse-base.c +@@ -723,16 +723,19 @@ static int psmouse_extensions(struct psm + + /* Always check for focaltech, this is safe as it uses pnp-id matching */ + if (psmouse_do_detect(focaltech_detect, psmouse, set_properties) == 0) { +- if (!set_properties || focaltech_init(psmouse) == 0) { +- /* +- * Not supported yet, use bare protocol. +- * Note that we need to also restrict +- * psmouse_max_proto so that psmouse_initialize() +- * does not try to reset rate and resolution, +- * because even that upsets the device. +- */ +- psmouse_max_proto = PSMOUSE_PS2; +- return PSMOUSE_PS2; ++ if (max_proto > PSMOUSE_IMEX) { ++ if (!set_properties || focaltech_init(psmouse) == 0) { ++ if (focaltech_supported()) ++ return PSMOUSE_FOCALTECH; ++ /* ++ * Note that we need to also restrict ++ * psmouse_max_proto so that psmouse_initialize() ++ * does not try to reset rate and resolution, ++ * because even that upsets the device. ++ */ ++ psmouse_max_proto = PSMOUSE_PS2; ++ return PSMOUSE_PS2; ++ } + } + } + +@@ -1061,6 +1064,15 @@ static const struct psmouse_protocol psm + .alias = "cortps", + .detect = cortron_detect, + }, ++#ifdef CONFIG_MOUSE_PS2_FOCALTECH ++ { ++ .type = PSMOUSE_FOCALTECH, ++ .name = "FocalTechPS/2", ++ .alias = "focaltech", ++ .detect = focaltech_detect, ++ .init = focaltech_init, ++ }, ++#endif + { + .type = PSMOUSE_AUTO, + .name = "auto", +--- a/drivers/input/mouse/psmouse.h ++++ b/drivers/input/mouse/psmouse.h +@@ -96,6 +96,7 @@ enum psmouse_type { + PSMOUSE_FSP, + PSMOUSE_SYNAPTICS_RELATIVE, + PSMOUSE_CYPRESS, ++ PSMOUSE_FOCALTECH, + PSMOUSE_AUTO /* This one should always be last */ + }; + diff --git a/debian/patches/features/arm/ARM-dts-sun4i-cubieboard-add-axp209-regulator-nodes.patch b/debian/patches/features/arm/ARM-dts-sun4i-cubieboard-add-axp209-regulator-nodes.patch new file mode 100644 index 000000000..fab31efb5 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun4i-cubieboard-add-axp209-regulator-nodes.patch @@ -0,0 +1,81 @@ +From 84d678e330f80376456c764fe1f9c27d9b79610c Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Mon, 12 Jan 2015 12:34:09 +0800 +Subject: [PATCH 6/7] ARM: dts: sun4i: cubieboard: add axp209 regulator nodes +Origin: https://git.kernel.org/linus/ce124f7a18c5ebc9dc93aaec15aaef779c8708ae + +This patch adds the regulator nodes for the axp209 by including +the axp209 dtsi. As the inputs of these regulators are from the +axp209's PS output, which is basically just a mux over the 2 +inputs, it is considered to be unregulated. Thus we do not provide +input supply properties for them. + +The regulator names and constraints are based on the board +schematics and the SoC datasheet. + +DCDC2 is used as the cpu power supply. This patch also references +it from the cpu node. + +Also get rid of axp209 properties already set in axp209.dtsi. + +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 35 ++++++++++++++++++++++++++---- + 1 file changed, 31 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts +index 539b693..5543b76 100644 +--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts ++++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts +@@ -92,12 +92,8 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupts = <0>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + +@@ -137,3 +133,34 @@ + status = "okay"; + }; + }; ++ ++#include "axp209.dtsi" ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1450000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun5i-Enable-axp209-support-on-A13-OLinuxIno.patch b/debian/patches/features/arm/ARM-dts-sun5i-Enable-axp209-support-on-A13-OLinuxIno.patch new file mode 100644 index 000000000..1f5810771 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun5i-Enable-axp209-support-on-A13-OLinuxIno.patch @@ -0,0 +1,37 @@ +From 3e4ab009b2f03bf5153320a52c0c18e0f631a7fa Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 25 Jan 2015 15:36:08 +0100 +Subject: [PATCH 7/7] ARM: dts: sun5i: Enable axp209 support on A13-OLinuxIno +Origin: https://git.kernel.org/linus/c121f45e6291e00c71b919ce4a439e0b6e829668 + +The (non micro) A13-OLinuxIno has an axp203 pmic, enable support for this. + +Signed-off-by: Hans de Goede +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts +index 429994e..59261aa 100644 +--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts ++++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts +@@ -76,6 +76,15 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_a>; + status = "okay"; ++ ++ axp209: pmic@34 { ++ compatible = "x-powers,axp209"; ++ reg = <0x34>; ++ interrupts = <0>; ++ ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ }; + }; + + i2c1: i2c@01c2b000 { +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun7i-cubieboard2-add-axp209-regulator-nodes.patch b/debian/patches/features/arm/ARM-dts-sun7i-cubieboard2-add-axp209-regulator-nodes.patch new file mode 100644 index 000000000..34720022e --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun7i-cubieboard2-add-axp209-regulator-nodes.patch @@ -0,0 +1,85 @@ +From 078a04de9f3a4ad1021ec647040b87381c9e5776 Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Mon, 12 Jan 2015 12:34:04 +0800 +Subject: [PATCH 4/7] ARM: dts: sun7i: cubieboard2: add axp209 regulator nodes +Origin: https://git.kernel.org/linus/ae265c801ffdbd58e4c7a83efc8dc08932de1f74 + +This patch adds the regulator nodes for the axp209 by including +the axp209 dtsi. As the inputs of these regulators are from the +axp209's PS output, which is basically just a mux over the 2 +inputs, it is considered to be unregulated. Thus we do not provide +input supply properties for them. + +The regulator names and constraints are based on the board +schematics and the SoC datasheet. + +DCDC2 is used as the cpu power supply. This patch also references +it from the cpu node. + +Also get rid of axp209 properties already set in axp209.dtsi. + +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard + +Conflicts: + arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +--- + arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 35 +++++++++++++++++++++++++---- + 1 file changed, 31 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +index d4648cf..7ce74a1 100644 +--- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts ++++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +@@ -78,13 +78,9 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 8>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + +@@ -135,3 +131,34 @@ + status = "okay"; + }; + }; ++ ++#include "axp209.dtsi" ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1450000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sun7i-cubietruck-add-axp209-regulator-nodes.patch b/debian/patches/features/arm/ARM-dts-sun7i-cubietruck-add-axp209-regulator-nodes.patch new file mode 100644 index 000000000..3aeb417b7 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sun7i-cubietruck-add-axp209-regulator-nodes.patch @@ -0,0 +1,85 @@ +From 319a5005396069f7c1829cafccbbe918166ec51a Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Mon, 12 Jan 2015 12:34:05 +0800 +Subject: [PATCH 5/7] ARM: dts: sun7i: cubietruck: add axp209 regulator nodes +Origin: https://git.kernel.org/linus/0d4e29343ce6317cf5cf073346c3e66ad82d61a1 + +This patch adds the regulator nodes for the axp209 by including +the axp209 dtsi. As the inputs of these regulators are from the +axp209's PS output, which is basically just a mux over the 2 +inputs, it is considered to be unregulated. Thus we do not provide +input supply properties for them. + +The regulator names and constraints are based on the board +schematics and the SoC datasheet. + +DCDC2 is used as the cpu power supply. This patch also references +it from the cpu node. + +Also get rid of axp209 properties already set in axp209.dtsi. + +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard + +Conflicts: + arch/arm/boot/dts/sun7i-a20-cubietruck.dts +--- + arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 35 ++++++++++++++++++++++++++---- + 1 file changed, 31 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts +index 96aee60..eb93cdd 100644 +--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts ++++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts +@@ -112,13 +112,9 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 8>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + +@@ -198,3 +194,34 @@ + gpio = <&pio 7 9 0>; + }; + }; ++ ++#include "axp209.dtsi" ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1450000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sunxi-Add-dtsi-for-AXP209-PMIC.patch b/debian/patches/features/arm/ARM-dts-sunxi-Add-dtsi-for-AXP209-PMIC.patch new file mode 100644 index 000000000..4d9d8d898 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sunxi-Add-dtsi-for-AXP209-PMIC.patch @@ -0,0 +1,123 @@ +From f3fb8c8611d470e40cb3460ede6f339e810d6f19 Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Mon, 12 Jan 2015 12:34:02 +0800 +Subject: [PATCH 3/7] ARM: dts: sunxi: Add dtsi for AXP209 PMIC +Origin: https://git.kernel.org/linus/ddfd0232ede34e673fe338d1e5a7ec7aa022aa99 + +The AXP209 PMIC is used with some Allwinner SoCs. This patch adds +a dtsi file listing all the regulator nodes. The regulators are +initialized based on their device node names. + +Signed-off-by: Chen-Yu Tsai +Signed-off-by: Maxime Ripard +--- + arch/arm/boot/dts/axp209.dtsi | 97 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 97 insertions(+) + create mode 100644 arch/arm/boot/dts/axp209.dtsi + +diff --git a/arch/arm/boot/dts/axp209.dtsi b/arch/arm/boot/dts/axp209.dtsi +new file mode 100644 +index 0000000..c20cf53 +--- /dev/null ++++ b/arch/arm/boot/dts/axp209.dtsi +@@ -0,0 +1,97 @@ ++/* ++ * Copyright 2015 Chen-Yu Tsai ++ * ++ * Chen-Yu Tsai ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this file; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * AXP202/209 Integrated Power Management Chip ++ * http://www.x-powers.com/product/AXP20X.php ++ * http://dl.linux-sunxi.org/AXP/AXP209%20Datasheet%20v1.0_cn.pdf ++ */ ++ ++&axp209 { ++ compatible = "x-powers,axp209"; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ ++ regulators { ++ /* Default work frequency for buck regulators */ ++ x-powers,dcdc-freq = <1500>; ++ ++ reg_dcdc2: dcdc2 { ++ regulator-name = "dcdc2"; ++ }; ++ ++ reg_dcdc3: dcdc3 { ++ regulator-name = "dcdc3"; ++ }; ++ ++ reg_ldo1: ldo1 { ++ /* LDO1 is a fixed output regulator */ ++ regulator-always-on; ++ regulator-min-microvolt = <1300000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-name = "ldo1"; ++ }; ++ ++ reg_ldo2: ldo2 { ++ regulator-name = "ldo2"; ++ }; ++ ++ reg_ldo3: ldo3 { ++ regulator-name = "ldo3"; ++ }; ++ ++ reg_ldo4: ldo4 { ++ regulator-name = "ldo4"; ++ }; ++ ++ reg_ldo5: ldo5 { ++ regulator-name = "ldo5"; ++ }; ++ }; ++}; +-- +2.1.4 + diff --git a/debian/patches/features/arm/ARM-dts-sunxi-Fixup-after-backport-of-axp209-support.patch b/debian/patches/features/arm/ARM-dts-sunxi-Fixup-after-backport-of-axp209-support.patch new file mode 100644 index 000000000..2ea9415e2 --- /dev/null +++ b/debian/patches/features/arm/ARM-dts-sunxi-Fixup-after-backport-of-axp209-support.patch @@ -0,0 +1,61 @@ +From 0737d5a36d9bbb22d9a156055116e710940be98b Mon Sep 17 00:00:00 2001 +From: Ian Campbell +Date: Fri, 3 Apr 2015 10:26:04 +0100 +Subject: [PATCH] ARM: dts: sunxi: Fixup after backport of axp209 support +Forwarded: not-needed + +By adding cpu0 label to cpu@0. + +Upstream this was added by "ARM: dts: sun4i: Add cpu clock reference and +operating points to dtsi" (and similar for sun5i, sun7i) which we have not +backported. + +Signed-off-by: Ian Campbell +--- + arch/arm/boot/dts/sun4i-a10.dtsi | 2 +- + arch/arm/boot/dts/sun5i-a13.dtsi | 2 +- + arch/arm/boot/dts/sun7i-a20.dtsi | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi +index eae8bfd..ad2ef45 100644 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi +@@ -70,7 +70,7 @@ + cpus { + #address-cells = <1>; + #size-cells = <0>; +- cpu@0 { ++ cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a8"; + reg = <0x0>; +diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi +index a194c1e..23bfb8f 100644 +--- a/arch/arm/boot/dts/sun5i-a13.dtsi ++++ b/arch/arm/boot/dts/sun5i-a13.dtsi +@@ -38,7 +38,7 @@ + cpus { + #address-cells = <1>; + #size-cells = <0>; +- cpu@0 { ++ cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a8"; + reg = <0x0>; +diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi +index 7d47914..648051c 100644 +--- a/arch/arm/boot/dts/sun7i-a20.dtsi ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi +@@ -63,7 +63,7 @@ + #address-cells = <1>; + #size-cells = <0>; + +- cpu@0 { ++ cpu0: cpu@0 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; + reg = <0>; +-- +2.1.4 + diff --git a/debian/patches/series b/debian/patches/series index ce733f411..d868cec0c 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -46,6 +46,7 @@ bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-730u3e-740u bugfix/x86/acpi-video-add-disable_native_backlight-quirk-for-samsung-510r.patch bugfix/x86/acpi-video-disable-native-backlight-on-samsung-series-9.patch bugfix/x86/drm-i915-quietly-reject-attempts-to-create-non-pagealigned-stolen-objects.patch +bugfix/x86/x86-microcode-intel-guard-against-stack-overflow-in-.patch # Arch features features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch @@ -56,6 +57,12 @@ features/x86/x86-make-x32-syscall-support-conditional.patch features/arm/deb-pkg-add-automatic-support-for-armhf-architecture.patch features/arm/dts-sun7i-Add-dts-file-for-Bananapro-board.patch features/arm/ARM-dts-sunxi-Add-simplefb-nodes-for-de_be0-lcd0-de_.patch +features/arm/ARM-dts-sunxi-Add-dtsi-for-AXP209-PMIC.patch +features/arm/ARM-dts-sun7i-cubieboard2-add-axp209-regulator-nodes.patch +features/arm/ARM-dts-sun7i-cubietruck-add-axp209-regulator-nodes.patch +features/arm/ARM-dts-sun4i-cubieboard-add-axp209-regulator-nodes.patch +features/arm/ARM-dts-sun5i-Enable-axp209-support-on-A13-OLinuxIno.patch +features/arm/ARM-dts-sunxi-Fixup-after-backport-of-axp209-support.patch # Miscellaneous bug fixes bugfix/all/misc-bmp085-Enable-building-as-a-module.patch @@ -66,7 +73,18 @@ bugfix/all/aic94xx-remove-broken-fallback-for-missing-ctrl-a.patch bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch bugfix/all/net-mv643xx-disable-tso-by-default.patch bugfix/all/vfs-read-file_handle-only-once-in-handle_to_path.patch +bugfix/all/ib-core-prevent-integer-overflow-in-ib_umem_get.patch +bugfix/all/ext4-allocate-entire-range-in-zero-range.patch +bugfix/all/ipv6-don-t-reduce-hop-limit-for-an-interface.patch +debian/emmc-don-t-initialize-partitions-on-rpmb-flagged-areas.patch # Miscellaneous features features/all/efi-autoload-efi-pstore.patch features/all/efi-expose-underlying-uefi-firmware-platform-size-to.patch + +# Add FocalTech support to psmouse +features/all/psmouse/input-psmouse-support-for-the-focaltech-ps-2-protoco.patch +features/all/psmouse/input-psmouse-remove-hardcoded-touchpad-size-from-th.patch +features/all/psmouse/input-psmouse-ensure-that-focaltech-reports-consiste.patch +features/all/psmouse/input-psmouse-disable-changing-resolution-rate-scale.patch +features/all/psmouse/input-psmouse-disable-palm-detection-in-the-focaltec.patch