Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1996415pxp; Mon, 21 Mar 2022 09:09:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw++jc/CkCIE1uJ+wl7GscHy7o0LaUSSBPQhz4sovgNp2psNBV2m9BkEgyaIB15P7CGsqrc X-Received: by 2002:aca:f1d4:0:b0:2ef:1fa6:3c74 with SMTP id p203-20020acaf1d4000000b002ef1fa63c74mr8394304oih.89.1647878969752; Mon, 21 Mar 2022 09:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647878969; cv=none; d=google.com; s=arc-20160816; b=KW2eA/sJRF2G9FycW5gc/ezvOU+iM1Qn/v0ERI2wi+52KezP0P6pTQB+uGLQ0LAlKV mKEfaMfDW4P5brI02e01jLe8ktXAz7y8dtYq5ek7InmMJLuy5lgLNFT5elN/UFC6c0/t Nqui0cMU2LI85jxpkz/llheBvFU4KA93LoKsuc4nU0wUQiKrzW4mocYRXMBpy/Km5oWj +2OlEVdbacQ8N27h8Fa6LzIeM7+S5ZBX3qY3rK4bmSi1emkGjOqMNxnyIHOzvBV2Cqs0 epv4xxG9/JFuyKc7b1LMAlogXQDTLiO9ixmWcSdIsCVhfRbNAFawwNnBwFwplowceD9b f4LA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=hqswhbnOMm7ffYakT7tRGJ2is1DrUVKVb/3MOzX5S9A=; b=uI9p1t0MKvNY+mOC7o6uckNPfljEynUDxM0/QbjmbN/SHi7hcbghdZxg2KI/K4TGR8 YWvW+ucJ0SXur4bd3XbxSmq8sil8rIkA1Wqt2tsTrqIKnAPfIHCH+xmuB0HT5BJoBjc3 ILUygEHKcmvF7xf0qAa1uhXEg9ddEEM1S1fsTdQJ3c1yJQFXkp6u8PRYC4+L3aKdQv5E dnpb0vCZIZ5uHG+nAS/5k2kWoVl34XKy29bFjaZmJIWoeSgDzDe2Fc9b2ruXDjuMggJh MrdKcvU6Bv/UQMi8/9lYsEgwr8EWrkO/OsOpDt9K+yL5gnydlMVe6wpYVSnDSV2/CVeg ez9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=K+SgmylN; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020aca5a0b000000b002ef0c347681si4060363oib.257.2022.03.21.09.09.06; Mon, 21 Mar 2022 09:09:29 -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=@gmail.com header.s=20210112 header.b=K+SgmylN; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245571AbiCTQxC (ORCPT + 99 others); Sun, 20 Mar 2022 12:53:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232215AbiCTQxB (ORCPT ); Sun, 20 Mar 2022 12:53:01 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5464F39811; Sun, 20 Mar 2022 09:51:38 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id o3-20020a17090a3d4300b001c6bc749227so5103566pjf.1; Sun, 20 Mar 2022 09:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hqswhbnOMm7ffYakT7tRGJ2is1DrUVKVb/3MOzX5S9A=; b=K+SgmylNNoqzvCijb+HlnpncJ/rhUCdJZP5qya/K7MkTTwtC7Y+Z3GMn8DK5R6cQnz uZvRySRta0HruYs2/vWX8Pida8dOzy3TvnNWf/WMnH4V0jqh0KyI1L1Q+Iai9bAS9Qtl 348GgmaoBGsDHm6Msc6CyWwo4jIOfQXzwQywhkvFVteSCKIGzixTNuK1h6rh3m/DqkUh y1nsbZoSx8JYTMqo8rkMevvE085CzWCIpzvmEj0BnbnS7cn83MzMc04rsRxqjWURWPsc tjRs7MxOy76mhoPNctzUx4q6ny2sk17tgQAhyrhf5ifVCQSGLBWfprCe8526ESoQ2ttv 5grQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hqswhbnOMm7ffYakT7tRGJ2is1DrUVKVb/3MOzX5S9A=; b=38x3ofwmmInjR5Ld3f5U65pJitXhC9mIeSDVB+sOjHzTmhw5grUontDLW5c60XhpdK cJR3RHoFovJjZTnQR5Gv5vsogNP0+8eZgvxtnAmQvGkZn8X9UQm10Nu62dbrh38sAIVQ Lv1y9FsYtcSNyRk1/58xVAG1Sb4DehpHAx2IZkVf/ZYg1BQ6qDnSgg+HhuTjHzNIsWj5 hijp6TjqrTTOLNsvJAz4EVLIumfzTysTVGsDQyduzFq1tZSgGgP8qVGqirNum+1XMVDp mFhbDTDsCoKEsS9Q/9BClE91btFC7agXyHIQ8ER0Guef6xjFiirpkr7QszxA6Mo+AFud kK5A== X-Gm-Message-State: AOAM530VzzH4mQ04kQo1Rmze5/CboRjgH0N1k6k69wvgXUIWtDBIIj4K 3qcWG4vdbcOku0K6Peykklc= X-Received: by 2002:a17:90b:4f92:b0:1bf:25e2:f6af with SMTP id qe18-20020a17090b4f9200b001bf25e2f6afmr21846736pjb.98.1647795097761; Sun, 20 Mar 2022 09:51:37 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:7b82:18e2:fb73:9272]) by smtp.gmail.com with ESMTPSA id f4-20020aa782c4000000b004f6f0334a51sm15218841pfn.126.2022.03.20.09.51.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Mar 2022 09:51:37 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov , stable@vger.kernel.org Subject: [PATCH] xtensa: fix xtensa_wsr always writing 0 Date: Sun, 20 Mar 2022 09:51:28 -0700 Message-Id: <20220320165128.3137083-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 The commit cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") replaced 'WSR' macro in the function xtensa_wsr with 'xtensa_set_sr', but variable 'v' in the xtensa_set_sr body shadowed the argument 'v' passed to it, resulting in wrong value written to debug registers. Fix that by removing intermediate variable from the xtensa_set_sr macro body. Cc: stable@vger.kernel.org Fixes: cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") Signed-off-by: Max Filippov --- arch/xtensa/include/asm/processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index ba62bbcea160..67ccc3d48c8c 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -242,8 +242,8 @@ extern unsigned long __get_wchan(struct task_struct *p); #define xtensa_set_sr(x, sr) \ ({ \ - unsigned int v = (unsigned int)(x); \ - __asm__ __volatile__ ("wsr %0, "__stringify(sr) :: "a"(v)); \ + __asm__ __volatile__ ("wsr %0, "__stringify(sr) :: \ + "a"((unsigned int)(x))); \ }) #define xtensa_get_sr(sr) \ -- 2.30.2