From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0378C433F5 for ; Wed, 10 Nov 2021 21:36:34 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECAFD610FF for ; Wed, 10 Nov 2021 21:36:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ECAFD610FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HqJ7z5G6Zz30Ph for ; Thu, 11 Nov 2021 08:36:31 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lD15/Vjq; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::12e; helo=mail-lf1-x12e.google.com; envelope-from=digetx@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lD15/Vjq; dkim-atps=neutral Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Hq5X95bxRz2xCG; Thu, 11 Nov 2021 00:38:15 +1100 (AEDT) Received: by mail-lf1-x12e.google.com with SMTP id p16so6110310lfa.2; Wed, 10 Nov 2021 05:38:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WtBceGsuNkvJWXKObFPMz3/faWDyi74JI/F+pRXLbvs=; b=lD15/VjqUInHM3dZidzqbDMtU49DALHBS4Ay1C40nUi5lxcF7BMQ5EnHXXzG4e6Wu9 KEtaN/+P0k1Njtg3ToWP1/KM8wIXtXfb2GMI1jVOw30JDescBKoGZyWGQkHaeFFMF1Cx 557WfM+CudsCe0rfY4tn9Qu/fZ6FXK7hdk9Wu9dTaZ71QukQt6Mf26SjkHrJIeq+MupJ /vckqogxswS5UmhYqlk9vNHYa1S8ChRuc7OrOB+B+82hPJEZwrpCBIceX5S6KM+5NMWF FSm1MYMPHMKiWtHmf2u4gxwpqn+oAaxX8rT7fWDE5HDvTnS5+IytbAjE77fEnTdMp1QG 4sBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WtBceGsuNkvJWXKObFPMz3/faWDyi74JI/F+pRXLbvs=; b=vE7CEUEkioGMWDnpxnrl8ts2TtZT9gPmFxJdqsVvbPFSVAZjMxYtSMnON9Uckyh3DS P3Ae456fDjTsm5oxkfVCIMMngMEvHqfU+tUNIA5QciQw161CpAPrFkctQQ+XPVeT7GFS JcCFyH/PPGk5X4H2apxMxByFciY181j4MHsyq0MtUW8CSifEiX2pvF2xcxAwMPhoZLF9 J19eMRePg96xaNFNIZm+HNhXNilOqXiAsuj+jokNHlVmbmI6AD0iNepPt+VBC+7kP6gk EtzfmE3ymbm7Ea7Uefs7AW4HP0Wh77UugMPAmeIUR6QrJAlIftg3Au6SkFNUsSqoVjEs /O5Q== X-Gm-Message-State: AOAM5302G/dQOrxm23FgTwM4NDfN2E8K63Mx2xou/WO9GG/k2qIaGc4m su+RMRT8mea0gWOXVzOLsAg= X-Google-Smtp-Source: ABdhPJxBHb2JNLIS70NEJi27Oqj8IHGODoK0u1oyS1uV5awJ6mpkyMTiHwL65DF0nZiuWJMJYZ6aSw== X-Received: by 2002:a05:6512:c02:: with SMTP id z2mr14599668lfu.445.1636551490068; Wed, 10 Nov 2021 05:38:10 -0800 (PST) Received: from [192.168.2.145] (79-139-177-117.dynamic.spd-mgts.ru. [79.139.177.117]) by smtp.googlemail.com with ESMTPSA id z25sm60391lja.99.2021.11.10.05.38.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Nov 2021 05:38:09 -0800 (PST) Subject: Re: [PATCH v2 27/45] mfd: ntxec: Use devm_register_power_handler() To: =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= References: <20211027211715.12671-1-digetx@gmail.com> <20211027211715.12671-28-digetx@gmail.com> <9a22c22d-94b1-f519-27a2-ae0b8bbf6e99@roeck-us.net> <658cf796-e3b1-f816-1e15-9e9e08b8ade0@gmail.com> <5a17fee3-4214-c2b9-abc1-ab9d6071591b@roeck-us.net> <04103df3-1ef4-b560-a5cb-fa51737d28ad@gmail.com> From: Dmitry Osipenko Message-ID: Date: Wed, 10 Nov 2021 16:38:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 11 Nov 2021 08:35:52 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Rich Felker , linux-ia64@vger.kernel.org, Tomer Maimon , Santosh Shilimkar , "Rafael J . Wysocki" , Boris Ostrovsky , Catalin Marinas , Linus Walleij , Dave Hansen , x86@kernel.org, Tali Perry , Thierry Reding , Guo Ren , Pavel Machek , "H. Peter Anvin" , linux-riscv@lists.infradead.org, Vincent Chen , Will Deacon , Greg Ungerer , Stefano Stabellini , Benjamin Fair , Yoshinori Sato , Krzysztof Kozlowski , linux-sh@vger.kernel.org, Lee Jones , Helge Deller , Daniel Lezcano , Russell King , linux-csky@vger.kernel.org, Jonathan Hunter , Tony Lindgren , Chen-Yu Tsai , Ingo Molnar , Geert Uytterhoeven , xen-devel@lists.xenproject.org, linux-mips@vger.kernel.org, Guenter Roeck , Len Brown , Albert Ou , linux-omap@vger.kernel.org, Vladimir Zapolskiy , linux-acpi@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Mark Brown , Borislav Petkov , Greentime Hu , Paul Walmsley , linux-tegra@vger.kernel.org, Thomas Gleixner , Andy Shevchenko , Nancy Yuen , linux-arm-kernel@lists.infradead.org, Juergen Gross , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, Nick Hu , Avi Fishman , Patrick Venture , linux-pm@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, Palmer Dabbelt , Philipp Zabel , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, openbmc@lists.ozlabs.org, Joshua Thompson Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 10.11.2021 13:43, Jonathan Neuschäfer пишет: > On Mon, Nov 08, 2021 at 02:36:42PM +0300, Dmitry Osipenko wrote: >> 08.11.2021 14:22, Jonathan Neuschäfer пишет: >>> On Sun, Nov 07, 2021 at 08:42:33PM +0300, Dmitry Osipenko wrote: >>> [...] >>>> EC drivers tend to use higher priority in general. Jonathan, could you >>>> please confirm that NTXEC driver is a more preferable restart method >>>> than the watchdog? >>> >>> Yes. The original firmware uses the NTXEC to restart, and it works well, >>> so I do think it's preferable. >> >> Thank you, then I'll update the NTXEC patch like this: >> >> https://github.com/grate-driver/linux/commit/22da3d91f1734d9a0ed036220ad4ea28465af988 > > I tested again, but sys_off_handler_reboot called a bogus pointer > (probably reboot_prepare_cb). I think it was left uninitialized in > ntxec_probe, which uses devm_kmalloc. I guess we could switch it to > devm_kzalloc: > > diff --git a/drivers/mfd/ntxec.c b/drivers/mfd/ntxec.c > index 1f55dfce14308..30364beb4b1d0 100644 > --- a/drivers/mfd/ntxec.c > +++ b/drivers/mfd/ntxec.c > @@ -144,7 +144,7 @@ static int ntxec_probe(struct i2c_client *client) > const struct mfd_cell *subdevs; > size_t n_subdevs; > > - ec = devm_kmalloc(&client->dev, sizeof(*ec), GFP_KERNEL); > + ec = devm_kzalloc(&client->dev, sizeof(*ec), GFP_KERNEL); > if (!ec) > return -ENOMEM; > > > > With that done, it works flawlessly. Good catch, thank you! I'll correct this patch and add yours t-b.