<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/macintosh, branch v4.19.170</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.170</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.19.170'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-06-22T07:05:29Z</updated>
<entry>
<title>drivers/macintosh: Fix memleak in windfarm_pm112 driver</title>
<updated>2020-06-22T07:05:29Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2020-04-23T06:00:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e37a469827c378afd13dae1ed3a3221ed9ff976b'/>
<id>urn:sha1:e37a469827c378afd13dae1ed3a3221ed9ff976b</id>
<content type='text'>
commit 93900337b9ac2f4eca427eff6d187be2dc3b5551 upstream.

create_cpu_loop() calls smu_sat_get_sdb_partition() which does
kmalloc() and returns the allocated buffer. In fact it's called twice,
and neither buffer is freed.

This results in a memory leak as reported by Erhard:
  unreferenced object 0xc00000047081f840 (size 32):
    comm "kwindfarm", pid 203, jiffies 4294880630 (age 5552.877s)
    hex dump (first 32 bytes):
      c8 06 02 7f ff 02 ff 01 fb bf 00 41 00 20 00 00  ...........A. ..
      00 07 89 37 00 a0 00 00 00 00 00 00 00 00 00 00  ...7............
    backtrace:
      [&lt;0000000083f0a65c&gt;] .smu_sat_get_sdb_partition+0xc4/0x2d0 [windfarm_smu_sat]
      [&lt;000000003010fcb7&gt;] .pm112_wf_notify+0x104c/0x13bc [windfarm_pm112]
      [&lt;00000000b958b2dd&gt;] .notifier_call_chain+0xa8/0x180
      [&lt;0000000070490868&gt;] .blocking_notifier_call_chain+0x64/0x90
      [&lt;00000000131d8149&gt;] .wf_thread_func+0x114/0x1a0
      [&lt;000000000d54838d&gt;] .kthread+0x13c/0x190
      [&lt;00000000669b72bc&gt;] .ret_from_kernel_thread+0x58/0x64
  unreferenced object 0xc0000004737089f0 (size 16):
    comm "kwindfarm", pid 203, jiffies 4294880879 (age 5552.050s)
    hex dump (first 16 bytes):
      c4 04 01 7f 22 11 e0 e6 ff 55 7b 12 ec 11 00 00  ...."....U{.....
    backtrace:
      [&lt;0000000083f0a65c&gt;] .smu_sat_get_sdb_partition+0xc4/0x2d0 [windfarm_smu_sat]
      [&lt;00000000b94ef7e1&gt;] .pm112_wf_notify+0x1294/0x13bc [windfarm_pm112]
      [&lt;00000000b958b2dd&gt;] .notifier_call_chain+0xa8/0x180
      [&lt;0000000070490868&gt;] .blocking_notifier_call_chain+0x64/0x90
      [&lt;00000000131d8149&gt;] .wf_thread_func+0x114/0x1a0
      [&lt;000000000d54838d&gt;] .kthread+0x13c/0x190
      [&lt;00000000669b72bc&gt;] .ret_from_kernel_thread+0x58/0x64

Fix it by rearranging the logic so we deal with each buffer
separately, which then makes it easy to free the buffer once we're
done with it.

Fixes: ac171c46667c ("[PATCH] powerpc: Thermal control for dual core G5s")
Cc: stable@vger.kernel.org # v2.6.16+
Reported-by: Erhard F. &lt;erhard_f@mailbox.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Tested-by: Erhard F. &lt;erhard_f@mailbox.org&gt;
Link: https://lore.kernel.org/r/20200423060038.3308530-1-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>macintosh: windfarm: fix MODINFO regression</title>
<updated>2020-03-18T06:14:21Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2020-03-03T12:50:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=609314331540b3b40d75d2fd049222df5797737e'/>
<id>urn:sha1:609314331540b3b40d75d2fd049222df5797737e</id>
<content type='text'>
commit bcf3588d8ed3517e6ffaf083f034812aee9dc8e2 upstream.

Commit af503716ac14 made sure OF devices get an OF style modalias with
I2C events. It assumed all in-tree users were converted, yet it missed
some Macintosh drivers.

Add an OF module device table for all windfarm drivers to make them
automatically load again.

Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=199471
Reported-by: Erhard Furtner &lt;erhard_f@mailbox.org&gt;
Tested-by: Erhard Furtner &lt;erhard_f@mailbox.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org # v4.17+
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>macintosh: therm_windtunnel: fix regression when instantiating devices</title>
<updated>2020-03-05T15:42:18Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2020-02-25T14:12:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=19b217e0e48b3ccdf43d16585b3081bf4d0b64bb'/>
<id>urn:sha1:19b217e0e48b3ccdf43d16585b3081bf4d0b64bb</id>
<content type='text'>
commit 38b17afb0ebb9ecd41418d3c08bcf9198af4349d upstream.

Removing attach_adapter from this driver caused a regression for at
least some machines. Those machines had the sensors described in their
DT, too, so they didn't need manual creation of the sensor devices. The
old code worked, though, because manual creation came first. Creation of
DT devices then failed later and caused error logs, but the sensors
worked nonetheless because of the manually created devices.

