Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp225078rdg; Tue, 10 Oct 2023 08:33:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXJynYQaHg+EyxgY708MEGxmlUJcgv46WmzZtXF1+AZsDdYLhtvJ0XXV3asC5WL3h/zvui X-Received: by 2002:a05:6e02:930:b0:351:2288:e132 with SMTP id o16-20020a056e02093000b003512288e132mr17738116ilt.21.1696952035466; Tue, 10 Oct 2023 08:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696952035; cv=none; d=google.com; s=arc-20160816; b=OUdd9sgfPbiP+vWTAvC37uhfy08sczc3eojA/SvceSyVFgZN2dzx4EeUoB2J8yZUBo wqVWSRSIjs5jJscASLw6ZRJNTltbZ0wefVB6hgzZic/VJPR+BNK6bzfT8rmBPYiKZsP+ CVtliuaY9bFcG3jX33QZFxU8qaq6COdpDo3HZ+e9s5zFJWf2U2i7a97Xa/3vfWRISSHg ZV9UxjkWmH+SnhBhQqVKOtuNQHMK3v7zTfUiYVKAyizo/KGRpgqeyFaDeG26Y1N6K5D3 AVHDr15JZB1VWSRC4FETSCPqjxDH1guUG1AGqlHNMS+t3sa5ffjfub//1o053+E7UF7z g94A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lDB8Xo9cJ2VeIdENPctPOpmpBQtYaHFP/tzuWEeiQzA=; fh=63g0MwTp43zJShPFqQBX9SmahiJVKDEEv378dLNtdUY=; b=hfAZejzsBL+n5FachgSlmXeiECMuf6uwPAC6EiHlXJsJFOfYzCMHSztciucrEGXlpQ xefWuLm0AmSPC9Rjht/EfKTlVbXD6R9YVFGapp0719lBsZDZRzZ0shfBQIFOIE0q9BP9 lYAuJeiJNjzF4IJWMhWf+Ey6Lnvqky/Yctq26QC79afKigcwPwlJkRHZYSVsozVApoFC pmYZLx/T6CZESGOKMIcu3SIrak55PWTB1AKXNtyGih8blGOigy8w65+PS6zpHs25FERJ x38j3f9fCkeD22CqMSOPESL7HXmhlScbp60KpZJRTAK/LEsAYVm2bqN2kLLNHLFIBD/3 2gog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EWSBW2fw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u62-20020a638541000000b0058934e72163si3389853pgd.746.2023.10.10.08.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 08:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EWSBW2fw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2CA9682339B8; Tue, 10 Oct 2023 08:33:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233379AbjJJPdl (ORCPT + 99 others); Tue, 10 Oct 2023 11:33:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233381AbjJJPdj (ORCPT ); Tue, 10 Oct 2023 11:33:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D40C6; Tue, 10 Oct 2023 08:33:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35732C433C9; Tue, 10 Oct 2023 15:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696952017; bh=uCeGXpQ2PhB2LhIPquLo56o19XqjK0xYL5TVnuMv/+U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EWSBW2fwN/2X5IF6uuWJ2T0Ug0fKHP0BR60rjiZ98D7b+0D5YH7OZoBJuYr8vewe3 ej5UceVmEfNbjoRbsPD2wXrFdzIiEhd7KURWJmTKOXit+h8xneME7SgE90NNYHutU0 tgNdNs3kql8u5m3FIhC7S0cb95i9y9iQdWSzEDhPFWg34b+QRpPheb++z6SNYEz/5K BySmRLyxiHMXfmf0XTvfacF/pgtoEEjv3qdT16w327kJ0h596RDI3hIPSk1cnahddC hBsp8bFDWLRrKZqqOaIe3F//7c/UKE96Q4LXyv19ozBaEJS1zLGXn/5NSpuHCYj0gb SJd/UewTRBMMA== Date: Tue, 10 Oct 2023 16:33:46 +0100 From: Jonathan Cameron To: AngeloGioacchino Del Regno Cc: lars@metafoo.de, matthias.bgg@gmail.com, ruanjinjie@huawei.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wenst@chromium.org, kernel@collabora.com Subject: Re: [PATCH] iio: adc: mt6577_auxadc: Fix kernel panic on suspend Message-ID: <20231010163346.3e346536@jic23-huawei> In-Reply-To: <20231010121940.159696-1-angelogioacchino.delregno@collabora.com> References: <20231010121940.159696-1-angelogioacchino.delregno@collabora.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 08:33:53 -0700 (PDT) X-Spam-Level: ** On Tue, 10 Oct 2023 14:19:40 +0200 AngeloGioacchino Del Regno wrote: > Commit a2d518fbe376 ("iio: adc: mt6577_auxadc: Simplify with device managed function") > simplified the driver with devm hooks, but wrongly states that the > platform_set_drvdata(), platform_get_drvdata() are unused after the > simplification: the driver data is infact used in .suspend() and > .resume() PM callbacks, currently producing a kernel panic. > > Reintroduce the call to platform_set_drvdata() in the probe function > > Fixes: a2d518fbe376 ("iio: adc: mt6577_auxadc: Simplify with device managed function") > Signed-off-by: AngeloGioacchino Del Regno Applied to the togreg branch of iio.git (as the patch it is fixing is only there for now) Pushed out initially as testing for 0-day to take a look. Thanks, Jonathan > --- > drivers/iio/adc/mt6577_auxadc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c > index 370b84c2d0ba..3343b54e8e44 100644 > --- a/drivers/iio/adc/mt6577_auxadc.c > +++ b/drivers/iio/adc/mt6577_auxadc.c > @@ -293,6 +293,7 @@ static int mt6577_auxadc_probe(struct platform_device *pdev) > mt6577_auxadc_mod_reg(adc_dev->reg_base + MT6577_AUXADC_MISC, > MT6577_AUXADC_PDN_EN, 0); > mdelay(MT6577_AUXADC_POWER_READY_MS); > + platform_set_drvdata(pdev, indio_dev); > > ret = devm_add_action_or_reset(&pdev->dev, mt6577_power_off, adc_dev); > if (ret)