[PATCH v2 2/8] cdrom: factor out common open_for_* code

2019-10-23 Thread Michal Suchanek
The open_for_audio and open_for_data copies are bitrotten in different ways already and will need to update the autoclose logic in both. Signed-off-by: Michal Suchanek --- drivers/cdrom/cdrom.c | 96 +++ 1 file changed, 34 insertions(+), 62 deletions

[PATCH v2 3/8] cdrom: wait for the tray to close

2019-10-23 Thread Michal Suchanek
error when it detects the tray is blocked. At worst the wait can be interrupted by the user. Also wait for the drive to become ready once the tray closes. Signed-off-by: Michal Suchanek --- v2: - check drive_status exists before using it - rename tray_close -> cdrom_tray_close - also wait

[PATCH v2 0/8] Fix cdrom autoclose.

2019-10-23 Thread Michal Suchanek
mount or dd which has no business knowing which devices are CD-roms and where the autoclose setting is in the kernel. Michal Suchanek (8): cdrom: add poll_event_interruptible cdrom: factor out common open_for_* code cdrom: wait for the tray to close cdrom: separate autoclose into an IOCTL

[PATCH v2 6/8] bdev: add open_finish.

2019-10-23 Thread Michal Suchanek
-by: Michal Suchanek --- Documentation/filesystems/locking.rst | 2 ++ fs/block_dev.c| 21 + include/linux/blkdev.h| 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Documentation/filesystems/locking.rst b

[PATCH v2 5/8] docs: cdrom: Add autoclose IOCTL

2019-10-23 Thread Michal Suchanek
This IOCTL will be used internally by the sr driver but there is no reason to not document it for userspace. Signed-off-by: Michal Suchanek --- Documentation/ioctl/cdrom.rst | 25 + 1 file changed, 25 insertions(+) diff --git a/Documentation/ioctl/cdrom.rst b

[PATCH v2 1/8] cdrom: add poll_event_interruptible

2019-10-23 Thread Michal Suchanek
Add convenience macro for polling an event that does not have a waitqueue. Signed-off-by: Michal Suchanek --- drivers/cdrom/cdrom.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index ac42ae4651ce..2ad6b73482fe 100644 --- a

[PATCH v2 7/8] scsi: sr: workaround VMware ESXi cdrom emulation bug

2019-10-23 Thread Michal Suchanek
door_open is interpreted as open tray. This is fine so long as tray_move would close the tray when requested or report an error which never happens on VMware ESXi servers (5.5 and 6.5 tested). This is a popular virtualization platform so a workaround is worthwhile. Signed-off-by: Michal Suchanek -

[PATCH v2 8/8] scsi: sr: wait for the medium to become ready

2019-10-23 Thread Michal Suchanek
Use the autoclose IOCLT provided by cdrom driver to wait for drive to close in open_finish, and attempt to open once more after the door closes. Signed-off-by: Michal Suchanek --- drivers/scsi/sr.c | 54 --- 1 file changed, 42 insertions(+), 12

[PATCH v2 4/8] cdrom: separate autoclose into an IOCTL

2019-10-23 Thread Michal Suchanek
: Michal Suchanek --- drivers/cdrom/cdrom.c | 83 +- include/uapi/linux/cdrom.h | 1 + 2 files changed, 48 insertions(+), 36 deletions(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index c0fc9a02b70c..bd8813b5afdb 100644 --- a/drivers/cdrom

[PATCH resend 5/6] Documentetion: cdrom: introduce CDS_DRIVE_ERROR

2018-01-27 Thread Michal Suchanek
CDS_DRIVE_NOT_READY is used for the state in which CDROM is 'becoming ready' (typically analyzing the disc) but also as the fallback when nothing else applies. Introduce CDS_DRIVE_ERROR for the fallback case. Signed-off-by: Michal Suchanek --- Documentation/cdrom/cdrom-standa

[PATCH resend 1/6] delay: add poll_event_interruptible

2018-01-27 Thread Michal Suchanek
Add convenience macro for polling an event that does not have a waitqueue. Signed-off-by: Michal Suchanek --- include/linux/delay.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/delay.h b/include/linux/delay.h index b78bab4395d8..3ae9fa395628 100644 --- a

[PATCH resend 3/6] cdrom: wait for tray to close

2018-01-27 Thread Michal Suchanek
reports an error when it detects the tray is blocked. At worst the wait can be interrupted by user. Signed-off-by: Michal Suchanek --- v2: - check drive_status exists before using it - rename tray_close -> cdrom_tray_close --- drivers/cdrom/cdrom.c | 21 +++-- 1 file changed,

[PATCH resend 4/6] cdrom: introduce CDS_DRIVE_ERROR

2018-01-27 Thread Michal Suchanek
CDS_DRIVE_NOT_READY is used for the state in which CDROM is 'becoming ready' (typically analyzing the disc) but also as the fallback when nothing else applies. Introduce CDS_DRIVE_ERROR for the fallback case. Signed-off-by: Michal Suchanek --- drivers/block/paride/pcd.c | 2 +- dri

[PATCH resend 6/6] cdrom: wait for drive to become ready

2018-01-27 Thread Michal Suchanek
When the drive closes it can take tens of seconds until the disc is analyzed. Wait for the drive to become ready or report an error. Signed-off-by: Michal Suchanek --- drivers/cdrom/cdrom.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom

[PATCH resend 2/6] cdrom: factor out common open_for_* code

2018-01-26 Thread Michal Suchanek
The open_for_audio and open_for_data copies are bitrotten in different ways already and will need to update the autoclose logic in both. Signed-off-by: Michal Suchanek --- drivers/cdrom/cdrom.c | 100 ++ 1 file changed, 36 insertions(+), 64

[PATCH resend 0/6] Fix cdrom autoclose

2018-01-26 Thread Michal Suchanek
ate from the harware specific drivers. First time I did not get any feedback for the patches. I found a defect in tray_close - it used status function without checking it exists. So resending with the defect corrected. Michal Suchanek (6): delay: add poll_event_interruptible cdrom: factor out co

[PATCH 0/6] Fix cdrom autoclose

2017-12-14 Thread Michal Suchanek
tate which is knowledge that never leaves the hardware-specific driver and is passed neither to userspace nor the generic cdrom driver. So this patchset fixes the kernel autoclose implementation in cdrom.c and to do so reports the "drive becoming ready" state from the harware speci

[PATCH 2/6] Documentation/admin-guide: backslash support in commandline.

2017-09-15 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- Documentation/admin-guide/kernel-parameters.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst index b2598cc9834c..722d3f771924 100644

[PATCH 4/6] powerpc/fadump: Update fadump ducumentation on quoting arguments.

2017-09-15 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- Documentation/powerpc/firmware-assisted-dump.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/powerpc/firmware-assisted-dump.txt b/Documentation/powerpc/firmware-assisted-dump.txt index 2df88524d2c7..5705f55ffae4 100644

[PATCH 6/6] Documentation/admin-guide: single quotes in kernel arguments.

2017-09-15 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- Documentation/admin-guide/kernel-parameters.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst index 722d3f771924..1f9837266417 100644

[PATCH 5/6] lib/cmdline.c: Implement single quotes in commandline argument parsing

2017-09-15 Thread Michal Suchanek
: Michal Suchanek --- lib/cmdline.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/cmdline.c b/lib/cmdline.c index d98bdc017545..c5335a79a177 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -191,34 +191,45 @@ bool parse_option_str(const char

[PATCH 3/6] powerpc/fadump: stop removing quotes in argument parsing.

2017-09-15 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/fadump.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 1678d99ea835..275ea42a27d5 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c

[PATCH 1/6] lib/cmdline.c: Add backslash support to kernel commandline parsing.

2017-09-15 Thread Michal Suchanek
. Signed-off-by: Michal Suchanek --- lib/cmdline.c | 41 - 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/cmdline.c b/lib/cmdline.c index 6d398a8b63fc..d98bdc017545 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -193,30 +193,36 @@ bool

[PATCH v8 3/6] lib/cmdline.c: Remove quotes symmetrically.

2017-09-12 Thread Michal Suchanek
Remove quotes from argument value only if there is qoute on both sides. Signed-off-by: Michal Suchanek --- lib/cmdline.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/cmdline.c b/lib/cmdline.c index 171c19b6888e..6d398a8b63fc 100644 --- a/lib/cmdline.c +++ b

[PATCH v8 2/6] powerpc/fadump: update documentation about 'fadump_extra_args=' parameter

2017-09-12 Thread Michal Suchanek
With the introduction of 'fadump_extra_args=' parameter to pass additional parameters to fadump (capture) kernel, update documentation about it. Signed-off-by: Hari Bathini Signed-off-by: Michal Suchanek --- Documentation/powerpc/firmware-assisted-dump.txt | 20 ++

[PATCH v8 5/6] boot/param: add pointer to current and next argument to unknown parameter callback

2017-09-12 Thread Michal Suchanek
The fadump parameter processing re-does the logic of next_arg quote stripping to determine where the argument ends. Pass pointer to the current and next argument instead to make this more robust. Signed-off-by: Michal Suchanek --- rebase on master split off changes to fadump.c add pointer to

[PATCH v8 6/6] powerpc/fadump: use the new parse_args callback arguments

2017-09-12 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/fadump.c | 47 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 8778e1cc0380..1678d99ea835 100644 --- a/arch

[PATCH v8 4/6] powerpc/fadump: update the dequoting logic to match lib/cmdline.c

2017-09-12 Thread Michal Suchanek
Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/fadump.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 0e08f1a80af2..b214c1e333dd 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc

[PATCH v8 1/6] powerpc/fadump: reduce memory consumption for capture kernel

2017-09-12 Thread Michal Suchanek
d-off-by: Hari Bathini Signed-off-by: Michal Suchanek --- Changes from v6: Correct and simplify quote handling. Ideally I would like to extend parse_args to give the length of the original quoted value to callback. However, parse_args removes at most one doubel-quote from the start and one from the

[PATCH v7 1/4] powerpc/fadump: reduce memory consumption for capture kernel

2017-08-17 Thread Michal Suchanek
ichael Ellerman Signed-off-by: Hari Bathini Signed-off-by: Michal Suchanek --- Changes from v6: Correct and simplify quote handling. Ideally I would like to extend parse_args to give the length of the original quoted value to callback. However, parse_args removes at most one doubel-quote from the

[PATCH v7 3/4] lib/cmdline.c Remove quotes symmetrically.

2017-08-17 Thread Michal Suchanek
Remove quotes from argument value only if there is qoute on both sides. Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/fadump.c | 6 ++ lib/cmdline.c| 7 ++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch

[PATCH v7 2/4] powerpc/fadump: update documentation about 'fadump_extra_args=' parameter

2017-08-17 Thread Michal Suchanek
From: Hari Bathini With the introduction of 'fadump_extra_args=' parameter to pass additional parameters to fadump (capture) kernel, update documentation about it. Signed-off-by: Hari Bathini Signed-off-by: Michal Suchanek --- Documentation/powerpc/firmware-assisted-dum

[PATCH v7 4/4] boot/param: add pointer to next argument to unknown parameter callback

2017-08-17 Thread Michal Suchanek
The fadump parameter processing re-does the logic of next_arg quote stripping to determine where the argument ends. Pass pointer to the next argument instead to make this more robust. Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/fadump.c | 13 + arch/powerpc/mm

[PATCH v4 RFT 2/2] powerpc/fadump: update documentation about 'fadump_append=' parameter

2017-05-02 Thread Michal Suchanek
With the introduction of 'fadump_append=' parameter to pass additional parameters to fadump (capture) kernel, update documentation about it. Signed-off-by: Hari Bathini Signed-off-by: Michal Suchanek --- Documentation/powerpc/firmware-assisted-dump.txt | 8 +++- 1 file

[PATCH v4 RFT 1/2] powerpc/fadump: reduce memory consumption for capture kernel

2017-05-02 Thread Michal Suchanek
able=memory and numa=off, to disable unwarranted resources/subsystems. Also, ensure the log "Firmware-assisted dump is active" is printed early in the boot process to put the subsequent fadump messages in context. Suggested-by: Michael Ellerman Signed-off-by: Hari Bathini Signed-o