Skip to content

Commit

Permalink
Merge pull request torvalds#155 from zandrey/5.4-2.2.x-imx
Browse files Browse the repository at this point in the history
Update 5.4-2.2.x-imx to v5.4.72 from stable + merge commits from imx_5.4.47_2.2.0
  • Loading branch information
otavio authored Oct 18, 2020
2 parents a307a5e + 04bbcf4 commit 75c84dc
Show file tree
Hide file tree
Showing 27 changed files with 241 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 4
SUBLEVEL = 71
SUBLEVEL = 72
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \
asflags-y := -DZIMAGE

# Supply kernel BSS size to the decompressor via a linker symbol.
KBSS_SZ = $(shell echo $$(($$($(CROSS_COMPILE)nm $(obj)/../../../../vmlinux | \
KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \
sed -n -e 's/^\([^ ]*\) [AB] __bss_start$$/-0x\1/p' \
-e 's/^\([^ ]*\) [AB] __bss_stop$$/+0x\1/p') )) )
LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
Expand Down Expand Up @@ -165,7 +165,7 @@ $(obj)/bswapsdi2.S: $(srctree)/arch/$(SRCARCH)/lib/bswapsdi2.S
# The .data section is already discarded by the linker script so no need
# to bother about it here.
check_for_bad_syms = \
bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
bad_syms=$$($(NM) $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
[ -z "$$bad_syms" ] || \
( echo "following symbols must have non local/private scope:" >&2; \
echo "$$bad_syms" >&2; false )
Expand Down
15 changes: 13 additions & 2 deletions arch/arm/mach-imx/pm-imx7ulp.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@

#define ADDR_1M_MASK 0xFFF00000

#define WDOG_CS 0x0
#define WDOG_CS_CMD32EN BIT(13)
#define WDOG_CNT 0x4
#define REFRESH_SEQ0 0xA602
#define REFRESH_SEQ1 0xB480
#define REFRESH ((REFRESH_SEQ1 << 16) | REFRESH_SEQ0)

static void __iomem *smc1_base;
static void __iomem *pmc0_base;
static void __iomem *pmc1_base;
Expand Down Expand Up @@ -469,8 +476,12 @@ static void imx7ulp_wdog_refresh(void)
* On revision 2.2, wdog2 is by default disabled when out of
* reset, so here, we ONLY refresh wdog1.
*/
writel_relaxed(0xA602, wdog1_base + 0x4);
writel_relaxed(0xB480, wdog1_base + 0x4);
if (readl_relaxed(wdog1_base + WDOG_CS) & WDOG_CS_CMD32EN) {
writel(REFRESH, wdog1_base + WDOG_CNT);
} else {
writel_relaxed(REFRESH_SEQ0, wdog1_base + WDOG_CNT);
writel_relaxed(REFRESH_SEQ1, wdog1_base + WDOG_CNT);
}
}

