Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3061708pxk; Mon, 21 Sep 2020 04:25:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8skPuH9MRZ6SrmKhZFeEUKwn1FvKv1BE70gsjxMOXHkhvw/Bl5zCnkjzSy7tpWUepCy8U X-Received: by 2002:a17:907:2078:: with SMTP id qp24mr52788002ejb.500.1600687508449; Mon, 21 Sep 2020 04:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600687508; cv=none; d=google.com; s=arc-20160816; b=ewEMohDknxea+piu/YHy01W8wR8uGBF7VJkRYQgGa8DAkjmyndvnQhUM9tUQaBSvGt c4EAnke1UCJbd9p285LVJQlt4ZfkVl7fPx9x1lBKGBbhgfT20PnAVlqrKY87ZcFeGUxG s4zC2+SfgNB5Z53Nto42AV0dicnWezFzC7SWiINUqSWiPoUStC8wPOM6BNKHWUixcezx YsMrT0iL8L4XMX+q7OzNu3wFbDOrT8x3mpN0/G3xV/p5H/NkUCPZ/pSGiVuhLKPIXmx3 U2+eqBEtq2o7s0GJxYTIOEOY3BNUvC9JFKJjIO8VPpphBmgZaNHlC7I4cSsqCGrgc7ln LNYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0ZnIRDHof5llKXKRdM1UTdt+GPv/4voJnfxD2ooD47I=; b=g2DXwNzmvMDV7n5PGPwaoJwyauwvuNO+ymoouQCkDe9Ia81ed+H13L62rpV/RyTPi6 8CJ4eWMkMRhea2xp5VznvLLX2yDvL2dwS/ZoDfsA7e8aBUJYq5XW28hSfGT2WdR5c4j6 t18Do+5eurPfiTMtXsZXAMWc+8tDOc7ljI1yUh2n8ul3MOJbuv/mlghbve+reY3J040z xMDX4ziu23QjskpbLYPXCXN0G445wr/BBAMlsM/mw2/JcggLjxTjXDbtl9CdgQy4azUk ruFZRIy8FytE5V5A6WTFw7h9sN4ffQtDcz6T/KonczVeHzCHinStWcq7gOpN1dXDoriw Lq3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kttlAkC1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c9si6876346edm.284.2020.09.21.04.24.45; Mon, 21 Sep 2020 04:25:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kttlAkC1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726696AbgIULVa (ORCPT + 99 others); Mon, 21 Sep 2020 07:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbgIULVa (ORCPT ); Mon, 21 Sep 2020 07:21:30 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE77CC061755; Mon, 21 Sep 2020 04:21:29 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id z9so12216782wmk.1; Mon, 21 Sep 2020 04:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0ZnIRDHof5llKXKRdM1UTdt+GPv/4voJnfxD2ooD47I=; b=kttlAkC1AoyTyET4BKsIM8keD3CJpbyDi10VAiTrTGxPJQ4Kj8XE5+nitoFbm2PsZC S4HSpUGhV4mUeWY4JR5AuvrfyBUweWZbCBLqHsYoqMdt9ZN3RkApKeg+/5eWheV6leou cMzOEqRMQNQI6vR3TxtgUMDIV8FVbQJ5pyPT1PONXZDlCa5MGLZdUeR0NmKu6SSQyQsL 0CTXKKBsN1FUL58poNXtl60kOXOJFIlYXJap9BDzm7fb4juhp1s+yoqP0jCdCDtFbgW4 /NaoczVNVeKWKFz9LCI2ljVBZBU8PTw5mpiGrq7gm5AiPziA5i3YGHX3SqlezjWKW7tA peaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0ZnIRDHof5llKXKRdM1UTdt+GPv/4voJnfxD2ooD47I=; b=gRx9A1aRURjJTwGw/edXSRuXdfXYkShIUa97nDJqg0PhCNtYgZj3XGG8OLYCWlUcXC EwHqeyoiFPHx/i+DYDIjXzcFarveTANMLoJKuCd0STXEcLz6WiYt5n/BErfrR4ZHATLu HynaSqULkHKBGcwPWkHrCMXD4e4wEHnQtqZ96ypjijabY25xkPL4WwxJPWC4MnlhtWNc Q0RYsTojFs4ZCV0W6sffOGIyCxvQSG+BMowO6N+a6PnfaC7qT2MvPsdiJjII0zaqykzQ DbSLBZmIxAUvVKtlKGbokOFdpDT2oyuVqGpMuIUPlhGr8f5udw1RA6zpEMUGoRph8MWH 8NAg== X-Gm-Message-State: AOAM530BLN496C4Oi4+HAlI/spFpo+5gx6KPPriufSUusEN1m73EXD5k 6Nha8qfO4RkRLkKiTSm+CLE= X-Received: by 2002:a7b:cc88:: with SMTP id p8mr29826223wma.150.1600687288359; Mon, 21 Sep 2020 04:21:28 -0700 (PDT) Received: from localhost ([217.111.27.204]) by smtp.gmail.com with ESMTPSA id 2sm18627914wmf.25.2020.09.21.04.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 04:21:27 -0700 (PDT) Date: Mon, 21 Sep 2020 13:21:25 +0200 From: Thierry Reding To: Dmitry Osipenko Cc: Jonathan Hunter , Laxman Dewangan , Wolfram Sang , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Andy Shevchenko , linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 21/34] i2c: tegra: Don't fall back to PIO mode if DMA configuration fails Message-ID: <20200921112125.GI3950626@ulmo> References: <20200908224006.25636-1-digetx@gmail.com> <20200908224006.25636-22-digetx@gmail.com> <20200917114716.GZ3515672@ulmo> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2xeD/fx0+7k8I/QN" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2xeD/fx0+7k8I/QN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 17, 2020 at 06:03:04PM +0300, Dmitry Osipenko wrote: > 17.09.2020 14:47, Thierry Reding =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > On Wed, Sep 09, 2020 at 01:39:53AM +0300, Dmitry Osipenko wrote: > >> The DMA code path has been tested well enough and the DMA configuration > >> performed by tegra_i2c_config_fifo_trig() shouldn't ever fail in pract= ice. > >> Hence let's remove the obscure transfer-mode switching in order to hav= e a > >> cleaner and simpler code. Now I2C transfer will be failed if DMA > >> configuration fails. > >> > >> Signed-off-by: Dmitry Osipenko > >> --- > >> drivers/i2c/busses/i2c-tegra.c | 18 ++++++++++-------- > >> 1 file changed, 10 insertions(+), 8 deletions(-) > >=20 > > I'm not sure that's a good idea. It's always possible that the DMA setup > > is going to break because of something that's not related to the I2C > > driver itself. Having the system completely break instead of falling > > back to PIO mode seems like it would only complicate troubleshooting any > > such issues. >=20 > That code has zero test coverage because this problem never happens in > practice, hence it should be better to have it removed. We may consider > re-adding it back if there will be a real-world incident, okay? Again, I think throwing out fallbacks and error messages out the window just because they "don't happen in practice" is misguided. Just because they don't *usually* happen doesn't mean they can't happen. And in case they do happen we absolutely do want some way of dealing with it rather than just have the driver stop working without any explanation. Thierry --2xeD/fx0+7k8I/QN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl9ojLUACgkQ3SOs138+ s6G1jBAAo7ALv/1b+UdZOVeHC+ZjxIDvuKeSkINgH09LfvSpEP0SE09rXlVrk1VJ tJkgVoeixIlCNCPPW62AVl91hiYdAoah2oywe8F5wrPuB06sGfcgaOrYTCGilYdt wN/wCRgHOYhqLB/sfe8vMS29hhxxA5V3F6uCUrdIhHsTv7L5i+g/v3FJsR3LHX3X aBMwKrO1Ku8gn5jySWeJRTjxnm8X+AhxTJepSS5kxxZALaS3mhLtbYO5qhZmiE0r xW7i+04SS5ILKdMWEC/xB1WFD7oVSAgzCd9ei7UWxFFUpLWzQ9upWNrLB01Ysap5 lRCRk0PLyA56JdKQgHVUnjMpWpGk7zv/4NjQK5Hn/B3JFCw7CLYbmpWLJiqAWEwb Ov0SjbCuPeIMNdUlt0Ndlhqr6TeFjTg8h36oqaXZvdA0vYEXuGDVxFWbgLnvwemN nkAjxUe24kyeCze/RV0EzgpbldywDJe+/q+swkcF4t4f+/cbNXS3zIsxewSRpsN5 IzQc4QRoPgE3dhCWEdi9X4DTWu3wDSXCBW7Plnw5zTekIsq5yMqL6RZOjT1mTv8z DWh/At1KaPDwZ10vH9zb1pmVQyNnUBNcTB/8YyqI+7ErMEoHsv2AcPBNjEd+qURQ xaalpSnh91hwMjyHRxoRW5JGBrq28zX28SfO7GXioeEa3qwAhQw= =wZn0 -----END PGP SIGNATURE----- --2xeD/fx0+7k8I/QN--