Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4154659pxb; Tue, 10 Nov 2020 09:10:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzskPmIWKBzyG+Ds9BLetIj0pZjNAVrKIMaHqQImRQgfyD5er867ta4quYIgmZJNriCLdWe X-Received: by 2002:a50:a40a:: with SMTP id u10mr21341456edb.16.1605028231024; Tue, 10 Nov 2020 09:10:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605028231; cv=none; d=google.com; s=arc-20160816; b=lOrpp7X/Bh7QRszSq9THkwLHQ6YRmNkQM+n8PWkEnwSEA5srqqgUZz1cC0Xha0dsnb JqNga0esGITR2tvt6HY8FBE1O748WdbwM7YKFMb3w/vXy17VXcnRj1gnwDGEhb/69NRA GFr8Gohx+YsKe9mviwXF7896ZFB3Z4yNZBoXKevvBPY+7C9QqWB/nHokgLJX3ptblEKB hL2QNvJO4b43gKbE/Qshr+4Hi+yY4TmHklHHyrZXzoCPOOC9U6r7gRnIMqUWTBmq2Up0 zv11StT6CJ//F9qNSbKtLHckmFEOQTj/1V9TlnoqTTsdT+uc19GY/exxlukJLKUEwkqC V+OQ== 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 :ironport-sdr:ironport-sdr; bh=qf0XWWdX9Fn8z9fivdqhu5YR3AZPaEk6AbjY2Xg5bkc=; b=a3IafQt5CINsjobOh541likoL6CjjL5xE2btn6EAhjXgTi+UKZ4AXuDkvgOnm56WUI QZe+ebaKZ9bbBVc3mVlGdVVZeLDrG9cZ40ilu+m2dB0l4NYF3DLe/hlBfZ9Vz/BDf7pZ d+JuYQVKR/sAWKcFPsk3y7xl/QO8ZaIqRW90Ar+MO8T8J03/wjULHRDRF5WpyHLL4yWB /Rauj0BoYcTX0LHKC366DIaFn51F4XSLJ3YBqNJhA7NsiNUEIvXLE4YEbhHYzzuvryKY MMO4u8Iw6oYF8O/Z1t64/46eqBdE/r30gCBKOWf2iP9Sy4rg6w8i1WOd3LDwPXqAXLRz iX4g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si10934579ejv.268.2020.11.10.09.10.06; Tue, 10 Nov 2020 09:10:31 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728999AbgKJRHm (ORCPT + 99 others); Tue, 10 Nov 2020 12:07:42 -0500 Received: from mga06.intel.com ([134.134.136.31]:34408 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbgKJRHl (ORCPT ); Tue, 10 Nov 2020 12:07:41 -0500 IronPort-SDR: Xb6czI0S6OaBFIIULk/AFLiHRZyExTwWkuWtyfDTDaSiG3AKSmdF0Eq82qN6RA9z17OKrCeYZD a/UuiBUfrrGA== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="231638326" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="231638326" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 09:07:21 -0800 IronPort-SDR: 8lIBQlt+omhWuHSiOpSF8Q0IiNYjUHG45vxp8GFZHhK1l5FrEaEqJGwsW0QGCKFOPcwYGEWVwK XQscQG0o+yNg== X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="356227904" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 09:07:19 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kcX80-005Wtq-IO; Tue, 10 Nov 2020 19:08:20 +0200 Date: Tue, 10 Nov 2020 19:08:20 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Linus Walleij , Jan Kiszka , David Laight , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH v4 6/7] gpio: exar: switch to using regmap Message-ID: <20201110170820.GC4077@smile.fi.intel.com> References: <20201110145552.23024-1-brgl@bgdev.pl> <20201110145552.23024-7-brgl@bgdev.pl> <20201110150447.GW4077@smile.fi.intel.com> <20201110151022.GY4077@smile.fi.intel.com> <20201110161225.GZ4077@smile.fi.intel.com> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 05:52:26PM +0100, Bartosz Golaszewski wrote: > On Tue, Nov 10, 2020 at 5:43 PM Andy Shevchenko > wrote: > > > > On Tue, Nov 10, 2020 at 6:37 PM Bartosz Golaszewski > > wrote: > > > On Tue, Nov 10, 2020 at 5:17 PM Andy Shevchenko > > > wrote: ... > > It's not a typo. But thinking again. This is basically done in regmap > > to support serial buses. Here we have MMIO pretty much with 32-bit or > > 64-bit address accesses. I didn't dig into regmap implementation to > > understand the consequences of changing this to the different values > > (it seems like rather offset, and in this case 11 is a correct one, > > not a typo, and regmap is okay with that). > > But I would rather ask Jan to actually mount debugfs and dump > > registers and see if it screws up the UART (because it may go all over > > important registers), that's why I think this configuration is still > > missing some strict rules about what addresses (offsets) driver may or > > may not access. > > Ok now I get it. Yes 11 seems to be right in this case for the max > address. We can implement the readable/writable callbacks to be very > strict about the register accesses but isn't it overkill? This driver > is very small and only accesses a couple registers. I don't see such > strict checking very often except for very complicated modules (like > pca953x you mentioned). Maybe a comment in commit message or code that this has no protection against access to out of boundary registers. Keep my tag after choosing 11 and whatever you decide for access to non-GPIO registers from this driver. I'm not blocking this from upstreaming since we have got a confirmation that main functionality works as expected. -- With Best Regards, Andy Shevchenko