Merge android.googlesource.com/kernel/common
authorChristian Hoffmann <chrmhoffmann@gmail.com>
Sun, 12 Feb 2023 08:08:38 +0000 (09:08 +0100)
committerChristian Hoffmann <chrmhoffmann@gmail.com>
Sun, 12 Feb 2023 08:08:38 +0000 (09:08 +0100)
* Branch: android-4.9-q
* SHA1: e7f15a9ebb2885905683dce8e287ada8f8aca0f2
* Version: 4.9.269

168 files changed:
1  2 
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/Makefile
arch/arm/include/asm/uaccess.h
arch/arm/kernel/hw_breakpoint.c
arch/arm/kernel/sleep.S
arch/arm/kernel/smp.c
arch/arm/mm/fault.c
arch/arm/mm/init.c
arch/arm/mm/mmu.c
arch/arm64/Makefile
arch/arm64/configs/cuttlefish_defconfig
arch/arm64/include/asm/alternative.h
arch/arm64/kernel/armv8_deprecated.c
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/head.S
arch/arm64/kernel/hw_breakpoint.c
arch/arm64/kernel/smp.c
arch/arm64/mm/fault.c
arch/arm64/mm/mmu.c
drivers/android/binder.c
drivers/base/Kconfig
drivers/base/power/main.c
drivers/block/loop.c
drivers/block/zram/zram_drv.c
drivers/clocksource/arm_arch_timer.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/scpi-cpufreq.c
drivers/dma-buf/sync_file.c
drivers/extcon/extcon.c
drivers/gpio/gpiolib-of.c
drivers/gpio/gpiolib.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/drm_probe_helper.c
drivers/input/input.c
drivers/irqchip/irq-gic.c
drivers/media/dvb-core/dvb_frontend.c
drivers/media/dvb-core/dvb_frontend.h
drivers/media/usb/cx231xx/cx231xx-video.c
drivers/media/v4l2-core/v4l2-ioctl.c
drivers/mmc/core/core.c
drivers/mmc/core/mmc.c
drivers/mmc/core/sdio_cis.c
drivers/mtd/nand/nand_base.c
drivers/mtd/spi-nor/spi-nor.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/phy/phy_device.c
drivers/of/of_reserved_mem.c
drivers/pci/probe.c
drivers/pci/quirks.c
drivers/perf/arm_pmu.c
drivers/pwm/sysfs.c
drivers/spi/Kconfig
drivers/staging/android/Kconfig
drivers/staging/android/Makefile
drivers/staging/android/ion/ion_heap.c
drivers/staging/android/lowmemorykiller.c
drivers/thermal/thermal_core.c
drivers/tty/sysrq.c
drivers/usb/core/devio.c
drivers/usb/core/hub.c
drivers/usb/core/message.c
drivers/usb/core/quirks.c
drivers/usb/core/urb.c
drivers/usb/core/usb.c
drivers/usb/core/usb.h
drivers/usb/dwc3/core.c
drivers/usb/gadget/configfs.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/host/ehci-hub.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/video/fbdev/core/fbmem.c
drivers/video/hdmi.c
fs/Makefile
fs/block_dev.c
fs/char_dev.c
fs/ext4/dir.c
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/ialloc.c
fs/ext4/inode.c
fs/ext4/ioctl.c
fs/ext4/namei.c
fs/ext4/page-io.c
fs/ext4/super.c
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/file.c
fs/f2fs/inline.c
fs/f2fs/segment.c
fs/f2fs/super.c
fs/inode.c
fs/namespace.c
fs/proc/task_mmu.c
fs/pstore/ram.c
include/linux/fs.h
include/linux/gfp.h
include/linux/gpio/consumer.h
include/linux/ieee80211.h
include/linux/memory_hotplug.h
include/linux/mm.h
include/linux/mm_types.h
include/linux/mmzone.h
include/linux/module.h
include/linux/mtd/nand.h
include/linux/page-flags.h
include/linux/sched.h
include/linux/serial_core.h
include/linux/usb.h
include/linux/vmalloc.h
include/net/cfg80211.h
include/net/tcp.h
include/trace/events/sched.h
include/uapi/linux/dvb/frontend.h
init/main.c
init/version.c
kernel/cgroup.c
kernel/cpu.c
kernel/fork.c
kernel/gcov/gcc_4_7.c
kernel/module.c
kernel/panic.c
kernel/printk/printk.c
kernel/sched/core.c
kernel/sched/fair.c
kernel/sysctl.c
kernel/time/posix-cpu-timers.c
kernel/workqueue.c
lib/Kconfig.debug
mm/cma.c
mm/internal.h
mm/kmemleak.c
mm/ksm.c
mm/memory.c
mm/page_alloc.c
mm/shmem.c
mm/slab_common.c
mm/slub.c
mm/swap_state.c
mm/vmalloc.c
mm/vmstat.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_timer.c
net/mac80211/main.c
net/mac80211/mlme.c
net/mac80211/tx.c
net/unix/af_unix.c
net/wireless/core.c
net/wireless/nl80211.c
net/wireless/rdev-ops.h
net/wireless/reg.c
net/wireless/sme.c
net/wireless/util.c
scripts/checkpatch.pl
scripts/dtc/dtc-lexer.l
scripts/dtc/dtc-lexer.lex.c_shipped
sound/usb/pcm.c

diff --cc MAINTAINERS
Simple merge
diff --cc Makefile
index de110035e6619f6d8e360b4fb7c501205cb81133,7d4e1b08f394790ff2d25291b71467888045e564..bbd1dc4fe4e3ab5e7faa671ec5d4619353788b77
+++ b/Makefile
@@@ -1221,13 -1220,17 +1237,17 @@@ endi
  # needs to be updated, so this check is forced on all builds
  
  uts_len := 64
+ ifneq (,$(BUILD_NUMBER))
+       UTS_RELEASE=$(KERNELRELEASE)-ab$(BUILD_NUMBER)
+ else
+       UTS_RELEASE=$(KERNELRELEASE)
+ endif
  define filechk_utsrelease.h
