2019-05-27 08:55:05 +02:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2009-06-04 21:09:38 +02:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
firewire: reorganize header files
The three header files of firewire-core, i.e.
"drivers/firewire/fw-device.h",
"drivers/firewire/fw-topology.h",
"drivers/firewire/fw-transaction.h",
are replaced by
"drivers/firewire/core.h",
"include/linux/firewire.h".
The latter includes everything which a firewire high-level driver (like
firewire-sbp2) needs besides linux/firewire-constants.h, while core.h
contains the rest which is needed by firewire-core itself and by low-
level drivers (card drivers) like firewire-ohci.
High-level drivers can now also reside outside of drivers/firewire
without having to add drivers/firewire to the header file search path in
makefiles. At least the firedtv driver will be such a driver.
I also considered to spread the contents of core.h over several files,
one for each .c file where the respective implementation resides. But
it turned out that most core .c files will end up including most of the
core .h files. Also, the combined core.h isn't unreasonably big, and it
will lose more of its contents to linux/firewire.h anyway soon when more
firewire drivers are added. (IP-over-1394, firedtv, and there are plans
for one or two more.)
Furthermore, fw-ohci.h is renamed to ohci.h. The name of core.h and
ohci.h is chosen with regard to name changes of the .c files in a
follow-up change.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2009-06-05 16:26:18 +02:00
|
|
|
|
|
|
|
|
|
2009-06-04 21:09:38 +02:00
|
|
|
|
|
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
2009-06-04 21:09:38 +02:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
2007-05-07 20:33:33 -04:00
|
|
|
|
2009-06-04 21:09:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-26 16:09:06 -07:00
|
|
|
|
2009-06-04 21:09:38 +02:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
firewire: reorganize header files
The three header files of firewire-core, i.e.
"drivers/firewire/fw-device.h",
"drivers/firewire/fw-topology.h",
"drivers/firewire/fw-transaction.h",
are replaced by
"drivers/firewire/core.h",
"include/linux/firewire.h".
The latter includes everything which a firewire high-level driver (like
firewire-sbp2) needs besides linux/firewire-constants.h, while core.h
contains the rest which is needed by firewire-core itself and by low-
level drivers (card drivers) like firewire-ohci.
High-level drivers can now also reside outside of drivers/firewire
without having to add drivers/firewire to the header file search path in
makefiles. At least the firedtv driver will be such a driver.
I also considered to spread the contents of core.h over several files,
one for each .c file where the respective implementation resides. But
it turned out that most core .c files will end up including most of the
core .h files. Also, the combined core.h isn't unreasonably big, and it
will lose more of its contents to linux/firewire.h anyway soon when more
firewire drivers are added. (IP-over-1394, firedtv, and there are plans
for one or two more.)
Furthermore, fw-ohci.h is renamed to ohci.h. The name of core.h and
ohci.h is chosen with regard to name changes of the .c files in a
follow-up change.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2009-06-05 16:26:18 +02:00
|
|
|
|
2024-05-01 16:32:36 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
firewire: core: prefix log messages with card name
Associate all log messages from firewire-core with the respective card
because some people have more than one card. E.g.
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core: created device fw0: GUID 0814438400000389, S800
firewire_core: phy config: new root=ffc1, gap_count=5
firewire_core: created device fw1: GUID 0814438400000388, S800
firewire_core: created device fw2: GUID 0001d202e06800d1, S800
turns into
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core 0000:04:00.0: created device fw0: GUID 0814438400000389, S800
firewire_core 0000:04:00.0: phy config: new root=ffc1, gap_count=5
firewire_core 0000:05:00.0: created device fw1: GUID 0814438400000388, S800
firewire_core 0000:04:00.0: created device fw2: GUID 0001d202e06800d1, S800
This increases the module size slightly; to keep this in check, turn the
former printk wrapper macros into functions. Their implementation is
largely copied from driver core's dev_printk counterparts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2012-02-18 22:03:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-08 00:42:53 +02:00
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:33 -04:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-08 00:42:27 +02:00
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
|
|
|
|
|
2009-10-08 00:42:27 +02:00
|
|
|
|
2007-05-07 20:33:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-14 22:30:18 +02:00
|
|
|
|
2007-05-07 20:33:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-14 22:30:18 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2011-03-07 11:21:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-15 18:19:48 +01:00
|
|
|
|
|
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-21 20:44:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-22 15:59:42 -04:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
|
|
|
|
|
2010-04-14 22:30:18 +02:00
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
2007-05-07 20:33:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-14 22:30:18 +02:00
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2010-04-14 22:30:18 +02:00
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-07 12:12:36 -05:00
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-10-08 00:41:59 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:31 -04:00
|
|
|
|
2009-10-08 00:42:53 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-28 21:26:42 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-07 12:12:36 -05:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2009-05-18 13:08:06 -04:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2007-03-07 12:12:36 -05:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2009-05-18 13:08:06 -04:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-13 22:14:39 +09:00
|
|
|
|
2024-05-01 16:32:36 +09:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-13 22:14:39 +09:00
|
|
|
|
2024-05-01 16:32:36 +09:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
firewire: sbp2: parallelize login, reconnect, logout
The struct sbp2_logical_unit.work items can all be executed in parallel
but are not reentrant. Furthermore, reconnect or re-login work must be
executed in a WQ_MEM_RECLAIM workqueue.
Hence replace the old single-threaded firewire-sbp2 workqueue by a
concurrency-managed but non-reentrant workqueue with rescuer.
firewire-core already maintains one, hence use this one.
In earlier versions of this change, I observed occasional failures of
parallel INQUIRY to an Initio INIC-2430 FireWire 800 to dual IDE bridge.
More testing indicates that parallel INQUIRY is not actually a problem,
but too quick successions of logout and login + INQUIRY, e.g. a quick
sequence of cable plugout and plugin, can result in failed INQUIRY.
This does not seem to be something that should or could be addressed by
serialization.
Another dual-LU device to which I currently have access to, an
OXUF924DSB FireWire 800 to dual SATA bridge with firmware from MacPower,
has been successfully tested with this too.
This change is beneficial to environments with two or more FireWire
storage devices, especially if they are located on the same bus.
Management tasks that should be performed as soon and as quickly as
possible, especially reconnect, are no longer held up by tasks on other
devices that may take a long time, especially login with INQUIRY and sd
or sr driver probe.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2011-05-01 20:50:31 +02:00
|
|
|
|
firewire: core: use non-reentrant workqueue with rescuer
firewire-core manages the following types of work items:
fw_card.br_work:
- resets the bus on a card and possibly sends a PHY packet before that
- does not sleep for long or not at all
- is scheduled via fw_schedule_bus_reset() by
- firewire-ohci's pci_probe method
- firewire-ohci's set_config_rom method, called by kernelspace
protocol drivers and userspace drivers which add/remove
Configuration ROM descriptors
- userspace drivers which use the bus reset ioctl
- itself if the last reset happened less than 2 seconds ago
fw_card.bm_work:
- performs bus management duties
- usually does not (but may in corner cases) sleep for long
- is scheduled via fw_schedule_bm_work() by
- firewire-ohci's self-ID-complete IRQ handler tasklet
- firewire-core's fw_device.work instances whenever the root node
device was (successfully or unsuccessfully) discovered,
refreshed, or rediscovered
- itself in case of resource allocation failures or in order to
obey the 125ms bus manager arbitration interval
fw_device.work:
- performs node probe, update, shutdown, revival, removal; including
kernel driver probe, update, shutdown and bus reset notification to
userspace drivers
- usually sleeps moderately long, in corner cases very long
- is scheduled by
- firewire-ohci's self-ID-complete IRQ handler tasklet via the
core's fw_node_event
- firewire-ohci's pci_remove method via core's fw_destroy_nodes/
fw_node_event
- itself during retries, e.g. while a node is powering up
iso_resource.work:
- accesses registers at the Isochronous Resource Manager node
- usually does not (but may in corner cases) sleep for long
- is scheduled via schedule_iso_resource() by
- the owning userspace driver at addition and removal of the
resource
- firewire-core's fw_device.work instances after bus reset
- itself in case of resource allocation if necessary to obey the
1000ms reallocation period after bus reset
fw_card.br_work instances should not, and instances of the others must
not, be executed in parallel by multiple CPUs -- but were not protected
against that. Hence allocate a non-reentrant workqueue for them.
fw_device.work may be used in the memory reclaim path in case of SBP-2
device updates. Hence we need a workqueue with rescuer and cannot use
system_nrt_wq.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Reviewed-by: Tejun Heo <tj@kernel.org>
2010-10-13 13:39:46 +02:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-22 15:05:03 +01:00
|
|
|
|
2024-06-13 22:14:39 +09:00
|
|
|
|
2024-05-01 16:32:36 +09:00
|
|
|
|
firewire: sbp2: parallelize login, reconnect, logout
The struct sbp2_logical_unit.work items can all be executed in parallel
but are not reentrant. Furthermore, reconnect or re-login work must be
executed in a WQ_MEM_RECLAIM workqueue.
Hence replace the old single-threaded firewire-sbp2 workqueue by a
concurrency-managed but non-reentrant workqueue with rescuer.
firewire-core already maintains one, hence use this one.
In earlier versions of this change, I observed occasional failures of
parallel INQUIRY to an Initio INIC-2430 FireWire 800 to dual IDE bridge.
More testing indicates that parallel INQUIRY is not actually a problem,
but too quick successions of logout and login + INQUIRY, e.g. a quick
sequence of cable plugout and plugin, can result in failed INQUIRY.
This does not seem to be something that should or could be addressed by
serialization.
Another dual-LU device to which I currently have access to, an
OXUF924DSB FireWire 800 to dual SATA bridge with firmware from MacPower,
has been successfully tested with this too.
This change is beneficial to environments with two or more FireWire
storage devices, especially if they are located on the same bus.
Management tasks that should be performed as soon and as quickly as
possible, especially reconnect, are no longer held up by tasks on other
devices that may take a long time, especially login with INQUIRY and sd
or sr driver probe.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2011-05-01 20:50:31 +02:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2009-02-23 15:59:34 -05:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2009-02-23 15:59:34 -05:00
|
|
|
|
2010-06-10 08:40:49 +02:00
|
|
|
|
|
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
2010-06-10 08:40:49 +02:00
|
|
|
|
firewire: core: prefix log messages with card name
Associate all log messages from firewire-core with the respective card
because some people have more than one card. E.g.
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core: created device fw0: GUID 0814438400000389, S800
firewire_core: phy config: new root=ffc1, gap_count=5
firewire_core: created device fw1: GUID 0814438400000388, S800
firewire_core: created device fw2: GUID 0001d202e06800d1, S800
turns into
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core 0000:04:00.0: created device fw0: GUID 0814438400000389, S800
firewire_core 0000:04:00.0: phy config: new root=ffc1, gap_count=5
firewire_core 0000:05:00.0: created device fw1: GUID 0814438400000388, S800
firewire_core 0000:04:00.0: created device fw2: GUID 0001d202e06800d1, S800
This increases the module size slightly; to keep this in check, turn the
former printk wrapper macros into functions. Their implementation is
largely copied from driver core's dev_printk counterparts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2012-02-18 22:03:14 +01:00
|
|
|
|
2010-06-10 08:40:49 +02:00
|
|
|
|
|
|
|
|
|
2009-03-10 21:09:28 +01:00
|
|
|
|
2009-02-23 15:59:34 -05:00
|
|
|
|
2010-06-10 08:40:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-23 15:59:34 -05:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:37:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2008-11-29 17:44:57 +01:00
|
|
|
|
|
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
2008-11-29 17:44:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2010-06-21 23:24:35 +02:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2008-03-24 20:57:12 +01:00
|
|
|
|
2009-01-09 20:49:37 +01:00
|
|
|
|
|
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
2011-01-15 18:19:48 +01:00
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2008-11-29 17:44:57 +01:00
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
|
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
|
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2009-01-09 20:49:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-15 18:19:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-10 21:07:46 +01:00
|
|
|
|
2011-01-22 15:05:03 +01:00
|
|
|
|
|
|
|
|
|
2009-03-10 21:07:46 +01:00
|
|
|
|
2010-06-10 08:37:15 +02:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
|
|
|
|
|
firewire: core: prefix log messages with card name
Associate all log messages from firewire-core with the respective card
because some people have more than one card. E.g.
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core: created device fw0: GUID 0814438400000389, S800
firewire_core: phy config: new root=ffc1, gap_count=5
firewire_core: created device fw1: GUID 0814438400000388, S800
firewire_core: created device fw2: GUID 0001d202e06800d1, S800
turns into
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core 0000:04:00.0: created device fw0: GUID 0814438400000389, S800
firewire_core 0000:04:00.0: phy config: new root=ffc1, gap_count=5
firewire_core 0000:05:00.0: created device fw1: GUID 0814438400000388, S800
firewire_core 0000:04:00.0: created device fw2: GUID 0001d202e06800d1, S800
This increases the module size slightly; to keep this in check, turn the
former printk wrapper macros into functions. Their implementation is
largely copied from driver core's dev_printk counterparts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2012-02-18 22:03:14 +01:00
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-15 18:19:48 +01:00
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
firewire: core: prefix log messages with card name
Associate all log messages from firewire-core with the respective card
because some people have more than one card. E.g.
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core: created device fw0: GUID 0814438400000389, S800
firewire_core: phy config: new root=ffc1, gap_count=5
firewire_core: created device fw1: GUID 0814438400000388, S800
firewire_core: created device fw2: GUID 0001d202e06800d1, S800
turns into
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core 0000:04:00.0: created device fw0: GUID 0814438400000389, S800
firewire_core 0000:04:00.0: phy config: new root=ffc1, gap_count=5
firewire_core 0000:05:00.0: created device fw1: GUID 0814438400000388, S800
firewire_core 0000:04:00.0: created device fw2: GUID 0001d202e06800d1, S800
This increases the module size slightly; to keep this in check, turn the
former printk wrapper macros into functions. Their implementation is
largely copied from driver core's dev_printk counterparts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2012-02-18 22:03:14 +01:00
|
|
|
|
2010-05-30 19:43:52 +02:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2008-07-20 14:20:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2008-07-20 14:20:53 +02:00
|
|
|
|
|
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2024-08-05 17:54:05 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-21 23:24:35 +02:00
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2009-02-23 15:59:34 -05:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2010-06-10 08:23:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2008-07-20 14:20:53 +02:00
|
|
|
|
2011-01-15 18:19:48 +01:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2012-04-11 17:38:47 +02:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2009-03-10 21:07:46 +01:00
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2009-03-10 21:07:46 +01:00
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
firewire: core: send bus reset promptly on gap count error
If we are bus manager and the bus has inconsistent gap counts, send a
bus reset immediately instead of trying to read the root node's config
ROM first. Otherwise, we could spend a lot of time trying to read the
config ROM but never succeeding.
This eliminates a 50+ second delay before the FireWire bus is usable after
a newly connected device is powered on in certain circumstances.
The delay occurs if a gap count inconsistency occurs, we are not the root
node, and we become bus manager. One scenario that causes this is with a TI
XIO2213B OHCI, the first time a Sony DSR-25 is powered on after being
connected to the FireWire cable. In this configuration, the Linux box will
not receive the initial PHY configuration packet sent by the DSR-25 as IRM,
resulting in the DSR-25 having a gap count of 44 while the Linux box has a
gap count of 63.
FireWire devices have a gap count parameter, which is set to 63 on power-up
and can be changed with a PHY configuration packet. This determines the
duration of the subaction and arbitration gaps. For reliable communication,
all nodes on a FireWire bus must have the same gap count.
A node may have zero or more of the following roles: root node, bus manager
(BM), isochronous resource manager (IRM), and cycle master. Unless a root
node was forced with a PHY configuration packet, any node might become root
node after a bus reset. Only the root node can become cycle master. If the
root node is not cycle master capable, the BM or IRM should force a change
of root node.
After a bus reset, each node sends a self-ID packet, which contains its
current gap count. A single bus reset does not change the gap count, but
two bus resets in a row will set the gap count to 63. Because a consistent
gap count is required for reliable communication, IEEE 1394a-2000 requires
that the bus manager generate a bus reset if it detects that the gap count
is inconsistent.
When the gap count is inconsistent, build_tree() will notice this after the
self identification process. It will set card->gap_count to the invalid
value 0. If we become bus master, this will force bm_work() to send a bus
reset when it performs gap count optimization.
After a bus reset, there is no bus manager. We will almost always try to
become bus manager. Once we become bus manager, we will first determine
whether the root node is cycle master capable. Then, we will determine if
the gap count should be changed. If either the root node or the gap count
should be changed, we will generate a bus reset.
To determine if the root node is cycle master capable, we read its
configuration ROM. bm_work() will wait until we have finished trying to
read the configuration ROM.
However, an inconsistent gap count can make this take a long time.
read_config_rom() will read the first few quadlets from the config ROM. Due
to the gap count inconsistency, eventually one of the reads will time out.
When read_config_rom() fails, fw_device_init() calls it again until
MAX_RETRIES is reached. This takes 50+ seconds.
Once we give up trying to read the configuration ROM, bm_work() will wake
up, assume that the root node is not cycle master capable, and do a bus
reset. Hopefully, this will resolve the gap count inconsistency.
This change makes bm_work() check for an inconsistent gap count before
waiting for the root node's configuration ROM. If the gap count is
inconsistent, bm_work() will immediately do a bus reset. This eliminates
the 50+ second delay and rapidly brings the bus to a working state.
I considered that if the gap count is inconsistent, a PHY configuration
packet might not be successful, so it could be desirable to skip the PHY
configuration packet before the bus reset in this case. However, IEEE
1394a-2000 and IEEE 1394-2008 say that the bus manager may transmit a PHY
configuration packet before a bus reset when correcting a gap count error.
Since the standard endorses this, I decided it's safe to retain the PHY
configuration packet transmission.
Normally, after a topology change, we will reset the bus a maximum of 5
times to change the root node and perform gap count optimization. However,
if there is a gap count inconsistency, we must always generate a bus reset.
Otherwise the gap count inconsistency will persist and communication will
be unreliable. For that reason, if there is a gap count inconstency, we
generate a bus reset even if we already reached the 5 reset limit.
Signed-off-by: Adam Goldman <adamg@pobox.com>
Reference: https://sourceforge.net/p/linux1394/mailman/message/58727806/
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-02-07 08:01:17 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2009-01-09 20:49:37 +01:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
2009-01-09 20:49:37 +01:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2010-06-10 08:41:51 +02:00
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2007-01-26 00:37:50 -05:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2007-01-26 00:37:50 -05:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
2007-06-18 19:44:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:37:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2008-03-24 20:57:12 +01:00
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:37:50 -05:00
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
|
|
|
|
|
2008-03-24 20:57:12 +01:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2010-06-21 23:23:52 +02:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2007-01-26 00:37:50 -05:00
|
|
|
|
firewire: core: prefix log messages with card name
Associate all log messages from firewire-core with the respective card
because some people have more than one card. E.g.
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core: created device fw0: GUID 0814438400000389, S800
firewire_core: phy config: new root=ffc1, gap_count=5
firewire_core: created device fw1: GUID 0814438400000388, S800
firewire_core: created device fw2: GUID 0001d202e06800d1, S800
turns into
firewire_ohci 0000:04:00.0: added OHCI v1.10 device as card 0, 8 IR + 8 IT contexts, quirks 0x0
firewire_ohci 0000:05:00.0: added OHCI v1.10 device as card 1, 8 IR + 8 IT contexts, quirks 0x0
firewire_core 0000:04:00.0: created device fw0: GUID 0814438400000389, S800
firewire_core 0000:04:00.0: phy config: new root=ffc1, gap_count=5
firewire_core 0000:05:00.0: created device fw1: GUID 0814438400000388, S800
firewire_core 0000:04:00.0: created device fw2: GUID 0001d202e06800d1, S800
This increases the module size slightly; to keep this in check, turn the
former printk wrapper macros into functions. Their implementation is
largely copied from driver core's dev_printk counterparts.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2012-02-18 22:03:14 +01:00
|
|
|
|
|
|
|
|
|
2007-01-26 00:38:45 -05:00
|
|
|
|
firewire: core: use long bus reset on gap count error
When resetting the bus after a gap count error, use a long rather than
short bus reset.
IEEE 1394-1995 uses only long bus resets. IEEE 1394a adds the option of
short bus resets. When video or audio transmission is in progress and a
device is hot-plugged elsewhere on the bus, the resulting bus reset can
cause video frame drops or audio dropouts. Short bus resets reduce or
eliminate this problem. Accordingly, short bus resets are almost always
preferred.
However, on a mixed 1394/1394a bus, a short bus reset can trigger an
immediate additional bus reset. This double bus reset can be interpreted
differently by different nodes on the bus, resulting in an inconsistent gap
count after the bus reset. An inconsistent gap count will cause another bus
reset, leading to a neverending bus reset loop. This only happens for some
bus topologies, not for all mixed 1394/1394a buses.
By instead sending a long bus reset after a gap count inconsistency, we
avoid the doubled bus reset, restoring the bus to normal operation.
Signed-off-by: Adam Goldman <adamg@pobox.com>
Link: https://sourceforge.net/p/linux1394/mailman/message/58741624/
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
2024-02-29 22:17:37 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-10 21:08:37 +01:00
|
|
|
|
2010-06-10 08:41:51 +02:00
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
2009-02-23 15:59:34 -05:00
|
|
|
|
2010-06-10 08:41:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
2010-06-10 08:41:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-22 15:13:54 +02:00
|
|
|
|
2010-06-10 08:41:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-24 18:57:23 +01:00
|
|
|
|
|
|
|
|
|
2008-11-29 17:44:57 +01:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:31 -05:00
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2007-02-06 14:49:38 -05:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2007-02-06 14:49:38 -05:00
|
|
|
|
2007-01-21 20:44:09 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2007-01-21 20:44:09 +01:00
|
|
|
|
|
|
|
|
|
2011-03-07 11:21:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2008-05-24 16:41:09 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
|
|
|
|
|
2007-01-21 20:44:09 +01:00
|
|
|
|
2010-07-16 22:25:51 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
2009-02-03 17:55:19 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-01-24 14:47:02 +01:00
|
|
|
|
|
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
|
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
2009-09-06 18:50:29 +02:00
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2009-02-03 17:55:19 +01:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2009-06-16 19:15:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-01 12:23:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-07 20:33:32 -04:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-07-18 12:44:01 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2010-07-18 12:44:01 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2007-02-06 14:49:32 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-01 12:23:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
firewire: Add dummy read_csr/write_csr functions
(Hector Martin wrote)
This fixes segfaults when a card gets yanked off of the PCIe bus while
busy, e.g. with a userspace app trying to get the cycle time:
[8638860.994310] Call Trace:
[8638860.994313] ioctl_get_cycle_timer2+0x4f/0xd0 [firewire_core]
[8638860.994323] fw_device_op_ioctl+0xae/0x150 [firewire_core]
[8638860.994328] __x64_sys_ioctl+0x7d/0xb0
[8638860.994332] do_syscall_64+0x45/0x80
[8638860.994337] entry_SYSCALL_64_after_hwframe+0x44/0xae
(Takashi Sakamoto wrote)
As long as reading commit 20802224298c ("firewire: core: add forgotten
dummy driver methods, remove unused ones"), three functions are not
implemeted in dummy driver for reason; .read_csr, .write_csr, and
.set_config_rom.
In core of Linux FireWire subsystem, the callback of .set_config_rom is
under acquisition of mutual exclusive for local list of card. The
acquision is also done in process for removal of card, therefore it's
safe for missing implementation of .set_config_rom.
On the other hand, no lock primitive accompanies any call of .read_csr and
.write_csr. For userspace client, check of node shutdown is done in the
beginning of dispatch of ioctl request, while node shifts to shutdown
state in workqueue context enough after card shifts to dummy driver. It's
probable that these two functions are called for the dummy driver by the
code of userspace client. In-kernel unit driver has similar situation.
It's better to add implementation of the two functions for dummy driver.
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220405072221.226217-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-04-05 16:22:19 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-01 12:23:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-02 09:33:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-18 19:06:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-16 19:15:25 +02:00
|
|
|
|
2010-08-01 12:23:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
firewire: Add dummy read_csr/write_csr functions
(Hector Martin wrote)
This fixes segfaults when a card gets yanked off of the PCIe bus while
busy, e.g. with a userspace app trying to get the cycle time:
[8638860.994310] Call Trace:
[8638860.994313] ioctl_get_cycle_timer2+0x4f/0xd0 [firewire_core]
[8638860.994323] fw_device_op_ioctl+0xae/0x150 [firewire_core]
[8638860.994328] __x64_sys_ioctl+0x7d/0xb0
[8638860.994332] do_syscall_64+0x45/0x80
[8638860.994337] entry_SYSCALL_64_after_hwframe+0x44/0xae
(Takashi Sakamoto wrote)
As long as reading commit 20802224298c ("firewire: core: add forgotten
dummy driver methods, remove unused ones"), three functions are not
implemeted in dummy driver for reason; .read_csr, .write_csr, and
.set_config_rom.
In core of Linux FireWire subsystem, the callback of .set_config_rom is
under acquisition of mutual exclusive for local list of card. The
acquision is also done in process for removal of card, therefore it's
safe for missing implementation of .set_config_rom.
On the other hand, no lock primitive accompanies any call of .read_csr and
.write_csr. For userspace client, check of node shutdown is done in the
beginning of dispatch of ioctl request, while node shifts to shutdown
state in workqueue context enough after card shifts to dummy driver. It's
probable that these two functions are called for the dummy driver by the
code of userspace client. In-kernel unit driver has similar situation.
It's better to add implementation of the two functions for dummy driver.
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220405072221.226217-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2022-04-05 16:22:19 +09:00
|
|
|
|
|
|
|
|
|
2010-08-01 12:23:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-02 09:33:56 +02:00
|
|
|
|
2012-03-18 19:06:39 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-01 22:36:02 +00:00
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
2008-12-14 21:47:04 +01:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2009-06-16 19:15:25 +02:00
|
|
|
|
|
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
|
|
|
|
|
2007-03-23 10:24:02 -06:00
|
|
|
|
|
|
|
|
|
2010-07-08 16:09:06 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-08-05 17:53:53 +09:00
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2009-06-16 19:15:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
2024-08-05 17:54:05 +09:00
|
|
|
|
|
|
|
|
|
2008-05-24 16:50:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-21 01:05:14 +02:00
|
|
|
|
2024-09-04 21:51:50 +09:00
|
|
|
|
|
|
|
|
|
2008-07-12 14:51:18 +02:00
|
|
|
|
2006-12-19 19:58:27 -05:00
|
|
|
|
|
|
|
|
|
2022-04-05 16:22:20 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|