aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-05-08ide: don't call memcpy with the same source and destinationMikulas Patocka1-1/+1
The parisc architecture recently reimplemented the memcpy function and their reimplementation crashed when source and destination overlapped. The crash happened in the function ide_complete_cmd where memcpy is called with the same source and destination pointer. According to the C specification, memcpy behavior is undefined if the source and destination range overlaps. This patches fixes the undefined behavior. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-08ide: use setup_timerGeliang Tang1-3/+1
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-26ide-pm: always pass 0 error to ide_complete_rq in ide_do_devsetChristoph Hellwig1-1/+1
The caller only looks at the scsi_request result field anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-04-26ide-pm: always pass 0 error to __blk_end_request_allChristoph Hellwig1-1/+1
ide_pm_execute_rq exectures a PM request synchronously, and in the failure case where it calls __blk_end_request_all it never checks the error field passed to the end_io callback, so don't bother setting it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-04-20scsi: introduce a result field in struct scsi_requestChristoph Hellwig13-59/+59
This passes on the scsi_cmnd result field to users of passthrough requests. Currently we abuse req->errors for this purpose, but that field will go away in its current form. Note that the old IDE code abuses the errors field in very creative ways and stores all kinds of different values in it. I didn't dare to touch this magic, so the abuses are brought forward 1:1. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-04-20block: remove the blk_execute_rq return valueChristoph Hellwig9-14/+19
The function only returns -EIO if rq->errors is non-zero, which is not very useful and lets a large number of callers ignore the return value. Just let the callers figure out their error themselves. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-03-02sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h>Ingo Molnar1-0/+1
We are going to split <linux/sched/task_stack.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/task_stack.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-02sched/headers: Prepare for new header dependencies before moving code to <linux/sched/nmi.h>Ingo Molnar1-0/+1
We are going to move softlockup APIs out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. <linux/nmi.h> already includes <linux/sched.h>. Include the <linux/nmi.h> header in the files that are going to need it. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-02-28Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ideLinus Torvalds1-1/+1
Pull IDE updates from David Miller: "Just one actual change here this time around, adding some init data annotations. The other change was bogus and got reverted" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: ide: palm_bk3710: add __initdata to palm_bk3710_port_info Revert "ide: Fix interface autodetection in legacy IDE driver (trial #2)" ide: Fix interface autodetection in legacy IDE driver (trial #2)
2017-02-27lib/vsprintf.c: remove %Z supportAlexey Dobriyan2-3/+3
Now that %z is standartised in C99 there is no reason to support %Z. Unlike %L it doesn't even make format strings smaller. Use BUILD_BUG_ON in a couple ATM drivers. In case anyone didn't notice lib/vsprintf.o is about half of SLUB which is in my opinion is quite an achievement. Hopefully this patch inspires someone else to trim vsprintf.c more. Link: http://lkml.kernel.org/r/20170103230126.GA30170@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27ide: palm_bk3710: add __initdata to palm_bk3710_port_infoBhumika Goyal1-1/+1
The object palm_bk3710_port_info of type ide_port_info is never referenced anywhere after initialization by palm_bk3710_probe. It is also passed as a parameter to ide_host_add which is called from the init function but this call doesn't store the object reference anywhere, and it only dereferences the values of the fields. Therefore add __initdata to its declaration. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-02-17Merge branch 'for-4.11/next' into for-4.11/linus-mergeJens Axboe17-215/+289
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-02-14cdrom: Make device operations read-onlyKees Cook1-1/+1
Since function tables are a common target for attackers, it's best to keep them in read-only memory. As such, this makes the CDROM device ops tables const. This drops additionally n_minors, since it isn't used meaningfully, and sets the only user of cdrom_dummy_generic_packet explicitly so the variables can all be const. Inspired by similar changes in grsecurity/PaX. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-01-31block: fold cmd_type into the REQ_OP_ spaceChristoph Hellwig13-82/+86
Instead of keeping two levels of indirection for requests types, fold it all into the operations. The little caveat here is that previously cmd_type only applied to struct request, while the request and bio op fields were set to plain REQ_OP_READ/WRITE even for passthrough operations. Instead this patch adds new REQ_OP_* for SCSI passthrough and driver private requests, althought it has to add two for each so that we can communicate the data in/out nature of the request. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-01-31ide: don't abuse cmd_typeChristoph Hellwig13-40/+72
Currently the legacy ide driver defines several request types of it's own, which is in the way of removing that field entirely. Instead add a type field to struct ide_request and use that to distinguish the different types of IDE-internal requests. It's a bit of a mess, but so is the surrounding code.. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-01-31block: make scsi_request and scsi ioctl support optionalChristoph Hellwig1-0/+1
We only need this code to support scsi, ide, cciss and virtio. And at least for virtio it's a deprecated feature to start with. This should shrink the kernel size for embedded device that only use, say eMMC a bit. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-01-27block: split scsi_request out of struct requestChristoph Hellwig16-107/+144
And require all drivers that want to support BLOCK_PC to allocate it as the first thing of their private data. To support this the legacy IDE and BSG code is switched to set cmd_size on their queues to let the block layer allocate the additional space. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2017-01-09Revert "ide: Fix interface autodetection in legacy IDE driver (trial #2)"David S. Miller1-2/+2
This reverts commit b2ae75052a8c1611b2030fa49ba1c6b6439fa04f. The inverse logic is intentional, and this change even breaks booting on some systems. Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-26ide: Fix interface autodetection in legacy IDE driver (trial #2)lramos.prof@yahoo.com.br1-2/+2
This humble patch was sent one or two months before, and had no actions, except for a colleague reply which friendly pointed out some formatting problems (which were solved in a second message). It relates to an old code, the legacy IDE driver, but the bug it addresses is real. The code, although rarely used, is still there to be compiled if one chooses to do so (like me). Also, the fix has a very low risk of present collateral effects IMHO. It is already compiled and tested in some embedded machines. So, again IMHO, it is worth be fixed. This email is a second trial with it. I hope it can help the one or two guys out there which are still running the legacy IDE driver and haven't noticed the former email. Fixes: 20df429dd667 ("ide-generic: handle probing of legacy io-ports v5") Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-24Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds6-6/+6
This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-28block: split out request-only flags into a new namespaceChristoph Hellwig6-35/+35
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 <hch@lst.de> Reviewed-by: Shaun Tancheff <shaun.tancheff@seagate.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2016-07-29Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ideLinus Torvalds4-5/+6
Pull IDE updates from David Miller: "Just a couple small bug fixes, nothing overly exciting in here" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: ide: missing break statement in set_timings_mdma() ide: hpt366: fix incorrect mask when checking at cmd_high_time ide-tape: fix misprint in failure handling in idetape_init() cmd640: add __init attribute
2016-07-27Merge tag 'leds_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-ledsLinus Torvalds1-1/+1
Pull LED updates from Jacek Anaszewski: "New LED class driver: - LED driver for TI LP3952 6-Channel Color LED LED core improvements: - Only descend into leds directory when CONFIG_NEW_LEDS is set - Add no-op gpio_led_register_device when LED subsystem is disabled - MAINTAINERS: Add file patterns for led device tree bindings LED Trigger core improvements: - return error if invalid trigger name is provided via sysfs LED class drivers improvements - is31fl32xx: define complete i2c_device_id table - is31fl32xx: fix typo in id and match table names - leds-gpio: Set of_node for created LED devices - pca9532: Add device tree support Conversion of IDE trigger to common disk trigger: - leds: convert IDE trigger to common disk trigger - leds: documentation: 'ide-disk' to 'disk-activity' - unicore32: use the new LED disk activity trigger - parisc: use the new LED disk activity trigger - mips: use the new LED disk activity trigger - arm: use the new LED disk activity trigger - powerpc: use the new LED disk activity trigger" * tag 'leds_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: is31fl32xx: define complete i2c_device_id table leds: is31fl32xx: fix typo in id and match table names leds: LED driver for TI LP3952 6-Channel Color LED leds: leds-gpio: Set of_node for created LED devices leds: triggers: return error if invalid trigger name is provided via sysfs leds: Only descend into leds directory when CONFIG_NEW_LEDS is set leds: Add no-op gpio_led_register_device when LED subsystem is disabled unicore32: use the new LED disk activity trigger parisc: use the new LED disk activity trigger mips: use the new LED disk activity trigger arm: use the new LED disk activity trigger powerpc: use the new LED disk activity trigger leds: documentation: 'ide-disk' to 'disk-activity' leds: convert IDE trigger to common disk trigger leds: pca9532: Add device tree support MAINTAINERS: Add file patterns for led device tree bindings
2016-07-26ide: missing break statement in set_timings_mdma()Dan Carpenter1-0/+1
There was clearly supposed to be a break statement here. Currently we use the k2 ata timings instead of sh ata ones we intended. Probably no one has this hardware anymore so it likely doesn't make a difference beyond the static checker warning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-26ide: hpt366: fix incorrect mask when checking at cmd_high_timeColin Ian King1-1/+1
According to the HPT366 data sheet, PCI config space dword 0x40-0x43 bits 11:8 specify the primary drive cmd_high_time, however, currently just 3 bits of the 4 are being used because the mask is 0x07 and not 0x0f. Fix the mask, allowing for the 40MHz clock to be detected. Also add in missing space between switch and parenthesis to clean up a checkpatch warning. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-26ide-tape: fix misprint in failure handling in idetape_init()Alexey Khoroshilov1-3/+3
If driver_register() failed there is no sense to call driver_unregister(). unregister_chrdev() should be called here. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-26cmd640: add __init attributeJulia Lawall1-1/+1
Add __init attribute on a function that is only called from other __init functions and that is not inlined, at least with gcc version 4.8.4 on an x86 machine with allyesconfig. Currently, the function is put in the .text.unlikely segment. Declaring it as __init will cause it to be put in the .init.text and to disappear after initialization. The result of objdump -x on the function before the change is as follows: 0000000000000000 l F .text.unlikely 00000000000000e4 cmd640x_init_one And after the change it is as follows: 00000000000000d2 l F .init.text 00000000000000df cmd640x_init_one Done with the help of Coccinelle. The semantic patch checks for local static non-init functions that are called from an __init function and are not called from any other function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-06-27block: convert to device_add_disk()Dan Williams2-4/+2
For block drivers that specify a parent device, convert them to use device_add_disk(). This conversion was done with the following semantic patch: @@ struct gendisk *disk; expression E; @@ - disk->driverfs_dev = E; ... - add_disk(disk); + device_add_disk(E, disk); @@ struct gendisk *disk; expression E1, E2; @@ - disk->driverfs_dev = E1; ... E2 = disk; ... - add_disk(E2); + device_add_disk(E1, E2); ...plus some manual fixups for a few missed conversions. Cc: Jens Axboe <axboe@fb.com> Cc: Keith Busch <keith.busch@intel.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: David S. Miller <davem@davemloft.net> Cc: James Bottomley <James.Bottomley@hansenpartnership.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2016-06-20leds: convert IDE trigger to common disk triggerStephan Linz1-1/+1
This patch converts the IDE specific LED trigger to a generic disk activity LED trigger. The libata core is now a trigger source just like before the IDE disk driver. It's merely a replacement of the string ide by disk. The patch is taken from http://dev.gentoo.org/~josejx/ata.patch and is widely used by any ibook/powerbook owners with great satisfaction. Likewise, it is very often used successfully on different ARM platforms. Unlike the original patch, the existing 'ide-disk' trigger is still available for backward compatibility. That reduce the amount of patches in affected device trees out of the mainline kernel. For further development, the new name 'disk-activity' should be used. Cc: Joseph Jezak <josejx@gentoo.org> Cc: Jörg Sommer <joerg@alea.gnuu.de> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Stephan Linz <linz@li-pro.net> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2016-06-07block, drivers: add REQ_OP_FLUSH operationMike Christie1-1/+1
This adds a REQ_OP_FLUSH operation that is sent to request_fn based drivers by the block layer's flush code, instead of sending requests with the request->cmd_flags REQ_FLUSH bit set. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2016-06-07ide cd: do not set REQ_WRITE on requests.Mike Christie1-3/+0
The block layer will set the correct READ/WRITE operation flags/fields when creating a request, so there is not need for drivers to set the REQ_WRITE flag. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2016-06-07drivers: use req op accessorMike Christie1-1/+1
The req operation REQ_OP is separated from the rq_flag_bits definition. This converts the block layer drivers to use req_op to get the op from the request struct. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
2016-04-12ide-disk: update to using blk_queue_write_cache()Jens Axboe1-3/+3
Signed-off-by: Jens Axboe <axboe@fb.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2016-03-20ide: palm_bk3710: test clock rate to avoid division by 0Wolfram Sang1-0/+2
The clk API may return 0 on clk_get_rate, so we should check the result before using it as a divisor. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-20ide: icside: remove incorrect initconst annotationArnd Bergmann1-1/+1
The icside_probe function can be called for hotplugged devices, so its reference to the __initconst icside_v6_port_info variable may be invalid, as Kbuild points out: WARNING: drivers/ide/icside.o(.text+0x338): Section mismatch in reference from the function icside_probe() to the (unknown reference) .init.rodata:(unknown) Interestingly, this problem only shows up with clang but not with gcc, which optimizes out the __initconst variable. This removes the incorrect annotation. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-17ide: hpt366: convert to use match_string() helperAndy Shevchenko1-7/+2
The new helper returns index of the mathing string in an array. We would use it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-02-05PCI: Remove includes of asm/pci-bridge.hBjorn Helgaas2-2/+0
Drivers should include asm/pci-bridge.h only when they need the arch- specific things provided there. Outside of the arch/ directories, the only drivers that actually need things provided by asm/pci-bridge.h are the powerpc RPA hotplug drivers in drivers/pci/hotplug/rpa*. Remove the includes of asm/pci-bridge.h from the other drivers, adding an include of linux/pci.h if necessary. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-01-18drivers/ide: make ide-scan-pci.c driver explicitly non-modularPaul Gortmaker1-2/+1
The Kconfig for this support is currently: config IDEPCI_PCIBUS_ORDER bool "Probe IDE PCI devices in the PCI bus order (DEPRECATED)" ...meaning that it currently is not being built as a module by anyone. Lets change the initcall to be the equivalent device_initcall, so that when reading the driver code, there is no doubt it is builtin-only. Unlike other similar changes, we leave the module.h header to be included since this code interacts with other drivers and needs to know what a struct module is. Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-ide@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-18ide: constify ide_dma_ops structuresJulia Lawall2-2/+2
The ide_dma_ops structures are never modified, so declare these as const, as is already done for the others. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-18ide: silence some underflow warningsDan Carpenter1-8/+8
Back in the day we used to just say this code was root only so it was ok that the bounds checking was sloppy. These days it annoys static checkers so we fix it. In the original code "c > INT_MAX" was never true since "c" was an int. I am not sure what was intended so I left it alone. But because I made "c" unsigned it means we don't have a warning any more. The second warning is that we cap "i" but allow negatives leading to an underflow of the ide_disks_chs[] array. The third set of warnings is because these values come from the user and we cap most of the upper bounds but allow negative values. Negative cylinders doesn't make sense. drivers/ide/ide.c:262 ide_set_disk_chs() warn: impossible condition '(c > ((~0 >> 1))) => (s32min-s32max > s32max)' drivers/ide/ide.c:270 ide_set_disk_chs() warn: check 'ide_disks_chs[i]' for negative offsets 'i' = s32min. extra = 's32min-19' drivers/ide/ide.c:271 ide_set_disk_chs() warn: no lower bound on 'h' Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-06mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIMMel Gorman10-14/+14
__GFP_WAIT was used to signal that the caller was in atomic context and could not sleep. Now it is possible to distinguish between true atomic context and callers that are not willing to sleep. The latter should clear __GFP_DIRECT_RECLAIM so kswapd will still wake. As clearing __GFP_WAIT behaves differently, there is a risk that people will clear the wrong flags. This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly indicate what it does -- setting it allows all reclaim activity, clearing them prevents it. [akpm@linux-foundation.org: fix build] [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Christoph Lameter <cl@linux.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Vitaly Wool <vitalywool@gmail.com> Cc: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-03ide: pdc202xx_new: Replace timeval with ktime_tAmitoj Kaur Chawla1-5/+5
This driver uses 'struct timeval' which we are trying to remove since 32 bit time types will break in the year 2038 by replacing it with ktime_t. This patch changes do_gettimeofday() to ktime_get() because ktime_get() returns a ktime_t while do_gettimeofday() returns struct timeval. This patch also uses ktime_us_delta() to get the elapsed time. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-07-01Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linuxLinus Torvalds1-1/+1
Pull module updates from Rusty Russell: "Main excitement here is Peter Zijlstra's lockless rbtree optimization to speed module address lookup. He found some abusers of the module lock doing that too. A little bit of parameter work here too; including Dan Streetman's breaking up the big param mutex so writing a parameter can load another module (yeah, really). Unfortunately that broke the usual suspects, !CONFIG_MODULES and !CONFIG_SYSFS, so those fixes were appended too" * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (26 commits) modules: only use mod->param_lock if CONFIG_MODULES param: fix module param locks when !CONFIG_SYSFS. rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE() module: add per-module param_lock module: make perm const params: suppress unused variable error, warn once just in case code changes. modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'. kernel/module.c: avoid ifdefs for sig_enforce declaration kernel/workqueue.c: remove ifdefs over wq_power_efficient kernel/params.c: export param_ops_bool_enable_only kernel/params.c: generalize bool_enable_only kernel/module.c: use generic module param operaters for sig_enforce kernel/params: constify struct kernel_param_ops uses sysfs: tightened sysfs permission checks module: Rework module_addr_{min,max} module: Use __module_address() for module_address_lookup() module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING module: Optimize __module_address() using a latched RB-tree rbtree: Implement generic latch_tree seqlock: Introduce raw_read_seqcount_latch() ...
2015-06-25Merge branch 'for-4.2/core' of git://git.kernel.dk/linux-blockLinus Torvalds12-44/+74
Pull core block IO update from Jens Axboe: "Nothing really major in here, mostly a collection of smaller optimizations and cleanups, mixed with various fixes. In more detail, this contains: - Addition of policy specific data to blkcg for block cgroups. From Arianna Avanzini. - Various cleanups around command types from Christoph. - Cleanup of the suspend block I/O path from Christoph. - Plugging updates from Shaohua and Jeff Moyer, for blk-mq. - Eliminating atomic inc/dec of both remaining IO count and reference count in a bio. From me. - Fixes for SG gap and chunk size support for data-less (discards) IO, so we can merge these better. From me. - Small restructuring of blk-mq shared tag support, freeing drivers from iterating hardware queues. From Keith Busch. - A few cfq-iosched tweaks, from Tahsin Erdogan and me. Makes the IOPS mode the default for non-rotational storage" * 'for-4.2/core' of git://git.kernel.dk/linux-block: (35 commits) cfq-iosched: fix other locations where blkcg_to_cfqgd() can return NULL cfq-iosched: fix sysfs oops when attempting to read unconfigured weights cfq-iosched: move group scheduling functions under ifdef cfq-iosched: fix the setting of IOPS mode on SSDs blktrace: Add blktrace.c to BLOCK LAYER in MAINTAINERS file block, cgroup: implement policy-specific per-blkcg data block: Make CFQ default to IOPS mode on SSDs block: add blk_set_queue_dying() to blkdev.h blk-mq: Shared tag enhancements block: don't honor chunk sizes for data-less IO block: only honor SG gap prevention for merges that contain data block: fix returnvar.cocci warnings block, dm: don't copy bios for request clones block: remove management of bi_remaining when restoring original bi_end_io block: replace trylock with mutex_lock in blkdev_reread_part() block: export blkdev_reread_part() and __blkdev_reread_part() suspend: simplify block I/O handling block: collapse bio bit space block: remove unused BIO_RW_BLOCK and BIO_EOF flags block: remove BIO_EOPNOTSUPP ...
2015-05-28kernel/params: constify struct kernel_param_ops usesLuis R. Rodriguez1-1/+1
Most code already uses consts for the struct kernel_param_ops, sweep the kernel for the last offending stragglers. Other than include/linux/moduleparam.h and kernel/params.c all other changes were generated with the following Coccinelle SmPL patch. Merge conflicts between trees can be handled with Coccinelle. In the future git could get Coccinelle merge support to deal with patch --> fail --> grammar --> Coccinelle --> new patch conflicts automatically for us on patches where the grammar is available and the patch is of high confidence. Consider this a feature request. Test compiled on x86_64 against: * allnoconfig * allmodconfig * allyesconfig @ const_found @ identifier ops; @@ const struct kernel_param_ops ops = { }; @ const_not_found depends on !const_found @ identifier ops; @@ -struct kernel_param_ops ops = { +const struct kernel_param_ops ops = { }; Generated-by: Coccinelle SmPL Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Junio C Hamano <gitster@pobox.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Kees Cook <keescook@chromium.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-11Merge branch 'for-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libataLinus Torvalds3-897/+0
Pull libata fixes from Tejun Heo: "Rather big for fixes pull. - SCC controllers never lived to see the light of the day. Both libata and ide drivers removed. - In some configurations, link power management policy changes sometimes cause delayed spurious PHY events which can develop into noticeable failures. This has been reported several times over the years. Gabriele's patches suppress PHY events for a while after LPM policy changes which should help most of these failures without causing too much problem for hotplug use cases. - A few controller specific fixes" [ Hmm. I don't think removing SSC support is really a "fix", but hey, it removes a lot of lines of code. Which I like. So ... good riddance ] * 'for-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: ahci: avoton port-disable reset-quirk ata: select DW_DMAC in case of SATA_DWC libata: Blacklist queued TRIM on all Samsung 800-series libata: Ignore spurious PHY event on LPM policy change libata: Add helper to determine when PHY events should be ignored ata: ahci_st: fixup layering violations / drvdata errors Remove celleb-only SCC PATA drivers
2015-05-05block: move PM request support to IDEChristoph Hellwig4-19/+49
This removes the request types and hacks from the block code and into the old IDE driver. There is a small amunt of code duplication due to this, but it's not too bad. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2015-05-05block: move REQ_TYPE_SENSE to the ide driverChristoph Hellwig4-9/+9
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2015-05-05block: rename REQ_TYPE_SPECIAL to REQ_TYPE_DRV_PRIVChristoph Hellwig10-16/+16
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
2015-04-17ide: remove deprecated use of pci apiQuentin Lambert4-7/+6
Replace occurences of the pci api by appropriate call to the dma api. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr) @deprecated@ idexpression id; position p; @@ ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @bad1@ idexpression id; position deprecated.p; @@ ...when != &id->dev when != pci_get_drvdata ( id ) when != pci_enable_device ( id ) ( pci_dma_supported@p ( id, ...) | pci_alloc_consistent@p ( id, ...) ) @depends on !bad1@ idexpression id; expression direction; position deprecated.p; @@ ( - pci_dma_supported@p ( id, + dma_supported ( &id->dev, ... + , GFP_ATOMIC ) | - pci_alloc_consistent@p ( id, + dma_alloc_coherent ( &id->dev, ... + , GFP_ATOMIC ) ) Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>