Ticket #2180: glamo_mci_send_request_time_detector.patch

File glamo_mci_send_request_time_detector.patch, 1.7 KB (added by Sascha, 9 years ago)
  • drivers/mfd/glamo/glamo-mci.c

    diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
    index e836913..d8d9bea 100644
    a b done: 
    398398        host->mrq = NULL; 
    399399        mmc_request_done(host->mmc, cmd->mrq); 
    400400        spin_unlock_irqrestore(&host->complete_lock, iflags); 
     401 
    401402} 
    402403 
    403404static void glamo_mci_irq(unsigned int irq, struct irq_desc *desc) 
    static int glamo_mci_prepare_pio(struct glamo_mci_host *host, 
    579580        return 0; 
    580581} 
    581582 
     583extern int iblock_limit; 
     584unsigned long s3c2410_gettimeoffset(void); 
     585 
    582586static void glamo_mci_send_request(struct mmc_host *mmc) 
    583587{ 
    584588        struct glamo_mci_host *host = mmc_priv(mmc); 
    static void glamo_mci_send_request(struct mmc_host *mmc) 
    590594        int n; 
    591595        int timeout = 1000000; 
    592596        int insanity_timeout = 1000000; 
     597        unsigned long us; 
    593598 
    594599        if (host->suspending) { 
    595600                dev_err(&host->pdev->dev, "IGNORING glamo_mci_send_request while " 
    static void glamo_mci_send_request(struct mmc_host *mmc) 
    644649         * we must spin until response is ready or timed out 
    645650         * -- we don't get interrupts unless there is a bulk rx 
    646651         */ 
     652 
     653        us = s3c2410_gettimeoffset(); 
     654 
    647655        do 
    648656                status = readw(host->base + GLAMO_REG_MMC_RB_STAT1); 
    649657        while (((((status >> 15) & 1) != (host->ccnt & 1)) || 
    static void glamo_mci_send_request(struct mmc_host *mmc) 
    653661                             GLAMO_STAT1_MMC_BWERR | 
    654662                             GLAMO_STAT1_MMC_BRERR)))) && (insanity_timeout--)); 
    655663 
     664        us = s3c2410_gettimeoffset() - us; 
     665        if (iblock_limit && us > iblock_limit && us < 10000000) 
     666                printk(KERN_ERR "glamo_mci_send_request: %lu us - %d polls\n", 
     667                        us, 1000000 - insanity_timeout); 
     668 
    656669        if (insanity_timeout < 0) 
    657670                dev_info(&host->pdev->dev, "command timeout, continuing\n"); 
    658671