<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/firewire/ohci.c, branch linux-6.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-04-03T13:11:37Z</updated>
<entry>
<title>firewire: ohci: prevent leak of left-over IRQ on unbind</title>
<updated>2024-04-03T13:11:37Z</updated>
<author>
<name>Edmund Raile</name>
</author>
<published>2024-02-29T14:47:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=318f6d53dd425c400e35f1a9b7af682c2c6a66d6'/>
<id>urn:sha1:318f6d53dd425c400e35f1a9b7af682c2c6a66d6</id>
<content type='text'>
commit 575801663c7dc38f826212b39e3b91a4a8661c33 upstream.

Commit 5a95f1ded28691e6 ("firewire: ohci: use devres for requested IRQ")
also removed the call to free_irq() in pci_remove(), leading to a
leftover irq of devm_request_irq() at pci_disable_msi() in pci_remove()
when unbinding the driver from the device

remove_proc_entry: removing non-empty directory 'irq/136', leaking at
least 'firewire_ohci'
Call Trace:
 ? remove_proc_entry+0x19c/0x1c0
 ? __warn+0x81/0x130
 ? remove_proc_entry+0x19c/0x1c0
 ? report_bug+0x171/0x1a0
 ? console_unlock+0x78/0x120
 ? handle_bug+0x3c/0x80
 ? exc_invalid_op+0x17/0x70
 ? asm_exc_invalid_op+0x1a/0x20
 ? remove_proc_entry+0x19c/0x1c0
 unregister_irq_proc+0xf4/0x120
 free_desc+0x3d/0xe0
 ? kfree+0x29f/0x2f0
 irq_free_descs+0x47/0x70
 msi_domain_free_locked.part.0+0x19d/0x1d0
 msi_domain_free_irqs_all_locked+0x81/0xc0
 pci_free_msi_irqs+0x12/0x40
 pci_disable_msi+0x4c/0x60
 pci_remove+0x9d/0xc0 [firewire_ohci
     01b483699bebf9cb07a3d69df0aa2bee71db1b26]
 pci_device_remove+0x37/0xa0
 device_release_driver_internal+0x19f/0x200
 unbind_store+0xa1/0xb0

remove irq with devm_free_irq() before pci_disable_msi()
also remove it in fail_msi: of pci_probe() as this would lead to
an identical leak

Cc: stable@vger.kernel.org
Fixes: 5a95f1ded28691e6 ("firewire: ohci: use devres for requested IRQ")
Signed-off-by: Edmund Raile &lt;edmund.raile@proton.me&gt;
Link: https://lore.kernel.org/r/20240229144723.13047-2-edmund.raile@proton.me
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards</title>
<updated>2024-01-05T12:28:08Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2024-01-02T11:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac9184fbb8478dab4a0724b279f94956b69be827'/>
<id>urn:sha1:ac9184fbb8478dab4a0724b279f94956b69be827</id>
<content type='text'>
VIA VT6306/6307/6308 provides PCI interface compliant to 1394 OHCI. When
the hardware is combined with Asmedia ASM1083/1085 PCIe-to-PCI bus bridge,
it appears that accesses to its 'Isochronous Cycle Timer' register (offset
0xf0 on PCI memory space) often causes unexpected system reboot in any
type of AMD Ryzen machine (both 0x17 and 0x19 families). It does not
appears in the other type of machine (AMD pre-Ryzen machine, Intel
machine, at least), or in the other OHCI 1394 hardware (e.g. Texas
Instruments).

