Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
26b614f
dmaengine: ti: k3-udma: Fix pktdma rchan TPL level setup
Dec 16, 2020
ff58f7d
dmaengine: idxd: off by one in cleanup code
Dec 16, 2020
8fb2879
dmaengine: qcom: gpi: Fixes a format mismatch
nixiaoming Dec 18, 2020
33cbd54
dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error hand…
tititiou36 Dec 19, 2020
d645148
dmaengine: milbeaut-xdmac: Fix a resource leak in the error handling …
tititiou36 Dec 19, 2020
595a334
dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk()
Dec 14, 2020
ba42f61
qcom: bam_dma: Delete useless kfree code
Dec 16, 2020
28d8e07
MAINTAINERS: Add entry for Texas Instruments DMA drivers
Dec 15, 2020
cc465fa
dt-bindings: dma: ti: Update maintainer and author information
Dec 15, 2020
e042f15
hwmon: (sbtsi_temp) Fix Documenation kernel-doc warning
rddunlap Dec 29, 2020
1eda523
hwmon: (pwm-fan) Ensure that calculation doesn't discard big period v…
Dec 15, 2020
0bd1bf8
dmaengine: qcom: fix gpi undefined behavior
arndb Jan 3, 2021
99974ae
dmaengine: xilinx_dma: check dma_async_device_register return value
Dec 23, 2020
faeb073
dmaengine: xilinx_dma: fix incompatible param warning in _child_probe()
Dec 23, 2020
2d5efea
dmaengine: xilinx_dma: fix mixed_enum_type coverity warning
Dec 23, 2020
e1263f9
dmaengine: stm32-mdma: fix STM32_MDMA_VERY_HIGH_PRIORITY value
ADESTM Jan 4, 2021
0b884fe
i2c: sprd: use a specific timeout to avoid system hang up issue
Dec 14, 2020
0b3ea2a
i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly term…
jwrdegoede Dec 21, 2020
05f6f72
i2c: mediatek: Fix apdma and i2c hand-shake timeout
Dec 24, 2020
84e2615
hwmon: (amd_energy) fix allocation of hwmon_channel_info config
darcari Jan 7, 2021
6bae85b
maintainers: update my email address
djwong Jan 9, 2021
caab314
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/…
torvalds Jan 9, 2021
f408126
Merge tag 'dmaengine-fix-5.11' of git://git.kernel.org/pub/scm/linux/…
torvalds Jan 9, 2021
2ff9010
Merge tag 'hwmon-for-v5.11-rc3' of git://git.kernel.org/pub/scm/linux…
torvalds Jan 9, 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
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2020 Texas Instruments Incorporated
# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/ti/k3-bcdma.yaml#
Expand All @@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments K3 DMSS BCDMA Device Tree Bindings

maintainers:
- Peter Ujfalusi <peter.ujfalusi@ti.com>
- Peter Ujfalusi <peter.ujfalusi@gmail.com>

description: |
The Block Copy DMA (BCDMA) is intended to perform similar functions as the TR
Expand Down
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2020 Texas Instruments Incorporated
# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/ti/k3-pktdma.yaml#
Expand All @@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments K3 DMSS PKTDMA Device Tree Bindings

maintainers:
- Peter Ujfalusi <peter.ujfalusi@ti.com>
- Peter Ujfalusi <peter.ujfalusi@gmail.com>

description: |
The Packet DMA (PKTDMA) is intended to perform similar functions as the packet
Expand Down
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/dma/ti/k3-udma.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2019 Texas Instruments Incorporated
# Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/ti/k3-udma.yaml#
Expand All @@ -7,7 +9,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments K3 NAVSS Unified DMA Device Tree Bindings

maintainers:
- Peter Ujfalusi <peter.ujfalusi@ti.com>
- Peter Ujfalusi <peter.ujfalusi@gmail.com>

description: |
The UDMA-P is intended to perform similar (but significantly upgraded)
Expand Down
2 changes: 1 addition & 1 deletion Documentation/hwmon/sbtsi_temp.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver sbtsi_temp
==================
========================

Supported hardware:

Expand Down
17 changes: 15 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9273,7 +9273,7 @@ F: drivers/net/ethernet/sgi/ioc3-eth.c

IOMAP FILESYSTEM LIBRARY
M: Christoph Hellwig <hch@infradead.org>
M: Darrick J. Wong <darrick.wong@oracle.com>
M: Darrick J. Wong <djwong@kernel.org>
M: linux-xfs@vger.kernel.org
M: linux-fsdevel@vger.kernel.org
L: linux-xfs@vger.kernel.org
Expand Down Expand Up @@ -17552,6 +17552,19 @@ S: Supported
F: Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
F: drivers/iio/dac/ti-dac7612.c

TEXAS INSTRUMENTS DMA DRIVERS
M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
L: dmaengine@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/dma/ti-dma-crossbar.txt
F: Documentation/devicetree/bindings/dma/ti-edma.txt
F: Documentation/devicetree/bindings/dma/ti/
F: drivers/dma/ti/
X: drivers/dma/ti/cppi41.c
F: include/linux/dma/k3-udma-glue.h
F: include/linux/dma/ti-cppi5.h
F: include/linux/dma/k3-psil.h

TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
M: Nishanth Menon <nm@ti.com>
M: Tero Kristo <t-kristo@ti.com>
Expand Down Expand Up @@ -19504,7 +19517,7 @@ F: arch/x86/xen/*swiotlb*
F: drivers/xen/*swiotlb*

XFS FILESYSTEM
M: Darrick J. Wong <darrick.wong@oracle.com>
M: Darrick J. Wong <djwong@kernel.org>
M: linux-xfs@vger.kernel.org
L: linux-xfs@vger.kernel.org
S: Supported
Expand Down
4 changes: 2 additions & 2 deletions drivers/dma/dw-edma/dw-edma-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ static struct dw_edma_chunk *dw_edma_alloc_chunk(struct dw_edma_desc *desc)

if (desc->chunk) {
/* Create and add new element into the linked list */
desc->chunks_alloc++;
list_add_tail(&chunk->list, &desc->chunk->list);
if (!dw_edma_alloc_burst(chunk)) {
kfree(chunk);
return NULL;
}
desc->chunks_alloc++;
list_add_tail(&chunk->list, &desc->chunk->list);
} else {
/* List head */
chunk->burst = NULL;
Expand Down
4 changes: 2 additions & 2 deletions drivers/dma/idxd/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ int idxd_register_driver(void)
return 0;

drv_fail:
for (; i > 0; i--)
while (--i >= 0)
driver_unregister(&idxd_drvs[i]->drv);
return rc;
}
Expand Down Expand Up @@ -1840,7 +1840,7 @@ int idxd_register_bus_type(void)
return 0;

bus_err:
for (; i > 0; i--)
while (--i >= 0)
bus_unregister(idxd_bus_types[i]);
return rc;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/dma/mediatek/mtk-hsdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return 0;

err_free:
mtk_hsdma_hw_deinit(hsdma);
of_dma_controller_free(pdev->dev.of_node);
err_unregister:
dma_async_device_unregister(dd);
Expand Down
4 changes: 3 additions & 1 deletion drivers/dma/milbeaut-xdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev)

ret = dma_async_device_register(ddev);
if (ret)
return ret;
goto disable_xdmac;

ret = of_dma_controller_register(dev->of_node,
of_dma_simple_xlate, mdev);
Expand All @@ -363,6 +363,8 @@ static int milbeaut_xdmac_probe(struct platform_device *pdev)

unregister_dmac:
dma_async_device_unregister(ddev);
disable_xdmac:
disable_xdmac(mdev);
return ret;
}

Expand Down
6 changes: 1 addition & 5 deletions drivers/dma/qcom/bam_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
GFP_NOWAIT);

if (!async_desc)
goto err_out;
return NULL;

if (flags & DMA_PREP_FENCE)
async_desc->flags |= DESC_FLAG_NWD;
Expand Down Expand Up @@ -670,10 +670,6 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
}

return vchan_tx_prep(&bchan->vc, &async_desc->vd, flags);

err_out:
kfree(async_desc);
return NULL;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions drivers/dma/qcom/gpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,15 +1416,15 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements,
len = 1 << bit;
ring->alloc_size = (len + (len - 1));
dev_dbg(gpii->gpi_dev->dev,
"#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%lu\n",
"#el:%u el_size:%u len:%u actual_len:%llu alloc_size:%zu\n",
elements, el_size, (elements * el_size), len,
ring->alloc_size);

ring->pre_aligned = dma_alloc_coherent(gpii->gpi_dev->dev,
ring->alloc_size,
&ring->dma_handle, GFP_KERNEL);
if (!ring->pre_aligned) {
dev_err(gpii->gpi_dev->dev, "could not alloc size:%lu mem for ring\n",
dev_err(gpii->gpi_dev->dev, "could not alloc size:%zu mem for ring\n",
ring->alloc_size);
return -ENOMEM;
}
Expand All @@ -1444,8 +1444,8 @@ static int gpi_alloc_ring(struct gpi_ring *ring, u32 elements,
smp_wmb();

dev_dbg(gpii->gpi_dev->dev,
"phy_pre:0x%0llx phy_alig:0x%0llx len:%u el_size:%u elements:%u\n",
ring->dma_handle, ring->phys_addr, ring->len,
"phy_pre:%pad phy_alig:%pa len:%u el_size:%u elements:%u\n",
&ring->dma_handle, &ring->phys_addr, ring->len,
ring->el_size, ring->elements);

return 0;
Expand Down Expand Up @@ -1948,7 +1948,7 @@ static int gpi_ch_init(struct gchan *gchan)
return ret;

error_start_chan:
for (i = i - 1; i >= 0; i++) {
for (i = i - 1; i >= 0; i--) {
gpi_stop_chan(&gpii->gchan[i]);
gpi_send_cmd(gpii, gchan, GPI_CH_CMD_RESET);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/dma/stm32-mdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
#define STM32_MDMA_MAX_CHANNELS 63
#define STM32_MDMA_MAX_REQUESTS 256
#define STM32_MDMA_MAX_BURST 128
#define STM32_MDMA_VERY_HIGH_PRIORITY 0x11
#define STM32_MDMA_VERY_HIGH_PRIORITY 0x3

enum stm32_mdma_trigger_mode {
STM32_MDMA_BUFFER,
Expand Down
6 changes: 3 additions & 3 deletions drivers/dma/ti/k3-udma.c
Original file line number Diff line number Diff line change
Expand Up @@ -4698,9 +4698,9 @@ static int pktdma_setup_resources(struct udma_dev *ud)
ud->tchan_tpl.levels = 1;
}

ud->tchan_tpl.levels = ud->tchan_tpl.levels;
ud->tchan_tpl.start_idx[0] = ud->tchan_tpl.start_idx[0];
ud->tchan_tpl.start_idx[1] = ud->tchan_tpl.start_idx[1];
ud->rchan_tpl.levels = ud->tchan_tpl.levels;
ud->rchan_tpl.start_idx[0] = ud->tchan_tpl.start_idx[0];
ud->rchan_tpl.start_idx[1] = ud->tchan_tpl.start_idx[1];

ud->tchan_map = devm_kmalloc_array(dev, BITS_TO_LONGS(ud->tchan_cnt),
sizeof(unsigned long), GFP_KERNEL);
Expand Down
11 changes: 8 additions & 3 deletions drivers/dma/xilinx/xilinx_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -2781,7 +2781,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
has_dre = false;

if (!has_dre)
xdev->common.copy_align = fls(width - 1);
xdev->common.copy_align = (enum dmaengine_alignment)fls(width - 1);

if (of_device_is_compatible(node, "xlnx,axi-vdma-mm2s-channel") ||
of_device_is_compatible(node, "xlnx,axi-dma-mm2s-channel") ||
Expand Down Expand Up @@ -2900,7 +2900,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
static int xilinx_dma_child_probe(struct xilinx_dma_device *xdev,
struct device_node *node)
{
int ret, i, nr_channels = 1;
int ret, i;
u32 nr_channels = 1;

ret = of_property_read_u32(node, "dma-channels", &nr_channels);
if (xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA && ret < 0)
Expand Down Expand Up @@ -3112,7 +3113,11 @@ static int xilinx_dma_probe(struct platform_device *pdev)
}

/* Register the DMA engine with the core */
dma_async_device_register(&xdev->common);
err = dma_async_device_register(&xdev->common);
if (err) {
dev_err(xdev->dev, "failed to register the dma device\n");
goto error;
}

err = of_dma_controller_register(node, of_dma_xilinx_xlate,
xdev);
Expand Down
3 changes: 2 additions & 1 deletion drivers/hwmon/amd_energy.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static int amd_create_sensor(struct device *dev,
*/
cpus = num_present_cpus() / num_siblings;

s_config = devm_kcalloc(dev, cpus + sockets,
s_config = devm_kcalloc(dev, cpus + sockets + 1,
sizeof(u32), GFP_KERNEL);
if (!s_config)
return -ENOMEM;
Expand Down Expand Up @@ -254,6 +254,7 @@ static int amd_create_sensor(struct device *dev,
scnprintf(label_l[i], 10, "Esocket%u", (i - cpus));
}

s_config[i] = 0;
return 0;
}

Expand Down
12 changes: 11 additions & 1 deletion drivers/hwmon/pwm-fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,18 @@ static int pwm_fan_probe(struct platform_device *pdev)

ctx->pwm_value = MAX_PWM;

/* Set duty cycle to maximum allowed and enable PWM output */
pwm_init_state(ctx->pwm, &state);
/*
* __set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned
* long. Check this here to prevent the fan running at a too low
* frequency.
*/
if (state.period > ULONG_MAX / MAX_PWM + 1) {
dev_err(dev, "Configured period too big\n");
return -EINVAL;
}

/* Set duty cycle to maximum allowed and enable PWM output */
state.duty_cycle = ctx->pwm->args.period - 1;
state.enabled = true;

Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ static int i801_add_mux(struct i801_priv *priv)

/* Register GPIO descriptor lookup table */
lookup = devm_kzalloc(dev,
struct_size(lookup, table, mux_config->n_gpios),
struct_size(lookup, table, mux_config->n_gpios + 1),
GFP_KERNEL);
if (!lookup)
return -ENOMEM;
Expand Down
27 changes: 22 additions & 5 deletions drivers/i2c/busses/i2c-mt65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
#define I2C_IO_CONFIG_OPEN_DRAIN 0x0003
#define I2C_IO_CONFIG_PUSH_PULL 0x0000
#define I2C_SOFT_RST 0x0001
#define I2C_HANDSHAKE_RST 0x0020
#define I2C_FIFO_ADDR_CLR 0x0001
#define I2C_DELAY_LEN 0x0002
#define I2C_TIME_CLR_VALUE 0x0000
#define I2C_TIME_DEFAULT_VALUE 0x0003
#define I2C_WRRD_TRANAC_VALUE 0x0002
#define I2C_RD_TRANAC_VALUE 0x0001
#define I2C_SCL_MIS_COMP_VALUE 0x0000
#define I2C_CHN_CLR_FLAG 0x0000

#define I2C_DMA_CON_TX 0x0000
#define I2C_DMA_CON_RX 0x0001
Expand All @@ -54,7 +56,9 @@
#define I2C_DMA_START_EN 0x0001
#define I2C_DMA_INT_FLAG_NONE 0x0000
#define I2C_DMA_CLR_FLAG 0x0000
#define I2C_DMA_WARM_RST 0x0001
#define I2C_DMA_HARD_RST 0x0002
#define I2C_DMA_HANDSHAKE_RST 0x0004

#define MAX_SAMPLE_CNT_DIV 8
#define MAX_STEP_CNT_DIV 64
Expand Down Expand Up @@ -475,11 +479,24 @@ static void mtk_i2c_init_hw(struct mtk_i2c *i2c)
{
u16 control_reg;

writel(I2C_DMA_HARD_RST, i2c->pdmabase + OFFSET_RST);
udelay(50);
writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);

mtk_i2c_writew(i2c, I2C_SOFT_RST, OFFSET_SOFTRESET);
if (i2c->dev_comp->dma_sync) {
writel(I2C_DMA_WARM_RST, i2c->pdmabase + OFFSET_RST);
udelay(10);
writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
udelay(10);
writel(I2C_DMA_HANDSHAKE_RST | I2C_DMA_HARD_RST,
i2c->pdmabase + OFFSET_RST);
mtk_i2c_writew(i2c, I2C_HANDSHAKE_RST | I2C_SOFT_RST,
OFFSET_SOFTRESET);
udelay(10);
writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
mtk_i2c_writew(i2c, I2C_CHN_CLR_FLAG, OFFSET_SOFTRESET);
} else {
writel(I2C_DMA_HARD_RST, i2c->pdmabase + OFFSET_RST);
udelay(50);
writel(I2C_DMA_CLR_FLAG, i2c->pdmabase + OFFSET_RST);
mtk_i2c_writew(i2c, I2C_SOFT_RST, OFFSET_SOFTRESET);
}

/* Set ioconfig */
if (i2c->use_push_pull)
Expand Down
8 changes: 7 additions & 1 deletion drivers/i2c/busses/i2c-sprd.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@

/* timeout (ms) for pm runtime autosuspend */
#define SPRD_I2C_PM_TIMEOUT 1000
/* timeout (ms) for transfer message */
#define I2C_XFER_TIMEOUT 1000

/* SPRD i2c data structure */
struct sprd_i2c {
Expand Down Expand Up @@ -244,6 +246,7 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap,
struct i2c_msg *msg, bool is_last_msg)
{
struct sprd_i2c *i2c_dev = i2c_adap->algo_data;
unsigned long time_left;

i2c_dev->msg = msg;
i2c_dev->buf = msg->buf;
Expand Down Expand Up @@ -273,7 +276,10 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap,

sprd_i2c_opt_start(i2c_dev);

wait_for_completion(&i2c_dev->complete);
time_left = wait_for_completion_timeout(&i2c_dev->complete,
msecs_to_jiffies(I2C_XFER_TIMEOUT));
if (!time_left)
return -ETIMEDOUT;

return i2c_dev->err;
}
Expand Down