aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2011-05-25mtd: mtdswap: fix possible null dereferenceMaxin B. John1-1/+7
This patch fixes the possible null dereference of the variable "oinfo" Thanks to Coverity for spotting this. Signed-off-by: Maxin B. John <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: remove duplicate assignment of chip->stateTadashi Abe3-3/+0
This is a trivial patch which removes unnecessary assignment of chip->state in put_chip(). It's duplicated. Signed-off-by: Tadashi Abe <[email protected]> Acked-by: Joakim Tjernlund <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: fix hang-up in cfi erase and read contentionTadashi Abe4-15/+6
cfi erase command hangs up when erase and read contention occurs. If read runs at the same address as erase operation, read issues Erase-Suspend via get_chip() and the erase goes into sleep in wait queue. But in this case, read operation exits by time-out without waking it up. I think the other variants (0001, 0020 and lpddr) have the same problem too. Tested and verified the patch only on CFI-0002 flash, though. Signed-off-by: Tadashi Abe <[email protected]> Acked-by: Joakim Tjernlund <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: simplify get_mtd_device_nm functionWanlong Gao1-11/+2
'get_mtd_device_nm()' has a piece of code which equivalent to what '__get_mtd_device()' does - remove this duplicated code and use ''__get_mtd_device()' instead. Artem: changed commit message. Artem: while on it, remove an unnecessary extra empty line Signed-off-by: Wanlong Gao <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: be silent when mtd partition parser cannot be foundArtem Bityutskiy1-4/+1
Currently when we register partitions in 'parse_mtd_partitions()' we accept the list of parsers we should try. And if one of the parsers was not found we print a message. Well, first of all this whole idea is bad - look at how many 'part_probes' and 'part_probe_types' variables we have - nearly every driver defines one. Instead, we should just go through all registered parsers all the time. But this needs to be worked on separately. This patch makes life of MTD partitions' users a bit simpler and allows them to safely request parsers which have not been registered - 'parse_mtd_partitions()' will not print a "not available" message in this case. The point is that drivers do not have to do things like this any longer: static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "afs", NULL }; but can simply do like this: static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "afs", NULL }; Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: convert to seq_file interfaceAlexey Dobriyan1-31/+19
->read_proc interface is going away, switch to seq_file. Signed-off-by: Alexey Dobriyan <[email protected]> Acked-by: Mike Frysinger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: omap: fix subpage ecc issue with prefetchKishore Kadiyala1-7/+5
When reading/writing a subpage (When HW ECC is not available/enabled) for number of bytes not aligned to 4, the mis-aligned bytes are handled first (by cpu copy method) before enabling the Prefetch engine to/from 'p'(start of buffer 'buf'). Then it reads/writes rest of the bytes with the help of Prefetch engine, if available, or again using cpu copy method. Currently, reading/writing of rest of bytes, is not done correctly since its trying to read/write again to/from begining of buffer 'buf', overwriting the mis-aligned bytes. Read & write using prefetch engine got broken in commit '2c01946c'. We never hit a scenario of not getting 'gpmc_prefetch_enable' call success. So, problem did not get caught up. Signed-off-by: Kishore Kadiyala <[email protected]> Signed-off-by: Vimal Singh <[email protected]> Reported-by: Bryan DE FARIA <[email protected]> Cc: [email protected] [2.6.35+] Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: sst25l: fix section markingsMike Frysinger1-3/+3
The previous section mismatch fix for this driver wasn't entirely correct. The sst25l_flash_info array is now used in the devinit probe func, but is marked as initdata, so building results in the warning: WARNING: drivers/mtd/devices/sst25l.o(.devinit.text): Section mismatch in reference from the function sst25l_probe() to the variable .init.data:sst25l_flash_info Further, the remove func should be devexit rather than exit to match the probe func. Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: m25p80: Add Spansion S25FL512S, S70FL01GSKevin Cernekee1-0/+2
S25FL512S = 64MiB single die, same family as S25FL256S S70FL01GS = 2x S25FL512S dies in one package (separate chip selects) These devices are not sampling yet, but they are expected to be very similar to S25FL256S, which has been tested. Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: m25p80: Add Spansion S25FL256SKevin Cernekee1-5/+17
These are 32MiB parts which use a slightly different 4-byte enable sequence from Macronix. Default to the Spansion 4-byte scheme in set_4byte(), as it is more likely to be copied by other vendors. Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: m25p80: Clean up JEDEC manufacturer checksKevin Cernekee1-4/+7
Use the manufacturer ID names from cfi.h instead of hard-coding hex constants. Introduce a JEDEC_MFR macro for clarity. Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: m25p80: Add Numonyx m25px32 familyKevin Cernekee1-1/+4
Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: denali: detect the number of banksJamie Iles2-9/+21
Not all configurations of the Denali controller support 4 banks. The controller can support between 1 and 16 banks. Detect this from the design features register. Signed-off-by: Jamie Iles <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: denali: remove nearly-duplicated register definitionsJamie Iles2-395/+110
The controller has interrupt enable/status register pairs for each bank (along with ECC and status registers) that differ only in address offset. Rather than providing definitions for each register, make the address a macro so that it scales for devices with different numbers of banks. Signed-off-by: Jamie Iles <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: denali: convert to generic DMA APIJamie Iles2-44/+40
Rather than using the PCI specific DMA API, convert to the generic DMA API so that we can use the Denali NAND controller on other bus types. Signed-off-by: Jamie Iles <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: onenand: add missing check[email protected]1-1/+1
Coverity has reported that inside the function "onenand_block_by_block_erase()" in onenand_base.c, we should add a check to prevent the incrementing of possible NULL value for "region" Signed-off-by: Maxin B. John <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: return badblockbits backArtem Bityutskiy1-0/+2
In commit c7b28e25cb9beb943aead770ff14551b55fa8c79 the initialization of the backblockbits was accidentally removed. This patch returns it back, because otherwise some NAND drivers are broken. This problem was reported by "Saxena, Parth <[email protected]>" here: http://lists.infradead.org/pipermail/linux-mtd/2011-April/035221.html Reported-by: Saxena, Parth <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Tested-by: Saxena, Parth <[email protected]> Acked-by: Saxena, Parth <[email protected]> Acked-by: Brian Norris <[email protected]> Cc: [email protected] [2.6.36+] Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: nand: ndfc: add multiple chip select supportFelix Radensky1-17/+35
This patch extends NDFC driver to support all 4 chip selects available in NDFC NAND controller. Tested on custom 460EX board with 2 chip select NAND device. Artem: white-space cleanups Signed-off-by: Felix Radensky <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: mtdchar: retry large buffer allocationsGrant Erickson1-27/+23
Replace direct call to kmalloc for a potentially large, contiguous buffer allocation with one to mtd_kmalloc_up_to which helps ensure the operation can succeed under low-memory, highly- fragmented situations albeit somewhat more slowly. Signed-off-by: Grant Erickson <[email protected]> Tested-by: Ben Gardiner <[email protected]> Tested-by: Stefano Babic <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: create function to perform large allocationsGrant Erickson1-0/+49
Introduce a common function to handle large, contiguous kmalloc buffer allocations by exponentially backing off on the size of the requested kernel transfer buffer until it succeeds or until the requested transfer buffer size falls below the page size. This helps ensure the operation can succeed under low-memory, highly- fragmented situations albeit somewhat more slowly. Artem: so this patch solves the problem that the kernel tries to kmalloc too large buffers, which (a) may fail and does fail - people complain about this, and (b) slows down the system in case of high memory fragmentation, because the kernel starts dropping caches, writing back, swapping, etc. But we do not really have to allocate a lot of memory to do the I/O, we may do this even with as little as one min. I/O unit (NAND page) of RAM. So the idea of this patch is that if the user asks to read or write a lot, we try to kmalloc a lot, with GFP flags which make the kernel _not_ drop caches, etc. If we can allocate it - good, if not - we try to allocate twice as less, and so on, until we reach the min. I/O unit size, which is our last resort allocation and use the normal GFP_KERNEL flag. Artem: re-write the allocation function so that it makes sure the allocated buffer is aligned to the min. I/O size of the flash. Signed-off-by: Grant Erickson <[email protected]> Tested-by: Ben Gardiner <[email protected]> Tested-by: Stefano Babic <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: mtdconcat: fix NAND OOB writeFelix Radensky1-2/+2
Currently mtdconcat is broken for NAND. An attemtpt to create JFFS2 filesystem on concatenation of several NAND devices fails with OOB write errors. This patch fixes that problem. Signed-off-by: Felix Radensky <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Cc: [email protected] Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: omap2: mtd split nand_scan in ident and tailJan Weitzel1-2/+8
nand_scan calls nand_scan_tail and here we got a ecc.layout and calculate oobavail for this layout. After calling nand_scan, we change the layout pointer if OMAP_ECC_HAMMING_CODE_HW_ROMCODE is set. This results in not calcluated oobavail. Mountig as jffs2 is not possible. To fix that nand_scan has to split up in nand_scan_ident and nand_scan_tail setting ecc.layout between these calls. So nand_scan_tail calculates oobvail for the used layout. This is also done in serveral other platforms. Signed-off-by: Jan Weitzel <[email protected]> Reviewed-by: Vimal Singh <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: mtd_blkdevs: fix error path in blktrans_openArtem Bityutskiy1-3/+21
The 'blktrans_open()' does not handle possible '__get_mtd_device()' failures because it does not check the error code. Moreover, the 'dev->tr->open()' failures are not handled correctly because in this case the function just goes ahead and gets the mtd device, then returns an error. But Instead, it should _not_ try to get the mtd device, then it should put back the module and the kref. This patch fixes the issue. Note, I only compile-tested it. This patch was inspired by a bug report about a similar issue in 2.6.34 kernels sent by Mike Turner <[email protected]> to the MTD mailing list: http://lists.infradead.org/pipermail/linux-mtd/2011-April/034980.html Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: atmel_nand: add missing include of linux/dmaengine.hHans-Christian Egtvedt1-0/+1
Including linux/dmaengine.h fixes the missing definition of the enum dma_ctrl_flags type used in atmel_nand_dma_op function. Signed-off-by: Hans-Christian Egtvedt <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: nand: remove doubled chip deselection on (un)lockJiri Pinkava1-6/+0
Chip deselection is already done in nand_release_device. So only duplicate code. Signed-off-by: Jiri Pinkava <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: nand: fix S3C NAND clock stopJiri Pinkava1-16/+43
Current implementation of s3c2410_nand_select_chip call clk_disable every time when chip = -1 (de-select). This happend multiple times even if chip was already de-selected. This causes disabling clock even if they are already disabled and due to nature of clock subsytem implementation this causes nand clock to be disabled and newer enabled again. Signed-off-by: Jiri Pinkava <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: cmdset_0002: add CFI 1.5 support for S29GL-SGernot Hoyler1-2/+3
This patch adds CFI 1.5 support for the new Spansion S29GL-S device family. For details, see the data sheet on the Spansion web site: http://www.spansion.com/Support/Datasheets/S29GL_128S_01GS_00_02_e.pdf Signed-off-by: Gernot Hoyler <[email protected]> Acked-by: Guillaume LECERF <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: onenand: add ecclayout and subpage_sft for non-flex 4KiB page onenandRoman Tereshonkov1-6/+40
So as the ecclayout and suppage size for 4KiB page Flex- and none-Flex OneNAND are different the new values for none-Flex 4KiB page OneNAND memory are added. The introduced ecclayout and suppage size are based on specification 4Gib M-die OneNAND Flash (KFM4G16Q4M, KFN8G16Q4M). Rev. 1.3, Apr. 2010 For eccpos we expose only 64 bytes out of 72, for oobfree the spare area fields marked as "Managed by internal ECC logic for Logical Sector Number area" are used. Signed-off-by: Roman Tereshonkov <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: denali: drop __TIME__ usageMichal Marek1-2/+1
The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time. Signed-off-by: Michal Marek <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: nand: dynamic allocation of flash-based BBT structsBrian Norris1-23/+4
It is nicer to dynamically create our badblock patterns than to statically define them. The nand_create_default_bbt_descr() function does a sufficient job of handling various bad block scanning options for either flash-based or non-flash-based BBTs, so we might as well use the function for both cases. This patch simplifies and shortens our code (and removes a TODO that I left a few months ago). Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: m25p80: add support for the MX25L1606E chipGabor Juhos1-0/+1
Signed-off-by: Gabor Juhos <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-25mtd: mxc_nand: add support for multiple chips on V21 devicesBaruch Siach1-19/+32
Do the following to add support for up to 4 chips on V21 devices (i.MX25 and i.MX35): * implement .select_chip for V21 * adjust existing NFC_V1_V2_BUF_ADDR writes to take chip select into account * unlock all chip selects at preset_v1_v2() * scan up to 4 devices at .probe This has been tested on i.MX25 with two attached NAND chip (on one die). Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2011-05-18Merge branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds16-36/+82
* 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6: drivercore: revert addition of of_match to struct device of: fix race when matching drivers
2011-05-18drivercore: revert addition of of_match to struct deviceGrant Likely16-36/+82
Commit b826291c, "drivercore/dt: add a match table pointer to struct device" added an of_match pointer to struct device to cache the of_match_table entry discovered at driver match time. This was unsafe because matching is not an atomic operation with probing a driver. If two or more drivers are attempted to be matched to a driver at the same time, then the cached matching entry pointer could get overwritten. This patch reverts the of_match cache pointer and reworks all users to call of_match_device() directly instead. Signed-off-by: Grant Likely <[email protected]>
2011-05-18Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds18-22/+21
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: block: don't delay blk_run_queue_async scsi: remove performance regression due to async queue run blk-throttle: Use task_subsys_state() to determine a task's blkio_cgroup block: rescan partitions on invalidated devices on -ENOMEDIA too cdrom: always check_disk_change() on open block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers
2011-05-18Merge branch 'v4l_for_linus' of ↵Linus Torvalds4-15/+54
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: [media] V4L: soc-camera: regression fix: calculate .sizeimage in soc_camera.c [media] v4l2-subdev: fix broken subdev control enumeration [media] Fix cx88 remote control input [media] v4l: Release module if subdev registration fails
2011-05-18drivers/leds/leds-lm3530.c: add MODULE_DEVICE_TABLEAxel Lin1-0/+1
Adding the necessary MODULE_DEVICE_TABLE() information allows the driver to be automatically loaded by udev. Signed-off-by: Axel Lin <[email protected]> Cc: Shreshtha Kumar SAHU <[email protected]> Cc: Richard Purdie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-18rapidio: fix default routing initializationAlexandre Bounine3-0/+21
Fix switch initialization to ensure that all switches have default routing disabled. This guarantees that no unexpected RapidIO packets arrive to the default port set by reset and there is no default routing destination until it is properly configured by software. This update also unifies handling of unmapped destinations by tsi57x, IDT Gen1 and IDT Gen2 switches. Signed-off-by: Alexandre Bounine <[email protected]> Cc: Kumar Gala <[email protected]> Cc: Matt Porter <[email protected]> Cc: Li Yang <[email protected]> Cc: Thomas Moll <[email protected]> Cc: <[email protected]> [2.6.37+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-17Merge branch 'timers-fixes-for-linus' of ↵Linus Torvalds11-26/+40
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: tick: Clear broadcast active bit when switching to oneshot rtc: mc13xxx: Don't call rtc_device_register while holding lock rtc: rp5c01: Initialize drvdata before registering device rtc: pcap: Initialize drvdata before registering device rtc: msm6242: Initialize drvdata before registering device rtc: max8998: Initialize drvdata before registering device rtc: max8925: Initialize drvdata before registering device rtc: m41t80: Initialize clientdata before registering device rtc: ds1286: Initialize drvdata before registering device rtc: ep93xx: Initialize drvdata before registering device rtc: davinci: Initialize drvdata before registering device rtc: mxc: Initialize drvdata before registering device clocksource: Install completely before selecting
2011-05-17scsi: remove performance regression due to async queue runJens Axboe2-4/+18
Commit c21e6beb removed our queue request_fn re-enter protection, and defaulted to always running the queues from kblockd to be safe. This was a known potential slow down, but should be safe. Unfortunately this is causing big performance regressions for some, so we need to improve this logic. Looking into the details of the re-enter, the real issue is on requeue of requests. Requeue of requests upon seeing a BUSY condition from the device ends up re-running the queue, causing traces like this: scsi_request_fn() scsi_dispatch_cmd() scsi_queue_insert() __scsi_queue_insert() scsi_run_queue() scsi_request_fn() ... potentially causing the issue we want to avoid. So special case the requeue re-run of the queue, but improve it to offload the entire run of local queue and starved queue from a single workqueue callback. This is a lot better than potentially kicking off a workqueue run for each device seen. This also fixes the issue of the local device going into recursion, since the above mentioned commit never moved that queue run out of line. Signed-off-by: Jens Axboe <[email protected]>
2011-05-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds2-0/+10
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: net: Change netdev_fix_features messages loglevel vmxnet3: Fix inconsistent LRO state after initialization sfc: Fix oops in register dump after mapping change IPVS: fix netns if reading ip_vs_* procfs entries bridge: fix forwarding of IPv6
2011-05-16Merge branch 'for-linus' of ↵Linus Torvalds1-4/+5
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: Revert "mmc: fix a race between card-detect rescan and clock-gate work instances"
2011-05-16PCI: Clear bridge resource flags if requested size is 0Yinghai Lu1-2/+2
During pci remove/rescan testing found: pci 0000:c0:03.0: PCI bridge to [bus c4-c9] pci 0000:c0:03.0: bridge window [io 0x1000-0x0fff] pci 0000:c0:03.0: bridge window [mem 0xf0000000-0xf00fffff] pci 0000:c0:03.0: bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref] pci 0000:c0:03.0: device not available (can't reserve [io 0x1000-0x0fff]) pci 0000:c0:03.0: Error enabling bridge (-22), continuing pci 0000:c0:03.0: enabling bus mastering pci 0000:c0:03.0: setting latency timer to 64 pcieport 0000:c0:03.0: device not available (can't reserve [io 0x1000-0x0fff]) pcieport: probe of 0000:c0:03.0 failed with error -22 This bug was caused by commit c8adf9a3e873 ("PCI: pre-allocate additional resources to devices only after successful allocation of essential resources.") After that commit, pci_hotplug_io_size is changed to additional_io_size from minium size. So it will not go through resource_size(res) != 0 path, and will not be reset. The root cause is: pci_bridge_check_ranges will set RESOURCE_IO flag for pci bridge, and later if children do not need IO resource. those bridge resources will not need to be allocated. but flags is still there. that will confuse the the pci_enable_bridges later. related code: static void assign_requested_resources_sorted(struct resource_list *head, struct resource_list_x *fail_head) { struct resource *res; struct resource_list *list; int idx; for (list = head->next; list; list = list->next) { res = list->res; idx = res - &list->dev->resource[0]; if (resource_size(res) && pci_assign_resource(list->dev, idx)) { ... reset_resource(res); } } } At last, We have to clear the flags in pbus_size_mem/io when requested size == 0 and !add_head. becasue this case it will not go through adjust_resources_sorted(). Just make size1 = size0 when !add_head. it will make flags get cleared. At the same time when requested size == 0, add_size != 0, will still have in head and add_list. because we do not clear the flags for it. After this, we will get right result: pci 0000:c0:03.0: PCI bridge to [bus c4-c9] pci 0000:c0:03.0: bridge window [io disabled] pci 0000:c0:03.0: bridge window [mem 0xf0000000-0xf00fffff] pci 0000:c0:03.0: bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref] pci 0000:c0:03.0: enabling bus mastering pci 0000:c0:03.0: setting latency timer to 64 pcieport 0000:c0:03.0: setting latency timer to 64 pcieport 0000:c0:03.0: irq 160 for MSI/MSI-X pcieport 0000:c0:03.0: Signaling PME through PCIe PME interrupt pci 0000:c4:00.0: Signaling PME through PCIe PME interrupt pcie_pme 0000:c0:03.0:pcie01: service driver pcie_pme loaded aer 0000:c0:03.0:pcie02: service driver aer loaded pciehp 0000:c0:03.0:pcie04: Hotplug Controller: v3: more simple fix. also fix one typo in pbus_size_mem Signed-off-by: Yinghai Lu <[email protected]> Reviewed-by: Ram Pai <[email protected]> Cc: Jesse Barnes <[email protected]> Cc: Bjorn Helgaas <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-05-16vmxnet3: Fix inconsistent LRO state after initializationThomas Jarosch1-0/+3
During initialization of vmxnet3, the state of LRO gets out of sync with netdev->features. This leads to very poor TCP performance in a IP forwarding setup and is hitting many VMware users. Simplified call sequence: 1. vmxnet3_declare_features() initializes "adapter->lro" to true. 2. The kernel automatically disables LRO if IP forwarding is enabled, so vmxnet3_set_flags() gets called. This also updates netdev->features. 3. Now vmxnet3_setup_driver_shared() is called. "adapter->lro" is still set to true and LRO gets enabled again, even though netdev->features shows it's disabled. Fix it by updating "adapter->lro", too. The private vmxnet3 adapter flags are scheduled for removal in net-next, see commit a0d2730c9571aeba793cb5d3009094ee1d8fda35 "net: vmxnet3: convert to hw_features". Patch applies to 2.6.37 / 2.6.38 and 2.6.39-rc6. Please CC: comments. Signed-off-by: Thomas Jarosch <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-05-16sfc: Fix oops in register dump after mapping changeBen Hutchings1-0/+7
Commit 747df2258b1b9a2e25929ef496262c339c380009 ('sfc: Always map MCDI shared memory as uncacheable') introduced a separate mapping for the MCDI shared memory (MC_TREG_SMEM). This means we can no longer easily include it in the register dump. Since it is not particularly useful in debugging, substitute a recognisable dummy value. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-05-16Merge branch 'drm-fixes' of ↵Linus Torvalds7-11/+43
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm: Take lock around probes for drm_fb_helper_hotplug_event drm/i915: Revert i915.semaphore=1 default from 47ae63e0 vga_switcheroo: don't toggle-switch devices drm/radeon/kms: add some evergreen/ni safe regs drm/radeon/kms: fix extended lvds info parsing drm/radeon/kms: fix tiling reg on fusion
2011-05-16Revert "mmc: fix a race between card-detect rescan and clock-gate work ↵Chris Ball1-4/+5
instances" This reverts commit 26fc8775b51484d8c0a671198639c6d5ae60533e, which has been reported to cause boot/resume-time crashes for some users: https://bbs.archlinux.org/viewtopic.php?id=118751. Signed-off-by: Chris Ball <[email protected]> Cc: <[email protected]>
2011-05-16drm: Take lock around probes for drm_fb_helper_hotplug_eventChris Wilson1-4/+22
We need to hold the dev->mode_config.mutex whilst detecting the output status. But we also need to drop it for the call into drm_fb_helper_single_fb_probe(), which indirectly acquires the lock when attaching the fbcon. Failure to do so exposes a race with normal output probing. Detected by adding some warnings that the mutex is held to the backend detect routines: [ 17.772456] WARNING: at drivers/gpu/drm/i915/intel_crt.c:471 intel_crt_detect+0x3e/0x373 [i915]() [ 17.772458] Hardware name: Latitude E6400 [ 17.772460] Modules linked in: .... [ 17.772582] Pid: 11, comm: kworker/0:1 Tainted: G W 2.6.38.4-custom.2 #8 [ 17.772584] Call Trace: [ 17.772591] [<ffffffff81046af5>] ? warn_slowpath_common+0x78/0x8c [ 17.772603] [<ffffffffa03f3e5c>] ? intel_crt_detect+0x3e/0x373 [i915] [ 17.772612] [<ffffffffa0355d49>] ? drm_helper_probe_single_connector_modes+0xbf/0x2af [drm_kms_helper] [ 17.772619] [<ffffffffa03534d5>] ? drm_fb_helper_probe_connector_modes+0x39/0x4d [drm_kms_helper] [ 17.772625] [<ffffffffa0354760>] ? drm_fb_helper_hotplug_event+0xa5/0xc3 [drm_kms_helper] [ 17.772633] [<ffffffffa035577f>] ? output_poll_execute+0x146/0x17c [drm_kms_helper] [ 17.772638] [<ffffffff81193c01>] ? cfq_init_queue+0x247/0x345 [ 17.772644] [<ffffffffa0355639>] ? output_poll_execute+0x0/0x17c [drm_kms_helper] [ 17.772648] [<ffffffff8105b540>] ? process_one_work+0x193/0x28e [ 17.772652] [<ffffffff8105c6bc>] ? worker_thread+0xef/0x172 [ 17.772655] [<ffffffff8105c5cd>] ? worker_thread+0x0/0x172 [ 17.772658] [<ffffffff8105c5cd>] ? worker_thread+0x0/0x172 [ 17.772663] [<ffffffff8105f767>] ? kthread+0x7a/0x82 [ 17.772668] [<ffffffff8100a724>] ? kernel_thread_helper+0x4/0x10 [ 17.772671] [<ffffffff8105f6ed>] ? kthread+0x0/0x82 [ 17.772674] [<ffffffff8100a720>] ? kernel_thread_helper+0x0/0x10 Reported-by: Frederik Himpe <[email protected]> References: https://bugs.freedesktop.org/show_bug.cgi?id=36394 Signed-off-by: Chris Wilson <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2011-05-16drm/i915: Revert i915.semaphore=1 default from 47ae63e0Andy Lutomirski1-1/+1
My Q67 / i7-2600 box has rev09 Sandy Bridge graphics. It hangs instantly when GNOME loads and it hangs so hard the reset button doesn't work. Setting i915.semaphore=0 fixes it. Semaphores were disabled in a1656b9090f7008d2941c314f5a64724bea2ae37 in 2.6.38 and were re-enabled by commit 47ae63e0c2e5fdb582d471dc906eb29be94c732f Merge: c59a333 467cffb Author: Chris Wilson <[email protected]> Date: Mon Mar 7 12:32:44 2011 +0000 Merge branch 'drm-intel-fixes' into drm-intel-next Apply the trivial conflicting regression fixes, but keep GPU semaphores enabled. Conflicts: drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem_execbuffer.c (It's worth noting that the offending change is i915_drv.c, which is not a conflict.) Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Keith Packard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2011-05-16vga_switcheroo: don't toggle-switch devicesFlorian Mickler1-3/+3
If the requested device is already active, ignore the request. This restores the original behaviour of the interface. The change was probably an unintended side effect of commit 66b37c6777c4 vga_switcheroo: split switching into two stages which did not take into account to duplicate the !active check in the split-off stage2. Fix this by factoring that check out of stage1 into the debugfs_write routine. References: https://bugzilla.kernel.org/show_bug.cgi?id=34252 Reported-by: Igor Murzov <[email protected]> Tested-by: Igor Murzov <[email protected]> Signed-off-by: Florian Mickler <[email protected]> Signed-off-by: Dave Airlie <[email protected]>