Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3383643pxf; Mon, 22 Mar 2021 05:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOV34FYvscTS9Je50avzNHL+/XeqXp5+aQMbhm7FEVzMF9TXHPjw0xraOUR+7d/YzXq/HM X-Received: by 2002:aa7:db4f:: with SMTP id n15mr25137059edt.12.1616415466940; Mon, 22 Mar 2021 05:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616415466; cv=none; d=google.com; s=arc-20160816; b=uvWgem7eLiXsGsyVP0RORD4jWsmKcUbgWiPn4nRpOyhiHv9pg48xRazoPUrPnlEvCd UXkptyRYzaHKvbJZjX2jftDoJiz+DMmUnOlR5+b0YlErpUzzCmnSCIDBoaiE2WVUvmY+ 9GeSNd7ayq/+TyG08Vzc/3Laow8Yx0si295Fds5XjifyYE/MueqyuGI9u48ryxvgfQAk s/nuiod8oZxOmNdnTUMcwBMqrEOUXBW8PzWHvwGAFaX5fRFAWob2vd0/0gcI5gjI3Gul Jorl3nZWlc9XsebOCiIOORExpGcLWkz14DN0WMk6QHdvJ0GhcFVXfdI6DExUVIq48DZO +XAw== 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=vLVQEbCaZ+2sASCPIVc5025gzMbQRYGdD6fBiIA+ogw=; b=aeVaoQ6ysFwxcXygmn+ZnhLypWvcP5u2Yycyp95lJf9GaAY2D50lmtcHQ0UM8w3XdZ 8xa7cLugFuG9DBH0w211KMgEFDKbbxTtYmemmRjwULelxh6NGaanqwv8XmD56MdMTHvE /dYq96xyKXGjt3HMvOHKPa1KwIz7Y88tdJD++tmNImi1iYCdAiMGN/ueMcyWUTdgXkOg v4WH5NXvxMdDWhdVCPIMIQLMx417xsfljQ2ptvuCyVQdLqz/nArFK/43fD8VxuE2jhFB 15WN2Djpyy/ePBdCP91enZG4t7/GZiP67JUEMpuiOg+VJmqPUFW1aocCKWwgnvs5G0D0 S64Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YalbtbL5; 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 y12si11428914eda.74.2021.03.22.05.17.24; Mon, 22 Mar 2021 05:17:46 -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=YalbtbL5; 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 S230100AbhCVMP6 (ORCPT + 99 others); Mon, 22 Mar 2021 08:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbhCVMPY (ORCPT ); Mon, 22 Mar 2021 08:15:24 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91AE2C061574; Mon, 22 Mar 2021 05:15:24 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id u19so8488934pgh.10; Mon, 22 Mar 2021 05:15:24 -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=vLVQEbCaZ+2sASCPIVc5025gzMbQRYGdD6fBiIA+ogw=; b=YalbtbL5Ay1s/ZY6TELzy+l6vTrHk4GpwC/So/VQe+M9PKSXMfimPwO01NBzNedoAI Yew7Ce6fMBMV0IJpQOxrk8jvF8dmgwlrIRC87/+3rbMyCYB38L4q/Po3To948VmTFjaq fPJuIiYXjP8nKbgftyAxtAUyXDt9y4kwbVGSBVA0wXHvMQ4qM7Ba5ZYEQ/NEEg0ikw5S VaRZLXWvWesNNdOHxTBqew3QIZJUPPU6b/gtXrmT5QSUXSL5XjzVkkm3zz0jhDQaP4n6 rrooTdjksXTNwEdAXQDndBD2bPlwmJrqBw/631TRMYYPJyq72UdIvBMG8Grv/QuVQ1mA eexA== 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=vLVQEbCaZ+2sASCPIVc5025gzMbQRYGdD6fBiIA+ogw=; b=DJnRB9j4WjEU1sAdlre3kunRP/KGOVzlqlsQ1f9kNTn6edzNL4AO4FPLb0UFq5MM2i y/zv00/4FeJkgJFw3Utsb9H060uZzcQim3hcNVMDsx8bwjHhiizFDwDnaHEmVlE7Rtzc oDr5dKV4ZQE2qf9EttOMRsgcPkcGW2rTzA62ZgXCHUWXOTfkZ0sLFBBOsX9xCOUMWWpT a4mAKxM8U2yeIRCoT9EpYFi5b+dcY90ZUTXeUMWPVXRUvWxgilgbzv3eOGVE/8OAkzH/ XjiyRvohx+ejha4dNRcj1K6Dw5XPcATmoZ7v/zceJVWGPGBbSr0tMuFbkw+Sx4yE+6Xt bs6g== X-Gm-Message-State: AOAM532g0/aI6bEoJSnG7mfRYmmGsigTX85nFpUAPB7Tb8+CM9ahpKkw S1O3BSwOU3LhMj7NnU54HB+pvsdW6mTJ7a4OuAk= X-Received: by 2002:a62:e50f:0:b029:214:8e4a:ae46 with SMTP id n15-20020a62e50f0000b02902148e4aae46mr12024153pff.73.1616415324021; Mon, 22 Mar 2021 05:15:24 -0700 (PDT) MIME-Version: 1.0 References: <20210111203532.m3yvq6e5bcpjs7mc@pengutronix.de> <20210322112254.5mjkajkq3wnhgnd5@pengutronix.de> <20210322114826.ahwhbqxjxfg3nmrf@pengutronix.de> In-Reply-To: <20210322114826.ahwhbqxjxfg3nmrf@pengutronix.de> From: Andy Shevchenko Date: Mon, 22 Mar 2021 14:15:08 +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:48 PM Uwe Kleine-K=C3=B6nig wrote: > On Mon, Mar 22, 2021 at 01:40:57PM +0200, Andy Shevchenko wrote: > > 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 wrote: > > > > > On Fri, Jan 29, 2021 at 09:37:47PM +0100, Clemens Gruber wrote: > > > > > > Thierry: Would you accept it if we continue to reset the regist= ers in > > > > > > .probe? > > > > > > > > > > Yes, I think it's fine to continue to reset the registers since t= hat's > > > > > basically what the driver already does. It'd be great if you coul= d > > > > > follow up with a patch that removes the reset and leaves the hard= ware in > > > > > whatever state the bootloader has set up. Then we can take that p= atch > > > > > 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. Bu= t I > > > > > think we should at least try to make this consistent with how oth= er > > > > > 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)= when > > > > boot loader left device completely untouched and device either in w= rong > > > > state because if failed reset (saw this on PCA9555 which has a > > > > corresponding errata), or simply we have done a warm reset of the s= ystem. > > > > 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, i= t > > > 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 o= f > > > 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. > > That's wrong, the first consumer to enable the PWM (in software) is > supposed to be able to change the settings. If it's a critical PWM, how can you be allowed to do that? And if so, what is the difference between resetting the device in this case? You may consider it as a change to the settings by the first consumer. --=20 With Best Regards, Andy Shevchenko