When removing attach_adaper, manual creation now comes later and loses
the race. The sensor devices were already registered via DT, yet with
another binding, so the driver could not be bound to it.

This fix refactors the code to remove the race and only manually creates
devices if there are no DT nodes present. Also, the DT binding is updated
to match both, the DT and manually created devices. Because we don't
know which device creation will be used at runtime, the code to start
the kthread is moved to do_probe() which will be called by both methods.

Fixes: 3e7bed52719d ("macintosh: therm_windtunnel: drop using attach_adapter")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=201723
Reported-by: Erhard Furtner &lt;erhard_f@mailbox.org&gt;
Tested-by: Erhard Furtner &lt;erhard_f@mailbox.org&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: stable@kernel.org # v4.19+
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>macintosh/windfarm_smu_sat: Fix debug output</title>
<updated>2019-12-01T08:16:37Z</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2018-10-15T00:18:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b0f69ccfff3a353d08ee2aa5bb3a39f701d2482d'/>
<id>urn:sha1:b0f69ccfff3a353d08ee2aa5bb3a39f701d2482d</id>
<content type='text'>
[ Upstream commit fc0c8b36d379a046525eacb9c3323ca635283757 ]

There's some antiquated debug output that's trying
to do a hand-made hexdump and turning into horrible
1-byte-per-line output these days.

Use print_hex_dump() instead

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>macintosh: therm_windtunnel: drop using attach_adapter</title>
<updated>2018-08-24T12:42:42Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2018-08-21T15:02:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3e7bed52719de4b5b5fb900869e293eae0bc3f3e'/>
<id>urn:sha1:3e7bed52719de4b5b5fb900869e293eae0bc3f3e</id>
<content type='text'>
As we now have deferred probing, we can use a custom mechanism and
finally get rid of the legacy interface from the i2c core.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>macintosh/via-pmu: Disambiguate interrupt statistics</title>
<updated>2018-07-31T09:56:43Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2018-07-02T08:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6edc22fc9cbb80fdf929df3e5b912d8c42e0ff3a'/>
<id>urn:sha1:6edc22fc9cbb80fdf929df3e5b912d8c42e0ff3a</id>
<content type='text'>
Some of the event counters are overloaded which makes it very
difficult to interpret their values.

Counter 0 is supposed to report CB1 interrupts but it can also count
PMU_INT_WAITING_CHARGER events.

Counter 1 is supposed to report GPIO interrupts but it can also count
other events (depending upon the value of the PMU_INT_ADB bit).

Disambiguate these statistics with dedicated counters for GPIO and
CB1 interrupts.

Comments in the MkLinux source code say that the type 0 and type 1
interrupts are model-specific. Label them as "unknown".

This change to the contents of /proc/pmu/interrupts is by necessity
visible in userland. However, packages which interact with the PMU
(that is, pbbuttonsd, pmac-utils and pmud) don't open this file.
AFAIK, user software has no need to poll these counters.

Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>macintosh/via-pmu: Clean up interrupt statistics</title>
<updated>2018-07-31T09:56:43Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2018-07-02T08:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b5c7cccaacdfa8d707da3e65970b15070f56df5e'/>
<id>urn:sha1:b5c7cccaacdfa8d707da3e65970b15070f56df5e</id>
<content type='text'>
Replace an open-coded ffs() with the function call.
Simplify an if-else cascade using a switch statement.
Correct a typo and an indentation issue.

Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver</title>
<updated>2018-07-31T09:56:42Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2018-07-02T08:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ebd722275f9cfc6752e29d2412fa3816ca05764b'/>
<id>urn:sha1:ebd722275f9cfc6752e29d2412fa3816ca05764b</id>
<content type='text'>
Now that the PowerMac via-pmu driver supports m68k PowerBooks,
switch over to that driver and remove the via-pmu68k driver.

Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>macintosh/via-pmu68k: Don't load driver on unsupported hardware</title>
<updated>2018-07-31T09:56:42Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2018-07-02T08:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=54c990775f78113a708f24e15877f6b7bd9a1277'/>
<id>urn:sha1:54c990775f78113a708f24e15877f6b7bd9a1277</id>
<content type='text'>
Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU
device found in those models was never supported by this driver.
Attempting to load the driver usually causes a boot hang.

Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Reviewed-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>macintosh/via-pmu: Explicitly specify CONFIG_PPC_PMAC dependencies</title>
<updated>2018-07-31T09:56:41Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2018-07-02T08:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c2f028b6a0b241d1b18d8d0ebcb13d21659dcfe7'/>
<id>urn:sha1:c2f028b6a0b241d1b18d8d0ebcb13d21659dcfe7</id>
<content type='text'>
At present, CONFIG_ADB_PMU depends on CONFIG_PPC_PMAC. When this gets
relaxed to CONFIG_PPC_PMAC || CONFIG_MAC, those Kconfig symbols with
implicit deps on PPC_PMAC will need explicit deps. Add them now.
No functional change.

Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
</feed>
