Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2123177rwd; Fri, 26 May 2023 01:58:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4LGvvW5hY7FUDxTlcnq6DKnR97n+BunTf4c8Lk6JjcUHMnIJ5YgERFrkZnVikPlWfaKd1P X-Received: by 2002:a17:903:1209:b0:1ae:6a3:d058 with SMTP id l9-20020a170903120900b001ae06a3d058mr2194569plh.36.1685091482473; Fri, 26 May 2023 01:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685091482; cv=none; d=google.com; s=arc-20160816; b=nKT1QgY5pu2y2exonxy3UYjx+sLDueOkbWUxYgRbfsw6nf9oF4AqSjuZ3e8BixzxW7 qAZ6qAjeAVEHhKIXmWVcxmpMF0L8G3mVDjZttd+j25jGo9GJFGjNvolwDHbADyntci/n EvcCG1rALIsVIRsd0EYhMhGo7ow/spVmwG70IAblX/WvuLl3QlmihNrE7z8nsVWProrY VMqtkAZPANFpa0RD7fOC6bo7KHiFR6lfGjwtzex5nhc2Xl4su9PQlzHFV7/2+MCPhE4l AlNn0y27uaeD73qDfgGwFB9ci4HURkTSAm5wOUN/I8INXeFQNCvsT1xKqls3EWkgWZZS 033w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Pc/Sfa/uvyYzyrCdTxcbvx9K9W/z6iYPxxsGml4BfXQ=; b=In29WvfURavMdazzakjkb3OUEjE0xfA81+wbc6W0lyE1vhk+SedThA3L4Do1I2Um1q +tv/xnWBuodUStZa2DSAXfb9DR/3mXGXM0Ps9ccFyhzeBa2epkCb2/SMkUcp6LFRMhID 2nNkdnFIu4FGaHWPu+/5rFig1MOYnBw901kSobLPcq/afZ+1KcMn9BbQ/UAa9RMdK9nD ZC4zlZN7+19Te+LxNlOs4OQ5tDroQ+GEyrh9quAq8neFc/AU1nIxpW15XqjbOhMVLCsT 3frnPeYEkN87aaPYju/Npn79HJ7G/vSJzrR17cf7avvTJ3CTxl5nA75OdXEV/nAqA/Bv GHhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="ddK5/GN9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iy6-20020a170903130600b001a64e7b7026si1117953plb.438.2023.05.26.01.57.47; Fri, 26 May 2023 01:58:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="ddK5/GN9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236939AbjEZIpt (ORCPT + 99 others); Fri, 26 May 2023 04:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242397AbjEZIpj (ORCPT ); Fri, 26 May 2023 04:45:39 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E097219A; Fri, 26 May 2023 01:45:36 -0700 (PDT) Received: from [IPV6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab] (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id D0B496606E83; Fri, 26 May 2023 09:45:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685090735; bh=jIYCjGbXEyWJJEvEqZFXDnEttlE1pdHBfo4pRBrBZ44=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ddK5/GN9kRklJI2XLwlNE6peqrD4tc8nVY5l2UQ41DrEC44HDa+qWEkoxqNMbJLgF FxYJM7znsKalwM09C/EjgdvjYdnhB1Lu9mCrvmvIGYAFPv8ePMm7llLDEdaoCXLydp RjLGCxvZsLX1d0k71oNsBQTyxypn+8p34mTrNs0vYFyKym+1MNGLwMze01bxEUJCBe DAJhb3Z/vPGM06ZQ+3/Zbh13CswcOPkgdbgv8u+pz1jHAm7/jLzZkBGyku+DKAbXUg iCnTdzx5QI/RURMXHwOoUJtVsKPA+eVlXBz2RxePNN6DYdYcBENtP49hZXOHAeH+nd 0fwUTB3RJT0sQ== Message-ID: <23366389-1be5-92ef-7728-ce639d46a0b0@collabora.com> Date: Fri, 26 May 2023 10:45:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] notifier: Initialize new struct srcu_usage field Content-Language: en-US To: Chen-Yu Tsai , Lai Jiangshan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?Q?N=c3=adcolas_F_=2e_R_=2e_A_=2e_Prado?= , "Rafael J. Wysocki" References: <20230526073539.339203-1-wenst@chromium.org> From: AngeloGioacchino Del Regno In-Reply-To: <20230526073539.339203-1-wenst@chromium.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 26/05/23 09:35, Chen-Yu Tsai ha scritto: > In commit 95433f726301 ("srcu: Begin offloading srcu_struct fields to > srcu_update"), a new struct srcu_usage field was added, but was not > properly initialized. This led to a "spinlock bad magic" BUG when > the SRCU notifier was ever used. This was observed in the MediaTek > CCI devfreq driver on next-20230525. Trimmed stack trace as follows: > > BUG: spinlock bad magic on CPU#4, swapper/0/1 > lock: 0xffffff80ff529ac0, .magic: 00000000, .owner: /-1, .owner_cpu: 0 > Call trace: > spin_bug+0xa4/0xe8 > do_raw_spin_lock+0xec/0x120 > _raw_spin_lock_irqsave+0x78/0xb8 > synchronize_srcu+0x3c/0x168 > srcu_notifier_chain_unregister+0x5c/0xa0 > cpufreq_unregister_notifier+0x94/0xe0 > devfreq_passive_event_handler+0x7c/0x3e0 > devfreq_remove_device+0x48/0xe8 > > Add __SRCU_USAGE_INIT() to SRCU_NOTIFIER_INIT() so that srcu_usage gets > initialized properly. > > Fixes: 95433f726301 ("srcu: Begin offloading srcu_struct fields to srcu_update") > Signed-off-by: Chen-Yu Tsai Tested-by: AngeloGioacchino Del Regno