Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2510063pxj; Mon, 31 May 2021 04:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb2h0H5xPqV2cabxbD17Y8abHo1xGS8AAprhEIuNGzM07VEbfocx7alR99yfneUR1E+hnL X-Received: by 2002:a02:cc8d:: with SMTP id s13mr19989968jap.17.1622459376931; Mon, 31 May 2021 04:09:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622459376; cv=pass; d=google.com; s=arc-20160816; b=0EoxCTd8r/sSatSKTD7k1iDmimfafhB1KGwyVhZ6JI+CEM2wntwTzabd1fHwseSXYD Sq9kmP39zidqqZrOsAOk4HK6podPkQtTOVKCs+UOx2Z3yPTLoNlepBWPzMS/hMGxrlkO INzbSJ/U9Rg9LAoQTcIoCEccGwlupk71LA7wziC9/phwYmboKr3llwWzOrBL5cxxYIto iXqHnaAdhYE20ouzbU/HbuHzqqaw9qNeBSaMK7I/o2FvUbAbom9q73aQilb3R0MQ76z1 cs/DMLQvE5gNTSVOjbwHKUo1isifZ+BCHmVjlKmD2nHQjLEhM0HugOXTi0M+5Ri0YAOS xqLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=KY1DjwMaUhneCE1Kj3cqttjXDfIa3KaTSRUS65XTHtQ=; b=zztTT8ZmX5AxaveyDoDXqojww6KSYn6bUNmrpD2oG5o19oKjjXSEspa06zBlsUOgiy 5IFEdKCBuhkVnR/GPuBSCGHuBMxpwGfTGsmG+3n9Z4n4EtvHABnppZD4e2LXrnlk5jHL 9OhkigfOVH/TVr1sbcn9+uGjKvZqbysKbNTNppqoaTkUQx9cO62njur8/NqEvamdwthy YsVy1kEHwtYAaJs1kpbJiw4xEUAMA7qHh94GdqFqT7npXTxMrS4xnXLAO0OLTChPoNMo jIOWw4YUFnjYjmEc27oaGPEM6lLi2avJb842Bw0GhBpEte0RDB7/1tGLnBeBMuDiD0PP n3CA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=HDeNAfdL; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a23si13560666jap.18.2021.05.31.04.09.24; Mon, 31 May 2021 04:09:36 -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=@nxp.com header.s=selector2 header.b=HDeNAfdL; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbhEaLJ5 (ORCPT + 99 others); Mon, 31 May 2021 07:09:57 -0400 Received: from mail-eopbgr30076.outbound.protection.outlook.com ([40.107.3.76]:3142 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230518AbhEaLJ4 (ORCPT ); Mon, 31 May 2021 07:09:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QiNQXhfDJtGGyddfu7XM7gCRIk9HkJA4dWNVu+eseCK6MMZ4MxyJZvZ1ee/R8DaE9bQvD2wU/EqedzmmGdD9eQqnVAp3fgtUSAl9Zo+w3FYSyEwGzakTs7mvQZS0QyAoEJ3wm29xMMEZ97VGG137rj72sWfyr3U5VE2lZbIBr/mW2aHky4xR+Wh05Pz6P0JetJNmoDkYtYH+yPyaZ8CRClPUwe/32OEfHJwuauCoxzQbP1cH1OyT/eHXI7wMht5I11sCLaWJEhUsFOlKcMrk2ruwBbmPWj15h0O+FnjUwgy9gmKIXgCOH5fq2naySxFdhMp5DOVVK2E0H2vtQXVJmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KY1DjwMaUhneCE1Kj3cqttjXDfIa3KaTSRUS65XTHtQ=; b=RVFjRnxQa0jWJgzEV8fz/yyVsmmsyN4i3Uj5fQFIMelTBqsV8bCtIvUijMr99MMfMHTxFuBWz/SouCwEBLPkcaJf70use31qzGC8Z5PKZUNt/6vYbSpev8KcDAc3Hy1HVhIsUaWPKn/55N3ggf8ZCqq5bQH36LSEQu5rSEAaZPTtu1bhdwn/74uYcSv3/Ev8zfL4jxxGux40CbRv4FpADAnOQ/IBUyJyy71WhCWlYpXISaYUXzG4snJbtTQ+nBhy7kS3wmUgcbHePz71lMLGac25lPlE57navugUuiPbzLykk3x2nKm4V0/4ikNV9KWb4xxXumtTDg+MSL/KvkC7fA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KY1DjwMaUhneCE1Kj3cqttjXDfIa3KaTSRUS65XTHtQ=; b=HDeNAfdLO58aRTSio3ra6DXp/83iOmi3QgfFsdk9qOBX1cUuKEgnI6m6v278v/gcUkvsGew8MuU5JhAMDbx5cKl6TL3i8P9RigryuTQyAjz6Ye3orP2JE2RGFpcaGhhVab5Ovzs2uYSax5JBe62vVWuB3uyoyLwwHWlgvU7+7w4= Received: from VI1PR04MB5935.eurprd04.prod.outlook.com (2603:10a6:803:e9::17) by VI1PR0401MB2559.eurprd04.prod.outlook.com (2603:10a6:800:57::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21; Mon, 31 May 2021 11:08:14 +0000 Received: from VI1PR04MB5935.eurprd04.prod.outlook.com ([fe80::453c:f24d:af8e:f194]) by VI1PR04MB5935.eurprd04.prod.outlook.com ([fe80::453c:f24d:af8e:f194%7]) with mapi id 15.20.4173.030; Mon, 31 May 2021 11:08:14 +0000 From: Jun Li To: Heikki Krogerus , Greg Kroah-Hartman CC: Hans de Goede , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 2/2] usb: typec: mux: Remove requirement for the "orientation-switch" device property Thread-Topic: [PATCH 2/2] usb: typec: mux: Remove requirement for the "orientation-switch" device property Thread-Index: AQHXUkTF1Hli5+/RLUyh4hA8exUVWqr4dZKQgATB44CAAAkYAIAACCYAgAArbUA= Date: Mon, 31 May 2021 11:08:14 +0000 Message-ID: References: <20210526153548.61276-1-heikki.krogerus@linux.intel.com> <20210526153548.61276-3-heikki.krogerus@linux.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linux.intel.com; dkim=none (message not signed) header.d=none;linux.intel.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c595cc4a-2216-443d-5996-08d9242462d6 x-ms-traffictypediagnostic: VI1PR0401MB2559: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: R4gv3e2IoiMswJG8tdKej7q1k12kWHtF5kvmCTz/FImM+EiXPBrdA9S2U6GBBPjgPKryyRMmjjSxqJ505GwpGS9tF3GSFZfjeufgG+h6n4+xjVURx7CjvpMhlZJwVA/X89jJV1wa7bgHzzD69yJh6nDbsLpEtDsFV74hP7q5nfu7Q7lzD78N4p+XpFrDI/z8vzP57uaVHh+Ybg4Vakaaqbv2Xq1uXv077NC/rZjiBZ9kEy856h57SJmeI3t9q73nwVzdbNqRtOK7J22ygPIR0NqspXKObARTwvzpJWqHw5TSEI7y/4+m5Bp6Yg9xE//Wk3qrCrduEu2cn03p6WCOafqYRvLqxVs4whxOHTgkyk72FERykH8KEWmmoyDie9ZjVmHJpoIvwmXLP07g1LlPo6bP2GQpdgpPm5yvC4ygDiS2bcV+OjdTSOXKYqP4n3LNWzFscaT34oMkxf74/jy/c7RFeVaR8gjZ0eCfhYn8MFRmnNKrhWcAsFXjUXiad16yfeur/H8Nh96cgup/jyAaWohostZRX2qNwVPaseWMDKBYJjUH6PqmhcUP1qK9mUm7EDwpcXkqIppvDlwi9Wmi8sZivoBjmFeCEAHVfl87o/4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5935.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(39850400004)(136003)(346002)(366004)(9686003)(66946007)(71200400001)(7696005)(5660300002)(316002)(122000001)(66556008)(110136005)(64756008)(33656002)(76116006)(44832011)(66446008)(66476007)(86362001)(26005)(4326008)(52536014)(83380400001)(478600001)(38100700002)(2906002)(8936002)(55016002)(54906003)(186003)(8676002)(6506007)(53546011);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?XORuZ7tgCF0a+2iFoxjEd9+QTNDau+CqP9MYFmFWBTX2s/Bs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m43PTicnB/IT9/tl7hDFSYbi9Jkm2jfPnAVNblS/eiz7jqh9e9VnLZX7vb?= =?us-ascii?Q?pdMkpGVR1qtsATsnTeYFzbPUtv+/hyOSFnNtDkOnc2HLmPfnf0MAQo8aHRA+?= =?us-ascii?Q?b55ngZ/JM2JrHxRtpEDizAss3uFBJR9KtT9dHLMxqMvCegBzxWcX8xrCrovJ?= =?us-ascii?Q?1nV9HGXpx92vJJc9/SJ862mT/e0mKaJFOQ1MbVdnh+oTC4BgsoR4MngrQei1?= =?us-ascii?Q?KS4V7McAEf5+bVohquJPQu0Xdn4HYr5TFoPbTV41ceO/FvgHDC4bzQ4IOLCH?= =?us-ascii?Q?9XBn3l0XQ6IKrAUqZVxbd9QSZKN2+0yYWaoWCfITWOnHAbS9KFz4el9J/7jq?= =?us-ascii?Q?MpOT+jZihKbmH1csenYszSySpHefiU7X1JFkyADXvAUSILiMj2h597SLZARf?= =?us-ascii?Q?71ZqLNtdEmQG9VDvIqDl0crP?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5935.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c595cc4a-2216-443d-5996-08d9242462d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2021 11:08:14.4323 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: G949ueXocSYBjcIdEPEjiZA6QRAhu/WgRZz38oO5+DB60COGS2JqCkAnGRRh3pW1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2559 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi > -----Original Message----- > From: Heikki Krogerus > Sent: Monday, May 31, 2021 4:26 PM > To: Jun Li ; Greg Kroah-Hartman > > Cc: Hans de Goede ; linux-usb@vger.kernel.org; > linux-kernel@vger.kernel.org > Subject: Re: [PATCH 2/2] usb: typec: mux: Remove requirement for the > "orientation-switch" device property >=20 > On Mon, May 31, 2021 at 10:57:04AM +0300, Heikki Krogerus wrote: > > On Mon, May 31, 2021 at 10:24:35AM +0300, Heikki Krogerus wrote: > > > On Fri, May 28, 2021 at 07:26:43AM +0000, Jun Li wrote: > > > > Hi, > > > > > -----Original Message----- > > > > > From: Heikki Krogerus > > > > > Sent: Wednesday, May 26, 2021 11:36 PM > > > > > To: Greg Kroah-Hartman ; Hans de > > > > > Goede ; Jun Li > > > > > Cc: linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org > > > > > Subject: [PATCH 2/2] usb: typec: mux: Remove requirement for the > > > > > "orientation-switch" device property > > > > > > > > > > The additional boolean device property "orientation-switch" > > > > > is not needed when the connection is described with device > > > > > graph, so removing the check and the requirement for it. > > > > > > > > > > Signed-off-by: Heikki Krogerus > > > > > --- > > > > > drivers/usb/typec/mux.c | 3 --- > > > > > 1 file changed, 3 deletions(-) > > > > > > > > > > diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c > > > > > index e40a555724fb6..603f3e698cc0b 100644 > > > > > --- a/drivers/usb/typec/mux.c > > > > > +++ b/drivers/usb/typec/mux.c > > > > > @@ -30,9 +30,6 @@ static void *typec_switch_match(struct > > > > > fwnode_handle *fwnode, const char *id, { > > > > > struct device *dev; > > > > > > > > > > - if (id && !fwnode_property_present(fwnode, id)) > > > > > - return NULL; > > > > > - > > > > > > > > May this change the result of fwnode_connection_find_match() if > > > > there are multiple remote-endpoint node? > > > > > > > > After the 2 patches change, typec_switch_match() will never return > > > > NULL, so > > > > > > > > 17 static void * > > > > 18 fwnode_graph_devcon_match(struct fwnode_handle *fwnode, const > char *con_id, > > > > 19 void *data, devcon_match_fn_t match) > > > > 20 { > > > > 21 struct fwnode_handle *node; > > > > 22 struct fwnode_handle *ep; > > > > 23 void *ret; > > > > 24 > > > > 25 fwnode_graph_for_each_endpoint(fwnode, ep) { > > > > 26 node =3D fwnode_graph_get_remote_port_parent(e= p); > > > > 27 if (!fwnode_device_is_available(node)) > > > > 28 continue; > > > > 29 > > > > 30 ret =3D match(node, con_id, data);// ret can't= be > NULL; > > > > 31 fwnode_handle_put(node); > > > > 32 if (ret) { > > > > /* > > > > * So loop will go to here and stop > > > > * checking next ep, even this ep > > > > * actually is not for typec_switch > > > > */ > > > > 33 fwnode_handle_put(ep); > > > > 34 return ret; > > > > 35 } > > > > 36 } > > > > 37 return NULL; > > > > 38 } > > > > > > > > fwnode_graph_devcon_match() Will return ERR_PTR(-EPROBE_DEFER) > > > > even this ep's remote parent already probed but it's not for > > > > typec_switch. > > > > > > You are correct. With device graph I guess we really always need the > > > extra device property after all. > > > > > > So let's forget about this one. > > > > Oh no. This patch just landed into Greg's usb-next. I'll prepare the > > revert. I'm sorry about this. >=20 > Actually, if we always need that extra (boolean) device property to ident= ify > the device class when OF graph is used,=20 Looks like yes, as we need a way to know if the current fwnode is for the target device we are looking for, to return probe defer correctly. > shouldn't we just do that always > in fwnode_graph_devcon_match()? This depends on if we want to limit this to be a boolean property (to mark this is the target fwnode), or make it to be more generic so user can define it in its ->match(). Now there are only 2 users of it, role switch and typec mux, both work as a boolean property for con_id. Li Jun >=20 > diff --git a/drivers/base/property.c b/drivers/base/property.c index > 1421e9548857b..238da64375bb1 100644 > --- a/drivers/base/property.c > +++ b/drivers/base/property.c > @@ -1263,6 +1263,13 @@ fwnode_graph_devcon_match(struct fwnode_handle > *fwnode, const char *con_id, > if (!fwnode_device_is_available(node)) > continue; >=20 > + /* > + * With device graph @con_id is expected to be the name o= f > the > + * "device class" of the fwnode. > + */ > + if (con_id && !fwnode_property_present(node, con_id)) > + continue; > + > ret =3D match(node, con_id, data); > fwnode_handle_put(node); > if (ret) { >=20 > thanks, >=20 > -- > heikki