Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp58038pja; Fri, 22 Nov 2019 03:25:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyfsm1DVmBgk78BeN9a9qAoPKeVb+HDT/MR9hKxwFG389bmxqeiGHHFfNF2pgnraWqcxqh5 X-Received: by 2002:a50:fa83:: with SMTP id w3mr413451edr.272.1574421916467; Fri, 22 Nov 2019 03:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421916; cv=none; d=google.com; s=arc-20160816; b=nFU9VDPYz/plLWTXgWnnWkk3nwJPuUGxKYIvLMq38FPdwhU85sfjXnmqRRx1C+tty9 p3LDj3Hi+6BbycQxS6b5wEH3yLT7nuXMIVKe8aYK/Bu1AarUj398QwbDoywMw5XBN2zr LSn8r7KUsUHf0ihm60ysY8KfEyCDhW5jnlriUbWo4jntJkwD/HOxhtM8RbVwtxdNJaRS lpJqRUHzjVQTuIuVl6Fud35+5ztzOzsXEg8T2IoudHK9+Ev/2YpKvpwGziIw/407nL1Z LN1+0J6wfmL3WhENXrnvzdiUjdpODD5mfua5iXE5mqWvoqQwOSUqA8s1/QWs4/2Iq5lo s8pw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xeRsX7uk9JInuVpTCDPgVQn8I9ef6lPqe1vjPRu+FZ4=; b=nkOl4JMs4jqrg8ETxTARGTjhRtn293csQWQPtqhGdYY61DqLUW5GaJPjGpVX9BGuYE wZCsP9U/QUb5a05PtR61VQZs0kzUBwRuDPKETtCQmBbDmQuGiYae+URmu7CJu4400aM1 76Jh53Xk0xTz0hGyVzf1GreWhxyzSX7WMv/Xk4NlJz7gJ8k/vlhnIFtnkxm3nrQ4NTdG AE49a1ST06wFBMAwHlfxYetEV3D66uODY+15iNoZ+FibZ8/22nfZn3bhz1/bGKgKl1wD laOKN/NVLIhu6PozstzxktjWAzmi2OzY/QqxfQaT00/Jhw34DHxSdz/QnjvC9zOZuMcW b+IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dXniKX0o; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si4566385eds.64.2019.11.22.03.24.51; Fri, 22 Nov 2019 03:25:16 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=dXniKX0o; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729003AbfKVLWb (ORCPT + 99 others); Fri, 22 Nov 2019 06:22:31 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:35104 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728796AbfKVKnG (ORCPT ); Fri, 22 Nov 2019 05:43:06 -0500 Received: by mail-yb1-f194.google.com with SMTP id h23so2554155ybg.2 for ; Fri, 22 Nov 2019 02:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=xeRsX7uk9JInuVpTCDPgVQn8I9ef6lPqe1vjPRu+FZ4=; b=dXniKX0oSrn32S3I6viPYhCnrkW5RC8QBhQ+HnveJ64PajVPXNOf6lWs8ikK324gHX W5zx9Tu2PGSqkOTKyD9lBTdsqXTEYDL2EDfYXLSdCRtQj0BA+edOiLDI+Oz5ahHfHH+P Ct5z1ckAZpNAdyMglpBVfcW80kIpyOYzncubHxLg2MUPO6B5Qqfn8rsLwaDOd4TJo+1K t67LvMmDtCEo7luM9hVrPY9V7lwnxxOO2n4xP+to4SlvZB8PcqMP8lm1ADf08yPC/eAp GuV3wIpXTu/csvMN6i2NgalTtPhebuqATZGQF5uTW3ujHIkstYVxKWS5Mw4Han+9ONCu QGDA== 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:content-transfer-encoding; bh=xeRsX7uk9JInuVpTCDPgVQn8I9ef6lPqe1vjPRu+FZ4=; b=aO9Z0Tsuzg+NLUrAL4HtnliluCv7h+lAU8CoNEbIMvWV3hxh0AFeGDPtEqNYkppl1Y LMZ8GPW33CPzIViR/YDeESO5Mvz6Gzp/vBv8VtlhndyXjsnuSY8+kpdfe9I01g3MCsvg Y/+xEHWHJJKEeO/Hh7gqkG0wQQ1TYbOOgbIKPhyshrf+Tury9bIiBEkQk1pHK5DQiNM6 DtuNOWm+VZq/LPJ7F9DrKn1YuzKb3zBWX/z6gr4Xz8dx42Y7H3oRYskcuTndBOLWixty QKIqNurYh4d7iz0nCjelUif6DKNJSi8R09jERyY8/FyAg1yFHsF+ZI9eBtx65Rnkxzlh aYYQ== X-Gm-Message-State: APjAAAXrtT6XxJLJpV93jR+NXX7m00xeVd8Qb8xPKi7caz3kCVfdkZpw YyhY9QBw4+G39XZZ9wbxP/F/+17Mt0R/Sh5jc5yMuzVJ X-Received: by 2002:a25:50c9:: with SMTP id e192mr9535860ybb.208.1574419384804; Fri, 22 Nov 2019 02:43:04 -0800 (PST) MIME-Version: 1.0 References: <20191121211053.48861-1-rrangel@chromium.org> <20191121140830.4.Iddc7dd74f893297cb932e9825d413e7890633b3d@changeid> <20191122080319.GC3296@dell> In-Reply-To: <20191122080319.GC3296@dell> From: Guenter Roeck Date: Fri, 22 Nov 2019 02:42:53 -0800 Message-ID: Subject: Re: [PATCH 4/4] platform/chrome: i2c: i2c-cros-ec-tunnel: Convert i2c tunnel to MFD Cell To: Lee Jones Cc: Raul E Rangel , Enric Balletbo i Serra , Wolfram Sang , Akshu.Agrawal@amd.com, Guenter Roeck , Chanwoo Choi , linux-kernel , Alexandre Belloni , linux-i2c@vger.kernel.org, Benson Leung Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 22, 2019 at 12:03 AM Lee Jones wrote: > > On Thu, 21 Nov 2019, Guenter Roeck wrote: > > > On Thu, Nov 21, 2019 at 1:11 PM Raul E Rangel wr= ote: > > > > > > If the i2c-cros-ec-tunnel driver is compiled into the kernel, it is > > > possible that i2c-cros-ec-tunnel could be probed before cros_ec_XXX > > > has finished initializing and setting the drvdata. This would cause a > > > NULL pointer panic. > > > > > > Converting this driver over to an MFD solves the problem and aligns w= ith > > > where the cros_ec is going. > > > > > > > I thought the mfd maintainer objects to the use of the mfd API outside > > drivers/mfd. Did that change recently ? > > It hasn't changed, although I don't see that here? > Sorry, I was confused. Guenter > > > Signed-off-by: Raul E Rangel > > > --- > > > You can now see the device node lives under the mfd device. > > > > > > $ find /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunne= l.12.auto/ -iname firmware_node -exec ls -l '{}' \; > > > /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunnel.12.au= to/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/de= vice:1c/PNP0C09:00/GOOG0004:00/GOOG0012:00 > > > /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunnel.12.au= to/i2c-9/firmware_node -> ../../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0= A08:00/device:1c/PNP0C09:00/GOOG0004:00/GOOG0012:00 > > > /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunnel.12.au= to/i2c-9/i2c-10EC5682:00/firmware_node -> ../../../../../../../../LNXSYSTM:= 00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00/GOOG0012:00/10EC= 5682:00 > > > > > > drivers/i2c/busses/i2c-cros-ec-tunnel.c | 36 +++++++++--------------= -- > > > drivers/mfd/cros_ec_dev.c | 19 +++++++++++++ > > > 2 files changed, 32 insertions(+), 23 deletions(-) > > -- > Lee Jones [=E6=9D=8E=E7=90=BC=E6=96=AF] > Linaro Services Technical Lead > Linaro.org =E2=94=82 Open source software for ARM SoCs > Follow Linaro: Facebook | Twitter | Blog