Peter Zijlstra
cdd30ebb1b
module: Convert symbol namespace to string literal
...
Clean up the existing export namespace code along the same lines of
commit 33def8498f ("treewide: Convert macro and uses of __section(foo)
to __section("foo")") and for the same reason, it is not desired for the
namespace argument to be a macro expansion itself.
Scripted using
git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
do
awk -i inplace '
/^#define EXPORT_SYMBOL_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/^#define MODULE_IMPORT_NS/ {
gsub(/__stringify\(ns\)/, "ns");
print;
next;
}
/MODULE_IMPORT_NS/ {
$0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
}
/EXPORT_SYMBOL_NS/ {
if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
$0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
$0 !~ /^my/) {
getline line;
gsub(/[[:space:]]*\\$/, "");
gsub(/[[:space:]]/, "", line);
$0 = $0 " " line;
}
$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
"\\1(\\2, \"\\3\")", "g");
}
}
{ print }' $file;
done
Requested-by: Masahiro Yamada <masahiroy@kernel.org >
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org >
Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc
Acked-by: Greg KH <gregkh@linuxfoundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2024-12-02 11:34:44 -08:00
Christophe JAILLET
733dc978fa
peci: npcm: Constify struct peci_controller_ops
...
'struct peci_controller_ops' is not modified in this driver.
Constifying this structure moves some data to a read-only section, so
increase overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig:
Before:
======
text data bss dec hex filename
8003 784 48 8835 2283 drivers/peci/controller/peci-npcm.o
After:
=====
text data bss dec hex filename
8003 776 48 8827 227b drivers/peci/controller/peci-npcm.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com >
Link: https://lore.kernel.org/r/3c7d455745c2265c19ed02f026dfc9610271d3c2.1725692376.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com >
2024-10-25 10:58:07 +02:00
Al Viro
5f60d5f6bb
move asm/unaligned.h to linux/unaligned.h
...
asm/unaligned.h is always an include of asm-generic/unaligned.h;
might as well move that thing to linux/unaligned.h and include
that - there's nothing arch-specific in that header.
auto-generated by the following:
for i in `git grep -l -w asm/unaligned.h`; do
sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i
done
for i in `git grep -l -w asm-generic/unaligned.h`; do
sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i
done
git mv include/asm-generic/unaligned.h include/linux/unaligned.h
git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h
sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild
sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
2024-10-02 17:23:23 -04:00
Iwona Winiarska
aba59ce109
peci: aspeed: Clear clock_divider value before setting it
...
PECI clock divider is programmed on 10:8 bits of PECI Control register.
Before setting a new value, clear bits read from hardware.
Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com >
Link: https://lore.kernel.org/r/20240417134849.5793-1-iwona.winiarska@intel.com
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com >
2024-06-17 15:18:29 +02:00
Greg Kroah-Hartman
f90bebb36a
Merge tag 'peci-next-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/iwi/linux into char-misc-next
...
Iwona writes:
Update peci-next for v6.6-rc1
* Add Intel Sapphire Rapids support.
* Add Nuvoton controller driver.
* tag 'peci-next-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/iwi/linux:
arm64: dts: nuvoton: Add PECI controller node
ARM: dts: nuvoton: Add PECI controller node
peci: Add peci-npcm controller driver
dt-bindings: Add bindings for peci-npcm
hwmon: (peci/dimmtemp) Add Sapphire Rapids support
hwmon: (peci/cputemp) Add Intel Sapphire Rapids support
peci: cpu: Add Intel Sapphire Rapids support
2023-08-08 10:53:30 +02:00
Tomer Maimon
3e16184a1b
peci: Add peci-npcm controller driver
...
Add support for Nuvoton NPCM BMC hardware to the Platform Environment
Control Interface (PECI) subsystem.
Signed-off-by: Tomer Maimon <tmaimon77@gmail.com >
Signed-off-by: Tyrone Ting <warp5tw@gmail.com >
Co-developed-by: Iwona Winiarska <iwona.winiarska@intel.com >
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com >
Link: https://lore.kernel.org/r/20230727202126.1477515-3-iwona.winiarska@intel.com
2023-08-07 18:27:55 +02:00
Zev Weiss
8306d6f35d
peci: Constify struct peci_controller_ops
...
As with most ops structs, we never modify it at runtime, and keeping
function pointers in read-only memory is generally a good thing
security-wise.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net >
Link: https://lore.kernel.org/r/20230327224315.11135-1-zev@bewilderbeest.net
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com >
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com >
Link: https://lore.kernel.org/r/20230623142805.577612-1-iwona.winiarska@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-08-04 16:21:30 +02:00
Lv Ruyi
e79b548b72
peci: aspeed: fix error check return value of platform_get_irq()
...
platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.
Fixes: a85e4c5208 ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn >
Link: https://lore.kernel.org/r/20220413010425.2534887-1-lv.ruyi@zte.com.cn
Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com >
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com >
2022-08-15 20:31:34 +02:00
Jae Hyun Yoo
a85e4c5208
peci: Add peci-aspeed controller driver
...
ASPEED AST24xx/AST25xx/AST26xx SoCs support the PECI electrical
interface (a.k.a PECI wire) that provides a communication channel with
Intel processors.
This driver allows BMC to discover devices connected to it and
communicate with them using PECI protocol.
Co-developed-by: Iwona Winiarska <iwona.winiarska@intel.com >
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Reviewed-by: Joel Stanley <joel@jms.id.au >
Acked-by: Joel Stanley <joel@jms.id.au >
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com >
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com >
Link: https://lore.kernel.org/r/20220208153639.255278-6-iwona.winiarska@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-02-09 08:04:43 +01:00