Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2194306iof; Tue, 7 Jun 2022 22:49:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfSIHUTixcpBl16BS1RIoJN62hB9ij8A1bEkoW+C9ROp2+3Jbp9LWdMn8ShKBNd//pIEBR X-Received: by 2002:aa7:8008:0:b0:51a:cae3:7563 with SMTP id j8-20020aa78008000000b0051acae37563mr56183003pfi.16.1654667349090; Tue, 07 Jun 2022 22:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667349; cv=none; d=google.com; s=arc-20160816; b=kEIMVWx2m5AP0ZEUPwT/o40ZxzXth7rw2C6/cHiQFvw0JYzPxa7+P0EeVoQozef8j3 c+NI1BVPQqCdyRNjTUIdlFsFCj1N1nA81WI+U5PFtEyklyVjyAKrFJ19jerHxpA0wGgt 4XpbKjKAxb08SvenzUNtgqlmdOerYIyQ1Iq5SubwbiUumuMcrsupcS7kvqgV3kyW76LV aa2k3pV7olBUHQy7Mw8b+9SZzkNYaC9OlKiA6Hx3kOGpg3UNw+3haI8JQnmDX8nR/eL9 bxNbUlFPvbd5mjP8v1mrIepKXdG8+UPFzXq/8dA4VSw1T9DoiQryTXDn4aN8jbOCfDku tvHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dKgR3od+OQNXT+4qo/NtCFgihThFOVwsgEfxgCALGTo=; b=D2VwglFOIZ1Jdtw1ZgNXb/tjTzU5tyNHpK6lmNqw3GD3KL4q06yYTgNyFdcW2m8CyK dnMIGnT+nV88dRY5Lfj4OxtPjihtTNuvmfviCnqlf7pf1Z3zEhBYadwA0k10KkUd42X/ sM4IFP2tMEgUNXf/DnIucaTtTY0rmkTrfWkXZD4ndf+s+uFKWRy5UPu0gy1pR0KVpDqJ LfUaTwR5+G5FgXk/51XwD7ufLXgcIBXNDGKISB4k3AftgqXckvLyts0yUB3FOEXE8MEl e7AUXhHTTiNa9DjPpEE+ljtwoHdjyuS0haKElrQLaAyNNcyI13th8dyMBH9yrb4YRuuc gz2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="W7epv/ZI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j186-20020a638bc3000000b003fb882c85fasi20087529pge.64.2022.06.07.22.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:49:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="W7epv/ZI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 375EE4B6CAE; Tue, 7 Jun 2022 22:23:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390351AbiFHBGN (ORCPT + 99 others); Tue, 7 Jun 2022 21:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382571AbiFGWEa (ORCPT ); Tue, 7 Jun 2022 18:04:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 453481957BD; Tue, 7 Jun 2022 12:15:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C49E9B8233E; Tue, 7 Jun 2022 19:15:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D053C385A5; Tue, 7 Jun 2022 19:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629334; bh=Ok82NdQlu5FkySxI5+3ZGfOpXbcVehWXEJPOChoCMOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7epv/ZIYwKQMBH15ysTGucpcUQ2czS0BMEeLh+5F5T+f3IxF2nJQ7j+LWGgoJLNz wcPg54H8L8yoiRc/z2AsWtVbeRwKvX5TDgAOQ9nfYJcfpyyKHVkC3jF1QE8b3Jr7rB CsGhXrgjyGdO/d6E38/nWHmA563wXfLZ8vLJ+kmA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hector Martin , Linus Walleij , Sasha Levin Subject: [PATCH 5.18 654/879] pinctrl: apple: Use a raw spinlock for the regmap Date: Tue, 7 Jun 2022 19:02:52 +0200 Message-Id: <20220607165021.829606310@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Hector Martin [ Upstream commit 83969805cc716a7dc6b296c3fb1bc7e5cd7ca321 ] The irqchip ops are called with a raw spinlock held, so the subsequent regmap usage cannot use a plain spinlock. spi-hid-apple-of spi0.0: spihid_apple_of_probe:74 ============================= [ BUG: Invalid wait context ] 5.18.0-asahi-00176-g0fa3ab03bdea #1337 Not tainted ----------------------------- kworker/u20:3/86 is trying to lock: ffff8000166b5018 (pinctrl_apple_gpio:462:(®map_config)->lock){....}-{3:3}, at: regmap_lock_spinlock+0x18/0x30 other info that might help us debug this: context-{5:5} 7 locks held by kworker/u20:3/86: #0: ffff800017725d48 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670 #1: ffff80001e33bdd0 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670 #2: ffff800017d629a0 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c #3: ffff80002414e618 (&ctlr->add_lock){+.+.}-{4:4}, at: spi_add_device+0x40/0x80 #4: ffff800024116990 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c #5: ffff800022d4be58 (request_class){+.+.}-{4:4}, at: __setup_irq+0xa8/0x720 #6: ffff800022d4bcc8 (lock_class){....}-{2:2}, at: __setup_irq+0xcc/0x720 Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs") Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20220524142206.18833-1-marcan@marcan.st Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-apple-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c index 72f4dd2466e1..6d1bff9588d9 100644 --- a/drivers/pinctrl/pinctrl-apple-gpio.c +++ b/drivers/pinctrl/pinctrl-apple-gpio.c @@ -72,6 +72,7 @@ struct regmap_config regmap_config = { .max_register = 512 * sizeof(u32), .num_reg_defaults_raw = 512, .use_relaxed_mmio = true, + .use_raw_spinlock = true, }; /* No locking needed to mask/unmask IRQs as the interrupt mode is per pin-register. */ -- 2.35.1