mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
media: atomisp: Fix namespace collision and startup() section placement with -ffunction-sections
When compiling the kernel with -ffunction-sections (e.g., for LTO,
livepatch, dead code elimination, AutoFDO, or Propeller), the startup()
function gets compiled into the .text.startup section. In some cases it
can even be cloned into .text.startup.constprop.0 or
.text.startup.isra.0.
However, the .text.startup and .text.startup.* section names are already
reserved for use by the compiler for __attribute__((constructor)) code.
This naming conflict causes the vmlinux linker script to wrongly place
startup() function code in .init.text, which gets freed during boot.
Fix that by renaming startup() to ov2722_startup().
Fixes: 6568f14cb5 ("vmlinux.lds: Exclude .text.startup and .text.exit from TEXT_MAIN")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: live-patching@vger.kernel.org
Cc: Hans de Goede <hansg@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/bf8cd823a3f11f64cc82167913be5013c72afa57.1762991150.git.jpoimboe@kernel.org
This commit is contained in:
committed by
Ingo Molnar
parent
f6a8919d61
commit
56255fa968
@@ -600,7 +600,7 @@ static int ov2722_s_power(struct v4l2_subdev *sd, int on)
|
||||
}
|
||||
|
||||
/* TODO: remove it. */
|
||||
static int startup(struct v4l2_subdev *sd)
|
||||
static int ov2722_startup(struct v4l2_subdev *sd)
|
||||
{
|
||||
struct ov2722_device *dev = to_ov2722_sensor(sd);
|
||||
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||
@@ -662,7 +662,7 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd,
|
||||
dev->pixels_per_line = dev->res->pixels_per_line;
|
||||
dev->lines_per_frame = dev->res->lines_per_frame;
|
||||
|
||||
ret = startup(sd);
|
||||
ret = ov2722_startup(sd);
|
||||
if (ret) {
|
||||
int i = 0;
|
||||
|
||||
@@ -677,7 +677,7 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd,
|
||||
dev_err(&client->dev, "power up failed, continue\n");
|
||||
continue;
|
||||
}
|
||||
ret = startup(sd);
|
||||
ret = ov2722_startup(sd);
|
||||
if (ret) {
|
||||
dev_err(&client->dev, " startup FAILED!\n");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user