Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…git/stable/linux into 12.0

This is the 4.19.235 stable release
  • Loading branch information
raystef66 committed Mar 19, 2022
2 parents 8e3d379 + 6b48167 commit 7c45896
Show file tree
Hide file tree
Showing 27 changed files with 157 additions and 69 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 = 4
PATCHLEVEL = 19
SUBLEVEL = 234
SUBLEVEL = 235
EXTRAVERSION =
NAME = "People's Front"

Expand Down
6 changes: 6 additions & 0 deletions arch/arm/include/asm/spectre.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ enum {
SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8),
};

#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES
void spectre_v2_update_state(unsigned int state, unsigned int methods);
#else
static inline void spectre_v2_update_state(unsigned int state,
unsigned int methods)
{}
#endif

int spectre_bhb_update_vectors(unsigned int method);

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,9 @@ vector_bhb_loop8_\name:

@ bhb workaround
mov r0, #8
1: b . + 4
3: b . + 4
subs r0, r0, #1
bne 1b
bne 3b
dsb
isb
b 2b
Expand Down
21 changes: 16 additions & 5 deletions arch/riscv/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
#include <asm/pgtable.h>
#include <asm/sections.h>

/*
* The auipc+jalr instruction pair can reach any PC-relative offset
* in the range [-2^31 - 2^11, 2^31 - 2^11)
*/
static bool riscv_insn_valid_32bit_offset(ptrdiff_t val)
{
#ifdef CONFIG_32BIT
return true;
#else
return (-(1L << 31) - (1L << 11)) <= val && val < ((1L << 31) - (1L << 11));
#endif
}

static int apply_r_riscv_32_rela(struct module *me, u32 *location, Elf_Addr v)
{
if (v != (u32)v) {
Expand Down Expand Up @@ -103,7 +116,7 @@ static int apply_r_riscv_pcrel_hi20_rela(struct module *me, u32 *location,
ptrdiff_t offset = (void *)v - (void *)location;
s32 hi20;

if (offset != (s32)offset) {
if (!riscv_insn_valid_32bit_offset(offset)) {
pr_err(
"%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",
me->name, (long long)v, location);
Expand Down Expand Up @@ -205,10 +218,9 @@ static int apply_r_riscv_call_plt_rela(struct module *me, u32 *location,
Elf_Addr v)
{
ptrdiff_t offset = (void *)v - (void *)location;
s32 fill_v = offset;
u32 hi20, lo12;

if (offset != fill_v) {
if (!riscv_insn_valid_32bit_offset(offset)) {
/* Only emit the plt entry if offset over 32-bit range */
if (IS_ENABLED(CONFIG_MODULE_SECTIONS)) {
offset = module_emit_plt_entry(me, v);
Expand All @@ -232,10 +244,9 @@ static int apply_r_riscv_call_rela(struct module *me, u32 *location,
Elf_Addr v)
{
ptrdiff_t offset = (void *)v - (void *)location;
s32 fill_v = offset;
u32 hi20, lo12;

if (offset != fill_v) {
if (!riscv_insn_valid_32bit_offset(offset)) {
pr_err(
"%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n",
me->name, (long long)v, location);
Expand Down
24 changes: 19 additions & 5 deletions drivers/gpio/gpio-ts4900.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Digital I/O driver for Technologic Systems I2C FPGA Core
*
* Copyright (C) 2015 Technologic Systems
* Copyright (C) 2015, 2018 Technologic Systems
* Copyright (C) 2016 Savoir-Faire Linux
*
* This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -52,19 +52,33 @@ static int ts4900_gpio_direction_input(struct gpio_chip *chip,
{
struct ts4900_gpio_priv *priv = gpiochip_get_data(chip);

/*
* This will clear the output enable bit, the other bits are
* dontcare when this is cleared
/* Only clear the OE bit here, requires a RMW. Prevents potential issue
* with OE and data getting to the physical pin at different times.
*/
return regmap_write(priv->regmap, offset, 0);
return regmap_update_bits(priv->regmap, offset, TS4900_GPIO_OE, 0);
}

static int ts4900_gpio_direction_output(struct gpio_chip *chip,
unsigned int offset, int value)
{
struct ts4900_gpio_priv *priv = gpiochip_get_data(chip);
unsigned int reg;
int ret;

/* If changing from an input to an output, we need to first set the
* proper data bit to what is requested and then set OE bit. This
* prevents a glitch that can occur on the IO line
*/
regmap_read(priv->regmap, offset, &reg);
if (!(reg & TS4900_GPIO_OE)) {
if (value)
reg = TS4900_GPIO_OUT;
else
reg &= ~TS4900_GPIO_OUT;

regmap_write(priv->regmap, offset, reg);
}

if (value)
ret = regmap_write(priv->regmap, offset, TS4900_GPIO_OE |
TS4900_GPIO_OUT);
Expand Down
25 changes: 24 additions & 1 deletion drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,14 +1269,37 @@ static int macb_poll(struct napi_struct *napi, int budget)
if (work_done < budget) {
napi_complete_done(napi, work_done);

/* Packets received while interrupts were disabled */
/* RSR bits only seem to propagate to raise interrupts when
* interrupts are enabled at the time, so if bits are already
* set due to packets received while interrupts were disabled,
* they will not cause another interrupt to be generated when
* interrupts are re-enabled.
* Check for this case here. This has been seen to happen
* around 30% of the time under heavy network load.
*/
status = macb_readl(bp, RSR);
if (status) {
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
queue_writel(queue, ISR, MACB_BIT(RCOMP));
napi_reschedule(napi);
} else {
queue_writel(queue, IER, bp->rx_intr_mask);

/* In rare cases, packets could have been received in
* the window between the check above and re-enabling
* interrupts. Therefore, a double-check is required
* to avoid losing a wakeup. This can potentially race
* with the interrupt handler doing the same actions
* if an interrupt is raised just after enabling them,
* but this should be harmless.
*/
status = macb_readl(bp, RSR);
if (unlikely(status)) {
queue_writel(queue, IDR, bp->rx_intr_mask);
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
queue_writel(queue, ISR, MACB_BIT(RCOMP));
napi_schedule(napi);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/freescale/gianfar_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,7 @@ static int gfar_get_ts_info(struct net_device *dev,
ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp");
if (ptp_node) {
ptp_dev = of_find_device_by_node(ptp_node);
of_node_put(ptp_node);
if (ptp_dev)
ptp = platform_get_drvdata(ptp_dev);
}
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ethernet/nxp/lpc_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct netdata_local *pldat;
int ret;

if (device_may_wakeup(&pdev->dev))
disable_irq_wake(ndev->irq);
Expand All @@ -1521,7 +1522,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
pldat = netdev_priv(ndev);

/* Enable interface clock */
clk_enable(pldat->clk);
ret = clk_enable(pldat->clk);
if (ret)
return ret;

/* Reset and initialize */
__lpc_eth_reset(pldat);
Expand Down
18 changes: 11 additions & 7 deletions drivers/net/ethernet/qlogic/qed/qed_sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -3800,19 +3800,19 @@ bool qed_iov_mark_vf_flr(struct qed_hwfn *p_hwfn, u32 *p_disabled_vfs)
return found;
}

static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
u16 vfid,
struct qed_mcp_link_params *p_params,
struct qed_mcp_link_state *p_link,
struct qed_mcp_link_capabilities *p_caps)
static int qed_iov_get_link(struct qed_hwfn *p_hwfn,
u16 vfid,
struct qed_mcp_link_params *p_params,
struct qed_mcp_link_state *p_link,
struct qed_mcp_link_capabilities *p_caps)
{
struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn,
vfid,
false);
struct qed_bulletin_content *p_bulletin;

if (!p_vf)
return;
return -EINVAL;

p_bulletin = p_vf->bulletin.p_virt;

Expand All @@ -3822,6 +3822,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
__qed_vf_get_link_state(p_hwfn, p_link, p_bulletin);
if (p_caps)
__qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin);
return 0;
}

static int
Expand Down Expand Up @@ -4676,6 +4677,7 @@ static int qed_get_vf_config(struct qed_dev *cdev,
struct qed_public_vf_info *vf_info;
struct qed_mcp_link_state link;
u32 tx_rate;
int ret;

/* Sanitize request */
if (IS_VF(cdev))
Expand All @@ -4689,7 +4691,9 @@ static int qed_get_vf_config(struct qed_dev *cdev,

vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true);

qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL);
ret = qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL);
if (ret)
return ret;

/* Fill information about VF */
ivi->vf = vf_id;
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/ethernet/qlogic/qed/qed_vf.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
p_iov->bulletin.size,
&p_iov->bulletin.phys,
GFP_KERNEL);
if (!p_iov->bulletin.p_virt)
goto free_pf2vf_reply;

DP_VERBOSE(p_hwfn, QED_MSG_IOV,
"VF's bulletin Board [%p virt 0x%llx phys 0x%08x bytes]\n",
p_iov->bulletin.p_virt,
Expand Down Expand Up @@ -578,6 +581,10 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)

return rc;

free_pf2vf_reply:
dma_free_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(union pfvf_tlvs),
p_iov->pf2vf_reply, p_iov->pf2vf_reply_phys);
free_vf2pf_request:
dma_free_coherent(&p_hwfn->cdev->pdev->dev,
sizeof(union vfpf_tlvs),
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/ti/cpts.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ int cpts_register(struct cpts *cpts)
for (i = 0; i < CPTS_MAX_EVENTS; i++)
list_add(&cpts->pool_data[i].list, &cpts->pool);

clk_enable(cpts->refclk);
err = clk_enable(cpts->refclk);
if (err)
return err;

cpts_write32(cpts, CPTS_EN, control);
cpts_write32(cpts, TS_PEND_EN, int_enable);
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/xilinx/xilinx_emaclite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,14 +1173,16 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
if (rc) {
dev_err(dev,
"Cannot register network device, aborting\n");
goto error;
goto put_node;
}

dev_info(dev,
"Xilinx EmacLite at 0x%08X mapped to 0x%p, irq=%d\n",
(unsigned int __force)ndev->mem_start, lp->base_addr, ndev->irq);
return 0;

put_node:
of_node_put(lp->phy_node);
error:
free_netdev(ndev);
return rc;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/phy/dp83822.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static int dp83822_config_intr(struct phy_device *phydev)
if (err < 0)
return err;

err = phy_write(phydev, MII_DP83822_MISR1, 0);
err = phy_write(phydev, MII_DP83822_MISR2, 0);
if (err < 0)
return err;

Expand Down
13 changes: 5 additions & 8 deletions drivers/net/xen-netback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ static void backend_disconnect(struct backend_info *be)
unsigned int queue_index;

xen_unregister_watchers(vif);
xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status");
#ifdef CONFIG_DEBUG_FS
xenvif_debugfs_delif(vif);
#endif /* CONFIG_DEBUG_FS */
Expand Down Expand Up @@ -1043,15 +1044,11 @@ static void connect(struct backend_info *be)
xenvif_carrier_on(be->vif);

unregister_hotplug_status_watch(be);
if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) {
err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
NULL, hotplug_status_changed,
"%s/%s", dev->nodename,
"hotplug-status");
if (err)
goto err;
err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
hotplug_status_changed,
"%s/%s", dev->nodename, "hotplug-status");
if (!err)
be->have_hotplug_status_watch = 1;
}

netif_tx_wake_all_queues(be->vif->dev);

Expand Down
2 changes: 2 additions & 0 deletions drivers/nfc/port100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,9 @@ static int port100_probe(struct usb_interface *interface,
nfc_digital_free_device(dev->nfc_digital_dev);

error:
usb_kill_urb(dev->in_urb);
usb_free_urb(dev->in_urb);
usb_kill_urb(dev->out_urb);
usb_free_urb(dev->out_urb);
usb_put_dev(dev->udev);

Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/gdm724x/gdm_lte.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ static void tx_complete(void *arg)

static int gdm_lte_rx(struct sk_buff *skb, struct nic *nic, int nic_type)
{
int ret;
int ret, len;

len = skb->len + ETH_HLEN;
ret = netif_rx_ni(skb);
if (ret == NET_RX_DROP) {
nic->stats.rx_dropped++;
} else {
nic->stats.rx_packets++;
nic->stats.rx_bytes += skb->len + ETH_HLEN;
nic->stats.rx_bytes += len;
}

return 0;
Expand Down
Loading

0 comments on commit 7c45896

Please sign in to comment.