Skip to content

Commit

Permalink
Merge tag 'v5.15.152' into 5.15-main
Browse files Browse the repository at this point in the history
Linux 5.15.152

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEE4n5dijQDou9mhzu83qZv95d3LNwFAmX0mqEACgkQ3qZv95d3
# LNzF+hAAm9dD6uNAB7FK37+O6HLmzBDlWSayII2VsO6DPhBz/ZcVAyoIxJa768sM
# SvRbs2qT8z/+oUo8libZ0nIMqsw72OSSnEBbpMZOK5WLtxALZQDlFGzMpbM3FQ9L
# tv3bWrzhfjrM8+pwMuZ8659o7W8nu61rqvWH/w8F6ayL55WisY2iRBB77zdvfh74
# 89Y370DmgS6kC9CXVt3ySkIq2WdSFk5Jwf8lg23JjcVsS+MUNOM4WHsHHLNJH8GG
# ND3E3Q9C5IEPF9GACB+qhtux1gZky3h5iAIpWPq6LSwElAd+myY8IG8oVC5SqGz7
# WXsc3ra2zo1GyZCBy12iKhcZRFjJho40usOZYnqiIkAyPgcIKqw21TDn5sRMj0eb
# KIpTbN4H4kZxhiDmmyzaEPhYXSxFr/AFDQJH1mXHUSP8AILmNzcMtHNzkMJy0io+
# ceQlWLxWR8pq3hxA2tQ0RtVufue6Ju7m8nhtHAf6Cdd943OmQMq7d7qZ0TPS1E7T
# S+biWgmEKeqM7oV7F0N9AMh6vCIvzLRN6meYO2wF54uxMsgLuY3IZp6fehtUzWGw
# 4Ki+30UAHxXArOkBdPHr4MD4ek8l0EyjqImbrIvby9GEHTfbhh6TvWyBAc9iXzzc
# CUiofRyq9o8GGGq/ixVSbYE/dzu4VSJXVTMgCOKh1eCKjDhBGCo=
# =uG5x
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri Mar 15 19:59:45 2024 CET
# gpg:                using RSA key E27E5D8A3403A2EF66873BBCDEA66FF797772CDC
# gpg: Can't check signature: No public key
  • Loading branch information
frank-w committed Apr 20, 2024
2 parents d3ae3d1 + b95c01a commit b37473b
Show file tree
Hide file tree
Showing 76 changed files with 957 additions and 469 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 15
SUBLEVEL = 151
SUBLEVEL = 152
EXTRAVERSION =
NAME = Trick or Treat

