* [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports
@ 2023-08-29 9:40 Jan Kiszka
2023-08-29 11:04 ` Florian Bezdeka
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2023-08-29 9:40 UTC (permalink / raw)
To: Xenomai; +Cc: Florian Bezdeka
From: Jan Kiszka <jan.kiszka@siemens.com>
Some stable kernels gained this helper meanwhile as well.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
index ea7ed3ad56..a533d46690 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
@@ -54,7 +54,13 @@
#define close_fd(__ufd) __close_fd(current->files, __ufd)
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
+ LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) || \
+ LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
+ LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
#define dev_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, MAX_ADDR_LEN)
#define eth_hw_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, ETH_ALEN)
#endif
--
2.35.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports
2023-08-29 9:40 [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports Jan Kiszka
@ 2023-08-29 11:04 ` Florian Bezdeka
2023-08-29 11:39 ` Bezdeka, Florian
2023-08-29 13:45 ` Jan Kiszka
0 siblings, 2 replies; 6+ messages in thread
From: Florian Bezdeka @ 2023-08-29 11:04 UTC (permalink / raw)
To: Jan Kiszka, Xenomai
On Tue, 2023-08-29 at 11:40 +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Some stable kernels gained this helper meanwhile as well.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> index ea7ed3ad56..a533d46690 100644
> --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> @@ -54,7 +54,13 @@
> #define close_fd(__ufd) __close_fd(current->files, __ufd)
> #endif
>
> -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
> + LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) || \
> + LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
> + (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
> + LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
This is still broken. I have a 5.4.253 kernel here which already
provides eth_hw_addr_set.
LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) is true for that kernel.
> #define dev_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, MAX_ADDR_LEN)
> #define eth_hw_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, ETH_ALEN)
> #endif
> --
> 2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports
2023-08-29 11:04 ` Florian Bezdeka
@ 2023-08-29 11:39 ` Bezdeka, Florian
2023-08-29 13:48 ` Jan Kiszka
2023-08-29 13:45 ` Jan Kiszka
1 sibling, 1 reply; 6+ messages in thread
From: Bezdeka, Florian @ 2023-08-29 11:39 UTC (permalink / raw)
To: Kiszka, Jan, xenomai
On Tue, 2023-08-29 at 13:04 +0200, Florian Bezdeka wrote:
> On Tue, 2023-08-29 at 11:40 +0200, Jan Kiszka wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> >
> > Some stable kernels gained this helper meanwhile as well.
> >
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> > kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> > index ea7ed3ad56..a533d46690 100644
> > --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> > +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> > @@ -54,7 +54,13 @@
> > #define close_fd(__ufd) __close_fd(current->files, __ufd)
> > #endif
> >
> > -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
> > + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
> > + LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
> > + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) || \
> > + LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
> > + (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
> > + LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
>
> This is still broken. I have a 5.4.253 kernel here which already
> provides eth_hw_addr_set.
>
> LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) is true for that kernel.
I'm testing with
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
( \
LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) && LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291)) \
)
right now. Would need proper formatting of course.
>
> > #define dev_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, MAX_ADDR_LEN)
> > #define eth_hw_addr_set(dev, addr) memcpy((dev)->dev_addr, addr, ETH_ALEN)
> > #endif
> > --
> > 2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports
2023-08-29 11:04 ` Florian Bezdeka
2023-08-29 11:39 ` Bezdeka, Florian
@ 2023-08-29 13:45 ` Jan Kiszka
1 sibling, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2023-08-29 13:45 UTC (permalink / raw)
To: Florian Bezdeka, Xenomai
On 29.08.23 13:04, Florian Bezdeka wrote:
> On Tue, 2023-08-29 at 11:40 +0200, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Some stable kernels gained this helper meanwhile as well.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>> index ea7ed3ad56..a533d46690 100644
>> --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>> +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>> @@ -54,7 +54,13 @@
>> #define close_fd(__ufd) __close_fd(current->files, __ufd)
>> #endif
>>
>> -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
>> + LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) || \
>> + LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
>> + LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
>
> This is still broken. I have a 5.4.253 kernel here which already
> provides eth_hw_addr_set.
>
> LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) is true for that kernel.
>
Yes, the new lower limits were wrong. They should have been 5.5 and
4.20, respectively...
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports
2023-08-29 11:39 ` Bezdeka, Florian
@ 2023-08-29 13:48 ` Jan Kiszka
2023-08-29 13:56 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2023-08-29 13:48 UTC (permalink / raw)
To: Bezdeka, Florian (T CED SES-DE), xenomai
On 29.08.23 13:39, Bezdeka, Florian (T CED SES-DE) wrote:
> On Tue, 2023-08-29 at 13:04 +0200, Florian Bezdeka wrote:
>> On Tue, 2023-08-29 at 11:40 +0200, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> Some stable kernels gained this helper meanwhile as well.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>> kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 8 +++++++-
>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>>> index ea7ed3ad56..a533d46690 100644
>>> --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>>> +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>>> @@ -54,7 +54,13 @@
>>> #define close_fd(__ufd) __close_fd(current->files, __ufd)
>>> #endif
>>>
>>> -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
>>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
>>> + LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
>>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) || \
>>> + LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
>>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
>>> + LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
>>
>> This is still broken. I have a 5.4.253 kernel here which already
>> provides eth_hw_addr_set.
>>
>> LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) is true for that kernel.
>
> I'm testing with
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
> ( \
> LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
> (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) || \
> (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) || \
> (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) && LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291)) \
> )
>
> right now. Would need proper formatting of course.
>
Wouldn't that work as well?
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
(LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
(LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) || \
LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \
LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
...
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports
2023-08-29 13:48 ` Jan Kiszka
@ 2023-08-29 13:56 ` Jan Kiszka
0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2023-08-29 13:56 UTC (permalink / raw)
To: Bezdeka, Florian (T CED SES-DE), xenomai
On 29.08.23 15:48, Jan Kiszka wrote:
> On 29.08.23 13:39, Bezdeka, Florian (T CED SES-DE) wrote:
>> On Tue, 2023-08-29 at 13:04 +0200, Florian Bezdeka wrote:
>>> On Tue, 2023-08-29 at 11:40 +0200, Jan Kiszka wrote:
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> Some stable kernels gained this helper meanwhile as well.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> ---
>>>> kernel/cobalt/include/asm-generic/xenomai/wrappers.h | 8 +++++++-
>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>>>> index ea7ed3ad56..a533d46690 100644
>>>> --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>>>> +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
>>>> @@ -54,7 +54,13 @@
>>>> #define close_fd(__ufd) __close_fd(current->files, __ufd)
>>>> #endif
>>>>
>>>> -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
>>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
>>>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
>>>> + LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
>>>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) || \
>>>> + LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
>>>> + (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) || \
>>>> + LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
>>>
>>> This is still broken. I have a 5.4.253 kernel here which already
>>> provides eth_hw_addr_set.
>>>
>>> LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) is true for that kernel.
>>
>> I'm testing with
>>
>> #if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
>> ( \
>> LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
>> (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) || \
>> (LINUX_VERSION_CODE >= KERNEL_VERSION(5,4,0) && LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) || \
>> (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) && LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291)) \
>> )
>>
>> right now. Would need proper formatting of course.
>>
>
> Wouldn't that work as well?
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) && \
> (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) || \
> LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188)) && \
> (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) || \
> LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251)) && \
> (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \
> LINUX_VERSION_CODE < KERNEL_VERSION(4,19,291))
> ...
>
> Jan
>
BTW, both v2 and v3 make no sense for master because master does not
support kernels < 5.10. But stable/v3.2.x would need it.
And I noticed that I apparently never sent v1 which was only addressing
5.10. Will do that soon (and restore next to it).
Sorry for the mess.
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-29 13:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 9:40 [PATCH v3] cobalt: Adjust dev_addr_set wrapper to 5.10, 5.1 and 4.19 backports Jan Kiszka
2023-08-29 11:04 ` Florian Bezdeka
2023-08-29 11:39 ` Bezdeka, Florian
2023-08-29 13:48 ` Jan Kiszka
2023-08-29 13:56 ` Jan Kiszka
2023-08-29 13:45 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).