Commit Graph

127398 Commits

Author SHA1 Message Date
Nicolas Ferre 51c5d8d149 mmc: at91_mci: remove the use of irq_to_gpio
Remove the use of irq_to_gpio() in the card detection interrupt
handler. The information is available in the board structure and
we can avoid using a function that has little meaning.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:27 -04:00
Ludovic Desroches 7e8ba228d9 mmc: atmel-mci: fix a potential issue about pending PDC interrupts
This patch fixes a potential issue about PDC interrupts. For example we
have a ENDRX pending interrupt and a RXBUFF pending interrupt. We have
received the RXBUFF interrupt but the transfer is not finished (so we
didn't have time to give a new buffer to the PDC controller). Then we
will compute ENDRX interrupt and we will give a new buffer to the PDC
controller, just after we will compute the RXBUFF interrupt and give
one or two new buffers to the PDC controller but we are not sure that
the first buffer given has been filled. So in this situation we may
have "lost" one sg buffer. It's the same for transmission.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:26 -04:00
Ludovic Desroches 341fa4c3af mmc: atmel-mci: correct sg buffer size evaluation
Assuming that a sg buffer size is a page size is false so use sg_dma_len.
A 4096 bytes can be required with two 2048-bytes sg buffer.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:26 -04:00
Ludovic Desroches 1ebbe3d31f mmc: atmel-mci: use ATMEL_PDC_SCND_BUF_OFF instead of a literal value
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:26 -04:00
Ludovic Desroches 11d1488b01 mmc: atmel-mci: change atmci_start_command to atmci_send_command
Rename atmci_start_command() to atmci_send_command() which is more
appropriate; atmci_start_command suggests we're sending a start command.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:26 -04:00
Ludovic Desroches 796211b795 mmc: atmel-mci: add pdc support and runtime capabilities detection
Add pdc support for atmel-mci. It makes at91-mci driver useless because it
was only used for the old atmel MCI core which has pdc but no dma support.
To allow removing at91-mci, the capabilities of the MCI core are detected
at runtime -- then the driver will use pio, pdc or dma transfers.
Warning: at91rm9200 is not supported, to support it we need to use swab32
on data but I have no board to test it.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:26 -04:00
Ludovic Desroches b9867f371c mmc: atmel-mci: indentation
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:26 -04:00
Ludovic Desroches 03fc9a7f0c mmc: atmel-mci: change atmci_readl and atmci_writel macros
Change atmci_readl and atmci_writel macros: remove string concatenation.
We can use these macros with registers which are not prefixed by ATMCI_.
This is the case if we want to write PDC registers which are common to
several devices so they are not prefixed with ATMCI_.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:25 -04:00
Ludovic Desroches 2c96a293bb mmc: atmel-mci: change namespace
Homogenize namespace to atmci.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2011-10-26 15:43:25 -04:00
Linus Torvalds c3ae1f3356 Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md: (34 commits)
  md: Fix some bugs in recovery_disabled handling.
  md/raid5: fix bug that could result in reads from a failed device.
  lib/raid6: Fix filename emitted in generated code
  md.c: trivial comment fix
  MD: Allow restarting an interrupted incremental recovery.
  md: clear In_sync bit on devices added to an active array.
  md: add proper write-congestion reporting to RAID1 and RAID10.
  md: rename "mdk_personality" to "md_personality"
  md/bitmap remove fault injection options.
  md/raid5: typedef removal: raid5_conf_t -> struct r5conf
  md/raid1: typedef removal: conf_t -> struct r1conf
  md/raid10: typedef removal: conf_t -> struct r10conf
  md/raid0: typedef removal: raid0_conf_t -> struct r0conf
  md/multipath: typedef removal: multipath_conf_t -> struct mpconf
  md/linear: typedef removal: linear_conf_t -> struct linear_conf
  md/faulty: remove typedef: conf_t -> struct faulty_conf
  md/linear: remove typedefs: dev_info_t -> struct dev_info
  md: remove typedefs: mirror_info_t -> struct mirror_info
  md: remove typedefs: r10bio_t -> struct r10bio and r1bio_t -> struct r1bio
  md: remove typedefs: mdk_thread_t -> struct md_thread
  ...
2011-10-26 21:39:42 +02:00
Linus Torvalds c28cfd60e4 Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
* 'for-linus' of git://git.open-osd.org/linux-open-osd: (21 commits)
  ore: Enable RAID5 mounts
  exofs: Support for RAID5 read-4-write interface.
  ore: RAID5 Write
  ore: RAID5 read
  fs/Makefile: Always inspect exofs/
  ore: Make ore_calc_stripe_info EXPORT_SYMBOL
  ore/exofs: Change ore_check_io API
  ore/exofs: Define new ore_verify_layout
  ore: Support for partial component table
  ore: Support for short read/writes
  exofs: Support for short read/writes
  ore: Remove check for ios->kern_buff in _prepare_for_striping to later
  ore: cleanup: Embed an ore_striping_info inside ore_io_state
  ore: Only IO one group at a time (API change)
  ore/exofs: Change the type of the devices array (API change)
  ore: Make ore_striping_info and ore_calc_stripe_info public
  exofs: Remove unused data_map member from exofs_sb_info
  exofs: Rename struct ore_components comps => oc
  exofs/super.c: local functions should be static
  exofs/ore.c: local functions should be static
  ...
2011-10-26 21:33:50 +02:00
Linus Torvalds edb34a4dbd Remove stale "depends on NETDEV_1000"in staging drivers
Mark Einon points out that the Kconfig option for NETDEV_1000 no longer
exists, and the merge of the staging drivers should have removed that
for the et131x driver.

And while checking for it, I noticed that slicoss had the same stale
dependency.  Remove that one too.

Reported-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-26 17:21:19 +02:00
Linus Torvalds 39adff5f69 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
  time, s390: Get rid of compile warning
  dw_apb_timer: constify clocksource name
  time: Cleanup old CONFIG_GENERIC_TIME references that snuck in
  time: Change jiffies_to_clock_t() argument type to unsigned long
  alarmtimers: Fix error handling
  clocksource: Make watchdog reset lockless
  posix-cpu-timers: Cure SMP accounting oddities
  s390: Use direct ktime path for s390 clockevent device
  clockevents: Add direct ktime programming function
  clockevents: Make minimum delay adjustments configurable
  nohz: Remove "Switched to NOHz mode" debugging messages
  proc: Consider NO_HZ when printing idle and iowait times
  nohz: Make idle/iowait counter update conditional
  nohz: Fix update_ts_time_stat idle accounting
  cputime: Clean up cputime_to_usecs and usecs_to_cputime macros
  alarmtimers: Rework RTC device selection using class interface
  alarmtimers: Add try_to_cancel functionality
  alarmtimers: Add more refined alarm state tracking
  alarmtimers: Remove period from alarm structure
  alarmtimers: Remove interval cap limit hack
  ...
2011-10-26 17:15:03 +02:00
Linus Torvalds 8a4a8918ed Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
  llist: Add back llist_add_batch() and llist_del_first() prototypes
  sched: Don't use tasklist_lock for debug prints
  sched: Warn on rt throttling
  sched: Unify the ->cpus_allowed mask copy
  sched: Wrap scheduler p->cpus_allowed access
  sched: Request for idle balance during nohz idle load balance
  sched: Use resched IPI to kick off the nohz idle balance
  sched: Fix idle_cpu()
  llist: Remove cpu_relax() usage in cmpxchg loops
  sched: Convert to struct llist
  llist: Add llist_next()
  irq_work: Use llist in the struct irq_work logic
  llist: Return whether list is empty before adding in llist_add()
  llist: Move cpu_relax() to after the cmpxchg()
  llist: Remove the platform-dependent NMI checks
  llist: Make some llist functions inline
  sched, tracing: Show PREEMPT_ACTIVE state in trace_sched_switch
  sched: Remove redundant test in check_preempt_tick()
  sched: Add documentation for bandwidth control
  sched: Return unused runtime on group dequeue
  ...
2011-10-26 17:08:43 +02:00
Linus Torvalds 7115e3fcf4 Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (121 commits)
  perf symbols: Increase symbol KSYM_NAME_LEN size
  perf hists browser: Refuse 'a' hotkey on non symbolic views
  perf ui browser: Use libslang to read keys
  perf tools: Fix tracing info recording
  perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads
  perf hists: Don't consider filtered entries when calculating column widths
  perf hists: Don't decay total_period for filtered entries
  perf hists browser: Honour symbol_conf.show_{nr_samples,total_period}
  perf hists browser: Do not exit on tab key with single event
  perf annotate browser: Don't change selection line when returning from callq
  perf tools: handle endianness of feature bitmap
  perf tools: Add prelink suggestion to dso update message
  perf script: Fix unknown feature comment
  perf hists browser: Apply the dso and thread filters when merging new batches
  perf hists: Move the dso and thread filters from hist_browser
  perf ui browser: Honour the xterm colors
  perf top tui: Give color hints just on the percentage, like on --stdio
  perf ui browser: Make the colors configurable and change the defaults
  perf tui: Remove unneeded call to newtCls on startup
  perf hists: Don't format the percentage on hist_entry__snprintf
  ...

Fix up conflicts in arch/x86/kernel/kprobes.c manually.

Ingo's tree did the insane "add volatile to const array", which just
doesn't make sense ("volatile const"?).  But we could remove the const
*and* make the array volatile to make doubly sure that gcc doesn't
optimize it away..

Also fix up kernel/trace/ring_buffer.c non-data-conflicts manually: the
reader_lock has been turned into a raw lock by the core locking merge,
and there was a new user of it introduced in this perf core merge.  Make
sure that new use also uses the raw accessor functions.
2011-10-26 17:03:38 +02:00
Linus Torvalds 1f6e05171b Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Add IRQF_RESUME_EARLY and resume such IRQs earlier
  genirq: Fix fatfinered fixup really
  genirq: percpu: allow interrupt type to be set at enable time
  genirq: Add support for per-cpu dev_id interrupts
  genirq: Add IRQCHIP_SKIP_SET_WAKE flag
2011-10-26 16:44:09 +02:00
Linus Torvalds 3cfef95246 Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
  rtmutex: Add missing rcu_read_unlock() in debug_rt_mutex_print_deadlock()
  lockdep: Comment all warnings
  lib: atomic64: Change the type of local lock to raw_spinlock_t
  locking, lib/atomic64: Annotate atomic64_lock::lock as raw
  locking, x86, iommu: Annotate qi->q_lock as raw
  locking, x86, iommu: Annotate irq_2_ir_lock as raw
  locking, x86, iommu: Annotate iommu->register_lock as raw
  locking, dma, ipu: Annotate bank_lock as raw
  locking, ARM: Annotate low level hw locks as raw
  locking, drivers/dca: Annotate dca_lock as raw
  locking, powerpc: Annotate uic->lock as raw
  locking, x86: mce: Annotate cmci_discover_lock as raw
  locking, ACPI: Annotate c3_lock as raw
  locking, oprofile: Annotate oprofilefs lock as raw
  locking, video: Annotate vga console lock as raw
  locking, latencytop: Annotate latency_lock as raw
  locking, timer_stats: Annotate table_lock as raw
  locking, rwsem: Annotate inner lock as raw
  locking, semaphores: Annotate inner lock as raw
  locking, sched: Annotate thread_group_cputimer as raw
  ...

Fix up conflicts in kernel/posix-cpu-timers.c manually: making
cputimer->cputime a raw lock conflicted with the ABBA fix in commit
bcd5cff721 ("cputimer: Cure lock inversion").
2011-10-26 16:17:32 +02:00
Linus Torvalds 982653009b Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, ioapic: Consolidate the explicit EOI code
  x86, ioapic: Restore the mask bit correctly in eoi_ioapic_irq()
  x86, kdump, ioapic: Reset remote-IRR in clear_IO_APIC
  iommu: Rename the DMAR and INTR_REMAP config options
  x86, ioapic: Define irq_remap_modify_chip_defaults()
  x86, msi, intr-remap: Use the ioapic set affinity routine
  iommu: Cleanup ifdefs in detect_intel_iommu()
  iommu: No need to set dmar_disabled in check_zero_address()
  iommu: Move IOMMU specific code to intel-iommu.c
  intr_remap: Call dmar_dev_scope_init() explicitly
  x86, x2apic: Enable the bios request for x2apic optout
2011-10-26 16:11:53 +02:00
Linus Torvalds 37d96c28ec Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  caif: Fix BUG() with network namespaces
  net: make bonding slaves honour master's skb->priority
  net: Unlock sock before calling sk_free()
2011-10-26 16:08:52 +02:00
Linus Torvalds aa77677e0a Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1519 commits)
  staging: et131x: Remove redundant check and return statement
  staging: et131x: Mainly whitespace changes to appease checkpatch
  staging: et131x: Remove last of the forward declarations
  staging: et131x: Remove even more forward declarations
  staging: et131x: Remove yet more forward declarations
  staging: et131x: Remove more forward declarations
  staging: et131x: Remove forward declaration of et131x_adapter_setup
  staging: et131x: Remove some forward declarations
  staging: et131x: Remove unused rx_ring.recv_packet_pool
  staging: et131x: Remove call to find pci pm capability
  staging: et131x: Remove redundant et131x_reset_recv() call
  staging: et131x: Remove unused rx_ring.recv_buffer_pool
  Staging: bcm: Fix three initialization errors in InterfaceDld.c
  Staging: bcm: Fix coding style issues in InterfaceDld.c
  staging:iio:dac: Add AD5360 driver
  staging:iio:trigger:bfin-timer: Fix compile error
  Staging: vt6655: add some range checks before memcpy()
  Staging: vt6655: whitespace fixes to iotcl.c
  Staging: vt6656: add some range checks before memcpy()
  Staging: vt6656: whitespace cleanups in ioctl.c
  ...

Fix up conflicts in:
 - drivers/{Kconfig,Makefile}, drivers/staging/{Kconfig,Makefile}:
	vg driver movement
 - drivers/staging/brcm80211/brcmfmac/{dhd_linux.c,mac80211_if.c}:
	driver removal vs now stale changes
 - drivers/staging/rtl8192e/r8192E_core.c:
	driver removal vs now stale changes
 - drivers/staging/et131x/et131*:
	driver consolidation into one file, tried to do fixups
2011-10-26 15:39:02 +02:00
Linus Torvalds efb8d21b2c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (79 commits)
  TTY: serial_core: Fix crash if DCD drop during suspend
  tty/serial: atmel_serial: bootconsole removed from auto-enumerates
  Revert "TTY: call tty_driver_lookup_tty unconditionally"
  tty/serial: atmel_serial: add device tree support
  tty/serial: atmel_serial: auto-enumerate ports
  tty/serial: atmel_serial: whitespace and braces modifications
  tty/serial: atmel_serial: change platform_data variable name
  tty/serial: RS485 bindings for device tree
  TTY: call tty_driver_lookup_tty unconditionally
  TTY: pty, release tty in all ptmx_open fail paths
  TTY: make tty_add_file non-failing
  TTY: drop driver reference in tty_open fail path
  8250_pci: Fix kernel panic when pch_uart is disabled
  h8300: drivers/serial/Kconfig was moved
  parport_pc: release IO region properly if unsupported ITE887x card is found
  tty: Support compat_ioctl get/set termios_locked
  hvc_console: display printk messages on console.
  TTY: snyclinkmp: forever loop in tx_load_dma_buffer()
  tty/n_gsm: avoid fifo overflow in gsm_dlci_data_output
  tty/n_gsm: fix a bug in gsm_dlci_data_output (adaption = 2 case)
  ...

Fix up Conflicts in:
 - drivers/tty/serial/8250_pci.c
	Trivial conflict with removed duplicate device ID
 - drivers/tty/serial/atmel_serial.c
	Annoying silly conflict between "specify the port num via
	platform_data" and other changes to atmel_console_init
2011-10-26 15:11:09 +02:00
Linus Torvalds 3cb603284b Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (26 commits)
  hwmon: (w83627ehf) Better fix for negative temperature values
  hwmon: (w83627ehf) Uninline is_word_sized
  hwmon: (lm75) Document why clones are not detected
  hwmon: (w83627ehf) Move fan pins check to a separate function
  hwmon: (w83627ehf) Skip reading unused voltage registers
  hwmon: (lm75) Add support for Analog Devices ADT75
  hwmon: (pmbus_core) Simplify sign extensions
  hwmon: (pmbus) Add support for Lineage Power DC-DC converters
  hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driver
  hwmon: (pmbus/ltc2978) Explicit driver for LTC2978
  hwmon: (pmbus) Add support for TEMP2 peak attributes
  hwmon: AD7314 driver (ported from IIO)
  hwmon: (pmbus) Add support for Intersil power management chips
  hwmon: (pmbus) Always call _pmbus_read_byte in core driver
  hwmon: (pmbus) Replace EINVAL return codes with more appropriate errors
  hwmon: (pmbus) Provide more documentation
  hwmon/f71882fg: Make the decision wether to register fan attr. per fan
  hwmon/f71882fg: Add a f71882fg_create_fan_sysfs_files helper function
  hwmon/f71882fg: Make all fan/pwm attr tables 2 dimensional
  hwmon: (exynos4_tmu) Remove IRQF_DISABLED
  ...
2011-10-26 14:52:52 +02:00
NeilBrown d890fa2b05 md: Fix some bugs in recovery_disabled handling.
In 3.0 we changed the way recovery_disabled was handle so that instead
of testing against zero, we test an mddev-> value against a conf->
value.
Two problems:
  1/ one place in raid1 was missed and still sets to '1'.
  2/ We didn't explicitly set the conf-> value at array creation
     time.
     It defaulted to '0' just like the mddev value does so they
     could appear equal and thus disable recovery.
     This did not affect normal 'md' as it calls bind_rdev_to_array
     which changes the mddev value.  However the dmraid interface
     doesn't call this and so doesn't change ->recovery_disabled; so at
     array start all recovery is incorrectly disabled.

So initialise the 'conf' value to one less that the mddev value, so
the will only be the same when explicitly set that way.

Reported-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: NeilBrown  <neilb@suse.de>
2011-10-26 11:54:39 +11:00
NeilBrown 355840e7a7 md/raid5: fix bug that could result in reads from a failed device.
This bug was introduced in 415e72d034
which was in 2.6.36.

There is a small window of time between when a device fails and when
it is removed from the array.  During this time we might still read
from it, but we won't write to it - so it is possible that we could
read stale data.

We didn't need the test of 'Faulty' before because the test on
In_sync is sufficient.  Since we started allowing reads from the early
part of non-In_sync devices we need a test on Faulty too.

This is suitable for any kernel from 2.6.36 onwards, though the patch
might need a bit of tweaking in 3.0 and earlier.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
2011-10-26 10:31:04 +11:00
Maciej Żenczykowski 59fdaca9a4 net: make bonding slaves honour master's skb->priority
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-25 19:22:23 -04:00
Sage Weil 6ab00d465a libceph: create messenger with client
This simplifies the init/shutdown paths, and makes client->msgr available
during the rest of the setup process.

Signed-off-by: Sage Weil <sage@newdream.net>
2011-10-25 16:10:15 -07:00
Eric Dumazet 0110bba5e7 ehea: fix skb_frag_size typo
Commit 9e903e0852 ("net: add skb frag size accessors") introduced a
typo in ehea driver.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-25 16:20:43 +02:00
Linus Torvalds 7e0bb71e75 Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits)
  PM / Clocks: Remove redundant NULL checks before kfree()
  PM / Documentation: Update docs about suspend and CPU hotplug
  ACPI / PM: Add Sony VGN-FW21E to nonvs blacklist.
  ARM: mach-shmobile: sh7372 A4R support (v4)
  ARM: mach-shmobile: sh7372 A3SP support (v4)
  PM / Sleep: Mark devices involved in wakeup signaling during suspend
  PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image
  PM / Hibernate: Do not initialize static and extern variables to 0
  PM / Freezer: Make fake_signal_wake_up() wake TASK_KILLABLE tasks too
  PM / Hibernate: Add resumedelay kernel param in addition to resumewait
  MAINTAINERS: Update linux-pm list address
  PM / ACPI: Blacklist Vaio VGN-FW520F machine known to require acpi_sleep=nonvs
  PM / ACPI: Blacklist Sony Vaio known to require acpi_sleep=nonvs
  PM / Hibernate: Add resumewait param to support MMC-like devices as resume file
  PM / Hibernate: Fix typo in a kerneldoc comment
  PM / Hibernate: Freeze kernel threads after preallocating memory
  PM: Update the policy on default wakeup settings
  PM / VT: Cleanup #if defined uglyness and fix compile error
  PM / Suspend: Off by one in pm_suspend()
  PM / Hibernate: Include storage keys in hibernation image on s390
  ...
2011-10-25 15:18:39 +02:00
Linus Torvalds c9d6329c35 Merge branch 'for-next' of git://git.linaro.org/people/triad/linux-pinctrl
* 'for-next' of git://git.linaro.org/people/triad/linux-pinctrl:
  pinctrl/sirf: fix sirfsoc_get_group_pins prototype
  pinctrl: Don't copy function name when requesting a pin
  pinctrl: Don't copy pin names when registering them
  pinctrl: Remove unsafe __refdata
  pinctrl: get_group_pins() const fixes
  pinctrl: add a driver for the CSR SiRFprimaII pinmux
  pinctrl: add a driver for the U300 pinmux
  drivers: create a pin control subsystem
2011-10-25 14:04:01 +02:00
Linus Torvalds 4e7e2a2008 Merge branch 'for-linus' of git://opensource.wolfsonmicro.com/regmap
* 'for-linus' of git://opensource.wolfsonmicro.com/regmap: (62 commits)
  mfd: Enable rbtree cache for wm831x devices
  regmap: Support some block operations on cached devices
  regmap: Allow caches for devices with no defaults
  regmap: Ensure rbtree syncs registers set to zero properly
  regmap: Allow rbtree to cache zero default values
  regmap: Warn on raw I/O as well as bulk reads that bypass cache
  regmap: Return a sensible error code if we fail to read the cache
  regmap: Use bsearch() to search the register defaults
  regmap: Fix doc comment
  regmap: Optimize the lookup path to use binary search
  regmap: Ensure we scream if we enable cache bypass/only at the same time
  regmap: Implement regcache_cache_bypass helper function
  regmap: Save/restore the bypass state upon syncing
  regmap: Lock the sync path, ensure we use the lockless _regmap_write()
  regmap: Fix apostrophe usage
  regmap: Make _regmap_write() global
  regmap: Fix lock used for regcache_cache_only()
  regmap: Grab the lock in regcache_cache_only()
  regmap: Modify map->cache_bypass directly
  regmap: Fix regcache_sync generic implementation
  ...
2011-10-25 13:57:45 +02:00
Linus Torvalds 8a9ea3237e Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1745 commits)
  dp83640: free packet queues on remove
  dp83640: use proper function to free transmit time stamping packets
  ipv6: Do not use routes from locally generated RAs
  |PATCH net-next] tg3: add tx_dropped counter
  be2net: don't create multiple RX/TX rings in multi channel mode
  be2net: don't create multiple TXQs in BE2
  be2net: refactor VF setup/teardown code into be_vf_setup/clear()
  be2net: add vlan/rx-mode/flow-control config to be_setup()
  net_sched: cls_flow: use skb_header_pointer()
  ipv4: avoid useless call of the function check_peer_pmtu
  TCP: remove TCP_DEBUG
  net: Fix driver name for mdio-gpio.c
  ipv4: tcp: fix TOS value in ACK messages sent from TIME_WAIT
  rtnetlink: Add missing manual netlink notification in dev_change_net_namespaces
  ipv4: fix ipsec forward performance regression
  jme: fix irq storm after suspend/resume
  route: fix ICMP redirect validation
  net: hold sock reference while processing tx timestamps
  tcp: md5: add more const attributes
  Add ethtool -g support to virtio_net
  ...

Fix up conflicts in:
 - drivers/net/Kconfig:
	The split-up generated a trivial conflict with removal of a
	stale reference to Documentation/networking/net-modules.txt.
	Remove it from the new location instead.
 - fs/sysfs/dir.c:
	Fairly nasty conflicts with the sysfs rb-tree usage, conflicting
	with Eric Biederman's changes for tagged directories.
2011-10-25 13:25:22 +02:00
Linus Torvalds 1be025d3cb Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (260 commits)
  usb: renesas_usbhs: fixup inconsistent return from usbhs_pkt_push()
  usb/isp1760: Allow to optionally trigger low-level chip reset via GPIOLIB.
  USB: gadget: midi: memory leak in f_midi_bind_config()
  USB: gadget: midi: fix range check in f_midi_out_open()
  QE/FHCI: fixed the CONTROL bug
  usb: renesas_usbhs: tidyup for smatch warnings
  USB: Fix USB Kconfig dependency problem on 85xx/QoirQ platforms
  EHCI: workaround for MosChip controller bug
  usb: gadget: file_storage: fix race on unloading
  USB: ftdi_sio.c: Use ftdi async_icount structure for TIOCMIWAIT, as in other drivers
  USB: ftdi_sio.c:Fill MSR fields of the ftdi async_icount structure
  USB: ftdi_sio.c: Fill LSR fields of the ftdi async_icount structure
  USB: ftdi_sio.c:Fill TX field of the ftdi async_icount structure
  USB: ftdi_sio.c: Fill the RX field of the ftdi async_icount structure
  USB: ftdi_sio.c: Basic icount infrastructure for ftdi_sio
  usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF .
  USB: ftdi_sio: Support TI/Luminary Micro Stellaris BD-ICDI Board
  USB: Fix runtime wakeup on OHCI
  xHCI/USB: Make xHCI driver have a BOS descriptor.
  usb: gadget: add new usb gadget for ACM and mass storage
  ...
2011-10-25 12:23:15 +02:00
Linus Torvalds 2d03423b23 Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits)
  mm: memory hotplug: Check if pages are correctly reserved on a per-section basis
  Revert "memory hotplug: Correct page reservation checking"
  Update email address for stable patch submission
  dynamic_debug: fix undefined reference to `__netdev_printk'
  dynamic_debug: use a single printk() to emit messages
  dynamic_debug: remove num_enabled accounting
  dynamic_debug: consolidate repetitive struct _ddebug descriptor definitions
  uio: Support physical addresses >32 bits on 32-bit systems
  sysfs: add unsigned long cast to prevent compile warning
  drivers: base: print rejected matches with DEBUG_DRIVER
  memory hotplug: Correct page reservation checking
  memory hotplug: Refuse to add unaligned memory regions
  remove the messy code file Documentation/zh_CN/SubmitChecklist
  ARM: mxc: convert device creation to use platform_device_register_full
  new helper to create platform devices with dma mask
  docs/driver-model: Update device class docs
  docs/driver-model: Document device.groups
  kobj_uevent: Ignore if some listeners cannot handle message
  dynamic_debug: make netif_dbg() call __netdev_printk()
  dynamic_debug: make netdev_dbg() call __netdev_printk()
  ...
2011-10-25 12:13:59 +02:00
Linus Torvalds 59e5253417 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (59 commits)
  MAINTAINERS: linux-m32r is moderated for non-subscribers
  linux@lists.openrisc.net is moderated for non-subscribers
  Drop default from "DM365 codec select" choice
  parisc: Kconfig: cleanup Kernel page size default
  Kconfig: remove redundant CONFIG_ prefix on two symbols
  cris: remove arch/cris/arch-v32/lib/nand_init.S
  microblaze: add missing CONFIG_ prefixes
  h8300: drop puzzling Kconfig dependencies
  MAINTAINERS: microblaze-uclinux@itee.uq.edu.au is moderated for non-subscribers
  tty: drop superfluous dependency in Kconfig
  ARM: mxc: fix Kconfig typo 'i.MX51'
  Fix file references in Kconfig files
  aic7xxx: fix Kconfig references to READMEs
  Fix file references in drivers/ide/
  thinkpad_acpi: Fix printk typo 'bluestooth'
  bcmring: drop commented out line in Kconfig
  btmrvl_sdio: fix typo 'btmrvl_sdio_sd6888'
  doc: raw1394: Trivial typo fix
  CIFS: Don't free volume_info->UNC until we are entirely done with it.
  treewide: Correct spelling of successfully in comments
  ...
2011-10-25 12:11:02 +02:00
Linus Torvalds 73692d9bb5 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/apm:
  apm-emulation: use wait_event_freezable() instead of freezer_[do_not_]count()
2011-10-25 12:03:58 +02:00
Linus Torvalds 31dced41c6 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (61 commits)
  HID: hid-magicmouse: Magic Trackpad has 1 button, not 2
  HID: Add device IDs for more SJOY adapters
  HID: primax: remove spurious dependency
  HID: support primax keyboards violating USB HID spec
  HID: usbhid: cancel timer for retry synchronously
  HID: wacom: Set input bits before registration
  HID: consolidate MacbookAir 4,1 mappings
  HID: MacbookAir4,1 and MacbookAir4,2 need entry in hid_mouse_ignore_list[]
  HID: Add support MacbookAir 4,1 keyboard
  HID: hidraw: open count should not increase if error
  HID: hiddev: potential info leak in hiddev_ioctl()
  HID: multitouch: decide if hid-multitouch needs to handle mt devices
  HID: add autodetection of multitouch devices
  HID: "hid-logitech" driver with Logitech Driving Force GT
  HID: hid-logitech-dj: fix off by one
  HID: hidraw: protect hidraw_disconnect() better
  HID: hid-multitouch: add support for the IDEACOM 6650 chip
  HID: Add full support for Logitech Unifying receivers
  HID: hidraw: free list for all error in hidraw_open
  HID: roccat: Kone now reports external profile changes via roccat device
  ...
2011-10-25 12:03:13 +02:00
Linus Torvalds 7c1953ddb6 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (62 commits)
  target: Fix compile warning w/ missing module.h include
  target: Remove legacy se_task->task_timer and associated logic
  target: Fix incorrect transport_sent usage
  target: re-use the command S/G list for single-task commands
  target: Fix BIDI t_task_cdb handling in transport_generic_new_cmd
  target: remove transport_allocate_tasks
  target: merge transport_new_cmd_obj into transport_generic_new_cmd
  target: remove the task_sg_bidi field se_task and pSCSI BIDI support
  target: transport_subsystem_check_init cleanups
  target: use a workqueue for I/O completions
  target: remove unused TRANSPORT_ states
  target: remove TRANSPORT_DEFERRED_CMD state
  target: remove the TRANSPORT_REMOVE state
  target: move depth_left manipulation out of transport_generic_request_failure
  target: stop task timers earlier
  target: remove TF_TIMER_STOP
  target: factor some duplicate code for stopping a task
  target: fix list walking in transport_free_dev_tasks
  target: use transport_cmd_check_stop_to_fabric consistently
  target: do not pass the queue object to transport_remove_cmd_from_queue
  ...
2011-10-25 11:17:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD ad7761ab3a pinctrl/sirf: fix sirfsoc_get_group_pins prototype
fix sirfsoc_get_group_pins prototype introduced in 7e570f97, we
missed to de-constify a pointer.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2011-10-25 10:43:57 +02:00
Linus Torvalds 1bc67188c3 Merge branch 'for-linus' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm
* 'for-linus' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: (81 commits)
  ARM: 7133/1: SMP: fix per cpu timer setup before the cpu is marked online
  ARM: 7129/1: Add __arm_ioremap_exec for mapping external memory as MT_MEMORY
  ARM: 7136/1: pl330: Fix a race condition
  ARM: smp: fix clipping of number of CPUs
  ARM: 7137/1: Fix error upon adding LL debug
  ARM: Add a few machine types to mach-types
  ARM: 7130/1: dev_archdata: add private iommu extension
  ARM: 7125/1: Add unwinding annotations for 64bit division functions
  ARM: 7120/1: remove bashism in check for multiple zreladdrs
  ARM: 7118/1: rename temp variable in read*_relaxed()
  ARM: 6217/4: mach-realview: expose PB1176 ROM using physmap and map_rom
  ARM: 7098/1: kdump: copy kernel relocation code at the kexec prepare stage
  ARM: 7062/1: cache: detect PIPT I-cache using CTR
  ARM: platform fixups: remove mdesc argument to fixup function
  ARM: 7017/1: Use generic BUG() handler
  ARM: 7102/1: mach-integrator: update defconfig
  ARM: 7087/2: mach-integrator: get timer frequency from clock
  ARM: 7086/2: mach-integrator: modernize clock event registration
  ARM: 7085/2: mach-integrator: clockevent supports oneshot mode
  ARM: 7084/1: mach-integrator: retire some timer macros
  ...
2011-10-25 10:18:27 +02:00
Jiri Kosina b3aec7b686 Merge branch 'upstream' into for-linus
Conflicts:
	drivers/hid/hid-core.c
	drivers/hid/hid-ids.h
2011-10-25 09:59:04 +02:00
Jiri Kosina f6f1242784 Merge branch 'upstream-fixes' into for-linus
Conflicts:
	drivers/hid/hid-wacom.c
2011-10-25 09:58:12 +02:00
Jiri Kosina b0eae38ceb Merge branches 'acrux', 'logitech', 'multitouch', 'roccat' and 'wiimote' into for-linus 2011-10-25 09:54:16 +02:00
Linus Torvalds 36b8d186e6 Merge branch 'next' of git://selinuxproject.org/~jmorris/linux-security
* 'next' of git://selinuxproject.org/~jmorris/linux-security: (95 commits)
  TOMOYO: Fix incomplete read after seek.
  Smack: allow to access /smack/access as normal user
  TOMOYO: Fix unused kernel config option.
  Smack: fix: invalid length set for the result of /smack/access
  Smack: compilation fix
  Smack: fix for /smack/access output, use string instead of byte
  Smack: domain transition protections (v3)
  Smack: Provide information for UDS getsockopt(SO_PEERCRED)
  Smack: Clean up comments
  Smack: Repair processing of fcntl
  Smack: Rule list lookup performance
  Smack: check permissions from user space (v2)
  TOMOYO: Fix quota and garbage collector.
  TOMOYO: Remove redundant tasklist_lock.
  TOMOYO: Fix domain transition failure warning.
  TOMOYO: Remove tomoyo_policy_memory_lock spinlock.
  TOMOYO: Simplify garbage collector.
  TOMOYO: Fix make namespacecheck warnings.
  target: check hex2bin result
  encrypted-keys: check hex2bin result
  ...
2011-10-25 09:45:31 +02:00
Linus Torvalds cd85b55741 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k: Finally remove leftover markers sections
  m68k/mac: Fix mac_irq_pending() for PSC MACE and SCC
  m68k/mac: Fix compiler warning in via_read_time()
  zorro: Fix four checkpatch warnings
2011-10-25 09:34:10 +02:00
Russell King bdf4e94823 Merge branch 'misc' into for-linus
Conflicts:
	arch/arm/mach-integrator/integrator_ap.c
2011-10-25 08:19:59 +01:00
Linus Torvalds 04a8752485 Merge branches 'stable/drivers-3.2', 'stable/drivers.bugfixes-3.2' and 'stable/pci.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/drivers-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xenbus: don't rely on xen_initial_domain to detect local xenstore
  xenbus: Fix loopback event channel assuming domain 0
  xen/pv-on-hvm:kexec: Fix implicit declaration of function 'xen_hvm_domain'
  xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel
  xen/pv-on-hvm kexec: update xs_wire.h:xsd_sockmsg_type from xen-unstable
  xen/pv-on-hvm kexec+kdump: reset PV devices in kexec or crash kernel
  xen/pv-on-hvm kexec: rebind virqs to existing eventchannel ports
  xen/pv-on-hvm kexec: prevent crash in xenwatch_thread() when stale watch events arrive

* 'stable/drivers.bugfixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/pciback: Check if the device is found instead of blindly assuming so.
  xen/pciback: Do not dereference psdev during printk when it is NULL.
  xen: remove XEN_PLATFORM_PCI config option
  xen: XEN_PVHVM depends on PCI
  xen/pciback: double lock typo
  xen/pciback: use mutex rather than spinlock in vpci backend
  xen/pciback: Use mutexes when working with Xenbus state transitions.
  xen/pciback: miscellaneous adjustments
  xen/pciback: use mutex rather than spinlock in passthrough backend
  xen/pciback: use resource_size()

* 'stable/pci.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/pci: support multi-segment systems
  xen-swiotlb: When doing coherent alloc/dealloc check before swizzling the MFNs.
  xen/pci: make bus notifier handler return sane values
  xen-swiotlb: fix printk and panic args
  xen-swiotlb: Fix wrong panic.
  xen-swiotlb: Retry up three times to allocate Xen-SWIOTLB
  xen-pcifront: Update warning comment to use 'e820_host' option.
2011-10-25 09:19:36 +02:00
Greg Kroah-Hartman 43a3beb6da Merge branch 'staging-next' into Linux 3.1
This was done to resolve a conflict in the
drivers/staging/comedi/drivers/ni_labpc.c file that resolved a build
bugfix in Linus's tree with a "better" bugfix that was in the
staging-next tree that resolved the issue in a more complete manner.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25 09:18:11 +02:00
Linus Torvalds 31018acd4c Merge branches 'stable/bug.fixes-3.2' and 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/bug.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/p2m/debugfs: Make type_name more obvious.
  xen/p2m/debugfs: Fix potential pointer exception.
  xen/enlighten: Fix compile warnings and set cx to known value.
  xen/xenbus: Remove the unnecessary check.
  xen/irq: If we fail during msi_capability_init return proper error code.
  xen/events: Don't check the info for NULL as it is already done.
  xen/events: BUG() when we can't allocate our event->irq array.

* 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: Fix selfballooning and ensure it doesn't go too far
  xen/gntdev: Fix sleep-inside-spinlock
  xen: modify kernel mappings corresponding to granted pages
  xen: add an "highmem" parameter to alloc_xenballooned_pages
  xen/p2m: Use SetPagePrivate and its friends for M2P overrides.
  xen/p2m: Make debug/xen/mmu/p2m visible again.
  Revert "xen/debug: WARN_ON when identity PFN has no _PAGE_IOMAP flag set."
2011-10-25 09:17:47 +02:00
Linus Torvalds 5eef150c1d Merge branch 'stable/e820-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/e820-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: release all pages within 1-1 p2m mappings
  xen: allow extra memory to be in multiple regions
  xen: allow balloon driver to use more than one memory region
  xen/balloon: simplify test for the end of usable RAM
  xen/balloon: account for pages released during memory setup
2011-10-25 09:17:07 +02:00
Nicholas Bellinger b91bf5bf7f target: Fix compile warning w/ missing module.h include
This patch fixes the following compile warning in target_core_cdb.c in
recent linux-next code due to the new use of EXPORT_SYMBOL() for
target_get_task_cdb().

drivers/target/target_core_cdb.c:1316: warning: data definition has no type or storage class
drivers/target/target_core_cdb.c:1316: warning: type defaults to ‘int’ in declaration of ‘EXPORT_SYMBOL’
drivers/target/target_core_cdb.c:1316: warning: parameter names (without types) in function declaration

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-25 06:43:29 +00:00
Kyle Moffett ae97159aed of_mdio: Don't phy_scan_fixups() twice
The "phy_device_register()" call 5 lines down already calls
phy_scan_fixups(), there's no need to do it a second time.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-25 06:55:52 +02:00
Richard Cochran 8b3408f8ee dp83640: free packet queues on remove
If the PHY should disappear (for example, on an USB Ethernet MAC), then
the driver would leak any undelivered time stamp packets. This commit
fixes the issue by calling the appropriate functions to free any packets
left in the transmit and receive queues.

The driver first appeared in v3.0.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 19:14:50 -04:00
Richard Cochran f5ff7cd1a8 dp83640: use proper function to free transmit time stamping packets
The previous commit enforces a new rule for handling the cloned packets
for transmit time stamping. These packets must not be freed using any other
function than skb_complete_tx_timestamp. This commit fixes the one and only
driver using this API.

The driver first appeared in v3.0.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 19:14:50 -04:00
Eric Dumazet 4885543204 |PATCH net-next] tg3: add tx_dropped counter
If a frame cant be transmitted, it is silently discarded.

Add a counter to report these errors to user.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 18:40:14 -04:00
Sathya Perla 752961a11e be2net: don't create multiple RX/TX rings in multi channel mode
When the HW is in multi-channel mode based on the skew/IPL, there are
4 functions per port and so not enough resources to create multiple
RX/TX rings for each function.

Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 18:40:14 -04:00
Sathya Perla dafc0fe3af be2net: don't create multiple TXQs in BE2
Multiple TXQ support is partially broken in BE2. It is fully
supported BE3 onwards and in Lancer.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 18:40:14 -04:00
Sathya Perla f9449ab768 be2net: refactor VF setup/teardown code into be_vf_setup/clear()
Currently the code for VF setup/teardown done by a PF (if_create,
mac_add_config, link_status_query etc) is scattered; this patch
refactors this code into be_vf_setup() and be_vf_clear().  The
if_create/if_destroy/mac_addr_query cmds are now called after the MCCQ
is created; so these cmds are now modified to use the MCCQ instead of
MBOX.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 18:40:14 -04:00
Sathya Perla a54769f51b be2net: add vlan/rx-mode/flow-control config to be_setup()
When a card is reset due to EEH error recovery or due to a suspend,
rx-mode config (promisc/mc) is not being sent to the FW. be_setup() is
called in these flows and is the best place for such config/re-config
cmds. Hence include rx-mode, vlan and flow-control config in
be_setup().

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 18:40:14 -04:00
Grant Likely 940ab88962 drivercore: Add helper macro for platform_driver boilerplate
For simple modules that contain a single platform_driver without any
additional setup code then ends up being a block of duplicated
boilerplate.  This patch adds a new macro, module_platform_driver(),
which replaces the module_init()/module_exit() registrations with
template functions.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Reviewed-by: Magnus Damm <magnus.damm@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
2011-10-25 00:35:47 +02:00
David S. Miller 1805b2f048 Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
Dirk Eibach f42af6c486 net: Fix driver name for mdio-gpio.c
Since commit
"7488876... dt/net: Eliminate users of of_platform_{,un}register_driver"
there are two platform drivers named "mdio-gpio" registered.
I renamed the of variant to "mdio-ofgpio".

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 17:24:40 -04:00
Jim Rotmalm d996e9dc45 zorro: Fix four checkpatch warnings
zorro-driver.c: fix four checkpatch warnings of:
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable

I had a cat. The cat was mine.
His name was Zorro. Amiga is fine.

Signed-off-by: Jim Rotmalm <jim.rotmalm@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2011-10-24 21:00:34 +02:00
Jean Delvare c5794cfac0 hwmon: (w83627ehf) Better fix for negative temperature values
It is more efficient to left-align 8-bit temperature values, so that
8-bit and 9-bit temperature values can be handled exactly the same way
in the rest of the code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:48 -07:00
Jean Delvare 17296feb3c hwmon: (w83627ehf) Uninline is_word_sized
Helper function is_word_sized has grown too much to be kept inline. It
was OK when there were only 6 word-sized registers but support for new
devices have made the list much longer. The function is also called
from more places than before.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:47 -07:00
Jean Delvare 426343ef34 hwmon: (lm75) Document why clones are not detected
Explain why clones of the LM75 are generally not detected by the
driver, and why this isn't going to change. Also update the
documentation to reflect the list of chip names currently supported by
the driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:47 -07:00
Jean Delvare 03f5de2bb7 hwmon: (w83627ehf) Move fan pins check to a separate function
Move the check of fan pin usage to a separate function. This improves
readability, and will make it easier to integrate chip-specific
conditions.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:46 -07:00
Jean Delvare 389ef65d2e hwmon: (w83627ehf) Skip reading unused voltage registers
When in6 is missing, don't read the corresponding registers, it's a
waste of time. The logic is similar to what we do for fans and
temperatures.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:45 -07:00
Michael Hennerich e96f9d89e6 hwmon: (lm75) Add support for Analog Devices ADT75
Add datasheet reference and device ID for ADT75.

The ADT75, like some other LM75 derivatives, needs to be instantiated
using methods 1, 2, or 4.
For more information see Documentation/i2c/instantiating-devices.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:45 -07:00
Guenter Roeck 1af1f5313c hwmon: (pmbus_core) Simplify sign extensions
Shift operations can be used for sign extensions. Use it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:44 -07:00
Guenter Roeck bc365a7f3c hwmon: (pmbus) Add support for Lineage Power DC-DC converters
Add device IDs and reference to datasheets for Lineage Power DC-DC converters.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:44 -07:00
Guenter Roeck ddfb41ca2a hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driver
The LTC3880 PMBus command set is comparable to LTC2978. Add support for it
to the LTC2978 driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:43 -07:00
Guenter Roeck c3ff9a674c hwmon: (pmbus/ltc2978) Explicit driver for LTC2978
Provide explicit driver for LTC2978 to enable support for minimum and peak
attributes. Remove ltc2978 chip id from generic pmbus driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:42 -07:00
Guenter Roeck 3d790287c4 hwmon: (pmbus) Add support for TEMP2 peak attributes
At least one PMBus chip supports peak attributes for READ_TEMPERATURE2.
Add virtual registers to be able to report it to the user.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:42 -07:00
Jonathan Cameron 4f3a659581 hwmon: AD7314 driver (ported from IIO)
Driver for AD7314, ADT7301, and ADT7302, ported from IIO.

Currently dropped power down mode support.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
[guenter.roeck@ericsson.com: Added MODULE_DEVICE_TABLE]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:41 -07:00
Guenter Roeck 200855e52d hwmon: (pmbus) Add support for Intersil power management chips
Add support for Intersil / Zilker Labs ZL2004, ZL2006, ZL2008, ZL2105, ZL2106,
ZL6100, and ZL6105.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:40 -07:00
Guenter Roeck da8e48ab48 hwmon: (pmbus) Always call _pmbus_read_byte in core driver
Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core
driver. With this change, device specific read functions can be implemented for
all registers.

Since the device specific read_byte function is now always called, we need to be
more careful with page validations. Only fail if the passed page number is larger
than 0, since -1 means "current page".

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:40 -07:00
Guenter Roeck 179144a0d4 hwmon: (pmbus) Replace EINVAL return codes with more appropriate errors
EINVAL was over-used in the code. Replace it with more appropriate errors.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-10-24 11:09:39 -07:00
Hans de Goede 6543439f19 hwmon/f71882fg: Make the decision wether to register fan attr. per fan
Before this patch the f71882fg driver completely fails to initialize
on systems which have reserved settings in the pwm enable register, and
it disables all auto pwm sysfs attributes if any fan is controlled by
a digital sensor reading.

This patch changes the fail to initialize into don't register any attributes
for the fan for which there are reserved settings in the pwm enable register
and also makes the not registering of auto pwm sysfs attributes a per fan
thing.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:38 -07:00
Hans de Goede 9af0794c63 hwmon/f71882fg: Add a f71882fg_create_fan_sysfs_files helper function
This is a preparation patch for not registering fan/pwm attributes for
some fans (rather then register them for all or for none).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:37 -07:00
Hans de Goede 5584014256 hwmon/f71882fg: Make all fan/pwm attr tables 2 dimensional
This is a preparation patch for not registering fan/pwm attributes for
some fans (rather then register them for all or for none).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:37 -07:00
Yong Zhang 3f67f83525 hwmon: (exynos4_tmu) Remove IRQF_DISABLED
Since commit [c58543c8: genirq: Run irq handlers with interrupts disabled],
we run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:36 -07:00
Donggeun Kim 9d97e5c81e hwmon: Add driver for EXYNOS4 TMU
This patch allows to read temperature
from TMU(Thermal Management Unit) of SAMSUNG EXYNOS4 series of SoC.

Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:35 -07:00
Guenter Roeck 5cf231a346 hwmon: (pmbus/adm1275) Add support for ADM1276
ADM1276 is mostly compatible to ADM1275, with added support for input power
measurement. Add support for it to the ADM1275 driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:35 -07:00
Guenter Roeck c5e6763667 hwmon: (pmbus/adm1275) Add support for second current limit
ADM1275 supports a second current limit, which can be configured as either lower
or upper limit. Add support for it and report it as either lower or upper
critical current limit.

Also replace error return code EINVAL for unsupported pages with ENXIO as this
is more appropriate for the observed condition.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:34 -07:00
Guenter Roeck 866cf12a0e hwmon: (pmbus) Don't return errors from driver remove functions
Driver remove functions have an error return value, but rarely return an error
in practice. If a driver does return an error from its remove function, the
driver won't be unloaded and is expected to stay alive.

pmbus_do_remove() is defined as returning an int, but always returns 0 (no
error). Calling code passes that return value on to high level driver
remove functions, but does not evaluate it and removes driver data even if
pmbus_do_remove() returned an error (which it in practice never does). Even if
this code could never cause a real problem, it is nevertheless conceptually
wrong.

To reduce confusion and simplify the code, change pmbus_do_remove() to be a void
function, and have PMBus client drivers always return zero in their driver
remove functions.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:33 -07:00
Guenter Roeck 20fcfe1721 hwmon: (pmbus) Add comments explaining internal driver API return values
Return values for functions reading/writing manufacturer specific registers are
poorly explained. Add comments to improve documentation.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
2011-10-24 11:09:33 -07:00
Dmitry Artamonow 363a12a499 hwmon: (w83627ehf) add caseopen detection
Export caseopen alarm status into userspace for Winbond W83627*
and Nuvoton NCT677[56] chips and implement alarm clear attribute.
Second caseopen alarm on NCT6776 is also supported.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-10-24 11:09:32 -07:00
Grant Likely 2bf6f675fa Merge commit 'v3.1' into devicetree/next 2011-10-24 17:03:35 +02:00
Lee, Chun-Yi 1d1fc8a75f acer-wmi: replaced the hard coded bitmap by the communication devices bitmap from SMBIOS
Before set communication devices state, we need query out all devices state to set
the states bitmap. That will be better use the devices bitmap in SMBIOS type Aah
instead of hardcode in driver.

Tested on Acer Travelmate 8572.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:42 +02:00
Lee, Chun-Yi 1fbc01a7b0 acer-wmi: check the existence of internal wireless device when set capability
That will be better to check the existence of internal wireless device
when we set wireless capability and generate killswitch for it. It can
avoid userland access wireless rfkill but the machine doesn't have internal
wireless device.

Tested on Acer Travelmate 8572

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:42 +02:00
Lee, Chun-Yi 72e71de15f acer-wmi: add ACER_WMID_v2 interface flag to represent new notebooks
There have new acer notebooks' BIOS provide new WMID_GUID3 and
ACERWMID_EVENT_GUID methods.

Some of machines still keep the old WMID_GUID1 method but more and
more machines were already removed old wmi methods from DSDT.

So, this patch add a new ACER_WMID_v2 interface flag to represent
new acer notebooks, the following is definition:

 + ACER_WMID:
        It means this machine only provides WMID_GUID1/2 methods.

 + ACER_WMID_v2:
        It means this machine provide new WMID_GUID3 and WMID_EVENT_GUID
        methods.
        Some ACER_WMID_v2 machines also provide old WMID_GUID1/2 methods,
        but we still query/set communication device's state by new
        WMID_GUID3 method.

Tested on Acer Travelmate 8572
Tested on Acer Aspire 4739Z

Tested-by: AceLan Kao <acelan.kao@canonical.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:42 +02:00
Yong Zhang 6a0d89c264 sony-laptop:irq: Remove IRQF_DISABLED
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:42 +02:00
Anisse Astier 149083996e asus-laptop: Add rfkill support for Pegatron Lucid tablet
Add three new rfkill switches in this driver that are specific to
Pegatron Lucid tablet.
Please note that you might not need all three switches. For example if
you don't have a 3G module inside your tablet.

Also, on my device, the gpio for the wifi/bt module is connected to the
bluetooth line. Therefore to activate your wireless lan interface, you
need to use the "pega-bt" rfkill switch.

Finally, the rfkill switch only works before the wireless module is
loaded the first time. Unloading ath9k doesn't help, a reboot is
necessary.

Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:41 +02:00
Anisse Astier b93f82816c asus-laptop: pega_accel - Report accelerometer orientation change through udev
Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:41 +02:00
Corentin Chary 16cbf93369 asus-laptop: fix module description
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:41 +02:00
Corentin Chary 8d38e42c61 asus-laptop: hide leds on Pegatron Lucid
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:41 +02:00
Andy Ross b23910c219 asus-laptop: Pegatron Lucid accelerometer
Support the built-in accelerometer on the Lucid tablets as a standard
3-axis input device.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:41 +02:00
Andy Ross abec04dbc3 asus-laptop: allow boot time control of Pegatron ALS sensor
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:40 +02:00
Tommaso Massimi 7500eeb08a Platform: samsung_laptop: add support for X520 machines.
my samsung laptop would be very happy if you add
these lines to the file drivers/platform/x86/samsung-laptop.c

Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:40 +02:00
Stefan Beller f87d02996f platform: samsung_laptop: add dmi information for Samsung R700 laptops
My DMI model is this:
>dmesg |grep DMI
[    0.000000] DMI present.
[    0.000000] DMI: SAMSUNG ELECTRONICS CO., LTD. SR700/SR700, BIOS
04SR 02/20/2008

adding dmi information of Samsung R700 laptops
This adds the dmi information of Samsungs R700 laptops.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:40 +02:00
Takashi Iwai 85003c3850 hp_accel: Add axis-mapping for HP ProBook / EliteBook
Add the corrected axis-mapping for some HP laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:40 +02:00
Takashi Iwai 24570d2293 hp_accel: Add a new PNP id
New HP laptops assign a new PNP id "HPQ6000" for DriveGuard.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:40 +02:00
Dmitry Torokhov 023b956597 WMI: properly cleanup devices to avoid crashes
We need to remove devices that we destroy from the list, otherwise
we'll crash if there are more than one "_WDG" methods in DSDT.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=32052

Tested-by: Ilya Tumaykin <librarian_rus@yahoo.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:40 +02:00
Ike Panhc 349d594be4 ideapad: remove sysfs node for cfg
Replaced by the one in debugfs.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:39 +02:00
Ike Panhc 773e3206e6 ideapad: add debugfs support
Add two nodes in debugfs which shows cfg value and its meaning,
and status info read from VPC2004.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:39 +02:00
Ike Panhc f43d9ec060 ideapad: add event for Novo key
Novo key is the Lenovo define key on every ideapads, which has two
definition. Long press and short click. Driver will report
KEY_PROG1 on short click and KEY_PROG2 when long press.

On pre-install OS for ideapads there are application waiting for
the event and there is no such application for Linux yet, so I
think to report KEY_PROG is fine in anyway.

Also change the scancode from hex to decimal because they are
related to vpc bit in notify function which is in decimal.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:39 +02:00
Ike Panhc 923de84ab0 ideapad: change parameter of ideapad_sync_rfk_state
This could save us a local variable.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:39 +02:00
Ike Panhc 2be1dc215b ideapad: define vpc commands
Better then write hex number everywhere.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:39 +02:00
Kirill A. Shutemov 21893ab24c intel_scu_ipcutil: fix major device number handling
We need to save major device number to be able to use it for
unregister_chrdev() in ipc_module_exit().

ipc_module_init() must return 0 on success, not major device number.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:39 +02:00
Rene Bollford d4afc7754a [PATCH] ideapad: Check if acpi already handle backlight power to avoid a page fault
This patch avoid a page fault in the ideapad-laptop extras when
turning the backlight power on or off.

Signed-off-by: Rene Bolldorf <xsecute@googlemail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:38 +02:00
Lee, Chun-Yi 1709adab07 acer-wmi: check wireless capability flag before register rfkill
There will be better to check the wireless capability flag
(ACER_CAP_WIRELESS) before register wireless rfkill because maybe
the machine doesn't have wifi module or the module removed by user.

Tested on Acer Travelmate 8572
Tested on Acer Aspire 4739Z

Tested-by: AceLan Kao <acelan.kao@canonical.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:38 +02:00
Axel Lin 8fcf71aa00 platform-drivers-x86: asus-laptop: fix wrong test for successful registered led_classdev
device_create returns &struct device pointer on success, or ERR_PTR() on error.
Thus if led_classdev_register fails, led_cdev->dev is always not NULL.

Thus to unregister a successful registered led_classdev, we should check
IS_ERR_OR_NULL macro for led_cdev->dev instead of checking if led_cdev->dev
is NULL or not.

we use IS_ERR_OR_NULL instead of IS_ERR because if we havn't call
led_classdev_register, the led_cdev->dev is NULL.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:38 +02:00
Axel Lin e9298028ee platform-drivers-x86: asus-wmi: fix resource leak in asus_wmi_led_exit
This patch fixes wrong test for successful registered led_classdev,
and also fixes a leak due to missing led_classdev_unregister call
for asus->kbd_led in asus_wmi_led_exit.

device_create returns &struct device pointer on success, or ERR_PTR() on error.
Thus if led_classdev_register fails, led_cdev->dev is always not NULL.

Thus to unregister a successful registered led_classdev, we should check
(!IS_ERR_OR_NULL(asus->tpd_led.dev)) instead of (asus->tpd_led.dev).

we use IS_ERR_OR_NULL instead of IS_ERR because if we havn't call
led_classdev_register, the led_cdev->dev is NULL.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:38 +02:00
Axel Lin 5d6afd1503 platform-drivers-x86: eeepc-laptop: fix wrong test for successful registered led_classdev
device_create returns &struct device pointer on success, or ERR_PTR() on error.
Thus if led_classdev_register fails, led_cdev->dev is always not NULL.

If IS_ERR(eeepc->tpd_led.dev) is ture, it means led_classdev_register fails.
If (asus->tpd_led.dev) is NULL, it means we call eeepc_led_exit before
calling led_classdev_register for &eeepc->tpd_led.

We only want to call led_classdev_unregister for sucessfully registered
led_classdev, then we should check (!IS_ERR_OR_NULL(eeepc->tpd_led.dev)).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:38 +02:00
Andy Ross 33989ba6f7 asus-laptop: Pegatron Lucid ALS sensor
Ambient light sensor for Pegatron Lucid.  Supports pre-existing
ls_switch sysfs interface to en/disable automatic control, and exports
the brightness from the device as "ls_value".

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
Andy Ross 8819de7f98 asus-laptop: Platform detection for Pegatron Lucid
Recognize the Pegatron Lucid tablets by their method signatures.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
John Serock ba05b23737 Platform: Detect samsung laptop quirk when initial level is zero
This patch depends on the "Platform: Brightness quirk for samsung
laptop driver" patch from Jason Stubbs. This patch adds a check for an
initial brightness level of 0; if the level is 0, this patch changes
the brightness level to 1 before the driver attempts to detect the
brightness quirk.

The Samsung N150 netbook experiences the brightness quirk. Without
Jason's patch, the only brightness levels available on the N150 are 0,
1, and 8. This patch ensures that, when the initial brightness level
is 0, the samsang-laptop driver detects the brightness quirk on the
N150, thereby making brightness levels 0 through 8 available.

Signed-off-by: John Serock <john.serock@gmail.com>
Acked-by: Jason Stubbs <jasonbstubbs@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
Seth Forshee be3128b107 acer-wmi: Add wireless quirk for Lenovo 3000 N200
This quirk fixes the wlan rfkill status on this machine. Without
it, wlan is permanently soft blocked whenever acer-wmi is loaded.

BugLink: https://bugs.launchpad.net/bugs/857297
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
AceLan Kao 2d8b90be4f dell-laptop: support Synaptics/Alps touchpad led
This patch supports Dell laptop with Synaptics and Alps touchpad chip
that with LED to indicate the functionality of touchpad is disabled or
enabled.

The command for touchpad LED is 0x97, and the data 1 means turn on the
touchpad LED, 2 means turn it off.

BTW, I add dell_quirks to white list those machines that supports this
behavior, so that the code won't affect those who don't have a touchpad LED
machine.

We can easily to turn it on/off by
   echo 1 > /sys/class/leds/dell-laptop::touchpad/brightness
   echo 0 > /sys/class/leds/dell-laptop::touchpad/brightness

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
Manuel Lauss bd038080c7 topstar-latop: ignore 0x82 event
Event 0x82 is emitted whenever a backlight event happens (brightness
change, backlight on/off).  For instance, when display is switched
off after a timeout, event 0x82 is emitted, and along with it a keypress
which switches the display back on again.

This patch adds 0x82 to the event ignore list so that the display stays
off when it is automatically switched off.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
Seth Forshee ac2dad886d toshiba_acpi: Initialize brightness in backlight device
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:37 +02:00
Seth Forshee 36d03f9355 toshiba_acpi: Don't add devices for unsupported features
Test for features up-front to determine whether or not they are
supported, and avoid creating devices and proc files for
unsupported features.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:36 +02:00
Seth Forshee a540d6b5b5 toshiba_acpi: Support SPFC as an HCI method
Some Toshiba models, notably those with the TOS1900 device, use
the SPFC method for HCI calls instead of GHCI. Test for this method
if GHCI isn't found, and if it exists use it for all HCI calls.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:36 +02:00
Seth Forshee 6e02cc7eb6 toshiba_acpi: Use handle for HCI calls
Now that we're using an acpi driver we already have a handle to
the namespace of the HCI call, so there's no need to test various
paths to the HCI call or even be aware of the path at all.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:36 +02:00
Seth Forshee 32bcd5cba0 toshiba_acpi: Fix up return codes
Many routines are returning success on failure, and those that are
indicating failure frequently return incorrect error codes. Fix
these up throughout the driver.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:36 +02:00
Seth Forshee 135740de77 toshiba_acpi: Convert to use acpi_driver
Changes toshiba_acpi to register an acpi driver and eliminates the
platform device it was using. Also eliminates most global
variables, moving them into toshiba_acpi_dev, along with some
other miscellaneous fixes and cleanup.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:36 +02:00
Raul Gutierrez Segales f689c875c1 Platform: fix samsung-laptop DMI identification for N220 model
This is a follow-up for commit 78a7539b, which didn't cover the
Samsung N220 laptop. With this backlight brightness works nicely
on the N220 netbook.

Signed-off-by: Raul Gutierrez Segales <rgs@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:36 +02:00
Jason Stubbs 7b3c257ce4 Platform: Samsung laptop DMI info for NC210/NC110
This patch just adds the DMI info for the samsung laptop driver to work with
the NC210/NC110. It needs the brightness quirk patch for proper support.

Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:35 +02:00
Jason Stubbs ac08052314 Platform: Brightness quirk for samsung laptop driver
On some Samsung laptops the brightness regulation works slightly different.
All SABI commands except for set_brightness work as expected. The behaviour
of set_brightness is as follows:

- Setting a new brightness will only step one level toward the new brightness
  level. For example, setting a level of 5 when the current level is 2 will
  result in a brightness level of 3.
- A spurious KEY_BRIGHTNESS_UP or KEY_BRIGHTNESS_DOWN event is also generated
  along with the change in brightness.
- Neither of the above two issues occur when changing from/to brightness
  level 0.

This patch adds detection and a non-intrusive workaround for the above issues.

Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com>
Tested-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:35 +02:00
David Herrmann a7ea19926f Platform: Fix error path in samsung-laptop init
samsung_init() should not return success if not all devices are initialized.
Otherwise, samsung_exit() will dereference sdev NULL pointers and others.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:35 +02:00
Jason Stubbs bee460be8c platform: samsung_laptop: fix samsung brightness min/max calculations
The min_brightness value of the sabi_config is incorrectly used in brightness
calculations. For the config where min_brightness = 1 and max_brightness = 8,
the user visible range should be 0 to 7 with hardware being set in the range
of 1 to 8. What is actually happening is that the user visible range is 0 to
8 with hardware being set in the range of -1 to 7.

This patch fixes the above issue as well as a miscalculation that would occur
in the case of min_brightness > 1.

Signed-off-by: Jason Stubbs <jasonbstubbs@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:35 +02:00
Smelov Andrey 093ed56164 Platform: samsung_laptop: samsung backlight for R528/R728
patch works for me, but I need to add "acpi_backlight=vendor" to kernel
params

Signed-off-by: Smelov Andrey <xor29a@bk.ru>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-10-24 16:52:35 +02:00
Yong Zhang 38ada214fa spi: irq: Remove IRQF_DISABLED
Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
We run all interrupt handlers with interrupts disabled
and we even check and yell when an interrupt handler
returns with interrupts enabled (see commit [b738a50a:
genirq: Warn when handler enables interrupts]).

So now this flag is a NOOP and can be removed.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-24 14:14:40 +02:00
Shubhrajyoti D 1458d160de OMAP: SPI: Fix the trying to free nonexistent resource error
Currently there is a request_mem_region(r->start, ..
followed by r->start += pdata->regs_offset;

And then in remove

   r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   release_mem_region(r->start, resource_size(r));

Here the offset addition is not taken care. Fix the code for the
same.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-24 13:44:30 +02:00
Grant Likely a853ba8d6d Merge commit 'v3.1' into spi/next 2011-10-24 13:42:08 +02:00
David S. Miller 8b1857357a Merge git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next 2011-10-24 03:12:49 -04:00
Clemens Buchacher a7d5b76d9a jme: fix irq storm after suspend/resume
If the device is down during suspend/resume, interrupts are enabled
without a registered interrupt handler, causing a storm of
unhandled interrupts until the IRQ is disabled because "nobody
cared".

Instead, check that the device is up before touching it in the
suspend/resume code.

Fixes https://bugzilla.kernel.org/show_bug.cgi?id=39112

Helped-by: Adrian Chadd <adrian@freebsd.org>
Helped-by: Mohammed Shafi <shafi.wireless@gmail.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 02:58:09 -04:00
Rick Jones 8f9f4668b3 Add ethtool -g support to virtio_net
Add support for reporting ring sizes via ethtool -g to the virtio_net
driver.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-24 02:07:21 -04:00
Linus Torvalds 6a0596583f Merge git://git.infradead.org/iommu-2.6
* git://git.infradead.org/iommu-2.6:
  intel-iommu: fix superpage support in pfn_to_dma_pte()
  intel-iommu: set iommu_superpage on VM domains to lowest common denominator
  intel-iommu: fix return value of iommu_unmap() API
  MAINTAINERS: Update VT-d entry for drivers/pci -> drivers/iommu move
  intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.
  intel-iommu: Workaround IOTLB hang on Ironlake GPU
  intel-iommu: Fix AB-BA lockdep report
2011-10-24 07:08:24 +02:00
Linus Torvalds 15cc910112 Merge branch 'for-linus' of http://people.redhat.com/agk/git/linux-dm
* 'for-linus' of http://people.redhat.com/agk/git/linux-dm:
  dm kcopyd: fix job_pool leak
2011-10-24 07:05:38 +02:00
Dave Airlie 9b553f7286 Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into drm-core-next
* 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux: (72 commits)
  drm/i915/dp: Fix eDP on PCH DP on CPT/PPT
  drm/i915/dp: Introduce is_cpu_edp()
  drm/i915: use correct SPD type value
  drm/i915: fix ILK+ infoframe support
  drm/i915: add DP test request handling
  drm/i915: read full receiver capability field during DP hot plug
  drm/i915/dp: Remove eDP special cases from bandwidth checks
  drm/i915/dp: Fix the math in intel_dp_link_required
  drm/i915/panel: Always record the backlight level again (but cleverly)
  i915: Move i915_read/write out of line
  drm/i915: remove transcoder PLL mashing from mode_set per specs
  drm/i915: if transcoder disable fails, say which
  drm/i915: set watermarks for third pipe on IVB
  drm/i915: export a CPT mode set verification function
  drm/i915: fix transcoder PLL select masking
  drm/i915: fix IVB cursor support
  drm/i915: fix debug output for 3 pipe configs
  drm/i915: add PLL sharing support to handle 3 pipes
  drm/i915: fix PCH PLL assertion check for 3 pipes
  drm/i915: use transcoder select bits on VGA and HDMI on CPT
  ...
2011-10-24 05:48:39 +01:00
Nicholas Bellinger 2e982ab92d target: Remove legacy se_task->task_timer and associated logic
This patch removes the legacy usage of se_task->task_timer and associated
infrastructure that originally was used as a way to help manage buggy backend
SCSI LLDs that in certain cases would never return back an outstanding task.

This includes the removal of target_complete_timeout_work(), timeout logic
from transport_complete_task(), transport_task_timeout_handler(),
transport_start_task_timer(), the per device task_timeout configfs attribute,
and all task_timeout associated structure members and defines in
target_core_base.h

This is being removed in preparation to make transport_complete_task() run
in lock-less mode.

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:22:08 +00:00
Nicholas Bellinger 415a090ade target: Fix incorrect transport_sent usage
This patch converts target-core to use se_cmd->t_transport_sent instead of
a duplicated se_cmd->transport_sent member in a handful of locations.
It also updates iscsi_target to properly use ->t_transport_sent instead of
it's own iscsi_cmd_t->transport_sent value that was not being assigned.

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:22:06 +00:00
Christoph Hellwig af3f00c759 target: re-use the command S/G list for single-task commands
If we only have a single task per command (which at least in my testing
is the by far most common case) we do not have to allocate a new per-task
S/G list but can reuse the one from the command.

(nab: Fix BIDI handling in transport_free_dev_tasks)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:22:04 +00:00
Nicholas Bellinger 9ac549873d target: Fix BIDI t_task_cdb handling in transport_generic_new_cmd
This patch fixes a bug for BIDI handling in transport_generic_new_cmd() where
cmd->t_task_cdbs_left and Co. where not taking into account the extra
task count generated during the first call to transport_allocate_data_tasks().

Cc: Christoph Hellwig <hch@lst.de>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:22:02 +00:00
Christoph Hellwig 38b400676b target: remove transport_allocate_tasks
There were only two callers, and one of them always wants the call
to transport_allocate_data_tasks anyway.  Also drop the constant
lba argument to transport_allocate_data_tasks and move the variables
inside it into the minimum required scope.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:59 +00:00
Christoph Hellwig da0f761991 target: merge transport_new_cmd_obj into transport_generic_new_cmd
These are two fairly small functions, and merging them gives a much
more readable control flow, and opportunities for more useful comments.

It also moves all code related to resources allocation closer together
and allows to remove a forward declaration for transport_allocate_tasks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:57 +00:00
Christoph Hellwig 7c1c6af37a target: remove the task_sg_bidi field se_task and pSCSI BIDI support
This field is never used given that BIDI handling happens at the
command and not the task level.  Remove it and the dead code in
pscsi that tries to work on it.

It also prevents pSCSI passthrough for the two currently enabled BIDI
commands now that task->task_sg_bidi support has been removed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:56 +00:00
Nicholas Bellinger dbc5623eb2 target: transport_subsystem_check_init cleanups
Remove the now unnecessary extra call to transport_subsystem_check_init() in
target_core_register_fabric(), and also merge transport_subsystem_reqmods()
directly into transport_subsystem_check_init().

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:54 +00:00
Christoph Hellwig 35e0e75753 target: use a workqueue for I/O completions
Instead of abusing the target processing thread for offloading I/O
completion in the backends to user context add a new workqueue.  This means
completions can be processed as fast as available CPU time allows it,
including in parallel with other completions and more importantly I/O
submission or QUEUE FULL retries.  This should give much better performance
especially on loaded systems.

As a fallout we can merge all the completed states into a single
one.

On the downside this change complicates lun reset handling a bit by
requiring us to cancel a work item only for those states that have it
initialized.  The alternative would be to either always initialize the work
item to a dummy handler, or always use the same handler and do a switch on
the state. The long term solution will be a flag that says that the command
has an initialized work item, but that's only going to be useful once we
have more users.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:52 +00:00
Christoph Hellwig f2da9dbdb5 target: remove TRANSPORT_DEFERRED_CMD state
We never check for this state, and it makes testing for a completed
state much harder given that it overrides the existing state.

Also remove the unused deferred_t_state which is related to it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:49 +00:00
Christoph Hellwig bfaf40ada2 target: remove the TRANSPORT_REMOVE state
We never queue an command with this state, and only set it in a completely
bogus place in tcm_fc.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:47 +00:00
Christoph Hellwig 4499dda858 target: move depth_left manipulation out of transport_generic_request_failure
We only need to decrement dev->depth_left if failing a command from
__transport_execute_tasks.  Instead of doing it first thing in
transport_generic_request_failure and requiring a pseudo-flag argument
for it just opencode the decrement in the two callers (which should
be factored into a single one anyway)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:46 +00:00
Christoph Hellwig cc5d0f0f61 target: stop task timers earlier
Currently we stop the timers for all tasks in a command fairly late during
I/O completion, which is fairly pointless and requires all kinds of safety
checks.

Instead delete pending timers early on in transport_complete_task, thus
ensuring no new timers firest after that.  We take t_state_lock a bit later
in that function thus making sure currenly running timers are out of the
criticial section.  To be completely sure the timer has finished we also
add another del_timer_sync call when freeing the task.

This also allows removing TF_TIMER_RUNNING as it would be equivalent
to TF_ACTIVE now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:44 +00:00
Christoph Hellwig e99d48a62b target: remove TF_TIMER_STOP
TF_TIMER_STOP is useless as it only helps to mitigate a tiny race during
deleting the timer.  But given that we have cleared TF_ACTIVE at this point
we already have another mitigation a few lines down the function.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:42 +00:00
Christoph Hellwig cdbb70bb4c target: factor some duplicate code for stopping a task
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:41 +00:00
Christoph Hellwig 0c2cfe5fe7 target: fix list walking in transport_free_dev_tasks
list_for_each_entry_safe only protects against deletions from the list,
but not against any concurrent modifications.  Given that we drop
t_state_lock inside the loop it is not safe in transport_free_dev_tasks.

Instead of use a local dispose_list that we move all tasks that are
to be deleted to.  This is safe because we never do list_emptry checks
on t_list to check if a command is on the list anywhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:39 +00:00
Christoph Hellwig b7b8bef7f8 target: use transport_cmd_check_stop_to_fabric consistently
Change one remaining user of transport_cmd_check_stop(cmd, 2, 0) to the
transport_cmd_check_stop_to_fabric wrapper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:37 +00:00
Christoph Hellwig 3df8d40ba3 target: do not pass the queue object to transport_remove_cmd_from_queue
We always operated on the same queue, so move finding it into the function,
just like we do for all other helpers operating on it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:36 +00:00
Christoph Hellwig f7a5cc0b31 target: remove SCF_EMULATE_QUEUE_FULL
Add a new boolean at_head parameter to transport_add_cmd_to_queue and thus
obsolete the SCF_EMULATE_QUEUE_FULL flag.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:34 +00:00
Christoph Hellwig e057f53308 target: remove the transport_qf_callback se_cmd callback
Remove the need for the transport_qf_callback callback by making
sure we have specific states with specific handlers for the two
queue full cases.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:32 +00:00
Christoph Hellwig f55918fa32 target: clean up the backend interface to caching parameters
Remove the dpo_emulated, fua_write_emulated, fua_read_emulated and
write_cache_emulated methods, and replace them with a simple bitfields in
se_subsystem_api in those cases where they ever returned one.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:31 +00:00
Christoph Hellwig df5fa691ce target: make iblock_emulate_sync_cache asynchronous
Do not block the submitting thread when handling a SYNCHRONIZE CACHE command,
but implement it asynchronously by sending the FLUSH command ourself and
calling transport_complete_sync_cache from the completion handler.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:29 +00:00
Nicholas Bellinger 6b20fa9aaf target: Fix REPORT TARGET PORT GROUPS handling with small allocation length
This patch fixes a bug with the handling of REPORT TARGET PORT GROUPS
containing a smaller allocation length than the payload requires causing
memory writes beyond the end of the buffer.  This patch checks for the
minimum 4 byte length for the response payload length, and also checks
upon each loop of T10_ALUA(su_dev)->tg_pt_gps_list to ensure the Target
port group and Target port descriptor list is able to fit into the
remaining allocation length.

If the response payload exceeds the allocation length length, then rd_len
is still increments to indicate to the initiator that the payload has
been truncated.

Reported-by: Roland Dreier <roland@purestorage.com>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
2011-10-24 03:21:19 +00:00
Christoph Hellwig b937d27052 target: remove the ->transport_split_cdb callback in se_cmd
Add a switch statement implementing the CDB LBA/len update directly
in target_get_task_cdb and remove the old ->transport_split_cdb
callback and all its implementations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:15 +00:00
Christoph Hellwig 485fd0d1e3 target: replace ->get_cdb with a target_get_task_cdb helper
Instead of calling out to the backends from the core to get a per-task
CDB and then modify it for the LBA/len pair used for this CDB provide
a helper that writes the adjusted CDB into a provided buffer and call
this method from ->do_task in pscsi.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:13 +00:00
Christoph Hellwig 6193f06e6f target: make the ->get_cdb method optional
The most commonly used file, iblock and rd backends have no use for
a per-task CDB and thus don't need a method to copy it into their
otherwise unused CDB fields.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:11 +00:00
Christoph Hellwig 04629b7bde target: Remove unnecessary se_task members
This is a squashed version of the following unnecessary se_task structure
member removal patches:

target: remove the task_execute_queue field in se_task

    Instead of using a separate flag we can simply do list_emptry checks
    on t_execute_list if we make sure to always use list_del_init to remove
    a task from the list.  Also factor some duplicate code into a new
    __transport_remove_task_from_execute_queue helper.

target: remove the read-only task_no field in se_task

    The task_no field never was initialized and only used in debug printks,
    so kill it.

target: remove the task_padded_sg field in se_task

    This field is only check in one place and not actually needed there.

    Rationale:
    - transport_do_task_sg_chain asserts that we have task_sg_chaining
      set early on
    - we only make use of the sg_prev_nents field we calculate based on it
      if there is another sg list that gets chained onto this one, which
      never happens for the last (or only) task.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:08 +00:00
Christoph Hellwig 6c76bf951c target: make more use of the task_flags field in se_task
Replace various atomic_t variables that were mostly under t_state_lock
with new flags in task_flags.  Note that the execution error path
didn't take t_state_lock before, so add it there.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:06 +00:00
Christoph Hellwig 42bf829eee target: Cleanup unused se_task bits
This is a squashed version of the following se_task cleanup patches:

    target: remove the unused task_state_flags field in se_task
    target: remove the unused se_obj_ptr field in se_task
    target: remove the se_dev field in se_task

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:05 +00:00
Christoph Hellwig c0427f1556 target: Cleanup unused target_core_base.h bits
This is a squashed version of the following target_core_base.h
cleanup patches:

    target: remove the unused SHUTDOWN_SIGS defintion
    target: remove unused se_mem leftovers
    target: remove the unused map_func_t typedef
    target: move TRANSPORT_IOV_DATA_BUFFER to the iscsi-specific code

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:03 +00:00
Nicholas Bellinger 0a020436d8 loopback: Prevent uninitialized use of tl_tpg in tcm_loop_queuecommand
This patch fixes a bug with tcm_loop where performing a scsi_host rescan was
causing an oops due to a received scsi_cmnd->device->id value not matching a
previously configured tcm_loop_tpg entry in tcm_loop_hba->tl_hba_tpgs[]
obtained from within tcm_loop_queuecommand() code.

This fix adds an explict check for tcm_loop_tpg->tl_hba in order to ensure
tcm_loop_make_naa_tpg() has already been invoked to initialize a given
tcm_loop_tpg entry, and also adds an explict clear of tcm_loop_tpg->tl_hba
from within the tcm_loop_drop_naa_tpg() release path.

This bug was manifesting itself with the following OOPs:

[176289.430909] BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
[176289.431337] IP: [<ffffffffa0395617>] transport_processing_thread+0x1e3/0x794 [target_core_mod]
[176289.431399] PGD 22e9b067 PUD 23375067 PMD 0
[176289.431399] Oops: 0000 [#1] SMP
[176289.431815] CPU 1
[176289.431815] Modules linked in: tcm_loop target_core_stgt target_core_pscsi target_core_file target_core_iblock target_core_mod crc32c ib_cm ib_sa ib_mad ib_core qla2xxx scsi_tgt configfs fcoe libfcoe libfc scsi_transport_fc ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi sr_mod cdrom sd_mod ata_piix libata e1000 mptspi mptscsih mptbase [last unloaded: target_core_mod]
[176289.431815]
[176289.431815] Pid: 12339, comm: LIO_iblock Tainted: G        W   3.1.0-rc8+
[176289.431815] RIP: 0010:[<ffffffffa0395617>]  [<ffffffffa0395617>] transport_processing_thread+0x1e3/0x794 [target_core_mod]
[176289.431815] RSP: 0018:ffff880023bfbe10  EFLAGS: 00010283
[176289.431815] RAX: 0000000000000000 RBX: ffff88002d600040 RCX: ffff88002d600108
[176289.431815] RDX: ffff88000c9e50bc RSI: 0000000000000246 RDI: 0000000000000246
[176289.431815] RBP: ffff880023bfbee0 R08: ffff88002d600108 R09: 0000000000000000
[176289.431815] R10: ffff88002fc8cc80 R11: ffffffff81671b60 R12: ffff88002d600108
[176289.431815] R13: ffff88000c9e4f38 R14: ffff88000c9e50b8 R15: 0000000000000000
[176289.431815] FS:  0000000000000000(0000) GS:ffff88002fc80000(0000) knlGS:0000000000000000
[176289.431815] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[176289.431815] CR2: 0000000000000090 CR3: 000000002a33f000 CR4: 00000000000006e0
[176289.431815] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[176289.431815] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[176289.431815] Process LIO_iblock (pid: 12339, threadinfo ffff880023bfa000, task ffff88002a2e0000)
[176289.431815] Stack:
[176289.431815]  0000000000011280 0000000000000246 ffff88002a2e0000 ffff880023a58900
[176289.431815]  ffff880023bfbed0 ffff880023bfa000 ffff880023bfa000 ffff88000c9e50d0
[176289.431815]  ffff88000c9e50c0 ffff88000c9e50bc ffff880023bfa000 ffff880023bfbfd8
[176289.431815] Call Trace:
[176289.431815]  [<ffffffff81056657>] ? wake_up_bit+0x25/0x25
[176289.431815]  [<ffffffffa0395434>] ? transport_handle_cdb_direct+0x92/0x92 [target_core_mod]
[176289.431815]  [<ffffffff8105619a>] kthread+0x7d/0x85
[176289.431815]  [<ffffffff813cbcb4>] kernel_thread_helper+0x4/0x10
[176289.431815]  [<ffffffff8105611d>] ? kthread_worker_fn+0x16d/0x16d
[176289.431815]  [<ffffffff813cbcb0>] ? gs_change+0x13/0x13
[176289.431815] Code: 67 05 00 00 41 8b 84 24 4c ff ff ff ff c8 83 f8 11 0f 87 f0 04 00 00 89 c0 ff 24 c5 b0 c6 39 a0 0f 0b eb fe 48 8b 83 d8 00 00 00
[176289.431815] RIP  [<ffffffffa0395617>] transport_processing_thread+0x1e3/0x794 [target_core_mod]
[176289.431815]  RSP <ffff880023bfbe10>
[176289.431815] CR2: 0000000000000090
[176295.041004] ---[ end trace 85dc6865b23b8f3e ]---

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:21:01 +00:00
Nicholas Bellinger ce8762f6cd target: Remove legacy + unused device active I/O shutdown code
This patch removes the legacy device active I/O shutdown code that was
originally called from transport_processing_thread() context during shutdown
including transport_processing_shutdown() and transport_release_all_cmds().

This is due to the fact that in modern configfs control plane code by the
time shutdown of an se_device instance in transport_processing_thread()
is allowed to occur via:

	rmdir /sys/kernel/config/target/core/$HBA/$DEV

all active I/O will already have been ceased while removing active configfs
fabric Port/LUN symlinks.  Eg: the removal of an active se_device is protected
by inter-module VFS references from active Port/LUN symlinks.

Two WARN_ON() checks have been added in their place before exiting
transport_processing_thread() to watch out for any leaked descriptors.

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:59 +00:00
Nicholas Bellinger 8dc52b5420 target: Merge transport_cmd_finish_abort_tmr into transport_cmd_finish_abort
This patch merges transport_cmd_finish_abort_tmr() logic into a single
transport_cmd_finish_abort() function by adding a cmd->se_tmr_req check
around transport_lun_remove_cmd(), and updates the single caller within
core_tmr_drain_tmr_list().

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:58 +00:00
Nicholas Bellinger d270190a75 iscsi-target: Remove SCF_SE_LUN_CMD flag abuses
This patch removes a number of SCF_SE_LUN_CMD flag abuses within iscsi-target
code to determine when iscsit_release_cmd() or transport_generic_free_cmd()
should be called while releasing an individual iscsi_cmd descriptor.

In the place of SCF_SE_LUN_CMD checks, this patch converts existing code to
use a new iscsit_free_cmd() that inspects iscsi_cmd->iscsi_opcode types to
determine which of the above functions should be invoked.  It also removes the
now unnecessary special case checking in iscsit_release_commands_from_conn().

(hch: Use iscsit_free_cmd instead of open-coded alternative)

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:56 +00:00
Nicholas Bellinger d14921d6ad target: Convert ->transport_wait_for_tasks usage to transport_generic_free_cmd
This patch converts se_cmd->transport_wait_for_tasks(se_cmd, 1) usage to use
transport_generic_free_cmd() directly in target-core and iscsi-target fabric
usage.  The includes:

*) Removal of the optional transport_generic_free_cmd() call from within
   transport_generic_wait_for_tasks()
*) Usage of existing SCF_SUPPORTED_SAM_OPCODE to determine when
   transport_generic_wait_for_tasks() processing may occur instead of
   checking se_cmd->transport_wait_for_tasks()
*) Move transport_generic_wait_for_tasks() call ahead of core_dec_lacl_count()
   and transport_lun_remove_cmd() in transport_generic_free_cmd() to follow
   existing logic for iscsi-target w/ se_cmd->transport_wait_for_tasks(se_cmd, 1)
*) Removal of se_cmd->transport_wait_for_tasks() function pointer
*) Rename transport_generic_wait_for_tasks() -> transport_wait_for_tasks(), and
   add docbook comment.
*) Add EXPORT_SYMBOL for transport_wait_for_tasks()

For the case in iscsi_target_erl2.c:iscsit_prepare_cmds_for_realligance()
where se_cmd->transport_wait_for_tasks(se_cmd, 0) is called, this patch
adds a direct call to transport_wait_for_tasks().

(hch: Fix transport_generic_free_cmd() usage in iscsit_release_commands_from_conn)
(nab: Add patch: Ensure that TMRs hit wait_for_tasks logic during release)

Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:54 +00:00
Roland Dreier dd503a5fcc target: Have core_tmr_alloc_req() take an explicit GFP_xxx flag
Testing in_interrupt() to know when sleeping is allowed is not really
reliable (since eg it won't be true if the caller is holding a spinlock).
Instead have the caller tell core_tmr_alloc_req() what GFP_xxx to use;
every caller except tcm_qla2xxx can use GFP_KERNEL.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:53 +00:00
Dan Carpenter 942d82646e target: Make pscsi_create_virtdevice use ERR_CAST
This patch changes pscsi_create_virtdevice() to properly return ERR_CAST
instead of a raw pointer upon scsi_host_lookup() failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:51 +00:00
Andy Shevchenko 635a2b3f3e tcm_fc: remove custom hex_to_bin in ft_parse_wwn
This patch converts ft_parse_wwn() to use hex_to_bin() instead of custom
conversion code.

(Andy: Re-add missing strict && isupper(c) check)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:49 +00:00
Andy Shevchenko f2b56afd40 iscsi-target: use native hex2bin for chap_string_to_hex
This patch converts chap_string_to_hex() to use hex2bin() instead of
the internal chap_asciihex_to_binaryhex().

(nab: Fix up minor compile breakage + typo)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:48 +00:00
Christoph Hellwig a3eedc227b target: remove unused se_subsystem_api methods
The cdb_none, map_data_SG and map_control_SG methods have no callers left
and can be removed now.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:46 +00:00
Christoph Hellwig 02b1a74634 target: cleanup pscsi request submission
Move the entirely request allocation, mapping and submission into ->do_task.
This

 a) avoids blocking the I/O submission thread unessecarily, and
 b) simplifies the code greatly

Note that the code seems to have various error handling issues, mostly
related to bidi handling in the current form.  I've added comments about
those but not tried to fix them in this commit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:44 +00:00
Christoph Hellwig dbbf3e94c2 target: cleanup iblock bio submission
Move the entirely bio allocation, mapping and submission into ->do_task.
This

 a) avoids blocking the I/O submission thread unessecarily, and
 b) simplifies the code greatly

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:43 +00:00
Andy Shevchenko b6b4e61ff4 target: simplify target_parse_naa_6h_vendor_specific()
This patch adds a minor simplfication in target_parse_naa_6h_vendor_specific()
to remove direct isxdigit() + ctype.h usage.

(nab: Fix next assignment breakage in for loop)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:41 +00:00
Nicholas Bellinger 39c05f321a target: Remove session_reinstatement parameter from ->transport_wait_for_tasks
This patch removes the unnecessary session_reinstatement parameter from
se_cmd->transport_wait_for_tasks(), logic in transport_generic_wait_for_tasks,
and usage within iscsi-target code.

This also includes the removal of the 'bool' return from transport_put_cmd() +
transport_generic_free_cmd() that is no longer necessary.

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:39 +00:00
Christoph Hellwig 82f1c8a4e7 target: push session reinstatement out of transport_generic_free_cmd
Push session reinstatement out of transport_generic_free_cmd into the only
caller that actually needs it.  Clean up transport_generic_free_cmd a bit,
and remove the useless comment.  I'd love to add a more useful kerneldoc
comment for it, but as this point I'm still a bit confused in where it
stands in the command release stack.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:38 +00:00
Christoph Hellwig e6a2573f1f target: remove transport_generic_remove
All callers that never have the session_reinstatement flag set can trivially
be converted to transport_put_cmd.  Opencode the session reinstatement code
in transport_generic_free_cmd, which was the only caller ever asking for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:36 +00:00
Christoph Hellwig 4911e3ccbe target: simplify transport_put_cmd
Inline two simple functions only used by it, and replace a goto
with a simple if else construct.

Note that the code moved from transport_dec_and_check seems fairly
buggy - the atomic_read check on a variable where we'd do an
atomic_dec_and_test looks racy if we'll ever get someone increment
it without the lock held around them (which it looks like we do),
and not decrementing the second counter if the first one doesn't
hit zero also at least needs an explanation.

(nab: Fix transport_put_cmd breakage)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:34 +00:00
Christoph Hellwig d3df7825ae target: simplify transport_generic_remove
Instead of duplicating the code from transport_release_fe_cmd re-use it by
allowing transport_release_fe_cmd to return wether it actually freed the
command or not.  Also rename transport_release_fe_cmd to transport_put_cmd
and add a kerneldoc comment for it to make the use case more obvious.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:33 +00:00
Christoph Hellwig 2dbc43d256 target: remove transport_free_se_cmd
It is only called by transport_release_cmd, so inline it there.  Also add
a kerneldoc comment for transport_release_cmd while we are at it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:31 +00:00
Christoph Hellwig 31afc39c0c target: don't opencode transport_release_cmd in transport_release_fe_cmd
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:29 +00:00
Christoph Hellwig 680b73c5f2 target: remove transport_generic_handle_cdb
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:28 +00:00
Christoph Hellwig acf3ecc4a1 iscsi-target: always call transport_handle_cdb_direct
iscsit_task_reassign_complete is always called from the TX thread, so
handle the CDB directly instead of offloading it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:26 +00:00
Christoph Hellwig 4ca495e063 tfm_fc: use transport_handle_cdb_direct
ft_send_work is always called from workqueue context, which means we can
handle the CDB directly instead of doing another context switch.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-10-24 03:20:24 +00:00
Nicholas Bellinger c252f00347 target: Prevent transport_send_task_abort when CHECK_CONDITION status
This patch fixes a bug where transport_send_task_abort() could be called
during LUN_RESET to return SAM_STAT_TASK_ABORTED + tfo->queue_status(), when
SCF_SENT_CHECK_CONDITION -> tfo->queue_status() has already been sent from
within another context via transport_send_check_condition_and_sense().

Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
2011-10-24 03:20:12 +00:00
Nicholas Bellinger 77039d1eaf target: Fix transport_cmd_finish_abort queue removal bug
This patch fixes a bug in LUN_RESET operation with transport_cmd_finish_abort()
where transport_remove_cmd_from_queue() was incorrectly being called, causing
descriptors with t_state == TRANSPORT_FREE_CMD_INTR to be incorrectly removed
from qobj->qobj_list during process context release.  This change ensures the
descriptor is only removed via transport_remove_cmd_from_queue() when doing a
direct release via transport_generic_remove().

Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
2011-10-24 03:20:01 +00:00
Nicholas Bellinger b0e062aec5 target: Prevent TRANSPORT_FREE_CMD_INTR processing in core_tmr_drain_cmd_list
This patch contains a bugfix for TMR LUN_RESET related to TRANSPORT_FREE_CMD_INTR
operation, where core_tmr_drain_cmd_list() will now skip processing for this
case to prevent an ABORT_TASK status from being returned for descriptors that
are already queued up to be released by processing thread context.

Cc: Roland Dreier <roland@purestorage.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
2011-10-24 03:19:49 +00:00
Nicholas Bellinger d050ffb922 target: Re-org of core_tmr_lun_reset
This patch is a re-orginzation of core_tmr_lun_reset() logic to properly
scan the active tmr_list, dev->state_task_list and qobj->qobj_list w/ the
relivent locks held, and performing a list_move_tail onto seperate local
scope lists before performing the full drain.

This involves breaking out the code into three seperate list specific
functions: core_tmr_drain_tmr_list(), core_tmr_drain_task_list() and
core_tmr_drain_cmd_list().

(nab: Include target: Remove non-active tasks from execute list during
      LUN_RESET patch to address original breakage)

Reported-by: Roland Dreier <roland@purestorage.com>
Cc: Roland Dreier <roland@purestorage.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
2011-10-24 03:19:32 +00:00
Roland Dreier 79a7fef264 target: Prevent cmd->se_queue_node double add
This patch addresses a bug with the lio-core-2.6.git conversion of
transport_add_cmd_to_queue() to use a single embedded list_head, instead
of individual struct se_queue_req allocations allowing a single se_cmd to
be added to the queue mulitple times.  This was changed in the following:

commit 2a9e4d5ca5d99f4c600578d6285d45142e7e5208
Author: Andy Grover <agrover@redhat.com>
Date:   Tue Apr 26 17:45:51 2011 -0700

    target: Embed qr in struct se_cmd

The problem is that some target code still assumes performing multiple
adds is allowed via transport_add_cmd_to_queue(), which ends up causing
list corruption in qobj->qobj_list code.  This patch addresses this
by removing an existing struct se_cmd from the list before the add, and
removes an unnecessary list walk in transport_remove_cmd_from_queue()

It also changes cmd->t_transport_queue_active to use explict sets intead
of increment/decrement to prevent confusion during exception path handling.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
2011-10-24 03:17:51 +00:00
Alasdair G Kergon d136f2efdf dm kcopyd: fix job_pool leak
Fix memory leak introduced by commit a6e50b409d
(dm snapshot: skip reading origin when overwriting complete chunk).

When allocating a set of jobs from kc->job_pool, job->master_job must be
set (to point to itself) so that the mempool item gets freed when the
master_job completes.

master_job was introduced by commit c6ea41fbbe
(dm kcopyd: preallocate sub jobs to avoid deadlock)

Reported-by: Michael Leun <ml@newton.leun.net>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2011-10-23 20:55:17 +01:00
Mark Einon 68cf162a1a staging: et131x: Remove redundant check and return statement
In nic_send_packet(), by the time 'frag' is checked to be zero, it never
is - the for loop has been entered (as nr_frags is always > 0) and frag
has been incremented at least once. Remove the check and associated
error return.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:13 +02:00
Mark Einon 09a3fc2bf1 staging: et131x: Mainly whitespace changes to appease checkpatch
- Whitespace changes to appease checkpatch warnings
- Removed unneeded braces around single line if/else

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:13 +02:00
Mark Einon 8310c60238 staging: et131x: Remove last of the forward declarations
Moved functions in et131x.c file to remove the forward declarations of:

et131x_rx_dma_disable
et131x_rx_dma_enable
et131x_init_send
et131x_tx_dma_enable

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:13 +02:00
Mark Einon 2288760e3b staging: et131x: Remove even more forward declarations
Moved functions in et131x.c file to remove the forward declarations of:

et1310_in_phy_coma
et1310_phy_access_mii_bit
et131x_phy_mii_read
et131x_mii_write
et131x_rx_dma_memory_free

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:13 +02:00
Mark Einon a4d444bdef staging: et131x: Remove yet more forward declarations
Moved functions in et131x.c file to remove the forward declarations of:

et1310_setup_device_for_multicast
et1310_setup_device_for_unicast
et131x_up
et131x_down
et131x_enable_txrx
et131x_disable_txrx

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:13 +02:00
Mark Einon 5da2b1581a staging: et131x: Remove more forward declarations
Moved functions in et131x.c file to remove the following forward
declarations:

et131x_soft_reset
et131x_isr_handler
et131x_device_alloc

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:12 +02:00
Mark Einon 36f2771a70 staging: et131x: Remove forward declaration of et131x_adapter_setup
Also associated function movements within et131x.c file

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:12 +02:00
Mark Einon 44012dfe4e staging: et131x: Remove some forward declarations
Moved functions in et131x.c file to remove the following forward
declarations:

et131x_align_allocated_memory
et131x_disable_interrupts
et131x_enable_interrupts
et131x_error_timer_handler

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:12 +02:00
Mark Einon c018a5f11d staging: et131x: Remove unused rx_ring.recv_packet_pool
tx_ring.recv_packet_pool is unused, even in the original driver code.
Removed.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:12 +02:00
Mark Einon ac8f4837f2 staging: et131x: Remove call to find pci pm capability
pci_find_capability is called, but not used and is now redundant as
power management is handled elsewhere. Removed.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:12 +02:00
Mark Einon 5ad5be581e staging: et131x: Remove redundant et131x_reset_recv() call
This call doesn't do anything useful - only warns on the receive list
being empty, so removed it.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:11 +02:00
Mark Einon 16d8de3cc9 staging: et131x: Remove unused rx_ring.recv_buffer_pool
rx_ring.recv_buffer_pool is unused, even in the original driver code.
Remove from stuct, and also remove some comments regarding it.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 11:35:11 +02:00
Kevin McKinney a86581829f Staging: bcm: Fix three initialization errors in InterfaceDld.c
This patch fixes three initialization errors.
One is an incorrect initialization of a static
variable. The other two are incorrect
initializations in an if statement. These
errors were found by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:16:34 +02:00
Kevin McKinney a5e4b81e27 Staging: bcm: Fix coding style issues in InterfaceDld.c
This patch fixes multiple coding style issues in file,
InterfaceDld.c, found by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:16:34 +02:00
Lars-Peter Clausen a3e2940c24 staging:iio:dac: Add AD5360 driver
This patch adds support for the Analog Devices AD5360, AD5361, AD5362, AD5363,
AD5370, AD5371, AD5372, AD5373 multi-channel digital-to-analog converters.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:15:02 +02:00
Lars-Peter Clausen dafb7d1bd0 staging:iio:trigger:bfin-timer: Fix compile error
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:15:02 +02:00
Dan Carpenter 0c849b3c16 Staging: vt6655: add some range checks before memcpy()
There were no range checks in the original code so the user could
write past the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:13:20 +02:00
Dan Carpenter 0d3eb2b29f Staging: vt6655: whitespace fixes to iotcl.c
The indents didn't line up at all in the original code.  I also fixed
a bunch of other white issues as I went along.  I changed the comment
style and removed some commented out code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:13:20 +02:00
Dan Carpenter 44ec5d2916 Staging: vt6656: add some range checks before memcpy()
We need to verify that we're not writing past the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:13:20 +02:00
Dan Carpenter 883aeecc9d Staging: vt6656: whitespace cleanups in ioctl.c
The indents on this file didn't line up so it was hard to work with.
I changed other white space issues as I came across them.  I also
deleted or changed some couple comments and the comment style.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:13:19 +02:00
Mark Einon 4fb544c947 staging: et131x: Remove unused defines
Some defines are no longer referenced in the code, so removed them.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:12 +02:00
Mark Einon 26dc751e25 staging: et131x: Convert rest of pci memory management to dma api
Replaced pci map/unmap and set_mask calls with their dma equivalents.
Also updated comments to reflect this.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:12 +02:00
Mark Einon 06709e9623 staging: et131x: on transmit, stop the queue if the next packet will fail
* Currently the tx queue is only stopped when the current packet fails.
Check if the next packet will fail, and stop the queue if so.

* Removed associated item from TODO list in the README.

* Also minor fixup as adapter was being declared as null and immediately set
to a value.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:12 +02:00
Mark Einon 26d19bf60b staging: et131x: Tidy up PCI device table definition
Used the convenience macros DEFINE_PCI_DEVICE_TABLE and PCI_VDEVICE to
tidy up the device table definition.

Also remove the corresponding TODO item from the README.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:12 +02:00
Mark Einon 675c8f68ca staging: et131x: Match dma_alloc_ calls with dma_free_ calls
Previous update was to replace pci_alloc with dma_alloc calls. I missed
replacing the corresponding pci_free_ calls with the dma versions. Now
done. Thanks to Denis Kirjanov <kirjanov@gmail.com> for pointing this
out.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:11 +02:00
Mark Einon 0d1b7a84d3 staging: et131x: use dma_alloc... instead of pci_alloc...
Use dma_allocs instead of pci_allocs, so we can use GFP_KERNEL
allocations.

Also removed this item from the TODO list

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:11 +02:00
Mark Einon e592a9b06c staging: et131x: Fix issues when USE_FBR0 is not defined
* Following on from making rx_ring.fbr use a common structure - reversed
the fbr[] array indicies so that index 1 = FBR0 and index 0 = FBR1,
which allows USE_FBR0 define to work.

* Also fixed up minor issues where indexes into the array were out of
bounds in some places.

* Removed rx_ring.fbr common stuct TODO item from README

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:11 +02:00
Mark Einon 6abafc164c staging: et131x: Make rx_ring.fbr{0,1} share a common structure
Sharing a common structure by moving common structure items into
fbr_lookup.

TODO - Currently will not work if USE_FBR0 = 0 as FBR1 uses fbr[1]
which is removed in this case

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:11 +02:00
Mark Einon 920d74a405 staging: et131x: Moving two extern inline functions to .c file
Two helper functions for adding 10bit/12bit umbers with wrapping are
defined in the header. Moved them to the driver .c file.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:10 +02:00
Mark Einon 82e4b35f4d staging: et131x: Update TODO list - remove 'put driver into single file'
Driver now resides in a single file with a separate header with
registers, updated the README TODO list.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:10 +02:00
Mark Einon 17ec9ff32c staging: et131x: move et1310_tx.h contents into et131x.c
Move et1310_tx.h contents into et131x.c and delete et1310_tx.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:10 +02:00
Mark Einon 562550b02b staging: et131x: move et1310_rx.h contents into et131x.c
Move et1310_rx.h contents into et131x.c and delete et1310_rx.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:10 +02:00
Mark Einon 1c1c1b5fda staging: et131x: move et131x_defs.h contents into et131x.c
Move et131x_defs.h contents into et131x.c and delete et131x_defs.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:09 +02:00
Mark Einon fd0651a6d1 staging: et131x: move et131x_adapter.h contents into et131x.c
Move et131x_adapter.h contents into et131x.c and delete et131x_adapter.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:09 +02:00
Mark Einon 2b2b9554de staging: et131x: move et1310_phy.h contents into et131x.h
Move et1310_phy.h register defines into et131x.h and delete
et1310_phy.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:09 +02:00
Mark Einon 01df6aa263 staging: et131x: move et1310_address_map.h contents into et131x.h
Move et1310_address_map.h register defines into et131x.h and delete
et1310_address_map.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:09 +02:00
Mark Einon bd156af600 staging: et131x: Move non-register defines from et131x.h to et131x.c
Header file should only have register defines, moved non-register
defines to et131x.c

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:08 +02:00
Mark Einon 2d0c64ad04 staging: et131x: Move function declarations from et131x.h to et131x.c
The function declarations in et131x.h are no longer used now all
functions are in one file. Removed declarations from et131x.h and
added any required forward declarations to et131x.c.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:07:08 +02:00
Mark Einon d2796743cb staging: et131x: Put all .c files into one big file
Created one big .c file for the driver, moving the contents of all
driver .c files into it.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:03:40 +02:00
Linus Torvalds 5117cc25fd Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83627ehf) Fix negative 8-bit temperature values
2011-10-23 10:43:31 +03:00
Jakob Bornecrantz c5c42360bc vmwgfx: Don't pass unused arguments to do_dirty functions
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-23 07:48:00 +01:00
Jakob Bornecrantz 64fc99447f vmwgfx: Emulate depth 32 framebuffers
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-23 07:47:53 +01:00
Eric W. Biederman 01718e36df bonding: Add a forgetten sysfs_attr_init on class_attr_bonding_masters
When I made class_attr_bonding_matters per network namespace and dynamically
allocated I overlooked the need for calling sysfs_attr_init.  Oops.

This fixes the following lockdep splat:

[    5.749651] bonding: Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    5.749655] bonding: MII link monitoring set to 100 ms
[    5.749676] BUG: key f49a831c not in .data!
[    5.749677] ------------[ cut here ]------------
[    5.749752] WARNING: at kernel/lockdep.c:2897 lockdep_init_map+0x1c3/0x460()
[    5.749809] Hardware name: ProLiant BL460c G1
[    5.749862] Modules linked in: bonding(+)
[    5.749978] Pid: 3177, comm: modprobe Not tainted 3.1.0-rc9-02177-gf2d1a4e-dirty #1157
[    5.750066] Call Trace:
[    5.750120]  [<c1352c2f>] ? printk+0x18/0x21
[    5.750176]  [<c103112d>] warn_slowpath_common+0x6d/0xa0
[    5.750231]  [<c1060133>] ? lockdep_init_map+0x1c3/0x460
[    5.750287]  [<c1060133>] ? lockdep_init_map+0x1c3/0x460
[    5.750342]  [<c103117d>] warn_slowpath_null+0x1d/0x20
[    5.750398]  [<c1060133>] lockdep_init_map+0x1c3/0x460
[    5.750453]  [<c1355ddd>] ? _raw_spin_unlock+0x1d/0x20
[    5.750510]  [<c11255c8>] ? sysfs_new_dirent+0x68/0x110
[    5.750565]  [<c1124d4b>] sysfs_add_file_mode+0x8b/0xe0
[    5.750621]  [<c1124db3>] sysfs_add_file+0x13/0x20
[    5.750675]  [<c1124e7c>] sysfs_create_file+0x1c/0x20
[    5.750737]  [<c1208f09>] class_create_file+0x19/0x20
[    5.750794]  [<c12c186f>] netdev_class_create_file+0xf/0x20
[    5.750853]  [<f85deaf4>] bond_create_sysfs+0x44/0x90 [bonding]
[    5.750911]  [<f8410947>] ? bond_create_proc_dir+0x1e/0x3e [bonding]
[    5.750970]  [<f841007e>] bond_net_init+0x7e/0x87 [bonding]
[    5.751026]  [<f8410000>] ? 0xf840ffff
[    5.751080]  [<c12abc7a>] ops_init.clone.4+0xba/0x100
[    5.751135]  [<c12abdb2>] ? register_pernet_subsys+0x12/0x30
[    5.751191]  [<c12abd03>] register_pernet_operations.clone.3+0x43/0x80
[    5.751249]  [<c12abdb9>] register_pernet_subsys+0x19/0x30
[    5.751306]  [<f84108b9>] bonding_init+0x832/0x8a2 [bonding]
[    5.751363]  [<c10011f0>] do_one_initcall+0x30/0x160
[    5.751420]  [<f8410087>] ? bond_net_init+0x87/0x87 [bonding]
[    5.751477]  [<c106d5cf>] sys_init_module+0xef/0x1890
[    5.751533]  [<c1356490>] sysenter_do_call+0x12/0x36
[    5.751588] ---[ end trace 89f492d83a7f5006 ]---

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-22 05:08:44 -04:00
Eric Dumazet f7ff19871b tg3: fix tigon3_dma_hwbug_workaround()
Ari got kernel panics using tg3 NIC, and bisected to 2669069aac "tg3:
enable transmit time stamping."

This is because tigon3_dma_hwbug_workaround() might alloc a new skb and
free the original. We panic when skb_tx_timestamp() is called on freed
skb.

Reported-by: Ari Savolainen <ari.m.savolainen@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-22 03:29:53 -04:00
Jonghwan Choi 0ab1e79b82 PM / Clocks: Remove redundant NULL checks before kfree()
Since kfree() checks it its argument is not NULL, it is not necessary
to duplicate this check in __pm_clk_remove().

[rjw: Added the changelog.]

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-10-22 00:22:54 +02:00
Dave Jones d11c78e97e ACPI / PM: Add Sony VGN-FW21E to nonvs blacklist.
As noted by a user in https://bugzilla.redhat.com/show_bug.cgi?id=641789
The Sony VGN-FW21E also needs the nonvs by default workaround added.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-10-22 00:22:27 +02:00
Rafael J. Wysocki d033e07856 Merge branch 'pm-domains' into pm-for-linus
* pm-domains:
  ARM: mach-shmobile: sh7372 A4R support (v4)
  ARM: mach-shmobile: sh7372 A3SP support (v4)
  PM / Sleep: Mark devices involved in wakeup signaling during suspend
2011-10-22 00:21:52 +02:00
Rafael J. Wysocki 4ca46ff3e0 PM / Sleep: Mark devices involved in wakeup signaling during suspend
The generic PM domains code in drivers/base/power/domain.c has
to avoid powering off domains that provide power to wakeup devices
during system suspend.  Currently, however, this only works for
wakeup devices directly belonging to the given domain and not for
their children (or the children of their children and so on).
Thus, if there's a wakeup device whose parent belongs to a power
domain handled by the generic PM domains code, the domain will be
powered off during system suspend preventing the device from
signaling wakeup.

To address this problem introduce a device flag, power.wakeup_path,
that will be set during system suspend for all wakeup devices,
their parents, the parents of their parents and so on.  This way,
all wakeup paths in the device hierarchy will be marked and the
generic PM domains code will only need to avoid powering off
domains containing devices whose power.wakeup_path is set.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-10-22 00:19:29 +02:00
Mitko Haralanov dde05cbdf8 IB/qib: Hold links until tuning data is available
Hold the link state machine until the tuning data is read from the
QSFP EEPROM so correct tuning settings are applied before the state
machine attempts to bring the link up.  Link is also held on cable
unplug in case a different cable is used.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 15:08:20 -07:00
Mike Marciniszyn 44d75d3d92 IB/qib: Clean up checkpatch issue
This was probably present from initial submission.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 15:08:18 -07:00
Dave Jones 19703058cd drm/radeon: Lower the severity of the radeon lockup messages.
abrt files a lot of bug reports when users get GPU lockups, but there's not really
enough context to do anything useful with them.  Given the lack of GPU context being
dumped, this patch removes the stack trace, so that abrt ignores the messages.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-21 19:00:15 +01:00
Mike Marciniszyn 9fd5473deb IB/qib: Remove s_lock around header validation
Review of qib_ruc_check_hdr() shows that the s_lock is not required in
the normal case.  The r_lock is held in all cases, and protects the qp
fields that are read.

The s_lock will be needed to around the call to qib_migrate_qp() to
insure that the send engine sees a consistent set of fields.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 09:38:57 -07:00
Mike Marciniszyn d0f2faf72d IB/qib: Precompute timeout jiffies to optimize latency
A new field is added to qib_qp called timeout_jiffies. It is
initialized upon create and modify.

The field is now used instead of a computation based on qp->timeout.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 09:38:56 -07:00
Mike Marciniszyn af061a644a IB/qib: Use RCU for qpn lookup
The heavy weight spinlock in qib_lookup_qpn() is replaced with RCU.
The hash list itself is now accessed via jhash functions instead of mod.

The changes should benefit multiple receive contexts in different
processors by not contending for the lock just to read the hash
structures.

The patch also adds a lookaside_qp (pointer) and a lookaside_qpn in
the context.  The interrupt handler will test the current packet's qpn
against lookaside_qpn if the lookaside_qp pointer is non-NULL.  The
pointer is NULL'ed when the interrupt handler exits.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 09:38:54 -07:00
Mike Marciniszyn 9e1c0e4325 IB/qib: Eliminate divide/mod in converting idx to egr buf pointer
The context init now saves a shift from rcvegrbufs_perchunk
rcvegrbufs_perchunk_shift using ilog2.   A BUG_ON() protects the
power of 2 assumption.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 09:38:52 -07:00
Mike Marciniszyn cc6ea1385b IB/qib: Decode path MTU optimization
Store both the encoded and decoded MTU in the QP structure as a minor
optimization for UC/RC receive routines.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 09:38:50 -07:00
Mike Marciniszyn 2fc109c890 IB/qib: Optimize RC/UC code by IB operation
The memset for zeroing work completions had been unconditional.

This patch removes the memset and moves the zeroing into the work
completion with a more explicit field by field set.  With this patch,
non-ONLY/non-LAST packets will avoid the overhead since they will not
generate a completion.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-10-21 09:38:49 -07:00
Kim Phillips 3e721aeb3d crypto: talitos - handle descriptor not found in error path
The CDPR (Current Descriptor Pointer Register) can be unreliable
when trying to locate an offending descriptor.  Handle that case by
(a) not OOPSing, and (b) reverting to the machine internal copy of
the descriptor header in order to report the correct execution unit
error.

Note: printing all execution units' ISRs is not effective because it
results in an internal time out (ITO) error and the EU resetting its
ISR value (at least when specifying an invalid key length on an SEC
2.2/MPC8313E).

Reported-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2011-10-21 15:20:28 +02:00
Joerg Roedel 1abb4ba596 Merge branches 'amd/fixes', 'debug/dma-api', 'arm/omap', 'arm/msm', 'core', 'iommu/fault-reporting' and 'api/iommu-ops-per-bus' into next
Conflicts:
	drivers/iommu/amd_iommu.c
	drivers/iommu/iommu.c
2011-10-21 14:38:55 +02:00
Joerg Roedel 94441c3bd9 iommu/core: Remove global iommu_ops and register_iommu
With all IOMMU drivers being converted to bus_set_iommu the
global iommu_ops are no longer required. The same is true
for the deprecated register_iommu function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:23 +02:00
Joerg Roedel 85eebbc5e4 iommu/msm: Use bus_set_iommu instead of register_iommu
Convert the MSM IOMMU driver for ARM to use the new
interface for publishing the iommu_ops.

Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:23 +02:00
Joerg Roedel a65bc64f91 iommu/omap: Use bus_set_iommu instead of register_iommu
Convert the OMAP IOMMU driver on ARM to use the new
interface for publishing the iommu_ops.

Cc: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:22 +02:00
Joerg Roedel 4236d97df6 iommu/vt-d: Use bus_set_iommu instead of register_iommu
Convert the Intel IOMMU driver to use the new interface for
publishing the iommu_ops.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:22 +02:00
Joerg Roedel 2cc21c4236 iommu/amd: Use bus_set_iommu instead of register_iommu
Convert the AMD IOMMU driver to use the new interface for
publishing the iommu_ops.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:21 +02:00
Joerg Roedel e5aa7f0077 iommu/core: Use bus->iommu_ops in the iommu-api
Use the per-bus iommu-ops in the functions of the iommu-api
instead of the global iommu_ops.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:21 +02:00
Joerg Roedel a1b60c1cd9 iommu/core: Convert iommu_found to iommu_present
With per-bus iommu_ops the iommu_found function needs to
work on a bus_type too. This patch adds a bus_type parameter
to that function and converts all call-places.
The function is also renamed to iommu_present because the
function now checks if an iommu is present for a given bus
and does not check for a global iommu anymore.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:20 +02:00
Joerg Roedel 905d66c1e5 iommu/core: Add bus_type parameter to iommu_domain_alloc
This is necessary to store a pointer to the bus-specific
iommu_ops in the iommu-domain structure. It will be used
later to call into bus-specific iommu-ops.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:19 +02:00
Joerg Roedel ff21776d12 Driver core: Add iommu_ops to bus_type
This is the starting point to make the iommu_ops used for
the iommu-api a per-bus-type structure. It is required to
easily implement bus-specific setup in the iommu-layer.
The first user will be the iommu-group attribute in sysfs.

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2011-10-21 14:37:19 +02:00
Richard Weinberger 75b766258e crypto: Make hifn_795x build depend on !ARCH_DMA_ADDR_T_64BIT
hifn_795x works only on 32 bit, remove the detection while loading
the module and catch non-32 bit systems at build time.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2011-10-21 14:28:57 +02:00
Carolyn Wyborny 1128c756be igb: VFTA Table Fix for i350 devices
Due to a hardware problem, writes to the VFTA register can
theoretically fail. Although the likelihood of this is very low.
This patch adds a shadow vfta in the adapter struct for reading
and adds new write functions for these devices to work around the problem.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-10-21 03:19:39 -07:00
Carolyn Wyborny b6e0c419f0 igb: Move DMA Coalescing init code to separate function.
This patch moves the DMA Coalescing feature initialization code from
igb_reset to a new function and replaces it with a call to the new
function.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-10-21 03:15:10 -07:00
Carolyn Wyborny 65189d284b igb: Fix for Alt MAC Address feature on 82580 and later devices
In 82580 and later devices, the alternate MAC address feature is
completely handled by the option ROM and software does not handle
it anymore.  This patch changes the check_alt_mac_addr function to
exit immediately if device is 82580 or later.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-10-21 03:13:21 -07:00
Williams, Mitch A 7d94eb84f3 igbvf: Bump version number
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-10-21 03:08:58 -07:00
Williams, Mitch A 10090751c0 igbvf: Update module identification strings
Update adapter identification strings to properly indicate i350 VF devices
in the VF driver. Change the driver ID string to remove 82576-specific
wording. Update copyright date.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-10-21 03:06:55 -07:00
Daniel van Vugt bca621421c HID: hid-magicmouse: Magic Trackpad has 1 button, not 2
hid-magicmouse was advertising the Apple Magic Trackpad as having 2
buttons (left and right) when it actually only has 1 button.

Advertising multiple buttons makes Xorg disable all button 2 and 3
emulation (using multi-finger clicks). So Xorg users don't get working
right/middle-click emulation out of the box.

This patch makes hid-magicmouse correctly only report one real button
for Magic Trackpad, which in turn makes Xorg enable multi-finger click
support to emulate right/middle buttons.

[http://launchpad.net/bugs/862094]

Signed-off-by: Daniel van Vugt <vanvugt@gmail.com>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-10-21 10:13:55 +02:00
Eric W. Biederman e09eff7fc1 macvtap: Fix the minor device number allocation
On systems that create and delete lots of dynamic devices the
31bit linux ifindex fails to fit in the 16bit macvtap minor,
resulting in unusable macvtap devices.  I have systems running
automated tests that that hit this condition in just a few days.

Use a linux idr allocator to track which mavtap minor numbers
are available and and to track the association between macvtap
minor numbers and macvtap network devices.

Remove the unnecessary unneccessary check to see if the network
device we have found is indeed a macvtap device.  With macvtap
specific data structures it is impossible to find any other
kind of networking device.

Increase the macvtap minor range from 65536 to the full 20 bits
that is supported by linux device numbers.  It doesn't solve the
original problem but there is no penalty for a larger minor
device range.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:53:07 -04:00
Eric W. Biederman 9bf1907f42 macvtap: Rewrite macvtap_newlink so the error handling works.
Place macvlan_common_newlink at the end of macvtap_newlink because
failing in newlink after registering your network device is not
supported.

Move device_create into a netdevice creation notifier.   The network device
notifier is the only hook that is called after the network device has been
registered with the device layer and before register_network_device returns
success.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:53:07 -04:00
Eric W. Biederman 2259fef0bb macvtap: Don't leak unreceived packets when we delete a macvtap device.
To avoid leaking packets in the receive queue.  Add a socket destructor
that will run whenever destroy a macvtap socket.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:53:07 -04:00
Eric W. Biederman 047af9cfed macvtap: Fix macvtap_open races in the zero copy enable code.
To see if it is appropriate to enable the macvtap zero copy feature
don't test the lowerdev network device flags.   Instead test the
macvtap network device flags which are a direct copy of the lowerdev
flags.  This is important because nothing holds a reference to lowerdev
and on a very bad day we lowerdev could be a pointer to stale memory.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:53:07 -04:00
Eric W. Biederman 99f34b38cd macvtap: Close a race between macvtap_open and macvtap_dellink.
There is a small window in macvtap_open between looking up a
networking device and calling macvtap_set_queue in which
macvtap_del_queues called from macvtap_dellink.   After
calling macvtap_del_queues it is totally incorrect to
allow macvtap_set_queue to proceed so prevent success by
reporting that all of the available queues are in use.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:53:06 -04:00
Eric Dumazet 4b727361f0 virtio_net: fix truesize underestimation
We must account in skb->truesize, the size of the fragments, not the
used part of them.

Doing this work is important to avoid unexpected OOM situations.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: "Michael S. Tsirkin" <mst@redhat.com>
CC: virtualization@lists.linux-foundation.org
CC: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:53:00 -04:00
Eric Dumazet e1ac50f646 bnx2x: fix skb truesize underestimation
bnx2x allocates a full page per fragment.

We must account in skb->truesize, the size of the fragment, not the used
part of it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:52:59 -04:00
Ian Campbell 6a39a16a5a cxgbi: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: Karen Xie <kxie@chelsio.com>
Cc: linux-scsi@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:52:53 -04:00
Ian Campbell a0006a86cb cxgb4vf: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Casey Leedom <leedom@chelsio.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:52:52 -04:00
Ian Campbell e91b0f2491 cxgb4: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Dimitris Michailidis <dm@chelsio.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:52:52 -04:00
Ian Campbell 311761c8a5 mlx4: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-21 02:52:52 -04:00
Adam Jackson 82d165557e drm/i915/dp: Fix eDP on PCH DP on CPT/PPT
According to the gen6 docs, only the DP_A port (on-CPU eDP) still uses
the old IBX bit shift for the link training pattern setup bits.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:03 -07:00
Adam Jackson 1c95822afe drm/i915/dp: Introduce is_cpu_edp()
The obvious counterpart to is_pch_edp().  Convert existing instances of
the idiom to the new routine.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:03 -07:00
Jesse Barnes 260052100e drm/i915: use correct SPD type value
SPD frames are actually type 0x83, not just 0x3.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:02 -07:00
Jesse Barnes 64a8fc0145 drm/i915: fix ILK+ infoframe support
Misc fixes based on tests with an infoframe analyzer:
  - checksum *does* include header bytes
  - DIP enable & AVI infoframe are tied together in hw, so disable both
    and make sure AVI frames are enabled first
  - use every vsync flag for SPD frames to avoid reserved value in
    frequency field when enabling both AVI & SPD

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40281.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:02 -07:00
Jesse Barnes a60f0e38d7 drm/i915: add DP test request handling
DPCD 1.1+ adds some automated test infrastructure support.  Add support
for reading the IRQ source and jumping to a test handling routine if
needed.  Subsequent patches will handle particular tests; this patch
just ACKs any requested tests by default.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:01 -07:00
Jesse Barnes a2006cf5a7 drm/i915: read full receiver capability field during DP hot plug
Read link status first, followed by the full DPCD receiver cap field
rather than just the first 8 bytes.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:00 -07:00
Adam Jackson dc22ee6fc1 drm/i915/dp: Remove eDP special cases from bandwidth checks
These were just working around the math being wrong.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:22:00 -07:00
Adam Jackson cd9dde44f4 drm/i915/dp: Fix the math in intel_dp_link_required
The previous code was confused about units, which is pretty reasonable
given that the units themselves are confusing.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:59 -07:00
Takashi Iwai f52c619a59 drm/i915/panel: Always record the backlight level again (but cleverly)
The commit 47356eb672 introduced a
mechanism to record the backlight level only at disabling time, but it
also introduced a regression.  Since intel_lvds_enable() may be called
without disabling (e.g. intel_lvds_commit() calls it unconditionally),
the backlight gets back to the last recorded value.  For example, this
happens when you dim the backlight, close the lid and open the lid,
then the backlight suddenly goes to the brightest.

This patch fixes the bug by recording the backlight level always
when changed via intel_panel_set_backlight().  And,
intel_panel_{enable|disable}_backlight() call the internal function not
to update the recorded level wrongly.

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:59 -07:00
Andi Kleen f700088333 i915: Move i915_read/write out of line
With the tracing code in there they are far too big to inline.

.text savings compared to a non force inline kernel:

i915_restore_display                        4393   12036   +7643
i915_save_display                           4295   11459   +7164
i915_handle_error                           2979    6666   +3687
i915_driver_irq_handler                     2923    5086   +2163
i915_ringbuffer_info                         458    1661   +1203
i915_save_vga                                  -    1200   +1200
i915_driver_irq_uninstall                    453    1624   +1171
i915_driver_irq_postinstall                  913    2078   +1165
ironlake_enable_drps                         719    1872   +1153
i915_restore_vga                               -    1142   +1142
intel_display_capture_error_state            784    2030   +1246
intel_init_emon                              719    2016   +1297

and more ...

[AK: these are older numbers, with the new SNB forcewake checks
it will be even worse]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:58 -07:00
Jesse Barnes a487928908 drm/i915: remove transcoder PLL mashing from mode_set per specs
Belongs in PCH enable instead.  The duplication is worrying and the
specs explicitly list transcoder select *after* actual PLL enable, which
doesn't occur until later.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:58 -07:00
Jesse Barnes 4c9c18c293 drm/i915: if transcoder disable fails, say which
Just some extra debug output.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:57 -07:00
Jesse Barnes d6c892df7e drm/i915: set watermarks for third pipe on IVB
The watermark reg for the third pipe is in an unusual offset; add
support for it and set watermarks for 3 pipe configs.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:56 -07:00
Jesse Barnes d4270e57ef drm/i915: export a CPT mode set verification function
At the point where we check, we can't do much about the failure, but it
can aid debugging.  Note that the auto-train override bit will be reset
as part of normal mode setting with this patch if a pipe ever does get
stuck, but that's consistent with the workaround for CPT provided by the
hardware team.  This patch helped catch the fact that the pipe wasn't
running in the !composite sync FDI case on my IVB SDV, so has already
shown to be useful.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:56 -07:00