Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 5.4-2.3.x-imx to v5.4.98 #257

Merged
merged 26 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
968b1b0
tracing/kprobe: Fix to support kretprobe events on unloaded modules
mhiramat Jan 27, 2021
03d76df
af_key: relax availability checks for skb size calculation
Dec 27, 2020
2654856
regulator: core: avoid regulator_resolve_supply() race condition
Jan 8, 2021
db272cd
mac80211: 160MHz with extended NSS BW in CSA
shaydevel Dec 22, 2020
8b6d501
ASoC: Intel: Skylake: Zero snd_ctl_elem_value
ribalda Jan 21, 2021
a5c70e5
chtls: Fix potential resource leak
SinkFinder Jan 21, 2021
e96d102
pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process()
Jan 21, 2021
589cf15
ASoC: ak4458: correct reset polarity
eliotb Jan 22, 2021
8f630ed
iwlwifi: mvm: skip power command when unbinding vif during CSA
sara-s Jan 15, 2021
01742ad
iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time()
jmberg-intel Jan 15, 2021
b301eaf
iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap
egrumbach Jan 15, 2021
c82793e
iwlwifi: pcie: fix context info memory leak
jmberg-intel Jan 15, 2021
2fa76f1
iwlwifi: mvm: invalidate IDs of internal stations at mvm start
ggreenma Jan 22, 2021
fa75803
iwlwifi: mvm: guard against device removal in reprobe
jmberg-intel Jan 22, 2021
19b56e8
SUNRPC: Move simple_get_bytes and simple_get_netobj into private header
DaveWysochanskiRH Jan 21, 2021
618b65d
SUNRPC: Handle 0 length opaque XDR object data properly
DaveWysochanskiRH Jan 21, 2021
d1eb418
i2c: mediatek: Move suspend and resume handling to NOIRQ phase
Jan 9, 2021
513fee2
blk-cgroup: Use cond_resched() when destroy blkgs
Jan 28, 2021
8589eda
regulator: Fix lockdep warning resolving supplies
broonie Jan 22, 2021
78e2f71
bpf: Fix 32 bit src register truncation on div/mod
borkmann Feb 9, 2021
848bcb0
Fix unsynchronized access to sev members through svm_register_enc_region
pgonda Jan 27, 2021
a814355
squashfs: add more sanity checks in id lookup
plougher Feb 9, 2021
d78a706
squashfs: add more sanity checks in inode lookup
plougher Feb 9, 2021
3654a0e
squashfs: add more sanity checks in xattr id lookup
plougher Feb 9, 2021
5b9a410
Linux 5.4.98
gregkh Feb 13, 2021
5df3672
Merge tag 'v5.4.98' into 5.4-2.3.x-imx
zandrey Feb 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 97
SUBLEVEL = 98
EXTRAVERSION =
NAME = Kleptomaniac Octopus

Expand Down
18 changes: 11 additions & 7 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,8 @@ static struct page **sev_pin_memory(struct kvm *kvm, unsigned long uaddr,
struct page **pages;
unsigned long first, last;

lockdep_assert_held(&kvm->lock);

if (ulen == 0 || uaddr + ulen < uaddr)
return NULL;

Expand Down Expand Up @@ -7091,12 +7093,21 @@ static int svm_register_enc_region(struct kvm *kvm,
if (!region)
return -ENOMEM;

mutex_lock(&kvm->lock);
region->pages = sev_pin_memory(kvm, range->addr, range->size, &region->npages, 1);
if (!region->pages) {
ret = -ENOMEM;
mutex_unlock(&kvm->lock);
goto e_free;
}

region->uaddr = range->addr;
region->size = range->size;

mutex_lock(&kvm->lock);
list_add_tail(&region->list, &sev->regions_list);
mutex_unlock(&kvm->lock);

/*
* The guest may change the memory encryption attribute from C=0 -> C=1
* or vice versa for this memory range. Lets make sure caches are
Expand All @@ -7105,13 +7116,6 @@ static int svm_register_enc_region(struct kvm *kvm,
*/
sev_clflush_pages(region->pages, region->npages);

region->uaddr = range->addr;
region->size = range->size;

mutex_lock(&kvm->lock);
list_add_tail(&region->list, &sev->regions_list);
mutex_unlock(&kvm->lock);

return ret;

e_free:
Expand Down
18 changes: 13 additions & 5 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,21 +1089,29 @@ static void blkcg_css_offline(struct cgroup_subsys_state *css)
*/
void blkcg_destroy_blkgs(struct blkcg *blkcg)
{
might_sleep();

spin_lock_irq(&blkcg->lock);

while (!hlist_empty(&blkcg->blkg_list)) {
struct blkcg_gq *blkg = hlist_entry(blkcg->blkg_list.first,
struct blkcg_gq, blkcg_node);
struct request_queue *q = blkg->q;

if (spin_trylock(&q->queue_lock)) {
blkg_destroy(blkg);
spin_unlock(&q->queue_lock);
} else {
if (need_resched() || !spin_trylock(&q->queue_lock)) {
/*
* Given that the system can accumulate a huge number
* of blkgs in pathological cases, check to see if we
* need to rescheduling to avoid softlockup.
*/
spin_unlock_irq(&blkcg->lock);
cpu_relax();
cond_resched();
spin_lock_irq(&blkcg->lock);
continue;
}

blkg_destroy(blkg);
spin_unlock(&q->queue_lock);
}

spin_unlock_irq(&blkcg->lock);
Expand Down
7 changes: 3 additions & 4 deletions drivers/crypto/chelsio/chtls/chtls_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,11 +1047,9 @@ static struct sock *chtls_recv_sock(struct sock *lsk,

n = dst_neigh_lookup(dst, &iph->saddr);
if (!n || !n->dev)
goto free_sk;
goto free_dst;

ndev = n->dev;
if (!ndev)
goto free_dst;
if (is_vlan_dev(ndev))
ndev = vlan_dev_real_dev(ndev);

Expand Down Expand Up @@ -1117,7 +1115,8 @@ static struct sock *chtls_recv_sock(struct sock *lsk,
free_csk:
chtls_sock_release(&csk->kref);
free_dst:
neigh_release(n);
if (n)
neigh_release(n);
dst_release(dst);
free_sk:
inet_csk_prepare_forced_close(newsk);
Expand Down
19 changes: 16 additions & 3 deletions drivers/i2c/busses/i2c-mt65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,8 @@ static int mtk_i2c_probe(struct platform_device *pdev)
mtk_i2c_clock_disable(i2c);

ret = devm_request_irq(&pdev->dev, irq, mtk_i2c_irq,
IRQF_TRIGGER_NONE, I2C_DRV_NAME, i2c);
IRQF_NO_SUSPEND | IRQF_TRIGGER_NONE,
I2C_DRV_NAME, i2c);
if (ret < 0) {
dev_err(&pdev->dev,
"Request I2C IRQ %d fail\n", irq);
Expand All @@ -1035,7 +1036,16 @@ static int mtk_i2c_remove(struct platform_device *pdev)
}

#ifdef CONFIG_PM_SLEEP
static int mtk_i2c_resume(struct device *dev)
static int mtk_i2c_suspend_noirq(struct device *dev)
{
struct mtk_i2c *i2c = dev_get_drvdata(dev);

i2c_mark_adapter_suspended(&i2c->adap);

return 0;
}

static int mtk_i2c_resume_noirq(struct device *dev)
{
int ret;
struct mtk_i2c *i2c = dev_get_drvdata(dev);
Expand All @@ -1050,12 +1060,15 @@ static int mtk_i2c_resume(struct device *dev)

mtk_i2c_clock_disable(i2c);

i2c_mark_adapter_resumed(&i2c->adap);

return 0;
}
#endif

static const struct dev_pm_ops mtk_i2c_pm = {
SET_SYSTEM_SLEEP_PM_OPS(NULL, mtk_i2c_resume)
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq,
mtk_i2c_resume_noirq)
};

static struct platform_driver mtk_i2c_driver = {
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,10 @@ static ssize_t iwl_dbgfs_os_device_timediff_read(struct file *file,
const size_t bufsz = sizeof(buf);
int pos = 0;

mutex_lock(&mvm->mutex);
iwl_mvm_get_sync_time(mvm, &curr_gp2, &curr_os);
mutex_unlock(&mvm->mutex);

do_div(curr_os, NSEC_PER_USEC);
diff = curr_os - curr_gp2;
pos += scnprintf(buf + pos, bufsz - pos, "diff=%lld\n", diff);
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -4169,6 +4169,9 @@ static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm,
iwl_mvm_binding_remove_vif(mvm, vif);

out:
if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD) &&
switching_chanctx)
return;
mvmvif->phy_ctxt = NULL;
iwl_mvm_power_update_mac(mvm);
}
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/wireless/intel/iwlwifi/mvm/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,10 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
if (!mvm->scan_cmd)
goto out_free;

/* invalidate ids to prevent accidental removal of sta_id 0 */
mvm->aux_sta.sta_id = IWL_MVM_INVALID_STA;
mvm->snif_sta.sta_id = IWL_MVM_INVALID_STA;

/* Set EBS as successful as long as not stated otherwise by the FW. */
mvm->last_ebs_successful = true;

Expand Down Expand Up @@ -1238,6 +1242,7 @@ static void iwl_mvm_reprobe_wk(struct work_struct *wk)
reprobe = container_of(wk, struct iwl_mvm_reprobe, work);
if (device_reprobe(reprobe->dev))
dev_err(reprobe->dev, "reprobe failed!\n");
put_device(reprobe->dev);
kfree(reprobe);
module_put(THIS_MODULE);
}
Expand Down Expand Up @@ -1288,7 +1293,7 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
module_put(THIS_MODULE);
return;
}
reprobe->dev = mvm->trans->dev;
reprobe->dev = get_device(mvm->trans->dev);
INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk);
schedule_work(&reprobe->work);
} else if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,9 @@ int iwl_mvm_rm_snif_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)

lockdep_assert_held(&mvm->mutex);

if (WARN_ON_ONCE(mvm->snif_sta.sta_id == IWL_MVM_INVALID_STA))
return -EINVAL;

iwl_mvm_disable_txq(mvm, NULL, mvm->snif_queue, IWL_MAX_TID_COUNT, 0);
ret = iwl_mvm_rm_sta_common(mvm, mvm->snif_sta.sta_id);
if (ret)
Expand All @@ -2084,6 +2087,9 @@ int iwl_mvm_rm_aux_sta(struct iwl_mvm *mvm)

lockdep_assert_held(&mvm->mutex);

if (WARN_ON_ONCE(mvm->aux_sta.sta_id == IWL_MVM_INVALID_STA))
return -EINVAL;

iwl_mvm_disable_txq(mvm, NULL, mvm->aux_queue, IWL_MAX_TID_COUNT, 0);
ret = iwl_mvm_rm_sta_common(mvm, mvm->aux_sta.sta_id);
if (ret)
Expand Down
11 changes: 9 additions & 2 deletions drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
/* Allocate IML */
iml_img = dma_alloc_coherent(trans->dev, trans->iml_len,
&trans_pcie->iml_dma_addr, GFP_KERNEL);
if (!iml_img)
return -ENOMEM;
if (!iml_img) {
ret = -ENOMEM;
goto err_free_ctxt_info;
}

memcpy(iml_img, trans->iml, trans->iml_len);

Expand Down Expand Up @@ -207,6 +209,11 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,

return 0;

