Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1009281rdh; Fri, 24 Nov 2023 03:23:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IECqRqOAFmvoxrzLRWt5oBLzidlkoeMU3w1gKuw7hpRqqeEzc93/AO2DqRNaxE3k8HaiJai X-Received: by 2002:a17:903:2286:b0:1cf:6900:6714 with SMTP id b6-20020a170903228600b001cf69006714mr3142437plh.9.1700824991425; Fri, 24 Nov 2023 03:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700824991; cv=none; d=google.com; s=arc-20160816; b=MnnZYoWNSKP+8XR+hEAcTg02O6zhix0NkBkog7K02yftAwTC+0q6OrbHxQwlDQxYce 3oxymvUhfWgNl0ePt/IMHeznk+vVdOjdV+yaG4hdfjgJ3KAhGE+oHgmIsQNs9epxlHld IrrzdS2Kf8k7SIKe8lr8eHgD7kxyTqY4ih4A1sXdbVtMKX21M9oFHhb/6lH56e2t4XIA GSjP6cMCGhydg0u0BGf2YAOw0A2f16v18aYt3nCxNPj8xhNQMzBxtxMEfcwuWJcPezsA jfcR6u38Q+2W476jDq9E+AXdb75xqoRT15tk74WX2+FebSt0SyPoumAoLF1qF7+XHgzW GXWQ== 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=8JT6SaW/06DjplRa11Ea8V5XcEpEi4WJDOQdOEgJaRw=; fh=59xt6uxysj/eXzLVrZRIeC/dqOOu/391/NRFZhoEwxw=; b=IlNQCtJKvsPeB9VmKUNBBF7fBKCPov4mLx5fo2USnxMtor6geC5LqyqqvXe+c/h3jg 7cdr3lbOsDllmt6vd0aaQMvEHnypWtspJBcTOPPpsg5SzE2qt8jrSPYTtarafzTuctsX X6Z+HI0Ct17vZgkGsQIIL5yhxYtckTgwJM72W1F+P5Px8yHGKyQchaRnbliTyOoIjRUd wJQl3Ps0GxazlDtSuFG0Zy4oKQgwSsf25lWh5KK8aAVVj0XmfCtoyCghQR7gObzd+fq2 qhJetYFvBHpVhe9SNbR841Y731OetCFxQK6zrFaLaJlDqKffo+LRWl9y0WTtX/EOLT38 HX8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="aj7g/DL6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id c5-20020a170902d90500b001c9c3f327e1si3065245plz.191.2023.11.24.03.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 03:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="aj7g/DL6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5E17B81E9CAF; Fri, 24 Nov 2023 03:23:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230334AbjKXLWk (ORCPT + 99 others); Fri, 24 Nov 2023 06:22:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjKXLWh (ORCPT ); Fri, 24 Nov 2023 06:22:37 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D93EB10D7; Fri, 24 Nov 2023 03:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700824964; x=1732360964; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=NkIA0FKFLlcC69DWDl71RDdxGe5F/FY5m+uFFak1rb4=; b=aj7g/DL6CUqXN6hPALkwteejOQ+ZBgoYgb/VPa+wP1pCj1fLLj5jSvvZ IEdhSKJLBUGtZU1bVXycUnvlQkDKN+E3L0NWXuafiGz4OhV8Bn0sfpk7S yfi5lHy76PfIX0xpuHPJ6E5b+sL1QPhr/SDUzLw1V8MHrSFRV6thZEyL9 7xDeQ57VPMPNqoPsrNI+VBA0TjcVgzmtU64xylVba9M6ofQcUoIdrntnD jRrr59n94NTROFpzOswZtcnnsxh31zgzEABKhZbQVQK6yswvWC9DhFjF3 2MNW4PKERFY2hGgTayR3Aw5w6U66Um9rAPyOmujfznkb6hNh6627AL+kS w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="5628040" X-IronPort-AV: E=Sophos;i="6.04,223,1695711600"; d="scan'208";a="5628040" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 03:22:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="833670573" X-IronPort-AV: E=Sophos;i="6.04,223,1695711600"; d="scan'208";a="833670573" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 03:22:39 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1r6UGa-0000000GhMj-2SIa; Fri, 24 Nov 2023 13:22:36 +0200 Date: Fri, 24 Nov 2023 13:22:36 +0200 From: Andy Shevchenko To: Hugo Villeneuve Cc: Greg Kroah-Hartman , Jiri Slaby , lech.perczak@camlingroup.com, Hugo Villeneuve , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH] serial: sc16is7xx: improve regmap debugfs by using one regmap per port Message-ID: References: <20231030211447.974779-1-hugo@hugovil.com> <20231124000534.aa8f0c866753c3a9e6844354@hugovil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124000534.aa8f0c866753c3a9e6844354@hugovil.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 24 Nov 2023 03:23:00 -0800 (PST) On Fri, Nov 24, 2023 at 12:05:34AM -0500, Hugo Villeneuve wrote: > On Thu, 23 Nov 2023 23:37:33 +0200 > Andy Shevchenko wrote: > > On Mon, Oct 30, 2023 at 05:14:47PM -0400, Hugo Villeneuve wrote: ... > > This change might be problematic, i.e. ... ... > > > regmap_update_bits( > > > s->regmap, > > > - SC16IS7XX_IOCONTROL_REG << SC16IS7XX_REG_SHIFT, > > > + SC16IS7XX_IOCONTROL_REG, > > > SC16IS7XX_IOCONTROL_MODEM_A_BIT | > > > SC16IS7XX_IOCONTROL_MODEM_B_BIT, s->mctrl_mask); > > > > ...if this happens inside another regmap operation it might collide with this > > as there is no more shared locking (and if driver is going to be converted to > > use an external lock, the one in regmap might be disabled). But I haven't > > checked anyhow deeply this, so just a heads up for the potential issue. > > Hi Andy, > are you refering to the above piece of code as the only location where > this could be problematic? > > If yes, then it is located inside sc16is7xx_setup_mctrl_ports(), which > is called only during sc16is7xx_probe(), and I assume it should be ok. With below it becomes two. Maybe you can point out somewhere in the code (in a form of a comment?) that regmap[0] separate access is allowed only in probe stage? Also be aware, that other callbacks shouldn't be called at that time (means no port should be made visible / registered to the users). ... > > > - ret = regmap_read(regmap, > > > - SC16IS7XX_LSR_REG << SC16IS7XX_REG_SHIFT, &val); > > > + ret = regmap_read(regmaps[0], SC16IS7XX_LSR_REG, &val); > > > > Here is a probe, most likely no issues. > > Ok. > > > > if (ret < 0) > > > return -EPROBE_DEFER; ... > > > + snprintf(buf, sizeof(buf), "port%d", port_id); > > > > Should be %u. > > Yes. I just noticed that Greg has applied the patch to its tty-testing > branch, I assume I should just send a new patch to fix it? Yes. -- With Best Regards, Andy Shevchenko