Skip to contentSkip to conversation

Query regarding ADMA descriptor allocation

DISCUSSION Asutosh Das 2 participants 3 messages Jan 11, 2013 – Jan 15, 2013 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Hi
In sdhci_add_host function, the number of adma descriptors allocated are 128 and each descriptor consumes 8 bytes and 1 4byte is added in the end like, kmalloc((128 * 2 + 1) * 4, GFP_KERNEL);

In sdhci_adma_table_pre function, each node in sg-list is iterated and in case of a misaligned node, a descriptor is consumed, which means for a single sg-node 2 descriptors were consumed. Let's say in a situation, where there are multiple unaligned addresses in multiple sg nodes and the sg-list length is 128, wouldn't this use up all the 128 descriptors long before the entire sg-list is traversed ?

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw

Hi
Can you please let me know if my understanding in the below question is correct ?

Thanks
Asutosh

Quoted 9 lines · Asutosh Das

Hi
In sdhci_add_host function, the number of adma descriptors allocated are 128 and each descriptor consumes 8 bytes and 1 4byte is added in the end like, kmalloc((128 * 2 + 1) * 4, GFP_KERNEL);

In sdhci_adma_table_pre function, each node in sg-list is iterated and in case of a misaligned node, a descriptor is consumed, which means for a single sg-node 2 descriptors were consumed. Let's say in a situation, where there are multiple unaligned addresses in multiple sg nodes and the sg-list length is 128, wouldn't this use up all the 128 descriptors long before the entire sg-list is traversed ?

Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#2 lore raw

Hi Chris,

Can anyone from SDHCi confirm if the understanding below is correct or not? If it is than we can post a patch to fix it.

Regards,
Subhash

Quoted 18 lines · Asutosh Das

Hi
Can you please let me know if my understanding in the below question is correct ?

Thanks
Asutosh

Quoted 9 lines · Asutosh Das

Hi
In sdhci_add_host function, the number of adma descriptors allocated are 128 and each descriptor consumes 8 bytes and 1 4byte is added in the end like, kmalloc((128 * 2 + 1) * 4, GFP_KERNEL);

In sdhci_adma_table_pre function, each node in sg-list is iterated and in case of a misaligned node, a descriptor is consumed, which means for a single sg-node 2 descriptors were consumed. Let's say in a situation, where there are multiple unaligned addresses in multiple sg nodes and the sg-list length is 128, wouldn't this use up all the 128 descriptors long before the entire sg-list is traversed ?