Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2604938lqo; Mon, 20 May 2024 10:30:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDnzCKrr6CGNlJCo7gGC26TlmfuJQIoDdbaE+g/n1Sel2XzMCu2rJst7PPjqEoACOokfjKuXrZlCE6rKV9PawcAmQc4eU/W35dXse8TQ== X-Google-Smtp-Source: AGHT+IEqTU07i19N2mICOM3IOlhIu6csPQwXHWBQKRDaXWFkGlLfDHwidfFetErjeG7rdeLnbW1K X-Received: by 2002:a05:622a:14cf:b0:43d:f335:425b with SMTP id d75a77b69052e-43dfdb68ffamr314584751cf.44.1716226201827; Mon, 20 May 2024 10:30:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716226201; cv=pass; d=google.com; s=arc-20160816; b=YkKFnymgvDUyOOKjK3bWYgyr3t2S5nWJTRV9YhrHnGRgYZ4c+Or6hgNCYdm+cJTADl tc04Lykk3JUP1kxuZqSwoXTAK252GJ8ewRQawuAcdffuq7dGE1BsrnBau5H6shj3dYCB QVhUz3JXJgX9clzn8WN8+/k2WcMeOD7bBiXEFPxLKNHXXCApHfJ3ewuMv9s8YLM02MDy 2RUTW6gyFrQ/VGKf1mdvLHY2t2SrFhtBsrrH7/LG4s5v79fNHjBoh0ipGdTTM7DhDaS5 vtxKf/FHFRfYWupPtvBhqdenMCv9pIyz9+R6oeLFQjFsGtCGuxCyL+e2x+nLVrKPiVdJ G/6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=cvIOdk4xUZa+dLTqg5VA9e7Melwr8hlOaowEyxAGAac=; fh=9m9cUyCufFSS8h6UHpaGd7f7zAGik4iX06J85Xd2c80=; b=F7VnlCCkq1lv2sNobtOcE2YvSNQTBNIQEoZSVR7WegLpFHNDfR7byc1riiRM0GFF3B E6cN9lTf/I0QMuTl3r+a1wGk7HOuLyk7pptzggD2YhkYvrXxPWypKcJFgJ8nwIxrFsE5 TrnJr7SI2hHiAEfA815F7ogZB9qDMOwCUGuRL4/YRSH6WwrXbZlT5IQlfUqdHVy5WRFp 9GhVmVg0xK359WtY1NEN8wk8X0NdzNODWTVwkV2ZXdisyFN4dTJ0zjg60BEoQ74byUTF DA4+KqVHAolBQjFaVSBNby40iYisGToiCdx21BGcITJjfrk++K8nV2ezurhEwMGs7RxZ kuLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=neutral (body hash did not verify) header.i=@freemail.hu header.s=20181004 header.b=bXIVpLoz; arc=pass (i=1 spf=pass spfdomain=freemail.hu); spf=pass (google.com: domain of linux-kernel+bounces-184010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184010-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df56d03d1si69971301cf.653.2024.05.20.10.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 10:30:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@freemail.hu header.s=20181004 header.b=bXIVpLoz; arc=pass (i=1 spf=pass spfdomain=freemail.hu); spf=pass (google.com: domain of linux-kernel+bounces-184010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184010-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8AD1F1C21881 for ; Mon, 20 May 2024 17:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CFEA13A89F; Mon, 20 May 2024 17:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=freemail.hu header.i=@freemail.hu header.b="bXIVpLoz" Received: from smtp-out.freemail.hu (fmfe00.freemail.hu [46.107.16.193]) (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 418BD13A417; Mon, 20 May 2024 17:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.107.16.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716226052; cv=none; b=MUzV8m/ys4WmMKoKmTrhc4lRiNkE2tdpHLYihDWrsAjzA6lWNs+/Nl6dLKruE2M5joGDD4Tgb6UznRY9FQS9lZu/5KBfVbJ2eUDI7Wd6WpgLEhZIEDENGB8/a9KypNeDQfb5KICllsy8cV1pA2hAeRIO5P5tRzu5zRJAnsua87A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716226052; c=relaxed/simple; bh=hZ9BTpanyVdzRqlVTlS9UoiB+8CRYDf1nsuDDju6yYY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bjWe3WIT+jwh8GbAI3efVWM7qMPOEBaL6Nc2dvlPC3orxsAv8c7Hj0+tzfE1p2wYsSE3Z0ArRtMIGrOyrnB5S//52fnOc4hDkNqysfudnPS0SaXA+fg/pStQxCngfZUb9Lt27/+TRGYCfMXiB8mdbSpTYaibTcvDKJh2Hg+ka5M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=freemail.hu; spf=pass smtp.mailfrom=freemail.hu; dkim=fail (2048-bit key) header.d=freemail.hu header.i=@freemail.hu header.b=bXIVpLoz reason="signature verification failed"; arc=none smtp.client-ip=46.107.16.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=freemail.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=freemail.hu Received: from [192.168.0.16] (catv-80-98-74-198.catv.fixed.vodafone.hu [80.98.74.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.freemail.hu (Postfix) with ESMTPSA id 4Vjkpp6dq1zqc; Mon, 20 May 2024 19:20:18 +0200 (CEST) Message-ID: <9ae65e3c-f1fa-4ca9-8d74-12d92c51c5c6@freemail.hu> Date: Mon, 20 May 2024 19:20:12 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] spidev: Introduce "linux,spidev-name" property for device tree of spidev. To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240519211346.30323-1-egyszeregy@freemail.hu> <1ec9e8e5-0818-42b0-8776-d9cfb0585f42@sirena.org.uk> Content-Language: hu, en-US From: =?UTF-8?Q?Sz=C5=91ke_Benjamin?= In-Reply-To: <1ec9e8e5-0818-42b0-8776-d9cfb0585f42@sirena.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/relaxed; t=1716225620; s=20181004; d=freemail.hu; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; l=3028; bh=cvIOdk4xUZa+dLTqg5VA9e7Melwr8hlOaowEyxAGAac=; b=bXIVpLozECHnvAP90I3d0K9994PrGE0swuIbqqeq77SjTOhiokcktCTix+gfkE9e 8FehBfGyU+zH7ycndbsuXdwKLx5lmG3U6eTo/poY4Ydb0phNaEQFXaBDuHMMSJxbgzK uBSR+L7zVqdqyGPXz9eb/JpxRfA1nQ6EFYofVn/AA0tj/T6G3mHFkVq/EgPRHU7/dwP y+ZhVCC+zJwTtQDw2Lepwvl3kHllWVf/7GkkHYVa89MSl0WfHyB92+sjhxix9jfzr7X VEiEW1lIG1M4NlPx4NFmQOZoA5AzzYI90PX78nNFfx4c/cDECyJeqa3vQ/7nVmEB5EM JI+vvv0e8g== 2024. 05. 20. 15:20 keltezéssel, Mark Brown írta: > On Sun, May 19, 2024 at 11:13:46PM +0200, egyszeregy@freemail.hu wrote: >> From: Benjamin Szőke >> >> Optionally, spidev may have a "linux,spidev-name" property. >> This is a string which is defining a custom suffix name for spi device in >> /dev/spidev- format. It helps to improve software portability between >> various SoCs and reduce complexities of hardware related codes in SWs. > > This seems like what udev rules are for? Hi, Goal of this patch is to introduce this new mode to assign a custom name from lowlevel device tree to a spidev device. As i know udev can do it, but to do it from device tree is the best and easier way for this feature in my opinion. It is more maintainable then use udev in userspace for it. For example there are three different SoCs: i.MX7, i.MX9, ZynqMP. In Yocto project, the Linux image's SW environment is nicely configurable independently from what is the target MACHNIE. But if i like to deploy a SW which uses peripheries like gpiobanks, i2c-dev, spidev these /dev/... name will be totally different on each SoCs, more over in ZynqMP and any other Adaptive SoC platform, the index number for the spidev, gpiobanks or other can be not deterministic if it probed in run-time. Goal is to easily make a Linux OS image which can support multiple SoCs in SW point of view easily. So, in Yocto project build system point of view the best, if any Machine specific settings is stored in the device tree files of the target machine in driver levels/config, because it will be deterministic in 100% sure and it will be nicely separated from the SW meta layers which may not contains any machine specific hacking with udev and so on. So this way to assign a custom name for a spidev from device tree is more efficient and more maintainable in SW developing point of view in embedded Linux and Yocto/buildroot world because i need to just define a name like linux,spidev-name = "sensor"; then use it with a fixed name in my generic SW under /dev/spidev-sensor name. And there are no need to care about what will be the index number of this spidev randomly after boot and how need to make an ugly append layer for udev config and make it for all of machine variants separately. My opinion udev is ugly to use for it, and no longer beneficial for new Adaptive SoCs where they can be not deterministic what kind of index number they got in driver probing for many gpio, spidev, i2c-dev peripheries (you do not have info about that which need to mapping for what custom name, it can be different in many time based on PL FW). It is much better, safe and easier to assign this custom suffix/name explicitly from device tree, moreover it is a driver related things, i think the best place is in device tree for it not in a sys config file for udev. DT binding would need to be documented later in a separated patch as a guideline mentioned it in Linux repo.