Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp980783rdb; Sun, 18 Feb 2024 23:22:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUbzcHBTm5DMN0ml/w7TZ7UtOnnU+8dxa37Rcn2iO3Rsl3cbj/7HoX7rWNlpfGLBosywkHicm1kuTbfalYpVYC6TRjLYMD4IV91KKTNA== X-Google-Smtp-Source: AGHT+IEhv2UAL06DmQDW5CBNdHca1tn9IWDgNJUulP2zM1WabnhJRksn+zOxTtvfcW7oecrMpu8m X-Received: by 2002:a17:906:3492:b0:a3e:6d75:61df with SMTP id g18-20020a170906349200b00a3e6d7561dfmr1872669ejb.45.1708327374258; Sun, 18 Feb 2024 23:22:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708327374; cv=pass; d=google.com; s=arc-20160816; b=JVzvTG/MTMn+W0Q7xLMucT+5Fr8jognYfIGmASflESktqmlOw2/lY1PH+rtZMfgpu/ TVdAqU/ZLX4RzFJTttiXdDFtxXHWFo5HlrcZo6fjHs/HgV0dJ2QWDBRWcYFywnkJTzHl elu6p/RntSoGe0MhM3Hzryjxfeu708yUQrsryby5vXkYEXURZ1w5cHo2cdqVrzeA95PT 4dEBEBaT4odrfsKSXuU6yengtKOG0Q8//xYC66g5QnbRHTRtW3lDm4Zkr8R6ZUV1eP/0 ODQOLMlwG43akZ2EuNoLdeYYlVUMzTeqG9OwtlVvlL2O/fZZfybZNDS2ArBI4oNeqzDA Avdw== 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=5dCSMGPJwoBpw5PXRyaP0nuOddqAKD0OsOkKhNES/YI=; fh=ZZPbh6o7IC4z5NoYIGG7e5qDyg/iVuvz3u6xVK6uxuo=; b=CFn1YEkiGve7TwssozihUWpOKmuU/5QDO1mfV7K7VidPrlkvdKqDa9528HmY5l+MvD oQ9PWNDgPUxLyicHiecIat70cgLs3KUXYZcIYVcoXcAHQUaezbiGhHyGIakBtgPImPL2 yZfwheaerYg9Ws6S/lV42RH3t0vl24m0BhZx/guMCv6JNLgk5Bx7U3hA0L8i4suApcs7 KME/O5htEOwOHZLESTd/lbdCrYj73clLJq9bh+5aZmFfcjWMnL0IEPqVoaZ4rmCB8svg jpA5sW5TShFd+xLJzkN9KlqsOHLNUekToStDUrT49puIbMqBmH6O3c75ux1f8m+xb7K+ 8RiQ==; 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-70820-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70820-linux.lists.archive=gmail.com@vger.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 g17-20020a1709061c9100b00a3eb46980b2si303657ejh.799.2024.02.18.23.22.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 23:22:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70820-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; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-70820-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70820-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0BB691F21122 for ; Mon, 19 Feb 2024 07:22:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAE0620DE1; Mon, 19 Feb 2024 07:22:38 +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 844C720DC5 for ; Mon, 19 Feb 2024 07:22:35 +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=1708327358; cv=none; b=A8SeKGhs+PEkqX45duJcLRNtBMa6nXIr6mCRFzpkxwe6iY346npkZsv6KmLIWHpNYDsDg1VujiiPUnu+qKfxDK6gm+u5cXzKXSbzpt6+ONOcp2iIeXhba5B1bM9zLwar4c+/+B4KJV8zblTE0+U8Ry1MxNeCg5W0A+hhqFpN6zM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708327358; c=relaxed/simple; bh=UP1nq5CRx3BtEKG76frDqPHJU12i2jRZco/i+UQSPTI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XSDK7Yb65XC/iDzkNOLThbj4XX1g+jPxQvhow4kC2I/4S0sj6dUzHO5lOaVELMvqz4JOSQoBD4sqC4AQRFIomY6hdJTtwJixJEU6XSaGA+illTISIqISBcsYZ3aLaEAbLN4Do7YnWAjAV4I+OBCEUJxw59SsLIZXU4eZiinTKw4= 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 1rbxyi-0007Ri-Va; Mon, 19 Feb 2024 08:22:16 +0100 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 1rbxyh-001bBt-SQ; Mon, 19 Feb 2024 08:22:15 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rbxyh-007apT-2W; Mon, 19 Feb 2024 08:22:15 +0100 Date: Mon, 19 Feb 2024 08:22:15 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Raag Jadav Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com, lakshmi.sowjanya.d@intel.com, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/4] pwm: dwc: Fix PM regression Message-ID: References: <20240219033835.11369-1-raag.jadav@intel.com> <20240219033835.11369-2-raag.jadav@intel.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="lujspconz4o5yy2y" Content-Disposition: inline In-Reply-To: <20240219033835.11369-2-raag.jadav@intel.com> 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 --lujspconz4o5yy2y Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Raag, On Mon, Feb 19, 2024 at 09:08:32AM +0530, Raag Jadav wrote: > While preparing dwc driver for devm_pwmchip_alloc() usage, commit > df41cd8bbcad ("pwm: dwc: Prepare removing pwm_chip from driver data") > modified ->suspend() handle to use the pwm_chip as driver_data for > accessing struct dwc_pwm, but didn't modify ->resume() handle with > relevant changes. This results into illegal memory access during > device wakeup and causes a PM regression. >=20 > Fix this by correctly accessing struct dwc_pwm in ->resume() handle. >=20 > Fixes: df41cd8bbcad ("pwm: dwc: Prepare removing pwm_chip from driver dat= a") > Signed-off-by: Raag Jadav > --- > drivers/pwm/pwm-dwc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c > index 8ca1c20a6aaf..c0e586688e57 100644 > --- a/drivers/pwm/pwm-dwc.c > +++ b/drivers/pwm/pwm-dwc.c > @@ -95,7 +95,8 @@ static int dwc_pwm_suspend(struct device *dev) > =20 > static int dwc_pwm_resume(struct device *dev) > { > - struct dwc_pwm *dwc =3D dev_get_drvdata(dev); > + struct pwm_chip *chip =3D dev_get_drvdata(dev); > + struct dwc_pwm *dwc =3D to_dwc_pwm(chip); > int i; > =20 > for (i =3D 0; i < DWC_TIMERS_TOTAL; i++) { If you're ok I'd squash this into df41cd8bbcad adding Thanks to Raag Jadav for providing a hunk of this patch that Uwe missed during creation of this patch. to the commit log. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --lujspconz4o5yy2y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmXTAaYACgkQj4D7WH0S /k4Qmgf8D5jnORguDQnPQg6OUPdRe46RfOY6+BkDi+smMqEj5pksoJ5s3pRZBZYL u2eOV4vh3Oxrb017HAOIEMNcuAvNE4O+vbLEX1ppIZNcFj6o3I/P7ctTLfqLNBcj b3VAYNNlxm3ZH6j5wh9xpD5U+HVBPadFY70WK9tS3kzgQlzzX1dWDSxDKuiaL9KO ZIdmjyygZdTLYCxixnzQQTbzI13wlhLGd1vf7294v0ZFRNxPPrTmfZZzuLdHoQsy BTFGxuuBtidfYdWEw8ptkSFbDYAQDgCXFeKJy8j+RoyKkSMywQTKgTTPXmyHQVT6 hPGk4G4ws89YdtUiUTbAwc/O8XD3Ig== =SIJf -----END PGP SIGNATURE----- --lujspconz4o5yy2y--