* [PATCH] hamradio: baycom_epp: Do not use x86-specific rdtsc()
@ 2022-12-18 12:04 Borislav Petkov
2022-12-19 9:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Borislav Petkov @ 2022-12-18 12:04 UTC (permalink / raw)
To: Thomas Sailer; +Cc: linux-hams, netdev, LKML
From: "Borislav Petkov (AMD)" <bp@alien8.de>
Use get_cycles() which is provided by pretty much every arch.
The UML build works too because get_cycles() is a simple "return 0;"
because the rdtsc() is optimized away there.
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
drivers/net/hamradio/baycom_epp.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index bd3b0c2655a2..83ff882f5d97 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -623,16 +623,10 @@ static int receive(struct net_device *dev, int cnt)
/* --------------------------------------------------------------------- */
-#if defined(__i386__) && !defined(CONFIG_UML)
-#include <asm/msr.h>
#define GETTICK(x) \
({ \
- if (boot_cpu_has(X86_FEATURE_TSC)) \
- x = (unsigned int)rdtsc(); \
+ x = (unsigned int)get_cycles(); \
})
-#else /* __i386__ && !CONFIG_UML */
-#define GETTICK(x)
-#endif /* __i386__ && !CONFIG_UML */
static void epp_bh(struct work_struct *work)
{
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hamradio: baycom_epp: Do not use x86-specific rdtsc()
2022-12-18 12:04 [PATCH] hamradio: baycom_epp: Do not use x86-specific rdtsc() Borislav Petkov
@ 2022-12-19 9:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-19 9:50 UTC (permalink / raw)
To: Borislav Petkov; +Cc: t.sailer, linux-hams, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Sun, 18 Dec 2022 13:04:05 +0100 you wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
>
> Use get_cycles() which is provided by pretty much every arch.
>
> The UML build works too because get_cycles() is a simple "return 0;"
> because the rdtsc() is optimized away there.
>
> [...]
Here is the summary with links:
- hamradio: baycom_epp: Do not use x86-specific rdtsc()
https://git.kernel.org/netdev/net-next/c/aba5b397cad7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-19 9:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-18 12:04 [PATCH] hamradio: baycom_epp: Do not use x86-specific rdtsc() Borislav Petkov
2022-12-19 9:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox