Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3357598pxf; Mon, 22 Mar 2021 04:44:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfGftpIOmCjr3KWk8NzR3cHAmOQvdckwGALDEKzFnXQjxUpqPyFtZj3SiOejoGJvAZYbYR X-Received: by 2002:a05:6402:51d0:: with SMTP id r16mr25021962edd.48.1616413493213; Mon, 22 Mar 2021 04:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616413493; cv=none; d=google.com; s=arc-20160816; b=JuG+LP2X8IojNc9KAxozFW2xXmKUXQ+6Xf/a8GI7yT5wzOOCZqpNGleTGwjqk9+8IS iGb4kt5X3goIgJVggZ7a6BEy8XHteefbT803W2zlynbqu7ZnCQ2ndKVllI2y8+OV8Ddj 03bXhO1HeqQoOkeT5TT4ZuEm/adU2qP8XnZNrEBGDNOE6soDNFVsMsnyDXzJoACx2z6y /uqU166nVOFr54Y01OxH82K/QpvhbaX7wVMGT7KJaxVwt0J4MxeBfKmvuEUheaEerWm4 roPPwUsW8lSeIYQ7VXOQQiucbVg0IQzBiaIvVEhmmBVaInVgvFclWeu3k4hBYh0kuDD3 Z+Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EIQgvdeDjnmWWKbsRqKq4n3TDYblw0NK5hlNUEV3b/s=; b=MUvns2aWZHGXLMFFaoHAWwOsJRhpaBiQ4Ui9z1XyvA8yPQpz14iuQLnYAoPjp+9cmX 28oNXy6KRdFerKOmXvxVbtstc5ZWfKN+FIdP7jTYAh2pXx++rh+a3WfZ0ohAqBZ72Qns r0YsYx1DTrmHHNVN4nSPD+CIPF2FMux5PLfdlgZITqhWg/882HX1d5z+1Dh56gYxMT0u wHcTGwqO0eYO2EmgNx5OwhK09Y8pAlKdki4xaBYeIzFwH/xDZG5Z/DBh99M6ZX437Pe8 QpGeToEgBxAsk2fjxN6sxEWy0xJdhLuWfD0O7dIYB+mYf2ub/0ZRSrkgexZyMUspQVdw rK0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LYrpjYaH; 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 4si11479392edc.316.2021.03.22.04.44.31; Mon, 22 Mar 2021 04:44:53 -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=LYrpjYaH; 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 S229692AbhCVLl1 (ORCPT + 99 others); Mon, 22 Mar 2021 07:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbhCVLlO (ORCPT ); Mon, 22 Mar 2021 07:41:14 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE68AC061574; Mon, 22 Mar 2021 04:41:13 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id kk2-20020a17090b4a02b02900c777aa746fso8362928pjb.3; Mon, 22 Mar 2021 04:41:13 -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:content-transfer-encoding; bh=EIQgvdeDjnmWWKbsRqKq4n3TDYblw0NK5hlNUEV3b/s=; b=LYrpjYaHyqQft0gjUeIevpjw7UDx+Zj4qCfxZCTVZIYFLK3+TcZMp6ZbahHww0+ZE9 vq2Dw4rwYLDVCsoYgYs+W7Kl08BIMzHMMOilro1Cn+P6hVT6hz05fWicAdYV48eeor0s iZpjZ6Zef063THkojd290tZMnVDj+ngoqLJYxdY20M3YF40EaviKBP5I4ZG0S9/d1csY CLO2kkVduTdV5RHz5OkofEBwt0Cg5pLsyobW3RhHpX7q0GWmkLNj2NibJ6Dfj6OMr2N4 tw1QJztOVq+M2srsqC7b5Z0RD3k6zVDOqz4NKH5w3saWwVZUIuT8yRn+gMY8+JkVgHlH 3pQQ== 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:content-transfer-encoding; bh=EIQgvdeDjnmWWKbsRqKq4n3TDYblw0NK5hlNUEV3b/s=; b=bo5rYBqE8Lf8AOaa7Cfe1DoO3Exg00W/oVQfC8xGcefG3tpyhazS2cKZRqISP7aGAB COBI1x6TXbk+r9P6wu1LJx2hG0DL7fTQt6AeayTIZlxztjEwdnFqnZxnjG5rdIfo4Bh0 IiQlaOv6Zje6CCtKvEPs+/h4OoxlEXGaY9HrS8Tj+txHiOpOwUVrYubvv2jP8ka8jPhN eYChJrSYrpj4d04baHZW5XVtj1vx81J38nncae0UUypv0vfN2WaRh0JmHQ6grN/shfXF ADzD2pBJNtzC1KAl05lbK6OKxGHKFr7kQi8RHAvFfb+CArl9jrUo4iiN9OYCiHXngvvW Rzlw== X-Gm-Message-State: AOAM5314tTvAvZPNntd2wS7FlV1G5gJkGbLRe+FNlFG/B5YQamUumVYd KcxyiU10mKOCevKZsiwzyYw8SPA6Gqdex4EOCeQ= X-Received: by 2002:a17:90a:b311:: with SMTP id d17mr13271988pjr.228.1616413273374; Mon, 22 Mar 2021 04:41:13 -0700 (PDT) MIME-Version: 1.0 References: <20201216125320.5277-2-clemens.gruber@pqgruber.com> <20210111203532.m3yvq6e5bcpjs7mc@pengutronix.de> <20210322112254.5mjkajkq3wnhgnd5@pengutronix.de> In-Reply-To: <20210322112254.5mjkajkq3wnhgnd5@pengutronix.de> From: Andy Shevchenko Date: Mon, 22 Mar 2021 13:40:57 +0200 Message-ID: Subject: Re: [PATCH v5 2/7] pwm: pca9685: Support hardware readout To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Thierry Reding , Clemens Gruber , Sven Van Asbroeck , Linux Kernel Mailing List , "linux-pwm@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 1:22 PM Uwe Kleine-K=C3=B6nig wrote: > On Mon, Mar 22, 2021 at 11:38:40AM +0200, Andy Shevchenko wrote: > > On Monday, March 22, 2021, Thierry Reding wr= ote: > > > On Fri, Jan 29, 2021 at 09:37:47PM +0100, Clemens Gruber wrote: > > > > Thierry: Would you accept it if we continue to reset the registers = in > > > > .probe? > > > > > > Yes, I think it's fine to continue to reset the registers since that'= s > > > basically what the driver already does. It'd be great if you could > > > follow up with a patch that removes the reset and leaves the hardware= in > > > whatever state the bootloader has set up. Then we can take that patch > > > for a ride and see if there are any complains about it breaking. If > > > there are we can always try to fix them, but as a last resort we can > > > also revert, which then may be something we have to live with. But I > > > think we should at least try to make this consistent with how other > > > drivers do this so that people don't stumble over this particular > > > driver's > > > > I guess we may miss (a PCB / silicon design flaw or warm boot case) whe= n > > boot loader left device completely untouched and device either in wrong > > state because if failed reset (saw this on PCA9555 which has a > > corresponding errata), or simply we have done a warm reset of the syste= m. > > So, we also have to understand how to properly exit. > > I don't think that not resetting is a real problem. My argumentation > goes as follows: > > When the PWM driver is loaded and the PWM configuration is invalid, it > was already invalid for the time between power up (or warm start) and > PWM driver load time. Then it doesn't really hurt to keep the PWM > in this invalid state for a little moment longer until the consumer of > the PWM becomes active. But this won't work in the cases when we have a chip with a shared settings for period and/or duty cycle. You will never have a user come due to -EBUSY. > Together with the use cases where not resetting is the right thing to > do, I'm convinced not resetting is the better strategy. I'm on the opposite side, although I know the cases that resetting maybe harmful (to some extent). We definitely need a hint if we may or may not touch 1 or more channels of a given PWM. > > Another point, CCF has a bit =E2=80=9Cis critical=E2=80=9D, and u guess= PWM may get the > > same and make the all assumptions much easier. > > So I think complicating the PWM framework for this isn't the right thing > to do. Again, I'm on opposite side here b/c see above. --=20 With Best Regards, Andy Shevchenko