Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2477879pxb; Mon, 11 Jan 2021 10:34:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJLLu6TTyNvUCYBZzuLR3lTnJxvrMwf3QJSJu9AiN8Ppkm3bdrGaO9heNk1P9CXwrXLlXz X-Received: by 2002:a17:906:3b4d:: with SMTP id h13mr527991ejf.289.1610390065608; Mon, 11 Jan 2021 10:34:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610390065; cv=none; d=google.com; s=arc-20160816; b=TnMgD7w2k6Sqj4QxtRcqs2cA9xtBv4+vr/S8HCrbsF9PutVyCNDs0/3zP++9a3ZSW1 Ufrhfa07Hsp+ZQztWlckmizJKd7n4goQsbcTLD+1zXZs25EB7EGO7QNVCFtiRrwJpTi/ cMozjYNfSIDC8jEdoLG++CnGGsSv0O0jAeK4QQ4H2IsLuEQ+VQp8pp0lTyFj938RZd2h qdsrZ5M0oPc0ipXR//htvdWj3OUj7c2tku3aP2zhRr5+LFNT089f4m/TmjrN840VM5B/ v+Qg0htKfIwQaTfJA2RQoe0KRcvb9CnjzVK6FNJzvw2qQZPKdUr12PEnJFYEw63fhiHQ hcCA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=P9oFeHULbHnF3mpaSPkN9EJ0BKLTK0LDx5Zik7ys4lo=; b=zvflz4rr7UI6bvVDJ0cysyOY/Dg5U2Eav1wUHCMw/1H/WY2W5mWPCidXw01aI12kAp UH7H/Tc5/9HzomHhLh/KDQPIbPhHMOosd14ilQg9Q2E2fwqpmFWRQjnIOWOtBIzwhHGT XU5MMlStVolNW2tilbmoYP5kHExHNcVEG3a7bhkoFpErubfciCgTUqh0ykK/MuEE3TzH LROFmhACZk4uorXu3dyXNKVK4yO2F2ey84vb++IkMRoiTbVaPpK0vNYYchtcvavEi6vF 6ELb3ec4ki/AhSOuKOO7b9NF3P8/g8vc+jQDepe4ybweoSdG0Sq8PguRuIJu8ik+FyTD vT8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oQZex2rj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp19si81132ejb.465.2021.01.11.10.34.01; Mon, 11 Jan 2021 10:34:25 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oQZex2rj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390610AbhAKSbf (ORCPT + 99 others); Mon, 11 Jan 2021 13:31:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389276AbhAKSbe (ORCPT ); Mon, 11 Jan 2021 13:31:34 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31DABC061786 for ; Mon, 11 Jan 2021 10:30:54 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id y23so174181wmi.1 for ; Mon, 11 Jan 2021 10:30:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=P9oFeHULbHnF3mpaSPkN9EJ0BKLTK0LDx5Zik7ys4lo=; b=oQZex2rjAa3eJHkEVIW3W/XqfY8EKPwW2ruwAROac7O4pWoH+ncg0b1MAC9unk89V1 mMvDptoHYrKqDaTvqa8kFm4MqOIHPcqwN9Phi9++Cp8N3NHpo51VpvB7BDsmQyg1PDnj /ZUa8Yfc9np74F2W1qAYVMCOMbV0e7ne6ueLksZMAk6hy6MQSqHisGBCluWvf6N2uMqu nlcxiFlFkmRtQ2L/ImoBYXbjIO9Ne6M6AE+qK9JyQT9Cpz7CMXDIIp9QV/FfkU7xW8Ri sPlD6CyXil22NX/DHWueIrw3CGJxJTF/O/XTr/V4AaxUGXWaR0Aj5zDkYsag4YDJKGjo 2nJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=P9oFeHULbHnF3mpaSPkN9EJ0BKLTK0LDx5Zik7ys4lo=; b=MEwoAYiPdIITHnB9JjBwiuxHICDDe7s3UAIvZpTiU31ushA85n0ee8gBWaDbGA+hvZ rZ7s+qt4xC3X0EduGprA8AGW6Yheg7s8eUTfStkVXe1slsDHqaxLeJZ1eYkpdzCu+Jdz WOhYOJ/ZNOlYWIzMTGHRnPDAW6DxTna9wk4nzC5Uu5bh+JTjp4UGJLCd9uEXgIu6rzw/ HG3Q3NbPy91IOtRQRpQ/Jwx7s4uL4A1UsDALeSlmim8K9P2cu4UkdwoFKehKNI0747uM QR1NC4gsHiUvWc263iNByO4Xx7taCMKHBbFt4bq9Ko9Tesw1lANqJ0J4zyBOHCHrc2mG PISA== X-Gm-Message-State: AOAM531DoWT+isC7gJzdGXZyMz3g6OUd1oea+e/PcPymXmqs0SrJnwvR s8abbyilrpYlylRjfJicjMI= X-Received: by 2002:a7b:cb46:: with SMTP id v6mr119562wmj.19.1610389852982; Mon, 11 Jan 2021 10:30:52 -0800 (PST) Received: from Saturn.fritz.box ([81.221.211.103]) by smtp.googlemail.com with ESMTPSA id j10sm234244wmj.7.2021.01.11.10.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 10:30:52 -0800 (PST) Message-ID: <147692b37063057ce4128894db112caf9320b65b.camel@gmail.com> Subject: Re: [PATCH 1/1] ARM: imx: build suspend-imx6.S with arm instruction set From: Max Krummenacher To: Ahmad Fatoum Cc: Max Krummenacher , Lucas Stach , linux-arm-kernel@lists.infradead.org, Fabio Estevam , Rouven Czerwinski , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Sascha Hauer , Russell King , Shawn Guo , NXP Linux Team Date: Mon, 11 Jan 2021 19:30:51 +0100 In-Reply-To: References: <20210111151704.26296-1-max.krummenacher@toradex.com> <20210111151704.26296-2-max.krummenacher@toradex.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Resent due to gmail adding HTML, sorry for the noise. Am Montag, den 11.01.2021, 18:49 +0100 schrieb Ahmad Fatoum: > > On 11.01.21 16:17, Max Krummenacher wrote: > > When the kernel is configured to use the Thumb-2 instruction set > > "suspend-to-memory" fails to resume. Observed on a Colibri iMX6ULL > > (i.MX 6ULL) and Apalis iMX6 (i.MX 6Q). > > > > It looks like the CPU resumes unconditionally in ARM instruction mode > > and then chokes on the presented Thumb-2 code it should execute. > > > > Fix this by using the arm instruction set for all code in > > suspend-imx6.S. > > > > Signed-off-by: Max Krummenacher > > > > --- > > > > arch/arm/mach-imx/suspend-imx6.S | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S > > index 1eabf2d2834be..e06f946b75b96 100644 > > --- a/arch/arm/mach-imx/suspend-imx6.S > > +++ b/arch/arm/mach-imx/suspend-imx6.S > > @@ -67,6 +67,7 @@ > > #define MX6Q_CCM_CCR 0x0 > > > > .align 3 > > + .arm > > You had a return to thumb at the end of this subroutine in the cover letter, > yet here it's omitted. Why? Now the whole subroutine is compiled for ARM and the return address has bit 0 set so that on jumping back to the caller the CPU will switch back to Thumb-2. Probably the return to Thumb-2 isn't needed in the cover letter solution and it would also work to finish the subroutine in ARM instruction set. However it looks strange to me if a function which begins with the ARM instruction set would come to the return in Thumb-2. > > > > > .macro sync_l2_cache > > > >