1. 18 Jul, 2007 20 commits
  2. 17 Jul, 2007 1 commit
    • Rafael J. Wysocki's avatar
      Freezer: make kernel threads nonfreezable by default · 83144186
      Rafael J. Wysocki authored
      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: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarNigel 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: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  3. 11 Jul, 2007 2 commits
    • Zhang Rui's avatar
      sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes · 91a69029
      Zhang Rui authored
      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: default avatarZhang Rui <rui.zhang@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    • Tejun Heo's avatar
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo authored
      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.
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  4. 29 May, 2007 1 commit
  5. 06 May, 2007 1 commit
  6. 02 May, 2007 1 commit
    • Jean Delvare's avatar
      PCI: Cleanup the includes of <linux/pci.h> · 6473d160
      Jean Delvare authored
      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:
      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
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  7. 03 Feb, 2007 2 commits
    • Darrick J. Wong's avatar
      [SCSI] libsas: Add an LU reset mechanism to the error handler · a9344e68
      Darrick J. Wong authored
      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: default avatarDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    • Darrick J. Wong's avatar
      [SCSI] libsas: Don't BUG when connecting two expanders via wide port · 423f7cf4
      Darrick J. Wong authored
      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: default avatarDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
  8. 30 Jan, 2007 1 commit
  9. 27 Jan, 2007 4 commits
    • Darrick J. Wong's avatar
      [SCSI] libsas: Enable automatic spin-up of SAS disks · f27708fc
      Darrick J. Wong authored
      Set allow_restart=1 for all SAS disks so that they are spun up when needed.
      Signed-off-by: default avatarDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    • Darrick J. Wong's avatar
      [SCSI] libsas: Handle SCSI commands that complete with failure codes · ad689233
      Darrick J. Wong authored
      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: default avatarDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    • Darrick J. Wong's avatar
      [SCSI] libsas: Clean up discovery failure handler code · 6f63caae
      Darrick J. Wong authored
      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
      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
      This patch does not change the semantics of sas_rphy_delete.
      Signed-off-by: default avatarDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    • Darrick J. Wong's avatar
      [SCSI] libsas: Fix incorrect sas_port deformation in sas_form_port · 3b6e9faf
      Darrick J. Wong authored
      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: default avatarDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
  10. 13 Jan, 2007 7 commits