public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:ACPI COMPONENT ARCHITECTURE (ACPICA)"
	<devel@acpica.org>, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	Robert Moore <robert.moore@intel.com>,
	Erik Kaneda <erik.kaneda@intel.com>
Subject: Re: [PATCH v2 1/1] ACPI: scan: Use unique number for instance_no
Date: Fri, 19 Mar 2021 21:21:38 +0200	[thread overview]
Message-ID: <YFT5woqIyNtypwXX@smile.fi.intel.com> (raw)
In-Reply-To: <CAJZ5v0jihmos4gza_+0MzGsUfxJJ-5LGBOURVebdGsE_RuPhFA@mail.gmail.com>

On Fri, Mar 19, 2021 at 07:51:00PM +0100, Rafael J. Wysocki wrote:
> On Fri, Mar 19, 2021 at 7:33 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > Current mechanism of incrementing and decrementing plain integer
> > to get a next free instance_no when creating an ACPI device is buggy.
> >
> > The simple integer and operations line increment and decrement
> > on top of it can't cover the possible gaps during run time. The
> > arbitrary instantiation and elimination of the devices is racy
> 
> But it isn't racy AFAICS.  It always happens under acpi_device_lock().

Hmm.. indeed. I sent a v3 with the commit message based on your proposal.


> > and after a couple of iterations with unequal amount of devices
> > being added and removed we may reproduce a bug:

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2021-03-19 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 18:32 [PATCH v2 1/1] ACPI: scan: Use unique number for instance_no Andy Shevchenko
2021-03-19 18:51 ` Rafael J. Wysocki
2021-03-19 19:21   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YFT5woqIyNtypwXX@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=devel@acpica.org \
    --cc=erik.kaneda@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox