Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp564198imn; Thu, 28 Jul 2022 09:02:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uHSa2jpdpDLrsAobYHWD4CKm3bSzcarZ9MfH48Wtw+xoPhJwrmo/MEP6cjg+6eJntk7BJj X-Received: by 2002:a05:6402:248f:b0:43a:b89c:20e3 with SMTP id q15-20020a056402248f00b0043ab89c20e3mr28571669eda.335.1659024131949; Thu, 28 Jul 2022 09:02:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659024131; cv=pass; d=google.com; s=arc-20160816; b=NW4Q283wfc4xyxwtoBPlHW4A6FjqZvsEK/nzaGjeL5ftMNCQp1F9ZuSCGlzDxRpq+B GH+dXcJinPJ40UhP2IrOqlpWmCWFn+lvIV/lH5ge6w8XYVhkqqZHM5EER4oCVJrAe7fQ /6nZS9/3Tu52cTmXDGzrcMZPUmZ2n+LJyCtQaEW458wlDequFTRoy89H8eXTXjKA59Kh hdzlmFoHwAry77vVcLNnole0zWbxYruBHSV2R7USdhbO57vIUtbPTnwDRv6tQlkWCwM3 yzWJ/WmMgAGygqNTay7wYfM6Ib1Y0Yxe3ra2fzlKjrLRzVYBseWfcMrIX+ltg5KGwTMN /3jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=kR7G6Uf6lFjk4WkWdvZoiF/q16SzNJzhd60JRhinaNM=; b=LDzYqwfwRVsDjCAxI50SPbd/ixiZYoydTBvI8ykj05T6JwRN+8Bd390fief4IRVL7C N7zkaLQm432tzQru5gYQmtoWSmMCyAbINkdzr4j3N1JN7ZtiJibqDP92tO+S7bX5rtib XH7+pKasgBsSMZpSGcT6/MGjSb9/NVkrSw3vGFMUreRvDqoGsPzBroNjPnQw59f/a4J7 KFSMyNMsuHvWkto5+Bm5MbzQgScR3y/cS52LaFvRWY+9s3hqFRalBIo5alinLCsjhoW9 mi+8/XoAjURW567sKsOXGEC9QmhM4ST16l7Z1DplFaogucuXZ7TDkov7YL08+OyYWHez MylQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=RZfzBh9o; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); 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=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a170906774600b0072f22d91836si856990ejn.541.2022.07.28.09.01.44; Thu, 28 Jul 2022 09:02:11 -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=@seco.com header.s=selector1 header.b=RZfzBh9o; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); 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=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbiG1PZj (ORCPT + 99 others); Thu, 28 Jul 2022 11:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiG1PZf (ORCPT ); Thu, 28 Jul 2022 11:25:35 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80059.outbound.protection.outlook.com [40.107.8.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E414E614 for ; Thu, 28 Jul 2022 08:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AoPJnq+Dlpu+z6KsZDGp+MBckzfbzepG5ryaFJ0Of5wcCfEWNLo8xlhWm7axWHj7NPQHAbuG88PexhSMaU8iG+IbAJGwrh8+goyhVU6Fc8pKKMr4SwISki5NjCrSxu4GOcyw5JLiv5I87ooOVJKruaXIM/wIZ785MBeF/eCxn9c1G0oyVsTLB1DxHXnPT2gFcUCJ7hozwT+ZJt0BgeBiIx13w4syepGNwqgFxqVV4MY7orYpgHBGId+B63j4tgemE4PAwU3i3VoIeBuZA+Hpmw/pMhztdqesDYJ1w/CWOMUF8ebfmi8InQnCcXrmE3iGI0KTaFW8jYKOJZC5VSoRKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kR7G6Uf6lFjk4WkWdvZoiF/q16SzNJzhd60JRhinaNM=; b=Om7SE58nfgp3fuXMEgoLwiV7pzP+XFrhEFoL0rpqTsxSbmzlfzeRy1PzcNqJHE7dIm/oyAomPSxk2ERf5ePFmrUZuCIwSqlKynFcxNdzrhz7nhDtpq51B+qNsjEfz2uRMSU0NKc6n+w16XcSol1RChHPXeRbRzgRSFS1hMX6wpJfK9VmjHNcvMk3S1PHs2XE1cEZWBthstsoDtbB/J7Q6lVI0VGjPYCWHNOtY6yTd2ROXlMnnVfO+Z4PYp8x1CNAZbYv/s5S8sptoT5N7oQv0fc802AJ7vH6WEHh+pkwRqXhV1smSVVbaFsVeXgU9Aj7u2XQdEejjsKnsVoJlM/AZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kR7G6Uf6lFjk4WkWdvZoiF/q16SzNJzhd60JRhinaNM=; b=RZfzBh9ojidS4QqpDz3QqZe2kUhaURR6XOnVT8cyLgXxJVN8YoINKQzNFYkFV7qdWDPmycN4s6HhAo4j/ZdDtD94RmzAHh/v6EagvMgzZC369u+t1ApZClwVrtZUn51Xs6YKGXrHObNkOTD5n3y2RZbnyH9C8JoHZN6GqzJVOhLaa/PE40e6ewD3K9SH09Qyh74BfR1Qo9A6ROdczRhxtUITHI/xpawyCyh3Rxw8Uf1C6YBAMUC+ii8KcDwr8cjTkpLlYLzmJWG7ikf88At5Y67A22Q91CIQ3nfHJnaNcO/EQScyw9D0hWKx5qh5BmAjuKzSdp3AK9fzig/ztnQV1g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by VE1PR03MB6352.eurprd03.prod.outlook.com (2603:10a6:803:11a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.6; Thu, 28 Jul 2022 15:25:30 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::3974:3665:ac2:906]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::3974:3665:ac2:906%4]) with mapi id 15.20.5482.006; Thu, 28 Jul 2022 15:25:30 +0000 Subject: Re: [PATCH v4] irqchip/ls-extirq: fix invalid wait context by avoiding to use regmap To: Vladimir Oltean , linux-kernel@vger.kernel.org Cc: Lee Jones , Thomas Gleixner , Marc Zyngier , Rasmus Villemoes , Arnd Bergmann , Hou Zhiqiang , Biwen Li References: <20220728144254.175385-1-vladimir.oltean@nxp.com> From: Sean Anderson Message-ID: <501b52ba-7691-0263-c007-38174c7e5c22@seco.com> Date: Thu, 28 Jul 2022 11:25:23 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <20220728144254.175385-1-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR05CA0055.namprd05.prod.outlook.com (2603:10b6:610:38::32) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35b22333-9487-43b9-886c-08da70ad6823 X-MS-TrafficTypeDiagnostic: VE1PR03MB6352:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TOQQMKGOw1bKYo1F7kEt8vXpVklOv9mvUM3WtFV2YXWwQJQ+4uEU0NSBNNl8u2uP0ng4G/ISj8+Hybfm3a9NexCE7kBkvtg1PIDZyvh+sYy94iq63cQZGLZd1MkLiO3zS915zLh50weo7JPsOX50QCg/MXtGz4D4KjC+At1vaO4aJskk47Tigtw+mR1Wwl1b5BYvO1h4zxSbK5zuHIKYE+D7B1fvtscRd9x4jzPiUj3TUhrxHkYhAEFhnOyVtCy8IAWtDksDI5oB0+raheGjByRhU2BLQDrhhW4Vhx7wKEpmhn1oPa5GiD4lkINZdJnjKQtI+FXqShB/DGvN5EPbkUT6gMfh/DEwYqSSGkWgoe5McikltBdkB7CaTJN63ckoEmdPNn7lgkupZOwS9MwJSnlA9UWta+NcGEm8bgdsVq1e9WNek2Tqt3i915IMoPgu84HIPBMr5vo965s1b4yXISb4YIZ0oYLoJdOzhSOCWpAU+Z+D4TITbEm2IDCPGR9ty6LVaF9gVVBl83zu++kKMoo5oxaMU+mDMj1LFausE3pmbnfTSiqN0ZKKIIO9L0aTLqgmlwCvoLOcgdFYthHS+zEiDIzW+jkrxJ9WR2n9Zdj1dBcX1KmmEl0GZCdPGi5clnSd6+RHb6xOiWDDMSGOKJs3LRRGoommcFzGkxwEKSCNz+FG3AbOUT/IJ8LpL3AmDz6HKO248sqHxOwKbEnVJ4d7NolvHbN7u9kfBt8LBdFtm8VolADXf8LwYj2di2yRCjdRY9SMSrkdEobhRJzvEwAXiEOJFVF1DpMQwUPJnn2V6mSFSpheJESPxJmjFdB/uiVGJdrmQl/us2gvnMUbSk9dKsSN4fOf7gKESrMmokbjxn+Ngz2yRuEJ/8IJRR1+ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(39840400004)(396003)(346002)(366004)(136003)(376002)(6506007)(36756003)(31686004)(83380400001)(186003)(66946007)(66556008)(4326008)(54906003)(66476007)(8676002)(316002)(26005)(52116002)(53546011)(86362001)(6512007)(44832011)(2616005)(31696002)(41300700001)(6486002)(5660300002)(8936002)(478600001)(38100700002)(2906002)(6666004)(38350700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YTFOVWFiU3V0NDZ6WDVMaG8xeHRvVXh6b1Fsb1F6Z1BRMkllSkY4bVdpazc2?= =?utf-8?B?TEpYakpvc2xLWDNzZWovZlg4MklCSWxMQWNtZTI4eUNhZkRhWjI4NERPeWVG?= =?utf-8?B?d295d09yMWQ1NHV0K1FzeE5kYmJvL0ZFcGJweUtVU1VkZFJ0cXpWZ1dnZUY1?= =?utf-8?B?dlNyYms2dDdLcENidmZQSWtFdlhWSVExR1JPTi9kWDhaYVBOM0tLeS9sVXkv?= =?utf-8?B?WTRWS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V5aytuZlZXUHN4MCtU?= =?utf-8?B?am9Oa3dRR2VuRUcydXBiZUtGbS9Mak9PN0tWVXNKNWVieVZGdnYySWY3cU85?= =?utf-8?B?ajIzWjZoM2FIMWdZTDUwNWlBVEZhSHRKWTU4YTFTSDRZVWVySUdPT2xKd1ZM?= =?utf-8?B?Mnc9PQ==?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35b22333-9487-43b9-886c-08da70ad6823 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 15:25:30.7189 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XDtbJQBQwDPzCozHy9NcIFoh8BURETifcUTQgISVjF/4MlDjPUCvKE9p+QSoTZDOL5WfI8PEUgLydNbXpoKSKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR03MB6352 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 On 7/28/22 10:42 AM, Vladimir Oltean wrote: > The irqchip->irq_set_type method is called by __irq_set_trigger() under > the desc->lock raw spinlock. > > The ls-extirq implementation, ls_extirq_irq_set_type(), uses an MMIO > regmap created by of_syscon_register(), which uses plain spinlocks > (the kind that are sleepable on RT). > > Therefore, this is an invalid locking scheme for which we get a kernel > splat stating just that ("[ BUG: Invalid wait context ]"), because the > context in which the plain spinlock may sleep is atomic due to the raw > spinlock. We need to go raw spinlocks all the way. Could we just use use_raw_spinlock in the regmap config? --Sean > Make this driver ioremap its INTPCR register on its own, and stop > relying on syscon to provide a regmap. Since the regmap we got from > syscon belonged to the parent and the newly ioremapped region belongs > just to us, the offset to the INTPCR register is now 0, because of the > address translation that takes place through the device tree. > > One complication, due to the fact that this driver uses IRQCHIP_DECLARE > rather than traditional platform devices with probe and remove methods, > is that we cannot use devres, so we need to implement a full-blown > cleanup procedure on the error path. > > Fixes: 0dcd9f872769 ("irqchip: Add support for Layerscape external interrupt lines") > Signed-off-by: Vladimir Oltean > ---