-       if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
-         echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2;    \
-         exit 1;                                                         \
-       fi;                                                               \
-       (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; echo \#define UTS_RELEASE_FULL \"$(KERNELRELEASE_FULL)\";\
-       echo \#define UTS_RELEASEY \"$(basename $(KERNELRELEASE)).y\";)
+       if [ `echo -n "$(UTS_RELEASE)" | wc -c ` -gt $(uts_len) ]; then \
+         echo '"$(UTS_RELEASE)" exceeds $(uts_len) characters' >&2;    \
+         exit 1;                                                       \
+       fi;                                                             \
 -      (echo \#define UTS_RELEASE \"$(UTS_RELEASE)\";)
++      (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; echo \#define UTS_RELEASE_FULL \"$(KERNELRELEASE_FULL)\";)
  endef
  
  define filechk_version.h
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 28e7b0d0014b5221e343c1deaacfae44d0aec967,c8569390e7e7e8f39eb333de26aba62c9221c1ef..39836df6e2cfe587996049237e05926ed9852b0a
@@@ -138,14 -142,10 +146,15 @@@ ARM_BE8(setend be)                      @ ensure we are i
        bl      __hyp_stub_install_secondary
  #endif
        safe_svcmode_maskall r1
+ no_hyp:
        mov     r1, #0
        ALT_SMP(mrc p15, 0, r0, c0, c0, 5)
 +      ALT_SMP(and r2, r0, #1<<24)
 +      ALT_SMP(cmp r2, #0)
 +      ALT_SMP(beq 2f)
 +      ALT_SMP(lsr r0, r0, #8)
        ALT_UP_B(1f)
 +2:
        adr     r2, mpidr_hash_ptr
        ldr     r3, [r2]
        add     r2, r2, r3              @ r2 = struct mpidr_hash phys address
Simple merge
Simple merge
Simple merge
index c7e41d4e11e75b58f581e0b60ae025e876f7e106,7edc6c3f4bd9174ce199f446b2a821cc2a69d8c2..eb38ce9057609b5649062c86fefe6f1ee0c12b57
@@@ -1175,12 -1166,24 +1175,28 @@@ void __init adjust_lowmem_bounds(void
         * and may itself be outside the valid range for which phys_addr_t
         * and therefore __pa() is defined.
         */
 +#ifdef CONFIG_AMLOGIC_KASAN32
 +      vmalloc_limit = (u64)(KMEM_END - PAGE_OFFSET + PHYS_OFFSET);
 +#else
        vmalloc_limit = (u64)(uintptr_t)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET;
 +#endif
  
+       /*
+        * The first usable region must be PMD aligned. Mark its start
+        * as MEMBLOCK_NOMAP if it isn't
+        */
+       for_each_memblock(memory, reg) {
+               if (!memblock_is_nomap(reg)) {
+                       if (!IS_ALIGNED(reg->base, PMD_SIZE)) {
+                               phys_addr_t len;
+                               len = round_up(reg->base, PMD_SIZE) - reg->base;
+                               memblock_mark_nomap(reg->base, len);
+                       }
+                       break;
+               }
+       }
        for_each_memblock(memory, reg) {
                phys_addr_t block_start = reg->base;
                phys_addr_t block_end = reg->base + reg->size;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 5a463e22ab71d045706269120cc388d4e26ec40a,f1022a873c8a30b85a29cfba528344f85591f68b..300f7542186e9e8e485378d3e50130ad39e0a238
  #include <linux/memblock.h>
  #include <linux/fs.h>
  #include <linux/io.h>
- #include <linux/slab.h>
- #include <linux/stop_machine.h>
  #include <linux/mm.h>
 +#ifdef CONFIG_AMLOGIC_MODIFY
 +#include <linux/bootmem.h>
 +#endif /* CONFIG_AMLOGIC_MODIFY */
  
  #include <asm/barrier.h>
  #include <asm/cputype.h>
@@@ -640,14 -612,9 +656,14 @@@ int __meminit vmemmap_populate(unsigne
                        if (!p)
                                return -ENOMEM;
  
-                       set_pmd(pmd, __pmd(__pa(p) | PROT_SECT_NORMAL));
+                       pmd_set_huge(pmd, __pa(p), __pgprot(PROT_SECT_NORMAL));
                } else
                        vmemmap_verify((pte_t *)pmd, node, addr, next);
 +
 +      #ifdef CONFIG_AMLOGIC_MODIFY
 +              if (in_vmap && check_pfn_overflow(page_to_pfn(page)))
 +                      break;
 +      #endif /* CONFIG_AMLOGIC_MODIFY */
        } while (addr = next, addr != end);
  
        return 0;
Simple merge
index 4fe2d754d32a869052de3e7df8ac90407ab4dd85,c9f6bae0acec33770857ae098231e7837baf0ce5..97e9c47776e5305abad2e41c43dafc418edeead4
@@@ -246,8 -246,6 +246,7 @@@ source "drivers/base/regmap/Kconfig
  config DMA_SHARED_BUFFER
        bool
        default n
-       select ANON_INODES
 +      select IRQ_WORK
        help
          This option enables the framework for buffer-sharing between
          multiple drivers. A buffer is associated with a file using driver
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index ebe1307fd5b2cdda7774a530b88d8bcf37b89118,cd45b38946616dc139af070503f91912352784bc..d9a820257b4e17f08b06c5da0b799d12cb48c289
@@@ -1811,40 -1787,35 +1822,40 @@@ static int dtv_property_process_set(str
                r = dtv_set_frontend(fe);
                break;
        case DTV_FREQUENCY:
-               c->frequency = tvp->u.data;
+               c->frequency = data;
                break;
        case DTV_MODULATION:
-               c->modulation = tvp->u.data;
+               c->modulation = data;
                break;
        case DTV_BANDWIDTH_HZ:
-               c->bandwidth_hz = tvp->u.data;
+               c->bandwidth_hz = data;
                break;
        case DTV_INVERSION:
-               c->inversion = tvp->u.data;
+               c->inversion = data;
                break;
        case DTV_SYMBOL_RATE:
-               c->symbol_rate = tvp->u.data;
+               c->symbol_rate = data;
                break;
        case DTV_INNER_FEC:
-               c->fec_inner = tvp->u.data;
+               c->fec_inner = data;
                break;
        case DTV_PILOT:
-               c->pilot = tvp->u.data;
+               c->pilot = data;
                break;
        case DTV_ROLLOFF:
-               c->rolloff = tvp->u.data;
+               c->rolloff = data;
                break;
        case DTV_DELIVERY_SYSTEM:
-               r = dvbv5_set_delivery_system(fe, tvp->u.data);
+               r = dvbv5_set_delivery_system(fe, data);
                break;
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +      case DTV_DELIVERY_SUB_SYSTEM:
 +              r = 0;
 +              break;
 +#endif
        case DTV_VOLTAGE:
-               c->voltage = tvp->u.data;
-               r = dvb_frontend_ioctl_legacy(file, FE_SET_VOLTAGE,
+               c->voltage = data;
+               r = dvb_frontend_handle_ioctl(file, FE_SET_VOLTAGE,
                        (void *)c->voltage);
                break;
        case DTV_TONE:
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 5cdb94c2639282118a0b68d280fa81aefb89441e,4216c0a5eaf5a64a180729a3ee2cacab4dd4e805..c5d6180b399aec1a4a39f7254b909a04c8a89d76
@@@ -184,13 -181,15 +184,19 @@@ static void dwmac4_set_filter(struct ma
                        dwmac4_set_umac_addr(hw, ha->addr, reg);
                        reg++;
                }
+               while (reg <= GMAC_MAX_PERFECT_ADDRESSES) {
+                       writel(0, ioaddr + GMAC_ADDR_HIGH(reg));
+                       writel(0, ioaddr + GMAC_ADDR_LOW(reg));
+                       reg++;
+               }
        }
 -
 +#ifdef CONFIG_AMLOGIC_ETH_PRIVE
 +      /*patch to support 5.1a*/
 +      writel(value | 0x80000000, ioaddr + GMAC_PACKET_FILTER);
 +#else
        writel(value, ioaddr + GMAC_PACKET_FILTER);
 +#endif
  }
  
  static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
index 978ce54d9230cb89b6d0199eddbe433c6eadd514,dbd56fefa2f3f7202018c10bb1b6741d6cf50a03..d8c456481f2bece40745453f383f251d92b30f87
  #include <linux/reset.h>
  #include <linux/of_mdio.h>
  #include "dwmac1000.h"
 +#ifdef CONFIG_AMLOGIC_ETH_PRIVE
 +#include "stmmac_platform.h"
 +#endif
 +#ifdef CONFIG_DWMAC_MESON
 +#include <phy_debug.h>
 +#endif
  
- #define       STMMAC_ALIGN(x)         __ALIGN_KERNEL(x, SMP_CACHE_BYTES)
+ #define       STMMAC_ALIGN(x)         ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
  #define       TSO_MAX_BUFF_SIZE       (SZ_16K - 1)
  
  /* Module parameters */
@@@ -3579,17 -3503,13 +3583,22 @@@ int stmmac_suspend(struct device *dev
        netif_device_detach(ndev);
        netif_stop_queue(ndev);
  
 +      /**
 +       *napi_disable call might_sleep,if not irq restore
 +       *It will warning bug
 +       */
 +      spin_unlock_irqrestore(&priv->lock, flags);
        napi_disable(&priv->napi);
 +      spin_lock_irqsave(&priv->lock, flags);
  
 +#ifdef CONFIG_AMLOGIC_ETH_PRIVE
 +      del_timer_sync(&priv->txtimer);
 +#endif
+       if (priv->eee_enabled) {
+               priv->tx_path_in_lpi_mode = false;
+               del_timer_sync(&priv->eee_ctrl_timer);
+       }
        /* Stop TX/RX DMA */
        priv->hw->dma->stop_tx(priv->ioaddr);
        priv->hw->dma->stop_rx(priv->ioaddr);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index af30a2e066c84a95e3cd394c5eb62198eca88f4d,3482d43c1aa5f48e2d37515273c2b2a4a373f038..e4c09e6f1055d606475b06e6885d63dbfde854da
@@@ -1,9 -1,7 +1,8 @@@
  ccflags-y += -I$(src)                 # needed for trace events
  
  obj-y                                 += ion/
- obj-$(CONFIG_FIQ_DEBUGGER)            += fiq_debugger/
  
  obj-$(CONFIG_ASHMEM)                  += ashmem.o
 +obj-$(CONFIG_ANDROID_LOGGER)            += logger.o
  obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER)       += lowmemorykiller.o
  obj-$(CONFIG_ANDROID_VSOC)            += vsoc.o
index 694637b9852b1c62f4d3904b3cded660c6afce87,8894a5f9820fb2408e39587e9b986ffbd117474d..62bd666ab7c1b67bccc4de699f2614dc93f2c728
  #include <linux/circ_buf.h>
  #include <linux/proc_fs.h>
  #include <linux/slab.h>
+ #include <linux/poll.h>
  
 +#ifdef CONFIG_AMLOGIC_CMA
 +#include <linux/amlogic/aml_cma.h>
 +#endif
 +
  #define CREATE_TRACE_POINTS
  #include "trace/lowmemorykiller.h"
  
@@@ -398,26 -323,9 +382,26 @@@ static unsigned long lowmem_scan(struc
                             cache_size, cache_limit,
                             min_score_adj,
                             free);
 +      #ifdef CONFIG_AMLOGIC_CMA
 +              if (cma_forbid) {
 +                      /* kill quickly if can't use cma */
 +                      lowmem_deathpending_timeout = jiffies + HZ / 2;
 +                      pr_info("   Free cma:%ldkB, file cma:%ldkB\n",
 +                              free_cma * (long)(PAGE_SIZE / 1024),
 +                              file_cma * (long)(PAGE_SIZE / 1024));
 +              } else {
 +                      lowmem_deathpending_timeout = jiffies + HZ;
 +              }
 +      #else
                lowmem_deathpending_timeout = jiffies + HZ;
 +      #endif /* CONFIG_AMLOGIC_CMA */
                rem += selected_tasksize;
-               handle_lmk_event(selected, min_score_adj);
+               get_task_struct(selected);
++
 +      #ifdef CONFIG_AMLOGIC_MEMORY_EXTEND
 +              if (!selected_oom_score_adj) /* forgeround task killed */
 +                      show_task_adj();
 +      #endif /* CONFIG_AMLOGIC_MEMORY_EXTEND */
        }
  
        lowmem_print(4, "lowmem_scan %lu, %x, return %lu\n",
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index de86d1aea2d9cadb34a22153d9e8846c85be9237,3dfd584a1ef3dec2fbf649f3f90e981289de2730..3b01306722c3d837637e99adb572fea0f9ef6212
@@@ -285,8 -332,8 +332,10 @@@ static const struct usb_device_id usb_q
        /* INTEL VALUE SSD */
        { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
  
 +      { USB_DEVICE(0x1fc9, 0x0011), .driver_info =
 +                      USB_QUIRK_DEVICE_QUALIFIER },
+       /* novation SoundControl XL */
+       { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME },
  
        { }  /* terminating entry must be last */
  };
Simple merge
Simple merge
Simple merge
index 9fa2ae9181e490596ccc1d9e82474e90a61bc331,66254500e7a948c8ba785b042d9697f329ccec57..bb756f9865aaaa00bb5fb8f58fa6c8dd4f01ec87
@@@ -330,10 -227,7 +330,9 @@@ static void dwc3_frame_length_adjustmen
  
        reg = dwc3_readl(dwc->regs, DWC3_GFLADJ);
        dft = reg & DWC3_GFLADJ_30MHZ_MASK;
-       if (!dev_WARN_ONCE(dwc->dev, dft == dwc->fladj,
-           "request value same as default, ignoring\n")) {
 +#ifndef CONFIG_AMLOGIC_USB
+       if (dft != dwc->fladj) {
 +#endif
                reg &= ~DWC3_GFLADJ_30MHZ_MASK;
                reg |= DWC3_GFLADJ_30MHZ_SDBND_SEL | dwc->fladj;
                dwc3_writel(dwc->regs, DWC3_GFLADJ, reg);
index 5774c02860ecf58e15928e9737bfa44e1e7af889,32940b8e76f09808303004ebebd6db1e2f080120..f8d5eb0ac4537f75c36d7194f7cdee46d420c1a5
@@@ -1295,18 -1290,12 +1313,19 @@@ static int configfs_composite_bind(stru
        int                             ret;
  
        /* the gi->lock is hold by the caller */
+       gi->unbind = 0;
        cdev->gadget = gadget;
        set_gadget_data(gadget, cdev);
 +#ifdef CONFIG_AMLOGIC_USB
 +      wakeup_source_init(&Gadget_Lock.wakesrc, "gadget-connect");
 +#endif
        ret = composite_dev_prepare(composite, cdev);
 -      if (ret)
 +      if (ret) {
 +#ifdef CONFIG_AMLOGIC_USB
 +              wakeup_source_trash(&Gadget_Lock.wakesrc);
 +#endif
                return ret;
 +      }
        /* and now the gadget bind */
        ret = -EINVAL;
  
@@@ -1508,11 -1492,101 +1531,104 @@@ static void configfs_composite_unbind(s
        purge_configs_funcs(gi);
        composite_dev_cleanup(cdev);
        usb_ep_autoconfig_reset(cdev->gadget);
 +#ifdef CONFIG_AMLOGIC_USB
 +      wakeup_source_trash(&Gadget_Lock.wakesrc);
 +#endif
+       spin_lock_irqsave(&gi->spinlock, flags);
        cdev->gadget = NULL;
        set_gadget_data(gadget, NULL);
+       spin_unlock_irqrestore(&gi->spinlock, flags);
+ }
+ static int configfs_composite_setup(struct usb_gadget *gadget,
+               const struct usb_ctrlrequest *ctrl)
+ {
+       struct usb_composite_dev *cdev;
+       struct gadget_info *gi;
+       unsigned long flags;
+       int ret;
+       cdev = get_gadget_data(gadget);
+       if (!cdev)
+               return 0;
+       gi = container_of(cdev, struct gadget_info, cdev);
+       spin_lock_irqsave(&gi->spinlock, flags);
+       cdev = get_gadget_data(gadget);
+       if (!cdev || gi->unbind) {
+               spin_unlock_irqrestore(&gi->spinlock, flags);
+               return 0;
+       }
+       ret = composite_setup(gadget, ctrl);
+       spin_unlock_irqrestore(&gi->spinlock, flags);
+       return ret;
+ }
+ static void configfs_composite_disconnect(struct usb_gadget *gadget)
+ {
+       struct usb_composite_dev *cdev;
+       struct gadget_info *gi;
+       unsigned long flags;
+       cdev = get_gadget_data(gadget);
+       if (!cdev)
+               return;
+       gi = container_of(cdev, struct gadget_info, cdev);
+       spin_lock_irqsave(&gi->spinlock, flags);
+       cdev = get_gadget_data(gadget);
+       if (!cdev || gi->unbind) {
+               spin_unlock_irqrestore(&gi->spinlock, flags);
+               return;
+       }
+       composite_disconnect(gadget);
+       spin_unlock_irqrestore(&gi->spinlock, flags);
+ }
+ static void configfs_composite_suspend(struct usb_gadget *gadget)
+ {
+       struct usb_composite_dev *cdev;
+       struct gadget_info *gi;
+       unsigned long flags;
+       cdev = get_gadget_data(gadget);
+       if (!cdev)
+               return;
+       gi = container_of(cdev, struct gadget_info, cdev);
+       spin_lock_irqsave(&gi->spinlock, flags);
+       cdev = get_gadget_data(gadget);
+       if (!cdev || gi->unbind) {
+               spin_unlock_irqrestore(&gi->spinlock, flags);
+               return;
+       }
+       composite_suspend(gadget);
+       spin_unlock_irqrestore(&gi->spinlock, flags);
+ }
+ static void configfs_composite_resume(struct usb_gadget *gadget)
+ {
+       struct usb_composite_dev *cdev;
+       struct gadget_info *gi;
+       unsigned long flags;
+       cdev = get_gadget_data(gadget);
+       if (!cdev)
+               return;
+       gi = container_of(cdev, struct gadget_info, cdev);
+       spin_lock_irqsave(&gi->spinlock, flags);
+       cdev = get_gadget_data(gadget);
+       if (!cdev || gi->unbind) {
+               spin_unlock_irqrestore(&gi->spinlock, flags);
+               return;
+       }
+       composite_resume(gadget);
+       spin_unlock_irqrestore(&gi->spinlock, flags);
  }
  
  #ifdef CONFIG_USB_CONFIGFS_UEVENT
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/Makefile
Simple merge
diff --cc fs/block_dev.c
Simple merge
diff --cc fs/char_dev.c
Simple merge
diff --cc fs/ext4/dir.c
index 4ffc5edbdf7df24f4231b75c28cb8bc3dbe85df2,6b3a32f75dadb88e51aaab3271b5b81ddec7453d..022d67f5424f57302fe93c5900e547e3169bd01c
@@@ -106,10 -111,9 +111,9 @@@ static int ext4_readdir(struct file *fi
        struct inode *inode = file_inode(file);
        struct super_block *sb = inode->i_sb;
        struct buffer_head *bh = NULL;
-       int dir_has_error = 0;
        struct fscrypt_str fstr = FSTR_INIT(NULL, 0);
  
 -      if (ext4_encrypted_inode(inode)) {
 +      if (IS_ENCRYPTED(inode)) {
                err = fscrypt_get_encryption_info(inode);
                if (err && err != -ENOKEY)
                        return err;
diff --cc fs/ext4/ext4.h
Simple merge
Simple merge
Simple merge
diff --cc fs/ext4/inode.c
Simple merge
diff --cc fs/ext4/ioctl.c
Simple merge
diff --cc fs/ext4/namei.c
index 6817a897df6db4b6994eb1d7a74b22815807856e,021d6a313c97d58bb98b9ce8730ab043fab61e83..7791eceba65a3796976aeb474e1e1975c11641cc
@@@ -3148,10 -3195,9 +3195,10 @@@ static int ext4_link(struct dentry *old
  
        if (inode->i_nlink >= EXT4_LINK_MAX)
                return -EMLINK;
-       err = fscrypt_prepare_link(old_dentry, dir, dentry);
-       if (err)
-               return err;
 +
+       if (ext4_encrypted_inode(dir) &&
+                       !fscrypt_has_permitted_context(dir, inode))
+               return -EXDEV;
  
         if ((ext4_test_inode_flag(dir, EXT4_INODE_PROJINHERIT)) &&
           (!projid_eq(EXT4_I(dir)->i_projid,
index a7684d39c318ac809373be3fa2206f4b10a481c6,d68032bda4bf096ab726fea88f910afc1f6b6fcb..906dc63ddc0cd53e094c3b5afe397b097d1bee83
@@@ -464,9 -464,17 +464,16 @@@ int ext4_bio_write_page(struct ext4_io_
  
        bh = head = page_buffers(page);
  
 -      if (ext4_encrypted_inode(inode) && S_ISREG(inode->i_mode) &&
 -          nr_to_submit) {
 +      if (IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode) && nr_to_submit) {
                gfp_t gfp_flags = GFP_NOFS;
  
+               /*
+                * Since bounce page allocation uses a mempool, we can only use
+                * a waiting mask (i.e. request guaranteed allocation) on the
+                * first page of the bio.  Otherwise it can deadlock.
+                */
+               if (io->io_bio)
+                       gfp_flags = GFP_NOWAIT | __GFP_NOWARN;
        retry_encrypt:
                data_page = fscrypt_encrypt_page(inode, page, PAGE_SIZE, 0,
                                                page->index, gfp_flags);
diff --cc fs/ext4/super.c
Simple merge
Simple merge
diff --cc fs/f2fs/data.c
Simple merge
diff --cc fs/f2fs/file.c
Simple merge
Simple merge
Simple merge
diff --cc fs/f2fs/super.c
Simple merge
diff --cc fs/inode.c
Simple merge
diff --cc fs/namespace.c
Simple merge
Simple merge
diff --cc fs/pstore/ram.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index f02e87e7ab61de4f6505f204aa545dbfb4ee36c3,b653754ee9cfaec709787c793d8937946faf2995..87a3583db1271f788c0fb31a2fddcd5616c020f1
  #define _DVBFRONTEND_H_
  
  #include <linux/types.h>
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +#include <linux/videodev2.h>
 +#endif
  
- enum fe_type {
-       FE_QPSK,
-       FE_QAM,
-       FE_OFDM,
-       FE_ATSC,
- #ifdef CONFIG_AMLOGIC_DVB_COMPAT
-       FE_ANALOG,
-       FE_DTMB,
-       FE_ISDBT
- #endif
- };
+ /**
+  * enum fe_caps - Frontend capabilities
+  *
+  * @FE_IS_STUPID:                     There's something wrong at the
+  *                                    frontend, and it can't report its
+  *                                    capabilities.
+  * @FE_CAN_INVERSION_AUTO:            Can auto-detect frequency spectral
+  *                                    band inversion
+  * @FE_CAN_FEC_1_2:                   Supports FEC 1/2
+  * @FE_CAN_FEC_2_3:                   Supports FEC 2/3
+  * @FE_CAN_FEC_3_4:                   Supports FEC 3/4
+  * @FE_CAN_FEC_4_5:                   Supports FEC 4/5
+  * @FE_CAN_FEC_5_6:                   Supports FEC 5/6
+  * @FE_CAN_FEC_6_7:                   Supports FEC 6/7
+  * @FE_CAN_FEC_7_8:                   Supports FEC 7/8
+  * @FE_CAN_FEC_8_9:                   Supports FEC 8/9
+  * @FE_CAN_FEC_AUTO:                  Can auto-detect FEC
+  * @FE_CAN_QPSK:                      Supports QPSK modulation
+  * @FE_CAN_QAM_16:                    Supports 16-QAM modulation
+  * @FE_CAN_QAM_32:                    Supports 32-QAM modulation
+  * @FE_CAN_QAM_64:                    Supports 64-QAM modulation
+  * @FE_CAN_QAM_128:                   Supports 128-QAM modulation
+  * @FE_CAN_QAM_256:                   Supports 256-QAM modulation
+  * @FE_CAN_QAM_AUTO:                  Can auto-detect QAM modulation
+  * @FE_CAN_TRANSMISSION_MODE_AUTO:    Can auto-detect transmission mode
+  * @FE_CAN_BANDWIDTH_AUTO:            Can auto-detect bandwidth
+  * @FE_CAN_GUARD_INTERVAL_AUTO:               Can auto-detect guard interval
+  * @FE_CAN_HIERARCHY_AUTO:            Can auto-detect hierarchy
+  * @FE_CAN_8VSB:                      Supports 8-VSB modulation
+  * @FE_CAN_16VSB:                     Supporta 16-VSB modulation
+  * @FE_HAS_EXTENDED_CAPS:             Unused
+  * @FE_CAN_MULTISTREAM:                       Supports multistream filtering
+  * @FE_CAN_TURBO_FEC:                 Supports "turbo FEC" modulation
+  * @FE_CAN_2G_MODULATION:             Supports "2nd generation" modulation,
+  *                                    e. g. DVB-S2, DVB-T2, DVB-C2
+  * @FE_NEEDS_BENDING:                 Unused
+  * @FE_CAN_RECOVER:                   Can recover from a cable unplug
+  *                                    automatically
+  * @FE_CAN_MUTE_TS:                   Can stop spurious TS data output
+  */
  enum fe_caps {
        FE_IS_STUPID                    = 0,
-       FE_CAN_INVERSION_AUTO   = 0x1,
+       FE_CAN_INVERSION_AUTO           = 0x1,
        FE_CAN_FEC_1_2                  = 0x2,
        FE_CAN_FEC_2_3                  = 0x4,
        FE_CAN_FEC_3_4                  = 0x8,
        FE_CAN_HIERARCHY_AUTO           = 0x100000,
        FE_CAN_8VSB                     = 0x200000,
        FE_CAN_16VSB                    = 0x400000,
- /* We need more bitspace for newer APIs, indicate this. */
-       FE_HAS_EXTENDED_CAPS            = 0x800000,
-       FE_CAN_MULTISTREAM              = 0x4000000,  /* frontend supports multistream filtering */
-       FE_CAN_TURBO_FEC                = 0x8000000,  /* frontend supports "turbo fec modulation" */
- /* frontend supports "2nd generation modulation" (DVB-S2) */
-       FE_CAN_2G_MODULATION            = 0x10000000,
-       FE_NEEDS_BENDING                = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
-       FE_CAN_RECOVER                  = 0x40000000, /* frontend can recover from a cable unplug automatically */
-       FE_CAN_MUTE_TS                  = 0x80000000  /* frontend can stop spurious TS data output */
+       FE_HAS_EXTENDED_CAPS            = 0x800000,
+       FE_CAN_MULTISTREAM              = 0x4000000,
+       FE_CAN_TURBO_FEC                = 0x8000000,
+       FE_CAN_2G_MODULATION            = 0x10000000,
+       FE_NEEDS_BENDING                = 0x20000000,
+       FE_CAN_RECOVER                  = 0x40000000,
+       FE_CAN_MUTE_TS                  = 0x80000000
  };
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +#define FE_CAN_3_LAYER FE_CAN_MULTISTREAM
 +#endif
++
+ /*
+  * DEPRECATED: Should be kept just due to backward compatibility.
+  */
+ enum fe_type {
+       FE_QPSK,
+       FE_QAM,
+       FE_OFDM,
+       FE_ATSC
++#ifdef CONFIG_AMLOGIC_DVB_COMPAT
++      FE_ANALOG,
++      FE_DTMB,
++      FE_ISDBT
++#endif
+ };
+ /**
+  * struct dvb_frontend_info - Frontend properties and capabilities
+  *
+  * @name:                     Name of the frontend
+  * @type:                     **DEPRECATED**.
+  *                            Should not be used on modern programs,
+  *                            as a frontend may have more than one type.
+  *                            In order to get the support types of a given
+  *                            frontend, use :c:type:`DTV_ENUM_DELSYS`
+  *                            instead.
+  * @frequency_min:            Minimal frequency supported by the frontend.
+  * @frequency_max:            Minimal frequency supported by the frontend.
+  * @frequency_stepsize:               All frequencies are multiple of this value.
+  * @frequency_tolerance:      Frequency tolerance.
+  * @symbol_rate_min:          Minimal symbol rate, in bauds
+  *                            (for Cable/Satellite systems).
+  * @symbol_rate_max:          Maximal symbol rate, in bauds
+  *                            (for Cable/Satellite systems).
+  * @symbol_rate_tolerance:    Maximal symbol rate tolerance, in ppm
+  *                            (for Cable/Satellite systems).
+  * @notifier_delay:           **DEPRECATED**. Not used by any driver.
+  * @caps:                     Capabilities supported by the frontend,
+  *                            as specified in &enum fe_caps.
+  *
+  * .. note:
+  *
+  *    #. The frequencies are specified in Hz for Terrestrial and Cable
+  *       systems.
+  *    #. The frequencies are specified in kHz for Satellite systems.
+  */
  struct dvb_frontend_info {
        char       name[128];
        enum fe_type type;      /* DEPRECATED. Use DTV_ENUM_DELSYS instead */
@@@ -128,33 -235,43 +247,49 @@@ enum fe_sec_mini_cmd 
  };
  
  /**
-  * enum fe_status - enumerates the possible frontend status
-  * @FE_HAS_SIGNAL:    found something above the noise level
-  * @FE_HAS_CARRIER:   found a DVB signal
-  * @FE_HAS_VITERBI:   FEC is stable
-  * @FE_HAS_SYNC:      found sync bytes
-  * @FE_HAS_LOCK:      everything's working
-  * @FE_TIMEDOUT:      no lock within the last ~2 seconds
-  * @FE_REINIT:                frontend was reinitialized, application is recommended
-  *                    to reset DiSEqC, tone and parameters
+  * enum fe_status - Enumerates the possible frontend status.
+  * @FE_NONE:          The frontend doesn't have any kind of lock.
+  *                    That's the initial frontend status
+  * @FE_HAS_SIGNAL:    Has found something above the noise level.
+  * @FE_HAS_CARRIER:   Has found a DVB signal.
+  * @FE_HAS_VITERBI:   FEC inner coding (Viterbi, LDPC or other inner code).
+  *                    is stable.
+  * @FE_HAS_SYNC:      Synchronization bytes was found.
+  * @FE_HAS_LOCK:      DVB were locked and everything is working.
+  * @FE_TIMEDOUT:      Fo lock within the last about 2 seconds.
+  * @FE_REINIT:                Frontend was reinitialized, application is recommended
+  *                    to reset DiSEqC, tone and parameters.
   */
  enum fe_status {
-       FE_HAS_SIGNAL   = 0x01,   /* found something above the noise level */
-       FE_HAS_CARRIER  = 0x02,   /* found a DVB signal  */
-       FE_HAS_VITERBI  = 0x04,   /* FEC is stable  */
-       FE_HAS_SYNC     = 0x08,   /* found sync bytes  */
-       FE_HAS_LOCK     = 0x10,   /* everything's working... */
-       FE_TIMEDOUT     = 0x20,   /* no lock within the last ~2 seconds */
-       FE_REINIT       = 0x40,    /* frontend was reinitialized,  */
+       FE_NONE                 = 0x00,
+       FE_HAS_SIGNAL           = 0x01,
+       FE_HAS_CARRIER          = 0x02,
+       FE_HAS_VITERBI          = 0x04,
+       FE_HAS_SYNC             = 0x08,
+       FE_HAS_LOCK             = 0x10,
+       FE_TIMEDOUT             = 0x20,
+       FE_REINIT               = 0x40,
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +      BLINDSCAN_NONEDO = 0x80, /* not blind scan  */
 +      BLINDSCAN_UPDATESTARTFREQ = 0x100, /* blind scan update start freq  */
 +      BLINDSCAN_UPDATEPROCESS   = 0x200, /* blind scan update process  */
 +      BLINDSCAN_UPDATERESULTFREQ = 0x400/* blind scan update result  */
 +#endif
- }; /* application is recommended to reset */
- /* DiSEqC, tone and parameters */
+ };
  
+ /**
+  * enum fe_spectral_inversion - Type of inversion band
+  *
+  * @INVERSION_OFF:    Don't do spectral band inversion.
+  * @INVERSION_ON:     Do spectral band inversion.
+  * @INVERSION_AUTO:   Autodetect spectral band inversion.
+  *
+  * This parameter indicates if spectral inversion should be presumed or
+  * not. In the automatic setting (``INVERSION_AUTO``) the hardware will try
+  * to figure out the correct setting by itself. If the hardware doesn't
+  * support, the DVB core will try to lock at the carrier first with
+  * inversion off. If it fails, it will try to enable inversion.
+  */
  enum fe_spectral_inversion {
        INVERSION_OFF,
        INVERSION_ON,
@@@ -235,26 -454,8 +472,27 @@@ enum fe_interleaving 
        INTERLEAVING_720,
  };
  
- /* S2API Commands */
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +struct fe_blind_scan_parameters {
 +      /* minimum tuner frequency in kHz */
 +      __u32 min_frequency;
 +      /* maximum tuner frequency in kHz */
 +      __u32 max_frequency;
 +      /* minimum symbol rate in sym/sec */
 +      __u32 min_symbol_rate;
 +      /* maximum symbol rate in sym/sec */
 +      __u32 max_symbol_rate;
 +      /* search range in kHz. freq -/+freqRange will be searched */
 +      __u32 frequency_range;
 +      /* tuner step frequency in kHz */
 +      __u32 frequency_step;
 +      /* blindscan event timeout */
 +      __s32 timeout;
 +};
 +#endif
 +
+ /* DVBv5 property Commands */
  #define DTV_UNDEFINED         0
  #define DTV_TUNE              1
  #define DTV_CLEAR             2
  #define DTV_STAT_ERROR_BLOCK_COUNT    68
  #define DTV_STAT_TOTAL_BLOCK_COUNT    69
  
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +
 +/* Get tne TS input of the frontend */
 +#define DTV_TS_INPUT                    100
 +/* Blind scan */
 +#define DTV_START_BLIND_SCAN            101
 +#define DTV_CANCEL_BLIND_SCAN           102
 +#define DTV_BLIND_SCAN_MIN_FRE          103
 +#define DTV_BLIND_SCAN_MAX_FRE          104
 +#define DTV_BLIND_SCAN_MIN_SRATE        105
 +#define DTV_BLIND_SCAN_MAX_SRATE        106
 +#define DTV_BLIND_SCAN_FRE_RANGE        107
 +#define DTV_BLIND_SCAN_FRE_STEP         108
 +#define DTV_BLIND_SCAN_TIMEOUT          109
 +/* Blind scan end*/
 +#define DTV_DELIVERY_SUB_SYSTEM                       110
 +#define DTV_MAX_COMMAND               DTV_DELIVERY_SUB_SYSTEM
 +
 +#else  /*!defined(CONFIG_AMLOGIC_DVB_COMPAT)*/
 +
  #define DTV_MAX_COMMAND               DTV_STAT_TOTAL_BLOCK_COUNT
  
 +#endif /*CONFIG_AMLOGIC_DVB_COMPAT*/
 +
+ /**
+  * enum fe_pilot - Type of pilot tone
+  *
+  * @PILOT_ON: Pilot tones enabled
+  * @PILOT_OFF:        Pilot tones disabled
+  * @PILOT_AUTO:       Autodetect pilot tones
+  */
  enum fe_pilot {
        PILOT_ON,
        PILOT_OFF,
@@@ -405,17 -641,27 +702,30 @@@ enum fe_delivery_system 
        SYS_DVBT2,
        SYS_TURBO,
        SYS_DVBC_ANNEX_C,
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +      SYS_ANALOG
 +#endif
  };
  
- /* backward compatibility */
+ /* backward compatibility definitions for delivery systems */
  #define SYS_DVBC_ANNEX_AC     SYS_DVBC_ANNEX_A
- #define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */
+ #define SYS_DMBTH             SYS_DTMB /* DMB-TH is legacy name, use DTMB */
  
- /* ATSC-MH */
+ /* ATSC-MH specific parameters */
  
+ /**
+  * enum atscmh_sccc_block_mode - Type of Series Concatenated Convolutional
+  *                             Code Block Mode.
+  *
+  * @ATSCMH_SCCC_BLK_SEP:
+  *    Separate SCCC: the SCCC outer code mode shall be set independently
+  *    for each Group Region (A, B, C, D)
+  * @ATSCMH_SCCC_BLK_COMB:
+  *    Combined SCCC: all four Regions shall have the same SCCC outer
+  *    code mode.
+  * @ATSCMH_SCCC_BLK_RES:
+  *    Reserved. Shouldn't be used.
+  */
  enum atscmh_sccc_block_mode {
        ATSCMH_SCCC_BLK_SEP      = 0,
        ATSCMH_SCCC_BLK_COMB     = 1,
@@@ -555,18 -860,53 +924,66 @@@ struct dtv_property 
  /* num of properties cannot exceed DTV_IOCTL_MAX_MSGS per ioctl */
  #define DTV_IOCTL_MAX_MSGS 64
  
+ /**
+  * struct dtv_properties - a set of command/value pairs.
+  *
+  * @num:      amount of commands stored at the struct.
+  * @props:    a pointer to &struct dtv_property.
+  */
  struct dtv_properties {
        __u32 num;
- #if 0 && defined(CONFIG_AMLOGIC_DVB_COMPAT)
-       union {
-               struct dtv_property *props;
-               __u64                reserved;
-       };
- #else
        struct dtv_property *props;
- #endif
  };
  
+ /*
+  * When set, this flag will disable any zigzagging or other "normal" tuning
+  * behavior. Additionally, there will be no automatic monitoring of the lock
+  * status, and hence no frontend events will be generated. If a frontend device
+  * is closed, this flag will be automatically turned off when the device is
+  * reopened read-write.
+  */
+ #define FE_TUNE_MODE_ONESHOT 0x01
+ /* Digital TV Frontend API calls */
+ #define FE_GET_INFO              _IOR('o', 61, struct dvb_frontend_info)
+ #define FE_DISEQC_RESET_OVERLOAD   _IO('o', 62)
+ #define FE_DISEQC_SEND_MASTER_CMD  _IOW('o', 63, struct dvb_diseqc_master_cmd)
+ #define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
+ #define FE_DISEQC_SEND_BURST       _IO('o', 65)  /* fe_sec_mini_cmd_t */
+ #define FE_SET_TONE              _IO('o', 66)  /* fe_sec_tone_mode_t */
+ #define FE_SET_VOLTAGE                   _IO('o', 67)  /* fe_sec_voltage_t */
+ #define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68)  /* int */
+ #define FE_READ_STATUS                   _IOR('o', 69, fe_status_t)
+ #define FE_READ_BER              _IOR('o', 70, __u32)
+ #define FE_READ_SIGNAL_STRENGTH    _IOR('o', 71, __u16)
+ #define FE_READ_SNR              _IOR('o', 72, __u16)
+ #define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
+ #define FE_SET_FRONTEND_TUNE_MODE  _IO('o', 81) /* unsigned int */
+ #define FE_GET_EVENT             _IOR('o', 78, struct dvb_frontend_event)
+ #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
+ #define FE_SET_PROPERTY                  _IOW('o', 82, struct dtv_properties)
+ #define FE_GET_PROPERTY                  _IOR('o', 83, struct dtv_properties)
++#ifdef CONFIG_AMLOGIC_DVB_COMPAT
++/*need del this ioctl, used set PROPERTY instead*/
++#define FE_SET_DELAY               _IO('o', 100)
++#define FE_READ_AFC                _IOR('o', 91, __u32)
++#define FE_FINE_TUNE               _IOW('o', 92, __u32)
++#define FE_READ_TUNER_STATUS       _IOR('o', 93, struct tuner_status_s)
++#define FE_READ_ANALOG_STATUS      _IOR('o', 94, struct atv_status_s)
++#define FE_READ_SD_STATUS          _IOR('o', 95, struct sound_status_s)
++/*set & get the tuner parameters only atv*/
++#define FE_SET_PARAM_BOX           _IOWR('o', 97, struct tuner_param_s)
++#define FE_SET_AFC                 _IOW('o', 98, __u32)
++#endif /*CONFIG_AMLOGIC_DVB_COMPAT*/
++
  #if defined(__DVB_CORE__) || !defined (__KERNEL__)
  
  /*
@@@ -603,13 -954,8 +1031,15 @@@ typedef enum fe_pilot fe_pilot_t
  typedef enum fe_rolloff fe_rolloff_t;
  typedef enum fe_delivery_system fe_delivery_system_t;
  
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +enum fe_ofdm_mode {
 +      OFDM_DVBT,
 +      OFDM_DVBT2,
 +};
 +#endif
 +
+ /* DVBv3 structs */
  struct dvb_qpsk_parameters {
        __u32           symbol_rate;  /* symbol rate in Symbols per second */
        fe_code_rate_t  fec_inner;    /* forward error correction (see above) */
@@@ -635,25 -981,9 +1065,24 @@@ struct dvb_ofdm_parameters 
        fe_hierarchy_t      hierarchy_information;
  };
  
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +#define ANALOG_FLAG_ENABLE_AFC                 0X00000001
 +#define  ANALOG_FLAG_MANUL_SCAN                0x00000011
 +struct dvb_analog_parameters {
 +      /*V4L2_TUNER_MODE_MONO,V4L2_TUNER_MODE_STEREO,*/
 +      /*V4L2_TUNER_MODE_LANG2,V4L2_TUNER_MODE_SAP,*/
 +      /*V4L2_TUNER_MODE_LANG1,V4L2_TUNER_MODE_LANG1_LANG2 */
 +      unsigned int audmode;
 +      unsigned int soundsys;  /*A2,BTSC,EIAJ,NICAM */
 +      v4l2_std_id std;
 +      unsigned int flag;
 +      unsigned int afc_range;
 +};
 +#endif
 +
  struct dvb_frontend_parameters {
-       /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */
-       __u32 frequency;
-       /* intermediate frequency in kHz for DVB-S */
+       __u32 frequency;     /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */
+                            /* intermediate frequency in kHz for DVB-S */
        fe_spectral_inversion_t inversion;
        union {
                struct dvb_qpsk_parameters qpsk;        /* DVB-S */
@@@ -695,163 -997,12 +1121,122 @@@ struct dvb_frontend_event 
        fe_status_t status;
        struct dvb_frontend_parameters parameters;
  };
- #endif
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +/* Satellite blind scan event */
 +struct dvbsx_blindscanevent {
 +      enum fe_status status;
 +      union {
 +              /* The percentage completion of the*/
 +              /*blind scan procedure. A value of*/
 +              /*100 indicates that the blind scan*/
 +              /*is finished. */
 +              __u16 m_uiprogress;
 +              /*The start scan frequency in units of kHz.*/
 +              /*The minimum value depends on the tuner*/
 +              /*specification.*/
 +              __u32 m_uistartfreq_khz;
 +              /* Blind scan channel info. */
 +              struct dvb_frontend_parameters parameters;
 +      } u;
 +};
 +#endif /*CONFIG_AMLOGIC_DVB_COMPAT*/
- #define FE_SET_PROPERTY                  _IOW('o', 82, struct dtv_properties)
- #define FE_GET_PROPERTY                  _IOR('o', 83, struct dtv_properties)
 +
+ /* DVBv3 API calls */
+ #define FE_SET_FRONTEND                  _IOW('o', 76, struct dvb_frontend_parameters)
+ #define FE_GET_FRONTEND                  _IOR('o', 77, struct dvb_frontend_parameters)
+ #endif
  
- /**
-  * When set, this flag will disable any zigzagging or other "normal" tuning
-  * behaviour. Additionally, there will be no automatic monitoring of the lock
-  * status, and hence no frontend events will be generated. If a frontend device
-  * is closed, this flag will be automatically turned off when the device is
-  * reopened read-write.
-  */
- #define FE_TUNE_MODE_ONESHOT 0x01
- #define FE_GET_INFO              _IOR('o', 61, struct dvb_frontend_info)
- #define FE_DISEQC_RESET_OVERLOAD   _IO('o', 62)
- #define FE_DISEQC_SEND_MASTER_CMD  _IOW('o', 63, struct dvb_diseqc_master_cmd)
- #define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
- #define FE_DISEQC_SEND_BURST       _IO('o', 65)  /* fe_sec_mini_cmd_t */
- #define FE_SET_TONE              _IO('o', 66)  /* fe_sec_tone_mode_t */
- #define FE_SET_VOLTAGE                   _IO('o', 67)  /* fe_sec_voltage_t */
- #define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68)  /* int */
- #define FE_READ_STATUS                   _IOR('o', 69, fe_status_t)
- #define FE_READ_BER              _IOR('o', 70, __u32)
- #define FE_READ_SIGNAL_STRENGTH    _IOR('o', 71, __u16)
- #define FE_READ_SNR              _IOR('o', 72, __u16)
- #define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
- #define FE_SET_FRONTEND                  _IOW('o', 76, struct dvb_frontend_parameters)
- #define FE_GET_FRONTEND                  _IOR('o', 77, struct dvb_frontend_parameters)
- #define FE_SET_FRONTEND_TUNE_MODE  _IO('o', 81) /* unsigned int */
- #define FE_GET_EVENT             _IOR('o', 78, struct dvb_frontend_event)
- #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
- #ifdef CONFIG_AMLOGIC_DVB_COMPAT
- /*need del this ioctl, used set PROPERTY instead*/
- #define FE_SET_DELAY               _IO('o', 100)
- #define FE_READ_AFC                _IOR('o', 91, __u32)
- #define FE_FINE_TUNE               _IOW('o', 92, __u32)
- #define FE_READ_TUNER_STATUS       _IOR('o', 93, struct tuner_status_s)
- #define FE_READ_ANALOG_STATUS      _IOR('o', 94, struct atv_status_s)
- #define FE_READ_SD_STATUS          _IOR('o', 95, struct sound_status_s)
- /*set & get the tuner parameters only atv*/
- #define FE_SET_PARAM_BOX           _IOWR('o', 97, struct tuner_param_s)
- #define FE_SET_AFC                 _IOW('o', 98, __u32)
- #endif /*CONFIG_AMLOGIC_DVB_COMPAT*/
 +#ifdef CONFIG_AMLOGIC_DVB_COMPAT
 +/*for atv*/
 +struct tuner_status_s {
 +      unsigned int frequency;
 +      unsigned int rssi;
 +      unsigned char mode;/*dtv:0 or atv:1*/
 +      unsigned char tuner_locked;/*notlocked:0,locked:1*/
 +      union {
 +              void *ressrved;
 +              __u64 reserved1;
 +      };
 +};
 +
 +
 +struct atv_status_s {
 +      unsigned char atv_lock;/*notlocked:0,locked 1*/
 +      v4l2_std_id       std;
 +      unsigned int  audmode;
 +      int  snr;
 +      int  afc;
 +      union {
 +              void *resrvred;
 +              __u64 reserved1;
 +      };
 +};
 +
 +struct sound_status_s {
 +      unsigned short sound_sys;/*A2DK/A2BG/NICAM BG/NICAM DK/BTSC/EIAJ*/
 +      unsigned short sound_mode;/*SETERO/DUAL/MONO/SAP*/
 +      union {
 +              void *resrvred;
 +              __u64 reserved1;
 +      };
 +};
 +
 +
 +enum tuner_param_cmd_e {
 +      TUNER_CMD_AUDIO_MUTE = 0x0000,
 +      TUNER_CMD_AUDIO_ON,
 +      TUNER_CMD_TUNER_POWER_ON,
 +      TUNER_CMD_TUNER_POWER_DOWN,
 +      TUNER_CMD_SET_VOLUME,
 +      TUNER_CMD_SET_LEAP_SETP_SIZE,
 +      TUNER_CMD_GET_MONO_MODE,
 +      TUNER_CMD_SET_BEST_LOCK_RANGE,
 +      TUNER_CMD_GET_BEST_LOCK_RANGE,
 +      TUNER_CMD_SET_CVBS_AMP_OUT,
 +      TUNER_CMD_GET_CVBS_AMP_OUT,
 +      TUNER_CMD_NULL,
 +};
 +
 +
 +/*parameter for set param box*/
 +struct tuner_param_s {
 +      enum tuner_param_cmd_e cmd;
 +      unsigned int      parm;
 +      unsigned int    resvred;
 +};
 +
 +
 +enum fe_layer {
 +      Layer_A_B_C,
 +      Layer_A,
 +      Layer_B,
 +      Layer_C,
 +};
 +
 +// typedef struct dvb_analog_parameters dvb_analog_parameters_t;
 +// typedef struct tuner_status_s tuner_status_t;
 +// typedef struct atv_status_s atv_status_t;
 +// typedef struct sound_status_s sound_status_t;
 +// typedef enum tuner_param_cmd_e tuner_param_cmd_t;
 +// typedef struct tuner_param_s tuner_param_t;
 +// typedef enum fe_layer fe_layer_t;
 +// typedef enum fe_ofdm_mode fe_ofdm_mode_t;
 +
 +
 +/* Satellite blind scan settings */
 +struct dvbsx_blindscanpara {
 +      __u32 minfrequency;/* minimum tuner frequency in kHz */
 +      __u32 maxfrequency;/* maximum tuner frequency in kHz */
 +      __u32 minSymbolRate;/* minimum symbol rate in sym/sec */
 +      __u32 maxSymbolRate;/* maximum symbol rate in sym/sec */
 +      /*search range in kHz. freq -/+freqRange will be searched */
 +      __u32 frequencyRange;
 +      __u32 frequencyStep;/* tuner step frequency in kHz */
 +      __s32 timeout;/* blindscan event timeout*/
 +};
 +#endif /*CONFIG_AMLOGIC_DVB_COMPAT*/
 +
  #endif /*_DVBFRONTEND_H_*/
diff --cc init/main.c
Simple merge
diff --cc init/version.c
Simple merge
diff --cc kernel/cgroup.c
Simple merge
diff --cc kernel/cpu.c
Simple merge
diff --cc kernel/fork.c
Simple merge
Simple merge
diff --cc kernel/module.c
Simple merge
diff --cc kernel/panic.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/sysctl.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mm/cma.c
Simple merge
diff --cc mm/internal.h
Simple merge
diff --cc mm/kmemleak.c
Simple merge
diff --cc mm/ksm.c
Simple merge
diff --cc mm/memory.c
Simple merge
diff --cc mm/page_alloc.c
index 2628585df933c8faeb45dadcfdae123c2c974d23,d30ba08120f1c48f492dcbdbeec2c2491ad81748..101bdd9ef7dabd08506d5dc8ac5a8d03cfe7e9c5
  #include <linux/page_owner.h>
  #include <linux/kthread.h>
  #include <linux/memcontrol.h>
+ #include <linux/khugepaged.h>
  #include <linux/psi.h>
 +#ifdef CONFIG_AMLOGIC_PAGE_TRACE
 +#include <linux/amlogic/page_trace.h>
 +#endif /* CONFIG_AMLOGIC_PAGE_TRACE */
  
  #include <asm/sections.h>
  #include <asm/tlbflush.h>
diff --cc mm/shmem.c
Simple merge
Simple merge
diff --cc mm/slub.c
index f1827060b18f807bbb3d867bef8f3db052181835,20cb89548ea2786f8f65c59d637bf68936ee02a0..4567b0aaae849bdb6403adbc1a14f55d8589b3d2
+++ b/mm/slub.c
@@@ -2949,11 -2969,10 +2984,13 @@@ redo
        /* Same with comment on barrier() in slab_alloc_node() */
        barrier();
  
 +#ifdef CONFIG_AMLOGIC_SLAB_TRACE
 +      slab_trace_remove_object(head, s);
 +#endif
        if (likely(page == c->page)) {
-               set_freepointer(s, tail_obj, c->freelist);
+               void **freelist = READ_ONCE(c->freelist);
+               set_freepointer(s, tail_obj, freelist);
  
                if (unlikely(!this_cpu_cmpxchg_double(
                                s->cpu_slab->freelist, s->cpu_slab->tid,
diff --cc mm/swap_state.c
Simple merge
diff --cc mm/vmalloc.c
Simple merge
diff --cc mm/vmstat.c
Simple merge
Simple merge
diff --cc net/ipv4/tcp.c
Simple merge
index 555a3e75fbae72ba79320327ae81413ae1682852,e6470074019fd724e8f6530fc512db6bb202978c..22de7d80943427ae340cf6e2b645bdcf6f5325b5
@@@ -4511,9 -4535,14 +4535,13 @@@ static void tcp_data_queue_ofo(struct s
        /* In the typical case, we are adding an skb to the end of the list.
         * Use of ooo_last_skb avoids the O(Log(N)) rbtree lookup.
         */
 -      if (tcp_ooo_try_coalesce(sk, tp->ooo_last_skb,
 -                               skb, &fragstolen)) {
 +      if (tcp_ooo_try_coalesce(sk, tp->ooo_last_skb, skb, &fragstolen)) {
  coalesce_done:
-               tcp_grow_window(sk, skb);
+               /* For non sack flows, do not grow window to force DUPACK
+                * and trigger fast retransmit.
+                */
+               if (tcp_is_sack(tp))
+                       tcp_grow_window(sk, skb);
                kfree_skb_partial(skb, fragstolen);
                skb = NULL;
                goto add_sack;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 82b6eba1c73da5fcfadb479c7e18f522e248fb14,262922cf6a0ccf0a5b78c43c9fe704bd87f2e90d..8efc074fa8fbd717cadec135141f63635ceff568
@@@ -1938,57 -1795,47 +1939,101 @@@ const unsigned char bridge_tunnel_heade
        { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
  EXPORT_SYMBOL(bridge_tunnel_header);
  
 +#ifdef CONFIG_AMLOGIC_MODIFY
 +bool cfg80211_is_gratuitous_arp_unsolicited_na(struct sk_buff *skb)
 +{
 +      const struct ethhdr *eth = (void *)skb->data;
 +
 +      const struct {
 +          struct arphdr hdr;
 +          u8 ar_sha[ETH_ALEN];
 +          u8 ar_sip[4];
 +          u8 ar_tha[ETH_ALEN];
 +          u8 ar_tip[4];
 +      } __packed * arp;
 +      const struct ipv6hdr *ipv6;
 +      const struct icmp6hdr *icmpv6;
 +
 +      switch (eth->h_proto) {
 +      case cpu_to_be16(ETH_P_ARP):
 +              /* can't say - but will probably be dropped later anyway */
 +              if (!pskb_may_pull(skb, sizeof(*eth) + sizeof(*arp)))
 +                      return false;
 +
 +              arp = (void *)(eth + 1);
 +
 +              if ((arp->hdr.ar_op == cpu_to_be16(ARPOP_REPLY) ||
 +                      arp->hdr.ar_op == cpu_to_be16(ARPOP_REQUEST)) &&
 +                      !memcmp(arp->ar_sip, arp->ar_tip, sizeof(arp->ar_sip)))
 +                      return true;
 +              break;
 +      case cpu_to_be16(ETH_P_IPV6):
 +          /* can't say - but will probably be dropped later anyway */
 +              if (!pskb_may_pull(skb, sizeof(*eth) + sizeof(*ipv6) +
 +                      sizeof(*icmpv6)))
 +                      return false;
 +
 +              ipv6 = (void *)(eth + 1);
 +              icmpv6 = (void *)(ipv6 + 1);
 +
 +              if (icmpv6->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT &&
 +                      !memcmp(&ipv6->saddr, &ipv6->daddr,
 +                              sizeof(ipv6->saddr)))
 +                      return true;
 +              break;
 +      default:
 +              /* no need to support other protocols, proxy service isn't
 +               * specified for any others
 +               */
 +              break;
 +      }
 +
 +      return false;
 +}
 +EXPORT_SYMBOL(cfg80211_is_gratuitous_arp_unsolicited_na);
 +#endif
 +
+ /* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */
+ struct iapp_layer2_update {
+       u8 da[ETH_ALEN];        /* broadcast */
+       u8 sa[ETH_ALEN];        /* STA addr */
+       __be16 len;             /* 6 */
+       u8 dsap;                /* 0 */
+       u8 ssap;                /* 0 */
+       u8 control;
+       u8 xid_info[3];
+ } __packed;
+ void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr)
+ {
+       struct iapp_layer2_update *msg;
+       struct sk_buff *skb;
+       /* Send Level 2 Update Frame to update forwarding tables in layer 2
+        * bridge devices */
+       skb = dev_alloc_skb(sizeof(*msg));
+       if (!skb)
+               return;
+       msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg));
+       /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID)
+        * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */
+       eth_broadcast_addr(msg->da);
+       ether_addr_copy(msg->sa, addr);
+       msg->len = htons(6);
+       msg->dsap = 0;
+       msg->ssap = 0x01;       /* NULL LSAP, CR Bit: Response */
+       msg->control = 0xaf;    /* XID response lsb.1111F101.
+                                * F=0 (no poll command; unsolicited frame) */
+       msg->xid_info[0] = 0x81;        /* XID format identifier */
+       msg->xid_info[1] = 1;   /* LLC types/classes: Type 1 LLC */
+       msg->xid_info[2] = 0;   /* XID sender's receive window size (RW) */
+       skb->dev = dev;
+       skb->protocol = eth_type_trans(skb, dev);
+       memset(skb->cb, 0, sizeof(skb->cb));
+       netif_rx_ni(skb);
+ }
+ EXPORT_SYMBOL(cfg80211_send_layer2_update);
Simple merge
Simple merge
Simple merge
diff --cc sound/usb/pcm.c
Simple merge