This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x system hang issue after removing sdcard while copying files to sdcard

Other Parts Discussed in Thread: TMDXEVM3358

Hi Sir 

we use sdk6.0 in GP-EVM  for development and copy one big file(about 8M)  from SDcard-A to SDcard-B.

at this moment, we remove SDcard-B from MMC1 interface. System will be in stuck without no message output

SW Setting is listed as below 

static void mmc1_init(int evm_id, int profile)
{
setup_pin_mux(mmc1_common_pin_mux);
setup_pin_mux(mmc1_dat4_7_pin_mux);
setup_pin_mux(mmc1_wp_only_pin_mux);
setup_pin_mux(mmc1_cd_only_pin_mux);

am335x_mmc[1].mmc = 2;

am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA ;
am335x_mmc[1].gpio_cd = GPIO_TO_PIN(2, 2);
am335x_mmc[1].gpio_wp = GPIO_TO_PIN(1, 29);

am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */

/* mmc will be initialized when mmc0_init is called */
return;
}

and log message is showed as below.

root@am335x-evm:/bootmode/mp3# mount /dev/mmcblk1p1 /mmc1/
root@am335x-evm:/bootmode/mp3# cp * /mmc1/.

BTW, we have another MBs which has MMC1 interface without CD pin. we use above method to reproduce this issue. It also has the same phenomenon.

SW Setting is listed as below 

static void mmc1_init(int evm_id, int profile)
{
setup_pin_mux(mmc1_common_pin_mux);
setup_pin_mux(mmc1_dat4_7_pin_mux);
setup_pin_mux(mmc1_wp_only_pin_mux);
setup_pin_mux(mmc1_cd_only_pin_mux);

am335x_mmc[1].mmc = 2;
am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NEEDS_POLL;
am335x_mmc[1].gpio_cd = -EINVAL;
am335x_mmc[1].gpio_wp = -EINVAL;

am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */

/* mmc will be initialized when mmc0_init is called */
return;
}

and log message is showed as below.

root@am335x-evm:/bootmode/mp3# mount /dev/mmcblk1p1 /mmc1/
root@am335x-evm:/bootmode/mp3# cp * /mmc1/

Does anyone meet this issue ?  have any patch or experience to fix this issue ? 

thanks for reply.

BR

Yimin

  • I will forward this to the SW team.
  • Hi Yimin,

    If I understand correctly, you have 2 sdcard slots on your board, right?
    Can you share the board-file modifications?

    Also I see you have another thread for an sdcard issue: e2e.ti.com/.../1581159. I would again advise you to check the driver from the latest kernel.

    Best Regards,
    Yordan
  • Hi Sir

    We use TI General-Purpose EVM (TMDXEVM3358)  to duplicate this issue in SDK 6.0 with profile2 setting( which supports 2 MMC interface)

    So there is no modification in my site. it is TI original design EVM.

    No matter what we modify in the file like below , this issue still happen and cause system hanging  

    a.)  add MMC_CAP_NEEDS_POLL setting 

    b.) define  am335x_mmc[1].gpio_cd = GPIO_TO_PIN(2, 2); 

    i think the point is that we write data into sdcard and at this moment we remove it . system cannot detect this event immediately and cause system hanging.

    Could you provide the suggestion how to fix this issue ?  

    BR

    Yimin