struct meson_host {
struct device *dev;
struct mmc_host *mmc;
- struct mmc_request *mrq;
struct mmc_command *cmd;
spinlock_t lock;
{
struct meson_host *host = mmc_priv(mmc);
- WARN_ON(host->mrq != mrq);
-
- host->mrq = NULL;
host->cmd = NULL;
mmc_request_done(host->mmc, mrq);
}
{
struct meson_host *host = mmc_priv(mmc);
- WARN_ON(host->mrq != NULL);
-
/* Stop execution */
writel(0, host->regs + SD_EMMC_START);
- host->mrq = mrq;
-
if (mrq->sbc)
meson_mmc_start_cmd(mmc, mrq->sbc);
else
static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
{
struct meson_host *host = dev_id;
- struct mmc_request *mrq;
struct mmc_command *cmd;
u32 irq_en, status, raw_status;
irqreturn_t ret = IRQ_HANDLED;
cmd = host->cmd;
- mrq = host->mrq;
-
- if (WARN_ON(!mrq))
- return IRQ_NONE;
-
if (WARN_ON(!cmd))
return IRQ_NONE;
else {
dev_warn(host->dev, "Unknown IRQ! status=0x%04x: MMC CMD%u arg=0x%08x flags=0x%08x stop=%d\n",
status, cmd->opcode, cmd->arg,
- cmd->flags, mrq->stop ? 1 : 0);
+ cmd->flags, cmd->mrq->stop ? 1 : 0);
if (cmd->data) {
struct mmc_data *data = cmd->data;
static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
{
struct meson_host *host = dev_id;
- struct mmc_request *mrq = host->mrq;
struct mmc_command *cmd = host->cmd;
struct mmc_data *data;
unsigned int xfer_bytes;
- if (WARN_ON(!mrq))
- return IRQ_NONE;
-
if (WARN_ON(!cmd))
return IRQ_NONE;
}
meson_mmc_read_resp(host->mmc, cmd);
- if (!data || !data->stop || mrq->sbc)
- meson_mmc_request_done(host->mmc, mrq);
+ if (!data || !data->stop || cmd->mrq->sbc)
+ meson_mmc_request_done(host->mmc, cmd->mrq);
else
meson_mmc_start_cmd(host->mmc, data->stop);