Expand Down
4 changes: 4 additions & 0 deletions drivers/base/regmap/internal.h
Expand Up @@ -108,6 +108,10 @@ struct regmap {
int (*reg_write)(void *context, unsigned int reg, unsigned int val);
int (*reg_update_bits)(void *context, unsigned int reg,
unsigned int mask, unsigned int val);
/* Bulk read/write */
int (*read)(void *context, const void *reg_buf, size_t reg_size,
void *val_buf, size_t val_size);
int (*write)(void *context, const void *data, size_t count);

bool defer_caching;

Expand Down
77 changes: 41 additions & 36 deletions drivers/base/regmap/regmap.c
Expand Up @@ -835,12 +835,15 @@ struct regmap *__regmap_init(struct device *dev,
map->reg_stride_order = ilog2(map->reg_stride);
else
map->reg_stride_order = -1;
map->use_single_read = config->use_single_read || !bus || !bus->read;
map->use_single_write = config->use_single_write || !bus || !bus->write;
map->can_multi_write = config->can_multi_write && bus && bus->write;
map->use_single_read = config->use_single_read || !(config->read || (bus && bus->read));
map->use_single_write = config->use_single_write || !(config->write || (bus && bus->write));
map->can_multi_write = config->can_multi_write && (config->write || (bus && bus->write));
if (bus) {
map->max_raw_read = bus->max_raw_read;
map->max_raw_write = bus->max_raw_write;
} else if (config->max_raw_read && config->max_raw_write) {
map->max_raw_read = config->max_raw_read;
map->max_raw_write = config->max_raw_write;
}
map->dev = dev;
map->bus = bus;
Expand Down Expand Up @@ -874,9 +877,19 @@ struct regmap *__regmap_init(struct device *dev,
map->read_flag_mask = bus->read_flag_mask;
}

if (!bus) {
if (config && config->read && config->write) {
map->reg_read = _regmap_bus_read;

/* Bulk read/write */
map->read = config->read;
map->write = config->write;

reg_endian = REGMAP_ENDIAN_NATIVE;
val_endian = REGMAP_ENDIAN_NATIVE;
} else if (!bus) {
map->reg_read = config->reg_read;
map->reg_write = config->reg_write;
map->reg_update_bits = config->reg_update_bits;

map->defer_caching = false;
goto skip_format_initialization;
Expand All @@ -890,10 +903,13 @@ struct regmap *__regmap_init(struct device *dev,
} else {
map->reg_read = _regmap_bus_read;
map->reg_update_bits = bus->reg_update_bits;
}
/* Bulk read/write */
map->read = bus->read;
map->write = bus->write;

reg_endian = regmap_get_reg_endian(bus, config);
val_endian = regmap_get_val_endian(dev, bus, config);
reg_endian = regmap_get_reg_endian(bus, config);
val_endian = regmap_get_val_endian(dev, bus, config);
}

switch (config->reg_bits + map->reg_shift) {
case 2:
Expand Down Expand Up @@ -1667,8 +1683,6 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
size_t len;
int i;

WARN_ON(!map->bus);

/* Check for unwritable or noinc registers in range
* before we start
*/
Expand Down Expand Up @@ -1750,7 +1764,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
val = work_val;
}

if (map->async && map->bus->async_write) {
if (map->async && map->bus && map->bus->async_write) {
struct regmap_async *async;

trace_regmap_async_write_start(map, reg, val_len);
Expand Down Expand Up @@ -1818,10 +1832,10 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
* write.
*/
if (val == work_val)
ret = map->bus->write(map->bus_context, map->work_buf,
map->format.reg_bytes +
map->format.pad_bytes +
val_len);
ret = map->write(map->bus_context, map->work_buf,
map->format.reg_bytes +
map->format.pad_bytes +
val_len);
else if (map->bus->gather_write)
ret = map->bus->gather_write(map->bus_context, map->work_buf,
map->format.reg_bytes +
Expand All @@ -1840,7 +1854,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
memcpy(buf, map->work_buf, map->format.reg_bytes);
memcpy(buf + map->format.reg_bytes + map->format.pad_bytes,
val, val_len);
ret = map->bus->write(map->bus_context, buf, len);
ret = map->write(map->bus_context, buf, len);

kfree(buf);
} else if (ret != 0 && !map->cache_bypass && map->format.parse_val) {
Expand Down Expand Up @@ -1897,7 +1911,7 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg,
struct regmap_range_node *range;
struct regmap *map = context;

WARN_ON(!map->bus || !map->format.format_write);
WARN_ON(!map->format.format_write);

range = _regmap_range_lookup(map, reg);
if (range) {
Expand All @@ -1910,8 +1924,7 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg,

trace_regmap_hw_write_start(map, reg, 1);

ret = map->bus->write(map->bus_context, map->work_buf,
map->format.buf_size);
ret = map->write(map->bus_context, map->work_buf, map->format.buf_size);

trace_regmap_hw_write_done(map, reg, 1);

Expand All @@ -1931,7 +1944,7 @@ static int _regmap_bus_raw_write(void *context, unsigned int reg,
{
struct regmap *map = context;

WARN_ON(!map->bus || !map->format.format_val);
WARN_ON(!map->format.format_val);

map->format.format_val(map->work_buf + map->format.reg_bytes
+ map->format.pad_bytes, val, 0);
Expand All @@ -1945,7 +1958,7 @@ static int _regmap_bus_raw_write(void *context, unsigned int reg,

static inline void *_regmap_map_get_context(struct regmap *map)
{
return (map->bus) ? map : map->bus_context;
return (map->bus || (!map->bus && map->read)) ? map : map->bus_context;
}

int _regmap_write(struct regmap *map, unsigned int reg,
Expand Down Expand Up @@ -2355,7 +2368,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map,
u8 = buf;
*u8 |= map->write_flag_mask;

ret = map->bus->write(map->bus_context, buf, len);
ret = map->write(map->bus_context, buf, len);

kfree(buf);

Expand Down Expand Up @@ -2661,9 +2674,7 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
struct regmap_range_node *range;
int ret;

WARN_ON(!map->bus);

if (!map->bus || !map->bus->read)
if (!map->read)
return -EINVAL;

range = _regmap_range_lookup(map, reg);
Expand All @@ -2679,9 +2690,9 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
map->read_flag_mask);
trace_regmap_hw_read_start(map, reg, val_len / map->format.val_bytes);

ret = map->bus->read(map->bus_context, map->work_buf,
map->format.reg_bytes + map->format.pad_bytes,
val, val_len);
ret = map->read(map->bus_context, map->work_buf,
map->format.reg_bytes + map->format.pad_bytes,
val, val_len);

trace_regmap_hw_read_done(map, reg, val_len / map->format.val_bytes);

Expand Down Expand Up @@ -2792,8 +2803,6 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
unsigned int v;
int ret, i;

if (!map->bus)
return -EINVAL;
if (val_len % map->format.val_bytes)
return -EINVAL;
if (!IS_ALIGNED(reg, map->reg_stride))
Expand All @@ -2808,7 +2817,7 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
size_t chunk_count, chunk_bytes;
size_t chunk_regs = val_count;

if (!map->bus->read) {
if (!map->read) {
ret = -ENOTSUPP;
goto out;
}
Expand Down Expand Up @@ -2868,7 +2877,7 @@ EXPORT_SYMBOL_GPL(regmap_raw_read);
* @val: Pointer to data buffer
* @val_len: Length of output buffer in bytes.
*
* The regmap API usually assumes that bulk bus read operations will read a
* The regmap API usually assumes that bulk read operations will read a
* range of registers. Some devices have certain registers for which a read
* operation read will read from an internal FIFO.
*
Expand All @@ -2886,10 +2895,6 @@ int regmap_noinc_read(struct regmap *map, unsigned int reg,
size_t read_len;
int ret;

if (!map->bus)
return -EINVAL;
if (!map->bus->read)
return -ENOTSUPP;
if (val_len % map->format.val_bytes)
return -EINVAL;
if (!IS_ALIGNED(reg, map->reg_stride))
Expand Down Expand Up @@ -3003,7 +3008,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
if (val_count == 0)
return -EINVAL;

if (map->bus && map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {
if (map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {
ret = regmap_raw_read(map, reg, val, val_bytes * val_count);
if (ret != 0)
return ret;
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/cik_ih.c
Expand Up @@ -204,6 +204,12 @@ static u32 cik_ih_get_wptr(struct amdgpu_device *adev,
tmp = RREG32(mmIH_RB_CNTL);
tmp |= IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
WREG32(mmIH_RB_CNTL, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp &= ~IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
WREG32(mmIH_RB_CNTL, tmp);
}
return (wptr & ih->ptr_mask);
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/cz_ih.c
Expand Up @@ -216,6 +216,11 @@ static u32 cz_ih_get_wptr(struct amdgpu_device *adev,
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32(mmIH_RB_CNTL, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
WREG32(mmIH_RB_CNTL, tmp);

out:
return (wptr & ih->ptr_mask);
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/iceland_ih.c
Expand Up @@ -215,6 +215,11 @@ static u32 iceland_ih_get_wptr(struct amdgpu_device *adev,
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32(mmIH_RB_CNTL, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
WREG32(mmIH_RB_CNTL, tmp);

out:
return (wptr & ih->ptr_mask);
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/navi10_ih.c
Expand Up @@ -447,6 +447,12 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
tmp = RREG32_NO_KIQ(ih_regs->ih_rb_cntl);
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);
out:
return (wptr & ih->ptr_mask);
}
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/si_ih.c
Expand Up @@ -119,6 +119,12 @@ static u32 si_ih_get_wptr(struct amdgpu_device *adev,
tmp = RREG32(IH_RB_CNTL);
tmp |= IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
WREG32(IH_RB_CNTL, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp &= ~IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
WREG32(IH_RB_CNTL, tmp);
}
return (wptr & ih->ptr_mask);
}
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/tonga_ih.c
Expand Up @@ -219,6 +219,12 @@ static u32 tonga_ih_get_wptr(struct amdgpu_device *adev,
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32(mmIH_RB_CNTL, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
WREG32(mmIH_RB_CNTL, tmp);

out:
return (wptr & ih->ptr_mask);
}
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/vega10_ih.c
Expand Up @@ -371,6 +371,12 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);

out:
return (wptr & ih->ptr_mask);
}
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/vega20_ih.c
Expand Up @@ -422,6 +422,12 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev,
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 1);
WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);

/* Unset the CLEAR_OVERFLOW bit immediately so new overflows
* can be detected.
*/
tmp = REG_SET_FIELD(tmp, IH_RB_CNTL, WPTR_OVERFLOW_CLEAR, 0);
WREG32_NO_KIQ(ih_regs->ih_rb_cntl, tmp);

out:
return (wptr & ih->ptr_mask);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c
Expand Up @@ -52,7 +52,7 @@ static DEFINE_PER_CPU(int, fpu_recursion_depth);
* This function tells if the code is already under FPU protection or not. A
* function that works as an API for a set of FPU operations can use this
* function for checking if the caller invoked it after DC_FP_START(). For
* example, take a look at dcn2x.c file.
* example, take a look at dcn20_fpu.c file.
*/
inline void dc_assert_fp_enabled(void)
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/display/dc/Makefile
Expand Up @@ -23,12 +23,12 @@
# Makefile for Display Core (dc) component.
#

DC_LIBS = basics bios calcs clk_mgr dce gpio irq virtual
DC_LIBS = basics bios clk_mgr dce dml gpio irq virtual

ifdef CONFIG_DRM_AMD_DC_DCN
DC_LIBS += dcn20
DC_LIBS += dsc
DC_LIBS += dcn10 dml
DC_LIBS += dcn10
DC_LIBS += dcn21
DC_LIBS += dcn30
DC_LIBS += dcn301
Expand Down

0 comments on commit b37473b

Please sign in to comment.