Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2931092pxy; Mon, 3 May 2021 11:08:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6mydUK6mBz4WmFxmwMUXQ8TvSX/eARQUQkN6hSRMCuglzY4XjwY22xoc/tLNNk7l23s95 X-Received: by 2002:a17:902:9006:b029:ed:7f89:49d8 with SMTP id a6-20020a1709029006b02900ed7f8949d8mr21805309plp.52.1620065319075; Mon, 03 May 2021 11:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065319; cv=none; d=google.com; s=arc-20160816; b=hB3QDh2EQakoqIQoSge7e2rs1Nn6MmpeUOnuZnszYnKQkl+rH1oSTet6XV0D4cSjQW 1DrIUwu6ajBcV/BbmXphfVHY2uHRoc/k/Lv/yIcya5sCactFg3S+DG/x9+/1lQOCZumA cZw1eVD0U+Z91vcor2amuUUk0kORyhX6wKLEse3pI6PCTA0Kpzf0hjzpsYI1gO3sNikX 2cbgwCO+1AuWCPNBy8c2u9eaysvUbPMp6+kM7DgZLWT4ueEt3lvgdS7vzKL7EBvdQ2Tz v3l2YQdId5Q2PrT6XcgAc37wqJY4YZ6hzRI7dosIeSO/zLgM0mPd6XzJ4VUaXfaL4st6 8DAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=9pu81er+n+Of/wzoAlkjAnVXf9pjnWq62Moci+oL3Bg=; b=dvIitqNBqERKBlEV6PY1BTI5eag9p6KDz/dsdEQp833pYXSyXjiMqnJd1+hS2x3oHu wHNn7iK+oZYNF4H97g9gW8owqhjmMEYxC03Ro0Hzs9uwOIBbXVC1v+rjzalp0y8zszZz FNFb65Mr0o7fP7DBTNHLJUcfFAyOfnCtWZgFeTWKvWBDFZT5LGtOdPi7A8k4N/v3vN9r OtmihyahRfc4IgC91hNOPQsq9GpKLBadOiJyvFH+ft3QX6GNSo3SBqASpB0TIaVbDJcZ S+ZOTK+ObDIrzBKq1nJazg4HzZX2eMoso1k5ERRVKefxrCfYrxP+kQgYjjJxGf+GL+RC +huQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si358914pgd.28.2021.05.03.11.08.26; Mon, 03 May 2021 11:08:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234483AbhECNzq (ORCPT + 99 others); Mon, 3 May 2021 09:55:46 -0400 Received: from mga07.intel.com ([134.134.136.100]:17751 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbhECNzp (ORCPT ); Mon, 3 May 2021 09:55:45 -0400 IronPort-SDR: lFEPihZuv0E5JqPTvVoD9BZvn5SFLFw2tP+gzWeurHlsflpGKNR4XCD0RxVONW7cfvoJF4EYaD sqnghZf4b09A== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="261694824" X-IronPort-AV: E=Sophos;i="5.82,270,1613462400"; d="scan'208";a="261694824" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2021 06:54:51 -0700 IronPort-SDR: eeXV4PYnWo5SszbN3Oim3P/1YkyeuVr02vkhC2x9B0jLnsXYgWf59XE5C7KIXMdiQkaqz+JEqQ Z+nk1wkMRLLA== X-IronPort-AV: E=Sophos;i="5.82,270,1613462400"; d="scan'208";a="388399893" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2021 06:54:42 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1ldZ1z-009HMS-DJ; Mon, 03 May 2021 16:54:39 +0300 Date: Mon, 3 May 2021 16:54:39 +0300 From: Andy Shevchenko To: Frieder Schrempf Cc: Marc Kleine-Budde , linux-can@vger.kernel.org, Wolfgang Grandegger , "David S. Miller" , Jakub Kicinski , Liam Girdwood , Mark Brown , Vincent Mailhol , Oliver Hartkopp , Timo =?iso-8859-1?B?U2NobPzfbGVy?= , Tim Harvey , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Null pointer dereference in mcp251x driver when resuming from sleep Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Mon, May 03, 2021 at 04:48:10PM +0300, Andy Shevchenko wrote: > On Mon, May 03, 2021 at 04:44:24PM +0300, Andy Shevchenko wrote: > > On Mon, May 03, 2021 at 03:11:40PM +0200, Frieder Schrempf wrote: > > > Hi, > > > > > > with kernel 5.10.x and 5.12.x I'm getting a null pointer dereference > > > exception from the mcp251x driver when I resume from sleep (see trace > > > below). > > > > > > As far as I can tell this was working fine with 5.4. As I currently don't > > > have the time to do further debugging/bisecting, for now I want to at least > > > report this here. > > > > > > Maybe there is someone around who could already give a wild guess for what > > > might cause this just by looking at the trace/code!? > > > > Does revert of c7299fea6769 ("spi: Fix spi device unregister flow") help? > > Other than that, bisecting will take not more than 3-4 iterations only: > % git log --oneline v5.4..v5.10.34 -- drivers/net/can/spi/mcp251x.c > 3292c4fc9ce2 can: mcp251x: fix support for half duplex SPI host controllers > e0e25001d088 can: mcp251x: add support for half duplex controllers > 74fa565b63dc can: mcp251x: Use readx_poll_timeout() helper > 2d52dabbef60 can: mcp251x: add GPIO support > cfc24a0aa7a1 can: mcp251x: sort include files alphabetically > df561f6688fe treewide: Use fallthrough pseudo-keyword > 8ce8c0abcba3 can: mcp251x: only reset hardware as required And only smoking gun by analyzing the code is the above. So, for the first I would simply check before that commit and immediately after (15-30 minutes of work). (I would do it myself if I had a hardware at hand...) > 877a902103fd can: mcp251x: add mcp251x_write_2regs() and make use of it > 50ec88120ea1 can: mcp251x: get rid of legacy platform data > 14684b93019a Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net -- With Best Regards, Andy Shevchenko