linux1394-devel Mailing List for IEEE 1394 for Linux (Page 2)
Brought to you by:
aeb,
bencollins
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
(39) |
Apr
(154) |
May
(172) |
Jun
(237) |
Jul
(127) |
Aug
(135) |
Sep
(193) |
Oct
(175) |
Nov
(173) |
Dec
(148) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(161) |
Feb
(225) |
Mar
(193) |
Apr
(158) |
May
(179) |
Jun
(292) |
Jul
(146) |
Aug
(134) |
Sep
(185) |
Oct
(190) |
Nov
(149) |
Dec
(161) |
2002 |
Jan
(186) |
Feb
(236) |
Mar
(254) |
Apr
(207) |
May
(189) |
Jun
(182) |
Jul
(202) |
Aug
(155) |
Sep
(149) |
Oct
(449) |
Nov
(191) |
Dec
(108) |
2003 |
Jan
(174) |
Feb
(242) |
Mar
(243) |
Apr
(255) |
May
(202) |
Jun
(290) |
Jul
(237) |
Aug
(178) |
Sep
(101) |
Oct
(153) |
Nov
(144) |
Dec
(95) |
2004 |
Jan
(162) |
Feb
(278) |
Mar
(282) |
Apr
(152) |
May
(127) |
Jun
(138) |
Jul
(94) |
Aug
(63) |
Sep
(64) |
Oct
(150) |
Nov
(102) |
Dec
(197) |
2005 |
Jan
(102) |
Feb
(172) |
Mar
(89) |
Apr
(158) |
May
(139) |
Jun
(160) |
Jul
(288) |
Aug
(89) |
Sep
(201) |
Oct
(92) |
Nov
(190) |
Dec
(139) |
2006 |
Jan
(121) |
Feb
(204) |
Mar
(133) |
Apr
(134) |
May
(91) |
Jun
(226) |
Jul
(122) |
Aug
(101) |
Sep
(144) |
Oct
(141) |
Nov
|
Dec
|
2023 |
Jan
(19) |
Feb
(1) |
Mar
(5) |
Apr
(5) |
May
(33) |
Jun
(17) |
Jul
|
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(5) |
Dec
(40) |
2024 |
Jan
(26) |
Feb
(14) |
Mar
(26) |
Apr
(46) |
May
(17) |
Jun
(47) |
Jul
(23) |
Aug
(72) |
Sep
(42) |
Oct
(6) |
Nov
(2) |
Dec
(1) |
2025 |
Jan
(2) |
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
|
Jun
(25) |
Jul
(12) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Takashi S. <o-t...@sa...> - 2025-06-15 13:33:11
|
Hi, This is the revised version of v1 patchset[1]. Last year, in Linux kernel v6.12, the bottom-halves for isochronous contexts of 1394 OHCI PCI driver were changed to use workqueue instead of tasklet (softIRQ)[2]. I have received no reports of any issues related to the change until today. Therefore, I believe it's time to move on to the next step. This patchset updates the driver to use a regular workqueue (not WQ_BH) to handle 1394 OHCI AT/AR context events. Unlike isochronous contexts, the asynchronous contexts are used by the implementation of the SCSI over IEEE 1394 protocol (sbp2). The workqueue is allocated with WQ_MEM_RECLAIM flag so that it can still participate in memory reclaim paths. With this change, all remaining uses of tasklets in the subsystem are completely removed. [1] https://lore.kernel.org/lkml/202...@sa.../ [2] https://lore.kernel.org/lkml/202...@sa.../ Changes from v1 patchset: * Fix "error: cannot jump from this goto statement to its label" * https://lore.kernel.org/lkml/202...@sa.../ * Fix indentations. Takashi Sakamoto (3): firewire: core: allocate workqueue for AR/AT request/response contexts firewire: ohci: use workqueue to handle events of AR request/response contexts firewire: ohci: use workqueue to handle events of AT request/response contexts drivers/firewire/core-card.c | 48 +++++++++++++++------ drivers/firewire/core-transaction.c | 7 +-- drivers/firewire/net.c | 4 +- drivers/firewire/ohci.c | 67 +++++++++++++++-------------- include/linux/firewire.h | 12 +++++- 5 files changed, 85 insertions(+), 53 deletions(-) -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-15 13:33:11
|
Some tasklets (softIRQs) are still used as bottom-halves to handle events for 1394 OHCI AR/AT contexts. However, using softIRQs for IRQ bottom halves is generally discouraged today. This commit adds a per-fw_card workqueue to accommodate the behaviour specified by the 1394 OHCI specification. According to the 1394 OHCI specification, system memory pages are reserved for each asynchronous DMA context. This allows concurrent operation across contexts. In the 1394 OHCI PCI driver implementation, the hardware generates IRQs either upon receiving asynchronous packets from other nodes (incoming) or after completing transmission to them (outgoing). These independent events can occur in the same transmission cycle, therefore the max_active parameter for the workqueue is set to the total number of AR/AT contexts (=4). The WQ_UNBOUND flag is used to allow the work to be scheduled on any available core, since there is little CPU cache affinity benefit for the data. Each DMA context uses a circular descriptor list in system memory, allowing deferred data processing in software as long as buffer overrun are avoided. Since the overall operation is sleepable except for small atomic regions, WQ_BH is not used. As the descriptors contain timestamps, WQ_HIGHPRI is specified to support semi-real-time processing. The asynchronous context is also used by the SCSI over IEEE 1394 protocol implementation (sbp2), which can be part of memory reclaim paths. Therefore, WQ_MEM_RECLAIM is required. To allow uses to adjust CPU affinity according to workload, WQ_SYSFS is specified so that workqueue attributes are exposed to user space. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-card.c | 48 +++++++++++++++++++++++++----------- include/linux/firewire.h | 1 + 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 2b6ad47b6d57..b3e48ca516fe 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -574,7 +574,6 @@ EXPORT_SYMBOL(fw_card_initialize); int fw_card_add(struct fw_card *card, u32 max_receive, u32 link_speed, u64 guid, unsigned int supported_isoc_contexts) { - struct workqueue_struct *isoc_wq; int ret; // This workqueue should be: @@ -589,29 +588,48 @@ int fw_card_add(struct fw_card *card, u32 max_receive, u32 link_speed, u64 guid, // * == WQ_SYSFS Parameters are available via sysfs. // * max_active == n_it + n_ir A hardIRQ could notify events for multiple isochronous // contexts if they are scheduled to the same cycle. - isoc_wq = alloc_workqueue("firewire-isoc-card%u", - WQ_UNBOUND | WQ_FREEZABLE | WQ_HIGHPRI | WQ_SYSFS, - supported_isoc_contexts, card->index); - if (!isoc_wq) + card->isoc_wq = alloc_workqueue("firewire-isoc-card%u", + WQ_UNBOUND | WQ_FREEZABLE | WQ_HIGHPRI | WQ_SYSFS, + supported_isoc_contexts, card->index); + if (!card->isoc_wq) return -ENOMEM; + // This workqueue should be: + // * != WQ_BH Sleepable. + // * == WQ_UNBOUND Any core can process data for asynchronous context. + // * == WQ_MEM_RECLAIM Used for any backend of block device. + // * == WQ_FREEZABLE The target device would not be available when being freezed. + // * == WQ_HIGHPRI High priority to process semi-realtime timestamped data. + // * == WQ_SYSFS Parameters are available via sysfs. + // * max_active == 4 A hardIRQ could notify events for a pair of requests and + // response AR/AT contexts. + card->async_wq = alloc_workqueue("firewire-async-card%u", + WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_HIGHPRI | WQ_SYSFS, + 4, card->index); + if (!card->async_wq) { + ret = -ENOMEM; + goto err_isoc; + } + card->max_receive = max_receive; card->link_speed = link_speed; card->guid = guid; - guard(mutex)(&card_mutex); + scoped_guard(mutex, &card_mutex) { + generate_config_rom(card, tmp_config_rom); + ret = card->driver->enable(card, tmp_config_rom, config_rom_length); + if (ret < 0) + goto err_async; - generate_config_rom(card, tmp_config_rom); - ret = card->driver->enable(card, tmp_config_rom, config_rom_length); - if (ret < 0) { - destroy_workqueue(isoc_wq); - return ret; + list_add_tail(&card->link, &card_list); } - card->isoc_wq = isoc_wq; - list_add_tail(&card->link, &card_list); - return 0; +err_async: + destroy_workqueue(card->async_wq); +err_isoc: + destroy_workqueue(card->isoc_wq); + return ret; } EXPORT_SYMBOL(fw_card_add); @@ -744,6 +762,7 @@ void fw_core_remove_card(struct fw_card *card) dummy_driver.stop_iso = card->driver->stop_iso; card->driver = &dummy_driver; drain_workqueue(card->isoc_wq); + drain_workqueue(card->async_wq); scoped_guard(spinlock_irqsave, &card->lock) fw_destroy_nodes(card); @@ -753,6 +772,7 @@ void fw_core_remove_card(struct fw_card *card) wait_for_completion(&card->done); destroy_workqueue(card->isoc_wq); + destroy_workqueue(card->async_wq); WARN_ON(!list_empty(&card->transaction_list)); } diff --git a/include/linux/firewire.h b/include/linux/firewire.h index b632eec3ab52..c55b8e30e700 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -136,6 +136,7 @@ struct fw_card { __be32 maint_utility_register; struct workqueue_struct *isoc_wq; + struct workqueue_struct *async_wq; }; static inline struct fw_card *fw_card_get(struct fw_card *card) -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-14 11:52:09
|
This commit adds a work item to handle events of 1394 OHCI AR request/response contexts, and queues the item to the specific workqueue. The call of struct fw_address_handler.address_callback() is done in the workqueue when receiving any requests from the remove nodes. Additionally, the call of struct fw_packet.callback() is done in the workqueue too when receiving acknowledge to the asynchronous packet for the response subaction of split transaction to the remote nodes. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-transaction.c | 7 ++++--- drivers/firewire/ohci.c | 27 +++++++++++---------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 2bd5deb9054e..d28477d84697 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -557,9 +557,10 @@ const struct fw_address_region fw_unit_space_region = * * region->start, ->end, and handler->length have to be quadlet-aligned. * - * When a request is received that falls within the specified address range, - * the specified callback is invoked. The parameters passed to the callback - * give the details of the particular request. + * When a request is received that falls within the specified address range, the specified callback + * is invoked. The parameters passed to the callback give the details of the particular request. + * The callback is invoked in the workqueue context in most cases. However, if the request is + * initiated by the local node, the callback is invoked in the initiator's context. * * To be called in process context. * Return value: 0 on success, non-zero otherwise. diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 40313a3ec63e..68317b5a64a7 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -101,7 +101,7 @@ struct ar_context { void *pointer; unsigned int last_buffer_index; u32 regs; - struct tasklet_struct tasklet; + struct work_struct work; }; struct context; @@ -1016,9 +1016,9 @@ static void ar_recycle_buffers(struct ar_context *ctx, unsigned int end_buffer) } } -static void ar_context_tasklet(unsigned long data) +static void ohci_ar_context_work(struct work_struct *work) { - struct ar_context *ctx = (struct ar_context *)data; + struct ar_context *ctx = from_work(ctx, work, work); unsigned int end_buffer_index, end_buffer_offset; void *p, *end; @@ -1026,23 +1026,19 @@ static void ar_context_tasklet(unsigned long data) if (!p) return; - end_buffer_index = ar_search_last_active_buffer(ctx, - &end_buffer_offset); + end_buffer_index = ar_search_last_active_buffer(ctx, &end_buffer_offset); ar_sync_buffers_for_cpu(ctx, end_buffer_index, end_buffer_offset); end = ctx->buffer + end_buffer_index * PAGE_SIZE + end_buffer_offset; if (end_buffer_index < ar_first_buffer_index(ctx)) { - /* - * The filled part of the overall buffer wraps around; handle - * all packets up to the buffer end here. If the last packet - * wraps around, its tail will be visible after the buffer end - * because the buffer start pages are mapped there again. - */ + // The filled part of the overall buffer wraps around; handle all packets up to the + // buffer end here. If the last packet wraps around, its tail will be visible after + // the buffer end because the buffer start pages are mapped there again. void *buffer_end = ctx->buffer + AR_BUFFERS * PAGE_SIZE; p = handle_ar_packets(ctx, p, buffer_end); if (p < buffer_end) goto error; - /* adjust p to point back into the actual buffer */ + // adjust p to point back into the actual buffer p -= AR_BUFFERS * PAGE_SIZE; } @@ -1057,7 +1053,6 @@ static void ar_context_tasklet(unsigned long data) ar_recycle_buffers(ctx, end_buffer_index); return; - error: ctx->pointer = NULL; } @@ -1073,7 +1068,7 @@ static int ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, ctx->regs = regs; ctx->ohci = ohci; - tasklet_init(&ctx->tasklet, ar_context_tasklet, (unsigned long)ctx); + INIT_WORK(&ctx->work, ohci_ar_context_work); for (i = 0; i < AR_BUFFERS; i++) { ctx->pages[i] = dma_alloc_pages(dev, PAGE_SIZE, &dma_addr, @@ -2238,10 +2233,10 @@ static irqreturn_t irq_handler(int irq, void *data) } if (event & OHCI1394_RQPkt) - tasklet_schedule(&ohci->ar_request_ctx.tasklet); + queue_work(ohci->card.async_wq, &ohci->ar_request_ctx.work); if (event & OHCI1394_RSPkt) - tasklet_schedule(&ohci->ar_response_ctx.tasklet); + queue_work(ohci->card.async_wq, &ohci->ar_response_ctx.work); if (event & OHCI1394_reqTxComplete) tasklet_schedule(&ohci->at_request_ctx.tasklet); -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-14 11:52:09
|
Hi, Last year, in Linux kernel v6.12, the bottom-halves for isochronous contexts of 1394 OHCI PCI driver were changed to use workqueue instead of tasklet (softIRQ). I have received no reports of any issues related to the change until today. Therefore, I believe it's time to move on to the next step. This patchset updates the driver to use a regular workqueue (not WQ_BH) to handle 1394 OHCI AT/AR context events. Unlike isochronous contexts, the asynchronous contexts are used by the implementation of the SCSI over IEEE 1394 protocol (sbp2). The workqueue is allocated with WQ_MEM_RECLAIM flag so that it can still participate in memory reclaim paths. With this change, all remaining uses of tasklets in the subsystem are completely removed. [1] https://lore.kernel.org/lkml/202...@sa.../ Takashi Sakamoto (3): firewire: core: allocate workqueue for AR/AT request/response contexts firewire: ohci: use workqueue to handle events of AR request/response contexts firewire: ohci: use workqueue to handle events of AT request/response contexts drivers/firewire/core-card.c | 40 ++++++++++++----- drivers/firewire/core-transaction.c | 7 +-- drivers/firewire/net.c | 4 +- drivers/firewire/ohci.c | 67 +++++++++++++++-------------- include/linux/firewire.h | 12 +++++- 5 files changed, 81 insertions(+), 49 deletions(-) -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-14 11:52:04
|
Some tasklets (softIRQs) are still used as bottom-halves to handle events for 1394 OHCI AR/AT contexts. However, using softIRQs for IRQ bottom halves is generally discouraged today. This commit adds a per-fw_card workqueue to accommodate the behaviour specified by the 1394 OHCI specification. According to the 1394 OHCI specification, system memory pages are reserved for each asynchronous DMA context. This allows concurrent operation across contexts. In the 1394 OHCI PCI driver implementation, the hardware generates IRQs either upon receiving asynchronous packets from other nodes (incoming) or after completing transmission to them (outgoing). These independent events can occur in the same transmission cycle, therefore the max_active parameter for the workqueue is set to the total number of AR/AT contexts (=4). The WQ_UNBOUND flag is used to allow the work to be scheduled on any available core, since there is little CPU cache affinity benefit for the data. Each DMA context uses a circular descriptor list in system memory, allowing deferred data processing in software as long as buffer overrun are avoided. Since the overall operation is sleepable except for small atomic regions, WQ_BH is not used. As the descriptors contain timestamps, WQ_HIGHPRI is specified to support semi-real-time processing. The asynchronous context is also used by the SCSI over IEEE 1394 protocol implementation (sbp2), which can be part of memory reclaim paths. Therefore, WQ_MEM_RECLAIM is required. To allow uses to adjust CPU affinity according to workload, WQ_SYSFS is specified so that workqueue attributes are exposed to user space. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-card.c | 40 +++++++++++++++++++++++++++--------- include/linux/firewire.h | 1 + 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 2b6ad47b6d57..df0bb5b96ddc 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -574,7 +574,6 @@ EXPORT_SYMBOL(fw_card_initialize); int fw_card_add(struct fw_card *card, u32 max_receive, u32 link_speed, u64 guid, unsigned int supported_isoc_contexts) { - struct workqueue_struct *isoc_wq; int ret; // This workqueue should be: @@ -589,12 +588,29 @@ int fw_card_add(struct fw_card *card, u32 max_receive, u32 link_speed, u64 guid, // * == WQ_SYSFS Parameters are available via sysfs. // * max_active == n_it + n_ir A hardIRQ could notify events for multiple isochronous // contexts if they are scheduled to the same cycle. - isoc_wq = alloc_workqueue("firewire-isoc-card%u", - WQ_UNBOUND | WQ_FREEZABLE | WQ_HIGHPRI | WQ_SYSFS, - supported_isoc_contexts, card->index); - if (!isoc_wq) + card->isoc_wq = alloc_workqueue("firewire-isoc-card%u", + WQ_UNBOUND | WQ_FREEZABLE | WQ_HIGHPRI | WQ_SYSFS, + supported_isoc_contexts, card->index); + if (!card->isoc_wq) return -ENOMEM; + // This workqueue should be: + // * != WQ_BH Sleepable. + // * == WQ_UNBOUND Any core can process data for asynchronous context. + // * == WQ_MEM_RECLAIM Used for any backend of block device. + // * == WQ_FREEZABLE The target device would not be available when being freezed. + // * == WQ_HIGHPRI High priority to process semi-realtime timestamped data. + // * == WQ_SYSFS Parameters are available via sysfs. + // * max_active == 4 A hardIRQ could notify events for a pair of requests and + // response AR/AT contexts. + card->async_wq = alloc_workqueue("firewire-async-card%u", + WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_FREEZABLE | WQ_HIGHPRI | WQ_SYSFS, + 4, card->index); + if (!card->async_wq) { + ret = -ENOMEM; + goto err_isoc; + } + card->max_receive = max_receive; card->link_speed = link_speed; card->guid = guid; @@ -603,15 +619,17 @@ int fw_card_add(struct fw_card *card, u32 max_receive, u32 link_speed, u64 guid, generate_config_rom(card, tmp_config_rom); ret = card->driver->enable(card, tmp_config_rom, config_rom_length); - if (ret < 0) { - destroy_workqueue(isoc_wq); - return ret; - } + if (ret < 0) + goto err_async; - card->isoc_wq = isoc_wq; list_add_tail(&card->link, &card_list); return 0; +err_async: + destroy_workqueue(card->async_wq); +err_isoc: + destroy_workqueue(card->isoc_wq); + return ret; } EXPORT_SYMBOL(fw_card_add); @@ -744,6 +762,7 @@ void fw_core_remove_card(struct fw_card *card) dummy_driver.stop_iso = card->driver->stop_iso; card->driver = &dummy_driver; drain_workqueue(card->isoc_wq); + drain_workqueue(card->async_wq); scoped_guard(spinlock_irqsave, &card->lock) fw_destroy_nodes(card); @@ -753,6 +772,7 @@ void fw_core_remove_card(struct fw_card *card) wait_for_completion(&card->done); destroy_workqueue(card->isoc_wq); + destroy_workqueue(card->async_wq); WARN_ON(!list_empty(&card->transaction_list)); } diff --git a/include/linux/firewire.h b/include/linux/firewire.h index b632eec3ab52..c55b8e30e700 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -136,6 +136,7 @@ struct fw_card { __be32 maint_utility_register; struct workqueue_struct *isoc_wq; + struct workqueue_struct *async_wq; }; static inline struct fw_card *fw_card_get(struct fw_card *card) -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-14 11:52:04
|
This commit adds a work item to handle events of 1394 OHCI AT request/response contexts, and queues the item to the specific workqueue. The call of struct fw_packet.callbaqck() is done in the workqueue when receiving acknowledgement to the asynchronous packet transferred to remote node. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/net.c | 4 ++-- drivers/firewire/ohci.c | 40 ++++++++++++++++++++++++---------------- include/linux/firewire.h | 11 +++++++++-- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 1bf0e15c1540..6d6446713539 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -1007,7 +1007,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask) spin_lock_irqsave(&dev->lock, flags); - /* If the AT tasklet already ran, we may be last user. */ + /* If the AT work item already ran, we may be last user. */ free = (ptask->outstanding_pkts == 0 && !ptask->enqueued); if (!free) ptask->enqueued = true; @@ -1026,7 +1026,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask) spin_lock_irqsave(&dev->lock, flags); - /* If the AT tasklet already ran, we may be last user. */ + /* If the AT work item already ran, we may be last user. */ free = (ptask->outstanding_pkts == 0 && !ptask->enqueued); if (!free) ptask->enqueued = true; diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 68317b5a64a7..a81a876819d0 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -158,7 +158,7 @@ struct context { descriptor_callback_t callback; - struct tasklet_struct tasklet; + struct work_struct work; }; struct iso_context { @@ -1176,9 +1176,9 @@ static void context_retire_descriptors(struct context *ctx) } } -static void context_tasklet(unsigned long data) +static void ohci_at_context_work(struct work_struct *work) { - struct context *ctx = (struct context *) data; + struct context *ctx = from_work(ctx, work, work); context_retire_descriptors(ctx); } @@ -1243,7 +1243,6 @@ static int context_init(struct context *ctx, struct fw_ohci *ohci, ctx->buffer_tail = list_entry(ctx->buffer_list.next, struct descriptor_buffer, list); - tasklet_init(&ctx->tasklet, context_tasklet, (unsigned long)ctx); ctx->callback = callback; /* @@ -1524,13 +1523,17 @@ static int at_context_queue_packet(struct context *ctx, static void at_context_flush(struct context *ctx) { - tasklet_disable(&ctx->tasklet); + // Avoid dead lock due to programming mistake. + if (WARN_ON_ONCE(current_work() == &ctx->work)) + return; + + disable_work_sync(&ctx->work); - ctx->flushing = true; - context_tasklet((unsigned long)ctx); - ctx->flushing = false; + WRITE_ONCE(ctx->flushing, true); + ohci_at_context_work(&ctx->work); + WRITE_ONCE(ctx->flushing, false); - tasklet_enable(&ctx->tasklet); + enable_work(&ctx->work); } static int handle_at_packet(struct context *context, @@ -1542,7 +1545,7 @@ static int handle_at_packet(struct context *context, struct fw_ohci *ohci = context->ohci; int evt; - if (last->transfer_status == 0 && !context->flushing) + if (last->transfer_status == 0 && !READ_ONCE(context->flushing)) /* This descriptor isn't done yet, stop iteration. */ return 0; @@ -1576,7 +1579,7 @@ static int handle_at_packet(struct context *context, break; case OHCI1394_evt_missing_ack: - if (context->flushing) + if (READ_ONCE(context->flushing)) packet->ack = RCODE_GENERATION; else { /* @@ -1598,7 +1601,7 @@ static int handle_at_packet(struct context *context, break; case OHCI1394_evt_no_status: - if (context->flushing) { + if (READ_ONCE(context->flushing)) { packet->ack = RCODE_GENERATION; break; } @@ -2239,10 +2242,10 @@ static irqreturn_t irq_handler(int irq, void *data) queue_work(ohci->card.async_wq, &ohci->ar_response_ctx.work); if (event & OHCI1394_reqTxComplete) - tasklet_schedule(&ohci->at_request_ctx.tasklet); + queue_work(ohci->card.async_wq, &ohci->at_request_ctx.work); if (event & OHCI1394_respTxComplete) - tasklet_schedule(&ohci->at_response_ctx.tasklet); + queue_work(ohci->card.async_wq, &ohci->at_response_ctx.work); if (event & OHCI1394_isochRx) { iso_event = reg_read(ohci, OHCI1394_IsoRecvIntEventClear); @@ -2684,7 +2687,10 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) struct driver_data *driver_data = packet->driver_data; int ret = -ENOENT; - tasklet_disable_in_atomic(&ctx->tasklet); + // Avoid dead lock due to programming mistake. + if (WARN_ON_ONCE(current_work() == &ctx->work)) + return 0; + disable_work_sync(&ctx->work); if (packet->ack != 0) goto out; @@ -2703,7 +2709,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) packet->callback(packet, &ohci->card, packet->ack); ret = 0; out: - tasklet_enable(&ctx->tasklet); + enable_work(&ctx->work); return ret; } @@ -3765,11 +3771,13 @@ static int pci_probe(struct pci_dev *dev, OHCI1394_AsReqTrContextControlSet, handle_at_packet); if (err < 0) return err; + INIT_WORK(&ohci->at_request_ctx.work, ohci_at_context_work); err = context_init(&ohci->at_response_ctx, ohci, OHCI1394_AsRspTrContextControlSet, handle_at_packet); if (err < 0) return err; + INIT_WORK(&ohci->at_response_ctx.work, ohci_at_context_work); reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, ~0); ohci->ir_context_channels = ~0ULL; diff --git a/include/linux/firewire.h b/include/linux/firewire.h index c55b8e30e700..cceb70415ed2 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -308,8 +308,7 @@ struct fw_packet { * For successful transmission, the status code is the ack received * from the destination. Otherwise it is one of the juju-specific * rcodes: RCODE_SEND_ERROR, _CANCELLED, _BUSY, _GENERATION, _NO_ACK. - * The callback can be called from tasklet context and thus - * must never block. + * The callback can be called from workqueue and thus must never block. */ fw_packet_callback_t callback; int ack; @@ -382,6 +381,10 @@ void __fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode * * A variation of __fw_send_request() to generate callback for response subaction without time * stamp. + * + * The callback is invoked in the workqueue context in most cases. However, if an error is detected + * before queueing or the destination address refers to the local node, it is invoked in the + * current context instead. */ static inline void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode, int destination_id, int generation, int speed, @@ -411,6 +414,10 @@ static inline void fw_send_request(struct fw_card *card, struct fw_transaction * * @callback_data: data to be passed to the transaction completion callback * * A variation of __fw_send_request() to generate callback for response subaction with time stamp. + * + * The callback is invoked in the workqueue context in most cases. However, if an error is detected + * before queueing or the destination address refers to the local node, it is invoked in the current + * context instead. */ static inline void fw_send_request_with_tstamp(struct fw_card *card, struct fw_transaction *t, int tcode, int destination_id, int generation, int speed, unsigned long long offset, -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-09 23:05:34
|
Hi, On Mon, Jun 09, 2025 at 08:38:08AM +0900, Takashi Sakamoto wrote: > A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner > callback declarations") introduces a new macro to retrieve a poiner for the > parent structure of the work item. It is convenient to reduce input text. > > This commit uses the macro in core functionalities. > > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > drivers/firewire/core-card.c | 4 ++-- > drivers/firewire/core-cdev.c | 3 +-- > drivers/firewire/core-device.c | 15 +++++---------- > 3 files changed, 8 insertions(+), 14 deletions(-) Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-06-09 23:05:08
|
Hi, On Mon, Jun 09, 2025 at 08:38:07AM +0900, Takashi Sakamoto wrote: > A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner > callback declarations") introduces a new macro to retrieve a poiner for the > parent structure of the work item. It is convenient to reduce input text. > > This commit uses the macro in PCI driver for 1394 OHCI. > > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > drivers/firewire/ohci.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-06-09 23:04:51
|
Hi, On Mon, Jun 09, 2025 at 08:38:06AM +0900, Takashi Sakamoto wrote: > The tasklet for bus reset event has been replaced with work item, while > some code comments still address to the tasklet. > > This commit corrects them. > > Fixes: 2d7a36e23300 ("firewire: ohci: Move code from the bus reset tasklet into a workqueue") > Signed-off-by: Takashi Sakamoto <o-t...@sa...> > --- > drivers/firewire/ohci.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Applied to for-next branch. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-06-08 23:56:17
|
A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner callback declarations") introduces a new macro to retrieve a poiner for the parent structure of the work item. It is convenient to reduce input text. This commit uses the macro in core functionalities. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/core-card.c | 4 ++-- drivers/firewire/core-cdev.c | 3 +-- drivers/firewire/core-device.c | 15 +++++---------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 01354b9de8b2..2b6ad47b6d57 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c @@ -237,7 +237,7 @@ EXPORT_SYMBOL(fw_schedule_bus_reset); static void br_work(struct work_struct *work) { - struct fw_card *card = container_of(work, struct fw_card, br_work.work); + struct fw_card *card = from_work(card, work, br_work.work); /* Delay for 2s after last reset per IEEE 1394 clause 8.2.1. */ if (card->reset_jiffies != 0 && @@ -286,7 +286,7 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay) static void bm_work(struct work_struct *work) { - struct fw_card *card = container_of(work, struct fw_card, bm_work.work); + struct fw_card *card = from_work(card, work, bm_work.work); struct fw_device *root_device, *irm_device; struct fw_node *root_node; int root_id, new_root_id, irm_id, bm_id, local_id; diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index bd04980009a4..78b10c6ef7fe 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -1313,8 +1313,7 @@ static int ioctl_get_cycle_timer(struct client *client, union ioctl_arg *arg) static void iso_resource_work(struct work_struct *work) { struct iso_resource_event *e; - struct iso_resource *r = - container_of(work, struct iso_resource, work.work); + struct iso_resource *r = from_work(r, work, work.work); struct client *client = r->client; unsigned long index = r->resource.handle; int generation, channel, bandwidth, todo; diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index ec3e21ad2025..aeacd4cfd694 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c @@ -853,8 +853,7 @@ static void fw_schedule_device_work(struct fw_device *device, static void fw_device_shutdown(struct work_struct *work) { - struct fw_device *device = - container_of(work, struct fw_device, work.work); + struct fw_device *device = from_work(device, work, work.work); if (time_before64(get_jiffies_64(), device->card->reset_jiffies + SHUTDOWN_DELAY) @@ -921,8 +920,7 @@ static int update_unit(struct device *dev, void *data) static void fw_device_update(struct work_struct *work) { - struct fw_device *device = - container_of(work, struct fw_device, work.work); + struct fw_device *device = from_work(device, work, work.work); fw_device_cdev_update(device); device_for_each_child(&device->device, NULL, update_unit); @@ -1002,8 +1000,7 @@ static int compare_configuration_rom(struct device *dev, const void *data) static void fw_device_init(struct work_struct *work) { - struct fw_device *device = - container_of(work, struct fw_device, work.work); + struct fw_device *device = from_work(device, work, work.work); struct fw_card *card = device->card; struct device *found; u32 minor; @@ -1184,8 +1181,7 @@ static int reread_config_rom(struct fw_device *device, int generation, static void fw_device_refresh(struct work_struct *work) { - struct fw_device *device = - container_of(work, struct fw_device, work.work); + struct fw_device *device = from_work(device, work, work.work); struct fw_card *card = device->card; int ret, node_id = device->node_id; bool changed; @@ -1251,8 +1247,7 @@ static void fw_device_refresh(struct work_struct *work) static void fw_device_workfn(struct work_struct *work) { - struct fw_device *device = container_of(to_delayed_work(work), - struct fw_device, work); + struct fw_device *device = from_work(device, to_delayed_work(work), work); device->workfn(work); } -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-08 23:56:13
|
A commit 60b2ebf48526 ("workqueue: Introduce from_work() helper for cleaner callback declarations") introduces a new macro to retrieve a poiner for the parent structure of the work item. It is convenient to reduce input text. This commit uses the macro in PCI driver for 1394 OHCI. Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 27e3e998e6fc..40313a3ec63e 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -1190,7 +1190,7 @@ static void context_tasklet(unsigned long data) static void ohci_isoc_context_work(struct work_struct *work) { - struct fw_iso_context *base = container_of(work, struct fw_iso_context, work); + struct fw_iso_context *base = from_work(base, work, work); struct iso_context *isoc_ctx = container_of(base, struct iso_context, base); context_retire_descriptors(&isoc_ctx->context); @@ -2028,8 +2028,7 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count) static void bus_reset_work(struct work_struct *work) { - struct fw_ohci *ohci = - container_of(work, struct fw_ohci, bus_reset_work); + struct fw_ohci *ohci = from_work(ohci, work, bus_reset_work); int self_id_count, generation, new_generation, i, j; u32 reg, quadlet; void *free_rom = NULL; -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-06-08 23:51:14
|
The tasklet for bus reset event has been replaced with work item, while some code comments still address to the tasklet. This commit corrects them. Fixes: 2d7a36e23300 ("firewire: ohci: Move code from the bus reset tasklet into a workqueue") Signed-off-by: Takashi Sakamoto <o-t...@sa...> --- drivers/firewire/ohci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index edaedd156a6d..27e3e998e6fc 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2528,7 +2528,7 @@ static int ohci_enable(struct fw_card *card, * They shouldn't do that in this initial case where the link * isn't enabled. This means we have to use the same * workaround here, setting the bus header to 0 and then write - * the right values in the bus reset tasklet. + * the right values in the bus reset work item. */ if (config_rom) { @@ -2617,7 +2617,7 @@ static int ohci_set_config_rom(struct fw_card *card, * during the atomic update, even on little endian * architectures. The workaround we use is to put a 0 in the * header quadlet; 0 is endian agnostic and means that the - * config rom isn't ready yet. In the bus reset tasklet we + * config rom isn't ready yet. In the bus reset work item we * then set up the real values for the two registers. * * We use ohci->lock to avoid racing with the code that sets @@ -2659,7 +2659,7 @@ static int ohci_set_config_rom(struct fw_card *card, /* * Now initiate a bus reset to have the changes take * effect. We clean up the old config rom memory and DMA - * mappings in the bus reset tasklet, since the OHCI + * mappings in the bus reset work item, since the OHCI * controller could need to access it before the bus reset * takes effect. */ -- 2.48.1 |
From: Takashi S. <o-t...@sa...> - 2025-04-02 15:16:35
|
Hi Linus, Please apply a single commit from FireWire subsystem to your tree. As a side note, we continue to have a discussion about kbuild script since the recent change seems to bring a regression when building some in-kernel tools including the one for firewire[1]. A fix candidate has come[2], but it could be too late for the current merge window. [1] https://lore.kernel.org/lkml/202...@ky.../ [2] https://lore.kernel.org/lkml/202...@ky.../ The following changes since commit 2014c95afecee3e76ca4a56956a936e23283f05b: Linux 6.14-rc1 (2025-02-02 15:39:26 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git tags/firewire-updates-6.15 for you to fetch changes up to ca2c736554c105897d67a015a97973af315e1c32: firewire: core: avoid -Wflex-array-member-not-at-end warning (2025-03-16 09:32:30 +0900) ---------------------------------------------------------------- firewire updates for v6.15 A single commit has done to use the common helper function for on-stack trailing array to enqueue any isochronous packet by the requests from userspace application. ---------------------------------------------------------------- Gustavo A. R. Silva (1): firewire: core: avoid -Wflex-array-member-not-at-end warning drivers/firewire/core-cdev.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) Regards Takashi Sakamoto |
From: AreYouLoco? <are...@pa...> - 2025-04-01 17:35:17
|
Hi Takashi, hi other maintainers if any, I wanted to report another PHY device IDs. But commands failed with timeout. Willing to build and test in case of changes. Its Ricoh controller integrated with OHCI controller on one chip: FireWire (IEEE 1394): Ricoh Co Ltd R5C832 PCIe IEEE 1394 Controller (rev 04) [1180:e832] Target having it is Lenovo Thinkpad T420. And other models as well. # lsfirewirephy timeout $ lsfirewire -v device fw0: vendor ID: 0x001f11 model ID: 0x023901 vendor: Linux Firewire model: Juju guid: 0x0021cc20060f508e So its submitted to: <https://ieee1394.docs.kernel.org/en/latest/phy.html#phy-device-ids> Cheers |
From: Takashi S. <o-t...@sa...> - 2025-03-29 01:07:49
|
Hi, On Fri, Mar 28, 2025 at 03:47:50PM +0800, Riwen Lu wrote: > The value -rR of MAKEFLAGS implicit do not use make's built-in rules and > variables. Previous commit d1d096312176 ("tools: fix annoying "mkdir -p > ..." logs when building tools in parallel") removed the MAKEFLAGS= > command for tools and caused the built-in rules for pfrut/firewire > failed to take effect. > > Reported-by: k2ci <ker...@ky...> > Signed-off-by: Riwen Lu <lu...@ky...> > --- > tools/firewire/Makefile | 7 +++++++ > tools/power/acpi/tools/pfrut/Makefile | 2 +- > 2 files changed, 8 insertions(+), 1 deletion(-) As long as testing with v6.14 release, I can not find such failure. I guess that some one has fixed the issue between the commit and the release. Would you please recheck the issue? Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-03-17 12:05:59
|
Hi, On Fri, Mar 14, 2025 at 08:58:23AM +1030, Gustavo A. R. Silva wrote: > Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of > a flexible structure where the size of the flexible-array member > is known at compile-time, and refactor the rest of the code, > accordingly. > > So, with these changes, fix the following warning: > > drivers/firewire/core-cdev.c:1141:38: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > > Signed-off-by: Gustavo A. R. Silva <gus...@ke...> > --- > Changes in v2: > - Adjust COUNT argument for DEFINE_RAW_FLEX() to 64. (Takashi) > > v1: > - Link: https://lore.kernel.org/linux-hardening/Z9AA9tAbcIcz6BMO@kspp/ > > drivers/firewire/core-cdev.c | 42 ++++++++++++++++-------------------- > 1 file changed, 19 insertions(+), 23 deletions(-) Applied to for-next branch. Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-03-13 00:21:16
|
Hi, On Tue, Mar 11, 2025 at 07:53:02PM +1030, Gustavo A. R. Silva wrote: > Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of > a flexible structure where the size of the flexible-array member > is known at compile-time, and refactor the rest of the code, > accordingly. > > So, with these changes, fix the following warning: > > drivers/firewire/core-cdev.c:1141:38: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > > Signed-off-by: Gustavo A. R. Silva <gus...@ke...> > --- > drivers/firewire/core-cdev.c | 42 ++++++++++++++++-------------------- > 1 file changed, 19 insertions(+), 23 deletions(-) Thanks for the improvement, however I think it includes a slight concern about the calculation for the length of array. > diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c > index b360dca2c69e..706b9037faac 100644 > --- a/drivers/firewire/core-cdev.c > +++ b/drivers/firewire/core-cdev.c > @@ -1137,10 +1137,7 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg) > unsigned long payload, buffer_end, transmit_header_bytes = 0; > u32 control; > int count; > - struct { > - struct fw_iso_packet packet; > - u8 header[256]; > - } u; > + DEFINE_RAW_FLEX(struct fw_iso_packet, u, header, 8); The definition of 'struct fw_iso_packet' is in 'include/linux/firewire.h': ``` $ cat include/linux/firewire.h ... 460 struct fw_iso_packet { 461 u16 payload_length; /* Length of indirect payload */ 462 u32 interrupt:1; /* Generate interrupt on this packet */ 463 u32 skip:1; /* tx: Set to not send packet at all */ 464 /* rx: Sync bit, wait for matching sy */ 465 u32 tag:2; /* tx: Tag in packet header */ 466 u32 sy:4; /* tx: Sy in packet header */ 467 u32 header_length:8; /* Size of immediate header */ 468 u32 header[]; /* tx: Top of 1394 isoch. data_block */ 469 }; ``` The size of element of 'header' array is 4 byte (= 32 / 8). The original code keeps 256 bytes storage following to the structure. Therefore the 'COUNT' argument of DEFINE_RAW_FLEX() macro should be 64 (= 256 / 4). Although the header field is not rarely used by userspace applications actually and the reduction of kernel stack usage is preferable itself, it is preferable to keep the compatibility. Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-03-05 11:14:12
|
Hi, On Thu, Feb 20, 2025 at 02:03:13PM +0900, Takashi Sakamoto wrote: > Hi, > > On Wed, Feb 19, 2025 at 09:32:19AM +0100, Mauro Carvalho Chehab wrote: > > The description of @tstamp parameter has one line that starts at the > > beginning. This moves such line to the description, which is not the > > intent here. > > > > Signed-off-by: Mauro Carvalho Chehab <mch...@ke...> > > --- > > include/uapi/linux/firewire-cdev.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Applied to for-next branch. I dropped the patch from for-next branch since it already exists in jc_docs tree. https://lore.kernel.org/lkml/202...@ca.../ Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-02-20 05:03:30
|
Hi, On Wed, Feb 19, 2025 at 09:32:19AM +0100, Mauro Carvalho Chehab wrote: > The description of @tstamp parameter has one line that starts at the > beginning. This moves such line to the description, which is not the > intent here. > > Signed-off-by: Mauro Carvalho Chehab <mch...@ke...> > --- > include/uapi/linux/firewire-cdev.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to for-next branch. Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-01-26 09:11:24
|
Hi Linus, Please merge the firewire updates for the 6.14 kernel. The following changes since commit 40384c840ea1944d7c5a392e8975ed088ecf0b37: Linux 6.13-rc1 (2024-12-01 14:28:56 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git tags/firewire-updates-6.14 for you to fetch changes up to 352fafe97784e81a10a7c74bd508f71a19b53c2a: firewire: test: Fix potential null dereference in firewire kunit test (2025-01-13 10:31:27 +0900) ---------------------------------------------------------------- firewire updates for v6.14 Two changes for the 6.14 kernel. The first change concerns the PCI driver for 1394 OHCI hardware. Previously, it used legacy PCI suspend/resume callbacks, which have now been replaced with callbacks defined in the Linux generic power management framework. This original patch was posted in 2020 and has been adapted with some modifications for the latest kernel. Note that the driver still includes platform-specific operations for PowerPC, and these operations have not been tested in the new implementation yet. It would be helpful to share the results of suspending/resuming on the platform. The rest is a minor fix for the memory allocation in some KUnit tests. ---------------------------------------------------------------- Charles Han (1): firewire: test: Fix potential null dereference in firewire kunit test Vaibhav Gupta (1): firewire: ohci: use generic power management drivers/firewire/device-attribute-test.c | 2 ++ drivers/firewire/ohci.c | 44 +++++++++++++------------------------------- 2 files changed, 15 insertions(+), 31 deletions(-) Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2025-01-13 02:01:38
|
Hi, On Fri, Jan 10, 2025 at 04:42:37PM +0800, Charles Han wrote: > kunit_kzalloc() may return a NULL pointer, dereferencing it without > NULL check may lead to NULL dereference. > Add a NULL check for test_state. > > Fixes: 1c8506d62624 ("firewire: test: add test of device attributes for simple AV/C device") > Signed-off-by: Charles Han <han...@in...> > --- > drivers/firewire/device-attribute-test.c | 2 ++ > 1 file changed, 2 insertions(+) Applied to for-next branch. Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-12-07 01:13:34
|
Hi, On Mon, Jul 20, 2020 at 08:37:16PM +0530, Vaibhav Gupta wrote: > Drivers using legacy PM have to manage PCI states and device's PM states > themselves. They also need to take care of configuration registers. > > With improved and powerful support of generic PM, PCI Core takes care of > above mentioned, device-independent, jobs. > > This driver makes use of PCI helper functions like > pci_save/restore_state(), pci_disable_device() and pci_set_power_state() to > do required operations. In generic mode, they are no longer needed. > > Change function parameter in both .suspend() and .resume() to > "struct device*" type. Use to_pci_dev() to get "struct pci_dev*" variable. > > Compile-tested only. > > Signed-off-by: Vaibhav Gupta <vai...@gm...> > --- > drivers/firewire/ohci.c | 43 ++++++++++++----------------------------- > 1 file changed, 12 insertions(+), 31 deletions(-) Although it takes a long time since the patch was posted, I applied it now to for-next branch with my handy changes to optimize to v6.13-rc1. I still have a slight concern about the operation specific to powermac platforms, however let us fix when receiving any reports from the users. Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-11-23 07:13:19
|
Hi Linus, Please pull some updates for 6.13 from FireWire subsystem. The development activity has been relatively quiet, so only a few commits are included in this PR. The following changes since commit 9852d85ec9d492ebef56dc5f229416c925758edc: Linux 6.12-rc1 (2024-09-29 15:06:19 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394.git tags/firewire-updates-6.13 for you to fetch changes up to 4752e8cde8344cb8673abdefe0dd74e9a2fe23ad: tools/firewire: Fix several incorrect format specifiers (2024-11-14 09:12:04 +0900) ---------------------------------------------------------------- firewire updates for v6.13 A few updates for the 6.13 kernel, including some typo corrections in the software stack and some fixes for tools. Additionally, it includes a change resulting from the deprecation of a kernel API in the PCI subsystem. ---------------------------------------------------------------- Luo Yifan (1): tools/firewire: Fix several incorrect format specifiers Philipp Stanner (1): firewire: ohci: Replace deprecated PCI functions Shen Lichuan (1): firewire: Correct some typos drivers/firewire/core-topology.c | 2 +- drivers/firewire/core.h | 2 +- drivers/firewire/ohci.c | 11 +++++------ tools/firewire/decode-fcp.c | 2 +- tools/firewire/nosy-dump.c | 6 +++--- 5 files changed, 11 insertions(+), 12 deletions(-) Regards Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-11-14 00:27:59
|
On Wed, Nov 13, 2024 at 10:31:37AM +0800, Luo Yifan wrote: > Make a minor change to eliminate static checker warnings. Fix several > incorrect format specifiers that misused signed and unsigned versions. > > Signed-off-by: Luo Yifan <luo...@cm...> > --- > tools/firewire/decode-fcp.c | 2 +- > tools/firewire/nosy-dump.c | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) Applied to for-next branch. Thanks Takashi Sakamoto |
From: Takashi S. <o-t...@sa...> - 2024-10-29 01:19:42
|
Hi, On Mon, Oct 28, 2024 at 10:44:42AM +0100, Philipp Stanner wrote: > pcim_iomap_regions() and pcim_iomap_table() have been deprecated in > commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), > pcim_iomap_regions_request_all()"). > > Replace these functions with pcim_iomap_region(). > > Signed-off-by: Philipp Stanner <pst...@re...> > --- > drivers/firewire/ohci.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Oh, the API has been made available outside of PCI subsystem, great. Applied to for-next branch. Thanks Takashi Sakamoto |