<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/wireless/mediatek/mt76/eeprom.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-07-11T11:40:03Z</updated>
<entry>
<title>mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node()</title>
<updated>2022-07-11T11:40:03Z</updated>
<author>
<name>Liang He</name>
<email>windhl@126.com</email>
</author>
<published>2022-07-04T08:34:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3bd53ea02d77917c2314ec7be9e2d05be22f87d3'/>
<id>urn:sha1:3bd53ea02d77917c2314ec7be9e2d05be22f87d3</id>
<content type='text'>
We should use of_node_put() for the reference 'np' returned by
of_get_child_by_name() which will increase the refcount.

Fixes: 22b980badc0f ("mt76: add functions for parsing rate power limits from DT")
Signed-off-by: Liang He &lt;windhl@126.com&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: eeprom: tolerate corrected bit-flips</title>
<updated>2021-12-19T14:24:01Z</updated>
<author>
<name>Daniel Golle</name>
<email>daniel@makrotopia.org</email>
</author>
<published>2021-11-25T19:45:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5b595b66394096258d0ad555a41e52ea387aeb9e'/>
<id>urn:sha1:5b595b66394096258d0ad555a41e52ea387aeb9e</id>
<content type='text'>
mtd_read() returns -EUCLEAN in case of corrected bit-flips.
As data was read, don't error out in this case.

Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Acked-by: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: Print error message when reading EEPROM from mtd failed</title>
<updated>2021-10-23T11:23:45Z</updated>
<author>
<name>Hauke Mehrtens</name>
<email>hauke@hauke-m.de</email>
</author>
<published>2021-10-22T21:41:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2c4766fd5d3d390cbdd1f71eacee13a756d8ef0e'/>
<id>urn:sha1:2c4766fd5d3d390cbdd1f71eacee13a756d8ef0e</id>
<content type='text'>
When the EEPROM data is stored on a MTD partition print an error message
when reading this MTD partition failed. This is currently happening
often in OpenWrt because the initial data was written with using a flash
driver which ignores the error detection data and now OpenWrt uses a
driver which checks it.

With this patch a better error message is shown:
[    8.986988] mt7915e 0000:01:00.0: WA Firmware Version: DEV_000000, Build Time: 20201105222323
[    9.100508] mt7915e 0000:01:00.0: reading EEPROM from mtd factory failed: -117
[    9.144289] mt7915e: probe of 0000:01:00.0 failed with error -22

mt7915 does not work without an EEPROM, MT7922 still works.

Signed-off-by: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: support reading EEPROM data embedded in fdt</title>
<updated>2021-10-20T08:36:48Z</updated>
<author>
<name>Daniel Golle</name>
<email>daniel@makrotopia.org</email>
</author>
<published>2021-08-25T01:32:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=255d3807b60436c9699fc593b66b2dbb6203b2df'/>
<id>urn:sha1:255d3807b60436c9699fc593b66b2dbb6203b2df</id>
<content type='text'>
Some platforms boot from SD card and don't come with calibration data
stored anywhere on the board.
As EEPROM data is rather small it can be embedded into the device tree
to be loaded from there by the mt76.

Signed-off-by: Daniel Golle &lt;daniel@makrotopia.org&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: connac: set 6G phymode in single-sku support</title>
<updated>2021-10-20T08:36:45Z</updated>
<author>
<name>Lorenzo Bianconi</name>
<email>lorenzo@kernel.org</email>
</author>
<published>2021-08-24T10:22:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9b2ea8eee42a19bb8187a3a5c48496ad8b257026'/>
<id>urn:sha1:9b2ea8eee42a19bb8187a3a5c48496ad8b257026</id>
<content type='text'>
Configure tx rate power for 6GHz channels. This is a preliminary patch
to enable 6GHz band for mt7921 devices.

Tested-by: Deren Wu &lt;deren.wu@mediatek.com&gt;
Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: mt7915: add support for applying pre-calibration data</title>
<updated>2021-04-21T09:42:22Z</updated>
<author>
<name>Ryder Lee</name>
<email>ryder.lee@mediatek.com</email>
</author>
<published>2021-04-14T16:45:49Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=495184ac91bb866ad7d794ad6ceb064e191319d4'/>
<id>urn:sha1:495184ac91bb866ad7d794ad6ceb064e191319d4</id>
<content type='text'>
When the EEPROM data is read from flash, it can contain pre-calibration
data, which can save calibration time.

Note that group_cal can save 30% bootup calibration time, and dpd_cal can
save 75% channel switching time.

Tested-by: Bo Jiao &lt;bo.jiao@mediatek.com&gt;
Signed-off-by: Ryder Lee &lt;ryder.lee@mediatek.com&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: extend DT rate power limits to support 11ax devices</title>
<updated>2021-04-21T09:42:21Z</updated>
<author>
<name>Shayne Chen</name>
<email>shayne.chen@mediatek.com</email>
</author>
<published>2021-04-13T09:08:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a9627d992b5e3aa18315094b501eba0f4d883419'/>
<id>urn:sha1:a9627d992b5e3aa18315094b501eba0f4d883419</id>
<content type='text'>
Enable parsing per-rate txpower limits from DT for 11ax chipsets.

Co-developed-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Tested-by: Evelyn Tsai &lt;evelyn.tsai@mediatek.com&gt;
Signed-off-by: Shayne Chen &lt;shayne.chen@mediatek.com&gt;
Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mt76: add functions for parsing rate power limits from DT</title>
<updated>2021-04-21T09:42:21Z</updated>
<author>
<name>Felix Fietkau</name>
<email>nbd@nbd.name</email>
</author>
<published>2021-04-13T09:08:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=22b980badc0fc746431b81b9d402cf0612f59a7a'/>
<id>urn:sha1:22b980badc0fc746431b81b9d402cf0612f59a7a</id>
<content type='text'>
This subnode can be used to set per-rate tx power limits either per
country code / regdomain or globally.
These limits are typically provided by the device manufacturers and are
used to limit sideband emissions and stay within regulatory limits

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
Signed-off-by: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>of: net: pass the dst buffer to of_get_mac_address()</title>
<updated>2021-04-13T21:35:02Z</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-04-12T17:47:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=83216e3988cd196183542937c9bd58b279f946af'/>
<id>urn:sha1:83216e3988cd196183542937c9bd58b279f946af</id>
<content type='text'>
of_get_mac_address() returns a "const void*" pointer to a MAC address.
Lately, support to fetch the MAC address by an NVMEM provider was added.
But this will only work with platform devices. It will not work with
PCI devices (e.g. of an integrated root complex) and esp. not with DSA
ports.

There is an of_* variant of the nvmem binding which works without
devices. The returned data of a nvmem_cell_read() has to be freed after
use. On the other hand the return of_get_mac_address() points to some
static data without a lifetime. The trick for now, was to allocate a
device resource managed buffer which is then returned. This will only
work if we have an actual device.

Change it, so that the caller of of_get_mac_address() has to supply a
buffer where the MAC address is written to. Unfortunately, this will
touch all drivers which use the of_get_mac_address().

Usually the code looks like:

  const char *addr;
  addr = of_get_mac_address(np);
  if (!IS_ERR(addr))
    ether_addr_copy(ndev-&gt;dev_addr, addr);

This can then be simply rewritten as:

  of_get_mac_address(np, ndev-&gt;dev_addr);

Sometimes is_valid_ether_addr() is used to test the MAC address.
of_get_mac_address() already makes sure, it just returns a valid MAC
address. Thus we can just test its return code. But we have to be
careful if there are still other sources for the MAC address before the
of_get_mac_address(). In this case we have to keep the
is_valid_ether_addr() call.

The following coccinelle patch was used to convert common cases to the
new style. Afterwards, I've manually gone over the drivers and fixed the
return code variable: either used a new one or if one was already
available use that. Mansour Moufid, thanks for that coccinelle patch!

&lt;spml&gt;
@a@
identifier x;
expression y, z;
@@
- x = of_get_mac_address(y);
+ x = of_get_mac_address(y, z);
  &lt;...
- ether_addr_copy(z, x);
  ...&gt;

@@
identifier a.x;
@@
- if (&lt;+... x ...+&gt;) {}

@@
identifier a.x;
@@
  if (&lt;+... x ...+&gt;) {
      ...
  }
- else {}

@@
identifier a.x;
expression e;
@@
- if (&lt;+... x ...+&gt;@e)
-     {}
- else
+ if (!(e))
      {...}

@@
expression x, y, z;
@@
- x = of_get_mac_address(y, z);
+ of_get_mac_address(y, z);
  ... when != x
&lt;/spml&gt;

All drivers, except drivers/net/ethernet/aeroflex/greth.c, were
compile-time tested.

Suggested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>mt76: testmode: move mtd part to mt76_dev</title>
<updated>2021-01-26T19:07:47Z</updated>
<author>
<name>Shayne Chen</name>
<email>shayne.chen@mediatek.com</email>
</author>
<published>2020-12-04T09:36:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e7a6a044f9b9a3df3652aed8b91fa479ffad4475'/>
<id>urn:sha1:e7a6a044f9b9a3df3652aed8b91fa479ffad4475</id>
<content type='text'>
Move testmode mtd variables to mt76_dev, since they are the same on
each phy.

Signed-off-by: Shayne Chen &lt;shayne.chen@mediatek.com&gt;
Acked-by: Ryder Lee &lt;ryder.lee@mediatek.com&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
</feed>
