Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4085986ybl; Mon, 9 Dec 2019 05:20:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzk93FHviX7GH7UNCp+DDEpV+9y9/cmnAzRzrwacJaFS9e7zvcxG24Wb7GQp1JL+INJIJM8 X-Received: by 2002:a05:6808:218:: with SMTP id l24mr18882374oie.75.1575897618269; Mon, 09 Dec 2019 05:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575897618; cv=none; d=google.com; s=arc-20160816; b=06Si7sWVfFmllaE9LMIOBRzwVgnMvQpaFp2w5Tf6swfmQGmaXXj4c9IONfvUBZO5dr C3zUAWaLNkK8UlefvRWGl23GvoGM/9wxeSM+494nKv63DXb6HA0IqmTcsqlOpyV4H1QW 0PuZJMUvCWj8PIVYK9TkGT3JxQ1ugNOHXs6wymDnghUCU7UK+nuL9tsXuyg4PrnCaXuu qPKatXDNwBgy3fb/SMQ9AulX09O5sXXqAtA00jnOqUq/0SYw+mJYIVKZwZVfqUxgT+9P DV/Vb9XUMWRxKisY1aBFGCXjAu7rtgnWYNdCKGo3+HIYfQH/terFO8M/p3jzrUPo4ht9 NPtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4+QA/tgnnIgBecFWO74sIEulDFPFsySoDm6BKiBPuIs=; b=ehV8kMkNiCeihM4ASLV+UQ0zkDjSu2Fkr14YTCosyB/JqhjUO1G4P+gaw5/3HiMScE QL7UvrDGzqQ/4gLkLM0nvWJD2sNBpPEPE8ADh6qIF4b/XtVrKcNbCFn29O9zcrtbugfY GdeAKCdRD4jp5LuUE7get2FKq1S0urb1Fg0RIzUBvWFWKyyxMHFv9gAQgWgZpJ1+Fw4x UrG+u+nymV1coifx4OVnFBrLhQJtgoJhUxcgK36R+30xTif9Wk3/Ewp9NUj1XneU4OcI YkqI5HbI8cpLFCB6Fxn8VDoh1cU0dlSpCNvBlSCVaCbYAGk3gKo2KveNLuQpjI4Wk+Mi n8MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TtHK5BAI; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l125si12237064oih.223.2019.12.09.05.20.05; Mon, 09 Dec 2019 05:20:18 -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=@linaro.org header.s=google header.b=TtHK5BAI; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727727AbfLINRz (ORCPT + 99 others); Mon, 9 Dec 2019 08:17:55 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34767 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727513AbfLINRz (ORCPT ); Mon, 9 Dec 2019 08:17:55 -0500 Received: by mail-wm1-f66.google.com with SMTP id f4so15426768wmj.1 for ; Mon, 09 Dec 2019 05:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=4+QA/tgnnIgBecFWO74sIEulDFPFsySoDm6BKiBPuIs=; b=TtHK5BAIe4p2p2E4v3xakR8r03HFNDQD5p0kmKz6BqeglB72D1LS8HQckhtJdHYF6s UcCKoi/Z26YLLdKCJZO+HHHQL+HS9tRQPacXFHLuQgBYAD6Ge4fuqL4Xf50Up5kaFVaN E80bJ/7qKJ6AT/ZB7OgrGuq10uBIRuE4u76wNjS+Lk13f9ERx82b9DEIdRszzMcWMBf1 9RxdH5SvcD+8Ckh8gCm1KGVOFlAdQ53hzYeh+wI21DlPY1gKU3CrvPgqWRV/DqnAKBmp hS1dODN9nRn5R0AX6pWoVsavUa3k9tmYxyDfUiYCEImgVQi1CgqfeggiiOQiNHZ/L8m/ /Q8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=4+QA/tgnnIgBecFWO74sIEulDFPFsySoDm6BKiBPuIs=; b=R+U0KvNGdIe5sJd/Y1dyHJfVkKDkItu7PI17jhCw1VqA8h23mex5C4PnAQ9p8Z35lw yDBX/2OwAbnWOCIp19KTUic4mmnQm7mGLC00c5lqnQfH5YcnBg1P69kHJB+N5BxM+g1W FM6o3INjGtUNpFyZoyVqIoVwh7ejx4GBfIlk2o3jIV3HofYOgB7dvdRLreLLVZGLZU4K cS6YZK9cAJQnARiDAxys+tg+N6ZEolUaHoD+Jj6iIz+uF8MKxD/0CKk1jDMZilaGIA3O E4C0j911YYSS5wMiqoubDpLneV5kYKMzOcWPP6iL0olAP3i6vU+fbNInrIIZqTSkAJKZ OqSg== X-Gm-Message-State: APjAAAWslXuRNvP2MbTGKqYG0JM2i8/QjjxR1KeTvS1mz3pWP938rJX0 /XK/DqG0CTouP40dMpuX9Oa/jQ== X-Received: by 2002:a1c:49c3:: with SMTP id w186mr25635339wma.53.1575897473285; Mon, 09 Dec 2019 05:17:53 -0800 (PST) Received: from dell ([2.27.35.145]) by smtp.gmail.com with ESMTPSA id u14sm26646505wrm.51.2019.12.09.05.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 05:17:51 -0800 (PST) Date: Mon, 9 Dec 2019 13:17:45 +0000 From: Lee Jones To: Raul E Rangel Cc: enric.balletbo@collabora.com, Wolfram Sang , Akshu.Agrawal@amd.com, Guenter Roeck , Chanwoo Choi , linux-kernel@vger.kernel.org, Alexandre Belloni , linux-i2c@vger.kernel.org, Benson Leung Subject: Re: [PATCH 4/4] platform/chrome: i2c: i2c-cros-ec-tunnel: Convert i2c tunnel to MFD Cell Message-ID: <20191209131745.GM3468@dell> References: <20191121211053.48861-1-rrangel@chromium.org> <20191121140830.4.Iddc7dd74f893297cb932e9825d413e7890633b3d@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191121140830.4.Iddc7dd74f893297cb932e9825d413e7890633b3d@changeid> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Nov 2019, Raul E Rangel wrote: > 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 with > where the cros_ec is going. > > 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-tunnel.12.auto/ -iname firmware_node -exec ls -l '{}' \; > /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunnel.12.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00/GOOG0012:00 > /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunnel.12.auto/i2c-9/firmware_node -> ../../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00/GOOG0012:00 > /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-i2c-tunnel.12.auto/i2c-9/i2c-10EC5682:00/firmware_node -> ../../../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00/GOOG0012:00/10EC5682:00 > > drivers/i2c/busses/i2c-cros-ec-tunnel.c | 36 +++++++++---------------- > drivers/mfd/cros_ec_dev.c | 19 +++++++++++++ For my own reference: Acked-for-MFD-by: Lee Jones -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog