{"action":"created","issue":{"url":"https://api.github.com/repos/jeremytrimble/ezdma/issues/2","labels_url":"https://api.github.com/repos/jeremytrimble/ezdma/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jeremytrimble/ezdma/issues/2/comments","events_url":"https://api.github.com/repos/jeremytrimble/ezdma/issues/2/events","html_url":"https://github.com/jeremytrimble/ezdma/issues/2","id":122412660,"number":2,"title":"read() throws error when transfer size is 1 MB","user":{"login":"farzadfch","id":8872058,"avatar_url":"https://avatars.githubusercontent.com/u/8872058?v=3","gravatar_id":"","url":"https://api.github.com/users/farzadfch","html_url":"https://github.com/farzadfch","followers_url":"https://api.github.com/users/farzadfch/followers","following_url":"https://api.github.com/users/farzadfch/following{/other_user}","gists_url":"https://api.github.com/users/farzadfch/gists{/gist_id}","starred_url":"https://api.github.com/users/farzadfch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farzadfch/subscriptions","organizations_url":"https://api.github.com/users/farzadfch/orgs","repos_url":"https://api.github.com/users/farzadfch/repos","events_url":"https://api.github.com/users/farzadfch/events{/privacy}","received_events_url":"https://api.github.com/users/farzadfch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-16T02:24:16Z","updated_at":"2016-01-12T13:47:11Z","closed_at":null,"body":"Hi Jeremy,\r\n\r\nI am using ezdma with Xilinx AXI DMA. When I try to initiate a 1 MB read transfer, ezdma throws this error:\r\nezdma: loop_rx: dmaengine_prep_slave_sg() failed\r\n\r\nI traced the error back to xilinx_dma_alloc_tx_segment() which is called by xilinx_dma_prep_slave_sg(). This function returns NULL (free_seg_list is empty?).  I also tried to find the maximum possible size. It turns out to be 1 MB minus 8192 bytes.\r\n\r\nAny idea on this? Is it a Xilinx driver issue or ezdma one?\r\nDoes it happen to have a relation with the maximum number of descriptors \"XILINX_DMA_NUM_DESCS\" defined in the Xilinx driver?\r\n\r\nBest,\r\nFarzad"},"comment":{"url":"https://api.github.com/repos/jeremytrimble/ezdma/issues/comments/170916017","html_url":"https://github.com/jeremytrimble/ezdma/issues/2#issuecomment-170916017","issue_url":"https://api.github.com/repos/jeremytrimble/ezdma/issues/2","id":170916017,"user":{"login":"jeremytrimble","id":1209303,"avatar_url":"https://avatars.githubusercontent.com/u/1209303?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremytrimble","html_url":"https://github.com/jeremytrimble","followers_url":"https://api.github.com/users/jeremytrimble/followers","following_url":"https://api.github.com/users/jeremytrimble/following{/other_user}","gists_url":"https://api.github.com/users/jeremytrimble/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremytrimble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremytrimble/subscriptions","organizations_url":"https://api.github.com/users/jeremytrimble/orgs","repos_url":"https://api.github.com/users/jeremytrimble/repos","events_url":"https://api.github.com/users/jeremytrimble/events{/privacy}","received_events_url":"https://api.github.com/users/jeremytrimble/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T13:47:11Z","updated_at":"2016-01-12T13:47:11Z","body":"Farzad,\r\n\r\nYes, the way ezdma and the AXI DMA driver are written currently, the size passed to read() must equal the size of the AXI Stream packet (which thus must be known in advance).  Unfortunately it's not easy to recognize when less than the expected amount of data has arrived (how would the AXI DMA \"know\" that more data wasn't coming?).\r\n\r\nPerhaps ezdma could be modified to make use of the new \"residue querying\" functionality in the dmaengine API (if the AXI DMA driver's residue support works -- I haven't tested it myself).  However, this would still probably only allow descriptor-level resolution on short reads."}}