* [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once
@ 2013-06-23 21:38 Aaro Koskinen
2013-06-23 21:38 ` [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Aaro Koskinen @ 2013-06-23 21:38 UTC (permalink / raw)
To: Ralf Baechle, linux-mips; +Cc: Aaro Koskinen
When booting a new board for the first time, the console is flooded with
"Unknown board" messages. This is not really helpful. Board type is not
going to change after the boot, so it's sufficient to print the warning
only once.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
v2: Adjust indentation.
arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
index 7c64977..9838c0e 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
@@ -31,6 +31,8 @@
* network ports from the rest of the cvmx-helper files.
*/
+#include <linux/printk.h>
+
#include <asm/octeon/octeon.h>
#include <asm/octeon/cvmx-bootinfo.h>
@@ -184,9 +186,8 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
}
/* Some unknown board. Somebody forgot to update this function... */
- cvmx_dprintf
- ("cvmx_helper_board_get_mii_address: Unknown board type %d\n",
- cvmx_sysinfo_get()->board_type);
+ pr_warn_once("%s: Unknown board type %d\n", __func__,
+ cvmx_sysinfo_get()->board_type);
return -1;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite 2013-06-23 21:38 [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen @ 2013-06-23 21:38 ` Aaro Koskinen 2013-06-24 18:48 ` David Daney 2013-06-24 18:52 ` [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once David Daney 2013-06-26 18:47 ` Ralf Baechle 2 siblings, 1 reply; 11+ messages in thread From: Aaro Koskinen @ 2013-06-23 21:38 UTC (permalink / raw) To: Ralf Baechle, linux-mips; +Cc: Aaro Koskinen Enable interfaces on EdgeRouter Lite. Tested with cavium_octeon_defconfig and busybox shell. DHCP & ping works with eth0, eth1 and eth2. The board type "UBNT_E100" is taken from the sources of the vendor kernel shipped with the product. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> --- arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 13 +++++++++++++ arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c index 9838c0e..2fcf030 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c @@ -183,6 +183,11 @@ int cvmx_helper_board_get_mii_address(int ipd_port) return ipd_port - 16 + 4; else return -1; + case CVMX_BOARD_TYPE_UBNT_E100: + if (ipd_port >= 0 && ipd_port <= 2) + return 7 - ipd_port; + else + return -1; } /* Some unknown board. Somebody forgot to update this function... */ @@ -707,6 +712,14 @@ int __cvmx_helper_board_hardware_enable(int interface) } } } + } else if (cvmx_sysinfo_get()->board_type == + CVMX_BOARD_TYPE_UBNT_E100) { + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0); + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10); + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0); + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10); + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0); + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10); } return 0; } diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h index 284fa8d..7b7818d 100644 --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h @@ -227,6 +227,7 @@ enum cvmx_board_types_enum { * use any numbers in this range. */ CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, + CVMX_BOARD_TYPE_UBNT_E100 = 20002, CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, /* The remaining range is reserved for future use. */ @@ -325,6 +326,7 @@ static inline const char *cvmx_board_type_to_string(enum /* Customer private range */ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) } return "Unsupported Board"; -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite 2013-06-23 21:38 ` [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen @ 2013-06-24 18:48 ` David Daney 2013-06-28 21:41 ` Aaro Koskinen 0 siblings, 1 reply; 11+ messages in thread From: David Daney @ 2013-06-24 18:48 UTC (permalink / raw) To: Aaro Koskinen, Ralf Baechle; +Cc: linux-mips On 06/23/2013 02:38 PM, Aaro Koskinen wrote: > Enable interfaces on EdgeRouter Lite. Tested with cavium_octeon_defconfig > and busybox shell. DHCP & ping works with eth0, eth1 and eth2. > > The board type "UBNT_E100" is taken from the sources of the vendor kernel > shipped with the product. > > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> I don't have a board to verify any of this, but... Acked-by: David Daney <david.daney@cavium.com> > --- > arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 13 +++++++++++++ > arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 ++ > 2 files changed, 15 insertions(+) > > diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > index 9838c0e..2fcf030 100644 > --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > @@ -183,6 +183,11 @@ int cvmx_helper_board_get_mii_address(int ipd_port) > return ipd_port - 16 + 4; > else > return -1; > + case CVMX_BOARD_TYPE_UBNT_E100: > + if (ipd_port >= 0 && ipd_port <= 2) > + return 7 - ipd_port; > + else > + return -1; > } > > /* Some unknown board. Somebody forgot to update this function... */ > @@ -707,6 +712,14 @@ int __cvmx_helper_board_hardware_enable(int interface) > } > } > } > + } else if (cvmx_sysinfo_get()->board_type == > + CVMX_BOARD_TYPE_UBNT_E100) { > + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0); > + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10); > + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0); > + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10); > + cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0); > + cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10); > } > return 0; > } > diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h > index 284fa8d..7b7818d 100644 > --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h > +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h > @@ -227,6 +227,7 @@ enum cvmx_board_types_enum { > * use any numbers in this range. > */ > CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, > + CVMX_BOARD_TYPE_UBNT_E100 = 20002, > CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, > > /* The remaining range is reserved for future use. */ > @@ -325,6 +326,7 @@ static inline const char *cvmx_board_type_to_string(enum > > /* Customer private range */ > ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) > + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) > ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) > } > return "Unsupported Board"; > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite 2013-06-24 18:48 ` David Daney @ 2013-06-28 21:41 ` Aaro Koskinen 0 siblings, 0 replies; 11+ messages in thread From: Aaro Koskinen @ 2013-06-28 21:41 UTC (permalink / raw) To: Ralf Baechle, linux-mips; +Cc: David Daney Hi, On Mon, Jun 24, 2013 at 11:48:48AM -0700, David Daney wrote: > On 06/23/2013 02:38 PM, Aaro Koskinen wrote: > >Enable interfaces on EdgeRouter Lite. Tested with cavium_octeon_defconfig > >and busybox shell. DHCP & ping works with eth0, eth1 and eth2. > > > >The board type "UBNT_E100" is taken from the sources of the vendor kernel > >shipped with the product. > > > >Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> > > I don't have a board to verify any of this, but... > > Acked-by: David Daney <david.daney@cavium.com> Ralf, would it be still possible to get this patch into 3.11 merge window? 3.10-rc has been working well with this board. With this patch, we can enable ethernet, and also there will be USB driver in staging in 3.11, so this board would be already pretty much usable (at least for development purposes) with the mainline kernel. A. > > >--- > > arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 13 +++++++++++++ > > arch/mips/include/asm/octeon/cvmx-bootinfo.h | 2 ++ > > 2 files changed, 15 insertions(+) > > > >diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > >index 9838c0e..2fcf030 100644 > >--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > >+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > >@@ -183,6 +183,11 @@ int cvmx_helper_board_get_mii_address(int ipd_port) > > return ipd_port - 16 + 4; > > else > > return -1; > >+ case CVMX_BOARD_TYPE_UBNT_E100: > >+ if (ipd_port >= 0 && ipd_port <= 2) > >+ return 7 - ipd_port; > >+ else > >+ return -1; > > } > > > > /* Some unknown board. Somebody forgot to update this function... */ > >@@ -707,6 +712,14 @@ int __cvmx_helper_board_hardware_enable(int interface) > > } > > } > > } > >+ } else if (cvmx_sysinfo_get()->board_type == > >+ CVMX_BOARD_TYPE_UBNT_E100) { > >+ cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(0, interface), 0); > >+ cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(0, interface), 0x10); > >+ cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(1, interface), 0); > >+ cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(1, interface), 0x10); > >+ cvmx_write_csr(CVMX_ASXX_RX_CLK_SETX(2, interface), 0); > >+ cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(2, interface), 0x10); > > } > > return 0; > > } > >diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h > >index 284fa8d..7b7818d 100644 > >--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h > >+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h > >@@ -227,6 +227,7 @@ enum cvmx_board_types_enum { > > * use any numbers in this range. > > */ > > CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, > >+ CVMX_BOARD_TYPE_UBNT_E100 = 20002, > > CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, > > > > /* The remaining range is reserved for future use. */ > >@@ -325,6 +326,7 @@ static inline const char *cvmx_board_type_to_string(enum > > > > /* Customer private range */ > > ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) > >+ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) > > ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) > > } > > return "Unsupported Board"; > > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-23 21:38 [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen 2013-06-23 21:38 ` [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen @ 2013-06-24 18:52 ` David Daney 2013-06-24 22:04 ` Aaro Koskinen 2013-06-26 18:47 ` Ralf Baechle 2 siblings, 1 reply; 11+ messages in thread From: David Daney @ 2013-06-24 18:52 UTC (permalink / raw) To: Aaro Koskinen; +Cc: Ralf Baechle, linux-mips On 06/23/2013 02:38 PM, Aaro Koskinen wrote: > When booting a new board for the first time, the console is flooded with > "Unknown board" messages. This is not really helpful. Board type is not > going to change after the boot, so it's sufficient to print the warning > only once. > > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> I don't think we need this patch. In 2/2 you add the board type for the board you have, so you shouldn't be getting any messages, and this is unneeded. I don't mind spamming people with all the messages, if people see these messages, they have bigger problems than too many messages. David Daney > --- > > v2: Adjust indentation. > > arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > index 7c64977..9838c0e 100644 > --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > @@ -31,6 +31,8 @@ > * network ports from the rest of the cvmx-helper files. > */ > > +#include <linux/printk.h> > + > #include <asm/octeon/octeon.h> > #include <asm/octeon/cvmx-bootinfo.h> > > @@ -184,9 +186,8 @@ int cvmx_helper_board_get_mii_address(int ipd_port) > } > > /* Some unknown board. Somebody forgot to update this function... */ > - cvmx_dprintf > - ("cvmx_helper_board_get_mii_address: Unknown board type %d\n", > - cvmx_sysinfo_get()->board_type); > + pr_warn_once("%s: Unknown board type %d\n", __func__, > + cvmx_sysinfo_get()->board_type); > return -1; > } > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-24 18:52 ` [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once David Daney @ 2013-06-24 22:04 ` Aaro Koskinen 2013-06-24 22:33 ` David Daney 0 siblings, 1 reply; 11+ messages in thread From: Aaro Koskinen @ 2013-06-24 22:04 UTC (permalink / raw) To: David Daney; +Cc: Ralf Baechle, linux-mips On Mon, Jun 24, 2013 at 11:52:23AM -0700, David Daney wrote: > On 06/23/2013 02:38 PM, Aaro Koskinen wrote: > >When booting a new board for the first time, the console is flooded with > >"Unknown board" messages. This is not really helpful. Board type is not > >going to change after the boot, so it's sufficient to print the warning > >only once. > > > >Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> > > I don't think we need this patch. In 2/2 you add the board type for > the board you have, so you shouldn't be getting any messages, and > this is unneeded. > > I don't mind spamming people with all the messages, if people see > these messages, they have bigger problems than too many messages. I guess this patch can be dropped, but whoever tries to improve the support for the next new Octeon board will get annoyed by these same messages... A. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-24 22:04 ` Aaro Koskinen @ 2013-06-24 22:33 ` David Daney 2013-06-24 23:06 ` Aaro Koskinen 0 siblings, 1 reply; 11+ messages in thread From: David Daney @ 2013-06-24 22:33 UTC (permalink / raw) To: Aaro Koskinen; +Cc: Ralf Baechle, linux-mips On 06/24/2013 03:04 PM, Aaro Koskinen wrote: > On Mon, Jun 24, 2013 at 11:52:23AM -0700, David Daney wrote: >> On 06/23/2013 02:38 PM, Aaro Koskinen wrote: >>> When booting a new board for the first time, the console is flooded with >>> "Unknown board" messages. This is not really helpful. Board type is not >>> going to change after the boot, so it's sufficient to print the warning >>> only once. >>> >>> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> >> >> I don't think we need this patch. In 2/2 you add the board type for >> the board you have, so you shouldn't be getting any messages, and >> this is unneeded. >> >> I don't mind spamming people with all the messages, if people see >> these messages, they have bigger problems than too many messages. > > I guess this patch can be dropped, but whoever tries to improve the > support for the next new Octeon board will get annoyed by these same > messages... I would hope that the "next new Octeon board" would have a bootloader that supplies a device tree. That way most of this would never be used, and there would be no messages. David Daney ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-24 22:33 ` David Daney @ 2013-06-24 23:06 ` Aaro Koskinen 2013-06-24 23:24 ` David Daney 0 siblings, 1 reply; 11+ messages in thread From: Aaro Koskinen @ 2013-06-24 23:06 UTC (permalink / raw) To: David Daney, Ralf Baechle; +Cc: linux-mips On Mon, Jun 24, 2013 at 03:33:36PM -0700, David Daney wrote: > On 06/24/2013 03:04 PM, Aaro Koskinen wrote: > >On Mon, Jun 24, 2013 at 11:52:23AM -0700, David Daney wrote: > >>On 06/23/2013 02:38 PM, Aaro Koskinen wrote: > >>>When booting a new board for the first time, the console is flooded with > >>>"Unknown board" messages. This is not really helpful. Board type is not > >>>going to change after the boot, so it's sufficient to print the warning > >>>only once. > >>> > >>>Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> > >> > >>I don't think we need this patch. In 2/2 you add the board type for > >>the board you have, so you shouldn't be getting any messages, and > >>this is unneeded. > >> > >>I don't mind spamming people with all the messages, if people see > >>these messages, they have bigger problems than too many messages. > > > >I guess this patch can be dropped, but whoever tries to improve the > >support for the next new Octeon board will get annoyed by these same > >messages... > > I would hope that the "next new Octeon board" would have a > bootloader that supplies a device tree. That way most of this would > never be used, and there would be no messages. Yes, actually I was wondering if MIPS kernel could offer something similar to ARM's APPENDED_DTB, i.e. provide some mechanism to pass the dtb if the bootloader support is missing. A. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-24 23:06 ` Aaro Koskinen @ 2013-06-24 23:24 ` David Daney 0 siblings, 0 replies; 11+ messages in thread From: David Daney @ 2013-06-24 23:24 UTC (permalink / raw) To: Aaro Koskinen; +Cc: Ralf Baechle, linux-mips On 06/24/2013 04:06 PM, Aaro Koskinen wrote: > On Mon, Jun 24, 2013 at 03:33:36PM -0700, David Daney wrote: >> On 06/24/2013 03:04 PM, Aaro Koskinen wrote: >>> On Mon, Jun 24, 2013 at 11:52:23AM -0700, David Daney wrote: >>>> On 06/23/2013 02:38 PM, Aaro Koskinen wrote: >>>>> When booting a new board for the first time, the console is flooded with >>>>> "Unknown board" messages. This is not really helpful. Board type is not >>>>> going to change after the boot, so it's sufficient to print the warning >>>>> only once. >>>>> >>>>> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> >>>> >>>> I don't think we need this patch. In 2/2 you add the board type for >>>> the board you have, so you shouldn't be getting any messages, and >>>> this is unneeded. >>>> >>>> I don't mind spamming people with all the messages, if people see >>>> these messages, they have bigger problems than too many messages. >>> >>> I guess this patch can be dropped, but whoever tries to improve the >>> support for the next new Octeon board will get annoyed by these same >>> messages... >> >> I would hope that the "next new Octeon board" would have a >> bootloader that supplies a device tree. That way most of this would >> never be used, and there would be no messages. > > Yes, actually I was wondering if MIPS kernel could offer something > similar to ARM's APPENDED_DTB, i.e. provide some mechanism to pass the > dtb if the bootloader support is missing. > Well the octeon port does supply its own device tree if one isn't passed from the bootloader. And your patch 2/2 supplies the information used populate it. But that is not quite the same I think. It would be nice to be able to pass on the command line something. Then you could load a blob from the boot ROM or similar and get something sensible. David Daney ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-23 21:38 [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen 2013-06-23 21:38 ` [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen 2013-06-24 18:52 ` [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once David Daney @ 2013-06-26 18:47 ` Ralf Baechle 2013-06-28 22:58 ` Aaro Koskinen 2 siblings, 1 reply; 11+ messages in thread From: Ralf Baechle @ 2013-06-26 18:47 UTC (permalink / raw) To: Aaro Koskinen; +Cc: linux-mips On Mon, Jun 24, 2013 at 12:38:43AM +0300, Aaro Koskinen wrote: > When booting a new board for the first time, the console is flooded with > "Unknown board" messages. This is not really helpful. Board type is not > going to change after the boot, so it's sufficient to print the warning > only once. > > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> > --- > > v2: Adjust indentation. > > arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > index 7c64977..9838c0e 100644 > --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > @@ -31,6 +31,8 @@ > * network ports from the rest of the cvmx-helper files. > */ > > +#include <linux/printk.h> > + > #include <asm/octeon/octeon.h> > #include <asm/octeon/cvmx-bootinfo.h> > > @@ -184,9 +186,8 @@ int cvmx_helper_board_get_mii_address(int ipd_port) > } > > /* Some unknown board. Somebody forgot to update this function... */ > - cvmx_dprintf > - ("cvmx_helper_board_get_mii_address: Unknown board type %d\n", > - cvmx_sysinfo_get()->board_type); > + pr_warn_once("%s: Unknown board type %d\n", __func__, > + cvmx_sysinfo_get()->board_type); David, cvmx_dprintf() is a function frequently invoked from the OCTEON code. I'm wondering. Right now it's defined as: #if CVMX_ENABLE_DEBUG_PRINTS #define cvmx_dprintf printk #else #define cvmx_dprintf(...) {} #endif That is, there isn't even a severity level being used and the define CVMX_ENABLE_DEBUG_PRINTS to control cvmx_dprintf is way to similar to what CONFIG_DYNAMIC_DEBUG rsp. a simple #define DEBUG do. And the no-debug variant of cvmx_dprintf isn't correct in presence of side effects of arguments. So I propose to just replace cvmx_dprintf with pr_debug. What do you think? Ralf ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once 2013-06-26 18:47 ` Ralf Baechle @ 2013-06-28 22:58 ` Aaro Koskinen 0 siblings, 0 replies; 11+ messages in thread From: Aaro Koskinen @ 2013-06-28 22:58 UTC (permalink / raw) To: Ralf Baechle; +Cc: linux-mips Hi, On Wed, Jun 26, 2013 at 08:47:27PM +0200, Ralf Baechle wrote: > On Mon, Jun 24, 2013 at 12:38:43AM +0300, Aaro Koskinen wrote: > > When booting a new board for the first time, the console is flooded with > > "Unknown board" messages. This is not really helpful. Board type is not > > going to change after the boot, so it's sufficient to print the warning > > only once. > > > > Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> > > --- > > > > v2: Adjust indentation. > > > > arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > > index 7c64977..9838c0e 100644 > > --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > > +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c > > @@ -31,6 +31,8 @@ > > * network ports from the rest of the cvmx-helper files. > > */ > > > > +#include <linux/printk.h> > > + > > #include <asm/octeon/octeon.h> > > #include <asm/octeon/cvmx-bootinfo.h> > > > > @@ -184,9 +186,8 @@ int cvmx_helper_board_get_mii_address(int ipd_port) > > } > > > > /* Some unknown board. Somebody forgot to update this function... */ > > - cvmx_dprintf > > - ("cvmx_helper_board_get_mii_address: Unknown board type %d\n", > > - cvmx_sysinfo_get()->board_type); > > + pr_warn_once("%s: Unknown board type %d\n", __func__, > > + cvmx_sysinfo_get()->board_type); > > David, > > cvmx_dprintf() is a function frequently invoked from the OCTEON code. > I'm wondering. Right now it's defined as: > > #if CVMX_ENABLE_DEBUG_PRINTS > #define cvmx_dprintf printk > #else > #define cvmx_dprintf(...) {} > #endif > > That is, there isn't even a severity level being used and the define > CVMX_ENABLE_DEBUG_PRINTS to control cvmx_dprintf is way to similar to > what CONFIG_DYNAMIC_DEBUG rsp. a simple #define DEBUG do. And the > no-debug variant of cvmx_dprintf isn't correct in presence of side > effects of arguments. > > So I propose to just replace cvmx_dprintf with pr_debug. What do you > think? There are logs with prefix "WARNING:" and "ERROR:". So those could be converted to pr_warn/err, and remaining to pr_debug. A. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-06-28 22:58 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-06-23 21:38 [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once Aaro Koskinen 2013-06-23 21:38 ` [PATCH v2 2/2] MIPS: cavium-octeon: enable interfaces on EdgeRouter Lite Aaro Koskinen 2013-06-24 18:48 ` David Daney 2013-06-28 21:41 ` Aaro Koskinen 2013-06-24 18:52 ` [PATCH v2 1/2] MIPS: cavium-octeon: cvmx-helper-board: print unknown board warning only once David Daney 2013-06-24 22:04 ` Aaro Koskinen 2013-06-24 22:33 ` David Daney 2013-06-24 23:06 ` Aaro Koskinen 2013-06-24 23:24 ` David Daney 2013-06-26 18:47 ` Ralf Baechle 2013-06-28 22:58 ` Aaro Koskinen
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.