Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp266982imp; Thu, 21 Feb 2019 00:46:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IYOIFzL4cI6VnBoxQKyJdH7R+6YvzFVDmDJjertM4wwaYkvebNnEliTuTRYQbHtT/OyBhnB X-Received: by 2002:a17:902:34a:: with SMTP id 68mr42012313pld.268.1550738775944; Thu, 21 Feb 2019 00:46:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550738775; cv=none; d=google.com; s=arc-20160816; b=Dgx8FLxPnXjm0SzG6XZ6JGI0jM0FrnmRxF8nA3fssBs/b/6GasRNNo8CTpMN+VsLlE relJ7pW1/3M2weiB33P5yEcDIB39cnTYyVp78Njr0/FlY9/wAXKEGyfHID5qy2oAYoZb xQXMSehRA0hkwSx565Ukgh2bEHhR605DuQ0q3JA4t82oYykz65VC8HSB/yIjlPmzUTfx JbwiRQ+rWxdsAKe5xDDi/arCxUxMwc4TTVesCpuHAelPTFF83yPAPO3mbjFv8RJT2khC 66KGPlc9c3wdmptSLXTCI/jR16GDhz/i3V7pxqHctM1525m7nb0BaO8SAveQwrl+pq3S rlPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id; bh=hGR7cZH1zF8GT3sB+U/65WXr7Y+VLK/i0yvGLV0b2RE=; b=St9tel0FEYhFqJx0V5gAjk39ir+BdvLMnJrA5FC8SIc84kLYxUUoSRYA7uGuqBDwzg c7xPy8bbrKQDHkBOczg8JqhAvtWhvGiNMGEAtVmw3sz8RA+gNoxB0a4hWMwIX1iwnFPM D8LOeYyv/ao+6biv8uWoPm57GkFjH3mHFtqPP8OrkjF/vU33cz+H9F1cvESg8gWHGSAO bhhOjRlQKxjYpVezew1Hc3xjobbezwJCngghl+2yLQfxMxBCal1VxDnycf7oHcbpVFCI SiL6O8vpLKbbdA3da7RiRG9eAWf7BMHo/iuld4kEoxzBKDgg7ZakM886xUJUilpkAKLf I7ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si19266815pgp.491.2019.02.21.00.46.00; Thu, 21 Feb 2019 00:46:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727095AbfBUIoT (ORCPT + 99 others); Thu, 21 Feb 2019 03:44:19 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:45699 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfBUIoT (ORCPT ); Thu, 21 Feb 2019 03:44:19 -0500 X-Originating-IP: 90.88.23.190 Received: from aptenodytes (aaubervilliers-681-1-81-190.w90-88.abo.wanadoo.fr [90.88.23.190]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id EDABE4001E; Thu, 21 Feb 2019 08:44:16 +0000 (UTC) Message-ID: <8fa473aee266f6fdd90c6b90661977982488cb77.camel@bootlin.com> Subject: Re: [PATCH v3] usb: chipidea: Grab the (legacy) USB PHY by phandle first From: Paul Kocialkowski To: Peter Chen , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: Greg Kroah-Hartman , Thomas Petazzoni Date: Thu, 21 Feb 2019 09:44:16 +0100 In-Reply-To: References: <20190215162225.19284-1-paul.kocialkowski@bootlin.com> <3ed330798d31d01fdfbd40571d016a108c9c5040.camel@bootlin.com> Organization: Bootlin Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-02-21 at 08:37 +0000, Peter Chen wrote: > > > > If there is a generic PHY node under USB controller, and there is a > > > USB PHY at other sides, both ci->phy and ci->usb_phy are valid, I > > > original thought it is the problem you met. > > > > Right, this is not the problem we are having. The problem is that legacy USB PHYs > > are not grabbed from device-tree. Instead, they are currently matched with their > > type in the list of registered USB PHYs, making it impossible to use 2 distinct USB > > PHYs this way. > > > > > Since you are trying to fix the legacy USB PHY grab issue, I hope you > > > could consider the generic PHY as well. > > > > What do you have in mind about generic PHYs? Everything already works as > > expected with them. > > > > Current code w/o your patch, it is possible both ci->phy and ci->usb_phy are valid > if the USB PHY is not at the device tree, but generic PHY is at the device tree. > If you don't want to fix this issue with this patch, it is ok too. We could fix it later. I'm not sure I understand the issue. With my patch, if there is a generic PHY described in device-tree, then devm_usb_get_phy_by_phandle for legacy PHY will fail and the code will fallback to devm_usb_get_phy, which is the same behavior as before. Is it a problem that we can end up with both a generic and legacy PHY? I thought this was expected behavior at probe, and the rest of the code will just use the generic one in priority. Do you want to make it so that only one (generic or legacy) PHY remains after probe? Cheers, Paul -- Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com