<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/spmi/spmi.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-05-17T09:35:49Z</updated>
<entry>
<title>spmi: Add a check for remove callback when removing a SPMI driver</title>
<updated>2023-05-17T09:35:49Z</updated>
<author>
<name>Jishnu Prakash</name>
</author>
<published>2023-04-13T22:38:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54dda732225555dc6d660e95793c54a0a44b612c'/>
<id>urn:sha1:54dda732225555dc6d660e95793c54a0a44b612c</id>
<content type='text'>
[ Upstream commit b56eef3e16d888883fefab47425036de80dd38fc ]

When removing a SPMI driver, there can be a crash due to NULL pointer
dereference if it does not have a remove callback defined. This is
one such call trace observed when removing the QCOM SPMI PMIC driver:

 dump_backtrace.cfi_jt+0x0/0x8
 dump_stack_lvl+0xd8/0x16c
 panic+0x188/0x498
 __cfi_slowpath+0x0/0x214
 __cfi_slowpath+0x1dc/0x214
 spmi_drv_remove+0x16c/0x1e0
 device_release_driver_internal+0x468/0x79c
 driver_detach+0x11c/0x1a0
 bus_remove_driver+0xc4/0x124
 driver_unregister+0x58/0x84
 cleanup_module+0x1c/0xc24 [qcom_spmi_pmic]
 __do_sys_delete_module+0x3ec/0x53c
 __arm64_sys_delete_module+0x18/0x28
 el0_svc_common+0xdc/0x294
 el0_svc+0x38/0x9c
 el0_sync_handler+0x8c/0xf0
 el0_sync+0x1b4/0x1c0

If a driver has all its resources allocated through devm_() APIs and
does not need any other explicit cleanup, it would not require a
remove callback to be defined. Hence, add a check for remove callback
presence before calling it when removing a SPMI driver.

Link: https://lore.kernel.org/r/1671601032-18397-2-git-send-email-quic_jprakash@quicinc.com
Fixes: 6f00f8c8635f ("mfd: qcom-spmi-pmic: Use devm_of_platform_populate()")
Fixes: 5a86bf343976 ("spmi: Linux driver framework for SPMI")
Signed-off-by: Jishnu Prakash &lt;quic_jprakash@quicinc.com&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Link: https://lore.kernel.org/r/20230413223834.4084793-7-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284</title>
<updated>2019-06-05T15:36:37Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2019-05-29T14:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=97fb5e8d9b57f10f294303c9a5d1bd033eded6bf'/>
<id>urn:sha1:97fb5e8d9b57f10f294303c9a5d1bd033eded6bf</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 and
  only version 2 as published by the free software foundation this
  program is distributed in the hope that it will be useful but
  without any warranty without even the implied warranty of
  merchantability or fitness for a particular purpose see the gnu
  general public license for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 294 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141900.825281744@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: Convert to using %pOF instead of full_name</title>
<updated>2017-08-28T11:51:20Z</updated>
<author>
<name>Rob Herring</name>
</author>
<published>2017-07-18T21:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e55fe64a198d2657e24f9fca5cd6e7e7f13e0b2f'/>
<id>urn:sha1:e55fe64a198d2657e24f9fca5cd6e7e7f13e0b2f</id>
<content type='text'>
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: Include OF based modalias in device uevent</title>
<updated>2017-07-17T13:00:47Z</updated>
<author>
<name>Bjorn Andersson</name>
</author>
<published>2017-06-29T21:46:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d50daa2af2618dab6d21634e65a5fbcf4ae437d6'/>
<id>urn:sha1:d50daa2af2618dab6d21634e65a5fbcf4ae437d6</id>
<content type='text'>
Include the OF-based modalias in the uevent sent when registering SPMI
devices, so that user space has a chance to autoload the kernel module
for the device.

Tested-by: Rob Clark &lt;robdclark@gmail.com&gt;
Reported-by: Rob Clark &lt;robdclark@gmail.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: do not use bus internal data</title>
<updated>2016-04-30T21:15:56Z</updated>
<author>
<name>Sudip Mukherjee</name>
</author>
<published>2016-03-07T11:35:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47f55b74cfb28cbd3328ffd5c4c0f7a14da36498'/>
<id>urn:sha1:47f55b74cfb28cbd3328ffd5c4c0f7a14da36498</id>
<content type='text'>
The variable p is a data structure which is used by the driver core
internally and it is not expected that busses will be directly accessing
these driver core internal only data.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: Auto-populate driver.owner in spmi_driver_register()</title>
<updated>2015-09-21T02:32:02Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2015-09-10T22:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff6f46483f0e14b829cd5a71bafcbb1c136a84b6'/>
<id>urn:sha1:ff6f46483f0e14b829cd5a71bafcbb1c136a84b6</id>
<content type='text'>
Populate the owner field of the spmi driver when
spmi_driver_register() is called in a similar fashion to how
other *_driver_register() functions do it. This saves driver
writers from having to do this themselves.

