]> git.karo-electronics.de Git - mv-sheeva.git/log
mv-sheeva.git
16 years agoide-cd: merge cdrom_select_speed() into ide_cdrom_select_speed()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:24 +0000 (23:09 +0100)]
ide-cd: merge cdrom_select_speed() into ide_cdrom_select_speed()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: merge cdrom_read_subchannel() into ide_cdrom_get_mcn()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:24 +0000 (23:09 +0100)]
ide-cd: merge cdrom_read_subchannel() into ide_cdrom_get_mcn()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: merge cdrom_play_audio() into ide_cd_fake_play_trkind()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:23 +0000 (23:09 +0100)]
ide-cd: merge cdrom_play_audio() into ide_cd_fake_play_trkind()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: factor out ioctl handlers from ide_cdrom_audio_ioctl()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:23 +0000 (23:09 +0100)]
ide-cd: factor out ioctl handlers from ide_cdrom_audio_ioctl()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: move VERBOSE_IDE_CD_ERRORS code to ide-cd_verbose.c
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:23 +0000 (23:09 +0100)]
ide-cd: move VERBOSE_IDE_CD_ERRORS code to ide-cd_verbose.c

* Rename ide-cd kernel module to ide-cd_mod in preparation to moving code out
  from ide-cd.[c,h].   Add MODULE_ALIAS("ide-cd") to preserve compatibility.

* Move VERBOSE_IDE_CD_ERRORS code from ide-cd.[c,h] to ide-cd_verbose.c.

  ide-cd_verbose.c is IDE subsystem independent and may be easily converted
  into generic library usable by other drivers (i.e. libata) if needed.

* Add CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS config option to drivers/ide/Kconfig
  replacing VERBOSE_IDE_CD_ERRORS define.  Make this config option enabled by
  default and visible only if CONFIG_EMBEDDED is defined.

before the patch:
   text    data     bss     dec     hex filename
  22841     360    1056   24257    5ec1 drivers/ide/ide-cd.o

after the patch w/ CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y:
   text    data     bss     dec     hex filename
  22857     360    1056   24273    5ed1 drivers/ide/ide-cd_mod.o

after the patch w/ CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=n:
   text    data     bss     dec     hex filename
  15091     360    1056   16507    407b drivers/ide/ide-cd_mod.o

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: coding style fixes for VERBOSE_IDE_CD_ERRORS code
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:23 +0000 (23:09 +0100)]
ide-cd: coding style fixes for VERBOSE_IDE_CD_ERRORS code

* Coding style fixes for VERBOSE_IDE_CD_ERRORS code.

* Add KERN_{ERR,CONT} printk() levels where needed.

This is a preparation for moving this code out of ide-cd.[c,h].

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove duplicate sense keys definitions from ide-cd.h
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:23 +0000 (23:09 +0100)]
ide-cd: remove duplicate sense keys definitions from ide-cd.h

ide-cd.c already uses sense keys definitions from <scsi/scsi.h>.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: re-organize handling of quirky devices
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:22 +0000 (23:09 +0100)]
ide-cd: re-organize handling of quirky devices

Re-organize handling of quirky devices:

* Add struct cd_list_entry, ide_cd_quirks_list[] and ide_cd_flags() helper.

* Set flags returned by ide_cd_flags() in ide_cdrom_setup().

* Add IDE_CD_FLAG_VERTOS_{300_SDD,600_ESD} and IDE_CD_FLAG_SANYO_3CD flags.

* Move device quirks from ide_cdrom_setup() to ide_cd_quirks_list[].

* Rename IDE_CD_FLAG_NEC260 to IDE_CD_FLAG_PRE_ATAPI12 and handle
  quirky Stingray 8X CD-ROM using ide_cd_quirks_list[].

* Add IDE_CD_FLAG_FULL_CAPS_PAGE flag and handle quirky ACER 50X CD-ROM
  / WPI 32X CD-ROM using ide_cd_quirk_list[].

* Add IDE_CD_FLAG_PLAY_AUDIO_OK flag and handle quirky MATSHITA DVD-ROMs
  using ide_cd_quirks_list[].

* Add IDE_CD_FLAG_LE_SPEED_FIELDS flag and handle quirky ACER/AOpen 24X
  CD-ROM using ide_cd_quirk_list[].

* Fix some comments about quirky devices while at it.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h>
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:22 +0000 (23:09 +0100)]
ide-cd: use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h>

Use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h>
and remove the local bcd2bin()/bin2bcd() inlines.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove STANDARD_ATAPI define
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:22 +0000 (23:09 +0100)]
ide-cd: remove STANDARD_ATAPI define

Remove STANDARD_ATAPI define + drive-by coding style fixes.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove NO_DOOR_LOCKING define
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:22 +0000 (23:09 +0100)]
ide-cd: remove NO_DOOR_LOCKING define

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove struct ide_cd_{config,state}_flags
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:22 +0000 (23:09 +0100)]
ide-cd: remove struct ide_cd_{config,state}_flags

* Remove unused ->{writing,reserved} fields from struct ide_cd_config_flags.

* Move ->max_speed from struct ide_cd_config_flags to struct cdrom_info.

* Move ->current_speed from struct ide_cd_state_flags to struct cdrom_info.

* Add defines for config and state flags.

* Add 'unsigned int cd_flags' to struct cdrom_info and use ->cd_flags
  instead of ->{config,state}_flags.

* Remove no longer needed struct ide_cd_{config,state}_flags.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove struct atapi_capabilities_page (take 2)
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:21 +0000 (23:09 +0100)]
ide-cd: remove struct atapi_capabilities_page (take 2)

* Remove struct atapi_capabilities_page.

* Add ATAPI_CAPABILITIES_PAGE[_PAD]_SIZE define.

v2:
* The buf[] array access indexes were swapped between 'curspeed'/'maxspeed'.
  (Noticed by Borislav Petkov).

Cc: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: kill CDROM_STATE_FLAGS() macro
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:21 +0000 (23:09 +0100)]
ide-cd: kill CDROM_STATE_FLAGS() macro

While at it rename 'info' variable to 'cd' in cdrom_saw_media_change().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: kill CDROM_CONFIG_FLAGS() macro
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:21 +0000 (23:09 +0100)]
ide-cd: kill CDROM_CONFIG_FLAGS() macro

While at it rename 'info' variable to 'cd' in
ide_cdrom_probe_capabilities() and ide_cdrom_setup().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove redundant config flags
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:20 +0000 (23:09 +0100)]
ide-cd: remove redundant config flags

* Use CDC_* flags directly and remove redundant flags from ->config_flags.

While at it:
* Add KERN_CONT to printk()-s in ide_cdrom_probe_capabilities().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: add IDE_CD_CAPABILITIES define
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:20 +0000 (23:09 +0100)]
ide-cd: add IDE_CD_CAPABILITIES define

While at it remove stale/incorrect comment.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: cleanup ide_cdrom_update_speed()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:20 +0000 (23:09 +0100)]
ide-cd: cleanup ide_cdrom_update_speed()

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove struct atapi_{mechstat_header,changer_info,slot}
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:19 +0000 (23:09 +0100)]
ide-cd: remove struct atapi_{mechstat_header,changer_info,slot}

* Remove ->changer_info from struct cdrom_info (it is never allocated).

* Remove unused struct atapi_{mechstat_header,changer_info,slot}.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove unused and write-only struct ide_cd_config_flags fields
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:19 +0000 (23:09 +0100)]
ide-cd: remove unused and write-only struct ide_cd_config_flags fields

unused fields:
* ->writing
* ->reserved

write-only fields:
* ->playmsf_as_bcd
* ->subchan_as_bcd
* ->test_write
* ->supp_disc_present

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove needless zeroing of 'info' fields from ide_cdrom_setup()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:19 +0000 (23:09 +0100)]
ide-cd: remove needless zeroing of 'info' fields from ide_cdrom_setup()

ide_cd_probe() zeroes 'info' prior to calling ide_cdrom_setup() so there
is no need to explicitly zero 'info' fields in the latter function.

Ditto for fields of CDROM_STATE_FLAGS(), CDROM_CONFIG_FLAGS() and 'cdi'
(all are embedded in 'info').

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove unused struct atapi_cdrom_subchnl
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:19 +0000 (23:09 +0100)]
ide-cd: remove unused struct atapi_cdrom_subchnl

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove dead code from cdrom_pc_intr()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:18 +0000 (23:09 +0100)]
ide-cd: remove dead code from cdrom_pc_intr()

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove unused defines from ide-cd.h
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:18 +0000 (23:09 +0100)]
ide-cd: remove unused defines from ide-cd.h

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove stale cdrom_transfer_packet_command() comment
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:18 +0000 (23:09 +0100)]
ide-cd: remove stale cdrom_transfer_packet_command() comment

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: move historical changelog to Documentation/ide/ChangeLog.ide-cd.1994-2004
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:18 +0000 (23:09 +0100)]
ide-cd: move historical changelog to Documentation/ide/ChangeLog.ide-cd.1994-2004

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix trailing whitespaces in changelog
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:18 +0000 (23:09 +0100)]
ide-cd: fix trailing whitespaces in changelog

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix DMA error handling in cdrom_newpc_intr()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:17 +0000 (23:09 +0100)]
ide-cd: fix DMA error handling in cdrom_newpc_intr()

Make cdrom_newpc_intr() match cdrom_{read,write}_intr() w.r.t.
handling DMA errors:

* disable DMA before cdrom_decode_status() call

* log the device name and the type of the request (read/write)

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix "missing data" handling in cdrom_pc_intr()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:17 +0000 (23:09 +0100)]
ide-cd: fix "missing data" handling in cdrom_pc_intr()

If drive still wants to transfer the data we need to pad the transfer
instead of just finishing the request.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: add ide_cd_pad_transfer() helper
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:17 +0000 (23:09 +0100)]
ide-cd: add ide_cd_pad_transfer() helper

Add ide_cd_pad_transfer() helper and use it in cdrom_[new]pc_intr()
and cdrom_{read,write}_check_ireason().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: use xfer_func_t in cdrom_pc_intr()
Bartlomiej Zolnierkiewicz [Fri, 1 Feb 2008 22:09:17 +0000 (23:09 +0100)]
ide-cd: use xfer_func_t in cdrom_pc_intr()

Unify writing and reading handling in cdrom_pc_intr() using xfer_func_t.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide/ppc/pmac.c section fixes
Adrian Bunk [Fri, 1 Feb 2008 22:09:16 +0000 (23:09 +0100)]
ide/ppc/pmac.c section fixes

This patch fixes the following section mismatch:

<--  snip  -->

...
WARNING: vmlinux.o(.text+0x3b641c): Section mismatch in reference from the function .pmac_ide_setup_device() to the function .init.text:.pmac_ide_setup_dma()
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: make wait_drive_not_busy() static again
Adrian Bunk [Fri, 1 Feb 2008 22:09:16 +0000 (23:09 +0100)]
ide: make wait_drive_not_busy() static again

After commit 7267c3377443322588cddaf457cf106839a60463
wait_drive_not_busy() can become static again.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: small ide-scan-pci.c cleanup
Adrian Bunk [Fri, 1 Feb 2008 22:09:16 +0000 (23:09 +0100)]
ide: small ide-scan-pci.c cleanup

- ide_scan_pcibus() can become static
- instead of ide_scan_pci() we can use ide_scan_pcibus() directly
  in module_init()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: unexport ide_dma_on
Adrian Bunk [Fri, 1 Feb 2008 22:09:16 +0000 (23:09 +0100)]
ide: unexport ide_dma_on

ide_dma_on can be unexported.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide/Kconfig: use 'on-board' instead of 'built-in' in config options
Frans Pop [Fri, 1 Feb 2008 22:09:16 +0000 (23:09 +0100)]
ide/Kconfig: use 'on-board' instead of 'built-in' in config options

To avoid confusion between 'built-in' drivers and 'on-board'
controllers, consistently use the term 'on-board' for controllers.

Minor line-wrapping improvements in descriptions for config options.

[ Bart: thanks to Jan for 'built-in'->'on-board' suggestion ]

Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoAtari Falcon IDE: Add missing hwif variable
Geert Uytterhoeven [Fri, 1 Feb 2008 22:09:15 +0000 (23:09 +0100)]
Atari Falcon IDE: Add missing hwif variable

Commit cbb010c180294a5242a7681555c28737d9dd26ab

    ide: drop 'initializing' argument from ide_register_hw()

    * Rename init_hwif_data() to ide_init_port_data() and export it.

    * For all users of ide_register_hw() with 'initializing' argument set
      hwif->present and hwif->hold are always zero so convert these host
      drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw()
      instead (also no need for init_hwif_default() call since the setup
      done by it gets over-ridden by ide_init_port_hw() call).

    * Drop 'initializing' argument from ide_register_hw().

introduced the usage of a hwif variable, but forgot to declare the actual
variable.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Fri, 1 Feb 2008 21:47:54 +0000 (08:47 +1100)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (24 commits)
  pci: allow multiple calls to pcim_enable_device()
  Blackfin pata-bf54x driver: fix compiling bug - no ata_port struct in struct ata_device any more
  Blackfin pata-bf54x driver: should cover all possible interrupt sources
  Blackfin pata-bf54x driver: Add debug information
  Blackfin pata-bf54x driver: Remove obsolete PM function
  pata_sl82c105: dual channel support
  ata_piix.c: make piix_merge_scr() static
  sata_nv: fix for completion handling
  sata_mv: Remove PCI dependency
  sata_mv ncq Comments and version bump
  sata_mv ncq Remove post internal cmd op
  sata_mv ncq Enable NCQ operation
  sata_mv ncq Introduce per-tag SG tables
  ata_piix: IDE mode SATA patch for Intel ICH10 DeviceID's
  ahci: RAID mode SATA patch for Intel ICH10 DeviceID's
  sata_mv ncq Use DMA memory pools for hardware memory tables
  sata_mv ncq Restrict max sectors to 8-bits on GenII NCQ
  sata_mv ncq Ignore response status LSB on NCQ
  sata_mv ncq Use hqtag instead of ioid
  sata_mv ncq Add want ncq parameter for EDMA configuration
  ...

16 years agoMerge branch 'audit.b46' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
Linus Torvalds [Fri, 1 Feb 2008 21:37:03 +0000 (08:37 +1100)]
Merge branch 'audit.b46' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current

* 'audit.b46' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
  [AUDIT] Add uid, gid fields to ANOM_PROMISCUOUS message
  [AUDIT] ratelimit printk messages audit
  [patch 2/2] audit: complement va_copy with va_end()
  [patch 1/2] kernel/audit.c: warning fix
  [AUDIT] create context if auditing was ever enabled
  [AUDIT] clean up audit_receive_msg()
  [AUDIT] make audit=0 really stop audit messages
  [AUDIT] break large execve argument logging into smaller messages
  [AUDIT] include audit type in audit message when using printk
  [AUDIT] do not panic on exclude messages in audit_log_pid_context()
  [AUDIT] Add End of Event record
  [AUDIT] add session id to audit messages
  [AUDIT] collect uid, loginuid, and comm in OBJ_PID records
  [AUDIT] return EINTR not ERESTART*
  [PATCH] get rid of loginuid races
  [PATCH] switch audit_get_loginuid() to task_struct *

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
Linus Torvalds [Fri, 1 Feb 2008 21:27:50 +0000 (08:27 +1100)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86

* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
  x86: avoid section mismatch involving arch_register_cpu
  x86: fixes for lookup_address args
  x86: fix sparse warnings in cpu/common.c
  x86: make early_console static in early_printk.c
  x86: remove unneeded round_up
  x86: fix section mismatch warning in kernel/pci-calgary
  x86: fix section mismatch warning in acpi/boot.c
  x86: fix section mismatch warnings when referencing notifiers
  x86: silence section mismatch warning in smpboot_64.c
  x86: fix comments in vmlinux_64.lds
  x86_64: make bootmap_start page align v6
  x86_64: add debug name for early_res

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
Linus Torvalds [Fri, 1 Feb 2008 21:27:00 +0000 (08:27 +1100)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched

* git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched:
  latencytop: Change Kconfig dependency.
  futex: Add bitset conditional wait/wakeup functionality
  futex: Remove warn on in return fixup path
  x86: replace LOCK_PREFIX in futex.h
  tick-sched: add more debug information
  timekeeping: update xtime_cache when time(zone) changes
  hrtimer: fix hrtimer_init_sleeper() users

16 years ago[AUDIT] Add uid, gid fields to ANOM_PROMISCUOUS message
Klaus Heinrich Kiwi [Thu, 24 Jan 2008 03:57:45 +0000 (22:57 -0500)]
[AUDIT] Add uid, gid fields to ANOM_PROMISCUOUS message

Changes the ANOM_PROMISCUOUS message to include uid and gid fields,
making it consistent with other AUDIT_ANOM_ messages and in the
format the userspace is expecting.

Signed-off-by: Klaus Heinrich Kiwi <klausk@br.ibm.com>
Acked-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] ratelimit printk messages audit
Eric Paris [Thu, 24 Jan 2008 03:55:05 +0000 (22:55 -0500)]
[AUDIT] ratelimit printk messages audit

some printk messages from the audit system can become excessive.  This
patch ratelimits those messages.  It was found that messages, such as
the audit backlog lost printk message could flood the logs to the point
that a machine could take an nmi watchdog hit or otherwise become
unresponsive.

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[patch 2/2] audit: complement va_copy with va_end()
Richard Knutsson [Thu, 10 Jan 2008 19:02:40 +0000 (11:02 -0800)]
[patch 2/2] audit: complement va_copy with va_end()

Complement va_copy() with va_end().

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
16 years ago[patch 1/2] kernel/audit.c: warning fix
Andrew Morton [Thu, 10 Jan 2008 19:02:39 +0000 (11:02 -0800)]
[patch 1/2] kernel/audit.c: warning fix

kernel/audit.c: In function 'audit_log_start':
kernel/audit.c:1133: warning: 'serial' may be used uninitialized in this function

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
16 years ago[AUDIT] create context if auditing was ever enabled
Eric Paris [Tue, 8 Jan 2008 22:38:31 +0000 (17:38 -0500)]
[AUDIT] create context if auditing was ever enabled

Disabling audit at runtime by auditctl doesn't mean that we can
stop allocating contexts for new processes; we don't want to miss them
when that sucker is reenabled.

(based on work from Al Viro in the RHEL kernel series)

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] clean up audit_receive_msg()
Eric Paris [Mon, 7 Jan 2008 23:14:19 +0000 (18:14 -0500)]
[AUDIT] clean up audit_receive_msg()

generally clean up audit_receive_msg() don't free random memory if
selinux_sid_to_string fails for some reason.  Move generic auditing
to a helper function

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] make audit=0 really stop audit messages
Eric Paris [Mon, 7 Jan 2008 22:09:31 +0000 (17:09 -0500)]
[AUDIT] make audit=0 really stop audit messages

Some audit messages (namely configuration changes) are still emitted even if
the audit subsystem has been explicitly disabled.  This patch turns those
messages off as well.

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] break large execve argument logging into smaller messages
Eric Paris [Mon, 7 Jan 2008 19:31:58 +0000 (14:31 -0500)]
[AUDIT] break large execve argument logging into smaller messages

execve arguments can be quite large.  There is no limit on the number of
arguments and a 4G limit on the size of an argument.

this patch prints those aruguments in bite sized pieces.  a userspace size
limitation of 8k was discovered so this keeps messages around 7.5k

single arguments larger than 7.5k in length are split into multiple records
and can be identified as aX[Y]=

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] include audit type in audit message when using printk
Eric Paris [Mon, 7 Jan 2008 19:19:15 +0000 (14:19 -0500)]
[AUDIT] include audit type in audit message when using printk

Currently audit drops the audit type when an audit message goes through
printk instead of the audit deamon.  This is a minor annoyance in
that the audit type is no longer part of the message and the information
the audit type conveys needs to be carried in, or derived from the
message data.

The attached patch includes the type number as part of the printk.
Admittedly it isn't the type name that the audit deamon provides but I
think this is better than dropping the type completely.

Signed-pff-by: John Johansen <jjohansen@suse.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] do not panic on exclude messages in audit_log_pid_context()
Eric Paris [Mon, 7 Jan 2008 19:01:18 +0000 (14:01 -0500)]
[AUDIT] do not panic on exclude messages in audit_log_pid_context()

If we fail to get an ab in audit_log_pid_context this may be due to an exclude
rule rather than a memory allocation failure.  If it was due to a memory
allocation failue we would have already paniced and no need to do it again.

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] Add End of Event record
Eric Paris [Mon, 7 Jan 2008 18:49:15 +0000 (13:49 -0500)]
[AUDIT] Add End of Event record

This patch adds an end of event record type. It will be sent by the kernel as
the last record when a multi-record event is triggered. This will aid realtime
analysis programs since they will now reliably know they have the last record
to complete an event. The audit daemon filters this and will not write it to
disk.

Signed-off-by: Steve Grubb <sgrubb redhat com>
Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] add session id to audit messages
Eric Paris [Tue, 8 Jan 2008 15:06:53 +0000 (10:06 -0500)]
[AUDIT] add session id to audit messages

In order to correlate audit records to an individual login add a session
id.  This is incremented every time a user logs in and is included in
almost all messages which currently output the auid.  The field is
labeled ses=  or oses=

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] collect uid, loginuid, and comm in OBJ_PID records
Eric Paris [Mon, 7 Jan 2008 18:40:17 +0000 (13:40 -0500)]
[AUDIT] collect uid, loginuid, and comm in OBJ_PID records

Add uid, loginuid, and comm collection to OBJ_PID records.  This just
gives users a little more information about the task that received a
signal.  pid is rather meaningless after the fact, and even though comm
isn't great we can't collect exe reasonably on this code path for
performance reasons.

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[AUDIT] return EINTR not ERESTART*
Eric Paris [Mon, 7 Jan 2008 18:34:51 +0000 (13:34 -0500)]
[AUDIT] return EINTR not ERESTART*

The syscall exit code will change ERESTART* kernel internal return codes
to EINTR if it does not restart the syscall.  Since we collect the audit
info before that point we should fix those in the audit log as well.

Signed-off-by: Eric Paris <eparis@redhat.com>
16 years ago[PATCH] get rid of loginuid races
Al Viro [Thu, 10 Jan 2008 09:53:18 +0000 (04:53 -0500)]
[PATCH] get rid of loginuid races

Keeping loginuid in audit_context is racy and results in messier
code.  Taken to task_struct, out of the way of ->audit_context
changes.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years ago[PATCH] switch audit_get_loginuid() to task_struct *
Al Viro [Thu, 10 Jan 2008 09:20:52 +0000 (04:20 -0500)]
[PATCH] switch audit_get_loginuid() to task_struct *

all callers pass something->audit_context

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
16 years agopci: allow multiple calls to pcim_enable_device()
Tejun Heo [Wed, 30 Jan 2008 09:20:04 +0000 (18:20 +0900)]
pci: allow multiple calls to pcim_enable_device()

There's no reason not to allow multiple calls to pcim_enable_device().
Calls after the first one can simply be noop.  All PCI resources will
be released when the initial pcim_enable_device() resource is
released.

This allows more flexibility to managed PCI users.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoBlackfin pata-bf54x driver: fix compiling bug - no ata_port struct in struct ata_devi...
Bryan Wu [Wed, 30 Jan 2008 08:43:28 +0000 (16:43 +0800)]
Blackfin pata-bf54x driver: fix compiling bug - no ata_port struct in struct ata_device any more

Cc: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoBlackfin pata-bf54x driver: should cover all possible interrupt sources
Sonic Zhang [Wed, 30 Jan 2008 08:43:27 +0000 (16:43 +0800)]
Blackfin pata-bf54x driver: should cover all possible interrupt sources

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoBlackfin pata-bf54x driver: Add debug information
Sonic Zhang [Wed, 30 Jan 2008 08:43:26 +0000 (16:43 +0800)]
Blackfin pata-bf54x driver: Add debug information

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoBlackfin pata-bf54x driver: Remove obsolete PM function
Sonic Zhang [Wed, 30 Jan 2008 08:43:25 +0000 (16:43 +0800)]
Blackfin pata-bf54x driver: Remove obsolete PM function

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_sl82c105: dual channel support
Alan Cox [Mon, 28 Jan 2008 16:08:23 +0000 (16:08 +0000)]
pata_sl82c105: dual channel support

Use qc_defer to serialize the two channels

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoata_piix.c: make piix_merge_scr() static
Adrian Bunk [Mon, 28 Jan 2008 22:10:19 +0000 (00:10 +0200)]
ata_piix.c: make piix_merge_scr() static

piix_merge_scr() can become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_nv: fix for completion handling
Robert Hancock [Wed, 30 Jan 2008 01:53:19 +0000 (19:53 -0600)]
sata_nv: fix for completion handling

This patch is based on an original patch from Kuan Luo of NVIDIA,
posted under subject "fixed a bug of adma in rhel4u5 with HDS7250SASUN500G".
His description follows. I've reworked it a bit to avoid some unnecessary
repeated checks but it should be functionally identical.

"The patch is to solve the error message "ata1: CPB flags CMD err,
flags=0x11" when testing HDS7250SASUN500G in rhel4u5.
I tested this hd in 2.6.24-rc7 which needed to remove the mask in
blacklist to run the ncq and the same error also showed up.

