From c7edc3e882a70edfa0019e4dcafed8cb8cf37710 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 25 Aug 2017 07:56:14 +0200 Subject: [PATCH] Kernel 4.4 upstream patches and small bugfix with mvebu64 --- config/kernel/linux-mvebu64-default.config | 2 +- config/kernel/linux-rk3328-default.config | 2 +- config/kernel/linux-rockchip-default.config | 3 +- config/kernel/linux-udoo-next.config | 2 +- .../mvebu-default/03-patch-4.4.82-83.patch | 476 +++++++++++ .../mvebu-default/03-patch-4.4.83-84.patch | 761 ++++++++++++++++++ .../mvebu64-default/03-patch-4.4.82-83.patch | 476 +++++++++++ .../mvebu64-default/03-patch-4.4.83-84.patch | 761 ++++++++++++++++++ ...DMA_block_memory_allocation_to_2048.patch} | 2 +- .../rk3328-default/patch-4.4.83-84.patch | 761 ++++++++++++++++++ .../rockchip-default/03-patch-4.4.81-82.patch | 330 ++++++++ .../rockchip-default/03-patch-4.4.82-83.patch | 476 +++++++++++ .../rockchip-default/03-patch-4.4.83-84.patch | 761 ++++++++++++++++++ .../kernel/udoo-next/03-patch-4.4.82-83.patch | 476 +++++++++++ .../kernel/udoo-next/03-patch-4.4.83-84.patch | 761 ++++++++++++++++++ 15 files changed, 6044 insertions(+), 6 deletions(-) create mode 100644 patch/kernel/mvebu-default/03-patch-4.4.82-83.patch create mode 100644 patch/kernel/mvebu-default/03-patch-4.4.83-84.patch create mode 100644 patch/kernel/mvebu64-default/03-patch-4.4.82-83.patch create mode 100644 patch/kernel/mvebu64-default/03-patch-4.4.83-84.patch rename patch/kernel/mvebu64-default/{arm64_increasing_DMA_block_memory_allocation_to_2048.patch => arm64_espressobin_increasing_DMA_block_memory_allocation_to_2048.patch} (85%) create mode 100644 patch/kernel/rk3328-default/patch-4.4.83-84.patch create mode 100644 patch/kernel/rockchip-default/03-patch-4.4.81-82.patch create mode 100644 patch/kernel/rockchip-default/03-patch-4.4.82-83.patch create mode 100644 patch/kernel/rockchip-default/03-patch-4.4.83-84.patch create mode 100644 patch/kernel/udoo-next/03-patch-4.4.82-83.patch create mode 100644 patch/kernel/udoo-next/03-patch-4.4.83-84.patch diff --git a/config/kernel/linux-mvebu64-default.config b/config/kernel/linux-mvebu64-default.config index fc8b289d9..2200820c4 100644 --- a/config/kernel/linux-mvebu64-default.config +++ b/config/kernel/linux-mvebu64-default.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 4.4.82 Kernel Configuration +# Linux/arm64 4.4.84 Kernel Configuration # CONFIG_ARM64=y CONFIG_64BIT=y diff --git a/config/kernel/linux-rk3328-default.config b/config/kernel/linux-rk3328-default.config index 0ff4a1ebe..cdf4a9b56 100644 --- a/config/kernel/linux-rk3328-default.config +++ b/config/kernel/linux-rk3328-default.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm64 4.4.83 Kernel Configuration +# Linux/arm64 4.4.84 Kernel Configuration # CONFIG_ARM64=y CONFIG_64BIT=y diff --git a/config/kernel/linux-rockchip-default.config b/config/kernel/linux-rockchip-default.config index fb9d0345f..7f34f8bae 100644 --- a/config/kernel/linux-rockchip-default.config +++ b/config/kernel/linux-rockchip-default.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.4.81 Kernel Configuration +# Linux/arm 4.4.84 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2513,7 +2513,6 @@ CONFIG_VIDEO_V4L2=y # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set CONFIG_VIDEO_TUNER=m CONFIG_VIDEOBUF_GEN=m -CONFIG_VIDEOBUF_DMA_CONTIG=m CONFIG_VIDEOBUF2_CORE=y CONFIG_VIDEOBUF2_MEMOPS=y CONFIG_VIDEOBUF2_DMA_CONTIG=y diff --git a/config/kernel/linux-udoo-next.config b/config/kernel/linux-udoo-next.config index 0dd0000e3..fdac49ff1 100644 --- a/config/kernel/linux-udoo-next.config +++ b/config/kernel/linux-udoo-next.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.4.82 Kernel Configuration +# Linux/arm 4.4.84 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y diff --git a/patch/kernel/mvebu-default/03-patch-4.4.82-83.patch b/patch/kernel/mvebu-default/03-patch-4.4.82-83.patch new file mode 100644 index 000000000..104c0c331 --- /dev/null +++ b/patch/kernel/mvebu-default/03-patch-4.4.82-83.patch @@ -0,0 +1,476 @@ +diff --git a/Makefile b/Makefile +index 52f2dd8dcebd..7f67b35caf99 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 82 ++SUBLEVEL = 83 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c +index fa24d5196615..c7122919a8c0 100644 +--- a/drivers/iio/accel/bmc150-accel-core.c ++++ b/drivers/iio/accel/bmc150-accel-core.c +@@ -194,7 +194,6 @@ struct bmc150_accel_data { + struct device *dev; + int irq; + struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS]; +- atomic_t active_intr; + struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS]; + struct mutex mutex; + u8 fifo_mode, watermark; +@@ -489,11 +488,6 @@ static int bmc150_accel_set_interrupt(struct bmc150_accel_data *data, int i, + goto out_fix_power_state; + } + +- if (state) +- atomic_inc(&data->active_intr); +- else +- atomic_dec(&data->active_intr); +- + return 0; + + out_fix_power_state: +@@ -1704,8 +1698,7 @@ static int bmc150_accel_resume(struct device *dev) + struct bmc150_accel_data *data = iio_priv(indio_dev); + + mutex_lock(&data->mutex); +- if (atomic_read(&data->active_intr)) +- bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); ++ bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); + bmc150_accel_fifo_set_mode(data); + mutex_unlock(&data->mutex); + +diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c +index b10f629cc44b..1dbc2143cdfc 100644 +--- a/drivers/iio/adc/vf610_adc.c ++++ b/drivers/iio/adc/vf610_adc.c +@@ -77,7 +77,7 @@ + #define VF610_ADC_ADSTS_MASK 0x300 + #define VF610_ADC_ADLPC_EN 0x80 + #define VF610_ADC_ADHSC_EN 0x400 +-#define VF610_ADC_REFSEL_VALT 0x100 ++#define VF610_ADC_REFSEL_VALT 0x800 + #define VF610_ADC_REFSEL_VBG 0x1000 + #define VF610_ADC_ADTRG_HARD 0x2000 + #define VF610_ADC_AVGS_8 0x4000 +diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c +index 12731d6b89ec..ec1b2e798cc1 100644 +--- a/drivers/iio/light/tsl2563.c ++++ b/drivers/iio/light/tsl2563.c +@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private) + struct tsl2563_chip *chip = iio_priv(dev_info); + + iio_push_event(dev_info, +- IIO_UNMOD_EVENT_CODE(IIO_LIGHT, ++ IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, + 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_EITHER), +diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c +index 71ccf6a90b22..2551e4adb33f 100644 +--- a/drivers/pinctrl/samsung/pinctrl-exynos.c ++++ b/drivers/pinctrl/samsung/pinctrl-exynos.c +@@ -194,8 +194,6 @@ static int exynos_irq_request_resources(struct irq_data *irqd) + + spin_unlock_irqrestore(&bank->slock, flags); + +- exynos_irq_unmask(irqd); +- + return 0; + } + +@@ -216,8 +214,6 @@ static void exynos_irq_release_resources(struct irq_data *irqd) + shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC]; + mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; + +- exynos_irq_mask(irqd); +- + spin_lock_irqsave(&bank->slock, flags); + + con = readl(d->virt_base + reg_con); +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +index 862a096c5dba..be5c71df148d 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +@@ -811,6 +811,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = { + SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */ + SUNXI_FUNCTION(0x3, "pata"), /* ATAD12 */ + SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */ ++ SUNXI_FUNCTION(0x5, "sim"), /* DET */ + SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */ + SUNXI_FUNCTION(0x7, "csi1")), /* D16 */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17), +diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c +index d97aa2827412..8eb7179da342 100644 +--- a/drivers/staging/iio/resolver/ad2s1210.c ++++ b/drivers/staging/iio/resolver/ad2s1210.c +@@ -468,7 +468,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev, + long m) + { + struct ad2s1210_state *st = iio_priv(indio_dev); +- bool negative; ++ u16 negative; + int ret = 0; + u16 pos; + s16 vel; +diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c +index 31d5d9c0e10b..1ff1c83e2df5 100644 +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -418,6 +418,7 @@ int iscsit_reset_np_thread( + return 0; + } + np->np_thread_state = ISCSI_NP_THREAD_RESET; ++ atomic_inc(&np->np_reset_count); + + if (np->np_thread) { + spin_unlock_bh(&np->np_thread_lock); +@@ -1996,6 +1997,7 @@ iscsit_setup_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, + cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); + cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); + cmd->data_direction = DMA_NONE; ++ kfree(cmd->text_in_ptr); + cmd->text_in_ptr = NULL; + + return 0; +diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c +index b19edffa7d98..bc2cbffec27e 100644 +--- a/drivers/target/iscsi/iscsi_target_login.c ++++ b/drivers/target/iscsi/iscsi_target_login.c +@@ -1219,9 +1219,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + flush_signals(current); + + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { + np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; ++ spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); ++ return 1; + } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { + spin_unlock_bh(&np->np_thread_lock); + goto exit; +@@ -1254,7 +1256,8 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + goto exit; + } else if (rc < 0) { + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { ++ np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; + spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); + iscsit_put_transport(conn->conn_transport); +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index b403596818db..5c0952995280 100644 +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1851,7 +1851,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, + /* No more submits can occur */ + spin_lock_irq(&hcd_urb_list_lock); + rescan: +- list_for_each_entry (urb, &ep->urb_list, urb_list) { ++ list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) { + int is_in; + + if (urb->unlinked) +@@ -2448,6 +2448,8 @@ void usb_hc_died (struct usb_hcd *hcd) + } + if (usb_hcd_is_primary_hcd(hcd) && hcd->shared_hcd) { + hcd = hcd->shared_hcd; ++ clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags); ++ set_bit(HCD_FLAG_DEAD, &hcd->flags); + if (hcd->rh_registered) { + clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 1d59d489a1ad..cdf4be3939f5 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4661,7 +4661,8 @@ hub_power_remaining(struct usb_hub *hub) + static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, + u16 portchange) + { +- int status, i; ++ int status = -ENODEV; ++ int i; + unsigned unit_load; + struct usb_device *hdev = hub->hdev; + struct usb_hcd *hcd = bus_to_hcd(hdev->bus); +@@ -4865,9 +4866,10 @@ loop: + + done: + hub_port_disable(hub, port1, 1); +- if (hcd->driver->relinquish_port && !hub->hdev->parent) +- hcd->driver->relinquish_port(hcd, port1); +- ++ if (hcd->driver->relinquish_port && !hub->hdev->parent) { ++ if (status != -ENOTCONN && status != -ENODEV) ++ hcd->driver->relinquish_port(hcd, port1); ++ } + } + + /* Handle physical or logical connection change events. +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c +index 3116edfcdc18..574da2b4529c 100644 +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -150,6 +150,9 @@ static const struct usb_device_id usb_quirk_list[] = { + /* appletouch */ + { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, + ++ /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */ ++ { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM }, ++ + /* Avision AV600U */ + { USB_DEVICE(0x0638, 0x0a13), .driver_info = + USB_QUIRK_STRING_FETCH_255 }, +@@ -249,6 +252,7 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = { + { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME }, ++ { USB_DEVICE(0x03f0, 0x2b4a), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Logitech Optical Mouse M90/M100 */ + { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME }, +diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c +index f9400564cb72..03b9a372636f 100644 +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -89,6 +89,7 @@ enum amd_chipset_gen { + AMD_CHIPSET_HUDSON2, + AMD_CHIPSET_BOLTON, + AMD_CHIPSET_YANGTZE, ++ AMD_CHIPSET_TAISHAN, + AMD_CHIPSET_UNKNOWN, + }; + +@@ -132,6 +133,11 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) + pinfo->sb_type.gen = AMD_CHIPSET_SB700; + else if (rev >= 0x40 && rev <= 0x4f) + pinfo->sb_type.gen = AMD_CHIPSET_SB800; ++ } ++ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, ++ 0x145c, NULL); ++ if (pinfo->smbus_dev) { ++ pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; + } else { + pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); +@@ -251,11 +257,12 @@ int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev) + { + /* Make sure amd chipset type has already been initialized */ + usb_amd_find_chipset_info(); +- if (amd_chipset.sb_type.gen != AMD_CHIPSET_YANGTZE) +- return 0; +- +- dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); +- return 1; ++ if (amd_chipset.sb_type.gen == AMD_CHIPSET_YANGTZE || ++ amd_chipset.sb_type.gen == AMD_CHIPSET_TAISHAN) { ++ dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); ++ return 1; ++ } ++ return 0; + } + EXPORT_SYMBOL_GPL(usb_hcd_amd_remote_wakeup_quirk); + +diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c +index 13d5614f37f1..0d843e0f8055 100644 +--- a/drivers/usb/musb/musb_host.c ++++ b/drivers/usb/musb/musb_host.c +@@ -138,6 +138,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) + "Could not flush host TX%d fifo: csr: %04x\n", + ep->epnum, csr)) + return; ++ mdelay(1); + } + } + +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c +index b0dc6da3d970..41a6513646de 100644 +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -135,6 +135,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ + { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ + { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ ++ { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index ebe51f11105d..fe123153b1a5 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2025,6 +2025,8 @@ static const struct usb_device_id option_ids[] = { + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */ ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/A3 */ +diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c +index 1db4b61bdf7b..a51b28379850 100644 +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, ++ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_UC485) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) }, + { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) }, + { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, +diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h +index 09d9be88209e..3b5a15d1dc0d 100644 +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -27,6 +27,7 @@ + #define ATEN_VENDOR_ID 0x0557 + #define ATEN_VENDOR_ID2 0x0547 + #define ATEN_PRODUCT_ID 0x2008 ++#define ATEN_PRODUCT_UC485 0x2021 + #define ATEN_PRODUCT_ID2 0x2118 + + #define IODATA_VENDOR_ID 0x04bb +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 53341a77d89f..a37ed1e59e99 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -123,9 +123,9 @@ UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999, + /* Reported-by: Benjamin Tissoires */ + UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, + "Initio Corporation", +- "", ++ "INIC-3069", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, +- US_FL_NO_ATA_1X), ++ US_FL_NO_ATA_1X | US_FL_IGNORE_RESIDUE), + + /* Reported-by: Tom Arild Naess */ + UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999, +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index 11538a8be9f0..1a063cbfe503 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -46,7 +46,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) + { + struct fuse_file *ff; + +- ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL); ++ ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL); + if (unlikely(!ff)) + return NULL; + +diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig +index f31fd0dd92c6..b1daeafbea92 100644 +--- a/fs/nfs/Kconfig ++++ b/fs/nfs/Kconfig +@@ -121,6 +121,7 @@ config PNFS_FILE_LAYOUT + config PNFS_BLOCK + tristate + depends on NFS_V4_1 && BLK_DEV_DM ++ depends on 64BIT || LBDAF + default NFS_V4 + + config PNFS_OBJLAYOUT +diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +index e125e55de86d..2603d7589946 100644 +--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c ++++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +@@ -30,6 +30,7 @@ void nfs4_ff_layout_free_deviceid(struct nfs4_ff_layout_ds *mirror_ds) + { + nfs4_print_deviceid(&mirror_ds->id_node.deviceid); + nfs4_pnfs_ds_put(mirror_ds->ds); ++ kfree(mirror_ds->ds_versions); + kfree_rcu(mirror_ds, id_node.rcu); + } + +diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h +index 85a868ccb493..8397dc235e84 100644 +--- a/include/linux/cpuset.h ++++ b/include/linux/cpuset.h +@@ -16,6 +16,7 @@ + + #ifdef CONFIG_CPUSETS + ++extern struct static_key cpusets_pre_enable_key; + extern struct static_key cpusets_enabled_key; + static inline bool cpusets_enabled(void) + { +@@ -30,12 +31,14 @@ static inline int nr_cpusets(void) + + static inline void cpuset_inc(void) + { ++ static_key_slow_inc(&cpusets_pre_enable_key); + static_key_slow_inc(&cpusets_enabled_key); + } + + static inline void cpuset_dec(void) + { + static_key_slow_dec(&cpusets_enabled_key); ++ static_key_slow_dec(&cpusets_pre_enable_key); + } + + extern int cpuset_init(void); +@@ -104,7 +107,7 @@ extern void cpuset_print_current_mems_allowed(void); + */ + static inline unsigned int read_mems_allowed_begin(void) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_pre_enable_key)) + return 0; + + return read_seqcount_begin(¤t->mems_allowed_seq); +@@ -118,7 +121,7 @@ static inline unsigned int read_mems_allowed_begin(void) + */ + static inline bool read_mems_allowed_retry(unsigned int seq) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_enabled_key)) + return false; + + return read_seqcount_retry(¤t->mems_allowed_seq, seq); +diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h +index fdda45f26f75..22f442ab85f9 100644 +--- a/include/target/iscsi/iscsi_target_core.h ++++ b/include/target/iscsi/iscsi_target_core.h +@@ -784,6 +784,7 @@ struct iscsi_np { + int np_sock_type; + enum np_thread_state_table np_thread_state; + bool enabled; ++ atomic_t np_reset_count; + enum iscsi_timer_flags_table np_login_timer_flags; + u32 np_exports; + enum np_flags_table np_flags; +diff --git a/kernel/cpuset.c b/kernel/cpuset.c +index 3b5e5430f5d0..8ccd66a97c8b 100644 +--- a/kernel/cpuset.c ++++ b/kernel/cpuset.c +@@ -60,6 +60,7 @@ + #include + #include + ++struct static_key cpusets_pre_enable_key __read_mostly = STATIC_KEY_INIT_FALSE; + struct static_key cpusets_enabled_key __read_mostly = STATIC_KEY_INIT_FALSE; + + /* See "Frequency meter" comments, below. */ +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index f9d648fce8cd..53286b2f5b1c 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6804,7 +6804,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, + + /* Make sure the range is really isolated. */ + if (test_pages_isolated(outer_start, end, false)) { +- pr_info("%s: [%lx, %lx) PFNs busy\n", ++ pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n", + __func__, outer_start, end); + ret = -EBUSY; + goto done; diff --git a/patch/kernel/mvebu-default/03-patch-4.4.83-84.patch b/patch/kernel/mvebu-default/03-patch-4.4.83-84.patch new file mode 100644 index 000000000..74a42d331 --- /dev/null +++ b/patch/kernel/mvebu-default/03-patch-4.4.83-84.patch @@ -0,0 +1,761 @@ +diff --git a/Makefile b/Makefile +index 7f67b35caf99..9d77ac063ec0 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 83 ++SUBLEVEL = 84 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h +index 9e11dbe1cec3..329c127e13dc 100644 +--- a/arch/arm64/include/asm/elf.h ++++ b/arch/arm64/include/asm/elf.h +@@ -121,10 +121,10 @@ typedef struct user_fpsimd_state elf_fpregset_t; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ +-#define ELF_ET_DYN_BASE 0x100000000UL ++#define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) + + /* + * When the program starts, a1 contains a pointer to a function to be +diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +index 1cd792db15ef..1eab79c9ac48 100644 +--- a/arch/x86/crypto/sha1_avx2_x86_64_asm.S ++++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +@@ -117,11 +117,10 @@ + .set T1, REG_T1 + .endm + +-#define K_BASE %r8 + #define HASH_PTR %r9 ++#define BLOCKS_CTR %r8 + #define BUFFER_PTR %r10 + #define BUFFER_PTR2 %r13 +-#define BUFFER_END %r11 + + #define PRECALC_BUF %r14 + #define WK_BUF %r15 +@@ -205,14 +204,14 @@ + * blended AVX2 and ALU instruction scheduling + * 1 vector iteration per 8 rounds + */ +- vmovdqu ((i * 2) + PRECALC_OFFSET)(BUFFER_PTR), W_TMP ++ vmovdqu (i * 2)(BUFFER_PTR), W_TMP + .elseif ((i & 7) == 1) +- vinsertf128 $1, (((i-1) * 2)+PRECALC_OFFSET)(BUFFER_PTR2),\ ++ vinsertf128 $1, ((i-1) * 2)(BUFFER_PTR2),\ + WY_TMP, WY_TMP + .elseif ((i & 7) == 2) + vpshufb YMM_SHUFB_BSWAP, WY_TMP, WY + .elseif ((i & 7) == 4) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + .elseif ((i & 7) == 7) + vmovdqu WY_TMP, PRECALC_WK(i&~7) + +@@ -255,7 +254,7 @@ + vpxor WY, WY_TMP, WY_TMP + .elseif ((i & 7) == 7) + vpxor WY_TMP2, WY_TMP, WY +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -291,7 +290,7 @@ + vpsrld $30, WY, WY + vpor WY, WY_TMP, WY + .elseif ((i & 7) == 7) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -446,6 +445,16 @@ + + .endm + ++/* Add constant only if (%2 > %3) condition met (uses RTA as temp) ++ * %1 + %2 >= %3 ? %4 : 0 ++ */ ++.macro ADD_IF_GE a, b, c, d ++ mov \a, RTA ++ add $\d, RTA ++ cmp $\c, \b ++ cmovge RTA, \a ++.endm ++ + /* + * macro implements 80 rounds of SHA-1, for multiple blocks with s/w pipelining + */ +@@ -463,13 +472,16 @@ + lea (2*4*80+32)(%rsp), WK_BUF + + # Precalc WK for first 2 blocks +- PRECALC_OFFSET = 0 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 2, 64 + .set i, 0 + .rept 160 + PRECALC i + .set i, i + 1 + .endr +- PRECALC_OFFSET = 128 ++ ++ /* Go to next block if needed */ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 3, 128 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + xchg WK_BUF, PRECALC_BUF + + .align 32 +@@ -479,8 +491,8 @@ _loop: + * we use K_BASE value as a signal of a last block, + * it is set below by: cmovae BUFFER_PTR, K_BASE + */ +- cmp K_BASE, BUFFER_PTR +- jne _begin ++ test BLOCKS_CTR, BLOCKS_CTR ++ jnz _begin + .align 32 + jmp _end + .align 32 +@@ -512,10 +524,10 @@ _loop0: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR /* move to next odd-64-byte block */ +- cmp BUFFER_END, BUFFER_PTR /* is current block the last one? */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ +- ++ /* Update Counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 4, 128 + /* + * rounds + * 60,62,64,66,68 +@@ -532,8 +544,8 @@ _loop0: + UPDATE_HASH 12(HASH_PTR), D + UPDATE_HASH 16(HASH_PTR), E + +- cmp K_BASE, BUFFER_PTR /* is current block the last one? */ +- je _loop ++ test BLOCKS_CTR, BLOCKS_CTR ++ jz _loop + + mov TB, B + +@@ -575,10 +587,10 @@ _loop2: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR2 /* move to next even-64-byte block */ +- +- cmp BUFFER_END, BUFFER_PTR2 /* is current block the last one */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ ++ /* update counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + + jmp _loop3 + _loop3: +@@ -641,19 +653,12 @@ _loop3: + + avx2_zeroupper + +- lea K_XMM_AR(%rip), K_BASE +- ++ /* Setup initial values */ + mov CTX, HASH_PTR + mov BUF, BUFFER_PTR +- lea 64(BUF), BUFFER_PTR2 +- +- shl $6, CNT /* mul by 64 */ +- add BUF, CNT +- add $64, CNT +- mov CNT, BUFFER_END + +- cmp BUFFER_END, BUFFER_PTR2 +- cmovae K_BASE, BUFFER_PTR2 ++ mov BUF, BUFFER_PTR2 ++ mov CNT, BLOCKS_CTR + + xmm_mov BSWAP_SHUFB_CTL(%rip), YMM_SHUFB_BSWAP + +diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c +index 7de207a11014..dd14616b7739 100644 +--- a/arch/x86/crypto/sha1_ssse3_glue.c ++++ b/arch/x86/crypto/sha1_ssse3_glue.c +@@ -201,7 +201,7 @@ asmlinkage void sha1_transform_avx2(u32 *digest, const char *data, + + static bool avx2_usable(void) + { +- if (false && avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) ++ if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) + && boot_cpu_has(X86_FEATURE_BMI1) + && boot_cpu_has(X86_FEATURE_BMI2)) + return true; +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index a55697d19824..cc0f2f5da19b 100644 +--- a/arch/x86/entry/entry_64.S ++++ b/arch/x86/entry/entry_64.S +@@ -1190,6 +1190,8 @@ ENTRY(nmi) + * other IST entries. + */ + ++ ASM_CLAC ++ + /* Use %rdx as our temp variable throughout */ + pushq %rdx + +diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h +index 07cf288b692e..bcd3d6199464 100644 +--- a/arch/x86/include/asm/elf.h ++++ b/arch/x86/include/asm/elf.h +@@ -247,11 +247,11 @@ extern int force_personality32; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ + #define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \ +- 0x100000000UL) ++ (TASK_SIZE / 3 * 2)) + + /* This yields a mask that user programs can use to figure out what + instruction set this CPU supports. This could be done in user space, +diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +index 8900400230c6..2cdae69d7e0b 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +@@ -153,7 +153,7 @@ static void __intel_pmu_lbr_enable(bool pmi) + */ + if (cpuc->lbr_sel) + lbr_select = cpuc->lbr_sel->config; +- if (!pmi) ++ if (!pmi && cpuc->lbr_sel) + wrmsrl(MSR_LBR_SELECT, lbr_select); + + rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl); +@@ -432,8 +432,10 @@ static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) + int out = 0; + int num = x86_pmu.lbr_nr; + +- if (cpuc->lbr_sel->config & LBR_CALL_STACK) +- num = tos; ++ if (cpuc->lbr_sel) { ++ if (cpuc->lbr_sel->config & LBR_CALL_STACK) ++ num = tos; ++ } + + for (i = 0; i < num; i++) { + unsigned long lbr_idx = (tos - i) & mask; +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c +index da5458dfb1e3..98d4e515587a 100644 +--- a/drivers/input/mouse/elan_i2c_core.c ++++ b/drivers/input/mouse/elan_i2c_core.c +@@ -1235,6 +1235,10 @@ static const struct acpi_device_id elan_acpi_id[] = { + { "ELAN0100", 0 }, + { "ELAN0600", 0 }, + { "ELAN0605", 0 }, ++ { "ELAN0608", 0 }, ++ { "ELAN0605", 0 }, ++ { "ELAN0609", 0 }, ++ { "ELAN060B", 0 }, + { "ELAN1000", 0 }, + { } + }; +diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c +index 37199b9b2cfa..831a195cb806 100644 +--- a/drivers/irqchip/irq-atmel-aic-common.c ++++ b/drivers/irqchip/irq-atmel-aic-common.c +@@ -148,9 +148,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) + struct device_node *np; + void __iomem *regs; + +- np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); ++ np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); + if (!np) +- np = of_find_compatible_node(root, NULL, ++ np = of_find_compatible_node(NULL, NULL, + "atmel,at91sam9x5-rtc"); + + if (!np) +@@ -202,7 +202,6 @@ void __init aic_common_irq_fixup(const struct of_device_id *matches) + return; + + match = of_match_node(matches, root); +- of_node_put(root); + + if (match) { + void (*fixup)(struct device_node *) = match->data; +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 582d8f0c6266..958af3b1af7f 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -707,6 +707,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ + {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ + {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ ++ {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ + {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ + {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ + {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c +index 7b0ca1551d7b..005ea632ba53 100644 +--- a/drivers/parisc/dino.c ++++ b/drivers/parisc/dino.c +@@ -954,7 +954,7 @@ static int __init dino_probe(struct parisc_device *dev) + + dino_dev->hba.dev = dev; + dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096); +- dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ ++ dino_dev->hba.lmmio_space_offset = PCI_F_EXTEND; + spin_lock_init(&dino_dev->dinosaur_pen); + dino_dev->hba.iommu = ccio_get_iommu(dev); + +diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c +index 2776cfe64c09..ef9cf4a21afe 100644 +--- a/drivers/usb/core/usb-acpi.c ++++ b/drivers/usb/core/usb-acpi.c +@@ -127,6 +127,22 @@ out: + */ + #define USB_ACPI_LOCATION_VALID (1 << 31) + ++static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent, ++ int raw) ++{ ++ struct acpi_device *adev; ++ ++ if (!parent) ++ return NULL; ++ ++ list_for_each_entry(adev, &parent->children, node) { ++ if (acpi_device_adr(adev) == raw) ++ return adev; ++ } ++ ++ return acpi_find_child_device(parent, raw, false); ++} ++ + static struct acpi_device *usb_acpi_find_companion(struct device *dev) + { + struct usb_device *udev; +@@ -174,8 +190,10 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + int raw; + + raw = usb_hcd_find_raw_port_number(hcd, port1); +- adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev), +- raw, false); ++ ++ adev = usb_acpi_find_port(ACPI_COMPANION(&udev->dev), ++ raw); ++ + if (!adev) + return NULL; + } else { +@@ -186,7 +204,9 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + return NULL; + + acpi_bus_get_device(parent_handle, &adev); +- adev = acpi_find_child_device(adev, port1, false); ++ ++ adev = usb_acpi_find_port(adev, port1); ++ + if (!adev) + return NULL; + } +diff --git a/drivers/xen/biomerge.c b/drivers/xen/biomerge.c +index 4da69dbf7dca..1bdd02a6d6ac 100644 +--- a/drivers/xen/biomerge.c ++++ b/drivers/xen/biomerge.c +@@ -10,8 +10,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, + unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); + unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); + +- return __BIOVEC_PHYS_MERGEABLE(vec1, vec2) && +- ((bfn1 == bfn2) || ((bfn1+1) == bfn2)); ++ return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; + #else + /* + * XXX: Add support for merging bio_vec when using different page +diff --git a/include/linux/pid.h b/include/linux/pid.h +index 23705a53abba..97b745ddece5 100644 +--- a/include/linux/pid.h ++++ b/include/linux/pid.h +@@ -8,7 +8,9 @@ enum pid_type + PIDTYPE_PID, + PIDTYPE_PGID, + PIDTYPE_SID, +- PIDTYPE_MAX ++ PIDTYPE_MAX, ++ /* only valid to __task_pid_nr_ns() */ ++ __PIDTYPE_TGID + }; + + /* +diff --git a/include/linux/sched.h b/include/linux/sched.h +index eff7c1fad26f..e887c8d6f395 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -1949,31 +1949,8 @@ static inline pid_t task_tgid_nr(struct task_struct *tsk) + return tsk->tgid; + } + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); +- +-static inline pid_t task_tgid_vnr(struct task_struct *tsk) +-{ +- return pid_vnr(task_tgid(tsk)); +-} +- + + static inline int pid_alive(const struct task_struct *p); +-static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) +-{ +- pid_t pid = 0; +- +- rcu_read_lock(); +- if (pid_alive(tsk)) +- pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); +- rcu_read_unlock(); +- +- return pid; +-} +- +-static inline pid_t task_ppid_nr(const struct task_struct *tsk) +-{ +- return task_ppid_nr_ns(tsk, &init_pid_ns); +-} + + static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, + struct pid_namespace *ns) +@@ -1998,6 +1975,33 @@ static inline pid_t task_session_vnr(struct task_struct *tsk) + return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); + } + ++static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns); ++} ++ ++static inline pid_t task_tgid_vnr(struct task_struct *tsk) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL); ++} ++ ++static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ pid_t pid = 0; ++ ++ rcu_read_lock(); ++ if (pid_alive(tsk)) ++ pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); ++ rcu_read_unlock(); ++ ++ return pid; ++} ++ ++static inline pid_t task_ppid_nr(const struct task_struct *tsk) ++{ ++ return task_ppid_nr_ns(tsk, &init_pid_ns); ++} ++ + /* obsolete, do not use */ + static inline pid_t task_pgrp_nr(struct task_struct *tsk) + { +diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c +index 939945a5649c..a162661c9d60 100644 +--- a/kernel/audit_watch.c ++++ b/kernel/audit_watch.c +@@ -457,13 +457,15 @@ void audit_remove_watch_rule(struct audit_krule *krule) + list_del(&krule->rlist); + + if (list_empty(&watch->rules)) { ++ /* ++ * audit_remove_watch() drops our reference to 'parent' which ++ * can get freed. Grab our own reference to be safe. ++ */ ++ audit_get_parent(parent); + audit_remove_watch(watch); +- +- if (list_empty(&parent->watches)) { +- audit_get_parent(parent); ++ if (list_empty(&parent->watches)) + fsnotify_destroy_mark(&parent->mark, audit_watch_group); +- audit_put_parent(parent); +- } ++ audit_put_parent(parent); + } + } + +diff --git a/kernel/pid.c b/kernel/pid.c +index 78b3d9f80d44..b17263be9082 100644 +--- a/kernel/pid.c ++++ b/kernel/pid.c +@@ -526,8 +526,11 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + if (!ns) + ns = task_active_pid_ns(current); + if (likely(pid_alive(task))) { +- if (type != PIDTYPE_PID) ++ if (type != PIDTYPE_PID) { ++ if (type == __PIDTYPE_TGID) ++ type = PIDTYPE_PID; + task = task->group_leader; ++ } + nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); + } + rcu_read_unlock(); +@@ -536,12 +539,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + } + EXPORT_SYMBOL(__task_pid_nr_ns); + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) +-{ +- return pid_nr_ns(task_tgid(tsk), ns); +-} +-EXPORT_SYMBOL(task_tgid_nr_ns); +- + struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) + { + return ns_of_pid(task_pid(tsk)); +diff --git a/mm/mempolicy.c b/mm/mempolicy.c +index e09b1a0e2cfe..c947014d128a 100644 +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -894,11 +894,6 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, + *policy |= (pol->flags & MPOL_MODE_FLAGS); + } + +- if (vma) { +- up_read(¤t->mm->mmap_sem); +- vma = NULL; +- } +- + err = 0; + if (nmask) { + if (mpol_store_user_nodemask(pol)) { +diff --git a/mm/migrate.c b/mm/migrate.c +index 72c09dea6526..afedcfab60e2 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1483,7 +1484,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + const int __user *, nodes, + int __user *, status, int, flags) + { +- const struct cred *cred = current_cred(), *tcred; + struct task_struct *task; + struct mm_struct *mm; + int err; +@@ -1507,14 +1507,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + + /* + * Check if this process has the right to modify the specified +- * process. The right exists if the process has administrative +- * capabilities, superuser privileges or the same +- * userid as the target process. ++ * process. Use the regular "ptrace_may_access()" checks. + */ +- tcred = __task_cred(task); +- if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && +- !capable(CAP_SYS_NICE)) { ++ if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { + rcu_read_unlock(); + err = -EPERM; + goto out; +diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c +index 1a9545965c0d..531ca55f1af6 100644 +--- a/net/netfilter/nf_conntrack_extend.c ++++ b/net/netfilter/nf_conntrack_extend.c +@@ -53,7 +53,11 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } ++ + off = ALIGN(sizeof(struct nf_ct_ext), t->align); + len = off + t->len + var_alloc_len; + alloc_size = t->alloc_size + var_alloc_len; +@@ -88,7 +92,10 @@ void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } + + newoff = ALIGN(old->len, t->align); + newlen = newoff + t->len + var_alloc_len; +@@ -186,6 +193,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type) + RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL); + update_alloc_size(type); + mutex_unlock(&nf_ct_ext_type_mutex); +- rcu_barrier(); /* Wait for completion of call_rcu()'s */ ++ synchronize_rcu(); + } + EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c +index c67f9c212dd1..e326c1d80416 100644 +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -1530,19 +1530,14 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + void __user *arg) + { + struct snd_seq_queue_info info; +- int result; + struct snd_seq_queue *q; + + if (copy_from_user(&info, arg, sizeof(info))) + return -EFAULT; + +- result = snd_seq_queue_alloc(client->number, info.locked, info.flags); +- if (result < 0) +- return result; +- +- q = queueptr(result); +- if (q == NULL) +- return -EINVAL; ++ q = snd_seq_queue_alloc(client->number, info.locked, info.flags); ++ if (IS_ERR(q)) ++ return PTR_ERR(q); + + info.queue = q->queue; + info.locked = q->locked; +@@ -1552,7 +1547,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + if (! info.name[0]) + snprintf(info.name, sizeof(info.name), "Queue-%d", q->queue); + strlcpy(q->name, info.name, sizeof(q->name)); +- queuefree(q); ++ snd_use_lock_free(&q->use_lock); + + if (copy_to_user(arg, &info, sizeof(info))) + return -EFAULT; +diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c +index 450c5187eecb..79e0c5604ef8 100644 +--- a/sound/core/seq/seq_queue.c ++++ b/sound/core/seq/seq_queue.c +@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) + static void queue_use(struct snd_seq_queue *queue, int client, int use); + + /* allocate a new queue - +- * return queue index value or negative value for error ++ * return pointer to new queue or ERR_PTR(-errno) for error ++ * The new queue's use_lock is set to 1. It is the caller's responsibility to ++ * call snd_use_lock_free(&q->use_lock). + */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) + { + struct snd_seq_queue *q; + + q = queue_new(client, locked); + if (q == NULL) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + q->info_flags = info_flags; + queue_use(q, client, 1); ++ snd_use_lock_use(&q->use_lock); + if (queue_list_add(q) < 0) { ++ snd_use_lock_free(&q->use_lock); + queue_delete(q); +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + } +- return q->queue; ++ return q; + } + + /* delete a queue - queue must be owned by the client */ +diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h +index 30c8111477f6..719093489a2c 100644 +--- a/sound/core/seq/seq_queue.h ++++ b/sound/core/seq/seq_queue.h +@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); + + + /* create new queue (constructor) */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int flags); ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags); + + /* delete queue (destructor) */ + int snd_seq_queue_delete(int client, int queueid); +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c +index 499b03c8281d..696de5ac69be 100644 +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -541,6 +541,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, + + if (size < sizeof(scale)) + return -ENOMEM; ++ if (cval->min_mute) ++ scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE; + scale[2] = cval->dBmin; + scale[3] = cval->dBmax; + if (copy_to_user(_tlv, scale, sizeof(scale))) +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h +index 3417ef347e40..2b4b067646ab 100644 +--- a/sound/usb/mixer.h ++++ b/sound/usb/mixer.h +@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { + int cached; + int cache_val[MAX_CHANNELS]; + u8 initialized; ++ u8 min_mute; + void *private_data; + }; + +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c +index 04991b009132..5d2fc5f58bfe 100644 +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1873,6 +1873,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, + if (unitid == 7 && cval->control == UAC_FU_VOLUME) + snd_dragonfly_quirk_db_scale(mixer, cval, kctl); + break; ++ /* lowest playback value is muted on C-Media devices */ ++ case USB_ID(0x0d8c, 0x000c): ++ case USB_ID(0x0d8c, 0x0014): ++ if (strstr(kctl->id.name, "Playback")) ++ cval->min_mute = 1; ++ break; + } + } + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 29f38e2b4ca9..1cc20d138dae 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1143,6 +1143,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ + case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ ++ case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ + case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ + case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ + case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ diff --git a/patch/kernel/mvebu64-default/03-patch-4.4.82-83.patch b/patch/kernel/mvebu64-default/03-patch-4.4.82-83.patch new file mode 100644 index 000000000..104c0c331 --- /dev/null +++ b/patch/kernel/mvebu64-default/03-patch-4.4.82-83.patch @@ -0,0 +1,476 @@ +diff --git a/Makefile b/Makefile +index 52f2dd8dcebd..7f67b35caf99 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 82 ++SUBLEVEL = 83 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c +index fa24d5196615..c7122919a8c0 100644 +--- a/drivers/iio/accel/bmc150-accel-core.c ++++ b/drivers/iio/accel/bmc150-accel-core.c +@@ -194,7 +194,6 @@ struct bmc150_accel_data { + struct device *dev; + int irq; + struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS]; +- atomic_t active_intr; + struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS]; + struct mutex mutex; + u8 fifo_mode, watermark; +@@ -489,11 +488,6 @@ static int bmc150_accel_set_interrupt(struct bmc150_accel_data *data, int i, + goto out_fix_power_state; + } + +- if (state) +- atomic_inc(&data->active_intr); +- else +- atomic_dec(&data->active_intr); +- + return 0; + + out_fix_power_state: +@@ -1704,8 +1698,7 @@ static int bmc150_accel_resume(struct device *dev) + struct bmc150_accel_data *data = iio_priv(indio_dev); + + mutex_lock(&data->mutex); +- if (atomic_read(&data->active_intr)) +- bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); ++ bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); + bmc150_accel_fifo_set_mode(data); + mutex_unlock(&data->mutex); + +diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c +index b10f629cc44b..1dbc2143cdfc 100644 +--- a/drivers/iio/adc/vf610_adc.c ++++ b/drivers/iio/adc/vf610_adc.c +@@ -77,7 +77,7 @@ + #define VF610_ADC_ADSTS_MASK 0x300 + #define VF610_ADC_ADLPC_EN 0x80 + #define VF610_ADC_ADHSC_EN 0x400 +-#define VF610_ADC_REFSEL_VALT 0x100 ++#define VF610_ADC_REFSEL_VALT 0x800 + #define VF610_ADC_REFSEL_VBG 0x1000 + #define VF610_ADC_ADTRG_HARD 0x2000 + #define VF610_ADC_AVGS_8 0x4000 +diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c +index 12731d6b89ec..ec1b2e798cc1 100644 +--- a/drivers/iio/light/tsl2563.c ++++ b/drivers/iio/light/tsl2563.c +@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private) + struct tsl2563_chip *chip = iio_priv(dev_info); + + iio_push_event(dev_info, +- IIO_UNMOD_EVENT_CODE(IIO_LIGHT, ++ IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, + 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_EITHER), +diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c +index 71ccf6a90b22..2551e4adb33f 100644 +--- a/drivers/pinctrl/samsung/pinctrl-exynos.c ++++ b/drivers/pinctrl/samsung/pinctrl-exynos.c +@@ -194,8 +194,6 @@ static int exynos_irq_request_resources(struct irq_data *irqd) + + spin_unlock_irqrestore(&bank->slock, flags); + +- exynos_irq_unmask(irqd); +- + return 0; + } + +@@ -216,8 +214,6 @@ static void exynos_irq_release_resources(struct irq_data *irqd) + shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC]; + mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; + +- exynos_irq_mask(irqd); +- + spin_lock_irqsave(&bank->slock, flags); + + con = readl(d->virt_base + reg_con); +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +index 862a096c5dba..be5c71df148d 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +@@ -811,6 +811,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = { + SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */ + SUNXI_FUNCTION(0x3, "pata"), /* ATAD12 */ + SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */ ++ SUNXI_FUNCTION(0x5, "sim"), /* DET */ + SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */ + SUNXI_FUNCTION(0x7, "csi1")), /* D16 */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17), +diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c +index d97aa2827412..8eb7179da342 100644 +--- a/drivers/staging/iio/resolver/ad2s1210.c ++++ b/drivers/staging/iio/resolver/ad2s1210.c +@@ -468,7 +468,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev, + long m) + { + struct ad2s1210_state *st = iio_priv(indio_dev); +- bool negative; ++ u16 negative; + int ret = 0; + u16 pos; + s16 vel; +diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c +index 31d5d9c0e10b..1ff1c83e2df5 100644 +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -418,6 +418,7 @@ int iscsit_reset_np_thread( + return 0; + } + np->np_thread_state = ISCSI_NP_THREAD_RESET; ++ atomic_inc(&np->np_reset_count); + + if (np->np_thread) { + spin_unlock_bh(&np->np_thread_lock); +@@ -1996,6 +1997,7 @@ iscsit_setup_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, + cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); + cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); + cmd->data_direction = DMA_NONE; ++ kfree(cmd->text_in_ptr); + cmd->text_in_ptr = NULL; + + return 0; +diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c +index b19edffa7d98..bc2cbffec27e 100644 +--- a/drivers/target/iscsi/iscsi_target_login.c ++++ b/drivers/target/iscsi/iscsi_target_login.c +@@ -1219,9 +1219,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + flush_signals(current); + + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { + np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; ++ spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); ++ return 1; + } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { + spin_unlock_bh(&np->np_thread_lock); + goto exit; +@@ -1254,7 +1256,8 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + goto exit; + } else if (rc < 0) { + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { ++ np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; + spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); + iscsit_put_transport(conn->conn_transport); +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index b403596818db..5c0952995280 100644 +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1851,7 +1851,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, + /* No more submits can occur */ + spin_lock_irq(&hcd_urb_list_lock); + rescan: +- list_for_each_entry (urb, &ep->urb_list, urb_list) { ++ list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) { + int is_in; + + if (urb->unlinked) +@@ -2448,6 +2448,8 @@ void usb_hc_died (struct usb_hcd *hcd) + } + if (usb_hcd_is_primary_hcd(hcd) && hcd->shared_hcd) { + hcd = hcd->shared_hcd; ++ clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags); ++ set_bit(HCD_FLAG_DEAD, &hcd->flags); + if (hcd->rh_registered) { + clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 1d59d489a1ad..cdf4be3939f5 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4661,7 +4661,8 @@ hub_power_remaining(struct usb_hub *hub) + static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, + u16 portchange) + { +- int status, i; ++ int status = -ENODEV; ++ int i; + unsigned unit_load; + struct usb_device *hdev = hub->hdev; + struct usb_hcd *hcd = bus_to_hcd(hdev->bus); +@@ -4865,9 +4866,10 @@ loop: + + done: + hub_port_disable(hub, port1, 1); +- if (hcd->driver->relinquish_port && !hub->hdev->parent) +- hcd->driver->relinquish_port(hcd, port1); +- ++ if (hcd->driver->relinquish_port && !hub->hdev->parent) { ++ if (status != -ENOTCONN && status != -ENODEV) ++ hcd->driver->relinquish_port(hcd, port1); ++ } + } + + /* Handle physical or logical connection change events. +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c +index 3116edfcdc18..574da2b4529c 100644 +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -150,6 +150,9 @@ static const struct usb_device_id usb_quirk_list[] = { + /* appletouch */ + { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, + ++ /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */ ++ { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM }, ++ + /* Avision AV600U */ + { USB_DEVICE(0x0638, 0x0a13), .driver_info = + USB_QUIRK_STRING_FETCH_255 }, +@@ -249,6 +252,7 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = { + { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME }, ++ { USB_DEVICE(0x03f0, 0x2b4a), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Logitech Optical Mouse M90/M100 */ + { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME }, +diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c +index f9400564cb72..03b9a372636f 100644 +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -89,6 +89,7 @@ enum amd_chipset_gen { + AMD_CHIPSET_HUDSON2, + AMD_CHIPSET_BOLTON, + AMD_CHIPSET_YANGTZE, ++ AMD_CHIPSET_TAISHAN, + AMD_CHIPSET_UNKNOWN, + }; + +@@ -132,6 +133,11 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) + pinfo->sb_type.gen = AMD_CHIPSET_SB700; + else if (rev >= 0x40 && rev <= 0x4f) + pinfo->sb_type.gen = AMD_CHIPSET_SB800; ++ } ++ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, ++ 0x145c, NULL); ++ if (pinfo->smbus_dev) { ++ pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; + } else { + pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); +@@ -251,11 +257,12 @@ int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev) + { + /* Make sure amd chipset type has already been initialized */ + usb_amd_find_chipset_info(); +- if (amd_chipset.sb_type.gen != AMD_CHIPSET_YANGTZE) +- return 0; +- +- dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); +- return 1; ++ if (amd_chipset.sb_type.gen == AMD_CHIPSET_YANGTZE || ++ amd_chipset.sb_type.gen == AMD_CHIPSET_TAISHAN) { ++ dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); ++ return 1; ++ } ++ return 0; + } + EXPORT_SYMBOL_GPL(usb_hcd_amd_remote_wakeup_quirk); + +diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c +index 13d5614f37f1..0d843e0f8055 100644 +--- a/drivers/usb/musb/musb_host.c ++++ b/drivers/usb/musb/musb_host.c +@@ -138,6 +138,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) + "Could not flush host TX%d fifo: csr: %04x\n", + ep->epnum, csr)) + return; ++ mdelay(1); + } + } + +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c +index b0dc6da3d970..41a6513646de 100644 +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -135,6 +135,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ + { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ + { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ ++ { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index ebe51f11105d..fe123153b1a5 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2025,6 +2025,8 @@ static const struct usb_device_id option_ids[] = { + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */ ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/A3 */ +diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c +index 1db4b61bdf7b..a51b28379850 100644 +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, ++ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_UC485) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) }, + { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) }, + { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, +diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h +index 09d9be88209e..3b5a15d1dc0d 100644 +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -27,6 +27,7 @@ + #define ATEN_VENDOR_ID 0x0557 + #define ATEN_VENDOR_ID2 0x0547 + #define ATEN_PRODUCT_ID 0x2008 ++#define ATEN_PRODUCT_UC485 0x2021 + #define ATEN_PRODUCT_ID2 0x2118 + + #define IODATA_VENDOR_ID 0x04bb +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 53341a77d89f..a37ed1e59e99 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -123,9 +123,9 @@ UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999, + /* Reported-by: Benjamin Tissoires */ + UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, + "Initio Corporation", +- "", ++ "INIC-3069", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, +- US_FL_NO_ATA_1X), ++ US_FL_NO_ATA_1X | US_FL_IGNORE_RESIDUE), + + /* Reported-by: Tom Arild Naess */ + UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999, +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index 11538a8be9f0..1a063cbfe503 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -46,7 +46,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) + { + struct fuse_file *ff; + +- ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL); ++ ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL); + if (unlikely(!ff)) + return NULL; + +diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig +index f31fd0dd92c6..b1daeafbea92 100644 +--- a/fs/nfs/Kconfig ++++ b/fs/nfs/Kconfig +@@ -121,6 +121,7 @@ config PNFS_FILE_LAYOUT + config PNFS_BLOCK + tristate + depends on NFS_V4_1 && BLK_DEV_DM ++ depends on 64BIT || LBDAF + default NFS_V4 + + config PNFS_OBJLAYOUT +diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +index e125e55de86d..2603d7589946 100644 +--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c ++++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +@@ -30,6 +30,7 @@ void nfs4_ff_layout_free_deviceid(struct nfs4_ff_layout_ds *mirror_ds) + { + nfs4_print_deviceid(&mirror_ds->id_node.deviceid); + nfs4_pnfs_ds_put(mirror_ds->ds); ++ kfree(mirror_ds->ds_versions); + kfree_rcu(mirror_ds, id_node.rcu); + } + +diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h +index 85a868ccb493..8397dc235e84 100644 +--- a/include/linux/cpuset.h ++++ b/include/linux/cpuset.h +@@ -16,6 +16,7 @@ + + #ifdef CONFIG_CPUSETS + ++extern struct static_key cpusets_pre_enable_key; + extern struct static_key cpusets_enabled_key; + static inline bool cpusets_enabled(void) + { +@@ -30,12 +31,14 @@ static inline int nr_cpusets(void) + + static inline void cpuset_inc(void) + { ++ static_key_slow_inc(&cpusets_pre_enable_key); + static_key_slow_inc(&cpusets_enabled_key); + } + + static inline void cpuset_dec(void) + { + static_key_slow_dec(&cpusets_enabled_key); ++ static_key_slow_dec(&cpusets_pre_enable_key); + } + + extern int cpuset_init(void); +@@ -104,7 +107,7 @@ extern void cpuset_print_current_mems_allowed(void); + */ + static inline unsigned int read_mems_allowed_begin(void) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_pre_enable_key)) + return 0; + + return read_seqcount_begin(¤t->mems_allowed_seq); +@@ -118,7 +121,7 @@ static inline unsigned int read_mems_allowed_begin(void) + */ + static inline bool read_mems_allowed_retry(unsigned int seq) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_enabled_key)) + return false; + + return read_seqcount_retry(¤t->mems_allowed_seq, seq); +diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h +index fdda45f26f75..22f442ab85f9 100644 +--- a/include/target/iscsi/iscsi_target_core.h ++++ b/include/target/iscsi/iscsi_target_core.h +@@ -784,6 +784,7 @@ struct iscsi_np { + int np_sock_type; + enum np_thread_state_table np_thread_state; + bool enabled; ++ atomic_t np_reset_count; + enum iscsi_timer_flags_table np_login_timer_flags; + u32 np_exports; + enum np_flags_table np_flags; +diff --git a/kernel/cpuset.c b/kernel/cpuset.c +index 3b5e5430f5d0..8ccd66a97c8b 100644 +--- a/kernel/cpuset.c ++++ b/kernel/cpuset.c +@@ -60,6 +60,7 @@ + #include + #include + ++struct static_key cpusets_pre_enable_key __read_mostly = STATIC_KEY_INIT_FALSE; + struct static_key cpusets_enabled_key __read_mostly = STATIC_KEY_INIT_FALSE; + + /* See "Frequency meter" comments, below. */ +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index f9d648fce8cd..53286b2f5b1c 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6804,7 +6804,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, + + /* Make sure the range is really isolated. */ + if (test_pages_isolated(outer_start, end, false)) { +- pr_info("%s: [%lx, %lx) PFNs busy\n", ++ pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n", + __func__, outer_start, end); + ret = -EBUSY; + goto done; diff --git a/patch/kernel/mvebu64-default/03-patch-4.4.83-84.patch b/patch/kernel/mvebu64-default/03-patch-4.4.83-84.patch new file mode 100644 index 000000000..74a42d331 --- /dev/null +++ b/patch/kernel/mvebu64-default/03-patch-4.4.83-84.patch @@ -0,0 +1,761 @@ +diff --git a/Makefile b/Makefile +index 7f67b35caf99..9d77ac063ec0 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 83 ++SUBLEVEL = 84 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h +index 9e11dbe1cec3..329c127e13dc 100644 +--- a/arch/arm64/include/asm/elf.h ++++ b/arch/arm64/include/asm/elf.h +@@ -121,10 +121,10 @@ typedef struct user_fpsimd_state elf_fpregset_t; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ +-#define ELF_ET_DYN_BASE 0x100000000UL ++#define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) + + /* + * When the program starts, a1 contains a pointer to a function to be +diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +index 1cd792db15ef..1eab79c9ac48 100644 +--- a/arch/x86/crypto/sha1_avx2_x86_64_asm.S ++++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +@@ -117,11 +117,10 @@ + .set T1, REG_T1 + .endm + +-#define K_BASE %r8 + #define HASH_PTR %r9 ++#define BLOCKS_CTR %r8 + #define BUFFER_PTR %r10 + #define BUFFER_PTR2 %r13 +-#define BUFFER_END %r11 + + #define PRECALC_BUF %r14 + #define WK_BUF %r15 +@@ -205,14 +204,14 @@ + * blended AVX2 and ALU instruction scheduling + * 1 vector iteration per 8 rounds + */ +- vmovdqu ((i * 2) + PRECALC_OFFSET)(BUFFER_PTR), W_TMP ++ vmovdqu (i * 2)(BUFFER_PTR), W_TMP + .elseif ((i & 7) == 1) +- vinsertf128 $1, (((i-1) * 2)+PRECALC_OFFSET)(BUFFER_PTR2),\ ++ vinsertf128 $1, ((i-1) * 2)(BUFFER_PTR2),\ + WY_TMP, WY_TMP + .elseif ((i & 7) == 2) + vpshufb YMM_SHUFB_BSWAP, WY_TMP, WY + .elseif ((i & 7) == 4) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + .elseif ((i & 7) == 7) + vmovdqu WY_TMP, PRECALC_WK(i&~7) + +@@ -255,7 +254,7 @@ + vpxor WY, WY_TMP, WY_TMP + .elseif ((i & 7) == 7) + vpxor WY_TMP2, WY_TMP, WY +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -291,7 +290,7 @@ + vpsrld $30, WY, WY + vpor WY, WY_TMP, WY + .elseif ((i & 7) == 7) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -446,6 +445,16 @@ + + .endm + ++/* Add constant only if (%2 > %3) condition met (uses RTA as temp) ++ * %1 + %2 >= %3 ? %4 : 0 ++ */ ++.macro ADD_IF_GE a, b, c, d ++ mov \a, RTA ++ add $\d, RTA ++ cmp $\c, \b ++ cmovge RTA, \a ++.endm ++ + /* + * macro implements 80 rounds of SHA-1, for multiple blocks with s/w pipelining + */ +@@ -463,13 +472,16 @@ + lea (2*4*80+32)(%rsp), WK_BUF + + # Precalc WK for first 2 blocks +- PRECALC_OFFSET = 0 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 2, 64 + .set i, 0 + .rept 160 + PRECALC i + .set i, i + 1 + .endr +- PRECALC_OFFSET = 128 ++ ++ /* Go to next block if needed */ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 3, 128 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + xchg WK_BUF, PRECALC_BUF + + .align 32 +@@ -479,8 +491,8 @@ _loop: + * we use K_BASE value as a signal of a last block, + * it is set below by: cmovae BUFFER_PTR, K_BASE + */ +- cmp K_BASE, BUFFER_PTR +- jne _begin ++ test BLOCKS_CTR, BLOCKS_CTR ++ jnz _begin + .align 32 + jmp _end + .align 32 +@@ -512,10 +524,10 @@ _loop0: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR /* move to next odd-64-byte block */ +- cmp BUFFER_END, BUFFER_PTR /* is current block the last one? */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ +- ++ /* Update Counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 4, 128 + /* + * rounds + * 60,62,64,66,68 +@@ -532,8 +544,8 @@ _loop0: + UPDATE_HASH 12(HASH_PTR), D + UPDATE_HASH 16(HASH_PTR), E + +- cmp K_BASE, BUFFER_PTR /* is current block the last one? */ +- je _loop ++ test BLOCKS_CTR, BLOCKS_CTR ++ jz _loop + + mov TB, B + +@@ -575,10 +587,10 @@ _loop2: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR2 /* move to next even-64-byte block */ +- +- cmp BUFFER_END, BUFFER_PTR2 /* is current block the last one */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ ++ /* update counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + + jmp _loop3 + _loop3: +@@ -641,19 +653,12 @@ _loop3: + + avx2_zeroupper + +- lea K_XMM_AR(%rip), K_BASE +- ++ /* Setup initial values */ + mov CTX, HASH_PTR + mov BUF, BUFFER_PTR +- lea 64(BUF), BUFFER_PTR2 +- +- shl $6, CNT /* mul by 64 */ +- add BUF, CNT +- add $64, CNT +- mov CNT, BUFFER_END + +- cmp BUFFER_END, BUFFER_PTR2 +- cmovae K_BASE, BUFFER_PTR2 ++ mov BUF, BUFFER_PTR2 ++ mov CNT, BLOCKS_CTR + + xmm_mov BSWAP_SHUFB_CTL(%rip), YMM_SHUFB_BSWAP + +diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c +index 7de207a11014..dd14616b7739 100644 +--- a/arch/x86/crypto/sha1_ssse3_glue.c ++++ b/arch/x86/crypto/sha1_ssse3_glue.c +@@ -201,7 +201,7 @@ asmlinkage void sha1_transform_avx2(u32 *digest, const char *data, + + static bool avx2_usable(void) + { +- if (false && avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) ++ if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) + && boot_cpu_has(X86_FEATURE_BMI1) + && boot_cpu_has(X86_FEATURE_BMI2)) + return true; +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index a55697d19824..cc0f2f5da19b 100644 +--- a/arch/x86/entry/entry_64.S ++++ b/arch/x86/entry/entry_64.S +@@ -1190,6 +1190,8 @@ ENTRY(nmi) + * other IST entries. + */ + ++ ASM_CLAC ++ + /* Use %rdx as our temp variable throughout */ + pushq %rdx + +diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h +index 07cf288b692e..bcd3d6199464 100644 +--- a/arch/x86/include/asm/elf.h ++++ b/arch/x86/include/asm/elf.h +@@ -247,11 +247,11 @@ extern int force_personality32; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ + #define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \ +- 0x100000000UL) ++ (TASK_SIZE / 3 * 2)) + + /* This yields a mask that user programs can use to figure out what + instruction set this CPU supports. This could be done in user space, +diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +index 8900400230c6..2cdae69d7e0b 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +@@ -153,7 +153,7 @@ static void __intel_pmu_lbr_enable(bool pmi) + */ + if (cpuc->lbr_sel) + lbr_select = cpuc->lbr_sel->config; +- if (!pmi) ++ if (!pmi && cpuc->lbr_sel) + wrmsrl(MSR_LBR_SELECT, lbr_select); + + rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl); +@@ -432,8 +432,10 @@ static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) + int out = 0; + int num = x86_pmu.lbr_nr; + +- if (cpuc->lbr_sel->config & LBR_CALL_STACK) +- num = tos; ++ if (cpuc->lbr_sel) { ++ if (cpuc->lbr_sel->config & LBR_CALL_STACK) ++ num = tos; ++ } + + for (i = 0; i < num; i++) { + unsigned long lbr_idx = (tos - i) & mask; +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c +index da5458dfb1e3..98d4e515587a 100644 +--- a/drivers/input/mouse/elan_i2c_core.c ++++ b/drivers/input/mouse/elan_i2c_core.c +@@ -1235,6 +1235,10 @@ static const struct acpi_device_id elan_acpi_id[] = { + { "ELAN0100", 0 }, + { "ELAN0600", 0 }, + { "ELAN0605", 0 }, ++ { "ELAN0608", 0 }, ++ { "ELAN0605", 0 }, ++ { "ELAN0609", 0 }, ++ { "ELAN060B", 0 }, + { "ELAN1000", 0 }, + { } + }; +diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c +index 37199b9b2cfa..831a195cb806 100644 +--- a/drivers/irqchip/irq-atmel-aic-common.c ++++ b/drivers/irqchip/irq-atmel-aic-common.c +@@ -148,9 +148,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) + struct device_node *np; + void __iomem *regs; + +- np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); ++ np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); + if (!np) +- np = of_find_compatible_node(root, NULL, ++ np = of_find_compatible_node(NULL, NULL, + "atmel,at91sam9x5-rtc"); + + if (!np) +@@ -202,7 +202,6 @@ void __init aic_common_irq_fixup(const struct of_device_id *matches) + return; + + match = of_match_node(matches, root); +- of_node_put(root); + + if (match) { + void (*fixup)(struct device_node *) = match->data; +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 582d8f0c6266..958af3b1af7f 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -707,6 +707,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ + {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ + {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ ++ {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ + {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ + {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ + {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c +index 7b0ca1551d7b..005ea632ba53 100644 +--- a/drivers/parisc/dino.c ++++ b/drivers/parisc/dino.c +@@ -954,7 +954,7 @@ static int __init dino_probe(struct parisc_device *dev) + + dino_dev->hba.dev = dev; + dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096); +- dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ ++ dino_dev->hba.lmmio_space_offset = PCI_F_EXTEND; + spin_lock_init(&dino_dev->dinosaur_pen); + dino_dev->hba.iommu = ccio_get_iommu(dev); + +diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c +index 2776cfe64c09..ef9cf4a21afe 100644 +--- a/drivers/usb/core/usb-acpi.c ++++ b/drivers/usb/core/usb-acpi.c +@@ -127,6 +127,22 @@ out: + */ + #define USB_ACPI_LOCATION_VALID (1 << 31) + ++static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent, ++ int raw) ++{ ++ struct acpi_device *adev; ++ ++ if (!parent) ++ return NULL; ++ ++ list_for_each_entry(adev, &parent->children, node) { ++ if (acpi_device_adr(adev) == raw) ++ return adev; ++ } ++ ++ return acpi_find_child_device(parent, raw, false); ++} ++ + static struct acpi_device *usb_acpi_find_companion(struct device *dev) + { + struct usb_device *udev; +@@ -174,8 +190,10 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + int raw; + + raw = usb_hcd_find_raw_port_number(hcd, port1); +- adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev), +- raw, false); ++ ++ adev = usb_acpi_find_port(ACPI_COMPANION(&udev->dev), ++ raw); ++ + if (!adev) + return NULL; + } else { +@@ -186,7 +204,9 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + return NULL; + + acpi_bus_get_device(parent_handle, &adev); +- adev = acpi_find_child_device(adev, port1, false); ++ ++ adev = usb_acpi_find_port(adev, port1); ++ + if (!adev) + return NULL; + } +diff --git a/drivers/xen/biomerge.c b/drivers/xen/biomerge.c +index 4da69dbf7dca..1bdd02a6d6ac 100644 +--- a/drivers/xen/biomerge.c ++++ b/drivers/xen/biomerge.c +@@ -10,8 +10,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, + unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); + unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); + +- return __BIOVEC_PHYS_MERGEABLE(vec1, vec2) && +- ((bfn1 == bfn2) || ((bfn1+1) == bfn2)); ++ return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; + #else + /* + * XXX: Add support for merging bio_vec when using different page +diff --git a/include/linux/pid.h b/include/linux/pid.h +index 23705a53abba..97b745ddece5 100644 +--- a/include/linux/pid.h ++++ b/include/linux/pid.h +@@ -8,7 +8,9 @@ enum pid_type + PIDTYPE_PID, + PIDTYPE_PGID, + PIDTYPE_SID, +- PIDTYPE_MAX ++ PIDTYPE_MAX, ++ /* only valid to __task_pid_nr_ns() */ ++ __PIDTYPE_TGID + }; + + /* +diff --git a/include/linux/sched.h b/include/linux/sched.h +index eff7c1fad26f..e887c8d6f395 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -1949,31 +1949,8 @@ static inline pid_t task_tgid_nr(struct task_struct *tsk) + return tsk->tgid; + } + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); +- +-static inline pid_t task_tgid_vnr(struct task_struct *tsk) +-{ +- return pid_vnr(task_tgid(tsk)); +-} +- + + static inline int pid_alive(const struct task_struct *p); +-static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) +-{ +- pid_t pid = 0; +- +- rcu_read_lock(); +- if (pid_alive(tsk)) +- pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); +- rcu_read_unlock(); +- +- return pid; +-} +- +-static inline pid_t task_ppid_nr(const struct task_struct *tsk) +-{ +- return task_ppid_nr_ns(tsk, &init_pid_ns); +-} + + static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, + struct pid_namespace *ns) +@@ -1998,6 +1975,33 @@ static inline pid_t task_session_vnr(struct task_struct *tsk) + return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); + } + ++static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns); ++} ++ ++static inline pid_t task_tgid_vnr(struct task_struct *tsk) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL); ++} ++ ++static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ pid_t pid = 0; ++ ++ rcu_read_lock(); ++ if (pid_alive(tsk)) ++ pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); ++ rcu_read_unlock(); ++ ++ return pid; ++} ++ ++static inline pid_t task_ppid_nr(const struct task_struct *tsk) ++{ ++ return task_ppid_nr_ns(tsk, &init_pid_ns); ++} ++ + /* obsolete, do not use */ + static inline pid_t task_pgrp_nr(struct task_struct *tsk) + { +diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c +index 939945a5649c..a162661c9d60 100644 +--- a/kernel/audit_watch.c ++++ b/kernel/audit_watch.c +@@ -457,13 +457,15 @@ void audit_remove_watch_rule(struct audit_krule *krule) + list_del(&krule->rlist); + + if (list_empty(&watch->rules)) { ++ /* ++ * audit_remove_watch() drops our reference to 'parent' which ++ * can get freed. Grab our own reference to be safe. ++ */ ++ audit_get_parent(parent); + audit_remove_watch(watch); +- +- if (list_empty(&parent->watches)) { +- audit_get_parent(parent); ++ if (list_empty(&parent->watches)) + fsnotify_destroy_mark(&parent->mark, audit_watch_group); +- audit_put_parent(parent); +- } ++ audit_put_parent(parent); + } + } + +diff --git a/kernel/pid.c b/kernel/pid.c +index 78b3d9f80d44..b17263be9082 100644 +--- a/kernel/pid.c ++++ b/kernel/pid.c +@@ -526,8 +526,11 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + if (!ns) + ns = task_active_pid_ns(current); + if (likely(pid_alive(task))) { +- if (type != PIDTYPE_PID) ++ if (type != PIDTYPE_PID) { ++ if (type == __PIDTYPE_TGID) ++ type = PIDTYPE_PID; + task = task->group_leader; ++ } + nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); + } + rcu_read_unlock(); +@@ -536,12 +539,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + } + EXPORT_SYMBOL(__task_pid_nr_ns); + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) +-{ +- return pid_nr_ns(task_tgid(tsk), ns); +-} +-EXPORT_SYMBOL(task_tgid_nr_ns); +- + struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) + { + return ns_of_pid(task_pid(tsk)); +diff --git a/mm/mempolicy.c b/mm/mempolicy.c +index e09b1a0e2cfe..c947014d128a 100644 +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -894,11 +894,6 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, + *policy |= (pol->flags & MPOL_MODE_FLAGS); + } + +- if (vma) { +- up_read(¤t->mm->mmap_sem); +- vma = NULL; +- } +- + err = 0; + if (nmask) { + if (mpol_store_user_nodemask(pol)) { +diff --git a/mm/migrate.c b/mm/migrate.c +index 72c09dea6526..afedcfab60e2 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1483,7 +1484,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + const int __user *, nodes, + int __user *, status, int, flags) + { +- const struct cred *cred = current_cred(), *tcred; + struct task_struct *task; + struct mm_struct *mm; + int err; +@@ -1507,14 +1507,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + + /* + * Check if this process has the right to modify the specified +- * process. The right exists if the process has administrative +- * capabilities, superuser privileges or the same +- * userid as the target process. ++ * process. Use the regular "ptrace_may_access()" checks. + */ +- tcred = __task_cred(task); +- if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && +- !capable(CAP_SYS_NICE)) { ++ if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { + rcu_read_unlock(); + err = -EPERM; + goto out; +diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c +index 1a9545965c0d..531ca55f1af6 100644 +--- a/net/netfilter/nf_conntrack_extend.c ++++ b/net/netfilter/nf_conntrack_extend.c +@@ -53,7 +53,11 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } ++ + off = ALIGN(sizeof(struct nf_ct_ext), t->align); + len = off + t->len + var_alloc_len; + alloc_size = t->alloc_size + var_alloc_len; +@@ -88,7 +92,10 @@ void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } + + newoff = ALIGN(old->len, t->align); + newlen = newoff + t->len + var_alloc_len; +@@ -186,6 +193,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type) + RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL); + update_alloc_size(type); + mutex_unlock(&nf_ct_ext_type_mutex); +- rcu_barrier(); /* Wait for completion of call_rcu()'s */ ++ synchronize_rcu(); + } + EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c +index c67f9c212dd1..e326c1d80416 100644 +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -1530,19 +1530,14 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + void __user *arg) + { + struct snd_seq_queue_info info; +- int result; + struct snd_seq_queue *q; + + if (copy_from_user(&info, arg, sizeof(info))) + return -EFAULT; + +- result = snd_seq_queue_alloc(client->number, info.locked, info.flags); +- if (result < 0) +- return result; +- +- q = queueptr(result); +- if (q == NULL) +- return -EINVAL; ++ q = snd_seq_queue_alloc(client->number, info.locked, info.flags); ++ if (IS_ERR(q)) ++ return PTR_ERR(q); + + info.queue = q->queue; + info.locked = q->locked; +@@ -1552,7 +1547,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + if (! info.name[0]) + snprintf(info.name, sizeof(info.name), "Queue-%d", q->queue); + strlcpy(q->name, info.name, sizeof(q->name)); +- queuefree(q); ++ snd_use_lock_free(&q->use_lock); + + if (copy_to_user(arg, &info, sizeof(info))) + return -EFAULT; +diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c +index 450c5187eecb..79e0c5604ef8 100644 +--- a/sound/core/seq/seq_queue.c ++++ b/sound/core/seq/seq_queue.c +@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) + static void queue_use(struct snd_seq_queue *queue, int client, int use); + + /* allocate a new queue - +- * return queue index value or negative value for error ++ * return pointer to new queue or ERR_PTR(-errno) for error ++ * The new queue's use_lock is set to 1. It is the caller's responsibility to ++ * call snd_use_lock_free(&q->use_lock). + */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) + { + struct snd_seq_queue *q; + + q = queue_new(client, locked); + if (q == NULL) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + q->info_flags = info_flags; + queue_use(q, client, 1); ++ snd_use_lock_use(&q->use_lock); + if (queue_list_add(q) < 0) { ++ snd_use_lock_free(&q->use_lock); + queue_delete(q); +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + } +- return q->queue; ++ return q; + } + + /* delete a queue - queue must be owned by the client */ +diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h +index 30c8111477f6..719093489a2c 100644 +--- a/sound/core/seq/seq_queue.h ++++ b/sound/core/seq/seq_queue.h +@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); + + + /* create new queue (constructor) */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int flags); ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags); + + /* delete queue (destructor) */ + int snd_seq_queue_delete(int client, int queueid); +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c +index 499b03c8281d..696de5ac69be 100644 +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -541,6 +541,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, + + if (size < sizeof(scale)) + return -ENOMEM; ++ if (cval->min_mute) ++ scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE; + scale[2] = cval->dBmin; + scale[3] = cval->dBmax; + if (copy_to_user(_tlv, scale, sizeof(scale))) +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h +index 3417ef347e40..2b4b067646ab 100644 +--- a/sound/usb/mixer.h ++++ b/sound/usb/mixer.h +@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { + int cached; + int cache_val[MAX_CHANNELS]; + u8 initialized; ++ u8 min_mute; + void *private_data; + }; + +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c +index 04991b009132..5d2fc5f58bfe 100644 +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1873,6 +1873,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, + if (unitid == 7 && cval->control == UAC_FU_VOLUME) + snd_dragonfly_quirk_db_scale(mixer, cval, kctl); + break; ++ /* lowest playback value is muted on C-Media devices */ ++ case USB_ID(0x0d8c, 0x000c): ++ case USB_ID(0x0d8c, 0x0014): ++ if (strstr(kctl->id.name, "Playback")) ++ cval->min_mute = 1; ++ break; + } + } + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 29f38e2b4ca9..1cc20d138dae 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1143,6 +1143,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ + case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ ++ case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ + case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ + case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ + case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ diff --git a/patch/kernel/mvebu64-default/arm64_increasing_DMA_block_memory_allocation_to_2048.patch b/patch/kernel/mvebu64-default/arm64_espressobin_increasing_DMA_block_memory_allocation_to_2048.patch similarity index 85% rename from patch/kernel/mvebu64-default/arm64_increasing_DMA_block_memory_allocation_to_2048.patch rename to patch/kernel/mvebu64-default/arm64_espressobin_increasing_DMA_block_memory_allocation_to_2048.patch index d1f5d4075..bd61a5a73 100644 --- a/patch/kernel/mvebu64-default/arm64_increasing_DMA_block_memory_allocation_to_2048.patch +++ b/patch/kernel/mvebu64-default/arm64_espressobin_increasing_DMA_block_memory_allocation_to_2048.patch @@ -10,6 +10,6 @@ index 3216e09..21bce28 -#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K +#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_2M - static size_t atomic_pool_size __initdata = DEFAULT_DMA_COHERENT_POOL_SIZE; + static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE; static int __init early_coherent_pool(char *p) diff --git a/patch/kernel/rk3328-default/patch-4.4.83-84.patch b/patch/kernel/rk3328-default/patch-4.4.83-84.patch new file mode 100644 index 000000000..74a42d331 --- /dev/null +++ b/patch/kernel/rk3328-default/patch-4.4.83-84.patch @@ -0,0 +1,761 @@ +diff --git a/Makefile b/Makefile +index 7f67b35caf99..9d77ac063ec0 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 83 ++SUBLEVEL = 84 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h +index 9e11dbe1cec3..329c127e13dc 100644 +--- a/arch/arm64/include/asm/elf.h ++++ b/arch/arm64/include/asm/elf.h +@@ -121,10 +121,10 @@ typedef struct user_fpsimd_state elf_fpregset_t; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ +-#define ELF_ET_DYN_BASE 0x100000000UL ++#define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) + + /* + * When the program starts, a1 contains a pointer to a function to be +diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +index 1cd792db15ef..1eab79c9ac48 100644 +--- a/arch/x86/crypto/sha1_avx2_x86_64_asm.S ++++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +@@ -117,11 +117,10 @@ + .set T1, REG_T1 + .endm + +-#define K_BASE %r8 + #define HASH_PTR %r9 ++#define BLOCKS_CTR %r8 + #define BUFFER_PTR %r10 + #define BUFFER_PTR2 %r13 +-#define BUFFER_END %r11 + + #define PRECALC_BUF %r14 + #define WK_BUF %r15 +@@ -205,14 +204,14 @@ + * blended AVX2 and ALU instruction scheduling + * 1 vector iteration per 8 rounds + */ +- vmovdqu ((i * 2) + PRECALC_OFFSET)(BUFFER_PTR), W_TMP ++ vmovdqu (i * 2)(BUFFER_PTR), W_TMP + .elseif ((i & 7) == 1) +- vinsertf128 $1, (((i-1) * 2)+PRECALC_OFFSET)(BUFFER_PTR2),\ ++ vinsertf128 $1, ((i-1) * 2)(BUFFER_PTR2),\ + WY_TMP, WY_TMP + .elseif ((i & 7) == 2) + vpshufb YMM_SHUFB_BSWAP, WY_TMP, WY + .elseif ((i & 7) == 4) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + .elseif ((i & 7) == 7) + vmovdqu WY_TMP, PRECALC_WK(i&~7) + +@@ -255,7 +254,7 @@ + vpxor WY, WY_TMP, WY_TMP + .elseif ((i & 7) == 7) + vpxor WY_TMP2, WY_TMP, WY +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -291,7 +290,7 @@ + vpsrld $30, WY, WY + vpor WY, WY_TMP, WY + .elseif ((i & 7) == 7) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -446,6 +445,16 @@ + + .endm + ++/* Add constant only if (%2 > %3) condition met (uses RTA as temp) ++ * %1 + %2 >= %3 ? %4 : 0 ++ */ ++.macro ADD_IF_GE a, b, c, d ++ mov \a, RTA ++ add $\d, RTA ++ cmp $\c, \b ++ cmovge RTA, \a ++.endm ++ + /* + * macro implements 80 rounds of SHA-1, for multiple blocks with s/w pipelining + */ +@@ -463,13 +472,16 @@ + lea (2*4*80+32)(%rsp), WK_BUF + + # Precalc WK for first 2 blocks +- PRECALC_OFFSET = 0 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 2, 64 + .set i, 0 + .rept 160 + PRECALC i + .set i, i + 1 + .endr +- PRECALC_OFFSET = 128 ++ ++ /* Go to next block if needed */ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 3, 128 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + xchg WK_BUF, PRECALC_BUF + + .align 32 +@@ -479,8 +491,8 @@ _loop: + * we use K_BASE value as a signal of a last block, + * it is set below by: cmovae BUFFER_PTR, K_BASE + */ +- cmp K_BASE, BUFFER_PTR +- jne _begin ++ test BLOCKS_CTR, BLOCKS_CTR ++ jnz _begin + .align 32 + jmp _end + .align 32 +@@ -512,10 +524,10 @@ _loop0: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR /* move to next odd-64-byte block */ +- cmp BUFFER_END, BUFFER_PTR /* is current block the last one? */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ +- ++ /* Update Counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 4, 128 + /* + * rounds + * 60,62,64,66,68 +@@ -532,8 +544,8 @@ _loop0: + UPDATE_HASH 12(HASH_PTR), D + UPDATE_HASH 16(HASH_PTR), E + +- cmp K_BASE, BUFFER_PTR /* is current block the last one? */ +- je _loop ++ test BLOCKS_CTR, BLOCKS_CTR ++ jz _loop + + mov TB, B + +@@ -575,10 +587,10 @@ _loop2: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR2 /* move to next even-64-byte block */ +- +- cmp BUFFER_END, BUFFER_PTR2 /* is current block the last one */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ ++ /* update counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + + jmp _loop3 + _loop3: +@@ -641,19 +653,12 @@ _loop3: + + avx2_zeroupper + +- lea K_XMM_AR(%rip), K_BASE +- ++ /* Setup initial values */ + mov CTX, HASH_PTR + mov BUF, BUFFER_PTR +- lea 64(BUF), BUFFER_PTR2 +- +- shl $6, CNT /* mul by 64 */ +- add BUF, CNT +- add $64, CNT +- mov CNT, BUFFER_END + +- cmp BUFFER_END, BUFFER_PTR2 +- cmovae K_BASE, BUFFER_PTR2 ++ mov BUF, BUFFER_PTR2 ++ mov CNT, BLOCKS_CTR + + xmm_mov BSWAP_SHUFB_CTL(%rip), YMM_SHUFB_BSWAP + +diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c +index 7de207a11014..dd14616b7739 100644 +--- a/arch/x86/crypto/sha1_ssse3_glue.c ++++ b/arch/x86/crypto/sha1_ssse3_glue.c +@@ -201,7 +201,7 @@ asmlinkage void sha1_transform_avx2(u32 *digest, const char *data, + + static bool avx2_usable(void) + { +- if (false && avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) ++ if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) + && boot_cpu_has(X86_FEATURE_BMI1) + && boot_cpu_has(X86_FEATURE_BMI2)) + return true; +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index a55697d19824..cc0f2f5da19b 100644 +--- a/arch/x86/entry/entry_64.S ++++ b/arch/x86/entry/entry_64.S +@@ -1190,6 +1190,8 @@ ENTRY(nmi) + * other IST entries. + */ + ++ ASM_CLAC ++ + /* Use %rdx as our temp variable throughout */ + pushq %rdx + +diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h +index 07cf288b692e..bcd3d6199464 100644 +--- a/arch/x86/include/asm/elf.h ++++ b/arch/x86/include/asm/elf.h +@@ -247,11 +247,11 @@ extern int force_personality32; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ + #define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \ +- 0x100000000UL) ++ (TASK_SIZE / 3 * 2)) + + /* This yields a mask that user programs can use to figure out what + instruction set this CPU supports. This could be done in user space, +diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +index 8900400230c6..2cdae69d7e0b 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +@@ -153,7 +153,7 @@ static void __intel_pmu_lbr_enable(bool pmi) + */ + if (cpuc->lbr_sel) + lbr_select = cpuc->lbr_sel->config; +- if (!pmi) ++ if (!pmi && cpuc->lbr_sel) + wrmsrl(MSR_LBR_SELECT, lbr_select); + + rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl); +@@ -432,8 +432,10 @@ static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) + int out = 0; + int num = x86_pmu.lbr_nr; + +- if (cpuc->lbr_sel->config & LBR_CALL_STACK) +- num = tos; ++ if (cpuc->lbr_sel) { ++ if (cpuc->lbr_sel->config & LBR_CALL_STACK) ++ num = tos; ++ } + + for (i = 0; i < num; i++) { + unsigned long lbr_idx = (tos - i) & mask; +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c +index da5458dfb1e3..98d4e515587a 100644 +--- a/drivers/input/mouse/elan_i2c_core.c ++++ b/drivers/input/mouse/elan_i2c_core.c +@@ -1235,6 +1235,10 @@ static const struct acpi_device_id elan_acpi_id[] = { + { "ELAN0100", 0 }, + { "ELAN0600", 0 }, + { "ELAN0605", 0 }, ++ { "ELAN0608", 0 }, ++ { "ELAN0605", 0 }, ++ { "ELAN0609", 0 }, ++ { "ELAN060B", 0 }, + { "ELAN1000", 0 }, + { } + }; +diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c +index 37199b9b2cfa..831a195cb806 100644 +--- a/drivers/irqchip/irq-atmel-aic-common.c ++++ b/drivers/irqchip/irq-atmel-aic-common.c +@@ -148,9 +148,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) + struct device_node *np; + void __iomem *regs; + +- np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); ++ np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); + if (!np) +- np = of_find_compatible_node(root, NULL, ++ np = of_find_compatible_node(NULL, NULL, + "atmel,at91sam9x5-rtc"); + + if (!np) +@@ -202,7 +202,6 @@ void __init aic_common_irq_fixup(const struct of_device_id *matches) + return; + + match = of_match_node(matches, root); +- of_node_put(root); + + if (match) { + void (*fixup)(struct device_node *) = match->data; +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 582d8f0c6266..958af3b1af7f 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -707,6 +707,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ + {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ + {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ ++ {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ + {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ + {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ + {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c +index 7b0ca1551d7b..005ea632ba53 100644 +--- a/drivers/parisc/dino.c ++++ b/drivers/parisc/dino.c +@@ -954,7 +954,7 @@ static int __init dino_probe(struct parisc_device *dev) + + dino_dev->hba.dev = dev; + dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096); +- dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ ++ dino_dev->hba.lmmio_space_offset = PCI_F_EXTEND; + spin_lock_init(&dino_dev->dinosaur_pen); + dino_dev->hba.iommu = ccio_get_iommu(dev); + +diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c +index 2776cfe64c09..ef9cf4a21afe 100644 +--- a/drivers/usb/core/usb-acpi.c ++++ b/drivers/usb/core/usb-acpi.c +@@ -127,6 +127,22 @@ out: + */ + #define USB_ACPI_LOCATION_VALID (1 << 31) + ++static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent, ++ int raw) ++{ ++ struct acpi_device *adev; ++ ++ if (!parent) ++ return NULL; ++ ++ list_for_each_entry(adev, &parent->children, node) { ++ if (acpi_device_adr(adev) == raw) ++ return adev; ++ } ++ ++ return acpi_find_child_device(parent, raw, false); ++} ++ + static struct acpi_device *usb_acpi_find_companion(struct device *dev) + { + struct usb_device *udev; +@@ -174,8 +190,10 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + int raw; + + raw = usb_hcd_find_raw_port_number(hcd, port1); +- adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev), +- raw, false); ++ ++ adev = usb_acpi_find_port(ACPI_COMPANION(&udev->dev), ++ raw); ++ + if (!adev) + return NULL; + } else { +@@ -186,7 +204,9 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + return NULL; + + acpi_bus_get_device(parent_handle, &adev); +- adev = acpi_find_child_device(adev, port1, false); ++ ++ adev = usb_acpi_find_port(adev, port1); ++ + if (!adev) + return NULL; + } +diff --git a/drivers/xen/biomerge.c b/drivers/xen/biomerge.c +index 4da69dbf7dca..1bdd02a6d6ac 100644 +--- a/drivers/xen/biomerge.c ++++ b/drivers/xen/biomerge.c +@@ -10,8 +10,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, + unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); + unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); + +- return __BIOVEC_PHYS_MERGEABLE(vec1, vec2) && +- ((bfn1 == bfn2) || ((bfn1+1) == bfn2)); ++ return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; + #else + /* + * XXX: Add support for merging bio_vec when using different page +diff --git a/include/linux/pid.h b/include/linux/pid.h +index 23705a53abba..97b745ddece5 100644 +--- a/include/linux/pid.h ++++ b/include/linux/pid.h +@@ -8,7 +8,9 @@ enum pid_type + PIDTYPE_PID, + PIDTYPE_PGID, + PIDTYPE_SID, +- PIDTYPE_MAX ++ PIDTYPE_MAX, ++ /* only valid to __task_pid_nr_ns() */ ++ __PIDTYPE_TGID + }; + + /* +diff --git a/include/linux/sched.h b/include/linux/sched.h +index eff7c1fad26f..e887c8d6f395 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -1949,31 +1949,8 @@ static inline pid_t task_tgid_nr(struct task_struct *tsk) + return tsk->tgid; + } + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); +- +-static inline pid_t task_tgid_vnr(struct task_struct *tsk) +-{ +- return pid_vnr(task_tgid(tsk)); +-} +- + + static inline int pid_alive(const struct task_struct *p); +-static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) +-{ +- pid_t pid = 0; +- +- rcu_read_lock(); +- if (pid_alive(tsk)) +- pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); +- rcu_read_unlock(); +- +- return pid; +-} +- +-static inline pid_t task_ppid_nr(const struct task_struct *tsk) +-{ +- return task_ppid_nr_ns(tsk, &init_pid_ns); +-} + + static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, + struct pid_namespace *ns) +@@ -1998,6 +1975,33 @@ static inline pid_t task_session_vnr(struct task_struct *tsk) + return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); + } + ++static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns); ++} ++ ++static inline pid_t task_tgid_vnr(struct task_struct *tsk) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL); ++} ++ ++static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ pid_t pid = 0; ++ ++ rcu_read_lock(); ++ if (pid_alive(tsk)) ++ pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); ++ rcu_read_unlock(); ++ ++ return pid; ++} ++ ++static inline pid_t task_ppid_nr(const struct task_struct *tsk) ++{ ++ return task_ppid_nr_ns(tsk, &init_pid_ns); ++} ++ + /* obsolete, do not use */ + static inline pid_t task_pgrp_nr(struct task_struct *tsk) + { +diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c +index 939945a5649c..a162661c9d60 100644 +--- a/kernel/audit_watch.c ++++ b/kernel/audit_watch.c +@@ -457,13 +457,15 @@ void audit_remove_watch_rule(struct audit_krule *krule) + list_del(&krule->rlist); + + if (list_empty(&watch->rules)) { ++ /* ++ * audit_remove_watch() drops our reference to 'parent' which ++ * can get freed. Grab our own reference to be safe. ++ */ ++ audit_get_parent(parent); + audit_remove_watch(watch); +- +- if (list_empty(&parent->watches)) { +- audit_get_parent(parent); ++ if (list_empty(&parent->watches)) + fsnotify_destroy_mark(&parent->mark, audit_watch_group); +- audit_put_parent(parent); +- } ++ audit_put_parent(parent); + } + } + +diff --git a/kernel/pid.c b/kernel/pid.c +index 78b3d9f80d44..b17263be9082 100644 +--- a/kernel/pid.c ++++ b/kernel/pid.c +@@ -526,8 +526,11 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + if (!ns) + ns = task_active_pid_ns(current); + if (likely(pid_alive(task))) { +- if (type != PIDTYPE_PID) ++ if (type != PIDTYPE_PID) { ++ if (type == __PIDTYPE_TGID) ++ type = PIDTYPE_PID; + task = task->group_leader; ++ } + nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); + } + rcu_read_unlock(); +@@ -536,12 +539,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + } + EXPORT_SYMBOL(__task_pid_nr_ns); + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) +-{ +- return pid_nr_ns(task_tgid(tsk), ns); +-} +-EXPORT_SYMBOL(task_tgid_nr_ns); +- + struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) + { + return ns_of_pid(task_pid(tsk)); +diff --git a/mm/mempolicy.c b/mm/mempolicy.c +index e09b1a0e2cfe..c947014d128a 100644 +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -894,11 +894,6 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, + *policy |= (pol->flags & MPOL_MODE_FLAGS); + } + +- if (vma) { +- up_read(¤t->mm->mmap_sem); +- vma = NULL; +- } +- + err = 0; + if (nmask) { + if (mpol_store_user_nodemask(pol)) { +diff --git a/mm/migrate.c b/mm/migrate.c +index 72c09dea6526..afedcfab60e2 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1483,7 +1484,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + const int __user *, nodes, + int __user *, status, int, flags) + { +- const struct cred *cred = current_cred(), *tcred; + struct task_struct *task; + struct mm_struct *mm; + int err; +@@ -1507,14 +1507,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + + /* + * Check if this process has the right to modify the specified +- * process. The right exists if the process has administrative +- * capabilities, superuser privileges or the same +- * userid as the target process. ++ * process. Use the regular "ptrace_may_access()" checks. + */ +- tcred = __task_cred(task); +- if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && +- !capable(CAP_SYS_NICE)) { ++ if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { + rcu_read_unlock(); + err = -EPERM; + goto out; +diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c +index 1a9545965c0d..531ca55f1af6 100644 +--- a/net/netfilter/nf_conntrack_extend.c ++++ b/net/netfilter/nf_conntrack_extend.c +@@ -53,7 +53,11 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } ++ + off = ALIGN(sizeof(struct nf_ct_ext), t->align); + len = off + t->len + var_alloc_len; + alloc_size = t->alloc_size + var_alloc_len; +@@ -88,7 +92,10 @@ void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } + + newoff = ALIGN(old->len, t->align); + newlen = newoff + t->len + var_alloc_len; +@@ -186,6 +193,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type) + RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL); + update_alloc_size(type); + mutex_unlock(&nf_ct_ext_type_mutex); +- rcu_barrier(); /* Wait for completion of call_rcu()'s */ ++ synchronize_rcu(); + } + EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c +index c67f9c212dd1..e326c1d80416 100644 +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -1530,19 +1530,14 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + void __user *arg) + { + struct snd_seq_queue_info info; +- int result; + struct snd_seq_queue *q; + + if (copy_from_user(&info, arg, sizeof(info))) + return -EFAULT; + +- result = snd_seq_queue_alloc(client->number, info.locked, info.flags); +- if (result < 0) +- return result; +- +- q = queueptr(result); +- if (q == NULL) +- return -EINVAL; ++ q = snd_seq_queue_alloc(client->number, info.locked, info.flags); ++ if (IS_ERR(q)) ++ return PTR_ERR(q); + + info.queue = q->queue; + info.locked = q->locked; +@@ -1552,7 +1547,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + if (! info.name[0]) + snprintf(info.name, sizeof(info.name), "Queue-%d", q->queue); + strlcpy(q->name, info.name, sizeof(q->name)); +- queuefree(q); ++ snd_use_lock_free(&q->use_lock); + + if (copy_to_user(arg, &info, sizeof(info))) + return -EFAULT; +diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c +index 450c5187eecb..79e0c5604ef8 100644 +--- a/sound/core/seq/seq_queue.c ++++ b/sound/core/seq/seq_queue.c +@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) + static void queue_use(struct snd_seq_queue *queue, int client, int use); + + /* allocate a new queue - +- * return queue index value or negative value for error ++ * return pointer to new queue or ERR_PTR(-errno) for error ++ * The new queue's use_lock is set to 1. It is the caller's responsibility to ++ * call snd_use_lock_free(&q->use_lock). + */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) + { + struct snd_seq_queue *q; + + q = queue_new(client, locked); + if (q == NULL) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + q->info_flags = info_flags; + queue_use(q, client, 1); ++ snd_use_lock_use(&q->use_lock); + if (queue_list_add(q) < 0) { ++ snd_use_lock_free(&q->use_lock); + queue_delete(q); +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + } +- return q->queue; ++ return q; + } + + /* delete a queue - queue must be owned by the client */ +diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h +index 30c8111477f6..719093489a2c 100644 +--- a/sound/core/seq/seq_queue.h ++++ b/sound/core/seq/seq_queue.h +@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); + + + /* create new queue (constructor) */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int flags); ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags); + + /* delete queue (destructor) */ + int snd_seq_queue_delete(int client, int queueid); +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c +index 499b03c8281d..696de5ac69be 100644 +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -541,6 +541,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, + + if (size < sizeof(scale)) + return -ENOMEM; ++ if (cval->min_mute) ++ scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE; + scale[2] = cval->dBmin; + scale[3] = cval->dBmax; + if (copy_to_user(_tlv, scale, sizeof(scale))) +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h +index 3417ef347e40..2b4b067646ab 100644 +--- a/sound/usb/mixer.h ++++ b/sound/usb/mixer.h +@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { + int cached; + int cache_val[MAX_CHANNELS]; + u8 initialized; ++ u8 min_mute; + void *private_data; + }; + +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c +index 04991b009132..5d2fc5f58bfe 100644 +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1873,6 +1873,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, + if (unitid == 7 && cval->control == UAC_FU_VOLUME) + snd_dragonfly_quirk_db_scale(mixer, cval, kctl); + break; ++ /* lowest playback value is muted on C-Media devices */ ++ case USB_ID(0x0d8c, 0x000c): ++ case USB_ID(0x0d8c, 0x0014): ++ if (strstr(kctl->id.name, "Playback")) ++ cval->min_mute = 1; ++ break; + } + } + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 29f38e2b4ca9..1cc20d138dae 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1143,6 +1143,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ + case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ ++ case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ + case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ + case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ + case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ diff --git a/patch/kernel/rockchip-default/03-patch-4.4.81-82.patch b/patch/kernel/rockchip-default/03-patch-4.4.81-82.patch new file mode 100644 index 000000000..f61b7675a --- /dev/null +++ b/patch/kernel/rockchip-default/03-patch-4.4.81-82.patch @@ -0,0 +1,330 @@ +diff --git a/Makefile b/Makefile +index d049e53a6960..52f2dd8dcebd 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 81 ++SUBLEVEL = 82 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c +index 1f1ff7e7b9cf..ba079e279b58 100644 +--- a/arch/arm/kvm/mmu.c ++++ b/arch/arm/kvm/mmu.c +@@ -1629,12 +1629,16 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, void *data) + + int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end) + { ++ if (!kvm->arch.pgd) ++ return 0; + trace_kvm_age_hva(start, end); + return handle_hva_to_gpa(kvm, start, end, kvm_age_hva_handler, NULL); + } + + int kvm_test_age_hva(struct kvm *kvm, unsigned long hva) + { ++ if (!kvm->arch.pgd) ++ return 0; + trace_kvm_test_age_hva(hva); + return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL); + } +diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c +index 0e2919dd8df3..1395eeb6005f 100644 +--- a/arch/s390/net/bpf_jit_comp.c ++++ b/arch/s390/net/bpf_jit_comp.c +@@ -1250,7 +1250,8 @@ static int bpf_jit_prog(struct bpf_jit *jit, struct bpf_prog *fp) + insn_count = bpf_jit_insn(jit, fp, i); + if (insn_count < 0) + return -1; +- jit->addrs[i + 1] = jit->prg; /* Next instruction address */ ++ /* Next instruction address */ ++ jit->addrs[i + insn_count] = jit->prg; + } + bpf_jit_epilogue(jit); + +diff --git a/arch/sparc/include/asm/mmu_context_64.h b/arch/sparc/include/asm/mmu_context_64.h +index 349dd23e2876..0cdeb2b483a0 100644 +--- a/arch/sparc/include/asm/mmu_context_64.h ++++ b/arch/sparc/include/asm/mmu_context_64.h +@@ -25,9 +25,11 @@ void destroy_context(struct mm_struct *mm); + void __tsb_context_switch(unsigned long pgd_pa, + struct tsb_config *tsb_base, + struct tsb_config *tsb_huge, +- unsigned long tsb_descr_pa); ++ unsigned long tsb_descr_pa, ++ unsigned long secondary_ctx); + +-static inline void tsb_context_switch(struct mm_struct *mm) ++static inline void tsb_context_switch_ctx(struct mm_struct *mm, ++ unsigned long ctx) + { + __tsb_context_switch(__pa(mm->pgd), + &mm->context.tsb_block[0], +@@ -38,9 +40,12 @@ static inline void tsb_context_switch(struct mm_struct *mm) + #else + NULL + #endif +- , __pa(&mm->context.tsb_descr[0])); ++ , __pa(&mm->context.tsb_descr[0]), ++ ctx); + } + ++#define tsb_context_switch(X) tsb_context_switch_ctx(X, 0) ++ + void tsb_grow(struct mm_struct *mm, + unsigned long tsb_index, + unsigned long mm_rss); +@@ -110,8 +115,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str + * cpu0 to update it's TSB because at that point the cpu_vm_mask + * only had cpu1 set in it. + */ +- load_secondary_context(mm); +- tsb_context_switch(mm); ++ tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); + + /* Any time a processor runs a context on an address space + * for the first time, we must flush that context out of the +diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S +index 395ec1800530..7d961f6e3907 100644 +--- a/arch/sparc/kernel/tsb.S ++++ b/arch/sparc/kernel/tsb.S +@@ -375,6 +375,7 @@ tsb_flush: + * %o1: TSB base config pointer + * %o2: TSB huge config pointer, or NULL if none + * %o3: Hypervisor TSB descriptor physical address ++ * %o4: Secondary context to load, if non-zero + * + * We have to run this whole thing with interrupts + * disabled so that the current cpu doesn't change +@@ -387,6 +388,17 @@ __tsb_context_switch: + rdpr %pstate, %g1 + wrpr %g1, PSTATE_IE, %pstate + ++ brz,pn %o4, 1f ++ mov SECONDARY_CONTEXT, %o5 ++ ++661: stxa %o4, [%o5] ASI_DMMU ++ .section .sun4v_1insn_patch, "ax" ++ .word 661b ++ stxa %o4, [%o5] ASI_MMU ++ .previous ++ flush %g6 ++ ++1: + TRAP_LOAD_TRAP_BLOCK(%g2, %g3) + + stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR] +diff --git a/arch/sparc/power/hibernate.c b/arch/sparc/power/hibernate.c +index 17bd2e167e07..df707a8ad311 100644 +--- a/arch/sparc/power/hibernate.c ++++ b/arch/sparc/power/hibernate.c +@@ -35,6 +35,5 @@ void restore_processor_state(void) + { + struct mm_struct *mm = current->active_mm; + +- load_secondary_context(mm); +- tsb_context_switch(mm); ++ tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); + } +diff --git a/mm/mempool.c b/mm/mempool.c +index 004d42b1dfaf..7924f4f58a6d 100644 +--- a/mm/mempool.c ++++ b/mm/mempool.c +@@ -135,8 +135,8 @@ static void *remove_element(mempool_t *pool) + void *element = pool->elements[--pool->curr_nr]; + + BUG_ON(pool->curr_nr < 0); +- check_element(pool, element); + kasan_unpoison_element(pool, element); ++ check_element(pool, element); + return element; + } + +diff --git a/net/core/dev.c b/net/core/dev.c +index 4b0853194a03..24d243084aab 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -2551,7 +2551,7 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path) + { + if (tx_path) + return skb->ip_summed != CHECKSUM_PARTIAL && +- skb->ip_summed != CHECKSUM_NONE; ++ skb->ip_summed != CHECKSUM_UNNECESSARY; + + return skb->ip_summed == CHECKSUM_NONE; + } +diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c +index 5d58a6703a43..09c73dd541c5 100644 +--- a/net/ipv4/ip_output.c ++++ b/net/ipv4/ip_output.c +@@ -922,11 +922,12 @@ static int __ip_append_data(struct sock *sk, + csummode = CHECKSUM_PARTIAL; + + cork->length += length; +- if ((((length + (skb ? skb->len : fragheaderlen)) > mtu) || +- (skb && skb_is_gso(skb))) && ++ if ((skb && skb_is_gso(skb)) || ++ (((length + (skb ? skb->len : fragheaderlen)) > mtu) && ++ (skb_queue_len(queue) <= 1) && + (sk->sk_protocol == IPPROTO_UDP) && + (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && +- (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) { ++ (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx)) { + err = ip_ufo_append_data(sk, queue, getfrag, from, length, + hh_len, fragheaderlen, transhdrlen, + maxfraglen, flags); +@@ -1242,6 +1243,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, + return -EINVAL; + + if ((size + skb->len > mtu) && ++ (skb_queue_len(&sk->sk_write_queue) == 1) && + (sk->sk_protocol == IPPROTO_UDP) && + (rt->dst.dev->features & NETIF_F_UFO)) { + if (skb->ip_summed != CHECKSUM_PARTIAL) +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c +index 8f13b2eaabf8..f0dabd125c43 100644 +--- a/net/ipv4/tcp_input.c ++++ b/net/ipv4/tcp_input.c +@@ -2503,8 +2503,8 @@ static inline void tcp_end_cwnd_reduction(struct sock *sk) + struct tcp_sock *tp = tcp_sk(sk); + + /* Reset cwnd to ssthresh in CWR or Recovery (unless it's undone) */ +- if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || +- (tp->undo_marker && tp->snd_ssthresh < TCP_INFINITE_SSTHRESH)) { ++ if (tp->snd_ssthresh < TCP_INFINITE_SSTHRESH && ++ (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR || tp->undo_marker)) { + tp->snd_cwnd = tp->snd_ssthresh; + tp->snd_cwnd_stamp = tcp_time_stamp; + } +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c +index 3fdcdc730f71..850d1b5bfd81 100644 +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -3256,6 +3256,9 @@ int tcp_connect(struct sock *sk) + struct sk_buff *buff; + int err; + ++ if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) ++ return -EHOSTUNREACH; /* Routing failure or similar. */ ++ + tcp_connect_init(sk); + + if (unlikely(tp->repair)) { +diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c +index ebb34d0c5e80..1ec12a4f327e 100644 +--- a/net/ipv4/tcp_timer.c ++++ b/net/ipv4/tcp_timer.c +@@ -606,7 +606,8 @@ static void tcp_keepalive_timer (unsigned long data) + goto death; + } + +- if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE) ++ if (!sock_flag(sk, SOCK_KEEPOPEN) || ++ ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_SYN_SENT))) + goto out; + + elapsed = keepalive_time_when(tp); +diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c +index e9513e397c4f..301e60829c7e 100644 +--- a/net/ipv4/udp.c ++++ b/net/ipv4/udp.c +@@ -819,7 +819,7 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4) + if (is_udplite) /* UDP-Lite */ + csum = udplite_csum(skb); + +- else if (sk->sk_no_check_tx) { /* UDP csum disabled */ ++ else if (sk->sk_no_check_tx && !skb_is_gso(skb)) { /* UDP csum off */ + + skb->ip_summed = CHECKSUM_NONE; + goto send; +diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c +index 6396f1c80ae9..6dfc3daf7c21 100644 +--- a/net/ipv4/udp_offload.c ++++ b/net/ipv4/udp_offload.c +@@ -231,7 +231,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, + if (uh->check == 0) + uh->check = CSUM_MANGLED_0; + +- skb->ip_summed = CHECKSUM_NONE; ++ skb->ip_summed = CHECKSUM_UNNECESSARY; + + /* Fragment the skb. IP headers of the fragments are updated in + * inet_gso_segment() +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c +index 0de3245ea42f..e22339fad10b 100644 +--- a/net/ipv6/ip6_output.c ++++ b/net/ipv6/ip6_output.c +@@ -1357,11 +1357,12 @@ emsgsize: + */ + + cork->length += length; +- if ((((length + (skb ? skb->len : headersize)) > mtu) || +- (skb && skb_is_gso(skb))) && ++ if ((skb && skb_is_gso(skb)) || ++ (((length + (skb ? skb->len : headersize)) > mtu) && ++ (skb_queue_len(queue) <= 1) && + (sk->sk_protocol == IPPROTO_UDP) && + (rt->dst.dev->features & NETIF_F_UFO) && +- (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { ++ (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk))) { + err = ip6_ufo_append_data(sk, queue, getfrag, from, length, + hh_len, fragheaderlen, exthdrlen, + transhdrlen, mtu, flags, fl6); +diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c +index 01582966ffa0..2e3c12eeca07 100644 +--- a/net/ipv6/udp_offload.c ++++ b/net/ipv6/udp_offload.c +@@ -86,7 +86,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, + if (uh->check == 0) + uh->check = CSUM_MANGLED_0; + +- skb->ip_summed = CHECKSUM_NONE; ++ skb->ip_summed = CHECKSUM_UNNECESSARY; + + /* Check if there is enough headroom to insert fragment header. */ + tnl_hlen = skb_tnl_header_len(skb); +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c +index 061771ca2582..148ec130d99d 100644 +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -3622,14 +3622,19 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv + + if (optlen != sizeof(val)) + return -EINVAL; +- if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) +- return -EBUSY; + if (copy_from_user(&val, optval, sizeof(val))) + return -EFAULT; + if (val > INT_MAX) + return -EINVAL; +- po->tp_reserve = val; +- return 0; ++ lock_sock(sk); ++ if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) { ++ ret = -EBUSY; ++ } else { ++ po->tp_reserve = val; ++ ret = 0; ++ } ++ release_sock(sk); ++ return ret; + } + case PACKET_LOSS: + { +diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c +index d05869646515..0915d448ba23 100644 +--- a/net/sched/act_ipt.c ++++ b/net/sched/act_ipt.c +@@ -42,8 +42,8 @@ static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int + return PTR_ERR(target); + + t->u.kernel.target = target; ++ memset(&par, 0, sizeof(par)); + par.table = table; +- par.entryinfo = NULL; + par.target = target; + par.targinfo = t->data; + par.hook_mask = hook; diff --git a/patch/kernel/rockchip-default/03-patch-4.4.82-83.patch b/patch/kernel/rockchip-default/03-patch-4.4.82-83.patch new file mode 100644 index 000000000..104c0c331 --- /dev/null +++ b/patch/kernel/rockchip-default/03-patch-4.4.82-83.patch @@ -0,0 +1,476 @@ +diff --git a/Makefile b/Makefile +index 52f2dd8dcebd..7f67b35caf99 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 82 ++SUBLEVEL = 83 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c +index fa24d5196615..c7122919a8c0 100644 +--- a/drivers/iio/accel/bmc150-accel-core.c ++++ b/drivers/iio/accel/bmc150-accel-core.c +@@ -194,7 +194,6 @@ struct bmc150_accel_data { + struct device *dev; + int irq; + struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS]; +- atomic_t active_intr; + struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS]; + struct mutex mutex; + u8 fifo_mode, watermark; +@@ -489,11 +488,6 @@ static int bmc150_accel_set_interrupt(struct bmc150_accel_data *data, int i, + goto out_fix_power_state; + } + +- if (state) +- atomic_inc(&data->active_intr); +- else +- atomic_dec(&data->active_intr); +- + return 0; + + out_fix_power_state: +@@ -1704,8 +1698,7 @@ static int bmc150_accel_resume(struct device *dev) + struct bmc150_accel_data *data = iio_priv(indio_dev); + + mutex_lock(&data->mutex); +- if (atomic_read(&data->active_intr)) +- bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); ++ bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); + bmc150_accel_fifo_set_mode(data); + mutex_unlock(&data->mutex); + +diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c +index b10f629cc44b..1dbc2143cdfc 100644 +--- a/drivers/iio/adc/vf610_adc.c ++++ b/drivers/iio/adc/vf610_adc.c +@@ -77,7 +77,7 @@ + #define VF610_ADC_ADSTS_MASK 0x300 + #define VF610_ADC_ADLPC_EN 0x80 + #define VF610_ADC_ADHSC_EN 0x400 +-#define VF610_ADC_REFSEL_VALT 0x100 ++#define VF610_ADC_REFSEL_VALT 0x800 + #define VF610_ADC_REFSEL_VBG 0x1000 + #define VF610_ADC_ADTRG_HARD 0x2000 + #define VF610_ADC_AVGS_8 0x4000 +diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c +index 12731d6b89ec..ec1b2e798cc1 100644 +--- a/drivers/iio/light/tsl2563.c ++++ b/drivers/iio/light/tsl2563.c +@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private) + struct tsl2563_chip *chip = iio_priv(dev_info); + + iio_push_event(dev_info, +- IIO_UNMOD_EVENT_CODE(IIO_LIGHT, ++ IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, + 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_EITHER), +diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c +index 71ccf6a90b22..2551e4adb33f 100644 +--- a/drivers/pinctrl/samsung/pinctrl-exynos.c ++++ b/drivers/pinctrl/samsung/pinctrl-exynos.c +@@ -194,8 +194,6 @@ static int exynos_irq_request_resources(struct irq_data *irqd) + + spin_unlock_irqrestore(&bank->slock, flags); + +- exynos_irq_unmask(irqd); +- + return 0; + } + +@@ -216,8 +214,6 @@ static void exynos_irq_release_resources(struct irq_data *irqd) + shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC]; + mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; + +- exynos_irq_mask(irqd); +- + spin_lock_irqsave(&bank->slock, flags); + + con = readl(d->virt_base + reg_con); +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +index 862a096c5dba..be5c71df148d 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +@@ -811,6 +811,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = { + SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */ + SUNXI_FUNCTION(0x3, "pata"), /* ATAD12 */ + SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */ ++ SUNXI_FUNCTION(0x5, "sim"), /* DET */ + SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */ + SUNXI_FUNCTION(0x7, "csi1")), /* D16 */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17), +diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c +index d97aa2827412..8eb7179da342 100644 +--- a/drivers/staging/iio/resolver/ad2s1210.c ++++ b/drivers/staging/iio/resolver/ad2s1210.c +@@ -468,7 +468,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev, + long m) + { + struct ad2s1210_state *st = iio_priv(indio_dev); +- bool negative; ++ u16 negative; + int ret = 0; + u16 pos; + s16 vel; +diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c +index 31d5d9c0e10b..1ff1c83e2df5 100644 +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -418,6 +418,7 @@ int iscsit_reset_np_thread( + return 0; + } + np->np_thread_state = ISCSI_NP_THREAD_RESET; ++ atomic_inc(&np->np_reset_count); + + if (np->np_thread) { + spin_unlock_bh(&np->np_thread_lock); +@@ -1996,6 +1997,7 @@ iscsit_setup_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, + cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); + cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); + cmd->data_direction = DMA_NONE; ++ kfree(cmd->text_in_ptr); + cmd->text_in_ptr = NULL; + + return 0; +diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c +index b19edffa7d98..bc2cbffec27e 100644 +--- a/drivers/target/iscsi/iscsi_target_login.c ++++ b/drivers/target/iscsi/iscsi_target_login.c +@@ -1219,9 +1219,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + flush_signals(current); + + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { + np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; ++ spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); ++ return 1; + } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { + spin_unlock_bh(&np->np_thread_lock); + goto exit; +@@ -1254,7 +1256,8 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + goto exit; + } else if (rc < 0) { + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { ++ np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; + spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); + iscsit_put_transport(conn->conn_transport); +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index b403596818db..5c0952995280 100644 +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1851,7 +1851,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, + /* No more submits can occur */ + spin_lock_irq(&hcd_urb_list_lock); + rescan: +- list_for_each_entry (urb, &ep->urb_list, urb_list) { ++ list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) { + int is_in; + + if (urb->unlinked) +@@ -2448,6 +2448,8 @@ void usb_hc_died (struct usb_hcd *hcd) + } + if (usb_hcd_is_primary_hcd(hcd) && hcd->shared_hcd) { + hcd = hcd->shared_hcd; ++ clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags); ++ set_bit(HCD_FLAG_DEAD, &hcd->flags); + if (hcd->rh_registered) { + clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 1d59d489a1ad..cdf4be3939f5 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4661,7 +4661,8 @@ hub_power_remaining(struct usb_hub *hub) + static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, + u16 portchange) + { +- int status, i; ++ int status = -ENODEV; ++ int i; + unsigned unit_load; + struct usb_device *hdev = hub->hdev; + struct usb_hcd *hcd = bus_to_hcd(hdev->bus); +@@ -4865,9 +4866,10 @@ loop: + + done: + hub_port_disable(hub, port1, 1); +- if (hcd->driver->relinquish_port && !hub->hdev->parent) +- hcd->driver->relinquish_port(hcd, port1); +- ++ if (hcd->driver->relinquish_port && !hub->hdev->parent) { ++ if (status != -ENOTCONN && status != -ENODEV) ++ hcd->driver->relinquish_port(hcd, port1); ++ } + } + + /* Handle physical or logical connection change events. +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c +index 3116edfcdc18..574da2b4529c 100644 +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -150,6 +150,9 @@ static const struct usb_device_id usb_quirk_list[] = { + /* appletouch */ + { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, + ++ /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */ ++ { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM }, ++ + /* Avision AV600U */ + { USB_DEVICE(0x0638, 0x0a13), .driver_info = + USB_QUIRK_STRING_FETCH_255 }, +@@ -249,6 +252,7 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = { + { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME }, ++ { USB_DEVICE(0x03f0, 0x2b4a), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Logitech Optical Mouse M90/M100 */ + { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME }, +diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c +index f9400564cb72..03b9a372636f 100644 +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -89,6 +89,7 @@ enum amd_chipset_gen { + AMD_CHIPSET_HUDSON2, + AMD_CHIPSET_BOLTON, + AMD_CHIPSET_YANGTZE, ++ AMD_CHIPSET_TAISHAN, + AMD_CHIPSET_UNKNOWN, + }; + +@@ -132,6 +133,11 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) + pinfo->sb_type.gen = AMD_CHIPSET_SB700; + else if (rev >= 0x40 && rev <= 0x4f) + pinfo->sb_type.gen = AMD_CHIPSET_SB800; ++ } ++ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, ++ 0x145c, NULL); ++ if (pinfo->smbus_dev) { ++ pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; + } else { + pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); +@@ -251,11 +257,12 @@ int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev) + { + /* Make sure amd chipset type has already been initialized */ + usb_amd_find_chipset_info(); +- if (amd_chipset.sb_type.gen != AMD_CHIPSET_YANGTZE) +- return 0; +- +- dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); +- return 1; ++ if (amd_chipset.sb_type.gen == AMD_CHIPSET_YANGTZE || ++ amd_chipset.sb_type.gen == AMD_CHIPSET_TAISHAN) { ++ dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); ++ return 1; ++ } ++ return 0; + } + EXPORT_SYMBOL_GPL(usb_hcd_amd_remote_wakeup_quirk); + +diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c +index 13d5614f37f1..0d843e0f8055 100644 +--- a/drivers/usb/musb/musb_host.c ++++ b/drivers/usb/musb/musb_host.c +@@ -138,6 +138,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) + "Could not flush host TX%d fifo: csr: %04x\n", + ep->epnum, csr)) + return; ++ mdelay(1); + } + } + +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c +index b0dc6da3d970..41a6513646de 100644 +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -135,6 +135,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ + { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ + { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ ++ { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index ebe51f11105d..fe123153b1a5 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2025,6 +2025,8 @@ static const struct usb_device_id option_ids[] = { + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */ ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/A3 */ +diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c +index 1db4b61bdf7b..a51b28379850 100644 +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, ++ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_UC485) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) }, + { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) }, + { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, +diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h +index 09d9be88209e..3b5a15d1dc0d 100644 +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -27,6 +27,7 @@ + #define ATEN_VENDOR_ID 0x0557 + #define ATEN_VENDOR_ID2 0x0547 + #define ATEN_PRODUCT_ID 0x2008 ++#define ATEN_PRODUCT_UC485 0x2021 + #define ATEN_PRODUCT_ID2 0x2118 + + #define IODATA_VENDOR_ID 0x04bb +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 53341a77d89f..a37ed1e59e99 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -123,9 +123,9 @@ UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999, + /* Reported-by: Benjamin Tissoires */ + UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, + "Initio Corporation", +- "", ++ "INIC-3069", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, +- US_FL_NO_ATA_1X), ++ US_FL_NO_ATA_1X | US_FL_IGNORE_RESIDUE), + + /* Reported-by: Tom Arild Naess */ + UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999, +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index 11538a8be9f0..1a063cbfe503 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -46,7 +46,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) + { + struct fuse_file *ff; + +- ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL); ++ ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL); + if (unlikely(!ff)) + return NULL; + +diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig +index f31fd0dd92c6..b1daeafbea92 100644 +--- a/fs/nfs/Kconfig ++++ b/fs/nfs/Kconfig +@@ -121,6 +121,7 @@ config PNFS_FILE_LAYOUT + config PNFS_BLOCK + tristate + depends on NFS_V4_1 && BLK_DEV_DM ++ depends on 64BIT || LBDAF + default NFS_V4 + + config PNFS_OBJLAYOUT +diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +index e125e55de86d..2603d7589946 100644 +--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c ++++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +@@ -30,6 +30,7 @@ void nfs4_ff_layout_free_deviceid(struct nfs4_ff_layout_ds *mirror_ds) + { + nfs4_print_deviceid(&mirror_ds->id_node.deviceid); + nfs4_pnfs_ds_put(mirror_ds->ds); ++ kfree(mirror_ds->ds_versions); + kfree_rcu(mirror_ds, id_node.rcu); + } + +diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h +index 85a868ccb493..8397dc235e84 100644 +--- a/include/linux/cpuset.h ++++ b/include/linux/cpuset.h +@@ -16,6 +16,7 @@ + + #ifdef CONFIG_CPUSETS + ++extern struct static_key cpusets_pre_enable_key; + extern struct static_key cpusets_enabled_key; + static inline bool cpusets_enabled(void) + { +@@ -30,12 +31,14 @@ static inline int nr_cpusets(void) + + static inline void cpuset_inc(void) + { ++ static_key_slow_inc(&cpusets_pre_enable_key); + static_key_slow_inc(&cpusets_enabled_key); + } + + static inline void cpuset_dec(void) + { + static_key_slow_dec(&cpusets_enabled_key); ++ static_key_slow_dec(&cpusets_pre_enable_key); + } + + extern int cpuset_init(void); +@@ -104,7 +107,7 @@ extern void cpuset_print_current_mems_allowed(void); + */ + static inline unsigned int read_mems_allowed_begin(void) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_pre_enable_key)) + return 0; + + return read_seqcount_begin(¤t->mems_allowed_seq); +@@ -118,7 +121,7 @@ static inline unsigned int read_mems_allowed_begin(void) + */ + static inline bool read_mems_allowed_retry(unsigned int seq) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_enabled_key)) + return false; + + return read_seqcount_retry(¤t->mems_allowed_seq, seq); +diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h +index fdda45f26f75..22f442ab85f9 100644 +--- a/include/target/iscsi/iscsi_target_core.h ++++ b/include/target/iscsi/iscsi_target_core.h +@@ -784,6 +784,7 @@ struct iscsi_np { + int np_sock_type; + enum np_thread_state_table np_thread_state; + bool enabled; ++ atomic_t np_reset_count; + enum iscsi_timer_flags_table np_login_timer_flags; + u32 np_exports; + enum np_flags_table np_flags; +diff --git a/kernel/cpuset.c b/kernel/cpuset.c +index 3b5e5430f5d0..8ccd66a97c8b 100644 +--- a/kernel/cpuset.c ++++ b/kernel/cpuset.c +@@ -60,6 +60,7 @@ + #include + #include + ++struct static_key cpusets_pre_enable_key __read_mostly = STATIC_KEY_INIT_FALSE; + struct static_key cpusets_enabled_key __read_mostly = STATIC_KEY_INIT_FALSE; + + /* See "Frequency meter" comments, below. */ +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index f9d648fce8cd..53286b2f5b1c 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6804,7 +6804,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, + + /* Make sure the range is really isolated. */ + if (test_pages_isolated(outer_start, end, false)) { +- pr_info("%s: [%lx, %lx) PFNs busy\n", ++ pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n", + __func__, outer_start, end); + ret = -EBUSY; + goto done; diff --git a/patch/kernel/rockchip-default/03-patch-4.4.83-84.patch b/patch/kernel/rockchip-default/03-patch-4.4.83-84.patch new file mode 100644 index 000000000..74a42d331 --- /dev/null +++ b/patch/kernel/rockchip-default/03-patch-4.4.83-84.patch @@ -0,0 +1,761 @@ +diff --git a/Makefile b/Makefile +index 7f67b35caf99..9d77ac063ec0 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 83 ++SUBLEVEL = 84 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h +index 9e11dbe1cec3..329c127e13dc 100644 +--- a/arch/arm64/include/asm/elf.h ++++ b/arch/arm64/include/asm/elf.h +@@ -121,10 +121,10 @@ typedef struct user_fpsimd_state elf_fpregset_t; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ +-#define ELF_ET_DYN_BASE 0x100000000UL ++#define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) + + /* + * When the program starts, a1 contains a pointer to a function to be +diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +index 1cd792db15ef..1eab79c9ac48 100644 +--- a/arch/x86/crypto/sha1_avx2_x86_64_asm.S ++++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +@@ -117,11 +117,10 @@ + .set T1, REG_T1 + .endm + +-#define K_BASE %r8 + #define HASH_PTR %r9 ++#define BLOCKS_CTR %r8 + #define BUFFER_PTR %r10 + #define BUFFER_PTR2 %r13 +-#define BUFFER_END %r11 + + #define PRECALC_BUF %r14 + #define WK_BUF %r15 +@@ -205,14 +204,14 @@ + * blended AVX2 and ALU instruction scheduling + * 1 vector iteration per 8 rounds + */ +- vmovdqu ((i * 2) + PRECALC_OFFSET)(BUFFER_PTR), W_TMP ++ vmovdqu (i * 2)(BUFFER_PTR), W_TMP + .elseif ((i & 7) == 1) +- vinsertf128 $1, (((i-1) * 2)+PRECALC_OFFSET)(BUFFER_PTR2),\ ++ vinsertf128 $1, ((i-1) * 2)(BUFFER_PTR2),\ + WY_TMP, WY_TMP + .elseif ((i & 7) == 2) + vpshufb YMM_SHUFB_BSWAP, WY_TMP, WY + .elseif ((i & 7) == 4) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + .elseif ((i & 7) == 7) + vmovdqu WY_TMP, PRECALC_WK(i&~7) + +@@ -255,7 +254,7 @@ + vpxor WY, WY_TMP, WY_TMP + .elseif ((i & 7) == 7) + vpxor WY_TMP2, WY_TMP, WY +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -291,7 +290,7 @@ + vpsrld $30, WY, WY + vpor WY, WY_TMP, WY + .elseif ((i & 7) == 7) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -446,6 +445,16 @@ + + .endm + ++/* Add constant only if (%2 > %3) condition met (uses RTA as temp) ++ * %1 + %2 >= %3 ? %4 : 0 ++ */ ++.macro ADD_IF_GE a, b, c, d ++ mov \a, RTA ++ add $\d, RTA ++ cmp $\c, \b ++ cmovge RTA, \a ++.endm ++ + /* + * macro implements 80 rounds of SHA-1, for multiple blocks with s/w pipelining + */ +@@ -463,13 +472,16 @@ + lea (2*4*80+32)(%rsp), WK_BUF + + # Precalc WK for first 2 blocks +- PRECALC_OFFSET = 0 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 2, 64 + .set i, 0 + .rept 160 + PRECALC i + .set i, i + 1 + .endr +- PRECALC_OFFSET = 128 ++ ++ /* Go to next block if needed */ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 3, 128 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + xchg WK_BUF, PRECALC_BUF + + .align 32 +@@ -479,8 +491,8 @@ _loop: + * we use K_BASE value as a signal of a last block, + * it is set below by: cmovae BUFFER_PTR, K_BASE + */ +- cmp K_BASE, BUFFER_PTR +- jne _begin ++ test BLOCKS_CTR, BLOCKS_CTR ++ jnz _begin + .align 32 + jmp _end + .align 32 +@@ -512,10 +524,10 @@ _loop0: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR /* move to next odd-64-byte block */ +- cmp BUFFER_END, BUFFER_PTR /* is current block the last one? */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ +- ++ /* Update Counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 4, 128 + /* + * rounds + * 60,62,64,66,68 +@@ -532,8 +544,8 @@ _loop0: + UPDATE_HASH 12(HASH_PTR), D + UPDATE_HASH 16(HASH_PTR), E + +- cmp K_BASE, BUFFER_PTR /* is current block the last one? */ +- je _loop ++ test BLOCKS_CTR, BLOCKS_CTR ++ jz _loop + + mov TB, B + +@@ -575,10 +587,10 @@ _loop2: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR2 /* move to next even-64-byte block */ +- +- cmp BUFFER_END, BUFFER_PTR2 /* is current block the last one */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ ++ /* update counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + + jmp _loop3 + _loop3: +@@ -641,19 +653,12 @@ _loop3: + + avx2_zeroupper + +- lea K_XMM_AR(%rip), K_BASE +- ++ /* Setup initial values */ + mov CTX, HASH_PTR + mov BUF, BUFFER_PTR +- lea 64(BUF), BUFFER_PTR2 +- +- shl $6, CNT /* mul by 64 */ +- add BUF, CNT +- add $64, CNT +- mov CNT, BUFFER_END + +- cmp BUFFER_END, BUFFER_PTR2 +- cmovae K_BASE, BUFFER_PTR2 ++ mov BUF, BUFFER_PTR2 ++ mov CNT, BLOCKS_CTR + + xmm_mov BSWAP_SHUFB_CTL(%rip), YMM_SHUFB_BSWAP + +diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c +index 7de207a11014..dd14616b7739 100644 +--- a/arch/x86/crypto/sha1_ssse3_glue.c ++++ b/arch/x86/crypto/sha1_ssse3_glue.c +@@ -201,7 +201,7 @@ asmlinkage void sha1_transform_avx2(u32 *digest, const char *data, + + static bool avx2_usable(void) + { +- if (false && avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) ++ if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) + && boot_cpu_has(X86_FEATURE_BMI1) + && boot_cpu_has(X86_FEATURE_BMI2)) + return true; +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index a55697d19824..cc0f2f5da19b 100644 +--- a/arch/x86/entry/entry_64.S ++++ b/arch/x86/entry/entry_64.S +@@ -1190,6 +1190,8 @@ ENTRY(nmi) + * other IST entries. + */ + ++ ASM_CLAC ++ + /* Use %rdx as our temp variable throughout */ + pushq %rdx + +diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h +index 07cf288b692e..bcd3d6199464 100644 +--- a/arch/x86/include/asm/elf.h ++++ b/arch/x86/include/asm/elf.h +@@ -247,11 +247,11 @@ extern int force_personality32; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ + #define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \ +- 0x100000000UL) ++ (TASK_SIZE / 3 * 2)) + + /* This yields a mask that user programs can use to figure out what + instruction set this CPU supports. This could be done in user space, +diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +index 8900400230c6..2cdae69d7e0b 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +@@ -153,7 +153,7 @@ static void __intel_pmu_lbr_enable(bool pmi) + */ + if (cpuc->lbr_sel) + lbr_select = cpuc->lbr_sel->config; +- if (!pmi) ++ if (!pmi && cpuc->lbr_sel) + wrmsrl(MSR_LBR_SELECT, lbr_select); + + rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl); +@@ -432,8 +432,10 @@ static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) + int out = 0; + int num = x86_pmu.lbr_nr; + +- if (cpuc->lbr_sel->config & LBR_CALL_STACK) +- num = tos; ++ if (cpuc->lbr_sel) { ++ if (cpuc->lbr_sel->config & LBR_CALL_STACK) ++ num = tos; ++ } + + for (i = 0; i < num; i++) { + unsigned long lbr_idx = (tos - i) & mask; +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c +index da5458dfb1e3..98d4e515587a 100644 +--- a/drivers/input/mouse/elan_i2c_core.c ++++ b/drivers/input/mouse/elan_i2c_core.c +@@ -1235,6 +1235,10 @@ static const struct acpi_device_id elan_acpi_id[] = { + { "ELAN0100", 0 }, + { "ELAN0600", 0 }, + { "ELAN0605", 0 }, ++ { "ELAN0608", 0 }, ++ { "ELAN0605", 0 }, ++ { "ELAN0609", 0 }, ++ { "ELAN060B", 0 }, + { "ELAN1000", 0 }, + { } + }; +diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c +index 37199b9b2cfa..831a195cb806 100644 +--- a/drivers/irqchip/irq-atmel-aic-common.c ++++ b/drivers/irqchip/irq-atmel-aic-common.c +@@ -148,9 +148,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) + struct device_node *np; + void __iomem *regs; + +- np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); ++ np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); + if (!np) +- np = of_find_compatible_node(root, NULL, ++ np = of_find_compatible_node(NULL, NULL, + "atmel,at91sam9x5-rtc"); + + if (!np) +@@ -202,7 +202,6 @@ void __init aic_common_irq_fixup(const struct of_device_id *matches) + return; + + match = of_match_node(matches, root); +- of_node_put(root); + + if (match) { + void (*fixup)(struct device_node *) = match->data; +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 582d8f0c6266..958af3b1af7f 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -707,6 +707,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ + {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ + {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ ++ {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ + {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ + {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ + {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c +index 7b0ca1551d7b..005ea632ba53 100644 +--- a/drivers/parisc/dino.c ++++ b/drivers/parisc/dino.c +@@ -954,7 +954,7 @@ static int __init dino_probe(struct parisc_device *dev) + + dino_dev->hba.dev = dev; + dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096); +- dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ ++ dino_dev->hba.lmmio_space_offset = PCI_F_EXTEND; + spin_lock_init(&dino_dev->dinosaur_pen); + dino_dev->hba.iommu = ccio_get_iommu(dev); + +diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c +index 2776cfe64c09..ef9cf4a21afe 100644 +--- a/drivers/usb/core/usb-acpi.c ++++ b/drivers/usb/core/usb-acpi.c +@@ -127,6 +127,22 @@ out: + */ + #define USB_ACPI_LOCATION_VALID (1 << 31) + ++static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent, ++ int raw) ++{ ++ struct acpi_device *adev; ++ ++ if (!parent) ++ return NULL; ++ ++ list_for_each_entry(adev, &parent->children, node) { ++ if (acpi_device_adr(adev) == raw) ++ return adev; ++ } ++ ++ return acpi_find_child_device(parent, raw, false); ++} ++ + static struct acpi_device *usb_acpi_find_companion(struct device *dev) + { + struct usb_device *udev; +@@ -174,8 +190,10 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + int raw; + + raw = usb_hcd_find_raw_port_number(hcd, port1); +- adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev), +- raw, false); ++ ++ adev = usb_acpi_find_port(ACPI_COMPANION(&udev->dev), ++ raw); ++ + if (!adev) + return NULL; + } else { +@@ -186,7 +204,9 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + return NULL; + + acpi_bus_get_device(parent_handle, &adev); +- adev = acpi_find_child_device(adev, port1, false); ++ ++ adev = usb_acpi_find_port(adev, port1); ++ + if (!adev) + return NULL; + } +diff --git a/drivers/xen/biomerge.c b/drivers/xen/biomerge.c +index 4da69dbf7dca..1bdd02a6d6ac 100644 +--- a/drivers/xen/biomerge.c ++++ b/drivers/xen/biomerge.c +@@ -10,8 +10,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, + unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); + unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); + +- return __BIOVEC_PHYS_MERGEABLE(vec1, vec2) && +- ((bfn1 == bfn2) || ((bfn1+1) == bfn2)); ++ return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; + #else + /* + * XXX: Add support for merging bio_vec when using different page +diff --git a/include/linux/pid.h b/include/linux/pid.h +index 23705a53abba..97b745ddece5 100644 +--- a/include/linux/pid.h ++++ b/include/linux/pid.h +@@ -8,7 +8,9 @@ enum pid_type + PIDTYPE_PID, + PIDTYPE_PGID, + PIDTYPE_SID, +- PIDTYPE_MAX ++ PIDTYPE_MAX, ++ /* only valid to __task_pid_nr_ns() */ ++ __PIDTYPE_TGID + }; + + /* +diff --git a/include/linux/sched.h b/include/linux/sched.h +index eff7c1fad26f..e887c8d6f395 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -1949,31 +1949,8 @@ static inline pid_t task_tgid_nr(struct task_struct *tsk) + return tsk->tgid; + } + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); +- +-static inline pid_t task_tgid_vnr(struct task_struct *tsk) +-{ +- return pid_vnr(task_tgid(tsk)); +-} +- + + static inline int pid_alive(const struct task_struct *p); +-static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) +-{ +- pid_t pid = 0; +- +- rcu_read_lock(); +- if (pid_alive(tsk)) +- pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); +- rcu_read_unlock(); +- +- return pid; +-} +- +-static inline pid_t task_ppid_nr(const struct task_struct *tsk) +-{ +- return task_ppid_nr_ns(tsk, &init_pid_ns); +-} + + static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, + struct pid_namespace *ns) +@@ -1998,6 +1975,33 @@ static inline pid_t task_session_vnr(struct task_struct *tsk) + return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); + } + ++static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns); ++} ++ ++static inline pid_t task_tgid_vnr(struct task_struct *tsk) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL); ++} ++ ++static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ pid_t pid = 0; ++ ++ rcu_read_lock(); ++ if (pid_alive(tsk)) ++ pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); ++ rcu_read_unlock(); ++ ++ return pid; ++} ++ ++static inline pid_t task_ppid_nr(const struct task_struct *tsk) ++{ ++ return task_ppid_nr_ns(tsk, &init_pid_ns); ++} ++ + /* obsolete, do not use */ + static inline pid_t task_pgrp_nr(struct task_struct *tsk) + { +diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c +index 939945a5649c..a162661c9d60 100644 +--- a/kernel/audit_watch.c ++++ b/kernel/audit_watch.c +@@ -457,13 +457,15 @@ void audit_remove_watch_rule(struct audit_krule *krule) + list_del(&krule->rlist); + + if (list_empty(&watch->rules)) { ++ /* ++ * audit_remove_watch() drops our reference to 'parent' which ++ * can get freed. Grab our own reference to be safe. ++ */ ++ audit_get_parent(parent); + audit_remove_watch(watch); +- +- if (list_empty(&parent->watches)) { +- audit_get_parent(parent); ++ if (list_empty(&parent->watches)) + fsnotify_destroy_mark(&parent->mark, audit_watch_group); +- audit_put_parent(parent); +- } ++ audit_put_parent(parent); + } + } + +diff --git a/kernel/pid.c b/kernel/pid.c +index 78b3d9f80d44..b17263be9082 100644 +--- a/kernel/pid.c ++++ b/kernel/pid.c +@@ -526,8 +526,11 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + if (!ns) + ns = task_active_pid_ns(current); + if (likely(pid_alive(task))) { +- if (type != PIDTYPE_PID) ++ if (type != PIDTYPE_PID) { ++ if (type == __PIDTYPE_TGID) ++ type = PIDTYPE_PID; + task = task->group_leader; ++ } + nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); + } + rcu_read_unlock(); +@@ -536,12 +539,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + } + EXPORT_SYMBOL(__task_pid_nr_ns); + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) +-{ +- return pid_nr_ns(task_tgid(tsk), ns); +-} +-EXPORT_SYMBOL(task_tgid_nr_ns); +- + struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) + { + return ns_of_pid(task_pid(tsk)); +diff --git a/mm/mempolicy.c b/mm/mempolicy.c +index e09b1a0e2cfe..c947014d128a 100644 +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -894,11 +894,6 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, + *policy |= (pol->flags & MPOL_MODE_FLAGS); + } + +- if (vma) { +- up_read(¤t->mm->mmap_sem); +- vma = NULL; +- } +- + err = 0; + if (nmask) { + if (mpol_store_user_nodemask(pol)) { +diff --git a/mm/migrate.c b/mm/migrate.c +index 72c09dea6526..afedcfab60e2 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1483,7 +1484,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + const int __user *, nodes, + int __user *, status, int, flags) + { +- const struct cred *cred = current_cred(), *tcred; + struct task_struct *task; + struct mm_struct *mm; + int err; +@@ -1507,14 +1507,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + + /* + * Check if this process has the right to modify the specified +- * process. The right exists if the process has administrative +- * capabilities, superuser privileges or the same +- * userid as the target process. ++ * process. Use the regular "ptrace_may_access()" checks. + */ +- tcred = __task_cred(task); +- if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && +- !capable(CAP_SYS_NICE)) { ++ if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { + rcu_read_unlock(); + err = -EPERM; + goto out; +diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c +index 1a9545965c0d..531ca55f1af6 100644 +--- a/net/netfilter/nf_conntrack_extend.c ++++ b/net/netfilter/nf_conntrack_extend.c +@@ -53,7 +53,11 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } ++ + off = ALIGN(sizeof(struct nf_ct_ext), t->align); + len = off + t->len + var_alloc_len; + alloc_size = t->alloc_size + var_alloc_len; +@@ -88,7 +92,10 @@ void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } + + newoff = ALIGN(old->len, t->align); + newlen = newoff + t->len + var_alloc_len; +@@ -186,6 +193,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type) + RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL); + update_alloc_size(type); + mutex_unlock(&nf_ct_ext_type_mutex); +- rcu_barrier(); /* Wait for completion of call_rcu()'s */ ++ synchronize_rcu(); + } + EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c +index c67f9c212dd1..e326c1d80416 100644 +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -1530,19 +1530,14 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + void __user *arg) + { + struct snd_seq_queue_info info; +- int result; + struct snd_seq_queue *q; + + if (copy_from_user(&info, arg, sizeof(info))) + return -EFAULT; + +- result = snd_seq_queue_alloc(client->number, info.locked, info.flags); +- if (result < 0) +- return result; +- +- q = queueptr(result); +- if (q == NULL) +- return -EINVAL; ++ q = snd_seq_queue_alloc(client->number, info.locked, info.flags); ++ if (IS_ERR(q)) ++ return PTR_ERR(q); + + info.queue = q->queue; + info.locked = q->locked; +@@ -1552,7 +1547,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + if (! info.name[0]) + snprintf(info.name, sizeof(info.name), "Queue-%d", q->queue); + strlcpy(q->name, info.name, sizeof(q->name)); +- queuefree(q); ++ snd_use_lock_free(&q->use_lock); + + if (copy_to_user(arg, &info, sizeof(info))) + return -EFAULT; +diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c +index 450c5187eecb..79e0c5604ef8 100644 +--- a/sound/core/seq/seq_queue.c ++++ b/sound/core/seq/seq_queue.c +@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) + static void queue_use(struct snd_seq_queue *queue, int client, int use); + + /* allocate a new queue - +- * return queue index value or negative value for error ++ * return pointer to new queue or ERR_PTR(-errno) for error ++ * The new queue's use_lock is set to 1. It is the caller's responsibility to ++ * call snd_use_lock_free(&q->use_lock). + */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) + { + struct snd_seq_queue *q; + + q = queue_new(client, locked); + if (q == NULL) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + q->info_flags = info_flags; + queue_use(q, client, 1); ++ snd_use_lock_use(&q->use_lock); + if (queue_list_add(q) < 0) { ++ snd_use_lock_free(&q->use_lock); + queue_delete(q); +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + } +- return q->queue; ++ return q; + } + + /* delete a queue - queue must be owned by the client */ +diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h +index 30c8111477f6..719093489a2c 100644 +--- a/sound/core/seq/seq_queue.h ++++ b/sound/core/seq/seq_queue.h +@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); + + + /* create new queue (constructor) */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int flags); ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags); + + /* delete queue (destructor) */ + int snd_seq_queue_delete(int client, int queueid); +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c +index 499b03c8281d..696de5ac69be 100644 +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -541,6 +541,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, + + if (size < sizeof(scale)) + return -ENOMEM; ++ if (cval->min_mute) ++ scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE; + scale[2] = cval->dBmin; + scale[3] = cval->dBmax; + if (copy_to_user(_tlv, scale, sizeof(scale))) +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h +index 3417ef347e40..2b4b067646ab 100644 +--- a/sound/usb/mixer.h ++++ b/sound/usb/mixer.h +@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { + int cached; + int cache_val[MAX_CHANNELS]; + u8 initialized; ++ u8 min_mute; + void *private_data; + }; + +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c +index 04991b009132..5d2fc5f58bfe 100644 +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1873,6 +1873,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, + if (unitid == 7 && cval->control == UAC_FU_VOLUME) + snd_dragonfly_quirk_db_scale(mixer, cval, kctl); + break; ++ /* lowest playback value is muted on C-Media devices */ ++ case USB_ID(0x0d8c, 0x000c): ++ case USB_ID(0x0d8c, 0x0014): ++ if (strstr(kctl->id.name, "Playback")) ++ cval->min_mute = 1; ++ break; + } + } + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 29f38e2b4ca9..1cc20d138dae 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1143,6 +1143,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ + case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ ++ case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ + case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ + case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ + case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ diff --git a/patch/kernel/udoo-next/03-patch-4.4.82-83.patch b/patch/kernel/udoo-next/03-patch-4.4.82-83.patch new file mode 100644 index 000000000..104c0c331 --- /dev/null +++ b/patch/kernel/udoo-next/03-patch-4.4.82-83.patch @@ -0,0 +1,476 @@ +diff --git a/Makefile b/Makefile +index 52f2dd8dcebd..7f67b35caf99 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 82 ++SUBLEVEL = 83 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c +index fa24d5196615..c7122919a8c0 100644 +--- a/drivers/iio/accel/bmc150-accel-core.c ++++ b/drivers/iio/accel/bmc150-accel-core.c +@@ -194,7 +194,6 @@ struct bmc150_accel_data { + struct device *dev; + int irq; + struct bmc150_accel_interrupt interrupts[BMC150_ACCEL_INTERRUPTS]; +- atomic_t active_intr; + struct bmc150_accel_trigger triggers[BMC150_ACCEL_TRIGGERS]; + struct mutex mutex; + u8 fifo_mode, watermark; +@@ -489,11 +488,6 @@ static int bmc150_accel_set_interrupt(struct bmc150_accel_data *data, int i, + goto out_fix_power_state; + } + +- if (state) +- atomic_inc(&data->active_intr); +- else +- atomic_dec(&data->active_intr); +- + return 0; + + out_fix_power_state: +@@ -1704,8 +1698,7 @@ static int bmc150_accel_resume(struct device *dev) + struct bmc150_accel_data *data = iio_priv(indio_dev); + + mutex_lock(&data->mutex); +- if (atomic_read(&data->active_intr)) +- bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); ++ bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_NORMAL, 0); + bmc150_accel_fifo_set_mode(data); + mutex_unlock(&data->mutex); + +diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c +index b10f629cc44b..1dbc2143cdfc 100644 +--- a/drivers/iio/adc/vf610_adc.c ++++ b/drivers/iio/adc/vf610_adc.c +@@ -77,7 +77,7 @@ + #define VF610_ADC_ADSTS_MASK 0x300 + #define VF610_ADC_ADLPC_EN 0x80 + #define VF610_ADC_ADHSC_EN 0x400 +-#define VF610_ADC_REFSEL_VALT 0x100 ++#define VF610_ADC_REFSEL_VALT 0x800 + #define VF610_ADC_REFSEL_VBG 0x1000 + #define VF610_ADC_ADTRG_HARD 0x2000 + #define VF610_ADC_AVGS_8 0x4000 +diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c +index 12731d6b89ec..ec1b2e798cc1 100644 +--- a/drivers/iio/light/tsl2563.c ++++ b/drivers/iio/light/tsl2563.c +@@ -626,7 +626,7 @@ static irqreturn_t tsl2563_event_handler(int irq, void *private) + struct tsl2563_chip *chip = iio_priv(dev_info); + + iio_push_event(dev_info, +- IIO_UNMOD_EVENT_CODE(IIO_LIGHT, ++ IIO_UNMOD_EVENT_CODE(IIO_INTENSITY, + 0, + IIO_EV_TYPE_THRESH, + IIO_EV_DIR_EITHER), +diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c +index 71ccf6a90b22..2551e4adb33f 100644 +--- a/drivers/pinctrl/samsung/pinctrl-exynos.c ++++ b/drivers/pinctrl/samsung/pinctrl-exynos.c +@@ -194,8 +194,6 @@ static int exynos_irq_request_resources(struct irq_data *irqd) + + spin_unlock_irqrestore(&bank->slock, flags); + +- exynos_irq_unmask(irqd); +- + return 0; + } + +@@ -216,8 +214,6 @@ static void exynos_irq_release_resources(struct irq_data *irqd) + shift = irqd->hwirq * bank_type->fld_width[PINCFG_TYPE_FUNC]; + mask = (1 << bank_type->fld_width[PINCFG_TYPE_FUNC]) - 1; + +- exynos_irq_mask(irqd); +- + spin_lock_irqsave(&bank->slock, flags); + + con = readl(d->virt_base + reg_con); +diff --git a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +index 862a096c5dba..be5c71df148d 100644 +--- a/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c ++++ b/drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +@@ -811,6 +811,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = { + SUNXI_FUNCTION(0x2, "lcd1"), /* D16 */ + SUNXI_FUNCTION(0x3, "pata"), /* ATAD12 */ + SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */ ++ SUNXI_FUNCTION(0x5, "sim"), /* DET */ + SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */ + SUNXI_FUNCTION(0x7, "csi1")), /* D16 */ + SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17), +diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c +index d97aa2827412..8eb7179da342 100644 +--- a/drivers/staging/iio/resolver/ad2s1210.c ++++ b/drivers/staging/iio/resolver/ad2s1210.c +@@ -468,7 +468,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev, + long m) + { + struct ad2s1210_state *st = iio_priv(indio_dev); +- bool negative; ++ u16 negative; + int ret = 0; + u16 pos; + s16 vel; +diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c +index 31d5d9c0e10b..1ff1c83e2df5 100644 +--- a/drivers/target/iscsi/iscsi_target.c ++++ b/drivers/target/iscsi/iscsi_target.c +@@ -418,6 +418,7 @@ int iscsit_reset_np_thread( + return 0; + } + np->np_thread_state = ISCSI_NP_THREAD_RESET; ++ atomic_inc(&np->np_reset_count); + + if (np->np_thread) { + spin_unlock_bh(&np->np_thread_lock); +@@ -1996,6 +1997,7 @@ iscsit_setup_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, + cmd->cmd_sn = be32_to_cpu(hdr->cmdsn); + cmd->exp_stat_sn = be32_to_cpu(hdr->exp_statsn); + cmd->data_direction = DMA_NONE; ++ kfree(cmd->text_in_ptr); + cmd->text_in_ptr = NULL; + + return 0; +diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c +index b19edffa7d98..bc2cbffec27e 100644 +--- a/drivers/target/iscsi/iscsi_target_login.c ++++ b/drivers/target/iscsi/iscsi_target_login.c +@@ -1219,9 +1219,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + flush_signals(current); + + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { + np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; ++ spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); ++ return 1; + } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { + spin_unlock_bh(&np->np_thread_lock); + goto exit; +@@ -1254,7 +1256,8 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) + goto exit; + } else if (rc < 0) { + spin_lock_bh(&np->np_thread_lock); +- if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { ++ if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { ++ np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; + spin_unlock_bh(&np->np_thread_lock); + complete(&np->np_restart_comp); + iscsit_put_transport(conn->conn_transport); +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c +index b403596818db..5c0952995280 100644 +--- a/drivers/usb/core/hcd.c ++++ b/drivers/usb/core/hcd.c +@@ -1851,7 +1851,7 @@ void usb_hcd_flush_endpoint(struct usb_device *udev, + /* No more submits can occur */ + spin_lock_irq(&hcd_urb_list_lock); + rescan: +- list_for_each_entry (urb, &ep->urb_list, urb_list) { ++ list_for_each_entry_reverse(urb, &ep->urb_list, urb_list) { + int is_in; + + if (urb->unlinked) +@@ -2448,6 +2448,8 @@ void usb_hc_died (struct usb_hcd *hcd) + } + if (usb_hcd_is_primary_hcd(hcd) && hcd->shared_hcd) { + hcd = hcd->shared_hcd; ++ clear_bit(HCD_FLAG_RH_RUNNING, &hcd->flags); ++ set_bit(HCD_FLAG_DEAD, &hcd->flags); + if (hcd->rh_registered) { + clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 1d59d489a1ad..cdf4be3939f5 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4661,7 +4661,8 @@ hub_power_remaining(struct usb_hub *hub) + static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, + u16 portchange) + { +- int status, i; ++ int status = -ENODEV; ++ int i; + unsigned unit_load; + struct usb_device *hdev = hub->hdev; + struct usb_hcd *hcd = bus_to_hcd(hdev->bus); +@@ -4865,9 +4866,10 @@ loop: + + done: + hub_port_disable(hub, port1, 1); +- if (hcd->driver->relinquish_port && !hub->hdev->parent) +- hcd->driver->relinquish_port(hcd, port1); +- ++ if (hcd->driver->relinquish_port && !hub->hdev->parent) { ++ if (status != -ENOTCONN && status != -ENODEV) ++ hcd->driver->relinquish_port(hcd, port1); ++ } + } + + /* Handle physical or logical connection change events. +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c +index 3116edfcdc18..574da2b4529c 100644 +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -150,6 +150,9 @@ static const struct usb_device_id usb_quirk_list[] = { + /* appletouch */ + { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, + ++ /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */ ++ { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM }, ++ + /* Avision AV600U */ + { USB_DEVICE(0x0638, 0x0a13), .driver_info = + USB_QUIRK_STRING_FETCH_255 }, +@@ -249,6 +252,7 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = { + { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME }, + { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME }, ++ { USB_DEVICE(0x03f0, 0x2b4a), .driver_info = USB_QUIRK_RESET_RESUME }, + + /* Logitech Optical Mouse M90/M100 */ + { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME }, +diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c +index f9400564cb72..03b9a372636f 100644 +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -89,6 +89,7 @@ enum amd_chipset_gen { + AMD_CHIPSET_HUDSON2, + AMD_CHIPSET_BOLTON, + AMD_CHIPSET_YANGTZE, ++ AMD_CHIPSET_TAISHAN, + AMD_CHIPSET_UNKNOWN, + }; + +@@ -132,6 +133,11 @@ static int amd_chipset_sb_type_init(struct amd_chipset_info *pinfo) + pinfo->sb_type.gen = AMD_CHIPSET_SB700; + else if (rev >= 0x40 && rev <= 0x4f) + pinfo->sb_type.gen = AMD_CHIPSET_SB800; ++ } ++ pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, ++ 0x145c, NULL); ++ if (pinfo->smbus_dev) { ++ pinfo->sb_type.gen = AMD_CHIPSET_TAISHAN; + } else { + pinfo->smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL); +@@ -251,11 +257,12 @@ int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev) + { + /* Make sure amd chipset type has already been initialized */ + usb_amd_find_chipset_info(); +- if (amd_chipset.sb_type.gen != AMD_CHIPSET_YANGTZE) +- return 0; +- +- dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); +- return 1; ++ if (amd_chipset.sb_type.gen == AMD_CHIPSET_YANGTZE || ++ amd_chipset.sb_type.gen == AMD_CHIPSET_TAISHAN) { ++ dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n"); ++ return 1; ++ } ++ return 0; + } + EXPORT_SYMBOL_GPL(usb_hcd_amd_remote_wakeup_quirk); + +diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c +index 13d5614f37f1..0d843e0f8055 100644 +--- a/drivers/usb/musb/musb_host.c ++++ b/drivers/usb/musb/musb_host.c +@@ -138,6 +138,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep) + "Could not flush host TX%d fifo: csr: %04x\n", + ep->epnum, csr)) + return; ++ mdelay(1); + } + } + +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c +index b0dc6da3d970..41a6513646de 100644 +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -135,6 +135,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */ + { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ + { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ ++ { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ + { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c +index ebe51f11105d..fe123153b1a5 100644 +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2025,6 +2025,8 @@ static const struct usb_device_id option_ids[] = { + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d04, 0xff) }, /* D-Link DWM-158 */ + { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */ + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, ++ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */ ++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */ + { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/A3 */ +diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c +index 1db4b61bdf7b..a51b28379850 100644 +--- a/drivers/usb/serial/pl2303.c ++++ b/drivers/usb/serial/pl2303.c +@@ -49,6 +49,7 @@ static const struct usb_device_id id_table[] = { + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, + { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, ++ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_UC485) }, + { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID2) }, + { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) }, + { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, +diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h +index 09d9be88209e..3b5a15d1dc0d 100644 +--- a/drivers/usb/serial/pl2303.h ++++ b/drivers/usb/serial/pl2303.h +@@ -27,6 +27,7 @@ + #define ATEN_VENDOR_ID 0x0557 + #define ATEN_VENDOR_ID2 0x0547 + #define ATEN_PRODUCT_ID 0x2008 ++#define ATEN_PRODUCT_UC485 0x2021 + #define ATEN_PRODUCT_ID2 0x2118 + + #define IODATA_VENDOR_ID 0x04bb +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h +index 53341a77d89f..a37ed1e59e99 100644 +--- a/drivers/usb/storage/unusual_uas.h ++++ b/drivers/usb/storage/unusual_uas.h +@@ -123,9 +123,9 @@ UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999, + /* Reported-by: Benjamin Tissoires */ + UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, + "Initio Corporation", +- "", ++ "INIC-3069", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, +- US_FL_NO_ATA_1X), ++ US_FL_NO_ATA_1X | US_FL_IGNORE_RESIDUE), + + /* Reported-by: Tom Arild Naess */ + UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999, +diff --git a/fs/fuse/file.c b/fs/fuse/file.c +index 11538a8be9f0..1a063cbfe503 100644 +--- a/fs/fuse/file.c ++++ b/fs/fuse/file.c +@@ -46,7 +46,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) + { + struct fuse_file *ff; + +- ff = kmalloc(sizeof(struct fuse_file), GFP_KERNEL); ++ ff = kzalloc(sizeof(struct fuse_file), GFP_KERNEL); + if (unlikely(!ff)) + return NULL; + +diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig +index f31fd0dd92c6..b1daeafbea92 100644 +--- a/fs/nfs/Kconfig ++++ b/fs/nfs/Kconfig +@@ -121,6 +121,7 @@ config PNFS_FILE_LAYOUT + config PNFS_BLOCK + tristate + depends on NFS_V4_1 && BLK_DEV_DM ++ depends on 64BIT || LBDAF + default NFS_V4 + + config PNFS_OBJLAYOUT +diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +index e125e55de86d..2603d7589946 100644 +--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c ++++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c +@@ -30,6 +30,7 @@ void nfs4_ff_layout_free_deviceid(struct nfs4_ff_layout_ds *mirror_ds) + { + nfs4_print_deviceid(&mirror_ds->id_node.deviceid); + nfs4_pnfs_ds_put(mirror_ds->ds); ++ kfree(mirror_ds->ds_versions); + kfree_rcu(mirror_ds, id_node.rcu); + } + +diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h +index 85a868ccb493..8397dc235e84 100644 +--- a/include/linux/cpuset.h ++++ b/include/linux/cpuset.h +@@ -16,6 +16,7 @@ + + #ifdef CONFIG_CPUSETS + ++extern struct static_key cpusets_pre_enable_key; + extern struct static_key cpusets_enabled_key; + static inline bool cpusets_enabled(void) + { +@@ -30,12 +31,14 @@ static inline int nr_cpusets(void) + + static inline void cpuset_inc(void) + { ++ static_key_slow_inc(&cpusets_pre_enable_key); + static_key_slow_inc(&cpusets_enabled_key); + } + + static inline void cpuset_dec(void) + { + static_key_slow_dec(&cpusets_enabled_key); ++ static_key_slow_dec(&cpusets_pre_enable_key); + } + + extern int cpuset_init(void); +@@ -104,7 +107,7 @@ extern void cpuset_print_current_mems_allowed(void); + */ + static inline unsigned int read_mems_allowed_begin(void) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_pre_enable_key)) + return 0; + + return read_seqcount_begin(¤t->mems_allowed_seq); +@@ -118,7 +121,7 @@ static inline unsigned int read_mems_allowed_begin(void) + */ + static inline bool read_mems_allowed_retry(unsigned int seq) + { +- if (!cpusets_enabled()) ++ if (!static_key_false(&cpusets_enabled_key)) + return false; + + return read_seqcount_retry(¤t->mems_allowed_seq, seq); +diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h +index fdda45f26f75..22f442ab85f9 100644 +--- a/include/target/iscsi/iscsi_target_core.h ++++ b/include/target/iscsi/iscsi_target_core.h +@@ -784,6 +784,7 @@ struct iscsi_np { + int np_sock_type; + enum np_thread_state_table np_thread_state; + bool enabled; ++ atomic_t np_reset_count; + enum iscsi_timer_flags_table np_login_timer_flags; + u32 np_exports; + enum np_flags_table np_flags; +diff --git a/kernel/cpuset.c b/kernel/cpuset.c +index 3b5e5430f5d0..8ccd66a97c8b 100644 +--- a/kernel/cpuset.c ++++ b/kernel/cpuset.c +@@ -60,6 +60,7 @@ + #include + #include + ++struct static_key cpusets_pre_enable_key __read_mostly = STATIC_KEY_INIT_FALSE; + struct static_key cpusets_enabled_key __read_mostly = STATIC_KEY_INIT_FALSE; + + /* See "Frequency meter" comments, below. */ +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index f9d648fce8cd..53286b2f5b1c 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6804,7 +6804,7 @@ int alloc_contig_range(unsigned long start, unsigned long end, + + /* Make sure the range is really isolated. */ + if (test_pages_isolated(outer_start, end, false)) { +- pr_info("%s: [%lx, %lx) PFNs busy\n", ++ pr_info_ratelimited("%s: [%lx, %lx) PFNs busy\n", + __func__, outer_start, end); + ret = -EBUSY; + goto done; diff --git a/patch/kernel/udoo-next/03-patch-4.4.83-84.patch b/patch/kernel/udoo-next/03-patch-4.4.83-84.patch new file mode 100644 index 000000000..74a42d331 --- /dev/null +++ b/patch/kernel/udoo-next/03-patch-4.4.83-84.patch @@ -0,0 +1,761 @@ +diff --git a/Makefile b/Makefile +index 7f67b35caf99..9d77ac063ec0 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 4 + PATCHLEVEL = 4 +-SUBLEVEL = 83 ++SUBLEVEL = 84 + EXTRAVERSION = + NAME = Blurry Fish Butt + +diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h +index 9e11dbe1cec3..329c127e13dc 100644 +--- a/arch/arm64/include/asm/elf.h ++++ b/arch/arm64/include/asm/elf.h +@@ -121,10 +121,10 @@ typedef struct user_fpsimd_state elf_fpregset_t; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ +-#define ELF_ET_DYN_BASE 0x100000000UL ++#define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) + + /* + * When the program starts, a1 contains a pointer to a function to be +diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +index 1cd792db15ef..1eab79c9ac48 100644 +--- a/arch/x86/crypto/sha1_avx2_x86_64_asm.S ++++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S +@@ -117,11 +117,10 @@ + .set T1, REG_T1 + .endm + +-#define K_BASE %r8 + #define HASH_PTR %r9 ++#define BLOCKS_CTR %r8 + #define BUFFER_PTR %r10 + #define BUFFER_PTR2 %r13 +-#define BUFFER_END %r11 + + #define PRECALC_BUF %r14 + #define WK_BUF %r15 +@@ -205,14 +204,14 @@ + * blended AVX2 and ALU instruction scheduling + * 1 vector iteration per 8 rounds + */ +- vmovdqu ((i * 2) + PRECALC_OFFSET)(BUFFER_PTR), W_TMP ++ vmovdqu (i * 2)(BUFFER_PTR), W_TMP + .elseif ((i & 7) == 1) +- vinsertf128 $1, (((i-1) * 2)+PRECALC_OFFSET)(BUFFER_PTR2),\ ++ vinsertf128 $1, ((i-1) * 2)(BUFFER_PTR2),\ + WY_TMP, WY_TMP + .elseif ((i & 7) == 2) + vpshufb YMM_SHUFB_BSWAP, WY_TMP, WY + .elseif ((i & 7) == 4) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + .elseif ((i & 7) == 7) + vmovdqu WY_TMP, PRECALC_WK(i&~7) + +@@ -255,7 +254,7 @@ + vpxor WY, WY_TMP, WY_TMP + .elseif ((i & 7) == 7) + vpxor WY_TMP2, WY_TMP, WY +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -291,7 +290,7 @@ + vpsrld $30, WY, WY + vpor WY, WY_TMP, WY + .elseif ((i & 7) == 7) +- vpaddd K_XMM(K_BASE), WY, WY_TMP ++ vpaddd K_XMM + K_XMM_AR(%rip), WY, WY_TMP + vmovdqu WY_TMP, PRECALC_WK(i&~7) + + PRECALC_ROTATE_WY +@@ -446,6 +445,16 @@ + + .endm + ++/* Add constant only if (%2 > %3) condition met (uses RTA as temp) ++ * %1 + %2 >= %3 ? %4 : 0 ++ */ ++.macro ADD_IF_GE a, b, c, d ++ mov \a, RTA ++ add $\d, RTA ++ cmp $\c, \b ++ cmovge RTA, \a ++.endm ++ + /* + * macro implements 80 rounds of SHA-1, for multiple blocks with s/w pipelining + */ +@@ -463,13 +472,16 @@ + lea (2*4*80+32)(%rsp), WK_BUF + + # Precalc WK for first 2 blocks +- PRECALC_OFFSET = 0 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 2, 64 + .set i, 0 + .rept 160 + PRECALC i + .set i, i + 1 + .endr +- PRECALC_OFFSET = 128 ++ ++ /* Go to next block if needed */ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 3, 128 ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + xchg WK_BUF, PRECALC_BUF + + .align 32 +@@ -479,8 +491,8 @@ _loop: + * we use K_BASE value as a signal of a last block, + * it is set below by: cmovae BUFFER_PTR, K_BASE + */ +- cmp K_BASE, BUFFER_PTR +- jne _begin ++ test BLOCKS_CTR, BLOCKS_CTR ++ jnz _begin + .align 32 + jmp _end + .align 32 +@@ -512,10 +524,10 @@ _loop0: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR /* move to next odd-64-byte block */ +- cmp BUFFER_END, BUFFER_PTR /* is current block the last one? */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ +- ++ /* Update Counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR, BLOCKS_CTR, 4, 128 + /* + * rounds + * 60,62,64,66,68 +@@ -532,8 +544,8 @@ _loop0: + UPDATE_HASH 12(HASH_PTR), D + UPDATE_HASH 16(HASH_PTR), E + +- cmp K_BASE, BUFFER_PTR /* is current block the last one? */ +- je _loop ++ test BLOCKS_CTR, BLOCKS_CTR ++ jz _loop + + mov TB, B + +@@ -575,10 +587,10 @@ _loop2: + .set j, j+2 + .endr + +- add $(2*64), BUFFER_PTR2 /* move to next even-64-byte block */ +- +- cmp BUFFER_END, BUFFER_PTR2 /* is current block the last one */ +- cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */ ++ /* update counter */ ++ sub $1, BLOCKS_CTR ++ /* Move to the next block only if needed*/ ++ ADD_IF_GE BUFFER_PTR2, BLOCKS_CTR, 4, 128 + + jmp _loop3 + _loop3: +@@ -641,19 +653,12 @@ _loop3: + + avx2_zeroupper + +- lea K_XMM_AR(%rip), K_BASE +- ++ /* Setup initial values */ + mov CTX, HASH_PTR + mov BUF, BUFFER_PTR +- lea 64(BUF), BUFFER_PTR2 +- +- shl $6, CNT /* mul by 64 */ +- add BUF, CNT +- add $64, CNT +- mov CNT, BUFFER_END + +- cmp BUFFER_END, BUFFER_PTR2 +- cmovae K_BASE, BUFFER_PTR2 ++ mov BUF, BUFFER_PTR2 ++ mov CNT, BLOCKS_CTR + + xmm_mov BSWAP_SHUFB_CTL(%rip), YMM_SHUFB_BSWAP + +diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c +index 7de207a11014..dd14616b7739 100644 +--- a/arch/x86/crypto/sha1_ssse3_glue.c ++++ b/arch/x86/crypto/sha1_ssse3_glue.c +@@ -201,7 +201,7 @@ asmlinkage void sha1_transform_avx2(u32 *digest, const char *data, + + static bool avx2_usable(void) + { +- if (false && avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) ++ if (avx_usable() && boot_cpu_has(X86_FEATURE_AVX2) + && boot_cpu_has(X86_FEATURE_BMI1) + && boot_cpu_has(X86_FEATURE_BMI2)) + return true; +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S +index a55697d19824..cc0f2f5da19b 100644 +--- a/arch/x86/entry/entry_64.S ++++ b/arch/x86/entry/entry_64.S +@@ -1190,6 +1190,8 @@ ENTRY(nmi) + * other IST entries. + */ + ++ ASM_CLAC ++ + /* Use %rdx as our temp variable throughout */ + pushq %rdx + +diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h +index 07cf288b692e..bcd3d6199464 100644 +--- a/arch/x86/include/asm/elf.h ++++ b/arch/x86/include/asm/elf.h +@@ -247,11 +247,11 @@ extern int force_personality32; + + /* + * This is the base location for PIE (ET_DYN with INTERP) loads. On +- * 64-bit, this is raised to 4GB to leave the entire 32-bit address ++ * 64-bit, this is above 4GB to leave the entire 32-bit address + * space open for things that want to use the area for 32-bit pointers. + */ + #define ELF_ET_DYN_BASE (mmap_is_ia32() ? 0x000400000UL : \ +- 0x100000000UL) ++ (TASK_SIZE / 3 * 2)) + + /* This yields a mask that user programs can use to figure out what + instruction set this CPU supports. This could be done in user space, +diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +index 8900400230c6..2cdae69d7e0b 100644 +--- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c ++++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c +@@ -153,7 +153,7 @@ static void __intel_pmu_lbr_enable(bool pmi) + */ + if (cpuc->lbr_sel) + lbr_select = cpuc->lbr_sel->config; +- if (!pmi) ++ if (!pmi && cpuc->lbr_sel) + wrmsrl(MSR_LBR_SELECT, lbr_select); + + rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl); +@@ -432,8 +432,10 @@ static void intel_pmu_lbr_read_64(struct cpu_hw_events *cpuc) + int out = 0; + int num = x86_pmu.lbr_nr; + +- if (cpuc->lbr_sel->config & LBR_CALL_STACK) +- num = tos; ++ if (cpuc->lbr_sel) { ++ if (cpuc->lbr_sel->config & LBR_CALL_STACK) ++ num = tos; ++ } + + for (i = 0; i < num; i++) { + unsigned long lbr_idx = (tos - i) & mask; +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c +index da5458dfb1e3..98d4e515587a 100644 +--- a/drivers/input/mouse/elan_i2c_core.c ++++ b/drivers/input/mouse/elan_i2c_core.c +@@ -1235,6 +1235,10 @@ static const struct acpi_device_id elan_acpi_id[] = { + { "ELAN0100", 0 }, + { "ELAN0600", 0 }, + { "ELAN0605", 0 }, ++ { "ELAN0608", 0 }, ++ { "ELAN0605", 0 }, ++ { "ELAN0609", 0 }, ++ { "ELAN060B", 0 }, + { "ELAN1000", 0 }, + { } + }; +diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c +index 37199b9b2cfa..831a195cb806 100644 +--- a/drivers/irqchip/irq-atmel-aic-common.c ++++ b/drivers/irqchip/irq-atmel-aic-common.c +@@ -148,9 +148,9 @@ void __init aic_common_rtc_irq_fixup(struct device_node *root) + struct device_node *np; + void __iomem *regs; + +- np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc"); ++ np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-rtc"); + if (!np) +- np = of_find_compatible_node(root, NULL, ++ np = of_find_compatible_node(NULL, NULL, + "atmel,at91sam9x5-rtc"); + + if (!np) +@@ -202,7 +202,6 @@ void __init aic_common_irq_fixup(const struct of_device_id *matches) + return; + + match = of_match_node(matches, root); +- of_node_put(root); + + if (match) { + void (*fixup)(struct device_node *) = match->data; +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 582d8f0c6266..958af3b1af7f 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -707,6 +707,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */ + {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */ + {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */ ++ {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */ + {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */ + {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */ + {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */ +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c +index 7b0ca1551d7b..005ea632ba53 100644 +--- a/drivers/parisc/dino.c ++++ b/drivers/parisc/dino.c +@@ -954,7 +954,7 @@ static int __init dino_probe(struct parisc_device *dev) + + dino_dev->hba.dev = dev; + dino_dev->hba.base_addr = ioremap_nocache(hpa, 4096); +- dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ ++ dino_dev->hba.lmmio_space_offset = PCI_F_EXTEND; + spin_lock_init(&dino_dev->dinosaur_pen); + dino_dev->hba.iommu = ccio_get_iommu(dev); + +diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c +index 2776cfe64c09..ef9cf4a21afe 100644 +--- a/drivers/usb/core/usb-acpi.c ++++ b/drivers/usb/core/usb-acpi.c +@@ -127,6 +127,22 @@ out: + */ + #define USB_ACPI_LOCATION_VALID (1 << 31) + ++static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent, ++ int raw) ++{ ++ struct acpi_device *adev; ++ ++ if (!parent) ++ return NULL; ++ ++ list_for_each_entry(adev, &parent->children, node) { ++ if (acpi_device_adr(adev) == raw) ++ return adev; ++ } ++ ++ return acpi_find_child_device(parent, raw, false); ++} ++ + static struct acpi_device *usb_acpi_find_companion(struct device *dev) + { + struct usb_device *udev; +@@ -174,8 +190,10 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + int raw; + + raw = usb_hcd_find_raw_port_number(hcd, port1); +- adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev), +- raw, false); ++ ++ adev = usb_acpi_find_port(ACPI_COMPANION(&udev->dev), ++ raw); ++ + if (!adev) + return NULL; + } else { +@@ -186,7 +204,9 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev) + return NULL; + + acpi_bus_get_device(parent_handle, &adev); +- adev = acpi_find_child_device(adev, port1, false); ++ ++ adev = usb_acpi_find_port(adev, port1); ++ + if (!adev) + return NULL; + } +diff --git a/drivers/xen/biomerge.c b/drivers/xen/biomerge.c +index 4da69dbf7dca..1bdd02a6d6ac 100644 +--- a/drivers/xen/biomerge.c ++++ b/drivers/xen/biomerge.c +@@ -10,8 +10,7 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1, + unsigned long bfn1 = pfn_to_bfn(page_to_pfn(vec1->bv_page)); + unsigned long bfn2 = pfn_to_bfn(page_to_pfn(vec2->bv_page)); + +- return __BIOVEC_PHYS_MERGEABLE(vec1, vec2) && +- ((bfn1 == bfn2) || ((bfn1+1) == bfn2)); ++ return bfn1 + PFN_DOWN(vec1->bv_offset + vec1->bv_len) == bfn2; + #else + /* + * XXX: Add support for merging bio_vec when using different page +diff --git a/include/linux/pid.h b/include/linux/pid.h +index 23705a53abba..97b745ddece5 100644 +--- a/include/linux/pid.h ++++ b/include/linux/pid.h +@@ -8,7 +8,9 @@ enum pid_type + PIDTYPE_PID, + PIDTYPE_PGID, + PIDTYPE_SID, +- PIDTYPE_MAX ++ PIDTYPE_MAX, ++ /* only valid to __task_pid_nr_ns() */ ++ __PIDTYPE_TGID + }; + + /* +diff --git a/include/linux/sched.h b/include/linux/sched.h +index eff7c1fad26f..e887c8d6f395 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -1949,31 +1949,8 @@ static inline pid_t task_tgid_nr(struct task_struct *tsk) + return tsk->tgid; + } + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); +- +-static inline pid_t task_tgid_vnr(struct task_struct *tsk) +-{ +- return pid_vnr(task_tgid(tsk)); +-} +- + + static inline int pid_alive(const struct task_struct *p); +-static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) +-{ +- pid_t pid = 0; +- +- rcu_read_lock(); +- if (pid_alive(tsk)) +- pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); +- rcu_read_unlock(); +- +- return pid; +-} +- +-static inline pid_t task_ppid_nr(const struct task_struct *tsk) +-{ +- return task_ppid_nr_ns(tsk, &init_pid_ns); +-} + + static inline pid_t task_pgrp_nr_ns(struct task_struct *tsk, + struct pid_namespace *ns) +@@ -1998,6 +1975,33 @@ static inline pid_t task_session_vnr(struct task_struct *tsk) + return __task_pid_nr_ns(tsk, PIDTYPE_SID, NULL); + } + ++static inline pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, ns); ++} ++ ++static inline pid_t task_tgid_vnr(struct task_struct *tsk) ++{ ++ return __task_pid_nr_ns(tsk, __PIDTYPE_TGID, NULL); ++} ++ ++static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_namespace *ns) ++{ ++ pid_t pid = 0; ++ ++ rcu_read_lock(); ++ if (pid_alive(tsk)) ++ pid = task_tgid_nr_ns(rcu_dereference(tsk->real_parent), ns); ++ rcu_read_unlock(); ++ ++ return pid; ++} ++ ++static inline pid_t task_ppid_nr(const struct task_struct *tsk) ++{ ++ return task_ppid_nr_ns(tsk, &init_pid_ns); ++} ++ + /* obsolete, do not use */ + static inline pid_t task_pgrp_nr(struct task_struct *tsk) + { +diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c +index 939945a5649c..a162661c9d60 100644 +--- a/kernel/audit_watch.c ++++ b/kernel/audit_watch.c +@@ -457,13 +457,15 @@ void audit_remove_watch_rule(struct audit_krule *krule) + list_del(&krule->rlist); + + if (list_empty(&watch->rules)) { ++ /* ++ * audit_remove_watch() drops our reference to 'parent' which ++ * can get freed. Grab our own reference to be safe. ++ */ ++ audit_get_parent(parent); + audit_remove_watch(watch); +- +- if (list_empty(&parent->watches)) { +- audit_get_parent(parent); ++ if (list_empty(&parent->watches)) + fsnotify_destroy_mark(&parent->mark, audit_watch_group); +- audit_put_parent(parent); +- } ++ audit_put_parent(parent); + } + } + +diff --git a/kernel/pid.c b/kernel/pid.c +index 78b3d9f80d44..b17263be9082 100644 +--- a/kernel/pid.c ++++ b/kernel/pid.c +@@ -526,8 +526,11 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + if (!ns) + ns = task_active_pid_ns(current); + if (likely(pid_alive(task))) { +- if (type != PIDTYPE_PID) ++ if (type != PIDTYPE_PID) { ++ if (type == __PIDTYPE_TGID) ++ type = PIDTYPE_PID; + task = task->group_leader; ++ } + nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); + } + rcu_read_unlock(); +@@ -536,12 +539,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, + } + EXPORT_SYMBOL(__task_pid_nr_ns); + +-pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns) +-{ +- return pid_nr_ns(task_tgid(tsk), ns); +-} +-EXPORT_SYMBOL(task_tgid_nr_ns); +- + struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) + { + return ns_of_pid(task_pid(tsk)); +diff --git a/mm/mempolicy.c b/mm/mempolicy.c +index e09b1a0e2cfe..c947014d128a 100644 +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -894,11 +894,6 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, + *policy |= (pol->flags & MPOL_MODE_FLAGS); + } + +- if (vma) { +- up_read(¤t->mm->mmap_sem); +- vma = NULL; +- } +- + err = 0; + if (nmask) { + if (mpol_store_user_nodemask(pol)) { +diff --git a/mm/migrate.c b/mm/migrate.c +index 72c09dea6526..afedcfab60e2 100644 +--- a/mm/migrate.c ++++ b/mm/migrate.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1483,7 +1484,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + const int __user *, nodes, + int __user *, status, int, flags) + { +- const struct cred *cred = current_cred(), *tcred; + struct task_struct *task; + struct mm_struct *mm; + int err; +@@ -1507,14 +1507,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, + + /* + * Check if this process has the right to modify the specified +- * process. The right exists if the process has administrative +- * capabilities, superuser privileges or the same +- * userid as the target process. ++ * process. Use the regular "ptrace_may_access()" checks. + */ +- tcred = __task_cred(task); +- if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && +- !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && +- !capable(CAP_SYS_NICE)) { ++ if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { + rcu_read_unlock(); + err = -EPERM; + goto out; +diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c +index 1a9545965c0d..531ca55f1af6 100644 +--- a/net/netfilter/nf_conntrack_extend.c ++++ b/net/netfilter/nf_conntrack_extend.c +@@ -53,7 +53,11 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } ++ + off = ALIGN(sizeof(struct nf_ct_ext), t->align); + len = off + t->len + var_alloc_len; + alloc_size = t->alloc_size + var_alloc_len; +@@ -88,7 +92,10 @@ void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, + + rcu_read_lock(); + t = rcu_dereference(nf_ct_ext_types[id]); +- BUG_ON(t == NULL); ++ if (!t) { ++ rcu_read_unlock(); ++ return NULL; ++ } + + newoff = ALIGN(old->len, t->align); + newlen = newoff + t->len + var_alloc_len; +@@ -186,6 +193,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type) + RCU_INIT_POINTER(nf_ct_ext_types[type->id], NULL); + update_alloc_size(type); + mutex_unlock(&nf_ct_ext_type_mutex); +- rcu_barrier(); /* Wait for completion of call_rcu()'s */ ++ synchronize_rcu(); + } + EXPORT_SYMBOL_GPL(nf_ct_extend_unregister); +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c +index c67f9c212dd1..e326c1d80416 100644 +--- a/sound/core/seq/seq_clientmgr.c ++++ b/sound/core/seq/seq_clientmgr.c +@@ -1530,19 +1530,14 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + void __user *arg) + { + struct snd_seq_queue_info info; +- int result; + struct snd_seq_queue *q; + + if (copy_from_user(&info, arg, sizeof(info))) + return -EFAULT; + +- result = snd_seq_queue_alloc(client->number, info.locked, info.flags); +- if (result < 0) +- return result; +- +- q = queueptr(result); +- if (q == NULL) +- return -EINVAL; ++ q = snd_seq_queue_alloc(client->number, info.locked, info.flags); ++ if (IS_ERR(q)) ++ return PTR_ERR(q); + + info.queue = q->queue; + info.locked = q->locked; +@@ -1552,7 +1547,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, + if (! info.name[0]) + snprintf(info.name, sizeof(info.name), "Queue-%d", q->queue); + strlcpy(q->name, info.name, sizeof(q->name)); +- queuefree(q); ++ snd_use_lock_free(&q->use_lock); + + if (copy_to_user(arg, &info, sizeof(info))) + return -EFAULT; +diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c +index 450c5187eecb..79e0c5604ef8 100644 +--- a/sound/core/seq/seq_queue.c ++++ b/sound/core/seq/seq_queue.c +@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) + static void queue_use(struct snd_seq_queue *queue, int client, int use); + + /* allocate a new queue - +- * return queue index value or negative value for error ++ * return pointer to new queue or ERR_PTR(-errno) for error ++ * The new queue's use_lock is set to 1. It is the caller's responsibility to ++ * call snd_use_lock_free(&q->use_lock). + */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) + { + struct snd_seq_queue *q; + + q = queue_new(client, locked); + if (q == NULL) +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + q->info_flags = info_flags; + queue_use(q, client, 1); ++ snd_use_lock_use(&q->use_lock); + if (queue_list_add(q) < 0) { ++ snd_use_lock_free(&q->use_lock); + queue_delete(q); +- return -ENOMEM; ++ return ERR_PTR(-ENOMEM); + } +- return q->queue; ++ return q; + } + + /* delete a queue - queue must be owned by the client */ +diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h +index 30c8111477f6..719093489a2c 100644 +--- a/sound/core/seq/seq_queue.h ++++ b/sound/core/seq/seq_queue.h +@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); + + + /* create new queue (constructor) */ +-int snd_seq_queue_alloc(int client, int locked, unsigned int flags); ++struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags); + + /* delete queue (destructor) */ + int snd_seq_queue_delete(int client, int queueid); +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c +index 499b03c8281d..696de5ac69be 100644 +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -541,6 +541,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, + + if (size < sizeof(scale)) + return -ENOMEM; ++ if (cval->min_mute) ++ scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE; + scale[2] = cval->dBmin; + scale[3] = cval->dBmax; + if (copy_to_user(_tlv, scale, sizeof(scale))) +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h +index 3417ef347e40..2b4b067646ab 100644 +--- a/sound/usb/mixer.h ++++ b/sound/usb/mixer.h +@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { + int cached; + int cache_val[MAX_CHANNELS]; + u8 initialized; ++ u8 min_mute; + void *private_data; + }; + +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c +index 04991b009132..5d2fc5f58bfe 100644 +--- a/sound/usb/mixer_quirks.c ++++ b/sound/usb/mixer_quirks.c +@@ -1873,6 +1873,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, + if (unitid == 7 && cval->control == UAC_FU_VOLUME) + snd_dragonfly_quirk_db_scale(mixer, cval, kctl); + break; ++ /* lowest playback value is muted on C-Media devices */ ++ case USB_ID(0x0d8c, 0x000c): ++ case USB_ID(0x0d8c, 0x0014): ++ if (strstr(kctl->id.name, "Playback")) ++ cval->min_mute = 1; ++ break; + } + } + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 29f38e2b4ca9..1cc20d138dae 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1143,6 +1143,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) + case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ + case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ + case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ ++ case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ + case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ + case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ + case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */