Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3479422pxv; Mon, 26 Jul 2021 05:14:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu6foBLLSY8V0BrATtwVdTH/aDA9SPSK6Ix/CzeQkOyX1S/IXdL+8hluZTBfTx4gBJkDTw X-Received: by 2002:a17:906:7c86:: with SMTP id w6mr7745539ejo.493.1627301683046; Mon, 26 Jul 2021 05:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627301683; cv=none; d=google.com; s=arc-20160816; b=QJV0bCIPPJNH6OdMx1+4KCZZ1AtRxhbRRRiW8ztnwG/iRTZ4w3FkTLsK5Frkd3kNqO FjDsq4MyDbXH13mgM6/M7tg1IkBlaEtisWkKZh937oZysIHWzuCtBgnUnbtfSc3JZeM0 tOnDnKtsw2UTtbbCta5SEh/2RhyVRpMzocOjJTm2vhZJbHhEB59JVI/K83GlybgC9YiO tzEnvMxPZTYVT4X1EcZHi63G3pmNZlwMqur/Z9/b7GBIa8d47P5HiXo1o7YgKsRPlyEq n8t2i7r72G/jeJ7ZsoJDc9m1HEPH5wF6m0+epx8WAOrqnyWqeuAJXF0EW9uLQixH08gR 99yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8mGVcWiAq/sq7pdDAoDeXiiWkwiSZxDQ6yc7Wn/XoCA=; b=h7E3S5esjphn1mdxURlbP15xEFSJRRe7gHLuniZbGCpPgXReln6TpKDn+GFTPFdeo8 rWleX0Rw18vu3imuzHV4UiHfmpnuMjEYcN/89jFzisywCPF1pkIaUrh97SyEMVe8umId bf7k8chWk1Z1ndn6rQTWkbNMoEfmsGe+WdX8JCFy0VhXP+yrgIqFfLjNLIumdr8qEgHi TaQ5jmU18Ehl7gYLw1KqGyfWQaSJeQtvddokaqN9tEkwWG8MubSZDusxX43mkuPJNQo8 pXdcvzsygMu6MzZYtV3CLP+3i3wuwP96n35eHKGhQBrNr/uXBXND4X2bybTlu0wjsoCa RUEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WmkskUkI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si1003550edp.87.2021.07.26.05.14.19; Mon, 26 Jul 2021 05:14:43 -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=@kernel.org header.s=k20201202 header.b=WmkskUkI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233874AbhGZLbV (ORCPT + 99 others); Mon, 26 Jul 2021 07:31:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:39966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbhGZLbU (ORCPT ); Mon, 26 Jul 2021 07:31:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB258600D1; Mon, 26 Jul 2021 12:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627301509; bh=/QofLHUu0Emm2H+ZcKFx3EDNEVMlwCtoBJQm1TtySOw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WmkskUkICpmrjbz2hFjNzve3EeJqYZVnQiMxgLHd89172pwA61x7ukFRQMsqFxOnA vd7GxeGIW6+B5LiTxsWDpBe9juJx2PwzmPP33jYtPKeoHpRMoqIadydAJb/7YhmFsM 8rny1LKHMdy2D46fu6RaqCanLO/xIOYQLkGKz90Dq6jU1J86lkIDDjkgAqmYz9cOai GyaJdBf3PhSf5+Q11sjoh++YTxUMSo9F0T4NgCoUdtHW0wJS0H0FxIcb1Hb+iEPMQP 5zKB9mUw8L1qrViWb+yDBPvLK5w2NIKs7cP2Gw2AJVKABCShEe8lHreb3RcuQ+IBoy 7ufQO2RGYl5qg== Date: Mon, 26 Jul 2021 13:11:40 +0100 From: Mark Brown To: Matthias Schiffer Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , David Lechner , linux-kernel@vger.kernel.org Subject: Re: [PATCH] regmap: do not call regmap_debugfs_init() from regmap_attach_dev() Message-ID: <20210726121140.GH4670@sirena.org.uk> References: <20210726073627.31589-1-matthias.schiffer@ew.tq-group.com> <20210726114751.GE4670@sirena.org.uk> <7b54590fddf167744fa2574d8815130608f8e063.camel@ew.tq-group.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J/zg8ciPNcraoWb6" Content-Disposition: inline In-Reply-To: <7b54590fddf167744fa2574d8815130608f8e063.camel@ew.tq-group.com> X-Cookie: Vini, vidi, Linux! User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --J/zg8ciPNcraoWb6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 26, 2021 at 02:01:51PM +0200, Matthias Schiffer wrote: > On Mon, 2021-07-26 at 12:47 +0100, Mark Brown wrote: > > The use case for regmap_attach_dev() is that there was no device when > > the regmap was initially instantiated due to it running very early, we > > want to attach the device when we figure out what it is which includes > > setting up the debugfs stuff. Whatever is managing to call this with > > the same device as has already been set is clearly not that use case. > I'm not talking about a case where regmap_attach_dev() is called when > there is already a device attached; as far as I can tell such a thing > does not happen in current kernel code. So in that case how are we managing to create a debugfs file with the same name given (which was the problem you were reporting) that the device name is embedded in the name of the debugfs file? > Please have a look at the commit in the Fixes: tag. The duplicate > regmap_debugfs_init() happens even when no device was passed in > __regmap_init(), so the regmap_attach_dev() is the first time a device > it attached. That's not what your patch says it's fixing, your patch says it's fixing an attempt to recreate the same directory as we had originally (we should probably clean up the one with no device but that's not what your commit does). I think what you need to look at here is that we store map->debugfs_name and don't overwrite it when the device is supplied. --J/zg8ciPNcraoWb6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmD+pnsACgkQJNaLcl1U h9AuLAf/bz56u91f+8X4FVTHSRY/jPtHrZ1O0onHtCXFxjRdNMQQMepd5egYhm9/ jrwLMN8YL1B6jbpkXqfsQyi6Dv5VslqnphcimDtglAY64xYYsz4Lj0KzaLoT0qXO KPbcloeSnG9X2t/Wpl2tuqIahkpuCEwUzyGQg6h3P7KWyAOQOzFpw1t48Onnwawy Q2MPvyeEmnUjW4AG+bGiARI9+Qvm8Mzwio2b2imWJ2y0RmqRWVquvZHca2xXzl7w tutOOucn7g2lP10ZQH58HMGD+yh+F3OH/yldHmIRI3uEnXYmELpgfI+jR/gL1+tP 76v1WZd7BUVvOqY+VfZlSl1+EUxijA== =US12 -----END PGP SIGNATURE----- --J/zg8ciPNcraoWb6--