firefly-linux-kernel-4.4.55.git
13 years agoHID: fix support for Microsoft comfort mouse 4500
Jiri Kosina [Fri, 22 Jul 2011 10:11:15 +0000 (12:11 +0200)]
HID: fix support for Microsoft comfort mouse 4500

Add forgotten entry into the global blacklist.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
13 years agotarget: Bump version to v4.1.0-rc1-ml
Nicholas Bellinger [Fri, 22 Jul 2011 08:24:22 +0000 (08:24 +0000)]
target: Bump version to v4.1.0-rc1-ml

This patch bumps the target core version to v4.1.0-rc1 now that we are
in sync with upstream lio-core-2.6.git/master

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: remove custom hex2bin() implementation
Andy Shevchenko [Tue, 19 Jul 2011 05:26:40 +0000 (22:26 -0700)]
target: remove custom hex2bin() implementation

This patch drops transport_asciihex_to_binaryhex() in favor of proper
hex2bin usage from include/linux/kernel.h:hex2bin()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: fix typo Assoication -> Association
Andy Shevchenko [Tue, 19 Jul 2011 05:17:43 +0000 (22:17 -0700)]
target: fix typo Assoication -> Association

Additionally this patch brings proper apply of the designator type.
However, the original code luckily has no bug, because the association
equals to 0.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: James Bottomley <jbottomley@parallels.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Update QUEUE ALGORITHM MODIFIER control page default
Nicholas Bellinger [Sun, 17 Jul 2011 09:57:58 +0000 (02:57 -0700)]
target: Update QUEUE ALGORITHM MODIFIER control page default

This patch adds the default 'Unrestricted reordering allowed' for SCSI
control mode page QUEUE ALGORITHM MODIFIER on a per se_device basis in
target_modesense_control() following spc4r23.  This includes a new
emuluate_rest_reord configfs attribute that currently (only) accepts
zero to signal 'Unrestricted reordering allowed' in control mode page
usage by the backend target device.

Reported-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
13 years agotarget: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG
Nicholas Bellinger [Thu, 21 Jul 2011 04:41:48 +0000 (04:41 +0000)]
target: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG

This patch breaks up the ->map_task_SG() backend call into two seperate
->map_control_SG() and ->map_data_SG() in order to better address
IBLOCK and pSCSI.  IBLOCK only allocates bios for ->map_data_SG(), and
pSCSI will allocate a struct request for both cases.

This patch fixes incorrect usage of ->map_task_SG() for all se_cmd descriptors
in transport_generic_new_cmd() by moving the call into it's proper location
directly inside of transport_allocate_data_tasks()

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Follow up core updates from AGrover and HCH (round 4)
Andy Grover [Wed, 8 Jun 2011 17:36:43 +0000 (10:36 -0700)]
target: Follow up core updates from AGrover and HCH (round 4)

This patch contains the squashed version of forth round series cleanups
from Andy and Christoph following the post heavy lifting in the preceeding:
'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
changes.  This also includes a conversion of target core and the v3.0
mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
CONFIG_DYNAMIC_DEBUG infrastructure!

These have been squashed into this third and final round for v3.1.

target: Remove ifdeffed code in t_g_process_write
target: Remove direct ramdisk code
target: Rename task_sg_num to task_sg_nents
target: Remove custom debug macros for pr_debug. Use pr_err().
target: Remove custom debug macros in mainline fabrics
target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
target: Remove transport do_se_mem_map callback
target: Further simplify transport_free_pages
target: Redo task allocation return value handling
target: Remove extra parentheses
target: change alloc_task call to take *cdb, not *cmd

(nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)

Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Eliminate usage of struct se_mem
Andy Grover [Wed, 20 Jul 2011 19:28:46 +0000 (19:28 +0000)]
target: Eliminate usage of struct se_mem

Both backstores and fabrics use arrays of struct scatterlist to describe
data buffers. However TCM used struct se_mems, basically a linked list
of scatterlist entries. We are able to simplify the code by eliminating
this intermediate data structure and just using struct scatterlist[]
throughout.

Also, moved attachment of task to cmd out of transport_generic_get_task
and into allocate_control_task and allocate_data_tasks. The reasoning
is that it's nonintuitive that get_task should automatically add it to
the cmd's task list -- it should just return an allocated, initialized
task. That's all it should do, based on the function's name, so either the
function shouldn't do it, or the name should change to encapsulate the
entire essence of what it does.

(nab: Fix compile warnings in tcm_fc, and make transport_kmap_first_data_page
 honor sg->offset for SGLs from contigious memory with TCM_Loop, and
 fix control se_cmd descriptor memory leak)

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Pass 2nd param of transport_split_cdb by value
Andy Grover [Tue, 28 Jun 2011 17:31:18 +0000 (10:31 -0700)]
target: Pass 2nd param of transport_split_cdb by value

Since sectors is not modified, it's more straightforward to do this.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Enforce 1 page max for control cdb buffer sizes
Andy Grover [Sat, 9 Jul 2011 00:04:53 +0000 (17:04 -0700)]
target: Enforce 1 page max for control cdb buffer sizes

Due to all cdbs' data buffers being referenced by scatterlists, buffers
of more than a page are not contiguous. Instead of handling this in all
control command handlers, we may be able to get away with just limiting
control cdb data buffers to one page. The only control CDBs we handle that
have potentially large data buffers are REPORT LUNS and UNMAP, so if we
didn't want to live with this limitation, they would need to be modified
to walk the pages in the data buffer's sgl.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Make all control CDBs scatter-gather
Andy Grover [Wed, 20 Jul 2011 19:13:28 +0000 (19:13 +0000)]
target: Make all control CDBs scatter-gather

Previously, some control CDBs did not allocate memory in pages for their
data buffer, but just did a kmalloc. This patch makes all cdbs allocate
pages.

This has the benefit of streamlining some paths that had to behave
differently when we used two allocation methods. The downside is that
all accesses to the data buffer need to kmap it before use, and need to
handle data in page-sized chunks if more than a page is needed for a given
command's data buffer.

Finally, note that cdbs with no data buffers are handled a little
differently. Before, SCSI_NON_DATA_CDBs would not call get_mem at all
(they'd be in the final else in transport_allocate_resources) but now
these will make it into generic_get_mem, but just not allocate any
buffers.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Implement Block Device Characteristics VPD page
Roland Dreier [Tue, 5 Jul 2011 20:34:52 +0000 (13:34 -0700)]
target: Implement Block Device Characteristics VPD page

Implement page B1h, Block Device Characteristics, so that we can report
a medium rotation rate of 1 (non-rotating / solid state) if the
is_nonrot device attribute is set; we update the iblock backend to set
this attribute if the underlying Linux block device has its nonrot
flag set.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Fix reporting of supported VPD pages
Roland Dreier [Tue, 5 Jul 2011 20:34:51 +0000 (13:34 -0700)]
target: Fix reporting of supported VPD pages

The current handling of VPD page 00h (Supported VPD Pages) for INQUIRY
commands has a couple of problems:

 - The page length field is incorrectly set to 3, so the entry for 86h
   (Extended INQUIRY Data) is ignored since it is in the fourth slot.
 - Even though the code handles pages B0h and B2h, those pages aren't
   mentioned in the Supported VPD Pages list, so eg the Linux SCSI stack
   won't actually try to use them.

Fix these problems and make things more robust to avoid future problems
by moving to a table of supported VPD pages, which means that any added
VPD page support will automatically get reported on page 0.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Allow for built-in target modules
Roland Dreier [Tue, 5 Jul 2011 20:34:50 +0000 (13:34 -0700)]
target: Allow for built-in target modules

In target_fabric_configfs_init(), we should allow fabric_mod to be NULL,
since THIS_MODULE is NULL for built-in modules.  The main method of
using the target code may be as modules, but having everything built-in
is useful eg to be able to do quick testing with "qemu -kernel".

In any case, we shouldn't bomb out fabric registration for a perfectly
valid configuration, so simply drop the check of fabric_mod.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotcm_fc: Convert to wake_up_process and schedule_timeout_interruptible
Nicholas Bellinger [Fri, 27 May 2011 20:58:48 +0000 (13:58 -0700)]
tcm_fc: Convert to wake_up_process and schedule_timeout_interruptible

This patch converts ft_queue_cmd() to use wake_up_process() and
ft_thread() to use schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT)
instead of wait_event_interruptible().  This fixes a potential race with
the wait_event_interruptible() conditional with qobj->queue_cnt in
ft_thread().

This patch also drops the unnecessary set_user_nice(current, -20) in
ft_thread(), and drops extra () around two if (!(acl)) conditionals in
tfc_conf.c.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotcm_fc: Makefile cleanups
Nicholas Bellinger [Fri, 27 May 2011 20:34:20 +0000 (13:34 -0700)]
tcm_fc: Makefile cleanups

This patch removes the unnecessary EXTRA_CFLAGS includes, and drops the
unused -DTCM_FC_DEBUG define.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agoloopback: Fix memory leak in tcm_loop_make_scsi_hba()
Jesper Juhl [Mon, 27 Jun 2011 22:30:17 +0000 (00:30 +0200)]
loopback: Fix memory leak in tcm_loop_make_scsi_hba()

There is a memory leak in tcm_loop_make_scsi_hba().

If all the strstr() calls return NULL and we end up at return ERR_PTR(-EINVAL);
then we'll be leaking the memory previously allocated to tl_hba as
that variable goes out of scope.

This patch should fix the leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoloopback: Remove duplicate scsi/scsi_tcq.h include
Jesper Juhl [Wed, 22 Jun 2011 08:55:50 +0000 (01:55 -0700)]
loopback: Remove duplicate scsi/scsi_tcq.h include

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agoloopback: off by one in tcm_loop_make_naa_tpg()
Dan Carpenter [Sat, 2 Apr 2011 21:32:47 +0000 (14:32 -0700)]
loopback: off by one in tcm_loop_make_naa_tpg()

This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result
in memory corruption.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget/iblock: Remove unused iblock_dev members
Roland Dreier [Tue, 5 Jul 2011 22:35:02 +0000 (15:35 -0700)]
target/iblock: Remove unused iblock_dev members

ibd_depth and ibd_force are used write-only.  Remove them.
ibd_major/minor can be easily retrieved from ibd_bd, so get
rid of them too.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget/iblock: Use request_queue->nr_request for se_device defaults
Nicholas Bellinger [Wed, 22 Jun 2011 08:32:20 +0000 (01:32 -0700)]
target/iblock: Use request_queue->nr_request for se_device defaults

This patch converts iblock_create_virtdevice() to use request_queue->nr_request
for se_dev_limits usage of ->hw_queue_depth and ->queue_depth for individual
struct se_device export.

It also removes the now unused defines for IBLOCK_DEVICE_QUEUE_DEPTH and
IBLOCK_MAX_DEVICE_QUEUE_DEPTH

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Make se_tmr_lock IRQ-safe
Roland Dreier [Wed, 20 Jul 2011 09:28:56 +0000 (09:28 +0000)]
target: Make se_tmr_lock IRQ-safe

transport_lookup_tmr_lun() can be called from interrupt context and
therefore needs to use IRQ-safe spinlock functions.  Fix this up, and
to make the locking work, convert the other uses of se_tmr_lock to be
IRQ-disabling.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Make se_dev_check_online() locking IRQ-safe
Roland Dreier [Tue, 14 Jun 2011 03:55:06 +0000 (20:55 -0700)]
target: Make se_dev_check_online() locking IRQ-safe

se_dev_check_online() is called from transport_lookup_cmd_lun(), which
as discussed before may be called from interrupt context.  So it needs
to use spin_lock_irqsave() instead of spin_lock_irq() to avoid
enabling interrupts at the wrong time.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Make transport_lookup_cmd_lun() locking IRQ-safe
Roland Dreier [Wed, 20 Jul 2011 09:09:10 +0000 (09:09 +0000)]
target: Make transport_lookup_cmd_lun() locking IRQ-safe

transport_lookup_cmd_lun() may be called from interrupt context (eg
tcm_loop_allocate_core_cmd() calls it, and it has a comment that says,
"Can be called from interrupt context"), so it needs to use
spin_lock_irqsave() instead of spin_lock_irq() to avoid enabling
interrupts at the wrong time.

(And indeed the last set of lock operations, on lun_cmd_lock, were
already using spin_lock_irqsave(), so we just need to fix the other
two locks we take)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Add SCF_EMULATE_QUEUE_FULL -> transport_handle_queue_full
Nicholas Bellinger [Mon, 13 Jun 2011 21:46:09 +0000 (14:46 -0700)]
target: Add SCF_EMULATE_QUEUE_FULL -> transport_handle_queue_full

This patch adds SCF_EMULATE_QUEUE_FULL support using -EAGAIN failures
via transport_handle_queue_full() to signal queue full in completion
path TFO->queue_data_in() and TFO->queue_status() callbacks.

This is done using a new se_cmd->transport_qf_callback() to handle
the following queue full exception cases within target core:

*) TRANSPORT_COMPLETE_OK (for completion path queue full)

*) TRANSPORT_COMPLETE_QF_WP (for TRANSPORT_WRITE_PENDING queue full)

*) transport_send_check_condition_and_sense() failure paths in
   transport_generic_request_failure() and transport_generic_complete_ok()

All logic is driven using se_device->qf_work_queue -> target_qf_do_work()
to to requeue outstanding se_cmd at the head of se_dev->queue_obj->qobj_list
for transport_processing_thread() execution.

Tested using tcm_qla2xxx with MAX_OUTSTANDING_COMMANDS=128 for FCP READ
to trigger the TRANSPORT_COMPLETE_OK queue full cases, and a simulated
TFO->write_pending() -EAGAIN failure to trigger TRANSPORT_COMPLETE_QF_WP.

Reported-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Add transport_handle_cdb_direct optimization
Nicholas Bellinger [Sat, 4 Jun 2011 03:59:19 +0000 (20:59 -0700)]
target: Add transport_handle_cdb_direct optimization

This patch adds a transport_handle_cdb_direct() optimization for mapping
and queueing tasks directly from within fabric processing context by calling
the newly exported transport_generic_new_cmd().  This currently expects to
be called from process context only, and will fail if called within interrupt
context.

This patch also leaves transport_generic_handle_cdb() unmodified for the
moment to function as expected with existing tcm_fc and ib_srpt fabrics,
and will be removed once these have been converted and tested with v4.1
code using transport_handle_cdb_direct().

Based on Andy's original patch here:

[PATCH 39/42] target: Call transport_new_cmd instead of adding to cmd queue

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: merge release_cmd methods
Christoph Hellwig [Wed, 1 Jun 2011 03:56:57 +0000 (23:56 -0400)]
target: merge release_cmd methods

The release_cmd_to_pool and release_cmd_direct methods are always the same.
Merge them into a single release_cmd method, and clean up the fallout.

(nab: fix breakage in transport_generic_free_cmd() parameter build breakage
 in drivers/target/tcm_fc/tfc_cmd.c)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: remove the unused SCF_* flags
Christoph Hellwig [Tue, 31 May 2011 21:06:43 +0000 (17:06 -0400)]
target: remove the unused SCF_* flags

This patch contains a squashed version to remove unused  SCF_* flags:

target: remove the unused SCF_SE_DISABLE_ONLINE_CHECK flag
target: remove the unused SCF_CMD_PASSTHROUGH_NOALLOC flag
target: remove the unused SCF_EMULATE_SYNC_UNMAP flag
target: remove the unused SCF_EMULATE_SYNC_CACHE flag

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: remove the always-noop ->new_cmd_failure method
Christoph Hellwig [Tue, 31 May 2011 21:06:42 +0000 (17:06 -0400)]
target: remove the always-noop ->new_cmd_failure method

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Updates from AGrover and HCH (round 3)
Andy Grover [Tue, 3 May 2011 00:12:10 +0000 (17:12 -0700)]
target: Updates from AGrover and HCH (round 3)

This patch contains a squashed version of third round series cleanups,
improvements ,and simplfications from Andy and Christoph ahead of the
heavy lifting between round 3 -> 4 for the target core SGL conversion.

This include cleanups to the main target I/O path and other miscellaneous
updates.

target: Replace custom sg<->buf functions with lib funcs
target: Simplify sector limiting code
target: get_cdb should never return NULL
target: Simplify transport_memcpy_se_mem_read_contig
target: Use assignment rather than increment for t_task_cdbs
target: Don't pass dma_size to generic_get_mem
target: Pass sg with type scatterlist in transport_map_sg_to_mem
target: Move task_sg_num next to task_sg in struct se_task
target: inline struct se_transport_task into struct se_cmd
target: Change name & semantics of transport_get_sectors()
target: Remove unused members of se_cmd
target: Rename se_cmd.t_task_cdbs to t_task_list_num
target: Fix some spelling
target: Remove unused var from transport_generic_do_tmr
target: map_sg_to_mem: return sg_count in return value
target/pscsi: Use min_t for sector limits
target/pscsi: Unused param for pscsi_get_bio()
target: Rename get_cdb_count to allocate_tasks
target: Make transport_generic_new_cmd() available for iscsi-target
target: Remove fabric callback to allocate iovecs
target: Fix transport_generic_new_cmd WRITE comment

(hch: Use __GFP_ZERO usage for alloc_pages() usage)

Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Fix WRITE_SAME_[16,32] number of blocks=0 case
Nicholas Bellinger [Sat, 7 May 2011 00:55:35 +0000 (17:55 -0700)]
target: Fix WRITE_SAME_[16,32] number of blocks=0 case

This patch fixes the handling of WRITE_SAME_[16,32] emulation where a
WRITE_SAME_* CDB with number of blocks=0 was being rejected by SCSI
expected data transfer length overflow checking in target core.

It changes both CDB cases in transport_generic_cmd_sequencer() to use
dev->se_sub_dev->se_dev_attrib.block_size to match what sg_write_same
is sending us with --num=0.  It also fixes target_emulate_write_same()
to properly determine the num_blocks with --num=0 case to determine the
remaining range for dev->transport->do_discard().

Reported-by: Chris Greiveldinger <chris.greiveldinger@rnanetworks.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget: Fix WRITE_SAME_16 t_task_lba assignment bug
Nicholas Bellinger [Tue, 3 May 2011 21:23:54 +0000 (14:23 -0700)]
target: Fix WRITE_SAME_16 t_task_lba assignment bug

This patch fixes a bug in the assignment of cmd->t_task.t_task_lba with
WRITE_SAME_16 to correctly use get_unaligned_be64() for the 64-bit LBA.

Reported-by: Chris Greiveldinger <chris.greiveldinger@rnanetworks.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget: More core cleanups from AGrover (round 2)
Andy Grover [Tue, 19 Jul 2011 10:26:37 +0000 (10:26 +0000)]
target: More core cleanups from AGrover (round 2)

This patch contains the squashed version of second round of target core
cleanups and simplifications and Andy and Co.   It also contains a handful
of fixes to address bugs the original series and other minor cleanups.

Here is the condensed shortlog:

target: Remove unneeded casts to void*
target: Rename get_lun_for_{cmd,tmr} to lookup_{cmd,tmr}_lun
target: Make t_task a member of se_cmd, not a pointer
target: Handle functions returning "-2"
target: Use cmd->se_dev over cmd->se_lun->lun_se_dev
target: Embed qr in struct se_cmd
target: Replace embedded struct se_queue_req with a list_head
target: Rename list_heads that are nodes in struct se_cmd to "*_node"
target: Fold transport_device_setup_cmd() into lookup_{tmr,cmd}_lun()
target: Make t_mem_list and t_mem_list_bidi members of t_task
target: Add comment & cleanup transport_map_sg_to_mem()
target: Remove unneeded checks in transport_free_pages()

(Roland: Fix se_queue_req removal leftovers OOPs)
(nab: Fix transport_lookup_tmr_lun failure case)
(nab: Fix list_empty(&cmd->t_task.t_mem_bidi_list) inversion bugs)

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Fix double test of inquiry_prod
Roland Dreier [Tue, 3 May 2011 05:15:37 +0000 (22:15 -0700)]
target: Fix double test of inquiry_prod

The code in transport_add_device_to_core_hba() really intends to make sure
that neither inquiry_prod nor inquiry_rev is NULL.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget: Core cleanups from AGrover (round 1)
Andy Grover [Tue, 19 Jul 2011 08:55:10 +0000 (08:55 +0000)]
target: Core cleanups from AGrover (round 1)

This patch contains the squashed version of a number of cleanups and
minor fixes from Andy's initial series (round 1) for target core this
past spring.  The condensed log looks like:

target: use errno values instead of returning -1 for everything
target: Rename transport_calc_sg_num to transport_init_task_sg
target: Fix leak in error path in transport_init_task_sg
target/pscsi: Remove pscsi_get_sh() usage
target: Make two runtime checks into WARN_ONs
target: Remove hba queue depth and convert to spin_lock_irq usage
target: dev->dev_status_queue_obj is unused
target: Make struct se_queue_req.cmd type struct se_cmd *
target: Remove __transport_get_qr_from_queue()
target: Rename se_dev->g_se_dev_list to se_dev_node
target: Remove struct se_global
target: Simplify scsi mib index table code
target: Make dev_queue_obj a member of se_device instead of a pointer
target: remove extraneous returns at end of void functions
target: Ensure transport_dump_vpd_ident_type returns null-terminated str
target: Function pointers don't need to use '&' to be assigned
target: Fix comment in __transport_execute_tasks()
target: Misc style cleanups
target: rename struct pr_reservation_template to pr_reservation
target: Remove #defines that just perform indirection
target: Inline transport_get_task_from_execute_queue()
target: Minor header comment fixes

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 years agotarget: Remove unused su_group usage in fabric register/dergister
Nicholas Bellinger [Sun, 6 Mar 2011 19:49:36 +0000 (11:49 -0800)]
target: Remove unused su_group usage in fabric register/dergister

This patch removes two instances of left over v3.x code performing local
scope access to struct target_core_fabric_ops->tf_subsys->su_group in
target_fabric_configfs_register() and target_fabric_configfs_deregister().

Reported-by: Christophe Fergeau <cfergeau@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget: Remove unnecessary *cdb transport_get_lun_for_cmd parameter
Nicholas Bellinger [Tue, 19 Jul 2011 08:09:01 +0000 (08:09 +0000)]
target: Remove unnecessary *cdb transport_get_lun_for_cmd parameter

This patch removes the now unnecessary 'unsigned char *cdb' function
parameter from transport_get_lun_for_cmd().  This also includes updating
lio-target, tcm_loop and tcm_fc usage of transport_get_lun_for_cmd().

Reported-by: Fubo Chen <fubo.chen@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget: use MAINTENANCE_IN and MAINTENANCE_OUT definitions in scsi.h
Nicholas Bellinger [Mon, 21 Feb 2011 07:49:26 +0000 (07:49 +0000)]
target: use MAINTENANCE_IN and MAINTENANCE_OUT definitions in scsi.h

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agotarget: Check LUN numbers in transport_get_lun_for_[cmd,tmr]
Fubo Chen [Sun, 13 Feb 2011 23:13:42 +0000 (15:13 -0800)]
target: Check LUN numbers in transport_get_lun_for_[cmd,tmr]

This patch checks the passed 'unpacked_lun' against TRANSPORT_MAX_LUNS_PER_TPG
before reading from struct se_node_acl->device_list[].

Signed-off-by: Fubo Chen <fubo.chen@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
13 years agomips: Fix i8253 clockevent fallout
Thomas Gleixner [Fri, 22 Jul 2011 09:17:11 +0000 (11:17 +0200)]
mips: Fix i8253 clockevent fallout

pit_clockevent wants to replaced in the argument of the callback
function as well.

Reported-by; Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
13 years agoslab: fix DEBUG_SLAB warning
Tetsuo Handa [Thu, 21 Jul 2011 00:42:45 +0000 (09:42 +0900)]
slab: fix DEBUG_SLAB warning

In commit c225150b "slab: fix DEBUG_SLAB build",
"if ((unsigned long)objp & (ARCH_SLAB_MINALIGN-1))" is always true if
ARCH_SLAB_MINALIGN == 0. Do not print warning if ARCH_SLAB_MINALIGN == 0.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoMAINTAINERS: change e-mail of Adrian Hunter
Artem Bityutskiy [Fri, 22 Jul 2011 07:55:50 +0000 (10:55 +0300)]
MAINTAINERS: change e-mail of Adrian Hunter

... he does not work in Nokia any longer.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
13 years agoMerge branch 'topic/hda' into for-linus
Takashi Iwai [Fri, 22 Jul 2011 06:43:27 +0000 (08:43 +0200)]
Merge branch 'topic/hda' into for-linus

13 years agoMerge branch 'topic/misc' into for-linus
Takashi Iwai [Fri, 22 Jul 2011 06:43:24 +0000 (08:43 +0200)]
Merge branch 'topic/misc' into for-linus

13 years agoMerge branch 'topic/asoc' into for-linus
Takashi Iwai [Fri, 22 Jul 2011 06:43:19 +0000 (08:43 +0200)]
Merge branch 'topic/asoc' into for-linus

13 years agoMerge branch 'vhost-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mst...
David S. Miller [Fri, 22 Jul 2011 06:36:41 +0000 (23:36 -0700)]
Merge branch 'vhost-net-next' of git://git./linux/kernel/git/mst/vhost

13 years agonet: Fix ppc64 BPF JIT dependencies.
David S. Miller [Fri, 22 Jul 2011 06:26:13 +0000 (23:26 -0700)]
net: Fix ppc64 BPF JIT dependencies.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoacenic: include NET_SKB_PAD headroom to incoming skbs
Eric Dumazet [Fri, 22 Jul 2011 06:24:52 +0000 (23:24 -0700)]
acenic: include NET_SKB_PAD headroom to incoming skbs

Some workloads need some headroom (NET_SKB_PAD) to avoid expensive
reallocations.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Fri, 22 Jul 2011 06:18:00 +0000 (23:18 -0700)]
Merge branch 'master' of /linux/kernel/git/jkirsher/net-next-2.6

13 years agoALSA: asihpi - Replace with snd_ctl_boolean_mono_info()
Takashi Iwai [Fri, 22 Jul 2011 05:57:44 +0000 (07:57 +0200)]
ALSA: asihpi - Replace with snd_ctl_boolean_mono_info()

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoixgbe: convert to ndo_fix_features
Don Skidmore [Thu, 21 Jul 2011 05:55:00 +0000 (05:55 +0000)]
ixgbe: convert to ndo_fix_features

Private rx_csum flags are now duplicate of netdev->features &
NETIF_F_RXCSUM.  We remove those duplicates and now use the net_device_ops
ndo_set_features.  This was based on the original patch submitted by
Michal Miroslaw <mirq-linux@rere.qmqm.pl>.  I also removed the special
case not requiring a reset for X540 hardware.  It is needed just as it is
in 82599 hardware.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Cc: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: only enable WoL for magic packet by default
Andy Gospodarek [Sat, 16 Jul 2011 07:31:33 +0000 (07:31 +0000)]
ixgbe: only enable WoL for magic packet by default

Martin Wilck <martin.wilck@ts.fujitsu.com> reported that systems using
the ixgbe-driver that were capable of WoL were rebooting almost as soon
as they were shut down.  This is because the default WoL settings
enabled magic packet, broadcast, unicast, and multicast.

Other Intel devices seem to use the stored eeprom value for initial WoL
capabilities.  The 82578DM (e1000e) and 82576 (igb) the devices I looked
at had only the magic packet enabled in the eeprom, so that seems
appropriate on ixgbe-based devices as well.  I set the WoL options on my
82578DM to be the same default as the ixgbe devices (umbg) and saw the
same as Martin -- almost as soon as my box shutdown, it booted again.

This patch changes the default to only be the magic packet.  This is the
same as the default for most Intel and non-Intel hardware currently
upstream.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
CC: Martin Wilck <martin.wilck@ts.fujitsu.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: remove ifdef check for non-existent define
Emil Tantilov [Tue, 12 Jul 2011 08:13:41 +0000 (08:13 +0000)]
ixgbe: remove ifdef check for non-existent define

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: Pass staterr instead of re-reading status and error bits from descriptor
Alexander Duyck [Sat, 11 Jun 2011 01:45:13 +0000 (01:45 +0000)]
ixgbe: Pass staterr instead of re-reading status and error bits from descriptor

This change is meant to address possible race conditions from the status
and error bits on the RX descriptors being re-read by multiple functions in
the RX cleanup path.  To resolve this I have added code that will pass the
staterr value to those functions.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: Move interrupt related values out of ring and into q_vector
Alexander Duyck [Sat, 11 Jun 2011 01:45:08 +0000 (01:45 +0000)]
ixgbe: Move interrupt related values out of ring and into q_vector

This change moves work_limit, total_packets, and total_bytes into the ring
container struct of the q_vector.  The advantage of this is that it should
reduce the size of memory used in the event of multiple rings being
assigned to a single q_vector.  In addition it should help to reduce the
total workload for calculating itr since now total_packets and total_bytes
will be the total work done of the interrupt instead of for the ring.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: add structure for containing RX/TX rings to q_vector
Alexander Duyck [Sat, 11 Jun 2011 01:45:03 +0000 (01:45 +0000)]
ixgbe: add structure for containing RX/TX rings to q_vector

This patch adds support for a ring container structure to be used within
the q_vector.  The basic idea is to provide a means of separating the RX
and TX rings while maintaining a common structure for their containment.
The advantage to this is that later we should be able to pass this
structure to the update_itr functions without needing to pass individual
rings.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agomlx4_core: Bump the driver version to 1.0
Dotan Barak [Thu, 14 Jul 2011 14:36:42 +0000 (14:36 +0000)]
mlx4_core: Bump the driver version to 1.0

Many features were added to this driver, so the driver version should change too.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
13 years agoALSA: asihpi - HPI version 4.08
Eliot Blennerhassett [Fri, 22 Jul 2011 03:53:04 +0000 (15:53 +1200)]
ALSA: asihpi - HPI version 4.08

HPI Version is used to check for firmware compatibility.
This version  will accept 4.08.xx released firmware,
and will also accept 4.09.xx beta firmware

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoixgbe: inline the ixgbe_maybe_stop_tx function
Alexander Duyck [Sat, 11 Jun 2011 01:44:58 +0000 (01:44 +0000)]
ixgbe: inline the ixgbe_maybe_stop_tx function

The ixgbe_maybe_stop_tx function is only a few lines long and is called
multiple times through the xmit hotpath.  In order to streamline things it
makes sense to just inline it.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoALSA: asihpi - Add volume mute controls
Eliot Blennerhassett [Fri, 22 Jul 2011 03:53:03 +0000 (15:53 +1200)]
ALSA: asihpi - Add volume mute controls

Mute functionality was recently added to the DSP firmware

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoixgbe: Update ATR to use recorded TX queues instead of CPU for routing
Alexander Duyck [Sat, 11 Jun 2011 01:44:53 +0000 (01:44 +0000)]
ixgbe: Update ATR to use recorded TX queues instead of CPU for routing

This change is meant to update ATR so that it will use the recorded RX
queue instead of the CPU in the case of routing.  This change is meant to
help ixgbe default behavior to more closely match that of the kernel.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigb: Fix for DH89xxCC near end loopback test
Robert Healy [Tue, 12 Jul 2011 08:46:20 +0000 (08:46 +0000)]
igb: Fix for DH89xxCC near end loopback test

On this chipset it is required to configure the MPHY block for loopback tests. If MPHY is not configured then all loopback tests will report failures.

Signed-off-by: Robert Healy <robert.healy@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoALSA: asihpi - Control name updates
Eliot Blennerhassett [Fri, 22 Jul 2011 03:53:00 +0000 (15:53 +1200)]
ALSA: asihpi - Control name updates

Add names corresponding to new HPI node types.
Shorten some names so that constructed names don't overflow the
maximum name length.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoe1000: always call e1000_check_for_link() on e1000_ce4100 MACs.
Nicolas Schichan [Sat, 9 Jul 2011 00:24:18 +0000 (00:24 +0000)]
e1000: always call e1000_check_for_link() on e1000_ce4100 MACs.

Interrupts about link lost or rx sequence errors are not reported by
the ce4100 hardware, leading to transitions from link UP to link DOWN
never being reported.

Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoALSA: asihpi - Use size_t for sizeof result
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:58 +0000 (15:52 +1200)]
ALSA: asihpi - Use size_t for sizeof result

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Explicitly include mutex.h
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:56 +0000 (15:52 +1200)]
ALSA: asihpi - Explicitly include mutex.h

Because mutex is used in adapter struct defined here.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Add new node and message defines
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:55 +0000 (15:52 +1200)]
ALSA: asihpi - Add new node and message defines

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Make local function static
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:52 +0000 (15:52 +1200)]
ALSA: asihpi - Make local function static

Fixes a sparse warning.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Fix minor typos and spelling
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:50 +0000 (15:52 +1200)]
ALSA: asihpi - Fix minor typos and spelling

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Remove unused structures, macros and functions
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:48 +0000 (15:52 +1200)]
ALSA: asihpi - Remove unused structures, macros and functions

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Remove spurious adapter index check
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:46 +0000 (15:52 +1200)]
ALSA: asihpi - Remove spurious adapter index check

Subsystem requests don't have or need a valid adapter index.
The adapter index is already checked further on, before it is used to index
the adapters array. (Reverts 4a122c10f)

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:44 +0000 (15:52 +1200)]
ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro

Work towards moving the function into alsa common header.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - DSP code loader API now independent of OS
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:42 +0000 (15:52 +1200)]
ALSA: asihpi - DSP code loader API now independent of OS

The loader API has been revised so that OS specific data is kept
local to hpidspcd.c, and the public API is unchanged across OSes.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Remove controlex structs and associated special data transfer code
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:40 +0000 (15:52 +1200)]
ALSA: asihpi - Remove controlex structs and associated special data transfer code

Some cobranet control data would not fit in an original HPI message.
Now that HPI is able to transfer larger messages, this special handling
is no longer required.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Increase request and response buffer sizes
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:38 +0000 (15:52 +1200)]
ALSA: asihpi - Increase request and response buffer sizes

Allow for up to 256 bytes of extra data on top of standard hpi
request and response sizes.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoALSA: asihpi - Give more meaningful name to hpi request message type
Eliot Blennerhassett [Fri, 22 Jul 2011 03:52:36 +0000 (15:52 +1200)]
ALSA: asihpi - Give more meaningful name to hpi request message type

Having a 'request message' makes more sense than a 'message message'

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agolguest: Fix in/out emulation
Rusty Russell [Fri, 22 Jul 2011 05:09:51 +0000 (14:39 +0930)]
lguest: Fix in/out emulation

We were blatting too much of the register.  Linux didn't care, but in
theory it might.

Reported-by: Jonas Maebe <jonas.maebe@elis.ugent.be>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: Fix translation count about wikipedia's cpuid page
Adrian Knoth [Mon, 11 Jul 2011 16:08:47 +0000 (18:08 +0200)]
lguest: Fix translation count about wikipedia's cpuid page

The comment is outdated, wikipedia now has six translations of the cpuid
page.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: Fix three simple typos in comments
Adrian Knoth [Mon, 11 Jul 2011 16:07:14 +0000 (18:07 +0200)]
lguest: Fix three simple typos in comments

This patch fixes three typos I've accidentally spotted.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (one was already fixed)
13 years agolguest: update comments
Rusty Russell [Fri, 22 Jul 2011 05:09:50 +0000 (14:39 +0930)]
lguest: update comments

Also removes a long-unused #define and an extraneous semicolon.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: Simplify device initialization.
Rusty Russell [Fri, 22 Jul 2011 05:09:49 +0000 (14:39 +0930)]
lguest: Simplify device initialization.

We used to notify the Host every time we updated a device's status.  However,
it only really needs to know when we're resetting the device, or failed to
initialize it, or when we've finished our feature negotiation.

In particular, we used to wait for VIRTIO_CONFIG_S_DRIVER_OK in the
status byte before starting the device service threads.  But this
corresponds to the successful finish of device initialization, which
might (like virtio_blk's partition scanning) use the device.  So we
had a hack, if they used the device before we expected we started the
threads anyway.

Now we hook into the finalize_features hook in the Guest: at that
point we tell the Launcher that it can rely on the features we have
acked.  On the Launcher side, we look at the status at that point, and
start servicing the device.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: don't rewrite vmcall instructions
Rusty Russell [Fri, 22 Jul 2011 05:09:49 +0000 (14:39 +0930)]
lguest: don't rewrite vmcall instructions

Now we no longer use vmcall, we don't need to rewrite it in the Guest.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: remove remaining vmcall
Rusty Russell [Fri, 22 Jul 2011 05:09:49 +0000 (14:39 +0930)]
lguest: remove remaining vmcall

We switch back from using vmcall in 091ebf07a2408f9a56634caa0f86d9360e9af23b
because it was unreliable under kvm, but I missed one (rarely-used) place.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: use a special 1:1 linear pagetable mode until first switch.
Rusty Russell [Fri, 22 Jul 2011 05:09:48 +0000 (14:39 +0930)]
lguest: use a special 1:1 linear pagetable mode until first switch.

The Host used to create some page tables for the Guest to use at the
top of Guest memory; it would then tell the Guest where this was.  In
particular, it created linear mappings for 0 and 0xC0000000 addresses
because lguest used to switch to its real page tables quite late in
boot.

However, since d50d8fe19 Linux initialized boot page tables in
head_32.S even before the "are we lguest?" boot jump.  So, now we can
simplify things: the Host pagetable code assumes 1:1 linear mapping
until it first calls the LHCALL_NEW_PGTABLE hypercall, which we now do
before we reach C code.

This also means that the Host doesn't need to know anything about the
Guest's PAGE_OFFSET.  (Non-Linux guests might not even have such a
thing).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agolguest: Do not exit on non-fatal errors
Sakari Ailus [Sun, 26 Jun 2011 16:36:46 +0000 (19:36 +0300)]
lguest: Do not exit on non-fatal errors

Do not exit on some non-fatal errors:

- writev() fails in net_output(). The result is a lost packet or packets.
- writev() fails in console_output(). The result is partially lost console
output.
- readv() fails in net_input(). The result is a lost packet or packets.

Rather than bringing the guest down, this patch ignores e.g. an allocation
failure on the host side. Example:

lguest: page allocation failure. order:4, mode:0x4d0
Pid: 4045, comm: lguest Tainted: G        W   2.6.36 #1
Call Trace:
 [<c138d614>] ? printk+0x18/0x1c
 [<c106a4e2>] __alloc_pages_nodemask+0x4d2/0x570
 [<c1087954>] cache_alloc_refill+0x2a4/0x4d0
 [<c1305149>] ? __netif_receive_skb+0x189/0x270
 [<c1087c5a>] __kmalloc+0xda/0xf0
 [<c12fffa5>] __alloc_skb+0x55/0x100
 [<c1305519>] ? net_rx_action+0x79/0x100
 [<c12fafed>] sock_alloc_send_pskb+0x18d/0x280
 [<c11fda25>] ? _copy_from_user+0x35/0x130
 [<c13010b6>] ? memcpy_fromiovecend+0x56/0x80
 [<c12a74dc>] tun_chr_aio_write+0x1cc/0x500
 [<c108a125>] do_sync_readv_writev+0x95/0xd0
 [<c11fda25>] ? _copy_from_user+0x35/0x130
 [<c1089fa8>] ? rw_copy_check_uvector+0x58/0x100
 [<c108a7bc>] do_readv_writev+0x9c/0x1d0
 [<c12a7310>] ? tun_chr_aio_write+0x0/0x500
 [<c108a93a>] vfs_writev+0x4a/0x60
 [<c108aa21>] sys_writev+0x41/0x80
 [<c138f061>] syscall_call+0x7/0xb
Mem-Info:
DMA per-cpu:
CPU    0: hi:    0, btch:   1 usd:   0
Normal per-cpu:
CPU    0: hi:  186, btch:  31 usd:   0
HighMem per-cpu:
CPU    0: hi:  186, btch:  31 usd:   0
active_anon:134651 inactive_anon:50543 isolated_anon:0
 active_file:96881 inactive_file:132007 isolated_file:0
 unevictable:0 dirty:3 writeback:0 unstable:0
 free:91374 slab_reclaimable:6300 slab_unreclaimable:2802
 mapped:2281 shmem:9 pagetables:330 bounce:0
DMA free:3524kB min:64kB low:80kB high:96kB active_anon:0kB inactive_anon:8kB active_file:8760kB inactive_file:2760kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15868kB mlocked:0kB dirty:0kB writeback:0kB mapped:16kB shmem:0kB slab_reclaimable:88kB slab_unreclaimable:148kB kernel_stack:40kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 865 2016 2016
Normal free:150100kB min:3728kB low:4660kB high:5592kB active_anon:6224kB inactive_anon:15772kB active_file:324084kB inactive_file:325944kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:885944kB mlocked:0kB dirty:12kB writeback:0kB mapped:1520kB shmem:0kB slab_reclaimable:25112kB slab_unreclaimable:11060kB kernel_stack:1888kB pagetables:1320kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 9207 9207
HighMem free:211872kB min:512kB low:1752kB high:2992kB active_anon:532380kB inactive_anon:186392kB active_file:54680kB inactive_file:199324kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:1178504kB mlocked:0kB dirty:0kB writeback:0kB mapped:7588kB shmem:36kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
DMA: 3*4kB 65*8kB 35*16kB 18*32kB 11*64kB 9*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 3524kB
Normal: 35981*4kB 344*8kB 158*16kB 28*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 150100kB
HighMem: 5732*4kB 5462*8kB 2826*16kB 1598*32kB 84*64kB 10*128kB 7*256kB 1*512kB 1*1024kB 1*2048kB 9*4096kB = 211872kB
231237 total pagecache pages
2340 pages in swap cache
Swap cache stats: add 160060, delete 157720, find 189017/194106
Free swap  = 4179840kB
Total swap = 4194300kB
524271 pages RAM
296946 pages HighMem
5668 pages reserved
867664 pages shared
82155 pages non-shared

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
13 years agonetxen: add fw version compatibility check
Amit Kumar Salecha [Wed, 20 Jul 2011 00:08:53 +0000 (00:08 +0000)]
netxen: add fw version compatibility check

o Minimum fw version supported for P3 chip is 4.0.505
o File Fw > 4.0.554 is not supported if flash fw < 4.0.554.
o In mn firmware case, file fw older than flash fw is allowed.
o Change variable names for readability
o Update driver version 4.0.76

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: request native mode each time the card is reset
Sathya Perla [Tue, 19 Jul 2011 19:52:33 +0000 (19:52 +0000)]
be2net: request native mode each time the card is reset

Currently be3-native mode is requested only in probe(). It must be requested, each time the card is reset either after an EEH error or after
sleep/hibernation.
Also, the be_cmd_check_native_mode() is better named be_cmd_req_native_mode()

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Constrain UFO fragment sizes to multiples of 8 bytes
Bill Sommerfeld [Tue, 19 Jul 2011 15:22:33 +0000 (15:22 +0000)]
ipv4: Constrain UFO fragment sizes to multiples of 8 bytes

Because the ip fragment offset field counts 8-byte chunks, ip
fragments other than the last must contain a multiple of 8 bytes of
payload.  ip_ufo_append_data wasn't respecting this constraint and,
depending on the MTU and ip option sizes, could create malformed
non-final fragments.

Google-Bug-Id: 5009328
Signed-off-by: Bill Sommerfeld <wsommerfeld@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovirtio_net: Fix panic in virtnet_remove
Krishna Kumar [Wed, 20 Jul 2011 03:56:02 +0000 (03:56 +0000)]
virtio_net: Fix panic in virtnet_remove

Fix a panic in virtnet_remove. unregister_netdev has already
freed up the netdev (and virtnet_info) due to dev->destructor
being set, while virtnet_info is still required. Remove
virtnet_free altogether, and move the freeing of the per-cpu
statistics from virtnet_free to virtnet_remove.

Tested patch below.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: make fragment identifications less predictable
Eric Dumazet [Fri, 22 Jul 2011 04:25:58 +0000 (21:25 -0700)]
ipv6: make fragment identifications less predictable

IPv6 fragment identification generation is way beyond what we use for
IPv4 : It uses a single generator. Its not scalable and allows DOS
attacks.

Now inetpeer is IPv6 aware, we can use it to provide a more secure and
scalable frag ident generator (per destination, instead of system wide)

This patch :
1) defines a new secure_ipv6_id() helper
2) extends inet_getid() to provide 32bit results
3) extends ipv6_select_ident() with a new dest parameter

Reported-by: Fernando Gont <fernando@gont.com.ar>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: unshare inetpeers
Eric Dumazet [Tue, 19 Jul 2011 20:18:36 +0000 (20:18 +0000)]
ipv6: unshare inetpeers

We currently cow metrics a bit too soon in IPv6 case : All routes are
tied to a single inetpeer entry.

Change ip6_rt_copy() to get destination address as second argument, so
that we fill rt6i_dst before the dst_copy_metrics() call.

icmp6_dst_alloc() must set rt6i_dst before calling dst_metric_set(), or
else the cow is done while rt6i_dst is still NULL.

If orig route points to readonly metrics, we can share the pointer
instead of performing the memory allocation and copy.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: make function can_get_bittiming static
Thadeu Lima de Souza Cascardo [Thu, 21 Jul 2011 16:22:31 +0000 (16:22 +0000)]
can: make function can_get_bittiming static

The function can_get_bittiming is not used anywhere else, so it should be
static.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Kobj and queues_kset should be used when CONFIG_XPS is enabled
Choi, Jong-Hwan [Wed, 20 Jul 2011 20:33:03 +0000 (20:33 +0000)]
net: Kobj and queues_kset should be used when CONFIG_XPS is enabled

Kobj and queues_kset are used with CONFIG_XPS=y.

Signed-off-by: Choi, Jong-Hwan <jhbird.choi@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovmxnet3: fix publicity of NETIF_F_HIGHDMA
Shreyas Bhatewara [Wed, 20 Jul 2011 17:21:51 +0000 (17:21 +0000)]
vmxnet3: fix publicity of NETIF_F_HIGHDMA

NETIF_F_HIGHDMA is being disabled even when dma64 is true. This patch fixes it.

CC: Michal Miroslaw <mirq-linux@rere.qmqm.pl>
Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovmxnet3: set netdev parant device before calling netdev_info
Shreyas Bhatewara [Wed, 20 Jul 2011 16:01:11 +0000 (16:01 +0000)]
vmxnet3: set netdev parant device before calling netdev_info

Parent device for netdev should be set before netdev_info() can be called
otherwise there is a NULL pointer dereference and probe() fails.

Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Signed-off-by: Scott J. Goldman <scottjg@vmware.com>--
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoASIX: Add AX88772B USB ID
Marek Vasut [Wed, 20 Jul 2011 05:57:04 +0000 (05:57 +0000)]
ASIX: Add AX88772B USB ID

This device can be found in Acer Iconia TAB W500 tablet dock.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 22 Jul 2011 03:21:27 +0000 (20:21 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

13 years agoLinux 3.0
Linus Torvalds [Fri, 22 Jul 2011 02:17:23 +0000 (19:17 -0700)]
Linux 3.0

13 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
Linus Torvalds [Fri, 22 Jul 2011 00:20:57 +0000 (17:20 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  sparc,kgdbts: fix compile regression with kgdb test suite

13 years agosparc,kgdbts: fix compile regression with kgdb test suite
Jason Wessel [Tue, 19 Jul 2011 20:43:16 +0000 (15:43 -0500)]
sparc,kgdbts: fix compile regression with kgdb test suite

Commit 63ab25ebbc (kgdbts: unify/generalize gdb breakpoint adjustment)
introduced a compile regression on sparc.

kgdbts.c: In function 'check_and_rewind_pc':
kgdbts.c:307: error: implicit declaration of function 'instruction_pointer_set'

Simply add the correct macro definition for instruction pointer on the
Sparc architecture.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: David S. Miller <davem@davemloft.net>