Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp786361img; Wed, 20 Mar 2019 10:49:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuWrkg5/22Wu/XtNkvAjlfTzq9EJoLdnNCOT+3qLrsgisrIKzMJ76o+CosTQLGGjM0zfEz X-Received: by 2002:a17:902:e3:: with SMTP id a90mr31905936pla.45.1553104160906; Wed, 20 Mar 2019 10:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553104160; cv=none; d=google.com; s=arc-20160816; b=Z+2d1U/KTVIDvBgWiMOAG43jUDN/lztd7+dc/gGi0tIRa/ee94fRzWgm4qDPLzsGgK HLMB6eEP06VEHuc99nni/D1QmcjM6XMMPI9KCfZAbLamOpHKo9BHK4HnQnbKm6y4ejXO RpnFSa4s3KpFKDU1ZGNmORuxmHMXcPYneqUkgneT3B/JFFHJjjIAar2jBiGGja9DXu9J sWsEGG77yWnj6KRBNb4VZ0Tp113gBlZmPeim0UNtHd0B4D59sRErSgcZypESU3VwZK24 gvaZO6KHbASQ9qJJ4t8dgf3faoP6g3ungDBIlp+akjxbyySdrET0expEn+G5huYtyi+4 r+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GwYNiu8yIWI3Q9wqZ1wcU3AHJ+j3+pORIgl4ynqCl7E=; b=ACjcz4ZtItqDgAZGiUez2Ac/CCg8JFYdPK2EL8onG/ZvDh7xO76WKNAUJV3ft42hv7 +qV6jDSWy9FJ8M6aKQzVXhFZOhS8krskPHMGAjNMNY4Fsq7b+oBWwBclu2o185C3WN+h 8eP2c+t3zxK2dzPhccppDVCdmCaD6cU1/VTMjJItAMkhsEsmvdjmrwJCD+C38rpan1sn ZyxG8tJQgFaddRG1qYgrPZxUJlv3Yynx6YYoQgc7EYY26LQsAG3BlhbuQXueP4GO3QEw 39/pB6rsqjHCBjGiVTwY7uyEA8PRJuL3b6ghqDgRe3e0vdjbXuUqCnGfEcwyFEXR4zRO NU2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZK++xmKu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si2139344pgl.474.2019.03.20.10.49.05; Wed, 20 Mar 2019 10:49:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZK++xmKu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbfCTRs0 (ORCPT + 99 others); Wed, 20 Mar 2019 13:48:26 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:46935 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbfCTRsY (ORCPT ); Wed, 20 Mar 2019 13:48:24 -0400 Received: by mail-lj1-f195.google.com with SMTP id z26so2990322lja.13; 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=krS0h2l+p2IZYgt3OEGBg1p2FLGJbM83V15uieku2nQzfieXyQ5GK5b/6FvtNSKweL xE45mbPbqkOmADJ2xXg8wnK3OUXfRN8a6TzVlRSXv8o++q5CTcOusy762iL0tTilZs6M v1Js73eITrENNd80AExFSim+QWqC/1iaWomiAEbYA/m6SFzolju3JN5mvXVV9jvPr3wx MdGRfDe6hy/6DPyxKJOeKuBvcWPlXV/DV3lvN5WhWZJi31kGgJG4T5YXFxdQGIp5P1vG U5M+lQhJKCDFW0HD6mkqwCUhv2F/OwDO03jf2T9CY5tHxa3b71Ev05h8UjyoHUyBS1iI of6Q== X-Gm-Message-State: APjAAAVH92m+1mKcJaQ8qz1pUi++EQchyrLrw7wwnsN3CG6HjSeAmqM6 PgrIOryz1/NzRe6dre4gYOpmc8e+ 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 Cc: Alexander Kochetkov 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 1.7.9.5