Skip to content

Commit

Permalink
Merge branch 'torvalds:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
offsoc authored Sep 30, 2024
2 parents 02a0ad5 + 9852d85 commit 63b5e5c
Show file tree
Hide file tree
Showing 106 changed files with 1,487 additions and 603 deletions.
8 changes: 8 additions & 0 deletions Documentation/core-api/cleanup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. SPDX-License-Identifier: GPL-2.0
===========================
Scope-based Cleanup Helpers
===========================

.. kernel-doc:: include/linux/cleanup.h
:doc: scope-based cleanup helpers
1 change: 1 addition & 0 deletions Documentation/core-api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Library functionality that is used throughout the kernel.

kobject
kref
cleanup
assoc_array
xarray
maple_tree
Expand Down
12 changes: 9 additions & 3 deletions Documentation/devicetree/bindings/mailbox/mtk,adsp-mbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ description: |
properties:
compatible:
enum:
- mediatek,mt8195-adsp-mbox
- mediatek,mt8186-adsp-mbox
oneOf:
- enum:
- mediatek,mt8186-adsp-mbox
- mediatek,mt8195-adsp-mbox
- items:
- enum:
- mediatek,mt8188-adsp-mbox
- const: mediatek,mt8186-adsp-mbox


"#mbox-cells":
const: 0
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ properties:
compatible:
items:
- enum:
- qcom,qcs8300-ipcc
- qcom,qdu1000-ipcc
- qcom,sa8255p-ipcc
- qcom,sa8775p-ipcc
- qcom,sc7280-ipcc
- qcom,sc8280xp-ipcc
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 11
PATCHLEVEL = 12
SUBLEVEL = 0
EXTRAVERSION =
EXTRAVERSION = -rc1
NAME = Baby Opossum Posse

# *DOCUMENTATION*
Expand Down
6 changes: 6 additions & 0 deletions arch/x86/coco/tdx/tdx.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <asm/insn-eval.h>
#include <asm/pgtable.h>
#include <asm/set_memory.h>
#include <asm/traps.h>

/* MMIO direction */
#define EPT_READ 0
Expand Down Expand Up @@ -433,6 +434,11 @@ static int handle_mmio(struct pt_regs *regs, struct ve_info *ve)
return -EINVAL;
}

if (!fault_in_kernel_space(ve->gla)) {
WARN_ONCE(1, "Access to userspace address is not supported");
return -EINVAL;
}

/*
* Reject EPT violation #VEs that split pages.
*
Expand Down
6 changes: 2 additions & 4 deletions arch/x86/include/asm/atomic64_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,18 @@ static __always_inline s64 arch_atomic64_dec_return(atomic64_t *v)
}
#define arch_atomic64_dec_return arch_atomic64_dec_return

static __always_inline s64 arch_atomic64_add(s64 i, atomic64_t *v)
static __always_inline void arch_atomic64_add(s64 i, atomic64_t *v)
{
__alternative_atomic64(add, add_return,
ASM_OUTPUT2("+A" (i), "+c" (v)),
ASM_NO_INPUT_CLOBBER("memory"));
return i;
}

static __always_inline s64 arch_atomic64_sub(s64 i, atomic64_t *v)
static __always_inline void arch_atomic64_sub(s64 i, atomic64_t *v)
{
__alternative_atomic64(sub, sub_return,
ASM_OUTPUT2("+A" (i), "+c" (v)),
ASM_NO_INPUT_CLOBBER("memory"));
return i;
}

static __always_inline void arch_atomic64_inc(atomic64_t *v)
Expand Down
5 changes: 5 additions & 0 deletions arch/x86/include/asm/intel-family.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@

#define INTEL_LUNARLAKE_M IFM(6, 0xBD)

#define INTEL_PANTHERLAKE_L IFM(6, 0xCC)

/* "Small Core" Processors (Atom/E-Core) */

#define INTEL_ATOM_BONNELL IFM(6, 0x1C) /* Diamondville, Pineview */
Expand Down Expand Up @@ -178,4 +180,7 @@
#define INTEL_FAM5_QUARK_X1000 0x09 /* Quark X1000 SoC */
#define INTEL_QUARK_X1000 IFM(5, 0x09) /* Quark X1000 SoC */

/* Family 19 */
#define INTEL_PANTHERCOVE_X IFM(19, 0x01) /* Diamond Rapids */

#endif /* _ASM_X86_INTEL_FAMILY_H */
2 changes: 2 additions & 0 deletions arch/x86/include/asm/reboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback);
void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback);
void cpu_emergency_disable_virtualization(void);
#else
static inline void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback) {}
static inline void cpu_emergency_unregister_virt_callback(cpu_emergency_virt_cb *callback) {}
static inline void cpu_emergency_disable_virtualization(void) {}
#endif /* CONFIG_KVM_INTEL || CONFIG_KVM_AMD */

Expand Down
9 changes: 7 additions & 2 deletions arch/x86/lib/atomic64_cx8_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
cmpxchg8b (\reg)
.endm

.macro read64_nonatomic reg
movl (\reg), %eax
movl 4(\reg), %edx
.endm

SYM_FUNC_START(atomic64_read_cx8)
read64 %ecx
RET
Expand Down Expand Up @@ -51,7 +56,7 @@ SYM_FUNC_START(atomic64_\func\()_return_cx8)
movl %edx, %edi
movl %ecx, %ebp

read64 %ecx
read64_nonatomic %ecx
1:
movl %eax, %ebx
movl %edx, %ecx
Expand Down Expand Up @@ -79,7 +84,7 @@ addsub_return sub sub sbb
SYM_FUNC_START(atomic64_\func\()_return_cx8)
pushl %ebx

read64 %esi
read64_nonatomic %esi
1:
movl %eax, %ebx
movl %edx, %ecx
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ config I2C_JZ4780
config I2C_KEBA
tristate "KEBA I2C controller support"
depends on HAS_IOMEM
depends on KEBA_CP500 || COMPILE_TEST
select AUXILIARY_BUS
help
This driver supports the I2C controller found in KEBA system FPGA
Expand Down
14 changes: 14 additions & 0 deletions drivers/i2c/busses/i2c-designware-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev)

void __i2c_dw_disable(struct dw_i2c_dev *dev)
{
struct i2c_timings *t = &dev->timings;
unsigned int raw_intr_stats;
unsigned int enable;
int timeout = 100;
Expand All @@ -535,6 +536,19 @@ void __i2c_dw_disable(struct dw_i2c_dev *dev)

abort_needed = raw_intr_stats & DW_IC_INTR_MST_ON_HOLD;
if (abort_needed) {
if (!(enable & DW_IC_ENABLE_ENABLE)) {
regmap_write(dev->map, DW_IC_ENABLE, DW_IC_ENABLE_ENABLE);
/*
* Wait 10 times the signaling period of the highest I2C
* transfer supported by the driver (for 400KHz this is
* 25us) to ensure the I2C ENABLE bit is already set
* as described in the DesignWare I2C databook.
*/
fsleep(DIV_ROUND_CLOSEST_ULL(10 * MICRO, t->bus_freq_hz));
/* Set ENABLE bit before setting ABORT */
enable |= DW_IC_ENABLE_ENABLE;
}

regmap_write(dev->map, DW_IC_ENABLE, enable | DW_IC_ENABLE_ABORT);
ret = regmap_read_poll_timeout(dev->map, DW_IC_ENABLE, enable,
!(enable & DW_IC_ENABLE_ABORT), 10,
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-designware-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
DW_IC_INTR_RX_UNDER | \
DW_IC_INTR_RD_REQ)

#define DW_IC_ENABLE_ENABLE BIT(0)
#define DW_IC_ENABLE_ABORT BIT(1)

#define DW_IC_STATUS_ACTIVITY BIT(0)
Expand Down
38 changes: 38 additions & 0 deletions drivers/i2c/busses/i2c-designware-master.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,34 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
__i2c_dw_write_intr_mask(dev, DW_IC_INTR_MASTER_MASK);
}

/*
* This function waits for the controller to be idle before disabling I2C
* When the controller is not in the IDLE state, the MST_ACTIVITY bit
* (IC_STATUS[5]) is set.
*
* Values:
* 0x1 (ACTIVE): Controller not idle
* 0x0 (IDLE): Controller is idle
*
* The function is called after completing the current transfer.
*
* Returns:
* False when the controller is in the IDLE state.
* True when the controller is in the ACTIVE state.
*/
static bool i2c_dw_is_controller_active(struct dw_i2c_dev *dev)
{
u32 status;

regmap_read(dev->map, DW_IC_STATUS, &status);
if (!(status & DW_IC_STATUS_MASTER_ACTIVITY))
return false;

return regmap_read_poll_timeout(dev->map, DW_IC_STATUS, status,
!(status & DW_IC_STATUS_MASTER_ACTIVITY),
1100, 20000) != 0;
}

static int i2c_dw_check_stopbit(struct dw_i2c_dev *dev)
{
u32 val;
Expand Down Expand Up @@ -806,6 +834,16 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
goto done;
}

/*
* This happens rarely (~1:500) and is hard to reproduce. Debug trace
* showed that IC_STATUS had value of 0x23 when STOP_DET occurred,
* if disable IC_ENABLE.ENABLE immediately that can result in
* IC_RAW_INTR_STAT.MASTER_ON_HOLD holding SCL low. Check if
* controller is still ACTIVE before disabling I2C.
*/
if (i2c_dw_is_controller_active(dev))
dev_err(dev->dev, "controller active\n");

/*
* We must disable the adapter before returning and signaling the end
* of the current transfer. Otherwise the hardware might continue
Expand Down
5 changes: 3 additions & 2 deletions drivers/i2c/busses/i2c-synquacer.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,13 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
device_property_read_u32(&pdev->dev, "socionext,pclk-rate",
&i2c->pclkrate);

pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
if (IS_ERR(pclk))
return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
"failed to get and enable clock\n");

i2c->pclkrate = clk_get_rate(pclk);
if (pclk)
i2c->pclkrate = clk_get_rate(pclk);

if (i2c->pclkrate < SYNQUACER_I2C_MIN_CLK_RATE ||
i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE)
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-xiic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,8 +1337,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
return 0;

err_pm_disable:
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);

return ret;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/mailbox/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ config ARM_MHU_V2

config ARM_MHU_V3
tristate "ARM MHUv3 Mailbox"
depends on ARM64 || COMPILE_TEST
depends on HAS_IOMEM || COMPILE_TEST
depends on OF
help
Expand Down Expand Up @@ -73,7 +74,7 @@ config ARMADA_37XX_RWTM_MBOX

config OMAP2PLUS_MBOX
tristate "OMAP2+ Mailbox framework support"
depends on ARCH_OMAP2PLUS || ARCH_K3
depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
help
Mailbox implementation for OMAP family chips with hardware for
interprocessor communication involving DSP, IVA1.0 and IVA2 in
Expand Down
3 changes: 2 additions & 1 deletion drivers/mailbox/bcm2835-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
spin_lock_init(&mbox->lock);

ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0),
bcm2835_mbox_irq, 0, dev_name(dev), mbox);
bcm2835_mbox_irq, IRQF_NO_SUSPEND, dev_name(dev),
mbox);
if (ret) {
dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n",
ret);
Expand Down
6 changes: 3 additions & 3 deletions drivers/mailbox/imx-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define IMX_MU_SCU_CHANS 6
/* TX0/RX0 */
#define IMX_MU_S4_CHANS 2
#define IMX_MU_CHAN_NAME_SIZE 20
#define IMX_MU_CHAN_NAME_SIZE 32

#define IMX_MU_V2_PAR_OFF 0x4
#define IMX_MU_V2_TR_MASK GENMASK(7, 0)
Expand Down Expand Up @@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
cp->chan = &priv->mbox_chans[i];
priv->mbox_chans[i].con_priv = cp;
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
"imx_mu_chan[%i-%i]", cp->type, cp->idx);
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
}

priv->mbox.num_chans = IMX_MU_CHANS;
Expand Down Expand Up @@ -819,7 +819,7 @@ static int imx_mu_init_specific(struct imx_mu_priv *priv)
cp->chan = &priv->mbox_chans[i];
priv->mbox_chans[i].con_priv = cp;
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
"imx_mu_chan[%i-%i]", cp->type, cp->idx);
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
}

priv->mbox.num_chans = num_chans;
Expand Down
22 changes: 6 additions & 16 deletions drivers/mailbox/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,30 +450,20 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
const char *name)
{
struct device_node *np = cl->dev->of_node;
struct property *prop;
const char *mbox_name;
int index = 0;
int index;

if (!np) {
dev_err(cl->dev, "%s() currently only supports DT\n", __func__);
return ERR_PTR(-EINVAL);
}

if (!of_get_property(np, "mbox-names", NULL)) {
dev_err(cl->dev,
"%s() requires an \"mbox-names\" property\n", __func__);
index = of_property_match_string(np, "mbox-names", name);
if (index < 0) {
dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",
__func__, name);
return ERR_PTR(-EINVAL);
}

of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
if (!strncmp(name, mbox_name, strlen(name)))
return mbox_request_channel(cl, index);
index++;
}

dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",
__func__, name);
return ERR_PTR(-EINVAL);
return mbox_request_channel(cl, index);
}
EXPORT_SYMBOL_GPL(mbox_request_channel_byname);

Expand Down
2 changes: 1 addition & 1 deletion drivers/mailbox/omap-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static struct platform_driver omap_mbox_driver = {
.driver = {
.name = "omap-mailbox",
.pm = &omap_mbox_pm_ops,
.of_match_table = of_match_ptr(omap_mailbox_of_match),
.of_match_table = omap_mailbox_of_match,
},
};
module_platform_driver(omap_mbox_driver);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mailbox/rockchip-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static const struct of_device_id rockchip_mbox_of_match[] = {
{ .compatible = "rockchip,rk3368-mailbox", .data = &rk3368_drv_data},
{ },
};
MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match);
MODULE_DEVICE_TABLE(of, rockchip_mbox_of_match);

static int rockchip_mbox_probe(struct platform_device *pdev)
{
Expand Down
Loading

0 comments on commit 63b5e5c

Please sign in to comment.