Re: linux-next: build failure after merge of the y2038 tree

2018-12-17 Thread Steve French
Pushed to cifs-2.6.git for-next (after minor commit description text
cleanup and adding acked-by and reviewed-by)

Paulo/Aurelien,
Let me know your thoughts about Arnd's additional comments which were
interesting.

On Mon, Dec 17, 2018 at 6:49 AM Arnd Bergmann  wrote:
>
> On Mon, Dec 17, 2018 at 10:11 AM Stephen Rothwell  
> wrote:
>
> > I have applied the following merge fix patch (better versions welcome):
> >
> > From: Stephen Rothwell 
> > Date: Mon, 17 Dec 2018 20:03:28 +1100
> > Subject: [PATCH] cifs: update for current_kernel_time64() removal
> >
> > Signed-off-by: Stephen Rothwell 
> > ---
>
> Your patch looks correct, and the conflict should be easy to
> resolve by Steve merging this into his tree, as
> ktime_get_coarse_real_ts64() is readily available in mainline
> kernels.
>
> Acked-by: Arnd Bergmann 
>
> >  fs/cifs/dfs_cache.c | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
> > index 70f9c9e2175c..d20cc94d7abd 100644
> > --- a/fs/cifs/dfs_cache.c
> > +++ b/fs/cifs/dfs_cache.c
> > @@ -103,7 +103,7 @@ static inline bool cache_entry_expired(const struct 
> > dfs_cache_entry *ce)
> >  {
> > struct timespec64 ts;
> >
> > -   ts = current_kernel_time64();
> > +   ktime_get_coarse_real_ts64(&ts);
> > return timespec64_compare(&ts, &ce->ce_etime) >= 0;
> >  }
> >
> > @@ -338,8 +338,10 @@ static inline struct timespec64 get_expire_time(int 
> > ttl)
> > .tv_sec = ttl,
> > .tv_nsec = 0,
> > };
> > +   struct timespec64 now;
> >
> > -   return timespec64_add(current_kernel_time64(), ts);
> > +   ktime_get_coarse_real_ts64(&now);
> > +   return timespec64_add(now, ts);
> >  }
>
> In case efficiency is a concern: using ktime_t with
> ktime_get_coarse_real() may be much faster if we decide to
> abandon the coarse-grained timespec64 accessors in the future.
>
> Also, I wonder if the expiration here has to use CLOCK_REALTIME,
> since that is affected by leap second adjustment and
> clock_settime().
>
> In other modules, we usually concluded that it should be either
> CLOCK_MONOTONIC or CLOCK_BOOTTIME, depending on whether
> you want the expiration timer to keep ticking during suspend.
>
> Arnd



-- 
Thanks,

Steve


Re: linux-next: build failure after merge of the y2038 tree

2018-12-17 Thread Arnd Bergmann
On Mon, Dec 17, 2018 at 10:11 AM Stephen Rothwell  wrote:

> I have applied the following merge fix patch (better versions welcome):
>
> From: Stephen Rothwell 
> Date: Mon, 17 Dec 2018 20:03:28 +1100
> Subject: [PATCH] cifs: update for current_kernel_time64() removal
>
> Signed-off-by: Stephen Rothwell 
> ---

Your patch looks correct, and the conflict should be easy to
resolve by Steve merging this into his tree, as
ktime_get_coarse_real_ts64() is readily available in mainline
kernels.

Acked-by: Arnd Bergmann 

>  fs/cifs/dfs_cache.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
> index 70f9c9e2175c..d20cc94d7abd 100644
> --- a/fs/cifs/dfs_cache.c
> +++ b/fs/cifs/dfs_cache.c
> @@ -103,7 +103,7 @@ static inline bool cache_entry_expired(const struct 
> dfs_cache_entry *ce)
>  {
> struct timespec64 ts;
>
> -   ts = current_kernel_time64();
> +   ktime_get_coarse_real_ts64(&ts);
> return timespec64_compare(&ts, &ce->ce_etime) >= 0;
>  }
>
> @@ -338,8 +338,10 @@ static inline struct timespec64 get_expire_time(int ttl)
> .tv_sec = ttl,
> .tv_nsec = 0,
> };
> +   struct timespec64 now;
>
> -   return timespec64_add(current_kernel_time64(), ts);
> +   ktime_get_coarse_real_ts64(&now);
> +   return timespec64_add(now, ts);
>  }

In case efficiency is a concern: using ktime_t with
ktime_get_coarse_real() may be much faster if we decide to
abandon the coarse-grained timespec64 accessors in the future.

Also, I wonder if the expiration here has to use CLOCK_REALTIME,
since that is affected by leap second adjustment and
clock_settime().

In other modules, we usually concluded that it should be either
CLOCK_MONOTONIC or CLOCK_BOOTTIME, depending on whether
you want the expiration timer to keep ticking during suspend.

Arnd


linux-next: build failure after merge of the y2038 tree

2018-12-17 Thread Stephen Rothwell
Hi Arnd,

After merging the y2038 tree, today's linux-next build (x86_64
allmodconfig) failed like this:

fs/cifs/dfs_cache.c: In function 'cache_entry_expired':
fs/cifs/dfs_cache.c:106:7: error: implicit declaration of function 
'current_kernel_time64'; did you mean 'core_kernel_text'? 
[-Werror=implicit-function-declaration]
  ts = current_kernel_time64();
   ^
   core_kernel_text
fs/cifs/dfs_cache.c:106:5: error: incompatible types when assigning to type 
'struct timespec64' from type 'int'
  ts = current_kernel_time64();
 ^
fs/cifs/dfs_cache.c: In function 'get_expire_time':
fs/cifs/dfs_cache.c:342:24: error: incompatible type for argument 1 of 
'timespec64_add'
  return timespec64_add(current_kernel_time64(), ts);
^~~
In file included from include/linux/restart_block.h:10,
 from include/linux/thread_info.h:13,
 from arch/x86/include/asm/preempt.h:7,
 from include/linux/preempt.h:78,
 from include/linux/rcupdate.h:40,
 from fs/cifs/dfs_cache.c:8:
include/linux/time64.h:66:66: note: expected 'struct timespec64' but argument 
is of type 'int'
 static inline struct timespec64 timespec64_add(struct timespec64 lhs,
~~^~~
fs/cifs/dfs_cache.c:343:1: warning: control reaches end of non-void function 
[-Wreturn-type]
 }
 ^

Caused by commit

  ccea641b6742 ("timekeeping: remove obsolete time accessors")

interacting with commit

  34a44fb160f9 ("cifs: Add DFS cache routines")

from the cifs tree.

I have applied the following merge fix patch (better versions welcome):

From: Stephen Rothwell 
Date: Mon, 17 Dec 2018 20:03:28 +1100
Subject: [PATCH] cifs: update for current_kernel_time64() removal

Signed-off-by: Stephen Rothwell 
---
 fs/cifs/dfs_cache.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index 70f9c9e2175c..d20cc94d7abd 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -103,7 +103,7 @@ static inline bool cache_entry_expired(const struct 
dfs_cache_entry *ce)
 {
struct timespec64 ts;
 
-   ts = current_kernel_time64();
+   ktime_get_coarse_real_ts64(&ts);
return timespec64_compare(&ts, &ce->ce_etime) >= 0;
 }
 
@@ -338,8 +338,10 @@ static inline struct timespec64 get_expire_time(int ttl)
.tv_sec = ttl,
.tv_nsec = 0,
};
+   struct timespec64 now;
 
-   return timespec64_add(current_kernel_time64(), ts);
+   ktime_get_coarse_real_ts64(&now);
+   return timespec64_add(now, ts);
 }
 
 /* Allocate a new DFS target */
-- 
2.19.1

-- 
Cheers,
Stephen Rothwell


pgpNCWW0J5UwH.pgp
Description: OpenPGP digital signature


linux-next: build failure after merge of the y2038 tree

