Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp567097lqd; Wed, 24 Apr 2024 10:12:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXA7dukDsQnE8g9zhJPakVBZnJKm75TDUSR76+ItREu6NzFTroxuf7uqgzZL6R9RgGE1leRFbhxk+E3+fYGGYUXF7desP6zEVyhV6XrQw== X-Google-Smtp-Source: AGHT+IEmEVNflj9ygKOREPUeKwa6EpnxWvst8oMBwRbacmBNsgc8DIJlYxCv7AeFbYOOkFAtx9MM X-Received: by 2002:a05:6a20:3243:b0:1a3:ca86:be8a with SMTP id hm3-20020a056a20324300b001a3ca86be8amr2972691pzc.57.1713978736659; Wed, 24 Apr 2024 10:12:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713978736; cv=pass; d=google.com; s=arc-20160816; b=GU8gVndvCw7KuejjueQ5ALkjUYEdMMEuU6ME4nTkLxGWNpalMRa+BJnX7vS6L5aBog L1uOfRG6/thRpASrSooIz5w8XL8QL9ODF999agR0fftttLXypL8tn3Juor7OSIsYht+Y tFvfMfWoKXfX+J6GlW1X35feDNLvZm7lqgu6Uq63r1AbB6U2xP8XFCKcjkdVWZPyoTFI rZYWRubX73gaE5wdghGFb3vB4udlC9mCEc75ipgkBUHbHuIIaR0ttfvnljZ7q5RWVVLV 8Bu2wpqm6ecbePvdykcV1AcS60weZ260Qih/5iQywUtn50VAI+qDDZMJ7hF4+XSbq6jC xDZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zmM7lELFzDnGc6ZurObVedqGSv5yidRsKIMWiDcLanw=; fh=71FImMQDlVl5Cy1OKNCpV4Xyp6O/D6k6nfgZdXOkZ18=; b=nejPTn5+s0vd9lXbt8BMFcuTG4hXL68zGL6xoqUPve36xUd2SFtWypIPORQzbsBCsh +MsFrxYEM809+QLoGGhS9l3YnaVtmCHFHjgMnQ1z8onPUXE6d0QqLjO5Pl5pep1Djjgm E0sFUGTCamR6pHweuPSGyB1zId/DmbQHaiY8DHg9xPkEXvaGSksOkKyQ9T3b5dWQ/rdb EjMkaxKU9K7NJ42GvGH1YuX2ZmjkzfgONGDOI5PTh5uTj6Ns5okGH8XjfI7g9ozKN0b8 pfaF/OIlT8Ax6UpgMMt9IM7tV8FWn8fR1HXgmfb/h++4v8HDg2XusgbQNtniyBYOwAyg vrDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dMo1QBHt; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-157336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u11-20020a63234b000000b005dc6cbf8440si11697826pgm.99.2024.04.24.10.12.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 10:12:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dMo1QBHt; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-157336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7CF03B2B1E4 for ; Wed, 24 Apr 2024 16:36:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3498816D324; Wed, 24 Apr 2024 16:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dMo1QBHt" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0493224E8 for ; Wed, 24 Apr 2024 16:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713976500; cv=none; b=fFfVaoqAAK/KNoMA6fle/S6IVk0G16lC6LxmJGG4gQ4PeuA0vm+tfY57zQro2H7uIa8RSkFjzV+SBd1Eb/3TsskEPyw8Mrq6wlzlmIi79X5zs1WpC90beZFw8zABk/xSmnm5Xo5oYstXKcXV8SE4WPjR61ORJIThq9RghZHNie4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713976500; c=relaxed/simple; bh=iB+4XqNIdHt7yvtxsimmIldmqZ+s79xvMNaIc7fbl+M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YXu8YmOGcc6nr4VWaTRfsIrap8souxwx15skuYHR7LO+MyuadQwA2A5gunpTOdzhNRO21gObzJWBfBYbPLcDlxBAucIY+LewprnVCVO0GVgzu8bWbWYTJc4zmp1BziGFQCWsjtEdI5ePXJyifz9y56inYYo2+C3Q0ZPgUMALyCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dMo1QBHt; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-518931f8d23so7755490e87.3 for ; Wed, 24 Apr 2024 09:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713976497; x=1714581297; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=zmM7lELFzDnGc6ZurObVedqGSv5yidRsKIMWiDcLanw=; b=dMo1QBHtMYfsf4ULtJhXA9C51awBvbVyYudqDfRrWx6k/Pbdq37k425ORLSJ9dposp /yUMzUQu3rLFzbDn6nzxwZ3yxUsv+wBJFBlQ1KGbBcZOhTuGaWg5066ND2GDmZS2y/py aNLdCf4i69yvym2pDNpmHtWJ93EbFixAXT0JBcTVZmbgq9n3ZzNQgepHAiqOLWYbXVT/ 34CwVrXoe7MG6/gCmDLz8CMy76kaRnLHDAZRve6Ha18rIVh7vuxQETT6JjZT7SY6t8K2 LxwHQlaQWTFFbggDGv0kF3fGy8EjJ6vJbwznV0dMkEv9wTD9iDFJReYvQm26Wx1msaAJ UQTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713976497; x=1714581297; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zmM7lELFzDnGc6ZurObVedqGSv5yidRsKIMWiDcLanw=; b=mVhO50EDkTR3NMxAU71iXhjIxaeoKWfTxcwSteNP7udqF9pT5LuROtnGNOlC3bbjFF 2M3G1Gfxmn4FABqa2XIO9/+gTk7MkN6ZHQcXG733PR5hx6VwUHgIjjWD8VFEDYiHIFLp oUZ7x/xbh4EkELjW71EPJ/4VUl6+AnJR+JaTxQI9ymK8f3uuQALlu7uubEOUxD5dBXzl JRyIxd0q0HP0EZvbCaCgpPi8dCll5LBffvxZfkkSW4iDUhsfGUIX3ds0lgsjbtwE00n6 uP+fkISXaCXODvdv7KDpvqFC35xWeE3xct+ohU3pxd7M0UkQGAssfbsyOD4qUdhAocZw VkjA== X-Forwarded-Encrypted: i=1; AJvYcCXyCJQjXL38MwXsZU7K7Xh9SnanJSmOBIA1J+rXK8OHvfRIcWaK6pd22xlTJQNA5NnZY3ZdwmfKBJCW05RBZOKZ+7haL9XxOK0QYpdi X-Gm-Message-State: AOJu0Yyn4zyrrEcBlRwl1efb60X26Ee2IWEyJhThgaQSej8u1KB6c0sd 2wSPYl8Ncu5U+/lgWWRy+n4X3yNRa6FiWp/qOdT1YzWNjvmHMM6Ju+zIdZAwUM8= X-Received: by 2002:ac2:47e7:0:b0:519:1503:9566 with SMTP id b7-20020ac247e7000000b0051915039566mr1987909lfp.56.1713976496664; Wed, 24 Apr 2024 09:34:56 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::8a5]) by smtp.gmail.com with ESMTPSA id n9-20020a056512388900b00518fadeed0fsm2430866lft.115.2024.04.24.09.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 09:34:56 -0700 (PDT) Date: Wed, 24 Apr 2024 19:34:54 +0300 From: Dmitry Baryshkov To: Andy Shevchenko Cc: Sui Jingfeng , dri-devel@lists.freedesktop.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: Re: [PATCH v2] software node: Implement device_get_match_data fwnode callback Message-ID: References: <20240422164658.217037-1-sui.jingfeng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Apr 24, 2024 at 05:52:03PM +0300, Andy Shevchenko wrote: > On Wed, Apr 24, 2024 at 04:34:39PM +0300, Dmitry Baryshkov wrote: > > On Wed, 24 Apr 2024 at 16:11, Andy Shevchenko > > wrote: > > > > > > On Wed, Apr 24, 2024 at 12:37:16AM +0300, Dmitry Baryshkov wrote: > > > > On Wed, Apr 24, 2024 at 12:49:18AM +0800, Sui Jingfeng wrote: > > > > > On 2024/4/23 21:28, Andy Shevchenko wrote: > > > > > > On Tue, Apr 23, 2024 at 12:46:58AM +0800, Sui Jingfeng wrote: > > ... > > > > > But let me throw an argument why this patch (or something similar) looks > > > > to be necessary. > > > > > > > > Both on DT and non-DT systems the kernel allows using the non-OF based > > > > matching. For the platform devices there is platform_device_id-based > > > > matching. > > > > > > > > Currently handling the data coming from such device_ids requires using > > > > special bits of code, e.g. platform_get_device_id(pdev)->driver_data to > > > > get the data from the platform_device_id. Having such codepaths goes > > > > against the goal of unifying DT and non-DT paths via generic property / > > > > fwnode code. > > > > > > > > As such, I support Sui's idea of being able to use device_get_match_data > > > > for non-DT, non-ACPI platform devices. > > > > > > I'm not sure I buy this. We have a special helpers based on the bus type to > > > combine device_get_match_data() with the respective ID table crawling, see > > > the SPI and I?C cases as the examples. > > > > I was thinking that we might be able to deprecate these helpers and > > always use device_get_match_data(). > > True, but that is orthogonal to swnode match_data support, right? > There even was (still is?) a patch series to do something like a new > member to struct device_driver (? don't remember) to achieve that. Maybe the scenario was not properly described in the commit message, or maybe I missed something. The usecase that I understood from the commit message was to use instatiated i2c / spi devices, which means i2c_device_id / spi_device_id. The commit message should describe why the usecase requires using 'compatible' property and swnode. Ideally it should describe how these devices are instantiated at the first place. -- With best wishes Dmitry