From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2937FC6FA83 for ; Mon, 5 Sep 2022 17:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VRrU+vi+GOQVmgXM4uggOH8ESTng6Li7uimvpail9Mc=; b=38ohWkSI+7lvjq 33Wt0A+pMjx2cNDQ5AN3CvGoZshG2IwDS4CiRLutDJOs4zvE/gch87WWsSAusBQgGw5OakezxTKrZ /qMXnJjXQnQV83W72lXvZwJdCWtQN5WCbK2SQDfrrSIrF1Q2sEnhu6kp8R2OYdpaBfUFRrKfRROJ/ 6whAwyE8kP/Ujfh9VPht7FfCOcpuOIUb9kuO8nJvIzpMfnTTpuYpdIFIWvIdBpSyno2CgI/SeF8wv NJa3j7kCsrnkIjafdHAbiqC6KLD+4m0/49rIjvOah/JVgHAeOe0fASiuN0fmvLGYZP1LW6LidoysG /rJCDBVX9BsVLNuMVQfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVGGq-007tfa-1j; Mon, 05 Sep 2022 17:52:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVApw-001l2d-6R for linux-arm-kernel@bombadil.infradead.org; Mon, 05 Sep 2022 12:04:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tMfQDlYvzFyFrUvYU5MebTEg/joFiQu8bqTpr1XujAw=; b=eXDxCfCIga/wDR6K4iT2sNNH64 Y8G2teyvAhFoiiqxhg6l3/EubP4oz62+aZVHlmvc8U2KzZ+3uKYhtjy6GKT7E6fECpvtM14FiYN3D W07GDN3u/BSq3iTctJcx1beuIwVclxMSOYsghNUcdW3wd+C2RjYzu2GQF1NSohbPjS0sKoNr2dyn4 61A+SkwHCFzjwTiLLGrViv7v0vjVCSABLYsWF1ZsHoT4kTGTkxvaU6qf+53LBj2F8d+WISKOgqFOH PLNCrfIgUY8QPIxb9uX7L0poB6Xyv/YqcWQI0fYBLkY510VL3gJZpT7KMIR9tSp/F4R1K53y9ZGDn dc79hWIg==; Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVAi1-009aXr-UE for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 11:56:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tMfQDlYvzFyFrUvYU5MebTEg/joFiQu8bqTpr1XujAw=; b=04vYN5g0hl4+pGbqsYuRhl/Mp4 HBpYa+AHyQSSe+1ZoHG7g33gNm33rMi/lJcLzNdLmz7Q6nmgP9kaTOSoGBQWvKZ0tAluvSRGskeAE 6D5+NbBkqEj9tEqNQlocq8J7lzNuY7lLv3dRVfCqOhAaJyor2i72wEvnkFrLC5NWKYHgiX9GUKKpD F6cGUeg7+Zg7g2WDqu9rq8KDo2Dgu4PjeW1fhnFCVa4fmTQg8fLixzXknMTUNEmh2Xr5mun2Jswws PGjLGDYjXAyo3Hqa4a+ebXPgL+7OhCu24UhdCbhHmfKKdc1fIHl4FFBjVJkn0vHvsCp8hYKZ4VQja 35sY2EGQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34104) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oVAgn-0002IC-5O; Mon, 05 Sep 2022 12:54:53 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oVAgk-0007Fm-IG; Mon, 05 Sep 2022 12:54:50 +0100 Date: Mon, 5 Sep 2022 12:54:50 +0100 From: "Russell King (Oracle)" To: Andy Shevchenko Cc: Arnd Bergmann , Lee Jones , Linus Walleij , Alyssa Rosenzweig , asahi@lists.linux.dev, Bartosz Golaszewski , Hector Martin , linux-arm Mailing List , "open list:GPIO SUBSYSTEM" , Sven Peter Subject: Re: [PATCH 6/6] gpio: macsmc: Add IRQ support Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_125610_062503_5A0F17BF X-CRM114-Status: GOOD ( 23.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 01, 2022 at 09:03:49PM +0300, Andy Shevchenko wrote: > On Thu, Sep 1, 2022 at 5:18 PM Russell King wrote: > > From: Hector Martin > > > > Add IRQ support to the macsmc driver. This patch has updates from Joey > > Gouly and Russell King. > > ... > > > + u16 type = event >> 16; > > + u8 offset = (event >> 8) & 0xff; > > The ' & 0xff' part is redundant. It's probably also more logical to call this "hwirq". > > +static int macsmc_gpio_irq_set_type(struct irq_data *d, unsigned int type) > > +{ > > + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); > > + struct macsmc_gpio *smcgp = gpiochip_get_data(gc); ... > > + if (!test_bit(offset, smcgp->irq_supported)) > > + return -EINVAL; > > We have a valid mask for IRQs. Can it be used here instead? Looks like we can, thanks for the suggestion. > > + smcgp->irq_mode_shadow[offset] = mode; > > Usually we want to have handle_bad_irq() handler by default and in > ->set_type() we lock a handler depending on the flags. Why is this not > the case in this driver? "lock a handler" ? I guess you mean select a handler. I don't see a reason why we couldn't switch between handle_bad_irq() and handle_simple_irq(). I would guess (I don't know the implementation details of the Apple platform) that the SMC forwards a message when the IRQ happens, but I'm guessing that this is well tested on the platform with the simple flow handler. Changing it to something else would need discussion with the Asahi Linux folk. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel