1. 26 7月, 2011 2 次提交
  2. 24 7月, 2011 6 次提交
    • K
      module: add /sys/module/<name>/uevent files · 88bfa324
      Kay Sievers 提交于
      Userspace wants to manage module parameters with udev rules.
      This currently only works for loaded modules, but not for
      built-in ones.
      
      To allow access to the built-in modules we need to
      re-trigger all module load events that happened before any
      userspace was running. We already do the same thing for all
      devices, subsystems(buses) and drivers.
      
      This adds the currently missing /sys/module/<name>/uevent files
      to all module entries.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (split & trivial fix)
      88bfa324
    • K
      module: change attr callbacks to take struct module_kobject · 4befb026
      Kay Sievers 提交于
      This simplifies the next patch, where we have an attribute on a
      builtin module (ie. module == NULL).
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (split into 2)
      4befb026
    • J
      modules: add default loader hook implementations · 74e08fcf
      Jonas Bonn 提交于
      The module loader code allows architectures to hook into the code by
      providing a small number of entry points that each arch must implement.
      This patch provides __weakly linked generic implementations of these
      entry points for architectures that don't need to do anything special.
      Signed-off-by: NJonas Bonn <jonas@southpole.se>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      74e08fcf
    • X
      KVM: MMU: filter out the mmio pfn from the fault pfn · fce92dce
      Xiao Guangrong 提交于
      If the page fault is caused by mmio, the gfn can not be found in memslots, and
      'bad_pfn' is returned on gfn_to_hva path, so we can use 'bad_pfn' to identify
      the mmio page fault.
      And, to clarify the meaning of mmio pfn, we return fault page instead of bad
      page when the gfn is not allowd to prefetch
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      fce92dce
    • J
      ata: Add and use ata_print_version_once · 06296a1e
      Joe Perches 提交于
      Use a single mechanism to show driver version.
      Reduces text a tiny bit too.
      
      Remove uses of static int printed_version
      Add and use ata_print_version(const struct device *, const char *ver)
      and ata_print_version_once.
      
      $ size drivers/ata/built-in.*
         text	   data	    bss	    dec	    hex	filename
       544969	  73893	 116584	 735446	  b38d6	drivers/ata/built-in.allyesconfig.ata.o
       543870	  73893	 116592	 734355	  b34ad	drivers/ata/built-in.allyesconfig.print_once.o
       141328	  14689	   4220	 160237	  271ed	drivers/ata/built-in.defconfig.ata.o
       141212	  14689	   4220	 160121	  27179	drivers/ata/built-in.defconfig.print_once.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      06296a1e
    • J
      ata: Convert ata_<foo>_printk(KERN_<LEVEL> to ata_<foo>_<level> · a9a79dfe
      Joe Perches 提交于
      Saves text by removing nearly duplicated text format strings by
      creating ata_<foo>_printk functions and printf extension %pV.
      
      ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)
      
      Format string duplication comes from:
      
       #define ata_link_printk(link, lv, fmt, args...) do { \
             if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link)    \
                     printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id,   \
                            (link)->pmp , ##args); \
             else \
                     printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
             } while(0)
      
      Coalesce long formats.
      
      $ size drivers/ata/built-in.*
         text	   data	    bss	    dec	    hex	filename
       544969	  73893	 116584	 735446	  b38d6	drivers/ata/built-in.allyesconfig.ata.o
       558429	  73893	 117864	 750186	  b726a	drivers/ata/built-in.allyesconfig.dev_level.o
       141328	  14689	   4220	 160237	  271ed	drivers/ata/built-in.defconfig.ata.o
       149567	  14689	   4220	 168476	  2921c	drivers/ata/built-in.defconfig.dev_level.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      a9a79dfe
  3. 23 7月, 2011 12 次提交
  4. 22 7月, 2011 20 次提交
    • R
      bcma: inform drivers about translation bits needed for the core · 05aec233
      Rafał Miłecki 提交于
      When using DMA, drivers need to pass special translation info to the
      hardware.
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      05aec233
    • N
      target: Bump version to v4.1.0-rc1-ml · fa495159
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      fa495159
    • A
      target: remove custom hex2bin() implementation · 11650b85
      Andy Shevchenko 提交于
      This patch drops transport_asciihex_to_binaryhex() in favor of proper
      hex2bin usage from include/linux/kernel.h:hex2bin()
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      11650b85
    • N
      target: Update QUEUE ALGORITHM MODIFIER control page default · 5de619a3
      Nicholas Bellinger 提交于
      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: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      5de619a3
    • N
      target: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG · 1d20bb61
      Nicholas Bellinger 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1d20bb61
    • A
      target: Follow up core updates from AGrover and HCH (round 4) · 6708bb27
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6708bb27
    • A
      target: Eliminate usage of struct se_mem · ec98f782
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      ec98f782
    • A
      target: Pass 2nd param of transport_split_cdb by value · 3a867205
      Andy Grover 提交于
      Since sectors is not modified, it's more straightforward to do this.
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3a867205
    • A
      target: Enforce 1 page max for control cdb buffer sizes · d0229ae3
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d0229ae3
    • A
      target: Make all control CDBs scatter-gather · 05d1c7c0
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      05d1c7c0
    • R
      target: Implement Block Device Characteristics VPD page · e22a7f07
      Roland Dreier 提交于
      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: NRoland Dreier <roland@purestorage.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e22a7f07
    • N
      target: Add SCF_EMULATE_QUEUE_FULL -> transport_handle_queue_full · 07bde79a
      Nicholas Bellinger 提交于
      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: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      07bde79a
    • N
      target: Add transport_handle_cdb_direct optimization · 695434e1
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@linux-iscsi.org>
      695434e1
    • C
      target: merge release_cmd methods · 35462975
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      35462975
    • C
      target: remove the unused SCF_* flags · db1620a2
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      db1620a2
    • C
    • A
      target: Updates from AGrover and HCH (round 3) · a1d8b49a
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      a1d8b49a
    • A
      target: More core cleanups from AGrover (round 2) · 5951146d
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5951146d
    • A
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e3d6f909
    • N
      target: Remove unnecessary *cdb transport_get_lun_for_cmd parameter · efa4988d
      Nicholas Bellinger 提交于
      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: NFubo Chen <fubo.chen@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      efa4988d