Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4465602rwb; Tue, 6 Sep 2022 07:57:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6TgkAF1+L/xuVCwTFMK6CaQST/kgb8qsqINb5UbNYmh5bHJtBJ9I9d4I4WQ1AF5+X5uqnj X-Received: by 2002:a63:36cb:0:b0:430:c35:b2ee with SMTP id d194-20020a6336cb000000b004300c35b2eemr29093455pga.437.1662476243107; Tue, 06 Sep 2022 07:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476243; cv=none; d=google.com; s=arc-20160816; b=nMLUF9RvRzjkO1jggUE0UulkbazCwg7zXpFBTWTOvpTdypku2VTCs1i35+IikWg385 g8GfIAe7KNNi2WrgYKweYxZivRI86q5X0CAkhR9fkWtyif2R26JOx9aGGIx/Z2+WqbyG GsYkf7MF/G3FOZ6EJVNpymRw71eqoke5IP1Bb31lZN1XWWtgYTUgk8++BWtnW3zmnfaH 13USGJJa2HTcg9aASrKK7dWHFrEmIirkahguaYb4vm0wg/ml5n2avK3+r33NK4hnFAb7 PjMvXp9mTmOjl78K1u2p0De3TJiJhgRQFHSMrtb1KlqtWd81qzB+XV1It+zKDE3vxPnJ VZQA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=nxadPF94X1MxwNwmHHCKkZOFAQb3ef2XOU15LrtN6NI=; b=MIv9DegBP5wWhLbG3nVBJw++EE71OEMnO3cHltkI7COBaVwA3YRakErNniosCs11Vi Cf2K1XhM70pKqJImgJv57sY5nzCfRmJdsm683AUcnEoFzo87k2WR3GUXz2rCRncPHivn D/N2LUjNsSXtLFG2WoHeEW7WJRbO2e6scqgjBZUbICHvfLLZdXqjamwcMClKEsadLZ7U a9LPC/19Ps1uQ1JU9k3QlTEkremcV787+x/hALhHPL3C/fgZvlIFISFXG4mPKSF1jmLY YX2TeQ6xQ5VLk6+ISdM/39AOGNBv81+4u0OurdtOQRxN4KI2nsbAkuHfB3S7Vmd2dbFT ObAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0oIf5mE9; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a056a0021c200b00535fd435cf6si12554106pfj.208.2022.09.06.07.57.12; Tue, 06 Sep 2022 07:57:23 -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=@linuxfoundation.org header.s=korg header.b=0oIf5mE9; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240948AbiIFOC6 (ORCPT + 99 others); Tue, 6 Sep 2022 10:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240996AbiIFN7S (ORCPT ); Tue, 6 Sep 2022 09:59:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD5081B0C; Tue, 6 Sep 2022 06:43:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72B52B8162F; Tue, 6 Sep 2022 13:43:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9915C433D7; Tue, 6 Sep 2022 13:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471782; bh=ZUeFA3lxFmVxi0w/jhimiRYvlLExLzNc113cBPzsRbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0oIf5mE96QJRAHQVh/kf0f2T9UGuetAY1mWKkQz29VIwzHxVYoIDoeMn9nT+qbaZ1 Toonh6FPPg5Hsm8AaNo9lg9c7VAuDbH0LO5RmzwHnEtuxkmdrLjvjx3I9m4HZ+pJMV zlTOpRKBUeuPVt+ktFsfr3wIWtGpHCXGfzUsawJA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Hans de Goede , Sasha Levin Subject: [PATCH 5.19 007/155] platform/x86: pmc_atom: Fix SLP_TYPx bitfield mask Date: Tue, 6 Sep 2022 15:29:15 +0200 Message-Id: <20220906132829.717050642@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Andy Shevchenko [ Upstream commit 0a90ed8d0cfa29735a221eba14d9cb6c735d35b6 ] On Intel hardware the SLP_TYPx bitfield occupies bits 10-12 as per ACPI specification (see Table 4.13 "PM1 Control Registers Fixed Hardware Feature Control Bits" for the details). Fix the mask and other related definitions accordingly. Fixes: 93e5eadd1f6e ("x86/platform: New Intel Atom SOC power management controller driver") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220801113734.36131-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/pmc_atom.c | 2 +- include/linux/platform_data/x86/pmc_atom.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index 154317e9910d2..5c757c7f64dee 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -232,7 +232,7 @@ static void pmc_power_off(void) pm1_cnt_port = acpi_base_addr + PM1_CNT; pm1_cnt_value = inl(pm1_cnt_port); - pm1_cnt_value &= SLEEP_TYPE_MASK; + pm1_cnt_value &= ~SLEEP_TYPE_MASK; pm1_cnt_value |= SLEEP_TYPE_S5; pm1_cnt_value |= SLEEP_ENABLE; diff --git a/include/linux/platform_data/x86/pmc_atom.h b/include/linux/platform_data/x86/pmc_atom.h index 6807839c718bd..ea01dd80153b3 100644 --- a/include/linux/platform_data/x86/pmc_atom.h +++ b/include/linux/platform_data/x86/pmc_atom.h @@ -7,6 +7,8 @@ #ifndef PMC_ATOM_H #define PMC_ATOM_H +#include + /* ValleyView Power Control Unit PCI Device ID */ #define PCI_DEVICE_ID_VLV_PMC 0x0F1C /* CherryTrail Power Control Unit PCI Device ID */ @@ -139,9 +141,9 @@ #define ACPI_MMIO_REG_LEN 0x100 #define PM1_CNT 0x4 -#define SLEEP_TYPE_MASK 0xFFFFECFF +#define SLEEP_TYPE_MASK GENMASK(12, 10) #define SLEEP_TYPE_S5 0x1C00 -#define SLEEP_ENABLE 0x2000 +#define SLEEP_ENABLE BIT(13) extern int pmc_atom_read(int offset, u32 *value); -- 2.35.1