I am currently trying to find a solution to the below setup
Setup:
The setup consists of a connection from a iMX6 to a XIOO2213BZAY chip via PCI then connected to removable memory modules via firewire
Reference:
I have used the nitrogen6x to model the behavior. Though it is not a complete reprsentation of the actual board we are using for, the Nitrogen6x doesn not have a reset. The same behavior is still seen.
Kernel Version:
I have tested a variety of versions.
3.10.17, 3.10.53, 3.14.52, & 4.1.15
Behavior:
The expected behavior is that the drives would connect every time. Right now the behavior changes depending on the Linux kernel version. We have had the best luck with 3.10.17.
The PCI, firewire_core, firewire_ohci, and firewire_sbp2 drivers all load; however, the sbp2 driver fails at login when sbp2_agent_reset is performed. 'orb->response' from sbp2_send_management_orb is used as the buffer passed into dma_map_single which seems to have mixed up results. Half of the array is always has consistent results, element 0 & 1; meanwhile, element 2 & 3 return as 0x00's more times than not.
In sbp2_login: command_block_agent_address is 281470681743360 (FFFF00000000), I hardcoded the command_block_agent_address to be 0xFFFFF0100000 which allowed the driver to connect to the drive & created the SCSI device. Everything works as expected if I just hardcode that value.
I also modified the driver to do a repeat the DMA read, continuously, if a failure occurs. I have also included a variety of command like 'smp_mb()', 'sync', "echo 3 > /proc/sys/vm/drop_cache" that in some cases would help establish a connection. Once a connection was established I was able to connect to the drives just fine.
There is more information at this link:
https://sourceforge.net/p/linux1394/mailman/message/34243589/
Do you have any ideas what would cause incomplete reading from DMA?
Please see logging below.
Any help is appreciated,
Jason
***** Successful Run ******
sbp2_login: size of response: 16
sbp2_send_management_orb: dma_map_single: DMA_FROM_DEVICE
sbp2_send_management_orb: dev id: 0xD219E868
sbp2_send_management_orb: orb->response_bus: 0x223752B8 ;function: 0x0
sbp2_send_management_orb: lu->tgt->management_agent_address = 0xFFFFF0030000
sbp2_send_management_orb: dma_map_single: DMA_TO_DEVICE
sbp2_send_management_orb: orb->base.request_bus: 0x22375298
sbp2_send_orb 0x22375298
complete_transaction 0x22375298
sbp2_status_write: spin_lock_irqsave
sbp2_status_write: sync
sbp2_status_write: spin_unlock_irqrestore
complete_managment_orb 0x223752B8
sbp2_send_management_orb:wait_for_completion_timeout: 2997 , orb->done = 0 ; timeout = 196611
sbp2_cancel_orbs:
sbp2_send_management_orb: dma_unmap_single: DMA_TO_DEVICE
sbp2_send_management_orb: dma_unmap_single: DMA_FROM_DEVICE
sbp2_send_management_orb: memcpy size = 16
sbp2_send_management_orb: orb->response[0] = 0x1000
sbp2_send_management_orb: orb->response[1] = 0xFFFFC0FF
sbp2_send_management_orb: orb->response[2] = 0x10F0
sbp2_send_management_orb: orb->response[3] = 0x3000000**
***** Failed Run ******
sbp2_login: size of response: 16
sbp2_send_management_orb: dma_map_single: DMA_FROM_DEVICE
sbp2_send_management_orb: dev id: 0xD219E868
sbp2_send_management_orb: orb->response_bus: 0x224C4FB8 ;function: 0x0
sbp2_send_management_orb: lu->tgt->management_agent_address = 0xFFFFF0030000
sbp2_send_management_orb: dma_map_single: DMA_TO_DEVICE
sbp2_send_management_orb: orb->base.request_bus: 0x224C4F98
sbp2_send_orb 0x224C4F98
complete_transaction 0x224C4F98
sbp2_status_write: spin_lock_irqsave
sbp2_status_write: sync
sbp2_status_write: spin_unlock_irqrestore
complete_managment_orb 0x224C4FB8
sbp2_send_management_orb:wait_for_completion_timeout: 2997 , orb->done = 0 ; timeout = 196611
sbp2_cancel_orbs:
sbp2_send_management_orb: dma_unmap_single: DMA_TO_DEVICE
sbp2_send_management_orb: dma_unmap_single: DMA_FROM_DEVICE
sbp2_send_management_orb: memcpy size = 16
sbp2_send_management_orb: orb->response[0] = 0x1000
sbp2_send_management_orb: orb->response[1] = 0xFFFFC0FF
sbp2_send_management_orb: orb->response[2] = 0x0
sbp2_send_management_orb: orb->response[3] = 0x0**
free_orb 0x224C4F98
firewire_sbp2 fw1.0: logged in to LUN 0000 (0 retries)
sbp2_login: command_block_agent_address is 281470681743360 (FFFF00000000), generation is 4
sbp2_set_busy_timeout returned rcode 0x0 (no error)
sbp2_agent_reset: command_block_agent_address is FFFF00000000, generation is 4
sbp2_agent_reset returned rcode 0x7 (address error)