All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Dave Chinner @ 2020-07-18  1:42 UTC (permalink / raw)
  To: Eric Biggers
  Cc: linux-kernel, linux-arch, Paul E . McKenney, linux-fsdevel,
	Akira Yokosawa, Alan Stern, Andrea Parri, Boqun Feng,
	Daniel Lustig, Darrick J . Wong, David Howells, Jade Alglave,
	Luc Maranget, Nicholas Piggin, Peter Zijlstra, Will Deacon
In-Reply-To: <20200717044427.68747-1-ebiggers@kernel.org>

On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> The "one-time init" pattern is implemented incorrectly in various places
> in the kernel.  And when people do try to implement it correctly, it is
> unclear what to use.  Try to give some proper guidance.
> 
> This is motivated by the discussion at
> https://lkml.kernel.org/linux-fsdevel/20200713033330.205104-1-ebiggers@kernel.org/T/#u
> regarding fixing the initialization of super_block::s_dio_done_wq.

You're still using words that the target audience of the
documentation will not understand.

This is known as the "curse of knowledge" cognative bias, where
subject matter experts try to explain something to non-experts using
terms only subject matter experts understand....

This is one of the reasons that the LKMM documetnation is so damn
difficult to read and understand: just understanding the vocabulary
it uses requires a huge learning curve, and it's not defined
anywhere. Understanding the syntax of examples requires a huge
learning curve, because it's not defined anywhere. 

Recipes are *not useful* if you need to understand the LKMM
documenation to select the correct recipe to use. Recipes are not
useful if you say "here's 5 different variations of the same thing,
up to you to understand which one you need to use". Recipes are not
useful if changes in other code can silently break the recipe that
was selected by the user by carefully considering the most optimal
variant at the time they selected it.

i.e. Recipes are not for experts who understand the LKMM - recipes
are for developers who don't really understand how the LKMM all
works and just want a single, solid, reliable pattern they can use
just about everywhere for that specific operation.

Performance and optimisation doesn't even enter the picture here -
we need to provide a simple, easy to use and understand pattern that
just works. We need to stop making this harder than it should be.

So....

> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Paul E. McKenney <paulmck@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Will Deacon <will@kernel.org>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  tools/memory-model/Documentation/recipes.txt | 151 +++++++++++++++++++
>  1 file changed, 151 insertions(+)
> 
> diff --git a/tools/memory-model/Documentation/recipes.txt b/tools/memory-model/Documentation/recipes.txt
> index 7fe8d7aa3029..04beb06dbfc7 100644
> --- a/tools/memory-model/Documentation/recipes.txt
> +++ b/tools/memory-model/Documentation/recipes.txt
> @@ -519,6 +519,157 @@ CPU1 puts the waiting task to sleep and CPU0 fails to wake it up.
>  
>  Note that use of locking can greatly simplify this pattern.
>  
> +One-time init
> +-------------
> +
> +The "one-time init" pattern is when multiple tasks can race to
> +initialize the same data structure(s) on first use.
> +
> +In many cases, it's best to just avoid the need for this by simply
> +initializing the data ahead of time.
> +
> +But in cases where the data would often go unused, one-time init can be
> +appropriate to avoid wasting kernel resources.  It can also be
> +appropriate if the initialization has other prerequisites which preclude
> +it being done ahead of time.
> +
> +First, consider if your data has (a) global or static scope, (b) can be
> +initialized from atomic context, and (c) cannot fail to be initialized.
> +If all of those apply, just use DO_ONCE() from <linux/once.h>:
> +
> +	DO_ONCE(func);
> +
> +If that doesn't apply, you'll have to implement one-time init yourself.
> +
> +The simplest implementation just uses a mutex and an 'inited' flag.
> +This implementation should be used where feasible:
> +
> +	static bool foo_inited;
> +	static DEFINE_MUTEX(foo_init_mutex);
> +
> +	int init_foo_if_needed(void)
> +	{
> +		int err = 0;
> +
> +		mutex_lock(&foo_init_mutex);
> +		if (!foo_inited) {
> +			err = init_foo();
> +			if (err == 0)
> +				foo_inited = true;
> +		}
> +		mutex_unlock(&foo_init_mutex);
> +		return err;
> +	}
> +
> +The above example uses static variables, but this solution also works
> +for initializing something that is part of another data structure.  The
> +mutex may still be static.

All good up to here - people will see this and understand that this
is the pattern they want to use, and DO_ONCE() is a great, simple
API that is easy to use.

What needs to follow is a canonical example of how to do it
locklessly and efficiently, without describing conditional use of it
using words like "initialised memory is transitively reachable" (I
don't know WTF that means!).  Don't discuss potential optimisations,
control flow/data dependencies, etc, because failing to understand
those details are the reason people are looking for a simple recipe
that does what they need in the first place ("curse of knowledge").

However, I think the whole problem around code like this is that it
is being open-coded and that is the reason people get it wrong.
Hence I agree with Willy that this needs to be wrapped in a simple,
easy to use and hard to get wrong APIs for the patterns we expect to
see people use.

And the recipes should doucment the use of that API for the
init-once pattern, not try to teach people how to open-code their
own init-once pattern that they will continue to screw up....

As a result, I think the examples should document correct use of the
API for the two main variants it would be used for. The first
variant has an external "inited" flag that handles multiple
structure initialisations, and the second variant handles allocation
and initialisation of a single structure that is stored and accessed
by a single location.

Work out an API to do these things correctly, then write the recipes
to use them. Then people like yourself can argue all day and night
on how to best optimise them, and people like myself can just ignore
that all knowing that my init_once() call will always do the right
thing.

> +For the single-pointer case, a further optimized implementation
> +eliminates the mutex and instead uses compare-and-exchange:
> +
> +	static struct foo *foo;
> +
> +	int init_foo_if_needed(void)
> +	{
> +		struct foo *p;
> +
> +		/* pairs with successful cmpxchg_release() below */
> +		if (smp_load_acquire(&foo))
> +			return 0;
> +
> +		p = alloc_foo();
> +		if (!p)
> +			return -ENOMEM;
> +
> +		/* on success, pairs with smp_load_acquire() above and below */
> +		if (cmpxchg_release(&foo, NULL, p) != NULL) {
> +			free_foo(p);
> +			/* pairs with successful cmpxchg_release() above */
> +			smp_load_acquire(&foo);

This is the failure path, not the success. So it describing it as
pairing with "successful cmpxchg_release() above" when the code that
is executing is in the path where  the cmpxchg_release() above -just
failed- doesn't help anyone understand exactly what it is pairing
with.

This is why I said in that other thread "just saying 'pairs with
<foo>' is not sufficient to explain to the reader exactly what the
memory barrier is doing. You needed two full paragraphs to explain
why this was put here and that, to me, indicate the example and
expected use case is wrong.

But even then, I think this example is incorrect and doesn't fit the
patterns people might expect. That is, if this init function
-returned foo for the caller to use-, then the smp_load_acquire() on
failure is necessary to ensure the initialisation done by the racing
context is correct seen. But this function doesn't return foo, and
so the smp_load_acquire() is required in whatever context is trying
to access the contents of foo, not the init function.

Hence I think this example is likely incorrect and will lead to bugs
because it does not, in any way, indicate that
smp_load_acquire(&foo) must always be used in the contexts where foo
may accessed before (or during) the init function has been run...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply

* Re: [PATCH net-next] dpaa_eth: Fix one possible memleak in dpaa_eth_probe
From: David Miller @ 2020-07-18  1:41 UTC (permalink / raw)
  To: liujian56; +Cc: madalin.bucur, kuba, laurentiu.tudor, netdev
In-Reply-To: <20200717090528.19683-1-liujian56@huawei.com>

From: Liu Jian <liujian56@huawei.com>
Date: Fri, 17 Jul 2020 17:05:28 +0800

> When dma_coerce_mask_and_coherent() fails, the alloced netdev need to be freed.
> 
> Fixes: 060ad66f9795 ("dpaa_eth: change DMA device")
> Signed-off-by: Liu Jian <liujian56@huawei.com>

This is a bug fix introduced in v5.5, therefore it should be targetting
'net' instead of 'net-next'.

^ permalink raw reply

* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Matthew Wilcox @ 2020-07-18  1:40 UTC (permalink / raw)
  To: Alan Stern
  Cc: Eric Biggers, Darrick J. Wong, linux-kernel, linux-arch,
	Paul E . McKenney, linux-fsdevel, Akira Yokosawa, Andrea Parri,
	Boqun Feng, Daniel Lustig, Dave Chinner, David Howells,
	Jade Alglave, Luc Maranget, Nicholas Piggin, Peter Zijlstra,
	Will Deacon
In-Reply-To: <20200718012555.GA1168834@rowland.harvard.edu>

On Fri, Jul 17, 2020 at 09:25:55PM -0400, Alan Stern wrote:
> On Fri, Jul 17, 2020 at 05:58:57PM -0700, Eric Biggers wrote:
> > On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote:
> > > > +There are also cases in which the smp_load_acquire() can be replaced by
> > > > +the more lightweight READ_ONCE().  (smp_store_release() is still
> > > > +required.)  Specifically, if all initialized memory is transitively
> > > > +reachable from the pointer itself, then there is no control dependency
> > > 
> > > I don't quite understand what "transitively reachable from the pointer
> > > itself" means?  Does that describe the situation where all the objects
> > > reachable through the object that the global struct foo pointer points
> > > at are /only/ reachable via that global pointer?
> > > 
> > 
> > The intent is that "transitively reachable" means that all initialized memory
> > can be reached by dereferencing the pointer in some way, e.g. p->a->b[5]->c.
> > 
> > It could also be the case that allocating the object initializes some global or
> > static data, which isn't reachable in that way.  Access to that data would then
> > be a control dependency, which a data dependency barrier wouldn't work for.
> > 
> > It's possible I misunderstood something.  (Note the next paragraph does say that
> > using READ_ONCE() is discouraged, exactly for this reason -- it can be hard to
> > tell whether it's correct.)  Suggestions of what to write here are appreciated.
> 
> Perhaps something like this:
> 
> 	Specifically, if the only way to reach the initialized memory 
> 	involves dereferencing the pointer itself then READ_ONCE() is 
> 	sufficient.  This is because there will be an address dependency 
> 	between reading the pointer and accessing the memory, which will 
> 	ensure proper ordering.  But if some of the initialized memory 
> 	is reachable some other way (for example, if it is global or 
> 	static data) then there need not be an address dependency, 
> 	merely a control dependency (checking whether the pointer is 
> 	non-NULL).  Control dependencies do not always ensure ordering 
> 	-- certainly not for reads, and depending on the compiler, 
> 	possibly not for some writes -- and therefore a load-acquire is 
> 	necessary.
> 
> Perhaps this is more wordy than you want, but it does get the important 
> ideas across.

I don't think we should worry about wordsmithing this.  We should just
say "Use the init_pointer_once API" and then people who want to worry
about optimising the implementation of that API never have to talk to
the people who want to use that API.

^ permalink raw reply

* Re: [PATCH] net: cxgb3: add missed destroy_workqueue in cxgb3 probe failure
From: David Miller @ 2020-07-18  1:39 UTC (permalink / raw)
  To: wanghai38; +Cc: vishal, kuba, jeff, divy, netdev, linux-kernel
In-Reply-To: <20200717062117.8941-1-wanghai38@huawei.com>

From: Wang Hai <wanghai38@huawei.com>
Date: Fri, 17 Jul 2020 14:21:17 +0800

> The driver forgets to call destroy_workqueue when cxgb3 probe fails.
> Add the missed calls to fix it.
> 
> Fixes: 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3.")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>

You have to handle the case that the probing of one or more devices
fails yet one or more others succeed.

And you can't know in advance how this will play out.

This is why the workqueue is unconditionally created, and only destroyed
on module remove.

^ permalink raw reply

* Re: [PATCH 1/6] syscalls: use uaccess_kernel in addr_limit_user_check
From: Guenter Roeck @ 2020-07-18  1:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-arch, Nick Hu, linux-kernel, Palmer Dabbelt, Greentime Hu,
	Paul Walmsley, Andrew Morton, Vincent Chen, Linus Torvalds,
	linux-riscv
In-Reply-To: <20200714105505.935079-2-hch@lst.de>

Hi,

On Tue, Jul 14, 2020 at 12:55:00PM +0200, Christoph Hellwig wrote:
> Use the uaccess_kernel helper instead of duplicating it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

This patch causes a severe hiccup with my mps2-an385 boot test.

[    8.545195] ------------[ cut here ]------------
[    8.545294] WARNING: CPU: 0 PID: 1 at ./include/linux/syscalls.h:267 addr_limit_check_failed+0x11/0x24
[    8.545376] Invalid address limit on user-mode return
[    8.545487] CPU: 0 PID: 1 Comm: init Not tainted 5.8.0-rc5-next-20200717 #1
[    8.545603] Hardware name: MPS2 (Device Tree Support)
[    8.546053] [<2100af9d>] (unwind_backtrace) from [<2100a353>] (show_stack+0xb/0xc)
[    8.546240] [<2100a353>] (show_stack) from [<2100dadb>] (__warn+0x6f/0x80)
[    8.546311] [<2100dadb>] (__warn) from [<2100db1d>] (warn_slowpath_fmt+0x31/0x60)
[    8.546383] [<2100db1d>] (warn_slowpath_fmt) from [<2100a159>] (addr_limit_check_failed+0x11/0x24)
[    8.546464] [<2100a159>] (addr_limit_check_failed) from [<210080f3>] (ret_to_user_from_irq+0xf/0x18)
[    8.546567] Exception stack(0x21427fb0 to 0x21427ff8)
[    8.546649] 7fa0:                                     00000000 00000000 00000000 00000000
[    8.546729] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 21744f80 00000000
[    8.546800] 7fe0: 00000000 21757fa8 00000000 21700b6c 01000000 00000000
[    8.546910] ---[ end trace f1b0cd10cc3456dc ]---

This keeps happening until qemu aborts.

Reverting the patch isn't possible since segment_eq() is gone in
next-20200717.

Guenter

---
# bad: [aab7ee9f8ff0110bfcd594b33dc33748dc1baf46] Add linux-next specific files for 20200717
# good: [11ba468877bb23f28956a35e896356252d63c983] Linux 5.8-rc5
git bisect start 'HEAD' 'v5.8-rc5'
# good: [4d55a7a1298d197755c1a0f4512f56917e938a83] Merge remote-tracking branch 'crypto/master'
git bisect good 4d55a7a1298d197755c1a0f4512f56917e938a83
# good: [e63bf5dcce255302e355cb2277a3a39c83752c92] Merge remote-tracking branch 'devicetree/for-next'
git bisect good e63bf5dcce255302e355cb2277a3a39c83752c92
# good: [94d932ec3afb923efd8c736974f8316413175a5b] Merge remote-tracking branch 'thunderbolt/next'
git bisect good 94d932ec3afb923efd8c736974f8316413175a5b
# good: [5ddd2e0dbe8fceb80b0b36bd38a32217be7a04a5] Merge remote-tracking branch 'livepatching/for-next'
git bisect good 5ddd2e0dbe8fceb80b0b36bd38a32217be7a04a5
# bad: [40346f79983caf46fb92f779b0353422d43580a9] ipc/shm.c: Remove the superfluous break
git bisect bad 40346f79983caf46fb92f779b0353422d43580a9
# good: [0b917599517f71ddef5f7274a8199a33cecd49b2] kasan: update required compiler versions in documentation
git bisect good 0b917599517f71ddef5f7274a8199a33cecd49b2
# good: [701571ae06641cc0632d113a6d25f54ce651e723] mm,hwpoison: rework soft offline for free pages
git bisect good 701571ae06641cc0632d113a6d25f54ce651e723
# bad: [1c21deffe923b068d2d297c248845ec93531d1bf] lib/test_bits.c: add tests of GENMASK
git bisect bad 1c21deffe923b068d2d297c248845ec93531d1bf
# bad: [9549375184b2cb4f63fa7917665acf9c44114499] uaccess: add force_uaccess_{begin,end} helpers
git bisect bad 9549375184b2cb4f63fa7917665acf9c44114499
# good: [233d009c15719e43c53b73296144664e0bd59a2e] mm/memory_hotplug: introduce default dummy memory_add_physaddr_to_nid()
git bisect good 233d009c15719e43c53b73296144664e0bd59a2e
# good: [42889ca325dd735ce964838cff81a444637d9d01] mm: drop duplicated words in <linux/mm.h>
git bisect good 42889ca325dd735ce964838cff81a444637d9d01
# bad: [3b17e98704eedeeff41672b2f64cef1bbefbb8b2] nds32: use uaccess_kernel in show_regs
git bisect bad 3b17e98704eedeeff41672b2f64cef1bbefbb8b2
# bad: [02dc30b876b111276fe7d83d492ddfc2b39b80e3] syscalls: use uaccess_kernel in addr_limit_user_check
git bisect bad 02dc30b876b111276fe7d83d492ddfc2b39b80e3
# first bad commit: [02dc30b876b111276fe7d83d492ddfc2b39b80e3] syscalls: use uaccess_kernel in addr_limit_user_check

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply

* Re: linux-next: Tree for Jul 17 (drivers/rtc/rtc-ds1374.o)
From: Stephen Rothwell @ 2020-07-18  1:38 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, linux-rtc,
	Alessandro Zummo, Alexandre Belloni, Scott Wood,
	Johnson CH Chen (陳昭勳)
In-Reply-To: <d36fac01-2a7b-c3f1-84ef-3a1560d18790@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Hi Randy,

[Please trim your emails a bit more, thanks]

On Fri, 17 Jul 2020 09:49:05 -0700 Randy Dunlap <rdunlap@infradead.org> wrote:
> on x86_64:
> # CONFIG_WATCHDOG is not set
> 
> ld: drivers/rtc/rtc-ds1374.o: in function `ds1374_probe':
> rtc-ds1374.c:(.text+0x736): undefined reference to `watchdog_init_timeout'
> ld: rtc-ds1374.c:(.text+0x77e): undefined reference to `devm_watchdog_register_device'

Caused by commit

  d3de4beb14a8 ("rtc: ds1374: wdt: Use watchdog core for watchdog part")

from the rtc tree.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: [PATCH 1/6] syscalls: use uaccess_kernel in addr_limit_user_check
From: Guenter Roeck @ 2020-07-18  1:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Nick Hu, Greentime Hu, Vincent Chen, Paul Walmsley,
	Palmer Dabbelt, Andrew Morton, Linus Torvalds, linux-riscv,
	linux-arch, linux-kernel
In-Reply-To: <20200714105505.935079-2-hch@lst.de>

Hi,

On Tue, Jul 14, 2020 at 12:55:00PM +0200, Christoph Hellwig wrote:
> Use the uaccess_kernel helper instead of duplicating it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

This patch causes a severe hiccup with my mps2-an385 boot test.

[    8.545195] ------------[ cut here ]------------
[    8.545294] WARNING: CPU: 0 PID: 1 at ./include/linux/syscalls.h:267 addr_limit_check_failed+0x11/0x24
[    8.545376] Invalid address limit on user-mode return
[    8.545487] CPU: 0 PID: 1 Comm: init Not tainted 5.8.0-rc5-next-20200717 #1
[    8.545603] Hardware name: MPS2 (Device Tree Support)
[    8.546053] [<2100af9d>] (unwind_backtrace) from [<2100a353>] (show_stack+0xb/0xc)
[    8.546240] [<2100a353>] (show_stack) from [<2100dadb>] (__warn+0x6f/0x80)
[    8.546311] [<2100dadb>] (__warn) from [<2100db1d>] (warn_slowpath_fmt+0x31/0x60)
[    8.546383] [<2100db1d>] (warn_slowpath_fmt) from [<2100a159>] (addr_limit_check_failed+0x11/0x24)
[    8.546464] [<2100a159>] (addr_limit_check_failed) from [<210080f3>] (ret_to_user_from_irq+0xf/0x18)
[    8.546567] Exception stack(0x21427fb0 to 0x21427ff8)
[    8.546649] 7fa0:                                     00000000 00000000 00000000 00000000
[    8.546729] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 21744f80 00000000
[    8.546800] 7fe0: 00000000 21757fa8 00000000 21700b6c 01000000 00000000
[    8.546910] ---[ end trace f1b0cd10cc3456dc ]---

This keeps happening until qemu aborts.

Reverting the patch isn't possible since segment_eq() is gone in
next-20200717.

Guenter

---
# bad: [aab7ee9f8ff0110bfcd594b33dc33748dc1baf46] Add linux-next specific files for 20200717
# good: [11ba468877bb23f28956a35e896356252d63c983] Linux 5.8-rc5
git bisect start 'HEAD' 'v5.8-rc5'
# good: [4d55a7a1298d197755c1a0f4512f56917e938a83] Merge remote-tracking branch 'crypto/master'
git bisect good 4d55a7a1298d197755c1a0f4512f56917e938a83
# good: [e63bf5dcce255302e355cb2277a3a39c83752c92] Merge remote-tracking branch 'devicetree/for-next'
git bisect good e63bf5dcce255302e355cb2277a3a39c83752c92
# good: [94d932ec3afb923efd8c736974f8316413175a5b] Merge remote-tracking branch 'thunderbolt/next'
git bisect good 94d932ec3afb923efd8c736974f8316413175a5b
# good: [5ddd2e0dbe8fceb80b0b36bd38a32217be7a04a5] Merge remote-tracking branch 'livepatching/for-next'
git bisect good 5ddd2e0dbe8fceb80b0b36bd38a32217be7a04a5
# bad: [40346f79983caf46fb92f779b0353422d43580a9] ipc/shm.c: Remove the superfluous break
git bisect bad 40346f79983caf46fb92f779b0353422d43580a9
# good: [0b917599517f71ddef5f7274a8199a33cecd49b2] kasan: update required compiler versions in documentation
git bisect good 0b917599517f71ddef5f7274a8199a33cecd49b2
# good: [701571ae06641cc0632d113a6d25f54ce651e723] mm,hwpoison: rework soft offline for free pages
git bisect good 701571ae06641cc0632d113a6d25f54ce651e723
# bad: [1c21deffe923b068d2d297c248845ec93531d1bf] lib/test_bits.c: add tests of GENMASK
git bisect bad 1c21deffe923b068d2d297c248845ec93531d1bf
# bad: [9549375184b2cb4f63fa7917665acf9c44114499] uaccess: add force_uaccess_{begin,end} helpers
git bisect bad 9549375184b2cb4f63fa7917665acf9c44114499
# good: [233d009c15719e43c53b73296144664e0bd59a2e] mm/memory_hotplug: introduce default dummy memory_add_physaddr_to_nid()
git bisect good 233d009c15719e43c53b73296144664e0bd59a2e
# good: [42889ca325dd735ce964838cff81a444637d9d01] mm: drop duplicated words in <linux/mm.h>
git bisect good 42889ca325dd735ce964838cff81a444637d9d01
# bad: [3b17e98704eedeeff41672b2f64cef1bbefbb8b2] nds32: use uaccess_kernel in show_regs
git bisect bad 3b17e98704eedeeff41672b2f64cef1bbefbb8b2
# bad: [02dc30b876b111276fe7d83d492ddfc2b39b80e3] syscalls: use uaccess_kernel in addr_limit_user_check
git bisect bad 02dc30b876b111276fe7d83d492ddfc2b39b80e3
# first bad commit: [02dc30b876b111276fe7d83d492ddfc2b39b80e3] syscalls: use uaccess_kernel in addr_limit_user_check

^ permalink raw reply

* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Eric Biggers @ 2020-07-18  1:38 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-kernel, linux-arch, Paul E . McKenney, linux-fsdevel,
	Akira Yokosawa, Alan Stern, Andrea Parri, Boqun Feng,
	Daniel Lustig, Darrick J . Wong, Dave Chinner, David Howells,
	Jade Alglave, Luc Maranget, Nicholas Piggin, Peter Zijlstra,
	Will Deacon
In-Reply-To: <20200717174750.GQ12769@casper.infradead.org>

On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote:
> On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote:
> > +If that doesn't apply, you'll have to implement one-time init yourself.
> > +
> > +The simplest implementation just uses a mutex and an 'inited' flag.
> > +This implementation should be used where feasible:
> 
> I think some syntactic sugar should make it feasible for normal people
> to implement the most efficient version of this just like they use locks.

Note that the cmpxchg version is not necessarily the "most efficient".

If the one-time initialization is expensive, e.g. if it allocates a lot of
memory or if takes a long time, it could be better to use the mutex version so
that at most one task does it.

> How about something like this ...
> 
> once.h:
> 
> static struct init_once_pointer {
> 	void *p;
> };
> 
> static inline void *once_get(struct init_once_pointer *oncep)
> { ... }
> 
> static inline bool once_store(struct init_once_pointer *oncep, void *p)
> { ... }
> 
> --- foo.c ---
> 
> struct foo *get_foo(gfp_t gfp)
> {
> 	static struct init_once_pointer my_foo;
> 	struct foo *foop;
> 
> 	foop = once_get(&my_foo);
> 	if (foop)
> 		return foop;
> 
> 	foop = alloc_foo(gfp);
> 	if (!once_store(&my_foo, foop)) {
> 		free_foo(foop);
> 		foop = once_get(&my_foo);
> 	}
> 
> 	return foop;
> }
> 
> Any kernel programmer should be able to handle that pattern.  And no mutex!

I don't think this version would be worthwhile.  It eliminates type safety due
to the use of 'void *', and doesn't actually save any lines of code.  Nor does
it eliminate the need to correctly implement the cmpxchg failure case, which is
tricky (it must free the object and get the new one) and will be rarely tested.

It also forces all users of the struct to use this helper function to access it.
That could be considered a good thing, but it's also bad because even with
one-time init there's still usually some sort of ordering of "initialization"
vs. "use".  Just taking a random example I'm familiar with, we do one-time init
of inode::i_crypt_info when we open an encrypted file, so we guarantee it's set
for all I/O to the file, where we then simply access ->i_crypt_info directly.
We don't want the code to read like it's initializing ->i_crypt_info in the
middle of ->writepages(), since that would be wrong.

An improvement might be to make once_store() take the free function as a
parameter so that it would handle the failure case for you:

struct foo *get_foo(gfp_t gfp)
{
	static struct init_once_pointer my_foo;
	struct foo *foop;
 
 	foop = once_get(&my_foo);
 	if (!foop) {
		foop = alloc_foo(gfp);
		if (foop)
			once_store(&my_foo, foop, free_foo);
	}
 	return foop;
}

I'm not sure even that version would be worthwhile, though.

What I do like is DO_ONCE() in <linux/once.h>, which is used as just:

    DO_ONCE(func)

But it has limitations:

   - Only atomic context
   - Initialization can't fail
   - Only global/static data

We could address the first two limitations by splitting it into DO_ONCE_ATOMIC()
and DO_ONCE_BLOCKING(), and by allowing the initialization function to return an
error code.  That would make it work for all global/static data cases, I think.

Ideally we'd have something almost as simple for non-global/non-static data too.
I'm not sure the best way to do it, though.  It would have to be something more
complex like:

    ONETIME_INIT_DATA(&my_foo, alloc_foo, free_foo)

- Eric

^ permalink raw reply

* Re: [PATCH] git-mv: improve error message for conflicted file
From: Chris Torek @ 2020-07-18  1:35 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Chris Torek via GitGitGadget, Git List
In-Reply-To: <CAPig+cQaqg7MbyNZakuWVzezhPCXu=LonCVAw_p13c=0YNBdPw@mail.gmail.com>

On Fri, Jul 17, 2020 at 4:47 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> Style: write `!ce` rather than `ce == NULL`:

OK, but I'll go with Junio's suggestion of getting `ce` once and
then checking `ce_staged` anyway.  (I'm used to a different
style guide that frowns on `if (ce)` and `if (!ce)`...)

> As for bikeshedding the message itself, perhaps:
>
>     _("conflicted");
>
> Though, perhaps that's too succinct.

Maybe.  Succinct is usually good though.

> > +       touch conflicted &&
>
> If the timestamp of the file is not relevant to the test -- as is the
> case here -- then we avoid using `touch`. Instead:
>
>     >conflicted &&

OK.

> ... use literal TABs and let the here-doc provide the newlines.

I personally hate depending on literal tabs, as they're really
hard to see.  If q_to_tab() is OK I'll use that.

> I realize that this test script is already filled with this sort of
> thing where actions are performed outside of tests, however, these
> days we frown upon that, and there really isn't a good reason to avoid
> taking care of this clean up via the modern idiom of using
> test_when_finished(), which you would call immediately after creating
> the file in the test. So:
>
>     ...
>     >conflicted &&
>     test_when_finished "rm -f conflicted" &&
>     ...

Indeed, that's where I copied it from.

Should I clean up other instances of separated-out `rm -f`s
in this file in a separate commit?

Chris

^ permalink raw reply

* Re: [PATCH net-next] efx: convert to new udp_tunnel infrastructure
From: David Miller @ 2020-07-18  1:34 UTC (permalink / raw)
  To: kuba; +Cc: netdev, linux-net-drivers, ecree, mhabets, mslattery
In-Reply-To: <20200717235336.879264-1-kuba@kernel.org>

From: Jakub Kicinski <kuba@kernel.org>
Date: Fri, 17 Jul 2020 16:53:36 -0700

> Check MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED, before setting
> the info, which will hopefully protect us from -EPERM errors
> the previous code was gracefully ignoring. Shared code reports
> the port information back to user space, so we really want
> to know what was added and what failed.
> 
> The driver does not call udp_tunnel_get_rx_info(), so its own
> management of table state is not really all that problematic,
> we can leave it be. This allows the driver to continue with its
> copious table syncing, and matching the ports to TX frames,
> which it will reportedly do one day.
> 
> Leave the feature checking in the callbacks, as the device may
> remove the capabilities on reset.
> 
> Inline the loop from __efx_ef10_udp_tnl_lookup_port() into
> efx_ef10_udp_tnl_has_port(), since it's the only caller now.
> 
> With new infra this driver gains port replace - when space frees
> up in a full table a new port will be selected for offload.
> Plus efx will no longer sleep in an atomic context.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Edward et al., please review.

Thank you.

^ permalink raw reply

* Re: [PATCH] rhashtable: drop duplicated word in <linux/rhashtable.h>
From: David Miller @ 2020-07-18  1:34 UTC (permalink / raw)
  To: rdunlap; +Cc: linux-kernel, netdev, tgraf, herbert
In-Reply-To: <392beaa8-f240-70b5-b04d-3be910ef68a3@infradead.org>

From: Randy Dunlap <rdunlap@infradead.org>
Date: Fri, 17 Jul 2020 16:37:25 -0700

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Drop the doubled word "be" in a comment.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH] crypto: skcipher.h: drop duplicated word in kernel-doc
From: David Miller @ 2020-07-18  1:33 UTC (permalink / raw)
  To: rdunlap; +Cc: linux-kernel, linux-crypto, herbert
In-Reply-To: <c031a64c-2337-cd9d-e148-ed8365c2365e@infradead.org>

From: Randy Dunlap <rdunlap@infradead.org>
Date: Fri, 17 Jul 2020 16:35:49 -0700

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Drop the doubled word "request" in a kernel-doc comment.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* Re: [PATCH] crypto: hash.h: drop duplicated word in a comment
From: David Miller @ 2020-07-18  1:33 UTC (permalink / raw)
  To: rdunlap; +Cc: linux-kernel, herbert, linux-crypto
In-Reply-To: <83bdec97-38ef-f339-02ad-9066219b32c1@infradead.org>

From: Randy Dunlap <rdunlap@infradead.org>
Date: Fri, 17 Jul 2020 16:35:33 -0700

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Drop the doubled word "in" in a comment.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* Re: Unexpected PACKET_TX_TIMESTAMP Messages
From: Matt Sandy @ 2020-07-18  1:32 UTC (permalink / raw)
  To: Willem de Bruijn; +Cc: Network Development
In-Reply-To: <CA+FuTSeR-M56yJbYNeE4j4+4kQ6Mi4P2DrxQAdoFSkvoWKHxJw@mail.gmail.com>

Got it, thanks! This makes a lot more sense. tl;dr: it's metadata
about the corresponding SOL_SOCKET/SO_TIMESTAMPING cmsg. It also looks
like passing OPT_ID as a socket option should auto-increment the
ee_data field on send. This was the first message sent on the socket
though so I'd expect zero anyway.

On Fri, Jul 17, 2020 at 3:51 PM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> On Fri, Jul 17, 2020 at 1:52 PM Matt Sandy <mooseboys@gmail.com> wrote:
> >
> > I've been playing around with raw sockets and timestamps, but seem to
> > be getting strange timestamp data back on the errqueue. Specifically,
> > if I am creating a socket(AF_PACKET, SOCK_RAW, htons(ETH_P_IP)) and
> > requesting SO_TIMESTAMPING_NEW with options 0x4DF. I am not modifying
> > the flags with control messages.
> >
> > On both send and receive, I get the expected
> > SOL_SOCKET/SO_TIMESTAMPING_NEW cmsg (in errqueue on send, in the
> > message itself on receive), and it contains what appears to be valid
> > timestamps in the ts[0] field. On send, however, I receive an
> > additional cmsg with level = SOL_PACKET/PACKET_TX_TIMESTAMP, whose
> > content is just the fixed value `char[16] { 42, 0, 0, 0, 4, <zeros>
> > }`.
> >
> > Any ideas why I'd be getting the SOL_PACKET message on transmit, and
> > why its payload is clearly not a valid timestamp? In case it matters,
> > this is on an Intel I210 nic using the igb driver.
>
> This is not a char[16], but a struct sock_extended_err.
>
> The first four bytes correspond to __u32 ee_errno, where 42 is ENOMSG.
> The fifth byte is __u8 ee_origin, where 4 corresponds to
> SO_EE_ORIGIN_TIMESTAMPING.
>
> This is metadata stored along with the skb by __skb_complete_tx_timestamp.
> This helps demultiplex timestamps received from the error queue from
> other messages.
>
> Additionally, in the case of timestamps it may include additional
> associated information:
>
>         serr->ee.ee_info = tstype;
>         serr->opt_stats = opt_stats;
>         serr->header.h4.iif = skb->dev ? skb->dev->ifindex : 0;
>         if (sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID) {
>                 serr->ee.ee_data = skb_shinfo(skb)->tskey;
>                 if (sk->sk_protocol == IPPROTO_TCP &&
>                     sk->sk_type == SOCK_STREAM)
>                         serr->ee.ee_data -= sk->sk_tskey;
>         }
>
> The fact that the field after ee_origin is zero means that this is a
> timestamp captured at device transmit (SCM_TSTAMP_SND), for instance.
>
> The csmg_level and type themselves are chosen on recv errqueue in
> packet_recvmsg:
>
>         if (flags & MSG_ERRQUEUE) {
>                 err = sock_recv_errqueue(sk, msg, len,
>                                          SOL_PACKET, PACKET_TX_TIMESTAMP);
>                 goto out;
>         }

^ permalink raw reply

* Re: [PATCH net] net: macb: use phy_interface_mode_is_rgmii everywhere
From: David Miller @ 2020-07-18  1:32 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: nicolas.ferre, kuba, andrew, philippe.schenker, linux, netdev,
	linux-kernel
In-Reply-To: <20200717233221.840294-1-alexandre.belloni@bootlin.com>

From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Sat, 18 Jul 2020 01:32:21 +0200

> There is one RGMII check not using the phy_interface_mode_is_rgmii()
> helper. This prevents the driver from configuring the MAC properly when
> using a phy-mode that is not just rgmii, e.g. rgmii-rxid. This became an
> issue on sama5d3 xplained since the ksz9031 driver is hadling phy-mode
> properly and the phy-mode has to be set to rgmii-rxid.
> 
> Fixes: bcf3440c6dd78bfe ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Applied, thank you.

^ permalink raw reply

* Re: mmotm 2020-07-16-22-52 uploaded (mm/hugetlb.c)
From: Stephen Rothwell @ 2020-07-18  1:32 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Andrew Morton, broonie, linux-fsdevel, linux-kernel, linux-mm,
	linux-next, mhocko, mm-commits
In-Reply-To: <267a50e8-b7b2-b095-d62e-6e95313bc4c2@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

Hi Randy,

On Fri, 17 Jul 2020 08:35:45 -0700 Randy Dunlap <rdunlap@infradead.org> wrote:
>
> on i386:
> 6 of 10 builds failed with:
> 
> ../mm/hugetlb.c:1302:20: error: redefinition of ‘destroy_compound_gigantic_page’
>  static inline void destroy_compound_gigantic_page(struct hstate *h,
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../mm/hugetlb.c:1223:13: note: previous definition of ‘destroy_compound_gigantic_page’ was here
>  static void destroy_compound_gigantic_page(struct hstate *h, struct page *page,
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported here: https://lore.kernel.org/lkml/20200717213127.3bd426e1@canb.auug.org.au/

> ../mm/hugetlb.c:1223:13: warning: ‘destroy_compound_gigantic_page’ defined but not used [-Wunused-function]
> ../mm/hugetlb.c:50:https://lore.kernel.org/lkml/20200709191111.0b63f84d@canb.auug.org.au/20: warning: ‘hugetlb_cma’ defined but not used [-Wunused-variable]
>  static struct cma *hugetlb_cma[MAX_NUMNODES];
>                     ^~~~~~~~~~~

Reported here: https://lore.kernel.org/lkml/20200709191111.0b63f84d@canb.auug.org.au/

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: mmotm 2020-07-16-22-52 uploaded (net: IPVS)
From: Stephen Rothwell @ 2020-07-18  1:27 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Andrew Morton, broonie, linux-fsdevel, linux-kernel, linux-mm,
	linux-next, mhocko, mm-commits, netdev@vger.kernel.org,
	Wensong Zhang, Simon Horman, Julian Anastasov, lvs-devel,
	Andrew Sy Kim, Pablo Neira Ayuso
In-Reply-To: <88196a8a-2778-0324-8005-d63bfee86c4e@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

Hi all,

On Fri, 17 Jul 2020 08:30:04 -0700 Randy Dunlap <rdunlap@infradead.org> wrote:
>
> (also in linux-next)
> 
> Many of these errors:
> 
> In file included from ../net/netfilter/ipvs/ip_vs_conn.c:37:0:
> ../include/net/ip_vs.h: In function ‘ip_vs_enqueue_expire_nodest_conns’:
> ../include/net/ip_vs.h:1536:61: error: parameter name omitted
>  static inline void ip_vs_enqueue_expire_nodest_conns(struct netns_ipvs) {}

Caused by commit

  04231e52d355 ("ipvs: queue delayed work to expire no destination connections if expire_nodest_conn=1")

from the netfilter-next tree.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] net: bnxt: don't complain if TC flower can't be supported
From: David Miller @ 2020-07-18  1:26 UTC (permalink / raw)
  To: kuba; +Cc: netdev, kernel-team, michael.chan
In-Reply-To: <20200717205958.163031-1-kuba@kernel.org>

From: Jakub Kicinski <kuba@kernel.org>
Date: Fri, 17 Jul 2020 13:59:58 -0700

> The fact that NETIF_F_HW_TC is not set should be a sufficient
> indication to the user that TC offloads are not supported.
> No need to bother users of older firmware versions with
> pointless warnings on every boot.
> 
> Also, since the support is optional, bnxt_init_tc() should not
> return an error in case FW is old, similarly to how error
> is not returned when CONFIG_BNXT_FLOWER_OFFLOAD is not set.
> 
> With that we can add an error message to the caller, to warn
> about actual unexpected failures.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Applied, thank you.

^ permalink raw reply

* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Alan Stern @ 2020-07-18  1:25 UTC (permalink / raw)
  To: Eric Biggers
  Cc: Darrick J. Wong, linux-kernel, linux-arch, Paul E . McKenney,
	linux-fsdevel, Akira Yokosawa, Andrea Parri, Boqun Feng,
	Daniel Lustig, Dave Chinner, David Howells, Jade Alglave,
	Luc Maranget, Nicholas Piggin, Peter Zijlstra, Will Deacon
In-Reply-To: <20200718005857.GB2183@sol.localdomain>

On Fri, Jul 17, 2020 at 05:58:57PM -0700, Eric Biggers wrote:
> On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote:
> > > +There are also cases in which the smp_load_acquire() can be replaced by
> > > +the more lightweight READ_ONCE().  (smp_store_release() is still
> > > +required.)  Specifically, if all initialized memory is transitively
> > > +reachable from the pointer itself, then there is no control dependency
> > 
> > I don't quite understand what "transitively reachable from the pointer
> > itself" means?  Does that describe the situation where all the objects
> > reachable through the object that the global struct foo pointer points
> > at are /only/ reachable via that global pointer?
> > 
> 
> The intent is that "transitively reachable" means that all initialized memory
> can be reached by dereferencing the pointer in some way, e.g. p->a->b[5]->c.
> 
> It could also be the case that allocating the object initializes some global or
> static data, which isn't reachable in that way.  Access to that data would then
> be a control dependency, which a data dependency barrier wouldn't work for.
> 
> It's possible I misunderstood something.  (Note the next paragraph does say that
> using READ_ONCE() is discouraged, exactly for this reason -- it can be hard to
> tell whether it's correct.)  Suggestions of what to write here are appreciated.

Perhaps something like this:

	Specifically, if the only way to reach the initialized memory 
	involves dereferencing the pointer itself then READ_ONCE() is 
	sufficient.  This is because there will be an address dependency 
	between reading the pointer and accessing the memory, which will 
	ensure proper ordering.  But if some of the initialized memory 
	is reachable some other way (for example, if it is global or 
	static data) then there need not be an address dependency, 
	merely a control dependency (checking whether the pointer is 
	non-NULL).  Control dependencies do not always ensure ordering 
	-- certainly not for reads, and depending on the compiler, 
	possibly not for some writes -- and therefore a load-acquire is 
	necessary.

Perhaps this is more wordy than you want, but it does get the important 
ideas across.

Alan Stern

^ permalink raw reply

* Re: [PATCH net] net: atlantic: disable PTP on AQC111, AQC112
From: David Miller @ 2020-07-18  1:25 UTC (permalink / raw)
  To: mstarovoitov; +Cc: kuba, irusskikh, netdev, linux-kernel, ndanilov
In-Reply-To: <20200717203949.9098-1-mstarovoitov@marvell.com>

From: Mark Starovoytov <mstarovoitov@marvell.com>
Date: Fri, 17 Jul 2020 23:39:49 +0300

> From: Nikita Danilov <ndanilov@marvell.com>
> 
> This patch disables PTP on AQC111 and AQC112 due to a known HW issue,
> which can cause datapath issues.
> 
> Ideally PTP block should have been disabled via PHY provisioning, but
> unfortunately many units have been shipped with enabled PTP block.
> Thus, we have to work around this in the driver.
> 
> Fixes: dbcd6806af420 ("net: aquantia: add support for Phy access")
> Signed-off-by: Nikita Danilov <ndanilov@marvell.com>
> Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>

Applied and queued up for -stable, thank you.

^ permalink raw reply

* [PATCH 0/9] mmc: fsl_esdhc: support eMMC HS200/HS400 modes
From: Jaehoon Chung @ 2020-07-18  1:21 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <AM7PR04MB688508333CAADD6FC1332755F87C0@AM7PR04MB6885.eurprd04.prod.outlook.com>

On 7/17/20 5:48 PM, Y.b. Lu wrote:
> Hi Jaehoon,
> 
> Below is the full log of the performance and function tests for eMMC HS400 mode. Since I used date to record time, there must be some error more or less.
> I tested the r/w performance with 4G data size at 175MHz bus speed. The results were,
> Read: 273MB/s = 4096MB / 15s
> Write: 74MB/s = 4096MB / 55s
> 
> According to the eMMC data sheet the HS400 max performance for sequential r/w are,
> Read: 270MB/s
> Write: 90MB/s
> 
> The performance seems to be matched and good.
> BTW, the test was applied two more patches to fix stability issue. Let me send out v2 patch-set with them.
> Thanks.

Thanks for sharing result. I will check your patch-v2.

Best Regards,
Jaehoon Chung

> 
> ============ log ======================
> NOTICE:  BL2: v1.5(release):LSDK-20.04
> NOTICE:  BL2: Built : 05:20:45, Apr  9 2020
> NOTICE:  UDIMM 18ADF2G72AZ-3G2E1
> NOTICE:  DDR4 UDIMM with 2-rank 64-bit bus (x8)
> 
> NOTICE:  32 GB DDR4, 64-bit, CL=22, ECC on, 256B, CS0+CS1
> NOTICE:  BL2: Booting BL31
> NOTICE:  BL31: v1.5(release):LSDK-20.04
> NOTICE:  BL31: Built : 11:00:17, Jul 15 2020
> NOTICE:  Welcome to LX2160 BL31 Phase
> 
> 
> U-Boot 2020.07-00703-g1b677f8 (Jul 17 2020 - 16:30:43 +0800)
> 
> SoC:  LX2160ACE Rev2.0 (0x87360020)
> Clock Configuration:
>        CPU0(A72):2000 MHz  CPU1(A72):2000 MHz  CPU2(A72):2000 MHz
>        CPU3(A72):2000 MHz  CPU4(A72):2000 MHz  CPU5(A72):2000 MHz
>        CPU6(A72):2000 MHz  CPU7(A72):2000 MHz  CPU8(A72):2000 MHz
>        CPU9(A72):2000 MHz  CPU10(A72):2000 MHz  CPU11(A72):2000 MHz
>        CPU12(A72):2000 MHz  CPU13(A72):2000 MHz  CPU14(A72):2000 MHz
>        CPU15(A72):2000 MHz
>        Bus:      700  MHz  DDR:      2900 MT/s
> Reset Configuration Word (RCW):
>        00000000: 50777738 24500050 00000000 00000000
>        00000010: 00000000 0c010000 00000000 00000000
>        00000020: 02e001a0 00002580 00000000 00000096
>        00000030: 00000000 00000000 00000000 00000000
>        00000040: 00000000 00000000 00000000 00000000
>        00000050: 00000000 00000000 00000000 00000000
>        00000060: 00000000 00000000 00027000 00000000
>        00000070: 08b30010 00150020
> Model: NXP Layerscape LX2160ARDB Board
> Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#1
> FPGA: v7.0
> SERDES1 Reference: Clock1 = 161.13MHz Clock2 = 161.13MHz
> SERDES2 Reference: Clock1 = 100MHz Clock2 = 100MHz
> SERDES3 Reference: Clock1 = 100MHz Clock2 = 100MHz
> VID: Core voltage after adjustment is at 852 mV
> DRAM:  31.9 GiB
> DDR    31.9 GiB (DDR4, 64-bit, CL=22, ECC on)
>        DDR Controller Interleaving Mode: 256B
>        DDR Chip-Select Interleaving Mode: CS0+CS1
> Using SERDES1 Protocol: 19 (0x13)
> Using SERDES2 Protocol: 5 (0x5)
> Using SERDES3 Protocol: 2 (0x2)
> PCIe0: pcie at 3400000 disabled
> PCIe1: pcie at 3500000 disabled
> PCIe2: pcie at 3600000 Root Complex: x1 gen1
> PCI: Failed autoconfig bar 18
> PCIe3: pcie at 3700000 disabled
> PCIe4: pcie at 3800000 Root Complex: no link
> PCIe5: pcie at 3900000 disabled
> MMC:   FSL_SDHC: 0, FSL_SDHC: 1
> Loading Environment from SPI Flash... SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB
> *** Warning - bad CRC, using default environment
> 
> EEPROM: NXID v1
> In:    serial_pl01x
> Out:   serial_pl01x
> Err:   serial_pl01x
> Net:   e1000: 68:05:ca:31:2c:73
> 
> Warning: e1000#0 MAC addresses don't match:
> Address in ROM is               68:05:ca:31:2c:73
> Address in environment is       00:04:9f:05:84:57
> eth0: DPMAC3 at usxgmii, eth1: DPMAC4 at usxgmii, eth2: DPMAC17 at rgmii-id, eth3: DPMAC18 at rgmii-id, eth4: e1000#0
> SF: Detected mt35xu512aba with page size 256 Bytes, erase size 128 KiB, total 64 MiB
> device 0 offset 0x640000, size 0x80000
> SF: 524288 bytes @ 0x640000 Read: OK
> device 0 offset 0xa00000, size 0x300000
> SF: 3145728 bytes @ 0xa00000 Read: OK
> device 0 offset 0xe00000, size 0x100000
> SF: 1048576 bytes @ 0xe00000 Read: OK
> crc32+
> fsl-mc: Booting Management Complex ... SUCCESS
> fsl-mc: Management Complex booted (version: 10.20.4, boot status: 0x1)
> Hit any key to stop autoboot:  0
> => mmc dev 1
> switch to partitions #0, OK
> mmc1(part 0) is current device
> => mmcinfo
> Device: FSL_SDHC
> Manufacturer ID: 13
> OEM: 14e
> Name: R1J59
> Bus Speed: 175000000
> Mode: HS400 (200MHz)
> Rd Block Len: 512
> MMC version 5.0
> High Capacity: Yes
> Capacity: 116.5 GiB
> Bus Width: 8-bit DDR
> Erase Group Size: 512 KiB
> HC WP Group Size: 32 MiB
> User Capacity: 116.5 GiB WRREL
> Boot Capacity: 8 MiB ENH
> RPMB Capacity: 4 MiB ENH
> Boot area 0 is not write protected
> Boot area 1 is not write protected
> => date;mmc read 81000000 0 200000;mmc read 81000000 0 200000;mmc read 81000000 0 200000;mmc read 81000000 0 200000;date
> Date: 2020-07-17 (Friday)    Time:  7:46:18
> 
> MMC read: dev # 1, block # 0, count 2097152 ... 2097152 blocks read: OK
> 
> MMC read: dev # 1, block # 0, count 2097152 ... 2097152 blocks read: OK
> 
> MMC read: dev # 1, block # 0, count 2097152 ... 2097152 blocks read: OK
> 
> MMC read: dev # 1, block # 0, count 2097152 ... 2097152 blocks read: OK
> Date: 2020-07-17 (Friday)    Time:  7:46:33
> => date;mmc write 81000000 0 200000;mmc write 81000000 0 200000;mmc write 81000000 0 200000;mmc write 81000000 0 200000;date
> Date: 2020-07-17 (Friday)    Time:  7:47:08
> 
> MMC write: dev # 1, block # 0, count 2097152 ... 2097152 blocks written: OK
> 
> MMC write: dev # 1, block # 0, count 2097152 ... 2097152 blocks written: OK
> 
> MMC write: dev # 1, block # 0, count 2097152 ... 2097152 blocks written: OK
> 
> MMC write: dev # 1, block # 0, count 2097152 ... 2097152 blocks written: OK
> Date: 2020-07-17 (Friday)    Time:  7:48:03
> => mw.l 81000000 55555555 1000;mw.l 82000000 aaaaaaaa 1000;mmc write 81000000 0 100;mmc read 82000000 0 100;cmp.b 81000000 82000000 100
> 
> MMC write: dev # 1, block # 0, count 256 ... 256 blocks written: OK
> 
> MMC read: dev # 1, block # 0, count 256 ... 256 blocks read: OK
> Total of 256 byte(s) were the same
> =>
> 
> 
> Best regards,
> Yangbo Lu
> 
> 
>> -----Original Message-----
>> From: Jaehoon Chung <jh80.chung@samsung.com>
>> Sent: Friday, July 17, 2020 8:31 AM
>> To: Y.b. Lu <yangbo.lu@nxp.com>; u-boot at lists.denx.de; Peng Fan
>> <peng.fan@nxp.com>; Priyanka Jain <priyanka.jain@nxp.com>
>> Subject: Re: [PATCH 0/9] mmc: fsl_esdhc: support eMMC HS200/HS400 modes
>>
>> Hi Yangbo,
>>
>> On 7/16/20 11:29 AM, Yangbo Lu wrote:
>>> This patch-set is to support eMMC HS200 and HS400 speed modes for
>>> eSDHC, and enable them on LX2160ARDB board.
>>
>> Is there any result about performance?
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>
>>> CI build link
>>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-ci
>> .org%2Fgithub%2Fyangbolu1991%2Fu-boot-test%2Fbuilds%2F708215558&a
>> mp;data=02%7C01%7Cyangbo.lu%40nxp.com%7Ca438d5eb0d9b4c7c660708
>> d829e8bc25%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63730
>> 5426855786897&amp;sdata=h54G7iKDdtmVRyuU0mZ7aZ06To3EqDc%2BRL3
>> 0SFYtaWE%3D&amp;reserved=0
>>>
>>> Yangbo Lu (9):
>>>   mmc: add a reinit() API
>>>   mmc: fsl_esdhc: add a reinit() callback
>>>   mmc: fsl_esdhc: support tuning for eMMC HS200
>>>   mmc: fsl_esdhc: clean TBCTL[TB_EN] manually during init
>>>   mmc: add a hs400_tuning flag
>>>   mmc: add a mmc_hs400_prepare_ddr() interface
>>>   mmc: fsl_esdhc: support eMMC HS400 mode
>>>   arm: dts: lx2160ardb: support eMMC HS400 mode
>>>   configs: lx2160ardb: enable eMMC HS400 mode support
>>>
>>>  arch/arm/dts/fsl-lx2160a-rdb.dts             |   2 +
>>>  configs/lx2160ardb_tfa_SECURE_BOOT_defconfig |   1 +
>>>  configs/lx2160ardb_tfa_defconfig             |   1 +
>>>  configs/lx2160ardb_tfa_stmm_defconfig        |   1 +
>>>  drivers/mmc/fsl_esdhc.c                      | 148
>> ++++++++++++++++++++++++++-
>>>  drivers/mmc/mmc-uclass.c                     |  30 ++++++
>>>  drivers/mmc/mmc.c                            |  12 ++-
>>>  include/fsl_esdhc.h                          |  29 +++++-
>>>  include/mmc.h                                |  26 ++++-
>>>  9 files changed, 240 insertions(+), 10 deletions(-)
>>>
> 

^ permalink raw reply

* Re: [ANNOUNCE] Git for Windows 2.28.0-rc1
From: Derrick Stolee @ 2020-07-18  1:16 UTC (permalink / raw)
  To: Johannes Schindelin, git-for-windows, git, git-packagers
In-Reply-To: <20200718011007.6808-1-johannes.schindelin@gmx.de>

On 7/17/2020 9:10 PM, Johannes Schindelin wrote:
> Dear Git users,
> 
> I hereby announce that Git for Windows 2.28.0-rc1 is available from:
> 
>     https://github.com/git-for-windows/git/releases/tag/v2.28.0-rc1.windows.1

While this (automated) email came from Johannes, I want to point
out that I'm taking point on this and the remaining releases of
Git for Windows in the 2.28.0 cycle while Johannes takes a well-
deserved vacation.

Please continue to use the issue tracker at
https://github.com/git-for-windows/git/issues for any problems.
Also, don't hesitate to CC me.

Thanks,
-Stolee

^ permalink raw reply

* [ANNOUNCE] Git for Windows 2.28.0-rc1
From: Johannes Schindelin @ 2020-07-18  1:10 UTC (permalink / raw)
  To: git-for-windows, git, git-packagers; +Cc: Johannes Schindelin

Dear Git users,

I hereby announce that Git for Windows 2.28.0-rc1 is available from:

    https://github.com/git-for-windows/git/releases/tag/v2.28.0-rc1.windows.1

Changes since Git for Windows v2.27.0 (June 1st 2020)

New Features

  * Comes with Git v2.28.0-rc1.
  * Comes with subversion v1.14.0.
  * Comes with the designated successor of Git Credential Manager for
    Windows (GCM for Windows), the cross-platform Git Credential
    Manager Core. For now, this is opt-in, with the idea of eventually
    retiring GCM for Windows.
  * Comes with cURL v7.71.1.
  * Comes with Perl v5.32.0.
  * Comes with MSYS2 runtime (Git for Windows flavor) based on Cygwin
    3.1.6 (including the improvements of Cygwin 3.1.5).
  * Comes with GNU Privacy Guard v2.2.21.

Bug Fixes

  * A typo was fixed in the installer.
  * The new git pull behavior option now records the fast-forward
    choice correctly.
  * In v2.27.0, git svn was broken completely, which has been fixed.
  * Some Git operations could end up with bogus modified symbolic links
    (where git status would report changes but git diff would not),
    which is now fixed.
  * When reinstalling (or upgrading) Git for Windows, the "Pseudo
    Console Support" choice is now remembered correctly.
  * Under certain circumstances, the Git Bash window (MinTTY) would
    crash frequently, which has been addressed.
  * When pseudo console support is enabled, the VIM editor sometimes
    had troubles accepting certain keystrokes, which was fixed.
  * Due to a bug, it was not possible to disable Pseudo Console support
    by reinstalling with the checkbox turned off, which has been fixed.
  * A bug with enabled Pseudo Console support, where git add -i would
    not quit the file selection mode upon an empty input, has been
    fixed.
  * The cleanup mode called "scissors" in git commit now handles CR/LF
    line endings correctly.
  * When cloning into an existing directory, under certain
    circumstances, the core.worktree option was set unnecessarily. This
    has been fixed.

Git-2.28.0-rc1-64-bit.exe | 15a73c06141512c93dd0ad92f0aba1628bd6294162b44fb24baba7d05e5c636c
Git-2.28.0-rc1-32-bit.exe | 1a12463d484068e73b218a9a1d2d98b7924699fefbc7baa4a06054ea8a6597cb
PortableGit-2.28.0-rc1-64-bit.7z.exe | 90f6bc4ba6af69375acb286c45fa2ec01d91b0e67a4d851a9e9d7507e8486437
PortableGit-2.28.0-rc1-32-bit.7z.exe | c4e0e659e34f47e679c9882b2bc3c184e0b6ca58f850ce91764cfc19d5f002f3
MinGit-2.28.0-rc1-64-bit.zip | 08edf0ea9f94e511eea3abcc1c3fab6967bbf6e14fe7dcf619c3218b6f038c66
MinGit-2.28.0-rc1-32-bit.zip | ee21cc0648bf2e0f96e331fd6f8a4af4cd01375e18c8980a835baa148b0c1b81
MinGit-2.28.0-rc1-busybox-64-bit.zip | 76b1e67705bd7ea92364e286a6d3e35a1c5b5fb47b80f4cc82a581e478464e99
MinGit-2.28.0-rc1-busybox-32-bit.zip | 2a53b2e632e039a4ed0db3656c6d8394df4111bfcd5ca263067c62ddfff2a3f7
Git-2.28.0-rc1-64-bit.tar.bz2 | 62b70980b712be2ff02b264b77f645d260651053d58eec0191838eaf6b1d59d5
Git-2.28.0-rc1-32-bit.tar.bz2 | cccf7f9696945b2b471fcc4dcad296d61382205bb8d8d64b0a84e950bf1d20d9

Ciao,
Johannes

^ permalink raw reply

* Re: [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap
From: Atish Patra @ 2020-07-18  1:05 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, linux-efi, Kees Cook, Heinrich Schuchardt,
	Masahiro Yamada, Anup Patel, linux-kernel@vger.kernel.org,
	Mike Rapoport, Atish Patra, Palmer Dabbelt, Zong Li,
	Paul Walmsley, Greentime Hu, linux-riscv, Will Deacon,
	Ard Biesheuvel, Linux ARM
In-Reply-To: <CAK8P3a2EesjQAs-YGrCO=cYfUVWFQ3CbJfVXJx3qZjCS_XW+wA@mail.gmail.com>

On Thu, Jul 16, 2020 at 11:32 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, Jul 17, 2020 at 1:41 AM Atish Patra <atish.patra@wdc.com> wrote:
> >
> > From: Anup Patel <anup.patel@wdc.com>
> >
> > Currently, RISC-V reserves 1MB of fixmap memory for device tree. However,
> > it maps only single PMD (2MB) space for fixmap which leaves only < 1MB space
> > left for other kernel features such as early ioremap which requires fixmap
> > as well. The fixmap size can be increased by another 2MB but it brings
> > additional complexity and changes the virtual memory layout as well.
> > If we require some additional feature requiring fixmap again, it has to be
> > moved again.
> >
> > Technically, DT doesn't need a fixmap as the memory occupied by the DT is
> > only used during boot. Thus, init memory section can be used for the same
> > purpose as well. This simplifies fixmap implementation.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > Signed-off-by: Atish Patra <atish.patra@wdc.com>
>
> The patch seems fine for the moment, but I have one concern for the
> long run:
>
> > +#define DTB_EARLY_SIZE         SZ_1M
> > +static char early_dtb[DTB_EARLY_SIZE] __initdata;
>
> Hardcoding the size in .bss seems slightly problematic both for
> small and for big systems. On machines with very little memory,
> this can lead to running out of free pages before .initdata gets freed,
> and it increases the size of the uncompressed vmlinux file by quite
> a bit.
>
> On some systems, the 1MB limit may get too small. While most dtbs
> would fall into the range between 10KB and 100KB, it can also be
> much larger than that, e.g. when there are DT properties that include
> blobs like device firmware that gets loaded into hardware by a kernel
> driver.
>
I was not aware that we can do such things. Is there a current example of that ?

> Is there anything stopping you from parsing the FDT in its original
> location without the extra copy before it gets unflattened?
>

That's what the original code was doing. A fixmap entry was added to
map the original fdt
location to a virtual so that parse_dtb can be operated on a virtual
address. But we can't map
both FDT & early ioremap within a single PMD region( 2MB ). That's why
we removed the DT
mapping from the fixmap to .bss section. The other alternate option is
to increase the fixmap space to
4MB which seems more fragile.

>        Arnd



-- 
Regards,
Atish

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* [renesas-devel:master] BUILD SUCCESS 2b913e80d50bfd17088670569460220937257212
From: kernel test robot @ 2020-07-18  1:05 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git  master
branch HEAD: 2b913e80d50bfd17088670569460220937257212  Merge branch 'renesas-next' into renesas-devel

elapsed time: 765m

configs tested: 98
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

arm                                 defconfig
arm                              allyesconfig
arm                              allmodconfig
arm                               allnoconfig
arm64                            allyesconfig
arm64                               defconfig
arm64                            allmodconfig
arm64                             allnoconfig
nds32                             allnoconfig
powerpc                      ppc64e_defconfig
arm                           viper_defconfig
ia64                             alldefconfig
sh                           se7721_defconfig
ia64                          tiger_defconfig
mips                        jmr3927_defconfig
arm                            xcep_defconfig
h8300                            allyesconfig
powerpc                 linkstation_defconfig
sparc                       sparc32_defconfig
arm                          badge4_defconfig
powerpc                      pmac32_defconfig
riscv                          rv32_defconfig
i386                             allyesconfig
i386                                defconfig
i386                              debian-10.3
i386                              allnoconfig
ia64                             allmodconfig
ia64                                defconfig
ia64                              allnoconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                              allnoconfig
m68k                           sun3_defconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
nios2                            allyesconfig
openrisc                            defconfig
c6x                              allyesconfig
c6x                               allnoconfig
openrisc                         allyesconfig
nds32                               defconfig
csky                             allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allmodconfig
xtensa                              defconfig
arc                                 defconfig
arc                              allyesconfig
sh                               allmodconfig
sh                                allnoconfig
microblaze                        allnoconfig
mips                             allyesconfig
mips                              allnoconfig
mips                             allmodconfig
parisc                            allnoconfig
parisc                              defconfig
parisc                           allyesconfig
parisc                           allmodconfig
powerpc                             defconfig
powerpc                          allyesconfig
powerpc                          rhel-kconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
i386                 randconfig-a016-20200717
i386                 randconfig-a011-20200717
i386                 randconfig-a015-20200717
i386                 randconfig-a012-20200717
i386                 randconfig-a013-20200717
i386                 randconfig-a014-20200717
x86_64               randconfig-a005-20200717
x86_64               randconfig-a006-20200717
x86_64               randconfig-a002-20200717
x86_64               randconfig-a001-20200717
x86_64               randconfig-a003-20200717
x86_64               randconfig-a004-20200717
riscv                            allyesconfig
riscv                             allnoconfig
riscv                               defconfig
riscv                            allmodconfig
s390                             allyesconfig
s390                              allnoconfig
s390                             allmodconfig
s390                                defconfig
sparc                            allyesconfig
sparc                               defconfig
sparc64                             defconfig
sparc64                           allnoconfig
sparc64                          allyesconfig
sparc64                          allmodconfig
x86_64                    rhel-7.6-kselftests
x86_64                               rhel-8.3
x86_64                                  kexec
x86_64                                   rhel
x86_64                                    lkp
x86_64                              fedora-25

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.