Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1019887ybl; Wed, 8 Jan 2020 09:36:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzHbTasc0vmjnVnIzjlfFvShpSPZlbz9PYjEuokD74ulxct9idpvT+UdzXTTLlfCkLh/CKP X-Received: by 2002:aca:d0c:: with SMTP id 12mr4110806oin.26.1578504974971; Wed, 08 Jan 2020 09:36:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578504974; cv=none; d=google.com; s=arc-20160816; b=CsovPi/d8HuXf1nok1yrl/NYJVaK1DKg3qwxMUmMg6n8fF/5tfJ9Bk/LHfN7VYo8+T 8jli+KMoSSQbMV6AFkbxUSkVd7ibo9pPLVnCtl5Z+YIqBOhi95/xSJL44lXPMOk3NMBR ns6gE/32z3x8nsMYWvVLGKSkMTiHRbYLEwrjUYPbtRCZsqsqeaGfNEFSXqXJ+T5BmieO BWdnVwOuCZTehF8BoNE3wrRWhqwdFHWFH2hKCLYDX0wXhsQx0KoZC0J4FiBSO4kFbDPr dEtLX4L1shdVwLHZBpNBZBIsxPn5aof8UYu7mnqumzB6KT6Ptblk3U84Ksiw3IpvArR7 Qajg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:authorized-sender; bh=3k8Fah5fnzy83gYQYlVIZKjjS65s3G/PhTDa28Jowuk=; b=h6LAjfz/wYFWqLsbSF6czO1FUBDevA2YFo3guHEEEpwrVL4a30L0dDNQoelxU8qYtC uoucDNsBtIYBYkipmRfI2clSgDTM1CM7Jn6fn2EZIgWPuUeXvSo/jwSNSZcUoahPRzX1 cW9Vs4JYuGtf6KGtPR0ROoyZHS0FtVsAku3fenghs7mAgvqA5HGnhBWoI5c2lE5s41ur TpiERqe86v2QdhH+LYpDmVRUmNVKapVGISHzeX5Lq1gDmqC/m5T/pj2vPvckdzmeWnCZ QjSeSyEXX5mXl25HNqW2onvqENiy618bGRRPOqSdhA48SMVvGIHSFGeSsHkygj768jrv L37w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y140si2157572oia.49.2020.01.08.09.36.03; Wed, 08 Jan 2020 09:36:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728584AbgAHOrq (ORCPT + 99 others); Wed, 8 Jan 2020 09:47:46 -0500 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:53946 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbgAHOrq (ORCPT ); Wed, 8 Jan 2020 09:47:46 -0500 X-Greylist: delayed 362 seconds by postgrey-1.27 at vger.kernel.org; Wed, 08 Jan 2020 09:47:45 EST X-Halon-ID: faaf162b-3224-11ea-b6d8-005056917f90 Authorized-sender: andreas@gaisler.com Received: from andreas.got.gaisler.com (h-98-128-223-123.na.cust.bahnhof.se [98.128.223.123]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id faaf162b-3224-11ea-b6d8-005056917f90; Wed, 08 Jan 2020 15:41:39 +0100 (CET) Subject: Re: [PATCH 2/2] gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_irq_map/unmap() To: Linus Walleij , Jia-Ju Bai Cc: Bartosz Golaszewski , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" References: <20191218132605.10594-1-baijiaju1990@gmail.com> From: Andreas Larsson Message-ID: <74268192-4d4f-8019-804e-49b34ec52787@gaisler.com> Date: Wed, 8 Jan 2020 15:41:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-07 10:37, Linus Walleij wrote: > However there is a deeper problem, this code was added by Andreas > Larsson in 2013 and at the time this was a hacky way to deal with > an interrupt that is actually hierarchical. > > Since 2013 we have gained: > - Hierarchical interrupt controllers > - Hierarchical interrupt chip helpers in gpiolib > > So this code really needs to be modernized using a hierarchical > irqchip. > > See for example commit: > aa7d618ac65f ("gpio: ixp4xx: Convert to hierarchical GPIOLIB_IRQCHIP") > for an example. > > Who is using grgpio these days and could work on fixing this up? I will put on my list to look into this. GRGPIO is used in all our chips, and in most designs made by our customers. The main hurdle with the interrupt handling in the current driver was to both allow several lines to generate the same system interrupt and at the same time make sure to not register any system interrupts for any lines until the user actually requests it (as in the general case all interrupts would be registered leading to clashes with interrupts that cannot necessarily be shared). Hopefully, the hierarchical interrupt controller and chip helper functionalities can cater for these requirements. Best regards, Andreas Larsson