static int imx7ulp_pm_enter(suspend_state_t state)
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ acpi-y += acpi_pnp.o
acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
acpi-y += power.o
acpi-y += event.o
acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
acpi-y += evged.o
acpi-y += sysfs.o
acpi-y += property.o
acpi-$(CONFIG_X86) += acpi_cmos_rtc.o
Expand Down
15 changes: 14 additions & 1 deletion drivers/crypto/bcm/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -2937,7 +2937,6 @@ static int aead_gcm_ccm_setkey(struct crypto_aead *cipher,

ctx->enckeylen = keylen;
ctx->authkeylen = 0;
memcpy(ctx->enckey, key, ctx->enckeylen);

switch (ctx->enckeylen) {
case AES_KEYSIZE_128:
Expand All @@ -2953,6 +2952,8 @@ static int aead_gcm_ccm_setkey(struct crypto_aead *cipher,
goto badkey;
}

memcpy(ctx->enckey, key, ctx->enckeylen);

flow_log(" enckeylen:%u authkeylen:%u\n", ctx->enckeylen,
ctx->authkeylen);
flow_dump(" enc: ", ctx->enckey, ctx->enckeylen);
Expand Down Expand Up @@ -3013,6 +3014,10 @@ static int aead_gcm_esp_setkey(struct crypto_aead *cipher,
struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);

flow_log("%s\n", __func__);

if (keylen < GCM_ESP_SALT_SIZE)
return -EINVAL;

ctx->salt_len = GCM_ESP_SALT_SIZE;
ctx->salt_offset = GCM_ESP_SALT_OFFSET;
memcpy(ctx->salt, key + keylen - GCM_ESP_SALT_SIZE, GCM_ESP_SALT_SIZE);
Expand Down Expand Up @@ -3041,6 +3046,10 @@ static int rfc4543_gcm_esp_setkey(struct crypto_aead *cipher,
struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);

flow_log("%s\n", __func__);

if (keylen < GCM_ESP_SALT_SIZE)
return -EINVAL;

ctx->salt_len = GCM_ESP_SALT_SIZE;
ctx->salt_offset = GCM_ESP_SALT_OFFSET;
memcpy(ctx->salt, key + keylen - GCM_ESP_SALT_SIZE, GCM_ESP_SALT_SIZE);
Expand Down Expand Up @@ -3070,6 +3079,10 @@ static int aead_ccm_esp_setkey(struct crypto_aead *cipher,
struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);

flow_log("%s\n", __func__);

if (keylen < CCM_ESP_SALT_SIZE)
return -EINVAL;

ctx->salt_len = CCM_ESP_SALT_SIZE;
ctx->salt_offset = CCM_ESP_SALT_OFFSET;
memcpy(ctx->salt, key + keylen - CCM_ESP_SALT_SIZE, CCM_ESP_SALT_SIZE);
Expand Down
10 changes: 9 additions & 1 deletion drivers/crypto/qat/qat_common/qat_algs.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,11 @@ static int qat_alg_aead_dec(struct aead_request *areq)
struct icp_qat_fw_la_bulk_req *msg;
int digst_size = crypto_aead_authsize(aead_tfm);
int ret, ctr = 0;
u32 cipher_len;

cipher_len = areq->cryptlen - digst_size;
if (cipher_len % AES_BLOCK_SIZE != 0)
return -EINVAL;

ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
if (unlikely(ret))
Expand All @@ -887,7 +892,7 @@ static int qat_alg_aead_dec(struct aead_request *areq)
qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
cipher_param->cipher_length = areq->cryptlen - digst_size;
cipher_param->cipher_length = cipher_len;
cipher_param->cipher_offset = areq->assoclen;
memcpy(cipher_param->u.cipher_IV_array, areq->iv, AES_BLOCK_SIZE);
auth_param = (void *)((uint8_t *)cipher_param + sizeof(*cipher_param));
Expand Down Expand Up @@ -916,6 +921,9 @@ static int qat_alg_aead_enc(struct aead_request *areq)
uint8_t *iv = areq->iv;
int ret, ctr = 0;

if (areq->cryptlen % AES_BLOCK_SIZE != 0)
return -EINVAL;

ret = qat_alg_sgl_to_bufl(ctx->inst, areq->src, areq->dst, qat_req);
if (unlikely(ret))
return ret;
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/usb/usbtv/usbtv-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ static int usbtv_probe(struct usb_interface *intf,

usbtv_audio_fail:
/* we must not free at this point */
usb_get_dev(usbtv->udev);
v4l2_device_get(&usbtv->v4l2_dev);
/* this will undo the v4l2_device_get() */
usbtv_video_free(usbtv);

usbtv_video_fail:
Expand Down
3 changes: 3 additions & 0 deletions drivers/staging/comedi/drivers/vmk80xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,9 @@ static int vmk80xx_find_usb_endpoints(struct comedi_device *dev)
if (!devpriv->ep_rx || !devpriv->ep_tx)
return -ENODEV;

if (!usb_endpoint_maxp(devpriv->ep_rx) || !usb_endpoint_maxp(devpriv->ep_tx))
return -EINVAL;

return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,11 @@ static const struct usb_device_id id_table_combined[] = {
/* U-Blox devices */
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
{ USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
/* FreeCalypso USB adapters */
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID),
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ } /* Terminating entry */
};

Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/serial/ftdi_sio_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@

#define FTDI_LUMEL_PD12_PID 0x6002

/*
* Custom USB adapters made by Falconia Partners LLC
* for FreeCalypso project, ID codes allocated to Falconia by FTDI.
*/
#define FTDI_FALCONIA_JTAG_BUF_PID 0x7150
#define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151

/* Sienna Serial Interface by Secyourit GmbH */
#define FTDI_SIENNA_PID 0x8348

Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ static void option_instat_callback(struct urb *urb);
/* Cellient products */
#define CELLIENT_VENDOR_ID 0x2692
#define CELLIENT_PRODUCT_MEN200 0x9005
#define CELLIENT_PRODUCT_MPL200 0x9025

/* Hyundai Petatel Inc. products */
#define PETATEL_VENDOR_ID 0x1ff4
Expand Down Expand Up @@ -1186,6 +1187,8 @@ static const struct usb_device_id option_ids[] = {
.driver_info = NCTRL(2) | RSVD(3) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */
.driver_info = NCTRL(0) | RSVD(1) },
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */
.driver_info = NCTRL(2) | RSVD(3) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
Expand Down Expand Up @@ -1982,6 +1985,8 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
.driver_info = RSVD(1) | RSVD(4) },
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LD381GC_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) },
{ USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/pl2303.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@

/* Hewlett-Packard POS Pole Displays */
#define HP_VENDOR_ID 0x03f0
#define HP_LD381GC_PRODUCT_ID 0x0183
#define HP_LM920_PRODUCT_ID 0x026b
#define HP_TD620_PRODUCT_ID 0x0956
#define HP_LD960_PRODUCT_ID 0x0b39
Expand Down
29 changes: 21 additions & 8 deletions drivers/xen/events/events_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ static bool (*pirq_needs_eoi)(unsigned irq);
/* Xen will never allocate port zero for any purpose. */
#define VALID_EVTCHN(chn) ((chn) != 0)

static struct irq_info *legacy_info_ptrs[NR_IRQS_LEGACY];

static struct irq_chip xen_dynamic_chip;
static struct irq_chip xen_percpu_chip;
static struct irq_chip xen_pirq_chip;
Expand Down Expand Up @@ -155,7 +157,18 @@ int get_evtchn_to_irq(unsigned evtchn)
/* Get info for IRQ */
struct irq_info *info_for_irq(unsigned irq)
{
return irq_get_chip_data(irq);
if (irq < nr_legacy_irqs())
return legacy_info_ptrs[irq];
else
return irq_get_chip_data(irq);
}

static void set_info_for_irq(unsigned int irq, struct irq_info *info)
{
if (irq < nr_legacy_irqs())
legacy_info_ptrs[irq] = info;
else
irq_set_chip_data(irq, info);
}

/* Constructors for packed IRQ information. */
Expand Down Expand Up @@ -376,7 +389,7 @@ static void xen_irq_init(unsigned irq)
info->type = IRQT_UNBOUND;
info->refcnt = -1;

irq_set_chip_data(irq, info);
set_info_for_irq(irq, info);

list_add_tail(&info->list, &xen_irq_list_head);
}
Expand Down Expand Up @@ -425,14 +438,14 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi)

static void xen_free_irq(unsigned irq)
{
struct irq_info *info = irq_get_chip_data(irq);
struct irq_info *info = info_for_irq(irq);

if (WARN_ON(!info))
return;

list_del(&info->list);

irq_set_chip_data(irq, NULL);
set_info_for_irq(irq, NULL);

WARN_ON(info->refcnt > 0);

Expand Down Expand Up @@ -602,7 +615,7 @@ EXPORT_SYMBOL_GPL(xen_irq_from_gsi);
static void __unbind_from_irq(unsigned int irq)
{
int evtchn = evtchn_from_irq(irq);
struct irq_info *info = irq_get_chip_data(irq);
struct irq_info *info = info_for_irq(irq);

if (info->refcnt > 0) {
info->refcnt--;
Expand Down Expand Up @@ -1106,7 +1119,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,

void unbind_from_irqhandler(unsigned int irq, void *dev_id)
{
struct irq_info *info = irq_get_chip_data(irq);
struct irq_info *info = info_for_irq(irq);

if (WARN_ON(!info))
return;
Expand Down Expand Up @@ -1140,7 +1153,7 @@ int evtchn_make_refcounted(unsigned int evtchn)
if (irq == -1)
return -ENOENT;

info = irq_get_chip_data(irq);
info = info_for_irq(irq);

if (!info)
return -ENOENT;
Expand Down Expand Up @@ -1168,7 +1181,7 @@ int evtchn_get(unsigned int evtchn)
if (irq == -1)
goto done;

info = irq_get_chip_data(irq);
info = info_for_irq(irq);

if (!info)
goto done;
Expand Down
38 changes: 26 additions & 12 deletions fs/btrfs/block-group.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,6 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)
{
struct btrfs_space_info *sinfo = cache->space_info;
u64 num_bytes;
u64 sinfo_used;
u64 min_allocable_bytes;
int ret = -ENOSPC;

Expand All @@ -1213,20 +1212,38 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)

num_bytes = cache->key.offset - cache->reserved - cache->pinned -
cache->bytes_super - btrfs_block_group_used(&cache->item);
sinfo_used = btrfs_space_info_used(sinfo, true);

/*
* sinfo_used + num_bytes should always <= sinfo->total_bytes.
*
* Here we make sure if we mark this bg RO, we still have enough
* free space as buffer (if min_allocable_bytes is not 0).
* Data never overcommits, even in mixed mode, so do just the straight
* check of left over space in how much we have allocated.
*/
if (sinfo_used + num_bytes + min_allocable_bytes <=
sinfo->total_bytes) {
if (force) {
ret = 0;
} else if (sinfo->flags & BTRFS_BLOCK_GROUP_DATA) {
u64 sinfo_used = btrfs_space_info_used(sinfo, true);

/*
* Here we make sure if we mark this bg RO, we still have enough
* free space as buffer.
*/
if (sinfo_used + num_bytes <= sinfo->total_bytes)
ret = 0;
} else {
/*
* We overcommit metadata, so we need to do the
* btrfs_can_overcommit check here, and we need to pass in
* BTRFS_RESERVE_NO_FLUSH to give ourselves the most amount of
* leeway to allow us to mark this block group as read only.
*/
if (btrfs_can_overcommit(cache->fs_info, sinfo, num_bytes,
BTRFS_RESERVE_NO_FLUSH))
ret = 0;
}

if (!ret) {
sinfo->bytes_readonly += num_bytes;
cache->ro++;
list_add_tail(&cache->ro_list, &sinfo->ro_bgs);
ret = 0;
}
out:
spin_unlock(&cache->lock);
Expand All @@ -1235,9 +1252,6 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)
btrfs_info(cache->fs_info,
"unable to make block group %llu ro",
cache->key.objectid);
btrfs_info(cache->fs_info,
"sinfo_used=%llu bg_num_bytes=%llu min_allocable=%llu",
sinfo_used, num_bytes, min_allocable_bytes);
btrfs_dump_space_info(cache->fs_info, cache->space_info, 0, 0);
}
return ret;
Expand Down
Loading

0 comments on commit 75c84dc

Please sign in to comment.