<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/staging/mt7621-pci, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/staging/mt7621-pci?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/staging/mt7621-pci?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-10-21T15:59:18Z</updated>
<entry>
<title>PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver</title>
<updated>2021-10-21T15:59:18Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-09-22T05:00:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2bdd5238e756aac3ecbffc7c22b884485e84062e'/>
<id>urn:sha1:2bdd5238e756aac3ecbffc7c22b884485e84062e</id>
<content type='text'>
Add driver for the PCIe controller of the MT7621 SoC.

[bhelgaas: rename from pci-mt7621.c to pcie-mt7621.c; also rename Kconfig
symbol from PCI_MT7621 to PCIE_MT7621]
Link: https://lore.kernel.org/r/20210922050035.18162-3-sergio.paracuellos@gmail.com
Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: fix hang when nothing is connected to pcie ports</title>
<updated>2021-08-26T10:06:37Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-08-23T17:08:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7d761b084b3c785e1fbbe707fbdf7baba905c6ad'/>
<id>urn:sha1:7d761b084b3c785e1fbbe707fbdf7baba905c6ad</id>
<content type='text'>
When nothing is connected to pcie ports, each port is set to reset state.
When this occurs, next access result in a hang on boot as follows:

mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST &amp; CLK)
mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST &amp; CLK)
mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST &amp; CLK)
[ HANGS HERE ]

Fix this just detecting 'nothing is connected state' to avoid next accesses
to pcie port related configuration registers.

Fixes: b99cc3a2b6b6 ("staging: mt7621-pci: avoid custom 'map_irq' function")
Cc: stable &lt;stable@vger.kernel.org&gt;
Reported-by: DENG Qingfang &lt;dqfext@gmail.com&gt;
Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210823170803.2108-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: avoid to re-disable clock for those pcies not in use</title>
<updated>2021-07-27T13:48:43Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-07-27T05:40:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c7b65650c7f41d3946c4e2f0bb56dfdb92cfe127'/>
<id>urn:sha1:c7b65650c7f41d3946c4e2f0bb56dfdb92cfe127</id>
<content type='text'>
Clock driver for this SoC is using some gates to properly enabling
and disabling the access to peripherals. Those gates that are not
in use are properly being automatically disabled by the kernel.
Pcie driver is explicitly doing a 'clk_disable_unprepare' call for
gates of those pcies that are not used. Since kernel has already
disabled them, the following warnings appear:

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:952 clk_core_disable+0xe4/0x100
pcie2 already disabled
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.14.0 #0
Stack : 81661680 80082d00 807c0000 00000004 00000000
        80a20000 80860000 80792380
        814503d4 80862e83 00000000 1431b70 81454360
        00000000 00000000 80792380
        81431a08 ffffefff fffffea 00000000 81431a14
        0000007b 80868820 ffffffff
        80792380 1431c70 803d7a24 00000009 807f3a74
        00000001 815df810 00000018 0000000 80a20000
...
Call Trace:
[&lt;80007ed8&gt;] show_stack+0x28/0xf0
[&lt;80381e40&gt;] dump_stack_lvl+0x60/0x80
[&lt;8002cf90&gt;] __warn+0xcc/0x140
[&lt;8002d090&gt;] warn_slowpath_fmt+0x8c/0xac
[&lt;803d7a24&gt;] clk_core_disable+0xe4/0x100
[&lt;803da468&gt;] clk_disable+0x38/0x58
[&lt;804cb730&gt;] mt7621_pci_probe+0x980/0xa50
[&lt;8041e624&gt;] platform_probe+0x50/0xbc
[&lt;8041bfe4&gt;] really_probe.part.0+0xa8/0x340
[&lt;8041c3dc&gt;] driver_probe_device+0x4c/0x154
[&lt;8041cb88&gt;] __driver_attach+0xb4/0x1b4
[&lt;80419a38&gt;] bus_for_each_dev+0x68/0xa4
[&lt;8041b1e8&gt;] bus_add_driver+0x134/0x214
[&lt;8041d3bc&gt;] driver_register+0x98/0x154
[&lt;80001648&gt;] do_one_initcall+0x50/0x1a8
[&lt;808ea1fc&gt;] kernel_init_freeable+0x270/0x30c
[&lt;806dd9dc&gt;] kernel_init+0x20/0x110
[&lt;80002d98&gt;] ret_from_kernel_thread+0x14/0x1c

WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:810 clk_core_unprepare+0xf4/0x194
pcie2 already unprepared
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W 5.14.0 #0
Stack : 81661680 80082d00 807c0000 00000004 00000000
        00000000 81431bc4 80a20000
        80860000 80792380 814503d4 80862e83 00000000
        00000001 81431b70 81454360
        00000000 00000000 80792380 81431a08 ffffefff
        00000000 ffffffea 00000000
        81431a14 0000009b 80868820 ffffffff 80792380
        00000001 81431c70 803d7764
        00000009 807f3a74 00000001 815df810 00000018
        8040b36c 00000000 80a20000
...
Call Trace:
[&lt;80007ed8&gt;] show_stack+0x28/0xf0
[&lt;80381e40&gt;] dump_stack_lvl+0x60/0x80
[&lt;8002cf90&gt;] __warn+0xcc/0x140
[&lt;8002d090&gt;] warn_slowpath_fmt+0x8c/0xac
[&lt;803d7764&gt;] clk_core_unprepare+0xf4/0x194
[&lt;803d97c4&gt;] clk_unprepare+0x30/0x48
[&lt;804cb738&gt;] mt7621_pci_probe+0x988/0xa50
[&lt;8041e624&gt;] platform_probe+0x50/0xbc
[&lt;8041bfe4&gt;] really_probe.part.0+0xa8/0x340
[&lt;8041c3dc&gt;] driver_probe_device+0x4c/0x154
[&lt;8041cb88&gt;] __driver_attach+0xb4/0x1b4
[&lt;80419a38&gt;] bus_for_each_dev+0x68/0xa4
[&lt;8041b1e8&gt;] bus_add_driver+0x134/0x214
[&lt;8041d3bc&gt;] driver_register+0x98/0x154
[&lt;80001648&gt;] do_one_initcall+0x50/0x1a8
[&lt;808ea1fc&gt;] kernel_init_freeable+0x270/0x30c
[&lt;806dd9dc&gt;] kernel_init+0x20/0x110
[&lt;80002d98&gt;] ret_from_kernel_thread+0x14/0x1c

Avoid to explicitly disable already disabled pcie gates
fixes the problem.

Fixes: cc4e864a5ce4 ("staging: mt7621-pci: make use of kernel clock apis")
Reported-by: DENG Qingfang &lt;dqfext@gmail.com&gt;
Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210727054058.10612-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: remove 'mt7621_pci_parse_request_of_pci_ranges'</title>
<updated>2021-06-15T13:24:29Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-06-14T10:06:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b15606e63ea90ced5044bd2007fd7b54298ce293'/>
<id>urn:sha1:b15606e63ea90ced5044bd2007fd7b54298ce293</id>
<content type='text'>
After 'PCI_IOBASE' is defined for ralink, ranges are properly parsed
using pci generic APIS and there is no need to parse anything
manually. So function 'mt7621_pci_parse_request_of_pci_ranges'
used for this can be enterely removed. Since we have to configure
iocu memory regions and pci io windows resources must be retrieved
accordly from 'bridge-&gt;windows' but there is no need to store
anything as driver private data.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210614100617.28753-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: make use of 'pcie_port_write'</title>
<updated>2021-06-09T12:19:22Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-06-07T12:01:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=25203e32ce3ef9bfa363cfed7813c4fd7270ce45'/>
<id>urn:sha1:25203e32ce3ef9bfa363cfed7813c4fd7270ce45</id>
<content type='text'>
Function 'mt7621_pcie_enable_port' is calculating an offset
to write some port related registers. Instead of doing that
just make use of already existent 'pcie_write_port' function
and use virtualy mapped base address with registers. This
increase readability and allow us to remove also two defitions
not used else where.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210607120153.24989-7-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: parse some dt properties from root port child nodes</title>
<updated>2021-06-09T12:19:22Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-06-07T12:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2d3d288f0eaf102c3739ad811fa9727c742a49e0'/>
<id>urn:sha1:2d3d288f0eaf102c3739ad811fa9727c742a49e0</id>
<content type='text'>
Properties 'clocks', 'resets' and 'phys' have been moved from parent
node to the root port children. Hence we have to adapt the way device
tree is parsed in driver code to properly align things and make all
the stuff work.
Note that we moved from using 'devm_reset_control_get_exclusive() to
'of_reset_control_get_exclusive()' so we need to properly call the
'reset_control_put()' function manually in error and remove paths.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210607120153.24989-6-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: use {readl|writel}_relaxed instead of readl/writel</title>
<updated>2021-06-09T12:19:21Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-06-07T12:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=860bce4565b665adb889e61fb6d8227d99753a00'/>
<id>urn:sha1:860bce4565b665adb889e61fb6d8227d99753a00</id>
<content type='text'>
The driver does not perform DMA, so it's safe to use the relaxed version
for both readl and writel operations.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210607120153.24989-4-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: remove 'RALINK_PCI_BAR0SETUP_ADDR' definition</title>
<updated>2021-06-09T12:19:21Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-06-07T12:01:49Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=aa6c32f9fe0de12f685d441faf9a73dd277af209'/>
<id>urn:sha1:aa6c32f9fe0de12f685d441faf9a73dd277af209</id>
<content type='text'>
Instead of define RALINK_PCI_BAR0SETUP_ADDR just use standard
pci defnition for this which is 'PCI_BASE_ADDRESS_0'.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210607120153.24989-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: make cleaner 'mt7621_pcie_enable_ports'</title>
<updated>2021-06-09T12:19:21Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-06-07T12:01:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a3bb1d050e436e5ad301491315ea42c9ac0821c5'/>
<id>urn:sha1:a3bb1d050e436e5ad301491315ea42c9ac0821c5</id>
<content type='text'>
Function 'mt7621_pcie_enable_ports' call 'mt7621_pcie_enable_port'
for each available pcie port. Instead of having two for loops
there just move needed initialization. There is one setting
that can be removed which is the set for 'PCI_COMMAND_MASTER'
bit. Pci drivers are in charge of set that bit if is really
needed and should be not a mission of the controller to do that.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210607120153.24989-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: mt7621-pci: remove two blank lines</title>
<updated>2021-05-10T09:19:40Z</updated>
<author>
<name>Sergio Paracuellos</name>
<email>sergio.paracuellos@gmail.com</email>
</author>
<published>2021-05-05T12:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7fa708e061b72a2d50b1d7075d9b4759490a3e47'/>
<id>urn:sha1:7fa708e061b72a2d50b1d7075d9b4759490a3e47</id>
<content type='text'>
There are useless two blank lines in code that can
be removed. Hence, remove them.

Signed-off-by: Sergio Paracuellos &lt;sergio.paracuellos@gmail.com&gt;
Link: https://lore.kernel.org/r/20210505121736.6459-9-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
