Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp571817lqh; Tue, 7 May 2024 07:46:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUK+putV65XFyqJNWjEYwPIT4/4eSwwm5G2JNoB5S4FKjCo/ay4CCY6g/HmIVcd5snx/OQJd++3hbFNe/vXuXhK5rdmbenfeTSSPDH/qQ== X-Google-Smtp-Source: AGHT+IEYj5CFqdMLkQ9MZC3Ksx5UdQ/vgh5MMbh2fyCF1zcvLDCR1Zt3qJzV18D0Gh+xhbUOBof1 X-Received: by 2002:a17:903:298f:b0:1eb:5222:7c5f with SMTP id lm15-20020a170903298f00b001eb52227c5fmr16864919plb.10.1715093219151; Tue, 07 May 2024 07:46:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715093219; cv=pass; d=google.com; s=arc-20160816; b=gAxNyJKd7MbMu3u2I1Me4Btirz5qBPTJ7gQc67rgBWjroeFlafQ4eXSxnGtmEtRsci fu6jTL7/ENAmRToyV6Gj1yozAf3GxeY5wOVKK2b4ubxULJShY6a1QlKe2o9ayAQ5tM6Q /xWfFblkV78tfwlPbErAE582nInuYe2JZ1sNgUlJ72qNJq4qydkkJV0OwOfJh6F/A8YG s5yDgSH22UXtXSqWwGM3FdIWQCLSDtSht7KP9zjL6p6xNCbACIA1nATWnOcKWpo1zh0Z vtZcjjNZX1DKDKXxNqFVxy1Fnoq0QBEtUIPd86nKOfLg85O2HNrDjnHIoByblfE/bXvV HFoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LmDorImnIdOysGOIUO3rbGXhLiFWzvdZdrq18QybmTM=; fh=sSHLxc+YM9R1/ITH3LBpJJqDJd84bceuaT/vSDtWFm8=; b=dWKVHhxbaXoLBMqKEK5q2RY8tw3VaPhwor+nb4CPK28JYcbPj6yctilCI4SI8CJYXI poK6s8DwdZZlyHzh34NCYnU+NxwQA/1iQuA229KOEu/3u/7NqEG0CU6XG9tQc7jhmJTz AqW4ui97Smlayc9b4OprLxVPgwC8MwwHMpEao226Q0JxczMpTPu7Of1PpEEgG27N3lgc Gg6IaErWN0y7QEzeH+59un7rxJqTi7tFJUQVsZtEbcXhKNgQL8yxM+yXjntldXrWJoTc bpDxJD4YsEyEJbIekMq1oBy4+b4h5NUBp5QPasHFWDDhJ5ZgJAdf8MTwhiV8pqP7zBdq gvSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAEXXUXv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h3-20020a170902680300b001ed3ca2545dsi8275265plk.642.2024.05.07.07.46.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TAEXXUXv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EECF728D74F for ; Tue, 7 May 2024 14:36:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 662C61591E0; Tue, 7 May 2024 14:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TAEXXUXv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AFC7154BFC; Tue, 7 May 2024 14:36:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715092604; cv=none; b=pTtw/kqkmR8Pkhgw5Manz8AEtuzULtQI2fQz/wVZOr31lEw3UULhooBzBRHO6NaOqNsVmsmCl7K82xZxARJ/9WdLE8jcsVTpV255S3wnxAEF46OJbQ66TAtDjkH/O0+ld8V/qRACeUN/YCML0aH7rrn/BHnHMgQ3QN0ZlKryRCA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715092604; c=relaxed/simple; bh=tMTmRH5/GWPjl9T+PClN91yYJR6r89On46+/BeKoh6k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qmLoIwAjK2Jg7MIh2FudhPIS9+ewTTdVfCRNmr5+Msk8V5bmtiSimUb3HLNCMI+nwCEczaX4HerPLh6DniOxQVN/jR5xUEGt5ziaMX6dTeqzcMMKlafZWekmMVfm1xm9b0XaFJBT7bQ2sS8UWsFYksMTMO0y/inA1jHrfgk1nHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TAEXXUXv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DBEEC2BBFC; Tue, 7 May 2024 14:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715092604; bh=tMTmRH5/GWPjl9T+PClN91yYJR6r89On46+/BeKoh6k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TAEXXUXvP/RwXMufOxMcpdr0ktv6yxwsW7WAv9/h370YTCjXFYtnJUhRjnfUWyslu +LaWO4UEtWUnCDAbfm2GMxC0GdtC2ZUAYfABjbvYuAimQn5h7LvLT9N51BLY9YpM6t L0H17jUkUxj/47TYyxguGxRlqBPtGopQwDyCRaVSRYZLdD4vFAbNTueiqKVsE+9W0V cpQ5THDkwwmOTm4S2uhYLKLktFIpUxroiI6hixZ+/S6Y2Wk/WUReX2aBn3p3JiWQpG /J6wpeUm/bk67u57GqPOBJoE8YZL4RHhMvI3t2pMpndWL4ZXVIr57X0JcrD4CH5BLl w4KYGQzrl5w2A== Date: Tue, 7 May 2024 23:36:41 +0900 From: Mark Brown To: Dmitry Torokhov Cc: Hans de Goede , Charles Wang , hadess@hadess.net, Richard Hughes , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, neil.armstrong@linaro.org Subject: Re: [PATCH] Input: goodix-berlin - Add sysfs interface for reading and writing touch IC registers Message-ID: References: <20240506114752.47204-1-charles.goodix@gmail.com> <6362e889-7df2-4c61-8ad5-bfe199e451ec@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lPiblj3fTQ4wDvEh" Content-Disposition: inline In-Reply-To: X-Cookie: Accuracy, n.: --lPiblj3fTQ4wDvEh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 06, 2024 at 07:13:38PM -0700, Dmitry Torokhov wrote: > On Mon, May 06, 2024 at 02:03:13PM +0200, Hans de Goede wrote: > > If raw register access is seen as a good solution, then I think this > > should use regmap + some generic helpers (to be written) to export > > regmap r/w access to userspace. > I think the less code we have in kernel the better, especially if in > cases where firmware flashing is not essential for device to work (i.e. > it the controller has a flash memory). That said IIRC Mark felt very > strongly about allowing regmap writes from userspace... but maybe he > softened the stance or we could have this functionality opt-in? I think unmediated raw register access is a terrible idea, you can't safely write a driver if userspace can just go in and randomly write to registers with no coordination with the running driver and for some devices the kernel needs to ensure that any writes don't damage or destabalise the system. If a driver provides an interface that looks like raw register accesses that's of course fine (I mean, a lot of firmware formats basically boil down to register write sequences which is clearly fine) but it should be the driver doing that and it should be looking at what's going on and ensure that it's joined up with the needs of the rest of the system. --lPiblj3fTQ4wDvEh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmY6PHgACgkQJNaLcl1U h9D1eAf8CiFrx1FTof5H3G+5IPZ86vGYxnBqYnt4ClHpxIe7bCBCQTi2o0/+2eOr dbx61ihnlezPAkp+0cFqM7/Kzxruc9I0cEP6jp4LtOP6sDJgTz9Zj0zRht2i6A5b j+BOo/2UHk+Q7nhde9m/7tjL6MkwsHpvg+ydWB679H/PnBo8hm75lgjq3gy+3gGd EOMryKmKcnF/bPEk24QpI1BNf3mdbJ63Avcj0LCvack3yeaEoXPKJ89xN1SqLdAe LMzF9V0YqKi3H8llb0Jfccvta9feqUQ/k/XI2mq2j4nr2/M7UBh/ckThwHUZRT18 nB7fKVugWFClUR8n/kKIp2fRdxsG9A== =4jXB -----END PGP SIGNATURE----- --lPiblj3fTQ4wDvEh--