Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp17183pxv; Wed, 21 Jul 2021 14:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMYsvYx19D2VvEFdq6DzVQQpCzs88hhli+F+4Z8gSzExXbkEHgyOux1Xt/QlkCiLN6BhYI X-Received: by 2002:a17:906:33d0:: with SMTP id w16mr40111645eja.376.1626901461449; Wed, 21 Jul 2021 14:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626901461; cv=none; d=google.com; s=arc-20160816; b=WZmaVvQK4Gs+iS/EzpYRzfmI8m04FRqa54TvgZY88OxlWHz2wk/5Wb5dtj+JM8l5P8 IXWEbKqU0O3skDS2GqpeY0F4S5ahkIoZN5ZJesNQ78ZFqjC6pBnfz8BE5h6Pwsw6XWwa GBTLkhRtR39lGcZW0Qfxnq6lOxCyGQf8zr0u4am9Cm1+UiFRBM6MMcDqwvulmus1BHt7 3dUWMMbfJk7MTvsF1dHxiZ84XQav6RD/9FdmXc28xl70/52PRsbPE+7Bikb9GGzLXo7f Zpmy4h2WhEYHsLMc7gahbbAJ/2IPppEINrBwwdm4ypxSgP48q5d3EU+C7ikT+u2AUbEN VTzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gtIf04Z37gx9XqNiwrsxPZO7oSThLTlbi0RPsWdfaFM=; b=WzjQPJ0/1LedLX07u0KGM0C+sN11bn2+B9xZeQfNRCKk7feU9ZtW7SSBvUblhpWOaj bYHds6bvqXrbatZH1oreUMUT609v/NovbBvIy0jkih4mVJZkE6FMxPpXCwDJ+xMETV7w J5Jp5keMqau0+3q3c8zcgvq030s8Ail6eSr7fRVzFa+ANYNjx99SyTAA12OWZLGiAM/K npR1eNRzQbDzyl7tS0isVEASG1cvAqMMmyJz2yQ9nozknmCJ+ciHVBnJ4SBhRwQOjjkg KleMRwFkefDvZjxRJpG41eYnFwqMy3Zta05hZx3rLvpFttxhPSK6f3XyImIPOY/DP9ud 8YGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UGfV3dnR; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si28490075ejb.86.2021.07.21.14.03.58; Wed, 21 Jul 2021 14:04:21 -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=@linaro.org header.s=google header.b=UGfV3dnR; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237948AbhGUR1u (ORCPT + 99 others); Wed, 21 Jul 2021 13:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbhGUR1p (ORCPT ); Wed, 21 Jul 2021 13:27:45 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AB7BC0613C1 for ; Wed, 21 Jul 2021 11:08:21 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id h4so4111420ljo.6 for ; Wed, 21 Jul 2021 11:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gtIf04Z37gx9XqNiwrsxPZO7oSThLTlbi0RPsWdfaFM=; b=UGfV3dnRrxXZDPaaemsemZl5AWjKR+fUL80TbIDXhqu2qF770NP1zJ4FWA7smAOsBj +DTEb1bn7VR5OD7KSSObN2is3t9s51LebBvBA+eV0QEDRC3TZZ8M8m6U9xGxVum9ljJ0 VKQq2uVXNUptfjfbw4frYhB44+zw9VvSmYkCPQGMZj9wTazF9LCaeBKzLdJzbAMgrRcc U+rxvhfNeaG/uUuf3s2bB2juZWWx0x7MCbEkOJyH8F118hqDbt9KovoLgVgQmfj+IWMm Ete3RO0RWdpj0xJ9uIZznY5JzOl7+iZwcoqmKIQ+mwrfoBjKRKt/qN9eaC9PHxWIzGDi fVxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gtIf04Z37gx9XqNiwrsxPZO7oSThLTlbi0RPsWdfaFM=; b=pCgMkCIZMM188WZ7M3PxlgIFqlZsUlauGbim9o9hA+TPcfwM4QpPVmi2WX+jnnkHcV Vl+E2ZouSqeC9kOFeLRUNdK4z2Ae7Gpw62s4ob501s7cgYntNW8iU2cwlZtKslup/jTe CPDOgHLKvcxUqwQ6YDNWfSZCPD7MFcQX5Oqs2f99CwwmVwM7uWuSA3OfSkrp2SxMlxyo DRigZAKmdI64VGGekMFGQLOCvq7Tfmcc/jctS7zCD1Wtpqy2sN7nEA3tmfor0rFYaLks lHvQodrBSOhm5xB/jAEmtRvlksCFvufkFzGi5NqZNIA03ixNpxGDD+mEOQCKlj0wZeeo NysA== X-Gm-Message-State: AOAM532zHwRuzFZPZsqM9ifEVc/bca8xuvNlns/hEHtl0Me9ubtMqkA9 6oMl0/0yyEAFmzLqk6XXd1eTQC6+Y740AY1J4Y//Bg== X-Received: by 2002:a2e:720f:: with SMTP id n15mr28248753ljc.333.1626890899442; Wed, 21 Jul 2021 11:08:19 -0700 (PDT) MIME-Version: 1.0 References: <20201020115959.2658-1-Sergey.Semin@baikalelectronics.ru> <20201020115959.2658-30-Sergey.Semin@baikalelectronics.ru> <20210714124807.o22mottsrg3tv6nt@mobilestation> <20210721100220.ddfxwugivsndsedv@mobilestation> <0064cb2c-5ca6-e693-2e89-8f045c8f7502@kernel.org> <20210721112531.xvu6ni5ksaehsrjh@mobilestation> In-Reply-To: <20210721112531.xvu6ni5ksaehsrjh@mobilestation> From: John Stultz Date: Wed, 21 Jul 2021 11:08:08 -0700 Message-ID: Subject: Re: [PATCH 29/29] arm64: dts: qcom: Harmonize DWC USB3 DT nodes name To: Serge Semin Cc: Krzysztof Kozlowski , Greg Kroah-Hartman , Serge Semin , Rob Herring , Felipe Balbi , Florian Fainelli , Andy Gross , Bjorn Andersson , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-arm-msm , Linux USB List , lkml , linux-arm-kernel , Amit Pundir Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 21, 2021 at 4:25 AM Serge Semin wrote: > On Wed, Jul 21, 2021 at 01:10:19PM +0200, Krzysztof Kozlowski wrote: > > It's not good example. The configfs entries (file names) are > > user-visible however the USB gadget exposes specific value for specific > > one device. It encodes device specific DT node name and HW address and > > gives it to user-space. It is valid only on this one HW, all other > > devices will have different values. > > > > User-space has hard-coded this value (DT node name and hardware > > address). This value was never part of configfs ABI, maybe except of its > > format "[a-z]+\.[0-9a-f]+". Format is not broken. Just the value changes > > for a specific device/hardware. > > > > It's like you depend that lsusb will always report: > > Bus 003 Device 008: ID 046d:c52b Logitech, Inc. Unifying Receiver > > and then probing order changed and this Logitech ends as Device 009. > > Then AOSP guys come, wait, we hard-coded that Logitech on our device > > will be always Device 008, not 009. Please revert it, we depend on > > specific value of Device number. It must be always 009... > > > > For the record - the change discussed here it's nothing like USB VID/PID. :) > > Right I was wrong referring to the configfs names in this context. > That must have mislead Greg. > > Getting back to the topic AFAICS from what John said in here > https://lore.kernel.org/lkml/CALAqxLWGujgR7p8Vb5S_RimRVYxwm5XF-c4NkKgMH-43wEBaWg@mail.gmail.com/ > > AOSP developers somehow hardcoded a USB-controller UDC name in the > internal property called "sys.usb.controller" with a value > "ff100000.dwc3". That value is generated by the kernel based on the > corresponding DT-node name. The property is then used to > pre-initialize the system like it's done here: > https://android.googlesource.com/platform/system/core/+/master/rootdir/init.usb.configfs.rc > > Since we changed the DT-node name in the recent kernel, we thus changed the > UDC controller name so AOSP init procedure now fails to bring up the Linux > USB-gadget using on the older UDC name. UDC is supposed to be ff100000.usb now > (after this patch has been merged in). > > What problems I see here: > 1) the AOSP developers shouldn't have hard-coded the value but read > from the /sys/class/udc/* directory and then decided which controller > to use. As it's described for instance here: > https://www.kernel.org/doc/Documentation/usb/gadget_configfs.txt The problem with this is there may be multiple USB controllers on a system (not all exposed outside the case - and also the dummy controller is often present). How can we configure the system to know which controller is which? The only name we have for distinguishing the controllers is the DTS node. So it seems inherent that changes to that name will break the config. That said, this issue reminded me of the /dev/hda -> /dev/sda device name or the eth0 -> enp3s0 switch which both also had the potential to break configurations or scripts. I get that having a standard naming scheme is important (I'm very sympathetic to this point)! I can imagine UI trying to show possible controllers for a user to select needs a simple way to determine if a device is a usb controller - but again this just shows that the node names are an ABI. So I'm not the one to judge if this change is useful enough to push through the pain, but it did seem to be done a bit casually. > 2) even if they hard-coded the value, then they should have used an > older dts file for their platform, since DTS is more > platform-specific, but not the kernel one. Even if a dts-file is > supplied in the kernel it isn't supposed to have the node names > unchanged from release to release. DTS changes are a constant source of regressions in my experience. We mostly just have to roll with it, but it feels never ending. :) I'd personally rather folks in general be more thoughtful about what DTS changes they make and accept, understanding that they do have impact on userland. And I'd imagine If updates to linux-firmware broke the most recent LTS kernel, that would be seen as a regression too, and folks wouldn't be told to just keep the old firmware. But all the same, I'd also be happy for suggestions to remove any such dependencies userland has on specific dts naming, where possible, to make the constant pain go away. :) thanks -john