Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp882416ybi; Fri, 24 May 2019 13:04:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz85Oi2tt0U1hRbhJPvlNu8XyQhGK2R7ZTa3w9F8RLa9hj/7QRkAVoSx1szFOplZtAoZGEl X-Received: by 2002:a63:465b:: with SMTP id v27mr106748647pgk.38.1558728260000; Fri, 24 May 2019 13:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558728259; cv=none; d=google.com; s=arc-20160816; b=ttG9JPVULZuluTGvXyMkFRXDOQ0vQE5RCSafaIL//A8pL5p4W75XMecXF+vD/BdCfQ blagP790/7jmUnDTUCSUmesQO6b/bgdtZO6H3BUwrX/yso3NrGzbKOzGVynlChJjNu2F B8EB5aqTVhjsbRKkmHWElShZ6c3BCg7XNpEEDw1t5StiqYUDGb+wUo7aRa2Dcnnris98 XsmsZpsOx7R1MbDOM/4lYjnqmVIB+8Z5Jm+jhNw6Hjmy+46lX/sn8kET9O3uTf+iAas2 SruCzd8MlEUT2eOnxJ1pcU644RJr4al4y2XHtvz9hLVlqfZ5+7PSAxzJy3TCX/QJDiTs +njw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UHojS6CxTbfNN1lxBjQLh832vFhB7+3k4jCcVBGUCwo=; b=e2tZ3J7EG3gzLkU/NkO2tSPuWPyhT8NyIA0RCXendL7LB1fphyZP5tT1nNhChTR/6F ByTLeEr/d5fG81kYzYB0gWfzGWJ7kcDMOgsqLaNLoiaDIdviub69NZZCowBzlcMNhUnN nZPfGtNso0CeXimCbaWo03zBo8f+eF68/ddfASH1rOGdX3YWTz/UL3eVe+hGcJNBZx9A ZHSgafnqx0or+uRZ+jO/w1LBANaUa3s9tdT2Uur2kVsZMI2mkgvEUK1fnvln9uKuTeRy OJ/JyP/3Uf5dUTzUC0HUWnlVqrNHSPzqQBOYX8v1HfMc1QLysbpsdUIPRKuR2J9yoxop AFKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ejkNcbw1; 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 m14si5080911pls.393.2019.05.24.13.04.04; Fri, 24 May 2019 13:04:19 -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=ejkNcbw1; 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 S2391822AbfEXUBi (ORCPT + 99 others); Fri, 24 May 2019 16:01:38 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:41687 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391669AbfEXUBi (ORCPT ); Fri, 24 May 2019 16:01:38 -0400 Received: by mail-ot1-f67.google.com with SMTP id l25so9764229otp.8; Fri, 24 May 2019 13:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UHojS6CxTbfNN1lxBjQLh832vFhB7+3k4jCcVBGUCwo=; b=ejkNcbw1bQFBLEnFnDkIxXEI0u0HP7oz5bcc1EnQ+n94Z72O6xJzE8EuzHq+JdeSMk p19cyfGthHzSF4yHlB8Ele/gjquVnEk/9YTyp8PVGMegFHF90VbRGOLjSxHxF1vOCrDp jjWgh8B+aE26+SyApL7pIGvJYt42K89NqUr5gsBDiq9XjNY2zwBdWJRfaT1FCMAMMW8h obgMmSr7UbIVkQurVpvrvdfX1JTTBc0whdnKpgfnKAjC5XDCVy5Unke95FJ/SnlpCJ6D Hg+WoYVvllJbpiGZ4UWGAHKr6tC7t/Bdt/pRpGrrAp1eZgYcXZaDSY3W/PTTwzpzItbm LZYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UHojS6CxTbfNN1lxBjQLh832vFhB7+3k4jCcVBGUCwo=; b=DnUMhbTt5VOV6kuHIBMKWSmiQ9kFLskQUOY5jayl85X5E11L19doUkjmW+sEyi61GJ RRe/TBD6s+BbK5B8iAeX1GE6XadpPqUW4g6yHC8Ey9gSS3+Z4etqR8hNfh3OUoAbtFyb GO9VDeCg+UQXRCog3Va0wlTFWS2YVuDaF+wT4NSHx7x1k62+nnn1jAVkNB5BIQD6vo3j 292SS+jH8zinv11tFdZH2a8p0zl1r2tdfigWdAdXocTGhfxiEJUw82bKQzPxn5w5DNkJ aLIPofCqYGxBdN3oDUXNs4N5gVKe4Ie/U2Gu6VUvil5juQKklN+RnWMK3qcNHSpufdbb vWmQ== X-Gm-Message-State: APjAAAXnGrO/9rJ+B5/DtYDiWVMTgSRnPGG5hEcNfi15c0CeJ8V627c9 aRlvPQnwk+NI14CWKjAkEQ9frvfN0uQFdONKYyzOIOoz X-Received: by 2002:a9d:7f8b:: with SMTP id t11mr107728otp.110.1558728097573; Fri, 24 May 2019 13:01:37 -0700 (PDT) MIME-Version: 1.0 References: <20190524030514.14082-1-qiang.zhao@nxp.com> In-Reply-To: <20190524030514.14082-1-qiang.zhao@nxp.com> From: Yang Li Date: Fri, 24 May 2019 15:01:26 -0500 Message-ID: Subject: Re: [PATCH] i2c: layerscape: use PIO when fail to request dma channel To: Qiang Zhao Cc: "shawnguo@kernel.org" , "linux-i2c@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 10:08 PM Qiang Zhao wrote: > > When fail to request DMA TX/RX channel, use PIO instead for layerscape. I know that there is a problem that the i2c will fail to probe when edma driver is not configured. But this shouldn't be a Layerscape specific issue. We don't have proper fix yet, but we have a workaround which is enable the EDMA driver in the defconfig. Disabling deferred probe just for Layerscape is not a proper fix either as this is not specific to Layerscape. > > Signed-off-by: Zhao Qiang > --- > drivers/i2c/busses/i2c-imx.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index 98b278613cf2..39a5ab4cf332 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -347,9 +347,13 @@ static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, > > dma->chan_tx = dma_request_chan(dev, "tx"); > if (IS_ERR(dma->chan_tx)) { > +#ifdef CONFIG_ARCH_LAYERSCAPE > + dev_dbg(dev, "can't request DMA tx channel\n"); > +#else > ret = PTR_ERR(dma->chan_tx); > if (ret != -ENODEV && ret != -EPROBE_DEFER) > dev_err(dev, "can't request DMA tx channel (%d)\n", ret); > +#endif > goto fail_al; > } > > @@ -366,9 +370,13 @@ static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, > > dma->chan_rx = dma_request_chan(dev, "rx"); > if (IS_ERR(dma->chan_rx)) { > +#ifdef CONFIG_ARCH_LAYERSCAPE > + dev_dbg(dev, "can't request DMA rx channel\n"); > +#else > ret = PTR_ERR(dma->chan_rx); > if (ret != -ENODEV && ret != -EPROBE_DEFER) > dev_err(dev, "can't request DMA rx channel (%d)\n", ret); > +#endif > goto fail_tx; > } > > @@ -396,6 +404,9 @@ static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, > dma_release_channel(dma->chan_tx); > fail_al: > devm_kfree(dev, dma); > +#ifdef CONFIG_ARCH_LAYERSCAPE > + dev_info(dev, "can't use DMA, using PIO instead.\n"); > +#endif > /* return successfully if there is no dma support */ > return ret == -ENODEV ? 0 : ret; > } > -- > 2.17.1 > -- - Leo