Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp507403imu; Fri, 4 Jan 2019 01:52:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN4hF2QXqU730WxSgDkI05DRc2RrJmRL7J5jAVs/OeaA7jYl5Um6ZSLHDeG5iD3sBX4ydOnp X-Received: by 2002:a63:ec4b:: with SMTP id r11mr19574674pgj.44.1546595559608; Fri, 04 Jan 2019 01:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546595559; cv=none; d=google.com; s=arc-20160816; b=lJy9W4Qf3D/nWSCjtrX4wGWUDl8ClrKFWw1Mtt50FbmQf7Ff3/F7hjIbIY8cBIJHvk p2VrOBWkjdTmcH/IIUg6BQIxEQF7+I5zsFcj84DTfhCN3luOhOmytIOVIdLgmsPz6/nC i6h8ON5UrGZZy0mxg6delOARpTlBO576gxps5HqCJXskaITnRZ3jwlzfRFWOOE5DZsU1 95cWu05+/Q9gdKF6ea0+yB1yQZX8lL8HBj1CBeK9uSZAXO8zSQeukEmPTMiOOZpRJxU2 yk7j/jFSptpUrLfAdRxS6m6lSdrR2H/IHCa4M0/so09MbRZep8kpnChtP+OJGuL4Ilsj /23w== 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=NvhY3wu/fHL0DJZcMatDD+if2531/0VbYTjX0hfgGMs=; b=0GgAdxC67sFDy63Rfl7Pxrw+NsyTmWwxiJJLk//eKwc1EQgorUm0A2h6AWguR9mNDc qqsK9/iVAI6rmRpzSVxnJpM8IAhkSyfUfiaq6uBoi8KLcsVvqPOlQC4djvdf9pr692zQ hNq0Ho0cBy15hm0P4iRgpNajTc64xkI4JXSdE43BFdJKLHnQPSy1bQ99pabTQQLE8+hs 0T83xz+CZBiv8cNOnjTY8+pw54uChMLeZUussM8DxEyOv6fnAc+b3/VBeZYXHZD1CcDS EZIgCVEs1JXdygYNF+dMHT8KJcoF8zM62WpGj3B3oBJ2JNs/Z28r5VNo2dcuXgzMQX9M c4ew== 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 b21si32051715pfb.89.2019.01.04.01.52.10; Fri, 04 Jan 2019 01:52:39 -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 S1726765AbfADICb (ORCPT + 99 others); Fri, 4 Jan 2019 03:02:31 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44846 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbfADICa (ORCPT ); Fri, 4 Jan 2019 03:02:30 -0500 Received: by mail-lj1-f194.google.com with SMTP id k19-v6so31742969lji.11; Fri, 04 Jan 2019 00:02:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NvhY3wu/fHL0DJZcMatDD+if2531/0VbYTjX0hfgGMs=; b=YX0TLqdMfBw+QIZ8bMRgg8NWYjLysFgU1oOHzeez2ZzXt6qwNCoGbNaMO7/2FM/Hgv 7N1NMKlSo1tqtP4tJj+joczOPDa8zBXloZBa8E5Gv6K0PIGHY5dVWKpr2JTOl8exV90D 641F8mGI1OgAibx3CsEYQn1Vj1Ib+gvUnxlLH3rpK/EgopWNE/ZDduZu6C6o9XvMHUi1 JJFJ/7U1iTTeIhUwLZvgkNhk/iOmz/t0fnSfhHHktKGMOBx9v8P3Kf1862K/TBXGyUyL IHSgpSG6GAdKRGCFo1BR7U8BLU9knYbeZZAHrhknXqBu0fCnYPqUnAHMSIZvgwCQv5z0 moZQ== X-Gm-Message-State: AJcUukcOQtvSU5dT4vCczOSxFJq+O4PvKxPDUb2wPnWId9t+5oXV7oAH RfH6HbOLQ8IeC/qWYFQwTPs= X-Received: by 2002:a2e:9a16:: with SMTP id o22-v6mr28443082lji.112.1546588948122; Fri, 04 Jan 2019 00:02:28 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id b128sm11161004lfe.91.2019.01.04.00.02.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jan 2019 00:02:26 -0800 (PST) Date: Fri, 4 Jan 2019 10:02:24 +0200 From: Matti Vaittinen To: Charles Keepax Cc: Mark Brown , Geert Uytterhoeven , mazziesaccount@gmail.com, heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com, Greg KH , "Rafael J. Wysocki" , Linus Walleij , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Vladimir Zapolskiy , Linux-Renesas Subject: Re: [PATCH v3] regmap: regmap-irq/gpio-max77620: add level-irq support Message-ID: <20190104080224.GB8865@localhost.localdomain> References: <20181218115931.GA21253@localhost.localdomain> <20181227073531.GA2461@localhost.localdomain> <20181227075648.GB2461@localhost.localdomain> <20181228080533.GC2461@localhost.localdomain> <20181231191127.GL1846@sirena.org.uk> <20190102074251.GA8865@localhost.localdomain> <20190103172008.GO16508@imbe.wolfsonmicro.main> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190103172008.GO16508@imbe.wolfsonmicro.main> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 03, 2019 at 05:20:08PM +0000, Charles Keepax wrote: > On Wed, Jan 02, 2019 at 09:42:51AM +0200, Matti Vaittinen wrote: > > On Mon, Dec 31, 2018 at 07:11:27PM +0000, Mark Brown wrote: > > > On Fri, Dec 28, 2018 at 10:05:33AM +0200, Matti Vaittinen wrote: > > > > > > > Last night - just when I was about to get some sleep - it stroke me. I > > > > think the correct thing to do would be leaving the irq_set_type to NULL > > > > for those IRQ chips which do not support type setting. If we do that, > > > > then the irq core will take care of situations where user requests type > > > > setting but the chip does not support it. Which means the regmap-irq > > > > would be no different from any other irq chip where type setting is not > > > > supported. > > > > > > Yes, this is the best fix - let the framework handle things properly. > > > We'll need a second set of operations and to select which to use based > > > on having type information but that's fine. > > > > > > > So at the cost of removing "const" from regmap_irq_chip we could do: > > > > > > ... > > > > > > > Mark, Geert, what do you think? (And maybe same for the .irq_set_wake - > > > > but I did omit this as I have never looked at the wake functionality > > > > before). > > > > > > We need a separate struct as otherwise if there's multiple devices with > > > regmap irq_chip implementations then they'll collide with each other > > > > Right. I must admit I didn't notice this! I was about to make a nasty > > error there... > > > > Looking at the code I think it just copies the struct anyway, > basically using it as a template so I think this should be fine. Rigth. It seems to be: d->irq_chip = regmap_irq_chip; not: d->irq_chip = ®map_irq_chip; and struct regmap_irq_chip_data { struct mutex lock; struct irq_chip irq_chip; struct regmap *map; ... }; not struct regmap_irq_chip_data { struct mutex lock; struct irq_chip *irq_chip; struct regmap *map; ... }; > > > you're probably right that we need to do the same thing for the wake > > > configuration. I'll still look at applying your patch as a temporary > > > fix though. I won't touch the wake thing (at least not yet) as I am not familiar with it. Is it Ok to change it with another patch later? > > > > Thanks Mark. I try to cook a patch with copying of struct irq_chip still > > at this week but I wont rush it (I have some other topics under work) as > > the regression should be fixed by the other patch. > > > > Just to check that is this patch here: > > https://lore.kernel.org/lkml/20181227084443.GA23991@localhost.localdomain/ > > Just want to check what will be applied so I know it will fix the > regression I am seeing as well. Yep. That's the patch Mark did apply. > > Thanks, > Charles -- Matti Vaittinen ROHM Semiconductors ~~~ "I don't think so," said Rene Descartes. Just then, he vanished ~~~