Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp45903lqj; Thu, 11 Apr 2024 09:25:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlNO6q74Y84/XKSnX6D7c6sgF/Bcq7E2FUZIlmoNthlspA6S8TUCYBbdCPchqy0TWK0iahw3BjEMVyyu9B4RTDoq+glbhtc6z2otF8Jg== X-Google-Smtp-Source: AGHT+IE4rFAuutqKdK4va+SFeWF6t5NR178vrqwt0xhN584ZpoIFdBGg3zrxPVkKJbYd5T4mmIj8 X-Received: by 2002:ac8:594e:0:b0:434:af74:e84d with SMTP id 14-20020ac8594e000000b00434af74e84dmr175896qtz.16.1712852754949; Thu, 11 Apr 2024 09:25:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712852754; cv=pass; d=google.com; s=arc-20160816; b=mUbiYjtVg0tdNvXBjCQevSJX2CepjVPyj/164PdfKIh7f+qhZCg2FyZimZrLxqtIlM XqnUgRzQOWbkvjb3ZrkoVVizUjqrjKpLWz6esTxvqHizBCc0O26TTWm0erh++/Imqmf4 /Aj6otM6ZXpdn6k2ob4Mv27PdKDJ1QZ0dACZIqySY1Ade56tA8EbD63Jar1V6QIFVzaj OP4A8A4KbR2WVQ8gemeg/rSdUzf77Cfyj0ETFjiQrQwRWC0BEQaoR4aRV9smOkSZ97NI 453rrBXzM1E3juCKwNJ/xLp0bNZzFr+qtrga+seHgQVbVUTgoKPPbT6f2BMDaF8RfYBZ qCVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=GPoh1eEid/YL7wOq31VGSN0TWecA98NR7ObV7LiHvCw=; fh=qMiM44PWAqNZbd34Ygv9rAymnjsObgjcisby5JM9IIY=; b=n6Nu30qfboCGcxMbODNRKOjASN1+RODFLZz+F1aCQyE1U0ifjUHQ8xI19d7QZSELv0 rUxkfE959hDEIJvjySCr0crv/QwG1AwVldDTp7oZlvrOs8rZO4QVDuf+8PbYDoXrcKoZ C4T5bBdUT+vFRJePB1pn9ATvHeYiPSoCKsjyHyRStp1VfHpKN4GZDDEPqM0hBupHjY/d H4DY202gty3n/zRoqd9XhGIv/K4b0cFR4/XaGfCXekEhEpuG4uNdM6kcQItNLWXRLfh1 sHZfr2/aAzN9xdVWfxLtz7DArdmGBdlXlUOZcsq3mpIwVkbPuLwN/8Amvkx4qWMTSQe3 ZXjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-140977-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140977-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t12-20020ac8760c000000b00435ecc552b3si1610402qtq.409.2024.04.11.09.25.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 09:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140977-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-140977-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140977-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A424A1C2127E for ; Thu, 11 Apr 2024 16:25:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84F9B1BC7D1; Thu, 11 Apr 2024 15:37:31 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 438541BC7A1 for ; Thu, 11 Apr 2024 15:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849850; cv=none; b=cMo8fmM/xFn0/FguoJzZ0w6HXgxKyuj7P/JbGAzjmHYOcdOmrCdIQJneSx0oc8Z8Zf6Kp4RImtI7UxV7ekJSlncKNlLky4De8n2udLiblkonkBOKW5tTxRM6W87OtHrXbR7Xn1wjOyXGpxyKy6yL8mNIOYhcPor0IZTRLcFAqdM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712849850; c=relaxed/simple; bh=tm3OudM3U3aNloJACnj/5Z3NyHZxofdkBhqTIgpdlHM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FYuaFaAxhSfVoe9Cx1OcTGKHy8kLS90OVKf1+2GzIPjLIkDpqxpKPpNGlGEwveVCOijJO2lvBj/ybmgxiWw1dMwTfbQND8iHAxJmgRv4aoQy1PgsYypIjq3uymbFhkx9VG9zo1wu7ir3pxpJov5hYsICZbf/Y1ZcQQJhbhN3eI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ruwUR-0008Tj-EC; Thu, 11 Apr 2024 17:37:27 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ruwUQ-00BiHf-Cr; Thu, 11 Apr 2024 17:37:26 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1ruwUQ-000fi4-0y; Thu, 11 Apr 2024 17:37:26 +0200 Date: Thu, 11 Apr 2024 17:37:26 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Trevor Gamblin Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, michael.hennerich@analog.com, nuno.sa@analog.com, devicetree@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, dlechner@baylibre.com, Drew Fustini , Sergiu Cuciurean Subject: Re: [PATCH 2/2 v4] pwm: Add driver for AXI PWM generator Message-ID: <7i44urixaxohcae44gleqm6tvgterwjz7kerbozijxzrau7czd@bl6rkkmpes3u> References: <20240301173343.1086332-1-tgamblin@baylibre.com> <20240301173343.1086332-3-tgamblin@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z5pq6rhmfbngiav5" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --z5pq6rhmfbngiav5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, On Thu, Apr 11, 2024 at 10:07:54AM -0400, Trevor Gamblin wrote: > On 2024-04-11 12:59, Uwe Kleine-K=F6nig wrote: > > > + * - Writing LOAD_CONFIG also has the effect of re-synchronizing all > > > + * enabled channels, which could cause glitching on other channels= =2E It > > > + * is therefore expected that channels are assigned harmonic perio= ds > > > + * and all have a single user coordinating this. > > What does "re-synchronize" mean here? Are all counters reset to zero? > > "harmonic" means that all channels should use the same period length? > Yes, it means that all counters are reset to zero. Harmonic in this case > means that channels can have different periods, but they should be integer > multiples of each other. Should I rewrite the comment to be more explicit? I hesitate to say "yes, please be more specific" because I think it's mood. If all pwm lines restart with their counter =3D 0 as soon as one line is reconfigured (without completing the current period) being a multiple of each other doesn't help at all. So I think the right thing to write there is: - Reconfiguring a channel doesn't complete the currently running period and resets the counters of all other channels and so very likely introduces glitches on these unrelated outputs. (Even if the period was completed, and only assuming configuration updates that don't modify the period, all channels that don't have a period that is a divider of the just configured line (might) glitch. So if you have one PWM with period =3D 200 and another with period =3D 400, everything is fine if you update the latter, however updating the former might make the latter glitch. So essentially you need to have a single period for all channels. That's why I asked if "harmonic" means that all channels should use the same period.) > > Reading https://wiki.analog.com/resources/fpga/docs/axi_pwm_gen I would > > have expected: > >=20 > > /* ch in { 0, ... 15 } */ > > #define AXI_PWMGEN_REG_PULSE_X_PERIOD(ch) (0x40 + 4 * (ch)) > > #define AXI_PWMGEN_REG_PULSE_X_WIDTH(ch) (0x80 + 4 * (ch)) > > #define AXI_PWMGEN_REG_PULSE_X_OFFSET (0xc0 + 4 * (ch)) >=20 > The regmap you find there now reflects v2 of the pwmgen IP; v1 used a step > of 12 instead of 4. The v2 series sent a little bit later on adds this ex= tra > support: https://lore.kernel.org/linux-pwm/20240314204722.1291993-1-tgamb= lin@baylibre.com/ >=20 > I've added support for both versions since v1 of the IP could still be in > use on some devices. Would it be better to have the two patch series > squashed together into a v5 of the axi-pwmgen driver? Not necessarily squashed, but I suggest to send them in a single series. (Note, this doesn't mean "Don't squash". I didn't look at the other series yet, so make a sensible choice yourself (or wait until I come around reviewing that other series and hope that I remember the context to comment about this question. :-) =20 Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --z5pq6rhmfbngiav5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmYYA7UACgkQj4D7WH0S /k42rAf/dYYgtWgQCwgoIgEbZ3xDBVCMESJkV0AhyE6HM01lBRbUSA5YWTE3kV6b opqkoV8PJn0Vc4l0cUkKrW/dtLYdn53XYIzu0G04IJLGN2qpj73UxAl/mcl3r+HW 5UcYF9SQiXF+xcalszH3x2q7g9Lk4YA2j19Jv1322HWp0PIQ59uD5a/MsDhzvsnr e9ZlQ8nnvFVIDozffW+Dzi8TwisbywGvo8IEBtyW8/PQPlNtmvdKfTBiR/1Cjg8p wS6wmlYNqqVBIeCMRWr377gE/16YAUCs7uzksJ33B5BuNT8NlkfmAI+2U5QD5jni 4B2Pqu0G5QpOwMipw/RLhIftklyaeQ== =H5Ix -----END PGP SIGNATURE----- --z5pq6rhmfbngiav5--