From patchwork Wed Mar 20 17:48:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 10862345 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 0E724139A for ; Wed, 20 Mar 2019 17:48:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E082529E4A for ; Wed, 20 Mar 2019 17:48:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D46C329E5E; Wed, 20 Mar 2019 17:48:50 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7DAA629E4A for ; Wed, 20 Mar 2019 17:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=P8ccx2kucTQFgjkbvjttX1byArYmSIZZrtV9vss9pu8=; b=ZkIrnQ+mSluEUKiwBUsWiWeanM 3NZI1nzrcSZiWSEdH0NMuQvi9ID+zGb1WZT7jK3dYCrP+Iub2aDXUf4pRtgG8frDShyjzQvFO1Dwg fx8e00cBCBuoYQiuwJqcwIhtDW2KF+RwhabpA59ZOD4vd3Bvg99poDxPbooSI2cOrvSUhi3sVw1/M 5v1U4kIZlZmOWAajxTtzd1vC2gloerFaWZ7rXT0QFdsW1zd7knya5clqSZXxXUJ86L/aRnZV/Q6uT JsLnqIDOhHc5SUWAXPVF6mZAZ+tSShiNitwz+Wr2i/s+nNEfk43V7pTr0TrfgHLm+YVK8HcrjIcaO iLMXQHVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6fKY-00074f-N5; Wed, 20 Mar 2019 17:48:46 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6fKD-0006Y7-Hu; Wed, 20 Mar 2019 17:48:27 +0000 Received: by mail-lj1-x244.google.com with SMTP id l7so3043591ljg.6; Wed, 20 Mar 2019 10:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GwYNiu8yIWI3Q9wqZ1wcU3AHJ+j3+pORIgl4ynqCl7E=; b=ZK++xmKuSwNM5000UaN5YDhLz5YwoBJFyBrig31lHssklwrkLv4Q7tAiiBYHAw47ca RtEHhw5cq8ywnW+zAYoHRdE6U6gxhFYnaUv3a7PMIV3KcfpVTx+q1xyYOF6LrphkKglZ x3bZq8+bbX+NXlIAxg6gyI+dEEMLOiKF/L12W1RP7tzHMuDTC+1ReQRv3ciaKPi8JQ3o T8Wh0AkVLfRvRoNaf91lZZcbtVo9cygCzKAwhh98s3b6M/dstOw7WT+hc1xZtQtMbrrq UjXlR3gu/KsQb0AcpzRTQTrmS2/Lzfhq7E+TTv0E0foKlhfMrxR9ZD59fNbpLc+N3+RN qRTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GwYNiu8yIWI3Q9wqZ1wcU3AHJ+j3+pORIgl4ynqCl7E=; b=jDpVq38WBacKowhzgqzlnQyjMCCSdv4ABr0D8A7GqbKLEcUgruqOoDBiskseXFyfIf M46R/anwWjU2G9Ywckvp/fWWcfYyBik8cb7Vgnfp++CrWBLNp7dxqVBSDo7C3zCwbRQX D4mo1g+04hM8ZaFPlddjexSsM7wDLE71hd+VUZKhS/wp7F6K4BLKFeCL34t0cQGixNRR CV5N4cQ+DXwk9m+HzA3N0IDCivLZKg69E8jRU90iMfxy2cqbX4AvVKdIEe7IFB+vgnxL vpN7gm+ErURyYkifB/doV8mEbKmSpi49y6Ielty09MAuVnZbV/q1RYWsAflpM493T1K2 ehEw== X-Gm-Message-State: APjAAAUC5d1PH3mKC2MlRJp2tTDv8VgvtxJzCbB9FVdQfL+wmugrg5qq YUcILQbGpuFkyZ1zKEQlbXI= X-Google-Smtp-Source: APXvYqyeF/eSetNw3zqNaX4wFhR3LHAufxVgDX775K8UY2FHJlyAb9qjRNZYY0VJjbmxCfmthFSbFQ== X-Received: by 2002:a2e:9597:: with SMTP id w23mr10922036ljh.111.1553104102469; Wed, 20 Mar 2019 10:48:22 -0700 (PDT) Received: from ubuntu.lintech.local ([80.87.144.137]) by smtp.gmail.com with ESMTPSA id m19sm479959lfb.78.2019.03.20.10.48.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 10:48:21 -0700 (PDT) From: Alexander Kochetkov To: Jaehoon Chung , Ulf Hansson , Heiko Stuebner , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mmc: dw_mmc: add init_slot() hook to platform function table Date: Wed, 20 Mar 2019 20:48:04 +0300 Message-Id: <1553104085-32312-2-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1553104085-32312-1-git-send-email-al.kochet@gmail.com> References: <1553104085-32312-1-git-send-email-al.kochet@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_104825_635124_10070DB4 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Kochetkov MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The init_slot() hook allow platform driver override slot defaults provided by generic dw_mmc driver. It's required to fix EDMA based transfer hangs observed on rockchip rk3188. Signed-off-by: Alexander Kochetkov --- drivers/mmc/host/dw_mmc.c | 4 ++++ drivers/mmc/host/dw_mmc.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 80dc2fd..d3ecee9 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2819,6 +2819,7 @@ static int dw_mci_init_slot_caps(struct dw_mci_slot *slot) static int dw_mci_init_slot(struct dw_mci *host) { + const struct dw_mci_drv_data *drv_data = host->drv_data; struct mmc_host *mmc; struct dw_mci_slot *slot; int ret; @@ -2876,6 +2877,9 @@ static int dw_mci_init_slot(struct dw_mci *host) mmc->max_seg_size = mmc->max_req_size; } + if (drv_data && drv_data->init_slot) + drv_data->init_slot(host); + dw_mci_get_cd(mmc); ret = mmc_add_host(mmc); diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 46e9f8e..de51c59 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -548,6 +548,7 @@ struct dw_mci_slot { * @caps: mmc subsystem specified capabilities of the controller(s). * @num_caps: number of capabilities specified by @caps. * @init: early implementation specific initialization. + * @init_slot: platform specific slot initialization. * @set_ios: handle bus specific extensions. * @parse_dt: parse implementation specific device tree properties. * @execute_tuning: implementation specific tuning procedure. @@ -560,6 +561,7 @@ struct dw_mci_drv_data { unsigned long *caps; u32 num_caps; int (*init)(struct dw_mci *host); + void (*init_slot)(struct dw_mci *host); void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); int (*parse_dt)(struct dw_mci *host); int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode);