Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4465441rwb; Tue, 6 Sep 2022 07:57:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6+odE3W/bFdD9Z4wPjUwYkPZkJhwhku/qmCrVoOMuBem0rIafvVJK+RS6sEF+hk5jnOYmF X-Received: by 2002:a17:907:a0c7:b0:739:7ea:88ec with SMTP id hw7-20020a170907a0c700b0073907ea88ecmr39677826ejc.363.1662476234367; Tue, 06 Sep 2022 07:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476234; cv=none; d=google.com; s=arc-20160816; b=U+zWqJNqayxs3MmcacfZWyg0jLHHdJg/zqD2jCGKBknOfmjf+mBqtnH7+tFEryYHh5 0qvnX1zI3qJd3deXafayavkAo5OASbVZJLqNg0QYsHBC6cFCi0UtD6FgDQ8SWPmnsT+y lxuIyoKkIDfTb0bHRDn4YQ6BG/v8gJilk1vEoVkwNoMBc6Rg4SVhIqyR5uKZxLu94RZ7 D1Cds3pjdff/MMs3ySVkoJ8/CnXxVmuwUvEDn09ADYXXxq9Dv22xoKIdHyLyXp/11EaS mQytihrXnLyPWXlHle/xP1wmrl08BHThcl7qS0EExksZ/6ujAzLJAf2Iw5Uxjua4WP7U pftA== 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=f9ocpvqOF6hS7B3ITnqHjd3Dlmbqgkf/3+YfpJz2r5o=; b=eIFzFyZsNmWkiq67GkAk6DrfbrNnflL5wf3XfQuUMwM2VfMEVHrob19ILZGStVOwET xOI8mjVmgFKuEqv+U1yNGudzzq/VtIYndlhmfoHKqNBMx3TQudMTTOAaOgbUfOxfKm0L AIVhdkTIbwDfaD1Yv1QX3+Mw8e23dAN12MAV7/xYbj76caSiNbnZrYbTa0g6+uJCQALJ esTNU/ltzIqtvfpZ+3d5+0mKD89L7+0cTGK6h8XkroUZ28zq8+neJ2np7kSFn/Evb/8Y e0rRFAAZm1pEzZtctX09e5xYwKWk7ejE3WNK6yJtRdS9q97NUDt2eRUlrsC16p6dCv3u VtPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cz0KjPDE; 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 he16-20020a1709073d9000b007706069c600si100407ejc.540.2022.09.06.07.56.49; Tue, 06 Sep 2022 07:57:14 -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=Cz0KjPDE; 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 S240512AbiIFNd1 (ORCPT + 99 others); Tue, 6 Sep 2022 09:33:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239958AbiIFNc4 (ORCPT ); Tue, 6 Sep 2022 09:32:56 -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 D39AB7755A; Tue, 6 Sep 2022 06:32:41 -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 54D8EB81633; Tue, 6 Sep 2022 13:32:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90C19C433C1; Tue, 6 Sep 2022 13:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471159; bh=vS1J7xHJYezLlqAAI9KOAoTsdvtuaOOiTsYuHicaTPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cz0KjPDEKyo8v3xzd4RB4znWHNEWFOXjfaCetkSo1MNIY3CHdgL7rumBiqGADJ5FP X+4jmX5JiAmY15H0kREsG/UGLV3d3iLbMl57NXuriwZKzB+hj4+U2wg4uD0zw9CelY DD9DWUHy6KHtSyyddibEF4fM/sl9hP5yNMTSlmXw= 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.10 05/80] platform/x86: pmc_atom: Fix SLP_TYPx bitfield mask Date: Tue, 6 Sep 2022 15:30:02 +0200 Message-Id: <20220906132817.156084519@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132816.936069583@linuxfoundation.org> References: <20220906132816.936069583@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 a9d2a4b98e570..4b0739f95f8b9 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -244,7 +244,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 022bcea9edec5..99a9b09dc839d 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); extern int pmc_atom_write(int offset, u32 value); -- 2.35.1