- 08 Sep, 2024 1 commit
-
-
Takashi Sakamoto authored
In packet-per-buffer mode for isochronous context of 1394 OHCI, software can schedule hardIRQ to the buffer in which the content of isochronous packet is processed. The actual behaviour is different between isochronous receive (IR) and transmit (IT) contexts in respect to isochronous cycle in which the hardIRQ occurs. In IR context, the hardIRQ occurs when the buffer is filled actually by the content of received packet. If there are any isochronous cycles in which the packet transmission is skipped, it is postponed to generate the hardIRQ in respect to the isochronous cycle. In IT context, software can schedule the content of packet every isochronous cycle including skipping, therefore the hardIRQ occurs in the isochronous cycle to which the software scheduled. ALSA firewire stack uses the packet-per-buffer mode for both IR/IT contexts. To process time stamp per packet (or per sample in some cases) steadily for media clock recovery against unexpected transmission skips, it uses an IT context to operate all of isochronous contexts by calls of fw_iso_context_flush_completions() in the bottom-half of hardIRQ for the IT context. Although it looks well to handle all of isochronous contexts in a single bottom-half context, it relatively takes longer time. In the future code integration (not yet), it is possible to apply parallelism method to process these context. In the case, it is useful to allow unit drivers to schedule work items to process these isochronous contexts. As a preparation, this commit exposes fw_iso_context_schedule_flush_completions() as a kernel API available by unit drivers. It is renamed from fw_iso_context_queue_work() since it is a counter part of fw_iso_context_flush_completions(). Link: https://lore.kernel.org/r/20240908040549.75304-2-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 05 Sep, 2024 1 commit
-
-
Takashi Sakamoto authored
It is enough to notify programming mistakes to programmers just once. Suggested-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240905131029.6433-1-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 04 Sep, 2024 5 commits
-
-
Takashi Sakamoto authored
In the former commits, the callback of isochronous context runs on usual work process. In the case, ALSA PCM device has a flag, nonatomic, to acquire mutex lock instead of spin lock for PCM substream group. This commit uses the flag. It has an advantage in the case that ALSA PCM application uses the large size of intermediate buffer, since it takes too long time even in tasklet softIRQ to process many of isochronous packets, then result in the delay of system event due to disabled IRQ so long. It is avertible to switch to nonatomic operation. Reviewed-by: Takashi Iwai <tiwai@suse.de> Tested-by: Edmund Raile <edmund.raile@protonmail.com> Link: https://lore.kernel.org/r/20240904125155.461886-6-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
In the former commits, the callback of isochronous context runs on work process, thus no need to use atomic memory allocation. This commit replaces GFP_ATOMIC with GCP_KERNEL in the callback for user client. Tested-by: Edmund Raile <edmund.raile@protonmail.com> Link: https://lore.kernel.org/r/20240904125155.461886-5-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
This commit queues work item for IT/IR events at hardIRQ handler to operate the corresponding isochronous context. The work item is queued to any of worker-pools. The callback for either the implementation of unit protocol and user space clients is executed in sleepable work process context. The change could results in any errors of concurrent processing as well as sleep at atomic context. These errors are fixed by the following commits. Tested-by: Edmund Raile <edmund.raile@protonmail.com> Link: https://lore.kernel.org/r/20240904125155.461886-4-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
In the previous commit, the workqueue is added per the instance of fw_card structure for isochronous contexts. The workqueue is designed to be used by the implementation of fw_card_driver structure underlying the fw_card. This commit adds some local APIs to be used by the implementation. Tested-by: Edmund Raile <edmund.raile@protonmail.com> Link: https://lore.kernel.org/r/20240904125155.461886-3-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
This commit adds a workqueue dedicated for isochronous context processing. The workqueue is allocated per instance of fw_card structure to satisfy the following characteristics descending from 1394 OHCI specification: In 1394 OHCI specification, memory pages are reserved to each isochronous context dedicated to DMA transmission. It allows to operate these per-context pages concurrently. Software can schedule hardware interrupt for several isochronous context to the same cycle, thus WQ_UNBOUND is specified. Additionally, it is sleepable to operate the content of pages, thus WQ_BH is not used. The isochronous context delivers the packets with time stamp, thus WQ_HIGHPRI is specified for semi real-time data such as IEC 61883-1/6 protocol implemented by ALSA firewire stack. The isochronous context is not used by the implementation of SCSI over IEEE1394 protocol (sbp2), thus WQ_MEM_RECLAIM is not specified. It is useful for users to adjust cpu affinity of the workqueue depending on their work loads, thus WQ_SYS is specified to expose the attributes to user space. Tested-by: Edmund Raile <edmund.raile@protonmail.com> Link: https://lore.kernel.org/r/20240904125155.461886-2-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 03 Sep, 2024 2 commits
-
-
Takashi Sakamoto authored
A commit 77006a0a ("ratelimit: add comment warning people off printk_ratelimit()") has already deprecated printk_ratelimit(). This commit uses alternative functions to obsolete its usage. Link: https://lore.kernel.org/r/20240903101523.317110-1-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
Many tracepoints events have been added to 6.10 and 6.11 kernels. They are available as an alternative of debug parameter in firewire-ohci module. The logging messages enabled by the parameter require some cumbersomes in a point of maintenance; e.g. the code to decode transaction frame. This commit adds deprecation text to conduct users to them.. Link: https://lore.kernel.org/r/20240903101455.317067-1-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 20 Aug, 2024 1 commit
-
-
Takashi Sakamoto authored
When detecting updates of bus topology, the data of fw_device is newly allocated and caches the content of configuration ROM from the corresponding node. Then, the tree of device is sought to find the previous data of fw_device corresponding to the node. If found, the previous data is updated and reused and the data of fw_device newly allocated is going to be released. The above procedure is done in the call of device_find_child(), however it is a bit abusing against the intention of the helper function, since it is preferable to find only without updating. This commit splits the update outside of the call. Cc: Zijun Hu <zijun_hu@icloud.com> Link: https://lore.kernel.org/r/20240820132132.28839-1-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 17 Aug, 2024 1 commit
-
-
Takashi Sakamoto authored
A commit 404957c1e207 ("firewire: ohci: use guard macro to serialize accesses to phy registers") refactored initiated_reset() helper function, while the error path was changed wrongly. This commit fixes the bug. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Fixes: 80f3401dfeb2 ("firewire: ohci: use guard macro to serialize accesses to phy registers") Link: https://lore.kernel.org/r/20240817091128.180303-1-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 14 Aug, 2024 3 commits
-
-
Takashi Sakamoto authored
The size of space for configuration ROM is defined by IEEE 1212. The start and end offsets are available as some macros in UAPI header. This commit uses these macros to compute the size. Link: https://lore.kernel.org/r/20240814131222.69949-4-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The ohci_info() macro is a thin wrapper of dev_info(), while it is never used. Link: https://lore.kernel.org/r/20240814131222.69949-3-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The __aligned() macro has been available since v4.19 kernel by a commit 815f0ddb ("include/linux/compiler*.h: make compiler-*.h mutually exclusive"). This commit replaces with the macro. Link: https://lore.kernel.org/r/20240814131222.69949-2-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 12 Aug, 2024 7 commits
-
-
Takashi Sakamoto authored
In core function, the instances of some client resource structures are maintained by IDR. As of kernel v6.0, IDR has been superseded by XArray and deprecated. This commit replaces the usage of IDR with XArray to maintain the resource instances. The instance of XArray is allocated per client with XA_FLAGS_ALLOC1 so that the index of allocated entry is greater than zero and returns to user space client as handle of the resource. Link: https://lore.kernel.org/r/20240812235210.28458-6-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
firewire: core: code refactoring to use idr_for_each_entry() macro instead of idr_for_each() function This commit is a preparation to use xa_for_each() macro. Current implementation uses idr_for_each() function and has a disadvantage to replace with the macro. The IDR framework has idr_for_each_entry() macro for the similar purpose. This commit replace the function with the macro with minor code refactoring. Link: https://lore.kernel.org/r/20240812235210.28458-5-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
It depends on the function assigned to release member to identify resource structure. This commit adds a helper function to identify iso_resource structure. Link: https://lore.kernel.org/r/20240812235210.28458-4-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
All of local resource structure commonly have data of client_resource type in its first member. This design sometimes requires usage of container_of to retrieve parent structure by the first member. This commit adds some helper functions for this purpose. Link: https://lore.kernel.org/r/20240812235210.28458-3-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
Current implementation checks and validates the result to find resource entry two times. It is redundant. This commit refactors the redundancy. Link: https://lore.kernel.org/r/20240812235210.28458-2-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The data of XArray structure includes spinlock and requires no external lock, while the data is still under the critical section by fw_device_rwsem. This commit deletes the critical section. Link: https://lore.kernel.org/r/20240812014251.165492-3-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
In core function, the instances of fw_device corresponding to firewire device node in system are maintained by IDR. As of kernel v6.0, IDR has been superseded by XArray and deprecated. This commit replaces the usage of IDR with XArray to maintain the device instances. The instance of XArray is allocated statically, and initialized with XA_FLAGS_ALLOC so that the index of allocated entry starts with zero and available as the minor identifier of device node. Link: https://lore.kernel.org/r/20240812014251.165492-2-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 10 Aug, 2024 1 commit
-
-
Takashi Sakamoto authored
A commit d8527cab ("firewire: cdev: implement new event to notify response subaction with time stamp") adds an additional case, FW_CDEV_EVENT_RESPONSE2, into switch statement in complete_transaction(). However, the range of block is beyond to the case label and reaches neibour default label. This commit corrects the range of block. Fortunately, it has few impacts in practice since the local variable in the scope under the label is not used in codes under default label. Fixes: d8527cab ("firewire: cdev: implement new event to notify response subaction with time stamp") Link: https://lore.kernel.org/r/20240810070403.36801-1-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 05 Aug, 2024 17 commits
-
-
Takashi Sakamoto authored
The 1394 OHCI driver uses spinlock to serialize operations for isochronous contexts. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-18-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The 1394 OHCI driver uses spinlock for the process to update local configuration ROM. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-17-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The 1394 OHCI driver maintains bus time to respond to querying request. The concurrent access to the bus time is protected by spinlock. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-16-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core functions uses spinlock in instance of fw_card structure to protect concurrent access to properties in the instance. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-15-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains pending asynchronous transactions by list in the instance of fw_card. The concurrent access to the list is protected by spinlock in the instance. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-14-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains clients to receive phy configuration packets by list in the instance of fw_card. The concurrent access to the list is protected by spinlock in the instance. This commit uses guard macro to maintain the list. Link: https://lore.kernel.org/r/20240805085408.251763-13-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function allows one isochronous contexts per userspace client. The concurrent access to the context is protected by spinlock in the instance of client. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-12-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function provides UAPI to maintain isochronous resources allocated by userspace clients across bus resets automatically. The resources are maintained by IDR and the concurrent access to it is protected by spinlock in the instance of client. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-11-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains events to userspace by list in the instance of client. The concurrent access to the list is protected by spinlock in the instance. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-10-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function provides an operation for userspace application to retrieve current value of CYCLE_TIMER register with several types of system time. In the operation, local interrupt is disables so that the access of the register and ktime are done atomically. This commit uses guard macro to disable/enable local interrupts. Link: https://lore.kernel.org/r/20240805085408.251763-9-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains address handlers by list. It is protected by spinlock to insert and remove entry to the list. This commit uses guard macro to maintain the spinlock. Link: https://lore.kernel.org/r/20240805085408.251763-8-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains the instance of fw_device structure by IDR. The concurrent access to IDR is protected by static read/write semaphore. The semaphore is also utilized to protect concurrent access to the content of configuration ROM cached to the instance so that the cache is swapped to the latest one. This commit uses guard macro to maintain the mutex. Link: https://lore.kernel.org/r/20240805085408.251763-7-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains address handlers by list. RCU is utilized for efficient read access to any entries in the list. This commit uses guard macro to maintain RCU locking and releasing. Link: https://lore.kernel.org/r/20240805085408.251763-6-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The 1394 OHCI driver protects concurrent accesses to phy registers by mutex object in fw_ohci structure. This commit uses guard macro to maintain the mutex. Link: https://lore.kernel.org/r/20240805085408.251763-5-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains userspace clients by the list in fw_device object associated to the operated character device. The concurrent access to the list is protected by mutex in the object. This commit uses guard macro to maintain the mutex. Link: https://lore.kernel.org/r/20240805085408.251763-4-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function maintains registered cards by list. The concurrent access to the list is protected by static mutex. This commit uses guard macro to maintain the mutex. Link: https://lore.kernel.org/r/20240805085408.251763-3-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
Takashi Sakamoto authored
The core function provide a kernel API to send phy configuration packet. Current implementation of the feature uses packet object allocated statically. The concurrent access to the object is protected by static mutex. This commit uses guard macro to maintain the mutex. Link: https://lore.kernel.org/r/20240805085408.251763-2-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- 02 Aug, 2024 1 commit
-
-
Takashi Sakamoto authored
THis commit replaces current implementation with the helper functions added in the former commit. Link: https://lore.kernel.org/r/20240802003606.109402-5-o-takashi@sakamocchi.jpSigned-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-