Commit Graph

1101 Commits

Author SHA1 Message Date
Linus Torvalds
c2a96b7f18 Driver core changes for 6.11-rc1
Here is the big set of driver core changes for 6.11-rc1.
 
 Lots of stuff in here, with not a huge diffstat, but apis are evolving
 which required lots of files to be touched.  Highlights of the changes
 in here are:
   - platform remove callback api final fixups (Uwe took many releases to
     get here, finally!)
   - Rust bindings for basic firmware apis and initial driver-core
     interactions.  It's not all that useful for a "write a whole driver
     in rust" type of thing, but the firmware bindings do help out the
     phy rust drivers, and the driver core bindings give a solid base on
     which others can start their work.  There is still a long way to go
     here before we have a multitude of rust drivers being added, but
     it's a great first step.
   - driver core const api changes.  This reached across all bus types,
     and there are some fix-ups for some not-common bus types that
     linux-next and 0-day testing shook out.  This work is being done to
     help make the rust bindings more safe, as well as the C code, moving
     toward the end-goal of allowing us to put driver structures into
     read-only memory.  We aren't there yet, but are getting closer.
   - minor devres cleanups and fixes found by code inspection
   - arch_topology minor changes
   - other minor driver core cleanups
 
 All of these have been in linux-next for a very long time with no
 reported problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZqH+aQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymoOQCfVBdLcBjEDAGh3L8qHRGMPy4rV2EAoL/r+zKm
 cJEYtJpGtWX6aAtugm9E
 =ZyJV
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the big set of driver core changes for 6.11-rc1.

  Lots of stuff in here, with not a huge diffstat, but apis are evolving
  which required lots of files to be touched. Highlights of the changes
  in here are:

   - platform remove callback api final fixups (Uwe took many releases
     to get here, finally!)

   - Rust bindings for basic firmware apis and initial driver-core
     interactions.

     It's not all that useful for a "write a whole driver in rust" type
     of thing, but the firmware bindings do help out the phy rust
     drivers, and the driver core bindings give a solid base on which
     others can start their work.

     There is still a long way to go here before we have a multitude of
     rust drivers being added, but it's a great first step.

   - driver core const api changes.

     This reached across all bus types, and there are some fix-ups for
     some not-common bus types that linux-next and 0-day testing shook
     out.

     This work is being done to help make the rust bindings more safe,
     as well as the C code, moving toward the end-goal of allowing us to
     put driver structures into read-only memory. We aren't there yet,
     but are getting closer.

   - minor devres cleanups and fixes found by code inspection

   - arch_topology minor changes

   - other minor driver core cleanups

  All of these have been in linux-next for a very long time with no
  reported problems"

* tag 'driver-core-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits)
  ARM: sa1100: make match function take a const pointer
  sysfs/cpu: Make crash_hotplug attribute world-readable
  dio: Have dio_bus_match() callback take a const *
  zorro: make match function take a const pointer
  driver core: module: make module_[add|remove]_driver take a const *
  driver core: make driver_find_device() take a const *
  driver core: make driver_[create|remove]_file take a const *
  firmware_loader: fix soundness issue in `request_internal`
  firmware_loader: annotate doctests as `no_run`
  devres: Correct code style for functions that return a pointer type
  devres: Initialize an uninitialized struct member
  devres: Fix memory leakage caused by driver API devm_free_percpu()
  devres: Fix devm_krealloc() wasting memory
  driver core: platform: Switch to use kmemdup_array()
  driver core: have match() callback in struct bus_type take a const *
  MAINTAINERS: add Rust device abstractions to DRIVER CORE
  device: rust: improve safety comments
  MAINTAINERS: add Danilo as FIRMWARE LOADER maintainer
  MAINTAINERS: add Rust FW abstractions to FIRMWARE LOADER
  firmware: rust: improve safety comments
  ...
2024-07-25 10:42:22 -07:00
Takashi Sakamoto
06dcc4c9ba firewire: core: move copy_port_status() helper function to TP_fast_assign() block
It would be possible to put any statement in TP_fast_assign().

This commit obsoletes the helper function and put its statements to
TP_fast_assign() for the code simplicity.

Link: https://lore.kernel.org/r/20240712003010.87341-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-12 14:34:12 +09:00
Takashi Sakamoto
9f349e8e53 Revert "firewire: ohci: use common macro to interpret be32 data in le32 buffer"
This reverts commit f26a38e61c, since it
causes the following sparse warnings:

sparse warnings: (new ones prefixed by >>)
>> drivers/firewire/ohci.c:891:23: sparse: sparse: cast to restricted __be32
>> drivers/firewire/ohci.c:891:23: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:892:23: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:892:23: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:893:23: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:893:23: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:905:31: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:905:31: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:914:31: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:914:31: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:939:18: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:939:18: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:2033:23: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:2033:23: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:2037:27: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:2037:27: sparse: sparse: cast from restricted __le32
   drivers/firewire/ohci.c:2038:27: sparse: sparse: cast to restricted __be32
   drivers/firewire/ohci.c:2038:27: sparse: sparse: cast from restricted __le32

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407050656.03bw1YXA-lkp@intel.com/
Link: https://lore.kernel.org/r/20240707134523.11784-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-08 06:42:39 +09:00
Takashi Sakamoto
526e21a2aa firewire: ohci: add tracepoints event for data of Self-ID DMA
In 1394 OHCI, the SelfIDComplete event occurs when the hardware has
finished transmitting all of the self ID packets received during the bus
initialization process to the host memory by DMA.

