Commit Graph

1078 Commits

Author SHA1 Message Date
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
Takashi Sakamoto
eec045c571 firewire: core: add tracepoints event for asynchronous inbound phy packet
At the former commit, a pair of tracepoints events is added to trace
asynchronous outbound phy packet. This commit adds a tracepoints event
to trace inbound phy packet. It includes transaction status as well as
the content of phy packet.

This is an example for Remote Reply Packet as a response to Remote Access
Packet sent by lsfirewirephy command in linux-firewire-utils:

async_phy_inbound: \
  packet=0xffff955fc02b4e10 generation=1 status=1 timestamp=0x0619 \
  first_quadlet=0x001c8208 second_quadlet=0xffe37df7

Link: https://lore.kernel.org/r/20240430001404.734657-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
1a4c53cf35 firewire: core/cdev: add tracepoints events for asynchronous phy packet
In IEEE 1394 bus, the type of asynchronous packet without any offset to
node address space is called as phy packet. The destination of packet is
IEEE 1394 phy itself. This type of packet is used for several purposes,
mainly for selfID at the state of bus reset, to force selection of root
node, and to adjust gap count.

This commit adds tracepoints events for the type of asynchronous outbound
packet. Like asynchronous outbound transaction packets, a pair of events
are added to trace initiation and completion of transmission.

In the case that the phy packet is sent by kernel API, the match between
the initiation and completion is not so easy, since the data of
'struct fw_packet' is allocated statically. In the case that it is sent by
userspace applications via cdev, the match is easy, since the data is
allocated per each.

This example is for Remote Access Packet by lsfirewirephy command in
linux-firewire-utils:

async_phy_outbound_initiate: \
  packet=0xffff89fb34e42e78 generation=1 first_quadlet=0x00148200 \
  second_quadlet=0xffeb7dff
async_phy_outbound_complete: \
  packet=0xffff89fb34e42e78 generation=1 status=1 timestamp=0x0619

Link: https://lore.kernel.org/r/20240430001404.734657-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
624a8535f7 firewire: core: add tracepoints events for asynchronous outbound response
In a view of core transaction service, the asynchronous outbound response
consists of two stages; initiation and completion.

This commit adds a pair of events for the asynchronous outbound response.
The following example is for asynchronous write quadlet request as IEC
61883-1 FCP response to node 0xffc1.

async_response_outbound_initiate: \
  transaction=0xffff89fa08cf16c0 generation=4 scode=2 dst_id=0xffc1 \
  tlabel=25 tcode=2 src_id=0xffc0 rcode=0 \
  header={0xffc16420,0xffc00000,0x0,0x0} data={}
async_response_outbound_complete: \
  transaction=0xffff89fa08cf16c0 generation=4 scode=2 status=1 \
  timestamp=0x0000

Link: https://lore.kernel.org/r/20240429043218.609398-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
2c945b10d7 firewire: core: add tracepoint event for asynchronous inbound request
This commit adds an event for asynchronous inbound request.

The following example is for asynchronous block write request as IEC
61883-1 FCP request from node 0xffc1.

async_request_inbound: \
  transaction=0xffff89fa08cf16c0 generation=4 scode=2 status=2 \
  timestamp=0x00b3 dst_id=0xffc0 tlabel=19 tcode=1 src_id=0xffc1 \
  offset=0xfffff0000d00 header={0xffc04d10,0xffc1ffff,0xf0000d00,0x80000} \
  data={0x19ff08,0xffff0090}

Link: https://lore.kernel.org/r/20240429043218.609398-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
06cc078c07 firewire: core: add tracepoints event for asynchronous inbound response
In the transaction of IEEE 1394, the node to receive the asynchronous
request transfers any response packet to the requester except for the
unified transaction.

This commit adds an event for the inbound packet. Note that the code to
decode the packet header is moved, against the note about the sanity
check.

The following example is for asynchronous lock response with
compare_and_swap code.

async_response_inbound: \
  transaction=0xffff955fc6a07a10 generation=5 scode=2 status=1 \
  timestamp=0x0089 dst_id=0xffc1 tlabel=54 tcode=11 src_id=0xffc0 \
  rcode=0 header={0xffc1d9b0,0xffc00000,0x0,0x40002} data={0x50800080}

Link: https://lore.kernel.org/r/20240429043218.609398-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
944b06840a firewire: core: add tracepoints events for asynchronous outbound request
In a view of core transaction service, the asynchronous outbound request
consists of two stages; initiation and completion. This commit adds a pair
of event for them.

The following example is for asynchronous lock request with compare_swap
code to offset 0x'ffff'f000'0904 in node 0xffc0.

async_request_outbound_initiate: \
  transaction=0xffff955fc6a07a10 generation=5 scode=2 dst_id=0xffc0 \
  tlabel=54 tcode=9 src_id=0xffc1 offset=0xfffff0000904 \
  header={0xffc0d990,0xffc1ffff,0xf0000904,0x80002}
  data={0x80,0x940181}
async_request_outbound_complete: \
  transaction=0xffff955fc6a07a10 generation=5 scode=2 status=2 \
  timestamp=0xd887

Link: https://lore.kernel.org/r/20240429043218.609398-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
57614c2884 firewire: core: add support for Linux kernel tracepoints
The Linux Kernel Tracepoints framework is enough useful to trace
packet data inbound to and outbound from core.

This commit adds firewire subsystem to use the framework.

Link: https://lore.kernel.org/r/20240429043218.609398-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
aa5c5edc08 firewire: core: replace local macros with common inline functions for isochronous packet header
This commit replaces the local macros with the common inline functions
to serialize the packer header for Asynchronous Streaming Packet.

Link: https://lore.kernel.org/r/20240428071347.409202-9-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
6503df3612 firewire: core: add common macro to serialize/deserialize isochronous packet header
The packet for Asynchronous Streaming Packet includes the same header
fields as the isochronous packet has. It is helpful to have some helper
functions to serialize/deserialize them.

This commit adds such helper functions with their test.

Link: https://lore.kernel.org/r/20240428071347.409202-8-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
c5deb01849 firewire: core: obsolete tcode check macros with inline functions
This commit declares the helper functions to check tcode to obsolete
the functional macros.

Link: https://lore.kernel.org/r/20240428071347.409202-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:05 +09:00
Takashi Sakamoto
2a0b46a988 firewire: ohci: replace hard-coded values with common macros
In the helper function for logging in 1394 ohci driver includes the
hard-coded variables for transaction code. They can be replaced with
the enumerations in UAPI header.

Link: https://lore.kernel.org/r/20240428071347.409202-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
4af4361418 firewire: ohci: replace hard-coded values with inline functions for asynchronous packet header
This commit replaces the hard-coded values with the common inline functions
to serialize and deserialize the header of asynchronous packet.

Link: https://lore.kernel.org/r/20240428071347.409202-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
1162825c9c firewire: ohci: replace local macros with common inline functions for asynchronous packet header
This commit uses the common inline functions to serialize and deserialize
header of asynchronous packet.

Link: https://lore.kernel.org/r/20240428071347.409202-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
e8cd3e4f27 firewire: core: replace local macros with common inline functions for asynchronous packet header
This commit uses common inline functions to serialize and deserialize
header of asynchronous packet.

Link: https://lore.kernel.org/r/20240428071347.409202-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
75527d8d9e firewire: core: add common inline functions to serialize/deserialize asynchronous packet header
In both core and 1394 OHCI driver, some hard-coded values and macros are
used to serialize/deserialize the header of asynchronous packets. It is
inconvenient to reuse them.

This commit adds some helper inline functions with their tests for the
purpose.

Link: https://lore.kernel.org/r/20240428071347.409202-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
e41b2c1532 firewire: ohci: use pci_irq_vector() to retrieve allocated interrupt line
The pci_irq_vector() is available to retrieve the allocated interrupt line
instead of the direct access to the member of device structure.

Link: https://lore.kernel.org/r/20240331135037.191479-5-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
b9d9a025bf firewire: ohci: obsolete usage of deprecated API for MSI
The usage of the pair of pci_enable_msi() and pci_disable_msi() is
deprecated.

This commit uses the preferred pair of API for the purpose. The call of
pci_alloc_irq_vectors() can have a subeffect to change the return value
of pci_dev_msi_enabled().

Link: https://lore.kernel.org/r/20240331135037.191479-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
d4cad4162b firewire: ohci: replace request_irq() with request_threaded_irq()
Nowadays request_irq() is a wrapper of request_threaded_irq(). The IRQ
handler of 1394 ohci driver has never been optimized yet, while it is
a good preparation for the future work to replace the latter.

This commit replaces the former.

Link: https://lore.kernel.org/r/20240331135037.191479-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Takashi Sakamoto
fb7d0e5e1f Revert "firewire: ohci: use devres for requested IRQ"
This reverts commit 5a95f1ded2.

As long as allocating any device interrupt vector for MSI, it is
inconvenient to utilize managed device resources for IRQ requesting.

Link: https://lore.kernel.org/r/20240331135037.191479-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:04 +09:00
Adam Goldman
f83a052f9a firewire: core: option to log bus reset initiation
Add a debug parameter to firewire-core, analogous to the one in
firewire-ohci. When this is set to 1, log when we schedule, delay, or
initiate a bus reset. Since FireWire bus resets can originate from any
node on the bus, specific logging of the resets we initiate provides
additional insight.

Signed-off-by: Adam Goldman <adamg@pobox.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-05-06 11:06:03 +09:00
Takashi Sakamoto
09773bf55a firewire: ohci: fulfill timestamp for some local asynchronous transaction
1394 OHCI driver generates packet data for the response subaction to the
request subaction to some local registers. In the case, the driver should
assign timestamp to them by itself.

This commit fulfills the timestamp for the subaction.

Cc: stable@vger.kernel.org
Fixes: dcadfd7f7c ("firewire: core: use union for callback of transaction completion")
Link: https://lore.kernel.org/r/20240429084709.707473-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-04-29 18:41:00 +09:00
Thanassis Avgerinos
38762a0763 firewire: nosy: ensure user_length is taken into account when fetching packet contents
Ensure that packet_buffer_get respects the user_length provided. If
the length of the head packet exceeds the user_length, packet_buffer_get
will now return 0 to signify to the user that no data were read
and a larger buffer size is required. Helps prevent user space overflows.

Signed-off-by: Thanassis Avgerinos <thanassis.avgerinos@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-04-29 18:35:55 +09:00
Christoph Hellwig
c1f99322fc scsi: sbp2: Switch to using ->device_configure
Switch to the ->device_configure method instead of ->slave_configure and
update the block limits on the passed in queue_limits instead of using the
per-limit accessors.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240409143748.980206-14-hch@lst.de
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-04-11 21:37:49 -04:00