99efdb3e | 30-Jun-2017 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: correct API violation for submit
Current code is violating the DMA Engine API by putting the submitted requests directly into the HW queue. This causes queued transactions to
dmaengine: qcom_hidma: correct API violation for submit
Current code is violating the DMA Engine API by putting the submitted requests directly into the HW queue. This causes queued transactions to be started by another thread as soon as the first one finishes.
The DMA Engine document clearly states this.
"dmaengine_submit() will not start the DMA operation".
Move HW queuing of the requests into the issue_pending() routine to comply with API requirements also create a new queued state for temporarily holding the requests.
A descriptor goes through these transitions now.
free->prepared->queued->active->completed->free
as opposed to
free->prepared->active->completed->free
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
dc7c733a | 25-Mar-2017 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: pause the channel on shutdown
We need to ensure that all DMAs and interrupts are cleared during shutdown operation in order for kexec to start the next kernel clearly.
Otherw
dmaengine: qcom_hidma: pause the channel on shutdown
We need to ensure that all DMAs and interrupts are cleared during shutdown operation in order for kexec to start the next kernel clearly.
Otherwise, HW could be performing a DMA into random addresses in the middle of second kernel start.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
75ff7668 | 19-Nov-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: autoload while probing ACPI
MODULE_DEVICE_TABLE is used by the kernel to determine which device driver should be loaded for which platform device. MODULE_DEVICE_TABLE has been
dmaengine: qcom_hidma: autoload while probing ACPI
MODULE_DEVICE_TABLE is used by the kernel to determine which device driver should be loaded for which platform device. MODULE_DEVICE_TABLE has been only defined for the device-tree based platforms in the current code. Defining it also for ACPI based platforms.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
c6e4584d | 14-Nov-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: cleanup sysfs entries during remove
The 4.8-rc8 kernel is printing duplicate file entry warnings while removing the HIDMA object. This is caused by stale sysfs entries remaini
dmaengine: qcom_hidma: cleanup sysfs entries during remove
The 4.8-rc8 kernel is printing duplicate file entry warnings while removing the HIDMA object. This is caused by stale sysfs entries remaining from the previous execution.
_sysfs_warn_dup+0x5c/0x78 sysfs_add_file_mode_ns+0x13c/0x1c0 sysfs_create_file_ns+0x2c/0x40 device_create_file+0x54/0xa0 hidma_probe+0x7c8/0x808
Create hidma_sysfs_init and hidma_sysfs_uninit functions and call them from the probe and remove path. To do proper clean up, adding the attrs object to the device data structure to keep it around until remove call is made.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
8cc12b26 | 08-Nov-2016 |
Arnd Bergmann <arnd@arndb.de> |
dmaengine: qcom_hidma: hide MSI handler when unused
The newly added MSI support causes a harmless warning when MSI is disabled:
drivers/dma/qcom/hidma.c:558:20: error: 'hidma_chirq_handler_msi' def
dmaengine: qcom_hidma: hide MSI handler when unused
The newly added MSI support causes a harmless warning when MSI is disabled:
drivers/dma/qcom/hidma.c:558:20: error: 'hidma_chirq_handler_msi' defined but not used [-Werror=unused-function]
This adds another #ifdef to match that around the users of the function.
Fixes: 1c0e3e82a7fb ("dmaengine: qcom_hidma: add MSI support for interrupts") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
87ffcea5 | 22-Oct-2016 |
Wei Yongjun <weiyongjun1@huawei.com> |
dmaengine: qcom_hidma: remove unneeded of_node_put()
Device node iterators put the previous value of the index variable, so an explicit put causes a double put.
Generated by: scripts/coccinelle/ite
dmaengine: qcom_hidma: remove unneeded of_node_put()
Device node iterators put the previous value of the index variable, so an explicit put causes a double put.
Generated by: scripts/coccinelle/iterators/device_node_continue.cocci
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
1c0e3e82 | 21-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: add MSI support for interrupts
The interrupts can now be delivered as platform MSI interrupts on newer platforms. The code looks for a new OF and ACPI strings in order to enab
dmaengine: qcom_hidma: add MSI support for interrupts
The interrupts can now be delivered as platform MSI interrupts on newer platforms. The code looks for a new OF and ACPI strings in order to enable the functionality.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
0e858f8d | 21-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: protect common data structures
When MSI interrupts are supported, error and the transfer interrupt can come from multiple processor contexts.
Each error interrupt is an MSI i
dmaengine: qcom_hidma: protect common data structures
When MSI interrupts are supported, error and the transfer interrupt can come from multiple processor contexts.
Each error interrupt is an MSI interrupt. If the channel is disabled by the first error interrupt, the remaining error interrupts will gracefully return in the interrupt handler.
If an error is observed while servicing the completions in success case, the posting of the completions will be aborted as soon as channel disabled state is observed. The error interrupt handler will take it from there and finish the remaining completions. We don't want to create multiple success and error messages to be delivered to the client in mixed order.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
9483d9ae | 21-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: bring out interrupt cause
Bring out the interrupt cause to the top level so that MSI interrupts can be hooked at a later stage.
Signed-off-by: Sinan Kaya <okaya@codeaurora.or
dmaengine: qcom_hidma: bring out interrupt cause
Bring out the interrupt cause to the top level so that MSI interrupts can be hooked at a later stage.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
bdcfddfd | 21-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: make pending_tre_count atomic
Getting ready for the MSI interrupts. The pending_tre_count is used in the interrupt handler to make sure all outstanding requests are serviced.
dmaengine: qcom_hidma: make pending_tre_count atomic
Getting ready for the MSI interrupts. The pending_tre_count is used in the interrupt handler to make sure all outstanding requests are serviced.
The driver will allocate 11 MSI interrupts. Each MSI interrupt can be assigned to a different CPU. Then, we have a race condition for common variables as they share the same interrupt handler with a different cause bit and they can potentially be executed in parallel. Making this variable atomic so that it can be updated from multiple processor contexts.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
fc737969 | 07-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: break completion processing on error
We try to consume as much successful transfers as possible. Now that we support MSI interrupts, an error interrupt might be observed by an
dmaengine: qcom_hidma: break completion processing on error
We try to consume as much successful transfers as possible. Now that we support MSI interrupts, an error interrupt might be observed by another processor while we are finishing the successful ones.
Try to abort successful processing if this is the case.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
d3eab504 | 07-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: add a common API to setup the interrupt
Introducing the hidma_ll_setup_irq function to set up the interrupt type externally from the OS interface.
Signed-off-by: Sinan Kaya <
dmaengine: qcom_hidma: add a common API to setup the interrupt
Introducing the hidma_ll_setup_irq function to set up the interrupt type externally from the OS interface.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
b5b80953 | 06-Oct-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: remove useless debugfs file removal
Since 'commit acc29fb8f792 ("debugfs: ->d_parent is never NULL or negative")', HIDMA object removal is no longer working. This is due to re
dmaengine: qcom_hidma: remove useless debugfs file removal
Since 'commit acc29fb8f792 ("debugfs: ->d_parent is never NULL or negative")', HIDMA object removal is no longer working. This is due to redundant debugfs remove call in hidma_debug_uninit.
debugfs_remove_recursive(dmadev->debugfs); debugfs_remove_recursive(dmadev->stats);
The first remove is for the directory. Second remove is for the file under the directory. The directory remove makes file remove invalid.
Unable to handle kernel NULL pointer dereference at virtual address
[<ffff00000889f480>] down_write+0x18/0x68 [<ffff00000831c220>] debugfs_remove_recursive+0x50/0x1c0 [<ffff00000848e0a8>] hidma_debug_uninit+0x20/0x30 [<ffff00000848c5d8>] hidma_remove+0x48/0x98 [<ffff000008511b6c>] platform_drv_remove+0x24/0x68 [<ffff00000850fac8>] __device_release_driver+0x80/0x118 [<ffff00000850fb84>] device_release_driver+0x24/0x38 [<ffff00000850e928>] unbind_store+0xe8/0x110 [<ffff00000850dd30>] drv_attr_store+0x20/0x30 [<ffff000008253a48>] sysfs_kf_write+0x48/0x58 [<ffff000008252dd8>] kernfs_fop_write+0xb0/0x1d8 [<ffff0000081dab3c>] __vfs_write+0x1c/0x110 [<ffff0000081db940>] vfs_write+0xa0/0x1b8 [<ffff0000081dcd34>] SyS_write+0x44/0xa0 [<ffff000008082ef0>] el0_svc_naked+0x24/0x28
Removing the second line.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
793ae66c | 31-Aug-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: add error reporting for tx_status
The HIDMA driver is capable of error detection. However, the error was not being passed back to the client when tx_status API is called.
Cha
dmaengine: qcom_hidma: add error reporting for tx_status
The HIDMA driver is capable of error detection. However, the error was not being passed back to the client when tx_status API is called.
Changing the error handling behavior to follow this oder.
1. dmaengine asserts error interrupt 2. Driver receives and mark's the txn as error 3. Driver completes the txn and intimates the client. No further submissions. Drop the locks before calling callback, as subsequent processing by client maybe in callback thread. 4. Client invokes status and you can return error 5. On error, client calls terminate_all. You can reset channel, free all descriptors in the active, pending and completed lists 6. Client prepares new txn and so on.
As part of this work, got rid of the reset in the interrupt handler when an error happens and the HW is put into disabled state. The only way to recover is for the client to terminate the channel.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
55c370e5 | 31-Aug-2016 |
Sinan Kaya <okaya@codeaurora.org> |
dmaengine: qcom_hidma: report transfer errors with new interface
Pass the DMA errors to the client by passing a result argument. The HW only supports a generic error when something goes wrong. That'
dmaengine: qcom_hidma: report transfer errors with new interface
Pass the DMA errors to the client by passing a result argument. The HW only supports a generic error when something goes wrong. That's why, using DMA_TRANS_ABORTED all the time.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
show more ...
|
4cad91b2 | 06-Jul-2016 |
Vinod Koul <vinod.koul@intel.com> |
dmaengine: qcom_hidma_lli: kill the tasklets upon exit
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed
Signed-off-by: Vinod Koul <vinod.kou
dmaengine: qcom_hidma_lli: kill the tasklets upon exit
drivers should ensure that tasklets are killed, so that they can't be run after driver remove is executed
Signed-off-by: Vinod Koul <vinod.koul@intel.com> Cc: Sinan Kaya <okaya@codeaurora.org>
show more ...
|