03 Aug, 2018
2 commits
-
There is a lot of needless struct request_sense usage in the CDROM
code. These can all be struct scsi_sense_hdr instead, to avoid any
confusion over their respective structure sizes. This patch is a lot
of noise changing "sense" to "sshdr", but the final code is more
readable to distinguish between "sense" meaning "struct request_sense"
and "sshdr" meaning "struct scsi_sense_hdr".Reviewed-by: Christoph Hellwig
Signed-off-by: Kees Cook
Signed-off-by: Jens Axboe -
This drops unused sense buffers from:
cdrom_eject()
cdrom_read_capacity()
cdrom_read_tocentry()
ide_cd_lockdoor()
ide_cd_read_toc()Acked-by: David S. Miller
Reviewed-by: Christoph Hellwig
Signed-off-by: Kees Cook
Signed-off-by: Jens Axboe
18 Mar, 2018
1 commit
-
It happens often while I'm preparing a patch for a block driver that
I'm wondering: is a definition of SECTOR_SIZE and/or SECTOR_SHIFT
available for this driver? Do I have to introduce definitions of these
constants before I can use these constants? To avoid this confusion,
move the existing definitions of SECTOR_SIZE and SECTOR_SHIFT into the
header file such that these become available for all
block drivers. Make the SECTOR_SIZE definition in the uapi msdos_fs.h
header file conditional to avoid that including that header file after
causes the compiler to complain about a SECTOR_SIZE
redefinition.Note: the SECTOR_SIZE / SECTOR_SHIFT / SECTOR_BITS definitions have
not been removed from uapi header files nor from NAND drivers in
which these constants are used for another purpose than converting
block layer offsets and sizes into a number of sectors.Cc: David S. Miller
Cc: Mike Snitzer
Cc: Dan Williams
Cc: Minchan Kim
Cc: Nitin Gupta
Reviewed-by: Sergey Senozhatsky
Reviewed-by: Christoph Hellwig
Reviewed-by: Johannes Thumshirn
Reviewed-by: Martin K. Petersen
Signed-off-by: Bart Van Assche
Signed-off-by: Jens Axboe
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
28 Oct, 2016
1 commit
-
A lot of the REQ_* flags are only used on struct requests, and only of
use to the block layer and a few drivers that dig into struct request
internals.This patch adds a new req_flags_t rq_flags field to struct request for
them, and thus dramatically shrinks the number of common requests. It
also removes the unfortunate situation where we have to fit the fields
from the same enum into 32 bits for struct bio and 64 bits for
struct request.Signed-off-by: Christoph Hellwig
Reviewed-by: Shaun Tancheff
Signed-off-by: Jens Axboe
10 Mar, 2011
1 commit
-
Convert ->media_changed() to the new ->check_events() method. The
conversion is mostly mechanical. The only notable change is that
cdrom now doesn't generate any event if @slot_nr isn't CDSL_CURRENT.
It used to return -EINVAL which would be treated as media changed. As
media changer isn't supported anyway, this doesn't make any
difference.This makes ide emit the standard disk events and allows kernel event
polling. Currently, only MEDIA_CHANGE event is implemented. Adding
support for EJECT_REQUEST shouldn't be difficult; however, given that
ide driver is already deprecated, it probably is best to leave it
alone.Signed-off-by: Tejun Heo
Acked-by: Jens Axboe
Cc: Kay Sievers
Cc: "David S. Miller"
Cc: linux-ide@vger.kernel.org
19 Apr, 2009
1 commit
-
Preallocate a sense request in the ->do_request method and reinitialize
it only on demand, in case it's been consumed in the IRQ handler path.
The reason for this is that we don't want to be mapping rq to bio in
the IRQ path and introduce all kinds of unnecessary hacks to the block
layer.tj: * Both user and kernel PC requests expect sense data to be stored
in separate storage other than drive->sense_data. Copy sense
data to rq->sense on completion if rq->sense is not NULL. This
fixes bogus sense data on PC requests.As a result, remove cdrom_queue_request_sense.
CC: Bartlomiej Zolnierkiewicz
CC: FUJITA Tomonori
Signed-off-by: Borislav Petkov
Signed-off-by: Tejun Heo
27 Mar, 2009
2 commits
-
There should be no functionality change resulting from this patch.
Suggested-by: Bartlomiej Zolnierkiewicz
Signed-off-by: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz -
and more specifically, push __func__ into debug
macro thus making ide_debug_log() calls shorter and more readable.Signed-off-by: Borislav Petkov
26 Feb, 2009
1 commit
-
During host driver module removal del_gendisk() results in a final
put on drive->gendev and freeing the drive by drive_release_dev().Convert device drivers from using struct kref to use struct device
so device driver's object holds reference on ->gendev and prevents
drive from prematurely going away.Also fix ->remove methods to not erroneously drop reference on a
host driver by using only put_device() instead of ide*_put().Reported-by: Stanislaw Gruszka
Tested-by: Stanislaw Gruszka
Signed-off-by: Bartlomiej Zolnierkiewicz
07 Jan, 2009
2 commits
-
While at it:
- s/struct ide_driver_s/struct ide_driver/
- use to_ide_driver() macro in ide-proc.cSigned-off-by: Bartlomiej Zolnierkiewicz
-
Just use u8 instead, also s/__u8/u8/ in ide-cd.h while at it.
Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz
02 Jan, 2009
2 commits
-
- cdrom_timer_expiry -> ide_cd_expiry
- remove expiry-arg to ide_issue_pc as it is redundant now
- ide_debug_log -> debug_logSigned-off-by: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz -
While at it:
- disable compiling-in debug support by defaultSigned-off-by: Borislav Petkov
[bart: fixup patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz
30 Dec, 2008
1 commit
-
It doesn't make much sense nowadays and is problematic on some drives.
Cc: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz
14 Oct, 2008
1 commit
-
There should be no functionality change resulting from this patch.
Signed-off-by: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz
24 Jul, 2008
1 commit
-
There should be no functionality change resulting from this patch.
[bart: IDE_FLAG_* -> IDE_AFLAG_*, dev_flags -> atapi_flags]
Signed-off-by: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz
16 Jul, 2008
2 commits
-
ide_cd_init_rq is not used by ide-cd_ioctl any more. Only
cdrom_queue_request_sense use it. This converts
cdrom_queue_request_sense to use blk_rq_init directly and removes
ide_cd_init_rq.Signed-off-by: FUJITA Tomonori
Cc: Borislav Petkov
Cc: Jens Axboe
Signed-off-by: Bartlomiej Zolnierkiewicz -
This converts ide_cd_queue_pc to use blk_execute_rq, necessitating
changing the ide_cd_queue_pc prototype into a form that doesn't takes
a pointer to request struct. ide_cd_queue_pc works like scsi_execute.Signed-off-by: FUJITA Tomonori
Cc: Borislav Petkov
Cc: Jens Axboe
Signed-off-by: Bartlomiej Zolnierkiewicz
26 Apr, 2008
1 commit
-
This removes the internal ide-cd buffer and falls back to read-ahead block layer
capabilities. Thorough testing (cd burning, dvd read, raw read) gives with the
bufferless mode marginally better performance in addition to simplified code.bufferless:
dd: reading `/dev/hdc': Input/output error
6238+0 records in
6238+0 records out
204406784 bytes (204 MB) copied, 259.891 s, 787 kB/sreal 4m21.598s
user 0m0.014s
sys 0m0.744swith the old buffer (2.6.25-rc1):
dd: reading `/dev/hdc': Input/output error
6238+0 records in
6238+0 records out
204406784 bytes (204 MB) copied, 262.893 s, 778 kB/sreal 4m22.938s
user 0m0.009s
sys 0m0.771sSigned-off-by: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz
02 Feb, 2008
18 commits
-
Delete filenames/versions from comments.
I'm leaving decisions about adding DRV_VERSION defines and MODULE_VERSION()-s
to maintainers of the respective drivers.While at it:
* Remove unused VERSION define from ide.c.
* Remove unused/stale DRV_VERSION define from au1xxx-ide.c.
Signed-off-by: Bartlomiej Zolnierkiewicz
-
There should be no functional changes from this.
Signed-off-by: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz -
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz
-
* Rename ide-cd kernel module to ide-cd_mod in preparation to moving code out
from ide-cd.[c,h]. Add MODULE_ALIAS("ide-cd") to preserve compatibility.* Move VERBOSE_IDE_CD_ERRORS code from ide-cd.[c,h] to ide-cd_verbose.c.
ide-cd_verbose.c is IDE subsystem independent and may be easily converted
into generic library usable by other drivers (i.e. libata) if needed.* Add CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS config option to drivers/ide/Kconfig
replacing VERBOSE_IDE_CD_ERRORS define. Make this config option enabled by
default and visible only if CONFIG_EMBEDDED is defined.before the patch:
text data bss dec hex filename
22841 360 1056 24257 5ec1 drivers/ide/ide-cd.oafter the patch w/ CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y:
text data bss dec hex filename
22857 360 1056 24273 5ed1 drivers/ide/ide-cd_mod.oafter the patch w/ CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=n:
text data bss dec hex filename
15091 360 1056 16507 407b drivers/ide/ide-cd_mod.oSigned-off-by: Bartlomiej Zolnierkiewicz
-
* Coding style fixes for VERBOSE_IDE_CD_ERRORS code.
* Add KERN_{ERR,CONT} printk() levels where needed.
This is a preparation for moving this code out of ide-cd.[c,h].
Signed-off-by: Bartlomiej Zolnierkiewicz
-
ide-cd.c already uses sense keys definitions from .
Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz -
Re-organize handling of quirky devices:
* Add struct cd_list_entry, ide_cd_quirks_list[] and ide_cd_flags() helper.
* Set flags returned by ide_cd_flags() in ide_cdrom_setup().
* Add IDE_CD_FLAG_VERTOS_{300_SDD,600_ESD} and IDE_CD_FLAG_SANYO_3CD flags.
* Move device quirks from ide_cdrom_setup() to ide_cd_quirks_list[].
* Rename IDE_CD_FLAG_NEC260 to IDE_CD_FLAG_PRE_ATAPI12 and handle
quirky Stingray 8X CD-ROM using ide_cd_quirks_list[].* Add IDE_CD_FLAG_FULL_CAPS_PAGE flag and handle quirky ACER 50X CD-ROM
/ WPI 32X CD-ROM using ide_cd_quirk_list[].* Add IDE_CD_FLAG_PLAY_AUDIO_OK flag and handle quirky MATSHITA DVD-ROMs
using ide_cd_quirks_list[].* Add IDE_CD_FLAG_LE_SPEED_FIELDS flag and handle quirky ACER/AOpen 24X
CD-ROM using ide_cd_quirk_list[].* Fix some comments about quirky devices while at it.
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz
-
Remove STANDARD_ATAPI define + drive-by coding style fixes.
Signed-off-by: Bartlomiej Zolnierkiewicz
-
Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz -
* Remove unused ->{writing,reserved} fields from struct ide_cd_config_flags.
* Move ->max_speed from struct ide_cd_config_flags to struct cdrom_info.
* Move ->current_speed from struct ide_cd_state_flags to struct cdrom_info.
* Add defines for config and state flags.
* Add 'unsigned int cd_flags' to struct cdrom_info and use ->cd_flags
instead of ->{config,state}_flags.* Remove no longer needed struct ide_cd_{config,state}_flags.
Signed-off-by: Bartlomiej Zolnierkiewicz
-
* Remove struct atapi_capabilities_page.
* Add ATAPI_CAPABILITIES_PAGE[_PAD]_SIZE define.
v2:
* The buf[] array access indexes were swapped between 'curspeed'/'maxspeed'.
(Noticed by Borislav Petkov).Cc: Borislav Petkov
Signed-off-by: Bartlomiej Zolnierkiewicz -
While at it rename 'info' variable to 'cd' in cdrom_saw_media_change().
Signed-off-by: Bartlomiej Zolnierkiewicz
-
While at it rename 'info' variable to 'cd' in
ide_cdrom_probe_capabilities() and ide_cdrom_setup().Signed-off-by: Bartlomiej Zolnierkiewicz
-
* Use CDC_* flags directly and remove redundant flags from ->config_flags.
While at it:
* Add KERN_CONT to printk()-s in ide_cdrom_probe_capabilities().Signed-off-by: Bartlomiej Zolnierkiewicz
-
* Remove ->changer_info from struct cdrom_info (it is never allocated).
* Remove unused struct atapi_{mechstat_header,changer_info,slot}.
Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz -
unused fields:
* ->writing
* ->reservedwrite-only fields:
* ->playmsf_as_bcd
* ->subchan_as_bcd
* ->test_write
* ->supp_disc_presentAcked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz -
Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz -
Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz
24 Dec, 2007
1 commit
-
cdi->mask is cleared by ide_cdrom_register() which is called after the quirk.
Fix it by adding new ->no_speed_select flag to struct ide_cd_config_flags
and using it in ide_cdrom_register() to set CDC_SELECT_SPEED flag.Acked-by: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz
10 Jul, 2007
1 commit
-
Delete the unnecessary macro ARY_LEN and use ARRAY_SIZE directly.
Signed-off-by: Robert P. J. Day
Signed-off-by: Bartlomiej Zolnierkiewicz