1
0
Fork 0
Commit Graph

36215 Commits (1c44f5f16fee880b294f8068354bfb9dddf1349b)

Author SHA1 Message Date
Adrian Bunk 976006f10b ibmlana_adapter_names[] must be __devinitdata
This patch fixes the following section mismatch:

<--  snip  -->

...
WARNING: drivers/net/built-in.o(.devinit.text+0x1baa4): Section mismatch in reference from the function ibmlana_init_one() to the variable .init.data:ibmlana_adapter_names
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:26:10 -08:00
Adrian Bunk de4e7c8899 via-rhine.c:rhine_hw_init() must be __devinit
Thie patch fixes the following section mismatch:

<--  snip  -->

...
WARNING: drivers/net/built-in.o(.text+0xdd840): Section mismatch in reference from the function rhine_hw_init() to the function .devinit.text:rhine_reload_eeprom()
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:26:10 -08:00
Ben Dooks 237c5e8ee2 NET: AX88796 use dev_dbg() instead of printk()
Change to using dev_dbg() and the other dev_xxx()
macros instead of printk, and update to use the
print_mac() helper.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:26:09 -08:00
Haavard Skinnemoen 06c3fd6ad5 macb: Fix section mismatch and shrink runtime footprint
macb devices are only found integrated on SoCs, so they can't be
hotplugged. Thus, the probe() and exit() functions can be __init and
__exit, respectively. By using platform_driver_probe() instead of
platform_driver_register(), there won't be any references to the
discarded probe() function after the driver has loaded.

This also fixes a section mismatch due to macb_probe(), defined as
__devinit, calling macb_get_hwaddr, defined as __init.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:26:00 -08:00
Jan-Bernd Themann e87ceea13e ehea: fix sysfs link compile problem
Due to changes in the struct device_driver there is no direct
access to its kobj any longer. The kobj was used to create
sysfs links between eHEA ethernet devices and the driver.
This patch removes the affected sysfs links to resolve
the build problems.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:26:00 -08:00
Anton Vorontsov 26d29ea799 ucc_geth: add support for netpoll
This patch adds netpoll support for the QE UCC Gigabit Ethernet
driver. Tested using netconsole and KGDBoE.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:59 -08:00
Anton Vorontsov 80a9fad8e8 ucc_geth: fix module removal
- uccf should be set to NULL to not double-free memory on
  subsequent calls;
- ind_hash_q and group_hash_q lists should be initialized in the
  probe() function, instead of struct_init() (called by open()),
  otherwise there will be an oops if ucc_geth_driver removed
  prior 'ifconfig ethX up';
- add unregister_netdev();
- reorder geth_remove() steps.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:58 -08:00
Doug Maxey f67c627518 ehea: fix qmr checkpatch complaints
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Doug Maxey <dwm@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:58 -08:00
Doug Maxey e076c872df ehea: fix phyp checkpatch complaints
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Doug Maxey <dwm@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:57 -08:00
Doug Maxey 508d2b5d26 ehea: fix main checkpatch complaints
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Doug Maxey <dwm@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:56 -08:00
Doug Maxey 13da93d495 ehea: fix ethtool checkpatch complaints
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Doug Maxey <dwm@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:56 -08:00
Doug Maxey c6fa0b03cd ehea: fix ehea.h checkpatch complaints
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Doug Maxey <dwm@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-03 04:25:55 -08:00
Cornelia Huck 0c98b19fe5 Driver core: Remove unneeded get_{device,driver}() calls.
Driver core: Remove unneeded get_{device,driver}() calls.

Code trying to add/remove attributes must hold a reference to
the device resp. driver anyway, so let's remove those reference
count games.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:14:49 -08:00
Dave Young cd35449b93 driver core: convert to use class_find_device api
Convert to use class_find_device api in drivers/base/core.c

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:14:49 -08:00
Rafael J. Wysocki 9617c3e460 PM: Export device_pm_schedule_removal
Move the declaration of device_pm_schedule_removal() to device.h
and make it exported, as it will be used directly by some drivers
for unregistering device objects during suspend/resume cycles in a
safe way.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:14:48 -08:00
Frank Seidel 18bbe0c26c nozomi: finish constification
Even some more constifications

Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:14:48 -08:00
Jan Engelhardt 71e1b4abdc nozomi: constify driver
nozomi: constify structures and annotate vars

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:14:48 -08:00
Frank Seidel e9ed537a3a nozomi driver update
Minor cleanups and removal of in-file changelog:

- Correction of misspellings and wrong encoded Name
- changed 'unsigned' to 'unsigned int' for better readability
- use of generic devicefile access macro
- fixed/added explanatory comment to ntty_put_char

Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:14:48 -08:00
Sam Ravnborg 451124a7cc PCI: fix 4x section mismatch warnings
The following warnings were issued during build of
drivers/pci with an allyesconfig build:
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xdaf): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x15e2): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b0c5): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b32d): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()

Investigating each case closer it looked like all
referred functions are only used in the init phase
or during hotplug.
So to avoid wasting too much memory in the non-hotplug
case the simpler fix was to allow the fuctions to
use code/data from the __devinit sections.
This was done in all four case by adding the __ref
annotation.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:08:04 -08:00
Sam Ravnborg 4105717bc9 PCI: fix section mismatch warnings referring to pci_do_scan_bus
Fix following warnings:
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xb054): Section mismatch in reference from the function cpci_configure_slot() to the function .devinit.text:pci_do_scan_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x153ab): Section mismatch in reference from the function shpchp_configure_device() to the function .devinit.text:pci_do_scan_bus()
WARNING: o-x86_64/drivers/pci/built-in.o(__ksymtab+0xc0): Section mismatch in reference from the variable __ksymtab_pci_do_scan_bus to the function .devinit.text:pci_do_scan_bus()

PCI hotplug were the only user of pci_do_scan_bus()
so moving this function to a separate file that is build
only when we enable CONFIG_HOTPLUG_PCI.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 15:04:30 -08:00
Linus Torvalds 9135f1901e Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (95 commits)
  ide-tape: remove idetape_config_t typedef
  ide-tape: remove mtio.h related comments
  ide-tape: make function name more accurate
  ide-tape: remove unused sense packet commands.
  ide-tape: use generic byteorder macros
  ide-tape: remove EXPERIMENTAL driver status
  ide-tape: use generic scsi commands
  ide-tape: remove struct idetape_block_size_page_t
  ide-tape: remove structs os_partition_t, os_dat_entry_t, os_dat_t
  ide-tape: remove struct idetape_parameter_block_descriptor_t
  ide-tape: remove struct idetape_medium_partition_page_t
  ide-tape: remove struct idetape_data_compression_page_t
  ide-tape: remove struct idetape_inquiry_result_t
  ide-tape: remove struct idetape_capabilities_page_t
  ide-tape: remove IDETAPE_DEBUG_BUGS
  ide-tape: remove IDETAPE_DEBUG_INFO
  ide-tape: dump gcw fields on error in idetape_identify_device()
  ide-tape: remove struct idetape_mode_parameter_header_t
  ide-tape: remove struct idetape_request_sense_result_t
  ide-tape: remove dead code
  ...
2008-02-03 07:58:57 +11:00
Linus Torvalds 6598b60fd5 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  ieee1394: sbp2: fix bogus s/g access change
2008-02-03 07:51:38 +11:00
Greg Kroah-Hartman d5f78fb0c8 pci: pci_enable_device_bars() fix for lpfc driver
Based on a patch from Ingo Molnar <mingo@elte.hu> as he pointed out that
I wrongly missed this.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 12:04:28 -08:00
Greg Kroah-Hartman cc3a1378b4 Revert "PCI: PCIE ASPM support"
This reverts commit 6c723d5bd8.

It caused build errors on non-x86 platforms, config file confusion, and
even some boot errors on some x86-64 boxes.  All around, not quite ready
for prime-time :(

Cc: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 11:32:01 -08:00
Borislav Petkov d59823fa44 ide-tape: remove idetape_config_t typedef
Since this is used only in idetape_blkdev_ioctl(), remove the typedef and make
the struct function-local.

Bart:
- s/sizeof(struct idetape_config)/sizeof(config)/

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov d99c9da215 ide-tape: remove mtio.h related comments
Those are already in mtio.h.

Bart:
- undo 'unsigned int/unsigned long' -> 'uint/ulong' conversion

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov 419d4741ce ide-tape: make function name more accurate
idetape_active_next_stage() was rather ambiguous wrt its purpose. Make that
more explicit and remove superfluous comment.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov fa36625bf7 ide-tape: remove unused sense packet commands.
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov 860ff5ecbf ide-tape: use generic byteorder macros
This is not a network driver.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 4278c2d5ba ide-tape: remove EXPERIMENTAL driver status
ide-tape has depended on EXPERIMENTAL for ages. Change that since the driver is
being only maintained now.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 90699ce2b2 ide-tape: use generic scsi commands
Also, remove those which weren't used.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov f011889d1d ide-tape: remove struct idetape_block_size_page_t
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 323875549f ide-tape: remove structs os_partition_t, os_dat_entry_t, os_dat_t
They seem just to sit there completely unused.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 3cffb9ce47 ide-tape: remove struct idetape_parameter_block_descriptor_t
Also, shorten function name idetape_get_blocksize_from_block_descriptor() and
move its definition up thereby getting rid of its forward declaration.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 496b92e65d ide-tape: remove struct idetape_medium_partition_page_t
There should be no functional changes resulting from this patch.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00
Borislav Petkov 64a0e08682 ide-tape: remove struct idetape_data_compression_page_t
There should be no functional changes resulting from this patch.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00
Borislav Petkov 6d29c8f0ab ide-tape: remove struct idetape_inquiry_result_t
There should be no functional changes resulting from this patch.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00
Borislav Petkov b642201326 ide-tape: remove struct idetape_capabilities_page_t
All those 2-byte values denoting the different capabilities are being written to
the local copy of the caps buffer without being converted to big endian for
simplicity of usage and shorter code later.  Also, we add some comments stating
which are the fields of the caps page in question in order to alleviate the
cryptic pointer casting exercises as in e.g. idetape_get_mode_sense_results().

There should be no functional changes resulting from this patch.

Bart:
- remove two needless "!!"

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00
Borislav Petkov 55a5d291fd ide-tape: remove IDETAPE_DEBUG_BUGS
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00
Borislav Petkov f79f93a2f3 ide-tape: remove IDETAPE_DEBUG_INFO
The device capabilities are probed for during device initialization so this
info is available through proc/ioctl() und it is redundant here.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00
Bartlomiej Zolnierkiewicz 16422de357 ide-tape: dump gcw fields on error in idetape_identify_device()
Cc: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:48 +01:00
Borislav Petkov 47314fa429 ide-tape: remove struct idetape_mode_parameter_header_t
Bart:
- remove 'capabilities->speed' chunk
- re-add brackets to block_descrp assignment

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:48 +01:00
Borislav Petkov 1b5db434f4 ide-tape: remove struct idetape_request_sense_result_t
Bart:
- remove unnecessary comment change
- remove two needless "!!"

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:48 +01:00
Borislav Petkov c7ea8a1b36 ide-tape: remove dead code
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:48 +01:00
Borislav Petkov 5ce78af4be ide-tape: move historical changelog to Documentation/ide/ChangeLog.ide-tape.1995-2002
Also, cleanup whitespace and update comments.

Bart:
- remove reference to drivers/block/ide.c
- move driver documentation to Documentation/ide/ide-tape.txt

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:48 +01:00
Bartlomiej Zolnierkiewicz dcb425f557 ide-cs: use ide_std_init_ports()
No reason to use ide_init_hwif_ports() in ide-cs (as a nice side-effect
this makes ide-cs work on archs that don't define IDE_ARCH_OBSOLETE_INIT).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:47 +01:00
Bartlomiej Zolnierkiewicz 578cfa0d72 ide: move check_dma_crc() to ide-dma.c
* Move check_dma_crc() to ide-dma.c and add inline version for
  CONFIG_BLK_DEV_IDEDMA=n case.

* Rename check_dma_crc() to ide_check_dma_crc().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:47 +01:00
Bartlomiej Zolnierkiewicz 296921a4ca ide: remove ide_auto_reduce_xfer()
While at it:

* Remove needless '!drive->crc_count' check.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:47 +01:00
Bartlomiej Zolnierkiewicz 99ffbe0e97 ide: move drive->crc_count check out from check_dma_crc()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:47 +01:00
Bartlomiej Zolnierkiewicz af10f77390 ide: remove ide_ata66_check()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:46 +01:00
Bartlomiej Zolnierkiewicz 5efe7c540e ide: remove set_transfer()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:46 +01:00
Bartlomiej Zolnierkiewicz fa017176f7 ide: unexport SELECT_DRIVE()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:46 +01:00
Bartlomiej Zolnierkiewicz 98d2a7aad1 ide-scsi: remove needless SELECT_DRIVE() call
SELECT_DRIVE() is called by IDE core code in start_request() before device
driver's ->do_request method.  In ide-scsi case ->do_request is implemented
by idescsi_do_request() which is also the only user of idescsi_issue_pc().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:46 +01:00
Bartlomiej Zolnierkiewicz 629f944bb1 ide: use __ide_set_handler() in ide_execute_command()
* Use __ide_set_handler() in ide_execute_command().

While at it:

* Fix whitespace damage in ide_execute_command().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:46 +01:00
Bartlomiej Zolnierkiewicz 835457def9 ide: remove SATA_*_REG macros
* siimage.c: use hwif->sata_scr[SATA_{ERROR,STATUS}_OFFSET] instead of
  SATA_{ERROR,STATUS}_REG macros.

* Remove no longer needed SATA_*_REG macros.

While at it:

* Remove needless SATA Status register read from sil_sata_reset_poll().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:45 +01:00
Bartlomiej Zolnierkiewicz 92b83c8f32 ide: remove ->nice0 and ->nice2 fields from ide_drive_t
* ->nice0 and ->nice2 ide_drive_t fields are always zero so remove them.

* IDE_NICE_0 and IDE_NICE_2 defines from <linux/hdreg.h> are no longer
  used by any kernel code so cover them with #ifndef/#endif __KERNEL__.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:45 +01:00
Bartlomiej Zolnierkiewicz 57b5527573 ide-probe: remove needless Status register reads
* Cache value read from the Status register in 'stat' variable in do_probe()
  and enable_nest(), then remove remove needless Status register reads.

While at it:

* Add proper KERN_* levels to printk() calls.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:45 +01:00
Bartlomiej Zolnierkiewicz b187dfeed3 ide-cris: use ide_execute_command()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:44 +01:00
Bartlomiej Zolnierkiewicz c78d717210 trm290: use ide_execute_command()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:44 +01:00
Bartlomiej Zolnierkiewicz 2d6027f087 ide-scsi: use ide_execute_command()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:44 +01:00
Bartlomiej Zolnierkiewicz c1c9dbc849 ide-tape: use ide_execute_command()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:44 +01:00
Bartlomiej Zolnierkiewicz d9270a3f1d ide: move create_proc_ide_drives() call to ide_device_add_all()
* Un-static create_proc_ide_drives() and call it from ide_device_add_all().

While at it:
* Rename create_proc_ide_drives() to ide_proc_port_register_devices().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:43 +01:00
Bartlomiej Zolnierkiewicz 327617e1da ide: move hwif->present check out from ide_proc_register_port()
Move hwif->present check out from ide_proc_register_port() to
ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:43 +01:00
Bartlomiej Zolnierkiewicz eafd88a3b5 ide: factor out devices setup from ide_acpi_init()
* Factor out devices setup from ide_acpi_init() to
  ide_acpi_port_init_devices().

* Call ide_acpi_port_init_devices() in ide_device_add_all().

While at it:
* Remove no longer needed 'drive' field from struct ide_acpi_drive_link.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:43 +01:00
Bartlomiej Zolnierkiewicz 070ecb841c ide-acpi: remove dead code from do_drive_get_GTF()
These pointers are always setup in ide_acpi_init().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:43 +01:00
Bartlomiej Zolnierkiewicz 4484d80388 ide-acpi: remove needless exports
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:42 +01:00
Bartlomiej Zolnierkiewicz decdc3f0d6 ide: move ide_acpi_init() call to ide_device_add_all()
There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:41 +01:00
Bartlomiej Zolnierkiewicz d5bc6592df ide: factor out devices setup from init_irq()
* Factor out devices setup from init_irq() to ide_port_setup_devices().

While at it:
* Do devices setup after printing port information.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:41 +01:00
Bartlomiej Zolnierkiewicz 0947e0dcd6 ide: factor out adding drive to hwgroup from init_irq()
Factor out adding drive to hwgroup from init_irq() to
ide_add_drive_to_hwgroup().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:41 +01:00
Bartlomiej Zolnierkiewicz 8a0e7e14a2 ide: move hwif->rqsize init from ide_init_queue() to init_irq()
Move hwif->rqsize init from ide_init_queue() to init_irq().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:41 +01:00
Bartlomiej Zolnierkiewicz c5d70cc73a ide: merge init_gendisk() into hwif_register_devices()
There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:41 +01:00
Bartlomiej Zolnierkiewicz 346d49969b ide: call init_gendisk() after ide_acpi_init()
There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 3a4e7c96d6 ide: move blk_register_region() call out from init_gendisk()
Move blk_register_region() call out from init_gendisk() to hwif_init().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 5c2854e62c ide: skip not present devices in init_gendisk()
No need to initialize drive->gendev and waste memory on IDE settings
for not present devices.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 521fd1e8d1 ide: remove incorrect init_gendisk() comment
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 1f2cf8b001 ide: add ->port_init_devs method to ide_hwif_t
* Add ->port_init_devs method to ide_hwif_t for a host specific
  initialization of devices on a port.  Call the new method from
  ide_port_init_devices().

* Convert ht6560b, qd65xx and opti621 host drivers to use the new
  ->port_init_devs method.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 807b90d0be ide: add IDE_HFLAG_NO_{IO32_BIT,UNMASK_IRQS} host flags
* Use the same bit for IDE_HFLAG_CS5520 and IDE_HFLAG_VDMA host flags
  (both are used only by cs5520 host driver currently).

* Add IDE_HFLAG_NO_IO32_BIT host flag and use it instead of ->no_io_32bit
  ide_hwif_t field.

* Add IDE_HFLAG_NO_UNMASK_IRQS host flag, then convert dtc2278 and rz1000
  host drivers to use it.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 7704ca2a3e ide: factor out code initializing devices from ide_init_port()
* Factor out code initializing devices from ide_init_port() to
  ide_port_init_devices().

* Call the new function from ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz 909f4369bc ide: fix ide_unregister() usage in host drivers
bast-ide.c/ide-cs.c/delkin_cb.c:

* Don't set 'restore' flag for ide_unregister() when initializing new
  interface.

rapide.c/ide-pnp.c/ide-cs.c/ide_platform.c/au1xxx-ide.c/delkin_cb.c/scc_pata.c:

* Don't set 'init_default' and 'restore' flags for ide_unregister() when
  removing interface.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz 9e016a7192 ide: add ide_deprecated_find_port() helper
* Factor out code for finding ide_hwifs[] slot from ide_register_hw()
  to ide_deprecated_find_port().

* Convert bast-ide, ide-cs and delkin_cb host drivers to use ide_device_add()
  instead of ide_register_hw() (while at it drop doing "ide_unregister()" loop
  which tries to unregister _all_ IDE interfaces if useable ide_hwifs[] slot
  cannot be find).

This patch leaves us with only two ide_register_hw() users:
- drivers/macintosh/mediabay.c
- drivers/ide/ide.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz f82c2b1719 ide: add 'init_default' and 'restore' arguments to ide_unregister()
* Add 'init_default' (flag for calling init_hwif_default()) and 'restore'
  (flag for calling ide_hwif_restore()) arguments to ide_unregister().

* Update ide_unregister() users to set 'init_default' and 'restore' flags.

* No need to set 'init_default' flag in ide_register_hw() if the setup done
  by init_hwif_default() is going to be overridden by ide_init_port_hw().

* No need to set 'init_default' and 'restore' flags in cleanup_module().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz ead741df38 ide: remove redundant init_hwif_default() call from ide_register_hw()
ide_init_port_hw() call overrides setup done by init_hwif_default().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Bartlomiej Zolnierkiewicz 2244e85063 ide: remove redundant hwif->present check from ide_register_hw()
We check earlier for hwif->present and call ide_unregister() if necessary
(after ide_unregister() hwif->present will be always cleared).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Alan Cox 1bee4d1dce pdc202xx_old: remove surplus initialiser
Bart:
- drive-by CodingStyle fixups

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Borislav Petkov fc6c5bc7c1 ide-floppy: bump driver version number
Acknowledge major ide-floppy code refactoring and cleanup by bumping the driver
version number. Also, remove a wrong comment.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Borislav Petkov 0571c7a4f5 ide-floppy: fix most of the remaining checkpatch.pl issues
such as
ERROR: switch and case should be at the same indent
ERROR: need spaces around that '=' (ctx:VxV)
ERROR: trailing statements should be on next line
WARNING: no space between function name and open parenthesis '('
WARNING: printk() should include KERN_ facility level
ERROR: That open brace { should be on the previous line
ERROR: use tabs not spaces
ERROR: do not use assignment in if condition
WARNING: braces {} are not necessary for single statement blocks
ERROR: need space after that ',' (ctx:VxV)
WARNING: line over 80 characters
ERROR: do not use assignment in if condition
...
and so on.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Borislav Petkov 6e5fa7b88c ide-floppy: remove atomic test_*bit macros
..and replace them with flag enums.

Bart:
- fix idefloppy_media_changed() return value

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:37 +01:00
Borislav Petkov 757ced8983 ide-floppy: remove unused flag PC_ABORT
This flag was never being set in the code so remove it. By the way, the
code in the second patch was being executed unconditionally, i.e. in case
pc->retries > IDEFLOPPY_MAX_PC_RETRIES is true (actually that is the only case
when the outer if-test passed), !test_bit(PC_ABORT, &pc->flags)
was always true so the comment is now incorrect and has to go.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:37 +01:00
Borislav Petkov f373bd820d ide-floppy: remove IDEFLOPPY_DEBUG_INFO
This info is already available through ioctl() and /proc

Bart:
- dump 'gcw.packet_size' for unsupported packet sizes

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov ae7e8ddc34 ide-floppy: remove unused IDEFLOPPY_USE_READ12
This flag is not being set anywhere in the driver so it can go.

Bart:
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov 32925e1a16 ide-floppy: merge idefloppy_{input,output}_buffers
We merge idefloppy_{input,output}_buffers() into idefloppy_io_buffers() by
introducing a 4th arg. called direction. According to its value
we atapi_input_bytes() or atapi_output_bytes(). Also, this simplifies the
interrupt handler logic a bit. Finally, rename idefloppy_io_buffers() to
ide_floppy_io_buffers().

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov 0eea6458c0 ide-floppy: use an xfer_func_t and io_buf_t typedefs in order to unify rw
Also, move xfer_func_t typedef to the ide.h since it is used by two drivers
now (more coming).

Bart:
- use __func__ while at it

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov 0bf399e69c ide-floppy: remove IDEFLOPPY_DEBUG_BUGS macro
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov d652c13808 ide-floppy: mv idefloppy_{should_,}report_error
In addition to shortening the function name, move the printk-call into the
function thereby saving some code lines. Also, make the function out_of_line
since it is not on a performance critical path. Finally, rename the reworked
function to ide_floppy..().

Bart:
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov d30a7fba43 ide-floppy: report DMA handling in idefloppy_pc_intr() properly
Bart:
- use 'hwif' instead of 'HWIF(drive)'
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 20bf7bdad4 ide-floppy: factor out ioctl handlers from idefloppy_ioctl()
By passing idefloppy_floppy_t *floppy to the factored out functions, we get
rid of (almost) all local vars so stack usage should be at minimum here. Also,
we merge idefloppy_begin_format() into idefloppy_format_start() since it is its
only user. Also, rename idefloppy_format_start() to idefloppy_format_unit().
Finally, rename the reworked functions to ide_floppy..().

Bart
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 194ec0c078 ide-floppy: remove struct idefloppy_capacity_descriptor
Also,
- remove the accompanying 4 byte idefloppy_capacity_header.
- rename functions from idefloppy_... to ide_floppy_... after cleanup.
- simplify loop in ide_floppy_get_capacity() by reversing if-test condition
  logically.
- finally, fix white space and checkpatch.pl issues

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 8e81bbba72 ide-floppy: remove struct idefloppy_flexible_disk_page
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 24a5d7033b ide-floppy: remove struct idefloppy_mode_parameter_header
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov a6ff2d3b08 ide-floppy: remove struct idefloppy_request_sense_result
While at it, collapse idefloppy_analyze_error() into
idefloppy_request_sense_callback() since the latter was its only user.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 4d37d32e4a ide-floppy: remove struct idefloppy_inquiry_result
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 948391d17c ide-floppy: remove struct idefloppy_capabilities_page
This change is rather temporary and is in preparation of using generic commands
as is the case with ide-cd and the uniform cdrom layer (i.e. init_cdrom_command())
However, before this happens, we'll have to remove all typedefs and teach
idefloppy_create_mode_sense_cmd() to work directly on u8 buffers.

Also, since idefloppy_get_capability_page() was used to read only the sfrp bit,
rename the latter so that the name reflects what it does.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov bcc77d9cc1 ide-floppy: cleanup and unify debugging macro calls
* some debug_log() calls were not using "ide-floppy: " prefix

* a few used printk levels different than KERN_INFO (KERN_NOTICE
  and KERN_ERR, which is the default one if no level is given)

Bart:
- fix build issues for IDEFLOPPY_DEBUG_LOG set to 1 while at it
- s/__FUNCTION__/__func__/

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 7e8b163b25 ide-floppy: include the proper headers
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 9a24b63db0 ide-floppy: disambiguate function names
There were two almost identical function names in ide-floppy.c, which makes
their distinction almost impossible. While ide_floppy_release() cleans up the
object after the last reference to it has been dropped, idefloppy_release() is
the blkdev .release method from struct block_device_operations which releases
that last reference.

Rename ide_floppy_release() to idefloppy_cleanup_obj() in order to make its
purpose more clear.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Borislav Petkov 0078df2ece ide-floppy: remove unnecessary ->handler != NULL check
This BUG_ON is unneeded since the ->handler != NULL check is performed in
ide_set_handler().

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Borislav Petkov 8f6224308b ide-floppy: replace ntoh{s,l} and hton{s,l} calls with the generic byteorder
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Borislav Petkov 30d6709938 ide-floppy: convert to generic packet commands
Replace the ide-floppy packet commands opcode defines with the generic ones.
Add a missing GPCMD_WRITE_12 (opcode 0xaa) to the generic ones in cdrom.h. The
last one can be found in the current version of INF-8090, p.905.

[ Bart: Tejun's libata patch also adding GPCMD_WRITE_12 got merged first ]

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Bartlomiej Zolnierkiewicz 78829dd922 ide: remove needless includes from PCI host drivers
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Bartlomiej Zolnierkiewicz bfa14b42a3 ide: add ->cable_detect method to ide_hwif_t
* Add ->cable_detect method to ide_hwif_t.

* Call the new method in ide_init_port() if:
  - the host supports UDMA modes > UDMA2 ('hwif->ultra_mask & 78')
  - DMA initialization was successful (if hwif->dma_base is not set
    ide_init_port() sets hwif->ultra_mask to zero)
  - "idex=ata66" is not used ('hwif->cbl != ATA_CBL_PATA40_SHORT')

* Convert PCI host drivers to use ->cable_detect method.

While at it:

* Factor out cable detection to separate functions (if not already done).

* hpt366.c/it8213.c/slc90e66.c:
  - don't check cable type if "idex=ata66" is used

* pdc202xx_new.c:
  - add __devinit tag to pdcnew_cable_detect()

* pdc202xx_old.c:
  - rename pdc202xx_old_cable_detect() to pdc2026x_old_cable_detect()
  - add __devinit tag to pdc2026x_old_cable_detect()

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:31 +01:00
Bartlomiej Zolnierkiewicz c413b9b94d ide: add struct ide_port_info instances to legacy host drivers
* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma().

* Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version.

* Add 'const struct ide_port_info *d' argument to ide_device_add[_all]().

* Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(),
  move it to ide-probe.c and call it in in ide_device_add_all() instead of
  ide_pci_setup_ports().

* Move ->mate setup to ide_device_add_all() from ide_port_init().

* Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable
  ->autotune currently.

* Setup hwif->chipset in ide_init_port() but iff pi->chipset is set
  (to not override setup done by ide_hwif_configure()).

* Add ETRAX host handling to ide_device_add_all().

* cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n.

* pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks
  setup to pmac_ide_setup_device().

* Add 'struct ide_port_info' instances to legacy host drivers, pass them to
  ide_device_add() calls and then remove open-coded ports initialization.

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:31 +01:00
Bartlomiej Zolnierkiewicz 1ebf74936b ide: separate PCI specific init from generic init in ide_pci_setup_ports()
* Setup ->mate and ->channel in ide_pci_setup_ports() instead of
  in ide_hwif_configure().

* Make 'port' parameter for ide_hwif_configure() 'unsigned int'.

* Separate PCI specific init from generic init in ide_pci_setup_ports().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:30 +01:00
Bartlomiej Zolnierkiewicz bf77c53171 ide: always set DMA masks in ide_pci_setup_ports()
Always set DMA masks in ide_pci_setup_ports() to make sure that the valid
masks for a host are set.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:30 +01:00
Bartlomiej Zolnierkiewicz d4e6d4eb16 macide: remove drive->capacity64 quirk
Nowadays IDE core always provides drive ID and ide-disk always setups
drive->capacity64 so this quirk is no longer needed.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:30 +01:00
Bartlomiej Zolnierkiewicz b4d1c73dcd atiixp/cs5535/scc_pata: fix "idex=ata66" parameter handling
Don't override the cable type if the "idex=ata66" parameter was used.

While at it:

* atiixp.c: factor out cable detection to atiixp_cable_detect() from
  init_hwif_atiixp().

* cs5535.c: pass 'ide_hwif_t *hwif' instead of 'struct pci_dev *dev' to
  cs5535_cable_detect().

* scc_pata.c: factor out cable detection to scc_cable_detect() from
  init_hwif_scc() and remove incorrect comment.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:29 +01:00
Bartlomiej Zolnierkiewicz bd38dd3c13 au1xxx-ide: fix ->io_32bit handling
The host driver must set hwif's ->no_io_32bit setting not drive's one
(ide_port_tune_devices() overrides drive's setting).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:29 +01:00
Bartlomiej Zolnierkiewicz 36e9dc469b dtc2278: fix ->io_32bit handling
On DTC2278 32-bit I/O has to be enabled for both devices on the port
so always enable it during init time and disallow further changes.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:28 +01:00
Stefan Richter 5fcf500058 ieee1394: sbp2: fix bogus s/g access change
sg_dma_len(sg) is invalid before the s/g list is DMA-mapped.

This fixes a post 2.6.24 regression which prevents access to SBP-2
devices on several architectures, introduced by "ieee1394: sbp2: s/g
list access cosmetics", commit 825f1df545.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2008-02-02 13:48:16 +01:00
Linus Torvalds ae9458d6a0 Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
  apm_power: check I.intval for zero value, we use it as the divisor
  MAINTAINERS: remove kernel-discuss@handhelds.org list
  pda_power: implement polling
  pda_power: various cleanups
  apm_power: support using VOLTAGE_* properties for apm calculations
  pda_power: add suspend/resume support
  power_supply: add few more values and props
  pda_power: only register available psu
  power: fix incorrect unregistration in power_supply_create_attrs error path
  power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL
  [BATTERY] power_supply_leds: use kasprintf
  [BATTERY] Every file should include the headers containing the prototypes for its global functions.
2008-02-02 15:13:05 +11:00
Linus Torvalds 687fcdf741 Merge branch 'suspend' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'suspend' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (38 commits)
  suspend: cleanup reference to swsusp_pg_dir[]
  PM: Remove obsolete /sys/devices/.../power/state docs
  Hibernation: Invoke suspend notifications after console switch
  Suspend: Invoke suspend notifications after console switch
  Suspend: Clean up suspend_64.c
  Suspend: Add config option to disable the freezer if architecture wants that
  ACPI: Print message before calling _PTS
  ACPI hibernation: Call _PTS before suspending devices
  Hibernation: Introduce begin() and end() callbacks
  ACPI suspend: Call _PTS before suspending devices
  ACPI: Separate disabling of GPEs from _PTS
  ACPI: Separate invocations of _GTS and _BFS from _PTS and _WAK
  Suspend: Introduce begin() and end() callbacks
  suspend: fix ia64 allmodconfig build
  ACPI: clear GPE earily in resume to avoid warning
  Suspend: Clean up Kconfig (V2)
  Hibernation: Clean up Kconfig (V2)
  Hibernation: Update messages
  Suspend: Use common prefix in messages
  Hibernation: Remove unnecessary variable declaration
  ...
2008-02-02 14:29:57 +11:00
Linus Torvalds 215e871aaa Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6: (64 commits)
  PCI: make pci_bus a struct device
  PCI: fix codingstyle issues in include/linux/pci.h
  PCI: fix codingstyle issues in drivers/pci/pci.h
  PCI: PCIE ASPM support
  PCI: Fix fakephp deadlock
  PCI: modify SB700 SATA MSI quirk
  PCI: Run ACPI _OSC method on root bridges only
  PCI ACPI: AER driver should only register PCIe devices with _OSC
  PCI ACPI: Added a function to register _OSC with only PCIe devices.
  PCI: constify function pointer tables
  PCI: Convert drivers/pci/proc.c to use unlocked_ioctl
  pciehp: block new requests from the device before power off
  pciehp: workaround against Bad DLLP during power off
  pciehp: wait for 1000ms before LED operation after power off
  PCI: Remove pci_enable_device_bars() from documentation
  PCI: Remove pci_enable_device_bars()
  PCI: Remove users of pci_enable_device_bars()
  PCI: Add pci_enable_device_{io,mem} intefaces
  PCI: avoid save the same type of cap multiple times
  PCI: correctly initialize a structure for pcie_save_pcix_state()
  ...
2008-02-02 14:29:33 +11:00
Linus Torvalds b6cf160c4b Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (128 commits)
  USB: fix codingstyle issues in drivers/usb/core/*.c
  USB: fix codingstyle issues in drivers/usb/core/message.c
  USB: fix codingstyle issues in drivers/usb/core/hcd-pci.c
  USB: fix codingstyle issues in drivers/usb/core/devio.c
  USB: fix codingstyle issues in drivers/usb/core/devices.c
  USB: fix codingstyle issues in drivers/usb/core/*.h
  USB: fix codingstyle issues in include/linux/usb/
  USB: fix codingstyle issues in include/linux/usb.h
  USB: mark USB drivers as being GPL only
  USB: use a real vendor and product id for root hubs
  USB: mount options: fix usbfs
  USB: Fix usb_serial_driver structure for Kobil cardreader driver.
  usb: ehci should use u16 for isochronous intervals
  usb: ehci, remove false clear-reset path
  USB: Use menuconfig objects
  usb: ohci-sm501 driver
  usb: dma bounce buffer support
  USB: last abuses of intfdata in close for usb-serial drivers
  USB: kl5kusb105 don't flush to logically disconnected devices
  USB: oti6858: cleanup
  ...
2008-02-02 14:28:57 +11:00
Anton Vorontsov e91926e9ea apm_power: check I.intval for zero value, we use it as the divisor
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:44:34 +03:00
Anton Vorontsov c3caebad74 pda_power: implement polling
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:44:34 +03:00
Anton Vorontsov bfde2662ae pda_power: various cleanups
- handle spurious interrupts correctly;
- get rid of pda_power_supplies array, use two variables instead;
- factor out psy_changed() function, it will be used for polling.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:44:34 +03:00
Dmitry Baryshkov dffd28a13a apm_power: support using VOLTAGE_* properties for apm calculations
It's pretty dummy, but useful for batteries for which we can only
get voltages.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:44:34 +03:00
Dmitry Baryshkov 8f8e9b387e pda_power: add suspend/resume support
Add suspend/resume/wakeup support for pda_power.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:43:00 +03:00
Dmitry Baryshkov c7cc930f9a power_supply: add few more values and props
Add LiMn (one of the most common for small non-rechargable batteries)
battery technology and voltage_min/_max properties support.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:43:00 +03:00
Dmitry Baryshkov 9ef4510626 pda_power: only register available psu
Currently pda-power adds both ac and usb power supply units.
This patch fixes it so that psu are added only if they are enabled.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:42:59 +03:00
Andres Salomon 839dc9f105 power: fix incorrect unregistration in power_supply_create_attrs error path
In power_supply_create_attrs(), we create static attributes as referenced
by power_supply_static_attrs[i].  After that, if we fail, we unregister
via power_supply_static_attrs[psy->properties[i]].  This is incorrect, as
psy->properties has absolutely no bearing on static attribs.  This patch
fixes it to unregister the correct attrib.

Another line which was unnecessarily line wrapped is also unwrapped.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-02-02 02:42:59 +03:00
Andres Salomon 8efe444038 power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL
The CAPACITY_LEVEL stuff defines various levels of charge; however, what
is the difference between them?  What differentiates between HIGH and NORMAL,
LOW and CRITICAL, etc?

As it appears that these are fairly arbitrary, we end up making such policy
decisions in the kernel (or in hardware).  This is the sort of decision that
should be made in userspace, not in the kernel.

If the hardware does not support _CAPACITY and it cannot be easily calculated,
then perhaps the driver should register a custom CAPACITY_LEVEL attribute;
however, userspace should not become accustomed to looking for such a thing,
and we should certainly not encourage drivers to provide CAPACITY_LEVEL
stubs.

The following removes support for POWER_SUPPLY_PROP_CAPACITY_LEVEL.  The
OLPC battery driver is the only driver making use of this, so it's
removed from there as well.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-02-02 02:42:59 +03:00
Akinobu Mita 4d24473c43 [BATTERY] power_supply_leds: use kasprintf
Use kasprintf instead of kmalloc()-strcpy()-strcat().

Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:42:59 +03:00
Adrian Bunk 25f12141e2 [BATTERY] Every file should include the headers containing the prototypes for its global functions.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2008-02-02 02:42:58 +03:00
Rafael J. Wysocki c9b6c8f68e ACPI: Print message before calling _PTS
Make acpi_sleep_prepare() static and cause it to print a message
specifying the ACPI system sleep state to be entered (helpful for
debugging the suspend/hibernation code).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:58 -05:00
Rafael J. Wysocki 7258ec5d11 ACPI hibernation: Call _PTS before suspending devices
The ACPI 1.0 specification wants us to put devices into low power
states after executing the _PTS global control method, while ACPI
2.0 and later want us to do that in the reverse order.  The current
hibernation code follows ACPI 2.0 in that respect which may cause some
ACPI 1.0x systems to hang during hibernation (ref.
http://bugzilla.kernel.org/show_bug.cgi?id=9528).

Make the hibernation code execute _PTS before putting devices into
low power states (ie. in accordance with ACPI 1.0x) with the
possibility to override that using the 'acpi_new_pts_ordering' kernel
command line option.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:58 -05:00
Rafael J. Wysocki caea99ef33 Hibernation: Introduce begin() and end() callbacks
Introduce global hibernation callback .end() and rename global
hibernation callback .start() to .begin(), in analogy with the
recent modifications of the global suspend callbacks.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:58 -05:00
Rafael J. Wysocki 60417f5976 ACPI suspend: Call _PTS before suspending devices
The ACPI 1.0 specification wants us to put devices into low power
states after executing the _PTS global control method, while ACPI
2.0 and later want us to do that in the reverse order.  The current
suspend code follows ACPI 2.0 in that respect which causes some
ACPI 1.0x systems to hang during suspend (ref.
http://bugzilla.kernel.org/show_bug.cgi?id=9528).

Make the suspend code execute _PTS before putting devices into low
power states (ie. in accordance with ACPI 1.0x) and provide a command
line option to override the default if need be.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:58 -05:00
Rafael J. Wysocki 3c1d2b6085 ACPI: Separate disabling of GPEs from _PTS
The preparation to enter an ACPI system sleep state is now tied to
the disabling of GPEs, but the GPEs should not be disabled before
suspending devices.  Since on ACPI 1.0x systems the _PTS global
control method should be executed before suspending devices, we
need to disable GPEs separately.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:56 -05:00
Rafael J. Wysocki c95d47a868 ACPI: Separate invocations of _GTS and _BFS from _PTS and _WAK
The execution of ACPI global control methods _GTS and _BFS is
currently tied to the preparation to enter a sleep state and to the
leaving of the sleep state, respectively.  However, these functions
are called before disabling the nonboot CPUs and after enabling
them, respectively (in fact, on ACPI 1.0x systems the first of them
ought to be called before suspending devices), while according to the
ACPI specification, _GTS is to be executed right prior to entering
the system sleep state and _BFS is to be executed right after the
platfor firmware has returned control to the OS on wake up.

Move the execution of _GTS and _BFS to the right places.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:56 -05:00
Rafael J. Wysocki c697eecebc Suspend: Introduce begin() and end() callbacks
On ACPI systems the target state set by acpi_pm_set_target() is
reset by acpi_pm_finish(), but that need not be called if the
suspend fails.  All platforms that use the .set_target() global
suspend callback are affected by analogous issues.

For this reason, we need an additional global suspend callback that
will reset the target state regardless of whether or not the suspend
is successful.  Also, it is reasonable to rename the .set_target()
callback, since it will be used for a different purpose on ACPI
systems (due to ACPI 1.0x code ordering requirements).

Introduce the global suspend callback .end() to be executed at the
end of the suspend sequence and rename the .set_target() global
suspend callback to .begin().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:56 -05:00
Shaohua Li a3627f67b1 ACPI: clear GPE earily in resume to avoid warning
Wakeup GPE hasn't a handler. If system is waked up by such GPE like a
USB hotplug, I saw a lot of error reporting the GPE hasn't handler.
acpi_leave_sleep_state will clear the GPE but it's too late, we should
do it before interrupt is re-enabled.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:55 -05:00
Johannes Berg 90dda1cb6a PM: Make PM_TRACE more architecture independent
When trying to debug a suspend failure I started implementing
PM_TRACE for powerpc. I then noticed that I'm debugging a suspend
failure and so PM_TRACE isn't useful at all, but thought that
nonetheless this could be useful in the future.

Basically, to support PM_TRACE, you add a Kconfig option that
selects PM_TRACE and provides the infrastructure as per the
help text of PM_TRACE.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:54 -05:00
Rafael J. Wysocki 964756a52f ACPI: Fix mismerge in acpi_hibernation_finish
Some code in acpi_hibernation_finish() was moved to acpi_hibernation_leave(),
but the old copy had been left (it's harmless, but also useless).  Remove it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-01 18:30:53 -05:00
Greg Kroah-Hartman fd7d1ced29 PCI: make pci_bus a struct device
This moves the pci_bus class device to be a real struct device and at
the same time, place it in the device tree in the correct location.

Note, the old "bridge" symlink is now gone, but this was a non-standard
link and no userspace program used it.  If you need to determine the
device that the bus is on, follow the standard device symlink, or walk
up the device tree.


Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:31 -08:00
Greg Kroah-Hartman 367b09fec4 PCI: fix codingstyle issues in drivers/pci/pci.h
Fixes a few coding style issues in the internal pci.h file

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:31 -08:00
Shaohua Li 6c723d5bd8 PCI: PCIE ASPM support
PCI Express ASPM defines a protocol for PCI Express components in the D0
state to reduce Link power by placing their Links into a low power state
and instructing the other end of the Link to do likewise. This
capability allows hardware-autonomous, dynamic Link power reduction
beyond what is achievable by software-only controlled power management.
However, The device should be configured by software appropriately.
Enabling ASPM will save power, but will introduce device latency.

This patch adds ASPM support in Linux. It introduces a global policy for
ASPM, a sysfs file /sys/module/pcie_aspm/parameters/policy can control
it. The interface can be used as a boot option too. Currently we have
below setting:
        -default, BIOS default setting
        -powersave, highest power saving mode, enable all available ASPM
state
and clock power management
        -performance, highest performance, disable ASPM and clock power
management
By default, the 'default' policy is used currently.

In my test, power difference between powersave mode and performance mode
is about 1.3w in a system with 3 PCIE links.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:30 -08:00
Ian Abbott 5c796ae7a7 PCI: Fix fakephp deadlock
If the fakephp driver is used to emulate removal of a PCI device by
writing text string "0" to the "power" sysfs attribute file, this causes
its parent directory and its contents (including the "power" file) to be
deleted before the write operation returns.  Unfortunately, it ends up
in a deadlock waiting for itself to complete.

The deadlock is as follows: sysfs_write_file calls flush_write_buffer
which calls sysfs_get_active_two before calling power_write_file in
pci_hotplug_core.c via the sysfs store operation. The power_write_file
function calls disable_slot in fakephp.c via the slot operation.  The
disable_slot function calls remove_slot which calls pci_hp_deregister
(back in pci_hotplug_core.c) which calls fs_remove_slot which calls
sysfs_remove_file to remove the "power" file. The sysfs_remove_file
function calls sysfs_hash_and_remove which calls sysfs_addrm_finish
which calls sysfs_deactivate. The sysfs_deactivate function sees that
something has an active reference on the sysfs_dirent (from the
previous call to sysfs_get_active_two back up the call stack somewhere)
so waits for the active reference to go away, which is of course
impossible.

The problem has been present since 2.6.21.

This patch breaks the deadlock by queuing work queue items on a single-
threaded work queue to remove a slot from sysfs, and to rescan the PCI
buses.  There is also some protection against disabling a slot that is
already being removed.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:30 -08:00
Shane Huang 4600c9d74e PCI: modify SB700 SATA MSI quirk
SB700 SATA MSI bug will be fixed in SB700 revision A21 at hardware
level, but the SB700 revision older than A21 will also be found in the
market.  This patch modify the original quirk commit
bc38b411fe instead of withdrawing it.
The patch also removes quirk to 0x4395 because 0x4395 is SB800 device
ID.

Signed-off-by: Shane Huang <shane.huang@amd.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:30 -08:00
Andrew Patterson 3c75e23784 PCI: Run ACPI _OSC method on root bridges only
According to the PCI Firmware Specification Revision 3.0 section 4.5, _OSC
should only be called on a root brdige.  Here is the relevant passage: "The
_OSC interface defined in this section applies only to Host Bridge ACPI
devices that originate PCI, PCI-X, or PCI Express hierarchies". Changed the
code to find the parent root bridge of the device and call _OSC on that.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:30 -08:00
Andrew Patterson d8634ddd37 PCI ACPI: AER driver should only register PCIe devices with _OSC
AER is only used with PCIe devices so we should only check PCIe devices for
_OSC support.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:30 -08:00
Andrew Patterson c277835723 PCI ACPI: Added a function to register _OSC with only PCIe devices.
The function pci_osc_support_set() traverses every root bridge when
checking for _OSC support for a capability.  It quits as soon as it finds a
device/bridge that doesn't support the requested capability. This won't
work for systems that have mixed PCI and PCIe bridges when checking for
PCIe features.  I split this function into two -- pci_osc_support_set() and
pcie_osc_support_set(). The latter is used when only PCIe devices should be
traversed.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:29 -08:00
Jan Engelhardt 02d90fc343 PCI: constify function pointer tables
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:29 -08:00
Mathieu Segaud add771840b PCI: Convert drivers/pci/proc.c to use unlocked_ioctl
Change access to inode thru file->f_dentry->d_inode, and add explicit
lock/unlock_kernel() calls.


Signed-off-by: Mathieu Segaud <mathieu.segaud@regala.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:29 -08:00
Kenji Kaneshige 2326e2b999 pciehp: block new requests from the device before power off
Disable Bus Master, SERR# and INTx to ensure that no new Requests will
be generated from the device before turning power off, in accordance
with the specification.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:28 -08:00
Kenji Kaneshige f1050a35cd pciehp: workaround against Bad DLLP during power off
Set Bad DLLP Mask bit in Correctable Error Mask Register during
turning power off the slot.

This is the workaround against Bad DLLP error that sometimes happen
during turning power off on the slot which conforms to PCI Express
1.0a spec. The cause of this error seems that PCI Express 1.0a spec
doesn't have the following consideration that was added to PCI Express
1.1 spec.

    "If the port is associated with a hot-pluggable slot (Hot-Plug
    Capable bit in the Slot Capabilities register set to 1b), and
    Power Controller Control bit in Slot Control register is 1b(Off),
    then any transition to DL Inactive must not be considered an
    error."

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:28 -08:00
Kenji Kaneshige 8bb7c7af1f pciehp: wait for 1000ms before LED operation after power off
After turning power off, we must wait for at least 1 second *before*
LED operation.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:28 -08:00
Benjamin Herrenschmidt 7cbe5b6005 PCI: Remove pci_enable_device_bars()
Now that all in-tree users are gone, this removes pci_enable_device_bars()
completely.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:28 -08:00
Benjamin Herrenschmidt 0948391641 PCI: Remove users of pci_enable_device_bars()
This patch converts users of pci_enable_device_bars() to the new
pci_enable_device_{io,mem} interface.

The new API fits nicely, except maybe for the QLA case where a bit of
code re-organization might be a good idea but I prefer sticking to the
simple patch as I don't have hardware to test on.

I'll also need some feedback on the cs5520 change.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Benjamin Herrenschmidt b718989da7 PCI: Add pci_enable_device_{io,mem} intefaces
The pci_enable_device_bars() interface isn't well suited to PCI
because you can't actually enable/disable BARs individually on
a device. So for example, if a device has 2 memory BARs 0 and 1,
and one of them (let's say 1) has not been successfully allocated
by the firmware or the kernel, then enabling memory decoding
shouldn't be permitted for the entire device since it will decode
whatever random address is still in that BAR 1.

So a device must be either fully enabled for IO, for Memory, or
for both. Not on a per-BAR basis.

This provides two new functions, pci_enable_device_io() and
pci_enable_device_mem() to replace pci_enable_device_bars(). The
implementation internally builds a BAR mask in order to be able
to use existing arch infrastructure.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Shaohua Li 017fc480cc PCI: avoid save the same type of cap multiple times
Avoid adding the same type of cap multiple times, otherwise we will see dead loop.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Shaohua Li ec0a3a27fb PCI: correctly initialize a structure for pcie_save_pcix_state()
save_state->cap_nr should be correctly set, otherwise we can't find the
saved cap at resume.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Shaohua Li f34303de9e PCI: fix typo in pci_save_pcix_state
pci_save/store_state has multiple bugs, which will cause cap can't be
saved/restored correctly. Below 3 patches fix them.


fix the typo in pci_save_pcix_state

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
bjorn.helgaas@hp.com f0fda801da PCI: use dev_printk in quirk messages
Convert quirk printks to dev_printk().

I made the MSI disable messages a little more consistent:

    - always use "disabled", not "deactivated"
    - specify "device MSI disabled" or "subordinate MSI disabled" when
      disabling MSI for only a specific device or subordinate bus

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:26 -08:00
bjorn.helgaas@hp.com 9f23ed3b94 PCI: print quirk name in debug messages
Instead of printing this:

    PCI: Calling quirk c023b250 for 0000:00:00.0

we can print this:

    pci 0000:00:00.0: calling quirk 0xc023b270: quirk_cardbus_legacy+0x0/0x30()

The address is superfluous because sprint_symbol() includes the
address if the symbol lookup fails, but this is the same style used
in do_initcalls() and pnp_fixup_device().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:26 -08:00
Ivan Kokshaysky e64aeccbec PCI: fix for quirk_e100_interrupt()
Check that the e100 is in the D0 power state. If it's not, it won't
respond to MMIO accesses and we end up with master-abort machine
checks on some platforms.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:26 -08:00
Joe Perches 3609801ecc PCI: Spelling fixes
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:26 -08:00
Adrian Bunk 6a9e7f2031 PCI: drivers/pci/msi.c: move arch hooks to the top
This patch fixes the following problem present with older gcc versions:

<--  snip  -->

...
  CC      drivers/pci/msi.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:692: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:704: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:724: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
...

<--  snip  -->

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:25 -08:00
Sebastien Dugue 6bae1d96c6 PCI: quirk: enable MSI Mapping on HT1000
Add a quirk to enable the MSI mapping capability on HyperTransport bridges.

Wire Broadcom's HT1000 to use the quirk.

Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andy Currid <acurrid@nvidia.com>
Cc: Peer Chen <pchen@nvidia.com>
Cc: Prakash Punnoor <prakash@punnoor.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michael Chan <mchan@broadcom.com>
Cc: Greg KH <greg@kroah.com>
Cc: Andy Currid <acurrid@nvidia.com>
Cc: Peer Chen <pchen@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:25 -08:00
Benjamin Herrenschmidt 6015fbefc4 PCI: Fix warning in setup-res.c on 32-bit platforms with 64-bit resources
This adds appropriate casts to avoid a warning and print the correct
values in pr_debug.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:25 -08:00
Benjamin Herrenschmidt c40a22e0ce PCI: Fix bus resource assignment on 32 bits with 64b resources
The current pci_assign_unassigned_resources() code doesn't work properly
on 32 bits platforms with 64 bits resources. The main reason is the use
of unsigned long in various places instead of resource_size_t.

This is a pre-requisite for making powerpc use the generic code instead of
its own half-useful implementation.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:25 -08:00
Rolf Eike Beer f07234b66a PCI Hotplug: PCIeHP: Fix some whitespace damage
PCIeHP: Fix some whitespace damage

Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:24 -08:00
Kenji Kaneshige 9515930ea2 PCI Hotplug: pciehp: use generic function to find ext capability
Remove duplicated code to find an extend capability in PCIEHP driver.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:24 -08:00
Kenji Kaneshige 941f10e941 PCI Hotplug: pciehp: remove needless hp_slot calculation
Remove needless hp_slot calculation. This has no functional changes.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:24 -08:00
Kenji Kaneshige 0837974ddb PCI Hotplug: pciehp: remove needless members from struct controller
Remove needless members from struct controller. This has no functional
changes.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:24 -08:00
MUNEDA Takahiro 25d6ddcd78 PCI Hotplug: acpiphp: remove unneeded acpi_get_name function call
acpi_get_name() is called before and after dbg(). The latter is
useless and should be removed.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:24 -08:00
MUNEDA Takahiro 5a340ed879 PCI Hotplug: acpiphp: fix trivial typos
fix trivial typos.

Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:23 -08:00
Mark Lord ecdde93962 PCIe: fix double initialization bug
Earlier patches to split out the hardware init for PCIe hotplug resulted in
some one-time initializations being redone on every resume cycle.  Eg.
irq/polling initialization.

This patch splits the hardware init into two parts, and separates the
one-time initializations from those so that they only ever get done once,
as intended.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:23 -08:00
Mark Lord cd2fe83a81 PCIE: Make use of the previously split out pcie_init_enable_events() function
Make use of the previously split out pcie_init_enable_events() function
to reinitialize the hotplug hardware on resume from suspend, but only
when pciehp_force==1.  Otherwise behaviour is unmodified.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:23 -08:00
Mark Lord 08e7a7d27d PCI: more fixes for PCIe Hotplug so that it works with ExpressCard slots on Dell notebooks (and others?) in conjunction with modparam of pciehp_force=1
Split out the hotplug hardware initialization code from pcie_init()
into pcie_init_enable_events(), without changing any functionality.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:23 -08:00
Mark Lord 0a3c33d77f PCIE: fix PCIe Hotplug so that it works with ExpressCard slots on Dell notebooks (and others?) in conjunction with modparam of pciehp_force=1.
Fix pciehp_probe() to deal with ExpressCard cards
that were inserted prior to the driver being loaded.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:22 -08:00
Joe Perches a6f29a98af PCI: Add missing "space" in printk messages
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:22 -08:00
Linas Vepstas 94688cf245 PCI: export pci_restore_msi_state()
PCI error recovery usually involves the PCI adapter being reset.
If the device is using MSI, the reset will cause the MSI state
to be lost; the device driver needs to restore the MSI state.

The pci_restore_msi_state() routine is currently protected
by CONFIG_PM; remove this, and also export the symbol, so
that it can be used in a modle.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:22 -08:00
Linas Vepstas 1b7c9fcaa1 pci hotplug: fix rpaphp directory naming
Fix presentation of the slot number in the /sys/bus/pci/slots
directory to match that used in the majority of other drivers.

> Greg said:
> How is anyone supposed to write sane managability tools in the
> presence
> of such anarchy?
>
> > ~ # cat /sys/bus/pci/slots/0000:00:02.2/phy_location
> > U787A.001.DNZ00Z5-P1-C2
>
> Right.  This should look like:
>
> # cat /sys/bus/pci/slots/U787A.001.DNZ00Z5-P1-C2/address
> 0000:00:02

This patch implements exactly what you describe. Boot tested.
I assume you really mean it -- if so, then please review and
ack the patch !?

I have absolutely no clue if this breaks any existing IBM tools.
I'm pretty sure it doesn't ... but attention Mike Strosaker! does it?

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: <strosake@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:22 -08:00
Jean Delvare 677cc6443b PCI: Unhide the SMBus on the HP xw4100
Unhide the SMBus on the HP xw4100. This gives access to a hardware
monitoring chip (ADT7463) and to the memory module SPD EEPROMs. I
checked that ACPI wasn't accessing the SMBus, so it should be safe.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:22 -08:00
Fenghua Yu 093f87d279 PCI: More Sanity checks for DMAR
Add and changes a few sanity checks in dmar.c.

1.  The haw field in ACPI DMAR table in VT-d spec doesn't describe the
   range of haw.  But since DMA page size is 4KB in DMA remapping, haw
   should be at least 4KB.  The current VT-d code in dmar.c returns failure
   when haw==0.  This sanity check is not accurate and execution can pass
   when haw is less than one page size 4KB.  This patch changes the haw
   sanity check to validate if haw is less than 4KB.

2. Add dmar_rmrr_units verification.

3. Add parse_dmar_table() verification.

[akpm@linux-foundation.org: coding-style fixes]

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: mark gross <mgross@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:21 -08:00
Andrew Morton 652c538eb5 PCI: drivers/pci/quirks.c: coding-style cleanup
Remove lots of space-before-) instances.  Perhaps these were a workaround for
problems in some long-dead cpp version.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:21 -08:00
Adrian Bunk 943e6c0d5c PCI: remove additional pci_scan_child_bus() prototype
There's already a prototype for pci_scan_child_bus() at the correct place in
pci.h, so there's no reason for an additional one.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:21 -08:00
Adrian Bunk b73e96878d PCI: always export pci_scan_single_device
This patch fixes the following build error with CONFIG_HOTPLUG=n:

  MODPOST 2137 modules
ERROR: "pci_scan_single_device" [drivers/edac/i82875p_edac.ko] undefined!

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:21 -08:00
Diego Woitasen 0741a951e8 PCI: remove unneeded lock_kernel() in drivers/pci/syscall.c.
sys_pciconfig_{read,write}() are protected against PCI removal with the
reference count in struct pci_dev.  The concurrency of
pci_user_{read,write}_config_* functions are already protected by pci_lock
in drivers/pci/access.c.

Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:21 -08:00
Lee Schermerhorn 74e27e44b0 PCI: Mem Policy: fix mempolicy usage in pci driver
In an attempt to ensure memory allocation from the local node, the pci
driver temporarily replaces the current task's memory policy with the
system default policy.  Trying to be a good citizen, the driver then call's
mpol_get() on the new policy.  When it's finished probing, it undoes the
'_get by calling mpol_free() [on the system default policy] and then
restores the current task's saved mempolicy.

A couple of issues here:

1) it's never necessary to set a task's mempolicy to the
   system default policy in order to get system default
   allocation behavior.  Simply set the current task's
   mempolicy to NULL and allocations will fall back to
   system default policy.

2) we should never [need to] call mpol_free() on the system
   default policy.  [I plan on trapping this with a VM_BUG_ON()
   in a subsequent patch.]

This patch removes the calls to mpol_get() and mpol_free()
and uses NULL for the temporary task mempolicy to effect
default allocation behavior.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:20 -08:00
Tim Yamin 53a9bf4267 PCI: VIA CX700 quirk to disable PCI Bus Parking
PCI Bus Parking and PCI Master read caching on the VIA CX700 is buggy and
can lead to problems such as USB2.0 packet loss if a VT6212L controller
is on the PCI bus. It's disabled by default, but some BIOSes turn these
features on and this patch reverts the configuration to the safe defaults.

Signed-off-by: Tim Yamin <tim.yamin@zonbu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:20 -08:00
Auke Kok 2b1afa87e1 PCI: quirk_vialatency: Omit reading pci revision ID
Don't read the revision ID unnecessary since the PCI subsystem
fills this field in already.

Updated to fix a thinko bug in a previously sent patch.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:20 -08:00
Alex Chiang 561e55e8e3 PCI: hotplug: Link fakephp last
Currently, fakephp will claim all devices; we really only want it
to claim those not in slots.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:20 -08:00
Alex Chiang 41ece3829f PCI: hotplug: pci_hotplug_core whitespace fix
Remove superfluous space.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:20 -08:00
Alex Chiang 1d5b95ab8e PCI: hotplug: acpiphp: Remove unused variable from acpiphp
Remove unused variable from acpiphp.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:20 -08:00
Kristen Carlson Accardi 1ec87280eb PCI: hotplug: remove Experimental
Remove EXPERIMENTAL from PCI Hot Plug.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:19 -08:00
Joonwoo Park f362b8bffe PCI: hotplug: Switch to pci_get_bus_and_slot
Thank you so much for your check & advise.
This time, I've tried on ibmphp_core.c, is it OK?

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:19 -08:00
Shaohua Li 4348a2dc49 pcie: utilize pcie transaction pending bit
PCIE has a mechanism to wait for Non-Posted request to complete. I think
pci_disable_device is a good place to do this.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:19 -08:00
Shaohua Li 39ec4561b3 pcie port driver: correctly detect native PME feature
Native PME is capability of root port or root complex event collector.
It's not determined by PCI PME capability.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:18 -08:00
Adrian Bunk eb003ec265 PCI: drivers/pci/: remove unused exports
This patch removes the following unused exports:
- remove the following unused EXPORT_SYMBOL's:
 - pci-acpi.c: pci_osc_support_set
 - proc.c: pci_proc_detach_bus
- remove the following unused EXPORT_SYMBOL_GPL's:
  - bus.c: pci_walk_bus
  - probe.c: pci_create_bus
  - setup-res.c: pci_claim_resource

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:18 -08:00