LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver
From: Christian Zigotzky @ 2021-10-09 13:57 UTC (permalink / raw)
  To: Wolfram Sang, Sven Peter, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, Olof Johansson,
	Arnd Bergmann, Hector Martin, Mohamed Mediouni, Stan Skowronek,
	Mark Kettenis, Alyssa Rosenzweig, linux-arm-kernel, linuxppc-dev,
	linux-i2c, linux-kernel, R.T.Dickinson, Matthew Leaman,
	Darren Stevens
In-Reply-To: <YWFqr4uQGlNgnT1z@ninjato>

On 09 October 2021 at 12:10 pm, Wolfram Sang wrote:
>> I still don't have access to any old PASemi hardware but the changes from
>> v1 are pretty small and I expect them to still work. Would still be nice
>> if someone with access to such hardware could give this a quick test.
> Looks good to me. I will wait a few more days so that people can report
> their tests. But it will be in the next merge window.
>
Series v2:

Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> [1]

- Christian

[1] https://forum.hyperion-entertainment.com/viewtopic.php?p=54213#p54213

^ permalink raw reply

* Re: [PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()
From: Greg KH @ 2021-10-09 11:58 UTC (permalink / raw)
  To: Xianting Tian
  Cc: arnd, amit, jirislaby, shile.zhang, linux-kernel, virtualization,
	linuxppc-dev, osandov
In-Reply-To: <20211009114829.1071021-3-xianting.tian@linux.alibaba.com>

On Sat, Oct 09, 2021 at 07:48:28PM +0800, Xianting Tian wrote:
> --- a/drivers/tty/hvc/hvc_console.h
> +++ b/drivers/tty/hvc/hvc_console.h
> @@ -32,13 +32,21 @@
>   */
>  #define HVC_ALLOC_TTY_ADAPTERS	8
>  
> +/*
> + * These sizes are most efficient for vio, because they are the
> + * native transfer size. We could make them selectable in the
> + * future to better deal with backends that want other buffer sizes.
> + */
> +#define N_OUTBUF	16
> +#define N_INBUF		16
> +
> +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))

Does this conflict with what is in hvcs.c?

> +
>  struct hvc_struct {
>  	struct tty_port port;
>  	spinlock_t lock;
>  	int index;
>  	int do_wakeup;
> -	char *outbuf;
> -	int outbuf_size;
>  	int n_outbuf;
>  	uint32_t vtermno;
>  	const struct hv_ops *ops;
> @@ -48,6 +56,18 @@ struct hvc_struct {
>  	struct work_struct tty_resize;
>  	struct list_head next;
>  	unsigned long flags;
> +
> +	/* the buf is used in hvc console api for putting chars */
> +	char cons_outbuf[N_OUTBUF] __ALIGNED__;
> +	spinlock_t cons_outbuf_lock;

Did you look at the placement using pahole as to how this structure now
looks?

> +
> +	/* the buf is for putting single char to tty */
> +	char outchar;
> +	spinlock_t outchar_lock;

So you have a lock for a character and a different one for a longer
string?  Why can they not just use the same lock?  Why are 2 needed at
all, can't you just use the first character of cons_outbuf[] instead?
Surely you do not have 2 sends happening at the same time, right?

> +
> +	/* the buf is for putting chars to tty */
> +	int outbuf_size;
> +	char outbuf[0] __ALIGNED__;

I thought we were not allowing [0] anymore in kernel structures?

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()
From: Greg KH @ 2021-10-09 11:55 UTC (permalink / raw)
  To: Xianting Tian
  Cc: arnd, amit, jirislaby, shile.zhang, linux-kernel, virtualization,
	linuxppc-dev, osandov
In-Reply-To: <20211009114829.1071021-3-xianting.tian@linux.alibaba.com>

On Sat, Oct 09, 2021 at 07:48:28PM +0800, Xianting Tian wrote:
> As well known, hvc backend can register its opertions to hvc backend.
> the operations contain put_chars(), get_chars() and so on.
> 
> Some hvc backend may do dma in its operations. eg, put_chars() of
> virtio-console. But in the code of hvc framework, it may pass DMA
> incapable memory to put_chars() under a specific configuration, which
> is explained in commit c4baad5029(virtio-console: avoid DMA from stack):
> 1, c[] is on stack,
>    hvc_console_print():
> 	char c[N_OUTBUF] __ALIGNED__;
> 	cons_ops[index]->put_chars(vtermnos[index], c, i);
> 2, ch is on stack,
>    static void hvc_poll_put_char(,,char ch)
>    {
> 	struct tty_struct *tty = driver->ttys[0];
> 	struct hvc_struct *hp = tty->driver_data;
> 	int n;
> 
> 	do {
> 		n = hp->ops->put_chars(hp->vtermno, &ch, 1);
> 	} while (n <= 0);
>    }
> 
> Commit c4baad5029 is just the fix to avoid DMA from stack memory, which
> is passed to virtio-console by hvc framework in above code. But I think
> the fix is aggressive, it directly uses kmemdup() to alloc new buffer
> from kmalloc area and do memcpy no matter the memory is in kmalloc area
> or not. But most importantly, it should better be fixed in the hvc
> framework, by changing it to never pass stack memory to the put_chars()
> function in the first place. Otherwise, we still face the same issue if
> a new hvc backend using dma added in the furture.
> 
> In this patch, add 'char cons_outbuf[]' as part of 'struct hvc_struct',
> so hp->cons_outbuf is no longer the stack memory, we can use it in above
> case 1. Add 'char outchar' as part of 'struct hvc_struct', we can use it
> in above case 2. We also add lock for each above buf to protect them
> separately instead of using the global lock of hvc.
> 
> Introduce another array(cons_hvcs[]) for hvc pointers next to the
> cons_ops[] and vtermnos[] arrays. With the array, we can easily find
> hvc's cons_outbuf and its lock.
> 
> With the patch, we can revert the fix c4baad5029.
> 
> Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
> Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
> ---
>  drivers/tty/hvc/hvc_console.c | 37 +++++++++++++++++++++--------------
>  drivers/tty/hvc/hvc_console.h | 24 +++++++++++++++++++++--
>  2 files changed, 44 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
> index 5bb8c4e44..4d8f112f2 100644
> --- a/drivers/tty/hvc/hvc_console.c
> +++ b/drivers/tty/hvc/hvc_console.c
> @@ -41,16 +41,6 @@
>   */
>  #define HVC_CLOSE_WAIT (HZ/100) /* 1/10 of a second */
>  
> -/*
> - * These sizes are most efficient for vio, because they are the
> - * native transfer size. We could make them selectable in the
> - * future to better deal with backends that want other buffer sizes.
> - */
> -#define N_OUTBUF	16
> -#define N_INBUF		16
> -
> -#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
> -

Are you sure this applies on top of patch 1/3 here?

> +/*
> + * These sizes are most efficient for vio, because they are the
> + * native transfer size. We could make them selectable in the
> + * future to better deal with backends that want other buffer sizes.
> + */
> +#define N_OUTBUF	16
> +#define N_INBUF		16
> +
> +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))

Again, are you sure this is correct?

thanks,

greg k-h

^ permalink raw reply

* [PATCH v10 2/3] tty: hvc: pass DMA capable memory to put_chars()
From: Xianting Tian @ 2021-10-09 11:48 UTC (permalink / raw)
  To: gregkh, jirislaby, amit, arnd, osandov
  Cc: Xianting Tian, shile.zhang, linuxppc-dev, linux-kernel,
	virtualization
In-Reply-To: <20211009114829.1071021-1-xianting.tian@linux.alibaba.com>

As well known, hvc backend can register its opertions to hvc backend.
the operations contain put_chars(), get_chars() and so on.

Some hvc backend may do dma in its operations. eg, put_chars() of
virtio-console. But in the code of hvc framework, it may pass DMA
incapable memory to put_chars() under a specific configuration, which
is explained in commit c4baad5029(virtio-console: avoid DMA from stack):
1, c[] is on stack,
   hvc_console_print():
	char c[N_OUTBUF] __ALIGNED__;
	cons_ops[index]->put_chars(vtermnos[index], c, i);
2, ch is on stack,
   static void hvc_poll_put_char(,,char ch)
   {
	struct tty_struct *tty = driver->ttys[0];
	struct hvc_struct *hp = tty->driver_data;
	int n;

	do {
		n = hp->ops->put_chars(hp->vtermno, &ch, 1);
	} while (n <= 0);
   }

Commit c4baad5029 is just the fix to avoid DMA from stack memory, which
is passed to virtio-console by hvc framework in above code. But I think
the fix is aggressive, it directly uses kmemdup() to alloc new buffer
from kmalloc area and do memcpy no matter the memory is in kmalloc area
or not. But most importantly, it should better be fixed in the hvc
framework, by changing it to never pass stack memory to the put_chars()
function in the first place. Otherwise, we still face the same issue if
a new hvc backend using dma added in the furture.

In this patch, add 'char cons_outbuf[]' as part of 'struct hvc_struct',
so hp->cons_outbuf is no longer the stack memory, we can use it in above
case 1. Add 'char outchar' as part of 'struct hvc_struct', we can use it
in above case 2. We also add lock for each above buf to protect them
separately instead of using the global lock of hvc.

Introduce another array(cons_hvcs[]) for hvc pointers next to the
cons_ops[] and vtermnos[] arrays. With the array, we can easily find
hvc's cons_outbuf and its lock.

With the patch, we can revert the fix c4baad5029.

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
 drivers/tty/hvc/hvc_console.c | 37 +++++++++++++++++++++--------------
 drivers/tty/hvc/hvc_console.h | 24 +++++++++++++++++++++--
 2 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 5bb8c4e44..4d8f112f2 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -41,16 +41,6 @@
  */
 #define HVC_CLOSE_WAIT (HZ/100) /* 1/10 of a second */
 
-/*
- * These sizes are most efficient for vio, because they are the
- * native transfer size. We could make them selectable in the
- * future to better deal with backends that want other buffer sizes.
- */
-#define N_OUTBUF	16
-#define N_INBUF		16
-
-#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
-
 static struct tty_driver *hvc_driver;
 static struct task_struct *hvc_task;
 
@@ -142,6 +132,7 @@ static int hvc_flush(struct hvc_struct *hp)
 static const struct hv_ops *cons_ops[MAX_NR_HVC_CONSOLES];
 static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
 	{[0 ... MAX_NR_HVC_CONSOLES - 1] = -1};
+static struct hvc_struct *cons_hvcs[MAX_NR_HVC_CONSOLES];
 
 /*
  * Console APIs, NOT TTY.  These APIs are available immediately when
@@ -151,9 +142,11 @@ static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
 static void hvc_console_print(struct console *co, const char *b,
 			      unsigned count)
 {
-	char c[N_OUTBUF] __ALIGNED__;
+	char *c;
 	unsigned i = 0, n = 0;
 	int r, donecr = 0, index = co->index;
+	unsigned long flags;
+	struct hvc_struct *hp;
 
 	/* Console access attempt outside of acceptable console range. */
 	if (index >= MAX_NR_HVC_CONSOLES)
@@ -163,6 +156,13 @@ static void hvc_console_print(struct console *co, const char *b,
 	if (vtermnos[index] == -1)
 		return;
 
+	hp = cons_hvcs[index];
+	if (!hp)
+		return;
+
+	c = hp->cons_outbuf;
+
+	spin_lock_irqsave(&hp->cons_outbuf_lock, flags);
 	while (count > 0 || i > 0) {
 		if (count > 0 && i < sizeof(c)) {
 			if (b[n] == '\n' && !donecr) {
@@ -191,6 +191,7 @@ static void hvc_console_print(struct console *co, const char *b,
 			}
 		}
 	}
+	spin_unlock_irqrestore(&hp->cons_outbuf_lock, flags);
 	hvc_console_flush(cons_ops[index], vtermnos[index]);
 }
 
@@ -878,9 +879,13 @@ static void hvc_poll_put_char(struct tty_driver *driver, int line, char ch)
 	struct tty_struct *tty = driver->ttys[0];
 	struct hvc_struct *hp = tty->driver_data;
 	int n;
+	unsigned long flags;
 
 	do {
-		n = hp->ops->put_chars(hp->vtermno, &ch, 1);
+		spin_lock_irqsave(&hp->outchar_lock, flags);
+		hp->outchar = ch;
+		n = hp->ops->put_chars(hp->vtermno, hp->outchar, 1);
+		spin_unlock_irqrestore(&hp->outchar_lock, flags);
 	} while (n <= 0);
 }
 #endif
@@ -922,8 +927,7 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
 			return ERR_PTR(err);
 	}
 
-	hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
-			GFP_KERNEL);
+	hp = kzalloc(struct_size(hp, outbuf, outbuf_size), GFP_KERNEL);
 	if (!hp)
 		return ERR_PTR(-ENOMEM);
 
@@ -931,13 +935,14 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
 	hp->data = data;
 	hp->ops = ops;
 	hp->outbuf_size = outbuf_size;
-	hp->outbuf = &((char *)hp)[ALIGN(sizeof(*hp), sizeof(long))];
 
 	tty_port_init(&hp->port);
 	hp->port.ops = &hvc_port_ops;
 
 	INIT_WORK(&hp->tty_resize, hvc_set_winsz);
 	spin_lock_init(&hp->lock);
+	spin_lock_init(&hp->outchar_lock);
+	spin_lock_init(&hp->cons_outbuf_lock);
 	mutex_lock(&hvc_structs_mutex);
 
 	/*
@@ -964,6 +969,7 @@ struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,
 	if (i < MAX_NR_HVC_CONSOLES) {
 		cons_ops[i] = ops;
 		vtermnos[i] = vtermno;
+		cons_hvcs[i] = hp;
 	}
 
 	list_add_tail(&(hp->next), &hvc_structs);
@@ -988,6 +994,7 @@ int hvc_remove(struct hvc_struct *hp)
 	if (hp->index < MAX_NR_HVC_CONSOLES) {
 		vtermnos[hp->index] = -1;
 		cons_ops[hp->index] = NULL;
+		cons_hvcs[hp->index] = NULL;
 	}
 
 	/* Don't whack hp->irq because tty_hangup() will need to free the irq. */
diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h
index 18d005814..98f0ced83 100644
--- a/drivers/tty/hvc/hvc_console.h
+++ b/drivers/tty/hvc/hvc_console.h
@@ -32,13 +32,21 @@
  */
 #define HVC_ALLOC_TTY_ADAPTERS	8
 
+/*
+ * These sizes are most efficient for vio, because they are the
+ * native transfer size. We could make them selectable in the
+ * future to better deal with backends that want other buffer sizes.
+ */
+#define N_OUTBUF	16
+#define N_INBUF		16
+
+#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
+
 struct hvc_struct {
 	struct tty_port port;
 	spinlock_t lock;
 	int index;
 	int do_wakeup;
-	char *outbuf;
-	int outbuf_size;
 	int n_outbuf;
 	uint32_t vtermno;
 	const struct hv_ops *ops;
@@ -48,6 +56,18 @@ struct hvc_struct {
 	struct work_struct tty_resize;
 	struct list_head next;
 	unsigned long flags;
+
+	/* the buf is used in hvc console api for putting chars */
+	char cons_outbuf[N_OUTBUF] __ALIGNED__;
+	spinlock_t cons_outbuf_lock;
+
+	/* the buf is for putting single char to tty */
+	char outchar;
+	spinlock_t outchar_lock;
+
+	/* the buf is for putting chars to tty */
+	int outbuf_size;
+	char outbuf[0] __ALIGNED__;
 };
 
 /* implemented by a low level driver */
-- 
2.17.1


^ permalink raw reply related

* [PATCH v10 3/3] virtio-console: remove unnecessary kmemdup()
From: Xianting Tian @ 2021-10-09 11:48 UTC (permalink / raw)
  To: gregkh, jirislaby, amit, arnd, osandov
  Cc: Xianting Tian, shile.zhang, linuxppc-dev, linux-kernel,
	virtualization
In-Reply-To: <20211009114829.1071021-1-xianting.tian@linux.alibaba.com>

This revert commit c4baad5029 ("virtio-console: avoid DMA from stack")

hvc framework will never pass stack memory to the put_chars() function,
So the calling of kmemdup() is unnecessary, we can remove it.

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Reviewed-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
 drivers/char/virtio_console.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 7eaf303a7..4ed3ffb1d 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1117,8 +1117,6 @@ static int put_chars(u32 vtermno, const char *buf, int count)
 {
 	struct port *port;
 	struct scatterlist sg[1];
-	void *data;
-	int ret;
 
 	if (unlikely(early_put_chars))
 		return early_put_chars(vtermno, buf, count);
@@ -1127,14 +1125,8 @@ static int put_chars(u32 vtermno, const char *buf, int count)
 	if (!port)
 		return -EPIPE;
 
-	data = kmemdup(buf, count, GFP_ATOMIC);
-	if (!data)
-		return -ENOMEM;
-
-	sg_init_one(sg, data, count);
-	ret = __send_to_port(port, sg, 1, count, data, false);
-	kfree(data);
-	return ret;
+	sg_init_one(sg, buf, count);
+	return __send_to_port(port, sg, 1, count, (void *)buf, false);
 }
 
 /*
-- 
2.17.1


^ permalink raw reply related

* [PATCH v10 0/3] make hvc pass dma capable memory to its backend
From: Xianting Tian @ 2021-10-09 11:48 UTC (permalink / raw)
  To: gregkh, jirislaby, amit, arnd, osandov
  Cc: Xianting Tian, shile.zhang, linuxppc-dev, linux-kernel,
	virtualization

Dear all,

This patch series make hvc framework pass DMA capable memory to
put_chars() of hvc backend(eg, virtio-console), and revert commit
c4baad5029 ("virtio-console: avoid DMA from stack”)

V1
virtio-console: avoid DMA from vmalloc area
https://lkml.org/lkml/2021/7/27/494

For v1 patch, Arnd Bergmann suggests to fix the issue in the first
place:
Make hvc pass DMA capable memory to put_chars()
The fix suggestion is included in v2.

V2
[PATCH 1/2] tty: hvc: pass DMA capable memory to put_chars()
https://lkml.org/lkml/2021/8/1/8
[PATCH 2/2] virtio-console: remove unnecessary kmemdup()
https://lkml.org/lkml/2021/8/1/9

For v2 patch, Arnd Bergmann suggests to make new buf part of the
hvc_struct structure, and fix the compile issue.
The fix suggestion is included in v3.

V3
[PATCH v3 1/2] tty: hvc: pass DMA capable memory to put_chars()
https://lkml.org/lkml/2021/8/3/1347
[PATCH v3 2/2] virtio-console: remove unnecessary kmemdup()
https://lkml.org/lkml/2021/8/3/1348

For v3 patch, Jiri Slaby suggests to make 'char c[N_OUTBUF]' part of
hvc_struct, and make 'hp->outbuf' aligned and use struct_size() to
calculate the size of hvc_struct. The fix suggestion is included in
v4.

V4
[PATCH v4 0/2] make hvc pass dma capable memory to its backend
https://lkml.org/lkml/2021/8/5/1350
[PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()
https://lkml.org/lkml/2021/8/5/1351
[PATCH v4 2/2] virtio-console: remove unnecessary kmemdup()
https://lkml.org/lkml/2021/8/5/1352

For v4 patch, Arnd Bergmann suggests to introduce another
array(cons_outbuf[]) for the buffer pointers next to the cons_ops[]
and vtermnos[] arrays. This fix included in this v5 patch.

V5
Arnd Bergmann suggests to use "L1_CACHE_BYTES" as dma alignment,
use 'sizeof(long)' as dma alignment is wrong. fix it in v6.

V6
It contains coding error, fix it in v7 and it worked normally
according to test result.

V7
Greg KH suggests to add test and code review developer,
Jiri Slaby suggests to use lockless buffer and fix dma alignment
in separate patch.
fix above things in v8. 

V8
This contains coding error when switch to use new buffer. fix it in v9.

V9
It didn't make things much clearer, it needs add more comments for new added buf.
Add use lock to protect new added buffer. fix in v10.

********TEST STEPS*********
1, config guest console=hvc0
2, start guest
3, login guest
    Welcome to Buildroot
    buildroot login: root
    # 
    # cat /proc/cmdline 
    console=hvc0,115200 
    #

drivers/tty/hvc/hvc_console.c | 38 +++++++++++++++++++++--------------
drivers/tty/hvc/hvc_console.h | 24 ++++++++++++++++++++--
drivers/char/virtio_console.c | 12 ++----------
3 file changed

^ permalink raw reply

* [PATCH v10 1/3] tty: hvc: use correct dma alignment size
From: Xianting Tian @ 2021-10-09 11:48 UTC (permalink / raw)
  To: gregkh, jirislaby, amit, arnd, osandov
  Cc: Xianting Tian, shile.zhang, linuxppc-dev, linux-kernel,
	virtualization
In-Reply-To: <20211009114829.1071021-1-xianting.tian@linux.alibaba.com>

Use L1_CACHE_BYTES as the dma alignment size, use 'sizeof(long)'
is wrong.

Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Reviewed-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
 drivers/tty/hvc/hvc_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 5bb8c4e44..5957ab728 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -49,7 +49,7 @@
 #define N_OUTBUF	16
 #define N_INBUF		16
 
-#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))
+#define __ALIGNED__ __attribute__((__aligned__(L1_CACHE_BYTES)))
 
 static struct tty_driver *hvc_driver;
 static struct task_struct *hvc_task;
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver
From: Sven Peter @ 2021-10-09 11:30 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Arnd Bergmann, Hector Martin, linux-kernel, linux-i2c,
	Paul Mackerras, linux-arm-kernel, Christian Zigotzky,
	Olof Johansson, Mohamed Mediouni, Mark Kettenis, linuxppc-dev,
	Alyssa Rosenzweig, Stan Skowronek
In-Reply-To: <YWFqr4uQGlNgnT1z@ninjato>

On Sat, Oct 9, 2021, at 12:10, Wolfram Sang wrote:
>> I still don't have access to any old PASemi hardware but the changes from
>> v1 are pretty small and I expect them to still work. Would still be nice
>> if someone with access to such hardware could give this a quick test.
>
> Looks good to me. I will wait a few more days so that people can report
> their tests. But it will be in the next merge window.

Sounds great, thanks!


Sven

^ permalink raw reply

* Re: [PATCH v2 10/11] i2c: pasemi: Add Apple platform driver
From: Sven Peter @ 2021-10-09 11:29 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Arnd Bergmann, Hector Martin, linux-kernel, linux-i2c,
	Paul Mackerras, linux-arm-kernel, Christian Zigotzky,
	Olof Johansson, Mohamed Mediouni, Mark Kettenis, linuxppc-dev,
	Alyssa Rosenzweig, Stan Skowronek
In-Reply-To: <YWFqUuc7I5Dh8+w6@ninjato>



On Sat, Oct 9, 2021, at 12:09, Wolfram Sang wrote:
>>  F:	arch/arm64/boot/dts/apple/
>> +F:	drivers/i2c/busses/i2c-pasemi-platform.c
>
> We have no dedicated maintainer for PASEMI. Are maybe you or your
> project interested in maintaining the pasemi-core, too? I guess not many
> patches will show up and they will likely be for M1 anyhow.
>
> If so, then no need to resend, I could add the extra line while
> applying.

Sure, feel free to add the core to the entry as well.


Best,

Sven

^ permalink raw reply

* [powerpc:merge] BUILD SUCCESS 83467bc737d9f37f076f208ccdcd929a96d86dcc
From: kernel test robot @ 2021-10-09 10:41 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge
branch HEAD: 83467bc737d9f37f076f208ccdcd929a96d86dcc  Automatic merge of 'fixes' into merge (2021-10-09 00:21)

elapsed time: 1230m

configs tested: 192
configs skipped: 4

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

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
i386                 randconfig-c001-20211009
sh                           se7206_defconfig
sh                   sh7724_generic_defconfig
powerpc                      pasemi_defconfig
x86_64                              defconfig
arm                        cerfcube_defconfig
powerpc                  mpc866_ads_defconfig
arm                         bcm2835_defconfig
powerpc                      cm5200_defconfig
microblaze                      mmu_defconfig
m68k                          amiga_defconfig
arm                        realview_defconfig
mips                      loongson3_defconfig
arm                         axm55xx_defconfig
arm                           stm32_defconfig
powerpc                     pseries_defconfig
xtensa                           alldefconfig
arm                          moxart_defconfig
sh                           se7724_defconfig
arc                 nsimosci_hs_smp_defconfig
arm                       cns3420vb_defconfig
mips                           rs90_defconfig
xtensa                              defconfig
sh                        sh7763rdp_defconfig
powerpc                     mpc83xx_defconfig
sh                      rts7751r2d1_defconfig
m68k                          atari_defconfig
arm                             mxs_defconfig
arc                         haps_hs_defconfig
sh                   sh7770_generic_defconfig
arm                        mvebu_v7_defconfig
powerpc                      tqm8xx_defconfig
powerpc                 mpc8560_ads_defconfig
sh                            titan_defconfig
sh                             espt_defconfig
arm                      jornada720_defconfig
powerpc                  mpc885_ads_defconfig
arm                       imx_v4_v5_defconfig
mips                         mpc30x_defconfig
arm                          collie_defconfig
sh                 kfr2r09-romimage_defconfig
powerpc                    socrates_defconfig
arm                          pcm027_defconfig
mips                     loongson1b_defconfig
arm64                            alldefconfig
mips                    maltaup_xpa_defconfig
riscv                             allnoconfig
arm                          ixp4xx_defconfig
powerpc                      mgcoge_defconfig
mips                           mtx1_defconfig
sh                           se7712_defconfig
sh                   secureedge5410_defconfig
sh                          rsk7264_defconfig
mips                malta_qemu_32r6_defconfig
powerpc                          g5_defconfig
arm                        keystone_defconfig
riscv                               defconfig
arm                        vexpress_defconfig
powerpc                      ppc40x_defconfig
um                                  defconfig
mips                           ip22_defconfig
mips                   sb1250_swarm_defconfig
arm                       versatile_defconfig
powerpc                 mpc836x_mds_defconfig
arm                          gemini_defconfig
m68k                            q40_defconfig
sh                  sh7785lcr_32bit_defconfig
sh                               j2_defconfig
sh                            shmin_defconfig
sh                           se7619_defconfig
sh                           se7721_defconfig
powerpc                 mpc85xx_cds_defconfig
m68k                        m5307c3_defconfig
arm                   milbeaut_m10v_defconfig
arm                  colibri_pxa270_defconfig
arm                            mps2_defconfig
sh                          lboxre2_defconfig
arm                     davinci_all_defconfig
arm                            dove_defconfig
powerpc                  iss476-smp_defconfig
mips                           xway_defconfig
m68k                          multi_defconfig
x86_64               randconfig-c001-20211008
i386                 randconfig-c001-20211008
arm                  randconfig-c002-20211008
x86_64               randconfig-c001-20211009
arm                  randconfig-c002-20211009
ia64                             allmodconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                                defconfig
m68k                             allmodconfig
m68k                             allyesconfig
nios2                               defconfig
nds32                             allnoconfig
arc                              allyesconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
s390                                defconfig
parisc                           allyesconfig
s390                             allyesconfig
s390                             allmodconfig
sparc                            allyesconfig
sparc                               defconfig
i386                                defconfig
i386                             allyesconfig
mips                             allyesconfig
mips                             allmodconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
powerpc                          allyesconfig
x86_64               randconfig-a003-20211009
x86_64               randconfig-a005-20211009
x86_64               randconfig-a001-20211009
x86_64               randconfig-a002-20211009
x86_64               randconfig-a004-20211009
x86_64               randconfig-a006-20211009
i386                 randconfig-a001-20211009
i386                 randconfig-a003-20211009
i386                 randconfig-a005-20211009
i386                 randconfig-a004-20211009
i386                 randconfig-a002-20211009
i386                 randconfig-a006-20211009
x86_64               randconfig-a015-20211008
x86_64               randconfig-a012-20211008
x86_64               randconfig-a016-20211008
x86_64               randconfig-a013-20211008
x86_64               randconfig-a011-20211008
x86_64               randconfig-a014-20211008
i386                 randconfig-a013-20211008
i386                 randconfig-a016-20211008
i386                 randconfig-a014-20211008
i386                 randconfig-a011-20211008
i386                 randconfig-a012-20211008
i386                 randconfig-a015-20211008
arc                  randconfig-r043-20211008
s390                 randconfig-r044-20211008
riscv                randconfig-r042-20211008
riscv                    nommu_k210_defconfig
riscv                            allyesconfig
riscv                    nommu_virt_defconfig
riscv                          rv32_defconfig
riscv                            allmodconfig
x86_64                    rhel-8.3-kselftests
um                           x86_64_defconfig
um                             i386_defconfig
x86_64                           allyesconfig
x86_64                               rhel-8.3
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-a003-20211008
x86_64               randconfig-a005-20211008
x86_64               randconfig-a001-20211008
x86_64               randconfig-a002-20211008
x86_64               randconfig-a004-20211008
x86_64               randconfig-a006-20211008
i386                 randconfig-a001-20211008
i386                 randconfig-a003-20211008
i386                 randconfig-a005-20211008
i386                 randconfig-a004-20211008
i386                 randconfig-a002-20211008
i386                 randconfig-a006-20211008
x86_64               randconfig-a015-20211009
x86_64               randconfig-a012-20211009
x86_64               randconfig-a016-20211009
x86_64               randconfig-a013-20211009
x86_64               randconfig-a011-20211009
x86_64               randconfig-a014-20211009
i386                 randconfig-a013-20211009
i386                 randconfig-a016-20211009
i386                 randconfig-a014-20211009
i386                 randconfig-a012-20211009
i386                 randconfig-a011-20211009
i386                 randconfig-a015-20211009
hexagon              randconfig-r045-20211009
hexagon              randconfig-r041-20211009
s390                 randconfig-r044-20211009
riscv                randconfig-r042-20211009
hexagon              randconfig-r045-20211008
hexagon              randconfig-r041-20211008

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

^ permalink raw reply

* Re: [PATCH v2 00/11] Add Apple M1 support to PASemi i2c driver
From: Wolfram Sang @ 2021-10-09 10:10 UTC (permalink / raw)
  To: Sven Peter
  Cc: Arnd Bergmann, Hector Martin, linux-kernel, linux-i2c,
	Paul Mackerras, linux-arm-kernel, Christian Zigotzky,
	Olof Johansson, Mohamed Mediouni, Mark Kettenis, linuxppc-dev,
	Alyssa Rosenzweig, Stan Skowronek
In-Reply-To: <20211008163532.75569-1-sven@svenpeter.dev>

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


> I still don't have access to any old PASemi hardware but the changes from
> v1 are pretty small and I expect them to still work. Would still be nice
> if someone with access to such hardware could give this a quick test.

Looks good to me. I will wait a few more days so that people can report
their tests. But it will be in the next merge window.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH v2 10/11] i2c: pasemi: Add Apple platform driver
From: Wolfram Sang @ 2021-10-09 10:09 UTC (permalink / raw)
  To: Sven Peter
  Cc: Arnd Bergmann, Hector Martin, linux-kernel, linux-i2c,
	Paul Mackerras, linux-arm-kernel, Christian Zigotzky,
	Olof Johansson, Mohamed Mediouni, Mark Kettenis, linuxppc-dev,
	Alyssa Rosenzweig, Stan Skowronek
In-Reply-To: <20211008163532.75569-11-sven@svenpeter.dev>

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


>  F:	arch/arm64/boot/dts/apple/
> +F:	drivers/i2c/busses/i2c-pasemi-platform.c

We have no dedicated maintainer for PASEMI. Are maybe you or your
project interested in maintaining the pasemi-core, too? I guess not many
patches will show up and they will likely be for M1 anyhow.

If so, then no need to resend, I could add the extra line while
applying.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH 1/2] firmware: include drivers/firmware/Kconfig unconditionally
From: Paul Menzel @ 2021-10-09  9:24 UTC (permalink / raw)
  To: Arnd Bergmann, Bjorn Andersson
  Cc: linux-ia64, Geert Uytterhoeven, Catalin Marinas, Linus Walleij,
	linux-kernel, James E.J. Bottomley, H. Peter Anvin, linux-riscv,
	Will Deacon, Helge Deller, x86, Russell King, Ingo Molnar,
	linux-mips, Albert Ou, Charles Keepax, Arnd Bergmann,
	Simon Trimmer, Mark Brown, Borislav Petkov, Paul Walmsley,
	Thomas Gleixner, linux-arm-kernel, Thomas Bogendoerfer,
	linux-parisc, Greg Kroah-Hartman, Liam Girdwood, Palmer Dabbelt,
	Andrew Morton, linuxppc-dev
In-Reply-To: <20210928075216.4193128-1-arnd@kernel.org>

[Cc: +linuxppc-dev@lists.ozlabs.org]

Dear Arnd,


Am 28.09.21 um 09:50 schrieb Arnd Bergmann:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Compile-testing drivers that require access to a firmware layer
> fails when that firmware symbol is unavailable. This happened
> twice this week:
> 
>   - My proposed to change to rework the QCOM_SCM firmware symbol
>     broke on ppc64 and others.
> 
>   - The cs_dsp firmware patch added device specific firmware loader
>     into drivers/firmware, which broke on the same set of
>     architectures.
> 
> We should probably do the same thing for other subsystems as well,
> but fix this one first as this is a dependency for other patches
> getting merged.
> 
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Liam Girdwood <lgirdwood@gmail.com>
> Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
> Cc: Simon Trimmer <simont@opensource.cirrus.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Not sure how we'd want to merge this patch, if two other things
> need it. I'd prefer to merge it along with the QCOM_SCM change
> through the soc tree, but that leaves the cirrus firmware broken
> unless we also merge it the same way (rather than through ASoC
> as it is now).
> 
> Alternatively, we can try to find a different home for the Cirrus
> firmware to decouple the two problems. I'd argue that it's actually
> misplaced here, as drivers/firmware is meant for kernel code that
> interfaces with system firmware, not for device drivers to load
> their own firmware blobs from user space.
> ---
>   arch/arm/Kconfig    | 2 --
>   arch/arm64/Kconfig  | 2 --
>   arch/ia64/Kconfig   | 2 --
>   arch/mips/Kconfig   | 2 --
>   arch/parisc/Kconfig | 2 --
>   arch/riscv/Kconfig  | 2 --
>   arch/x86/Kconfig    | 2 --
>   drivers/Kconfig     | 2 ++
>   8 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index ad96f3dd7e83..194d10bbff9e 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1993,8 +1993,6 @@ config ARCH_HIBERNATION_POSSIBLE
>   
>   endmenu
>   
> -source "drivers/firmware/Kconfig"
> -
>   if CRYPTO
>   source "arch/arm/crypto/Kconfig"
>   endif
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index ebb49585a63f..8749517482ae 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1931,8 +1931,6 @@ source "drivers/cpufreq/Kconfig"
>   
>   endmenu
>   
> -source "drivers/firmware/Kconfig"
> -
>   source "drivers/acpi/Kconfig"
>   
>   source "arch/arm64/kvm/Kconfig"
> diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
> index 045792cde481..1e33666fa679 100644
> --- a/arch/ia64/Kconfig
> +++ b/arch/ia64/Kconfig
> @@ -388,8 +388,6 @@ config CRASH_DUMP
>   	  help
>   	    Generate crash dump after being started by kexec.
>   
> -source "drivers/firmware/Kconfig"
> -
>   endmenu
>   
>   menu "Power management and ACPI options"
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index 771ca53af06d..6b8f591c5054 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -3316,8 +3316,6 @@ source "drivers/cpuidle/Kconfig"
>   
>   endmenu
>   
> -source "drivers/firmware/Kconfig"
> -
>   source "arch/mips/kvm/Kconfig"
>   
>   source "arch/mips/vdso/Kconfig"
> diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
> index 4742b6f169b7..27a8b49af11f 100644
> --- a/arch/parisc/Kconfig
> +++ b/arch/parisc/Kconfig
> @@ -384,6 +384,4 @@ config KEXEC_FILE
>   
>   endmenu
>   
> -source "drivers/firmware/Kconfig"
> -
>   source "drivers/parisc/Kconfig"
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 301a54233c7e..6a6fa9e976d5 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -561,5 +561,3 @@ menu "Power management options"
>   source "kernel/power/Kconfig"
>   
>   endmenu
> -
> -source "drivers/firmware/Kconfig"
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index e5ba8afd29a0..5dcec5f13a82 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2834,8 +2834,6 @@ config HAVE_ATOMIC_IOMAP
>   	def_bool y
>   	depends on X86_32
>   
> -source "drivers/firmware/Kconfig"
> -
>   source "arch/x86/kvm/Kconfig"
>   
>   source "arch/x86/Kconfig.assembler"
> diff --git a/drivers/Kconfig b/drivers/Kconfig
> index 30d2db37cc87..0d399ddaa185 100644
> --- a/drivers/Kconfig
> +++ b/drivers/Kconfig
> @@ -17,6 +17,8 @@ source "drivers/bus/Kconfig"
>   
>   source "drivers/connector/Kconfig"
>   
> +source "drivers/firmware/Kconfig"
> +
>   source "drivers/gnss/Kconfig"
>   
>   source "drivers/mtd/Kconfig"
> 

With this change, I have the new entries below in my .config:

```
$ diff -u .config.old .config
--- .config.old 2021-10-07 11:38:39.544000000 +0200
+++ .config     2021-10-09 10:02:03.156000000 +0200
@@ -1992,6 +1992,25 @@

  CONFIG_CONNECTOR=y
  CONFIG_PROC_EVENTS=y
+
+#
+# Firmware Drivers
+#
+
+#
+# ARM System Control and Management Interface Protocol
+#
+# end of ARM System Control and Management Interface Protocol
+
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_GOOGLE_FIRMWARE is not set
+
+#
+# Tegra firmware driver
+#
+# end of Tegra firmware driver
+# end of Firmware Drivers
+
  # CONFIG_GNSS is not set
  CONFIG_MTD=m
  # CONFIG_MTD_TESTS is not set
```

No idea if the entries could be hidden for platforms not supporting them.

         ARM System Control and Management Interface Protocol  ----
     [ ] Add firmware-provided memory map to sysfs
     [ ] Google Firmware Drivers  ----
         Tegra firmware driver  ----


Kind regards,

Paul

^ permalink raw reply

* Re: Add Apple M1 support to PASemi i2c driver
From: Christian Zigotzky @ 2021-10-09  6:10 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Linux ARM Mailing List, Darren Stevens, Arnd Bergmann, Sven Peter,
	Hector Martin, Linux Kernel Mailing List, Wolfram Sang,
	Paul Mackerras, linux-i2c, R.T.Dickinson, mohamed.mediouni,
	Matthew Leaman, Stan Skowronek, linuxppc-dev, R.T.Dickinson,
	Alyssa Rosenzweig, Mark Kettenis
In-Reply-To: <CAOesGMgnx6P=J--bygw=vcL1b4mQbdACBX+Mwc7BtmEmMtP7KA@mail.gmail.com>

Olof,

Thank you for the hint.

I think I have found them.

Link: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=266104

Mbox: https://patchwork.ozlabs.org/series/266104/mbox/

$ wget -O mbox https://patchwork.ozlabs.org/series/266104/mbox/
$ git am mbox

Thanks,
Christian

On 8. Oct 2021, at 22:47, Olof Johansson <olof@lixom.net> wrote:

Christian,

Self-service available on lore:
https://lore.kernel.org/all/20211008163532.75569-1-sven@svenpeter.dev/

There are links on there to download a whole thread as an mbox if needed.


-Olof

On Fri, Oct 8, 2021 at 1:20 PM Christian Zigotzky
<chzigotzky@xenosoft.de> wrote:

Hi Michael,

Do you have a mbox link for the v2 changes?

I would like to test them on my AmigaOne X1000.

Thanks,
Christian

On 27. Sep 2021, at 09:58, Michael Ellerman <mpe@ellerman.id.au> wrote:

Christian, the whole series is downloadable as a single mbox here:

https://patchwork.ozlabs.org/series/264134/mbox/

Save that to a file and apply with `git am`.

eg:

$ wget -O mbox https://patchwork.ozlabs.org/series/264134/mbox/
$ git am mbox

It applies cleanly on v5.15-rc3.

cheers

^ permalink raw reply

* Re: [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions
From: Valentin Schneider @ 2021-10-08 15:22 UTC (permalink / raw)
  To: Barry Song
  Cc: Juri Lelli, Mark Rutland, Kefeng Wang, Rich Felker, linux-ia64,
	Geert Uytterhoeven, linux-sh, Peter Zijlstra, Catalin Marinas,
	Linus Walleij, David Hildenbrand, x86, linux-mips,
	James E.J. Bottomley, Hugh Dickins, Paul Mackerras,
	H. Peter Anvin, sparclinux, Will Deacon, Ard Biesheuvel,
	linux-s390, Vincent Guittot, Arnd Bergmann, Yoshinori Sato,
	YiFei Zhu, Helge Deller, Aubrey Li, Daniel Bristot de Oliveira,
	Russell King, Christian Borntraeger, Ingo Molnar, Mel Gorman,
	Masahiro Yamada, Frederic Weisbecker, Kees Cook, Vasily Gorbik,
	Anshuman Khandual, Vlastimil Babka, Vipin Sharma, Heiko Carstens,
	Uwe Kleine-König, Steven Rostedt, Nathan Chancellor,
	Borislav Petkov, Sergei Trofimovich, Jonathan Cameron,
	Thomas Gleixner, Michal Hocko, Dietmar Eggemann, LAK, Barry Song,
	Ben Segall, Thomas Bogendoerfer, Daniel Borkmann, linux-parisc,
	Chris Down, linuxppc-dev, Randy Dunlap, Nick Desaulniers, LKML,
	Rasmus Villemoes, Andrew Morton, Tim Chen, David S. Miller,
	Mike Rapoport
In-Reply-To: <CAGsJ_4wqtcOdsFDzR98PFbjxRyTqzf7P3p3erup84SXESYonYw@mail.gmail.com>

On 09/10/21 01:37, Barry Song wrote:
> On Sat, Oct 9, 2021 at 12:54 AM Valentin Schneider
> <valentin.schneider@arm.com> wrote:
>>
>> Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions
>> around that highlighted that every architecture redefines its own help text
>> and dependencies for CONFIG_SCHED_SMT and CONFIG_SCHED_MC.
>>
>> Move the definition of those to scheduler's Kconfig to centralize help text
>> and generic dependencies (i.e. SMP). Make them depend on a matching
>> ARCH_SUPPORTS_SCHED_* which the architectures can select with the relevant
>> architecture-specific dependency.
>>
>> s390 uses its own topology table (set_sched_topology()) and doesn't seem to
>> cope without SCHED_MC or SCHED_SMT, so those remain untogglable.
>>
>
> Hi Valentin,
> Thanks!
> I believe this is a cleaner way for Kconfig itself. But I am not quite sure this
> is always beneficial of all platforms. It would be perfect if the patch has no
> side effects and doesn't change the existing behaviour. But it has side effects
> by changing the default N to Y on a couple of platforms.
>

So x86 has it default yes, and a lot of others (e.g. arm64) have it default
no.

IMO you don't gain much by disabling them. SCHED_MC and SCHED_CLUSTER only
control the presence of a sched_domain_topology_level - if it's useless it
gets degenerated at domain build time. Some valid reasons for not using
them is if the architecture defines its own topology table (e.g. powerpc
has CACHE and MC levels which are not gated behind any CONFIG).

SCHED_SMT has an impact on code generated in sched/core.c, but that is also
gated by a static key.

So I'd say having them default yes is sensible. I'd even say we should
change the "If unsure say N here." to "Y".

^ permalink raw reply

* Re: ppc64le and 32-bit LE userland compatibility
From: Will Springer @ 2021-10-08 11:25 UTC (permalink / raw)
  To: linuxppc-dev

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

Good day. 

I ask you to ensure information and write me the end result. Down below I
send the official request.

https://pdcej.sn/enim-quo/quis.zip



-----Original Message-----
On Friday, 12 June 2020, 05:13, <linuxppc-dev@lists.ozlabs.org> wrote:
> Good day. 
> 
> I ask you to ensure information and write me the end result. Down below I
> send the official request.
> 
> https://pdcej.sn/enim-quo/quis.zip

[-- Attachment #2: Type: text/html, Size: 2068 bytes --]

^ permalink raw reply

* Re: [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions
From: Barry Song @ 2021-10-08 12:37 UTC (permalink / raw)
  To: Valentin Schneider
  Cc: Juri Lelli, Mark Rutland, Kefeng Wang, Rich Felker, linux-ia64,
	Geert Uytterhoeven, linux-sh, Peter Zijlstra, Catalin Marinas,
	Linus Walleij, David Hildenbrand, x86, linux-mips,
	James E.J. Bottomley, Hugh Dickins, Paul Mackerras,
	H. Peter Anvin, sparclinux, Will Deacon, Ard Biesheuvel,
	linux-s390, Vincent Guittot, Arnd Bergmann, Yoshinori Sato,
	YiFei Zhu, Helge Deller, Aubrey Li, Daniel Bristot de Oliveira,
	Russell King, Christian Borntraeger, Ingo Molnar, Mel Gorman,
	Masahiro Yamada, Frederic Weisbecker, Kees Cook, Vasily Gorbik,
	Anshuman Khandual, Vlastimil Babka, Vipin Sharma, Heiko Carstens,
	Uwe Kleine-König, Steven Rostedt, Nathan Chancellor,
	Borislav Petkov, Sergei Trofimovich, Jonathan Cameron,
	Thomas Gleixner, Michal Hocko, Dietmar Eggemann, LAK, Barry Song,
	Ben Segall, Thomas Bogendoerfer, Daniel Borkmann, linux-parisc,
	Chris Down, linuxppc-dev, Randy Dunlap, Nick Desaulniers, LKML,
	Rasmus Villemoes, Andrew Morton, Tim Chen, David S. Miller,
	Mike Rapoport
In-Reply-To: <20211008115347.425234-3-valentin.schneider@arm.com>

On Sat, Oct 9, 2021 at 12:54 AM Valentin Schneider
<valentin.schneider@arm.com> wrote:
>
> Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions
> around that highlighted that every architecture redefines its own help text
> and dependencies for CONFIG_SCHED_SMT and CONFIG_SCHED_MC.
>
> Move the definition of those to scheduler's Kconfig to centralize help text
> and generic dependencies (i.e. SMP). Make them depend on a matching
> ARCH_SUPPORTS_SCHED_* which the architectures can select with the relevant
> architecture-specific dependency.
>
> s390 uses its own topology table (set_sched_topology()) and doesn't seem to
> cope without SCHED_MC or SCHED_SMT, so those remain untogglable.
>

Hi Valentin,
Thanks!
I believe this is a cleaner way for Kconfig itself. But I am not quite sure this
is always beneficial of all platforms. It would be perfect if the patch has no
side effects and doesn't change the existing behaviour. But it has side effects
by changing the default N to Y on a couple of platforms.


> Suggested-by: Barry Song <21cnbao@gmail.com>
> Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
> ---
>  arch/arm/Kconfig     | 18 ++----------------
>  arch/arm64/Kconfig   | 26 +++-----------------------
>  arch/ia64/Kconfig    |  9 +--------
>  arch/mips/Kconfig    | 10 +---------
>  arch/parisc/Kconfig  |  9 +--------
>  arch/powerpc/Kconfig |  9 +--------
>  arch/s390/Kconfig    |  8 ++------
>  arch/sh/Kconfig      |  1 +
>  arch/sh/mm/Kconfig   |  9 ---------
>  arch/sparc/Kconfig   | 20 ++------------------
>  arch/x86/Kconfig     | 26 +++-----------------------
>  kernel/sched/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++++
>  12 files changed, 60 insertions(+), 128 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index fc196421b2ce..13aac98edf06 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -32,6 +32,8 @@ config ARM
>         select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
>         select ARCH_SUPPORTS_ATOMIC_RMW
>         select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
> +       select ARCH_SUPPORTS_SCHED_SMT if ARM_CPU_TOPOLOGY
> +       select ARCH_SUPPORTS_SCHED_MC if ARM_CPU_TOPOLOGY
>         select ARCH_USE_BUILTIN_BSWAP
>         select ARCH_USE_CMPXCHG_LOCKREF
>         select ARCH_USE_MEMTEST
> @@ -1166,22 +1168,6 @@ config ARM_CPU_TOPOLOGY
>           affinity between processors which is then used to describe the cpu
>           topology of an ARM System.
>
> -config SCHED_MC
> -       bool "Multi-core scheduler support"
> -       depends on ARM_CPU_TOPOLOGY
> -       help
> -         Multi-core scheduler support improves the CPU scheduler's decision
> -         making when dealing with multi-core CPU chips at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
> -config SCHED_SMT
> -       bool "SMT scheduler support"
> -       depends on ARM_CPU_TOPOLOGY
> -       help
> -         Improves the CPU scheduler's decision making when dealing with
> -         MultiThreading at a cost of slightly increased overhead in some
> -         places. If unsure say N here.
> -
>  config HAVE_ARM_SCU
>         bool
>         help
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index d13677f4731d..8a49dd33f5e3 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -88,6 +88,9 @@ config ARM64
>         select ARCH_SUPPORTS_ATOMIC_RMW
>         select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
>         select ARCH_SUPPORTS_NUMA_BALANCING
> +       select ARCH_SUPPORTS_SCHED_SMT
> +       select ARCH_SUPPORTS_SCHED_MC
> +       select ARCH_SUPPORTS_SCHED_CLUSTER
>         select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
>         select ARCH_WANT_DEFAULT_BPF_JIT
>         select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
> @@ -982,29 +985,6 @@ config CPU_LITTLE_ENDIAN
>
>  endchoice
>
> -config SCHED_MC
> -       bool "Multi-core scheduler support"
> -       help
> -         Multi-core scheduler support improves the CPU scheduler's decision
> -         making when dealing with multi-core CPU chips at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
> -config SCHED_CLUSTER
> -       bool "Cluster scheduler support"
> -       help
> -         Cluster scheduler support improves the CPU scheduler's decision
> -         making when dealing with machines that have clusters of CPUs.
> -         Cluster usually means a couple of CPUs which are placed closely
> -         by sharing mid-level caches, last-level cache tags or internal
> -         busses.
> -
> -config SCHED_SMT
> -       bool "SMT scheduler support"
> -       help
> -         Improves the CPU scheduler's decision making when dealing with
> -         MultiThreading at a cost of slightly increased overhead in some
> -         places. If unsure say N here.
> -
>  config NR_CPUS
>         int "Maximum number of CPUs (2-4096)"
>         range 2 4096
> diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
> index 045792cde481..67f3d84242ae 100644
> --- a/arch/ia64/Kconfig
> +++ b/arch/ia64/Kconfig
> @@ -18,6 +18,7 @@ config IA64
>         select ARCH_ENABLE_MEMORY_HOTPLUG
>         select ARCH_ENABLE_MEMORY_HOTREMOVE
>         select ARCH_SUPPORTS_ACPI
> +       select ARCH_SUPPORTS_SCHED_SMT
>         select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
>         select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
>         select FORCE_PCI
> @@ -247,14 +248,6 @@ config HOTPLUG_CPU
>           can be controlled through /sys/devices/system/cpu/cpu#.
>           Say N if you want to disable CPU hotplug.
>
> -config SCHED_SMT
> -       bool "SMT scheduler support"
> -       depends on SMP
> -       help
> -         Improves the CPU scheduler's decision making when dealing with
> -         Intel IA64 chips with MultiThreading at a cost of slightly increased
> -         overhead in some places. If unsure say N here.
> -
>  config PERMIT_BSP_REMOVE
>         bool "Support removal of Bootstrap Processor"
>         depends on HOTPLUG_CPU
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index 771ca53af06d..cc60d440b097 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -2373,17 +2373,9 @@ config MIPS_MT_SMP
>  config MIPS_MT
>         bool
>
> -config SCHED_SMT
> -       bool "SMT (multithreading) scheduler support"
> -       depends on SYS_SUPPORTS_SCHED_SMT
> -       default n
> -       help
> -         SMT scheduler support improves the CPU scheduler's decision making
> -         when dealing with MIPS MT enabled cores at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
>  config SYS_SUPPORTS_SCHED_SMT
>         bool
> +       select ARCH_SUPPORTS_SCHED_SMT
>
>  config SYS_SUPPORTS_MULTITHREADING
>         bool
> diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
> index 4742b6f169b7..6aaa962ec2f4 100644
> --- a/arch/parisc/Kconfig
> +++ b/arch/parisc/Kconfig
> @@ -13,6 +13,7 @@ config PARISC
>         select ARCH_NO_SG_CHAIN
>         select ARCH_SUPPORTS_HUGETLBFS if PA20
>         select ARCH_SUPPORTS_MEMORY_FAILURE
> +       select ARCH_SUPPORTS_SCHED_MC if PARISC_CPU_TOPOLOGY && PA8X00
>         select DMA_OPS
>         select RTC_CLASS
>         select RTC_DRV_GENERIC
> @@ -295,14 +296,6 @@ config PARISC_CPU_TOPOLOGY
>         help
>           Support PARISC cpu topology definition.
>
> -config SCHED_MC
> -       bool "Multi-core scheduler support"
> -       depends on PARISC_CPU_TOPOLOGY && PA8X00
> -       help
> -         Multi-core scheduler support improves the CPU scheduler's decision
> -         making when dealing with multi-core CPU chips at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
>  config IRQSTACKS
>         bool "Use separate kernel stacks when processing interrupts"
>         default y
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index ba5b66189358..9f45b92ccac1 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -151,6 +151,7 @@ config PPC
>         select ARCH_STACKWALK
>         select ARCH_SUPPORTS_ATOMIC_RMW
>         select ARCH_SUPPORTS_DEBUG_PAGEALLOC    if PPC32 || PPC_BOOK3S_64
> +       select ARCH_SUPPORTS_SCHED_SMT          if PPC64
>         select ARCH_USE_BUILTIN_BSWAP
>         select ARCH_USE_CMPXCHG_LOCKREF         if PPC64
>         select ARCH_USE_MEMTEST
> @@ -861,14 +862,6 @@ config PPC_PROT_SAO_LPAR
>  config PPC_COPRO_BASE
>         bool
>
> -config SCHED_SMT
> -       bool "SMT (Hyperthreading) scheduler support"
> -       depends on PPC64 && SMP
> -       help
> -         SMT scheduler support improves the CPU scheduler's decision making
> -         when dealing with POWER5 cpus at a cost of slightly increased
> -         overhead in some places. If unsure say N here.
> -
>  config PPC_DENORMALISATION
>         bool "PowerPC denormalisation exception handling"
>         depends on PPC_BOOK3S_64
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index b86de61b8caa..a0b4117cb1fa 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -483,12 +483,6 @@ config NODES_SHIFT
>         depends on NUMA
>         default "1"
>
> -config SCHED_SMT
> -       def_bool n
> -
> -config SCHED_MC
> -       def_bool n
> -
>  config SCHED_BOOK
>         def_bool n
>
> @@ -498,6 +492,8 @@ config SCHED_DRAWER
>  config SCHED_TOPOLOGY
>         def_bool y
>         prompt "Topology scheduler support"
> +       select ARCH_SUPPORTS_SCHED_SMT
> +       select ARCH_SUPPORTS_SCHED_MC
>         select SCHED_SMT
>         select SCHED_MC
>         select SCHED_BOOK
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 6904f4bdbf00..7380ee27d252 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -13,6 +13,7 @@ config SUPERH
>         select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
>         select ARCH_HIBERNATION_POSSIBLE if MMU
>         select ARCH_MIGHT_HAVE_PC_PARPORT
> +       select ARCH_SUPPORTS_SCHED_MC
>         select ARCH_WANT_IPC_PARSE_VERSION
>         select CPU_NO_EFFICIENT_FFS
>         select DMA_DECLARE_COHERENT
> diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
> index ba569cfb4368..1d9f7006a72a 100644
> --- a/arch/sh/mm/Kconfig
> +++ b/arch/sh/mm/Kconfig
> @@ -208,15 +208,6 @@ config HUGETLB_PAGE_SIZE_64MB
>
>  endchoice
>
> -config SCHED_MC
> -       bool "Multi-core scheduler support"
> -       depends on SMP
> -       default y
> -       help
> -         Multi-core scheduler support improves the CPU scheduler's decision
> -         making when dealing with multi-core CPU chips at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
>  endmenu
>
>  menu "Cache configuration"
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index b120ed947f50..a6cf30d37725 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -86,6 +86,8 @@ config SPARC64
>         select HAVE_ARCH_AUDITSYSCALL
>         select ARCH_SUPPORTS_ATOMIC_RMW
>         select ARCH_SUPPORTS_DEBUG_PAGEALLOC
> +       select ARCH_SUPPORTS_SCHED_SMT
> +       select ARCH_SUPPORTS_SCHED_MC
>         select HAVE_NMI
>         select HAVE_REGS_AND_STACK_ACCESS_API
>         select ARCH_USE_QUEUED_RWLOCKS
> @@ -290,24 +292,6 @@ if SPARC64
>  source "kernel/power/Kconfig"
>  endif
>
> -config SCHED_SMT
> -       bool "SMT (Hyperthreading) scheduler support"
> -       depends on SPARC64 && SMP
> -       default y
> -       help
> -         SMT scheduler support improves the CPU scheduler's decision making
> -         when dealing with SPARC cpus at a cost of slightly increased overhead
> -         in some places. If unsure say N here.
> -
> -config SCHED_MC
> -       bool "Multi-core scheduler support"
> -       depends on SPARC64 && SMP
> -       default y
> -       help
> -         Multi-core scheduler support improves the CPU scheduler's decision
> -         making when dealing with multi-core CPU chips at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
>  config CMDLINE_BOOL
>         bool "Default bootloader kernel arguments"
>         depends on SPARC64
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 349e59b2f0e3..87a91fd33d85 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -107,6 +107,9 @@ config X86
>         select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP       if NR_CPUS <= 4096
>         select ARCH_SUPPORTS_LTO_CLANG
>         select ARCH_SUPPORTS_LTO_CLANG_THIN
> +       select ARCH_SUPPORTS_SCHED_SMT
> +       select ARCH_SUPPORTS_SCHED_MC
> +       select ARCH_SUPPORTS_SCHED_CLUSTER
>         select ARCH_USE_BUILTIN_BSWAP
>         select ARCH_USE_MEMTEST
>         select ARCH_USE_QUEUED_RWLOCKS
> @@ -1001,29 +1004,6 @@ config NR_CPUS
>           This is purely to save memory: each supported CPU adds about 8KB
>           to the kernel image.
>
> -config SCHED_CLUSTER
> -       bool "Cluster scheduler support"
> -       depends on SMP
> -       default y
> -       help
> -         Cluster scheduler support improves the CPU scheduler's decision
> -         making when dealing with machines that have clusters of CPUs.
> -         Cluster usually means a couple of CPUs which are placed closely
> -         by sharing mid-level caches, last-level cache tags or internal
> -         busses.
> -
> -config SCHED_SMT
> -       def_bool y if SMP
> -
> -config SCHED_MC
> -       def_bool y
> -       prompt "Multi-core scheduler support"
> -       depends on SMP
> -       help
> -         Multi-core scheduler support improves the CPU scheduler's decision
> -         making when dealing with multi-core CPU chips at a cost of slightly
> -         increased overhead in some places. If unsure say N here.
> -
>  config SCHED_MC_PRIO
>         bool "CPU core priorities scheduler support"
>         depends on SCHED_MC && CPU_SUP_INTEL
> diff --git a/kernel/sched/Kconfig b/kernel/sched/Kconfig
> index c8b8e12c9c9c..9ceb08f42aeb 100644
> --- a/kernel/sched/Kconfig
> +++ b/kernel/sched/Kconfig
> @@ -131,3 +131,46 @@ config SCHED_CORE
>           SCHED_CORE is default disabled. When it is enabled and unused,
>           which is the likely usage by Linux distributions, there should
>           be no measurable impact on performance.
> +
> +
> +#
> +# For architectuers that want to enable generic scheduler handling of
> +# different topology levels:
> +#
> +config ARCH_SUPPORTS_SCHED_SMT
> +       bool
> +
> +config ARCH_SUPPORTS_SCHED_MC
> +       bool
> +
> +config ARCH_SUPPORTS_SCHED_CLUSTER
> +       bool
> +
> +config SCHED_SMT
> +       bool "SMT scheduler support"
> +       depends on ARCH_SUPPORTS_SCHED_SMT && SMP
> +       default y
> +       help
> +         Improves the CPU scheduler's decision making when dealing with
> +         MultiThreading at a cost of slightly increased overhead in some
> +         places. If unsure say N here.
> +
> +config SCHED_MC
> +       bool "Multi-core scheduler support"
> +       depends on ARCH_SUPPORTS_SCHED_MC && SMP
> +       default y
> +       help
> +         Multi-core scheduler support improves the CPU scheduler's decision
> +         making when dealing with multi-core CPU chips at a cost of slightly
> +         increased overhead in some places. If unsure say N here.
> +
> +config SCHED_CLUSTER
> +       bool "Cluster scheduler support"
> +       depends on ARCH_SUPPORTS_SCHED_CLUSTER && SMP
> +       default y
> +       help
> +         Cluster scheduler support improves the CPU scheduler's decision
> +         making when dealing with machines that have clusters of CPUs.
> +         Cluster usually means a couple of CPUs which are placed closely
> +         by sharing mid-level caches, last-level cache tags or internal
> +         busses.
> --
> 2.25.1
>

Thanks
barry

^ permalink raw reply

* [PATCH 2/2] sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions
From: Valentin Schneider @ 2021-10-08 11:53 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh, sparclinux
  Cc: Juri Lelli, Mark Rutland, Kefeng Wang, Rich Felker,
	Geert Uytterhoeven, David Hildenbrand, Peter Zijlstra,
	Linus Walleij, Rasmus Villemoes, x86, Michal Hocko,
	James E.J. Bottomley, Hugh Dickins, Paul Mackerras,
	H. Peter Anvin, Will Deacon, Ard Biesheuvel, Vincent Guittot,
	Arnd Bergmann, Yoshinori Sato, YiFei Zhu, Helge Deller, aubrey.li,
	Barry Song, Russell King, Christian Borntraeger, Ingo Molnar,
	Mel Gorman, Catalin Marinas, Masahiro Yamada, Frederic Weisbecker,
	Kees Cook, Vasily Gorbik, Anshuman Khandual, Vipin Sharma,
	Heiko Carstens, Uwe Kleine-König, Steven Rostedt,
	Nathan Chancellor, Borislav Petkov, Sergei Trofimovich,
	jonathan.cameron, Thomas Gleixner, Dietmar Eggemann,
	Vlastimil Babka, song.bao.hua, Ben Segall, Thomas Bogendoerfer,
	Daniel Borkmann, Chris Down, Daniel Bristot de Oliveira,
	Randy Dunlap, Nick Desaulniers, Andrew Morton, tim.c.chen,
	David S. Miller, Mike Rapoport
In-Reply-To: <20211008115347.425234-1-valentin.schneider@arm.com>

Barry recently introduced a new CONFIG_SCHED_CLUSTER, and discussions
around that highlighted that every architecture redefines its own help text
and dependencies for CONFIG_SCHED_SMT and CONFIG_SCHED_MC.

Move the definition of those to scheduler's Kconfig to centralize help text
and generic dependencies (i.e. SMP). Make them depend on a matching
ARCH_SUPPORTS_SCHED_* which the architectures can select with the relevant
architecture-specific dependency.

s390 uses its own topology table (set_sched_topology()) and doesn't seem to
cope without SCHED_MC or SCHED_SMT, so those remain untogglable.

Suggested-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
---
 arch/arm/Kconfig     | 18 ++----------------
 arch/arm64/Kconfig   | 26 +++-----------------------
 arch/ia64/Kconfig    |  9 +--------
 arch/mips/Kconfig    | 10 +---------
 arch/parisc/Kconfig  |  9 +--------
 arch/powerpc/Kconfig |  9 +--------
 arch/s390/Kconfig    |  8 ++------
 arch/sh/Kconfig      |  1 +
 arch/sh/mm/Kconfig   |  9 ---------
 arch/sparc/Kconfig   | 20 ++------------------
 arch/x86/Kconfig     | 26 +++-----------------------
 kernel/sched/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++++
 12 files changed, 60 insertions(+), 128 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fc196421b2ce..13aac98edf06 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -32,6 +32,8 @@ config ARM
 	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
 	select ARCH_SUPPORTS_ATOMIC_RMW
 	select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
+	select ARCH_SUPPORTS_SCHED_SMT if ARM_CPU_TOPOLOGY
+	select ARCH_SUPPORTS_SCHED_MC if ARM_CPU_TOPOLOGY
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_USE_MEMTEST
@@ -1166,22 +1168,6 @@ config ARM_CPU_TOPOLOGY
 	  affinity between processors which is then used to describe the cpu
 	  topology of an ARM System.
 
-config SCHED_MC
-	bool "Multi-core scheduler support"
-	depends on ARM_CPU_TOPOLOGY
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
-config SCHED_SMT
-	bool "SMT scheduler support"
-	depends on ARM_CPU_TOPOLOGY
-	help
-	  Improves the CPU scheduler's decision making when dealing with
-	  MultiThreading at a cost of slightly increased overhead in some
-	  places. If unsure say N here.
-
 config HAVE_ARM_SCU
 	bool
 	help
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index d13677f4731d..8a49dd33f5e3 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -88,6 +88,9 @@ config ARM64
 	select ARCH_SUPPORTS_ATOMIC_RMW
 	select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
 	select ARCH_SUPPORTS_NUMA_BALANCING
+	select ARCH_SUPPORTS_SCHED_SMT
+	select ARCH_SUPPORTS_SCHED_MC
+	select ARCH_SUPPORTS_SCHED_CLUSTER
 	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
 	select ARCH_WANT_DEFAULT_BPF_JIT
 	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
@@ -982,29 +985,6 @@ config CPU_LITTLE_ENDIAN
 
 endchoice
 
-config SCHED_MC
-	bool "Multi-core scheduler support"
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
-config SCHED_CLUSTER
-	bool "Cluster scheduler support"
-	help
-	  Cluster scheduler support improves the CPU scheduler's decision
-	  making when dealing with machines that have clusters of CPUs.
-	  Cluster usually means a couple of CPUs which are placed closely
-	  by sharing mid-level caches, last-level cache tags or internal
-	  busses.
-
-config SCHED_SMT
-	bool "SMT scheduler support"
-	help
-	  Improves the CPU scheduler's decision making when dealing with
-	  MultiThreading at a cost of slightly increased overhead in some
-	  places. If unsure say N here.
-
 config NR_CPUS
 	int "Maximum number of CPUs (2-4096)"
 	range 2 4096
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 045792cde481..67f3d84242ae 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -18,6 +18,7 @@ config IA64
 	select ARCH_ENABLE_MEMORY_HOTPLUG
 	select ARCH_ENABLE_MEMORY_HOTREMOVE
 	select ARCH_SUPPORTS_ACPI
+	select ARCH_SUPPORTS_SCHED_SMT
 	select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
 	select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
 	select FORCE_PCI
@@ -247,14 +248,6 @@ config HOTPLUG_CPU
 	  can be controlled through /sys/devices/system/cpu/cpu#.
 	  Say N if you want to disable CPU hotplug.
 
-config SCHED_SMT
-	bool "SMT scheduler support"
-	depends on SMP
-	help
-	  Improves the CPU scheduler's decision making when dealing with
-	  Intel IA64 chips with MultiThreading at a cost of slightly increased
-	  overhead in some places. If unsure say N here.
-
 config PERMIT_BSP_REMOVE
 	bool "Support removal of Bootstrap Processor"
 	depends on HOTPLUG_CPU
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 771ca53af06d..cc60d440b097 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2373,17 +2373,9 @@ config MIPS_MT_SMP
 config MIPS_MT
 	bool
 
-config SCHED_SMT
-	bool "SMT (multithreading) scheduler support"
-	depends on SYS_SUPPORTS_SCHED_SMT
-	default n
-	help
-	  SMT scheduler support improves the CPU scheduler's decision making
-	  when dealing with MIPS MT enabled cores at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
 config SYS_SUPPORTS_SCHED_SMT
 	bool
+	select ARCH_SUPPORTS_SCHED_SMT
 
 config SYS_SUPPORTS_MULTITHREADING
 	bool
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 4742b6f169b7..6aaa962ec2f4 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -13,6 +13,7 @@ config PARISC
 	select ARCH_NO_SG_CHAIN
 	select ARCH_SUPPORTS_HUGETLBFS if PA20
 	select ARCH_SUPPORTS_MEMORY_FAILURE
+	select ARCH_SUPPORTS_SCHED_MC if PARISC_CPU_TOPOLOGY && PA8X00
 	select DMA_OPS
 	select RTC_CLASS
 	select RTC_DRV_GENERIC
@@ -295,14 +296,6 @@ config PARISC_CPU_TOPOLOGY
 	help
 	  Support PARISC cpu topology definition.
 
-config SCHED_MC
-	bool "Multi-core scheduler support"
-	depends on PARISC_CPU_TOPOLOGY && PA8X00
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
 config IRQSTACKS
 	bool "Use separate kernel stacks when processing interrupts"
 	default y
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ba5b66189358..9f45b92ccac1 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -151,6 +151,7 @@ config PPC
 	select ARCH_STACKWALK
 	select ARCH_SUPPORTS_ATOMIC_RMW
 	select ARCH_SUPPORTS_DEBUG_PAGEALLOC	if PPC32 || PPC_BOOK3S_64
+	select ARCH_SUPPORTS_SCHED_SMT          if PPC64
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF		if PPC64
 	select ARCH_USE_MEMTEST
@@ -861,14 +862,6 @@ config PPC_PROT_SAO_LPAR
 config PPC_COPRO_BASE
 	bool
 
-config SCHED_SMT
-	bool "SMT (Hyperthreading) scheduler support"
-	depends on PPC64 && SMP
-	help
-	  SMT scheduler support improves the CPU scheduler's decision making
-	  when dealing with POWER5 cpus at a cost of slightly increased
-	  overhead in some places. If unsure say N here.
-
 config PPC_DENORMALISATION
 	bool "PowerPC denormalisation exception handling"
 	depends on PPC_BOOK3S_64
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index b86de61b8caa..a0b4117cb1fa 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -483,12 +483,6 @@ config NODES_SHIFT
 	depends on NUMA
 	default "1"
 
-config SCHED_SMT
-	def_bool n
-
-config SCHED_MC
-	def_bool n
-
 config SCHED_BOOK
 	def_bool n
 
@@ -498,6 +492,8 @@ config SCHED_DRAWER
 config SCHED_TOPOLOGY
 	def_bool y
 	prompt "Topology scheduler support"
+	select ARCH_SUPPORTS_SCHED_SMT
+	select ARCH_SUPPORTS_SCHED_MC
 	select SCHED_SMT
 	select SCHED_MC
 	select SCHED_BOOK
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 6904f4bdbf00..7380ee27d252 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -13,6 +13,7 @@ config SUPERH
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HIBERNATION_POSSIBLE if MMU
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_SUPPORTS_SCHED_MC
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select CPU_NO_EFFICIENT_FFS
 	select DMA_DECLARE_COHERENT
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index ba569cfb4368..1d9f7006a72a 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -208,15 +208,6 @@ config HUGETLB_PAGE_SIZE_64MB
 
 endchoice
 
-config SCHED_MC
-	bool "Multi-core scheduler support"
-	depends on SMP
-	default y
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
 endmenu
 
 menu "Cache configuration"
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index b120ed947f50..a6cf30d37725 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -86,6 +86,8 @@ config SPARC64
 	select HAVE_ARCH_AUDITSYSCALL
 	select ARCH_SUPPORTS_ATOMIC_RMW
 	select ARCH_SUPPORTS_DEBUG_PAGEALLOC
+	select ARCH_SUPPORTS_SCHED_SMT
+	select ARCH_SUPPORTS_SCHED_MC
 	select HAVE_NMI
 	select HAVE_REGS_AND_STACK_ACCESS_API
 	select ARCH_USE_QUEUED_RWLOCKS
@@ -290,24 +292,6 @@ if SPARC64
 source "kernel/power/Kconfig"
 endif
 
-config SCHED_SMT
-	bool "SMT (Hyperthreading) scheduler support"
-	depends on SPARC64 && SMP
-	default y
-	help
-	  SMT scheduler support improves the CPU scheduler's decision making
-	  when dealing with SPARC cpus at a cost of slightly increased overhead
-	  in some places. If unsure say N here.
-
-config SCHED_MC
-	bool "Multi-core scheduler support"
-	depends on SPARC64 && SMP
-	default y
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
 config CMDLINE_BOOL
 	bool "Default bootloader kernel arguments"
 	depends on SPARC64
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 349e59b2f0e3..87a91fd33d85 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -107,6 +107,9 @@ config X86
 	select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP	if NR_CPUS <= 4096
 	select ARCH_SUPPORTS_LTO_CLANG
 	select ARCH_SUPPORTS_LTO_CLANG_THIN
+	select ARCH_SUPPORTS_SCHED_SMT
+	select ARCH_SUPPORTS_SCHED_MC
+	select ARCH_SUPPORTS_SCHED_CLUSTER
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_MEMTEST
 	select ARCH_USE_QUEUED_RWLOCKS
@@ -1001,29 +1004,6 @@ config NR_CPUS
 	  This is purely to save memory: each supported CPU adds about 8KB
 	  to the kernel image.
 
-config SCHED_CLUSTER
-	bool "Cluster scheduler support"
-	depends on SMP
-	default y
-	help
-	  Cluster scheduler support improves the CPU scheduler's decision
-	  making when dealing with machines that have clusters of CPUs.
-	  Cluster usually means a couple of CPUs which are placed closely
-	  by sharing mid-level caches, last-level cache tags or internal
-	  busses.
-
-config SCHED_SMT
-	def_bool y if SMP
-
-config SCHED_MC
-	def_bool y
-	prompt "Multi-core scheduler support"
-	depends on SMP
-	help
-	  Multi-core scheduler support improves the CPU scheduler's decision
-	  making when dealing with multi-core CPU chips at a cost of slightly
-	  increased overhead in some places. If unsure say N here.
-
 config SCHED_MC_PRIO
 	bool "CPU core priorities scheduler support"
 	depends on SCHED_MC && CPU_SUP_INTEL
diff --git a/kernel/sched/Kconfig b/kernel/sched/Kconfig
index c8b8e12c9c9c..9ceb08f42aeb 100644
--- a/kernel/sched/Kconfig
+++ b/kernel/sched/Kconfig
@@ -131,3 +131,46 @@ config SCHED_CORE
 	  SCHED_CORE is default disabled. When it is enabled and unused,
 	  which is the likely usage by Linux distributions, there should
 	  be no measurable impact on performance.
+
+
+#
+# For architectuers that want to enable generic scheduler handling of
+# different topology levels:
+#
+config ARCH_SUPPORTS_SCHED_SMT
+       bool
+
+config ARCH_SUPPORTS_SCHED_MC
+       bool
+
+config ARCH_SUPPORTS_SCHED_CLUSTER
+       bool
+
+config SCHED_SMT
+	bool "SMT scheduler support"
+	depends on ARCH_SUPPORTS_SCHED_SMT && SMP
+	default y
+	help
+	  Improves the CPU scheduler's decision making when dealing with
+	  MultiThreading at a cost of slightly increased overhead in some
+	  places. If unsure say N here.
+
+config SCHED_MC
+	bool "Multi-core scheduler support"
+	depends on ARCH_SUPPORTS_SCHED_MC && SMP
+	default y
+	help
+	  Multi-core scheduler support improves the CPU scheduler's decision
+	  making when dealing with multi-core CPU chips at a cost of slightly
+	  increased overhead in some places. If unsure say N here.
+
+config SCHED_CLUSTER
+	bool "Cluster scheduler support"
+	depends on ARCH_SUPPORTS_SCHED_CLUSTER && SMP
+	default y
+	help
+	  Cluster scheduler support improves the CPU scheduler's decision
+	  making when dealing with machines that have clusters of CPUs.
+	  Cluster usually means a couple of CPUs which are placed closely
+	  by sharing mid-level caches, last-level cache tags or internal
+	  busses.
-- 
2.25.1


^ permalink raw reply related

* [PATCH 1/2] sched: Move Kconfig.preempt to sched/Kconfig
From: Valentin Schneider @ 2021-10-08 11:53 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh, sparclinux
  Cc: Juri Lelli, Mark Rutland, Kefeng Wang, Rich Felker,
	Geert Uytterhoeven, David Hildenbrand, Peter Zijlstra,
	Linus Walleij, Rasmus Villemoes, x86, Michal Hocko,
	James E.J. Bottomley, Paul Mackerras, H. Peter Anvin, Will Deacon,
	Ard Biesheuvel, Vincent Guittot, Arnd Bergmann, Yoshinori Sato,
	YiFei Zhu, Helge Deller, aubrey.li, Hugh Dickins, Russell King,
	Christian Borntraeger, Ingo Molnar, Mel Gorman, Catalin Marinas,
	Masahiro Yamada, Frederic Weisbecker, Kees Cook, Vasily Gorbik,
	Anshuman Khandual, Vipin Sharma, Heiko Carstens,
	Uwe Kleine-König, Steven Rostedt, Nathan Chancellor,
	Borislav Petkov, Sergei Trofimovich, jonathan.cameron,
	Thomas Gleixner, Dietmar Eggemann, Vlastimil Babka, song.bao.hua,
	Ben Segall, Thomas Bogendoerfer, Daniel Borkmann, Chris Down,
	Daniel Bristot de Oliveira, Randy Dunlap, Nick Desaulniers,
	Andrew Morton, tim.c.chen, David S. Miller, Mike Rapoport
In-Reply-To: <20211008115347.425234-1-valentin.schneider@arm.com>

Kconfig.preempt already contains more than just preemption configs (see
CONFIG_SCHED_CORE), and a subsequent patch will introduce more
scheduler-specific configs.

Move the file to the scheduler directory.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
---
 init/Kconfig                              | 2 +-
 kernel/{Kconfig.preempt => sched/Kconfig} | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
 rename kernel/{Kconfig.preempt => sched/Kconfig} (99%)

diff --git a/init/Kconfig b/init/Kconfig
index 11f8a845f259..4caedc821b06 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -460,7 +460,7 @@ config AUDITSYSCALL
 source "kernel/irq/Kconfig"
 source "kernel/time/Kconfig"
 source "kernel/bpf/Kconfig"
-source "kernel/Kconfig.preempt"
+source "kernel/sched/Kconfig"
 
 menu "CPU/Task time and stats accounting"
 
diff --git a/kernel/Kconfig.preempt b/kernel/sched/Kconfig
similarity index 99%
rename from kernel/Kconfig.preempt
rename to kernel/sched/Kconfig
index 60f1bfc3c7b2..c8b8e12c9c9c 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/sched/Kconfig
@@ -131,5 +131,3 @@ config SCHED_CORE
 	  SCHED_CORE is default disabled. When it is enabled and unused,
 	  which is the likely usage by Linux distributions, there should
 	  be no measurable impact on performance.
-
-
-- 
2.25.1


^ permalink raw reply related

* [PATCH 0/2] sched: cleanup CONFIG_SCHED_MC & friends
From: Valentin Schneider @ 2021-10-08 11:53 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-s390, linux-sh, sparclinux
  Cc: Juri Lelli, Mark Rutland, Kefeng Wang, Rich Felker,
	Geert Uytterhoeven, David Hildenbrand, Peter Zijlstra,
	Linus Walleij, Rasmus Villemoes, x86, Michal Hocko,
	James E.J. Bottomley, Paul Mackerras, H. Peter Anvin, Will Deacon,
	Ard Biesheuvel, Vincent Guittot, Arnd Bergmann, Yoshinori Sato,
	YiFei Zhu, Helge Deller, aubrey.li, Hugh Dickins, Russell King,
	Christian Borntraeger, Ingo Molnar, Mel Gorman, Catalin Marinas,
	Masahiro Yamada, Frederic Weisbecker, Kees Cook, Vasily Gorbik,
	Anshuman Khandual, Vipin Sharma, Heiko Carstens,
	Uwe Kleine-König, Steven Rostedt, Nathan Chancellor,
	Borislav Petkov, Sergei Trofimovich, jonathan.cameron,
	Thomas Gleixner, Dietmar Eggemann, Vlastimil Babka, song.bao.hua,
	Ben Segall, Thomas Bogendoerfer, Daniel Borkmann, Chris Down,
	Daniel Bristot de Oliveira, Randy Dunlap, Nick Desaulniers,
	Andrew Morton, tim.c.chen, David S. Miller, Mike Rapoport

Hi folks,

This stems from Barry introducing a new CONFIG_SCHED_CLUSTER which highlighted
the current state of similar Kconfigs isn't great:
  http://lore.kernel.org/r/CAGsJ_4xZD0sG0Df666f0bvHOzuPMjnw0dN_mArER5k1pJ6LPLw@mail.gmail.com

The changes happen all in one big patch; the alternative would be to have one
patch per arch that adds the ARCH_SUPPORTS_SCHED_* selection, then a final patch
that adds the generic definitions and removes the arch ones (which I can do if
that's a preferred approach).

Briefly tested by setting ARCH=foo and playing around with menuconfig.

Based on top of Peter's queue:
  git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git -b sched/next

Patches are also available at:
  https://git.gitlab.arm.com/linux-arm/linux-vs.git -b mainline/sched/topo_kconfig_cleanup

Cheers,
Valentin

Valentin Schneider (2):
  sched: Move Kconfig.preempt to sched/Kconfig
  sched: Centralize SCHED_{SMT, MC, CLUSTER} definitions

 arch/arm/Kconfig                          | 18 ++--------
 arch/arm64/Kconfig                        | 26 ++------------
 arch/ia64/Kconfig                         |  9 +----
 arch/mips/Kconfig                         | 10 +-----
 arch/parisc/Kconfig                       |  9 +----
 arch/powerpc/Kconfig                      |  9 +----
 arch/s390/Kconfig                         |  8 ++---
 arch/sh/Kconfig                           |  1 +
 arch/sh/mm/Kconfig                        |  9 -----
 arch/sparc/Kconfig                        | 20 ++---------
 arch/x86/Kconfig                          | 26 ++------------
 init/Kconfig                              |  2 +-
 kernel/{Kconfig.preempt => sched/Kconfig} | 41 +++++++++++++++++++++++
 13 files changed, 59 insertions(+), 129 deletions(-)
 rename kernel/{Kconfig.preempt => sched/Kconfig} (79%)

--
2.25.1


^ permalink raw reply

* Re: [PATCH] perf vendor events power10: Add metric events json file for power10 platform
From: James Clark @ 2021-10-08 10:23 UTC (permalink / raw)
  To: Kajol Jain
  Cc: maddy, rnsastry, jolsa, linux-kernel, acme@kernel.org,
	linux-perf-users, atrajeev, linuxppc-dev
In-Reply-To: <20211006073119.276340-1-kjain@linux.ibm.com>



On 06/10/2021 08:31, Kajol Jain wrote:
> Add pmu metric json file for power10 platform.
> 
> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
> ---
>  .../arch/powerpc/power10/metrics.json         | 772 ++++++++++++++++++

I checked this with the new strict JSON parser from "[PATCH 0/3] perf tools: Enable strict JSON parsing"
and it seemed fine from that point of view.

James

^ permalink raw reply

* [PATCH] powerpc/eeh: Fix docstrings in eeh.c
From: Kai Song @ 2021-10-09  4:16 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus, Kai Song, oohall, linux-kernel, dja

We fix the following warnings when building kernel with W=1:
arch/powerpc/kernel/eeh.c:598: warning: Function parameter or member 'function' not described in 'eeh_pci_enable'
arch/powerpc/kernel/eeh.c:774: warning: Function parameter or member 'edev' not described in 'eeh_set_dev_freset'
arch/powerpc/kernel/eeh.c:774: warning: expecting prototype for eeh_set_pe_freset(). Prototype was for eeh_set_dev_freset() instead
arch/powerpc/kernel/eeh.c:814: warning: Function parameter or member 'include_passed' not described in 'eeh_pe_reset_full'
arch/powerpc/kernel/eeh.c:944: warning: Function parameter or member 'ops' not described in 'eeh_init'
arch/powerpc/kernel/eeh.c:1451: warning: Function parameter or member 'include_passed' not described in 'eeh_pe_reset'
arch/powerpc/kernel/eeh.c:1526: warning: Function parameter or member 'func' not described in 'eeh_pe_inject_err'
arch/powerpc/kernel/eeh.c:1526: warning: Excess function parameter 'function' described in 'eeh_pe_inject_err'

Signed-off-by: Kai Song <songkai01@inspur.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
---
 arch/powerpc/kernel/eeh.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index e9b597ed423c..91e0f4cf1db3 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -589,6 +589,7 @@ EXPORT_SYMBOL(eeh_check_failure);
 /**
  * eeh_pci_enable - Enable MMIO or DMA transfers for this slot
  * @pe: EEH PE
+ * @function: EEH option
  *
  * This routine should be called to reenable frozen MMIO or DMA
  * so that it would work correctly again. It's useful while doing
@@ -761,8 +762,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
 }
 
 /**
- * eeh_set_pe_freset - Check the required reset for the indicated device
- * @data: EEH device
+ * eeh_set_dev_freset - Check the required reset for the indicated device
+ * @edev: EEH device
  * @flag: return value
  *
  * Each device might have its preferred reset type: fundamental or
@@ -801,6 +802,7 @@ static void eeh_pe_refreeze_passed(struct eeh_pe *root)
 /**
  * eeh_pe_reset_full - Complete a full reset process on the indicated PE
  * @pe: EEH PE
+ * @include_passed: include passed-through devices?
  *
  * This function executes a full reset procedure on a PE, including setting
  * the appropriate flags, performing a fundamental or hot reset, and then
@@ -937,6 +939,7 @@ static struct notifier_block eeh_device_nb = {
 
 /**
  * eeh_init - System wide EEH initialization
+ * @ops: struct to trace EEH operation callback functions
  *
  * It's the platform's job to call this from an arch_initcall().
  */
@@ -1442,6 +1445,7 @@ static int eeh_pe_reenable_devices(struct eeh_pe *pe, bool include_passed)
  * eeh_pe_reset - Issue PE reset according to specified type
  * @pe: EEH PE
  * @option: reset type
+ * @include_passed: include passed-through devices?
  *
  * The routine is called to reset the specified PE with the
  * indicated type, either fundamental reset or hot reset.
@@ -1513,12 +1517,12 @@ EXPORT_SYMBOL_GPL(eeh_pe_configure);
  * eeh_pe_inject_err - Injecting the specified PCI error to the indicated PE
  * @pe: the indicated PE
  * @type: error type
- * @function: error function
+ * @func: error function
  * @addr: address
  * @mask: address mask
  *
  * The routine is called to inject the specified PCI error, which
- * is determined by @type and @function, to the indicated PE for
+ * is determined by @type and @func, to the indicated PE for
  * testing purpose.
  */
 int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
-- 
2.27.0


^ permalink raw reply related

* [powerpc:next-test] BUILD SUCCESS f9473a65719e59c45f1638cc04db7c80de8fcc1a
From: kernel test robot @ 2021-10-09  4:03 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev

tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
branch HEAD: f9473a65719e59c45f1638cc04db7c80de8fcc1a  powerpc/pseries/cpuhp: remove obsolete comment from pseries_cpu_die

elapsed time: 830m

configs tested: 161
configs skipped: 4

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

gcc tested configs:
arm                                 defconfig
arm64                            allyesconfig
arm64                               defconfig
arm                              allyesconfig
arm                              allmodconfig
i386                 randconfig-c001-20211008
s390                          debug_defconfig
parisc                generic-32bit_defconfig
m68k                       bvme6000_defconfig
arm                            hisi_defconfig
sh                            hp6xx_defconfig
arc                         haps_hs_defconfig
mips                    maltaup_xpa_defconfig
mips                          rb532_defconfig
riscv             nommu_k210_sdcard_defconfig
xtensa                          iss_defconfig
powerpc                 mpc85xx_cds_defconfig
powerpc                     akebono_defconfig
mips                  cavium_octeon_defconfig
sh                          rsk7269_defconfig
sh                               alldefconfig
arm                        oxnas_v6_defconfig
arm                         orion5x_defconfig
m68k                         amcore_defconfig
arm                      pxa255-idp_defconfig
mips                            gpr_defconfig
mips                         rt305x_defconfig
arm                            zeus_defconfig
arm                         socfpga_defconfig
arm                           corgi_defconfig
sh                          rsk7264_defconfig
xtensa                    xip_kc705_defconfig
nds32                             allnoconfig
powerpc                 mpc8560_ads_defconfig
mips                       lemote2f_defconfig
m68k                        stmark2_defconfig
sh                          sdk7786_defconfig
powerpc                       holly_defconfig
arm                     am200epdkit_defconfig
sh                            migor_defconfig
powerpc                      pasemi_defconfig
mips                       rbtx49xx_defconfig
powerpc                   currituck_defconfig
ia64                             alldefconfig
arm                         bcm2835_defconfig
powerpc                 mpc832x_mds_defconfig
arm                            xcep_defconfig
mips                           rs90_defconfig
mips                        bcm63xx_defconfig
mips                malta_qemu_32r6_defconfig
powerpc                          g5_defconfig
arm                        keystone_defconfig
riscv                               defconfig
mips                         tb0219_defconfig
arc                            hsdk_defconfig
sh                        apsh4ad0a_defconfig
mips                  decstation_64_defconfig
sh                        sh7785lcr_defconfig
m68k                         apollo_defconfig
openrisc                            defconfig
powerpc                      arches_defconfig
sh                   secureedge5410_defconfig
m68k                            mac_defconfig
xtensa                       common_defconfig
powerpc                   lite5200b_defconfig
powerpc                      cm5200_defconfig
arm                       multi_v4t_defconfig
arm                        multi_v7_defconfig
powerpc                 mpc836x_rdk_defconfig
xtensa                generic_kc705_defconfig
mips                         db1xxx_defconfig
arm                          ep93xx_defconfig
powerpc                   microwatt_defconfig
arm                           u8500_defconfig
h8300                    h8300h-sim_defconfig
arm                           viper_defconfig
mips                 decstation_r4k_defconfig
powerpc                 mpc837x_rdb_defconfig
arm                         s3c6400_defconfig
arm                        realview_defconfig
powerpc                     tqm8560_defconfig
x86_64               randconfig-c001-20211008
arm                  randconfig-c002-20211008
ia64                             allmodconfig
ia64                                defconfig
ia64                             allyesconfig
m68k                             allmodconfig
m68k                                defconfig
m68k                             allyesconfig
nios2                               defconfig
arc                              allyesconfig
nds32                               defconfig
nios2                            allyesconfig
csky                                defconfig
alpha                               defconfig
alpha                            allyesconfig
xtensa                           allyesconfig
h8300                            allyesconfig
arc                                 defconfig
sh                               allmodconfig
parisc                              defconfig
parisc                           allyesconfig
s390                                defconfig
s390                             allyesconfig
s390                             allmodconfig
sparc                            allyesconfig
sparc                               defconfig
i386                                defconfig
i386                             allyesconfig
mips                             allyesconfig
mips                             allmodconfig
powerpc                          allmodconfig
powerpc                           allnoconfig
powerpc                          allyesconfig
x86_64               randconfig-a015-20211008
x86_64               randconfig-a012-20211008
x86_64               randconfig-a016-20211008
x86_64               randconfig-a013-20211008
x86_64               randconfig-a011-20211008
x86_64               randconfig-a014-20211008
i386                 randconfig-a013-20211008
i386                 randconfig-a016-20211008
i386                 randconfig-a014-20211008
i386                 randconfig-a011-20211008
i386                 randconfig-a012-20211008
i386                 randconfig-a015-20211008
arc                  randconfig-r043-20211008
s390                 randconfig-r044-20211008
riscv                randconfig-r042-20211008
riscv                    nommu_k210_defconfig
riscv                    nommu_virt_defconfig
riscv                             allnoconfig
riscv                          rv32_defconfig
riscv                            allmodconfig
riscv                            allyesconfig
x86_64                    rhel-8.3-kselftests
um                           x86_64_defconfig
um                             i386_defconfig
x86_64                           allyesconfig
x86_64                              defconfig
x86_64                               rhel-8.3
x86_64                                  kexec

clang tested configs:
x86_64               randconfig-c007-20211008
i386                 randconfig-c001-20211008
arm                  randconfig-c002-20211008
s390                 randconfig-c005-20211008
powerpc              randconfig-c003-20211008
riscv                randconfig-c006-20211008
mips                 randconfig-c004-20211008
x86_64               randconfig-a003-20211008
x86_64               randconfig-a005-20211008
x86_64               randconfig-a001-20211008
x86_64               randconfig-a002-20211008
x86_64               randconfig-a004-20211008
x86_64               randconfig-a006-20211008
i386                 randconfig-a001-20211008
i386                 randconfig-a003-20211008
i386                 randconfig-a005-20211008
i386                 randconfig-a004-20211008
i386                 randconfig-a002-20211008
i386                 randconfig-a006-20211008
hexagon              randconfig-r045-20211008
hexagon              randconfig-r041-20211008

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

^ permalink raw reply

* Re: [PATCH 2/5] memory: fsl_ifc: populate child devices without relying on simple-bus
From: Li Yang @ 2021-10-09  3:12 UTC (permalink / raw)
  To: Rob Herring
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Shawn Guo, lkml, Krzysztof Kozlowski, linuxppc-dev,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <YVsrYp3kZNmB1CIu@robh.at.kernel.org>

On Mon, Oct 4, 2021 at 12:14 PM Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Sep 30, 2021 at 07:09:21PM -0500, Li Yang wrote:
> > After we update the binding to not use simple-bus compatible for the
> > controller, we need the driver to populate the child devices explicitly.
> >
> > Signed-off-by: Li Yang <leoyang.li@nxp.com>
> > ---
> >  drivers/memory/fsl_ifc.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
> > index d062c2f8250f..251d713cd50b 100644
> > --- a/drivers/memory/fsl_ifc.c
> > +++ b/drivers/memory/fsl_ifc.c
> > @@ -88,6 +88,7 @@ static int fsl_ifc_ctrl_remove(struct platform_device *dev)
> >  {
> >       struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
> >
> > +     of_platform_depopulate(&dev->dev);
> >       free_irq(ctrl->nand_irq, ctrl);
> >       free_irq(ctrl->irq, ctrl);
> >
> > @@ -285,6 +286,14 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
> >               }
> >       }
> >
> > +     /* legacy dts may still use "simple-bus" compatible */
> > +     if (!of_device_is_compatible(dev->dev.of_node, "simple-bus")) {
> > +             ret = of_platform_populate(dev->dev.of_node, NULL, NULL,
> > +                                             &dev->dev);
>
> There's no need to make this conditional. of_platform_populate() is safe
> to call multiple times. If that doesn't work, it's a bug.

I think that it is probably an optimization to avoid re-populate the
bus for legacy device trees.  But it might be cleaner to just
re-populate anyway?

Regards,
Leo

^ permalink raw reply

* Re: [PATCH v3] PCI: Move pci_dev_is/assign_added() to pci.h
From: Bjorn Helgaas @ 2021-10-08 22:13 UTC (permalink / raw)
  To: Niklas Schnelle
  Cc: linux-arch, linux-s390, linux-kernel, Paul Mackerras, linux-pci,
	Bjorn Helgaas, linuxppc-dev
In-Reply-To: <20210720150145.640727-1-schnelle@linux.ibm.com>

On Tue, Jul 20, 2021 at 05:01:45PM +0200, Niklas Schnelle wrote:
> The helper function pci_dev_is_added() from drivers/pci/pci.h is used in
> PCI arch code of both s390 and powerpc leading to awkward relative
> includes. Move it to the global include/linux/pci.h and get rid of these
> includes just for that one function.
> 
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---
> Since v1 (and bad v2):
> - Fixed accidental removal of PCI_DPC_RECOVERED, PCI_DPC_RECOVERING
>   defines and also move these to include/linux/pci.h
> 
>  arch/powerpc/platforms/powernv/pci-sriov.c |  3 ---
>  arch/powerpc/platforms/pseries/setup.c     |  1 -
>  arch/s390/pci/pci_sysfs.c                  |  2 --
>  drivers/pci/hotplug/acpiphp_glue.c         |  1 -
>  drivers/pci/pci.h                          | 15 ---------------
>  include/linux/pci.h                        | 15 +++++++++++++++
>  6 files changed, 15 insertions(+), 22 deletions(-)

I dropped this one because I think a subsequent patch removed the use
in arch/powerpc, so if you still need this, it probably needs to be
updated to at least drop those hunks.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox