Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 6568f14cb5ae ("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

authored by

Josh Poimboeuf and committed by
Ingo Molnar
56255fa9 f6a8919d

+3 -3
+3 -3
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
··· 600 600 } 601 601 602 602 /* TODO: remove it. */ 603 - static int startup(struct v4l2_subdev *sd) 603 + static int ov2722_startup(struct v4l2_subdev *sd) 604 604 { 605 605 struct ov2722_device *dev = to_ov2722_sensor(sd); 606 606 struct i2c_client *client = v4l2_get_subdevdata(sd); ··· 662 662 dev->pixels_per_line = dev->res->pixels_per_line; 663 663 dev->lines_per_frame = dev->res->lines_per_frame; 664 664 665 - ret = startup(sd); 665 + ret = ov2722_startup(sd); 666 666 if (ret) { 667 667 int i = 0; 668 668 ··· 677 677 dev_err(&client->dev, "power up failed, continue\n"); 678 678 continue; 679 679 } 680 - ret = startup(sd); 680 + ret = ov2722_startup(sd); 681 681 if (ret) { 682 682 dev_err(&client->dev, " startup FAILED!\n"); 683 683 } else {