I traced the  bug and found that the interrupt finished a command (for
example, tag=0) when the driver got that adma status is
NV_ADMA_STAT_DONE  and  cpb->resp_flags is NV_CPB_RESP_DONE.
However, For this hd, the drive maybe didn't clear bit 0 at this moment.
It meaned the hardware  had not completely finished the command.
If at the same time  the driver freed the command(tag 0) and sended
another command (tag 0), the error happened.

The notifier register is 32-bit register containing notifier value.
Value is bit vector containing one bit per tag number (0-31) in
corresponding bit positions (bit 0 is for tag 0, etc). When bit is set
then ADMA indicates that command with corresponding tag number completed
execution.

So i added the check notifier code. Sometimes i saw that the notifier
reg set some bits  , but the adma status set NV_ADMA_STAT_CMD_COMPLETE
,not NV_ADMA_STAT_DONE. So i added the NV_ADMA_STAT_CMD_COMPLETE check
code."

Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv: Remove PCI dependency
Saeed Bishara [Wed, 30 Jan 2008 22:50:45 +0000 (11:50 -1100)]
sata_mv: Remove PCI dependency

The integrated SATA controller is connected directly to the SoC's
internal bus, not via PCI interface. this patch removes the dependency
on the PCI interface.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agox86: avoid section mismatch involving arch_register_cpu
Alexander van Heukelum [Fri, 1 Feb 2008 16:49:43 +0000 (17:49 +0100)]
x86: avoid section mismatch involving arch_register_cpu

Avoid section mismatch involving arch_register_cpu.

Marking arch_register_cpu as __init and removing the export
for non-hotplug-cpu configurations makes the following warning
go away:

Section mismatch in reference from the function
arch_register_cpu() to the function .devinit.text:register_cpu()
The function  arch_register_cpu() references
the function __devinit register_cpu().
This is often because arch_register_cpu lacks a __devinit
annotation or the annotation of register_cpu is wrong.

The only external user of arch_register_cpu in the tree is
in drivers/acpi/processor_core.c where it is guarded by
ACPI_HOTPLUG_CPU (which depends on HOTPLUG_CPU).

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
CC: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fixes for lookup_address args
Harvey Harrison [Fri, 1 Feb 2008 16:49:43 +0000 (17:49 +0100)]
x86: fixes for lookup_address args

Signedness mismatches in level argument.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix sparse warnings in cpu/common.c
Harvey Harrison [Fri, 1 Feb 2008 16:49:43 +0000 (17:49 +0100)]
x86: fix sparse warnings in cpu/common.c

The casts will always be needed, may as well make them the right
signedness.  The ebx variables can easily be unsigned, may as well.

arch/x86/kernel/cpu/common.c:261:21: warning: incorrect type in argument 2 (different signedness)
arch/x86/kernel/cpu/common.c:261:21:    expected unsigned int *eax
arch/x86/kernel/cpu/common.c:261:21:    got int *<noident>
arch/x86/kernel/cpu/common.c:262:9: warning: incorrect type in argument 3 (different signedness)
arch/x86/kernel/cpu/common.c:262:9:    expected unsigned int *ebx
arch/x86/kernel/cpu/common.c:262:9:    got int *<noident>
arch/x86/kernel/cpu/common.c:263:9: warning: incorrect type in argument 4 (different signedness)
arch/x86/kernel/cpu/common.c:263:9:    expected unsigned int *ecx
arch/x86/kernel/cpu/common.c:263:9:    got int *<noident>
arch/x86/kernel/cpu/common.c:264:9: warning: incorrect type in argument 5 (different signedness)
arch/x86/kernel/cpu/common.c:264:9:    expected unsigned int *edx
arch/x86/kernel/cpu/common.c:264:9:    got int *<noident>
arch/x86/kernel/cpu/common.c:293:30: warning: incorrect type in argument 3 (different signedness)
arch/x86/kernel/cpu/common.c:293:30:    expected unsigned int *ebx
arch/x86/kernel/cpu/common.c:293:30:    got int *<noident>
arch/x86/kernel/cpu/common.c:350:22: warning: incorrect type in argument 2 (different signedness)
arch/x86/kernel/cpu/common.c:350:22:    expected unsigned int *eax
arch/x86/kernel/cpu/common.c:350:22:    got int *<noident>
arch/x86/kernel/cpu/common.c:351:10: warning: incorrect type in argument 3 (different signedness)
arch/x86/kernel/cpu/common.c:351:10:    expected unsigned int *ebx
arch/x86/kernel/cpu/common.c:351:10:    got int *<noident>
arch/x86/kernel/cpu/common.c:352:10: warning: incorrect type in argument 4 (different signedness)
arch/x86/kernel/cpu/common.c:352:10:    expected unsigned int *ecx
arch/x86/kernel/cpu/common.c:352:10:    got int *<noident>
arch/x86/kernel/cpu/common.c:353:10: warning: incorrect type in argument 5 (different signedness)
arch/x86/kernel/cpu/common.c:353:10:    expected unsigned int *edx
arch/x86/kernel/cpu/common.c:353:10:    got int *<noident>
arch/x86/kernel/cpu/common.c:362:30: warning: incorrect type in argument 3 (different signedness)
arch/x86/kernel/cpu/common.c:362:30:    expected unsigned int *ebx
arch/x86/kernel/cpu/common.c:362:30:    got int *<noident>

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: make early_console static in early_printk.c
Harvey Harrison [Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)]
x86: make early_console static in early_printk.c

Not necessary to expose it, also fixes sparse warning.

arch/x86/kernel/early_printk.c:196:16: warning: symbol 'early_console' was not declared. Should it be static?

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove unneeded round_up
Yinghai Lu [Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)]
x86: remove unneeded round_up

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix section mismatch warning in kernel/pci-calgary
Sam Ravnborg [Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)]
x86: fix section mismatch warning in kernel/pci-calgary

Fix following warning:
WARNING: arch/x86/kernel/built-in.o(.text+0x1eb41): Section mismatch in reference from the function calgary_handle_quirks() to the function .init.text:calgary_set_split_completion_timeout()

calgary_handle_quirks() are only called at
__init time (in calgary_init_one() via handle_quirks ops).
So annotate this function and the sister function __init.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix section mismatch warning in acpi/boot.c
Sam Ravnborg [Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)]
x86: fix section mismatch warning in acpi/boot.c

Fix following warning:
WARNING: o-x86_64/arch/x86/kernel/built-in.o(.text+0x13d15): Section mismatch in reference from the function acpi_map_lsapic() to the function .cpuinit.text:mp_register_lapic()

The function acpi_map_lsapic() is exported and thus not annotated.
But the sole user is acpi/processor_core.c in a __cpuinit path.
So create a small wrapper and put back the annotation thus
avoiding the warning.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix section mismatch warnings when referencing notifiers
Sam Ravnborg [Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)]
x86: fix section mismatch warnings when referencing notifiers

Fix the following warnings:
WARNING: arch/x86/kernel/built-in.o(.exit.text+0xf8): Section mismatch in reference from the function msr_exit() to the variable .cpuinit.data:msr_class_cpu_notifier
WARNING: arch/x86/kernel/built-in.o(.exit.text+0x158): Section mismatch in reference from the function cpuid_exit() to the variable .cpuinit.data:cpuid_class_cpu_notifier
WARNING: arch/x86/kernel/built-in.o(.exit.text+0x171): Section mismatch in reference from the function microcode_exit() to the variable .cpuinit.data:mc_cpu_notifier

In all three cases there were a function annotated __exit
that referenced a variable annotated __cpuinitdata.

The fix was to replace the annotation of the notifier
with __refdata to tell modpost that the reference to
a _cpuinit function in the notifier are OK.
The unregister call that references the notifier
variable will simple delete the function pointer
so there is no problem ignoring the reference.

Note: This looks like another case where __cpuinit
has been used as replacement for proper use
of CONFIG_HOTPLUG_CPU to decide what code are used for
HOTPLUG_CPU.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: silence section mismatch warning in smpboot_64.c
Sam Ravnborg [Fri, 1 Feb 2008 16:49:41 +0000 (17:49 +0100)]
x86: silence section mismatch warning in smpboot_64.c

Silence the following warning:
WARNING: o-x86_64/arch/x86/kernel/built-in.o(.text+0x17cd3): Section mismatch in reference from the function remove_cpu_from_maps() to the variable .cpuinit.data:cpu_initialized

remove_cpu:maps() had a single user: __cpu_disable() so
mark it static and annotate it with __ref to silence the
warning from modpost.

_cpu_disable() has a single user in kernel/cpu.c:
 => take_cpu_down()
    which again has a single user in the following call:
    => __stop_machine_run(take_cpu_down, &tcd_param, cpu);
Here a kthread is created.

So maybe the warning is correct and the right fix is to
remove the __cpuinitdata annotation of cpu_initialized?

Note: The analysis were disturbed by the fact that we had a variable
      with the same name in cpu/common.c - but this is 32 bit only]
Note: Should smpboot_64 use cpu_clear()?

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix comments in vmlinux_64.lds
Yinghai Lu [Fri, 1 Feb 2008 16:49:41 +0000 (17:49 +0100)]
x86: fix comments in vmlinux_64.lds

for bzImage, the vmlinux_64.lds still have s32 bit code, and startup_32
should be 0. fix the comment.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86_64: make bootmap_start page align v6
Yinghai Lu [Fri, 1 Feb 2008 16:49:41 +0000 (17:49 +0100)]
x86_64: make bootmap_start page align v6

boot oopses when a system has 64 or 128 GB of RAM installed:

Calling initcall 0xffffffff80bc33b6: sctp_init+0x0/0x711()
BUG: unable to handle kernel NULL pointer dereference at 000000000000005f
IP: [<ffffffff802bfe55>] proc_register+0xe7/0x10f
PGD 0
Oops: 0000 [1] SMP
CPU 0
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.24-smp-g5a514e21-dirty #6
RIP: 0010:[<ffffffff802bfe55>]  [<ffffffff802bfe55>] proc_register+0xe7/0x10f
RSP: 0000:ffff810824c57e60  EFLAGS: 00010246
RAX: 000000000000d7d7 RBX: ffff811024c5fa80 RCX: ffff810824c57e08
RDX: 0000000000000000 RSI: 0000000000000195 RDI: ffffffff80cc2460
RBP: ffffffffffffffff R08: 0000000000000000 R09: ffff811024c5fa80
R10: 0000000000000000 R11: 0000000000000002 R12: ffff810824c57e6c
R13: 0000000000000000 R14: ffff810824c57ee0 R15: 00000006abd25bee
FS:  0000000000000000(0000) GS:ffffffff80b4d000(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 000000000000005f CR3: 0000000000201000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 1, threadinfo ffff810824c56000, task ffff812024c52000)
Stack:  ffffffff80a57348 0000019500000000 ffff811024c5fa80 0000000000000000
 00000000ffffff97 ffffffff802bfef0 0000000000000000 ffffffffffffffff
 0000000000000000 ffffffff80bc3b4b ffff810824c57ee0 ffffffff80bc34a5
Call Trace:
 [<ffffffff802bfef0>] ? create_proc_entry+0x73/0x8a
 [<ffffffff80bc3b4b>] ? sctp_snmp_proc_init+0x1c/0x34
 [<ffffffff80bc34a5>] ? sctp_init+0xef/0x711
 [<ffffffff80b976e3>] ? kernel_init+0x175/0x2e1
 [<ffffffff8020ccf8>] ? child_rip+0xa/0x12
 [<ffffffff80b9756e>] ? kernel_init+0x0/0x2e1
 [<ffffffff8020ccee>] ? child_rip+0x0/0x12

Code: 1e 48 83 7b 38 00 75 08 48 c7 43 38 f0 e8 82 80 48 83 7b 30 00 75 08 48 c7 43 30 d0 e9 82 80 48 c7 c7 60 24 cc 80 e8 bd 5a 54 00 <48> 8b 45 60 48 89 6b 58 48 89 5d 60 48 89 43 50 fe 05 f5 25 a0
RIP  [<ffffffff802bfe55>] proc_register+0xe7/0x10f
 RSP <ffff810824c57e60>
CR2: 000000000000005f
---[ end trace 02c2d78def82877a ]---
Kernel panic - not syncing: Attempted to kill init!

it turns out some variables near end of bss are corrupted already.

in System.map we have
ffffffff80d40420 b rsi_table
ffffffff80d40620 B krb5_seq_lock
ffffffff80d40628 b i.20437
ffffffff80d40630 b xprt_rdma_inline_write_padding
ffffffff80d40638 b sunrpc_table_header
ffffffff80d40640 b zero
ffffffff80d40644 b min_memreg
ffffffff80d40648 b rpcrdma_tk_lock_g
ffffffff80d40650 B sctp_assocs_id_lock
ffffffff80d40658 B proc_net_sctp
ffffffff80d40660 B sctp_assocs_id
ffffffff80d40680 B sysctl_sctp_mem
ffffffff80d40690 B sysctl_sctp_rmem
ffffffff80d406a0 B sysctl_sctp_wmem
ffffffff80d406b0 b sctp_ctl_socket
ffffffff80d406b8 b sctp_pf_inet6_specific
ffffffff80d406c0 b sctp_pf_inet_specific
ffffffff80d406c8 b sctp_af_v4_specific
ffffffff80d406d0 b sctp_af_v6_specific
ffffffff80d406d8 b sctp_rand.33270
ffffffff80d406dc b sctp_memory_pressure
ffffffff80d406e0 b sctp_sockets_allocated
ffffffff80d406e4 b sctp_memory_allocated
ffffffff80d406e8 b sctp_sysctl_header
ffffffff80d406f0 b zero
ffffffff80d406f4 A __bss_stop
ffffffff80d406f4 A _end

and setup_node_bootmem() will use that page 0xd40000 for bootmap
Bootmem setup node 0 0000000000000000-0000000828000000
  NODE_DATA [000000000008a485 - 0000000000091484]
  bootmap [0000000000d406f4 -  0000000000e456f3] pages 105
Bootmem setup node 1 0000000828000000-0000001028000000
  NODE_DATA [0000000828000000 - 0000000828006fff]
  bootmap [0000000828007000 -  0000000828106fff] pages 100
Bootmem setup node 2 0000001028000000-0000001828000000
  NODE_DATA [0000001028000000 - 0000001028006fff]
  bootmap [0000001028007000 -  0000001028106fff] pages 100
Bootmem setup node 3 0000001828000000-0000002028000000
  NODE_DATA [0000001828000000 - 0000001828006fff]
  bootmap [0000001828007000 -  0000001828106fff] pages 100

setup_node_bootmem() makes NODE_DATA cacheline aligned,
and bootmap is page-aligned.

the patch updates find_e820_area() to make sure we can meet
the alignment constraints.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86_64: add debug name for early_res
Yinghai Lu [Fri, 1 Feb 2008 16:49:41 +0000 (17:49 +0100)]
x86_64: add debug name for early_res

helps debugging problems in this rather murky area of code.

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agolatencytop: Change Kconfig dependency.
Heiko Carstens [Fri, 1 Feb 2008 16:45:14 +0000 (17:45 +0100)]
latencytop: Change Kconfig dependency.

Change latencytop Kconfig entry so it doesn't list the archictectures
that support it. Instead introduce HAVE_LATENCY_SUPPORT which any
architecture can set. Should reduce patch conflicts.

Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Holger Wolf <wolf@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agofutex: Add bitset conditional wait/wakeup functionality
Thomas Gleixner [Fri, 1 Feb 2008 16:45:14 +0000 (17:45 +0100)]
futex: Add bitset conditional wait/wakeup functionality

To allow the implementation of optimized rw-locks in user space, glibc
needs a possibility to select waiters for wakeup depending on a bitset
mask.

This requires two new futex OPs: FUTEX_WAIT_BITS and FUTEX_WAKE_BITS
These OPs are basically the same as FUTEX_WAIT and FUTEX_WAKE plus an
additional argument - a bitset. Further the FUTEX_WAIT_BITS OP is
expecting an absolute timeout value instead of the relative one, which
is used for the FUTEX_WAIT OP.

FUTEX_WAIT_BITS calls into the kernel with a bitset. The bitset is
stored in the futex_q structure, which is used to enqueue the waiter
into the hashed futex waitqueue.

FUTEX_WAKE_BITS also calls into the kernel with a bitset. The wakeup
function logically ANDs the bitset with the bitset stored in each
waiters futex_q structure. If the result is zero (i.e. none of the set
bits in the bitsets is matching), then the waiter is not woken up. If
the result is not zero (i.e. one of the set bits in the bitsets is
matching), then the waiter is woken.

The bitset provided by the caller must be non zero. In case the
provided bitset is zero the kernel returns EINVAL.

Internaly the new OPs are only extensions to the existing FUTEX_WAIT
and FUTEX_WAKE functions. The existing OPs hand a bitset with all bits
set into the futex_wait() and futex_wake() functions.

Signed-off-by: Thomas Gleixner <tgxl@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agofutex: Remove warn on in return fixup path
Thomas Gleixner [Fri, 1 Feb 2008 16:45:14 +0000 (17:45 +0100)]
futex: Remove warn on in return fixup path

The WARN_ON() in the fixup return path of futex_lock_pi() can
trigger with false positives.

The following scenario happens:
t1 holds the futex and t2 and t3 are blocked on the kernel side rt_mutex.
t1 releases the futex (and the rt_mutex) and assigned t2 to be the next
owner of the futex.

t2 is interrupted and returns w/o acquiring the rt_mutex, before t1 can
release the rtmutex.

t1 releases the rtmutex and t3 becomes the pending owner of the rtmutex.

t2 notices that it is the designated owner (user space variable) and
fails to acquire the rt_mutex via trylock, because it is not allowed to
steal the rt_mutex from t3. Now it looks at the rt_mutex pending owner (t3)
and assigns the futex and the pi_state to it.

During the fixup t4 steals the rtmutex from t3.

t2 returns from the fixup and the owner of the rt_mutex has changed from
t3 to t4.

There is no need to do another round of fixups from t2. The important
part (t2 is not returning as the user space visible owner) is
done. The further fixups are done, before either t3 or t4 return to
user space.

For the user space it is not relevant which task (t3 or t4) is the real
owner, as long as those are both in the kernel, which is guaranteed by
the serialization of the hash bucket lock. Both tasks (which ever returns
first to userspace - t4 because it locked the rt_mutex or t3 due to a signal)
are going through the lock_futex_pi() return path where the ownership is
fixed before the return to user space.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: replace LOCK_PREFIX in futex.h
Thomas Gleixner [Fri, 1 Feb 2008 16:45:14 +0000 (17:45 +0100)]
x86: replace LOCK_PREFIX in futex.h

The exception fixup for the futex macros __futex_atomic_op1/2 and
futex_atomic_cmpxchg_inatomic() is missing an entry when the lock
prefix is replaced by a NOP via SMP alternatives.

Chuck Ebert tracked this down from the information provided in:
https://bugzilla.redhat.com/show_bug.cgi?id=429412

A possible solution would be to add another fixup after the
LOCK_PREFIX, so both the LOCK and NOP case have their own entry in the
exception table, but it's not really worth the trouble.

Simply replace LOCK_PREFIX with lock and keep those untouched by SMP
alternatives.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotick-sched: add more debug information
Thomas Gleixner [Fri, 1 Feb 2008 16:45:14 +0000 (17:45 +0100)]
tick-sched: add more debug information

To allow better diagnosis of tick-sched related, especially NOHZ
related problems, we need to know when the last wakeup via an irq
happened and when the CPU left the idle state.

Add two fields (idle_waketime, idle_exittime) to the tick_sched
structure and add them to the timer_list output.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotimekeeping: update xtime_cache when time(zone) changes
Thomas Gleixner [Fri, 1 Feb 2008 16:45:13 +0000 (17:45 +0100)]
timekeeping: update xtime_cache when time(zone) changes

xtime_cache needs to be updated whenever xtime and or wall_to_monotic
are changed. Otherwise users of xtime_cache might see a stale (and in
the case of timezone changes utterly wrong) value until the next
update happens.

Fixup the obvious places, which miss this update.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <johnstul@us.ibm.com>
Tested-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agohrtimer: fix hrtimer_init_sleeper() users
Peter Zijlstra [Fri, 1 Feb 2008 16:45:13 +0000 (17:45 +0100)]
hrtimer: fix hrtimer_init_sleeper() users

this patch:

 commit 37bb6cb4097e29ffee970065b74499cbf10603a3
 Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
 Date:   Fri Jan 25 21:08:32 2008 +0100

     hrtimer: unlock hrtimer_wakeup

Broke hrtimer_init_sleeper() users. It forgot to fix up the futex
caller of this function to detect the failed queueing and messed up
the do_nanosleep() caller in that it could leak a TASK_INTERRUPTIBLE
state.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agosata_mv ncq Comments and version bump
Mark Lord [Sat, 26 Jan 2008 23:33:59 +0000 (18:33 -0500)]
sata_mv ncq Comments and version bump

Remove some obsolete comments, and bump up the driver version number.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Remove post internal cmd op
Mark Lord [Sat, 26 Jan 2008 23:33:36 +0000 (18:33 -0500)]
sata_mv ncq Remove post internal cmd op

This driver currently has no need for the .post_internal_cmd op.
So get rid of it, to save unnecessary transitions between EDMA and non-EDMA modes.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Enable NCQ operation
Mark Lord [Sat, 26 Jan 2008 23:33:18 +0000 (18:33 -0500)]
sata_mv ncq Enable NCQ operation

Final changes to actually turn on NCQ in the driver for GEN_II/IIE hardware.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Introduce per-tag SG tables
Mark Lord [Tue, 29 Jan 2008 18:24:00 +0000 (13:24 -0500)]
sata_mv ncq Introduce per-tag SG tables

In preparation for supporting NCQ, we must allocate separate SG tables
for each command tag, rather than just a single table per port as before.

Gen-I hardware cannot do NCQ, though, so we still allocate just a single
table for that, but populate it in all 32 slots to avoid special-cases
elsewhere in hotter paths of the code.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoata_piix: IDE mode SATA patch for Intel ICH10 DeviceID's
Jason Gaston [Tue, 29 Jan 2008 01:36:45 +0000 (17:36 -0800)]
ata_piix: IDE mode SATA patch for Intel ICH10 DeviceID's

This patch adds the Intel ICH10 IDE mode SATA Controller DeviceID's.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoahci: RAID mode SATA patch for Intel ICH10 DeviceID's
Jason Gaston [Tue, 29 Jan 2008 01:34:14 +0000 (17:34 -0800)]
ahci: RAID mode SATA patch for Intel ICH10 DeviceID's

This patch adds the Intel ICH10 SATA RAID Controllers DeviceID's.

Signed-off-by: Jason Gaston <jason.d.gaston@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Use DMA memory pools for hardware memory tables
Mark Lord [Sat, 26 Jan 2008 23:32:45 +0000 (18:32 -0500)]
sata_mv ncq Use DMA memory pools for hardware memory tables

Create host-owned DMA memory pools, for use in allocating/freeing per-port
command/response queues and SG tables.  This gives us a way to guarantee we
meet the hardware address alignment requirements, and also reduces memory that
might otherwise be wasted on alignment gaps.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Restrict max sectors to 8-bits on GenII NCQ
Mark Lord [Sat, 26 Jan 2008 23:32:29 +0000 (18:32 -0500)]
sata_mv ncq Restrict max sectors to 8-bits on GenII NCQ

The GenII chips have only 8-bits for the sector_count field when performing NCQ.
Add a dev_config method to restrict this when necessary, taking care not to
override any other restriction already in place (likely none, but someday.. ?).

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Ignore response status LSB on NCQ
Mark Lord [Sat, 26 Jan 2008 23:32:09 +0000 (18:32 -0500)]
sata_mv ncq Ignore response status LSB on NCQ

The lower 8 bits of response status are not valid for NCQ.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Use hqtag instead of ioid
Mark Lord [Sat, 26 Jan 2008 23:31:48 +0000 (18:31 -0500)]
sata_mv ncq Use hqtag instead of ioid

Simplify tag handling by using the cid/hqtag field instead of ioid,
as recommended by Marvell.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Add want ncq parameter for EDMA configuration
Mark Lord [Sat, 26 Jan 2008 23:31:33 +0000 (18:31 -0500)]
sata_mv ncq Add want ncq parameter for EDMA configuration

An extra EDMA config bit is required for NCQ operation.
So set/clear it as needed, and cache current setting in port_priv.
For now though, it will always be "off" (0).

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Fix EDMA configuration
Mark Lord [Sat, 26 Jan 2008 23:31:16 +0000 (18:31 -0500)]
sata_mv ncq Fix EDMA configuration

Simplify and fix EDMA configuration setup to match Marvell specificiations.
The chip documentation gives a specific (re)init sequence, which we now follow.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Rename base to port mmio
Mark Lord [Sat, 26 Jan 2008 23:31:00 +0000 (18:31 -0500)]
sata_mv ncq Rename base to port mmio

Use naming consistent with elsewhere in this driver.
This will keep things less confusing when we later add "hc_mmio" in this function.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq Mask transient IRQs
Mark Lord [Sat, 26 Jan 2008 23:30:37 +0000 (18:30 -0500)]
sata_mv ncq Mask transient IRQs

The chips can handle many transient errors internally without a software IRQ.
We now mask/ignore those interrupts here.  This is necessary for NCQ, later on.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agosata_mv ncq EH fixes
Mark Lord [Sat, 26 Jan 2008 23:28:23 +0000 (18:28 -0500)]
sata_mv ncq EH fixes

A hard reset is necessary after hotplug events.
Only clear the error irq bits that were set on entry.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>