From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752038AbdGYMpe (ORCPT ); Tue, 25 Jul 2017 08:45:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:42341 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbdGYMpc (ORCPT ); Tue, 25 Jul 2017 08:45:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,411,1496127600"; d="scan'208";a="115392886" Date: Tue, 25 Jul 2017 15:45:27 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Linux PCI , Linux ACPI , Linux PM , LKML , Bjorn Helgaas Subject: Re: [PATCH 2/3] ACPI / PM: Split acpi_device_wakeup() Message-ID: <20170725124527.GR2369@lahna.fi.intel.com> References: <3116391.JNS1F4DjTg@aspire.rjw.lan> <3408475.MC8krXn0zk@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3408475.MC8krXn0zk@aspire.rjw.lan> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 21, 2017 at 02:40:49PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > To prepare for a subsequent change and make the code somewhat easier > to follow, do the following in the ACPI device wakeup handling code: > > * Replace wakeup.flags.enabled under struct acpi_device with > wakeup.enable_count as that will be necessary going forward. > > For now, wakeup.enable_count is not allowed to grow beyond 1, > so the current behavior is retained. > > * Split acpi_device_wakeup() into acpi_device_wakeup_enable() > and acpi_device_wakeup_disable() and modify the callers of > it accordingly. > > * Introduce a new acpi_wakeup_lock mutex to protect the wakeup > enabling/disabling code from races in case it is executed > more than once in parallel for the same device (which may > happen for bridges theoretically). > > Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg