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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3E55C43334 for ; Wed, 15 Jun 2022 17:33:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qTeD48d0Hamq5LxCsHAU72PwbTJXtuLLqyos3R7yV/I=; b=HWGuO8bFM9SHfq Ec6U/0UF0CTUel/fDH1JDHaWSYtdsPVKvUOOk8p3abMtSC6oEM32Qkp/PhoYqnVzn/QDMSK28gHbq 4SGpSz0v9bdhUoHSjwJtxjatVH5cfkO/yf4E5R8uE6sWkLJ0yPxoxgjLAwGO07KxQVa0IN8rO/5Ye oRjcWz7jNADZWJ7pFn8FmOmXCz59Gnc/inen1KcKMAK7f5G3pnXD4vqcYOISp6m/Ht2fjUZMsRAA4 DBPRP31K6S6aX57bqPXUN4qryw5fog5Wf3UF861mhB1YxrtnQ3zYEaqbAzQ7HWzwkVtaDwJ67DRfM nTPPQbC7p2z2jFKyQ8uA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Wt2-00FieW-AT; Wed, 15 Jun 2022 17:33:00 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1Wsn-00Fiap-VG for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 17:32:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B736C153B; Wed, 15 Jun 2022 10:32:42 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 661013F73B; Wed, 15 Jun 2022 10:32:41 -0700 (PDT) Date: Wed, 15 Jun 2022 18:32:31 +0100 From: Cristian Marussi To: Florian Fainelli Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [PATCH 11/22] firmware: arm_scmi: Add SCMIv3.1 extended names protocols support Message-ID: References: <20220330150551.2573938-1-cristian.marussi@arm.com> <20220330150551.2573938-12-cristian.marussi@arm.com> <6f865d7f-fde8-d923-3c7e-d12bfbc370a6@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_103246_175309_90D1F38E X-CRM114-Status: GOOD ( 40.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 15, 2022 at 10:19:53AM -0700, Florian Fainelli wrote: > On 6/15/22 09:29, Cristian Marussi wrote: > > On Wed, Jun 15, 2022 at 09:10:03AM -0700, Florian Fainelli wrote: > > > On 6/15/22 02:40, Cristian Marussi wrote: > > > > On Wed, Jun 15, 2022 at 09:18:03AM +0100, Cristian Marussi wrote: > > > > > On Wed, Jun 15, 2022 at 05:45:11AM +0200, Florian Fainelli wrote: > > > > > > > > > > > > > > > > > > On 3/30/2022 5:05 PM, Cristian Marussi wrote: > > > > > > > Using the common protocol helper implementation add support for all new > > > > > > > SCMIv3.1 extended names commands related to all protocols with the > > > > > > > exception of SENSOR_AXIS_GET_NAME. > > > > > > > > > > > > > > Signed-off-by: Cristian Marussi > > > > > > > > > > > > This causes the following splat on a platform where regulators fail to > > > > > > initialize: > > > > > > > > > > > > > > > > Hi Florian, > > > > > > > > > > thanks for the report. > > > > > > > > > > It seems a memory error while allocating so it was not meant to be > > > > > solved by the fixes, anyway, I've never seen this splat in my testing > > > > > and at first sight I cannot see anything wrong in the devm_k* calls > > > > > inside scmi_voltage_protocol_init...is there any particular config in > > > > > your setup ? > > > > > > > > > > Moreover, the WARNING line 5402 seems to match v5.19-rc1 and it has > > > > > slightly changed with -rc-1, so I'll try rebasing on that at first and > > > > > see if I can reproduce the issue locally. > > > > > > > > > > > > > I just re-tested the series rebased on v519-rc1 plus fixes and I cannot > > > > reproduce in my setup with a few (~9) good and bad voltage domains. > > > > > > > > How many voltage domains are advertised by the platform in your setup ? > > > > > > There are 11 voltage regulators on this platform, and of course, now that I > > > am trying to reproduce the splat I reported I just cannot anymore... I will > > > let you know if there is anything that needs to be done. Thanks for being > > > responsive as usual! > > > > ... you're welcome... > > > > I'm trying to figure out where an abnormal mem request could happen... > > I think the problem is/was with the number of voltage domains being reported > which was way too big and passed directly, without any clamping to > devm_kcalloc() resulting the splat indicating that the allocation was beyond > the MAX_ORDER. The specification allows for up to 2^16 domains which would > still be way too much to allocate using kmalloc() so we could/should > consider vmalloc() here eventually? > Yes I was suspicious about the same and I was starting to think about vmalloc in general across all domain enumerations even if this is may not be the case for your splat... > In all likelihood though we probably won't find a system with 65k voltage > domains. > > > > > can you try adding this (for brutal debugging) when you try ? > > (...just to rule out funny fw replies.... :D) > > Sure, nothing weird coming out and it succeeded in enumerating all of the > regulators, I smell a transient issue with our firmware implementation, > maybe... > > [ 0.560544] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.560617] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.560673] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.560730] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.560881] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.560940] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.560996] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.561054] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.561110] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.561168] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.561225] arm-scmi brcm_scmi@0: num_returned:1 num_remaining:0 > [ 0.561652] scmi-regulator scmi_dev.2: Regulator stb_vreg_2 registered > for domain [2] > [ 0.561858] scmi-regulator scmi_dev.2: Regulator stb_vreg_3 registered > for domain [3] > [ 0.562030] scmi-regulator scmi_dev.2: Regulator stb_vreg_4 registered > for domain [4] > [ 0.562190] scmi-regulator scmi_dev.2: Regulator stb_vreg_5 registered > for domain [5] > [ 0.564427] scmi-regulator scmi_dev.2: Regulator stb_vreg_6 registered > for domain [6] > [ 0.564638] scmi-regulator scmi_dev.2: Regulator stb_vreg_7 registered > for domain [7] > [ 0.564817] scmi-regulator scmi_dev.2: Regulator stb_vreg_8 registered > for domain [8] > [ 0.565030] scmi-regulator scmi_dev.2: Regulator stb_vreg_9 registered > for domain [9] > [ 0.565191] scmi-regulator scmi_dev.2: Regulator stb_vreg_10 registered > for domain [10] > Ok, this was another place where a reply carrying a consistent number of non-segmented entries could trigger an jumbo-request to kmalloc... ..maybe this is where a transient fw issue can reply with a dramatic numbers of possible (non-segmented) levels (num_returned+num_remaining) (I filter out replies carrying descriptors for segmented voltage-levels that does not come in triplets (returned:3 remaining:0) since they are out of spec...but I just hit today on another fw sending such out of spec reply for clocks and I will relax such req probably not to break too many out-of-spec blobs out in the wild :P) So let me know if got new splats... Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel