From patchwork Fri Dec 15 11:25:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 179202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9205017dys; Fri, 15 Dec 2023 03:37:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzLk1xwI92fBepSUDkrCyFFkCShYlc6F+V+bygf9z1v88fuqed9A7JMxFvzSIoG+1uemRk X-Received: by 2002:a05:6871:64c9:b0:1fa:fc26:7f81 with SMTP id rk9-20020a05687164c900b001fafc267f81mr13346716oab.14.1702640228226; Fri, 15 Dec 2023 03:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702640228; cv=none; d=google.com; s=arc-20160816; b=RIA1a0koz+I2W7awJ49VOzkMKUQRAjNywFNremALIx2h2lspbYsEGaGsOent/gwVhV sbjIAmda4EWHOgq9E13GYBsxqBExWPD7crPFh1T41lw0Ye0vkIR8E2iz0q4So/KwrFoM +hTm9yemSAVbqInm3gLpQJBaGkjNE/eR+NClLVzOAGYOEWPKvX3lvsuB0RiiHGoVAlbU zdIeG6CCSDqqRNT8WEed3H4Sk1MX3GFMsLbaoMSyRvJ4bPFik0Hq5m6NxVET0uW37fR4 GfZHdVPlc1tdwMNahr6PD4z8lwqAIu5nxZmettb+xwL2cPmZFX+nH8YX/qWkbpr6Fb8Y n8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=3VMnIZhauRJuZBPluOB/ZadWDwWu29lQyyz/2l4qLAE=; fh=onaXV/9tgv2VQNqWsV5miYD1muoRQWddouYPtnrp6Do=; b=XM4XP2CHprMw3whJmWwEKS5+UBFwb1wKmeDbxOVgEJ2vlsCyi2Rw0ISLV9AZEMe/Q9 FL7Mk+5LQejfHXffjQeFXUtgSPqDAVXUmgRDPe/hTdQn3xrhNkv1aOEwqYllDpqa+91H Y9k9LYx1JrGnY7AKntWqINU3FSDwkO9ynuRSYuN9WHE9DnBlaac50u0PiMCLcEBQrH7W 0nPTneaELt3X5FDRuIAI88m7Jyu6qtV8goR6zhY0EhTQjKjD0HbFbZSI5DGjPLUDqFSm Mdo0mKk0YVYU1XwsLT008FwOYesbAmKQG3fHH3QcseYHbDFyE/enhDM00ncChmHsorl8 OvNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-851-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-851-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h18-20020a63e152000000b005be27af74basi12621494pgk.33.2023.12.15.03.37.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 03:37:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-851-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-851-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-851-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D063BB215EC for ; Fri, 15 Dec 2023 11:35:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C49D12D607; Fri, 15 Dec 2023 11:34:35 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCD9A250E6; Fri, 15 Dec 2023 11:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id 452ee2495fde20ac; Fri, 15 Dec 2023 12:27:50 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 754B3668B1E; Fri, 15 Dec 2023 12:27:49 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Zhang Rui , Srinivas Pandruvada , Michal Wilczynski , Hans de Goede , Andy Shevchenko , Mika Westerberg , Heikki Krogerus , Mario Limonciello , Daniel Drake Subject: [PATCH v1 1/3] ACPI: OSL: Use spin locks without disabling interrupts Date: Fri, 15 Dec 2023 12:25:15 +0100 Message-ID: <1895035.tdWV9SEqCh@kreacher> In-Reply-To: <2330034.ElGaqSPkdT@kreacher> References: <2330034.ElGaqSPkdT@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtvddgvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepuddupdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgt ohhmpdhrtghpthhtohepmhhitghhrghlrdifihhltgiihihnshhkihesihhnthgvlhdrtghomhdprhgtphhtthhopehhuggvghhovgguvgesrhgvughhrghtrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=11 Fuz1=11 Fuz2=11 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785347679605636899 X-GMAIL-MSGID: 1785347679605636899 From: Rafael J. Wysocki After commit 7a36b901a6eb ("ACPI: OSL: Use a threaded interrupt handler for SCI") any ACPICA code never runs in a hardirq handler, so it need not dissable interrupts on the local CPU when acquiring a spin lock. Make it use spin locks without disabling interrupts. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/osl.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) Index: linux-pm/drivers/acpi/osl.c =================================================================== --- linux-pm.orig/drivers/acpi/osl.c +++ linux-pm/drivers/acpi/osl.c @@ -1515,20 +1515,18 @@ void acpi_os_delete_lock(acpi_spinlock h acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp) __acquires(lockp) { - acpi_cpu_flags flags; - - spin_lock_irqsave(lockp, flags); - return flags; + spin_lock(lockp); + return 0; } /* * Release a spinlock. See above. */ -void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags) +void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags not_used) __releases(lockp) { - spin_unlock_irqrestore(lockp, flags); + spin_unlock(lockp); } #ifndef ACPI_USE_LOCAL_CACHE