kernel: bump 5.15 to 5.15.139

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.139

Removed upstreamed:
	x86/patches-5.15/120-hwrng-geode-fix-accessing-registers.patch[3]

All other patches automatically rebased.

3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.139&id=a5c83c8043d70b9a28d1bd78a2dbbab340f43889

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
[Refresh on top of OpenWrt 23.05]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit df167450a5)
This commit is contained in:
John Audia
2023-11-20 08:23:17 -05:00
committed by Hauke Mehrtens
parent d6b62611b8
commit 95ebd609ae
16 changed files with 41 additions and 88 deletions

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .138 LINUX_VERSION-5.15 = .139
LINUX_KERNEL_HASH-5.15.138 = af84e54164e1c01f59764ba528448ed36b377d22aafbd81b4b0cf47792ef4aaa LINUX_KERNEL_HASH-5.15.139 = 9c68c10dfe18e59b892e940436dea6a18d167160d55e62563cf7282244d8044e

View File

@@ -414,7 +414,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
/* forking complete and child started to run, tell ptracer */ /* forking complete and child started to run, tell ptracer */
--- a/kernel/sched/core.c --- a/kernel/sched/core.c
+++ b/kernel/sched/core.c +++ b/kernel/sched/core.c
@@ -5010,6 +5010,7 @@ context_switch(struct rq *rq, struct tas @@ -5014,6 +5014,7 @@ context_switch(struct rq *rq, struct tas
* finish_task_switch()'s mmdrop(). * finish_task_switch()'s mmdrop().
*/ */
switch_mm_irqs_off(prev->active_mm, next->mm, next); switch_mm_irqs_off(prev->active_mm, next->mm, next);

View File

@@ -37,7 +37,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8); map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8);
map->format.buf_size = DIV_ROUND_UP(config->reg_bits + map->format.buf_size = DIV_ROUND_UP(config->reg_bits +
config->val_bits + config->pad_bits, 8); config->val_bits + config->pad_bits, 8);
@@ -1735,6 +1736,7 @@ static int _regmap_raw_write_impl(struct @@ -1737,6 +1738,7 @@ static int _regmap_raw_write_impl(struct
return ret; return ret;
} }
@@ -45,7 +45,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.format_reg(map->work_buf, reg, map->reg_shift); map->format.format_reg(map->work_buf, reg, map->reg_shift);
regmap_set_work_buf_flag_mask(map, map->format.reg_bytes, regmap_set_work_buf_flag_mask(map, map->format.reg_bytes,
map->write_flag_mask); map->write_flag_mask);
@@ -1905,6 +1907,7 @@ static int _regmap_bus_formatted_write(v @@ -1907,6 +1909,7 @@ static int _regmap_bus_formatted_write(v
return ret; return ret;
} }
@@ -53,7 +53,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.format_write(map, reg, val); map->format.format_write(map, reg, val);
trace_regmap_hw_write_start(map, reg, 1); trace_regmap_hw_write_start(map, reg, 1);
@@ -2346,6 +2349,7 @@ static int _regmap_raw_multi_reg_write(s @@ -2348,6 +2351,7 @@ static int _regmap_raw_multi_reg_write(s
unsigned int reg = regs[i].reg; unsigned int reg = regs[i].reg;
unsigned int val = regs[i].def; unsigned int val = regs[i].def;
trace_regmap_hw_write_start(map, reg, 1); trace_regmap_hw_write_start(map, reg, 1);
@@ -61,7 +61,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.format_reg(u8, reg, map->reg_shift); map->format.format_reg(u8, reg, map->reg_shift);
u8 += reg_bytes + pad_bytes; u8 += reg_bytes + pad_bytes;
map->format.format_val(u8, val, 0); map->format.format_val(u8, val, 0);
@@ -2673,6 +2677,7 @@ static int _regmap_raw_read(struct regma @@ -2675,6 +2679,7 @@ static int _regmap_raw_read(struct regma
return ret; return ret;
} }

View File

@@ -42,7 +42,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8); map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8);
map->format.pad_bytes = config->pad_bits / 8; map->format.pad_bytes = config->pad_bits / 8;
map->format.reg_downshift = config->reg_downshift; map->format.reg_downshift = config->reg_downshift;
@@ -1736,6 +1738,7 @@ static int _regmap_raw_write_impl(struct @@ -1738,6 +1740,7 @@ static int _regmap_raw_write_impl(struct
return ret; return ret;
} }
@@ -50,7 +50,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
reg >>= map->format.reg_downshift; reg >>= map->format.reg_downshift;
map->format.format_reg(map->work_buf, reg, map->reg_shift); map->format.format_reg(map->work_buf, reg, map->reg_shift);
regmap_set_work_buf_flag_mask(map, map->format.reg_bytes, regmap_set_work_buf_flag_mask(map, map->format.reg_bytes,
@@ -1907,6 +1910,7 @@ static int _regmap_bus_formatted_write(v @@ -1909,6 +1912,7 @@ static int _regmap_bus_formatted_write(v
return ret; return ret;
} }
@@ -58,7 +58,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
reg >>= map->format.reg_downshift; reg >>= map->format.reg_downshift;
map->format.format_write(map, reg, val); map->format.format_write(map, reg, val);
@@ -2349,6 +2353,7 @@ static int _regmap_raw_multi_reg_write(s @@ -2351,6 +2355,7 @@ static int _regmap_raw_multi_reg_write(s
unsigned int reg = regs[i].reg; unsigned int reg = regs[i].reg;
unsigned int val = regs[i].def; unsigned int val = regs[i].def;
trace_regmap_hw_write_start(map, reg, 1); trace_regmap_hw_write_start(map, reg, 1);
@@ -66,7 +66,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
reg >>= map->format.reg_downshift; reg >>= map->format.reg_downshift;
map->format.format_reg(u8, reg, map->reg_shift); map->format.format_reg(u8, reg, map->reg_shift);
u8 += reg_bytes + pad_bytes; u8 += reg_bytes + pad_bytes;
@@ -2677,6 +2682,7 @@ static int _regmap_raw_read(struct regma @@ -2679,6 +2684,7 @@ static int _regmap_raw_read(struct regma
return ret; return ret;
} }

View File

@@ -28,7 +28,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
--- a/drivers/base/regmap/regmap.c --- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c
@@ -1929,6 +1929,8 @@ static int _regmap_bus_reg_write(void *c @@ -1931,6 +1931,8 @@ static int _regmap_bus_reg_write(void *c
{ {
struct regmap *map = context; struct regmap *map = context;
@@ -37,7 +37,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
return map->bus->reg_write(map->bus_context, reg, val); return map->bus->reg_write(map->bus_context, reg, val);
} }
@@ -2703,6 +2705,8 @@ static int _regmap_bus_reg_read(void *co @@ -2705,6 +2707,8 @@ static int _regmap_bus_reg_read(void *co
{ {
struct regmap *map = context; struct regmap *map = context;
@@ -46,7 +46,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
return map->bus->reg_read(map->bus_context, reg, val); return map->bus->reg_read(map->bus_context, reg, val);
} }
@@ -3078,6 +3082,8 @@ static int _regmap_update_bits(struct re @@ -3080,6 +3084,8 @@ static int _regmap_update_bits(struct re
*change = false; *change = false;
if (regmap_volatile(map, reg) && map->reg_update_bits) { if (regmap_volatile(map, reg) && map->reg_update_bits) {

View File

@@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/property.h> #include <linux/property.h>
@@ -3358,3 +3359,5 @@ static int __init regmap_initcall(void) @@ -3360,3 +3361,5 @@ static int __init regmap_initcall(void)
return 0; return 0;
} }
postcore_initcall(regmap_initcall); postcore_initcall(regmap_initcall);

View File

@@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c --- a/kernel/sched/core.c
+++ b/kernel/sched/core.c +++ b/kernel/sched/core.c
@@ -4216,6 +4216,7 @@ int wake_up_state(struct task_struct *p, @@ -4220,6 +4220,7 @@ int wake_up_state(struct task_struct *p,
{ {
return try_to_wake_up(p, state, 0); return try_to_wake_up(p, state, 0);
} }

View File

@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/nf_tables_api.c --- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c
@@ -7707,7 +7707,7 @@ static int nft_register_flowtable_net_ho @@ -7703,7 +7703,7 @@ static int nft_register_flowtable_net_ho
err = flowtable->data.type->setup(&flowtable->data, err = flowtable->data.type->setup(&flowtable->data,
hook->ops.dev, hook->ops.dev,
FLOW_BLOCK_BIND); FLOW_BLOCK_BIND);

View File

@@ -15,7 +15,7 @@ Link: https://lore.kernel.org/r/20220515210048.483898-9-robimarko@gmail.com
--- a/drivers/clk/qcom/Kconfig --- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig
@@ -166,6 +166,7 @@ config IPQ_LCC_806X @@ -167,6 +167,7 @@ config IPQ_LCC_806X
config IPQ_GCC_8074 config IPQ_GCC_8074
tristate "IPQ8074 Global Clock Controller" tristate "IPQ8074 Global Clock Controller"

View File

@@ -35,7 +35,7 @@ Link: https://lore.kernel.org/r/20220818220628.339366-1-robimarko@gmail.com
extern const struct clk_ops clk_byte2_ops; extern const struct clk_ops clk_byte2_ops;
--- a/drivers/clk/qcom/clk-rcg2.c --- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c
@@ -477,6 +477,13 @@ const struct clk_ops clk_rcg2_floor_ops @@ -471,6 +471,13 @@ const struct clk_ops clk_rcg2_floor_ops
}; };
EXPORT_SYMBOL_GPL(clk_rcg2_floor_ops); EXPORT_SYMBOL_GPL(clk_rcg2_floor_ops);

View File

@@ -110,7 +110,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
static int update_config(struct clk_rcg2 *rcg) static int update_config(struct clk_rcg2 *rcg)
{ {
int count, ret; int count, ret;
@@ -164,12 +174,10 @@ calc_rate(unsigned long rate, u32 m, u32 @@ -158,12 +168,10 @@ calc_rate(unsigned long rate, u32 m, u32
} }
static unsigned long static unsigned long
@@ -125,7 +125,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
if (rcg->mnd_width) { if (rcg->mnd_width) {
mask = BIT(rcg->mnd_width) - 1; mask = BIT(rcg->mnd_width) - 1;
@@ -190,6 +198,17 @@ clk_rcg2_recalc_rate(struct clk_hw *hw, @@ -184,6 +192,17 @@ clk_rcg2_recalc_rate(struct clk_hw *hw,
return calc_rate(parent_rate, m, n, mode, hid_div); return calc_rate(parent_rate, m, n, mode, hid_div);
} }
@@ -143,7 +143,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
static int _freq_tbl_determine_rate(struct clk_hw *hw, const struct freq_tbl *f, static int _freq_tbl_determine_rate(struct clk_hw *hw, const struct freq_tbl *f,
struct clk_rate_request *req, struct clk_rate_request *req,
enum freq_policy policy) enum freq_policy policy)
@@ -263,7 +282,8 @@ static int clk_rcg2_determine_floor_rate @@ -257,7 +276,8 @@ static int clk_rcg2_determine_floor_rate
return _freq_tbl_determine_rate(hw, rcg->freq_tbl, req, FLOOR); return _freq_tbl_determine_rate(hw, rcg->freq_tbl, req, FLOOR);
} }
@@ -153,7 +153,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
{ {
u32 cfg, mask, d_val, not2d_val, n_minus_m; u32 cfg, mask, d_val, not2d_val, n_minus_m;
struct clk_hw *hw = &rcg->clkr.hw; struct clk_hw *hw = &rcg->clkr.hw;
@@ -305,15 +325,27 @@ static int __clk_rcg2_configure(struct c @@ -299,15 +319,27 @@ static int __clk_rcg2_configure(struct c
cfg |= rcg->parent_map[index].cfg << CFG_SRC_SEL_SHIFT; cfg |= rcg->parent_map[index].cfg << CFG_SRC_SEL_SHIFT;
if (rcg->mnd_width && f->n && (f->m != f->n)) if (rcg->mnd_width && f->n && (f->m != f->n))
cfg |= CFG_MODE_DUAL_EDGE; cfg |= CFG_MODE_DUAL_EDGE;
@@ -184,7 +184,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
if (ret) if (ret)
return ret; return ret;
@@ -994,11 +1026,12 @@ static int clk_rcg2_shared_set_rate(stru @@ -988,11 +1020,12 @@ static int clk_rcg2_shared_set_rate(stru
return -EINVAL; return -EINVAL;
/* /*
@@ -201,7 +201,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
return clk_rcg2_shared_force_enable_clear(hw, f); return clk_rcg2_shared_force_enable_clear(hw, f);
} }
@@ -1022,6 +1055,11 @@ static int clk_rcg2_shared_enable(struct @@ -1016,6 +1049,11 @@ static int clk_rcg2_shared_enable(struct
if (ret) if (ret)
return ret; return ret;
@@ -213,7 +213,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
ret = update_config(rcg); ret = update_config(rcg);
if (ret) if (ret)
return ret; return ret;
@@ -1032,13 +1070,12 @@ static int clk_rcg2_shared_enable(struct @@ -1026,13 +1064,12 @@ static int clk_rcg2_shared_enable(struct
static void clk_rcg2_shared_disable(struct clk_hw *hw) static void clk_rcg2_shared_disable(struct clk_hw *hw)
{ {
struct clk_rcg2 *rcg = to_clk_rcg2(hw); struct clk_rcg2 *rcg = to_clk_rcg2(hw);
@@ -228,7 +228,7 @@ Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.
/* /*
* Park the RCG at a safe configuration - sourced off of safe source. * Park the RCG at a safe configuration - sourced off of safe source.
@@ -1056,17 +1093,52 @@ static void clk_rcg2_shared_disable(stru @@ -1050,17 +1087,52 @@ static void clk_rcg2_shared_disable(stru
update_config(rcg); update_config(rcg);
clk_rcg2_clear_force_enable(hw); clk_rcg2_clear_force_enable(hw);

View File

@@ -64,7 +64,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
/** /**
--- a/drivers/clk/qcom/clk-rcg2.c --- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c
@@ -209,11 +209,60 @@ clk_rcg2_recalc_rate(struct clk_hw *hw, @@ -203,11 +203,60 @@ clk_rcg2_recalc_rate(struct clk_hw *hw,
return __clk_rcg2_recalc_rate(hw, parent_rate, cfg); return __clk_rcg2_recalc_rate(hw, parent_rate, cfg);
} }
@@ -125,7 +125,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
struct clk_hw *p; struct clk_hw *p;
struct clk_rcg2 *rcg = to_clk_rcg2(hw); struct clk_rcg2 *rcg = to_clk_rcg2(hw);
int index; int index;
@@ -232,7 +281,15 @@ static int _freq_tbl_determine_rate(stru @@ -226,7 +275,15 @@ static int _freq_tbl_determine_rate(stru
if (!f) if (!f)
return -EINVAL; return -EINVAL;
@@ -142,7 +142,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
if (index < 0) if (index < 0)
return index; return index;
@@ -242,18 +299,18 @@ static int _freq_tbl_determine_rate(stru @@ -236,18 +293,18 @@ static int _freq_tbl_determine_rate(stru
return -EINVAL; return -EINVAL;
if (clk_flags & CLK_SET_RATE_PARENT) { if (clk_flags & CLK_SET_RATE_PARENT) {
@@ -167,7 +167,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
rate = tmp; rate = tmp;
} }
} else { } else {
@@ -261,7 +318,7 @@ static int _freq_tbl_determine_rate(stru @@ -255,7 +312,7 @@ static int _freq_tbl_determine_rate(stru
} }
req->best_parent_hw = p; req->best_parent_hw = p;
req->best_parent_rate = rate; req->best_parent_rate = rate;
@@ -176,7 +176,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
return 0; return 0;
} }
@@ -357,6 +414,7 @@ static int __clk_rcg2_set_rate(struct cl @@ -351,6 +408,7 @@ static int __clk_rcg2_set_rate(struct cl
{ {
struct clk_rcg2 *rcg = to_clk_rcg2(hw); struct clk_rcg2 *rcg = to_clk_rcg2(hw);
const struct freq_tbl *f; const struct freq_tbl *f;
@@ -184,7 +184,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
switch (policy) { switch (policy) {
case FLOOR: case FLOOR:
@@ -372,7 +430,15 @@ static int __clk_rcg2_set_rate(struct cl @@ -366,7 +424,15 @@ static int __clk_rcg2_set_rate(struct cl
if (!f) if (!f)
return -EINVAL; return -EINVAL;

View File

@@ -54,9 +54,9 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the
--- a/drivers/leds/leds-turris-omnia.c --- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c +++ b/drivers/leds/leds-turris-omnia.c
@@ -41,6 +41,39 @@ struct omnia_leds { @@ -72,6 +72,39 @@ static int omnia_cmd_read_u8(const struc
struct omnia_led leds[]; return -EIO;
}; }
+static struct led_hw_trigger_type omnia_hw_trigger_type; +static struct led_hw_trigger_type omnia_hw_trigger_type;
+ +
@@ -94,7 +94,7 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
static int omnia_led_brightness_set_blocking(struct led_classdev *cdev, static int omnia_led_brightness_set_blocking(struct led_classdev *cdev,
enum led_brightness brightness) enum led_brightness brightness)
{ {
@@ -112,6 +145,8 @@ static int omnia_led_register(struct i2c @@ -143,6 +176,8 @@ static int omnia_led_register(struct i2c
cdev = &led->mc_cdev.led_cdev; cdev = &led->mc_cdev.led_cdev;
cdev->max_brightness = 255; cdev->max_brightness = 255;
cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; cdev->brightness_set_blocking = omnia_led_brightness_set_blocking;
@@ -102,8 +102,8 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
+ cdev->default_trigger = omnia_hw_trigger.name; + cdev->default_trigger = omnia_hw_trigger.name;
/* put the LED into software mode */ /* put the LED into software mode */
ret = i2c_smbus_write_byte_data(client, CMD_LED_MODE, ret = omnia_cmd_write_u8(client, CMD_LED_MODE,
@@ -228,6 +263,12 @@ static int omnia_leds_probe(struct i2c_c @@ -249,6 +284,12 @@ static int omnia_leds_probe(struct i2c_c
mutex_init(&leds->lock); mutex_init(&leds->lock);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
--- a/drivers/leds/leds-turris-omnia.c --- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c +++ b/drivers/leds/leds-turris-omnia.c
@@ -131,10 +131,13 @@ static int omnia_led_register(struct i2c @@ -162,10 +162,13 @@ static int omnia_led_register(struct i2c
} }
led->subled_info[0].color_index = LED_COLOR_ID_RED; led->subled_info[0].color_index = LED_COLOR_ID_RED;

View File

@@ -20,7 +20,7 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
--- a/drivers/leds/leds-turris-omnia.c --- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c +++ b/drivers/leds/leds-turris-omnia.c
@@ -146,7 +146,7 @@ static int omnia_led_register(struct i2c @@ -177,7 +177,7 @@ static int omnia_led_register(struct i2c
init_data.fwnode = &np->fwnode; init_data.fwnode = &np->fwnode;
cdev = &led->mc_cdev.led_cdev; cdev = &led->mc_cdev.led_cdev;

View File

@@ -1,47 +0,0 @@
From 859bd2e0c0052967536f3f902716f204d5a978b1 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Fri, 8 Sep 2023 22:48:33 +0200
Subject: [PATCH] hwrng: geode: fix accessing registers
When the membase and pci_dev pointer were moved to a new struct in priv,
the actual membase users were left untouched, and they started reading
out arbitrary memory behind the struct instead of registers. This
unfortunately turned the RNG into a constant number generator, depending
on the content of what was at that offset.
To fix this, update geode_rng_data_{read,present}() to also get the
membase via amd_geode_priv, and properly read from the right addresses
again.
Fixes: 9f6ec8dc574e ("hwrng: geode - Fix PCI device refcount leak")
Reported-by: Timur I. Davletshin <timur.davletshin@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217882
Tested-by: Timur I. Davletshin <timur.davletshin@gmail.com>
Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
drivers/char/hw_random/geode-rng.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/char/hw_random/geode-rng.c
+++ b/drivers/char/hw_random/geode-rng.c
@@ -58,7 +58,8 @@ struct amd_geode_priv {
static int geode_rng_data_read(struct hwrng *rng, u32 *data)
{
- void __iomem *mem = (void __iomem *)rng->priv;
+ struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv;
+ void __iomem *mem = priv->membase;
*data = readl(mem + GEODE_RNG_DATA_REG);
@@ -67,7 +68,8 @@ static int geode_rng_data_read(struct hw
static int geode_rng_data_present(struct hwrng *rng, int wait)
{
- void __iomem *mem = (void __iomem *)rng->priv;
+ struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv;
+ void __iomem *mem = priv->membase;
int data, i;
for (i = 0; i < 20; i++) {