Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1472575rdg; Sat, 14 Oct 2023 03:58:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFx2z+gqyX9FuYwHchJKemReGI3ByWF9FndQ75DdI6Is30F24w22+RoGU+sNFAAG5WSULqY X-Received: by 2002:a05:6358:919:b0:134:e4fe:e162 with SMTP id r25-20020a056358091900b00134e4fee162mr31319742rwi.13.1697281139414; Sat, 14 Oct 2023 03:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697281139; cv=none; d=google.com; s=arc-20160816; b=WHWZvpIAaE4NJ/xTd33adJbi+t7EFPyo1SYK1vWVj/u7k6D8geTMxYevZnHcAlYuM3 Ciez208bgNAyc636rM3aHnHVZGcOf36wh7Jhf+aHRpf59UJcBaPwyYUhSA68bQf3e7Kk lzcxgZ7+y5vxvPrHMQEyecVe6Dw8wVALNm6OKnShNVQWGTwDBWSTRa06dYysC9Ro1TD9 1yPhgue9USO0e1jCcrzpHo64/JaS2SyOYr6lGnLxAUkkEHTYWqP5ze4r4XGaKcktx0Zy h3mwr/x0lry8l5N8RqIXZ9teeYKfcBiJWvT1DQZD95hFW7AmAgftXK3WABIbOv/scSCP Slsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7K8u/F/T7vd5Qb0NUDHtY09uDfh7jAIHafbl7k57Yug=; fh=TzCF4TjeZ07BCeOPoUtEv8Wm4vSgBBWslu6oIpZC3yY=; b=U5Df8us/2CiCsXw1AqC65CqFcyTq5AErkGUk8qHk1zMaDAze0sWnnq5TSuFd6GJhWW /lELcoXV+HAen/KMyrEbwpdyUfkaTuIFYJtzMcKjKHFnxePKey/GOOmRpAtrS64g1kJB y2cdO/ERWPyu4ToNkK+cDkFvdaXJW+OybPfL8XEc2BtxZC7H2zYAcRyrddPHkkw068Vm 8ltycMwmWM/KW79ucV0Y6IAOPVmdIGiDaiOee36L3oOKWWNFquyfFEJL2NyAT3rdTvDT hgYFMFlPMRaFu18Ar4qC/XcNOmaC3rXHs6P+RQDQVafvd4KgcnGkiPiDEXkX7vY/Wwj+ ZbIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=axAGG+XO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b21-20020a056a000cd500b006b5273b8d14si2844005pfv.72.2023.10.14.03.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 03:58:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=axAGG+XO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 93D3F802CFED; Sat, 14 Oct 2023 03:58:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233018AbjJNK6z (ORCPT + 99 others); Sat, 14 Oct 2023 06:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbjJNK6x (ORCPT ); Sat, 14 Oct 2023 06:58:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA39CB3 for ; Sat, 14 Oct 2023 03:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697281091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7K8u/F/T7vd5Qb0NUDHtY09uDfh7jAIHafbl7k57Yug=; b=axAGG+XOnTuegyal3NHIDnoT8m3q0+oLDWgkhc+vVW2Uqbc+lfwIdbXowqsVGvcgNXcrYh PIBnm2EygyJ2ciFZSvW6c1z7alV7MJV3w2oYSBNAKMBPpuIkR1VQ63ByY9AHv+yNMbg88b kyI75UuHXjX3pZc6k0u2xEXFPJtBtes= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-457-sPkV44EJMx2wB2Fn_HjE6Q-1; Sat, 14 Oct 2023 06:58:09 -0400 X-MC-Unique: sPkV44EJMx2wB2Fn_HjE6Q-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-9ae0601d689so187555566b.0 for ; Sat, 14 Oct 2023 03:58:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697281088; x=1697885888; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7K8u/F/T7vd5Qb0NUDHtY09uDfh7jAIHafbl7k57Yug=; b=SzB/uhJk4flfHVKJOmoN3axpFKc5RHa2EE/lZ1dcBH802WyRZyclay9z6lei4p62qc ecruAdKs/kUNTTaXoZoXdffU3CGT2SaOByf/QbyuaKMt3PqyclhxV6YL5ItdXDt+AAXL Nw8oFeXkSwbK7JKuiPCHChchljMDFxl9PUj5JbrbfVRz984cYSDM+25ZzMV5E3MkRvF0 Rd+I00G3jwP4sQghvUJMum8eZXSikQj+kG5yqG2JXRNbT2FebwfyuMGHSEKNwc4N5/WI u/vbHAYiq0dQ4+uy7/NG6SQxY3+PZkA61OPCc9OdSPtY1uFh3Co0X50WHj9LxxzL16Yf FxqQ== X-Gm-Message-State: AOJu0YyqWSlug4u6G1oYgsb/Cfu3QUt5GibGGAOS6DvV/pJ7WHDOPfJ3 ioRLn1uEPqlIEMVsfBuFRO0PxucG9iu2MhGTnkFGd2+/y9mxTQtHM9p7FT0vdOA9W1+pYUiL4d0 y+QpPJBic3pTZYeZqqp+V2wuj X-Received: by 2002:a17:907:9306:b0:9bd:a2a9:a722 with SMTP id bu6-20020a170907930600b009bda2a9a722mr4380721ejc.45.1697281088712; Sat, 14 Oct 2023 03:58:08 -0700 (PDT) X-Received: by 2002:a17:907:9306:b0:9bd:a2a9:a722 with SMTP id bu6-20020a170907930600b009bda2a9a722mr4380709ejc.45.1697281088270; Sat, 14 Oct 2023 03:58:08 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id vl9-20020a170907b60900b0099bccb03eadsm755833ejc.205.2023.10.14.03.58.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 14 Oct 2023 03:58:07 -0700 (PDT) Message-ID: <9a080d06-586d-686f-997e-674cb8d16099@redhat.com> Date: Sat, 14 Oct 2023 12:58:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v20 1/4] usb: Add support for Intel LJCA device To: "Shevchenko, Andriy" Cc: "Wu, Wentong" , "gregkh@linuxfoundation.org" , "oneukum@suse.com" , "wsa@kernel.org" , "andi.shyti@linux.intel.com" , "broonie@kernel.org" , "bartosz.golaszewski@linaro.org" , "linus.walleij@linaro.org" , "linux-usb@vger.kernel.org" , "linux-i2c@vger.kernel.org" , "linux-spi@vger.kernel.org" , "sakari.ailus@linux.intel.com" , "Wang, Zhifeng" , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1696833205-16716-1-git-send-email-wentong.wu@intel.com> <1696833205-16716-2-git-send-email-wentong.wu@intel.com> <6a87b43a-0648-28d4-6c69-e0f684e44eb6@redhat.com> <5d2e9eba-a941-ea9a-161a-5b97d09d5d35@redhat.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sat, 14 Oct 2023 03:58:58 -0700 (PDT) Hi Andy, On 10/13/23 22:05, Shevchenko, Andriy wrote: > On Thu, Oct 12, 2023 at 01:14:23PM +0200, Hans de Goede wrote: >> Ah ok, I see. So the code: >> >> 1. First tries to find the matching child acpi_device for the auxdev by ADR >> >> 2. If 1. fails then falls back to HID + UID matching >> >> And there are DSDTs which use either: >> >> 1. Only use _ADR to identify which child device is which, like the example >> DSDT snippet from the commit msg. >> >> 2. Only use _HID + _UID like the 2 example DSDT snippets from me email >> >> But there never is a case where both _ADR and _HID are used at >> the same time (which would be an ACPI spec violation as Andy said). >> >> So AFAICT there is no issue here since _ADR and _HID are never >> user at the same time and the commit message correctly describes >> scenario 1. from above, so the commit message is fine too. >> >> So I believe that we can continue with this patch series in >> its current v20 form, which has already been staged for >> going into -next by Greg. >> >> Andy can you confirm that moving ahead with the current >> version is ok ? > > Yes as we have a few weeks to fix corner cases. > > What I'm worrying is that opening door for _ADR that seems never used is kinda > an overkill here (resolving non-existing problem). I assume that there actually some DSDTs using the _ADR approach and that this support is not there just for fun. Wentong, can you confirm that the _ADR using codepaths are actually used on some hardware / with some DSDTs out there ? > Looking at the design of the > driver I'm not sure why ACPI HIDs are collected somewhere else than in the > respective drivers. And looking at the ID lists themselves I am not sure why > the firmware of the respective hardware platforms are not using _CID. This is a USB device which has 4 functions: 1. GPIO controller 2. I2C controller 1 3. I2C controller 2 4. SPI controller The driver for the main USB interface uses the new auxbus to create 4 child devices. The _ADR or if that fails _HID + _UID matching is done to find the correct acpi_device child of the acpi_device which is the ACPI-companion of the main USB device. After looking up the correct acpi_device child this is then set as the fwnode / ACPI-companion of the auxbus device created for that function. Having the correct fwnode is important because other parts of the DSDT reference this fwnode to specify GPIO / I2C / SPI resources and if the fwnode of the aux-device is not set correctly then the resources for other devices referencing it (typically a camera sensor) can not be found. As for why the driver for the auxbus devices / children do not use HID matching, AFAIK the auxbus has no support for using ACPI (or DT) matching for aux-devices and these drivers need to be auxiliary_driver's and bind to the auxbus device and not to a platform_device instantiated for the acpi_device since they need the auxbus device to access the USB device. Regards, Hans