This commit adds a tracepoints event for this event to trace the timing
and packet data of Self-ID DMA. It is the part of following tracepoints
events helpful to debug some events at bus reset; e.g. the issue addressed
at a commit d0b06dc48f ("firewire: core: use long bus reset on gap count
error")[1]:

* firewire_ohci:irqs
* firewire_ohci:self_id_complete
* firewire:bus_reset_handle
* firewire:self_id_sequence

They would be also helpful in the problem about invocation timing of
hardIRQ and process (workqueue) contexts. We can often see this kind of
problem with -rt kernel[2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d0b06dc48fb1
[2] https://lore.kernel.org/linux-rt-users/YAwPoaUZ1gTD5y+k@hmbx/

Link: https://lore.kernel.org/r/20240702222034.1378764-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-04 09:07:14 +09:00
Takashi Sakamoto
4a13617ef3 firewire: ohci: use inline functions to operate data of self-ID DMA
The code of 1394 OHCI driver includes hard-coded magic number to operate
data of Self-ID DMA.

This commit replaces them with the inline functions added/tested in the
former commit.

Link: https://lore.kernel.org/r/20240702222034.1378764-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-04 08:12:48 +09:00
Takashi Sakamoto
7a14f78d70 firewire: ohci: add static inline functions to deserialize for Self-ID DMA operation
The SelfI-ID is one type of DMAs defined in 1394 OHCI specification. It is
operated by two registers, one interrupt, and has one format of buffer.

This commit adds some static inline functions to deserialize the data in
the buffer and registers. Some KUnit tests are also added to check their
reliability.

Link: https://lore.kernel.org/r/20240702222034.1378764-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-04 08:12:48 +09:00
Takashi Sakamoto
c538b06de6 firewire: ohci: use static function to handle endian issue on PowerPC platform
It is preferable to use static function instead of functional macro in
some points. It checks type of argument, but would be optimized to
embedded code instead of function calls.

This commit obsoletes the functional macro with the static function.
Additionally this commit refactors quirk detection to ease the later work.

Link: https://lore.kernel.org/r/20240702222034.1378764-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-04 08:12:48 +09:00
Takashi Sakamoto
f26a38e61c firewire: ohci: use common macro to interpret be32 data in le32 buffer
The 1394 OHCI driver configures the hardware to transfer the data quadlets
of packet via DMA after converting it to little endian, therefore the data
is typed as __le32. Nevertheless some actual hardware ignores the
configuration. In the case, the data in DMA buffer is aligned to big endian
(__be32).

For the case in big-endian machine, the driver includes the following
interpretation from __le32 to u32 (host-endian = __be32):

    * (__force __u32)(v)

In include/linux/byteorder/generic.h, be32_to_cpu() is available. It is
expanded to the following expression in
'include/uapi/linux/byteorder/big_endian.h':

    * (__force __u32)(__be32)(x)

This commit replace the ad-hoc endian interpretation with the above.

Link: https://lore.kernel.org/r/20240702222034.1378764-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-07-04 08:12:48 +09:00
Greg Kroah-Hartman
d69d804845 driver core: have match() callback in struct bus_type take a const *
In the match() callback, the struct device_driver * should not be
changed, so change the function callback to be a const *.  This is one
step of many towards making the driver core safe to have struct
device_driver in read-only memory.

Because the match() callback is in all busses, all busses are modified
to handle this properly.  This does entail switching some container_of()
calls to container_of_const() to properly handle the constant *.

For some busses, like PCI and USB and HV, the const * is cast away in
the match callback as those busses do want to modify those structures at
this point in time (they have a local lock in the driver structure.)
That will have to be changed in the future if they wish to have their
struct device * in read-only-memory.

Cc: Rafael J. Wysocki <rafael@kernel.org>
Reviewed-by: Alex Elder <elder@kernel.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Link: https://lore.kernel.org/r/2024070136-wrongdoer-busily-01e8@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-03 15:16:54 +02:00
Takashi Sakamoto
0d8914165d firewire: ohci: add tracepoints event for hardIRQ event
1394 OHCI hardware triggers PCI interrupts to notify any events to
software. Current driver for the hardware is programmed by the typical
way to utilize top- and bottom- halves, thus it has a timing gap to handle
the notification in softIRQ (tasklet).

This commit adds a tracepoint event for the hardIRQ event. The comparison
of the tracepoint event to tracepoints events in firewire subsystem is
helpful to diagnose the timing gap.

Link: https://lore.kernel.org/r/20240625031806.956650-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 21:49:43 +09:00
Takashi Sakamoto
001c1ff5dc firewire: ohci: add support for Linux kernel tracepoints
The Linux Kernel Tracepoints framework is enough useful to trace the
interaction between 1394 OHCI hardware and its driver.

This commit adds firewire_ohci subsystem to use the framework. It is
defined as the different subsystem from the existing firewire subsystem.
The definition file for the existing subsystem is slightly changed so that
both subsystems are available in 1394 OHCI driver.

Link: https://lore.kernel.org/r/20240625031806.956650-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 21:49:43 +09:00
Takashi Sakamoto
daf763c2d6 firewire: core: add tracepoints events for completions of packets in isochronous context
It is helpful to trace completion of packets in isochronous context when
the core function is requested them by both in-kernel units driver and
userspace applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:39 +09:00
Takashi Sakamoto
1f3c0d794d firewire: core: add tracepoints events for queueing packets of isochronous context
It is helpful to trace the queueing packets of isochronous context when
the core function is requested them by both in-kernel unit drivers and
userspace applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:38 +09:00
Takashi Sakamoto
8320b63e02 firewire: core: add tracepoints events for flushing completions of isochronous context
It is helpful to trace the flushing completions of isochronous context when
the core function is requested them by both in-kernel unit drivers and
userspace applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:38 +09:00
Takashi Sakamoto
c0b0ce6c47 firewire: core: add tracepoints events for flushing of isochronous context
It is helpful to trace the flushing of isochronous context when the core
function is requested them by both in-kernel unit drivers and userspace
applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:38 +09:00
Takashi Sakamoto
4e64210f67 firewire: core: add tracepoints events for starting/stopping of isochronous context
It is helpful to trace the starting and stopping of isochronous context
when the core function is requested them by both in-kernel unit drivers
and userspace applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:38 +09:00
Takashi Sakamoto
9f16ac725b firewire: core: add tracepoints events for setting channels of multichannel context
It is helpful to trace the channel setting for the multichannel isochronous
context when the core function is requested it by both in-kernel unit
drivers and userspace applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:38 +09:00
Takashi Sakamoto
25e6e00d3f firewire: core: add tracepoints events for allocation/deallocation of isochronous context
It is helpful to trace the allocation and dealocation of isochronous
when the core function is requested them by both in-kernel unit drivers
and userspace applications.

This commit adds some tracepoints events for the aim.

Link: https://lore.kernel.org/r/20240623220859.851685-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-25 07:31:38 +09:00
Takashi Sakamoto
2fd22faf0e firewire: core: record card index in tracepoints event for self ID sequence
This patch is for for-next branch.

The selfIDComplete event occurs in the bus managed by one of 1394 OHCI
controller in Linux system, while the existing tracepoints events has
the lack of data about it to distinguish the issued hardware from the
others.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240614004251.460649-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:04 +09:00
Takashi Sakamoto
67e51784c1 firewire: core: use inline helper functions to serialize phy config packet
This commit uses the added helper functions to obsolete the existing
implementation for phy configuration packet.

Link: https://lore.kernel.org/r/20240606235133.231543-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:04 +09:00
Takashi Sakamoto
75d47101fa firewire: core: add tests for serialization/deserialization of phy config packet
In the protocol of IEEE 1394, phy configuration packet is broadcasted to
the bus to configure all PHYs residing on the bus. It includes two
purposes; selecting root node and optimizing gap count.

This commit adds some helper function to serialize/deserialize the
content of phy configuration packet, as well as some KUnit tests for it.

Link: https://lore.kernel.org/r/20240606235133.231543-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
677ceae190 firewire: core: add tracepoints event for self_id_sequence
It is helpful to trace the content of self ID sequence when the core
function building bus topology.

This commit adds a tracepoints event fot the purpose. It seems not to
achieve printing variable length of array in print time without any
storage, thus the structure of event includes a superfluous array to store
the state of port. Additionally, there is no helper function to print
symbol array, thus the state of port is printed as raw value.

Link: https://lore.kernel.org/r/20240605235155.116468-12-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
1ccfd1a4c8 firewire: core: arrangement header inclusion for tracepoints events
It is a bit inconvenient to put the relative path to local header from
tree-wide header.

This commit delegates the selection to include headers into users.

Link: https://lore.kernel.org/r/20240605235155.116468-11-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
f9a228364e firewire: ohci: use helper inline functions to serialize/deserialize self ID packet
This commit replaces the existing implementation with the helper
functions for self ID packet.

Link: https://lore.kernel.org/r/20240605235155.116468-10-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
8f035147f0 firewire: core: use helper inline functions to deserialize self ID packet
This commit replaces the existing implementation with the helper
functions for self ID packet.

Link: https://lore.kernel.org/r/20240605235155.116468-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
baf9d20b99 firewire: core: add common inline functions to serialize/deserialize self ID packet
Within FireWire subsystem, the serializations and deserializations of phy
packet are implemented in several parts. They includes some redundancies.

This commit adds a series of helper functions for the serializations and
deserializations of self ID packet with a Kunit test suite.

Link: https://lore.kernel.org/r/20240605235155.116468-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
a16931ac6d firewire: ohci: use helper functions for self ID sequence
This commit replaces the existing implementation with the helper
functions for self ID sequence.

Link: https://lore.kernel.org/r/20240605235155.116468-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
24b7f8e5cd firewire: core: use helper functions for self ID sequence
This commit replaces the existing implementation with the helper
functions for self ID sequence.

Link: https://lore.kernel.org/r/20240605235155.116468-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
e404cacfc5 firewire: ohci: minor code refactoring for self ID logging
Current implementation to log self ID sequence has the rest to be
refactored; e.g. moving translation-unit level variables to the
dependent block.

This commit is for the purpose.

Link: https://lore.kernel.org/r/20240605235155.116468-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
10f5aee037 firewire: core: minor code refactoring for topology builder
Current implementation to build tree according to self ID sequences has
the rest to be refactored; e.g. putting local variables into block.

This commit is for the purpose.

Link: https://lore.kernel.org/r/20240605235155.116468-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:03 +09:00
Takashi Sakamoto
93389767da firewire: core: add helper function to handle port status from self ID sequence and its KUnit test
The self ID sequence delivers the information about the state of port.

This commit adds some enumerations to express the state of port, and
some helper functions to handle the state. It adds a KUnit test for them,
too.

Link: https://lore.kernel.org/r/20240605235155.116468-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:02 +09:00
Takashi Sakamoto
7bd10e0e3a firewire: core: add enumerator of self ID sequences and its KUnit test
When the state of bus reset finishes, 1394 OHCI driver constructs self ID
sequences, then it calls fw_core_handle_bus_reset() in core function. The
core function enumerates the self ID sequences to build bus topology.

This commit adds a structure and some helper functions for the enumeration,
and adds a KUnit test suite to ensure its expected behaviour.

Link: https://lore.kernel.org/r/20240605235155.116468-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-17 08:37:02 +09:00
Takashi Sakamoto
893098b2af firewire: core: record card index in bus_reset_handle tracepoints event
The bus reset event occurs in the bus managed by one of 1394 OHCI
controller in Linux system, however the existing tracepoints events has
the lack of data about it to distinguish the issued hardware from the
others.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:26 +09:00
Takashi Sakamoto
7507dbc46b firewire: core: record card index in tracepoinrts events derived from bus_reset_arrange_template
The asynchronous transmission of phy packet is initiated on one of 1394
OHCI controller, however the existing tracepoints events has the lack of
data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
abbb4bd96d firewire: core: record card index in async_phy_inbound tracepoints event
The asynchronous transmission of phy packet is initiated on one of 1394
OHCI controller, however the existing tracepoints events has the lack of
data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
810f2aa835 firewire: core: record card index in async_phy_outbound_complete tracepoints event
The asynchronous transmission of phy packet is initiated on one of 1394
OHCI controller, however the existing tracepoints events has the lack of
data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
3cb44a72a3 firewire: core: record card index in async_phy_outbound_initiate tracepoints event
The asynchronous transaction is initiated on one of 1394 OHCI
controller, however the existing tracepoints events has the lack of data
about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
65ec7ebefe firewire: core: record card index in tracepoinrts events derived from async_inbound_template
The asynchronous transaction is initiated on one of 1394 OHCI controller,
however the existing tracepoints events has the lack of data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
64e02b64fb firewire: core: record card index in tracepoinrts events derived from async_outbound_initiate_template
The asynchronous transaction is initiated on one of 1394 OHCI controller,
however the existing tracepoints events has the lack of data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
e7da16abf0 firewire: core: record card index in tracepoinrts events derived from async_outbound_complete_template
The asynchronous transaction is initiated on one of 1394 OHCI controller,
however the existing tracepoints events has the lack of data about it.

This commit adds card_index member into event structure to store the index
of host controller in use, and prints it.

Link: https://lore.kernel.org/r/20240613131440.431766-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:17 +09:00
Takashi Sakamoto
e789523fe2 firewire: fix website URL in Kconfig
The wiki in kernel.org is no longer updated. This commit replaces the
website URL with the latest one.

Link: https://lore.kernel.org/r/20240613090343.416198-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-06-15 14:59:04 +09:00
Jeff Johnson
f94b77709e firewire: add missing MODULE_DESCRIPTION() to test modules
Fix the 'make W=1' warnings:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/firewire/uapi-test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/firewire/packet-serdes-test.o

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240523-md-firewire-uapi-test-v1-1-6be5adcc3aed@quicinc.com
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-27 07:34:58 +09:00
Linus Torvalds
b850dc206a firewire updates for v6.10
During the development period of v6.8 kernel, it became evident that there
 was a lack of helper utilities to trace the initial state of bus, while
 investigating certain PHYs compliant with different versions of IEEE 1394
 specification.
 
 This series of changes includes the addition of tracepoints events,
 provided by 'firewire' subsystem. These events enable tracing of how
 firewire core functions during bus reset and asynchronous communication
 over IEEE 1394 bus.
 
 When implementing the tracepoints events, it was found that the existing
 serialization and deserialization helpers for several types of
 asynchronous packets are scattered across both firewire-core and
 firewire-ohci kernel modules. A set of inline functions is newly added
 to address it, along with some KUnit tests, serving as the foundation for
 the tracepoints events. This renders the dispersed code obsolete.
 
 The remaining changes constitute the final steps in phasing out the usage
 of deprecated PCI MSI APIs, in continuation from the previous version.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQE66IEYNDXNBPeGKSsLtaWM8LwEwUCZkM2QAAKCRCsLtaWM8Lw
 E44iAP9BWtYRNqRVR6eg+auUYro0ce5+0R5lmkfb7kkgv3AS7QEAsJjev7uF5Hfb
 kpCCFC8Imb29govdgH8sPT2lYdSk4AM=
 =78E1
 -----END PGP SIGNATURE-----

Merge tag 'firewire-updates-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire updates from Takashi Sakamoto:
 "During the development period of v6.8 kernel, it became evident that
  there was a lack of helper utilities to trace the initial state of
  bus, while investigating certain PHYs compliant with different
  versions of IEEE 1394 specification.

  This series of changes includes the addition of tracepoints events,
  provided by 'firewire' subsystem. These events enable tracing of how
  firewire core functions during bus reset and asynchronous
  communication over IEEE 1394 bus.

  When implementing the tracepoints events, it was found that the
  existing serialization and deserialization helpers for several types
  of asynchronous packets are scattered across both firewire-core and
  firewire-ohci kernel modules. A set of inline functions is newly added
  to address it, along with some KUnit tests, serving as the foundation
  for the tracepoints events. This renders the dispersed code obsolete.

  The remaining changes constitute the final steps in phasing out the
  usage of deprecated PCI MSI APIs, in continuation from the previous
  version"

* tag 'firewire-updates-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: (29 commits)
  firewire: obsolete usage of *-objs in Makefile for KUnit test
  firewire: core: remove flag and width from u64 formats of tracepoints events
  firewire: core: fix type of timestamp for async_inbound_template tracepoints events
  firewire: core: add tracepoint event for handling bus reset
  Revert "firewire: core: option to log bus reset initiation"
  firewire: core: add tracepoints events for initiating bus reset
  firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug module parameter
  firewire: ohci: add bus-reset event for initial set of handled irq
  firewire: core: add tracepoints event for asynchronous inbound phy packet
  firewire: core/cdev: add tracepoints events for asynchronous phy packet
  firewire: core: add tracepoints events for asynchronous outbound response
  firewire: core: add tracepoint event for asynchronous inbound request
  firewire: core: add tracepoints event for asynchronous inbound response
  firewire: core: add tracepoints events for asynchronous outbound request
  firewire: core: add support for Linux kernel tracepoints
  firewire: core: replace local macros with common inline functions for isochronous packet header
  firewire: core: add common macro to serialize/deserialize isochronous packet header
  firewire: core: obsolete tcode check macros with inline functions
  firewire: ohci: replace hard-coded values with common macros
  firewire: ohci: replace hard-coded values with inline functions for asynchronous packet header
  ...
2024-05-14 18:57:22 -07:00
Linus Torvalds
113d1dd9c8 SCSI misc on 20240514
Updates to the usual drivers (ufs, lpfc, qla2xxx, mpi3mr, libsas).
 The major update (which causes a conflict with block, see below) is
 Christoph removing the queue limits and their associated block
 helpers.  The remaining patches are assorted minor fixes and
 deprecated function updates plus a bit of constification.
 
 Signed-off-by: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCZkOnWyYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishYe7AP93XRN/
 xnccJbSTTUL4FFGobq2CYXv58Na+FM/b/+/kEAD+PNi0LmHDdDTOaFUblMd9l4lj
 mpvYLRvJ6ifnHX6WXAg=
 =PVnL
 -----END PGP SIGNATURE-----

Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (ufs, lpfc, qla2xxx, mpi3mr, libsas).

  The major update (which causes a conflict with block, see below) is
  Christoph removing the queue limits and their associated block
  helpers.

  The remaining patches are assorted minor fixes and deprecated function
  updates plus a bit of constification"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (141 commits)
  scsi: mpi3mr: Sanitise num_phys
  scsi: lpfc: Copyright updates for 14.4.0.2 patches
  scsi: lpfc: Update lpfc version to 14.4.0.2
  scsi: lpfc: Add support for 32 byte CDBs
  scsi: lpfc: Change lpfc_hba hba_flag member into a bitmask
  scsi: lpfc: Introduce rrq_list_lock to protect active_rrq_list
  scsi: lpfc: Clear deferred RSCN processing flag when driver is unloading
  scsi: lpfc: Update logging of protection type for T10 DIF I/O
  scsi: lpfc: Change default logging level for unsolicited CT MIB commands
  scsi: target: Remove unused list 'device_list'
  scsi: iscsi: Remove unused list 'connlist_err'
  scsi: ufs: exynos: Add support for Tensor gs101 SoC
  scsi: ufs: exynos: Add some pa_dbg_ register offsets into drvdata
  scsi: ufs: exynos: Allow max frequencies up to 267Mhz
  scsi: ufs: exynos: Add EXYNOS_UFS_OPT_TIMER_TICK_SELECT option
  scsi: ufs: exynos: Add EXYNOS_UFS_OPT_UFSPR_SECURE option
  scsi: ufs: dt-bindings: exynos: Add gs101 compatible
  scsi: qla2xxx: Fix debugfs output for fw_resource_count
  scsi: qedf: Ensure the copied buf is NUL terminated
  scsi: bfa: Ensure the copied buf is NUL terminated
  ...
2024-05-14 18:25:53 -07:00
Takashi Sakamoto
21151fd8f0 firewire: obsolete usage of *-objs in Makefile for KUnit test
Nowadays *-objs list is just for user space programs.

This commit obsolete the usage, and simplify Makefile for firewire KUnit
tests since the tests are not composite objects.

Link: https://lore.kernel.org/r/20240508105351.532693-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-09 08:06:22 +09:00
Takashi Sakamoto
6b0b708f12 firewire: core: add tracepoint event for handling bus reset
The core function expects hardware drivers to call
fw_core_handle_bus_reset() when changing bus topology. The 1394 OHCI
driver calls it when handling selfID event as a result of any bus-reset.

This commit adds a tracepoints event for it.

Link: https://lore.kernel.org/r/20240501073238.72769-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:06 +09:00
Takashi Sakamoto
01d860427f Revert "firewire: core: option to log bus reset initiation"
This reverts commit 6732491243.

The former commit adds some alternative tracepoints events to replace the
reverted kernel log messages.

Link: https://lore.kernel.org/r/20240501073238.72769-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:06 +09:00
Takashi Sakamoto
08dd8602aa firewire: core: add tracepoints events for initiating bus reset
At a commit 6732491243 ("firewire: core: option to log bus reset
initiation"), some kernel log messages were added to trace initiation of
bus reset. The kernel log messages are really helpful, while nowadays it
is not preferable just for debugging purpose. For the purpose, Linux
kernel tracepoints is more preferable.

This commit adds some alternative tracepoints events.

Link: https://lore.kernel.org/r/20240501073238.72769-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:06 +09:00
Takashi Sakamoto
42374303b7 firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug module parameter
The OHCI_PARAM_DEBUG_BUSRESETS bit of debug module parameter was added at
a commit a007bb857e ("firewire: fw-ohci: conditionally log busReset
interrupts").

At the former commit, the bit becomes less meaningful, just to skip
logging.

This commit obsoletes it.

Link: https://lore.kernel.org/r/20240501073238.72769-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:06 +09:00
Takashi Sakamoto
0d12f095b4 firewire: ohci: add bus-reset event for initial set of handled irq
In the former commits, the spurious interrupt events are suppressed as
possible, by unset bus-reset event from the set of handled irq. The change
was written with the less-intrusive style, thus it firstly works at the
second time to handle the event. But it is slightly inconvenient.

This commit adds the event for the initial set of irq to handle. As a
result, the event can be handled even if it is the first time. The change
has a benefit that the OHCI_PARAM_DEBUG_BUSRESETS bit in debug module
parameter is always effective.

Tested-by: Adam Goldman <adamg@pobox.com>
Link: https://lore.kernel.org/r/20240501073238.72769-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:06 +09:00