From patchwork Wed Aug 22 18:22:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10573145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DF1C14E1 for ; Wed, 22 Aug 2018 18:22:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1165428B6A for ; Wed, 22 Aug 2018 18:22:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 057872BB03; Wed, 22 Aug 2018 18:22:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F418D2A668 for ; Wed, 22 Aug 2018 18:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbeHVVs1 (ORCPT ); Wed, 22 Aug 2018 17:48:27 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42654 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727786AbeHVVs0 (ORCPT ); Wed, 22 Aug 2018 17:48:26 -0400 Received: by mail-lf1-f65.google.com with SMTP id z11-v6so2079476lff.9 for ; Wed, 22 Aug 2018 11:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:organization:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=XsiONTwKhy2Bk6TIXOUYYwnd5+ponsmTgkJBwlr/lOk=; b=ZSK39Xbwi4nSuEUzl2B+Q0M/CkzVfIMM4NnAF8yr/Sl/1gxBboCxs+LJYdTEnQHtiR ACX1BLFW8E7m2bRDLiIWsLLKriEr56wkjigcwKAu/8QOZKV4Otu3UZkaQhX+jaVpalg9 Qfp89YDWuNsvUVhndJMxOjK1R72I1YH1cP8cf10HJKZ4UYhFGLct/zT6QDWGjS7nT2DL rl2brjSYVhTPue0EdYGc6aB+41ojh2PYOmq3SlLB3fTI77qNW+KRbd5sNOuM1BC4tNSy tsZOAp04Z6KyG+7ee4Zu9+cmtS9KBluk5Vid/bcHP5uQx4MCWXzwZfx2sCpOZzv7xy+X YakA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:organization:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=XsiONTwKhy2Bk6TIXOUYYwnd5+ponsmTgkJBwlr/lOk=; b=SSKaX75+tzkE+jNTnICuljCuuf+8+effgIme9SoZN+869oFp916bqDpYfa51XPXL8H d8YvvEYjA3Z9TzS9GEzHMszV0T182H47EcokRXhVPIAjkbLXymP9ZGVrKe7JL3FaCDeg R2RUVSTbNeu+VKHf2P7rcLWyoNLrGqbigdlxg4Vq6mgnl5eAVJwudMjrobunu+Q5YF78 knmeQi2TfV6plNdgD3uGJAdUFkhUWRaWnoUVOIj7Ke8euZ6w2fPOc7Z4YDShxecbu/FD SzLxgcErxTsIAjKkyaSMChU5EAvuF6bxPIAZ3Ej9r+QpvCSfI0iq69cJigtlIkfoN7FM VTog== X-Gm-Message-State: AOUpUlHK2HlUnTnnvMPfozoHajhF1K7DMbYZPjk4ua1Vq+Zr+2JCTDKk mcIuGOdMO8ATowv10Q20mVdNIw== X-Google-Smtp-Source: AA+uWPw2Ipk9CnsQZxKJTZnVPf3AlCZfupPnRekm65q/lIxBbpTSwMLEtCfl+efUaugVvSlLMMCzWw== X-Received: by 2002:a19:1c4c:: with SMTP id c73-v6mr10669998lfc.90.1534962147754; Wed, 22 Aug 2018 11:22:27 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.83.203]) by smtp.gmail.com with ESMTPSA id 135-v6sm339676ljj.35.2018.08.22.11.22.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 11:22:26 -0700 (PDT) From: Sergei Shtylyov Subject: [PATCH v2] mmc: renesas_sdhi_internal_dmac: mask DMAC interrupts To: Wolfram Sang , Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Organization: Cogent Embedded Message-ID: <624fec83-0190-18b4-1d80-b59b1bc964b2@cogentembedded.com> Date: Wed, 22 Aug 2018 21:22:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Language: en-MW Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I have encountered an interrupt storm during the eMMC chip probing (and the chip finally didn't get detected). It turned out that U-Boot left the SDHI DMA interrupts enabled while the Linux driver didn't use those. Masking those interrupts in renesas_sdhi_internal_dmac_request_dma() gets rid of both issues... Signed-off-by: Sergei Shtylyov Reviewed-by: Wolfram Sang --- The patch is against Ulf Hansson's 'mmc.git' repo's 'fixes' branch. Changes in version 2: - fixed #define INFO{1|2}_RESERVED_BITS, rename them to INFO{1|2}_MASK_CLEAR, and moved them higher; - shortened the comment before masking the DMAC interrupts; - fixed up the excess whitespace in the patch dsescription. drivers/mmc/host/renesas_sdhi_internal_dmac.c | 8 ++++++++ 1 file changed, 8 insertions(+) Index: renesas/drivers/mmc/host/renesas_sdhi_internal_dmac.c =================================================================== --- renesas.orig/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ renesas/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -49,10 +49,12 @@ /* DM_CM_INFO1 and DM_CM_INFO1_MASK */ #define INFO1_CLEAR 0 +#define INFO1_MASK_CLEAR GENMASK_ULL(31, 0) #define INFO1_DTRANEND1 BIT(17) #define INFO1_DTRANEND0 BIT(16) /* DM_CM_INFO2 and DM_CM_INFO2_MASK */ +#define INFO2_MASK_CLEAR GENMASK_ULL(31, 0) #define INFO2_DTRANERR1 BIT(17) #define INFO2_DTRANERR0 BIT(16) @@ -236,6 +238,12 @@ renesas_sdhi_internal_dmac_request_dma(s { struct renesas_sdhi *priv = host_to_priv(host); + /* Disable DMAC interrupts, we don't use them */ + renesas_sdhi_internal_dmac_dm_write(host, DM_CM_INFO1_MASK, + INFO1_MASK_CLEAR); + renesas_sdhi_internal_dmac_dm_write(host, DM_CM_INFO2_MASK, + INFO2_MASK_CLEAR); + /* Each value is set to non-zero to assume "enabling" each DMA */ host->chan_rx = host->chan_tx = (void *)0xdeadbeaf;