SAMV7 HSCMI: Don't assert of the data buffer is unaligned. Instead, return -EFAULT. This will allow the FAT file system to utilize the CONFIG_FAT_DMAMEMORY option and fix the problem from the file system
This commit is contained in:
parent
1446784fbd
commit
08f0086771
@ -2931,18 +2931,20 @@ static int sam_dmarecvsetup(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer,
|
|||||||
|
|
||||||
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
|
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
|
||||||
|
|
||||||
#ifdef CONFIG_SAMV7_HSMCI_UNALIGNED
|
|
||||||
/* 32-bit buffer alignment is required for DMA transfers */
|
/* 32-bit buffer alignment is required for DMA transfers */
|
||||||
|
|
||||||
if (((uintptr_t)buffer & 3) != 0 || (buflen & 3) != 0)
|
if (((uintptr_t)buffer & 3) != 0 || (buflen & 3) != 0)
|
||||||
{
|
{
|
||||||
/* Fall back and do a non-DMA transfer */
|
#ifdef CONFIG_SAMV7_HSMCI_UNALIGNED
|
||||||
|
/* Fall back and do an unaligned, non-DMA transfer */
|
||||||
|
|
||||||
return sam_recvsetup(dev, buffer, buflen);
|
return sam_recvsetup(dev, buffer, buflen);
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
DEBUGASSERT(((uint32_t)buffer & 3) == 0 && (buflen & 3) == 0);
|
/* Return the -EFAULT error. */
|
||||||
|
|
||||||
|
return -EFAULT;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* How many blocks? That should have been saved by the sam_blocksetup()
|
/* How many blocks? That should have been saved by the sam_blocksetup()
|
||||||
* method earlier.
|
* method earlier.
|
||||||
@ -3039,18 +3041,21 @@ static int sam_dmasendsetup(FAR struct sdio_dev_s *dev,
|
|||||||
|
|
||||||
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
|
DEBUGASSERT(priv != NULL && buffer != NULL && buflen > 0);
|
||||||
|
|
||||||
#ifdef CONFIG_SAMV7_HSMCI_UNALIGNED
|
|
||||||
/* 32-bit buffer alignment is required for DMA transfers */
|
/* 32-bit buffer alignment is required for DMA transfers */
|
||||||
|
|
||||||
if (((uintptr_t)buffer & 3) != 0 || (buflen & 3) != 0)
|
if (((uintptr_t)buffer & 3) != 0 || (buflen & 3) != 0)
|
||||||
{
|
{
|
||||||
/* Fall back and do a non-DMA transfer */
|
#ifdef CONFIG_SAMV7_HSMCI_UNALIGNED
|
||||||
|
/* Fall back and do an unaligned, non-DMA transfer */
|
||||||
|
|
||||||
return sam_sendsetup(dev, buffer, buflen);
|
return sam_sendsetup(dev, buffer, buflen);
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
DEBUGASSERT(((uint32_t)buffer & 3) == 0 && (buflen & 3) == 0);
|
/* Return the -EFAULT error. */
|
||||||
|
|
||||||
|
return -EFAULT;
|
||||||
#endif
|
#endif
|
||||||
|
/* Fall back and do a non-DMA transfer */
|
||||||
|
}
|
||||||
|
|
||||||
/* How many blocks? That should have been saved by the sam_blocksetup()
|
/* How many blocks? That should have been saved by the sam_blocksetup()
|
||||||
* method earlier.
|
* method earlier.
|
||||||
|
Loading…
Reference in New Issue
Block a user