Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp619223pxy; Wed, 28 Apr 2021 10:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQMWkQRg9AV4d1yn/83KxbUa7TZTljDWJXPZ/CckM6CmzuNMjhCDiR76soADIjg2aAj/7r X-Received: by 2002:a05:6402:7d1:: with SMTP id u17mr2714040edy.312.1619631350952; Wed, 28 Apr 2021 10:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631350; cv=none; d=google.com; s=arc-20160816; b=wqaISff9k8LJa+j30fxB5/BeBUz2XhdXpl4TQaPtYAQlXm04mUdPbEOYS+R7iFOZq8 QIAbFKK+fq6kdCS+nqIp1jLbnJiQcjiJaK6Ixt/yusXG6Q/YZy1xmDtn126u1fTga3rU r50KB8+Lyd986so1bGeCfBWJkGI2v3WxRCgwLi0ytVE5MVUTmsxLs5Q9Xh3pDLz8lK21 u0SaQHLWak1lstlkop+6jQo/FH5vbGEqjrrQG5kM2nZp0SnEQgLWC8e0KOr0gIb3bptl TlEIy9IH4p1vrhXXXm/GhYQg0fsQYBDATOq9FECIdLk5XpKzKzYUm++dENHCSZz86F69 IwMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=qOjw/W9iHbCH+auAwK67+0lrcJOV1+e5IdkBIE6HY9s=; b=DwAu976Z8kBJjzL0lwkS2VgxBcH7Imx3phJjQGUy4dETSno8k9i59SXR2+Up18Brxc 9SWY/6ihGEYp0Shms8HBcQpt88qNMBCamCXapmgIsaCFYmk+L6PRxTr/gJy1PyixOvhn 3xGygbIkcYssIBeGolM+Z10UECMRe1vB+LiO5utTfUzMMHgJLK4krwIjqteh3Zy2OAsp wxen88wq0awD4Uo8vWIk8Ra+IsnHeAAOUVM+cnVOKeekB5Ujq9eoODIDisOwqUMqOBy5 db7tkxtoBp7u3izi1M5KkemzWhx1JiK9oUk4SqIgKikDzN5FXD1WW6Do3nxq7kUfOhOf eJLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=eED+hgpd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho32si631147ejc.270.2021.04.28.10.35.27; Wed, 28 Apr 2021 10:35:50 -0700 (PDT) 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=@walle.cc header.s=mail2016061301 header.b=eED+hgpd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237669AbhD1OtO (ORCPT + 99 others); Wed, 28 Apr 2021 10:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232569AbhD1OtL (ORCPT ); Wed, 28 Apr 2021 10:49:11 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD2ACC061573; Wed, 28 Apr 2021 07:48:26 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id B1CB42224D; Wed, 28 Apr 2021 16:48:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1619621303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOjw/W9iHbCH+auAwK67+0lrcJOV1+e5IdkBIE6HY9s=; b=eED+hgpdmV1x/gcf1G6u/pInBwmVMUq7EmE6v+HyiPCnyW82nLTnTB9Z5lmMWNxHXKVHQV 89TTW9BsAp1z2kRPp4zeQwKSbMcet4icxNcJM1mz2o1Va3d+3PZkpNNFjPydX5fQJKJP3b JCr4+3tIRzCZxQLCcJ76jdqmoDaEUdg= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 28 Apr 2021 16:48:23 +0200 From: Michael Walle To: Andy Shevchenko Cc: Thomas Bogendoerfer , Linus Walleij , Bartosz Golaszewski , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Mark Brown Subject: Re: [PATCH v4 1/2] gpio: Add support for IDT 79RC3243x GPIO controller In-Reply-To: References: <20210426095426.118356-1-tsbogend@alpha.franken.de> <6f6bce2f070998db49acca2f6611727b@walle.cc> <880011ffd80ae7d1a32e7a17d405b987@walle.cc> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <3a23d7e901ac72630aadbd274517f8ec@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Adding Mark here, too] Am 2021-04-28 16:32, schrieb Andy Shevchenko: > On Wed, Apr 28, 2021 at 5:04 PM Michael Walle wrote: >> Am 2021-04-28 15:44, schrieb Andy Shevchenko: >> > On Wed, Apr 28, 2021 at 2:57 PM Michael Walle wrote: >> >> >> >> Am 2021-04-28 13:07, schrieb Andy Shevchenko: >> >> > On Wed, Apr 28, 2021 at 1:51 AM Michael Walle wrote: >> >> >> Am 2021-04-26 12:29, schrieb Andy Shevchenko: >> >> >> > On Mon, Apr 26, 2021 at 12:55 PM Thomas Bogendoerfer >> >> >> > wrote: >> >> >> > >> >> >> > 2) there is gpio-regmap generic code, that may be worth >> >> >> > considering. >> >> >> >> >> >> This driver uses memory mapped registers. While that is >> >> >> also possible with gpio-regmap, there is one drawback: >> >> >> it assumes gpiochip->can_sleep = true for now, see [1]. >> >> >> Unfortunately, there is no easy way to ask the regmap >> >> >> if its mmio/fastio. >> >> > >> >> > I don't see how it is an impediment. >> >> >> >> You'd have to use the *_cansleep() variants with the gpios, >> >> which cannot be used everywhere, no? >> > >> > *can* sleep means that it requires a sleeping context to run, if your >> > controller is fine with that, there are no worries. OTOH if you want >> > to run this in an atomic context, then consumers can't do with that >> > kind of controller. >> >> Ok, then we are on the same track. >> >> > What I meant above (and you stripped it here) is >> > to add a patch that will fix that and set it based on >> > gpio_regmap_config. >> >> Yes, but ideally, it would ask the regmap. Otherwise that >> information is redundant and might mismatch, i.e. gpio_regmap_config >> tell can_sleep=false but the regmap is an I2C type for example. Also >> if a driver wants to support both regmap types, we are no step >> further. > > Yeah, I agree that is a band aid, but you are free to fix it actually > on regmap level. > I don't think it will require an enormous amount of work there. I'd love to fix that, but Mark was against exposing that property outside of regmap. So it it what it is for now ;) Maybe he'll change his mind or someone has another idea. -michael