Skip to content

Commit

Permalink
Merge pull request torvalds#152 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.71 from stable
  • Loading branch information
otavio committed Oct 16, 2020
2 parents 97422b4 + 77364c4 commit a307a5e
Show file tree
Hide file tree
Showing 106 changed files with 812 additions and 448 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 = 70
SUBLEVEL = 71
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
};

&qspi {
status = "okay";
flash@0 {
#address-cells = <1>;
#size-cells = <1>;
Expand Down
5 changes: 3 additions & 2 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
drv->bus->name, __func__, drv->name, dev_name(dev));
if (!list_empty(&dev->devres_head)) {
dev_crit(dev, "Resources present before probing\n");
return -EBUSY;
ret = -EBUSY;
goto done;
}

re_probe:
Expand Down Expand Up @@ -639,7 +640,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
ret = 0;
done:
atomic_dec(&probe_count);
wake_up(&probe_waitqueue);
wake_up_all(&probe_waitqueue);
return ret;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)

release_sg:
kfree(ttm->sg);
ttm->sg = NULL;
return r;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/nouveau_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ void
nouveau_mem_del(struct ttm_mem_reg *reg)
{
struct nouveau_mem *mem = nouveau_mem(reg);
if (!mem)
return;
nouveau_mem_fini(mem);
kfree(reg->mm_node);
reg->mm_node = NULL;
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)

pci_set_drvdata(dev, priv);

dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NEVER_SKIP);
pm_runtime_set_autosuspend_delay(&dev->dev, 1000);
pm_runtime_use_autosuspend(&dev->dev);
pm_runtime_put_autosuspend(&dev->dev);
Expand Down
42 changes: 30 additions & 12 deletions drivers/i2c/busses/i2c-meson.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
*/

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/i2c.h>
Expand Down Expand Up @@ -32,12 +33,17 @@
#define REG_CTRL_ACK_IGNORE BIT(1)
#define REG_CTRL_STATUS BIT(2)
#define REG_CTRL_ERROR BIT(3)
#define REG_CTRL_CLKDIV_SHIFT 12
#define REG_CTRL_CLKDIV_MASK GENMASK(21, 12)
#define REG_CTRL_CLKDIVEXT_SHIFT 28
#define REG_CTRL_CLKDIVEXT_MASK GENMASK(29, 28)
#define REG_CTRL_CLKDIV GENMASK(21, 12)
#define REG_CTRL_CLKDIVEXT GENMASK(29, 28)

#define REG_SLV_ADDR GENMASK(7, 0)
#define REG_SLV_SDA_FILTER GENMASK(10, 8)
#define REG_SLV_SCL_FILTER GENMASK(13, 11)
#define REG_SLV_SCL_LOW GENMASK(27, 16)
#define REG_SLV_SCL_LOW_EN BIT(28)

#define I2C_TIMEOUT_MS 500
#define FILTER_DELAY 15

enum {
TOKEN_END = 0,
Expand Down Expand Up @@ -132,19 +138,24 @@ static void meson_i2c_set_clk_div(struct meson_i2c *i2c, unsigned int freq)
unsigned long clk_rate = clk_get_rate(i2c->clk);
unsigned int div;

div = DIV_ROUND_UP(clk_rate, freq * i2c->data->div_factor);
div = DIV_ROUND_UP(clk_rate, freq);
div -= FILTER_DELAY;
div = DIV_ROUND_UP(div, i2c->data->div_factor);

/* clock divider has 12 bits */
if (div >= (1 << 12)) {
if (div > GENMASK(11, 0)) {
dev_err(i2c->dev, "requested bus frequency too low\n");
div = (1 << 12) - 1;
div = GENMASK(11, 0);
}

meson_i2c_set_mask(i2c, REG_CTRL, REG_CTRL_CLKDIV_MASK,
(div & GENMASK(9, 0)) << REG_CTRL_CLKDIV_SHIFT);
meson_i2c_set_mask(i2c, REG_CTRL, REG_CTRL_CLKDIV,
FIELD_PREP(REG_CTRL_CLKDIV, div & GENMASK(9, 0)));

meson_i2c_set_mask(i2c, REG_CTRL, REG_CTRL_CLKDIVEXT,
FIELD_PREP(REG_CTRL_CLKDIVEXT, div >> 10));

meson_i2c_set_mask(i2c, REG_CTRL, REG_CTRL_CLKDIVEXT_MASK,
(div >> 10) << REG_CTRL_CLKDIVEXT_SHIFT);
/* Disable HIGH/LOW mode */
meson_i2c_set_mask(i2c, REG_SLAVE_ADDR, REG_SLV_SCL_LOW_EN, 0);

dev_dbg(i2c->dev, "%s: clk %lu, freq %u, div %u\n", __func__,
clk_rate, freq, div);
Expand Down Expand Up @@ -273,7 +284,10 @@ static void meson_i2c_do_start(struct meson_i2c *i2c, struct i2c_msg *msg)
token = (msg->flags & I2C_M_RD) ? TOKEN_SLAVE_ADDR_READ :
TOKEN_SLAVE_ADDR_WRITE;

writel(msg->addr << 1, i2c->regs + REG_SLAVE_ADDR);

meson_i2c_set_mask(i2c, REG_SLAVE_ADDR, REG_SLV_ADDR,
FIELD_PREP(REG_SLV_ADDR, msg->addr << 1));

meson_i2c_add_token(i2c, TOKEN_START);
meson_i2c_add_token(i2c, token);
}
Expand Down Expand Up @@ -432,6 +446,10 @@ static int meson_i2c_probe(struct platform_device *pdev)
return ret;
}

/* Disable filtering */
meson_i2c_set_mask(i2c, REG_SLAVE_ADDR,
REG_SLV_SDA_FILTER | REG_SLV_SCL_FILTER, 0);

meson_i2c_set_clk_div(i2c, timings.bus_freq_hz);

return 0;
Expand Down
6 changes: 6 additions & 0 deletions drivers/i2c/busses/i2c-owl.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,19 @@ static irqreturn_t owl_i2c_interrupt(int irq, void *_dev)
fifostat = readl(i2c_dev->base + OWL_I2C_REG_FIFOSTAT);
if (fifostat & OWL_I2C_FIFOSTAT_RNB) {
i2c_dev->err = -ENXIO;
/* Clear NACK error bit by writing "1" */
owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_FIFOSTAT,
OWL_I2C_FIFOSTAT_RNB, true);
goto stop;
}

/* Handle bus error */
stat = readl(i2c_dev->base + OWL_I2C_REG_STAT);
if (stat & OWL_I2C_STAT_BEB) {
i2c_dev->err = -EIO;
/* Clear BUS error bit by writing "1" */
owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_STAT,
OWL_I2C_STAT_BEB, true);
goto stop;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/input/misc/ati_remote2.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int ati_remote2_get_channel_mask(char *buffer,
{
pr_debug("%s()\n", __func__);

return sprintf(buffer, "0x%04x", *(unsigned int *)kp->arg);
return sprintf(buffer, "0x%04x\n", *(unsigned int *)kp->arg);
}

static int ati_remote2_set_mode_mask(const char *val,
Expand All @@ -84,7 +84,7 @@ static int ati_remote2_get_mode_mask(char *buffer,
{
pr_debug("%s()\n", __func__);

return sprintf(buffer, "0x%02x", *(unsigned int *)kp->arg);
return sprintf(buffer, "0x%02x\n", *(unsigned int *)kp->arg);
}

static unsigned int channel_mask = ATI_REMOTE2_MAX_CHANNEL_MASK;
Expand Down
4 changes: 2 additions & 2 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,14 +2560,14 @@ static struct dmar_domain *dmar_insert_one_dev_info(struct intel_iommu *iommu,
}

/* Setup the PASID entry for requests without PASID: */
spin_lock(&iommu->lock);
spin_lock_irqsave(&iommu->lock, flags);
if (hw_pass_through && domain_type_is_si(domain))
ret = intel_pasid_setup_pass_through(iommu, domain,
dev, PASID_RID2PASID);
else
ret = intel_pasid_setup_second_level(iommu, domain,
dev, PASID_RID2PASID);
spin_unlock(&iommu->lock);
spin_unlock_irqrestore(&iommu->lock, flags);
if (ret) {
dev_err(dev, "Setup RID2PASID failed\n");
dmar_remove_one_dev_info(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/core/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void mmc_queue_setup_discard(struct request_queue *q,
q->limits.discard_granularity = card->pref_erase << 9;
/* granularity must not be greater than max. discard */
if (card->pref_erase > max_discard)
q->limits.discard_granularity = 0;
q->limits.discard_granularity = SECTOR_SIZE;
if (mmc_can_secure_erase_trim(card))
blk_queue_flag_set(QUEUE_FLAG_SECERASE, q);
}
Expand Down
1 change: 1 addition & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ static void bond_setup_by_slave(struct net_device *bond_dev,

bond_dev->type = slave_dev->type;
bond_dev->hard_header_len = slave_dev->hard_header_len;
bond_dev->needed_headroom = slave_dev->needed_headroom;
bond_dev->addr_len = slave_dev->addr_len;

memcpy(bond_dev->broadcast, slave_dev->broadcast,
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ static int octeon_mgmt_open(struct net_device *netdev)
*/
if (netdev->phydev) {
netif_carrier_off(netdev);
phy_start_aneg(netdev->phydev);
phy_start(netdev->phydev);
}

netif_wake_queue(netdev);
Expand Down Expand Up @@ -1250,8 +1250,10 @@ static int octeon_mgmt_stop(struct net_device *netdev)
napi_disable(&p->napi);
netif_stop_queue(netdev);

if (netdev->phydev)
if (netdev->phydev) {
phy_stop(netdev->phydev);
phy_disconnect(netdev->phydev);
}

netif_carrier_off(netdev);

Expand Down
49 changes: 14 additions & 35 deletions drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3773,19 +3773,17 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return err;
}

#ifdef CONFIG_PM
/**
* iavf_suspend - Power management suspend routine
* @pdev: PCI device information struct
* @state: unused
*
* Called when the system (VM) is entering sleep/suspend.
**/
static int iavf_suspend(struct pci_dev *pdev, pm_message_t state)
static int __maybe_unused iavf_suspend(struct device *dev_d)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct net_device *netdev = dev_get_drvdata(dev_d);
struct iavf_adapter *adapter = netdev_priv(netdev);
int retval = 0;

netif_device_detach(netdev);

Expand All @@ -3803,12 +3801,6 @@ static int iavf_suspend(struct pci_dev *pdev, pm_message_t state)

clear_bit(__IAVF_IN_CRITICAL_TASK, &adapter->crit_section);

retval = pci_save_state(pdev);
if (retval)
return retval;

pci_disable_device(pdev);

return 0;
}

Expand All @@ -3818,24 +3810,13 @@ static int iavf_suspend(struct pci_dev *pdev, pm_message_t state)
*
* Called when the system (VM) is resumed from sleep/suspend.
**/
static int iavf_resume(struct pci_dev *pdev)
static int __maybe_unused iavf_resume(struct device *dev_d)
{
struct iavf_adapter *adapter = pci_get_drvdata(pdev);
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = to_pci_dev(dev_d);
struct net_device *netdev = pci_get_drvdata(pdev);
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 err;

pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
/* pci_restore_state clears dev->state_saved so call
* pci_save_state to restore it.
*/
pci_save_state(pdev);

err = pci_enable_device_mem(pdev);
if (err) {
dev_err(&pdev->dev, "Cannot enable PCI device from suspend.\n");
return err;
}
pci_set_master(pdev);

rtnl_lock();
Expand All @@ -3859,7 +3840,6 @@ static int iavf_resume(struct pci_dev *pdev)
return err;
}

#endif /* CONFIG_PM */
/**
* iavf_remove - Device Removal Routine
* @pdev: PCI device information struct
Expand Down Expand Up @@ -3961,16 +3941,15 @@ static void iavf_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}

static SIMPLE_DEV_PM_OPS(iavf_pm_ops, iavf_suspend, iavf_resume);

static struct pci_driver iavf_driver = {
.name = iavf_driver_name,
.id_table = iavf_pci_tbl,
.probe = iavf_probe,
.remove = iavf_remove,
#ifdef CONFIG_PM
.suspend = iavf_suspend,
.resume = iavf_resume,
#endif
.shutdown = iavf_shutdown,
.name = iavf_driver_name,
.id_table = iavf_pci_tbl,
.probe = iavf_probe,
.remove = iavf_remove,
.driver.pm = &iavf_pm_ops,
.shutdown = iavf_shutdown,
};

/**
Expand Down
Loading

0 comments on commit a307a5e

Please sign in to comment.