<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/dsa/qca/ar9331.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-07-20T22:52:55Z</updated>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2023-07-20T22:52:55Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2023-07-20T22:05:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=59be3baa8dff271d48500e009622318badfc7140'/>
<id>urn:sha1:59be3baa8dff271d48500e009622318badfc7140</id>
<content type='text'>
Cross-merge networking fixes after downstream PR.

No conflicts or adjacent changes.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: Use maple tree register cache</title>
<updated>2023-07-14T07:43:20Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-07-12T23:45:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=88085b3b83f55eab1be57f4eb0f69446717f23fb'/>
<id>urn:sha1:88085b3b83f55eab1be57f4eb0f69446717f23fb</id>
<content type='text'>
We now have a regmap cache which uses a maple tree to store the register
state, this is a more modern data structure and the regmap level code
using it makes a number of assumptions better tuned for modern hardware
than those made by the rbtree cache type that the at9331 driver uses.
Switch the ar9331 driver to use the more modern data structure.

This should have minimal practical impact, it's mainly code
modernisation.

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: Use explict flags for regmap single read/write</title>
<updated>2023-07-14T07:34:24Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2023-07-12T11:16:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9845217d60d01d151b45842ef2017a65e8f39f5a'/>
<id>urn:sha1:9845217d60d01d151b45842ef2017a65e8f39f5a</id>
<content type='text'>
The at9331 is only able to read or write a single register at once.  The
driver has a custom regmap bus and chooses to tell the regmap core about
this by reporting the maximum transfer sizes rather than the explicit
flags that exist at the regmap level.  Since there are a number of
problems with the raw transfer limits and the regmap level flags are
better integrated anyway convert the driver to use the flags.

No functional change.

Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: qca8k: remove unnecessary (void*) conversions</title>
<updated>2023-06-07T11:26:19Z</updated>
<author>
<name>Atin Bainada</name>
<email>hi@atinb.me</email>
</author>
<published>2023-06-06T12:23:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=92db9e2e0498b92d0a57cc48ea869ddabda934d9'/>
<id>urn:sha1:92db9e2e0498b92d0a57cc48ea869ddabda934d9</id>
<content type='text'>
Pointer variables of (void*) type do not require type cast.

Signed-off-by: Atin Bainada &lt;hi@atinb.me&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: remove unnecessary dev_set_drvdata()</title>
<updated>2022-09-23T02:30:38Z</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2022-09-21T14:05:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=14b29ece30e53f9b380f146d5f4f9062131b0d65'/>
<id>urn:sha1:14b29ece30e53f9b380f146d5f4f9062131b0d65</id>
<content type='text'>
Remove unnecessary dev_set_drvdata() in -&gt;remove(), the driver_data will
be set to NULL in device_unbind_cleanup() after calling -&gt;remove().

Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: add support for pause stats</title>
<updated>2022-06-30T03:17:12Z</updated>
<author>
<name>Oleksij Rempel</name>
<email>o.rempel@pengutronix.de</email>
</author>
<published>2022-06-28T08:51:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ea294f39b4382b7932285e52607bc668d83b31da'/>
<id>urn:sha1:ea294f39b4382b7932285e52607bc668d83b31da</id>
<content type='text'>
Add support for pause stats.

Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Reviewed-by: Vladimir Oltean &lt;olteanv@gmail.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: fix potential dead lock on mdio access</title>
<updated>2022-06-18T03:11:14Z</updated>
<author>
<name>Oleksij Rempel</name>
<email>o.rempel@pengutronix.de</email>
</author>
<published>2022-06-16T11:25:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7a49f2193063b7db60a964fc26774275a4c964cd'/>
<id>urn:sha1:7a49f2193063b7db60a964fc26774275a4c964cd</id>
<content type='text'>
Rework MDIO locking to avoid potential  circular locking:

 WARNING: possible circular locking dependency detected
 5.19.0-rc1-ar9331-00017-g3ab364c7c48c #5 Not tainted
 ------------------------------------------------------
 kworker/u2:4/68 is trying to acquire lock:
 81f3c83c (ar9331:1005:(&amp;ar9331_mdio_regmap_config)-&gt;lock){+.+.}-{4:4}, at: regmap_write+0x50/0x8c

 but task is already holding lock:
 81f60494 (&amp;bus-&gt;mdio_lock){+.+.}-{4:4}, at: mdiobus_read+0x40/0x78

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;bus-&gt;mdio_lock){+.+.}-{4:4}:
        lock_acquire+0x2d4/0x360
        __mutex_lock+0xf8/0x384
        mutex_lock_nested+0x2c/0x38
        mdiobus_write+0x44/0x80
        ar9331_sw_bus_write+0x50/0xe4
        _regmap_raw_write_impl+0x604/0x724
        _regmap_bus_raw_write+0x9c/0xb4
        _regmap_write+0xdc/0x1a0
        _regmap_update_bits+0xf4/0x118
        _regmap_select_page+0x108/0x138
        _regmap_raw_read+0x25c/0x288
        _regmap_bus_read+0x60/0x98
        _regmap_read+0xd4/0x1b0
        _regmap_update_bits+0xc4/0x118
        regmap_update_bits_base+0x64/0x8c
        ar9331_sw_irq_bus_sync_unlock+0x40/0x6c
        __irq_set_handler+0x7c/0xac
        ar9331_sw_irq_map+0x48/0x7c
        irq_domain_associate+0x174/0x208
        irq_create_mapping_affinity+0x1a8/0x230
        ar9331_sw_probe+0x22c/0x388
        mdio_probe+0x44/0x70
        really_probe+0x200/0x424
        __driver_probe_device+0x290/0x298
        driver_probe_device+0x54/0xe4
        __device_attach_driver+0xe4/0x130
        bus_for_each_drv+0xb4/0xd8
        __device_attach+0x104/0x1a4
        bus_probe_device+0x48/0xc4
        device_add+0x600/0x800
        mdio_device_register+0x68/0xa0
        of_mdiobus_register+0x2bc/0x3c4
        ag71xx_probe+0x6e4/0x984
        platform_probe+0x78/0xd0
        really_probe+0x200/0x424
        __driver_probe_device+0x290/0x298
        driver_probe_device+0x54/0xe4
        __driver_attach+0x17c/0x190
        bus_for_each_dev+0x8c/0xd0
        bus_add_driver+0x110/0x228
        driver_register+0xe4/0x12c
        do_one_initcall+0x104/0x2a0
        kernel_init_freeable+0x250/0x288
        kernel_init+0x34/0x130
        ret_from_kernel_thread+0x14/0x1c

 -&gt; #0 (ar9331:1005:(&amp;ar9331_mdio_regmap_config)-&gt;lock){+.+.}-{4:4}:
        check_noncircular+0x88/0xc0
        __lock_acquire+0x10bc/0x18bc
        lock_acquire+0x2d4/0x360
        __mutex_lock+0xf8/0x384
        mutex_lock_nested+0x2c/0x38
        regmap_write+0x50/0x8c
        ar9331_sw_mbus_read+0x74/0x1b8
        __mdiobus_read+0x90/0xec
        mdiobus_read+0x50/0x78
        get_phy_device+0xa0/0x18c
        fwnode_mdiobus_register_phy+0x120/0x1d4
        of_mdiobus_register+0x244/0x3c4
        devm_of_mdiobus_register+0xe8/0x100
        ar9331_sw_setup+0x16c/0x3a0
        dsa_register_switch+0x7dc/0xcc0
        ar9331_sw_probe+0x370/0x388
        mdio_probe+0x44/0x70
        really_probe+0x200/0x424
        __driver_probe_device+0x290/0x298
        driver_probe_device+0x54/0xe4
        __device_attach_driver+0xe4/0x130
        bus_for_each_drv+0xb4/0xd8
        __device_attach+0x104/0x1a4
        bus_probe_device+0x48/0xc4
        deferred_probe_work_func+0xf0/0x10c
        process_one_work+0x314/0x4d4
        worker_thread+0x2a4/0x354
        kthread+0x134/0x13c
        ret_from_kernel_thread+0x14/0x1c

 other info that might help us debug this:

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&amp;bus-&gt;mdio_lock);
                                lock(ar9331:1005:(&amp;ar9331_mdio_regmap_config)-&gt;lock);
                                lock(&amp;bus-&gt;mdio_lock);
   lock(ar9331:1005:(&amp;ar9331_mdio_regmap_config)-&gt;lock);

  *** DEADLOCK ***

 5 locks held by kworker/u2:4/68:
  #0: 81c04eb4 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1e4/0x4d4
  #1: 81f0de78 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x1e4/0x4d4
  #2: 81f0a880 (&amp;dev-&gt;mutex){....}-{4:4}, at: __device_attach+0x40/0x1a4
  #3: 80c8aee0 (dsa2_mutex){+.+.}-{4:4}, at: dsa_register_switch+0x5c/0xcc0
  #4: 81f60494 (&amp;bus-&gt;mdio_lock){+.+.}-{4:4}, at: mdiobus_read+0x40/0x78

 stack backtrace:
 CPU: 0 PID: 68 Comm: kworker/u2:4 Not tainted 5.19.0-rc1-ar9331-00017-g3ab364c7c48c #5
 Workqueue: events_unbound deferred_probe_work_func
 Stack : 00000056 800d4638 81f0d64c 00000004 00000018 00000000 80a20000 80a20000
         80937590 81ef3858 81f0d760 3913578a 00000005 8045e824 81f0d600 a8db84cc
         00000000 00000000 80937590 00000a44 00000000 00000002 00000001 ffffffff
         81f0d6a4 80982d7c 0000000f 20202020 80a20000 00000001 80937590 81ef3858
         81f0d760 3913578a 00000005 00000005 00000000 03bd0000 00000000 80e00000
         ...
 Call Trace:
 [&lt;80069db0&gt;] show_stack+0x94/0x130
 [&lt;8045e824&gt;] dump_stack_lvl+0x54/0x8c
 [&lt;800c7fac&gt;] check_noncircular+0x88/0xc0
 [&lt;800ca068&gt;] __lock_acquire+0x10bc/0x18bc
 [&lt;800cb478&gt;] lock_acquire+0x2d4/0x360
 [&lt;807b84c4&gt;] __mutex_lock+0xf8/0x384
 [&lt;807b877c&gt;] mutex_lock_nested+0x2c/0x38
 [&lt;804ea640&gt;] regmap_write+0x50/0x8c
 [&lt;80501e38&gt;] ar9331_sw_mbus_read+0x74/0x1b8
 [&lt;804fe9a0&gt;] __mdiobus_read+0x90/0xec
 [&lt;804feac4&gt;] mdiobus_read+0x50/0x78
 [&lt;804fcf74&gt;] get_phy_device+0xa0/0x18c
 [&lt;804ffeb4&gt;] fwnode_mdiobus_register_phy+0x120/0x1d4
 [&lt;805004f0&gt;] of_mdiobus_register+0x244/0x3c4
 [&lt;804f0c50&gt;] devm_of_mdiobus_register+0xe8/0x100
 [&lt;805017a0&gt;] ar9331_sw_setup+0x16c/0x3a0
 [&lt;807355c8&gt;] dsa_register_switch+0x7dc/0xcc0
 [&lt;80501468&gt;] ar9331_sw_probe+0x370/0x388
 [&lt;804ff0c0&gt;] mdio_probe+0x44/0x70
 [&lt;804d1848&gt;] really_probe+0x200/0x424
 [&lt;804d1cfc&gt;] __driver_probe_device+0x290/0x298
 [&lt;804d1d58&gt;] driver_probe_device+0x54/0xe4
 [&lt;804d2298&gt;] __device_attach_driver+0xe4/0x130
 [&lt;804cf048&gt;] bus_for_each_drv+0xb4/0xd8
 [&lt;804d200c&gt;] __device_attach+0x104/0x1a4
 [&lt;804d026c&gt;] bus_probe_device+0x48/0xc4
 [&lt;804d108c&gt;] deferred_probe_work_func+0xf0/0x10c
 [&lt;800a0ffc&gt;] process_one_work+0x314/0x4d4
 [&lt;800a17fc&gt;] worker_thread+0x2a4/0x354
 [&lt;800a9a54&gt;] kthread+0x134/0x13c
 [&lt;8006306c&gt;] ret_from_kernel_thread+0x14/0x1c
[

Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20220616112550.877118-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2022-02-11T01:29:56Z</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2022-02-11T01:29:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5b91c5cc0e7be4e41567cb2a6e21a8bb682c7cc5'/>
<id>urn:sha1:5b91c5cc0e7be4e41567cb2a6e21a8bb682c7cc5</id>
<content type='text'>
No conflicts.

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: register the mdiobus under devres</title>
<updated>2022-02-09T04:30:34Z</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2022-02-07T16:15:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=50facd86e9fbc4b93fe02e5fe05776047f45dbfb'/>
<id>urn:sha1:50facd86e9fbc4b93fe02e5fe05776047f45dbfb</id>
<content type='text'>
As explained in commits:
74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres")
5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres")

mdiobus_free() will panic when called from devm_mdiobus_free() &lt;-
devres_release_all() &lt;- __device_release_driver(), and that mdiobus was
not previously unregistered.

The ar9331 is an MDIO device, so the initial set of constraints that I
thought would cause this (I2C or SPI buses which call -&gt;remove on
-&gt;shutdown) do not apply. But there is one more which applies here.

If the DSA master itself is on a bus that calls -&gt;remove from -&gt;shutdown
(like dpaa2-eth, which is on the fsl-mc bus), there is a device link
between the switch and the DSA master, and device_links_unbind_consumers()
will unbind the ar9331 switch driver on shutdown.

So the same treatment must be applied to all DSA switch drivers, which
is: either use devres for both the mdiobus allocation and registration,
or don't use devres at all.

The ar9331 driver doesn't have a complex code structure for mdiobus
removal, so just replace of_mdiobus_register with the devres variant in
order to be all-devres and ensure that we don't free a still-registered
bus.

Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()")
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Tested-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: dsa: ar9331: convert to phylink_generic_validate()</title>
<updated>2022-02-03T11:47:06Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2022-02-02T10:24:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2a229ef44e738feb64a365affa6ece91646307eb'/>
<id>urn:sha1:2a229ef44e738feb64a365affa6ece91646307eb</id>
<content type='text'>
Populate the supported interfaces and MAC capabilities for the AR9331
DSA switch and remove the old validate implementation to allow DSA to
use phylink_generic_validate() for this switch driver.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
