1. 19 7月, 2007 7 次提交
    • J
      [SCSI] libsas: fixup NCQ for SATA disks · 0281e02c
      James Bottomley 提交于
      We actually had two problems: the one with the tag (which is fixed by
      zeroing the tag before sending the taskfile to the sequencer) but the
      other with the fact that we sent our first NCQ command to the device
      before the sequencer had been informed of the NCQ tagging
      capabilities.  I fixed the latter by moving the rphy_add() to the
      correct point in the code after the NCQ capabilities are set up.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      0281e02c
    • J
      [SCSI] libsas: better error handling in sas_ex_discover_end_dev() · 528fd552
      James Bottomley 提交于
      This replaces a few BUG_ON() statements with the correct failure error
      handling.  There are still many more to do.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      528fd552
    • J
      [SCSI] aic94xx: add SATAPI support · 27e92471
      James Bottomley 提交于
      It turns out this is fairly easy to plumb in by recognising the three
      command types and copying the CDB.  The protocol response path needs to
      be amended to cope with SAS_PROTO_RESPONSE.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      27e92471
    • D
      [SCSI] libsas: support NCQ for SATA disks · bdab4e87
      Darrick J. Wong 提交于
      This patch adds SATAII NCQ support to libsas.  Both the use_ncq and the
      dma_xfer flags in ata_task must be set for NCQ to work correctly on the
      Adaptec SAS controller.  The rest of the patch adds ATA_FLAG_NCQ to
      sata_port_info and sets up ap->scsi_host so that ata_setup_ncq doesn't
      crash.  Please note that this patch is against the aic94xx-sas git tree,
      not scsi-misc.  Thanks also to James Bottomley for providing an earlier
      version of this patch from which to work.
      
      I've tested this patch on a x206m with a ST380819AS SATA2 disk plugged
      into the Adaptec SAS controller.  The drive came up with a queue depth
      of 31, and I successfully ran an I/O flood test to coerce libata into
      sending multiple commands simultaneously.  A kernel probe recorded the
      maximum tag number that had been seen before and after the flood test;
      before the test it was 2 and after it was 30, as I expected.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      bdab4e87
    • J
      [SCSI] libsas: fix up sas_smp_phy_control() · 38e2f035
      James Bottomley 提交于
      The prototype of this has changed for the link speed setting patch.
      Need to update the SATA use of this.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      38e2f035
    • J
      [SCSI] libsas: Add SATA support to STP piece for SATA on SAS expanders · 1acce194
      James Bottomley 提交于
      This patch adds support for SATA over SAS expanders to the previous two
      SATA support in libsas patches.
      
      There were a couple of nasty non trivial things to sort out before this
      one could be made to work.
      
      Firstly, I'd like to thank Doug Gilbert for diagnosing a problem with
      the LSI expanders where the REPORT_SATA_PHY command was returning the
      D2H FIS in the wrong order (Although, here, I think I have to blame the
      SAS standards which specifies the FIS "shall be returned in little
      endian format" and later on "which means resp[24] shall be FIS type"
      The latter, of course, implying big endian format).  Just to make sure,
      I put a check for the D2H FIS type being in the wrong position and
      reverse the FIS data if it is.
      
      The second is a problem outlined in Annex G of the SAS standard (again,
      a technical point with D2H FIS ... necessitating a phy reset on certain
      conditions).
      
      With the patch, I can now see my SATA-1 disk in a cascaded expander
      configuration.
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      1acce194
    • D
      [SCSI] Add SATA support to libsas · fa1c1e8f
      Darrick J. Wong 提交于
      Hook the scsi_host_template functions in libsas to delegate
      functionality to libata when appropriate.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      
      Misc code changes and merge fixes and update for libata->drivers/ata
      move
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      fa1c1e8f
  2. 18 7月, 2007 1 次提交
    • R
      Freezer: make kernel threads nonfreezable by default · 83144186
      Rafael J. Wysocki 提交于
      Currently, the freezer treats all tasks as freezable, except for the kernel
      threads that explicitly set the PF_NOFREEZE flag for themselves.  This
      approach is problematic, since it requires every kernel thread to either
      set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
      care for the freezing of tasks at all.
      
      It seems better to only require the kernel threads that want to or need to
      be frozen to use some freezer-related code and to remove any
      freezer-related code from the other (nonfreezable) kernel threads, which is
      done in this patch.
      
      The patch causes all kernel threads to be nonfreezable by default (ie.  to
      have PF_NOFREEZE set by default) and introduces the set_freezable()
      function that should be called by the freezable kernel threads in order to
      unset PF_NOFREEZE.  It also makes all of the currently freezable kernel
      threads call set_freezable(), so it shouldn't cause any (intentional)
      change of behaviour to appear.  Additionally, it updates documentation to
      describe the freezing of tasks more accurately.
      
      [akpm@linux-foundation.org: build fixes]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NNigel Cunningham <nigel@nigel.suspend2.net>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      83144186
  3. 12 7月, 2007 2 次提交
    • Z
      sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes · 91a69029
      Zhang Rui 提交于
      Well, first of all, I don't want to change so many files either.
      
      What I do:
      Adding a new parameter "struct bin_attribute *" in the
      .read/.write methods for the sysfs binary attributes.
      
      In fact, only the four lines change in fs/sysfs/bin.c and
      include/linux/sysfs.h do the real work.
      But I have to update all the files that use binary attributes
      to make them compatible with the new .read and .write methods.
      I'm not sure if I missed any. :(
      
      Why I do this:
      For a sysfs attribute, we can get a pointer pointing to the
      struct attribute in the .show/.store method,
      while we can't do this for the binary attributes.
      I don't know why this is different, but this does make it not
      so handy to use the binary attributes as the regular ones.
      So I think this patch is reasonable. :)
      
      Who benefits from it:
      The patch that exposes ACPI tables in sysfs
      requires such an improvement.
      All the table binary attributes share the same .read method.
      Parameter "struct bin_attribute *" is used to get
      the table signature and instance number which are used to
      distinguish different ACPI table binary attributes.
      
      Without this parameter, we need to offer different .read methods
      for different ACPI table binary attributes.
      This is impossible as there are various ACPI tables on different
      platforms, and we don't know what they are until they are loaded.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      91a69029
    • T
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo 提交于
      sysfs is now completely out of driver/module lifetime game.  After
      deletion, a sysfs node doesn't access anything outside sysfs proper,
      so there's no reason to hold onto the attribute owners.  Note that
      often the wrong modules were accounted for as owners leading to
      accessing removed modules.
      
      This patch kills now unnecessary attribute->owner.  Note that with
      this change, userland holding a sysfs node does not prevent the
      backing module from being unloaded.
      
      For more info regarding lifetime rule cleanup, please read the
      following message.
      
        http://article.gmane.org/gmane.linux.kernel/510293
      
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7b595756
  4. 30 5月, 2007 1 次提交
  5. 06 5月, 2007 1 次提交
  6. 03 5月, 2007 1 次提交
    • J
      PCI: Cleanup the includes of <linux/pci.h> · 6473d160
      Jean Delvare 提交于
      I noticed that many source files include <linux/pci.h> while they do
      not appear to need it. Here is an attempt to clean it all up.
      
      In order to find all possibly affected files, I searched for all
      files including <linux/pci.h> but without any other occurence of "pci"
      or "PCI". I removed the include statement from all of these, then I
      compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
      false positives manually.
      
      My tests covered 66% of the affected files, so there could be false
      positives remaining. Untested files are:
      
      arch/alpha/kernel/err_common.c
      arch/alpha/kernel/err_ev6.c
      arch/alpha/kernel/err_ev7.c
      arch/ia64/sn/kernel/huberror.c
      arch/ia64/sn/kernel/xpnet.c
      arch/m68knommu/kernel/dma.c
      arch/mips/lib/iomap.c
      arch/powerpc/platforms/pseries/ras.c
      arch/ppc/8260_io/enet.c
      arch/ppc/8260_io/fcc_enet.c
      arch/ppc/8xx_io/enet.c
      arch/ppc/syslib/ppc4xx_sgdma.c
      arch/sh64/mach-cayman/iomap.c
      arch/xtensa/kernel/xtensa_ksyms.c
      arch/xtensa/platform-iss/setup.c
      drivers/i2c/busses/i2c-at91.c
      drivers/i2c/busses/i2c-mpc.c
      drivers/media/video/saa711x.c
      drivers/misc/hdpuftrs/hdpu_cpustate.c
      drivers/misc/hdpuftrs/hdpu_nexus.c
      drivers/net/au1000_eth.c
      drivers/net/fec_8xx/fec_main.c
      drivers/net/fec_8xx/fec_mii.c
      drivers/net/fs_enet/fs_enet-main.c
      drivers/net/fs_enet/mac-fcc.c
      drivers/net/fs_enet/mac-fec.c
      drivers/net/fs_enet/mac-scc.c
      drivers/net/fs_enet/mii-bitbang.c
      drivers/net/fs_enet/mii-fec.c
      drivers/net/ibm_emac/ibm_emac_core.c
      drivers/net/lasi_82596.c
      drivers/parisc/hppb.c
      drivers/sbus/sbus.c
      drivers/video/g364fb.c
      drivers/video/platinumfb.c
      drivers/video/stifb.c
      drivers/video/valkyriefb.c
      include/asm-arm/arch-ixp4xx/dma.h
      sound/oss/au1550_ac97.c
      
      I would welcome test reports for these files. I am fine with removing
      the untested files from the patch if the general opinion is that these
      changes aren't safe. The tested part would still be nice to have.
      
      Note that this patch depends on another header fixup patch I submitted
      to LKML yesterday:
        [PATCH] scatterlist.h needs types.h
        http://lkml.org/lkml/2007/3/01/141Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6473d160
  7. 03 2月, 2007 2 次提交
    • D
      [SCSI] libsas: Add an LU reset mechanism to the error handler · a9344e68
      Darrick J. Wong 提交于
      After discussion with andmike and dougg, it seems that the purpose of
      eh_device_reset_handler is to issue LU resets, and that
      eh_bus_reset_handler would be a more appropriate place for a phy reset.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      a9344e68
    • D
      [SCSI] libsas: Don't BUG when connecting two expanders via wide port · 423f7cf4
      Darrick J. Wong 提交于
      libsas: Don't BUG when connecting two expanders via wide port
      
      When a device is connected to an expander, the discovery process goes through
      sas_ex_discover_dev to figure out what's attached to the phy.  If it is the
      case that the phy being discovered happens to be the second phy of a wide link
      to an expander, that discover_dev function will incorrectly call
      sas_ex_discover_expander, which creates another sas_port and tries to attach the
      other sas_phys to the new port, thus triggering a BUG.  The correct thing to do is
      to check the other ex_phys of the expander to see if there's a sas_port for this
      sas_phy, and attach the sas_phy to the existing sas_port.
      
      This is easily triggered if one enables the phys of a wide port between
      expanders one by one.
      
      This second version of the patch fixes a small regression in the case where
      all the phys show up at once and we accidentally try to attach to a port
      that hasn't been created yet.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      423f7cf4
  8. 31 1月, 2007 1 次提交
  9. 28 1月, 2007 4 次提交
    • D
      [SCSI] libsas: Enable automatic spin-up of SAS disks · f27708fc
      Darrick J. Wong 提交于
      Set allow_restart=1 for all SAS disks so that they are spun up when needed.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      f27708fc
    • D
      [SCSI] libsas: Handle SCSI commands that complete with failure codes · ad689233
      Darrick J. Wong 提交于
      This patch moves the code that handles SAS failures out of the main EH
      function and into a separate function.  It also detects commands that have
      no sas_task (i.e. they completed, but with error data) and sends them into
      scsi_error for processing.  This allows us to handle SCSI errors (and
      enables auto-spinup as a side effect) instead of dropping them on the
      floor and falling into an infinite loop.  It also requires the
      implementation of a device reset function, which the SAS failure code has
      been modified to employ for REQ_DEVICE_RESET.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      ad689233
    • D
      [SCSI] libsas: Clean up discovery failure handler code · 6f63caae
      Darrick J. Wong 提交于
      sas_rphy_delete does two things: it removes the sas_rphy from the transport
      layer and frees the sas_rphy.  This can be broken down into two functions,
      sas_rphy_remove and sas_rphy_free; sas_rphy_remove is of interest to
      sas_discover_root_expander because it calls functions that require
      sas_rphy_add as a prerequisite and can fail (namely sas_discover_expander).
      In that case, sas_discover_root_expander needs to be able to undo the effects
      of sas_rphy_add yet leave the job of freeing the sas_rphy to the caller of
      sas_discover_root_expander.
      
      This patch also removes some unnecessary code from sas_discover_end_dev
      to eliminate an unnecessary cycle of sas_notify_lldd_gone/found for SAS
      devices, thus eliminating a sas_rphy_remove call (and fixing a race condition
      where a SCSI target scan can come in between the gone and found call).
      It also moves the sas_rphy_free calls into sas_discover_domain and
      sas_ex_discover_end_dev to complement the sas_rphy_allocation via
      sas_get_port_device.
      
      This patch does not change the semantics of sas_rphy_delete.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      6f63caae
    • D
      [SCSI] libsas: Fix incorrect sas_port deformation in sas_form_port · 3b6e9faf
      Darrick J. Wong 提交于
      Currently, sas_form_port checks the given asd_sas_phy's sas_phy to see if
      there's already a port attached.  If so, the SAS addresses of the port and
      the phy are compared to determine if we need to detach from the port
      because the addresses don't match or if we can stop; the SAS address stored
      in the sas_port reflects whatever device _was_ attached to the port/phy, and
      the SAS address stored in the sas_port reflects whatever device we just
      discovered.  As written, the code detaches from the port if the addresses
      _do_ match, and prints an error if they do _not_ match.  I believe this to
      be incorrect, as it seems more logical to keep the port if the addresses
      match (i.e. the phy was reset but the device didn't change), and detach it
      they do not (i.e. the device changed).
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      3b6e9faf
  10. 14 1月, 2007 12 次提交
  11. 08 12月, 2006 1 次提交
  12. 06 12月, 2006 1 次提交
  13. 04 12月, 2006 1 次提交
  14. 23 11月, 2006 1 次提交
    • D
      [PATCH] aic94xx: handle REQ_DEVICE_RESET · dea22214
      Darrick J. Wong 提交于
      This patch implements a REQ_DEVICE_RESET handler for the aic94xx
      driver.  Like the earlier REQ_TASK_ABORT patch, this patch defers the
      device reset to the Scsi_Host's workqueue, which has the added benefit
      of ensuring that the device reset does not happen at the same time
      that the abort tmfs are being processed.  After the phy reset, the
      busted drive should go away and be re-detected later, which is indeed
      what I've seen on both a x260 and a x206m.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      dea22214
  15. 22 11月, 2006 1 次提交
  16. 16 11月, 2006 2 次提交
  17. 09 11月, 2006 1 次提交