Skip to content

Commit 4b83e99

Browse files
committed
Revert "pktcdvd: remove driver."
This reverts commit f40eb99. There are apparently still users out there of this driver. While we'd love to remove it to ease the maintenance burden, let's reinstate it for now until better (userspace) solutions can be developed. Link: https://lore.kernel.org/lkml/20230104190115.ceglfefco475ev6c@pali/ Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 050a4f3 commit 4b83e99

File tree

8 files changed

+3419
-0
lines changed

8 files changed

+3419
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
What: /sys/kernel/debug/pktcdvd/pktcdvd[0-7]
2+
Date: Oct. 2006
3+
KernelVersion: 2.6.20
4+
Contact: Thomas Maier <balagi@justmail.de>
5+
Description:
6+
7+
The pktcdvd module (packet writing driver) creates
8+
these files in debugfs:
9+
10+
/sys/kernel/debug/pktcdvd/pktcdvd[0-7]/
11+
12+
==== ====== ====================================
13+
info 0444 Lots of driver statistics and infos.
14+
==== ====== ====================================
15+
16+
Example::
17+
18+
cat /sys/kernel/debug/pktcdvd/pktcdvd0/info
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
sysfs interface
2+
---------------
3+
The pktcdvd module (packet writing driver) creates the following files in the
4+
sysfs: (<devid> is in the format major:minor)
5+
6+
What: /sys/class/pktcdvd/add
7+
What: /sys/class/pktcdvd/remove
8+
What: /sys/class/pktcdvd/device_map
9+
Date: Oct. 2006
10+
KernelVersion: 2.6.20
11+
Contact: Thomas Maier <balagi@justmail.de>
12+
Description:
13+
14+
========== ==============================================
15+
add (WO) Write a block device id (major:minor) to
16+
create a new pktcdvd device and map it to the
17+
block device.
18+
19+
remove (WO) Write the pktcdvd device id (major:minor)
20+
to remove the pktcdvd device.
21+
22+
device_map (RO) Shows the device mapping in format:
23+
pktcdvd[0-7] <pktdevid> <blkdevid>
24+
========== ==============================================
25+
26+
27+
What: /sys/class/pktcdvd/pktcdvd[0-7]/dev
28+
What: /sys/class/pktcdvd/pktcdvd[0-7]/uevent
29+
Date: Oct. 2006
30+
KernelVersion: 2.6.20
31+
Contact: Thomas Maier <balagi@justmail.de>
32+
Description:
33+
dev: (RO) Device id
34+
35+
uevent: (WO) To send a uevent
36+
37+
38+
What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started
39+
What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished
40+
What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written
41+
What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read
42+
What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather
43+
What: /sys/class/pktcdvd/pktcdvd[0-7]/stat/reset
44+
Date: Oct. 2006
45+
KernelVersion: 2.6.20
46+
Contact: Thomas Maier <balagi@justmail.de>
47+
Description:
48+
packets_started: (RO) Number of started packets.
49+
50+
packets_finished: (RO) Number of finished packets.
51+
52+
kb_written: (RO) kBytes written.
53+
54+
kb_read: (RO) kBytes read.
55+
56+
kb_read_gather: (RO) kBytes read to fill write packets.
57+
58+
reset: (WO) Write any value to it to reset
59+
pktcdvd device statistic values, like
60+
bytes read/written.
61+
62+
63+
What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size
64+
What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off
65+
What: /sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on
66+
Date: Oct. 2006
67+
KernelVersion: 2.6.20
68+
Contact: Thomas Maier <balagi@justmail.de>
69+
Description:
70+
============== ================================================
71+
size (RO) Contains the size of the bio write queue.
72+
73+
congestion_off (RW) If bio write queue size is below this mark,
74+
accept new bio requests from the block layer.
75+
76+
congestion_on (RW) If bio write queue size is higher as this
77+
mark, do no longer accept bio write requests
78+
from the block layer and wait till the pktcdvd
79+
device has processed enough bio's so that bio
80+
write queue size is below congestion off mark.
81+
A value of <= 0 disables congestion control.
82+
============== ================================================
83+
84+
85+
Example:
86+
--------
87+
To use the pktcdvd sysfs interface directly, you can do::
88+
89+
# create a new pktcdvd device mapped to /dev/hdc
90+
echo "22:0" >/sys/class/pktcdvd/add
91+
cat /sys/class/pktcdvd/device_map
92+
# assuming device pktcdvd0 was created, look at stat's
93+
cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
94+
# print the device id of the mapped block device
95+
fgrep pktcdvd0 /sys/class/pktcdvd/device_map
96+
# remove device, using pktcdvd0 device id 253:0
97+
echo "253:0" >/sys/class/pktcdvd/remove

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16520,6 +16520,13 @@ S: Supported
1652016520
F: Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml
1652116521
F: drivers/input/keyboard/pinephone-keyboard.c
1652216522

16523+
PKTCDVD DRIVER
16524+
M: linux-block@vger.kernel.org
16525+
S: Orphan
16526+
F: drivers/block/pktcdvd.c
16527+
F: include/linux/pktcdvd.h
16528+
F: include/uapi/linux/pktcdvd.h
16529+
1652316530
PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
1652416531
M: Tomasz Duszynski <tduszyns@gmail.com>
1652516532
S: Maintained

drivers/block/Kconfig

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,49 @@ config BLK_DEV_RAM_SIZE
285285
The default value is 4096 kilobytes. Only change this if you know
286286
what you are doing.
287287

288+
config CDROM_PKTCDVD
289+
tristate "Packet writing on CD/DVD media (DEPRECATED)"
290+
depends on !UML
291+
depends on SCSI
292+
select CDROM
293+
help
294+
Note: This driver is deprecated and will be removed from the
295+
kernel in the near future!
296+
297+
If you have a CDROM/DVD drive that supports packet writing, say
298+
Y to include support. It should work with any MMC/Mt Fuji
299+
compliant ATAPI or SCSI drive, which is just about any newer
300+
DVD/CD writer.
301+
302+
Currently only writing to CD-RW, DVD-RW, DVD+RW and DVDRAM discs
303+
is possible.
304+
DVD-RW disks must be in restricted overwrite mode.
305+
306+
See the file <file:Documentation/cdrom/packet-writing.rst>
307+
for further information on the use of this driver.
308+
309+
To compile this driver as a module, choose M here: the
310+
module will be called pktcdvd.
311+
312+
config CDROM_PKTCDVD_BUFFERS
313+
int "Free buffers for data gathering"
314+
depends on CDROM_PKTCDVD
315+
default "8"
316+
help
317+
This controls the maximum number of active concurrent packets. More
318+
concurrent packets can increase write performance, but also require
319+
more memory. Each concurrent packet will require approximately 64Kb
320+
of non-swappable kernel memory, memory which will be allocated when
321+
a disc is opened for writing.
322+
323+
config CDROM_PKTCDVD_WCACHE
324+
bool "Enable write caching"
325+
depends on CDROM_PKTCDVD
326+
help
327+
If enabled, write caching will be set for the CD-R/W device. For now
328+
this option is dangerous unless the CD-RW media is known good, as we
329+
don't do deferred write error handling yet.
330+
288331
config ATA_OVER_ETH
289332
tristate "ATA over Ethernet support"
290333
depends on NET

drivers/block/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
2020
obj-$(CONFIG_N64CART) += n64cart.o
2121
obj-$(CONFIG_BLK_DEV_RAM) += brd.o
2222
obj-$(CONFIG_BLK_DEV_LOOP) += loop.o
23+
obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o
2324
obj-$(CONFIG_SUNVDC) += sunvdc.o
2425

2526
obj-$(CONFIG_BLK_DEV_NBD) += nbd.o

0 commit comments

Comments
 (0)