diff options
415 files changed, 2493 insertions, 1540 deletions
diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index 4d4ce0e61e4..b4665b9c40b 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | </orgname> | 16 | </orgname> |
| 17 | 17 | ||
| 18 | <address> | 18 | <address> |
| 19 | <email>hjk@linutronix.de</email> | 19 | <email>hjk@hansjkoch.de</email> |
| 20 | </address> | 20 | </address> |
| 21 | </affiliation> | 21 | </affiliation> |
| 22 | </author> | 22 | </author> |
| @@ -114,7 +114,7 @@ GPL version 2. | |||
| 114 | 114 | ||
| 115 | <para>If you know of any translations for this document, or you are | 115 | <para>If you know of any translations for this document, or you are |
| 116 | interested in translating it, please email me | 116 | interested in translating it, please email me |
| 117 | <email>hjk@linutronix.de</email>. | 117 | <email>hjk@hansjkoch.de</email>. |
| 118 | </para> | 118 | </para> |
| 119 | </sect1> | 119 | </sect1> |
| 120 | 120 | ||
| @@ -171,7 +171,7 @@ interested in translating it, please email me | |||
| 171 | <title>Feedback</title> | 171 | <title>Feedback</title> |
| 172 | <para>Find something wrong with this document? (Or perhaps something | 172 | <para>Find something wrong with this document? (Or perhaps something |
| 173 | right?) I would love to hear from you. Please email me at | 173 | right?) I would love to hear from you. Please email me at |
| 174 | <email>hjk@linutronix.de</email>.</para> | 174 | <email>hjk@hansjkoch.de</email>.</para> |
| 175 | </sect1> | 175 | </sect1> |
| 176 | </chapter> | 176 | </chapter> |
| 177 | 177 | ||
diff --git a/Documentation/arm/OMAP/DSS b/Documentation/arm/OMAP/DSS index 0af0e9eed5d..888ae7b83ae 100644 --- a/Documentation/arm/OMAP/DSS +++ b/Documentation/arm/OMAP/DSS | |||
| @@ -255,9 +255,10 @@ framebuffer parameters. | |||
| 255 | Kernel boot arguments | 255 | Kernel boot arguments |
| 256 | --------------------- | 256 | --------------------- |
| 257 | 257 | ||
| 258 | vram=<size> | 258 | vram=<size>[,<physaddr>] |
| 259 | - Amount of total VRAM to preallocate. For example, "10M". omapfb | 259 | - Amount of total VRAM to preallocate and optionally a physical start |
| 260 | allocates memory for framebuffers from VRAM. | 260 | memory address. For example, "10M". omapfb allocates memory for |
| 261 | framebuffers from VRAM. | ||
| 261 | 262 | ||
| 262 | omapfb.mode=<display>:<mode>[,...] | 263 | omapfb.mode=<display>:<mode>[,...] |
| 263 | - Default video mode for specified displays. For example, | 264 | - Default video mode for specified displays. For example, |
diff --git a/Documentation/development-process/2.Process b/Documentation/development-process/2.Process index 97726eba610..911a4518634 100644 --- a/Documentation/development-process/2.Process +++ b/Documentation/development-process/2.Process | |||
| @@ -154,7 +154,7 @@ The stages that a patch goes through are, generally: | |||
| 154 | inclusion, it should be accepted by a relevant subsystem maintainer - | 154 | inclusion, it should be accepted by a relevant subsystem maintainer - |
| 155 | though this acceptance is not a guarantee that the patch will make it | 155 | though this acceptance is not a guarantee that the patch will make it |
| 156 | all the way to the mainline. The patch will show up in the maintainer's | 156 | all the way to the mainline. The patch will show up in the maintainer's |
| 157 | subsystem tree and into the staging trees (described below). When the | 157 | subsystem tree and into the -next trees (described below). When the |
| 158 | process works, this step leads to more extensive review of the patch and | 158 | process works, this step leads to more extensive review of the patch and |
| 159 | the discovery of any problems resulting from the integration of this | 159 | the discovery of any problems resulting from the integration of this |
| 160 | patch with work being done by others. | 160 | patch with work being done by others. |
| @@ -236,7 +236,7 @@ finding the right maintainer. Sending patches directly to Linus is not | |||
| 236 | normally the right way to go. | 236 | normally the right way to go. |
| 237 | 237 | ||
| 238 | 238 | ||
| 239 | 2.4: STAGING TREES | 239 | 2.4: NEXT TREES |
| 240 | 240 | ||
| 241 | The chain of subsystem trees guides the flow of patches into the kernel, | 241 | The chain of subsystem trees guides the flow of patches into the kernel, |
| 242 | but it also raises an interesting question: what if somebody wants to look | 242 | but it also raises an interesting question: what if somebody wants to look |
| @@ -250,7 +250,7 @@ changes land in the mainline kernel. One could pull changes from all of | |||
| 250 | the interesting subsystem trees, but that would be a big and error-prone | 250 | the interesting subsystem trees, but that would be a big and error-prone |
| 251 | job. | 251 | job. |
| 252 | 252 | ||
| 253 | The answer comes in the form of staging trees, where subsystem trees are | 253 | The answer comes in the form of -next trees, where subsystem trees are |
| 254 | collected for testing and review. The older of these trees, maintained by | 254 | collected for testing and review. The older of these trees, maintained by |
| 255 | Andrew Morton, is called "-mm" (for memory management, which is how it got | 255 | Andrew Morton, is called "-mm" (for memory management, which is how it got |
| 256 | started). The -mm tree integrates patches from a long list of subsystem | 256 | started). The -mm tree integrates patches from a long list of subsystem |
| @@ -275,7 +275,7 @@ directory at: | |||
| 275 | Use of the MMOTM tree is likely to be a frustrating experience, though; | 275 | Use of the MMOTM tree is likely to be a frustrating experience, though; |
| 276 | there is a definite chance that it will not even compile. | 276 | there is a definite chance that it will not even compile. |
| 277 | 277 | ||
| 278 | The other staging tree, started more recently, is linux-next, maintained by | 278 | The other -next tree, started more recently, is linux-next, maintained by |
| 279 | Stephen Rothwell. The linux-next tree is, by design, a snapshot of what | 279 | Stephen Rothwell. The linux-next tree is, by design, a snapshot of what |
| 280 | the mainline is expected to look like after the next merge window closes. | 280 | the mainline is expected to look like after the next merge window closes. |
| 281 | Linux-next trees are announced on the linux-kernel and linux-next mailing | 281 | Linux-next trees are announced on the linux-kernel and linux-next mailing |
| @@ -303,12 +303,25 @@ volatility of linux-next tends to make it a difficult development target. | |||
| 303 | See http://lwn.net/Articles/289013/ for more information on this topic, and | 303 | See http://lwn.net/Articles/289013/ for more information on this topic, and |
| 304 | stay tuned; much is still in flux where linux-next is involved. | 304 | stay tuned; much is still in flux where linux-next is involved. |
| 305 | 305 | ||
| 306 | Besides the mmotm and linux-next trees, the kernel source tree now contains | 306 | 2.4.1: STAGING TREES |
| 307 | the drivers/staging/ directory and many sub-directories for drivers or | 307 | |
| 308 | filesystems that are on their way to being added to the kernel tree | 308 | The kernel source tree now contains the drivers/staging/ directory, where |
| 309 | proper, but they remain in drivers/staging/ while they still need more | 309 | many sub-directories for drivers or filesystems that are on their way to |
| 310 | work. | 310 | being added to the kernel tree live. They remain in drivers/staging while |
| 311 | 311 | they still need more work; once complete, they can be moved into the | |
| 312 | kernel proper. This is a way to keep track of drivers that aren't | ||
| 313 | up to Linux kernel coding or quality standards, but people may want to use | ||
| 314 | them and track development. | ||
| 315 | |||
| 316 | Greg Kroah-Hartman currently (as of 2.6.36) maintains the staging tree. | ||
| 317 | Drivers that still need work are sent to him, with each driver having | ||
| 318 | its own subdirectory in drivers/staging/. Along with the driver source | ||
| 319 | files, a TODO file should be present in the directory as well. The TODO | ||
| 320 | file lists the pending work that the driver needs for acceptance into | ||
| 321 | the kernel proper, as well as a list of people that should be Cc'd for any | ||
| 322 | patches to the driver. Staging drivers that don't currently build should | ||
| 323 | have their config entries depend upon CONFIG_BROKEN. Once they can | ||
| 324 | be successfully built without outside patches, CONFIG_BROKEN can be removed. | ||
| 312 | 325 | ||
| 313 | 2.5: TOOLS | 326 | 2.5: TOOLS |
| 314 | 327 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index d8f36f984fa..6c2f55e05f1 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
| @@ -554,3 +554,13 @@ Why: This is a legacy interface which have been replaced by a more | |||
| 554 | Who: NeilBrown <neilb@suse.de> | 554 | Who: NeilBrown <neilb@suse.de> |
| 555 | 555 | ||
| 556 | ---------------------------- | 556 | ---------------------------- |
| 557 | |||
| 558 | What: i2c_adapter.id | ||
| 559 | When: June 2011 | ||
| 560 | Why: This field is deprecated. I2C device drivers shouldn't change their | ||
| 561 | behavior based on the underlying I2C adapter. Instead, the I2C | ||
| 562 | adapter driver should instantiate the I2C devices and provide the | ||
| 563 | needed platform-specific information. | ||
| 564 | Who: Jean Delvare <khali@linux-fr.org> | ||
| 565 | |||
| 566 | ---------------------------- | ||
diff --git a/Documentation/filesystems/configfs/configfs_example_explicit.c b/Documentation/filesystems/configfs/configfs_example_explicit.c index d428cc9f07f..fd53869f563 100644 --- a/Documentation/filesystems/configfs/configfs_example_explicit.c +++ b/Documentation/filesystems/configfs/configfs_example_explicit.c | |||
| @@ -89,7 +89,7 @@ static ssize_t childless_storeme_write(struct childless *childless, | |||
| 89 | char *p = (char *) page; | 89 | char *p = (char *) page; |
| 90 | 90 | ||
| 91 | tmp = simple_strtoul(p, &p, 10); | 91 | tmp = simple_strtoul(p, &p, 10); |
| 92 | if (!p || (*p && (*p != '\n'))) | 92 | if ((*p != '\0') && (*p != '\n')) |
| 93 | return -EINVAL; | 93 | return -EINVAL; |
| 94 | 94 | ||
| 95 | if (tmp > INT_MAX) | 95 | if (tmp > INT_MAX) |
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 9633da01ff4..792faa3c06c 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
| @@ -617,6 +617,16 @@ and have the following read/write attributes: | |||
| 617 | is configured as an output, this value may be written; | 617 | is configured as an output, this value may be written; |
| 618 | any nonzero value is treated as high. | 618 | any nonzero value is treated as high. |
| 619 | 619 | ||
| 620 | If the pin can be configured as interrupt-generating interrupt | ||
| 621 | and if it has been configured to generate interrupts (see the | ||
| 622 | description of "edge"), you can poll(2) on that file and | ||
| 623 | poll(2) will return whenever the interrupt was triggered. If | ||
| 624 | you use poll(2), set the events POLLPRI and POLLERR. If you | ||
| 625 | use select(2), set the file descriptor in exceptfds. After | ||
| 626 | poll(2) returns, either lseek(2) to the beginning of the sysfs | ||
| 627 | file and read the new value or close the file and re-open it | ||
| 628 | to read the value. | ||
| 629 | |||
| 620 | "edge" ... reads as either "none", "rising", "falling", or | 630 | "edge" ... reads as either "none", "rising", "falling", or |
| 621 | "both". Write these strings to select the signal edge(s) | 631 | "both". Write these strings to select the signal edge(s) |
| 622 | that will make poll(2) on the "value" file return. | 632 | that will make poll(2) on the "value" file return. |
diff --git a/Documentation/hwmon/lm93 b/Documentation/hwmon/lm93 index ac711f357fa..7a10616d0b4 100644 --- a/Documentation/hwmon/lm93 +++ b/Documentation/hwmon/lm93 | |||
| @@ -11,7 +11,7 @@ Authors: | |||
| 11 | Mark M. Hoffman <mhoffman@lightlink.com> | 11 | Mark M. Hoffman <mhoffman@lightlink.com> |
| 12 | Ported to 2.6 by Eric J. Bowersox <ericb@aspsys.com> | 12 | Ported to 2.6 by Eric J. Bowersox <ericb@aspsys.com> |
| 13 | Adapted to 2.6.20 by Carsten Emde <ce@osadl.org> | 13 | Adapted to 2.6.20 by Carsten Emde <ce@osadl.org> |
| 14 | Modified for mainline integration by Hans J. Koch <hjk@linutronix.de> | 14 | Modified for mainline integration by Hans J. Koch <hjk@hansjkoch.de> |
| 15 | 15 | ||
| 16 | Module Parameters | 16 | Module Parameters |
| 17 | ----------------- | 17 | ----------------- |
diff --git a/Documentation/hwmon/max6650 b/Documentation/hwmon/max6650 index 8be7beb9e3e..c565650fcfc 100644 --- a/Documentation/hwmon/max6650 +++ b/Documentation/hwmon/max6650 | |||
| @@ -8,7 +8,7 @@ Supported chips: | |||
| 8 | Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf | 8 | Datasheet: http://pdfserv.maxim-ic.com/en/ds/MAX6650-MAX6651.pdf |
| 9 | 9 | ||
| 10 | Authors: | 10 | Authors: |
| 11 | Hans J. Koch <hjk@linutronix.de> | 11 | Hans J. Koch <hjk@hansjkoch.de> |
| 12 | John Morris <john.morris@spirentcom.com> | 12 | John Morris <john.morris@spirentcom.com> |
| 13 | Claus Gindhart <claus.gindhart@kontron.com> | 13 | Claus Gindhart <claus.gindhart@kontron.com> |
| 14 | 14 | ||
diff --git a/Documentation/power/opp.txt b/Documentation/power/opp.txt index 44d87ad3cea..cd445582d1f 100644 --- a/Documentation/power/opp.txt +++ b/Documentation/power/opp.txt | |||
| @@ -37,6 +37,9 @@ Typical usage of the OPP library is as follows: | |||
| 37 | SoC framework -> modifies on required cases certain OPPs -> OPP layer | 37 | SoC framework -> modifies on required cases certain OPPs -> OPP layer |
| 38 | -> queries to search/retrieve information -> | 38 | -> queries to search/retrieve information -> |
| 39 | 39 | ||
| 40 | Architectures that provide a SoC framework for OPP should select ARCH_HAS_OPP | ||
| 41 | to make the OPP layer available. | ||
| 42 | |||
| 40 | OPP layer expects each domain to be represented by a unique device pointer. SoC | 43 | OPP layer expects each domain to be represented by a unique device pointer. SoC |
| 41 | framework registers a set of initial OPPs per device with the OPP layer. This | 44 | framework registers a set of initial OPPs per device with the OPP layer. This |
| 42 | list is expected to be an optimally small number typically around 5 per device. | 45 | list is expected to be an optimally small number typically around 5 per device. |
diff --git a/MAINTAINERS b/MAINTAINERS index 88b74a75d93..f51ec0a22ff 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -945,7 +945,7 @@ M: Magnus Damm <magnus.damm@gmail.com> | |||
| 945 | L: linux-sh@vger.kernel.org | 945 | L: linux-sh@vger.kernel.org |
| 946 | W: http://oss.renesas.com | 946 | W: http://oss.renesas.com |
| 947 | Q: http://patchwork.kernel.org/project/linux-sh/list/ | 947 | Q: http://patchwork.kernel.org/project/linux-sh/list/ |
| 948 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/genesis-2.6.git | 948 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git rmobile-latest |
| 949 | S: Supported | 949 | S: Supported |
| 950 | F: arch/arm/mach-shmobile/ | 950 | F: arch/arm/mach-shmobile/ |
| 951 | F: drivers/sh/ | 951 | F: drivers/sh/ |
| @@ -2008,6 +2008,7 @@ F: drivers/hwmon/dme1737.c | |||
| 2008 | DOCBOOK FOR DOCUMENTATION | 2008 | DOCBOOK FOR DOCUMENTATION |
| 2009 | M: Randy Dunlap <rdunlap@xenotime.net> | 2009 | M: Randy Dunlap <rdunlap@xenotime.net> |
| 2010 | S: Maintained | 2010 | S: Maintained |
| 2011 | F: scripts/kernel-doc | ||
| 2011 | 2012 | ||
| 2012 | DOCKING STATION DRIVER | 2013 | DOCKING STATION DRIVER |
| 2013 | M: Shaohua Li <shaohua.li@intel.com> | 2014 | M: Shaohua Li <shaohua.li@intel.com> |
| @@ -2018,6 +2019,7 @@ F: drivers/acpi/dock.c | |||
| 2018 | DOCUMENTATION | 2019 | DOCUMENTATION |
| 2019 | M: Randy Dunlap <rdunlap@xenotime.net> | 2020 | M: Randy Dunlap <rdunlap@xenotime.net> |
| 2020 | L: linux-doc@vger.kernel.org | 2021 | L: linux-doc@vger.kernel.org |
| 2022 | T: quilt oss.oracle.com/~rdunlap/kernel-doc-patches/current/ | ||
| 2021 | S: Maintained | 2023 | S: Maintained |
| 2022 | F: Documentation/ | 2024 | F: Documentation/ |
| 2023 | 2025 | ||
| @@ -2435,6 +2437,7 @@ F: drivers/net/wan/sdla.c | |||
| 2435 | FRAMEBUFFER LAYER | 2437 | FRAMEBUFFER LAYER |
| 2436 | L: linux-fbdev@vger.kernel.org | 2438 | L: linux-fbdev@vger.kernel.org |
| 2437 | W: http://linux-fbdev.sourceforge.net/ | 2439 | W: http://linux-fbdev.sourceforge.net/ |
| 2440 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6.git | ||
| 2438 | S: Orphan | 2441 | S: Orphan |
| 2439 | F: Documentation/fb/ | 2442 | F: Documentation/fb/ |
| 2440 | F: drivers/video/fb* | 2443 | F: drivers/video/fb* |
| @@ -5705,7 +5708,7 @@ M: Paul Mundt <lethal@linux-sh.org> | |||
| 5705 | L: linux-sh@vger.kernel.org | 5708 | L: linux-sh@vger.kernel.org |
| 5706 | W: http://www.linux-sh.org | 5709 | W: http://www.linux-sh.org |
| 5707 | Q: http://patchwork.kernel.org/project/linux-sh/list/ | 5710 | Q: http://patchwork.kernel.org/project/linux-sh/list/ |
| 5708 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git | 5711 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6.git sh-latest |
| 5709 | S: Supported | 5712 | S: Supported |
| 5710 | F: Documentation/sh/ | 5713 | F: Documentation/sh/ |
| 5711 | F: arch/sh/ | 5714 | F: arch/sh/ |
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 2 | 1 | VERSION = 2 |
| 2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
| 3 | SUBLEVEL = 37 | 3 | SUBLEVEL = 37 |
| 4 | EXTRAVERSION = -rc1 | 4 | EXTRAVERSION = -rc2 |
| 5 | NAME = Flesh-Eating Bats with Fangs | 5 | NAME = Flesh-Eating Bats with Fangs |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 8ae3d48d504..db524e75c4a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -646,7 +646,7 @@ config ARCH_S3C2410 | |||
| 646 | select ARCH_HAS_CPUFREQ | 646 | select ARCH_HAS_CPUFREQ |
| 647 | select HAVE_CLK | 647 | select HAVE_CLK |
| 648 | select ARCH_USES_GETTIMEOFFSET | 648 | select ARCH_USES_GETTIMEOFFSET |
| 649 | select HAVE_S3C2410_I2C | 649 | select HAVE_S3C2410_I2C if I2C |
| 650 | help | 650 | help |
| 651 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics | 651 | Samsung S3C2410X CPU based systems, such as the Simtec Electronics |
| 652 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or | 652 | BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or |
| @@ -676,8 +676,8 @@ config ARCH_S3C64XX | |||
| 676 | select S3C_DEV_NAND | 676 | select S3C_DEV_NAND |
| 677 | select USB_ARCH_HAS_OHCI | 677 | select USB_ARCH_HAS_OHCI |
| 678 | select SAMSUNG_GPIOLIB_4BIT | 678 | select SAMSUNG_GPIOLIB_4BIT |
| 679 | select HAVE_S3C2410_I2C | 679 | select HAVE_S3C2410_I2C if I2C |
| 680 | select HAVE_S3C2410_WATCHDOG | 680 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 681 | help | 681 | help |
| 682 | Samsung S3C64XX series based systems | 682 | Samsung S3C64XX series based systems |
| 683 | 683 | ||
| @@ -686,10 +686,10 @@ config ARCH_S5P64X0 | |||
| 686 | select CPU_V6 | 686 | select CPU_V6 |
| 687 | select GENERIC_GPIO | 687 | select GENERIC_GPIO |
| 688 | select HAVE_CLK | 688 | select HAVE_CLK |
| 689 | select HAVE_S3C2410_WATCHDOG | 689 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 690 | select ARCH_USES_GETTIMEOFFSET | 690 | select ARCH_USES_GETTIMEOFFSET |
| 691 | select HAVE_S3C2410_I2C | 691 | select HAVE_S3C2410_I2C if I2C |
| 692 | select HAVE_S3C_RTC | 692 | select HAVE_S3C_RTC if RTC_CLASS |
| 693 | help | 693 | help |
| 694 | Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, | 694 | Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, |
| 695 | SMDK6450. | 695 | SMDK6450. |
| @@ -700,7 +700,7 @@ config ARCH_S5P6442 | |||
| 700 | select GENERIC_GPIO | 700 | select GENERIC_GPIO |
| 701 | select HAVE_CLK | 701 | select HAVE_CLK |
| 702 | select ARCH_USES_GETTIMEOFFSET | 702 | select ARCH_USES_GETTIMEOFFSET |
| 703 | select HAVE_S3C2410_WATCHDOG | 703 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 704 | help | 704 | help |
| 705 | Samsung S5P6442 CPU based systems | 705 | Samsung S5P6442 CPU based systems |
| 706 | 706 | ||
| @@ -711,9 +711,9 @@ config ARCH_S5PC100 | |||
| 711 | select CPU_V7 | 711 | select CPU_V7 |
| 712 | select ARM_L1_CACHE_SHIFT_6 | 712 | select ARM_L1_CACHE_SHIFT_6 |
| 713 | select ARCH_USES_GETTIMEOFFSET | 713 | select ARCH_USES_GETTIMEOFFSET |
| 714 | select HAVE_S3C2410_I2C | 714 | select HAVE_S3C2410_I2C if I2C |
| 715 | select HAVE_S3C_RTC | 715 | select HAVE_S3C_RTC if RTC_CLASS |
| 716 | select HAVE_S3C2410_WATCHDOG | 716 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 717 | help | 717 | help |
| 718 | Samsung S5PC100 series based systems | 718 | Samsung S5PC100 series based systems |
| 719 | 719 | ||
| @@ -726,9 +726,9 @@ config ARCH_S5PV210 | |||
| 726 | select ARM_L1_CACHE_SHIFT_6 | 726 | select ARM_L1_CACHE_SHIFT_6 |
| 727 | select ARCH_HAS_CPUFREQ | 727 | select ARCH_HAS_CPUFREQ |
| 728 | select ARCH_USES_GETTIMEOFFSET | 728 | select ARCH_USES_GETTIMEOFFSET |
| 729 | select HAVE_S3C2410_I2C | 729 | select HAVE_S3C2410_I2C if I2C |
| 730 | select HAVE_S3C_RTC | 730 | select HAVE_S3C_RTC if RTC_CLASS |
| 731 | select HAVE_S3C2410_WATCHDOG | 731 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 732 | help | 732 | help |
| 733 | Samsung S5PV210/S5PC110 series based systems | 733 | Samsung S5PV210/S5PC110 series based systems |
| 734 | 734 | ||
| @@ -739,9 +739,9 @@ config ARCH_S5PV310 | |||
| 739 | select GENERIC_GPIO | 739 | select GENERIC_GPIO |
| 740 | select HAVE_CLK | 740 | select HAVE_CLK |
| 741 | select GENERIC_CLOCKEVENTS | 741 | select GENERIC_CLOCKEVENTS |
| 742 | select HAVE_S3C_RTC | 742 | select HAVE_S3C_RTC if RTC_CLASS |
| 743 | select HAVE_S3C2410_I2C | 743 | select HAVE_S3C2410_I2C if I2C |
| 744 | select HAVE_S3C2410_WATCHDOG | 744 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 745 | help | 745 | help |
| 746 | Samsung S5PV310 series based systems | 746 | Samsung S5PV310 series based systems |
| 747 | 747 | ||
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index ea0d80a89da..e7f9ee63dce 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
| @@ -321,10 +321,9 @@ static struct platform_device omap_wdt_device = { | |||
| 321 | static int __init omap_init_wdt(void) | 321 | static int __init omap_init_wdt(void) |
| 322 | { | 322 | { |
| 323 | if (!cpu_is_omap16xx()) | 323 | if (!cpu_is_omap16xx()) |
| 324 | return; | 324 | return -ENODEV; |
| 325 | 325 | ||
| 326 | platform_device_register(&omap_wdt_device); | 326 | return platform_device_register(&omap_wdt_device); |
| 327 | return 0; | ||
| 328 | } | 327 | } |
| 329 | subsys_initcall(omap_init_wdt); | 328 | subsys_initcall(omap_init_wdt); |
| 330 | #endif | 329 | #endif |
diff --git a/arch/arm/mach-omap1/include/mach/camera.h b/arch/arm/mach-omap1/include/mach/camera.h index fd54b452eb2..847d00f0bb0 100644 --- a/arch/arm/mach-omap1/include/mach/camera.h +++ b/arch/arm/mach-omap1/include/mach/camera.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef __ASM_ARCH_CAMERA_H_ | 1 | #ifndef __ASM_ARCH_CAMERA_H_ |
| 2 | #define __ASM_ARCH_CAMERA_H_ | 2 | #define __ASM_ARCH_CAMERA_H_ |
| 3 | 3 | ||
| 4 | #include <media/omap1_camera.h> | ||
| 5 | |||
| 4 | void omap1_camera_init(void *); | 6 | void omap1_camera_init(void *); |
| 5 | 7 | ||
| 6 | static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info) | 8 | static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info) |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 067f4379c87..53ac762518b 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
| @@ -242,9 +242,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev, | |||
| 242 | mmc[0].gpio_cd = gpio + 0; | 242 | mmc[0].gpio_cd = gpio + 0; |
| 243 | omap2_hsmmc_init(mmc); | 243 | omap2_hsmmc_init(mmc); |
| 244 | 244 | ||
| 245 | /* link regulators to MMC adapters */ | ||
| 246 | devkit8000_vmmc1_supply.dev = mmc[0].dev; | ||
| 247 | |||
| 248 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | 245 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ |
| 249 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 246 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
| 250 | 247 | ||
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 1ca7bdc6485..579d2f0f4dd 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
| @@ -143,7 +143,7 @@ config MACH_SMDK6410 | |||
| 143 | select S3C_DEV_USB_HSOTG | 143 | select S3C_DEV_USB_HSOTG |
| 144 | select S3C_DEV_WDT | 144 | select S3C_DEV_WDT |
| 145 | select SAMSUNG_DEV_KEYPAD | 145 | select SAMSUNG_DEV_KEYPAD |
| 146 | select HAVE_S3C2410_WATCHDOG | 146 | select HAVE_S3C2410_WATCHDOG if WATCHDOG |
| 147 | select S3C64XX_SETUP_SDHCI | 147 | select S3C64XX_SETUP_SDHCI |
| 148 | select S3C64XX_SETUP_I2C1 | 148 | select S3C64XX_SETUP_I2C1 |
| 149 | select S3C64XX_SETUP_IDE | 149 | select S3C64XX_SETUP_IDE |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 32d9e2816e5..d3260542b94 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
| @@ -163,11 +163,13 @@ static struct mtd_partition nor_flash_partitions[] = { | |||
| 163 | .name = "loader", | 163 | .name = "loader", |
| 164 | .offset = 0x00000000, | 164 | .offset = 0x00000000, |
| 165 | .size = 512 * 1024, | 165 | .size = 512 * 1024, |
| 166 | .mask_flags = MTD_WRITEABLE, | ||
| 166 | }, | 167 | }, |
| 167 | { | 168 | { |
| 168 | .name = "bootenv", | 169 | .name = "bootenv", |
| 169 | .offset = MTDPART_OFS_APPEND, | 170 | .offset = MTDPART_OFS_APPEND, |
| 170 | .size = 512 * 1024, | 171 | .size = 512 * 1024, |
| 172 | .mask_flags = MTD_WRITEABLE, | ||
| 171 | }, | 173 | }, |
| 172 | { | 174 | { |
| 173 | .name = "kernel_ro", | 175 | .name = "kernel_ro", |
| @@ -581,6 +583,10 @@ static int fsi_set_rate(int is_porta, int rate) | |||
| 581 | return -EINVAL; | 583 | return -EINVAL; |
| 582 | 584 | ||
| 583 | switch (rate) { | 585 | switch (rate) { |
| 586 | case 44100: | ||
| 587 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 11283000)); | ||
| 588 | ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; | ||
| 589 | break; | ||
| 584 | case 48000: | 590 | case 48000: |
| 585 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000)); | 591 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000)); |
| 586 | clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000)); | 592 | clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000)); |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index 4cd3cae38e7..30b2f400666 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
| @@ -98,7 +98,7 @@ static struct intc_vect intca_vectors[] __initdata = { | |||
| 98 | INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0), | 98 | INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0), |
| 99 | INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220), | 99 | INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220), |
| 100 | INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260), | 100 | INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260), |
| 101 | INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0), | 101 | INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ21A, 0x32a0), |
| 102 | INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0), | 102 | INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0), |
| 103 | INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320), | 103 | INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320), |
| 104 | INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360), | 104 | INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360), |
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index f5c5b8da9a8..2c2826571d4 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
| @@ -1983,6 +1983,8 @@ static int omap2_dma_handle_ch(int ch) | |||
| 1983 | 1983 | ||
| 1984 | dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch)); | 1984 | dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(ch)); |
| 1985 | dma_write(1 << ch, IRQSTATUS_L0); | 1985 | dma_write(1 << ch, IRQSTATUS_L0); |
| 1986 | /* read back the register to flush the write */ | ||
| 1987 | dma_read(IRQSTATUS_L0); | ||
| 1986 | 1988 | ||
| 1987 | /* If the ch is not chained then chain_id will be -1 */ | 1989 | /* If the ch is not chained then chain_id will be -1 */ |
| 1988 | if (dma_chan[ch].chain_id != -1) { | 1990 | if (dma_chan[ch].chain_id != -1) { |
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index cd0c090ebc5..b407bc8ad91 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/smp_lock.h> | ||
| 11 | #include <linux/unistd.h> | 10 | #include <linux/unistd.h> |
| 12 | #include <linux/user.h> | 11 | #include <linux/user.h> |
| 13 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 2b63b0191f5..efad12071c2 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/stddef.h> | 19 | #include <linux/stddef.h> |
| 21 | #include <linux/unistd.h> | 20 | #include <linux/unistd.h> |
| 22 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 97478138e36..933bd388efb 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/mm.h> | 29 | #include <linux/mm.h> |
| 30 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/stddef.h> | 31 | #include <linux/stddef.h> |
| 33 | #include <linux/unistd.h> | 32 | #include <linux/unistd.h> |
| 34 | #include <linux/ptrace.h> | 33 | #include <linux/ptrace.h> |
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index 3a078ad3aa4..331de723c67 100644 --- a/arch/ia64/hp/sim/simscsi.c +++ b/arch/ia64/hp/sim/simscsi.c | |||
| @@ -202,7 +202,7 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | static int | 204 | static int |
| 205 | simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | 205 | simscsi_queuecommand_lck (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) |
| 206 | { | 206 | { |
| 207 | unsigned int target_id = sc->device->id; | 207 | unsigned int target_id = sc->device->id; |
| 208 | char fname[MAX_ROOT_LEN+16]; | 208 | char fname[MAX_ROOT_LEN+16]; |
| @@ -326,6 +326,8 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | |||
| 326 | return 0; | 326 | return 0; |
| 327 | } | 327 | } |
| 328 | 328 | ||
| 329 | static DEF_SCSI_QCMD(simscsi_queuecommand) | ||
| 330 | |||
| 329 | static int | 331 | static int |
| 330 | simscsi_host_reset (struct scsi_cmnd *sc) | 332 | simscsi_host_reset (struct scsi_cmnd *sc) |
| 331 | { | 333 | { |
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 18732ab2329..c2a1fc23dd7 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 19 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
| 20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
| 21 | #include <linux/smp_lock.h> | ||
| 22 | #include <linux/stddef.h> | 21 | #include <linux/stddef.h> |
| 23 | #include <linux/unistd.h> | 22 | #include <linux/unistd.h> |
| 24 | #include <linux/ptrace.h> | 23 | #include <linux/ptrace.h> |
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c index 6d3390590e5..e2a63af5d51 100644 --- a/arch/m68knommu/kernel/process.c +++ b/arch/m68knommu/kernel/process.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 20 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | #include <linux/stddef.h> | 22 | #include <linux/stddef.h> |
| 24 | #include <linux/unistd.h> | 23 | #include <linux/unistd.h> |
| 25 | #include <linux/ptrace.h> | 24 | #include <linux/ptrace.h> |
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index 0d0f8049a17..e1b14a6ed54 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
| 16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
| 17 | #include <linux/smp_lock.h> | ||
| 18 | #include <linux/stddef.h> | 17 | #include <linux/stddef.h> |
| 19 | #include <linux/unistd.h> | 18 | #include <linux/unistd.h> |
| 20 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index ba430a03bc7..30394081d9b 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/namei.h> | 28 | #include <linux/namei.h> |
| 29 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
| 30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/syscalls.h> | 31 | #include <linux/syscalls.h> |
| 33 | #include <linux/utsname.h> | 32 | #include <linux/utsname.h> |
| 34 | #include <linux/vfs.h> | 33 | #include <linux/vfs.h> |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index 9779ece2b07..88a0ad14a9c 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/times.h> | 20 | #include <linux/times.h> |
| 21 | #include <linux/time.h> | 21 | #include <linux/time.h> |
| 22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
| 23 | #include <linux/smp_lock.h> | ||
| 24 | #include <linux/sem.h> | 23 | #include <linux/sem.h> |
| 25 | #include <linux/msg.h> | 24 | #include <linux/msg.h> |
| 26 | #include <linux/shm.h> | 25 | #include <linux/shm.h> |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index b6447190e1a..e625e9e034a 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
| @@ -4,6 +4,10 @@ config PPC32 | |||
| 4 | bool | 4 | bool |
| 5 | default y if !PPC64 | 5 | default y if !PPC64 |
| 6 | 6 | ||
| 7 | config 32BIT | ||
| 8 | bool | ||
| 9 | default y if PPC32 | ||
| 10 | |||
| 7 | config 64BIT | 11 | config 64BIT |
| 8 | bool | 12 | bool |
| 9 | default y if PPC64 | 13 | default y if PPC64 |
diff --git a/arch/powerpc/boot/div64.S b/arch/powerpc/boot/div64.S index 722f360a32a..d271ab54267 100644 --- a/arch/powerpc/boot/div64.S +++ b/arch/powerpc/boot/div64.S | |||
| @@ -33,9 +33,10 @@ __div64_32: | |||
| 33 | cntlzw r0,r5 # we are shifting the dividend right | 33 | cntlzw r0,r5 # we are shifting the dividend right |
| 34 | li r10,-1 # to make it < 2^32, and shifting | 34 | li r10,-1 # to make it < 2^32, and shifting |
| 35 | srw r10,r10,r0 # the divisor right the same amount, | 35 | srw r10,r10,r0 # the divisor right the same amount, |
| 36 | add r9,r4,r10 # rounding up (so the estimate cannot | 36 | addc r9,r4,r10 # rounding up (so the estimate cannot |
| 37 | andc r11,r6,r10 # ever be too large, only too small) | 37 | andc r11,r6,r10 # ever be too large, only too small) |
| 38 | andc r9,r9,r10 | 38 | andc r9,r9,r10 |
| 39 | addze r9,r9 | ||
| 39 | or r11,r5,r11 | 40 | or r11,r5,r11 |
| 40 | rotlw r9,r9,r0 | 41 | rotlw r9,r9,r0 |
| 41 | rotlw r11,r11,r0 | 42 | rotlw r11,r11,r0 |
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64f3f0..42850ee00ad 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c | |||
| @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) | |||
| 337 | /* FP registers 32 -> 63 */ | 337 | /* FP registers 32 -> 63 */ |
| 338 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) | 338 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) |
| 339 | if (current) | 339 | if (current) |
| 340 | memcpy(mem, current->thread.evr[regno-32], | 340 | memcpy(mem, ¤t->thread.evr[regno-32], |
| 341 | dbg_reg_def[regno].size); | 341 | dbg_reg_def[regno].size); |
| 342 | #else | 342 | #else |
| 343 | /* fp registers not used by kernel, leave zero */ | 343 | /* fp registers not used by kernel, leave zero */ |
| @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) | |||
| 362 | if (regno >= 32 && regno < 64) { | 362 | if (regno >= 32 && regno < 64) { |
| 363 | /* FP registers 32 -> 63 */ | 363 | /* FP registers 32 -> 63 */ |
| 364 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) | 364 | #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE) |
| 365 | memcpy(current->thread.evr[regno-32], mem, | 365 | memcpy(¤t->thread.evr[regno-32], mem, |
| 366 | dbg_reg_def[regno].size); | 366 | dbg_reg_def[regno].size); |
| 367 | #else | 367 | #else |
| 368 | /* fp registers not used by kernel, leave zero */ | 368 | /* fp registers not used by kernel, leave zero */ |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 2a178b0ebcd..ce6f61c6f87 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
| @@ -497,9 +497,8 @@ static void __init emergency_stack_init(void) | |||
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | /* | 499 | /* |
| 500 | * Called into from start_kernel, after lock_kernel has been called. | 500 | * Called into from start_kernel this initializes bootmem, which is used |
| 501 | * Initializes bootmem, which is unsed to manage page allocation until | 501 | * to manage page allocation until mem_init is called. |
| 502 | * mem_init is called. | ||
| 503 | */ | 502 | */ |
| 504 | void __init setup_arch(char **cmdline_p) | 503 | void __init setup_arch(char **cmdline_p) |
| 505 | { | 504 | { |
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index b1b6043a56c..4e5bf1edc0f 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #include <linux/resource.h> | 23 | #include <linux/resource.h> |
| 24 | #include <linux/times.h> | 24 | #include <linux/times.h> |
| 25 | #include <linux/smp.h> | 25 | #include <linux/smp.h> |
| 26 | #include <linux/smp_lock.h> | ||
| 27 | #include <linux/sem.h> | 26 | #include <linux/sem.h> |
| 28 | #include <linux/msg.h> | 27 | #include <linux/msg.h> |
| 29 | #include <linux/shm.h> | 28 | #include <linux/shm.h> |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 83f534d862d..5e9584405c4 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
| @@ -1123,7 +1123,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
| 1123 | else | 1123 | else |
| 1124 | #endif /* CONFIG_PPC_HAS_HASH_64K */ | 1124 | #endif /* CONFIG_PPC_HAS_HASH_64K */ |
| 1125 | rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, | 1125 | rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, |
| 1126 | subpage_protection(pgdir, ea)); | 1126 | subpage_protection(mm, ea)); |
| 1127 | 1127 | ||
| 1128 | /* Dump some info in case of hash insertion failure, they should | 1128 | /* Dump some info in case of hash insertion failure, they should |
| 1129 | * never happen so it is really useful to know if/when they do | 1129 | * never happen so it is really useful to know if/when they do |
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S index 8b04c54e596..8526bd9d2aa 100644 --- a/arch/powerpc/mm/tlb_low_64e.S +++ b/arch/powerpc/mm/tlb_low_64e.S | |||
| @@ -138,8 +138,11 @@ | |||
| 138 | cmpldi cr0,r15,0 /* Check for user region */ | 138 | cmpldi cr0,r15,0 /* Check for user region */ |
| 139 | std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */ | 139 | std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */ |
| 140 | beq normal_tlb_miss | 140 | beq normal_tlb_miss |
| 141 | |||
| 142 | li r11,_PAGE_PRESENT|_PAGE_BAP_SX /* Base perm */ | ||
| 143 | oris r11,r11,_PAGE_ACCESSED@h | ||
| 141 | /* XXX replace the RMW cycles with immediate loads + writes */ | 144 | /* XXX replace the RMW cycles with immediate loads + writes */ |
| 142 | 1: mfspr r10,SPRN_MAS1 | 145 | mfspr r10,SPRN_MAS1 |
| 143 | cmpldi cr0,r15,8 /* Check for vmalloc region */ | 146 | cmpldi cr0,r15,8 /* Check for vmalloc region */ |
| 144 | rlwinm r10,r10,0,16,1 /* Clear TID */ | 147 | rlwinm r10,r10,0,16,1 /* Clear TID */ |
| 145 | mtspr SPRN_MAS1,r10 | 148 | mtspr SPRN_MAS1,r10 |
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index 36c0c449a89..2a030d89bbc 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c | |||
| @@ -585,6 +585,6 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, | |||
| 585 | ppc64_rma_size = min_t(u64, first_memblock_size, 0x40000000); | 585 | ppc64_rma_size = min_t(u64, first_memblock_size, 0x40000000); |
| 586 | 586 | ||
| 587 | /* Finally limit subsequent allocations */ | 587 | /* Finally limit subsequent allocations */ |
| 588 | memblock_set_current_limit(ppc64_memblock_base + ppc64_rma_size); | 588 | memblock_set_current_limit(first_memblock_base + ppc64_rma_size); |
| 589 | } | 589 | } |
| 590 | #endif /* CONFIG_PPC64 */ | 590 | #endif /* CONFIG_PPC64 */ |
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index c667f0f02c3..3139814f643 100644 --- a/arch/powerpc/platforms/pseries/Kconfig +++ b/arch/powerpc/platforms/pseries/Kconfig | |||
| @@ -47,6 +47,12 @@ config LPARCFG | |||
| 47 | config PPC_PSERIES_DEBUG | 47 | config PPC_PSERIES_DEBUG |
| 48 | depends on PPC_PSERIES && PPC_EARLY_DEBUG | 48 | depends on PPC_PSERIES && PPC_EARLY_DEBUG |
| 49 | bool "Enable extra debug logging in platforms/pseries" | 49 | bool "Enable extra debug logging in platforms/pseries" |
| 50 | help | ||
| 51 | Say Y here if you want the pseries core to produce a bunch of | ||
| 52 | debug messages to the system log. Select this if you are having a | ||
| 53 | problem with the pseries core and want to see more of what is | ||
| 54 | going on. This does not enable debugging in lpar.c, which must | ||
| 55 | be manually done due to its verbosity. | ||
| 50 | default y | 56 | default y |
| 51 | 57 | ||
| 52 | config PPC_SMLPAR | 58 | config PPC_SMLPAR |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 34b7dc12e73..17a11c82e6f 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | * Please address comments and feedback to Linas Vepstas <linas@austin.ibm.com> | 21 | * Please address comments and feedback to Linas Vepstas <linas@austin.ibm.com> |
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #undef DEBUG | ||
| 25 | |||
| 26 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
| 27 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 28 | #include <linux/list.h> | 26 | #include <linux/list.h> |
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index 4b7a062dee1..5fcc92a12d3 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c | |||
| @@ -25,8 +25,6 @@ | |||
| 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #undef DEBUG | ||
| 29 | |||
| 30 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
| 31 | #include <asm/pci-bridge.h> | 29 | #include <asm/pci-bridge.h> |
| 32 | #include <asm/ppc-pci.h> | 30 | #include <asm/ppc-pci.h> |
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug index 45e0c6199f3..05221b13ffb 100644 --- a/arch/s390/Kconfig.debug +++ b/arch/s390/Kconfig.debug | |||
| @@ -6,6 +6,18 @@ config TRACE_IRQFLAGS_SUPPORT | |||
| 6 | 6 | ||
| 7 | source "lib/Kconfig.debug" | 7 | source "lib/Kconfig.debug" |
| 8 | 8 | ||
| 9 | config STRICT_DEVMEM | ||
| 10 | def_bool y | ||
| 11 | prompt "Filter access to /dev/mem" | ||
| 12 | ---help--- | ||
| 13 | This option restricts access to /dev/mem. If this option is | ||
| 14 | disabled, you allow userspace access to all memory, including | ||
| 15 | kernel and userspace memory. Accidental memory access is likely | ||
| 16 | to be disastrous. | ||
| 17 | Memory access is required for experts who want to debug the kernel. | ||
| 18 | |||
| 19 | If you are unsure, say Y. | ||
| 20 | |||
| 9 | config DEBUG_STRICT_USER_COPY_CHECKS | 21 | config DEBUG_STRICT_USER_COPY_CHECKS |
| 10 | bool "Strict user copy size checks" | 22 | bool "Strict user copy size checks" |
| 11 | ---help--- | 23 | ---help--- |
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index a8729ea7e9a..3c987e9ec8d 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h | |||
| @@ -130,6 +130,11 @@ struct page; | |||
| 130 | void arch_free_page(struct page *page, int order); | 130 | void arch_free_page(struct page *page, int order); |
| 131 | void arch_alloc_page(struct page *page, int order); | 131 | void arch_alloc_page(struct page *page, int order); |
| 132 | 132 | ||
| 133 | static inline int devmem_is_allowed(unsigned long pfn) | ||
| 134 | { | ||
| 135 | return 0; | ||
| 136 | } | ||
| 137 | |||
| 133 | #define HAVE_ARCH_FREE_PAGE | 138 | #define HAVE_ARCH_FREE_PAGE |
| 134 | #define HAVE_ARCH_ALLOC_PAGE | 139 | #define HAVE_ARCH_ALLOC_PAGE |
| 135 | 140 | ||
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 1e6449c79ab..53acaa86dd9 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/resource.h> | 25 | #include <linux/resource.h> |
| 26 | #include <linux/times.h> | 26 | #include <linux/times.h> |
| 27 | #include <linux/smp.h> | 27 | #include <linux/smp.h> |
| 28 | #include <linux/smp_lock.h> | ||
| 29 | #include <linux/sem.h> | 28 | #include <linux/sem.h> |
| 30 | #include <linux/msg.h> | 29 | #include <linux/msg.h> |
| 31 | #include <linux/shm.h> | 30 | #include <linux/shm.h> |
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index d60fc439851..2564793ec2b 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <asm/sections.h> | 30 | #include <asm/sections.h> |
| 31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
| 32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
| 33 | #include <linux/hardirq.h> | ||
| 33 | 34 | ||
| 34 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 35 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
| 35 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 36 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
| @@ -212,7 +213,7 @@ static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | |||
| 212 | /* Set the PER control regs, turns on single step for this address */ | 213 | /* Set the PER control regs, turns on single step for this address */ |
| 213 | __ctl_load(kprobe_per_regs, 9, 11); | 214 | __ctl_load(kprobe_per_regs, 9, 11); |
| 214 | regs->psw.mask |= PSW_MASK_PER; | 215 | regs->psw.mask |= PSW_MASK_PER; |
| 215 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK); | 216 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); |
| 216 | } | 217 | } |
| 217 | 218 | ||
| 218 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) | 219 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
| @@ -239,7 +240,7 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | |||
| 239 | __get_cpu_var(current_kprobe) = p; | 240 | __get_cpu_var(current_kprobe) = p; |
| 240 | /* Save the interrupt and per flags */ | 241 | /* Save the interrupt and per flags */ |
| 241 | kcb->kprobe_saved_imask = regs->psw.mask & | 242 | kcb->kprobe_saved_imask = regs->psw.mask & |
| 242 | (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK); | 243 | (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT); |
| 243 | /* Save the control regs that govern PER */ | 244 | /* Save the control regs that govern PER */ |
| 244 | __ctl_store(kcb->kprobe_saved_ctl, 9, 11); | 245 | __ctl_store(kcb->kprobe_saved_ctl, 9, 11); |
| 245 | } | 246 | } |
| @@ -316,8 +317,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) | |||
| 316 | return 1; | 317 | return 1; |
| 317 | 318 | ||
| 318 | ss_probe: | 319 | ss_probe: |
| 319 | if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) | ||
| 320 | local_irq_disable(); | ||
| 321 | prepare_singlestep(p, regs); | 320 | prepare_singlestep(p, regs); |
| 322 | kcb->kprobe_status = KPROBE_HIT_SS; | 321 | kcb->kprobe_status = KPROBE_HIT_SS; |
| 323 | return 1; | 322 | return 1; |
| @@ -350,6 +349,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, | |||
| 350 | struct hlist_node *node, *tmp; | 349 | struct hlist_node *node, *tmp; |
| 351 | unsigned long flags, orig_ret_address = 0; | 350 | unsigned long flags, orig_ret_address = 0; |
| 352 | unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; | 351 | unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline; |
| 352 | kprobe_opcode_t *correct_ret_addr = NULL; | ||
| 353 | 353 | ||
| 354 | INIT_HLIST_HEAD(&empty_rp); | 354 | INIT_HLIST_HEAD(&empty_rp); |
| 355 | kretprobe_hash_lock(current, &head, &flags); | 355 | kretprobe_hash_lock(current, &head, &flags); |
| @@ -372,10 +372,32 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, | |||
| 372 | /* another task is sharing our hash bucket */ | 372 | /* another task is sharing our hash bucket */ |
| 373 | continue; | 373 | continue; |
| 374 | 374 | ||
| 375 | if (ri->rp && ri->rp->handler) | 375 | orig_ret_address = (unsigned long)ri->ret_addr; |
| 376 | ri->rp->handler(ri, regs); | 376 | |
| 377 | if (orig_ret_address != trampoline_address) | ||
| 378 | /* | ||
| 379 | * This is the real return address. Any other | ||
| 380 | * instances associated with this task are for | ||
| 381 | * other calls deeper on the call stack | ||
| 382 | */ | ||
| 383 | break; | ||
| 384 | } | ||
| 385 | |||
| 386 | kretprobe_assert(ri, orig_ret_address, trampoline_address); | ||
| 387 | |||
| 388 | correct_ret_addr = ri->ret_addr; | ||
| 389 | hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { | ||
| 390 | if (ri->task != current) | ||
| 391 | /* another task is sharing our hash bucket */ | ||
| 392 | continue; | ||
| 377 | 393 | ||
| 378 | orig_ret_address = (unsigned long)ri->ret_addr; | 394 | orig_ret_address = (unsigned long)ri->ret_addr; |
| 395 | |||
| 396 | if (ri->rp && ri->rp->handler) { | ||
| 397 | ri->ret_addr = correct_ret_addr; | ||
| 398 | ri->rp->handler(ri, regs); | ||
| 399 | } | ||
| 400 | |||
| 379 | recycle_rp_inst(ri, &empty_rp); | 401 | recycle_rp_inst(ri, &empty_rp); |
| 380 | 402 | ||
| 381 | if (orig_ret_address != trampoline_address) { | 403 | if (orig_ret_address != trampoline_address) { |
| @@ -387,7 +409,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p, | |||
| 387 | break; | 409 | break; |
| 388 | } | 410 | } |
| 389 | } | 411 | } |
| 390 | kretprobe_assert(ri, orig_ret_address, trampoline_address); | 412 | |
| 391 | regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; | 413 | regs->psw.addr = orig_ret_address | PSW_ADDR_AMODE; |
| 392 | 414 | ||
| 393 | reset_current_kprobe(); | 415 | reset_current_kprobe(); |
| @@ -465,8 +487,6 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs) | |||
| 465 | goto out; | 487 | goto out; |
| 466 | } | 488 | } |
| 467 | reset_current_kprobe(); | 489 | reset_current_kprobe(); |
| 468 | if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) | ||
| 469 | local_irq_enable(); | ||
| 470 | out: | 490 | out: |
| 471 | preempt_enable_no_resched(); | 491 | preempt_enable_no_resched(); |
| 472 | 492 | ||
| @@ -482,7 +502,7 @@ out: | |||
| 482 | return 1; | 502 | return 1; |
| 483 | } | 503 | } |
| 484 | 504 | ||
| 485 | int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | 505 | static int __kprobes kprobe_trap_handler(struct pt_regs *regs, int trapnr) |
| 486 | { | 506 | { |
| 487 | struct kprobe *cur = kprobe_running(); | 507 | struct kprobe *cur = kprobe_running(); |
| 488 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 508 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
| @@ -508,8 +528,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
| 508 | restore_previous_kprobe(kcb); | 528 | restore_previous_kprobe(kcb); |
| 509 | else { | 529 | else { |
| 510 | reset_current_kprobe(); | 530 | reset_current_kprobe(); |
| 511 | if (regs->psw.mask & (PSW_MASK_PER | PSW_MASK_IO)) | ||
| 512 | local_irq_enable(); | ||
| 513 | } | 531 | } |
| 514 | preempt_enable_no_resched(); | 532 | preempt_enable_no_resched(); |
| 515 | break; | 533 | break; |
| @@ -553,6 +571,18 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
| 553 | return 0; | 571 | return 0; |
| 554 | } | 572 | } |
| 555 | 573 | ||
| 574 | int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | ||
| 575 | { | ||
| 576 | int ret; | ||
| 577 | |||
| 578 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 579 | local_irq_disable(); | ||
| 580 | ret = kprobe_trap_handler(regs, trapnr); | ||
| 581 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 582 | local_irq_restore(regs->psw.mask & ~PSW_MASK_PER); | ||
| 583 | return ret; | ||
| 584 | } | ||
| 585 | |||
| 556 | /* | 586 | /* |
| 557 | * Wrapper routine to for handling exceptions. | 587 | * Wrapper routine to for handling exceptions. |
| 558 | */ | 588 | */ |
| @@ -560,8 +590,12 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
| 560 | unsigned long val, void *data) | 590 | unsigned long val, void *data) |
| 561 | { | 591 | { |
| 562 | struct die_args *args = (struct die_args *)data; | 592 | struct die_args *args = (struct die_args *)data; |
| 593 | struct pt_regs *regs = args->regs; | ||
| 563 | int ret = NOTIFY_DONE; | 594 | int ret = NOTIFY_DONE; |
| 564 | 595 | ||
| 596 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 597 | local_irq_disable(); | ||
| 598 | |||
| 565 | switch (val) { | 599 | switch (val) { |
| 566 | case DIE_BPT: | 600 | case DIE_BPT: |
| 567 | if (kprobe_handler(args->regs)) | 601 | if (kprobe_handler(args->regs)) |
| @@ -572,16 +606,17 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, | |||
| 572 | ret = NOTIFY_STOP; | 606 | ret = NOTIFY_STOP; |
| 573 | break; | 607 | break; |
| 574 | case DIE_TRAP: | 608 | case DIE_TRAP: |
| 575 | /* kprobe_running() needs smp_processor_id() */ | 609 | if (!preemptible() && kprobe_running() && |
| 576 | preempt_disable(); | 610 | kprobe_trap_handler(args->regs, args->trapnr)) |
| 577 | if (kprobe_running() && | ||
| 578 | kprobe_fault_handler(args->regs, args->trapnr)) | ||
| 579 | ret = NOTIFY_STOP; | 611 | ret = NOTIFY_STOP; |
| 580 | preempt_enable(); | ||
| 581 | break; | 612 | break; |
| 582 | default: | 613 | default: |
| 583 | break; | 614 | break; |
| 584 | } | 615 | } |
| 616 | |||
| 617 | if (regs->psw.mask & (PSW_MASK_IO | PSW_MASK_EXT)) | ||
| 618 | local_irq_restore(regs->psw.mask & ~PSW_MASK_PER); | ||
| 619 | |||
| 585 | return ret; | 620 | return ret; |
| 586 | } | 621 | } |
| 587 | 622 | ||
| @@ -595,6 +630,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
| 595 | 630 | ||
| 596 | /* setup return addr to the jprobe handler routine */ | 631 | /* setup return addr to the jprobe handler routine */ |
| 597 | regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; | 632 | regs->psw.addr = (unsigned long)(jp->entry) | PSW_ADDR_AMODE; |
| 633 | regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT); | ||
| 598 | 634 | ||
| 599 | /* r14 is the function return address */ | 635 | /* r14 is the function return address */ |
| 600 | kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14]; | 636 | kcb->jprobe_saved_r14 = (unsigned long)regs->gprs[14]; |
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c index 38e641cdd97..45b405ca256 100644 --- a/arch/s390/mm/gup.c +++ b/arch/s390/mm/gup.c | |||
| @@ -20,18 +20,17 @@ | |||
| 20 | static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, | 20 | static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, |
| 21 | unsigned long end, int write, struct page **pages, int *nr) | 21 | unsigned long end, int write, struct page **pages, int *nr) |
| 22 | { | 22 | { |
| 23 | unsigned long mask, result; | 23 | unsigned long mask; |
| 24 | pte_t *ptep, pte; | 24 | pte_t *ptep, pte; |
| 25 | struct page *page; | 25 | struct page *page; |
| 26 | 26 | ||
| 27 | result = write ? 0 : _PAGE_RO; | 27 | mask = (write ? _PAGE_RO : 0) | _PAGE_INVALID | _PAGE_SPECIAL; |
| 28 | mask = result | _PAGE_INVALID | _PAGE_SPECIAL; | ||
| 29 | 28 | ||
| 30 | ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); | 29 | ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); |
| 31 | do { | 30 | do { |
| 32 | pte = *ptep; | 31 | pte = *ptep; |
| 33 | barrier(); | 32 | barrier(); |
| 34 | if ((pte_val(pte) & mask) != result) | 33 | if ((pte_val(pte) & mask) != 0) |
| 35 | return 0; | 34 | return 0; |
| 36 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); | 35 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); |
| 37 | page = pte_page(pte); | 36 | page = pte_page(pte); |
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 7524689b03d..16582d85368 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/threads.h> | 13 | #include <linux/threads.h> |
| 14 | #include <linux/smp.h> | 14 | #include <linux/smp.h> |
| 15 | #include <linux/smp_lock.h> | ||
| 16 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 17 | #include <linux/kernel_stat.h> | 16 | #include <linux/kernel_stat.h> |
| 18 | #include <linux/init.h> | 17 | #include <linux/init.h> |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index e6375a750d9..6db18c6927f 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/resource.h> | 17 | #include <linux/resource.h> |
| 18 | #include <linux/times.h> | 18 | #include <linux/times.h> |
| 19 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/sem.h> | 20 | #include <linux/sem.h> |
| 22 | #include <linux/msg.h> | 21 | #include <linux/msg.h> |
| 23 | #include <linux/shm.h> | 22 | #include <linux/shm.h> |
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c index 675c9e11ada..42b282fa611 100644 --- a/arch/sparc/kernel/sys_sparc_32.c +++ b/arch/sparc/kernel/sys_sparc_32.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/mman.h> | 19 | #include <linux/mman.h> |
| 20 | #include <linux/utsname.h> | 20 | #include <linux/utsname.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | #include <linux/ipc.h> | 22 | #include <linux/ipc.h> |
| 24 | 23 | ||
| 25 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c index 12b9f352595..4491f4cb269 100644 --- a/arch/sparc/kernel/unaligned_32.c +++ b/arch/sparc/kernel/unaligned_32.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <asm/system.h> | 16 | #include <asm/system.h> |
| 17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/perf_event.h> | 19 | #include <linux/perf_event.h> |
| 21 | 20 | ||
| 22 | enum direction { | 21 | enum direction { |
diff --git a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c index b351770cbdd..3107381e576 100644 --- a/arch/sparc/kernel/windows.c +++ b/arch/sparc/kernel/windows.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
| 11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | 12 | ||
| 14 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
| 15 | 14 | ||
diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c index 67617a05e60..dbc213adf5e 100644 --- a/arch/tile/kernel/compat.c +++ b/arch/tile/kernel/compat.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/kdev_t.h> | 21 | #include <linux/kdev_t.h> |
| 22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
| 23 | #include <linux/fcntl.h> | 23 | #include <linux/fcntl.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/uaccess.h> | 24 | #include <linux/uaccess.h> |
| 26 | #include <linux/signal.h> | 25 | #include <linux/signal.h> |
| 27 | #include <asm/syscalls.h> | 26 | #include <asm/syscalls.h> |
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index fb64b99959d..543d6a33aa2 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
| 16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 17 | #include <linux/smp.h> | 17 | #include <linux/smp.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 20 | #include <linux/signal.h> | 19 | #include <linux/signal.h> |
| 21 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
diff --git a/arch/tile/kernel/signal.c b/arch/tile/kernel/signal.c index 687719d4abd..757407e3669 100644 --- a/arch/tile/kernel/signal.c +++ b/arch/tile/kernel/signal.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 21 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
| 22 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
diff --git a/arch/tile/kernel/smpboot.c b/arch/tile/kernel/smpboot.c index 74d62d098ed..b949edcec20 100644 --- a/arch/tile/kernel/smpboot.c +++ b/arch/tile/kernel/smpboot.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
| 19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
| 20 | #include <linux/kernel_stat.h> | 20 | #include <linux/kernel_stat.h> |
| 21 | #include <linux/smp_lock.h> | ||
| 22 | #include <linux/bootmem.h> | 21 | #include <linux/bootmem.h> |
| 23 | #include <linux/notifier.h> | 22 | #include <linux/notifier.h> |
| 24 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
diff --git a/arch/tile/kernel/sys.c b/arch/tile/kernel/sys.c index 7e764669a02..e2187d24a9b 100644 --- a/arch/tile/kernel/sys.c +++ b/arch/tile/kernel/sys.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
| 23 | #include <linux/smp_lock.h> | ||
| 24 | #include <linux/syscalls.h> | 23 | #include <linux/syscalls.h> |
| 25 | #include <linux/mman.h> | 24 | #include <linux/mman.h> |
| 26 | #include <linux/file.h> | 25 | #include <linux/file.h> |
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c index f295b4ac941..dcebfc831cd 100644 --- a/arch/tile/mm/fault.c +++ b/arch/tile/mm/fault.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <linux/mman.h> | 24 | #include <linux/mman.h> |
| 25 | #include <linux/mm.h> | 25 | #include <linux/mm.h> |
| 26 | #include <linux/smp.h> | 26 | #include <linux/smp.h> |
| 27 | #include <linux/smp_lock.h> | ||
| 28 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
| 29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 30 | #include <linux/tty.h> | 29 | #include <linux/tty.h> |
diff --git a/arch/tile/mm/hugetlbpage.c b/arch/tile/mm/hugetlbpage.c index 24688b697a8..201a582c413 100644 --- a/arch/tile/mm/hugetlbpage.c +++ b/arch/tile/mm/hugetlbpage.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
| 22 | #include <linux/hugetlb.h> | 22 | #include <linux/hugetlb.h> |
| 23 | #include <linux/pagemap.h> | 23 | #include <linux/pagemap.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
| 26 | #include <linux/err.h> | 25 | #include <linux/err.h> |
| 27 | #include <linux/sysctl.h> | 26 | #include <linux/sysctl.h> |
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 340268be00b..09bd7b58572 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | #include "linux/stddef.h" | 6 | #include "linux/stddef.h" |
| 7 | #include "linux/fs.h" | 7 | #include "linux/fs.h" |
| 8 | #include "linux/smp_lock.h" | ||
| 9 | #include "linux/ptrace.h" | 8 | #include "linux/ptrace.h" |
| 10 | #include "linux/sched.h" | 9 | #include "linux/sched.h" |
| 11 | #include "linux/slab.h" | 10 | #include "linux/slab.h" |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 849813f398e..5852519b2d0 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/syscalls.h> | 28 | #include <linux/syscalls.h> |
| 29 | #include <linux/times.h> | 29 | #include <linux/times.h> |
| 30 | #include <linux/utsname.h> | 30 | #include <linux/utsname.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/mm.h> | 31 | #include <linux/mm.h> |
| 33 | #include <linux/uio.h> | 32 | #include <linux/uio.h> |
| 34 | #include <linux/poll.h> | 33 | #include <linux/poll.h> |
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 1b7b31ab7d8..212a6a42527 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/poll.h> | 34 | #include <linux/poll.h> |
| 35 | #include <linux/smp.h> | 35 | #include <linux/smp.h> |
| 36 | #include <linux/smp_lock.h> | ||
| 37 | #include <linux/major.h> | 36 | #include <linux/major.h> |
| 38 | #include <linux/fs.h> | 37 | #include <linux/fs.h> |
| 39 | #include <linux/device.h> | 38 | #include <linux/device.h> |
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index ec592caac4b..cd21b654dec 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
| @@ -315,14 +315,18 @@ static void kgdb_remove_all_hw_break(void) | |||
| 315 | if (!breakinfo[i].enabled) | 315 | if (!breakinfo[i].enabled) |
| 316 | continue; | 316 | continue; |
| 317 | bp = *per_cpu_ptr(breakinfo[i].pev, cpu); | 317 | bp = *per_cpu_ptr(breakinfo[i].pev, cpu); |
| 318 | if (bp->attr.disabled == 1) | 318 | if (!bp->attr.disabled) { |
| 319 | arch_uninstall_hw_breakpoint(bp); | ||
| 320 | bp->attr.disabled = 1; | ||
| 319 | continue; | 321 | continue; |
| 322 | } | ||
| 320 | if (dbg_is_early) | 323 | if (dbg_is_early) |
| 321 | early_dr7 &= ~encode_dr7(i, breakinfo[i].len, | 324 | early_dr7 &= ~encode_dr7(i, breakinfo[i].len, |
| 322 | breakinfo[i].type); | 325 | breakinfo[i].type); |
| 323 | else | 326 | else if (hw_break_release_slot(i)) |
| 324 | arch_uninstall_hw_breakpoint(bp); | 327 | printk(KERN_ERR "KGDB: hw bpt remove failed %lx\n", |
| 325 | bp->attr.disabled = 1; | 328 | breakinfo[i].addr); |
| 329 | breakinfo[i].enabled = 0; | ||
| 326 | } | 330 | } |
| 327 | } | 331 | } |
| 328 | 332 | ||
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 7bf2dc4c8f7..12fcbe2c143 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
| 31 | #include <linux/poll.h> | 31 | #include <linux/poll.h> |
| 32 | #include <linux/smp.h> | 32 | #include <linux/smp.h> |
| 33 | #include <linux/smp_lock.h> | ||
| 34 | #include <linux/major.h> | 33 | #include <linux/major.h> |
| 35 | #include <linux/fs.h> | 34 | #include <linux/fs.h> |
| 36 | #include <linux/device.h> | 35 | #include <linux/device.h> |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 82e144a4e51..1ca12298ffc 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -3395,6 +3395,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 3395 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; | 3395 | vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; |
| 3396 | 3396 | ||
| 3397 | load_host_msrs(vcpu); | 3397 | load_host_msrs(vcpu); |
| 3398 | kvm_load_ldt(ldt_selector); | ||
| 3398 | loadsegment(fs, fs_selector); | 3399 | loadsegment(fs, fs_selector); |
| 3399 | #ifdef CONFIG_X86_64 | 3400 | #ifdef CONFIG_X86_64 |
| 3400 | load_gs_index(gs_selector); | 3401 | load_gs_index(gs_selector); |
| @@ -3402,7 +3403,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 3402 | #else | 3403 | #else |
| 3403 | loadsegment(gs, gs_selector); | 3404 | loadsegment(gs, gs_selector); |
| 3404 | #endif | 3405 | #endif |
| 3405 | kvm_load_ldt(ldt_selector); | ||
| 3406 | 3406 | ||
| 3407 | reload_tss(vcpu); | 3407 | reload_tss(vcpu); |
| 3408 | 3408 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 8da0e45ff7c..ff21fdda0c5 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -821,10 +821,9 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) | |||
| 821 | #endif | 821 | #endif |
| 822 | 822 | ||
| 823 | #ifdef CONFIG_X86_64 | 823 | #ifdef CONFIG_X86_64 |
| 824 | if (is_long_mode(&vmx->vcpu)) { | 824 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); |
| 825 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); | 825 | if (is_long_mode(&vmx->vcpu)) |
| 826 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); | 826 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); |
| 827 | } | ||
| 828 | #endif | 827 | #endif |
| 829 | for (i = 0; i < vmx->save_nmsrs; ++i) | 828 | for (i = 0; i < vmx->save_nmsrs; ++i) |
| 830 | kvm_set_shared_msr(vmx->guest_msrs[i].index, | 829 | kvm_set_shared_msr(vmx->guest_msrs[i].index, |
| @@ -839,23 +838,23 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) | |||
| 839 | 838 | ||
| 840 | ++vmx->vcpu.stat.host_state_reload; | 839 | ++vmx->vcpu.stat.host_state_reload; |
| 841 | vmx->host_state.loaded = 0; | 840 | vmx->host_state.loaded = 0; |
| 842 | if (vmx->host_state.fs_reload_needed) | 841 | #ifdef CONFIG_X86_64 |
| 843 | loadsegment(fs, vmx->host_state.fs_sel); | 842 | if (is_long_mode(&vmx->vcpu)) |
| 843 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); | ||
| 844 | #endif | ||
| 844 | if (vmx->host_state.gs_ldt_reload_needed) { | 845 | if (vmx->host_state.gs_ldt_reload_needed) { |
| 845 | kvm_load_ldt(vmx->host_state.ldt_sel); | 846 | kvm_load_ldt(vmx->host_state.ldt_sel); |
| 846 | #ifdef CONFIG_X86_64 | 847 | #ifdef CONFIG_X86_64 |
| 847 | load_gs_index(vmx->host_state.gs_sel); | 848 | load_gs_index(vmx->host_state.gs_sel); |
| 848 | wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs); | ||
| 849 | #else | 849 | #else |
| 850 | loadsegment(gs, vmx->host_state.gs_sel); | 850 | loadsegment(gs, vmx->host_state.gs_sel); |
| 851 | #endif | 851 | #endif |
| 852 | } | 852 | } |
| 853 | if (vmx->host_state.fs_reload_needed) | ||
| 854 | loadsegment(fs, vmx->host_state.fs_sel); | ||
| 853 | reload_tss(); | 855 | reload_tss(); |
| 854 | #ifdef CONFIG_X86_64 | 856 | #ifdef CONFIG_X86_64 |
| 855 | if (is_long_mode(&vmx->vcpu)) { | 857 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); |
| 856 | rdmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); | ||
| 857 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); | ||
| 858 | } | ||
| 859 | #endif | 858 | #endif |
| 860 | if (current_thread_info()->status & TS_USEDFPU) | 859 | if (current_thread_info()->status & TS_USEDFPU) |
| 861 | clts(); | 860 | clts(); |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 15466c096ba..0972315c386 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
| @@ -138,7 +138,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 138 | struct acpi_resource_address64 addr; | 138 | struct acpi_resource_address64 addr; |
| 139 | acpi_status status; | 139 | acpi_status status; |
| 140 | unsigned long flags; | 140 | unsigned long flags; |
| 141 | struct resource *root, *conflict; | ||
| 142 | u64 start, end; | 141 | u64 start, end; |
| 143 | 142 | ||
| 144 | status = resource_to_addr(acpi_res, &addr); | 143 | status = resource_to_addr(acpi_res, &addr); |
| @@ -146,12 +145,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 146 | return AE_OK; | 145 | return AE_OK; |
| 147 | 146 | ||
| 148 | if (addr.resource_type == ACPI_MEMORY_RANGE) { | 147 | if (addr.resource_type == ACPI_MEMORY_RANGE) { |
| 149 | root = &iomem_resource; | ||
| 150 | flags = IORESOURCE_MEM; | 148 | flags = IORESOURCE_MEM; |
| 151 | if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) | 149 | if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY) |
| 152 | flags |= IORESOURCE_PREFETCH; | 150 | flags |= IORESOURCE_PREFETCH; |
| 153 | } else if (addr.resource_type == ACPI_IO_RANGE) { | 151 | } else if (addr.resource_type == ACPI_IO_RANGE) { |
| 154 | root = &ioport_resource; | ||
| 155 | flags = IORESOURCE_IO; | 152 | flags = IORESOURCE_IO; |
| 156 | } else | 153 | } else |
| 157 | return AE_OK; | 154 | return AE_OK; |
| @@ -172,25 +169,90 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
| 172 | return AE_OK; | 169 | return AE_OK; |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | conflict = insert_resource_conflict(root, res); | 172 | info->res_num++; |
| 176 | if (conflict) { | 173 | if (addr.translation_offset) |
| 177 | dev_err(&info->bridge->dev, | 174 | dev_info(&info->bridge->dev, "host bridge window %pR " |
| 178 | "address space collision: host bridge window %pR " | 175 | "(PCI address [%#llx-%#llx])\n", |
| 179 | "conflicts with %s %pR\n", | 176 | res, res->start - addr.translation_offset, |
| 180 | res, conflict->name, conflict); | 177 | res->end - addr.translation_offset); |
| 181 | } else { | 178 | else |
| 182 | pci_bus_add_resource(info->bus, res, 0); | 179 | dev_info(&info->bridge->dev, "host bridge window %pR\n", res); |
| 183 | info->res_num++; | 180 | |
| 184 | if (addr.translation_offset) | 181 | return AE_OK; |
| 185 | dev_info(&info->bridge->dev, "host bridge window %pR " | 182 | } |
| 186 | "(PCI address [%#llx-%#llx])\n", | 183 | |
| 187 | res, res->start - addr.translation_offset, | 184 | static bool resource_contains(struct resource *res, resource_size_t point) |
| 188 | res->end - addr.translation_offset); | 185 | { |
| 186 | if (res->start <= point && point <= res->end) | ||
| 187 | return true; | ||
| 188 | return false; | ||
| 189 | } | ||
| 190 | |||
| 191 | static void coalesce_windows(struct pci_root_info *info, int type) | ||
| 192 | { | ||
| 193 | int i, j; | ||
| 194 | struct resource *res1, *res2; | ||
| 195 | |||
| 196 | for (i = 0; i < info->res_num; i++) { | ||
| 197 | res1 = &info->res[i]; | ||
| 198 | if (!(res1->flags & type)) | ||
| 199 | continue; | ||
| 200 | |||
| 201 | for (j = i + 1; j < info->res_num; j++) { | ||
| 202 | res2 = &info->res[j]; | ||
| 203 | if (!(res2->flags & type)) | ||
| 204 | continue; | ||
| 205 | |||
| 206 | /* | ||
| 207 | * I don't like throwing away windows because then | ||
| 208 | * our resources no longer match the ACPI _CRS, but | ||
| 209 | * the kernel resource tree doesn't allow overlaps. | ||
| 210 | */ | ||
| 211 | if (resource_contains(res1, res2->start) || | ||
| 212 | resource_contains(res1, res2->end) || | ||
| 213 | resource_contains(res2, res1->start) || | ||
| 214 | resource_contains(res2, res1->end)) { | ||
| 215 | res1->start = min(res1->start, res2->start); | ||
| 216 | res1->end = max(res1->end, res2->end); | ||
| 217 | dev_info(&info->bridge->dev, | ||
| 218 | "host bridge window expanded to %pR; %pR ignored\n", | ||
| 219 | res1, res2); | ||
| 220 | res2->flags = 0; | ||
| 221 | } | ||
| 222 | } | ||
| 223 | } | ||
| 224 | } | ||
| 225 | |||
| 226 | static void add_resources(struct pci_root_info *info) | ||
| 227 | { | ||
| 228 | int i; | ||
| 229 | struct resource *res, *root, *conflict; | ||
| 230 | |||
| 231 | if (!pci_use_crs) | ||
| 232 | return; | ||
| 233 | |||
| 234 | coalesce_windows(info, IORESOURCE_MEM); | ||
| 235 | coalesce_windows(info, IORESOURCE_IO); | ||
| 236 | |||
| 237 | for (i = 0; i < info->res_num; i++) { | ||
| 238 | res = &info->res[i]; | ||
| 239 | |||
| 240 | if (res->flags & IORESOURCE_MEM) | ||
| 241 | root = &iomem_resource; | ||
| 242 | else if (res->flags & IORESOURCE_IO) | ||
| 243 | root = &ioport_resource; | ||
| 189 | else | 244 | else |
| 190 | dev_info(&info->bridge->dev, | 245 | continue; |
| 191 | "host bridge window %pR\n", res); | 246 | |
| 247 | conflict = insert_resource_conflict(root, res); | ||
| 248 | if (conflict) | ||
| 249 | dev_err(&info->bridge->dev, | ||
| 250 | "address space collision: host bridge window %pR " | ||
| 251 | "conflicts with %s %pR\n", | ||
| 252 | res, conflict->name, conflict); | ||
| 253 | else | ||
| 254 | pci_bus_add_resource(info->bus, res, 0); | ||
| 192 | } | 255 | } |
| 193 | return AE_OK; | ||
| 194 | } | 256 | } |
| 195 | 257 | ||
| 196 | static void | 258 | static void |
| @@ -224,6 +286,7 @@ get_current_resources(struct acpi_device *device, int busnum, | |||
| 224 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, | 286 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, |
| 225 | &info); | 287 | &info); |
| 226 | 288 | ||
| 289 | add_resources(&info); | ||
| 227 | return; | 290 | return; |
| 228 | 291 | ||
| 229 | name_alloc_fail: | 292 | name_alloc_fail: |
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c index 58c6ee5b010..cc3eb78e333 100644 --- a/block/compat_ioctl.c +++ b/block/compat_ioctl.c | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include <linux/hdreg.h> | 8 | #include <linux/hdreg.h> |
| 9 | #include <linux/slab.h> | 9 | #include <linux/slab.h> |
| 10 | #include <linux/syscalls.h> | 10 | #include <linux/syscalls.h> |
| 11 | #include <linux/smp_lock.h> | ||
| 12 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 13 | #include <linux/uaccess.h> | 12 | #include <linux/uaccess.h> |
| 14 | 13 | ||
diff --git a/block/ioctl.c b/block/ioctl.c index 3d866d0037f..a9a302eba01 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include <linux/hdreg.h> | 5 | #include <linux/hdreg.h> |
| 6 | #include <linux/backing-dev.h> | 6 | #include <linux/backing-dev.h> |
| 7 | #include <linux/buffer_head.h> | 7 | #include <linux/buffer_head.h> |
| 8 | #include <linux/smp_lock.h> | ||
| 9 | #include <linux/blktrace_api.h> | 8 | #include <linux/blktrace_api.h> |
| 10 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
| 11 | 10 | ||
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3f91c01c217..66aa4bee80a 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -3166,8 +3166,8 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, | |||
| 3166 | 3166 | ||
| 3167 | /** | 3167 | /** |
| 3168 | * ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device | 3168 | * ata_scsi_queuecmd - Issue SCSI cdb to libata-managed device |
| 3169 | * @shost: SCSI host of command to be sent | ||
| 3169 | * @cmd: SCSI command to be sent | 3170 | * @cmd: SCSI command to be sent |
| 3170 | * @done: Completion function, called when command is complete | ||
| 3171 | * | 3171 | * |
| 3172 | * In some cases, this function translates SCSI commands into | 3172 | * In some cases, this function translates SCSI commands into |
| 3173 | * ATA taskfiles, and queues the taskfiles to be sent to | 3173 | * ATA taskfiles, and queues the taskfiles to be sent to |
| @@ -3177,37 +3177,36 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, | |||
| 3177 | * ATA and ATAPI devices appearing as SCSI devices. | 3177 | * ATA and ATAPI devices appearing as SCSI devices. |
| 3178 | * | 3178 | * |
| 3179 | * LOCKING: | 3179 | * LOCKING: |
| 3180 | * Releases scsi-layer-held lock, and obtains host lock. | 3180 | * ATA host lock |
| 3181 | * | 3181 | * |
| 3182 | * RETURNS: | 3182 | * RETURNS: |
| 3183 | * Return value from __ata_scsi_queuecmd() if @cmd can be queued, | 3183 | * Return value from __ata_scsi_queuecmd() if @cmd can be queued, |
| 3184 | * 0 otherwise. | 3184 | * 0 otherwise. |
| 3185 | */ | 3185 | */ |
| 3186 | int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 3186 | int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) |
| 3187 | { | 3187 | { |
| 3188 | struct ata_port *ap; | 3188 | struct ata_port *ap; |
| 3189 | struct ata_device *dev; | 3189 | struct ata_device *dev; |
| 3190 | struct scsi_device *scsidev = cmd->device; | 3190 | struct scsi_device *scsidev = cmd->device; |
| 3191 | struct Scsi_Host *shost = scsidev->host; | ||
| 3192 | int rc = 0; | 3191 | int rc = 0; |
| 3192 | unsigned long irq_flags; | ||
| 3193 | 3193 | ||
| 3194 | ap = ata_shost_to_port(shost); | 3194 | ap = ata_shost_to_port(shost); |
| 3195 | 3195 | ||
| 3196 | spin_unlock(shost->host_lock); | 3196 | spin_lock_irqsave(ap->lock, irq_flags); |
| 3197 | spin_lock(ap->lock); | ||
| 3198 | 3197 | ||
| 3199 | ata_scsi_dump_cdb(ap, cmd); | 3198 | ata_scsi_dump_cdb(ap, cmd); |
| 3200 | 3199 | ||
| 3201 | dev = ata_scsi_find_dev(ap, scsidev); | 3200 | dev = ata_scsi_find_dev(ap, scsidev); |
| 3202 | if (likely(dev)) | 3201 | if (likely(dev)) |
| 3203 | rc = __ata_scsi_queuecmd(cmd, done, dev); | 3202 | rc = __ata_scsi_queuecmd(cmd, cmd->scsi_done, dev); |
| 3204 | else { | 3203 | else { |
| 3205 | cmd->result = (DID_BAD_TARGET << 16); | 3204 | cmd->result = (DID_BAD_TARGET << 16); |
| 3206 | done(cmd); | 3205 | cmd->scsi_done(cmd); |
| 3207 | } | 3206 | } |
| 3208 | 3207 | ||
| 3209 | spin_unlock(ap->lock); | 3208 | spin_unlock_irqrestore(ap->lock, irq_flags); |
| 3210 | spin_lock(shost->host_lock); | 3209 | |
| 3211 | return rc; | 3210 | return rc; |
| 3212 | } | 3211 | } |
| 3213 | 3212 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 31b526661ec..ead3e79d6fc 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -475,20 +475,33 @@ End: | |||
| 475 | */ | 475 | */ |
| 476 | void dpm_resume_noirq(pm_message_t state) | 476 | void dpm_resume_noirq(pm_message_t state) |
| 477 | { | 477 | { |
| 478 | struct device *dev; | 478 | struct list_head list; |
| 479 | ktime_t starttime = ktime_get(); | 479 | ktime_t starttime = ktime_get(); |
| 480 | 480 | ||
| 481 | INIT_LIST_HEAD(&list); | ||
| 481 | mutex_lock(&dpm_list_mtx); | 482 | mutex_lock(&dpm_list_mtx); |
| 482 | transition_started = false; | 483 | transition_started = false; |
| 483 | list_for_each_entry(dev, &dpm_list, power.entry) | 484 | while (!list_empty(&dpm_list)) { |
| 485 | struct device *dev = to_device(dpm_list.next); | ||
| 486 | |||
| 487 | get_device(dev); | ||
| 484 | if (dev->power.status > DPM_OFF) { | 488 | if (dev->power.status > DPM_OFF) { |
| 485 | int error; | 489 | int error; |
| 486 | 490 | ||
| 487 | dev->power.status = DPM_OFF; | 491 | dev->power.status = DPM_OFF; |
| 492 | mutex_unlock(&dpm_list_mtx); | ||
| 493 | |||
| 488 | error = device_resume_noirq(dev, state); | 494 | error = device_resume_noirq(dev, state); |
| 495 | |||
| 496 | mutex_lock(&dpm_list_mtx); | ||
| 489 | if (error) | 497 | if (error) |
| 490 | pm_dev_err(dev, state, " early", error); | 498 | pm_dev_err(dev, state, " early", error); |
| 491 | } | 499 | } |
| 500 | if (!list_empty(&dev->power.entry)) | ||
| 501 | list_move_tail(&dev->power.entry, &list); | ||
| 502 | put_device(dev); | ||
| 503 | } | ||
| 504 | list_splice(&list, &dpm_list); | ||
| 492 | mutex_unlock(&dpm_list_mtx); | 505 | mutex_unlock(&dpm_list_mtx); |
| 493 | dpm_show_time(starttime, state, "early"); | 506 | dpm_show_time(starttime, state, "early"); |
| 494 | resume_device_irqs(); | 507 | resume_device_irqs(); |
| @@ -789,20 +802,33 @@ End: | |||
| 789 | */ | 802 | */ |
| 790 | int dpm_suspend_noirq(pm_message_t state) | 803 | int dpm_suspend_noirq(pm_message_t state) |
| 791 | { | 804 | { |
| 792 | struct device *dev; | 805 | struct list_head list; |
| 793 | ktime_t starttime = ktime_get(); | 806 | ktime_t starttime = ktime_get(); |
| 794 | int error = 0; | 807 | int error = 0; |
| 795 | 808 | ||
| 809 | INIT_LIST_HEAD(&list); | ||
| 796 | suspend_device_irqs(); | 810 | suspend_device_irqs(); |
| 797 | mutex_lock(&dpm_list_mtx); | 811 | mutex_lock(&dpm_list_mtx); |
| 798 | list_for_each_entry_reverse(dev, &dpm_list, power.entry) { | 812 | while (!list_empty(&dpm_list)) { |
| 813 | struct device *dev = to_device(dpm_list.prev); | ||
| 814 | |||
| 815 | get_device(dev); | ||
| 816 | mutex_unlock(&dpm_list_mtx); | ||
| 817 | |||
| 799 | error = device_suspend_noirq(dev, state); | 818 | error = device_suspend_noirq(dev, state); |
| 819 | |||
| 820 | mutex_lock(&dpm_list_mtx); | ||
| 800 | if (error) { | 821 | if (error) { |
| 801 | pm_dev_err(dev, state, " late", error); | 822 | pm_dev_err(dev, state, " late", error); |
| 823 | put_device(dev); | ||
| 802 | break; | 824 | break; |
| 803 | } | 825 | } |
| 804 | dev->power.status = DPM_OFF_IRQ; | 826 | dev->power.status = DPM_OFF_IRQ; |
| 827 | if (!list_empty(&dev->power.entry)) | ||
| 828 | list_move(&dev->power.entry, &list); | ||
| 829 | put_device(dev); | ||
| 805 | } | 830 | } |
| 831 | list_splice_tail(&list, &dpm_list); | ||
| 806 | mutex_unlock(&dpm_list_mtx); | 832 | mutex_unlock(&dpm_list_mtx); |
| 807 | if (error) | 833 | if (error) |
| 808 | dpm_resume_noirq(resume_event(state)); | 834 | dpm_resume_noirq(resume_event(state)); |
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 575495f3c4b..727d0225b7d 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
| @@ -62,8 +62,8 @@ static int cciss_scsi_proc_info( | |||
| 62 | int length, /* length of data in buffer */ | 62 | int length, /* length of data in buffer */ |
| 63 | int func); /* 0 == read, 1 == write */ | 63 | int func); /* 0 == read, 1 == write */ |
| 64 | 64 | ||
| 65 | static int cciss_scsi_queue_command (struct scsi_cmnd *cmd, | 65 | static int cciss_scsi_queue_command (struct Scsi_Host *h, |
| 66 | void (* done)(struct scsi_cmnd *)); | 66 | struct scsi_cmnd *cmd); |
| 67 | static int cciss_eh_device_reset_handler(struct scsi_cmnd *); | 67 | static int cciss_eh_device_reset_handler(struct scsi_cmnd *); |
| 68 | static int cciss_eh_abort_handler(struct scsi_cmnd *); | 68 | static int cciss_eh_abort_handler(struct scsi_cmnd *); |
| 69 | 69 | ||
| @@ -1406,7 +1406,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c, | |||
| 1406 | 1406 | ||
| 1407 | 1407 | ||
| 1408 | static int | 1408 | static int |
| 1409 | cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) | 1409 | cciss_scsi_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 1410 | { | 1410 | { |
| 1411 | ctlr_info_t *h; | 1411 | ctlr_info_t *h; |
| 1412 | int rc; | 1412 | int rc; |
| @@ -1504,6 +1504,8 @@ cciss_scsi_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd | |||
| 1504 | return 0; | 1504 | return 0; |
| 1505 | } | 1505 | } |
| 1506 | 1506 | ||
| 1507 | static DEF_SCSI_QCMD(cciss_scsi_queue_command) | ||
| 1508 | |||
| 1507 | static void cciss_unregister_scsi(ctlr_info_t *h) | 1509 | static void cciss_unregister_scsi(ctlr_info_t *h) |
| 1508 | { | 1510 | { |
| 1509 | struct cciss_scsi_adapter_data_t *sa; | 1511 | struct cciss_scsi_adapter_data_t *sa; |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index d299fe9e78c..89d8a7cc405 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | #include <linux/memcontrol.h> | 36 | #include <linux/memcontrol.h> |
| 37 | #include <linux/mm_inline.h> | 37 | #include <linux/mm_inline.h> |
| 38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
| 39 | #include <linux/smp_lock.h> | ||
| 40 | #include <linux/pkt_sched.h> | 39 | #include <linux/pkt_sched.h> |
| 41 | #define __KERNEL_SYSCALLS__ | 40 | #define __KERNEL_SYSCALLS__ |
| 42 | #include <linux/unistd.h> | 41 | #include <linux/unistd.h> |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index b0551ba7ad0..47d223c2409 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 27 | #include <linux/drbd.h> | 27 | #include <linux/drbd.h> |
| 28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
| 29 | #include <linux/smp_lock.h> | ||
| 30 | #include <linux/wait.h> | 29 | #include <linux/wait.h> |
| 31 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
| 32 | #include <linux/memcontrol.h> | 31 | #include <linux/memcontrol.h> |
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index 43412c03969..3cb4539a98b 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
| 40 | #include <linux/fs.h> | 40 | #include <linux/fs.h> |
| 41 | #include <linux/sched.h> | 41 | #include <linux/sched.h> |
| 42 | #include <linux/smp_lock.h> | ||
| 43 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
| 44 | #include <asm/pgtable.h> | 43 | #include <asm/pgtable.h> |
| 45 | #include "agp.h" | 44 | #include "agp.h" |
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index c0bd6f472c5..6ee3348bc3e 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
| @@ -81,7 +81,6 @@ static char *serial_version = "4.30"; | |||
| 81 | #include <linux/mm.h> | 81 | #include <linux/mm.h> |
| 82 | #include <linux/seq_file.h> | 82 | #include <linux/seq_file.h> |
| 83 | #include <linux/slab.h> | 83 | #include <linux/slab.h> |
| 84 | #include <linux/smp_lock.h> | ||
| 85 | #include <linux/init.h> | 84 | #include <linux/init.h> |
| 86 | #include <linux/bitops.h> | 85 | #include <linux/bitops.h> |
| 87 | #include <linux/platform_device.h> | 86 | #include <linux/platform_device.h> |
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c index f6718f05dad..095ab90535c 100644 --- a/drivers/char/briq_panel.c +++ b/drivers/char/briq_panel.c | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | 8 | ||
| 9 | #include <linux/smp_lock.h> | ||
| 10 | #include <linux/types.h> | 9 | #include <linux/types.h> |
| 11 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
| 12 | #include <linux/tty.h> | 11 | #include <linux/tty.h> |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 55b8667f739..7066e801b9d 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/smp_lock.h> | ||
| 18 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 19 | #include <linux/miscdevice.h> | 18 | #include <linux/miscdevice.h> |
| 20 | #include <linux/major.h> | 19 | #include <linux/major.h> |
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 788da05190c..2016aad8520 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
| 38 | #include <linux/fs.h> | 38 | #include <linux/fs.h> |
| 39 | #include <linux/sched.h> | 39 | #include <linux/sched.h> |
| 40 | #include <linux/smp_lock.h> | ||
| 41 | #include <linux/init.h> | 40 | #include <linux/init.h> |
| 42 | #include <linux/miscdevice.h> | 41 | #include <linux/miscdevice.h> |
| 43 | #include <linux/delay.h> | 42 | #include <linux/delay.h> |
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index f0863bec186..d72433f2d31 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
| @@ -120,7 +120,7 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 120 | int eax = regs->eax; | 120 | int eax = regs->eax; |
| 121 | 121 | ||
| 122 | #if defined(CONFIG_X86_64) | 122 | #if defined(CONFIG_X86_64) |
| 123 | asm("pushq %%rax\n\t" | 123 | asm volatile("pushq %%rax\n\t" |
| 124 | "movl 0(%%rax),%%edx\n\t" | 124 | "movl 0(%%rax),%%edx\n\t" |
| 125 | "pushq %%rdx\n\t" | 125 | "pushq %%rdx\n\t" |
| 126 | "movl 4(%%rax),%%ebx\n\t" | 126 | "movl 4(%%rax),%%ebx\n\t" |
| @@ -142,11 +142,11 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 142 | "lahf\n\t" | 142 | "lahf\n\t" |
| 143 | "shrl $8,%%eax\n\t" | 143 | "shrl $8,%%eax\n\t" |
| 144 | "andl $1,%%eax\n" | 144 | "andl $1,%%eax\n" |
| 145 | :"=a"(rc), "+m" (*regs) | 145 | :"=a"(rc) |
| 146 | : "a"(regs) | 146 | : "a"(regs) |
| 147 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); | 147 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); |
| 148 | #else | 148 | #else |
| 149 | asm("pushl %%eax\n\t" | 149 | asm volatile("pushl %%eax\n\t" |
| 150 | "movl 0(%%eax),%%edx\n\t" | 150 | "movl 0(%%eax),%%edx\n\t" |
| 151 | "push %%edx\n\t" | 151 | "push %%edx\n\t" |
| 152 | "movl 4(%%eax),%%ebx\n\t" | 152 | "movl 4(%%eax),%%ebx\n\t" |
| @@ -168,7 +168,7 @@ static int i8k_smm(struct smm_regs *regs) | |||
| 168 | "lahf\n\t" | 168 | "lahf\n\t" |
| 169 | "shrl $8,%%eax\n\t" | 169 | "shrl $8,%%eax\n\t" |
| 170 | "andl $1,%%eax\n" | 170 | "andl $1,%%eax\n" |
| 171 | :"=a"(rc), "+m" (*regs) | 171 | :"=a"(rc) |
| 172 | : "a"(regs) | 172 | : "a"(regs) |
| 173 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); | 173 | : "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); |
| 174 | #endif | 174 | #endif |
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index 667abd23ad6..7c6de4c9245 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
| 22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
| 23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
| 26 | #include <linux/tty.h> | 25 | #include <linux/tty.h> |
| 27 | #include <linux/tty_flip.h> | 26 | #include <linux/tty_flip.h> |
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index f646725bd56..748c3b0ecd8 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c | |||
| @@ -52,7 +52,6 @@ | |||
| 52 | #include <linux/interrupt.h> | 52 | #include <linux/interrupt.h> |
| 53 | #include <linux/serial.h> | 53 | #include <linux/serial.h> |
| 54 | #include <linux/serialP.h> | 54 | #include <linux/serialP.h> |
| 55 | #include <linux/smp_lock.h> | ||
| 56 | #include <linux/string.h> | 55 | #include <linux/string.h> |
| 57 | #include <linux/fcntl.h> | 56 | #include <linux/fcntl.h> |
| 58 | #include <linux/ptrace.h> | 57 | #include <linux/ptrace.h> |
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 9f8495b4fc8..a7616d226a4 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
| @@ -87,7 +87,6 @@ | |||
| 87 | #include <linux/tty_flip.h> | 87 | #include <linux/tty_flip.h> |
| 88 | #include <linux/mm.h> | 88 | #include <linux/mm.h> |
| 89 | #include <linux/serial.h> | 89 | #include <linux/serial.h> |
| 90 | #include <linux/smp_lock.h> | ||
| 91 | #include <linux/fcntl.h> | 90 | #include <linux/fcntl.h> |
| 92 | #include <linux/major.h> | 91 | #include <linux/major.h> |
| 93 | #include <linux/delay.h> | 92 | #include <linux/delay.h> |
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c index 4bef6ab8362..461a5a04551 100644 --- a/drivers/char/stallion.c +++ b/drivers/char/stallion.c | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | #include <linux/stallion.h> | 40 | #include <linux/stallion.h> |
| 41 | #include <linux/ioport.h> | 41 | #include <linux/ioport.h> |
| 42 | #include <linux/init.h> | 42 | #include <linux/init.h> |
| 43 | #include <linux/smp_lock.h> | ||
| 44 | #include <linux/device.h> | 43 | #include <linux/device.h> |
| 45 | #include <linux/delay.h> | 44 | #include <linux/delay.h> |
| 46 | #include <linux/ctype.h> | 45 | #include <linux/ctype.h> |
diff --git a/drivers/char/sx.c b/drivers/char/sx.c index e53f1686539..a786326cea2 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c | |||
| @@ -216,7 +216,6 @@ | |||
| 216 | #include <linux/eisa.h> | 216 | #include <linux/eisa.h> |
| 217 | #include <linux/pci.h> | 217 | #include <linux/pci.h> |
| 218 | #include <linux/slab.h> | 218 | #include <linux/slab.h> |
| 219 | #include <linux/smp_lock.h> | ||
| 220 | #include <linux/init.h> | 219 | #include <linux/init.h> |
| 221 | #include <linux/miscdevice.h> | 220 | #include <linux/miscdevice.h> |
| 222 | #include <linux/bitops.h> | 221 | #include <linux/bitops.h> |
diff --git a/drivers/char/uv_mmtimer.c b/drivers/char/uv_mmtimer.c index 493b47a0d51..956ebe2080a 100644 --- a/drivers/char/uv_mmtimer.c +++ b/drivers/char/uv_mmtimer.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 24 | #include <linux/time.h> | 24 | #include <linux/time.h> |
| 25 | #include <linux/math64.h> | 25 | #include <linux/math64.h> |
| 26 | #include <linux/smp_lock.h> | ||
| 27 | 26 | ||
| 28 | #include <asm/genapic.h> | 27 | #include <asm/genapic.h> |
| 29 | #include <asm/uv/uv_hub.h> | 28 | #include <asm/uv/uv_hub.h> |
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index bfae4b30979..afa576a75a8 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c | |||
| @@ -1468,7 +1468,7 @@ static int sbp2_map_scatterlist(struct sbp2_command_orb *orb, | |||
| 1468 | 1468 | ||
| 1469 | /* SCSI stack integration */ | 1469 | /* SCSI stack integration */ |
| 1470 | 1470 | ||
| 1471 | static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) | 1471 | static int sbp2_scsi_queuecommand_lck(struct scsi_cmnd *cmd, scsi_done_fn_t done) |
| 1472 | { | 1472 | { |
| 1473 | struct sbp2_logical_unit *lu = cmd->device->hostdata; | 1473 | struct sbp2_logical_unit *lu = cmd->device->hostdata; |
| 1474 | struct fw_device *device = target_device(lu->tgt); | 1474 | struct fw_device *device = target_device(lu->tgt); |
| @@ -1534,6 +1534,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) | |||
| 1534 | return retval; | 1534 | return retval; |
| 1535 | } | 1535 | } |
| 1536 | 1536 | ||
| 1537 | static DEF_SCSI_QCMD(sbp2_scsi_queuecommand) | ||
| 1538 | |||
| 1537 | static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) | 1539 | static int sbp2_scsi_slave_alloc(struct scsi_device *sdev) |
| 1538 | { | 1540 | { |
| 1539 | struct sbp2_logical_unit *lu = sdev->hostdata; | 1541 | struct sbp2_logical_unit *lu = sdev->hostdata; |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index b744dad5c23..a39794bac04 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include "drmP.h" | 37 | #include "drmP.h" |
| 38 | #include <linux/poll.h> | 38 | #include <linux/poll.h> |
| 39 | #include <linux/slab.h> | 39 | #include <linux/slab.h> |
| 40 | #include <linux/smp_lock.h> | ||
| 41 | 40 | ||
| 42 | /* from BKL pushdown: note that nothing else serializes idr_find() */ | 41 | /* from BKL pushdown: note that nothing else serializes idr_find() */ |
| 43 | DEFINE_MUTEX(drm_global_mutex); | 42 | DEFINE_MUTEX(drm_global_mutex); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 406228f4a2a..b14c8111057 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | */ | 31 | */ |
| 32 | 32 | ||
| 33 | #include <linux/backlight.h> | 33 | #include <linux/backlight.h> |
| 34 | #include <linux/acpi.h> | ||
| 34 | 35 | ||
| 35 | #include "drmP.h" | 36 | #include "drmP.h" |
| 36 | #include "nouveau_drv.h" | 37 | #include "nouveau_drv.h" |
| @@ -136,6 +137,14 @@ int nouveau_backlight_init(struct drm_device *dev) | |||
| 136 | { | 137 | { |
| 137 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 138 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 138 | 139 | ||
| 140 | #ifdef CONFIG_ACPI | ||
| 141 | if (acpi_video_backlight_support()) { | ||
| 142 | NV_INFO(dev, "ACPI backlight interface available, " | ||
| 143 | "not registering our own\n"); | ||
| 144 | return 0; | ||
| 145 | } | ||
| 146 | #endif | ||
| 147 | |||
| 139 | switch (dev_priv->card_type) { | 148 | switch (dev_priv->card_type) { |
| 140 | case NV_40: | 149 | case NV_40: |
| 141 | return nouveau_nv40_backlight_init(dev); | 150 | return nouveau_nv40_backlight_init(dev); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 5f21030a293..b2293576f27 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
| @@ -6829,7 +6829,7 @@ nouveau_bios_posted(struct drm_device *dev) | |||
| 6829 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 6829 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 6830 | unsigned htotal; | 6830 | unsigned htotal; |
| 6831 | 6831 | ||
| 6832 | if (dev_priv->chipset >= NV_50) { | 6832 | if (dev_priv->card_type >= NV_50) { |
| 6833 | if (NVReadVgaCrtc(dev, 0, 0x00) == 0 && | 6833 | if (NVReadVgaCrtc(dev, 0, 0x00) == 0 && |
| 6834 | NVReadVgaCrtc(dev, 0, 0x1a) == 0) | 6834 | NVReadVgaCrtc(dev, 0, 0x1a) == 0) |
| 6835 | return false; | 6835 | return false; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 80353e2b840..c41e1c200ef 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
| @@ -143,8 +143,10 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan, | |||
| 143 | nvbo->no_vm = no_vm; | 143 | nvbo->no_vm = no_vm; |
| 144 | nvbo->tile_mode = tile_mode; | 144 | nvbo->tile_mode = tile_mode; |
| 145 | nvbo->tile_flags = tile_flags; | 145 | nvbo->tile_flags = tile_flags; |
| 146 | nvbo->bo.bdev = &dev_priv->ttm.bdev; | ||
| 146 | 147 | ||
| 147 | nouveau_bo_fixup_align(dev, tile_mode, tile_flags, &align, &size); | 148 | nouveau_bo_fixup_align(dev, tile_mode, nouveau_bo_tile_layout(nvbo), |
| 149 | &align, &size); | ||
| 148 | align >>= PAGE_SHIFT; | 150 | align >>= PAGE_SHIFT; |
| 149 | 151 | ||
| 150 | nouveau_bo_placement_set(nvbo, flags, 0); | 152 | nouveau_bo_placement_set(nvbo, flags, 0); |
| @@ -176,6 +178,31 @@ set_placement_list(uint32_t *pl, unsigned *n, uint32_t type, uint32_t flags) | |||
| 176 | pl[(*n)++] = TTM_PL_FLAG_SYSTEM | flags; | 178 | pl[(*n)++] = TTM_PL_FLAG_SYSTEM | flags; |
| 177 | } | 179 | } |
| 178 | 180 | ||
| 181 | static void | ||
| 182 | set_placement_range(struct nouveau_bo *nvbo, uint32_t type) | ||
| 183 | { | ||
| 184 | struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev); | ||
| 185 | |||
| 186 | if (dev_priv->card_type == NV_10 && | ||
| 187 | nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM)) { | ||
| 188 | /* | ||
| 189 | * Make sure that the color and depth buffers are handled | ||
| 190 | * by independent memory controller units. Up to a 9x | ||
| 191 | * speed up when alpha-blending and depth-test are enabled | ||
| 192 | * at the same time. | ||
| 193 | */ | ||
| 194 | int vram_pages = dev_priv->vram_size >> PAGE_SHIFT; | ||
| 195 | |||
| 196 | if (nvbo->tile_flags & NOUVEAU_GEM_TILE_ZETA) { | ||
| 197 | nvbo->placement.fpfn = vram_pages / 2; | ||
| 198 | nvbo->placement.lpfn = ~0; | ||
| 199 | } else { | ||
| 200 | nvbo->placement.fpfn = 0; | ||
| 201 | nvbo->placement.lpfn = vram_pages / 2; | ||
| 202 | } | ||
| 203 | } | ||
| 204 | } | ||
| 205 | |||
| 179 | void | 206 | void |
| 180 | nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t type, uint32_t busy) | 207 | nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t type, uint32_t busy) |
| 181 | { | 208 | { |
| @@ -190,6 +217,8 @@ nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t type, uint32_t busy) | |||
| 190 | pl->busy_placement = nvbo->busy_placements; | 217 | pl->busy_placement = nvbo->busy_placements; |
| 191 | set_placement_list(nvbo->busy_placements, &pl->num_busy_placement, | 218 | set_placement_list(nvbo->busy_placements, &pl->num_busy_placement, |
| 192 | type | busy, flags); | 219 | type | busy, flags); |
| 220 | |||
| 221 | set_placement_range(nvbo, type); | ||
| 193 | } | 222 | } |
| 194 | 223 | ||
| 195 | int | 224 | int |
| @@ -525,7 +554,8 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | |||
| 525 | stride = 16 * 4; | 554 | stride = 16 * 4; |
| 526 | height = amount / stride; | 555 | height = amount / stride; |
| 527 | 556 | ||
| 528 | if (new_mem->mem_type == TTM_PL_VRAM && nvbo->tile_flags) { | 557 | if (new_mem->mem_type == TTM_PL_VRAM && |
| 558 | nouveau_bo_tile_layout(nvbo)) { | ||
| 529 | ret = RING_SPACE(chan, 8); | 559 | ret = RING_SPACE(chan, 8); |
| 530 | if (ret) | 560 | if (ret) |
| 531 | return ret; | 561 | return ret; |
| @@ -546,7 +576,8 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | |||
| 546 | BEGIN_RING(chan, NvSubM2MF, 0x0200, 1); | 576 | BEGIN_RING(chan, NvSubM2MF, 0x0200, 1); |
| 547 | OUT_RING (chan, 1); | 577 | OUT_RING (chan, 1); |
| 548 | } | 578 | } |
| 549 | if (old_mem->mem_type == TTM_PL_VRAM && nvbo->tile_flags) { | 579 | if (old_mem->mem_type == TTM_PL_VRAM && |
| 580 | nouveau_bo_tile_layout(nvbo)) { | ||
| 550 | ret = RING_SPACE(chan, 8); | 581 | ret = RING_SPACE(chan, 8); |
| 551 | if (ret) | 582 | if (ret) |
| 552 | return ret; | 583 | return ret; |
| @@ -753,7 +784,8 @@ nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem, | |||
| 753 | if (dev_priv->card_type == NV_50) { | 784 | if (dev_priv->card_type == NV_50) { |
| 754 | ret = nv50_mem_vm_bind_linear(dev, | 785 | ret = nv50_mem_vm_bind_linear(dev, |
| 755 | offset + dev_priv->vm_vram_base, | 786 | offset + dev_priv->vm_vram_base, |
| 756 | new_mem->size, nvbo->tile_flags, | 787 | new_mem->size, |
| 788 | nouveau_bo_tile_layout(nvbo), | ||
| 757 | offset); | 789 | offset); |
| 758 | if (ret) | 790 | if (ret) |
| 759 | return ret; | 791 | return ret; |
| @@ -894,7 +926,8 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
| 894 | * nothing to do here. | 926 | * nothing to do here. |
| 895 | */ | 927 | */ |
| 896 | if (bo->mem.mem_type != TTM_PL_VRAM) { | 928 | if (bo->mem.mem_type != TTM_PL_VRAM) { |
| 897 | if (dev_priv->card_type < NV_50 || !nvbo->tile_flags) | 929 | if (dev_priv->card_type < NV_50 || |
| 930 | !nouveau_bo_tile_layout(nvbo)) | ||
| 898 | return 0; | 931 | return 0; |
| 899 | } | 932 | } |
| 900 | 933 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 0871495096f..52c356e9a3d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c | |||
| @@ -281,7 +281,7 @@ detect_analog: | |||
| 281 | nv_encoder = find_encoder_by_type(connector, OUTPUT_ANALOG); | 281 | nv_encoder = find_encoder_by_type(connector, OUTPUT_ANALOG); |
| 282 | if (!nv_encoder && !nouveau_tv_disable) | 282 | if (!nv_encoder && !nouveau_tv_disable) |
| 283 | nv_encoder = find_encoder_by_type(connector, OUTPUT_TV); | 283 | nv_encoder = find_encoder_by_type(connector, OUTPUT_TV); |
| 284 | if (nv_encoder) { | 284 | if (nv_encoder && force) { |
| 285 | struct drm_encoder *encoder = to_drm_encoder(nv_encoder); | 285 | struct drm_encoder *encoder = to_drm_encoder(nv_encoder); |
| 286 | struct drm_encoder_helper_funcs *helper = | 286 | struct drm_encoder_helper_funcs *helper = |
| 287 | encoder->helper_private; | 287 | encoder->helper_private; |
| @@ -641,11 +641,28 @@ nouveau_connector_get_modes(struct drm_connector *connector) | |||
| 641 | return ret; | 641 | return ret; |
| 642 | } | 642 | } |
| 643 | 643 | ||
| 644 | static unsigned | ||
| 645 | get_tmds_link_bandwidth(struct drm_connector *connector) | ||
| 646 | { | ||
| 647 | struct nouveau_connector *nv_connector = nouveau_connector(connector); | ||
| 648 | struct drm_nouveau_private *dev_priv = connector->dev->dev_private; | ||
| 649 | struct dcb_entry *dcb = nv_connector->detected_encoder->dcb; | ||
| 650 | |||
| 651 | if (dcb->location != DCB_LOC_ON_CHIP || | ||
| 652 | dev_priv->chipset >= 0x46) | ||
| 653 | return 165000; | ||
| 654 | else if (dev_priv->chipset >= 0x40) | ||
| 655 | return 155000; | ||
| 656 | else if (dev_priv->chipset >= 0x18) | ||
| 657 | return 135000; | ||
| 658 | else | ||
| 659 | return 112000; | ||
| 660 | } | ||
| 661 | |||
| 644 | static int | 662 | static int |
| 645 | nouveau_connector_mode_valid(struct drm_connector *connector, | 663 | nouveau_connector_mode_valid(struct drm_connector *connector, |
| 646 | struct drm_display_mode *mode) | 664 | struct drm_display_mode *mode) |
| 647 | { | 665 | { |
| 648 | struct drm_nouveau_private *dev_priv = connector->dev->dev_private; | ||
| 649 | struct nouveau_connector *nv_connector = nouveau_connector(connector); | 666 | struct nouveau_connector *nv_connector = nouveau_connector(connector); |
| 650 | struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; | 667 | struct nouveau_encoder *nv_encoder = nv_connector->detected_encoder; |
| 651 | struct drm_encoder *encoder = to_drm_encoder(nv_encoder); | 668 | struct drm_encoder *encoder = to_drm_encoder(nv_encoder); |
| @@ -663,11 +680,9 @@ nouveau_connector_mode_valid(struct drm_connector *connector, | |||
| 663 | max_clock = 400000; | 680 | max_clock = 400000; |
| 664 | break; | 681 | break; |
| 665 | case OUTPUT_TMDS: | 682 | case OUTPUT_TMDS: |
| 666 | if ((dev_priv->card_type >= NV_50 && !nouveau_duallink) || | 683 | max_clock = get_tmds_link_bandwidth(connector); |
| 667 | !nv_encoder->dcb->duallink_possible) | 684 | if (nouveau_duallink && nv_encoder->dcb->duallink_possible) |
| 668 | max_clock = 165000; | 685 | max_clock *= 2; |
| 669 | else | ||
| 670 | max_clock = 330000; | ||
| 671 | break; | 686 | break; |
| 672 | case OUTPUT_ANALOG: | 687 | case OUTPUT_ANALOG: |
| 673 | max_clock = nv_encoder->dcb->crtconf.maxfreq; | 688 | max_clock = nv_encoder->dcb->crtconf.maxfreq; |
| @@ -709,44 +724,6 @@ nouveau_connector_best_encoder(struct drm_connector *connector) | |||
| 709 | return NULL; | 724 | return NULL; |
| 710 | } | 725 | } |
| 711 | 726 | ||
| 712 | void | ||
| 713 | nouveau_connector_set_polling(struct drm_connector *connector) | ||
| 714 | { | ||
| 715 | struct drm_device *dev = connector->dev; | ||
| 716 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 717 | struct drm_crtc *crtc; | ||
| 718 | bool spare_crtc = false; | ||
| 719 | |||
| 720 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) | ||
| 721 | spare_crtc |= !crtc->enabled; | ||
| 722 | |||
| 723 | connector->polled = 0; | ||
| 724 | |||
| 725 | switch (connector->connector_type) { | ||
| 726 | case DRM_MODE_CONNECTOR_VGA: | ||
| 727 | case DRM_MODE_CONNECTOR_TV: | ||
| 728 | if (dev_priv->card_type >= NV_50 || | ||
| 729 | (nv_gf4_disp_arch(dev) && spare_crtc)) | ||
| 730 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | ||
| 731 | break; | ||
| 732 | |||
| 733 | case DRM_MODE_CONNECTOR_DVII: | ||
| 734 | case DRM_MODE_CONNECTOR_DVID: | ||
| 735 | case DRM_MODE_CONNECTOR_HDMIA: | ||
| 736 | case DRM_MODE_CONNECTOR_DisplayPort: | ||
| 737 | case DRM_MODE_CONNECTOR_eDP: | ||
| 738 | if (dev_priv->card_type >= NV_50) | ||
| 739 | connector->polled = DRM_CONNECTOR_POLL_HPD; | ||
| 740 | else if (connector->connector_type == DRM_MODE_CONNECTOR_DVID || | ||
| 741 | spare_crtc) | ||
| 742 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | ||
| 743 | break; | ||
| 744 | |||
| 745 | default: | ||
| 746 | break; | ||
| 747 | } | ||
| 748 | } | ||
| 749 | |||
| 750 | static const struct drm_connector_helper_funcs | 727 | static const struct drm_connector_helper_funcs |
| 751 | nouveau_connector_helper_funcs = { | 728 | nouveau_connector_helper_funcs = { |
| 752 | .get_modes = nouveau_connector_get_modes, | 729 | .get_modes = nouveau_connector_get_modes, |
| @@ -872,6 +849,7 @@ nouveau_connector_create(struct drm_device *dev, int index) | |||
| 872 | dev->mode_config.scaling_mode_property, | 849 | dev->mode_config.scaling_mode_property, |
| 873 | nv_connector->scaling_mode); | 850 | nv_connector->scaling_mode); |
| 874 | } | 851 | } |
| 852 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | ||
| 875 | /* fall-through */ | 853 | /* fall-through */ |
| 876 | case DCB_CONNECTOR_TV_0: | 854 | case DCB_CONNECTOR_TV_0: |
| 877 | case DCB_CONNECTOR_TV_1: | 855 | case DCB_CONNECTOR_TV_1: |
| @@ -888,11 +866,16 @@ nouveau_connector_create(struct drm_device *dev, int index) | |||
| 888 | dev->mode_config.dithering_mode_property, | 866 | dev->mode_config.dithering_mode_property, |
| 889 | nv_connector->use_dithering ? | 867 | nv_connector->use_dithering ? |
| 890 | DRM_MODE_DITHERING_ON : DRM_MODE_DITHERING_OFF); | 868 | DRM_MODE_DITHERING_ON : DRM_MODE_DITHERING_OFF); |
| 869 | |||
| 870 | if (dcb->type != DCB_CONNECTOR_LVDS) { | ||
| 871 | if (dev_priv->card_type >= NV_50) | ||
| 872 | connector->polled = DRM_CONNECTOR_POLL_HPD; | ||
| 873 | else | ||
| 874 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | ||
| 875 | } | ||
| 891 | break; | 876 | break; |
| 892 | } | 877 | } |
| 893 | 878 | ||
| 894 | nouveau_connector_set_polling(connector); | ||
| 895 | |||
| 896 | drm_sysfs_connector_add(connector); | 879 | drm_sysfs_connector_add(connector); |
| 897 | dcb->drm = connector; | 880 | dcb->drm = connector; |
| 898 | return dcb->drm; | 881 | return dcb->drm; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h index c21ed6b16f8..711b1e9203a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.h +++ b/drivers/gpu/drm/nouveau/nouveau_connector.h | |||
| @@ -52,9 +52,6 @@ static inline struct nouveau_connector *nouveau_connector( | |||
| 52 | struct drm_connector * | 52 | struct drm_connector * |
| 53 | nouveau_connector_create(struct drm_device *, int index); | 53 | nouveau_connector_create(struct drm_device *, int index); |
| 54 | 54 | ||
| 55 | void | ||
| 56 | nouveau_connector_set_polling(struct drm_connector *); | ||
| 57 | |||
| 58 | int | 55 | int |
| 59 | nouveau_connector_bpp(struct drm_connector *); | 56 | nouveau_connector_bpp(struct drm_connector *); |
| 60 | 57 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 3a07e580d27..1c7db64c03b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
| @@ -100,6 +100,9 @@ struct nouveau_bo { | |||
| 100 | int pin_refcnt; | 100 | int pin_refcnt; |
| 101 | }; | 101 | }; |
| 102 | 102 | ||
| 103 | #define nouveau_bo_tile_layout(nvbo) \ | ||
| 104 | ((nvbo)->tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK) | ||
| 105 | |||
| 103 | static inline struct nouveau_bo * | 106 | static inline struct nouveau_bo * |
| 104 | nouveau_bo(struct ttm_buffer_object *bo) | 107 | nouveau_bo(struct ttm_buffer_object *bo) |
| 105 | { | 108 | { |
| @@ -304,6 +307,7 @@ struct nouveau_fifo_engine { | |||
| 304 | void (*destroy_context)(struct nouveau_channel *); | 307 | void (*destroy_context)(struct nouveau_channel *); |
| 305 | int (*load_context)(struct nouveau_channel *); | 308 | int (*load_context)(struct nouveau_channel *); |
| 306 | int (*unload_context)(struct drm_device *); | 309 | int (*unload_context)(struct drm_device *); |
| 310 | void (*tlb_flush)(struct drm_device *dev); | ||
| 307 | }; | 311 | }; |
| 308 | 312 | ||
| 309 | struct nouveau_pgraph_object_method { | 313 | struct nouveau_pgraph_object_method { |
| @@ -336,6 +340,7 @@ struct nouveau_pgraph_engine { | |||
| 336 | void (*destroy_context)(struct nouveau_channel *); | 340 | void (*destroy_context)(struct nouveau_channel *); |
| 337 | int (*load_context)(struct nouveau_channel *); | 341 | int (*load_context)(struct nouveau_channel *); |
| 338 | int (*unload_context)(struct drm_device *); | 342 | int (*unload_context)(struct drm_device *); |
| 343 | void (*tlb_flush)(struct drm_device *dev); | ||
| 339 | 344 | ||
| 340 | void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr, | 345 | void (*set_region_tiling)(struct drm_device *dev, int i, uint32_t addr, |
| 341 | uint32_t size, uint32_t pitch); | 346 | uint32_t size, uint32_t pitch); |
| @@ -485,13 +490,13 @@ enum nv04_fp_display_regs { | |||
| 485 | }; | 490 | }; |
| 486 | 491 | ||
| 487 | struct nv04_crtc_reg { | 492 | struct nv04_crtc_reg { |
| 488 | unsigned char MiscOutReg; /* */ | 493 | unsigned char MiscOutReg; |
| 489 | uint8_t CRTC[0xa0]; | 494 | uint8_t CRTC[0xa0]; |
| 490 | uint8_t CR58[0x10]; | 495 | uint8_t CR58[0x10]; |
| 491 | uint8_t Sequencer[5]; | 496 | uint8_t Sequencer[5]; |
| 492 | uint8_t Graphics[9]; | 497 | uint8_t Graphics[9]; |
| 493 | uint8_t Attribute[21]; | 498 | uint8_t Attribute[21]; |
| 494 | unsigned char DAC[768]; /* Internal Colorlookuptable */ | 499 | unsigned char DAC[768]; |
| 495 | 500 | ||
| 496 | /* PCRTC regs */ | 501 | /* PCRTC regs */ |
| 497 | uint32_t fb_start; | 502 | uint32_t fb_start; |
| @@ -539,43 +544,9 @@ struct nv04_output_reg { | |||
| 539 | }; | 544 | }; |
| 540 | 545 | ||
| 541 | struct nv04_mode_state { | 546 | struct nv04_mode_state { |
| 542 | uint32_t bpp; | 547 | struct nv04_crtc_reg crtc_reg[2]; |
| 543 | uint32_t width; | ||
| 544 | uint32_t height; | ||
| 545 | uint32_t interlace; | ||
| 546 | uint32_t repaint0; | ||
| 547 | uint32_t repaint1; | ||
| 548 | uint32_t screen; | ||
| 549 | uint32_t scale; | ||
| 550 | uint32_t dither; | ||
| 551 | uint32_t extra; | ||
| 552 | uint32_t fifo; | ||
| 553 | uint32_t pixel; | ||
| 554 | uint32_t horiz; | ||
| 555 | int arbitration0; | ||
| 556 | int arbitration1; | ||
| 557 | uint32_t pll; | ||
| 558 | uint32_t pllB; | ||
| 559 | uint32_t vpll; | ||
| 560 | uint32_t vpll2; | ||
| 561 | uint32_t vpllB; | ||
| 562 | uint32_t vpll2B; | ||
| 563 | uint32_t pllsel; | 548 | uint32_t pllsel; |
| 564 | uint32_t sel_clk; | 549 | uint32_t sel_clk; |
| 565 | uint32_t general; | ||
| 566 | uint32_t crtcOwner; | ||
| 567 | uint32_t head; | ||
| 568 | uint32_t head2; | ||
| 569 | uint32_t cursorConfig; | ||
| 570 | uint32_t cursor0; | ||
| 571 | uint32_t cursor1; | ||
| 572 | uint32_t cursor2; | ||
| 573 | uint32_t timingH; | ||
| 574 | uint32_t timingV; | ||
| 575 | uint32_t displayV; | ||
| 576 | uint32_t crtcSync; | ||
| 577 | |||
| 578 | struct nv04_crtc_reg crtc_reg[2]; | ||
| 579 | }; | 550 | }; |
| 580 | 551 | ||
| 581 | enum nouveau_card_type { | 552 | enum nouveau_card_type { |
| @@ -613,6 +584,12 @@ struct drm_nouveau_private { | |||
| 613 | struct work_struct irq_work; | 584 | struct work_struct irq_work; |
| 614 | struct work_struct hpd_work; | 585 | struct work_struct hpd_work; |
| 615 | 586 | ||
| 587 | struct { | ||
| 588 | spinlock_t lock; | ||
| 589 | uint32_t hpd0_bits; | ||
| 590 | uint32_t hpd1_bits; | ||
| 591 | } hpd_state; | ||
| 592 | |||
| 616 | struct list_head vbl_waiting; | 593 | struct list_head vbl_waiting; |
| 617 | 594 | ||
| 618 | struct { | 595 | struct { |
| @@ -1045,6 +1022,7 @@ extern int nv50_fifo_create_context(struct nouveau_channel *); | |||
| 1045 | extern void nv50_fifo_destroy_context(struct nouveau_channel *); | 1022 | extern void nv50_fifo_destroy_context(struct nouveau_channel *); |
| 1046 | extern int nv50_fifo_load_context(struct nouveau_channel *); | 1023 | extern int nv50_fifo_load_context(struct nouveau_channel *); |
| 1047 | extern int nv50_fifo_unload_context(struct drm_device *); | 1024 | extern int nv50_fifo_unload_context(struct drm_device *); |
| 1025 | extern void nv50_fifo_tlb_flush(struct drm_device *dev); | ||
| 1048 | 1026 | ||
| 1049 | /* nvc0_fifo.c */ | 1027 | /* nvc0_fifo.c */ |
| 1050 | extern int nvc0_fifo_init(struct drm_device *); | 1028 | extern int nvc0_fifo_init(struct drm_device *); |
| @@ -1122,6 +1100,8 @@ extern int nv50_graph_load_context(struct nouveau_channel *); | |||
| 1122 | extern int nv50_graph_unload_context(struct drm_device *); | 1100 | extern int nv50_graph_unload_context(struct drm_device *); |
| 1123 | extern void nv50_graph_context_switch(struct drm_device *); | 1101 | extern void nv50_graph_context_switch(struct drm_device *); |
| 1124 | extern int nv50_grctx_init(struct nouveau_grctx *); | 1102 | extern int nv50_grctx_init(struct nouveau_grctx *); |
| 1103 | extern void nv50_graph_tlb_flush(struct drm_device *dev); | ||
| 1104 | extern void nv86_graph_tlb_flush(struct drm_device *dev); | ||
| 1125 | 1105 | ||
| 1126 | /* nvc0_graph.c */ | 1106 | /* nvc0_graph.c */ |
| 1127 | extern int nvc0_graph_init(struct drm_device *); | 1107 | extern int nvc0_graph_init(struct drm_device *); |
| @@ -1239,7 +1219,6 @@ extern u16 nouveau_bo_rd16(struct nouveau_bo *nvbo, unsigned index); | |||
| 1239 | extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val); | 1219 | extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val); |
| 1240 | extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index); | 1220 | extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index); |
| 1241 | extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val); | 1221 | extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val); |
| 1242 | extern int nouveau_bo_sync_gpu(struct nouveau_bo *, struct nouveau_channel *); | ||
| 1243 | 1222 | ||
| 1244 | /* nouveau_fence.c */ | 1223 | /* nouveau_fence.c */ |
| 1245 | struct nouveau_fence; | 1224 | struct nouveau_fence; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 441b12420bb..ab1bbfbf266 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c | |||
| @@ -249,6 +249,7 @@ alloc_semaphore(struct drm_device *dev) | |||
| 249 | { | 249 | { |
| 250 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 250 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 251 | struct nouveau_semaphore *sema; | 251 | struct nouveau_semaphore *sema; |
| 252 | int ret; | ||
| 252 | 253 | ||
| 253 | if (!USE_SEMA(dev)) | 254 | if (!USE_SEMA(dev)) |
| 254 | return NULL; | 255 | return NULL; |
| @@ -257,10 +258,14 @@ alloc_semaphore(struct drm_device *dev) | |||
| 257 | if (!sema) | 258 | if (!sema) |
| 258 | goto fail; | 259 | goto fail; |
| 259 | 260 | ||
| 261 | ret = drm_mm_pre_get(&dev_priv->fence.heap); | ||
| 262 | if (ret) | ||
| 263 | goto fail; | ||
| 264 | |||
| 260 | spin_lock(&dev_priv->fence.lock); | 265 | spin_lock(&dev_priv->fence.lock); |
| 261 | sema->mem = drm_mm_search_free(&dev_priv->fence.heap, 4, 0, 0); | 266 | sema->mem = drm_mm_search_free(&dev_priv->fence.heap, 4, 0, 0); |
| 262 | if (sema->mem) | 267 | if (sema->mem) |
| 263 | sema->mem = drm_mm_get_block(sema->mem, 4, 0); | 268 | sema->mem = drm_mm_get_block_atomic(sema->mem, 4, 0); |
| 264 | spin_unlock(&dev_priv->fence.lock); | 269 | spin_unlock(&dev_priv->fence.lock); |
| 265 | 270 | ||
| 266 | if (!sema->mem) | 271 | if (!sema->mem) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 5c4c929d7f7..9a1fdcf400c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
| @@ -107,23 +107,29 @@ nouveau_gem_info(struct drm_gem_object *gem, struct drm_nouveau_gem_info *rep) | |||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | static bool | 109 | static bool |
| 110 | nouveau_gem_tile_flags_valid(struct drm_device *dev, uint32_t tile_flags) { | 110 | nouveau_gem_tile_flags_valid(struct drm_device *dev, uint32_t tile_flags) |
| 111 | switch (tile_flags) { | 111 | { |
| 112 | case 0x0000: | 112 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 113 | case 0x1800: | 113 | |
| 114 | case 0x2800: | 114 | if (dev_priv->card_type >= NV_50) { |
| 115 | case 0x4800: | 115 | switch (tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK) { |
| 116 | case 0x7000: | 116 | case 0x0000: |
| 117 | case 0x7400: | 117 | case 0x1800: |
| 118 | case 0x7a00: | 118 | case 0x2800: |
| 119 | case 0xe000: | 119 | case 0x4800: |
| 120 | break; | 120 | case 0x7000: |
| 121 | default: | 121 | case 0x7400: |
| 122 | NV_ERROR(dev, "bad page flags: 0x%08x\n", tile_flags); | 122 | case 0x7a00: |
| 123 | return false; | 123 | case 0xe000: |
| 124 | return true; | ||
| 125 | } | ||
| 126 | } else { | ||
| 127 | if (!(tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK)) | ||
| 128 | return true; | ||
| 124 | } | 129 | } |
| 125 | 130 | ||
| 126 | return true; | 131 | NV_ERROR(dev, "bad page flags: 0x%08x\n", tile_flags); |
| 132 | return false; | ||
| 127 | } | 133 | } |
| 128 | 134 | ||
| 129 | int | 135 | int |
diff --git a/drivers/gpu/drm/nouveau/nouveau_hw.c b/drivers/gpu/drm/nouveau/nouveau_hw.c index bed669a54a2..b9672a05c41 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hw.c +++ b/drivers/gpu/drm/nouveau/nouveau_hw.c | |||
| @@ -519,11 +519,11 @@ nouveau_hw_fix_bad_vpll(struct drm_device *dev, int head) | |||
| 519 | 519 | ||
| 520 | struct pll_lims pll_lim; | 520 | struct pll_lims pll_lim; |
| 521 | struct nouveau_pll_vals pv; | 521 | struct nouveau_pll_vals pv; |
| 522 | uint32_t pllreg = head ? NV_RAMDAC_VPLL2 : NV_PRAMDAC_VPLL_COEFF; | 522 | enum pll_types pll = head ? PLL_VPLL1 : PLL_VPLL0; |
| 523 | 523 | ||
| 524 | if (get_pll_limits(dev, pllreg, &pll_lim)) | 524 | if (get_pll_limits(dev, pll, &pll_lim)) |
| 525 | return; | 525 | return; |
| 526 | nouveau_hw_get_pllvals(dev, pllreg, &pv); | 526 | nouveau_hw_get_pllvals(dev, pll, &pv); |
| 527 | 527 | ||
| 528 | if (pv.M1 >= pll_lim.vco1.min_m && pv.M1 <= pll_lim.vco1.max_m && | 528 | if (pv.M1 >= pll_lim.vco1.min_m && pv.M1 <= pll_lim.vco1.max_m && |
| 529 | pv.N1 >= pll_lim.vco1.min_n && pv.N1 <= pll_lim.vco1.max_n && | 529 | pv.N1 >= pll_lim.vco1.min_n && pv.N1 <= pll_lim.vco1.max_n && |
| @@ -536,7 +536,7 @@ nouveau_hw_fix_bad_vpll(struct drm_device *dev, int head) | |||
| 536 | pv.M1 = pll_lim.vco1.max_m; | 536 | pv.M1 = pll_lim.vco1.max_m; |
| 537 | pv.N1 = pll_lim.vco1.min_n; | 537 | pv.N1 = pll_lim.vco1.min_n; |
| 538 | pv.log2P = pll_lim.max_usable_log2p; | 538 | pv.log2P = pll_lim.max_usable_log2p; |
| 539 | nouveau_hw_setpll(dev, pllreg, &pv); | 539 | nouveau_hw_setpll(dev, pll_lim.reg, &pv); |
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | /* | 542 | /* |
diff --git a/drivers/gpu/drm/nouveau/nouveau_hw.h b/drivers/gpu/drm/nouveau/nouveau_hw.h index 869130f8360..2989090b943 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hw.h +++ b/drivers/gpu/drm/nouveau/nouveau_hw.h | |||
| @@ -416,6 +416,25 @@ nv_fix_nv40_hw_cursor(struct drm_device *dev, int head) | |||
| 416 | } | 416 | } |
| 417 | 417 | ||
| 418 | static inline void | 418 | static inline void |
| 419 | nv_set_crtc_base(struct drm_device *dev, int head, uint32_t offset) | ||
| 420 | { | ||
| 421 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 422 | |||
| 423 | NVWriteCRTC(dev, head, NV_PCRTC_START, offset); | ||
| 424 | |||
| 425 | if (dev_priv->card_type == NV_04) { | ||
| 426 | /* | ||
| 427 | * Hilarious, the 24th bit doesn't want to stick to | ||
| 428 | * PCRTC_START... | ||
| 429 | */ | ||
| 430 | int cre_heb = NVReadVgaCrtc(dev, head, NV_CIO_CRE_HEB__INDEX); | ||
| 431 | |||
| 432 | NVWriteVgaCrtc(dev, head, NV_CIO_CRE_HEB__INDEX, | ||
| 433 | (cre_heb & ~0x40) | ((offset >> 18) & 0x40)); | ||
| 434 | } | ||
| 435 | } | ||
| 436 | |||
| 437 | static inline void | ||
| 419 | nv_show_cursor(struct drm_device *dev, int head, bool show) | 438 | nv_show_cursor(struct drm_device *dev, int head, bool show) |
| 420 | { | 439 | { |
| 421 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 440 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index fdd7e3de79c..cb389d01432 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c | |||
| @@ -256,7 +256,7 @@ nouveau_i2c_find(struct drm_device *dev, int index) | |||
| 256 | if (index >= DCB_MAX_NUM_I2C_ENTRIES) | 256 | if (index >= DCB_MAX_NUM_I2C_ENTRIES) |
| 257 | return NULL; | 257 | return NULL; |
| 258 | 258 | ||
| 259 | if (dev_priv->chipset >= NV_50 && (i2c->entry & 0x00000100)) { | 259 | if (dev_priv->card_type >= NV_50 && (i2c->entry & 0x00000100)) { |
| 260 | uint32_t reg = 0xe500, val; | 260 | uint32_t reg = 0xe500, val; |
| 261 | 261 | ||
| 262 | if (i2c->port_type == 6) { | 262 | if (i2c->port_type == 6) { |
diff --git a/drivers/gpu/drm/nouveau/nouveau_irq.c b/drivers/gpu/drm/nouveau/nouveau_irq.c index 6fd51a51c60..7bfd9e6c9d6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_irq.c +++ b/drivers/gpu/drm/nouveau/nouveau_irq.c | |||
| @@ -42,6 +42,13 @@ | |||
| 42 | #include "nouveau_connector.h" | 42 | #include "nouveau_connector.h" |
| 43 | #include "nv50_display.h" | 43 | #include "nv50_display.h" |
| 44 | 44 | ||
| 45 | static DEFINE_RATELIMIT_STATE(nouveau_ratelimit_state, 3 * HZ, 20); | ||
| 46 | |||
| 47 | static int nouveau_ratelimit(void) | ||
| 48 | { | ||
| 49 | return __ratelimit(&nouveau_ratelimit_state); | ||
| 50 | } | ||
| 51 | |||
| 45 | void | 52 | void |
| 46 | nouveau_irq_preinstall(struct drm_device *dev) | 53 | nouveau_irq_preinstall(struct drm_device *dev) |
| 47 | { | 54 | { |
| @@ -53,6 +60,7 @@ nouveau_irq_preinstall(struct drm_device *dev) | |||
| 53 | if (dev_priv->card_type >= NV_50) { | 60 | if (dev_priv->card_type >= NV_50) { |
| 54 | INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh); | 61 | INIT_WORK(&dev_priv->irq_work, nv50_display_irq_handler_bh); |
| 55 | INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh); | 62 | INIT_WORK(&dev_priv->hpd_work, nv50_display_irq_hotplug_bh); |
| 63 | spin_lock_init(&dev_priv->hpd_state.lock); | ||
| 56 | INIT_LIST_HEAD(&dev_priv->vbl_waiting); | 64 | INIT_LIST_HEAD(&dev_priv->vbl_waiting); |
| 57 | } | 65 | } |
| 58 | } | 66 | } |
| @@ -202,8 +210,8 @@ nouveau_fifo_irq_handler(struct drm_device *dev) | |||
| 202 | } | 210 | } |
| 203 | 211 | ||
| 204 | if (status & NV_PFIFO_INTR_DMA_PUSHER) { | 212 | if (status & NV_PFIFO_INTR_DMA_PUSHER) { |
| 205 | u32 get = nv_rd32(dev, 0x003244); | 213 | u32 dma_get = nv_rd32(dev, 0x003244); |
| 206 | u32 put = nv_rd32(dev, 0x003240); | 214 | u32 dma_put = nv_rd32(dev, 0x003240); |
| 207 | u32 push = nv_rd32(dev, 0x003220); | 215 | u32 push = nv_rd32(dev, 0x003220); |
| 208 | u32 state = nv_rd32(dev, 0x003228); | 216 | u32 state = nv_rd32(dev, 0x003228); |
| 209 | 217 | ||
| @@ -213,16 +221,18 @@ nouveau_fifo_irq_handler(struct drm_device *dev) | |||
| 213 | u32 ib_get = nv_rd32(dev, 0x003334); | 221 | u32 ib_get = nv_rd32(dev, 0x003334); |
| 214 | u32 ib_put = nv_rd32(dev, 0x003330); | 222 | u32 ib_put = nv_rd32(dev, 0x003330); |
| 215 | 223 | ||
| 216 | NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%02x%08x " | 224 | if (nouveau_ratelimit()) |
| 225 | NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%02x%08x " | ||
| 217 | "Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x " | 226 | "Put 0x%02x%08x IbGet 0x%08x IbPut 0x%08x " |
| 218 | "State 0x%08x Push 0x%08x\n", | 227 | "State 0x%08x Push 0x%08x\n", |
| 219 | chid, ho_get, get, ho_put, put, ib_get, ib_put, | 228 | chid, ho_get, dma_get, ho_put, |
| 220 | state, push); | 229 | dma_put, ib_get, ib_put, state, |
| 230 | push); | ||
| 221 | 231 | ||
| 222 | /* METHOD_COUNT, in DMA_STATE on earlier chipsets */ | 232 | /* METHOD_COUNT, in DMA_STATE on earlier chipsets */ |
| 223 | nv_wr32(dev, 0x003364, 0x00000000); | 233 | nv_wr32(dev, 0x003364, 0x00000000); |
| 224 | if (get != put || ho_get != ho_put) { | 234 | if (dma_get != dma_put || ho_get != ho_put) { |
| 225 | nv_wr32(dev, 0x003244, put); | 235 | nv_wr32(dev, 0x003244, dma_put); |
| 226 | nv_wr32(dev, 0x003328, ho_put); | 236 | nv_wr32(dev, 0x003328, ho_put); |
| 227 | } else | 237 | } else |
| 228 | if (ib_get != ib_put) { | 238 | if (ib_get != ib_put) { |
| @@ -231,10 +241,10 @@ nouveau_fifo_irq_handler(struct drm_device *dev) | |||
| 231 | } else { | 241 | } else { |
| 232 | NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%08x " | 242 | NV_INFO(dev, "PFIFO_DMA_PUSHER - Ch %d Get 0x%08x " |
| 233 | "Put 0x%08x State 0x%08x Push 0x%08x\n", | 243 | "Put 0x%08x State 0x%08x Push 0x%08x\n", |
| 234 | chid, get, put, state, push); | 244 | chid, dma_get, dma_put, state, push); |
| 235 | 245 | ||
| 236 | if (get != put) | 246 | if (dma_get != dma_put) |
| 237 | nv_wr32(dev, 0x003244, put); | 247 | nv_wr32(dev, 0x003244, dma_put); |
| 238 | } | 248 | } |
| 239 | 249 | ||
| 240 | nv_wr32(dev, 0x003228, 0x00000000); | 250 | nv_wr32(dev, 0x003228, 0x00000000); |
| @@ -266,8 +276,9 @@ nouveau_fifo_irq_handler(struct drm_device *dev) | |||
| 266 | } | 276 | } |
| 267 | 277 | ||
| 268 | if (status) { | 278 | if (status) { |
| 269 | NV_INFO(dev, "PFIFO_INTR 0x%08x - Ch %d\n", | 279 | if (nouveau_ratelimit()) |
| 270 | status, chid); | 280 | NV_INFO(dev, "PFIFO_INTR 0x%08x - Ch %d\n", |
| 281 | status, chid); | ||
| 271 | nv_wr32(dev, NV03_PFIFO_INTR_0, status); | 282 | nv_wr32(dev, NV03_PFIFO_INTR_0, status); |
| 272 | status = 0; | 283 | status = 0; |
| 273 | } | 284 | } |
| @@ -544,13 +555,6 @@ nouveau_pgraph_intr_notify(struct drm_device *dev, uint32_t nsource) | |||
| 544 | nouveau_graph_dump_trap_info(dev, "PGRAPH_NOTIFY", &trap); | 555 | nouveau_graph_dump_trap_info(dev, "PGRAPH_NOTIFY", &trap); |
| 545 | } | 556 | } |
| 546 | 557 | ||
| 547 | static DEFINE_RATELIMIT_STATE(nouveau_ratelimit_state, 3 * HZ, 20); | ||
| 548 | |||
| 549 | static int nouveau_ratelimit(void) | ||
| 550 | { | ||
| 551 | return __ratelimit(&nouveau_ratelimit_state); | ||
| 552 | } | ||
| 553 | |||
| 554 | 558 | ||
| 555 | static inline void | 559 | static inline void |
| 556 | nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource) | 560 | nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index a163c7c612e..fe4a30dc4b4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
| @@ -33,9 +33,9 @@ | |||
| 33 | #include "drmP.h" | 33 | #include "drmP.h" |
| 34 | #include "drm.h" | 34 | #include "drm.h" |
| 35 | #include "drm_sarea.h" | 35 | #include "drm_sarea.h" |
| 36 | #include "nouveau_drv.h" | ||
| 37 | 36 | ||
| 38 | #define MIN(a,b) a < b ? a : b | 37 | #include "nouveau_drv.h" |
| 38 | #include "nouveau_pm.h" | ||
| 39 | 39 | ||
| 40 | /* | 40 | /* |
| 41 | * NV10-NV40 tiling helpers | 41 | * NV10-NV40 tiling helpers |
| @@ -175,11 +175,10 @@ nv50_mem_vm_bind_linear(struct drm_device *dev, uint64_t virt, uint32_t size, | |||
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| 177 | } | 177 | } |
| 178 | dev_priv->engine.instmem.flush(dev); | ||
| 179 | 178 | ||
| 180 | nv50_vm_flush(dev, 5); | 179 | dev_priv->engine.instmem.flush(dev); |
| 181 | nv50_vm_flush(dev, 0); | 180 | dev_priv->engine.fifo.tlb_flush(dev); |
| 182 | nv50_vm_flush(dev, 4); | 181 | dev_priv->engine.graph.tlb_flush(dev); |
| 183 | nv50_vm_flush(dev, 6); | 182 | nv50_vm_flush(dev, 6); |
| 184 | return 0; | 183 | return 0; |
| 185 | } | 184 | } |
| @@ -209,11 +208,10 @@ nv50_mem_vm_unbind(struct drm_device *dev, uint64_t virt, uint32_t size) | |||
| 209 | pte++; | 208 | pte++; |
| 210 | } | 209 | } |
| 211 | } | 210 | } |
| 212 | dev_priv->engine.instmem.flush(dev); | ||
| 213 | 211 | ||
| 214 | nv50_vm_flush(dev, 5); | 212 | dev_priv->engine.instmem.flush(dev); |
| 215 | nv50_vm_flush(dev, 0); | 213 | dev_priv->engine.fifo.tlb_flush(dev); |
| 216 | nv50_vm_flush(dev, 4); | 214 | dev_priv->engine.graph.tlb_flush(dev); |
| 217 | nv50_vm_flush(dev, 6); | 215 | nv50_vm_flush(dev, 6); |
| 218 | } | 216 | } |
| 219 | 217 | ||
| @@ -653,6 +651,7 @@ nouveau_mem_gart_init(struct drm_device *dev) | |||
| 653 | void | 651 | void |
| 654 | nouveau_mem_timing_init(struct drm_device *dev) | 652 | nouveau_mem_timing_init(struct drm_device *dev) |
| 655 | { | 653 | { |
| 654 | /* cards < NVC0 only */ | ||
| 656 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 655 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 657 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 656 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
| 658 | struct nouveau_pm_memtimings *memtimings = &pm->memtimings; | 657 | struct nouveau_pm_memtimings *memtimings = &pm->memtimings; |
| @@ -719,14 +718,14 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
| 719 | tUNK_19 = 1; | 718 | tUNK_19 = 1; |
| 720 | tUNK_20 = 0; | 719 | tUNK_20 = 0; |
| 721 | tUNK_21 = 0; | 720 | tUNK_21 = 0; |
| 722 | switch (MIN(recordlen,21)) { | 721 | switch (min(recordlen, 22)) { |
| 723 | case 21: | 722 | case 22: |
| 724 | tUNK_21 = entry[21]; | 723 | tUNK_21 = entry[21]; |
| 725 | case 20: | 724 | case 21: |
| 726 | tUNK_20 = entry[20]; | 725 | tUNK_20 = entry[20]; |
| 727 | case 19: | 726 | case 20: |
| 728 | tUNK_19 = entry[19]; | 727 | tUNK_19 = entry[19]; |
| 729 | case 18: | 728 | case 19: |
| 730 | tUNK_18 = entry[18]; | 729 | tUNK_18 = entry[18]; |
| 731 | default: | 730 | default: |
| 732 | tUNK_0 = entry[0]; | 731 | tUNK_0 = entry[0]; |
| @@ -756,24 +755,30 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
| 756 | timing->reg_100228 = (tUNK_12 << 16 | tUNK_11 << 8 | tUNK_10); | 755 | timing->reg_100228 = (tUNK_12 << 16 | tUNK_11 << 8 | tUNK_10); |
| 757 | if(recordlen > 19) { | 756 | if(recordlen > 19) { |
| 758 | timing->reg_100228 += (tUNK_19 - 1) << 24; | 757 | timing->reg_100228 += (tUNK_19 - 1) << 24; |
| 759 | } else { | 758 | }/* I cannot back-up this else-statement right now |
| 759 | else { | ||
| 760 | timing->reg_100228 += tUNK_12 << 24; | 760 | timing->reg_100228 += tUNK_12 << 24; |
| 761 | } | 761 | }*/ |
| 762 | 762 | ||
| 763 | /* XXX: reg_10022c */ | 763 | /* XXX: reg_10022c */ |
| 764 | timing->reg_10022c = tUNK_2 - 1; | ||
| 764 | 765 | ||
| 765 | timing->reg_100230 = (tUNK_20 << 24 | tUNK_21 << 16 | | 766 | timing->reg_100230 = (tUNK_20 << 24 | tUNK_21 << 16 | |
| 766 | tUNK_13 << 8 | tUNK_13); | 767 | tUNK_13 << 8 | tUNK_13); |
| 767 | 768 | ||
| 768 | /* XXX: +6? */ | 769 | /* XXX: +6? */ |
| 769 | timing->reg_100234 = (tRAS << 24 | (tUNK_19 + 6) << 8 | tRC); | 770 | timing->reg_100234 = (tRAS << 24 | (tUNK_19 + 6) << 8 | tRC); |
| 770 | if(tUNK_10 > tUNK_11) { | 771 | timing->reg_100234 += max(tUNK_10,tUNK_11) << 16; |
| 771 | timing->reg_100234 += tUNK_10 << 16; | 772 | |
| 772 | } else { | 773 | /* XXX; reg_100238, reg_10023c |
| 773 | timing->reg_100234 += tUNK_11 << 16; | 774 | * reg: 0x00?????? |
| 775 | * reg_10023c: | ||
| 776 | * 0 for pre-NV50 cards | ||
| 777 | * 0x????0202 for NV50+ cards (empirical evidence) */ | ||
| 778 | if(dev_priv->card_type >= NV_50) { | ||
| 779 | timing->reg_10023c = 0x202; | ||
| 774 | } | 780 | } |
| 775 | 781 | ||
| 776 | /* XXX; reg_100238, reg_10023c */ | ||
| 777 | NV_DEBUG(dev, "Entry %d: 220: %08x %08x %08x %08x\n", i, | 782 | NV_DEBUG(dev, "Entry %d: 220: %08x %08x %08x %08x\n", i, |
| 778 | timing->reg_100220, timing->reg_100224, | 783 | timing->reg_100220, timing->reg_100224, |
| 779 | timing->reg_100228, timing->reg_10022c); | 784 | timing->reg_100228, timing->reg_10022c); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index 896cf863414..dd572adca02 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c | |||
| @@ -129,7 +129,7 @@ nouveau_gpuobj_new(struct drm_device *dev, struct nouveau_channel *chan, | |||
| 129 | if (ramin == NULL) { | 129 | if (ramin == NULL) { |
| 130 | spin_unlock(&dev_priv->ramin_lock); | 130 | spin_unlock(&dev_priv->ramin_lock); |
| 131 | nouveau_gpuobj_ref(NULL, &gpuobj); | 131 | nouveau_gpuobj_ref(NULL, &gpuobj); |
| 132 | return ret; | 132 | return -ENOMEM; |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | ramin = drm_mm_get_block_atomic(ramin, size, align); | 135 | ramin = drm_mm_get_block_atomic(ramin, size, align); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 1c99c55d6d4..9f7b158f582 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c | |||
| @@ -284,6 +284,7 @@ nouveau_sysfs_fini(struct drm_device *dev) | |||
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | #ifdef CONFIG_HWMON | ||
| 287 | static ssize_t | 288 | static ssize_t |
| 288 | nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) | 289 | nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) |
| 289 | { | 290 | { |
| @@ -395,10 +396,12 @@ static struct attribute *hwmon_attributes[] = { | |||
| 395 | static const struct attribute_group hwmon_attrgroup = { | 396 | static const struct attribute_group hwmon_attrgroup = { |
| 396 | .attrs = hwmon_attributes, | 397 | .attrs = hwmon_attributes, |
| 397 | }; | 398 | }; |
| 399 | #endif | ||
| 398 | 400 | ||
| 399 | static int | 401 | static int |
| 400 | nouveau_hwmon_init(struct drm_device *dev) | 402 | nouveau_hwmon_init(struct drm_device *dev) |
| 401 | { | 403 | { |
| 404 | #ifdef CONFIG_HWMON | ||
| 402 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 405 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 403 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 406 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
| 404 | struct device *hwmon_dev; | 407 | struct device *hwmon_dev; |
| @@ -425,13 +428,14 @@ nouveau_hwmon_init(struct drm_device *dev) | |||
| 425 | } | 428 | } |
| 426 | 429 | ||
| 427 | pm->hwmon = hwmon_dev; | 430 | pm->hwmon = hwmon_dev; |
| 428 | 431 | #endif | |
| 429 | return 0; | 432 | return 0; |
| 430 | } | 433 | } |
| 431 | 434 | ||
| 432 | static void | 435 | static void |
| 433 | nouveau_hwmon_fini(struct drm_device *dev) | 436 | nouveau_hwmon_fini(struct drm_device *dev) |
| 434 | { | 437 | { |
| 438 | #ifdef CONFIG_HWMON | ||
| 435 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 439 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 436 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 440 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
| 437 | 441 | ||
| @@ -439,6 +443,7 @@ nouveau_hwmon_fini(struct drm_device *dev) | |||
| 439 | sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup); | 443 | sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup); |
| 440 | hwmon_device_unregister(pm->hwmon); | 444 | hwmon_device_unregister(pm->hwmon); |
| 441 | } | 445 | } |
| 446 | #endif | ||
| 442 | } | 447 | } |
| 443 | 448 | ||
| 444 | int | 449 | int |
diff --git a/drivers/gpu/drm/nouveau/nouveau_ramht.c b/drivers/gpu/drm/nouveau/nouveau_ramht.c index 7f16697cc96..2d8580927ca 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ramht.c +++ b/drivers/gpu/drm/nouveau/nouveau_ramht.c | |||
| @@ -153,26 +153,42 @@ nouveau_ramht_insert(struct nouveau_channel *chan, u32 handle, | |||
| 153 | return -ENOMEM; | 153 | return -ENOMEM; |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | static struct nouveau_ramht_entry * | ||
| 157 | nouveau_ramht_remove_entry(struct nouveau_channel *chan, u32 handle) | ||
| 158 | { | ||
| 159 | struct nouveau_ramht *ramht = chan ? chan->ramht : NULL; | ||
| 160 | struct nouveau_ramht_entry *entry; | ||
| 161 | unsigned long flags; | ||
| 162 | |||
| 163 | if (!ramht) | ||
| 164 | return NULL; | ||
| 165 | |||
| 166 | spin_lock_irqsave(&ramht->lock, flags); | ||
| 167 | list_for_each_entry(entry, &ramht->entries, head) { | ||
| 168 | if (entry->channel == chan && | ||
| 169 | (!handle || entry->handle == handle)) { | ||
| 170 | list_del(&entry->head); | ||
| 171 | spin_unlock_irqrestore(&ramht->lock, flags); | ||
| 172 | |||
| 173 | return entry; | ||
| 174 | } | ||
| 175 | } | ||
| 176 | spin_unlock_irqrestore(&ramht->lock, flags); | ||
| 177 | |||
| 178 | return NULL; | ||
| 179 | } | ||
| 180 | |||
| 156 | static void | 181 | static void |
| 157 | nouveau_ramht_remove_locked(struct nouveau_channel *chan, u32 handle) | 182 | nouveau_ramht_remove_hash(struct nouveau_channel *chan, u32 handle) |
| 158 | { | 183 | { |
| 159 | struct drm_device *dev = chan->dev; | 184 | struct drm_device *dev = chan->dev; |
| 160 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 185 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 161 | struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; | 186 | struct nouveau_instmem_engine *instmem = &dev_priv->engine.instmem; |
| 162 | struct nouveau_gpuobj *ramht = chan->ramht->gpuobj; | 187 | struct nouveau_gpuobj *ramht = chan->ramht->gpuobj; |
| 163 | struct nouveau_ramht_entry *entry, *tmp; | 188 | unsigned long flags; |
| 164 | u32 co, ho; | 189 | u32 co, ho; |
| 165 | 190 | ||
| 166 | list_for_each_entry_safe(entry, tmp, &chan->ramht->entries, head) { | 191 | spin_lock_irqsave(&chan->ramht->lock, flags); |
| 167 | if (entry->channel != chan || entry->handle != handle) | ||
| 168 | continue; | ||
| 169 | |||
| 170 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); | ||
| 171 | list_del(&entry->head); | ||
| 172 | kfree(entry); | ||
| 173 | break; | ||
| 174 | } | ||
| 175 | |||
| 176 | co = ho = nouveau_ramht_hash_handle(chan, handle); | 192 | co = ho = nouveau_ramht_hash_handle(chan, handle); |
| 177 | do { | 193 | do { |
| 178 | if (nouveau_ramht_entry_valid(dev, ramht, co) && | 194 | if (nouveau_ramht_entry_valid(dev, ramht, co) && |
| @@ -184,7 +200,7 @@ nouveau_ramht_remove_locked(struct nouveau_channel *chan, u32 handle) | |||
| 184 | nv_wo32(ramht, co + 0, 0x00000000); | 200 | nv_wo32(ramht, co + 0, 0x00000000); |
| 185 | nv_wo32(ramht, co + 4, 0x00000000); | 201 | nv_wo32(ramht, co + 4, 0x00000000); |
| 186 | instmem->flush(dev); | 202 | instmem->flush(dev); |
| 187 | return; | 203 | goto out; |
| 188 | } | 204 | } |
| 189 | 205 | ||
| 190 | co += 8; | 206 | co += 8; |
| @@ -194,17 +210,22 @@ nouveau_ramht_remove_locked(struct nouveau_channel *chan, u32 handle) | |||
| 194 | 210 | ||
| 195 | NV_ERROR(dev, "RAMHT entry not found. ch=%d, handle=0x%08x\n", | 211 | NV_ERROR(dev, "RAMHT entry not found. ch=%d, handle=0x%08x\n", |
| 196 | chan->id, handle); | 212 | chan->id, handle); |
| 213 | out: | ||
| 214 | spin_unlock_irqrestore(&chan->ramht->lock, flags); | ||
| 197 | } | 215 | } |
| 198 | 216 | ||
| 199 | void | 217 | void |
| 200 | nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) | 218 | nouveau_ramht_remove(struct nouveau_channel *chan, u32 handle) |
| 201 | { | 219 | { |
| 202 | struct nouveau_ramht *ramht = chan->ramht; | 220 | struct nouveau_ramht_entry *entry; |
| 203 | unsigned long flags; | ||
| 204 | 221 | ||
| 205 | spin_lock_irqsave(&ramht->lock, flags); | 222 | entry = nouveau_ramht_remove_entry(chan, handle); |
| 206 | nouveau_ramht_remove_locked(chan, handle); | 223 | if (!entry) |
| 207 | spin_unlock_irqrestore(&ramht->lock, flags); | 224 | return; |
| 225 | |||
| 226 | nouveau_ramht_remove_hash(chan, entry->handle); | ||
| 227 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); | ||
| 228 | kfree(entry); | ||
| 208 | } | 229 | } |
| 209 | 230 | ||
| 210 | struct nouveau_gpuobj * | 231 | struct nouveau_gpuobj * |
| @@ -265,23 +286,19 @@ void | |||
| 265 | nouveau_ramht_ref(struct nouveau_ramht *ref, struct nouveau_ramht **ptr, | 286 | nouveau_ramht_ref(struct nouveau_ramht *ref, struct nouveau_ramht **ptr, |
| 266 | struct nouveau_channel *chan) | 287 | struct nouveau_channel *chan) |
| 267 | { | 288 | { |
| 268 | struct nouveau_ramht_entry *entry, *tmp; | 289 | struct nouveau_ramht_entry *entry; |
| 269 | struct nouveau_ramht *ramht; | 290 | struct nouveau_ramht *ramht; |
| 270 | unsigned long flags; | ||
| 271 | 291 | ||
| 272 | if (ref) | 292 | if (ref) |
| 273 | kref_get(&ref->refcount); | 293 | kref_get(&ref->refcount); |
| 274 | 294 | ||
| 275 | ramht = *ptr; | 295 | ramht = *ptr; |
| 276 | if (ramht) { | 296 | if (ramht) { |
| 277 | spin_lock_irqsave(&ramht->lock, flags); | 297 | while ((entry = nouveau_ramht_remove_entry(chan, 0))) { |
| 278 | list_for_each_entry_safe(entry, tmp, &ramht->entries, head) { | 298 | nouveau_ramht_remove_hash(chan, entry->handle); |
| 279 | if (entry->channel != chan) | 299 | nouveau_gpuobj_ref(NULL, &entry->gpuobj); |
| 280 | continue; | 300 | kfree(entry); |
| 281 | |||
| 282 | nouveau_ramht_remove_locked(chan, entry->handle); | ||
| 283 | } | 301 | } |
| 284 | spin_unlock_irqrestore(&ramht->lock, flags); | ||
| 285 | 302 | ||
| 286 | kref_put(&ramht->refcount, nouveau_ramht_del); | 303 | kref_put(&ramht->refcount, nouveau_ramht_del); |
| 287 | } | 304 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index 288bacac7e5..d4ac9700703 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c | |||
| @@ -120,8 +120,8 @@ nouveau_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem) | |||
| 120 | dev_priv->engine.instmem.flush(nvbe->dev); | 120 | dev_priv->engine.instmem.flush(nvbe->dev); |
| 121 | 121 | ||
| 122 | if (dev_priv->card_type == NV_50) { | 122 | if (dev_priv->card_type == NV_50) { |
| 123 | nv50_vm_flush(dev, 5); /* PGRAPH */ | 123 | dev_priv->engine.fifo.tlb_flush(dev); |
| 124 | nv50_vm_flush(dev, 0); /* PFIFO */ | 124 | dev_priv->engine.graph.tlb_flush(dev); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | nvbe->bound = true; | 127 | nvbe->bound = true; |
| @@ -162,8 +162,8 @@ nouveau_sgdma_unbind(struct ttm_backend *be) | |||
| 162 | dev_priv->engine.instmem.flush(nvbe->dev); | 162 | dev_priv->engine.instmem.flush(nvbe->dev); |
| 163 | 163 | ||
| 164 | if (dev_priv->card_type == NV_50) { | 164 | if (dev_priv->card_type == NV_50) { |
| 165 | nv50_vm_flush(dev, 5); | 165 | dev_priv->engine.fifo.tlb_flush(dev); |
| 166 | nv50_vm_flush(dev, 0); | 166 | dev_priv->engine.graph.tlb_flush(dev); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | nvbe->bound = false; | 169 | nvbe->bound = false; |
| @@ -224,7 +224,11 @@ nouveau_sgdma_init(struct drm_device *dev) | |||
| 224 | int i, ret; | 224 | int i, ret; |
| 225 | 225 | ||
| 226 | if (dev_priv->card_type < NV_50) { | 226 | if (dev_priv->card_type < NV_50) { |
| 227 | aper_size = (64 * 1024 * 1024); | 227 | if(dev_priv->ramin_rsvd_vram < 2 * 1024 * 1024) |
| 228 | aper_size = 64 * 1024 * 1024; | ||
| 229 | else | ||
| 230 | aper_size = 512 * 1024 * 1024; | ||
| 231 | |||
| 228 | obj_size = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 4; | 232 | obj_size = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 4; |
| 229 | obj_size += 8; /* ctxdma header */ | 233 | obj_size += 8; /* ctxdma header */ |
| 230 | } else { | 234 | } else { |
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index ed7757f1408..049f755567e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
| @@ -354,6 +354,15 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) | |||
| 354 | engine->graph.destroy_context = nv50_graph_destroy_context; | 354 | engine->graph.destroy_context = nv50_graph_destroy_context; |
| 355 | engine->graph.load_context = nv50_graph_load_context; | 355 | engine->graph.load_context = nv50_graph_load_context; |
| 356 | engine->graph.unload_context = nv50_graph_unload_context; | 356 | engine->graph.unload_context = nv50_graph_unload_context; |
| 357 | if (dev_priv->chipset != 0x86) | ||
| 358 | engine->graph.tlb_flush = nv50_graph_tlb_flush; | ||
| 359 | else { | ||
| 360 | /* from what i can see nvidia do this on every | ||
| 361 | * pre-NVA3 board except NVAC, but, we've only | ||
| 362 | * ever seen problems on NV86 | ||
| 363 | */ | ||
| 364 | engine->graph.tlb_flush = nv86_graph_tlb_flush; | ||
| 365 | } | ||
| 357 | engine->fifo.channels = 128; | 366 | engine->fifo.channels = 128; |
| 358 | engine->fifo.init = nv50_fifo_init; | 367 | engine->fifo.init = nv50_fifo_init; |
| 359 | engine->fifo.takedown = nv50_fifo_takedown; | 368 | engine->fifo.takedown = nv50_fifo_takedown; |
| @@ -365,6 +374,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) | |||
| 365 | engine->fifo.destroy_context = nv50_fifo_destroy_context; | 374 | engine->fifo.destroy_context = nv50_fifo_destroy_context; |
| 366 | engine->fifo.load_context = nv50_fifo_load_context; | 375 | engine->fifo.load_context = nv50_fifo_load_context; |
| 367 | engine->fifo.unload_context = nv50_fifo_unload_context; | 376 | engine->fifo.unload_context = nv50_fifo_unload_context; |
| 377 | engine->fifo.tlb_flush = nv50_fifo_tlb_flush; | ||
| 368 | engine->display.early_init = nv50_display_early_init; | 378 | engine->display.early_init = nv50_display_early_init; |
| 369 | engine->display.late_takedown = nv50_display_late_takedown; | 379 | engine->display.late_takedown = nv50_display_late_takedown; |
| 370 | engine->display.create = nv50_display_create; | 380 | engine->display.create = nv50_display_create; |
| @@ -1041,6 +1051,9 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data, | |||
| 1041 | case NOUVEAU_GETPARAM_PTIMER_TIME: | 1051 | case NOUVEAU_GETPARAM_PTIMER_TIME: |
| 1042 | getparam->value = dev_priv->engine.timer.read(dev); | 1052 | getparam->value = dev_priv->engine.timer.read(dev); |
| 1043 | break; | 1053 | break; |
| 1054 | case NOUVEAU_GETPARAM_HAS_BO_USAGE: | ||
| 1055 | getparam->value = 1; | ||
| 1056 | break; | ||
| 1044 | case NOUVEAU_GETPARAM_GRAPH_UNITS: | 1057 | case NOUVEAU_GETPARAM_GRAPH_UNITS: |
| 1045 | /* NV40 and NV50 versions are quite different, but register | 1058 | /* NV40 and NV50 versions are quite different, but register |
| 1046 | * address is the same. User is supposed to know the card | 1059 | * address is the same. User is supposed to know the card |
| @@ -1051,7 +1064,7 @@ int nouveau_ioctl_getparam(struct drm_device *dev, void *data, | |||
| 1051 | } | 1064 | } |
| 1052 | /* FALLTHRU */ | 1065 | /* FALLTHRU */ |
| 1053 | default: | 1066 | default: |
| 1054 | NV_ERROR(dev, "unknown parameter %lld\n", getparam->param); | 1067 | NV_DEBUG(dev, "unknown parameter %lld\n", getparam->param); |
| 1055 | return -EINVAL; | 1068 | return -EINVAL; |
| 1056 | } | 1069 | } |
| 1057 | 1070 | ||
| @@ -1066,7 +1079,7 @@ nouveau_ioctl_setparam(struct drm_device *dev, void *data, | |||
| 1066 | 1079 | ||
| 1067 | switch (setparam->param) { | 1080 | switch (setparam->param) { |
| 1068 | default: | 1081 | default: |
| 1069 | NV_ERROR(dev, "unknown parameter %lld\n", setparam->param); | 1082 | NV_DEBUG(dev, "unknown parameter %lld\n", setparam->param); |
| 1070 | return -EINVAL; | 1083 | return -EINVAL; |
| 1071 | } | 1084 | } |
| 1072 | 1085 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_temp.c b/drivers/gpu/drm/nouveau/nouveau_temp.c index 16bbbf1eff6..7ecc4adc1e4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_temp.c +++ b/drivers/gpu/drm/nouveau/nouveau_temp.c | |||
| @@ -191,7 +191,7 @@ nv40_temp_get(struct drm_device *dev) | |||
| 191 | int offset = sensor->offset_mult / sensor->offset_div; | 191 | int offset = sensor->offset_mult / sensor->offset_div; |
| 192 | int core_temp; | 192 | int core_temp; |
| 193 | 193 | ||
| 194 | if (dev_priv->chipset >= 0x50) { | 194 | if (dev_priv->card_type >= NV_50) { |
| 195 | core_temp = nv_rd32(dev, 0x20008); | 195 | core_temp = nv_rd32(dev, 0x20008); |
| 196 | } else { | 196 | } else { |
| 197 | core_temp = nv_rd32(dev, 0x0015b4) & 0x1fff; | 197 | core_temp = nv_rd32(dev, 0x0015b4) & 0x1fff; |
diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/nv04_crtc.c index c71abc2a34d..40e18074162 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/nv04_crtc.c | |||
| @@ -158,7 +158,6 @@ nv_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 158 | { | 158 | { |
| 159 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 159 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
| 160 | struct drm_device *dev = crtc->dev; | 160 | struct drm_device *dev = crtc->dev; |
| 161 | struct drm_connector *connector; | ||
| 162 | unsigned char seq1 = 0, crtc17 = 0; | 161 | unsigned char seq1 = 0, crtc17 = 0; |
| 163 | unsigned char crtc1A; | 162 | unsigned char crtc1A; |
| 164 | 163 | ||
| @@ -213,10 +212,6 @@ nv_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 213 | NVVgaSeqReset(dev, nv_crtc->index, false); | 212 | NVVgaSeqReset(dev, nv_crtc->index, false); |
| 214 | 213 | ||
| 215 | NVWriteVgaCrtc(dev, nv_crtc->index, NV_CIO_CRE_RPC1_INDEX, crtc1A); | 214 | NVWriteVgaCrtc(dev, nv_crtc->index, NV_CIO_CRE_RPC1_INDEX, crtc1A); |
| 216 | |||
| 217 | /* Update connector polling modes */ | ||
| 218 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) | ||
| 219 | nouveau_connector_set_polling(connector); | ||
| 220 | } | 215 | } |
| 221 | 216 | ||
| 222 | static bool | 217 | static bool |
| @@ -831,7 +826,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, | |||
| 831 | /* Update the framebuffer location. */ | 826 | /* Update the framebuffer location. */ |
| 832 | regp->fb_start = nv_crtc->fb.offset & ~3; | 827 | regp->fb_start = nv_crtc->fb.offset & ~3; |
| 833 | regp->fb_start += (y * drm_fb->pitch) + (x * drm_fb->bits_per_pixel / 8); | 828 | regp->fb_start += (y * drm_fb->pitch) + (x * drm_fb->bits_per_pixel / 8); |
| 834 | NVWriteCRTC(dev, nv_crtc->index, NV_PCRTC_START, regp->fb_start); | 829 | nv_set_crtc_base(dev, nv_crtc->index, regp->fb_start); |
| 835 | 830 | ||
| 836 | /* Update the arbitration parameters. */ | 831 | /* Update the arbitration parameters. */ |
| 837 | nouveau_calc_arb(dev, crtc->mode.clock, drm_fb->bits_per_pixel, | 832 | nouveau_calc_arb(dev, crtc->mode.clock, drm_fb->bits_per_pixel, |
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c index c936403b26e..ef23550407b 100644 --- a/drivers/gpu/drm/nouveau/nv04_dfp.c +++ b/drivers/gpu/drm/nouveau/nv04_dfp.c | |||
| @@ -185,14 +185,15 @@ static bool nv04_dfp_mode_fixup(struct drm_encoder *encoder, | |||
| 185 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | 185 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); |
| 186 | struct nouveau_connector *nv_connector = nouveau_encoder_connector_get(nv_encoder); | 186 | struct nouveau_connector *nv_connector = nouveau_encoder_connector_get(nv_encoder); |
| 187 | 187 | ||
| 188 | /* For internal panels and gpu scaling on DVI we need the native mode */ | 188 | if (!nv_connector->native_mode || |
| 189 | if (nv_connector->scaling_mode != DRM_MODE_SCALE_NONE) { | 189 | nv_connector->scaling_mode == DRM_MODE_SCALE_NONE || |
| 190 | if (!nv_connector->native_mode) | 190 | mode->hdisplay > nv_connector->native_mode->hdisplay || |
| 191 | return false; | 191 | mode->vdisplay > nv_connector->native_mode->vdisplay) { |
| 192 | nv_encoder->mode = *adjusted_mode; | ||
| 193 | |||
| 194 | } else { | ||
| 192 | nv_encoder->mode = *nv_connector->native_mode; | 195 | nv_encoder->mode = *nv_connector->native_mode; |
| 193 | adjusted_mode->clock = nv_connector->native_mode->clock; | 196 | adjusted_mode->clock = nv_connector->native_mode->clock; |
| 194 | } else { | ||
| 195 | nv_encoder->mode = *adjusted_mode; | ||
| 196 | } | 197 | } |
| 197 | 198 | ||
| 198 | return true; | 199 | return true; |
diff --git a/drivers/gpu/drm/nouveau/nv04_pm.c b/drivers/gpu/drm/nouveau/nv04_pm.c index 6a6eb697d38..eb1c70dd82e 100644 --- a/drivers/gpu/drm/nouveau/nv04_pm.c +++ b/drivers/gpu/drm/nouveau/nv04_pm.c | |||
| @@ -76,6 +76,15 @@ nv04_pm_clock_set(struct drm_device *dev, void *pre_state) | |||
| 76 | reg += 4; | 76 | reg += 4; |
| 77 | 77 | ||
| 78 | nouveau_hw_setpll(dev, reg, &state->calc); | 78 | nouveau_hw_setpll(dev, reg, &state->calc); |
| 79 | |||
| 80 | if (dev_priv->card_type < NV_30 && reg == NV_PRAMDAC_MPLL_COEFF) { | ||
| 81 | if (dev_priv->card_type == NV_20) | ||
| 82 | nv_mask(dev, 0x1002c4, 0, 1 << 20); | ||
| 83 | |||
| 84 | /* Reset the DLLs */ | ||
| 85 | nv_mask(dev, 0x1002c0, 0, 1 << 8); | ||
| 86 | } | ||
| 87 | |||
| 79 | kfree(state); | 88 | kfree(state); |
| 80 | } | 89 | } |
| 81 | 90 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_calc.c b/drivers/gpu/drm/nouveau/nv50_calc.c index 2cdc2bfe717..de81151648f 100644 --- a/drivers/gpu/drm/nouveau/nv50_calc.c +++ b/drivers/gpu/drm/nouveau/nv50_calc.c | |||
| @@ -51,24 +51,28 @@ nv50_calc_pll2(struct drm_device *dev, struct pll_lims *pll, int clk, | |||
| 51 | int *N, int *fN, int *M, int *P) | 51 | int *N, int *fN, int *M, int *P) |
| 52 | { | 52 | { |
| 53 | fixed20_12 fb_div, a, b; | 53 | fixed20_12 fb_div, a, b; |
| 54 | u32 refclk = pll->refclk / 10; | ||
| 55 | u32 max_vco_freq = pll->vco1.maxfreq / 10; | ||
| 56 | u32 max_vco_inputfreq = pll->vco1.max_inputfreq / 10; | ||
| 57 | clk /= 10; | ||
| 54 | 58 | ||
| 55 | *P = pll->vco1.maxfreq / clk; | 59 | *P = max_vco_freq / clk; |
| 56 | if (*P > pll->max_p) | 60 | if (*P > pll->max_p) |
| 57 | *P = pll->max_p; | 61 | *P = pll->max_p; |
| 58 | if (*P < pll->min_p) | 62 | if (*P < pll->min_p) |
| 59 | *P = pll->min_p; | 63 | *P = pll->min_p; |
| 60 | 64 | ||
| 61 | /* *M = ceil(refclk / pll->vco.max_inputfreq); */ | 65 | /* *M = floor((refclk + max_vco_inputfreq) / max_vco_inputfreq); */ |
| 62 | a.full = dfixed_const(pll->refclk); | 66 | a.full = dfixed_const(refclk + max_vco_inputfreq); |
| 63 | b.full = dfixed_const(pll->vco1.max_inputfreq); | 67 | b.full = dfixed_const(max_vco_inputfreq); |
| 64 | a.full = dfixed_div(a, b); | 68 | a.full = dfixed_div(a, b); |
| 65 | a.full = dfixed_ceil(a); | 69 | a.full = dfixed_floor(a); |
| 66 | *M = dfixed_trunc(a); | 70 | *M = dfixed_trunc(a); |
| 67 | 71 | ||
| 68 | /* fb_div = (vco * *M) / refclk; */ | 72 | /* fb_div = (vco * *M) / refclk; */ |
| 69 | fb_div.full = dfixed_const(clk * *P); | 73 | fb_div.full = dfixed_const(clk * *P); |
| 70 | fb_div.full = dfixed_mul(fb_div, a); | 74 | fb_div.full = dfixed_mul(fb_div, a); |
| 71 | a.full = dfixed_const(pll->refclk); | 75 | a.full = dfixed_const(refclk); |
| 72 | fb_div.full = dfixed_div(fb_div, a); | 76 | fb_div.full = dfixed_div(fb_div, a); |
| 73 | 77 | ||
| 74 | /* *N = floor(fb_div); */ | 78 | /* *N = floor(fb_div); */ |
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index 16380d52cd8..56476d0c6de 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c | |||
| @@ -546,7 +546,7 @@ nv50_crtc_do_mode_set_base(struct drm_crtc *crtc, | |||
| 546 | } | 546 | } |
| 547 | 547 | ||
| 548 | nv_crtc->fb.offset = fb->nvbo->bo.offset - dev_priv->vm_vram_base; | 548 | nv_crtc->fb.offset = fb->nvbo->bo.offset - dev_priv->vm_vram_base; |
| 549 | nv_crtc->fb.tile_flags = fb->nvbo->tile_flags; | 549 | nv_crtc->fb.tile_flags = nouveau_bo_tile_layout(fb->nvbo); |
| 550 | nv_crtc->fb.cpp = drm_fb->bits_per_pixel / 8; | 550 | nv_crtc->fb.cpp = drm_fb->bits_per_pixel / 8; |
| 551 | if (!nv_crtc->fb.blanked && dev_priv->chipset != 0x50) { | 551 | if (!nv_crtc->fb.blanked && dev_priv->chipset != 0x50) { |
| 552 | ret = RING_SPACE(evo, 2); | 552 | ret = RING_SPACE(evo, 2); |
| @@ -578,7 +578,7 @@ nv50_crtc_do_mode_set_base(struct drm_crtc *crtc, | |||
| 578 | fb->nvbo->tile_mode); | 578 | fb->nvbo->tile_mode); |
| 579 | } | 579 | } |
| 580 | if (dev_priv->chipset == 0x50) | 580 | if (dev_priv->chipset == 0x50) |
| 581 | OUT_RING(evo, (fb->nvbo->tile_flags << 8) | format); | 581 | OUT_RING(evo, (nv_crtc->fb.tile_flags << 8) | format); |
| 582 | else | 582 | else |
| 583 | OUT_RING(evo, format); | 583 | OUT_RING(evo, format); |
| 584 | 584 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 55c9663ef2b..f624c611dde 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
| @@ -1032,11 +1032,18 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) | |||
| 1032 | struct drm_connector *connector; | 1032 | struct drm_connector *connector; |
| 1033 | const uint32_t gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 }; | 1033 | const uint32_t gpio_reg[4] = { 0xe104, 0xe108, 0xe280, 0xe284 }; |
| 1034 | uint32_t unplug_mask, plug_mask, change_mask; | 1034 | uint32_t unplug_mask, plug_mask, change_mask; |
| 1035 | uint32_t hpd0, hpd1 = 0; | 1035 | uint32_t hpd0, hpd1; |
| 1036 | 1036 | ||
| 1037 | hpd0 = nv_rd32(dev, 0xe054) & nv_rd32(dev, 0xe050); | 1037 | spin_lock_irq(&dev_priv->hpd_state.lock); |
| 1038 | hpd0 = dev_priv->hpd_state.hpd0_bits; | ||
| 1039 | dev_priv->hpd_state.hpd0_bits = 0; | ||
| 1040 | hpd1 = dev_priv->hpd_state.hpd1_bits; | ||
| 1041 | dev_priv->hpd_state.hpd1_bits = 0; | ||
| 1042 | spin_unlock_irq(&dev_priv->hpd_state.lock); | ||
| 1043 | |||
| 1044 | hpd0 &= nv_rd32(dev, 0xe050); | ||
| 1038 | if (dev_priv->chipset >= 0x90) | 1045 | if (dev_priv->chipset >= 0x90) |
| 1039 | hpd1 = nv_rd32(dev, 0xe074) & nv_rd32(dev, 0xe070); | 1046 | hpd1 &= nv_rd32(dev, 0xe070); |
| 1040 | 1047 | ||
| 1041 | plug_mask = (hpd0 & 0x0000ffff) | (hpd1 << 16); | 1048 | plug_mask = (hpd0 & 0x0000ffff) | (hpd1 << 16); |
| 1042 | unplug_mask = (hpd0 >> 16) | (hpd1 & 0xffff0000); | 1049 | unplug_mask = (hpd0 >> 16) | (hpd1 & 0xffff0000); |
| @@ -1078,10 +1085,6 @@ nv50_display_irq_hotplug_bh(struct work_struct *work) | |||
| 1078 | helper->dpms(connector->encoder, DRM_MODE_DPMS_OFF); | 1085 | helper->dpms(connector->encoder, DRM_MODE_DPMS_OFF); |
| 1079 | } | 1086 | } |
| 1080 | 1087 | ||
| 1081 | nv_wr32(dev, 0xe054, nv_rd32(dev, 0xe054)); | ||
| 1082 | if (dev_priv->chipset >= 0x90) | ||
| 1083 | nv_wr32(dev, 0xe074, nv_rd32(dev, 0xe074)); | ||
| 1084 | |||
| 1085 | drm_helper_hpd_irq_event(dev); | 1088 | drm_helper_hpd_irq_event(dev); |
| 1086 | } | 1089 | } |
| 1087 | 1090 | ||
| @@ -1092,8 +1095,22 @@ nv50_display_irq_handler(struct drm_device *dev) | |||
| 1092 | uint32_t delayed = 0; | 1095 | uint32_t delayed = 0; |
| 1093 | 1096 | ||
| 1094 | if (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_HOTPLUG) { | 1097 | if (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_HOTPLUG) { |
| 1095 | if (!work_pending(&dev_priv->hpd_work)) | 1098 | uint32_t hpd0_bits, hpd1_bits = 0; |
| 1096 | queue_work(dev_priv->wq, &dev_priv->hpd_work); | 1099 | |
| 1100 | hpd0_bits = nv_rd32(dev, 0xe054); | ||
| 1101 | nv_wr32(dev, 0xe054, hpd0_bits); | ||
| 1102 | |||
| 1103 | if (dev_priv->chipset >= 0x90) { | ||
| 1104 | hpd1_bits = nv_rd32(dev, 0xe074); | ||
| 1105 | nv_wr32(dev, 0xe074, hpd1_bits); | ||
| 1106 | } | ||
| 1107 | |||
| 1108 | spin_lock(&dev_priv->hpd_state.lock); | ||
| 1109 | dev_priv->hpd_state.hpd0_bits |= hpd0_bits; | ||
| 1110 | dev_priv->hpd_state.hpd1_bits |= hpd1_bits; | ||
| 1111 | spin_unlock(&dev_priv->hpd_state.lock); | ||
| 1112 | |||
| 1113 | queue_work(dev_priv->wq, &dev_priv->hpd_work); | ||
| 1097 | } | 1114 | } |
| 1098 | 1115 | ||
| 1099 | while (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_DISPLAY) { | 1116 | while (nv_rd32(dev, NV50_PMC_INTR_0) & NV50_PMC_INTR_0_DISPLAY) { |
diff --git a/drivers/gpu/drm/nouveau/nv50_fifo.c b/drivers/gpu/drm/nouveau/nv50_fifo.c index a46a961102f..1da65bd60c1 100644 --- a/drivers/gpu/drm/nouveau/nv50_fifo.c +++ b/drivers/gpu/drm/nouveau/nv50_fifo.c | |||
| @@ -464,3 +464,8 @@ nv50_fifo_unload_context(struct drm_device *dev) | |||
| 464 | return 0; | 464 | return 0; |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | void | ||
| 468 | nv50_fifo_tlb_flush(struct drm_device *dev) | ||
| 469 | { | ||
| 470 | nv50_vm_flush(dev, 5); | ||
| 471 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c index cbf5ae2f67d..8b669d0af61 100644 --- a/drivers/gpu/drm/nouveau/nv50_graph.c +++ b/drivers/gpu/drm/nouveau/nv50_graph.c | |||
| @@ -402,3 +402,55 @@ struct nouveau_pgraph_object_class nv50_graph_grclass[] = { | |||
| 402 | { 0x8597, false, NULL }, /* tesla (nva3, nva5, nva8) */ | 402 | { 0x8597, false, NULL }, /* tesla (nva3, nva5, nva8) */ |
| 403 | {} | 403 | {} |
| 404 | }; | 404 | }; |
| 405 | |||
| 406 | void | ||
| 407 | nv50_graph_tlb_flush(struct drm_device *dev) | ||
| 408 | { | ||
| 409 | nv50_vm_flush(dev, 0); | ||
| 410 | } | ||
| 411 | |||
| 412 | void | ||
| 413 | nv86_graph_tlb_flush(struct drm_device *dev) | ||
| 414 | { | ||
| 415 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
| 416 | struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer; | ||
| 417 | bool idle, timeout = false; | ||
| 418 | unsigned long flags; | ||
| 419 | u64 start; | ||
| 420 | u32 tmp; | ||
| 421 | |||
| 422 | spin_lock_irqsave(&dev_priv->context_switch_lock, flags); | ||
| 423 | nv_mask(dev, 0x400500, 0x00000001, 0x00000000); | ||
| 424 | |||
| 425 | start = ptimer->read(dev); | ||
| 426 | do { | ||
| 427 | idle = true; | ||
| 428 | |||
| 429 | for (tmp = nv_rd32(dev, 0x400380); tmp && idle; tmp >>= 3) { | ||
| 430 | if ((tmp & 7) == 1) | ||
| 431 | idle = false; | ||
| 432 | } | ||
| 433 | |||
| 434 | for (tmp = nv_rd32(dev, 0x400384); tmp && idle; tmp >>= 3) { | ||
| 435 | if ((tmp & 7) == 1) | ||
| 436 | idle = false; | ||
| 437 | } | ||
| 438 | |||
| 439 | for (tmp = nv_rd32(dev, 0x400388); tmp && idle; tmp >>= 3) { | ||
| 440 | if ((tmp & 7) == 1) | ||
| 441 | idle = false; | ||
| 442 | } | ||
| 443 | } while (!idle && !(timeout = ptimer->read(dev) - start > 2000000000)); | ||
| 444 | |||
| 445 | if (timeout) { | ||
| 446 | NV_ERROR(dev, "PGRAPH TLB flush idle timeout fail: " | ||
| 447 | "0x%08x 0x%08x 0x%08x 0x%08x\n", | ||
| 448 | nv_rd32(dev, 0x400700), nv_rd32(dev, 0x400380), | ||
| 449 | nv_rd32(dev, 0x400384), nv_rd32(dev, 0x400388)); | ||
| 450 | } | ||
| 451 | |||
| 452 | nv50_vm_flush(dev, 0); | ||
| 453 | |||
| 454 | nv_mask(dev, 0x400500, 0x00000001, 0x00000001); | ||
| 455 | spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); | ||
| 456 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index a53fc974332..b773229b764 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
| @@ -402,7 +402,6 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj) | |||
| 402 | } | 402 | } |
| 403 | dev_priv->engine.instmem.flush(dev); | 403 | dev_priv->engine.instmem.flush(dev); |
| 404 | 404 | ||
| 405 | nv50_vm_flush(dev, 4); | ||
| 406 | nv50_vm_flush(dev, 6); | 405 | nv50_vm_flush(dev, 6); |
| 407 | 406 | ||
| 408 | gpuobj->im_bound = 1; | 407 | gpuobj->im_bound = 1; |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 488c36c8f5e..4dc5b4714c5 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -1650,7 +1650,36 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
| 1650 | } | 1650 | } |
| 1651 | } | 1651 | } |
| 1652 | 1652 | ||
| 1653 | rdev->config.evergreen.tile_config = gb_addr_config; | 1653 | /* setup tiling info dword. gb_addr_config is not adequate since it does |
| 1654 | * not have bank info, so create a custom tiling dword. | ||
| 1655 | * bits 3:0 num_pipes | ||
| 1656 | * bits 7:4 num_banks | ||
| 1657 | * bits 11:8 group_size | ||
| 1658 | * bits 15:12 row_size | ||
| 1659 | */ | ||
| 1660 | rdev->config.evergreen.tile_config = 0; | ||
| 1661 | switch (rdev->config.evergreen.max_tile_pipes) { | ||
| 1662 | case 1: | ||
| 1663 | default: | ||
| 1664 | rdev->config.evergreen.tile_config |= (0 << 0); | ||
| 1665 | break; | ||
| 1666 | case 2: | ||
| 1667 | rdev->config.evergreen.tile_config |= (1 << 0); | ||
| 1668 | break; | ||
| 1669 | case 4: | ||
| 1670 | rdev->config.evergreen.tile_config |= (2 << 0); | ||
| 1671 | break; | ||
| 1672 | case 8: | ||
| 1673 | rdev->config.evergreen.tile_config |= (3 << 0); | ||
| 1674 | break; | ||
| 1675 | } | ||
| 1676 | rdev->config.evergreen.tile_config |= | ||
| 1677 | ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4; | ||
| 1678 | rdev->config.evergreen.tile_config |= | ||
| 1679 | ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT) << 8; | ||
| 1680 | rdev->config.evergreen.tile_config |= | ||
| 1681 | ((gb_addr_config & 0x30000000) >> 28) << 12; | ||
| 1682 | |||
| 1654 | WREG32(GB_BACKEND_MAP, gb_backend_map); | 1683 | WREG32(GB_BACKEND_MAP, gb_backend_map); |
| 1655 | WREG32(GB_ADDR_CONFIG, gb_addr_config); | 1684 | WREG32(GB_ADDR_CONFIG, gb_addr_config); |
| 1656 | WREG32(DMIF_ADDR_CONFIG, gb_addr_config); | 1685 | WREG32(DMIF_ADDR_CONFIG, gb_addr_config); |
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index ac3b6dde23d..e0e590110dd 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c | |||
| @@ -459,7 +459,7 @@ int evergreen_blit_init(struct radeon_device *rdev) | |||
| 459 | obj_size += evergreen_ps_size * 4; | 459 | obj_size += evergreen_ps_size * 4; |
| 460 | obj_size = ALIGN(obj_size, 256); | 460 | obj_size = ALIGN(obj_size, 256); |
| 461 | 461 | ||
| 462 | r = radeon_bo_create(rdev, NULL, obj_size, true, RADEON_GEM_DOMAIN_VRAM, | 462 | r = radeon_bo_create(rdev, NULL, obj_size, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, |
| 463 | &rdev->r600_blit.shader_obj); | 463 | &rdev->r600_blit.shader_obj); |
| 464 | if (r) { | 464 | if (r) { |
| 465 | DRM_ERROR("evergreen failed to allocate shader\n"); | 465 | DRM_ERROR("evergreen failed to allocate shader\n"); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 0f806cc7dc7..a3552594ccc 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -2718,7 +2718,7 @@ static int r600_ih_ring_alloc(struct radeon_device *rdev) | |||
| 2718 | /* Allocate ring buffer */ | 2718 | /* Allocate ring buffer */ |
| 2719 | if (rdev->ih.ring_obj == NULL) { | 2719 | if (rdev->ih.ring_obj == NULL) { |
| 2720 | r = radeon_bo_create(rdev, NULL, rdev->ih.ring_size, | 2720 | r = radeon_bo_create(rdev, NULL, rdev->ih.ring_size, |
| 2721 | true, | 2721 | PAGE_SIZE, true, |
| 2722 | RADEON_GEM_DOMAIN_GTT, | 2722 | RADEON_GEM_DOMAIN_GTT, |
| 2723 | &rdev->ih.ring_obj); | 2723 | &rdev->ih.ring_obj); |
| 2724 | if (r) { | 2724 | if (r) { |
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index 8362974ef41..86e5aa07f0d 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
| @@ -501,7 +501,7 @@ int r600_blit_init(struct radeon_device *rdev) | |||
| 501 | obj_size += r6xx_ps_size * 4; | 501 | obj_size += r6xx_ps_size * 4; |
| 502 | obj_size = ALIGN(obj_size, 256); | 502 | obj_size = ALIGN(obj_size, 256); |
| 503 | 503 | ||
| 504 | r = radeon_bo_create(rdev, NULL, obj_size, true, RADEON_GEM_DOMAIN_VRAM, | 504 | r = radeon_bo_create(rdev, NULL, obj_size, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, |
| 505 | &rdev->r600_blit.shader_obj); | 505 | &rdev->r600_blit.shader_obj); |
| 506 | if (r) { | 506 | if (r) { |
| 507 | DRM_ERROR("r600 failed to allocate shader\n"); | 507 | DRM_ERROR("r600 failed to allocate shader\n"); |
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 0f90fc3482c..9bebac1ec00 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
| @@ -315,7 +315,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) | |||
| 315 | if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { | 315 | if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { |
| 316 | /* the initial DDX does bad things with the CB size occasionally */ | 316 | /* the initial DDX does bad things with the CB size occasionally */ |
| 317 | /* it rounds up height too far for slice tile max but the BO is smaller */ | 317 | /* it rounds up height too far for slice tile max but the BO is smaller */ |
| 318 | tmp = (height - 7) * 8 * bpe; | 318 | tmp = (height - 7) * pitch * bpe; |
| 319 | if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { | 319 | if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { |
| 320 | dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); | 320 | dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); |
| 321 | return -EINVAL; | 321 | return -EINVAL; |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 73f600d39ad..3a7095743d4 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -1262,6 +1262,10 @@ void r100_pll_errata_after_index(struct radeon_device *rdev); | |||
| 1262 | (rdev->family == CHIP_RS400) || \ | 1262 | (rdev->family == CHIP_RS400) || \ |
| 1263 | (rdev->family == CHIP_RS480)) | 1263 | (rdev->family == CHIP_RS480)) |
| 1264 | #define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600)) | 1264 | #define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600)) |
| 1265 | #define ASIC_IS_DCE2(rdev) ((rdev->family == CHIP_RS600) || \ | ||
| 1266 | (rdev->family == CHIP_RS690) || \ | ||
| 1267 | (rdev->family == CHIP_RS740) || \ | ||
| 1268 | (rdev->family >= CHIP_R600)) | ||
| 1265 | #define ASIC_IS_DCE3(rdev) ((rdev->family >= CHIP_RV620)) | 1269 | #define ASIC_IS_DCE3(rdev) ((rdev->family >= CHIP_RV620)) |
| 1266 | #define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730)) | 1270 | #define ASIC_IS_DCE32(rdev) ((rdev->family >= CHIP_RV730)) |
| 1267 | #define ASIC_IS_DCE4(rdev) ((rdev->family >= CHIP_CEDAR)) | 1271 | #define ASIC_IS_DCE4(rdev) ((rdev->family >= CHIP_CEDAR)) |
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c index 7932dc4d6b9..c558685cc63 100644 --- a/drivers/gpu/drm/radeon/radeon_benchmark.c +++ b/drivers/gpu/drm/radeon/radeon_benchmark.c | |||
| @@ -41,7 +41,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize, | |||
| 41 | 41 | ||
| 42 | size = bsize; | 42 | size = bsize; |
| 43 | n = 1024; | 43 | n = 1024; |
| 44 | r = radeon_bo_create(rdev, NULL, size, true, sdomain, &sobj); | 44 | r = radeon_bo_create(rdev, NULL, size, PAGE_SIZE, true, sdomain, &sobj); |
| 45 | if (r) { | 45 | if (r) { |
| 46 | goto out_cleanup; | 46 | goto out_cleanup; |
| 47 | } | 47 | } |
| @@ -53,7 +53,7 @@ void radeon_benchmark_move(struct radeon_device *rdev, unsigned bsize, | |||
| 53 | if (r) { | 53 | if (r) { |
| 54 | goto out_cleanup; | 54 | goto out_cleanup; |
| 55 | } | 55 | } |
| 56 | r = radeon_bo_create(rdev, NULL, size, true, ddomain, &dobj); | 56 | r = radeon_bo_create(rdev, NULL, size, PAGE_SIZE, true, ddomain, &dobj); |
| 57 | if (r) { | 57 | if (r) { |
| 58 | goto out_cleanup; | 58 | goto out_cleanup; |
| 59 | } | 59 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 7b7ea269549..3bddea5b529 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
| @@ -571,6 +571,7 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde | |||
| 571 | } | 571 | } |
| 572 | 572 | ||
| 573 | if (clk_mask && data_mask) { | 573 | if (clk_mask && data_mask) { |
| 574 | /* system specific masks */ | ||
| 574 | i2c.mask_clk_mask = clk_mask; | 575 | i2c.mask_clk_mask = clk_mask; |
| 575 | i2c.mask_data_mask = data_mask; | 576 | i2c.mask_data_mask = data_mask; |
| 576 | i2c.a_clk_mask = clk_mask; | 577 | i2c.a_clk_mask = clk_mask; |
| @@ -579,7 +580,19 @@ static struct radeon_i2c_bus_rec combios_setup_i2c_bus(struct radeon_device *rde | |||
| 579 | i2c.en_data_mask = data_mask; | 580 | i2c.en_data_mask = data_mask; |
| 580 | i2c.y_clk_mask = clk_mask; | 581 | i2c.y_clk_mask = clk_mask; |
| 581 | i2c.y_data_mask = data_mask; | 582 | i2c.y_data_mask = data_mask; |
| 583 | } else if ((ddc_line == RADEON_GPIOPAD_MASK) || | ||
| 584 | (ddc_line == RADEON_MDGPIO_MASK)) { | ||
| 585 | /* default gpiopad masks */ | ||
| 586 | i2c.mask_clk_mask = (0x20 << 8); | ||
| 587 | i2c.mask_data_mask = 0x80; | ||
| 588 | i2c.a_clk_mask = (0x20 << 8); | ||
| 589 | i2c.a_data_mask = 0x80; | ||
| 590 | i2c.en_clk_mask = (0x20 << 8); | ||
| 591 | i2c.en_data_mask = 0x80; | ||
| 592 | i2c.y_clk_mask = (0x20 << 8); | ||
| 593 | i2c.y_data_mask = 0x80; | ||
| 582 | } else { | 594 | } else { |
| 595 | /* default masks for ddc pads */ | ||
| 583 | i2c.mask_clk_mask = RADEON_GPIO_EN_1; | 596 | i2c.mask_clk_mask = RADEON_GPIO_EN_1; |
| 584 | i2c.mask_data_mask = RADEON_GPIO_EN_0; | 597 | i2c.mask_data_mask = RADEON_GPIO_EN_0; |
| 585 | i2c.a_clk_mask = RADEON_GPIO_A_1; | 598 | i2c.a_clk_mask = RADEON_GPIO_A_1; |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe6c74780f1..3bef9f6d66f 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -1008,9 +1008,21 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector) | |||
| 1008 | static int radeon_dp_get_modes(struct drm_connector *connector) | 1008 | static int radeon_dp_get_modes(struct drm_connector *connector) |
| 1009 | { | 1009 | { |
| 1010 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 1010 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
| 1011 | struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; | ||
| 1011 | int ret; | 1012 | int ret; |
| 1012 | 1013 | ||
| 1014 | if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { | ||
| 1015 | if (!radeon_dig_connector->edp_on) | ||
| 1016 | atombios_set_edp_panel_power(connector, | ||
| 1017 | ATOM_TRANSMITTER_ACTION_POWER_ON); | ||
| 1018 | } | ||
| 1013 | ret = radeon_ddc_get_modes(radeon_connector); | 1019 | ret = radeon_ddc_get_modes(radeon_connector); |
| 1020 | if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { | ||
| 1021 | if (!radeon_dig_connector->edp_on) | ||
| 1022 | atombios_set_edp_panel_power(connector, | ||
| 1023 | ATOM_TRANSMITTER_ACTION_POWER_OFF); | ||
| 1024 | } | ||
| 1025 | |||
| 1014 | return ret; | 1026 | return ret; |
| 1015 | } | 1027 | } |
| 1016 | 1028 | ||
| @@ -1029,8 +1041,14 @@ radeon_dp_detect(struct drm_connector *connector, bool force) | |||
| 1029 | if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { | 1041 | if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { |
| 1030 | /* eDP is always DP */ | 1042 | /* eDP is always DP */ |
| 1031 | radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; | 1043 | radeon_dig_connector->dp_sink_type = CONNECTOR_OBJECT_ID_DISPLAYPORT; |
| 1044 | if (!radeon_dig_connector->edp_on) | ||
| 1045 | atombios_set_edp_panel_power(connector, | ||
| 1046 | ATOM_TRANSMITTER_ACTION_POWER_ON); | ||
| 1032 | if (radeon_dp_getdpcd(radeon_connector)) | 1047 | if (radeon_dp_getdpcd(radeon_connector)) |
| 1033 | ret = connector_status_connected; | 1048 | ret = connector_status_connected; |
| 1049 | if (!radeon_dig_connector->edp_on) | ||
| 1050 | atombios_set_edp_panel_power(connector, | ||
| 1051 | ATOM_TRANSMITTER_ACTION_POWER_OFF); | ||
| 1034 | } else { | 1052 | } else { |
| 1035 | radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); | 1053 | radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); |
| 1036 | if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { | 1054 | if (radeon_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 8adfedfe547..d8ac1849180 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -180,7 +180,7 @@ int radeon_wb_init(struct radeon_device *rdev) | |||
| 180 | int r; | 180 | int r; |
| 181 | 181 | ||
| 182 | if (rdev->wb.wb_obj == NULL) { | 182 | if (rdev->wb.wb_obj == NULL) { |
| 183 | r = radeon_bo_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, true, | 183 | r = radeon_bo_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, PAGE_SIZE, true, |
| 184 | RADEON_GEM_DOMAIN_GTT, &rdev->wb.wb_obj); | 184 | RADEON_GEM_DOMAIN_GTT, &rdev->wb.wb_obj); |
| 185 | if (r) { | 185 | if (r) { |
| 186 | dev_warn(rdev->dev, "(%d) create WB bo failed\n", r); | 186 | dev_warn(rdev->dev, "(%d) create WB bo failed\n", r); |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index f678257c42e..041943df966 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
| @@ -176,6 +176,7 @@ static inline bool radeon_encoder_is_digital(struct drm_encoder *encoder) | |||
| 176 | return false; | 176 | return false; |
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | |||
| 179 | void | 180 | void |
| 180 | radeon_link_encoder_connector(struct drm_device *dev) | 181 | radeon_link_encoder_connector(struct drm_device *dev) |
| 181 | { | 182 | { |
| @@ -228,6 +229,27 @@ radeon_get_connector_for_encoder(struct drm_encoder *encoder) | |||
| 228 | return NULL; | 229 | return NULL; |
| 229 | } | 230 | } |
| 230 | 231 | ||
| 232 | struct drm_encoder *radeon_atom_get_external_encoder(struct drm_encoder *encoder) | ||
| 233 | { | ||
| 234 | struct drm_device *dev = encoder->dev; | ||
| 235 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 236 | struct drm_encoder *other_encoder; | ||
| 237 | struct radeon_encoder *other_radeon_encoder; | ||
| 238 | |||
| 239 | if (radeon_encoder->is_ext_encoder) | ||
| 240 | return NULL; | ||
| 241 | |||
| 242 | list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) { | ||
| 243 | if (other_encoder == encoder) | ||
| 244 | continue; | ||
| 245 | other_radeon_encoder = to_radeon_encoder(other_encoder); | ||
| 246 | if (other_radeon_encoder->is_ext_encoder && | ||
| 247 | (radeon_encoder->devices & other_radeon_encoder->devices)) | ||
| 248 | return other_encoder; | ||
| 249 | } | ||
| 250 | return NULL; | ||
| 251 | } | ||
| 252 | |||
| 231 | void radeon_panel_mode_fixup(struct drm_encoder *encoder, | 253 | void radeon_panel_mode_fixup(struct drm_encoder *encoder, |
| 232 | struct drm_display_mode *adjusted_mode) | 254 | struct drm_display_mode *adjusted_mode) |
| 233 | { | 255 | { |
| @@ -426,52 +448,49 @@ atombios_tv_setup(struct drm_encoder *encoder, int action) | |||
| 426 | 448 | ||
| 427 | } | 449 | } |
| 428 | 450 | ||
| 429 | void | 451 | union dvo_encoder_control { |
| 430 | atombios_external_tmds_setup(struct drm_encoder *encoder, int action) | 452 | ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION ext_tmds; |
| 431 | { | 453 | DVO_ENCODER_CONTROL_PS_ALLOCATION dvo; |
| 432 | struct drm_device *dev = encoder->dev; | 454 | DVO_ENCODER_CONTROL_PS_ALLOCATION_V3 dvo_v3; |
| 433 | struct radeon_device *rdev = dev->dev_private; | 455 | }; |
| 434 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 435 | ENABLE_EXTERNAL_TMDS_ENCODER_PS_ALLOCATION args; | ||
| 436 | int index = 0; | ||
| 437 | |||
| 438 | memset(&args, 0, sizeof(args)); | ||
| 439 | |||
| 440 | index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); | ||
| 441 | |||
| 442 | args.sXTmdsEncoder.ucEnable = action; | ||
| 443 | |||
| 444 | if (radeon_encoder->pixel_clock > 165000) | ||
| 445 | args.sXTmdsEncoder.ucMisc = PANEL_ENCODER_MISC_DUAL; | ||
| 446 | |||
| 447 | /*if (pScrn->rgbBits == 8)*/ | ||
| 448 | args.sXTmdsEncoder.ucMisc |= (1 << 1); | ||
| 449 | |||
| 450 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 451 | |||
| 452 | } | ||
| 453 | 456 | ||
| 454 | static void | 457 | void |
| 455 | atombios_ddia_setup(struct drm_encoder *encoder, int action) | 458 | atombios_dvo_setup(struct drm_encoder *encoder, int action) |
| 456 | { | 459 | { |
| 457 | struct drm_device *dev = encoder->dev; | 460 | struct drm_device *dev = encoder->dev; |
| 458 | struct radeon_device *rdev = dev->dev_private; | 461 | struct radeon_device *rdev = dev->dev_private; |
| 459 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 462 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
| 460 | DVO_ENCODER_CONTROL_PS_ALLOCATION args; | 463 | union dvo_encoder_control args; |
| 461 | int index = 0; | 464 | int index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); |
| 462 | 465 | ||
| 463 | memset(&args, 0, sizeof(args)); | 466 | memset(&args, 0, sizeof(args)); |
| 464 | 467 | ||
| 465 | index = GetIndexIntoMasterTable(COMMAND, DVOEncoderControl); | 468 | if (ASIC_IS_DCE3(rdev)) { |
| 469 | /* DCE3+ */ | ||
| 470 | args.dvo_v3.ucAction = action; | ||
| 471 | args.dvo_v3.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); | ||
| 472 | args.dvo_v3.ucDVOConfig = 0; /* XXX */ | ||
| 473 | } else if (ASIC_IS_DCE2(rdev)) { | ||
| 474 | /* DCE2 (pre-DCE3 R6xx, RS600/690/740 */ | ||
| 475 | args.dvo.sDVOEncoder.ucAction = action; | ||
| 476 | args.dvo.sDVOEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); | ||
| 477 | /* DFP1, CRT1, TV1 depending on the type of port */ | ||
| 478 | args.dvo.sDVOEncoder.ucDeviceType = ATOM_DEVICE_DFP1_INDEX; | ||
| 479 | |||
| 480 | if (radeon_encoder->pixel_clock > 165000) | ||
| 481 | args.dvo.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute |= PANEL_ENCODER_MISC_DUAL; | ||
| 482 | } else { | ||
| 483 | /* R4xx, R5xx */ | ||
| 484 | args.ext_tmds.sXTmdsEncoder.ucEnable = action; | ||
| 466 | 485 | ||
| 467 | args.sDVOEncoder.ucAction = action; | 486 | if (radeon_encoder->pixel_clock > 165000) |
| 468 | args.sDVOEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); | 487 | args.ext_tmds.sXTmdsEncoder.ucMisc |= PANEL_ENCODER_MISC_DUAL; |
| 469 | 488 | ||
| 470 | if (radeon_encoder->pixel_clock > 165000) | 489 | /*if (pScrn->rgbBits == 8)*/ |
| 471 | args.sDVOEncoder.usDevAttr.sDigAttrib.ucAttribute = PANEL_ENCODER_MISC_DUAL; | 490 | args.ext_tmds.sXTmdsEncoder.ucMisc |= ATOM_PANEL_MISC_888RGB; |
| 491 | } | ||
| 472 | 492 | ||
| 473 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 493 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
| 474 | |||
| 475 | } | 494 | } |
| 476 | 495 | ||
| 477 | union lvds_encoder_control { | 496 | union lvds_encoder_control { |
| @@ -532,14 +551,14 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) | |||
| 532 | if (dig->lcd_misc & ATOM_PANEL_MISC_DUAL) | 551 | if (dig->lcd_misc & ATOM_PANEL_MISC_DUAL) |
| 533 | args.v1.ucMisc |= PANEL_ENCODER_MISC_DUAL; | 552 | args.v1.ucMisc |= PANEL_ENCODER_MISC_DUAL; |
| 534 | if (dig->lcd_misc & ATOM_PANEL_MISC_888RGB) | 553 | if (dig->lcd_misc & ATOM_PANEL_MISC_888RGB) |
| 535 | args.v1.ucMisc |= (1 << 1); | 554 | args.v1.ucMisc |= ATOM_PANEL_MISC_888RGB; |
| 536 | } else { | 555 | } else { |
| 537 | if (dig->linkb) | 556 | if (dig->linkb) |
| 538 | args.v1.ucMisc |= PANEL_ENCODER_MISC_TMDS_LINKB; | 557 | args.v1.ucMisc |= PANEL_ENCODER_MISC_TMDS_LINKB; |
| 539 | if (radeon_encoder->pixel_clock > 165000) | 558 | if (radeon_encoder->pixel_clock > 165000) |
| 540 | args.v1.ucMisc |= PANEL_ENCODER_MISC_DUAL; | 559 | args.v1.ucMisc |= PANEL_ENCODER_MISC_DUAL; |
| 541 | /*if (pScrn->rgbBits == 8) */ | 560 | /*if (pScrn->rgbBits == 8) */ |
| 542 | args.v1.ucMisc |= (1 << 1); | 561 | args.v1.ucMisc |= ATOM_PANEL_MISC_888RGB; |
| 543 | } | 562 | } |
| 544 | break; | 563 | break; |
| 545 | case 2: | 564 | case 2: |
| @@ -595,6 +614,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) | |||
| 595 | int | 614 | int |
| 596 | atombios_get_encoder_mode(struct drm_encoder *encoder) | 615 | atombios_get_encoder_mode(struct drm_encoder *encoder) |
| 597 | { | 616 | { |
| 617 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 598 | struct drm_device *dev = encoder->dev; | 618 | struct drm_device *dev = encoder->dev; |
| 599 | struct radeon_device *rdev = dev->dev_private; | 619 | struct radeon_device *rdev = dev->dev_private; |
| 600 | struct drm_connector *connector; | 620 | struct drm_connector *connector; |
| @@ -602,9 +622,20 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
| 602 | struct radeon_connector_atom_dig *dig_connector; | 622 | struct radeon_connector_atom_dig *dig_connector; |
| 603 | 623 | ||
| 604 | connector = radeon_get_connector_for_encoder(encoder); | 624 | connector = radeon_get_connector_for_encoder(encoder); |
| 605 | if (!connector) | 625 | if (!connector) { |
| 606 | return 0; | 626 | switch (radeon_encoder->encoder_id) { |
| 607 | 627 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: | |
| 628 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: | ||
| 629 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: | ||
| 630 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: | ||
| 631 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | ||
| 632 | return ATOM_ENCODER_MODE_DVI; | ||
| 633 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: | ||
| 634 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: | ||
| 635 | default: | ||
| 636 | return ATOM_ENCODER_MODE_CRT; | ||
| 637 | } | ||
| 638 | } | ||
| 608 | radeon_connector = to_radeon_connector(connector); | 639 | radeon_connector = to_radeon_connector(connector); |
| 609 | 640 | ||
| 610 | switch (connector->connector_type) { | 641 | switch (connector->connector_type) { |
| @@ -834,6 +865,9 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t | |||
| 834 | memset(&args, 0, sizeof(args)); | 865 | memset(&args, 0, sizeof(args)); |
| 835 | 866 | ||
| 836 | switch (radeon_encoder->encoder_id) { | 867 | switch (radeon_encoder->encoder_id) { |
| 868 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | ||
| 869 | index = GetIndexIntoMasterTable(COMMAND, DVOOutputControl); | ||
| 870 | break; | ||
| 837 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: | 871 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: |
| 838 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: | 872 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: |
| 839 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: | 873 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: |
| @@ -978,6 +1012,105 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t | |||
| 978 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 1012 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
| 979 | } | 1013 | } |
| 980 | 1014 | ||
| 1015 | void | ||
| 1016 | atombios_set_edp_panel_power(struct drm_connector *connector, int action) | ||
| 1017 | { | ||
| 1018 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
| 1019 | struct drm_device *dev = radeon_connector->base.dev; | ||
| 1020 | struct radeon_device *rdev = dev->dev_private; | ||
| 1021 | union dig_transmitter_control args; | ||
| 1022 | int index = GetIndexIntoMasterTable(COMMAND, UNIPHYTransmitterControl); | ||
| 1023 | uint8_t frev, crev; | ||
| 1024 | |||
| 1025 | if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) | ||
| 1026 | return; | ||
| 1027 | |||
| 1028 | if (!ASIC_IS_DCE4(rdev)) | ||
| 1029 | return; | ||
| 1030 | |||
| 1031 | if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || | ||
| 1032 | (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) | ||
| 1033 | return; | ||
| 1034 | |||
| 1035 | if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) | ||
| 1036 | return; | ||
| 1037 | |||
| 1038 | memset(&args, 0, sizeof(args)); | ||
| 1039 | |||
| 1040 | args.v1.ucAction = action; | ||
| 1041 | |||
| 1042 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1043 | } | ||
| 1044 | |||
| 1045 | union external_encoder_control { | ||
| 1046 | EXTERNAL_ENCODER_CONTROL_PS_ALLOCATION v1; | ||
| 1047 | }; | ||
| 1048 | |||
| 1049 | static void | ||
| 1050 | atombios_external_encoder_setup(struct drm_encoder *encoder, | ||
| 1051 | struct drm_encoder *ext_encoder, | ||
| 1052 | int action) | ||
| 1053 | { | ||
| 1054 | struct drm_device *dev = encoder->dev; | ||
| 1055 | struct radeon_device *rdev = dev->dev_private; | ||
| 1056 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 1057 | union external_encoder_control args; | ||
| 1058 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | ||
| 1059 | int index = GetIndexIntoMasterTable(COMMAND, ExternalEncoderControl); | ||
| 1060 | u8 frev, crev; | ||
| 1061 | int dp_clock = 0; | ||
| 1062 | int dp_lane_count = 0; | ||
| 1063 | int connector_object_id = 0; | ||
| 1064 | |||
| 1065 | if (connector) { | ||
| 1066 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
| 1067 | struct radeon_connector_atom_dig *dig_connector = | ||
| 1068 | radeon_connector->con_priv; | ||
| 1069 | |||
| 1070 | dp_clock = dig_connector->dp_clock; | ||
| 1071 | dp_lane_count = dig_connector->dp_lane_count; | ||
| 1072 | connector_object_id = | ||
| 1073 | (radeon_connector->connector_object_id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT; | ||
| 1074 | } | ||
| 1075 | |||
| 1076 | memset(&args, 0, sizeof(args)); | ||
| 1077 | |||
| 1078 | if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) | ||
| 1079 | return; | ||
| 1080 | |||
| 1081 | switch (frev) { | ||
| 1082 | case 1: | ||
| 1083 | /* no params on frev 1 */ | ||
| 1084 | break; | ||
| 1085 | case 2: | ||
| 1086 | switch (crev) { | ||
| 1087 | case 1: | ||
| 1088 | case 2: | ||
| 1089 | args.v1.sDigEncoder.ucAction = action; | ||
| 1090 | args.v1.sDigEncoder.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); | ||
| 1091 | args.v1.sDigEncoder.ucEncoderMode = atombios_get_encoder_mode(encoder); | ||
| 1092 | |||
| 1093 | if (args.v1.sDigEncoder.ucEncoderMode == ATOM_ENCODER_MODE_DP) { | ||
| 1094 | if (dp_clock == 270000) | ||
| 1095 | args.v1.sDigEncoder.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ; | ||
| 1096 | args.v1.sDigEncoder.ucLaneNum = dp_lane_count; | ||
| 1097 | } else if (radeon_encoder->pixel_clock > 165000) | ||
| 1098 | args.v1.sDigEncoder.ucLaneNum = 8; | ||
| 1099 | else | ||
| 1100 | args.v1.sDigEncoder.ucLaneNum = 4; | ||
| 1101 | break; | ||
| 1102 | default: | ||
| 1103 | DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); | ||
| 1104 | return; | ||
| 1105 | } | ||
| 1106 | break; | ||
| 1107 | default: | ||
| 1108 | DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); | ||
| 1109 | return; | ||
| 1110 | } | ||
| 1111 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1112 | } | ||
| 1113 | |||
| 981 | static void | 1114 | static void |
| 982 | atombios_yuv_setup(struct drm_encoder *encoder, bool enable) | 1115 | atombios_yuv_setup(struct drm_encoder *encoder, bool enable) |
| 983 | { | 1116 | { |
| @@ -1021,6 +1154,7 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
| 1021 | struct drm_device *dev = encoder->dev; | 1154 | struct drm_device *dev = encoder->dev; |
| 1022 | struct radeon_device *rdev = dev->dev_private; | 1155 | struct radeon_device *rdev = dev->dev_private; |
| 1023 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 1156 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
| 1157 | struct drm_encoder *ext_encoder = radeon_atom_get_external_encoder(encoder); | ||
| 1024 | DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; | 1158 | DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; |
| 1025 | int index = 0; | 1159 | int index = 0; |
| 1026 | bool is_dig = false; | 1160 | bool is_dig = false; |
| @@ -1043,9 +1177,14 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
| 1043 | break; | 1177 | break; |
| 1044 | case ENCODER_OBJECT_ID_INTERNAL_DVO1: | 1178 | case ENCODER_OBJECT_ID_INTERNAL_DVO1: |
| 1045 | case ENCODER_OBJECT_ID_INTERNAL_DDI: | 1179 | case ENCODER_OBJECT_ID_INTERNAL_DDI: |
| 1046 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | ||
| 1047 | index = GetIndexIntoMasterTable(COMMAND, DVOOutputControl); | 1180 | index = GetIndexIntoMasterTable(COMMAND, DVOOutputControl); |
| 1048 | break; | 1181 | break; |
| 1182 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | ||
| 1183 | if (ASIC_IS_DCE3(rdev)) | ||
| 1184 | is_dig = true; | ||
| 1185 | else | ||
| 1186 | index = GetIndexIntoMasterTable(COMMAND, DVOOutputControl); | ||
| 1187 | break; | ||
| 1049 | case ENCODER_OBJECT_ID_INTERNAL_LVDS: | 1188 | case ENCODER_OBJECT_ID_INTERNAL_LVDS: |
| 1050 | index = GetIndexIntoMasterTable(COMMAND, LCD1OutputControl); | 1189 | index = GetIndexIntoMasterTable(COMMAND, LCD1OutputControl); |
| 1051 | break; | 1190 | break; |
| @@ -1082,34 +1221,85 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode) | |||
| 1082 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { | 1221 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { |
| 1083 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | 1222 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); |
| 1084 | 1223 | ||
| 1224 | if (connector && | ||
| 1225 | (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { | ||
| 1226 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
| 1227 | struct radeon_connector_atom_dig *radeon_dig_connector = | ||
| 1228 | radeon_connector->con_priv; | ||
| 1229 | atombios_set_edp_panel_power(connector, | ||
| 1230 | ATOM_TRANSMITTER_ACTION_POWER_ON); | ||
| 1231 | radeon_dig_connector->edp_on = true; | ||
| 1232 | } | ||
| 1085 | dp_link_train(encoder, connector); | 1233 | dp_link_train(encoder, connector); |
| 1086 | if (ASIC_IS_DCE4(rdev)) | 1234 | if (ASIC_IS_DCE4(rdev)) |
| 1087 | atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON); | 1235 | atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON); |
| 1088 | } | 1236 | } |
| 1237 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) | ||
| 1238 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0); | ||
| 1089 | break; | 1239 | break; |
| 1090 | case DRM_MODE_DPMS_STANDBY: | 1240 | case DRM_MODE_DPMS_STANDBY: |
| 1091 | case DRM_MODE_DPMS_SUSPEND: | 1241 | case DRM_MODE_DPMS_SUSPEND: |
| 1092 | case DRM_MODE_DPMS_OFF: | 1242 | case DRM_MODE_DPMS_OFF: |
| 1093 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT, 0, 0); | 1243 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_DISABLE_OUTPUT, 0, 0); |
| 1094 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { | 1244 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_DP) { |
| 1245 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | ||
| 1246 | |||
| 1095 | if (ASIC_IS_DCE4(rdev)) | 1247 | if (ASIC_IS_DCE4(rdev)) |
| 1096 | atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF); | 1248 | atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_OFF); |
| 1249 | if (connector && | ||
| 1250 | (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) { | ||
| 1251 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
| 1252 | struct radeon_connector_atom_dig *radeon_dig_connector = | ||
| 1253 | radeon_connector->con_priv; | ||
| 1254 | atombios_set_edp_panel_power(connector, | ||
| 1255 | ATOM_TRANSMITTER_ACTION_POWER_OFF); | ||
| 1256 | radeon_dig_connector->edp_on = false; | ||
| 1257 | } | ||
| 1097 | } | 1258 | } |
| 1259 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) | ||
| 1260 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_LCD_BLOFF, 0, 0); | ||
| 1098 | break; | 1261 | break; |
| 1099 | } | 1262 | } |
| 1100 | } else { | 1263 | } else { |
| 1101 | switch (mode) { | 1264 | switch (mode) { |
| 1102 | case DRM_MODE_DPMS_ON: | 1265 | case DRM_MODE_DPMS_ON: |
| 1103 | args.ucAction = ATOM_ENABLE; | 1266 | args.ucAction = ATOM_ENABLE; |
| 1267 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1268 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | ||
| 1269 | args.ucAction = ATOM_LCD_BLON; | ||
| 1270 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1271 | } | ||
| 1104 | break; | 1272 | break; |
| 1105 | case DRM_MODE_DPMS_STANDBY: | 1273 | case DRM_MODE_DPMS_STANDBY: |
| 1106 | case DRM_MODE_DPMS_SUSPEND: | 1274 | case DRM_MODE_DPMS_SUSPEND: |
| 1107 | case DRM_MODE_DPMS_OFF: | 1275 | case DRM_MODE_DPMS_OFF: |
| 1108 | args.ucAction = ATOM_DISABLE; | 1276 | args.ucAction = ATOM_DISABLE; |
| 1277 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1278 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | ||
| 1279 | args.ucAction = ATOM_LCD_BLOFF; | ||
| 1280 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1281 | } | ||
| 1109 | break; | 1282 | break; |
| 1110 | } | 1283 | } |
| 1111 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1112 | } | 1284 | } |
| 1285 | |||
| 1286 | if (ext_encoder) { | ||
| 1287 | int action; | ||
| 1288 | |||
| 1289 | switch (mode) { | ||
| 1290 | case DRM_MODE_DPMS_ON: | ||
| 1291 | default: | ||
| 1292 | action = ATOM_ENABLE; | ||
| 1293 | break; | ||
| 1294 | case DRM_MODE_DPMS_STANDBY: | ||
| 1295 | case DRM_MODE_DPMS_SUSPEND: | ||
| 1296 | case DRM_MODE_DPMS_OFF: | ||
| 1297 | action = ATOM_DISABLE; | ||
| 1298 | break; | ||
| 1299 | } | ||
| 1300 | atombios_external_encoder_setup(encoder, ext_encoder, action); | ||
| 1301 | } | ||
| 1302 | |||
| 1113 | radeon_atombios_encoder_dpms_scratch_regs(encoder, (mode == DRM_MODE_DPMS_ON) ? true : false); | 1303 | radeon_atombios_encoder_dpms_scratch_regs(encoder, (mode == DRM_MODE_DPMS_ON) ? true : false); |
| 1114 | 1304 | ||
| 1115 | } | 1305 | } |
| @@ -1242,7 +1432,7 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder) | |||
| 1242 | break; | 1432 | break; |
| 1243 | default: | 1433 | default: |
| 1244 | DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); | 1434 | DRM_ERROR("Unknown table version: %d, %d\n", frev, crev); |
| 1245 | break; | 1435 | return; |
| 1246 | } | 1436 | } |
| 1247 | 1437 | ||
| 1248 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 1438 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
| @@ -1357,6 +1547,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
| 1357 | struct drm_device *dev = encoder->dev; | 1547 | struct drm_device *dev = encoder->dev; |
| 1358 | struct radeon_device *rdev = dev->dev_private; | 1548 | struct radeon_device *rdev = dev->dev_private; |
| 1359 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 1549 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
| 1550 | struct drm_encoder *ext_encoder = radeon_atom_get_external_encoder(encoder); | ||
| 1360 | 1551 | ||
| 1361 | radeon_encoder->pixel_clock = adjusted_mode->clock; | 1552 | radeon_encoder->pixel_clock = adjusted_mode->clock; |
| 1362 | 1553 | ||
| @@ -1400,11 +1591,9 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
| 1400 | } | 1591 | } |
| 1401 | break; | 1592 | break; |
| 1402 | case ENCODER_OBJECT_ID_INTERNAL_DDI: | 1593 | case ENCODER_OBJECT_ID_INTERNAL_DDI: |
| 1403 | atombios_ddia_setup(encoder, ATOM_ENABLE); | ||
| 1404 | break; | ||
| 1405 | case ENCODER_OBJECT_ID_INTERNAL_DVO1: | 1594 | case ENCODER_OBJECT_ID_INTERNAL_DVO1: |
| 1406 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | 1595 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: |
| 1407 | atombios_external_tmds_setup(encoder, ATOM_ENABLE); | 1596 | atombios_dvo_setup(encoder, ATOM_ENABLE); |
| 1408 | break; | 1597 | break; |
| 1409 | case ENCODER_OBJECT_ID_INTERNAL_DAC1: | 1598 | case ENCODER_OBJECT_ID_INTERNAL_DAC1: |
| 1410 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: | 1599 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: |
| @@ -1419,6 +1608,11 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
| 1419 | } | 1608 | } |
| 1420 | break; | 1609 | break; |
| 1421 | } | 1610 | } |
| 1611 | |||
| 1612 | if (ext_encoder) { | ||
| 1613 | atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE); | ||
| 1614 | } | ||
| 1615 | |||
| 1422 | atombios_apply_encoder_quirks(encoder, adjusted_mode); | 1616 | atombios_apply_encoder_quirks(encoder, adjusted_mode); |
| 1423 | 1617 | ||
| 1424 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) { | 1618 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) { |
| @@ -1595,11 +1789,9 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder) | |||
| 1595 | } | 1789 | } |
| 1596 | break; | 1790 | break; |
| 1597 | case ENCODER_OBJECT_ID_INTERNAL_DDI: | 1791 | case ENCODER_OBJECT_ID_INTERNAL_DDI: |
| 1598 | atombios_ddia_setup(encoder, ATOM_DISABLE); | ||
| 1599 | break; | ||
| 1600 | case ENCODER_OBJECT_ID_INTERNAL_DVO1: | 1792 | case ENCODER_OBJECT_ID_INTERNAL_DVO1: |
| 1601 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | 1793 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: |
| 1602 | atombios_external_tmds_setup(encoder, ATOM_DISABLE); | 1794 | atombios_dvo_setup(encoder, ATOM_DISABLE); |
| 1603 | break; | 1795 | break; |
| 1604 | case ENCODER_OBJECT_ID_INTERNAL_DAC1: | 1796 | case ENCODER_OBJECT_ID_INTERNAL_DAC1: |
| 1605 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: | 1797 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: |
| @@ -1621,6 +1813,53 @@ disable_done: | |||
| 1621 | radeon_encoder->active_device = 0; | 1813 | radeon_encoder->active_device = 0; |
| 1622 | } | 1814 | } |
| 1623 | 1815 | ||
| 1816 | /* these are handled by the primary encoders */ | ||
| 1817 | static void radeon_atom_ext_prepare(struct drm_encoder *encoder) | ||
| 1818 | { | ||
| 1819 | |||
| 1820 | } | ||
| 1821 | |||
| 1822 | static void radeon_atom_ext_commit(struct drm_encoder *encoder) | ||
| 1823 | { | ||
| 1824 | |||
| 1825 | } | ||
| 1826 | |||
| 1827 | static void | ||
| 1828 | radeon_atom_ext_mode_set(struct drm_encoder *encoder, | ||
| 1829 | struct drm_display_mode *mode, | ||
| 1830 | struct drm_display_mode *adjusted_mode) | ||
| 1831 | { | ||
| 1832 | |||
| 1833 | } | ||
| 1834 | |||
| 1835 | static void radeon_atom_ext_disable(struct drm_encoder *encoder) | ||
| 1836 | { | ||
| 1837 | |||
| 1838 | } | ||
| 1839 | |||
| 1840 | static void | ||
| 1841 | radeon_atom_ext_dpms(struct drm_encoder *encoder, int mode) | ||
| 1842 | { | ||
| 1843 | |||
| 1844 | } | ||
| 1845 | |||
| 1846 | static bool radeon_atom_ext_mode_fixup(struct drm_encoder *encoder, | ||
| 1847 | struct drm_display_mode *mode, | ||
| 1848 | struct drm_display_mode *adjusted_mode) | ||
| 1849 | { | ||
| 1850 | return true; | ||
| 1851 | } | ||
| 1852 | |||
| 1853 | static const struct drm_encoder_helper_funcs radeon_atom_ext_helper_funcs = { | ||
| 1854 | .dpms = radeon_atom_ext_dpms, | ||
| 1855 | .mode_fixup = radeon_atom_ext_mode_fixup, | ||
| 1856 | .prepare = radeon_atom_ext_prepare, | ||
| 1857 | .mode_set = radeon_atom_ext_mode_set, | ||
| 1858 | .commit = radeon_atom_ext_commit, | ||
| 1859 | .disable = radeon_atom_ext_disable, | ||
| 1860 | /* no detect for TMDS/LVDS yet */ | ||
| 1861 | }; | ||
| 1862 | |||
| 1624 | static const struct drm_encoder_helper_funcs radeon_atom_dig_helper_funcs = { | 1863 | static const struct drm_encoder_helper_funcs radeon_atom_dig_helper_funcs = { |
| 1625 | .dpms = radeon_atom_encoder_dpms, | 1864 | .dpms = radeon_atom_encoder_dpms, |
| 1626 | .mode_fixup = radeon_atom_mode_fixup, | 1865 | .mode_fixup = radeon_atom_mode_fixup, |
| @@ -1730,6 +1969,7 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t | |||
| 1730 | radeon_encoder->devices = supported_device; | 1969 | radeon_encoder->devices = supported_device; |
| 1731 | radeon_encoder->rmx_type = RMX_OFF; | 1970 | radeon_encoder->rmx_type = RMX_OFF; |
| 1732 | radeon_encoder->underscan_type = UNDERSCAN_OFF; | 1971 | radeon_encoder->underscan_type = UNDERSCAN_OFF; |
| 1972 | radeon_encoder->is_ext_encoder = false; | ||
| 1733 | 1973 | ||
| 1734 | switch (radeon_encoder->encoder_id) { | 1974 | switch (radeon_encoder->encoder_id) { |
| 1735 | case ENCODER_OBJECT_ID_INTERNAL_LVDS: | 1975 | case ENCODER_OBJECT_ID_INTERNAL_LVDS: |
| @@ -1771,6 +2011,9 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t | |||
| 1771 | radeon_encoder->rmx_type = RMX_FULL; | 2011 | radeon_encoder->rmx_type = RMX_FULL; |
| 1772 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_LVDS); | 2012 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_LVDS); |
| 1773 | radeon_encoder->enc_priv = radeon_atombios_get_lvds_info(radeon_encoder); | 2013 | radeon_encoder->enc_priv = radeon_atombios_get_lvds_info(radeon_encoder); |
| 2014 | } else if (radeon_encoder->devices & (ATOM_DEVICE_CRT_SUPPORT)) { | ||
| 2015 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_DAC); | ||
| 2016 | radeon_encoder->enc_priv = radeon_atombios_set_dig_info(radeon_encoder); | ||
| 1774 | } else { | 2017 | } else { |
| 1775 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_TMDS); | 2018 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_TMDS); |
| 1776 | radeon_encoder->enc_priv = radeon_atombios_set_dig_info(radeon_encoder); | 2019 | radeon_encoder->enc_priv = radeon_atombios_set_dig_info(radeon_encoder); |
| @@ -1779,5 +2022,22 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t | |||
| 1779 | } | 2022 | } |
| 1780 | drm_encoder_helper_add(encoder, &radeon_atom_dig_helper_funcs); | 2023 | drm_encoder_helper_add(encoder, &radeon_atom_dig_helper_funcs); |
| 1781 | break; | 2024 | break; |
| 2025 | case ENCODER_OBJECT_ID_SI170B: | ||
| 2026 | case ENCODER_OBJECT_ID_CH7303: | ||
| 2027 | case ENCODER_OBJECT_ID_EXTERNAL_SDVOA: | ||
| 2028 | case ENCODER_OBJECT_ID_EXTERNAL_SDVOB: | ||
| 2029 | case ENCODER_OBJECT_ID_TITFP513: | ||
| 2030 | case ENCODER_OBJECT_ID_VT1623: | ||
| 2031 | case ENCODER_OBJECT_ID_HDMI_SI1930: | ||
| 2032 | /* these are handled by the primary encoders */ | ||
| 2033 | radeon_encoder->is_ext_encoder = true; | ||
| 2034 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) | ||
| 2035 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_LVDS); | ||
| 2036 | else if (radeon_encoder->devices & (ATOM_DEVICE_CRT_SUPPORT)) | ||
| 2037 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_DAC); | ||
| 2038 | else | ||
| 2039 | drm_encoder_init(dev, encoder, &radeon_atom_enc_funcs, DRM_MODE_ENCODER_TMDS); | ||
| 2040 | drm_encoder_helper_add(encoder, &radeon_atom_ext_helper_funcs); | ||
| 2041 | break; | ||
| 1782 | } | 2042 | } |
| 1783 | } | 2043 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index e65b90317fa..65016117d95 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c | |||
| @@ -79,8 +79,8 @@ int radeon_gart_table_vram_alloc(struct radeon_device *rdev) | |||
| 79 | 79 | ||
| 80 | if (rdev->gart.table.vram.robj == NULL) { | 80 | if (rdev->gart.table.vram.robj == NULL) { |
| 81 | r = radeon_bo_create(rdev, NULL, rdev->gart.table_size, | 81 | r = radeon_bo_create(rdev, NULL, rdev->gart.table_size, |
| 82 | true, RADEON_GEM_DOMAIN_VRAM, | 82 | PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, |
| 83 | &rdev->gart.table.vram.robj); | 83 | &rdev->gart.table.vram.robj); |
| 84 | if (r) { | 84 | if (r) { |
| 85 | return r; | 85 | return r; |
| 86 | } | 86 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index d1e595d9172..df95eb83dac 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c | |||
| @@ -67,7 +67,7 @@ int radeon_gem_object_create(struct radeon_device *rdev, int size, | |||
| 67 | if (alignment < PAGE_SIZE) { | 67 | if (alignment < PAGE_SIZE) { |
| 68 | alignment = PAGE_SIZE; | 68 | alignment = PAGE_SIZE; |
| 69 | } | 69 | } |
| 70 | r = radeon_bo_create(rdev, gobj, size, kernel, initial_domain, &robj); | 70 | r = radeon_bo_create(rdev, gobj, size, alignment, kernel, initial_domain, &robj); |
| 71 | if (r) { | 71 | if (r) { |
| 72 | if (r != -ERESTARTSYS) | 72 | if (r != -ERESTARTSYS) |
| 73 | DRM_ERROR("Failed to allocate GEM object (%d, %d, %u, %d)\n", | 73 | DRM_ERROR("Failed to allocate GEM object (%d, %d, %u, %d)\n", |
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index 0cfbba02c4d..ded2a45bc95 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c | |||
| @@ -896,7 +896,8 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, | |||
| 896 | ((rdev->family <= CHIP_RS480) || | 896 | ((rdev->family <= CHIP_RS480) || |
| 897 | ((rdev->family >= CHIP_RV515) && (rdev->family <= CHIP_R580))))) { | 897 | ((rdev->family >= CHIP_RV515) && (rdev->family <= CHIP_R580))))) { |
| 898 | /* set the radeon hw i2c adapter */ | 898 | /* set the radeon hw i2c adapter */ |
| 899 | sprintf(i2c->adapter.name, "Radeon i2c hw bus %s", name); | 899 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
| 900 | "Radeon i2c hw bus %s", name); | ||
| 900 | i2c->adapter.algo = &radeon_i2c_algo; | 901 | i2c->adapter.algo = &radeon_i2c_algo; |
| 901 | ret = i2c_add_adapter(&i2c->adapter); | 902 | ret = i2c_add_adapter(&i2c->adapter); |
| 902 | if (ret) { | 903 | if (ret) { |
| @@ -905,7 +906,8 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev, | |||
| 905 | } | 906 | } |
| 906 | } else { | 907 | } else { |
| 907 | /* set the radeon bit adapter */ | 908 | /* set the radeon bit adapter */ |
| 908 | sprintf(i2c->adapter.name, "Radeon i2c bit bus %s", name); | 909 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), |
| 910 | "Radeon i2c bit bus %s", name); | ||
| 909 | i2c->adapter.algo_data = &i2c->algo.bit; | 911 | i2c->adapter.algo_data = &i2c->algo.bit; |
| 910 | i2c->algo.bit.pre_xfer = pre_xfer; | 912 | i2c->algo.bit.pre_xfer = pre_xfer; |
| 911 | i2c->algo.bit.post_xfer = post_xfer; | 913 | i2c->algo.bit.post_xfer = post_xfer; |
| @@ -946,6 +948,8 @@ struct radeon_i2c_chan *radeon_i2c_create_dp(struct drm_device *dev, | |||
| 946 | i2c->rec = *rec; | 948 | i2c->rec = *rec; |
| 947 | i2c->adapter.owner = THIS_MODULE; | 949 | i2c->adapter.owner = THIS_MODULE; |
| 948 | i2c->dev = dev; | 950 | i2c->dev = dev; |
| 951 | snprintf(i2c->adapter.name, sizeof(i2c->adapter.name), | ||
| 952 | "Radeon aux bus %s", name); | ||
| 949 | i2c_set_adapdata(&i2c->adapter, i2c); | 953 | i2c_set_adapdata(&i2c->adapter, i2c); |
| 950 | i2c->adapter.algo_data = &i2c->algo.dp; | 954 | i2c->adapter.algo_data = &i2c->algo.dp; |
| 951 | i2c->algo.dp.aux_ch = radeon_dp_i2c_aux_ch; | 955 | i2c->algo.dp.aux_ch = radeon_dp_i2c_aux_ch; |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c index 0b8397000f4..59f834ba283 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c | |||
| @@ -670,7 +670,7 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder, | |||
| 670 | 670 | ||
| 671 | if (rdev->is_atom_bios) { | 671 | if (rdev->is_atom_bios) { |
| 672 | radeon_encoder->pixel_clock = adjusted_mode->clock; | 672 | radeon_encoder->pixel_clock = adjusted_mode->clock; |
| 673 | atombios_external_tmds_setup(encoder, ATOM_ENABLE); | 673 | atombios_dvo_setup(encoder, ATOM_ENABLE); |
| 674 | fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL); | 674 | fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL); |
| 675 | } else { | 675 | } else { |
| 676 | fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL); | 676 | fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL); |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 680f57644e8..e301c6f9e05 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
| @@ -375,6 +375,7 @@ struct radeon_encoder { | |||
| 375 | int hdmi_config_offset; | 375 | int hdmi_config_offset; |
| 376 | int hdmi_audio_workaround; | 376 | int hdmi_audio_workaround; |
| 377 | int hdmi_buffer_status; | 377 | int hdmi_buffer_status; |
| 378 | bool is_ext_encoder; | ||
| 378 | }; | 379 | }; |
| 379 | 380 | ||
| 380 | struct radeon_connector_atom_dig { | 381 | struct radeon_connector_atom_dig { |
| @@ -385,6 +386,7 @@ struct radeon_connector_atom_dig { | |||
| 385 | u8 dp_sink_type; | 386 | u8 dp_sink_type; |
| 386 | int dp_clock; | 387 | int dp_clock; |
| 387 | int dp_lane_count; | 388 | int dp_lane_count; |
| 389 | bool edp_on; | ||
| 388 | }; | 390 | }; |
| 389 | 391 | ||
| 390 | struct radeon_gpio_rec { | 392 | struct radeon_gpio_rec { |
| @@ -523,9 +525,10 @@ struct drm_encoder *radeon_encoder_legacy_primary_dac_add(struct drm_device *dev | |||
| 523 | struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv); | 525 | struct drm_encoder *radeon_encoder_legacy_tv_dac_add(struct drm_device *dev, int bios_index, int with_tv); |
| 524 | struct drm_encoder *radeon_encoder_legacy_tmds_int_add(struct drm_device *dev, int bios_index); | 526 | struct drm_encoder *radeon_encoder_legacy_tmds_int_add(struct drm_device *dev, int bios_index); |
| 525 | struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, int bios_index); | 527 | struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, int bios_index); |
| 526 | extern void atombios_external_tmds_setup(struct drm_encoder *encoder, int action); | 528 | extern void atombios_dvo_setup(struct drm_encoder *encoder, int action); |
| 527 | extern void atombios_digital_setup(struct drm_encoder *encoder, int action); | 529 | extern void atombios_digital_setup(struct drm_encoder *encoder, int action); |
| 528 | extern int atombios_get_encoder_mode(struct drm_encoder *encoder); | 530 | extern int atombios_get_encoder_mode(struct drm_encoder *encoder); |
| 531 | extern void atombios_set_edp_panel_power(struct drm_connector *connector, int action); | ||
| 529 | extern void radeon_encoder_set_active_device(struct drm_encoder *encoder); | 532 | extern void radeon_encoder_set_active_device(struct drm_encoder *encoder); |
| 530 | 533 | ||
| 531 | extern void radeon_crtc_load_lut(struct drm_crtc *crtc); | 534 | extern void radeon_crtc_load_lut(struct drm_crtc *crtc); |
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 8eb18346601..1d067743fee 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
| @@ -86,11 +86,12 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) | |||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, | 88 | int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, |
| 89 | unsigned long size, bool kernel, u32 domain, | 89 | unsigned long size, int byte_align, bool kernel, u32 domain, |
| 90 | struct radeon_bo **bo_ptr) | 90 | struct radeon_bo **bo_ptr) |
| 91 | { | 91 | { |
| 92 | struct radeon_bo *bo; | 92 | struct radeon_bo *bo; |
| 93 | enum ttm_bo_type type; | 93 | enum ttm_bo_type type; |
| 94 | int page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT; | ||
| 94 | int r; | 95 | int r; |
| 95 | 96 | ||
| 96 | if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { | 97 | if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { |
| @@ -115,7 +116,7 @@ retry: | |||
| 115 | /* Kernel allocation are uninterruptible */ | 116 | /* Kernel allocation are uninterruptible */ |
| 116 | mutex_lock(&rdev->vram_mutex); | 117 | mutex_lock(&rdev->vram_mutex); |
| 117 | r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type, | 118 | r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type, |
| 118 | &bo->placement, 0, 0, !kernel, NULL, size, | 119 | &bo->placement, page_align, 0, !kernel, NULL, size, |
| 119 | &radeon_ttm_bo_destroy); | 120 | &radeon_ttm_bo_destroy); |
| 120 | mutex_unlock(&rdev->vram_mutex); | 121 | mutex_unlock(&rdev->vram_mutex); |
| 121 | if (unlikely(r != 0)) { | 122 | if (unlikely(r != 0)) { |
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index 3481bc7f6f5..d143702b244 100644 --- a/drivers/gpu/drm/radeon/radeon_object.h +++ b/drivers/gpu/drm/radeon/radeon_object.h | |||
| @@ -137,9 +137,10 @@ static inline int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, | |||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | extern int radeon_bo_create(struct radeon_device *rdev, | 139 | extern int radeon_bo_create(struct radeon_device *rdev, |
| 140 | struct drm_gem_object *gobj, unsigned long size, | 140 | struct drm_gem_object *gobj, unsigned long size, |
| 141 | bool kernel, u32 domain, | 141 | int byte_align, |
| 142 | struct radeon_bo **bo_ptr); | 142 | bool kernel, u32 domain, |
| 143 | struct radeon_bo **bo_ptr); | ||
| 143 | extern int radeon_bo_kmap(struct radeon_bo *bo, void **ptr); | 144 | extern int radeon_bo_kmap(struct radeon_bo *bo, void **ptr); |
| 144 | extern void radeon_bo_kunmap(struct radeon_bo *bo); | 145 | extern void radeon_bo_kunmap(struct radeon_bo *bo); |
| 145 | extern void radeon_bo_unref(struct radeon_bo **bo); | 146 | extern void radeon_bo_unref(struct radeon_bo **bo); |
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index 6ea798ce821..06e79822a2b 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
| @@ -176,8 +176,8 @@ int radeon_ib_pool_init(struct radeon_device *rdev) | |||
| 176 | INIT_LIST_HEAD(&rdev->ib_pool.bogus_ib); | 176 | INIT_LIST_HEAD(&rdev->ib_pool.bogus_ib); |
| 177 | /* Allocate 1M object buffer */ | 177 | /* Allocate 1M object buffer */ |
| 178 | r = radeon_bo_create(rdev, NULL, RADEON_IB_POOL_SIZE*64*1024, | 178 | r = radeon_bo_create(rdev, NULL, RADEON_IB_POOL_SIZE*64*1024, |
| 179 | true, RADEON_GEM_DOMAIN_GTT, | 179 | PAGE_SIZE, true, RADEON_GEM_DOMAIN_GTT, |
| 180 | &rdev->ib_pool.robj); | 180 | &rdev->ib_pool.robj); |
| 181 | if (r) { | 181 | if (r) { |
| 182 | DRM_ERROR("radeon: failed to ib pool (%d).\n", r); | 182 | DRM_ERROR("radeon: failed to ib pool (%d).\n", r); |
| 183 | return r; | 183 | return r; |
| @@ -332,7 +332,7 @@ int radeon_ring_init(struct radeon_device *rdev, unsigned ring_size) | |||
| 332 | rdev->cp.ring_size = ring_size; | 332 | rdev->cp.ring_size = ring_size; |
| 333 | /* Allocate ring buffer */ | 333 | /* Allocate ring buffer */ |
| 334 | if (rdev->cp.ring_obj == NULL) { | 334 | if (rdev->cp.ring_obj == NULL) { |
| 335 | r = radeon_bo_create(rdev, NULL, rdev->cp.ring_size, true, | 335 | r = radeon_bo_create(rdev, NULL, rdev->cp.ring_size, PAGE_SIZE, true, |
| 336 | RADEON_GEM_DOMAIN_GTT, | 336 | RADEON_GEM_DOMAIN_GTT, |
| 337 | &rdev->cp.ring_obj); | 337 | &rdev->cp.ring_obj); |
| 338 | if (r) { | 338 | if (r) { |
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c index 313c96bc09d..5b44f652145 100644 --- a/drivers/gpu/drm/radeon/radeon_test.c +++ b/drivers/gpu/drm/radeon/radeon_test.c | |||
| @@ -52,7 +52,7 @@ void radeon_test_moves(struct radeon_device *rdev) | |||
| 52 | goto out_cleanup; | 52 | goto out_cleanup; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | r = radeon_bo_create(rdev, NULL, size, true, RADEON_GEM_DOMAIN_VRAM, | 55 | r = radeon_bo_create(rdev, NULL, size, PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, |
| 56 | &vram_obj); | 56 | &vram_obj); |
| 57 | if (r) { | 57 | if (r) { |
| 58 | DRM_ERROR("Failed to create VRAM object\n"); | 58 | DRM_ERROR("Failed to create VRAM object\n"); |
| @@ -71,7 +71,7 @@ void radeon_test_moves(struct radeon_device *rdev) | |||
| 71 | void **gtt_start, **gtt_end; | 71 | void **gtt_start, **gtt_end; |
| 72 | void **vram_start, **vram_end; | 72 | void **vram_start, **vram_end; |
| 73 | 73 | ||
| 74 | r = radeon_bo_create(rdev, NULL, size, true, | 74 | r = radeon_bo_create(rdev, NULL, size, PAGE_SIZE, true, |
| 75 | RADEON_GEM_DOMAIN_GTT, gtt_obj + i); | 75 | RADEON_GEM_DOMAIN_GTT, gtt_obj + i); |
| 76 | if (r) { | 76 | if (r) { |
| 77 | DRM_ERROR("Failed to create GTT object %d\n", i); | 77 | DRM_ERROR("Failed to create GTT object %d\n", i); |
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 01c2c736a1d..1272e4b6a1d 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c | |||
| @@ -529,7 +529,7 @@ int radeon_ttm_init(struct radeon_device *rdev) | |||
| 529 | DRM_ERROR("Failed initializing VRAM heap.\n"); | 529 | DRM_ERROR("Failed initializing VRAM heap.\n"); |
| 530 | return r; | 530 | return r; |
| 531 | } | 531 | } |
| 532 | r = radeon_bo_create(rdev, NULL, 256 * 1024, true, | 532 | r = radeon_bo_create(rdev, NULL, 256 * 1024, PAGE_SIZE, true, |
| 533 | RADEON_GEM_DOMAIN_VRAM, | 533 | RADEON_GEM_DOMAIN_VRAM, |
| 534 | &rdev->stollen_vga_memory); | 534 | &rdev->stollen_vga_memory); |
| 535 | if (r) { | 535 | if (r) { |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 245374e2b77..4dfead8cee3 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -915,8 +915,8 @@ static int rv770_vram_scratch_init(struct radeon_device *rdev) | |||
| 915 | 915 | ||
| 916 | if (rdev->vram_scratch.robj == NULL) { | 916 | if (rdev->vram_scratch.robj == NULL) { |
| 917 | r = radeon_bo_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, | 917 | r = radeon_bo_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, |
| 918 | true, RADEON_GEM_DOMAIN_VRAM, | 918 | PAGE_SIZE, true, RADEON_GEM_DOMAIN_VRAM, |
| 919 | &rdev->vram_scratch.robj); | 919 | &rdev->vram_scratch.robj); |
| 920 | if (r) { | 920 | if (r) { |
| 921 | return r; | 921 | return r; |
| 922 | } | 922 | } |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 3ca77dc0391..148a322d8f5 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -224,6 +224,9 @@ int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, | |||
| 224 | int ret; | 224 | int ret; |
| 225 | 225 | ||
| 226 | while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) { | 226 | while (unlikely(atomic_cmpxchg(&bo->reserved, 0, 1) != 0)) { |
| 227 | /** | ||
| 228 | * Deadlock avoidance for multi-bo reserving. | ||
| 229 | */ | ||
| 227 | if (use_sequence && bo->seq_valid && | 230 | if (use_sequence && bo->seq_valid && |
| 228 | (sequence - bo->val_seq < (1 << 31))) { | 231 | (sequence - bo->val_seq < (1 << 31))) { |
| 229 | return -EAGAIN; | 232 | return -EAGAIN; |
| @@ -241,6 +244,14 @@ int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, | |||
| 241 | } | 244 | } |
| 242 | 245 | ||
| 243 | if (use_sequence) { | 246 | if (use_sequence) { |
| 247 | /** | ||
| 248 | * Wake up waiters that may need to recheck for deadlock, | ||
| 249 | * if we decreased the sequence number. | ||
| 250 | */ | ||
| 251 | if (unlikely((bo->val_seq - sequence < (1 << 31)) | ||
| 252 | || !bo->seq_valid)) | ||
| 253 | wake_up_all(&bo->event_queue); | ||
| 254 | |||
| 244 | bo->val_seq = sequence; | 255 | bo->val_seq = sequence; |
| 245 | bo->seq_valid = true; | 256 | bo->seq_valid = true; |
| 246 | } else { | 257 | } else { |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index 36e129f0023..5408b1b7996 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | |||
| @@ -862,7 +862,7 @@ int vmw_dmabuf_alloc_ioctl(struct drm_device *dev, void *data, | |||
| 862 | &vmw_vram_sys_placement, true, | 862 | &vmw_vram_sys_placement, true, |
| 863 | &vmw_user_dmabuf_destroy); | 863 | &vmw_user_dmabuf_destroy); |
| 864 | if (unlikely(ret != 0)) | 864 | if (unlikely(ret != 0)) |
| 865 | return ret; | 865 | goto out_no_dmabuf; |
| 866 | 866 | ||
| 867 | tmp = ttm_bo_reference(&vmw_user_bo->dma.base); | 867 | tmp = ttm_bo_reference(&vmw_user_bo->dma.base); |
| 868 | ret = ttm_base_object_init(vmw_fpriv(file_priv)->tfile, | 868 | ret = ttm_base_object_init(vmw_fpriv(file_priv)->tfile, |
| @@ -870,19 +870,21 @@ int vmw_dmabuf_alloc_ioctl(struct drm_device *dev, void *data, | |||
| 870 | false, | 870 | false, |
| 871 | ttm_buffer_type, | 871 | ttm_buffer_type, |
| 872 | &vmw_user_dmabuf_release, NULL); | 872 | &vmw_user_dmabuf_release, NULL); |
| 873 | if (unlikely(ret != 0)) { | 873 | if (unlikely(ret != 0)) |
| 874 | ttm_bo_unref(&tmp); | 874 | goto out_no_base_object; |
| 875 | } else { | 875 | else { |
| 876 | rep->handle = vmw_user_bo->base.hash.key; | 876 | rep->handle = vmw_user_bo->base.hash.key; |
| 877 | rep->map_handle = vmw_user_bo->dma.base.addr_space_offset; | 877 | rep->map_handle = vmw_user_bo->dma.base.addr_space_offset; |
| 878 | rep->cur_gmr_id = vmw_user_bo->base.hash.key; | 878 | rep->cur_gmr_id = vmw_user_bo->base.hash.key; |
| 879 | rep->cur_gmr_offset = 0; | 879 | rep->cur_gmr_offset = 0; |
| 880 | } | 880 | } |
| 881 | ttm_bo_unref(&tmp); | ||
| 882 | 881 | ||
| 882 | out_no_base_object: | ||
| 883 | ttm_bo_unref(&tmp); | ||
| 884 | out_no_dmabuf: | ||
| 883 | ttm_read_unlock(&vmaster->lock); | 885 | ttm_read_unlock(&vmaster->lock); |
| 884 | 886 | ||
| 885 | return 0; | 887 | return ret; |
| 886 | } | 888 | } |
| 887 | 889 | ||
| 888 | int vmw_dmabuf_unref_ioctl(struct drm_device *dev, void *data, | 890 | int vmw_dmabuf_unref_ioctl(struct drm_device *dev, void *data, |
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 8a4b32dca9f..e1f07483691 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | #include <linux/hid.h> | 32 | #include <linux/hid.h> |
| 33 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
| 34 | #include <linux/sched.h> | 34 | #include <linux/sched.h> |
| 35 | #include <linux/smp_lock.h> | ||
| 36 | 35 | ||
| 37 | #include <linux/hidraw.h> | 36 | #include <linux/hidraw.h> |
| 38 | 37 | ||
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index fedd88df9a1..984feb351a5 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 32 | #include <linux/smp_lock.h> | ||
| 33 | #include <linux/input.h> | 32 | #include <linux/input.h> |
| 34 | #include <linux/usb.h> | 33 | #include <linux/usb.h> |
| 35 | #include <linux/hid.h> | 34 | #include <linux/hid.h> |
diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index fa9708c2d72..4033974d1bb 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | Copyright (C) 2009 T. Mertelj <tomaz.mertelj@guest.arnes.si> | 4 | Copyright (C) 2009 T. Mertelj <tomaz.mertelj@guest.arnes.si> |
| 5 | 5 | ||
| 6 | Based on max6650.c: | 6 | Based on max6650.c: |
| 7 | Copyright (C) 2007 Hans J. Koch <hjk@linutronix.de> | 7 | Copyright (C) 2007 Hans J. Koch <hjk@hansjkoch.de> |
| 8 | 8 | ||
| 9 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index 6669255aadc..c9ed14eba5a 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | Adapted to 2.6.20 by Carsten Emde <cbe@osadl.org> | 20 | Adapted to 2.6.20 by Carsten Emde <cbe@osadl.org> |
| 21 | Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab | 21 | Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab |
| 22 | 22 | ||
| 23 | Modified for mainline integration by Hans J. Koch <hjk@linutronix.de> | 23 | Modified for mainline integration by Hans J. Koch <hjk@hansjkoch.de> |
| 24 | Copyright (c) 2007 Hans J. Koch, Linutronix GmbH | 24 | Copyright (c) 2007 Hans J. Koch, Linutronix GmbH |
| 25 | 25 | ||
| 26 | This program is free software; you can redistribute it and/or modify | 26 | This program is free software; you can redistribute it and/or modify |
| @@ -2629,7 +2629,7 @@ static void __exit lm93_exit(void) | |||
| 2629 | } | 2629 | } |
| 2630 | 2630 | ||
| 2631 | MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>, " | 2631 | MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>, " |
| 2632 | "Hans J. Koch <hjk@linutronix.de"); | 2632 | "Hans J. Koch <hjk@hansjkoch.de>"); |
| 2633 | MODULE_DESCRIPTION("LM93 driver"); | 2633 | MODULE_DESCRIPTION("LM93 driver"); |
| 2634 | MODULE_LICENSE("GPL"); | 2634 | MODULE_LICENSE("GPL"); |
| 2635 | 2635 | ||
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index 464340f2549..4546d82f024 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c | |||
| @@ -128,9 +128,12 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr, | |||
| 128 | { | 128 | { |
| 129 | struct i2c_client *client = to_i2c_client(dev); | 129 | struct i2c_client *client = to_i2c_client(dev); |
| 130 | struct lm95241_data *data = i2c_get_clientdata(client); | 130 | struct lm95241_data *data = i2c_get_clientdata(client); |
| 131 | unsigned long val; | ||
| 131 | 132 | ||
| 132 | strict_strtol(buf, 10, &data->interval); | 133 | if (strict_strtoul(buf, 10, &val) < 0) |
| 133 | data->interval = data->interval * HZ / 1000; | 134 | return -EINVAL; |
| 135 | |||
| 136 | data->interval = val * HZ / 1000; | ||
| 134 | 137 | ||
| 135 | return count; | 138 | return count; |
| 136 | } | 139 | } |
| @@ -188,7 +191,9 @@ static ssize_t set_type##flag(struct device *dev, \ | |||
| 188 | struct lm95241_data *data = i2c_get_clientdata(client); \ | 191 | struct lm95241_data *data = i2c_get_clientdata(client); \ |
| 189 | \ | 192 | \ |
| 190 | long val; \ | 193 | long val; \ |
| 191 | strict_strtol(buf, 10, &val); \ | 194 | \ |
| 195 | if (strict_strtol(buf, 10, &val) < 0) \ | ||
| 196 | return -EINVAL; \ | ||
| 192 | \ | 197 | \ |
| 193 | if ((val == 1) || (val == 2)) { \ | 198 | if ((val == 1) || (val == 2)) { \ |
| 194 | \ | 199 | \ |
| @@ -227,7 +232,9 @@ static ssize_t set_min##flag(struct device *dev, \ | |||
| 227 | struct lm95241_data *data = i2c_get_clientdata(client); \ | 232 | struct lm95241_data *data = i2c_get_clientdata(client); \ |
| 228 | \ | 233 | \ |
| 229 | long val; \ | 234 | long val; \ |
| 230 | strict_strtol(buf, 10, &val); \ | 235 | \ |
| 236 | if (strict_strtol(buf, 10, &val) < 0) \ | ||
| 237 | return -EINVAL;\ | ||
| 231 | \ | 238 | \ |
| 232 | mutex_lock(&data->update_lock); \ | 239 | mutex_lock(&data->update_lock); \ |
| 233 | \ | 240 | \ |
| @@ -256,7 +263,9 @@ static ssize_t set_max##flag(struct device *dev, \ | |||
| 256 | struct lm95241_data *data = i2c_get_clientdata(client); \ | 263 | struct lm95241_data *data = i2c_get_clientdata(client); \ |
| 257 | \ | 264 | \ |
| 258 | long val; \ | 265 | long val; \ |
| 259 | strict_strtol(buf, 10, &val); \ | 266 | \ |
| 267 | if (strict_strtol(buf, 10, &val) < 0) \ | ||
| 268 | return -EINVAL; \ | ||
| 260 | \ | 269 | \ |
| 261 | mutex_lock(&data->update_lock); \ | 270 | mutex_lock(&data->update_lock); \ |
| 262 | \ | 271 | \ |
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index a0160ee5cae..9a11532ecae 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * max6650.c - Part of lm_sensors, Linux kernel modules for hardware | 2 | * max6650.c - Part of lm_sensors, Linux kernel modules for hardware |
| 3 | * monitoring. | 3 | * monitoring. |
| 4 | * | 4 | * |
| 5 | * (C) 2007 by Hans J. Koch <hjk@linutronix.de> | 5 | * (C) 2007 by Hans J. Koch <hjk@hansjkoch.de> |
| 6 | * | 6 | * |
| 7 | * based on code written by John Morris <john.morris@spirentcom.com> | 7 | * based on code written by John Morris <john.morris@spirentcom.com> |
| 8 | * Copyright (c) 2003 Spirent Communications | 8 | * Copyright (c) 2003 Spirent Communications |
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index 1d840aa8378..cdbc7448491 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c | |||
| @@ -165,10 +165,14 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = { | |||
| 165 | 165 | ||
| 166 | #define W83795_REG_VID_CTRL 0x6A | 166 | #define W83795_REG_VID_CTRL 0x6A |
| 167 | 167 | ||
| 168 | #define W83795_REG_ALARM_CTRL 0x40 | ||
| 169 | #define ALARM_CTRL_RTSACS (1 << 7) | ||
| 168 | #define W83795_REG_ALARM(index) (0x41 + (index)) | 170 | #define W83795_REG_ALARM(index) (0x41 + (index)) |
| 171 | #define W83795_REG_CLR_CHASSIS 0x4D | ||
| 169 | #define W83795_REG_BEEP(index) (0x50 + (index)) | 172 | #define W83795_REG_BEEP(index) (0x50 + (index)) |
| 170 | 173 | ||
| 171 | #define W83795_REG_CLR_CHASSIS 0x4D | 174 | #define W83795_REG_OVT_CFG 0x58 |
| 175 | #define OVT_CFG_SEL (1 << 7) | ||
| 172 | 176 | ||
| 173 | 177 | ||
| 174 | #define W83795_REG_FCMS1 0x201 | 178 | #define W83795_REG_FCMS1 0x201 |
| @@ -178,6 +182,14 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = { | |||
| 178 | 182 | ||
| 179 | #define W83795_REG_TSS(index) (0x209 + (index)) | 183 | #define W83795_REG_TSS(index) (0x209 + (index)) |
| 180 | 184 | ||
| 185 | #define TSS_MAP_RESERVED 0xff | ||
| 186 | static const u8 tss_map[4][6] = { | ||
| 187 | { 0, 1, 2, 3, 4, 5}, | ||
| 188 | { 6, 7, 8, 9, 0, 1}, | ||
| 189 | {10, 11, 12, 13, 2, 3}, | ||
| 190 | { 4, 5, 4, 5, TSS_MAP_RESERVED, TSS_MAP_RESERVED}, | ||
| 191 | }; | ||
| 192 | |||
| 181 | #define PWM_OUTPUT 0 | 193 | #define PWM_OUTPUT 0 |
| 182 | #define PWM_FREQ 1 | 194 | #define PWM_FREQ 1 |
| 183 | #define PWM_START 2 | 195 | #define PWM_START 2 |
| @@ -369,6 +381,7 @@ struct w83795_data { | |||
| 369 | u8 setup_pwm[3]; /* Register value */ | 381 | u8 setup_pwm[3]; /* Register value */ |
| 370 | 382 | ||
| 371 | u8 alarms[6]; /* Register value */ | 383 | u8 alarms[6]; /* Register value */ |
| 384 | u8 enable_beep; | ||
| 372 | u8 beeps[6]; /* Register value */ | 385 | u8 beeps[6]; /* Register value */ |
| 373 | 386 | ||
| 374 | char valid; | 387 | char valid; |
| @@ -499,8 +512,11 @@ static void w83795_update_limits(struct i2c_client *client) | |||
| 499 | } | 512 | } |
| 500 | 513 | ||
| 501 | /* Read beep settings */ | 514 | /* Read beep settings */ |
| 502 | for (i = 0; i < ARRAY_SIZE(data->beeps); i++) | 515 | if (data->enable_beep) { |
| 503 | data->beeps[i] = w83795_read(client, W83795_REG_BEEP(i)); | 516 | for (i = 0; i < ARRAY_SIZE(data->beeps); i++) |
| 517 | data->beeps[i] = | ||
| 518 | w83795_read(client, W83795_REG_BEEP(i)); | ||
| 519 | } | ||
| 504 | 520 | ||
| 505 | data->valid_limits = 1; | 521 | data->valid_limits = 1; |
| 506 | } | 522 | } |
| @@ -577,6 +593,7 @@ static struct w83795_data *w83795_update_device(struct device *dev) | |||
| 577 | struct i2c_client *client = to_i2c_client(dev); | 593 | struct i2c_client *client = to_i2c_client(dev); |
| 578 | struct w83795_data *data = i2c_get_clientdata(client); | 594 | struct w83795_data *data = i2c_get_clientdata(client); |
| 579 | u16 tmp; | 595 | u16 tmp; |
| 596 | u8 intrusion; | ||
| 580 | int i; | 597 | int i; |
| 581 | 598 | ||
| 582 | mutex_lock(&data->update_lock); | 599 | mutex_lock(&data->update_lock); |
| @@ -648,9 +665,24 @@ static struct w83795_data *w83795_update_device(struct device *dev) | |||
| 648 | w83795_read(client, W83795_REG_PWM(i, PWM_OUTPUT)); | 665 | w83795_read(client, W83795_REG_PWM(i, PWM_OUTPUT)); |
| 649 | } | 666 | } |
| 650 | 667 | ||
| 651 | /* update alarm */ | 668 | /* Update intrusion and alarms |
| 669 | * It is important to read intrusion first, because reading from | ||
| 670 | * register SMI STS6 clears the interrupt status temporarily. */ | ||
| 671 | tmp = w83795_read(client, W83795_REG_ALARM_CTRL); | ||
| 672 | /* Switch to interrupt status for intrusion if needed */ | ||
| 673 | if (tmp & ALARM_CTRL_RTSACS) | ||
| 674 | w83795_write(client, W83795_REG_ALARM_CTRL, | ||
| 675 | tmp & ~ALARM_CTRL_RTSACS); | ||
| 676 | intrusion = w83795_read(client, W83795_REG_ALARM(5)) & (1 << 6); | ||
| 677 | /* Switch to real-time alarms */ | ||
| 678 | w83795_write(client, W83795_REG_ALARM_CTRL, tmp | ALARM_CTRL_RTSACS); | ||
| 652 | for (i = 0; i < ARRAY_SIZE(data->alarms); i++) | 679 | for (i = 0; i < ARRAY_SIZE(data->alarms); i++) |
| 653 | data->alarms[i] = w83795_read(client, W83795_REG_ALARM(i)); | 680 | data->alarms[i] = w83795_read(client, W83795_REG_ALARM(i)); |
| 681 | data->alarms[5] |= intrusion; | ||
| 682 | /* Restore original configuration if needed */ | ||
| 683 | if (!(tmp & ALARM_CTRL_RTSACS)) | ||
| 684 | w83795_write(client, W83795_REG_ALARM_CTRL, | ||
| 685 | tmp & ~ALARM_CTRL_RTSACS); | ||
| 654 | 686 | ||
| 655 | data->last_updated = jiffies; | 687 | data->last_updated = jiffies; |
| 656 | data->valid = 1; | 688 | data->valid = 1; |
| @@ -730,6 +762,10 @@ store_chassis_clear(struct device *dev, | |||
| 730 | val = w83795_read(client, W83795_REG_CLR_CHASSIS); | 762 | val = w83795_read(client, W83795_REG_CLR_CHASSIS); |
| 731 | val |= 0x80; | 763 | val |= 0x80; |
| 732 | w83795_write(client, W83795_REG_CLR_CHASSIS, val); | 764 | w83795_write(client, W83795_REG_CLR_CHASSIS, val); |
| 765 | |||
| 766 | /* Clear status and force cache refresh */ | ||
| 767 | w83795_read(client, W83795_REG_ALARM(5)); | ||
| 768 | data->valid = 0; | ||
| 733 | mutex_unlock(&data->update_lock); | 769 | mutex_unlock(&data->update_lock); |
| 734 | return count; | 770 | return count; |
| 735 | } | 771 | } |
| @@ -857,20 +893,20 @@ show_pwm_enable(struct device *dev, struct device_attribute *attr, char *buf) | |||
| 857 | int index = sensor_attr->index; | 893 | int index = sensor_attr->index; |
| 858 | u8 tmp; | 894 | u8 tmp; |
| 859 | 895 | ||
| 860 | if (1 == (data->pwm_fcms[0] & (1 << index))) { | 896 | /* Speed cruise mode */ |
| 897 | if (data->pwm_fcms[0] & (1 << index)) { | ||
| 861 | tmp = 2; | 898 | tmp = 2; |
| 862 | goto out; | 899 | goto out; |
| 863 | } | 900 | } |
| 901 | /* Thermal cruise or SmartFan IV mode */ | ||
| 864 | for (tmp = 0; tmp < 6; tmp++) { | 902 | for (tmp = 0; tmp < 6; tmp++) { |
| 865 | if (data->pwm_tfmr[tmp] & (1 << index)) { | 903 | if (data->pwm_tfmr[tmp] & (1 << index)) { |
| 866 | tmp = 3; | 904 | tmp = 3; |
| 867 | goto out; | 905 | goto out; |
| 868 | } | 906 | } |
| 869 | } | 907 | } |
| 870 | if (data->pwm_fomc & (1 << index)) | 908 | /* Manual mode */ |
| 871 | tmp = 0; | 909 | tmp = 1; |
| 872 | else | ||
| 873 | tmp = 1; | ||
| 874 | 910 | ||
| 875 | out: | 911 | out: |
| 876 | return sprintf(buf, "%u\n", tmp); | 912 | return sprintf(buf, "%u\n", tmp); |
| @@ -890,23 +926,21 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr, | |||
| 890 | 926 | ||
| 891 | if (strict_strtoul(buf, 10, &val) < 0) | 927 | if (strict_strtoul(buf, 10, &val) < 0) |
| 892 | return -EINVAL; | 928 | return -EINVAL; |
| 893 | if (val > 2) | 929 | if (val < 1 || val > 2) |
| 894 | return -EINVAL; | 930 | return -EINVAL; |
| 895 | 931 | ||
| 896 | mutex_lock(&data->update_lock); | 932 | mutex_lock(&data->update_lock); |
| 897 | switch (val) { | 933 | switch (val) { |
| 898 | case 0: | ||
| 899 | case 1: | 934 | case 1: |
| 935 | /* Clear speed cruise mode bits */ | ||
| 900 | data->pwm_fcms[0] &= ~(1 << index); | 936 | data->pwm_fcms[0] &= ~(1 << index); |
| 901 | w83795_write(client, W83795_REG_FCMS1, data->pwm_fcms[0]); | 937 | w83795_write(client, W83795_REG_FCMS1, data->pwm_fcms[0]); |
| 938 | /* Clear thermal cruise mode bits */ | ||
| 902 | for (i = 0; i < 6; i++) { | 939 | for (i = 0; i < 6; i++) { |
| 903 | data->pwm_tfmr[i] &= ~(1 << index); | 940 | data->pwm_tfmr[i] &= ~(1 << index); |
| 904 | w83795_write(client, W83795_REG_TFMR(i), | 941 | w83795_write(client, W83795_REG_TFMR(i), |
| 905 | data->pwm_tfmr[i]); | 942 | data->pwm_tfmr[i]); |
| 906 | } | 943 | } |
| 907 | data->pwm_fomc |= 1 << index; | ||
| 908 | data->pwm_fomc ^= val << index; | ||
| 909 | w83795_write(client, W83795_REG_FOMC, data->pwm_fomc); | ||
| 910 | break; | 944 | break; |
| 911 | case 2: | 945 | case 2: |
| 912 | data->pwm_fcms[0] |= (1 << index); | 946 | data->pwm_fcms[0] |= (1 << index); |
| @@ -918,23 +952,60 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr, | |||
| 918 | } | 952 | } |
| 919 | 953 | ||
| 920 | static ssize_t | 954 | static ssize_t |
| 955 | show_pwm_mode(struct device *dev, struct device_attribute *attr, char *buf) | ||
| 956 | { | ||
| 957 | struct w83795_data *data = w83795_update_pwm_config(dev); | ||
| 958 | int index = to_sensor_dev_attr_2(attr)->index; | ||
| 959 | unsigned int mode; | ||
| 960 | |||
| 961 | if (data->pwm_fomc & (1 << index)) | ||
| 962 | mode = 0; /* DC */ | ||
| 963 | else | ||
| 964 | mode = 1; /* PWM */ | ||
| 965 | |||
| 966 | return sprintf(buf, "%u\n", mode); | ||
| 967 | } | ||
| 968 | |||
| 969 | /* | ||
| 970 | * Check whether a given temperature source can ever be useful. | ||
| 971 | * Returns the number of selectable temperature channels which are | ||
| 972 | * enabled. | ||
| 973 | */ | ||
| 974 | static int w83795_tss_useful(const struct w83795_data *data, int tsrc) | ||
| 975 | { | ||
| 976 | int useful = 0, i; | ||
| 977 | |||
| 978 | for (i = 0; i < 4; i++) { | ||
| 979 | if (tss_map[i][tsrc] == TSS_MAP_RESERVED) | ||
| 980 | continue; | ||
| 981 | if (tss_map[i][tsrc] < 6) /* Analog */ | ||
| 982 | useful += (data->has_temp >> tss_map[i][tsrc]) & 1; | ||
| 983 | else /* Digital */ | ||
| 984 | useful += (data->has_dts >> (tss_map[i][tsrc] - 6)) & 1; | ||
| 985 | } | ||
| 986 | |||
| 987 | return useful; | ||
| 988 | } | ||
| 989 | |||
| 990 | static ssize_t | ||
| 921 | show_temp_src(struct device *dev, struct device_attribute *attr, char *buf) | 991 | show_temp_src(struct device *dev, struct device_attribute *attr, char *buf) |
| 922 | { | 992 | { |
| 923 | struct sensor_device_attribute_2 *sensor_attr = | 993 | struct sensor_device_attribute_2 *sensor_attr = |
| 924 | to_sensor_dev_attr_2(attr); | 994 | to_sensor_dev_attr_2(attr); |
| 925 | struct w83795_data *data = w83795_update_pwm_config(dev); | 995 | struct w83795_data *data = w83795_update_pwm_config(dev); |
| 926 | int index = sensor_attr->index; | 996 | int index = sensor_attr->index; |
| 927 | u8 val = index / 2; | 997 | u8 tmp = data->temp_src[index / 2]; |
| 928 | u8 tmp = data->temp_src[val]; | ||
| 929 | 998 | ||
| 930 | if (index & 1) | 999 | if (index & 1) |
| 931 | val = 4; | 1000 | tmp >>= 4; /* Pick high nibble */ |
| 932 | else | 1001 | else |
| 933 | val = 0; | 1002 | tmp &= 0x0f; /* Pick low nibble */ |
| 934 | tmp >>= val; | ||
| 935 | tmp &= 0x0f; | ||
| 936 | 1003 | ||
| 937 | return sprintf(buf, "%u\n", tmp); | 1004 | /* Look-up the actual temperature channel number */ |
| 1005 | if (tmp >= 4 || tss_map[tmp][index] == TSS_MAP_RESERVED) | ||
| 1006 | return -EINVAL; /* Shouldn't happen */ | ||
| 1007 | |||
| 1008 | return sprintf(buf, "%u\n", (unsigned int)tss_map[tmp][index] + 1); | ||
| 938 | } | 1009 | } |
| 939 | 1010 | ||
| 940 | static ssize_t | 1011 | static ssize_t |
| @@ -946,12 +1017,21 @@ store_temp_src(struct device *dev, struct device_attribute *attr, | |||
| 946 | struct sensor_device_attribute_2 *sensor_attr = | 1017 | struct sensor_device_attribute_2 *sensor_attr = |
| 947 | to_sensor_dev_attr_2(attr); | 1018 | to_sensor_dev_attr_2(attr); |
| 948 | int index = sensor_attr->index; | 1019 | int index = sensor_attr->index; |
| 949 | unsigned long tmp; | 1020 | int tmp; |
| 1021 | unsigned long channel; | ||
| 950 | u8 val = index / 2; | 1022 | u8 val = index / 2; |
| 951 | 1023 | ||
| 952 | if (strict_strtoul(buf, 10, &tmp) < 0) | 1024 | if (strict_strtoul(buf, 10, &channel) < 0 || |
| 1025 | channel < 1 || channel > 14) | ||
| 1026 | return -EINVAL; | ||
| 1027 | |||
| 1028 | /* Check if request can be fulfilled */ | ||
| 1029 | for (tmp = 0; tmp < 4; tmp++) { | ||
| 1030 | if (tss_map[tmp][index] == channel - 1) | ||
| 1031 | break; | ||
| 1032 | } | ||
| 1033 | if (tmp == 4) /* No match */ | ||
| 953 | return -EINVAL; | 1034 | return -EINVAL; |
| 954 | tmp = SENSORS_LIMIT(tmp, 0, 15); | ||
| 955 | 1035 | ||
| 956 | mutex_lock(&data->update_lock); | 1036 | mutex_lock(&data->update_lock); |
| 957 | if (index & 1) { | 1037 | if (index & 1) { |
| @@ -1515,7 +1595,7 @@ store_sf_setup(struct device *dev, struct device_attribute *attr, | |||
| 1515 | 1595 | ||
| 1516 | #define NOT_USED -1 | 1596 | #define NOT_USED -1 |
| 1517 | 1597 | ||
| 1518 | /* Don't change the attribute order, _max and _min are accessed by index | 1598 | /* Don't change the attribute order, _max, _min and _beep are accessed by index |
| 1519 | * somewhere else in the code */ | 1599 | * somewhere else in the code */ |
| 1520 | #define SENSOR_ATTR_IN(index) { \ | 1600 | #define SENSOR_ATTR_IN(index) { \ |
| 1521 | SENSOR_ATTR_2(in##index##_input, S_IRUGO, show_in, NULL, \ | 1601 | SENSOR_ATTR_2(in##index##_input, S_IRUGO, show_in, NULL, \ |
| @@ -1530,6 +1610,8 @@ store_sf_setup(struct device *dev, struct device_attribute *attr, | |||
| 1530 | show_alarm_beep, store_beep, BEEP_ENABLE, \ | 1610 | show_alarm_beep, store_beep, BEEP_ENABLE, \ |
| 1531 | index + ((index > 14) ? 1 : 0)) } | 1611 | index + ((index > 14) ? 1 : 0)) } |
| 1532 | 1612 | ||
| 1613 | /* Don't change the attribute order, _beep is accessed by index | ||
| 1614 | * somewhere else in the code */ | ||
| 1533 | #define SENSOR_ATTR_FAN(index) { \ | 1615 | #define SENSOR_ATTR_FAN(index) { \ |
| 1534 | SENSOR_ATTR_2(fan##index##_input, S_IRUGO, show_fan, \ | 1616 | SENSOR_ATTR_2(fan##index##_input, S_IRUGO, show_fan, \ |
| 1535 | NULL, FAN_INPUT, index - 1), \ | 1617 | NULL, FAN_INPUT, index - 1), \ |
| @@ -1553,9 +1635,13 @@ store_sf_setup(struct device *dev, struct device_attribute *attr, | |||
| 1553 | show_pwm, store_pwm, PWM_FREQ, index - 1), \ | 1635 | show_pwm, store_pwm, PWM_FREQ, index - 1), \ |
| 1554 | SENSOR_ATTR_2(pwm##index##_enable, S_IWUSR | S_IRUGO, \ | 1636 | SENSOR_ATTR_2(pwm##index##_enable, S_IWUSR | S_IRUGO, \ |
| 1555 | show_pwm_enable, store_pwm_enable, NOT_USED, index - 1), \ | 1637 | show_pwm_enable, store_pwm_enable, NOT_USED, index - 1), \ |
| 1638 | SENSOR_ATTR_2(pwm##index##_mode, S_IRUGO, \ | ||
| 1639 | show_pwm_mode, NULL, NOT_USED, index - 1), \ | ||
| 1556 | SENSOR_ATTR_2(fan##index##_target, S_IWUSR | S_IRUGO, \ | 1640 | SENSOR_ATTR_2(fan##index##_target, S_IWUSR | S_IRUGO, \ |
| 1557 | show_fanin, store_fanin, FANIN_TARGET, index - 1) } | 1641 | show_fanin, store_fanin, FANIN_TARGET, index - 1) } |
| 1558 | 1642 | ||
| 1643 | /* Don't change the attribute order, _beep is accessed by index | ||
| 1644 | * somewhere else in the code */ | ||
| 1559 | #define SENSOR_ATTR_DTS(index) { \ | 1645 | #define SENSOR_ATTR_DTS(index) { \ |
| 1560 | SENSOR_ATTR_2(temp##index##_type, S_IRUGO , \ | 1646 | SENSOR_ATTR_2(temp##index##_type, S_IRUGO , \ |
| 1561 | show_dts_mode, NULL, NOT_USED, index - 7), \ | 1647 | show_dts_mode, NULL, NOT_USED, index - 7), \ |
| @@ -1574,6 +1660,8 @@ store_sf_setup(struct device *dev, struct device_attribute *attr, | |||
| 1574 | SENSOR_ATTR_2(temp##index##_beep, S_IWUSR | S_IRUGO, \ | 1660 | SENSOR_ATTR_2(temp##index##_beep, S_IWUSR | S_IRUGO, \ |
| 1575 | show_alarm_beep, store_beep, BEEP_ENABLE, index + 17) } | 1661 | show_alarm_beep, store_beep, BEEP_ENABLE, index + 17) } |
| 1576 | 1662 | ||
| 1663 | /* Don't change the attribute order, _beep is accessed by index | ||
| 1664 | * somewhere else in the code */ | ||
| 1577 | #define SENSOR_ATTR_TEMP(index) { \ | 1665 | #define SENSOR_ATTR_TEMP(index) { \ |
| 1578 | SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 4 ? S_IWUSR : 0), \ | 1666 | SENSOR_ATTR_2(temp##index##_type, S_IRUGO | (index < 4 ? S_IWUSR : 0), \ |
| 1579 | show_temp_mode, store_temp_mode, NOT_USED, index - 1), \ | 1667 | show_temp_mode, store_temp_mode, NOT_USED, index - 1), \ |
| @@ -1593,8 +1681,6 @@ store_sf_setup(struct device *dev, struct device_attribute *attr, | |||
| 1593 | SENSOR_ATTR_2(temp##index##_beep, S_IWUSR | S_IRUGO, \ | 1681 | SENSOR_ATTR_2(temp##index##_beep, S_IWUSR | S_IRUGO, \ |
| 1594 | show_alarm_beep, store_beep, BEEP_ENABLE, \ | 1682 | show_alarm_beep, store_beep, BEEP_ENABLE, \ |
| 1595 | index + (index > 4 ? 11 : 17)), \ | 1683 | index + (index > 4 ? 11 : 17)), \ |
| 1596 | SENSOR_ATTR_2(temp##index##_source_sel, S_IWUSR | S_IRUGO, \ | ||
| 1597 | show_temp_src, store_temp_src, NOT_USED, index - 1), \ | ||
| 1598 | SENSOR_ATTR_2(temp##index##_pwm_enable, S_IWUSR | S_IRUGO, \ | 1684 | SENSOR_ATTR_2(temp##index##_pwm_enable, S_IWUSR | S_IRUGO, \ |
| 1599 | show_temp_pwm_enable, store_temp_pwm_enable, \ | 1685 | show_temp_pwm_enable, store_temp_pwm_enable, \ |
| 1600 | TEMP_PWM_ENABLE, index - 1), \ | 1686 | TEMP_PWM_ENABLE, index - 1), \ |
| @@ -1680,7 +1766,7 @@ static const struct sensor_device_attribute_2 w83795_fan[][4] = { | |||
| 1680 | SENSOR_ATTR_FAN(14), | 1766 | SENSOR_ATTR_FAN(14), |
| 1681 | }; | 1767 | }; |
| 1682 | 1768 | ||
| 1683 | static const struct sensor_device_attribute_2 w83795_temp[][29] = { | 1769 | static const struct sensor_device_attribute_2 w83795_temp[][28] = { |
| 1684 | SENSOR_ATTR_TEMP(1), | 1770 | SENSOR_ATTR_TEMP(1), |
| 1685 | SENSOR_ATTR_TEMP(2), | 1771 | SENSOR_ATTR_TEMP(2), |
| 1686 | SENSOR_ATTR_TEMP(3), | 1772 | SENSOR_ATTR_TEMP(3), |
| @@ -1700,7 +1786,7 @@ static const struct sensor_device_attribute_2 w83795_dts[][8] = { | |||
| 1700 | SENSOR_ATTR_DTS(14), | 1786 | SENSOR_ATTR_DTS(14), |
| 1701 | }; | 1787 | }; |
| 1702 | 1788 | ||
| 1703 | static const struct sensor_device_attribute_2 w83795_pwm[][7] = { | 1789 | static const struct sensor_device_attribute_2 w83795_pwm[][8] = { |
| 1704 | SENSOR_ATTR_PWM(1), | 1790 | SENSOR_ATTR_PWM(1), |
| 1705 | SENSOR_ATTR_PWM(2), | 1791 | SENSOR_ATTR_PWM(2), |
| 1706 | SENSOR_ATTR_PWM(3), | 1792 | SENSOR_ATTR_PWM(3), |
| @@ -1711,13 +1797,24 @@ static const struct sensor_device_attribute_2 w83795_pwm[][7] = { | |||
| 1711 | SENSOR_ATTR_PWM(8), | 1797 | SENSOR_ATTR_PWM(8), |
| 1712 | }; | 1798 | }; |
| 1713 | 1799 | ||
| 1800 | static const struct sensor_device_attribute_2 w83795_tss[6] = { | ||
| 1801 | SENSOR_ATTR_2(temp1_source_sel, S_IWUSR | S_IRUGO, | ||
| 1802 | show_temp_src, store_temp_src, NOT_USED, 0), | ||
| 1803 | SENSOR_ATTR_2(temp2_source_sel, S_IWUSR | S_IRUGO, | ||
| 1804 | show_temp_src, store_temp_src, NOT_USED, 1), | ||
| 1805 | SENSOR_ATTR_2(temp3_source_sel, S_IWUSR | S_IRUGO, | ||
| 1806 | show_temp_src, store_temp_src, NOT_USED, 2), | ||
| 1807 | SENSOR_ATTR_2(temp4_source_sel, S_IWUSR | S_IRUGO, | ||
| 1808 | show_temp_src, store_temp_src, NOT_USED, 3), | ||
| 1809 | SENSOR_ATTR_2(temp5_source_sel, S_IWUSR | S_IRUGO, | ||
| 1810 | show_temp_src, store_temp_src, NOT_USED, 4), | ||
| 1811 | SENSOR_ATTR_2(temp6_source_sel, S_IWUSR | S_IRUGO, | ||
| 1812 | show_temp_src, store_temp_src, NOT_USED, 5), | ||
| 1813 | }; | ||
| 1814 | |||
| 1714 | static const struct sensor_device_attribute_2 sda_single_files[] = { | 1815 | static const struct sensor_device_attribute_2 sda_single_files[] = { |
| 1715 | SENSOR_ATTR_2(intrusion0_alarm, S_IWUSR | S_IRUGO, show_alarm_beep, | 1816 | SENSOR_ATTR_2(intrusion0_alarm, S_IWUSR | S_IRUGO, show_alarm_beep, |
| 1716 | store_chassis_clear, ALARM_STATUS, 46), | 1817 | store_chassis_clear, ALARM_STATUS, 46), |
| 1717 | SENSOR_ATTR_2(intrusion0_beep, S_IWUSR | S_IRUGO, show_alarm_beep, | ||
| 1718 | store_beep, BEEP_ENABLE, 46), | ||
| 1719 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep, | ||
| 1720 | store_beep, BEEP_ENABLE, 47), | ||
| 1721 | #ifdef CONFIG_SENSORS_W83795_FANCTRL | 1818 | #ifdef CONFIG_SENSORS_W83795_FANCTRL |
| 1722 | SENSOR_ATTR_2(speed_cruise_tolerance, S_IWUSR | S_IRUGO, show_fanin, | 1819 | SENSOR_ATTR_2(speed_cruise_tolerance, S_IWUSR | S_IRUGO, show_fanin, |
| 1723 | store_fanin, FANIN_TOL, NOT_USED), | 1820 | store_fanin, FANIN_TOL, NOT_USED), |
| @@ -1730,6 +1827,13 @@ static const struct sensor_device_attribute_2 sda_single_files[] = { | |||
| 1730 | #endif | 1827 | #endif |
| 1731 | }; | 1828 | }; |
| 1732 | 1829 | ||
| 1830 | static const struct sensor_device_attribute_2 sda_beep_files[] = { | ||
| 1831 | SENSOR_ATTR_2(intrusion0_beep, S_IWUSR | S_IRUGO, show_alarm_beep, | ||
| 1832 | store_beep, BEEP_ENABLE, 46), | ||
| 1833 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_alarm_beep, | ||
| 1834 | store_beep, BEEP_ENABLE, 47), | ||
| 1835 | }; | ||
| 1836 | |||
| 1733 | /* | 1837 | /* |
| 1734 | * Driver interface | 1838 | * Driver interface |
| 1735 | */ | 1839 | */ |
| @@ -1859,6 +1963,8 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *, | |||
| 1859 | if (!(data->has_in & (1 << i))) | 1963 | if (!(data->has_in & (1 << i))) |
| 1860 | continue; | 1964 | continue; |
| 1861 | for (j = 0; j < ARRAY_SIZE(w83795_in[0]); j++) { | 1965 | for (j = 0; j < ARRAY_SIZE(w83795_in[0]); j++) { |
| 1966 | if (j == 4 && !data->enable_beep) | ||
| 1967 | continue; | ||
| 1862 | err = fn(dev, &w83795_in[i][j].dev_attr); | 1968 | err = fn(dev, &w83795_in[i][j].dev_attr); |
| 1863 | if (err) | 1969 | if (err) |
| 1864 | return err; | 1970 | return err; |
| @@ -1869,18 +1975,37 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *, | |||
| 1869 | if (!(data->has_fan & (1 << i))) | 1975 | if (!(data->has_fan & (1 << i))) |
| 1870 | continue; | 1976 | continue; |
| 1871 | for (j = 0; j < ARRAY_SIZE(w83795_fan[0]); j++) { | 1977 | for (j = 0; j < ARRAY_SIZE(w83795_fan[0]); j++) { |
| 1978 | if (j == 3 && !data->enable_beep) | ||
| 1979 | continue; | ||
| 1872 | err = fn(dev, &w83795_fan[i][j].dev_attr); | 1980 | err = fn(dev, &w83795_fan[i][j].dev_attr); |
| 1873 | if (err) | 1981 | if (err) |
| 1874 | return err; | 1982 | return err; |
| 1875 | } | 1983 | } |
| 1876 | } | 1984 | } |
| 1877 | 1985 | ||
| 1986 | for (i = 0; i < ARRAY_SIZE(w83795_tss); i++) { | ||
| 1987 | j = w83795_tss_useful(data, i); | ||
| 1988 | if (!j) | ||
| 1989 | continue; | ||
| 1990 | err = fn(dev, &w83795_tss[i].dev_attr); | ||
| 1991 | if (err) | ||
| 1992 | return err; | ||
| 1993 | } | ||
| 1994 | |||
| 1878 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) { | 1995 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) { |
| 1879 | err = fn(dev, &sda_single_files[i].dev_attr); | 1996 | err = fn(dev, &sda_single_files[i].dev_attr); |
| 1880 | if (err) | 1997 | if (err) |
| 1881 | return err; | 1998 | return err; |
| 1882 | } | 1999 | } |
| 1883 | 2000 | ||
| 2001 | if (data->enable_beep) { | ||
| 2002 | for (i = 0; i < ARRAY_SIZE(sda_beep_files); i++) { | ||
| 2003 | err = fn(dev, &sda_beep_files[i].dev_attr); | ||
| 2004 | if (err) | ||
| 2005 | return err; | ||
| 2006 | } | ||
| 2007 | } | ||
| 2008 | |||
| 1884 | #ifdef CONFIG_SENSORS_W83795_FANCTRL | 2009 | #ifdef CONFIG_SENSORS_W83795_FANCTRL |
| 1885 | for (i = 0; i < data->has_pwm; i++) { | 2010 | for (i = 0; i < data->has_pwm; i++) { |
| 1886 | for (j = 0; j < ARRAY_SIZE(w83795_pwm[0]); j++) { | 2011 | for (j = 0; j < ARRAY_SIZE(w83795_pwm[0]); j++) { |
| @@ -1899,6 +2024,8 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *, | |||
| 1899 | #else | 2024 | #else |
| 1900 | for (j = 0; j < 8; j++) { | 2025 | for (j = 0; j < 8; j++) { |
| 1901 | #endif | 2026 | #endif |
| 2027 | if (j == 7 && !data->enable_beep) | ||
| 2028 | continue; | ||
| 1902 | err = fn(dev, &w83795_temp[i][j].dev_attr); | 2029 | err = fn(dev, &w83795_temp[i][j].dev_attr); |
| 1903 | if (err) | 2030 | if (err) |
| 1904 | return err; | 2031 | return err; |
| @@ -1910,6 +2037,8 @@ static int w83795_handle_files(struct device *dev, int (*fn)(struct device *, | |||
| 1910 | if (!(data->has_dts & (1 << i))) | 2037 | if (!(data->has_dts & (1 << i))) |
| 1911 | continue; | 2038 | continue; |
| 1912 | for (j = 0; j < ARRAY_SIZE(w83795_dts[0]); j++) { | 2039 | for (j = 0; j < ARRAY_SIZE(w83795_dts[0]); j++) { |
| 2040 | if (j == 7 && !data->enable_beep) | ||
| 2041 | continue; | ||
| 1913 | err = fn(dev, &w83795_dts[i][j].dev_attr); | 2042 | err = fn(dev, &w83795_dts[i][j].dev_attr); |
| 1914 | if (err) | 2043 | if (err) |
| 1915 | return err; | 2044 | return err; |
| @@ -2049,6 +2178,18 @@ static int w83795_probe(struct i2c_client *client, | |||
| 2049 | else | 2178 | else |
| 2050 | data->has_pwm = 2; | 2179 | data->has_pwm = 2; |
| 2051 | 2180 | ||
| 2181 | /* Check if BEEP pin is available */ | ||
| 2182 | if (data->chip_type == w83795g) { | ||
| 2183 | /* The W83795G has a dedicated BEEP pin */ | ||
| 2184 | data->enable_beep = 1; | ||
| 2185 | } else { | ||
| 2186 | /* The W83795ADG has a shared pin for OVT# and BEEP, so you | ||
| 2187 | * can't have both */ | ||
| 2188 | tmp = w83795_read(client, W83795_REG_OVT_CFG); | ||
| 2189 | if ((tmp & OVT_CFG_SEL) == 0) | ||
| 2190 | data->enable_beep = 1; | ||
| 2191 | } | ||
| 2192 | |||
| 2052 | err = w83795_handle_files(dev, device_create_file); | 2193 | err = w83795_handle_files(dev, device_create_file); |
| 2053 | if (err) | 2194 | if (err) |
| 2054 | goto exit_remove; | 2195 | goto exit_remove; |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index d231f683f57..6b4cc567645 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -848,6 +848,18 @@ static int i2c_register_adapter(struct i2c_adapter *adap) | |||
| 848 | goto out_list; | 848 | goto out_list; |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | /* Sanity checks */ | ||
| 852 | if (unlikely(adap->name[0] == '\0')) { | ||
| 853 | pr_err("i2c-core: Attempt to register an adapter with " | ||
| 854 | "no name!\n"); | ||
| 855 | return -EINVAL; | ||
| 856 | } | ||
| 857 | if (unlikely(!adap->algo)) { | ||
| 858 | pr_err("i2c-core: Attempt to register adapter '%s' with " | ||
| 859 | "no algo!\n", adap->name); | ||
| 860 | return -EINVAL; | ||
| 861 | } | ||
| 862 | |||
| 851 | rt_mutex_init(&adap->bus_lock); | 863 | rt_mutex_init(&adap->bus_lock); |
| 852 | mutex_init(&adap->userspace_clients_lock); | 864 | mutex_init(&adap->userspace_clients_lock); |
| 853 | INIT_LIST_HEAD(&adap->userspace_clients); | 865 | INIT_LIST_HEAD(&adap->userspace_clients); |
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index d32a4843fc3..d7a4833be41 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c | |||
| @@ -120,7 +120,6 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, | |||
| 120 | snprintf(priv->adap.name, sizeof(priv->adap.name), | 120 | snprintf(priv->adap.name, sizeof(priv->adap.name), |
| 121 | "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); | 121 | "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); |
| 122 | priv->adap.owner = THIS_MODULE; | 122 | priv->adap.owner = THIS_MODULE; |
| 123 | priv->adap.id = parent->id; | ||
| 124 | priv->adap.algo = &priv->algo; | 123 | priv->adap.algo = &priv->algo; |
| 125 | priv->adap.algo_data = priv; | 124 | priv->adap.algo_data = priv; |
| 126 | priv->adap.dev.parent = &parent->dev; | 125 | priv->adap.dev.parent = &parent->dev; |
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index 6078992da3f..9292a15ad7c 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
| @@ -40,7 +40,6 @@ | |||
| 40 | #include <linux/highmem.h> | 40 | #include <linux/highmem.h> |
| 41 | #include <linux/io.h> | 41 | #include <linux/io.h> |
| 42 | #include <linux/jiffies.h> | 42 | #include <linux/jiffies.h> |
| 43 | #include <linux/smp_lock.h> | ||
| 44 | #include <asm/pgtable.h> | 43 | #include <asm/pgtable.h> |
| 45 | 44 | ||
| 46 | #include "ipath_kernel.h" | 45 | #include "ipath_kernel.h" |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index cfc1d65c457..1e1e347a771 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
| @@ -1123,7 +1123,7 @@ static void srp_send_completion(struct ib_cq *cq, void *target_ptr) | |||
| 1123 | } | 1123 | } |
| 1124 | } | 1124 | } |
| 1125 | 1125 | ||
| 1126 | static int srp_queuecommand(struct scsi_cmnd *scmnd, | 1126 | static int srp_queuecommand_lck(struct scsi_cmnd *scmnd, |
| 1127 | void (*done)(struct scsi_cmnd *)) | 1127 | void (*done)(struct scsi_cmnd *)) |
| 1128 | { | 1128 | { |
| 1129 | struct srp_target_port *target = host_to_target(scmnd->device->host); | 1129 | struct srp_target_port *target = host_to_target(scmnd->device->host); |
| @@ -1196,6 +1196,8 @@ err: | |||
| 1196 | return SCSI_MLQUEUE_HOST_BUSY; | 1196 | return SCSI_MLQUEUE_HOST_BUSY; |
| 1197 | } | 1197 | } |
| 1198 | 1198 | ||
| 1199 | static DEF_SCSI_QCMD(srp_queuecommand) | ||
| 1200 | |||
| 1199 | static int srp_alloc_iu_bufs(struct srp_target_port *target) | 1201 | static int srp_alloc_iu_bufs(struct srp_target_port *target) |
| 1200 | { | 1202 | { |
| 1201 | int i; | 1203 | int i; |
diff --git a/drivers/input/input.c b/drivers/input/input.c index 7f26ca6ecf7..90b7ecfb625 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
| 25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
| 26 | #include <linux/rcupdate.h> | 26 | #include <linux/rcupdate.h> |
| 27 | #include <linux/smp_lock.h> | ||
| 28 | #include "input-compat.h" | 27 | #include "input-compat.h" |
| 29 | 28 | ||
| 30 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); | 29 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>"); |
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index cd82bb12591..b7ba4597f7f 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
| 14 | #include <linux/smp_lock.h> | ||
| 15 | #include <linux/poll.h> | 14 | #include <linux/poll.h> |
| 16 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 17 | #include <linux/serio.h> | 16 | #include <linux/serio.h> |
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c index 3d88542612e..74ee172b5bc 100644 --- a/drivers/media/common/saa7146_i2c.c +++ b/drivers/media/common/saa7146_i2c.c | |||
| @@ -391,7 +391,6 @@ static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, in | |||
| 391 | 391 | ||
| 392 | /*****************************************************************************/ | 392 | /*****************************************************************************/ |
| 393 | /* i2c-adapter helper functions */ | 393 | /* i2c-adapter helper functions */ |
| 394 | #include <linux/i2c-id.h> | ||
| 395 | 394 | ||
| 396 | /* exported algorithm data */ | 395 | /* exported algorithm data */ |
| 397 | static struct i2c_algorithm saa7146_algo = { | 396 | static struct i2c_algorithm saa7146_algo = { |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 4d0646da608..7ea517b7e18 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
| 37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
| 38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
| 39 | #include <linux/smp_lock.h> | ||
| 40 | #include <linux/kthread.h> | 39 | #include <linux/kthread.h> |
| 41 | 40 | ||
| 42 | #include "dvb_ca_en50221.h" | 41 | #include "dvb_ca_en50221.h" |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 1589d5a5cb4..cad6634610e 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | #include <linux/list.h> | 36 | #include <linux/list.h> |
| 37 | #include <linux/freezer.h> | 37 | #include <linux/freezer.h> |
| 38 | #include <linux/jiffies.h> | 38 | #include <linux/jiffies.h> |
| 39 | #include <linux/smp_lock.h> | ||
| 40 | #include <linux/kthread.h> | 39 | #include <linux/kthread.h> |
| 41 | #include <asm/processor.h> | 40 | #include <asm/processor.h> |
| 42 | 41 | ||
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index 4caeb163a66..3a7ef71087b 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | #include <linux/io.h> | 34 | #include <linux/io.h> |
| 35 | #include <asm/div64.h> | 35 | #include <asm/div64.h> |
| 36 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
| 37 | #include <linux/smp_lock.h> | ||
| 38 | #include <linux/timer.h> | 37 | #include <linux/timer.h> |
| 39 | #include <linux/byteorder/generic.h> | 38 | #include <linux/byteorder/generic.h> |
| 40 | #include <linux/firmware.h> | 39 | #include <linux/firmware.h> |
diff --git a/drivers/media/dvb/ngene/ngene-dvb.c b/drivers/media/dvb/ngene/ngene-dvb.c index 48f980b21d6..3832e5983c1 100644 --- a/drivers/media/dvb/ngene/ngene-dvb.c +++ b/drivers/media/dvb/ngene/ngene-dvb.c | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | #include <linux/io.h> | 35 | #include <linux/io.h> |
| 36 | #include <asm/div64.h> | 36 | #include <asm/div64.h> |
| 37 | #include <linux/pci.h> | 37 | #include <linux/pci.h> |
| 38 | #include <linux/smp_lock.h> | ||
| 39 | #include <linux/timer.h> | 38 | #include <linux/timer.h> |
| 40 | #include <linux/byteorder/generic.h> | 39 | #include <linux/byteorder/generic.h> |
| 41 | #include <linux/firmware.h> | 40 | #include <linux/firmware.h> |
diff --git a/drivers/media/dvb/ngene/ngene-i2c.c b/drivers/media/dvb/ngene/ngene-i2c.c index c3ae956714e..d28554f8ce9 100644 --- a/drivers/media/dvb/ngene/ngene-i2c.c +++ b/drivers/media/dvb/ngene/ngene-i2c.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <asm/div64.h> | 37 | #include <asm/div64.h> |
| 38 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
| 39 | #include <linux/pci_ids.h> | 39 | #include <linux/pci_ids.h> |
| 40 | #include <linux/smp_lock.h> | ||
| 41 | #include <linux/timer.h> | 40 | #include <linux/timer.h> |
| 42 | #include <linux/byteorder/generic.h> | 41 | #include <linux/byteorder/generic.h> |
| 43 | #include <linux/firmware.h> | 42 | #include <linux/firmware.h> |
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index b540e8072e9..e6b2d085a44 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
| @@ -58,7 +58,6 @@ | |||
| 58 | #include <linux/module.h> | 58 | #include <linux/module.h> |
| 59 | #include <linux/init.h> | 59 | #include <linux/init.h> |
| 60 | #include <linux/slab.h> | 60 | #include <linux/slab.h> |
| 61 | #include <linux/smp_lock.h> | ||
| 62 | #include <linux/input.h> | 61 | #include <linux/input.h> |
| 63 | #include <linux/videodev2.h> | 62 | #include <linux/videodev2.h> |
| 64 | #include <media/v4l2-device.h> | 63 | #include <media/v4l2-device.h> |
diff --git a/drivers/media/radio/si470x/radio-si470x.h b/drivers/media/radio/si470x/radio-si470x.h index ea12782359a..b9914d7a0c9 100644 --- a/drivers/media/radio/si470x/radio-si470x.h +++ b/drivers/media/radio/si470x/radio-si470x.h | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 32 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
| 33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
| 34 | #include <linux/smp_lock.h> | ||
| 35 | #include <linux/input.h> | 34 | #include <linux/input.h> |
| 36 | #include <linux/version.h> | 35 | #include <linux/version.h> |
| 37 | #include <linux/videodev2.h> | 36 | #include <linux/videodev2.h> |
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 3da6e80e104..a529619e51f 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | #include <linux/fs.h> | 42 | #include <linux/fs.h> |
| 43 | #include <linux/kernel.h> | 43 | #include <linux/kernel.h> |
| 44 | #include <linux/sched.h> | 44 | #include <linux/sched.h> |
| 45 | #include <linux/smp_lock.h> | ||
| 46 | #include <linux/interrupt.h> | 45 | #include <linux/interrupt.h> |
| 47 | #include <linux/kdev_t.h> | 46 | #include <linux/kdev_t.h> |
| 48 | #include "bttvp.h" | 47 | #include "bttvp.h" |
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index 417d1d5c73c..d7c94848249 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
| 34 | #include <linux/device.h> | 34 | #include <linux/device.h> |
| 35 | #include <linux/firmware.h> | 35 | #include <linux/firmware.h> |
| 36 | #include <linux/smp_lock.h> | ||
| 37 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
| 38 | #include <media/v4l2-ioctl.h> | 37 | #include <media/v4l2-ioctl.h> |
| 39 | #include <media/cx2341x.h> | 38 | #include <media/cx2341x.h> |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index d2f159daa8b..88b51194f91 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <linux/kmod.h> | 31 | #include <linux/kmod.h> |
| 32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
| 33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
| 34 | #include <linux/smp_lock.h> | ||
| 35 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
| 36 | #include <linux/dma-mapping.h> | 35 | #include <linux/dma-mapping.h> |
| 37 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
diff --git a/drivers/media/video/imx074.c b/drivers/media/video/imx074.c index 380e459f899..27b5dfdfbb9 100644 --- a/drivers/media/video/imx074.c +++ b/drivers/media/video/imx074.c | |||
| @@ -451,7 +451,6 @@ static int imx074_probe(struct i2c_client *client, | |||
| 451 | ret = imx074_video_probe(icd, client); | 451 | ret = imx074_video_probe(icd, client); |
| 452 | if (ret < 0) { | 452 | if (ret < 0) { |
| 453 | icd->ops = NULL; | 453 | icd->ops = NULL; |
| 454 | i2c_set_clientdata(client, NULL); | ||
| 455 | kfree(priv); | 454 | kfree(priv); |
| 456 | return ret; | 455 | return ret; |
| 457 | } | 456 | } |
| @@ -468,7 +467,6 @@ static int imx074_remove(struct i2c_client *client) | |||
| 468 | icd->ops = NULL; | 467 | icd->ops = NULL; |
| 469 | if (icl->free_bus) | 468 | if (icl->free_bus) |
| 470 | icl->free_bus(icl); | 469 | icl->free_bus(icl); |
| 471 | i2c_set_clientdata(client, NULL); | ||
| 472 | client->driver = NULL; | 470 | client->driver = NULL; |
| 473 | kfree(priv); | 471 | kfree(priv); |
| 474 | 472 | ||
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 5a000c65ae9..ce4a7537590 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | #include <linux/errno.h> | 44 | #include <linux/errno.h> |
| 45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
| 46 | #include <linux/i2c.h> | 46 | #include <linux/i2c.h> |
| 47 | #include <linux/i2c-id.h> | ||
| 48 | #include <linux/workqueue.h> | 47 | #include <linux/workqueue.h> |
| 49 | 48 | ||
| 50 | #include <media/ir-core.h> | 49 | #include <media/ir-core.h> |
diff --git a/drivers/media/video/ov6650.c b/drivers/media/video/ov6650.c index 31f19373bba..cf93de98806 100644 --- a/drivers/media/video/ov6650.c +++ b/drivers/media/video/ov6650.c | |||
| @@ -1174,7 +1174,6 @@ static int ov6650_probe(struct i2c_client *client, | |||
| 1174 | 1174 | ||
| 1175 | if (ret) { | 1175 | if (ret) { |
| 1176 | icd->ops = NULL; | 1176 | icd->ops = NULL; |
| 1177 | i2c_set_clientdata(client, NULL); | ||
| 1178 | kfree(priv); | 1177 | kfree(priv); |
| 1179 | } | 1178 | } |
| 1180 | 1179 | ||
| @@ -1185,7 +1184,6 @@ static int ov6650_remove(struct i2c_client *client) | |||
| 1185 | { | 1184 | { |
| 1186 | struct ov6650 *priv = to_ov6650(client); | 1185 | struct ov6650 *priv = to_ov6650(client); |
| 1187 | 1186 | ||
| 1188 | i2c_set_clientdata(client, NULL); | ||
| 1189 | kfree(priv); | 1187 | kfree(priv); |
| 1190 | return 0; | 1188 | return 0; |
| 1191 | } | 1189 | } |
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index e62beb4efdb..f3dc89da4c4 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c | |||
| @@ -62,7 +62,6 @@ | |||
| 62 | #include <linux/module.h> | 62 | #include <linux/module.h> |
| 63 | #include <linux/poll.h> | 63 | #include <linux/poll.h> |
| 64 | #include <linux/slab.h> | 64 | #include <linux/slab.h> |
| 65 | #include <linux/smp_lock.h> | ||
| 66 | #ifdef CONFIG_USB_PWC_INPUT_EVDEV | 65 | #ifdef CONFIG_USB_PWC_INPUT_EVDEV |
| 67 | #include <linux/usb/input.h> | 66 | #include <linux/usb/input.h> |
| 68 | #endif | 67 | #endif |
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index f5a46c45871..a845753665c 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c | |||
| @@ -49,7 +49,6 @@ | |||
| 49 | #include <linux/videodev2.h> | 49 | #include <linux/videodev2.h> |
| 50 | #include <linux/version.h> | 50 | #include <linux/version.h> |
| 51 | #include <linux/mm.h> | 51 | #include <linux/mm.h> |
| 52 | #include <linux/smp_lock.h> | ||
| 53 | #include <media/videobuf-vmalloc.h> | 52 | #include <media/videobuf-vmalloc.h> |
| 54 | #include <media/v4l2-common.h> | 53 | #include <media/v4l2-common.h> |
| 55 | #include <media/v4l2-device.h> | 54 | #include <media/v4l2-device.h> |
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 1467a30a434..b890aafe7d6 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
| 26 | 25 | ||
| 27 | #include "saa7134-reg.h" | 26 | #include "saa7134-reg.h" |
diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h index 1d9c5cbbbc5..041ae8e20f6 100644 --- a/drivers/media/video/saa7164/saa7164.h +++ b/drivers/media/video/saa7164/saa7164.h | |||
| @@ -58,7 +58,6 @@ | |||
| 58 | #include <media/tveeprom.h> | 58 | #include <media/tveeprom.h> |
| 59 | #include <media/videobuf-dma-sg.h> | 59 | #include <media/videobuf-dma-sg.h> |
| 60 | #include <media/videobuf-dvb.h> | 60 | #include <media/videobuf-dvb.h> |
| 61 | #include <linux/smp_lock.h> | ||
| 62 | #include <dvb_demux.h> | 61 | #include <dvb_demux.h> |
| 63 | #include <dvb_frontend.h> | 62 | #include <dvb_frontend.h> |
| 64 | #include <dvb_net.h> | 63 | #include <dvb_net.h> |
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index db6b828594f..011c0c38699 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
| @@ -50,7 +50,6 @@ | |||
| 50 | #include <linux/list.h> | 50 | #include <linux/list.h> |
| 51 | #include <linux/timer.h> | 51 | #include <linux/timer.h> |
| 52 | #include <linux/slab.h> | 52 | #include <linux/slab.h> |
| 53 | #include <linux/smp_lock.h> | ||
| 54 | #include <linux/mm.h> | 53 | #include <linux/mm.h> |
| 55 | #include <linux/highmem.h> | 54 | #include <linux/highmem.h> |
| 56 | #include <linux/vmalloc.h> | 55 | #include <linux/vmalloc.h> |
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c index 86294ed35c9..e30e8dfb620 100644 --- a/drivers/media/video/v4l2-compat-ioctl32.c +++ b/drivers/media/video/v4l2-compat-ioctl32.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/videodev.h> | 18 | #include <linux/videodev.h> |
| 19 | #include <linux/videodev2.h> | 19 | #include <linux/videodev2.h> |
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/smp_lock.h> | ||
| 22 | #include <media/v4l2-ioctl.h> | 21 | #include <media/v4l2-ioctl.h> |
| 23 | 22 | ||
| 24 | #ifdef CONFIG_COMPAT | 23 | #ifdef CONFIG_COMPAT |
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index e15220ff52f..d784c36707c 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
| @@ -97,8 +97,7 @@ static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; | |||
| 97 | 97 | ||
| 98 | static int mptfc_target_alloc(struct scsi_target *starget); | 98 | static int mptfc_target_alloc(struct scsi_target *starget); |
| 99 | static int mptfc_slave_alloc(struct scsi_device *sdev); | 99 | static int mptfc_slave_alloc(struct scsi_device *sdev); |
| 100 | static int mptfc_qcmd(struct scsi_cmnd *SCpnt, | 100 | static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); |
| 101 | void (*done)(struct scsi_cmnd *)); | ||
| 102 | static void mptfc_target_destroy(struct scsi_target *starget); | 101 | static void mptfc_target_destroy(struct scsi_target *starget); |
| 103 | static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); | 102 | static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); |
| 104 | static void __devexit mptfc_remove(struct pci_dev *pdev); | 103 | static void __devexit mptfc_remove(struct pci_dev *pdev); |
| @@ -650,7 +649,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
| 650 | } | 649 | } |
| 651 | 650 | ||
| 652 | static int | 651 | static int |
| 653 | mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 652 | mptfc_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 654 | { | 653 | { |
| 655 | struct mptfc_rport_info *ri; | 654 | struct mptfc_rport_info *ri; |
| 656 | struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); | 655 | struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); |
| @@ -681,6 +680,8 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
| 681 | return mptscsih_qcmd(SCpnt,done); | 680 | return mptscsih_qcmd(SCpnt,done); |
| 682 | } | 681 | } |
| 683 | 682 | ||
| 683 | static DEF_SCSI_QCMD(mptfc_qcmd) | ||
| 684 | |||
| 684 | /* | 685 | /* |
| 685 | * mptfc_display_port_link_speed - displaying link speed | 686 | * mptfc_display_port_link_speed - displaying link speed |
| 686 | * @ioc: Pointer to MPT_ADAPTER structure | 687 | * @ioc: Pointer to MPT_ADAPTER structure |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 83a5115f025..d48c2c6058e 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
| @@ -1889,7 +1889,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) | |||
| 1889 | } | 1889 | } |
| 1890 | 1890 | ||
| 1891 | static int | 1891 | static int |
| 1892 | mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 1892 | mptsas_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 1893 | { | 1893 | { |
| 1894 | MPT_SCSI_HOST *hd; | 1894 | MPT_SCSI_HOST *hd; |
| 1895 | MPT_ADAPTER *ioc; | 1895 | MPT_ADAPTER *ioc; |
| @@ -1913,6 +1913,8 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
| 1913 | return mptscsih_qcmd(SCpnt,done); | 1913 | return mptscsih_qcmd(SCpnt,done); |
| 1914 | } | 1914 | } |
| 1915 | 1915 | ||
| 1916 | static DEF_SCSI_QCMD(mptsas_qcmd) | ||
| 1917 | |||
| 1916 | /** | 1918 | /** |
| 1917 | * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout | 1919 | * mptsas_mptsas_eh_timed_out - resets the scsi_cmnd timeout |
| 1918 | * if the device under question is currently in the | 1920 | * if the device under question is currently in the |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 0e2803155ae..6d9568d2ec5 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
| @@ -780,7 +780,7 @@ static int mptspi_slave_configure(struct scsi_device *sdev) | |||
| 780 | } | 780 | } |
| 781 | 781 | ||
| 782 | static int | 782 | static int |
| 783 | mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 783 | mptspi_qcmd_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 784 | { | 784 | { |
| 785 | struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); | 785 | struct _MPT_SCSI_HOST *hd = shost_priv(SCpnt->device->host); |
| 786 | VirtDevice *vdevice = SCpnt->device->hostdata; | 786 | VirtDevice *vdevice = SCpnt->device->hostdata; |
| @@ -805,6 +805,8 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
| 805 | return mptscsih_qcmd(SCpnt,done); | 805 | return mptscsih_qcmd(SCpnt,done); |
| 806 | } | 806 | } |
| 807 | 807 | ||
| 808 | static DEF_SCSI_QCMD(mptspi_qcmd) | ||
| 809 | |||
| 808 | static void mptspi_slave_destroy(struct scsi_device *sdev) | 810 | static void mptspi_slave_destroy(struct scsi_device *sdev) |
| 809 | { | 811 | { |
| 810 | struct scsi_target *starget = scsi_target(sdev); | 812 | struct scsi_target *starget = scsi_target(sdev); |
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c index ea6b2197da8..97bdf82ec90 100644 --- a/drivers/message/i2o/i2o_scsi.c +++ b/drivers/message/i2o/i2o_scsi.c | |||
| @@ -506,7 +506,7 @@ static struct i2o_driver i2o_scsi_driver = { | |||
| 506 | * Locks: takes the controller lock on error path only | 506 | * Locks: takes the controller lock on error path only |
| 507 | */ | 507 | */ |
| 508 | 508 | ||
| 509 | static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | 509 | static int i2o_scsi_queuecommand_lck(struct scsi_cmnd *SCpnt, |
| 510 | void (*done) (struct scsi_cmnd *)) | 510 | void (*done) (struct scsi_cmnd *)) |
| 511 | { | 511 | { |
| 512 | struct i2o_controller *c; | 512 | struct i2o_controller *c; |
| @@ -688,7 +688,9 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 688 | 688 | ||
| 689 | exit: | 689 | exit: |
| 690 | return rc; | 690 | return rc; |
| 691 | }; | 691 | } |
| 692 | |||
| 693 | static DEF_SCSI_QCMD(i2o_scsi_queuecommand) | ||
| 692 | 694 | ||
| 693 | /** | 695 | /** |
| 694 | * i2o_scsi_abort - abort a running command | 696 | * i2o_scsi_abort - abort a running command |
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 0ed09358027..644d4cd071c 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c | |||
| @@ -251,7 +251,6 @@ static int apds9802als_probe(struct i2c_client *client, | |||
| 251 | 251 | ||
| 252 | return res; | 252 | return res; |
| 253 | als_error1: | 253 | als_error1: |
| 254 | i2c_set_clientdata(client, NULL); | ||
| 255 | kfree(data); | 254 | kfree(data); |
| 256 | return res; | 255 | return res; |
| 257 | } | 256 | } |
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index a38a7bd25f1..b9aedf18a04 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c | |||
| @@ -57,7 +57,6 @@ | |||
| 57 | #include <linux/fcntl.h> | 57 | #include <linux/fcntl.h> |
| 58 | #include <linux/spinlock.h> | 58 | #include <linux/spinlock.h> |
| 59 | #include <linux/list.h> | 59 | #include <linux/list.h> |
| 60 | #include <linux/smp_lock.h> | ||
| 61 | #include <linux/usb.h> | 60 | #include <linux/usb.h> |
| 62 | #include <linux/timer.h> | 61 | #include <linux/timer.h> |
| 63 | 62 | ||
diff --git a/drivers/parisc/eisa_eeprom.c b/drivers/parisc/eisa_eeprom.c index cce00ed81f3..af212c6a615 100644 --- a/drivers/parisc/eisa_eeprom.c +++ b/drivers/parisc/eisa_eeprom.c | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
| 25 | #include <linux/miscdevice.h> | 25 | #include <linux/miscdevice.h> |
| 26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
| 27 | #include <linux/smp_lock.h> | ||
| 28 | #include <linux/fs.h> | 27 | #include <linux/fs.h> |
| 29 | #include <asm/io.h> | 28 | #include <asm/io.h> |
| 30 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 5624db8c9ad..003170ea2e3 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
| @@ -64,17 +64,57 @@ void pci_bus_remove_resources(struct pci_bus *bus) | |||
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static bool pci_bus_resource_better(struct resource *res1, bool pos1, | ||
| 68 | struct resource *res2, bool pos2) | ||
| 69 | { | ||
| 70 | /* If exactly one is positive decode, always prefer that one */ | ||
| 71 | if (pos1 != pos2) | ||
| 72 | return pos1 ? true : false; | ||
| 73 | |||
| 74 | /* Prefer the one that contains the highest address */ | ||
| 75 | if (res1->end != res2->end) | ||
| 76 | return (res1->end > res2->end) ? true : false; | ||
| 77 | |||
| 78 | /* Otherwise, prefer the one with highest "center of gravity" */ | ||
| 79 | if (res1->start != res2->start) | ||
| 80 | return (res1->start > res2->start) ? true : false; | ||
| 81 | |||
| 82 | /* Otherwise, choose one arbitrarily (but consistently) */ | ||
| 83 | return (res1 > res2) ? true : false; | ||
| 84 | } | ||
| 85 | |||
| 86 | static bool pci_bus_resource_positive(struct pci_bus *bus, struct resource *res) | ||
| 87 | { | ||
| 88 | struct pci_bus_resource *bus_res; | ||
| 89 | |||
| 90 | /* | ||
| 91 | * This relies on the fact that pci_bus.resource[] refers to P2P or | ||
| 92 | * CardBus bridge base/limit registers, which are always positively | ||
| 93 | * decoded. The pci_bus.resources list contains host bridge or | ||
| 94 | * subtractively decoded resources. | ||
| 95 | */ | ||
| 96 | list_for_each_entry(bus_res, &bus->resources, list) { | ||
| 97 | if (bus_res->res == res) | ||
| 98 | return (bus_res->flags & PCI_SUBTRACTIVE_DECODE) ? | ||
| 99 | false : true; | ||
| 100 | } | ||
| 101 | return true; | ||
| 102 | } | ||
| 103 | |||
| 67 | /* | 104 | /* |
| 68 | * Find the highest-address bus resource below the cursor "res". If the | 105 | * Find the next-best bus resource after the cursor "res". If the cursor is |
| 69 | * cursor is NULL, return the highest resource. | 106 | * NULL, return the best resource. "Best" means that we prefer positive |
| 107 | * decode regions over subtractive decode, then those at higher addresses. | ||
| 70 | */ | 108 | */ |
| 71 | static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, | 109 | static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, |
| 72 | unsigned int type, | 110 | unsigned int type, |
| 73 | struct resource *res) | 111 | struct resource *res) |
| 74 | { | 112 | { |
| 113 | bool res_pos, r_pos, prev_pos = false; | ||
| 75 | struct resource *r, *prev = NULL; | 114 | struct resource *r, *prev = NULL; |
| 76 | int i; | 115 | int i; |
| 77 | 116 | ||
| 117 | res_pos = pci_bus_resource_positive(bus, res); | ||
| 78 | pci_bus_for_each_resource(bus, r, i) { | 118 | pci_bus_for_each_resource(bus, r, i) { |
| 79 | if (!r) | 119 | if (!r) |
| 80 | continue; | 120 | continue; |
| @@ -82,26 +122,14 @@ static struct resource *pci_bus_find_resource_prev(struct pci_bus *bus, | |||
| 82 | if ((r->flags & IORESOURCE_TYPE_BITS) != type) | 122 | if ((r->flags & IORESOURCE_TYPE_BITS) != type) |
| 83 | continue; | 123 | continue; |
| 84 | 124 | ||
| 85 | /* If this resource is at or past the cursor, skip it */ | 125 | r_pos = pci_bus_resource_positive(bus, r); |
| 86 | if (res) { | 126 | if (!res || pci_bus_resource_better(res, res_pos, r, r_pos)) { |
| 87 | if (r == res) | 127 | if (!prev || pci_bus_resource_better(r, r_pos, |
| 88 | continue; | 128 | prev, prev_pos)) { |
| 89 | if (r->end > res->end) | 129 | prev = r; |
| 90 | continue; | 130 | prev_pos = r_pos; |
| 91 | if (r->end == res->end && r->start > res->start) | 131 | } |
| 92 | continue; | ||
| 93 | } | 132 | } |
| 94 | |||
| 95 | if (!prev) | ||
| 96 | prev = r; | ||
| 97 | |||
| 98 | /* | ||
| 99 | * A small resource is higher than a large one that ends at | ||
| 100 | * the same address. | ||
| 101 | */ | ||
| 102 | if (r->end > prev->end || | ||
| 103 | (r->end == prev->end && r->start > prev->start)) | ||
| 104 | prev = r; | ||
| 105 | } | 133 | } |
| 106 | 134 | ||
| 107 | return prev; | 135 | return prev; |
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index 5becbdee402..2850e64deda 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c | |||
| @@ -276,6 +276,12 @@ int __init ibmphp_access_ebda (void) | |||
| 276 | 276 | ||
| 277 | for (;;) { | 277 | for (;;) { |
| 278 | offset = next_offset; | 278 | offset = next_offset; |
| 279 | |||
| 280 | /* Make sure what we read is still in the mapped section */ | ||
| 281 | if (WARN(offset > (ebda_sz * 1024 - 4), | ||
| 282 | "ibmphp_ebda: next read is beyond ebda_sz\n")) | ||
| 283 | break; | ||
| 284 | |||
| 279 | next_offset = readw (io_mem + offset); /* offset of next blk */ | 285 | next_offset = readw (io_mem + offset); /* offset of next blk */ |
| 280 | 286 | ||
| 281 | offset += 2; | 287 | offset += 2; |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index b5a7d9bfcb2..63d5042f207 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
| @@ -705,17 +705,21 @@ void pci_remove_legacy_files(struct pci_bus *b) | |||
| 705 | 705 | ||
| 706 | #ifdef HAVE_PCI_MMAP | 706 | #ifdef HAVE_PCI_MMAP |
| 707 | 707 | ||
| 708 | int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma) | 708 | int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct *vma, |
| 709 | enum pci_mmap_api mmap_api) | ||
| 709 | { | 710 | { |
| 710 | unsigned long nr, start, size; | 711 | unsigned long nr, start, size, pci_start; |
| 711 | 712 | ||
| 713 | if (pci_resource_len(pdev, resno) == 0) | ||
| 714 | return 0; | ||
| 712 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 715 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
| 713 | start = vma->vm_pgoff; | 716 | start = vma->vm_pgoff; |
| 714 | size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; | 717 | size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; |
| 715 | if (start < size && size - start >= nr) | 718 | pci_start = (mmap_api == PCI_MMAP_PROCFS) ? |
| 719 | pci_resource_start(pdev, resno) >> PAGE_SHIFT : 0; | ||
| 720 | if (start >= pci_start && start < pci_start + size && | ||
| 721 | start + nr <= pci_start + size) | ||
| 716 | return 1; | 722 | return 1; |
| 717 | WARN(1, "process \"%s\" tried to map 0x%08lx-0x%08lx on %s BAR %d (size 0x%08lx)\n", | ||
| 718 | current->comm, start, start+nr, pci_name(pdev), resno, size); | ||
| 719 | return 0; | 723 | return 0; |
| 720 | } | 724 | } |
| 721 | 725 | ||
| @@ -745,8 +749,15 @@ pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, | |||
| 745 | if (i >= PCI_ROM_RESOURCE) | 749 | if (i >= PCI_ROM_RESOURCE) |
| 746 | return -ENODEV; | 750 | return -ENODEV; |
| 747 | 751 | ||
| 748 | if (!pci_mmap_fits(pdev, i, vma)) | 752 | if (!pci_mmap_fits(pdev, i, vma, PCI_MMAP_SYSFS)) { |
| 753 | WARN(1, "process \"%s\" tried to map 0x%08lx bytes " | ||
| 754 | "at page 0x%08lx on %s BAR %d (start 0x%16Lx, size 0x%16Lx)\n", | ||
| 755 | current->comm, vma->vm_end-vma->vm_start, vma->vm_pgoff, | ||
| 756 | pci_name(pdev), i, | ||
| 757 | (u64)pci_resource_start(pdev, i), | ||
| 758 | (u64)pci_resource_len(pdev, i)); | ||
| 749 | return -EINVAL; | 759 | return -EINVAL; |
| 760 | } | ||
| 750 | 761 | ||
| 751 | /* pci_mmap_page_range() expects the same kind of entry as coming | 762 | /* pci_mmap_page_range() expects the same kind of entry as coming |
| 752 | * from /proc/bus/pci/ which is a "user visible" value. If this is | 763 | * from /proc/bus/pci/ which is a "user visible" value. If this is |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e98c8104297..710c8a29be0 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -1007,6 +1007,18 @@ static int __pci_enable_device_flags(struct pci_dev *dev, | |||
| 1007 | int err; | 1007 | int err; |
| 1008 | int i, bars = 0; | 1008 | int i, bars = 0; |
| 1009 | 1009 | ||
| 1010 | /* | ||
| 1011 | * Power state could be unknown at this point, either due to a fresh | ||
| 1012 | * boot or a device removal call. So get the current power state | ||
| 1013 | * so that things like MSI message writing will behave as expected | ||
| 1014 | * (e.g. if the device really is in D0 at enable time). | ||
| 1015 | */ | ||
| 1016 | if (dev->pm_cap) { | ||
| 1017 | u16 pmcsr; | ||
| 1018 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); | ||
| 1019 | dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); | ||
| 1020 | } | ||
| 1021 | |||
| 1010 | if (atomic_add_return(1, &dev->enable_cnt) > 1) | 1022 | if (atomic_add_return(1, &dev->enable_cnt) > 1) |
| 1011 | return 0; /* already enabled */ | 1023 | return 0; /* already enabled */ |
| 1012 | 1024 | ||
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index f5c7c382765..7d33f667386 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -22,8 +22,13 @@ extern void pci_remove_firmware_label_files(struct pci_dev *pdev); | |||
| 22 | #endif | 22 | #endif |
| 23 | extern void pci_cleanup_rom(struct pci_dev *dev); | 23 | extern void pci_cleanup_rom(struct pci_dev *dev); |
| 24 | #ifdef HAVE_PCI_MMAP | 24 | #ifdef HAVE_PCI_MMAP |
| 25 | enum pci_mmap_api { | ||
| 26 | PCI_MMAP_SYSFS, /* mmap on /sys/bus/pci/devices/<BDF>/resource<N> */ | ||
| 27 | PCI_MMAP_PROCFS /* mmap on /proc/bus/pci/<BDF> */ | ||
| 28 | }; | ||
| 25 | extern int pci_mmap_fits(struct pci_dev *pdev, int resno, | 29 | extern int pci_mmap_fits(struct pci_dev *pdev, int resno, |
| 26 | struct vm_area_struct *vma); | 30 | struct vm_area_struct *vmai, |
| 31 | enum pci_mmap_api mmap_api); | ||
| 27 | #endif | 32 | #endif |
| 28 | int pci_probe_reset_function(struct pci_dev *dev); | 33 | int pci_probe_reset_function(struct pci_dev *dev); |
| 29 | 34 | ||
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 297b72c880a..27911b55c2a 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 11 | #include <linux/proc_fs.h> | 11 | #include <linux/proc_fs.h> |
| 12 | #include <linux/seq_file.h> | 12 | #include <linux/seq_file.h> |
| 13 | #include <linux/smp_lock.h> | ||
| 14 | #include <linux/capability.h> | 13 | #include <linux/capability.h> |
| 15 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
| 16 | #include <asm/byteorder.h> | 15 | #include <asm/byteorder.h> |
| @@ -257,7 +256,7 @@ static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 257 | 256 | ||
| 258 | /* Make sure the caller is mapping a real resource for this device */ | 257 | /* Make sure the caller is mapping a real resource for this device */ |
| 259 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { | 258 | for (i = 0; i < PCI_ROM_RESOURCE; i++) { |
| 260 | if (pci_mmap_fits(dev, i, vma)) | 259 | if (pci_mmap_fits(dev, i, vma, PCI_MMAP_PROCFS)) |
| 261 | break; | 260 | break; |
| 262 | } | 261 | } |
| 263 | 262 | ||
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index e73ebefdf3e..315b3112aca 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/isapnp.h> | 21 | #include <linux/isapnp.h> |
| 22 | #include <linux/proc_fs.h> | 22 | #include <linux/proc_fs.h> |
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
| 26 | 25 | ||
| 27 | extern struct pnp_protocol isapnp_protocol; | 26 | extern struct pnp_protocol isapnp_protocol; |
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 5efbd5990ff..06e41ed9323 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
| @@ -761,7 +761,7 @@ err_unmap: | |||
| 761 | clk_put(rtc->clk); | 761 | clk_put(rtc->clk); |
| 762 | iounmap(rtc->regbase); | 762 | iounmap(rtc->regbase); |
| 763 | err_badmap: | 763 | err_badmap: |
| 764 | release_resource(rtc->res); | 764 | release_mem_region(rtc->res->start, rtc->regsize); |
| 765 | err_badres: | 765 | err_badres: |
| 766 | kfree(rtc); | 766 | kfree(rtc); |
| 767 | 767 | ||
| @@ -786,7 +786,7 @@ static int __exit sh_rtc_remove(struct platform_device *pdev) | |||
| 786 | } | 786 | } |
| 787 | 787 | ||
| 788 | iounmap(rtc->regbase); | 788 | iounmap(rtc->regbase); |
| 789 | release_resource(rtc->res); | 789 | release_mem_region(rtc->res->start, rtc->regsize); |
| 790 | 790 | ||
| 791 | clk_disable(rtc->clk); | 791 | clk_disable(rtc->clk); |
| 792 | clk_put(rtc->clk); | 792 | clk_put(rtc->clk); |
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index c71d89dba30..83b4615a3b6 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
| 18 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
| 19 | #include <linux/mutex.h> | 19 | #include <linux/mutex.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/err.h> | 20 | #include <linux/err.h> |
| 22 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
| 23 | 22 | ||
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index eb28fb01a38..f6489eb7e97 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/smp_lock.h> | ||
| 18 | 17 | ||
| 19 | #include <asm/compat.h> | 18 | #include <asm/compat.h> |
| 20 | #include <asm/ccwdev.h> | 19 | #include <asm/ccwdev.h> |
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 883e2db02bd..e090a307fde 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_fs.h> |
| 19 | #include <linux/mtio.h> | 19 | #include <linux/mtio.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/compat.h> | 20 | #include <linux/compat.h> |
| 22 | 21 | ||
| 23 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index 6c408670e08..b3a3e8e8656 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c | |||
| @@ -209,29 +209,79 @@ tape_state_set(struct tape_device *device, enum tape_state newstate) | |||
| 209 | wake_up(&device->state_change_wq); | 209 | wake_up(&device->state_change_wq); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | struct tape_med_state_work_data { | ||
| 213 | struct tape_device *device; | ||
| 214 | enum tape_medium_state state; | ||
| 215 | struct work_struct work; | ||
| 216 | }; | ||
| 217 | |||
| 218 | static void | ||
| 219 | tape_med_state_work_handler(struct work_struct *work) | ||
| 220 | { | ||
| 221 | static char env_state_loaded[] = "MEDIUM_STATE=LOADED"; | ||
| 222 | static char env_state_unloaded[] = "MEDIUM_STATE=UNLOADED"; | ||
| 223 | struct tape_med_state_work_data *p = | ||
| 224 | container_of(work, struct tape_med_state_work_data, work); | ||
| 225 | struct tape_device *device = p->device; | ||
| 226 | char *envp[] = { NULL, NULL }; | ||
| 227 | |||
| 228 | switch (p->state) { | ||
| 229 | case MS_UNLOADED: | ||
| 230 | pr_info("%s: The tape cartridge has been successfully " | ||
| 231 | "unloaded\n", dev_name(&device->cdev->dev)); | ||
| 232 | envp[0] = env_state_unloaded; | ||
| 233 | kobject_uevent_env(&device->cdev->dev.kobj, KOBJ_CHANGE, envp); | ||
| 234 | break; | ||
| 235 | case MS_LOADED: | ||
| 236 | pr_info("%s: A tape cartridge has been mounted\n", | ||
| 237 | dev_name(&device->cdev->dev)); | ||
| 238 | envp[0] = env_state_loaded; | ||
| 239 | kobject_uevent_env(&device->cdev->dev.kobj, KOBJ_CHANGE, envp); | ||
| 240 | break; | ||
| 241 | default: | ||
| 242 | break; | ||
| 243 | } | ||
| 244 | tape_put_device(device); | ||
| 245 | kfree(p); | ||
| 246 | } | ||
| 247 | |||
| 248 | static void | ||
| 249 | tape_med_state_work(struct tape_device *device, enum tape_medium_state state) | ||
| 250 | { | ||
| 251 | struct tape_med_state_work_data *p; | ||
| 252 | |||
| 253 | p = kzalloc(sizeof(*p), GFP_ATOMIC); | ||
| 254 | if (p) { | ||
| 255 | INIT_WORK(&p->work, tape_med_state_work_handler); | ||
| 256 | p->device = tape_get_device(device); | ||
| 257 | p->state = state; | ||
| 258 | schedule_work(&p->work); | ||
| 259 | } | ||
| 260 | } | ||
| 261 | |||
| 212 | void | 262 | void |
| 213 | tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate) | 263 | tape_med_state_set(struct tape_device *device, enum tape_medium_state newstate) |
| 214 | { | 264 | { |
| 215 | if (device->medium_state == newstate) | 265 | enum tape_medium_state oldstate; |
| 266 | |||
| 267 | oldstate = device->medium_state; | ||
| 268 | if (oldstate == newstate) | ||
| 216 | return; | 269 | return; |
| 270 | device->medium_state = newstate; | ||
| 217 | switch(newstate){ | 271 | switch(newstate){ |
| 218 | case MS_UNLOADED: | 272 | case MS_UNLOADED: |
| 219 | device->tape_generic_status |= GMT_DR_OPEN(~0); | 273 | device->tape_generic_status |= GMT_DR_OPEN(~0); |
| 220 | if (device->medium_state == MS_LOADED) | 274 | if (oldstate == MS_LOADED) |
| 221 | pr_info("%s: The tape cartridge has been successfully " | 275 | tape_med_state_work(device, MS_UNLOADED); |
| 222 | "unloaded\n", dev_name(&device->cdev->dev)); | ||
| 223 | break; | 276 | break; |
| 224 | case MS_LOADED: | 277 | case MS_LOADED: |
| 225 | device->tape_generic_status &= ~GMT_DR_OPEN(~0); | 278 | device->tape_generic_status &= ~GMT_DR_OPEN(~0); |
| 226 | if (device->medium_state == MS_UNLOADED) | 279 | if (oldstate == MS_UNLOADED) |
| 227 | pr_info("%s: A tape cartridge has been mounted\n", | 280 | tape_med_state_work(device, MS_LOADED); |
| 228 | dev_name(&device->cdev->dev)); | ||
| 229 | break; | 281 | break; |
| 230 | default: | 282 | default: |
| 231 | // print nothing | ||
| 232 | break; | 283 | break; |
| 233 | } | 284 | } |
| 234 | device->medium_state = newstate; | ||
| 235 | wake_up(&device->state_change_wq); | 285 | wake_up(&device->state_change_wq); |
| 236 | } | 286 | } |
| 237 | 287 | ||
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 9f661426e4a..c837d7419a6 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/kmod.h> | 30 | #include <linux/kmod.h> |
| 31 | #include <linux/cdev.h> | 31 | #include <linux/cdev.h> |
| 32 | #include <linux/device.h> | 32 | #include <linux/device.h> |
| 33 | #include <linux/smp_lock.h> | ||
| 34 | #include <linux/string.h> | 33 | #include <linux/string.h> |
| 35 | 34 | ||
| 36 | MODULE_AUTHOR | 35 | MODULE_AUTHOR |
| @@ -249,27 +248,25 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr, | |||
| 249 | char cp_command[80]; | 248 | char cp_command[80]; |
| 250 | char cp_response[160]; | 249 | char cp_response[160]; |
| 251 | char *onoff, *qid_string; | 250 | char *onoff, *qid_string; |
| 251 | int rc; | ||
| 252 | 252 | ||
| 253 | memset(cp_command, 0x00, sizeof(cp_command)); | 253 | onoff = ((action == 1) ? "ON" : "OFF"); |
| 254 | memset(cp_response, 0x00, sizeof(cp_response)); | ||
| 255 | |||
| 256 | onoff = ((action == 1) ? "ON" : "OFF"); | ||
| 257 | qid_string = ((recording_class_AB == 1) ? " QID * " : ""); | 254 | qid_string = ((recording_class_AB == 1) ? " QID * " : ""); |
| 258 | 255 | ||
| 259 | /* | 256 | /* |
| 260 | * The recording commands needs to be called with option QID | 257 | * The recording commands needs to be called with option QID |
| 261 | * for guests that have previlege classes A or B. | 258 | * for guests that have previlege classes A or B. |
| 262 | * Purging has to be done as separate step, because recording | 259 | * Purging has to be done as separate step, because recording |
| 263 | * can't be switched on as long as records are on the queue. | 260 | * can't be switched on as long as records are on the queue. |
| 264 | * Doing both at the same time doesn't work. | 261 | * Doing both at the same time doesn't work. |
| 265 | */ | 262 | */ |
| 266 | 263 | if (purge && (action == 1)) { | |
| 267 | if (purge) { | 264 | memset(cp_command, 0x00, sizeof(cp_command)); |
| 265 | memset(cp_response, 0x00, sizeof(cp_response)); | ||
| 268 | snprintf(cp_command, sizeof(cp_command), | 266 | snprintf(cp_command, sizeof(cp_command), |
| 269 | "RECORDING %s PURGE %s", | 267 | "RECORDING %s PURGE %s", |
| 270 | logptr->recording_name, | 268 | logptr->recording_name, |
| 271 | qid_string); | 269 | qid_string); |
| 272 | |||
| 273 | cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); | 270 | cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); |
| 274 | } | 271 | } |
| 275 | 272 | ||
| @@ -279,19 +276,33 @@ static int vmlogrdr_recording(struct vmlogrdr_priv_t * logptr, | |||
| 279 | logptr->recording_name, | 276 | logptr->recording_name, |
| 280 | onoff, | 277 | onoff, |
| 281 | qid_string); | 278 | qid_string); |
| 282 | |||
| 283 | cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); | 279 | cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); |
| 284 | /* The recording command will usually answer with 'Command complete' | 280 | /* The recording command will usually answer with 'Command complete' |
| 285 | * on success, but when the specific service was never connected | 281 | * on success, but when the specific service was never connected |
| 286 | * before then there might be an additional informational message | 282 | * before then there might be an additional informational message |
| 287 | * 'HCPCRC8072I Recording entry not found' before the | 283 | * 'HCPCRC8072I Recording entry not found' before the |
| 288 | * 'Command complete'. So I use strstr rather then the strncmp. | 284 | * 'Command complete'. So I use strstr rather then the strncmp. |
| 289 | */ | 285 | */ |
| 290 | if (strstr(cp_response,"Command complete")) | 286 | if (strstr(cp_response,"Command complete")) |
| 291 | return 0; | 287 | rc = 0; |
| 292 | else | 288 | else |
| 293 | return -EIO; | 289 | rc = -EIO; |
| 290 | /* | ||
| 291 | * If we turn recording off, we have to purge any remaining records | ||
| 292 | * afterwards, as a large number of queued records may impact z/VM | ||
| 293 | * performance. | ||
| 294 | */ | ||
| 295 | if (purge && (action == 0)) { | ||
| 296 | memset(cp_command, 0x00, sizeof(cp_command)); | ||
| 297 | memset(cp_response, 0x00, sizeof(cp_response)); | ||
| 298 | snprintf(cp_command, sizeof(cp_command), | ||
| 299 | "RECORDING %s PURGE %s", | ||
| 300 | logptr->recording_name, | ||
| 301 | qid_string); | ||
| 302 | cpcmd(cp_command, cp_response, sizeof(cp_response), NULL); | ||
| 303 | } | ||
| 294 | 304 | ||
| 305 | return rc; | ||
| 295 | } | 306 | } |
| 296 | 307 | ||
| 297 | 308 | ||
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 1de672f2103..f7e4ae6bf15 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | #include <linux/cdev.h> | 14 | #include <linux/cdev.h> |
| 15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
| 16 | #include <linux/smp_lock.h> | ||
| 17 | 16 | ||
| 18 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
| 19 | #include <asm/cio.h> | 18 | #include <asm/cio.h> |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 2ff8a22d425..e8391b89eff 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
| @@ -1455,7 +1455,16 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process) | |||
| 1455 | break; | 1455 | break; |
| 1456 | case IO_SCH_UNREG_ATTACH: | 1456 | case IO_SCH_UNREG_ATTACH: |
| 1457 | case IO_SCH_UNREG: | 1457 | case IO_SCH_UNREG: |
| 1458 | if (cdev) | 1458 | if (!cdev) |
| 1459 | break; | ||
| 1460 | if (cdev->private->state == DEV_STATE_SENSE_ID) { | ||
| 1461 | /* | ||
| 1462 | * Note: delayed work triggered by this event | ||
| 1463 | * and repeated calls to sch_event are synchronized | ||
| 1464 | * by the above check for work_pending(cdev). | ||
| 1465 | */ | ||
| 1466 | dev_fsm_event(cdev, DEV_EVENT_NOTOPER); | ||
| 1467 | } else | ||
| 1459 | ccw_device_set_notoper(cdev); | 1468 | ccw_device_set_notoper(cdev); |
| 1460 | break; | 1469 | break; |
| 1461 | case IO_SCH_NOP: | 1470 | case IO_SCH_NOP: |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index f5221749d18..7fca9c10ffc 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | #include <linux/proc_fs.h> | 35 | #include <linux/proc_fs.h> |
| 36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 37 | #include <linux/compat.h> | 37 | #include <linux/compat.h> |
| 38 | #include <linux/smp_lock.h> | ||
| 39 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
| 40 | #include <asm/atomic.h> | 39 | #include <asm/atomic.h> |
| 41 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 50286d8707f..6bd2dbc4c31 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
| @@ -76,7 +76,7 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) | |||
| 76 | scpnt->scsi_done(scpnt); | 76 | scpnt->scsi_done(scpnt); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, | 79 | static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, |
| 80 | void (*done) (struct scsi_cmnd *)) | 80 | void (*done) (struct scsi_cmnd *)) |
| 81 | { | 81 | { |
| 82 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); | 82 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); |
| @@ -127,6 +127,8 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, | |||
| 127 | return ret; | 127 | return ret; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static DEF_SCSI_QCMD(zfcp_scsi_queuecommand) | ||
| 131 | |||
| 130 | static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) | 132 | static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) |
| 131 | { | 133 | { |
| 132 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); | 134 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); |
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index fcf08b3f52c..b7bd5b0cc7a 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c | |||
| @@ -1765,7 +1765,7 @@ out: | |||
| 1765 | } /* End twa_scsi_eh_reset() */ | 1765 | } /* End twa_scsi_eh_reset() */ |
| 1766 | 1766 | ||
| 1767 | /* This is the main scsi queue function to handle scsi opcodes */ | 1767 | /* This is the main scsi queue function to handle scsi opcodes */ |
| 1768 | static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 1768 | static int twa_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 1769 | { | 1769 | { |
| 1770 | int request_id, retval; | 1770 | int request_id, retval; |
| 1771 | TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; | 1771 | TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; |
| @@ -1812,6 +1812,8 @@ out: | |||
| 1812 | return retval; | 1812 | return retval; |
| 1813 | } /* End twa_scsi_queue() */ | 1813 | } /* End twa_scsi_queue() */ |
| 1814 | 1814 | ||
| 1815 | static DEF_SCSI_QCMD(twa_scsi_queue) | ||
| 1816 | |||
| 1815 | /* This function hands scsi cdb's to the firmware */ | 1817 | /* This function hands scsi cdb's to the firmware */ |
| 1816 | static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg) | 1818 | static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg) |
| 1817 | { | 1819 | { |
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 6a95d111d20..13e39e1fdfe 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c | |||
| @@ -1501,7 +1501,7 @@ out: | |||
| 1501 | } /* End twl_scsi_eh_reset() */ | 1501 | } /* End twl_scsi_eh_reset() */ |
| 1502 | 1502 | ||
| 1503 | /* This is the main scsi queue function to handle scsi opcodes */ | 1503 | /* This is the main scsi queue function to handle scsi opcodes */ |
| 1504 | static int twl_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 1504 | static int twl_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 1505 | { | 1505 | { |
| 1506 | int request_id, retval; | 1506 | int request_id, retval; |
| 1507 | TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; | 1507 | TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata; |
| @@ -1536,6 +1536,8 @@ out: | |||
| 1536 | return retval; | 1536 | return retval; |
| 1537 | } /* End twl_scsi_queue() */ | 1537 | } /* End twl_scsi_queue() */ |
| 1538 | 1538 | ||
| 1539 | static DEF_SCSI_QCMD(twl_scsi_queue) | ||
| 1540 | |||
| 1539 | /* This function tells the controller to shut down */ | 1541 | /* This function tells the controller to shut down */ |
| 1540 | static void __twl_shutdown(TW_Device_Extension *tw_dev) | 1542 | static void __twl_shutdown(TW_Device_Extension *tw_dev) |
| 1541 | { | 1543 | { |
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index b1125341f4c..7fe96ff60c5 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c | |||
| @@ -1947,7 +1947,7 @@ static int tw_scsiop_test_unit_ready_complete(TW_Device_Extension *tw_dev, int r | |||
| 1947 | } /* End tw_scsiop_test_unit_ready_complete() */ | 1947 | } /* End tw_scsiop_test_unit_ready_complete() */ |
| 1948 | 1948 | ||
| 1949 | /* This is the main scsi queue function to handle scsi opcodes */ | 1949 | /* This is the main scsi queue function to handle scsi opcodes */ |
| 1950 | static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 1950 | static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 1951 | { | 1951 | { |
| 1952 | unsigned char *command = SCpnt->cmnd; | 1952 | unsigned char *command = SCpnt->cmnd; |
| 1953 | int request_id = 0; | 1953 | int request_id = 0; |
| @@ -2023,6 +2023,8 @@ static int tw_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd | |||
| 2023 | return retval; | 2023 | return retval; |
| 2024 | } /* End tw_scsi_queue() */ | 2024 | } /* End tw_scsi_queue() */ |
| 2025 | 2025 | ||
| 2026 | static DEF_SCSI_QCMD(tw_scsi_queue) | ||
| 2027 | |||
| 2026 | /* This function is the interrupt service routine */ | 2028 | /* This function is the interrupt service routine */ |
| 2027 | static irqreturn_t tw_interrupt(int irq, void *dev_instance) | 2029 | static irqreturn_t tw_interrupt(int irq, void *dev_instance) |
| 2028 | { | 2030 | { |
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 89fc1c8af86..f672491774e 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c | |||
| @@ -167,7 +167,7 @@ MODULE_LICENSE("GPL"); | |||
| 167 | #include "53c700_d.h" | 167 | #include "53c700_d.h" |
| 168 | 168 | ||
| 169 | 169 | ||
| 170 | STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); | 170 | STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); |
| 171 | STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); | 171 | STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); |
| 172 | STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); | 172 | STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); |
| 173 | STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); | 173 | STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); |
| @@ -1749,8 +1749,8 @@ NCR_700_intr(int irq, void *dev_id) | |||
| 1749 | return IRQ_RETVAL(handled); | 1749 | return IRQ_RETVAL(handled); |
| 1750 | } | 1750 | } |
| 1751 | 1751 | ||
| 1752 | STATIC int | 1752 | static int |
| 1753 | NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) | 1753 | NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) |
| 1754 | { | 1754 | { |
| 1755 | struct NCR_700_Host_Parameters *hostdata = | 1755 | struct NCR_700_Host_Parameters *hostdata = |
| 1756 | (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; | 1756 | (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; |
| @@ -1904,6 +1904,8 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) | |||
| 1904 | return 0; | 1904 | return 0; |
| 1905 | } | 1905 | } |
| 1906 | 1906 | ||
| 1907 | STATIC DEF_SCSI_QCMD(NCR_700_queuecommand) | ||
| 1908 | |||
| 1907 | STATIC int | 1909 | STATIC int |
| 1908 | NCR_700_abort(struct scsi_cmnd * SCp) | 1910 | NCR_700_abort(struct scsi_cmnd * SCp) |
| 1909 | { | 1911 | { |
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index fc0b4b81d55..f66c33b9ab4 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c | |||
| @@ -2807,7 +2807,7 @@ static int BusLogic_host_reset(struct scsi_cmnd * SCpnt) | |||
| 2807 | Outgoing Mailbox for execution by the associated Host Adapter. | 2807 | Outgoing Mailbox for execution by the associated Host Adapter. |
| 2808 | */ | 2808 | */ |
| 2809 | 2809 | ||
| 2810 | static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) | 2810 | static int BusLogic_QueueCommand_lck(struct scsi_cmnd *Command, void (*CompletionRoutine) (struct scsi_cmnd *)) |
| 2811 | { | 2811 | { |
| 2812 | struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata; | 2812 | struct BusLogic_HostAdapter *HostAdapter = (struct BusLogic_HostAdapter *) Command->device->host->hostdata; |
| 2813 | struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id]; | 2813 | struct BusLogic_TargetFlags *TargetFlags = &HostAdapter->TargetFlags[Command->device->id]; |
| @@ -2994,6 +2994,7 @@ static int BusLogic_QueueCommand(struct scsi_cmnd *Command, void (*CompletionRou | |||
| 2994 | return 0; | 2994 | return 0; |
| 2995 | } | 2995 | } |
| 2996 | 2996 | ||
| 2997 | static DEF_SCSI_QCMD(BusLogic_QueueCommand) | ||
| 2997 | 2998 | ||
| 2998 | #if 0 | 2999 | #if 0 |
| 2999 | /* | 3000 | /* |
diff --git a/drivers/scsi/BusLogic.h b/drivers/scsi/BusLogic.h index 73f237a1ed9..649fcb31f26 100644 --- a/drivers/scsi/BusLogic.h +++ b/drivers/scsi/BusLogic.h | |||
| @@ -1319,7 +1319,7 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T Co | |||
| 1319 | */ | 1319 | */ |
| 1320 | 1320 | ||
| 1321 | static const char *BusLogic_DriverInfo(struct Scsi_Host *); | 1321 | static const char *BusLogic_DriverInfo(struct Scsi_Host *); |
| 1322 | static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *)); | 1322 | static int BusLogic_QueueCommand(struct Scsi_Host *h, struct scsi_cmnd *); |
| 1323 | static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *); | 1323 | static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *); |
| 1324 | static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int); | 1324 | static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int); |
| 1325 | static int BusLogic_SlaveConfigure(struct scsi_device *); | 1325 | static int BusLogic_SlaveConfigure(struct scsi_device *); |
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 5d2f148889a..9a5629f94f9 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
| @@ -952,7 +952,7 @@ static void NCR5380_exit(struct Scsi_Host *instance) | |||
| 952 | * Locks: host lock taken by caller | 952 | * Locks: host lock taken by caller |
| 953 | */ | 953 | */ |
| 954 | 954 | ||
| 955 | static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | 955 | static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) |
| 956 | { | 956 | { |
| 957 | struct Scsi_Host *instance = cmd->device->host; | 957 | struct Scsi_Host *instance = cmd->device->host; |
| 958 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 958 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; |
| @@ -1021,6 +1021,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
| 1021 | return 0; | 1021 | return 0; |
| 1022 | } | 1022 | } |
| 1023 | 1023 | ||
| 1024 | static DEF_SCSI_QCMD(NCR5380_queue_command) | ||
| 1024 | 1025 | ||
| 1025 | /** | 1026 | /** |
| 1026 | * NCR5380_main - NCR state machines | 1027 | * NCR5380_main - NCR state machines |
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h index bdc468c9e1d..fd40a32b1f6 100644 --- a/drivers/scsi/NCR5380.h +++ b/drivers/scsi/NCR5380.h | |||
| @@ -313,7 +313,7 @@ static void NCR5380_print(struct Scsi_Host *instance); | |||
| 313 | #endif | 313 | #endif |
| 314 | static int NCR5380_abort(Scsi_Cmnd * cmd); | 314 | static int NCR5380_abort(Scsi_Cmnd * cmd); |
| 315 | static int NCR5380_bus_reset(Scsi_Cmnd * cmd); | 315 | static int NCR5380_bus_reset(Scsi_Cmnd * cmd); |
| 316 | static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)); | 316 | static int NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 317 | static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance, | 317 | static int __maybe_unused NCR5380_proc_info(struct Scsi_Host *instance, |
| 318 | char *buffer, char **start, off_t offset, int length, int inout); | 318 | char *buffer, char **start, off_t offset, int length, int inout); |
| 319 | 319 | ||
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index 6961f78742a..c91888a0a23 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c | |||
| @@ -693,7 +693,7 @@ static void wait_intr(void) | |||
| 693 | } | 693 | } |
| 694 | #endif | 694 | #endif |
| 695 | 695 | ||
| 696 | static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | 696 | static int NCR53c406a_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) |
| 697 | { | 697 | { |
| 698 | int i; | 698 | int i; |
| 699 | 699 | ||
| @@ -726,6 +726,8 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | |||
| 726 | return 0; | 726 | return 0; |
| 727 | } | 727 | } |
| 728 | 728 | ||
| 729 | static DEF_SCSI_QCMD(NCR53c406a_queue) | ||
| 730 | |||
| 729 | static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) | 731 | static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt) |
| 730 | { | 732 | { |
| 731 | DEB(printk("NCR53c406a_reset called\n")); | 733 | DEB(printk("NCR53c406a_reset called\n")); |
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index dbbc601948e..dc5ac6e528c 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c | |||
| @@ -911,7 +911,7 @@ static int inia100_build_scb(struct orc_host * host, struct orc_scb * scb, struc | |||
| 911 | * queue the command down to the controller | 911 | * queue the command down to the controller |
| 912 | */ | 912 | */ |
| 913 | 913 | ||
| 914 | static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) | 914 | static int inia100_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) |
| 915 | { | 915 | { |
| 916 | struct orc_scb *scb; | 916 | struct orc_scb *scb; |
| 917 | struct orc_host *host; /* Point to Host adapter control block */ | 917 | struct orc_host *host; /* Point to Host adapter control block */ |
| @@ -930,6 +930,8 @@ static int inia100_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd | |||
| 930 | return 0; | 930 | return 0; |
| 931 | } | 931 | } |
| 932 | 932 | ||
| 933 | static DEF_SCSI_QCMD(inia100_queue) | ||
| 934 | |||
| 933 | /***************************************************************************** | 935 | /***************************************************************************** |
| 934 | Function name : inia100_abort | 936 | Function name : inia100_abort |
| 935 | Description : Abort a queued command. | 937 | Description : Abort a queued command. |
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 29c0ed1cf50..2c93d9496d6 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
| @@ -248,7 +248,7 @@ static struct aac_driver_ident aac_drivers[] = { | |||
| 248 | * TODO: unify with aac_scsi_cmd(). | 248 | * TODO: unify with aac_scsi_cmd(). |
| 249 | */ | 249 | */ |
| 250 | 250 | ||
| 251 | static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 251 | static int aac_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 252 | { | 252 | { |
| 253 | struct Scsi_Host *host = cmd->device->host; | 253 | struct Scsi_Host *host = cmd->device->host; |
| 254 | struct aac_dev *dev = (struct aac_dev *)host->hostdata; | 254 | struct aac_dev *dev = (struct aac_dev *)host->hostdata; |
| @@ -267,6 +267,8 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd | |||
| 267 | return (aac_scsi_cmd(cmd) ? FAILED : 0); | 267 | return (aac_scsi_cmd(cmd) ? FAILED : 0); |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | static DEF_SCSI_QCMD(aac_queuecommand) | ||
| 271 | |||
| 270 | /** | 272 | /** |
| 271 | * aac_info - Returns the host adapter name | 273 | * aac_info - Returns the host adapter name |
| 272 | * @shost: Scsi host to report on | 274 | * @shost: Scsi host to report on |
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 0ec3da6f3e1..081c6de92bc 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
| @@ -9500,7 +9500,7 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp) | |||
| 9500 | * in the 'scp' result field. | 9500 | * in the 'scp' result field. |
| 9501 | */ | 9501 | */ |
| 9502 | static int | 9502 | static int |
| 9503 | advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) | 9503 | advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) |
| 9504 | { | 9504 | { |
| 9505 | struct Scsi_Host *shost = scp->device->host; | 9505 | struct Scsi_Host *shost = scp->device->host; |
| 9506 | int asc_res, result = 0; | 9506 | int asc_res, result = 0; |
| @@ -9525,6 +9525,8 @@ advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) | |||
| 9525 | return result; | 9525 | return result; |
| 9526 | } | 9526 | } |
| 9527 | 9527 | ||
| 9528 | static DEF_SCSI_QCMD(advansys_queuecommand) | ||
| 9529 | |||
| 9528 | static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) | 9530 | static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base) |
| 9529 | { | 9531 | { |
| 9530 | PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | | 9532 | PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | |
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 8eab8587ff2..c5169f01c1c 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c | |||
| @@ -1056,7 +1056,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete, | |||
| 1056 | * queue a command | 1056 | * queue a command |
| 1057 | * | 1057 | * |
| 1058 | */ | 1058 | */ |
| 1059 | static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) | 1059 | static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) |
| 1060 | { | 1060 | { |
| 1061 | #if 0 | 1061 | #if 0 |
| 1062 | if(*SCpnt->cmnd == REQUEST_SENSE) { | 1062 | if(*SCpnt->cmnd == REQUEST_SENSE) { |
| @@ -1070,6 +1070,8 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) | |||
| 1070 | return aha152x_internal_queue(SCpnt, NULL, 0, done); | 1070 | return aha152x_internal_queue(SCpnt, NULL, 0, done); |
| 1071 | } | 1071 | } |
| 1072 | 1072 | ||
| 1073 | static DEF_SCSI_QCMD(aha152x_queue) | ||
| 1074 | |||
| 1073 | 1075 | ||
| 1074 | /* | 1076 | /* |
| 1075 | * | 1077 | * |
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 4f785f254c1..195823a51aa 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
| @@ -558,7 +558,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
| 558 | }; | 558 | }; |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | 561 | static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) |
| 562 | { | 562 | { |
| 563 | unchar ahacmd = CMD_START_SCSI; | 563 | unchar ahacmd = CMD_START_SCSI; |
| 564 | unchar direction; | 564 | unchar direction; |
| @@ -718,6 +718,8 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | |||
| 718 | return 0; | 718 | return 0; |
| 719 | } | 719 | } |
| 720 | 720 | ||
| 721 | static DEF_SCSI_QCMD(aha1542_queuecommand) | ||
| 722 | |||
| 721 | /* Initialize mailboxes */ | 723 | /* Initialize mailboxes */ |
| 722 | static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) | 724 | static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) |
| 723 | { | 725 | { |
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h index 1db538552d5..b871d2b57f9 100644 --- a/drivers/scsi/aha1542.h +++ b/drivers/scsi/aha1542.h | |||
| @@ -132,7 +132,7 @@ struct ccb { /* Command Control Block 5.3 */ | |||
| 132 | }; | 132 | }; |
| 133 | 133 | ||
| 134 | static int aha1542_detect(struct scsi_host_template *); | 134 | static int aha1542_detect(struct scsi_host_template *); |
| 135 | static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); | 135 | static int aha1542_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 136 | static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); | 136 | static int aha1542_bus_reset(Scsi_Cmnd * SCpnt); |
| 137 | static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); | 137 | static int aha1542_dev_reset(Scsi_Cmnd * SCpnt); |
| 138 | static int aha1542_host_reset(Scsi_Cmnd * SCpnt); | 138 | static int aha1542_host_reset(Scsi_Cmnd * SCpnt); |
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index 0107a4cc333..d058f1ab82b 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c | |||
| @@ -331,7 +331,7 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id) | |||
| 331 | return IRQ_RETVAL(handled); | 331 | return IRQ_RETVAL(handled); |
| 332 | } | 332 | } |
| 333 | 333 | ||
| 334 | static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) | 334 | static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) |
| 335 | { | 335 | { |
| 336 | unchar direction; | 336 | unchar direction; |
| 337 | unchar *cmd = (unchar *) SCpnt->cmnd; | 337 | unchar *cmd = (unchar *) SCpnt->cmnd; |
| @@ -503,6 +503,8 @@ static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) | |||
| 503 | return 0; | 503 | return 0; |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | static DEF_SCSI_QCMD(aha1740_queuecommand) | ||
| 507 | |||
| 506 | /* Query the board for its irq_level and irq_type. Nothing else matters | 508 | /* Query the board for its irq_level and irq_type. Nothing else matters |
| 507 | in enhanced mode on an EISA bus. */ | 509 | in enhanced mode on an EISA bus. */ |
| 508 | 510 | ||
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 88ad8482ef5..25d06662447 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c | |||
| @@ -573,7 +573,7 @@ ahd_linux_info(struct Scsi_Host *host) | |||
| 573 | * Queue an SCB to the controller. | 573 | * Queue an SCB to the controller. |
| 574 | */ | 574 | */ |
| 575 | static int | 575 | static int |
| 576 | ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) | 576 | ahd_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) |
| 577 | { | 577 | { |
| 578 | struct ahd_softc *ahd; | 578 | struct ahd_softc *ahd; |
| 579 | struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); | 579 | struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); |
| @@ -588,6 +588,8 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) | |||
| 588 | return rtn; | 588 | return rtn; |
| 589 | } | 589 | } |
| 590 | 590 | ||
| 591 | static DEF_SCSI_QCMD(ahd_linux_queue) | ||
| 592 | |||
| 591 | static struct scsi_target ** | 593 | static struct scsi_target ** |
| 592 | ahd_linux_target_in_softc(struct scsi_target *starget) | 594 | ahd_linux_target_in_softc(struct scsi_target *starget) |
| 593 | { | 595 | { |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index aeea7a61478..4a359bb307c 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
| @@ -528,7 +528,7 @@ ahc_linux_info(struct Scsi_Host *host) | |||
| 528 | * Queue an SCB to the controller. | 528 | * Queue an SCB to the controller. |
| 529 | */ | 529 | */ |
| 530 | static int | 530 | static int |
| 531 | ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) | 531 | ahc_linux_queue_lck(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) |
| 532 | { | 532 | { |
| 533 | struct ahc_softc *ahc; | 533 | struct ahc_softc *ahc; |
| 534 | struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); | 534 | struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); |
| @@ -548,6 +548,8 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) | |||
| 548 | return rtn; | 548 | return rtn; |
| 549 | } | 549 | } |
| 550 | 550 | ||
| 551 | static DEF_SCSI_QCMD(ahc_linux_queue) | ||
| 552 | |||
| 551 | static inline struct scsi_target ** | 553 | static inline struct scsi_target ** |
| 552 | ahc_linux_target_in_softc(struct scsi_target *starget) | 554 | ahc_linux_target_in_softc(struct scsi_target *starget) |
| 553 | { | 555 | { |
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index aee73fafccc..4ff60a08df0 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c | |||
| @@ -10234,7 +10234,7 @@ static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd, | |||
| 10234 | * Description: | 10234 | * Description: |
| 10235 | * Queue a SCB to the controller. | 10235 | * Queue a SCB to the controller. |
| 10236 | *-F*************************************************************************/ | 10236 | *-F*************************************************************************/ |
| 10237 | static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) | 10237 | static int aic7xxx_queue_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) |
| 10238 | { | 10238 | { |
| 10239 | struct aic7xxx_host *p; | 10239 | struct aic7xxx_host *p; |
| 10240 | struct aic7xxx_scb *scb; | 10240 | struct aic7xxx_scb *scb; |
| @@ -10292,6 +10292,8 @@ static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) | |||
| 10292 | return (0); | 10292 | return (0); |
| 10293 | } | 10293 | } |
| 10294 | 10294 | ||
| 10295 | static DEF_SCSI_QCMD(aic7xxx_queue) | ||
| 10296 | |||
| 10295 | /*+F************************************************************************* | 10297 | /*+F************************************************************************* |
| 10296 | * Function: | 10298 | * Function: |
| 10297 | * aic7xxx_bus_device_reset | 10299 | * aic7xxx_bus_device_reset |
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 05a78e515a2..17e3df4f016 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c | |||
| @@ -85,8 +85,7 @@ static int arcmsr_abort(struct scsi_cmnd *); | |||
| 85 | static int arcmsr_bus_reset(struct scsi_cmnd *); | 85 | static int arcmsr_bus_reset(struct scsi_cmnd *); |
| 86 | static int arcmsr_bios_param(struct scsi_device *sdev, | 86 | static int arcmsr_bios_param(struct scsi_device *sdev, |
| 87 | struct block_device *bdev, sector_t capacity, int *info); | 87 | struct block_device *bdev, sector_t capacity, int *info); |
| 88 | static int arcmsr_queue_command(struct scsi_cmnd *cmd, | 88 | static int arcmsr_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 89 | void (*done) (struct scsi_cmnd *)); | ||
| 90 | static int arcmsr_probe(struct pci_dev *pdev, | 89 | static int arcmsr_probe(struct pci_dev *pdev, |
| 91 | const struct pci_device_id *id); | 90 | const struct pci_device_id *id); |
| 92 | static void arcmsr_remove(struct pci_dev *pdev); | 91 | static void arcmsr_remove(struct pci_dev *pdev); |
| @@ -2081,7 +2080,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb, | |||
| 2081 | } | 2080 | } |
| 2082 | } | 2081 | } |
| 2083 | 2082 | ||
| 2084 | static int arcmsr_queue_command(struct scsi_cmnd *cmd, | 2083 | static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, |
| 2085 | void (* done)(struct scsi_cmnd *)) | 2084 | void (* done)(struct scsi_cmnd *)) |
| 2086 | { | 2085 | { |
| 2087 | struct Scsi_Host *host = cmd->device->host; | 2086 | struct Scsi_Host *host = cmd->device->host; |
| @@ -2124,6 +2123,8 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd, | |||
| 2124 | return 0; | 2123 | return 0; |
| 2125 | } | 2124 | } |
| 2126 | 2125 | ||
| 2126 | static DEF_SCSI_QCMD(arcmsr_queue_command) | ||
| 2127 | |||
| 2127 | static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) | 2128 | static bool arcmsr_get_hba_config(struct AdapterControlBlock *acb) |
| 2128 | { | 2129 | { |
| 2129 | struct MessageUnit_A __iomem *reg = acb->pmuA; | 2130 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index 918ccf81875..ec166726b31 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c | |||
| @@ -2511,7 +2511,7 @@ acornscsi_intr(int irq, void *dev_id) | |||
| 2511 | * done - function called on completion, with pointer to command descriptor | 2511 | * done - function called on completion, with pointer to command descriptor |
| 2512 | * Returns : 0, or < 0 on error. | 2512 | * Returns : 0, or < 0 on error. |
| 2513 | */ | 2513 | */ |
| 2514 | int acornscsi_queuecmd(struct scsi_cmnd *SCpnt, | 2514 | static int acornscsi_queuecmd_lck(struct scsi_cmnd *SCpnt, |
| 2515 | void (*done)(struct scsi_cmnd *)) | 2515 | void (*done)(struct scsi_cmnd *)) |
| 2516 | { | 2516 | { |
| 2517 | AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; | 2517 | AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; |
| @@ -2561,6 +2561,8 @@ int acornscsi_queuecmd(struct scsi_cmnd *SCpnt, | |||
| 2561 | return 0; | 2561 | return 0; |
| 2562 | } | 2562 | } |
| 2563 | 2563 | ||
| 2564 | DEF_SCSI_QCMD(acornscsi_queuecmd) | ||
| 2565 | |||
| 2564 | /* | 2566 | /* |
| 2565 | * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) | 2567 | * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result) |
| 2566 | * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 | 2568 | * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 |
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index 9e71ac61114..2b2ce21e227 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c | |||
| @@ -2198,7 +2198,7 @@ no_command: | |||
| 2198 | * Returns: 0 on success, else error. | 2198 | * Returns: 0 on success, else error. |
| 2199 | * Notes: io_request_lock is held, interrupts are disabled. | 2199 | * Notes: io_request_lock is held, interrupts are disabled. |
| 2200 | */ | 2200 | */ |
| 2201 | int fas216_queue_command(struct scsi_cmnd *SCpnt, | 2201 | static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt, |
| 2202 | void (*done)(struct scsi_cmnd *)) | 2202 | void (*done)(struct scsi_cmnd *)) |
| 2203 | { | 2203 | { |
| 2204 | FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; | 2204 | FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; |
| @@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt, | |||
| 2240 | return result; | 2240 | return result; |
| 2241 | } | 2241 | } |
| 2242 | 2242 | ||
| 2243 | DEF_SCSI_QCMD(fas216_queue_command) | ||
| 2244 | |||
| 2243 | /** | 2245 | /** |
| 2244 | * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command | 2246 | * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command |
| 2245 | * @SCpnt: Command to wake | 2247 | * @SCpnt: Command to wake |
| @@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt) | |||
| 2263 | * Returns: scsi result code. | 2265 | * Returns: scsi result code. |
| 2264 | * Notes: io_request_lock is held, interrupts are disabled. | 2266 | * Notes: io_request_lock is held, interrupts are disabled. |
| 2265 | */ | 2267 | */ |
| 2266 | int fas216_noqueue_command(struct scsi_cmnd *SCpnt, | 2268 | static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt, |
| 2267 | void (*done)(struct scsi_cmnd *)) | 2269 | void (*done)(struct scsi_cmnd *)) |
| 2268 | { | 2270 | { |
| 2269 | FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; | 2271 | FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; |
| @@ -2277,7 +2279,7 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt, | |||
| 2277 | BUG_ON(info->scsi.irq != NO_IRQ); | 2279 | BUG_ON(info->scsi.irq != NO_IRQ); |
| 2278 | 2280 | ||
| 2279 | info->internal_done = 0; | 2281 | info->internal_done = 0; |
| 2280 | fas216_queue_command(SCpnt, fas216_internal_done); | 2282 | fas216_queue_command_lck(SCpnt, fas216_internal_done); |
| 2281 | 2283 | ||
| 2282 | /* | 2284 | /* |
| 2283 | * This wastes time, since we can't return until the command is | 2285 | * This wastes time, since we can't return until the command is |
| @@ -2310,6 +2312,8 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt, | |||
| 2310 | return 0; | 2312 | return 0; |
| 2311 | } | 2313 | } |
| 2312 | 2314 | ||
| 2315 | DEF_SCSI_QCMD(fas216_noqueue_command) | ||
| 2316 | |||
| 2313 | /* | 2317 | /* |
| 2314 | * Error handler timeout function. Indicate that we timed out, | 2318 | * Error handler timeout function. Indicate that we timed out, |
| 2315 | * and wake up any error handler process so it can continue. | 2319 | * and wake up any error handler process so it can continue. |
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h index b65f4cf0eec..377cfb72cc6 100644 --- a/drivers/scsi/arm/fas216.h +++ b/drivers/scsi/arm/fas216.h | |||
| @@ -331,23 +331,21 @@ extern int fas216_init (struct Scsi_Host *instance); | |||
| 331 | */ | 331 | */ |
| 332 | extern int fas216_add (struct Scsi_Host *instance, struct device *dev); | 332 | extern int fas216_add (struct Scsi_Host *instance, struct device *dev); |
| 333 | 333 | ||
| 334 | /* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 334 | /* Function: int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) |
| 335 | * Purpose : queue a command for adapter to process. | 335 | * Purpose : queue a command for adapter to process. |
| 336 | * Params : SCpnt - Command to queue | 336 | * Params : h - host adapter |
| 337 | * done - done function to call once command is complete | 337 | * : SCpnt - Command to queue |
| 338 | * Returns : 0 - success, else error | 338 | * Returns : 0 - success, else error |
| 339 | */ | 339 | */ |
| 340 | extern int fas216_queue_command(struct scsi_cmnd *, | 340 | extern int fas216_queue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); |
| 341 | void (*done)(struct scsi_cmnd *)); | ||
| 342 | 341 | ||
| 343 | /* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 342 | /* Function: int fas216_noqueue_command(struct Scsi_Host *h, struct scsi_cmnd *SCpnt) |
| 344 | * Purpose : queue a command for adapter to process, and process it to completion. | 343 | * Purpose : queue a command for adapter to process, and process it to completion. |
| 345 | * Params : SCpnt - Command to queue | 344 | * Params : h - host adapter |
| 346 | * done - done function to call once command is complete | 345 | * : SCpnt - Command to queue |
| 347 | * Returns : 0 - success, else error | 346 | * Returns : 0 - success, else error |
| 348 | */ | 347 | */ |
| 349 | extern int fas216_noqueue_command(struct scsi_cmnd *, | 348 | extern int fas216_noqueue_command(struct Scsi_Host *, struct scsi_cmnd *) |
| 350 | void (*done)(struct scsi_cmnd *)); | ||
| 351 | 349 | ||
| 352 | /* Function: irqreturn_t fas216_intr (FAS216_Info *info) | 350 | /* Function: irqreturn_t fas216_intr (FAS216_Info *info) |
| 353 | * Purpose : handle interrupts from the interface to progress a command | 351 | * Purpose : handle interrupts from the interface to progress a command |
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 158ebc3644d..88b2928b4d3 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
| @@ -910,7 +910,7 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags) | |||
| 910 | * | 910 | * |
| 911 | */ | 911 | */ |
| 912 | 912 | ||
| 913 | static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) | 913 | static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) |
| 914 | { | 914 | { |
| 915 | SETUP_HOSTDATA(cmd->device->host); | 915 | SETUP_HOSTDATA(cmd->device->host); |
| 916 | Scsi_Cmnd *tmp; | 916 | Scsi_Cmnd *tmp; |
| @@ -1022,6 +1022,8 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) | |||
| 1022 | return 0; | 1022 | return 0; |
| 1023 | } | 1023 | } |
| 1024 | 1024 | ||
| 1025 | static DEF_SCSI_QCMD(NCR5380_queue_command) | ||
| 1026 | |||
| 1025 | /* | 1027 | /* |
| 1026 | * Function : NCR5380_main (void) | 1028 | * Function : NCR5380_main (void) |
| 1027 | * | 1029 | * |
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index ad7a23aef0e..3e8658e2f15 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c | |||
| @@ -572,23 +572,6 @@ static void falcon_get_lock(void) | |||
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | 574 | ||
| 575 | /* This is the wrapper function for NCR5380_queue_command(). It just | ||
| 576 | * tries to get the lock on the ST-DMA (see above) and then calls the | ||
| 577 | * original function. | ||
| 578 | */ | ||
| 579 | |||
| 580 | #if 0 | ||
| 581 | int atari_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) | ||
| 582 | { | ||
| 583 | /* falcon_get_lock(); | ||
| 584 | * ++guenther: moved to NCR5380_queue_command() to prevent | ||
| 585 | * race condition, see there for an explanation. | ||
| 586 | */ | ||
| 587 | return NCR5380_queue_command(cmd, done); | ||
| 588 | } | ||
| 589 | #endif | ||
| 590 | |||
| 591 | |||
| 592 | int __init atari_scsi_detect(struct scsi_host_template *host) | 575 | int __init atari_scsi_detect(struct scsi_host_template *host) |
| 593 | { | 576 | { |
| 594 | static int called = 0; | 577 | static int called = 0; |
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index ab5bdda6903..76029d570be 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c | |||
| @@ -605,7 +605,7 @@ handled: | |||
| 605 | * | 605 | * |
| 606 | * Queue a command to the ATP queue. Called with the host lock held. | 606 | * Queue a command to the ATP queue. Called with the host lock held. |
| 607 | */ | 607 | */ |
| 608 | static int atp870u_queuecommand(struct scsi_cmnd * req_p, | 608 | static int atp870u_queuecommand_lck(struct scsi_cmnd *req_p, |
| 609 | void (*done) (struct scsi_cmnd *)) | 609 | void (*done) (struct scsi_cmnd *)) |
| 610 | { | 610 | { |
| 611 | unsigned char c; | 611 | unsigned char c; |
| @@ -694,6 +694,8 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p, | |||
| 694 | return 0; | 694 | return 0; |
| 695 | } | 695 | } |
| 696 | 696 | ||
| 697 | static DEF_SCSI_QCMD(atp870u_queuecommand) | ||
| 698 | |||
| 697 | /** | 699 | /** |
| 698 | * send_s870 - send a command to the controller | 700 | * send_s870 - send a command to the controller |
| 699 | * @host: host | 701 | * @host: host |
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 8daa716739d..8ca967dee66 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
| @@ -30,8 +30,7 @@ DEFINE_IDR(bfad_im_port_index); | |||
| 30 | struct scsi_transport_template *bfad_im_scsi_transport_template; | 30 | struct scsi_transport_template *bfad_im_scsi_transport_template; |
| 31 | struct scsi_transport_template *bfad_im_scsi_vport_transport_template; | 31 | struct scsi_transport_template *bfad_im_scsi_vport_transport_template; |
| 32 | static void bfad_im_itnim_work_handler(struct work_struct *work); | 32 | static void bfad_im_itnim_work_handler(struct work_struct *work); |
| 33 | static int bfad_im_queuecommand(struct scsi_cmnd *cmnd, | 33 | static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd); |
| 34 | void (*done)(struct scsi_cmnd *)); | ||
| 35 | static int bfad_im_slave_alloc(struct scsi_device *sdev); | 34 | static int bfad_im_slave_alloc(struct scsi_device *sdev); |
| 36 | static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, | 35 | static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, |
| 37 | struct bfad_itnim_s *itnim); | 36 | struct bfad_itnim_s *itnim); |
| @@ -1120,7 +1119,7 @@ bfad_im_itnim_work_handler(struct work_struct *work) | |||
| 1120 | * Scsi_Host template entry, queue a SCSI command to the BFAD. | 1119 | * Scsi_Host template entry, queue a SCSI command to the BFAD. |
| 1121 | */ | 1120 | */ |
| 1122 | static int | 1121 | static int |
| 1123 | bfad_im_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) | 1122 | bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) |
| 1124 | { | 1123 | { |
| 1125 | struct bfad_im_port_s *im_port = | 1124 | struct bfad_im_port_s *im_port = |
| 1126 | (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; | 1125 | (struct bfad_im_port_s *) cmnd->device->host->hostdata[0]; |
| @@ -1187,6 +1186,8 @@ out_fail_cmd: | |||
| 1187 | return 0; | 1186 | return 0; |
| 1188 | } | 1187 | } |
| 1189 | 1188 | ||
| 1189 | static DEF_SCSI_QCMD(bfad_im_queuecommand) | ||
| 1190 | |||
| 1190 | void | 1191 | void |
| 1191 | bfad_os_rport_online_wait(struct bfad_s *bfad) | 1192 | bfad_os_rport_online_wait(struct bfad_s *bfad) |
| 1192 | { | 1193 | { |
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 54f50b07dac..8f1b5c8bf90 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
| @@ -1080,7 +1080,7 @@ static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb, | |||
| 1080 | * and is expected to be held on return. | 1080 | * and is expected to be held on return. |
| 1081 | * | 1081 | * |
| 1082 | **/ | 1082 | **/ |
| 1083 | static int dc395x_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 1083 | static int dc395x_queue_command_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 1084 | { | 1084 | { |
| 1085 | struct DeviceCtlBlk *dcb; | 1085 | struct DeviceCtlBlk *dcb; |
| 1086 | struct ScsiReqBlk *srb; | 1086 | struct ScsiReqBlk *srb; |
| @@ -1154,6 +1154,7 @@ complete: | |||
| 1154 | return 0; | 1154 | return 0; |
| 1155 | } | 1155 | } |
| 1156 | 1156 | ||
| 1157 | static DEF_SCSI_QCMD(dc395x_queue_command) | ||
| 1157 | 1158 | ||
| 1158 | /* | 1159 | /* |
| 1159 | * Return the disk geometry for the given SCSI device. | 1160 | * Return the disk geometry for the given SCSI device. |
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 23dec006338..cffcb108ac9 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
| @@ -423,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device) | |||
| 423 | return 0; | 423 | return 0; |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) | 426 | static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) |
| 427 | { | 427 | { |
| 428 | adpt_hba* pHba = NULL; | 428 | adpt_hba* pHba = NULL; |
| 429 | struct adpt_device* pDev = NULL; /* dpt per device information */ | 429 | struct adpt_device* pDev = NULL; /* dpt per device information */ |
| @@ -491,6 +491,8 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) | |||
| 491 | return adpt_scsi_to_i2o(pHba, cmd, pDev); | 491 | return adpt_scsi_to_i2o(pHba, cmd, pDev); |
| 492 | } | 492 | } |
| 493 | 493 | ||
| 494 | static DEF_SCSI_QCMD(adpt_queue) | ||
| 495 | |||
| 494 | static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, | 496 | static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, |
| 495 | sector_t capacity, int geom[]) | 497 | sector_t capacity, int geom[]) |
| 496 | { | 498 | { |
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h index 337746d4604..beded716f93 100644 --- a/drivers/scsi/dpti.h +++ b/drivers/scsi/dpti.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | static int adpt_detect(struct scsi_host_template * sht); | 31 | static int adpt_detect(struct scsi_host_template * sht); |
| 32 | static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); | 32 | static int adpt_queue(struct Scsi_Host *h, struct scsi_cmnd * cmd); |
| 33 | static int adpt_abort(struct scsi_cmnd * cmd); | 33 | static int adpt_abort(struct scsi_cmnd * cmd); |
| 34 | static int adpt_reset(struct scsi_cmnd* cmd); | 34 | static int adpt_reset(struct scsi_cmnd* cmd); |
| 35 | static int adpt_release(struct Scsi_Host *host); | 35 | static int adpt_release(struct Scsi_Host *host); |
diff --git a/drivers/scsi/dtc.h b/drivers/scsi/dtc.h index 0b205f8c732..cdc621204b6 100644 --- a/drivers/scsi/dtc.h +++ b/drivers/scsi/dtc.h | |||
| @@ -36,7 +36,7 @@ static int dtc_abort(Scsi_Cmnd *); | |||
| 36 | static int dtc_biosparam(struct scsi_device *, struct block_device *, | 36 | static int dtc_biosparam(struct scsi_device *, struct block_device *, |
| 37 | sector_t, int*); | 37 | sector_t, int*); |
| 38 | static int dtc_detect(struct scsi_host_template *); | 38 | static int dtc_detect(struct scsi_host_template *); |
| 39 | static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); | 39 | static int dtc_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 40 | static int dtc_bus_reset(Scsi_Cmnd *); | 40 | static int dtc_bus_reset(Scsi_Cmnd *); |
| 41 | 41 | ||
| 42 | #ifndef CMD_PER_LUN | 42 | #ifndef CMD_PER_LUN |
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index d1c31378f6d..53925ac178f 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c | |||
| @@ -505,8 +505,7 @@ | |||
| 505 | 505 | ||
| 506 | static int eata2x_detect(struct scsi_host_template *); | 506 | static int eata2x_detect(struct scsi_host_template *); |
| 507 | static int eata2x_release(struct Scsi_Host *); | 507 | static int eata2x_release(struct Scsi_Host *); |
| 508 | static int eata2x_queuecommand(struct scsi_cmnd *, | 508 | static int eata2x_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 509 | void (*done) (struct scsi_cmnd *)); | ||
| 510 | static int eata2x_eh_abort(struct scsi_cmnd *); | 509 | static int eata2x_eh_abort(struct scsi_cmnd *); |
| 511 | static int eata2x_eh_host_reset(struct scsi_cmnd *); | 510 | static int eata2x_eh_host_reset(struct scsi_cmnd *); |
| 512 | static int eata2x_bios_param(struct scsi_device *, struct block_device *, | 511 | static int eata2x_bios_param(struct scsi_device *, struct block_device *, |
| @@ -1758,7 +1757,7 @@ static void scsi_to_dev_dir(unsigned int i, struct hostdata *ha) | |||
| 1758 | 1757 | ||
| 1759 | } | 1758 | } |
| 1760 | 1759 | ||
| 1761 | static int eata2x_queuecommand(struct scsi_cmnd *SCpnt, | 1760 | static int eata2x_queuecommand_lck(struct scsi_cmnd *SCpnt, |
| 1762 | void (*done) (struct scsi_cmnd *)) | 1761 | void (*done) (struct scsi_cmnd *)) |
| 1763 | { | 1762 | { |
| 1764 | struct Scsi_Host *shost = SCpnt->device->host; | 1763 | struct Scsi_Host *shost = SCpnt->device->host; |
| @@ -1843,6 +1842,8 @@ static int eata2x_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 1843 | return 0; | 1842 | return 0; |
| 1844 | } | 1843 | } |
| 1845 | 1844 | ||
| 1845 | static DEF_SCSI_QCMD(eata2x_queuecommand) | ||
| 1846 | |||
| 1846 | static int eata2x_eh_abort(struct scsi_cmnd *SCarg) | 1847 | static int eata2x_eh_abort(struct scsi_cmnd *SCarg) |
| 1847 | { | 1848 | { |
| 1848 | struct Scsi_Host *shost = SCarg->device->host; | 1849 | struct Scsi_Host *shost = SCarg->device->host; |
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c index 60886c19065..4a9641e69f5 100644 --- a/drivers/scsi/eata_pio.c +++ b/drivers/scsi/eata_pio.c | |||
| @@ -335,7 +335,7 @@ static inline unsigned int eata_pio_send_command(unsigned long base, unsigned ch | |||
| 335 | return 0; | 335 | return 0; |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | static int eata_pio_queue(struct scsi_cmnd *cmd, | 338 | static int eata_pio_queue_lck(struct scsi_cmnd *cmd, |
| 339 | void (*done)(struct scsi_cmnd *)) | 339 | void (*done)(struct scsi_cmnd *)) |
| 340 | { | 340 | { |
| 341 | unsigned int x, y; | 341 | unsigned int x, y; |
| @@ -438,6 +438,8 @@ static int eata_pio_queue(struct scsi_cmnd *cmd, | |||
| 438 | return 0; | 438 | return 0; |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | static DEF_SCSI_QCMD(eata_pio_queue) | ||
| 442 | |||
| 441 | static int eata_pio_abort(struct scsi_cmnd *cmd) | 443 | static int eata_pio_abort(struct scsi_cmnd *cmd) |
| 442 | { | 444 | { |
| 443 | unsigned int loop = 100; | 445 | unsigned int loop = 100; |
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index e2bc779f86c..57558523c1b 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c | |||
| @@ -916,7 +916,7 @@ static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent) | |||
| 916 | scsi_track_queue_full(dev, lp->num_tagged - 1); | 916 | scsi_track_queue_full(dev, lp->num_tagged - 1); |
| 917 | } | 917 | } |
| 918 | 918 | ||
| 919 | static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 919 | static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 920 | { | 920 | { |
| 921 | struct scsi_device *dev = cmd->device; | 921 | struct scsi_device *dev = cmd->device; |
| 922 | struct esp *esp = shost_priv(dev->host); | 922 | struct esp *esp = shost_priv(dev->host); |
| @@ -941,6 +941,8 @@ static int esp_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd | |||
| 941 | return 0; | 941 | return 0; |
| 942 | } | 942 | } |
| 943 | 943 | ||
| 944 | static DEF_SCSI_QCMD(esp_queuecommand) | ||
| 945 | |||
| 944 | static int esp_check_gross_error(struct esp *esp) | 946 | static int esp_check_gross_error(struct esp *esp) |
| 945 | { | 947 | { |
| 946 | if (esp->sreg & ESP_STAT_SPAM) { | 948 | if (esp->sreg & ESP_STAT_SPAM) { |
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c index 2ad95aa8f58..a2c6135d337 100644 --- a/drivers/scsi/fd_mcs.c +++ b/drivers/scsi/fd_mcs.c | |||
| @@ -1072,7 +1072,7 @@ static int fd_mcs_release(struct Scsi_Host *shpnt) | |||
| 1072 | return 0; | 1072 | return 0; |
| 1073 | } | 1073 | } |
| 1074 | 1074 | ||
| 1075 | static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | 1075 | static int fd_mcs_queue_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) |
| 1076 | { | 1076 | { |
| 1077 | struct Scsi_Host *shpnt = SCpnt->device->host; | 1077 | struct Scsi_Host *shpnt = SCpnt->device->host; |
| 1078 | 1078 | ||
| @@ -1122,6 +1122,8 @@ static int fd_mcs_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | |||
| 1122 | return 0; | 1122 | return 0; |
| 1123 | } | 1123 | } |
| 1124 | 1124 | ||
| 1125 | static DEF_SCSI_QCMD(fd_mcs_queue) | ||
| 1126 | |||
| 1125 | #if DEBUG_ABORT || DEBUG_RESET | 1127 | #if DEBUG_ABORT || DEBUG_RESET |
| 1126 | static void fd_mcs_print_info(Scsi_Cmnd * SCpnt) | 1128 | static void fd_mcs_print_info(Scsi_Cmnd * SCpnt) |
| 1127 | { | 1129 | { |
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index e296bcc57d5..69b7aa54f43 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c | |||
| @@ -1419,7 +1419,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id) | |||
| 1419 | return IRQ_HANDLED; | 1419 | return IRQ_HANDLED; |
| 1420 | } | 1420 | } |
| 1421 | 1421 | ||
| 1422 | static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, | 1422 | static int fdomain_16x0_queue_lck(struct scsi_cmnd *SCpnt, |
| 1423 | void (*done)(struct scsi_cmnd *)) | 1423 | void (*done)(struct scsi_cmnd *)) |
| 1424 | { | 1424 | { |
| 1425 | if (in_command) { | 1425 | if (in_command) { |
| @@ -1469,6 +1469,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, | |||
| 1469 | return 0; | 1469 | return 0; |
| 1470 | } | 1470 | } |
| 1471 | 1471 | ||
| 1472 | static DEF_SCSI_QCMD(fdomain_16x0_queue) | ||
| 1473 | |||
| 1472 | #if DEBUG_ABORT | 1474 | #if DEBUG_ABORT |
| 1473 | static void print_info(struct scsi_cmnd *SCpnt) | 1475 | static void print_info(struct scsi_cmnd *SCpnt) |
| 1474 | { | 1476 | { |
diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h index cbb20b13b22..92f185081e6 100644 --- a/drivers/scsi/fnic/fnic.h +++ b/drivers/scsi/fnic/fnic.h | |||
| @@ -246,7 +246,7 @@ void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *); | |||
| 246 | void fnic_update_mac(struct fc_lport *, u8 *new); | 246 | void fnic_update_mac(struct fc_lport *, u8 *new); |
| 247 | void fnic_update_mac_locked(struct fnic *, u8 *new); | 247 | void fnic_update_mac_locked(struct fnic *, u8 *new); |
| 248 | 248 | ||
| 249 | int fnic_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); | 249 | int fnic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 250 | int fnic_abort_cmd(struct scsi_cmnd *); | 250 | int fnic_abort_cmd(struct scsi_cmnd *); |
| 251 | int fnic_device_reset(struct scsi_cmnd *); | 251 | int fnic_device_reset(struct scsi_cmnd *); |
| 252 | int fnic_host_reset(struct scsi_cmnd *); | 252 | int fnic_host_reset(struct scsi_cmnd *); |
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 198cbab3e89..22d02404d15 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c | |||
| @@ -349,7 +349,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, | |||
| 349 | * Routine to send a scsi cdb | 349 | * Routine to send a scsi cdb |
| 350 | * Called with host_lock held and interrupts disabled. | 350 | * Called with host_lock held and interrupts disabled. |
| 351 | */ | 351 | */ |
| 352 | int fnic_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | 352 | static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) |
| 353 | { | 353 | { |
| 354 | struct fc_lport *lp; | 354 | struct fc_lport *lp; |
| 355 | struct fc_rport *rport; | 355 | struct fc_rport *rport; |
| @@ -457,6 +457,8 @@ out: | |||
| 457 | return ret; | 457 | return ret; |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | DEF_SCSI_QCMD(fnic_queuecommand) | ||
| 461 | |||
| 460 | /* | 462 | /* |
| 461 | * fnic_fcpio_fw_reset_cmpl_handler | 463 | * fnic_fcpio_fw_reset_cmpl_handler |
| 462 | * Routine to handle fw reset completion | 464 | * Routine to handle fw reset completion |
diff --git a/drivers/scsi/g_NCR5380.h b/drivers/scsi/g_NCR5380.h index 921764c9ab2..1bcdb7beb77 100644 --- a/drivers/scsi/g_NCR5380.h +++ b/drivers/scsi/g_NCR5380.h | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | static int generic_NCR5380_abort(Scsi_Cmnd *); | 46 | static int generic_NCR5380_abort(Scsi_Cmnd *); |
| 47 | static int generic_NCR5380_detect(struct scsi_host_template *); | 47 | static int generic_NCR5380_detect(struct scsi_host_template *); |
| 48 | static int generic_NCR5380_release_resources(struct Scsi_Host *); | 48 | static int generic_NCR5380_release_resources(struct Scsi_Host *); |
| 49 | static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); | 49 | static int generic_NCR5380_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 50 | static int generic_NCR5380_bus_reset(Scsi_Cmnd *); | 50 | static int generic_NCR5380_bus_reset(Scsi_Cmnd *); |
| 51 | static const char* generic_NCR5380_info(struct Scsi_Host *); | 51 | static const char* generic_NCR5380_info(struct Scsi_Host *); |
| 52 | 52 | ||
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 841101846b8..76365700e2d 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
| @@ -185,7 +185,7 @@ static long gdth_unlocked_ioctl(struct file *filep, unsigned int cmd, | |||
| 185 | unsigned long arg); | 185 | unsigned long arg); |
| 186 | 186 | ||
| 187 | static void gdth_flush(gdth_ha_str *ha); | 187 | static void gdth_flush(gdth_ha_str *ha); |
| 188 | static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *)); | 188 | static int gdth_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 189 | static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, | 189 | static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, |
| 190 | struct gdth_cmndinfo *cmndinfo); | 190 | struct gdth_cmndinfo *cmndinfo); |
| 191 | static void gdth_scsi_done(struct scsi_cmnd *scp); | 191 | static void gdth_scsi_done(struct scsi_cmnd *scp); |
| @@ -4004,7 +4004,7 @@ static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,se | |||
| 4004 | } | 4004 | } |
| 4005 | 4005 | ||
| 4006 | 4006 | ||
| 4007 | static int gdth_queuecommand(struct scsi_cmnd *scp, | 4007 | static int gdth_queuecommand_lck(struct scsi_cmnd *scp, |
| 4008 | void (*done)(struct scsi_cmnd *)) | 4008 | void (*done)(struct scsi_cmnd *)) |
| 4009 | { | 4009 | { |
| 4010 | gdth_ha_str *ha = shost_priv(scp->device->host); | 4010 | gdth_ha_str *ha = shost_priv(scp->device->host); |
| @@ -4022,6 +4022,8 @@ static int gdth_queuecommand(struct scsi_cmnd *scp, | |||
| 4022 | return __gdth_queuecommand(ha, scp, cmndinfo); | 4022 | return __gdth_queuecommand(ha, scp, cmndinfo); |
| 4023 | } | 4023 | } |
| 4024 | 4024 | ||
| 4025 | static DEF_SCSI_QCMD(gdth_queuecommand) | ||
| 4026 | |||
| 4025 | static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, | 4027 | static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp, |
| 4026 | struct gdth_cmndinfo *cmndinfo) | 4028 | struct gdth_cmndinfo *cmndinfo) |
| 4027 | { | 4029 | { |
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index c5d0606ad09..b2fb2b2a6e7 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
| 32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
| 33 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
| 34 | #include <linux/smp_lock.h> | ||
| 35 | #include <linux/compat.h> | 34 | #include <linux/compat.h> |
| 36 | #include <linux/blktrace_api.h> | 35 | #include <linux/blktrace_api.h> |
| 37 | #include <linux/uaccess.h> | 36 | #include <linux/uaccess.h> |
| @@ -143,8 +142,7 @@ static void fill_cmd(struct CommandList *c, u8 cmd, struct ctlr_info *h, | |||
| 143 | void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, | 142 | void *buff, size_t size, u8 page_code, unsigned char *scsi3addr, |
| 144 | int cmd_type); | 143 | int cmd_type); |
| 145 | 144 | ||
| 146 | static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, | 145 | static int hpsa_scsi_queue_command(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 147 | void (*done)(struct scsi_cmnd *)); | ||
| 148 | static void hpsa_scan_start(struct Scsi_Host *); | 146 | static void hpsa_scan_start(struct Scsi_Host *); |
| 149 | static int hpsa_scan_finished(struct Scsi_Host *sh, | 147 | static int hpsa_scan_finished(struct Scsi_Host *sh, |
| 150 | unsigned long elapsed_time); | 148 | unsigned long elapsed_time); |
| @@ -1926,7 +1924,7 @@ sglist_finished: | |||
| 1926 | } | 1924 | } |
| 1927 | 1925 | ||
| 1928 | 1926 | ||
| 1929 | static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, | 1927 | static int hpsa_scsi_queue_command_lck(struct scsi_cmnd *cmd, |
| 1930 | void (*done)(struct scsi_cmnd *)) | 1928 | void (*done)(struct scsi_cmnd *)) |
| 1931 | { | 1929 | { |
| 1932 | struct ctlr_info *h; | 1930 | struct ctlr_info *h; |
| @@ -2020,6 +2018,8 @@ static int hpsa_scsi_queue_command(struct scsi_cmnd *cmd, | |||
| 2020 | return 0; | 2018 | return 0; |
| 2021 | } | 2019 | } |
| 2022 | 2020 | ||
| 2021 | static DEF_SCSI_QCMD(hpsa_scsi_queue_command) | ||
| 2022 | |||
| 2023 | static void hpsa_scan_start(struct Scsi_Host *sh) | 2023 | static void hpsa_scan_start(struct Scsi_Host *sh) |
| 2024 | { | 2024 | { |
| 2025 | struct ctlr_info *h = shost_to_hba(sh); | 2025 | struct ctlr_info *h = shost_to_hba(sh); |
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index 0729f150b33..10b65556937 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c | |||
| @@ -751,7 +751,7 @@ static void hptiop_post_req_mv(struct hptiop_hba *hba, | |||
| 751 | MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); | 751 | MVIOP_MU_QUEUE_ADDR_HOST_BIT | size_bit, hba); |
| 752 | } | 752 | } |
| 753 | 753 | ||
| 754 | static int hptiop_queuecommand(struct scsi_cmnd *scp, | 754 | static int hptiop_queuecommand_lck(struct scsi_cmnd *scp, |
| 755 | void (*done)(struct scsi_cmnd *)) | 755 | void (*done)(struct scsi_cmnd *)) |
| 756 | { | 756 | { |
| 757 | struct Scsi_Host *host = scp->device->host; | 757 | struct Scsi_Host *host = scp->device->host; |
| @@ -819,6 +819,8 @@ cmd_done: | |||
| 819 | return 0; | 819 | return 0; |
| 820 | } | 820 | } |
| 821 | 821 | ||
| 822 | static DEF_SCSI_QCMD(hptiop_queuecommand) | ||
| 823 | |||
| 822 | static const char *hptiop_info(struct Scsi_Host *host) | 824 | static const char *hptiop_info(struct Scsi_Host *host) |
| 823 | { | 825 | { |
| 824 | return driver_name_long; | 826 | return driver_name_long; |
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c index 9a4b69d4f4e..67fc8ffd52e 100644 --- a/drivers/scsi/ibmmca.c +++ b/drivers/scsi/ibmmca.c | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | #include <scsi/scsi_host.h> | 39 | #include <scsi/scsi_host.h> |
| 40 | 40 | ||
| 41 | /* Common forward declarations for all Linux-versions: */ | 41 | /* Common forward declarations for all Linux-versions: */ |
| 42 | static int ibmmca_queuecommand (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); | 42 | static int ibmmca_queuecommand (struct Scsi_Host *, struct scsi_cmnd *); |
| 43 | static int ibmmca_abort (Scsi_Cmnd *); | 43 | static int ibmmca_abort (Scsi_Cmnd *); |
| 44 | static int ibmmca_host_reset (Scsi_Cmnd *); | 44 | static int ibmmca_host_reset (Scsi_Cmnd *); |
| 45 | static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *); | 45 | static int ibmmca_biosparam (struct scsi_device *, struct block_device *, sector_t, int *); |
| @@ -1691,7 +1691,7 @@ static int __devexit ibmmca_remove(struct device *dev) | |||
| 1691 | } | 1691 | } |
| 1692 | 1692 | ||
| 1693 | /* The following routine is the SCSI command queue for the midlevel driver */ | 1693 | /* The following routine is the SCSI command queue for the midlevel driver */ |
| 1694 | static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | 1694 | static int ibmmca_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) |
| 1695 | { | 1695 | { |
| 1696 | unsigned int ldn; | 1696 | unsigned int ldn; |
| 1697 | unsigned int scsi_cmd; | 1697 | unsigned int scsi_cmd; |
| @@ -1996,6 +1996,8 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
| 1996 | return 0; | 1996 | return 0; |
| 1997 | } | 1997 | } |
| 1998 | 1998 | ||
| 1999 | static DEF_SCSI_QCMD(ibmmca_queuecommand) | ||
| 2000 | |||
| 1999 | static int __ibmmca_abort(Scsi_Cmnd * cmd) | 2001 | static int __ibmmca_abort(Scsi_Cmnd * cmd) |
| 2000 | { | 2002 | { |
| 2001 | /* Abort does not work, as the adapter never generates an interrupt on | 2003 | /* Abort does not work, as the adapter never generates an interrupt on |
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 00d08b25425..57cad7e20ca 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
| @@ -1606,7 +1606,7 @@ static inline int ibmvfc_host_chkready(struct ibmvfc_host *vhost) | |||
| 1606 | * Returns: | 1606 | * Returns: |
| 1607 | * 0 on success / other on failure | 1607 | * 0 on success / other on failure |
| 1608 | **/ | 1608 | **/ |
| 1609 | static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd, | 1609 | static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd, |
| 1610 | void (*done) (struct scsi_cmnd *)) | 1610 | void (*done) (struct scsi_cmnd *)) |
| 1611 | { | 1611 | { |
| 1612 | struct ibmvfc_host *vhost = shost_priv(cmnd->device->host); | 1612 | struct ibmvfc_host *vhost = shost_priv(cmnd->device->host); |
| @@ -1672,6 +1672,8 @@ static int ibmvfc_queuecommand(struct scsi_cmnd *cmnd, | |||
| 1672 | return 0; | 1672 | return 0; |
| 1673 | } | 1673 | } |
| 1674 | 1674 | ||
| 1675 | static DEF_SCSI_QCMD(ibmvfc_queuecommand) | ||
| 1676 | |||
| 1675 | /** | 1677 | /** |
| 1676 | * ibmvfc_sync_completion - Signal that a synchronous command has completed | 1678 | * ibmvfc_sync_completion - Signal that a synchronous command has completed |
| 1677 | * @evt: ibmvfc event struct | 1679 | * @evt: ibmvfc event struct |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 67f78a470f5..041958453e2 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
| @@ -713,7 +713,7 @@ static inline u16 lun_from_dev(struct scsi_device *dev) | |||
| 713 | * @cmd: struct scsi_cmnd to be executed | 713 | * @cmd: struct scsi_cmnd to be executed |
| 714 | * @done: Callback function to be called when cmd is completed | 714 | * @done: Callback function to be called when cmd is completed |
| 715 | */ | 715 | */ |
| 716 | static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, | 716 | static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd, |
| 717 | void (*done) (struct scsi_cmnd *)) | 717 | void (*done) (struct scsi_cmnd *)) |
| 718 | { | 718 | { |
| 719 | struct srp_cmd *srp_cmd; | 719 | struct srp_cmd *srp_cmd; |
| @@ -766,6 +766,8 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd, | |||
| 766 | return ibmvscsi_send_srp_event(evt_struct, hostdata, 0); | 766 | return ibmvscsi_send_srp_event(evt_struct, hostdata, 0); |
| 767 | } | 767 | } |
| 768 | 768 | ||
| 769 | static DEF_SCSI_QCMD(ibmvscsi_queuecommand) | ||
| 770 | |||
| 769 | /* ------------------------------------------------------------ | 771 | /* ------------------------------------------------------------ |
| 770 | * Routines for driver initialization | 772 | * Routines for driver initialization |
| 771 | */ | 773 | */ |
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 4734ab0b3ff..99aa0e5699b 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c | |||
| @@ -926,7 +926,7 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) | |||
| 926 | return 0; | 926 | return 0; |
| 927 | } | 927 | } |
| 928 | 928 | ||
| 929 | static int imm_queuecommand(struct scsi_cmnd *cmd, | 929 | static int imm_queuecommand_lck(struct scsi_cmnd *cmd, |
| 930 | void (*done)(struct scsi_cmnd *)) | 930 | void (*done)(struct scsi_cmnd *)) |
| 931 | { | 931 | { |
| 932 | imm_struct *dev = imm_dev(cmd->device->host); | 932 | imm_struct *dev = imm_dev(cmd->device->host); |
| @@ -949,6 +949,8 @@ static int imm_queuecommand(struct scsi_cmnd *cmd, | |||
| 949 | return 0; | 949 | return 0; |
| 950 | } | 950 | } |
| 951 | 951 | ||
| 952 | static DEF_SCSI_QCMD(imm_queuecommand) | ||
| 953 | |||
| 952 | /* | 954 | /* |
| 953 | * Apparently the disk->capacity attribute is off by 1 sector | 955 | * Apparently the disk->capacity attribute is off by 1 sector |
| 954 | * for all disk drives. We add the one here, but it should really | 956 | * for all disk drives. We add the one here, but it should really |
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c index 52bdc6df6b9..6568aab745a 100644 --- a/drivers/scsi/in2000.c +++ b/drivers/scsi/in2000.c | |||
| @@ -334,7 +334,7 @@ static uchar calc_sync_xfer(unsigned int period, unsigned int offset) | |||
| 334 | 334 | ||
| 335 | static void in2000_execute(struct Scsi_Host *instance); | 335 | static void in2000_execute(struct Scsi_Host *instance); |
| 336 | 336 | ||
| 337 | static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | 337 | static int in2000_queuecommand_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) |
| 338 | { | 338 | { |
| 339 | struct Scsi_Host *instance; | 339 | struct Scsi_Host *instance; |
| 340 | struct IN2000_hostdata *hostdata; | 340 | struct IN2000_hostdata *hostdata; |
| @@ -431,6 +431,8 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
| 431 | return 0; | 431 | return 0; |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | static DEF_SCSI_QCMD(in2000_queuecommand) | ||
| 435 | |||
| 434 | 436 | ||
| 435 | 437 | ||
| 436 | /* | 438 | /* |
diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h index 0fb8b06b839..5821e1fbce0 100644 --- a/drivers/scsi/in2000.h +++ b/drivers/scsi/in2000.h | |||
| @@ -396,7 +396,7 @@ struct IN2000_hostdata { | |||
| 396 | flags) | 396 | flags) |
| 397 | 397 | ||
| 398 | static int in2000_detect(struct scsi_host_template *) in2000__INIT; | 398 | static int in2000_detect(struct scsi_host_template *) in2000__INIT; |
| 399 | static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); | 399 | static int in2000_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 400 | static int in2000_abort(Scsi_Cmnd *); | 400 | static int in2000_abort(Scsi_Cmnd *); |
| 401 | static void in2000_setup(char *, int *) in2000__INIT; | 401 | static void in2000_setup(char *, int *) in2000__INIT; |
| 402 | static int in2000_biosparam(struct scsi_device *, struct block_device *, | 402 | static int in2000_biosparam(struct scsi_device *, struct block_device *, |
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 108797761b9..9627d062e16 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c | |||
| @@ -2639,7 +2639,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c | |||
| 2639 | * will cause the mid layer to call us again later with the command) | 2639 | * will cause the mid layer to call us again later with the command) |
| 2640 | */ | 2640 | */ |
| 2641 | 2641 | ||
| 2642 | static int i91u_queuecommand(struct scsi_cmnd *cmd, | 2642 | static int i91u_queuecommand_lck(struct scsi_cmnd *cmd, |
| 2643 | void (*done)(struct scsi_cmnd *)) | 2643 | void (*done)(struct scsi_cmnd *)) |
| 2644 | { | 2644 | { |
| 2645 | struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; | 2645 | struct initio_host *host = (struct initio_host *) cmd->device->host->hostdata; |
| @@ -2656,6 +2656,8 @@ static int i91u_queuecommand(struct scsi_cmnd *cmd, | |||
| 2656 | return 0; | 2656 | return 0; |
| 2657 | } | 2657 | } |
| 2658 | 2658 | ||
| 2659 | static DEF_SCSI_QCMD(i91u_queuecommand) | ||
| 2660 | |||
| 2659 | /** | 2661 | /** |
| 2660 | * i91u_bus_reset - reset the SCSI bus | 2662 | * i91u_bus_reset - reset the SCSI bus |
| 2661 | * @cmnd: Command block we want to trigger the reset for | 2663 | * @cmnd: Command block we want to trigger the reset for |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index fa60d7df44b..5bbaee597e8 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
| @@ -5709,7 +5709,7 @@ static void ipr_scsi_done(struct ipr_cmnd *ipr_cmd) | |||
| 5709 | * SCSI_MLQUEUE_DEVICE_BUSY if device is busy | 5709 | * SCSI_MLQUEUE_DEVICE_BUSY if device is busy |
| 5710 | * SCSI_MLQUEUE_HOST_BUSY if host is busy | 5710 | * SCSI_MLQUEUE_HOST_BUSY if host is busy |
| 5711 | **/ | 5711 | **/ |
| 5712 | static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd, | 5712 | static int ipr_queuecommand_lck(struct scsi_cmnd *scsi_cmd, |
| 5713 | void (*done) (struct scsi_cmnd *)) | 5713 | void (*done) (struct scsi_cmnd *)) |
| 5714 | { | 5714 | { |
| 5715 | struct ipr_ioa_cfg *ioa_cfg; | 5715 | struct ipr_ioa_cfg *ioa_cfg; |
| @@ -5792,6 +5792,8 @@ static int ipr_queuecommand(struct scsi_cmnd *scsi_cmd, | |||
| 5792 | return 0; | 5792 | return 0; |
| 5793 | } | 5793 | } |
| 5794 | 5794 | ||
| 5795 | static DEF_SCSI_QCMD(ipr_queuecommand) | ||
| 5796 | |||
| 5795 | /** | 5797 | /** |
| 5796 | * ipr_ioctl - IOCTL handler | 5798 | * ipr_ioctl - IOCTL handler |
| 5797 | * @sdev: scsi device struct | 5799 | * @sdev: scsi device struct |
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index f83a116955f..b2511acd39b 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
| @@ -232,7 +232,7 @@ static int ips_detect(struct scsi_host_template *); | |||
| 232 | static int ips_release(struct Scsi_Host *); | 232 | static int ips_release(struct Scsi_Host *); |
| 233 | static int ips_eh_abort(struct scsi_cmnd *); | 233 | static int ips_eh_abort(struct scsi_cmnd *); |
| 234 | static int ips_eh_reset(struct scsi_cmnd *); | 234 | static int ips_eh_reset(struct scsi_cmnd *); |
| 235 | static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *)); | 235 | static int ips_queue(struct Scsi_Host *, struct scsi_cmnd *); |
| 236 | static const char *ips_info(struct Scsi_Host *); | 236 | static const char *ips_info(struct Scsi_Host *); |
| 237 | static irqreturn_t do_ipsintr(int, void *); | 237 | static irqreturn_t do_ipsintr(int, void *); |
| 238 | static int ips_hainit(ips_ha_t *); | 238 | static int ips_hainit(ips_ha_t *); |
| @@ -1046,7 +1046,7 @@ static int ips_eh_reset(struct scsi_cmnd *SC) | |||
| 1046 | /* Linux obtains io_request_lock before calling this function */ | 1046 | /* Linux obtains io_request_lock before calling this function */ |
| 1047 | /* */ | 1047 | /* */ |
| 1048 | /****************************************************************************/ | 1048 | /****************************************************************************/ |
| 1049 | static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) | 1049 | static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) |
| 1050 | { | 1050 | { |
| 1051 | ips_ha_t *ha; | 1051 | ips_ha_t *ha; |
| 1052 | ips_passthru_t *pt; | 1052 | ips_passthru_t *pt; |
| @@ -1137,6 +1137,8 @@ static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) | |||
| 1137 | return (0); | 1137 | return (0); |
| 1138 | } | 1138 | } |
| 1139 | 1139 | ||
| 1140 | static DEF_SCSI_QCMD(ips_queue) | ||
| 1141 | |||
| 1140 | /****************************************************************************/ | 1142 | /****************************************************************************/ |
| 1141 | /* */ | 1143 | /* */ |
| 1142 | /* Routine Name: ips_biosparam */ | 1144 | /* Routine Name: ips_biosparam */ |
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index e340373b509..2924363d142 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
| @@ -1753,7 +1753,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport) | |||
| 1753 | * This is the i/o strategy routine, called by the SCSI layer. This routine | 1753 | * This is the i/o strategy routine, called by the SCSI layer. This routine |
| 1754 | * is called with the host_lock held. | 1754 | * is called with the host_lock held. |
| 1755 | */ | 1755 | */ |
| 1756 | int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) | 1756 | static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) |
| 1757 | { | 1757 | { |
| 1758 | struct fc_lport *lport; | 1758 | struct fc_lport *lport; |
| 1759 | struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); | 1759 | struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); |
| @@ -1851,6 +1851,8 @@ out: | |||
| 1851 | spin_lock_irq(lport->host->host_lock); | 1851 | spin_lock_irq(lport->host->host_lock); |
| 1852 | return rc; | 1852 | return rc; |
| 1853 | } | 1853 | } |
| 1854 | |||
| 1855 | DEF_SCSI_QCMD(fc_queuecommand) | ||
| 1854 | EXPORT_SYMBOL(fc_queuecommand); | 1856 | EXPORT_SYMBOL(fc_queuecommand); |
| 1855 | 1857 | ||
| 1856 | /** | 1858 | /** |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 633e0903635..c15fde808c3 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
| @@ -1599,7 +1599,7 @@ enum { | |||
| 1599 | FAILURE_SESSION_NOT_READY, | 1599 | FAILURE_SESSION_NOT_READY, |
| 1600 | }; | 1600 | }; |
| 1601 | 1601 | ||
| 1602 | int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) | 1602 | static int iscsi_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) |
| 1603 | { | 1603 | { |
| 1604 | struct iscsi_cls_session *cls_session; | 1604 | struct iscsi_cls_session *cls_session; |
| 1605 | struct Scsi_Host *host; | 1605 | struct Scsi_Host *host; |
| @@ -1736,6 +1736,8 @@ fault: | |||
| 1736 | spin_lock(host->host_lock); | 1736 | spin_lock(host->host_lock); |
| 1737 | return 0; | 1737 | return 0; |
| 1738 | } | 1738 | } |
| 1739 | |||
| 1740 | DEF_SCSI_QCMD(iscsi_queuecommand) | ||
| 1739 | EXPORT_SYMBOL_GPL(iscsi_queuecommand); | 1741 | EXPORT_SYMBOL_GPL(iscsi_queuecommand); |
| 1740 | 1742 | ||
| 1741 | int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason) | 1743 | int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, int reason) |
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 55f09e92ab5..29251fabecc 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
| @@ -189,7 +189,7 @@ int sas_queue_up(struct sas_task *task) | |||
| 189 | * Note: XXX: Remove the host unlock/lock pair when SCSI Core can | 189 | * Note: XXX: Remove the host unlock/lock pair when SCSI Core can |
| 190 | * call us without holding an IRQ spinlock... | 190 | * call us without holding an IRQ spinlock... |
| 191 | */ | 191 | */ |
| 192 | int sas_queuecommand(struct scsi_cmnd *cmd, | 192 | static int sas_queuecommand_lck(struct scsi_cmnd *cmd, |
| 193 | void (*scsi_done)(struct scsi_cmnd *)) | 193 | void (*scsi_done)(struct scsi_cmnd *)) |
| 194 | __releases(host->host_lock) | 194 | __releases(host->host_lock) |
| 195 | __acquires(dev->sata_dev.ap->lock) | 195 | __acquires(dev->sata_dev.ap->lock) |
| @@ -254,6 +254,8 @@ out: | |||
| 254 | return res; | 254 | return res; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | DEF_SCSI_QCMD(sas_queuecommand) | ||
| 258 | |||
| 257 | static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) | 259 | static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) |
| 258 | { | 260 | { |
| 259 | struct sas_task *task = TO_SAS_TASK(cmd); | 261 | struct sas_task *task = TO_SAS_TASK(cmd); |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index f64b65a770b..581837b3c71 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
| @@ -2899,7 +2899,7 @@ void lpfc_poll_timeout(unsigned long ptr) | |||
| 2899 | * SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. | 2899 | * SCSI_MLQUEUE_HOST_BUSY - Block all devices served by this host temporarily. |
| 2900 | **/ | 2900 | **/ |
| 2901 | static int | 2901 | static int |
| 2902 | lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) | 2902 | lpfc_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) |
| 2903 | { | 2903 | { |
| 2904 | struct Scsi_Host *shost = cmnd->device->host; | 2904 | struct Scsi_Host *shost = cmnd->device->host; |
| 2905 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 2905 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
| @@ -3060,6 +3060,8 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) | |||
| 3060 | return 0; | 3060 | return 0; |
| 3061 | } | 3061 | } |
| 3062 | 3062 | ||
| 3063 | static DEF_SCSI_QCMD(lpfc_queuecommand) | ||
| 3064 | |||
| 3063 | /** | 3065 | /** |
| 3064 | * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point | 3066 | * lpfc_abort_handler - scsi_host_template eh_abort_handler entry point |
| 3065 | * @cmnd: Pointer to scsi_cmnd data structure. | 3067 | * @cmnd: Pointer to scsi_cmnd data structure. |
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c index 3ddb4dc62d5..6c42dff0f4d 100644 --- a/drivers/scsi/mac53c94.c +++ b/drivers/scsi/mac53c94.c | |||
| @@ -66,7 +66,7 @@ static void cmd_done(struct fsc_state *, int result); | |||
| 66 | static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); | 66 | static void set_dma_cmds(struct fsc_state *, struct scsi_cmnd *); |
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 69 | static int mac53c94_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 70 | { | 70 | { |
| 71 | struct fsc_state *state; | 71 | struct fsc_state *state; |
| 72 | 72 | ||
| @@ -99,6 +99,8 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd * | |||
| 99 | return 0; | 99 | return 0; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | static DEF_SCSI_QCMD(mac53c94_queue) | ||
| 103 | |||
| 102 | static int mac53c94_host_reset(struct scsi_cmnd *cmd) | 104 | static int mac53c94_host_reset(struct scsi_cmnd *cmd) |
| 103 | { | 105 | { |
| 104 | struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata; | 106 | struct fsc_state *state = (struct fsc_state *) cmd->device->host->hostdata; |
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 7ceb5cf12c6..9aa048525eb 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
| @@ -366,7 +366,7 @@ mega_runpendq(adapter_t *adapter) | |||
| 366 | * The command queuing entry point for the mid-layer. | 366 | * The command queuing entry point for the mid-layer. |
| 367 | */ | 367 | */ |
| 368 | static int | 368 | static int |
| 369 | megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) | 369 | megaraid_queue_lck(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) |
| 370 | { | 370 | { |
| 371 | adapter_t *adapter; | 371 | adapter_t *adapter; |
| 372 | scb_t *scb; | 372 | scb_t *scb; |
| @@ -409,6 +409,8 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *)) | |||
| 409 | return busy; | 409 | return busy; |
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | static DEF_SCSI_QCMD(megaraid_queue) | ||
| 413 | |||
| 412 | /** | 414 | /** |
| 413 | * mega_allocate_scb() | 415 | * mega_allocate_scb() |
| 414 | * @adapter - pointer to our soft state | 416 | * @adapter - pointer to our soft state |
| @@ -4456,7 +4458,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) | |||
| 4456 | 4458 | ||
| 4457 | scb->idx = CMDID_INT_CMDS; | 4459 | scb->idx = CMDID_INT_CMDS; |
| 4458 | 4460 | ||
| 4459 | megaraid_queue(scmd, mega_internal_done); | 4461 | megaraid_queue_lck(scmd, mega_internal_done); |
| 4460 | 4462 | ||
| 4461 | wait_for_completion(&adapter->int_waitq); | 4463 | wait_for_completion(&adapter->int_waitq); |
| 4462 | 4464 | ||
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h index 2b4a048cadf..f5644745e24 100644 --- a/drivers/scsi/megaraid.h +++ b/drivers/scsi/megaraid.h | |||
| @@ -987,7 +987,7 @@ static int mega_query_adapter(adapter_t *); | |||
| 987 | static int issue_scb(adapter_t *, scb_t *); | 987 | static int issue_scb(adapter_t *, scb_t *); |
| 988 | static int mega_setup_mailbox(adapter_t *); | 988 | static int mega_setup_mailbox(adapter_t *); |
| 989 | 989 | ||
| 990 | static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); | 990 | static int megaraid_queue (struct Scsi_Host *, struct scsi_cmnd *); |
| 991 | static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); | 991 | static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *); |
| 992 | static void __mega_runpendq(adapter_t *); | 992 | static void __mega_runpendq(adapter_t *); |
| 993 | static int issue_scb_block(adapter_t *, u_char *); | 993 | static int issue_scb_block(adapter_t *, u_char *); |
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index a7810a106b3..5708cb27d07 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c | |||
| @@ -113,8 +113,7 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *); | |||
| 113 | static void megaraid_mbox_display_scb(adapter_t *, scb_t *); | 113 | static void megaraid_mbox_display_scb(adapter_t *, scb_t *); |
| 114 | static void megaraid_mbox_setup_device_map(adapter_t *); | 114 | static void megaraid_mbox_setup_device_map(adapter_t *); |
| 115 | 115 | ||
| 116 | static int megaraid_queue_command(struct scsi_cmnd *, | 116 | static int megaraid_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 117 | void (*)(struct scsi_cmnd *)); | ||
| 118 | static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); | 117 | static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); |
| 119 | static void megaraid_mbox_runpendq(adapter_t *, scb_t *); | 118 | static void megaraid_mbox_runpendq(adapter_t *, scb_t *); |
| 120 | static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, | 119 | static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, |
| @@ -1484,7 +1483,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb) | |||
| 1484 | * Queue entry point for mailbox based controllers. | 1483 | * Queue entry point for mailbox based controllers. |
| 1485 | */ | 1484 | */ |
| 1486 | static int | 1485 | static int |
| 1487 | megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) | 1486 | megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) |
| 1488 | { | 1487 | { |
| 1489 | adapter_t *adapter; | 1488 | adapter_t *adapter; |
| 1490 | scb_t *scb; | 1489 | scb_t *scb; |
| @@ -1513,6 +1512,8 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) | |||
| 1513 | return if_busy; | 1512 | return if_busy; |
| 1514 | } | 1513 | } |
| 1515 | 1514 | ||
| 1515 | static DEF_SCSI_QCMD(megaraid_queue_command) | ||
| 1516 | |||
| 1516 | /** | 1517 | /** |
| 1517 | * megaraid_mbox_build_cmd - transform the mid-layer scsi commands | 1518 | * megaraid_mbox_build_cmd - transform the mid-layer scsi commands |
| 1518 | * @adapter : controller's soft state | 1519 | * @adapter : controller's soft state |
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index eb29d508513..7451bc096a0 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
| @@ -1334,7 +1334,7 @@ megasas_dump_pending_frames(struct megasas_instance *instance) | |||
| 1334 | * @done: Callback entry point | 1334 | * @done: Callback entry point |
| 1335 | */ | 1335 | */ |
| 1336 | static int | 1336 | static int |
| 1337 | megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) | 1337 | megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) |
| 1338 | { | 1338 | { |
| 1339 | u32 frame_count; | 1339 | u32 frame_count; |
| 1340 | struct megasas_cmd *cmd; | 1340 | struct megasas_cmd *cmd; |
| @@ -1417,6 +1417,8 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) | |||
| 1417 | return 0; | 1417 | return 0; |
| 1418 | } | 1418 | } |
| 1419 | 1419 | ||
| 1420 | static DEF_SCSI_QCMD(megasas_queue_command) | ||
| 1421 | |||
| 1420 | static struct megasas_instance *megasas_lookup_instance(u16 host_no) | 1422 | static struct megasas_instance *megasas_lookup_instance(u16 host_no) |
| 1421 | { | 1423 | { |
| 1422 | int i; | 1424 | int i; |
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index 1f784fde251..197aa1b3f0f 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c | |||
| @@ -1627,7 +1627,7 @@ static void cmd_complete(struct mesh_state *ms) | |||
| 1627 | * Called by midlayer with host locked to queue a new | 1627 | * Called by midlayer with host locked to queue a new |
| 1628 | * request | 1628 | * request |
| 1629 | */ | 1629 | */ |
| 1630 | static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 1630 | static int mesh_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 1631 | { | 1631 | { |
| 1632 | struct mesh_state *ms; | 1632 | struct mesh_state *ms; |
| 1633 | 1633 | ||
| @@ -1648,6 +1648,8 @@ static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | |||
| 1648 | return 0; | 1648 | return 0; |
| 1649 | } | 1649 | } |
| 1650 | 1650 | ||
| 1651 | static DEF_SCSI_QCMD(mesh_queue) | ||
| 1652 | |||
| 1651 | /* | 1653 | /* |
| 1652 | * Called to handle interrupts, either call by the interrupt | 1654 | * Called to handle interrupts, either call by the interrupt |
| 1653 | * handler (do_mesh_interrupt) or by other functions in | 1655 | * handler (do_mesh_interrupt) or by other functions in |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 16e99b68635..1a96a00418a 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
| @@ -3315,7 +3315,7 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) | |||
| 3315 | * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full | 3315 | * SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full |
| 3316 | */ | 3316 | */ |
| 3317 | static int | 3317 | static int |
| 3318 | _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | 3318 | _scsih_qcmd_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) |
| 3319 | { | 3319 | { |
| 3320 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); | 3320 | struct MPT2SAS_ADAPTER *ioc = shost_priv(scmd->device->host); |
| 3321 | struct MPT2SAS_DEVICE *sas_device_priv_data; | 3321 | struct MPT2SAS_DEVICE *sas_device_priv_data; |
| @@ -3441,6 +3441,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | |||
| 3441 | return SCSI_MLQUEUE_HOST_BUSY; | 3441 | return SCSI_MLQUEUE_HOST_BUSY; |
| 3442 | } | 3442 | } |
| 3443 | 3443 | ||
| 3444 | static DEF_SCSI_QCMD(_scsih_qcmd) | ||
| 3445 | |||
| 3444 | /** | 3446 | /** |
| 3445 | * _scsih_normalize_sense - normalize descriptor and fixed format sense data | 3447 | * _scsih_normalize_sense - normalize descriptor and fixed format sense data |
| 3446 | * @sense_buffer: sense data returned by target | 3448 | * @sense_buffer: sense data returned by target |
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index d013a2aa2fd..46cc3825638 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c | |||
| @@ -8029,7 +8029,7 @@ static int ncr53c8xx_slave_configure(struct scsi_device *device) | |||
| 8029 | return 0; | 8029 | return 0; |
| 8030 | } | 8030 | } |
| 8031 | 8031 | ||
| 8032 | static int ncr53c8xx_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) | 8032 | static int ncr53c8xx_queue_command_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 8033 | { | 8033 | { |
| 8034 | struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; | 8034 | struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb; |
| 8035 | unsigned long flags; | 8035 | unsigned long flags; |
| @@ -8068,6 +8068,8 @@ printk("ncr53c8xx : command successfully queued\n"); | |||
| 8068 | return sts; | 8068 | return sts; |
| 8069 | } | 8069 | } |
| 8070 | 8070 | ||
| 8071 | static DEF_SCSI_QCMD(ncr53c8xx_queue_command) | ||
| 8072 | |||
| 8071 | irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) | 8073 | irqreturn_t ncr53c8xx_intr(int irq, void *dev_id) |
| 8072 | { | 8074 | { |
| 8073 | unsigned long flags; | 8075 | unsigned long flags; |
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 4c1e5454520..6b8b021400f 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c | |||
| @@ -196,8 +196,7 @@ static void __exit exit_nsp32 (void); | |||
| 196 | static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); | 196 | static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); |
| 197 | 197 | ||
| 198 | static int nsp32_detect (struct pci_dev *pdev); | 198 | static int nsp32_detect (struct pci_dev *pdev); |
| 199 | static int nsp32_queuecommand(struct scsi_cmnd *, | 199 | static int nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 200 | void (*done)(struct scsi_cmnd *)); | ||
| 201 | static const char *nsp32_info (struct Scsi_Host *); | 200 | static const char *nsp32_info (struct Scsi_Host *); |
| 202 | static int nsp32_release (struct Scsi_Host *); | 201 | static int nsp32_release (struct Scsi_Host *); |
| 203 | 202 | ||
| @@ -909,7 +908,7 @@ static int nsp32_setup_sg_table(struct scsi_cmnd *SCpnt) | |||
| 909 | return TRUE; | 908 | return TRUE; |
| 910 | } | 909 | } |
| 911 | 910 | ||
| 912 | static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 911 | static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 913 | { | 912 | { |
| 914 | nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; | 913 | nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; |
| 915 | nsp32_target *target; | 914 | nsp32_target *target; |
| @@ -1050,6 +1049,8 @@ static int nsp32_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_ | |||
| 1050 | return 0; | 1049 | return 0; |
| 1051 | } | 1050 | } |
| 1052 | 1051 | ||
| 1052 | static DEF_SCSI_QCMD(nsp32_queuecommand) | ||
| 1053 | |||
| 1053 | /* initialize asic */ | 1054 | /* initialize asic */ |
| 1054 | static int nsp32hw_init(nsp32_hw_data *data) | 1055 | static int nsp32hw_init(nsp32_hw_data *data) |
| 1055 | { | 1056 | { |
diff --git a/drivers/scsi/pas16.h b/drivers/scsi/pas16.h index 8dc5b1a5f5d..a04281cace2 100644 --- a/drivers/scsi/pas16.h +++ b/drivers/scsi/pas16.h | |||
| @@ -118,7 +118,7 @@ static int pas16_abort(Scsi_Cmnd *); | |||
| 118 | static int pas16_biosparam(struct scsi_device *, struct block_device *, | 118 | static int pas16_biosparam(struct scsi_device *, struct block_device *, |
| 119 | sector_t, int*); | 119 | sector_t, int*); |
| 120 | static int pas16_detect(struct scsi_host_template *); | 120 | static int pas16_detect(struct scsi_host_template *); |
| 121 | static int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); | 121 | static int pas16_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 122 | static int pas16_bus_reset(Scsi_Cmnd *); | 122 | static int pas16_bus_reset(Scsi_Cmnd *); |
| 123 | 123 | ||
| 124 | #ifndef CMD_PER_LUN | 124 | #ifndef CMD_PER_LUN |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 9326c2c1488..be3f33d31a9 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
| @@ -184,7 +184,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt) | |||
| 184 | SCpnt->scsi_done(SCpnt); | 184 | SCpnt->scsi_done(SCpnt); |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | static int nsp_queuecommand(struct scsi_cmnd *SCpnt, | 187 | static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, |
| 188 | void (*done)(struct scsi_cmnd *)) | 188 | void (*done)(struct scsi_cmnd *)) |
| 189 | { | 189 | { |
| 190 | #ifdef NSP_DEBUG | 190 | #ifdef NSP_DEBUG |
| @@ -264,6 +264,8 @@ static int nsp_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 264 | return 0; | 264 | return 0; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | static DEF_SCSI_QCMD(nsp_queuecommand) | ||
| 268 | |||
| 267 | /* | 269 | /* |
| 268 | * setup PIO FIFO transfer mode and enable/disable to data out | 270 | * setup PIO FIFO transfer mode and enable/disable to data out |
| 269 | */ | 271 | */ |
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index d68c9f267c5..7fc9a9d0a44 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h | |||
| @@ -299,8 +299,7 @@ static int nsp_proc_info ( | |||
| 299 | off_t offset, | 299 | off_t offset, |
| 300 | int length, | 300 | int length, |
| 301 | int inout); | 301 | int inout); |
| 302 | static int nsp_queuecommand(struct scsi_cmnd *SCpnt, | 302 | static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); |
| 303 | void (* done)(struct scsi_cmnd *SCpnt)); | ||
| 304 | 303 | ||
| 305 | /* Error handler */ | 304 | /* Error handler */ |
| 306 | /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/ | 305 | /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/ |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 0ae27cb5cd6..8552296edaa 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
| @@ -547,7 +547,7 @@ SYM53C500_info(struct Scsi_Host *SChost) | |||
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | static int | 549 | static int |
| 550 | SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 550 | SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
| 551 | { | 551 | { |
| 552 | int i; | 552 | int i; |
| 553 | int port_base = SCpnt->device->host->io_port; | 553 | int port_base = SCpnt->device->host->io_port; |
| @@ -583,6 +583,8 @@ SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
| 583 | return 0; | 583 | return 0; |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | static DEF_SCSI_QCMD(SYM53C500_queue) | ||
| 587 | |||
| 586 | static int | 588 | static int |
| 587 | SYM53C500_host_reset(struct scsi_cmnd *SCpnt) | 589 | SYM53C500_host_reset(struct scsi_cmnd *SCpnt) |
| 588 | { | 590 | { |
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index 8e38ca8cd10..7f064f9ca82 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h | |||
| @@ -50,7 +50,6 @@ | |||
| 50 | #include <linux/dma-mapping.h> | 50 | #include <linux/dma-mapping.h> |
| 51 | #include <linux/pci.h> | 51 | #include <linux/pci.h> |
| 52 | #include <linux/interrupt.h> | 52 | #include <linux/interrupt.h> |
| 53 | #include <linux/smp_lock.h> | ||
| 54 | #include <scsi/libsas.h> | 53 | #include <scsi/libsas.h> |
| 55 | #include <scsi/scsi_tcq.h> | 54 | #include <scsi/scsi_tcq.h> |
| 56 | #include <scsi/sas_ata.h> | 55 | #include <scsi/sas_ata.h> |
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index cf89091e4c3..5e76a624cb0 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c | |||
| @@ -3478,7 +3478,7 @@ static int pmcraid_copy_sglist( | |||
| 3478 | * SCSI_MLQUEUE_DEVICE_BUSY if device is busy | 3478 | * SCSI_MLQUEUE_DEVICE_BUSY if device is busy |
| 3479 | * SCSI_MLQUEUE_HOST_BUSY if host is busy | 3479 | * SCSI_MLQUEUE_HOST_BUSY if host is busy |
| 3480 | */ | 3480 | */ |
| 3481 | static int pmcraid_queuecommand( | 3481 | static int pmcraid_queuecommand_lck( |
| 3482 | struct scsi_cmnd *scsi_cmd, | 3482 | struct scsi_cmnd *scsi_cmd, |
| 3483 | void (*done) (struct scsi_cmnd *) | 3483 | void (*done) (struct scsi_cmnd *) |
| 3484 | ) | 3484 | ) |
| @@ -3584,6 +3584,8 @@ static int pmcraid_queuecommand( | |||
| 3584 | return rc; | 3584 | return rc; |
| 3585 | } | 3585 | } |
| 3586 | 3586 | ||
| 3587 | static DEF_SCSI_QCMD(pmcraid_queuecommand) | ||
| 3588 | |||
| 3587 | /** | 3589 | /** |
| 3588 | * pmcraid_open -char node "open" entry, allowed only users with admin access | 3590 | * pmcraid_open -char node "open" entry, allowed only users with admin access |
| 3589 | */ | 3591 | */ |
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index 7bc2d796e40..d164c963936 100644 --- a/drivers/scsi/ppa.c +++ b/drivers/scsi/ppa.c | |||
| @@ -798,7 +798,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) | |||
| 798 | return 0; | 798 | return 0; |
| 799 | } | 799 | } |
| 800 | 800 | ||
| 801 | static int ppa_queuecommand(struct scsi_cmnd *cmd, | 801 | static int ppa_queuecommand_lck(struct scsi_cmnd *cmd, |
| 802 | void (*done) (struct scsi_cmnd *)) | 802 | void (*done) (struct scsi_cmnd *)) |
| 803 | { | 803 | { |
| 804 | ppa_struct *dev = ppa_dev(cmd->device->host); | 804 | ppa_struct *dev = ppa_dev(cmd->device->host); |
| @@ -821,6 +821,8 @@ static int ppa_queuecommand(struct scsi_cmnd *cmd, | |||
| 821 | return 0; | 821 | return 0; |
| 822 | } | 822 | } |
| 823 | 823 | ||
| 824 | static DEF_SCSI_QCMD(ppa_queuecommand) | ||
| 825 | |||
| 824 | /* | 826 | /* |
| 825 | * Apparently the disk->capacity attribute is off by 1 sector | 827 | * Apparently the disk->capacity attribute is off by 1 sector |
| 826 | * for all disk drives. We add the one here, but it should really | 828 | * for all disk drives. We add the one here, but it should really |
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c index 92ffbb51049..cd178b9e40c 100644 --- a/drivers/scsi/ps3rom.c +++ b/drivers/scsi/ps3rom.c | |||
| @@ -211,7 +211,7 @@ static int ps3rom_write_request(struct ps3_storage_device *dev, | |||
| 211 | return 0; | 211 | return 0; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | static int ps3rom_queuecommand(struct scsi_cmnd *cmd, | 214 | static int ps3rom_queuecommand_lck(struct scsi_cmnd *cmd, |
| 215 | void (*done)(struct scsi_cmnd *)) | 215 | void (*done)(struct scsi_cmnd *)) |
| 216 | { | 216 | { |
| 217 | struct ps3rom_private *priv = shost_priv(cmd->device->host); | 217 | struct ps3rom_private *priv = shost_priv(cmd->device->host); |
| @@ -260,6 +260,8 @@ static int ps3rom_queuecommand(struct scsi_cmnd *cmd, | |||
| 260 | return 0; | 260 | return 0; |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static DEF_SCSI_QCMD(ps3rom_queuecommand) | ||
| 264 | |||
| 263 | static int decode_lv1_status(u64 status, unsigned char *sense_key, | 265 | static int decode_lv1_status(u64 status, unsigned char *sense_key, |
| 264 | unsigned char *asc, unsigned char *ascq) | 266 | unsigned char *asc, unsigned char *ascq) |
| 265 | { | 267 | { |
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index b8166ecfd0e..5dec684bf01 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
| @@ -727,7 +727,7 @@ qla1280_info(struct Scsi_Host *host) | |||
| 727 | * context which is a big NO! NO!. | 727 | * context which is a big NO! NO!. |
| 728 | **************************************************************************/ | 728 | **************************************************************************/ |
| 729 | static int | 729 | static int |
| 730 | qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) | 730 | qla1280_queuecommand_lck(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) |
| 731 | { | 731 | { |
| 732 | struct Scsi_Host *host = cmd->device->host; | 732 | struct Scsi_Host *host = cmd->device->host; |
| 733 | struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; | 733 | struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; |
| @@ -756,6 +756,8 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *)) | |||
| 756 | return status; | 756 | return status; |
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | static DEF_SCSI_QCMD(qla1280_queuecommand) | ||
| 760 | |||
| 759 | enum action { | 761 | enum action { |
| 760 | ABORT_COMMAND, | 762 | ABORT_COMMAND, |
| 761 | DEVICE_RESET, | 763 | DEVICE_RESET, |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1830e6e9731..1644eabaafe 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -179,8 +179,7 @@ static int qla2xxx_slave_alloc(struct scsi_device *); | |||
| 179 | static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); | 179 | static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); |
| 180 | static void qla2xxx_scan_start(struct Scsi_Host *); | 180 | static void qla2xxx_scan_start(struct Scsi_Host *); |
| 181 | static void qla2xxx_slave_destroy(struct scsi_device *); | 181 | static void qla2xxx_slave_destroy(struct scsi_device *); |
| 182 | static int qla2xxx_queuecommand(struct scsi_cmnd *cmd, | 182 | static int qla2xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 183 | void (*fn)(struct scsi_cmnd *)); | ||
| 184 | static int qla2xxx_eh_abort(struct scsi_cmnd *); | 183 | static int qla2xxx_eh_abort(struct scsi_cmnd *); |
| 185 | static int qla2xxx_eh_device_reset(struct scsi_cmnd *); | 184 | static int qla2xxx_eh_device_reset(struct scsi_cmnd *); |
| 186 | static int qla2xxx_eh_target_reset(struct scsi_cmnd *); | 185 | static int qla2xxx_eh_target_reset(struct scsi_cmnd *); |
| @@ -535,7 +534,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, | |||
| 535 | } | 534 | } |
| 536 | 535 | ||
| 537 | static int | 536 | static int |
| 538 | qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 537 | qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 539 | { | 538 | { |
| 540 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); | 539 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); |
| 541 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; | 540 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; |
| @@ -609,6 +608,8 @@ qc24_fail_command: | |||
| 609 | return 0; | 608 | return 0; |
| 610 | } | 609 | } |
| 611 | 610 | ||
| 611 | static DEF_SCSI_QCMD(qla2xxx_queuecommand) | ||
| 612 | |||
| 612 | 613 | ||
| 613 | /* | 614 | /* |
| 614 | * qla2x00_eh_wait_on_command | 615 | * qla2x00_eh_wait_on_command |
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index f4cd846abf6..0d48fb4d104 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
| @@ -79,8 +79,7 @@ static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc); | |||
| 79 | /* | 79 | /* |
| 80 | * SCSI host template entry points | 80 | * SCSI host template entry points |
| 81 | */ | 81 | */ |
| 82 | static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, | 82 | static int qla4xxx_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 83 | void (*done) (struct scsi_cmnd *)); | ||
| 84 | static int qla4xxx_eh_abort(struct scsi_cmnd *cmd); | 83 | static int qla4xxx_eh_abort(struct scsi_cmnd *cmd); |
| 85 | static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd); | 84 | static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd); |
| 86 | static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd); | 85 | static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd); |
| @@ -464,7 +463,7 @@ void qla4xxx_srb_compl(struct kref *ref) | |||
| 464 | * completion handling). Unfortunely, it sometimes calls the scheduler | 463 | * completion handling). Unfortunely, it sometimes calls the scheduler |
| 465 | * in interrupt context which is a big NO! NO!. | 464 | * in interrupt context which is a big NO! NO!. |
| 466 | **/ | 465 | **/ |
| 467 | static int qla4xxx_queuecommand(struct scsi_cmnd *cmd, | 466 | static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, |
| 468 | void (*done)(struct scsi_cmnd *)) | 467 | void (*done)(struct scsi_cmnd *)) |
| 469 | { | 468 | { |
| 470 | struct scsi_qla_host *ha = to_qla_host(cmd->device->host); | 469 | struct scsi_qla_host *ha = to_qla_host(cmd->device->host); |
| @@ -538,6 +537,8 @@ qc_fail_command: | |||
| 538 | return 0; | 537 | return 0; |
| 539 | } | 538 | } |
| 540 | 539 | ||
| 540 | static DEF_SCSI_QCMD(qla4xxx_queuecommand) | ||
| 541 | |||
| 541 | /** | 542 | /** |
| 542 | * qla4xxx_mem_free - frees memory allocated to adapter | 543 | * qla4xxx_mem_free - frees memory allocated to adapter |
| 543 | * @ha: Pointer to host adapter structure. | 544 | * @ha: Pointer to host adapter structure. |
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c index 1ad51552d6b..c3a9151ca82 100644 --- a/drivers/scsi/qlogicfas408.c +++ b/drivers/scsi/qlogicfas408.c | |||
| @@ -439,7 +439,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id) | |||
| 439 | * Queued command | 439 | * Queued command |
| 440 | */ | 440 | */ |
| 441 | 441 | ||
| 442 | int qlogicfas408_queuecommand(struct scsi_cmnd *cmd, | 442 | static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd, |
| 443 | void (*done) (struct scsi_cmnd *)) | 443 | void (*done) (struct scsi_cmnd *)) |
| 444 | { | 444 | { |
| 445 | struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); | 445 | struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); |
| @@ -459,6 +459,8 @@ int qlogicfas408_queuecommand(struct scsi_cmnd *cmd, | |||
| 459 | return 0; | 459 | return 0; |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | DEF_SCSI_QCMD(qlogicfas408_queuecommand) | ||
| 463 | |||
| 462 | /* | 464 | /* |
| 463 | * Return bios parameters | 465 | * Return bios parameters |
| 464 | */ | 466 | */ |
diff --git a/drivers/scsi/qlogicfas408.h b/drivers/scsi/qlogicfas408.h index 260626427a3..2f6c0a16620 100644 --- a/drivers/scsi/qlogicfas408.h +++ b/drivers/scsi/qlogicfas408.h | |||
| @@ -103,8 +103,7 @@ struct qlogicfas408_priv { | |||
| 103 | #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0]) | 103 | #define get_priv_by_host(x) (struct qlogicfas408_priv *)&((x)->hostdata[0]) |
| 104 | 104 | ||
| 105 | irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id); | 105 | irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id); |
| 106 | int qlogicfas408_queuecommand(struct scsi_cmnd * cmd, | 106 | int qlogicfas408_queuecommand(struct Scsi_Host *h, struct scsi_cmnd * cmd); |
| 107 | void (*done) (struct scsi_cmnd *)); | ||
| 108 | int qlogicfas408_biosparam(struct scsi_device * disk, | 107 | int qlogicfas408_biosparam(struct scsi_device * disk, |
| 109 | struct block_device *dev, | 108 | struct block_device *dev, |
| 110 | sector_t capacity, int ip[]); | 109 | sector_t capacity, int ip[]); |
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index f8c561cf751..664c9572d0c 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c | |||
| @@ -1003,7 +1003,7 @@ static int qlogicpti_slave_configure(struct scsi_device *sdev) | |||
| 1003 | * | 1003 | * |
| 1004 | * "This code must fly." -davem | 1004 | * "This code must fly." -davem |
| 1005 | */ | 1005 | */ |
| 1006 | static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) | 1006 | static int qlogicpti_queuecommand_lck(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *)) |
| 1007 | { | 1007 | { |
| 1008 | struct Scsi_Host *host = Cmnd->device->host; | 1008 | struct Scsi_Host *host = Cmnd->device->host; |
| 1009 | struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; | 1009 | struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; |
| @@ -1052,6 +1052,8 @@ toss_command: | |||
| 1052 | return 1; | 1052 | return 1; |
| 1053 | } | 1053 | } |
| 1054 | 1054 | ||
| 1055 | static DEF_SCSI_QCMD(qlogicpti_queuecommand) | ||
| 1056 | |||
| 1055 | static int qlogicpti_return_status(struct Status_Entry *sts, int id) | 1057 | static int qlogicpti_return_status(struct Status_Entry *sts, int id) |
| 1056 | { | 1058 | { |
| 1057 | int host_status = DID_ERROR; | 1059 | int host_status = DID_ERROR; |
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 348fba0a897..2aeb2e9c4d3 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
| @@ -634,12 +634,13 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) | |||
| 634 | * Description: a serial number identifies a request for error recovery | 634 | * Description: a serial number identifies a request for error recovery |
| 635 | * and debugging purposes. Protected by the Host_Lock of host. | 635 | * and debugging purposes. Protected by the Host_Lock of host. |
| 636 | */ | 636 | */ |
| 637 | static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) | 637 | void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd *cmd) |
| 638 | { | 638 | { |
| 639 | cmd->serial_number = host->cmd_serial_number++; | 639 | cmd->serial_number = host->cmd_serial_number++; |
| 640 | if (cmd->serial_number == 0) | 640 | if (cmd->serial_number == 0) |
| 641 | cmd->serial_number = host->cmd_serial_number++; | 641 | cmd->serial_number = host->cmd_serial_number++; |
| 642 | } | 642 | } |
| 643 | EXPORT_SYMBOL(scsi_cmd_get_serial); | ||
| 643 | 644 | ||
| 644 | /** | 645 | /** |
| 645 | * scsi_dispatch_command - Dispatch a command to the low-level driver. | 646 | * scsi_dispatch_command - Dispatch a command to the low-level driver. |
| @@ -651,7 +652,6 @@ static inline void scsi_cmd_get_serial(struct Scsi_Host *host, struct scsi_cmnd | |||
| 651 | int scsi_dispatch_cmd(struct scsi_cmnd *cmd) | 652 | int scsi_dispatch_cmd(struct scsi_cmnd *cmd) |
| 652 | { | 653 | { |
| 653 | struct Scsi_Host *host = cmd->device->host; | 654 | struct Scsi_Host *host = cmd->device->host; |
| 654 | unsigned long flags = 0; | ||
| 655 | unsigned long timeout; | 655 | unsigned long timeout; |
| 656 | int rtn = 0; | 656 | int rtn = 0; |
| 657 | 657 | ||
| @@ -737,23 +737,15 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) | |||
| 737 | goto out; | 737 | goto out; |
| 738 | } | 738 | } |
| 739 | 739 | ||
| 740 | spin_lock_irqsave(host->host_lock, flags); | ||
| 741 | /* | ||
| 742 | * AK: unlikely race here: for some reason the timer could | ||
| 743 | * expire before the serial number is set up below. | ||
| 744 | * | ||
| 745 | * TODO: kill serial or move to blk layer | ||
| 746 | */ | ||
| 747 | scsi_cmd_get_serial(host, cmd); | ||
| 748 | |||
| 749 | if (unlikely(host->shost_state == SHOST_DEL)) { | 740 | if (unlikely(host->shost_state == SHOST_DEL)) { |
| 750 | cmd->result = (DID_NO_CONNECT << 16); | 741 | cmd->result = (DID_NO_CONNECT << 16); |
| 751 | scsi_done(cmd); | 742 | scsi_done(cmd); |
| 752 | } else { | 743 | } else { |
| 753 | trace_scsi_dispatch_cmd_start(cmd); | 744 | trace_scsi_dispatch_cmd_start(cmd); |
| 754 | rtn = host->hostt->queuecommand(cmd, scsi_done); | 745 | cmd->scsi_done = scsi_done; |
| 746 | rtn = host->hostt->queuecommand(host, cmd); | ||
| 755 | } | 747 | } |
| 756 | spin_unlock_irqrestore(host->host_lock, flags); | 748 | |
| 757 | if (rtn) { | 749 | if (rtn) { |
| 758 | trace_scsi_dispatch_cmd_error(cmd, rtn); | 750 | trace_scsi_dispatch_cmd_error(cmd, rtn); |
| 759 | if (rtn != SCSI_MLQUEUE_DEVICE_BUSY && | 751 | if (rtn != SCSI_MLQUEUE_DEVICE_BUSY && |
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2c36bae3bd4..2f1f9b079b1 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
| @@ -3538,7 +3538,7 @@ static void sdebug_remove_adapter(void) | |||
| 3538 | } | 3538 | } |
| 3539 | 3539 | ||
| 3540 | static | 3540 | static |
| 3541 | int scsi_debug_queuecommand(struct scsi_cmnd *SCpnt, done_funct_t done) | 3541 | int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done) |
| 3542 | { | 3542 | { |
| 3543 | unsigned char *cmd = (unsigned char *) SCpnt->cmnd; | 3543 | unsigned char *cmd = (unsigned char *) SCpnt->cmnd; |
| 3544 | int len, k; | 3544 | int len, k; |
| @@ -3884,6 +3884,8 @@ write: | |||
| 3884 | (delay_override ? 0 : scsi_debug_delay)); | 3884 | (delay_override ? 0 : scsi_debug_delay)); |
| 3885 | } | 3885 | } |
| 3886 | 3886 | ||
| 3887 | static DEF_SCSI_QCMD(scsi_debug_queuecommand) | ||
| 3888 | |||
| 3887 | static struct scsi_host_template sdebug_driver_template = { | 3889 | static struct scsi_host_template sdebug_driver_template = { |
| 3888 | .proc_info = scsi_debug_proc_info, | 3890 | .proc_info = scsi_debug_proc_info, |
| 3889 | .proc_name = sdebug_proc_name, | 3891 | .proc_name = sdebug_proc_name, |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f3cf924a2cd..824b8fc03ce 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
| @@ -773,17 +773,15 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, | |||
| 773 | struct Scsi_Host *shost = sdev->host; | 773 | struct Scsi_Host *shost = sdev->host; |
| 774 | DECLARE_COMPLETION_ONSTACK(done); | 774 | DECLARE_COMPLETION_ONSTACK(done); |
| 775 | unsigned long timeleft; | 775 | unsigned long timeleft; |
| 776 | unsigned long flags; | ||
| 777 | struct scsi_eh_save ses; | 776 | struct scsi_eh_save ses; |
| 778 | int rtn; | 777 | int rtn; |
| 779 | 778 | ||
| 780 | scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); | 779 | scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); |
| 781 | shost->eh_action = &done; | 780 | shost->eh_action = &done; |
| 782 | 781 | ||
| 783 | spin_lock_irqsave(shost->host_lock, flags); | ||
| 784 | scsi_log_send(scmd); | 782 | scsi_log_send(scmd); |
| 785 | shost->hostt->queuecommand(scmd, scsi_eh_done); | 783 | scmd->scsi_done = scsi_eh_done; |
| 786 | spin_unlock_irqrestore(shost->host_lock, flags); | 784 | shost->hostt->queuecommand(shost, scmd); |
| 787 | 785 | ||
| 788 | timeleft = wait_for_completion_timeout(&done, timeout); | 786 | timeleft = wait_for_completion_timeout(&done, timeout); |
| 789 | 787 | ||
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b9ab3a590e4..956496182c8 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
| @@ -46,7 +46,6 @@ | |||
| 46 | #include <linux/blkdev.h> | 46 | #include <linux/blkdev.h> |
| 47 | #include <linux/blkpg.h> | 47 | #include <linux/blkpg.h> |
| 48 | #include <linux/delay.h> | 48 | #include <linux/delay.h> |
| 49 | #include <linux/smp_lock.h> | ||
| 50 | #include <linux/mutex.h> | 49 | #include <linux/mutex.h> |
| 51 | #include <linux/string_helpers.h> | 50 | #include <linux/string_helpers.h> |
| 52 | #include <linux/async.h> | 51 | #include <linux/async.h> |
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 9c73dbda3bb..606215e54b8 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c | |||
| @@ -572,7 +572,7 @@ stex_slave_destroy(struct scsi_device *sdev) | |||
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | static int | 574 | static int |
| 575 | stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) | 575 | stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 576 | { | 576 | { |
| 577 | struct st_hba *hba; | 577 | struct st_hba *hba; |
| 578 | struct Scsi_Host *host; | 578 | struct Scsi_Host *host; |
| @@ -698,6 +698,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *)) | |||
| 698 | return 0; | 698 | return 0; |
| 699 | } | 699 | } |
| 700 | 700 | ||
| 701 | static DEF_SCSI_QCMD(stex_queuecommand) | ||
| 702 | |||
| 701 | static void stex_scsi_done(struct st_ccb *ccb) | 703 | static void stex_scsi_done(struct st_ccb *ccb) |
| 702 | { | 704 | { |
| 703 | struct scsi_cmnd *cmd = ccb->cmd; | 705 | struct scsi_cmnd *cmd = ccb->cmd; |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 713620ed70d..4f0e5485ffd 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
| @@ -908,7 +908,7 @@ static int NCR5380_init (struct Scsi_Host *instance, int flags) | |||
| 908 | */ | 908 | */ |
| 909 | 909 | ||
| 910 | /* Only make static if a wrapper function is used */ | 910 | /* Only make static if a wrapper function is used */ |
| 911 | static int NCR5380_queue_command(struct scsi_cmnd *cmd, | 911 | static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd, |
| 912 | void (*done)(struct scsi_cmnd *)) | 912 | void (*done)(struct scsi_cmnd *)) |
| 913 | { | 913 | { |
| 914 | SETUP_HOSTDATA(cmd->device->host); | 914 | SETUP_HOSTDATA(cmd->device->host); |
| @@ -1019,6 +1019,8 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd, | |||
| 1019 | return 0; | 1019 | return 0; |
| 1020 | } | 1020 | } |
| 1021 | 1021 | ||
| 1022 | static DEF_SCSI_QCMD(NCR5380_queue_command) | ||
| 1023 | |||
| 1022 | /* | 1024 | /* |
| 1023 | * Function : NCR5380_main (void) | 1025 | * Function : NCR5380_main (void) |
| 1024 | * | 1026 | * |
diff --git a/drivers/scsi/sun3_scsi.h b/drivers/scsi/sun3_scsi.h index b29a9d661ca..bcefd8458e6 100644 --- a/drivers/scsi/sun3_scsi.h +++ b/drivers/scsi/sun3_scsi.h | |||
| @@ -51,8 +51,7 @@ static int sun3scsi_abort(struct scsi_cmnd *); | |||
| 51 | static int sun3scsi_detect (struct scsi_host_template *); | 51 | static int sun3scsi_detect (struct scsi_host_template *); |
| 52 | static const char *sun3scsi_info (struct Scsi_Host *); | 52 | static const char *sun3scsi_info (struct Scsi_Host *); |
| 53 | static int sun3scsi_bus_reset(struct scsi_cmnd *); | 53 | static int sun3scsi_bus_reset(struct scsi_cmnd *); |
| 54 | static int sun3scsi_queue_command(struct scsi_cmnd *, | 54 | static int sun3scsi_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 55 | void (*done)(struct scsi_cmnd *)); | ||
| 56 | static int sun3scsi_release (struct Scsi_Host *); | 55 | static int sun3scsi_release (struct Scsi_Host *); |
| 57 | 56 | ||
| 58 | #ifndef CMD_PER_LUN | 57 | #ifndef CMD_PER_LUN |
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index e5c369bb568..190107ae120 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c | |||
| @@ -734,7 +734,7 @@ const char *sym53c416_info(struct Scsi_Host *SChost) | |||
| 734 | return info; | 734 | return info; |
| 735 | } | 735 | } |
| 736 | 736 | ||
| 737 | int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) | 737 | static int sym53c416_queuecommand_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) |
| 738 | { | 738 | { |
| 739 | int base; | 739 | int base; |
| 740 | unsigned long flags = 0; | 740 | unsigned long flags = 0; |
| @@ -761,6 +761,8 @@ int sym53c416_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) | |||
| 761 | return 0; | 761 | return 0; |
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | DEF_SCSI_QCMD(sym53c416_queuecommand) | ||
| 765 | |||
| 764 | static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) | 766 | static int sym53c416_host_reset(Scsi_Cmnd *SCpnt) |
| 765 | { | 767 | { |
| 766 | int base; | 768 | int base; |
diff --git a/drivers/scsi/sym53c416.h b/drivers/scsi/sym53c416.h index 77860d0748f..387de5d80a7 100644 --- a/drivers/scsi/sym53c416.h +++ b/drivers/scsi/sym53c416.h | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | static int sym53c416_detect(struct scsi_host_template *); | 25 | static int sym53c416_detect(struct scsi_host_template *); |
| 26 | static const char *sym53c416_info(struct Scsi_Host *); | 26 | static const char *sym53c416_info(struct Scsi_Host *); |
| 27 | static int sym53c416_release(struct Scsi_Host *); | 27 | static int sym53c416_release(struct Scsi_Host *); |
| 28 | static int sym53c416_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); | 28 | static int sym53c416_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 29 | static int sym53c416_host_reset(Scsi_Cmnd *); | 29 | static int sym53c416_host_reset(Scsi_Cmnd *); |
| 30 | static int sym53c416_bios_param(struct scsi_device *, struct block_device *, | 30 | static int sym53c416_bios_param(struct scsi_device *, struct block_device *, |
| 31 | sector_t, int *); | 31 | sector_t, int *); |
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index 8b955b534a3..6b97ded9d45 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c | |||
| @@ -505,7 +505,7 @@ void sym_log_bus_error(struct Scsi_Host *shost) | |||
| 505 | * queuecommand method. Entered with the host adapter lock held and | 505 | * queuecommand method. Entered with the host adapter lock held and |
| 506 | * interrupts disabled. | 506 | * interrupts disabled. |
| 507 | */ | 507 | */ |
| 508 | static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, | 508 | static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd, |
| 509 | void (*done)(struct scsi_cmnd *)) | 509 | void (*done)(struct scsi_cmnd *)) |
| 510 | { | 510 | { |
| 511 | struct sym_hcb *np = SYM_SOFTC_PTR(cmd); | 511 | struct sym_hcb *np = SYM_SOFTC_PTR(cmd); |
| @@ -536,6 +536,8 @@ static int sym53c8xx_queue_command(struct scsi_cmnd *cmd, | |||
| 536 | return 0; | 536 | return 0; |
| 537 | } | 537 | } |
| 538 | 538 | ||
| 539 | static DEF_SCSI_QCMD(sym53c8xx_queue_command) | ||
| 540 | |||
| 539 | /* | 541 | /* |
| 540 | * Linux entry point of the interrupt handler. | 542 | * Linux entry point of the interrupt handler. |
| 541 | */ | 543 | */ |
diff --git a/drivers/scsi/t128.h b/drivers/scsi/t128.h index 76a069b7ac0..ada1115079c 100644 --- a/drivers/scsi/t128.h +++ b/drivers/scsi/t128.h | |||
| @@ -96,8 +96,7 @@ static int t128_abort(struct scsi_cmnd *); | |||
| 96 | static int t128_biosparam(struct scsi_device *, struct block_device *, | 96 | static int t128_biosparam(struct scsi_device *, struct block_device *, |
| 97 | sector_t, int*); | 97 | sector_t, int*); |
| 98 | static int t128_detect(struct scsi_host_template *); | 98 | static int t128_detect(struct scsi_host_template *); |
| 99 | static int t128_queue_command(struct scsi_cmnd *, | 99 | static int t128_queue_command(struct Scsi_Host *, struct scsi_cmnd *); |
| 100 | void (*done)(struct scsi_cmnd *)); | ||
| 101 | static int t128_bus_reset(struct scsi_cmnd *); | 100 | static int t128_bus_reset(struct scsi_cmnd *); |
| 102 | 101 | ||
| 103 | #ifndef CMD_PER_LUN | 102 | #ifndef CMD_PER_LUN |
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c index 27866b0adfe..a124a28f2cc 100644 --- a/drivers/scsi/tmscsim.c +++ b/drivers/scsi/tmscsim.c | |||
| @@ -1883,7 +1883,7 @@ dc390_ScsiRstDetect( struct dc390_acb* pACB ) | |||
| 1883 | return; | 1883 | return; |
| 1884 | } | 1884 | } |
| 1885 | 1885 | ||
| 1886 | static int DC390_queuecommand(struct scsi_cmnd *cmd, | 1886 | static int DC390_queuecommand_lck(struct scsi_cmnd *cmd, |
| 1887 | void (*done)(struct scsi_cmnd *)) | 1887 | void (*done)(struct scsi_cmnd *)) |
| 1888 | { | 1888 | { |
| 1889 | struct scsi_device *sdev = cmd->device; | 1889 | struct scsi_device *sdev = cmd->device; |
| @@ -1944,6 +1944,8 @@ static int DC390_queuecommand(struct scsi_cmnd *cmd, | |||
| 1944 | return SCSI_MLQUEUE_DEVICE_BUSY; | 1944 | return SCSI_MLQUEUE_DEVICE_BUSY; |
| 1945 | } | 1945 | } |
| 1946 | 1946 | ||
| 1947 | static DEF_SCSI_QCMD(DC390_queuecommand) | ||
| 1948 | |||
| 1947 | static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) | 1949 | static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB) |
| 1948 | { | 1950 | { |
| 1949 | struct pci_dev *pdev; | 1951 | struct pci_dev *pdev; |
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c index 5d9fdeeb231..edfc5da8be4 100644 --- a/drivers/scsi/u14-34f.c +++ b/drivers/scsi/u14-34f.c | |||
| @@ -433,7 +433,7 @@ | |||
| 433 | 433 | ||
| 434 | static int u14_34f_detect(struct scsi_host_template *); | 434 | static int u14_34f_detect(struct scsi_host_template *); |
| 435 | static int u14_34f_release(struct Scsi_Host *); | 435 | static int u14_34f_release(struct Scsi_Host *); |
| 436 | static int u14_34f_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); | 436 | static int u14_34f_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 437 | static int u14_34f_eh_abort(struct scsi_cmnd *); | 437 | static int u14_34f_eh_abort(struct scsi_cmnd *); |
| 438 | static int u14_34f_eh_host_reset(struct scsi_cmnd *); | 438 | static int u14_34f_eh_host_reset(struct scsi_cmnd *); |
| 439 | static int u14_34f_bios_param(struct scsi_device *, struct block_device *, | 439 | static int u14_34f_bios_param(struct scsi_device *, struct block_device *, |
| @@ -1248,7 +1248,7 @@ static void scsi_to_dev_dir(unsigned int i, unsigned int j) { | |||
| 1248 | 1248 | ||
| 1249 | } | 1249 | } |
| 1250 | 1250 | ||
| 1251 | static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { | 1251 | static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) { |
| 1252 | unsigned int i, j, k; | 1252 | unsigned int i, j, k; |
| 1253 | struct mscp *cpp; | 1253 | struct mscp *cpp; |
| 1254 | 1254 | ||
| @@ -1329,6 +1329,8 @@ static int u14_34f_queuecommand(struct scsi_cmnd *SCpnt, void (*done)(struct scs | |||
| 1329 | return 0; | 1329 | return 0; |
| 1330 | } | 1330 | } |
| 1331 | 1331 | ||
| 1332 | static DEF_SCSI_QCMD(u14_34f_queuecommand) | ||
| 1333 | |||
| 1332 | static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) { | 1334 | static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) { |
| 1333 | unsigned int i, j; | 1335 | unsigned int i, j; |
| 1334 | 1336 | ||
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 27aa40f3980..0571ef9639c 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c | |||
| @@ -700,7 +700,7 @@ static inline void build_sg_list(struct mscp *mscp, struct scsi_cmnd *SCpnt) | |||
| 700 | mscp->transfer_data_length = transfer_length; | 700 | mscp->transfer_data_length = transfer_length; |
| 701 | } | 701 | } |
| 702 | 702 | ||
| 703 | static int ultrastor_queuecommand(struct scsi_cmnd *SCpnt, | 703 | static int ultrastor_queuecommand_lck(struct scsi_cmnd *SCpnt, |
| 704 | void (*done) (struct scsi_cmnd *)) | 704 | void (*done) (struct scsi_cmnd *)) |
| 705 | { | 705 | { |
| 706 | struct mscp *my_mscp; | 706 | struct mscp *my_mscp; |
| @@ -825,6 +825,8 @@ retry: | |||
| 825 | return 0; | 825 | return 0; |
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | static DEF_SCSI_QCMD(ultrastor_queuecommand) | ||
| 829 | |||
| 828 | /* This code must deal with 2 cases: | 830 | /* This code must deal with 2 cases: |
| 829 | 831 | ||
| 830 | 1. The command has not been written to the OGM. In this case, set | 832 | 1. The command has not been written to the OGM. In this case, set |
diff --git a/drivers/scsi/ultrastor.h b/drivers/scsi/ultrastor.h index a692905f95f..165c18b5cf5 100644 --- a/drivers/scsi/ultrastor.h +++ b/drivers/scsi/ultrastor.h | |||
| @@ -15,8 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | static int ultrastor_detect(struct scsi_host_template *); | 16 | static int ultrastor_detect(struct scsi_host_template *); |
| 17 | static const char *ultrastor_info(struct Scsi_Host *shpnt); | 17 | static const char *ultrastor_info(struct Scsi_Host *shpnt); |
| 18 | static int ultrastor_queuecommand(struct scsi_cmnd *, | 18 | static int ultrastor_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 19 | void (*done)(struct scsi_cmnd *)); | ||
| 20 | static int ultrastor_abort(struct scsi_cmnd *); | 19 | static int ultrastor_abort(struct scsi_cmnd *); |
| 21 | static int ultrastor_host_reset(struct scsi_cmnd *); | 20 | static int ultrastor_host_reset(struct scsi_cmnd *); |
| 22 | static int ultrastor_biosparam(struct scsi_device *, struct block_device *, | 21 | static int ultrastor_biosparam(struct scsi_device *, struct block_device *, |
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index 26894459c37..a18996d2446 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c | |||
| @@ -690,7 +690,7 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter, | |||
| 690 | return 0; | 690 | return 0; |
| 691 | } | 691 | } |
| 692 | 692 | ||
| 693 | static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | 693 | static int pvscsi_queue_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) |
| 694 | { | 694 | { |
| 695 | struct Scsi_Host *host = cmd->device->host; | 695 | struct Scsi_Host *host = cmd->device->host; |
| 696 | struct pvscsi_adapter *adapter = shost_priv(host); | 696 | struct pvscsi_adapter *adapter = shost_priv(host); |
| @@ -719,6 +719,8 @@ static int pvscsi_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | |||
| 719 | return 0; | 719 | return 0; |
| 720 | } | 720 | } |
| 721 | 721 | ||
| 722 | static DEF_SCSI_QCMD(pvscsi_queue) | ||
| 723 | |||
| 722 | static int pvscsi_abort(struct scsi_cmnd *cmd) | 724 | static int pvscsi_abort(struct scsi_cmnd *cmd) |
| 723 | { | 725 | { |
| 724 | struct pvscsi_adapter *adapter = shost_priv(cmd->device->host); | 726 | struct pvscsi_adapter *adapter = shost_priv(cmd->device->host); |
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index b701bf2cc18..5f697e0bd00 100644 --- a/drivers/scsi/wd33c93.c +++ b/drivers/scsi/wd33c93.c | |||
| @@ -371,8 +371,8 @@ calc_sync_msg(unsigned int period, unsigned int offset, unsigned int fast, | |||
| 371 | msg[1] = offset; | 371 | msg[1] = offset; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | int | 374 | static int |
| 375 | wd33c93_queuecommand(struct scsi_cmnd *cmd, | 375 | wd33c93_queuecommand_lck(struct scsi_cmnd *cmd, |
| 376 | void (*done)(struct scsi_cmnd *)) | 376 | void (*done)(struct scsi_cmnd *)) |
| 377 | { | 377 | { |
| 378 | struct WD33C93_hostdata *hostdata; | 378 | struct WD33C93_hostdata *hostdata; |
| @@ -468,6 +468,8 @@ wd33c93_queuecommand(struct scsi_cmnd *cmd, | |||
| 468 | return 0; | 468 | return 0; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | DEF_SCSI_QCMD(wd33c93_queuecommand) | ||
| 472 | |||
| 471 | /* | 473 | /* |
| 472 | * This routine attempts to start a scsi command. If the host_card is | 474 | * This routine attempts to start a scsi command. If the host_card is |
| 473 | * already connected, we give up immediately. Otherwise, look through | 475 | * already connected, we give up immediately. Otherwise, look through |
diff --git a/drivers/scsi/wd33c93.h b/drivers/scsi/wd33c93.h index 1ed5f3bf388..3b463d7304d 100644 --- a/drivers/scsi/wd33c93.h +++ b/drivers/scsi/wd33c93.h | |||
| @@ -343,8 +343,7 @@ struct WD33C93_hostdata { | |||
| 343 | void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, | 343 | void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs, |
| 344 | dma_setup_t setup, dma_stop_t stop, int clock_freq); | 344 | dma_setup_t setup, dma_stop_t stop, int clock_freq); |
| 345 | int wd33c93_abort (struct scsi_cmnd *cmd); | 345 | int wd33c93_abort (struct scsi_cmnd *cmd); |
| 346 | int wd33c93_queuecommand (struct scsi_cmnd *cmd, | 346 | int wd33c93_queuecommand (struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 347 | void (*done)(struct scsi_cmnd *)); | ||
| 348 | void wd33c93_intr (struct Scsi_Host *instance); | 347 | void wd33c93_intr (struct Scsi_Host *instance); |
| 349 | int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); | 348 | int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); |
| 350 | int wd33c93_host_reset (struct scsi_cmnd *); | 349 | int wd33c93_host_reset (struct scsi_cmnd *); |
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index 333580bf37c..db451ae0a36 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c | |||
| @@ -1082,7 +1082,7 @@ static irqreturn_t wd7000_intr(int irq, void *dev_id) | |||
| 1082 | return IRQ_HANDLED; | 1082 | return IRQ_HANDLED; |
| 1083 | } | 1083 | } |
| 1084 | 1084 | ||
| 1085 | static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, | 1085 | static int wd7000_queuecommand_lck(struct scsi_cmnd *SCpnt, |
| 1086 | void (*done)(struct scsi_cmnd *)) | 1086 | void (*done)(struct scsi_cmnd *)) |
| 1087 | { | 1087 | { |
| 1088 | Scb *scb; | 1088 | Scb *scb; |
| @@ -1139,6 +1139,8 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, | |||
| 1139 | return 0; | 1139 | return 0; |
| 1140 | } | 1140 | } |
| 1141 | 1141 | ||
| 1142 | static DEF_SCSI_QCMD(wd7000_queuecommand) | ||
| 1143 | |||
| 1142 | static int wd7000_diagnostics(Adapter * host, int code) | 1144 | static int wd7000_diagnostics(Adapter * host, int code) |
| 1143 | { | 1145 | { |
| 1144 | static IcbDiag icb = { ICB_OP_DIAGNOSTICS }; | 1146 | static IcbDiag icb = { ICB_OP_DIAGNOSTICS }; |
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index fa62578fcd2..bcc31f2140a 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c | |||
| @@ -18,7 +18,6 @@ static char *serial_version = "$Revision: 1.25 $"; | |||
| 18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
| 19 | #include <linux/tty_flip.h> | 19 | #include <linux/tty_flip.h> |
| 20 | #include <linux/major.h> | 20 | #include <linux/major.h> |
| 21 | #include <linux/smp_lock.h> | ||
| 22 | #include <linux/string.h> | 21 | #include <linux/string.h> |
| 23 | #include <linux/fcntl.h> | 22 | #include <linux/fcntl.h> |
| 24 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index c4ea14670d4..9ffa5bee44a 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include <linux/console.h> | 29 | #include <linux/console.h> |
| 30 | #include <linux/proc_fs.h> | 30 | #include <linux/proc_fs.h> |
| 31 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
| 32 | #include <linux/smp_lock.h> | ||
| 33 | #include <linux/device.h> | 32 | #include <linux/device.h> |
| 34 | #include <linux/serial.h> /* for serial_state and serial_icounter_struct */ | 33 | #include <linux/serial.h> /* for serial_state and serial_icounter_struct */ |
| 35 | #include <linux/serial_core.h> | 34 | #include <linux/serial_core.h> |
diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c index 09615b51d59..cb12a8e1466 100644 --- a/drivers/sh/clk/core.c +++ b/drivers/sh/clk/core.c | |||
| @@ -571,7 +571,7 @@ long clk_round_parent(struct clk *clk, unsigned long target, | |||
| 571 | *best_freq = freq_max; | 571 | *best_freq = freq_max; |
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | pr_debug("too low freq %lu, error %lu\n", freq->frequency, | 574 | pr_debug("too low freq %u, error %lu\n", freq->frequency, |
| 575 | target - freq_max); | 575 | target - freq_max); |
| 576 | 576 | ||
| 577 | if (!error) | 577 | if (!error) |
| @@ -591,7 +591,7 @@ long clk_round_parent(struct clk *clk, unsigned long target, | |||
| 591 | *best_freq = freq_min; | 591 | *best_freq = freq_min; |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | pr_debug("too high freq %lu, error %lu\n", freq->frequency, | 594 | pr_debug("too high freq %u, error %lu\n", freq->frequency, |
| 595 | freq_min - target); | 595 | freq_min - target); |
| 596 | 596 | ||
| 597 | if (!error) | 597 | if (!error) |
diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index e5bf5d3c698..4e0ff718116 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c | |||
| @@ -215,7 +215,7 @@ restart: | |||
| 215 | entry = radix_tree_deref_slot((void **)entries[i]); | 215 | entry = radix_tree_deref_slot((void **)entries[i]); |
| 216 | if (unlikely(!entry)) | 216 | if (unlikely(!entry)) |
| 217 | continue; | 217 | continue; |
| 218 | if (unlikely(entry == RADIX_TREE_RETRY)) | 218 | if (radix_tree_deref_retry(entry)) |
| 219 | goto restart; | 219 | goto restart; |
| 220 | 220 | ||
| 221 | irq = create_irq(); | 221 | irq = create_irq(); |
diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h index f3c827eb0ab..25961c23dc0 100644 --- a/drivers/staging/easycap/easycap.h +++ b/drivers/staging/easycap/easycap.h | |||
| @@ -77,7 +77,6 @@ | |||
| 77 | #include <linux/slab.h> | 77 | #include <linux/slab.h> |
| 78 | #include <linux/module.h> | 78 | #include <linux/module.h> |
| 79 | #include <linux/kref.h> | 79 | #include <linux/kref.h> |
| 80 | #include <linux/smp_lock.h> | ||
| 81 | #include <linux/usb.h> | 80 | #include <linux/usb.h> |
| 82 | #include <linux/uaccess.h> | 81 | #include <linux/uaccess.h> |
| 83 | 82 | ||
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index 41d9acf4cd6..6f8d67d0d64 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c | |||
| @@ -72,8 +72,7 @@ struct storvsc_driver_context { | |||
| 72 | 72 | ||
| 73 | /* Static decl */ | 73 | /* Static decl */ |
| 74 | static int storvsc_probe(struct device *dev); | 74 | static int storvsc_probe(struct device *dev); |
| 75 | static int storvsc_queuecommand(struct scsi_cmnd *scmnd, | 75 | static int storvsc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd); |
| 76 | void (*done)(struct scsi_cmnd *)); | ||
| 77 | static int storvsc_device_alloc(struct scsi_device *); | 76 | static int storvsc_device_alloc(struct scsi_device *); |
| 78 | static int storvsc_device_configure(struct scsi_device *); | 77 | static int storvsc_device_configure(struct scsi_device *); |
| 79 | static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); | 78 | static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd); |
| @@ -595,7 +594,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, | |||
| 595 | /* | 594 | /* |
| 596 | * storvsc_queuecommand - Initiate command processing | 595 | * storvsc_queuecommand - Initiate command processing |
| 597 | */ | 596 | */ |
| 598 | static int storvsc_queuecommand(struct scsi_cmnd *scmnd, | 597 | static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd, |
| 599 | void (*done)(struct scsi_cmnd *)) | 598 | void (*done)(struct scsi_cmnd *)) |
| 600 | { | 599 | { |
| 601 | int ret; | 600 | int ret; |
| @@ -783,6 +782,8 @@ retry_request: | |||
| 783 | return ret; | 782 | return ret; |
| 784 | } | 783 | } |
| 785 | 784 | ||
| 785 | static DEF_SCSI_QCMD(storvsc_queuecommand) | ||
| 786 | |||
| 786 | static int storvsc_merge_bvec(struct request_queue *q, | 787 | static int storvsc_merge_bvec(struct request_queue *q, |
| 787 | struct bvec_merge_data *bmd, struct bio_vec *bvec) | 788 | struct bvec_merge_data *bmd, struct bio_vec *bvec) |
| 788 | { | 789 | { |
diff --git a/drivers/staging/intel_sst/intel_sst_app_interface.c b/drivers/staging/intel_sst/intel_sst_app_interface.c index 9618c799746..991440015e9 100644 --- a/drivers/staging/intel_sst/intel_sst_app_interface.c +++ b/drivers/staging/intel_sst/intel_sst_app_interface.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
| 35 | #include <linux/firmware.h> | 35 | #include <linux/firmware.h> |
| 36 | #include <linux/ioctl.h> | 36 | #include <linux/ioctl.h> |
| 37 | #include <linux/smp_lock.h> | ||
| 38 | #ifdef CONFIG_MRST_RAR_HANDLER | 37 | #ifdef CONFIG_MRST_RAR_HANDLER |
| 39 | #include <linux/rar_register.h> | 38 | #include <linux/rar_register.h> |
| 40 | #include "../../../drivers/staging/memrar/memrar.h" | 39 | #include "../../../drivers/staging/memrar/memrar.h" |
diff --git a/drivers/staging/keucr/scsiglue.c b/drivers/staging/keucr/scsiglue.c index a2671404f7a..da4f42af383 100644 --- a/drivers/staging/keucr/scsiglue.c +++ b/drivers/staging/keucr/scsiglue.c | |||
| @@ -87,7 +87,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
| 87 | 87 | ||
| 88 | /* This is always called with scsi_lock(host) held */ | 88 | /* This is always called with scsi_lock(host) held */ |
| 89 | //----- queuecommand() --------------------- | 89 | //----- queuecommand() --------------------- |
| 90 | static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) | 90 | static int queuecommand_lck(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) |
| 91 | { | 91 | { |
| 92 | struct us_data *us = host_to_us(srb->device->host); | 92 | struct us_data *us = host_to_us(srb->device->host); |
| 93 | 93 | ||
| @@ -117,6 +117,8 @@ static int queuecommand(struct scsi_cmnd *srb, void (*done)(struct scsi_cmnd *)) | |||
| 117 | return 0; | 117 | return 0; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | static DEF_SCSI_QCMD(queuecommand) | ||
| 121 | |||
| 120 | /*********************************************************************** | 122 | /*********************************************************************** |
| 121 | * Error handling functions | 123 | * Error handling functions |
| 122 | ***********************************************************************/ | 124 | ***********************************************************************/ |
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 75aa7a36307..4ca45ec7fd8 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/console.h> | 17 | #include <linux/console.h> |
| 18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
| 19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 20 | #include <linux/i2c-id.h> | ||
| 21 | #include <linux/pci.h> | 20 | #include <linux/pci.h> |
| 22 | #include <linux/pci_ids.h> | 21 | #include <linux/pci_ids.h> |
| 23 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
| @@ -733,7 +732,6 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
| 733 | edev: | 732 | edev: |
| 734 | platform_device_unregister(dcon_device); | 733 | platform_device_unregister(dcon_device); |
| 735 | dcon_device = NULL; | 734 | dcon_device = NULL; |
| 736 | i2c_set_clientdata(client, NULL); | ||
| 737 | eirq: | 735 | eirq: |
| 738 | free_irq(DCON_IRQ, &dcon_driver); | 736 | free_irq(DCON_IRQ, &dcon_driver); |
| 739 | einit: | 737 | einit: |
| @@ -757,8 +755,6 @@ static int dcon_remove(struct i2c_client *client) | |||
| 757 | platform_device_unregister(dcon_device); | 755 | platform_device_unregister(dcon_device); |
| 758 | cancel_work_sync(&dcon_work); | 756 | cancel_work_sync(&dcon_work); |
| 759 | 757 | ||
| 760 | i2c_set_clientdata(client, NULL); | ||
| 761 | |||
| 762 | return 0; | 758 | return 0; |
| 763 | } | 759 | } |
| 764 | 760 | ||
diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index d1674cd282d..831d81e0e42 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
| 23 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
| 24 | #include <linux/kref.h> | 24 | #include <linux/kref.h> |
| 25 | #include <linux/smp_lock.h> | ||
| 26 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
| 27 | #include <linux/skbuff.h> | 26 | #include <linux/skbuff.h> |
| 28 | #include <linux/usb.h> | 27 | #include <linux/usb.h> |
diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c index b7b60d5e866..a2db956edd5 100644 --- a/drivers/staging/speakup/buffers.c +++ b/drivers/staging/speakup/buffers.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include <linux/console.h> | 1 | #include <linux/console.h> |
| 2 | #include <linux/smp_lock.h> | ||
| 3 | #include <linux/types.h> | 2 | #include <linux/types.h> |
| 4 | #include <linux/wait.h> | 3 | #include <linux/wait.h> |
| 5 | 4 | ||
diff --git a/drivers/staging/stradis/Kconfig b/drivers/staging/stradis/Kconfig index 92e89114189..02f0fc504cf 100644 --- a/drivers/staging/stradis/Kconfig +++ b/drivers/staging/stradis/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config VIDEO_STRADIS | 1 | config VIDEO_STRADIS |
| 2 | tristate "Stradis 4:2:2 MPEG-2 video driver (DEPRECATED)" | 2 | tristate "Stradis 4:2:2 MPEG-2 video driver (DEPRECATED)" |
| 3 | depends on EXPERIMENTAL && PCI && VIDEO_V4L1 && VIRT_TO_BUS | 3 | depends on EXPERIMENTAL && PCI && VIDEO_V4L1 && VIRT_TO_BUS && BKL |
| 4 | help | 4 | help |
| 5 | Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video | 5 | Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video |
| 6 | driver for PCI. There is a product page at | 6 | driver for PCI. There is a product page at |
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index ddb4dc98092..a3d2e239965 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
| @@ -54,7 +54,6 @@ | |||
| 54 | #include <linux/gfp.h> | 54 | #include <linux/gfp.h> |
| 55 | #include <linux/poll.h> | 55 | #include <linux/poll.h> |
| 56 | #include <linux/usb.h> | 56 | #include <linux/usb.h> |
| 57 | #include <linux/smp_lock.h> | ||
| 58 | #include <linux/usbdevice_fs.h> | 57 | #include <linux/usbdevice_fs.h> |
| 59 | #include <linux/usb/hcd.h> | 58 | #include <linux/usb/hcd.h> |
| 60 | #include <linux/mutex.h> | 59 | #include <linux/mutex.h> |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 045bb4b823e..a7131ad630f 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <linux/fs.h> | 37 | #include <linux/fs.h> |
| 38 | #include <linux/mm.h> | 38 | #include <linux/mm.h> |
| 39 | #include <linux/slab.h> | 39 | #include <linux/slab.h> |
| 40 | #include <linux/smp_lock.h> | ||
| 41 | #include <linux/signal.h> | 40 | #include <linux/signal.h> |
| 42 | #include <linux/poll.h> | 41 | #include <linux/poll.h> |
| 43 | #include <linux/module.h> | 42 | #include <linux/module.h> |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 9fe34fb78ef..cf6a5423de0 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
| 20 | #include <linux/rwsem.h> | 20 | #include <linux/rwsem.h> |
| 21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | #include <linux/usb.h> | 22 | #include <linux/usb.h> |
| 24 | 23 | ||
| 25 | #include "usb.h" | 24 | #include "usb.h" |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 9819a4cc3b2..b690aa35df9 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | #include <linux/parser.h> | 39 | #include <linux/parser.h> |
| 40 | #include <linux/notifier.h> | 40 | #include <linux/notifier.h> |
| 41 | #include <linux/seq_file.h> | 41 | #include <linux/seq_file.h> |
| 42 | #include <linux/smp_lock.h> | ||
| 43 | #include <linux/usb/hcd.h> | 42 | #include <linux/usb/hcd.h> |
| 44 | #include <asm/byteorder.h> | 43 | #include <asm/byteorder.h> |
| 45 | #include "usb.h" | 44 | #include "usb.h" |
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 4a830df4fc3..484c5ba5450 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/blkdev.h> | 30 | #include <linux/blkdev.h> |
| 31 | #include <linux/pagemap.h> | 31 | #include <linux/pagemap.h> |
| 32 | #include <asm/unaligned.h> | 32 | #include <asm/unaligned.h> |
| 33 | #include <linux/smp_lock.h> | ||
| 34 | 33 | ||
| 35 | #include <linux/usb/composite.h> | 34 | #include <linux/usb/composite.h> |
| 36 | #include <linux/usb/functionfs.h> | 35 | #include <linux/usb/functionfs.h> |
diff --git a/drivers/usb/gadget/f_hid.c b/drivers/usb/gadget/f_hid.c index 4f891eddd06..598e7e2ab80 100644 --- a/drivers/usb/gadget/f_hid.c +++ b/drivers/usb/gadget/f_hid.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/cdev.h> | 25 | #include <linux/cdev.h> |
| 26 | #include <linux/mutex.h> | 26 | #include <linux/mutex.h> |
| 27 | #include <linux/poll.h> | 27 | #include <linux/poll.h> |
| 28 | #include <linux/smp_lock.h> | ||
| 29 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
| 30 | #include <linux/wait.h> | 29 | #include <linux/wait.h> |
| 31 | #include <linux/usb/g_hid.h> | 30 | #include <linux/usb/g_hid.h> |
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index 8196fa11fec..6c4fb4efb4b 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c | |||
| @@ -70,7 +70,6 @@ | |||
| 70 | #include <linux/ioport.h> | 70 | #include <linux/ioport.h> |
| 71 | #include <linux/sched.h> | 71 | #include <linux/sched.h> |
| 72 | #include <linux/slab.h> | 72 | #include <linux/slab.h> |
| 73 | #include <linux/smp_lock.h> | ||
| 74 | #include <linux/errno.h> | 73 | #include <linux/errno.h> |
| 75 | #include <linux/init.h> | 74 | #include <linux/init.h> |
| 76 | #include <linux/list.h> | 75 | #include <linux/list.h> |
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 6e7fb5f38db..ee60cd3ea64 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/debugfs.h> | 14 | #include <linux/debugfs.h> |
| 15 | #include <linux/smp_lock.h> | ||
| 16 | #include <asm/io.h> | 15 | #include <asm/io.h> |
| 17 | 16 | ||
| 18 | #include "uhci-hcd.h" | 17 | #include "uhci-hcd.h" |
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 5a47805d958..c90c89dc000 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c | |||
| @@ -364,7 +364,7 @@ static int mts_scsi_host_reset(struct scsi_cmnd *srb) | |||
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | static int | 366 | static int |
| 367 | mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback); | 367 | mts_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *srb); |
| 368 | 368 | ||
| 369 | static void mts_transfer_cleanup( struct urb *transfer ); | 369 | static void mts_transfer_cleanup( struct urb *transfer ); |
| 370 | static void mts_do_sg(struct urb * transfer); | 370 | static void mts_do_sg(struct urb * transfer); |
| @@ -573,7 +573,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc) | |||
| 573 | 573 | ||
| 574 | 574 | ||
| 575 | static int | 575 | static int |
| 576 | mts_scsi_queuecommand(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) | 576 | mts_scsi_queuecommand_lck(struct scsi_cmnd *srb, mts_scsi_cmnd_callback callback) |
| 577 | { | 577 | { |
| 578 | struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); | 578 | struct mts_desc* desc = (struct mts_desc*)(srb->device->host->hostdata[0]); |
| 579 | int err = 0; | 579 | int err = 0; |
| @@ -626,6 +626,8 @@ out: | |||
| 626 | return err; | 626 | return err; |
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | static DEF_SCSI_QCMD(mts_scsi_queuecommand) | ||
| 630 | |||
| 629 | static struct scsi_host_template mts_scsi_host_template = { | 631 | static struct scsi_host_template mts_scsi_host_template = { |
| 630 | .module = THIS_MODULE, | 632 | .module = THIS_MODULE, |
| 631 | .name = "microtekX6", | 633 | .name = "microtekX6", |
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 44cb37b5a4d..c436e1e2c3b 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/poll.h> | 15 | #include <linux/poll.h> |
| 16 | #include <linux/compat.h> | 16 | #include <linux/compat.h> |
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include <linux/scatterlist.h> | 18 | #include <linux/scatterlist.h> |
| 20 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 21 | 20 | ||
diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index 8ec94f15a73..e5ce42bd316 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
| 12 | #include <linux/usb.h> | 12 | #include <linux/usb.h> |
| 13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
| 14 | #include <linux/smp_lock.h> | ||
| 15 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
| 16 | 15 | ||
| 17 | #include "usb_mon.h" | 16 | #include "usb_mon.h" |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index e64da74bdcc..861223f2af6 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
| 22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/tty.h> | 24 | #include <linux/tty.h> |
| 26 | #include <linux/tty_driver.h> | 25 | #include <linux/tty_driver.h> |
| 27 | #include <linux/tty_flip.h> | 26 | #include <linux/tty_flip.h> |
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index a688b1e686e..689ee1fb702 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
| @@ -285,7 +285,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
| 285 | 285 | ||
| 286 | /* queue a command */ | 286 | /* queue a command */ |
| 287 | /* This is always called with scsi_lock(host) held */ | 287 | /* This is always called with scsi_lock(host) held */ |
| 288 | static int queuecommand(struct scsi_cmnd *srb, | 288 | static int queuecommand_lck(struct scsi_cmnd *srb, |
| 289 | void (*done)(struct scsi_cmnd *)) | 289 | void (*done)(struct scsi_cmnd *)) |
| 290 | { | 290 | { |
| 291 | struct us_data *us = host_to_us(srb->device->host); | 291 | struct us_data *us = host_to_us(srb->device->host); |
| @@ -315,6 +315,8 @@ static int queuecommand(struct scsi_cmnd *srb, | |||
| 315 | return 0; | 315 | return 0; |
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | static DEF_SCSI_QCMD(queuecommand) | ||
| 319 | |||
| 318 | /*********************************************************************** | 320 | /*********************************************************************** |
| 319 | * Error handling functions | 321 | * Error handling functions |
| 320 | ***********************************************************************/ | 322 | ***********************************************************************/ |
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index d1268191acb..339fac3949d 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
| @@ -430,7 +430,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd, | |||
| 430 | return 0; | 430 | return 0; |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | static int uas_queuecommand(struct scsi_cmnd *cmnd, | 433 | static int uas_queuecommand_lck(struct scsi_cmnd *cmnd, |
| 434 | void (*done)(struct scsi_cmnd *)) | 434 | void (*done)(struct scsi_cmnd *)) |
| 435 | { | 435 | { |
| 436 | struct scsi_device *sdev = cmnd->device; | 436 | struct scsi_device *sdev = cmnd->device; |
| @@ -488,6 +488,8 @@ static int uas_queuecommand(struct scsi_cmnd *cmnd, | |||
| 488 | return 0; | 488 | return 0; |
| 489 | } | 489 | } |
| 490 | 490 | ||
| 491 | static DEF_SCSI_QCMD(uas_queuecommand) | ||
| 492 | |||
| 491 | static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) | 493 | static int uas_eh_abort_handler(struct scsi_cmnd *cmnd) |
| 492 | { | 494 | { |
| 493 | struct scsi_device *sdev = cmnd->device; | 495 | struct scsi_device *sdev = cmnd->device; |
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 54e32c51361..915448ec75b 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
| @@ -47,7 +47,6 @@ | |||
| 47 | #include <linux/ioport.h> | 47 | #include <linux/ioport.h> |
| 48 | #include <linux/init.h> | 48 | #include <linux/init.h> |
| 49 | #include <linux/screen_info.h> | 49 | #include <linux/screen_info.h> |
| 50 | #include <linux/smp_lock.h> | ||
| 51 | #include <video/vga.h> | 50 | #include <video/vga.h> |
| 52 | #include <asm/io.h> | 51 | #include <asm/io.h> |
| 53 | 52 | ||
diff --git a/drivers/video/omap2/vram.c b/drivers/video/omap2/vram.c index fed2a72bc6b..2fd7e5271be 100644 --- a/drivers/video/omap2/vram.c +++ b/drivers/video/omap2/vram.c | |||
| @@ -554,9 +554,15 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
| 554 | size = PAGE_ALIGN(size); | 554 | size = PAGE_ALIGN(size); |
| 555 | 555 | ||
| 556 | if (paddr) { | 556 | if (paddr) { |
| 557 | if ((paddr & ~PAGE_MASK) || | 557 | if (paddr & ~PAGE_MASK) { |
| 558 | !memblock_is_region_memory(paddr, size)) { | 558 | pr_err("VRAM start address 0x%08x not page aligned\n", |
| 559 | pr_err("Illegal SDRAM region for VRAM\n"); | 559 | paddr); |
| 560 | return; | ||
| 561 | } | ||
| 562 | |||
| 563 | if (!memblock_is_region_memory(paddr, size)) { | ||
| 564 | pr_err("Illegal SDRAM region 0x%08x..0x%08x for VRAM\n", | ||
| 565 | paddr, paddr + size - 1); | ||
| 560 | return; | 566 | return; |
| 561 | } | 567 | } |
| 562 | 568 | ||
| @@ -570,9 +576,12 @@ void __init omap_vram_reserve_sdram_memblock(void) | |||
| 570 | return; | 576 | return; |
| 571 | } | 577 | } |
| 572 | } else { | 578 | } else { |
| 573 | paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT); | 579 | paddr = memblock_alloc(size, PAGE_SIZE); |
| 574 | } | 580 | } |
| 575 | 581 | ||
| 582 | memblock_free(paddr, size); | ||
| 583 | memblock_remove(paddr, size); | ||
| 584 | |||
| 576 | omap_vram_add_region(paddr, size); | 585 | omap_vram_add_region(paddr, size); |
| 577 | 586 | ||
| 578 | pr_info("Reserving %u bytes SDRAM for VRAM\n", size); | 587 | pr_info("Reserving %u bytes SDRAM for VRAM\n", size); |
diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c index a0e22ac483a..167400e2a18 100644 --- a/drivers/video/riva/rivafb-i2c.c +++ b/drivers/video/riva/rivafb-i2c.c | |||
| @@ -94,7 +94,6 @@ static int __devinit riva_setup_i2c_bus(struct riva_i2c_chan *chan, | |||
| 94 | 94 | ||
| 95 | strcpy(chan->adapter.name, name); | 95 | strcpy(chan->adapter.name, name); |
| 96 | chan->adapter.owner = THIS_MODULE; | 96 | chan->adapter.owner = THIS_MODULE; |
| 97 | chan->adapter.id = I2C_HW_B_RIVA; | ||
| 98 | chan->adapter.class = i2c_class; | 97 | chan->adapter.class = i2c_class; |
| 99 | chan->adapter.algo_data = &chan->algo; | 98 | chan->adapter.algo_data = &chan->algo; |
| 100 | chan->adapter.dev.parent = &chan->par->pdev->dev; | 99 | chan->adapter.dev.parent = &chan->par->pdev->dev; |
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 55b3077ff6f..d7df10315d8 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
| @@ -1071,6 +1071,10 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1071 | if (!hdmi->info) | 1071 | if (!hdmi->info) |
| 1072 | goto out; | 1072 | goto out; |
| 1073 | 1073 | ||
| 1074 | hdmi->monspec.modedb_len = 0; | ||
| 1075 | fb_destroy_modedb(hdmi->monspec.modedb); | ||
| 1076 | hdmi->monspec.modedb = NULL; | ||
| 1077 | |||
| 1074 | acquire_console_sem(); | 1078 | acquire_console_sem(); |
| 1075 | 1079 | ||
| 1076 | /* HDMI disconnect */ | 1080 | /* HDMI disconnect */ |
| @@ -1078,7 +1082,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1078 | 1082 | ||
| 1079 | release_console_sem(); | 1083 | release_console_sem(); |
| 1080 | pm_runtime_put(hdmi->dev); | 1084 | pm_runtime_put(hdmi->dev); |
| 1081 | fb_destroy_modedb(hdmi->monspec.modedb); | ||
| 1082 | } | 1085 | } |
| 1083 | 1086 | ||
| 1084 | out: | 1087 | out: |
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 50963739a40..9b1364723c6 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
| @@ -115,15 +115,16 @@ static const struct fb_videomode default_720p = { | |||
| 115 | .xres = 1280, | 115 | .xres = 1280, |
| 116 | .yres = 720, | 116 | .yres = 720, |
| 117 | 117 | ||
| 118 | .left_margin = 200, | 118 | .left_margin = 220, |
| 119 | .right_margin = 88, | 119 | .right_margin = 110, |
| 120 | .hsync_len = 48, | 120 | .hsync_len = 40, |
| 121 | 121 | ||
| 122 | .upper_margin = 20, | 122 | .upper_margin = 20, |
| 123 | .lower_margin = 5, | 123 | .lower_margin = 5, |
| 124 | .vsync_len = 5, | 124 | .vsync_len = 5, |
| 125 | 125 | ||
| 126 | .pixclock = 13468, | 126 | .pixclock = 13468, |
| 127 | .refresh = 60, | ||
| 127 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, | 128 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, |
| 128 | }; | 129 | }; |
| 129 | 130 | ||
| @@ -1197,6 +1198,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1197 | const struct fb_videomode *mode = cfg->lcd_cfg; | 1198 | const struct fb_videomode *mode = cfg->lcd_cfg; |
| 1198 | unsigned long max_size = 0; | 1199 | unsigned long max_size = 0; |
| 1199 | int k; | 1200 | int k; |
| 1201 | int num_cfg; | ||
| 1200 | 1202 | ||
| 1201 | ch->info = framebuffer_alloc(0, &pdev->dev); | 1203 | ch->info = framebuffer_alloc(0, &pdev->dev); |
| 1202 | if (!ch->info) { | 1204 | if (!ch->info) { |
| @@ -1232,8 +1234,14 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1232 | info->fix = sh_mobile_lcdc_fix; | 1234 | info->fix = sh_mobile_lcdc_fix; |
| 1233 | info->fix.smem_len = max_size * (cfg->bpp / 8) * 2; | 1235 | info->fix.smem_len = max_size * (cfg->bpp / 8) * 2; |
| 1234 | 1236 | ||
| 1235 | if (!mode) | 1237 | if (!mode) { |
| 1236 | mode = &default_720p; | 1238 | mode = &default_720p; |
| 1239 | num_cfg = 1; | ||
| 1240 | } else { | ||
| 1241 | num_cfg = ch->cfg.num_cfg; | ||
| 1242 | } | ||
| 1243 | |||
| 1244 | fb_videomode_to_modelist(mode, num_cfg, &info->modelist); | ||
| 1237 | 1245 | ||
| 1238 | fb_videomode_to_var(var, mode); | 1246 | fb_videomode_to_var(var, mode); |
| 1239 | /* Default Y virtual resolution is 2x panel size */ | 1247 | /* Default Y virtual resolution is 2x panel size */ |
| @@ -1281,10 +1289,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1281 | 1289 | ||
| 1282 | for (i = 0; i < j; i++) { | 1290 | for (i = 0; i < j; i++) { |
| 1283 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; | 1291 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; |
| 1284 | const struct fb_videomode *mode = ch->cfg.lcd_cfg; | ||
| 1285 | |||
| 1286 | if (!mode) | ||
| 1287 | mode = &default_720p; | ||
| 1288 | 1292 | ||
| 1289 | info = ch->info; | 1293 | info = ch->info; |
| 1290 | 1294 | ||
| @@ -1297,7 +1301,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 1297 | } | 1301 | } |
| 1298 | } | 1302 | } |
| 1299 | 1303 | ||
| 1300 | fb_videomode_to_modelist(mode, ch->cfg.num_cfg, &info->modelist); | ||
| 1301 | error = register_framebuffer(info); | 1304 | error = register_framebuffer(info); |
| 1302 | if (error < 0) | 1305 | if (error < 0) |
| 1303 | goto err1; | 1306 | goto err1; |
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index b52f8e4ef1f..3dde12b0ab0 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
| @@ -4181,6 +4181,9 @@ static void __devinit | |||
| 4181 | sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize, | 4181 | sisfb_post_map_vram(struct sis_video_info *ivideo, unsigned int *mapsize, |
| 4182 | unsigned int min) | 4182 | unsigned int min) |
| 4183 | { | 4183 | { |
| 4184 | if (*mapsize < (min << 20)) | ||
| 4185 | return; | ||
| 4186 | |||
| 4184 | ivideo->video_vbase = ioremap(ivideo->video_base, (*mapsize)); | 4187 | ivideo->video_vbase = ioremap(ivideo->video_base, (*mapsize)); |
| 4185 | 4188 | ||
| 4186 | if(!ivideo->video_vbase) { | 4189 | if(!ivideo->video_vbase) { |
| @@ -4514,7 +4517,7 @@ sisfb_post_sis300(struct pci_dev *pdev) | |||
| 4514 | } else { | 4517 | } else { |
| 4515 | #endif | 4518 | #endif |
| 4516 | /* Need to map max FB size for finding out about RAM size */ | 4519 | /* Need to map max FB size for finding out about RAM size */ |
| 4517 | mapsize = 64 << 20; | 4520 | mapsize = ivideo->video_size; |
| 4518 | sisfb_post_map_vram(ivideo, &mapsize, 4); | 4521 | sisfb_post_map_vram(ivideo, &mapsize, 4); |
| 4519 | 4522 | ||
| 4520 | if(ivideo->video_vbase) { | 4523 | if(ivideo->video_vbase) { |
| @@ -4680,7 +4683,7 @@ sisfb_post_xgi_ramsize(struct sis_video_info *ivideo) | |||
| 4680 | orSISIDXREG(SISSR, 0x20, (0x80 | 0x04)); | 4683 | orSISIDXREG(SISSR, 0x20, (0x80 | 0x04)); |
| 4681 | 4684 | ||
| 4682 | /* Need to map max FB size for finding out about RAM size */ | 4685 | /* Need to map max FB size for finding out about RAM size */ |
| 4683 | mapsize = 256 << 20; | 4686 | mapsize = ivideo->video_size; |
| 4684 | sisfb_post_map_vram(ivideo, &mapsize, 32); | 4687 | sisfb_post_map_vram(ivideo, &mapsize, 32); |
| 4685 | 4688 | ||
| 4686 | if(!ivideo->video_vbase) { | 4689 | if(!ivideo->video_vbase) { |
| @@ -5936,6 +5939,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 5936 | } | 5939 | } |
| 5937 | 5940 | ||
| 5938 | ivideo->video_base = pci_resource_start(pdev, 0); | 5941 | ivideo->video_base = pci_resource_start(pdev, 0); |
| 5942 | ivideo->video_size = pci_resource_len(pdev, 0); | ||
| 5939 | ivideo->mmio_base = pci_resource_start(pdev, 1); | 5943 | ivideo->mmio_base = pci_resource_start(pdev, 1); |
| 5940 | ivideo->mmio_size = pci_resource_len(pdev, 1); | 5944 | ivideo->mmio_size = pci_resource_len(pdev, 1); |
| 5941 | ivideo->SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30; | 5945 | ivideo->SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30; |
diff --git a/drivers/xen/xenfs/privcmd.c b/drivers/xen/xenfs/privcmd.c index f80be7f6eb9..0f5d4162b22 100644 --- a/drivers/xen/xenfs/privcmd.c +++ b/drivers/xen/xenfs/privcmd.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/mman.h> | 15 | #include <linux/mman.h> |
| 16 | #include <linux/uaccess.h> | 16 | #include <linux/uaccess.h> |
| 17 | #include <linux/swap.h> | 17 | #include <linux/swap.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
| 20 | #include <linux/pagemap.h> | 19 | #include <linux/pagemap.h> |
| 21 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c index cafc5045429..e0c84725d3e 100644 --- a/drivers/zorro/proc.c +++ b/drivers/zorro/proc.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/proc_fs.h> | 13 | #include <linux/proc_fs.h> |
| 14 | #include <linux/seq_file.h> | 14 | #include <linux/seq_file.h> |
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/smp_lock.h> | ||
| 17 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
| 18 | #include <asm/amigahw.h> | 17 | #include <asm/amigahw.h> |
| 19 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 06e8ff12b97..4230252fd68 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
| 12 | #include <linux/kmod.h> | 12 | #include <linux/kmod.h> |
| 13 | #include <linux/major.h> | 13 | #include <linux/major.h> |
| 14 | #include <linux/smp_lock.h> | ||
| 15 | #include <linux/device_cgroup.h> | 14 | #include <linux/device_cgroup.h> |
| 16 | #include <linux/highmem.h> | 15 | #include <linux/highmem.h> |
| 17 | #include <linux/blkdev.h> | 16 | #include <linux/blkdev.h> |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 1d6a45b5a04..524b80be448 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
| 4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
| 5 | #include <linux/smp_lock.h> | ||
| 6 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
| 7 | #include <linux/string.h> | 6 | #include <linux/string.h> |
| 8 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 3142b15940c..7799cac2b62 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
| 7 | #include <linux/debugfs.h> | 7 | #include <linux/debugfs.h> |
| 8 | #include <linux/seq_file.h> | 8 | #include <linux/seq_file.h> |
| 9 | #include <linux/smp_lock.h> | ||
| 10 | 9 | ||
| 11 | #include "super.h" | 10 | #include "super.h" |
| 12 | #include "mds_client.h" | 11 | #include "mds_client.h" |
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 410ed188faa..a60579b007b 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
| 20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
| 21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | #include <linux/ioctl.h> | 22 | #include <linux/ioctl.h> |
| 24 | #include <linux/if.h> | 23 | #include <linux/if.h> |
| 25 | #include <linux/if_bridge.h> | 24 | #include <linux/if_bridge.h> |
diff --git a/fs/ecryptfs/super.c b/fs/ecryptfs/super.c index 253732382d3..2720178b771 100644 --- a/fs/ecryptfs/super.c +++ b/fs/ecryptfs/super.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/key.h> | 28 | #include <linux/key.h> |
| 29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
| 30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/file.h> | 31 | #include <linux/file.h> |
| 33 | #include <linux/crypto.h> | 32 | #include <linux/crypto.h> |
| 34 | #include "ecryptfs_kernel.h" | 33 | #include "ecryptfs_kernel.h" |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 2fedaf8b501..acf8695fa8f 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/blkdev.h> | 28 | #include <linux/blkdev.h> |
| 29 | #include <linux/parser.h> | 29 | #include <linux/parser.h> |
| 30 | #include <linux/smp_lock.h> | ||
| 31 | #include <linux/buffer_head.h> | 30 | #include <linux/buffer_head.h> |
| 32 | #include <linux/exportfs.h> | 31 | #include <linux/exportfs.h> |
| 33 | #include <linux/vfs.h> | 32 | #include <linux/vfs.h> |
diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c index 06d582732d3..5ab3839dfcb 100644 --- a/fs/gfs2/export.c +++ b/fs/gfs2/export.c | |||
| @@ -138,10 +138,8 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, | |||
| 138 | struct gfs2_inum_host *inum) | 138 | struct gfs2_inum_host *inum) |
| 139 | { | 139 | { |
| 140 | struct gfs2_sbd *sdp = sb->s_fs_info; | 140 | struct gfs2_sbd *sdp = sb->s_fs_info; |
| 141 | struct gfs2_holder i_gh; | ||
| 142 | struct inode *inode; | 141 | struct inode *inode; |
| 143 | struct dentry *dentry; | 142 | struct dentry *dentry; |
| 144 | int error; | ||
| 145 | 143 | ||
| 146 | inode = gfs2_ilookup(sb, inum->no_addr); | 144 | inode = gfs2_ilookup(sb, inum->no_addr); |
| 147 | if (inode) { | 145 | if (inode) { |
| @@ -152,52 +150,16 @@ static struct dentry *gfs2_get_dentry(struct super_block *sb, | |||
| 152 | goto out_inode; | 150 | goto out_inode; |
| 153 | } | 151 | } |
| 154 | 152 | ||
| 155 | error = gfs2_glock_nq_num(sdp, inum->no_addr, &gfs2_inode_glops, | 153 | inode = gfs2_lookup_by_inum(sdp, inum->no_addr, &inum->no_formal_ino, |
| 156 | LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | 154 | GFS2_BLKST_DINODE); |
| 157 | if (error) | 155 | if (IS_ERR(inode)) |
| 158 | return ERR_PTR(error); | 156 | return ERR_CAST(inode); |
| 159 | |||
| 160 | error = gfs2_check_blk_type(sdp, inum->no_addr, GFS2_BLKST_DINODE); | ||
| 161 | if (error) | ||
| 162 | goto fail; | ||
| 163 | |||
| 164 | inode = gfs2_inode_lookup(sb, DT_UNKNOWN, inum->no_addr, 0); | ||
| 165 | if (IS_ERR(inode)) { | ||
| 166 | error = PTR_ERR(inode); | ||
| 167 | goto fail; | ||
| 168 | } | ||
| 169 | |||
| 170 | error = gfs2_inode_refresh(GFS2_I(inode)); | ||
| 171 | if (error) { | ||
| 172 | iput(inode); | ||
| 173 | goto fail; | ||
| 174 | } | ||
| 175 | |||
| 176 | /* Pick up the works we bypass in gfs2_inode_lookup */ | ||
| 177 | if (inode->i_state & I_NEW) | ||
| 178 | gfs2_set_iop(inode); | ||
| 179 | |||
| 180 | if (GFS2_I(inode)->i_no_formal_ino != inum->no_formal_ino) { | ||
| 181 | iput(inode); | ||
| 182 | goto fail; | ||
| 183 | } | ||
| 184 | |||
| 185 | error = -EIO; | ||
| 186 | if (GFS2_I(inode)->i_diskflags & GFS2_DIF_SYSTEM) { | ||
| 187 | iput(inode); | ||
| 188 | goto fail; | ||
| 189 | } | ||
| 190 | |||
| 191 | gfs2_glock_dq_uninit(&i_gh); | ||
| 192 | 157 | ||
| 193 | out_inode: | 158 | out_inode: |
| 194 | dentry = d_obtain_alias(inode); | 159 | dentry = d_obtain_alias(inode); |
| 195 | if (!IS_ERR(dentry)) | 160 | if (!IS_ERR(dentry)) |
| 196 | dentry->d_op = &gfs2_dops; | 161 | dentry->d_op = &gfs2_dops; |
| 197 | return dentry; | 162 | return dentry; |
| 198 | fail: | ||
| 199 | gfs2_glock_dq_uninit(&i_gh); | ||
| 200 | return ERR_PTR(error); | ||
| 201 | } | 163 | } |
| 202 | 164 | ||
| 203 | static struct dentry *gfs2_fh_to_dentry(struct super_block *sb, struct fid *fid, | 165 | static struct dentry *gfs2_fh_to_dentry(struct super_block *sb, struct fid *fid, |
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 87778857f09..f92c1770416 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
| @@ -686,21 +686,20 @@ static void delete_work_func(struct work_struct *work) | |||
| 686 | { | 686 | { |
| 687 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); | 687 | struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_delete); |
| 688 | struct gfs2_sbd *sdp = gl->gl_sbd; | 688 | struct gfs2_sbd *sdp = gl->gl_sbd; |
| 689 | struct gfs2_inode *ip = NULL; | 689 | struct gfs2_inode *ip; |
| 690 | struct inode *inode; | 690 | struct inode *inode; |
| 691 | u64 no_addr = 0; | 691 | u64 no_addr = gl->gl_name.ln_number; |
| 692 | |||
| 693 | ip = gl->gl_object; | ||
| 694 | /* Note: Unsafe to dereference ip as we don't hold right refs/locks */ | ||
| 692 | 695 | ||
| 693 | spin_lock(&gl->gl_spin); | ||
| 694 | ip = (struct gfs2_inode *)gl->gl_object; | ||
| 695 | if (ip) | 696 | if (ip) |
| 696 | no_addr = ip->i_no_addr; | ||
| 697 | spin_unlock(&gl->gl_spin); | ||
| 698 | if (ip) { | ||
| 699 | inode = gfs2_ilookup(sdp->sd_vfs, no_addr); | 697 | inode = gfs2_ilookup(sdp->sd_vfs, no_addr); |
| 700 | if (inode) { | 698 | else |
| 701 | d_prune_aliases(inode); | 699 | inode = gfs2_lookup_by_inum(sdp, no_addr, NULL, GFS2_BLKST_UNLINKED); |
| 702 | iput(inode); | 700 | if (inode && !IS_ERR(inode)) { |
| 703 | } | 701 | d_prune_aliases(inode); |
| 702 | iput(inode); | ||
| 704 | } | 703 | } |
| 705 | gfs2_glock_put(gl); | 704 | gfs2_glock_put(gl); |
| 706 | } | 705 | } |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 06370f8bd8c..e1213f7f921 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
| @@ -73,49 +73,6 @@ static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr) | |||
| 73 | return iget5_locked(sb, hash, iget_test, iget_set, &no_addr); | 73 | return iget5_locked(sb, hash, iget_test, iget_set, &no_addr); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | struct gfs2_skip_data { | ||
| 77 | u64 no_addr; | ||
| 78 | int skipped; | ||
| 79 | }; | ||
| 80 | |||
| 81 | static int iget_skip_test(struct inode *inode, void *opaque) | ||
| 82 | { | ||
| 83 | struct gfs2_inode *ip = GFS2_I(inode); | ||
| 84 | struct gfs2_skip_data *data = opaque; | ||
| 85 | |||
| 86 | if (ip->i_no_addr == data->no_addr) { | ||
| 87 | if (inode->i_state & (I_FREEING|I_WILL_FREE)){ | ||
| 88 | data->skipped = 1; | ||
| 89 | return 0; | ||
| 90 | } | ||
| 91 | return 1; | ||
| 92 | } | ||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | |||
| 96 | static int iget_skip_set(struct inode *inode, void *opaque) | ||
| 97 | { | ||
| 98 | struct gfs2_inode *ip = GFS2_I(inode); | ||
| 99 | struct gfs2_skip_data *data = opaque; | ||
| 100 | |||
| 101 | if (data->skipped) | ||
| 102 | return 1; | ||
| 103 | inode->i_ino = (unsigned long)(data->no_addr); | ||
| 104 | ip->i_no_addr = data->no_addr; | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | static struct inode *gfs2_iget_skip(struct super_block *sb, | ||
| 109 | u64 no_addr) | ||
| 110 | { | ||
| 111 | struct gfs2_skip_data data; | ||
| 112 | unsigned long hash = (unsigned long)no_addr; | ||
| 113 | |||
| 114 | data.no_addr = no_addr; | ||
| 115 | data.skipped = 0; | ||
| 116 | return iget5_locked(sb, hash, iget_skip_test, iget_skip_set, &data); | ||
| 117 | } | ||
| 118 | |||
| 119 | /** | 76 | /** |
| 120 | * GFS2 lookup code fills in vfs inode contents based on info obtained | 77 | * GFS2 lookup code fills in vfs inode contents based on info obtained |
| 121 | * from directory entry inside gfs2_inode_lookup(). This has caused issues | 78 | * from directory entry inside gfs2_inode_lookup(). This has caused issues |
| @@ -243,93 +200,54 @@ fail: | |||
| 243 | return ERR_PTR(error); | 200 | return ERR_PTR(error); |
| 244 | } | 201 | } |
| 245 | 202 | ||
| 246 | /** | 203 | struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, |
| 247 | * gfs2_process_unlinked_inode - Lookup an unlinked inode for reclamation | 204 | u64 *no_formal_ino, unsigned int blktype) |
| 248 | * and try to reclaim it by doing iput. | ||
| 249 | * | ||
| 250 | * This function assumes no rgrp locks are currently held. | ||
| 251 | * | ||
| 252 | * @sb: The super block | ||
| 253 | * no_addr: The inode number | ||
| 254 | * | ||
| 255 | */ | ||
| 256 | |||
| 257 | void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | ||
| 258 | { | 205 | { |
| 259 | struct gfs2_sbd *sdp; | 206 | struct super_block *sb = sdp->sd_vfs; |
| 260 | struct gfs2_inode *ip; | 207 | struct gfs2_holder i_gh; |
| 261 | struct gfs2_glock *io_gl = NULL; | ||
| 262 | int error; | ||
| 263 | struct gfs2_holder gh; | ||
| 264 | struct inode *inode; | 208 | struct inode *inode; |
| 209 | int error; | ||
| 265 | 210 | ||
| 266 | inode = gfs2_iget_skip(sb, no_addr); | 211 | error = gfs2_glock_nq_num(sdp, no_addr, &gfs2_inode_glops, |
| 267 | 212 | LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | |
| 268 | if (!inode) | 213 | if (error) |
| 269 | return; | 214 | return ERR_PTR(error); |
| 270 | |||
| 271 | /* If it's not a new inode, someone's using it, so leave it alone. */ | ||
| 272 | if (!(inode->i_state & I_NEW)) { | ||
| 273 | iput(inode); | ||
| 274 | return; | ||
| 275 | } | ||
| 276 | |||
| 277 | ip = GFS2_I(inode); | ||
| 278 | sdp = GFS2_SB(inode); | ||
| 279 | ip->i_no_formal_ino = -1; | ||
| 280 | 215 | ||
| 281 | error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl); | 216 | error = gfs2_check_blk_type(sdp, no_addr, blktype); |
| 282 | if (unlikely(error)) | 217 | if (error) |
| 283 | goto fail; | 218 | goto fail; |
| 284 | ip->i_gl->gl_object = ip; | ||
| 285 | 219 | ||
| 286 | error = gfs2_glock_get(sdp, no_addr, &gfs2_iopen_glops, CREATE, &io_gl); | 220 | inode = gfs2_inode_lookup(sb, DT_UNKNOWN, no_addr, 0); |
| 287 | if (unlikely(error)) | 221 | if (IS_ERR(inode)) |
| 288 | goto fail_put; | 222 | goto fail; |
| 289 | |||
| 290 | set_bit(GIF_INVALID, &ip->i_flags); | ||
| 291 | error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, LM_FLAG_TRY | GL_EXACT, | ||
| 292 | &ip->i_iopen_gh); | ||
| 293 | if (unlikely(error)) | ||
| 294 | goto fail_iopen; | ||
| 295 | 223 | ||
| 296 | ip->i_iopen_gh.gh_gl->gl_object = ip; | 224 | error = gfs2_inode_refresh(GFS2_I(inode)); |
| 297 | gfs2_glock_put(io_gl); | 225 | if (error) |
| 298 | io_gl = NULL; | 226 | goto fail_iput; |
| 299 | 227 | ||
| 300 | inode->i_mode = DT2IF(DT_UNKNOWN); | 228 | /* Pick up the works we bypass in gfs2_inode_lookup */ |
| 229 | if (inode->i_state & I_NEW) | ||
| 230 | gfs2_set_iop(inode); | ||
| 301 | 231 | ||
| 302 | /* | 232 | /* Two extra checks for NFS only */ |
| 303 | * We must read the inode in order to work out its type in | 233 | if (no_formal_ino) { |
| 304 | * this case. Note that this doesn't happen often as we normally | 234 | error = -ESTALE; |
| 305 | * know the type beforehand. This code path only occurs during | 235 | if (GFS2_I(inode)->i_no_formal_ino != *no_formal_ino) |
| 306 | * unlinked inode recovery (where it is safe to do this glock, | 236 | goto fail_iput; |
| 307 | * which is not true in the general case). | ||
| 308 | */ | ||
| 309 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, LM_FLAG_TRY, | ||
| 310 | &gh); | ||
| 311 | if (unlikely(error)) | ||
| 312 | goto fail_glock; | ||
| 313 | 237 | ||
| 314 | /* Inode is now uptodate */ | 238 | error = -EIO; |
| 315 | gfs2_glock_dq_uninit(&gh); | 239 | if (GFS2_I(inode)->i_diskflags & GFS2_DIF_SYSTEM) |
| 316 | gfs2_set_iop(inode); | 240 | goto fail_iput; |
| 317 | 241 | ||
| 318 | /* The iput will cause it to be deleted. */ | 242 | error = 0; |
| 319 | iput(inode); | 243 | } |
| 320 | return; | ||
| 321 | 244 | ||
| 322 | fail_glock: | ||
| 323 | gfs2_glock_dq(&ip->i_iopen_gh); | ||
| 324 | fail_iopen: | ||
| 325 | if (io_gl) | ||
| 326 | gfs2_glock_put(io_gl); | ||
| 327 | fail_put: | ||
| 328 | ip->i_gl->gl_object = NULL; | ||
| 329 | gfs2_glock_put(ip->i_gl); | ||
| 330 | fail: | 245 | fail: |
| 331 | iget_failed(inode); | 246 | gfs2_glock_dq_uninit(&i_gh); |
| 332 | return; | 247 | return error ? ERR_PTR(error) : inode; |
| 248 | fail_iput: | ||
| 249 | iput(inode); | ||
| 250 | goto fail; | ||
| 333 | } | 251 | } |
| 334 | 252 | ||
| 335 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | 253 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) |
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 6720d7d5fbc..d8499fadcc5 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
| @@ -99,7 +99,9 @@ err: | |||
| 99 | extern void gfs2_set_iop(struct inode *inode); | 99 | extern void gfs2_set_iop(struct inode *inode); |
| 100 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, | 100 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, |
| 101 | u64 no_addr, u64 no_formal_ino); | 101 | u64 no_addr, u64 no_formal_ino); |
| 102 | extern void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr); | 102 | extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, |
| 103 | u64 *no_formal_ino, | ||
| 104 | unsigned int blktype); | ||
| 103 | extern struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr); | 105 | extern struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr); |
| 104 | 106 | ||
| 105 | extern int gfs2_inode_refresh(struct gfs2_inode *ip); | 107 | extern int gfs2_inode_refresh(struct gfs2_inode *ip); |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index bef3ab6cf5c..33c8407b876 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
| @@ -963,17 +963,18 @@ static int try_rgrp_fit(struct gfs2_rgrpd *rgd, struct gfs2_alloc *al) | |||
| 963 | * The inode, if one has been found, in inode. | 963 | * The inode, if one has been found, in inode. |
| 964 | */ | 964 | */ |
| 965 | 965 | ||
| 966 | static u64 try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, | 966 | static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip) |
| 967 | u64 skip) | ||
| 968 | { | 967 | { |
| 969 | u32 goal = 0, block; | 968 | u32 goal = 0, block; |
| 970 | u64 no_addr; | 969 | u64 no_addr; |
| 971 | struct gfs2_sbd *sdp = rgd->rd_sbd; | 970 | struct gfs2_sbd *sdp = rgd->rd_sbd; |
| 972 | unsigned int n; | 971 | unsigned int n; |
| 972 | struct gfs2_glock *gl; | ||
| 973 | struct gfs2_inode *ip; | ||
| 974 | int error; | ||
| 975 | int found = 0; | ||
| 973 | 976 | ||
| 974 | for(;;) { | 977 | while (goal < rgd->rd_data) { |
| 975 | if (goal >= rgd->rd_data) | ||
| 976 | break; | ||
| 977 | down_write(&sdp->sd_log_flush_lock); | 978 | down_write(&sdp->sd_log_flush_lock); |
| 978 | n = 1; | 979 | n = 1; |
| 979 | block = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED, | 980 | block = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED, |
| @@ -990,11 +991,32 @@ static u64 try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, | |||
| 990 | if (no_addr == skip) | 991 | if (no_addr == skip) |
| 991 | continue; | 992 | continue; |
| 992 | *last_unlinked = no_addr; | 993 | *last_unlinked = no_addr; |
| 993 | return no_addr; | 994 | |
| 995 | error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &gl); | ||
| 996 | if (error) | ||
| 997 | continue; | ||
| 998 | |||
| 999 | /* If the inode is already in cache, we can ignore it here | ||
| 1000 | * because the existing inode disposal code will deal with | ||
| 1001 | * it when all refs have gone away. Accessing gl_object like | ||
| 1002 | * this is not safe in general. Here it is ok because we do | ||
| 1003 | * not dereference the pointer, and we only need an approx | ||
| 1004 | * answer to whether it is NULL or not. | ||
| 1005 | */ | ||
| 1006 | ip = gl->gl_object; | ||
| 1007 | |||
| 1008 | if (ip || queue_work(gfs2_delete_workqueue, &gl->gl_delete) == 0) | ||
| 1009 | gfs2_glock_put(gl); | ||
| 1010 | else | ||
| 1011 | found++; | ||
| 1012 | |||
| 1013 | /* Limit reclaim to sensible number of tasks */ | ||
| 1014 | if (found > 2*NR_CPUS) | ||
| 1015 | return; | ||
| 994 | } | 1016 | } |
| 995 | 1017 | ||
| 996 | rgd->rd_flags &= ~GFS2_RDF_CHECK; | 1018 | rgd->rd_flags &= ~GFS2_RDF_CHECK; |
| 997 | return 0; | 1019 | return; |
| 998 | } | 1020 | } |
| 999 | 1021 | ||
| 1000 | /** | 1022 | /** |
| @@ -1075,11 +1097,9 @@ static void forward_rgrp_set(struct gfs2_sbd *sdp, struct gfs2_rgrpd *rgd) | |||
| 1075 | * Try to acquire rgrp in way which avoids contending with others. | 1097 | * Try to acquire rgrp in way which avoids contending with others. |
| 1076 | * | 1098 | * |
| 1077 | * Returns: errno | 1099 | * Returns: errno |
| 1078 | * unlinked: the block address of an unlinked block to be reclaimed | ||
| 1079 | */ | 1100 | */ |
| 1080 | 1101 | ||
| 1081 | static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | 1102 | static int get_local_rgrp(struct gfs2_inode *ip, u64 *last_unlinked) |
| 1082 | u64 *last_unlinked) | ||
| 1083 | { | 1103 | { |
| 1084 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1104 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 1085 | struct gfs2_rgrpd *rgd, *begin = NULL; | 1105 | struct gfs2_rgrpd *rgd, *begin = NULL; |
| @@ -1089,7 +1109,6 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | |||
| 1089 | int loops = 0; | 1109 | int loops = 0; |
| 1090 | int error, rg_locked; | 1110 | int error, rg_locked; |
| 1091 | 1111 | ||
| 1092 | *unlinked = 0; | ||
| 1093 | rgd = gfs2_blk2rgrpd(sdp, ip->i_goal); | 1112 | rgd = gfs2_blk2rgrpd(sdp, ip->i_goal); |
| 1094 | 1113 | ||
| 1095 | while (rgd) { | 1114 | while (rgd) { |
| @@ -1106,17 +1125,10 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | |||
| 1106 | case 0: | 1125 | case 0: |
| 1107 | if (try_rgrp_fit(rgd, al)) | 1126 | if (try_rgrp_fit(rgd, al)) |
| 1108 | goto out; | 1127 | goto out; |
| 1109 | /* If the rg came in already locked, there's no | 1128 | if (rgd->rd_flags & GFS2_RDF_CHECK) |
| 1110 | way we can recover from a failed try_rgrp_unlink | 1129 | try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr); |
| 1111 | because that would require an iput which can only | ||
| 1112 | happen after the rgrp is unlocked. */ | ||
| 1113 | if (!rg_locked && rgd->rd_flags & GFS2_RDF_CHECK) | ||
| 1114 | *unlinked = try_rgrp_unlink(rgd, last_unlinked, | ||
| 1115 | ip->i_no_addr); | ||
| 1116 | if (!rg_locked) | 1130 | if (!rg_locked) |
| 1117 | gfs2_glock_dq_uninit(&al->al_rgd_gh); | 1131 | gfs2_glock_dq_uninit(&al->al_rgd_gh); |
| 1118 | if (*unlinked) | ||
| 1119 | return -EAGAIN; | ||
| 1120 | /* fall through */ | 1132 | /* fall through */ |
| 1121 | case GLR_TRYFAILED: | 1133 | case GLR_TRYFAILED: |
| 1122 | rgd = recent_rgrp_next(rgd); | 1134 | rgd = recent_rgrp_next(rgd); |
| @@ -1145,13 +1157,10 @@ static int get_local_rgrp(struct gfs2_inode *ip, u64 *unlinked, | |||
| 1145 | case 0: | 1157 | case 0: |
| 1146 | if (try_rgrp_fit(rgd, al)) | 1158 | if (try_rgrp_fit(rgd, al)) |
| 1147 | goto out; | 1159 | goto out; |
| 1148 | if (!rg_locked && rgd->rd_flags & GFS2_RDF_CHECK) | 1160 | if (rgd->rd_flags & GFS2_RDF_CHECK) |
| 1149 | *unlinked = try_rgrp_unlink(rgd, last_unlinked, | 1161 | try_rgrp_unlink(rgd, last_unlinked, ip->i_no_addr); |
| 1150 | ip->i_no_addr); | ||
| 1151 | if (!rg_locked) | 1162 | if (!rg_locked) |
| 1152 | gfs2_glock_dq_uninit(&al->al_rgd_gh); | 1163 | gfs2_glock_dq_uninit(&al->al_rgd_gh); |
| 1153 | if (*unlinked) | ||
| 1154 | return -EAGAIN; | ||
| 1155 | break; | 1164 | break; |
| 1156 | 1165 | ||
| 1157 | case GLR_TRYFAILED: | 1166 | case GLR_TRYFAILED: |
| @@ -1204,12 +1213,12 @@ int gfs2_inplace_reserve_i(struct gfs2_inode *ip, int hold_rindex, | |||
| 1204 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); | 1213 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 1205 | struct gfs2_alloc *al = ip->i_alloc; | 1214 | struct gfs2_alloc *al = ip->i_alloc; |
| 1206 | int error = 0; | 1215 | int error = 0; |
| 1207 | u64 last_unlinked = NO_BLOCK, unlinked; | 1216 | u64 last_unlinked = NO_BLOCK; |
| 1217 | int tries = 0; | ||
| 1208 | 1218 | ||
| 1209 | if (gfs2_assert_warn(sdp, al->al_requested)) | 1219 | if (gfs2_assert_warn(sdp, al->al_requested)) |
| 1210 | return -EINVAL; | 1220 | return -EINVAL; |
| 1211 | 1221 | ||
| 1212 | try_again: | ||
| 1213 | if (hold_rindex) { | 1222 | if (hold_rindex) { |
| 1214 | /* We need to hold the rindex unless the inode we're using is | 1223 | /* We need to hold the rindex unless the inode we're using is |
| 1215 | the rindex itself, in which case it's already held. */ | 1224 | the rindex itself, in which case it's already held. */ |
| @@ -1218,31 +1227,23 @@ try_again: | |||
| 1218 | else if (!sdp->sd_rgrps) /* We may not have the rindex read | 1227 | else if (!sdp->sd_rgrps) /* We may not have the rindex read |
| 1219 | in, so: */ | 1228 | in, so: */ |
| 1220 | error = gfs2_ri_update_special(ip); | 1229 | error = gfs2_ri_update_special(ip); |
| 1230 | if (error) | ||
| 1231 | return error; | ||
| 1221 | } | 1232 | } |
| 1222 | 1233 | ||
| 1223 | if (error) | 1234 | do { |
| 1224 | return error; | 1235 | error = get_local_rgrp(ip, &last_unlinked); |
| 1236 | /* If there is no space, flushing the log may release some */ | ||
| 1237 | if (error) | ||
| 1238 | gfs2_log_flush(sdp, NULL); | ||
| 1239 | } while (error && tries++ < 3); | ||
| 1225 | 1240 | ||
| 1226 | /* Find an rgrp suitable for allocation. If it encounters any unlinked | ||
| 1227 | dinodes along the way, error will equal -EAGAIN and unlinked will | ||
| 1228 | contains it block address. We then need to look up that inode and | ||
| 1229 | try to free it, and try the allocation again. */ | ||
| 1230 | error = get_local_rgrp(ip, &unlinked, &last_unlinked); | ||
| 1231 | if (error) { | 1241 | if (error) { |
| 1232 | if (hold_rindex && ip != GFS2_I(sdp->sd_rindex)) | 1242 | if (hold_rindex && ip != GFS2_I(sdp->sd_rindex)) |
| 1233 | gfs2_glock_dq_uninit(&al->al_ri_gh); | 1243 | gfs2_glock_dq_uninit(&al->al_ri_gh); |
| 1234 | if (error != -EAGAIN) | 1244 | return error; |
| 1235 | return error; | ||
| 1236 | |||
| 1237 | gfs2_process_unlinked_inode(ip->i_inode.i_sb, unlinked); | ||
| 1238 | /* regardless of whether or not gfs2_process_unlinked_inode | ||
| 1239 | was successful, we don't want to repeat it again. */ | ||
| 1240 | last_unlinked = unlinked; | ||
| 1241 | gfs2_log_flush(sdp, NULL); | ||
| 1242 | error = 0; | ||
| 1243 | |||
| 1244 | goto try_again; | ||
| 1245 | } | 1245 | } |
| 1246 | |||
| 1246 | /* no error, so we have the rgrp set in the inode's allocation. */ | 1247 | /* no error, so we have the rgrp set in the inode's allocation. */ |
| 1247 | al->al_file = file; | 1248 | al->al_file = file; |
| 1248 | al->al_line = line; | 1249 | al->al_line = line; |
diff --git a/fs/ioctl.c b/fs/ioctl.c index e92fdbb3bc3..4f46752ce4f 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/syscalls.h> | 7 | #include <linux/syscalls.h> |
| 8 | #include <linux/mm.h> | 8 | #include <linux/mm.h> |
| 9 | #include <linux/smp_lock.h> | ||
| 10 | #include <linux/capability.h> | 9 | #include <linux/capability.h> |
| 11 | #include <linux/file.h> | 10 | #include <linux/file.h> |
| 12 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index d5bb86866e6..25509eb28fd 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include <linux/sunrpc/clnt.h> | 14 | #include <linux/sunrpc/clnt.h> |
| 15 | #include <linux/sunrpc/svc.h> | 15 | #include <linux/sunrpc/svc.h> |
| 16 | #include <linux/lockd/lockd.h> | 16 | #include <linux/lockd/lockd.h> |
| 17 | #include <linux/smp_lock.h> | ||
| 18 | #include <linux/kthread.h> | 17 | #include <linux/kthread.h> |
| 19 | 18 | ||
| 20 | #define NLMDBG_FACILITY NLMDBG_CLIENT | 19 | #define NLMDBG_FACILITY NLMDBG_CLIENT |
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 47ea1e1925b..332c54cf75e 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | #include <linux/smp_lock.h> | ||
| 11 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
| 12 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 13 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 25e21e4023b..ed0c59fe23c 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
| @@ -124,7 +124,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | |||
| 124 | continue; | 124 | continue; |
| 125 | if (host->h_server != ni->server) | 125 | if (host->h_server != ni->server) |
| 126 | continue; | 126 | continue; |
| 127 | if (ni->server && | 127 | if (ni->server && ni->src_len != 0 && |
| 128 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) | 128 | !rpc_cmp_addr(nlm_srcaddr(host), ni->src_sap)) |
| 129 | continue; | 129 | continue; |
| 130 | 130 | ||
| @@ -167,6 +167,7 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) | |||
| 167 | host->h_addrlen = ni->salen; | 167 | host->h_addrlen = ni->salen; |
| 168 | rpc_set_port(nlm_addr(host), 0); | 168 | rpc_set_port(nlm_addr(host), 0); |
| 169 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); | 169 | memcpy(nlm_srcaddr(host), ni->src_sap, ni->src_len); |
| 170 | host->h_srcaddrlen = ni->src_len; | ||
| 170 | host->h_version = ni->version; | 171 | host->h_version = ni->version; |
| 171 | host->h_proto = ni->protocol; | 172 | host->h_proto = ni->protocol; |
| 172 | host->h_rpcclnt = NULL; | 173 | host->h_rpcclnt = NULL; |
| @@ -238,9 +239,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 238 | const char *hostname, | 239 | const char *hostname, |
| 239 | int noresvport) | 240 | int noresvport) |
| 240 | { | 241 | { |
| 241 | const struct sockaddr source = { | ||
| 242 | .sa_family = AF_UNSPEC, | ||
| 243 | }; | ||
| 244 | struct nlm_lookup_host_info ni = { | 242 | struct nlm_lookup_host_info ni = { |
| 245 | .server = 0, | 243 | .server = 0, |
| 246 | .sap = sap, | 244 | .sap = sap, |
| @@ -249,8 +247,6 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
| 249 | .version = version, | 247 | .version = version, |
| 250 | .hostname = hostname, | 248 | .hostname = hostname, |
| 251 | .hostname_len = strlen(hostname), | 249 | .hostname_len = strlen(hostname), |
| 252 | .src_sap = &source, | ||
| 253 | .src_len = sizeof(source), | ||
| 254 | .noresvport = noresvport, | 250 | .noresvport = noresvport, |
| 255 | }; | 251 | }; |
| 256 | 252 | ||
| @@ -357,7 +353,6 @@ nlm_bind_host(struct nlm_host *host) | |||
| 357 | .protocol = host->h_proto, | 353 | .protocol = host->h_proto, |
| 358 | .address = nlm_addr(host), | 354 | .address = nlm_addr(host), |
| 359 | .addrsize = host->h_addrlen, | 355 | .addrsize = host->h_addrlen, |
| 360 | .saddress = nlm_srcaddr(host), | ||
| 361 | .timeout = &timeparms, | 356 | .timeout = &timeparms, |
| 362 | .servername = host->h_name, | 357 | .servername = host->h_name, |
| 363 | .program = &nlm_program, | 358 | .program = &nlm_program, |
| @@ -376,6 +371,8 @@ nlm_bind_host(struct nlm_host *host) | |||
| 376 | args.flags |= RPC_CLNT_CREATE_HARDRTRY; | 371 | args.flags |= RPC_CLNT_CREATE_HARDRTRY; |
| 377 | if (host->h_noresvport) | 372 | if (host->h_noresvport) |
| 378 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; | 373 | args.flags |= RPC_CLNT_CREATE_NONPRIVPORT; |
| 374 | if (host->h_srcaddrlen) | ||
| 375 | args.saddress = nlm_srcaddr(host); | ||
| 379 | 376 | ||
| 380 | clnt = rpc_create(&args); | 377 | clnt = rpc_create(&args); |
| 381 | if (!IS_ERR(clnt)) | 378 | if (!IS_ERR(clnt)) |
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c index a336e832475..38d26119245 100644 --- a/fs/lockd/svc4proc.c +++ b/fs/lockd/svc4proc.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/lockd/lockd.h> | 12 | #include <linux/lockd/lockd.h> |
| 14 | #include <linux/lockd/share.h> | 13 | #include <linux/lockd/share.h> |
| 15 | 14 | ||
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index c462d346acb..ef5659b211e 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <linux/errno.h> | 25 | #include <linux/errno.h> |
| 26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
| 27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
| 28 | #include <linux/smp_lock.h> | ||
| 29 | #include <linux/sunrpc/clnt.h> | 28 | #include <linux/sunrpc/clnt.h> |
| 30 | #include <linux/sunrpc/svc.h> | 29 | #include <linux/sunrpc/svc.h> |
| 31 | #include <linux/lockd/nlm.h> | 30 | #include <linux/lockd/nlm.h> |
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c index c3069f38d60..0caea5310ac 100644 --- a/fs/lockd/svcproc.c +++ b/fs/lockd/svcproc.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 11 | #include <linux/time.h> | 11 | #include <linux/time.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/lockd/lockd.h> | 12 | #include <linux/lockd/lockd.h> |
| 14 | #include <linux/lockd/share.h> | 13 | #include <linux/lockd/share.h> |
| 15 | 14 | ||
diff --git a/fs/locks.c b/fs/locks.c index 0e62dd35d08..8729347bcd1 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
| @@ -122,7 +122,6 @@ | |||
| 122 | #include <linux/module.h> | 122 | #include <linux/module.h> |
| 123 | #include <linux/security.h> | 123 | #include <linux/security.h> |
| 124 | #include <linux/slab.h> | 124 | #include <linux/slab.h> |
| 125 | #include <linux/smp_lock.h> | ||
| 126 | #include <linux/syscalls.h> | 125 | #include <linux/syscalls.h> |
| 127 | #include <linux/time.h> | 126 | #include <linux/time.h> |
| 128 | #include <linux/rcupdate.h> | 127 | #include <linux/rcupdate.h> |
diff --git a/fs/namespace.c b/fs/namespace.c index 8a415c9c5e5..3dbfc072ec7 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
| 14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
| 15 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
| 16 | #include <linux/smp_lock.h> | ||
| 17 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| 18 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
| 19 | #include <linux/acct.h> | 18 | #include <linux/acct.h> |
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index aac8832e919..f22b12e7d33 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
| 20 | #include <asm/uaccess.h> | 20 | #include <asm/uaccess.h> |
| 21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
| 22 | #include <linux/smp_lock.h> | ||
| 23 | 22 | ||
| 24 | #include <linux/ncp_fs.h> | 23 | #include <linux/ncp_fs.h> |
| 25 | 24 | ||
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 6c754f70c52..cb50aaf981d 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/vmalloc.h> | 18 | #include <linux/vmalloc.h> |
| 19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | 20 | ||
| 22 | #include <linux/ncp_fs.h> | 21 | #include <linux/ncp_fs.h> |
| 23 | #include "ncplib_kernel.h" | 22 | #include "ncplib_kernel.h" |
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index d290545aa0c..8fb93b604e7 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
| 27 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/smp_lock.h> | ||
| 30 | #include <linux/vfs.h> | 29 | #include <linux/vfs.h> |
| 31 | #include <linux/mount.h> | 30 | #include <linux/mount.h> |
| 32 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index c2a1f9a155c..d40a547e337 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/mount.h> | 17 | #include <linux/mount.h> |
| 18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
| 19 | #include <linux/highuid.h> | 19 | #include <linux/highuid.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/vmalloc.h> | 20 | #include <linux/vmalloc.h> |
| 22 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
| 23 | 22 | ||
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index aeec017fe81..93a8b3bd69e 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/completion.h> | 9 | #include <linux/completion.h> |
| 10 | #include <linux/ip.h> | 10 | #include <linux/ip.h> |
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/sunrpc/svc.h> | 12 | #include <linux/sunrpc/svc.h> |
| 14 | #include <linux/sunrpc/svcsock.h> | 13 | #include <linux/sunrpc/svcsock.h> |
| 15 | #include <linux/nfs_fs.h> | 14 | #include <linux/nfs_fs.h> |
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 232a7eead33..1fd62fc49be 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
| 14 | #include <linux/smp_lock.h> | ||
| 15 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
| 16 | 15 | ||
| 17 | #include <linux/nfs4.h> | 16 | #include <linux/nfs4.h> |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 07ac3847e56..662df2a5fad 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/mount.h> | 34 | #include <linux/mount.h> |
| 35 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
| 36 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
| 37 | #include <linux/kmemleak.h> | ||
| 37 | 38 | ||
| 38 | #include "delegation.h" | 39 | #include "delegation.h" |
| 39 | #include "iostat.h" | 40 | #include "iostat.h" |
| @@ -194,9 +195,13 @@ typedef struct { | |||
| 194 | static | 195 | static |
| 195 | struct nfs_cache_array *nfs_readdir_get_array(struct page *page) | 196 | struct nfs_cache_array *nfs_readdir_get_array(struct page *page) |
| 196 | { | 197 | { |
| 198 | void *ptr; | ||
| 197 | if (page == NULL) | 199 | if (page == NULL) |
| 198 | return ERR_PTR(-EIO); | 200 | return ERR_PTR(-EIO); |
| 199 | return (struct nfs_cache_array *)kmap(page); | 201 | ptr = kmap(page); |
| 202 | if (ptr == NULL) | ||
| 203 | return ERR_PTR(-ENOMEM); | ||
| 204 | return ptr; | ||
| 200 | } | 205 | } |
| 201 | 206 | ||
| 202 | static | 207 | static |
| @@ -213,6 +218,9 @@ int nfs_readdir_clear_array(struct page *page, gfp_t mask) | |||
| 213 | { | 218 | { |
| 214 | struct nfs_cache_array *array = nfs_readdir_get_array(page); | 219 | struct nfs_cache_array *array = nfs_readdir_get_array(page); |
| 215 | int i; | 220 | int i; |
| 221 | |||
| 222 | if (IS_ERR(array)) | ||
| 223 | return PTR_ERR(array); | ||
| 216 | for (i = 0; i < array->size; i++) | 224 | for (i = 0; i < array->size; i++) |
| 217 | kfree(array->array[i].string.name); | 225 | kfree(array->array[i].string.name); |
| 218 | nfs_readdir_release_array(page); | 226 | nfs_readdir_release_array(page); |
| @@ -231,6 +239,11 @@ int nfs_readdir_make_qstr(struct qstr *string, const char *name, unsigned int le | |||
| 231 | string->name = kmemdup(name, len, GFP_KERNEL); | 239 | string->name = kmemdup(name, len, GFP_KERNEL); |
| 232 | if (string->name == NULL) | 240 | if (string->name == NULL) |
| 233 | return -ENOMEM; | 241 | return -ENOMEM; |
| 242 | /* | ||
| 243 | * Avoid a kmemleak false positive. The pointer to the name is stored | ||
| 244 | * in a page cache page which kmemleak does not scan. | ||
| 245 | */ | ||
| 246 | kmemleak_not_leak(string->name); | ||
| 234 | string->hash = full_name_hash(name, len); | 247 | string->hash = full_name_hash(name, len); |
| 235 | return 0; | 248 | return 0; |
| 236 | } | 249 | } |
| @@ -244,7 +257,7 @@ int nfs_readdir_add_to_array(struct nfs_entry *entry, struct page *page) | |||
| 244 | 257 | ||
| 245 | if (IS_ERR(array)) | 258 | if (IS_ERR(array)) |
| 246 | return PTR_ERR(array); | 259 | return PTR_ERR(array); |
| 247 | ret = -EIO; | 260 | ret = -ENOSPC; |
| 248 | if (array->size >= MAX_READDIR_ARRAY) | 261 | if (array->size >= MAX_READDIR_ARRAY) |
| 249 | goto out; | 262 | goto out; |
| 250 | 263 | ||
| @@ -255,9 +268,9 @@ int nfs_readdir_add_to_array(struct nfs_entry *entry, struct page *page) | |||
| 255 | if (ret) | 268 | if (ret) |
| 256 | goto out; | 269 | goto out; |
| 257 | array->last_cookie = entry->cookie; | 270 | array->last_cookie = entry->cookie; |
| 271 | array->size++; | ||
| 258 | if (entry->eof == 1) | 272 | if (entry->eof == 1) |
| 259 | array->eof_index = array->size; | 273 | array->eof_index = array->size; |
| 260 | array->size++; | ||
| 261 | out: | 274 | out: |
| 262 | nfs_readdir_release_array(page); | 275 | nfs_readdir_release_array(page); |
| 263 | return ret; | 276 | return ret; |
| @@ -272,7 +285,7 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri | |||
| 272 | if (diff < 0) | 285 | if (diff < 0) |
| 273 | goto out_eof; | 286 | goto out_eof; |
| 274 | if (diff >= array->size) { | 287 | if (diff >= array->size) { |
| 275 | if (array->eof_index > 0) | 288 | if (array->eof_index >= 0) |
| 276 | goto out_eof; | 289 | goto out_eof; |
| 277 | desc->current_index += array->size; | 290 | desc->current_index += array->size; |
| 278 | return -EAGAIN; | 291 | return -EAGAIN; |
| @@ -281,8 +294,6 @@ int nfs_readdir_search_for_pos(struct nfs_cache_array *array, nfs_readdir_descri | |||
| 281 | index = (unsigned int)diff; | 294 | index = (unsigned int)diff; |
| 282 | *desc->dir_cookie = array->array[index].cookie; | 295 | *desc->dir_cookie = array->array[index].cookie; |
| 283 | desc->cache_entry_index = index; | 296 | desc->cache_entry_index = index; |
| 284 | if (index == array->eof_index) | ||
| 285 | desc->eof = 1; | ||
| 286 | return 0; | 297 | return 0; |
| 287 | out_eof: | 298 | out_eof: |
| 288 | desc->eof = 1; | 299 | desc->eof = 1; |
| @@ -296,17 +307,17 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des | |||
| 296 | int status = -EAGAIN; | 307 | int status = -EAGAIN; |
| 297 | 308 | ||
| 298 | for (i = 0; i < array->size; i++) { | 309 | for (i = 0; i < array->size; i++) { |
| 299 | if (i == array->eof_index) { | ||
| 300 | desc->eof = 1; | ||
| 301 | status = -EBADCOOKIE; | ||
| 302 | } | ||
| 303 | if (array->array[i].cookie == *desc->dir_cookie) { | 310 | if (array->array[i].cookie == *desc->dir_cookie) { |
| 304 | desc->cache_entry_index = i; | 311 | desc->cache_entry_index = i; |
| 305 | status = 0; | 312 | status = 0; |
| 306 | break; | 313 | goto out; |
| 307 | } | 314 | } |
| 308 | } | 315 | } |
| 309 | 316 | if (i == array->eof_index) { | |
| 317 | desc->eof = 1; | ||
| 318 | status = -EBADCOOKIE; | ||
| 319 | } | ||
| 320 | out: | ||
| 310 | return status; | 321 | return status; |
| 311 | } | 322 | } |
| 312 | 323 | ||
| @@ -449,7 +460,7 @@ out: | |||
| 449 | 460 | ||
| 450 | /* Perform conversion from xdr to cache array */ | 461 | /* Perform conversion from xdr to cache array */ |
| 451 | static | 462 | static |
| 452 | void nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *entry, | 463 | int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *entry, |
| 453 | void *xdr_page, struct page *page, unsigned int buflen) | 464 | void *xdr_page, struct page *page, unsigned int buflen) |
| 454 | { | 465 | { |
| 455 | struct xdr_stream stream; | 466 | struct xdr_stream stream; |
| @@ -471,21 +482,29 @@ void nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *e | |||
| 471 | 482 | ||
| 472 | do { | 483 | do { |
| 473 | status = xdr_decode(desc, entry, &stream); | 484 | status = xdr_decode(desc, entry, &stream); |
| 474 | if (status != 0) | 485 | if (status != 0) { |
| 486 | if (status == -EAGAIN) | ||
| 487 | status = 0; | ||
| 475 | break; | 488 | break; |
| 489 | } | ||
| 476 | 490 | ||
| 477 | if (nfs_readdir_add_to_array(entry, page) == -1) | ||
| 478 | break; | ||
| 479 | if (desc->plus == 1) | 491 | if (desc->plus == 1) |
| 480 | nfs_prime_dcache(desc->file->f_path.dentry, entry); | 492 | nfs_prime_dcache(desc->file->f_path.dentry, entry); |
| 493 | |||
| 494 | status = nfs_readdir_add_to_array(entry, page); | ||
| 495 | if (status != 0) | ||
| 496 | break; | ||
| 481 | } while (!entry->eof); | 497 | } while (!entry->eof); |
| 482 | 498 | ||
| 483 | if (status == -EBADCOOKIE && entry->eof) { | 499 | if (status == -EBADCOOKIE && entry->eof) { |
| 484 | array = nfs_readdir_get_array(page); | 500 | array = nfs_readdir_get_array(page); |
| 485 | array->eof_index = array->size - 1; | 501 | if (!IS_ERR(array)) { |
| 486 | status = 0; | 502 | array->eof_index = array->size; |
| 487 | nfs_readdir_release_array(page); | 503 | status = 0; |
| 504 | nfs_readdir_release_array(page); | ||
| 505 | } | ||
| 488 | } | 506 | } |
| 507 | return status; | ||
| 489 | } | 508 | } |
| 490 | 509 | ||
| 491 | static | 510 | static |
| @@ -537,7 +556,7 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 537 | struct nfs_entry entry; | 556 | struct nfs_entry entry; |
| 538 | struct file *file = desc->file; | 557 | struct file *file = desc->file; |
| 539 | struct nfs_cache_array *array; | 558 | struct nfs_cache_array *array; |
| 540 | int status = 0; | 559 | int status = -ENOMEM; |
| 541 | unsigned int array_size = ARRAY_SIZE(pages); | 560 | unsigned int array_size = ARRAY_SIZE(pages); |
| 542 | 561 | ||
| 543 | entry.prev_cookie = 0; | 562 | entry.prev_cookie = 0; |
| @@ -549,6 +568,10 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 549 | goto out; | 568 | goto out; |
| 550 | 569 | ||
| 551 | array = nfs_readdir_get_array(page); | 570 | array = nfs_readdir_get_array(page); |
| 571 | if (IS_ERR(array)) { | ||
| 572 | status = PTR_ERR(array); | ||
| 573 | goto out; | ||
| 574 | } | ||
| 552 | memset(array, 0, sizeof(struct nfs_cache_array)); | 575 | memset(array, 0, sizeof(struct nfs_cache_array)); |
| 553 | array->eof_index = -1; | 576 | array->eof_index = -1; |
| 554 | 577 | ||
| @@ -556,12 +579,19 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 556 | if (!pages_ptr) | 579 | if (!pages_ptr) |
| 557 | goto out_release_array; | 580 | goto out_release_array; |
| 558 | do { | 581 | do { |
| 582 | unsigned int pglen; | ||
| 559 | status = nfs_readdir_xdr_filler(pages, desc, &entry, file, inode); | 583 | status = nfs_readdir_xdr_filler(pages, desc, &entry, file, inode); |
| 560 | 584 | ||
| 561 | if (status < 0) | 585 | if (status < 0) |
| 562 | break; | 586 | break; |
| 563 | nfs_readdir_page_filler(desc, &entry, pages_ptr, page, array_size * PAGE_SIZE); | 587 | pglen = status; |
| 564 | } while (array->eof_index < 0 && array->size < MAX_READDIR_ARRAY); | 588 | status = nfs_readdir_page_filler(desc, &entry, pages_ptr, page, pglen); |
| 589 | if (status < 0) { | ||
| 590 | if (status == -ENOSPC) | ||
| 591 | status = 0; | ||
| 592 | break; | ||
| 593 | } | ||
| 594 | } while (array->eof_index < 0); | ||
| 565 | 595 | ||
| 566 | nfs_readdir_free_large_page(pages_ptr, pages, array_size); | 596 | nfs_readdir_free_large_page(pages_ptr, pages, array_size); |
| 567 | out_release_array: | 597 | out_release_array: |
| @@ -582,8 +612,10 @@ static | |||
| 582 | int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) | 612 | int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) |
| 583 | { | 613 | { |
| 584 | struct inode *inode = desc->file->f_path.dentry->d_inode; | 614 | struct inode *inode = desc->file->f_path.dentry->d_inode; |
| 615 | int ret; | ||
| 585 | 616 | ||
| 586 | if (nfs_readdir_xdr_to_array(desc, page, inode) < 0) | 617 | ret = nfs_readdir_xdr_to_array(desc, page, inode); |
| 618 | if (ret < 0) | ||
| 587 | goto error; | 619 | goto error; |
| 588 | SetPageUptodate(page); | 620 | SetPageUptodate(page); |
| 589 | 621 | ||
| @@ -595,7 +627,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) | |||
| 595 | return 0; | 627 | return 0; |
| 596 | error: | 628 | error: |
| 597 | unlock_page(page); | 629 | unlock_page(page); |
| 598 | return -EIO; | 630 | return ret; |
| 599 | } | 631 | } |
| 600 | 632 | ||
| 601 | static | 633 | static |
| @@ -608,12 +640,8 @@ void cache_page_release(nfs_readdir_descriptor_t *desc) | |||
| 608 | static | 640 | static |
| 609 | struct page *get_cache_page(nfs_readdir_descriptor_t *desc) | 641 | struct page *get_cache_page(nfs_readdir_descriptor_t *desc) |
| 610 | { | 642 | { |
| 611 | struct page *page; | 643 | return read_cache_page(desc->file->f_path.dentry->d_inode->i_mapping, |
| 612 | page = read_cache_page(desc->file->f_path.dentry->d_inode->i_mapping, | ||
| 613 | desc->page_index, (filler_t *)nfs_readdir_filler, desc); | 644 | desc->page_index, (filler_t *)nfs_readdir_filler, desc); |
| 614 | if (IS_ERR(page)) | ||
| 615 | desc->eof = 1; | ||
| 616 | return page; | ||
| 617 | } | 645 | } |
| 618 | 646 | ||
| 619 | /* | 647 | /* |
| @@ -639,8 +667,10 @@ int find_cache_page(nfs_readdir_descriptor_t *desc) | |||
| 639 | static inline | 667 | static inline |
| 640 | int readdir_search_pagecache(nfs_readdir_descriptor_t *desc) | 668 | int readdir_search_pagecache(nfs_readdir_descriptor_t *desc) |
| 641 | { | 669 | { |
| 642 | int res = -EAGAIN; | 670 | int res; |
| 643 | 671 | ||
| 672 | if (desc->page_index == 0) | ||
| 673 | desc->current_index = 0; | ||
| 644 | while (1) { | 674 | while (1) { |
| 645 | res = find_cache_page(desc); | 675 | res = find_cache_page(desc); |
| 646 | if (res != -EAGAIN) | 676 | if (res != -EAGAIN) |
| @@ -670,6 +700,8 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
| 670 | struct dentry *dentry = NULL; | 700 | struct dentry *dentry = NULL; |
| 671 | 701 | ||
| 672 | array = nfs_readdir_get_array(desc->page); | 702 | array = nfs_readdir_get_array(desc->page); |
| 703 | if (IS_ERR(array)) | ||
| 704 | return PTR_ERR(array); | ||
| 673 | 705 | ||
| 674 | for (i = desc->cache_entry_index; i < array->size; i++) { | 706 | for (i = desc->cache_entry_index; i < array->size; i++) { |
| 675 | d_type = DT_UNKNOWN; | 707 | d_type = DT_UNKNOWN; |
| @@ -685,11 +717,9 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
| 685 | *desc->dir_cookie = array->array[i+1].cookie; | 717 | *desc->dir_cookie = array->array[i+1].cookie; |
| 686 | else | 718 | else |
| 687 | *desc->dir_cookie = array->last_cookie; | 719 | *desc->dir_cookie = array->last_cookie; |
| 688 | if (i == array->eof_index) { | ||
| 689 | desc->eof = 1; | ||
| 690 | break; | ||
| 691 | } | ||
| 692 | } | 720 | } |
| 721 | if (i == array->eof_index) | ||
| 722 | desc->eof = 1; | ||
| 693 | 723 | ||
| 694 | nfs_readdir_release_array(desc->page); | 724 | nfs_readdir_release_array(desc->page); |
| 695 | cache_page_release(desc); | 725 | cache_page_release(desc); |
| @@ -1345,12 +1375,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry | |||
| 1345 | res = NULL; | 1375 | res = NULL; |
| 1346 | goto out; | 1376 | goto out; |
| 1347 | /* This turned out not to be a regular file */ | 1377 | /* This turned out not to be a regular file */ |
| 1348 | case -EISDIR: | ||
| 1349 | case -ENOTDIR: | 1378 | case -ENOTDIR: |
| 1350 | goto no_open; | 1379 | goto no_open; |
| 1351 | case -ELOOP: | 1380 | case -ELOOP: |
| 1352 | if (!(nd->intent.open.flags & O_NOFOLLOW)) | 1381 | if (!(nd->intent.open.flags & O_NOFOLLOW)) |
| 1353 | goto no_open; | 1382 | goto no_open; |
| 1383 | /* case -EISDIR: */ | ||
| 1354 | /* case -EINVAL: */ | 1384 | /* case -EINVAL: */ |
| 1355 | default: | 1385 | default: |
| 1356 | res = ERR_CAST(inode); | 1386 | res = ERR_CAST(inode); |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index e6bf45710cc..2563f765c9b 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
| @@ -423,7 +423,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy) | |||
| 423 | struct page **page; | 423 | struct page **page; |
| 424 | size_t hdrlen; | 424 | size_t hdrlen; |
| 425 | unsigned int pglen, recvd; | 425 | unsigned int pglen, recvd; |
| 426 | int status, nr = 0; | 426 | int status; |
| 427 | 427 | ||
| 428 | if ((status = ntohl(*p++))) | 428 | if ((status = ntohl(*p++))) |
| 429 | return nfs_stat_to_errno(status); | 429 | return nfs_stat_to_errno(status); |
| @@ -443,7 +443,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy) | |||
| 443 | if (pglen > recvd) | 443 | if (pglen > recvd) |
| 444 | pglen = recvd; | 444 | pglen = recvd; |
| 445 | page = rcvbuf->pages; | 445 | page = rcvbuf->pages; |
| 446 | return nr; | 446 | return pglen; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) | 449 | static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) |
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index d9a5e832c25..748dc91a4a1 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
| @@ -555,7 +555,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res | |||
| 555 | struct page **page; | 555 | struct page **page; |
| 556 | size_t hdrlen; | 556 | size_t hdrlen; |
| 557 | u32 recvd, pglen; | 557 | u32 recvd, pglen; |
| 558 | int status, nr = 0; | 558 | int status; |
| 559 | 559 | ||
| 560 | status = ntohl(*p++); | 560 | status = ntohl(*p++); |
| 561 | /* Decode post_op_attrs */ | 561 | /* Decode post_op_attrs */ |
| @@ -586,7 +586,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res | |||
| 586 | pglen = recvd; | 586 | pglen = recvd; |
| 587 | page = rcvbuf->pages; | 587 | page = rcvbuf->pages; |
| 588 | 588 | ||
| 589 | return nr; | 589 | return pglen; |
| 590 | } | 590 | } |
| 591 | 591 | ||
| 592 | __be32 * | 592 | __be32 * |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 0f24cdf2cb1..6a653ffd8e4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -2852,8 +2852,10 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, | |||
| 2852 | nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); | 2852 | nfs4_setup_readdir(cookie, NFS_COOKIEVERF(dir), dentry, &args); |
| 2853 | res.pgbase = args.pgbase; | 2853 | res.pgbase = args.pgbase; |
| 2854 | status = nfs4_call_sync(NFS_SERVER(dir), &msg, &args, &res, 0); | 2854 | status = nfs4_call_sync(NFS_SERVER(dir), &msg, &args, &res, 0); |
| 2855 | if (status == 0) | 2855 | if (status >= 0) { |
| 2856 | memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); | 2856 | memcpy(NFS_COOKIEVERF(dir), res.verifier.data, NFS4_VERIFIER_SIZE); |
| 2857 | status += args.pgbase; | ||
| 2858 | } | ||
| 2857 | 2859 | ||
| 2858 | nfs_invalidate_atime(dir); | 2860 | nfs_invalidate_atime(dir); |
| 2859 | 2861 | ||
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index f313c4cce7e..b7a204ff6fe 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -4518,7 +4518,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n | |||
| 4518 | xdr_read_pages(xdr, pglen); | 4518 | xdr_read_pages(xdr, pglen); |
| 4519 | 4519 | ||
| 4520 | 4520 | ||
| 4521 | return 0; | 4521 | return pglen; |
| 4522 | } | 4522 | } |
| 4523 | 4523 | ||
| 4524 | static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req) | 4524 | static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req) |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 0a42e8f4adc..3c045044fca 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | #include <linux/nfs_mount.h> | 39 | #include <linux/nfs_mount.h> |
| 40 | #include <linux/nfs4_mount.h> | 40 | #include <linux/nfs4_mount.h> |
| 41 | #include <linux/lockd/bind.h> | 41 | #include <linux/lockd/bind.h> |
| 42 | #include <linux/smp_lock.h> | ||
| 43 | #include <linux/seq_file.h> | 42 | #include <linux/seq_file.h> |
| 44 | #include <linux/mount.h> | 43 | #include <linux/mount.h> |
| 45 | #include <linux/mnt_namespace.h> | 44 | #include <linux/mnt_namespace.h> |
| @@ -67,6 +66,12 @@ | |||
| 67 | 66 | ||
| 68 | #define NFSDBG_FACILITY NFSDBG_VFS | 67 | #define NFSDBG_FACILITY NFSDBG_VFS |
| 69 | 68 | ||
| 69 | #ifdef CONFIG_NFS_V3 | ||
| 70 | #define NFS_DEFAULT_VERSION 3 | ||
| 71 | #else | ||
| 72 | #define NFS_DEFAULT_VERSION 2 | ||
| 73 | #endif | ||
| 74 | |||
| 70 | enum { | 75 | enum { |
| 71 | /* Mount options that take no arguments */ | 76 | /* Mount options that take no arguments */ |
| 72 | Opt_soft, Opt_hard, | 77 | Opt_soft, Opt_hard, |
| @@ -2277,7 +2282,7 @@ static int nfs_get_sb(struct file_system_type *fs_type, | |||
| 2277 | }; | 2282 | }; |
| 2278 | int error = -ENOMEM; | 2283 | int error = -ENOMEM; |
| 2279 | 2284 | ||
| 2280 | data = nfs_alloc_parsed_mount_data(3); | 2285 | data = nfs_alloc_parsed_mount_data(NFS_DEFAULT_VERSION); |
| 2281 | mntfh = nfs_alloc_fhandle(); | 2286 | mntfh = nfs_alloc_fhandle(); |
| 2282 | if (data == NULL || mntfh == NULL) | 2287 | if (data == NULL || mntfh == NULL) |
| 2283 | goto out_free_fh; | 2288 | goto out_free_fh; |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index ad2bfa68d53..116cab970e0 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
| @@ -2262,7 +2262,7 @@ nfs4_file_downgrade(struct nfs4_file *fp, unsigned int share_access) | |||
| 2262 | * Spawn a thread to perform a recall on the delegation represented | 2262 | * Spawn a thread to perform a recall on the delegation represented |
| 2263 | * by the lease (file_lock) | 2263 | * by the lease (file_lock) |
| 2264 | * | 2264 | * |
| 2265 | * Called from break_lease() with lock_kernel() held. | 2265 | * Called from break_lease() with lock_flocks() held. |
| 2266 | * Note: we assume break_lease will only call this *once* for any given | 2266 | * Note: we assume break_lease will only call this *once* for any given |
| 2267 | * lease. | 2267 | * lease. |
| 2268 | */ | 2268 | */ |
| @@ -2286,7 +2286,7 @@ void nfsd_break_deleg_cb(struct file_lock *fl) | |||
| 2286 | list_add_tail(&dp->dl_recall_lru, &del_recall_lru); | 2286 | list_add_tail(&dp->dl_recall_lru, &del_recall_lru); |
| 2287 | spin_unlock(&recall_lock); | 2287 | spin_unlock(&recall_lock); |
| 2288 | 2288 | ||
| 2289 | /* only place dl_time is set. protected by lock_kernel*/ | 2289 | /* only place dl_time is set. protected by lock_flocks*/ |
| 2290 | dp->dl_time = get_seconds(); | 2290 | dp->dl_time = get_seconds(); |
| 2291 | 2291 | ||
| 2292 | /* | 2292 | /* |
| @@ -2303,7 +2303,7 @@ void nfsd_break_deleg_cb(struct file_lock *fl) | |||
| 2303 | /* | 2303 | /* |
| 2304 | * The file_lock is being reapd. | 2304 | * The file_lock is being reapd. |
| 2305 | * | 2305 | * |
| 2306 | * Called by locks_free_lock() with lock_kernel() held. | 2306 | * Called by locks_free_lock() with lock_flocks() held. |
| 2307 | */ | 2307 | */ |
| 2308 | static | 2308 | static |
| 2309 | void nfsd_release_deleg_cb(struct file_lock *fl) | 2309 | void nfsd_release_deleg_cb(struct file_lock *fl) |
| @@ -2318,7 +2318,7 @@ void nfsd_release_deleg_cb(struct file_lock *fl) | |||
| 2318 | } | 2318 | } |
| 2319 | 2319 | ||
| 2320 | /* | 2320 | /* |
| 2321 | * Called from setlease() with lock_kernel() held | 2321 | * Called from setlease() with lock_flocks() held |
| 2322 | */ | 2322 | */ |
| 2323 | static | 2323 | static |
| 2324 | int nfsd_same_client_deleg_cb(struct file_lock *onlist, struct file_lock *try) | 2324 | int nfsd_same_client_deleg_cb(struct file_lock *onlist, struct file_lock *try) |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index d8408217e3b..1efea361558 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
| @@ -159,7 +159,9 @@ struct ocfs2_lock_res { | |||
| 159 | char l_name[OCFS2_LOCK_ID_MAX_LEN]; | 159 | char l_name[OCFS2_LOCK_ID_MAX_LEN]; |
| 160 | unsigned int l_ro_holders; | 160 | unsigned int l_ro_holders; |
| 161 | unsigned int l_ex_holders; | 161 | unsigned int l_ex_holders; |
| 162 | unsigned char l_level; | 162 | char l_level; |
| 163 | char l_requested; | ||
| 164 | char l_blocking; | ||
| 163 | 165 | ||
| 164 | /* Data packed - type enum ocfs2_lock_type */ | 166 | /* Data packed - type enum ocfs2_lock_type */ |
| 165 | unsigned char l_type; | 167 | unsigned char l_type; |
| @@ -169,8 +171,6 @@ struct ocfs2_lock_res { | |||
| 169 | unsigned char l_action; | 171 | unsigned char l_action; |
| 170 | /* Data packed - enum type ocfs2_unlock_action */ | 172 | /* Data packed - enum type ocfs2_unlock_action */ |
| 171 | unsigned char l_unlock_action; | 173 | unsigned char l_unlock_action; |
| 172 | unsigned char l_requested; | ||
| 173 | unsigned char l_blocking; | ||
| 174 | unsigned int l_pending_gen; | 174 | unsigned int l_pending_gen; |
| 175 | 175 | ||
| 176 | spinlock_t l_lock; | 176 | spinlock_t l_lock; |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index f02c0ef3157..cfeab7ce369 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -41,7 +41,6 @@ | |||
| 41 | #include <linux/mount.h> | 41 | #include <linux/mount.h> |
| 42 | #include <linux/seq_file.h> | 42 | #include <linux/seq_file.h> |
| 43 | #include <linux/quotaops.h> | 43 | #include <linux/quotaops.h> |
| 44 | #include <linux/smp_lock.h> | ||
| 45 | 44 | ||
| 46 | #define MLOG_MASK_PREFIX ML_SUPER | 45 | #define MLOG_MASK_PREFIX ML_SUPER |
| 47 | #include <cluster/masklog.h> | 46 | #include <cluster/masklog.h> |
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 9c2b5f48487..3ddb6068177 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/limits.h> | 16 | #include <linux/limits.h> |
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/sysctl.h> | 19 | #include <linux/sysctl.h> |
| 21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
| 22 | 21 | ||
diff --git a/fs/read_write.c b/fs/read_write.c index 431a0ed610c..5d431bacbea 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/fcntl.h> | 9 | #include <linux/fcntl.h> |
| 10 | #include <linux/file.h> | 10 | #include <linux/file.h> |
| 11 | #include <linux/uio.h> | 11 | #include <linux/uio.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/fsnotify.h> | 12 | #include <linux/fsnotify.h> |
| 14 | #include <linux/security.h> | 13 | #include <linux/security.h> |
| 15 | #include <linux/module.h> | 14 | #include <linux/module.h> |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 41656d40dc5..0bae036831e 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include <linux/reiserfs_acl.h> | 8 | #include <linux/reiserfs_acl.h> |
| 9 | #include <linux/reiserfs_xattr.h> | 9 | #include <linux/reiserfs_xattr.h> |
| 10 | #include <linux/exportfs.h> | 10 | #include <linux/exportfs.h> |
| 11 | #include <linux/smp_lock.h> | ||
| 12 | #include <linux/pagemap.h> | 11 | #include <linux/pagemap.h> |
| 13 | #include <linux/highmem.h> | 12 | #include <linux/highmem.h> |
| 14 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index adf22b485ce..bd9763e76ba 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/time.h> | 9 | #include <linux/time.h> |
| 10 | #include <asm/uaccess.h> | 10 | #include <asm/uaccess.h> |
| 11 | #include <linux/pagemap.h> | 11 | #include <linux/pagemap.h> |
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/compat.h> | 12 | #include <linux/compat.h> |
| 14 | 13 | ||
| 15 | /* | 14 | /* |
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 076c8b19468..d31bce1a9f9 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
| @@ -43,7 +43,6 @@ | |||
| 43 | #include <linux/fcntl.h> | 43 | #include <linux/fcntl.h> |
| 44 | #include <linux/stat.h> | 44 | #include <linux/stat.h> |
| 45 | #include <linux/string.h> | 45 | #include <linux/string.h> |
| 46 | #include <linux/smp_lock.h> | ||
| 47 | #include <linux/buffer_head.h> | 46 | #include <linux/buffer_head.h> |
| 48 | #include <linux/workqueue.h> | 47 | #include <linux/workqueue.h> |
| 49 | #include <linux/writeback.h> | 48 | #include <linux/writeback.h> |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 3bf7a6457f4..b243117b875 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/mount.h> | 28 | #include <linux/mount.h> |
| 29 | #include <linux/namei.h> | 29 | #include <linux/namei.h> |
| 30 | #include <linux/crc32.h> | 30 | #include <linux/crc32.h> |
| 31 | #include <linux/smp_lock.h> | ||
| 32 | 31 | ||
| 33 | struct file_system_type reiserfs_fs_type; | 32 | struct file_system_type reiserfs_fs_type; |
| 34 | 33 | ||
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index 01a71411950..bc5590b1a1a 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h | |||
| @@ -80,6 +80,7 @@ struct drm_nouveau_gpuobj_free { | |||
| 80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | 80 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 |
| 81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 | 81 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 |
| 82 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 | 82 | #define NOUVEAU_GETPARAM_PTIMER_TIME 14 |
| 83 | #define NOUVEAU_GETPARAM_HAS_BO_USAGE 15 | ||
| 83 | struct drm_nouveau_getparam { | 84 | struct drm_nouveau_getparam { |
| 84 | uint64_t param; | 85 | uint64_t param; |
| 85 | uint64_t value; | 86 | uint64_t value; |
| @@ -95,6 +96,12 @@ struct drm_nouveau_setparam { | |||
| 95 | #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) | 96 | #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) |
| 96 | #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) | 97 | #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) |
| 97 | 98 | ||
| 99 | #define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00 | ||
| 100 | #define NOUVEAU_GEM_TILE_16BPP 0x00000001 | ||
| 101 | #define NOUVEAU_GEM_TILE_32BPP 0x00000002 | ||
| 102 | #define NOUVEAU_GEM_TILE_ZETA 0x00000004 | ||
| 103 | #define NOUVEAU_GEM_TILE_NONCONTIG 0x00000008 | ||
| 104 | |||
| 98 | struct drm_nouveau_gem_info { | 105 | struct drm_nouveau_gem_info { |
| 99 | uint32_t handle; | 106 | uint32_t handle; |
| 100 | uint32_t domain; | 107 | uint32_t domain; |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index fc295d7ea46..781d4671415 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
| @@ -54,7 +54,6 @@ struct aoi_display_offset { | |||
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) |
| 57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
| 58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | 57 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) |
| 59 | 58 | ||
| 60 | #define MFB_SET_ALPHA 0x80014d00 | 59 | #define MFB_SET_ALPHA 0x80014d00 |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 41cb31f14ee..32f9fd6619b 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -2,9 +2,6 @@ | |||
| 2 | #define LINUX_HARDIRQ_H | 2 | #define LINUX_HARDIRQ_H |
| 3 | 3 | ||
| 4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
| 5 | #ifdef CONFIG_PREEMPT | ||
| 6 | #include <linux/smp_lock.h> | ||
| 7 | #endif | ||
| 8 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
| 9 | #include <linux/ftrace_irq.h> | 6 | #include <linux/ftrace_irq.h> |
| 10 | #include <asm/hardirq.h> | 7 | #include <asm/hardirq.h> |
| @@ -97,7 +94,8 @@ | |||
| 97 | #define in_nmi() (preempt_count() & NMI_MASK) | 94 | #define in_nmi() (preempt_count() & NMI_MASK) |
| 98 | 95 | ||
| 99 | #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) | 96 | #if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL) |
| 100 | # define PREEMPT_INATOMIC_BASE kernel_locked() | 97 | # include <linux/sched.h> |
| 98 | # define PREEMPT_INATOMIC_BASE (current->lock_depth >= 0) | ||
| 101 | #else | 99 | #else |
| 102 | # define PREEMPT_INATOMIC_BASE 0 | 100 | # define PREEMPT_INATOMIC_BASE 0 |
| 103 | #endif | 101 | #endif |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index e844a0b1869..4bef5c55716 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
| @@ -32,28 +32,6 @@ | |||
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | /* --- Bit algorithm adapters */ | 34 | /* --- Bit algorithm adapters */ |
| 35 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | ||
| 36 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | ||
| 37 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ | ||
| 38 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ | 35 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ |
| 39 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | ||
| 40 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | ||
| 41 | #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | ||
| 42 | #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ | ||
| 43 | #define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */ | ||
| 44 | #define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ | ||
| 45 | |||
| 46 | /* --- SGI adapters */ | ||
| 47 | #define I2C_HW_SGI_VINO 0x160000 | ||
| 48 | |||
| 49 | /* --- SMBus only adapters */ | ||
| 50 | #define I2C_HW_SMBUS_W9968CF 0x04000d | ||
| 51 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | ||
| 52 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | ||
| 53 | #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | ||
| 54 | |||
| 55 | /* --- Miscellaneous adapters */ | ||
| 56 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | ||
| 57 | #define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */ | ||
| 58 | 36 | ||
| 59 | #endif /* LINUX_I2C_ID_H */ | 37 | #endif /* LINUX_I2C_ID_H */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 889b35abaed..56cfe23ffb3 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -353,7 +353,7 @@ struct i2c_algorithm { | |||
| 353 | */ | 353 | */ |
| 354 | struct i2c_adapter { | 354 | struct i2c_adapter { |
| 355 | struct module *owner; | 355 | struct module *owner; |
| 356 | unsigned int id; | 356 | unsigned int id __deprecated; |
| 357 | unsigned int class; /* classes to allow probing for */ | 357 | unsigned int class; /* classes to allow probing for */ |
| 358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ | 358 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
| 359 | void *algo_data; | 359 | void *algo_data; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index fc3da9e4da1..b6de9a6f701 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -17,13 +17,11 @@ | |||
| 17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
| 18 | #include <linux/log2.h> | 18 | #include <linux/log2.h> |
| 19 | #include <linux/typecheck.h> | 19 | #include <linux/typecheck.h> |
| 20 | #include <linux/printk.h> | ||
| 20 | #include <linux/dynamic_debug.h> | 21 | #include <linux/dynamic_debug.h> |
| 21 | #include <asm/byteorder.h> | 22 | #include <asm/byteorder.h> |
| 22 | #include <asm/bug.h> | 23 | #include <asm/bug.h> |
| 23 | 24 | ||
| 24 | extern const char linux_banner[]; | ||
| 25 | extern const char linux_proc_banner[]; | ||
| 26 | |||
| 27 | #define USHRT_MAX ((u16)(~0U)) | 25 | #define USHRT_MAX ((u16)(~0U)) |
| 28 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) | 26 | #define SHRT_MAX ((s16)(USHRT_MAX>>1)) |
| 29 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) | 27 | #define SHRT_MIN ((s16)(-SHRT_MAX - 1)) |
| @@ -110,31 +108,6 @@ extern const char linux_proc_banner[]; | |||
| 110 | */ | 108 | */ |
| 111 | #define lower_32_bits(n) ((u32)(n)) | 109 | #define lower_32_bits(n) ((u32)(n)) |
| 112 | 110 | ||
| 113 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
| 114 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
| 115 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
| 116 | #define KERN_ERR "<3>" /* error conditions */ | ||
| 117 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
| 118 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
| 119 | #define KERN_INFO "<6>" /* informational */ | ||
| 120 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
| 121 | |||
| 122 | /* Use the default kernel loglevel */ | ||
| 123 | #define KERN_DEFAULT "<d>" | ||
| 124 | /* | ||
| 125 | * Annotation for a "continued" line of log printout (only done after a | ||
| 126 | * line that had no enclosing \n). Only to be used by core/arch code | ||
| 127 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
| 128 | */ | ||
| 129 | #define KERN_CONT "<c>" | ||
| 130 | |||
| 131 | extern int console_printk[]; | ||
| 132 | |||
| 133 | #define console_loglevel (console_printk[0]) | ||
| 134 | #define default_message_loglevel (console_printk[1]) | ||
| 135 | #define minimum_console_loglevel (console_printk[2]) | ||
| 136 | #define default_console_loglevel (console_printk[3]) | ||
| 137 | |||
| 138 | struct completion; | 111 | struct completion; |
| 139 | struct pt_regs; | 112 | struct pt_regs; |
| 140 | struct user; | 113 | struct user; |
| @@ -187,11 +160,6 @@ static inline void might_fault(void) | |||
| 187 | } | 160 | } |
| 188 | #endif | 161 | #endif |
| 189 | 162 | ||
| 190 | struct va_format { | ||
| 191 | const char *fmt; | ||
| 192 | va_list *va; | ||
| 193 | }; | ||
| 194 | |||
| 195 | extern struct atomic_notifier_head panic_notifier_list; | 163 | extern struct atomic_notifier_head panic_notifier_list; |
| 196 | extern long (*panic_blink)(int state); | 164 | extern long (*panic_blink)(int state); |
| 197 | NORET_TYPE void panic(const char * fmt, ...) | 165 | NORET_TYPE void panic(const char * fmt, ...) |
| @@ -245,115 +213,8 @@ extern int func_ptr_is_kernel_text(void *ptr); | |||
| 245 | struct pid; | 213 | struct pid; |
| 246 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 214 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
| 247 | 215 | ||
| 248 | /* | ||
| 249 | * FW_BUG | ||
| 250 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
| 251 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
| 252 | * should be able to fix this issue or at least get a concrete idea of the | ||
| 253 | * problem by reading your message without the need of looking at the kernel | ||
| 254 | * code. | ||
| 255 | * | ||
| 256 | * Use it for definite and high priority BIOS bugs. | ||
| 257 | * | ||
| 258 | * FW_WARN | ||
| 259 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
| 260 | * and medium priority BIOS bugs. | ||
| 261 | * | ||
| 262 | * FW_INFO | ||
| 263 | * Use this one if you want to tell the user or vendor about something | ||
| 264 | * suspicious, but generally harmless related to the firmware. | ||
| 265 | * | ||
| 266 | * Use it for information or very low priority BIOS bugs. | ||
| 267 | */ | ||
| 268 | #define FW_BUG "[Firmware Bug]: " | ||
| 269 | #define FW_WARN "[Firmware Warn]: " | ||
| 270 | #define FW_INFO "[Firmware Info]: " | ||
| 271 | |||
| 272 | /* | ||
| 273 | * HW_ERR | ||
| 274 | * Add this to a message for hardware errors, so that user can report | ||
| 275 | * it to hardware vendor instead of LKML or software vendor. | ||
| 276 | */ | ||
| 277 | #define HW_ERR "[Hardware Error]: " | ||
| 278 | |||
| 279 | #ifdef CONFIG_PRINTK | ||
| 280 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
| 281 | __attribute__ ((format (printf, 1, 0))); | ||
| 282 | asmlinkage int printk(const char * fmt, ...) | ||
| 283 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
| 284 | |||
| 285 | /* | ||
| 286 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
| 287 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
| 288 | * printk_ratelimited() or plain old __ratelimit(). | ||
| 289 | */ | ||
| 290 | extern int __printk_ratelimit(const char *func); | ||
| 291 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
| 292 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
| 293 | unsigned int interval_msec); | ||
| 294 | |||
| 295 | extern int printk_delay_msec; | ||
| 296 | extern int dmesg_restrict; | ||
| 297 | |||
| 298 | /* | ||
| 299 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
| 300 | */ | ||
| 301 | #define printk_once(x...) ({ \ | ||
| 302 | static bool __print_once; \ | ||
| 303 | \ | ||
| 304 | if (!__print_once) { \ | ||
| 305 | __print_once = true; \ | ||
| 306 | printk(x); \ | ||
| 307 | } \ | ||
| 308 | }) | ||
| 309 | |||
| 310 | void log_buf_kexec_setup(void); | ||
| 311 | #else | ||
| 312 | static inline int vprintk(const char *s, va_list args) | ||
| 313 | __attribute__ ((format (printf, 1, 0))); | ||
| 314 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
| 315 | static inline int printk(const char *s, ...) | ||
| 316 | __attribute__ ((format (printf, 1, 2))); | ||
| 317 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
| 318 | static inline int printk_ratelimit(void) { return 0; } | ||
| 319 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
| 320 | unsigned int interval_msec) \ | ||
| 321 | { return false; } | ||
| 322 | |||
| 323 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 324 | #define printk_once(x...) printk(x) | ||
| 325 | |||
| 326 | static inline void log_buf_kexec_setup(void) | ||
| 327 | { | ||
| 328 | } | ||
| 329 | #endif | ||
| 330 | |||
| 331 | /* | ||
| 332 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
| 333 | * gcc's format and side-effect checking. | ||
| 334 | */ | ||
| 335 | static inline __attribute__ ((format (printf, 1, 2))) | ||
| 336 | int no_printk(const char *s, ...) { return 0; } | ||
| 337 | |||
| 338 | extern int printk_needs_cpu(int cpu); | ||
| 339 | extern void printk_tick(void); | ||
| 340 | |||
| 341 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
| 342 | early_printk(const char *fmt, ...); | ||
| 343 | |||
| 344 | unsigned long int_sqrt(unsigned long); | 216 | unsigned long int_sqrt(unsigned long); |
| 345 | 217 | ||
| 346 | static inline void console_silent(void) | ||
| 347 | { | ||
| 348 | console_loglevel = 0; | ||
| 349 | } | ||
| 350 | |||
| 351 | static inline void console_verbose(void) | ||
| 352 | { | ||
| 353 | if (console_loglevel) | ||
| 354 | console_loglevel = 15; | ||
| 355 | } | ||
| 356 | |||
| 357 | extern void bust_spinlocks(int yes); | 218 | extern void bust_spinlocks(int yes); |
| 358 | extern void wake_up_klogd(void); | 219 | extern void wake_up_klogd(void); |
| 359 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 220 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
| @@ -390,22 +251,6 @@ extern enum system_states { | |||
| 390 | #define TAINT_CRAP 10 | 251 | #define TAINT_CRAP 10 |
| 391 | #define TAINT_FIRMWARE_WORKAROUND 11 | 252 | #define TAINT_FIRMWARE_WORKAROUND 11 |
| 392 | 253 | ||
| 393 | extern void dump_stack(void) __cold; | ||
| 394 | |||
| 395 | enum { | ||
| 396 | DUMP_PREFIX_NONE, | ||
| 397 | DUMP_PREFIX_ADDRESS, | ||
| 398 | DUMP_PREFIX_OFFSET | ||
| 399 | }; | ||
| 400 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
| 401 | int rowsize, int groupsize, | ||
| 402 | char *linebuf, size_t linebuflen, bool ascii); | ||
| 403 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
| 404 | int prefix_type, int rowsize, int groupsize, | ||
| 405 | const void *buf, size_t len, bool ascii); | ||
| 406 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
| 407 | const void *buf, size_t len); | ||
| 408 | |||
| 409 | extern const char hex_asc[]; | 254 | extern const char hex_asc[]; |
| 410 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 255 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
| 411 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 256 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
| @@ -419,94 +264,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 419 | 264 | ||
| 420 | extern int hex_to_bin(char ch); | 265 | extern int hex_to_bin(char ch); |
| 421 | 266 | ||
| 422 | #ifndef pr_fmt | ||
| 423 | #define pr_fmt(fmt) fmt | ||
| 424 | #endif | ||
| 425 | |||
| 426 | #define pr_emerg(fmt, ...) \ | ||
| 427 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 428 | #define pr_alert(fmt, ...) \ | ||
| 429 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 430 | #define pr_crit(fmt, ...) \ | ||
| 431 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 432 | #define pr_err(fmt, ...) \ | ||
| 433 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 434 | #define pr_warning(fmt, ...) \ | ||
| 435 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 436 | #define pr_warn pr_warning | ||
| 437 | #define pr_notice(fmt, ...) \ | ||
| 438 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 439 | #define pr_info(fmt, ...) \ | ||
| 440 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 441 | #define pr_cont(fmt, ...) \ | ||
| 442 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
| 443 | |||
| 444 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
| 445 | #ifdef DEBUG | ||
| 446 | #define pr_devel(fmt, ...) \ | ||
| 447 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 448 | #else | ||
| 449 | #define pr_devel(fmt, ...) \ | ||
| 450 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 451 | #endif | ||
| 452 | |||
| 453 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 454 | #if defined(DEBUG) | ||
| 455 | #define pr_debug(fmt, ...) \ | ||
| 456 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 457 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
| 458 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
| 459 | #define pr_debug(fmt, ...) \ | ||
| 460 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
| 461 | #else | ||
| 462 | #define pr_debug(fmt, ...) \ | ||
| 463 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 464 | #endif | ||
| 465 | |||
| 466 | /* | ||
| 467 | * ratelimited messages with local ratelimit_state, | ||
| 468 | * no local ratelimit_state used in the !PRINTK case | ||
| 469 | */ | ||
| 470 | #ifdef CONFIG_PRINTK | ||
| 471 | #define printk_ratelimited(fmt, ...) ({ \ | ||
| 472 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
| 473 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 474 | DEFAULT_RATELIMIT_BURST); \ | ||
| 475 | \ | ||
| 476 | if (__ratelimit(&_rs)) \ | ||
| 477 | printk(fmt, ##__VA_ARGS__); \ | ||
| 478 | }) | ||
| 479 | #else | ||
| 480 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 481 | #define printk_ratelimited printk | ||
| 482 | #endif | ||
| 483 | |||
| 484 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
| 485 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 486 | #define pr_alert_ratelimited(fmt, ...) \ | ||
| 487 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 488 | #define pr_crit_ratelimited(fmt, ...) \ | ||
| 489 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 490 | #define pr_err_ratelimited(fmt, ...) \ | ||
| 491 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 492 | #define pr_warning_ratelimited(fmt, ...) \ | ||
| 493 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 494 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
| 495 | #define pr_notice_ratelimited(fmt, ...) \ | ||
| 496 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 497 | #define pr_info_ratelimited(fmt, ...) \ | ||
| 498 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 499 | /* no pr_cont_ratelimited, don't do that... */ | ||
| 500 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 501 | #if defined(DEBUG) | ||
| 502 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 503 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 504 | #else | ||
| 505 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 506 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
| 507 | ##__VA_ARGS__); 0; }) | ||
| 508 | #endif | ||
| 509 | |||
| 510 | /* | 267 | /* |
| 511 | * General tracing related utility functions - trace_printk(), | 268 | * General tracing related utility functions - trace_printk(), |
| 512 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 269 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 15b77b8dc7e..d947b123166 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -986,7 +986,7 @@ extern void ata_host_init(struct ata_host *, struct device *, | |||
| 986 | unsigned long, struct ata_port_operations *); | 986 | unsigned long, struct ata_port_operations *); |
| 987 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 987 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
| 988 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 988 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
| 989 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 989 | extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 990 | extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, | 990 | extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, |
| 991 | int cmd, void __user *arg); | 991 | int cmd, void __user *arg); |
| 992 | extern void ata_sas_port_destroy(struct ata_port *); | 992 | extern void ata_sas_port_destroy(struct ata_port *); |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index a34dea46b62..2dee05e5119 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -43,6 +43,7 @@ struct nlm_host { | |||
| 43 | struct sockaddr_storage h_addr; /* peer address */ | 43 | struct sockaddr_storage h_addr; /* peer address */ |
| 44 | size_t h_addrlen; | 44 | size_t h_addrlen; |
| 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ | 45 | struct sockaddr_storage h_srcaddr; /* our address (optional) */ |
| 46 | size_t h_srcaddrlen; | ||
| 46 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ | 47 | struct rpc_clnt *h_rpcclnt; /* RPC client to talk to peer */ |
| 47 | char *h_name; /* remote hostname */ | 48 | char *h_name; /* remote hostname */ |
| 48 | u32 h_version; /* interface version */ | 49 | u32 h_version; /* interface version */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index bba26684acd..c66fdb7d699 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -593,12 +593,6 @@ nfs_fileid_to_ino_t(u64 fileid) | |||
| 593 | return ino; | 593 | return ino; |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | #define nfs_wait_event(clnt, wq, condition) \ | ||
| 597 | ({ \ | ||
| 598 | int __retval = wait_event_killable(wq, condition); \ | ||
| 599 | __retval; \ | ||
| 600 | }) | ||
| 601 | |||
| 602 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) | 596 | #define NFS_JUKEBOX_RETRY_TIME (5 * HZ) |
| 603 | 597 | ||
| 604 | #endif /* __KERNEL__ */ | 598 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/printk.h b/include/linux/printk.h new file mode 100644 index 00000000000..b772ca5fbdf --- /dev/null +++ b/include/linux/printk.h | |||
| @@ -0,0 +1,248 @@ | |||
| 1 | #ifndef __KERNEL_PRINTK__ | ||
| 2 | #define __KERNEL_PRINTK__ | ||
| 3 | |||
| 4 | extern const char linux_banner[]; | ||
| 5 | extern const char linux_proc_banner[]; | ||
| 6 | |||
| 7 | #define KERN_EMERG "<0>" /* system is unusable */ | ||
| 8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | ||
| 9 | #define KERN_CRIT "<2>" /* critical conditions */ | ||
| 10 | #define KERN_ERR "<3>" /* error conditions */ | ||
| 11 | #define KERN_WARNING "<4>" /* warning conditions */ | ||
| 12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | ||
| 13 | #define KERN_INFO "<6>" /* informational */ | ||
| 14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | ||
| 15 | |||
| 16 | /* Use the default kernel loglevel */ | ||
| 17 | #define KERN_DEFAULT "<d>" | ||
| 18 | /* | ||
| 19 | * Annotation for a "continued" line of log printout (only done after a | ||
| 20 | * line that had no enclosing \n). Only to be used by core/arch code | ||
| 21 | * during early bootup (a continued line is not SMP-safe otherwise). | ||
| 22 | */ | ||
| 23 | #define KERN_CONT "<c>" | ||
| 24 | |||
| 25 | extern int console_printk[]; | ||
| 26 | |||
| 27 | #define console_loglevel (console_printk[0]) | ||
| 28 | #define default_message_loglevel (console_printk[1]) | ||
| 29 | #define minimum_console_loglevel (console_printk[2]) | ||
| 30 | #define default_console_loglevel (console_printk[3]) | ||
| 31 | |||
| 32 | struct va_format { | ||
| 33 | const char *fmt; | ||
| 34 | va_list *va; | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* | ||
| 38 | * FW_BUG | ||
| 39 | * Add this to a message where you are sure the firmware is buggy or behaves | ||
| 40 | * really stupid or out of spec. Be aware that the responsible BIOS developer | ||
| 41 | * should be able to fix this issue or at least get a concrete idea of the | ||
| 42 | * problem by reading your message without the need of looking at the kernel | ||
| 43 | * code. | ||
| 44 | * | ||
| 45 | * Use it for definite and high priority BIOS bugs. | ||
| 46 | * | ||
| 47 | * FW_WARN | ||
| 48 | * Use it for not that clear (e.g. could the kernel messed up things already?) | ||
| 49 | * and medium priority BIOS bugs. | ||
| 50 | * | ||
| 51 | * FW_INFO | ||
| 52 | * Use this one if you want to tell the user or vendor about something | ||
| 53 | * suspicious, but generally harmless related to the firmware. | ||
| 54 | * | ||
| 55 | * Use it for information or very low priority BIOS bugs. | ||
| 56 | */ | ||
| 57 | #define FW_BUG "[Firmware Bug]: " | ||
| 58 | #define FW_WARN "[Firmware Warn]: " | ||
| 59 | #define FW_INFO "[Firmware Info]: " | ||
| 60 | |||
| 61 | /* | ||
| 62 | * HW_ERR | ||
| 63 | * Add this to a message for hardware errors, so that user can report | ||
| 64 | * it to hardware vendor instead of LKML or software vendor. | ||
| 65 | */ | ||
| 66 | #define HW_ERR "[Hardware Error]: " | ||
| 67 | |||
| 68 | #ifdef CONFIG_PRINTK | ||
| 69 | asmlinkage int vprintk(const char *fmt, va_list args) | ||
| 70 | __attribute__ ((format (printf, 1, 0))); | ||
| 71 | asmlinkage int printk(const char * fmt, ...) | ||
| 72 | __attribute__ ((format (printf, 1, 2))) __cold; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | ||
| 76 | * with all other unrelated printk_ratelimit() callsites. Instead use | ||
| 77 | * printk_ratelimited() or plain old __ratelimit(). | ||
| 78 | */ | ||
| 79 | extern int __printk_ratelimit(const char *func); | ||
| 80 | #define printk_ratelimit() __printk_ratelimit(__func__) | ||
| 81 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
| 82 | unsigned int interval_msec); | ||
| 83 | |||
| 84 | extern int printk_delay_msec; | ||
| 85 | extern int dmesg_restrict; | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
| 89 | */ | ||
| 90 | #define printk_once(x...) ({ \ | ||
| 91 | static bool __print_once; \ | ||
| 92 | \ | ||
| 93 | if (!__print_once) { \ | ||
| 94 | __print_once = true; \ | ||
| 95 | printk(x); \ | ||
| 96 | } \ | ||
| 97 | }) | ||
| 98 | |||
| 99 | void log_buf_kexec_setup(void); | ||
| 100 | #else | ||
| 101 | static inline int vprintk(const char *s, va_list args) | ||
| 102 | __attribute__ ((format (printf, 1, 0))); | ||
| 103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
| 104 | static inline int printk(const char *s, ...) | ||
| 105 | __attribute__ ((format (printf, 1, 2))); | ||
| 106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
| 107 | static inline int printk_ratelimit(void) { return 0; } | ||
| 108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
| 109 | unsigned int interval_msec) \ | ||
| 110 | { return false; } | ||
| 111 | |||
| 112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 113 | #define printk_once(x...) printk(x) | ||
| 114 | |||
| 115 | static inline void log_buf_kexec_setup(void) | ||
| 116 | { | ||
| 117 | } | ||
| 118 | #endif | ||
| 119 | |||
| 120 | /* | ||
| 121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
| 122 | * gcc's format and side-effect checking. | ||
| 123 | */ | ||
| 124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
| 125 | int no_printk(const char *s, ...) { return 0; } | ||
| 126 | |||
| 127 | extern int printk_needs_cpu(int cpu); | ||
| 128 | extern void printk_tick(void); | ||
| 129 | |||
| 130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
| 131 | early_printk(const char *fmt, ...); | ||
| 132 | |||
| 133 | static inline void console_silent(void) | ||
| 134 | { | ||
| 135 | console_loglevel = 0; | ||
| 136 | } | ||
| 137 | |||
| 138 | static inline void console_verbose(void) | ||
| 139 | { | ||
| 140 | if (console_loglevel) | ||
| 141 | console_loglevel = 15; | ||
| 142 | } | ||
| 143 | |||
| 144 | extern void dump_stack(void) __cold; | ||
| 145 | |||
| 146 | enum { | ||
| 147 | DUMP_PREFIX_NONE, | ||
| 148 | DUMP_PREFIX_ADDRESS, | ||
| 149 | DUMP_PREFIX_OFFSET | ||
| 150 | }; | ||
| 151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
| 152 | int rowsize, int groupsize, | ||
| 153 | char *linebuf, size_t linebuflen, bool ascii); | ||
| 154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
| 155 | int prefix_type, int rowsize, int groupsize, | ||
| 156 | const void *buf, size_t len, bool ascii); | ||
| 157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
| 158 | const void *buf, size_t len); | ||
| 159 | |||
| 160 | #ifndef pr_fmt | ||
| 161 | #define pr_fmt(fmt) fmt | ||
| 162 | #endif | ||
| 163 | |||
| 164 | #define pr_emerg(fmt, ...) \ | ||
| 165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 166 | #define pr_alert(fmt, ...) \ | ||
| 167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 168 | #define pr_crit(fmt, ...) \ | ||
| 169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 170 | #define pr_err(fmt, ...) \ | ||
| 171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 172 | #define pr_warning(fmt, ...) \ | ||
| 173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 174 | #define pr_warn pr_warning | ||
| 175 | #define pr_notice(fmt, ...) \ | ||
| 176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 177 | #define pr_info(fmt, ...) \ | ||
| 178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 179 | #define pr_cont(fmt, ...) \ | ||
| 180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | ||
| 181 | |||
| 182 | /* pr_devel() should produce zero code unless DEBUG is defined */ | ||
| 183 | #ifdef DEBUG | ||
| 184 | #define pr_devel(fmt, ...) \ | ||
| 185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 186 | #else | ||
| 187 | #define pr_devel(fmt, ...) \ | ||
| 188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 189 | #endif | ||
| 190 | |||
| 191 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 192 | #if defined(DEBUG) | ||
| 193 | #define pr_debug(fmt, ...) \ | ||
| 194 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 195 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
| 196 | /* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ | ||
| 197 | #define pr_debug(fmt, ...) \ | ||
| 198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ||
| 199 | #else | ||
| 200 | #define pr_debug(fmt, ...) \ | ||
| 201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | ||
| 202 | #endif | ||
| 203 | |||
| 204 | /* | ||
| 205 | * ratelimited messages with local ratelimit_state, | ||
| 206 | * no local ratelimit_state used in the !PRINTK case | ||
| 207 | */ | ||
| 208 | #ifdef CONFIG_PRINTK | ||
| 209 | #define printk_ratelimited(fmt, ...) ({ \ | ||
| 210 | static DEFINE_RATELIMIT_STATE(_rs, \ | ||
| 211 | DEFAULT_RATELIMIT_INTERVAL, \ | ||
| 212 | DEFAULT_RATELIMIT_BURST); \ | ||
| 213 | \ | ||
| 214 | if (__ratelimit(&_rs)) \ | ||
| 215 | printk(fmt, ##__VA_ARGS__); \ | ||
| 216 | }) | ||
| 217 | #else | ||
| 218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
| 219 | #define printk_ratelimited printk | ||
| 220 | #endif | ||
| 221 | |||
| 222 | #define pr_emerg_ratelimited(fmt, ...) \ | ||
| 223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 224 | #define pr_alert_ratelimited(fmt, ...) \ | ||
| 225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 226 | #define pr_crit_ratelimited(fmt, ...) \ | ||
| 227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
| 228 | #define pr_err_ratelimited(fmt, ...) \ | ||
| 229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
| 230 | #define pr_warning_ratelimited(fmt, ...) \ | ||
| 231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
| 232 | #define pr_warn_ratelimited pr_warning_ratelimited | ||
| 233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
| 234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 235 | #define pr_info_ratelimited(fmt, ...) \ | ||
| 236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 237 | /* no pr_cont_ratelimited, don't do that... */ | ||
| 238 | /* If you are writing a driver, please use dev_dbg instead */ | ||
| 239 | #if defined(DEBUG) | ||
| 240 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
| 242 | #else | ||
| 243 | #define pr_debug_ratelimited(fmt, ...) \ | ||
| 244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | ||
| 245 | ##__VA_ARGS__); 0; }) | ||
| 246 | #endif | ||
| 247 | |||
| 248 | #endif | ||
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 5ca47e59b72..c21072adbfa 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <asm/unaligned.h> | 22 | #include <asm/unaligned.h> |
| 23 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
| 24 | #include <linux/proc_fs.h> | 24 | #include <linux/proc_fs.h> |
| 25 | #include <linux/smp_lock.h> | ||
| 26 | #include <linux/buffer_head.h> | 25 | #include <linux/buffer_head.h> |
| 27 | #include <linux/reiserfs_fs_i.h> | 26 | #include <linux/reiserfs_fs_i.h> |
| 28 | #include <linux/reiserfs_fs_sb.h> | 27 | #include <linux/reiserfs_fs_sb.h> |
diff --git a/include/linux/sched.h b/include/linux/sched.h index d0036e52a24..2c79e921a68 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -862,6 +862,7 @@ struct sched_group { | |||
| 862 | * single CPU. | 862 | * single CPU. |
| 863 | */ | 863 | */ |
| 864 | unsigned int cpu_power, cpu_power_orig; | 864 | unsigned int cpu_power, cpu_power_orig; |
| 865 | unsigned int group_weight; | ||
| 865 | 866 | ||
| 866 | /* | 867 | /* |
| 867 | * The CPUs this group covers. | 868 | * The CPUs this group covers. |
diff --git a/include/linux/security.h b/include/linux/security.h index b8246a8df7d..fd4d55fb884 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -77,7 +77,6 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
| 77 | extern int cap_task_setscheduler(struct task_struct *p); | 77 | extern int cap_task_setscheduler(struct task_struct *p); |
| 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); | 78 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); |
| 79 | extern int cap_task_setnice(struct task_struct *p, int nice); | 79 | extern int cap_task_setnice(struct task_struct *p, int nice); |
| 80 | extern int cap_syslog(int type, bool from_file); | ||
| 81 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); | 80 | extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); |
| 82 | 81 | ||
| 83 | struct msghdr; | 82 | struct msghdr; |
| @@ -1388,7 +1387,7 @@ struct security_operations { | |||
| 1388 | int (*sysctl) (struct ctl_table *table, int op); | 1387 | int (*sysctl) (struct ctl_table *table, int op); |
| 1389 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1388 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
| 1390 | int (*quota_on) (struct dentry *dentry); | 1389 | int (*quota_on) (struct dentry *dentry); |
| 1391 | int (*syslog) (int type, bool from_file); | 1390 | int (*syslog) (int type); |
| 1392 | int (*settime) (struct timespec *ts, struct timezone *tz); | 1391 | int (*settime) (struct timespec *ts, struct timezone *tz); |
| 1393 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); | 1392 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); |
| 1394 | 1393 | ||
| @@ -1671,7 +1670,7 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap); | |||
| 1671 | int security_sysctl(struct ctl_table *table, int op); | 1670 | int security_sysctl(struct ctl_table *table, int op); |
| 1672 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1671 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
| 1673 | int security_quota_on(struct dentry *dentry); | 1672 | int security_quota_on(struct dentry *dentry); |
| 1674 | int security_syslog(int type, bool from_file); | 1673 | int security_syslog(int type); |
| 1675 | int security_settime(struct timespec *ts, struct timezone *tz); | 1674 | int security_settime(struct timespec *ts, struct timezone *tz); |
| 1676 | int security_vm_enough_memory(long pages); | 1675 | int security_vm_enough_memory(long pages); |
| 1677 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1676 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
| @@ -1901,9 +1900,9 @@ static inline int security_quota_on(struct dentry *dentry) | |||
| 1901 | return 0; | 1900 | return 0; |
| 1902 | } | 1901 | } |
| 1903 | 1902 | ||
| 1904 | static inline int security_syslog(int type, bool from_file) | 1903 | static inline int security_syslog(int type) |
| 1905 | { | 1904 | { |
| 1906 | return cap_syslog(type, from_file); | 1905 | return 0; |
| 1907 | } | 1906 | } |
| 1908 | 1907 | ||
| 1909 | static inline int security_settime(struct timespec *ts, struct timezone *tz) | 1908 | static inline int security_settime(struct timespec *ts, struct timezone *tz) |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index f656d1a43dc..5812fefbced 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
| @@ -79,7 +79,7 @@ struct intc_hw_desc { | |||
| 79 | unsigned int nr_subgroups; | 79 | unsigned int nr_subgroups; |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | #define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a) | 82 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a) |
| 83 | 83 | ||
| 84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ | 84 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ |
| 85 | prio_regs, sense_regs, ack_regs) \ | 85 | prio_regs, sense_regs, ack_regs) \ |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 291f721144c..3a198820273 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | #ifdef CONFIG_LOCK_KERNEL | 4 | #ifdef CONFIG_LOCK_KERNEL |
| 5 | #include <linux/sched.h> | 5 | #include <linux/sched.h> |
| 6 | 6 | ||
| 7 | #define kernel_locked() (current->lock_depth >= 0) | ||
| 8 | |||
| 9 | extern int __lockfunc __reacquire_kernel_lock(void); | 7 | extern int __lockfunc __reacquire_kernel_lock(void); |
| 10 | extern void __lockfunc __release_kernel_lock(void); | 8 | extern void __lockfunc __release_kernel_lock(void); |
| 11 | 9 | ||
| @@ -58,7 +56,6 @@ static inline void cycle_kernel_lock(void) | |||
| 58 | #define lock_kernel() | 56 | #define lock_kernel() |
| 59 | #define unlock_kernel() | 57 | #define unlock_kernel() |
| 60 | #define cycle_kernel_lock() do { } while(0) | 58 | #define cycle_kernel_lock() do { } while(0) |
| 61 | #define kernel_locked() 1 | ||
| 62 | #endif /* CONFIG_BKL */ | 59 | #endif /* CONFIG_BKL */ |
| 63 | 60 | ||
| 64 | #define release_kernel_lock(task) do { } while(0) | 61 | #define release_kernel_lock(task) do { } while(0) |
diff --git a/include/linux/tty.h b/include/linux/tty.h index c7ea9bc8897..032d79ff1d9 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/tty_driver.h> | 13 | #include <linux/tty_driver.h> |
| 14 | #include <linux/tty_ldisc.h> | 14 | #include <linux/tty_ldisc.h> |
| 15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
| 16 | #include <linux/smp_lock.h> | ||
| 17 | 16 | ||
| 18 | #include <asm/system.h> | 17 | #include <asm/system.h> |
| 19 | 18 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index f986ab7ffe6..5c4c1678f7b 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -1006,8 +1006,7 @@ void fc_fcp_destroy(struct fc_lport *); | |||
| 1006 | /* | 1006 | /* |
| 1007 | * SCSI INTERACTION LAYER | 1007 | * SCSI INTERACTION LAYER |
| 1008 | *****************************/ | 1008 | *****************************/ |
| 1009 | int fc_queuecommand(struct scsi_cmnd *, | 1009 | int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
| 1010 | void (*done)(struct scsi_cmnd *)); | ||
| 1011 | int fc_eh_abort(struct scsi_cmnd *); | 1010 | int fc_eh_abort(struct scsi_cmnd *); |
| 1012 | int fc_eh_device_reset(struct scsi_cmnd *); | 1011 | int fc_eh_device_reset(struct scsi_cmnd *); |
| 1013 | int fc_eh_host_reset(struct scsi_cmnd *); | 1012 | int fc_eh_host_reset(struct scsi_cmnd *); |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index ae5196aae1a..b81d969ddc6 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -341,8 +341,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc); | |||
| 341 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); | 341 | extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); |
| 342 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); | 342 | extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); |
| 343 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | 343 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); |
| 344 | extern int iscsi_queuecommand(struct scsi_cmnd *sc, | 344 | extern int iscsi_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *sc); |
| 345 | void (*done)(struct scsi_cmnd *)); | ||
| 346 | 345 | ||
| 347 | /* | 346 | /* |
| 348 | * iSCSI host helpers. | 347 | * iSCSI host helpers. |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 3dec1949f69..90ce527ecf3 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
| @@ -621,8 +621,7 @@ int sas_set_phy_speed(struct sas_phy *phy, | |||
| 621 | int sas_phy_enable(struct sas_phy *phy, int enabled); | 621 | int sas_phy_enable(struct sas_phy *phy, int enabled); |
| 622 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); | 622 | int sas_phy_reset(struct sas_phy *phy, int hard_reset); |
| 623 | int sas_queue_up(struct sas_task *task); | 623 | int sas_queue_up(struct sas_task *task); |
| 624 | extern int sas_queuecommand(struct scsi_cmnd *, | 624 | extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *); |
| 625 | void (*scsi_done)(struct scsi_cmnd *)); | ||
| 626 | extern int sas_target_alloc(struct scsi_target *); | 625 | extern int sas_target_alloc(struct scsi_target *); |
| 627 | extern int sas_slave_alloc(struct scsi_device *); | 626 | extern int sas_slave_alloc(struct scsi_device *); |
| 628 | extern int sas_slave_configure(struct scsi_device *); | 627 | extern int sas_slave_configure(struct scsi_device *); |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index d0a6a845f20..e7e385842a3 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
| @@ -127,8 +127,7 @@ struct scsi_host_template { | |||
| 127 | * | 127 | * |
| 128 | * STATUS: REQUIRED | 128 | * STATUS: REQUIRED |
| 129 | */ | 129 | */ |
| 130 | int (* queuecommand)(struct scsi_cmnd *, | 130 | int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *); |
| 131 | void (*done)(struct scsi_cmnd *)); | ||
| 132 | 131 | ||
| 133 | /* | 132 | /* |
| 134 | * The transfer functions are used to queue a scsi command to | 133 | * The transfer functions are used to queue a scsi command to |
| @@ -505,6 +504,25 @@ struct scsi_host_template { | |||
| 505 | }; | 504 | }; |
| 506 | 505 | ||
| 507 | /* | 506 | /* |
| 507 | * Temporary #define for host lock push down. Can be removed when all | ||
| 508 | * drivers have been updated to take advantage of unlocked | ||
| 509 | * queuecommand. | ||
| 510 | * | ||
| 511 | */ | ||
| 512 | #define DEF_SCSI_QCMD(func_name) \ | ||
| 513 | int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \ | ||
| 514 | { \ | ||
| 515 | unsigned long irq_flags; \ | ||
| 516 | int rc; \ | ||
| 517 | spin_lock_irqsave(shost->host_lock, irq_flags); \ | ||
| 518 | scsi_cmd_get_serial(shost, cmd); \ | ||
| 519 | rc = func_name##_lck (cmd, cmd->scsi_done); \ | ||
| 520 | spin_unlock_irqrestore(shost->host_lock, irq_flags); \ | ||
| 521 | return rc; \ | ||
| 522 | } | ||
| 523 | |||
| 524 | |||
| 525 | /* | ||
| 508 | * shost state: If you alter this, you also need to alter scsi_sysfs.c | 526 | * shost state: If you alter this, you also need to alter scsi_sysfs.c |
| 509 | * (for the ascii descriptions) and the state model enforcer: | 527 | * (for the ascii descriptions) and the state model enforcer: |
| 510 | * scsi_host_set_state() | 528 | * scsi_host_set_state() |
| @@ -752,6 +770,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); | |||
| 752 | extern void scsi_host_put(struct Scsi_Host *t); | 770 | extern void scsi_host_put(struct Scsi_Host *t); |
| 753 | extern struct Scsi_Host *scsi_host_lookup(unsigned short); | 771 | extern struct Scsi_Host *scsi_host_lookup(unsigned short); |
| 754 | extern const char *scsi_host_state_name(enum scsi_host_state); | 772 | extern const char *scsi_host_state_name(enum scsi_host_state); |
| 773 | extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *); | ||
| 755 | 774 | ||
| 756 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); | 775 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); |
| 757 | 776 | ||
diff --git a/init/main.c b/init/main.c index e59af24a0b7..8646401f7a0 100644 --- a/init/main.c +++ b/init/main.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| 21 | #include <linux/ioport.h> | 21 | #include <linux/ioport.h> |
| 22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 23 | #include <linux/smp_lock.h> | ||
| 24 | #include <linux/initrd.h> | 23 | #include <linux/initrd.h> |
| 25 | #include <linux/bootmem.h> | 24 | #include <linux/bootmem.h> |
| 26 | #include <linux/acpi.h> | 25 | #include <linux/acpi.h> |
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 37755d62192..a6e72976682 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c | |||
| @@ -82,7 +82,7 @@ static kdbtab_t kdb_base_commands[50]; | |||
| 82 | #define for_each_kdbcmd(cmd, num) \ | 82 | #define for_each_kdbcmd(cmd, num) \ |
| 83 | for ((cmd) = kdb_base_commands, (num) = 0; \ | 83 | for ((cmd) = kdb_base_commands, (num) = 0; \ |
| 84 | num < kdb_max_commands; \ | 84 | num < kdb_max_commands; \ |
| 85 | num == KDB_BASE_CMD_MAX ? cmd = kdb_commands : cmd++, num++) | 85 | num++, num == KDB_BASE_CMD_MAX ? cmd = kdb_commands : cmd++) |
| 86 | 86 | ||
| 87 | typedef struct _kdbmsg { | 87 | typedef struct _kdbmsg { |
| 88 | int km_diag; /* kdb diagnostic */ | 88 | int km_diag; /* kdb diagnostic */ |
| @@ -646,7 +646,7 @@ static int kdb_defcmd2(const char *cmdstr, const char *argv0) | |||
| 646 | } | 646 | } |
| 647 | if (!s->usable) | 647 | if (!s->usable) |
| 648 | return KDB_NOTIMP; | 648 | return KDB_NOTIMP; |
| 649 | s->command = kmalloc((s->count + 1) * sizeof(*(s->command)), GFP_KDB); | 649 | s->command = kzalloc((s->count + 1) * sizeof(*(s->command)), GFP_KDB); |
| 650 | if (!s->command) { | 650 | if (!s->command) { |
| 651 | kdb_printf("Could not allocate new kdb_defcmd table for %s\n", | 651 | kdb_printf("Could not allocate new kdb_defcmd table for %s\n", |
| 652 | cmdstr); | 652 | cmdstr); |
| @@ -2361,7 +2361,7 @@ static int kdb_pid(int argc, const char **argv) | |||
| 2361 | */ | 2361 | */ |
| 2362 | static int kdb_ll(int argc, const char **argv) | 2362 | static int kdb_ll(int argc, const char **argv) |
| 2363 | { | 2363 | { |
| 2364 | int diag; | 2364 | int diag = 0; |
| 2365 | unsigned long addr; | 2365 | unsigned long addr; |
| 2366 | long offset = 0; | 2366 | long offset = 0; |
| 2367 | unsigned long va; | 2367 | unsigned long va; |
| @@ -2400,20 +2400,21 @@ static int kdb_ll(int argc, const char **argv) | |||
| 2400 | char buf[80]; | 2400 | char buf[80]; |
| 2401 | 2401 | ||
| 2402 | if (KDB_FLAG(CMD_INTERRUPT)) | 2402 | if (KDB_FLAG(CMD_INTERRUPT)) |
| 2403 | return 0; | 2403 | goto out; |
| 2404 | 2404 | ||
| 2405 | sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va); | 2405 | sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va); |
| 2406 | diag = kdb_parse(buf); | 2406 | diag = kdb_parse(buf); |
| 2407 | if (diag) | 2407 | if (diag) |
| 2408 | return diag; | 2408 | goto out; |
| 2409 | 2409 | ||
| 2410 | addr = va + linkoffset; | 2410 | addr = va + linkoffset; |
| 2411 | if (kdb_getword(&va, addr, sizeof(va))) | 2411 | if (kdb_getword(&va, addr, sizeof(va))) |
| 2412 | return 0; | 2412 | goto out; |
| 2413 | } | 2413 | } |
| 2414 | kfree(command); | ||
| 2415 | 2414 | ||
| 2416 | return 0; | 2415 | out: |
| 2416 | kfree(command); | ||
| 2417 | return diag; | ||
| 2417 | } | 2418 | } |
| 2418 | 2419 | ||
| 2419 | static int kdb_kgdb(int argc, const char **argv) | 2420 | static int kdb_kgdb(int argc, const char **argv) |
| @@ -2739,13 +2740,13 @@ int kdb_register_repeat(char *cmd, | |||
| 2739 | } | 2740 | } |
| 2740 | if (kdb_commands) { | 2741 | if (kdb_commands) { |
| 2741 | memcpy(new, kdb_commands, | 2742 | memcpy(new, kdb_commands, |
| 2742 | kdb_max_commands * sizeof(*new)); | 2743 | (kdb_max_commands - KDB_BASE_CMD_MAX) * sizeof(*new)); |
| 2743 | kfree(kdb_commands); | 2744 | kfree(kdb_commands); |
| 2744 | } | 2745 | } |
| 2745 | memset(new + kdb_max_commands, 0, | 2746 | memset(new + kdb_max_commands, 0, |
| 2746 | kdb_command_extend * sizeof(*new)); | 2747 | kdb_command_extend * sizeof(*new)); |
| 2747 | kdb_commands = new; | 2748 | kdb_commands = new; |
| 2748 | kp = kdb_commands + kdb_max_commands; | 2749 | kp = kdb_commands + kdb_max_commands - KDB_BASE_CMD_MAX; |
| 2749 | kdb_max_commands += kdb_command_extend; | 2750 | kdb_max_commands += kdb_command_extend; |
| 2750 | } | 2751 | } |
| 2751 | 2752 | ||
diff --git a/kernel/futex.c b/kernel/futex.c index 6c683b37f2c..40a8777a27d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -2489,7 +2489,8 @@ void exit_robust_list(struct task_struct *curr) | |||
| 2489 | { | 2489 | { |
| 2490 | struct robust_list_head __user *head = curr->robust_list; | 2490 | struct robust_list_head __user *head = curr->robust_list; |
| 2491 | struct robust_list __user *entry, *next_entry, *pending; | 2491 | struct robust_list __user *entry, *next_entry, *pending; |
| 2492 | unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip; | 2492 | unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; |
| 2493 | unsigned int uninitialized_var(next_pi); | ||
| 2493 | unsigned long futex_offset; | 2494 | unsigned long futex_offset; |
| 2494 | int rc; | 2495 | int rc; |
| 2495 | 2496 | ||
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 06da4dfc339..a7934ac75e5 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c | |||
| @@ -49,7 +49,8 @@ void compat_exit_robust_list(struct task_struct *curr) | |||
| 49 | { | 49 | { |
| 50 | struct compat_robust_list_head __user *head = curr->compat_robust_list; | 50 | struct compat_robust_list_head __user *head = curr->compat_robust_list; |
| 51 | struct robust_list __user *entry, *next_entry, *pending; | 51 | struct robust_list __user *entry, *next_entry, *pending; |
| 52 | unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip; | 52 | unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; |
| 53 | unsigned int uninitialized_var(next_pi); | ||
| 53 | compat_uptr_t uentry, next_uentry, upending; | 54 | compat_uptr_t uentry, next_uentry, upending; |
| 54 | compat_long_t futex_offset; | 55 | compat_long_t futex_offset; |
| 55 | int rc; | 56 | int rc; |
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 6f6d091b575..a8db2570f99 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c | |||
| @@ -546,7 +546,7 @@ static const struct file_operations kallsyms_operations = { | |||
| 546 | 546 | ||
| 547 | static int __init kallsyms_init(void) | 547 | static int __init kallsyms_init(void) |
| 548 | { | 548 | { |
| 549 | proc_create("kallsyms", 0444, NULL, &kallsyms_operations); | 549 | proc_create("kallsyms", 0400, NULL, &kallsyms_operations); |
| 550 | return 0; | 550 | return 0; |
| 551 | } | 551 | } |
| 552 | device_initcall(kallsyms_init); | 552 | device_initcall(kallsyms_init); |
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index c7a8f453919..aeaa7f84682 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c | |||
| @@ -121,10 +121,10 @@ static inline int pm_qos_get_value(struct pm_qos_object *o) | |||
| 121 | 121 | ||
| 122 | switch (o->type) { | 122 | switch (o->type) { |
| 123 | case PM_QOS_MIN: | 123 | case PM_QOS_MIN: |
| 124 | return plist_last(&o->requests)->prio; | 124 | return plist_first(&o->requests)->prio; |
| 125 | 125 | ||
| 126 | case PM_QOS_MAX: | 126 | case PM_QOS_MAX: |
| 127 | return plist_first(&o->requests)->prio; | 127 | return plist_last(&o->requests)->prio; |
| 128 | 128 | ||
| 129 | default: | 129 | default: |
| 130 | /* runtime check for not using enum */ | 130 | /* runtime check for not using enum */ |
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 29bff6117ab..a5aff3ebad3 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig | |||
| @@ -246,9 +246,13 @@ config PM_OPS | |||
| 246 | depends on PM_SLEEP || PM_RUNTIME | 246 | depends on PM_SLEEP || PM_RUNTIME |
| 247 | default y | 247 | default y |
| 248 | 248 | ||
| 249 | config ARCH_HAS_OPP | ||
| 250 | bool | ||
| 251 | |||
| 249 | config PM_OPP | 252 | config PM_OPP |
| 250 | bool "Operating Performance Point (OPP) Layer library" | 253 | bool "Operating Performance Point (OPP) Layer library" |
| 251 | depends on PM | 254 | depends on PM |
| 255 | depends on ARCH_HAS_OPP | ||
| 252 | ---help--- | 256 | ---help--- |
| 253 | SOCs have a standard set of tuples consisting of frequency and | 257 | SOCs have a standard set of tuples consisting of frequency and |
| 254 | voltage pairs that the device will support per voltage domain. This | 258 | voltage pairs that the device will support per voltage domain. This |
diff --git a/kernel/printk.c b/kernel/printk.c index 38e7d5868d6..9a2264fc42c 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
| @@ -274,7 +274,20 @@ int do_syslog(int type, char __user *buf, int len, bool from_file) | |||
| 274 | char c; | 274 | char c; |
| 275 | int error = 0; | 275 | int error = 0; |
| 276 | 276 | ||
| 277 | error = security_syslog(type, from_file); | 277 | /* |
| 278 | * If this is from /proc/kmsg we only do the capabilities checks | ||
| 279 | * at open time. | ||
| 280 | */ | ||
| 281 | if (type == SYSLOG_ACTION_OPEN || !from_file) { | ||
| 282 | if (dmesg_restrict && !capable(CAP_SYS_ADMIN)) | ||
| 283 | return -EPERM; | ||
| 284 | if ((type != SYSLOG_ACTION_READ_ALL && | ||
| 285 | type != SYSLOG_ACTION_SIZE_BUFFER) && | ||
| 286 | !capable(CAP_SYS_ADMIN)) | ||
| 287 | return -EPERM; | ||
| 288 | } | ||
| 289 | |||
| 290 | error = security_syslog(type); | ||
| 278 | if (error) | 291 | if (error) |
| 279 | return error; | 292 | return error; |
| 280 | 293 | ||
diff --git a/kernel/sched.c b/kernel/sched.c index aa14a56f9d0..dc91a4d09ac 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -560,18 +560,8 @@ struct rq { | |||
| 560 | 560 | ||
| 561 | static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); | 561 | static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); |
| 562 | 562 | ||
| 563 | static inline | ||
| 564 | void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags) | ||
| 565 | { | ||
| 566 | rq->curr->sched_class->check_preempt_curr(rq, p, flags); | ||
| 567 | 563 | ||
| 568 | /* | 564 | static void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags); |
| 569 | * A queue event has occurred, and we're going to schedule. In | ||
| 570 | * this case, we can save a useless back to back clock update. | ||
| 571 | */ | ||
| 572 | if (test_tsk_need_resched(p)) | ||
| 573 | rq->skip_clock_update = 1; | ||
| 574 | } | ||
| 575 | 565 | ||
| 576 | static inline int cpu_of(struct rq *rq) | 566 | static inline int cpu_of(struct rq *rq) |
| 577 | { | 567 | { |
| @@ -2118,6 +2108,31 @@ static inline void check_class_changed(struct rq *rq, struct task_struct *p, | |||
| 2118 | p->sched_class->prio_changed(rq, p, oldprio, running); | 2108 | p->sched_class->prio_changed(rq, p, oldprio, running); |
| 2119 | } | 2109 | } |
| 2120 | 2110 | ||
| 2111 | static void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags) | ||
| 2112 | { | ||
| 2113 | const struct sched_class *class; | ||
| 2114 | |||
| 2115 | if (p->sched_class == rq->curr->sched_class) { | ||
| 2116 | rq->curr->sched_class->check_preempt_curr(rq, p, flags); | ||
| 2117 | } else { | ||
| 2118 | for_each_class(class) { | ||
| 2119 | if (class == rq->curr->sched_class) | ||
| 2120 | break; | ||
| 2121 | if (class == p->sched_class) { | ||
| 2122 | resched_task(rq->curr); | ||
| 2123 | break; | ||
| 2124 | } | ||
| 2125 | } | ||
| 2126 | } | ||
| 2127 | |||
| 2128 | /* | ||
| 2129 | * A queue event has occurred, and we're going to schedule. In | ||
| 2130 | * this case, we can save a useless back to back clock update. | ||
| 2131 | */ | ||
| 2132 | if (test_tsk_need_resched(rq->curr)) | ||
| 2133 | rq->skip_clock_update = 1; | ||
| 2134 | } | ||
| 2135 | |||
| 2121 | #ifdef CONFIG_SMP | 2136 | #ifdef CONFIG_SMP |
| 2122 | /* | 2137 | /* |
| 2123 | * Is this task likely cache-hot: | 2138 | * Is this task likely cache-hot: |
| @@ -6960,6 +6975,8 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd) | |||
| 6960 | if (cpu != group_first_cpu(sd->groups)) | 6975 | if (cpu != group_first_cpu(sd->groups)) |
| 6961 | return; | 6976 | return; |
| 6962 | 6977 | ||
| 6978 | sd->groups->group_weight = cpumask_weight(sched_group_cpus(sd->groups)); | ||
| 6979 | |||
| 6963 | child = sd->child; | 6980 | child = sd->child; |
| 6964 | 6981 | ||
| 6965 | sd->groups->cpu_power = 0; | 6982 | sd->groups->cpu_power = 0; |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index f4f6a8326dd..52ab113d8bb 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
| @@ -1654,12 +1654,6 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ | |||
| 1654 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); | 1654 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); |
| 1655 | int scale = cfs_rq->nr_running >= sched_nr_latency; | 1655 | int scale = cfs_rq->nr_running >= sched_nr_latency; |
| 1656 | 1656 | ||
| 1657 | if (unlikely(rt_prio(p->prio))) | ||
| 1658 | goto preempt; | ||
| 1659 | |||
| 1660 | if (unlikely(p->sched_class != &fair_sched_class)) | ||
| 1661 | return; | ||
| 1662 | |||
| 1663 | if (unlikely(se == pse)) | 1657 | if (unlikely(se == pse)) |
| 1664 | return; | 1658 | return; |
| 1665 | 1659 | ||
| @@ -2035,13 +2029,16 @@ struct sd_lb_stats { | |||
| 2035 | unsigned long this_load_per_task; | 2029 | unsigned long this_load_per_task; |
| 2036 | unsigned long this_nr_running; | 2030 | unsigned long this_nr_running; |
| 2037 | unsigned long this_has_capacity; | 2031 | unsigned long this_has_capacity; |
| 2032 | unsigned int this_idle_cpus; | ||
| 2038 | 2033 | ||
| 2039 | /* Statistics of the busiest group */ | 2034 | /* Statistics of the busiest group */ |
| 2035 | unsigned int busiest_idle_cpus; | ||
| 2040 | unsigned long max_load; | 2036 | unsigned long max_load; |
| 2041 | unsigned long busiest_load_per_task; | 2037 | unsigned long busiest_load_per_task; |
| 2042 | unsigned long busiest_nr_running; | 2038 | unsigned long busiest_nr_running; |
| 2043 | unsigned long busiest_group_capacity; | 2039 | unsigned long busiest_group_capacity; |
| 2044 | unsigned long busiest_has_capacity; | 2040 | unsigned long busiest_has_capacity; |
| 2041 | unsigned int busiest_group_weight; | ||
| 2045 | 2042 | ||
| 2046 | int group_imb; /* Is there imbalance in this sd */ | 2043 | int group_imb; /* Is there imbalance in this sd */ |
| 2047 | #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) | 2044 | #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) |
| @@ -2063,6 +2060,8 @@ struct sg_lb_stats { | |||
| 2063 | unsigned long sum_nr_running; /* Nr tasks running in the group */ | 2060 | unsigned long sum_nr_running; /* Nr tasks running in the group */ |
| 2064 | unsigned long sum_weighted_load; /* Weighted load of group's tasks */ | 2061 | unsigned long sum_weighted_load; /* Weighted load of group's tasks */ |
| 2065 | unsigned long group_capacity; | 2062 | unsigned long group_capacity; |
| 2063 | unsigned long idle_cpus; | ||
| 2064 | unsigned long group_weight; | ||
| 2066 | int group_imb; /* Is there an imbalance in the group ? */ | 2065 | int group_imb; /* Is there an imbalance in the group ? */ |
| 2067 | int group_has_capacity; /* Is there extra capacity in the group? */ | 2066 | int group_has_capacity; /* Is there extra capacity in the group? */ |
| 2068 | }; | 2067 | }; |
| @@ -2431,7 +2430,8 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, | |||
| 2431 | sgs->group_load += load; | 2430 | sgs->group_load += load; |
| 2432 | sgs->sum_nr_running += rq->nr_running; | 2431 | sgs->sum_nr_running += rq->nr_running; |
| 2433 | sgs->sum_weighted_load += weighted_cpuload(i); | 2432 | sgs->sum_weighted_load += weighted_cpuload(i); |
| 2434 | 2433 | if (idle_cpu(i)) | |
| 2434 | sgs->idle_cpus++; | ||
| 2435 | } | 2435 | } |
| 2436 | 2436 | ||
| 2437 | /* | 2437 | /* |
| @@ -2469,6 +2469,7 @@ static inline void update_sg_lb_stats(struct sched_domain *sd, | |||
| 2469 | sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, SCHED_LOAD_SCALE); | 2469 | sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, SCHED_LOAD_SCALE); |
| 2470 | if (!sgs->group_capacity) | 2470 | if (!sgs->group_capacity) |
| 2471 | sgs->group_capacity = fix_small_capacity(sd, group); | 2471 | sgs->group_capacity = fix_small_capacity(sd, group); |
| 2472 | sgs->group_weight = group->group_weight; | ||
| 2472 | 2473 | ||
| 2473 | if (sgs->group_capacity > sgs->sum_nr_running) | 2474 | if (sgs->group_capacity > sgs->sum_nr_running) |
| 2474 | sgs->group_has_capacity = 1; | 2475 | sgs->group_has_capacity = 1; |
| @@ -2576,13 +2577,16 @@ static inline void update_sd_lb_stats(struct sched_domain *sd, int this_cpu, | |||
| 2576 | sds->this_nr_running = sgs.sum_nr_running; | 2577 | sds->this_nr_running = sgs.sum_nr_running; |
| 2577 | sds->this_load_per_task = sgs.sum_weighted_load; | 2578 | sds->this_load_per_task = sgs.sum_weighted_load; |
| 2578 | sds->this_has_capacity = sgs.group_has_capacity; | 2579 | sds->this_has_capacity = sgs.group_has_capacity; |
| 2580 | sds->this_idle_cpus = sgs.idle_cpus; | ||
| 2579 | } else if (update_sd_pick_busiest(sd, sds, sg, &sgs, this_cpu)) { | 2581 | } else if (update_sd_pick_busiest(sd, sds, sg, &sgs, this_cpu)) { |
| 2580 | sds->max_load = sgs.avg_load; | 2582 | sds->max_load = sgs.avg_load; |
| 2581 | sds->busiest = sg; | 2583 | sds->busiest = sg; |
| 2582 | sds->busiest_nr_running = sgs.sum_nr_running; | 2584 | sds->busiest_nr_running = sgs.sum_nr_running; |
| 2585 | sds->busiest_idle_cpus = sgs.idle_cpus; | ||
| 2583 | sds->busiest_group_capacity = sgs.group_capacity; | 2586 | sds->busiest_group_capacity = sgs.group_capacity; |
| 2584 | sds->busiest_load_per_task = sgs.sum_weighted_load; | 2587 | sds->busiest_load_per_task = sgs.sum_weighted_load; |
| 2585 | sds->busiest_has_capacity = sgs.group_has_capacity; | 2588 | sds->busiest_has_capacity = sgs.group_has_capacity; |
| 2589 | sds->busiest_group_weight = sgs.group_weight; | ||
| 2586 | sds->group_imb = sgs.group_imb; | 2590 | sds->group_imb = sgs.group_imb; |
| 2587 | } | 2591 | } |
| 2588 | 2592 | ||
| @@ -2860,8 +2864,26 @@ find_busiest_group(struct sched_domain *sd, int this_cpu, | |||
| 2860 | if (sds.this_load >= sds.avg_load) | 2864 | if (sds.this_load >= sds.avg_load) |
| 2861 | goto out_balanced; | 2865 | goto out_balanced; |
| 2862 | 2866 | ||
| 2863 | if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) | 2867 | /* |
| 2864 | goto out_balanced; | 2868 | * In the CPU_NEWLY_IDLE, use imbalance_pct to be conservative. |
| 2869 | * And to check for busy balance use !idle_cpu instead of | ||
| 2870 | * CPU_NOT_IDLE. This is because HT siblings will use CPU_NOT_IDLE | ||
| 2871 | * even when they are idle. | ||
| 2872 | */ | ||
| 2873 | if (idle == CPU_NEWLY_IDLE || !idle_cpu(this_cpu)) { | ||
| 2874 | if (100 * sds.max_load <= sd->imbalance_pct * sds.this_load) | ||
| 2875 | goto out_balanced; | ||
| 2876 | } else { | ||
| 2877 | /* | ||
| 2878 | * This cpu is idle. If the busiest group load doesn't | ||
| 2879 | * have more tasks than the number of available cpu's and | ||
| 2880 | * there is no imbalance between this and busiest group | ||
| 2881 | * wrt to idle cpu's, it is balanced. | ||
| 2882 | */ | ||
| 2883 | if ((sds.this_idle_cpus <= sds.busiest_idle_cpus + 1) && | ||
| 2884 | sds.busiest_nr_running <= sds.busiest_group_weight) | ||
| 2885 | goto out_balanced; | ||
| 2886 | } | ||
| 2865 | 2887 | ||
| 2866 | force_balance: | 2888 | force_balance: |
| 2867 | /* Looks like there is an imbalance. Compute it */ | 2889 | /* Looks like there is an imbalance. Compute it */ |
diff --git a/kernel/sched_stoptask.c b/kernel/sched_stoptask.c index 45bddc0c104..2bf6b47058c 100644 --- a/kernel/sched_stoptask.c +++ b/kernel/sched_stoptask.c | |||
| @@ -19,14 +19,14 @@ select_task_rq_stop(struct rq *rq, struct task_struct *p, | |||
| 19 | static void | 19 | static void |
| 20 | check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags) | 20 | check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags) |
| 21 | { | 21 | { |
| 22 | resched_task(rq->curr); /* we preempt everything */ | 22 | /* we're never preempted */ |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | static struct task_struct *pick_next_task_stop(struct rq *rq) | 25 | static struct task_struct *pick_next_task_stop(struct rq *rq) |
| 26 | { | 26 | { |
| 27 | struct task_struct *stop = rq->stop; | 27 | struct task_struct *stop = rq->stop; |
| 28 | 28 | ||
| 29 | if (stop && stop->state == TASK_RUNNING) | 29 | if (stop && stop->se.on_rq) |
| 30 | return stop; | 30 | return stop; |
| 31 | 31 | ||
| 32 | return NULL; | 32 | return NULL; |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b65bf634035..5abfa151855 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -702,7 +702,6 @@ static struct ctl_table kern_table[] = { | |||
| 702 | .extra1 = &zero, | 702 | .extra1 = &zero, |
| 703 | .extra2 = &ten_thousand, | 703 | .extra2 = &ten_thousand, |
| 704 | }, | 704 | }, |
| 705 | #endif | ||
| 706 | { | 705 | { |
| 707 | .procname = "dmesg_restrict", | 706 | .procname = "dmesg_restrict", |
| 708 | .data = &dmesg_restrict, | 707 | .data = &dmesg_restrict, |
| @@ -712,6 +711,7 @@ static struct ctl_table kern_table[] = { | |||
| 712 | .extra1 = &zero, | 711 | .extra1 = &zero, |
| 713 | .extra2 = &one, | 712 | .extra2 = &one, |
| 714 | }, | 713 | }, |
| 714 | #endif | ||
| 715 | { | 715 | { |
| 716 | .procname = "ngroups_max", | 716 | .procname = "ngroups_max", |
| 717 | .data = &ngroups_max, | 717 | .data = &ngroups_max, |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index e04b8bcdef8..ea37e2ff416 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
| @@ -126,7 +126,7 @@ if FTRACE | |||
| 126 | config FUNCTION_TRACER | 126 | config FUNCTION_TRACER |
| 127 | bool "Kernel Function Tracer" | 127 | bool "Kernel Function Tracer" |
| 128 | depends on HAVE_FUNCTION_TRACER | 128 | depends on HAVE_FUNCTION_TRACER |
| 129 | select FRAME_POINTER if (!ARM_UNWIND) | 129 | select FRAME_POINTER if !ARM_UNWIND && !S390 |
| 130 | select KALLSYMS | 130 | select KALLSYMS |
| 131 | select GENERIC_TRACER | 131 | select GENERIC_TRACER |
| 132 | select CONTEXT_SWITCH_TRACER | 132 | select CONTEXT_SWITCH_TRACER |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 82d9b8106cd..04208415798 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/writeback.h> | 17 | #include <linux/writeback.h> |
| 18 | #include <linux/kallsyms.h> | 18 | #include <linux/kallsyms.h> |
| 19 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
| 20 | #include <linux/smp_lock.h> | ||
| 21 | #include <linux/notifier.h> | 20 | #include <linux/notifier.h> |
| 22 | #include <linux/irqflags.h> | 21 | #include <linux/irqflags.h> |
| 23 | #include <linux/debugfs.h> | 22 | #include <linux/debugfs.h> |
| @@ -3273,9 +3273,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, | |||
| 3273 | kfree(n); | 3273 | kfree(n); |
| 3274 | kfree(s); | 3274 | kfree(s); |
| 3275 | } | 3275 | } |
| 3276 | err: | ||
| 3276 | up_write(&slub_lock); | 3277 | up_write(&slub_lock); |
| 3277 | 3278 | ||
| 3278 | err: | ||
| 3279 | if (flags & SLAB_PANIC) | 3279 | if (flags & SLAB_PANIC) |
| 3280 | panic("Cannot create slabcache %s\n", name); | 3280 | panic("Cannot create slabcache %s\n", name); |
| 3281 | else | 3281 | else |
| @@ -3862,6 +3862,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s, | |||
| 3862 | x += sprintf(buf + x, " N%d=%lu", | 3862 | x += sprintf(buf + x, " N%d=%lu", |
| 3863 | node, nodes[node]); | 3863 | node, nodes[node]); |
| 3864 | #endif | 3864 | #endif |
| 3865 | up_read(&slub_lock); | ||
| 3865 | kfree(nodes); | 3866 | kfree(nodes); |
| 3866 | return x + sprintf(buf + x, "\n"); | 3867 | return x + sprintf(buf + x, "\n"); |
| 3867 | } | 3868 | } |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 7f097989cde..a6de3059746 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
| @@ -45,7 +45,6 @@ | |||
| 45 | #include <linux/capability.h> | 45 | #include <linux/capability.h> |
| 46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
| 47 | #include <linux/types.h> | 47 | #include <linux/types.h> |
| 48 | #include <linux/smp_lock.h> | ||
| 49 | #include <linux/socket.h> | 48 | #include <linux/socket.h> |
| 50 | #include <linux/sockios.h> | 49 | #include <linux/sockios.h> |
| 51 | #include <linux/slab.h> | 50 | #include <linux/slab.h> |
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 7fa86373de4..7c567b8aa89 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 18 | #include <linux/smp_lock.h> | ||
| 19 | #include "irnet_ppp.h" /* Private header */ | 18 | #include "irnet_ppp.h" /* Private header */ |
| 20 | /* Please put other headers in irnet.h - Thanks */ | 19 | /* Please put other headers in irnet.h - Thanks */ |
| 21 | 20 | ||
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index f71a73107ae..80df89d957b 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c | |||
| @@ -115,9 +115,7 @@ EXPORT_SYMBOL_GPL(svc_seq_show); | |||
| 115 | */ | 115 | */ |
| 116 | struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) | 116 | struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) |
| 117 | { | 117 | { |
| 118 | struct rpc_iostats *new; | 118 | return kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL); |
| 119 | new = kcalloc(clnt->cl_maxproc, sizeof(struct rpc_iostats), GFP_KERNEL); | ||
| 120 | return new; | ||
| 121 | } | 119 | } |
| 122 | EXPORT_SYMBOL_GPL(rpc_alloc_iostats); | 120 | EXPORT_SYMBOL_GPL(rpc_alloc_iostats); |
| 123 | 121 | ||
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index c82fe739fbd..ea2ff78dcf7 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
| 8 | #include <linux/smp_lock.h> | ||
| 9 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 10 | #include <linux/freezer.h> | 9 | #include <linux/freezer.h> |
| 11 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index cdb6dc1f645..39580a5dc5d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
| @@ -5,7 +5,7 @@ use strict; | |||
| 5 | ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## | 5 | ## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## |
| 6 | ## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## | 6 | ## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## |
| 7 | ## Copyright (C) 2001 Simon Huggins ## | 7 | ## Copyright (C) 2001 Simon Huggins ## |
| 8 | ## Copyright (C) 2005-2009 Randy Dunlap ## | 8 | ## Copyright (C) 2005-2010 Randy Dunlap ## |
| 9 | ## ## | 9 | ## ## |
| 10 | ## #define enhancements by Armin Kuster <akuster@mvista.com> ## | 10 | ## #define enhancements by Armin Kuster <akuster@mvista.com> ## |
| 11 | ## Copyright (c) 2000 MontaVista Software, Inc. ## | 11 | ## Copyright (c) 2000 MontaVista Software, Inc. ## |
| @@ -453,7 +453,7 @@ sub output_highlight { | |||
| 453 | if ($output_mode eq "html" || $output_mode eq "xml") { | 453 | if ($output_mode eq "html" || $output_mode eq "xml") { |
| 454 | $contents = local_unescape($contents); | 454 | $contents = local_unescape($contents); |
| 455 | # convert data read & converted thru xml_escape() into &xyz; format: | 455 | # convert data read & converted thru xml_escape() into &xyz; format: |
| 456 | $contents =~ s/\\\\\\/&/g; | 456 | $contents =~ s/\\\\\\/\&/g; |
| 457 | } | 457 | } |
| 458 | # print STDERR "contents b4:$contents\n"; | 458 | # print STDERR "contents b4:$contents\n"; |
| 459 | eval $dohighlight; | 459 | eval $dohighlight; |
| @@ -770,7 +770,11 @@ sub output_struct_xml(%) { | |||
| 770 | print $args{'type'} . " " . $args{'struct'} . " {\n"; | 770 | print $args{'type'} . " " . $args{'struct'} . " {\n"; |
| 771 | foreach $parameter (@{$args{'parameterlist'}}) { | 771 | foreach $parameter (@{$args{'parameterlist'}}) { |
| 772 | if ($parameter =~ /^#/) { | 772 | if ($parameter =~ /^#/) { |
| 773 | print "$parameter\n"; | 773 | my $prm = $parameter; |
| 774 | # convert data read & converted thru xml_escape() into &xyz; format: | ||
| 775 | # This allows us to have #define macros interspersed in a struct. | ||
| 776 | $prm =~ s/\\\\\\/\&/g; | ||
| 777 | print "$prm\n"; | ||
| 774 | next; | 778 | next; |
| 775 | } | 779 | } |
| 776 | 780 | ||
| @@ -1701,6 +1705,8 @@ sub push_parameter($$$) { | |||
| 1701 | } | 1705 | } |
| 1702 | } | 1706 | } |
| 1703 | 1707 | ||
| 1708 | $param = xml_escape($param); | ||
| 1709 | |||
| 1704 | # strip spaces from $param so that it is one continous string | 1710 | # strip spaces from $param so that it is one continous string |
| 1705 | # on @parameterlist; | 1711 | # on @parameterlist; |
| 1706 | # this fixes a problem where check_sections() cannot find | 1712 | # this fixes a problem where check_sections() cannot find |
diff --git a/security/capability.c b/security/capability.c index 30ae00fbecd..c773635ca3a 100644 --- a/security/capability.c +++ b/security/capability.c | |||
| @@ -17,6 +17,11 @@ static int cap_sysctl(ctl_table *table, int op) | |||
| 17 | return 0; | 17 | return 0; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | static int cap_syslog(int type) | ||
| 21 | { | ||
| 22 | return 0; | ||
| 23 | } | ||
| 24 | |||
| 20 | static int cap_quotactl(int cmds, int type, int id, struct super_block *sb) | 25 | static int cap_quotactl(int cmds, int type, int id, struct super_block *sb) |
| 21 | { | 26 | { |
| 22 | return 0; | 27 | return 0; |
diff --git a/security/commoncap.c b/security/commoncap.c index 04b80f9912b..64c2ed9c901 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
| 28 | #include <linux/prctl.h> | 28 | #include <linux/prctl.h> |
| 29 | #include <linux/securebits.h> | 29 | #include <linux/securebits.h> |
| 30 | #include <linux/syslog.h> | ||
| 31 | 30 | ||
| 32 | /* | 31 | /* |
| 33 | * If a non-root user executes a setuid-root binary in | 32 | * If a non-root user executes a setuid-root binary in |
| @@ -884,26 +883,6 @@ error: | |||
| 884 | } | 883 | } |
| 885 | 884 | ||
| 886 | /** | 885 | /** |
| 887 | * cap_syslog - Determine whether syslog function is permitted | ||
| 888 | * @type: Function requested | ||
| 889 | * @from_file: Whether this request came from an open file (i.e. /proc) | ||
| 890 | * | ||
| 891 | * Determine whether the current process is permitted to use a particular | ||
| 892 | * syslog function, returning 0 if permission is granted, -ve if not. | ||
| 893 | */ | ||
| 894 | int cap_syslog(int type, bool from_file) | ||
| 895 | { | ||
| 896 | if (type != SYSLOG_ACTION_OPEN && from_file) | ||
| 897 | return 0; | ||
| 898 | if (dmesg_restrict && !capable(CAP_SYS_ADMIN)) | ||
| 899 | return -EPERM; | ||
| 900 | if ((type != SYSLOG_ACTION_READ_ALL && | ||
| 901 | type != SYSLOG_ACTION_SIZE_BUFFER) && !capable(CAP_SYS_ADMIN)) | ||
| 902 | return -EPERM; | ||
| 903 | return 0; | ||
| 904 | } | ||
| 905 | |||
| 906 | /** | ||
| 907 | * cap_vm_enough_memory - Determine whether a new virtual mapping is permitted | 886 | * cap_vm_enough_memory - Determine whether a new virtual mapping is permitted |
| 908 | * @mm: The VM space in which the new mapping is to be made | 887 | * @mm: The VM space in which the new mapping is to be made |
| 909 | * @pages: The size of the mapping | 888 | * @pages: The size of the mapping |
diff --git a/security/security.c b/security/security.c index 3ef5e2a7a74..1b798d3df71 100644 --- a/security/security.c +++ b/security/security.c | |||
| @@ -197,9 +197,9 @@ int security_quota_on(struct dentry *dentry) | |||
| 197 | return security_ops->quota_on(dentry); | 197 | return security_ops->quota_on(dentry); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | int security_syslog(int type, bool from_file) | 200 | int security_syslog(int type) |
| 201 | { | 201 | { |
| 202 | return security_ops->syslog(type, from_file); | 202 | return security_ops->syslog(type); |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | int security_settime(struct timespec *ts, struct timezone *tz) | 205 | int security_settime(struct timespec *ts, struct timezone *tz) |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index d9154cf90ae..65fa8bf596f 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
| @@ -1973,14 +1973,10 @@ static int selinux_quota_on(struct dentry *dentry) | |||
| 1973 | return dentry_has_perm(cred, NULL, dentry, FILE__QUOTAON); | 1973 | return dentry_has_perm(cred, NULL, dentry, FILE__QUOTAON); |
| 1974 | } | 1974 | } |
| 1975 | 1975 | ||
| 1976 | static int selinux_syslog(int type, bool from_file) | 1976 | static int selinux_syslog(int type) |
| 1977 | { | 1977 | { |
| 1978 | int rc; | 1978 | int rc; |
| 1979 | 1979 | ||
| 1980 | rc = cap_syslog(type, from_file); | ||
| 1981 | if (rc) | ||
| 1982 | return rc; | ||
| 1983 | |||
| 1984 | switch (type) { | 1980 | switch (type) { |
| 1985 | case SYSLOG_ACTION_READ_ALL: /* Read last kernel messages */ | 1981 | case SYSLOG_ACTION_READ_ALL: /* Read last kernel messages */ |
| 1986 | case SYSLOG_ACTION_SIZE_BUFFER: /* Return size of the log buffer */ | 1982 | case SYSLOG_ACTION_SIZE_BUFFER: /* Return size of the log buffer */ |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index bc39f4067af..489a85afa47 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
| @@ -157,15 +157,11 @@ static int smack_ptrace_traceme(struct task_struct *ptp) | |||
| 157 | * | 157 | * |
| 158 | * Returns 0 on success, error code otherwise. | 158 | * Returns 0 on success, error code otherwise. |
| 159 | */ | 159 | */ |
| 160 | static int smack_syslog(int type, bool from_file) | 160 | static int smack_syslog(int typefrom_file) |
| 161 | { | 161 | { |
| 162 | int rc; | 162 | int rc = 0; |
| 163 | char *sp = current_security(); | 163 | char *sp = current_security(); |
| 164 | 164 | ||
| 165 | rc = cap_syslog(type, from_file); | ||
| 166 | if (rc != 0) | ||
| 167 | return rc; | ||
| 168 | |||
| 169 | if (capable(CAP_MAC_OVERRIDE)) | 165 | if (capable(CAP_MAC_OVERRIDE)) |
| 170 | return 0; | 166 | return 0; |
| 171 | 167 | ||
diff --git a/sound/core/info.c b/sound/core/info.c index b70564ed8b3..7077f601da5 100644 --- a/sound/core/info.c +++ b/sound/core/info.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #include <linux/time.h> | 23 | #include <linux/time.h> |
| 24 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
| 25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 26 | #include <linux/smp_lock.h> | ||
| 27 | #include <linux/string.h> | 26 | #include <linux/string.h> |
| 28 | #include <sound/core.h> | 27 | #include <sound/core.h> |
| 29 | #include <sound/minors.h> | 28 | #include <sound/minors.h> |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 8bc7cb3db33..e82c1f97d99 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
| 23 | #include <linux/file.h> | 23 | #include <linux/file.h> |
| 24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
| 25 | #include <linux/smp_lock.h> | ||
| 26 | #include <linux/time.h> | 25 | #include <linux/time.h> |
| 27 | #include <linux/pm_qos_params.h> | 26 | #include <linux/pm_qos_params.h> |
| 28 | #include <linux/uio.h> | 27 | #include <linux/uio.h> |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 62a093efb45..66691fe437e 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
| 23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 24 | #include <linux/smp_lock.h> | ||
| 25 | #include <linux/time.h> | 24 | #include <linux/time.h> |
| 26 | #include <linux/device.h> | 25 | #include <linux/device.h> |
| 27 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
diff --git a/sound/sound_core.c b/sound/sound_core.c index c03bbaefdbc..5580aced873 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
| @@ -104,7 +104,6 @@ module_exit(cleanup_soundcore); | |||
| 104 | 104 | ||
| 105 | #include <linux/init.h> | 105 | #include <linux/init.h> |
| 106 | #include <linux/slab.h> | 106 | #include <linux/slab.h> |
| 107 | #include <linux/smp_lock.h> | ||
| 108 | #include <linux/types.h> | 107 | #include <linux/types.h> |
| 109 | #include <linux/kernel.h> | 108 | #include <linux/kernel.h> |
| 110 | #include <linux/sound.h> | 109 | #include <linux/sound.h> |
