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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6DE4C433B4 for ; Wed, 28 Apr 2021 14:04:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E7CE61444 for ; Wed, 28 Apr 2021 14:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240124AbhD1OFV (ORCPT ); Wed, 28 Apr 2021 10:05:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbhD1OFU (ORCPT ); Wed, 28 Apr 2021 10:05:20 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A0DAC061573; Wed, 28 Apr 2021 07:04:34 -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 B78632224D; Wed, 28 Apr 2021 16:04:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1619618672; 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=chFDx8DLygr7BeMNJ5Y2+mrFjaqKbsXAp4rGczBn/rQ=; b=vYlIDouezddpBiLL9zI0HYbdVdOoorgyNAHvd3xgiWorddQWsmAQftY2OkK7Tm2aItXHno u2l7DiS7sWl2GEWGf6RARulLv2uOQknl0R+q3bW4xxS1D9qhMPwaztPZJFOTysmFvir8TN PQvTfSfjlv2Lu8ZIJvEOMN/85Z4tsPA= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 28 Apr 2021 16:04:32 +0200 From: Michael Walle To: Andy Shevchenko Cc: Thomas Bogendoerfer , Linus Walleij , Bartosz Golaszewski , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" 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> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <880011ffd80ae7d1a32e7a17d405b987@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -michael