From patchwork Wed Feb 25 18:11:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5882261 Return-Path: X-Original-To: patchwork-linux-rockchip@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 11BBFBF440 for ; Wed, 25 Feb 2015 18:13:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CEAE2034F for ; Wed, 25 Feb 2015 18:13:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B03A2028D for ; Wed, 25 Feb 2015 18:13:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQgSC-0003Bj-K6; Wed, 25 Feb 2015 18:13:00 +0000 Received: from mail-ie0-x233.google.com ([2607:f8b0:4001:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQgRh-0002zE-HZ for linux-rockchip@lists.infradead.org; Wed, 25 Feb 2015 18:12:30 +0000 Received: by iecrl12 with SMTP id rl12so7220689iec.4 for ; Wed, 25 Feb 2015 10:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YBOPYWCOK6VNYQafW758ppHkXggj6bkxqbwxnT2jP4E=; b=imSz8QUZdswzmaRAg57OQjk/VMMiGmuPsUu5cWD6X9eEsrse4bc+XNujYzG2offYuL QtVpQm6Uq6Bf2czKQ4BjyFMm2xR/K8hNUz9tkI+U6dmpYP7MARNj50Yoez4dz31jtIkT lDXvWOyNa7bXuTqlg+MHvY2pt9eYiWK5PKfxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YBOPYWCOK6VNYQafW758ppHkXggj6bkxqbwxnT2jP4E=; b=C3tp480MxpTE5HVdcnA5WdNE8ZeWBpiKHvdkDnS552PqrE0k3j+J7WP5kTWoeP9r4A a/V1pP/S7GAQc2QSsZCcxyz/JX6oF6VwYP7Azeo4c3rUAAB2GgM9S3GIu7bfG+qiVn7g jicbd4+XSmVXScW4SAeWLKFc3HajWL9MM42YCSGooW6LOiQvzPkI/7UefgRIh4jjQt2y 2k2NiAF+Px9B4Iu5PBkUqqrGIWFiMMUvSz0q/Fs44yetqFL1ECLO26byqxZPv8bef3x4 44CAzxrHUV/Jz2SpbRD3l7S5V+DeA4ceB/crwWW0lkUN/jDGDT99Iz6OiuXZltOBbRDZ RjSw== X-Gm-Message-State: ALoCoQlNiDCAgSeVX40OKpRnSQKizljhIHB0pJ+gcnVb04U3wOyZLGHDiyMU2GnfvMY5yd35T3mT X-Received: by 10.50.131.196 with SMTP id oo4mr6514806igb.2.1424887927372; Wed, 25 Feb 2015 10:12:07 -0800 (PST) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id i16sm11972202ioe.17.2015.02.25.10.12.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 10:12:06 -0800 (PST) From: Doug Anderson To: Jaehoon Chung , Seungwon Jeon , Ulf Hansson Subject: [PATCH 2/2] mmc: dw_mmc: Don't crash if we get an interrupt before slot has initted Date: Wed, 25 Feb 2015 10:11:52 -0800 Message-Id: <1424887912-20015-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1424887912-20015-1-git-send-email-dianders@chromium.org> References: <1424887912-20015-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150225_101229_682435_4427BE6E X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: -0.8 (/) Cc: Addy Ke , Heiko Stuebner , Andrew Bresticker , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Doug Anderson , chris@printf.net, linux-rockchip@lists.infradead.org, Alim Akhtar , Sonny Rao , javier.martinez@collabora.co.uk, linux-arm-kernel@lists.infradead.org, Alexandru Stan X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, 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 It's unlikely that this is really needed on any single-slot systems where we disable card detects until the end of probe, but it still seems safer to check to make sure that a slot has been initted before we try to dereference it to find the SDIO interrupt mask. Signed-off-by: Doug Anderson Tested-by: Javier Martinez Canillas --- drivers/mmc/host/dw_mmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 8df2a92..1c909ad 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2156,6 +2156,10 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) /* Handle SDIO Interrupts */ for (i = 0; i < host->num_slots; i++) { struct dw_mci_slot *slot = host->slot[i]; + + if (!slot) + continue; + if (pending & SDMMC_INT_SDIO(slot->sdio_id)) { mci_writel(host, RINTSTS, SDMMC_INT_SDIO(slot->sdio_id));