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: 5882291 Return-Path: X-Original-To: patchwork-linux-arm@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 EAB36BF440 for ; Wed, 25 Feb 2015 18:15:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E38120353 for ; Wed, 25 Feb 2015 18:15:38 +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 3F4E02028D for ; Wed, 25 Feb 2015 18:15:33 +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 1YQgRz-000384-UQ; Wed, 25 Feb 2015 18:12:47 +0000 Received: from mail-ie0-x235.google.com ([2607:f8b0:4001:c03::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQgRh-0002zD-Is for linux-arm-kernel@lists.infradead.org; Wed, 25 Feb 2015 18:12:30 +0000 Received: by iecat20 with SMTP id at20so7158036iec.12 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=JFOr+6VzDt7JLvESTHC2sLwG6OZCD/+vPIIA3vw8dK0ebhwxGoDohGxB69ldgTnfLZ FvoFTTx8pxEqliGsAEeaDQjdAILt8S87eMVVsrAZFt+pcMpTK0Ima0g+ycyMdM+nLPGz kjWrUyssa7bwFTvlrcY3BjaD6nQlFHWWIwUR8GA957LovMBzsxURpm6cIGvmx5UeUnFf wipckD+KXfmzZQc54ChYMoOjJzPj4O/d9WZHddjVboeSqMqCAPqmV5c6dfMeFEM8O8y2 aE+h+4hdPYfmTDrj/znOdxxsGiaTqtLfdhftVjHKguhAuOCe31WYmnFMBcGf518nxiHf Lb+g== X-Gm-Message-State: ALoCoQm3Ws9y24B5AeDG2VYXmcmqJ0SogK17Y1CiaFDVufhElQf0nlgczb7oZXdeUcm9wR2T6/0P 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_708239_6B965DE6 X-CRM114-Status: GOOD ( 11.62 ) 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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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));