Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5690121pxb; Wed, 26 Jan 2022 18:57:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyS/aBNOUGMNLok/L+IANtEJxgusSEUjZCYcuYC5XpL6igv920F36bC8lvbgXBqtLZyuble X-Received: by 2002:a05:6402:718:: with SMTP id w24mr1791923edx.35.1643252260782; Wed, 26 Jan 2022 18:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643252260; cv=none; d=google.com; s=arc-20160816; b=ov9eIK5G/1PVpy6LGDSLmQaeUiyWSJRU45Pk13NUZjzZ1W/At8cEOHUvt1Zx39UjPg 1RBsW1+YeNRQ8dKcackukYAFonwbW0nTQlUVsXtSjX61PZhgtsHAh/gwxO/py6OX2EO2 0fBXV2K042RofblXQwy0kexXVQLg+Fj/QO/U44OvlQWJNecnlhDcYlP1G9I0Gbh///KN kwT6Xb10d9PDBGCC0bBFGDeGbCv1KaNPB/DNqZq5IOzmhCVcdteuH8sxSsVe6ISHL5We OQ2wFgpzHYxdSdeswdYLkZ2Lzj5wuO+xkJW/4aHycCApjAwr0OfiC7KGjg4An6go+sVr fZsw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=Dq0lGCTgUY2foRXLONiN7fj2MSnnKOwhTtj7tXYQbuY=; b=bwe3v/WgRwUBioZV9AM5/kTIybvalBd+HI9p1u7H+xYxlMkWGTuxOxXICTPJGtz8O5 O6PFsZlNA71rKLKIWOVH0lolAihnn9vkXa3boDlyTLqbLnpNxRDTdQ+NG+hz2V8rRNGS 5707LE3EnmNeS31FuEtgT8WnkjFqrPZBn3ZCSfq8+SKYsLQvekPsDqJe1F0x29zygasa PnICuLKvOiMHjGc8s8xkHUaPpjnIoSgwlWgrFW3VaTNcDzLcmT1EhT4INvV9Y283sKUJ MKd6EBfbDrvYpzBQgOU2ySM3Ozo74elH/+PtkuZSewih3KD+NWCLSE4WL+omppM18YEv EILQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alyssa.is header.s=fm2 header.b="sPJwG+/l"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HdaQuQLk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si569352edj.391.2022.01.26.18.57.16; Wed, 26 Jan 2022 18:57:40 -0800 (PST) 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=@alyssa.is header.s=fm2 header.b="sPJwG+/l"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=HdaQuQLk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231156AbiAZXEP (ORCPT + 99 others); Wed, 26 Jan 2022 18:04:15 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:36831 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbiAZXEO (ORCPT ); Wed, 26 Jan 2022 18:04:14 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C823A5C019A; Wed, 26 Jan 2022 18:04:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 26 Jan 2022 18:04:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; bh=Dq0lGCTgUY2foRXLONiN7fj2MSnnKOwhTtj7tX YQbuY=; b=sPJwG+/l4BN6FTBVtxVfYxsPju2Ns/HwtT0yiiSHvlFUm06XlY6q9k sxXL2Pz/engdK/L2+l+7qluMsH7nuaVE8+g3PoEym3kDYYpULYMMn/TZTtNpxXOB ce62W5g03F2WsQ/Cu38BkEVeCm0+8T3jk194ZEenSOPnBdsfSzz37BDuywk6RrAh BeFD3syR4Nl7sQ+aVMMPiI/+MrKbWfP2unGleh9MNHzhY0z8AivQQFQBUwtrKt7u 71KCPOiJ0NKDvkP9Wjwc45/ZixlflosxDGIulikRYer14cPHZDFXw0n38ugRjISK b5vaDxwj4OLQZBYPgpWpHFzUbMetDSEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Dq0lGCTgUY2foRXLO NiN7fj2MSnnKOwhTtj7tXYQbuY=; b=HdaQuQLkKRApqU/ZV/XVdOEqLFPXzcsyg 1g7xuP9KdOFjv1+msp+1Dblf5zQSpeySU7HOp/S+DXp0GvmtIt7ctU9wh/t5IkS0 6Is5WOJ7QI8XA4lEJre5nmYCr3cxhTQze/uV8ann/G+VFuPvk21U9BPeDmxcpRIy 9ZMGcEqYrXD8K5Y/cmzqSR1hm7fqyFOXMtn93wpDtgoR6KfiLzPEUSGM0hRyB/rN FDKG6S50Hbb2vMRMquJdA7vzsq8ju3f4cg1oTpn4n7Tl1Rxdf/C+9LK+Q5Bvibw4 p9hJsiVrEyTJC8diEyhVy6Rngwte+eMMEp2z2xSk/ZfGpQ9XfSYkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrfedvgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheptehlhihsshgr ucftohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepteejhe ekjeevhfehveeuieejfeejtefgvefhudetudeludevjeejgeefieekhfehnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepqhihlhhishhssegvvh gvrdhqhihlihhsshdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Jan 2022 18:04:12 -0500 (EST) Received: by eve.qyliss.net (Postfix, from userid 1000) id 359808116; Wed, 26 Jan 2022 23:04:11 +0000 (UTC) Date: Wed, 26 Jan 2022 23:04:11 +0000 From: Alyssa Ross To: Prashant Malani Cc: linux-kernel@vger.kernel.org, Tzung-Bi Shih , Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Heikki Krogerus Subject: Re: [PATCH v2] platform/chrome: cros_ec_typec: Check for EC device Message-ID: <20220126230411.nn2illij4wbpdm4q@eve> References: <20220126190219.3095419-1-pmalani@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ydvev7hvnx7cp4p2" Content-Disposition: inline In-Reply-To: <20220126190219.3095419-1-pmalani@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ydvev7hvnx7cp4p2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 26, 2022 at 07:02:20PM +0000, Prashant Malani wrote: > The Type C ACPI device on older Chromebooks is not generated correctly > (since their EC firmware doesn't support the new commands required). In > such cases, the crafted ACPI device doesn't have an EC parent, and it is > therefore not useful (it shouldn't be generated in the first place since > the EC firmware doesn't support any of the Type C commands). > > To handle devices which use these older firmware revisions, check for > the parent EC device handle, and fail the probe if it's not found. > > Fixes: fdc6b21e2444 ("platform/chrome: Add Type C connector class driver") > Reported-by: Alyssa Ross > Reviewed-by: Tzung-Bi Shih > Signed-off-by: Prashant Malani > --- > Hi Alyssa, could you kindly test this with your existing setup? Thanks! Hi Prashant, I'm happy to test, but I'm on vacation until the end of the week so probably won't get a chance before Monday. I'm guessing I should be testing with latest upstream coreboot (now that your fix there has been applied)? > Changes in v2: > - Added newlines as suggested by reviewers. > - Added Reviewed-by tag from Tzung-Bi. > > drivers/platform/chrome/cros_ec_typec.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > index 5de0bfb0bc4d..952c1756f59e 100644 > --- a/drivers/platform/chrome/cros_ec_typec.c > +++ b/drivers/platform/chrome/cros_ec_typec.c > @@ -1075,7 +1075,13 @@ static int cros_typec_probe(struct platform_device *pdev) > return -ENOMEM; > > typec->dev = dev; > + > typec->ec = dev_get_drvdata(pdev->dev.parent); > + if (!typec->ec) { > + dev_err(dev, "couldn't find parent EC device\n"); > + return -ENODEV; > + } > + > platform_set_drvdata(pdev, typec); > > ret = cros_typec_get_cmd_version(typec); > -- > 2.35.0.rc0.227.g00780c9af4-goog > --ydvev7hvnx7cp4p2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmHx02kACgkQ+dvtSFmy ccDSeA//dgOrQ7iuPijev7cFEVYZlPvXEcMtI1kWwZzcx1zCsGi6FS63Gqg9uJVR Q9zet2csAlgeXmgUA0NTY2WwjhRiXYraRil5TXiV0hop1lvRifGsJjISBanIPIO2 XTibAtqKniaB9Bgar0n/D4r9Bn7yHEQTIIwpuYnwr5MgYzX7DrZDi3zkTj5fGj/6 cqEoeKBhc0/StN/bskEQhmHFBgK0IL/RY6STrvlM6hdyu3rVXYwhy63bHARLj/EH NGUXPiWH/YFj9U73PuS6XLu2rrr+rRBLuV2XWowWzP/Wpso2Ch1bBv7TMbvVbGVD 6kBalhbfmGryHUbNTrJEUe7gn7t4ZkF3Ni/+69JaLndjx8yhfJNKWihqET99CuJG 17tyRQ0bE4Rw7fGDTkRJMB19skZsDnpt2BVrrQ0mvSsGsyLcBlUMy2X7xt2Ewef/ hcV3CuCqcqFShfW4gnQpNtnqFzZ8S/IbSXjXMtXpCBB3o2HjBAIPAuruwUKJnvgk ijv1OX0CBex6g1MkyQKKAvFSLD1QcBVzqSPw/WapqtzLog58ZmDbGNbQIlU6ydmu g+3o+KQlYvRSHh0Ivbx/ARSUfw7W2Z7QOkT1gD9y9zVXWWzxy37jnUG9bHjZyNvg HQ2cCj4/G1wRaPIwyi4fgNsWsVneS3j9yNmUqmtG68I56JOFm2c= =cqF1 -----END PGP SIGNATURE----- --ydvev7hvnx7cp4p2--