Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3844989ybc; Thu, 21 Nov 2019 14:51:41 -0800 (PST) X-Google-Smtp-Source: APXvYqx/YNuU1AqutGL2PGTQW6kP5kw1h+cwp2wI5AG+Xc/+roIKZsx4wVmtXKqMxEZbEb0LDW0e X-Received: by 2002:a17:906:52c3:: with SMTP id w3mr17542955ejn.122.1574376701678; Thu, 21 Nov 2019 14:51:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574376701; cv=none; d=google.com; s=arc-20160816; b=eOydS0nJofr8TshRVMFEOzEbvwtrehYcsk93rHkiulrzhVQfwqaU3viAlW7wlMW6ah GDhm8kyMlkx3ks16pqDUnyhouWzEgWKmavNiWknMqIPi7rVZC0aa6SX+XoObEfFd2Gx8 hCihbzIsHNLYUq/JPlmB3iDeSoaWB7CEf7N939sn5pmvqK75hkF+Gd66zLvLkRo7oOcs J9RDNq8ha6cHTE+rRSlQyIkg+3ZmHhjf12KX9qMmVk1gmbBtBXlNUmjfilB/8hcmpntD YkT1p3YvmQEKOiFZZoOwr6lod5I56vENAFCPjZO6tnHC5eDd6sw5PXltoqwR0cYYPYXA U9fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hA7ZeCaJ44IhniM9MrgBuv3D6rgyGtv4i7x/i/LEXnc=; b=uRdruc3gtdodonVjb6l19YYoLzaLDGTN6C/I70xhmYC9/4pO0ZMQWdUebxyL9N0wc4 vmnwFz1SqzzCbDUDW741dElI4mGUU5xSkdjhlW5msBQj1BzMggjdRepWzKBKtsqgRmlA LqqJ/cuvk+M3QpFegcbBSSmjhfRQx1CJ8SjCHLwvx1u7WjBirX8VMKPQyK0Ux3F9K3U+ 3IEYdMw8zhdjOfS0kF5CbLaNnkPfSxlMKsiu4klDl4oMEv4WOWs8PspO7yKOeBhsoIP+ Vepaf27MgTCce6kYAq3Qj4f81g0difQUzJH4jAeL8p2PMS8OQIP0UlRDiYbv0cvauiOF angA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=VPOwDJ7M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si2774134ejf.345.2019.11.21.14.51.01; Thu, 21 Nov 2019 14:51:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=VPOwDJ7M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726038AbfKUWtr (ORCPT + 99 others); Thu, 21 Nov 2019 17:49:47 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:44175 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfKUWtr (ORCPT ); Thu, 21 Nov 2019 17:49:47 -0500 Received: by mail-qk1-f194.google.com with SMTP id m16so4597755qki.11 for ; Thu, 21 Nov 2019 14:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hA7ZeCaJ44IhniM9MrgBuv3D6rgyGtv4i7x/i/LEXnc=; b=VPOwDJ7M8glx/FuSXYsbzC8HGbZRK0z630Dk2T6qzrBTG9L9rBc5dGhwzzsmHCsKwi pitfVVmwmLyA1B6PpK4/Ox5jzFB7k/RzHWf4yHunb2h7qDRNYKlpUXuh3+d4Q+MVgTuf FCBLtrmoRt0JR/z8J27iALIiDQVVWCLs2TU8fFY8XCRtIstrAReDJeugpICIgPjb9h2G hk+57TGsyURujX3RVW72Te3grY1O9M0tQ/ETnZcTaes0JtJlev/b9fqpnnNZ0vwy6pv/ m3CfjGet2lchinpd8y5k98ouOOgKVDIUW7QWQrpskxK1N++8IwwrRy7vpVrE6oVuk0uZ TDLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hA7ZeCaJ44IhniM9MrgBuv3D6rgyGtv4i7x/i/LEXnc=; b=h0XjBd0Q9wRlcu3c8FBYhhcLt7ND1K2o1YhrQ7m4PcVwjtTSH0T6/s4tMOl19l4++C rH55In3/WFGTdZ1Iem46b2pPo0mKbhptrEYCoPad/aPeNHDlKXf9r7urEO6YVMZhNxob ECgYIOmA8TM33sBj5QcB1N2EzriKyJQs15F+I9NyLVfPJW22dR0QcuaSnhNlyykbqIjT Gm/tXF6hoh0K1px8pN+9V2HKB/+vEY3L9X9Ce9RRBT7GYGtvNMT2atRZZ3WmH/vCaOpr Ye/XIO9YW9RYKsMq+amSmCoXEViIP9Gi5hAIRvTtz+pRB0rTeA8ccul2t3MFA3C+Cjgr ecBg== X-Gm-Message-State: APjAAAXMNMicVtRpU710o+Vyjl8oa8tsbtQpc9PLuXLdlnDmPnOVPYZi 8mif1EH5ykYNUJKwT8rB8Dh2wRSjvj7ZmPbScnMKyQ== X-Received: by 2002:a37:4bc2:: with SMTP id y185mr780220qka.10.1574376585876; Thu, 21 Nov 2019 14:49:45 -0800 (PST) MIME-Version: 1.0 References: <20191120054728.0979695C0FE4@us180.sjc.aristanetworks.com> In-Reply-To: From: Francesco Ruggeri Date: Thu, 21 Nov 2019 14:49:34 -0800 Message-ID: Subject: Re: [PATCH] ACPI: only free map once in osl.c To: Dmitry Safonov <0x7f454c46@gmail.com> Cc: lenb@kernel.org, "Rafael J. Wysocki" , open list , linux-acpi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 21, 2019 at 1:19 PM Dmitry Safonov <0x7f454c46@gmail.com> wrote: > > Hi Francesco, > > I believe, there's still an issue with your patch. > > On Wed, 20 Nov 2019 at 05:50, Francesco Ruggeri wrote: > > @@ -472,10 +477,11 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) > > mutex_unlock(&acpi_ioremap_lock); > > return; > > } > > - acpi_os_drop_map_ref(map); > > + refcount = acpi_os_drop_map_ref(map); > > mutex_unlock(&acpi_ioremap_lock); > > Here comes acpi_os_get_iomem() increasing the refcount again. Thanks Dmitry. I think that any code that increments the refcount does so after looking for map in acpi_ioremap under acpi_ioremap_lock, and the process that drops the last reference removes map from the list, also under acpi_ioremap_lock, so I am not sure this could happen. The synchronize_rcu_expedited in acpi_os_map_cleanup should then take care of any other references to map (which it is my understanding require acpi_ioremap_lock or rcu read lock). Thanks, Francesco