Skip to content

Commit

Permalink
kernel: backport of changes & helpers
Browse files Browse the repository at this point in the history
This code is required for upcoming NVMEM changes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  • Loading branch information
Rafał Miłecki committed Jan 7, 2023
1 parent 98b09ba commit 11759a5
Show file tree
Hide file tree
Showing 18 changed files with 2,407 additions and 5 deletions.
@@ -0,0 +1,95 @@
From 3637d49e11219512920aca8b8ccd0994be33fa8b Mon Sep 17 00:00:00 2001
From: Lee Jones <lee.jones@linaro.org>
Date: Thu, 18 Mar 2021 10:40:30 +0000
Subject: [PATCH] of: base: Fix some formatting issues and provide missing
descriptions

Fixes the following W=1 kernel build warning(s):

drivers/of/base.c:315: warning: Function parameter or member 'cpun' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: Function parameter or member 'prop_name' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: Function parameter or member 'cpu' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: Function parameter or member 'thread' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: expecting prototype for property holds the physical id of the(). Prototype was for __of_find_n_match_cpu_property() instead
drivers/of/base.c:1139: warning: Function parameter or member 'match' not described in 'of_find_matching_node_and_match'
drivers/of/base.c:1779: warning: Function parameter or member 'np' not described in '__of_add_property'
drivers/of/base.c:1779: warning: Function parameter or member 'prop' not described in '__of_add_property'
drivers/of/base.c:1800: warning: Function parameter or member 'np' not described in 'of_add_property'
drivers/of/base.c:1800: warning: Function parameter or member 'prop' not described in 'of_add_property'
drivers/of/base.c:1849: warning: Function parameter or member 'np' not described in 'of_remove_property'
drivers/of/base.c:1849: warning: Function parameter or member 'prop' not described in 'of_remove_property'
drivers/of/base.c:2137: warning: Function parameter or member 'dn' not described in 'of_console_check'
drivers/of/base.c:2137: warning: Function parameter or member 'name' not described in 'of_console_check'
drivers/of/base.c:2137: warning: Function parameter or member 'index' not described in 'of_console_check'

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: devicetree@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210318104036.3175910-5-lee.jones@linaro.org
---
drivers/of/base.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -305,7 +305,7 @@ bool __weak arch_match_cpu_phys_id(int c
return (u32)phys_id == cpu;
}

-/**
+/*
* Checks if the given "prop_name" property holds the physical id of the
* core/thread corresponding to the logical cpu 'cpu'. If 'thread' is not
* NULL, local thread number within the core is returned in it.
@@ -1128,7 +1128,7 @@ EXPORT_SYMBOL(of_match_node);
* will; typically, you pass what the previous call
* returned. of_node_put() will be called on it
* @matches: array of of device match structures to search in
- * @match Updated to point at the matches entry which matched
+ * @match: Updated to point at the matches entry which matched
*
* Returns a node pointer with refcount incremented, use
* of_node_put() on it when done.
@@ -1779,6 +1779,8 @@ EXPORT_SYMBOL(of_count_phandle_with_args

/**
* __of_add_property - Add a property to a node without lock operations
+ * @np: Caller's Device Node
+ * @prob: Property to add
*/
int __of_add_property(struct device_node *np, struct property *prop)
{
@@ -1800,6 +1802,8 @@ int __of_add_property(struct device_node

/**
* of_add_property - Add a property to a node
+ * @np: Caller's Device Node
+ * @prob: Property to add
*/
int of_add_property(struct device_node *np, struct property *prop)
{
@@ -1844,6 +1848,8 @@ int __of_remove_property(struct device_n

/**
* of_remove_property - Remove a property from a node.
+ * @np: Caller's Device Node
+ * @prob: Property to remove
*
* Note that we don't actually remove it, since we have given out
* who-knows-how-many pointers to the data using get-property.
@@ -2130,9 +2136,9 @@ EXPORT_SYMBOL_GPL(of_alias_get_highest_i

/**
* of_console_check() - Test and setup console for DT setup
- * @dn - Pointer to device node
- * @name - Name to use for preferred console without index. ex. "ttyS"
- * @index - Index to use for preferred console.
+ * @dn: Pointer to device node
+ * @name: Name to use for preferred console without index. ex. "ttyS"
+ * @index: Index to use for preferred console.
*
* Check if the given device node matches the stdout-path property in the
* /chosen node. If it does then register it as the preferred console and return

3 comments on commit 11759a5

@DragonBluep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recent NVMEM backport caused some errors on ath79/nand: Netgear R6100. However, mac address and wireless calibration data are correct, so I think they're just some warnings.

Sun Jan  8 01:01:20 2023 kern.err kernel: [    0.159501] OF: /ahb/eth@19000000: could not get #nvmem-cell-cells for /ahb/nand@1b000200/partitions/partition@20000/macaddr@6
Sun Jan  8 01:01:20 2023 kern.err kernel: [    0.171819] OF: /ahb/eth@1a000000: could not get #nvmem-cell-cells for /ahb/nand@1b000200/partitions/partition@20000/macaddr@0
Sun Jan  8 01:01:20 2023 kern.err kernel: [    0.184221] OF: /ahb/wmac@18100000: could not get #nvmem-cell-cells for /ahb/nand@1b000200/partitions/partition@20000/calibration@1000
Sun Jan  8 01:01:20 2023 kern.err kernel: [    0.197725] OF: /ahb/pcie-controller@180c0000/wifi@0,0: could not get #nvmem-cell-cells for /ahb/nand@1b000200/partitions/partition@20000/calibration@5000

@Vladdrako
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same on ramips/mt7621/mi-r3p

[    0.422573] OF: /ethernet@1e100000/mac@0: could not get #nvmem-cell-cells for /nand@1e003000/partitions/partition@c0000/macaddr@e006
[    0.434473] OF: /ethernet@1e100000/mac@1: could not get #nvmem-cell-cells for /nand@1e003000/partitions/partition@c0000/macaddr@e000

@regae
Copy link

@regae regae commented on 11759a5 Jan 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same on eap1200h ath79

[ 0.165817] OF: /ahb/eth@19000000: could not get #nvmem-cell-cells for /ahb/spi@1f000000/flash@0/partitions/partition@ff0000/macaddr@0
[ 0.178913] OF: /ahb/pcie-controller@180c0000/wifi@0,0,0: could not get #nvmem-cell-cells for /ahb/spi@1f000000/flash@0/partitions/partition@ff0000/macaddr@0
[ 0.193983] OF: /ahb/wmac@18100000: could not get #nvmem-cell-cells for /ahb/spi@1f000000/flash@0/partitions/partition@ff0000/macaddr@0

Please sign in to comment.