* [PATCH 19/41] drivers: tty: serial: apbuart: fix code formatting
From: Enrico Weigelt, metux IT consult @ 2019-04-27 12:52 UTC (permalink / raw)
To: linux-kernel
Cc: lorenzo.pieralisi, linux-ia64, linux-serial, andrew, gregkh,
sudeep.holla, liviu.dudau, linux-mips, vz, linux, sparclinux,
khilman, macro, slemieux.tyco, matthias.bgg, jacmet,
linux-amlogic, andriy.shevchenko, linuxppc-dev, davem
In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net>
Fix checkpatch warnings:
WARNING: line over 80 characters
#9: FILE: drivers/tty/serial/apbuart.c:9:
+ * Copyright (C) 2006 Daniel Hellstrom <daniel@gaisler.com>, Aeroflex Gaisler AB
WARNING: line over 80 characters
#11: FILE: drivers/tty/serial/apbuart.c:11:
+ * Copyright (C) 2009 Kristoffer Glembo <kristoffer@gaisler.com>, Aeroflex Gaisler AB
WARNING: line over 80 characters
#16: FILE: drivers/tty/serial/apbuart.c:16:
+#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
WARNING: labels should not be indented
#122: FILE: drivers/tty/serial/apbuart.c:122:
+ ignore_char:
WARNING: Missing a blank line after declarations
#186: FILE: drivers/tty/serial/apbuart.c:186:
+ unsigned int status = UART_GET_STATUS(port);
+ return status & UART_STATUS_THE ? TIOCSER_TEMT : 0;
WARNING: Missing a blank line after declarations
#322: FILE: drivers/tty/serial/apbuart.c:322:
+ int ret = 0;
+ if (ser->type != PORT_UNKNOWN && ser->type != PORT_APBUART)
WARNING: Missing a blank line after declarations
#427: FILE: drivers/tty/serial/apbuart.c:427:
+ unsigned int status;
+ do {
WARNING: Missing a blank line after declarations
#463: FILE: drivers/tty/serial/apbuart.c:463:
+ unsigned int quot, status;
+ status = UART_GET_STATUS(port);
WARNING: line over 80 characters
#627: FILE: drivers/tty/serial/apbuart.c:627:
+ port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map));
WARNING: line over 80 characters
#634: FILE: drivers/tty/serial/apbuart.c:634:
+ port->fifosize = apbuart_scan_fifo_size((struct uart_port *) port, line);
Signed-off-by: Enrico Weigelt <info@metux.net>
---
drivers/tty/serial/apbuart.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 89e19b6..515a562 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -6,12 +6,15 @@
*
* Copyright (C) 2000 Deep Blue Solutions Ltd.
* Copyright (C) 2003 Konrad Eisele <eiselekd@web.de>
- * Copyright (C) 2006 Daniel Hellstrom <daniel@gaisler.com>, Aeroflex Gaisler AB
+ * Copyright (C) 2006 Daniel Hellstrom <daniel@gaisler.com>,
+ * Aeroflex Gaisler AB
* Copyright (C) 2008 Gilead Kutnick <kutnickg@zin-tech.com>
- * Copyright (C) 2009 Kristoffer Glembo <kristoffer@gaisler.com>, Aeroflex Gaisler AB
+ * Copyright (C) 2009 Kristoffer Glembo <kristoffer@gaisler.com>,
+ * Aeroflex Gaisler AB
*/
-#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE) \
+ && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
#endif
@@ -116,8 +119,7 @@ static void apbuart_rx_chars(struct uart_port *port)
uart_insert_char(port, rsr, UART_STATUS_OE, ch, flag);
-
- ignore_char:
+ignore_char:
status = UART_GET_STATUS(port);
}
@@ -181,6 +183,7 @@ static irqreturn_t apbuart_int(int irq, void *dev_id)
static unsigned int apbuart_tx_empty(struct uart_port *port)
{
unsigned int status = UART_GET_STATUS(port);
+
return status & UART_STATUS_THE ? TIOCSER_TEMT : 0;
}
@@ -317,6 +320,7 @@ static int apbuart_verify_port(struct uart_port *port,
struct serial_struct *ser)
{
int ret = 0;
+
if (ser->type != PORT_UNKNOWN && ser->type != PORT_APBUART)
ret = -EINVAL;
if (ser->irq < 0 || ser->irq >= NR_IRQS)
@@ -422,6 +426,7 @@ static void apbuart_flush_fifo(struct uart_port *port)
static void apbuart_console_putchar(struct uart_port *port, int ch)
{
unsigned int status;
+
do {
status = UART_GET_STATUS(port);
} while (!UART_TX_READY(status));
@@ -458,6 +463,7 @@ static void apbuart_console_putchar(struct uart_port *port, int ch)
if (UART_GET_CTRL(port) & (UART_CTRL_RE | UART_CTRL_TE)) {
unsigned int quot, status;
+
status = UART_GET_STATUS(port);
*parity = 'n';
@@ -622,14 +628,16 @@ static int __init grlib_apbuart_configure(void)
port = &grlib_apbuart_ports[line];
port->mapbase = addr;
- port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map));
+ port->membase = ioremap(addr,
+ sizeof(struct grlib_apbuart_regs_map));
port->irq = 0;
port->iotype = UPIO_MEM;
port->ops = &grlib_apbuart_ops;
port->flags = UPF_BOOT_AUTOCONF;
port->line = line;
port->uartclk = *freq_hz;
- port->fifosize = apbuart_scan_fifo_size((struct uart_port *) port, line);
+ port->fifosize = apbuart_scan_fifo_size(
+ (struct uart_port *) port, line);
line++;
/* We support maximum UART_NR uarts ... */
--
1.9.1
^ permalink raw reply related
* [PATCH 02/41] drivers: tty: serial: dz: include <linux/io.h> instead of <asm/io.h>
From: Enrico Weigelt, metux IT consult @ 2019-04-27 12:51 UTC (permalink / raw)
To: linux-kernel
Cc: lorenzo.pieralisi, linux-ia64, linux-serial, andrew, gregkh,
sudeep.holla, liviu.dudau, linux-mips, vz, linux, sparclinux,
khilman, macro, slemieux.tyco, matthias.bgg, jacmet,
linux-amlogic, andriy.shevchenko, linuxppc-dev, davem
In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net>
fixing checkpatch warning:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>
#55: FILE: dz.c:55:
+#include <asm/io.h>
Signed-off-by: Enrico Weigelt <info@metux.net>
---
drivers/tty/serial/dz.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c
index 96e35af..fd4f0cc 100644
--- a/drivers/tty/serial/dz.c
+++ b/drivers/tty/serial/dz.c
@@ -52,7 +52,7 @@
#include <linux/atomic.h>
#include <asm/bootinfo.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/dec/interrupts.h>
#include <asm/dec/kn01.h>
--
1.9.1
^ permalink raw reply related
* [PATCH 04/41] drivers: tty: serial: dz: fix use fix bare 'unsigned'
From: Enrico Weigelt, metux IT consult @ 2019-04-27 12:51 UTC (permalink / raw)
To: linux-kernel
Cc: lorenzo.pieralisi, linux-ia64, linux-serial, andrew, gregkh,
sudeep.holla, liviu.dudau, linux-mips, vz, linux, sparclinux,
khilman, macro, slemieux.tyco, matthias.bgg, jacmet,
linux-amlogic, andriy.shevchenko, linuxppc-dev, davem
In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net>
Fix checkpatch warnings:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
#103: FILE: dz.c:103:
+static u16 dz_in(struct dz_port *dport, unsigned offset)
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
#110: FILE: dz.c:110:
+static void dz_out(struct dz_port *dport, unsigned offset, u16 value)
Signed-off-by: Enrico Weigelt <info@metux.net>
---
drivers/tty/serial/dz.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c
index b3e9313..559d076 100644
--- a/drivers/tty/serial/dz.c
+++ b/drivers/tty/serial/dz.c
@@ -100,14 +100,14 @@ static inline struct dz_port *to_dport(struct uart_port *uport)
* ------------------------------------------------------------
*/
-static u16 dz_in(struct dz_port *dport, unsigned offset)
+static u16 dz_in(struct dz_port *dport, unsigned int offset)
{
void __iomem *addr = dport->port.membase + offset;
return readw(addr);
}
-static void dz_out(struct dz_port *dport, unsigned offset, u16 value)
+static void dz_out(struct dz_port *dport, unsigned int offset, u16 value)
{
void __iomem *addr = dport->port.membase + offset;
--
1.9.1
^ permalink raw reply related
* [PATCH 18/41] drivers: tty: serial: apbuart: use dev_info() instead of printk()
From: Enrico Weigelt, metux IT consult @ 2019-04-27 12:51 UTC (permalink / raw)
To: linux-kernel
Cc: lorenzo.pieralisi, linux-ia64, linux-serial, andrew, gregkh,
sudeep.holla, liviu.dudau, linux-mips, vz, linux, sparclinux,
khilman, macro, slemieux.tyco, matthias.bgg, jacmet,
linux-amlogic, andriy.shevchenko, linuxppc-dev, davem
In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net>
Using dev_err() instead of printk() for more consistent output.
(prints device name, etc).
Signed-off-by: Enrico Weigelt <info@metux.net>
---
drivers/tty/serial/apbuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index d2b86f7..89e19b6 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -568,7 +568,7 @@ static int apbuart_probe(struct platform_device *op)
apbuart_flush_fifo((struct uart_port *) port);
- printk(KERN_INFO "grlib-apbuart at 0x%llx, irq %d\n",
+ dev_info(&pdev->pdev, "grlib-apbuart at 0x%llx, irq %d\n",
(unsigned long long) port->mapbase, port->irq);
return 0;
}
--
1.9.1
^ permalink raw reply related
* [PATCH 13/41] drivers: tty: serial: uartlite: fill mapsize and use it
From: Enrico Weigelt, metux IT consult @ 2019-04-27 12:51 UTC (permalink / raw)
To: linux-kernel
Cc: lorenzo.pieralisi, linux-ia64, linux-serial, andrew, gregkh,
sudeep.holla, liviu.dudau, linux-mips, vz, linux, sparclinux,
khilman, macro, slemieux.tyco, matthias.bgg, jacmet,
linux-amlogic, andriy.shevchenko, linuxppc-dev, davem
In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net>
Fill the struct uart_port->mapsize field and use it, insteaf of
hardcoded values in many places. This makes the code layout a bit
more consistent and easily allows using generic helpers for the
io memory handling.
Candidates for such helpers could be eg. the request+ioremap and
iounmap+release combinations.
Signed-off-by: Enrico Weigelt <info@metux.net>
---
drivers/tty/serial/uartlite.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 44d65bd..c322ab6 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -342,7 +342,7 @@ static const char *ulite_type(struct uart_port *port)
static void ulite_release_port(struct uart_port *port)
{
- release_mem_region(port->mapbase, ULITE_REGION);
+ release_mem_region(port->mapbase, port->mapsize);
iounmap(port->membase);
port->membase = NULL;
}
@@ -356,15 +356,15 @@ static int ulite_request_port(struct uart_port *port)
"ulite console: port=%p; port->mapbase=%llx\n",
port, (unsigned long long) port->mapbase);
- if (!request_mem_region(port->mapbase, ULITE_REGION, "uartlite")) {
+ if (!request_mem_region(port->mapbase, port->mapsize, "uartlite")) {
dev_err(port->dev, "Memory region busy\n");
return -EBUSY;
}
- port->membase = ioremap(port->mapbase, ULITE_REGION);
+ port->membase = ioremap(port->mapbase, port->mapsize);
if (!port->membase) {
dev_err(port->dev, "Unable to map registers\n");
- release_mem_region(port->mapbase, ULITE_REGION);
+ release_mem_region(port->mapbase, port->mapsize);
return -EBUSY;
}
@@ -649,6 +649,7 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq,
port->iotype = UPIO_MEM;
port->iobase = 1; /* mark port in use */
port->mapbase = base;
+ port->mapsize = ULITE_REGION;
port->membase = NULL;
port->ops = &ulite_ops;
port->irq = irq;
--
1.9.1
^ permalink raw reply related
* [PATCH 16/41] drivers: tty: serial: uartlite: fix overlong lines
From: Enrico Weigelt, metux IT consult @ 2019-04-27 12:51 UTC (permalink / raw)
To: linux-kernel
Cc: lorenzo.pieralisi, linux-ia64, linux-serial, andrew, gregkh,
sudeep.holla, liviu.dudau, linux-mips, vz, linux, sparclinux,
khilman, macro, slemieux.tyco, matthias.bgg, jacmet,
linux-amlogic, andriy.shevchenko, linuxppc-dev, davem
In-Reply-To: <1556369542-13247-1-git-send-email-info@metux.net>
Fix checkpatch warnings:
WARNING: line over 80 characters
#283: FILE: drivers/tty/serial/uartlite.c:283:
+ ret = request_irq(port->irq, ulite_isr, IRQF_SHARED | IRQF_TRIGGER_RISING,
WARNING: Missing a blank line after declarations
#577: FILE: drivers/tty/serial/uartlite.c:577:
+ struct earlycon_device *device = console->data;
+ uart_console_write(&device->port, s, n, early_uartlite_putc);
WARNING: line over 80 characters
#590: FILE: drivers/tty/serial/uartlite.c:590:
+OF_EARLYCON_DECLARE(uartlite_b, "xlnx,opb-uartlite-1.00.b", early_uartlite_setup);
WARNING: line over 80 characters
#591: FILE: drivers/tty/serial/uartlite.c:591:
+OF_EARLYCON_DECLARE(uartlite_a, "xlnx,xps-uartlite-1.00.a", early_uartlite_setup);
Signed-off-by: Enrico Weigelt <info@metux.net>
---
drivers/tty/serial/uartlite.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 6f79353..0140cec 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -280,7 +280,8 @@ static int ulite_startup(struct uart_port *port)
return ret;
}
- ret = request_irq(port->irq, ulite_isr, IRQF_SHARED | IRQF_TRIGGER_RISING,
+ ret = request_irq(port->irq, ulite_isr,
+ IRQF_SHARED | IRQF_TRIGGER_RISING,
"uartlite", port);
if (ret)
return ret;
@@ -574,6 +575,7 @@ static void early_uartlite_write(struct console *console,
const char *s, unsigned int n)
{
struct earlycon_device *device = console->data;
+
uart_console_write(&device->port, s, n, early_uartlite_putc);
}
@@ -587,8 +589,10 @@ static int __init early_uartlite_setup(struct earlycon_device *device,
return 0;
}
EARLYCON_DECLARE(uartlite, early_uartlite_setup);
-OF_EARLYCON_DECLARE(uartlite_b, "xlnx,opb-uartlite-1.00.b", early_uartlite_setup);
-OF_EARLYCON_DECLARE(uartlite_a, "xlnx,xps-uartlite-1.00.a", early_uartlite_setup);
+OF_EARLYCON_DECLARE(uartlite_b, "xlnx,opb-uartlite-1.00.b",
+ early_uartlite_setup);
+OF_EARLYCON_DECLARE(uartlite_a, "xlnx,xps-uartlite-1.00.a",
+ early_uartlite_setup);
#endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */
--
1.9.1
^ permalink raw reply related
* Re: [PATCH v10 00/18] Introduce the Counter subsystem
From: Jonathan Cameron @ 2019-04-27 11:49 UTC (permalink / raw)
To: Greg KH
Cc: mark.rutland, benjamin.gaignard, linux-pwm, linux-iio,
patrick.havelange, thierry.reding, pmeerw, linux-api, lars,
daniel.lezcano, linux-arm-kernel, devicetree, david,
William Breathitt Gray, robh+dt, tglx, fabrice.gasnier, esben,
shawnguo, linux-kernel, leoyang.li, knaack.h, akpm, linuxppc-dev
In-Reply-To: <20190425193624.GA11240@kroah.com>
On Thu, 25 Apr 2019 21:36:24 +0200
Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sun, Apr 07, 2019 at 03:25:50PM +0100, Jonathan Cameron wrote:
> > On Tue, 2 Apr 2019 15:30:35 +0900
> > William Breathitt Gray <vilhelm.gray@gmail.com> wrote:
> >
> > > Changes in v10:
> > > - Fix minor typographical errors in documentation
> > > - Merge the FlexTimer Module Quadrature decoder counter driver patches
> > >
> > > This revision is functionally identical to the last; changes in this
> > > version were made to fix minor typos in the documentation files and also
> > > to pull in the new FTM quadrature decoder counter driver.
> > >
> > > The Generic Counter API has been and is still in a feature freeze until
> > > it is merged into the mainline. The following features will be
> > > investigated after the merge: interrupt support for counter devices, and
> > > a character device interface for low-latency applications.
> >
> > Hi William / al,
> >
> > So the question is how to move this forwards? I'm happy with how it turned
> > out and the existing drivers we had in IIO are a lot cleaner under
> > the counter subsystem (other than the backwards compatibility for those that
> > ever existed in IIO). For those not following closely the situation is:
>
> I've now sucked this into my staging-testing branch and if 0-day is fine
> with it, I'll merge it to staging-next in a day or so. This way you can
> build on it for any iio drivers that might be coming.
Great thanks.
>
> I do have reservations about that one sysfs file that is multi-line, and
> I think it will come to bite you in the end over time, so I reserve the
> right to say "I told you so" when that happens...
>
> But, I don't have a better answer for it now, so don't really worry
> about it :)
>
> thanks,
>
> greg k-h
Looks like a few late breaking comments came in, but nothing that can't
be fixed up before this reaches a release.
Thanks,
Jonathan
^ permalink raw reply
* Why is suspend with s2idle available on POWER8 systems?
From: Paul Menzel @ 2019-04-27 10:53 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Rafael J. Wysocki
Cc: linuxppc-dev, LKML, linux-pm
Dear Linux folks,
Updating an IBM S822LC from Ubuntu 18.10 to 19.04 some user space stuff
seems to have changed, so that going into sleep/suspend is enabled.
That raises two questions.
1. Is suspend actually supported on a POWER8 processor?
> Apr 27 10:18:13 power NetworkManager[7534]: <info> [1556353093.7224] manager: sleep: sleep requested (sleeping: no e
> Apr 27 10:18:13 power systemd[1]: Reached target Sleep.
> Apr 27 10:18:13 power systemd[1]: Starting Suspend...
> Apr 27 10:18:13 power systemd-sleep[82190]: Suspending system...
> Apr 27 10:18:13 power kernel: PM: suspend entry (s2idle)
> -- Reboot --
> $ uname -m
> ppc64le
> $ more /proc/version
> Linux version 5.1.0-rc6+ (joey@power) (gcc version 8.3.0 (Ubuntu 8.3.0-6ubuntu1)) #1 SMP Sat Apr 27 10:01:48 CEST 2019
> $ more /sys/power/mem_sleep
> [s2idle]
> $ more /sys/power/state
> freeze mem
> $ grep _SUSPEND /boot/config-5.0.0-14-generic # also enabled in Ubuntu’s configuration
> CONFIG_ARCH_SUSPEND_POSSIBLE=y
> CONFIG_SUSPEND=y
> CONFIG_SUSPEND_FREEZER=y
> # CONFIG_SUSPEND_SKIP_SYNC is not set
> # CONFIG_PM_TEST_SUSPEND is not set
Should the Kconfig symbol `SUSPEND` be selectable? If yes, should their
be some detection during runtime?
2. If it is supported, what are the ways to getting it to resume? What
would the IPMI command be?
For now I disabled the automatic suspend, masking the targets [1].
Kind regards,
Paul
[1]: https://wiki.debian.org/Suspend#Disable_suspend_and_hibernation
^ permalink raw reply
* Re: BUG: crash in __tlb_remove_page_size with STRICT_KERNEL_RWX on BOOK3S_32
From: christophe leroy @ 2019-04-27 9:05 UTC (permalink / raw)
To: Segher Boessenkool, Serge Belyshev; +Cc: linuxppc-dev
In-Reply-To: <20190426170700.GD8599@gate.crashing.org>
Le 26/04/2019 à 19:07, Segher Boessenkool a écrit :
> On Fri, Apr 26, 2019 at 05:38:50PM +0300, Serge Belyshev wrote:
>> ---[ Instruction Block Address Translation ]---
>> 0: 0xc0000000-0xc07fffff 0x00000000 Kernel EXEC coherent
>> 1: 0xc0800000-0xc087ffff 0x00800000 Kernel EXEC coherent
>> 2: -
>> 3: -
>> 4: -
>> 5: -
>> 6: -
>> 7: -
>>
>> ---[ Data Block Address Translation ]---
>> 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent
>> 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent
>> 2: 0xc0c00000-0xc13fffff 0x00c00000 Kernel RW coherent
>> 3: 0xc1400000-0xc23fffff 0x01400000 Kernel RW coherent
>> 4: 0xc2400000-0xc43fffff 0x02400000 Kernel RW coherent
>> 5: 0xc4400000-0xc83fffff 0x04400000 Kernel RW coherent
>> 6: 0xc8400000-0xd03fffff 0x08400000 Kernel RW coherent
>> 7: 0xd0400000-0xe03fffff 0x10400000 Kernel RW coherent
>
> The starting address of a BAT block is always aligned to the block size.
> All of DBAT2..DBAT7 are wrong?
>
Obviously function block_size() returns a wrong result, I'll try and fix
that early next week.
Christophe
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
^ permalink raw reply
* [PATCH v2 9/9] dpaa_eth: fix SG frame cleanup
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Fix issue with the entry indexing in the sg frame cleanup code being
off-by-1. This problem showed up when doing some basic iperf tests and
manifested in traffic coming to a halt.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index daede7272768..40420edc9ce6 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -1663,7 +1663,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
qm_sg_entry_get_len(&sgt[0]), dma_dir);
/* remaining pages were mapped with skb_frag_dma_map() */
- for (i = 1; i < nr_frags; i++) {
+ for (i = 1; i <= nr_frags; i++) {
WARN_ON(qm_sg_entry_is_ext(&sgt[i]));
dma_unmap_page(dev, qm_sg_addr(&sgt[i]),
--
2.17.1
^ permalink raw reply related
* [PATCH v2 8/9] dpaa_eth: fix iova handling for sg frames
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
The driver relies on the no longer valid assumption that dma addresses
(iovas) are identical to physical addressees and uses phys_to_virt() to
make iova -> vaddr conversions. Fix this also for scatter-gather frames
using the iova -> phys conversion function added in the previous patch.
While at it, clean-up a redundant dpaa_bpid2pool() and pass the bp
as parameter.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
.../net/ethernet/freescale/dpaa/dpaa_eth.c | 41 +++++++++++--------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index f17edc80dc37..daede7272768 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -1646,14 +1646,17 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) {
nr_frags = skb_shinfo(skb)->nr_frags;
- dma_unmap_single(dev, addr,
- qm_fd_get_offset(fd) + DPAA_SGT_SIZE,
- dma_dir);
/* The sgt buffer has been allocated with netdev_alloc_frag(),
* it's from lowmem.
*/
- sgt = phys_to_virt(addr + qm_fd_get_offset(fd));
+ sgt = phys_to_virt(dpaa_iova_to_phys(dev,
+ addr +
+ qm_fd_get_offset(fd)));
+
+ dma_unmap_single(dev, addr,
+ qm_fd_get_offset(fd) + DPAA_SGT_SIZE,
+ dma_dir);
/* sgt[0] is from lowmem, was dma_map_single()-ed */
dma_unmap_single(dev, qm_sg_addr(&sgt[0]),
@@ -1668,7 +1671,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
}
/* Free the page frag that we allocated on Tx */
- skb_free_frag(phys_to_virt(addr));
+ skb_free_frag(skbh);
} else {
dma_unmap_single(dev, addr,
skb_tail_pointer(skb) - (u8 *)skbh, dma_dir);
@@ -1729,14 +1732,14 @@ static struct sk_buff *contig_fd_to_skb(const struct dpaa_priv *priv,
* The page fragment holding the S/G Table is recycled here.
*/
static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv,
- const struct qm_fd *fd)
+ const struct qm_fd *fd,
+ struct dpaa_bp *dpaa_bp,
+ void *vaddr)
{
ssize_t fd_off = qm_fd_get_offset(fd);
- dma_addr_t addr = qm_fd_addr(fd);
const struct qm_sg_entry *sgt;
struct page *page, *head_page;
- struct dpaa_bp *dpaa_bp;
- void *vaddr, *sg_vaddr;
+ void *sg_vaddr;
int frag_off, frag_len;
struct sk_buff *skb;
dma_addr_t sg_addr;
@@ -1745,7 +1748,6 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv,
int *count_ptr;
int i;
- vaddr = phys_to_virt(addr);
WARN_ON(!IS_ALIGNED((unsigned long)vaddr, SMP_CACHE_BYTES));
/* Iterate through the SGT entries and add data buffers to the skb */
@@ -1756,14 +1758,18 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv,
WARN_ON(qm_sg_entry_is_ext(&sgt[i]));
sg_addr = qm_sg_addr(&sgt[i]);
- sg_vaddr = phys_to_virt(sg_addr);
- WARN_ON(!IS_ALIGNED((unsigned long)sg_vaddr,
- SMP_CACHE_BYTES));
/* We may use multiple Rx pools */
dpaa_bp = dpaa_bpid2pool(sgt[i].bpid);
- if (!dpaa_bp)
+ if (!dpaa_bp) {
+ pr_info("%s: fail to get dpaa_bp for sg bpid %d\n",
+ __func__, sgt[i].bpid);
goto free_buffers;
+ }
+ sg_vaddr = phys_to_virt(dpaa_iova_to_phys(dpaa_bp->dev,
+ sg_addr));
+ WARN_ON(!IS_ALIGNED((unsigned long)sg_vaddr,
+ SMP_CACHE_BYTES));
count_ptr = this_cpu_ptr(dpaa_bp->percpu_count);
dma_unmap_single(dpaa_bp->dev, sg_addr, dpaa_bp->size,
@@ -1835,10 +1841,11 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv,
/* free all the SG entries */
for (i = 0; i < DPAA_SGT_MAX_ENTRIES ; i++) {
sg_addr = qm_sg_addr(&sgt[i]);
- sg_vaddr = phys_to_virt(sg_addr);
- skb_free_frag(sg_vaddr);
dpaa_bp = dpaa_bpid2pool(sgt[i].bpid);
if (dpaa_bp) {
+ sg_addr = dpaa_iova_to_phys(dpaa_bp->dev, sg_addr);
+ sg_vaddr = phys_to_virt(sg_addr);
+ skb_free_frag(sg_vaddr);
count_ptr = this_cpu_ptr(dpaa_bp->percpu_count);
(*count_ptr)--;
}
@@ -2331,7 +2338,7 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,
if (likely(fd_format == qm_fd_contig))
skb = contig_fd_to_skb(priv, fd, dpaa_bp, vaddr);
else
- skb = sg_fd_to_skb(priv, fd);
+ skb = sg_fd_to_skb(priv, fd, dpaa_bp, vaddr);
if (!skb)
return qman_cb_dqrr_consume;
--
2.17.1
^ permalink raw reply related
* [PATCH v2 7/9] dpaa_eth: fix iova handling for contiguous frames
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
The driver relies on the no longer valid assumption that dma addresses
(iovas) are identical to physical addressees and uses phys_to_virt() to
make iova -> vaddr conversions. Fix this by adding a function that does
proper iova -> phys conversions using the iommu api and update the code
to use it.
Also, a dma_unmap_single() call had to be moved further down the code
because iova -> vaddr conversions were required before the unmap.
For now only the contiguous frame case is handled and the SG case is
split in a following patch.
While at it, clean-up a redundant dpaa_bpid2pool() and pass the bp
as parameter.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
.../net/ethernet/freescale/dpaa/dpaa_eth.c | 44 ++++++++++---------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index cdc7e6d83f77..f17edc80dc37 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -50,6 +50,7 @@
#include <linux/highmem.h>
#include <linux/percpu.h>
#include <linux/dma-mapping.h>
+#include <linux/iommu.h>
#include <linux/sort.h>
#include <linux/phy_fixed.h>
#include <soc/fsl/bman.h>
@@ -1595,6 +1596,17 @@ static int dpaa_eth_refill_bpools(struct dpaa_priv *priv)
return 0;
}
+static phys_addr_t dpaa_iova_to_phys(struct device *dev, dma_addr_t addr)
+{
+ struct iommu_domain *domain;
+
+ domain = iommu_get_domain_for_dev(dev);
+ if (domain)
+ return iommu_iova_to_phys(domain, addr);
+ else
+ return addr;
+}
+
/* Cleanup function for outgoing frame descriptors that were built on Tx path,
* either contiguous frames or scatter/gather ones.
* Skb freeing is not handled here.
@@ -1617,7 +1629,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
int nr_frags, i;
u64 ns;
- skbh = (struct sk_buff **)phys_to_virt(addr);
+ skbh = (struct sk_buff **)phys_to_virt(dpaa_iova_to_phys(dev, addr));
skb = *skbh;
if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) {
@@ -1687,25 +1699,21 @@ static u8 rx_csum_offload(const struct dpaa_priv *priv, const struct qm_fd *fd)
* accommodate the shared info area of the skb.
*/
static struct sk_buff *contig_fd_to_skb(const struct dpaa_priv *priv,
- const struct qm_fd *fd)
+ const struct qm_fd *fd,
+ struct dpaa_bp *dpaa_bp,
+ void *vaddr)
{
ssize_t fd_off = qm_fd_get_offset(fd);
- dma_addr_t addr = qm_fd_addr(fd);
- struct dpaa_bp *dpaa_bp;
struct sk_buff *skb;
- void *vaddr;
- vaddr = phys_to_virt(addr);
WARN_ON(!IS_ALIGNED((unsigned long)vaddr, SMP_CACHE_BYTES));
- dpaa_bp = dpaa_bpid2pool(fd->bpid);
- if (!dpaa_bp)
- goto free_buffer;
-
skb = build_skb(vaddr, dpaa_bp->size +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)));
- if (WARN_ONCE(!skb, "Build skb failure on Rx\n"))
- goto free_buffer;
+ if (WARN_ONCE(!skb, "Build skb failure on Rx\n")) {
+ skb_free_frag(vaddr);
+ return NULL;
+ }
WARN_ON(fd_off != priv->rx_headroom);
skb_reserve(skb, fd_off);
skb_put(skb, qm_fd_get_length(fd));
@@ -1713,10 +1721,6 @@ static struct sk_buff *contig_fd_to_skb(const struct dpaa_priv *priv,
skb->ip_summed = rx_csum_offload(priv, fd);
return skb;
-
-free_buffer:
- skb_free_frag(vaddr);
- return NULL;
}
/* Build an skb with the data of the first S/G entry in the linear portion and
@@ -2309,12 +2313,12 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,
if (!dpaa_bp)
return qman_cb_dqrr_consume;
- dma_unmap_single(dpaa_bp->dev, addr, dpaa_bp->size, DMA_FROM_DEVICE);
-
/* prefetch the first 64 bytes of the frame or the SGT start */
- vaddr = phys_to_virt(addr);
+ vaddr = phys_to_virt(dpaa_iova_to_phys(dpaa_bp->dev, addr));
prefetch(vaddr + qm_fd_get_offset(fd));
+ dma_unmap_single(dpaa_bp->dev, addr, dpaa_bp->size, DMA_FROM_DEVICE);
+
/* The only FD types that we may receive are contig and S/G */
WARN_ON((fd_format != qm_fd_contig) && (fd_format != qm_fd_sg));
@@ -2325,7 +2329,7 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,
(*count_ptr)--;
if (likely(fd_format == qm_fd_contig))
- skb = contig_fd_to_skb(priv, fd);
+ skb = contig_fd_to_skb(priv, fd, dpaa_bp, vaddr);
else
skb = sg_fd_to_skb(priv, fd);
if (!skb)
--
2.17.1
^ permalink raw reply related
* [PATCH v2 5/9] dpaa_eth: defer probing after qbman
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Enabling SMMU altered the order of device probing causing the dpaa1
ethernet driver to get probed before qbman and causing a boot crash.
Add predictability in the probing order by deferring the ethernet
driver probe after qbman and portals by using the recently introduced
qbman APIs.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
.../net/ethernet/freescale/dpaa/dpaa_eth.c | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index dfebc30c4841..647e90e7434f 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2774,6 +2774,37 @@ static int dpaa_eth_probe(struct platform_device *pdev)
int err = 0, i, channel;
struct device *dev;
+ err = bman_is_probed();
+ if (!err)
+ return -EPROBE_DEFER;
+ if (err < 0) {
+ dev_err(&pdev->dev, "failing probe due to bman probe error\n");
+ return -ENODEV;
+ }
+ err = qman_is_probed();
+ if (!err)
+ return -EPROBE_DEFER;
+ if (err < 0) {
+ dev_err(&pdev->dev, "failing probe due to qman probe error\n");
+ return -ENODEV;
+ }
+ err = bman_portals_probed();
+ if (!err)
+ return -EPROBE_DEFER;
+ if (err < 0) {
+ dev_err(&pdev->dev,
+ "failing probe due to bman portals probe error\n");
+ return -ENODEV;
+ }
+ err = qman_portals_probed();
+ if (!err)
+ return -EPROBE_DEFER;
+ if (err < 0) {
+ dev_err(&pdev->dev,
+ "failing probe due to qman portals probe error\n");
+ return -ENODEV;
+ }
+
/* device used for DMA mapping */
dev = pdev->dev.parent;
err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40));
--
2.17.1
^ permalink raw reply related
* [PATCH v2 3/9] fsl/fman: backup and restore ICID registers
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
During probing, FMAN is reset thus losing all its register
settings. Backup port ICID registers before reset and restore
them after, similarly to how it's done on powerpc / PAMU based
platforms.
This also has the side effect of disabling the old code path
(liodn backup/restore handling) that obviously make no sense
in the context of SMMU on ARMs.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
drivers/net/ethernet/freescale/fman/fman.c | 35 +++++++++++++++++++++-
drivers/net/ethernet/freescale/fman/fman.h | 4 +++
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c
index e80fedb27cee..ae833e215b74 100644
--- a/drivers/net/ethernet/freescale/fman/fman.c
+++ b/drivers/net/ethernet/freescale/fman/fman.c
@@ -629,6 +629,7 @@ static void set_port_order_restoration(struct fman_fpm_regs __iomem *fpm_rg,
iowrite32be(tmp, &fpm_rg->fmfp_prc);
}
+#ifdef CONFIG_PPC
static void set_port_liodn(struct fman *fman, u8 port_id,
u32 liodn_base, u32 liodn_ofst)
{
@@ -646,6 +647,27 @@ static void set_port_liodn(struct fman *fman, u8 port_id,
iowrite32be(tmp, &fman->dma_regs->fmdmplr[port_id / 2]);
iowrite32be(liodn_ofst, &fman->bmi_regs->fmbm_spliodn[port_id - 1]);
}
+#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+static void save_restore_port_icids(struct fman *fman, bool save)
+{
+ int port_idxes[] = {
+ 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
+ 0xd, 0xe, 0xf, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x10, 0x11, 0x30, 0x31
+ };
+ int idx, i;
+
+ for (i = 0; i < ARRAY_SIZE(port_idxes); i++) {
+ idx = port_idxes[i];
+ if (save)
+ fman->sp_icids[idx] =
+ ioread32be(&fman->bmi_regs->fmbm_spliodn[idx]);
+ else
+ iowrite32be(fman->sp_icids[idx],
+ &fman->bmi_regs->fmbm_spliodn[idx]);
+ }
+}
+#endif
static void enable_rams_ecc(struct fman_fpm_regs __iomem *fpm_rg)
{
@@ -1914,7 +1936,10 @@ static int fman_reset(struct fman *fman)
static int fman_init(struct fman *fman)
{
struct fman_cfg *cfg = NULL;
- int err = 0, i, count;
+ int err = 0, count;
+#ifdef CONFIG_PPC
+ int i;
+#endif
if (is_init_done(fman->cfg))
return -EINVAL;
@@ -1934,6 +1959,7 @@ static int fman_init(struct fman *fman)
memset_io((void __iomem *)(fman->base_addr + CGP_OFFSET), 0,
fman->state->fm_port_num_of_cg);
+#ifdef CONFIG_PPC
/* Save LIODN info before FMan reset
* Skipping non-existent port 0 (i = 1)
*/
@@ -1953,6 +1979,9 @@ static int fman_init(struct fman *fman)
}
fman->liodn_base[i] = liodn_base;
}
+#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+ save_restore_port_icids(fman, true);
+#endif
err = fman_reset(fman);
if (err)
@@ -2181,8 +2210,12 @@ int fman_set_port_params(struct fman *fman,
if (err)
goto return_err;
+#ifdef CONFIG_PPC
set_port_liodn(fman, port_id, fman->liodn_base[port_id],
fman->liodn_offset[port_id]);
+#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+ save_restore_port_icids(fman, false);
+#endif
if (fman->state->rev_info.major < 6)
set_port_order_restoration(fman->fpm_regs, port_id);
diff --git a/drivers/net/ethernet/freescale/fman/fman.h b/drivers/net/ethernet/freescale/fman/fman.h
index 935c317fa696..19f20fa58053 100644
--- a/drivers/net/ethernet/freescale/fman/fman.h
+++ b/drivers/net/ethernet/freescale/fman/fman.h
@@ -346,8 +346,12 @@ struct fman {
unsigned long fifo_offset;
size_t fifo_size;
+#ifdef CONFIG_PPC
u32 liodn_base[64];
u32 liodn_offset[64];
+#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+ u32 sp_icids[64];
+#endif
struct fman_dts_params dts_params;
};
--
2.17.1
^ permalink raw reply related
* [PATCH v2 6/9] dpaa_eth: base dma mappings on the fman rx port
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
The dma transactions initiator is the rx fman port so that's the device
that the dma mappings should be done. Previously the mappings were done
through the MAC device which makes no sense because it's neither dma-able
nor connected in any way to smmu.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 647e90e7434f..cdc7e6d83f77 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2805,8 +2805,15 @@ static int dpaa_eth_probe(struct platform_device *pdev)
return -ENODEV;
}
+ mac_dev = dpaa_mac_dev_get(pdev);
+ if (IS_ERR(mac_dev)) {
+ dev_err(&pdev->dev, "dpaa_mac_dev_get() failed\n");
+ err = PTR_ERR(mac_dev);
+ goto probe_err;
+ }
+
/* device used for DMA mapping */
- dev = pdev->dev.parent;
+ dev = fman_port_get_device(mac_dev->port[RX]);
err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40));
if (err) {
dev_err(dev, "dma_coerce_mask_and_coherent() failed\n");
@@ -2831,13 +2838,6 @@ static int dpaa_eth_probe(struct platform_device *pdev)
priv->msg_enable = netif_msg_init(debug, DPAA_MSG_DEFAULT);
- mac_dev = dpaa_mac_dev_get(pdev);
- if (IS_ERR(mac_dev)) {
- dev_err(dev, "dpaa_mac_dev_get() failed\n");
- err = PTR_ERR(mac_dev);
- goto free_netdev;
- }
-
/* If fsl_fm_max_frm is set to a higher value than the all-common 1500,
* we choose conservatively and let the user explicitly set a higher
* MTU via ifconfig. Otherwise, the user may end up with different MTUs
@@ -2973,9 +2973,9 @@ static int dpaa_eth_probe(struct platform_device *pdev)
qman_release_cgrid(priv->cgr_data.cgr.cgrid);
free_dpaa_bps:
dpaa_bps_free(priv);
-free_netdev:
dev_set_drvdata(dev, NULL);
free_netdev(net_dev);
+probe_err:
return err;
}
--
2.17.1
^ permalink raw reply related
* [PATCH v2 4/9] fsl/fman: add API to get the device behind a fman port
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Add an API that retrieves the 'struct device' that the specified fman
port probed against. The new API will be used in a subsequent iommu
enablement related patch.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
drivers/net/ethernet/freescale/fman/fman_port.c | 14 ++++++++++++++
drivers/net/ethernet/freescale/fman/fman_port.h | 2 ++
2 files changed, 16 insertions(+)
diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c
index ee82ee1384eb..bd76c9730692 100644
--- a/drivers/net/ethernet/freescale/fman/fman_port.c
+++ b/drivers/net/ethernet/freescale/fman/fman_port.c
@@ -1728,6 +1728,20 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port)
}
EXPORT_SYMBOL(fman_port_get_qman_channel_id);
+/**
+ * fman_port_get_device
+ * port: Pointer to the FMan port device
+ *
+ * Get the 'struct device' associated to the specified FMan port device
+ *
+ * Return: pointer to associated 'struct device'
+ */
+struct device *fman_port_get_device(struct fman_port *port)
+{
+ return port->dev;
+}
+EXPORT_SYMBOL(fman_port_get_device);
+
int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
{
if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE)
diff --git a/drivers/net/ethernet/freescale/fman/fman_port.h b/drivers/net/ethernet/freescale/fman/fman_port.h
index 9dbb69f40121..82f12661a46d 100644
--- a/drivers/net/ethernet/freescale/fman/fman_port.h
+++ b/drivers/net/ethernet/freescale/fman/fman_port.h
@@ -157,4 +157,6 @@ int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp);
struct fman_port *fman_port_bind(struct device *dev);
+struct device *fman_port_get_device(struct fman_port *port);
+
#endif /* __FMAN_PORT_H */
--
2.17.1
^ permalink raw reply related
* [PATCH v2 1/9] soc/fsl/qman: fixup liodns only on ppc targets
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
ARM SoCs use SMMU so the liodn fixup done in the qman driver is no
longer making sense and it also breaks the ICID settings inherited
from u-boot. Do the fixups only for PPC targets.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
drivers/soc/fsl/qbman/qman_ccsr.c | 2 +-
drivers/soc/fsl/qbman/qman_priv.h | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
index 109b38de3176..a6bb43007d03 100644
--- a/drivers/soc/fsl/qbman/qman_ccsr.c
+++ b/drivers/soc/fsl/qbman/qman_ccsr.c
@@ -596,7 +596,7 @@ static int qman_init_ccsr(struct device *dev)
}
#define LIO_CFG_LIODN_MASK 0x0fff0000
-void qman_liodn_fixup(u16 channel)
+void __qman_liodn_fixup(u16 channel)
{
static int done;
static u32 liodn_offset;
diff --git a/drivers/soc/fsl/qbman/qman_priv.h b/drivers/soc/fsl/qbman/qman_priv.h
index 75a8f905f8f7..04515718cfd9 100644
--- a/drivers/soc/fsl/qbman/qman_priv.h
+++ b/drivers/soc/fsl/qbman/qman_priv.h
@@ -193,7 +193,14 @@ extern struct gen_pool *qm_cgralloc; /* CGR ID allocator */
u32 qm_get_pools_sdqcr(void);
int qman_wq_alloc(void);
-void qman_liodn_fixup(u16 channel);
+#ifdef CONFIG_FSL_PAMU
+#define qman_liodn_fixup __qman_liodn_fixup
+#else
+static inline void qman_liodn_fixup(u16 channel)
+{
+}
+#endif
+void __qman_liodn_fixup(u16 channel);
void qman_set_sdest(u16 channel, unsigned int cpu_idx);
struct qman_portal *qman_create_affine_portal(
--
2.17.1
^ permalink raw reply related
* [PATCH v2 2/9] soc/fsl/qbman_portals: add APIs to retrieve the probing status
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Add a couple of new APIs to check the probing status of the required
cpu bound qman and bman portals:
'int bman_portals_probed()' and 'int qman_portals_probed()'.
They return the following values.
* 1 if qman/bman portals were all probed correctly
* 0 if qman/bman portals were not yet probed
* -1 if probing of qman/bman portals failed
Portals are considered successful probed if no error occurred during
the probing of any of the portals and if enough portals were probed
to have one available for each cpu.
The error handling paths were slightly rearranged in order to fit this
new functionality without being too intrusive.
Drivers that use qman/bman portal driver services are required to use
these APIs before calling any functions exported by these drivers or
otherwise they will crash the kernel.
First user will be the dpaa1 ethernet driver, coming in a subsequent
patch.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
drivers/soc/fsl/qbman/bman_portal.c | 20 ++++++++++++++++----
drivers/soc/fsl/qbman/qman_portal.c | 21 +++++++++++++++++----
include/soc/fsl/bman.h | 8 ++++++++
include/soc/fsl/qman.h | 9 +++++++++
4 files changed, 50 insertions(+), 8 deletions(-)
diff --git a/drivers/soc/fsl/qbman/bman_portal.c b/drivers/soc/fsl/qbman/bman_portal.c
index 2c95cf59f3e7..cf4f10d6f590 100644
--- a/drivers/soc/fsl/qbman/bman_portal.c
+++ b/drivers/soc/fsl/qbman/bman_portal.c
@@ -32,6 +32,7 @@
static struct bman_portal *affine_bportals[NR_CPUS];
static struct cpumask portal_cpus;
+static int __bman_portals_probed;
/* protect bman global registers and global data shared among portals */
static DEFINE_SPINLOCK(bman_lock);
@@ -87,6 +88,12 @@ static int bman_online_cpu(unsigned int cpu)
return 0;
}
+int bman_portals_probed(void)
+{
+ return __bman_portals_probed;
+}
+EXPORT_SYMBOL_GPL(bman_portals_probed);
+
static int bman_portal_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -104,8 +111,10 @@ static int bman_portal_probe(struct platform_device *pdev)
}
pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);
- if (!pcfg)
+ if (!pcfg) {
+ __bman_portals_probed = -1;
return -ENOMEM;
+ }
pcfg->dev = dev;
@@ -113,14 +122,14 @@ static int bman_portal_probe(struct platform_device *pdev)
DPAA_PORTAL_CE);
if (!addr_phys[0]) {
dev_err(dev, "Can't get %pOF property 'reg::CE'\n", node);
- return -ENXIO;
+ goto err_ioremap1;
}
addr_phys[1] = platform_get_resource(pdev, IORESOURCE_MEM,
DPAA_PORTAL_CI);
if (!addr_phys[1]) {
dev_err(dev, "Can't get %pOF property 'reg::CI'\n", node);
- return -ENXIO;
+ goto err_ioremap1;
}
pcfg->cpu = -1;
@@ -128,7 +137,7 @@ static int bman_portal_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(dev, "Can't get %pOF IRQ'\n", node);
- return -ENXIO;
+ goto err_ioremap1;
}
pcfg->irq = irq;
@@ -150,6 +159,7 @@ static int bman_portal_probe(struct platform_device *pdev)
spin_lock(&bman_lock);
cpu = cpumask_next_zero(-1, &portal_cpus);
if (cpu >= nr_cpu_ids) {
+ __bman_portals_probed = 1;
/* unassigned portal, skip init */
spin_unlock(&bman_lock);
return 0;
@@ -175,6 +185,8 @@ static int bman_portal_probe(struct platform_device *pdev)
err_ioremap2:
memunmap(pcfg->addr_virt_ce);
err_ioremap1:
+ __bman_portals_probed = -1;
+
return -ENXIO;
}
diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
index 661c9b234d32..e2186b681d87 100644
--- a/drivers/soc/fsl/qbman/qman_portal.c
+++ b/drivers/soc/fsl/qbman/qman_portal.c
@@ -38,6 +38,7 @@ EXPORT_SYMBOL(qman_dma_portal);
#define CONFIG_FSL_DPA_PIRQ_FAST 1
static struct cpumask portal_cpus;
+static int __qman_portals_probed;
/* protect qman global registers and global data shared among portals */
static DEFINE_SPINLOCK(qman_lock);
@@ -220,6 +221,12 @@ static int qman_online_cpu(unsigned int cpu)
return 0;
}
+int qman_portals_probed(void)
+{
+ return __qman_portals_probed;
+}
+EXPORT_SYMBOL_GPL(qman_portals_probed);
+
static int qman_portal_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -238,8 +245,10 @@ static int qman_portal_probe(struct platform_device *pdev)
}
pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);
- if (!pcfg)
+ if (!pcfg) {
+ __qman_portals_probed = -1;
return -ENOMEM;
+ }
pcfg->dev = dev;
@@ -247,19 +256,20 @@ static int qman_portal_probe(struct platform_device *pdev)
DPAA_PORTAL_CE);
if (!addr_phys[0]) {
dev_err(dev, "Can't get %pOF property 'reg::CE'\n", node);
- return -ENXIO;
+ goto err_ioremap1;
}
addr_phys[1] = platform_get_resource(pdev, IORESOURCE_MEM,
DPAA_PORTAL_CI);
if (!addr_phys[1]) {
dev_err(dev, "Can't get %pOF property 'reg::CI'\n", node);
- return -ENXIO;
+ goto err_ioremap1;
}
err = of_property_read_u32(node, "cell-index", &val);
if (err) {
dev_err(dev, "Can't get %pOF property 'cell-index'\n", node);
+ __qman_portals_probed = -1;
return err;
}
pcfg->channel = val;
@@ -267,7 +277,7 @@ static int qman_portal_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(dev, "Can't get %pOF IRQ\n", node);
- return -ENXIO;
+ goto err_ioremap1;
}
pcfg->irq = irq;
@@ -291,6 +301,7 @@ static int qman_portal_probe(struct platform_device *pdev)
spin_lock(&qman_lock);
cpu = cpumask_next_zero(-1, &portal_cpus);
if (cpu >= nr_cpu_ids) {
+ __qman_portals_probed = 1;
/* unassigned portal, skip init */
spin_unlock(&qman_lock);
return 0;
@@ -321,6 +332,8 @@ static int qman_portal_probe(struct platform_device *pdev)
err_ioremap2:
memunmap(pcfg->addr_virt_ce);
err_ioremap1:
+ __qman_portals_probed = -1;
+
return -ENXIO;
}
diff --git a/include/soc/fsl/bman.h b/include/soc/fsl/bman.h
index 5b99cb2ea5ef..173e4049d963 100644
--- a/include/soc/fsl/bman.h
+++ b/include/soc/fsl/bman.h
@@ -133,5 +133,13 @@ int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num);
* failed to probe or 0 if the bman driver did not probed yet.
*/
int bman_is_probed(void);
+/**
+ * bman_portals_probed - Check if all cpu bound bman portals are probed
+ *
+ * Returns 1 if all the required cpu bound bman portals successfully probed,
+ * -1 if probe errors appeared or 0 if the bman portals did not yet finished
+ * probing.
+ */
+int bman_portals_probed(void);
#endif /* __FSL_BMAN_H */
diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h
index 5cc7af06c1ba..aa31c05a103a 100644
--- a/include/soc/fsl/qman.h
+++ b/include/soc/fsl/qman.h
@@ -1194,6 +1194,15 @@ int qman_release_cgrid(u32 id);
*/
int qman_is_probed(void);
+/**
+ * qman_portals_probed - Check if all cpu bound qman portals are probed
+ *
+ * Returns 1 if all the required cpu bound qman portals successfully probed,
+ * -1 if probe errors appeared or 0 if the qman portals did not yet finished
+ * probing.
+ */
+int qman_portals_probed(void);
+
/**
* qman_dqrr_get_ithresh - Get coalesce interrupt threshold
* @portal: portal to get the value for
--
2.17.1
^ permalink raw reply related
* [PATCH v2 0/9] Prerequisites for NXP LS104xA SMMU enablement
From: laurentiu.tudor @ 2019-04-27 7:10 UTC (permalink / raw)
To: netdev, madalin.bucur, roy.pledge, camelia.groza, leoyang.li
Cc: linux-kernel, iommu, linuxppc-dev, davem, linux-arm-kernel,
Laurentiu Tudor
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
This patch series contains several fixes in preparation for SMMU
support on NXP LS1043A and LS1046A chips. Once these get picked up,
I'll submit the actual SMMU enablement patches consisting in the
required device tree changes.
This patch series contains only part of the previously submitted one,
(including also the device tree changes) available here:
https://patchwork.kernel.org/cover/10634443/
Changes in v2:
- dropped patches dealing with mapping reserved memory in iommu
- changed logic for qman portal probe status (Leo)
- moved "#ifdef CONFIG_PAMU" in header file (Leo)
- rebased on v5.1.0-rc5
Laurentiu Tudor (9):
soc/fsl/qman: fixup liodns only on ppc targets
soc/fsl/qbman_portals: add APIs to retrieve the probing status
fsl/fman: backup and restore ICID registers
fsl/fman: add API to get the device behind a fman port
dpaa_eth: defer probing after qbman
dpaa_eth: base dma mappings on the fman rx port
dpaa_eth: fix iova handling for contiguous frames
dpaa_eth: fix iova handling for sg frames
dpaa_eth: fix SG frame cleanup
.../net/ethernet/freescale/dpaa/dpaa_eth.c | 136 ++++++++++++------
drivers/net/ethernet/freescale/fman/fman.c | 35 ++++-
drivers/net/ethernet/freescale/fman/fman.h | 4 +
.../net/ethernet/freescale/fman/fman_port.c | 14 ++
.../net/ethernet/freescale/fman/fman_port.h | 2 +
drivers/soc/fsl/qbman/bman_portal.c | 20 ++-
drivers/soc/fsl/qbman/qman_ccsr.c | 2 +-
drivers/soc/fsl/qbman/qman_portal.c | 21 ++-
drivers/soc/fsl/qbman/qman_priv.h | 9 +-
include/soc/fsl/bman.h | 8 ++
include/soc/fsl/qman.h | 9 ++
11 files changed, 202 insertions(+), 58 deletions(-)
--
2.17.1
^ permalink raw reply
* Re: [PATCH v12 00/31] Speculative page faults
From: Michel Lespinasse @ 2019-04-27 6:00 UTC (permalink / raw)
To: Laurent Dufour
Cc: Jan Kara, sergey.senozhatsky.work, Peter Zijlstra, Will Deacon,
Michal Hocko, linux-mm, Paul Mackerras, Punit Agrawal,
H. Peter Anvin, Mike Rapoport, Alexei Starovoitov,
Andrea Arcangeli, Andi Kleen, Minchan Kim, aneesh.kumar, x86,
Matthew Wilcox, Daniel Jordan, Ingo Molnar, David Rientjes,
Paul E. McKenney, Haiyan Song, Nick Piggin, sj38.park,
Jerome Glisse, dave, kemi.wang, Kirill A. Shutemov,
Thomas Gleixner, zhong jiang, Ganesh Mahendran, Yang Shi,
linuxppc-dev, LKML, Sergey Senozhatsky, vinayak menon,
Andrew Morton, Tim Chen, haren
In-Reply-To: <aadc7b03-9121-6800-341b-6f2849088a09@linux.ibm.com>
On Wed, Apr 24, 2019 at 08:01:20PM +0200, Laurent Dufour wrote:
> Le 22/04/2019 à 23:29, Michel Lespinasse a écrit :
> > Hi Laurent,
> >
> > Thanks a lot for copying me on this patchset. It took me a few days to
> > go through it - I had not been following the previous iterations of
> > this series so I had to catch up. I will be sending comments for
> > individual commits, but before tat I would like to discuss the series
> > as a whole.
>
> Hi Michel,
>
> Thanks for reviewing this series.
>
> > I think these changes are a big step in the right direction. My main
> > reservation about them is that they are additive - adding some complexity
> > for speculative page faults - and I wonder if it'd be possible, over the
> > long term, to replace the existing complexity we have in mmap_sem retry
> > mechanisms instead of adding to it. This is not something that should
> > block your progress, but I think it would be good, as we introduce spf,
> > to evaluate whether we could eventually get all the way to removing the
> > mmap_sem retry mechanism, or if we will actually have to keep both.
>
> Until we get rid of the mmap_sem which seems to be a very long story, I
> can't see how we could get rid of the retry mechanism.
Short answer: I'd like spf to be extended to handle file vmas,
populating page tables, and the vm_normal_page thing, so that we
wouldn't have to fall back to the path that grabs (and possibly
has to drop) the read side mmap_sem.
Even doing the above, there are still cases spf can't solve - for
example, gup, or the occasional spf abort, or even the case of a large
mmap/munmap delaying a smaller one. I think replacing mmap_sem with a
reader/writer interval lock would be a very nice generic solution to
this problem, allowing false conflicts to proceed in parallel, while
synchronizing true conflicts which is exactly what we want. But I
don't think such a lock can be implemented efficiently enough to be
put on the page fault fast-path, so I think spf could be the solution
there - it would allow us to skip taking that interval lock on most
page faults. The other places where we use mmap_sem are not as critical
for performance (they normally operate on a larger region at a time)
so I think we could afford the interval lock in those places.
--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.
^ permalink raw reply
* [PATCH]powerpc/mobility: Serialize PRRN and LPM in device tree update
From: Juliet Kim @ 2019-04-26 19:19 UTC (permalink / raw)
To: linuxppc-dev; +Cc: nathanl, mmc, mwb
Fix extending start/stop topology update scope during LPM
Commit 65b9fdadfc4d ("powerpc/pseries/mobility: Extend start/stop
topology update scope") made the change to the duration that
topology updates are suppressed during LPM to allow the complete
device tree update which leaves the property update notifier
unregistered until device tree update completes. This prevents
topology update during LPM.
Instead, use mutex_lock, which serializes LPM and PRRN operation
in pseries_devicetree_update.
Signed-off-by: Juliet Kim <julietk@linux.ibm.com>
arch/powerpc/platforms/pseries/mobility.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 88925f8ca8a0..3a79ded056fd 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -42,6 +42,8 @@ struct update_props_workarea {
#define MIGRATION_SCOPE (1)
#define PRRN_SCOPE -2
+static DEFINE_MUTEX(dt_affinity_mutex);
+
static int mobility_rtas_call(int token, char *buf, s32 scope)
{
int rc;
@@ -270,13 +272,19 @@ int pseries_devicetree_update(s32 scope)
int update_nodes_token;
int rc;
+ mutex_lock(&dt_affinity_mutex);
+
update_nodes_token = rtas_token("ibm,update-nodes");
- if (update_nodes_token == RTAS_UNKNOWN_SERVICE)
+ if (update_nodes_token == RTAS_UNKNOWN_SERVICE) {
+ mutex_unlock(&dt_affinity_mutex);
return -EINVAL;
+ }
rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
- if (!rtas_buf)
+ if (!rtas_buf) {
+ mutex_unlock(&dt_affinity_mutex);
return -ENOMEM;
+ }
do {
rc = mobility_rtas_call(update_nodes_token, rtas_buf, scope);
@@ -316,6 +324,7 @@ int pseries_devicetree_update(s32 scope)
} while (rc == 1);
kfree(rtas_buf);
+ mutex_unlock(&dt_affinity_mutex);
return rc;
}
@@ -371,10 +380,10 @@ static ssize_t migration_store(struct class *class,
if (rc)
return rc;
- post_mobility_fixup();
-
start_topology_update();
+ post_mobility_fixup();
+
return count;
}
--
2.12.3
^ permalink raw reply related
* [linuxppc-dev] Patch notification: 3 patches updated
From: Patchwork @ 2019-04-27 4:07 UTC (permalink / raw)
To: linuxppc-dev
Hello,
The following patches (submitted by you) have been updated in Patchwork:
* linuxppc-dev: crash in ppc4xx-rng on canyonland
- http://patchwork.ozlabs.org/patch/608253/
- for: Linux PPC development
was: New
now: Not Applicable
* linuxppc-dev: crash in ppc4xx-rng on canyonland
- http://patchwork.ozlabs.org/patch/602137/
- for: Linux PPC development
was: New
now: Not Applicable
* linuxppc-dev: crash in ppc4xx-rng on canyonland
- http://patchwork.ozlabs.org/patch/611704/
- for: Linux PPC development
was: New
now: Not Applicable
This email is a notification only - you do not need to respond.
Happy patchworking.
--
This is an automated mail sent by the Patchwork system at
patchwork.ozlabs.org. To stop receiving these notifications, edit
your mail settings at:
http://patchwork.ozlabs.org/mail/
^ permalink raw reply
* [PATCH 2/4] dt-bindings: doc: Reflect new NVMEM of_get_mac_address behaviour
From: Petr Štetiar @ 2019-04-26 23:06 UTC (permalink / raw)
To: netdev, devicetree, linux-kernel, David S. Miller, Rob Herring,
Mark Rutland, Andrew Lunn, Vivien Didelot, Florian Fainelli,
Heiko Stuebner, Fugang Duan, Claudiu Manoil, Yisen Zhuang,
Salil Mehta, Woojung Huh, Microchip Linux Driver Support,
Neil Armstrong, Kunihiko Hayashi, Masahiro Yamada, Jassi Brar,
Maxime Coquelin, Alexandre Torgue, Kalle Valo, Matthias Brugger,
Li Yang
Cc: Maxime Ripard, linuxppc-dev, linux-wireless, linux-rockchip,
linux-mediatek, Srinivas Kandagatla, Alban Bedel,
Petr Štetiar, linux-oxnas, Frank Rowand, linux-stm32,
linux-arm-kernel, Heiner Kallweit
In-Reply-To: <1556320002-26213-1-git-send-email-ynezz@true.cz>
As of_get_mac_address now supports NVMEM under the hood, we should
update the bindings documentation with the new nvmem-cell* properties.
While at it, fix also other missing properties supported by
of_get_mac_address.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
Documentation/devicetree/bindings/net/altera_tse.txt | 3 +++
Documentation/devicetree/bindings/net/arc_emac.txt | 4 ++++
Documentation/devicetree/bindings/net/brcm,amac.txt | 3 +++
Documentation/devicetree/bindings/net/brcm,bcmgenet.txt | 5 +++++
Documentation/devicetree/bindings/net/brcm,systemport.txt | 4 ++++
Documentation/devicetree/bindings/net/cavium-mix.txt | 7 ++++++-
Documentation/devicetree/bindings/net/cavium-pip.txt | 5 +++++
Documentation/devicetree/bindings/net/cpsw.txt | 3 +++
Documentation/devicetree/bindings/net/davicom-dm9000.txt | 4 ++++
Documentation/devicetree/bindings/net/davinci_emac.txt | 2 ++
Documentation/devicetree/bindings/net/dsa/dsa.txt | 7 ++++---
Documentation/devicetree/bindings/net/emac_rockchip.txt | 4 ++++
Documentation/devicetree/bindings/net/ethernet.txt | 2 ++
Documentation/devicetree/bindings/net/ezchip_enet.txt | 6 ++++++
Documentation/devicetree/bindings/net/fsl-fec.txt | 4 ++++
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt | 4 ++++
Documentation/devicetree/bindings/net/hisilicon-femac.txt | 3 +++
Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt | 3 +++
Documentation/devicetree/bindings/net/keystone-netcp.txt | 9 ++++++---
Documentation/devicetree/bindings/net/macb.txt | 8 ++++----
Documentation/devicetree/bindings/net/marvell-orion-net.txt | 3 +++
Documentation/devicetree/bindings/net/marvell-pxa168.txt | 3 +++
Documentation/devicetree/bindings/net/microchip,enc28j60.txt | 3 +++
Documentation/devicetree/bindings/net/microchip,lan78xx.txt | 2 ++
Documentation/devicetree/bindings/net/opencores-ethoc.txt | 4 ++++
Documentation/devicetree/bindings/net/oxnas-dwmac.txt | 6 ++++++
Documentation/devicetree/bindings/net/qca,qca7000.txt | 3 +++
Documentation/devicetree/bindings/net/samsung-sxgbe.txt | 3 +++
Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt | 2 ++
Documentation/devicetree/bindings/net/socfpga-dwmac.txt | 4 ++++
.../devicetree/bindings/net/socionext,uniphier-ave4.txt | 3 +++
Documentation/devicetree/bindings/net/socionext-netsec.txt | 2 ++
Documentation/devicetree/bindings/net/stmmac.txt | 4 ++++
Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt | 2 ++
Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt | 2 ++
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt | 3 +++
36 files changed, 128 insertions(+), 11 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/altera_tse.txt b/Documentation/devicetree/bindings/net/altera_tse.txt
index 0e21df9..dbc2bb4 100644
--- a/Documentation/devicetree/bindings/net/altera_tse.txt
+++ b/Documentation/devicetree/bindings/net/altera_tse.txt
@@ -47,8 +47,11 @@ Required properties:
- device_type: Must be "ethernet-phy".
Optional properties:
+- mac-address: See ethernet.txt in the same directory.
- local-mac-address: See ethernet.txt in the same directory.
- max-frame-size: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Example:
diff --git a/Documentation/devicetree/bindings/net/arc_emac.txt b/Documentation/devicetree/bindings/net/arc_emac.txt
index c73a0e9..139204e 100644
--- a/Documentation/devicetree/bindings/net/arc_emac.txt
+++ b/Documentation/devicetree/bindings/net/arc_emac.txt
@@ -13,6 +13,10 @@ Optional properties:
only if property "phy-reset-gpios" is available. Missing the property
will have the duration be 1 millisecond. Numbers greater than 1000 are
invalid and 1 millisecond will be used instead.
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Clock handling:
The clock frequency is needed to calculate and set polling period of EMAC.
diff --git a/Documentation/devicetree/bindings/net/brcm,amac.txt b/Documentation/devicetree/bindings/net/brcm,amac.txt
index 0bfad65..a9b9514 100644
--- a/Documentation/devicetree/bindings/net/brcm,amac.txt
+++ b/Documentation/devicetree/bindings/net/brcm,amac.txt
@@ -18,6 +18,9 @@ Required properties:
Optional properties:
- mac-address: See ethernet.txt file in the same directory
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Examples:
diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
index 3956af1..b7e2517 100644
--- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
+++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt
@@ -30,6 +30,11 @@ Optional properties:
See Documentation/devicetree/bindings/net/fixed-link.txt for information on
the property specifics
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
+
Required child nodes:
- mdio bus node: this node should always be present regardless of the PHY
diff --git a/Documentation/devicetree/bindings/net/brcm,systemport.txt b/Documentation/devicetree/bindings/net/brcm,systemport.txt
index 83f29e0..ce3c812 100644
--- a/Documentation/devicetree/bindings/net/brcm,systemport.txt
+++ b/Documentation/devicetree/bindings/net/brcm,systemport.txt
@@ -20,6 +20,10 @@ Optional properties:
- systemport,num-tier1-arb: number of tier 1 arbiters, an integer
- systemport,num-txq: number of HW transmit queues, an integer
- systemport,num-rxq: number of HW receive queues, an integer
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Example:
ethernet@f04a0000 {
diff --git a/Documentation/devicetree/bindings/net/cavium-mix.txt b/Documentation/devicetree/bindings/net/cavium-mix.txt
index 8d7c309..41bcc99 100644
--- a/Documentation/devicetree/bindings/net/cavium-mix.txt
+++ b/Documentation/devicetree/bindings/net/cavium-mix.txt
@@ -18,7 +18,12 @@ Properties:
- interrupts: Two interrupt specifiers. The first is the MIX
interrupt routing and the second the routing for the AGL interrupts.
-- phy-handle: Optional, see ethernet.txt file in the same directory.
+Optional properties:
+- phy-handle: See ethernet.txt file in the same directory.
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Example:
ethernet@1070000100800 {
diff --git a/Documentation/devicetree/bindings/net/cavium-pip.txt b/Documentation/devicetree/bindings/net/cavium-pip.txt
index e3b8fe71..4b1c3d9 100644
--- a/Documentation/devicetree/bindings/net/cavium-pip.txt
+++ b/Documentation/devicetree/bindings/net/cavium-pip.txt
@@ -43,6 +43,11 @@ Properties for PIP port which is a child the PIP interface:
- tx-delay: Delay value for RGMII transmit clock. Optional. Disabled if 0.
Value range is 1-31, and mapping to the actual delay varies depending on HW.
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
+
Example:
pip@11800a0000000 {
diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
index 3264e19..248f7df 100644
--- a/Documentation/devicetree/bindings/net/cpsw.txt
+++ b/Documentation/devicetree/bindings/net/cpsw.txt
@@ -50,6 +50,9 @@ Required properties:
Optional properties:
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
- mac-address : See ethernet.txt file in the same directory
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- phy_id : Specifies slave phy id (deprecated, use phy-handle)
- phy-handle : See ethernet.txt file in the same directory
diff --git a/Documentation/devicetree/bindings/net/davicom-dm9000.txt b/Documentation/devicetree/bindings/net/davicom-dm9000.txt
index 64c159e..ce60d35 100644
--- a/Documentation/devicetree/bindings/net/davicom-dm9000.txt
+++ b/Documentation/devicetree/bindings/net/davicom-dm9000.txt
@@ -12,6 +12,10 @@ Optional properties:
- davicom,ext-phy : Use external PHY
- reset-gpios : phandle of gpio that will be used to reset chip during probe
- vcc-supply : phandle of regulator that will be used to enable power to chip
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Example:
diff --git a/Documentation/devicetree/bindings/net/davinci_emac.txt b/Documentation/devicetree/bindings/net/davinci_emac.txt
index ca83dcc..c953945 100644
--- a/Documentation/devicetree/bindings/net/davinci_emac.txt
+++ b/Documentation/devicetree/bindings/net/davinci_emac.txt
@@ -20,6 +20,8 @@ Required properties:
Optional properties:
- phy-handle: See ethernet.txt file in the same directory.
If absent, davinci_emac driver defaults to 100/FULL.
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
- ti,davinci-rmii-en: 1 byte, 1 means use RMII
diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.txt b/Documentation/devicetree/bindings/net/dsa/dsa.txt
index d66a529..9e2f0fa 100644
--- a/Documentation/devicetree/bindings/net/dsa/dsa.txt
+++ b/Documentation/devicetree/bindings/net/dsa/dsa.txt
@@ -71,9 +71,10 @@ properties, described in binding documents:
Documentation/devicetree/bindings/net/fixed-link.txt
for details.
-- local-mac-address : See
- Documentation/devicetree/bindings/net/ethernet.txt
- for details.
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Example
diff --git a/Documentation/devicetree/bindings/net/emac_rockchip.txt b/Documentation/devicetree/bindings/net/emac_rockchip.txt
index 05bd7da..a84944a 100644
--- a/Documentation/devicetree/bindings/net/emac_rockchip.txt
+++ b/Documentation/devicetree/bindings/net/emac_rockchip.txt
@@ -14,6 +14,10 @@ Required properties:
Optional properties:
- phy-supply: phandle to a regulator if the PHY needs one
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Clock handling:
- clocks: Must contain an entry for each entry in clock-names.
diff --git a/Documentation/devicetree/bindings/net/ethernet.txt b/Documentation/devicetree/bindings/net/ethernet.txt
index 2974e63..1e2bc9a 100644
--- a/Documentation/devicetree/bindings/net/ethernet.txt
+++ b/Documentation/devicetree/bindings/net/ethernet.txt
@@ -10,6 +10,8 @@ Documentation/devicetree/bindings/phy/phy-bindings.txt.
the boot program; should be used in cases where the MAC address assigned to
the device by the boot program is different from the "local-mac-address"
property;
+- nvmem-cells: phandle, reference to an nvmem node for the MAC address
+- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
- max-speed: number, specifies maximum speed in Mbit/s supported by the device;
- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
the maximum frame size (there's contradiction in the Devicetree
diff --git a/Documentation/devicetree/bindings/net/ezchip_enet.txt b/Documentation/devicetree/bindings/net/ezchip_enet.txt
index 4e29b2b..f928b92 100644
--- a/Documentation/devicetree/bindings/net/ezchip_enet.txt
+++ b/Documentation/devicetree/bindings/net/ezchip_enet.txt
@@ -5,6 +5,12 @@ Required properties:
- reg: Address and length of the register set for the device
- interrupts: Should contain the ENET interrupt
+Optional properties:
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
+
Examples:
ethernet@f0003000 {
diff --git a/Documentation/devicetree/bindings/net/fsl-fec.txt b/Documentation/devicetree/bindings/net/fsl-fec.txt
index 2d41fb9..f2099f0 100644
--- a/Documentation/devicetree/bindings/net/fsl-fec.txt
+++ b/Documentation/devicetree/bindings/net/fsl-fec.txt
@@ -46,6 +46,10 @@ Optional properties:
tx/rx queues 1 and 2. "int0" will be used for queue 0 and ENET_MII interrupts.
For imx6sx, "int0" handles all 3 queues and ENET_MII. "pps" is for the pulse
per second interrupt associated with 1588 precision time protocol(PTP).
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Optional subnodes:
diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index 047bdf7..6bc9a68 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -71,6 +71,10 @@ Properties:
in the L2.
- rx-stash-idx : Denotes the index of the first byte from the received
buffer to stash in the L2.
+ - mac-address: See ethernet.txt in the same directory.
+ - local-mac-address: See ethernet.txt in the same directory.
+ - nvmem-cells: See ethernet.txt in the same directory.
+ - nvmem-cell-names: See ethernet.txt in the same directory.
Example:
ethernet@24000 {
diff --git a/Documentation/devicetree/bindings/net/hisilicon-femac.txt b/Documentation/devicetree/bindings/net/hisilicon-femac.txt
index d11af5e..e28bb6e 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-femac.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-femac.txt
@@ -15,6 +15,9 @@ Required properties:
- reset-names: should contain the reset signal name "mac"(required)
and "phy"(optional).
- mac-address: see ethernet.txt [1].
+- local-mac-address: see ethernet.txt [1].
+- nvmem-cells: see ethernet.txt [1].
+- nvmem-cell-names: see ethernet.txt [1].
- phy-mode: see ethernet.txt [1].
- phy-handle: see ethernet.txt [1].
- hisilicon,phy-reset-delays-us: triplet of delays if PHY reset signal given.
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt b/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
index eea73ad..dddd408 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hix5hd2-gmac.txt
@@ -19,6 +19,9 @@ Required properties:
- phy-mode: see ethernet.txt [1].
- phy-handle: see ethernet.txt [1].
- mac-address: see ethernet.txt [1].
+- local-mac-address: see ethernet.txt [1].
+- nvmem-cells: see ethernet.txt [1].
+- nvmem-cell-names: see ethernet.txt [1].
- clocks: clock phandle and specifier pair.
- clock-names: contain the clock name "mac_core"(required) and "mac_ifc"(optional).
- resets: should contain the phandle to the MAC core reset signal(optional),
diff --git a/Documentation/devicetree/bindings/net/keystone-netcp.txt b/Documentation/devicetree/bindings/net/keystone-netcp.txt
index 04ba1dc..61e8019 100644
--- a/Documentation/devicetree/bindings/net/keystone-netcp.txt
+++ b/Documentation/devicetree/bindings/net/keystone-netcp.txt
@@ -137,9 +137,12 @@ Optional properties:
when it obtains the mac address from efuse.
- local-mac-address: the driver is designed to use the of_get_mac_address api
only if efuse-mac is 0. When efuse-mac is 0, the MAC
- address is obtained from local-mac-address. If this
- attribute is not present, then the driver will use a
- random MAC address.
+ address is obtained from nvmem-cells, mac-address and
+ local-mac-address. If any of this attributes is not present,
+ then the driver will use a random MAC address.
+- mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- "netcp-device label": phandle to the device specification for each of NetCP
sub-module attached to this interface.
diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
index 8b80515..92c5642 100644
--- a/Documentation/devicetree/bindings/net/macb.txt
+++ b/Documentation/devicetree/bindings/net/macb.txt
@@ -26,15 +26,15 @@ Required properties:
Optional elements: 'tsu_clk'
- clocks: Phandles to input clocks.
-Optional properties:
-- nvmem-cells: phandle, reference to an nvmem node for the MAC address
-- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
-
Optional properties for PHY child node:
- reset-gpios : Should specify the gpio for phy reset
- magic-packet : If present, indicates that the hardware supports waking
up via magic packet.
- phy-handle : see ethernet.txt file in the same directory
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Examples:
diff --git a/Documentation/devicetree/bindings/net/marvell-orion-net.txt b/Documentation/devicetree/bindings/net/marvell-orion-net.txt
index 6fd988c..2e0c06f 100644
--- a/Documentation/devicetree/bindings/net/marvell-orion-net.txt
+++ b/Documentation/devicetree/bindings/net/marvell-orion-net.txt
@@ -37,6 +37,9 @@ Required port properties:
- reg: port number relative to ethernet controller, shall be 0, 1, or 2.
- interrupts: port interrupt.
- local-mac-address: See ethernet.txt file in the same directory.
+ - mac-address: See ethernet.txt in the same directory.
+ - nvmem-cells: See ethernet.txt in the same directory.
+ - nvmem-cell-names: See ethernet.txt in the same directory.
Optional port properties:
- marvell,tx-queue-size: size of the transmit ring buffer.
diff --git a/Documentation/devicetree/bindings/net/marvell-pxa168.txt b/Documentation/devicetree/bindings/net/marvell-pxa168.txt
index 845a148..5eaafa2 100644
--- a/Documentation/devicetree/bindings/net/marvell-pxa168.txt
+++ b/Documentation/devicetree/bindings/net/marvell-pxa168.txt
@@ -12,6 +12,9 @@ Optional properties:
- #size-cells: must be 0 when using sub-nodes.
- phy-handle: see ethernet.txt file in the same directory.
- local-mac-address: see ethernet.txt file in the same directory.
+- mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Sub-nodes:
Each PHY can be represented as a sub-node. This is not mandatory.
diff --git a/Documentation/devicetree/bindings/net/microchip,enc28j60.txt b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
index 24626e0..c06923d 100644
--- a/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
+++ b/Documentation/devicetree/bindings/net/microchip,enc28j60.txt
@@ -22,6 +22,9 @@ Optional properties:
According to the ENC28J80 datasheet, the chip allows a maximum of 20 MHz, however,
board designs may need to limit this value.
- local-mac-address: See ethernet.txt in the same directory.
+- mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Example (for NXP i.MX28 with pin control stuff for GPIO irq):
diff --git a/Documentation/devicetree/bindings/net/microchip,lan78xx.txt b/Documentation/devicetree/bindings/net/microchip,lan78xx.txt
index 76786a0..a31c475 100644
--- a/Documentation/devicetree/bindings/net/microchip,lan78xx.txt
+++ b/Documentation/devicetree/bindings/net/microchip,lan78xx.txt
@@ -10,6 +10,8 @@ Required properties:
Optional properties:
- local-mac-address: see ethernet.txt
- mac-address: see ethernet.txt
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Optional properties of the embedded PHY:
- microchip,led-modes: a 0..4 element vector, with each element configuring
diff --git a/Documentation/devicetree/bindings/net/opencores-ethoc.txt b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
index 2dc127c..e7969dc 100644
--- a/Documentation/devicetree/bindings/net/opencores-ethoc.txt
+++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
@@ -10,6 +10,10 @@ Required properties:
Optional properties:
- clocks: phandle to refer to the clk used as per
Documentation/devicetree/bindings/clock/clock-bindings.txt
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
Examples:
diff --git a/Documentation/devicetree/bindings/net/oxnas-dwmac.txt b/Documentation/devicetree/bindings/net/oxnas-dwmac.txt
index d7117a2..7f43451 100644
--- a/Documentation/devicetree/bindings/net/oxnas-dwmac.txt
+++ b/Documentation/devicetree/bindings/net/oxnas-dwmac.txt
@@ -17,6 +17,12 @@ Required properties on all platforms:
- oxsemi,sys-ctrl: a phandle to the system controller syscon node
+Optional properties:
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
+
Example :
etha: ethernet@40400000 {
diff --git a/Documentation/devicetree/bindings/net/qca,qca7000.txt b/Documentation/devicetree/bindings/net/qca,qca7000.txt
index e4a8a51..5a2627e 100644
--- a/Documentation/devicetree/bindings/net/qca,qca7000.txt
+++ b/Documentation/devicetree/bindings/net/qca,qca7000.txt
@@ -24,6 +24,9 @@ Optional properties:
are invalid. Missing the property will set the SPI
frequency to 8000000 Hertz.
- local-mac-address : see ./ethernet.txt
+- mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- qca,legacy-mode : Set the SPI data transfer of the QCA7000 to legacy mode.
In this mode the SPI master must toggle the chip select
between each data word. In burst mode these gaps aren't
diff --git a/Documentation/devicetree/bindings/net/samsung-sxgbe.txt b/Documentation/devicetree/bindings/net/samsung-sxgbe.txt
index 46e5911..94c12b4 100644
--- a/Documentation/devicetree/bindings/net/samsung-sxgbe.txt
+++ b/Documentation/devicetree/bindings/net/samsung-sxgbe.txt
@@ -22,6 +22,9 @@ Required properties:
Optional properties:
- mac-address: 6 bytes, mac address
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- max-frame-size: Maximum Transfer Unit (IEEE defined MTU), rather
than the maximum frame size.
diff --git a/Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt b/Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt
index 36f1aef..881848f 100644
--- a/Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt
+++ b/Documentation/devicetree/bindings/net/snps,dwc-qos-ethernet.txt
@@ -105,6 +105,8 @@ Optional properties:
- dma-coherent: Present if dma operations are coherent
- mac-address: See ethernet.txt in the same directory
- local-mac-address: See ethernet.txt in the same directory
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- phy-reset-gpios: Phandle and specifier for any GPIO used to reset the PHY.
See ../gpio/gpio.txt.
- snps,en-lpi: If present it enables use of the AXI low-power interface
diff --git a/Documentation/devicetree/bindings/net/socfpga-dwmac.txt b/Documentation/devicetree/bindings/net/socfpga-dwmac.txt
index 17d6819..29ffd21 100644
--- a/Documentation/devicetree/bindings/net/socfpga-dwmac.txt
+++ b/Documentation/devicetree/bindings/net/socfpga-dwmac.txt
@@ -19,6 +19,10 @@ altr,emac-splitter: Should be the phandle to the emac splitter soft IP node if
DWMAC controller is connected emac splitter.
phy-mode: The phy mode the ethernet operates in
altr,sgmii-to-sgmii-converter: phandle to the TSE SGMII converter
+mac-address: See ethernet.txt in the same directory.
+local-mac-address: See ethernet.txt in the same directory.
+nvmem-cells: See ethernet.txt in the same directory.
+nvmem-cell-names: See ethernet.txt in the same directory.
This device node has additional phandle dependency, the sgmii converter:
diff --git a/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt b/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
index fc8f017..13daf31 100644
--- a/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
+++ b/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
@@ -33,6 +33,9 @@ Required properties:
Optional properties:
- local-mac-address: See ethernet.txt in the same directory.
+ - mac-address: See ethernet.txt in the same directory.
+ - nvmem-cells: See ethernet.txt in the same directory.
+ - nvmem-cell-names: See ethernet.txt in the same directory.
Required subnode:
- mdio: A container for child nodes representing phy nodes.
diff --git a/Documentation/devicetree/bindings/net/socionext-netsec.txt b/Documentation/devicetree/bindings/net/socionext-netsec.txt
index 0cff94f..c5ac7fc 100644
--- a/Documentation/devicetree/bindings/net/socionext-netsec.txt
+++ b/Documentation/devicetree/bindings/net/socionext-netsec.txt
@@ -28,6 +28,8 @@ Optional properties: (See ethernet.txt file in the same directory)
accesses performed by the device are cache coherent.
- local-mac-address: See ethernet.txt in the same directory.
- mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- max-speed: See ethernet.txt in the same directory.
- max-frame-size: See ethernet.txt in the same directory.
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index cb69406..0a0519a 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -21,6 +21,10 @@ Required properties:
The 3rd cell is reset post-delay in micro seconds.
Optional properties:
+- mac-address: See ethernet.txt in the same directory.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- resets: Should contain a phandle to the STMMAC reset signal, if any
- reset-names: Should contain the reset signal name "stmmaceth", if a
reset phandle is given
diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
index 7b9a776..bd5cc92 100644
--- a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
+++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
@@ -15,6 +15,8 @@ Optional properties:
- mac-address: See ethernet.txt in the parent directory
- local-mac-address: See ethernet.txt in the parent directory
+- nvmem-cells: See ethernet.txt in the parent directory.
+- nvmem-cell-names: See ethernet.txt in the parent directory.
- ieee80211-freq-limit: See ieee80211.txt
- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
diff --git a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
index b7396c8..77074a0 100644
--- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
+++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
@@ -36,6 +36,8 @@ Optional properties:
kernel firmware loader).
- mac-address: See ethernet.txt in the parent directory
- local-mac-address: See ethernet.txt in the parent directory
+- nvmem-cells: See ethernet.txt in the parent directory.
+- nvmem-cell-names: See ethernet.txt in the parent directory.
In this example, the node is defined as child node of the PCI controller:
diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt
index 5efb7ac..7fee9d5 100644
--- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt
@@ -43,6 +43,9 @@ to check for the new properties first.
Required properties for network device_type:
- mac-address : list of bytes representing the ethernet address.
+- local-mac-address: See ethernet.txt in the same directory.
+- nvmem-cells: See ethernet.txt in the same directory.
+- nvmem-cell-names: See ethernet.txt in the same directory.
- phy-handle : The phandle for the PHY connected to this controller.
Recommended properties:
--
1.9.1
^ permalink raw reply related
* [PATCH]powerpc/mobility: Serialize PRRN and LPM in device tree update
From: Juliet Kim @ 2019-04-26 19:06 UTC (permalink / raw)
To: linuxppc-dev; +Cc: nathanl, mmc, mwb
Fix extending start/stop topology update scope during LPM
Commit 65b9fdadfc4d ("powerpc/pseries/mobility: Extend start/stop
topology update scope") made the change to the duration that
topology updates are suppressed during LPM to allow the complete
device tree update which leaves the property update notifier
unregistered until device tree update completes. This prevents
topology update during LPM.
Instead, use mutex_lock, which serializes LPM and PRRN operation
in pseries_devicetree_update.
Signed-off-by: Juliet Kim <julietk@linux.ibm.com>
arch/powerpc/platforms/pseries/mobility.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 88925f8ca8a0..3a79ded056fd 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -42,6 +42,8 @@ struct update_props_workarea {
#define MIGRATION_SCOPE (1)
#define PRRN_SCOPE -2
+static DEFINE_MUTEX(dt_affinity_mutex);
+
static int mobility_rtas_call(int token, char *buf, s32 scope)
{
int rc;
@@ -270,13 +272,19 @@ int pseries_devicetree_update(s32 scope)
int update_nodes_token;
int rc;
+ mutex_lock(&dt_affinity_mutex);
+
update_nodes_token = rtas_token("ibm,update-nodes");
- if (update_nodes_token == RTAS_UNKNOWN_SERVICE)
+ if (update_nodes_token == RTAS_UNKNOWN_SERVICE) {
+ mutex_unlock(&dt_affinity_mutex);
return -EINVAL;
+ }
rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
- if (!rtas_buf)
+ if (!rtas_buf) {
+ mutex_unlock(&dt_affinity_mutex);
return -ENOMEM;
+ }
do {
rc = mobility_rtas_call(update_nodes_token, rtas_buf, scope);
@@ -316,6 +324,7 @@ int pseries_devicetree_update(s32 scope)
} while (rc == 1);
kfree(rtas_buf);
+ mutex_unlock(&dt_affinity_mutex);
return rc;
}
@@ -371,10 +380,10 @@ static ssize_t migration_store(struct class *class,
if (rc)
return rc;
- post_mobility_fixup();
-
start_topology_update();
+ post_mobility_fixup();
+
return count;
}
--
2.12.3
^ permalink raw reply related
* [PATCH]powerpc/mobility: Serialize PRRN and LPM in device tree update
From: Juilet Kim @ 2019-04-26 16:08 UTC (permalink / raw)
To: linuxppc-dev; +Cc: nathanl, mmc, mwb
Fix extending start/stop topology update scope during LPM
Commit 65b9fdadfc4d ("powerpc/pseries/mobility: Extend start/stop
topology update scope") made the change to the duration that
topology updates are suppressed during LPM to allow the complete
device tree update which leaves the property update notifier
unregistered until device tree update completes. This prevents
topology update during LPM.
Instead, use mutex_lock, which serializes LPM and PRRN operation
in pseries_devicetree_update.
Signed-off-by: Juliet Kim <julietk@linux.ibm.com>
arch/powerpc/platforms/pseries/mobility.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 88925f8ca8a0..3a79ded056fd 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -42,6 +42,8 @@ struct update_props_workarea {
#define MIGRATION_SCOPE (1)
#define PRRN_SCOPE -2
+static DEFINE_MUTEX(dt_affinity_mutex);
+
static int mobility_rtas_call(int token, char *buf, s32 scope)
{
int rc;
@@ -270,13 +272,19 @@ int pseries_devicetree_update(s32 scope)
int update_nodes_token;
int rc;
+ mutex_lock(&dt_affinity_mutex);
+
update_nodes_token = rtas_token("ibm,update-nodes");
- if (update_nodes_token == RTAS_UNKNOWN_SERVICE)
+ if (update_nodes_token == RTAS_UNKNOWN_SERVICE) {
+ mutex_unlock(&dt_affinity_mutex);
return -EINVAL;
+ }
rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
- if (!rtas_buf)
+ if (!rtas_buf) {
+ mutex_unlock(&dt_affinity_mutex);
return -ENOMEM;
+ }
do {
rc = mobility_rtas_call(update_nodes_token, rtas_buf, scope);
@@ -316,6 +324,7 @@ int pseries_devicetree_update(s32 scope)
} while (rc == 1);
kfree(rtas_buf);
+ mutex_unlock(&dt_affinity_mutex);
return rc;
}
@@ -371,10 +380,10 @@ static ssize_t migration_store(struct class *class,
if (rc)
return rc;
- post_mobility_fixup();
-
start_topology_update();
+ post_mobility_fixup();
+
return count;
}
--
2.12.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox