firefly-linux-kernel-4.4.55.git
15 years agotracing: removed duplicated #include
Huang Weiyi [Mon, 29 Dec 2008 22:41:44 +0000 (06:41 +0800)]
tracing: removed duplicated #include

Removed duplicated #include in kernel/trace/trace.c.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Wed, 31 Dec 2008 01:34:37 +0000 (17:34 -0800)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (33 commits)
  ide-cd: remove dead dsc_overlap setting
  ide: push local_irq_{save,restore}() to do_identify()
  ide: remove superfluous local_irq_{save,restore}() from ide_dump_status()
  ide: move legacy ISA/VLB ports handling to ide-legacy.c (v2)
  ide: move Power Management support to ide-pm.c
  ide: use ATA_DMA_* defines in ide-dma-sff.c
  ide: checkpatch.pl fixes for ide-lib.c
  ide: remove inline tags from ide-probe.c
  ide: remove redundant code from ide_end_drive_cmd()
  ide: struct device - replace bus_id with dev_name(), dev_set_name()
  ide: rework handling of serialized ports (v2)
  cy82c693: remove superfluous ide_cy82c693 chipset type
  trm290: add IDE_HFLAG_TRM290 host flag
  ide: add ->max_sectors field to struct ide_port_info
  rz1000: apply chipset quirks early (v2)
  ide: always set nIEN on idle devices
  ide: fix ->quirk_list checking in ide_do_request()
  gayle: set IDE_HFLAG_SERIALIZE explictly
  cmd64x: set IDE_HFLAG_SERIALIZE explictly for CMD646
  ali14xx: doesn't use shared IRQs
  ...

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
Linus Torvalds [Wed, 31 Dec 2008 01:33:33 +0000 (17:33 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  jfs: ensure symlinks are NUL-terminated

15 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Wed, 31 Dec 2008 01:32:25 +0000 (17:32 -0800)]
Merge branch 'upstream-linus' of git://git./linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  sata_sil: add Large Block Transfer support
  [libata] ata_piix: cleanup dmi strings checking
  DMI: add dmi_match
  libata: blacklist NCQ on OCZ CORE 2 SSD (resend)
  [libata] Update kernel-doc comments to match source code
  libata: perform port detach in EH
  libata: when restoring SControl during detach do the PMP links first
  libata: beef up iterators

15 years agoMerge branch 'oprofile-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 31 Dec 2008 01:31:25 +0000 (17:31 -0800)]
Merge branch 'oprofile-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'oprofile-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  oprofile: select RING_BUFFER
  ring_buffer: adding EXPORT_SYMBOLs
  oprofile: fix lost sample counter
  oprofile: remove nr_available_slots()
  oprofile: port to the new ring_buffer
  ring_buffer: add remaining cpu functions to ring_buffer.h
  oprofile: moving cpu_buffer_reset() to cpu_buffer.h
  oprofile: adding cpu_buffer_entries()
  oprofile: adding cpu_buffer_write_commit()
  oprofile: adding cpu buffer r/w access functions
  ftrace: remove unused function arg in trace_iterator_increment()
  ring_buffer: update description for ring_buffer_alloc()
  oprofile: set values to default when creating oprofilefs
  oprofile: implement switch/case in buffer_sync.c
  x86/oprofile: cleanup IBS init/exit functions in op_model_amd.c
  x86/oprofile: reordering IBS code in op_model_amd.c
  oprofile: fix typo
  oprofile: whitspace changes only
  oprofile: update comment for oprofile_add_sample()
  oprofile: comment cleanup

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Wed, 31 Dec 2008 01:28:09 +0000 (17:28 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slub: avoid leaking caches or refcounts on sysfs error
  slab: Fix comment on #endif
  slab: remove GFP_THISNODE clearing from alloc_slabmgmt()
  slub: Add might_sleep_if() to slab_alloc()
  SLUB: failslab support
  slub: Fix incorrect use of loose
  slab: Update the kmem_cache_create documentation regarding the name parameter
  slub: make early_kmem_cache_node_alloc void
  slab: unsigned slabp->inuse cannot be less than 0
  slub - fix get_object_page comment
  SLUB: Replace __builtin_return_address(0) with _RET_IP_.
  SLUB: cleanup - define macros instead of hardcoded numbers

15 years agoMerge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Wed, 31 Dec 2008 01:25:49 +0000 (17:25 -0800)]
Merge branch 'drm-next' of git://git./linux/kernel/git/airlied/drm-2.6

* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (37 commits)
  drm/i915: fix modeset devname allocation + agp init return check.
  drm/i915: Remove redundant test in error path.
  drm: Add a debug node for vblank state.
  drm: Avoid use-before-null-test on dev in drm_cleanup().
  drm/i915: Don't print to dmesg when taking signal during object_pin.
  drm: pin new and unpin old buffer when setting a mode.
  drm/i915: un-EXPORT and make 'intelfb_panic' static
  drm/i915: Delete unused, pointless i915_driver_firstopen.
  drm/i915: fix sparse warnings: returning void-valued expression
  drm/i915: fix sparse warnings: move 'extern' decls to header file
  drm/i915: fix sparse warnings: make symbols static
  drm/i915: fix sparse warnings: declare one-bit bitfield as unsigned
  drm/i915: Don't double-unpin buffers if we take a signal in evict_everything().
  drm/i915: Fix fbcon setup to align display pitch to 64b.
  drm/i915: Add missing userland definitions for gem init/execbuffer.
  i915/drm: provide compat defines for userspace for certain struct members.
  drm: drop DRM_IOCTL_MODE_REPLACEFB, add+remove works just as well.
  drm: sanitise drm modesetting API + remove unused hotplug
  drm: fix allowing master ioctls on non-master fds.
  drm/radeon: use locked rmmap to remove sarea mapping.
  ...

15 years agoMerge branch 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Wed, 31 Dec 2008 01:25:29 +0000 (17:25 -0800)]
Merge branch 'agp-next' of git://git./linux/kernel/git/airlied/agp-2.6

* 'agp-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
  agp/intel: Fix broken ® symbol in device name.
  agp/intel: add support for G41 chipset

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6
Linus Torvalds [Wed, 31 Dec 2008 01:23:31 +0000 (17:23 -0800)]
Merge git://git./linux/kernel/git/davem/sparc-next-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6: (98 commits)
  sparc: move select of ARCH_SUPPORTS_MSI
  sparc: drop SUN_IO
  sparc: unify sections.h
  sparc: use .data.init_task section for init_thread_union
  sparc: fix array overrun check in of_device_64.c
  sparc: unify module.c
  sparc64: prepare module_64.c for unification
  sparc64: use bit neutral Elf symbols
  sparc: unify module.h
  sparc: introduce CONFIG_BITS
  sparc: fix hardirq.h removal fallout
  sparc64: do not export pus_fs_struct
  sparc: use sparc64 version of scatterlist.h
  sparc: Commonize memcmp assembler.
  sparc: Unify strlen assembler.
  sparc: Add asm/asm.h
  sparc: Kill memcmp_32.S code which has been ifdef'd out for centuries.
  sparc: replace for_each_cpu_mask_nr with for_each_cpu
  sparc: fix sparse warnings in irq_32.c
  sparc: add include guards to kernel.h
  ...

15 years agoMerge branch 'for-2.6.29' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Wed, 31 Dec 2008 01:20:05 +0000 (17:20 -0800)]
Merge branch 'for-2.6.29' of git://git.kernel.dk/linux-2.6-block

* 'for-2.6.29' of git://git.kernel.dk/linux-2.6-block: (43 commits)
  bio: get rid of bio_vec clearing
  bounce: don't rely on a zeroed bio_vec list
  cciss: simplify parameters to deregister_disk function
  cfq-iosched: fix race between exiting queue and exiting task
  loop: Do not call loop_unplug for not configured loop device.
  loop: Flush possible running bios when loop device is released.
  alpha: remove dead BIO_VMERGE_BOUNDARY
  Get rid of CONFIG_LSF
  block: make blk_softirq_init() static
  block: use min_not_zero in blk_queue_stack_limits
  block: add one-hit cache for disk partition lookup
  cfq-iosched: remove limit of dispatch depth of max 4 times quantum
  nbd: tell the block layer that it is not a rotational device
  block: get rid of elevator_t typedef
  aio: make the lookup_ioctx() lockless
  bio: add support for inlining a number of bio_vecs inside the bio
  bio: allow individual slabs in the bio_set
  bio: move the slab pointer inside the bio_set
  bio: only mempool back the largest bio_vec slab cache
  block: don't use plugging on SSD devices
  ...

15 years agoMerge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 31 Dec 2008 00:20:19 +0000 (16:20 -0800)]
Merge branch 'irq-core-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, sparseirq: clean up Kconfig entry
  x86: turn CONFIG_SPARSE_IRQ off by default
  sparseirq: fix numa_migrate_irq_desc dependency and comments
  sparseirq: add kernel-doc notation for new member in irq_desc, -v2
  locking, irq: enclose irq_desc_lock_class in CONFIG_LOCKDEP
  sparseirq, xen: make sure irq_desc is allocated for interrupts
  sparseirq: fix !SMP building, #2
  x86, sparseirq: move irq_desc according to smp_affinity, v7
  proc: enclose desc variable of show_stat() in CONFIG_SPARSE_IRQ
  sparse irqs: add irqnr.h to the user headers list
  sparse irqs: handle !GENIRQ platforms
  sparseirq: fix !SMP && !PCI_MSI && !HT_IRQ build
  sparseirq: fix Alpha build failure
  sparseirq: fix typo in !CONFIG_IO_APIC case
  x86, MSI: pass irq_cfg and irq_desc
  x86: MSI start irq numbering from nr_irqs_gsi
  x86: use NR_IRQS_LEGACY
  sparse irq_desc[] array: core kernel and x86 changes
  genirq: record IRQ_LEVEL in irq_desc[]
  irq.h: remove padding from irq_desc on 64bits

15 years agoMerge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Wed, 31 Dec 2008 00:16:21 +0000 (16:16 -0800)]
Merge branch 'timers-core-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hrtimers: fix warning in kernel/hrtimer.c
  x86: make sure we really have an hpet mapping before using it
  x86: enable HPET on Fujitsu u9200
  linux/timex.h: cleanup for userspace
  posix-timers: simplify de_thread()->exit_itimers() path
  posix-timers: check ->it_signal instead of ->it_pid to validate the timer
  posix-timers: use "struct pid*" instead of "struct task_struct*"
  nohz: suppress needless timer reprogramming
  clocksource, acpi_pm.c: put acpi_pm_read_slow() under CONFIG_PCI
  nohz: no softirq pending warnings for offline cpus
  hrtimer: removing all ur callback modes, fix
  hrtimer: removing all ur callback modes, fix hotplug
  hrtimer: removing all ur callback modes
  x86: correct link to HPET timer specification
  rtc-cmos: export second NVRAM bank

Fixed up conflicts in sound/drivers/pcsp/pcsp.c and sound/core/hrtimer.c
manually.

15 years agoMerge branch 'core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
Linus Torvalds [Wed, 31 Dec 2008 00:10:19 +0000 (16:10 -0800)]
Merge branch 'core-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (63 commits)
  stacktrace: provide save_stack_trace_tsk() weak alias
  rcu: provide RCU options on non-preempt architectures too
  printk: fix discarding message when recursion_bug
  futex: clean up futex_(un)lock_pi fault handling
  "Tree RCU": scalable classic RCU implementation
  futex: rename field in futex_q to clarify single waiter semantics
  x86/swiotlb: add default swiotlb_arch_range_needs_mapping
  x86/swiotlb: add default phys<->bus conversion
  x86: unify pci iommu setup and allow swiotlb to compile for 32 bit
  x86: add swiotlb allocation functions
  swiotlb: consolidate swiotlb info message printing
  swiotlb: support bouncing of HighMem pages
  swiotlb: factor out copy to/from device
  swiotlb: add arch hook to force mapping
  swiotlb: allow architectures to override phys<->bus<->phys conversions
  swiotlb: add comment where we handle the overflow of a dma mask on 32 bit
  rcu: fix rcutorture behavior during reboot
  resources: skip sanity check of busy resources
  swiotlb: move some definitions to header
  swiotlb: allow architectures to override swiotlb pool allocation
  ...

Fix up trivial conflicts in
  arch/x86/kernel/Makefile
  arch/x86/mm/init_32.c
  include/linux/hardirq.h
as per Ingo's suggestions.

15 years agoide-cd: remove dead dsc_overlap setting
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:38 +0000 (20:27 +0100)]
ide-cd: remove dead dsc_overlap setting

dsc_overlap setting is not useful anymore for ide-cd so remove
"dsc_overlap" /proc setting, disallow changing the setting through
HDIO_SET_NICE ioctl and cleanup ide_cd{rom_setup,_release}().

Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: push local_irq_{save,restore}() to do_identify()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:38 +0000 (20:27 +0100)]
ide: push local_irq_{save,restore}() to do_identify()

Push local_irq_{save,restore}() from actual_try_to_identify()
to do_identify() and remove no longer needed local_irq_enable().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove superfluous local_irq_{save,restore}() from ide_dump_status()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:37 +0000 (20:27 +0100)]
ide: remove superfluous local_irq_{save,restore}() from ide_dump_status()

No reason to run this function with local IRQs off.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move legacy ISA/VLB ports handling to ide-legacy.c (v2)
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:37 +0000 (20:27 +0100)]
ide: move legacy ISA/VLB ports handling to ide-legacy.c (v2)

* Move legacy ISA/VLB ports handling from ide-probe.c to ide-legacy.c.

* Add CONFIG_IDE_LEGACY config option to be selected by host drivers
  needing ide-legacy.c.

v2:
Fix CONFIG_IDE_LEGACY not being defined in Kconfig.
(from Takashi Iwai <tiwai@suse.de>)

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move Power Management support to ide-pm.c
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:37 +0000 (20:27 +0100)]
ide: move Power Management support to ide-pm.c

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ATA_DMA_* defines in ide-dma-sff.c
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:37 +0000 (20:27 +0100)]
ide: use ATA_DMA_* defines in ide-dma-sff.c

In few places open-coded values were still being used.  Fix it.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: checkpatch.pl fixes for ide-lib.c
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:36 +0000 (20:27 +0100)]
ide: checkpatch.pl fixes for ide-lib.c

Fix following errors/warnings detected by checkpatch.pl:

- WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
- WARNING: space prohibited between function name and open parenthesis '('
- ERROR: trailing whitespace
- ERROR: trailing statements should be on next line
- WARNING: printk() should include KERN_ facility level

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove inline tags from ide-probe.c
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:36 +0000 (20:27 +0100)]
ide: remove inline tags from ide-probe.c

Let the compiler handle it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove redundant code from ide_end_drive_cmd()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:36 +0000 (20:27 +0100)]
ide: remove redundant code from ide_end_drive_cmd()

rq->errors is overwritten later in this function.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: struct device - replace bus_id with dev_name(), dev_set_name()
Kay Sievers [Mon, 29 Dec 2008 19:27:36 +0000 (20:27 +0100)]
ide: struct device - replace bus_id with dev_name(), dev_set_name()

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: rework handling of serialized ports (v2)
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:36 +0000 (20:27 +0100)]
ide: rework handling of serialized ports (v2)

* hpt366: set IDE_HFLAG_SERIALIZE in ->host_flags if needed
  in init_hwif_hpt366().  Remove HPT_SERIALIZE_IO while at it.

* Set IDE_HFLAG_SERIALIZE in ->host_flags if needed in
  ide_init_port().

* Convert init_irq() to use IDE_HFLAG_SERIALIZE together with
  hwif->host to find out ports which need to be serialized.

* Remove no longer needed save_match() and ide_hwif_t.serialized.

v2:
* Set host's ->host_flags field instead of port's copy.

This patch should fix the incorrect grouping of port(s) from
host(s) that need serialization with port(s) that happen to use
the same IRQ(s) but are from the host(s) that don't need it.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agocy82c693: remove superfluous ide_cy82c693 chipset type
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:34 +0000 (20:27 +0100)]
cy82c693: remove superfluous ide_cy82c693 chipset type

Since CY82C693 doesn't require serialization we may as well
use the default ide_pci chipset type.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotrm290: add IDE_HFLAG_TRM290 host flag
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:34 +0000 (20:27 +0100)]
trm290: add IDE_HFLAG_TRM290 host flag

* Add IDE_HFLAG_TRM290 host flag and use it in ide_build_dmatable().

* Remove no longer needed ide_trm290 chipset type.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ->max_sectors field to struct ide_port_info
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:34 +0000 (20:27 +0100)]
ide: add ->max_sectors field to struct ide_port_info

* Add ->max_sectors field to struct ide_port_info to allow host drivers
  to specify value used for hwif->rqsize (if smaller than the default).

* Convert pdc202xx_old to use ->max_sectors and remove no longer needed
  IDE_HFLAG_RQSIZE_256 flag.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtyltov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agorz1000: apply chipset quirks early (v2)
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:33 +0000 (20:27 +0100)]
rz1000: apply chipset quirks early (v2)

* Use pci_name(dev) instead of hwif->name in init_hwif_rz1000().

* init_hwif_rz1000() -> rz1000_init_chipset().  Update rz1000_init_one()
  to use rz1000_init_chipset() and add now required rz1000_remove().

* Remove superfluous ide_rz1000 chipset type.

v2:
* unsigned int rz1000_init_chipset() -> int rz1000_disable_readahead()
  per Sergei's suggestion.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: always set nIEN on idle devices
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:33 +0000 (20:27 +0100)]
ide: always set nIEN on idle devices

* Set nIEN for previous port/device in ide_do_request()
  also if port uses a non-shared IRQ.

* Remove no longer needed ide_hwif_t.sharing_irq.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix ->quirk_list checking in ide_do_request()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:33 +0000 (20:27 +0100)]
ide: fix ->quirk_list checking in ide_do_request()

Fix nIEN quirk check to also omit quirky devices using pdc202xx_{new,old}
host drivers for which ->quirk_list == 2.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agogayle: set IDE_HFLAG_SERIALIZE explictly
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:33 +0000 (20:27 +0100)]
gayle: set IDE_HFLAG_SERIALIZE explictly

If IDE doubler is used ports need to be serialized.  Currently
init_irq() handles it fine but lets also set IDE_HFLAG_SERIALIZE
host flag explicitly in preparation for future changes.

Also convert the driver to use struct ide_port_info while at it.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agocmd64x: set IDE_HFLAG_SERIALIZE explictly for CMD646
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:32 +0000 (20:27 +0100)]
cmd64x: set IDE_HFLAG_SERIALIZE explictly for CMD646

* Set IDE_HFLAG_SERIALIZE explictly for CMD646.

* Remove no longer needed ide_cmd646 chipset type (which has
  a nice side-effect of fixing handling of unexpected IRQs).

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoali14xx: doesn't use shared IRQs
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:32 +0000 (20:27 +0100)]
ali14xx: doesn't use shared IRQs

init_irq() shouldn't use IRQF_SHARED for ali14xx IDE IRQ handler.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-cd: remove obsolete seek optimization
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:32 +0000 (20:27 +0100)]
ide-cd: remove obsolete seek optimization

It doesn't make much sense nowadays and is problematic on some drives.

Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: cleanup ide_do_request()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:32 +0000 (20:27 +0100)]
ide: cleanup ide_do_request()

Both choose_drive() and PM handling code make sure that the queue
is unplugged so no need to check it again.

Cc: Elias Oltmanns <eo@nebensachen.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: replace the global ide_lock spinlock by per-hwgroup spinlocks (v2)
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:31 +0000 (20:27 +0100)]
ide: replace the global ide_lock spinlock by per-hwgroup spinlocks (v2)

Now that (almost) all host drivers have been fixed not to abuse ide_lock
and core code usage of ide_lock has been sanitized we may safely replace
ide_lock by per-hwgroup locks.

This patch is partially based on earlier patch from Ravikiran G Thirumalai.

While at it:
- don't use deprecated HWIF() and HWGROUP() macros
- update locking documentation in ide.h

v2:
Add missing spin_lock_init(&hwgroup->lock).  (Noticed by Elias Oltmanns)

Cc: Vaibhav V. Nivargi <vaibhav.nivargi@gmail.com>
Cc: Alok N. Kataria <alokk@calsoftinc.com>
Cc: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Cc: Elias Oltmanns <eo@nebensachen.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use queue lock instead of ide_lock when possible
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:31 +0000 (20:27 +0100)]
ide: use queue lock instead of ide_lock when possible

This is just a preparation for future changes and there should be no
functional changes caused by this patch since ide_lock is currently
also used as queue lock.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_lock + __blk_end_request() -> blk_end_request()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:31 +0000 (20:27 +0100)]
ide: ide_lock + __blk_end_request() -> blk_end_request()

Use blk_end_request() instead of ide_lock + __blk_end_request()
in cdrom_end_request(), cdrom_newpc_intr(), __ide_end_request(),
ide_complete_pm_request() and ide_end_drive_cmd().

[ ide_lock is currently also used as queue lock ]

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: push ide_lock to __ide_end_request()
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:30 +0000 (20:27 +0100)]
ide: push ide_lock to __ide_end_request()

__ide_end_request() needs ide_lock only for __blk_end_request()
call so push ide_lock taking inside __ide_end_requests().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_hwgroup_t.rq doesn't need an ide_lock held
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:30 +0000 (20:27 +0100)]
ide: ide_hwgroup_t.rq doesn't need an ide_lock held

While at it:
- no need to check for hwgroup presence in ide_dump_opcode()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: __ide_port_unregister_devices() doesn't need an ide_lock held
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:30 +0000 (20:27 +0100)]
ide: __ide_port_unregister_devices() doesn't need an ide_lock held

[ and ide_cfg_mtx mutex provides a sufficient protection for callers ]

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: IDE settings don't need an ide_lock held
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:29 +0000 (20:27 +0100)]
ide: IDE settings don't need an ide_lock held

IDE settings are protected by ide_setting_mtx mutex so there is
no need to hold ide_lock in ide_setting_ioctl(), ide_read_setting()
and ide_proc_unregister_driver().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: unify ide_intr()'s exit points
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:29 +0000 (20:27 +0100)]
ide: unify ide_intr()'s exit points

Just a preparation for future changes.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: fix IDE ACPI regression breaking suspend
Bartlomiej Zolnierkiewicz [Mon, 29 Dec 2008 19:27:29 +0000 (20:27 +0100)]
ide: fix IDE ACPI regression breaking suspend

Commit 4dde4492d850a4c9bcaa92e5bd7f4eebe3e2f5ab ("ide: make drive->id
an union (take 2)") accidentally introduced an IDE ACPI regression which
at least on some machines confuses ACPI and breaks suspend. Fix it.

Fixes kernel.org bug #12279:
http://bugzilla.kernel.org/show_bug.cgi?id=12279

[ Sorry about the bug (IDE ACPI is not used by default so it managed
  to slip in).  Still it is kind of surprising that the bug breaks
  suspend as it shouldn't impact anything except IDE ACPI (it seems
  that it uncovered either some ACPI/PM deficiency or a BIOS bug). ]

Reported-and-bisected-by: David Roka <roka@dawid.hu>
Tested-by: David Roka <roka@dawid.hu>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotx493[89]ide: Fix length for __ide_flush_dcache_range
Atsushi Nemoto [Mon, 29 Dec 2008 19:27:29 +0000 (20:27 +0100)]
tx493[89]ide: Fix length for __ide_flush_dcache_range

This fixes data corruption on PIO mode.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
Cc: sshtylyov@ru.mvista.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agotx4939ide: Do not use zero count PRD entry
Atsushi Nemoto [Mon, 29 Dec 2008 19:27:28 +0000 (20:27 +0100)]
tx4939ide: Do not use zero count PRD entry

This fixes data corruption on some heavy load.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
Cc: sshtylyov@ru.mvista.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agosata_sil: add Large Block Transfer support
Robert Hancock [Thu, 25 Dec 2008 01:06:06 +0000 (19:06 -0600)]
sata_sil: add Large Block Transfer support

This implements support for the Large Block Transfer feature found in Silicon
Image 311x controllers. This allows transferring bigger contiguous chunks of
data from system memory and avoids the 64KB boundary restriction of standard
SFF controllers.

This is based on a patch from Jeff Garzik (from the sii-lbt branch of
libata-dev) but includes a few bug fixes: Since the bmdma2 register does not
implement the status bits, the original bmdma register must be used except
where the bmdma2 register is required. As well the DMA boundary should be
31-bit instead of 32-bit since the top bit of the length field is still
required for the PRD end-of-table flag.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years ago[libata] ata_piix: cleanup dmi strings checking
Jiri Slaby [Wed, 10 Dec 2008 13:07:22 +0000 (14:07 +0100)]
[libata] ata_piix: cleanup dmi strings checking

Commit
ATA: piix, fix pointer deref on suspend
fixed a possible oops in an ugly manner. Use newly introduced dmi_match()
to make the code pretty again.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoDMI: add dmi_match
Jiri Slaby [Wed, 10 Dec 2008 13:07:21 +0000 (14:07 +0100)]
DMI: add dmi_match

Add a wrapper for testing system_info which will handle also NULL
system infos.

This will be used by the ata PIIX driver.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agolibata: blacklist NCQ on OCZ CORE 2 SSD (resend)
Lubomir Bulej [Mon, 22 Dec 2008 10:35:22 +0000 (11:35 +0100)]
libata: blacklist NCQ on OCZ CORE 2 SSD (resend)

The patchlet below blacklists NCQ on OCZ CORE v2 SSD drive(s). Even
though the drive advertises NCQ support with queue depth 1, it responds
with all-zeroes FIS to NCQ commands which triggers ata error handling
several times before the kernel decides to disable NCQ on the drive.

Signed-off-by: Lubomir Bulej <lubomir.bulej@dsrg.mff.cuni.cz>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
15 years agoMerge branch 'topic/failslab' into for-linus
Pekka Enberg [Mon, 29 Dec 2008 09:47:05 +0000 (11:47 +0200)]
Merge branch 'topic/failslab' into for-linus

Conflicts:

mm/slub.c

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoMerge branches 'topic/fixes', 'topic/cleanups' and 'topic/documentation' into for...
Pekka Enberg [Mon, 29 Dec 2008 09:45:47 +0000 (11:45 +0200)]
Merge branches 'topic/fixes', 'topic/cleanups' and 'topic/documentation' into for-linus

15 years agoslub: avoid leaking caches or refcounts on sysfs error
David Rientjes [Thu, 18 Dec 2008 06:09:46 +0000 (22:09 -0800)]
slub: avoid leaking caches or refcounts on sysfs error

If a slab cache is mergeable and the sysfs alias cannot be added, the
target cache shall have its refcount decremented.  kmem_cache_create()
will return NULL, so if kmem_cache_destroy() is ever called on the target
cache, it will never be freed if the refcount has been leaked.

Likewise, if a slab cache is not mergeable and the sysfs link cannot be
added, the new cache shall be removed from the slab_caches list.
kmem_cache_create() will return NULL, so it will be impossible to call
kmem_cache_destroy() on it.

Both of these operations require slub_lock since refcount of all slab
caches and slab_caches are protected by the lock.

In the mergeable case, it would be better to restore objsize and offset
back to their original values, but this could race with another merge
since slub_lock was dropped.

Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoslab: Fix comment on #endif
Pascal Terjan [Tue, 25 Nov 2008 14:08:19 +0000 (15:08 +0100)]
slab: Fix comment on #endif

This #endif in slab.h is described as closing the inner block while it's for
the big CONFIG_NUMA one. That makes reading the code a bit harder.

This trivial patch fixes the comment.

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoslab: remove GFP_THISNODE clearing from alloc_slabmgmt()
Pekka Enberg [Wed, 26 Nov 2008 08:01:31 +0000 (10:01 +0200)]
slab: remove GFP_THISNODE clearing from alloc_slabmgmt()

Commit 6cb062296f73e74768cca2f3eaf90deac54de02d ("Categorize GFP flags")
left one call-site in alloc_slabmgmt() to clear GFP_THISNODE instead of
GFP_CONSTRAINT_MASK. Unfortunately, that ends up clearing __GFP_NOWARN
and __GFP_NORETRY as well which is not what we want. As the only caller
of alloc_slabmgmt() already clears GFP_CONSTRAINT_MASK before passing
local_flags to it, we can just remove the clearing of GFP_THISNODE.

This patch should fix spurious page allocation failure warnings on the
mempool_alloc() path. See the following URL for the original discussion
of the bug:

  http://lkml.org/lkml/2008/10/27/100

Acked-by: Christoph Lameter <cl@linux-foundation.org>
Reported-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoslub: Add might_sleep_if() to slab_alloc()
OGAWA Hirofumi [Wed, 19 Nov 2008 12:23:59 +0000 (21:23 +0900)]
slub: Add might_sleep_if() to slab_alloc()

Currently SLUB doesn't warn about __GFP_WAIT. Add it into slab_alloc().

Acked-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agoSLUB: failslab support
Akinobu Mita [Tue, 23 Dec 2008 10:37:01 +0000 (19:37 +0900)]
SLUB: failslab support

Currently fault-injection capability for SLAB allocator is only
available to SLAB. This patch makes it available to SLUB, too.

[penberg@cs.helsinki.fi: unify slab and slub implementations]
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
15 years agodrm/i915: fix modeset devname allocation + agp init return check.
Dave Airlie [Mon, 29 Dec 2008 06:35:02 +0000 (16:35 +1000)]
drm/i915: fix modeset devname allocation + agp init return check.

devname needs to be allocated before the irq is installed, so the
irq routines get the correct name in /proc.

Also check the return value from the AGP init function, and
fixup the exit points.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: Remove redundant test in error path.
Julia Lawall [Sun, 21 Dec 2008 15:28:47 +0000 (16:28 +0100)]
drm/i915: Remove redundant test in error path.

The error path for object list being null is in the second goto target.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm: Add a debug node for vblank state.
Eric Anholt [Sat, 20 Dec 2008 01:23:38 +0000 (17:23 -0800)]
drm: Add a debug node for vblank state.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm: Avoid use-before-null-test on dev in drm_cleanup().
Eric Anholt [Fri, 19 Dec 2008 23:07:11 +0000 (15:07 -0800)]
drm: Avoid use-before-null-test on dev in drm_cleanup().

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: Don't print to dmesg when taking signal during object_pin.
Eric Anholt [Fri, 19 Dec 2008 22:47:48 +0000 (14:47 -0800)]
drm/i915: Don't print to dmesg when taking signal during object_pin.

This showed up in logs where people had a hung chip, so pinning was blocked
on the chip unpinning other buffers, and the X Server took its scheduler
signal during that time.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm: pin new and unpin old buffer when setting a mode.
Kristian Høgsberg [Thu, 18 Dec 2008 03:14:46 +0000 (22:14 -0500)]
drm: pin new and unpin old buffer when setting a mode.

This removes the requirement for user space to pin a buffer before
setting a mode that is backed by the pixels from that buffer.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: un-EXPORT and make 'intelfb_panic' static
Hannes Eder [Fri, 19 Dec 2008 11:34:27 +0000 (12:34 +0100)]
drm/i915: un-EXPORT and make 'intelfb_panic' static

Fix this sparse warning:

  drivers/gpu/drm/i915/intel_fb.c:417:5: warning: symbol 'intelfb_panic' was not declared. Should it be static?

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: Delete unused, pointless i915_driver_firstopen.
Eric Anholt [Fri, 19 Dec 2008 22:30:31 +0000 (14:30 -0800)]
drm/i915: Delete unused, pointless i915_driver_firstopen.

Thanks to Hannes Eder for pointing out that this code was dead according to
sparse.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: fix sparse warnings: returning void-valued expression
Hannes Eder [Thu, 18 Dec 2008 20:24:18 +0000 (21:24 +0100)]
drm/i915: fix sparse warnings: returning void-valued expression

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: fix sparse warnings: move 'extern' decls to header file
Hannes Eder [Thu, 18 Dec 2008 20:22:24 +0000 (21:22 +0100)]
drm/i915: fix sparse warnings: move 'extern' decls to header file

Move 'extern'-decls from "intel_dvo.c" to "dvo.h", as "dvo.h" is
included by and only by files where the symbols are either defined or
used.

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: fix sparse warnings: make symbols static
Hannes Eder [Thu, 18 Dec 2008 20:18:47 +0000 (21:18 +0100)]
drm/i915: fix sparse warnings: make symbols static

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: fix sparse warnings: declare one-bit bitfield as unsigned
Hannes Eder [Thu, 18 Dec 2008 14:09:00 +0000 (15:09 +0100)]
drm/i915: fix sparse warnings: declare one-bit bitfield as unsigned

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: Don't double-unpin buffers if we take a signal in evict_everything().
Eric Anholt [Wed, 10 Dec 2008 18:09:41 +0000 (10:09 -0800)]
drm/i915: Don't double-unpin buffers if we take a signal in evict_everything().

We haven't seen this in practice, but it was visible when looking at a bug
report from when i915_gem_evict_everything() was broken and would always
return error.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
15 years agodrm/i915: Fix fbcon setup to align display pitch to 64b.
Eric Anholt [Thu, 11 Dec 2008 01:23:00 +0000 (17:23 -0800)]
drm/i915: Fix fbcon setup to align display pitch to 64b.

This is required by the display plane, and fixes 1400x1050 laptop displays.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: Add missing userland definitions for gem init/execbuffer.
Eric Anholt [Thu, 18 Dec 2008 06:32:14 +0000 (22:32 -0800)]
drm/i915: Add missing userland definitions for gem init/execbuffer.

fdo bug #19132.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoi915/drm: provide compat defines for userspace for certain struct members.
Dave Airlie [Fri, 19 Dec 2008 05:07:46 +0000 (15:07 +1000)]
i915/drm: provide compat defines for userspace for certain struct members.

Painfully userspace started using new names that were never actually to be
used from the external repo.

Also fill out the gaps in the structure for old/new userspace compat

Add compat defines for these structs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: drop DRM_IOCTL_MODE_REPLACEFB, add+remove works just as well.
Kristian H�gsberg [Thu, 18 Dec 2008 03:14:37 +0000 (13:14 +1000)]
drm: drop DRM_IOCTL_MODE_REPLACEFB, add+remove works just as well.

The replace fb ioctl replaces the backing buffer object for a modesetting
framebuffer object.  This can be acheived by just creating a new
framebuffer backed by the new buffer object, setting that for the crtcs
in question and then removing the old framebuffer object.

Signed-off-by: Kristian Hogsberg <krh@redhat.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: sanitise drm modesetting API + remove unused hotplug
Jakob Bornecrantz [Fri, 19 Dec 2008 04:50:50 +0000 (14:50 +1000)]
drm: sanitise drm modesetting API + remove unused hotplug

The initially merged modesetting API has some uglies in it, this
cleans up the struct members and ioctl ordering for initial submission.

It also removes the unneeded hotplug infrastructure.

airlied:- I've pulled this patch in from git modesetting-gem tree.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: fix allowing master ioctls on non-master fds.
Dave Airlie [Fri, 19 Dec 2008 01:00:46 +0000 (12:00 +1100)]
drm: fix allowing master ioctls on non-master fds.

The multi-master patches changed master to a pointer, and this fell out,
change to use is_master.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: use locked rmmap to remove sarea mapping.
Dave Airlie [Thu, 18 Dec 2008 23:23:14 +0000 (10:23 +1100)]
drm/radeon: use locked rmmap to remove sarea mapping.

this exports the locked version of the symbol as struct_mutex locks it all.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: fix missing hunk from the master changes.
Dave Airlie [Thu, 18 Dec 2008 23:22:02 +0000 (10:22 +1100)]
drm/radeon: fix missing hunk from the master changes.

Thanks to Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> for reporting
this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: fix useless gcc unused variable warning
Dave Airlie [Thu, 18 Dec 2008 06:59:02 +0000 (16:59 +1000)]
drm: fix useless gcc unused variable warning

the calling function doesn't call this function unless one of the two
states that sets the value is true.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: fix warning due to PAGE_SIZE max
Dave Airlie [Thu, 18 Dec 2008 06:56:11 +0000 (16:56 +1000)]
drm/radeon: fix warning due to PAGE_SIZE max

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: kconfig have drm core select i2c for kms
Dave Airlie [Sat, 13 Dec 2008 08:21:08 +0000 (18:21 +1000)]
drm: kconfig have drm core select i2c for kms

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: PAGE_CACHE_WC is x86 only so far
Dave Airlie [Thu, 11 Dec 2008 07:06:35 +0000 (17:06 +1000)]
drm: PAGE_CACHE_WC is x86 only so far

The page protections need to be checked whether they need to be more flexible.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: pick an 800x600@60HZ mode by default for unknown CRT.
Dave Airlie [Mon, 8 Dec 2008 04:55:27 +0000 (14:55 +1000)]
drm: pick an 800x600@60HZ mode by default for unknown CRT.

This is what X picks now, so we should do the same.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: Fix stolen memory detection on G45 and GM45.
Eric Anholt [Thu, 4 Dec 2008 06:50:02 +0000 (22:50 -0800)]
drm/i915: Fix stolen memory detection on G45 and GM45.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: Register module dependencies for the modesetting code.
Eric Anholt [Thu, 4 Dec 2008 06:43:14 +0000 (22:43 -0800)]
drm/i915: Register module dependencies for the modesetting code.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoDRM: i915: add mode setting support
Jesse Barnes [Fri, 7 Nov 2008 22:24:08 +0000 (14:24 -0800)]
DRM: i915: add mode setting support

This commit adds i915 driver support for the DRM mode setting APIs.
Currently, VGA, LVDS, SDVO DVI & VGA, TV and DVO LVDS outputs are
supported.  HDMI, DisplayPort and additional SDVO output support will
follow.

Support for the mode setting code is controlled by the new 'modeset'
module option.  A new config option, CONFIG_DRM_I915_KMS controls the
default behavior, and whether a PCI ID list is built into the module for
use by user level module utilities.

Note that if mode setting is enabled, user level drivers that access
display registers directly or that don't use the kernel graphics memory
manager will likely corrupt kernel graphics memory, disrupt output
configuration (possibly leading to hangs and/or blank displays), and
prevent panic/oops messages from appearing.  So use caution when
enabling this code; be sure your user level code supports the new
interfaces.

A new SysRq key, 'g', provides emergency support for switching back to
the kernel's framebuffer console; which is useful for testing.

Co-authors: Dave Airlie <airlied@linux.ie>, Hong Liu <hong.liu@intel.com>

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoDRM: add mode setting support
Dave Airlie [Fri, 7 Nov 2008 22:05:41 +0000 (14:05 -0800)]
DRM: add mode setting support

Add mode setting support to the DRM layer.

This is a fairly big chunk of work that allows DRM drivers to provide
full output control and configuration capabilities to userspace.  It was
motivated by several factors:
  - the fb layer's APIs aren't suited for anything but simple
    configurations
  - coordination between the fb layer, DRM layer, and various userspace
    drivers is poor to non-existent (radeonfb excepted)
  - user level mode setting drivers makes displaying panic & oops
    messages more difficult
  - suspend/resume of graphics state is possible in many more
    configurations with kernel level support

This commit just adds the core DRM part of the mode setting APIs.
Driver specific commits using these new structure and APIs will follow.

Co-authors: Jesse Barnes <jbarnes@virtuousgeek.org>, Jakob Bornecrantz <jakob@tungstengraphics.com>
Contributors: Alan Hourihane <alanh@tungstengraphics.com>, Maarten Maathuis <madman2003@gmail.com>

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: add GEM GTT mapping support
Jesse Barnes [Wed, 12 Nov 2008 18:03:55 +0000 (10:03 -0800)]
drm/i915: add GEM GTT mapping support

Use the new core GEM object mapping code to allow GTT mapping of GEM
objects on i915.  The fault handler will make sure a fence register is
allocated too, if the object in question is tiled.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: GEM mmap support
Jesse Barnes [Wed, 5 Nov 2008 18:31:53 +0000 (10:31 -0800)]
drm: GEM mmap support

Add core support for mapping of GEM objects.  Drivers should provide a
vm_operations_struct if they want to support page faulting of objects.
The code for handling GEM object offsets was taken from TTM, which was
written by Thomas Hellström.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/i915: Add /proc debugging entry for reading out the HWS.
Eric Anholt [Wed, 5 Nov 2008 20:37:42 +0000 (12:37 -0800)]
drm/i915: Add /proc debugging entry for reading out the HWS.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: reorganise start and load.
Dave Airlie [Sun, 7 Dec 2008 02:02:21 +0000 (12:02 +1000)]
drm: reorganise start and load.

Make sure we have the primary node so the device can add maps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: fix leak of uninitialized data to userspace
Vegard Nossum [Tue, 2 Dec 2008 03:38:47 +0000 (13:38 +1000)]
drm: fix leak of uninitialized data to userspace

...so drm_getunique() is trying to copy some uninitialized data to
userspace. The ECX register contains the number of words that are
left to copy -- so there are 5 * 4 = 20 bytes left. The offset of the
first uninitialized byte (counting from the start of the string) is
also 20 (i.e. 0xf65d2294&((1 << 5)-1) == 20). So somebody tried to
copy 40 bytes when the string was only 19 long.

In drm_set_busid() we have this code:

        dev->unique_len = 40;
        dev->unique = drm_alloc(dev->unique_len + 1, DRM_MEM_DRIVER);
      ...
        len = snprintf(dev->unique, dev->unique_len, pci:%04x:%02x:%02x.%d",

...so it seems that dev->unique is never updated to reflect the
actual length of the string. The remaining bytes (20 in this case)
are random uninitialized bytes that are copied into userspace.

This patch fixes the problem by setting dev->unique_len after the
snprintf().

airlied- I've had to fix this up to store the alloced size so
we have it for drm_free later.

Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Vegard Nossum <vegardno@thuin.ifi.uio.no>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: move to kref per-master structures.
Dave Airlie [Fri, 28 Nov 2008 04:22:24 +0000 (14:22 +1000)]
drm: move to kref per-master structures.

This is step one towards having multiple masters sharing a drm
device in order to get fast-user-switching to work.

It splits out the information associated with the drm master
into a separate kref counted structure, and allocates this when
a master opens the device node. It also allows the current master
to abdicate (say while VT switched), and a new master to take over
the hardware.

It moves the Intel and radeon drivers to using the sarea from
within the new master structures.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm: cleanup exit path for module unload
Dave Airlie [Fri, 28 Nov 2008 03:43:47 +0000 (13:43 +1000)]
drm: cleanup exit path for module unload

The current sub-module unload exit path is a mess, it tries
to abuse the idr. Just keep a list of devices per driver struct
and free them in-order on rmmod.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agobio: get rid of bio_vec clearing
Jens Axboe [Tue, 23 Dec 2008 11:46:21 +0000 (12:46 +0100)]
bio: get rid of bio_vec clearing

We don't need to clear the memory used for adding bio_vec entries,
since nobody should be looking at members unitialized. Any valid
use should be below bio->bi_vcnt, and that members up until that count
must be valid since they were added through bio_add_page().

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agobounce: don't rely on a zeroed bio_vec list
Jens Axboe [Tue, 23 Dec 2008 11:44:19 +0000 (12:44 +0100)]
bounce: don't rely on a zeroed bio_vec list

__blk_queue_bounce() relies on a zeroed bio_vec list, since it looks
up arbitrary indexes in the allocated bio. The block layer only
guarentees that added entries are valid, so clear memory after alloc.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agocciss: simplify parameters to deregister_disk function
Stephen M. Cameron [Thu, 18 Dec 2008 13:55:51 +0000 (14:55 +0100)]
cciss: simplify parameters to deregister_disk function

Simplify parameters to deregister_disk function.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agocfq-iosched: fix race between exiting queue and exiting task
Jens Axboe [Mon, 15 Dec 2008 20:19:25 +0000 (21:19 +0100)]
cfq-iosched: fix race between exiting queue and exiting task

Original patch from Nikanth Karthikesan <knikanth@suse.de>

When a queue exits the queue lock is taken and cfq_exit_queue() would free all
the cic's associated with the queue.

But when a task exits, cfq_exit_io_context() gets cic one by one and then
locks the associated queue to call __cfq_exit_single_io_context. It looks like
between getting a cic from the ioc and locking the queue, the queue might have
exited on another cpu.

Fix this by rechecking the cfq_io_context queue key inside the queue lock
again, and not calling into __cfq_exit_single_io_context() if somebody
beat us to it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoloop: Do not call loop_unplug for not configured loop device.
Milan Broz [Fri, 12 Dec 2008 13:50:49 +0000 (14:50 +0100)]
loop: Do not call loop_unplug for not configured loop device.

In loop_unplug() function is expected that mapping is set
and lo->lo_backing_file is not NULL.

Unfortunately loop_set_fd() set the request queue unplug function,
but loop_clr_fd() doesn't clear that.

Loop device allows open of non-configured loop in some situations.
If the unplug on request queue is called, loop module oopses because
of missing lo_backing_file.

Simple reproducer:
losetup /dev/loop0 /xxx
losetup -d /dev/loop0
dmsetup create x --table "0 1 linear /dev/loop0 0"

 EIP is at loop_unplug+0x1d/0x3b
 ...
  Call Trace:
   blk_unplug+0x57/0x5e
   dm_table_unplug_all+0x34/0x77 [dm_mod]
   destroy_inode+0x27/0x38
   generic_delete_inode+0xd5/0xd9
   iput+0x4b/0x4e
   dm_resume+0xca/0xfe [dm_mod]
   dev_suspend+0x143/0x165 [dm_mod]
   dm_ctl_ioctl+0x18e/0x1cf [dm_mod]
   dev_suspend+0x0/0x165 [dm_mod]
   dm_ctl_ioctl+0x0/0x1cf [dm_mod]
   vfs_ioctl+0x22/0x69
   do_vfs_ioctl+0x39d/0x3c7
   trace_hardirqs_on+0xb/0xd
   remove_vma+0x50/0x56
   do_munmap+0x21c/0x237
   sys_ioctl+0x2c/0x45
   sysenter_do_call+0x12/0x31

Several reports here
http://www.kerneloops.org/search.php?search=loop_unplug

Fix it by simply clear unplug function together with
removing of backing file.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
15 years agoloop: Flush possible running bios when loop device is released.
Milan Broz [Fri, 12 Dec 2008 13:48:27 +0000 (14:48 +0100)]
loop: Flush possible running bios when loop device is released.

When there are still queued bios and reference count
drops to zero, loop device must flush all queued bios.

Otherwise it can lead to situation that caller
closes the device, but some bios are still running
and endio() function call later OOpses when uses
unallocated mempool.

This happens for example when running dm-crypt over loop,
here is typical oops backtrace:

 Oops: 0000 [#1] PREEMPT SMP
 EIP is at mempool_free+0x12/0x6b
...
 crypt_dec_pending+0x50/0x54 [dm_crypt]
 crypt_endio+0x9f/0xa7 [dm_crypt]
 crypt_endio+0x0/0xa7 [dm_crypt]
 bio_endio+0x2b/0x2e
 loop_thread+0x37a/0x3b1
 do_lo_send_aops+0x0/0x165
 autoremove_wake_function+0x0/0x33
 loop_thread+0x0/0x3b1
 kthread+0x3b/0x61
 kthread+0x0/0x61
 kernel_thread_helper+0x7/0x10

(But crash is reproducible with different dm targets
running over loop device too.)

Patch fixes it by flushing the bios in release call,
reusing the flush mechanism for switching backing store.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>