Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6946430imu; Mon, 3 Dec 2018 05:29:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/VLy+x7mMePpc3a0LHUO4ZauvP/gg9yrkmsjWmXu89JADqf39+FshaY0iOK9RlTZ4+D5PQm X-Received: by 2002:a65:448a:: with SMTP id l10mr12079427pgq.387.1543843771533; Mon, 03 Dec 2018 05:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543843771; cv=none; d=google.com; s=arc-20160816; b=LWVJORyHv3ffdDd6lefybK6m8TfnL0qmh6/RFtjPW62Z/pyeDjVp3D0oSIE2DQnE2R n4EocpKKZT6tPer17lEFDX2L2qQgAzt6mmzB6H1DIwTzJjpa7ILPb/CnkRQas+aLGoVD soi4ZO7dO6fN6wQcocmk7IbxK81sAzGooAdr3LAS0TSvF1AZT2kemrdu4HcZB9F8lDe3 WWgo1/sDIu7ILdTg05qSNxHYOcahAcR6btBqXh8stbACgfcfOerKrM2pTyi/OviVZv17 F++EnDffTD2q36pP9b8bJXBsOQ1uWtqygN6EM6wiQFln91nSwTfYzUV+rcM9vtHoGZ0S 8I4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from:dkim-signature:dkim-filter; bh=idciN5L8/LZtBaF+h1cUXZ28om2ERlcrF+dbGe8DA6c=; b=XMQ1DU5tsjaDOJMClwYirYlX3mVkOMT0cgOvHXCj24cRvIdo36kkLg1VNq6mOtgIq/ WuG6usoPZUBdYu+TnR1NNBngK16ajuUH3MaOqVtHS+g5iWkSdiOuoo8VqgRBz4HiFz5S FZccivgcnYogVkRSbEAx2M2wVtOemni20CptB2ynmX/7RVovdfn+89joZJipiRUR5jpG iGalgOrfCJlIXcFMQxmwGMBpk8s/NC57//X6g0WxlhQbuiS9k6oz5ui2ZPs7gZUG9HEV CxI9B/imZkW7/Q5tNMMmZRxX3bRvLDwdh6/8uHLk47T0EM5Eapt+PGaXzpNaqnT7kVsc Yiug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@piap.pl header.s=mail header.b=K18T5dOE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=piap.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si14075886plo.195.2018.12.03.05.29.17; Mon, 03 Dec 2018 05:29:31 -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=@piap.pl header.s=mail header.b=K18T5dOE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=piap.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726028AbeLCN30 (ORCPT + 99 others); Mon, 3 Dec 2018 08:29:26 -0500 Received: from ni.piap.pl ([195.187.100.4]:56096 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbeLCN30 (ORCPT ); Mon, 3 Dec 2018 08:29:26 -0500 Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ni.piap.pl (Postfix) with ESMTPSA id 9EE4B443027; Mon, 3 Dec 2018 14:28:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 ni.piap.pl 9EE4B443027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=piap.pl; s=mail; t=1543843699; bh=idciN5L8/LZtBaF+h1cUXZ28om2ERlcrF+dbGe8DA6c=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=K18T5dOE077ErF4/6N9thUtGKHfLoIRR1DCGjewIxS+TajkoVFA3dbQl+Lrtkyo/A uaGkDrqk7lS45KxAw9fSOVNcoSbEI6dJ43WduBf6QUOBjhMI9PJ7xWBUCacjwqPZsN jFWJ2LmTQA1dHXDF/6Sc5oBDU+n36ojVpMuj56pY= From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: Fabio Estevam Cc: linux-kernel , "moderated list\:ARM\/FREESCALE IMX \/ MXC ARM ARCHITECTURE" , linux-i2c , Lucas Stach Subject: Re: [PATCH] ARM i.MX: Fix a kernel panic in i2c_imx_clk_notifier_call(). References: Date: Mon, 03 Dec 2018 14:28:18 +0100 In-Reply-To: (Fabio Estevam's message of "Mon, 3 Dec 2018 09:21:32 -0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 132422 [Dec 03 2018] X-KLMS-AntiSpam-Version: 5.8.3.0 X-KLMS-AntiSpam-Envelope-From: khalasa@piap.pl X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Info: LuaCore: 214 214 dd5d82bb00ca93bd3dfb46ca097df6af04819311, {Tracking_DKIM, one}, {Tracking_ sender_matches_from}, Auth:dkim=pass header.d=piap.pl, DmarcAF: none X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, 2018/11/29 11:35:34 X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, bases: 2018/12/03 09:08:00 #9343794 X-KLMS-AntiVirus-Status: Clean, skipped Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fabio, Fabio Estevam writes: > Please provide a commit log, giving some context to your fix. Well, I hope Lucas could add something here. I am uncertain how it was supposed to work, the ndata->clk (the pointer, not the clk pointed by it) can't be at the same time a member of imx_i2c_struct, and I believe the macro only does simple arithmetics to get to the outer struct. @@ -510,9 +510,9 @@ static int i2c_imx_clk_notifier_call(struct notifier_block *nb, unsigned long action, void *data) { struct clk_notifier_data *ndata = data; - struct imx_i2c_struct *i2c_imx = container_of(&ndata->clk, + struct imx_i2c_struct *i2c_imx = container_of(nb, struct imx_i2c_struct, - clk); + clk_change_nb); > Is this a regression? Probably (it went in between 4.16 and 4.17, commit id is 90ad2cbe88c22d0215225ab9594eeead0eb24fde). However this part may be unused on many boards (apparently it only fires up if the "IPG" clock rate changes), so it may not manifest itself. I only hit it when I added a custom driver (using/requesting a special clock derived from IPG). -- Krzysztof Halasa Industrial Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland