Skip to contentSkip to conversation

Possible Bug in at32ap mmc driver atmel_mci.c

U-Boot-Users Gururaja Hebbar K R 1 participant 1 message Mar 18, 2008 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi,

I am trying to port mmc driver to my board with little assistance from atmel_mci driver. While i was trying to understand the mmc_cmd function, i think i found a bug in it.

File -> uboot-1.3.1\cpu\at32ap\atmel_mci.c

Function ->
static int
mmc_cmd(unsigned long cmd, unsigned long arg,
void *resp, unsigned long flags)

In Function, mmc_cmd , variable "error_flags" is 1st assigned to ERROR_FLAGS and then modified according to response type.

	error_flags = ERROR_FLAGS;
	if (!(flags & RESP_NO_CRC))
		error_flags |= MMCI_BIT(RCRCE);

However once the command is sent and a response is received, the driver checks for status

	if (status & ERROR_FLAGS) {
		printf("mmc: command %lu failed (status: 0x%08lx)\n",
		       cmd, status);
		return -EIO;
	}

But here, it checks for ERROR_FLAGS, while i think it was suppose to check for error_flags.

Kindly correct me if i am wrong.

Thanks in advance

Regards
Gururaja