The issue explicitly appears at a commit dcadfd7f7c74 ("firewire: core:
use union for callback of transaction completion") added to v6.5 kernel.
It changed 1394 OHCI driver to access to the register every time to
dispatch local asynchronous transaction. However, the issue exists in
older version of kernel as long as it runs in AMD Ryzen machine, since
the access to the register is required to maintain bus time. It is not
hard to imagine that users experience the unexpected system reboot when
generating bus reset by plugging any devices in, or reading the register
by time-aware application programs; e.g. audio sample processing.

This commit suppresses the unexpected system reboot in the combination of
hardware. It avoids the access itself. As a result, the software stack can
not provide the hardware time anymore to unit drivers, userspace
applications, and nodes in the same IEEE 1394 bus. It brings apparent
disadvantage since time-aware application programs require it, while
time-unaware applications are available again; e.g. sbp2.

Cc: stable@vger.kernel.org
Reported-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Closes: https://bugzilla.suse.com/show_bug.cgi?id=1215436
Reported-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217994
Reported-by: Tobias Gruetzmacher &lt;tobias-lists@23.gs&gt;
Closes: https://sourceforge.net/p/linux1394/mailman/message/58711901/
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2240973
Closes: https://bugs.launchpad.net/linux/+bug/2043905
Link: https://lore.kernel.org/r/20240102110150.244475-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: release buffer for AR req/resp contexts when managed resource is released</title>
<updated>2023-06-05T22:54:24Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5716e58aecdd4f7225c2e46ce903a839fc54f22f'/>
<id>urn:sha1:5716e58aecdd4f7225c2e46ce903a839fc54f22f</id>
<content type='text'>
The 1394 OHCI driver allocates several non-coherent DMA buffers for AR
request and response contexts. The buffers are mapped to kernel virtual
address (VMA) so that the first page locates after the last page. Even
when large payload of packet is handled crossing the boundary of buffers,
the driver operates continuously on VMA.

No kernel API is provided for this kind of mapping, while it is possible
to release the buffer when PCI device is going to be released.

This commit moves the call of release helper function to the callback
function of release resources.

Link: https://lore.kernel.org/r/20230604054451.161076-10-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for content of configuration ROM</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aeaf6aa8647182892f6bd63c5ae9faf4e73cbad0'/>
<id>urn:sha1:aeaf6aa8647182892f6bd63c5ae9faf4e73cbad0</id>
<content type='text'>
The 1394 OHCI driver allocates DMA coherent buffer to transfer content
of configuration ROM.

This commit utilizes managed device resource to maintain the lifetime of
buffer.

Link: https://lore.kernel.org/r/20230604054451.161076-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for IT, IR, AT/receive, and AT/request contexts</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa71e28d757244166c9ff50e4bc85cd83f2956fe'/>
<id>urn:sha1:aa71e28d757244166c9ff50e4bc85cd83f2956fe</id>
<content type='text'>
The 1394 OHCI driver allocates DMA coherent buffer for descriptors of IT,
IR, AT receive, and AT request contexts by the same way.

This commit utilizes managed device resource to maintain the lifetime of
buffers.

Link: https://lore.kernel.org/r/20230604054451.161076-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for list of isochronous contexts</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30d97fd7e30b6ba8ecef15c43797f90dad56ddab'/>
<id>urn:sha1:30d97fd7e30b6ba8ecef15c43797f90dad56ddab</id>
<content type='text'>
The 1394 OHCI driver allocates the list of isochronous contexts as much
as the hardware supports.

This commit utilizes managed device resource to maintain the lifetime of
list.

Link: https://lore.kernel.org/r/20230604054451.161076-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for requested IRQ</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a95f1ded28691e69f7d6718c5dcbc149613d431'/>
<id>urn:sha1:5a95f1ded28691e69f7d6718c5dcbc149613d431</id>
<content type='text'>
The 1394 OHCI controller register handler to single interrupt number.

This commit uses managed device resource to maintain the lifetime of
requested IRQ.

Link: https://lore.kernel.org/r/20230604054451.161076-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for misc DMA buffer</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8320442b264a8d49b08f2730d63a39b2e0c146f8'/>
<id>urn:sha1:8320442b264a8d49b08f2730d63a39b2e0c146f8</id>
<content type='text'>
The 1394 OHCI driver allocates a DMA coherent buffer for multi-purposes.
The buffer is split into three region for specific purposes; i.e. 1/4 for
context descriptors of AR request and response as well as 1/2 for self
ID handling.

This commit uses managed device resource to maintain the lifetime of
buffer.

Link: https://lore.kernel.org/r/20230604054451.161076-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for MMIO region mapping</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=086a0afbe9bbcdf7e12cdc7e317a57f49fa35207'/>
<id>urn:sha1:086a0afbe9bbcdf7e12cdc7e317a57f49fa35207</id>
<content type='text'>
The PCI framework has the convenient helper function to check and map MMIO
region with managed device resource.

This commit elaborates 1394 OHCI driver to use the function.

Link: https://lore.kernel.org/r/20230604054451.161076-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
<entry>
<title>firewire: ohci: use devres for PCI-related resources</title>
<updated>2023-06-05T22:54:23Z</updated>
<author>
<name>Takashi Sakamoto</name>
</author>
<published>2023-06-04T05:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14f6ca5b6ae759046fdc461633043bb05ff6de58'/>
<id>urn:sha1:14f6ca5b6ae759046fdc461633043bb05ff6de58</id>
<content type='text'>
The PCI framework supports managed device resource to maintain the
lifetime of PCI specific resources.

This commit allows 1394 OHCI driver to utilize it.

Link: https://lore.kernel.org/r/20230604054451.161076-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
</content>
</entry>
</feed>
