From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2EDDC433F5 for ; Fri, 12 Nov 2021 10:26:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8943461027 for ; Fri, 12 Nov 2021 10:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234917AbhKLK3U (ORCPT ); Fri, 12 Nov 2021 05:29:20 -0500 Received: from mga02.intel.com ([134.134.136.20]:35250 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234675AbhKLK3R (ORCPT ); Fri, 12 Nov 2021 05:29:17 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10165"; a="220321710" X-IronPort-AV: E=Sophos;i="5.87,229,1631602800"; d="scan'208";a="220321710" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2021 02:26:26 -0800 X-IronPort-AV: E=Sophos;i="5.87,229,1631602800"; d="scan'208";a="453113481" Received: from smile.fi.intel.com ([10.237.72.184]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2021 02:26:25 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1mlTl8-0063lg-Ow; Fri, 12 Nov 2021 12:26:14 +0200 Date: Fri, 12 Nov 2021 12:26:14 +0200 From: "andriy.shevchenko" To: =?utf-8?B?6buE56Kn5rOi?= Cc: Jarkko Nikula , linux-i2c , linux-kernel , "mika.westerberg" , "p.zabel" Subject: Re: [PATCH] i2c: designware: I2C unexpected interrupt handling will cause kernel panic Message-ID: References: <20211111065759.7423-1-huangbibo@uniontech.com> <0f203acf-7f63-e2d0-b590-120d3a7ba9c5@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 12, 2021 at 03:35:07AM +0000, 黄碧波 wrote: > Hi Andy, First of all, please fix your email client (it mangled the message in a bad way) and do not top post! > This patch is to make the kernel more stable & stronger, > Even if there is an unexpected I2C interrupt, kernel will not crash As far as I can see this is, as Jarkko said, the change to hide the real issue. > Let me elaborate on this issue: > The BIOS support EFI RTC feature and add the I2C bus descr in the ACPI table (RTC chip is connected to I2C bus), The OS matches and registers the I2C bus driver. > > When OS get RTC time by BIOS interface (Runtime Server), crash occurs. > The  BIOS interface direct acces registers to sends and receives data, which conflicts with the  I2C driver > > This is a BIOS error and the root cause of this issue. The final solution is to delete the I2C device node in the ACPI table Oh, yeah, yet another brain damaged design. If somebody wants to have driver of the I²C peripheral in the ASL, it's not gonna work in Linux (in 99.99% cases). What you should do is go and fix BIOS that it won't do two things together, i.e. ASL based driver and exposure of I²C host controller in ACPI. On the constructive way, you need to use DMI quirks and somehow make EFI and I²C code to be communicating nicely in the kernel. The patch makes no sense to me, the problem is obviously somewhere else. NAK. >   >   > ------------------ Original ------------------ > From:  "Jarkko Nikula" Date:  Thu, Nov 11, 2021 02:06 PM > To:  "huangbibo" Cc:  "linux-kernel" Subject:  Re: [PATCH] i2c: designware: I2C unexpected interrupt handling will cause kernel panic > >   > > Hi > > On 11/11/21 8:57 AM, huangbibo wrote: > > I2C interrupts may be triggered unexpectedly, > > such as programs that directly access I2C registers, > > bus conflicts caused by hardware design defects, etc. > > These can cause null pointer reference errors and kernel panic. > > > > kernel log: > > [   52.676442] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 > > ... > > [   52.816536] Workqueue: efi_rts_wq efi_call_rts > > [   52.820968] pstate: 60000085 (nZCv daIf -PAN -UAO) > > [   52.825753] pc : i2c_dw_isr+0x36c/0x5e0 [i2c_designware_core] > > [   52.831487] lr : i2c_dw_isr+0x88/0x5e0 [i2c_designware_core] > > [   52.837134] sp : ffff8020fff17650 > > [   52.924451] Call trace: > > [   52.926888]  i2c_dw_isr+0x36c/0x5e0 [i2c_designware_core] > > ... > > [   52.957394]  gic_handle_irq+0x7c/0x178 > > [   52.961130]  el1_irq+0xb0/0x140 > > [   52.964259]  0x21291d30 > > [   52.983729]  0x21160938 > > [   52.986164]  __efi_rt_asm_wrapper+0x28/0x44 > > [   52.990335]  efi_call_rts+0x78/0x448 > > [   53.019021] Kernel panic - not syncing: Fatal exception in interrupt -- With Best Regards, Andy Shevchenko