Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp910908rwl; Wed, 5 Apr 2023 09:14:21 -0700 (PDT) X-Google-Smtp-Source: AKy350Yq+A2XQvwVBlhF8l+uAj0dNB14chwHj8YmDEC2gvcYE4kHKCOY6Dd3jvHOujpt7WpbU+ki X-Received: by 2002:a17:903:2441:b0:1a1:a7b6:e31e with SMTP id l1-20020a170903244100b001a1a7b6e31emr8240580pls.7.1680711261181; Wed, 05 Apr 2023 09:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680711261; cv=none; d=google.com; s=arc-20160816; b=lmjpgQKQi2iYEUquxy1K/yEtpt52p+I+uUPOgvm/cImc8APxxA8KzLSmnk/zhQZHjE m/pK0A5gnzl5YD67xybmWaGCCxqPwZ8aYq68AKIOX6qDYKDkxpciWNbBF77LAU6CzOVa FtbXYOlSUSvmBEO1lrE9dmTeNDBKF6Ukq1vFKV+0TaqJObZGUZqfGYH+wKplPt5Hn0f9 m8azgPY6JOhFvdHxbCrD3M48RktF2dd5ZUIJWKgO0qyz05m8XSQoSh+raL/qCZLoD2is megqkibrb2d19ykyP+hMge9TSummrcsapuOoVvPqGjccP6rUDPDPQBKreFLlDY9q6PsD EcAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=y4S3XK+L5k17VRfD2qdUKVKQgCivH1OsFkKIaCPBFfk=; b=xCy+Ci5E5hvLT1R01NIyOyPEOdPtPAbJXd53kqoMsZlnkrOXGssU1YxWEsZYT8Flli ovyPWXxUC8klpEqFAwVjpUp6aCH203OFUOfz0v4e67eNe6yX7Re5/ILUN+k2u+ZvKsaD cDuLAfmWIKPUHpsreYE6+lEYbzJOvU8SLk8ZRqPknij/6cpjFtFE0KxYL+Ht8JXO2EsI 36a/wqA3KcHQJYR+plesCw2qiT6FYfwGgf0pHmEInNROA36J2y8C7NjXcqzDDZYf9+HU +K6cyUUfAg+t4Kf2QdyqhuklYEjKAuH+BYrLN6SHGw20OF3dHhVIT4GDyyb11jH6QLUD A2ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aVlxFBkd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a170902ea0c00b001a1f44d31b5si13404619plg.565.2023.04.05.09.14.09; Wed, 05 Apr 2023 09:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aVlxFBkd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230491AbjDEQNP (ORCPT + 99 others); Wed, 5 Apr 2023 12:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234091AbjDEQM5 (ORCPT ); Wed, 5 Apr 2023 12:12:57 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D83F7AB2; Wed, 5 Apr 2023 09:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680711148; x=1712247148; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=kY6FYRMMLrAPbGBkMo9Na+eZcMkaq3QXvRDWH/QYHCg=; b=aVlxFBkdAORWAaS0M/Y1B0D5Bolmh7oIwo6aYZHn5PxeC3ZyVU32ru1P taVAKbugtxg+00dBpAQhATOv0vMxLIjRb3Ej+tokRgh4tjh9dq+Htb6W9 LdUvrlEpI89Q5Qr3NleDBCr18rrcfGGDJ5qIAdN8Gt8vfr52WESv1V6AC f3h3j1jaUySffKnv/VkJWUomYHc2BbhnmDeuuwv+IX4gxZHt2KFdjwWLE 9m/0lR31cr1PX2Bs4pXpmAMnWvN/dFBAttxme487FzwwcB9MPerF2lvzj elk8gT3TXtWmOPorNsY+6QengeuN3mOXyqV0UmWxjjZ1ANk2bbDLd6ixd g==; X-IronPort-AV: E=McAfee;i="6600,9927,10671"; a="331100655" X-IronPort-AV: E=Sophos;i="5.98,321,1673942400"; d="scan'208";a="331100655" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2023 09:11:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10671"; a="1016526158" X-IronPort-AV: E=Sophos;i="5.98,321,1673942400"; d="scan'208";a="1016526158" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP; 05 Apr 2023 09:11:18 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pk5jA-00CuLV-2x; Wed, 05 Apr 2023 19:11:16 +0300 Date: Wed, 5 Apr 2023 19:11:16 +0300 From: Andy Shevchenko To: William Breathitt Gray Cc: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown , techsupport@winsystems.com, pdemetrotion@winsystems.com, quarium@gmail.com, jhentges@accesio.com, jay.dolan@accesio.com Subject: Re: [PATCH v6 0/3] Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers to the regmap API Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 05, 2023 at 11:45:41AM -0400, William Breathitt Gray wrote: > Changes in v6: > - Wrap lines to 80 characters rather than 100 for set_type_config() > - Remove regmap_config max_register lines as superfluous > - Enable use_raw_spinlock to prevent deadlocks when running -rt kernels > - Check regmap_update_bit() ret value before goto exit_unlock > - Rename exit_early label to the more descriptive exit_unlock > - Add sparse annotations for lock acquire/release in > ws16c48_handle_pre_irq() and ws16c48_handle_post_irq() > - Explicitly add 0 to WS16C48_ENAB in ws16c48_irq_init_hw() for sake of > symmetry to match the other WS16C48_ENAB operations > Changes in v5: > - Refactor for map parameter removal from handle_mask_sync() > - Cleanups and line wrappings to 100 characters rather than 80 > - Adjust to change mutex/spinlock_t type locks to raw_spin_lock_t type > - Remove pex8311_intcsr table configurations as superfluous > - Adjust to set pex8311_intcsr_regmap_config reg_base to > PLX_PEX8311_PCI_LCS_INTCSR > - Rename PAGE_FIELD_PAGE_* defines to POL_PAGE, ENAB_PAGE, and > INT_ID_PAGE > Changes in v4: > - Allocate idio24gpio before using it in idio_24_probe() > Changes in v3: > - Drop map from set_type_config() parameter list; regmap can be passed > by irq_drv_data instead > - Adjust idio_24_set_type_config() for parameter list > - Add mutex to prevent clobbering the COS_ENABLE register when masking > IRQ and setting their type configuration > Changes in v2: > - Simplify PCIe-IDIO-24 register offset defines to remove superfluous > arithmetic > - Check for NULL pointer after chip->irq_drv_data allocation > - Set gpio_regmap drvdata and use gpio_regmap_get_drvdata() to get the > regmap in idio_24_reg_map_xlate() > > The regmap API supports IO port accessors so we can take advantage of > regmap abstractions rather than handling access to the device registers > directly in the driver. > > A patch to pass irq_drv_data as a parameter for struct regmap_irq_chip > set_type_config() is included. This is needed by the > idio_24_set_type_config() and ws16c48_set_type_config() callbacks in > order to update the type configuration on their respective devices. > > This patchset depends on the "Drop map from handle_mask_sync() > parameters" patchset [0]. > > [0] https://lore.kernel.org/all/cover.1679323449.git.william.gray@linaro.org/ Looks good to me now. Reviewed-by: Andy Shevchenko It might be that regmap locks are unnecessary, but as far as I understood dropping them would require more intrusion into the regmap APIs along with GPIO regmap implementation. > William Breathitt Gray (3): > regmap: Pass irq_drv_data as a parameter for set_type_config() > gpio: pcie-idio-24: Migrate to the regmap API > gpio: ws16c48: Migrate to the regmap API > > drivers/base/regmap/regmap-irq.c | 8 +- > drivers/gpio/Kconfig | 6 + > drivers/gpio/gpio-pcie-idio-24.c | 677 +++++++++++-------------------- > drivers/gpio/gpio-ws16c48.c | 552 +++++++++---------------- > include/linux/regmap.h | 6 +- > 5 files changed, 447 insertions(+), 802 deletions(-) > > > base-commit: 7b59bdbc3965ca8add53e084af394c13a2be22a8 > prerequisite-patch-id: cd19046150b7cff1be4ac7152198777aa960a3df > prerequisite-patch-id: bd3e3830d9ce4f3876a77483364d7190b7fdffa7 > -- > 2.39.2 > -- With Best Regards, Andy Shevchenko