Cc: Andy Gross &lt;agross@codeaurora.org&gt;
Cc: Gilad Avidov &lt;gavidov@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: add command tracepoints for SPMI</title>
<updated>2015-08-05T19:27:09Z</updated>
<author>
<name>Ankit Gupta</name>
</author>
<published>2015-06-22T22:38:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a9fce374815d8ab94a3e6259802a944e2cc21408'/>
<id>urn:sha1:a9fce374815d8ab94a3e6259802a944e2cc21408</id>
<content type='text'>
Add tracepoints to retrieve information about read, write
and non-data commands. For performance measurement support
tracepoints are added at the beginning and at the end of
transfers. Following is a list showing the new tracepoint
events. The "cmd" parameter here represents the opcode, SID,
and full 16-bit address.

spmi_write_begin: cmd and data buffer.
spmi_write_end  : cmd and return value.
spmi_read_begin : cmd.
spmi_read_end   : cmd, return value and data buffer.
spmi_cmd        : cmd.

The reason that cmd appears at both the beginning and at
the end event is that SPMI drivers can request commands
concurrently. cmd helps in matching the corresponding
events.

SPMI tracepoints can be enabled like:

echo 1 &gt;/sys/kernel/debug/tracing/events/spmi/enable

and will dump messages that can be viewed in
/sys/kernel/debug/tracing/trace that look like:

... spmi_read_begin: opc=56 sid=00 addr=0x0000
... spmi_read_end: opc=56 sid=00 addr=0x0000 ret=0 len=02 buf=0x[01-40]
... spmi_write_begin: opc=48 sid=00 addr=0x0000 len=3 buf=0x[ff-ff-ff]

Suggested-by: Sagar Dharia &lt;sdharia@codeaurora.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Gilad Avidov &lt;gavidov@codeaurora.org&gt;
Signed-off-by: Ankit Gupta &lt;ankgupta@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: remove wakeup command before slave probe</title>
<updated>2015-03-26T22:51:36Z</updated>
<author>
<name>Gilad Avidov</name>
</author>
<published>2015-03-25T17:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0b9641f5722a9c08cacb534d633ff469ab02a288'/>
<id>urn:sha1:0b9641f5722a9c08cacb534d633ff469ab02a288</id>
<content type='text'>
According to spmi spec a slave powers up into startup state and then
transitions into active state. Thus, the wakeup command is not required
before calling the slave's probe. The wakeup command is only needed for
slaves that are in sleep state after receiving the sleep command.

Cc: galak@codeaurora.org
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Reviewed-by: Sagar Dharia &lt;sdharia@codeaurora.org&gt;
Acked-by: Josh Cartwright &lt;joshc@eso.teric.us&gt;
Signed-off-by: Gilad Avidov &lt;gavidov@codeaurora.org&gt;
Tested-by: Ivan T. Ivanov &lt;iivanov@mm-sol.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: Remove duplicate inclusion of module.h</title>
<updated>2014-07-10T22:22:13Z</updated>
<author>
<name>Sachin Kamat</name>
</author>
<published>2014-06-23T11:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f8a1031eeaf2a7e2994cd39086793270aff0a44'/>
<id>urn:sha1:6f8a1031eeaf2a7e2994cd39086793270aff0a44</id>
<content type='text'>
module.h was included twice.

Signed-off-by: Sachin Kamat &lt;sachin.kamat@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spmi: pm: drop bus-level PM suspend/resume routines</title>
<updated>2014-03-09T06:15:52Z</updated>
<author>
<name>Josh Cartwright</name>
</author>
<published>2014-03-03T16:49:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=442d40a28ea8584771118b9af48127ef1d1ca9cb'/>
<id>urn:sha1:442d40a28ea8584771118b9af48127ef1d1ca9cb</id>
<content type='text'>
SPMI defines the behavior of a device in the "SLEEP" state as being
"user-defined or specified by the device manufacturer".  Without
clearly-defined bus-level semantics for low-power states, push the
responsibility of transitioning a device into/out of "SLEEP" into SPMI
device drivers.

Cc: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Josh Cartwright &lt;joshc@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
