From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 4/4] platform/chrome: i2c: i2c-cros-ec-tunnel: Convert i2c tunnel to MFD Cell Date: Fri, 22 Nov 2019 08:03:19 +0000 Message-ID: <20191122080319.GC3296@dell> References: <20191121211053.48861-1-rrangel@chromium.org> <20191121140830.4.Iddc7dd74f893297cb932e9825d413e7890633b3d@changeid> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Guenter Roeck 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 List-Id: linux-i2c@vger.kernel.org On Thu, 21 Nov 2019, Guenter Roeck wrote: > On Thu, Nov 21, 2019 at 1:11 PM 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. > > > > 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? > > 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 +++++++++++++ > > 2 files changed, 32 insertions(+), 23 deletions(-) -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog