Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp207497lqp; Tue, 11 Jun 2024 01:50:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWabPB/5M4bAnzJw9jH18Jt9O9ipphfcEIs9ubnDCeYNOyCx6zI3xoL6FW3qW6yddDyHbJDJJEoza1vnQiCHzY0seIPz7YV74vulWot2g== X-Google-Smtp-Source: AGHT+IGU/S/yjFa488AvDRgG5SOaRCRaCD76YgdbfwFVddjq0YcLlTLnN3FTq0R+84rXSYl8tNAT X-Received: by 2002:a17:906:32c7:b0:a52:3583:b9d0 with SMTP id a640c23a62f3a-a6cd560fb20mr809411866b.3.1718095853726; Tue, 11 Jun 2024 01:50:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718095853; cv=pass; d=google.com; s=arc-20160816; b=PKhyb29kB74BHOXK9dBC3XblsDQ1FPKkPDaBSjOKpF3wMjAie5zabWt4LO7UNEtuAp ExdmYaVUWMd9nOkxppZW6Sl0+Mzidx+LF8CnyTiGfAwNTVGJGQLcqvpnv8gxqIW/Ku2G cYVsI1QLMAef+gY/zEWT54WMZi3l981w/Ck82iK+V37eeCwCvvaQMASZZcqfsbVZ6A8a MLX1TM9hmsoklcZKz8dgOwKzpRKnQQ77Lg2byDp6WWrWNz8LSd1O/gP1CHdRtiyQ6mKA F36kJtnO1Qb7Y1+6AmtG+s22wS7LsAZU6ecsGSJ/p2oGZUVW7705ZKnscmXz8H30MzLn KG8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P8gAWy3oAL3N6c9e4AbGCHB1FqgrUivdiid74NfRIgc=; fh=f5yvYz/a/wbkXHuC5ORrmjL5xWwo5PjncghJkiNCsNA=; b=ihQjiJ3zKXRAcDrMaWnFJb/gTtx65T+uf8TpIk7EhY2OIpNftKdoMdDZPQtmyyppHm esATm3BmIcIiLw/Q2aAgToGAyZmgWBSZoob1W1gy4XiwcmOuQIb0v0BdDZK7p6g10TMP tdNzHtB/dOBBNbJsUq1aNtA1Ck4ViT0FhPHThPjTNuS+72EFXGJMIbF12eZx5jERR6JC piMxejjC1ROQ0xokqjTCxGkof4z5zQEICiNcfdVwvoSpMeWdzzvcD1mDSDBy4Wq36Ixq yTPWTI0sg+0GBfBxJES/Ej16HH8ZbImwdTPFruXp9mAToh/seDv90w6hwIhZHXy1KnVp Xcdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fgQ7W1Gz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f121e675csi250177766b.926.2024.06.11.01.50.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fgQ7W1Gz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-209511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6A1D31F262FD for ; Tue, 11 Jun 2024 08:50:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B08A174EEB; Tue, 11 Jun 2024 08:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fgQ7W1Gz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A25717555C; Tue, 11 Jun 2024 08:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095847; cv=none; b=DAdN4cp/W3deWryqUDzFBbtQMvB72nq+NLcMll1MuzJpPaAcxJeq3p/oPr2bh3VsAVJvE3lQ+qBvyIBvQx/bf8R2kOfuPcDdnVUxLXSUqJMRco64EJnwuZzlVxHtEeS/+04n1Iq69qcg0sDvTMNfXKTlt2XKhZqgRhCmtYlgC+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095847; c=relaxed/simple; bh=x4IeccqboLkC6pu6d+XHWB0qsYC62Jw6KpyPHteDycU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RKAJA1epzF31b39/sKG2FHkvxdiYzsagb1aGzzAdBsgaHjnNSbyOz+0fWMBtwMI7nMPxC8Qn00dzCeUeExFWX86V4ZrKZaGZfKUZRi4FqlXC0NIpBA0RZk386XagfK2TZulHKPTZFfk9HccWw72zk9XVS+c1kMjErH8MEM2si8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fgQ7W1Gz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29F57C2BD10; Tue, 11 Jun 2024 08:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718095847; bh=x4IeccqboLkC6pu6d+XHWB0qsYC62Jw6KpyPHteDycU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fgQ7W1Gz2OXH5mdHXx6txC73K+8rJL4eA0kfjYVK1/tfR/BJgcP4DaBB4rSyDR++N o9l8TbXiqXRi9IUPwg8hT1e/ZfvtS/6Bc9lnyC/l9ZVlYCGgTzN98NU3EKWe8MXOch PHgQWF8hyuMqI/g5ySOYlf8YeDogRG2RRA+75KtiXQHIaZkbMFAreZdhNdf8gXM83j SRPCdxmaAVxoLdLlOUKgD/AdFjRRP71CPWWmkLA87A0jBjyAg/sBlczqjWCHnu2+7d SBV7atHfVYZH2mkk/YWzObDHFMW1+VZohaCDBwU7oHrRy8AmKmsoDyMo0/7Hw3PAuq PVP5zfxKIvbFw== Date: Tue, 11 Jun 2024 08:50:44 +0000 From: Tzung-Bi Shih To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Benson Leung , Guenter Roeck , linux-pwm@vger.kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] pwm: cros-ec: Don't care about consumers in .get_state() Message-ID: References: <20240607084416.897777-5-u.kleine-koenig@baylibre.com> <20240607084416.897777-6-u.kleine-koenig@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240607084416.897777-6-u.kleine-koenig@baylibre.com> On Fri, Jun 07, 2024 at 10:44:15AM +0200, Uwe Kleine-K?nig wrote: > The get_state() callback is never called (in a visible way) after there > is a consumer for a pwm device. The core handles loosing the information > about duty_cycle just fine. ChromeOS EC has no separated "enabled" state, it sees `duty == 0` as "disabled"[1]. 1db37f9561b2 ("pwm: cros-ec: Cache duty cycle value") caches the value in kernel side so that it can retrieve the original duty value even if (struct pwm_state *)->enabled is false. To make sure I understand, did you mean the original duty value could be less important because: - We are less caring as it is in a debug context at [2]? - At [3], the PWM device is still initializing. [1]: https://crrev.com/0e16954460a08133b2557150e0897014ea2b9672/common/pwm.c#66 [2]: https://elixir.bootlin.com/linux/v6.10-rc3/source/drivers/pwm/core.c#L52 [3]: https://elixir.bootlin.com/linux/v6.10-rc3/source/drivers/pwm/core.c#L371