From patchwork Sun Feb 15 14:46:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 5830181 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC8E6BF440 for ; Sun, 15 Feb 2015 14:47:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B933202A1 for ; Sun, 15 Feb 2015 14:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63F6C2022D for ; Sun, 15 Feb 2015 14:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755138AbbBOOrl (ORCPT ); Sun, 15 Feb 2015 09:47:41 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:56620 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754998AbbBOOrl (ORCPT ); Sun, 15 Feb 2015 09:47:41 -0500 Received: by mail-pa0-f51.google.com with SMTP id eu11so29450986pac.10; Sun, 15 Feb 2015 06:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Pc0rKKpdtFMRNl6WjLKFxB9PNHvr/IGR+wZcGBXI8DQ=; b=RaEBE2NZL5CbN5fijZtBpIBOhlIrkK/dWXV5d7XflIO16CfY5FXoHoCZAtFY6H5aiU T98ftRfPi5xWqAGay/xmOYHoIoiSCVdnfVd0iF3HoquhOTT3p0qZ672+UrOpEIREY4AK dU7dO76Wmo3I8H7pPmgayN2BuzMQMOkEOUN8Du5MrRR+MO3jeBozpGFwOI/iwS0e+NlY IY2jcWgR1mXyrqtrYb1dPdtmVq2MVFoOh8JRp00TpHnANj7R97mqpwst/56SoA9xmO/v X9QOD+zO0LVRcevukbyZFiIvUo2WZOoFkp1NsmQeKIvwTbbsmBtn8F+xP+Rbey69yRT9 J9AA== X-Received: by 10.70.56.102 with SMTP id z6mr22625295pdp.18.1424011660673; Sun, 15 Feb 2015 06:47:40 -0800 (PST) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by mx.google.com with ESMTPSA id d11sm12061752pdk.26.2015.02.15.06.47.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Feb 2015 06:47:39 -0800 (PST) From: Yoshihiro Kaneko To: linux-mmc@vger.kernel.org Cc: Chris Ball , Ulf Hansson , Simon Horman , Magnus Damm , Kuninori Morimoto , linux-sh@vger.kernel.org Subject: [PATCH/RFC] mmc: sh_mmcif: Move dev_err() of mmcif_timeout_work() Date: Sun, 15 Feb 2015 23:46:47 +0900 Message-Id: <1424011607-3682-2-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kouichi Tomita If interruption of command already occurred, mrq pointer in dev_err() would refer to NULL, because the host-state is changed to STATE_IDLE and mrq pointer is changed to NULL by interrupt handler. Therefore dev_err is moved after checking STATE_IDLE. Signed-off-by: Kouichi Tomita Signed-off-by: Yoshihiro Kaneko --- This patch is based on next branch of Chris Ball's mmc tree. drivers/mmc/host/sh_mmcif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 7d9d6a3..e075804 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1312,15 +1312,15 @@ static void mmcif_timeout_work(struct work_struct *work) /* Don't run after mmc_remove_host() */ return; - dev_err(&host->pd->dev, "Timeout waiting for %u on CMD%u\n", - host->wait_for, mrq->cmd->opcode); - spin_lock_irqsave(&host->lock, flags); if (host->state == STATE_IDLE) { spin_unlock_irqrestore(&host->lock, flags); return; } + dev_err(&host->pd->dev, "Timeout waiting for %u on CMD%u\n", + host->wait_for, mrq->cmd->opcode); + host->state = STATE_TIMEOUT; spin_unlock_irqrestore(&host->lock, flags);