Commit 1cea5180 authored by Jens Axboe's avatar Jens Axboe
Browse files

block: remove pktcdvd driver

This driver has long outlived it's utility, and it's broken and unloved.
The main use case for this was direct mount with UDF of cd-rw drives
that required 32kb packets. It would collect writes into that size and
write them out in multiples of that. That's not a common use case
anymore, the world has moved on from those kinds of media. To make
matters worse, it's actively breaking setups where it's not even
required or useful.

Link: https://lore.kernel.org/linux-block/fxg6dksau4jsk3u5xldlyo2m7qgiux6vtdrz5rywseotsouqdv@urcrwz6qtd3r/
Link: https://lore.kernel.org/linux-block/dcc4836e-6da9-4208-ad27-bbd44b3a2063@kernel.dk/


Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 10d77a8c
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
What:           /sys/kernel/debug/pktcdvd/pktcdvd[0-7]
Date:           Oct. 2006
KernelVersion:  2.6.20
Contact:        Thomas Maier <balagi@justmail.de>
Description:

The pktcdvd module (packet writing driver) creates
these files in debugfs:

/sys/kernel/debug/pktcdvd/pktcdvd[0-7]/

    ====            ====== ====================================
    info            0444   Lots of driver statistics and infos.
    ====            ====== ====================================

Example::

    cat /sys/kernel/debug/pktcdvd/pktcdvd0/info
+0 −97
Original line number Diff line number Diff line
sysfs interface
---------------
The pktcdvd module (packet writing driver) creates the following files in the
sysfs: (<devid> is in the format major:minor)

What:		/sys/class/pktcdvd/add
What:		/sys/class/pktcdvd/remove
What:		/sys/class/pktcdvd/device_map
Date:		Oct. 2006
KernelVersion:	2.6.20
Contact:	Thomas Maier <balagi@justmail.de>
Description:

		==========	==============================================
		add		(WO) Write a block device id (major:minor) to
				create a new pktcdvd device and map it to the
				block device.

		remove		(WO) Write the pktcdvd device id (major:minor)
				to remove the pktcdvd device.

		device_map	(RO) Shows the device mapping in format:
				pktcdvd[0-7] <pktdevid> <blkdevid>
		==========	==============================================


What:		/sys/class/pktcdvd/pktcdvd[0-7]/dev
What:		/sys/class/pktcdvd/pktcdvd[0-7]/uevent
Date:		Oct. 2006
KernelVersion:	2.6.20
Contact:	Thomas Maier <balagi@justmail.de>
Description:
		dev:	(RO) Device id

		uevent:	(WO) To send a uevent


What:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_started
What:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/packets_finished
What:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_written
What:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read
What:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/kb_read_gather
What:		/sys/class/pktcdvd/pktcdvd[0-7]/stat/reset
Date:		Oct. 2006
KernelVersion:	2.6.20
Contact:	Thomas Maier <balagi@justmail.de>
Description:
		packets_started:	(RO) Number of started packets.

		packets_finished:	(RO) Number of finished packets.

		kb_written:		(RO) kBytes written.

		kb_read:		(RO) kBytes read.

		kb_read_gather:		(RO) kBytes read to fill write packets.

		reset:			(WO) Write any value to it to reset
					pktcdvd device statistic values, like
					bytes read/written.


What:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/size
What:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_off
What:		/sys/class/pktcdvd/pktcdvd[0-7]/write_queue/congestion_on
Date:		Oct. 2006
KernelVersion:	2.6.20
Contact:	Thomas Maier <balagi@justmail.de>
Description:
		==============	================================================
		size		(RO) Contains the size of the bio write queue.

		congestion_off	(RW) If bio write queue size is below this mark,
				accept new bio requests from the block layer.

		congestion_on	(RW) If bio write queue size is higher as this
				mark, do no longer accept bio write requests
				from the block layer and wait till the pktcdvd
				device has processed enough bio's so that bio
				write queue size is below congestion off mark.
				A value of <= 0 disables congestion control.
		==============	================================================


Example:
--------
To use the pktcdvd sysfs interface directly, you can do::

    # create a new pktcdvd device mapped to /dev/hdc
    echo "22:0" >/sys/class/pktcdvd/add
    cat /sys/class/pktcdvd/device_map
    # assuming device pktcdvd0 was created, look at stat's
    cat /sys/class/pktcdvd/pktcdvd0/stat/kb_written
    # print the device id of the mapped block device
    fgrep pktcdvd0 /sys/class/pktcdvd/device_map
    # remove device, using pktcdvd0 device id   253:0
    echo "253:0" >/sys/class/pktcdvd/remove
+0 −139
Original line number Diff line number Diff line
==============
Packet writing
==============

Getting started quick
---------------------

- Select packet support in the block device section and UDF support in
  the file system section.

- Compile and install kernel and modules, reboot.

- You need the udftools package (pktsetup, mkudffs, cdrwtool).
  Download from https://github.com/pali/udftools

- Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute
  as appropriate)::

	# cdrwtool -d /dev/hdc -q

- Setup your writer::

	# pktsetup dev_name /dev/hdc

- Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy::

	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime


Packet writing for DVD-RW media
-------------------------------

DVD-RW discs can be written to much like CD-RW discs if they are in
the so called "restricted overwrite" mode. To put a disc in restricted
overwrite mode, run::

	# dvd+rw-format /dev/hdc

You can then use the disc the same way you would use a CD-RW disc::

	# pktsetup dev_name /dev/hdc
	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime


Packet writing for DVD+RW media
-------------------------------

According to the DVD+RW specification, a drive supporting DVD+RW discs
shall implement "true random writes with 2KB granularity", which means
that it should be possible to put any filesystem with a block size >=
2KB on such a disc. For example, it should be possible to do::

	# dvd+rw-format /dev/hdc   (only needed if the disc has never
	                            been formatted)
	# mkudffs /dev/hdc
	# mount /dev/hdc /cdrom -t udf -o rw,noatime

However, some drives don't follow the specification and expect the
host to perform aligned writes at 32KB boundaries. Other drives do
follow the specification, but suffer bad performance problems if the
writes are not 32KB aligned.

Both problems can be solved by using the pktcdvd driver, which always
generates aligned writes::

	# dvd+rw-format /dev/hdc
	# pktsetup dev_name /dev/hdc
	# mkudffs /dev/pktcdvd/dev_name
	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime


Packet writing for DVD-RAM media
--------------------------------

DVD-RAM discs are random writable, so using the pktcdvd driver is not
necessary. However, using the pktcdvd driver can improve performance
in the same way it does for DVD+RW media.


Notes
-----

- CD-RW media can usually not be overwritten more than about 1000
  times, so to avoid unnecessary wear on the media, you should always
  use the noatime mount option.

- Defect management (ie automatic remapping of bad sectors) has not
  been implemented yet, so you are likely to get at least some
  filesystem corruption if the disc wears out.

- Since the pktcdvd driver makes the disc appear as a regular block
  device with a 2KB block size, you can put any filesystem you like on
  the disc. For example, run::

	# /sbin/mke2fs /dev/pktcdvd/dev_name

  to create an ext2 filesystem on the disc.


Using the pktcdvd sysfs interface
---------------------------------

Since Linux 2.6.20, the pktcdvd module has a sysfs interface
and can be controlled by it. For example the "pktcdvd" tool uses
this interface. (see http://tom.ist-im-web.de/linux/software/pktcdvd )

"pktcdvd" works similar to "pktsetup", e.g.::

	# pktcdvd -a dev_name /dev/hdc
	# mkudffs /dev/pktcdvd/dev_name
	# mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram
	# cp files /dvdram
	# umount /dvdram
	# pktcdvd -r dev_name


For a description of the sysfs interface look into the file:

  Documentation/ABI/testing/sysfs-class-pktcdvd


Using the pktcdvd debugfs interface
-----------------------------------

To read pktcdvd device infos in human readable form, do::

	# cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info

For a description of the debugfs interface look into the file:

  Documentation/ABI/testing/debugfs-pktcdvd



Links
-----

See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information
about DVD writing.
+0 −1
Original line number Diff line number Diff line
@@ -220,7 +220,6 @@ Code Seq# Include File Comments
             include/linux/falloc.h,
             linux/fs.h,
'X'   all    fs/ocfs2/ocfs_fs.h                                      conflict!
'X'   01     linux/pktcdvd.h                                         conflict!
'Z'   14-15  drivers/message/fusion/mptctl.h
'['   00-3F  linux/usb/tmc.h                                         USB Test and Measurement Devices
                                                                     <mailto:gregkh@linuxfoundation.org>
+0 −7
Original line number Diff line number Diff line
@@ -19697,13 +19697,6 @@ S: Supported
F:	Documentation/devicetree/bindings/input/pine64,pinephone-keyboard.yaml
F:	drivers/input/keyboard/pinephone-keyboard.c
PKTCDVD DRIVER
M:	linux-block@vger.kernel.org
S:	Orphan
F:	drivers/block/pktcdvd.c
F:	include/linux/pktcdvd.h
F:	include/uapi/linux/pktcdvd.h
PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
M:	Tomasz Duszynski <tduszyns@gmail.com>
S:	Maintained
Loading