Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1060347rdb; Wed, 24 Jan 2024 03:50:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe8eTNpGA9PaZuc61Z31pq9tVid4CEfXdO7sZt/3Q5D+CVaFrSePc3q65jPDXyZSG6dIG2 X-Received: by 2002:a05:6402:3190:b0:557:7037:1a41 with SMTP id di16-20020a056402319000b0055770371a41mr1112714edb.25.1706097024349; Wed, 24 Jan 2024 03:50:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706097024; cv=pass; d=google.com; s=arc-20160816; b=WlXO6NXGq1hoBc7Hxifp/TExCEHKC78rTGkiq7bfru3phle2UuFHZEwHL5F+JX7rJe LDijsSaqBGDzOBb1Jzduqms7yhjibZeS98ka4DTXkto5yVxSCQ7/nbhEFiM1QpQtnH7q 6sY1505knFB4/Fh5v5n6qsWiWJlzZXFeO8ICfRiakHoyH6Ais3IdOOszzHb23sxGv+9I n3Ffx5aUxib4cSw4ltcRAJ9KgCcgE7kalOrBLH+1BLzZXrwgx/7K2yPBdKI3QtQjl4hC ZVRyHTVcdF+vtqObND6CdLl2Jo1r4srf1TpUGopKaspCISFh7BWCInbJJDN0PwzZ9Zhy zCmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=MBGq51n4k5tu2zEso/Kfv3zeWxFZhKEtwDi8kZYYhgA=; fh=UDtHf83i0XojY2/Sws8wmyLd9XFEVTIi2edOfBacBuQ=; b=Gl5ARfrBzj7gZN+5xhR33rckcejtQDJ6c7//jR+rdItUhLNwHdAnGO2yH5fv/x46fK zOdDWA9QrP6hgQ2UxxHrqarJooj0LO16sN33gHGEo5WGfJ6LZG+JzM55IAMompQoISGO h+fGJIHFavYBarBbLzhKyUl7RaL063a+AcTzxIkafzLss9yJaeDz9pkQFrg1dJf/GSc3 MHyI3K+bES2OejJUnMuBiVuBBEejyXZTK5dZpuR/fRYGk89NpE1p9oznOUKBQBwMZZ6k XHbicWbNqL4WD+Fub178jvQM3qen0V+UXcGxMr1oz3ycstoJv26InEkJx7OXwaQNgOGz ThoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.net header.s=s31663417 header.b="m/eYrZ3J"; arc=pass (i=1 spf=pass spfdomain=gmx.net dkim=pass dkdomain=gmx.net dmarc=pass fromdomain=gmx.net); spf=pass (google.com: domain of linux-kernel+bounces-36908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c6-20020a0564021f8600b005595c517b71si10247475edc.31.2024.01.24.03.50.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 03:50:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36908-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=@gmx.net header.s=s31663417 header.b="m/eYrZ3J"; arc=pass (i=1 spf=pass spfdomain=gmx.net dkim=pass dkdomain=gmx.net dmarc=pass fromdomain=gmx.net); spf=pass (google.com: domain of linux-kernel+bounces-36908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.net 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 1F0361F210D5 for ; Wed, 24 Jan 2024 11:50:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5321151C2D; Wed, 24 Jan 2024 11:48:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="m/eYrZ3J" Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 4182250A8A; Wed, 24 Jan 2024 11:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706096922; cv=none; b=KzDlMLNjM3/z3bch/oL+ikNm2RCU6Yi5+kWKrRBNcNT4EAAOoEoa+LFJEmy1O9NchnFtP8KyGSLAuF9qTcDCFBECwaoipB4y8vF2D++ybtp/vASUrUusxNBt0hzSEyIDbZ2bETTRh98Sv0Jk9rQRJ4AZ6UTuKjWqR3b8e67keFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706096922; c=relaxed/simple; bh=MBGq51n4k5tu2zEso/Kfv3zeWxFZhKEtwDi8kZYYhgA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LK2x5j6tUkIJmuFSl3hnni6tGfFDhJUHv0helYerPVu3zdgveyjUcjDz5pliUzlBxY7HkvIaLxzFV7A2E2hT6zh2AnEX3KQhaSQRjkLJDKKBvFwRmsQm1jVCGS5XKSXdqW4lHVe9epFGjDnYMx4rI7uZZWdM0yootkVlPeRXSaA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=m/eYrZ3J; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1706096902; x=1706701702; i=wahrenst@gmx.net; bh=MBGq51n4k5tu2zEso/Kfv3zeWxFZhKEtwDi8kZYYhgA=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=m/eYrZ3JQYCDHbdHp5EU37fzcvr7dqLkeOx+WMCRFn14Nrbwb9S0mhTMgSt+EkW6 fZDZl+6tZNohK/F4S809YHlree85LtK6h1GY6sFiwcn57adxE/iJJ5X5UaIhnkXrE +28zQIzrzmqcnFzW0rAZfISMuo1hTBBnIFFKP/4M260520u1RE0HaC1ysfUDkGxAx FT7d3qj3RaFQnwvE0urMLBqBG5YWlI+7188RneOWlIL34Cspl0RWLrA8H829zF7xr r+TGyNcxxbLpshinTEYPPfzV6ZhQf68Q5r8ABvck73E8oqNuMP+wWtoLCyK2SVmpP lumrOrcHYgV+T5O6tA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.167] ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N6siz-1r1fsP2i1X-018Mfh; Wed, 24 Jan 2024 12:48:22 +0100 Message-ID: <71426744-7223-448c-bd5b-ff786c5f8e65@gmx.net> Date: Wed, 24 Jan 2024 12:48:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] pwm: imx27: workaround of the pwm output bug Content-Language: en-US To: Francesco Dolcini , pratikmanvar09@gmail.com, u.kleine-koenig@pengutronix.de Cc: festevam@gmail.com, jun.li@nxp.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, oe-kbuild-all@lists.linux.dev, pratik.manvar@ifm.com, s.hauer@pengutronix.de, shawnguo@kernel.org, thierry.reding@gmail.com, xiaoning.wang@nxp.com References: <20240103103421.GA3758@francesco-nb> <20240103110200.1018-1-pratikmanvar09@gmail.com> <20240103122005.GA3347@francesco-nb> From: Stefan Wahren In-Reply-To: <20240103122005.GA3347@francesco-nb> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:rwJl8DHAumo4SDx3Jesd/2R8eqWN2kGR0ljliIKNuWvjhijl3Pd k5LxJeQZdrrRrV7BFQL1oddhIxKGqKTir+8OWK1aSOsFfylZJ+IZBfrPaQNSLyRS7Djp6sj FzQrCEb94+9vnGjq5SLlYZKeUviDG0jRPBBvOGzz2fb4H1xM5zNWEQYOdKnbRFj4Vuwh02k bD3ktbFoHsg8cuAc1ksFQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:FpBdyYjUWIo=;jFb/N0V408yet10BGR49UXehfay FudKxEWyxwbw3NNEzeMb1N/TVWJUmQV4dZfffaXO76sdWA8FvJZSB+0d4L5TSRbEccHRpmyWo viIrbtGCxK3Sutk1uEdYWsoIqDNP+tfTNAuPvySvUn7nWuQpzgBdQNPXVfi9KnfaiUswvpNdJ zuzy/AeEi9gfWidRmizzULC/keCwxb2Bd+2DYWnwxv7q3xueD2D4OVV7lkC49HA3wiwMnPqhP BtkEsaXw6aJAgGYeQ2qS45B8OOi8p7f+uEb/5dmPPrNfWLvJd6tzyISnFVT4NjMxJq0rw/5Bp cneQYp73tFiX6WbDGWU2RLR7nmX3MDLUWTn3Xd7tCIILDWsMvFKIdy6E8LHv1FOsOqq+P+A1O U0Iitj5isxkf71y+T87PMfNgU/loe7Z8tmdXcUGqRLUevKW3oo8eZEm46TpgIMYbi/WJ4Y3dv OLQ6hiB7Vx8bfBQq+IjqhF+idw67whxd31jtj4EGtZa/PYcDDLi0jP9YIF18ZPq+Py5wqDyYW T6VZYoyj3KojJLRn0vJMXEkvdoXpEp80HklJ/eS79G1OQ5XyyIjUzDd+rPGo6HbTLXwy9Hl2k TW+jfBKiOJSmeuculO+DIREzlPAxKy5mZN+jkqJ3MQNcfSihqVQyYsTaZ46z7mu6bOtfZEUux 0jLiO4epT4OTMtEgokXfRlXd15eAnlVQJ4sHXJwKV5AZqtH10HmwPUsol+0rm91MAYSD4f2Qe LVxgfWBMkWj+eLaEBHCoxO+s5wmbZ4WG/QN8KXBzDq3lTkc2nGueDKv3KT0MbedBMbepu26be Dr0KLkcpUlLVHs4Y8E2fLPhkM8KyNE5vCLGGJW5uyEw7km0pX/7XZCsz3l0xo7bqtutIcwD1u /GEGbmZN8TBGe5R3+68ENQkQgvTTPv6qfjttVVg5G2SnfrpwGJ8ewG2FAlsBG43/+X4zpHkaE MX9p91fmephZdWeHAL3vT/G+Q0A= Hi, Am 03.01.24 um 13:20 schrieb Francesco Dolcini: > Hello Pratik, > > On Wed, Jan 03, 2024 at 04:32:00PM +0530, pratikmanvar09@gmail.com wrote= : >> From: Clark Wang >> >> This fixes the pwm output bug when decrease the duty cycle. >> This is a limited workaround for the PWM IP issue TKT0577206. >> >> Root cause: >> When the SAR FIFO is empty, the new write value will be directly applie= d >> to SAR even the current period is not over. >> If the new SAR value is less than the old one, and the counter is >> greater than the new SAR value, the current period will not filp the >> level. This will result in a pulse with a duty cycle of 100%. >> >> Workaround: >> Add an old value SAR write before updating the new duty cycle to SAR. >> This will keep the new value is always in a not empty fifo, and can be >> wait to update after a period finished. >> >> Limitation: >> This workaround can only solve this issue when the PWM period is longer >> than 2us(or <500KHz). >> >> Reviewed-by: Jun Li >> Signed-off-by: Clark Wang >> Link: https://github.com/nxp-imx/linux-imx/commit/16181cc4eee61d87cbaba= 0e5a479990507816317 >> Tested-by: Pratik Manvar >> Signed-off-by: Pratik Manvar > A very similar patch was already send in 2021 [1], did it had review > comments not addressed? Please have a look. > > In general please refrain from sending a new patch version every other > day, while every Linux kernel subsystem has different rules and a > difference pace of development, in this specific case sending a v3 just > adding your signed-off-by without allowing a little bit of time to wait > for more feedback is just not sane. > > [1] https://lore.kernel.org/all/?q=3Ddfn%3Adrivers%2Fpwm%2Fpwm-imx27.c+A= ND+b%3A%22Clark+Wang%22 thank you, this is very helpful. Unfortunately i don't have the knowledge and resources to continue this work. @Uwe It seems that you were able to reproduce this issue. Is it possible to trigger this via sysfs and some kind of script?