Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2390543imn; Tue, 2 Aug 2022 00:31:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQsaBrW+BwsMCe2YpKbJEtwq9BRuRqzeLW6kwejZw1uyEMoKdE2GNPYI8gdXqOty+IgPFh X-Received: by 2002:a17:907:6e1d:b0:72f:20ad:e1b6 with SMTP id sd29-20020a1709076e1d00b0072f20ade1b6mr15653157ejc.545.1659425503668; Tue, 02 Aug 2022 00:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659425503; cv=none; d=google.com; s=arc-20160816; b=TCklYyqDYWXro/NPx2EWo+vHaXQGQNfDKZhWYjfSIqHHP7V9fE/180o7IeGOPYhiSH imxZlxKeX3nNLxNUaTXSJkIN9UvtPPtgkeU9RT0SUyczBYBW/cY9Fbp+ts864omComlk 75HUgKg881qmX4fEZdAjmkHl3abj1mbvX9IDETIF1gLucqGjna1PeN1y7XYNJWKsRxKq vD4fexfIVc6kuJnMNCdyF1hB88k+65L2hI74ICRn63CAFoBtoosfSVxWaN2sTG4JhOBw KWLgbYKcmbYBjxz6qqMXMlneurCF+vhbKDkk4f9o4M//WjszrFJTNL1Ons+ppoDoitaz 7p1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6E0Z0H+//2JUmjSmLfQw9bzx6bZ4jhyBRoS6s5ngqnA=; b=e0rDAVjnjUjGNc4jDluTridvNiF6AiIlQF4hEA6G+xQ3lvpDxwXw5B4CBYFD7m6QKY aQ7w098Pf9tcslgKsJ75yhHL1rLYKjvteOcr0oTX9Fb29jVqztqQKrPcuAW/8ag8x1YQ 63W7raQGVsrrdc4Ub6kdXH2LWmvUeXqwqrwOL8OkWcbtsLvLVx5E/y94En9bX5LqJVQA 1fFxbiGo4uQn933orYoNpBjT2P6dhS1RWuhOu2OchQmP1vqeTkbCLFgxypQAz09n05Vw kf0dnhaq12n0s1fDe6Q3yMfbHGMQxKcoDRGKEuDtGnAP2pzR+L7m1TJUDee3GZBN/ZrA fkOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y7Q4YQdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p34-20020a056402502200b0043d85ca3de4si6289733eda.435.2022.08.02.00.31.18; Tue, 02 Aug 2022 00:31:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y7Q4YQdv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235811AbiHBHSz (ORCPT + 99 others); Tue, 2 Aug 2022 03:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233231AbiHBHSy (ORCPT ); Tue, 2 Aug 2022 03:18:54 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9672FD13A; Tue, 2 Aug 2022 00:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659424733; x=1690960733; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=RvwmFxwP70eYQJZ3Lq3ZhuetbGK49H2H5zbw48rU8xs=; b=Y7Q4YQdvYVQIsH26gPsT6zMDwNBRGv0rsa5OhXUOUqzL1BoUwFIIWQcN FDFceFKr2gbE3EMC12YAagdZ66xeYtyh53jZpjMqG+FdgW87e7bl2QT2A QIY1pDyPipC6KqYWPjMZY3lUfEBRw5xCeo5JuueRtfCxjV/fpyaFhGrDh hmNA5sS8Lip0sHHaui8ZxWDEtp1mp7gMc7Y9m1zH0HNkJnjBmndAKeeqp j6vdHeVqR++mEFjv/YzPHeRIwAg8OuYCAAiCPyYZTdJFNlBTf7j7b79XC Hs3hq4v8dcyXJ4zoQ/p6BrRjBEZ+1NXUIUZ5xaPX2YlvD5rWeDCauwLhg w==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="353346621" X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="353346621" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 00:18:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="744571129" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 02 Aug 2022 00:18:47 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 02 Aug 2022 10:18:46 +0300 Date: Tue, 2 Aug 2022 10:18:46 +0300 From: Heikki Krogerus To: =?iso-8859-1?Q?N=EDcolas_F=2E_R=2E_A=2E?= Prado Cc: kernel@collabora.com, AngeloGioacchino Del Regno , Greg Kroah-Hartman , Prashant Malani , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: typec: retimer: Add missing id check in match callback Message-ID: References: <20220725203129.1973260-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220725203129.1973260-1-nfraprado@collabora.com> X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 On Mon, Jul 25, 2022 at 04:31:29PM -0400, N?colas F. R. A. Prado wrote: > The fwnode_connection_find_match() function handles two cases: named > references and graph endpoints. In the second case, the match function > passed in is called with the id to check for the match. However, the > match function for the recently added type-c retimer class assumes the > connection has already been matched (which is only true for the first > case). > > The result is that with that change, all type-c nodes with graph > endpoints defer probe indefinitely, independently of having a retimer > connection or not. > > Add the missing check, like is done by the type-c mux and usb role > switch code, to fix the issue. > > Fixes: ddaf8d96f93b ("usb: typec: Add support for retimers") > Signed-off-by: N?colas F. R. A. Prado Acked-by: Heikki Krogerus > --- > > drivers/usb/typec/retimer.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/retimer.c b/drivers/usb/typec/retimer.c > index 051eaa7d2899..2003731f1bee 100644 > --- a/drivers/usb/typec/retimer.c > +++ b/drivers/usb/typec/retimer.c > @@ -36,8 +36,13 @@ static int retimer_fwnode_match(struct device *dev, const void *fwnode) > > static void *typec_retimer_match(struct fwnode_handle *fwnode, const char *id, void *data) > { > - struct device *dev = class_find_device(&retimer_class, NULL, fwnode, > - retimer_fwnode_match); > + struct device *dev; > + > + if (id && !fwnode_property_present(fwnode, id)) > + return NULL; > + > + dev = class_find_device(&retimer_class, NULL, fwnode, > + retimer_fwnode_match); > > return dev ? to_typec_retimer(dev) : ERR_PTR(-EPROBE_DEFER); > } thanks, -- heikki