* [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915
@ 2023-10-17 19:05 Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 2/6] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Christian Marangi
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Christian Marangi @ 2023-10-17 19:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Kalle Valo, Matthias Brugger,
AngeloGioacchino Del Regno, Christian Marangi, Simon Horman,
Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Cc: stable
Commit 495184ac91bb ("mt76: mt7915: add support for applying
pre-calibration data") was fundamentally broken and never worked.
The idea (before NVMEM support) was to expand the MTD function and pass
an additional offset. For normal EEPROM load the offset would always be
0. For the purpose of precal loading, an offset was passed that was
internally the size of EEPROM, since precal data is right after the
EEPROM.
Problem is that the offset value passed is never handled and is actually
overwrite by
offset = be32_to_cpup(list);
ret = mtd_read(mtd, offset, len, &retlen, eep);
resulting in the passed offset value always ingnored. (and even passing
garbage data as precal as the start of the EEPROM is getting read)
Fix this by adding to the current offset value, the offset from DT to
correctly read the piece of data at the requested location.
Cc: stable@vger.kernel.org
Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index 36564930aef1..2558788f7ffb 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -67,7 +67,7 @@ static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offs
goto out_put_node;
}
- offset = be32_to_cpup(list);
+ offset += be32_to_cpup(list);
ret = mtd_read(mtd, offset, len, &retlen, eep);
put_mtd_device(mtd);
if (mtd_is_bitflip(ret))
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next RFC PATCH 2/6] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
@ 2023-10-17 19:05 ` Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 3/6] wifi: mt76: limit support of precal loading for mt7915 to MTD only Christian Marangi
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Christian Marangi @ 2023-10-17 19:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Kalle Valo, Matthias Brugger,
AngeloGioacchino Del Regno, Christian Marangi, Simon Horman,
Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Fix typo in mt76_get_of_eeprom_from_nvmem where eeprom was misspelled as
epprom.
Fixes: 5bef3a406c6e ("wifi: mt76: add support for providing eeprom in nvmem cells")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/wireless/mediatek/mt76/eeprom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index 2558788f7ffb..1de3c734e136 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -106,7 +106,7 @@ static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offs
#endif
}
-static int mt76_get_of_epprom_from_nvmem(struct mt76_dev *dev, void *eep, int len)
+static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int len)
{
struct device_node *np = dev->dev->of_node;
struct nvmem_cell *cell;
@@ -153,7 +153,7 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
if (!ret)
return 0;
- return mt76_get_of_epprom_from_nvmem(dev, eep, len);
+ return mt76_get_of_eeprom_from_nvmem(dev, eep, len);
}
EXPORT_SYMBOL_GPL(mt76_get_of_eeprom);
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next RFC PATCH 3/6] wifi: mt76: limit support of precal loading for mt7915 to MTD only
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 2/6] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Christian Marangi
@ 2023-10-17 19:05 ` Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 4/6] wifi: mt76: make mt76_get_of_eeprom static again Christian Marangi
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Christian Marangi @ 2023-10-17 19:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Kalle Valo, Matthias Brugger,
AngeloGioacchino Del Regno, Christian Marangi, Simon Horman,
Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Limit support for precal loading for mt7915 only to MTD. Passing data
from DT doesn't support offset and NVMEM require a different cell name
and doesn't support offset hence only MTD way is actually supported.
Rename mt76_get_of_eeprom_from_mtd to mt76_get_of_data_from_mtd as it is
now used for a more generic purpose and export it.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/wireless/mediatek/mt76/eeprom.c | 5 +++--
drivers/net/wireless/mediatek/mt76/mt76.h | 1 +
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index 1de3c734e136..817074a5d2fc 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -28,7 +28,7 @@ static int mt76_get_of_eeprom_data(struct mt76_dev *dev, void *eep, int len)
return 0;
}
-static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len)
+int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len)
{
#ifdef CONFIG_MTD
struct device_node *np = dev->dev->of_node;
@@ -105,6 +105,7 @@ static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offs
return -ENOENT;
#endif
}
+EXPORT_SYMBOL_GPL(mt76_get_of_data_from_mtd);
static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int len)
{
@@ -149,7 +150,7 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
if (!ret)
return 0;
- ret = mt76_get_of_epprom_from_mtd(dev, eep, offset, len);
+ ret = mt76_get_of_data_from_mtd(dev, eep, offset, len);
if (!ret)
return 0;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index e8757865a3d0..f6c850557447 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -1095,6 +1095,7 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str,
int mt76_eeprom_init(struct mt76_dev *dev, int len);
void mt76_eeprom_override(struct mt76_phy *phy);
+int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len);
int mt76_get_of_eeprom(struct mt76_dev *dev, void *data, int offset, int len);
struct mt76_queue *
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
index 76be7308460b..5228f710b3da 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
@@ -25,7 +25,7 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
offs = is_mt7915(&dev->mt76) ? MT_EE_PRECAL : MT_EE_PRECAL_V2;
- return mt76_get_of_eeprom(mdev, dev->cal, offs, val);
+ return mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val);
}
static int mt7915_check_eeprom(struct mt7915_dev *dev)
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next RFC PATCH 4/6] wifi: mt76: make mt76_get_of_eeprom static again
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 2/6] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 3/6] wifi: mt76: limit support of precal loading for mt7915 to MTD only Christian Marangi
@ 2023-10-17 19:05 ` Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 5/6] wifi: mt76: permit to use alternative cell name to eeprom NVMEM load Christian Marangi
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Christian Marangi @ 2023-10-17 19:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Kalle Valo, Matthias Brugger,
AngeloGioacchino Del Regno, Christian Marangi, Simon Horman,
Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Since mt76_get_of_eeprom is not used by mt7915 anymore, unexport it and
make it static again.
Also drop offset arg as it's only supported for MTD and was always set
to 0, hardcode the MTD functio instead.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/wireless/mediatek/mt76/eeprom.c | 7 +++----
drivers/net/wireless/mediatek/mt76/mt76.h | 1 -
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index 817074a5d2fc..748f4b643a5e 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -138,7 +138,7 @@ static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int le
return ret;
}
-int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
+static int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int len)
{
struct device_node *np = dev->dev->of_node;
int ret;
@@ -150,13 +150,12 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
if (!ret)
return 0;
- ret = mt76_get_of_data_from_mtd(dev, eep, offset, len);
+ ret = mt76_get_of_data_from_mtd(dev, eep, 0, len);
if (!ret)
return 0;
return mt76_get_of_eeprom_from_nvmem(dev, eep, len);
}
-EXPORT_SYMBOL_GPL(mt76_get_of_eeprom);
void
mt76_eeprom_override(struct mt76_phy *phy)
@@ -410,6 +409,6 @@ mt76_eeprom_init(struct mt76_dev *dev, int len)
if (!dev->eeprom.data)
return -ENOMEM;
- return !mt76_get_of_eeprom(dev, dev->eeprom.data, 0, len);
+ return !mt76_get_of_eeprom(dev, dev->eeprom.data, len);
}
EXPORT_SYMBOL_GPL(mt76_eeprom_init);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index f6c850557447..41e4f398083e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -1096,7 +1096,6 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str,
int mt76_eeprom_init(struct mt76_dev *dev, int len);
void mt76_eeprom_override(struct mt76_phy *phy);
int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len);
-int mt76_get_of_eeprom(struct mt76_dev *dev, void *data, int offset, int len);
struct mt76_queue *
mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next RFC PATCH 5/6] wifi: mt76: permit to use alternative cell name to eeprom NVMEM load
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
` (2 preceding siblings ...)
2023-10-17 19:05 ` [net-next RFC PATCH 4/6] wifi: mt76: make mt76_get_of_eeprom static again Christian Marangi
@ 2023-10-17 19:05 ` Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 6/6] wifi: mt76: permit to load precal from NVMEM cell for mt7915 Christian Marangi
2023-10-18 6:10 ` [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD " Kalle Valo
5 siblings, 0 replies; 7+ messages in thread
From: Christian Marangi @ 2023-10-17 19:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Kalle Valo, Matthias Brugger,
AngeloGioacchino Del Regno, Christian Marangi, Simon Horman,
Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Generilize mt76_get_of_eeprom_from_nvmem to use alternative cell name by
passing the cell name as an arg and expose it.
Rename it to mt76_get_of_data_from_nvmem to better reflect the now more
generic usage.
This is to permit driver to load additional cell, like precal cell.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/wireless/mediatek/mt76/eeprom.c | 8 +++++---
drivers/net/wireless/mediatek/mt76/mt76.h | 2 ++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index 748f4b643a5e..ac6c0a0e876f 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -107,7 +107,8 @@ int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int l
}
EXPORT_SYMBOL_GPL(mt76_get_of_data_from_mtd);
-static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int len)
+int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep,
+ const char *cell_name, int len)
{
struct device_node *np = dev->dev->of_node;
struct nvmem_cell *cell;
@@ -115,7 +116,7 @@ static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int le
size_t retlen;
int ret = 0;
- cell = of_nvmem_cell_get(np, "eeprom");
+ cell = of_nvmem_cell_get(np, cell_name);
if (IS_ERR(cell))
return PTR_ERR(cell);
@@ -137,6 +138,7 @@ static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int le
return ret;
}
+EXPORT_SYMBOL_GPL(mt76_get_of_data_from_nvmem);
static int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int len)
{
@@ -154,7 +156,7 @@ static int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int len)
if (!ret)
return 0;
- return mt76_get_of_eeprom_from_nvmem(dev, eep, len);
+ return mt76_get_of_data_from_nvmem(dev, eep, "eeprom", len);
}
void
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 41e4f398083e..c9934258c49d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -1096,6 +1096,8 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str,
int mt76_eeprom_init(struct mt76_dev *dev, int len);
void mt76_eeprom_override(struct mt76_phy *phy);
int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len);
+int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep,
+ const char *cell_name, int len);
struct mt76_queue *
mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next RFC PATCH 6/6] wifi: mt76: permit to load precal from NVMEM cell for mt7915
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
` (3 preceding siblings ...)
2023-10-17 19:05 ` [net-next RFC PATCH 5/6] wifi: mt76: permit to use alternative cell name to eeprom NVMEM load Christian Marangi
@ 2023-10-17 19:05 ` Christian Marangi
2023-10-18 6:10 ` [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD " Kalle Valo
5 siblings, 0 replies; 7+ messages in thread
From: Christian Marangi @ 2023-10-17 19:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Kalle Valo, Matthias Brugger,
AngeloGioacchino Del Regno, Christian Marangi, Simon Horman,
Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Permit to load precal from NVMEM cell for mt7915. The NVMEM cell must be
named "precal" to be correctly loaded.
NVMEM cell must already account the correct offset and be placed after
the EEPROM as the function expect the data right from the start.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
I would like to have some hint of the cell name... Is it ok to use
precal? Should we use "precal-eeprom"?
---
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
index 5228f710b3da..3bb2643d1b26 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
@@ -11,6 +11,7 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
u8 *eeprom = mdev->eeprom.data;
u32 val = eeprom[MT_EE_DO_PRE_CAL];
u32 offs;
+ int ret;
if (!dev->flash_mode)
return 0;
@@ -25,7 +26,11 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
offs = is_mt7915(&dev->mt76) ? MT_EE_PRECAL : MT_EE_PRECAL_V2;
- return mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val);
+ ret = mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val);
+ if (!ret)
+ return ret;
+
+ return mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", val);
}
static int mt7915_check_eeprom(struct mt7915_dev *dev)
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
` (4 preceding siblings ...)
2023-10-17 19:05 ` [net-next RFC PATCH 6/6] wifi: mt76: permit to load precal from NVMEM cell for mt7915 Christian Marangi
@ 2023-10-18 6:10 ` Kalle Valo
5 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2023-10-18 6:10 UTC (permalink / raw)
To: Christian Marangi
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
Simon Horman, Alexander Couzens, Nicolas Cavallari, Daniel Golle,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
stable
Christian Marangi <ansuelsmth@gmail.com> writes:
> Commit 495184ac91bb ("mt76: mt7915: add support for applying
> pre-calibration data") was fundamentally broken and never worked.
>
> The idea (before NVMEM support) was to expand the MTD function and pass
> an additional offset. For normal EEPROM load the offset would always be
> 0. For the purpose of precal loading, an offset was passed that was
> internally the size of EEPROM, since precal data is right after the
> EEPROM.
>
> Problem is that the offset value passed is never handled and is actually
> overwrite by
>
> offset = be32_to_cpup(list);
> ret = mtd_read(mtd, offset, len, &retlen, eep);
>
> resulting in the passed offset value always ingnored. (and even passing
> garbage data as precal as the start of the EEPROM is getting read)
>
> Fix this by adding to the current offset value, the offset from DT to
> correctly read the piece of data at the requested location.
>
> Cc: stable@vger.kernel.org
> Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
mt76 patches go to Felix's tree, not net-next.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-10-18 6:08 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 19:05 [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD for mt7915 Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 2/6] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 3/6] wifi: mt76: limit support of precal loading for mt7915 to MTD only Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 4/6] wifi: mt76: make mt76_get_of_eeprom static again Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 5/6] wifi: mt76: permit to use alternative cell name to eeprom NVMEM load Christian Marangi
2023-10-17 19:05 ` [net-next RFC PATCH 6/6] wifi: mt76: permit to load precal from NVMEM cell for mt7915 Christian Marangi
2023-10-18 6:10 ` [net-next RFC PATCH 1/6] wifi: mt76: fix broken precal loading from MTD " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).