Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1153016rwd; Tue, 16 May 2023 12:36:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QZwqNtZsbjwkehXxjCuP/+k38YYWrXlcIHBaPTdoW9eQ9E9wNV5ZhcHfbwKrx+aDssa/0 X-Received: by 2002:a17:903:4d5:b0:1ac:aac1:e344 with SMTP id jm21-20020a17090304d500b001acaac1e344mr26255318plb.36.1684265809529; Tue, 16 May 2023 12:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684265809; cv=none; d=google.com; s=arc-20160816; b=kz9XZaJCBzdQKBWnpVdL5olvefs8jZknccrVZfww1lrmWIEP9/CTYgPM80dI87NQdo Vf2Fn3XNtwaYEz23S9AJeUd9dqxzPr+8k6aWE2xqChPOp91Ty1u73u1WkdnseXqKN6wf Cd3oHu/YwCfuPDF01yxDyC5QtPyGYc/oTvR6iZiFKd2w9lGNxDR6ER85Uw3nc4JjaFjZ +o85KNgiedlEb7lDXaEKw276W0yOiiR7l86ylNX7Jt4E08IRrgm16KU6p3v4tCYAz0GB L5W7/MM6BbT3wFrsNyNVYg/CJAjs1L0/y0VDQ89qXABDqFtnTHeLSnrdkS9+qgYoqff8 IKgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date:cc :to:reply-to:from:subject:message-id:dkim-signature; bh=prchhFRwuSMvPwJfuwqk1PDnPCPf4Kl243xo/JpOii0=; b=XBoTDqKkpzP4unMiRsl1CUod5+GEQydKA1qBb6OVzJD1bKl8AbgdRKz/HfzVvbcwjp w2Pohi79xRqAAR4PWQfooGRRO+LjP8fEtLkDKpptJiQLFYD/oADct5OJd2KmIktsyGVK Jn7MAr+SR4jamFPTzr4K2krnkY89ovnJhIfM1f+8s+aQn1sO7OK1dHbZyK0MSxWsavMy jF0zOi3KXMLFrYbwt0mcfrslcR8pgSzfpgZ3nrtdNQH5Ewf8ehJulTWu9oowOs5XEq3Q Zvq/n2UosU9cURXPUexzQSzcl3kpypm6KUfmfnvAxOSIvUjxphP0jMZ/k/V6Ib2/L5zl +rXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=No1mE2yV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a170902f1d300b001addf547a59si10786871plc.0.2023.05.16.12.36.37; Tue, 16 May 2023 12:36:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=No1mE2yV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229558AbjEPTMM (ORCPT + 99 others); Tue, 16 May 2023 15:12:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjEPTMI (ORCPT ); Tue, 16 May 2023 15:12:08 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A93E91BD3 for ; Tue, 16 May 2023 12:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684264327; x=1715800327; h=message-id:subject:from:reply-to:to:cc:date:mime-version: content-transfer-encoding; bh=bN/A541hc6k5es5z2d6QQDgTmowFX9MWP05sD+SSzaw=; b=No1mE2yVgNDI3CM93HSc44HNm6JtF9aLRzEC4AvRqHKdrIUlU04UpRcq 1xR4L4g9PXl3jXQBJDpncbJPO9MQ2jEFod3nwHodY4y+vwUdUOcBeoNa+ usF9n9U44XwLvcls8NlGsWHnZ6x58T2SwHfFvpJYhzmTclu5YMlTirFKm 4/w4J4IBo6yXwgTLbaQaVMeyPaWYxMnmeA4TaEEPWkagXrjzQhHjsHdFx B2DA9GfJoKMyrKpuSaTJxclUuLFTCJ14bbWLAO5rApUyEcyek4xNHdtgS NS/J3yiptcTQaf6BN3JuYtZ9mS9OIoEbPw4dTdhlWWsTSOKs/c6MfRkts Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="417218214" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="417218214" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 12:12:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="771176942" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="771176942" Received: from wopr.jf.intel.com ([10.54.75.136]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 12:12:06 -0700 Message-ID: <51293660791f4a5fbcf4d86abe548c11fc91722f.camel@linux.intel.com> Subject: MTD: Patch to spi-nor hangs Lenovo ThinkPad X1 on suspend, sleep, and shutdown. From: Todd Brandt Reply-To: todd.e.brandt@linux.intel.com To: miquel.raynal@bootlin.com, pratyush@kernel.org, tudor.ambarus@linaro.org Cc: linux-kernel@vger.kernel.org Date: Tue, 16 May 2023 12:12:06 -0700 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is the kernel bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217448 This is the system I'm having troubles with: os-version : Ubuntu 20.04.2 LTS baseboard-manufacturer : LENOVO baseboard-product-name : 20QA000FUS baseboard-serial-number : W1KS11R111D baseboard-version : SDK0J40697 WIN bios-release-date : 05/20/2021 bios-vendor : LENOVO bios-version : N2MET49W (1.14 ) chassis-manufacturer : LENOVO chassis-serial-number : R911Q4MM chassis-version : None processor-manufacturer : Intel(R) Corporation processor-version : 11th Gen Intel(R) Core(TM) i7-1160G7 @ 1.20GHz system-manufacturer : LENOVO system-product-name : 20QA000FUS system-serial-number : R911Q4MM system-version : ThinkPad X1 Titanium Gen 1 cpucount : 8 memtotal : 15939728 kB memfree : 8428028 kB Ever since 6.4-rc1 this system has hung on every S3/S2idle suspend and shutdown during reboot. I've bisected it to a patch to the MTD: SPI-NOR subsystem about introducing the "concept of a bank" 9d6c5d64f0288a814d4435b7da39e360a4c39e40 is the first bad commit commit 9d6c5d64f0288a814d4435b7da39e360a4c39e40 Author: Miquel Raynal Date: Tue Mar 28 17:40:58 2023 +0200 mtd: spi-nor: Introduce the concept of bank SPI NOR chips are made of pages, which gathered in small groups make (erase) sectors. Sectors, gathered together, make banks inside the chip. Until now, there was only one bank per device supported, but we are about to introduce support for new chips featuring several banks (up to 4 so far) where different operations may happen in parallel. Let's allow describing these additional bank parameters, and let's do this independently of any other value (like the number of sectors) with an absolute value. By default we consider that all chips have a single bank. Signed-off-by: Miquel Raynal Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20230328154105.448540-2-miquel.raynal@bootlin.com Signed-off-by: Tudor Ambarus drivers/mtd/spi-nor/core.c | 1 + drivers/mtd/spi-nor/core.h | 16 +++++++++++----- drivers/mtd/spi-nor/xilinx.c | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) Basically something about the new code is improperly handling the memory size on this machine. It's not complex but I haven't dug any deeper since I want it posted as quickly as possible. To reproduce, run any of these 3 commands and the system will hang: echo freeze > /sys/power/state echo mem > /sys/power/state sudo reboot