Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp592062imn; Thu, 28 Jul 2022 09:50:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uhevv2uFLr0U6gnPw64H1S51veDGv+vRea9I8cE0KOFuIREBnL9d0G8ZRpES5QFixYKuK9 X-Received: by 2002:a65:6494:0:b0:419:9527:2a69 with SMTP id e20-20020a656494000000b0041995272a69mr23654596pgv.80.1659027019091; Thu, 28 Jul 2022 09:50:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659027019; cv=pass; d=google.com; s=arc-20160816; b=O1XTtb0AanSRcw6AR8OU3D9ZuDuuOq1mmjN5/WtEUwDF0rcpOzuiWrnRkkWyoVC2FK /lG0yvooJ/DmUbhm0r0eeJsC4YEMcXW3xEJi3tovp5rbz/fnD8y8K/i0HGiw9nRkv5/i 1og+AdsHPLlYEQV1je4HFn/Og81ZbtnIjI5trqftZQ0y0ziDy6F2pcPqHbrw5nT368m3 ZpVMGB73osNMG+zMpdIeAvNp4fOtG9lgIB8Pzge7/LGTUghykREoEAFItdsTJ07IFYpe DHyQQE+nYqQUPidZB7qoFLgI4oQMXNPtPL2YlpUGoT+9BnM1if4vPC5h+4pdTzSCUrhN vVXw== 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=d6//We+O7AzLOkVwJnaqDuRbyCgnO3m4XcHQ05QrMv4=; b=e/zzId1smNxH7aSAz7aiZbuhUuDsDaOy2BRz8G6yQXayV3qXiboaBY0cLg8BZa3rWi i7hzUoffNxxSpQgF4Mrj59CvTbI8sgeCQsvlMHBHdwHfddolyl5A3DymmzoJ70vGcoX1 dDXSKRnugxIR9xNLfCmNsLV0p3ge85rir+VQS0XsT6svjjjN5rOQlvNIFUO+ckvyTun7 LAhEW8jylHstVe6LEyEoe+M2NK6jxx0C3YNMqlwZKn7u60tWo0ulj6FtXGioIEs3DhEN nCkampntJ4xJre/KbG7HwMk1jWKQzvtbRIyuR+KDCbGvij+YH4oymUulOsIwpK6MkW13 2xhA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=g6Me3DtR; 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 k62-20020a17090a14c400b001f28dc085bfsi5231811pja.115.2022.07.28.09.50.02; Thu, 28 Jul 2022 09:50:19 -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=g6Me3DtR; 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 S231745AbiG1QcT (ORCPT + 99 others); Thu, 28 Jul 2022 12:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiG1QcQ (ORCPT ); Thu, 28 Jul 2022 12:32:16 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 915B454CB3 for ; Thu, 28 Jul 2022 09:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HBeZAodvdpfcgbqazXDsjWt5LeTFyx9O330KJfmZBD+SllWenqilSdfQlqjD4BM+8EtJGOzhbhlYDLSV8zvSrRSv5Ioe0CIInGHyrNIbUh+uyruCC5HyGGhxBV5G/Jxc8PBt3pZKdaPrr6TeLAzo+zoMzoI2U8ejFsZncw37Sqjd8ymcleXnZX07yJK7p6U0YI1FlxrdbjWp+TM8sqzKtKsiarzKZws/GXEKX3/mWBpTLASRsNSIn4iSx/Z8uQQnuPfgDScy2T4yGeUVwvMgaiGU5xnfB/F4EHb9C8JoJDGWLYikMKLAV1zVpXgN8BD/VC6djccO3x4xCsa1KaVrZQ== 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=d6//We+O7AzLOkVwJnaqDuRbyCgnO3m4XcHQ05QrMv4=; b=KU+CzP0nG4DHGorIUDL81rwvD4Zd0pQTXVyz1Ls+i1Jgo7RS6SpCUoXiCYQ5evKYfZm2ssPSH3arj1vU/5mIC3MheGgLfUMeFU6qMjkQTxomJ2dKfzrbHUSsr2+qJ/EQpEz5k+ZWxb0uAFUA/Luac0+LeBsFz6PVpN0PjIWg0wYs7XjmWhRv81s/RqTEZWiY61LBwbmCvjLjr6Z7e9jYOs/MgfIyBA1unA4aJkpOwyjsPBJrb0mHoYtbv1cOzbToar+hSvN7X6OxxBjF/ea4Mg25Tpk1nk3AWapEJ8fOo1iflzw04wNZk1iUEVeQVR2lqOQuJjzH+PNXlKStnQ05AA== 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=d6//We+O7AzLOkVwJnaqDuRbyCgnO3m4XcHQ05QrMv4=; b=g6Me3DtR5wYTrwXd/1qZQIQrpMTMGCVXUwg98wlRKJajs2OgYb8AofWwmEfg8IezOfMawDd54TEyJCxjzk/kdyUcSRSL6ieuJpzJ+2YzjVqyeBc55AJPmCqpP7tSFyWQtvosQHSr8OMv61/QVo8bJZLYj/4CbSs/0FfGJmA/RF7v8IQXD07PZ7Zu4p1g+jAIy8WZdmS0n3QmgG7Q/u4cE7gCII/RiFhuVYUhC1p98/RyvGenn1Gz8JmLkF8/6MalKODaBQhmmwA11POZ8pTDuV+Ozh/6/4meMv3/+nHz+rSJID8Upr8JAM6FjONmYaAFPt2TYlisq4xSV4B6EdShUg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by VE1PR03MB5822.eurprd03.prod.outlook.com (2603:10a6:803:110::15) 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 16:31:55 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::7d32:560f:9dd0:c36]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::7d32:560f:9dd0:c36%4]) with mapi id 15.20.5482.011; Thu, 28 Jul 2022 16:31:55 +0000 Subject: Re: [PATCH v4] irqchip/ls-extirq: fix invalid wait context by avoiding to use regmap To: Vladimir Oltean Cc: "linux-kernel@vger.kernel.org" , Lee Jones , Thomas Gleixner , Marc Zyngier , Rasmus Villemoes , Arnd Bergmann , "Z.Q. Hou" , Biwen Li References: <20220728144254.175385-1-vladimir.oltean@nxp.com> <501b52ba-7691-0263-c007-38174c7e5c22@seco.com> <20220728152815.6h4ytx52ll2gzjj3@skbuf> <532c8141-2a8b-6842-c9a2-cc4d17afd73d@seco.com> <20220728161948.gzc7kekygrfdumq6@skbuf> From: Sean Anderson Message-ID: <97f030ca-fb8c-3ff1-0b8b-12571cf11249@seco.com> Date: Thu, 28 Jul 2022 12:31:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <20220728161948.gzc7kekygrfdumq6@skbuf> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MN2PR15CA0014.namprd15.prod.outlook.com (2603:10b6:208:1b4::27) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82c96118-f553-4cda-8a3d-08da70b6af35 X-MS-TrafficTypeDiagnostic: VE1PR03MB5822:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8yw8rRlajHhGVFOemKez9uKJj+K8YWYY2DwOY0iY6SFTaiLpLap+ix6qMJYe/mlrAe9ELzsA5wfUoCkR16pGdioaj/00SuCyPvn+ETVxHYbTMlYqQrZIedo4XRQHciV+LKvokL63xuEiMd8JWMRnDQBxCG2bPHXhQzE7ByR7OuwGWstzIbtB3qHPzfqYtwHfWJH9Ofh0O4SuS6qLxPvuvu7tKUzLTQyvZCzormkrYBUxRgiTUzAMkngV62PZ3OCS4Afqh1vD7CaxISJ57ztGX4BgfD4aIig0LZbN4WTNCWNfHo0cob1J2tR12xr2DkmpykYrak25ZzO6MXELuWoI8pKpQoEe2+DzHupETOmQICPPcM6+927UggOHIa17+UydOGxxxOoZ++s1kA6cc0cTtIuL+ZRBDHueCp/tkrvXF5FY+pfGmzyTR5uX0SXreB47L2Nt6iLaEnbAv8UaB+SWMdC5s1ItSE8/G+0DWsyMUqMYLj+IMGLueQfCjifkSVxZ2BW7WtHWw1NemYK+1G2PyOWkyNm8DF0ZLyHXJxSOp3kbHMokL0uTdI94WUTQkkxPE20Ev4twITli+KDK/NL5R5FY58uUMdSbGdRTWzIHG0xSAxgXtTtGlDzQTYge+92u9kn0B3r0Fn3dcUHQRxrnCFKA2uxkVXk2SYpeNe5yDk3iGR9yGE6C+GvL7R2al0atgVl5Xm3ZiH7fe/XcR1ueJXXudSU5koXgRpzw5d+itz2UYrGd0stVHkL/quOP+pUau5n8RhZlkTvaYjrUab32LiExRLoNAhpJn+ZWy1+7QBjnpwrFtL8UwjkmMVSrGG9n7dhKE/dQftcttBJa9wW1p60qRStJcUbH8oA1kkDwt/Yy917M12ofzW3QW7Zb0TO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(136003)(39850400004)(346002)(376002)(6666004)(316002)(53546011)(2616005)(86362001)(54906003)(52116002)(31686004)(31696002)(36756003)(6506007)(8676002)(2906002)(66476007)(66946007)(41300700001)(38100700002)(66556008)(38350700002)(4326008)(478600001)(83380400001)(186003)(26005)(6512007)(8936002)(5660300002)(6916009)(6486002)(44832011)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VDFlZmlZYnlUWnp4c09XQytEem1Nc2dJYU1ubXRoeE1VWS9aK21scHNoZ2dV?= =?utf-8?B?SzM2bEVFV1VndTJZejM0TVdaNGZFUUQ3VjZRZTRKTVUrbm9nQ3E4NEtJUSs0?= =?utf-8?B?RHBCMWhQaFFn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QTZxMHF1?= =?utf-8?B?bFAzYW9JT1VpdEtGaEgyVjl1d3BkZmc2NUF3b2Q3Q2Vzc3JhNFZEUDhjWEVN?= =?utf-8?B?QTV1Mm9YYU1zMkJFTkMyMnVpNkJWUHRxNGljTkFrYUJuNkZEbytsVmg2UkxB?= =?utf-8?B?UmdjTGpzVDBka0ltWk5RNC9BbDVKQTV3NWU2Y2x5S1dUSFJzcHhBUm84dHdK?= =?utf-8?B?T1laaG9oQ3hMb3pGUTdjUlRlSHpkWEh5S2kwZW43bXhSbWtIbE5acXpZeHRq?= =?utf-8?B?TlE9PQ==?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82c96118-f553-4cda-8a3d-08da70b6af35 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 16:31:55.3476 (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: N8uDrRQku8lOaix0EiRFxfY2G6MZAuefl/alTU8zWmn86hq6uX3z1tm/UaXAKqRWzITteSUiFsD/nglwSR5oUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR03MB5822 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 12:19 PM, Vladimir Oltean wrote: > On Thu, Jul 28, 2022 at 11:43:40AM -0400, Sean Anderson wrote: >> > All of this should be rewritten to use of_device_is_big_endian(), and >> > reduce the whole thing to two cases (I don't think native endian makes >> > much sense anyway). I also wonder what the result is if none of these >> > properties is present... >> >> I think regmap_get_val_endian would be better here. > > It needs a struct device. > >> >> + >> >> + priv->regmap = regmap_init_mmio(NULL, base, &extirq_regmap_config); >> >> It could also be done automatically if we pass the syscon dev instead of >> NULL. The only downside is that some regmap error messages will use the >> syscon device > > How do you get the struct device of the syscon? Oh, interesting, we don't have a device in this driver. >> > Finally, what is the actual benefit of using a regmap here? It seems >> > like a very roundabout way of performing a RMW on a register whilst >> > holding a lock... Passing NULL for a device to regmap_init_mmio() also >> > seems to be an extremely rare idiom (only 5 cases in the tree), and >> > this doesn't seem completely right to me. >> >> The benefit is that you don't have to write (yet another) set of >> endian-converting read/write functions. The above (non-NULL) usage of >> regmap_init would also address your criticism here. > > I don't have a particular attraction towards using regmap for a single > register either, to be honest. > Yeah I suppose it's not a terrible burden here. --Sean