err_free_ctxt_info:
dma_free_coherent(trans->dev, sizeof(*trans_pcie->ctxt_info_gen3),
trans_pcie->ctxt_info_gen3,
trans_pcie->ctxt_info_dma_addr);
trans_pcie->ctxt_info_gen3 = NULL;
err_free_prph_info:
dma_free_coherent(trans->dev,
sizeof(*prph_info),
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/pcie/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id)
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
struct iwl_txq *txq = trans_pcie->txq[txq_id];

if (!txq) {
IWL_ERR(trans, "Trying to free a queue that wasn't allocated?\n");
return;
}

spin_lock_bh(&txq->lock);
while (txq->write_ptr != txq->read_ptr) {
IWL_DEBUG_TX_REPLY(trans, "Q %d Free %d\n",
Expand Down
44 changes: 33 additions & 11 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,13 +1772,13 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
{
struct regulator_dev *r;
struct device *dev = rdev->dev.parent;
int ret;
int ret = 0;

/* No supply to resolve? */
if (!rdev->supply_name)
return 0;

/* Supply already resolved? */
/* Supply already resolved? (fast-path without locking contention) */
if (rdev->supply)
return 0;

Expand All @@ -1788,23 +1788,26 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)

/* Did the lookup explicitly defer for us? */
if (ret == -EPROBE_DEFER)
return ret;
goto out;

if (have_full_constraints()) {
r = dummy_regulator_rdev;
get_device(&r->dev);
} else {
dev_err(dev, "Failed to resolve %s-supply for %s\n",
rdev->supply_name, rdev->desc->name);
return -EPROBE_DEFER;
ret = -EPROBE_DEFER;
goto out;
}
}

if (r == rdev) {
dev_err(dev, "Supply for %s (%s) resolved to itself\n",
rdev->desc->name, rdev->supply_name);
if (!have_full_constraints())
return -EINVAL;
if (!have_full_constraints()) {
ret = -EINVAL;
goto out;
}
r = dummy_regulator_rdev;
get_device(&r->dev);
}
Expand All @@ -1818,23 +1821,41 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (r->dev.parent && r->dev.parent != rdev->dev.parent) {
if (!device_is_bound(r->dev.parent)) {
put_device(&r->dev);
return -EPROBE_DEFER;
ret = -EPROBE_DEFER;
goto out;
}
}

/* Recursively resolve the supply of the supply */
ret = regulator_resolve_supply(r);
if (ret < 0) {
put_device(&r->dev);
return ret;
goto out;
}

/*
* Recheck rdev->supply with rdev->mutex lock held to avoid a race
* between rdev->supply null check and setting rdev->supply in
* set_supply() from concurrent tasks.
*/
regulator_lock(rdev);

/* Supply just resolved by a concurrent task? */
if (rdev->supply) {
regulator_unlock(rdev);
put_device(&r->dev);
goto out;
}

ret = set_supply(rdev, r);
if (ret < 0) {
regulator_unlock(rdev);
put_device(&r->dev);
return ret;
goto out;
}

regulator_unlock(rdev);

/*
* In set_machine_constraints() we may have turned this regulator on
* but we couldn't propagate to the supply if it hadn't been resolved
Expand All @@ -1845,11 +1866,12 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (ret < 0) {
_regulator_put(rdev->supply);
rdev->supply = NULL;
return ret;
goto out;
}
}

return 0;
out:
return ret;
}

/* Internal regulator request function */
Expand Down
8 changes: 7 additions & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,13 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
* We got an entirely new state ID. Mark all segments for the
* inode invalid, and retry the layoutget
*/
pnfs_mark_layout_stateid_invalid(lo, &free_me);
struct pnfs_layout_range range = {
.iomode = IOMODE_ANY,
.length = NFS4_MAX_UINT64,
};
pnfs_set_plh_return_info(lo, IOMODE_ANY, 0);
pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs,
&range, 0);
goto out_forget;
}

Expand Down
Loading