Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754912AbbLIKHz (ORCPT ); Wed, 9 Dec 2015 05:07:55 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:57113 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754356AbbLIKHo (ORCPT ); Wed, 9 Dec 2015 05:07:44 -0500 From: Arnd Bergmann To: John Stultz Cc: Bjorn Andersson , lkml , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Vinay Simha BN , Haojian Zhuang , "devicetree@vger.kernel.org" , Android Kernel Team , agross@codeaurora.org, "linux-arm-msm@vger.kernel.org" Subject: Re: [RFC][PATCH] misc: Introduce reboot_reason driver Date: Wed, 09 Dec 2015 11:07:25 +0100 Message-ID: <10759786.VG6jMebqAj@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1449610162-30543-1-git-send-email-john.stultz@linaro.org> <20151208220722.GG4000@usrtlx11787.corpusers.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:JZvsupjefoK+nULyRm+8FuNnu9wNDVelczmpzAaK0s8mguwNa6r dEtleImWp+2pLS6zXSvQQYU2GL4KoMoNYCku/QlPnmeR8xL9hWfDnOj51VZ8BbLqDsYKsUX 4AERg8fGeJyQTIgZUV8kt+T9SpQBPVhi9aAE66Rr8iT/EZZ/fXo4H2TMBELGqRnNmfXbTRc mTawmhRwmu9FFjLIEUVCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:mOuvoz79W+E=:Bl0WS5tsjW5jDL1VH91pqE iUkwdmQNx4KZx0bf8nlieeuKc4YPm8bz594+utTbEOl7eXS5/hzmZ+JXt0K+jcCtfTxzhpQKX eH+AycCL9q9PLjHSlTeoUGroh7BLSOIVYyMmmtNOmOrPqy2katn+wr0JOaHNvUcll5ui5Kn25 ydxQQR51pATKZWjynXJQ+CdGZ/GtwDltgiJnYP/YlwUk57WAOvzEqtKc3uemj15QaFupgHRM0 RUXE4+Kle1QTwiVCnnRVYtJZLST7zYU9jll9J2qUJVv0upD5mPnODCw3Xa4AmSPSjoKQSO/Pt 60dVTtATimJHtsB2tRbvCHhXTa1SHgcPF2TsOZ4w13KdvREWXyautvCdy9qCfvCfYxJGcz0oL 09hVZffy4ymRauUp3vceRrEgWSP6xCyFFLkm3DsxRIYw1gdMfzQ9LqEmMwEMuYzmKtxdXXRYK JcE1vo7JHC2DbNBcj7q/1ytku6UfgI261jOzEbbncoxckTbn/Ojy3Sea7wHpzVFyHSw7e+Qu7 udbr6aSvE5fcpVvHNvdcVOW2yI/zqcs0jWeLOX7rqnK63zpj67sjfHnUXmpvfn2FcB4aqAbf1 KLFsuDgqqHy+o7NHrWmMJXko83g90XAe+mCe5HX/dthUWRWzxQwq6FPvOPFLMp0BSDag+sZUA cfyKtBsyDU4jZvqHl6AG+zDsJ7F4XYLnnwQfhdulKVdDxP1HZqmDG7+DbaV+BVmtNdKobYF4y E8nKZ4OSx98hlspd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3645 Lines: 82 On Tuesday 08 December 2015 16:22:40 John Stultz wrote: > >> diff --git a/arch/arm/boot/dts/qcom-apq8064-nexus7-flo.dts b/arch/arm/boot/dts/qcom-apq8064-nexus7-flo.dts > >> index 5183d18..ee5dcb7 100644 > >> --- a/arch/arm/boot/dts/qcom-apq8064-nexus7-flo.dts > >> +++ b/arch/arm/boot/dts/qcom-apq8064-nexus7-flo.dts > >> @@ -282,6 +282,15 @@ > >> }; > >> }; > >> > >> + reboot_reason: reboot_reason@2a03f65c { > >> + compatible = "reboot_reason"; > >> + reg = <0x2A03F65C 0x4>; > >> + reason,none = <0x77665501>; > >> + reason,bootloader = <0x77665500>; > >> + reason,recovery = <0x77665502>; > >> + reason,oem = <0x6f656d00>; > >> + }; > >> + > > > > This address refers to IMEM, which is shared with a number of other > > uses. So I think we should have a simple-mfd (and syscon) with this > > within. > > Errr.. I'm going to have to read up there. I'm not super familiar with > any of those drivers, so I'll try to see how exactly they would map in > here. Is this an SRAM? We already have a generic SRAM binding, and I think this would fit in there. > > I like the fact that you don't hard code the magics in the > > implementation, as I've seen additions from multiple places - so perhaps > > it should be made even more flexible. > > > > OMAP seems to use strings here instead of magics, but the delivery > > mechanism looks to be the same. But I think of this as Qualcomm > > specific. > > Yea. This is good feedback. EFI bootloaders have their own > implementations as well. I suspect we'll need a few different driver > "types" to handle these differences, ie: value vs string. > > I'll maybe extend the compatible string to make it clear that this is > a "value" style, and we can extend it with a string type later if > folks care? If the two known implementations are already fundamentally different, there is a good chance that other vendors have found some more ways to do the same thing, so we might need to do this as a framework, or merge it into an existing framework. Maybe it can be done in the same driver that also handles rebooting the machine? Those are typically in drivers/power/reset or in drivers/watchdog/ for machines that use the watchdog as the only way to reboot the machine. We can have additional device specific properties along with the reboot method (e.g. a reference to the SRAM or some syscon node) and add common code in another file if we need it. > >> + /* initialize specified reasons from DT */ > >> + if (!of_property_read_u32(pdev->dev.of_node, "reason,none", &val)) > >> + reasons[NONE] = val; > >> + if (!of_property_read_u32(pdev->dev.of_node, "reason,bootloader", &val)) > >> + reasons[BOOTLOADER] = val; > >> + if (!of_property_read_u32(pdev->dev.of_node, "reason,recovery", &val)) > >> + reasons[RECOVERY] = val; > >> + if (!of_property_read_u32(pdev->dev.of_node, "reason,oem", &val)) > >> + reasons[OEM] = val; > > > > I would like for this to be less hard coded. > > Any tips here on how to do so? If we move this logic into the qcom reset driver in drivers/power/reset/msm-poweroff.c, we should be good. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/