2018-03-27 Thread Stephen Rothwell
Hi Arnd,

After merging the y2038 tree, today's linux-next build (sparc defconfig)
failed like this:

In file included from include/linux/compat.h:22:0,
 from arch/sparc/kernel/systbls.h:7,
 from arch/sparc/kernel/sys_sparc_32.c:30:
arch/sparc/include/asm/compat.h: In function 'arch_compat_alloc_user_space':
arch/sparc/include/asm/compat.h:162:46: error: 'struct thread_info' has no 
member named 'kregs'
  struct pt_regs *regs = current_thread_info()->kregs;
  ^~
arch/sparc/include/asm/compat.h:165:6: error: implicit declaration of function 
'test_thread_64bit_stack'; did you mean 'setup_thread_stack'? 
[-Werror=implicit-function-declaration]
  if (test_thread_64bit_stack(usp))
  ^~~
  setup_thread_stack
In file included from include/asm-generic/preempt.h:5:0,
 from ./arch/sparc/include/generated/asm/preempt.h:1,
 from include/linux/preempt.h:81,
 from include/linux/rcupdate.h:40,
 from include/linux/rculist.h:11,
 from include/linux/sched/signal.h:5,
 from arch/sparc/kernel/sys_sparc_32.c:11:
arch/sparc/include/asm/compat.h:168:23: error: 'TIF_32BIT' undeclared (first 
use in this function); did you mean 'MAP_32BIT'?
  if (test_thread_flag(TIF_32BIT))
   ^
include/linux/thread_info.h:91:45: note: in definition of macro 
'test_thread_flag'
  test_ti_thread_flag(current_thread_info(), flag)
 ^~~~
arch/sparc/include/asm/compat.h:168:23: note: each undeclared identifier is 
reported only once for each function it appears in
  if (test_thread_flag(TIF_32BIT))
   ^
include/linux/thread_info.h:91:45: note: in definition of macro 
'test_thread_flag'
  test_ti_thread_flag(current_thread_info(), flag)
 ^~~~
arch/sparc/include/asm/compat.h: In function 'is_compat_task':
arch/sparc/include/asm/compat.h:237:26: error: 'TIF_32BIT' undeclared (first 
use in this function); did you mean 'MAP_32BIT'?
  return test_thread_flag(TIF_32BIT);
  ^
include/linux/thread_info.h:91:45: note: in definition of macro 
'test_thread_flag'
  test_ti_thread_flag(current_thread_info(), flag)
 ^~~~
In file included from include/linux/compat.h:22:0,
 from arch/sparc/kernel/systbls.h:7,
 from arch/sparc/kernel/sys_sparc_32.c:30:
arch/sparc/include/asm/compat.h: In function 'in_compat_syscall':
arch/sparc/include/asm/compat.h:243:9: error: implicit declaration of function 
'pt_regs_trap_type'; did you mean 'resource_type'? 
[-Werror=implicit-function-declaration]
  return pt_regs_trap_type(current_pt_regs()) == 0x110;
 ^
 resource_type

and lots more :-(

I suspect it is caused by commit

  d1a353a4a8cc ("compat: add an asm-generic/compat.h file")

It looks like the sparc asm/compat.h does not expect to be included in
32 bit builds?

I have reverted the entire y2038 tree merge for today.

-- 
Cheers,
Stephen Rothwell


pgpx6RZE9CPQp.pgp
Description: OpenPGP digital signature


Re: linux-next: build failure after merge of the y2038 tree

2018-03-17 Thread Deepa Dinamani
I posted the patch.

The patch has simple changes. Let me know if maybe posting a new
version makes sense.

I also needed this patch to build linux-next:

commit b784c76bb7c1c440a4ce06a18f4b3a936f33967d
Author: Deepa Dinamani 
Date:   Fri Mar 16 20:57:10 2018 -0700

i40iw: add missing irq.h include

iwarp driver began using irq_get_affinity_mask in commit 7e952b19eb638.
Add the needed include irq.h to get the definition.

This was found while trying allmodconfig for arm64, s390, and sparc.

Signed-off-by: Deepa Dinamani 

diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index a51798578f27..506b10e8ea4e 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -32,6 +32,7 @@
 *
 
***/

+#include 
 #include 
 #include 
 #include 

-Deepa

On Fri, Mar 16, 2018 at 1:14 AM, Arnd Bergmann  wrote:
> On Fri, Mar 16, 2018 at 6:23 AM, Deepa Dinamani  
> wrote:
>> Hi Arnd,
>>
>> Do you want me to send the fix as a patch or should I re-post the series?
>
> Please send a fix relative to linux-next. Due to my travel next week, I might
> not be able to apply it right away but maybe Stephen can add it on top until
> I get back.
>
>   Arnd
>
>> On Thu, Mar 15, 2018 at 7:25 PM, Stephen Rothwell  
>> wrote:
>>> Hi Arnd,
>>>
>>> After merging the y2038 tree, today's linux-next build (s390 allnoconfig)
>>> failed like this:
>>>
>>> In file included from include/linux/elf.h:5:0,
>>>  from include/linux/module.h:15,
>>>  from init/main.c:16:
>>> arch/s390/include/asm/elf.h:138:1: error: unknown type name 
>>> 's390_compat_regs'
>>>
>>> Caused by commit
>>>
>>>   f00689038f71 ("include: Move compat_timespec/ timeval to compat_time.h")
>>>


Re: linux-next: build failure after merge of the y2038 tree

2018-03-16 Thread Arnd Bergmann
On Fri, Mar 16, 2018 at 6:23 AM, Deepa Dinamani  wrote:
> Hi Arnd,
>
> Do you want me to send the fix as a patch or should I re-post the series?

Please send a fix relative to linux-next. Due to my travel next week, I might
not be able to apply it right away but maybe Stephen can add it on top until
I get back.

  Arnd

> On Thu, Mar 15, 2018 at 7:25 PM, Stephen Rothwell  
> wrote:
>> Hi Arnd,
>>
>> After merging the y2038 tree, today's linux-next build (s390 allnoconfig)
>> failed like this:
>>
>> In file included from include/linux/elf.h:5:0,
>>  from include/linux/module.h:15,
>>  from init/main.c:16:
>> arch/s390/include/asm/elf.h:138:1: error: unknown type name 
>> 's390_compat_regs'
>>
>> Caused by commit
>>
>>   f00689038f71 ("include: Move compat_timespec/ timeval to compat_time.h")
>>


Re: linux-next: build failure after merge of the y2038 tree

2018-03-15 Thread Deepa Dinamani
Hi Arnd,

Do you want me to send the fix as a patch or should I re-post the series?

Thanks,
Deepa

On Thu, Mar 15, 2018 at 7:25 PM, Stephen Rothwell  wrote:
> Hi Arnd,
>
> After merging the y2038 tree, today's linux-next build (s390 allnoconfig)
> failed like this:
>
> In file included from include/linux/elf.h:5:0,
>  from include/linux/module.h:15,
>  from init/main.c:16:
> arch/s390/include/asm/elf.h:138:1: error: unknown type name 's390_compat_regs'
>
> Caused by commit
>
>   f00689038f71 ("include: Move compat_timespec/ timeval to compat_time.h")
>
> --
> Cheers,
> Stephen Rothwell


linux-next: build failure after merge of the y2038 tree

2018-03-15 Thread Stephen Rothwell
Hi Arnd,

After merging the y2038 tree, today's linux-next build (s390 allnoconfig)
failed like this:

In file included from include/linux/elf.h:5:0,
 from include/linux/module.h:15,
 from init/main.c:16:
arch/s390/include/asm/elf.h:138:1: error: unknown type name 's390_compat_regs'

Caused by commit

  f00689038f71 ("include: Move compat_timespec/ timeval to compat_time.h")

-- 
Cheers,
Stephen Rothwell


pgpufFUcBrb1d.pgp
Description: OpenPGP digital signature