Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp108195rdg; Tue, 10 Oct 2023 05:46:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFT892JPpiAZ2kRIvE1DIT3FlcojFz8DBguZEe3ga1Wi3MuK/UM2Ss4Cq3uuFjloFPvMvKY X-Received: by 2002:a05:6a00:1a42:b0:690:c75e:25c8 with SMTP id h2-20020a056a001a4200b00690c75e25c8mr17666147pfv.7.1696941992357; Tue, 10 Oct 2023 05:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696941992; cv=none; d=google.com; s=arc-20160816; b=BUhBweuyK7TlYrnB9QKjbqGx/TMI/CGHt9rRdS+K/PpWv5fk9CbTDXI4fyAbG0M4LZ 68VJGqOdmhFXCJMdCKBWa1bU60JE8ifFrXa1edwlDr5kHomIsSi2bsde7NL67GhRV8uE nGvxOdAaokJ1kvn+gDK/zh+//0G2xN0OooVr7hWogCShzI/nqqbLBoafZmPtcPXnQSgh w0wU+JWlz6IB1jEVD7Osorku4icczZ5PTUhbLV45/jjmcUoopd+X3zLH6vnd+3FQNX6K PyY401k7pHgiL9ZVt9suCKCTrE4ow2hzi5xRRxs9+hue3J2TadUNS5JwC5gWIdTdQrhK updQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=199RxfkmlH6n0PnGVzkV097mb/3xpEnD5+hjR+TaTtE=; fh=czqpk78njqdaA1l0BdtJdX+p0MiGLloRl5YaSaYI/dY=; b=lxU2pgD5R2HB+R8itGyOElBfKVGofHNmd5Yud8qNNlfC1kxFwIzPHIfpruw0qH1WD0 d4imrHXfC98bxIFvgUGq0wOfdB8XMrQXq1x/wov0bqlYcru6l+BfS9D0A0oXBwqKt/Gh JGTxqLJArMe+Fb9TlJdez95y8L2xS753luQi78x/BGu7gQuLlHPM8M+LhbFR9xy/ha6j QcHFNciNZh8XdSuyjsR5OPPkT/f+Y2sO7R8+xGyw40B2Huj7WuGavpXJue8oGJ8yswRd wUFwMFk6N7h6AfX6xLtaV+jMywdtybIYGbY0nTAlzNp9VJlGn4G+G3EsjKUqZxIA8lrq rtew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=JmH7D69W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id h71-20020a63834a000000b005824bad8f85si11742757pge.854.2023.10.10.05.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=JmH7D69W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5AFFD807CF59; Tue, 10 Oct 2023 05:45:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231794AbjJJMpE (ORCPT + 99 others); Tue, 10 Oct 2023 08:45:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231937AbjJJMo5 (ORCPT ); Tue, 10 Oct 2023 08:44:57 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A31B2B6 for ; Tue, 10 Oct 2023 05:44:54 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-52bd9ddb741so9893537a12.0 for ; Tue, 10 Oct 2023 05:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1696941893; x=1697546693; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=199RxfkmlH6n0PnGVzkV097mb/3xpEnD5+hjR+TaTtE=; b=JmH7D69WsnkCkebbS1hjyIq1DuX2G87kMsDENdIn42KMUVTSXMvJgUyNvmnQfFfAnm sAKNeFr2KbGhzZAUM3d2FUiGhmGzIi4g10huT6y77SiM7YeAC3dRh/gWHegXxVzDspHN pKg6bzLEJdhKasD1fiFht1TAtuU1kDNtjeIOqN6K9LpICrjKH/O18IVJm0IKsCbiCqwZ /r8jwbfB5ky21HoGdBvMIl0HvKZ3H8X6k9MzMiaJhNOcYiQObCU9qsa6vM5XI6ByFQZ8 B/e+VufkCyU3uhjfAxez62kDh32czXg17bDFFoik6Gge8EREhmxGwXpXmcFySg86QTUW Ah7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696941893; x=1697546693; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=199RxfkmlH6n0PnGVzkV097mb/3xpEnD5+hjR+TaTtE=; b=NpqRgAfpdbF1elqN6N1f80XVPBob4pVrpnXsw9eTqnEyfr/Y5KghfgJ5gmuKJ5NcGw JVOo46S/EVZqMl1WC87xQSbCktxEp90h5qgyjSv1ytKLQ2CFhcVcTg9EMSyDUqUT3W7K wRguWqKabo4M2OyCNOqKOPAl/t08SZuuuJN/sjE5HHJrWRQ8uHvaLSSMP1rp/adKW0hl H+JPJa/ToJHMowxg3VwjPbPHbx8nsYIUYiK/CKVlQo6znTOO1aNRAuw3Ql1/SgU1JBQ5 0Uzbdky6TBHx+RMNCTHmI87OroQ+15E6w5+7Se+RL/X4P+R4ZaxWKx6ILCYHjAr8bSFe UKTQ== X-Gm-Message-State: AOJu0YxwsGOVvTf3N9ml0Qx2mHPjP6M16a72uGgbcqK3yhelZez0BVnb ZSugxB+3IX+yQDHUNCAPMAfz0w== X-Received: by 2002:a17:906:530b:b0:9b2:b975:8327 with SMTP id h11-20020a170906530b00b009b2b9758327mr17819526ejo.65.1696941892862; Tue, 10 Oct 2023 05:44:52 -0700 (PDT) Received: from blmsp ([2001:4091:a246:8222:872:4a5b:b69c:1318]) by smtp.gmail.com with ESMTPSA id qq25-20020a17090720d900b00977cad140a8sm8410416ejb.218.2023.10.10.05.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:44:52 -0700 (PDT) Date: Tue, 10 Oct 2023 14:44:51 +0200 From: Markus Schneider-Pargmann To: AngeloGioacchino Del Regno Cc: jic23@kernel.org, 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: <20231010124451.iopfw2gnc54dap6f@blmsp> References: <20231010121940.159696-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231010121940.159696-1-angelogioacchino.delregno@collabora.com> X-Spam-Status: No, score=2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:45:20 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 02:19:40PM +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 Reviewed-by: Markus Schneider-Pargmann Best, Markus > --- > 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) > -- > 2.42.0 >