Skip to content

Commit

Permalink
Merge tag 'v5.10.59' into 5.10.y
Browse files Browse the repository at this point in the history
This is the 5.10.59 stable release
  • Loading branch information
sileshn committed Aug 16, 2021
2 parents 60b5006 + 5805e5e commit c00cd8c
Show file tree
Hide file tree
Showing 27 changed files with 169 additions and 100 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 = 10
SUBLEVEL = 58
SUBLEVEL = 59
EXTRAVERSION =.3
NAME = Dare mighty things

Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@
&ehci0 {
dr_mode = "otg";
status = "okay";
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
};

&ehci1 {
status = "okay";
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&usb2_clksel>, <&versaclock5 3>;
};

&hdmi0 {
Expand Down
6 changes: 4 additions & 2 deletions arch/arm64/boot/dts/renesas/beacon-renesom-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,10 @@
status = "okay";
};

&usb_extal_clk {
clock-frequency = <50000000>;
&usb2_clksel {
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
<&versaclock5 3>, <&usb3s0_clk>;
status = "okay";
};

&usb3s0_clk {
Expand Down
15 changes: 15 additions & 0 deletions arch/arm64/boot/dts/renesas/r8a774a1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,21 @@
status = "disabled";
};

usb2_clksel: clock-controller@e6590630 {
compatible = "renesas,r8a774a1-rcar-usb2-clock-sel",
"renesas,rcar-gen3-usb2-clock-sel";
reg = <0 0xe6590630 0 0x02>;
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
<&usb_extal_clk>, <&usb3s0_clk>;
clock-names = "ehci_ohci", "hs-usb-if",
"usb_extal", "usb_xtal";
#clock-cells = <0>;
power-domains = <&sysc R8A774A1_PD_ALWAYS_ON>;
resets = <&cpg 703>, <&cpg 704>;
reset-names = "ehci_ohci", "hs-usb-if";
status = "disabled";
};

usb_dmac0: dma-controller@e65a0000 {
compatible = "renesas,r8a774a1-usb-dmac",
"renesas,usb-dmac";
Expand Down
15 changes: 15 additions & 0 deletions arch/arm64/boot/dts/renesas/r8a774b1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,21 @@
status = "disabled";
};

usb2_clksel: clock-controller@e6590630 {
compatible = "renesas,r8a774b1-rcar-usb2-clock-sel",
"renesas,rcar-gen3-usb2-clock-sel";
reg = <0 0xe6590630 0 0x02>;
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
<&usb_extal_clk>, <&usb3s0_clk>;
clock-names = "ehci_ohci", "hs-usb-if",
"usb_extal", "usb_xtal";
#clock-cells = <0>;
power-domains = <&sysc R8A774B1_PD_ALWAYS_ON>;
resets = <&cpg 703>, <&cpg 704>;
reset-names = "ehci_ohci", "hs-usb-if";
status = "disabled";
};

usb_dmac0: dma-controller@e65a0000 {
compatible = "renesas,r8a774b1-usb-dmac",
"renesas,usb-dmac";
Expand Down
15 changes: 15 additions & 0 deletions arch/arm64/boot/dts/renesas/r8a774e1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,21 @@
status = "disabled";
};

usb2_clksel: clock-controller@e6590630 {
compatible = "renesas,r8a774e1-rcar-usb2-clock-sel",
"renesas,rcar-gen3-usb2-clock-sel";
reg = <0 0xe6590630 0 0x02>;
clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
<&usb_extal_clk>, <&usb3s0_clk>;
clock-names = "ehci_ohci", "hs-usb-if",
"usb_extal", "usb_xtal";
#clock-cells = <0>;
power-domains = <&sysc R8A774E1_PD_ALWAYS_ON>;
resets = <&cpg 703>, <&cpg 704>;
reset-names = "ehci_ohci", "hs-usb-if";
status = "disabled";
};

usb_dmac0: dma-controller@e65a0000 {
compatible = "renesas,r8a774e1-usb-dmac",
"renesas,usb-dmac";
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kvm/svm/sev.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static void sev_asid_free(int asid)

for_each_possible_cpu(cpu) {
sd = per_cpu(svm_data, cpu);
sd->sev_vmcbs[pos] = NULL;
sd->sev_vmcbs[asid] = NULL;
}

mutex_unlock(&sev_bitmap_lock);
Expand Down
14 changes: 11 additions & 3 deletions drivers/firmware/broadcom/tee_bnxt_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,9 @@ static int tee_bnxt_fw_probe(struct device *dev)

pvt_data.dev = dev;

fw_shm_pool = tee_shm_alloc(pvt_data.ctx, MAX_SHM_MEM_SZ,
TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
fw_shm_pool = tee_shm_alloc_kernel_buf(pvt_data.ctx, MAX_SHM_MEM_SZ);
if (IS_ERR(fw_shm_pool)) {
dev_err(pvt_data.dev, "tee_shm_alloc failed\n");
dev_err(pvt_data.dev, "tee_shm_alloc_kernel_buf failed\n");
err = PTR_ERR(fw_shm_pool);
goto out_sess;
}
Expand All @@ -242,6 +241,14 @@ static int tee_bnxt_fw_remove(struct device *dev)
return 0;
}

static void tee_bnxt_fw_shutdown(struct device *dev)
{
tee_shm_free(pvt_data.fw_shm_pool);
tee_client_close_session(pvt_data.ctx, pvt_data.session_id);
tee_client_close_context(pvt_data.ctx);
pvt_data.ctx = NULL;
}

static const struct tee_client_device_id tee_bnxt_fw_id_table[] = {
{UUID_INIT(0x6272636D, 0x2019, 0x0716,
0x42, 0x43, 0x4D, 0x5F, 0x53, 0x43, 0x48, 0x49)},
Expand All @@ -257,6 +264,7 @@ static struct tee_client_driver tee_bnxt_fw_driver = {
.bus = &tee_bus_type,
.probe = tee_bnxt_fw_probe,
.remove = tee_bnxt_fw_remove,
.shutdown = tee_bnxt_fw_shutdown,
},
};

Expand Down
5 changes: 2 additions & 3 deletions drivers/net/ethernet/xilinx/xilinx_emaclite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,9 +1191,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
}

dev_info(dev,
"Xilinx EmacLite at 0x%08X mapped to 0x%08X, irq=%d\n",
(unsigned int __force)ndev->mem_start,
(unsigned int __force)lp->base_addr, ndev->irq);
"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;

error:
Expand Down
19 changes: 15 additions & 4 deletions drivers/net/ppp/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static struct channel *ppp_find_channel(struct ppp_net *pn, int unit);
static int ppp_connect_channel(struct channel *pch, int unit);
static int ppp_disconnect_channel(struct channel *pch);
static void ppp_destroy_channel(struct channel *pch);
static int unit_get(struct idr *p, void *ptr);
static int unit_get(struct idr *p, void *ptr, int min);
static int unit_set(struct idr *p, void *ptr, int n);
static void unit_put(struct idr *p, int n);
static void *unit_find(struct idr *p, int n);
Expand Down Expand Up @@ -1045,9 +1045,20 @@ static int ppp_unit_register(struct ppp *ppp, int unit, bool ifname_is_set)
mutex_lock(&pn->all_ppp_mutex);

if (unit < 0) {
ret = unit_get(&pn->units_idr, ppp);
ret = unit_get(&pn->units_idr, ppp, 0);
if (ret < 0)
goto err;
if (!ifname_is_set) {
while (1) {
snprintf(ppp->dev->name, IFNAMSIZ, "ppp%i", ret);
if (!__dev_get_by_name(ppp->ppp_net, ppp->dev->name))
break;
unit_put(&pn->units_idr, ret);
ret = unit_get(&pn->units_idr, ppp, ret + 1);
if (ret < 0)
goto err;
}
}
} else {
/* Caller asked for a specific unit number. Fail with -EEXIST
* if unavailable. For backward compatibility, return -EEXIST
Expand Down Expand Up @@ -3378,9 +3389,9 @@ static int unit_set(struct idr *p, void *ptr, int n)
}

/* get new free unit number and associate pointer with it */
static int unit_get(struct idr *p, void *ptr)
static int unit_get(struct idr *p, void *ptr, int min)
{
return idr_alloc(p, ptr, 0, 0, GFP_KERNEL);
return idr_alloc(p, ptr, min, 0, GFP_KERNEL);
}

/* put unit number back to a pool */
Expand Down
2 changes: 1 addition & 1 deletion drivers/tee/optee/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static struct tee_shm *get_msg_arg(struct tee_context *ctx, size_t num_params,
struct optee_msg_arg *ma;

shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params),
TEE_SHM_MAPPED);
TEE_SHM_MAPPED | TEE_SHM_PRIV);
if (IS_ERR(shm))
return shm;

Expand Down
3 changes: 2 additions & 1 deletion drivers/tee/optee/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ static void optee_release(struct tee_context *ctx)
if (!ctxdata)
return;

shm = tee_shm_alloc(ctx, sizeof(struct optee_msg_arg), TEE_SHM_MAPPED);
shm = tee_shm_alloc(ctx, sizeof(struct optee_msg_arg),
TEE_SHM_MAPPED | TEE_SHM_PRIV);
if (!IS_ERR(shm)) {
arg = tee_shm_get_va(shm, 0);
/*
Expand Down
5 changes: 3 additions & 2 deletions drivers/tee/optee/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void handle_rpc_func_cmd_shm_alloc(struct tee_context *ctx,
shm = cmd_alloc_suppl(ctx, sz);
break;
case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED);
shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED | TEE_SHM_PRIV);
break;
default:
arg->ret = TEEC_ERROR_BAD_PARAMETERS;
Expand Down Expand Up @@ -501,7 +501,8 @@ void optee_handle_rpc(struct tee_context *ctx, struct optee_rpc_param *param,

switch (OPTEE_SMC_RETURN_GET_RPC_FUNC(param->a0)) {
case OPTEE_SMC_RPC_FUNC_ALLOC:
shm = tee_shm_alloc(ctx, param->a1, TEE_SHM_MAPPED);
shm = tee_shm_alloc(ctx, param->a1,
TEE_SHM_MAPPED | TEE_SHM_PRIV);
if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) {
reg_pair_from_64(&param->a1, &param->a2, pa);
reg_pair_from_64(&param->a4, &param->a5,
Expand Down
8 changes: 6 additions & 2 deletions drivers/tee/optee/shm_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
shm->paddr = page_to_phys(page);
shm->size = PAGE_SIZE << order;

if (shm->flags & TEE_SHM_DMA_BUF) {
/*
* Shared memory private to the OP-TEE driver doesn't need
* to be registered with OP-TEE.
*/
if (!(shm->flags & TEE_SHM_PRIV)) {
unsigned int nr_pages = 1 << order, i;
struct page **pages;

Expand Down Expand Up @@ -60,7 +64,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
static void pool_op_free(struct tee_shm_pool_mgr *poolm,
struct tee_shm *shm)
{
if (shm->flags & TEE_SHM_DMA_BUF)
if (!(shm->flags & TEE_SHM_PRIV))
optee_shm_unregister(shm->ctx, shm);

free_pages((unsigned long)shm->kaddr, get_order(shm->size));
Expand Down
4 changes: 2 additions & 2 deletions drivers/tee/tee_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags)
return ERR_PTR(-EINVAL);
}

if ((flags & ~(TEE_SHM_MAPPED | TEE_SHM_DMA_BUF))) {
if ((flags & ~(TEE_SHM_MAPPED | TEE_SHM_DMA_BUF | TEE_SHM_PRIV))) {
dev_err(teedev->dev.parent, "invalid shm flags 0x%x", flags);
return ERR_PTR(-EINVAL);
}
Expand Down Expand Up @@ -207,7 +207,7 @@ EXPORT_SYMBOL_GPL(tee_shm_alloc);
*/
struct tee_shm *tee_shm_alloc_kernel_buf(struct tee_context *ctx, size_t size)
{
return tee_shm_alloc(ctx, size, TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
return tee_shm_alloc(ctx, size, TEE_SHM_MAPPED);
}
EXPORT_SYMBOL_GPL(tee_shm_alloc_kernel_buf);

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/host/ehci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
if (pdev->vendor == PCI_VENDOR_ID_STMICRO
&& pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST)
; /* ConneXT has no sbrn register */
else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI
&& pdev->device == 0xa239)
; /* HUAWEI Kunpeng920 USB EHCI has no sbrn register */
else
pci_read_config_byte(pdev, 0x60, &ehci->sbrn);

Expand Down
42 changes: 28 additions & 14 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,20 @@ void drop_collected_mounts(struct vfsmount *mnt)
namespace_unlock();
}

static bool has_locked_children(struct mount *mnt, struct dentry *dentry)
{
struct mount *child;

list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
if (!is_subdir(child->mnt_mountpoint, dentry))
continue;

if (child->mnt.mnt_flags & MNT_LOCKED)
return true;
}
return false;
}

/**
* clone_private_mount - create a private clone of a path
*
Expand All @@ -1933,17 +1947,30 @@ struct vfsmount *clone_private_mount(const struct path *path)
struct mount *old_mnt = real_mount(path->mnt);
struct mount *new_mnt;

down_read(&namespace_sem);
if (IS_MNT_UNBINDABLE(old_mnt))
return ERR_PTR(-EINVAL);
goto invalid;

if (!check_mnt(old_mnt))
goto invalid;

if (has_locked_children(old_mnt, path->dentry))
goto invalid;

new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
up_read(&namespace_sem);

if (IS_ERR(new_mnt))
return ERR_CAST(new_mnt);

/* Longterm mount to be removed by kern_unmount*() */
new_mnt->mnt_ns = MNT_NS_INTERNAL;

return &new_mnt->mnt;

invalid:
up_read(&namespace_sem);
return ERR_PTR(-EINVAL);
}
EXPORT_SYMBOL_GPL(clone_private_mount);

Expand Down Expand Up @@ -2295,19 +2322,6 @@ static int do_change_type(struct path *path, int ms_flags)
return err;
}

static bool has_locked_children(struct mount *mnt, struct dentry *dentry)
{
struct mount *child;
list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
if (!is_subdir(child->mnt_mountpoint, dentry))
continue;

if (child->mnt.mnt_flags & MNT_LOCKED)
return true;
}
return false;
}

static struct mount *__do_loopback(struct path *old_path, int recurse)
{
struct mount *mnt = ERR_PTR(-EINVAL), *old = real_mount(old_path->mnt);
Expand Down
Loading

0 comments on commit c00cd8c

Please sign in to comment.