<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/acpi/sbshc.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-11-25T14:54:46Z</updated>
<entry>
<title>ACPI / SBS: Fix rare oops when removing modules</title>
<updated>2019-11-25T14:54:46Z</updated>
<author>
<name>Ronald Tschalär</name>
</author>
<published>2018-10-01T02:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=682e2ea0ca94e4cd8d244fd6c276ab3f6d9c51ab'/>
<id>urn:sha1:682e2ea0ca94e4cd8d244fd6c276ab3f6d9c51ab</id>
<content type='text'>
[ Upstream commit 757c968c442397f1249bb775a7c8c03842e3e0c7 ]

There was a small race when removing the sbshc module where
smbus_alarm() had queued acpi_smbus_callback() for deferred execution
but it hadn't been run yet, so that when it did run hc had been freed
and the module unloaded, resulting in an invalid paging request.

A similar race existed when removing the sbs module with regards to
acpi_sbs_callback() (which is called from acpi_smbus_callback()).

We therefore need to ensure no callbacks are pending or executing before
the cleanups are done and the modules are removed.

Signed-off-by: Ronald TschalÃ¤r &lt;ronald@innovation.ch&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI: sbshc: remove raw pointer from printk() message</title>
<updated>2018-02-16T19:09:47Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2018-01-19T09:06:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=591060a7a0a09cbaa5b6c04bd309966586aa9d2e'/>
<id>urn:sha1:591060a7a0a09cbaa5b6c04bd309966586aa9d2e</id>
<content type='text'>
commit 43cdd1b716b26f6af16da4e145b6578f98798bf6 upstream.

There's no need to be printing a raw kernel pointer to the kernel log at
every boot.  So just remove it, and change the whole message to use the
correct dev_info() call at the same time.

Reported-by: Wang Qize &lt;wang_qize@venustech.com.cn&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Revert "ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook"</title>
<updated>2015-11-16T22:26:45Z</updated>
<author>
<name>Chris Bainbridge</name>
</author>
<published>2015-11-12T19:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a76032e0abef027df83f7f053580aa297de54818'/>
<id>urn:sha1:a76032e0abef027df83f7f053580aa297de54818</id>
<content type='text'>
Revert commit 3349fb64b292 (ACPI / SBS: Add 5 us delay to fix SBS
hangs on MacBook), since the delay introduced by it is not necessary
any more after commit add68d6aa9e2 (ACPI / SMBus: Fix boot stalls /
high CPU caused by reentrant code).

Signed-off-by: Chris Bainbridge &lt;chris.bainbridge@gmail.com&gt;
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / SMBus: Fix boot stalls / high CPU caused by reentrant code</title>
<updated>2015-11-16T22:23:45Z</updated>
<author>
<name>Chris Bainbridge</name>
</author>
<published>2015-11-12T18:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=add68d6aa9e2492e51707ca603ada5b26c626757'/>
<id>urn:sha1:add68d6aa9e2492e51707ca603ada5b26c626757</id>
<content type='text'>
In the SBS initialisation, a reentrant call to wait_event_timeout()
causes an intermittent boot stall of several minutes usually following
the "Switching to clocksource tsc" message. Another symptom of this bug
is high CPU usage from programs (Firefox, upowerd) querying the battery
state. This is caused by:

 1. drivers/acpi/sbshc.c wait_transaction_complete() calls
    wait_event_timeout():

 	if (wait_event_timeout(hc-&gt;wait, smb_check_done(hc),
 			       msecs_to_jiffies(timeout)))

 2. ___wait_event sets task state to uninterruptible

 3. ___wait_event calls the "condition" smb_check_done()

 4. smb_check_done (sbshc.c) calls through to ec_read() in
    drivers/acpi/ec.c

 5. ec_guard() is reached which calls wait_event_timeout()

 	if (wait_event_timeout(ec-&gt;wait,
 			       ec_transaction_completed(ec),
 			       guard))

    ie. wait_event_timeout() is being called again inside evaluation of
    the previous wait_event_timeout() condition

 5. The EC IRQ handler calls wake_up() and wakes up the sleeping task in
    ec_guard()

 6. The task is now in state running even though the wait "condition" is
    still being evaluated

 7. The "condition" check returns false so ___wait_event calls
    schedule_timeout()

 8. Since the task state is running, the scheduler immediately schedules
    it again

 9. This loop usually repeats for around 250 seconds even though the
    original wait_event_timeout was only 1000ms.

    The timeout is incorrect because each call to schedule_timeout()
    usually returns immediately, taking less than 1ms, so the jiffies
    timeout counter is not decremented. The task is now stuck in a
    running state, and so is highly likely to be immediately
    rescheduled, which takes less than a jiffy. The loop will never exit
    if all schedule_timeout() calls take less than a jiffy.

Fix this by replacing SMBus reads in the wait_event_timeout condition
with checks of a boolean value that is updated by the EC query handler.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=107191
Link: https://lkml.org/lkml/2015/11/6/776
Signed-off-by: Chris Bainbridge &lt;chris.bainbridge@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook</title>
<updated>2015-04-30T21:18:11Z</updated>
<author>
<name>Chris Bainbridge</name>
</author>
<published>2015-04-29T20:21:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3349fb64b2927407017d970dd5c4daf3c5ad69f8'/>
<id>urn:sha1:3349fb64b2927407017d970dd5c4daf3c5ad69f8</id>
<content type='text'>
Commit 7bc5a2bad0b8 'ACPI: Support _OSI("Darwin") correctly' caused
the MacBook firmware to expose the SBS, resulting in intermittent
hangs of several minutes on boot, and failure to detect or report
the battery.  Fix this by adding a 5 us delay to the start of each
SMBUS transaction.  This timing is the result of experimentation -
hangs were observed with 3 us but never with 5 us.

Fixes: 7bc5a2bad0b8 'ACPI: Support _OSI("Darwin") correctly'
Link: https://bugzilla.kernel.org/show_bug.cgi?id=94651
Signed-off-by: Chris Bainbridge &lt;chris.bainbridge@gmail.com&gt;
Cc: 3.18+ &lt;stable@vger.kernel.org&gt; # 3.18+
[ rjw: Subject and changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: Clean up inclusions of ACPI header files</title>
<updated>2013-12-07T00:03:14Z</updated>
<author>
<name>Lv Zheng</name>
</author>
<published>2013-12-03T00:49:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b48463f89429af408ff695244dc627e1acff4f7'/>
<id>urn:sha1:8b48463f89429af408ff695244dc627e1acff4f7</id>
<content type='text'>
Replace direct inclusions of &lt;acpi/acpi.h&gt;, &lt;acpi/acpi_bus.h&gt; and
&lt;acpi/acpi_drivers.h&gt;, which are incorrect, with &lt;linux/acpi.h&gt;
inclusions and remove some inclusions of those files that aren't
necessary.

First of all, &lt;acpi/acpi.h&gt;, &lt;acpi/acpi_bus.h&gt; and &lt;acpi/acpi_drivers.h&gt;
should not be included directly from any files that are built for
CONFIG_ACPI unset, because that generally leads to build warnings about
undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
&lt;linux/acpi.h&gt; includes those files and for CONFIG_ACPI unset it
provides stub ACPI symbols to be used in that case.

Second, there are ordering dependencies between those files that always
have to be met.  Namely, it is required that &lt;acpi/acpi_bus.h&gt; be included
prior to &lt;acpi/acpi_drivers.h&gt; so that the acpi_pci_root declarations the
latter depends on are always there.  And &lt;acpi/acpi.h&gt; which provides
basic ACPICA type declarations should always be included prior to any other
ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
&lt;linux/acpi.h&gt; as appropriate.

Signed-off-by: Lv Zheng &lt;lv.zheng@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Matthew Garrett &lt;mjg59@srcf.ucam.org&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt; (drivers/pci stuff)
Acked-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt; (Xen stuff)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: Remove useless type argument of driver .remove() operation</title>
<updated>2013-01-25T23:37:24Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2013-01-23T23:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=51fac8388a0325a43f0ae67453ece2c373e2ec28'/>
<id>urn:sha1:51fac8388a0325a43f0ae67453ece2c373e2ec28</id>
<content type='text'>
The second argument of ACPI driver .remove() operation is only used
by the ACPI processor driver and the value passed to that driver
through it is always available from the given struct acpi_device
object's removal_type field.  For this reason, the second ACPI driver
.remove() argument is in fact useless, so drop it.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Jiang Liu &lt;jiang.liu@huawei.com&gt;
Acked-by: Toshi Kani &lt;toshi.kani@hp.com&gt;
Acked-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI/sbshc: convert to module_acpi_driver()</title>
<updated>2012-09-21T17:39:40Z</updated>
<author>
<name>Mika Westerberg</name>
</author>
<published>2012-09-07T07:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e84a239e75493c683fed7b82d440f596527a08b7'/>
<id>urn:sha1:e84a239e75493c683fed7b82d440f596527a08b7</id>
<content type='text'>
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
<entry>
<title>acpi: add module.h to files implicitly using/relying on it.</title>
<updated>2011-10-31T23:30:32Z</updated>
<author>
<name>Paul Gortmaker</name>
</author>
<published>2011-07-01T18:30:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc4b859c70e49d6a3e208c930e9eb81bea4481fd'/>
<id>urn:sha1:cc4b859c70e49d6a3e208c930e9eb81bea4481fd</id>
<content type='text'>
These files are using standard module API things like MODULE_AUTHOR
etc. and so should not be relying on an implicit presence of the
module.h header.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>sbshc: acpi_device_class "smbus_host_controller" too long</title>
<updated>2010-05-06T06:38:25Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2010-04-27T21:06:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=97c227cb51ddcf52c66f7a7fba69237026418b56'/>
<id>urn:sha1:97c227cb51ddcf52c66f7a7fba69237026418b56</id>
<content type='text'>
acpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_smbus_hc_add()
when we do:
	strcpy(acpi_device_class(device), ACPI_SMB_HC_CLASS);

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Cc: Alexey Starikovskiy &lt;astarikovskiy@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;
</content>
</entry>
</feed>
