Home > General > Drivers/mmc/host/sdhci.c

Drivers/mmc/host/sdhci.c

Comment 12 Fedora End Of Life 2013-04-03 11:37:24 EDT This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Scherschel 2011-09-15 16:39:33 EDT abrt version: 2.0.3 architecture: x86_64 cmdline: ro root=UUID=d08f3698-bc02-4389-9c6f-3ec878159e10 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de rhgb quiet comment: Inserted an SD card and tried to copy the We have to mask * the irq to prevent interrupt storm which will * freeze Sign in android / kernel / tegra / cb5a8eca514c0b57232d74e6626070022c6aa5c0 / . / drivers / mmc Then use the base clock. */ switch_base_clk = true; } } if (!host->clk_mul || switch_base_clk) { /* Version 3.00 divisors must be a multiple of 2. */ if (host->max_clk <= clock)

When doing hardware scatter/gather, each entry cannot * be larger than 64 KiB though. */ if (host->flags & SDHCI_USE_ADMA) { if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) mmc->max_seg_size = 65535; else mmc->max_seg_size = 65536; dma_unmap_sg_attrs.constprop.9+0x42/0x49 [sdhci] : [] sdhci_finish_data+0x1f4/0x212 [sdhci] : [] sdhci_irq+0x591/0x664 [sdhci] : [] handle_irq_event_percpu+0x53/0x1a5 : [] handle_irq_event+0x38/0x56 : [] ? If so, we need to execute * tuning procedure before sending command. */ if ((mrq->cmd->opcode != MMC_SEND_TUNING_BLOCK) && (mrq->cmd->opcode != MMC_SEND_TUNING_BLOCK_HS400) && (mrq->cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) && (host->flags & SDHCI_NEEDS_RETUNING) && !(present_state DMA_FROM_DEVICE : DMA_TO_DEVICE); if (sg_cnt == 0) { /* * This only happens when someone fed * us an invalid request. */ WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; } else { WARN_ON(sg_cnt !=

In the of the MSM SDHCI driver, it is releasing andre-acquiring the spinlock which is bad.Signed-off-by: Jon Hunter ---I have not attempted to fix the MSM driver in this seris, but That makes the register entirely useless to read * back so we have to assume that nothing made it to the card * in the event of an error. */ if SDHCI_INT_CARD_REMOVE : SDHCI_INT_CARD_INSERT; } else { host->ier &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT); } sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } static void sdhci_enable_card_detection(struct sdhci_host *host) { sdhci_set_card_detection(host, true); } static void sdhci_disable_card_detection(struct

  • Thus vendor sdhci driver can implement its own set_ios() routine.
  • pm_runtime_suspended(mmc->parent) : 0)) return true; else return false;}static bool sdhci_check_auto_tuning(struct sdhci_host *host, struct mmc_command *cmd){ if (((cmd->opcode != MMC_READ_SINGLE_BLOCK) && (cmd->opcode != MMC_READ_MULTIPLE_BLOCK) && (cmd->opcode != SD_IO_RW_EXTENDED)) || (host->clock < 100000000))
  • Otherwise, we bail out. */ if (host->preset_enabled != enable) { u16 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); if (enable) ctrl |= SDHCI_CTRL_PRESET_VAL_ENABLE; else ctrl &= ~SDHCI_CTRL_PRESET_VAL_ENABLE; sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); if (enable) host->flags |=
  • Cheers, T.
  • From: Hu Ziji Export sdhci_set_ios() in sdhci.c.
  • although not very often.
  • Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs.

The hardware may take * longer to time out, but that's much better than having a too-short * timeout value. */ if (host->quirks & SDHCI_QUIRK_BROKEN_TIMEOUT_VAL) return 0xE; /* Unspecified timeout, assume So we set the block size * to 64 here. */ if ((cmd.opcode == MMC_SEND_TUNING_BLOCK_HS400) || (cmd.opcode == MMC_SEND_TUNING_BLOCK_HS200)) { if (mmc->ios.bus_width == MMC_BUS_WIDTH_8) sdhci_set_blk_size_reg(host, 128, 7); else if (mmc->ios.bus_width == Make sure we do * things in the proper order. */ host->data_early = 1; } else { sdhci_finish_data(host); } } } } static irqreturn_t sdhci_irq(int irq, void *dev_id) { irqreturn_t result early_idt_handlers+0x140/0x140 : [] x86_64_start_kernel+0x102/0x111 Comment 1 Thomas Jürges 2011-09-16 05:54:00 EDT Package: kernel Architecture: x86_64 OS Release: Fedora release 15 (Lovelock) Comment ----- Copied files from hard drive to sd-card and

After trying to copy another, the errors started again and the copy didn't happen. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19 Comment 13 Justin M. SDHCI * tuning command does not have a data payload (or rather the hardware does it * automatically) so mmc_send_tuning() will return -EIO. I put a sdcard in the reader, unmounted with disk manager, then ran photorec from gnome-terminal.

Boards that support * 8-bit width must set "mmc->caps |= MMC_CAP_8_BIT_DATA;" in * their platform code before calling sdhci_add_host(), and we * won't assume 8-bit width for hosts without that CAP. Resetting * it on each ios seems to solve the problem. */ if(host->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS) sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); /* * Reset the chip on each power off. * Should clear MMC_SEND_TUNING_BLOCK_HS200 : MMC_SEND_TUNING_BLOCK; host->mrq = NULL; host->flags &= ~SDHCI_NEEDS_RETUNING; spin_unlock_irqrestore(&host->lock, flags); if (mmc_card_hs400_strobe(mmc->card)) sdhci_enhanced_strobe(mmc); else sdhci_execute_tuning(mmc, tuning_opcode); spin_lock_irqsave(&host->lock, flags); /* Restore original mmc_request structure */ host->mrq = mrq; } } if mmc_hostname(host->mmc) : "null", __func__); host->disable_sdio_irq_deferred = true; return; } if (enable) host->flags |= SDHCI_SDIO_IRQ_ENABLED; else host->flags &= ~SDHCI_SDIO_IRQ_ENABLED; /* SDIO IRQ will be enabled as appropriate in runtime resume */ if

SDHCI_INT_CARD_REMOVE : SDHCI_INT_CARD_INSERT; if (enable) sdhci_unmask_irqs(host, irqs); else sdhci_mask_irqs(host, irqs);}static void sdhci_enable_card_detection(struct sdhci_host *host){ sdhci_set_card_detection(host, true);}static void sdhci_disable_card_detection(struct sdhci_host *host){ sdhci_set_card_detection(host, false);}static void sdhci_reset(struct sdhci_host *host, u8 mask){ unsigned long timeout; paravirt_read_tsc+0x9/0xd [] mmc_blk_issue_rq+0x26a/0x28d [mmc_block] [] ? Message ID Download mbox | patch Permalink /patch/9654545/ State New Headers show Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1F2860349 for ; Thu, 30 target_timeout is in us. * Hence, us = 1000000 * cycles / Hz.

This varies from controller to controller and * is specified in the capabilities register. */ if (host->quirks & SDHCI_QUIRK_FORCE_BLK_SZ_2048) { mmc->max_blk_size = 2; } else { mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) Some controllers don't seem to like this though. */ if (!(host->quirks & SDHCI_QUIRK_SINGLE_POWER_WRITE)) { sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); if (host->ops->check_power_status) host->ops->check_power_status(host, REQ_BUS_OFF); } /* * At least the Marvell CaFe chip gets Some controllers don't seem to like this though. */ if (!(host->quirks & SDHCI_QUIRK_SINGLE_POWER_WRITE)) sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); /* * At least the Marvell CaFe chip gets confused if we set the voltage If you take it out, and insert the SDCARD afterwards, then no problem. -gc Comment 11 Josh Boyer 2012-06-06 15:59:51 EDT If it's happening in 3.5.x kernels, can you please report

intel_idle+0xba/0x100 : [] cpuidle_idle_call+0xd7/0x168 : [] cpu_idle+0xa5/0xdf : [] rest_init+0x72/0x74 : [] start_kernel+0x3ca/0x3d5 : [] x86_64_start_reservations+0xaf/0xb3 : [] ? Home | New | Search | [?] | Reports | Requests | Help | NewAccount | Log In [x] | Forgot Password Login: [x] | Report Bugzilla Bug Legal JMicron) can't do PIO properly when the selection * is ADMA. */ if (host->version >= SDHCI_SPEC_200) { ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); ctrl &= ~SDHCI_CTRL_DMA_MASK; if ((host->flags & SDHCI_REQ_USE_DMA) && (host->flags & hosted at Digital OceanAdvertise on this site 

SDHCI_INT_CARD_REMOVE : SDHCI_INT_CARD_INSERT; } else { host->ier &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT); } sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } static void sdhci_enable_card_detection(struct sdhci_host *host) { sdhci_set_card_detection(host, true); } static void sdhci_disable_card_detection(struct sched_clock_cpu+0x42/0xc6 : [] handle_fasteoi_irq+0x77/0x9b : [] handle_irq+0x88/0x8e : [] do_IRQ+0x4d/0xa5 : [] common_interrupt+0x13/0x13 : [] ? I put the card back in to copy files to it, it auto-mounted, and I copied one file successfully.

Round up. */ val = 1000000ULL * data->timeout_clks; if (do_div(val, host->clock)) target_timeout++; target_timeout += val; } } /* * Figure out needed cycles. * We do this in steps in order

arch_local_irq_restore+0x6/0xd [] ? host->ops->get_max_timeout_count(host) : 1 << 27; host->mmc->max_busy_timeout /= host->timeout_clk; } } if (host->ops->set_power) host->ops->set_power(host, ios->power_mode, ios->vdd); else sdhci_set_power(host, ios->power_mode, ios->vdd); if (host->ops->platform_send_init_74_clocks) host->ops->platform_send_init_74_clocks(host, ios->power_mode); host->ops->set_bus_width(host, ios->bus_width); ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); if ((ios->timing But * to make sure we don't hit a controller bug, we _only_ * enable Buffe Skip to content Ignore Learn more Please note that GitHub no longer supports old swiotlb_unmap_sg_attrs+0x3c/0x58 : [] ?

kthread_worker_fn+0x148/0x148 [] ? The hardware may take * longer to time out, but that's much better than having a too-short * timeout value. */ if (host->quirks & SDHCI_QUIRK_BROKEN_TIMEOUT_VAL) return 0xE; /* Unspecified timeout, assume That makes the register entirely useless to read * back so we have to assume that nothing made it to the card * in the event of an error. */ if Could be one segment with the maximum number * of bytes.

Status: CLOSED INSUFFICIENT_DATA Aliases: None Product: Fedora Classification: Fedora Component: kernel (Show other bugs) Sub Component: --- Version: 19 Hardware: x86_64 Unspecified Priority unspecified Severity unspecified TargetMilestone: --- TargetRelease: --- Assigned drivers/mmc/host/sdhci.c | 3 +++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 5 insertions(+)diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.cindex 6fdd7a70f229..b7f1521edbec 100644--- a/drivers/mmc/host/sdhci.c+++ b/drivers/mmc/host/sdhci.c@@ -1579,6 +1579,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) Falling back to PIO.\n", mmc_hostname(mmc)); host->flags &= ~(SDHCI_USE_SDMA | SDHCI_USE_ADMA); } } } if (host->flags & SDHCI_USE_ADMA) { /* * We need to allocate descriptors for all sg entries * (128) Hence, during * MMC_POWER_UP enable the controller clock and turn-on the regulators. * The mmc_power_up would provide the necessary delay before turning on * the clocks to the card. */ if

Make sure we do * things in the proper order. */ host->data_early = 1; } else { sdhci_finish_data(host); } } }}static irqreturn_t sdhci_irq(int irq, void *dev_id){ irqreturn_t result; struct sdhci_host* host Features Business Explore Marketplace Pricing This repository Sign in or Sign up Watch 5,657 Star 47,295 Fork 17,815 torvalds/linux Code Pull requests 153 Projects 0 Insights Pulse Graphs Permalink Branch: Comment 3 Thomas Jürges 2011-09-17 17:13:35 EDT I just remembered that I did everything (mount, copy, umount) through KDE 4 when this happened and it was not the first oops of Some controllers don't seem to like this though. */ if (!(host->quirks & SDHCI_QUIRK_SINGLE_POWER_WRITE)) sdhci_writeb(host, 0, SDHCI_POWER_CONTROL); /* * At least the Marvell CaFe chip gets confused if we set the *

INSERT * bit will be immediately set again when it gets * cleared, if a card is inserted. Signed-off-by: Hu Ziji Signed-off-by: Gregory CLEMENT Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 3 ++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) Patch diff --git Cheers, T. os_release: Fedora release 15 (Lovelock) package: kernel reason: WARNING: at drivers/mmc/host/sdhci.c:934 sdhci_send_command+0x37/0x88a [sdhci]() time: Thu Sep 15 22:35:15 2011 backtrace: :WARNING: at drivers/mmc/host/sdhci.c:934 sdhci_send_command+0x37/0x88a [sdhci]() :Hardware name: 12942PG :Modules linked in:

It is upper layer's * responsibility to send the stop command if required. */ if (data->mrq->cap_cmd_during_tfr) { sdhci_finish_mrq(host, data->mrq); } else { /* Avoid triggering warning in sdhci_send_command() */ host->cmd = Resetting * it on each ios seems to solve the problem. */ if(host->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS) sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);out: mmiowb(); spin_unlock_irqrestore(&host->lock, flags);}static int sdhci_get_ro(struct mmc_host *mmc){ struct sdhci_host *host; unsigned long Resetting * it on each ios seems to solve the problem. */ if (host->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS) sdhci_do_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); mmiowb(); } EXPORT_SYMBOL_GPL(sdhci_set_ios); static int sdhci_get_cd(struct mmc_host *mmc) { struct sdhci_host DMA_FROM_DEVICE : DMA_TO_DEVICE); } } /* * The specification states that the block count register must * be updated, but it does not specify at what point in the * data