[U-Boot-Users] Possible Bug in at32ap mmc driver atmel_mci.c

Gururaja Hebbar K R gururajakr at sanyo.co.in
Tue Mar 18 01:32:13 CET 2008


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




More information about the U-Boot mailing list