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 DA2A7C43334 for ; Wed, 15 Jun 2022 17:21:04 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=peCgH+VfqwW6ngi1B6oJO7M0IWLj7ptID1W6CjRG2nc=; b=3NQ3ZuYJZ8HV+O 1/miG2nCKsTwhWB41BK1c9UR6AAuDl8K0Hx3Fwe3uocbZH8fP/CjJVgxruNBkESlgl84F/26qxsyl +zgm2l8CsSYDm//R77Xq9VxNrAb6NvfvvRm65mZRWXN87m1n2yX2pKTHVxd5jEcbUWV7Q1q283ej6 ZgisGO0KxBlF1rHA7VWqpsp2WhdulQiBcvND/mf2aktMmsnbjOPzG6oR51SpocXp+CxZEJCVHjWN/ DdzpGZ86PzoKc9h1vHvcvKcgjev9gphXXGiqcMqSiV4nvBHNa++NVGAlMyOQL+fQbzryOLL2MhG7R wNrRCtxUMKwmqfs7QV0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1WgS-00Fesy-O3; Wed, 15 Jun 2022 17:20:00 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1WgO-00Feri-Su for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 17:19:58 +0000 Received: by mail-pj1-x1035.google.com with SMTP id o33-20020a17090a0a2400b001ea806e48c6so2662039pjo.1 for ; Wed, 15 Jun 2022 10:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=N8MeUCxkN/driIBOzauf+scZ7RKLz2Mt8aZBA30VF2A=; b=fm/Qpz4nICRi8zlUx7DOcrSsaAoGrD2oOQNn+SRQmpZ8qB2dusHM0blFir8HqLlbIE Av1XiLVLmVXB0ObDMddprXovZiJUVrxiyUPlpJ0ZhcqWhX6YgTdj0x7x6LzMMs7qC7t+ nVsedfeI4PBqrRxPfYS9smLHv3yZwK3zTt3oIJBNkqPDvKYUomnWkjmxyziscQSn6oiN ir1dk7fyGifjnn0QLU/GTmXPvYPS30h54S4wvZUPjHS1JSIkgxXVpAIJHhuhTHT3G+6F 4ziU5b6ZbCEEJb6uvY5dpRfuhNaFN6Zz2naVCcVYQ0rtFSsAAcsvJ+Ja9D+F6fvHP5A5 MYPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=N8MeUCxkN/driIBOzauf+scZ7RKLz2Mt8aZBA30VF2A=; b=yTWtmUXJZMt6LpMizGjhZPeiBn/x0KPxEmnp+Jr16W++ye11R28OL49Hn5a+lGNTbk auElB51PwfBOV0wH1EKtUCIGGgN2kyt5rRFZrNGdQ0KGUCm1QKm06H5lwr7wjrRcE+yO AV7Bhlyy4tl6b3wcH2BoP+Oxti0X8AaAxFIu6shk0lX9lOrQWRNj0EzO2g6rR1oYhd3L y7J8bIMqQa3q92Rdgsj8Rz29VR4gpUqDz/JOEnH/M1rZNNG7wlRqfg4BOZ3IkmGbIg26 JwbxaFWT0dLDRWHCStH1Lie1sOzdguRIOUyMg7rQ9q92elmIljzKA2c38ZaMIcg448bG gC7g== X-Gm-Message-State: AJIora8nTqKEs85cQgROAfIlkk0Q/H/kHNJ5VM1TZ0vSyBV1PiqDnCPK dPKtcmMjJnVmSiOavwepJHI= X-Google-Smtp-Source: AGRyM1ub4ixb7O9aDNAn3sy9QV4CJSnU4oyYwtR7YjA//FmlRZx787o86B/f+nltQaF8t4al3O0Pbg== X-Received: by 2002:a17:90b:3142:b0:1e3:1253:be27 with SMTP id ip2-20020a17090b314200b001e31253be27mr526127pjb.44.1655313596001; Wed, 15 Jun 2022 10:19:56 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id cf6-20020a17090aebc600b001e2da6766ecsm2073106pjb.31.2022.06.15.10.19.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 10:19:55 -0700 (PDT) Message-ID: Date: Wed, 15 Jun 2022 10:19:53 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 11/22] firmware: arm_scmi: Add SCMIv3.1 extended names protocols support Content-Language: en-US To: Cristian Marussi 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 References: <20220330150551.2573938-1-cristian.marussi@arm.com> <20220330150551.2573938-12-cristian.marussi@arm.com> <6f865d7f-fde8-d923-3c7e-d12bfbc370a6@gmail.com> From: Florian Fainelli In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_101957_026971_63419E79 X-CRM114-Status: GOOD ( 23.97 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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? 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] -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel