Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp126004imu; Thu, 3 Jan 2019 15:35:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4V2GFzoOAvghZ9i+0txZwXZz+lNNQHQQ8OxgeniQHaCn+pSRQFUn1QaoqJD5IFb07IlwDh X-Received: by 2002:a63:a401:: with SMTP id c1mr18805760pgf.403.1546558512337; Thu, 03 Jan 2019 15:35:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546558512; cv=none; d=google.com; s=arc-20160816; b=kCkBRaN/eoX3dQL+pAvQgnF14PgmbEB5ddNiiEtx56TTOIUX7kZocCi8r7GSh1XycX ItrWryww2NrYi7k0t/pGqBCEKCor5Qgqg7DlhWkOuXb6mCvCEx7NOTmnP1MLaDJKekCW D8J5ROmKSf8iNv2yHS7YibHjeZvcs1BOMI+gpROVYT8hC0wFFsENm/nHbtfB0tvVLKex Y31dGuFQGqHIF0g43vCDQO1BQ9Rh+PBhfw2+cE007yOTx7QqTIFXWV93T/wxNffmEmZy Bm6C61zI3DiLS7vRWrV5U0E8AoVpUEmdJ90H86r5GlUPpW8xn2Z6R4+4Sz6ED59ks4r/ IlWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RX9yAvo21LwmNTjcoM4z+exuAWWUdAqA0rGWiRKiv10=; b=LcbmxPrSG/jqnjs9csWrCQLWzmYNYm2fExY674RoZWG6DROSp3B/sDSMsGym/BP3YN 9AH1I5x2TAv97Zb6ri1JoLTP08XTp/NpRTX7op3cwVChjv+MM30laKYdVEKbXKVIf18R 1bwr/KPHKH4q1yKw4qgYk9cOCu8jiXB/RAFS1LQaivwNUDdpaOGbDrXhvZp49v+JenNo J6GIydDAFJsOPZ00GbTKB0VpkQcaHNA+ZnVZsDnNuABGR8QZMGbDIPE9gOFAyKz2/D1W DmF3P7Q56D3IcwAFSb9f9vLwx5TVIVVAFVkF0+I/UC7RJZ1UTCuX/aks9YAVWA72B7nG 0xuw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f90si54446421plb.362.2019.01.03.15.34.57; Thu, 03 Jan 2019 15:35:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732413AbfACRWX (ORCPT + 99 others); Thu, 3 Jan 2019 12:22:23 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:46354 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730229AbfACRWX (ORCPT ); Thu, 3 Jan 2019 12:22:23 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x03HJUQi009761; Thu, 3 Jan 2019 11:22:19 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0b-001ae601.pphosted.com with ESMTP id 2pp67unx05-1; Thu, 03 Jan 2019 11:22:18 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail1.cirrus.com (Postfix) with ESMTP id 5E413611C8AC; Thu, 3 Jan 2019 11:22:18 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Thu, 3 Jan 2019 17:22:17 +0000 Received: from imbe.wolfsonmicro.main (imbe.wolfsonmicro.main [198.61.95.81]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id x03HMHjB006264; Thu, 3 Jan 2019 17:22:17 GMT Date: Thu, 3 Jan 2019 17:22:17 +0000 From: Charles Keepax To: "Vaittinen, Matti" CC: "broonie@kernel.org" , "linux-kernel@vger.kernel.org" , "patches@opensource.cirrus.com" Subject: Re: [PATCH] regmap: irq: Make IRQ type support optional Message-ID: <20190103172217.GP16508@imbe.wolfsonmicro.main> References: <20181228112358.5914-1-ckeepax@opensource.cirrus.com> <20181228115548.GM16508@imbe.wolfsonmicro.main> <042F8805D2046347BB8420BEAE397A4066F2EFFE@WILL-MAIL001.REu.RohmEu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <042F8805D2046347BB8420BEAE397A4066F2EFFE@WILL-MAIL001.REu.RohmEu.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901030153 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 28, 2018 at 12:16:17PM +0000, Vaittinen, Matti wrote: > Hello Charles, > > Sending this mail form outlook web interface - so I won't inline any code :/ > > From: Charles Keepax [ckeepax@opensource.cirrus.com] > Sent: Friday, December 28, 2018 1:55 PM > > > On Fri, Dec 28, 2018 at 11:23:58AM +0000, Charles Keepax wrote: > > > Currently only gpio-max77620 is using the type support in regmap IRQ, > > > but the implementation causes the irq_set_type operation to fail on all > > > other regmap IRQ chips. Avoid these regressions by skipping the type > > > handling on any chips that don't define a set of supported types. > > > > > > Fixes: 1c2928e3e321 ("regmap: regmap-irq/gpio-max77620: add level-irq support") > > > Signed-off-by: Charles Keepax > > > --- > > > drivers/base/regmap/regmap-irq.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c > > > index 1bd1145ad8b5e..8c674f1ad0fc8 100644 > > > --- a/drivers/base/regmap/regmap-irq.c > > > +++ b/drivers/base/regmap/regmap-irq.c > > > @@ -257,6 +257,9 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type) > > > int reg; > > > const struct regmap_irq_type *t = &irq_data->type; > > > > > > + if (!t->types_supported) > > > + return 0; > > > + > > > if ((t->types_supported & type) != type) > > > return -ENOTSUPP; > > > > > I got the bug-report from Geert and sent this patch yesterday: > https://lore.kernel.org/lkml/20181227084443.GA23991@localhost.localdomain/ > > Looking at these two options, I wonder if we shuld return > -ENOTSUPP if we do support type setting, but for example > only for edge, not level active IRQs - and if LEVEL_LOW or > LEVEL_HIGH is requested? Well, I have no strong opinion and > both of these should fix the regressions - sorry for the hassle! > > I still wonder whether we should do as I suggested and only > set the irq_set_type callback for chips which have non zero > type_registers? I suggested that here: > https://lore.kernel.org/lkml/20181228080533.GC2461@localhost.localdomain/ > Yeah that does look like probably the best solution. Thanks, Charles