Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp35470pxu; Thu, 10 Dec 2020 17:27:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9wT07qcovEP9gG0AlfK3CEr8xeYbGMjaRnyc2JRZXjmLh2Mrw2nmf9XSxkZGgbFQA1Xo8 X-Received: by 2002:a50:fe87:: with SMTP id d7mr9536331edt.381.1607650078119; Thu, 10 Dec 2020 17:27:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607650078; cv=none; d=google.com; s=arc-20160816; b=ePXj26Z55dPmzKBUbyDnYCg00iEWjVo2TcU0+HD4FvDNo2MUk3mt0/x29d8V4on1bo kjPKjppwfYVVicRPUJAjAlBENfIk91CkiESwfxVzQ7Rl00rG9jIg+YKVHcUqakQEm12l VsAbCqP8wrOEQuRWP1PBjZp2V9uIbKNAMK6F5CSIxilbjBdpIQ6iScoD+CJuyAABncA5 KXEiyVCQ/w9kerhPk+VPLshIOyerP5hiScUCyrcg8yh3o2xrga2s/FxMEaMjZ2TlV06x IIsfE0T5Rx3UT25K+mnmogrHk71j3WGkPAiZNB4Cxfql7fzxhI5lD6TUJ05Hz/sKKw3s LBkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4Hb7CAOESndOw0qmRw9ewVrZoBtsOHUQtrWnjHs0d1U=; b=dYKrQcgJcgInIK032DOtojNtboxH+HyIeoWrg74AQR/yxvfEkxuOu0x3s8PKDrkOJ+ n6srv+DeNEf0dox9IDmMRZaquNBwyAqn56r1l7ge6vDCu8N2oL1BJH4Jr6JTIZ2dhwbK 8/rIow8/yHdqVKW9ZWi0yFei2slXM/TR0JTrisv6E/zymbdTQL4AC2/zAJDiEfep38Fb ETDWVYR6NttLJYXjqJes4xlcp2g8kqiqn9UPNOkdEf4jNV73GVRG5+kXsejJrH0U10/p D9zGTph9LPTDTgzS6FedDOJ5TKQmGKexzdczmHIKM3i8A0HFbF1TIQXssgCfSITI5q7k jRlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hs49l3Mb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si3810925edq.353.2020.12.10.17.27.28; Thu, 10 Dec 2020 17:27:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hs49l3Mb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387992AbgLJOOq (ORCPT + 99 others); Thu, 10 Dec 2020 09:14:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387865AbgLJOO0 (ORCPT ); Thu, 10 Dec 2020 09:14:26 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2918BC0613CF; Thu, 10 Dec 2020 06:13:46 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id w16so4318145pga.9; Thu, 10 Dec 2020 06:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Hb7CAOESndOw0qmRw9ewVrZoBtsOHUQtrWnjHs0d1U=; b=hs49l3MbegHnzNrh0GBjhULW6ig/YFYqX2EM+6DzwB+fRgW9ILpGbafrJWdjTyYMGx bg5fZABvSnlI26rFJy5pxWeVo1syaM3lTLnySC+vNijzgwJofGFA4jF8GbP5lw/3bolx 5MhNjpMMyGnxypq8jozD4tCdXpzAlJfrNhzeBSvLByOHyyXW0qcPmyn2crxwuFCW1NsE 0Y0LSTXpJzVV+Js+XxpS2wWocBaPoNyqwnIaHiLPRmTujhAnWChx87vID4du1gZxQ4lT IO1MhWxII0hyNuc2ufbgv59WCjVSJinhDKlHuXizxWjqOrMl69sU847jQTfSRlqFqumA +2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Hb7CAOESndOw0qmRw9ewVrZoBtsOHUQtrWnjHs0d1U=; b=kNOP9L8F0BN5IBCE9KrlPyFv/hPFTx8BKcQRvscwo0tcIzd9PBL+RgcTTWAVUIZLm+ fUBHaypM0m32nwlQFMk3KZsFDEGmZ74ueQAnRHcPaI4fmNTYKV+0veMXVQ3IIWKup9BD b2md8enq04Ct5X4xta9G0fKmef0NFjTO+jLjkYtW7t78rPqUziGFTX2dHrx867qPG15J Ki2Dy3CA7LA3nDlX3tm0UmT/JVyMdTyBVwpiRl/ffyBQCpx1tQJbxbe+iTSmEdqCrcbL oJ7h/r/OQ0otbn7Cm3K660cA51f9WYo7ylxbhUSDmBg0k6glpwHbSGjsvbbz0S3EcdhX G1lw== X-Gm-Message-State: AOAM533u2Ky4GuZviHKv14KoCABiRw9bE6EOMyCiK0WnB1kK0QOyhqJP /CdQ6pNQRoc3D2s1JJ5ubkWu+NQvj3zjBv4XxNkOsZ0Ap/w= X-Received: by 2002:a17:90a:c592:: with SMTP id l18mr7847600pjt.228.1607609625632; Thu, 10 Dec 2020 06:13:45 -0800 (PST) MIME-Version: 1.0 References: <20201210065013.29348-1-troy_lee@aspeedtech.com> In-Reply-To: <20201210065013.29348-1-troy_lee@aspeedtech.com> From: Andy Shevchenko Date: Thu, 10 Dec 2020 16:14:33 +0200 Message-ID: Subject: Re: [PATCH] gpio: aspeed: Lock GPIO pin used as IRQ To: Troy Lee Cc: OpenBMC Maillist , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , "open list:GPIO SUBSYSTEM" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , leetroy@gmail.com, ryan_chen@aspeedtech.com, chiawei_wang@aspeedtech.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 10, 2020 at 9:36 AM Troy Lee wrote: > > GPIO pins can be used as IRQ indicators. When they do, > those pins should be flaged with locks to avoid kernel flagged > warning message. ... > @@ -651,6 +651,13 @@ static int aspeed_gpio_set_type(struct irq_data *d, unsigned int type) > + rc = gpiochip_lock_as_irq(&gpio->chip, d->hwirq); > + if (rc) { > + dev_err(gpio->chip.parent, "unable to lock GPIO %lu as IRQ\n", > + d->hwirq); > + return rc; > + } It's a copy'n'paste of generic code. Why do you need it in an unusual place, i.e. ->irq_set_type() IIUC? Can you elaborate about an issue, because this seems to be a hack? -- With Best Regards, Andy Shevchenko