ddf90a27 parents dfb8518 5693188 56cb248 d098bc7 34fd421 90cf241 d12379a630 files · +5966 −3821Browse filesUnified · Split
| @@ -0,0 +1,19 @@ | ||
| 1 | +What: /sys/bus/hsi | |
| 2 | +Date: April 2012 | |
| 3 | +KernelVersion: 3.4 | |
| 4 | +Contact: Carlos Chinea <carlos.chinea@nokia.com> | |
| 5 | +Description: | |
| 6 | + High Speed Synchronous Serial Interface (HSI) is a | |
| 7 | + serial interface mainly used for connecting application | |
| 8 | + engines (APE) with cellular modem engines (CMT) in cellular | |
| 9 | + handsets. | |
| 10 | + The bus will be populated with devices (hsi_clients) representing | |
| 11 | + the protocols available in the system. Bus drivers implement | |
| 12 | + those protocols. | |
| 13 | + | |
| 14 | +What: /sys/bus/hsi/devices/.../modalias | |
| 15 | +Date: April 2012 | |
| 16 | +KernelVersion: 3.4 | |
| 17 | +Contact: Carlos Chinea <carlos.chinea@nokia.com> | |
| 18 | +Description: Stores the same MODALIAS value emitted by uevent | |
| 19 | + Format: hsi:<hsi_client device name> | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | <refentry id="V4L2-PIX-FMT-NV12M"> |
| 2 | 2 | <refmeta> |
| 3 | − <refentrytitle>V4L2_PIX_FMT_NV12M ('NV12M')</refentrytitle> | |
| 3 | + <refentrytitle>V4L2_PIX_FMT_NV12M ('NM12')</refentrytitle> | |
| 4 | 4 | &manvol; |
| 5 | 5 | </refmeta> |
| 6 | 6 | <refnamediv> |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | <refentry id="V4L2-PIX-FMT-YUV420M"> |
| 2 | 2 | <refmeta> |
| 3 | − <refentrytitle>V4L2_PIX_FMT_YUV420M ('YU12M')</refentrytitle> | |
| 3 | + <refentrytitle>V4L2_PIX_FMT_YUV420M ('YM12')</refentrytitle> | |
| 4 | 4 | &manvol; |
| 5 | 5 | </refmeta> |
| 6 | 6 | <refnamediv> |
| @@ -0,0 +1,27 @@ | ||
| 1 | +* ARM architected timer | |
| 2 | + | |
| 3 | +ARM Cortex-A7 and Cortex-A15 have a per-core architected timer, which | |
| 4 | +provides per-cpu timers. | |
| 5 | + | |
| 6 | +The timer is attached to a GIC to deliver its per-processor interrupts. | |
| 7 | + | |
| 8 | +** Timer node properties: | |
| 9 | + | |
| 10 | +- compatible : Should at least contain "arm,armv7-timer". | |
| 11 | + | |
| 12 | +- interrupts : Interrupt list for secure, non-secure, virtual and | |
| 13 | + hypervisor timers, in that order. | |
| 14 | + | |
| 15 | +- clock-frequency : The frequency of the main counter, in Hz. Optional. | |
| 16 | + | |
| 17 | +Example: | |
| 18 | + | |
| 19 | + timer { | |
| 20 | + compatible = "arm,cortex-a15-timer", | |
| 21 | + "arm,armv7-timer"; | |
| 22 | + interrupts = <1 13 0xf08>, | |
| 23 | + <1 14 0xf08>, | |
| 24 | + <1 11 0xf08>, | |
| 25 | + <1 10 0xf08>; | |
| 26 | + clock-frequency = <100000000>; | |
| 27 | + }; | |
| @@ -9,7 +9,7 @@ architectures). · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | II. How does it work? |
| 11 | 11 | |
| 12 | −There are four per-task flags used for that, PF_NOFREEZE, PF_FROZEN, TIF_FREEZE | |
| 12 | +There are three per-task flags used for that, PF_NOFREEZE, PF_FROZEN | |
| 13 | 13 | and PF_FREEZER_SKIP (the last one is auxiliary). The tasks that have |
| 14 | 14 | PF_NOFREEZE unset (all user space processes and some kernel threads) are |
| 15 | 15 | regarded as 'freezable' and treated in a special way before the system enters a |
| @@ -17,30 +17,31 @@ suspend state as well as before a hibernation image is created (in what follows · 1 unmodified line | ||
| 17 | 17 | we only consider hibernation, but the description also applies to suspend). |
| 18 | 18 | |
| 19 | 19 | Namely, as the first step of the hibernation procedure the function |
| 20 | −freeze_processes() (defined in kernel/power/process.c) is called. It executes | |
| 21 | −try_to_freeze_tasks() that sets TIF_FREEZE for all of the freezable tasks and | |
| 22 | −either wakes them up, if they are kernel threads, or sends fake signals to them, | |
| 23 | −if they are user space processes. A task that has TIF_FREEZE set, should react | |
| 24 | −to it by calling the function called __refrigerator() (defined in | |
| 25 | −kernel/freezer.c), which sets the task's PF_FROZEN flag, changes its state | |
| 26 | −to TASK_UNINTERRUPTIBLE and makes it loop until PF_FROZEN is cleared for it. | |
| 27 | −Then, we say that the task is 'frozen' and therefore the set of functions | |
| 28 | −handling this mechanism is referred to as 'the freezer' (these functions are | |
| 29 | −defined in kernel/power/process.c, kernel/freezer.c & include/linux/freezer.h). | |
| 30 | −User space processes are generally frozen before kernel threads. | |
| 20 | +freeze_processes() (defined in kernel/power/process.c) is called. A system-wide | |
| 21 | +variable system_freezing_cnt (as opposed to a per-task flag) is used to indicate | |
| 22 | +whether the system is to undergo a freezing operation. And freeze_processes() | |
| 23 | +sets this variable. After this, it executes try_to_freeze_tasks() that sends a | |
| 24 | +fake signal to all user space processes, and wakes up all the kernel threads. | |
| 25 | +All freezable tasks must react to that by calling try_to_freeze(), which | |
| 26 | +results in a call to __refrigerator() (defined in kernel/freezer.c), which sets | |
| 27 | +the task's PF_FROZEN flag, changes its state to TASK_UNINTERRUPTIBLE and makes | |
| 28 | +it loop until PF_FROZEN is cleared for it. Then, we say that the task is | |
| 29 | +'frozen' and therefore the set of functions handling this mechanism is referred | |
| 30 | +to as 'the freezer' (these functions are defined in kernel/power/process.c, | |
| 31 | +kernel/freezer.c & include/linux/freezer.h). User space processes are generally | |
| 32 | +frozen before kernel threads. | |
| 31 | 33 | |
| 32 | 34 | __refrigerator() must not be called directly. Instead, use the |
| 33 | 35 | try_to_freeze() function (defined in include/linux/freezer.h), that checks |
| 34 | −the task's TIF_FREEZE flag and makes the task enter __refrigerator() if the | |
| 35 | −flag is set. | |
| 36 | +if the task is to be frozen and makes the task enter __refrigerator(). | |
| 36 | 37 | |
| 37 | 38 | For user space processes try_to_freeze() is called automatically from the |
| 38 | 39 | signal-handling code, but the freezable kernel threads need to call it |
| 39 | 40 | explicitly in suitable places or use the wait_event_freezable() or |
| 40 | 41 | wait_event_freezable_timeout() macros (defined in include/linux/freezer.h) |
| 41 | −that combine interruptible sleep with checking if TIF_FREEZE is set and calling | |
| 42 | −try_to_freeze(). The main loop of a freezable kernel thread may look like the | |
| 43 | −following one: | |
| 42 | +that combine interruptible sleep with checking if the task is to be frozen and | |
| 43 | +calling try_to_freeze(). The main loop of a freezable kernel thread may look | |
| 44 | +like the following one: | |
| 44 | 45 | |
| 45 | 46 | set_freezable(); |
| 46 | 47 | do { |
| @@ -53,7 +54,7 @@ following one: · 6 unmodified lines | ||
| 53 | 54 | (from drivers/usb/core/hub.c::hub_thread()). |
| 54 | 55 | |
| 55 | 56 | If a freezable kernel thread fails to call try_to_freeze() after the freezer has |
| 56 | −set TIF_FREEZE for it, the freezing of tasks will fail and the entire | |
| 57 | +initiated a freezing operation, the freezing of tasks will fail and the entire | |
| 57 | 58 | hibernation operation will be cancelled. For this reason, freezable kernel |
| 58 | 59 | threads must call try_to_freeze() somewhere or use one of the |
| 59 | 60 | wait_event_freezable() and wait_event_freezable_timeout() macros. |
| @@ -123,7 +123,7 @@ KEY SERVICE OVERVIEW · 122 unmodified lines | ||
| 123 | 123 | |
| 124 | 124 | The key service provides a number of features besides keys: |
| 125 | 125 | |
| 126 | − (*) The key service defines two special key types: | |
| 126 | + (*) The key service defines three special key types: | |
| 127 | 127 | |
| 128 | 128 | (+) "keyring" |
| 129 | 129 | |
| @@ -137,6 +137,18 @@ The key service provides a number of features besides keys: · 7 unmodified lines | ||
| 137 | 137 | blobs of data. These can be created, updated and read by userspace, |
| 138 | 138 | and aren't intended for use by kernel services. |
| 139 | 139 | |
| 140 | + (+) "logon" | |
| 141 | + | |
| 142 | + Like a "user" key, a "logon" key has a payload that is an arbitrary | |
| 143 | + blob of data. It is intended as a place to store secrets which are | |
| 144 | + accessible to the kernel but not to userspace programs. | |
| 145 | + | |
| 146 | + The description can be arbitrary, but must be prefixed with a non-zero | |
| 147 | + length string that describes the key "subclass". The subclass is | |
| 148 | + separated from the rest of the description by a ':'. "logon" keys can | |
| 149 | + be created and updated from userspace, but the payload is only | |
| 150 | + readable from kernel space. | |
| 151 | + | |
| 140 | 152 | (*) Each process subscribes to three keyrings: a thread-specific keyring, a |
| 141 | 153 | process-specific keyring, and a session-specific keyring. |
| 142 | 154 | |
| @@ -2321,9 +2321,9 @@ S: Supported · 2320 unmodified lines | ||
| 2321 | 2321 | F: drivers/acpi/dock.c |
| 2322 | 2322 | |
| 2323 | 2323 | DOCUMENTATION |
| 2324 | −M: Randy Dunlap <rdunlap@xenotime.net> | |
| 2324 | +M: Rob Landley <rob@landley.net> | |
| 2325 | 2325 | L: linux-doc@vger.kernel.org |
| 2326 | −T: quilt http://xenotime.net/kernel-doc-patches/current/ | |
| 2326 | +T: TBD | |
| 2327 | 2327 | S: Maintained |
| 2328 | 2328 | F: Documentation/ |
| 2329 | 2329 | |
| @@ -3592,6 +3592,7 @@ S: Supported · 1262 unmodified lines | ||
| 3592 | 3592 | F: drivers/net/wireless/iwlegacy/ |
| 3593 | 3593 | |
| 3594 | 3594 | INTEL WIRELESS WIFI LINK (iwlwifi) |
| 3595 | +M: Johannes Berg <johannes.berg@intel.com> | |
| 3595 | 3596 | M: Wey-Yi Guy <wey-yi.w.guy@intel.com> |
| 3596 | 3597 | M: Intel Linux Wireless <ilw@linux.intel.com> |
| 3597 | 3598 | L: linux-wireless@vger.kernel.org |
| @@ -7578,8 +7579,8 @@ F: Documentation/filesystems/xfs.txt · 3980 unmodified lines | ||
| 7578 | 7579 | F: fs/xfs/ |
| 7579 | 7580 | |
| 7580 | 7581 | XILINX AXI ETHERNET DRIVER |
| 7581 | −M: Ariane Keller <ariane.keller@tik.ee.ethz.ch> | |
| 7582 | −M: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch> | |
| 7582 | +M: Anirudha Sarangi <anirudh@xilinx.com> | |
| 7583 | +M: John Linn <John.Linn@xilinx.com> | |
| 7583 | 7584 | S: Maintained |
| 7584 | 7585 | F: drivers/net/ethernet/xilinx/xilinx_axienet* |
| 7585 | 7586 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | VERSION = 3 |
| 2 | 2 | PATCHLEVEL = 4 |
| 3 | 3 | SUBLEVEL = 0 |
| 4 | −EXTRAVERSION = -rc3 | |
| 4 | +EXTRAVERSION = -rc5 | |
| 5 | 5 | NAME = Saber-toothed Squirrel |
| 6 | 6 | |
| 7 | 7 | # *DOCUMENTATION* |
| @@ -280,6 +280,7 @@ config ARCH_INTEGRATOR · 279 unmodified lines | ||
| 280 | 280 | select NEED_MACH_IO_H |
| 281 | 281 | select NEED_MACH_MEMORY_H |
| 282 | 282 | select SPARSE_IRQ |
| 283 | + select MULTI_IRQ_HANDLER | |
| 283 | 284 | help |
| 284 | 285 | Support for ARM's Integrator platform. |
| 285 | 286 | |
| @@ -1186,6 +1187,15 @@ if !MMU · 900 unmodified lines | ||
| 1186 | 1187 | source "arch/arm/Kconfig-nommu" |
| 1187 | 1188 | endif |
| 1188 | 1189 | |
| 1190 | +config ARM_ERRATA_326103 | |
| 1191 | + bool "ARM errata: FSR write bit incorrect on a SWP to read-only memory" | |
| 1192 | + depends on CPU_V6 | |
| 1193 | + help | |
| 1194 | + Executing a SWP instruction to read-only memory does not set bit 11 | |
| 1195 | + of the FSR on the ARM 1136 prior to r1p0. This causes the kernel to | |
| 1196 | + treat the access as a read, preventing a COW from occurring and | |
| 1197 | + causing the faulting task to livelock. | |
| 1198 | + | |
| 1189 | 1199 | config ARM_ERRATA_411920 |
| 1190 | 1200 | bool "ARM errata: Invalidation of the Instruction Cache operation can fail" |
| 1191 | 1201 | depends on CPU_V6 || CPU_V6K |
| @@ -1543,6 +1553,12 @@ config HAVE_ARM_SCU · 351 unmodified lines | ||
| 1543 | 1553 | help |
| 1544 | 1554 | This option enables support for the ARM system coherency unit |
| 1545 | 1555 | |
| 1556 | +config ARM_ARCH_TIMER | |
| 1557 | + bool "Architected timer support" | |
| 1558 | + depends on CPU_V7 | |
| 1559 | + help | |
| 1560 | + This option enables support for the ARM architected timer | |
| 1561 | + | |
| 1546 | 1562 | config HAVE_ARM_TWD |
| 1547 | 1563 | bool |
| 1548 | 1564 | depends on SMP |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | intc: interrupt-controller@02080000 { |
| 11 | 11 | compatible = "qcom,msm-8660-qgic"; |
| 12 | 12 | interrupt-controller; |
| 13 | − #interrupt-cells = <1>; | |
| 13 | + #interrupt-cells = <3>; | |
| 14 | 14 | reg = < 0x02080000 0x1000 >, |
| 15 | 15 | < 0x02081000 0x1000 >; |
| 16 | 16 | }; |
| @@ -19,6 +19,6 @@ · 2 unmodified lines | ||
| 19 | 19 | compatible = "qcom,msm-hsuart", "qcom,msm-uart"; |
| 20 | 20 | reg = <0x19c40000 0x1000>, |
| 21 | 21 | <0x19c00000 0x1000>; |
| 22 | − interrupts = <195>; | |
| 22 | + interrupts = <0 195 0x0>; | |
| 23 | 23 | }; |
| 24 | 24 | }; |
| @@ -173,7 +173,7 @@ · 172 unmodified lines | ||
| 173 | 173 | mmc@5000 { |
| 174 | 174 | compatible = "arm,primecell"; |
| 175 | 175 | reg = < 0x5000 0x1000>; |
| 176 | − interrupts = <22>; | |
| 176 | + interrupts = <22 34>; | |
| 177 | 177 | }; |
| 178 | 178 | kmi@6000 { |
| 179 | 179 | compatible = "arm,pl050", "arm,primecell"; |
| @@ -41,7 +41,7 @@ · 40 unmodified lines | ||
| 41 | 41 | mmc@b000 { |
| 42 | 42 | compatible = "arm,primecell"; |
| 43 | 43 | reg = <0xb000 0x1000>; |
| 44 | − interrupts = <23>; | |
| 44 | + interrupts = <23 34>; | |
| 45 | 45 | }; |
| 46 | 46 | }; |
| 47 | 47 | }; |
| @@ -222,7 +222,7 @@ static int it8152_pci_write_config(struct pci_bus *bus, · 221 unmodified lines | ||
| 222 | 222 | return PCIBIOS_SUCCESSFUL; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | −static struct pci_ops it8152_ops = { | |
| 225 | +struct pci_ops it8152_ops = { | |
| 226 | 226 | .read = it8152_pci_read_config, |
| 227 | 227 | .write = it8152_pci_write_config, |
| 228 | 228 | }; |
| @@ -346,9 +346,4 @@ void pcibios_set_master(struct pci_dev *dev) · 117 unmodified lines | ||
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
| 349 | −struct pci_bus * __init it8152_pci_scan_bus(int nr, struct pci_sys_data *sys) | |
| 350 | −{ | |
| 351 | − return pci_scan_root_bus(NULL, nr, &it8152_ops, sys, &sys->resources); | |
| 352 | −} | |
| 353 | − | |
| 354 | 349 | EXPORT_SYMBOL(dma_set_coherent_mask); |
| @@ -51,7 +51,7 @@ via82c505_write_config(struct pci_bus *bus, unsigned int devfn, int where, · 50 unmodified lines | ||
| 51 | 51 | return PCIBIOS_SUCCESSFUL; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | −static struct pci_ops via82c505_ops = { | |
| 54 | +struct pci_ops via82c505_ops = { | |
| 55 | 55 | .read = via82c505_read_config, |
| 56 | 56 | .write = via82c505_write_config, |
| 57 | 57 | }; |
| @@ -81,12 +81,3 @@ int __init via82c505_setup(int nr, struct pci_sys_data *sys) · 23 unmodified lines | ||
| 81 | 81 | { |
| 82 | 82 | return (nr == 0); |
| 83 | 83 | } |
| 84 | − | |
| 85 | −struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata) | |
| 86 | −{ | |
| 87 | − if (nr == 0) | |
| 88 | − return pci_scan_root_bus(NULL, 0, &via82c505_ops, sysdata, | |
| 89 | − &sysdata->resources); | |
| 90 | − | |
| 91 | − return NULL; | |
| 92 | −} | |
| @@ -112,6 +112,7 @@ CONFIG_WATCHDOG=y · 111 unmodified lines | ||
| 112 | 112 | CONFIG_IMX2_WDT=y |
| 113 | 113 | CONFIG_MFD_MC13XXX=y |
| 114 | 114 | CONFIG_REGULATOR=y |
| 115 | +CONFIG_REGULATOR_FIXED_VOLTAGE=y | |
| 115 | 116 | CONFIG_REGULATOR_MC13783=y |
| 116 | 117 | CONFIG_REGULATOR_MC13892=y |
| 117 | 118 | CONFIG_FB=y |
| @@ -14,6 +14,8 @@ CONFIG_MODULE_FORCE_UNLOAD=y · 13 unmodified lines | ||
| 14 | 14 | # CONFIG_BLK_DEV_BSG is not set |
| 15 | 15 | CONFIG_BLK_DEV_INTEGRITY=y |
| 16 | 16 | CONFIG_ARCH_S3C24XX=y |
| 17 | +# CONFIG_CPU_S3C2410 is not set | |
| 18 | +CONFIG_CPU_S3C2440=y | |
| 17 | 19 | CONFIG_S3C_ADC=y |
| 18 | 20 | CONFIG_S3C24XX_PWM=y |
| 19 | 21 | CONFIG_MACH_MINI2440=y |
| @@ -8,8 +8,6 @@ CONFIG_MODULE_UNLOAD=y · 7 unmodified lines | ||
| 8 | 8 | # CONFIG_LBDAF is not set |
| 9 | 9 | # CONFIG_BLK_DEV_BSG is not set |
| 10 | 10 | CONFIG_ARCH_U8500=y |
| 11 | −CONFIG_UX500_SOC_DB5500=y | |
| 12 | −CONFIG_UX500_SOC_DB8500=y | |
| 13 | 11 | CONFIG_MACH_HREFV60=y |
| 14 | 12 | CONFIG_MACH_SNOWBALL=y |
| 15 | 13 | CONFIG_MACH_U5500=y |
| @@ -39,7 +37,6 @@ CONFIG_CAIF=y · 23 unmodified lines | ||
| 39 | 37 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
| 40 | 38 | CONFIG_BLK_DEV_RAM=y |
| 41 | 39 | CONFIG_BLK_DEV_RAM_SIZE=65536 |
| 42 | −CONFIG_MISC_DEVICES=y | |
| 43 | 40 | CONFIG_AB8500_PWM=y |
| 44 | 41 | CONFIG_SENSORS_BH1780=y |
| 45 | 42 | CONFIG_NETDEVICES=y |
| @@ -65,16 +62,18 @@ CONFIG_SERIAL_AMBA_PL011=y · 19 unmodified lines | ||
| 65 | 62 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
| 66 | 63 | CONFIG_HW_RANDOM=y |
| 67 | 64 | CONFIG_HW_RANDOM_NOMADIK=y |
| 68 | −CONFIG_I2C=y | |
| 69 | −CONFIG_I2C_NOMADIK=y | |
| 70 | 65 | CONFIG_SPI=y |
| 71 | 66 | CONFIG_SPI_PL022=y |
| 72 | 67 | CONFIG_GPIO_STMPE=y |
| 73 | 68 | CONFIG_GPIO_TC3589X=y |
| 69 | +CONFIG_POWER_SUPPLY=y | |
| 70 | +CONFIG_AB8500_BM=y | |
| 71 | +CONFIG_AB8500_BATTERY_THERM_ON_BATCTRL=y | |
| 74 | 72 | CONFIG_MFD_STMPE=y |
| 75 | 73 | CONFIG_MFD_TC3589X=y |
| 76 | 74 | CONFIG_AB5500_CORE=y |
| 77 | 75 | CONFIG_AB8500_CORE=y |
| 76 | +CONFIG_REGULATOR=y | |
| 78 | 77 | CONFIG_REGULATOR_AB8500=y |
| 79 | 78 | # CONFIG_HID_SUPPORT is not set |
| 80 | 79 | CONFIG_USB_GADGET=y |
| @@ -0,0 +1,19 @@ | ||
| 1 | +#ifndef __ASMARM_ARCH_TIMER_H | |
| 2 | +#define __ASMARM_ARCH_TIMER_H | |
| 3 | + | |
| 4 | +#ifdef CONFIG_ARM_ARCH_TIMER | |
| 5 | +int arch_timer_of_register(void); | |
| 6 | +int arch_timer_sched_clock_init(void); | |
| 7 | +#else | |
| 8 | +static inline int arch_timer_of_register(void) | |
| 9 | +{ | |
| 10 | + return -ENXIO; | |
| 11 | +} | |
| 12 | + | |
| 13 | +static inline int arch_timer_sched_clock_init(void) | |
| 14 | +{ | |
| 15 | + return -ENXIO; | |
| 16 | +} | |
| 17 | +#endif | |
| 18 | + | |
| 19 | +#endif | |
| @@ -110,6 +110,6 @@ extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc); · 109 unmodified lines | ||
| 110 | 110 | extern void it8152_init_irq(void); |
| 111 | 111 | extern int it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); |
| 112 | 112 | extern int it8152_pci_setup(int nr, struct pci_sys_data *sys); |
| 113 | −extern struct pci_bus *it8152_pci_scan_bus(int nr, struct pci_sys_data *sys); | |
| 113 | +extern struct pci_ops it8152_ops; | |
| 114 | 114 | |
| 115 | 115 | #endif /* __ASM_HARDWARE_IT8152_H */ |
| @@ -12,13 +12,14 @@ · 11 unmodified lines | ||
| 12 | 12 | #define __ASM_MACH_PCI_H |
| 13 | 13 | |
| 14 | 14 | struct pci_sys_data; |
| 15 | +struct pci_ops; | |
| 15 | 16 | struct pci_bus; |
| 16 | 17 | |
| 17 | 18 | struct hw_pci { |
| 18 | 19 | #ifdef CONFIG_PCI_DOMAINS |
| 19 | 20 | int domain; |
| 20 | 21 | #endif |
| 21 | − struct list_head buses; | |
| 22 | + struct pci_ops *ops; | |
| 22 | 23 | int nr_controllers; |
| 23 | 24 | int (*setup)(int nr, struct pci_sys_data *); |
| 24 | 25 | struct pci_bus *(*scan)(int nr, struct pci_sys_data *); |
| @@ -45,15 +46,9 @@ struct pci_sys_data { · 20 unmodified lines | ||
| 45 | 46 | u8 (*swizzle)(struct pci_dev *, u8 *); |
| 46 | 47 | /* IRQ mapping */ |
| 47 | 48 | int (*map_irq)(const struct pci_dev *, u8, u8); |
| 48 | − struct hw_pci *hw; | |
| 49 | 49 | void *private_data; /* platform controller private data */ |
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | −/* | |
| 53 | − * This is the standard PCI-PCI bridge swizzling algorithm. | |
| 54 | − */ | |
| 55 | −#define pci_std_swizzle pci_common_swizzle | |
| 56 | − | |
| 57 | 52 | /* |
| 58 | 53 | * Call this with your hw_pci struct to initialise the PCI system. |
| 59 | 54 | */ |
| @@ -62,22 +57,22 @@ void pci_common_init(struct hw_pci *); · 2 unmodified lines | ||
| 62 | 57 | /* |
| 63 | 58 | * PCI controllers |
| 64 | 59 | */ |
| 60 | +extern struct pci_ops iop3xx_ops; | |
| 65 | 61 | extern int iop3xx_pci_setup(int nr, struct pci_sys_data *); |
| 66 | −extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *); | |
| 67 | 62 | extern void iop3xx_pci_preinit(void); |
| 68 | 63 | extern void iop3xx_pci_preinit_cond(void); |
| 69 | 64 | |
| 65 | +extern struct pci_ops dc21285_ops; | |
| 70 | 66 | extern int dc21285_setup(int nr, struct pci_sys_data *); |
| 71 | −extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *); | |
| 72 | 67 | extern void dc21285_preinit(void); |
| 73 | 68 | extern void dc21285_postinit(void); |
| 74 | 69 | |
| 70 | +extern struct pci_ops via82c505_ops; | |
| 75 | 71 | extern int via82c505_setup(int nr, struct pci_sys_data *); |
| 76 | −extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *); | |
| 77 | 72 | extern void via82c505_init(void *sysdata); |
| 78 | 73 | |
| 74 | +extern struct pci_ops pci_v3_ops; | |
| 79 | 75 | extern int pci_v3_setup(int nr, struct pci_sys_data *); |
| 80 | −extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *); | |
| 81 | 76 | extern void pci_v3_preinit(void); |
| 82 | 77 | extern void pci_v3_postinit(void); |
| 83 | 78 | |
| @@ -34,11 +34,4 @@ typedef struct { · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | #endif |
| 36 | 36 | |
| 37 | −/* | |
| 38 | − * switch_mm() may do a full cache flush over the context switch, | |
| 39 | − * so enable interrupts over the context switch to avoid high | |
| 40 | − * latency. | |
| 41 | − */ | |
| 42 | −#define __ARCH_WANT_INTERRUPTS_ON_CTXSW | |
| 43 | − | |
| 44 | 37 | #endif |
| @@ -43,45 +43,104 @@ void __check_kvm_seq(struct mm_struct *mm); · 42 unmodified lines | ||
| 43 | 43 | #define ASID_FIRST_VERSION (1 << ASID_BITS) |
| 44 | 44 | |
| 45 | 45 | extern unsigned int cpu_last_asid; |
| 46 | −#ifdef CONFIG_SMP | |
| 47 | −DECLARE_PER_CPU(struct mm_struct *, current_mm); | |
| 48 | −#endif | |
| 49 | 46 | |
| 50 | 47 | void __init_new_context(struct task_struct *tsk, struct mm_struct *mm); |
| 51 | 48 | void __new_context(struct mm_struct *mm); |
| 49 | +void cpu_set_reserved_ttbr0(void); | |
| 52 | 50 | |
| 53 | −static inline void check_context(struct mm_struct *mm) | |
| 51 | +static inline void switch_new_context(struct mm_struct *mm) | |
| 54 | 52 | { |
| 55 | − /* | |
| 56 | − * This code is executed with interrupts enabled. Therefore, | |
| 57 | − * mm->context.id cannot be updated to the latest ASID version | |
| 58 | − * on a different CPU (and condition below not triggered) | |
| 59 | − * without first getting an IPI to reset the context. The | |
| 60 | − * alternative is to take a read_lock on mm->context.id_lock | |
| 61 | − * (after changing its type to rwlock_t). | |
| 62 | − */ | |
| 63 | − if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) | |
| 64 | − __new_context(mm); | |
| 53 | + unsigned long flags; | |
| 54 | + | |
| 55 | + __new_context(mm); | |
| 56 | + | |
| 57 | + local_irq_save(flags); | |
| 58 | + cpu_switch_mm(mm->pgd, mm); | |
| 59 | + local_irq_restore(flags); | |
| 60 | +} | |
| 65 | 61 | |
| 62 | +static inline void check_and_switch_context(struct mm_struct *mm, | |
| 63 | + struct task_struct *tsk) | |
| 64 | +{ | |
| 66 | 65 | if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) |
| 67 | 66 | __check_kvm_seq(mm); |
| 67 | + | |
| 68 | + /* | |
| 69 | + * Required during context switch to avoid speculative page table | |
| 70 | + * walking with the wrong TTBR. | |
| 71 | + */ | |
| 72 | + cpu_set_reserved_ttbr0(); | |
| 73 | + | |
| 74 | + if (!((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) | |
| 75 | + /* | |
| 76 | + * The ASID is from the current generation, just switch to the | |
| 77 | + * new pgd. This condition is only true for calls from | |
| 78 | + * context_switch() and interrupts are already disabled. | |
| 79 | + */ | |
| 80 | + cpu_switch_mm(mm->pgd, mm); | |
| 81 | + else if (irqs_disabled()) | |
| 82 | + /* | |
| 83 | + * Defer the new ASID allocation until after the context | |
| 84 | + * switch critical region since __new_context() cannot be | |
| 85 | + * called with interrupts disabled (it sends IPIs). | |
| 86 | + */ | |
| 87 | + set_ti_thread_flag(task_thread_info(tsk), TIF_SWITCH_MM); | |
| 88 | + else | |
| 89 | + /* | |
| 90 | + * That is a direct call to switch_mm() or activate_mm() with | |
| 91 | + * interrupts enabled and a new context. | |
| 92 | + */ | |
| 93 | + switch_new_context(mm); | |
| 68 | 94 | } |
| 69 | 95 | |
| 70 | 96 | #define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0) |
| 71 | 97 | |
| 72 | −#else | |
| 73 | − | |
| 74 | −static inline void check_context(struct mm_struct *mm) | |
| 98 | +#define finish_arch_post_lock_switch \ | |
| 99 | + finish_arch_post_lock_switch | |
| 100 | +static inline void finish_arch_post_lock_switch(void) | |
| 75 | 101 | { |
| 102 | + if (test_and_clear_thread_flag(TIF_SWITCH_MM)) | |
| 103 | + switch_new_context(current->mm); | |
| 104 | +} | |
| 105 | + | |
| 106 | +#else /* !CONFIG_CPU_HAS_ASID */ | |
| 107 | + | |
| 76 | 108 | #ifdef CONFIG_MMU |
| 109 | + | |
| 110 | +static inline void check_and_switch_context(struct mm_struct *mm, | |
| 111 | + struct task_struct *tsk) | |
| 112 | +{ | |
| 77 | 113 | if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) |
| 78 | 114 | __check_kvm_seq(mm); |
| 79 | −#endif | |
| 115 | + | |
| 116 | + if (irqs_disabled()) | |
| 117 | + /* | |
| 118 | + * cpu_switch_mm() needs to flush the VIVT caches. To avoid | |
| 119 | + * high interrupt latencies, defer the call and continue | |
| 120 | + * running with the old mm. Since we only support UP systems | |
| 121 | + * on non-ASID CPUs, the old mm will remain valid until the | |
| 122 | + * finish_arch_post_lock_switch() call. | |
| 123 | + */ | |
| 124 | + set_ti_thread_flag(task_thread_info(tsk), TIF_SWITCH_MM); | |
| 125 | + else | |
| 126 | + cpu_switch_mm(mm->pgd, mm); | |
| 80 | 127 | } |
| 81 | 128 | |
| 129 | +#define finish_arch_post_lock_switch \ | |
| 130 | + finish_arch_post_lock_switch | |
| 131 | +static inline void finish_arch_post_lock_switch(void) | |
| 132 | +{ | |
| 133 | + if (test_and_clear_thread_flag(TIF_SWITCH_MM)) { | |
| 134 | + struct mm_struct *mm = current->mm; | |
| 135 | + cpu_switch_mm(mm->pgd, mm); | |
| 136 | + } | |
| 137 | +} | |
| 138 | + | |
| 139 | +#endif /* CONFIG_MMU */ | |
| 140 | + | |
| 82 | 141 | #define init_new_context(tsk,mm) 0 |
| 83 | 142 | |
| 84 | −#endif | |
| 143 | +#endif /* CONFIG_CPU_HAS_ASID */ | |
| 85 | 144 | |
| 86 | 145 | #define destroy_context(mm) do { } while(0) |
| 87 | 146 | |
| @@ -119,12 +178,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, · 31 unmodified lines | ||
| 119 | 178 | __flush_icache_all(); |
| 120 | 179 | #endif |
| 121 | 180 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next) { |
| 122 | −#ifdef CONFIG_SMP | |
| 123 | − struct mm_struct **crt_mm = &per_cpu(current_mm, cpu); | |
| 124 | − *crt_mm = next; | |
| 125 | −#endif | |
| 126 | − check_context(next); | |
| 127 | − cpu_switch_mm(next->pgd, next); | |
| 181 | + check_and_switch_context(next, tsk); | |
| 128 | 182 | if (cache_is_vivt()) |
| 129 | 183 | cpumask_clear_cpu(cpu, mm_cpumask(prev)); |
| 130 | 184 | } |
| @@ -118,6 +118,13 @@ extern void iwmmxt_task_switch(struct thread_info *); · 117 unmodified lines | ||
| 118 | 118 | extern void vfp_sync_hwstate(struct thread_info *); |
| 119 | 119 | extern void vfp_flush_hwstate(struct thread_info *); |
| 120 | 120 | |
| 121 | +struct user_vfp; | |
| 122 | +struct user_vfp_exc; | |
| 123 | + | |
| 124 | +extern int vfp_preserve_user_clear_hwstate(struct user_vfp __user *, | |
| 125 | + struct user_vfp_exc __user *); | |
| 126 | +extern int vfp_restore_user_hwstate(struct user_vfp __user *, | |
| 127 | + struct user_vfp_exc __user *); | |
| 121 | 128 | #endif |
| 122 | 129 | |
| 123 | 130 | /* |
| @@ -146,6 +153,7 @@ extern void vfp_flush_hwstate(struct thread_info *); · 22 unmodified lines | ||
| 146 | 153 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
| 147 | 154 | #define TIF_RESTORE_SIGMASK 20 |
| 148 | 155 | #define TIF_SECCOMP 21 |
| 156 | +#define TIF_SWITCH_MM 22 /* deferred switch_mm */ | |
| 149 | 157 | |
| 150 | 158 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
| 151 | 159 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
| @@ -7,6 +7,8 @@ · 6 unmodified lines | ||
| 7 | 7 | |
| 8 | 8 | .macro set_tls_v6k, tp, tmp1, tmp2 |
| 9 | 9 | mcr p15, 0, \tp, c13, c0, 3 @ set TLS register |
| 10 | + mov \tmp1, #0 | |
| 11 | + mcr p15, 0, \tmp1, c13, c0, 2 @ clear user r/w TLS register | |
| 10 | 12 | .endm |
| 11 | 13 | |
| 12 | 14 | .macro set_tls_v6, tp, tmp1, tmp2 |
| @@ -15,6 +17,8 @@ · 2 unmodified lines | ||
| 15 | 17 | mov \tmp2, #0xffff0fff |
| 16 | 18 | tst \tmp1, #HWCAP_TLS @ hardware TLS available? |
| 17 | 19 | mcrne p15, 0, \tp, c13, c0, 3 @ yes, set TLS register |
| 20 | + movne \tmp1, #0 | |
| 21 | + mcrne p15, 0, \tmp1, c13, c0, 2 @ clear user r/w TLS register | |
| 18 | 22 | streq \tp, [\tmp2, #-15] @ set TLS value at 0xffff0ff0 |
| 19 | 23 | .endm |
| 20 | 24 | |
| @@ -34,6 +34,7 @@ obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o · 33 unmodified lines | ||
| 34 | 34 | obj-$(CONFIG_SMP) += smp.o smp_tlb.o |
| 35 | 35 | obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o |
| 36 | 36 | obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o |
| 37 | +obj-$(CONFIG_ARM_ARCH_TIMER) += arch_timer.o | |
| 37 | 38 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o |
| 38 | 39 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o |
| 39 | 40 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o |
| @@ -0,0 +1,350 @@ | ||
| 1 | +/* | |
| 2 | + * linux/arch/arm/kernel/arch_timer.c | |
| 3 | + * | |
| 4 | + * Copyright (C) 2011 ARM Ltd. | |
| 5 | + * All Rights Reserved | |
| 6 | + * | |
| 7 | + * This program is free software; you can redistribute it and/or modify | |
| 8 | + * it under the terms of the GNU General Public License version 2 as | |
| 9 | + * published by the Free Software Foundation. | |
| 10 | + */ | |
| 11 | +#include <linux/init.h> | |
| 12 | +#include <linux/kernel.h> | |
| 13 | +#include <linux/delay.h> | |
| 14 | +#include <linux/device.h> | |
| 15 | +#include <linux/smp.h> | |
| 16 | +#include <linux/cpu.h> | |
| 17 | +#include <linux/jiffies.h> | |
| 18 | +#include <linux/clockchips.h> | |
| 19 | +#include <linux/interrupt.h> | |
| 20 | +#include <linux/of_irq.h> | |
| 21 | +#include <linux/io.h> | |
| 22 | + | |
| 23 | +#include <asm/cputype.h> | |
| 24 | +#include <asm/localtimer.h> | |
| 25 | +#include <asm/arch_timer.h> | |
| 26 | +#include <asm/system_info.h> | |
| 27 | +#include <asm/sched_clock.h> | |
| 28 | + | |
| 29 | +static unsigned long arch_timer_rate; | |
| 30 | +static int arch_timer_ppi; | |
| 31 | +static int arch_timer_ppi2; | |
| 32 | + | |
| 33 | +static struct clock_event_device __percpu **arch_timer_evt; | |
| 34 | + | |
| 35 | +/* | |
| 36 | + * Architected system timer support. | |
| 37 | + */ | |
| 38 | + | |
| 39 | +#define ARCH_TIMER_CTRL_ENABLE (1 << 0) | |
| 40 | +#define ARCH_TIMER_CTRL_IT_MASK (1 << 1) | |
| 41 | +#define ARCH_TIMER_CTRL_IT_STAT (1 << 2) | |
| 42 | + | |
| 43 | +#define ARCH_TIMER_REG_CTRL 0 | |
| 44 | +#define ARCH_TIMER_REG_FREQ 1 | |
| 45 | +#define ARCH_TIMER_REG_TVAL 2 | |
| 46 | + | |
| 47 | +static void arch_timer_reg_write(int reg, u32 val) | |
| 48 | +{ | |
| 49 | + switch (reg) { | |
| 50 | + case ARCH_TIMER_REG_CTRL: | |
| 51 | + asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val)); | |
| 52 | + break; | |
| 53 | + case ARCH_TIMER_REG_TVAL: | |
| 54 | + asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); | |
| 55 | + break; | |
| 56 | + } | |
| 57 | + | |
| 58 | + isb(); | |
| 59 | +} | |
| 60 | + | |
| 61 | +static u32 arch_timer_reg_read(int reg) | |
| 62 | +{ | |
| 63 | + u32 val; | |
| 64 | + | |
| 65 | + switch (reg) { | |
| 66 | + case ARCH_TIMER_REG_CTRL: | |
| 67 | + asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); | |
| 68 | + break; | |
| 69 | + case ARCH_TIMER_REG_FREQ: | |
| 70 | + asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); | |
| 71 | + break; | |
| 72 | + case ARCH_TIMER_REG_TVAL: | |
| 73 | + asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); | |
| 74 | + break; | |
| 75 | + default: | |
| 76 | + BUG(); | |
| 77 | + } | |
| 78 | + | |
| 79 | + return val; | |
| 80 | +} | |
| 81 | + | |
| 82 | +static irqreturn_t arch_timer_handler(int irq, void *dev_id) | |
| 83 | +{ | |
| 84 | + struct clock_event_device *evt = *(struct clock_event_device **)dev_id; | |
| 85 | + unsigned long ctrl; | |
| 86 | + | |
| 87 | + ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); | |
| 88 | + if (ctrl & ARCH_TIMER_CTRL_IT_STAT) { | |
| 89 | + ctrl |= ARCH_TIMER_CTRL_IT_MASK; | |
| 90 | + arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); | |
| 91 | + evt->event_handler(evt); | |
| 92 | + return IRQ_HANDLED; | |
| 93 | + } | |
| 94 | + | |
| 95 | + return IRQ_NONE; | |
| 96 | +} | |
| 97 | + | |
| 98 | +static void arch_timer_disable(void) | |
| 99 | +{ | |
| 100 | + unsigned long ctrl; | |
| 101 | + | |
| 102 | + ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); | |
| 103 | + ctrl &= ~ARCH_TIMER_CTRL_ENABLE; | |
| 104 | + arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); | |
| 105 | +} | |
| 106 | + | |
| 107 | +static void arch_timer_set_mode(enum clock_event_mode mode, | |
| 108 | + struct clock_event_device *clk) | |
| 109 | +{ | |
| 110 | + switch (mode) { | |
| 111 | + case CLOCK_EVT_MODE_UNUSED: | |
| 112 | + case CLOCK_EVT_MODE_SHUTDOWN: | |
| 113 | + arch_timer_disable(); | |
| 114 | + break; | |
| 115 | + default: | |
| 116 | + break; | |
| 117 | + } | |
| 118 | +} | |
| 119 | + | |
| 120 | +static int arch_timer_set_next_event(unsigned long evt, | |
| 121 | + struct clock_event_device *unused) | |
| 122 | +{ | |
| 123 | + unsigned long ctrl; | |
| 124 | + | |
| 125 | + ctrl = arch_timer_reg_read(ARCH_TIMER_REG_CTRL); | |
| 126 | + ctrl |= ARCH_TIMER_CTRL_ENABLE; | |
| 127 | + ctrl &= ~ARCH_TIMER_CTRL_IT_MASK; | |
| 128 | + | |
| 129 | + arch_timer_reg_write(ARCH_TIMER_REG_TVAL, evt); | |
| 130 | + arch_timer_reg_write(ARCH_TIMER_REG_CTRL, ctrl); | |
| 131 | + | |
| 132 | + return 0; | |
| 133 | +} | |
| 134 | + | |
| 135 | +static int __cpuinit arch_timer_setup(struct clock_event_device *clk) | |
| 136 | +{ | |
| 137 | + /* Be safe... */ | |
| 138 | + arch_timer_disable(); | |
| 139 | + | |
| 140 | + clk->features = CLOCK_EVT_FEAT_ONESHOT; | |
| 141 | + clk->name = "arch_sys_timer"; | |
| 142 | + clk->rating = 450; | |
| 143 | + clk->set_mode = arch_timer_set_mode; | |
| 144 | + clk->set_next_event = arch_timer_set_next_event; | |
| 145 | + clk->irq = arch_timer_ppi; | |
| 146 | + | |
| 147 | + clockevents_config_and_register(clk, arch_timer_rate, | |
| 148 | + 0xf, 0x7fffffff); | |
| 149 | + | |
| 150 | + *__this_cpu_ptr(arch_timer_evt) = clk; | |
| 151 | + | |
| 152 | + enable_percpu_irq(clk->irq, 0); | |
| 153 | + if (arch_timer_ppi2) | |
| 154 | + enable_percpu_irq(arch_timer_ppi2, 0); | |
| 155 | + | |
| 156 | + return 0; | |
| 157 | +} | |
| 158 | + | |
| 159 | +/* Is the optional system timer available? */ | |
| 160 | +static int local_timer_is_architected(void) | |
| 161 | +{ | |
| 162 | + return (cpu_architecture() >= CPU_ARCH_ARMv7) && | |
| 163 | + ((read_cpuid_ext(CPUID_EXT_PFR1) >> 16) & 0xf) == 1; | |
| 164 | +} | |
| 165 | + | |
| 166 | +static int arch_timer_available(void) | |
| 167 | +{ | |
| 168 | + unsigned long freq; | |
| 169 | + | |
| 170 | + if (!local_timer_is_architected()) | |
| 171 | + return -ENXIO; | |
| 172 | + | |
| 173 | + if (arch_timer_rate == 0) { | |
| 174 | + arch_timer_reg_write(ARCH_TIMER_REG_CTRL, 0); | |
| 175 | + freq = arch_timer_reg_read(ARCH_TIMER_REG_FREQ); | |
| 176 | + | |
| 177 | + /* Check the timer frequency. */ | |
| 178 | + if (freq == 0) { | |
| 179 | + pr_warn("Architected timer frequency not available\n"); | |
| 180 | + return -EINVAL; | |
| 181 | + } | |
| 182 | + | |
| 183 | + arch_timer_rate = freq; | |
| 184 | + } | |
| 185 | + | |
| 186 | + pr_info_once("Architected local timer running at %lu.%02luMHz.\n", | |
| 187 | + arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100); | |
| 188 | + return 0; | |
| 189 | +} | |
| 190 | + | |
| 191 | +static inline cycle_t arch_counter_get_cntpct(void) | |
| 192 | +{ | |
| 193 | + u32 cvall, cvalh; | |
| 194 | + | |
| 195 | + asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (cvall), "=r" (cvalh)); | |
| 196 | + | |
| 197 | + return ((cycle_t) cvalh << 32) | cvall; | |
| 198 | +} | |
| 199 | + | |
| 200 | +static inline cycle_t arch_counter_get_cntvct(void) | |
| 201 | +{ | |
| 202 | + u32 cvall, cvalh; | |
| 203 | + | |
| 204 | + asm volatile("mrrc p15, 1, %0, %1, c14" : "=r" (cvall), "=r" (cvalh)); | |
| 205 | + | |
| 206 | + return ((cycle_t) cvalh << 32) | cvall; | |
| 207 | +} | |
| 208 | + | |
| 209 | +static u32 notrace arch_counter_get_cntvct32(void) | |
| 210 | +{ | |
| 211 | + cycle_t cntvct = arch_counter_get_cntvct(); | |
| 212 | + | |
| 213 | + /* | |
| 214 | + * The sched_clock infrastructure only knows about counters | |
| 215 | + * with at most 32bits. Forget about the upper 24 bits for the | |
| 216 | + * time being... | |
| 217 | + */ | |
| 218 | + return (u32)(cntvct & (u32)~0); | |
| 219 | +} | |
| 220 | + | |
| 221 | +static cycle_t arch_counter_read(struct clocksource *cs) | |
| 222 | +{ | |
| 223 | + return arch_counter_get_cntpct(); | |
| 224 | +} | |
| 225 | + | |
| 226 | +static struct clocksource clocksource_counter = { | |
| 227 | + .name = "arch_sys_counter", | |
| 228 | + .rating = 400, | |
| 229 | + .read = arch_counter_read, | |
| 230 | + .mask = CLOCKSOURCE_MASK(56), | |
| 231 | + .flags = CLOCK_SOURCE_IS_CONTINUOUS, | |
| 232 | +}; | |
| 233 | + | |
| 234 | +static void __cpuinit arch_timer_stop(struct clock_event_device *clk) | |
| 235 | +{ | |
| 236 | + pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n", | |
| 237 | + clk->irq, smp_processor_id()); | |
| 238 | + disable_percpu_irq(clk->irq); | |
| 239 | + if (arch_timer_ppi2) | |
| 240 | + disable_percpu_irq(arch_timer_ppi2); | |
| 241 | + arch_timer_set_mode(CLOCK_EVT_MODE_UNUSED, clk); | |
| 242 | +} | |
| 243 | + | |
| 244 | +static struct local_timer_ops arch_timer_ops __cpuinitdata = { | |
| 245 | + .setup = arch_timer_setup, | |
| 246 | + .stop = arch_timer_stop, | |
| 247 | +}; | |
| 248 | + | |
| 249 | +static struct clock_event_device arch_timer_global_evt; | |
| 250 | + | |
| 251 | +static int __init arch_timer_register(void) | |
| 252 | +{ | |
| 253 | + int err; | |
| 254 | + | |
| 255 | + err = arch_timer_available(); | |
| 256 | + if (err) | |
| 257 | + return err; | |
| 258 | + | |
| 259 | + arch_timer_evt = alloc_percpu(struct clock_event_device *); | |
| 260 | + if (!arch_timer_evt) | |
| 261 | + return -ENOMEM; | |
| 262 | + | |
| 263 | + clocksource_register_hz(&clocksource_counter, arch_timer_rate); | |
| 264 | + | |
| 265 | + err = request_percpu_irq(arch_timer_ppi, arch_timer_handler, | |
| 266 | + "arch_timer", arch_timer_evt); | |
| 267 | + if (err) { | |
| 268 | + pr_err("arch_timer: can't register interrupt %d (%d)\n", | |
| 269 | + arch_timer_ppi, err); | |
| 270 | + goto out_free; | |
| 271 | + } | |
| 272 | + | |
| 273 | + if (arch_timer_ppi2) { | |
| 274 | + err = request_percpu_irq(arch_timer_ppi2, arch_timer_handler, | |
| 275 | + "arch_timer", arch_timer_evt); | |
| 276 | + if (err) { | |
| 277 | + pr_err("arch_timer: can't register interrupt %d (%d)\n", | |
| 278 | + arch_timer_ppi2, err); | |
| 279 | + arch_timer_ppi2 = 0; | |
| 280 | + goto out_free_irq; | |
| 281 | + } | |
| 282 | + } | |
| 283 | + | |
| 284 | + err = local_timer_register(&arch_timer_ops); | |
| 285 | + if (err) { | |
| 286 | + /* | |
| 287 | + * We couldn't register as a local timer (could be | |
| 288 | + * because we're on a UP platform, or because some | |
| 289 | + * other local timer is already present...). Try as a | |
| 290 | + * global timer instead. | |
| 291 | + */ | |
| 292 | + arch_timer_global_evt.cpumask = cpumask_of(0); | |
| 293 | + err = arch_timer_setup(&arch_timer_global_evt); | |
| 294 | + } | |
| 295 | + | |
| 296 | + if (err) | |
| 297 | + goto out_free_irq; | |
| 298 | + | |
| 299 | + return 0; | |
| 300 | + | |
| 301 | +out_free_irq: | |
| 302 | + free_percpu_irq(arch_timer_ppi, arch_timer_evt); | |
| 303 | + if (arch_timer_ppi2) | |
| 304 | + free_percpu_irq(arch_timer_ppi2, arch_timer_evt); | |
| 305 | + | |
| 306 | +out_free: | |
| 307 | + free_percpu(arch_timer_evt); | |
| 308 | + | |
| 309 | + return err; | |
| 310 | +} | |
| 311 | + | |
| 312 | +static const struct of_device_id arch_timer_of_match[] __initconst = { | |
| 313 | + { .compatible = "arm,armv7-timer", }, | |
| 314 | + {}, | |
| 315 | +}; | |
| 316 | + | |
| 317 | +int __init arch_timer_of_register(void) | |
| 318 | +{ | |
| 319 | + struct device_node *np; | |
| 320 | + u32 freq; | |
| 321 | + | |
| 322 | + np = of_find_matching_node(NULL, arch_timer_of_match); | |
| 323 | + if (!np) { | |
| 324 | + pr_err("arch_timer: can't find DT node\n"); | |
| 325 | + return -ENODEV; | |
| 326 | + } | |
| 327 | + | |
| 328 | + /* Try to determine the frequency from the device tree or CNTFRQ */ | |
| 329 | + if (!of_property_read_u32(np, "clock-frequency", &freq)) | |
| 330 | + arch_timer_rate = freq; | |
| 331 | + | |
| 332 | + arch_timer_ppi = irq_of_parse_and_map(np, 0); | |
| 333 | + arch_timer_ppi2 = irq_of_parse_and_map(np, 1); | |
| 334 | + pr_info("arch_timer: found %s irqs %d %d\n", | |
| 335 | + np->name, arch_timer_ppi, arch_timer_ppi2); | |
| 336 | + | |
| 337 | + return arch_timer_register(); | |
| 338 | +} | |
| 339 | + | |
| 340 | +int __init arch_timer_sched_clock_init(void) | |
| 341 | +{ | |
| 342 | + int err; | |
| 343 | + | |
| 344 | + err = arch_timer_available(); | |
| 345 | + if (err) | |
| 346 | + return err; | |
| 347 | + | |
| 348 | + setup_sched_clock(arch_counter_get_cntvct32, 32, arch_timer_rate); | |
| 349 | + return 0; | |
| 350 | +} | |
| @@ -374,16 +374,29 @@ EXPORT_SYMBOL(pcibios_fixup_bus); · 373 unmodified lines | ||
| 374 | 374 | #endif |
| 375 | 375 | |
| 376 | 376 | /* |
| 377 | − * Swizzle the device pin each time we cross a bridge. | |
| 378 | − * This might update pin and returns the slot number. | |
| 377 | + * Swizzle the device pin each time we cross a bridge. If a platform does | |
| 378 | + * not provide a swizzle function, we perform the standard PCI swizzling. | |
| 379 | + * | |
| 380 | + * The default swizzling walks up the bus tree one level at a time, applying | |
| 381 | + * the standard swizzle function at each step, stopping when it finds the PCI | |
| 382 | + * root bus. This will return the slot number of the bridge device on the | |
| 383 | + * root bus and the interrupt pin on that device which should correspond | |
| 384 | + * with the downstream device interrupt. | |
| 385 | + * | |
| 386 | + * Platforms may override this, in which case the slot and pin returned | |
| 387 | + * depend entirely on the platform code. However, please note that the | |
| 388 | + * PCI standard swizzle is implemented on plug-in cards and Cardbus based | |
| 389 | + * PCI extenders, so it can not be ignored. | |
| 379 | 390 | */ |
| 380 | 391 | static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin) |
| 381 | 392 | { |
| 382 | 393 | struct pci_sys_data *sys = dev->sysdata; |
| 383 | − int slot = 0, oldpin = *pin; | |
| 394 | + int slot, oldpin = *pin; | |
| 384 | 395 | |
| 385 | 396 | if (sys->swizzle) |
| 386 | 397 | slot = sys->swizzle(dev, pin); |
| 398 | + else | |
| 399 | + slot = pci_common_swizzle(dev, pin); | |
| 387 | 400 | |
| 388 | 401 | if (debug_pci) |
| 389 | 402 | printk("PCI: %s swizzling pin %d => pin %d slot %d\n", |
| @@ -410,7 +423,7 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 20 unmodified lines | ||
| 410 | 423 | return irq; |
| 411 | 424 | } |
| 412 | 425 | |
| 413 | −static void __init pcibios_init_hw(struct hw_pci *hw) | |
| 426 | +static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) | |
| 414 | 427 | { |
| 415 | 428 | struct pci_sys_data *sys = NULL; |
| 416 | 429 | int ret; |
| @@ -424,7 +437,6 @@ static void __init pcibios_init_hw(struct hw_pci *hw) · 7 unmodified lines | ||
| 424 | 437 | #ifdef CONFIG_PCI_DOMAINS |
| 425 | 438 | sys->domain = hw->domain; |
| 426 | 439 | #endif |
| 427 | − sys->hw = hw; | |
| 428 | 440 | sys->busnr = busnr; |
| 429 | 441 | sys->swizzle = hw->swizzle; |
| 430 | 442 | sys->map_irq = hw->map_irq; |
| @@ -440,14 +452,18 @@ static void __init pcibios_init_hw(struct hw_pci *hw) · 9 unmodified lines | ||
| 440 | 452 | &iomem_resource, sys->mem_offset); |
| 441 | 453 | } |
| 442 | 454 | |
| 443 | − sys->bus = hw->scan(nr, sys); | |
| 455 | + if (hw->scan) | |
| 456 | + sys->bus = hw->scan(nr, sys); | |
| 457 | + else | |
| 458 | + sys->bus = pci_scan_root_bus(NULL, sys->busnr, | |
| 459 | + hw->ops, sys, &sys->resources); | |
| 444 | 460 | |
| 445 | 461 | if (!sys->bus) |
| 446 | 462 | panic("PCI: unable to scan bus!"); |
| 447 | 463 | |
| 448 | 464 | busnr = sys->bus->subordinate + 1; |
| 449 | 465 | |
| 450 | − list_add(&sys->node, &hw->buses); | |
| 466 | + list_add(&sys->node, head); | |
| 451 | 467 | } else { |
| 452 | 468 | kfree(sys); |
| 453 | 469 | if (ret < 0) |
| @@ -459,19 +475,18 @@ static void __init pcibios_init_hw(struct hw_pci *hw) · 5 unmodified lines | ||
| 459 | 475 | void __init pci_common_init(struct hw_pci *hw) |
| 460 | 476 | { |
| 461 | 477 | struct pci_sys_data *sys; |
| 462 | − | |
| 463 | − INIT_LIST_HEAD(&hw->buses); | |
| 478 | + LIST_HEAD(head); | |
| 464 | 479 | |
| 465 | 480 | pci_add_flags(PCI_REASSIGN_ALL_RSRC); |
| 466 | 481 | if (hw->preinit) |
| 467 | 482 | hw->preinit(); |
| 468 | − pcibios_init_hw(hw); | |
| 483 | + pcibios_init_hw(hw, &head); | |
| 469 | 484 | if (hw->postinit) |
| 470 | 485 | hw->postinit(); |
| 471 | 486 | |
| 472 | 487 | pci_fixup_irqs(pcibios_swizzle, pcibios_map_irq); |
| 473 | 488 | |
| 474 | − list_for_each_entry(sys, &hw->buses, node) { | |
| 489 | + list_for_each_entry(sys, &head, node) { | |
| 475 | 490 | struct pci_bus *bus = sys->bus; |
| 476 | 491 | |
| 477 | 492 | if (!pci_has_flag(PCI_PROBE_ONLY)) { |
| @@ -155,10 +155,10 @@ static bool migrate_one_irq(struct irq_desc *desc) · 154 unmodified lines | ||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | c = irq_data_get_irq_chip(d); |
| 158 | − if (c->irq_set_affinity) | |
| 159 | − c->irq_set_affinity(d, affinity, true); | |
| 160 | − else | |
| 158 | + if (!c->irq_set_affinity) | |
| 161 | 159 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); |
| 160 | + else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret) | |
| 161 | + cpumask_copy(d->affinity, affinity); | |
| 162 | 162 | |
| 163 | 163 | return ret; |
| 164 | 164 | } |
| @@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request, · 905 unmodified lines | ||
| 906 | 906 | return ret; |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | −#ifdef __ARMEB__ | |
| 910 | −#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB | |
| 911 | −#else | |
| 912 | −#define AUDIT_ARCH_NR AUDIT_ARCH_ARM | |
| 913 | −#endif | |
| 914 | − | |
| 915 | 909 | asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) |
| 916 | 910 | { |
| 917 | 911 | unsigned long ip; |
| 918 | 912 | |
| 919 | − /* | |
| 920 | − * Save IP. IP is used to denote syscall entry/exit: | |
| 921 | − * IP = 0 -> entry, = 1 -> exit | |
| 922 | − */ | |
| 923 | − ip = regs->ARM_ip; | |
| 924 | − regs->ARM_ip = why; | |
| 925 | − | |
| 926 | − if (!ip) | |
| 913 | + if (why) | |
| 927 | 914 | audit_syscall_exit(regs); |
| 928 | 915 | else |
| 929 | − audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, | |
| 916 | + audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, | |
| 930 | 917 | regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); |
| 931 | 918 | |
| 932 | 919 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
| @@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) · 3 unmodified lines | ||
| 936 | 923 | |
| 937 | 924 | current_thread_info()->syscall = scno; |
| 938 | 925 | |
| 926 | + /* | |
| 927 | + * IP is used to denote syscall entry/exit: | |
| 928 | + * IP = 0 -> entry, =1 -> exit | |
| 929 | + */ | |
| 930 | + ip = regs->ARM_ip; | |
| 931 | + regs->ARM_ip = why; | |
| 932 | + | |
| 939 | 933 | /* the 0x80 provides a way for the tracing parent to distinguish |
| 940 | 934 | between a syscall stop and SIGTRAP delivery */ |
| 941 | 935 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) |
| @@ -180,44 +180,23 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame) · 179 unmodified lines | ||
| 180 | 180 | |
| 181 | 181 | static int preserve_vfp_context(struct vfp_sigframe __user *frame) |
| 182 | 182 | { |
| 183 | − struct thread_info *thread = current_thread_info(); | |
| 184 | − struct vfp_hard_struct *h = &thread->vfpstate.hard; | |
| 185 | 183 | const unsigned long magic = VFP_MAGIC; |
| 186 | 184 | const unsigned long size = VFP_STORAGE_SIZE; |
| 187 | 185 | int err = 0; |
| 188 | 186 | |
| 189 | − vfp_sync_hwstate(thread); | |
| 190 | 187 | __put_user_error(magic, &frame->magic, err); |
| 191 | 188 | __put_user_error(size, &frame->size, err); |
| 192 | 189 | |
| 193 | − /* | |
| 194 | − * Copy the floating point registers. There can be unused | |
| 195 | − * registers see asm/hwcap.h for details. | |
| 196 | − */ | |
| 197 | − err |= __copy_to_user(&frame->ufp.fpregs, &h->fpregs, | |
| 198 | − sizeof(h->fpregs)); | |
| 199 | − /* | |
| 200 | − * Copy the status and control register. | |
| 201 | − */ | |
| 202 | − __put_user_error(h->fpscr, &frame->ufp.fpscr, err); | |
| 203 | − | |
| 204 | − /* | |
| 205 | − * Copy the exception registers. | |
| 206 | − */ | |
| 207 | − __put_user_error(h->fpexc, &frame->ufp_exc.fpexc, err); | |
| 208 | − __put_user_error(h->fpinst, &frame->ufp_exc.fpinst, err); | |
| 209 | − __put_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err); | |
| 190 | + if (err) | |
| 191 | + return -EFAULT; | |
| 210 | 192 | |
| 211 | − return err ? -EFAULT : 0; | |
| 193 | + return vfp_preserve_user_clear_hwstate(&frame->ufp, &frame->ufp_exc); | |
| 212 | 194 | } |
| 213 | 195 | |
| 214 | 196 | static int restore_vfp_context(struct vfp_sigframe __user *frame) |
| 215 | 197 | { |
| 216 | − struct thread_info *thread = current_thread_info(); | |
| 217 | − struct vfp_hard_struct *h = &thread->vfpstate.hard; | |
| 218 | 198 | unsigned long magic; |
| 219 | 199 | unsigned long size; |
| 220 | − unsigned long fpexc; | |
| 221 | 200 | int err = 0; |
| 222 | 201 | |
| 223 | 202 | __get_user_error(magic, &frame->magic, err); |
| @@ -228,33 +207,7 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame) · 4 unmodified lines | ||
| 228 | 207 | if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE) |
| 229 | 208 | return -EINVAL; |
| 230 | 209 | |
| 231 | − vfp_flush_hwstate(thread); | |
| 232 | − | |
| 233 | − /* | |
| 234 | − * Copy the floating point registers. There can be unused | |
| 235 | − * registers see asm/hwcap.h for details. | |
| 236 | − */ | |
| 237 | − err |= __copy_from_user(&h->fpregs, &frame->ufp.fpregs, | |
| 238 | − sizeof(h->fpregs)); | |
| 239 | − /* | |
| 240 | − * Copy the status and control register. | |
| 241 | − */ | |
| 242 | − __get_user_error(h->fpscr, &frame->ufp.fpscr, err); | |
| 243 | − | |
| 244 | − /* | |
| 245 | − * Sanitise and restore the exception registers. | |
| 246 | − */ | |
| 247 | − __get_user_error(fpexc, &frame->ufp_exc.fpexc, err); | |
| 248 | − /* Ensure the VFP is enabled. */ | |
| 249 | − fpexc |= FPEXC_EN; | |
| 250 | − /* Ensure FPINST2 is invalid and the exception flag is cleared. */ | |
| 251 | − fpexc &= ~(FPEXC_EX | FPEXC_FP2V); | |
| 252 | − h->fpexc = fpexc; | |
| 253 | − | |
| 254 | − __get_user_error(h->fpinst, &frame->ufp_exc.fpinst, err); | |
| 255 | − __get_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err); | |
| 256 | − | |
| 257 | − return err ? -EFAULT : 0; | |
| 210 | + return vfp_restore_user_hwstate(&frame->ufp, &frame->ufp_exc); | |
| 258 | 211 | } |
| 259 | 212 | |
| 260 | 213 | #endif |
| @@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void) · 250 unmodified lines | ||
| 251 | 251 | struct mm_struct *mm = &init_mm; |
| 252 | 252 | unsigned int cpu = smp_processor_id(); |
| 253 | 253 | |
| 254 | − printk("CPU%u: Booted secondary processor\n", cpu); | |
| 255 | − | |
| 256 | 254 | /* |
| 257 | 255 | * All kernel threads share the same mm context; grab a |
| 258 | 256 | * reference and switch to it. |
| @@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void) · 5 unmodified lines | ||
| 264 | 262 | enter_lazy_tlb(mm, current); |
| 265 | 263 | local_flush_tlb_all(); |
| 266 | 264 | |
| 265 | + printk("CPU%u: Booted secondary processor\n", cpu); | |
| 266 | + | |
| 267 | 267 | cpu_init(); |
| 268 | 268 | preempt_disable(); |
| 269 | 269 | trace_hardirqs_off(); |
| @@ -454,6 +454,9 @@ static struct local_timer_ops *lt_ops; · 184 unmodified lines | ||
| 454 | 454 | #ifdef CONFIG_LOCAL_TIMERS |
| 455 | 455 | int local_timer_register(struct local_timer_ops *ops) |
| 456 | 456 | { |
| 457 | + if (!is_smp() || !setup_max_cpus) | |
| 458 | + return -ENXIO; | |
| 459 | + | |
| 457 | 460 | if (lt_ops) |
| 458 | 461 | return -EBUSY; |
| 459 | 462 | |
| @@ -510,10 +513,6 @@ static void ipi_cpu_stop(unsigned int cpu) · 50 unmodified lines | ||
| 510 | 513 | local_fiq_disable(); |
| 511 | 514 | local_irq_disable(); |
| 512 | 515 | |
| 513 | −#ifdef CONFIG_HOTPLUG_CPU | |
| 514 | − platform_cpu_kill(cpu); | |
| 515 | −#endif | |
| 516 | − | |
| 517 | 516 | while (1) |
| 518 | 517 | cpu_relax(); |
| 519 | 518 | } |
| @@ -576,17 +575,25 @@ void smp_send_reschedule(int cpu) · 56 unmodified lines | ||
| 576 | 575 | smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); |
| 577 | 576 | } |
| 578 | 577 | |
| 578 | +#ifdef CONFIG_HOTPLUG_CPU | |
| 579 | +static void smp_kill_cpus(cpumask_t *mask) | |
| 580 | +{ | |
| 581 | + unsigned int cpu; | |
| 582 | + for_each_cpu(cpu, mask) | |
| 583 | + platform_cpu_kill(cpu); | |
| 584 | +} | |
| 585 | +#else | |
| 586 | +static void smp_kill_cpus(cpumask_t *mask) { } | |
| 587 | +#endif | |
| 588 | + | |
| 579 | 589 | void smp_send_stop(void) |
| 580 | 590 | { |
| 581 | 591 | unsigned long timeout; |
| 592 | + struct cpumask mask; | |
| 582 | 593 | |
| 583 | − if (num_online_cpus() > 1) { | |
| 584 | − struct cpumask mask; | |
| 585 | − cpumask_copy(&mask, cpu_online_mask); | |
| 586 | − cpumask_clear_cpu(smp_processor_id(), &mask); | |
| 587 | − | |
| 588 | − smp_cross_call(&mask, IPI_CPU_STOP); | |
| 589 | − } | |
| 594 | + cpumask_copy(&mask, cpu_online_mask); | |
| 595 | + cpumask_clear_cpu(smp_processor_id(), &mask); | |
| 596 | + smp_cross_call(&mask, IPI_CPU_STOP); | |
| 590 | 597 | |
| 591 | 598 | /* Wait up to one second for other CPUs to stop */ |
| 592 | 599 | timeout = USEC_PER_SEC; |
| @@ -595,6 +602,8 @@ void smp_send_stop(void) · 2 unmodified lines | ||
| 595 | 602 | |
| 596 | 603 | if (num_online_cpus() > 1) |
| 597 | 604 | pr_warning("SMP: failed to stop secondary CPUs\n"); |
| 605 | + | |
| 606 | + smp_kill_cpus(&mask); | |
| 598 | 607 | } |
| 599 | 608 | |
| 600 | 609 | /* |
| @@ -118,14 +118,10 @@ static int twd_cpufreq_transition(struct notifier_block *nb, · 117 unmodified lines | ||
| 118 | 118 | * The twd clock events must be reprogrammed to account for the new |
| 119 | 119 | * frequency. The timer is local to a cpu, so cross-call to the |
| 120 | 120 | * changing cpu. |
| 121 | − * | |
| 122 | − * Only wait for it to finish, if the cpu is active to avoid | |
| 123 | − * deadlock when cpu1 is spinning on while(!cpu_active(cpu1)) during | |
| 124 | − * booting of that cpu. | |
| 125 | 121 | */ |
| 126 | 122 | if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE) |
| 127 | 123 | smp_call_function_single(freqs->cpu, twd_update_frequency, |
| 128 | − NULL, cpu_active(freqs->cpu)); | |
| 124 | + NULL, 1); | |
| 129 | 125 | |
| 130 | 126 | return NOTIFY_OK; |
| 131 | 127 | } |
| @@ -115,7 +115,7 @@ int kernel_execve(const char *filename, · 114 unmodified lines | ||
| 115 | 115 | "Ir" (THREAD_START_SP - sizeof(regs)), |
| 116 | 116 | "r" (®s), |
| 117 | 117 | "Ir" (sizeof(regs)) |
| 118 | − : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); | |
| 118 | + : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory"); | |
| 119 | 119 | |
| 120 | 120 | out: |
| 121 | 121 | return ret; |
| @@ -1173,7 +1173,6 @@ void __init at91_add_device_serial(void) · 1172 unmodified lines | ||
| 1173 | 1173 | printk(KERN_INFO "AT91: No default serial console defined.\n"); |
| 1174 | 1174 | } |
| 1175 | 1175 | #else |
| 1176 | −void __init __deprecated at91_init_serial(struct at91_uart_config *config) {} | |
| 1177 | 1176 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} |
| 1178 | 1177 | void __init at91_set_serial_console(unsigned portnr) {} |
| 1179 | 1178 | void __init at91_add_device_serial(void) {} |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #include <linux/interrupt.h> |
| 24 | 24 | #include <linux/irq.h> |
| 25 | 25 | #include <linux/clockchips.h> |
| 26 | +#include <linux/export.h> | |
| 26 | 27 | |
| 27 | 28 | #include <asm/mach/time.h> |
| 28 | 29 | |
| @@ -176,6 +177,7 @@ static struct clock_event_device clkevt = { · 147 unmodified lines | ||
| 176 | 177 | }; |
| 177 | 178 | |
| 178 | 179 | void __iomem *at91_st_base; |
| 180 | +EXPORT_SYMBOL_GPL(at91_st_base); | |
| 179 | 181 | |
| 180 | 182 | void __init at91rm9200_ioremap_st(u32 addr) |
| 181 | 183 | { |
| @@ -117,7 +117,7 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = { · 116 unmodified lines | ||
| 117 | 117 | }; |
| 118 | 118 | |
| 119 | 119 | #define EK_FLASH_BASE AT91_CHIPSELECT_0 |
| 120 | −#define EK_FLASH_SIZE SZ_2M | |
| 120 | +#define EK_FLASH_SIZE SZ_8M | |
| 121 | 121 | |
| 122 | 122 | static struct physmap_flash_data ek_flash_data = { |
| 123 | 123 | .width = 2, |
| @@ -85,8 +85,6 @@ static struct resource dm9000_resource[] = { · 84 unmodified lines | ||
| 85 | 85 | .flags = IORESOURCE_MEM |
| 86 | 86 | }, |
| 87 | 87 | [2] = { |
| 88 | − .start = AT91_PIN_PC11, | |
| 89 | − .end = AT91_PIN_PC11, | |
| 90 | 88 | .flags = IORESOURCE_IRQ |
| 91 | 89 | | IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE, |
| 92 | 90 | } |
| @@ -130,6 +128,8 @@ static struct sam9_smc_config __initdata dm9000_smc_config = { · 37 unmodified lines | ||
| 130 | 128 | |
| 131 | 129 | static void __init ek_add_device_dm9000(void) |
| 132 | 130 | { |
| 131 | + struct resource *r = &dm9000_resource[2]; | |
| 132 | + | |
| 133 | 133 | /* Configure chip-select 2 (DM9000) */ |
| 134 | 134 | sam9_smc_configure(0, 2, &dm9000_smc_config); |
| 135 | 135 | |
| @@ -139,6 +139,7 @@ static void __init ek_add_device_dm9000(void) · 3 unmodified lines | ||
| 139 | 139 | /* Configure Interrupt pin as input, no pull-up */ |
| 140 | 140 | at91_set_gpio_input(AT91_PIN_PC11, 0); |
| 141 | 141 | |
| 142 | + r->start = r->end = gpio_to_irq(AT91_PIN_PC11); | |
| 142 | 143 | platform_device_register(&dm9000_device); |
| 143 | 144 | } |
| 144 | 145 | #else |
| @@ -35,6 +35,7 @@ · 34 unmodified lines | ||
| 35 | 35 | #include "generic.h" |
| 36 | 36 | |
| 37 | 37 | void __iomem *at91_pmc_base; |
| 38 | +EXPORT_SYMBOL_GPL(at91_pmc_base); | |
| 38 | 39 | |
| 39 | 40 | /* |
| 40 | 41 | * There's a lot more which can be done with clocks, including cpufreq |
| @@ -25,7 +25,7 @@ extern void __iomem *at91_pmc_base; · 24 unmodified lines | ||
| 25 | 25 | #define at91_pmc_write(field, value) \ |
| 26 | 26 | __raw_writel(value, at91_pmc_base + field) |
| 27 | 27 | #else |
| 28 | −.extern at91_aic_base | |
| 28 | +.extern at91_pmc_base | |
| 29 | 29 | #endif |
| 30 | 30 | |
| 31 | 31 | #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ |
| @@ -54,6 +54,7 @@ void __init at91_init_interrupts(unsigned int *priority) · 53 unmodified lines | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | void __iomem *at91_ramc_base[2]; |
| 57 | +EXPORT_SYMBOL_GPL(at91_ramc_base); | |
| 57 | 58 | |
| 58 | 59 | void __init at91_ioremap_ramc(int id, u32 addr, u32 size) |
| 59 | 60 | { |
| @@ -292,6 +293,7 @@ void __init at91_ioremap_rstc(u32 base_addr) · 232 unmodified lines | ||
| 292 | 293 | } |
| 293 | 294 | |
| 294 | 295 | void __iomem *at91_matrix_base; |
| 296 | +EXPORT_SYMBOL_GPL(at91_matrix_base); | |
| 295 | 297 | |
| 296 | 298 | void __init at91_ioremap_matrix(u32 base_addr) |
| 297 | 299 | { |
| @@ -52,8 +52,8 @@ · 51 unmodified lines | ||
| 52 | 52 | #include <mach/csp/chipcHw_inline.h> |
| 53 | 53 | #include <mach/csp/tmrHw_reg.h> |
| 54 | 54 | |
| 55 | −static AMBA_APB_DEVICE(uartA, "uarta", MM_ADDR_IO_UARTA, { IRQ_UARTA }, NULL); | |
| 56 | −static AMBA_APB_DEVICE(uartB, "uartb", MM_ADDR_IO_UARTB, { IRQ_UARTB }, NULL); | |
| 55 | +static AMBA_APB_DEVICE(uartA, "uartA", 0, MM_ADDR_IO_UARTA, {IRQ_UARTA}, NULL); | |
| 56 | +static AMBA_APB_DEVICE(uartB, "uartB", 0, MM_ADDR_IO_UARTB, {IRQ_UARTB}, NULL); | |
| 57 | 57 | |
| 58 | 58 | static struct clk pll1_clk = { |
| 59 | 59 | .name = "PLL1", |
| @@ -166,12 +166,6 @@ static struct pci_ops cns3xxx_pcie_ops = { · 165 unmodified lines | ||
| 166 | 166 | .write = cns3xxx_pci_write_config, |
| 167 | 167 | }; |
| 168 | 168 | |
| 169 | −static struct pci_bus *cns3xxx_pci_scan_bus(int nr, struct pci_sys_data *sys) | |
| 170 | −{ | |
| 171 | − return pci_scan_root_bus(NULL, sys->busnr, &cns3xxx_pcie_ops, sys, | |
| 172 | − &sys->resources); | |
| 173 | −} | |
| 174 | − | |
| 175 | 169 | static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
| 176 | 170 | { |
| 177 | 171 | struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev); |
| @@ -221,10 +215,9 @@ static struct cns3xxx_pcie cns3xxx_pcie[] = { · 43 unmodified lines | ||
| 221 | 215 | .irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, }, |
| 222 | 216 | .hw_pci = { |
| 223 | 217 | .domain = 0, |
| 224 | − .swizzle = pci_std_swizzle, | |
| 225 | 218 | .nr_controllers = 1, |
| 219 | + .ops = &cns3xxx_pcie_ops, | |
| 226 | 220 | .setup = cns3xxx_pci_setup, |
| 227 | − .scan = cns3xxx_pci_scan_bus, | |
| 228 | 221 | .map_irq = cns3xxx_pcie_map_irq, |
| 229 | 222 | }, |
| 230 | 223 | }, |
| @@ -264,10 +257,9 @@ static struct cns3xxx_pcie cns3xxx_pcie[] = { · 33 unmodified lines | ||
| 264 | 257 | .irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, }, |
| 265 | 258 | .hw_pci = { |
| 266 | 259 | .domain = 1, |
| 267 | − .swizzle = pci_std_swizzle, | |
| 268 | 260 | .nr_controllers = 1, |
| 261 | + .ops = &cns3xxx_pcie_ops, | |
| 269 | 262 | .setup = cns3xxx_pci_setup, |
| 270 | − .scan = cns3xxx_pci_scan_bus, | |
| 271 | 263 | .map_irq = cns3xxx_pcie_map_irq, |
| 272 | 264 | }, |
| 273 | 265 | }, |
| @@ -43,6 +43,7 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) · 42 unmodified lines | ||
| 43 | 43 | return 0; |
| 44 | 44 | |
| 45 | 45 | pp = &pcie_port[nr]; |
| 46 | + sys->private_data = pp; | |
| 46 | 47 | pp->root_bus_nr = sys->busnr; |
| 47 | 48 | |
| 48 | 49 | /* |
| @@ -93,19 +94,6 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) · 44 unmodified lines | ||
| 93 | 94 | return 1; |
| 94 | 95 | } |
| 95 | 96 | |
| 96 | −static struct pcie_port *bus_to_port(int bus) | |
| 97 | −{ | |
| 98 | − int i; | |
| 99 | − | |
| 100 | − for (i = num_pcie_ports - 1; i >= 0; i--) { | |
| 101 | − int rbus = pcie_port[i].root_bus_nr; | |
| 102 | − if (rbus != -1 && rbus <= bus) | |
| 103 | − break; | |
| 104 | − } | |
| 105 | − | |
| 106 | − return i >= 0 ? pcie_port + i : NULL; | |
| 107 | −} | |
| 108 | − | |
| 109 | 97 | static int pcie_valid_config(struct pcie_port *pp, int bus, int dev) |
| 110 | 98 | { |
| 111 | 99 | /* |
| @@ -121,7 +109,8 @@ static int pcie_valid_config(struct pcie_port *pp, int bus, int dev) · 9 unmodified lines | ||
| 121 | 109 | static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, |
| 122 | 110 | int size, u32 *val) |
| 123 | 111 | { |
| 124 | − struct pcie_port *pp = bus_to_port(bus->number); | |
| 112 | + struct pci_sys_data *sys = bus->sysdata; | |
| 113 | + struct pcie_port *pp = sys->private_data; | |
| 125 | 114 | unsigned long flags; |
| 126 | 115 | int ret; |
| 127 | 116 | |
| @@ -140,7 +129,8 @@ static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, · 12 unmodified lines | ||
| 140 | 129 | static int pcie_wr_conf(struct pci_bus *bus, u32 devfn, |
| 141 | 130 | int where, int size, u32 val) |
| 142 | 131 | { |
| 143 | − struct pcie_port *pp = bus_to_port(bus->number); | |
| 132 | + struct pci_sys_data *sys = bus->sysdata; | |
| 133 | + struct pcie_port *pp = sys->private_data; | |
| 144 | 134 | unsigned long flags; |
| 145 | 135 | int ret; |
| 146 | 136 | |
| @@ -194,14 +184,14 @@ dove_pcie_scan_bus(int nr, struct pci_sys_data *sys) · 47 unmodified lines | ||
| 194 | 184 | |
| 195 | 185 | static int __init dove_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
| 196 | 186 | { |
| 197 | − struct pcie_port *pp = bus_to_port(dev->bus->number); | |
| 187 | + struct pci_sys_data *sys = dev->sysdata; | |
| 188 | + struct pcie_port *pp = sys->private_data; | |
| 198 | 189 | |
| 199 | 190 | return pp->index ? IRQ_DOVE_PCIE1 : IRQ_DOVE_PCIE0; |
| 200 | 191 | } |
| 201 | 192 | |
| 202 | 193 | static struct hw_pci dove_pci __initdata = { |
| 203 | 194 | .nr_controllers = 2, |
| 204 | − .swizzle = pci_std_swizzle, | |
| 205 | 195 | .setup = dove_pcie_setup, |
| 206 | 196 | .scan = dove_pcie_scan_bus, |
| 207 | 197 | .map_irq = dove_pcie_map_irq, |
| @@ -497,25 +497,25 @@ static struct clk exynos4_init_clocks_off[] = { · 496 unmodified lines | ||
| 497 | 497 | .ctrlbit = (1 << 3), |
| 498 | 498 | }, { |
| 499 | 499 | .name = "hsmmc", |
| 500 | − .devname = "s3c-sdhci.0", | |
| 500 | + .devname = "exynos4-sdhci.0", | |
| 501 | 501 | .parent = &exynos4_clk_aclk_133.clk, |
| 502 | 502 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 503 | 503 | .ctrlbit = (1 << 5), |
| 504 | 504 | }, { |
| 505 | 505 | .name = "hsmmc", |
| 506 | − .devname = "s3c-sdhci.1", | |
| 506 | + .devname = "exynos4-sdhci.1", | |
| 507 | 507 | .parent = &exynos4_clk_aclk_133.clk, |
| 508 | 508 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 509 | 509 | .ctrlbit = (1 << 6), |
| 510 | 510 | }, { |
| 511 | 511 | .name = "hsmmc", |
| 512 | − .devname = "s3c-sdhci.2", | |
| 512 | + .devname = "exynos4-sdhci.2", | |
| 513 | 513 | .parent = &exynos4_clk_aclk_133.clk, |
| 514 | 514 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 515 | 515 | .ctrlbit = (1 << 7), |
| 516 | 516 | }, { |
| 517 | 517 | .name = "hsmmc", |
| 518 | − .devname = "s3c-sdhci.3", | |
| 518 | + .devname = "exynos4-sdhci.3", | |
| 519 | 519 | .parent = &exynos4_clk_aclk_133.clk, |
| 520 | 520 | .enable = exynos4_clk_ip_fsys_ctrl, |
| 521 | 521 | .ctrlbit = (1 << 8), |
| @@ -1202,7 +1202,7 @@ static struct clksrc_clk exynos4_clk_sclk_uart3 = { · 680 unmodified lines | ||
| 1202 | 1202 | static struct clksrc_clk exynos4_clk_sclk_mmc0 = { |
| 1203 | 1203 | .clk = { |
| 1204 | 1204 | .name = "sclk_mmc", |
| 1205 | − .devname = "s3c-sdhci.0", | |
| 1205 | + .devname = "exynos4-sdhci.0", | |
| 1206 | 1206 | .parent = &exynos4_clk_dout_mmc0.clk, |
| 1207 | 1207 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1208 | 1208 | .ctrlbit = (1 << 0), |
| @@ -1213,7 +1213,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc0 = { · 4 unmodified lines | ||
| 1213 | 1213 | static struct clksrc_clk exynos4_clk_sclk_mmc1 = { |
| 1214 | 1214 | .clk = { |
| 1215 | 1215 | .name = "sclk_mmc", |
| 1216 | − .devname = "s3c-sdhci.1", | |
| 1216 | + .devname = "exynos4-sdhci.1", | |
| 1217 | 1217 | .parent = &exynos4_clk_dout_mmc1.clk, |
| 1218 | 1218 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1219 | 1219 | .ctrlbit = (1 << 4), |
| @@ -1224,7 +1224,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc1 = { · 4 unmodified lines | ||
| 1224 | 1224 | static struct clksrc_clk exynos4_clk_sclk_mmc2 = { |
| 1225 | 1225 | .clk = { |
| 1226 | 1226 | .name = "sclk_mmc", |
| 1227 | − .devname = "s3c-sdhci.2", | |
| 1227 | + .devname = "exynos4-sdhci.2", | |
| 1228 | 1228 | .parent = &exynos4_clk_dout_mmc2.clk, |
| 1229 | 1229 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1230 | 1230 | .ctrlbit = (1 << 8), |
| @@ -1235,7 +1235,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc2 = { · 4 unmodified lines | ||
| 1235 | 1235 | static struct clksrc_clk exynos4_clk_sclk_mmc3 = { |
| 1236 | 1236 | .clk = { |
| 1237 | 1237 | .name = "sclk_mmc", |
| 1238 | − .devname = "s3c-sdhci.3", | |
| 1238 | + .devname = "exynos4-sdhci.3", | |
| 1239 | 1239 | .parent = &exynos4_clk_dout_mmc3.clk, |
| 1240 | 1240 | .enable = exynos4_clksrc_mask_fsys_ctrl, |
| 1241 | 1241 | .ctrlbit = (1 << 12), |
| @@ -1340,10 +1340,10 @@ static struct clk_lookup exynos4_clk_lookup[] = { · 98 unmodified lines | ||
| 1340 | 1340 | CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk), |
| 1341 | 1341 | CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk), |
| 1342 | 1342 | CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk), |
| 1343 | − CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk), | |
| 1344 | − CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk), | |
| 1345 | − CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk), | |
| 1346 | − CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk), | |
| 1343 | + CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk), | |
| 1344 | + CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk), | |
| 1345 | + CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk), | |
| 1346 | + CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk), | |
| 1347 | 1347 | CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0), |
| 1348 | 1348 | CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0), |
| 1349 | 1349 | CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1), |
| @@ -455,25 +455,25 @@ static struct clk exynos5_init_clocks_off[] = { · 454 unmodified lines | ||
| 455 | 455 | .ctrlbit = (1 << 20), |
| 456 | 456 | }, { |
| 457 | 457 | .name = "hsmmc", |
| 458 | − .devname = "s3c-sdhci.0", | |
| 458 | + .devname = "exynos4-sdhci.0", | |
| 459 | 459 | .parent = &exynos5_clk_aclk_200.clk, |
| 460 | 460 | .enable = exynos5_clk_ip_fsys_ctrl, |
| 461 | 461 | .ctrlbit = (1 << 12), |
| 462 | 462 | }, { |
| 463 | 463 | .name = "hsmmc", |
| 464 | − .devname = "s3c-sdhci.1", | |
| 464 | + .devname = "exynos4-sdhci.1", | |
| 465 | 465 | .parent = &exynos5_clk_aclk_200.clk, |
| 466 | 466 | .enable = exynos5_clk_ip_fsys_ctrl, |
| 467 | 467 | .ctrlbit = (1 << 13), |
| 468 | 468 | }, { |
| 469 | 469 | .name = "hsmmc", |
| 470 | − .devname = "s3c-sdhci.2", | |
| 470 | + .devname = "exynos4-sdhci.2", | |
| 471 | 471 | .parent = &exynos5_clk_aclk_200.clk, |
| 472 | 472 | .enable = exynos5_clk_ip_fsys_ctrl, |
| 473 | 473 | .ctrlbit = (1 << 14), |
| 474 | 474 | }, { |
| 475 | 475 | .name = "hsmmc", |
| 476 | − .devname = "s3c-sdhci.3", | |
| 476 | + .devname = "exynos4-sdhci.3", | |
| 477 | 477 | .parent = &exynos5_clk_aclk_200.clk, |
| 478 | 478 | .enable = exynos5_clk_ip_fsys_ctrl, |
| 479 | 479 | .ctrlbit = (1 << 15), |
| @@ -813,7 +813,7 @@ static struct clksrc_clk exynos5_clk_sclk_uart3 = { · 333 unmodified lines | ||
| 813 | 813 | static struct clksrc_clk exynos5_clk_sclk_mmc0 = { |
| 814 | 814 | .clk = { |
| 815 | 815 | .name = "sclk_mmc", |
| 816 | − .devname = "s3c-sdhci.0", | |
| 816 | + .devname = "exynos4-sdhci.0", | |
| 817 | 817 | .parent = &exynos5_clk_dout_mmc0.clk, |
| 818 | 818 | .enable = exynos5_clksrc_mask_fsys_ctrl, |
| 819 | 819 | .ctrlbit = (1 << 0), |
| @@ -824,7 +824,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc0 = { · 4 unmodified lines | ||
| 824 | 824 | static struct clksrc_clk exynos5_clk_sclk_mmc1 = { |
| 825 | 825 | .clk = { |
| 826 | 826 | .name = "sclk_mmc", |
| 827 | − .devname = "s3c-sdhci.1", | |
| 827 | + .devname = "exynos4-sdhci.1", | |
| 828 | 828 | .parent = &exynos5_clk_dout_mmc1.clk, |
| 829 | 829 | .enable = exynos5_clksrc_mask_fsys_ctrl, |
| 830 | 830 | .ctrlbit = (1 << 4), |
| @@ -835,7 +835,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc1 = { · 4 unmodified lines | ||
| 835 | 835 | static struct clksrc_clk exynos5_clk_sclk_mmc2 = { |
| 836 | 836 | .clk = { |
| 837 | 837 | .name = "sclk_mmc", |
| 838 | − .devname = "s3c-sdhci.2", | |
| 838 | + .devname = "exynos4-sdhci.2", | |
| 839 | 839 | .parent = &exynos5_clk_dout_mmc2.clk, |
| 840 | 840 | .enable = exynos5_clksrc_mask_fsys_ctrl, |
| 841 | 841 | .ctrlbit = (1 << 8), |
| @@ -846,7 +846,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc2 = { · 4 unmodified lines | ||
| 846 | 846 | static struct clksrc_clk exynos5_clk_sclk_mmc3 = { |
| 847 | 847 | .clk = { |
| 848 | 848 | .name = "sclk_mmc", |
| 849 | − .devname = "s3c-sdhci.3", | |
| 849 | + .devname = "exynos4-sdhci.3", | |
| 850 | 850 | .parent = &exynos5_clk_dout_mmc3.clk, |
| 851 | 851 | .enable = exynos5_clksrc_mask_fsys_ctrl, |
| 852 | 852 | .ctrlbit = (1 << 12), |
| @@ -990,10 +990,10 @@ static struct clk_lookup exynos5_clk_lookup[] = { · 137 unmodified lines | ||
| 990 | 990 | CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos5_clk_sclk_uart1.clk), |
| 991 | 991 | CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos5_clk_sclk_uart2.clk), |
| 992 | 992 | CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos5_clk_sclk_uart3.clk), |
| 993 | − CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos5_clk_sclk_mmc0.clk), | |
| 994 | − CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos5_clk_sclk_mmc1.clk), | |
| 995 | − CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos5_clk_sclk_mmc2.clk), | |
| 996 | − CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos5_clk_sclk_mmc3.clk), | |
| 993 | + CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos5_clk_sclk_mmc0.clk), | |
| 994 | + CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos5_clk_sclk_mmc1.clk), | |
| 995 | + CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos5_clk_sclk_mmc2.clk), | |
| 996 | + CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos5_clk_sclk_mmc3.clk), | |
| 997 | 997 | CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0), |
| 998 | 998 | CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1), |
| 999 | 999 | CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1), |
| @@ -326,6 +326,11 @@ static void __init exynos4_map_io(void) · 325 unmodified lines | ||
| 326 | 326 | s3c_fimc_setname(2, "exynos4-fimc"); |
| 327 | 327 | s3c_fimc_setname(3, "exynos4-fimc"); |
| 328 | 328 | |
| 329 | + s3c_sdhci_setname(0, "exynos4-sdhci"); | |
| 330 | + s3c_sdhci_setname(1, "exynos4-sdhci"); | |
| 331 | + s3c_sdhci_setname(2, "exynos4-sdhci"); | |
| 332 | + s3c_sdhci_setname(3, "exynos4-sdhci"); | |
| 333 | + | |
| 329 | 334 | /* The I2C bus controllers are directly compatible with s3c2440 */ |
| 330 | 335 | s3c_i2c0_setname("s3c2440-i2c"); |
| 331 | 336 | s3c_i2c1_setname("s3c2440-i2c"); |
| @@ -344,6 +349,11 @@ static void __init exynos5_map_io(void) · 12 unmodified lines | ||
| 344 | 349 | s3c_device_i2c0.resource[1].start = EXYNOS5_IRQ_IIC; |
| 345 | 350 | s3c_device_i2c0.resource[1].end = EXYNOS5_IRQ_IIC; |
| 346 | 351 | |
| 352 | + s3c_sdhci_setname(0, "exynos4-sdhci"); | |
| 353 | + s3c_sdhci_setname(1, "exynos4-sdhci"); | |
| 354 | + s3c_sdhci_setname(2, "exynos4-sdhci"); | |
| 355 | + s3c_sdhci_setname(3, "exynos4-sdhci"); | |
| 356 | + | |
| 347 | 357 | /* The I2C bus controllers are directly compatible with s3c2440 */ |
| 348 | 358 | s3c_i2c0_setname("s3c2440-i2c"); |
| 349 | 359 | s3c_i2c1_setname("s3c2440-i2c"); |
| @@ -537,7 +547,9 @@ void __init exynos5_init_irq(void) · 187 unmodified lines | ||
| 537 | 547 | { |
| 538 | 548 | int irq; |
| 539 | 549 | |
| 540 | − gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); | |
| 550 | +#ifdef CONFIG_OF | |
| 551 | + of_irq_init(exynos4_dt_irq_match); | |
| 552 | +#endif | |
| 541 | 553 | |
| 542 | 554 | for (irq = 0; irq < EXYNOS5_MAX_COMBINER_NR; irq++) { |
| 543 | 555 | combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | #include <linux/dma-mapping.h> |
| 17 | 17 | #include <linux/platform_device.h> |
| 18 | 18 | #include <linux/interrupt.h> |
| 19 | +#include <linux/ioport.h> | |
| 19 | 20 | #include <linux/mmc/dw_mmc.h> |
| 20 | 21 | |
| 21 | 22 | #include <plat/devs.h> |
| @@ -33,16 +34,8 @@ static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void *data) · 11 unmodified lines | ||
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 36 | static struct resource exynos4_dwmci_resource[] = { |
| 36 | − [0] = { | |
| 37 | − .start = EXYNOS4_PA_DWMCI, | |
| 38 | − .end = EXYNOS4_PA_DWMCI + SZ_4K - 1, | |
| 39 | − .flags = IORESOURCE_MEM, | |
| 40 | − }, | |
| 41 | − [1] = { | |
| 42 | − .start = IRQ_DWMCI, | |
| 43 | − .end = IRQ_DWMCI, | |
| 44 | − .flags = IORESOURCE_IRQ, | |
| 45 | − } | |
| 37 | + [0] = DEFINE_RES_MEM(EXYNOS4_PA_DWMCI, SZ_4K), | |
| 38 | + [1] = DEFINE_RES_IRQ(EXYNOS4_IRQ_DWMCI), | |
| 46 | 39 | }; |
| 47 | 40 | |
| 48 | 41 | static struct dw_mci_board exynos4_dwci_pdata = { |
| @@ -112,6 +112,7 @@ static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = { · 111 unmodified lines | ||
| 112 | 112 | .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | |
| 113 | 113 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | |
| 114 | 114 | MMC_CAP_ERASE), |
| 115 | + .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE, | |
| 115 | 116 | .cd_type = S3C_SDHCI_CD_PERMANENT, |
| 116 | 117 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, |
| 117 | 118 | }; |
| @@ -747,6 +747,7 @@ static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = { · 746 unmodified lines | ||
| 747 | 747 | .max_width = 8, |
| 748 | 748 | .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | |
| 749 | 749 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), |
| 750 | + .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE, | |
| 750 | 751 | .cd_type = S3C_SDHCI_CD_PERMANENT, |
| 751 | 752 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, |
| 752 | 753 | }; |
| @@ -16,6 +16,11 @@ · 15 unmodified lines | ||
| 16 | 16 | /* cats host-specific stuff */ |
| 17 | 17 | static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; |
| 18 | 18 | |
| 19 | +static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) | |
| 20 | +{ | |
| 21 | + return 0; | |
| 22 | +} | |
| 23 | + | |
| 19 | 24 | static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
| 20 | 25 | { |
| 21 | 26 | if (dev->irq >= 255) |
| @@ -39,11 +44,11 @@ static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 17 unmodified lines | ||
| 39 | 44 | * cards being used (ie, pci-pci bridge based cards)? |
| 40 | 45 | */ |
| 41 | 46 | static struct hw_pci cats_pci __initdata = { |
| 42 | − .swizzle = NULL, | |
| 47 | + .swizzle = cats_no_swizzle, | |
| 43 | 48 | .map_irq = cats_map_irq, |
| 44 | 49 | .nr_controllers = 1, |
| 50 | + .ops = &dc21285_ops, | |
| 45 | 51 | .setup = dc21285_setup, |
| 46 | − .scan = dc21285_scan_bus, | |
| 47 | 52 | .preinit = dc21285_preinit, |
| 48 | 53 | .postinit = dc21285_postinit, |
| 49 | 54 | }; |
| @@ -129,7 +129,7 @@ dc21285_write_config(struct pci_bus *bus, unsigned int devfn, int where, · 128 unmodified lines | ||
| 129 | 129 | return PCIBIOS_SUCCESSFUL; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | −static struct pci_ops dc21285_ops = { | |
| 132 | +struct pci_ops dc21285_ops = { | |
| 133 | 133 | .read = dc21285_read_config, |
| 134 | 134 | .write = dc21285_write_config, |
| 135 | 135 | }; |
| @@ -284,11 +284,6 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys) · 148 unmodified lines | ||
| 284 | 284 | return 1; |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | −struct pci_bus * __init dc21285_scan_bus(int nr, struct pci_sys_data *sys) | |
| 288 | −{ | |
| 289 | − return pci_scan_root_bus(NULL, 0, &dc21285_ops, sys, &sys->resources); | |
| 290 | −} | |
| 291 | − | |
| 292 | 287 | #define dc21285_request_irq(_a, _b, _c, _d, _e) \ |
| 293 | 288 | WARN_ON(request_irq(_a, _b, _c, _d, _e) < 0) |
| 294 | 289 | |
| @@ -29,11 +29,10 @@ static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 28 unmodified lines | ||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static struct hw_pci ebsa285_pci __initdata = { |
| 32 | − .swizzle = pci_std_swizzle, | |
| 33 | 32 | .map_irq = ebsa285_map_irq, |
| 34 | 33 | .nr_controllers = 1, |
| 34 | + .ops = &dc21285_ops, | |
| 35 | 35 | .setup = dc21285_setup, |
| 36 | − .scan = dc21285_scan_bus, | |
| 37 | 36 | .preinit = dc21285_preinit, |
| 38 | 37 | .postinit = dc21285_postinit, |
| 39 | 38 | }; |
| @@ -43,11 +43,10 @@ static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 42 unmodified lines | ||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static struct hw_pci netwinder_pci __initdata = { |
| 46 | − .swizzle = pci_std_swizzle, | |
| 47 | 46 | .map_irq = netwinder_map_irq, |
| 48 | 47 | .nr_controllers = 1, |
| 48 | + .ops = &dc21285_ops, | |
| 49 | 49 | .setup = dc21285_setup, |
| 50 | − .scan = dc21285_scan_bus, | |
| 51 | 50 | .preinit = dc21285_preinit, |
| 52 | 51 | .postinit = dc21285_postinit, |
| 53 | 52 | }; |
| @@ -41,8 +41,8 @@ static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot, · 40 unmodified lines | ||
| 41 | 41 | static struct hw_pci personal_server_pci __initdata = { |
| 42 | 42 | .map_irq = personal_server_map_irq, |
| 43 | 43 | .nr_controllers = 1, |
| 44 | + .ops = &dc21285_ops, | |
| 44 | 45 | .setup = dc21285_setup, |
| 45 | − .scan = dc21285_scan_bus, | |
| 46 | 46 | .preinit = dc21285_preinit, |
| 47 | 47 | .postinit = dc21285_postinit, |
| 48 | 48 | }; |
| @@ -35,7 +35,7 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = { · 34 unmodified lines | ||
| 35 | 35 | static int __init imx27_avic_add_irq_domain(struct device_node *np, |
| 36 | 36 | struct device_node *interrupt_parent) |
| 37 | 37 | { |
| 38 | − irq_domain_add_simple(np, 0); | |
| 38 | + irq_domain_add_legacy(np, 64, 0, 0, &irq_domain_simple_ops, NULL); | |
| 39 | 39 | return 0; |
| 40 | 40 | } |
| 41 | 41 | |
| @@ -44,7 +44,9 @@ static int __init imx27_gpio_add_irq_domain(struct device_node *np, · 2 unmodified lines | ||
| 44 | 44 | { |
| 45 | 45 | static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; |
| 46 | 46 | |
| 47 | − irq_domain_add_simple(np, gpio_irq_base); | |
| 47 | + gpio_irq_base -= 32; | |
| 48 | + irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops, | |
| 49 | + NULL); | |
| 48 | 50 | |
| 49 | 51 | return 0; |
| 50 | 52 | } |
| @@ -35,7 +35,7 @@ static void imx5_idle(void) · 34 unmodified lines | ||
| 35 | 35 | } |
| 36 | 36 | clk_enable(gpc_dvfs_clk); |
| 37 | 37 | mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF); |
| 38 | − if (tzic_enable_wake() != 0) | |
| 38 | + if (!tzic_enable_wake()) | |
| 39 | 39 | cpu_do_idle(); |
| 40 | 40 | clk_disable(gpc_dvfs_clk); |
| 41 | 41 | } |
| @@ -1,39 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * arch/arm/mach-integrator/include/mach/entry-macro.S | |
| 3 | − * | |
| 4 | − * Low-level IRQ helper macros for Integrator platforms | |
| 5 | − * | |
| 6 | − * This file is licensed under the terms of the GNU General Public | |
| 7 | − * License version 2. This program is licensed "as is" without any | |
| 8 | − * warranty of any kind, whether express or implied. | |
| 9 | − */ | |
| 10 | −#include <mach/hardware.h> | |
| 11 | −#include <mach/platform.h> | |
| 12 | −#include <mach/irqs.h> | |
| 13 | − | |
| 14 | − .macro get_irqnr_preamble, base, tmp | |
| 15 | − .endm | |
| 16 | − | |
| 17 | − .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | |
| 18 | −/* FIXME: should not be using soo many LDRs here */ | |
| 19 | − ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE) | |
| 20 | − mov \irqnr, #IRQ_PIC_START | |
| 21 | − ldr \irqstat, [\base, #IRQ_STATUS] @ get masked status | |
| 22 | − ldr \base, =IO_ADDRESS(INTEGRATOR_HDR_BASE) | |
| 23 | − teq \irqstat, #0 | |
| 24 | − ldreq \irqstat, [\base, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)] | |
| 25 | − moveq \irqnr, #IRQ_CIC_START | |
| 26 | − | |
| 27 | −1001: tst \irqstat, #15 | |
| 28 | − bne 1002f | |
| 29 | − add \irqnr, \irqnr, #4 | |
| 30 | − movs \irqstat, \irqstat, lsr #4 | |
| 31 | − bne 1001b | |
| 32 | −1002: tst \irqstat, #1 | |
| 33 | − bne 1003f | |
| 34 | − add \irqnr, \irqnr, #1 | |
| 35 | − movs \irqstat, \irqstat, lsr #1 | |
| 36 | − bne 1002b | |
| 37 | −1003: /* EQ will be set if no irqs pending */ | |
| 38 | − .endm | |
| 39 | − | |
| @@ -22,37 +22,37 @@ · 21 unmodified lines | ||
| 22 | 22 | /* |
| 23 | 23 | * Interrupt numbers |
| 24 | 24 | */ |
| 25 | −#define IRQ_PIC_START 0 | |
| 26 | −#define IRQ_SOFTINT 0 | |
| 27 | −#define IRQ_UARTINT0 1 | |
| 28 | −#define IRQ_UARTINT1 2 | |
| 29 | −#define IRQ_KMIINT0 3 | |
| 30 | −#define IRQ_KMIINT1 4 | |
| 31 | −#define IRQ_TIMERINT0 5 | |
| 32 | −#define IRQ_TIMERINT1 6 | |
| 33 | −#define IRQ_TIMERINT2 7 | |
| 34 | −#define IRQ_RTCINT 8 | |
| 35 | −#define IRQ_AP_EXPINT0 9 | |
| 36 | −#define IRQ_AP_EXPINT1 10 | |
| 37 | −#define IRQ_AP_EXPINT2 11 | |
| 38 | −#define IRQ_AP_EXPINT3 12 | |
| 39 | −#define IRQ_AP_PCIINT0 13 | |
| 40 | −#define IRQ_AP_PCIINT1 14 | |
| 41 | −#define IRQ_AP_PCIINT2 15 | |
| 42 | −#define IRQ_AP_PCIINT3 16 | |
| 43 | −#define IRQ_AP_V3INT 17 | |
| 44 | −#define IRQ_AP_CPINT0 18 | |
| 45 | −#define IRQ_AP_CPINT1 19 | |
| 46 | −#define IRQ_AP_LBUSTIMEOUT 20 | |
| 47 | −#define IRQ_AP_APCINT 21 | |
| 48 | −#define IRQ_CP_CLCDCINT 22 | |
| 49 | −#define IRQ_CP_MMCIINT0 23 | |
| 50 | −#define IRQ_CP_MMCIINT1 24 | |
| 51 | −#define IRQ_CP_AACIINT 25 | |
| 52 | −#define IRQ_CP_CPPLDINT 26 | |
| 53 | −#define IRQ_CP_ETHINT 27 | |
| 54 | −#define IRQ_CP_TSPENINT 28 | |
| 55 | −#define IRQ_PIC_END 31 | |
| 25 | +#define IRQ_PIC_START 1 | |
| 26 | +#define IRQ_SOFTINT 1 | |
| 27 | +#define IRQ_UARTINT0 2 | |
| 28 | +#define IRQ_UARTINT1 3 | |
| 29 | +#define IRQ_KMIINT0 4 | |
| 30 | +#define IRQ_KMIINT1 5 | |
| 31 | +#define IRQ_TIMERINT0 6 | |
| 32 | +#define IRQ_TIMERINT1 7 | |
| 33 | +#define IRQ_TIMERINT2 8 | |
| 34 | +#define IRQ_RTCINT 9 | |
| 35 | +#define IRQ_AP_EXPINT0 10 | |
| 36 | +#define IRQ_AP_EXPINT1 11 | |
| 37 | +#define IRQ_AP_EXPINT2 12 | |
| 38 | +#define IRQ_AP_EXPINT3 13 | |
| 39 | +#define IRQ_AP_PCIINT0 14 | |
| 40 | +#define IRQ_AP_PCIINT1 15 | |
| 41 | +#define IRQ_AP_PCIINT2 16 | |
| 42 | +#define IRQ_AP_PCIINT3 17 | |
| 43 | +#define IRQ_AP_V3INT 18 | |
| 44 | +#define IRQ_AP_CPINT0 19 | |
| 45 | +#define IRQ_AP_CPINT1 20 | |
| 46 | +#define IRQ_AP_LBUSTIMEOUT 21 | |
| 47 | +#define IRQ_AP_APCINT 22 | |
| 48 | +#define IRQ_CP_CLCDCINT 23 | |
| 49 | +#define IRQ_CP_MMCIINT0 24 | |
| 50 | +#define IRQ_CP_MMCIINT1 25 | |
| 51 | +#define IRQ_CP_AACIINT 26 | |
| 52 | +#define IRQ_CP_CPPLDINT 27 | |
| 53 | +#define IRQ_CP_ETHINT 28 | |
| 54 | +#define IRQ_CP_TSPENINT 29 | |
| 55 | +#define IRQ_PIC_END 29 | |
| 56 | 56 | |
| 57 | 57 | #define IRQ_CIC_START 32 |
| 58 | 58 | #define IRQ_CM_SOFTINT 32 |
| @@ -80,4 +80,3 @@ · 21 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | #define NR_IRQS_INTEGRATOR_AP 34 |
| 82 | 82 | #define NR_IRQS_INTEGRATOR_CP 47 |
| 83 | − | |
| @@ -162,12 +162,6 @@ static void __init ap_map_io(void) · 161 unmodified lines | ||
| 162 | 162 | |
| 163 | 163 | #define INTEGRATOR_SC_VALID_INT 0x003fffff |
| 164 | 164 | |
| 165 | −static struct fpga_irq_data sc_irq_data = { | |
| 166 | − .base = VA_IC_BASE, | |
| 167 | − .irq_start = 0, | |
| 168 | − .chip.name = "SC", | |
| 169 | −}; | |
| 170 | − | |
| 171 | 165 | static void __init ap_init_irq(void) |
| 172 | 166 | { |
| 173 | 167 | /* Disable all interrupts initially. */ |
| @@ -178,7 +172,8 @@ static void __init ap_init_irq(void) · 4 unmodified lines | ||
| 178 | 172 | writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); |
| 179 | 173 | writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); |
| 180 | 174 | |
| 181 | − fpga_irq_init(-1, INTEGRATOR_SC_VALID_INT, &sc_irq_data); | |
| 175 | + fpga_irq_init(VA_IC_BASE, "SC", IRQ_PIC_START, | |
| 176 | + -1, INTEGRATOR_SC_VALID_INT, NULL); | |
| 182 | 177 | } |
| 183 | 178 | |
| 184 | 179 | #ifdef CONFIG_PM |
| @@ -478,6 +473,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator") · 293 unmodified lines | ||
| 478 | 473 | .nr_irqs = NR_IRQS_INTEGRATOR_AP, |
| 479 | 474 | .init_early = integrator_init_early, |
| 480 | 475 | .init_irq = ap_init_irq, |
| 476 | + .handle_irq = fpga_handle_irq, | |
| 481 | 477 | .timer = &ap_timer, |
| 482 | 478 | .init_machine = ap_init, |
| 483 | 479 | .restart = integrator_restart, |
| @@ -143,30 +143,14 @@ static void __init intcp_map_io(void) · 142 unmodified lines | ||
| 143 | 143 | iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc)); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | −static struct fpga_irq_data cic_irq_data = { | |
| 147 | − .base = INTCP_VA_CIC_BASE, | |
| 148 | − .irq_start = IRQ_CIC_START, | |
| 149 | − .chip.name = "CIC", | |
| 150 | −}; | |
| 151 | − | |
| 152 | −static struct fpga_irq_data pic_irq_data = { | |
| 153 | − .base = INTCP_VA_PIC_BASE, | |
| 154 | − .irq_start = IRQ_PIC_START, | |
| 155 | − .chip.name = "PIC", | |
| 156 | −}; | |
| 157 | − | |
| 158 | −static struct fpga_irq_data sic_irq_data = { | |
| 159 | − .base = INTCP_VA_SIC_BASE, | |
| 160 | − .irq_start = IRQ_SIC_START, | |
| 161 | − .chip.name = "SIC", | |
| 162 | −}; | |
| 163 | − | |
| 164 | 146 | static void __init intcp_init_irq(void) |
| 165 | 147 | { |
| 166 | − u32 pic_mask, sic_mask; | |
| 148 | + u32 pic_mask, cic_mask, sic_mask; | |
| 167 | 149 | |
| 150 | + /* These masks are for the HW IRQ registers */ | |
| 168 | 151 | pic_mask = ~((~0u) << (11 - IRQ_PIC_START)); |
| 169 | 152 | pic_mask |= (~((~0u) << (29 - 22))) << 22; |
| 153 | + cic_mask = ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)); | |
| 170 | 154 | sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START)); |
| 171 | 155 | |
| 172 | 156 | /* |
| @@ -179,12 +163,14 @@ static void __init intcp_init_irq(void) · 6 unmodified lines | ||
| 179 | 163 | writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); |
| 180 | 164 | writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR); |
| 181 | 165 | |
| 182 | − fpga_irq_init(-1, pic_mask, &pic_irq_data); | |
| 166 | + fpga_irq_init(INTCP_VA_PIC_BASE, "PIC", IRQ_PIC_START, | |
| 167 | + -1, pic_mask, NULL); | |
| 183 | 168 | |
| 184 | − fpga_irq_init(-1, ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)), | |
| 185 | − &cic_irq_data); | |
| 169 | + fpga_irq_init(INTCP_VA_CIC_BASE, "CIC", IRQ_CIC_START, | |
| 170 | + -1, cic_mask, NULL); | |
| 186 | 171 | |
| 187 | − fpga_irq_init(IRQ_CP_CPPLDINT, sic_mask, &sic_irq_data); | |
| 172 | + fpga_irq_init(INTCP_VA_SIC_BASE, "SIC", IRQ_SIC_START, | |
| 173 | + IRQ_CP_CPPLDINT, sic_mask, NULL); | |
| 188 | 174 | } |
| 189 | 175 | |
| 190 | 176 | /* |
| @@ -467,6 +453,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") · 276 unmodified lines | ||
| 467 | 453 | .nr_irqs = NR_IRQS_INTEGRATOR_CP, |
| 468 | 454 | .init_early = intcp_init_early, |
| 469 | 455 | .init_irq = intcp_init_irq, |
| 456 | + .handle_irq = fpga_handle_irq, | |
| 470 | 457 | .timer = &cp_timer, |
| 471 | 458 | .init_machine = intcp_init, |
| 472 | 459 | .restart = integrator_restart, |
| @@ -70,21 +70,10 @@ · 69 unmodified lines | ||
| 70 | 70 | */ |
| 71 | 71 | static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp) |
| 72 | 72 | { |
| 73 | − int pin = *pinp; | |
| 73 | + if (*pinp == 0) | |
| 74 | + *pinp = 1; | |
| 74 | 75 | |
| 75 | − if (pin == 0) | |
| 76 | − pin = 1; | |
| 77 | − | |
| 78 | − while (dev->bus->self) { | |
| 79 | − pin = pci_swizzle_interrupt_pin(dev, pin); | |
| 80 | − /* | |
| 81 | − * move up the chain of bridges, swizzling as we go. | |
| 82 | − */ | |
| 83 | − dev = dev->bus->self; | |
| 84 | − } | |
| 85 | − *pinp = pin; | |
| 86 | − | |
| 87 | − return PCI_SLOT(dev->devfn); | |
| 76 | + return pci_common_swizzle(dev, pinp); | |
| 88 | 77 | } |
| 89 | 78 | |
| 90 | 79 | static int irq_tab[4] __initdata = { |
| @@ -109,7 +98,7 @@ static struct hw_pci integrator_pci __initdata = { · 18 unmodified lines | ||
| 109 | 98 | .map_irq = integrator_map_irq, |
| 110 | 99 | .setup = pci_v3_setup, |
| 111 | 100 | .nr_controllers = 1, |
| 112 | − .scan = pci_v3_scan_bus, | |
| 101 | + .ops = &pci_v3_ops, | |
| 113 | 102 | .preinit = pci_v3_preinit, |
| 114 | 103 | .postinit = pci_v3_postinit, |
| 115 | 104 | }; |
| @@ -340,7 +340,7 @@ static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where, · 339 unmodified lines | ||
| 340 | 340 | return PCIBIOS_SUCCESSFUL; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | −static struct pci_ops pci_v3_ops = { | |
| 343 | +struct pci_ops pci_v3_ops = { | |
| 344 | 344 | .read = v3_read_config, |
| 345 | 345 | .write = v3_write_config, |
| 346 | 346 | }; |
| @@ -488,12 +488,6 @@ int __init pci_v3_setup(int nr, struct pci_sys_data *sys) · 141 unmodified lines | ||
| 488 | 488 | return ret; |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | −struct pci_bus * __init pci_v3_scan_bus(int nr, struct pci_sys_data *sys) | |
| 492 | −{ | |
| 493 | − return pci_scan_root_bus(NULL, sys->busnr, &pci_v3_ops, sys, | |
| 494 | − &sys->resources); | |
| 495 | −} | |
| 496 | − | |
| 497 | 491 | /* |
| 498 | 492 | * V3_LB_BASE? - local bus address |
| 499 | 493 | * V3_LB_MAP? - pci bus address |
| @@ -54,7 +54,6 @@ iq81340mc_pcix_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin) · 53 unmodified lines | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static struct hw_pci iq81340mc_pci __initdata = { |
| 57 | − .swizzle = pci_std_swizzle, | |
| 58 | 57 | .nr_controllers = 0, |
| 59 | 58 | .setup = iop13xx_pci_setup, |
| 60 | 59 | .map_irq = iq81340mc_pcix_map_irq, |
| @@ -56,7 +56,6 @@ iq81340sc_atux_map_irq(struct pci_dev *dev, u8 idsel, u8 pin) · 55 unmodified lines | ||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static struct hw_pci iq81340sc_pci __initdata = { |
| 59 | − .swizzle = pci_std_swizzle, | |
| 60 | 59 | .nr_controllers = 0, |
| 61 | 60 | .setup = iop13xx_pci_setup, |
| 62 | 61 | .scan = iop13xx_scan_bus, |
| @@ -103,11 +103,10 @@ em7210_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 102 unmodified lines | ||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | static struct hw_pci em7210_pci __initdata = { |
| 106 | − .swizzle = pci_std_swizzle, | |
| 107 | 106 | .nr_controllers = 1, |
| 107 | + .ops = &iop3xx_ops, | |
| 108 | 108 | .setup = iop3xx_pci_setup, |
| 109 | 109 | .preinit = iop3xx_pci_preinit, |
| 110 | − .scan = iop3xx_pci_scan_bus, | |
| 111 | 110 | .map_irq = em7210_pci_map_irq, |
| 112 | 111 | }; |
| 113 | 112 | |
| @@ -96,11 +96,10 @@ glantank_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 95 unmodified lines | ||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | static struct hw_pci glantank_pci __initdata = { |
| 99 | − .swizzle = pci_std_swizzle, | |
| 100 | 99 | .nr_controllers = 1, |
| 100 | + .ops = &iop3xx_ops, | |
| 101 | 101 | .setup = iop3xx_pci_setup, |
| 102 | 102 | .preinit = iop3xx_pci_preinit, |
| 103 | − .scan = iop3xx_pci_scan_bus, | |
| 104 | 103 | .map_irq = glantank_pci_map_irq, |
| 105 | 104 | }; |
| 106 | 105 | |
| @@ -130,11 +130,10 @@ ep80219_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 129 unmodified lines | ||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static struct hw_pci ep80219_pci __initdata = { |
| 133 | − .swizzle = pci_std_swizzle, | |
| 134 | 133 | .nr_controllers = 1, |
| 134 | + .ops = &iop3xx_ops, | |
| 135 | 135 | .setup = iop3xx_pci_setup, |
| 136 | 136 | .preinit = iop3xx_pci_preinit, |
| 137 | − .scan = iop3xx_pci_scan_bus, | |
| 138 | 137 | .map_irq = ep80219_pci_map_irq, |
| 139 | 138 | }; |
| 140 | 139 | |
| @@ -166,11 +165,10 @@ iq31244_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 25 unmodified lines | ||
| 166 | 165 | } |
| 167 | 166 | |
| 168 | 167 | static struct hw_pci iq31244_pci __initdata = { |
| 169 | − .swizzle = pci_std_swizzle, | |
| 170 | 168 | .nr_controllers = 1, |
| 169 | + .ops = &iop3xx_ops, | |
| 171 | 170 | .setup = iop3xx_pci_setup, |
| 172 | 171 | .preinit = iop3xx_pci_preinit, |
| 173 | − .scan = iop3xx_pci_scan_bus, | |
| 174 | 172 | .map_irq = iq31244_pci_map_irq, |
| 175 | 173 | }; |
| 176 | 174 | |
| @@ -101,11 +101,10 @@ iq80321_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 100 unmodified lines | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static struct hw_pci iq80321_pci __initdata = { |
| 104 | − .swizzle = pci_std_swizzle, | |
| 105 | 104 | .nr_controllers = 1, |
| 105 | + .ops = &iop3xx_ops, | |
| 106 | 106 | .setup = iop3xx_pci_setup, |
| 107 | 107 | .preinit = iop3xx_pci_preinit_cond, |
| 108 | − .scan = iop3xx_pci_scan_bus, | |
| 109 | 108 | .map_irq = iq80321_pci_map_irq, |
| 110 | 109 | }; |
| 111 | 110 | |
| @@ -114,11 +114,10 @@ n2100_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 113 unmodified lines | ||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static struct hw_pci n2100_pci __initdata = { |
| 117 | − .swizzle = pci_std_swizzle, | |
| 118 | 117 | .nr_controllers = 1, |
| 118 | + .ops = &iop3xx_ops, | |
| 119 | 119 | .setup = iop3xx_pci_setup, |
| 120 | 120 | .preinit = iop3xx_pci_preinit, |
| 121 | − .scan = iop3xx_pci_scan_bus, | |
| 122 | 121 | .map_irq = n2100_pci_map_irq, |
| 123 | 122 | }; |
| 124 | 123 | |
| @@ -84,11 +84,10 @@ iq80331_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 83 unmodified lines | ||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static struct hw_pci iq80331_pci __initdata = { |
| 87 | − .swizzle = pci_std_swizzle, | |
| 88 | 87 | .nr_controllers = 1, |
| 88 | + .ops = &iop3xx_ops, | |
| 89 | 89 | .setup = iop3xx_pci_setup, |
| 90 | 90 | .preinit = iop3xx_pci_preinit_cond, |
| 91 | − .scan = iop3xx_pci_scan_bus, | |
| 92 | 91 | .map_irq = iq80331_pci_map_irq, |
| 93 | 92 | }; |
| 94 | 93 | |
| @@ -84,11 +84,10 @@ iq80332_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 83 unmodified lines | ||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static struct hw_pci iq80332_pci __initdata = { |
| 87 | − .swizzle = pci_std_swizzle, | |
| 88 | 87 | .nr_controllers = 1, |
| 88 | + .ops = &iop3xx_ops, | |
| 89 | 89 | .setup = iop3xx_pci_setup, |
| 90 | 90 | .preinit = iop3xx_pci_preinit_cond, |
| 91 | − .scan = iop3xx_pci_scan_bus, | |
| 92 | 91 | .map_irq = iq80332_pci_map_irq, |
| 93 | 92 | }; |
| 94 | 93 | |
| @@ -141,13 +141,6 @@ static struct pci_ops enp2611_pci_ops = { · 140 unmodified lines | ||
| 141 | 141 | .write = enp2611_pci_write_config |
| 142 | 142 | }; |
| 143 | 143 | |
| 144 | −static struct pci_bus * __init enp2611_pci_scan_bus(int nr, | |
| 145 | − struct pci_sys_data *sys) | |
| 146 | −{ | |
| 147 | − return pci_scan_root_bus(NULL, sys->busnr, &enp2611_pci_ops, sys, | |
| 148 | − &sys->resources); | |
| 149 | −} | |
| 150 | − | |
| 151 | 144 | static int __init enp2611_pci_map_irq(const struct pci_dev *dev, u8 slot, |
| 152 | 145 | u8 pin) |
| 153 | 146 | { |
| @@ -180,9 +173,9 @@ static int __init enp2611_pci_map_irq(const struct pci_dev *dev, u8 slot, · 26 unmodified lines | ||
| 180 | 173 | |
| 181 | 174 | struct hw_pci enp2611_pci __initdata = { |
| 182 | 175 | .nr_controllers = 1, |
| 176 | + .ops = &enp2611_pci_ops, | |
| 183 | 177 | .setup = enp2611_pci_setup, |
| 184 | 178 | .preinit = enp2611_pci_preinit, |
| 185 | − .scan = enp2611_pci_scan_bus, | |
| 186 | 179 | .map_irq = enp2611_pci_map_irq, |
| 187 | 180 | }; |
| 188 | 181 | |
| @@ -127,10 +127,10 @@ unsigned long ixp2000_gettimeoffset(void); · 126 unmodified lines | ||
| 127 | 127 | |
| 128 | 128 | struct pci_sys_data; |
| 129 | 129 | |
| 130 | +extern struct pci_ops ixp2000_pci_ops; | |
| 130 | 131 | u32 *ixp2000_pci_config_addr(unsigned int bus, unsigned int devfn, int where); |
| 131 | 132 | void ixp2000_pci_preinit(void); |
| 132 | 133 | int ixp2000_pci_setup(int, struct pci_sys_data*); |
| 133 | −struct pci_bus* ixp2000_pci_scan_bus(int, struct pci_sys_data*); | |
| 134 | 134 | int ixp2000_pci_read_config(struct pci_bus*, unsigned int, int, int, u32 *); |
| 135 | 135 | int ixp2000_pci_write_config(struct pci_bus*, unsigned int, int, int, u32); |
| 136 | 136 | |
| @@ -146,10 +146,10 @@ static void ixdp2400_pci_postinit(void) · 145 unmodified lines | ||
| 146 | 146 | |
| 147 | 147 | static struct hw_pci ixdp2400_pci __initdata = { |
| 148 | 148 | .nr_controllers = 1, |
| 149 | + .ops = &ixp2000_pci_ops, | |
| 149 | 150 | .setup = ixdp2400_pci_setup, |
| 150 | 151 | .preinit = ixdp2400_pci_preinit, |
| 151 | 152 | .postinit = ixdp2400_pci_postinit, |
| 152 | − .scan = ixp2000_pci_scan_bus, | |
| 153 | 153 | .map_irq = ixdp2400_pci_map_irq, |
| 154 | 154 | }; |
| 155 | 155 | |
| @@ -246,10 +246,10 @@ static void __init ixdp2800_pci_postinit(void) · 245 unmodified lines | ||
| 246 | 246 | |
| 247 | 247 | struct __initdata hw_pci ixdp2800_pci __initdata = { |
| 248 | 248 | .nr_controllers = 1, |
| 249 | + .ops = &ixp2000_pci_ops, | |
| 249 | 250 | .setup = ixdp2800_pci_setup, |
| 250 | 251 | .preinit = ixdp2800_pci_preinit, |
| 251 | 252 | .postinit = ixdp2800_pci_postinit, |
| 252 | − .scan = ixp2000_pci_scan_bus, | |
| 253 | 253 | .map_irq = ixdp2800_pci_map_irq, |
| 254 | 254 | }; |
| 255 | 255 | |
| @@ -327,9 +327,9 @@ static int ixdp2x01_pci_setup(int nr, struct pci_sys_data *sys) · 326 unmodified lines | ||
| 327 | 327 | |
| 328 | 328 | struct hw_pci ixdp2x01_pci __initdata = { |
| 329 | 329 | .nr_controllers = 1, |
| 330 | + .ops = &ixp2000_pci_ops, | |
| 330 | 331 | .setup = ixdp2x01_pci_setup, |
| 331 | 332 | .preinit = ixdp2x01_pci_preinit, |
| 332 | − .scan = ixp2000_pci_scan_bus, | |
| 333 | 333 | .map_irq = ixdp2x01_pci_map_irq, |
| 334 | 334 | }; |
| 335 | 335 | |
| @@ -124,17 +124,11 @@ int ixp2000_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, · 123 unmodified lines | ||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | −static struct pci_ops ixp2000_pci_ops = { | |
| 127 | +struct pci_ops ixp2000_pci_ops = { | |
| 128 | 128 | .read = ixp2000_pci_read_config, |
| 129 | 129 | .write = ixp2000_pci_write_config |
| 130 | 130 | }; |
| 131 | 131 | |
| 132 | −struct pci_bus *ixp2000_pci_scan_bus(int nr, struct pci_sys_data *sysdata) | |
| 133 | −{ | |
| 134 | − return pci_scan_root_bus(NULL, sysdata->busnr, &ixp2000_pci_ops, | |
| 135 | − sysdata, &sysdata->resources); | |
| 136 | −} | |
| 137 | − | |
| 138 | 132 | |
| 139 | 133 | int ixp2000_pci_abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
| 140 | 134 | { |
| @@ -37,7 +37,7 @@ void ixp23xx_sys_init(void); · 36 unmodified lines | ||
| 37 | 37 | void ixp23xx_restart(char, const char *); |
| 38 | 38 | int ixp23xx_pci_setup(int, struct pci_sys_data *); |
| 39 | 39 | void ixp23xx_pci_preinit(void); |
| 40 | −struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); | |
| 40 | +extern struct pci_ops ixp23xx_pci_ops; | |
| 41 | 41 | void ixp23xx_pci_slave_init(void); |
| 42 | 42 | |
| 43 | 43 | extern struct sys_timer ixp23xx_timer; |
| @@ -251,9 +251,9 @@ static int __init ixdp2351_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 250 unmodified lines | ||
| 251 | 251 | |
| 252 | 252 | struct hw_pci ixdp2351_pci __initdata = { |
| 253 | 253 | .nr_controllers = 1, |
| 254 | + .ops = &ixp23xx_pci_ops, | |
| 254 | 255 | .preinit = ixp23xx_pci_preinit, |
| 255 | 256 | .setup = ixp23xx_pci_setup, |
| 256 | − .scan = ixp23xx_pci_scan_bus, | |
| 257 | 257 | .map_irq = ixdp2351_map_irq, |
| 258 | 258 | }; |
| 259 | 259 | |
| @@ -140,12 +140,6 @@ struct pci_ops ixp23xx_pci_ops = { · 139 unmodified lines | ||
| 140 | 140 | .write = ixp23xx_pci_write_config, |
| 141 | 141 | }; |
| 142 | 142 | |
| 143 | −struct pci_bus *ixp23xx_pci_scan_bus(int nr, struct pci_sys_data *sysdata) | |
| 144 | −{ | |
| 145 | − return pci_scan_root_bus(NULL, sysdata->busnr, &ixp23xx_pci_ops, | |
| 146 | − sysdata, &sysdata->resources); | |
| 147 | −} | |
| 148 | − | |
| 149 | 143 | int ixp23xx_pci_abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
| 150 | 144 | { |
| 151 | 145 | volatile unsigned long temp; |
| @@ -118,9 +118,9 @@ static void __init roadrunner_pci_preinit(void) · 117 unmodified lines | ||
| 118 | 118 | |
| 119 | 119 | static struct hw_pci roadrunner_pci __initdata = { |
| 120 | 120 | .nr_controllers = 1, |
| 121 | + .ops = &ixp23xx_pci_ops, | |
| 121 | 122 | .preinit = roadrunner_pci_preinit, |
| 122 | 123 | .setup = ixp23xx_pci_setup, |
| 123 | − .scan = ixp23xx_pci_scan_bus, | |
| 124 | 124 | .map_irq = roadrunner_map_irq, |
| 125 | 125 | }; |
| 126 | 126 | |
| @@ -65,10 +65,9 @@ static int __init avila_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 64 unmodified lines | ||
| 65 | 65 | |
| 66 | 66 | struct hw_pci avila_pci __initdata = { |
| 67 | 67 | .nr_controllers = 1, |
| 68 | + .ops = &ixp4xx_ops, | |
| 68 | 69 | .preinit = avila_pci_preinit, |
| 69 | − .swizzle = pci_std_swizzle, | |
| 70 | 70 | .setup = ixp4xx_setup, |
| 71 | − .scan = ixp4xx_scan_bus, | |
| 72 | 71 | .map_irq = avila_map_irq, |
| 73 | 72 | }; |
| 74 | 73 | |
| @@ -480,12 +480,6 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys) · 479 unmodified lines | ||
| 480 | 480 | return 1; |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | −struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) | |
| 484 | −{ | |
| 485 | − return pci_scan_root_bus(NULL, sys->busnr, &ixp4xx_ops, sys, | |
| 486 | − &sys->resources); | |
| 487 | −} | |
| 488 | − | |
| 489 | 483 | int dma_set_coherent_mask(struct device *dev, u64 mask) |
| 490 | 484 | { |
| 491 | 485 | if (mask >= SZ_64M - 1) |
| @@ -48,10 +48,9 @@ static int __init coyote_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 47 unmodified lines | ||
| 48 | 48 | |
| 49 | 49 | struct hw_pci coyote_pci __initdata = { |
| 50 | 50 | .nr_controllers = 1, |
| 51 | + .ops = &ixp4xx_ops, | |
| 51 | 52 | .preinit = coyote_pci_preinit, |
| 52 | − .swizzle = pci_std_swizzle, | |
| 53 | 53 | .setup = ixp4xx_setup, |
| 54 | − .scan = ixp4xx_scan_bus, | |
| 55 | 54 | .map_irq = coyote_map_irq, |
| 56 | 55 | }; |
| 57 | 56 | |
| @@ -62,10 +62,9 @@ static int __init dsmg600_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 61 unmodified lines | ||
| 62 | 62 | |
| 63 | 63 | struct hw_pci __initdata dsmg600_pci = { |
| 64 | 64 | .nr_controllers = 1, |
| 65 | + .ops = &ixp4xx_ops, | |
| 65 | 66 | .preinit = dsmg600_pci_preinit, |
| 66 | − .swizzle = pci_std_swizzle, | |
| 67 | 67 | .setup = ixp4xx_setup, |
| 68 | − .scan = ixp4xx_scan_bus, | |
| 69 | 68 | .map_irq = dsmg600_map_irq, |
| 70 | 69 | }; |
| 71 | 70 | |
| @@ -59,10 +59,9 @@ static int __init fsg_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | struct hw_pci fsg_pci __initdata = { |
| 61 | 61 | .nr_controllers = 1, |
| 62 | + .ops = &ixp4xx_ops, | |
| 62 | 63 | .preinit = fsg_pci_preinit, |
| 63 | − .swizzle = pci_std_swizzle, | |
| 64 | 64 | .setup = ixp4xx_setup, |
| 65 | − .scan = ixp4xx_scan_bus, | |
| 66 | 65 | .map_irq = fsg_map_irq, |
| 67 | 66 | }; |
| 68 | 67 | |
| @@ -47,10 +47,9 @@ static int __init gateway7001_map_irq(const struct pci_dev *dev, u8 slot, · 46 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | struct hw_pci gateway7001_pci __initdata = { |
| 49 | 49 | .nr_controllers = 1, |
| 50 | + .ops = &ixp4xx_ops, | |
| 50 | 51 | .preinit = gateway7001_pci_preinit, |
| 51 | − .swizzle = pci_std_swizzle, | |
| 52 | 52 | .setup = ixp4xx_setup, |
| 53 | − .scan = ixp4xx_scan_bus, | |
| 54 | 53 | .map_irq = gateway7001_map_irq, |
| 55 | 54 | }; |
| 56 | 55 | |
| @@ -473,11 +473,10 @@ static int __init gmlr_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 472 unmodified lines | ||
| 473 | 473 | |
| 474 | 474 | static struct hw_pci gmlr_hw_pci __initdata = { |
| 475 | 475 | .nr_controllers = 1, |
| 476 | + .ops = &ixp4xx_ops, | |
| 476 | 477 | .preinit = gmlr_pci_preinit, |
| 477 | 478 | .postinit = gmlr_pci_postinit, |
| 478 | − .swizzle = pci_std_swizzle, | |
| 479 | 479 | .setup = ixp4xx_setup, |
| 480 | − .scan = ixp4xx_scan_bus, | |
| 481 | 480 | .map_irq = gmlr_map_irq, |
| 482 | 481 | }; |
| 483 | 482 | |
| @@ -67,10 +67,9 @@ static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 66 unmodified lines | ||
| 67 | 67 | |
| 68 | 68 | struct hw_pci gtwx5715_pci __initdata = { |
| 69 | 69 | .nr_controllers = 1, |
| 70 | + .ops = &ixp4xx_ops, | |
| 70 | 71 | .preinit = gtwx5715_pci_preinit, |
| 71 | − .swizzle = pci_std_swizzle, | |
| 72 | 72 | .setup = ixp4xx_setup, |
| 73 | − .scan = ixp4xx_scan_bus, | |
| 74 | 73 | .map_irq = gtwx5715_map_irq, |
| 75 | 74 | }; |
| 76 | 75 | |
| @@ -130,7 +130,7 @@ extern void ixp4xx_restart(char, const char *); · 129 unmodified lines | ||
| 130 | 130 | extern void ixp4xx_pci_preinit(void); |
| 131 | 131 | struct pci_sys_data; |
| 132 | 132 | extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); |
| 133 | −extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); | |
| 133 | +extern struct pci_ops ixp4xx_ops; | |
| 134 | 134 | |
| 135 | 135 | /* |
| 136 | 136 | * GPIO-functions |
| @@ -60,10 +60,9 @@ static int __init ixdp425_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 59 unmodified lines | ||
| 60 | 60 | |
| 61 | 61 | struct hw_pci ixdp425_pci __initdata = { |
| 62 | 62 | .nr_controllers = 1, |
| 63 | + .ops = &ixp4xx_ops, | |
| 63 | 64 | .preinit = ixdp425_pci_preinit, |
| 64 | − .swizzle = pci_std_swizzle, | |
| 65 | 65 | .setup = ixp4xx_setup, |
| 66 | − .scan = ixp4xx_scan_bus, | |
| 67 | 66 | .map_irq = ixdp425_map_irq, |
| 68 | 67 | }; |
| 69 | 68 | |
| @@ -42,10 +42,9 @@ static int __init ixdpg425_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | struct hw_pci ixdpg425_pci __initdata = { |
| 44 | 44 | .nr_controllers = 1, |
| 45 | + .ops = &ixp4xx_ops, | |
| 45 | 46 | .preinit = ixdpg425_pci_preinit, |
| 46 | − .swizzle = pci_std_swizzle, | |
| 47 | 47 | .setup = ixp4xx_setup, |
| 48 | − .scan = ixp4xx_scan_bus, | |
| 49 | 48 | .map_irq = ixdpg425_map_irq, |
| 50 | 49 | }; |
| 51 | 50 | |
| @@ -61,10 +61,9 @@ static int __init miccpt_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 60 unmodified lines | ||
| 61 | 61 | |
| 62 | 62 | struct hw_pci miccpt_pci __initdata = { |
| 63 | 63 | .nr_controllers = 1, |
| 64 | + .ops = &ixp4xx_ops, | |
| 64 | 65 | .preinit = miccpt_pci_preinit, |
| 65 | − .swizzle = pci_std_swizzle, | |
| 66 | 66 | .setup = ixp4xx_setup, |
| 67 | − .scan = ixp4xx_scan_bus, | |
| 68 | 67 | .map_irq = miccpt_map_irq, |
| 69 | 68 | }; |
| 70 | 69 | |
| @@ -58,10 +58,9 @@ static int __init nas100d_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 57 unmodified lines | ||
| 58 | 58 | |
| 59 | 59 | struct hw_pci __initdata nas100d_pci = { |
| 60 | 60 | .nr_controllers = 1, |
| 61 | + .ops = &ixp4xx_ops, | |
| 61 | 62 | .preinit = nas100d_pci_preinit, |
| 62 | − .swizzle = pci_std_swizzle, | |
| 63 | 63 | .setup = ixp4xx_setup, |
| 64 | − .scan = ixp4xx_scan_bus, | |
| 65 | 64 | .map_irq = nas100d_map_irq, |
| 66 | 65 | }; |
| 67 | 66 | |
| @@ -54,10 +54,9 @@ static int __init nslu2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 53 unmodified lines | ||
| 54 | 54 | |
| 55 | 55 | struct hw_pci __initdata nslu2_pci = { |
| 56 | 56 | .nr_controllers = 1, |
| 57 | + .ops = &ixp4xx_ops, | |
| 57 | 58 | .preinit = nslu2_pci_preinit, |
| 58 | − .swizzle = pci_std_swizzle, | |
| 59 | 59 | .setup = ixp4xx_setup, |
| 60 | − .scan = ixp4xx_scan_bus, | |
| 61 | 60 | .map_irq = nslu2_map_irq, |
| 62 | 61 | }; |
| 63 | 62 | |
| @@ -56,10 +56,9 @@ static int __init vulcan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 55 unmodified lines | ||
| 56 | 56 | |
| 57 | 57 | struct hw_pci vulcan_pci __initdata = { |
| 58 | 58 | .nr_controllers = 1, |
| 59 | + .ops = &ixp4xx_ops, | |
| 59 | 60 | .preinit = vulcan_pci_preinit, |
| 60 | − .swizzle = pci_std_swizzle, | |
| 61 | 61 | .setup = ixp4xx_setup, |
| 62 | − .scan = ixp4xx_scan_bus, | |
| 63 | 62 | .map_irq = vulcan_map_irq, |
| 64 | 63 | }; |
| 65 | 64 | |
| @@ -46,10 +46,9 @@ static int __init wg302v2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | struct hw_pci wg302v2_pci __initdata = { |
| 48 | 48 | .nr_controllers = 1, |
| 49 | + .ops = &ixp4xx_ops, | |
| 49 | 50 | .preinit = wg302v2_pci_preinit, |
| 50 | − .swizzle = pci_std_swizzle, | |
| 51 | 51 | .setup = ixp4xx_setup, |
| 52 | − .scan = ixp4xx_scan_bus, | |
| 53 | 52 | .map_irq = wg302v2_map_irq, |
| 54 | 53 | }; |
| 55 | 54 | |
| @@ -44,12 +44,6 @@ struct pcie_port { · 43 unmodified lines | ||
| 44 | 44 | static int pcie_port_map[2]; |
| 45 | 45 | static int num_pcie_ports; |
| 46 | 46 | |
| 47 | −static inline struct pcie_port *bus_to_port(struct pci_bus *bus) | |
| 48 | −{ | |
| 49 | − struct pci_sys_data *sys = bus->sysdata; | |
| 50 | − return sys->private_data; | |
| 51 | −} | |
| 52 | − | |
| 53 | 47 | static int pcie_valid_config(struct pcie_port *pp, int bus, int dev) |
| 54 | 48 | { |
| 55 | 49 | /* |
| @@ -79,7 +73,8 @@ static int pcie_valid_config(struct pcie_port *pp, int bus, int dev) · 23 unmodified lines | ||
| 79 | 73 | static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, |
| 80 | 74 | int size, u32 *val) |
| 81 | 75 | { |
| 82 | − struct pcie_port *pp = bus_to_port(bus); | |
| 76 | + struct pci_sys_data *sys = bus->sysdata; | |
| 77 | + struct pcie_port *pp = sys->private_data; | |
| 83 | 78 | unsigned long flags; |
| 84 | 79 | int ret; |
| 85 | 80 | |
| @@ -98,7 +93,8 @@ static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, · 12 unmodified lines | ||
| 98 | 93 | static int pcie_wr_conf(struct pci_bus *bus, u32 devfn, |
| 99 | 94 | int where, int size, u32 val) |
| 100 | 95 | { |
| 101 | − struct pcie_port *pp = bus_to_port(bus); | |
| 96 | + struct pci_sys_data *sys = bus->sysdata; | |
| 97 | + struct pcie_port *pp = sys->private_data; | |
| 102 | 98 | unsigned long flags; |
| 103 | 99 | int ret; |
| 104 | 100 | |
| @@ -248,13 +244,13 @@ kirkwood_pcie_scan_bus(int nr, struct pci_sys_data *sys) · 143 unmodified lines | ||
| 248 | 244 | static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot, |
| 249 | 245 | u8 pin) |
| 250 | 246 | { |
| 251 | − struct pcie_port *pp = bus_to_port(dev->bus); | |
| 247 | + struct pci_sys_data *sys = dev->sysdata; | |
| 248 | + struct pcie_port *pp = sys->private_data; | |
| 252 | 249 | |
| 253 | 250 | return pp->irq; |
| 254 | 251 | } |
| 255 | 252 | |
| 256 | 253 | static struct hw_pci kirkwood_pci __initdata = { |
| 257 | − .swizzle = pci_std_swizzle, | |
| 258 | 254 | .setup = kirkwood_pcie_setup, |
| 259 | 255 | .scan = kirkwood_pcie_scan_bus, |
| 260 | 256 | .map_irq = kirkwood_pcie_map_irq, |
| @@ -141,12 +141,6 @@ static struct pci_ops ks8695_pci_ops = { · 140 unmodified lines | ||
| 141 | 141 | .write = ks8695_pci_writeconfig, |
| 142 | 142 | }; |
| 143 | 143 | |
| 144 | −static struct pci_bus* __init ks8695_pci_scan_bus(int nr, struct pci_sys_data *sys) | |
| 145 | −{ | |
| 146 | − return pci_scan_root_bus(NULL, sys->busnr, &ks8695_pci_ops, sys, | |
| 147 | − &sys->resources); | |
| 148 | −} | |
| 149 | − | |
| 150 | 144 | static struct resource pci_mem = { |
| 151 | 145 | .name = "PCI Memory space", |
| 152 | 146 | .start = KS8695_PCIMEM_PA, |
| @@ -302,11 +296,10 @@ static void ks8695_show_pciregs(void) · 149 unmodified lines | ||
| 302 | 296 | |
| 303 | 297 | static struct hw_pci ks8695_pci __initdata = { |
| 304 | 298 | .nr_controllers = 1, |
| 299 | + .ops = &ks8695_pci_ops, | |
| 305 | 300 | .preinit = ks8695_pci_preinit, |
| 306 | 301 | .setup = ks8695_pci_setup, |
| 307 | − .scan = ks8695_pci_scan_bus, | |
| 308 | 302 | .postinit = NULL, |
| 309 | − .swizzle = pci_std_swizzle, | |
| 310 | 303 | .map_irq = NULL, |
| 311 | 304 | }; |
| 312 | 305 | |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <linux/irqdomain.h> |
| 18 | 18 | #include <linux/of.h> |
| 19 | 19 | #include <linux/of_address.h> |
| 20 | +#include <linux/of_irq.h> | |
| 20 | 21 | #include <linux/of_platform.h> |
| 21 | 22 | #include <linux/memblock.h> |
| 22 | 23 | |
| @@ -49,10 +50,22 @@ static void __init msm8x60_map_io(void) · 26 unmodified lines | ||
| 49 | 50 | msm_map_msm8x60_io(); |
| 50 | 51 | } |
| 51 | 52 | |
| 53 | +#ifdef CONFIG_OF | |
| 54 | +static struct of_device_id msm_dt_gic_match[] __initdata = { | |
| 55 | + { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init }, | |
| 56 | + {} | |
| 57 | +}; | |
| 58 | +#endif | |
| 59 | + | |
| 52 | 60 | static void __init msm8x60_init_irq(void) |
| 53 | 61 | { |
| 54 | − gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, | |
| 55 | − (void *)MSM_QGIC_CPU_BASE); | |
| 62 | + if (!of_have_populated_dt()) | |
| 63 | + gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, | |
| 64 | + (void *)MSM_QGIC_CPU_BASE); | |
| 65 | +#ifdef CONFIG_OF | |
| 66 | + else | |
| 67 | + of_irq_init(msm_dt_gic_match); | |
| 68 | +#endif | |
| 56 | 69 | |
| 57 | 70 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| 58 | 71 | writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| @@ -73,16 +86,8 @@ static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = { · 14 unmodified lines | ||
| 73 | 86 | {} |
| 74 | 87 | }; |
| 75 | 88 | |
| 76 | −static struct of_device_id msm_dt_gic_match[] __initdata = { | |
| 77 | − { .compatible = "qcom,msm-8660-qgic", }, | |
| 78 | − {} | |
| 79 | −}; | |
| 80 | − | |
| 81 | 89 | static void __init msm8x60_dt_init(void) |
| 82 | 90 | { |
| 83 | − irq_domain_generate_simple(msm_dt_gic_match, MSM8X60_QGIC_DIST_PHYS, | |
| 84 | − GIC_SPI_START); | |
| 85 | − | |
| 86 | 91 | if (of_machine_is_compatible("qcom,msm8660-surf")) { |
| 87 | 92 | printk(KERN_INFO "Init surf UART registers\n"); |
| 88 | 93 | msm8x60_init_uart12dm(); |
| @@ -147,6 +147,7 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) · 146 unmodified lines | ||
| 147 | 147 | return 0; |
| 148 | 148 | |
| 149 | 149 | pp = &pcie_port[nr]; |
| 150 | + sys->private_data = pp; | |
| 150 | 151 | pp->root_bus_nr = sys->busnr; |
| 151 | 152 | |
| 152 | 153 | /* |
| @@ -161,19 +162,6 @@ static int __init mv78xx0_pcie_setup(int nr, struct pci_sys_data *sys) · 8 unmodified lines | ||
| 161 | 162 | return 1; |
| 162 | 163 | } |
| 163 | 164 | |
| 164 | −static struct pcie_port *bus_to_port(int bus) | |
| 165 | −{ | |
| 166 | − int i; | |
| 167 | − | |
| 168 | − for (i = num_pcie_ports - 1; i >= 0; i--) { | |
| 169 | − int rbus = pcie_port[i].root_bus_nr; | |
| 170 | − if (rbus != -1 && rbus <= bus) | |
| 171 | − break; | |
| 172 | − } | |
| 173 | − | |
| 174 | − return i >= 0 ? pcie_port + i : NULL; | |
| 175 | −} | |
| 176 | − | |
| 177 | 165 | static int pcie_valid_config(struct pcie_port *pp, int bus, int dev) |
| 178 | 166 | { |
| 179 | 167 | /* |
| @@ -189,7 +177,8 @@ static int pcie_valid_config(struct pcie_port *pp, int bus, int dev) · 9 unmodified lines | ||
| 189 | 177 | static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, |
| 190 | 178 | int size, u32 *val) |
| 191 | 179 | { |
| 192 | − struct pcie_port *pp = bus_to_port(bus->number); | |
| 180 | + struct pci_sys_data *sys = bus->sysdata; | |
| 181 | + struct pcie_port *pp = sys->private_data; | |
| 193 | 182 | unsigned long flags; |
| 194 | 183 | int ret; |
| 195 | 184 | |
| @@ -208,7 +197,8 @@ static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, · 12 unmodified lines | ||
| 208 | 197 | static int pcie_wr_conf(struct pci_bus *bus, u32 devfn, |
| 209 | 198 | int where, int size, u32 val) |
| 210 | 199 | { |
| 211 | − struct pcie_port *pp = bus_to_port(bus->number); | |
| 200 | + struct pci_sys_data *sys = bus->sysdata; | |
| 201 | + struct pcie_port *pp = sys->private_data; | |
| 212 | 202 | unsigned long flags; |
| 213 | 203 | int ret; |
| 214 | 204 | |
| @@ -263,7 +253,8 @@ mv78xx0_pcie_scan_bus(int nr, struct pci_sys_data *sys) · 48 unmodified lines | ||
| 263 | 253 | static int __init mv78xx0_pcie_map_irq(const struct pci_dev *dev, u8 slot, |
| 264 | 254 | u8 pin) |
| 265 | 255 | { |
| 266 | − struct pcie_port *pp = bus_to_port(dev->bus->number); | |
| 256 | + struct pci_sys_data *sys = dev->bus->sysdata; | |
| 257 | + struct pcie_port *pp = sys->private_data; | |
| 267 | 258 | |
| 268 | 259 | return IRQ_MV78XX0_PCIE_00 + (pp->maj << 2) + pp->min; |
| 269 | 260 | } |
| @@ -271,7 +262,6 @@ static int __init mv78xx0_pcie_map_irq(const struct pci_dev *dev, u8 slot, · 1 unmodified line | ||
| 271 | 262 | static struct hw_pci mv78xx0_pci __initdata = { |
| 272 | 263 | .nr_controllers = 8, |
| 273 | 264 | .preinit = mv78xx0_pcie_preinit, |
| 274 | − .swizzle = pci_std_swizzle, | |
| 275 | 265 | .setup = mv78xx0_pcie_setup, |
| 276 | 266 | .scan = mv78xx0_pcie_scan_bus, |
| 277 | 267 | .map_irq = mv78xx0_pcie_map_irq, |
| @@ -27,6 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | #include <linux/io.h> |
| 28 | 28 | #include <linux/spinlock.h> |
| 29 | 29 | |
| 30 | +#include <mach/hardware.h> | |
| 30 | 31 | |
| 31 | 32 | #include <plat/mux.h> |
| 32 | 33 | |
| @@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev, · 46 unmodified lines | ||
| 47 | 47 | int n = (pdev->id - 1) << 1; |
| 48 | 48 | u32 l; |
| 49 | 49 | |
| 50 | − l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); | |
| 50 | + l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); | |
| 51 | 51 | l |= source << n; |
| 52 | − __raw_writel(l, MOD_CONF_CTRL_1); | |
| 52 | + omap_writel(l, MOD_CONF_CTRL_1); | |
| 53 | 53 | |
| 54 | 54 | return 0; |
| 55 | 55 | } |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/usb/otg.h> |
| 21 | 21 | #include <linux/spi/spi.h> |
| 22 | 22 | #include <linux/i2c/twl.h> |
| 23 | +#include <linux/mfd/twl6040.h> | |
| 23 | 24 | #include <linux/gpio_keys.h> |
| 24 | 25 | #include <linux/regulator/machine.h> |
| 25 | 26 | #include <linux/regulator/fixed.h> |
| @@ -560,7 +561,7 @@ static struct regulator_init_data sdp4430_vusim = { · 534 unmodified lines | ||
| 560 | 561 | }, |
| 561 | 562 | }; |
| 562 | 563 | |
| 563 | −static struct twl4030_codec_data twl6040_codec = { | |
| 564 | +static struct twl6040_codec_data twl6040_codec = { | |
| 564 | 565 | /* single-step ramp for headset and handsfree */ |
| 565 | 566 | .hs_left_step = 0x0f, |
| 566 | 567 | .hs_right_step = 0x0f, |
| @@ -568,7 +569,7 @@ static struct twl4030_codec_data twl6040_codec = { · 1 unmodified line | ||
| 568 | 569 | .hf_right_step = 0x1d, |
| 569 | 570 | }; |
| 570 | 571 | |
| 571 | −static struct twl4030_vibra_data twl6040_vibra = { | |
| 572 | +static struct twl6040_vibra_data twl6040_vibra = { | |
| 572 | 573 | .vibldrv_res = 8, |
| 573 | 574 | .vibrdrv_res = 3, |
| 574 | 575 | .viblmotor_res = 10, |
| @@ -577,16 +578,14 @@ static struct twl4030_vibra_data twl6040_vibra = { · 2 unmodified lines | ||
| 577 | 578 | .vddvibr_uV = 0, /* fixed volt supply - VBAT */ |
| 578 | 579 | }; |
| 579 | 580 | |
| 580 | −static struct twl4030_audio_data twl6040_audio = { | |
| 581 | +static struct twl6040_platform_data twl6040_data = { | |
| 581 | 582 | .codec = &twl6040_codec, |
| 582 | 583 | .vibra = &twl6040_vibra, |
| 583 | 584 | .audpwron_gpio = 127, |
| 584 | − .naudint_irq = OMAP44XX_IRQ_SYS_2N, | |
| 585 | 585 | .irq_base = TWL6040_CODEC_IRQ_BASE, |
| 586 | 586 | }; |
| 587 | 587 | |
| 588 | 588 | static struct twl4030_platform_data sdp4430_twldata = { |
| 589 | − .audio = &twl6040_audio, | |
| 590 | 589 | /* Regulators */ |
| 591 | 590 | .vusim = &sdp4430_vusim, |
| 592 | 591 | .vaux1 = &sdp4430_vaux1, |
| @@ -617,7 +616,8 @@ static int __init omap4_i2c_init(void) · 24 unmodified lines | ||
| 617 | 616 | TWL_COMMON_REGULATOR_VCXIO | |
| 618 | 617 | TWL_COMMON_REGULATOR_VUSB | |
| 619 | 618 | TWL_COMMON_REGULATOR_CLK32KG); |
| 620 | − omap4_pmic_init("twl6030", &sdp4430_twldata); | |
| 619 | + omap4_pmic_init("twl6030", &sdp4430_twldata, | |
| 620 | + &twl6040_data, OMAP44XX_IRQ_SYS_2N); | |
| 621 | 621 | omap_register_i2c_bus(2, 400, NULL, 0); |
| 622 | 622 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
| 623 | 623 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); |
| @@ -137,7 +137,7 @@ static struct twl4030_platform_data sdp4430_twldata = { · 136 unmodified lines | ||
| 137 | 137 | |
| 138 | 138 | static void __init omap4_i2c_init(void) |
| 139 | 139 | { |
| 140 | − omap4_pmic_init("twl6030", &sdp4430_twldata); | |
| 140 | + omap4_pmic_init("twl6030", &sdp4430_twldata, NULL, 0); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static void __init omap4_init(void) |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <linux/gpio.h> |
| 26 | 26 | #include <linux/usb/otg.h> |
| 27 | 27 | #include <linux/i2c/twl.h> |
| 28 | +#include <linux/mfd/twl6040.h> | |
| 28 | 29 | #include <linux/regulator/machine.h> |
| 29 | 30 | #include <linux/regulator/fixed.h> |
| 30 | 31 | #include <linux/wl12xx.h> |
| @@ -284,7 +285,7 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) · 253 unmodified lines | ||
| 284 | 285 | return 0; |
| 285 | 286 | } |
| 286 | 287 | |
| 287 | −static struct twl4030_codec_data twl6040_codec = { | |
| 288 | +static struct twl6040_codec_data twl6040_codec = { | |
| 288 | 289 | /* single-step ramp for headset and handsfree */ |
| 289 | 290 | .hs_left_step = 0x0f, |
| 290 | 291 | .hs_right_step = 0x0f, |
| @@ -292,17 +293,14 @@ static struct twl4030_codec_data twl6040_codec = { · 1 unmodified line | ||
| 292 | 293 | .hf_right_step = 0x1d, |
| 293 | 294 | }; |
| 294 | 295 | |
| 295 | −static struct twl4030_audio_data twl6040_audio = { | |
| 296 | +static struct twl6040_platform_data twl6040_data = { | |
| 296 | 297 | .codec = &twl6040_codec, |
| 297 | 298 | .audpwron_gpio = 127, |
| 298 | − .naudint_irq = OMAP44XX_IRQ_SYS_2N, | |
| 299 | 299 | .irq_base = TWL6040_CODEC_IRQ_BASE, |
| 300 | 300 | }; |
| 301 | 301 | |
| 302 | 302 | /* Panda board uses the common PMIC configuration */ |
| 303 | −static struct twl4030_platform_data omap4_panda_twldata = { | |
| 304 | − .audio = &twl6040_audio, | |
| 305 | −}; | |
| 303 | +static struct twl4030_platform_data omap4_panda_twldata; | |
| 306 | 304 | |
| 307 | 305 | /* |
| 308 | 306 | * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM |
| @@ -326,7 +324,8 @@ static int __init omap4_panda_i2c_init(void) · 17 unmodified lines | ||
| 326 | 324 | TWL_COMMON_REGULATOR_VCXIO | |
| 327 | 325 | TWL_COMMON_REGULATOR_VUSB | |
| 328 | 326 | TWL_COMMON_REGULATOR_CLK32KG); |
| 329 | − omap4_pmic_init("twl6030", &omap4_panda_twldata); | |
| 327 | + omap4_pmic_init("twl6030", &omap4_panda_twldata, | |
| 328 | + &twl6040_data, OMAP44XX_IRQ_SYS_2N); | |
| 330 | 329 | omap_register_i2c_bus(2, 400, NULL, 0); |
| 331 | 330 | /* |
| 332 | 331 | * Bus 3 is attached to the DVI port where devices like the pico DLP |
| @@ -1422,6 +1422,9 @@ static int _ocp_softreset(struct omap_hwmod *oh) · 1421 unmodified lines | ||
| 1422 | 1422 | goto dis_opt_clks; |
| 1423 | 1423 | _write_sysconfig(v, oh); |
| 1424 | 1424 | |
| 1425 | + if (oh->class->sysc->srst_udelay) | |
| 1426 | + udelay(oh->class->sysc->srst_udelay); | |
| 1427 | + | |
| 1425 | 1428 | if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS) |
| 1426 | 1429 | omap_test_timeout((omap_hwmod_read(oh, |
| 1427 | 1430 | oh->class->sysc->syss_offs) |
| @@ -1903,10 +1906,20 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) · 475 unmodified lines | ||
| 1903 | 1906 | */ |
| 1904 | 1907 | int omap_hwmod_softreset(struct omap_hwmod *oh) |
| 1905 | 1908 | { |
| 1906 | − if (!oh) | |
| 1909 | + u32 v; | |
| 1910 | + int ret; | |
| 1911 | + | |
| 1912 | + if (!oh || !(oh->_sysc_cache)) | |
| 1907 | 1913 | return -EINVAL; |
| 1908 | 1914 | |
| 1909 | − return _ocp_softreset(oh); | |
| 1915 | + v = oh->_sysc_cache; | |
| 1916 | + ret = _set_softreset(oh, &v); | |
| 1917 | + if (ret) | |
| 1918 | + goto error; | |
| 1919 | + _write_sysconfig(v, oh); | |
| 1920 | + | |
| 1921 | +error: | |
| 1922 | + return ret; | |
| 1910 | 1923 | } |
| 1911 | 1924 | |
| 1912 | 1925 | /** |
| @@ -1000,7 +1000,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = { · 999 unmodified lines | ||
| 1000 | 1000 | .flags = OMAP_FIREWALL_L4, |
| 1001 | 1001 | } |
| 1002 | 1002 | }, |
| 1003 | − .flags = OCPIF_SWSUP_IDLE, | |
| 1004 | 1003 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 1005 | 1004 | }; |
| 1006 | 1005 | |
| @@ -1049,7 +1049,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { · 1048 unmodified lines | ||
| 1049 | 1049 | .slave = &omap2430_dss_venc_hwmod, |
| 1050 | 1050 | .clk = "dss_ick", |
| 1051 | 1051 | .addr = omap2_dss_venc_addrs, |
| 1052 | − .flags = OCPIF_SWSUP_IDLE, | |
| 1053 | 1052 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 1054 | 1053 | }; |
| 1055 | 1054 | |
| @@ -1676,7 +1676,6 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = { · 1675 unmodified lines | ||
| 1676 | 1676 | .flags = OMAP_FIREWALL_L4, |
| 1677 | 1677 | } |
| 1678 | 1678 | }, |
| 1679 | − .flags = OCPIF_SWSUP_IDLE, | |
| 1680 | 1679 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 1681 | 1680 | }; |
| 1682 | 1681 | |
| @@ -2594,6 +2594,15 @@ static struct omap_hwmod omap44xx_ipu_hwmod = { · 2593 unmodified lines | ||
| 2594 | 2594 | static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = { |
| 2595 | 2595 | .rev_offs = 0x0000, |
| 2596 | 2596 | .sysc_offs = 0x0010, |
| 2597 | + /* | |
| 2598 | + * ISS needs 100 OCP clk cycles delay after a softreset before | |
| 2599 | + * accessing sysconfig again. | |
| 2600 | + * The lowest frequency at the moment for L3 bus is 100 MHz, so | |
| 2601 | + * 1usec delay is needed. Add an x2 margin to be safe (2 usecs). | |
| 2602 | + * | |
| 2603 | + * TODO: Indicate errata when available. | |
| 2604 | + */ | |
| 2605 | + .srst_udelay = 2, | |
| 2597 | 2606 | .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS | |
| 2598 | 2607 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), |
| 2599 | 2608 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | |
| @@ -108,8 +108,14 @@ static void omap_uart_set_noidle(struct platform_device *pdev) · 107 unmodified lines | ||
| 108 | 108 | static void omap_uart_set_smartidle(struct platform_device *pdev) |
| 109 | 109 | { |
| 110 | 110 | struct omap_device *od = to_omap_device(pdev); |
| 111 | + u8 idlemode; | |
| 111 | 112 | |
| 112 | − omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_SMART); | |
| 113 | + if (od->hwmods[0]->class->sysc->idlemodes & SIDLE_SMART_WKUP) | |
| 114 | + idlemode = HWMOD_IDLEMODE_SMART_WKUP; | |
| 115 | + else | |
| 116 | + idlemode = HWMOD_IDLEMODE_SMART; | |
| 117 | + | |
| 118 | + omap_hwmod_set_slave_idlemode(od->hwmods[0], idlemode); | |
| 113 | 119 | } |
| 114 | 120 | |
| 115 | 121 | #else |
| @@ -120,124 +126,8 @@ static void omap_uart_set_smartidle(struct platform_device *pdev) {} · 4 unmodified lines | ||
| 120 | 126 | #endif /* CONFIG_PM */ |
| 121 | 127 | |
| 122 | 128 | #ifdef CONFIG_OMAP_MUX |
| 123 | −static struct omap_device_pad default_uart1_pads[] __initdata = { | |
| 124 | − { | |
| 125 | − .name = "uart1_cts.uart1_cts", | |
| 126 | − .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 127 | − }, | |
| 128 | − { | |
| 129 | − .name = "uart1_rts.uart1_rts", | |
| 130 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 131 | − }, | |
| 132 | − { | |
| 133 | − .name = "uart1_tx.uart1_tx", | |
| 134 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 135 | − }, | |
| 136 | − { | |
| 137 | − .name = "uart1_rx.uart1_rx", | |
| 138 | − .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, | |
| 139 | − .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 140 | − .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 141 | − }, | |
| 142 | −}; | |
| 143 | − | |
| 144 | −static struct omap_device_pad default_uart2_pads[] __initdata = { | |
| 145 | − { | |
| 146 | − .name = "uart2_cts.uart2_cts", | |
| 147 | − .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 148 | − }, | |
| 149 | − { | |
| 150 | − .name = "uart2_rts.uart2_rts", | |
| 151 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 152 | − }, | |
| 153 | − { | |
| 154 | − .name = "uart2_tx.uart2_tx", | |
| 155 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 156 | − }, | |
| 157 | − { | |
| 158 | − .name = "uart2_rx.uart2_rx", | |
| 159 | − .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, | |
| 160 | − .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 161 | − .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 162 | − }, | |
| 163 | −}; | |
| 164 | − | |
| 165 | −static struct omap_device_pad default_uart3_pads[] __initdata = { | |
| 166 | − { | |
| 167 | − .name = "uart3_cts_rctx.uart3_cts_rctx", | |
| 168 | − .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0, | |
| 169 | − }, | |
| 170 | − { | |
| 171 | − .name = "uart3_rts_sd.uart3_rts_sd", | |
| 172 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 173 | − }, | |
| 174 | − { | |
| 175 | − .name = "uart3_tx_irtx.uart3_tx_irtx", | |
| 176 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 177 | − }, | |
| 178 | − { | |
| 179 | − .name = "uart3_rx_irrx.uart3_rx_irrx", | |
| 180 | − .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, | |
| 181 | − .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE0, | |
| 182 | − .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE0, | |
| 183 | − }, | |
| 184 | −}; | |
| 185 | − | |
| 186 | −static struct omap_device_pad default_omap36xx_uart4_pads[] __initdata = { | |
| 187 | − { | |
| 188 | − .name = "gpmc_wait2.uart4_tx", | |
| 189 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 190 | − }, | |
| 191 | − { | |
| 192 | − .name = "gpmc_wait3.uart4_rx", | |
| 193 | − .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, | |
| 194 | − .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE2, | |
| 195 | − .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE2, | |
| 196 | − }, | |
| 197 | −}; | |
| 198 | − | |
| 199 | −static struct omap_device_pad default_omap4_uart4_pads[] __initdata = { | |
| 200 | − { | |
| 201 | − .name = "uart4_tx.uart4_tx", | |
| 202 | − .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0, | |
| 203 | − }, | |
| 204 | − { | |
| 205 | − .name = "uart4_rx.uart4_rx", | |
| 206 | − .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP, | |
| 207 | − .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE0, | |
| 208 | − .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE0, | |
| 209 | − }, | |
| 210 | −}; | |
| 211 | − | |
| 212 | 129 | static void omap_serial_fill_default_pads(struct omap_board_data *bdata) |
| 213 | 130 | { |
| 214 | − switch (bdata->id) { | |
| 215 | − case 0: | |
| 216 | − bdata->pads = default_uart1_pads; | |
| 217 | − bdata->pads_cnt = ARRAY_SIZE(default_uart1_pads); | |
| 218 | − break; | |
| 219 | − case 1: | |
| 220 | − bdata->pads = default_uart2_pads; | |
| 221 | − bdata->pads_cnt = ARRAY_SIZE(default_uart2_pads); | |
| 222 | − break; | |
| 223 | − case 2: | |
| 224 | − bdata->pads = default_uart3_pads; | |
| 225 | − bdata->pads_cnt = ARRAY_SIZE(default_uart3_pads); | |
| 226 | − break; | |
| 227 | − case 3: | |
| 228 | − if (cpu_is_omap44xx()) { | |
| 229 | − bdata->pads = default_omap4_uart4_pads; | |
| 230 | − bdata->pads_cnt = | |
| 231 | − ARRAY_SIZE(default_omap4_uart4_pads); | |
| 232 | − } else if (cpu_is_omap3630()) { | |
| 233 | − bdata->pads = default_omap36xx_uart4_pads; | |
| 234 | − bdata->pads_cnt = | |
| 235 | − ARRAY_SIZE(default_omap36xx_uart4_pads); | |
| 236 | − } | |
| 237 | − break; | |
| 238 | − default: | |
| 239 | − break; | |
| 240 | − } | |
| 241 | 131 | } |
| 242 | 132 | #else |
| 243 | 133 | static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {} |
| @@ -37,6 +37,16 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = { · 36 unmodified lines | ||
| 37 | 37 | .flags = I2C_CLIENT_WAKE, |
| 38 | 38 | }; |
| 39 | 39 | |
| 40 | +static struct i2c_board_info __initdata omap4_i2c1_board_info[] = { | |
| 41 | + { | |
| 42 | + .addr = 0x48, | |
| 43 | + .flags = I2C_CLIENT_WAKE, | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + I2C_BOARD_INFO("twl6040", 0x4b), | |
| 47 | + }, | |
| 48 | +}; | |
| 49 | + | |
| 40 | 50 | void __init omap_pmic_init(int bus, u32 clkrate, |
| 41 | 51 | const char *pmic_type, int pmic_irq, |
| 42 | 52 | struct twl4030_platform_data *pmic_data) |
| @@ -49,14 +59,31 @@ void __init omap_pmic_init(int bus, u32 clkrate, · 6 unmodified lines | ||
| 49 | 59 | omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); |
| 50 | 60 | } |
| 51 | 61 | |
| 62 | +void __init omap4_pmic_init(const char *pmic_type, | |
| 63 | + struct twl4030_platform_data *pmic_data, | |
| 64 | + struct twl6040_platform_data *twl6040_data, int twl6040_irq) | |
| 65 | +{ | |
| 66 | + /* PMIC part*/ | |
| 67 | + strncpy(omap4_i2c1_board_info[0].type, pmic_type, | |
| 68 | + sizeof(omap4_i2c1_board_info[0].type)); | |
| 69 | + omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N; | |
| 70 | + omap4_i2c1_board_info[0].platform_data = pmic_data; | |
| 71 | + | |
| 72 | + /* TWL6040 audio IC part */ | |
| 73 | + omap4_i2c1_board_info[1].irq = twl6040_irq; | |
| 74 | + omap4_i2c1_board_info[1].platform_data = twl6040_data; | |
| 75 | + | |
| 76 | + omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2); | |
| 77 | + | |
| 78 | +} | |
| 79 | + | |
| 52 | 80 | void __init omap_pmic_late_init(void) |
| 53 | 81 | { |
| 54 | 82 | /* Init the OMAP TWL parameters (if PMIC has been registerd) */ |
| 55 | − if (!pmic_i2c_board_info.irq) | |
| 56 | − return; | |
| 57 | − | |
| 58 | − omap3_twl_init(); | |
| 59 | − omap4_twl_init(); | |
| 83 | + if (pmic_i2c_board_info.irq) | |
| 84 | + omap3_twl_init(); | |
| 85 | + if (omap4_i2c1_board_info[0].irq) | |
| 86 | + omap4_twl_init(); | |
| 60 | 87 | } |
| 61 | 88 | |
| 62 | 89 | #if defined(CONFIG_ARCH_OMAP3) |
| @@ -29,6 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | struct twl4030_platform_data; |
| 32 | +struct twl6040_platform_data; | |
| 32 | 33 | |
| 33 | 34 | void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, |
| 34 | 35 | struct twl4030_platform_data *pmic_data); |
| @@ -46,12 +47,9 @@ static inline void omap3_pmic_init(const char *pmic_type, · 11 unmodified lines | ||
| 46 | 47 | omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data); |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | −static inline void omap4_pmic_init(const char *pmic_type, | |
| 50 | − struct twl4030_platform_data *pmic_data) | |
| 51 | −{ | |
| 52 | − /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */ | |
| 53 | − omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data); | |
| 54 | −} | |
| 50 | +void omap4_pmic_init(const char *pmic_type, | |
| 51 | + struct twl4030_platform_data *pmic_data, | |
| 52 | + struct twl6040_platform_data *audio_data, int twl6040_irq); | |
| 55 | 53 | |
| 56 | 54 | void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, |
| 57 | 55 | u32 pdata_flags, u32 regulators_flags); |
| @@ -265,7 +265,6 @@ static int __init db88f5281_pci_map_irq(const struct pci_dev *dev, u8 slot, · 264 unmodified lines | ||
| 265 | 265 | static struct hw_pci db88f5281_pci __initdata = { |
| 266 | 266 | .nr_controllers = 2, |
| 267 | 267 | .preinit = db88f5281_pci_preinit, |
| 268 | − .swizzle = pci_std_swizzle, | |
| 269 | 268 | .setup = orion5x_pci_sys_setup, |
| 270 | 269 | .scan = orion5x_pci_sys_scan_bus, |
| 271 | 270 | .map_irq = db88f5281_pci_map_irq, |
| @@ -86,7 +86,6 @@ static int __init dns323_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 85 unmodified lines | ||
| 86 | 86 | |
| 87 | 87 | static struct hw_pci dns323_pci __initdata = { |
| 88 | 88 | .nr_controllers = 2, |
| 89 | − .swizzle = pci_std_swizzle, | |
| 90 | 89 | .setup = orion5x_pci_sys_setup, |
| 91 | 90 | .scan = orion5x_pci_sys_scan_bus, |
| 92 | 91 | .map_irq = dns323_pci_map_irq, |
| @@ -138,7 +138,6 @@ static int __init kurobox_pro_pci_map_irq(const struct pci_dev *dev, u8 slot, · 137 unmodified lines | ||
| 138 | 138 | |
| 139 | 139 | static struct hw_pci kurobox_pro_pci __initdata = { |
| 140 | 140 | .nr_controllers = 2, |
| 141 | − .swizzle = pci_std_swizzle, | |
| 142 | 141 | .setup = orion5x_pci_sys_setup, |
| 143 | 142 | .scan = orion5x_pci_sys_scan_bus, |
| 144 | 143 | .map_irq = kurobox_pro_pci_map_irq, |
| @@ -89,7 +89,6 @@ static int __init mss2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 88 unmodified lines | ||
| 89 | 89 | |
| 90 | 90 | static struct hw_pci mss2_pci __initdata = { |
| 91 | 91 | .nr_controllers = 2, |
| 92 | − .swizzle = pci_std_swizzle, | |
| 93 | 92 | .setup = orion5x_pci_sys_setup, |
| 94 | 93 | .scan = orion5x_pci_sys_scan_bus, |
| 95 | 94 | .map_irq = mss2_pci_map_irq, |
| @@ -149,7 +149,6 @@ rd88f5181l_fxo_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 148 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | static struct hw_pci rd88f5181l_fxo_pci __initdata = { |
| 151 | 151 | .nr_controllers = 2, |
| 152 | − .swizzle = pci_std_swizzle, | |
| 153 | 152 | .setup = orion5x_pci_sys_setup, |
| 154 | 153 | .scan = orion5x_pci_sys_scan_bus, |
| 155 | 154 | .map_irq = rd88f5181l_fxo_pci_map_irq, |
| @@ -161,7 +161,6 @@ rd88f5181l_ge_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 160 unmodified lines | ||
| 161 | 161 | |
| 162 | 162 | static struct hw_pci rd88f5181l_ge_pci __initdata = { |
| 163 | 163 | .nr_controllers = 2, |
| 164 | − .swizzle = pci_std_swizzle, | |
| 165 | 164 | .setup = orion5x_pci_sys_setup, |
| 166 | 165 | .scan = orion5x_pci_sys_scan_bus, |
| 167 | 166 | .map_irq = rd88f5181l_ge_pci_map_irq, |
| @@ -200,7 +200,6 @@ static int __init rd88f5182_pci_map_irq(const struct pci_dev *dev, u8 slot, · 199 unmodified lines | ||
| 200 | 200 | static struct hw_pci rd88f5182_pci __initdata = { |
| 201 | 201 | .nr_controllers = 2, |
| 202 | 202 | .preinit = rd88f5182_pci_preinit, |
| 203 | − .swizzle = pci_std_swizzle, | |
| 204 | 203 | .setup = orion5x_pci_sys_setup, |
| 205 | 204 | .scan = orion5x_pci_sys_scan_bus, |
| 206 | 205 | .map_irq = rd88f5182_pci_map_irq, |
| @@ -102,7 +102,6 @@ static void __init rd88f6183ap_ge_init(void) · 101 unmodified lines | ||
| 102 | 102 | |
| 103 | 103 | static struct hw_pci rd88f6183ap_ge_pci __initdata = { |
| 104 | 104 | .nr_controllers = 2, |
| 105 | − .swizzle = pci_std_swizzle, | |
| 106 | 105 | .setup = orion5x_pci_sys_setup, |
| 107 | 106 | .scan = orion5x_pci_sys_scan_bus, |
| 108 | 107 | .map_irq = orion5x_pci_map_irq, |
| @@ -122,7 +122,6 @@ static int __init tsp2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 121 unmodified lines | ||
| 122 | 122 | static struct hw_pci tsp2_pci __initdata = { |
| 123 | 123 | .nr_controllers = 2, |
| 124 | 124 | .preinit = tsp2_pci_preinit, |
| 125 | − .swizzle = pci_std_swizzle, | |
| 126 | 125 | .setup = orion5x_pci_sys_setup, |
| 127 | 126 | .scan = orion5x_pci_sys_scan_bus, |
| 128 | 127 | .map_irq = tsp2_pci_map_irq, |
| @@ -170,7 +170,6 @@ static int __init qnap_ts209_pci_map_irq(const struct pci_dev *dev, u8 slot, · 169 unmodified lines | ||
| 170 | 170 | static struct hw_pci qnap_ts209_pci __initdata = { |
| 171 | 171 | .nr_controllers = 2, |
| 172 | 172 | .preinit = qnap_ts209_pci_preinit, |
| 173 | − .swizzle = pci_std_swizzle, | |
| 174 | 173 | .setup = orion5x_pci_sys_setup, |
| 175 | 174 | .scan = orion5x_pci_sys_scan_bus, |
| 176 | 175 | .map_irq = qnap_ts209_pci_map_irq, |
| @@ -140,7 +140,6 @@ static int __init qnap_ts409_pci_map_irq(const struct pci_dev *dev, u8 slot, · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | static struct hw_pci qnap_ts409_pci __initdata = { |
| 142 | 142 | .nr_controllers = 2, |
| 143 | − .swizzle = pci_std_swizzle, | |
| 144 | 143 | .setup = orion5x_pci_sys_setup, |
| 145 | 144 | .scan = orion5x_pci_sys_scan_bus, |
| 146 | 145 | .map_irq = qnap_ts409_pci_map_irq, |
| @@ -155,7 +155,6 @@ static int __init wnr854t_pci_map_irq(const struct pci_dev *dev, u8 slot, · 154 unmodified lines | ||
| 155 | 155 | |
| 156 | 156 | static struct hw_pci wnr854t_pci __initdata = { |
| 157 | 157 | .nr_controllers = 2, |
| 158 | − .swizzle = pci_std_swizzle, | |
| 159 | 158 | .setup = orion5x_pci_sys_setup, |
| 160 | 159 | .scan = orion5x_pci_sys_scan_bus, |
| 161 | 160 | .map_irq = wnr854t_pci_map_irq, |
| @@ -243,7 +243,6 @@ static int __init wrt350n_v2_pci_map_irq(const struct pci_dev *dev, u8 slot, · 242 unmodified lines | ||
| 243 | 243 | |
| 244 | 244 | static struct hw_pci wrt350n_v2_pci __initdata = { |
| 245 | 245 | .nr_controllers = 2, |
| 246 | − .swizzle = pci_std_swizzle, | |
| 247 | 246 | .setup = orion5x_pci_sys_setup, |
| 248 | 247 | .scan = orion5x_pci_sys_scan_bus, |
| 249 | 248 | .map_irq = wrt350n_v2_pci_map_irq, |
| @@ -181,11 +181,10 @@ static void cmx2xx_pci_preinit(void) · 180 unmodified lines | ||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static struct hw_pci cmx2xx_pci __initdata = { |
| 184 | − .swizzle = pci_std_swizzle, | |
| 185 | 184 | .map_irq = cmx2xx_pci_map_irq, |
| 186 | 185 | .nr_controllers = 1, |
| 186 | + .ops = &it8152_ops, | |
| 187 | 187 | .setup = it8152_pci_setup, |
| 188 | − .scan = it8152_pci_scan_bus, | |
| 189 | 188 | .preinit = cmx2xx_pci_preinit, |
| 190 | 189 | }; |
| 191 | 190 | |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | * |
| 18 | 18 | * bit 23 - Input/Output (PXA2xx specific) |
| 19 | 19 | * bit 24 - Wakeup Enable(PXA2xx specific) |
| 20 | + * bit 25 - Keep Output (PXA2xx specific) | |
| 20 | 21 | */ |
| 21 | 22 | |
| 22 | 23 | #define MFP_DIR_IN (0x0 << 23) |
| @@ -25,6 +26,12 @@ · 2 unmodified lines | ||
| 25 | 26 | #define MFP_DIR(x) (((x) >> 23) & 0x1) |
| 26 | 27 | |
| 27 | 28 | #define MFP_LPM_CAN_WAKEUP (0x1 << 24) |
| 29 | + | |
| 30 | +/* | |
| 31 | + * MFP_LPM_KEEP_OUTPUT must be specified for pins that need to | |
| 32 | + * retain their last output level (low or high). | |
| 33 | + * Note: MFP_LPM_KEEP_OUTPUT has no effect on pins configured for input. | |
| 34 | + */ | |
| 28 | 35 | #define MFP_LPM_KEEP_OUTPUT (0x1 << 25) |
| 29 | 36 | |
| 30 | 37 | #define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE) |
| @@ -33,6 +33,8 @@ · 32 unmodified lines | ||
| 33 | 33 | #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) |
| 34 | 34 | #define GPLR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5)) |
| 35 | 35 | #define GPDR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x0c) |
| 36 | +#define GPSR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x18) | |
| 37 | +#define GPCR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x24) | |
| 36 | 38 | |
| 37 | 39 | #define PWER_WE35 (1 << 24) |
| 38 | 40 | |
| @@ -348,6 +350,7 @@ static inline void pxa27x_mfp_init(void) {} · 309 unmodified lines | ||
| 348 | 350 | #ifdef CONFIG_PM |
| 349 | 351 | static unsigned long saved_gafr[2][4]; |
| 350 | 352 | static unsigned long saved_gpdr[4]; |
| 353 | +static unsigned long saved_gplr[4]; | |
| 351 | 354 | static unsigned long saved_pgsr[4]; |
| 352 | 355 | |
| 353 | 356 | static int pxa2xx_mfp_suspend(void) |
| @@ -366,14 +369,26 @@ static int pxa2xx_mfp_suspend(void) · 12 unmodified lines | ||
| 366 | 369 | } |
| 367 | 370 | |
| 368 | 371 | for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { |
| 369 | − | |
| 370 | 372 | saved_gafr[0][i] = GAFR_L(i); |
| 371 | 373 | saved_gafr[1][i] = GAFR_U(i); |
| 372 | 374 | saved_gpdr[i] = GPDR(i * 32); |
| 375 | + saved_gplr[i] = GPLR(i * 32); | |
| 373 | 376 | saved_pgsr[i] = PGSR(i); |
| 374 | 377 | |
| 375 | − GPDR(i * 32) = gpdr_lpm[i]; | |
| 378 | + GPSR(i * 32) = PGSR(i); | |
| 379 | + GPCR(i * 32) = ~PGSR(i); | |
| 380 | + } | |
| 381 | + | |
| 382 | + /* set GPDR bits taking into account MFP_LPM_KEEP_OUTPUT */ | |
| 383 | + for (i = 0; i < pxa_last_gpio; i++) { | |
| 384 | + if ((gpdr_lpm[gpio_to_bank(i)] & GPIO_bit(i)) || | |
| 385 | + ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) && | |
| 386 | + (saved_gpdr[gpio_to_bank(i)] & GPIO_bit(i)))) | |
| 387 | + GPDR(i) |= GPIO_bit(i); | |
| 388 | + else | |
| 389 | + GPDR(i) &= ~GPIO_bit(i); | |
| 376 | 390 | } |
| 391 | + | |
| 377 | 392 | return 0; |
| 378 | 393 | } |
| 379 | 394 | |
| @@ -384,6 +399,8 @@ static void pxa2xx_mfp_resume(void) · 4 unmodified lines | ||
| 384 | 399 | for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { |
| 385 | 400 | GAFR_L(i) = saved_gafr[0][i]; |
| 386 | 401 | GAFR_U(i) = saved_gafr[1][i]; |
| 402 | + GPSR(i * 32) = saved_gplr[i]; | |
| 403 | + GPCR(i * 32) = ~saved_gplr[i]; | |
| 387 | 404 | GPDR(i * 32) = saved_gpdr[i]; |
| 388 | 405 | PGSR(i) = saved_pgsr[i]; |
| 389 | 406 | } |
| @@ -421,8 +421,11 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info) · 420 unmodified lines | ||
| 421 | 421 | pxa_register_device(&pxa27x_device_i2c_power, info); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | +static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = { | |
| 425 | + .gpio_set_wake = gpio_set_wake, | |
| 426 | +}; | |
| 427 | + | |
| 424 | 428 | static struct platform_device *devices[] __initdata = { |
| 425 | − &pxa_device_gpio, | |
| 426 | 429 | &pxa27x_device_udc, |
| 427 | 430 | &pxa_device_pmu, |
| 428 | 431 | &pxa_device_i2s, |
| @@ -458,6 +461,7 @@ static int __init pxa27x_init(void) · 29 unmodified lines | ||
| 458 | 461 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); |
| 459 | 462 | register_syscore_ops(&pxa2xx_clock_syscore_ops); |
| 460 | 463 | |
| 464 | + pxa_register_device(&pxa_device_gpio, &pxa27x_gpio_info); | |
| 461 | 465 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 462 | 466 | } |
| 463 | 467 | |
| @@ -111,10 +111,6 @@ config S3C24XX_SETUP_TS · 110 unmodified lines | ||
| 111 | 111 | help |
| 112 | 112 | Compile in platform device definition for Samsung TouchScreen. |
| 113 | 113 | |
| 114 | −# cpu-specific sections | |
| 115 | − | |
| 116 | −if CPU_S3C2410 | |
| 117 | − | |
| 118 | 114 | config S3C2410_DMA |
| 119 | 115 | bool |
| 120 | 116 | depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442) |
| @@ -127,6 +123,10 @@ config S3C2410_PM · 6 unmodified lines | ||
| 127 | 123 | help |
| 128 | 124 | Power Management code common to S3C2410 and better |
| 129 | 125 | |
| 126 | +# cpu-specific sections | |
| 127 | + | |
| 128 | +if CPU_S3C2410 | |
| 129 | + | |
| 130 | 130 | config S3C24XX_SIMTEC_NOR |
| 131 | 131 | bool |
| 132 | 132 | help |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <linux/gpio_keys.h> |
| 26 | 26 | #include <linux/input.h> |
| 27 | 27 | #include <linux/gpio.h> |
| 28 | +#include <linux/mmc/host.h> | |
| 28 | 29 | #include <linux/interrupt.h> |
| 29 | 30 | |
| 30 | 31 | #include <asm/hardware/vic.h> |
| @@ -765,6 +766,7 @@ static void __init goni_pmic_init(void) · 734 unmodified lines | ||
| 765 | 766 | /* MoviNAND */ |
| 766 | 767 | static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = { |
| 767 | 768 | .max_width = 4, |
| 769 | + .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE, | |
| 768 | 770 | .cd_type = S3C_SDHCI_CD_PERMANENT, |
| 769 | 771 | }; |
| 770 | 772 | |
| @@ -306,7 +306,7 @@ void sa11x0_register_irda(struct irda_platform_data *irda) · 305 unmodified lines | ||
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static struct resource sa1100_rtc_resources[] = { |
| 309 | − DEFINE_RES_MEM(0x90010000, 0x9001003f), | |
| 309 | + DEFINE_RES_MEM(0x90010000, 0x40), | |
| 310 | 310 | DEFINE_RES_IRQ_NAMED(IRQ_RTC1Hz, "rtc 1Hz"), |
| 311 | 311 | DEFINE_RES_IRQ_NAMED(IRQ_RTCAlrm, "rtc alarm"), |
| 312 | 312 | }; |
| @@ -129,12 +129,6 @@ static int __init pci_nanoengine_map_irq(const struct pci_dev *dev, u8 slot, · 128 unmodified lines | ||
| 129 | 129 | return NANOENGINE_IRQ_GPIO_PCI; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | −struct pci_bus * __init pci_nanoengine_scan_bus(int nr, struct pci_sys_data *sys) | |
| 133 | −{ | |
| 134 | − return pci_scan_root_bus(NULL, sys->busnr, &pci_nano_ops, sys, | |
| 135 | − &sys->resources); | |
| 136 | −} | |
| 137 | − | |
| 138 | 132 | static struct resource pci_io_ports = |
| 139 | 133 | DEFINE_RES_IO_NAMED(0x400, 0x400, "PCI IO"); |
| 140 | 134 | |
| @@ -274,7 +268,7 @@ int __init pci_nanoengine_setup(int nr, struct pci_sys_data *sys) · 133 unmodified lines | ||
| 274 | 268 | static struct hw_pci nanoengine_pci __initdata = { |
| 275 | 269 | .map_irq = pci_nanoengine_map_irq, |
| 276 | 270 | .nr_controllers = 1, |
| 277 | − .scan = pci_nanoengine_scan_bus, | |
| 271 | + .ops = &pci_nano_ops, | |
| 278 | 272 | .setup = pci_nanoengine_setup, |
| 279 | 273 | }; |
| 280 | 274 | |
| @@ -29,10 +29,9 @@ extern void __init via82c505_preinit(void); · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | static struct hw_pci shark_pci __initdata = { |
| 31 | 31 | .setup = via82c505_setup, |
| 32 | − .swizzle = pci_std_swizzle, | |
| 33 | 32 | .map_irq = shark_map_irq, |
| 34 | 33 | .nr_controllers = 1, |
| 35 | − .scan = via82c505_scan_bus, | |
| 34 | + .ops = &via82c505_ops, | |
| 36 | 35 | .preinit = via82c505_preinit, |
| 37 | 36 | }; |
| 38 | 37 | |
| @@ -475,7 +475,6 @@ static struct hw_pci tegra_pcie_hw __initdata = { · 474 unmodified lines | ||
| 475 | 475 | .nr_controllers = 2, |
| 476 | 476 | .setup = tegra_pcie_setup, |
| 477 | 477 | .scan = tegra_pcie_scan_bus, |
| 478 | − .swizzle = pci_std_swizzle, | |
| 479 | 478 | .map_irq = tegra_pcie_map_irq, |
| 480 | 479 | }; |
| 481 | 480 | |
| @@ -1667,8 +1667,10 @@ void __init u300_init_irq(void) · 1666 unmodified lines | ||
| 1667 | 1667 | |
| 1668 | 1668 | for (i = 0; i < U300_VIC_IRQS_END; i++) |
| 1669 | 1669 | set_bit(i, (unsigned long *) &mask[0]); |
| 1670 | − vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]); | |
| 1671 | − vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]); | |
| 1670 | + vic_init((void __iomem *) U300_INTCON0_VBASE, IRQ_U300_INTCON0_START, | |
| 1671 | + mask[0], mask[0]); | |
| 1672 | + vic_init((void __iomem *) U300_INTCON1_VBASE, IRQ_U300_INTCON1_START, | |
| 1673 | + mask[1], mask[1]); | |
| 1672 | 1674 | } |
| 1673 | 1675 | |
| 1674 | 1676 | |
| @@ -146,9 +146,6 @@ static struct ab3100_platform_data ab3100_plf_data = { · 145 unmodified lines | ||
| 146 | 146 | .min_uV = 1800000, |
| 147 | 147 | .max_uV = 1800000, |
| 148 | 148 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
| 149 | − .valid_ops_mask = | |
| 150 | − REGULATOR_CHANGE_VOLTAGE | | |
| 151 | − REGULATOR_CHANGE_STATUS, | |
| 152 | 149 | .always_on = 1, |
| 153 | 150 | .boot_on = 1, |
| 154 | 151 | }, |
| @@ -160,9 +157,6 @@ static struct ab3100_platform_data ab3100_plf_data = { · 5 unmodified lines | ||
| 160 | 157 | .min_uV = 2500000, |
| 161 | 158 | .max_uV = 2500000, |
| 162 | 159 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
| 163 | − .valid_ops_mask = | |
| 164 | − REGULATOR_CHANGE_VOLTAGE | | |
| 165 | − REGULATOR_CHANGE_STATUS, | |
| 166 | 160 | .always_on = 1, |
| 167 | 161 | .boot_on = 1, |
| 168 | 162 | }, |
| @@ -230,8 +224,7 @@ static struct ab3100_platform_data ab3100_plf_data = { · 61 unmodified lines | ||
| 230 | 224 | .max_uV = 1800000, |
| 231 | 225 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
| 232 | 226 | .valid_ops_mask = |
| 233 | − REGULATOR_CHANGE_VOLTAGE | | |
| 234 | − REGULATOR_CHANGE_STATUS, | |
| 227 | + REGULATOR_CHANGE_VOLTAGE, | |
| 235 | 228 | .always_on = 1, |
| 236 | 229 | .boot_on = 1, |
| 237 | 230 | }, |
| @@ -12,101 +12,101 @@ · 11 unmodified lines | ||
| 12 | 12 | #ifndef __MACH_IRQS_H |
| 13 | 13 | #define __MACH_IRQS_H |
| 14 | 14 | |
| 15 | −#define IRQ_U300_INTCON0_START 0 | |
| 16 | −#define IRQ_U300_INTCON1_START 32 | |
| 15 | +#define IRQ_U300_INTCON0_START 1 | |
| 16 | +#define IRQ_U300_INTCON1_START 33 | |
| 17 | 17 | /* These are on INTCON0 - 30 lines */ |
| 18 | −#define IRQ_U300_IRQ0_EXT 0 | |
| 19 | −#define IRQ_U300_IRQ1_EXT 1 | |
| 20 | −#define IRQ_U300_DMA 2 | |
| 21 | −#define IRQ_U300_VIDEO_ENC_0 3 | |
| 22 | −#define IRQ_U300_VIDEO_ENC_1 4 | |
| 23 | −#define IRQ_U300_AAIF_RX 5 | |
| 24 | −#define IRQ_U300_AAIF_TX 6 | |
| 25 | −#define IRQ_U300_AAIF_VGPIO 7 | |
| 26 | −#define IRQ_U300_AAIF_WAKEUP 8 | |
| 27 | −#define IRQ_U300_PCM_I2S0_FRAME 9 | |
| 28 | −#define IRQ_U300_PCM_I2S0_FIFO 10 | |
| 29 | −#define IRQ_U300_PCM_I2S1_FRAME 11 | |
| 30 | −#define IRQ_U300_PCM_I2S1_FIFO 12 | |
| 31 | −#define IRQ_U300_XGAM_GAMCON 13 | |
| 32 | −#define IRQ_U300_XGAM_CDI 14 | |
| 33 | −#define IRQ_U300_XGAM_CDICON 15 | |
| 18 | +#define IRQ_U300_IRQ0_EXT 1 | |
| 19 | +#define IRQ_U300_IRQ1_EXT 2 | |
| 20 | +#define IRQ_U300_DMA 3 | |
| 21 | +#define IRQ_U300_VIDEO_ENC_0 4 | |
| 22 | +#define IRQ_U300_VIDEO_ENC_1 5 | |
| 23 | +#define IRQ_U300_AAIF_RX 6 | |
| 24 | +#define IRQ_U300_AAIF_TX 7 | |
| 25 | +#define IRQ_U300_AAIF_VGPIO 8 | |
| 26 | +#define IRQ_U300_AAIF_WAKEUP 9 | |
| 27 | +#define IRQ_U300_PCM_I2S0_FRAME 10 | |
| 28 | +#define IRQ_U300_PCM_I2S0_FIFO 11 | |
| 29 | +#define IRQ_U300_PCM_I2S1_FRAME 12 | |
| 30 | +#define IRQ_U300_PCM_I2S1_FIFO 13 | |
| 31 | +#define IRQ_U300_XGAM_GAMCON 14 | |
| 32 | +#define IRQ_U300_XGAM_CDI 15 | |
| 33 | +#define IRQ_U300_XGAM_CDICON 16 | |
| 34 | 34 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) |
| 35 | 35 | /* MMIACC not used on the DB3210 or DB3350 chips */ |
| 36 | −#define IRQ_U300_XGAM_MMIACC 16 | |
| 36 | +#define IRQ_U300_XGAM_MMIACC 17 | |
| 37 | 37 | #endif |
| 38 | −#define IRQ_U300_XGAM_PDI 17 | |
| 39 | −#define IRQ_U300_XGAM_PDICON 18 | |
| 40 | −#define IRQ_U300_XGAM_GAMEACC 19 | |
| 41 | −#define IRQ_U300_XGAM_MCIDCT 20 | |
| 42 | −#define IRQ_U300_APEX 21 | |
| 43 | −#define IRQ_U300_UART0 22 | |
| 44 | −#define IRQ_U300_SPI 23 | |
| 45 | −#define IRQ_U300_TIMER_APP_OS 24 | |
| 46 | −#define IRQ_U300_TIMER_APP_DD 25 | |
| 47 | −#define IRQ_U300_TIMER_APP_GP1 26 | |
| 48 | −#define IRQ_U300_TIMER_APP_GP2 27 | |
| 49 | −#define IRQ_U300_TIMER_OS 28 | |
| 50 | −#define IRQ_U300_TIMER_MS 29 | |
| 51 | −#define IRQ_U300_KEYPAD_KEYBF 30 | |
| 52 | −#define IRQ_U300_KEYPAD_KEYBR 31 | |
| 38 | +#define IRQ_U300_XGAM_PDI 18 | |
| 39 | +#define IRQ_U300_XGAM_PDICON 19 | |
| 40 | +#define IRQ_U300_XGAM_GAMEACC 20 | |
| 41 | +#define IRQ_U300_XGAM_MCIDCT 21 | |
| 42 | +#define IRQ_U300_APEX 22 | |
| 43 | +#define IRQ_U300_UART0 23 | |
| 44 | +#define IRQ_U300_SPI 24 | |
| 45 | +#define IRQ_U300_TIMER_APP_OS 25 | |
| 46 | +#define IRQ_U300_TIMER_APP_DD 26 | |
| 47 | +#define IRQ_U300_TIMER_APP_GP1 27 | |
| 48 | +#define IRQ_U300_TIMER_APP_GP2 28 | |
| 49 | +#define IRQ_U300_TIMER_OS 29 | |
| 50 | +#define IRQ_U300_TIMER_MS 30 | |
| 51 | +#define IRQ_U300_KEYPAD_KEYBF 31 | |
| 52 | +#define IRQ_U300_KEYPAD_KEYBR 32 | |
| 53 | 53 | /* These are on INTCON1 - 32 lines */ |
| 54 | −#define IRQ_U300_GPIO_PORT0 32 | |
| 55 | −#define IRQ_U300_GPIO_PORT1 33 | |
| 56 | −#define IRQ_U300_GPIO_PORT2 34 | |
| 54 | +#define IRQ_U300_GPIO_PORT0 33 | |
| 55 | +#define IRQ_U300_GPIO_PORT1 34 | |
| 56 | +#define IRQ_U300_GPIO_PORT2 35 | |
| 57 | 57 | |
| 58 | 58 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \ |
| 59 | 59 | defined(CONFIG_MACH_U300_BS335) |
| 60 | 60 | /* These are for DB3150, DB3200 and DB3350 */ |
| 61 | −#define IRQ_U300_WDOG 35 | |
| 62 | −#define IRQ_U300_EVHIST 36 | |
| 63 | −#define IRQ_U300_MSPRO 37 | |
| 64 | −#define IRQ_U300_MMCSD_MCIINTR0 38 | |
| 65 | −#define IRQ_U300_MMCSD_MCIINTR1 39 | |
| 66 | −#define IRQ_U300_I2C0 40 | |
| 67 | −#define IRQ_U300_I2C1 41 | |
| 68 | −#define IRQ_U300_RTC 42 | |
| 69 | −#define IRQ_U300_NFIF 43 | |
| 70 | −#define IRQ_U300_NFIF2 44 | |
| 61 | +#define IRQ_U300_WDOG 36 | |
| 62 | +#define IRQ_U300_EVHIST 37 | |
| 63 | +#define IRQ_U300_MSPRO 38 | |
| 64 | +#define IRQ_U300_MMCSD_MCIINTR0 39 | |
| 65 | +#define IRQ_U300_MMCSD_MCIINTR1 40 | |
| 66 | +#define IRQ_U300_I2C0 41 | |
| 67 | +#define IRQ_U300_I2C1 42 | |
| 68 | +#define IRQ_U300_RTC 43 | |
| 69 | +#define IRQ_U300_NFIF 44 | |
| 70 | +#define IRQ_U300_NFIF2 45 | |
| 71 | 71 | #endif |
| 72 | 72 | |
| 73 | 73 | /* DB3150 and DB3200 have only 45 IRQs */ |
| 74 | 74 | #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) |
| 75 | −#define U300_VIC_IRQS_END 45 | |
| 75 | +#define U300_VIC_IRQS_END 46 | |
| 76 | 76 | #endif |
| 77 | 77 | |
| 78 | 78 | /* The DB3350-specific interrupt lines */ |
| 79 | 79 | #ifdef CONFIG_MACH_U300_BS335 |
| 80 | −#define IRQ_U300_ISP_F0 45 | |
| 81 | −#define IRQ_U300_ISP_F1 46 | |
| 82 | −#define IRQ_U300_ISP_F2 47 | |
| 83 | −#define IRQ_U300_ISP_F3 48 | |
| 84 | −#define IRQ_U300_ISP_F4 49 | |
| 85 | −#define IRQ_U300_GPIO_PORT3 50 | |
| 86 | −#define IRQ_U300_SYSCON_PLL_LOCK 51 | |
| 87 | −#define IRQ_U300_UART1 52 | |
| 88 | −#define IRQ_U300_GPIO_PORT4 53 | |
| 89 | −#define IRQ_U300_GPIO_PORT5 54 | |
| 90 | −#define IRQ_U300_GPIO_PORT6 55 | |
| 91 | −#define U300_VIC_IRQS_END 56 | |
| 80 | +#define IRQ_U300_ISP_F0 46 | |
| 81 | +#define IRQ_U300_ISP_F1 47 | |
| 82 | +#define IRQ_U300_ISP_F2 48 | |
| 83 | +#define IRQ_U300_ISP_F3 49 | |
| 84 | +#define IRQ_U300_ISP_F4 50 | |
| 85 | +#define IRQ_U300_GPIO_PORT3 51 | |
| 86 | +#define IRQ_U300_SYSCON_PLL_LOCK 52 | |
| 87 | +#define IRQ_U300_UART1 53 | |
| 88 | +#define IRQ_U300_GPIO_PORT4 54 | |
| 89 | +#define IRQ_U300_GPIO_PORT5 55 | |
| 90 | +#define IRQ_U300_GPIO_PORT6 56 | |
| 91 | +#define U300_VIC_IRQS_END 57 | |
| 92 | 92 | #endif |
| 93 | 93 | |
| 94 | 94 | /* The DB3210-specific interrupt lines */ |
| 95 | 95 | #ifdef CONFIG_MACH_U300_BS365 |
| 96 | −#define IRQ_U300_GPIO_PORT3 35 | |
| 97 | −#define IRQ_U300_GPIO_PORT4 36 | |
| 98 | −#define IRQ_U300_WDOG 37 | |
| 99 | −#define IRQ_U300_EVHIST 38 | |
| 100 | −#define IRQ_U300_MSPRO 39 | |
| 101 | −#define IRQ_U300_MMCSD_MCIINTR0 40 | |
| 102 | −#define IRQ_U300_MMCSD_MCIINTR1 41 | |
| 103 | −#define IRQ_U300_I2C0 42 | |
| 104 | −#define IRQ_U300_I2C1 43 | |
| 105 | −#define IRQ_U300_RTC 44 | |
| 106 | −#define IRQ_U300_NFIF 45 | |
| 107 | −#define IRQ_U300_NFIF2 46 | |
| 108 | −#define IRQ_U300_SYSCON_PLL_LOCK 47 | |
| 109 | −#define U300_VIC_IRQS_END 48 | |
| 96 | +#define IRQ_U300_GPIO_PORT3 36 | |
| 97 | +#define IRQ_U300_GPIO_PORT4 37 | |
| 98 | +#define IRQ_U300_WDOG 38 | |
| 99 | +#define IRQ_U300_EVHIST 39 | |
| 100 | +#define IRQ_U300_MSPRO 40 | |
| 101 | +#define IRQ_U300_MMCSD_MCIINTR0 41 | |
| 102 | +#define IRQ_U300_MMCSD_MCIINTR1 42 | |
| 103 | +#define IRQ_U300_I2C0 43 | |
| 104 | +#define IRQ_U300_I2C1 44 | |
| 105 | +#define IRQ_U300_RTC 45 | |
| 106 | +#define IRQ_U300_NFIF 46 | |
| 107 | +#define IRQ_U300_NFIF2 47 | |
| 108 | +#define IRQ_U300_SYSCON_PLL_LOCK 48 | |
| 109 | +#define U300_VIC_IRQS_END 49 | |
| 110 | 110 | #endif |
| 111 | 111 | |
| 112 | 112 | /* Maximum 8*7 GPIO lines */ |
| @@ -117,6 +117,6 @@ · 4 unmodified lines | ||
| 117 | 117 | #define IRQ_U300_GPIO_END (U300_VIC_IRQS_END) |
| 118 | 118 | #endif |
| 119 | 119 | |
| 120 | −#define NR_IRQS (IRQ_U300_GPIO_END) | |
| 120 | +#define NR_IRQS (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START) | |
| 121 | 121 | |
| 122 | 122 | #endif |
| @@ -17,6 +17,7 @@ config UX500_SOC_DB5500 · 16 unmodified lines | ||
| 17 | 17 | config UX500_SOC_DB8500 |
| 18 | 18 | bool |
| 19 | 19 | select MFD_DB8500_PRCMU |
| 20 | + select REGULATOR | |
| 20 | 21 | select REGULATOR_DB8500_PRCMU |
| 21 | 22 | select CPU_FREQ_TABLE if CPU_FREQ |
| 22 | 23 | |
| @@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct device *dev, · 167 unmodified lines | ||
| 168 | 168 | return sprintf(buf, "0x%X\n", mbox_value); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | −static DEVICE_ATTR(fifo, S_IWUGO | S_IRUGO, mbox_read_fifo, mbox_write_fifo); | |
| 171 | +static DEVICE_ATTR(fifo, S_IWUSR | S_IRUGO, mbox_read_fifo, mbox_write_fifo); | |
| 172 | 172 | |
| 173 | 173 | static int mbox_show(struct seq_file *s, void *data) |
| 174 | 174 | { |
| @@ -99,7 +99,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) · 98 unmodified lines | ||
| 99 | 99 | */ |
| 100 | 100 | write_pen_release(cpu_logical_map(cpu)); |
| 101 | 101 | |
| 102 | − gic_raise_softirq(cpumask_of(cpu), 1); | |
| 102 | + smp_send_reschedule(cpu); | |
| 103 | 103 | |
| 104 | 104 | timeout = jiffies + (1 * HZ); |
| 105 | 105 | while (time_before(jiffies, timeout)) { |
| @@ -66,12 +66,6 @@ · 65 unmodified lines | ||
| 66 | 66 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) |
| 67 | 67 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) |
| 68 | 68 | |
| 69 | −static struct fpga_irq_data sic_irq = { | |
| 70 | − .base = VA_SIC_BASE, | |
| 71 | − .irq_start = IRQ_SIC_START, | |
| 72 | − .chip.name = "SIC", | |
| 73 | −}; | |
| 74 | − | |
| 75 | 69 | #if 1 |
| 76 | 70 | #define IRQ_MMCI0A IRQ_VICSOURCE22 |
| 77 | 71 | #define IRQ_AACI IRQ_VICSOURCE24 |
| @@ -105,8 +99,11 @@ void __init versatile_init_irq(void) · 27 unmodified lines | ||
| 105 | 99 | |
| 106 | 100 | writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); |
| 107 | 101 | |
| 108 | − fpga_irq_init(IRQ_VICSOURCE31, ~PIC_MASK, &sic_irq); | |
| 109 | − irq_domain_generate_simple(sic_of_match, VERSATILE_SIC_BASE, IRQ_SIC_START); | |
| 102 | + np = of_find_matching_node_by_address(NULL, sic_of_match, | |
| 103 | + VERSATILE_SIC_BASE); | |
| 104 | + | |
| 105 | + fpga_irq_init(VA_SIC_BASE, "SIC", IRQ_SIC_START, | |
| 106 | + IRQ_VICSOURCE31, ~PIC_MASK, np); | |
| 110 | 107 | |
| 111 | 108 | /* |
| 112 | 109 | * Interrupts on secondary controller from 0 to 8 are routed to |
| @@ -666,17 +663,18 @@ static struct amba_device *amba_devs[] __initdata = { · 553 unmodified lines | ||
| 666 | 663 | * having a specific name. |
| 667 | 664 | */ |
| 668 | 665 | struct of_dev_auxdata versatile_auxdata_lookup[] __initdata = { |
| 669 | − OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", NULL), | |
| 666 | + OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", &mmc0_plat_data), | |
| 670 | 667 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_KMI0_BASE, "fpga:06", NULL), |
| 671 | 668 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_KMI1_BASE, "fpga:07", NULL), |
| 672 | 669 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART3_BASE, "fpga:09", NULL), |
| 670 | + /* FIXME: this is buggy, the platform data is needed for this MMC instance too */ | |
| 673 | 671 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", NULL), |
| 674 | 672 | |
| 675 | 673 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_CLCD_BASE, "dev:20", &clcd_plat_data), |
| 676 | 674 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART0_BASE, "dev:f1", NULL), |
| 677 | 675 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART1_BASE, "dev:f2", NULL), |
| 678 | 676 | OF_DEV_AUXDATA("arm,primecell", VERSATILE_UART2_BASE, "dev:f3", NULL), |
| 679 | − OF_DEV_AUXDATA("arm,primecell", VERSATILE_SSP_BASE, "dev:f4", NULL), | |
| 677 | + OF_DEV_AUXDATA("arm,primecell", VERSATILE_SSP_BASE, "dev:f4", &ssp0_plat_data), | |
| 680 | 678 | |
| 681 | 679 | #if 0 |
| 682 | 680 | /* |
| @@ -303,12 +303,6 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) · 302 unmodified lines | ||
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| 306 | −struct pci_bus * __init pci_versatile_scan_bus(int nr, struct pci_sys_data *sys) | |
| 307 | −{ | |
| 308 | − return pci_scan_root_bus(NULL, sys->busnr, &pci_versatile_ops, sys, | |
| 309 | − &sys->resources); | |
| 310 | −} | |
| 311 | − | |
| 312 | 306 | void __init pci_versatile_preinit(void) |
| 313 | 307 | { |
| 314 | 308 | pcibios_min_io = 0x44000000; |
| @@ -339,19 +333,16 @@ static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 24 unmodified lines | ||
| 339 | 333 | * 26 1 29 |
| 340 | 334 | * 27 1 30 |
| 341 | 335 | */ |
| 342 | − irq = 27 + ((slot + pin - 1) & 3); | |
| 343 | − | |
| 344 | − printk("PCI map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq); | |
| 336 | + irq = 27 + ((slot - 24 + pin - 1) & 3); | |
| 345 | 337 | |
| 346 | 338 | return irq; |
| 347 | 339 | } |
| 348 | 340 | |
| 349 | 341 | static struct hw_pci versatile_pci __initdata = { |
| 350 | − .swizzle = NULL, | |
| 351 | 342 | .map_irq = versatile_map_irq, |
| 352 | 343 | .nr_controllers = 1, |
| 344 | + .ops = &pci_versatile_ops, | |
| 353 | 345 | .setup = pci_versatile_setup, |
| 354 | − .scan = pci_versatile_scan_bus, | |
| 355 | 346 | .preinit = pci_versatile_preinit, |
| 356 | 347 | }; |
| 357 | 348 | |
| @@ -19,8 +19,10 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <linux/clkdev.h> |
| 20 | 20 | #include <linux/mtd/physmap.h> |
| 21 | 21 | |
| 22 | +#include <asm/arch_timer.h> | |
| 22 | 23 | #include <asm/mach-types.h> |
| 23 | 24 | #include <asm/sizes.h> |
| 25 | +#include <asm/smp_twd.h> | |
| 24 | 26 | #include <asm/mach/arch.h> |
| 25 | 27 | #include <asm/mach/map.h> |
| 26 | 28 | #include <asm/mach/time.h> |
| @@ -616,7 +618,6 @@ void __init v2m_dt_init_early(void) · 589 unmodified lines | ||
| 616 | 618 | } |
| 617 | 619 | |
| 618 | 620 | clkdev_add_table(v2m_dt_lookups, ARRAY_SIZE(v2m_dt_lookups)); |
| 619 | − versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000); | |
| 620 | 621 | } |
| 621 | 622 | |
| 622 | 623 | static struct of_device_id vexpress_irq_match[] __initdata = { |
| @@ -643,6 +644,11 @@ static void __init v2m_dt_timer_init(void) · 20 unmodified lines | ||
| 643 | 644 | return; |
| 644 | 645 | node = of_find_node_by_path(path); |
| 645 | 646 | v2m_sp804_init(of_iomap(node, 0), irq_of_parse_and_map(node, 0)); |
| 647 | + if (arch_timer_of_register() != 0) | |
| 648 | + twd_local_timer_of_register(); | |
| 649 | + | |
| 650 | + if (arch_timer_sched_clock_init() != 0) | |
| 651 | + versatile_sched_clock_init(v2m_sysreg_base + V2M_SYS_24MHZ, 24000000); | |
| 646 | 652 | } |
| 647 | 653 | |
| 648 | 654 | static struct sys_timer v2m_dt_timer = { |
| @@ -26,18 +26,23 @@ ENTRY(v6_early_abort) · 25 unmodified lines | ||
| 26 | 26 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
| 27 | 27 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
| 28 | 28 | /* |
| 29 | − * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103). | |
| 30 | − * The test below covers all the write situations, including Java bytecodes | |
| 29 | + * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR. | |
| 31 | 30 | */ |
| 32 | − bic r1, r1, #1 << 11 @ clear bit 11 of FSR | |
| 31 | +#ifdef CONFIG_ARM_ERRATA_326103 | |
| 32 | + ldr ip, =0x4107b36 | |
| 33 | + mrc p15, 0, r3, c0, c0, 0 @ get processor id | |
| 34 | + teq ip, r3, lsr #4 @ r0 ARM1136? | |
| 35 | + bne do_DataAbort | |
| 33 | 36 | tst r5, #PSR_J_BIT @ Java? |
| 37 | + tsteq r5, #PSR_T_BIT @ Thumb? | |
| 34 | 38 | bne do_DataAbort |
| 35 | − do_thumb_abort fsr=r1, pc=r4, psr=r5, tmp=r3 | |
| 36 | − ldreq r3, [r4] @ read aborted ARM instruction | |
| 39 | + bic r1, r1, #1 << 11 @ clear bit 11 of FSR | |
| 40 | + ldr r3, [r4] @ read aborted ARM instruction | |
| 37 | 41 | #ifdef CONFIG_CPU_ENDIAN_BE8 |
| 38 | − reveq r3, r3 | |
| 42 | + rev r3, r3 | |
| 39 | 43 | #endif |
| 40 | 44 | do_ldrd_abort tmp=ip, insn=r3 |
| 41 | 45 | tst r3, #1 << 20 @ L = 0 -> write |
| 42 | 46 | orreq r1, r1, #1 << 11 @ yes. |
| 47 | +#endif | |
| 43 | 48 | b do_DataAbort |
| @@ -32,6 +32,7 @@ static void __iomem *l2x0_base; · 31 unmodified lines | ||
| 32 | 32 | static DEFINE_RAW_SPINLOCK(l2x0_lock); |
| 33 | 33 | static u32 l2x0_way_mask; /* Bitmask of active ways */ |
| 34 | 34 | static u32 l2x0_size; |
| 35 | +static unsigned long sync_reg_offset = L2X0_CACHE_SYNC; | |
| 35 | 36 | |
| 36 | 37 | struct l2x0_regs l2x0_saved_regs; |
| 37 | 38 | |
| @@ -61,12 +62,7 @@ static inline void cache_sync(void) · 23 unmodified lines | ||
| 61 | 62 | { |
| 62 | 63 | void __iomem *base = l2x0_base; |
| 63 | 64 | |
| 64 | −#ifdef CONFIG_PL310_ERRATA_753970 | |
| 65 | − /* write to an unmmapped register */ | |
| 66 | − writel_relaxed(0, base + L2X0_DUMMY_REG); | |
| 67 | −#else | |
| 68 | − writel_relaxed(0, base + L2X0_CACHE_SYNC); | |
| 69 | −#endif | |
| 65 | + writel_relaxed(0, base + sync_reg_offset); | |
| 70 | 66 | cache_wait(base + L2X0_CACHE_SYNC, 1); |
| 71 | 67 | } |
| 72 | 68 | |
| @@ -85,10 +81,13 @@ static inline void l2x0_inv_line(unsigned long addr) · 12 unmodified lines | ||
| 85 | 81 | } |
| 86 | 82 | |
| 87 | 83 | #if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915) |
| 84 | +static inline void debug_writel(unsigned long val) | |
| 85 | +{ | |
| 86 | + if (outer_cache.set_debug) | |
| 87 | + outer_cache.set_debug(val); | |
| 88 | +} | |
| 88 | 89 | |
| 89 | −#define debug_writel(val) outer_cache.set_debug(val) | |
| 90 | − | |
| 91 | −static void l2x0_set_debug(unsigned long val) | |
| 90 | +static void pl310_set_debug(unsigned long val) | |
| 92 | 91 | { |
| 93 | 92 | writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL); |
| 94 | 93 | } |
| @@ -98,7 +97,7 @@ static inline void debug_writel(unsigned long val) · 3 unmodified lines | ||
| 98 | 97 | { |
| 99 | 98 | } |
| 100 | 99 | |
| 101 | −#define l2x0_set_debug NULL | |
| 100 | +#define pl310_set_debug NULL | |
| 102 | 101 | #endif |
| 103 | 102 | |
| 104 | 103 | #ifdef CONFIG_PL310_ERRATA_588369 |
| @@ -331,6 +330,11 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) · 226 unmodified lines | ||
| 331 | 330 | else |
| 332 | 331 | ways = 8; |
| 333 | 332 | type = "L310"; |
| 333 | +#ifdef CONFIG_PL310_ERRATA_753970 | |
| 334 | + /* Unmapped register. */ | |
| 335 | + sync_reg_offset = L2X0_DUMMY_REG; | |
| 336 | +#endif | |
| 337 | + outer_cache.set_debug = pl310_set_debug; | |
| 334 | 338 | break; |
| 335 | 339 | case L2X0_CACHE_ID_PART_L210: |
| 336 | 340 | ways = (aux >> 13) & 0xf; |
| @@ -379,7 +383,6 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) · 42 unmodified lines | ||
| 379 | 383 | outer_cache.flush_all = l2x0_flush_all; |
| 380 | 384 | outer_cache.inv_all = l2x0_inv_all; |
| 381 | 385 | outer_cache.disable = l2x0_disable; |
| 382 | − outer_cache.set_debug = l2x0_set_debug; | |
| 383 | 386 | |
| 384 | 387 | printk(KERN_INFO "%s cache controller enabled\n", type); |
| 385 | 388 | printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", |
| @@ -18,30 +18,39 @@ · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | static DEFINE_RAW_SPINLOCK(cpu_asid_lock); |
| 20 | 20 | unsigned int cpu_last_asid = ASID_FIRST_VERSION; |
| 21 | −#ifdef CONFIG_SMP | |
| 22 | −DEFINE_PER_CPU(struct mm_struct *, current_mm); | |
| 23 | −#endif | |
| 24 | 21 | |
| 25 | 22 | #ifdef CONFIG_ARM_LPAE |
| 26 | −#define cpu_set_asid(asid) { \ | |
| 27 | − unsigned long ttbl, ttbh; \ | |
| 28 | − asm volatile( \ | |
| 29 | − " mrrc p15, 0, %0, %1, c2 @ read TTBR0\n" \ | |
| 30 | − " mov %1, %2, lsl #(48 - 32) @ set ASID\n" \ | |
| 31 | − " mcrr p15, 0, %0, %1, c2 @ set TTBR0\n" \ | |
| 32 | − : "=&r" (ttbl), "=&r" (ttbh) \ | |
| 33 | − : "r" (asid & ~ASID_MASK)); \ | |
| 23 | +void cpu_set_reserved_ttbr0(void) | |
| 24 | +{ | |
| 25 | + unsigned long ttbl = __pa(swapper_pg_dir); | |
| 26 | + unsigned long ttbh = 0; | |
| 27 | + | |
| 28 | + /* | |
| 29 | + * Set TTBR0 to swapper_pg_dir which contains only global entries. The | |
| 30 | + * ASID is set to 0. | |
| 31 | + */ | |
| 32 | + asm volatile( | |
| 33 | + " mcrr p15, 0, %0, %1, c2 @ set TTBR0\n" | |
| 34 | + : | |
| 35 | + : "r" (ttbl), "r" (ttbh)); | |
| 36 | + isb(); | |
| 34 | 37 | } |
| 35 | 38 | #else |
| 36 | −#define cpu_set_asid(asid) \ | |
| 37 | − asm(" mcr p15, 0, %0, c13, c0, 1\n" : : "r" (asid)) | |
| 39 | +void cpu_set_reserved_ttbr0(void) | |
| 40 | +{ | |
| 41 | + u32 ttb; | |
| 42 | + /* Copy TTBR1 into TTBR0 */ | |
| 43 | + asm volatile( | |
| 44 | + " mrc p15, 0, %0, c2, c0, 1 @ read TTBR1\n" | |
| 45 | + " mcr p15, 0, %0, c2, c0, 0 @ set TTBR0\n" | |
| 46 | + : "=r" (ttb)); | |
| 47 | + isb(); | |
| 48 | +} | |
| 38 | 49 | #endif |
| 39 | 50 | |
| 40 | 51 | /* |
| 41 | 52 | * We fork()ed a process, and we need a new context for the child |
| 42 | − * to run in. We reserve version 0 for initial tasks so we will | |
| 43 | − * always allocate an ASID. The ASID 0 is reserved for the TTBR | |
| 44 | − * register changing sequence. | |
| 53 | + * to run in. | |
| 45 | 54 | */ |
| 46 | 55 | void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) |
| 47 | 56 | { |
| @@ -51,9 +60,7 @@ void __init_new_context(struct task_struct *tsk, struct mm_struct *mm) · 3 unmodified lines | ||
| 51 | 60 | |
| 52 | 61 | static void flush_context(void) |
| 53 | 62 | { |
| 54 | − /* set the reserved ASID before flushing the TLB */ | |
| 55 | − cpu_set_asid(0); | |
| 56 | − isb(); | |
| 63 | + cpu_set_reserved_ttbr0(); | |
| 57 | 64 | local_flush_tlb_all(); |
| 58 | 65 | if (icache_is_vivt_asid_tagged()) { |
| 59 | 66 | __flush_icache_all(); |
| @@ -98,14 +105,7 @@ static void reset_context(void *info) · 38 unmodified lines | ||
| 98 | 105 | { |
| 99 | 106 | unsigned int asid; |
| 100 | 107 | unsigned int cpu = smp_processor_id(); |
| 101 | − struct mm_struct *mm = per_cpu(current_mm, cpu); | |
| 102 | − | |
| 103 | − /* | |
| 104 | − * Check if a current_mm was set on this CPU as it might still | |
| 105 | − * be in the early booting stages and using the reserved ASID. | |
| 106 | − */ | |
| 107 | − if (!mm) | |
| 108 | − return; | |
| 108 | + struct mm_struct *mm = current->active_mm; | |
| 109 | 109 | |
| 110 | 110 | smp_rmb(); |
| 111 | 111 | asid = cpu_last_asid + cpu + 1; |
| @@ -114,8 +114,7 @@ static void reset_context(void *info) · 2 unmodified lines | ||
| 114 | 114 | set_mm_context(mm, asid); |
| 115 | 115 | |
| 116 | 116 | /* set the new ASID */ |
| 117 | − cpu_set_asid(mm->context.id); | |
| 118 | − isb(); | |
| 117 | + cpu_switch_mm(mm->pgd, mm); | |
| 119 | 118 | } |
| 120 | 119 | |
| 121 | 120 | #else |
| @@ -247,7 +247,9 @@ good_area: · 246 unmodified lines | ||
| 247 | 247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); |
| 248 | 248 | |
| 249 | 249 | check_stack: |
| 250 | − if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) | |
| 250 | + /* Don't allow expansion below FIRST_USER_ADDRESS */ | |
| 251 | + if (vma->vm_flags & VM_GROWSDOWN && | |
| 252 | + addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr)) | |
| 251 | 253 | goto good_area; |
| 252 | 254 | out: |
| 253 | 255 | return fault; |
| @@ -293,11 +293,11 @@ EXPORT_SYMBOL(pfn_valid); · 292 unmodified lines | ||
| 293 | 293 | #endif |
| 294 | 294 | |
| 295 | 295 | #ifndef CONFIG_SPARSEMEM |
| 296 | −static void arm_memory_present(void) | |
| 296 | +static void __init arm_memory_present(void) | |
| 297 | 297 | { |
| 298 | 298 | } |
| 299 | 299 | #else |
| 300 | −static void arm_memory_present(void) | |
| 300 | +static void __init arm_memory_present(void) | |
| 301 | 301 | { |
| 302 | 302 | struct memblock_region *reg; |
| 303 | 303 | |
| @@ -489,7 +489,8 @@ static void __init build_mem_type_table(void) · 488 unmodified lines | ||
| 489 | 489 | */ |
| 490 | 490 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { |
| 491 | 491 | mem_types[i].prot_pte |= PTE_EXT_AF; |
| 492 | − mem_types[i].prot_sect |= PMD_SECT_AF; | |
| 492 | + if (mem_types[i].prot_sect) | |
| 493 | + mem_types[i].prot_sect |= PMD_SECT_AF; | |
| 493 | 494 | } |
| 494 | 495 | kern_pgprot |= PTE_EXT_AF; |
| 495 | 496 | vecs_pgprot |= PTE_EXT_AF; |
| @@ -618,8 +619,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr, · 122 unmodified lines | ||
| 618 | 619 | } |
| 619 | 620 | } |
| 620 | 621 | |
| 621 | −static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end, | |
| 622 | − unsigned long phys, const struct mem_type *type) | |
| 622 | +static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr, | |
| 623 | + unsigned long end, unsigned long phys, const struct mem_type *type) | |
| 623 | 624 | { |
| 624 | 625 | pud_t *pud = pud_offset(pgd, addr); |
| 625 | 626 | unsigned long next; |
| @@ -46,18 +46,13 @@ ENTRY(cpu_v7_switch_mm) · 45 unmodified lines | ||
| 46 | 46 | #ifdef CONFIG_ARM_ERRATA_430973 |
| 47 | 47 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB |
| 48 | 48 | #endif |
| 49 | −#ifdef CONFIG_ARM_ERRATA_754322 | |
| 50 | − dsb | |
| 51 | −#endif | |
| 52 | − mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID | |
| 53 | − isb | |
| 54 | −1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | |
| 55 | − isb | |
| 56 | 49 | #ifdef CONFIG_ARM_ERRATA_754322 |
| 57 | 50 | dsb |
| 58 | 51 | #endif |
| 59 | 52 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
| 60 | 53 | isb |
| 54 | + mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | |
| 55 | + isb | |
| 61 | 56 | #endif |
| 62 | 57 | mov pc, lr |
| 63 | 58 | ENDPROC(cpu_v7_switch_mm) |
| @@ -160,7 +160,7 @@ iop3xx_write_config(struct pci_bus *bus, unsigned int devfn, int where, · 159 unmodified lines | ||
| 160 | 160 | return PCIBIOS_SUCCESSFUL; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | −static struct pci_ops iop3xx_ops = { | |
| 163 | +struct pci_ops iop3xx_ops = { | |
| 164 | 164 | .read = iop3xx_read_config, |
| 165 | 165 | .write = iop3xx_write_config, |
| 166 | 166 | }; |
| @@ -220,12 +220,6 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) · 53 unmodified lines | ||
| 220 | 220 | return 1; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | −struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *sys) | |
| 224 | −{ | |
| 225 | − return pci_scan_root_bus(NULL, sys->busnr, &iop3xx_ops, sys, | |
| 226 | − &sys->resources); | |
| 227 | −} | |
| 228 | − | |
| 229 | 223 | void __init iop3xx_atu_setup(void) |
| 230 | 224 | { |
| 231 | 225 | /* BAR 0 ( Disabled ) */ |
| @@ -916,6 +916,13 @@ void omap_start_dma(int lch) · 915 unmodified lines | ||
| 916 | 916 | l |= OMAP_DMA_CCR_BUFFERING_DISABLE; |
| 917 | 917 | l |= OMAP_DMA_CCR_EN; |
| 918 | 918 | |
| 919 | + /* | |
| 920 | + * As dma_write() uses IO accessors which are weakly ordered, there | |
| 921 | + * is no guarantee that data in coherent DMA memory will be visible | |
| 922 | + * to the DMA device. Add a memory barrier here to ensure that any | |
| 923 | + * such data is visible prior to enabling DMA. | |
| 924 | + */ | |
| 925 | + mb(); | |
| 919 | 926 | p->dma_write(l, CCR, lch); |
| 920 | 927 | |
| 921 | 928 | dma_chan[lch].flags |= OMAP_DMA_ACTIVE; |
| @@ -965,6 +972,13 @@ void omap_stop_dma(int lch) · 43 unmodified lines | ||
| 965 | 972 | p->dma_write(l, CCR, lch); |
| 966 | 973 | } |
| 967 | 974 | |
| 975 | + /* | |
| 976 | + * Ensure that data transferred by DMA is visible to any access | |
| 977 | + * after DMA has been disabled. This is important for coherent | |
| 978 | + * DMA regions. | |
| 979 | + */ | |
| 980 | + mb(); | |
| 981 | + | |
| 968 | 982 | if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) { |
| 969 | 983 | int next_lch, cur_lch = lch; |
| 970 | 984 | char dma_chan_link_map[dma_lch_count]; |
| @@ -305,6 +305,7 @@ struct omap_hwmod_sysc_fields { · 304 unmodified lines | ||
| 305 | 305 | * @rev_offs: IP block revision register offset (from module base addr) |
| 306 | 306 | * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr) |
| 307 | 307 | * @syss_offs: OCP_SYSSTATUS register offset (from module base addr) |
| 308 | + * @srst_udelay: Delay needed after doing a softreset in usecs | |
| 308 | 309 | * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART} |
| 309 | 310 | * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported |
| 310 | 311 | * @clockact: the default value of the module CLOCKACTIVITY bits |
| @@ -330,9 +331,10 @@ struct omap_hwmod_class_sysconfig { · 19 unmodified lines | ||
| 330 | 331 | u16 sysc_offs; |
| 331 | 332 | u16 syss_offs; |
| 332 | 333 | u16 sysc_flags; |
| 334 | + struct omap_hwmod_sysc_fields *sysc_fields; | |
| 335 | + u8 srst_udelay; | |
| 333 | 336 | u8 idlemodes; |
| 334 | 337 | u8 clockact; |
| 335 | − struct omap_hwmod_sysc_fields *sysc_fields; | |
| 336 | 338 | }; |
| 337 | 339 | |
| 338 | 340 | /** |
| @@ -348,7 +348,6 @@ u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc, · 347 unmodified lines | ||
| 348 | 348 | sdrc_actim_ctrl_b_1, sdrc_mr_1); |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | −#ifdef CONFIG_PM | |
| 352 | 351 | void omap3_sram_restore_context(void) |
| 353 | 352 | { |
| 354 | 353 | omap_sram_ceil = omap_sram_base + omap_sram_size; |
| @@ -358,17 +357,18 @@ void omap3_sram_restore_context(void) · 3 unmodified lines | ||
| 358 | 357 | omap3_sram_configure_core_dpll_sz); |
| 359 | 358 | omap_push_sram_idle(); |
| 360 | 359 | } |
| 361 | −#endif /* CONFIG_PM */ | |
| 362 | − | |
| 363 | −#endif /* CONFIG_ARCH_OMAP3 */ | |
| 364 | 360 | |
| 365 | 361 | static inline int omap34xx_sram_init(void) |
| 366 | 362 | { |
| 367 | −#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | |
| 368 | 363 | omap3_sram_restore_context(); |
| 369 | −#endif | |
| 370 | 364 | return 0; |
| 371 | 365 | } |
| 366 | +#else | |
| 367 | +static inline int omap34xx_sram_init(void) | |
| 368 | +{ | |
| 369 | + return 0; | |
| 370 | +} | |
| 371 | +#endif /* CONFIG_ARCH_OMAP3 */ | |
| 372 | 372 | |
| 373 | 373 | static inline int am33xx_sram_init(void) |
| 374 | 374 | { |
| @@ -18,6 +18,8 @@ · 17 unmodified lines | ||
| 18 | 18 | #ifndef __PLAT_S3C_SDHCI_H |
| 19 | 19 | #define __PLAT_S3C_SDHCI_H __FILE__ |
| 20 | 20 | |
| 21 | +#include <plat/devs.h> | |
| 22 | + | |
| 21 | 23 | struct platform_device; |
| 22 | 24 | struct mmc_host; |
| 23 | 25 | struct mmc_card; |
| @@ -356,4 +358,30 @@ static inline void exynos4_default_sdhci3(void) { } · 332 unmodified lines | ||
| 356 | 358 | |
| 357 | 359 | #endif /* CONFIG_EXYNOS4_SETUP_SDHCI */ |
| 358 | 360 | |
| 361 | +static inline void s3c_sdhci_setname(int id, char *name) | |
| 362 | +{ | |
| 363 | + switch (id) { | |
| 364 | +#ifdef CONFIG_S3C_DEV_HSMMC | |
| 365 | + case 0: | |
| 366 | + s3c_device_hsmmc0.name = name; | |
| 367 | + break; | |
| 368 | +#endif | |
| 369 | +#ifdef CONFIG_S3C_DEV_HSMMC1 | |
| 370 | + case 1: | |
| 371 | + s3c_device_hsmmc1.name = name; | |
| 372 | + break; | |
| 373 | +#endif | |
| 374 | +#ifdef CONFIG_S3C_DEV_HSMMC2 | |
| 375 | + case 2: | |
| 376 | + s3c_device_hsmmc2.name = name; | |
| 377 | + break; | |
| 378 | +#endif | |
| 379 | +#ifdef CONFIG_S3C_DEV_HSMMC3 | |
| 380 | + case 3: | |
| 381 | + s3c_device_hsmmc3.name = name; | |
| 382 | + break; | |
| 383 | +#endif | |
| 384 | + } | |
| 385 | +} | |
| 386 | + | |
| 359 | 387 | #endif /* __PLAT_S3C_SDHCI_H */ |
| @@ -5,6 +5,12 @@ config PLAT_VERSATILE_CLCD · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | config PLAT_VERSATILE_FPGA_IRQ |
| 7 | 7 | bool |
| 8 | + select IRQ_DOMAIN | |
| 9 | + | |
| 10 | +config PLAT_VERSATILE_FPGA_IRQ_NR | |
| 11 | + int | |
| 12 | + default 4 | |
| 13 | + depends on PLAT_VERSATILE_FPGA_IRQ | |
| 8 | 14 | |
| 9 | 15 | config PLAT_VERSATILE_LEDS |
| 10 | 16 | def_bool y if LEDS_CLASS |
| @@ -3,7 +3,10 @@ · 2 unmodified lines | ||
| 3 | 3 | */ |
| 4 | 4 | #include <linux/irq.h> |
| 5 | 5 | #include <linux/io.h> |
| 6 | +#include <linux/irqdomain.h> | |
| 7 | +#include <linux/module.h> | |
| 6 | 8 | |
| 9 | +#include <asm/exception.h> | |
| 7 | 10 | #include <asm/mach/irq.h> |
| 8 | 11 | #include <plat/fpga-irq.h> |
| 9 | 12 | |
| @@ -12,10 +15,32 @@ · 2 unmodified lines | ||
| 12 | 15 | #define IRQ_ENABLE_SET 0x08 |
| 13 | 16 | #define IRQ_ENABLE_CLEAR 0x0c |
| 14 | 17 | |
| 18 | +/** | |
| 19 | + * struct fpga_irq_data - irq data container for the FPGA IRQ controller | |
| 20 | + * @base: memory offset in virtual memory | |
| 21 | + * @irq_start: first IRQ number handled by this instance | |
| 22 | + * @chip: chip container for this instance | |
| 23 | + * @domain: IRQ domain for this instance | |
| 24 | + * @valid: mask for valid IRQs on this controller | |
| 25 | + * @used_irqs: number of active IRQs on this controller | |
| 26 | + */ | |
| 27 | +struct fpga_irq_data { | |
| 28 | + void __iomem *base; | |
| 29 | + unsigned int irq_start; | |
| 30 | + struct irq_chip chip; | |
| 31 | + u32 valid; | |
| 32 | + struct irq_domain *domain; | |
| 33 | + u8 used_irqs; | |
| 34 | +}; | |
| 35 | + | |
| 36 | +/* we cannot allocate memory when the controllers are initially registered */ | |
| 37 | +static struct fpga_irq_data fpga_irq_devices[CONFIG_PLAT_VERSATILE_FPGA_IRQ_NR]; | |
| 38 | +static int fpga_irq_id; | |
| 39 | + | |
| 15 | 40 | static void fpga_irq_mask(struct irq_data *d) |
| 16 | 41 | { |
| 17 | 42 | struct fpga_irq_data *f = irq_data_get_irq_chip_data(d); |
| 18 | − u32 mask = 1 << (d->irq - f->irq_start); | |
| 43 | + u32 mask = 1 << d->hwirq; | |
| 19 | 44 | |
| 20 | 45 | writel(mask, f->base + IRQ_ENABLE_CLEAR); |
| 21 | 46 | } |
| @@ -23,7 +48,7 @@ static void fpga_irq_mask(struct irq_data *d) · 1 unmodified line | ||
| 23 | 48 | static void fpga_irq_unmask(struct irq_data *d) |
| 24 | 49 | { |
| 25 | 50 | struct fpga_irq_data *f = irq_data_get_irq_chip_data(d); |
| 26 | − u32 mask = 1 << (d->irq - f->irq_start); | |
| 51 | + u32 mask = 1 << d->hwirq; | |
| 27 | 52 | |
| 28 | 53 | writel(mask, f->base + IRQ_ENABLE_SET); |
| 29 | 54 | } |
| @@ -41,32 +66,93 @@ static void fpga_irq_handle(unsigned int irq, struct irq_desc *desc) · 11 unmodified lines | ||
| 41 | 66 | do { |
| 42 | 67 | irq = ffs(status) - 1; |
| 43 | 68 | status &= ~(1 << irq); |
| 44 | − | |
| 45 | − generic_handle_irq(irq + f->irq_start); | |
| 69 | + generic_handle_irq(irq_find_mapping(f->domain, irq)); | |
| 46 | 70 | } while (status); |
| 47 | 71 | } |
| 48 | 72 | |
| 49 | −void __init fpga_irq_init(int parent_irq, u32 valid, struct fpga_irq_data *f) | |
| 73 | +/* | |
| 74 | + * Handle each interrupt in a single FPGA IRQ controller. Returns non-zero | |
| 75 | + * if we've handled at least one interrupt. This does a single read of the | |
| 76 | + * status register and handles all interrupts in order from LSB first. | |
| 77 | + */ | |
| 78 | +static int handle_one_fpga(struct fpga_irq_data *f, struct pt_regs *regs) | |
| 79 | +{ | |
| 80 | + int handled = 0; | |
| 81 | + int irq; | |
| 82 | + u32 status; | |
| 83 | + | |
| 84 | + while ((status = readl(f->base + IRQ_STATUS))) { | |
| 85 | + irq = ffs(status) - 1; | |
| 86 | + handle_IRQ(irq_find_mapping(f->domain, irq), regs); | |
| 87 | + handled = 1; | |
| 88 | + } | |
| 89 | + | |
| 90 | + return handled; | |
| 91 | +} | |
| 92 | + | |
| 93 | +/* | |
| 94 | + * Keep iterating over all registered FPGA IRQ controllers until there are | |
| 95 | + * no pending interrupts. | |
| 96 | + */ | |
| 97 | +asmlinkage void __exception_irq_entry fpga_handle_irq(struct pt_regs *regs) | |
| 50 | 98 | { |
| 51 | − unsigned int i; | |
| 99 | + int i, handled; | |
| 52 | 100 | |
| 101 | + do { | |
| 102 | + for (i = 0, handled = 0; i < fpga_irq_id; ++i) | |
| 103 | + handled |= handle_one_fpga(&fpga_irq_devices[i], regs); | |
| 104 | + } while (handled); | |
| 105 | +} | |
| 106 | + | |
| 107 | +static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq, | |
| 108 | + irq_hw_number_t hwirq) | |
| 109 | +{ | |
| 110 | + struct fpga_irq_data *f = d->host_data; | |
| 111 | + | |
| 112 | + /* Skip invalid IRQs, only register handlers for the real ones */ | |
| 113 | + if (!(f->valid & (1 << hwirq))) | |
| 114 | + return -ENOTSUPP; | |
| 115 | + irq_set_chip_data(irq, f); | |
| 116 | + irq_set_chip_and_handler(irq, &f->chip, | |
| 117 | + handle_level_irq); | |
| 118 | + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | |
| 119 | + f->used_irqs++; | |
| 120 | + return 0; | |
| 121 | +} | |
| 122 | + | |
| 123 | +static struct irq_domain_ops fpga_irqdomain_ops = { | |
| 124 | + .map = fpga_irqdomain_map, | |
| 125 | + .xlate = irq_domain_xlate_onetwocell, | |
| 126 | +}; | |
| 127 | + | |
| 128 | +void __init fpga_irq_init(void __iomem *base, const char *name, int irq_start, | |
| 129 | + int parent_irq, u32 valid, struct device_node *node) | |
| 130 | +{ | |
| 131 | + struct fpga_irq_data *f; | |
| 132 | + | |
| 133 | + if (fpga_irq_id >= ARRAY_SIZE(fpga_irq_devices)) { | |
| 134 | + printk(KERN_ERR "%s: too few FPGA IRQ controllers, increase CONFIG_PLAT_VERSATILE_FPGA_IRQ_NR\n", __func__); | |
| 135 | + return; | |
| 136 | + } | |
| 137 | + | |
| 138 | + f = &fpga_irq_devices[fpga_irq_id]; | |
| 139 | + f->base = base; | |
| 140 | + f->irq_start = irq_start; | |
| 141 | + f->chip.name = name; | |
| 53 | 142 | f->chip.irq_ack = fpga_irq_mask; |
| 54 | 143 | f->chip.irq_mask = fpga_irq_mask; |
| 55 | 144 | f->chip.irq_unmask = fpga_irq_unmask; |
| 145 | + f->valid = valid; | |
| 56 | 146 | |
| 57 | 147 | if (parent_irq != -1) { |
| 58 | 148 | irq_set_handler_data(parent_irq, f); |
| 59 | 149 | irq_set_chained_handler(parent_irq, fpga_irq_handle); |
| 60 | 150 | } |
| 61 | 151 | |
| 62 | − for (i = 0; i < 32; i++) { | |
| 63 | − if (valid & (1 << i)) { | |
| 64 | − unsigned int irq = f->irq_start + i; | |
| 152 | + f->domain = irq_domain_add_legacy(node, fls(valid), f->irq_start, 0, | |
| 153 | + &fpga_irqdomain_ops, f); | |
| 154 | + pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs\n", | |
| 155 | + fpga_irq_id, name, base, f->used_irqs); | |
| 65 | 156 | |
| 66 | − irq_set_chip_data(irq, f); | |
| 67 | − irq_set_chip_and_handler(irq, &f->chip, | |
| 68 | − handle_level_irq); | |
| 69 | − set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | |
| 70 | − } | |
| 71 | − } | |
| 157 | + fpga_irq_id++; | |
| 72 | 158 | } |
| @@ -1,12 +1,11 @@ | ||
| 1 | 1 | #ifndef PLAT_FPGA_IRQ_H |
| 2 | 2 | #define PLAT_FPGA_IRQ_H |
| 3 | 3 | |
| 4 | −struct fpga_irq_data { | |
| 5 | − void __iomem *base; | |
| 6 | − unsigned int irq_start; | |
| 7 | − struct irq_chip chip; | |
| 8 | −}; | |
| 4 | +struct device_node; | |
| 5 | +struct pt_regs; | |
| 9 | 6 | |
| 10 | −void fpga_irq_init(int, u32, struct fpga_irq_data *); | |
| 7 | +void fpga_handle_irq(struct pt_regs *regs); | |
| 8 | +void fpga_irq_init(void __iomem *, const char *, int, int, u32, | |
| 9 | + struct device_node *node); | |
| 11 | 10 | |
| 12 | 11 | #endif |
| @@ -16,7 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | # are merged into mainline or have been edited in the machine database |
| 17 | 17 | # within the last 12 months. References to machine_is_NAME() do not count! |
| 18 | 18 | # |
| 19 | −# Last update: Tue Dec 6 11:07:38 2011 | |
| 19 | +# Last update: Thu Apr 26 08:44:23 2012 | |
| 20 | 20 | # |
| 21 | 21 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
| 22 | 22 | # |
| @@ -205,6 +205,7 @@ omap_fsample MACH_OMAP_FSAMPLE OMAP_FSAMPLE 970 · 182 unmodified lines | ||
| 205 | 205 | snapper_cl15 MACH_SNAPPER_CL15 SNAPPER_CL15 986 |
| 206 | 206 | omap_palmz71 MACH_OMAP_PALMZ71 OMAP_PALMZ71 993 |
| 207 | 207 | smdk2412 MACH_SMDK2412 SMDK2412 1009 |
| 208 | +bkde303 MACH_BKDE303 BKDE303 1021 | |
| 208 | 209 | smdk2413 MACH_SMDK2413 SMDK2413 1022 |
| 209 | 210 | aml_m5900 MACH_AML_M5900 AML_M5900 1024 |
| 210 | 211 | balloon3 MACH_BALLOON3 BALLOON3 1029 |
| @@ -381,8 +382,6 @@ davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 · 170 unmodified lines | ||
| 381 | 382 | at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 |
| 382 | 383 | omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 |
| 383 | 384 | magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 |
| 384 | −btmavb101 MACH_BTMAVB101 BTMAVB101 2172 | |
| 385 | −btmawb101 MACH_BTMAWB101 BTMAWB101 2173 | |
| 386 | 385 | tx25 MACH_TX25 TX25 2177 |
| 387 | 386 | omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 |
| 388 | 387 | anw6410 MACH_ANW6410 ANW6410 2183 |
| @@ -397,7 +396,6 @@ net2big_v2 MACH_NET2BIG_V2 NET2BIG_V2 2204 · 8 unmodified lines | ||
| 397 | 396 | net5big_v2 MACH_NET5BIG_V2 NET5BIG_V2 2206 |
| 398 | 397 | inetspace_v2 MACH_INETSPACE_V2 INETSPACE_V2 2208 |
| 399 | 398 | at91sam9g45ekes MACH_AT91SAM9G45EKES AT91SAM9G45EKES 2212 |
| 400 | −pc7302 MACH_PC7302 PC7302 2220 | |
| 401 | 399 | spear600 MACH_SPEAR600 SPEAR600 2236 |
| 402 | 400 | spear300 MACH_SPEAR300 SPEAR300 2237 |
| 403 | 401 | lilly1131 MACH_LILLY1131 LILLY1131 2239 |
| @@ -407,7 +405,6 @@ d2net MACH_D2NET D2NET 2282 · 3 unmodified lines | ||
| 407 | 405 | bigdisk MACH_BIGDISK BIGDISK 2283 |
| 408 | 406 | at91sam9g20ek_2mmc MACH_AT91SAM9G20EK_2MMC AT91SAM9G20EK_2MMC 2288 |
| 409 | 407 | bcmring MACH_BCMRING BCMRING 2289 |
| 410 | −dp6xx MACH_DP6XX DP6XX 2302 | |
| 411 | 408 | mahimahi MACH_MAHIMAHI MAHIMAHI 2304 |
| 412 | 409 | smdk6442 MACH_SMDK6442 SMDK6442 2324 |
| 413 | 410 | openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325 |
| @@ -444,8 +441,6 @@ mx28evk MACH_MX28EVK MX28EVK 2531 · 30 unmodified lines | ||
| 444 | 441 | smartq5 MACH_SMARTQ5 SMARTQ5 2534 |
| 445 | 442 | davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548 |
| 446 | 443 | mxt_td60 MACH_MXT_TD60 MXT_TD60 2550 |
| 447 | −riot_bei2 MACH_RIOT_BEI2 RIOT_BEI2 2576 | |
| 448 | −riot_x37 MACH_RIOT_X37 RIOT_X37 2578 | |
| 449 | 444 | pca101 MACH_PCA101 PCA101 2595 |
| 450 | 445 | capc7117 MACH_CAPC7117 CAPC7117 2612 |
| 451 | 446 | icontrol MACH_ICONTROL ICONTROL 2624 |
| @@ -460,7 +455,6 @@ spear320 MACH_SPEAR320 SPEAR320 2661 · 8 unmodified lines | ||
| 460 | 455 | aquila MACH_AQUILA AQUILA 2676 |
| 461 | 456 | esata_sheevaplug MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678 |
| 462 | 457 | msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679 |
| 463 | −ea2478devkit MACH_EA2478DEVKIT EA2478DEVKIT 2683 | |
| 464 | 458 | terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697 |
| 465 | 459 | msm7x25_surf MACH_MSM7X25_SURF MSM7X25_SURF 2703 |
| 466 | 460 | msm7x25_ffa MACH_MSM7X25_FFA MSM7X25_FFA 2704 |
| @@ -479,8 +473,6 @@ wbd222 MACH_WBD222 WBD222 2753 · 12 unmodified lines | ||
| 479 | 473 | msm8x60_surf MACH_MSM8X60_SURF MSM8X60_SURF 2755 |
| 480 | 474 | msm8x60_sim MACH_MSM8X60_SIM MSM8X60_SIM 2756 |
| 481 | 475 | tcc8000_sdk MACH_TCC8000_SDK TCC8000_SDK 2758 |
| 482 | −nanos MACH_NANOS NANOS 2759 | |
| 483 | −stamp9g45 MACH_STAMP9G45 STAMP9G45 2761 | |
| 484 | 476 | cns3420vb MACH_CNS3420VB CNS3420VB 2776 |
| 485 | 477 | omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791 |
| 486 | 478 | ti8168evm MACH_TI8168EVM TI8168EVM 2800 |
| @@ -490,12 +482,9 @@ eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821 · 3 unmodified lines | ||
| 490 | 482 | eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822 |
| 491 | 483 | eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823 |
| 492 | 484 | smdkc210 MACH_SMDKC210 SMDKC210 2838 |
| 493 | −pca102 MACH_PCA102 PCA102 2843 | |
| 485 | +pcaal1 MACH_PCAAL1 PCAAL1 2843 | |
| 494 | 486 | t5325 MACH_T5325 T5325 2846 |
| 495 | 487 | income MACH_INCOME INCOME 2849 |
| 496 | −vvbox_sdorig2 MACH_VVBOX_SDORIG2 VVBOX_SDORIG2 2857 | |
| 497 | −vvbox_sdlite2 MACH_VVBOX_SDLITE2 VVBOX_SDLITE2 2858 | |
| 498 | −vvbox_sdpro4 MACH_VVBOX_SDPRO4 VVBOX_SDPRO4 2859 | |
| 499 | 488 | mx257sx MACH_MX257SX MX257SX 2861 |
| 500 | 489 | goni MACH_GONI GONI 2862 |
| 501 | 490 | bv07 MACH_BV07 BV07 2882 |
| @@ -504,6 +493,7 @@ devixp MACH_DEVIXP DEVIXP 2885 · 2 unmodified lines | ||
| 504 | 493 | miccpt MACH_MICCPT MICCPT 2886 |
| 505 | 494 | mic256 MACH_MIC256 MIC256 2887 |
| 506 | 495 | u5500 MACH_U5500 U5500 2890 |
| 496 | +pov15hd MACH_POV15HD POV15HD 2910 | |
| 507 | 497 | linkstation_lschl MACH_LINKSTATION_LSCHL LINKSTATION_LSCHL 2913 |
| 508 | 498 | smdkv310 MACH_SMDKV310 SMDKV310 2925 |
| 509 | 499 | wm8505_7in_netbook MACH_WM8505_7IN_NETBOOK WM8505_7IN_NETBOOK 2928 |
| @@ -537,243 +527,24 @@ trimslice MACH_TRIMSLICE TRIMSLICE 3209 · 27 unmodified lines | ||
| 537 | 527 | mackerel MACH_MACKEREL MACKEREL 3211 |
| 538 | 528 | kaen MACH_KAEN KAEN 3217 |
| 539 | 529 | nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220 |
| 540 | −dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226 | |
| 541 | −quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227 | |
| 542 | −abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228 | |
| 543 | −svcid MACH_SVCID SVCID 3229 | |
| 544 | 530 | msm8960_sim MACH_MSM8960_SIM MSM8960_SIM 3230 |
| 545 | 531 | msm8960_rumi3 MACH_MSM8960_RUMI3 MSM8960_RUMI3 3231 |
| 546 | −icon_g MACH_ICON_G ICON_G 3232 | |
| 547 | −mb3 MACH_MB3 MB3 3233 | |
| 548 | 532 | gsia18s MACH_GSIA18S GSIA18S 3234 |
| 549 | −pivicc MACH_PIVICC PIVICC 3235 | |
| 550 | −pcm048 MACH_PCM048 PCM048 3236 | |
| 551 | −dds MACH_DDS DDS 3237 | |
| 552 | −chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238 | |
| 553 | −ts48xx MACH_TS48XX TS48XX 3239 | |
| 554 | −tonga2_tfttimer MACH_TONGA2_TFTTIMER TONGA2_TFTTIMER 3240 | |
| 555 | −whistler MACH_WHISTLER WHISTLER 3241 | |
| 556 | −asl_phoenix MACH_ASL_PHOENIX ASL_PHOENIX 3242 | |
| 557 | −at91sam9263otlite MACH_AT91SAM9263OTLITE AT91SAM9263OTLITE 3243 | |
| 558 | −ddplug MACH_DDPLUG DDPLUG 3244 | |
| 559 | −d2plug MACH_D2PLUG D2PLUG 3245 | |
| 560 | −kzm9d MACH_KZM9D KZM9D 3246 | |
| 561 | −verdi_lte MACH_VERDI_LTE VERDI_LTE 3247 | |
| 562 | −nanozoom MACH_NANOZOOM NANOZOOM 3248 | |
| 563 | −dm3730_som_lv MACH_DM3730_SOM_LV DM3730_SOM_LV 3249 | |
| 564 | −dm3730_torpedo MACH_DM3730_TORPEDO DM3730_TORPEDO 3250 | |
| 565 | −anchovy MACH_ANCHOVY ANCHOVY 3251 | |
| 566 | −re2rev20 MACH_RE2REV20 RE2REV20 3253 | |
| 567 | −re2rev21 MACH_RE2REV21 RE2REV21 3254 | |
| 568 | −cns21xx MACH_CNS21XX CNS21XX 3255 | |
| 569 | −rider MACH_RIDER RIDER 3257 | |
| 570 | −nsk330 MACH_NSK330 NSK330 3258 | |
| 571 | −cns2133evb MACH_CNS2133EVB CNS2133EVB 3259 | |
| 572 | −z3_816x_mod MACH_Z3_816X_MOD Z3_816X_MOD 3260 | |
| 573 | −z3_814x_mod MACH_Z3_814X_MOD Z3_814X_MOD 3261 | |
| 574 | −beect MACH_BEECT BEECT 3262 | |
| 575 | −dma_thunderbug MACH_DMA_THUNDERBUG DMA_THUNDERBUG 3263 | |
| 576 | −omn_at91sam9g20 MACH_OMN_AT91SAM9G20 OMN_AT91SAM9G20 3264 | |
| 577 | −mx25_e2s_uc MACH_MX25_E2S_UC MX25_E2S_UC 3265 | |
| 578 | −mione MACH_MIONE MIONE 3266 | |
| 579 | −top9000_tcu MACH_TOP9000_TCU TOP9000_TCU 3267 | |
| 580 | −top9000_bsl MACH_TOP9000_BSL TOP9000_BSL 3268 | |
| 581 | −kingdom MACH_KINGDOM KINGDOM 3269 | |
| 582 | −armadillo460 MACH_ARMADILLO460 ARMADILLO460 3270 | |
| 583 | −lq2 MACH_LQ2 LQ2 3271 | |
| 584 | −sweda_tms2 MACH_SWEDA_TMS2 SWEDA_TMS2 3272 | |
| 585 | 533 | mx53_loco MACH_MX53_LOCO MX53_LOCO 3273 |
| 586 | −acer_a8 MACH_ACER_A8 ACER_A8 3275 | |
| 587 | −acer_gauguin MACH_ACER_GAUGUIN ACER_GAUGUIN 3276 | |
| 588 | −guppy MACH_GUPPY GUPPY 3277 | |
| 589 | −mx61_ard MACH_MX61_ARD MX61_ARD 3278 | |
| 590 | 534 | tx53 MACH_TX53 TX53 3279 |
| 591 | −omapl138_case_a3 MACH_OMAPL138_CASE_A3 OMAPL138_CASE_A3 3280 | |
| 592 | −uemd MACH_UEMD UEMD 3281 | |
| 593 | −ccwmx51mut MACH_CCWMX51MUT CCWMX51MUT 3282 | |
| 594 | −rockhopper MACH_ROCKHOPPER ROCKHOPPER 3283 | |
| 595 | 535 | encore MACH_ENCORE ENCORE 3284 |
| 596 | −hkdkc100 MACH_HKDKC100 HKDKC100 3285 | |
| 597 | −ts42xx MACH_TS42XX TS42XX 3286 | |
| 598 | −aebl MACH_AEBL AEBL 3287 | |
| 599 | 536 | wario MACH_WARIO WARIO 3288 |
| 600 | −gfs_spm MACH_GFS_SPM GFS_SPM 3289 | |
| 601 | 537 | cm_t3730 MACH_CM_T3730 CM_T3730 3290 |
| 602 | −isc3 MACH_ISC3 ISC3 3291 | |
| 603 | −rascal MACH_RASCAL RASCAL 3292 | |
| 604 | 538 | hrefv60 MACH_HREFV60 HREFV60 3293 |
| 605 | −tpt_2_0 MACH_TPT_2_0 TPT_2_0 3294 | |
| 606 | −splendor MACH_SPLENDOR SPLENDOR 3296 | |
| 607 | −msm8x60_qt MACH_MSM8X60_QT MSM8X60_QT 3298 | |
| 608 | −htc_hd_mini MACH_HTC_HD_MINI HTC_HD_MINI 3299 | |
| 609 | −athene MACH_ATHENE ATHENE 3300 | |
| 610 | −deep_r_ek_1 MACH_DEEP_R_EK_1 DEEP_R_EK_1 3301 | |
| 611 | −vivow_ct MACH_VIVOW_CT VIVOW_CT 3302 | |
| 612 | −nery_1000 MACH_NERY_1000 NERY_1000 3303 | |
| 613 | −rfl109145_ssrv MACH_RFL109145_SSRV RFL109145_SSRV 3304 | |
| 614 | −nmh MACH_NMH NMH 3305 | |
| 615 | −wn802t MACH_WN802T WN802T 3306 | |
| 616 | −dragonet MACH_DRAGONET DRAGONET 3307 | |
| 617 | −at91sam9263desk16l MACH_AT91SAM9263DESK16L AT91SAM9263DESK16L 3309 | |
| 618 | −bcmhana_sv MACH_BCMHANA_SV BCMHANA_SV 3310 | |
| 619 | −bcmhana_tablet MACH_BCMHANA_TABLET BCMHANA_TABLET 3311 | |
| 620 | −koi MACH_KOI KOI 3312 | |
| 621 | −ts4800 MACH_TS4800 TS4800 3313 | |
| 622 | −tqma9263 MACH_TQMA9263 TQMA9263 3314 | |
| 623 | −holiday MACH_HOLIDAY HOLIDAY 3315 | |
| 624 | −pcats_overlay MACH_PCATS_OVERLAY PCATS_OVERLAY 3317 | |
| 625 | −hwgw6410 MACH_HWGW6410 HWGW6410 3318 | |
| 626 | −shenzhou MACH_SHENZHOU SHENZHOU 3319 | |
| 627 | −cwme9210 MACH_CWME9210 CWME9210 3320 | |
| 628 | −cwme9210js MACH_CWME9210JS CWME9210JS 3321 | |
| 629 | −colibri_tegra2 MACH_COLIBRI_TEGRA2 COLIBRI_TEGRA2 3323 | |
| 630 | −w21 MACH_W21 W21 3324 | |
| 631 | −polysat1 MACH_POLYSAT1 POLYSAT1 3325 | |
| 632 | −dataway MACH_DATAWAY DATAWAY 3326 | |
| 633 | −cobral138 MACH_COBRAL138 COBRAL138 3327 | |
| 634 | −roverpcs8 MACH_ROVERPCS8 ROVERPCS8 3328 | |
| 635 | −marvelc MACH_MARVELC MARVELC 3329 | |
| 636 | −navefihid MACH_NAVEFIHID NAVEFIHID 3330 | |
| 637 | −dm365_cv100 MACH_DM365_CV100 DM365_CV100 3331 | |
| 638 | −able MACH_ABLE ABLE 3332 | |
| 639 | −legacy MACH_LEGACY LEGACY 3333 | |
| 640 | −icong MACH_ICONG ICONG 3334 | |
| 641 | −rover_g8 MACH_ROVER_G8 ROVER_G8 3335 | |
| 642 | −t5388p MACH_T5388P T5388P 3336 | |
| 643 | −dingo MACH_DINGO DINGO 3337 | |
| 644 | −goflexhome MACH_GOFLEXHOME GOFLEXHOME 3338 | |
| 645 | −lanreadyfn511 MACH_LANREADYFN511 LANREADYFN511 3340 | |
| 646 | −omap3_baia MACH_OMAP3_BAIA OMAP3_BAIA 3341 | |
| 647 | −omap3smartdisplay MACH_OMAP3SMARTDISPLAY OMAP3SMARTDISPLAY 3342 | |
| 648 | −xilinx MACH_XILINX XILINX 3343 | |
| 649 | −a2f MACH_A2F A2F 3344 | |
| 650 | −sky25 MACH_SKY25 SKY25 3345 | |
| 651 | −ccmx53 MACH_CCMX53 CCMX53 3346 | |
| 652 | −ccmx53js MACH_CCMX53JS CCMX53JS 3347 | |
| 653 | −ccwmx53 MACH_CCWMX53 CCWMX53 3348 | |
| 654 | −ccwmx53js MACH_CCWMX53JS CCWMX53JS 3349 | |
| 655 | −frisms MACH_FRISMS FRISMS 3350 | |
| 656 | −msm7x27a_ffa MACH_MSM7X27A_FFA MSM7X27A_FFA 3351 | |
| 657 | −msm7x27a_surf MACH_MSM7X27A_SURF MSM7X27A_SURF 3352 | |
| 658 | −msm7x27a_rumi3 MACH_MSM7X27A_RUMI3 MSM7X27A_RUMI3 3353 | |
| 659 | −dimmsam9g20 MACH_DIMMSAM9G20 DIMMSAM9G20 3354 | |
| 660 | −dimm_imx28 MACH_DIMM_IMX28 DIMM_IMX28 3355 | |
| 661 | −amk_a4 MACH_AMK_A4 AMK_A4 3356 | |
| 662 | −gnet_sgme MACH_GNET_SGME GNET_SGME 3357 | |
| 663 | −shooter_u MACH_SHOOTER_U SHOOTER_U 3358 | |
| 664 | −vmx53 MACH_VMX53 VMX53 3359 | |
| 665 | −rhino MACH_RHINO RHINO 3360 | |
| 666 | 539 | armlex4210 MACH_ARMLEX4210 ARMLEX4210 3361 |
| 667 | −swarcoextmodem MACH_SWARCOEXTMODEM SWARCOEXTMODEM 3362 | |
| 668 | 540 | snowball MACH_SNOWBALL SNOWBALL 3363 |
| 669 | −pcm049 MACH_PCM049 PCM049 3364 | |
| 670 | −vigor MACH_VIGOR VIGOR 3365 | |
| 671 | −oslo_amundsen MACH_OSLO_AMUNDSEN OSLO_AMUNDSEN 3366 | |
| 672 | −gsl_diamond MACH_GSL_DIAMOND GSL_DIAMOND 3367 | |
| 673 | −cv2201 MACH_CV2201 CV2201 3368 | |
| 674 | −cv2202 MACH_CV2202 CV2202 3369 | |
| 675 | −cv2203 MACH_CV2203 CV2203 3370 | |
| 676 | −vit_ibox MACH_VIT_IBOX VIT_IBOX 3371 | |
| 677 | −dm6441_esp MACH_DM6441_ESP DM6441_ESP 3372 | |
| 678 | −at91sam9x5ek MACH_AT91SAM9X5EK AT91SAM9X5EK 3373 | |
| 679 | −libra MACH_LIBRA LIBRA 3374 | |
| 680 | −easycrrh MACH_EASYCRRH EASYCRRH 3375 | |
| 681 | −tripel MACH_TRIPEL TRIPEL 3376 | |
| 682 | −endian_mini MACH_ENDIAN_MINI ENDIAN_MINI 3377 | |
| 683 | 541 | xilinx_ep107 MACH_XILINX_EP107 XILINX_EP107 3378 |
| 684 | 542 | nuri MACH_NURI NURI 3379 |
| 685 | −janus MACH_JANUS JANUS 3380 | |
| 686 | −ddnas MACH_DDNAS DDNAS 3381 | |
| 687 | −tag MACH_TAG TAG 3382 | |
| 688 | −tagw MACH_TAGW TAGW 3383 | |
| 689 | −nitrogen_vm_imx51 MACH_NITROGEN_VM_IMX51 NITROGEN_VM_IMX51 3384 | |
| 690 | −viprinet MACH_VIPRINET VIPRINET 3385 | |
| 691 | −bockw MACH_BOCKW BOCKW 3386 | |
| 692 | −eva2000 MACH_EVA2000 EVA2000 3387 | |
| 693 | −steelyard MACH_STEELYARD STEELYARD 3388 | |
| 694 | −nsslsboard MACH_NSSLSBOARD NSSLSBOARD 3392 | |
| 695 | −geneva_b5 MACH_GENEVA_B5 GENEVA_B5 3393 | |
| 696 | −spear1340 MACH_SPEAR1340 SPEAR1340 3394 | |
| 697 | −rexmas MACH_REXMAS REXMAS 3395 | |
| 698 | −msm8960_cdp MACH_MSM8960_CDP MSM8960_CDP 3396 | |
| 699 | −msm8960_fluid MACH_MSM8960_FLUID MSM8960_FLUID 3398 | |
| 700 | −msm8960_apq MACH_MSM8960_APQ MSM8960_APQ 3399 | |
| 701 | −helios_v2 MACH_HELIOS_V2 HELIOS_V2 3400 | |
| 702 | −mif10p MACH_MIF10P MIF10P 3401 | |
| 703 | −iam28 MACH_IAM28 IAM28 3402 | |
| 704 | −picasso MACH_PICASSO PICASSO 3403 | |
| 705 | −mr301a MACH_MR301A MR301A 3404 | |
| 706 | −notle MACH_NOTLE NOTLE 3405 | |
| 707 | −eelx2 MACH_EELX2 EELX2 3406 | |
| 708 | −moon MACH_MOON MOON 3407 | |
| 709 | −ruby MACH_RUBY RUBY 3408 | |
| 710 | −goldengate MACH_GOLDENGATE GOLDENGATE 3409 | |
| 711 | −ctbu_gen2 MACH_CTBU_GEN2 CTBU_GEN2 3410 | |
| 712 | −kmp_am17_01 MACH_KMP_AM17_01 KMP_AM17_01 3411 | |
| 713 | 543 | wtplug MACH_WTPLUG WTPLUG 3412 |
| 714 | −mx27su2 MACH_MX27SU2 MX27SU2 3413 | |
| 715 | −nb31 MACH_NB31 NB31 3414 | |
| 716 | −hjsdu MACH_HJSDU HJSDU 3415 | |
| 717 | −td3_rev1 MACH_TD3_REV1 TD3_REV1 3416 | |
| 718 | −eag_ci4000 MACH_EAG_CI4000 EAG_CI4000 3417 | |
| 719 | −net5big_nand_v2 MACH_NET5BIG_NAND_V2 NET5BIG_NAND_V2 3418 | |
| 720 | −cpx2 MACH_CPX2 CPX2 3419 | |
| 721 | −net2big_nand_v2 MACH_NET2BIG_NAND_V2 NET2BIG_NAND_V2 3420 | |
| 722 | −ecuv5 MACH_ECUV5 ECUV5 3421 | |
| 723 | −hsgx6d MACH_HSGX6D HSGX6D 3422 | |
| 724 | −dawad7 MACH_DAWAD7 DAWAD7 3423 | |
| 725 | −sam9repeater MACH_SAM9REPEATER SAM9REPEATER 3424 | |
| 726 | −gt_i5700 MACH_GT_I5700 GT_I5700 3425 | |
| 727 | −ctera_plug_c2 MACH_CTERA_PLUG_C2 CTERA_PLUG_C2 3426 | |
| 728 | −marvelct MACH_MARVELCT MARVELCT 3427 | |
| 729 | −ag11005 MACH_AG11005 AG11005 3428 | |
| 730 | −vangogh MACH_VANGOGH VANGOGH 3430 | |
| 731 | −matrix505 MACH_MATRIX505 MATRIX505 3431 | |
| 732 | −oce_nigma MACH_OCE_NIGMA OCE_NIGMA 3432 | |
| 733 | −t55 MACH_T55 T55 3433 | |
| 734 | −bio3k MACH_BIO3K BIO3K 3434 | |
| 735 | −expressct MACH_EXPRESSCT EXPRESSCT 3435 | |
| 736 | −cardhu MACH_CARDHU CARDHU 3436 | |
| 737 | −aruba MACH_ARUBA ARUBA 3437 | |
| 738 | −bonaire MACH_BONAIRE BONAIRE 3438 | |
| 739 | −nuc700evb MACH_NUC700EVB NUC700EVB 3439 | |
| 740 | −nuc710evb MACH_NUC710EVB NUC710EVB 3440 | |
| 741 | −nuc740evb MACH_NUC740EVB NUC740EVB 3441 | |
| 742 | −nuc745evb MACH_NUC745EVB NUC745EVB 3442 | |
| 743 | −transcede MACH_TRANSCEDE TRANSCEDE 3443 | |
| 744 | −mora MACH_MORA MORA 3444 | |
| 745 | −nda_evm MACH_NDA_EVM NDA_EVM 3445 | |
| 746 | −timu MACH_TIMU TIMU 3446 | |
| 747 | −expressh MACH_EXPRESSH EXPRESSH 3447 | |
| 748 | 544 | veridis_a300 MACH_VERIDIS_A300 VERIDIS_A300 3448 |
| 749 | −dm368_leopard MACH_DM368_LEOPARD DM368_LEOPARD 3449 | |
| 750 | −omap_mcop MACH_OMAP_MCOP OMAP_MCOP 3450 | |
| 751 | −tritip MACH_TRITIP TRITIP 3451 | |
| 752 | −sm1k MACH_SM1K SM1K 3452 | |
| 753 | −monch MACH_MONCH MONCH 3453 | |
| 754 | −curacao MACH_CURACAO CURACAO 3454 | |
| 755 | 545 | origen MACH_ORIGEN ORIGEN 3455 |
| 756 | −epc10 MACH_EPC10 EPC10 3456 | |
| 757 | −sgh_i740 MACH_SGH_I740 SGH_I740 3457 | |
| 758 | −tuna MACH_TUNA TUNA 3458 | |
| 759 | −mx51_tulip MACH_MX51_TULIP MX51_TULIP 3459 | |
| 760 | −mx51_aster7 MACH_MX51_ASTER7 MX51_ASTER7 3460 | |
| 761 | −acro37xbrd MACH_ACRO37XBRD ACRO37XBRD 3461 | |
| 762 | −elke MACH_ELKE ELKE 3462 | |
| 763 | −sbc6000x MACH_SBC6000X SBC6000X 3463 | |
| 764 | −r1801e MACH_R1801E R1801E 3464 | |
| 765 | −h1600 MACH_H1600 H1600 3465 | |
| 766 | −mini210 MACH_MINI210 MINI210 3466 | |
| 767 | −mini8168 MACH_MINI8168 MINI8168 3467 | |
| 768 | −pc7308 MACH_PC7308 PC7308 3468 | |
| 769 | −kmm2m01 MACH_KMM2M01 KMM2M01 3470 | |
| 770 | −mx51erebus MACH_MX51EREBUS MX51EREBUS 3471 | |
| 771 | 546 | wm8650refboard MACH_WM8650REFBOARD WM8650REFBOARD 3472 |
| 772 | −tuxrail MACH_TUXRAIL TUXRAIL 3473 | |
| 773 | −arthur MACH_ARTHUR ARTHUR 3474 | |
| 774 | −doorboy MACH_DOORBOY DOORBOY 3475 | |
| 775 | 547 | xarina MACH_XARINA XARINA 3476 |
| 776 | −roverx7 MACH_ROVERX7 ROVERX7 3477 | |
| 777 | 548 | sdvr MACH_SDVR SDVR 3478 |
| 778 | 549 | acer_maya MACH_ACER_MAYA ACER_MAYA 3479 |
| 779 | 550 | pico MACH_PICO PICO 3480 |
| @@ -999,6 +770,7 @@ promwad_jade MACH_PROMWAD_JADE PROMWAD_JADE 3708 · 219 unmodified lines | ||
| 999 | 770 | amp MACH_AMP AMP 3709 |
| 1000 | 771 | gnet_amp MACH_GNET_AMP GNET_AMP 3710 |
| 1001 | 772 | toques MACH_TOQUES TOQUES 3711 |
| 773 | +apx4devkit MACH_APX4DEVKIT APX4DEVKIT 3712 | |
| 1002 | 774 | dct_storm MACH_DCT_STORM DCT_STORM 3713 |
| 1003 | 775 | owl MACH_OWL OWL 3715 |
| 1004 | 776 | cogent_csb1741 MACH_COGENT_CSB1741 COGENT_CSB1741 3716 |
| @@ -1063,7 +835,6 @@ shelter MACH_SHELTER SHELTER 3778 · 58 unmodified lines | ||
| 1063 | 835 | omap3_devkit8500 MACH_OMAP3_DEVKIT8500 OMAP3_DEVKIT8500 3779 |
| 1064 | 836 | edgetd MACH_EDGETD EDGETD 3780 |
| 1065 | 837 | copperyard MACH_COPPERYARD COPPERYARD 3781 |
| 1066 | −edge MACH_EDGE EDGE 3782 | |
| 1067 | 838 | edge_u MACH_EDGE_U EDGE_U 3783 |
| 1068 | 839 | edge_td MACH_EDGE_TD EDGE_TD 3784 |
| 1069 | 840 | wdss MACH_WDSS WDSS 3785 |
| @@ -1169,3 +940,269 @@ elite_ulk MACH_ELITE_ULK ELITE_ULK 3888 · 99 unmodified lines | ||
| 1169 | 940 | pov2 MACH_POV2 POV2 3889 |
| 1170 | 941 | ipod_touch_2g MACH_IPOD_TOUCH_2G IPOD_TOUCH_2G 3890 |
| 1171 | 942 | da850_pqab MACH_DA850_PQAB DA850_PQAB 3891 |
| 943 | +fermi MACH_FERMI FERMI 3892 | |
| 944 | +ccardwmx28 MACH_CCARDWMX28 CCARDWMX28 3893 | |
| 945 | +ccardmx28 MACH_CCARDMX28 CCARDMX28 3894 | |
| 946 | +fs20_fcm2050 MACH_FS20_FCM2050 FS20_FCM2050 3895 | |
| 947 | +kinetis MACH_KINETIS KINETIS 3896 | |
| 948 | +kai MACH_KAI KAI 3897 | |
| 949 | +bcthb2 MACH_BCTHB2 BCTHB2 3898 | |
| 950 | +inels3_cu MACH_INELS3_CU INELS3_CU 3899 | |
| 951 | +da850_apollo MACH_DA850_APOLLO DA850_APOLLO 3901 | |
| 952 | +tracnas MACH_TRACNAS TRACNAS 3902 | |
| 953 | +mityarm335x MACH_MITYARM335X MITYARM335X 3903 | |
| 954 | +xcgz7x MACH_XCGZ7X XCGZ7X 3904 | |
| 955 | +cubox MACH_CUBOX CUBOX 3905 | |
| 956 | +terminator MACH_TERMINATOR TERMINATOR 3906 | |
| 957 | +eye03 MACH_EYE03 EYE03 3907 | |
| 958 | +kota3 MACH_KOTA3 KOTA3 3908 | |
| 959 | +pscpe MACH_PSCPE PSCPE 3910 | |
| 960 | +akt1100 MACH_AKT1100 AKT1100 3911 | |
| 961 | +pcaaxl2 MACH_PCAAXL2 PCAAXL2 3912 | |
| 962 | +primodd_ct MACH_PRIMODD_CT PRIMODD_CT 3913 | |
| 963 | +nsbc MACH_NSBC NSBC 3914 | |
| 964 | +meson2_skt MACH_MESON2_SKT MESON2_SKT 3915 | |
| 965 | +meson2_ref MACH_MESON2_REF MESON2_REF 3916 | |
| 966 | +ccardwmx28js MACH_CCARDWMX28JS CCARDWMX28JS 3917 | |
| 967 | +ccardmx28js MACH_CCARDMX28JS CCARDMX28JS 3918 | |
| 968 | +indico MACH_INDICO INDICO 3919 | |
| 969 | +msm8960dt MACH_MSM8960DT MSM8960DT 3920 | |
| 970 | +primods MACH_PRIMODS PRIMODS 3921 | |
| 971 | +beluga_m1388 MACH_BELUGA_M1388 BELUGA_M1388 3922 | |
| 972 | +primotd MACH_PRIMOTD PRIMOTD 3923 | |
| 973 | +varan_master MACH_VARAN_MASTER VARAN_MASTER 3924 | |
| 974 | +primodd MACH_PRIMODD PRIMODD 3925 | |
| 975 | +jetduo MACH_JETDUO JETDUO 3926 | |
| 976 | +mx53_umobo MACH_MX53_UMOBO MX53_UMOBO 3927 | |
| 977 | +trats MACH_TRATS TRATS 3928 | |
| 978 | +starcraft MACH_STARCRAFT STARCRAFT 3929 | |
| 979 | +qseven_tegra2 MACH_QSEVEN_TEGRA2 QSEVEN_TEGRA2 3930 | |
| 980 | +lichee_sun4i_devbd MACH_LICHEE_SUN4I_DEVBD LICHEE_SUN4I_DEVBD 3931 | |
| 981 | +movenow MACH_MOVENOW MOVENOW 3932 | |
| 982 | +golf_u MACH_GOLF_U GOLF_U 3933 | |
| 983 | +msm7627a_evb MACH_MSM7627A_EVB MSM7627A_EVB 3934 | |
| 984 | +rambo MACH_RAMBO RAMBO 3935 | |
| 985 | +golfu MACH_GOLFU GOLFU 3936 | |
| 986 | +mango310 MACH_MANGO310 MANGO310 3937 | |
| 987 | +dns343 MACH_DNS343 DNS343 3938 | |
| 988 | +var_som_om44 MACH_VAR_SOM_OM44 VAR_SOM_OM44 3939 | |
| 989 | +naon MACH_NAON NAON 3940 | |
| 990 | +vp4000 MACH_VP4000 VP4000 3941 | |
| 991 | +impcard MACH_IMPCARD IMPCARD 3942 | |
| 992 | +smoovcam MACH_SMOOVCAM SMOOVCAM 3943 | |
| 993 | +cobham3725 MACH_COBHAM3725 COBHAM3725 3944 | |
| 994 | +cobham3730 MACH_COBHAM3730 COBHAM3730 3945 | |
| 995 | +cobham3703 MACH_COBHAM3703 COBHAM3703 3946 | |
| 996 | +quetzal MACH_QUETZAL QUETZAL 3947 | |
| 997 | +apq8064_cdp MACH_APQ8064_CDP APQ8064_CDP 3948 | |
| 998 | +apq8064_mtp MACH_APQ8064_MTP APQ8064_MTP 3949 | |
| 999 | +apq8064_fluid MACH_APQ8064_FLUID APQ8064_FLUID 3950 | |
| 1000 | +apq8064_liquid MACH_APQ8064_LIQUID APQ8064_LIQUID 3951 | |
| 1001 | +mango210 MACH_MANGO210 MANGO210 3952 | |
| 1002 | +mango100 MACH_MANGO100 MANGO100 3953 | |
| 1003 | +mango24 MACH_MANGO24 MANGO24 3954 | |
| 1004 | +mango64 MACH_MANGO64 MANGO64 3955 | |
| 1005 | +nsa320 MACH_NSA320 NSA320 3956 | |
| 1006 | +elv_ccu2 MACH_ELV_CCU2 ELV_CCU2 3957 | |
| 1007 | +triton_x00 MACH_TRITON_X00 TRITON_X00 3958 | |
| 1008 | +triton_1500_2000 MACH_TRITON_1500_2000 TRITON_1500_2000 3959 | |
| 1009 | +pogoplugv4 MACH_POGOPLUGV4 POGOPLUGV4 3960 | |
| 1010 | +venus_cl MACH_VENUS_CL VENUS_CL 3961 | |
| 1011 | +vulcano_g20 MACH_VULCANO_G20 VULCANO_G20 3962 | |
| 1012 | +sgs_i9100 MACH_SGS_I9100 SGS_I9100 3963 | |
| 1013 | +stsv2 MACH_STSV2 STSV2 3964 | |
| 1014 | +csb1724 MACH_CSB1724 CSB1724 3965 | |
| 1015 | +omapl138_lcdk MACH_OMAPL138_LCDK OMAPL138_LCDK 3966 | |
| 1016 | +pvd_mx25 MACH_PVD_MX25 PVD_MX25 3968 | |
| 1017 | +meson6_skt MACH_MESON6_SKT MESON6_SKT 3969 | |
| 1018 | +meson6_ref MACH_MESON6_REF MESON6_REF 3970 | |
| 1019 | +pxm MACH_PXM PXM 3971 | |
| 1020 | +pogoplugv3 MACH_POGOPLUGV3 POGOPLUGV3 3973 | |
| 1021 | +mlp89626 MACH_MLP89626 MLP89626 3974 | |
| 1022 | +iomegahmndce MACH_IOMEGAHMNDCE IOMEGAHMNDCE 3975 | |
| 1023 | +pogoplugv3pci MACH_POGOPLUGV3PCI POGOPLUGV3PCI 3976 | |
| 1024 | +bntv250 MACH_BNTV250 BNTV250 3977 | |
| 1025 | +mx53_qseven MACH_MX53_QSEVEN MX53_QSEVEN 3978 | |
| 1026 | +gtl_it1100 MACH_GTL_IT1100 GTL_IT1100 3979 | |
| 1027 | +mx6q_sabresd MACH_MX6Q_SABRESD MX6Q_SABRESD 3980 | |
| 1028 | +mt4 MACH_MT4 MT4 3981 | |
| 1029 | +jumbo_d MACH_JUMBO_D JUMBO_D 3982 | |
| 1030 | +jumbo_i MACH_JUMBO_I JUMBO_I 3983 | |
| 1031 | +fs20_dmp MACH_FS20_DMP FS20_DMP 3984 | |
| 1032 | +dns320 MACH_DNS320 DNS320 3985 | |
| 1033 | +mx28bacos MACH_MX28BACOS MX28BACOS 3986 | |
| 1034 | +tl80 MACH_TL80 TL80 3987 | |
| 1035 | +polatis_nic_1001 MACH_POLATIS_NIC_1001 POLATIS_NIC_1001 3988 | |
| 1036 | +tely MACH_TELY TELY 3989 | |
| 1037 | +u8520 MACH_U8520 U8520 3990 | |
| 1038 | +manta MACH_MANTA MANTA 3991 | |
| 1039 | +mpq8064_cdp MACH_MPQ8064_CDP MPQ8064_CDP 3993 | |
| 1040 | +mpq8064_dtv MACH_MPQ8064_DTV MPQ8064_DTV 3995 | |
| 1041 | +dm368som MACH_DM368SOM DM368SOM 3996 | |
| 1042 | +gprisb2 MACH_GPRISB2 GPRISB2 3997 | |
| 1043 | +chammid MACH_CHAMMID CHAMMID 3998 | |
| 1044 | +seoul2 MACH_SEOUL2 SEOUL2 3999 | |
| 1045 | +omap4_nooktablet MACH_OMAP4_NOOKTABLET OMAP4_NOOKTABLET 4000 | |
| 1046 | +aalto MACH_AALTO AALTO 4001 | |
| 1047 | +metro MACH_METRO METRO 4002 | |
| 1048 | +cydm3730 MACH_CYDM3730 CYDM3730 4003 | |
| 1049 | +tqma53 MACH_TQMA53 TQMA53 4004 | |
| 1050 | +msm7627a_qrd3 MACH_MSM7627A_QRD3 MSM7627A_QRD3 4005 | |
| 1051 | +mx28_canby MACH_MX28_CANBY MX28_CANBY 4006 | |
| 1052 | +tiger MACH_TIGER TIGER 4007 | |
| 1053 | +pcats_9307_type_a MACH_PCATS_9307_TYPE_A PCATS_9307_TYPE_A 4008 | |
| 1054 | +pcats_9307_type_o MACH_PCATS_9307_TYPE_O PCATS_9307_TYPE_O 4009 | |
| 1055 | +pcats_9307_type_r MACH_PCATS_9307_TYPE_R PCATS_9307_TYPE_R 4010 | |
| 1056 | +streamplug MACH_STREAMPLUG STREAMPLUG 4011 | |
| 1057 | +icechicken_dev MACH_ICECHICKEN_DEV ICECHICKEN_DEV 4012 | |
| 1058 | +hedgehog MACH_HEDGEHOG HEDGEHOG 4013 | |
| 1059 | +yusend_obc MACH_YUSEND_OBC YUSEND_OBC 4014 | |
| 1060 | +imxninja MACH_IMXNINJA IMXNINJA 4015 | |
| 1061 | +omap4_jarod MACH_OMAP4_JAROD OMAP4_JAROD 4016 | |
| 1062 | +eco5_pk MACH_ECO5_PK ECO5_PK 4017 | |
| 1063 | +qj2440 MACH_QJ2440 QJ2440 4018 | |
| 1064 | +mx6q_mercury MACH_MX6Q_MERCURY MX6Q_MERCURY 4019 | |
| 1065 | +cm6810 MACH_CM6810 CM6810 4020 | |
| 1066 | +omap4_torpedo MACH_OMAP4_TORPEDO OMAP4_TORPEDO 4021 | |
| 1067 | +nsa310 MACH_NSA310 NSA310 4022 | |
| 1068 | +tmx536 MACH_TMX536 TMX536 4023 | |
| 1069 | +ktt20 MACH_KTT20 KTT20 4024 | |
| 1070 | +dragonix MACH_DRAGONIX DRAGONIX 4025 | |
| 1071 | +lungching MACH_LUNGCHING LUNGCHING 4026 | |
| 1072 | +bulogics MACH_BULOGICS BULOGICS 4027 | |
| 1073 | +mx535_sx MACH_MX535_SX MX535_SX 4028 | |
| 1074 | +ngui3250 MACH_NGUI3250 NGUI3250 4029 | |
| 1075 | +salutec_dac MACH_SALUTEC_DAC SALUTEC_DAC 4030 | |
| 1076 | +loco MACH_LOCO LOCO 4031 | |
| 1077 | +ctera_plug_usi MACH_CTERA_PLUG_USI CTERA_PLUG_USI 4032 | |
| 1078 | +scepter MACH_SCEPTER SCEPTER 4033 | |
| 1079 | +sga MACH_SGA SGA 4034 | |
| 1080 | +p_81_j5 MACH_P_81_J5 P_81_J5 4035 | |
| 1081 | +p_81_o4 MACH_P_81_O4 P_81_O4 4036 | |
| 1082 | +msm8625_surf MACH_MSM8625_SURF MSM8625_SURF 4037 | |
| 1083 | +carallon_shark MACH_CARALLON_SHARK CARALLON_SHARK 4038 | |
| 1084 | +ordog MACH_ORDOG ORDOG 4040 | |
| 1085 | +puente_io MACH_PUENTE_IO PUENTE_IO 4041 | |
| 1086 | +msm8625_evb MACH_MSM8625_EVB MSM8625_EVB 4042 | |
| 1087 | +ev_am1707 MACH_EV_AM1707 EV_AM1707 4043 | |
| 1088 | +ev_am1707e2 MACH_EV_AM1707E2 EV_AM1707E2 4044 | |
| 1089 | +ev_am3517e2 MACH_EV_AM3517E2 EV_AM3517E2 4045 | |
| 1090 | +calabria MACH_CALABRIA CALABRIA 4046 | |
| 1091 | +ev_imx287 MACH_EV_IMX287 EV_IMX287 4047 | |
| 1092 | +erau MACH_ERAU ERAU 4048 | |
| 1093 | +sichuan MACH_SICHUAN SICHUAN 4049 | |
| 1094 | +davinci_da850 MACH_DAVINCI_DA850 DAVINCI_DA850 4051 | |
| 1095 | +omap138_trunarc MACH_OMAP138_TRUNARC OMAP138_TRUNARC 4052 | |
| 1096 | +bcm4761 MACH_BCM4761 BCM4761 4053 | |
| 1097 | +picasso_e2 MACH_PICASSO_E2 PICASSO_E2 4054 | |
| 1098 | +picasso_mf MACH_PICASSO_MF PICASSO_MF 4055 | |
| 1099 | +miro MACH_MIRO MIRO 4056 | |
| 1100 | +at91sam9g20ewon3 MACH_AT91SAM9G20EWON3 AT91SAM9G20EWON3 4057 | |
| 1101 | +yoyo MACH_YOYO YOYO 4058 | |
| 1102 | +windjkl MACH_WINDJKL WINDJKL 4059 | |
| 1103 | +monarudo MACH_MONARUDO MONARUDO 4060 | |
| 1104 | +batan MACH_BATAN BATAN 4061 | |
| 1105 | +tadao MACH_TADAO TADAO 4062 | |
| 1106 | +baso MACH_BASO BASO 4063 | |
| 1107 | +mahon MACH_MAHON MAHON 4064 | |
| 1108 | +villec2 MACH_VILLEC2 VILLEC2 4065 | |
| 1109 | +asi1230 MACH_ASI1230 ASI1230 4066 | |
| 1110 | +alaska MACH_ALASKA ALASKA 4067 | |
| 1111 | +swarco_shdsl2 MACH_SWARCO_SHDSL2 SWARCO_SHDSL2 4068 | |
| 1112 | +oxrtu MACH_OXRTU OXRTU 4069 | |
| 1113 | +omap5_panda MACH_OMAP5_PANDA OMAP5_PANDA 4070 | |
| 1114 | +c8000 MACH_C8000 C8000 4072 | |
| 1115 | +bje_display3_5 MACH_BJE_DISPLAY3_5 BJE_DISPLAY3_5 4073 | |
| 1116 | +picomod7 MACH_PICOMOD7 PICOMOD7 4074 | |
| 1117 | +picocom5 MACH_PICOCOM5 PICOCOM5 4075 | |
| 1118 | +qblissa8 MACH_QBLISSA8 QBLISSA8 4076 | |
| 1119 | +armstonea8 MACH_ARMSTONEA8 ARMSTONEA8 4077 | |
| 1120 | +netdcu14 MACH_NETDCU14 NETDCU14 4078 | |
| 1121 | +at91sam9x5_epiphan MACH_AT91SAM9X5_EPIPHAN AT91SAM9X5_EPIPHAN 4079 | |
| 1122 | +p2u MACH_P2U P2U 4080 | |
| 1123 | +doris MACH_DORIS DORIS 4081 | |
| 1124 | +j49 MACH_J49 J49 4082 | |
| 1125 | +vdss2e MACH_VDSS2E VDSS2E 4083 | |
| 1126 | +vc300 MACH_VC300 VC300 4084 | |
| 1127 | +ns115_pad_test MACH_NS115_PAD_TEST NS115_PAD_TEST 4085 | |
| 1128 | +ns115_pad_ref MACH_NS115_PAD_REF NS115_PAD_REF 4086 | |
| 1129 | +ns115_phone_test MACH_NS115_PHONE_TEST NS115_PHONE_TEST 4087 | |
| 1130 | +ns115_phone_ref MACH_NS115_PHONE_REF NS115_PHONE_REF 4088 | |
| 1131 | +golfc MACH_GOLFC GOLFC 4089 | |
| 1132 | +xerox_olympus MACH_XEROX_OLYMPUS XEROX_OLYMPUS 4090 | |
| 1133 | +mx6sl_arm2 MACH_MX6SL_ARM2 MX6SL_ARM2 4091 | |
| 1134 | +csb1701_csb1726 MACH_CSB1701_CSB1726 CSB1701_CSB1726 4092 | |
| 1135 | +at91sam9xeek MACH_AT91SAM9XEEK AT91SAM9XEEK 4093 | |
| 1136 | +ebv210 MACH_EBV210 EBV210 4094 | |
| 1137 | +msm7627a_qrd7 MACH_MSM7627A_QRD7 MSM7627A_QRD7 4095 | |
| 1138 | +svthin MACH_SVTHIN SVTHIN 4096 | |
| 1139 | +duovero MACH_DUOVERO DUOVERO 4097 | |
| 1140 | +chupacabra MACH_CHUPACABRA CHUPACABRA 4098 | |
| 1141 | +scorpion MACH_SCORPION SCORPION 4099 | |
| 1142 | +davinci_he_hmi10 MACH_DAVINCI_HE_HMI10 DAVINCI_HE_HMI10 4100 | |
| 1143 | +topkick MACH_TOPKICK TOPKICK 4101 | |
| 1144 | +m3_auguestrush MACH_M3_AUGUESTRUSH M3_AUGUESTRUSH 4102 | |
| 1145 | +ipc335x MACH_IPC335X IPC335X 4103 | |
| 1146 | +sun4i MACH_SUN4I SUN4I 4104 | |
| 1147 | +imx233_olinuxino MACH_IMX233_OLINUXINO IMX233_OLINUXINO 4105 | |
| 1148 | +k2_wl MACH_K2_WL K2_WL 4106 | |
| 1149 | +k2_ul MACH_K2_UL K2_UL 4107 | |
| 1150 | +k2_cl MACH_K2_CL K2_CL 4108 | |
| 1151 | +minbari_w MACH_MINBARI_W MINBARI_W 4109 | |
| 1152 | +minbari_m MACH_MINBARI_M MINBARI_M 4110 | |
| 1153 | +k035 MACH_K035 K035 4111 | |
| 1154 | +ariel MACH_ARIEL ARIEL 4112 | |
| 1155 | +arielsaarc MACH_ARIELSAARC ARIELSAARC 4113 | |
| 1156 | +arieldkb MACH_ARIELDKB ARIELDKB 4114 | |
| 1157 | +armadillo810 MACH_ARMADILLO810 ARMADILLO810 4115 | |
| 1158 | +tam335x MACH_TAM335X TAM335X 4116 | |
| 1159 | +grouper MACH_GROUPER GROUPER 4117 | |
| 1160 | +mpcsa21_9g20 MACH_MPCSA21_9G20 MPCSA21_9G20 4118 | |
| 1161 | +m6u_cpu MACH_M6U_CPU M6U_CPU 4119 | |
| 1162 | +davinci_dp10 MACH_DAVINCI_DP10 DAVINCI_DP10 4120 | |
| 1163 | +ginkgo MACH_GINKGO GINKGO 4121 | |
| 1164 | +cgt_qmx6 MACH_CGT_QMX6 CGT_QMX6 4122 | |
| 1165 | +profpga MACH_PROFPGA PROFPGA 4123 | |
| 1166 | +acfx100oc MACH_ACFX100OC ACFX100OC 4124 | |
| 1167 | +acfx100nb MACH_ACFX100NB ACFX100NB 4125 | |
| 1168 | +capricorn MACH_CAPRICORN CAPRICORN 4126 | |
| 1169 | +pisces MACH_PISCES PISCES 4127 | |
| 1170 | +aries MACH_ARIES ARIES 4128 | |
| 1171 | +cancer MACH_CANCER CANCER 4129 | |
| 1172 | +leo MACH_LEO LEO 4130 | |
| 1173 | +virgo MACH_VIRGO VIRGO 4131 | |
| 1174 | +sagittarius MACH_SAGITTARIUS SAGITTARIUS 4132 | |
| 1175 | +devil MACH_DEVIL DEVIL 4133 | |
| 1176 | +ballantines MACH_BALLANTINES BALLANTINES 4134 | |
| 1177 | +omap3_procerusvpu MACH_OMAP3_PROCERUSVPU OMAP3_PROCERUSVPU 4135 | |
| 1178 | +my27 MACH_MY27 MY27 4136 | |
| 1179 | +sun6i MACH_SUN6I SUN6I 4137 | |
| 1180 | +sun5i MACH_SUN5I SUN5I 4138 | |
| 1181 | +mx512_mx MACH_MX512_MX MX512_MX 4139 | |
| 1182 | +kzm9g MACH_KZM9G KZM9G 4140 | |
| 1183 | +vdstbn MACH_VDSTBN VDSTBN 4141 | |
| 1184 | +cfa10036 MACH_CFA10036 CFA10036 4142 | |
| 1185 | +cfa10049 MACH_CFA10049 CFA10049 4143 | |
| 1186 | +pcm051 MACH_PCM051 PCM051 4144 | |
| 1187 | +vybrid_vf7xx MACH_VYBRID_VF7XX VYBRID_VF7XX 4145 | |
| 1188 | +vybrid_vf6xx MACH_VYBRID_VF6XX VYBRID_VF6XX 4146 | |
| 1189 | +vybrid_vf5xx MACH_VYBRID_VF5XX VYBRID_VF5XX 4147 | |
| 1190 | +vybrid_vf4xx MACH_VYBRID_VF4XX VYBRID_VF4XX 4148 | |
| 1191 | +aria_g25 MACH_ARIA_G25 ARIA_G25 4149 | |
| 1192 | +bcm21553 MACH_BCM21553 BCM21553 4150 | |
| 1193 | +smdk5410 MACH_SMDK5410 SMDK5410 4151 | |
| 1194 | +lpc18xx MACH_LPC18XX LPC18XX 4152 | |
| 1195 | +oratisparty MACH_ORATISPARTY ORATISPARTY 4153 | |
| 1196 | +qseven MACH_QSEVEN QSEVEN 4154 | |
| 1197 | +gmv_generic MACH_GMV_GENERIC GMV_GENERIC 4155 | |
| 1198 | +th_link_eth MACH_TH_LINK_ETH TH_LINK_ETH 4156 | |
| 1199 | +tn_muninn MACH_TN_MUNINN TN_MUNINN 4157 | |
| 1200 | +rampage MACH_RAMPAGE RAMPAGE 4158 | |
| 1201 | +visstrim_mv10 MACH_VISSTRIM_MV10 VISSTRIM_MV10 4159 | |
| 1202 | +mx28_wilma MACH_MX28_WILMA MX28_WILMA 4164 | |
| 1203 | +msm8625_ffa MACH_MSM8625_FFA MSM8625_FFA 4166 | |
| 1204 | +vpu101 MACH_VPU101 VPU101 4167 | |
| 1205 | +baileys MACH_BAILEYS BAILEYS 4169 | |
| 1206 | +familybox MACH_FAMILYBOX FAMILYBOX 4170 | |
| 1207 | +ensemble_mx35 MACH_ENSEMBLE_MX35 ENSEMBLE_MX35 4171 | |
| 1208 | +sc_sps_1 MACH_SC_SPS_1 SC_SPS_1 4172 | |
| @@ -11,12 +11,15 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <linux/types.h> |
| 12 | 12 | #include <linux/cpu.h> |
| 13 | 13 | #include <linux/cpu_pm.h> |
| 14 | +#include <linux/hardirq.h> | |
| 14 | 15 | #include <linux/kernel.h> |
| 15 | 16 | #include <linux/notifier.h> |
| 16 | 17 | #include <linux/signal.h> |
| 17 | 18 | #include <linux/sched.h> |
| 18 | 19 | #include <linux/smp.h> |
| 19 | 20 | #include <linux/init.h> |
| 21 | +#include <linux/uaccess.h> | |
| 22 | +#include <linux/user.h> | |
| 20 | 23 | |
| 21 | 24 | #include <asm/cp15.h> |
| 22 | 25 | #include <asm/cputype.h> |
| @@ -430,7 +433,10 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) · 407 unmodified lines | ||
| 430 | 433 | |
| 431 | 434 | static void vfp_enable(void *unused) |
| 432 | 435 | { |
| 433 | − u32 access = get_copro_access(); | |
| 436 | + u32 access; | |
| 437 | + | |
| 438 | + BUG_ON(preemptible()); | |
| 439 | + access = get_copro_access(); | |
| 434 | 440 | |
| 435 | 441 | /* |
| 436 | 442 | * Enable full access to VFP (cp10 and cp11) |
| @@ -528,6 +534,93 @@ void vfp_flush_hwstate(struct thread_info *thread) · 91 unmodified lines | ||
| 528 | 534 | put_cpu(); |
| 529 | 535 | } |
| 530 | 536 | |
| 537 | +/* | |
| 538 | + * Save the current VFP state into the provided structures and prepare | |
| 539 | + * for entry into a new function (signal handler). | |
| 540 | + */ | |
| 541 | +int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp, | |
| 542 | + struct user_vfp_exc __user *ufp_exc) | |
| 543 | +{ | |
| 544 | + struct thread_info *thread = current_thread_info(); | |
| 545 | + struct vfp_hard_struct *hwstate = &thread->vfpstate.hard; | |
| 546 | + int err = 0; | |
| 547 | + | |
| 548 | + /* Ensure that the saved hwstate is up-to-date. */ | |
| 549 | + vfp_sync_hwstate(thread); | |
| 550 | + | |
| 551 | + /* | |
| 552 | + * Copy the floating point registers. There can be unused | |
| 553 | + * registers see asm/hwcap.h for details. | |
| 554 | + */ | |
| 555 | + err |= __copy_to_user(&ufp->fpregs, &hwstate->fpregs, | |
| 556 | + sizeof(hwstate->fpregs)); | |
| 557 | + /* | |
| 558 | + * Copy the status and control register. | |
| 559 | + */ | |
| 560 | + __put_user_error(hwstate->fpscr, &ufp->fpscr, err); | |
| 561 | + | |
| 562 | + /* | |
| 563 | + * Copy the exception registers. | |
| 564 | + */ | |
| 565 | + __put_user_error(hwstate->fpexc, &ufp_exc->fpexc, err); | |
| 566 | + __put_user_error(hwstate->fpinst, &ufp_exc->fpinst, err); | |
| 567 | + __put_user_error(hwstate->fpinst2, &ufp_exc->fpinst2, err); | |
| 568 | + | |
| 569 | + if (err) | |
| 570 | + return -EFAULT; | |
| 571 | + | |
| 572 | + /* Ensure that VFP is disabled. */ | |
| 573 | + vfp_flush_hwstate(thread); | |
| 574 | + | |
| 575 | + /* | |
| 576 | + * As per the PCS, clear the length and stride bits for function | |
| 577 | + * entry. | |
| 578 | + */ | |
| 579 | + hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK); | |
| 580 | + return 0; | |
| 581 | +} | |
| 582 | + | |
| 583 | +/* Sanitise and restore the current VFP state from the provided structures. */ | |
| 584 | +int vfp_restore_user_hwstate(struct user_vfp __user *ufp, | |
| 585 | + struct user_vfp_exc __user *ufp_exc) | |
| 586 | +{ | |
| 587 | + struct thread_info *thread = current_thread_info(); | |
| 588 | + struct vfp_hard_struct *hwstate = &thread->vfpstate.hard; | |
| 589 | + unsigned long fpexc; | |
| 590 | + int err = 0; | |
| 591 | + | |
| 592 | + /* Disable VFP to avoid corrupting the new thread state. */ | |
| 593 | + vfp_flush_hwstate(thread); | |
| 594 | + | |
| 595 | + /* | |
| 596 | + * Copy the floating point registers. There can be unused | |
| 597 | + * registers see asm/hwcap.h for details. | |
| 598 | + */ | |
| 599 | + err |= __copy_from_user(&hwstate->fpregs, &ufp->fpregs, | |
| 600 | + sizeof(hwstate->fpregs)); | |
| 601 | + /* | |
| 602 | + * Copy the status and control register. | |
| 603 | + */ | |
| 604 | + __get_user_error(hwstate->fpscr, &ufp->fpscr, err); | |
| 605 | + | |
| 606 | + /* | |
| 607 | + * Sanitise and restore the exception registers. | |
| 608 | + */ | |
| 609 | + __get_user_error(fpexc, &ufp_exc->fpexc, err); | |
| 610 | + | |
| 611 | + /* Ensure the VFP is enabled. */ | |
| 612 | + fpexc |= FPEXC_EN; | |
| 613 | + | |
| 614 | + /* Ensure FPINST2 is invalid and the exception flag is cleared. */ | |
| 615 | + fpexc &= ~(FPEXC_EX | FPEXC_FP2V); | |
| 616 | + hwstate->fpexc = fpexc; | |
| 617 | + | |
| 618 | + __get_user_error(hwstate->fpinst, &ufp_exc->fpinst, err); | |
| 619 | + __get_user_error(hwstate->fpinst2, &ufp_exc->fpinst2, err); | |
| 620 | + | |
| 621 | + return err ? -EFAULT : 0; | |
| 622 | +} | |
| 623 | + | |
| 531 | 624 | /* |
| 532 | 625 | * VFP hardware can lose all context when a CPU goes offline. |
| 533 | 626 | * As we will be running in SMP mode with CPU hotplug, we will save the |
| @@ -558,7 +651,7 @@ static int __init vfp_init(void) · 24 unmodified lines | ||
| 558 | 651 | unsigned int cpu_arch = cpu_architecture(); |
| 559 | 652 | |
| 560 | 653 | if (cpu_arch >= CPU_ARCH_ARMv6) |
| 561 | − vfp_enable(NULL); | |
| 654 | + on_each_cpu(vfp_enable, NULL, 1); | |
| 562 | 655 | |
| 563 | 656 | /* |
| 564 | 657 | * First check that there is a VFP that we can use. |
| @@ -579,8 +672,6 @@ static int __init vfp_init(void) · 14 unmodified lines | ||
| 579 | 672 | } else { |
| 580 | 673 | hotcpu_notifier(vfp_hotplug, 0); |
| 581 | 674 | |
| 582 | − smp_call_function(vfp_enable, NULL, 1); | |
| 583 | − | |
| 584 | 675 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ |
| 585 | 676 | printk("implementor %02x architecture %d part %02x variant %x rev %x\n", |
| 586 | 677 | (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, |
| @@ -38,7 +38,7 @@ static struct platform_device rtc_device = { · 37 unmodified lines | ||
| 38 | 38 | .name = "rtc-bfin", |
| 39 | 39 | .id = -1, |
| 40 | 40 | }; |
| 41 | −#endif | |
| 41 | +#endif /* CONFIG_RTC_DRV_BFIN */ | |
| 42 | 42 | |
| 43 | 43 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
| 44 | 44 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
| @@ -100,7 +100,7 @@ static struct platform_device bfin_uart0_device = { · 55 unmodified lines | ||
| 100 | 100 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ |
| 101 | 101 | }, |
| 102 | 102 | }; |
| 103 | −#endif | |
| 103 | +#endif /* CONFIG_SERIAL_BFIN_UART0 */ | |
| 104 | 104 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
| 105 | 105 | static struct resource bfin_uart1_resources[] = { |
| 106 | 106 | { |
| @@ -148,7 +148,7 @@ static struct platform_device bfin_uart1_device = { · 41 unmodified lines | ||
| 148 | 148 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ |
| 149 | 149 | }, |
| 150 | 150 | }; |
| 151 | −#endif | |
| 151 | +#endif /* CONFIG_SERIAL_BFIN_UART1 */ | |
| 152 | 152 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
| 153 | 153 | static struct resource bfin_uart2_resources[] = { |
| 154 | 154 | { |
| @@ -196,8 +196,8 @@ static struct platform_device bfin_uart2_device = { · 41 unmodified lines | ||
| 196 | 196 | .platform_data = &bfin_uart2_peripherals, /* Passed to driver */ |
| 197 | 197 | }, |
| 198 | 198 | }; |
| 199 | −#endif | |
| 200 | −#endif | |
| 199 | +#endif /* CONFIG_SERIAL_BFIN_UART2 */ | |
| 200 | +#endif /* CONFIG_SERIAL_BFIN */ | |
| 201 | 201 | |
| 202 | 202 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
| 203 | 203 | #ifdef CONFIG_BFIN_SIR0 |
| @@ -224,7 +224,7 @@ static struct platform_device bfin_sir0_device = { · 20 unmodified lines | ||
| 224 | 224 | .num_resources = ARRAY_SIZE(bfin_sir0_resources), |
| 225 | 225 | .resource = bfin_sir0_resources, |
| 226 | 226 | }; |
| 227 | −#endif | |
| 227 | +#endif /* CONFIG_BFIN_SIR0 */ | |
| 228 | 228 | #ifdef CONFIG_BFIN_SIR1 |
| 229 | 229 | static struct resource bfin_sir1_resources[] = { |
| 230 | 230 | { |
| @@ -249,7 +249,7 @@ static struct platform_device bfin_sir1_device = { · 18 unmodified lines | ||
| 249 | 249 | .num_resources = ARRAY_SIZE(bfin_sir1_resources), |
| 250 | 250 | .resource = bfin_sir1_resources, |
| 251 | 251 | }; |
| 252 | −#endif | |
| 252 | +#endif /* CONFIG_BFIN_SIR1 */ | |
| 253 | 253 | #ifdef CONFIG_BFIN_SIR2 |
| 254 | 254 | static struct resource bfin_sir2_resources[] = { |
| 255 | 255 | { |
| @@ -274,8 +274,8 @@ static struct platform_device bfin_sir2_device = { · 18 unmodified lines | ||
| 274 | 274 | .num_resources = ARRAY_SIZE(bfin_sir2_resources), |
| 275 | 275 | .resource = bfin_sir2_resources, |
| 276 | 276 | }; |
| 277 | −#endif | |
| 278 | −#endif | |
| 277 | +#endif /* CONFIG_BFIN_SIR2 */ | |
| 278 | +#endif /* CONFIG_BFIN_SIR */ | |
| 279 | 279 | |
| 280 | 280 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
| 281 | 281 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART |
| @@ -311,7 +311,7 @@ static struct platform_device bfin_sport0_uart_device = { · 29 unmodified lines | ||
| 311 | 311 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ |
| 312 | 312 | }, |
| 313 | 313 | }; |
| 314 | −#endif | |
| 314 | +#endif /* CONFIG_SERIAL_BFIN_SPORT0_UART */ | |
| 315 | 315 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART |
| 316 | 316 | static struct resource bfin_sport1_uart_resources[] = { |
| 317 | 317 | { |
| @@ -345,7 +345,7 @@ static struct platform_device bfin_sport1_uart_device = { · 27 unmodified lines | ||
| 345 | 345 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ |
| 346 | 346 | }, |
| 347 | 347 | }; |
| 348 | −#endif | |
| 348 | +#endif /* CONFIG_SERIAL_BFIN_SPORT1_UART */ | |
| 349 | 349 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART |
| 350 | 350 | static struct resource bfin_sport2_uart_resources[] = { |
| 351 | 351 | { |
| @@ -379,7 +379,7 @@ static struct platform_device bfin_sport2_uart_device = { · 27 unmodified lines | ||
| 379 | 379 | .platform_data = &bfin_sport2_peripherals, /* Passed to driver */ |
| 380 | 380 | }, |
| 381 | 381 | }; |
| 382 | −#endif | |
| 382 | +#endif /* CONFIG_SERIAL_BFIN_SPORT2_UART */ | |
| 383 | 383 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART |
| 384 | 384 | static struct resource bfin_sport3_uart_resources[] = { |
| 385 | 385 | { |
| @@ -413,8 +413,8 @@ static struct platform_device bfin_sport3_uart_device = { · 27 unmodified lines | ||
| 413 | 413 | .platform_data = &bfin_sport3_peripherals, /* Passed to driver */ |
| 414 | 414 | }, |
| 415 | 415 | }; |
| 416 | −#endif | |
| 417 | −#endif | |
| 416 | +#endif /* CONFIG_SERIAL_BFIN_SPORT3_UART */ | |
| 417 | +#endif /* CONFIG_SERIAL_BFIN_SPORT */ | |
| 418 | 418 | |
| 419 | 419 | #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) |
| 420 | 420 | static unsigned short bfin_can_peripherals[] = { |
| @@ -452,7 +452,7 @@ static struct platform_device bfin_can_device = { · 31 unmodified lines | ||
| 452 | 452 | .platform_data = &bfin_can_peripherals, /* Passed to driver */ |
| 453 | 453 | }, |
| 454 | 454 | }; |
| 455 | −#endif | |
| 455 | +#endif /* CONFIG_CAN_BFIN */ | |
| 456 | 456 | |
| 457 | 457 | /* |
| 458 | 458 | * USB-LAN EzExtender board |
| @@ -488,7 +488,7 @@ static struct platform_device smc91x_device = { · 29 unmodified lines | ||
| 488 | 488 | .platform_data = &smc91x_info, |
| 489 | 489 | }, |
| 490 | 490 | }; |
| 491 | −#endif | |
| 491 | +#endif /* CONFIG_SMC91X */ | |
| 492 | 492 | |
| 493 | 493 | #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) |
| 494 | 494 | /* all SPI peripherals info goes here */ |
| @@ -518,7 +518,8 @@ static struct flash_platform_data bfin_spi_flash_data = { · 23 unmodified lines | ||
| 518 | 518 | static struct bfin5xx_spi_chip spi_flash_chip_info = { |
| 519 | 519 | .enable_dma = 0, /* use dma transfer with this chip*/ |
| 520 | 520 | }; |
| 521 | −#endif | |
| 521 | +#endif /* CONFIG_MTD_M25P80 */ | |
| 522 | +#endif /* CONFIG_SPI_BFIN5XX */ | |
| 522 | 523 | |
| 523 | 524 | #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) |
| 524 | 525 | #include <linux/spi/ad7879.h> |
| @@ -535,7 +536,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = { · 10 unmodified lines | ||
| 535 | 536 | .gpio_export = 1, /* Export GPIO to gpiolib */ |
| 536 | 537 | .gpio_base = -1, /* Dynamic allocation */ |
| 537 | 538 | }; |
| 538 | −#endif | |
| 539 | +#endif /* CONFIG_TOUCHSCREEN_AD7879 */ | |
| 539 | 540 | |
| 540 | 541 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 541 | 542 | #include <asm/bfin-lq035q1.h> |
| @@ -564,7 +565,7 @@ static struct platform_device bfin_lq035q1_device = { · 22 unmodified lines | ||
| 564 | 565 | .platform_data = &bfin_lq035q1_data, |
| 565 | 566 | }, |
| 566 | 567 | }; |
| 567 | −#endif | |
| 568 | +#endif /* CONFIG_FB_BFIN_LQ035Q1 */ | |
| 568 | 569 | |
| 569 | 570 | static struct spi_board_info bf538_spi_board_info[] __initdata = { |
| 570 | 571 | #if defined(CONFIG_MTD_M25P80) \ |
| @@ -579,7 +580,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 8 unmodified lines | ||
| 579 | 580 | .controller_data = &spi_flash_chip_info, |
| 580 | 581 | .mode = SPI_MODE_3, |
| 581 | 582 | }, |
| 582 | −#endif | |
| 583 | +#endif /* CONFIG_MTD_M25P80 */ | |
| 583 | 584 | #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) |
| 584 | 585 | { |
| 585 | 586 | .modalias = "ad7879", |
| @@ -590,7 +591,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 4 unmodified lines | ||
| 590 | 591 | .chip_select = 1, |
| 591 | 592 | .mode = SPI_CPHA | SPI_CPOL, |
| 592 | 593 | }, |
| 593 | −#endif | |
| 594 | +#endif /* CONFIG_TOUCHSCREEN_AD7879_SPI */ | |
| 594 | 595 | #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) |
| 595 | 596 | { |
| 596 | 597 | .modalias = "bfin-lq035q1-spi", |
| @@ -599,7 +600,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 2 unmodified lines | ||
| 599 | 600 | .chip_select = 2, |
| 600 | 601 | .mode = SPI_CPHA | SPI_CPOL, |
| 601 | 602 | }, |
| 602 | −#endif | |
| 603 | +#endif /* CONFIG_FB_BFIN_LQ035Q1 */ | |
| 603 | 604 | #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) |
| 604 | 605 | { |
| 605 | 606 | .modalias = "spidev", |
| @@ -607,7 +608,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = { · 1 unmodified line | ||
| 607 | 608 | .bus_num = 0, |
| 608 | 609 | .chip_select = 1, |
| 609 | 610 | }, |
| 610 | −#endif | |
| 611 | +#endif /* CONFIG_SPI_SPIDEV */ | |
| 611 | 612 | }; |
| 612 | 613 | |
| 613 | 614 | /* SPI (0) */ |
| @@ -716,8 +717,6 @@ static struct platform_device bf538_spi_master2 = { · 102 unmodified lines | ||
| 716 | 717 | }, |
| 717 | 718 | }; |
| 718 | 719 | |
| 719 | −#endif /* spi master and devices */ | |
| 720 | − | |
| 721 | 720 | #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) |
| 722 | 721 | static struct resource bfin_twi0_resource[] = { |
| 723 | 722 | [0] = { |
| @@ -759,8 +758,8 @@ static struct platform_device i2c_bfin_twi1_device = { · 35 unmodified lines | ||
| 759 | 758 | .num_resources = ARRAY_SIZE(bfin_twi1_resource), |
| 760 | 759 | .resource = bfin_twi1_resource, |
| 761 | 760 | }; |
| 762 | −#endif | |
| 763 | −#endif | |
| 761 | +#endif /* CONFIG_BF542 */ | |
| 762 | +#endif /* CONFIG_I2C_BLACKFIN_TWI */ | |
| 764 | 763 | |
| 765 | 764 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 766 | 765 | #include <linux/gpio_keys.h> |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <linux/bootmem.h> |
| 23 | 23 | #include <linux/genalloc.h> |
| 24 | 24 | #include <asm/dma-mapping.h> |
| 25 | +#include <linux/module.h> | |
| 25 | 26 | |
| 26 | 27 | struct dma_map_ops *dma_ops; |
| 27 | 28 | EXPORT_SYMBOL(dma_ops); |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * Process creation support for Hexagon |
| 3 | 3 | * |
| 4 | − * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. | |
| 4 | + * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved. | |
| 5 | 5 | * |
| 6 | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | 7 | * it under the terms of the GNU General Public License version 2 and |
| @@ -88,7 +88,7 @@ void (*idle_sleep)(void) = default_idle; · 80 unmodified lines | ||
| 88 | 88 | void cpu_idle(void) |
| 89 | 89 | { |
| 90 | 90 | while (1) { |
| 91 | − tick_nohz_stop_sched_tick(1); | |
| 91 | + tick_nohz_idle_enter(); | |
| 92 | 92 | local_irq_disable(); |
| 93 | 93 | while (!need_resched()) { |
| 94 | 94 | idle_sleep(); |
| @@ -97,7 +97,7 @@ void cpu_idle(void) · 2 unmodified lines | ||
| 97 | 97 | local_irq_disable(); |
| 98 | 98 | } |
| 99 | 99 | local_irq_enable(); |
| 100 | − tick_nohz_restart_sched_tick(); | |
| 100 | + tick_nohz_idle_exit(); | |
| 101 | 101 | schedule(); |
| 102 | 102 | } |
| 103 | 103 | } |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/ptrace.h> |
| 29 | 29 | #include <linux/regset.h> |
| 30 | 30 | #include <linux/user.h> |
| 31 | +#include <linux/elf.h> | |
| 31 | 32 | |
| 32 | 33 | #include <asm/user.h> |
| 33 | 34 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * SMP support for Hexagon |
| 3 | 3 | * |
| 4 | − * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. | |
| 4 | + * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved. | |
| 5 | 5 | * |
| 6 | 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | 7 | * it under the terms of the GNU General Public License version 2 and |
| @@ -28,6 +28,7 @@ · 20 unmodified lines | ||
| 28 | 28 | #include <linux/sched.h> |
| 29 | 29 | #include <linux/smp.h> |
| 30 | 30 | #include <linux/spinlock.h> |
| 31 | +#include <linux/cpu.h> | |
| 31 | 32 | |
| 32 | 33 | #include <asm/time.h> /* timer_interrupt */ |
| 33 | 34 | #include <asm/hexagon_vm.h> |
| @@ -177,7 +178,12 @@ void __cpuinit start_secondary(void) · 143 unmodified lines | ||
| 177 | 178 | |
| 178 | 179 | printk(KERN_INFO "%s cpu %d\n", __func__, current_thread_info()->cpu); |
| 179 | 180 | |
| 181 | + notify_cpu_starting(cpu); | |
| 182 | + | |
| 183 | + ipi_call_lock(); | |
| 180 | 184 | set_cpu_online(cpu, true); |
| 185 | + ipi_call_unlock(); | |
| 186 | + | |
| 181 | 187 | local_irq_enable(); |
| 182 | 188 | |
| 183 | 189 | cpu_idle(); |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/of.h> |
| 29 | 29 | #include <linux/of_address.h> |
| 30 | 30 | #include <linux/of_irq.h> |
| 31 | +#include <linux/module.h> | |
| 31 | 32 | |
| 32 | 33 | #include <asm/timer-regs.h> |
| 33 | 34 | #include <asm/hexagon_vm.h> |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <linux/err.h> |
| 22 | 22 | #include <linux/mm.h> |
| 23 | 23 | #include <linux/vmalloc.h> |
| 24 | +#include <linux/binfmts.h> | |
| 24 | 25 | |
| 25 | 26 | #include <asm/vdso.h> |
| 26 | 27 | |
| @@ -106,15 +106,16 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, · 105 unmodified lines | ||
| 106 | 106 | return -EFAULT; |
| 107 | 107 | |
| 108 | 108 | { |
| 109 | − register unsigned long r8 __asm ("r8") = 0; | |
| 109 | + register unsigned long r8 __asm ("r8"); | |
| 110 | 110 | unsigned long prev; |
| 111 | 111 | __asm__ __volatile__( |
| 112 | 112 | " mf;; \n" |
| 113 | − " mov ar.ccv=%3;; \n" | |
| 114 | − "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n" | |
| 113 | + " mov %0=r0 \n" | |
| 114 | + " mov ar.ccv=%4;; \n" | |
| 115 | + "[1:] cmpxchg4.acq %1=[%2],%3,ar.ccv \n" | |
| 115 | 116 | " .xdata4 \"__ex_table\", 1b-., 2f-. \n" |
| 116 | 117 | "[2:]" |
| 117 | − : "=r" (prev) | |
| 118 | + : "=r" (r8), "=r" (prev) | |
| 118 | 119 | : "r" (uaddr), "r" (newval), |
| 119 | 120 | "rO" ((long) (unsigned) oldval) |
| 120 | 121 | : "memory"); |
| @@ -604,12 +604,6 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f) · 603 unmodified lines | ||
| 604 | 604 | spin_unlock(&(x)->ctx_lock); |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | −static inline unsigned int | |
| 608 | −pfm_do_munmap(struct mm_struct *mm, unsigned long addr, size_t len, int acct) | |
| 609 | −{ | |
| 610 | − return do_munmap(mm, addr, len); | |
| 611 | −} | |
| 612 | − | |
| 613 | 607 | static inline unsigned long |
| 614 | 608 | pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec) |
| 615 | 609 | { |
| @@ -1458,8 +1452,9 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu) · 842 unmodified lines | ||
| 1458 | 1452 | * a PROTECT_CTX() section. |
| 1459 | 1453 | */ |
| 1460 | 1454 | static int |
| 1461 | −pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long size) | |
| 1455 | +pfm_remove_smpl_mapping(void *vaddr, unsigned long size) | |
| 1462 | 1456 | { |
| 1457 | + struct task_struct *task = current; | |
| 1463 | 1458 | int r; |
| 1464 | 1459 | |
| 1465 | 1460 | /* sanity checks */ |
| @@ -1473,13 +1468,8 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz · 7 unmodified lines | ||
| 1473 | 1468 | /* |
| 1474 | 1469 | * does the actual unmapping |
| 1475 | 1470 | */ |
| 1476 | − down_write(&task->mm->mmap_sem); | |
| 1471 | + r = vm_munmap((unsigned long)vaddr, size); | |
| 1477 | 1472 | |
| 1478 | − DPRINT(("down_write done smpl_vaddr=%p size=%lu\n", vaddr, size)); | |
| 1479 | − | |
| 1480 | − r = pfm_do_munmap(task->mm, (unsigned long)vaddr, size, 0); | |
| 1481 | − | |
| 1482 | − up_write(&task->mm->mmap_sem); | |
| 1483 | 1473 | if (r !=0) { |
| 1484 | 1474 | printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); |
| 1485 | 1475 | } |
| @@ -1945,7 +1935,7 @@ pfm_flush(struct file *filp, fl_owner_t id) · 459 unmodified lines | ||
| 1945 | 1935 | * because some VM function reenables interrupts. |
| 1946 | 1936 | * |
| 1947 | 1937 | */ |
| 1948 | − if (smpl_buf_vaddr) pfm_remove_smpl_mapping(current, smpl_buf_vaddr, smpl_buf_size); | |
| 1938 | + if (smpl_buf_vaddr) pfm_remove_smpl_mapping(smpl_buf_vaddr, smpl_buf_size); | |
| 1949 | 1939 | |
| 1950 | 1940 | return 0; |
| 1951 | 1941 | } |
| @@ -49,7 +49,6 @@ CONFIG_BLK_DEV_RAM=y · 48 unmodified lines | ||
| 49 | 49 | CONFIG_NETDEVICES=y |
| 50 | 50 | CONFIG_NET_ETHERNET=y |
| 51 | 51 | CONFIG_FEC=y |
| 52 | −CONFIG_FEC2=y | |
| 53 | 52 | # CONFIG_NETDEV_1000 is not set |
| 54 | 53 | # CONFIG_NETDEV_10000 is not set |
| 55 | 54 | CONFIG_PPP=y |
| @@ -74,9 +74,7 @@ static void __init m527x_fec_init(void) · 73 unmodified lines | ||
| 74 | 74 | writew(par | 0xf00, MCF_IPSBAR + 0x100082); |
| 75 | 75 | v = readb(MCF_IPSBAR + 0x100078); |
| 76 | 76 | writeb(v | 0xc0, MCF_IPSBAR + 0x100078); |
| 77 | −#endif | |
| 78 | 77 | |
| 79 | −#ifdef CONFIG_FEC2 | |
| 80 | 78 | /* Set multi-function pins to ethernet mode for fec1 */ |
| 81 | 79 | par = readw(MCF_IPSBAR + 0x100082); |
| 82 | 80 | writew(par | 0xa0, MCF_IPSBAR + 0x100082); |
| @@ -3,9 +3,3 @@ · 2 unmodified lines | ||
| 3 | 3 | # |
| 4 | 4 | |
| 5 | 5 | obj-y := config.o |
| 6 | − | |
| 7 | −extra-y := bootlogo.rh | |
| 8 | − | |
| 9 | −$(obj)/bootlogo.rh: $(src)/bootlogo.h | |
| 10 | − perl $(src)/../68328/bootlogo.pl < $(src)/bootlogo.h \ | |
| 11 | − > $(obj)/bootlogo.rh | |
| @@ -3,14 +3,9 @@ · 2 unmodified lines | ||
| 3 | 3 | # |
| 4 | 4 | |
| 5 | 5 | obj-y := config.o |
| 6 | −logo-$(UCDIMM) := bootlogo.rh | |
| 7 | −logo-$(DRAGEN2) := screen.h | |
| 8 | −extra-y := $(logo-y) | |
| 9 | − | |
| 10 | −$(obj)/bootlogo.rh: $(src)/../68EZ328/bootlogo.h | |
| 11 | − perl $(src)/bootlogo.pl < $(src)/../68328/bootlogo.h > $(obj)/bootlogo.rh | |
| 6 | +extra-$(DRAGEN2):= screen.h | |
| 12 | 7 | |
| 13 | 8 | $(obj)/screen.h: $(src)/screen.xbm $(src)/xbm2lcd.pl |
| 14 | 9 | perl $(src)/xbm2lcd.pl < $(src)/screen.xbm > $(obj)/screen.h |
| 15 | 10 | |
| 16 | −clean-files := $(obj)/screen.h $(obj)/bootlogo.rh | |
| 11 | +clean-files := $(obj)/screen.h | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | #define splash_width 640 |
| 2 | 2 | #define splash_height 480 |
| 3 | −static unsigned char splash_bits[] = { | |
| 3 | +unsigned char __attribute__ ((aligned(16))) bootlogo_bits[] = { | |
| 4 | 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 5 | 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6 | 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| @@ -114,7 +114,7 @@ static struct resource mcf_fec1_resources[] = { · 113 unmodified lines | ||
| 114 | 114 | |
| 115 | 115 | static struct platform_device mcf_fec1 = { |
| 116 | 116 | .name = "fec", |
| 117 | − .id = 0, | |
| 117 | + .id = 1, | |
| 118 | 118 | .num_resources = ARRAY_SIZE(mcf_fec1_resources), |
| 119 | 119 | .resource = mcf_fec1_resources, |
| 120 | 120 | }; |
| @@ -0,0 +1,43 @@ | ||
| 1 | +/* | |
| 2 | + * PQ3 MPIC Message (Group B) device tree stub [ controller @ offset 0x42400 ] | |
| 3 | + * | |
| 4 | + * Copyright 2012 Freescale Semiconductor Inc. | |
| 5 | + * | |
| 6 | + * Redistribution and use in source and binary forms, with or without | |
| 7 | + * modification, are permitted provided that the following conditions are met: | |
| 8 | + * * Redistributions of source code must retain the above copyright | |
| 9 | + * notice, this list of conditions and the following disclaimer. | |
| 10 | + * * Redistributions in binary form must reproduce the above copyright | |
| 11 | + * notice, this list of conditions and the following disclaimer in the | |
| 12 | + * documentation and/or other materials provided with the distribution. | |
| 13 | + * * Neither the name of Freescale Semiconductor nor the | |
| 14 | + * names of its contributors may be used to endorse or promote products | |
| 15 | + * derived from this software without specific prior written permission. | |
| 16 | + * | |
| 17 | + * | |
| 18 | + * ALTERNATIVELY, this software may be distributed under the terms of the | |
| 19 | + * GNU General Public License ("GPL") as published by the Free Software | |
| 20 | + * Foundation, either version 2 of that License or (at your option) any | |
| 21 | + * later version. | |
| 22 | + * | |
| 23 | + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | |
| 24 | + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 25 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 26 | + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | |
| 27 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 28 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
| 29 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | |
| 30 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 31 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
| 32 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 33 | + */ | |
| 34 | + | |
| 35 | +message@42400 { | |
| 36 | + compatible = "fsl,mpic-v3.1-msgr"; | |
| 37 | + reg = <0x42400 0x200>; | |
| 38 | + interrupts = < | |
| 39 | + 0xb4 2 0 0 | |
| 40 | + 0xb5 2 0 0 | |
| 41 | + 0xb6 2 0 0 | |
| 42 | + 0xb7 2 0 0>; | |
| 43 | +}; | |
| @@ -53,6 +53,16 @@ timer@41100 { · 52 unmodified lines | ||
| 53 | 53 | 3 0 3 0>; |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | +message@41400 { | |
| 57 | + compatible = "fsl,mpic-v3.1-msgr"; | |
| 58 | + reg = <0x41400 0x200>; | |
| 59 | + interrupts = < | |
| 60 | + 0xb0 2 0 0 | |
| 61 | + 0xb1 2 0 0 | |
| 62 | + 0xb2 2 0 0 | |
| 63 | + 0xb3 2 0 0>; | |
| 64 | +}; | |
| 65 | + | |
| 56 | 66 | msi@41600 { |
| 57 | 67 | compatible = "fsl,mpic-msi"; |
| 58 | 68 | reg = <0x41600 0x80>; |
| @@ -18,10 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | #include <linux/atomic.h> |
| 19 | 19 | |
| 20 | 20 | |
| 21 | −/* Define a way to iterate across irqs. */ | |
| 22 | −#define for_each_irq(i) \ | |
| 23 | − for ((i) = 0; (i) < NR_IRQS; ++(i)) | |
| 24 | − | |
| 25 | 21 | extern atomic_t ppc_n_lost_interrupts; |
| 26 | 22 | |
| 27 | 23 | /* This number is used when no interrupt has been assigned */ |
| @@ -275,9 +275,6 @@ struct mpic · 274 unmodified lines | ||
| 275 | 275 | unsigned int isu_mask; |
| 276 | 276 | /* Number of sources */ |
| 277 | 277 | unsigned int num_sources; |
| 278 | − /* default senses array */ | |
| 279 | − unsigned char *senses; | |
| 280 | − unsigned int senses_count; | |
| 281 | 278 | |
| 282 | 279 | /* vector numbers used for internal sources (ipi/timers) */ |
| 283 | 280 | unsigned int ipi_vecs[4]; |
| @@ -415,21 +412,6 @@ extern struct mpic *mpic_alloc(struct device_node *node, · 131 unmodified lines | ||
| 415 | 412 | extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, |
| 416 | 413 | phys_addr_t phys_addr); |
| 417 | 414 | |
| 418 | −/* Set default sense codes | |
| 419 | − * | |
| 420 | − * @mpic: controller | |
| 421 | − * @senses: array of sense codes | |
| 422 | − * @count: size of above array | |
| 423 | − * | |
| 424 | − * Optionally provide an array (indexed on hardware interrupt numbers | |
| 425 | − * for this MPIC) of default sense codes for the chip. Those are linux | |
| 426 | − * sense codes IRQ_TYPE_* | |
| 427 | − * | |
| 428 | − * The driver gets ownership of the pointer, don't dispose of it or | |
| 429 | − * anything like that. __init only. | |
| 430 | − */ | |
| 431 | −extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count); | |
| 432 | − | |
| 433 | 415 | |
| 434 | 416 | /* Initialize the controller. After this has been called, none of the above |
| 435 | 417 | * should be called again for this mpic |
| @@ -13,6 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #include <linux/types.h> |
| 15 | 15 | #include <linux/spinlock.h> |
| 16 | +#include <asm/smp.h> | |
| 16 | 17 | |
| 17 | 18 | struct mpic_msgr { |
| 18 | 19 | u32 __iomem *base; |
| @@ -15,11 +15,6 @@ · 14 unmodified lines | ||
| 15 | 15 | #ifndef __ASM_POWERPC_REG_BOOKE_H__ |
| 16 | 16 | #define __ASM_POWERPC_REG_BOOKE_H__ |
| 17 | 17 | |
| 18 | −#ifdef CONFIG_BOOKE_WDT | |
| 19 | −extern u32 booke_wdt_enabled; | |
| 20 | −extern u32 booke_wdt_period; | |
| 21 | −#endif /* CONFIG_BOOKE_WDT */ | |
| 22 | − | |
| 23 | 18 | /* Machine State Register (MSR) Fields */ |
| 24 | 19 | #define MSR_GS (1<<28) /* Guest state */ |
| 25 | 20 | #define MSR_UCLE (1<<26) /* User-mode cache lock enable */ |
| @@ -330,14 +330,10 @@ void migrate_irqs(void) · 329 unmodified lines | ||
| 330 | 330 | |
| 331 | 331 | alloc_cpumask_var(&mask, GFP_KERNEL); |
| 332 | 332 | |
| 333 | − for_each_irq(irq) { | |
| 333 | + for_each_irq_desc(irq, desc) { | |
| 334 | 334 | struct irq_data *data; |
| 335 | 335 | struct irq_chip *chip; |
| 336 | 336 | |
| 337 | − desc = irq_to_desc(irq); | |
| 338 | − if (!desc) | |
| 339 | − continue; | |
| 340 | − | |
| 341 | 337 | data = irq_desc_get_irq_data(desc); |
| 342 | 338 | if (irqd_is_per_cpu(data)) |
| 343 | 339 | continue; |
| @@ -23,14 +23,11 @@ · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | void machine_kexec_mask_interrupts(void) { |
| 25 | 25 | unsigned int i; |
| 26 | + struct irq_desc *desc; | |
| 26 | 27 | |
| 27 | − for_each_irq(i) { | |
| 28 | − struct irq_desc *desc = irq_to_desc(i); | |
| 28 | + for_each_irq_desc(i, desc) { | |
| 29 | 29 | struct irq_chip *chip; |
| 30 | 30 | |
| 31 | − if (!desc) | |
| 32 | − continue; | |
| 33 | − | |
| 34 | 31 | chip = irq_desc_get_chip(desc); |
| 35 | 32 | if (!chip) |
| 36 | 33 | continue; |
| @@ -150,6 +150,9 @@ notrace void __init machine_init(u64 dt_ptr) · 149 unmodified lines | ||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | #ifdef CONFIG_BOOKE_WDT |
| 153 | +extern u32 booke_wdt_enabled; | |
| 154 | +extern u32 booke_wdt_period; | |
| 155 | + | |
| 153 | 156 | /* Checks wdt=x and wdt_period=xx command-line option */ |
| 154 | 157 | notrace int __init early_parse_wdt(char *p) |
| 155 | 158 | { |
| @@ -21,6 +21,12 @@ static struct of_device_id __initdata mpc85xx_common_ids[] = { · 20 unmodified lines | ||
| 21 | 21 | { .compatible = "fsl,qe", }, |
| 22 | 22 | { .compatible = "fsl,cpm2", }, |
| 23 | 23 | { .compatible = "fsl,srio", }, |
| 24 | + /* So that the DMA channel nodes can be probed individually: */ | |
| 25 | + { .compatible = "fsl,eloplus-dma", }, | |
| 26 | + /* For the PMC driver */ | |
| 27 | + { .compatible = "fsl,mpc8548-guts", }, | |
| 28 | + /* Probably unnecessary? */ | |
| 29 | + { .compatible = "gpio-leds", }, | |
| 24 | 30 | {}, |
| 25 | 31 | }; |
| 26 | 32 | |
| @@ -399,12 +399,6 @@ static int __init board_fixups(void) · 398 unmodified lines | ||
| 399 | 399 | machine_arch_initcall(mpc8568_mds, board_fixups); |
| 400 | 400 | machine_arch_initcall(mpc8569_mds, board_fixups); |
| 401 | 401 | |
| 402 | −static struct of_device_id mpc85xx_ids[] = { | |
| 403 | − { .compatible = "fsl,mpc8548-guts", }, | |
| 404 | − { .compatible = "gpio-leds", }, | |
| 405 | − {}, | |
| 406 | −}; | |
| 407 | − | |
| 408 | 402 | static int __init mpc85xx_publish_devices(void) |
| 409 | 403 | { |
| 410 | 404 | if (machine_is(mpc8568_mds)) |
| @@ -412,10 +406,7 @@ static int __init mpc85xx_publish_devices(void) · 1 unmodified line | ||
| 412 | 406 | if (machine_is(mpc8569_mds)) |
| 413 | 407 | simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); |
| 414 | 408 | |
| 415 | − mpc85xx_common_publish_devices(); | |
| 416 | − of_platform_bus_probe(NULL, mpc85xx_ids, NULL); | |
| 417 | − | |
| 418 | − return 0; | |
| 409 | + return mpc85xx_common_publish_devices(); | |
| 419 | 410 | } |
| 420 | 411 | |
| 421 | 412 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); |
| @@ -460,18 +460,7 @@ static void __init p1022_ds_setup_arch(void) · 459 unmodified lines | ||
| 460 | 460 | pr_info("Freescale P1022 DS reference board\n"); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | −static struct of_device_id __initdata p1022_ds_ids[] = { | |
| 464 | − /* So that the DMA channel nodes can be probed individually: */ | |
| 465 | − { .compatible = "fsl,eloplus-dma", }, | |
| 466 | − {}, | |
| 467 | −}; | |
| 468 | − | |
| 469 | −static int __init p1022_ds_publish_devices(void) | |
| 470 | −{ | |
| 471 | − mpc85xx_common_publish_devices(); | |
| 472 | − return of_platform_bus_probe(NULL, p1022_ds_ids, NULL); | |
| 473 | −} | |
| 474 | −machine_device_initcall(p1022_ds, p1022_ds_publish_devices); | |
| 463 | +machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices); | |
| 475 | 464 | |
| 476 | 465 | machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier); |
| 477 | 466 | |
| @@ -114,7 +114,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) · 113 unmodified lines | ||
| 114 | 114 | pr_devel("axon_msi: woff %x roff %x msi %x\n", |
| 115 | 115 | write_offset, msic->read_offset, msi); |
| 116 | 116 | |
| 117 | − if (msi < NR_IRQS && irq_get_chip_data(msi) == msic) { | |
| 117 | + if (msi < nr_irqs && irq_get_chip_data(msi) == msic) { | |
| 118 | 118 | generic_handle_irq(msi); |
| 119 | 119 | msic->fifo_virt[idx] = cpu_to_le32(0xffffffff); |
| 120 | 120 | } else { |
| @@ -276,9 +276,6 @@ static int axon_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) · 155 unmodified lines | ||
| 276 | 276 | if (rc) |
| 277 | 277 | return rc; |
| 278 | 278 | |
| 279 | − /* We rely on being able to stash a virq in a u16 */ | |
| 280 | − BUILD_BUG_ON(NR_IRQS > 65536); | |
| 281 | − | |
| 282 | 279 | list_for_each_entry(entry, &dev->msi_list, list) { |
| 283 | 280 | virq = irq_create_direct_mapping(msic->irq_domain); |
| 284 | 281 | if (virq == NO_IRQ) { |
| @@ -392,7 +389,8 @@ static int axon_msi_probe(struct platform_device *device) · 107 unmodified lines | ||
| 392 | 389 | } |
| 393 | 390 | memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES); |
| 394 | 391 | |
| 395 | − msic->irq_domain = irq_domain_add_nomap(dn, 0, &msic_host_ops, msic); | |
| 392 | + /* We rely on being able to stash a virq in a u16, so limit irqs to < 65536 */ | |
| 393 | + msic->irq_domain = irq_domain_add_nomap(dn, 65536, &msic_host_ops, msic); | |
| 396 | 394 | if (!msic->irq_domain) { |
| 397 | 395 | printk(KERN_ERR "axon_msi: couldn't allocate irq_domain for %s\n", |
| 398 | 396 | dn->full_name); |
| @@ -248,6 +248,6 @@ void beatic_deinit_IRQ(void) · 247 unmodified lines | ||
| 248 | 248 | { |
| 249 | 249 | int i; |
| 250 | 250 | |
| 251 | − for (i = 1; i < NR_IRQS; i++) | |
| 251 | + for (i = 1; i < nr_irqs; i++) | |
| 252 | 252 | beat_destruct_irq_plug(i); |
| 253 | 253 | } |
| @@ -366,11 +366,20 @@ static void kw_i2c_timeout(unsigned long data) · 365 unmodified lines | ||
| 366 | 366 | unsigned long flags; |
| 367 | 367 | |
| 368 | 368 | spin_lock_irqsave(&host->lock, flags); |
| 369 | + | |
| 370 | + /* | |
| 371 | + * If the timer is pending, that means we raced with the | |
| 372 | + * irq, in which case we just return | |
| 373 | + */ | |
| 374 | + if (timer_pending(&host->timeout_timer)) | |
| 375 | + goto skip; | |
| 376 | + | |
| 369 | 377 | kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr)); |
| 370 | 378 | if (host->state != state_idle) { |
| 371 | 379 | host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; |
| 372 | 380 | add_timer(&host->timeout_timer); |
| 373 | 381 | } |
| 382 | + skip: | |
| 374 | 383 | spin_unlock_irqrestore(&host->lock, flags); |
| 375 | 384 | } |
| 376 | 385 | |
| @@ -57,9 +57,9 @@ static int max_real_irqs; · 56 unmodified lines | ||
| 57 | 57 | |
| 58 | 58 | static DEFINE_RAW_SPINLOCK(pmac_pic_lock); |
| 59 | 59 | |
| 60 | −#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | |
| 61 | −static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; | |
| 62 | −static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | |
| 60 | +/* The max irq number this driver deals with is 128; see max_irqs */ | |
| 61 | +static DECLARE_BITMAP(ppc_lost_interrupts, 128); | |
| 62 | +static DECLARE_BITMAP(ppc_cached_irq_mask, 128); | |
| 63 | 63 | static int pmac_irq_cascade = -1; |
| 64 | 64 | static struct irq_domain *pmac_pic_host; |
| 65 | 65 | |
| @@ -30,9 +30,9 @@ config PPC_SPLPAR · 29 unmodified lines | ||
| 30 | 30 | two or more partitions. |
| 31 | 31 | |
| 32 | 32 | config EEH |
| 33 | − bool "PCI Extended Error Handling (EEH)" if EXPERT | |
| 33 | + bool | |
| 34 | 34 | depends on PPC_PSERIES && PCI |
| 35 | − default y if !EXPERT | |
| 35 | + default y | |
| 36 | 36 | |
| 37 | 37 | config PSERIES_MSI |
| 38 | 38 | bool |
| @@ -1076,7 +1076,7 @@ static void eeh_add_device_late(struct pci_dev *dev) · 1075 unmodified lines | ||
| 1076 | 1076 | pr_debug("EEH: Adding device %s\n", pci_name(dev)); |
| 1077 | 1077 | |
| 1078 | 1078 | dn = pci_device_to_OF_node(dev); |
| 1079 | − edev = pci_dev_to_eeh_dev(dev); | |
| 1079 | + edev = of_node_to_eeh_dev(dn); | |
| 1080 | 1080 | if (edev->pdev == dev) { |
| 1081 | 1081 | pr_debug("EEH: Already referenced !\n"); |
| 1082 | 1082 | return; |
| @@ -51,8 +51,7 @@ · 50 unmodified lines | ||
| 51 | 51 | static intctl_cpm2_t __iomem *cpm2_intctl; |
| 52 | 52 | |
| 53 | 53 | static struct irq_domain *cpm2_pic_host; |
| 54 | −#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | |
| 55 | −static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | |
| 54 | +static unsigned long ppc_cached_irq_mask[2]; /* 2 32-bit registers */ | |
| 56 | 55 | |
| 57 | 56 | static const u_char irq_to_siureg[] = { |
| 58 | 57 | 1, 1, 1, 1, 1, 1, 1, 1, |
| @@ -18,69 +18,45 @@ · 17 unmodified lines | ||
| 18 | 18 | extern int cpm_get_irq(struct pt_regs *regs); |
| 19 | 19 | |
| 20 | 20 | static struct irq_domain *mpc8xx_pic_host; |
| 21 | −#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | |
| 22 | −static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | |
| 21 | +static unsigned long mpc8xx_cached_irq_mask; | |
| 23 | 22 | static sysconf8xx_t __iomem *siu_reg; |
| 24 | 23 | |
| 25 | −int cpm_get_irq(struct pt_regs *regs); | |
| 24 | +static inline unsigned long mpc8xx_irqd_to_bit(struct irq_data *d) | |
| 25 | +{ | |
| 26 | + return 0x80000000 >> irqd_to_hwirq(d); | |
| 27 | +} | |
| 26 | 28 | |
| 27 | 29 | static void mpc8xx_unmask_irq(struct irq_data *d) |
| 28 | 30 | { |
| 29 | − int bit, word; | |
| 30 | − unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); | |
| 31 | − | |
| 32 | − bit = irq_nr & 0x1f; | |
| 33 | − word = irq_nr >> 5; | |
| 34 | − | |
| 35 | − ppc_cached_irq_mask[word] |= (1 << (31-bit)); | |
| 36 | − out_be32(&siu_reg->sc_simask, ppc_cached_irq_mask[word]); | |
| 31 | + mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d); | |
| 32 | + out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask); | |
| 37 | 33 | } |
| 38 | 34 | |
| 39 | 35 | static void mpc8xx_mask_irq(struct irq_data *d) |
| 40 | 36 | { |
| 41 | − int bit, word; | |
| 42 | − unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); | |
| 43 | − | |
| 44 | − bit = irq_nr & 0x1f; | |
| 45 | − word = irq_nr >> 5; | |
| 46 | − | |
| 47 | − ppc_cached_irq_mask[word] &= ~(1 << (31-bit)); | |
| 48 | − out_be32(&siu_reg->sc_simask, ppc_cached_irq_mask[word]); | |
| 37 | + mpc8xx_cached_irq_mask &= ~mpc8xx_irqd_to_bit(d); | |
| 38 | + out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask); | |
| 49 | 39 | } |
| 50 | 40 | |
| 51 | 41 | static void mpc8xx_ack(struct irq_data *d) |
| 52 | 42 | { |
| 53 | − int bit; | |
| 54 | − unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); | |
| 55 | − | |
| 56 | − bit = irq_nr & 0x1f; | |
| 57 | − out_be32(&siu_reg->sc_sipend, 1 << (31-bit)); | |
| 43 | + out_be32(&siu_reg->sc_sipend, mpc8xx_irqd_to_bit(d)); | |
| 58 | 44 | } |
| 59 | 45 | |
| 60 | 46 | static void mpc8xx_end_irq(struct irq_data *d) |
| 61 | 47 | { |
| 62 | − int bit, word; | |
| 63 | − unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); | |
| 64 | − | |
| 65 | − bit = irq_nr & 0x1f; | |
| 66 | − word = irq_nr >> 5; | |
| 67 | − | |
| 68 | − ppc_cached_irq_mask[word] |= (1 << (31-bit)); | |
| 69 | − out_be32(&siu_reg->sc_simask, ppc_cached_irq_mask[word]); | |
| 48 | + mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d); | |
| 49 | + out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask); | |
| 70 | 50 | } |
| 71 | 51 | |
| 72 | 52 | static int mpc8xx_set_irq_type(struct irq_data *d, unsigned int flow_type) |
| 73 | 53 | { |
| 74 | − if (flow_type & IRQ_TYPE_EDGE_FALLING) { | |
| 75 | − irq_hw_number_t hw = (unsigned int)irqd_to_hwirq(d); | |
| 54 | + /* only external IRQ senses are programmable */ | |
| 55 | + if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !(irqd_to_hwirq(d) & 1)) { | |
| 76 | 56 | unsigned int siel = in_be32(&siu_reg->sc_siel); |
| 77 | − | |
| 78 | − /* only external IRQ senses are programmable */ | |
| 79 | − if ((hw & 1) == 0) { | |
| 80 | − siel |= (0x80000000 >> hw); | |
| 81 | − out_be32(&siu_reg->sc_siel, siel); | |
| 82 | − __irq_set_handler_locked(d->irq, handle_edge_irq); | |
| 83 | − } | |
| 57 | + siel |= mpc8xx_irqd_to_bit(d); | |
| 58 | + out_be32(&siu_reg->sc_siel, siel); | |
| 59 | + __irq_set_handler_locked(d->irq, handle_edge_irq); | |
| 84 | 60 | } |
| 85 | 61 | return 0; |
| 86 | 62 | } |
| @@ -132,6 +108,9 @@ static int mpc8xx_pic_host_xlate(struct irq_domain *h, struct device_node *ct, · 45 unmodified lines | ||
| 132 | 108 | IRQ_TYPE_EDGE_FALLING, |
| 133 | 109 | }; |
| 134 | 110 | |
| 111 | + if (intspec[0] > 0x1f) | |
| 112 | + return 0; | |
| 113 | + | |
| 135 | 114 | *out_hwirq = intspec[0]; |
| 136 | 115 | if (intsize > 1 && intspec[1] < 4) |
| 137 | 116 | *out_flags = map_pic_senses[intspec[1]]; |
| @@ -604,18 +604,14 @@ static struct mpic *mpic_find(unsigned int irq) · 603 unmodified lines | ||
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | /* Determine if the linux irq is an IPI */ |
| 607 | −static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq) | |
| 607 | +static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int src) | |
| 608 | 608 | { |
| 609 | − unsigned int src = virq_to_hw(irq); | |
| 610 | − | |
| 611 | 609 | return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]); |
| 612 | 610 | } |
| 613 | 611 | |
| 614 | 612 | /* Determine if the linux irq is a timer */ |
| 615 | −static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int irq) | |
| 613 | +static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int src) | |
| 616 | 614 | { |
| 617 | − unsigned int src = virq_to_hw(irq); | |
| 618 | − | |
| 619 | 615 | return (src >= mpic->timer_vecs[0] && src <= mpic->timer_vecs[7]); |
| 620 | 616 | } |
| 621 | 617 | |
| @@ -876,21 +872,45 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type) · 254 unmodified lines | ||
| 876 | 872 | if (src >= mpic->num_sources) |
| 877 | 873 | return -EINVAL; |
| 878 | 874 | |
| 875 | + vold = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)); | |
| 876 | + | |
| 877 | + /* We don't support "none" type */ | |
| 879 | 878 | if (flow_type == IRQ_TYPE_NONE) |
| 880 | − if (mpic->senses && src < mpic->senses_count) | |
| 881 | − flow_type = mpic->senses[src]; | |
| 882 | − if (flow_type == IRQ_TYPE_NONE) | |
| 883 | − flow_type = IRQ_TYPE_LEVEL_LOW; | |
| 879 | + flow_type = IRQ_TYPE_DEFAULT; | |
| 880 | + | |
| 881 | + /* Default: read HW settings */ | |
| 882 | + if (flow_type == IRQ_TYPE_DEFAULT) { | |
| 883 | + switch(vold & (MPIC_INFO(VECPRI_POLARITY_MASK) | | |
| 884 | + MPIC_INFO(VECPRI_SENSE_MASK))) { | |
| 885 | + case MPIC_INFO(VECPRI_SENSE_EDGE) | | |
| 886 | + MPIC_INFO(VECPRI_POLARITY_POSITIVE): | |
| 887 | + flow_type = IRQ_TYPE_EDGE_RISING; | |
| 888 | + break; | |
| 889 | + case MPIC_INFO(VECPRI_SENSE_EDGE) | | |
| 890 | + MPIC_INFO(VECPRI_POLARITY_NEGATIVE): | |
| 891 | + flow_type = IRQ_TYPE_EDGE_FALLING; | |
| 892 | + break; | |
| 893 | + case MPIC_INFO(VECPRI_SENSE_LEVEL) | | |
| 894 | + MPIC_INFO(VECPRI_POLARITY_POSITIVE): | |
| 895 | + flow_type = IRQ_TYPE_LEVEL_HIGH; | |
| 896 | + break; | |
| 897 | + case MPIC_INFO(VECPRI_SENSE_LEVEL) | | |
| 898 | + MPIC_INFO(VECPRI_POLARITY_NEGATIVE): | |
| 899 | + flow_type = IRQ_TYPE_LEVEL_LOW; | |
| 900 | + break; | |
| 901 | + } | |
| 902 | + } | |
| 884 | 903 | |
| 904 | + /* Apply to irq desc */ | |
| 885 | 905 | irqd_set_trigger_type(d, flow_type); |
| 886 | 906 | |
| 907 | + /* Apply to HW */ | |
| 887 | 908 | if (mpic_is_ht_interrupt(mpic, src)) |
| 888 | 909 | vecpri = MPIC_VECPRI_POLARITY_POSITIVE | |
| 889 | 910 | MPIC_VECPRI_SENSE_EDGE; |
| 890 | 911 | else |
| 891 | 912 | vecpri = mpic_type_to_vecpri(mpic, flow_type); |
| 892 | 913 | |
| 893 | − vold = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)); | |
| 894 | 914 | vnew = vold & ~(MPIC_INFO(VECPRI_POLARITY_MASK) | |
| 895 | 915 | MPIC_INFO(VECPRI_SENSE_MASK)); |
| 896 | 916 | vnew |= vecpri; |
| @@ -1026,7 +1046,7 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq, · 129 unmodified lines | ||
| 1026 | 1046 | irq_set_chip_and_handler(virq, chip, handle_fasteoi_irq); |
| 1027 | 1047 | |
| 1028 | 1048 | /* Set default irq type */ |
| 1029 | − irq_set_irq_type(virq, IRQ_TYPE_NONE); | |
| 1049 | + irq_set_irq_type(virq, IRQ_TYPE_DEFAULT); | |
| 1030 | 1050 | |
| 1031 | 1051 | /* If the MPIC was reset, then all vectors have already been |
| 1032 | 1052 | * initialized. Otherwise, a per source lazy initialization |
| @@ -1417,12 +1437,6 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, · 384 unmodified lines | ||
| 1417 | 1437 | mpic->num_sources = isu_first + mpic->isu_size; |
| 1418 | 1438 | } |
| 1419 | 1439 | |
| 1420 | −void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count) | |
| 1421 | −{ | |
| 1422 | − mpic->senses = senses; | |
| 1423 | − mpic->senses_count = count; | |
| 1424 | −} | |
| 1425 | − | |
| 1426 | 1440 | void __init mpic_init(struct mpic *mpic) |
| 1427 | 1441 | { |
| 1428 | 1442 | int i, cpu; |
| @@ -1555,12 +1569,12 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri) · 126 unmodified lines | ||
| 1555 | 1569 | return; |
| 1556 | 1570 | |
| 1557 | 1571 | raw_spin_lock_irqsave(&mpic_lock, flags); |
| 1558 | − if (mpic_is_ipi(mpic, irq)) { | |
| 1572 | + if (mpic_is_ipi(mpic, src)) { | |
| 1559 | 1573 | reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) & |
| 1560 | 1574 | ~MPIC_VECPRI_PRIORITY_MASK; |
| 1561 | 1575 | mpic_ipi_write(src - mpic->ipi_vecs[0], |
| 1562 | 1576 | reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); |
| 1563 | − } else if (mpic_is_tm(mpic, irq)) { | |
| 1577 | + } else if (mpic_is_tm(mpic, src)) { | |
| 1564 | 1578 | reg = mpic_tm_read(src - mpic->timer_vecs[0]) & |
| 1565 | 1579 | ~MPIC_VECPRI_PRIORITY_MASK; |
| 1566 | 1580 | mpic_tm_write(src - mpic->timer_vecs[0], |
| @@ -27,6 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | |
| 28 | 28 | static struct mpic_msgr **mpic_msgrs; |
| 29 | 29 | static unsigned int mpic_msgr_count; |
| 30 | +static DEFINE_RAW_SPINLOCK(msgrs_lock); | |
| 30 | 31 | |
| 31 | 32 | static inline void _mpic_msgr_mer_write(struct mpic_msgr *msgr, u32 value) |
| 32 | 33 | { |
| @@ -56,12 +57,11 @@ struct mpic_msgr *mpic_msgr_get(unsigned int reg_num) · 23 unmodified lines | ||
| 56 | 57 | if (reg_num >= mpic_msgr_count) |
| 57 | 58 | return ERR_PTR(-ENODEV); |
| 58 | 59 | |
| 59 | − raw_spin_lock_irqsave(&msgr->lock, flags); | |
| 60 | − if (mpic_msgrs[reg_num]->in_use == MSGR_FREE) { | |
| 61 | − msgr = mpic_msgrs[reg_num]; | |
| 60 | + raw_spin_lock_irqsave(&msgrs_lock, flags); | |
| 61 | + msgr = mpic_msgrs[reg_num]; | |
| 62 | + if (msgr->in_use == MSGR_FREE) | |
| 62 | 63 | msgr->in_use = MSGR_INUSE; |
| 63 | − } | |
| 64 | − raw_spin_unlock_irqrestore(&msgr->lock, flags); | |
| 64 | + raw_spin_unlock_irqrestore(&msgrs_lock, flags); | |
| 65 | 65 | |
| 66 | 66 | return msgr; |
| 67 | 67 | } |
| @@ -228,7 +228,7 @@ static __devinit int mpic_msgr_probe(struct platform_device *dev) · 160 unmodified lines | ||
| 228 | 228 | |
| 229 | 229 | reg_number = block_number * MPIC_MSGR_REGISTERS_PER_BLOCK + i; |
| 230 | 230 | msgr->base = msgr_block_addr + i * MPIC_MSGR_STRIDE; |
| 231 | − msgr->mer = msgr->base + MPIC_MSGR_MER_OFFSET; | |
| 231 | + msgr->mer = (u32 *)((u8 *)msgr->base + MPIC_MSGR_MER_OFFSET); | |
| 232 | 232 | msgr->in_use = MSGR_FREE; |
| 233 | 233 | msgr->num = i; |
| 234 | 234 | raw_spin_lock_init(&msgr->lock); |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <linux/debugfs.h> |
| 23 | 23 | #include <linux/slab.h> |
| 24 | 24 | #include <linux/export.h> |
| 25 | +#include <asm/debug.h> | |
| 25 | 26 | #include <asm/prom.h> |
| 26 | 27 | #include <asm/scom.h> |
| 27 | 28 | |
| @@ -188,6 +188,7 @@ void xics_migrate_irqs_away(void) · 187 unmodified lines | ||
| 188 | 188 | { |
| 189 | 189 | int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id(); |
| 190 | 190 | unsigned int irq, virq; |
| 191 | + struct irq_desc *desc; | |
| 191 | 192 | |
| 192 | 193 | /* If we used to be the default server, move to the new "boot_cpuid" */ |
| 193 | 194 | if (hw_cpu == xics_default_server) |
| @@ -202,8 +203,7 @@ void xics_migrate_irqs_away(void) · 8 unmodified lines | ||
| 202 | 203 | /* Allow IPIs again... */ |
| 203 | 204 | icp_ops->set_priority(DEFAULT_PRIORITY); |
| 204 | 205 | |
| 205 | − for_each_irq(virq) { | |
| 206 | − struct irq_desc *desc; | |
| 206 | + for_each_irq_desc(virq, desc) { | |
| 207 | 207 | struct irq_chip *chip; |
| 208 | 208 | long server; |
| 209 | 209 | unsigned long flags; |
| @@ -212,9 +212,8 @@ void xics_migrate_irqs_away(void) · 2 unmodified lines | ||
| 212 | 212 | /* We can't set affinity on ISA interrupts */ |
| 213 | 213 | if (virq < NUM_ISA_INTERRUPTS) |
| 214 | 214 | continue; |
| 215 | − desc = irq_to_desc(virq); | |
| 216 | 215 | /* We only need to migrate enabled IRQS */ |
| 217 | − if (!desc || !desc->action) | |
| 216 | + if (!desc->action) | |
| 218 | 217 | continue; |
| 219 | 218 | if (desc->irq_data.domain != xics_host) |
| 220 | 219 | continue; |
| @@ -90,7 +90,6 @@ config S390 · 89 unmodified lines | ||
| 90 | 90 | select HAVE_KERNEL_XZ |
| 91 | 91 | select HAVE_ARCH_MUTEX_CPU_RELAX |
| 92 | 92 | select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 |
| 93 | − select HAVE_RCU_TABLE_FREE if SMP | |
| 94 | 93 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION |
| 95 | 94 | select HAVE_MEMBLOCK |
| 96 | 95 | select HAVE_MEMBLOCK_NODE_MAP |
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | CONFIG_EXPERIMENTAL=y |
| 2 | 2 | CONFIG_SYSVIPC=y |
| 3 | 3 | CONFIG_POSIX_MQUEUE=y |
| 4 | +CONFIG_FHANDLE=y | |
| 5 | +CONFIG_TASKSTATS=y | |
| 6 | +CONFIG_TASK_DELAY_ACCT=y | |
| 7 | +CONFIG_TASK_XACCT=y | |
| 8 | +CONFIG_TASK_IO_ACCOUNTING=y | |
| 4 | 9 | CONFIG_AUDIT=y |
| 5 | −CONFIG_RCU_TRACE=y | |
| 6 | 10 | CONFIG_IKCONFIG=y |
| 7 | 11 | CONFIG_IKCONFIG_PROC=y |
| 8 | 12 | CONFIG_CGROUPS=y |
| @@ -14,16 +18,22 @@ CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y · 5 unmodified lines | ||
| 14 | 18 | CONFIG_CGROUP_SCHED=y |
| 15 | 19 | CONFIG_RT_GROUP_SCHED=y |
| 16 | 20 | CONFIG_BLK_CGROUP=y |
| 21 | +CONFIG_NAMESPACES=y | |
| 17 | 22 | CONFIG_BLK_DEV_INITRD=y |
| 18 | −# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | |
| 23 | +CONFIG_RD_BZIP2=y | |
| 24 | +CONFIG_RD_LZMA=y | |
| 25 | +CONFIG_RD_XZ=y | |
| 26 | +CONFIG_RD_LZO=y | |
| 27 | +CONFIG_EXPERT=y | |
| 19 | 28 | # CONFIG_COMPAT_BRK is not set |
| 20 | −CONFIG_SLAB=y | |
| 21 | 29 | CONFIG_PROFILING=y |
| 22 | 30 | CONFIG_OPROFILE=y |
| 23 | 31 | CONFIG_KPROBES=y |
| 24 | 32 | CONFIG_MODULES=y |
| 25 | 33 | CONFIG_MODULE_UNLOAD=y |
| 26 | 34 | CONFIG_MODVERSIONS=y |
| 35 | +CONFIG_PARTITION_ADVANCED=y | |
| 36 | +CONFIG_IBM_PARTITION=y | |
| 27 | 37 | CONFIG_DEFAULT_DEADLINE=y |
| 28 | 38 | CONFIG_NO_HZ=y |
| 29 | 39 | CONFIG_HIGH_RES_TIMERS=y |
| @@ -34,18 +44,15 @@ CONFIG_KSM=y · 4 unmodified lines | ||
| 34 | 44 | CONFIG_BINFMT_MISC=m |
| 35 | 45 | CONFIG_CMM=m |
| 36 | 46 | CONFIG_HZ_100=y |
| 37 | −CONFIG_KEXEC=y | |
| 38 | −CONFIG_PM=y | |
| 47 | +CONFIG_CRASH_DUMP=y | |
| 39 | 48 | CONFIG_HIBERNATION=y |
| 40 | 49 | CONFIG_PACKET=y |
| 41 | 50 | CONFIG_UNIX=y |
| 42 | 51 | CONFIG_NET_KEY=y |
| 43 | −CONFIG_AFIUCV=m | |
| 44 | 52 | CONFIG_INET=y |
| 45 | 53 | CONFIG_IP_MULTICAST=y |
| 46 | 54 | # CONFIG_INET_LRO is not set |
| 47 | 55 | CONFIG_IPV6=y |
| 48 | −CONFIG_NET_SCTPPROBE=m | |
| 49 | 56 | CONFIG_L2TP=m |
| 50 | 57 | CONFIG_L2TP_DEBUGFS=m |
| 51 | 58 | CONFIG_VLAN_8021Q=y |
| @@ -84,15 +91,14 @@ CONFIG_SCSI_CONSTANTS=y · 32 unmodified lines | ||
| 84 | 91 | CONFIG_SCSI_LOGGING=y |
| 85 | 92 | CONFIG_SCSI_SCAN_ASYNC=y |
| 86 | 93 | CONFIG_ZFCP=y |
| 87 | −CONFIG_ZFCP_DIF=y | |
| 88 | 94 | CONFIG_NETDEVICES=y |
| 89 | −CONFIG_DUMMY=m | |
| 90 | 95 | CONFIG_BONDING=m |
| 96 | +CONFIG_DUMMY=m | |
| 91 | 97 | CONFIG_EQUALIZER=m |
| 92 | 98 | CONFIG_TUN=m |
| 93 | −CONFIG_NET_ETHERNET=y | |
| 94 | 99 | CONFIG_VIRTIO_NET=y |
| 95 | 100 | CONFIG_RAW_DRIVER=m |
| 101 | +CONFIG_VIRTIO_BALLOON=y | |
| 96 | 102 | CONFIG_EXT2_FS=y |
| 97 | 103 | CONFIG_EXT3_FS=y |
| 98 | 104 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
| @@ -103,27 +109,21 @@ CONFIG_PROC_KCORE=y · 4 unmodified lines | ||
| 103 | 109 | CONFIG_TMPFS=y |
| 104 | 110 | CONFIG_TMPFS_POSIX_ACL=y |
| 105 | 111 | # CONFIG_NETWORK_FILESYSTEMS is not set |
| 106 | −CONFIG_PARTITION_ADVANCED=y | |
| 107 | −CONFIG_IBM_PARTITION=y | |
| 108 | −CONFIG_DLM=m | |
| 109 | 112 | CONFIG_MAGIC_SYSRQ=y |
| 110 | −CONFIG_DEBUG_KERNEL=y | |
| 111 | 113 | CONFIG_TIMER_STATS=y |
| 112 | 114 | CONFIG_PROVE_LOCKING=y |
| 113 | 115 | CONFIG_PROVE_RCU=y |
| 114 | 116 | CONFIG_LOCK_STAT=y |
| 115 | 117 | CONFIG_DEBUG_LOCKDEP=y |
| 116 | −CONFIG_DEBUG_SPINLOCK_SLEEP=y | |
| 117 | 118 | CONFIG_DEBUG_LIST=y |
| 118 | 119 | CONFIG_DEBUG_NOTIFIERS=y |
| 119 | −# CONFIG_RCU_CPU_STALL_DETECTOR is not set | |
| 120 | +CONFIG_RCU_TRACE=y | |
| 120 | 121 | CONFIG_KPROBES_SANITY_TEST=y |
| 121 | 122 | CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y |
| 122 | 123 | CONFIG_CPU_NOTIFIER_ERROR_INJECT=m |
| 123 | 124 | CONFIG_LATENCYTOP=y |
| 124 | −CONFIG_SYSCTL_SYSCALL_CHECK=y | |
| 125 | 125 | CONFIG_DEBUG_PAGEALLOC=y |
| 126 | −# CONFIG_FTRACE is not set | |
| 126 | +CONFIG_BLK_DEV_IO_TRACE=y | |
| 127 | 127 | # CONFIG_STRICT_DEVMEM is not set |
| 128 | 128 | CONFIG_CRYPTO_NULL=m |
| 129 | 129 | CONFIG_CRYPTO_CRYPTD=m |
| @@ -173,4 +173,3 @@ CONFIG_CRYPTO_SHA512_S390=m · 43 unmodified lines | ||
| 173 | 173 | CONFIG_CRYPTO_DES_S390=m |
| 174 | 174 | CONFIG_CRYPTO_AES_S390=m |
| 175 | 175 | CONFIG_CRC7=m |
| 176 | −CONFIG_VIRTIO_BALLOON=y | |
| @@ -38,12 +38,11 @@ static inline void stfle(u64 *stfle_fac_list, int size) · 37 unmodified lines | ||
| 38 | 38 | unsigned long nr; |
| 39 | 39 | |
| 40 | 40 | preempt_disable(); |
| 41 | − S390_lowcore.stfl_fac_list = 0; | |
| 42 | 41 | asm volatile( |
| 43 | 42 | " .insn s,0xb2b10000,0(0)\n" /* stfl */ |
| 44 | 43 | "0:\n" |
| 45 | 44 | EX_TABLE(0b, 0b) |
| 46 | − : "=m" (S390_lowcore.stfl_fac_list)); | |
| 45 | + : "+m" (S390_lowcore.stfl_fac_list)); | |
| 47 | 46 | nr = 4; /* bytes stored by stfl */ |
| 48 | 47 | memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4); |
| 49 | 48 | if (S390_lowcore.stfl_fac_list & 0x01000000) { |
| @@ -22,10 +22,7 @@ void crst_table_free(struct mm_struct *, unsigned long *); · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | unsigned long *page_table_alloc(struct mm_struct *, unsigned long); |
| 24 | 24 | void page_table_free(struct mm_struct *, unsigned long *); |
| 25 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 26 | 25 | void page_table_free_rcu(struct mmu_gather *, unsigned long *); |
| 27 | −void __tlb_remove_table(void *_table); | |
| 28 | −#endif | |
| 29 | 26 | |
| 30 | 27 | static inline void clear_table(unsigned long *s, unsigned long val, size_t n) |
| 31 | 28 | { |
| @@ -77,7 +77,7 @@ static inline __u16 __arch_swab16p(const __u16 *x) · 76 unmodified lines | ||
| 77 | 77 | |
| 78 | 78 | asm volatile( |
| 79 | 79 | #ifndef __s390x__ |
| 80 | − " icm %0,2,%O+1(%R1)\n" | |
| 80 | + " icm %0,2,%O1+1(%R1)\n" | |
| 81 | 81 | " ic %0,%1\n" |
| 82 | 82 | : "=&d" (result) : "Q" (*x) : "cc"); |
| 83 | 83 | #else /* __s390x__ */ |
| @@ -30,14 +30,10 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | struct mmu_gather { |
| 32 | 32 | struct mm_struct *mm; |
| 33 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 34 | 33 | struct mmu_table_batch *batch; |
| 35 | −#endif | |
| 36 | 34 | unsigned int fullmm; |
| 37 | − unsigned int need_flush; | |
| 38 | 35 | }; |
| 39 | 36 | |
| 40 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 41 | 37 | struct mmu_table_batch { |
| 42 | 38 | struct rcu_head rcu; |
| 43 | 39 | unsigned int nr; |
| @@ -49,7 +45,6 @@ struct mmu_table_batch { · 5 unmodified lines | ||
| 49 | 45 | |
| 50 | 46 | extern void tlb_table_flush(struct mmu_gather *tlb); |
| 51 | 47 | extern void tlb_remove_table(struct mmu_gather *tlb, void *table); |
| 52 | −#endif | |
| 53 | 48 | |
| 54 | 49 | static inline void tlb_gather_mmu(struct mmu_gather *tlb, |
| 55 | 50 | struct mm_struct *mm, |
| @@ -57,29 +52,20 @@ static inline void tlb_gather_mmu(struct mmu_gather *tlb, · 1 unmodified line | ||
| 57 | 52 | { |
| 58 | 53 | tlb->mm = mm; |
| 59 | 54 | tlb->fullmm = full_mm_flush; |
| 60 | − tlb->need_flush = 0; | |
| 61 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 62 | 55 | tlb->batch = NULL; |
| 63 | −#endif | |
| 64 | 56 | if (tlb->fullmm) |
| 65 | 57 | __tlb_flush_mm(mm); |
| 66 | 58 | } |
| 67 | 59 | |
| 68 | 60 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) |
| 69 | 61 | { |
| 70 | − if (!tlb->need_flush) | |
| 71 | − return; | |
| 72 | − tlb->need_flush = 0; | |
| 73 | − __tlb_flush_mm(tlb->mm); | |
| 74 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 75 | 62 | tlb_table_flush(tlb); |
| 76 | −#endif | |
| 77 | 63 | } |
| 78 | 64 | |
| 79 | 65 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, |
| 80 | 66 | unsigned long start, unsigned long end) |
| 81 | 67 | { |
| 82 | − tlb_flush_mmu(tlb); | |
| 68 | + tlb_table_flush(tlb); | |
| 83 | 69 | } |
| 84 | 70 | |
| 85 | 71 | /* |
| @@ -105,10 +91,8 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) · 19 unmodified lines | ||
| 105 | 91 | static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, |
| 106 | 92 | unsigned long address) |
| 107 | 93 | { |
| 108 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 109 | 94 | if (!tlb->fullmm) |
| 110 | 95 | return page_table_free_rcu(tlb, (unsigned long *) pte); |
| 111 | −#endif | |
| 112 | 96 | page_table_free(tlb->mm, (unsigned long *) pte); |
| 113 | 97 | } |
| 114 | 98 | |
| @@ -125,10 +109,8 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, · 10 unmodified lines | ||
| 125 | 109 | #ifdef __s390x__ |
| 126 | 110 | if (tlb->mm->context.asce_limit <= (1UL << 31)) |
| 127 | 111 | return; |
| 128 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 129 | 112 | if (!tlb->fullmm) |
| 130 | 113 | return tlb_remove_table(tlb, pmd); |
| 131 | −#endif | |
| 132 | 114 | crst_table_free(tlb->mm, (unsigned long *) pmd); |
| 133 | 115 | #endif |
| 134 | 116 | } |
| @@ -146,10 +128,8 @@ static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, · 11 unmodified lines | ||
| 146 | 128 | #ifdef __s390x__ |
| 147 | 129 | if (tlb->mm->context.asce_limit <= (1UL << 42)) |
| 148 | 130 | return; |
| 149 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 150 | 131 | if (!tlb->fullmm) |
| 151 | 132 | return tlb_remove_table(tlb, pud); |
| 152 | −#endif | |
| 153 | 133 | crst_table_free(tlb->mm, (unsigned long *) pud); |
| 154 | 134 | #endif |
| 155 | 135 | } |
| @@ -474,9 +474,9 @@ ENTRY(startup_kdump) · 473 unmodified lines | ||
| 474 | 474 | stck __LC_LAST_UPDATE_CLOCK |
| 475 | 475 | spt 5f-.LPG0(%r13) |
| 476 | 476 | mvc __LC_LAST_UPDATE_TIMER(8),5f-.LPG0(%r13) |
| 477 | + xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST | |
| 477 | 478 | #ifndef CONFIG_MARCH_G5 |
| 478 | 479 | # check capabilities against MARCH_{G5,Z900,Z990,Z9_109,Z10} |
| 479 | − xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST | |
| 480 | 480 | .insn s,0xb2b10000,__LC_STFL_FAC_LIST # store facility list |
| 481 | 481 | tm __LC_STFL_FAC_LIST,0x01 # stfle available ? |
| 482 | 482 | jz 0f |
| @@ -118,9 +118,10 @@ asmlinkage void do_softirq(void) · 117 unmodified lines | ||
| 118 | 118 | "a" (__do_softirq) |
| 119 | 119 | : "0", "1", "2", "3", "4", "5", "14", |
| 120 | 120 | "cc", "memory" ); |
| 121 | − } else | |
| 121 | + } else { | |
| 122 | 122 | /* We are already on the async stack. */ |
| 123 | 123 | __do_softirq(); |
| 124 | + } | |
| 124 | 125 | } |
| 125 | 126 | |
| 126 | 127 | local_irq_restore(flags); |
| @@ -192,11 +193,12 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler) · 65 unmodified lines | ||
| 192 | 193 | int index = ext_hash(code); |
| 193 | 194 | |
| 194 | 195 | spin_lock_irqsave(&ext_int_hash_lock, flags); |
| 195 | − list_for_each_entry_rcu(p, &ext_int_hash[index], entry) | |
| 196 | + list_for_each_entry_rcu(p, &ext_int_hash[index], entry) { | |
| 196 | 197 | if (p->code == code && p->handler == handler) { |
| 197 | 198 | list_del_rcu(&p->entry); |
| 198 | 199 | kfree_rcu(p, rcu); |
| 199 | 200 | } |
| 201 | + } | |
| 200 | 202 | spin_unlock_irqrestore(&ext_int_hash_lock, flags); |
| 201 | 203 | return 0; |
| 202 | 204 | } |
| @@ -211,9 +213,10 @@ void __irq_entry do_extint(struct pt_regs *regs, struct ext_code ext_code, · 8 unmodified lines | ||
| 211 | 213 | |
| 212 | 214 | old_regs = set_irq_regs(regs); |
| 213 | 215 | irq_enter(); |
| 214 | − if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) | |
| 216 | + if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) { | |
| 215 | 217 | /* Serve timer interrupts first. */ |
| 216 | 218 | clock_comparator_work(); |
| 219 | + } | |
| 217 | 220 | kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++; |
| 218 | 221 | if (ext_code.code != 0x1004) |
| 219 | 222 | __get_cpu_var(s390_idle).nohz_delay = 1; |
| @@ -178,7 +178,7 @@ static void cpumf_pmu_enable(struct pmu *pmu) · 177 unmodified lines | ||
| 178 | 178 | err = lcctl(cpuhw->state); |
| 179 | 179 | if (err) { |
| 180 | 180 | pr_err("Enabling the performance measuring unit " |
| 181 | − "failed with rc=%lx\n", err); | |
| 181 | + "failed with rc=%x\n", err); | |
| 182 | 182 | return; |
| 183 | 183 | } |
| 184 | 184 | |
| @@ -203,7 +203,7 @@ static void cpumf_pmu_disable(struct pmu *pmu) · 18 unmodified lines | ||
| 203 | 203 | err = lcctl(inactive); |
| 204 | 204 | if (err) { |
| 205 | 205 | pr_err("Disabling the performance measuring unit " |
| 206 | − "failed with rc=%lx\n", err); | |
| 206 | + "failed with rc=%x\n", err); | |
| 207 | 207 | return; |
| 208 | 208 | } |
| 209 | 209 | |
| @@ -61,21 +61,14 @@ long probe_kernel_write(void *dst, const void *src, size_t size) · 60 unmodified lines | ||
| 61 | 61 | return copied < 0 ? -EFAULT : 0; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | −/* | |
| 65 | − * Copy memory in real mode (kernel to kernel) | |
| 66 | − */ | |
| 67 | −int memcpy_real(void *dest, void *src, size_t count) | |
| 64 | +static int __memcpy_real(void *dest, void *src, size_t count) | |
| 68 | 65 | { |
| 69 | 66 | register unsigned long _dest asm("2") = (unsigned long) dest; |
| 70 | 67 | register unsigned long _len1 asm("3") = (unsigned long) count; |
| 71 | 68 | register unsigned long _src asm("4") = (unsigned long) src; |
| 72 | 69 | register unsigned long _len2 asm("5") = (unsigned long) count; |
| 73 | − unsigned long flags; | |
| 74 | 70 | int rc = -EFAULT; |
| 75 | 71 | |
| 76 | − if (!count) | |
| 77 | − return 0; | |
| 78 | − flags = __arch_local_irq_stnsm(0xf8UL); | |
| 79 | 72 | asm volatile ( |
| 80 | 73 | "0: mvcle %1,%2,0x0\n" |
| 81 | 74 | "1: jo 0b\n" |
| @@ -86,7 +79,23 @@ int memcpy_real(void *dest, void *src, size_t count) · 4 unmodified lines | ||
| 86 | 79 | "+d" (_len2), "=m" (*((long *) dest)) |
| 87 | 80 | : "m" (*((long *) src)) |
| 88 | 81 | : "cc", "memory"); |
| 89 | − arch_local_irq_restore(flags); | |
| 82 | + return rc; | |
| 83 | +} | |
| 84 | + | |
| 85 | +/* | |
| 86 | + * Copy memory in real mode (kernel to kernel) | |
| 87 | + */ | |
| 88 | +int memcpy_real(void *dest, void *src, size_t count) | |
| 89 | +{ | |
| 90 | + unsigned long flags; | |
| 91 | + int rc; | |
| 92 | + | |
| 93 | + if (!count) | |
| 94 | + return 0; | |
| 95 | + local_irq_save(flags); | |
| 96 | + __arch_local_irq_stnsm(0xfbUL); | |
| 97 | + rc = __memcpy_real(dest, src, count); | |
| 98 | + local_irq_restore(flags); | |
| 90 | 99 | return rc; |
| 91 | 100 | } |
| 92 | 101 | |
| @@ -678,8 +678,6 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) · 677 unmodified lines | ||
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | −#ifdef CONFIG_HAVE_RCU_TABLE_FREE | |
| 682 | − | |
| 683 | 681 | static void __page_table_free_rcu(void *table, unsigned bit) |
| 684 | 682 | { |
| 685 | 683 | struct page *page; |
| @@ -733,7 +731,66 @@ void __tlb_remove_table(void *_table) · 47 unmodified lines | ||
| 733 | 731 | free_pages((unsigned long) table, ALLOC_ORDER); |
| 734 | 732 | } |
| 735 | 733 | |
| 736 | −#endif | |
| 734 | +static void tlb_remove_table_smp_sync(void *arg) | |
| 735 | +{ | |
| 736 | + /* Simply deliver the interrupt */ | |
| 737 | +} | |
| 738 | + | |
| 739 | +static void tlb_remove_table_one(void *table) | |
| 740 | +{ | |
| 741 | + /* | |
| 742 | + * This isn't an RCU grace period and hence the page-tables cannot be | |
| 743 | + * assumed to be actually RCU-freed. | |
| 744 | + * | |
| 745 | + * It is however sufficient for software page-table walkers that rely | |
| 746 | + * on IRQ disabling. See the comment near struct mmu_table_batch. | |
| 747 | + */ | |
| 748 | + smp_call_function(tlb_remove_table_smp_sync, NULL, 1); | |
| 749 | + __tlb_remove_table(table); | |
| 750 | +} | |
| 751 | + | |
| 752 | +static void tlb_remove_table_rcu(struct rcu_head *head) | |
| 753 | +{ | |
| 754 | + struct mmu_table_batch *batch; | |
| 755 | + int i; | |
| 756 | + | |
| 757 | + batch = container_of(head, struct mmu_table_batch, rcu); | |
| 758 | + | |
| 759 | + for (i = 0; i < batch->nr; i++) | |
| 760 | + __tlb_remove_table(batch->tables[i]); | |
| 761 | + | |
| 762 | + free_page((unsigned long)batch); | |
| 763 | +} | |
| 764 | + | |
| 765 | +void tlb_table_flush(struct mmu_gather *tlb) | |
| 766 | +{ | |
| 767 | + struct mmu_table_batch **batch = &tlb->batch; | |
| 768 | + | |
| 769 | + if (*batch) { | |
| 770 | + __tlb_flush_mm(tlb->mm); | |
| 771 | + call_rcu_sched(&(*batch)->rcu, tlb_remove_table_rcu); | |
| 772 | + *batch = NULL; | |
| 773 | + } | |
| 774 | +} | |
| 775 | + | |
| 776 | +void tlb_remove_table(struct mmu_gather *tlb, void *table) | |
| 777 | +{ | |
| 778 | + struct mmu_table_batch **batch = &tlb->batch; | |
| 779 | + | |
| 780 | + if (*batch == NULL) { | |
| 781 | + *batch = (struct mmu_table_batch *) | |
| 782 | + __get_free_page(GFP_NOWAIT | __GFP_NOWARN); | |
| 783 | + if (*batch == NULL) { | |
| 784 | + __tlb_flush_mm(tlb->mm); | |
| 785 | + tlb_remove_table_one(table); | |
| 786 | + return; | |
| 787 | + } | |
| 788 | + (*batch)->nr = 0; | |
| 789 | + } | |
| 790 | + (*batch)->tables[(*batch)->nr++] = table; | |
| 791 | + if ((*batch)->nr == MAX_TABLE_BATCH) | |
| 792 | + tlb_table_flush(tlb); | |
| 793 | +} | |
| 737 | 794 | |
| 738 | 795 | /* |
| 739 | 796 | * switch on pgstes for its userspace process (for kvm) |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <linux/types.h> |
| 12 | 12 | #include <asm/cmpxchg.h> |
| 13 | 13 | |
| 14 | −#define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) | |
| 14 | +#define ATOMIC_INIT(i) { (i) } | |
| 15 | 15 | |
| 16 | 16 | #define atomic_read(v) (*(volatile int *)&(v)->counter) |
| 17 | 17 | #define atomic_set(v,i) ((v)->counter = (i)) |
| @@ -86,7 +86,7 @@ static noinline int vmalloc_fault(unsigned long address) · 85 unmodified lines | ||
| 86 | 86 | pte_t *pte_k; |
| 87 | 87 | |
| 88 | 88 | /* Make sure we are in vmalloc/module/P3 area: */ |
| 89 | − if (!(address >= VMALLOC_START && address < P3_ADDR_MAX)) | |
| 89 | + if (!(address >= P3SEG && address < P3_ADDR_MAX)) | |
| 90 | 90 | return -1; |
| 91 | 91 | |
| 92 | 92 | /* |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #include <linux/pm.h> |
| 24 | 24 | #include <linux/delay.h> |
| 25 | 25 | #include <linux/gfp.h> |
| 26 | +#include <linux/cpu.h> | |
| 26 | 27 | |
| 27 | 28 | #include <asm/cacheflush.h> |
| 28 | 29 | #include <asm/tlbflush.h> |
| @@ -78,6 +79,8 @@ void __cpuinit leon_callin(void) · 49 unmodified lines | ||
| 78 | 79 | local_flush_tlb_all(); |
| 79 | 80 | leon_configure_cache_smp(); |
| 80 | 81 | |
| 82 | + notify_cpu_starting(cpuid); | |
| 83 | + | |
| 81 | 84 | /* Get our local ticker going. */ |
| 82 | 85 | smp_setup_percpu_timer(); |
| 83 | 86 | |
| @@ -566,15 +566,10 @@ out: · 565 unmodified lines | ||
| 566 | 566 | |
| 567 | 567 | SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len) |
| 568 | 568 | { |
| 569 | − long ret; | |
| 570 | − | |
| 571 | 569 | if (invalid_64bit_range(addr, len)) |
| 572 | 570 | return -EINVAL; |
| 573 | 571 | |
| 574 | − down_write(¤t->mm->mmap_sem); | |
| 575 | − ret = do_munmap(current->mm, addr, len); | |
| 576 | − up_write(¤t->mm->mmap_sem); | |
| 577 | − return ret; | |
| 572 | + return vm_munmap(addr, len); | |
| 578 | 573 | } |
| 579 | 574 | |
| 580 | 575 | extern unsigned long do_mremap(unsigned long addr, |
| @@ -47,8 +47,8 @@ struct pci_controller { · 46 unmodified lines | ||
| 47 | 47 | */ |
| 48 | 48 | #define PCI_DMA_BUS_IS_PHYS 1 |
| 49 | 49 | |
| 50 | −int __devinit tile_pci_init(void); | |
| 51 | −int __devinit pcibios_init(void); | |
| 50 | +int __init tile_pci_init(void); | |
| 51 | +int __init pcibios_init(void); | |
| 52 | 52 | |
| 53 | 53 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {} |
| 54 | 54 | |
| @@ -141,7 +141,7 @@ static int __devinit tile_init_irqs(int controller_id, · 140 unmodified lines | ||
| 141 | 141 | * |
| 142 | 142 | * Returns the number of controllers discovered. |
| 143 | 143 | */ |
| 144 | −int __devinit tile_pci_init(void) | |
| 144 | +int __init tile_pci_init(void) | |
| 145 | 145 | { |
| 146 | 146 | int i; |
| 147 | 147 | |
| @@ -287,7 +287,7 @@ static void __devinit fixup_read_and_payload_sizes(void) · 139 unmodified lines | ||
| 287 | 287 | * The controllers have been set up by the time we get here, by a call to |
| 288 | 288 | * tile_pci_init. |
| 289 | 289 | */ |
| 290 | −int __devinit pcibios_init(void) | |
| 290 | +int __init pcibios_init(void) | |
| 291 | 291 | { |
| 292 | 292 | int i; |
| 293 | 293 | |
| @@ -346,12 +346,10 @@ void single_step_once(struct pt_regs *regs) · 345 unmodified lines | ||
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /* allocate a cache line of writable, executable memory */ |
| 349 | − down_write(¤t->mm->mmap_sem); | |
| 350 | − buffer = (void __user *) do_mmap(NULL, 0, 64, | |
| 349 | + buffer = (void __user *) vm_mmap(NULL, 0, 64, | |
| 351 | 350 | PROT_EXEC | PROT_READ | PROT_WRITE, |
| 352 | 351 | MAP_PRIVATE | MAP_ANONYMOUS, |
| 353 | 352 | 0); |
| 354 | − up_write(¤t->mm->mmap_sem); | |
| 355 | 353 | |
| 356 | 354 | if (IS_ERR((void __force *)buffer)) { |
| 357 | 355 | kfree(state); |
| @@ -33,6 +33,9 @@ · 32 unmodified lines | ||
| 33 | 33 | __HEAD |
| 34 | 34 | ENTRY(startup_32) |
| 35 | 35 | #ifdef CONFIG_EFI_STUB |
| 36 | + jmp preferred_addr | |
| 37 | + | |
| 38 | + .balign 0x10 | |
| 36 | 39 | /* |
| 37 | 40 | * We don't need the return address, so set up the stack so |
| 38 | 41 | * efi_main() can find its arugments. |
| @@ -41,12 +44,17 @@ ENTRY(startup_32) · 2 unmodified lines | ||
| 41 | 44 | |
| 42 | 45 | call efi_main |
| 43 | 46 | cmpl $0, %eax |
| 44 | − je preferred_addr | |
| 45 | 47 | movl %eax, %esi |
| 46 | − call 1f | |
| 48 | + jne 2f | |
| 47 | 49 | 1: |
| 50 | + /* EFI init failed, so hang. */ | |
| 51 | + hlt | |
| 52 | + jmp 1b | |
| 53 | +2: | |
| 54 | + call 3f | |
| 55 | +3: | |
| 48 | 56 | popl %eax |
| 49 | − subl $1b, %eax | |
| 57 | + subl $3b, %eax | |
| 50 | 58 | subl BP_pref_address(%esi), %eax |
| 51 | 59 | add BP_code32_start(%esi), %eax |
| 52 | 60 | leal preferred_addr(%eax), %eax |
| @@ -200,18 +200,28 @@ ENTRY(startup_64) · 199 unmodified lines | ||
| 200 | 200 | * entire text+data+bss and hopefully all of memory. |
| 201 | 201 | */ |
| 202 | 202 | #ifdef CONFIG_EFI_STUB |
| 203 | − pushq %rsi | |
| 203 | + /* | |
| 204 | + * The entry point for the PE/COFF executable is 0x210, so only | |
| 205 | + * legacy boot loaders will execute this jmp. | |
| 206 | + */ | |
| 207 | + jmp preferred_addr | |
| 208 | + | |
| 209 | + .org 0x210 | |
| 204 | 210 | mov %rcx, %rdi |
| 205 | 211 | mov %rdx, %rsi |
| 206 | 212 | call efi_main |
| 207 | − popq %rsi | |
| 208 | − cmpq $0,%rax | |
| 209 | − je preferred_addr | |
| 210 | 213 | movq %rax,%rsi |
| 211 | − call 1f | |
| 214 | + cmpq $0,%rax | |
| 215 | + jne 2f | |
| 212 | 216 | 1: |
| 217 | + /* EFI init failed, so hang. */ | |
| 218 | + hlt | |
| 219 | + jmp 1b | |
| 220 | +2: | |
| 221 | + call 3f | |
| 222 | +3: | |
| 213 | 223 | popq %rax |
| 214 | − subq $1b, %rax | |
| 224 | + subq $3b, %rax | |
| 215 | 225 | subq BP_pref_address(%rsi), %rax |
| 216 | 226 | add BP_code32_start(%esi), %eax |
| 217 | 227 | leaq preferred_addr(%rax), %rax |
| @@ -205,8 +205,13 @@ int main(int argc, char ** argv) · 204 unmodified lines | ||
| 205 | 205 | put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); |
| 206 | 206 | |
| 207 | 207 | #ifdef CONFIG_X86_32 |
| 208 | − /* Address of entry point */ | |
| 209 | − put_unaligned_le32(i, &buf[pe_header + 0x28]); | |
| 208 | + /* | |
| 209 | + * Address of entry point. | |
| 210 | + * | |
| 211 | + * The EFI stub entry point is +16 bytes from the start of | |
| 212 | + * the .text section. | |
| 213 | + */ | |
| 214 | + put_unaligned_le32(i + 16, &buf[pe_header + 0x28]); | |
| 210 | 215 | |
| 211 | 216 | /* .text size */ |
| 212 | 217 | put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]); |
| @@ -217,9 +222,11 @@ int main(int argc, char ** argv) · 4 unmodified lines | ||
| 217 | 222 | /* |
| 218 | 223 | * Address of entry point. startup_32 is at the beginning and |
| 219 | 224 | * the 64-bit entry point (startup_64) is always 512 bytes |
| 220 | − * after. | |
| 225 | + * after. The EFI stub entry point is 16 bytes after that, as | |
| 226 | + * the first instruction allows legacy loaders to jump over | |
| 227 | + * the EFI stub initialisation | |
| 221 | 228 | */ |
| 222 | − put_unaligned_le32(i + 512, &buf[pe_header + 0x28]); | |
| 229 | + put_unaligned_le32(i + 528, &buf[pe_header + 0x28]); | |
| 223 | 230 | |
| 224 | 231 | /* .text size */ |
| 225 | 232 | put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]); |
| @@ -119,9 +119,7 @@ static void set_brk(unsigned long start, unsigned long end) · 118 unmodified lines | ||
| 119 | 119 | end = PAGE_ALIGN(end); |
| 120 | 120 | if (end <= start) |
| 121 | 121 | return; |
| 122 | − down_write(¤t->mm->mmap_sem); | |
| 123 | − do_brk(start, end - start); | |
| 124 | − up_write(¤t->mm->mmap_sem); | |
| 122 | + vm_brk(start, end - start); | |
| 125 | 123 | } |
| 126 | 124 | |
| 127 | 125 | #ifdef CORE_DUMP |
| @@ -332,9 +330,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 204 unmodified lines | ||
| 332 | 330 | pos = 32; |
| 333 | 331 | map_size = ex.a_text+ex.a_data; |
| 334 | 332 | |
| 335 | − down_write(¤t->mm->mmap_sem); | |
| 336 | − error = do_brk(text_addr & PAGE_MASK, map_size); | |
| 337 | − up_write(¤t->mm->mmap_sem); | |
| 333 | + error = vm_brk(text_addr & PAGE_MASK, map_size); | |
| 338 | 334 | |
| 339 | 335 | if (error != (text_addr & PAGE_MASK)) { |
| 340 | 336 | send_sig(SIGKILL, current, 0); |
| @@ -373,9 +369,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 32 unmodified lines | ||
| 373 | 369 | if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) { |
| 374 | 370 | loff_t pos = fd_offset; |
| 375 | 371 | |
| 376 | − down_write(¤t->mm->mmap_sem); | |
| 377 | − do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data); | |
| 378 | − up_write(¤t->mm->mmap_sem); | |
| 372 | + vm_brk(N_TXTADDR(ex), ex.a_text+ex.a_data); | |
| 379 | 373 | bprm->file->f_op->read(bprm->file, |
| 380 | 374 | (char __user *)N_TXTADDR(ex), |
| 381 | 375 | ex.a_text+ex.a_data, &pos); |
| @@ -385,26 +379,22 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 3 unmodified lines | ||
| 385 | 379 | goto beyond_if; |
| 386 | 380 | } |
| 387 | 381 | |
| 388 | − down_write(¤t->mm->mmap_sem); | |
| 389 | − error = do_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, | |
| 382 | + error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, | |
| 390 | 383 | PROT_READ | PROT_EXEC, |
| 391 | 384 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | |
| 392 | 385 | MAP_EXECUTABLE | MAP_32BIT, |
| 393 | 386 | fd_offset); |
| 394 | − up_write(¤t->mm->mmap_sem); | |
| 395 | 387 | |
| 396 | 388 | if (error != N_TXTADDR(ex)) { |
| 397 | 389 | send_sig(SIGKILL, current, 0); |
| 398 | 390 | return error; |
| 399 | 391 | } |
| 400 | 392 | |
| 401 | − down_write(¤t->mm->mmap_sem); | |
| 402 | − error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data, | |
| 393 | + error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data, | |
| 403 | 394 | PROT_READ | PROT_WRITE | PROT_EXEC, |
| 404 | 395 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | |
| 405 | 396 | MAP_EXECUTABLE | MAP_32BIT, |
| 406 | 397 | fd_offset + ex.a_text); |
| 407 | − up_write(¤t->mm->mmap_sem); | |
| 408 | 398 | if (error != N_DATADDR(ex)) { |
| 409 | 399 | send_sig(SIGKILL, current, 0); |
| 410 | 400 | return error; |
| @@ -476,9 +466,7 @@ static int load_aout_library(struct file *file) · 65 unmodified lines | ||
| 476 | 466 | error_time = jiffies; |
| 477 | 467 | } |
| 478 | 468 | #endif |
| 479 | − down_write(¤t->mm->mmap_sem); | |
| 480 | − do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); | |
| 481 | − up_write(¤t->mm->mmap_sem); | |
| 469 | + vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); | |
| 482 | 470 | |
| 483 | 471 | file->f_op->read(file, (char __user *)start_addr, |
| 484 | 472 | ex.a_text + ex.a_data, &pos); |
| @@ -490,12 +478,10 @@ static int load_aout_library(struct file *file) · 5 unmodified lines | ||
| 490 | 478 | goto out; |
| 491 | 479 | } |
| 492 | 480 | /* Now use mmap to map the library into memory. */ |
| 493 | − down_write(¤t->mm->mmap_sem); | |
| 494 | − error = do_mmap(file, start_addr, ex.a_text + ex.a_data, | |
| 481 | + error = vm_mmap(file, start_addr, ex.a_text + ex.a_data, | |
| 495 | 482 | PROT_READ | PROT_WRITE | PROT_EXEC, |
| 496 | 483 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_32BIT, |
| 497 | 484 | N_TXTOFF(ex)); |
| 498 | − up_write(¤t->mm->mmap_sem); | |
| 499 | 485 | retval = error; |
| 500 | 486 | if (error != start_addr) |
| 501 | 487 | goto out; |
| @@ -503,9 +489,7 @@ static int load_aout_library(struct file *file) · 1 unmodified line | ||
| 503 | 489 | len = PAGE_ALIGN(ex.a_text + ex.a_data); |
| 504 | 490 | bss = ex.a_text + ex.a_data + ex.a_bss; |
| 505 | 491 | if (bss > len) { |
| 506 | − down_write(¤t->mm->mmap_sem); | |
| 507 | − error = do_brk(start_addr + len, bss - len); | |
| 508 | − up_write(¤t->mm->mmap_sem); | |
| 492 | + error = vm_brk(start_addr + len, bss - len); | |
| 509 | 493 | retval = error; |
| 510 | 494 | if (error != start_addr + len) |
| 511 | 495 | goto out; |
| @@ -7,9 +7,9 @@ · 6 unmodified lines | ||
| 7 | 7 | #else |
| 8 | 8 | # ifdef __i386__ |
| 9 | 9 | # include "posix_types_32.h" |
| 10 | −# elif defined(__LP64__) | |
| 11 | −# include "posix_types_64.h" | |
| 12 | −# else | |
| 10 | +# elif defined(__ILP32__) | |
| 13 | 11 | # include "posix_types_x32.h" |
| 12 | +# else | |
| 13 | +# include "posix_types_64.h" | |
| 14 | 14 | # endif |
| 15 | 15 | #endif |
| @@ -257,7 +257,7 @@ struct sigcontext { · 256 unmodified lines | ||
| 257 | 257 | __u64 oldmask; |
| 258 | 258 | __u64 cr2; |
| 259 | 259 | struct _fpstate __user *fpstate; /* zero when no FPU context */ |
| 260 | −#ifndef __LP64__ | |
| 260 | +#ifdef __ILP32__ | |
| 261 | 261 | __u32 __fpstate_pad; |
| 262 | 262 | #endif |
| 263 | 263 | __u64 reserved1[8]; |
| @@ -2,7 +2,13 @@ · 1 unmodified line | ||
| 2 | 2 | #define _ASM_X86_SIGINFO_H |
| 3 | 3 | |
| 4 | 4 | #ifdef __x86_64__ |
| 5 | −# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | |
| 5 | +# ifdef __ILP32__ /* x32 */ | |
| 6 | +typedef long long __kernel_si_clock_t __attribute__((aligned(4))); | |
| 7 | +# define __ARCH_SI_CLOCK_T __kernel_si_clock_t | |
| 8 | +# define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8))) | |
| 9 | +# else /* x86-64 */ | |
| 10 | +# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | |
| 11 | +# endif | |
| 6 | 12 | #endif |
| 7 | 13 | |
| 8 | 14 | #include <asm-generic/siginfo.h> |
| @@ -63,10 +63,10 @@ · 62 unmodified lines | ||
| 63 | 63 | #else |
| 64 | 64 | # ifdef __i386__ |
| 65 | 65 | # include <asm/unistd_32.h> |
| 66 | −# elif defined(__LP64__) | |
| 67 | −# include <asm/unistd_64.h> | |
| 68 | −# else | |
| 66 | +# elif defined(__ILP32__) | |
| 69 | 67 | # include <asm/unistd_x32.h> |
| 68 | +# else | |
| 69 | +# include <asm/unistd_64.h> | |
| 70 | 70 | # endif |
| 71 | 71 | #endif |
| 72 | 72 | |
| @@ -195,6 +195,5 @@ extern struct x86_msi_ops x86_msi; · 194 unmodified lines | ||
| 195 | 195 | |
| 196 | 196 | extern void x86_init_noop(void); |
| 197 | 197 | extern void x86_init_uint_noop(unsigned int unused); |
| 198 | −extern void x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node); | |
| 199 | 198 | |
| 200 | 199 | #endif |
| @@ -24,6 +24,10 @@ unsigned long acpi_realmode_flags; · 23 unmodified lines | ||
| 24 | 24 | static char temp_stack[4096]; |
| 25 | 25 | #endif |
| 26 | 26 | |
| 27 | +asmlinkage void acpi_enter_s3(void) | |
| 28 | +{ | |
| 29 | + acpi_enter_sleep_state(3, wake_sleep_flags); | |
| 30 | +} | |
| 27 | 31 | /** |
| 28 | 32 | * acpi_suspend_lowlevel - save kernel state |
| 29 | 33 | * |
| @@ -3,12 +3,16 @@ · 2 unmodified lines | ||
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | 5 | #include <asm/trampoline.h> |
| 6 | +#include <linux/linkage.h> | |
| 6 | 7 | |
| 7 | 8 | extern unsigned long saved_video_mode; |
| 8 | 9 | extern long saved_magic; |
| 9 | 10 | |
| 10 | 11 | extern int wakeup_pmode_return; |
| 11 | 12 | |
| 13 | +extern u8 wake_sleep_flags; | |
| 14 | +extern asmlinkage void acpi_enter_s3(void); | |
| 15 | + | |
| 12 | 16 | extern unsigned long acpi_copy_wakeup_routine(unsigned long); |
| 13 | 17 | extern void wakeup_long64(void); |
| 14 | 18 | |
| @@ -74,9 +74,7 @@ restore_registers: · 73 unmodified lines | ||
| 74 | 74 | ENTRY(do_suspend_lowlevel) |
| 75 | 75 | call save_processor_state |
| 76 | 76 | call save_registers |
| 77 | − pushl $3 | |
| 78 | − call acpi_enter_sleep_state | |
| 79 | − addl $4, %esp | |
| 77 | + call acpi_enter_s3 | |
| 80 | 78 | |
| 81 | 79 | # In case of S3 failure, we'll emerge here. Jump |
| 82 | 80 | # to ret_point to recover |
| @@ -71,9 +71,7 @@ ENTRY(do_suspend_lowlevel) · 70 unmodified lines | ||
| 71 | 71 | movq %rsi, saved_rsi |
| 72 | 72 | |
| 73 | 73 | addq $8, %rsp |
| 74 | − movl $3, %edi | |
| 75 | − xorl %eax, %eax | |
| 76 | − call acpi_enter_sleep_state | |
| 74 | + call acpi_enter_s3 | |
| 77 | 75 | /* in case something went wrong, restore the machine status and go on */ |
| 78 | 76 | jmp resume_point |
| 79 | 77 | |
| @@ -1637,9 +1637,11 @@ static int __init apic_verify(void) · 1636 unmodified lines | ||
| 1637 | 1637 | mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; |
| 1638 | 1638 | |
| 1639 | 1639 | /* The BIOS may have set up the APIC at some other address */ |
| 1640 | − rdmsr(MSR_IA32_APICBASE, l, h); | |
| 1641 | − if (l & MSR_IA32_APICBASE_ENABLE) | |
| 1642 | − mp_lapic_addr = l & MSR_IA32_APICBASE_BASE; | |
| 1640 | + if (boot_cpu_data.x86 >= 6) { | |
| 1641 | + rdmsr(MSR_IA32_APICBASE, l, h); | |
| 1642 | + if (l & MSR_IA32_APICBASE_ENABLE) | |
| 1643 | + mp_lapic_addr = l & MSR_IA32_APICBASE_BASE; | |
| 1644 | + } | |
| 1643 | 1645 | |
| 1644 | 1646 | pr_info("Found and enabled local APIC!\n"); |
| 1645 | 1647 | return 0; |
| @@ -1657,13 +1659,15 @@ int __init apic_force_enable(unsigned long addr) · 11 unmodified lines | ||
| 1657 | 1659 | * MSR. This can only be done in software for Intel P6 or later |
| 1658 | 1660 | * and AMD K7 (Model > 1) or later. |
| 1659 | 1661 | */ |
| 1660 | − rdmsr(MSR_IA32_APICBASE, l, h); | |
| 1661 | − if (!(l & MSR_IA32_APICBASE_ENABLE)) { | |
| 1662 | − pr_info("Local APIC disabled by BIOS -- reenabling.\n"); | |
| 1663 | − l &= ~MSR_IA32_APICBASE_BASE; | |
| 1664 | − l |= MSR_IA32_APICBASE_ENABLE | addr; | |
| 1665 | − wrmsr(MSR_IA32_APICBASE, l, h); | |
| 1666 | − enabled_via_apicbase = 1; | |
| 1662 | + if (boot_cpu_data.x86 >= 6) { | |
| 1663 | + rdmsr(MSR_IA32_APICBASE, l, h); | |
| 1664 | + if (!(l & MSR_IA32_APICBASE_ENABLE)) { | |
| 1665 | + pr_info("Local APIC disabled by BIOS -- reenabling.\n"); | |
| 1666 | + l &= ~MSR_IA32_APICBASE_BASE; | |
| 1667 | + l |= MSR_IA32_APICBASE_ENABLE | addr; | |
| 1668 | + wrmsr(MSR_IA32_APICBASE, l, h); | |
| 1669 | + enabled_via_apicbase = 1; | |
| 1670 | + } | |
| 1667 | 1671 | } |
| 1668 | 1672 | return apic_verify(); |
| 1669 | 1673 | } |
| @@ -2209,10 +2213,12 @@ static void lapic_resume(void) · 539 unmodified lines | ||
| 2209 | 2213 | * FIXME! This will be wrong if we ever support suspend on |
| 2210 | 2214 | * SMP! We'll need to do this as part of the CPU restore! |
| 2211 | 2215 | */ |
| 2212 | − rdmsr(MSR_IA32_APICBASE, l, h); | |
| 2213 | − l &= ~MSR_IA32_APICBASE_BASE; | |
| 2214 | − l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; | |
| 2215 | − wrmsr(MSR_IA32_APICBASE, l, h); | |
| 2216 | + if (boot_cpu_data.x86 >= 6) { | |
| 2217 | + rdmsr(MSR_IA32_APICBASE, l, h); | |
| 2218 | + l &= ~MSR_IA32_APICBASE_BASE; | |
| 2219 | + l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; | |
| 2220 | + wrmsr(MSR_IA32_APICBASE, l, h); | |
| 2221 | + } | |
| 2216 | 2222 | } |
| 2217 | 2223 | |
| 2218 | 2224 | maxlvt = lapic_get_maxlvt(); |
| @@ -207,8 +207,11 @@ static void __init map_csrs(void) · 206 unmodified lines | ||
| 207 | 207 | |
| 208 | 208 | static void fixup_cpu_id(struct cpuinfo_x86 *c, int node) |
| 209 | 209 | { |
| 210 | − c->phys_proc_id = node; | |
| 211 | − per_cpu(cpu_llc_id, smp_processor_id()) = node; | |
| 210 | + | |
| 211 | + if (c->phys_proc_id != node) { | |
| 212 | + c->phys_proc_id = node; | |
| 213 | + per_cpu(cpu_llc_id, smp_processor_id()) = node; | |
| 214 | + } | |
| 212 | 215 | } |
| 213 | 216 | |
| 214 | 217 | static int __init numachip_system_init(void) |
| @@ -24,6 +24,12 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) · 23 unmodified lines | ||
| 24 | 24 | { |
| 25 | 25 | if (x2apic_phys) |
| 26 | 26 | return x2apic_enabled(); |
| 27 | + else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) && | |
| 28 | + (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) && | |
| 29 | + x2apic_enabled()) { | |
| 30 | + printk(KERN_DEBUG "System requires x2apic physical mode\n"); | |
| 31 | + return 1; | |
| 32 | + } | |
| 27 | 33 | else |
| 28 | 34 | return 0; |
| 29 | 35 | } |
| @@ -26,7 +26,8 @@ · 25 unmodified lines | ||
| 26 | 26 | * contact AMD for precise details and a CPU swap. |
| 27 | 27 | * |
| 28 | 28 | * See http://www.multimania.com/poulot/k6bug.html |
| 29 | − * http://www.amd.com/K6/k6docs/revgd.html | |
| 29 | + * and section 2.6.2 of "AMD-K6 Processor Revision Guide - Model 6" | |
| 30 | + * (Publication # 21266 Issue Date: August 1998) | |
| 30 | 31 | * |
| 31 | 32 | * The following test is erm.. interesting. AMD neglected to up |
| 32 | 33 | * the chip setting when fixing the bug but they also tweaked some |
| @@ -94,7 +95,6 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c) · 61 unmodified lines | ||
| 94 | 95 | "system stability may be impaired when more than 32 MB are used.\n"); |
| 95 | 96 | else |
| 96 | 97 | printk(KERN_CONT "probably OK (after B9730xxxx).\n"); |
| 97 | − printk(KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n"); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /* K6 with old style WHCR */ |
| @@ -353,10 +353,11 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) · 252 unmodified lines | ||
| 353 | 353 | node = per_cpu(cpu_llc_id, cpu); |
| 354 | 354 | |
| 355 | 355 | /* |
| 356 | − * If core numbers are inconsistent, it's likely a multi-fabric platform, | |
| 357 | − * so invoke platform-specific handler | |
| 356 | + * On multi-fabric platform (e.g. Numascale NumaChip) a | |
| 357 | + * platform-specific handler needs to be called to fixup some | |
| 358 | + * IDs of the CPU. | |
| 358 | 359 | */ |
| 359 | − if (c->phys_proc_id != node) | |
| 360 | + if (x86_cpuinit.fixup_cpu_id) | |
| 360 | 361 | x86_cpuinit.fixup_cpu_id(c, node); |
| 361 | 362 | |
| 362 | 363 | if (!node_online(node)) { |
| @@ -1162,15 +1162,6 @@ static void dbg_restore_debug_regs(void) · 1161 unmodified lines | ||
| 1162 | 1162 | #define dbg_restore_debug_regs() |
| 1163 | 1163 | #endif /* ! CONFIG_KGDB */ |
| 1164 | 1164 | |
| 1165 | −/* | |
| 1166 | − * Prints an error where the NUMA and configured core-number mismatch and the | |
| 1167 | − * platform didn't override this to fix it up | |
| 1168 | − */ | |
| 1169 | −void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node) | |
| 1170 | −{ | |
| 1171 | − pr_err("NUMA core number %d differs from configured core number %d\n", node, c->phys_proc_id); | |
| 1172 | −} | |
| 1173 | − | |
| 1174 | 1165 | /* |
| 1175 | 1166 | * cpu_init() initializes state that is per-CPU. Some data is already |
| 1176 | 1167 | * initialized (naturally) in the bootstrap process, such as the GDT |
| @@ -433,14 +433,14 @@ int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot, · 432 unmodified lines | ||
| 433 | 433 | /* check if @slot is already used or the index is already disabled */ |
| 434 | 434 | ret = amd_get_l3_disable_slot(nb, slot); |
| 435 | 435 | if (ret >= 0) |
| 436 | − return -EINVAL; | |
| 436 | + return -EEXIST; | |
| 437 | 437 | |
| 438 | 438 | if (index > nb->l3_cache.indices) |
| 439 | 439 | return -EINVAL; |
| 440 | 440 | |
| 441 | 441 | /* check whether the other slot has disabled the same index already */ |
| 442 | 442 | if (index == amd_get_l3_disable_slot(nb, !slot)) |
| 443 | − return -EINVAL; | |
| 443 | + return -EEXIST; | |
| 444 | 444 | |
| 445 | 445 | amd_l3_disable_index(nb, cpu, slot, index); |
| 446 | 446 | |
| @@ -468,8 +468,8 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf, · 21 unmodified lines | ||
| 468 | 468 | err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val); |
| 469 | 469 | if (err) { |
| 470 | 470 | if (err == -EEXIST) |
| 471 | − printk(KERN_WARNING "L3 disable slot %d in use!\n", | |
| 472 | − slot); | |
| 471 | + pr_warning("L3 slot %d in use/index already disabled!\n", | |
| 472 | + slot); | |
| 473 | 473 | return err; |
| 474 | 474 | } |
| 475 | 475 | return count; |
| @@ -235,6 +235,7 @@ int init_fpu(struct task_struct *tsk) · 234 unmodified lines | ||
| 235 | 235 | if (tsk_used_math(tsk)) { |
| 236 | 236 | if (HAVE_HWFP && tsk == current) |
| 237 | 237 | unlazy_fpu(tsk); |
| 238 | + tsk->thread.fpu.last_cpu = ~0; | |
| 238 | 239 | return 0; |
| 239 | 240 | } |
| 240 | 241 | |
| @@ -82,11 +82,6 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) · 81 unmodified lines | ||
| 82 | 82 | { |
| 83 | 83 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
| 84 | 84 | |
| 85 | − if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { | |
| 86 | − pr_warning("CPU%d: family %d not supported\n", cpu, c->x86); | |
| 87 | − return -1; | |
| 88 | − } | |
| 89 | − | |
| 90 | 85 | csig->rev = c->microcode; |
| 91 | 86 | pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev); |
| 92 | 87 | |
| @@ -380,6 +375,13 @@ static struct microcode_ops microcode_amd_ops = { · 287 unmodified lines | ||
| 380 | 375 | |
| 381 | 376 | struct microcode_ops * __init init_amd_microcode(void) |
| 382 | 377 | { |
| 378 | + struct cpuinfo_x86 *c = &cpu_data(0); | |
| 379 | + | |
| 380 | + if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { | |
| 381 | + pr_warning("AMD CPU family 0x%x not supported\n", c->x86); | |
| 382 | + return NULL; | |
| 383 | + } | |
| 384 | + | |
| 383 | 385 | patch = (void *)get_zeroed_page(GFP_KERNEL); |
| 384 | 386 | if (!patch) |
| 385 | 387 | return NULL; |
| @@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif) · 418 unmodified lines | ||
| 419 | 419 | if (err) |
| 420 | 420 | return err; |
| 421 | 421 | |
| 422 | − if (microcode_init_cpu(cpu) == UCODE_ERROR) { | |
| 423 | − sysfs_remove_group(&dev->kobj, &mc_attr_group); | |
| 422 | + if (microcode_init_cpu(cpu) == UCODE_ERROR) | |
| 424 | 423 | return -EINVAL; |
| 425 | − } | |
| 426 | 424 | |
| 427 | 425 | return err; |
| 428 | 426 | } |
| @@ -528,11 +526,11 @@ static int __init microcode_init(void) · 99 unmodified lines | ||
| 528 | 526 | microcode_ops = init_intel_microcode(); |
| 529 | 527 | else if (c->x86_vendor == X86_VENDOR_AMD) |
| 530 | 528 | microcode_ops = init_amd_microcode(); |
| 531 | − | |
| 532 | − if (!microcode_ops) { | |
| 529 | + else | |
| 533 | 530 | pr_err("no support for this CPU vendor\n"); |
| 531 | + | |
| 532 | + if (!microcode_ops) | |
| 534 | 533 | return -ENODEV; |
| 535 | − } | |
| 536 | 534 | |
| 537 | 535 | microcode_pdev = platform_device_register_simple("microcode", -1, |
| 538 | 536 | NULL, 0); |
| @@ -93,7 +93,6 @@ struct x86_init_ops x86_init __initdata = { · 92 unmodified lines | ||
| 93 | 93 | struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { |
| 94 | 94 | .early_percpu_clock_init = x86_init_noop, |
| 95 | 95 | .setup_percpu_clockev = setup_secondary_APIC_clock, |
| 96 | − .fixup_cpu_id = x86_default_fixup_cpu_id, | |
| 97 | 96 | }; |
| 98 | 97 | |
| 99 | 98 | static void default_nmi_init(void) { }; |
| @@ -459,17 +459,17 @@ void kvm_pmu_cpuid_update(struct kvm_vcpu *vcpu) · 458 unmodified lines | ||
| 459 | 459 | pmu->available_event_types = ~entry->ebx & ((1ull << bitmap_len) - 1); |
| 460 | 460 | |
| 461 | 461 | if (pmu->version == 1) { |
| 462 | − pmu->global_ctrl = (1 << pmu->nr_arch_gp_counters) - 1; | |
| 463 | − return; | |
| 462 | + pmu->nr_arch_fixed_counters = 0; | |
| 463 | + } else { | |
| 464 | + pmu->nr_arch_fixed_counters = min((int)(entry->edx & 0x1f), | |
| 465 | + X86_PMC_MAX_FIXED); | |
| 466 | + pmu->counter_bitmask[KVM_PMC_FIXED] = | |
| 467 | + ((u64)1 << ((entry->edx >> 5) & 0xff)) - 1; | |
| 464 | 468 | } |
| 465 | 469 | |
| 466 | − pmu->nr_arch_fixed_counters = min((int)(entry->edx & 0x1f), | |
| 467 | − X86_PMC_MAX_FIXED); | |
| 468 | − pmu->counter_bitmask[KVM_PMC_FIXED] = | |
| 469 | − ((u64)1 << ((entry->edx >> 5) & 0xff)) - 1; | |
| 470 | − pmu->global_ctrl_mask = ~(((1 << pmu->nr_arch_gp_counters) - 1) | |
| 471 | − | (((1ull << pmu->nr_arch_fixed_counters) - 1) | |
| 472 | − << X86_PMC_IDX_FIXED)); | |
| 470 | + pmu->global_ctrl = ((1 << pmu->nr_arch_gp_counters) - 1) | | |
| 471 | + (((1ull << pmu->nr_arch_fixed_counters) - 1) << X86_PMC_IDX_FIXED); | |
| 472 | + pmu->global_ctrl_mask = ~pmu->global_ctrl; | |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | void kvm_pmu_init(struct kvm_vcpu *vcpu) |
| @@ -2210,9 +2210,12 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) · 2209 unmodified lines | ||
| 2210 | 2210 | msr = find_msr_entry(vmx, msr_index); |
| 2211 | 2211 | if (msr) { |
| 2212 | 2212 | msr->data = data; |
| 2213 | − if (msr - vmx->guest_msrs < vmx->save_nmsrs) | |
| 2213 | + if (msr - vmx->guest_msrs < vmx->save_nmsrs) { | |
| 2214 | + preempt_disable(); | |
| 2214 | 2215 | kvm_set_shared_msr(msr->index, msr->data, |
| 2215 | 2216 | msr->mask); |
| 2217 | + preempt_enable(); | |
| 2218 | + } | |
| 2216 | 2219 | break; |
| 2217 | 2220 | } |
| 2218 | 2221 | ret = kvm_set_msr_common(vcpu, msr_index, data); |
| @@ -6336,13 +6336,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, · 6335 unmodified lines | ||
| 6336 | 6336 | if (npages && !old.rmap) { |
| 6337 | 6337 | unsigned long userspace_addr; |
| 6338 | 6338 | |
| 6339 | − down_write(¤t->mm->mmap_sem); | |
| 6340 | − userspace_addr = do_mmap(NULL, 0, | |
| 6339 | + userspace_addr = vm_mmap(NULL, 0, | |
| 6341 | 6340 | npages * PAGE_SIZE, |
| 6342 | 6341 | PROT_READ | PROT_WRITE, |
| 6343 | 6342 | map_flags, |
| 6344 | 6343 | 0); |
| 6345 | − up_write(¤t->mm->mmap_sem); | |
| 6346 | 6344 | |
| 6347 | 6345 | if (IS_ERR((void *)userspace_addr)) |
| 6348 | 6346 | return PTR_ERR((void *)userspace_addr); |
| @@ -6366,10 +6364,8 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, · 17 unmodified lines | ||
| 6366 | 6364 | if (!user_alloc && !old.user_alloc && old.rmap && !npages) { |
| 6367 | 6365 | int ret; |
| 6368 | 6366 | |
| 6369 | − down_write(¤t->mm->mmap_sem); | |
| 6370 | − ret = do_munmap(current->mm, old.userspace_addr, | |
| 6367 | + ret = vm_munmap(old.userspace_addr, | |
| 6371 | 6368 | old.npages * PAGE_SIZE); |
| 6372 | − up_write(¤t->mm->mmap_sem); | |
| 6373 | 6369 | if (ret < 0) |
| 6374 | 6370 | printk(KERN_WARNING |
| 6375 | 6371 | "kvm_vm_ioctl_set_memory_region: " |
| @@ -379,8 +379,8 @@ err_out: · 378 unmodified lines | ||
| 379 | 379 | return; |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | −/* Decode moffset16/32/64 */ | |
| 383 | −static void __get_moffset(struct insn *insn) | |
| 382 | +/* Decode moffset16/32/64. Return 0 if failed */ | |
| 383 | +static int __get_moffset(struct insn *insn) | |
| 384 | 384 | { |
| 385 | 385 | switch (insn->addr_bytes) { |
| 386 | 386 | case 2: |
| @@ -397,15 +397,19 @@ static void __get_moffset(struct insn *insn) · 10 unmodified lines | ||
| 397 | 397 | insn->moffset2.value = get_next(int, insn); |
| 398 | 398 | insn->moffset2.nbytes = 4; |
| 399 | 399 | break; |
| 400 | + default: /* opnd_bytes must be modified manually */ | |
| 401 | + goto err_out; | |
| 400 | 402 | } |
| 401 | 403 | insn->moffset1.got = insn->moffset2.got = 1; |
| 402 | 404 | |
| 405 | + return 1; | |
| 406 | + | |
| 403 | 407 | err_out: |
| 404 | − return; | |
| 408 | + return 0; | |
| 405 | 409 | } |
| 406 | 410 | |
| 407 | −/* Decode imm v32(Iz) */ | |
| 408 | −static void __get_immv32(struct insn *insn) | |
| 411 | +/* Decode imm v32(Iz). Return 0 if failed */ | |
| 412 | +static int __get_immv32(struct insn *insn) | |
| 409 | 413 | { |
| 410 | 414 | switch (insn->opnd_bytes) { |
| 411 | 415 | case 2: |
| @@ -417,14 +421,18 @@ static void __get_immv32(struct insn *insn) · 5 unmodified lines | ||
| 417 | 421 | insn->immediate.value = get_next(int, insn); |
| 418 | 422 | insn->immediate.nbytes = 4; |
| 419 | 423 | break; |
| 424 | + default: /* opnd_bytes must be modified manually */ | |
| 425 | + goto err_out; | |
| 420 | 426 | } |
| 421 | 427 | |
| 428 | + return 1; | |
| 429 | + | |
| 422 | 430 | err_out: |
| 423 | − return; | |
| 431 | + return 0; | |
| 424 | 432 | } |
| 425 | 433 | |
| 426 | −/* Decode imm v64(Iv/Ov) */ | |
| 427 | −static void __get_immv(struct insn *insn) | |
| 434 | +/* Decode imm v64(Iv/Ov), Return 0 if failed */ | |
| 435 | +static int __get_immv(struct insn *insn) | |
| 428 | 436 | { |
| 429 | 437 | switch (insn->opnd_bytes) { |
| 430 | 438 | case 2: |
| @@ -441,15 +449,18 @@ static void __get_immv(struct insn *insn) · 10 unmodified lines | ||
| 441 | 449 | insn->immediate2.value = get_next(int, insn); |
| 442 | 450 | insn->immediate2.nbytes = 4; |
| 443 | 451 | break; |
| 452 | + default: /* opnd_bytes must be modified manually */ | |
| 453 | + goto err_out; | |
| 444 | 454 | } |
| 445 | 455 | insn->immediate1.got = insn->immediate2.got = 1; |
| 446 | 456 | |
| 457 | + return 1; | |
| 447 | 458 | err_out: |
| 448 | − return; | |
| 459 | + return 0; | |
| 449 | 460 | } |
| 450 | 461 | |
| 451 | 462 | /* Decode ptr16:16/32(Ap) */ |
| 452 | −static void __get_immptr(struct insn *insn) | |
| 463 | +static int __get_immptr(struct insn *insn) | |
| 453 | 464 | { |
| 454 | 465 | switch (insn->opnd_bytes) { |
| 455 | 466 | case 2: |
| @@ -462,14 +473,17 @@ static void __get_immptr(struct insn *insn) · 6 unmodified lines | ||
| 462 | 473 | break; |
| 463 | 474 | case 8: |
| 464 | 475 | /* ptr16:64 is not exist (no segment) */ |
| 465 | − return; | |
| 476 | + return 0; | |
| 477 | + default: /* opnd_bytes must be modified manually */ | |
| 478 | + goto err_out; | |
| 466 | 479 | } |
| 467 | 480 | insn->immediate2.value = get_next(unsigned short, insn); |
| 468 | 481 | insn->immediate2.nbytes = 2; |
| 469 | 482 | insn->immediate1.got = insn->immediate2.got = 1; |
| 470 | 483 | |
| 484 | + return 1; | |
| 471 | 485 | err_out: |
| 472 | − return; | |
| 486 | + return 0; | |
| 473 | 487 | } |
| 474 | 488 | |
| 475 | 489 | /** |
| @@ -489,7 +503,8 @@ void insn_get_immediate(struct insn *insn) · 13 unmodified lines | ||
| 489 | 503 | insn_get_displacement(insn); |
| 490 | 504 | |
| 491 | 505 | if (inat_has_moffset(insn->attr)) { |
| 492 | − __get_moffset(insn); | |
| 506 | + if (!__get_moffset(insn)) | |
| 507 | + goto err_out; | |
| 493 | 508 | goto done; |
| 494 | 509 | } |
| 495 | 510 | |
| @@ -517,16 +532,20 @@ void insn_get_immediate(struct insn *insn) · 21 unmodified lines | ||
| 517 | 532 | insn->immediate2.nbytes = 4; |
| 518 | 533 | break; |
| 519 | 534 | case INAT_IMM_PTR: |
| 520 | − __get_immptr(insn); | |
| 535 | + if (!__get_immptr(insn)) | |
| 536 | + goto err_out; | |
| 521 | 537 | break; |
| 522 | 538 | case INAT_IMM_VWORD32: |
| 523 | − __get_immv32(insn); | |
| 539 | + if (!__get_immv32(insn)) | |
| 540 | + goto err_out; | |
| 524 | 541 | break; |
| 525 | 542 | case INAT_IMM_VWORD: |
| 526 | − __get_immv(insn); | |
| 543 | + if (!__get_immv(insn)) | |
| 544 | + goto err_out; | |
| 527 | 545 | break; |
| 528 | 546 | default: |
| 529 | − break; | |
| 547 | + /* Here, insn must have an immediate, but failed */ | |
| 548 | + goto err_out; | |
| 530 | 549 | } |
| 531 | 550 | if (inat_has_second_immediate(insn->attr)) { |
| 532 | 551 | insn->immediate2.value = get_next(char, insn); |
| @@ -805,7 +805,7 @@ void intel_scu_devices_create(void) · 804 unmodified lines | ||
| 805 | 805 | } else |
| 806 | 806 | i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1); |
| 807 | 807 | } |
| 808 | − intel_scu_notifier_post(SCU_AVAILABLE, 0L); | |
| 808 | + intel_scu_notifier_post(SCU_AVAILABLE, NULL); | |
| 809 | 809 | } |
| 810 | 810 | EXPORT_SYMBOL_GPL(intel_scu_devices_create); |
| 811 | 811 | |
| @@ -814,7 +814,7 @@ void intel_scu_devices_destroy(void) · 2 unmodified lines | ||
| 814 | 814 | { |
| 815 | 815 | int i; |
| 816 | 816 | |
| 817 | − intel_scu_notifier_post(SCU_DOWN, 0L); | |
| 817 | + intel_scu_notifier_post(SCU_DOWN, NULL); | |
| 818 | 818 | |
| 819 | 819 | for (i = 0; i < ipc_next_dev; i++) |
| 820 | 820 | platform_device_del(ipc_devs[i]); |
| @@ -261,7 +261,8 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, · 260 unmodified lines | ||
| 261 | 261 | |
| 262 | 262 | static bool __init xen_check_mwait(void) |
| 263 | 263 | { |
| 264 | −#ifdef CONFIG_ACPI | |
| 264 | +#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && \ | |
| 265 | + !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE) | |
| 265 | 266 | struct xen_platform_op op = { |
| 266 | 267 | .cmd = XENPF_set_processor_pminfo, |
| 267 | 268 | .u.set_pminfo.id = -1, |
| @@ -349,7 +350,6 @@ static void __init xen_init_cpuid_mask(void) · 81 unmodified lines | ||
| 349 | 350 | /* Xen will set CR4.OSXSAVE if supported and not disabled by force */ |
| 350 | 351 | if ((cx & xsave_mask) != xsave_mask) |
| 351 | 352 | cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */ |
| 352 | − | |
| 353 | 353 | if (xen_check_mwait()) |
| 354 | 354 | cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32)); |
| 355 | 355 | } |
| @@ -178,6 +178,7 @@ static void __init xen_fill_possible_map(void) · 177 unmodified lines | ||
| 178 | 178 | static void __init xen_filter_cpu_maps(void) |
| 179 | 179 | { |
| 180 | 180 | int i, rc; |
| 181 | + unsigned int subtract = 0; | |
| 181 | 182 | |
| 182 | 183 | if (!xen_initial_domain()) |
| 183 | 184 | return; |
| @@ -192,8 +193,22 @@ static void __init xen_filter_cpu_maps(void) · 8 unmodified lines | ||
| 192 | 193 | } else { |
| 193 | 194 | set_cpu_possible(i, false); |
| 194 | 195 | set_cpu_present(i, false); |
| 196 | + subtract++; | |
| 195 | 197 | } |
| 196 | 198 | } |
| 199 | +#ifdef CONFIG_HOTPLUG_CPU | |
| 200 | + /* This is akin to using 'nr_cpus' on the Linux command line. | |
| 201 | + * Which is OK as when we use 'dom0_max_vcpus=X' we can only | |
| 202 | + * have up to X, while nr_cpu_ids is greater than X. This | |
| 203 | + * normally is not a problem, except when CPU hotplugging | |
| 204 | + * is involved and then there might be more than X CPUs | |
| 205 | + * in the guest - which will not work as there is no | |
| 206 | + * hypercall to expand the max number of VCPUs an already | |
| 207 | + * running guest has. So cap it up to X. */ | |
| 208 | + if (subtract) | |
| 209 | + nr_cpu_ids = nr_cpu_ids - subtract; | |
| 210 | +#endif | |
| 211 | + | |
| 197 | 212 | } |
| 198 | 213 | |
| 199 | 214 | static void __init xen_smp_prepare_boot_cpu(void) |
| @@ -96,7 +96,7 @@ ENTRY(xen_restore_fl_direct) · 95 unmodified lines | ||
| 96 | 96 | |
| 97 | 97 | /* check for unmasked and pending */ |
| 98 | 98 | cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending |
| 99 | − jz 1f | |
| 99 | + jnz 1f | |
| 100 | 100 | 2: call check_events |
| 101 | 101 | 1: |
| 102 | 102 | ENDPATCH(xen_restore_fl_direct) |
| @@ -11,9 +11,6 @@ · 10 unmodified lines | ||
| 11 | 11 | #ifndef _XTENSA_HARDIRQ_H |
| 12 | 12 | #define _XTENSA_HARDIRQ_H |
| 13 | 13 | |
| 14 | −void ack_bad_irq(unsigned int irq); | |
| 15 | −#define ack_bad_irq ack_bad_irq | |
| 16 | − | |
| 17 | 14 | #include <asm-generic/hardirq.h> |
| 18 | 15 | |
| 19 | 16 | #endif /* _XTENSA_HARDIRQ_H */ |
| @@ -14,6 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | #ifdef __KERNEL__ |
| 15 | 15 | #include <asm/byteorder.h> |
| 16 | 16 | #include <asm/page.h> |
| 17 | +#include <linux/bug.h> | |
| 17 | 18 | #include <linux/kernel.h> |
| 18 | 19 | |
| 19 | 20 | #include <linux/types.h> |
| @@ -496,6 +496,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) · 495 unmodified lines | ||
| 496 | 496 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
| 497 | 497 | |
| 498 | 498 | if (signr > 0) { |
| 499 | + int ret; | |
| 499 | 500 | |
| 500 | 501 | /* Are we from a system call? */ |
| 501 | 502 | |
| @@ -174,7 +174,7 @@ sha512_update(struct shash_desc *desc, const u8 *data, unsigned int len) · 173 unmodified lines | ||
| 174 | 174 | index = sctx->count[0] & 0x7f; |
| 175 | 175 | |
| 176 | 176 | /* Update number of bytes */ |
| 177 | − if (!(sctx->count[0] += len)) | |
| 177 | + if ((sctx->count[0] += len) < len) | |
| 178 | 178 | sctx->count[1]++; |
| 179 | 179 | |
| 180 | 180 | part_len = 128 - index; |
| @@ -74,7 +74,8 @@ acpi_status acpi_reset(void) · 73 unmodified lines | ||
| 74 | 74 | |
| 75 | 75 | /* Check if the reset register is supported */ |
| 76 | 76 | |
| 77 | − if (!reset_reg->address) { | |
| 77 | + if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) || | |
| 78 | + !reset_reg->address) { | |
| 78 | 79 | return_ACPI_STATUS(AE_NOT_EXIST); |
| 79 | 80 | } |
| 80 | 81 | |
| @@ -607,8 +607,7 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler, · 606 unmodified lines | ||
| 607 | 607 | |
| 608 | 608 | acpi_irq_handler = handler; |
| 609 | 609 | acpi_irq_context = context; |
| 610 | − if (request_threaded_irq(irq, NULL, acpi_irq, IRQF_SHARED, "acpi", | |
| 611 | − acpi_irq)) { | |
| 610 | + if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) { | |
| 612 | 611 | printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); |
| 613 | 612 | acpi_irq_handler = NULL; |
| 614 | 613 | return AE_NOT_ACQUIRED; |
| @@ -23,7 +23,8 @@ void acpi_reboot(void) · 22 unmodified lines | ||
| 23 | 23 | /* Is the reset register supported? The spec says we should be |
| 24 | 24 | * checking the bit width and bit offset, but Windows ignores |
| 25 | 25 | * these fields */ |
| 26 | − /* Ignore also acpi_gbl_FADT.flags.ACPI_FADT_RESET_REGISTER */ | |
| 26 | + if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER)) | |
| 27 | + return; | |
| 27 | 28 | |
| 28 | 29 | reset_value = acpi_gbl_FADT.reset_value; |
| 29 | 30 | |
| @@ -28,23 +28,33 @@ · 27 unmodified lines | ||
| 28 | 28 | #include "internal.h" |
| 29 | 29 | #include "sleep.h" |
| 30 | 30 | |
| 31 | +u8 wake_sleep_flags = ACPI_NO_OPTIONAL_METHODS; | |
| 31 | 32 | static unsigned int gts, bfs; |
| 32 | −module_param(gts, uint, 0644); | |
| 33 | −module_param(bfs, uint, 0644); | |
| 34 | −MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); | |
| 35 | −MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); | |
| 36 | − | |
| 37 | −static u8 wake_sleep_flags(void) | |
| 33 | +static int set_param_wake_flag(const char *val, struct kernel_param *kp) | |
| 38 | 34 | { |
| 39 | − u8 flags = ACPI_NO_OPTIONAL_METHODS; | |
| 35 | + int ret = param_set_int(val, kp); | |
| 40 | 36 | |
| 41 | − if (gts) | |
| 42 | − flags |= ACPI_EXECUTE_GTS; | |
| 43 | − if (bfs) | |
| 44 | − flags |= ACPI_EXECUTE_BFS; | |
| 37 | + if (ret) | |
| 38 | + return ret; | |
| 45 | 39 | |
| 46 | − return flags; | |
| 40 | + if (kp->arg == (const char *)>s) { | |
| 41 | + if (gts) | |
| 42 | + wake_sleep_flags |= ACPI_EXECUTE_GTS; | |
| 43 | + else | |
| 44 | + wake_sleep_flags &= ~ACPI_EXECUTE_GTS; | |
| 45 | + } | |
| 46 | + if (kp->arg == (const char *)&bfs) { | |
| 47 | + if (bfs) | |
| 48 | + wake_sleep_flags |= ACPI_EXECUTE_BFS; | |
| 49 | + else | |
| 50 | + wake_sleep_flags &= ~ACPI_EXECUTE_BFS; | |
| 51 | + } | |
| 52 | + return ret; | |
| 47 | 53 | } |
| 54 | +module_param_call(gts, set_param_wake_flag, param_get_int, >s, 0644); | |
| 55 | +module_param_call(bfs, set_param_wake_flag, param_get_int, &bfs, 0644); | |
| 56 | +MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); | |
| 57 | +MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); | |
| 48 | 58 | |
| 49 | 59 | static u8 sleep_states[ACPI_S_STATE_COUNT]; |
| 50 | 60 | |
| @@ -263,7 +273,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 212 unmodified lines | ||
| 263 | 273 | { |
| 264 | 274 | acpi_status status = AE_OK; |
| 265 | 275 | u32 acpi_state = acpi_target_sleep_state; |
| 266 | − u8 flags = wake_sleep_flags(); | |
| 267 | 276 | int error; |
| 268 | 277 | |
| 269 | 278 | ACPI_FLUSH_CPU_CACHE(); |
| @@ -271,7 +280,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 1 unmodified line | ||
| 271 | 280 | switch (acpi_state) { |
| 272 | 281 | case ACPI_STATE_S1: |
| 273 | 282 | barrier(); |
| 274 | − status = acpi_enter_sleep_state(acpi_state, flags); | |
| 283 | + status = acpi_enter_sleep_state(acpi_state, wake_sleep_flags); | |
| 275 | 284 | break; |
| 276 | 285 | |
| 277 | 286 | case ACPI_STATE_S3: |
| @@ -286,7 +295,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) · 8 unmodified lines | ||
| 286 | 295 | acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); |
| 287 | 296 | |
| 288 | 297 | /* Reprogram control registers and execute _BFS */ |
| 289 | − acpi_leave_sleep_state_prep(acpi_state, flags); | |
| 298 | + acpi_leave_sleep_state_prep(acpi_state, wake_sleep_flags); | |
| 290 | 299 | |
| 291 | 300 | /* ACPI 3.0 specs (P62) says that it's the responsibility |
| 292 | 301 | * of the OSPM to clear the status bit [ implying that the |
| @@ -550,30 +559,27 @@ static int acpi_hibernation_begin(void) · 257 unmodified lines | ||
| 550 | 559 | |
| 551 | 560 | static int acpi_hibernation_enter(void) |
| 552 | 561 | { |
| 553 | − u8 flags = wake_sleep_flags(); | |
| 554 | 562 | acpi_status status = AE_OK; |
| 555 | 563 | |
| 556 | 564 | ACPI_FLUSH_CPU_CACHE(); |
| 557 | 565 | |
| 558 | 566 | /* This shouldn't return. If it returns, we have a problem */ |
| 559 | − status = acpi_enter_sleep_state(ACPI_STATE_S4, flags); | |
| 567 | + status = acpi_enter_sleep_state(ACPI_STATE_S4, wake_sleep_flags); | |
| 560 | 568 | /* Reprogram control registers and execute _BFS */ |
| 561 | − acpi_leave_sleep_state_prep(ACPI_STATE_S4, flags); | |
| 569 | + acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags); | |
| 562 | 570 | |
| 563 | 571 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; |
| 564 | 572 | } |
| 565 | 573 | |
| 566 | 574 | static void acpi_hibernation_leave(void) |
| 567 | 575 | { |
| 568 | − u8 flags = wake_sleep_flags(); | |
| 569 | − | |
| 570 | 576 | /* |
| 571 | 577 | * If ACPI is not enabled by the BIOS and the boot kernel, we need to |
| 572 | 578 | * enable it here. |
| 573 | 579 | */ |
| 574 | 580 | acpi_enable(); |
| 575 | 581 | /* Reprogram control registers and execute _BFS */ |
| 576 | − acpi_leave_sleep_state_prep(ACPI_STATE_S4, flags); | |
| 582 | + acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags); | |
| 577 | 583 | /* Check the hardware signature */ |
| 578 | 584 | if (facs && s4_hardware_signature != facs->hardware_signature) { |
| 579 | 585 | printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " |
| @@ -828,12 +834,10 @@ static void acpi_power_off_prepare(void) · 248 unmodified lines | ||
| 828 | 834 | |
| 829 | 835 | static void acpi_power_off(void) |
| 830 | 836 | { |
| 831 | − u8 flags = wake_sleep_flags(); | |
| 832 | − | |
| 833 | 837 | /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ |
| 834 | 838 | printk(KERN_DEBUG "%s called\n", __func__); |
| 835 | 839 | local_irq_disable(); |
| 836 | − acpi_enter_sleep_state(ACPI_STATE_S5, flags); | |
| 840 | + acpi_enter_sleep_state(ACPI_STATE_S5, wake_sleep_flags); | |
| 837 | 841 | } |
| 838 | 842 | |
| 839 | 843 | /* |
| @@ -329,6 +329,8 @@ static const struct pci_device_id piix_pci_tbl[] = { · 328 unmodified lines | ||
| 329 | 329 | { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
| 330 | 330 | /* SATA Controller IDE (Lynx Point) */ |
| 331 | 331 | { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
| 332 | + /* SATA Controller IDE (DH89xxCC) */ | |
| 333 | + { 0x8086, 0x2326, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | |
| 332 | 334 | { } /* terminate list */ |
| 333 | 335 | }; |
| 334 | 336 | |
| @@ -95,7 +95,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev); · 94 unmodified lines | ||
| 95 | 95 | static void ata_dev_xfermask(struct ata_device *dev); |
| 96 | 96 | static unsigned long ata_dev_blacklisted(const struct ata_device *dev); |
| 97 | 97 | |
| 98 | −unsigned int ata_print_id = 1; | |
| 98 | +atomic_t ata_print_id = ATOMIC_INIT(1); | |
| 99 | 99 | |
| 100 | 100 | struct ata_force_param { |
| 101 | 101 | const char *name; |
| @@ -6029,7 +6029,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) · 5927 unmodified lines | ||
| 6029 | 6029 | |
| 6030 | 6030 | /* give ports names and add SCSI hosts */ |
| 6031 | 6031 | for (i = 0; i < host->n_ports; i++) |
| 6032 | − host->ports[i]->print_id = ata_print_id++; | |
| 6032 | + host->ports[i]->print_id = atomic_inc_return(&ata_print_id); | |
| 6033 | 6033 | |
| 6034 | 6034 | |
| 6035 | 6035 | /* Create associated sysfs transport objects */ |
| @@ -3399,7 +3399,8 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht) · 3398 unmodified lines | ||
| 3399 | 3399 | */ |
| 3400 | 3400 | shost->max_host_blocked = 1; |
| 3401 | 3401 | |
| 3402 | − rc = scsi_add_host(ap->scsi_host, &ap->tdev); | |
| 3402 | + rc = scsi_add_host_with_dma(ap->scsi_host, | |
| 3403 | + &ap->tdev, ap->host->dev); | |
| 3403 | 3404 | if (rc) |
| 3404 | 3405 | goto err_add; |
| 3405 | 3406 | } |
| @@ -3838,18 +3839,25 @@ void ata_sas_port_stop(struct ata_port *ap) · 432 unmodified lines | ||
| 3838 | 3839 | } |
| 3839 | 3840 | EXPORT_SYMBOL_GPL(ata_sas_port_stop); |
| 3840 | 3841 | |
| 3841 | −int ata_sas_async_port_init(struct ata_port *ap) | |
| 3842 | +/** | |
| 3843 | + * ata_sas_async_probe - simply schedule probing and return | |
| 3844 | + * @ap: Port to probe | |
| 3845 | + * | |
| 3846 | + * For batch scheduling of probe for sas attached ata devices, assumes | |
| 3847 | + * the port has already been through ata_sas_port_init() | |
| 3848 | + */ | |
| 3849 | +void ata_sas_async_probe(struct ata_port *ap) | |
| 3842 | 3850 | { |
| 3843 | − int rc = ap->ops->port_start(ap); | |
| 3844 | − | |
| 3845 | − if (!rc) { | |
| 3846 | − ap->print_id = ata_print_id++; | |
| 3847 | − __ata_port_probe(ap); | |
| 3848 | − } | |
| 3851 | + __ata_port_probe(ap); | |
| 3852 | +} | |
| 3853 | +EXPORT_SYMBOL_GPL(ata_sas_async_probe); | |
| 3849 | 3854 | |
| 3850 | − return rc; | |
| 3855 | +int ata_sas_sync_probe(struct ata_port *ap) | |
| 3856 | +{ | |
| 3857 | + return ata_port_probe(ap); | |
| 3851 | 3858 | } |
| 3852 | −EXPORT_SYMBOL_GPL(ata_sas_async_port_init); | |
| 3859 | +EXPORT_SYMBOL_GPL(ata_sas_sync_probe); | |
| 3860 | + | |
| 3853 | 3861 | |
| 3854 | 3862 | /** |
| 3855 | 3863 | * ata_sas_port_init - Initialize a SATA device |
| @@ -3866,12 +3874,10 @@ int ata_sas_port_init(struct ata_port *ap) · 10 unmodified lines | ||
| 3866 | 3874 | { |
| 3867 | 3875 | int rc = ap->ops->port_start(ap); |
| 3868 | 3876 | |
| 3869 | − if (!rc) { | |
| 3870 | − ap->print_id = ata_print_id++; | |
| 3871 | − rc = ata_port_probe(ap); | |
| 3872 | − } | |
| 3873 | − | |
| 3874 | − return rc; | |
| 3877 | + if (rc) | |
| 3878 | + return rc; | |
| 3879 | + ap->print_id = atomic_inc_return(&ata_print_id); | |
| 3880 | + return 0; | |
| 3875 | 3881 | } |
| 3876 | 3882 | EXPORT_SYMBOL_GPL(ata_sas_port_init); |
| 3877 | 3883 | |
| @@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent, · 293 unmodified lines | ||
| 294 | 294 | device_enable_async_suspend(dev); |
| 295 | 295 | pm_runtime_set_active(dev); |
| 296 | 296 | pm_runtime_enable(dev); |
| 297 | + pm_runtime_forbid(dev); | |
| 297 | 298 | |
| 298 | 299 | transport_add_device(dev); |
| 299 | 300 | transport_configure_device(dev); |
| @@ -53,7 +53,7 @@ enum { · 52 unmodified lines | ||
| 53 | 53 | ATA_DNXFER_QUIET = (1 << 31), |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | −extern unsigned int ata_print_id; | |
| 56 | +extern atomic_t ata_print_id; | |
| 57 | 57 | extern int atapi_passthru16; |
| 58 | 58 | extern int libata_fua; |
| 59 | 59 | extern int libata_noacpi; |
| @@ -4025,7 +4025,8 @@ static int mv_platform_probe(struct platform_device *pdev) · 4024 unmodified lines | ||
| 4025 | 4025 | struct ata_host *host; |
| 4026 | 4026 | struct mv_host_priv *hpriv; |
| 4027 | 4027 | struct resource *res; |
| 4028 | − int n_ports, rc; | |
| 4028 | + int n_ports = 0; | |
| 4029 | + int rc; | |
| 4029 | 4030 | |
| 4030 | 4031 | ata_print_version_once(&pdev->dev, DRV_VERSION); |
| 4031 | 4032 | |
| @@ -404,16 +404,19 @@ int bcma_sprom_get(struct bcma_bus *bus) · 403 unmodified lines | ||
| 404 | 404 | return -EOPNOTSUPP; |
| 405 | 405 | |
| 406 | 406 | if (!bcma_sprom_ext_available(bus)) { |
| 407 | + bool sprom_onchip; | |
| 408 | + | |
| 407 | 409 | /* |
| 408 | 410 | * External SPROM takes precedence so check |
| 409 | 411 | * on-chip OTP only when no external SPROM |
| 410 | 412 | * is present. |
| 411 | 413 | */ |
| 412 | − if (bcma_sprom_onchip_available(bus)) { | |
| 414 | + sprom_onchip = bcma_sprom_onchip_available(bus); | |
| 415 | + if (sprom_onchip) { | |
| 413 | 416 | /* determine offset */ |
| 414 | 417 | offset = bcma_sprom_onchip_offset(bus); |
| 415 | 418 | } |
| 416 | − if (!offset) { | |
| 419 | + if (!offset || !sprom_onchip) { | |
| 417 | 420 | /* |
| 418 | 421 | * Maybe there is no SPROM on the device? |
| 419 | 422 | * Now we ask the arch code if there is some sprom |
| @@ -375,6 +375,34 @@ static int init_vq(struct virtio_blk *vblk) · 374 unmodified lines | ||
| 375 | 375 | return err; |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | +/* | |
| 379 | + * Legacy naming scheme used for virtio devices. We are stuck with it for | |
| 380 | + * virtio blk but don't ever use it for any new driver. | |
| 381 | + */ | |
| 382 | +static int virtblk_name_format(char *prefix, int index, char *buf, int buflen) | |
| 383 | +{ | |
| 384 | + const int base = 'z' - 'a' + 1; | |
| 385 | + char *begin = buf + strlen(prefix); | |
| 386 | + char *end = buf + buflen; | |
| 387 | + char *p; | |
| 388 | + int unit; | |
| 389 | + | |
| 390 | + p = end - 1; | |
| 391 | + *p = '\0'; | |
| 392 | + unit = base; | |
| 393 | + do { | |
| 394 | + if (p == begin) | |
| 395 | + return -EINVAL; | |
| 396 | + *--p = 'a' + (index % unit); | |
| 397 | + index = (index / unit) - 1; | |
| 398 | + } while (index >= 0); | |
| 399 | + | |
| 400 | + memmove(begin, p, end - p); | |
| 401 | + memcpy(buf, prefix, strlen(prefix)); | |
| 402 | + | |
| 403 | + return 0; | |
| 404 | +} | |
| 405 | + | |
| 378 | 406 | static int __devinit virtblk_probe(struct virtio_device *vdev) |
| 379 | 407 | { |
| 380 | 408 | struct virtio_blk *vblk; |
| @@ -443,18 +471,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) · 62 unmodified lines | ||
| 443 | 471 | |
| 444 | 472 | q->queuedata = vblk; |
| 445 | 473 | |
| 446 | − if (index < 26) { | |
| 447 | − sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26); | |
| 448 | − } else if (index < (26 + 1) * 26) { | |
| 449 | − sprintf(vblk->disk->disk_name, "vd%c%c", | |
| 450 | − 'a' + index / 26 - 1, 'a' + index % 26); | |
| 451 | − } else { | |
| 452 | − const unsigned int m1 = (index / 26 - 1) / 26 - 1; | |
| 453 | − const unsigned int m2 = (index / 26 - 1) % 26; | |
| 454 | − const unsigned int m3 = index % 26; | |
| 455 | − sprintf(vblk->disk->disk_name, "vd%c%c%c", | |
| 456 | − 'a' + m1, 'a' + m2, 'a' + m3); | |
| 457 | − } | |
| 474 | + virtblk_name_format("vd", index, vblk->disk->disk_name, DISK_NAME_LEN); | |
| 458 | 475 | |
| 459 | 476 | vblk->disk->major = major; |
| 460 | 477 | vblk->disk->first_minor = index_to_minor(index); |
| @@ -416,7 +416,7 @@ static void xen_blkbk_discard(struct xenbus_transaction xbt, struct backend_info · 415 unmodified lines | ||
| 416 | 416 | "discard-secure", "%d", |
| 417 | 417 | blkif->vbd.discard_secure); |
| 418 | 418 | if (err) { |
| 419 | − dev_warn(dev-dev, "writing discard-secure (%d)", err); | |
| 419 | + dev_warn(&dev->dev, "writing discard-secure (%d)", err); | |
| 420 | 420 | return; |
| 421 | 421 | } |
| 422 | 422 | } |
| @@ -18,6 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | #include <linux/interrupt.h> |
| 19 | 19 | #include <linux/spinlock.h> |
| 20 | 20 | #include <linux/gfp.h> |
| 21 | +#include <linux/module.h> | |
| 21 | 22 | |
| 22 | 23 | #include <crypto/ctr.h> |
| 23 | 24 | #include <crypto/des.h> |
| @@ -124,6 +124,9 @@ struct talitos_private { · 123 unmodified lines | ||
| 124 | 124 | void __iomem *reg; |
| 125 | 125 | int irq[2]; |
| 126 | 126 | |
| 127 | + /* SEC global registers lock */ | |
| 128 | + spinlock_t reg_lock ____cacheline_aligned; | |
| 129 | + | |
| 127 | 130 | /* SEC version geometry (from device tree node) */ |
| 128 | 131 | unsigned int num_channels; |
| 129 | 132 | unsigned int chfifo_len; |
| @@ -412,6 +415,7 @@ static void talitos_done_##name(unsigned long data) \ · 282 unmodified lines | ||
| 412 | 415 | { \ |
| 413 | 416 | struct device *dev = (struct device *)data; \ |
| 414 | 417 | struct talitos_private *priv = dev_get_drvdata(dev); \ |
| 418 | + unsigned long flags; \ | |
| 415 | 419 | \ |
| 416 | 420 | if (ch_done_mask & 1) \ |
| 417 | 421 | flush_channel(dev, 0, 0, 0); \ |
| @@ -427,8 +431,10 @@ static void talitos_done_##name(unsigned long data) \ · 9 unmodified lines | ||
| 427 | 431 | out: \ |
| 428 | 432 | /* At this point, all completed channels have been processed */ \ |
| 429 | 433 | /* Unmask done interrupts for channels completed later on. */ \ |
| 434 | + spin_lock_irqsave(&priv->reg_lock, flags); \ | |
| 430 | 435 | setbits32(priv->reg + TALITOS_IMR, ch_done_mask); \ |
| 431 | 436 | setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT); \ |
| 437 | + spin_unlock_irqrestore(&priv->reg_lock, flags); \ | |
| 432 | 438 | } |
| 433 | 439 | DEF_TALITOS_DONE(4ch, TALITOS_ISR_4CHDONE) |
| 434 | 440 | DEF_TALITOS_DONE(ch0_2, TALITOS_ISR_CH_0_2_DONE) |
| @@ -619,22 +625,28 @@ static irqreturn_t talitos_interrupt_##name(int irq, void *data) \ · 184 unmodified lines | ||
| 619 | 625 | struct device *dev = data; \ |
| 620 | 626 | struct talitos_private *priv = dev_get_drvdata(dev); \ |
| 621 | 627 | u32 isr, isr_lo; \ |
| 628 | + unsigned long flags; \ | |
| 622 | 629 | \ |
| 630 | + spin_lock_irqsave(&priv->reg_lock, flags); \ | |
| 623 | 631 | isr = in_be32(priv->reg + TALITOS_ISR); \ |
| 624 | 632 | isr_lo = in_be32(priv->reg + TALITOS_ISR_LO); \ |
| 625 | 633 | /* Acknowledge interrupt */ \ |
| 626 | 634 | out_be32(priv->reg + TALITOS_ICR, isr & (ch_done_mask | ch_err_mask)); \ |
| 627 | 635 | out_be32(priv->reg + TALITOS_ICR_LO, isr_lo); \ |
| 628 | 636 | \ |
| 629 | − if (unlikely((isr & ~TALITOS_ISR_4CHDONE) & ch_err_mask || isr_lo)) \ | |
| 630 | − talitos_error(dev, isr, isr_lo); \ | |
| 631 | − else \ | |
| 637 | + if (unlikely(isr & ch_err_mask || isr_lo)) { \ | |
| 638 | + spin_unlock_irqrestore(&priv->reg_lock, flags); \ | |
| 639 | + talitos_error(dev, isr & ch_err_mask, isr_lo); \ | |
| 640 | + } \ | |
| 641 | + else { \ | |
| 632 | 642 | if (likely(isr & ch_done_mask)) { \ |
| 633 | 643 | /* mask further done interrupts. */ \ |
| 634 | 644 | clrbits32(priv->reg + TALITOS_IMR, ch_done_mask); \ |
| 635 | 645 | /* done_task will unmask done interrupts at exit */ \ |
| 636 | 646 | tasklet_schedule(&priv->done_task[tlet]); \ |
| 637 | 647 | } \ |
| 648 | + spin_unlock_irqrestore(&priv->reg_lock, flags); \ | |
| 649 | + } \ | |
| 638 | 650 | \ |
| 639 | 651 | return (isr & (ch_done_mask | ch_err_mask) || isr_lo) ? IRQ_HANDLED : \ |
| 640 | 652 | IRQ_NONE; \ |
| @@ -2719,6 +2731,8 @@ static int talitos_probe(struct platform_device *ofdev) · 2078 unmodified lines | ||
| 2719 | 2731 | |
| 2720 | 2732 | priv->ofdev = ofdev; |
| 2721 | 2733 | |
| 2734 | + spin_lock_init(&priv->reg_lock); | |
| 2735 | + | |
| 2722 | 2736 | err = talitos_probe_irq(ofdev); |
| 2723 | 2737 | if (err) |
| 2724 | 2738 | goto err_out; |
| @@ -91,11 +91,10 @@ config DW_DMAC · 90 unmodified lines | ||
| 91 | 91 | |
| 92 | 92 | config AT_HDMAC |
| 93 | 93 | tristate "Atmel AHB DMA support" |
| 94 | − depends on ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 | |
| 94 | + depends on ARCH_AT91 | |
| 95 | 95 | select DMA_ENGINE |
| 96 | 96 | help |
| 97 | − Support the Atmel AHB DMA controller. This can be integrated in | |
| 98 | − chips such as the Atmel AT91SAM9RL. | |
| 97 | + Support the Atmel AHB DMA controller. | |
| 99 | 98 | |
| 100 | 99 | config FSL_DMA |
| 101 | 100 | tristate "Freescale Elo and Elo Plus DMA support" |
| @@ -1429,6 +1429,7 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · 1428 unmodified lines | ||
| 1429 | 1429 | * signal |
| 1430 | 1430 | */ |
| 1431 | 1431 | release_phy_channel(plchan); |
| 1432 | + plchan->phychan_hold = 0; | |
| 1432 | 1433 | } |
| 1433 | 1434 | /* Dequeue jobs and free LLIs */ |
| 1434 | 1435 | if (plchan->at) { |
| @@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first) · 220 unmodified lines | ||
| 221 | 221 | |
| 222 | 222 | vdbg_dump_regs(atchan); |
| 223 | 223 | |
| 224 | − /* clear any pending interrupt */ | |
| 225 | − while (dma_readl(atdma, EBCISR)) | |
| 226 | − cpu_relax(); | |
| 227 | − | |
| 228 | 224 | channel_writel(atchan, SADDR, 0); |
| 229 | 225 | channel_writel(atchan, DADDR, 0); |
| 230 | 226 | channel_writel(atchan, CTRLA, 0); |
| @@ -571,11 +571,14 @@ static void imxdma_tasklet(unsigned long data) · 570 unmodified lines | ||
| 571 | 571 | if (desc->desc.callback) |
| 572 | 572 | desc->desc.callback(desc->desc.callback_param); |
| 573 | 573 | |
| 574 | − dma_cookie_complete(&desc->desc); | |
| 575 | − | |
| 576 | − /* If we are dealing with a cyclic descriptor keep it on ld_active */ | |
| 574 | + /* If we are dealing with a cyclic descriptor keep it on ld_active | |
| 575 | + * and dont mark the descripor as complete. | |
| 576 | + * Only in non-cyclic cases it would be marked as complete | |
| 577 | + */ | |
| 577 | 578 | if (imxdma_chan_is_doing_cyclic(imxdmac)) |
| 578 | 579 | goto out; |
| 580 | + else | |
| 581 | + dma_cookie_complete(&desc->desc); | |
| 579 | 582 | |
| 580 | 583 | /* Free 2D slot if it was an interleaved transfer */ |
| 581 | 584 | if (imxdmac->enabled_2d) { |
| @@ -201,10 +201,6 @@ static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan) · 200 unmodified lines | ||
| 201 | 201 | |
| 202 | 202 | static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx) |
| 203 | 203 | { |
| 204 | − struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(tx->chan); | |
| 205 | − | |
| 206 | − mxs_dma_enable_chan(mxs_chan); | |
| 207 | − | |
| 208 | 204 | return dma_cookie_assign(tx); |
| 209 | 205 | } |
| 210 | 206 | |
| @@ -558,9 +554,9 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan, · 347 unmodified lines | ||
| 558 | 554 | |
| 559 | 555 | static void mxs_dma_issue_pending(struct dma_chan *chan) |
| 560 | 556 | { |
| 561 | − /* | |
| 562 | − * Nothing to do. We only have a single descriptor. | |
| 563 | − */ | |
| 557 | + struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan); | |
| 558 | + | |
| 559 | + mxs_dma_enable_chan(mxs_chan); | |
| 564 | 560 | } |
| 565 | 561 | |
| 566 | 562 | static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma) |
| @@ -2225,12 +2225,9 @@ static inline void free_desc_list(struct list_head *list) · 2224 unmodified lines | ||
| 2225 | 2225 | { |
| 2226 | 2226 | struct dma_pl330_dmac *pdmac; |
| 2227 | 2227 | struct dma_pl330_desc *desc; |
| 2228 | − struct dma_pl330_chan *pch; | |
| 2228 | + struct dma_pl330_chan *pch = NULL; | |
| 2229 | 2229 | unsigned long flags; |
| 2230 | 2230 | |
| 2231 | − if (list_empty(list)) | |
| 2232 | − return; | |
| 2233 | − | |
| 2234 | 2231 | /* Finish off the work list */ |
| 2235 | 2232 | list_for_each_entry(desc, list, node) { |
| 2236 | 2233 | dma_async_tx_callback callback; |
| @@ -2247,6 +2244,10 @@ static inline void free_desc_list(struct list_head *list) · 10 unmodified lines | ||
| 2247 | 2244 | desc->pchan = NULL; |
| 2248 | 2245 | } |
| 2249 | 2246 | |
| 2247 | + /* pch will be unset if list was empty */ | |
| 2248 | + if (!pch) | |
| 2249 | + return; | |
| 2250 | + | |
| 2250 | 2251 | pdmac = pch->dmac; |
| 2251 | 2252 | |
| 2252 | 2253 | spin_lock_irqsave(&pdmac->pool_lock, flags); |
| @@ -2257,12 +2258,9 @@ static inline void free_desc_list(struct list_head *list) · 4 unmodified lines | ||
| 2257 | 2258 | static inline void handle_cyclic_desc_list(struct list_head *list) |
| 2258 | 2259 | { |
| 2259 | 2260 | struct dma_pl330_desc *desc; |
| 2260 | − struct dma_pl330_chan *pch; | |
| 2261 | + struct dma_pl330_chan *pch = NULL; | |
| 2261 | 2262 | unsigned long flags; |
| 2262 | 2263 | |
| 2263 | − if (list_empty(list)) | |
| 2264 | − return; | |
| 2265 | − | |
| 2266 | 2264 | list_for_each_entry(desc, list, node) { |
| 2267 | 2265 | dma_async_tx_callback callback; |
| 2268 | 2266 | |
| @@ -2274,6 +2272,10 @@ static inline void handle_cyclic_desc_list(struct list_head *list) · 5 unmodified lines | ||
| 2274 | 2272 | callback(desc->txd.callback_param); |
| 2275 | 2273 | } |
| 2276 | 2274 | |
| 2275 | + /* pch will be unset if list was empty */ | |
| 2276 | + if (!pch) | |
| 2277 | + return; | |
| 2278 | + | |
| 2277 | 2279 | spin_lock_irqsave(&pch->lock, flags); |
| 2278 | 2280 | list_splice_tail_init(list, &pch->work_list); |
| 2279 | 2281 | spin_unlock_irqrestore(&pch->lock, flags); |
| @@ -2926,8 +2928,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 646 unmodified lines | ||
| 2926 | 2928 | INIT_LIST_HEAD(&pd->channels); |
| 2927 | 2929 | |
| 2928 | 2930 | /* Initialize channel parameters */ |
| 2929 | − num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri, | |
| 2930 | − (u8)pi->pcfg.num_chan); | |
| 2931 | + if (pdat) | |
| 2932 | + num_chan = max_t(int, pdat->nr_valid_peri, pi->pcfg.num_chan); | |
| 2933 | + else | |
| 2934 | + num_chan = max_t(int, pi->pcfg.num_peri, pi->pcfg.num_chan); | |
| 2935 | + | |
| 2931 | 2936 | pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); |
| 2932 | 2937 | |
| 2933 | 2938 | for (i = 0; i < num_chan; i++) { |
| @@ -18,6 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | #include <linux/pm_runtime.h> |
| 19 | 19 | #include <linux/err.h> |
| 20 | 20 | #include <linux/amba/bus.h> |
| 21 | +#include <linux/regulator/consumer.h> | |
| 21 | 22 | |
| 22 | 23 | #include <plat/ste_dma40.h> |
| 23 | 24 | |
| @@ -68,6 +69,22 @@ enum d40_command { · 44 unmodified lines | ||
| 68 | 69 | D40_DMA_SUSPENDED = 3 |
| 69 | 70 | }; |
| 70 | 71 | |
| 72 | +/* | |
| 73 | + * enum d40_events - The different Event Enables for the event lines. | |
| 74 | + * | |
| 75 | + * @D40_DEACTIVATE_EVENTLINE: De-activate Event line, stopping the logical chan. | |
| 76 | + * @D40_ACTIVATE_EVENTLINE: Activate the Event line, to start a logical chan. | |
| 77 | + * @D40_SUSPEND_REQ_EVENTLINE: Requesting for suspending a event line. | |
| 78 | + * @D40_ROUND_EVENTLINE: Status check for event line. | |
| 79 | + */ | |
| 80 | + | |
| 81 | +enum d40_events { | |
| 82 | + D40_DEACTIVATE_EVENTLINE = 0, | |
| 83 | + D40_ACTIVATE_EVENTLINE = 1, | |
| 84 | + D40_SUSPEND_REQ_EVENTLINE = 2, | |
| 85 | + D40_ROUND_EVENTLINE = 3 | |
| 86 | +}; | |
| 87 | + | |
| 71 | 88 | /* |
| 72 | 89 | * These are the registers that has to be saved and later restored |
| 73 | 90 | * when the DMA hw is powered off. |
| @@ -870,8 +887,8 @@ static void d40_save_restore_registers(struct d40_base *base, bool save) · 796 unmodified lines | ||
| 870 | 887 | } |
| 871 | 888 | #endif |
| 872 | 889 | |
| 873 | −static int d40_channel_execute_command(struct d40_chan *d40c, | |
| 874 | − enum d40_command command) | |
| 890 | +static int __d40_execute_command_phy(struct d40_chan *d40c, | |
| 891 | + enum d40_command command) | |
| 875 | 892 | { |
| 876 | 893 | u32 status; |
| 877 | 894 | int i; |
| @@ -880,6 +897,12 @@ static int d40_channel_execute_command(struct d40_chan *d40c, · 2 unmodified lines | ||
| 880 | 897 | unsigned long flags; |
| 881 | 898 | u32 wmask; |
| 882 | 899 | |
| 900 | + if (command == D40_DMA_STOP) { | |
| 901 | + ret = __d40_execute_command_phy(d40c, D40_DMA_SUSPEND_REQ); | |
| 902 | + if (ret) | |
| 903 | + return ret; | |
| 904 | + } | |
| 905 | + | |
| 883 | 906 | spin_lock_irqsave(&d40c->base->execmd_lock, flags); |
| 884 | 907 | |
| 885 | 908 | if (d40c->phy_chan->num % 2 == 0) |
| @@ -973,67 +996,109 @@ static void d40_term_all(struct d40_chan *d40c) · 87 unmodified lines | ||
| 973 | 996 | } |
| 974 | 997 | |
| 975 | 998 | d40c->pending_tx = 0; |
| 976 | − d40c->busy = false; | |
| 977 | 999 | } |
| 978 | 1000 | |
| 979 | −static void __d40_config_set_event(struct d40_chan *d40c, bool enable, | |
| 980 | − u32 event, int reg) | |
| 1001 | +static void __d40_config_set_event(struct d40_chan *d40c, | |
| 1002 | + enum d40_events event_type, u32 event, | |
| 1003 | + int reg) | |
| 981 | 1004 | { |
| 982 | 1005 | void __iomem *addr = chan_base(d40c) + reg; |
| 983 | 1006 | int tries; |
| 1007 | + u32 status; | |
| 1008 | + | |
| 1009 | + switch (event_type) { | |
| 1010 | + | |
| 1011 | + case D40_DEACTIVATE_EVENTLINE: | |
| 984 | 1012 | |
| 985 | − if (!enable) { | |
| 986 | 1013 | writel((D40_DEACTIVATE_EVENTLINE << D40_EVENTLINE_POS(event)) |
| 987 | 1014 | | ~D40_EVENTLINE_MASK(event), addr); |
| 988 | − return; | |
| 989 | − } | |
| 1015 | + break; | |
| 1016 | + | |
| 1017 | + case D40_SUSPEND_REQ_EVENTLINE: | |
| 1018 | + status = (readl(addr) & D40_EVENTLINE_MASK(event)) >> | |
| 1019 | + D40_EVENTLINE_POS(event); | |
| 1020 | + | |
| 1021 | + if (status == D40_DEACTIVATE_EVENTLINE || | |
| 1022 | + status == D40_SUSPEND_REQ_EVENTLINE) | |
| 1023 | + break; | |
| 990 | 1024 | |
| 1025 | + writel((D40_SUSPEND_REQ_EVENTLINE << D40_EVENTLINE_POS(event)) | |
| 1026 | + | ~D40_EVENTLINE_MASK(event), addr); | |
| 1027 | + | |
| 1028 | + for (tries = 0 ; tries < D40_SUSPEND_MAX_IT; tries++) { | |
| 1029 | + | |
| 1030 | + status = (readl(addr) & D40_EVENTLINE_MASK(event)) >> | |
| 1031 | + D40_EVENTLINE_POS(event); | |
| 1032 | + | |
| 1033 | + cpu_relax(); | |
| 1034 | + /* | |
| 1035 | + * Reduce the number of bus accesses while | |
| 1036 | + * waiting for the DMA to suspend. | |
| 1037 | + */ | |
| 1038 | + udelay(3); | |
| 1039 | + | |
| 1040 | + if (status == D40_DEACTIVATE_EVENTLINE) | |
| 1041 | + break; | |
| 1042 | + } | |
| 1043 | + | |
| 1044 | + if (tries == D40_SUSPEND_MAX_IT) { | |
| 1045 | + chan_err(d40c, | |
| 1046 | + "unable to stop the event_line chl %d (log: %d)" | |
| 1047 | + "status %x\n", d40c->phy_chan->num, | |
| 1048 | + d40c->log_num, status); | |
| 1049 | + } | |
| 1050 | + break; | |
| 1051 | + | |
| 1052 | + case D40_ACTIVATE_EVENTLINE: | |
| 991 | 1053 | /* |
| 992 | 1054 | * The hardware sometimes doesn't register the enable when src and dst |
| 993 | 1055 | * event lines are active on the same logical channel. Retry to ensure |
| 994 | 1056 | * it does. Usually only one retry is sufficient. |
| 995 | 1057 | */ |
| 996 | − tries = 100; | |
| 997 | − while (--tries) { | |
| 998 | − writel((D40_ACTIVATE_EVENTLINE << D40_EVENTLINE_POS(event)) | |
| 999 | − | ~D40_EVENTLINE_MASK(event), addr); | |
| 1058 | + tries = 100; | |
| 1059 | + while (--tries) { | |
| 1060 | + writel((D40_ACTIVATE_EVENTLINE << | |
| 1061 | + D40_EVENTLINE_POS(event)) | | |
| 1062 | + ~D40_EVENTLINE_MASK(event), addr); | |
| 1000 | 1063 | |
| 1001 | − if (readl(addr) & D40_EVENTLINE_MASK(event)) | |
| 1002 | − break; | |
| 1003 | − } | |
| 1064 | + if (readl(addr) & D40_EVENTLINE_MASK(event)) | |
| 1065 | + break; | |
| 1066 | + } | |
| 1004 | 1067 | |
| 1005 | − if (tries != 99) | |
| 1006 | − dev_dbg(chan2dev(d40c), | |
| 1007 | − "[%s] workaround enable S%cLNK (%d tries)\n", | |
| 1008 | − __func__, reg == D40_CHAN_REG_SSLNK ? 'S' : 'D', | |
| 1009 | − 100 - tries); | |
| 1068 | + if (tries != 99) | |
| 1069 | + dev_dbg(chan2dev(d40c), | |
| 1070 | + "[%s] workaround enable S%cLNK (%d tries)\n", | |
| 1071 | + __func__, reg == D40_CHAN_REG_SSLNK ? 'S' : 'D', | |
| 1072 | + 100 - tries); | |
| 1010 | 1073 | |
| 1011 | − WARN_ON(!tries); | |
| 1012 | −} | |
| 1074 | + WARN_ON(!tries); | |
| 1075 | + break; | |
| 1013 | 1076 | |
| 1014 | −static void d40_config_set_event(struct d40_chan *d40c, bool do_enable) | |
| 1015 | −{ | |
| 1016 | − unsigned long flags; | |
| 1077 | + case D40_ROUND_EVENTLINE: | |
| 1078 | + BUG(); | |
| 1079 | + break; | |
| 1017 | 1080 | |
| 1018 | − spin_lock_irqsave(&d40c->phy_chan->lock, flags); | |
| 1081 | + } | |
| 1082 | +} | |
| 1019 | 1083 | |
| 1084 | +static void d40_config_set_event(struct d40_chan *d40c, | |
| 1085 | + enum d40_events event_type) | |
| 1086 | +{ | |
| 1020 | 1087 | /* Enable event line connected to device (or memcpy) */ |
| 1021 | 1088 | if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || |
| 1022 | 1089 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) { |
| 1023 | 1090 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); |
| 1024 | 1091 | |
| 1025 | − __d40_config_set_event(d40c, do_enable, event, | |
| 1092 | + __d40_config_set_event(d40c, event_type, event, | |
| 1026 | 1093 | D40_CHAN_REG_SSLNK); |
| 1027 | 1094 | } |
| 1028 | 1095 | |
| 1029 | 1096 | if (d40c->dma_cfg.dir != STEDMA40_PERIPH_TO_MEM) { |
| 1030 | 1097 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); |
| 1031 | 1098 | |
| 1032 | − __d40_config_set_event(d40c, do_enable, event, | |
| 1099 | + __d40_config_set_event(d40c, event_type, event, | |
| 1033 | 1100 | D40_CHAN_REG_SDLNK); |
| 1034 | 1101 | } |
| 1035 | − | |
| 1036 | − spin_unlock_irqrestore(&d40c->phy_chan->lock, flags); | |
| 1037 | 1102 | } |
| 1038 | 1103 | |
| 1039 | 1104 | static u32 d40_chan_has_events(struct d40_chan *d40c) |
| @@ -1047,6 +1112,64 @@ static u32 d40_chan_has_events(struct d40_chan *d40c) · 7 unmodified lines | ||
| 1047 | 1112 | return val; |
| 1048 | 1113 | } |
| 1049 | 1114 | |
| 1115 | +static int | |
| 1116 | +__d40_execute_command_log(struct d40_chan *d40c, enum d40_command command) | |
| 1117 | +{ | |
| 1118 | + unsigned long flags; | |
| 1119 | + int ret = 0; | |
| 1120 | + u32 active_status; | |
| 1121 | + void __iomem *active_reg; | |
| 1122 | + | |
| 1123 | + if (d40c->phy_chan->num % 2 == 0) | |
| 1124 | + active_reg = d40c->base->virtbase + D40_DREG_ACTIVE; | |
| 1125 | + else | |
| 1126 | + active_reg = d40c->base->virtbase + D40_DREG_ACTIVO; | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + spin_lock_irqsave(&d40c->phy_chan->lock, flags); | |
| 1130 | + | |
| 1131 | + switch (command) { | |
| 1132 | + case D40_DMA_STOP: | |
| 1133 | + case D40_DMA_SUSPEND_REQ: | |
| 1134 | + | |
| 1135 | + active_status = (readl(active_reg) & | |
| 1136 | + D40_CHAN_POS_MASK(d40c->phy_chan->num)) >> | |
| 1137 | + D40_CHAN_POS(d40c->phy_chan->num); | |
| 1138 | + | |
| 1139 | + if (active_status == D40_DMA_RUN) | |
| 1140 | + d40_config_set_event(d40c, D40_SUSPEND_REQ_EVENTLINE); | |
| 1141 | + else | |
| 1142 | + d40_config_set_event(d40c, D40_DEACTIVATE_EVENTLINE); | |
| 1143 | + | |
| 1144 | + if (!d40_chan_has_events(d40c) && (command == D40_DMA_STOP)) | |
| 1145 | + ret = __d40_execute_command_phy(d40c, command); | |
| 1146 | + | |
| 1147 | + break; | |
| 1148 | + | |
| 1149 | + case D40_DMA_RUN: | |
| 1150 | + | |
| 1151 | + d40_config_set_event(d40c, D40_ACTIVATE_EVENTLINE); | |
| 1152 | + ret = __d40_execute_command_phy(d40c, command); | |
| 1153 | + break; | |
| 1154 | + | |
| 1155 | + case D40_DMA_SUSPENDED: | |
| 1156 | + BUG(); | |
| 1157 | + break; | |
| 1158 | + } | |
| 1159 | + | |
| 1160 | + spin_unlock_irqrestore(&d40c->phy_chan->lock, flags); | |
| 1161 | + return ret; | |
| 1162 | +} | |
| 1163 | + | |
| 1164 | +static int d40_channel_execute_command(struct d40_chan *d40c, | |
| 1165 | + enum d40_command command) | |
| 1166 | +{ | |
| 1167 | + if (chan_is_logical(d40c)) | |
| 1168 | + return __d40_execute_command_log(d40c, command); | |
| 1169 | + else | |
| 1170 | + return __d40_execute_command_phy(d40c, command); | |
| 1171 | +} | |
| 1172 | + | |
| 1050 | 1173 | static u32 d40_get_prmo(struct d40_chan *d40c) |
| 1051 | 1174 | { |
| 1052 | 1175 | static const unsigned int phy_map[] = { |
| @@ -1149,15 +1272,7 @@ static int d40_pause(struct d40_chan *d40c) · 96 unmodified lines | ||
| 1149 | 1272 | spin_lock_irqsave(&d40c->lock, flags); |
| 1150 | 1273 | |
| 1151 | 1274 | res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ); |
| 1152 | − if (res == 0) { | |
| 1153 | − if (chan_is_logical(d40c)) { | |
| 1154 | − d40_config_set_event(d40c, false); | |
| 1155 | − /* Resume the other logical channels if any */ | |
| 1156 | − if (d40_chan_has_events(d40c)) | |
| 1157 | − res = d40_channel_execute_command(d40c, | |
| 1158 | − D40_DMA_RUN); | |
| 1159 | − } | |
| 1160 | − } | |
| 1275 | + | |
| 1161 | 1276 | pm_runtime_mark_last_busy(d40c->base->dev); |
| 1162 | 1277 | pm_runtime_put_autosuspend(d40c->base->dev); |
| 1163 | 1278 | spin_unlock_irqrestore(&d40c->lock, flags); |
| @@ -1174,45 +1289,17 @@ static int d40_resume(struct d40_chan *d40c) · 10 unmodified lines | ||
| 1174 | 1289 | |
| 1175 | 1290 | spin_lock_irqsave(&d40c->lock, flags); |
| 1176 | 1291 | pm_runtime_get_sync(d40c->base->dev); |
| 1177 | − if (d40c->base->rev == 0) | |
| 1178 | − if (chan_is_logical(d40c)) { | |
| 1179 | − res = d40_channel_execute_command(d40c, | |
| 1180 | − D40_DMA_SUSPEND_REQ); | |
| 1181 | − goto no_suspend; | |
| 1182 | − } | |
| 1183 | 1292 | |
| 1184 | 1293 | /* If bytes left to transfer or linked tx resume job */ |
| 1185 | − if (d40_residue(d40c) || d40_tx_is_linked(d40c)) { | |
| 1186 | − | |
| 1187 | − if (chan_is_logical(d40c)) | |
| 1188 | − d40_config_set_event(d40c, true); | |
| 1189 | − | |
| 1294 | + if (d40_residue(d40c) || d40_tx_is_linked(d40c)) | |
| 1190 | 1295 | res = d40_channel_execute_command(d40c, D40_DMA_RUN); |
| 1191 | − } | |
| 1192 | 1296 | |
| 1193 | −no_suspend: | |
| 1194 | 1297 | pm_runtime_mark_last_busy(d40c->base->dev); |
| 1195 | 1298 | pm_runtime_put_autosuspend(d40c->base->dev); |
| 1196 | 1299 | spin_unlock_irqrestore(&d40c->lock, flags); |
| 1197 | 1300 | return res; |
| 1198 | 1301 | } |
| 1199 | 1302 | |
| 1200 | −static int d40_terminate_all(struct d40_chan *chan) | |
| 1201 | −{ | |
| 1202 | − unsigned long flags; | |
| 1203 | − int ret = 0; | |
| 1204 | − | |
| 1205 | − ret = d40_pause(chan); | |
| 1206 | − if (!ret && chan_is_physical(chan)) | |
| 1207 | − ret = d40_channel_execute_command(chan, D40_DMA_STOP); | |
| 1208 | − | |
| 1209 | − spin_lock_irqsave(&chan->lock, flags); | |
| 1210 | − d40_term_all(chan); | |
| 1211 | − spin_unlock_irqrestore(&chan->lock, flags); | |
| 1212 | − | |
| 1213 | − return ret; | |
| 1214 | −} | |
| 1215 | − | |
| 1216 | 1303 | static dma_cookie_t d40_tx_submit(struct dma_async_tx_descriptor *tx) |
| 1217 | 1304 | { |
| 1218 | 1305 | struct d40_chan *d40c = container_of(tx->chan, |
| @@ -1232,20 +1319,6 @@ static dma_cookie_t d40_tx_submit(struct dma_async_tx_descriptor *tx) · 13 unmodified lines | ||
| 1232 | 1319 | |
| 1233 | 1320 | static int d40_start(struct d40_chan *d40c) |
| 1234 | 1321 | { |
| 1235 | − if (d40c->base->rev == 0) { | |
| 1236 | − int err; | |
| 1237 | − | |
| 1238 | − if (chan_is_logical(d40c)) { | |
| 1239 | − err = d40_channel_execute_command(d40c, | |
| 1240 | − D40_DMA_SUSPEND_REQ); | |
| 1241 | − if (err) | |
| 1242 | − return err; | |
| 1243 | − } | |
| 1244 | − } | |
| 1245 | − | |
| 1246 | − if (chan_is_logical(d40c)) | |
| 1247 | − d40_config_set_event(d40c, true); | |
| 1248 | − | |
| 1249 | 1322 | return d40_channel_execute_command(d40c, D40_DMA_RUN); |
| 1250 | 1323 | } |
| 1251 | 1324 | |
| @@ -1258,10 +1331,10 @@ static struct d40_desc *d40_queue_start(struct d40_chan *d40c) · 6 unmodified lines | ||
| 1258 | 1331 | d40d = d40_first_queued(d40c); |
| 1259 | 1332 | |
| 1260 | 1333 | if (d40d != NULL) { |
| 1261 | − if (!d40c->busy) | |
| 1334 | + if (!d40c->busy) { | |
| 1262 | 1335 | d40c->busy = true; |
| 1263 | − | |
| 1264 | − pm_runtime_get_sync(d40c->base->dev); | |
| 1336 | + pm_runtime_get_sync(d40c->base->dev); | |
| 1337 | + } | |
| 1265 | 1338 | |
| 1266 | 1339 | /* Remove from queue */ |
| 1267 | 1340 | d40_desc_remove(d40d); |
| @@ -1388,8 +1461,8 @@ static void dma_tasklet(unsigned long data) · 120 unmodified lines | ||
| 1388 | 1461 | |
| 1389 | 1462 | return; |
| 1390 | 1463 | |
| 1391 | − err: | |
| 1392 | − /* Rescue manoeuvre if receiving double interrupts */ | |
| 1464 | +err: | |
| 1465 | + /* Rescue manouver if receiving double interrupts */ | |
| 1393 | 1466 | if (d40c->pending_tx > 0) |
| 1394 | 1467 | d40c->pending_tx--; |
| 1395 | 1468 | spin_unlock_irqrestore(&d40c->lock, flags); |
| @@ -1770,7 +1843,6 @@ static int d40_config_memcpy(struct d40_chan *d40c) · 374 unmodified lines | ||
| 1770 | 1843 | return 0; |
| 1771 | 1844 | } |
| 1772 | 1845 | |
| 1773 | − | |
| 1774 | 1846 | static int d40_free_dma(struct d40_chan *d40c) |
| 1775 | 1847 | { |
| 1776 | 1848 | |
| @@ -1806,43 +1878,18 @@ static int d40_free_dma(struct d40_chan *d40c) · 29 unmodified lines | ||
| 1806 | 1878 | } |
| 1807 | 1879 | |
| 1808 | 1880 | pm_runtime_get_sync(d40c->base->dev); |
| 1809 | − res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ); | |
| 1881 | + res = d40_channel_execute_command(d40c, D40_DMA_STOP); | |
| 1810 | 1882 | if (res) { |
| 1811 | − chan_err(d40c, "suspend failed\n"); | |
| 1883 | + chan_err(d40c, "stop failed\n"); | |
| 1812 | 1884 | goto out; |
| 1813 | 1885 | } |
| 1814 | 1886 | |
| 1815 | − if (chan_is_logical(d40c)) { | |
| 1816 | − /* Release logical channel, deactivate the event line */ | |
| 1887 | + d40_alloc_mask_free(phy, is_src, chan_is_logical(d40c) ? event : 0); | |
| 1817 | 1888 | |
| 1818 | − d40_config_set_event(d40c, false); | |
| 1889 | + if (chan_is_logical(d40c)) | |
| 1819 | 1890 | d40c->base->lookup_log_chans[d40c->log_num] = NULL; |
| 1820 | − | |
| 1821 | − /* | |
| 1822 | − * Check if there are more logical allocation | |
| 1823 | − * on this phy channel. | |
| 1824 | − */ | |
| 1825 | − if (!d40_alloc_mask_free(phy, is_src, event)) { | |
| 1826 | − /* Resume the other logical channels if any */ | |
| 1827 | − if (d40_chan_has_events(d40c)) { | |
| 1828 | − res = d40_channel_execute_command(d40c, | |
| 1829 | − D40_DMA_RUN); | |
| 1830 | − if (res) | |
| 1831 | − chan_err(d40c, | |
| 1832 | − "Executing RUN command\n"); | |
| 1833 | − } | |
| 1834 | − goto out; | |
| 1835 | − } | |
| 1836 | − } else { | |
| 1837 | − (void) d40_alloc_mask_free(phy, is_src, 0); | |
| 1838 | − } | |
| 1839 | − | |
| 1840 | − /* Release physical channel */ | |
| 1841 | − res = d40_channel_execute_command(d40c, D40_DMA_STOP); | |
| 1842 | − if (res) { | |
| 1843 | − chan_err(d40c, "Failed to stop channel\n"); | |
| 1844 | − goto out; | |
| 1845 | − } | |
| 1891 | + else | |
| 1892 | + d40c->base->lookup_phy_chans[phy->num] = NULL; | |
| 1846 | 1893 | |
| 1847 | 1894 | if (d40c->busy) { |
| 1848 | 1895 | pm_runtime_mark_last_busy(d40c->base->dev); |
| @@ -1852,7 +1899,6 @@ static int d40_free_dma(struct d40_chan *d40c) · 3 unmodified lines | ||
| 1852 | 1899 | d40c->busy = false; |
| 1853 | 1900 | d40c->phy_chan = NULL; |
| 1854 | 1901 | d40c->configured = false; |
| 1855 | − d40c->base->lookup_phy_chans[phy->num] = NULL; | |
| 1856 | 1902 | out: |
| 1857 | 1903 | |
| 1858 | 1904 | pm_runtime_mark_last_busy(d40c->base->dev); |
| @@ -2070,7 +2116,7 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, · 211 unmodified lines | ||
| 2070 | 2116 | if (sg_next(&sg_src[sg_len - 1]) == sg_src) |
| 2071 | 2117 | desc->cyclic = true; |
| 2072 | 2118 | |
| 2073 | − if (direction != DMA_NONE) { | |
| 2119 | + if (direction != DMA_TRANS_NONE) { | |
| 2074 | 2120 | dma_addr_t dev_addr = d40_get_dev_addr(chan, direction); |
| 2075 | 2121 | |
| 2076 | 2122 | if (direction == DMA_DEV_TO_MEM) |
| @@ -2371,6 +2417,31 @@ static void d40_issue_pending(struct dma_chan *chan) · 294 unmodified lines | ||
| 2371 | 2417 | spin_unlock_irqrestore(&d40c->lock, flags); |
| 2372 | 2418 | } |
| 2373 | 2419 | |
| 2420 | +static void d40_terminate_all(struct dma_chan *chan) | |
| 2421 | +{ | |
| 2422 | + unsigned long flags; | |
| 2423 | + struct d40_chan *d40c = container_of(chan, struct d40_chan, chan); | |
| 2424 | + int ret; | |
| 2425 | + | |
| 2426 | + spin_lock_irqsave(&d40c->lock, flags); | |
| 2427 | + | |
| 2428 | + pm_runtime_get_sync(d40c->base->dev); | |
| 2429 | + ret = d40_channel_execute_command(d40c, D40_DMA_STOP); | |
| 2430 | + if (ret) | |
| 2431 | + chan_err(d40c, "Failed to stop channel\n"); | |
| 2432 | + | |
| 2433 | + d40_term_all(d40c); | |
| 2434 | + pm_runtime_mark_last_busy(d40c->base->dev); | |
| 2435 | + pm_runtime_put_autosuspend(d40c->base->dev); | |
| 2436 | + if (d40c->busy) { | |
| 2437 | + pm_runtime_mark_last_busy(d40c->base->dev); | |
| 2438 | + pm_runtime_put_autosuspend(d40c->base->dev); | |
| 2439 | + } | |
| 2440 | + d40c->busy = false; | |
| 2441 | + | |
| 2442 | + spin_unlock_irqrestore(&d40c->lock, flags); | |
| 2443 | +} | |
| 2444 | + | |
| 2374 | 2445 | static int |
| 2375 | 2446 | dma40_config_to_halfchannel(struct d40_chan *d40c, |
| 2376 | 2447 | struct stedma40_half_channel_info *info, |
| @@ -2551,7 +2622,8 @@ static int d40_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · 174 unmodified lines | ||
| 2551 | 2622 | |
| 2552 | 2623 | switch (cmd) { |
| 2553 | 2624 | case DMA_TERMINATE_ALL: |
| 2554 | − return d40_terminate_all(d40c); | |
| 2625 | + d40_terminate_all(chan); | |
| 2626 | + return 0; | |
| 2555 | 2627 | case DMA_PAUSE: |
| 2556 | 2628 | return d40_pause(d40c); |
| 2557 | 2629 | case DMA_RESUME: |
| @@ -2908,6 +2980,12 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev) · 350 unmodified lines | ||
| 2908 | 2980 | dev_info(&pdev->dev, "hardware revision: %d @ 0x%x\n", |
| 2909 | 2981 | rev, res->start); |
| 2910 | 2982 | |
| 2983 | + if (rev < 2) { | |
| 2984 | + d40_err(&pdev->dev, "hardware revision: %d is not supported", | |
| 2985 | + rev); | |
| 2986 | + goto failure; | |
| 2987 | + } | |
| 2988 | + | |
| 2911 | 2989 | plat_data = pdev->dev.platform_data; |
| 2912 | 2990 | |
| 2913 | 2991 | /* Count the number of logical channels in use */ |
| @@ -2998,6 +3076,7 @@ failure: · 84 unmodified lines | ||
| 2998 | 3076 | |
| 2999 | 3077 | if (base) { |
| 3000 | 3078 | kfree(base->lcla_pool.alloc_map); |
| 3079 | + kfree(base->reg_val_backup_chan); | |
| 3001 | 3080 | kfree(base->lookup_log_chans); |
| 3002 | 3081 | kfree(base->lookup_phy_chans); |
| 3003 | 3082 | kfree(base->phy_res); |
| @@ -62,8 +62,6 @@ · 61 unmodified lines | ||
| 62 | 62 | #define D40_SREG_ELEM_LOG_LIDX_MASK (0xFF << D40_SREG_ELEM_LOG_LIDX_POS) |
| 63 | 63 | |
| 64 | 64 | /* Link register */ |
| 65 | −#define D40_DEACTIVATE_EVENTLINE 0x0 | |
| 66 | −#define D40_ACTIVATE_EVENTLINE 0x1 | |
| 67 | 65 | #define D40_EVENTLINE_POS(i) (2 * i) |
| 68 | 66 | #define D40_EVENTLINE_MASK(i) (0x3 << D40_EVENTLINE_POS(i)) |
| 69 | 67 | |
| @@ -191,6 +191,176 @@ utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len) · 190 unmodified lines | ||
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | +static bool | |
| 195 | +validate_device_path(struct efi_variable *var, int match, u8 *buffer, int len) | |
| 196 | +{ | |
| 197 | + struct efi_generic_dev_path *node; | |
| 198 | + int offset = 0; | |
| 199 | + | |
| 200 | + node = (struct efi_generic_dev_path *)buffer; | |
| 201 | + | |
| 202 | + while (offset < len) { | |
| 203 | + offset += node->length; | |
| 204 | + | |
| 205 | + if (offset > len) | |
| 206 | + return false; | |
| 207 | + | |
| 208 | + if ((node->type == EFI_DEV_END_PATH || | |
| 209 | + node->type == EFI_DEV_END_PATH2) && | |
| 210 | + node->sub_type == EFI_DEV_END_ENTIRE) | |
| 211 | + return true; | |
| 212 | + | |
| 213 | + node = (struct efi_generic_dev_path *)(buffer + offset); | |
| 214 | + } | |
| 215 | + | |
| 216 | + /* | |
| 217 | + * If we're here then either node->length pointed past the end | |
| 218 | + * of the buffer or we reached the end of the buffer without | |
| 219 | + * finding a device path end node. | |
| 220 | + */ | |
| 221 | + return false; | |
| 222 | +} | |
| 223 | + | |
| 224 | +static bool | |
| 225 | +validate_boot_order(struct efi_variable *var, int match, u8 *buffer, int len) | |
| 226 | +{ | |
| 227 | + /* An array of 16-bit integers */ | |
| 228 | + if ((len % 2) != 0) | |
| 229 | + return false; | |
| 230 | + | |
| 231 | + return true; | |
| 232 | +} | |
| 233 | + | |
| 234 | +static bool | |
| 235 | +validate_load_option(struct efi_variable *var, int match, u8 *buffer, int len) | |
| 236 | +{ | |
| 237 | + u16 filepathlength; | |
| 238 | + int i, desclength = 0; | |
| 239 | + | |
| 240 | + /* Either "Boot" or "Driver" followed by four digits of hex */ | |
| 241 | + for (i = match; i < match+4; i++) { | |
| 242 | + if (hex_to_bin(var->VariableName[i] & 0xff) < 0) | |
| 243 | + return true; | |
| 244 | + } | |
| 245 | + | |
| 246 | + /* A valid entry must be at least 6 bytes */ | |
| 247 | + if (len < 6) | |
| 248 | + return false; | |
| 249 | + | |
| 250 | + filepathlength = buffer[4] | buffer[5] << 8; | |
| 251 | + | |
| 252 | + /* | |
| 253 | + * There's no stored length for the description, so it has to be | |
| 254 | + * found by hand | |
| 255 | + */ | |
| 256 | + desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len) + 2; | |
| 257 | + | |
| 258 | + /* Each boot entry must have a descriptor */ | |
| 259 | + if (!desclength) | |
| 260 | + return false; | |
| 261 | + | |
| 262 | + /* | |
| 263 | + * If the sum of the length of the description, the claimed filepath | |
| 264 | + * length and the original header are greater than the length of the | |
| 265 | + * variable, it's malformed | |
| 266 | + */ | |
| 267 | + if ((desclength + filepathlength + 6) > len) | |
| 268 | + return false; | |
| 269 | + | |
| 270 | + /* | |
| 271 | + * And, finally, check the filepath | |
| 272 | + */ | |
| 273 | + return validate_device_path(var, match, buffer + desclength + 6, | |
| 274 | + filepathlength); | |
| 275 | +} | |
| 276 | + | |
| 277 | +static bool | |
| 278 | +validate_uint16(struct efi_variable *var, int match, u8 *buffer, int len) | |
| 279 | +{ | |
| 280 | + /* A single 16-bit integer */ | |
| 281 | + if (len != 2) | |
| 282 | + return false; | |
| 283 | + | |
| 284 | + return true; | |
| 285 | +} | |
| 286 | + | |
| 287 | +static bool | |
| 288 | +validate_ascii_string(struct efi_variable *var, int match, u8 *buffer, int len) | |
| 289 | +{ | |
| 290 | + int i; | |
| 291 | + | |
| 292 | + for (i = 0; i < len; i++) { | |
| 293 | + if (buffer[i] > 127) | |
| 294 | + return false; | |
| 295 | + | |
| 296 | + if (buffer[i] == 0) | |
| 297 | + return true; | |
| 298 | + } | |
| 299 | + | |
| 300 | + return false; | |
| 301 | +} | |
| 302 | + | |
| 303 | +struct variable_validate { | |
| 304 | + char *name; | |
| 305 | + bool (*validate)(struct efi_variable *var, int match, u8 *data, | |
| 306 | + int len); | |
| 307 | +}; | |
| 308 | + | |
| 309 | +static const struct variable_validate variable_validate[] = { | |
| 310 | + { "BootNext", validate_uint16 }, | |
| 311 | + { "BootOrder", validate_boot_order }, | |
| 312 | + { "DriverOrder", validate_boot_order }, | |
| 313 | + { "Boot*", validate_load_option }, | |
| 314 | + { "Driver*", validate_load_option }, | |
| 315 | + { "ConIn", validate_device_path }, | |
| 316 | + { "ConInDev", validate_device_path }, | |
| 317 | + { "ConOut", validate_device_path }, | |
| 318 | + { "ConOutDev", validate_device_path }, | |
| 319 | + { "ErrOut", validate_device_path }, | |
| 320 | + { "ErrOutDev", validate_device_path }, | |
| 321 | + { "Timeout", validate_uint16 }, | |
| 322 | + { "Lang", validate_ascii_string }, | |
| 323 | + { "PlatformLang", validate_ascii_string }, | |
| 324 | + { "", NULL }, | |
| 325 | +}; | |
| 326 | + | |
| 327 | +static bool | |
| 328 | +validate_var(struct efi_variable *var, u8 *data, int len) | |
| 329 | +{ | |
| 330 | + int i; | |
| 331 | + u16 *unicode_name = var->VariableName; | |
| 332 | + | |
| 333 | + for (i = 0; variable_validate[i].validate != NULL; i++) { | |
| 334 | + const char *name = variable_validate[i].name; | |
| 335 | + int match; | |
| 336 | + | |
| 337 | + for (match = 0; ; match++) { | |
| 338 | + char c = name[match]; | |
| 339 | + u16 u = unicode_name[match]; | |
| 340 | + | |
| 341 | + /* All special variables are plain ascii */ | |
| 342 | + if (u > 127) | |
| 343 | + return true; | |
| 344 | + | |
| 345 | + /* Wildcard in the matching name means we've matched */ | |
| 346 | + if (c == '*') | |
| 347 | + return variable_validate[i].validate(var, | |
| 348 | + match, data, len); | |
| 349 | + | |
| 350 | + /* Case sensitive match */ | |
| 351 | + if (c != u) | |
| 352 | + break; | |
| 353 | + | |
| 354 | + /* Reached the end of the string while matching */ | |
| 355 | + if (!c) | |
| 356 | + return variable_validate[i].validate(var, | |
| 357 | + match, data, len); | |
| 358 | + } | |
| 359 | + } | |
| 360 | + | |
| 361 | + return true; | |
| 362 | +} | |
| 363 | + | |
| 194 | 364 | static efi_status_t |
| 195 | 365 | get_var_data_locked(struct efivars *efivars, struct efi_variable *var) |
| 196 | 366 | { |
| @@ -324,6 +494,12 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) · 127 unmodified lines | ||
| 324 | 494 | return -EINVAL; |
| 325 | 495 | } |
| 326 | 496 | |
| 497 | + if ((new_var->Attributes & ~EFI_VARIABLE_MASK) != 0 || | |
| 498 | + validate_var(new_var, new_var->Data, new_var->DataSize) == false) { | |
| 499 | + printk(KERN_ERR "efivars: Malformed variable content\n"); | |
| 500 | + return -EINVAL; | |
| 501 | + } | |
| 502 | + | |
| 327 | 503 | spin_lock(&efivars->lock); |
| 328 | 504 | status = efivars->ops->set_variable(new_var->VariableName, |
| 329 | 505 | &new_var->VendorGuid, |
| @@ -626,6 +802,12 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 296 unmodified lines | ||
| 626 | 802 | if (!capable(CAP_SYS_ADMIN)) |
| 627 | 803 | return -EACCES; |
| 628 | 804 | |
| 805 | + if ((new_var->Attributes & ~EFI_VARIABLE_MASK) != 0 || | |
| 806 | + validate_var(new_var, new_var->Data, new_var->DataSize) == false) { | |
| 807 | + printk(KERN_ERR "efivars: Malformed variable content\n"); | |
| 808 | + return -EINVAL; | |
| 809 | + } | |
| 810 | + | |
| 629 | 811 | spin_lock(&efivars->lock); |
| 630 | 812 | |
| 631 | 813 | /* |
| @@ -64,6 +64,7 @@ struct pxa_gpio_chip { · 63 unmodified lines | ||
| 64 | 64 | unsigned long irq_mask; |
| 65 | 65 | unsigned long irq_edge_rise; |
| 66 | 66 | unsigned long irq_edge_fall; |
| 67 | + int (*set_wake)(unsigned int gpio, unsigned int on); | |
| 67 | 68 | |
| 68 | 69 | #ifdef CONFIG_PM |
| 69 | 70 | unsigned long saved_gplr; |
| @@ -269,7 +270,8 @@ static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value) · 199 unmodified lines | ||
| 269 | 270 | (value ? GPSR_OFFSET : GPCR_OFFSET)); |
| 270 | 271 | } |
| 271 | 272 | |
| 272 | −static int __devinit pxa_init_gpio_chip(int gpio_end) | |
| 273 | +static int __devinit pxa_init_gpio_chip(int gpio_end, | |
| 274 | + int (*set_wake)(unsigned int, unsigned int)) | |
| 273 | 275 | { |
| 274 | 276 | int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1; |
| 275 | 277 | struct pxa_gpio_chip *chips; |
| @@ -285,6 +287,7 @@ static int __devinit pxa_init_gpio_chip(int gpio_end) · 9 unmodified lines | ||
| 285 | 287 | |
| 286 | 288 | sprintf(chips[i].label, "gpio-%d", i); |
| 287 | 289 | chips[i].regbase = gpio_reg_base + BANK_OFF(i); |
| 290 | + chips[i].set_wake = set_wake; | |
| 288 | 291 | |
| 289 | 292 | c->base = gpio; |
| 290 | 293 | c->label = chips[i].label; |
| @@ -412,6 +415,17 @@ static void pxa_mask_muxed_gpio(struct irq_data *d) · 121 unmodified lines | ||
| 412 | 415 | writel_relaxed(gfer, c->regbase + GFER_OFFSET); |
| 413 | 416 | } |
| 414 | 417 | |
| 418 | +static int pxa_gpio_set_wake(struct irq_data *d, unsigned int on) | |
| 419 | +{ | |
| 420 | + int gpio = pxa_irq_to_gpio(d->irq); | |
| 421 | + struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); | |
| 422 | + | |
| 423 | + if (c->set_wake) | |
| 424 | + return c->set_wake(gpio, on); | |
| 425 | + else | |
| 426 | + return 0; | |
| 427 | +} | |
| 428 | + | |
| 415 | 429 | static void pxa_unmask_muxed_gpio(struct irq_data *d) |
| 416 | 430 | { |
| 417 | 431 | int gpio = pxa_irq_to_gpio(d->irq); |
| @@ -427,6 +441,7 @@ static struct irq_chip pxa_muxed_gpio_chip = { · 9 unmodified lines | ||
| 427 | 441 | .irq_mask = pxa_mask_muxed_gpio, |
| 428 | 442 | .irq_unmask = pxa_unmask_muxed_gpio, |
| 429 | 443 | .irq_set_type = pxa_gpio_irq_type, |
| 444 | + .irq_set_wake = pxa_gpio_set_wake, | |
| 430 | 445 | }; |
| 431 | 446 | |
| 432 | 447 | static int pxa_gpio_nums(void) |
| @@ -471,6 +486,7 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev) · 38 unmodified lines | ||
| 471 | 486 | struct pxa_gpio_chip *c; |
| 472 | 487 | struct resource *res; |
| 473 | 488 | struct clk *clk; |
| 489 | + struct pxa_gpio_platform_data *info; | |
| 474 | 490 | int gpio, irq, ret; |
| 475 | 491 | int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; |
| 476 | 492 | |
| @@ -516,7 +532,8 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev) · 39 unmodified lines | ||
| 516 | 532 | } |
| 517 | 533 | |
| 518 | 534 | /* Initialize GPIO chips */ |
| 519 | − pxa_init_gpio_chip(pxa_last_gpio); | |
| 535 | + info = dev_get_platdata(&pdev->dev); | |
| 536 | + pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL); | |
| 520 | 537 | |
| 521 | 538 | /* clear all GPIO edge detects */ |
| 522 | 539 | for_each_gpio_chip(gpio, c) { |
| @@ -1510,8 +1510,8 @@ int drm_freebufs(struct drm_device *dev, void *data, · 1509 unmodified lines | ||
| 1510 | 1510 | * \param arg pointer to a drm_buf_map structure. |
| 1511 | 1511 | * \return zero on success or a negative number on failure. |
| 1512 | 1512 | * |
| 1513 | − * Maps the AGP, SG or PCI buffer region with do_mmap(), and copies information | |
| 1514 | − * about each buffer into user space. For PCI buffers, it calls do_mmap() with | |
| 1513 | + * Maps the AGP, SG or PCI buffer region with vm_mmap(), and copies information | |
| 1514 | + * about each buffer into user space. For PCI buffers, it calls vm_mmap() with | |
| 1515 | 1515 | * offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls |
| 1516 | 1516 | * drm_mmap_dma(). |
| 1517 | 1517 | */ |
| @@ -1553,18 +1553,14 @@ int drm_mapbufs(struct drm_device *dev, void *data, · 35 unmodified lines | ||
| 1553 | 1553 | retcode = -EINVAL; |
| 1554 | 1554 | goto done; |
| 1555 | 1555 | } |
| 1556 | − down_write(¤t->mm->mmap_sem); | |
| 1557 | − virtual = do_mmap(file_priv->filp, 0, map->size, | |
| 1556 | + virtual = vm_mmap(file_priv->filp, 0, map->size, | |
| 1558 | 1557 | PROT_READ | PROT_WRITE, |
| 1559 | 1558 | MAP_SHARED, |
| 1560 | 1559 | token); |
| 1561 | − up_write(¤t->mm->mmap_sem); | |
| 1562 | 1560 | } else { |
| 1563 | − down_write(¤t->mm->mmap_sem); | |
| 1564 | − virtual = do_mmap(file_priv->filp, 0, dma->byte_count, | |
| 1561 | + virtual = vm_mmap(file_priv->filp, 0, dma->byte_count, | |
| 1565 | 1562 | PROT_READ | PROT_WRITE, |
| 1566 | 1563 | MAP_SHARED, 0); |
| 1567 | − up_write(¤t->mm->mmap_sem); | |
| 1568 | 1564 | } |
| 1569 | 1565 | if (virtual > -1024UL) { |
| 1570 | 1566 | /* Real error */ |
| @@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, · 3334 unmodified lines | ||
| 3335 | 3335 | |
| 3336 | 3336 | ret = crtc->funcs->page_flip(crtc, fb, e); |
| 3337 | 3337 | if (ret) { |
| 3338 | − spin_lock_irqsave(&dev->event_lock, flags); | |
| 3339 | − file_priv->event_space += sizeof e->event; | |
| 3340 | − spin_unlock_irqrestore(&dev->event_lock, flags); | |
| 3341 | − kfree(e); | |
| 3338 | + if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { | |
| 3339 | + spin_lock_irqsave(&dev->event_lock, flags); | |
| 3340 | + file_priv->event_space += sizeof e->event; | |
| 3341 | + spin_unlock_irqrestore(&dev->event_lock, flags); | |
| 3342 | + kfree(e); | |
| 3343 | + } | |
| 3342 | 3344 | } |
| 3343 | 3345 | |
| 3344 | 3346 | out: |
| @@ -507,12 +507,12 @@ int drm_release(struct inode *inode, struct file *filp) · 506 unmodified lines | ||
| 507 | 507 | |
| 508 | 508 | drm_events_release(file_priv); |
| 509 | 509 | |
| 510 | − if (dev->driver->driver_features & DRIVER_GEM) | |
| 511 | − drm_gem_release(dev, file_priv); | |
| 512 | − | |
| 513 | 510 | if (dev->driver->driver_features & DRIVER_MODESET) |
| 514 | 511 | drm_fb_release(file_priv); |
| 515 | 512 | |
| 513 | + if (dev->driver->driver_features & DRIVER_GEM) | |
| 514 | + drm_gem_release(dev, file_priv); | |
| 515 | + | |
| 516 | 516 | mutex_lock(&dev->ctxlist_mutex); |
| 517 | 517 | if (!list_empty(&dev->ctxlist)) { |
| 518 | 518 | struct drm_ctx_list *pos, *n; |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | #include "drmP.h" |
| 2 | 2 | #include <linux/usb.h> |
| 3 | −#include <linux/export.h> | |
| 3 | +#include <linux/module.h> | |
| 4 | 4 | |
| 5 | 5 | int drm_get_usb_dev(struct usb_interface *interface, |
| 6 | 6 | const struct usb_device_id *id, |
| @@ -114,3 +114,7 @@ void drm_usb_exit(struct drm_driver *driver, · 107 unmodified lines | ||
| 114 | 114 | usb_deregister(udriver); |
| 115 | 115 | } |
| 116 | 116 | EXPORT_SYMBOL(drm_usb_exit); |
| 117 | + | |
| 118 | +MODULE_AUTHOR("David Airlie"); | |
| 119 | +MODULE_DESCRIPTION("USB DRM support"); | |
| 120 | +MODULE_LICENSE("GPL and additional rights"); | |
| @@ -149,22 +149,12 @@ static int exynos_drm_gem_map_pages(struct drm_gem_object *obj, · 148 unmodified lines | ||
| 149 | 149 | unsigned long pfn; |
| 150 | 150 | |
| 151 | 151 | if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) { |
| 152 | − unsigned long usize = buf->size; | |
| 153 | − | |
| 154 | 152 | if (!buf->pages) |
| 155 | 153 | return -EINTR; |
| 156 | 154 | |
| 157 | − while (usize > 0) { | |
| 158 | − pfn = page_to_pfn(buf->pages[page_offset++]); | |
| 159 | − vm_insert_mixed(vma, f_vaddr, pfn); | |
| 160 | − f_vaddr += PAGE_SIZE; | |
| 161 | − usize -= PAGE_SIZE; | |
| 162 | − } | |
| 163 | − | |
| 164 | − return 0; | |
| 165 | − } | |
| 166 | − | |
| 167 | − pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset; | |
| 155 | + pfn = page_to_pfn(buf->pages[page_offset++]); | |
| 156 | + } else | |
| 157 | + pfn = (buf->dma_addr >> PAGE_SHIFT) + page_offset; | |
| 168 | 158 | |
| 169 | 159 | return vm_insert_mixed(vma, f_vaddr, pfn); |
| 170 | 160 | } |
| @@ -524,6 +514,8 @@ static int exynos_drm_gem_mmap_buffer(struct file *filp, · 353 unmodified lines | ||
| 524 | 514 | if (!buffer->pages) |
| 525 | 515 | return -EINVAL; |
| 526 | 516 | |
| 517 | + vma->vm_flags |= VM_MIXEDMAP; | |
| 518 | + | |
| 527 | 519 | do { |
| 528 | 520 | ret = vm_insert_page(vma, uaddr, buffer->pages[i++]); |
| 529 | 521 | if (ret) { |
| @@ -581,10 +573,8 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, · 51 unmodified lines | ||
| 581 | 573 | obj->filp->f_op = &exynos_drm_gem_fops; |
| 582 | 574 | obj->filp->private_data = obj; |
| 583 | 575 | |
| 584 | − down_write(¤t->mm->mmap_sem); | |
| 585 | − addr = do_mmap(obj->filp, 0, args->size, | |
| 576 | + addr = vm_mmap(obj->filp, 0, args->size, | |
| 586 | 577 | PROT_READ | PROT_WRITE, MAP_SHARED, 0); |
| 587 | − up_write(¤t->mm->mmap_sem); | |
| 588 | 578 | |
| 589 | 579 | drm_gem_object_unreference_unlocked(obj); |
| 590 | 580 | |
| @@ -712,7 +702,6 @@ int exynos_drm_gem_dumb_destroy(struct drm_file *file_priv, · 121 unmodified lines | ||
| 712 | 702 | int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) |
| 713 | 703 | { |
| 714 | 704 | struct drm_gem_object *obj = vma->vm_private_data; |
| 715 | − struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj); | |
| 716 | 705 | struct drm_device *dev = obj->dev; |
| 717 | 706 | unsigned long f_vaddr; |
| 718 | 707 | pgoff_t page_offset; |
| @@ -724,21 +713,10 @@ int exynos_drm_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 5 unmodified lines | ||
| 724 | 713 | |
| 725 | 714 | mutex_lock(&dev->struct_mutex); |
| 726 | 715 | |
| 727 | − /* | |
| 728 | − * allocate all pages as desired size if user wants to allocate | |
| 729 | − * physically non-continuous memory. | |
| 730 | − */ | |
| 731 | − if (exynos_gem_obj->flags & EXYNOS_BO_NONCONTIG) { | |
| 732 | − ret = exynos_drm_gem_get_pages(obj); | |
| 733 | − if (ret < 0) | |
| 734 | − goto err; | |
| 735 | − } | |
| 736 | − | |
| 737 | 716 | ret = exynos_drm_gem_map_pages(obj, vma, f_vaddr, page_offset); |
| 738 | 717 | if (ret < 0) |
| 739 | 718 | DRM_ERROR("failed to map pages.\n"); |
| 740 | 719 | |
| 741 | −err: | |
| 742 | 720 | mutex_unlock(&dev->struct_mutex); |
| 743 | 721 | |
| 744 | 722 | return convert_to_vm_err_msg(ret); |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | #define __MDFLD_DSI_OUTPUT_H__ |
| 30 | 30 | |
| 31 | 31 | #include <linux/backlight.h> |
| 32 | −#include <linux/version.h> | |
| 33 | 32 | #include <drm/drmP.h> |
| 34 | 33 | #include <drm/drm.h> |
| 35 | 34 | #include <drm/drm_crtc.h> |
| @@ -129,6 +129,7 @@ static int i810_map_buffer(struct drm_buf *buf, struct drm_file *file_priv) · 128 unmodified lines | ||
| 129 | 129 | if (buf_priv->currently_mapped == I810_BUF_MAPPED) |
| 130 | 130 | return -EINVAL; |
| 131 | 131 | |
| 132 | + /* This is all entirely broken */ | |
| 132 | 133 | down_write(¤t->mm->mmap_sem); |
| 133 | 134 | old_fops = file_priv->filp->f_op; |
| 134 | 135 | file_priv->filp->f_op = &i810_buffer_fops; |
| @@ -157,11 +158,8 @@ static int i810_unmap_buffer(struct drm_buf *buf) · 22 unmodified lines | ||
| 157 | 158 | if (buf_priv->currently_mapped != I810_BUF_MAPPED) |
| 158 | 159 | return -EINVAL; |
| 159 | 160 | |
| 160 | − down_write(¤t->mm->mmap_sem); | |
| 161 | − retcode = do_munmap(current->mm, | |
| 162 | − (unsigned long)buf_priv->virtual, | |
| 161 | + retcode = vm_munmap((unsigned long)buf_priv->virtual, | |
| 163 | 162 | (size_t) buf->total); |
| 164 | − up_write(¤t->mm->mmap_sem); | |
| 165 | 163 | |
| 166 | 164 | buf_priv->currently_mapped = I810_BUF_UNMAPPED; |
| 167 | 165 | buf_priv->virtual = NULL; |
| @@ -1087,11 +1087,9 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, · 1086 unmodified lines | ||
| 1087 | 1087 | if (obj == NULL) |
| 1088 | 1088 | return -ENOENT; |
| 1089 | 1089 | |
| 1090 | − down_write(¤t->mm->mmap_sem); | |
| 1091 | − addr = do_mmap(obj->filp, 0, args->size, | |
| 1090 | + addr = vm_mmap(obj->filp, 0, args->size, | |
| 1092 | 1091 | PROT_READ | PROT_WRITE, MAP_SHARED, |
| 1093 | 1092 | args->offset); |
| 1094 | − up_write(¤t->mm->mmap_sem); | |
| 1095 | 1093 | drm_gem_object_unreference_unlocked(obj); |
| 1096 | 1094 | if (IS_ERR((void *)addr)) |
| 1097 | 1095 | return addr; |
| @@ -1133,6 +1133,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, · 1132 unmodified lines | ||
| 1133 | 1133 | return -EINVAL; |
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | + if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) { | |
| 1137 | + DRM_DEBUG("execbuf with %u cliprects\n", | |
| 1138 | + args->num_cliprects); | |
| 1139 | + return -EINVAL; | |
| 1140 | + } | |
| 1136 | 1141 | cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects), |
| 1137 | 1142 | GFP_KERNEL); |
| 1138 | 1143 | if (cliprects == NULL) { |
| @@ -1404,7 +1409,8 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, · 265 unmodified lines | ||
| 1404 | 1409 | struct drm_i915_gem_exec_object2 *exec2_list = NULL; |
| 1405 | 1410 | int ret; |
| 1406 | 1411 | |
| 1407 | − if (args->buffer_count < 1) { | |
| 1412 | + if (args->buffer_count < 1 || | |
| 1413 | + args->buffer_count > UINT_MAX / sizeof(*exec2_list)) { | |
| 1408 | 1414 | DRM_DEBUG("execbuf2 with %d buffers\n", args->buffer_count); |
| 1409 | 1415 | return -EINVAL; |
| 1410 | 1416 | } |
| @@ -568,6 +568,7 @@ · 567 unmodified lines | ||
| 568 | 568 | #define CM0_MASK_SHIFT 16 |
| 569 | 569 | #define CM0_IZ_OPT_DISABLE (1<<6) |
| 570 | 570 | #define CM0_ZR_OPT_DISABLE (1<<5) |
| 571 | +#define CM0_STC_EVICT_DISABLE_LRA_SNB (1<<5) | |
| 571 | 572 | #define CM0_DEPTH_EVICT_DISABLE (1<<4) |
| 572 | 573 | #define CM0_COLOR_EVICT_DISABLE (1<<3) |
| 573 | 574 | #define CM0_DEPTH_WRITE_DISABLE (1<<1) |
| @@ -430,8 +430,8 @@ intel_crt_detect(struct drm_connector *connector, bool force) · 429 unmodified lines | ||
| 430 | 430 | { |
| 431 | 431 | struct drm_device *dev = connector->dev; |
| 432 | 432 | struct intel_crt *crt = intel_attached_crt(connector); |
| 433 | − struct drm_crtc *crtc; | |
| 434 | 433 | enum drm_connector_status status; |
| 434 | + struct intel_load_detect_pipe tmp; | |
| 435 | 435 | |
| 436 | 436 | if (I915_HAS_HOTPLUG(dev)) { |
| 437 | 437 | if (intel_crt_detect_hotplug(connector)) { |
| @@ -450,23 +450,16 @@ intel_crt_detect(struct drm_connector *connector, bool force) · 12 unmodified lines | ||
| 450 | 450 | return connector->status; |
| 451 | 451 | |
| 452 | 452 | /* for pre-945g platforms use load detect */ |
| 453 | − crtc = crt->base.base.crtc; | |
| 454 | − if (crtc && crtc->enabled) { | |
| 455 | − status = intel_crt_load_detect(crt); | |
| 456 | − } else { | |
| 457 | − struct intel_load_detect_pipe tmp; | |
| 458 | − | |
| 459 | − if (intel_get_load_detect_pipe(&crt->base, connector, NULL, | |
| 460 | − &tmp)) { | |
| 461 | − if (intel_crt_detect_ddc(connector)) | |
| 462 | − status = connector_status_connected; | |
| 463 | − else | |
| 464 | − status = intel_crt_load_detect(crt); | |
| 465 | − intel_release_load_detect_pipe(&crt->base, connector, | |
| 466 | − &tmp); | |
| 467 | − } else | |
| 468 | − status = connector_status_unknown; | |
| 469 | − } | |
| 453 | + if (intel_get_load_detect_pipe(&crt->base, connector, NULL, | |
| 454 | + &tmp)) { | |
| 455 | + if (intel_crt_detect_ddc(connector)) | |
| 456 | + status = connector_status_connected; | |
| 457 | + else | |
| 458 | + status = intel_crt_load_detect(crt); | |
| 459 | + intel_release_load_detect_pipe(&crt->base, connector, | |
| 460 | + &tmp); | |
| 461 | + } else | |
| 462 | + status = connector_status_unknown; | |
| 470 | 463 | |
| 471 | 464 | return status; |
| 472 | 465 | } |
| @@ -3478,8 +3478,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, · 3477 unmodified lines | ||
| 3478 | 3478 | return false; |
| 3479 | 3479 | } |
| 3480 | 3480 | |
| 3481 | − /* All interlaced capable intel hw wants timings in frames. */ | |
| 3482 | − drm_mode_set_crtcinfo(adjusted_mode, 0); | |
| 3481 | + /* All interlaced capable intel hw wants timings in frames. Note though | |
| 3482 | + * that intel_lvds_mode_fixup does some funny tricks with the crtc | |
| 3483 | + * timings, so we need to be careful not to clobber these.*/ | |
| 3484 | + if (!(adjusted_mode->private_flags & INTEL_MODE_CRTC_TIMINGS_SET)) | |
| 3485 | + drm_mode_set_crtcinfo(adjusted_mode, 0); | |
| 3483 | 3486 | |
| 3484 | 3487 | return true; |
| 3485 | 3488 | } |
| @@ -7465,7 +7468,13 @@ static int intel_gen6_queue_flip(struct drm_device *dev, · 3979 unmodified lines | ||
| 7465 | 7468 | OUT_RING(fb->pitches[0] | obj->tiling_mode); |
| 7466 | 7469 | OUT_RING(obj->gtt_offset); |
| 7467 | 7470 | |
| 7468 | − pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE; | |
| 7471 | + /* Contrary to the suggestions in the documentation, | |
| 7472 | + * "Enable Panel Fitter" does not seem to be required when page | |
| 7473 | + * flipping with a non-native mode, and worse causes a normal | |
| 7474 | + * modeset to fail. | |
| 7475 | + * pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE; | |
| 7476 | + */ | |
| 7477 | + pf = 0; | |
| 7469 | 7478 | pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff; |
| 7470 | 7479 | OUT_RING(pf | pipesrc); |
| 7471 | 7480 | ADVANCE_LP_RING(); |
| @@ -105,6 +105,10 @@ · 104 unmodified lines | ||
| 105 | 105 | #define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0) |
| 106 | 106 | #define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT) |
| 107 | 107 | #define INTEL_MODE_DP_FORCE_6BPC (0x10) |
| 108 | +/* This flag must be set by the encoder's mode_fixup if it changes the crtc | |
| 109 | + * timings in the mode to prevent the crtc fixup from overwriting them. | |
| 110 | + * Currently only lvds needs that. */ | |
| 111 | +#define INTEL_MODE_CRTC_TIMINGS_SET (0x20) | |
| 108 | 112 | |
| 109 | 113 | static inline void |
| 110 | 114 | intel_mode_set_pixel_multiplier(struct drm_display_mode *mode, |
| @@ -279,6 +279,8 @@ void intel_fb_restore_mode(struct drm_device *dev) · 278 unmodified lines | ||
| 279 | 279 | struct drm_mode_config *config = &dev->mode_config; |
| 280 | 280 | struct drm_plane *plane; |
| 281 | 281 | |
| 282 | + mutex_lock(&dev->mode_config.mutex); | |
| 283 | + | |
| 282 | 284 | ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); |
| 283 | 285 | if (ret) |
| 284 | 286 | DRM_DEBUG("failed to restore crtc mode\n"); |
| @@ -286,4 +288,6 @@ void intel_fb_restore_mode(struct drm_device *dev) · 1 unmodified line | ||
| 286 | 288 | /* Be sure to shut off any planes that may be active */ |
| 287 | 289 | list_for_each_entry(plane, &config->plane_list, head) |
| 288 | 290 | plane->funcs->disable_plane(plane); |
| 291 | + | |
| 292 | + mutex_unlock(&dev->mode_config.mutex); | |
| 289 | 293 | } |
| @@ -187,6 +187,8 @@ centre_horizontally(struct drm_display_mode *mode, · 186 unmodified lines | ||
| 187 | 187 | |
| 188 | 188 | mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos; |
| 189 | 189 | mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width; |
| 190 | + | |
| 191 | + mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET; | |
| 190 | 192 | } |
| 191 | 193 | |
| 192 | 194 | static void |
| @@ -208,6 +210,8 @@ centre_vertically(struct drm_display_mode *mode, · 15 unmodified lines | ||
| 208 | 210 | |
| 209 | 211 | mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos; |
| 210 | 212 | mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width; |
| 213 | + | |
| 214 | + mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET; | |
| 211 | 215 | } |
| 212 | 216 | |
| 213 | 217 | static inline u32 panel_fitter_scaling(u32 source, u32 target) |
| @@ -283,6 +287,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, · 69 unmodified lines | ||
| 283 | 287 | for_each_pipe(pipe) |
| 284 | 288 | I915_WRITE(BCLRPAT(pipe), 0); |
| 285 | 289 | |
| 290 | + drm_mode_set_crtcinfo(adjusted_mode, 0); | |
| 291 | + | |
| 286 | 292 | switch (intel_lvds->fitting_mode) { |
| 287 | 293 | case DRM_MODE_SCALE_CENTER: |
| 288 | 294 | /* |
| @@ -47,8 +47,6 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, · 46 unmodified lines | ||
| 47 | 47 | adjusted_mode->vtotal = fixed_mode->vtotal; |
| 48 | 48 | |
| 49 | 49 | adjusted_mode->clock = fixed_mode->clock; |
| 50 | − | |
| 51 | − drm_mode_set_crtcinfo(adjusted_mode, 0); | |
| 52 | 50 | } |
| 53 | 51 | |
| 54 | 52 | /* adjusted_mode has been preset to be the panel's fixed mode */ |
| @@ -401,6 +401,14 @@ static int init_render_ring(struct intel_ring_buffer *ring) · 400 unmodified lines | ||
| 401 | 401 | if (INTEL_INFO(dev)->gen >= 6) { |
| 402 | 402 | I915_WRITE(INSTPM, |
| 403 | 403 | INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); |
| 404 | + | |
| 405 | + /* From the Sandybridge PRM, volume 1 part 3, page 24: | |
| 406 | + * "If this bit is set, STCunit will have LRA as replacement | |
| 407 | + * policy. [...] This bit must be reset. LRA replacement | |
| 408 | + * policy is not supported." | |
| 409 | + */ | |
| 410 | + I915_WRITE(CACHE_MODE_0, | |
| 411 | + CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); | |
| 404 | 412 | } |
| 405 | 413 | |
| 406 | 414 | return ret; |
| @@ -731,6 +731,7 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, · 730 unmodified lines | ||
| 731 | 731 | uint16_t width, height; |
| 732 | 732 | uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len; |
| 733 | 733 | uint16_t h_sync_offset, v_sync_offset; |
| 734 | + int mode_clock; | |
| 734 | 735 | |
| 735 | 736 | width = mode->crtc_hdisplay; |
| 736 | 737 | height = mode->crtc_vdisplay; |
| @@ -745,7 +746,11 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, · 8 unmodified lines | ||
| 745 | 746 | h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start; |
| 746 | 747 | v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start; |
| 747 | 748 | |
| 748 | − dtd->part1.clock = mode->clock / 10; | |
| 749 | + mode_clock = mode->clock; | |
| 750 | + mode_clock /= intel_mode_get_pixel_multiplier(mode) ?: 1; | |
| 751 | + mode_clock /= 10; | |
| 752 | + dtd->part1.clock = mode_clock; | |
| 753 | + | |
| 749 | 754 | dtd->part1.h_active = width & 0xff; |
| 750 | 755 | dtd->part1.h_blank = h_blank_len & 0xff; |
| 751 | 756 | dtd->part1.h_high = (((width >> 8) & 0xf) << 4) | |
| @@ -996,7 +1001,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, · 244 unmodified lines | ||
| 996 | 1001 | struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder); |
| 997 | 1002 | u32 sdvox; |
| 998 | 1003 | struct intel_sdvo_in_out_map in_out; |
| 999 | − struct intel_sdvo_dtd input_dtd; | |
| 1004 | + struct intel_sdvo_dtd input_dtd, output_dtd; | |
| 1000 | 1005 | int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode); |
| 1001 | 1006 | int rate; |
| 1002 | 1007 | |
| @@ -1021,20 +1026,13 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, · 18 unmodified lines | ||
| 1021 | 1026 | intel_sdvo->attached_output)) |
| 1022 | 1027 | return; |
| 1023 | 1028 | |
| 1024 | − /* We have tried to get input timing in mode_fixup, and filled into | |
| 1025 | − * adjusted_mode. | |
| 1026 | − */ | |
| 1027 | − if (intel_sdvo->is_tv || intel_sdvo->is_lvds) { | |
| 1028 | − input_dtd = intel_sdvo->input_dtd; | |
| 1029 | − } else { | |
| 1030 | − /* Set the output timing to the screen */ | |
| 1031 | − if (!intel_sdvo_set_target_output(intel_sdvo, | |
| 1032 | − intel_sdvo->attached_output)) | |
| 1033 | − return; | |
| 1034 | − | |
| 1035 | − intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); | |
| 1036 | − (void) intel_sdvo_set_output_timing(intel_sdvo, &input_dtd); | |
| 1037 | − } | |
| 1029 | + /* lvds has a special fixed output timing. */ | |
| 1030 | + if (intel_sdvo->is_lvds) | |
| 1031 | + intel_sdvo_get_dtd_from_mode(&output_dtd, | |
| 1032 | + intel_sdvo->sdvo_lvds_fixed_mode); | |
| 1033 | + else | |
| 1034 | + intel_sdvo_get_dtd_from_mode(&output_dtd, mode); | |
| 1035 | + (void) intel_sdvo_set_output_timing(intel_sdvo, &output_dtd); | |
| 1038 | 1036 | |
| 1039 | 1037 | /* Set the input timing to the screen. Assume always input 0. */ |
| 1040 | 1038 | if (!intel_sdvo_set_target_input(intel_sdvo)) |
| @@ -1052,6 +1050,10 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, · 11 unmodified lines | ||
| 1052 | 1050 | !intel_sdvo_set_tv_format(intel_sdvo)) |
| 1053 | 1051 | return; |
| 1054 | 1052 | |
| 1053 | + /* We have tried to get input timing in mode_fixup, and filled into | |
| 1054 | + * adjusted_mode. | |
| 1055 | + */ | |
| 1056 | + intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); | |
| 1055 | 1057 | (void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd); |
| 1056 | 1058 | |
| 1057 | 1059 | switch (pixel_multiplier) { |
| @@ -235,6 +235,7 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile) · 234 unmodified lines | ||
| 235 | 235 | return -EPERM; |
| 236 | 236 | |
| 237 | 237 | strncpy(string, profile, sizeof(string)); |
| 238 | + string[sizeof(string) - 1] = 0; | |
| 238 | 239 | if ((ptr = strchr(string, '\n'))) |
| 239 | 240 | *ptr = '\0'; |
| 240 | 241 | |
| @@ -42,7 +42,7 @@ nv50_sor_dp_lane_map(struct drm_device *dev, struct dcb_entry *dcb, u8 lane) · 41 unmodified lines | ||
| 42 | 42 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 43 | 43 | static const u8 nvaf[] = { 24, 16, 8, 0 }; /* thanks, apple.. */ |
| 44 | 44 | static const u8 nv50[] = { 16, 8, 0, 24 }; |
| 45 | − if (dev_priv->card_type == 0xaf) | |
| 45 | + if (dev_priv->chipset == 0xaf) | |
| 46 | 46 | return nvaf[lane]; |
| 47 | 47 | return nv50[lane]; |
| 48 | 48 | } |
| @@ -575,6 +575,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, · 574 unmodified lines | ||
| 575 | 575 | |
| 576 | 576 | if (rdev->family < CHIP_RV770) |
| 577 | 577 | pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; |
| 578 | + /* use frac fb div on APUs */ | |
| 579 | + if (ASIC_IS_DCE41(rdev) || ASIC_IS_DCE61(rdev)) | |
| 580 | + pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; | |
| 578 | 581 | } else { |
| 579 | 582 | pll->flags |= RADEON_PLL_LEGACY; |
| 580 | 583 | |
| @@ -955,8 +958,8 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode · 374 unmodified lines | ||
| 955 | 958 | break; |
| 956 | 959 | } |
| 957 | 960 | |
| 958 | − if (radeon_encoder->active_device & | |
| 959 | − (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) { | |
| 961 | + if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) || | |
| 962 | + (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)) { | |
| 960 | 963 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
| 961 | 964 | struct drm_connector *connector = |
| 962 | 965 | radeon_get_connector_for_encoder(encoder); |
| @@ -1135,7 +1135,7 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc · 1134 unmodified lines | ||
| 1135 | 1135 | } |
| 1136 | 1136 | if (rdev->flags & RADEON_IS_AGP) { |
| 1137 | 1137 | size_bf = mc->gtt_start; |
| 1138 | − size_af = 0xFFFFFFFF - mc->gtt_end + 1; | |
| 1138 | + size_af = 0xFFFFFFFF - mc->gtt_end; | |
| 1139 | 1139 | if (size_bf > size_af) { |
| 1140 | 1140 | if (mc->mc_vram_size > size_bf) { |
| 1141 | 1141 | dev_warn(rdev->dev, "limiting VRAM\n"); |
| @@ -1149,7 +1149,7 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc · 7 unmodified lines | ||
| 1149 | 1149 | mc->real_vram_size = size_af; |
| 1150 | 1150 | mc->mc_vram_size = size_af; |
| 1151 | 1151 | } |
| 1152 | − mc->vram_start = mc->gtt_end; | |
| 1152 | + mc->vram_start = mc->gtt_end + 1; | |
| 1153 | 1153 | } |
| 1154 | 1154 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; |
| 1155 | 1155 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", |
| @@ -970,7 +970,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 969 unmodified lines | ||
| 970 | 970 | |
| 971 | 971 | encoder = obj_to_encoder(obj); |
| 972 | 972 | |
| 973 | − if (encoder->encoder_type != DRM_MODE_ENCODER_DAC || | |
| 973 | + if (encoder->encoder_type != DRM_MODE_ENCODER_DAC && | |
| 974 | 974 | encoder->encoder_type != DRM_MODE_ENCODER_TVDAC) |
| 975 | 975 | continue; |
| 976 | 976 | |
| @@ -1000,6 +1000,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 23 unmodified lines | ||
| 1000 | 1000 | * cases the DVI port is actually a virtual KVM port connected to the service |
| 1001 | 1001 | * processor. |
| 1002 | 1002 | */ |
| 1003 | +out: | |
| 1003 | 1004 | if ((!rdev->is_atom_bios) && |
| 1004 | 1005 | (ret == connector_status_disconnected) && |
| 1005 | 1006 | rdev->mode_info.bios_hardcoded_edid_size) { |
| @@ -1007,7 +1008,6 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) · 1 unmodified line | ||
| 1007 | 1008 | ret = connector_status_connected; |
| 1008 | 1009 | } |
| 1009 | 1010 | |
| 1010 | −out: | |
| 1011 | 1011 | /* updated in get modes as well since we need to know if it's analog or digital */ |
| 1012 | 1012 | radeon_connector_update_scratch_regs(connector, ret); |
| 1013 | 1013 | return ret; |
| @@ -533,7 +533,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index) · 532 unmodified lines | ||
| 533 | 533 | radeon_legacy_init_crtc(dev, radeon_crtc); |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | −static const char *encoder_names[36] = { | |
| 536 | +static const char *encoder_names[37] = { | |
| 537 | 537 | "NONE", |
| 538 | 538 | "INTERNAL_LVDS", |
| 539 | 539 | "INTERNAL_TMDS1", |
| @@ -570,6 +570,7 @@ static const char *encoder_names[36] = { · 30 unmodified lines | ||
| 570 | 570 | "INTERNAL_UNIPHY2", |
| 571 | 571 | "NUTMEG", |
| 572 | 572 | "TRAVIS", |
| 573 | + "INTERNAL_VCE" | |
| 573 | 574 | }; |
| 574 | 575 | |
| 575 | 576 | static const char *connector_names[15] = { |
| @@ -147,6 +147,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev) · 146 unmodified lines | ||
| 147 | 147 | (rdev->pdev->subsystem_device == 0x01fd)) |
| 148 | 148 | return true; |
| 149 | 149 | |
| 150 | + /* RV515 seems to have MSI issues where it loses | |
| 151 | + * MSI rearms occasionally. This leads to lockups and freezes. | |
| 152 | + * disable it by default. | |
| 153 | + */ | |
| 154 | + if (rdev->family == CHIP_RV515) | |
| 155 | + return false; | |
| 150 | 156 | if (rdev->flags & RADEON_IS_IGP) { |
| 151 | 157 | /* APUs work fine with MSIs */ |
| 152 | 158 | if (rdev->family >= CHIP_PALM) |
| @@ -969,7 +969,7 @@ void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) · 968 unmodified lines | ||
| 969 | 969 | } |
| 970 | 970 | if (rdev->flags & RADEON_IS_AGP) { |
| 971 | 971 | size_bf = mc->gtt_start; |
| 972 | − size_af = 0xFFFFFFFF - mc->gtt_end + 1; | |
| 972 | + size_af = 0xFFFFFFFF - mc->gtt_end; | |
| 973 | 973 | if (size_bf > size_af) { |
| 974 | 974 | if (mc->mc_vram_size > size_bf) { |
| 975 | 975 | dev_warn(rdev->dev, "limiting VRAM\n"); |
| @@ -983,7 +983,7 @@ void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) · 7 unmodified lines | ||
| 983 | 983 | mc->real_vram_size = size_af; |
| 984 | 984 | mc->mc_vram_size = size_af; |
| 985 | 985 | } |
| 986 | − mc->vram_start = mc->gtt_end; | |
| 986 | + mc->vram_start = mc->gtt_end + 1; | |
| 987 | 987 | } |
| 988 | 988 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; |
| 989 | 989 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", |
| @@ -2999,8 +2999,8 @@ int si_rlc_init(struct radeon_device *rdev) · 2998 unmodified lines | ||
| 2999 | 2999 | } |
| 3000 | 3000 | r = radeon_bo_pin(rdev->rlc.save_restore_obj, RADEON_GEM_DOMAIN_VRAM, |
| 3001 | 3001 | &rdev->rlc.save_restore_gpu_addr); |
| 3002 | + radeon_bo_unreserve(rdev->rlc.save_restore_obj); | |
| 3002 | 3003 | if (r) { |
| 3003 | − radeon_bo_unreserve(rdev->rlc.save_restore_obj); | |
| 3004 | 3004 | dev_warn(rdev->dev, "(%d) pin RLC sr bo failed\n", r); |
| 3005 | 3005 | si_rlc_fini(rdev); |
| 3006 | 3006 | return r; |
| @@ -3023,9 +3023,8 @@ int si_rlc_init(struct radeon_device *rdev) · 16 unmodified lines | ||
| 3023 | 3023 | } |
| 3024 | 3024 | r = radeon_bo_pin(rdev->rlc.clear_state_obj, RADEON_GEM_DOMAIN_VRAM, |
| 3025 | 3025 | &rdev->rlc.clear_state_gpu_addr); |
| 3026 | + radeon_bo_unreserve(rdev->rlc.clear_state_obj); | |
| 3026 | 3027 | if (r) { |
| 3027 | − | |
| 3028 | − radeon_bo_unreserve(rdev->rlc.clear_state_obj); | |
| 3029 | 3028 | dev_warn(rdev->dev, "(%d) pin RLC c bo failed\n", r); |
| 3030 | 3029 | si_rlc_fini(rdev); |
| 3031 | 3030 | return r; |
| @@ -34,7 +34,7 @@ config HID · 33 unmodified lines | ||
| 34 | 34 | config HID_BATTERY_STRENGTH |
| 35 | 35 | bool |
| 36 | 36 | depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY |
| 37 | − default y | |
| 37 | + default n | |
| 38 | 38 | |
| 39 | 39 | config HIDRAW |
| 40 | 40 | bool "/dev/hidraw raw HID device support" |
| @@ -62,7 +62,7 @@ static int tivo_input_mapping(struct hid_device *hdev, struct hid_input *hi, · 61 unmodified lines | ||
| 62 | 62 | |
| 63 | 63 | static const struct hid_device_id tivo_devices[] = { |
| 64 | 64 | /* TiVo Slide Bluetooth remote, pairs with a Broadcom dongle */ |
| 65 | − { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) }, | |
| 65 | + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) }, | |
| 66 | 66 | { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) }, |
| 67 | 67 | { } |
| 68 | 68 | }; |
| @@ -123,7 +123,7 @@ struct hsc_client_data { · 122 unmodified lines | ||
| 123 | 123 | static unsigned int hsc_major; |
| 124 | 124 | /* Maximum buffer size that hsi_char will accept from userspace */ |
| 125 | 125 | static unsigned int max_data_size = 0x1000; |
| 126 | −module_param(max_data_size, uint, S_IRUSR | S_IWUSR); | |
| 126 | +module_param(max_data_size, uint, 0); | |
| 127 | 127 | MODULE_PARM_DESC(max_data_size, "max read/write data size [4,8..65536] (^2)"); |
| 128 | 128 | |
| 129 | 129 | static void hsc_add_tail(struct hsc_channel *channel, struct hsi_msg *msg, |
| @@ -21,26 +21,13 @@ · 20 unmodified lines | ||
| 21 | 21 | */ |
| 22 | 22 | #include <linux/hsi/hsi.h> |
| 23 | 23 | #include <linux/compiler.h> |
| 24 | −#include <linux/rwsem.h> | |
| 25 | 24 | #include <linux/list.h> |
| 26 | −#include <linux/spinlock.h> | |
| 27 | 25 | #include <linux/kobject.h> |
| 28 | 26 | #include <linux/slab.h> |
| 29 | 27 | #include <linux/string.h> |
| 28 | +#include <linux/notifier.h> | |
| 30 | 29 | #include "hsi_core.h" |
| 31 | 30 | |
| 32 | −static struct device_type hsi_ctrl = { | |
| 33 | − .name = "hsi_controller", | |
| 34 | −}; | |
| 35 | − | |
| 36 | −static struct device_type hsi_cl = { | |
| 37 | − .name = "hsi_client", | |
| 38 | −}; | |
| 39 | − | |
| 40 | −static struct device_type hsi_port = { | |
| 41 | − .name = "hsi_port", | |
| 42 | −}; | |
| 43 | − | |
| 44 | 31 | static ssize_t modalias_show(struct device *dev, |
| 45 | 32 | struct device_attribute *a __maybe_unused, char *buf) |
| 46 | 33 | { |
| @@ -54,8 +41,7 @@ static struct device_attribute hsi_bus_dev_attrs[] = { · 7 unmodified lines | ||
| 54 | 41 | |
| 55 | 42 | static int hsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env) |
| 56 | 43 | { |
| 57 | − if (dev->type == &hsi_cl) | |
| 58 | − add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev)); | |
| 44 | + add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev)); | |
| 59 | 45 | |
| 60 | 46 | return 0; |
| 61 | 47 | } |
| @@ -80,12 +66,10 @@ static void hsi_client_release(struct device *dev) · 18 unmodified lines | ||
| 80 | 66 | static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info) |
| 81 | 67 | { |
| 82 | 68 | struct hsi_client *cl; |
| 83 | − unsigned long flags; | |
| 84 | 69 | |
| 85 | 70 | cl = kzalloc(sizeof(*cl), GFP_KERNEL); |
| 86 | 71 | if (!cl) |
| 87 | 72 | return; |
| 88 | − cl->device.type = &hsi_cl; | |
| 89 | 73 | cl->tx_cfg = info->tx_cfg; |
| 90 | 74 | cl->rx_cfg = info->rx_cfg; |
| 91 | 75 | cl->device.bus = &hsi_bus_type; |
| @@ -93,14 +77,11 @@ static void hsi_new_client(struct hsi_port *port, struct hsi_board_info *info) · 1 unmodified line | ||
| 93 | 77 | cl->device.release = hsi_client_release; |
| 94 | 78 | dev_set_name(&cl->device, info->name); |
| 95 | 79 | cl->device.platform_data = info->platform_data; |
| 96 | − spin_lock_irqsave(&port->clock, flags); | |
| 97 | − list_add_tail(&cl->link, &port->clients); | |
| 98 | − spin_unlock_irqrestore(&port->clock, flags); | |
| 99 | 80 | if (info->archdata) |
| 100 | 81 | cl->device.archdata = *info->archdata; |
| 101 | 82 | if (device_register(&cl->device) < 0) { |
| 102 | 83 | pr_err("hsi: failed to register client: %s\n", info->name); |
| 103 | − kfree(cl); | |
| 84 | + put_device(&cl->device); | |
| 104 | 85 | } |
| 105 | 86 | } |
| 106 | 87 | |
| @@ -120,13 +101,6 @@ static void hsi_scan_board_info(struct hsi_controller *hsi) · 13 unmodified lines | ||
| 120 | 101 | |
| 121 | 102 | static int hsi_remove_client(struct device *dev, void *data __maybe_unused) |
| 122 | 103 | { |
| 123 | − struct hsi_client *cl = to_hsi_client(dev); | |
| 124 | − struct hsi_port *port = to_hsi_port(dev->parent); | |
| 125 | − unsigned long flags; | |
| 126 | − | |
| 127 | − spin_lock_irqsave(&port->clock, flags); | |
| 128 | − list_del(&cl->link); | |
| 129 | − spin_unlock_irqrestore(&port->clock, flags); | |
| 130 | 104 | device_unregister(dev); |
| 131 | 105 | |
| 132 | 106 | return 0; |
| @@ -140,12 +114,17 @@ static int hsi_remove_port(struct device *dev, void *data __maybe_unused) · 7 unmodified lines | ||
| 140 | 114 | return 0; |
| 141 | 115 | } |
| 142 | 116 | |
| 143 | −static void hsi_controller_release(struct device *dev __maybe_unused) | |
| 117 | +static void hsi_controller_release(struct device *dev) | |
| 144 | 118 | { |
| 119 | + struct hsi_controller *hsi = to_hsi_controller(dev); | |
| 120 | + | |
| 121 | + kfree(hsi->port); | |
| 122 | + kfree(hsi); | |
| 145 | 123 | } |
| 146 | 124 | |
| 147 | −static void hsi_port_release(struct device *dev __maybe_unused) | |
| 125 | +static void hsi_port_release(struct device *dev) | |
| 148 | 126 | { |
| 127 | + kfree(to_hsi_port(dev)); | |
| 149 | 128 | } |
| 150 | 129 | |
| 151 | 130 | /** |
| @@ -170,20 +149,12 @@ int hsi_register_controller(struct hsi_controller *hsi) · 18 unmodified lines | ||
| 170 | 149 | unsigned int i; |
| 171 | 150 | int err; |
| 172 | 151 | |
| 173 | − hsi->device.type = &hsi_ctrl; | |
| 174 | − hsi->device.bus = &hsi_bus_type; | |
| 175 | − hsi->device.release = hsi_controller_release; | |
| 176 | − err = device_register(&hsi->device); | |
| 152 | + err = device_add(&hsi->device); | |
| 177 | 153 | if (err < 0) |
| 178 | 154 | return err; |
| 179 | 155 | for (i = 0; i < hsi->num_ports; i++) { |
| 180 | − hsi->port[i].device.parent = &hsi->device; | |
| 181 | − hsi->port[i].device.bus = &hsi_bus_type; | |
| 182 | − hsi->port[i].device.release = hsi_port_release; | |
| 183 | − hsi->port[i].device.type = &hsi_port; | |
| 184 | − INIT_LIST_HEAD(&hsi->port[i].clients); | |
| 185 | − spin_lock_init(&hsi->port[i].clock); | |
| 186 | − err = device_register(&hsi->port[i].device); | |
| 156 | + hsi->port[i]->device.parent = &hsi->device; | |
| 157 | + err = device_add(&hsi->port[i]->device); | |
| 187 | 158 | if (err < 0) |
| 188 | 159 | goto out; |
| 189 | 160 | } |
| @@ -192,7 +163,9 @@ int hsi_register_controller(struct hsi_controller *hsi) · 2 unmodified lines | ||
| 192 | 163 | |
| 193 | 164 | return 0; |
| 194 | 165 | out: |
| 195 | − hsi_unregister_controller(hsi); | |
| 166 | + while (i-- > 0) | |
| 167 | + device_del(&hsi->port[i]->device); | |
| 168 | + device_del(&hsi->device); | |
| 196 | 169 | |
| 197 | 170 | return err; |
| 198 | 171 | } |
| @@ -222,6 +195,29 @@ static inline int hsi_dummy_cl(struct hsi_client *cl __maybe_unused) · 23 unmodified lines | ||
| 222 | 195 | return 0; |
| 223 | 196 | } |
| 224 | 197 | |
| 198 | +/** | |
| 199 | + * hsi_put_controller - Free an HSI controller | |
| 200 | + * | |
| 201 | + * @hsi: Pointer to the HSI controller to freed | |
| 202 | + * | |
| 203 | + * HSI controller drivers should only use this function if they need | |
| 204 | + * to free their allocated hsi_controller structures before a successful | |
| 205 | + * call to hsi_register_controller. Other use is not allowed. | |
| 206 | + */ | |
| 207 | +void hsi_put_controller(struct hsi_controller *hsi) | |
| 208 | +{ | |
| 209 | + unsigned int i; | |
| 210 | + | |
| 211 | + if (!hsi) | |
| 212 | + return; | |
| 213 | + | |
| 214 | + for (i = 0; i < hsi->num_ports; i++) | |
| 215 | + if (hsi->port && hsi->port[i]) | |
| 216 | + put_device(&hsi->port[i]->device); | |
| 217 | + put_device(&hsi->device); | |
| 218 | +} | |
| 219 | +EXPORT_SYMBOL_GPL(hsi_put_controller); | |
| 220 | + | |
| 225 | 221 | /** |
| 226 | 222 | * hsi_alloc_controller - Allocate an HSI controller and its ports |
| 227 | 223 | * @n_ports: Number of ports on the HSI controller |
| @@ -232,54 +228,51 @@ static inline int hsi_dummy_cl(struct hsi_client *cl __maybe_unused) · 4 unmodified lines | ||
| 232 | 228 | struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags) |
| 233 | 229 | { |
| 234 | 230 | struct hsi_controller *hsi; |
| 235 | − struct hsi_port *port; | |
| 231 | + struct hsi_port **port; | |
| 236 | 232 | unsigned int i; |
| 237 | 233 | |
| 238 | 234 | if (!n_ports) |
| 239 | 235 | return NULL; |
| 240 | 236 | |
| 241 | − port = kzalloc(sizeof(*port)*n_ports, flags); | |
| 242 | − if (!port) | |
| 243 | − return NULL; | |
| 244 | 237 | hsi = kzalloc(sizeof(*hsi), flags); |
| 245 | 238 | if (!hsi) |
| 246 | − goto out; | |
| 247 | − for (i = 0; i < n_ports; i++) { | |
| 248 | − dev_set_name(&port[i].device, "port%d", i); | |
| 249 | − port[i].num = i; | |
| 250 | − port[i].async = hsi_dummy_msg; | |
| 251 | − port[i].setup = hsi_dummy_cl; | |
| 252 | − port[i].flush = hsi_dummy_cl; | |
| 253 | − port[i].start_tx = hsi_dummy_cl; | |
| 254 | − port[i].stop_tx = hsi_dummy_cl; | |
| 255 | − port[i].release = hsi_dummy_cl; | |
| 256 | − mutex_init(&port[i].lock); | |
| 239 | + return NULL; | |
| 240 | + port = kzalloc(sizeof(*port)*n_ports, flags); | |
| 241 | + if (!port) { | |
| 242 | + kfree(hsi); | |
| 243 | + return NULL; | |
| 257 | 244 | } |
| 258 | 245 | hsi->num_ports = n_ports; |
| 259 | 246 | hsi->port = port; |
| 247 | + hsi->device.release = hsi_controller_release; | |
| 248 | + device_initialize(&hsi->device); | |
| 249 | + | |
| 250 | + for (i = 0; i < n_ports; i++) { | |
| 251 | + port[i] = kzalloc(sizeof(**port), flags); | |
| 252 | + if (port[i] == NULL) | |
| 253 | + goto out; | |
| 254 | + port[i]->num = i; | |
| 255 | + port[i]->async = hsi_dummy_msg; | |
| 256 | + port[i]->setup = hsi_dummy_cl; | |
| 257 | + port[i]->flush = hsi_dummy_cl; | |
| 258 | + port[i]->start_tx = hsi_dummy_cl; | |
| 259 | + port[i]->stop_tx = hsi_dummy_cl; | |
| 260 | + port[i]->release = hsi_dummy_cl; | |
| 261 | + mutex_init(&port[i]->lock); | |
| 262 | + ATOMIC_INIT_NOTIFIER_HEAD(&port[i]->n_head); | |
| 263 | + dev_set_name(&port[i]->device, "port%d", i); | |
| 264 | + hsi->port[i]->device.release = hsi_port_release; | |
| 265 | + device_initialize(&hsi->port[i]->device); | |
| 266 | + } | |
| 260 | 267 | |
| 261 | 268 | return hsi; |
| 262 | 269 | out: |
| 263 | − kfree(port); | |
| 270 | + hsi_put_controller(hsi); | |
| 264 | 271 | |
| 265 | 272 | return NULL; |
| 266 | 273 | } |
| 267 | 274 | EXPORT_SYMBOL_GPL(hsi_alloc_controller); |
| 268 | 275 | |
| 269 | −/** | |
| 270 | − * hsi_free_controller - Free an HSI controller | |
| 271 | − * @hsi: Pointer to HSI controller | |
| 272 | − */ | |
| 273 | −void hsi_free_controller(struct hsi_controller *hsi) | |
| 274 | −{ | |
| 275 | − if (!hsi) | |
| 276 | − return; | |
| 277 | − | |
| 278 | − kfree(hsi->port); | |
| 279 | − kfree(hsi); | |
| 280 | −} | |
| 281 | −EXPORT_SYMBOL_GPL(hsi_free_controller); | |
| 282 | − | |
| 283 | 276 | /** |
| 284 | 277 | * hsi_free_msg - Free an HSI message |
| 285 | 278 | * @msg: Pointer to the HSI message |
| @@ -414,37 +407,67 @@ void hsi_release_port(struct hsi_client *cl) · 128 unmodified lines | ||
| 414 | 407 | } |
| 415 | 408 | EXPORT_SYMBOL_GPL(hsi_release_port); |
| 416 | 409 | |
| 417 | −static int hsi_start_rx(struct hsi_client *cl, void *data __maybe_unused) | |
| 410 | +static int hsi_event_notifier_call(struct notifier_block *nb, | |
| 411 | + unsigned long event, void *data __maybe_unused) | |
| 418 | 412 | { |
| 419 | − if (cl->hsi_start_rx) | |
| 420 | − (*cl->hsi_start_rx)(cl); | |
| 413 | + struct hsi_client *cl = container_of(nb, struct hsi_client, nb); | |
| 414 | + | |
| 415 | + (*cl->ehandler)(cl, event); | |
| 421 | 416 | |
| 422 | 417 | return 0; |
| 423 | 418 | } |
| 424 | 419 | |
| 425 | −static int hsi_stop_rx(struct hsi_client *cl, void *data __maybe_unused) | |
| 420 | +/** | |
| 421 | + * hsi_register_port_event - Register a client to receive port events | |
| 422 | + * @cl: HSI client that wants to receive port events | |
| 423 | + * @cb: Event handler callback | |
| 424 | + * | |
| 425 | + * Clients should register a callback to be able to receive | |
| 426 | + * events from the ports. Registration should happen after | |
| 427 | + * claiming the port. | |
| 428 | + * The handler can be called in interrupt context. | |
| 429 | + * | |
| 430 | + * Returns -errno on error, or 0 on success. | |
| 431 | + */ | |
| 432 | +int hsi_register_port_event(struct hsi_client *cl, | |
| 433 | + void (*handler)(struct hsi_client *, unsigned long)) | |
| 426 | 434 | { |
| 427 | − if (cl->hsi_stop_rx) | |
| 428 | − (*cl->hsi_stop_rx)(cl); | |
| 435 | + struct hsi_port *port = hsi_get_port(cl); | |
| 429 | 436 | |
| 430 | − return 0; | |
| 437 | + if (!handler || cl->ehandler) | |
| 438 | + return -EINVAL; | |
| 439 | + if (!hsi_port_claimed(cl)) | |
| 440 | + return -EACCES; | |
| 441 | + cl->ehandler = handler; | |
| 442 | + cl->nb.notifier_call = hsi_event_notifier_call; | |
| 443 | + | |
| 444 | + return atomic_notifier_chain_register(&port->n_head, &cl->nb); | |
| 431 | 445 | } |
| 446 | +EXPORT_SYMBOL_GPL(hsi_register_port_event); | |
| 432 | 447 | |
| 433 | −static int hsi_port_for_each_client(struct hsi_port *port, void *data, | |
| 434 | − int (*fn)(struct hsi_client *cl, void *data)) | |
| 448 | +/** | |
| 449 | + * hsi_unregister_port_event - Stop receiving port events for a client | |
| 450 | + * @cl: HSI client that wants to stop receiving port events | |
| 451 | + * | |
| 452 | + * Clients should call this function before releasing their associated | |
| 453 | + * port. | |
| 454 | + * | |
| 455 | + * Returns -errno on error, or 0 on success. | |
| 456 | + */ | |
| 457 | +int hsi_unregister_port_event(struct hsi_client *cl) | |
| 435 | 458 | { |
| 436 | − struct hsi_client *cl; | |
| 459 | + struct hsi_port *port = hsi_get_port(cl); | |
| 460 | + int err; | |
| 437 | 461 | |
| 438 | − spin_lock(&port->clock); | |
| 439 | − list_for_each_entry(cl, &port->clients, link) { | |
| 440 | − spin_unlock(&port->clock); | |
| 441 | − (*fn)(cl, data); | |
| 442 | − spin_lock(&port->clock); | |
| 443 | − } | |
| 444 | − spin_unlock(&port->clock); | |
| 462 | + WARN_ON(!hsi_port_claimed(cl)); | |
| 445 | 463 | |
| 446 | − return 0; | |
| 464 | + err = atomic_notifier_chain_unregister(&port->n_head, &cl->nb); | |
| 465 | + if (!err) | |
| 466 | + cl->ehandler = NULL; | |
| 467 | + | |
| 468 | + return err; | |
| 447 | 469 | } |
| 470 | +EXPORT_SYMBOL_GPL(hsi_unregister_port_event); | |
| 448 | 471 | |
| 449 | 472 | /** |
| 450 | 473 | * hsi_event -Notifies clients about port events |
| @@ -458,22 +481,12 @@ static int hsi_port_for_each_client(struct hsi_port *port, void *data, · 7 unmodified lines | ||
| 458 | 481 | * Events: |
| 459 | 482 | * HSI_EVENT_START_RX - Incoming wake line high |
| 460 | 483 | * HSI_EVENT_STOP_RX - Incoming wake line down |
| 484 | + * | |
| 485 | + * Returns -errno on error, or 0 on success. | |
| 461 | 486 | */ |
| 462 | −void hsi_event(struct hsi_port *port, unsigned int event) | |
| 487 | +int hsi_event(struct hsi_port *port, unsigned long event) | |
| 463 | 488 | { |
| 464 | − int (*fn)(struct hsi_client *cl, void *data); | |
| 465 | − | |
| 466 | − switch (event) { | |
| 467 | − case HSI_EVENT_START_RX: | |
| 468 | − fn = hsi_start_rx; | |
| 469 | − break; | |
| 470 | − case HSI_EVENT_STOP_RX: | |
| 471 | − fn = hsi_stop_rx; | |
| 472 | − break; | |
| 473 | − default: | |
| 474 | − return; | |
| 475 | − } | |
| 476 | − hsi_port_for_each_client(port, NULL, fn); | |
| 489 | + return atomic_notifier_call_chain(&port->n_head, event, NULL); | |
| 477 | 490 | } |
| 478 | 491 | EXPORT_SYMBOL_GPL(hsi_event); |
| 479 | 492 | |
| @@ -47,7 +47,7 @@ struct ad7314_data { · 46 unmodified lines | ||
| 47 | 47 | u16 rx ____cacheline_aligned; |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | −static int ad7314_spi_read(struct ad7314_data *chip, s16 *data) | |
| 50 | +static int ad7314_spi_read(struct ad7314_data *chip) | |
| 51 | 51 | { |
| 52 | 52 | int ret; |
| 53 | 53 | |
| @@ -57,9 +57,7 @@ static int ad7314_spi_read(struct ad7314_data *chip, s16 *data) · 3 unmodified lines | ||
| 57 | 57 | return ret; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | − *data = be16_to_cpu(chip->rx); | |
| 61 | − | |
| 62 | − return ret; | |
| 60 | + return be16_to_cpu(chip->rx); | |
| 63 | 61 | } |
| 64 | 62 | |
| 65 | 63 | static ssize_t ad7314_show_temperature(struct device *dev, |
| @@ -70,12 +68,12 @@ static ssize_t ad7314_show_temperature(struct device *dev, · 4 unmodified lines | ||
| 70 | 68 | s16 data; |
| 71 | 69 | int ret; |
| 72 | 70 | |
| 73 | − ret = ad7314_spi_read(chip, &data); | |
| 71 | + ret = ad7314_spi_read(chip); | |
| 74 | 72 | if (ret < 0) |
| 75 | 73 | return ret; |
| 76 | 74 | switch (spi_get_device_id(chip->spi_dev)->driver_data) { |
| 77 | 75 | case ad7314: |
| 78 | − data = (data & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET; | |
| 76 | + data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET; | |
| 79 | 77 | data = (data << 6) >> 6; |
| 80 | 78 | |
| 81 | 79 | return sprintf(buf, "%d\n", 250 * data); |
| @@ -86,7 +84,7 @@ static ssize_t ad7314_show_temperature(struct device *dev, · 4 unmodified lines | ||
| 86 | 84 | * with a sign bit - which is a 14 bit 2's complement |
| 87 | 85 | * register. 1lsb - 31.25 milli degrees centigrade |
| 88 | 86 | */ |
| 89 | − data &= ADT7301_TEMP_MASK; | |
| 87 | + data = ret & ADT7301_TEMP_MASK; | |
| 90 | 88 | data = (data << 2) >> 2; |
| 91 | 89 | |
| 92 | 90 | return sprintf(buf, "%d\n", |
| @@ -59,14 +59,11 @@ struct ads1015_data { · 58 unmodified lines | ||
| 59 | 59 | struct ads1015_channel_data channel_data[ADS1015_CHANNELS]; |
| 60 | 60 | }; |
| 61 | 61 | |
| 62 | −static int ads1015_read_value(struct i2c_client *client, unsigned int channel, | |
| 63 | − int *value) | |
| 62 | +static int ads1015_read_adc(struct i2c_client *client, unsigned int channel) | |
| 64 | 63 | { |
| 65 | 64 | u16 config; |
| 66 | − s16 conversion; | |
| 67 | 65 | struct ads1015_data *data = i2c_get_clientdata(client); |
| 68 | 66 | unsigned int pga = data->channel_data[channel].pga; |
| 69 | − int fullscale; | |
| 70 | 67 | unsigned int data_rate = data->channel_data[channel].data_rate; |
| 71 | 68 | unsigned int conversion_time_ms; |
| 72 | 69 | int res; |
| @@ -78,7 +75,6 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel, · 5 unmodified lines | ||
| 78 | 75 | if (res < 0) |
| 79 | 76 | goto err_unlock; |
| 80 | 77 | config = res; |
| 81 | − fullscale = fullscale_table[pga]; | |
| 82 | 78 | conversion_time_ms = DIV_ROUND_UP(1000, data_rate_table[data_rate]); |
| 83 | 79 | |
| 84 | 80 | /* setup and start single conversion */ |
| @@ -105,33 +101,36 @@ static int ads1015_read_value(struct i2c_client *client, unsigned int channel, · 20 unmodified lines | ||
| 105 | 101 | } |
| 106 | 102 | |
| 107 | 103 | res = i2c_smbus_read_word_swapped(client, ADS1015_CONVERSION); |
| 108 | − if (res < 0) | |
| 109 | − goto err_unlock; | |
| 110 | − conversion = res; | |
| 111 | − | |
| 112 | − mutex_unlock(&data->update_lock); | |
| 113 | − | |
| 114 | − *value = DIV_ROUND_CLOSEST(conversion * fullscale, 0x7ff0); | |
| 115 | − | |
| 116 | − return 0; | |
| 117 | 104 | |
| 118 | 105 | err_unlock: |
| 119 | 106 | mutex_unlock(&data->update_lock); |
| 120 | 107 | return res; |
| 121 | 108 | } |
| 122 | 109 | |
| 110 | +static int ads1015_reg_to_mv(struct i2c_client *client, unsigned int channel, | |
| 111 | + s16 reg) | |
| 112 | +{ | |
| 113 | + struct ads1015_data *data = i2c_get_clientdata(client); | |
| 114 | + unsigned int pga = data->channel_data[channel].pga; | |
| 115 | + int fullscale = fullscale_table[pga]; | |
| 116 | + | |
| 117 | + return DIV_ROUND_CLOSEST(reg * fullscale, 0x7ff0); | |
| 118 | +} | |
| 119 | + | |
| 123 | 120 | /* sysfs callback function */ |
| 124 | 121 | static ssize_t show_in(struct device *dev, struct device_attribute *da, |
| 125 | 122 | char *buf) |
| 126 | 123 | { |
| 127 | 124 | struct sensor_device_attribute *attr = to_sensor_dev_attr(da); |
| 128 | 125 | struct i2c_client *client = to_i2c_client(dev); |
| 129 | − int in; | |
| 130 | 126 | int res; |
| 127 | + int index = attr->index; | |
| 131 | 128 | |
| 132 | − res = ads1015_read_value(client, attr->index, &in); | |
| 129 | + res = ads1015_read_adc(client, index); | |
| 130 | + if (res < 0) | |
| 131 | + return res; | |
| 133 | 132 | |
| 134 | − return (res < 0) ? res : sprintf(buf, "%d\n", in); | |
| 133 | + return sprintf(buf, "%d\n", ads1015_reg_to_mv(client, index, res)); | |
| 135 | 134 | } |
| 136 | 135 | |
| 137 | 136 | static const struct sensor_device_attribute ads1015_in[] = { |
| @@ -122,6 +122,41 @@ static bool __devinit fam15h_power_is_internal_node0(struct pci_dev *f4) · 121 unmodified lines | ||
| 122 | 122 | return true; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | +/* | |
| 126 | + * Newer BKDG versions have an updated recommendation on how to properly | |
| 127 | + * initialize the running average range (was: 0xE, now: 0x9). This avoids | |
| 128 | + * counter saturations resulting in bogus power readings. | |
| 129 | + * We correct this value ourselves to cope with older BIOSes. | |
| 130 | + */ | |
| 131 | +static DEFINE_PCI_DEVICE_TABLE(affected_device) = { | |
| 132 | + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, | |
| 133 | + { 0 } | |
| 134 | +}; | |
| 135 | + | |
| 136 | +static void __devinit tweak_runavg_range(struct pci_dev *pdev) | |
| 137 | +{ | |
| 138 | + u32 val; | |
| 139 | + | |
| 140 | + /* | |
| 141 | + * let this quirk apply only to the current version of the | |
| 142 | + * northbridge, since future versions may change the behavior | |
| 143 | + */ | |
| 144 | + if (!pci_match_id(affected_device, pdev)) | |
| 145 | + return; | |
| 146 | + | |
| 147 | + pci_bus_read_config_dword(pdev->bus, | |
| 148 | + PCI_DEVFN(PCI_SLOT(pdev->devfn), 5), | |
| 149 | + REG_TDP_RUNNING_AVERAGE, &val); | |
| 150 | + if ((val & 0xf) != 0xe) | |
| 151 | + return; | |
| 152 | + | |
| 153 | + val &= ~0xf; | |
| 154 | + val |= 0x9; | |
| 155 | + pci_bus_write_config_dword(pdev->bus, | |
| 156 | + PCI_DEVFN(PCI_SLOT(pdev->devfn), 5), | |
| 157 | + REG_TDP_RUNNING_AVERAGE, val); | |
| 158 | +} | |
| 159 | + | |
| 125 | 160 | static void __devinit fam15h_power_init_data(struct pci_dev *f4, |
| 126 | 161 | struct fam15h_power_data *data) |
| 127 | 162 | { |
| @@ -155,6 +190,13 @@ static int __devinit fam15h_power_probe(struct pci_dev *pdev, · 27 unmodified lines | ||
| 155 | 190 | struct device *dev; |
| 156 | 191 | int err; |
| 157 | 192 | |
| 193 | + /* | |
| 194 | + * though we ignore every other northbridge, we still have to | |
| 195 | + * do the tweaking on _each_ node in MCM processors as the counters | |
| 196 | + * are working hand-in-hand | |
| 197 | + */ | |
| 198 | + tweak_runavg_range(pdev); | |
| 199 | + | |
| 158 | 200 | if (!fam15h_power_is_internal_node0(pdev)) { |
| 159 | 201 | err = -ENODEV; |
| 160 | 202 | goto exit; |
| @@ -1854,6 +1854,8 @@ static bool generate_unmatched_resp(struct ib_mad_private *recv, · 1853 unmodified lines | ||
| 1854 | 1854 | response->mad.mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP; |
| 1855 | 1855 | response->mad.mad.mad_hdr.status = |
| 1856 | 1856 | cpu_to_be16(IB_MGMT_MAD_STATUS_UNSUPPORTED_METHOD_ATTRIB); |
| 1857 | + if (recv->mad.mad.mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) | |
| 1858 | + response->mad.mad.mad_hdr.status |= IB_SMP_DIRECTION; | |
| 1857 | 1859 | |
| 1858 | 1860 | return true; |
| 1859 | 1861 | } else { |
| @@ -1869,6 +1871,7 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, · 9 unmodified lines | ||
| 1869 | 1871 | struct ib_mad_list_head *mad_list; |
| 1870 | 1872 | struct ib_mad_agent_private *mad_agent; |
| 1871 | 1873 | int port_num; |
| 1874 | + int ret = IB_MAD_RESULT_SUCCESS; | |
| 1872 | 1875 | |
| 1873 | 1876 | mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id; |
| 1874 | 1877 | qp_info = mad_list->mad_queue->qp_info; |
| @@ -1952,8 +1955,6 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, · 77 unmodified lines | ||
| 1952 | 1955 | local: |
| 1953 | 1956 | /* Give driver "right of first refusal" on incoming MAD */ |
| 1954 | 1957 | if (port_priv->device->process_mad) { |
| 1955 | − int ret; | |
| 1956 | − | |
| 1957 | 1958 | ret = port_priv->device->process_mad(port_priv->device, 0, |
| 1958 | 1959 | port_priv->port_num, |
| 1959 | 1960 | wc, &recv->grh, |
| @@ -1981,7 +1982,8 @@ local: · 21 unmodified lines | ||
| 1981 | 1982 | * or via recv_handler in ib_mad_complete_recv() |
| 1982 | 1983 | */ |
| 1983 | 1984 | recv = NULL; |
| 1984 | − } else if (generate_unmatched_resp(recv, response)) { | |
| 1985 | + } else if ((ret & IB_MAD_RESULT_SUCCESS) && | |
| 1986 | + generate_unmatched_resp(recv, response)) { | |
| 1985 | 1987 | agent_send_response(&response->mad.mad, &recv->grh, wc, |
| 1986 | 1988 | port_priv->device, port_num, qp_info->qp->qp_num); |
| 1987 | 1989 | } |
| @@ -247,7 +247,7 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port, · 246 unmodified lines | ||
| 247 | 247 | err = mlx4_MAD_IFC(to_mdev(ibdev), 1, 1, port, |
| 248 | 248 | NULL, NULL, in_mad, out_mad); |
| 249 | 249 | if (err) |
| 250 | − return err; | |
| 250 | + goto out; | |
| 251 | 251 | |
| 252 | 252 | /* Checking LinkSpeedActive for FDR-10 */ |
| 253 | 253 | if (out_mad->data[15] & 0x1) |
| @@ -380,8 +380,7 @@ config INPUT_TWL4030_VIBRA · 379 unmodified lines | ||
| 380 | 380 | |
| 381 | 381 | config INPUT_TWL6040_VIBRA |
| 382 | 382 | tristate "Support for TWL6040 Vibrator" |
| 383 | − depends on TWL4030_CORE | |
| 384 | − select TWL6040_CORE | |
| 383 | + depends on TWL6040_CORE | |
| 385 | 384 | select INPUT_FF_MEMLESS |
| 386 | 385 | help |
| 387 | 386 | This option enables support for TWL6040 Vibrator Driver. |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/module.h> |
| 29 | 29 | #include <linux/platform_device.h> |
| 30 | 30 | #include <linux/workqueue.h> |
| 31 | −#include <linux/i2c/twl.h> | |
| 31 | +#include <linux/input.h> | |
| 32 | 32 | #include <linux/mfd/twl6040.h> |
| 33 | 33 | #include <linux/slab.h> |
| 34 | 34 | #include <linux/delay.h> |
| @@ -257,7 +257,7 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); · 222 unmodified lines | ||
| 257 | 257 | |
| 258 | 258 | static int __devinit twl6040_vibra_probe(struct platform_device *pdev) |
| 259 | 259 | { |
| 260 | − struct twl4030_vibra_data *pdata = pdev->dev.platform_data; | |
| 260 | + struct twl6040_vibra_data *pdata = pdev->dev.platform_data; | |
| 261 | 261 | struct vibra_info *info; |
| 262 | 262 | int ret; |
| 263 | 263 | |
| @@ -274,7 +274,8 @@ static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse) · 273 unmodified lines | ||
| 274 | 274 | static unsigned char param = 0xc8; |
| 275 | 275 | struct synaptics_data *priv = psmouse->private; |
| 276 | 276 | |
| 277 | − if (!SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) | |
| 277 | + if (!(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) || | |
| 278 | + SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c))) | |
| 278 | 279 | return 0; |
| 279 | 280 | |
| 280 | 281 | if (psmouse_sliced_command(psmouse, SYN_QUE_MODEL)) |
| @@ -35,7 +35,7 @@ static void pwmled_brightness(struct led_classdev *cdev, enum led_brightness b) · 34 unmodified lines | ||
| 35 | 35 | * NOTE: we reuse the platform_data structure of GPIO leds, |
| 36 | 36 | * but repurpose its "gpio" number as a PWM channel number. |
| 37 | 37 | */ |
| 38 | −static int __init pwmled_probe(struct platform_device *pdev) | |
| 38 | +static int __devinit pwmled_probe(struct platform_device *pdev) | |
| 39 | 39 | { |
| 40 | 40 | const struct gpio_led_platform_data *pdata; |
| 41 | 41 | struct pwmled *leds; |
| @@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) · 858 unmodified lines | ||
| 859 | 859 | int ret; |
| 860 | 860 | unsigned redundancy = 0; |
| 861 | 861 | struct raid_dev *dev; |
| 862 | − struct md_rdev *rdev, *freshest; | |
| 862 | + struct md_rdev *rdev, *tmp, *freshest; | |
| 863 | 863 | struct mddev *mddev = &rs->md; |
| 864 | 864 | |
| 865 | 865 | switch (rs->raid_type->level) { |
| @@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs) · 11 unmodified lines | ||
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | freshest = NULL; |
| 880 | − rdev_for_each(rdev, mddev) { | |
| 880 | + rdev_for_each_safe(rdev, tmp, mddev) { | |
| 881 | 881 | if (!rdev->meta_bdev) |
| 882 | 882 | continue; |
| 883 | 883 | |
| @@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev) · 7559 unmodified lines | ||
| 7560 | 7560 | * any transients in the value of "sync_action". |
| 7561 | 7561 | */ |
| 7562 | 7562 | set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); |
| 7563 | − clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | |
| 7564 | 7563 | /* Clear some bits that don't mean anything, but |
| 7565 | 7564 | * might be left set |
| 7566 | 7565 | */ |
| 7567 | 7566 | clear_bit(MD_RECOVERY_INTR, &mddev->recovery); |
| 7568 | 7567 | clear_bit(MD_RECOVERY_DONE, &mddev->recovery); |
| 7569 | 7568 | |
| 7570 | − if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) | |
| 7569 | + if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) || | |
| 7570 | + test_bit(MD_RECOVERY_FROZEN, &mddev->recovery)) | |
| 7571 | 7571 | goto unlock; |
| 7572 | 7572 | /* no recovery is running. |
| 7573 | 7573 | * remove any failed drives, then |
| @@ -8140,7 +8140,8 @@ static int md_notify_reboot(struct notifier_block *this, · 566 unmodified lines | ||
| 8140 | 8140 | |
| 8141 | 8141 | for_each_mddev(mddev, tmp) { |
| 8142 | 8142 | if (mddev_trylock(mddev)) { |
| 8143 | − __md_stop_writes(mddev); | |
| 8143 | + if (mddev->pers) | |
| 8144 | + __md_stop_writes(mddev); | |
| 8144 | 8145 | mddev->safemode = 2; |
| 8145 | 8146 | mddev_unlock(mddev); |
| 8146 | 8147 | } |
| @@ -54,6 +54,7 @@ struct xc5000_priv { · 53 unmodified lines | ||
| 54 | 54 | struct list_head hybrid_tuner_instance_list; |
| 55 | 55 | |
| 56 | 56 | u32 if_khz; |
| 57 | + u32 xtal_khz; | |
| 57 | 58 | u32 freq_hz; |
| 58 | 59 | u32 bandwidth; |
| 59 | 60 | u8 video_standard; |
| @@ -214,9 +215,9 @@ static const struct xc5000_fw_cfg xc5000a_1_6_114 = { · 154 unmodified lines | ||
| 214 | 215 | .size = 12401, |
| 215 | 216 | }; |
| 216 | 217 | |
| 217 | −static const struct xc5000_fw_cfg xc5000c_41_024_5_31875 = { | |
| 218 | − .name = "dvb-fe-xc5000c-41.024.5-31875.fw", | |
| 219 | − .size = 16503, | |
| 218 | +static const struct xc5000_fw_cfg xc5000c_41_024_5 = { | |
| 219 | + .name = "dvb-fe-xc5000c-41.024.5.fw", | |
| 220 | + .size = 16497, | |
| 220 | 221 | }; |
| 221 | 222 | |
| 222 | 223 | static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) |
| @@ -226,7 +227,7 @@ static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id) · 3 unmodified lines | ||
| 226 | 227 | case XC5000A: |
| 227 | 228 | return &xc5000a_1_6_114; |
| 228 | 229 | case XC5000C: |
| 229 | − return &xc5000c_41_024_5_31875; | |
| 230 | + return &xc5000c_41_024_5; | |
| 230 | 231 | } |
| 231 | 232 | } |
| 232 | 233 | |
| @@ -572,6 +573,31 @@ static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode) · 339 unmodified lines | ||
| 572 | 573 | return found; |
| 573 | 574 | } |
| 574 | 575 | |
| 576 | +static int xc_set_xtal(struct dvb_frontend *fe) | |
| 577 | +{ | |
| 578 | + struct xc5000_priv *priv = fe->tuner_priv; | |
| 579 | + int ret = XC_RESULT_SUCCESS; | |
| 580 | + | |
| 581 | + switch (priv->chip_id) { | |
| 582 | + default: | |
| 583 | + case XC5000A: | |
| 584 | + /* 32.000 MHz xtal is default */ | |
| 585 | + break; | |
| 586 | + case XC5000C: | |
| 587 | + switch (priv->xtal_khz) { | |
| 588 | + default: | |
| 589 | + case 32000: | |
| 590 | + /* 32.000 MHz xtal is default */ | |
| 591 | + break; | |
| 592 | + case 31875: | |
| 593 | + /* 31.875 MHz xtal configuration */ | |
| 594 | + ret = xc_write_reg(priv, 0x000f, 0x8081); | |
| 595 | + break; | |
| 596 | + } | |
| 597 | + break; | |
| 598 | + } | |
| 599 | + return ret; | |
| 600 | +} | |
| 575 | 601 | |
| 576 | 602 | static int xc5000_fwupload(struct dvb_frontend *fe) |
| 577 | 603 | { |
| @@ -603,6 +629,8 @@ static int xc5000_fwupload(struct dvb_frontend *fe) · 25 unmodified lines | ||
| 603 | 629 | } else { |
| 604 | 630 | printk(KERN_INFO "xc5000: firmware uploading...\n"); |
| 605 | 631 | ret = xc_load_i2c_sequence(fe, fw->data); |
| 632 | + if (XC_RESULT_SUCCESS == ret) | |
| 633 | + ret = xc_set_xtal(fe); | |
| 606 | 634 | printk(KERN_INFO "xc5000: firmware upload complete...\n"); |
| 607 | 635 | } |
| 608 | 636 | |
| @@ -1164,6 +1192,9 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, · 555 unmodified lines | ||
| 1164 | 1192 | priv->if_khz = cfg->if_khz; |
| 1165 | 1193 | } |
| 1166 | 1194 | |
| 1195 | + if (priv->xtal_khz == 0) | |
| 1196 | + priv->xtal_khz = cfg->xtal_khz; | |
| 1197 | + | |
| 1167 | 1198 | if (priv->radio_input == 0) |
| 1168 | 1199 | priv->radio_input = cfg->radio_input; |
| 1169 | 1200 | |
| @@ -34,6 +34,7 @@ struct xc5000_config { · 33 unmodified lines | ||
| 34 | 34 | u8 i2c_address; |
| 35 | 35 | u32 if_khz; |
| 36 | 36 | u8 radio_input; |
| 37 | + u32 xtal_khz; | |
| 37 | 38 | |
| 38 | 39 | int chip_id; |
| 39 | 40 | }; |
| @@ -1446,6 +1446,28 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system) · 1445 unmodified lines | ||
| 1446 | 1446 | __func__); |
| 1447 | 1447 | return -EINVAL; |
| 1448 | 1448 | } |
| 1449 | + /* | |
| 1450 | + * Get a delivery system that is compatible with DVBv3 | |
| 1451 | + * NOTE: in order for this to work with softwares like Kaffeine that | |
| 1452 | + * uses a DVBv5 call for DVB-S2 and a DVBv3 call to go back to | |
| 1453 | + * DVB-S, drivers that support both should put the SYS_DVBS entry | |
| 1454 | + * before the SYS_DVBS2, otherwise it won't switch back to DVB-S. | |
| 1455 | + * The real fix is that userspace applications should not use DVBv3 | |
| 1456 | + * and not trust on calling FE_SET_FRONTEND to switch the delivery | |
| 1457 | + * system. | |
| 1458 | + */ | |
| 1459 | + ncaps = 0; | |
| 1460 | + while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) { | |
| 1461 | + if (fe->ops.delsys[ncaps] == desired_system) { | |
| 1462 | + delsys = desired_system; | |
| 1463 | + break; | |
| 1464 | + } | |
| 1465 | + ncaps++; | |
| 1466 | + } | |
| 1467 | + if (delsys == SYS_UNDEFINED) { | |
| 1468 | + dprintk("%s() Couldn't find a delivery system that matches %d\n", | |
| 1469 | + __func__, desired_system); | |
| 1470 | + } | |
| 1449 | 1471 | } else { |
| 1450 | 1472 | /* |
| 1451 | 1473 | * This is a DVBv5 call. So, it likely knows the supported |
| @@ -1494,9 +1516,10 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system) · 42 unmodified lines | ||
| 1494 | 1516 | __func__); |
| 1495 | 1517 | return -EINVAL; |
| 1496 | 1518 | } |
| 1497 | − c->delivery_system = delsys; | |
| 1498 | 1519 | } |
| 1499 | 1520 | |
| 1521 | + c->delivery_system = delsys; | |
| 1522 | + | |
| 1500 | 1523 | /* |
| 1501 | 1524 | * The DVBv3 or DVBv5 call is requesting a different system. So, |
| 1502 | 1525 | * emulation is needed. |
| @@ -1520,8 +1520,10 @@ static int scu_command(struct drxk_state *state, · 1519 unmodified lines | ||
| 1520 | 1520 | dprintk(1, "\n"); |
| 1521 | 1521 | |
| 1522 | 1522 | if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) || |
| 1523 | − ((resultLen > 0) && (result == NULL))) | |
| 1524 | − goto error; | |
| 1523 | + ((resultLen > 0) && (result == NULL))) { | |
| 1524 | + printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__); | |
| 1525 | + return status; | |
| 1526 | + } | |
| 1525 | 1527 | |
| 1526 | 1528 | mutex_lock(&state->mutex); |
| 1527 | 1529 | |
| @@ -1046,6 +1046,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) · 1045 unmodified lines | ||
| 1046 | 1046 | goto exit_unregister_led; |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | + data->dev->driver_type = RC_DRIVER_IR_RAW; | |
| 1049 | 1050 | data->dev->driver_name = WBCIR_NAME; |
| 1050 | 1051 | data->dev->input_name = WBCIR_NAME; |
| 1051 | 1052 | data->dev->input_phys = "wbcir/cir0"; |
| @@ -492,7 +492,7 @@ config VIDEO_VS6624 · 491 unmodified lines | ||
| 492 | 492 | |
| 493 | 493 | config VIDEO_MT9M032 |
| 494 | 494 | tristate "MT9M032 camera sensor support" |
| 495 | − depends on I2C && VIDEO_V4L2 | |
| 495 | + depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API | |
| 496 | 496 | select VIDEO_APTINA_PLL |
| 497 | 497 | ---help--- |
| 498 | 498 | This driver supports MT9M032 camera sensors from Aptina, monochrome |
| @@ -392,10 +392,11 @@ static int mt9m032_set_pad_format(struct v4l2_subdev *subdev, · 391 unmodified lines | ||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | /* Scaling is not supported, the format is thus fixed. */ |
| 395 | − ret = mt9m032_get_pad_format(subdev, fh, fmt); | |
| 395 | + fmt->format = *__mt9m032_get_pad_format(sensor, fh, fmt->which); | |
| 396 | + ret = 0; | |
| 396 | 397 | |
| 397 | 398 | done: |
| 398 | − mutex_lock(&sensor->lock); | |
| 399 | + mutex_unlock(&sensor->lock); | |
| 399 | 400 | return ret; |
| 400 | 401 | } |
| 401 | 402 | |
| @@ -268,10 +268,17 @@ config TWL6030_PWM · 267 unmodified lines | ||
| 268 | 268 | This is used to control charging LED brightness. |
| 269 | 269 | |
| 270 | 270 | config TWL6040_CORE |
| 271 | − bool | |
| 272 | − depends on TWL4030_CORE && GENERIC_HARDIRQS | |
| 271 | + bool "Support for TWL6040 audio codec" | |
| 272 | + depends on I2C=y && GENERIC_HARDIRQS | |
| 273 | 273 | select MFD_CORE |
| 274 | + select REGMAP_I2C | |
| 274 | 275 | default n |
| 276 | + help | |
| 277 | + Say yes here if you want support for Texas Instruments TWL6040 audio | |
| 278 | + codec. | |
| 279 | + This driver provides common support for accessing the device, | |
| 280 | + additional drivers must be enabled in order to use the | |
| 281 | + functionality of the device (audio, vibra). | |
| 275 | 282 | |
| 276 | 283 | config MFD_STMPE |
| 277 | 284 | bool "Support STMicroelectronics STMPE" |
| @@ -527,7 +527,9 @@ static void asic3_gpio_set(struct gpio_chip *chip, · 526 unmodified lines | ||
| 527 | 527 | |
| 528 | 528 | static int asic3_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
| 529 | 529 | { |
| 530 | − return (offset < ASIC3_NUM_GPIOS) ? IRQ_BOARD_START + offset : -ENXIO; | |
| 530 | + struct asic3 *asic = container_of(chip, struct asic3, gpio); | |
| 531 | + | |
| 532 | + return (offset < ASIC3_NUM_GPIOS) ? asic->irq_base + offset : -ENXIO; | |
| 531 | 533 | } |
| 532 | 534 | |
| 533 | 535 | static __init int asic3_gpio_probe(struct platform_device *pdev, |
| @@ -25,7 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <linux/clk.h> |
| 26 | 26 | #include <linux/dma-mapping.h> |
| 27 | 27 | #include <linux/spinlock.h> |
| 28 | −#include <linux/gpio.h> | |
| 29 | 28 | #include <plat/usb.h> |
| 30 | 29 | #include <linux/pm_runtime.h> |
| 31 | 30 | |
| @@ -502,19 +501,6 @@ static void omap_usbhs_init(struct device *dev) · 470 unmodified lines | ||
| 502 | 501 | pm_runtime_get_sync(dev); |
| 503 | 502 | spin_lock_irqsave(&omap->lock, flags); |
| 504 | 503 | |
| 505 | − if (pdata->ehci_data->phy_reset) { | |
| 506 | − if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | |
| 507 | − gpio_request_one(pdata->ehci_data->reset_gpio_port[0], | |
| 508 | − GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | |
| 509 | − | |
| 510 | − if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | |
| 511 | − gpio_request_one(pdata->ehci_data->reset_gpio_port[1], | |
| 512 | − GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | |
| 513 | − | |
| 514 | − /* Hold the PHY in RESET for enough time till DIR is high */ | |
| 515 | − udelay(10); | |
| 516 | − } | |
| 517 | − | |
| 518 | 504 | omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION); |
| 519 | 505 | dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev); |
| 520 | 506 | |
| @@ -593,39 +579,10 @@ static void omap_usbhs_init(struct device *dev) · 72 unmodified lines | ||
| 593 | 579 | usbhs_omap_tll_init(dev, OMAP_TLL_CHANNEL_COUNT); |
| 594 | 580 | } |
| 595 | 581 | |
| 596 | − if (pdata->ehci_data->phy_reset) { | |
| 597 | − /* Hold the PHY in RESET for enough time till | |
| 598 | − * PHY is settled and ready | |
| 599 | − */ | |
| 600 | − udelay(10); | |
| 601 | − | |
| 602 | − if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | |
| 603 | − gpio_set_value | |
| 604 | − (pdata->ehci_data->reset_gpio_port[0], 1); | |
| 605 | − | |
| 606 | − if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | |
| 607 | − gpio_set_value | |
| 608 | − (pdata->ehci_data->reset_gpio_port[1], 1); | |
| 609 | − } | |
| 610 | − | |
| 611 | 582 | spin_unlock_irqrestore(&omap->lock, flags); |
| 612 | 583 | pm_runtime_put_sync(dev); |
| 613 | 584 | } |
| 614 | 585 | |
| 615 | −static void omap_usbhs_deinit(struct device *dev) | |
| 616 | −{ | |
| 617 | − struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); | |
| 618 | − struct usbhs_omap_platform_data *pdata = &omap->platdata; | |
| 619 | − | |
| 620 | − if (pdata->ehci_data->phy_reset) { | |
| 621 | − if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | |
| 622 | − gpio_free(pdata->ehci_data->reset_gpio_port[0]); | |
| 623 | − | |
| 624 | − if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | |
| 625 | − gpio_free(pdata->ehci_data->reset_gpio_port[1]); | |
| 626 | − } | |
| 627 | −} | |
| 628 | − | |
| 629 | 586 | |
| 630 | 587 | /** |
| 631 | 588 | * usbhs_omap_probe - initialize TI-based HCDs |
| @@ -860,7 +817,6 @@ static int __devexit usbhs_omap_remove(struct platform_device *pdev) · 228 unmodified lines | ||
| 860 | 817 | { |
| 861 | 818 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); |
| 862 | 819 | |
| 863 | − omap_usbhs_deinit(&pdev->dev); | |
| 864 | 820 | iounmap(omap->tll_base); |
| 865 | 821 | iounmap(omap->uhh_base); |
| 866 | 822 | clk_put(omap->init_60m_fclk); |
| @@ -80,44 +80,6 @@ static struct mfd_cell rc5t583_subdevs[] = { · 79 unmodified lines | ||
| 80 | 80 | {.name = "rc5t583-key", } |
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | −int rc5t583_write(struct device *dev, uint8_t reg, uint8_t val) | |
| 84 | −{ | |
| 85 | − struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 86 | − return regmap_write(rc5t583->regmap, reg, val); | |
| 87 | −} | |
| 88 | − | |
| 89 | −int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val) | |
| 90 | −{ | |
| 91 | − struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 92 | − unsigned int ival; | |
| 93 | − int ret; | |
| 94 | − ret = regmap_read(rc5t583->regmap, reg, &ival); | |
| 95 | − if (!ret) | |
| 96 | − *val = (uint8_t)ival; | |
| 97 | − return ret; | |
| 98 | −} | |
| 99 | − | |
| 100 | −int rc5t583_set_bits(struct device *dev, unsigned int reg, | |
| 101 | − unsigned int bit_mask) | |
| 102 | −{ | |
| 103 | − struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 104 | − return regmap_update_bits(rc5t583->regmap, reg, bit_mask, bit_mask); | |
| 105 | −} | |
| 106 | − | |
| 107 | −int rc5t583_clear_bits(struct device *dev, unsigned int reg, | |
| 108 | − unsigned int bit_mask) | |
| 109 | −{ | |
| 110 | − struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 111 | − return regmap_update_bits(rc5t583->regmap, reg, bit_mask, 0); | |
| 112 | −} | |
| 113 | − | |
| 114 | −int rc5t583_update(struct device *dev, unsigned int reg, | |
| 115 | − unsigned int val, unsigned int mask) | |
| 116 | −{ | |
| 117 | − struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 118 | − return regmap_update_bits(rc5t583->regmap, reg, mask, val); | |
| 119 | −} | |
| 120 | − | |
| 121 | 83 | static int __rc5t583_set_ext_pwrreq1_control(struct device *dev, |
| 122 | 84 | int id, int ext_pwr, int slots) |
| 123 | 85 | { |
| @@ -197,6 +159,7 @@ int rc5t583_ext_power_req_config(struct device *dev, int ds_id, · 73 unmodified lines | ||
| 197 | 159 | ds_id, ext_pwr_req); |
| 198 | 160 | return 0; |
| 199 | 161 | } |
| 162 | +EXPORT_SYMBOL(rc5t583_ext_power_req_config); | |
| 200 | 163 | |
| 201 | 164 | static int rc5t583_clear_ext_power_req(struct rc5t583 *rc5t583, |
| 202 | 165 | struct rc5t583_platform_data *pdata) |
| @@ -30,7 +30,9 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <linux/platform_device.h> |
| 31 | 31 | #include <linux/gpio.h> |
| 32 | 32 | #include <linux/delay.h> |
| 33 | −#include <linux/i2c/twl.h> | |
| 33 | +#include <linux/i2c.h> | |
| 34 | +#include <linux/regmap.h> | |
| 35 | +#include <linux/err.h> | |
| 34 | 36 | #include <linux/mfd/core.h> |
| 35 | 37 | #include <linux/mfd/twl6040.h> |
| 36 | 38 | |
| @@ -39,7 +41,7 @@ · 2 unmodified lines | ||
| 39 | 41 | int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) |
| 40 | 42 | { |
| 41 | 43 | int ret; |
| 42 | − u8 val = 0; | |
| 44 | + unsigned int val; | |
| 43 | 45 | |
| 44 | 46 | mutex_lock(&twl6040->io_mutex); |
| 45 | 47 | /* Vibra control registers from cache */ |
| @@ -47,7 +49,7 @@ int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg) · 1 unmodified line | ||
| 47 | 49 | reg == TWL6040_REG_VIBCTLR)) { |
| 48 | 50 | val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)]; |
| 49 | 51 | } else { |
| 50 | − ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg); | |
| 52 | + ret = regmap_read(twl6040->regmap, reg, &val); | |
| 51 | 53 | if (ret < 0) { |
| 52 | 54 | mutex_unlock(&twl6040->io_mutex); |
| 53 | 55 | return ret; |
| @@ -64,7 +66,7 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val) · 10 unmodified lines | ||
| 64 | 66 | int ret; |
| 65 | 67 | |
| 66 | 68 | mutex_lock(&twl6040->io_mutex); |
| 67 | − ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg); | |
| 69 | + ret = regmap_write(twl6040->regmap, reg, val); | |
| 68 | 70 | /* Cache the vibra control registers */ |
| 69 | 71 | if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR) |
| 70 | 72 | twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val; |
| @@ -77,16 +79,9 @@ EXPORT_SYMBOL(twl6040_reg_write); · 6 unmodified lines | ||
| 77 | 79 | int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) |
| 78 | 80 | { |
| 79 | 81 | int ret; |
| 80 | − u8 val; | |
| 81 | 82 | |
| 82 | 83 | mutex_lock(&twl6040->io_mutex); |
| 83 | − ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg); | |
| 84 | − if (ret) | |
| 85 | − goto out; | |
| 86 | − | |
| 87 | − val |= mask; | |
| 88 | − ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg); | |
| 89 | −out: | |
| 84 | + ret = regmap_update_bits(twl6040->regmap, reg, mask, mask); | |
| 90 | 85 | mutex_unlock(&twl6040->io_mutex); |
| 91 | 86 | return ret; |
| 92 | 87 | } |
| @@ -95,16 +90,9 @@ EXPORT_SYMBOL(twl6040_set_bits); · 2 unmodified lines | ||
| 95 | 90 | int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask) |
| 96 | 91 | { |
| 97 | 92 | int ret; |
| 98 | − u8 val; | |
| 99 | 93 | |
| 100 | 94 | mutex_lock(&twl6040->io_mutex); |
| 101 | − ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg); | |
| 102 | − if (ret) | |
| 103 | − goto out; | |
| 104 | − | |
| 105 | − val &= ~mask; | |
| 106 | − ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg); | |
| 107 | −out: | |
| 95 | + ret = regmap_update_bits(twl6040->regmap, reg, mask, 0); | |
| 108 | 96 | mutex_unlock(&twl6040->io_mutex); |
| 109 | 97 | return ret; |
| 110 | 98 | } |
| @@ -494,32 +482,58 @@ static struct resource twl6040_codec_rsrc[] = { · 383 unmodified lines | ||
| 494 | 482 | }, |
| 495 | 483 | }; |
| 496 | 484 | |
| 497 | −static int __devinit twl6040_probe(struct platform_device *pdev) | |
| 485 | +static bool twl6040_readable_reg(struct device *dev, unsigned int reg) | |
| 498 | 486 | { |
| 499 | − struct twl4030_audio_data *pdata = pdev->dev.platform_data; | |
| 487 | + /* Register 0 is not readable */ | |
| 488 | + if (!reg) | |
| 489 | + return false; | |
| 490 | + return true; | |
| 491 | +} | |
| 492 | + | |
| 493 | +static struct regmap_config twl6040_regmap_config = { | |
| 494 | + .reg_bits = 8, | |
| 495 | + .val_bits = 8, | |
| 496 | + .max_register = TWL6040_REG_STATUS, /* 0x2e */ | |
| 497 | + | |
| 498 | + .readable_reg = twl6040_readable_reg, | |
| 499 | +}; | |
| 500 | + | |
| 501 | +static int __devinit twl6040_probe(struct i2c_client *client, | |
| 502 | + const struct i2c_device_id *id) | |
| 503 | +{ | |
| 504 | + struct twl6040_platform_data *pdata = client->dev.platform_data; | |
| 500 | 505 | struct twl6040 *twl6040; |
| 501 | 506 | struct mfd_cell *cell = NULL; |
| 502 | 507 | int ret, children = 0; |
| 503 | 508 | |
| 504 | 509 | if (!pdata) { |
| 505 | − dev_err(&pdev->dev, "Platform data is missing\n"); | |
| 510 | + dev_err(&client->dev, "Platform data is missing\n"); | |
| 506 | 511 | return -EINVAL; |
| 507 | 512 | } |
| 508 | 513 | |
| 509 | 514 | /* In order to operate correctly we need valid interrupt config */ |
| 510 | − if (!pdata->naudint_irq || !pdata->irq_base) { | |
| 511 | − dev_err(&pdev->dev, "Invalid IRQ configuration\n"); | |
| 515 | + if (!client->irq || !pdata->irq_base) { | |
| 516 | + dev_err(&client->dev, "Invalid IRQ configuration\n"); | |
| 512 | 517 | return -EINVAL; |
| 513 | 518 | } |
| 514 | 519 | |
| 515 | − twl6040 = kzalloc(sizeof(struct twl6040), GFP_KERNEL); | |
| 516 | − if (!twl6040) | |
| 517 | − return -ENOMEM; | |
| 520 | + twl6040 = devm_kzalloc(&client->dev, sizeof(struct twl6040), | |
| 521 | + GFP_KERNEL); | |
| 522 | + if (!twl6040) { | |
| 523 | + ret = -ENOMEM; | |
| 524 | + goto err; | |
| 525 | + } | |
| 526 | + | |
| 527 | + twl6040->regmap = regmap_init_i2c(client, &twl6040_regmap_config); | |
| 528 | + if (IS_ERR(twl6040->regmap)) { | |
| 529 | + ret = PTR_ERR(twl6040->regmap); | |
| 530 | + goto err; | |
| 531 | + } | |
| 518 | 532 | |
| 519 | − platform_set_drvdata(pdev, twl6040); | |
| 533 | + i2c_set_clientdata(client, twl6040); | |
| 520 | 534 | |
| 521 | − twl6040->dev = &pdev->dev; | |
| 522 | − twl6040->irq = pdata->naudint_irq; | |
| 535 | + twl6040->dev = &client->dev; | |
| 536 | + twl6040->irq = client->irq; | |
| 523 | 537 | twl6040->irq_base = pdata->irq_base; |
| 524 | 538 | |
| 525 | 539 | mutex_init(&twl6040->mutex); |
| @@ -588,12 +602,12 @@ static int __devinit twl6040_probe(struct platform_device *pdev) · 62 unmodified lines | ||
| 588 | 602 | } |
| 589 | 603 | |
| 590 | 604 | if (children) { |
| 591 | − ret = mfd_add_devices(&pdev->dev, pdev->id, twl6040->cells, | |
| 605 | + ret = mfd_add_devices(&client->dev, -1, twl6040->cells, | |
| 592 | 606 | children, NULL, 0); |
| 593 | 607 | if (ret) |
| 594 | 608 | goto mfd_err; |
| 595 | 609 | } else { |
| 596 | − dev_err(&pdev->dev, "No platform data found for children\n"); | |
| 610 | + dev_err(&client->dev, "No platform data found for children\n"); | |
| 597 | 611 | ret = -ENODEV; |
| 598 | 612 | goto mfd_err; |
| 599 | 613 | } |
| @@ -608,14 +622,15 @@ gpio2_err: · 8 unmodified lines | ||
| 608 | 622 | if (gpio_is_valid(twl6040->audpwron)) |
| 609 | 623 | gpio_free(twl6040->audpwron); |
| 610 | 624 | gpio1_err: |
| 611 | − platform_set_drvdata(pdev, NULL); | |
| 612 | − kfree(twl6040); | |
| 625 | + i2c_set_clientdata(client, NULL); | |
| 626 | + regmap_exit(twl6040->regmap); | |
| 627 | +err: | |
| 613 | 628 | return ret; |
| 614 | 629 | } |
| 615 | 630 | |
| 616 | −static int __devexit twl6040_remove(struct platform_device *pdev) | |
| 631 | +static int __devexit twl6040_remove(struct i2c_client *client) | |
| 617 | 632 | { |
| 618 | − struct twl6040 *twl6040 = platform_get_drvdata(pdev); | |
| 633 | + struct twl6040 *twl6040 = i2c_get_clientdata(client); | |
| 619 | 634 | |
| 620 | 635 | if (twl6040->power_count) |
| 621 | 636 | twl6040_power(twl6040, 0); |
| @@ -626,23 +641,30 @@ static int __devexit twl6040_remove(struct platform_device *pdev) · 4 unmodified lines | ||
| 626 | 641 | free_irq(twl6040->irq_base + TWL6040_IRQ_READY, twl6040); |
| 627 | 642 | twl6040_irq_exit(twl6040); |
| 628 | 643 | |
| 629 | − mfd_remove_devices(&pdev->dev); | |
| 630 | − platform_set_drvdata(pdev, NULL); | |
| 631 | − kfree(twl6040); | |
| 644 | + mfd_remove_devices(&client->dev); | |
| 645 | + i2c_set_clientdata(client, NULL); | |
| 646 | + regmap_exit(twl6040->regmap); | |
| 632 | 647 | |
| 633 | 648 | return 0; |
| 634 | 649 | } |
| 635 | 650 | |
| 636 | −static struct platform_driver twl6040_driver = { | |
| 651 | +static const struct i2c_device_id twl6040_i2c_id[] = { | |
| 652 | + { "twl6040", 0, }, | |
| 653 | + { }, | |
| 654 | +}; | |
| 655 | +MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id); | |
| 656 | + | |
| 657 | +static struct i2c_driver twl6040_driver = { | |
| 658 | + .driver = { | |
| 659 | + .name = "twl6040", | |
| 660 | + .owner = THIS_MODULE, | |
| 661 | + }, | |
| 637 | 662 | .probe = twl6040_probe, |
| 638 | 663 | .remove = __devexit_p(twl6040_remove), |
| 639 | − .driver = { | |
| 640 | − .owner = THIS_MODULE, | |
| 641 | − .name = "twl6040", | |
| 642 | − }, | |
| 664 | + .id_table = twl6040_i2c_id, | |
| 643 | 665 | }; |
| 644 | 666 | |
| 645 | −module_platform_driver(twl6040_driver); | |
| 667 | +module_i2c_driver(twl6040_driver); | |
| 646 | 668 | |
| 647 | 669 | MODULE_DESCRIPTION("TWL6040 MFD"); |
| 648 | 670 | MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>"); |
| @@ -873,7 +873,7 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, · 872 unmodified lines | ||
| 873 | 873 | { |
| 874 | 874 | struct mmc_blk_data *md = mq->data; |
| 875 | 875 | struct mmc_card *card = md->queue.card; |
| 876 | − unsigned int from, nr, arg; | |
| 876 | + unsigned int from, nr, arg, trim_arg, erase_arg; | |
| 877 | 877 | int err = 0, type = MMC_BLK_SECDISCARD; |
| 878 | 878 | |
| 879 | 879 | if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) { |
| @@ -881,20 +881,26 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, · 1 unmodified line | ||
| 881 | 881 | goto out; |
| 882 | 882 | } |
| 883 | 883 | |
| 884 | + from = blk_rq_pos(req); | |
| 885 | + nr = blk_rq_sectors(req); | |
| 886 | + | |
| 884 | 887 | /* The sanitize operation is supported at v4.5 only */ |
| 885 | 888 | if (mmc_can_sanitize(card)) { |
| 886 | − err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | |
| 887 | − EXT_CSD_SANITIZE_START, 1, 0); | |
| 888 | − goto out; | |
| 889 | + erase_arg = MMC_ERASE_ARG; | |
| 890 | + trim_arg = MMC_TRIM_ARG; | |
| 891 | + } else { | |
| 892 | + erase_arg = MMC_SECURE_ERASE_ARG; | |
| 893 | + trim_arg = MMC_SECURE_TRIM1_ARG; | |
| 889 | 894 | } |
| 890 | 895 | |
| 891 | − from = blk_rq_pos(req); | |
| 892 | − nr = blk_rq_sectors(req); | |
| 893 | − | |
| 894 | − if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr)) | |
| 895 | − arg = MMC_SECURE_TRIM1_ARG; | |
| 896 | − else | |
| 897 | − arg = MMC_SECURE_ERASE_ARG; | |
| 896 | + if (mmc_erase_group_aligned(card, from, nr)) | |
| 897 | + arg = erase_arg; | |
| 898 | + else if (mmc_can_trim(card)) | |
| 899 | + arg = trim_arg; | |
| 900 | + else { | |
| 901 | + err = -EINVAL; | |
| 902 | + goto out; | |
| 903 | + } | |
| 898 | 904 | retry: |
| 899 | 905 | if (card->quirks & MMC_QUIRK_INAND_CMD38) { |
| 900 | 906 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
| @@ -904,25 +910,41 @@ retry: · 3 unmodified lines | ||
| 904 | 910 | INAND_CMD38_ARG_SECERASE, |
| 905 | 911 | 0); |
| 906 | 912 | if (err) |
| 907 | − goto out; | |
| 913 | + goto out_retry; | |
| 908 | 914 | } |
| 915 | + | |
| 909 | 916 | err = mmc_erase(card, from, nr, arg); |
| 910 | − if (!err && arg == MMC_SECURE_TRIM1_ARG) { | |
| 917 | + if (err == -EIO) | |
| 918 | + goto out_retry; | |
| 919 | + if (err) | |
| 920 | + goto out; | |
| 921 | + | |
| 922 | + if (arg == MMC_SECURE_TRIM1_ARG) { | |
| 911 | 923 | if (card->quirks & MMC_QUIRK_INAND_CMD38) { |
| 912 | 924 | err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, |
| 913 | 925 | INAND_CMD38_ARG_EXT_CSD, |
| 914 | 926 | INAND_CMD38_ARG_SECTRIM2, |
| 915 | 927 | 0); |
| 916 | 928 | if (err) |
| 917 | − goto out; | |
| 929 | + goto out_retry; | |
| 918 | 930 | } |
| 931 | + | |
| 919 | 932 | err = mmc_erase(card, from, nr, MMC_SECURE_TRIM2_ARG); |
| 933 | + if (err == -EIO) | |
| 934 | + goto out_retry; | |
| 935 | + if (err) | |
| 936 | + goto out; | |
| 920 | 937 | } |
| 921 | −out: | |
| 922 | − if (err == -EIO && !mmc_blk_reset(md, card->host, type)) | |
| 938 | + | |
| 939 | + if (mmc_can_sanitize(card)) | |
| 940 | + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, | |
| 941 | + EXT_CSD_SANITIZE_START, 1, 0); | |
| 942 | +out_retry: | |
| 943 | + if (err && !mmc_blk_reset(md, card->host, type)) | |
| 923 | 944 | goto retry; |
| 924 | 945 | if (!err) |
| 925 | 946 | mmc_blk_reset_success(md, type); |
| 947 | +out: | |
| 926 | 948 | spin_lock_irq(&md->lock); |
| 927 | 949 | __blk_end_request(req, err, blk_rq_bytes(req)); |
| 928 | 950 | spin_unlock_irq(&md->lock); |
| @@ -1802,7 +1824,7 @@ static void mmc_blk_remove(struct mmc_card *card) · 873 unmodified lines | ||
| 1802 | 1824 | } |
| 1803 | 1825 | |
| 1804 | 1826 | #ifdef CONFIG_PM |
| 1805 | −static int mmc_blk_suspend(struct mmc_card *card, pm_message_t state) | |
| 1827 | +static int mmc_blk_suspend(struct mmc_card *card) | |
| 1806 | 1828 | { |
| 1807 | 1829 | struct mmc_blk_data *part_md; |
| 1808 | 1830 | struct mmc_blk_data *md = mmc_get_drvdata(card); |
| @@ -139,7 +139,7 @@ static void mmc_queue_setup_discard(struct request_queue *q, · 138 unmodified lines | ||
| 139 | 139 | |
| 140 | 140 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); |
| 141 | 141 | q->limits.max_discard_sectors = max_discard; |
| 142 | − if (card->erased_byte == 0) | |
| 142 | + if (card->erased_byte == 0 && !mmc_can_discard(card)) | |
| 143 | 143 | q->limits.discard_zeroes_data = 1; |
| 144 | 144 | q->limits.discard_granularity = card->pref_erase << 9; |
| 145 | 145 | /* granularity must not be greater than max. discard */ |
| @@ -122,14 +122,14 @@ static int mmc_bus_remove(struct device *dev) · 121 unmodified lines | ||
| 122 | 122 | return 0; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | −static int mmc_bus_suspend(struct device *dev, pm_message_t state) | |
| 125 | +static int mmc_bus_suspend(struct device *dev) | |
| 126 | 126 | { |
| 127 | 127 | struct mmc_driver *drv = to_mmc_driver(dev->driver); |
| 128 | 128 | struct mmc_card *card = mmc_dev_to_card(dev); |
| 129 | 129 | int ret = 0; |
| 130 | 130 | |
| 131 | 131 | if (dev->driver && drv->suspend) |
| 132 | − ret = drv->suspend(card, state); | |
| 132 | + ret = drv->suspend(card); | |
| 133 | 133 | return ret; |
| 134 | 134 | } |
| 135 | 135 | |
| @@ -165,20 +165,14 @@ static int mmc_runtime_idle(struct device *dev) · 29 unmodified lines | ||
| 165 | 165 | return pm_runtime_suspend(dev); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | +#endif /* !CONFIG_PM_RUNTIME */ | |
| 169 | + | |
| 168 | 170 | static const struct dev_pm_ops mmc_bus_pm_ops = { |
| 169 | − .runtime_suspend = mmc_runtime_suspend, | |
| 170 | − .runtime_resume = mmc_runtime_resume, | |
| 171 | − .runtime_idle = mmc_runtime_idle, | |
| 171 | + SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, | |
| 172 | + mmc_runtime_idle) | |
| 173 | + SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_suspend, mmc_bus_resume) | |
| 172 | 174 | }; |
| 173 | 175 | |
| 174 | −#define MMC_PM_OPS_PTR (&mmc_bus_pm_ops) | |
| 175 | − | |
| 176 | −#else /* !CONFIG_PM_RUNTIME */ | |
| 177 | − | |
| 178 | −#define MMC_PM_OPS_PTR NULL | |
| 179 | − | |
| 180 | −#endif /* !CONFIG_PM_RUNTIME */ | |
| 181 | − | |
| 182 | 176 | static struct bus_type mmc_bus_type = { |
| 183 | 177 | .name = "mmc", |
| 184 | 178 | .dev_attrs = mmc_dev_attrs, |
| @@ -186,9 +180,7 @@ static struct bus_type mmc_bus_type = { · 1 unmodified line | ||
| 186 | 180 | .uevent = mmc_bus_uevent, |
| 187 | 181 | .probe = mmc_bus_probe, |
| 188 | 182 | .remove = mmc_bus_remove, |
| 189 | − .suspend = mmc_bus_suspend, | |
| 190 | − .resume = mmc_bus_resume, | |
| 191 | − .pm = MMC_PM_OPS_PTR, | |
| 183 | + .pm = &mmc_bus_pm_ops, | |
| 192 | 184 | }; |
| 193 | 185 | |
| 194 | 186 | int mmc_register_bus(void) |
| @@ -12,6 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #include <linux/gpio.h> |
| 13 | 13 | #include <linux/interrupt.h> |
| 14 | 14 | #include <linux/jiffies.h> |
| 15 | +#include <linux/mmc/cd-gpio.h> | |
| 15 | 16 | #include <linux/mmc/host.h> |
| 16 | 17 | #include <linux/module.h> |
| 17 | 18 | #include <linux/slab.h> |
| @@ -1409,7 +1409,10 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card, · 1408 unmodified lines | ||
| 1409 | 1409 | { |
| 1410 | 1410 | unsigned int erase_timeout; |
| 1411 | 1411 | |
| 1412 | − if (card->ext_csd.erase_group_def & 1) { | |
| 1412 | + if (arg == MMC_DISCARD_ARG || | |
| 1413 | + (arg == MMC_TRIM_ARG && card->ext_csd.rev >= 6)) { | |
| 1414 | + erase_timeout = card->ext_csd.trim_timeout; | |
| 1415 | + } else if (card->ext_csd.erase_group_def & 1) { | |
| 1413 | 1416 | /* High Capacity Erase Group Size uses HC timeouts */ |
| 1414 | 1417 | if (arg == MMC_TRIM_ARG) |
| 1415 | 1418 | erase_timeout = card->ext_csd.trim_timeout; |
| @@ -1681,8 +1684,6 @@ int mmc_can_trim(struct mmc_card *card) · 265 unmodified lines | ||
| 1681 | 1684 | { |
| 1682 | 1685 | if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_GB_CL_EN) |
| 1683 | 1686 | return 1; |
| 1684 | − if (mmc_can_discard(card)) | |
| 1685 | − return 1; | |
| 1686 | 1687 | return 0; |
| 1687 | 1688 | } |
| 1688 | 1689 | EXPORT_SYMBOL(mmc_can_trim); |
| @@ -1701,6 +1702,8 @@ EXPORT_SYMBOL(mmc_can_discard); · 12 unmodified lines | ||
| 1701 | 1702 | |
| 1702 | 1703 | int mmc_can_sanitize(struct mmc_card *card) |
| 1703 | 1704 | { |
| 1705 | + if (!mmc_can_trim(card) && !mmc_can_erase(card)) | |
| 1706 | + return 0; | |
| 1704 | 1707 | if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_SANITIZE) |
| 1705 | 1708 | return 1; |
| 1706 | 1709 | return 0; |
| @@ -2235,6 +2238,7 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable) · 528 unmodified lines | ||
| 2235 | 2238 | mmc_card_is_removable(host)) |
| 2236 | 2239 | return err; |
| 2237 | 2240 | |
| 2241 | + mmc_claim_host(host); | |
| 2238 | 2242 | if (card && mmc_card_mmc(card) && |
| 2239 | 2243 | (card->ext_csd.cache_size > 0)) { |
| 2240 | 2244 | enable = !!enable; |
| @@ -2252,6 +2256,7 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable) · 11 unmodified lines | ||
| 2252 | 2256 | card->ext_csd.cache_ctrl = enable; |
| 2253 | 2257 | } |
| 2254 | 2258 | } |
| 2259 | + mmc_release_host(host); | |
| 2255 | 2260 | |
| 2256 | 2261 | return err; |
| 2257 | 2262 | } |
| @@ -2269,49 +2274,32 @@ int mmc_suspend_host(struct mmc_host *host) · 11 unmodified lines | ||
| 2269 | 2274 | |
| 2270 | 2275 | cancel_delayed_work(&host->detect); |
| 2271 | 2276 | mmc_flush_scheduled_work(); |
| 2272 | − if (mmc_try_claim_host(host)) { | |
| 2273 | − err = mmc_cache_ctrl(host, 0); | |
| 2274 | − mmc_release_host(host); | |
| 2275 | − } else { | |
| 2276 | − err = -EBUSY; | |
| 2277 | − } | |
| 2278 | 2277 | |
| 2278 | + err = mmc_cache_ctrl(host, 0); | |
| 2279 | 2279 | if (err) |
| 2280 | 2280 | goto out; |
| 2281 | 2281 | |
| 2282 | 2282 | mmc_bus_get(host); |
| 2283 | 2283 | if (host->bus_ops && !host->bus_dead) { |
| 2284 | 2284 | |
| 2285 | − /* | |
| 2286 | − * A long response time is not acceptable for device drivers | |
| 2287 | − * when doing suspend. Prevent mmc_claim_host in the suspend | |
| 2288 | − * sequence, to potentially wait "forever" by trying to | |
| 2289 | − * pre-claim the host. | |
| 2290 | − */ | |
| 2291 | − if (mmc_try_claim_host(host)) { | |
| 2292 | − if (host->bus_ops->suspend) { | |
| 2293 | − err = host->bus_ops->suspend(host); | |
| 2294 | − } | |
| 2295 | − mmc_release_host(host); | |
| 2285 | + if (host->bus_ops->suspend) | |
| 2286 | + err = host->bus_ops->suspend(host); | |
| 2296 | 2287 | |
| 2297 | − if (err == -ENOSYS || !host->bus_ops->resume) { | |
| 2298 | − /* | |
| 2299 | − * We simply "remove" the card in this case. | |
| 2300 | − * It will be redetected on resume. (Calling | |
| 2301 | − * bus_ops->remove() with a claimed host can | |
| 2302 | − * deadlock.) | |
| 2303 | − */ | |
| 2304 | − if (host->bus_ops->remove) | |
| 2305 | − host->bus_ops->remove(host); | |
| 2306 | − mmc_claim_host(host); | |
| 2307 | − mmc_detach_bus(host); | |
| 2308 | − mmc_power_off(host); | |
| 2309 | − mmc_release_host(host); | |
| 2310 | − host->pm_flags = 0; | |
| 2311 | − err = 0; | |
| 2312 | − } | |
| 2313 | − } else { | |
| 2314 | − err = -EBUSY; | |
| 2288 | + if (err == -ENOSYS || !host->bus_ops->resume) { | |
| 2289 | + /* | |
| 2290 | + * We simply "remove" the card in this case. | |
| 2291 | + * It will be redetected on resume. (Calling | |
| 2292 | + * bus_ops->remove() with a claimed host can | |
| 2293 | + * deadlock.) | |
| 2294 | + */ | |
| 2295 | + if (host->bus_ops->remove) | |
| 2296 | + host->bus_ops->remove(host); | |
| 2297 | + mmc_claim_host(host); | |
| 2298 | + mmc_detach_bus(host); | |
| 2299 | + mmc_power_off(host); | |
| 2300 | + mmc_release_host(host); | |
| 2301 | + host->pm_flags = 0; | |
| 2302 | + err = 0; | |
| 2315 | 2303 | } |
| 2316 | 2304 | } |
| 2317 | 2305 | mmc_bus_put(host); |
| @@ -526,8 +526,10 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) · 525 unmodified lines | ||
| 526 | 526 | return -ENODEV; |
| 527 | 527 | |
| 528 | 528 | sg_len = dw_mci_pre_dma_transfer(host, data, 0); |
| 529 | − if (sg_len < 0) | |
| 529 | + if (sg_len < 0) { | |
| 530 | + host->dma_ops->stop(host); | |
| 530 | 531 | return sg_len; |
| 532 | + } | |
| 531 | 533 | |
| 532 | 534 | host->using_dma = 1; |
| 533 | 535 | |
| @@ -1879,7 +1881,8 @@ static void dw_mci_init_dma(struct dw_mci *host) · 1345 unmodified lines | ||
| 1879 | 1881 | if (!host->dma_ops) |
| 1880 | 1882 | goto no_dma; |
| 1881 | 1883 | |
| 1882 | − if (host->dma_ops->init) { | |
| 1884 | + if (host->dma_ops->init && host->dma_ops->start && | |
| 1885 | + host->dma_ops->stop && host->dma_ops->cleanup) { | |
| 1883 | 1886 | if (host->dma_ops->init(host)) { |
| 1884 | 1887 | dev_err(&host->dev, "%s: Unable to initialize " |
| 1885 | 1888 | "DMA Controller.\n", __func__); |
| @@ -94,6 +94,17 @@ static struct variant_data variant_u300 = { · 93 unmodified lines | ||
| 94 | 94 | .signal_direction = true, |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | +static struct variant_data variant_nomadik = { | |
| 98 | + .fifosize = 16 * 4, | |
| 99 | + .fifohalfsize = 8 * 4, | |
| 100 | + .clkreg = MCI_CLK_ENABLE, | |
| 101 | + .datalength_bits = 24, | |
| 102 | + .sdio = true, | |
| 103 | + .st_clkdiv = true, | |
| 104 | + .pwrreg_powerup = MCI_PWR_ON, | |
| 105 | + .signal_direction = true, | |
| 106 | +}; | |
| 107 | + | |
| 97 | 108 | static struct variant_data variant_ux500 = { |
| 98 | 109 | .fifosize = 30 * 4, |
| 99 | 110 | .fifohalfsize = 8 * 4, |
| @@ -1568,6 +1579,11 @@ static struct amba_id mmci_ids[] = { · 1468 unmodified lines | ||
| 1568 | 1579 | .mask = 0x00ffffff, |
| 1569 | 1580 | .data = &variant_u300, |
| 1570 | 1581 | }, |
| 1582 | + { | |
| 1583 | + .id = 0x10180180, | |
| 1584 | + .mask = 0xf0ffffff, | |
| 1585 | + .data = &variant_nomadik, | |
| 1586 | + }, | |
| 1571 | 1587 | { |
| 1572 | 1588 | .id = 0x00280180, |
| 1573 | 1589 | .mask = 0x00ffffff, |
| @@ -363,6 +363,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host) · 362 unmodified lines | ||
| 363 | 363 | goto out; |
| 364 | 364 | |
| 365 | 365 | dmaengine_submit(desc); |
| 366 | + dma_async_issue_pending(host->dmach); | |
| 366 | 367 | return; |
| 367 | 368 | |
| 368 | 369 | out: |
| @@ -403,6 +404,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host) · 34 unmodified lines | ||
| 403 | 404 | goto out; |
| 404 | 405 | |
| 405 | 406 | dmaengine_submit(desc); |
| 407 | + dma_async_issue_pending(host->dmach); | |
| 406 | 408 | return; |
| 407 | 409 | |
| 408 | 410 | out: |
| @@ -531,6 +533,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host) · 122 unmodified lines | ||
| 531 | 533 | goto out; |
| 532 | 534 | |
| 533 | 535 | dmaengine_submit(desc); |
| 536 | + dma_async_issue_pending(host->dmach); | |
| 534 | 537 | return; |
| 535 | 538 | out: |
| 536 | 539 | dev_warn(mmc_dev(host->mmc), |
| @@ -249,7 +249,7 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on, · 248 unmodified lines | ||
| 249 | 249 | * the pbias cell programming support is still missing when |
| 250 | 250 | * booting with Device tree |
| 251 | 251 | */ |
| 252 | − if (of_have_populated_dt() && !vdd) | |
| 252 | + if (dev->of_node && !vdd) | |
| 253 | 253 | return 0; |
| 254 | 254 | |
| 255 | 255 | if (mmc_slot(host).before_set_reg) |
| @@ -1549,7 +1549,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 1293 unmodified lines | ||
| 1549 | 1549 | * can't be allowed when booting with device |
| 1550 | 1550 | * tree. |
| 1551 | 1551 | */ |
| 1552 | − (!of_have_populated_dt())) { | |
| 1552 | + !host->dev->of_node) { | |
| 1553 | 1553 | /* |
| 1554 | 1554 | * The mmc_select_voltage fn of the core does |
| 1555 | 1555 | * not seem to set the power_mode to |
| @@ -1741,7 +1741,7 @@ static const struct of_device_id omap_mmc_of_match[] = { · 185 unmodified lines | ||
| 1741 | 1741 | .data = &omap4_reg_offset, |
| 1742 | 1742 | }, |
| 1743 | 1743 | {}, |
| 1744 | −} | |
| 1744 | +}; | |
| 1745 | 1745 | MODULE_DEVICE_TABLE(of, omap_mmc_of_match); |
| 1746 | 1746 | |
| 1747 | 1747 | static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev) |
| @@ -467,8 +467,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev) · 466 unmodified lines | ||
| 467 | 467 | clk_prepare_enable(clk); |
| 468 | 468 | pltfm_host->clk = clk; |
| 469 | 469 | |
| 470 | − if (!is_imx25_esdhc(imx_data)) | |
| 471 | − host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; | |
| 470 | + host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; | |
| 472 | 471 | |
| 473 | 472 | if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data)) |
| 474 | 473 | /* Fix errata ENGcm07207 present on i.MX25 and i.MX35 */ |
| @@ -147,7 +147,7 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable) · 146 unmodified lines | ||
| 147 | 147 | u32 present, irqs; |
| 148 | 148 | |
| 149 | 149 | if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) || |
| 150 | − !mmc_card_is_removable(host->mmc)) | |
| 150 | + (host->mmc->caps & MMC_CAP_NONREMOVABLE)) | |
| 151 | 151 | return; |
| 152 | 152 | |
| 153 | 153 | present = sdhci_readl(host, SDHCI_PRESENT_STATE) & |
| @@ -266,6 +266,7 @@ int start_dma_without_bch_irq(struct gpmi_nand_data *this, · 265 unmodified lines | ||
| 266 | 266 | desc->callback = dma_irq_callback; |
| 267 | 267 | desc->callback_param = this; |
| 268 | 268 | dmaengine_submit(desc); |
| 269 | + dma_async_issue_pending(get_dma_chan(this)); | |
| 269 | 270 | |
| 270 | 271 | /* Wait for the interrupt from the DMA block. */ |
| 271 | 272 | err = wait_for_completion_timeout(dma_c, msecs_to_jiffies(1000)); |
| @@ -89,16 +89,16 @@ static int __init arcrimi_probe(struct net_device *dev) · 88 unmodified lines | ||
| 89 | 89 | BUGLVL(D_NORMAL) printk(VERSION); |
| 90 | 90 | BUGLVL(D_NORMAL) printk("E-mail me if you actually test the RIM I driver, please!\n"); |
| 91 | 91 | |
| 92 | − BUGMSG(D_NORMAL, "Given: node %02Xh, shmem %lXh, irq %d\n", | |
| 92 | + BUGLVL(D_NORMAL) printk("Given: node %02Xh, shmem %lXh, irq %d\n", | |
| 93 | 93 | dev->dev_addr[0], dev->mem_start, dev->irq); |
| 94 | 94 | |
| 95 | 95 | if (dev->mem_start <= 0 || dev->irq <= 0) { |
| 96 | − BUGMSG(D_NORMAL, "No autoprobe for RIM I; you " | |
| 96 | + BUGLVL(D_NORMAL) printk("No autoprobe for RIM I; you " | |
| 97 | 97 | "must specify the shmem and irq!\n"); |
| 98 | 98 | return -ENODEV; |
| 99 | 99 | } |
| 100 | 100 | if (dev->dev_addr[0] == 0) { |
| 101 | − BUGMSG(D_NORMAL, "You need to specify your card's station " | |
| 101 | + BUGLVL(D_NORMAL) printk("You need to specify your card's station " | |
| 102 | 102 | "ID!\n"); |
| 103 | 103 | return -ENODEV; |
| 104 | 104 | } |
| @@ -109,7 +109,7 @@ static int __init arcrimi_probe(struct net_device *dev) · 4 unmodified lines | ||
| 109 | 109 | * will be taken. |
| 110 | 110 | */ |
| 111 | 111 | if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) { |
| 112 | − BUGMSG(D_NORMAL, "Card memory already allocated\n"); | |
| 112 | + BUGLVL(D_NORMAL) printk("Card memory already allocated\n"); | |
| 113 | 113 | return -ENODEV; |
| 114 | 114 | } |
| 115 | 115 | return arcrimi_found(dev); |
| @@ -744,14 +744,14 @@ static void cfhsi_wake_up(struct work_struct *work) · 743 unmodified lines | ||
| 744 | 744 | size_t fifo_occupancy = 0; |
| 745 | 745 | |
| 746 | 746 | /* Wakeup timeout */ |
| 747 | − dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n", | |
| 747 | + dev_dbg(&cfhsi->ndev->dev, "%s: Timeout.\n", | |
| 748 | 748 | __func__); |
| 749 | 749 | |
| 750 | 750 | /* Check FIFO to check if modem has sent something. */ |
| 751 | 751 | WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev, |
| 752 | 752 | &fifo_occupancy)); |
| 753 | 753 | |
| 754 | − dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n", | |
| 754 | + dev_dbg(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n", | |
| 755 | 755 | __func__, (unsigned) fifo_occupancy); |
| 756 | 756 | |
| 757 | 757 | /* Check if we misssed the interrupt. */ |
| @@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev) · 452 unmodified lines | ||
| 1210 | 1210 | |
| 1211 | 1211 | static void cfhsi_shutdown(struct cfhsi *cfhsi) |
| 1212 | 1212 | { |
| 1213 | − u8 *tx_buf, *rx_buf; | |
| 1213 | + u8 *tx_buf, *rx_buf, *flip_buf; | |
| 1214 | 1214 | |
| 1215 | 1215 | /* Stop TXing */ |
| 1216 | 1216 | netif_tx_stop_all_queues(cfhsi->ndev); |
| @@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) · 17 unmodified lines | ||
| 1234 | 1234 | /* Store bufferes: will be freed later. */ |
| 1235 | 1235 | tx_buf = cfhsi->tx_buf; |
| 1236 | 1236 | rx_buf = cfhsi->rx_buf; |
| 1237 | − | |
| 1237 | + flip_buf = cfhsi->rx_flip_buf; | |
| 1238 | 1238 | /* Flush transmit queues. */ |
| 1239 | 1239 | cfhsi_abort_tx(cfhsi); |
| 1240 | 1240 | |
| @@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi) · 6 unmodified lines | ||
| 1247 | 1247 | /* Free buffers. */ |
| 1248 | 1248 | kfree(tx_buf); |
| 1249 | 1249 | kfree(rx_buf); |
| 1250 | + kfree(flip_buf); | |
| 1250 | 1251 | } |
| 1251 | 1252 | |
| 1252 | 1253 | int cfhsi_remove(struct platform_device *pdev) |
| @@ -875,6 +875,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) · 874 unmodified lines | ||
| 875 | 875 | PCAN_USBPRO_INFO_FW, |
| 876 | 876 | &fi, sizeof(fi)); |
| 877 | 877 | if (err) { |
| 878 | + kfree(usb_if); | |
| 878 | 879 | dev_err(dev->netdev->dev.parent, |
| 879 | 880 | "unable to read %s firmware info (err %d)\n", |
| 880 | 881 | pcan_usb_pro.name, err); |
| @@ -885,6 +886,7 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) · 4 unmodified lines | ||
| 885 | 886 | PCAN_USBPRO_INFO_BL, |
| 886 | 887 | &bi, sizeof(bi)); |
| 887 | 888 | if (err) { |
| 889 | + kfree(usb_if); | |
| 888 | 890 | dev_err(dev->netdev->dev.parent, |
| 889 | 891 | "unable to read %s bootloader info (err %d)\n", |
| 890 | 892 | pcan_usb_pro.name, err); |
| @@ -107,14 +107,14 @@ static int dummy_dev_init(struct net_device *dev) · 106 unmodified lines | ||
| 107 | 107 | return 0; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | −static void dummy_dev_free(struct net_device *dev) | |
| 110 | +static void dummy_dev_uninit(struct net_device *dev) | |
| 111 | 111 | { |
| 112 | 112 | free_percpu(dev->dstats); |
| 113 | − free_netdev(dev); | |
| 114 | 113 | } |
| 115 | 114 | |
| 116 | 115 | static const struct net_device_ops dummy_netdev_ops = { |
| 117 | 116 | .ndo_init = dummy_dev_init, |
| 117 | + .ndo_uninit = dummy_dev_uninit, | |
| 118 | 118 | .ndo_start_xmit = dummy_xmit, |
| 119 | 119 | .ndo_validate_addr = eth_validate_addr, |
| 120 | 120 | .ndo_set_rx_mode = set_multicast_list, |
| @@ -128,7 +128,7 @@ static void dummy_setup(struct net_device *dev) · 7 unmodified lines | ||
| 128 | 128 | |
| 129 | 129 | /* Initialize the device structure. */ |
| 130 | 130 | dev->netdev_ops = &dummy_netdev_ops; |
| 131 | − dev->destructor = dummy_dev_free; | |
| 131 | + dev->destructor = free_netdev; | |
| 132 | 132 | |
| 133 | 133 | /* Fill in device structure with ethernet-generic values. */ |
| 134 | 134 | dev->tx_queue_len = 0; |
| @@ -2476,7 +2476,7 @@ static irqreturn_t atl1_intr(int irq, void *data) · 2475 unmodified lines | ||
| 2476 | 2476 | "pcie phy link down %x\n", status); |
| 2477 | 2477 | if (netif_running(adapter->netdev)) { /* reset MAC */ |
| 2478 | 2478 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
| 2479 | − schedule_work(&adapter->pcie_dma_to_rst_task); | |
| 2479 | + schedule_work(&adapter->reset_dev_task); | |
| 2480 | 2480 | return IRQ_HANDLED; |
| 2481 | 2481 | } |
| 2482 | 2482 | } |
| @@ -2488,7 +2488,7 @@ static irqreturn_t atl1_intr(int irq, void *data) · 5 unmodified lines | ||
| 2488 | 2488 | "pcie DMA r/w error (status = 0x%x)\n", |
| 2489 | 2489 | status); |
| 2490 | 2490 | iowrite32(0, adapter->hw.hw_addr + REG_IMR); |
| 2491 | − schedule_work(&adapter->pcie_dma_to_rst_task); | |
| 2491 | + schedule_work(&adapter->reset_dev_task); | |
| 2492 | 2492 | return IRQ_HANDLED; |
| 2493 | 2493 | } |
| 2494 | 2494 | |
| @@ -2633,10 +2633,10 @@ static void atl1_down(struct atl1_adapter *adapter) · 138 unmodified lines | ||
| 2633 | 2633 | atl1_clean_rx_ring(adapter); |
| 2634 | 2634 | } |
| 2635 | 2635 | |
| 2636 | −static void atl1_tx_timeout_task(struct work_struct *work) | |
| 2636 | +static void atl1_reset_dev_task(struct work_struct *work) | |
| 2637 | 2637 | { |
| 2638 | 2638 | struct atl1_adapter *adapter = |
| 2639 | − container_of(work, struct atl1_adapter, tx_timeout_task); | |
| 2639 | + container_of(work, struct atl1_adapter, reset_dev_task); | |
| 2640 | 2640 | struct net_device *netdev = adapter->netdev; |
| 2641 | 2641 | |
| 2642 | 2642 | netif_device_detach(netdev); |
| @@ -3038,12 +3038,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev, · 395 unmodified lines | ||
| 3038 | 3038 | (unsigned long)adapter); |
| 3039 | 3039 | adapter->phy_timer_pending = false; |
| 3040 | 3040 | |
| 3041 | − INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task); | |
| 3041 | + INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task); | |
| 3042 | 3042 | |
| 3043 | 3043 | INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task); |
| 3044 | 3044 | |
| 3045 | − INIT_WORK(&adapter->pcie_dma_to_rst_task, atl1_tx_timeout_task); | |
| 3046 | − | |
| 3047 | 3045 | err = register_netdev(netdev); |
| 3048 | 3046 | if (err) |
| 3049 | 3047 | goto err_common; |
| @@ -758,9 +758,8 @@ struct atl1_adapter { · 757 unmodified lines | ||
| 758 | 758 | u16 link_speed; |
| 759 | 759 | u16 link_duplex; |
| 760 | 760 | spinlock_t lock; |
| 761 | − struct work_struct tx_timeout_task; | |
| 761 | + struct work_struct reset_dev_task; | |
| 762 | 762 | struct work_struct link_chg_task; |
| 763 | − struct work_struct pcie_dma_to_rst_task; | |
| 764 | 763 | |
| 765 | 764 | struct timer_list phy_config_timer; |
| 766 | 765 | bool phy_timer_pending; |
| @@ -194,7 +194,7 @@ static void atlx_tx_timeout(struct net_device *netdev) · 193 unmodified lines | ||
| 194 | 194 | { |
| 195 | 195 | struct atlx_adapter *adapter = netdev_priv(netdev); |
| 196 | 196 | /* Do the reset outside of interrupt context */ |
| 197 | − schedule_work(&adapter->tx_timeout_task); | |
| 197 | + schedule_work(&adapter->reset_dev_task); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /* |
| @@ -942,6 +942,12 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, · 941 unmodified lines | ||
| 942 | 942 | const u8 max_num_of_cos = (port) ? DCBX_E3B0_MAX_NUM_COS_PORT1 : |
| 943 | 943 | DCBX_E3B0_MAX_NUM_COS_PORT0; |
| 944 | 944 | |
| 945 | + if (pri >= max_num_of_cos) { | |
| 946 | + DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | |
| 947 | + "parameter Illegal strict priority\n"); | |
| 948 | + return -EINVAL; | |
| 949 | + } | |
| 950 | + | |
| 945 | 951 | if (sp_pri_to_cos[pri] != DCBX_INVALID_COS) { |
| 946 | 952 | DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " |
| 947 | 953 | "parameter There can't be two COS's with " |
| @@ -949,12 +955,6 @@ static int bnx2x_ets_e3b0_sp_pri_to_cos_set(const struct link_params *params, · 1 unmodified line | ||
| 949 | 955 | return -EINVAL; |
| 950 | 956 | } |
| 951 | 957 | |
| 952 | − if (pri > max_num_of_cos) { | |
| 953 | − DP(NETIF_MSG_LINK, "bnx2x_ets_e3b0_sp_pri_to_cos_set invalid " | |
| 954 | − "parameter Illegal strict priority\n"); | |
| 955 | − return -EINVAL; | |
| 956 | − } | |
| 957 | − | |
| 958 | 958 | sp_pri_to_cos[pri] = cos_entry; |
| 959 | 959 | return 0; |
| 960 | 960 | |
| @@ -1310,10 +1310,6 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) · 1309 unmodified lines | ||
| 1310 | 1310 | |
| 1311 | 1311 | if (mac_reg & E1000_PHY_CTRL_D0A_LPLU) |
| 1312 | 1312 | oem_reg |= HV_OEM_BITS_LPLU; |
| 1313 | − | |
| 1314 | − /* Set Restart auto-neg to activate the bits */ | |
| 1315 | − if (!hw->phy.ops.check_reset_block(hw)) | |
| 1316 | − oem_reg |= HV_OEM_BITS_RESTART_AN; | |
| 1317 | 1313 | } else { |
| 1318 | 1314 | if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE | |
| 1319 | 1315 | E1000_PHY_CTRL_NOND0A_GBE_DISABLE)) |
| @@ -1324,6 +1320,11 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) · 4 unmodified lines | ||
| 1324 | 1320 | oem_reg |= HV_OEM_BITS_LPLU; |
| 1325 | 1321 | } |
| 1326 | 1322 | |
| 1323 | + /* Set Restart auto-neg to activate the bits */ | |
| 1324 | + if ((d0_state || (hw->mac.type != e1000_pchlan)) && | |
| 1325 | + !hw->phy.ops.check_reset_block(hw)) | |
| 1326 | + oem_reg |= HV_OEM_BITS_RESTART_AN; | |
| 1327 | + | |
| 1327 | 1328 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); |
| 1328 | 1329 | |
| 1329 | 1330 | release: |
| @@ -3682,7 +3683,11 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) · 2352 unmodified lines | ||
| 3682 | 3683 | |
| 3683 | 3684 | if (hw->mac.type >= e1000_pchlan) { |
| 3684 | 3685 | e1000_oem_bits_config_ich8lan(hw, false); |
| 3685 | − e1000_phy_hw_reset_ich8lan(hw); | |
| 3686 | + | |
| 3687 | + /* Reset PHY to activate OEM bits on 82577/8 */ | |
| 3688 | + if (hw->mac.type == e1000_pchlan) | |
| 3689 | + e1000e_phy_hw_reset_generic(hw); | |
| 3690 | + | |
| 3686 | 3691 | ret_val = hw->phy.ops.acquire(hw); |
| 3687 | 3692 | if (ret_val) |
| 3688 | 3693 | return; |
| @@ -622,6 +622,16 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, int v_idx, · 621 unmodified lines | ||
| 622 | 622 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) |
| 623 | 623 | set_bit(__IXGBE_RX_CSUM_UDP_ZERO_ERR, &ring->state); |
| 624 | 624 | |
| 625 | +#ifdef IXGBE_FCOE | |
| 626 | + if (adapter->netdev->features & NETIF_F_FCOE_MTU) { | |
| 627 | + struct ixgbe_ring_feature *f; | |
| 628 | + f = &adapter->ring_feature[RING_F_FCOE]; | |
| 629 | + if ((rxr_idx >= f->mask) && | |
| 630 | + (rxr_idx < f->mask + f->indices)) | |
| 631 | + set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); | |
| 632 | + } | |
| 633 | + | |
| 634 | +#endif /* IXGBE_FCOE */ | |
| 625 | 635 | /* apply Rx specific ring traits */ |
| 626 | 636 | ring->count = adapter->rx_ring_count; |
| 627 | 637 | ring->queue_index = rxr_idx; |
| @@ -3154,14 +3154,6 @@ static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter) · 3153 unmodified lines | ||
| 3154 | 3154 | set_ring_rsc_enabled(rx_ring); |
| 3155 | 3155 | else |
| 3156 | 3156 | clear_ring_rsc_enabled(rx_ring); |
| 3157 | −#ifdef IXGBE_FCOE | |
| 3158 | − if (netdev->features & NETIF_F_FCOE_MTU) { | |
| 3159 | − struct ixgbe_ring_feature *f; | |
| 3160 | − f = &adapter->ring_feature[RING_F_FCOE]; | |
| 3161 | − if ((i >= f->mask) && (i < f->mask + f->indices)) | |
| 3162 | − set_bit(__IXGBE_RX_FCOE_BUFSZ, &rx_ring->state); | |
| 3163 | − } | |
| 3164 | −#endif /* IXGBE_FCOE */ | |
| 3165 | 3157 | } |
| 3166 | 3158 | } |
| 3167 | 3159 | |
| @@ -4836,7 +4828,9 @@ static int ixgbe_resume(struct pci_dev *pdev) · 1668 unmodified lines | ||
| 4836 | 4828 | |
| 4837 | 4829 | pci_wake_from_d3(pdev, false); |
| 4838 | 4830 | |
| 4831 | + rtnl_lock(); | |
| 4839 | 4832 | err = ixgbe_init_interrupt_scheme(adapter); |
| 4833 | + rtnl_unlock(); | |
| 4840 | 4834 | if (err) { |
| 4841 | 4835 | e_dev_err("Cannot initialize interrupts for device\n"); |
| 4842 | 4836 | return err; |
| @@ -4893,6 +4887,16 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) · 50 unmodified lines | ||
| 4893 | 4887 | if (wufc) { |
| 4894 | 4888 | ixgbe_set_rx_mode(netdev); |
| 4895 | 4889 | |
| 4890 | + /* | |
| 4891 | + * enable the optics for both mult-speed fiber and | |
| 4892 | + * 82599 SFP+ fiber as we can WoL. | |
| 4893 | + */ | |
| 4894 | + if (hw->mac.ops.enable_tx_laser && | |
| 4895 | + (hw->phy.multispeed_fiber || | |
| 4896 | + (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber && | |
| 4897 | + hw->mac.type == ixgbe_mac_82599EB))) | |
| 4898 | + hw->mac.ops.enable_tx_laser(hw); | |
| 4899 | + | |
| 4896 | 4900 | /* turn on all-multi mode if wake on multicast is enabled */ |
| 4897 | 4901 | if (wufc & IXGBE_WUFC_MC) { |
| 4898 | 4902 | fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL); |
| @@ -889,16 +889,17 @@ static int ks8851_net_stop(struct net_device *dev) · 888 unmodified lines | ||
| 889 | 889 | netif_stop_queue(dev); |
| 890 | 890 | |
| 891 | 891 | mutex_lock(&ks->lock); |
| 892 | + /* turn off the IRQs and ack any outstanding */ | |
| 893 | + ks8851_wrreg16(ks, KS_IER, 0x0000); | |
| 894 | + ks8851_wrreg16(ks, KS_ISR, 0xffff); | |
| 895 | + mutex_unlock(&ks->lock); | |
| 892 | 896 | |
| 893 | 897 | /* stop any outstanding work */ |
| 894 | 898 | flush_work(&ks->irq_work); |
| 895 | 899 | flush_work(&ks->tx_work); |
| 896 | 900 | flush_work(&ks->rxctrl_work); |
| 897 | 901 | |
| 898 | − /* turn off the IRQs and ack any outstanding */ | |
| 899 | − ks8851_wrreg16(ks, KS_IER, 0x0000); | |
| 900 | − ks8851_wrreg16(ks, KS_ISR, 0xffff); | |
| 901 | − | |
| 902 | + mutex_lock(&ks->lock); | |
| 902 | 903 | /* shutdown RX process */ |
| 903 | 904 | ks8851_wrreg16(ks, KS_RXCR1, 0x0000); |
| 904 | 905 | |
| @@ -907,6 +908,7 @@ static int ks8851_net_stop(struct net_device *dev) · 2 unmodified lines | ||
| 907 | 908 | |
| 908 | 909 | /* set powermode to soft power down to save power */ |
| 909 | 910 | ks8851_set_powermode(ks, PMECR_PM_SOFTDOWN); |
| 911 | + mutex_unlock(&ks->lock); | |
| 910 | 912 | |
| 911 | 913 | /* ensure any queued tx buffers are dumped */ |
| 912 | 914 | while (!skb_queue_empty(&ks->txq)) { |
| @@ -918,7 +920,6 @@ static int ks8851_net_stop(struct net_device *dev) · 5 unmodified lines | ||
| 918 | 920 | dev_kfree_skb(txb); |
| 919 | 921 | } |
| 920 | 922 | |
| 921 | − mutex_unlock(&ks->lock); | |
| 922 | 923 | return 0; |
| 923 | 924 | } |
| 924 | 925 | |
| @@ -1418,6 +1419,7 @@ static int __devinit ks8851_probe(struct spi_device *spi) · 493 unmodified lines | ||
| 1418 | 1419 | struct net_device *ndev; |
| 1419 | 1420 | struct ks8851_net *ks; |
| 1420 | 1421 | int ret; |
| 1422 | + unsigned cider; | |
| 1421 | 1423 | |
| 1422 | 1424 | ndev = alloc_etherdev(sizeof(struct ks8851_net)); |
| 1423 | 1425 | if (!ndev) |
| @@ -1484,8 +1486,8 @@ static int __devinit ks8851_probe(struct spi_device *spi) · 60 unmodified lines | ||
| 1484 | 1486 | ks8851_soft_reset(ks, GRR_GSR); |
| 1485 | 1487 | |
| 1486 | 1488 | /* simple check for a valid chip being connected to the bus */ |
| 1487 | − | |
| 1488 | − if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) { | |
| 1489 | + cider = ks8851_rdreg16(ks, KS_CIDER); | |
| 1490 | + if ((cider & ~CIDER_REV_MASK) != CIDER_ID) { | |
| 1489 | 1491 | dev_err(&spi->dev, "failed to read device ID\n"); |
| 1490 | 1492 | ret = -ENODEV; |
| 1491 | 1493 | goto err_id; |
| @@ -1516,15 +1518,14 @@ static int __devinit ks8851_probe(struct spi_device *spi) · 24 unmodified lines | ||
| 1516 | 1518 | } |
| 1517 | 1519 | |
| 1518 | 1520 | netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n", |
| 1519 | − CIDER_REV_GET(ks8851_rdreg16(ks, KS_CIDER)), | |
| 1520 | − ndev->dev_addr, ndev->irq, | |
| 1521 | + CIDER_REV_GET(cider), ndev->dev_addr, ndev->irq, | |
| 1521 | 1522 | ks->rc_ccr & CCR_EEPROM ? "has" : "no"); |
| 1522 | 1523 | |
| 1523 | 1524 | return 0; |
| 1524 | 1525 | |
| 1525 | 1526 | |
| 1526 | 1527 | err_netdev: |
| 1527 | − free_irq(ndev->irq, ndev); | |
| 1528 | + free_irq(ndev->irq, ks); | |
| 1528 | 1529 | |
| 1529 | 1530 | err_id: |
| 1530 | 1531 | err_irq: |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | #define DRV_NAME "ks8851_mll" |
| 41 | 41 | |
| 42 | 42 | static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 }; |
| 43 | −#define MAX_RECV_FRAMES 32 | |
| 43 | +#define MAX_RECV_FRAMES 255 | |
| 44 | 44 | #define MAX_BUF_SIZE 2048 |
| 45 | 45 | #define TX_BUF_SIZE 2000 |
| 46 | 46 | #define RX_BUF_SIZE 2000 |
| @@ -5675,7 +5675,7 @@ static int netdev_set_mac_address(struct net_device *dev, void *addr) · 5674 unmodified lines | ||
| 5675 | 5675 | memcpy(hw->override_addr, mac->sa_data, ETH_ALEN); |
| 5676 | 5676 | } |
| 5677 | 5677 | |
| 5678 | − memcpy(dev->dev_addr, mac->sa_data, MAX_ADDR_LEN); | |
| 5678 | + memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN); | |
| 5679 | 5679 | |
| 5680 | 5680 | interrupt = hw_block_intr(hw); |
| 5681 | 5681 | |
| @@ -958,6 +958,11 @@ static inline void cp_start_hw (struct cp_private *cp) · 957 unmodified lines | ||
| 958 | 958 | cpw8(Cmd, RxOn | TxOn); |
| 959 | 959 | } |
| 960 | 960 | |
| 961 | +static void cp_enable_irq(struct cp_private *cp) | |
| 962 | +{ | |
| 963 | + cpw16_f(IntrMask, cp_intr_mask); | |
| 964 | +} | |
| 965 | + | |
| 961 | 966 | static void cp_init_hw (struct cp_private *cp) |
| 962 | 967 | { |
| 963 | 968 | struct net_device *dev = cp->dev; |
| @@ -997,8 +1002,6 @@ static void cp_init_hw (struct cp_private *cp) · 33 unmodified lines | ||
| 997 | 1002 | |
| 998 | 1003 | cpw16(MultiIntr, 0); |
| 999 | 1004 | |
| 1000 | − cpw16_f(IntrMask, cp_intr_mask); | |
| 1001 | − | |
| 1002 | 1005 | cpw8_f(Cfg9346, Cfg9346_Lock); |
| 1003 | 1006 | } |
| 1004 | 1007 | |
| @@ -1130,6 +1133,8 @@ static int cp_open (struct net_device *dev) · 125 unmodified lines | ||
| 1130 | 1133 | if (rc) |
| 1131 | 1134 | goto err_out_hw; |
| 1132 | 1135 | |
| 1136 | + cp_enable_irq(cp); | |
| 1137 | + | |
| 1133 | 1138 | netif_carrier_off(dev); |
| 1134 | 1139 | mii_check_media(&cp->mii_if, netif_msg_link(cp), true); |
| 1135 | 1140 | netif_start_queue(dev); |
| @@ -2031,6 +2036,7 @@ static int cp_resume (struct pci_dev *pdev) · 895 unmodified lines | ||
| 2031 | 2036 | /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ |
| 2032 | 2037 | cp_init_rings_index (cp); |
| 2033 | 2038 | cp_init_hw (cp); |
| 2039 | + cp_enable_irq(cp); | |
| 2034 | 2040 | netif_start_queue (dev); |
| 2035 | 2041 | |
| 2036 | 2042 | spin_lock_irqsave (&cp->lock, flags); |
| @@ -1166,10 +1166,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat) · 1165 unmodified lines | ||
| 1166 | 1166 | |
| 1167 | 1167 | /* Quickly dumps bad packets */ |
| 1168 | 1168 | static void |
| 1169 | −smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes) | |
| 1169 | +smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords) | |
| 1170 | 1170 | { |
| 1171 | − unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2; | |
| 1172 | − | |
| 1173 | 1171 | if (likely(pktwords >= 4)) { |
| 1174 | 1172 | unsigned int timeout = 500; |
| 1175 | 1173 | unsigned int val; |
| @@ -1233,7 +1231,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) · 57 unmodified lines | ||
| 1233 | 1231 | continue; |
| 1234 | 1232 | } |
| 1235 | 1233 | |
| 1236 | − skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN); | |
| 1234 | + skb = netdev_alloc_skb(dev, pktwords << 2); | |
| 1237 | 1235 | if (unlikely(!skb)) { |
| 1238 | 1236 | SMSC_WARN(pdata, rx_err, |
| 1239 | 1237 | "Unable to allocate skb for rx packet"); |
| @@ -1243,14 +1241,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget) · 3 unmodified lines | ||
| 1243 | 1241 | break; |
| 1244 | 1242 | } |
| 1245 | 1243 | |
| 1246 | − skb->data = skb->head; | |
| 1247 | − skb_reset_tail_pointer(skb); | |
| 1244 | + pdata->ops->rx_readfifo(pdata, | |
| 1245 | + (unsigned int *)skb->data, pktwords); | |
| 1248 | 1246 | |
| 1249 | 1247 | /* Align IP on 16B boundary */ |
| 1250 | 1248 | skb_reserve(skb, NET_IP_ALIGN); |
| 1251 | 1249 | skb_put(skb, pktlength - 4); |
| 1252 | − pdata->ops->rx_readfifo(pdata, | |
| 1253 | − (unsigned int *)skb->head, pktwords); | |
| 1254 | 1250 | skb->protocol = eth_type_trans(skb, dev); |
| 1255 | 1251 | skb_checksum_none_assert(skb); |
| 1256 | 1252 | netif_receive_skb(skb); |
| @@ -1565,7 +1561,7 @@ static int smsc911x_open(struct net_device *dev) · 308 unmodified lines | ||
| 1565 | 1561 | smsc911x_reg_write(pdata, FIFO_INT, temp); |
| 1566 | 1562 | |
| 1567 | 1563 | /* set RX Data offset to 2 bytes for alignment */ |
| 1568 | − smsc911x_reg_write(pdata, RX_CFG, (2 << 8)); | |
| 1564 | + smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8)); | |
| 1569 | 1565 | |
| 1570 | 1566 | /* enable NAPI polling before enabling RX interrupts */ |
| 1571 | 1567 | napi_enable(&pdata->napi); |
| @@ -2382,7 +2378,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) · 810 unmodified lines | ||
| 2382 | 2378 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 2383 | 2379 | |
| 2384 | 2380 | pdata = netdev_priv(dev); |
| 2385 | − | |
| 2386 | 2381 | dev->irq = irq_res->start; |
| 2387 | 2382 | irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; |
| 2388 | 2383 | pdata->ioaddr = ioremap_nocache(res->start, res_size); |
| @@ -2446,7 +2441,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) · 57 unmodified lines | ||
| 2446 | 2441 | if (retval) { |
| 2447 | 2442 | SMSC_WARN(pdata, probe, |
| 2448 | 2443 | "Unable to claim requested irq: %d", dev->irq); |
| 2449 | − goto out_free_irq; | |
| 2444 | + goto out_disable_resources; | |
| 2450 | 2445 | } |
| 2451 | 2446 | |
| 2452 | 2447 | retval = register_netdev(dev); |
| @@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data) · 180 unmodified lines | ||
| 181 | 181 | __davinci_mdio_reset(data); |
| 182 | 182 | return -EAGAIN; |
| 183 | 183 | } |
| 184 | + | |
| 185 | + reg = __raw_readl(®s->user[0].access); | |
| 186 | + if ((reg & USERACCESS_GO) == 0) | |
| 187 | + return 0; | |
| 188 | + | |
| 184 | 189 | dev_err(data->dev, "timed out waiting for user access\n"); |
| 185 | 190 | return -ETIMEDOUT; |
| 186 | 191 | } |
| @@ -2,9 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | * Definitions for Xilinx Axi Ethernet device driver. |
| 3 | 3 | * |
| 4 | 4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. |
| 5 | − * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | |
| 6 | − * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | |
| 7 | − * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | |
| 5 | + * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. | |
| 8 | 6 | */ |
| 9 | 7 | |
| 10 | 8 | #ifndef XILINX_AXIENET_H |
| @@ -4,9 +4,9 @@ · 3 unmodified lines | ||
| 4 | 4 | * Copyright (c) 2008 Nissin Systems Co., Ltd., Yoshio Kashiwagi |
| 5 | 5 | * Copyright (c) 2005-2008 DLA Systems, David H. Lynch Jr. <dhlii@dlasys.net> |
| 6 | 6 | * Copyright (c) 2008-2009 Secret Lab Technologies Ltd. |
| 7 | − * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | |
| 8 | − * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | |
| 9 | − * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | |
| 7 | + * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu> | |
| 8 | + * Copyright (c) 2010 - 2011 PetaLogix | |
| 9 | + * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. | |
| 10 | 10 | * |
| 11 | 11 | * This is a driver for the Xilinx Axi Ethernet which is used in the Virtex6 |
| 12 | 12 | * and Spartan6. |
| @@ -2,9 +2,9 @@ · 1 unmodified line | ||
| 2 | 2 | * MDIO bus driver for the Xilinx Axi Ethernet device |
| 3 | 3 | * |
| 4 | 4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. |
| 5 | − * Copyright (c) 2010 Xilinx, Inc. All rights reserved. | |
| 6 | − * Copyright (c) 2012 Daniel Borkmann, <daniel.borkmann@tik.ee.ethz.ch> | |
| 7 | − * Copyright (c) 2012 Ariane Keller, <ariane.keller@tik.ee.ethz.ch> | |
| 5 | + * Copyright (c) 2010 - 2011 Michal Simek <monstr@monstr.eu> | |
| 6 | + * Copyright (c) 2010 - 2011 PetaLogix | |
| 7 | + * Copyright (c) 2010 - 2012 Xilinx, Inc. All rights reserved. | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include <linux/of_address.h> |
| @@ -44,6 +44,7 @@ struct net_device_context { · 43 unmodified lines | ||
| 44 | 44 | /* point back to our device context */ |
| 45 | 45 | struct hv_device *device_ctx; |
| 46 | 46 | struct delayed_work dwork; |
| 47 | + struct work_struct work; | |
| 47 | 48 | }; |
| 48 | 49 | |
| 49 | 50 | |
| @@ -51,30 +52,22 @@ static int ring_size = 128; · 1 unmodified line | ||
| 51 | 52 | module_param(ring_size, int, S_IRUGO); |
| 52 | 53 | MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); |
| 53 | 54 | |
| 54 | −struct set_multicast_work { | |
| 55 | − struct work_struct work; | |
| 56 | − struct net_device *net; | |
| 57 | −}; | |
| 58 | − | |
| 59 | 55 | static void do_set_multicast(struct work_struct *w) |
| 60 | 56 | { |
| 61 | − struct set_multicast_work *swk = | |
| 62 | − container_of(w, struct set_multicast_work, work); | |
| 63 | − struct net_device *net = swk->net; | |
| 64 | − | |
| 65 | − struct net_device_context *ndevctx = netdev_priv(net); | |
| 57 | + struct net_device_context *ndevctx = | |
| 58 | + container_of(w, struct net_device_context, work); | |
| 66 | 59 | struct netvsc_device *nvdev; |
| 67 | 60 | struct rndis_device *rdev; |
| 68 | 61 | |
| 69 | 62 | nvdev = hv_get_drvdata(ndevctx->device_ctx); |
| 70 | − if (nvdev == NULL) | |
| 71 | − goto out; | |
| 63 | + if (nvdev == NULL || nvdev->ndev == NULL) | |
| 64 | + return; | |
| 72 | 65 | |
| 73 | 66 | rdev = nvdev->extension; |
| 74 | 67 | if (rdev == NULL) |
| 75 | − goto out; | |
| 68 | + return; | |
| 76 | 69 | |
| 77 | − if (net->flags & IFF_PROMISC) | |
| 70 | + if (nvdev->ndev->flags & IFF_PROMISC) | |
| 78 | 71 | rndis_filter_set_packet_filter(rdev, |
| 79 | 72 | NDIS_PACKET_TYPE_PROMISCUOUS); |
| 80 | 73 | else |
| @@ -82,21 +75,13 @@ static void do_set_multicast(struct work_struct *w) · 1 unmodified line | ||
| 82 | 75 | NDIS_PACKET_TYPE_BROADCAST | |
| 83 | 76 | NDIS_PACKET_TYPE_ALL_MULTICAST | |
| 84 | 77 | NDIS_PACKET_TYPE_DIRECTED); |
| 85 | − | |
| 86 | −out: | |
| 87 | − kfree(w); | |
| 88 | 78 | } |
| 89 | 79 | |
| 90 | 80 | static void netvsc_set_multicast_list(struct net_device *net) |
| 91 | 81 | { |
| 92 | − struct set_multicast_work *swk = | |
| 93 | − kmalloc(sizeof(struct set_multicast_work), GFP_ATOMIC); | |
| 94 | − if (swk == NULL) | |
| 95 | − return; | |
| 82 | + struct net_device_context *net_device_ctx = netdev_priv(net); | |
| 96 | 83 | |
| 97 | − swk->net = net; | |
| 98 | − INIT_WORK(&swk->work, do_set_multicast); | |
| 99 | − schedule_work(&swk->work); | |
| 84 | + schedule_work(&net_device_ctx->work); | |
| 100 | 85 | } |
| 101 | 86 | |
| 102 | 87 | static int netvsc_open(struct net_device *net) |
| @@ -125,6 +110,8 @@ static int netvsc_close(struct net_device *net) · 22 unmodified lines | ||
| 125 | 110 | |
| 126 | 111 | netif_tx_disable(net); |
| 127 | 112 | |
| 113 | + /* Make sure netvsc_set_multicast_list doesn't re-enable filter! */ | |
| 114 | + cancel_work_sync(&net_device_ctx->work); | |
| 128 | 115 | ret = rndis_filter_close(device_obj); |
| 129 | 116 | if (ret != 0) |
| 130 | 117 | netdev_err(net, "unable to close device (ret %d).\n", ret); |
| @@ -335,6 +322,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) · 204 unmodified lines | ||
| 335 | 322 | |
| 336 | 323 | nvdev->start_remove = true; |
| 337 | 324 | cancel_delayed_work_sync(&ndevctx->dwork); |
| 325 | + cancel_work_sync(&ndevctx->work); | |
| 338 | 326 | netif_tx_disable(ndev); |
| 339 | 327 | rndis_filter_device_remove(hdev); |
| 340 | 328 | |
| @@ -403,6 +391,7 @@ static int netvsc_probe(struct hv_device *dev, · 62 unmodified lines | ||
| 403 | 391 | net_device_ctx->device_ctx = dev; |
| 404 | 392 | hv_set_drvdata(dev, net); |
| 405 | 393 | INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp); |
| 394 | + INIT_WORK(&net_device_ctx->work, do_set_multicast); | |
| 406 | 395 | |
| 407 | 396 | net->netdev_ops = &device_ops; |
| 408 | 397 | |
| @@ -456,6 +445,7 @@ static int netvsc_remove(struct hv_device *dev) · 47 unmodified lines | ||
| 456 | 445 | |
| 457 | 446 | ndev_ctx = netdev_priv(net); |
| 458 | 447 | cancel_delayed_work_sync(&ndev_ctx->dwork); |
| 448 | + cancel_work_sync(&ndev_ctx->work); | |
| 459 | 449 | |
| 460 | 450 | /* Stop outbound asap */ |
| 461 | 451 | netif_tx_disable(net); |
| @@ -40,6 +40,7 @@ MODULE_LICENSE("GPL"); · 39 unmodified lines | ||
| 40 | 40 | #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ |
| 41 | 41 | #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ |
| 42 | 42 | #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ |
| 43 | +#define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */ | |
| 43 | 44 | |
| 44 | 45 | static int ip175c_config_init(struct phy_device *phydev) |
| 45 | 46 | { |
| @@ -185,6 +186,15 @@ static int ip175c_config_aneg(struct phy_device *phydev) · 139 unmodified lines | ||
| 185 | 186 | return 0; |
| 186 | 187 | } |
| 187 | 188 | |
| 189 | +static int ip101a_g_ack_interrupt(struct phy_device *phydev) | |
| 190 | +{ | |
| 191 | + int err = phy_read(phydev, IP101A_G_IRQ_CONF_STATUS); | |
| 192 | + if (err < 0) | |
| 193 | + return err; | |
| 194 | + | |
| 195 | + return 0; | |
| 196 | +} | |
| 197 | + | |
| 188 | 198 | static struct phy_driver ip175c_driver = { |
| 189 | 199 | .phy_id = 0x02430d80, |
| 190 | 200 | .name = "ICPlus IP175C", |
| @@ -204,7 +214,6 @@ static struct phy_driver ip1001_driver = { · 13 unmodified lines | ||
| 204 | 214 | .phy_id_mask = 0x0ffffff0, |
| 205 | 215 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | |
| 206 | 216 | SUPPORTED_Asym_Pause, |
| 207 | − .flags = PHY_HAS_INTERRUPT, | |
| 208 | 217 | .config_init = &ip1001_config_init, |
| 209 | 218 | .config_aneg = &genphy_config_aneg, |
| 210 | 219 | .read_status = &genphy_read_status, |
| @@ -220,6 +229,7 @@ static struct phy_driver ip101a_g_driver = { · 9 unmodified lines | ||
| 220 | 229 | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | |
| 221 | 230 | SUPPORTED_Asym_Pause, |
| 222 | 231 | .flags = PHY_HAS_INTERRUPT, |
| 232 | + .ack_interrupt = ip101a_g_ack_interrupt, | |
| 223 | 233 | .config_init = &ip101a_g_config_init, |
| 224 | 234 | .config_aneg = &genphy_config_aneg, |
| 225 | 235 | .read_status = &genphy_read_status, |
| @@ -235,7 +235,7 @@ struct ppp_net { · 234 unmodified lines | ||
| 235 | 235 | /* Prototypes. */ |
| 236 | 236 | static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, |
| 237 | 237 | struct file *file, unsigned int cmd, unsigned long arg); |
| 238 | −static int ppp_xmit_process(struct ppp *ppp); | |
| 238 | +static void ppp_xmit_process(struct ppp *ppp); | |
| 239 | 239 | static void ppp_send_frame(struct ppp *ppp, struct sk_buff *skb); |
| 240 | 240 | static void ppp_push(struct ppp *ppp); |
| 241 | 241 | static void ppp_channel_push(struct channel *pch); |
| @@ -969,8 +969,7 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) · 727 unmodified lines | ||
| 969 | 969 | put_unaligned_be16(proto, pp); |
| 970 | 970 | |
| 971 | 971 | skb_queue_tail(&ppp->file.xq, skb); |
| 972 | − if (!ppp_xmit_process(ppp)) | |
| 973 | − netif_stop_queue(dev); | |
| 972 | + ppp_xmit_process(ppp); | |
| 974 | 973 | return NETDEV_TX_OK; |
| 975 | 974 | |
| 976 | 975 | outf: |
| @@ -1048,11 +1047,10 @@ static void ppp_setup(struct net_device *dev) · 71 unmodified lines | ||
| 1048 | 1047 | * Called to do any work queued up on the transmit side |
| 1049 | 1048 | * that can now be done. |
| 1050 | 1049 | */ |
| 1051 | −static int | |
| 1050 | +static void | |
| 1052 | 1051 | ppp_xmit_process(struct ppp *ppp) |
| 1053 | 1052 | { |
| 1054 | 1053 | struct sk_buff *skb; |
| 1055 | − int ret = 0; | |
| 1056 | 1054 | |
| 1057 | 1055 | ppp_xmit_lock(ppp); |
| 1058 | 1056 | if (!ppp->closing) { |
| @@ -1062,13 +1060,12 @@ ppp_xmit_process(struct ppp *ppp) · 3 unmodified lines | ||
| 1062 | 1060 | ppp_send_frame(ppp, skb); |
| 1063 | 1061 | /* If there's no work left to do, tell the core net |
| 1064 | 1062 | code that we can accept some more. */ |
| 1065 | − if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) { | |
| 1063 | + if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq)) | |
| 1066 | 1064 | netif_wake_queue(ppp->dev); |
| 1067 | − ret = 1; | |
| 1068 | − } | |
| 1065 | + else | |
| 1066 | + netif_stop_queue(ppp->dev); | |
| 1069 | 1067 | } |
| 1070 | 1068 | ppp_xmit_unlock(ppp); |
| 1071 | − return ret; | |
| 1072 | 1069 | } |
| 1073 | 1070 | |
| 1074 | 1071 | static inline struct sk_buff * |
| @@ -365,6 +365,27 @@ static const struct driver_info qmi_wwan_force_int4 = { · 364 unmodified lines | ||
| 365 | 365 | .data = BIT(4), /* interface whitelist bitmap */ |
| 366 | 366 | }; |
| 367 | 367 | |
| 368 | +/* Sierra Wireless provide equally useless interface descriptors | |
| 369 | + * Devices in QMI mode can be switched between two different | |
| 370 | + * configurations: | |
| 371 | + * a) USB interface #8 is QMI/wwan | |
| 372 | + * b) USB interfaces #8, #19 and #20 are QMI/wwan | |
| 373 | + * | |
| 374 | + * Both configurations provide a number of other interfaces (serial++), | |
| 375 | + * some of which have the same endpoint configuration as we expect, so | |
| 376 | + * a whitelist or blacklist is necessary. | |
| 377 | + * | |
| 378 | + * FIXME: The below whitelist should include BIT(20). It does not | |
| 379 | + * because I cannot get it to work... | |
| 380 | + */ | |
| 381 | +static const struct driver_info qmi_wwan_sierra = { | |
| 382 | + .description = "Sierra Wireless wwan/QMI device", | |
| 383 | + .flags = FLAG_WWAN, | |
| 384 | + .bind = qmi_wwan_bind_gobi, | |
| 385 | + .unbind = qmi_wwan_unbind_shared, | |
| 386 | + .manage_power = qmi_wwan_manage_power, | |
| 387 | + .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ | |
| 388 | +}; | |
| 368 | 389 | |
| 369 | 390 | #define HUAWEI_VENDOR_ID 0x12D1 |
| 370 | 391 | #define QMI_GOBI_DEVICE(vend, prod) \ |
| @@ -445,6 +466,15 @@ static const struct usb_device_id products[] = { · 74 unmodified lines | ||
| 445 | 466 | .bInterfaceProtocol = 0xff, |
| 446 | 467 | .driver_info = (unsigned long)&qmi_wwan_force_int4, |
| 447 | 468 | }, |
| 469 | + { /* Sierra Wireless MC77xx in QMI mode */ | |
| 470 | + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO, | |
| 471 | + .idVendor = 0x1199, | |
| 472 | + .idProduct = 0x68a2, | |
| 473 | + .bInterfaceClass = 0xff, | |
| 474 | + .bInterfaceSubClass = 0xff, | |
| 475 | + .bInterfaceProtocol = 0xff, | |
| 476 | + .driver_info = (unsigned long)&qmi_wwan_sierra, | |
| 477 | + }, | |
| 448 | 478 | {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
| 449 | 479 | {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
| 450 | 480 | {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ |
| @@ -1051,6 +1051,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) · 1050 unmodified lines | ||
| 1051 | 1051 | dev->net->ethtool_ops = &smsc75xx_ethtool_ops; |
| 1052 | 1052 | dev->net->flags |= IFF_MULTICAST; |
| 1053 | 1053 | dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD; |
| 1054 | + dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; | |
| 1054 | 1055 | return 0; |
| 1055 | 1056 | } |
| 1056 | 1057 | |
| @@ -626,16 +626,15 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) · 625 unmodified lines | ||
| 626 | 626 | /* This can happen with OOM and indirect buffers. */ |
| 627 | 627 | if (unlikely(capacity < 0)) { |
| 628 | 628 | if (likely(capacity == -ENOMEM)) { |
| 629 | − if (net_ratelimit()) { | |
| 629 | + if (net_ratelimit()) | |
| 630 | 630 | dev_warn(&dev->dev, |
| 631 | 631 | "TX queue failure: out of memory\n"); |
| 632 | − } else { | |
| 632 | + } else { | |
| 633 | 633 | dev->stats.tx_fifo_errors++; |
| 634 | 634 | if (net_ratelimit()) |
| 635 | 635 | dev_warn(&dev->dev, |
| 636 | 636 | "Unexpected TX queue failure: %d\n", |
| 637 | 637 | capacity); |
| 638 | − } | |
| 639 | 638 | } |
| 640 | 639 | dev->stats.tx_dropped++; |
| 641 | 640 | kfree_skb(skb); |
| @@ -2483,6 +2483,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 2482 unmodified lines | ||
| 2483 | 2483 | pr_err("Control memory remap failed\n"); |
| 2484 | 2484 | pci_release_regions(pdev); |
| 2485 | 2485 | pci_disable_device(pdev); |
| 2486 | + iounmap(card->mem); | |
| 2486 | 2487 | kfree(card); |
| 2487 | 2488 | return -ENODEV; |
| 2488 | 2489 | } |
| @@ -19,6 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <linux/nl80211.h> |
| 20 | 20 | #include <linux/platform_device.h> |
| 21 | 21 | #include <linux/etherdevice.h> |
| 22 | +#include <linux/export.h> | |
| 22 | 23 | #include <ar231x_platform.h> |
| 23 | 24 | #include "ath5k.h" |
| 24 | 25 | #include "debug.h" |
| @@ -119,7 +120,7 @@ static int ath_ahb_probe(struct platform_device *pdev) · 94 unmodified lines | ||
| 119 | 120 | if (res == NULL) { |
| 120 | 121 | dev_err(&pdev->dev, "no IRQ resource found\n"); |
| 121 | 122 | ret = -ENXIO; |
| 122 | − goto err_out; | |
| 123 | + goto err_iounmap; | |
| 123 | 124 | } |
| 124 | 125 | |
| 125 | 126 | irq = res->start; |
| @@ -128,7 +129,7 @@ static int ath_ahb_probe(struct platform_device *pdev) · 2 unmodified lines | ||
| 128 | 129 | if (hw == NULL) { |
| 129 | 130 | dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); |
| 130 | 131 | ret = -ENOMEM; |
| 131 | − goto err_out; | |
| 132 | + goto err_iounmap; | |
| 132 | 133 | } |
| 133 | 134 | |
| 134 | 135 | ah = hw->priv; |
| @@ -185,6 +186,8 @@ static int ath_ahb_probe(struct platform_device *pdev) · 50 unmodified lines | ||
| 185 | 186 | err_free_hw: |
| 186 | 187 | ieee80211_free_hw(hw); |
| 187 | 188 | platform_set_drvdata(pdev, NULL); |
| 189 | + err_iounmap: | |
| 190 | + iounmap(mem); | |
| 188 | 191 | err_out: |
| 189 | 192 | return ret; |
| 190 | 193 | } |
| @@ -1548,6 +1548,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) · 1547 unmodified lines | ||
| 1548 | 1548 | struct ath_hw *ah = sc->sc_ah; |
| 1549 | 1549 | struct ath_common *common = ath9k_hw_common(ah); |
| 1550 | 1550 | struct ieee80211_conf *conf = &hw->conf; |
| 1551 | + bool reset_channel = false; | |
| 1551 | 1552 | |
| 1552 | 1553 | ath9k_ps_wakeup(sc); |
| 1553 | 1554 | mutex_lock(&sc->mutex); |
| @@ -1556,6 +1557,12 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) · 2 unmodified lines | ||
| 1556 | 1557 | sc->ps_idle = !!(conf->flags & IEEE80211_CONF_IDLE); |
| 1557 | 1558 | if (sc->ps_idle) |
| 1558 | 1559 | ath_cancel_work(sc); |
| 1560 | + else | |
| 1561 | + /* | |
| 1562 | + * The chip needs a reset to properly wake up from | |
| 1563 | + * full sleep | |
| 1564 | + */ | |
| 1565 | + reset_channel = ah->chip_fullsleep; | |
| 1559 | 1566 | } |
| 1560 | 1567 | |
| 1561 | 1568 | /* |
| @@ -1584,7 +1591,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) · 22 unmodified lines | ||
| 1584 | 1591 | } |
| 1585 | 1592 | } |
| 1586 | 1593 | |
| 1587 | − if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { | |
| 1594 | + if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) { | |
| 1588 | 1595 | struct ieee80211_channel *curchan = hw->conf.channel; |
| 1589 | 1596 | int pos = curchan->hw_value; |
| 1590 | 1597 | int old_pos = -1; |
| @@ -1820,6 +1820,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, · 1819 unmodified lines | ||
| 1820 | 1820 | struct ath_frame_info *fi = get_frame_info(skb); |
| 1821 | 1821 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
| 1822 | 1822 | struct ath_buf *bf; |
| 1823 | + int fragno; | |
| 1823 | 1824 | u16 seqno; |
| 1824 | 1825 | |
| 1825 | 1826 | bf = ath_tx_get_buffer(sc); |
| @@ -1831,9 +1832,16 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, · 5 unmodified lines | ||
| 1831 | 1832 | ATH_TXBUF_RESET(bf); |
| 1832 | 1833 | |
| 1833 | 1834 | if (tid) { |
| 1835 | + fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; | |
| 1834 | 1836 | seqno = tid->seq_next; |
| 1835 | 1837 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); |
| 1836 | − INCR(tid->seq_next, IEEE80211_SEQ_MAX); | |
| 1838 | + | |
| 1839 | + if (fragno) | |
| 1840 | + hdr->seq_ctrl |= cpu_to_le16(fragno); | |
| 1841 | + | |
| 1842 | + if (!ieee80211_has_morefrags(hdr->frame_control)) | |
| 1843 | + INCR(tid->seq_next, IEEE80211_SEQ_MAX); | |
| 1844 | + | |
| 1837 | 1845 | bf->bf_state.seqno = seqno; |
| 1838 | 1846 | } |
| 1839 | 1847 | |
| @@ -7614,6 +7614,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, · 7613 unmodified lines | ||
| 7614 | 7614 | { |
| 7615 | 7615 | int len_mpdu; |
| 7616 | 7616 | struct ieee80211_rx_status rx_status; |
| 7617 | + struct ieee80211_hdr *hdr; | |
| 7617 | 7618 | |
| 7618 | 7619 | memset(&rx_status, 0, sizeof(rx_status)); |
| 7619 | 7620 | prep_mac80211_status(wlc, rxh, p, &rx_status); |
| @@ -7623,6 +7624,13 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh, · 3 unmodified lines | ||
| 7623 | 7624 | skb_pull(p, D11_PHY_HDR_LEN); |
| 7624 | 7625 | __skb_trim(p, len_mpdu); |
| 7625 | 7626 | |
| 7627 | + /* unmute transmit */ | |
| 7628 | + if (wlc->hw->suspended_fifos) { | |
| 7629 | + hdr = (struct ieee80211_hdr *)p->data; | |
| 7630 | + if (ieee80211_is_beacon(hdr->frame_control)) | |
| 7631 | + brcms_b_mute(wlc->hw, false); | |
| 7632 | + } | |
| 7633 | + | |
| 7626 | 7634 | memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status)); |
| 7627 | 7635 | ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p); |
| 7628 | 7636 | } |
| @@ -103,7 +103,7 @@ static const u32 cipher_suites[] = { · 102 unmodified lines | ||
| 103 | 103 | * Convert NL80211's auth_type to the one from Libertas, see chapter 5.9.1 |
| 104 | 104 | * in the firmware spec |
| 105 | 105 | */ |
| 106 | −static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type) | |
| 106 | +static int lbs_auth_to_authtype(enum nl80211_auth_type auth_type) | |
| 107 | 107 | { |
| 108 | 108 | int ret = -ENOTSUPP; |
| 109 | 109 | |
| @@ -1411,7 +1411,12 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, · 1301 unmodified lines | ||
| 1411 | 1411 | goto done; |
| 1412 | 1412 | } |
| 1413 | 1413 | |
| 1414 | − lbs_set_authtype(priv, sme); | |
| 1414 | + ret = lbs_set_authtype(priv, sme); | |
| 1415 | + if (ret == -ENOTSUPP) { | |
| 1416 | + wiphy_err(wiphy, "unsupported authtype 0x%x\n", sme->auth_type); | |
| 1417 | + goto done; | |
| 1418 | + } | |
| 1419 | + | |
| 1415 | 1420 | lbs_set_radio(priv, preamble, 1); |
| 1416 | 1421 | |
| 1417 | 1422 | /* Do the actual association */ |
| @@ -48,15 +48,15 @@ · 47 unmodified lines | ||
| 48 | 48 | #define PCIE_HOST_INT_STATUS_MASK 0xC3C |
| 49 | 49 | #define PCIE_SCRATCH_2_REG 0xC40 |
| 50 | 50 | #define PCIE_SCRATCH_3_REG 0xC44 |
| 51 | −#define PCIE_SCRATCH_4_REG 0xCC0 | |
| 52 | −#define PCIE_SCRATCH_5_REG 0xCC4 | |
| 53 | −#define PCIE_SCRATCH_6_REG 0xCC8 | |
| 54 | −#define PCIE_SCRATCH_7_REG 0xCCC | |
| 55 | −#define PCIE_SCRATCH_8_REG 0xCD0 | |
| 56 | −#define PCIE_SCRATCH_9_REG 0xCD4 | |
| 57 | −#define PCIE_SCRATCH_10_REG 0xCD8 | |
| 58 | −#define PCIE_SCRATCH_11_REG 0xCDC | |
| 59 | −#define PCIE_SCRATCH_12_REG 0xCE0 | |
| 51 | +#define PCIE_SCRATCH_4_REG 0xCD0 | |
| 52 | +#define PCIE_SCRATCH_5_REG 0xCD4 | |
| 53 | +#define PCIE_SCRATCH_6_REG 0xCD8 | |
| 54 | +#define PCIE_SCRATCH_7_REG 0xCDC | |
| 55 | +#define PCIE_SCRATCH_8_REG 0xCE0 | |
| 56 | +#define PCIE_SCRATCH_9_REG 0xCE4 | |
| 57 | +#define PCIE_SCRATCH_10_REG 0xCE8 | |
| 58 | +#define PCIE_SCRATCH_11_REG 0xCEC | |
| 59 | +#define PCIE_SCRATCH_12_REG 0xCF0 | |
| 60 | 60 | |
| 61 | 61 | #define CPU_INTR_DNLD_RDY BIT(0) |
| 62 | 62 | #define CPU_INTR_DOOR_BELL BIT(1) |
| @@ -42,6 +42,7 @@ obj-$(CONFIG_UNICORE32) += setup-bus.o setup-irq.o · 41 unmodified lines | ||
| 42 | 42 | obj-$(CONFIG_PARISC) += setup-bus.o |
| 43 | 43 | obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o |
| 44 | 44 | obj-$(CONFIG_PPC) += setup-bus.o |
| 45 | +obj-$(CONFIG_FRV) += setup-bus.o | |
| 45 | 46 | obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o |
| 46 | 47 | obj-$(CONFIG_X86_VISWS) += setup-irq.o |
| 47 | 48 | obj-$(CONFIG_MN10300) += setup-bus.o |
| @@ -991,8 +991,8 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset, · 990 unmodified lines | ||
| 991 | 991 | } |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | −static void pci_restore_config_space(struct pci_dev *pdev, int start, int end, | |
| 995 | − int retry) | |
| 994 | +static void pci_restore_config_space_range(struct pci_dev *pdev, | |
| 995 | + int start, int end, int retry) | |
| 996 | 996 | { |
| 997 | 997 | int index; |
| 998 | 998 | |
| @@ -1002,6 +1002,18 @@ static void pci_restore_config_space(struct pci_dev *pdev, int start, int end, · 3 unmodified lines | ||
| 1002 | 1002 | retry); |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | +static void pci_restore_config_space(struct pci_dev *pdev) | |
| 1006 | +{ | |
| 1007 | + if (pdev->hdr_type == PCI_HEADER_TYPE_NORMAL) { | |
| 1008 | + pci_restore_config_space_range(pdev, 10, 15, 0); | |
| 1009 | + /* Restore BARs before the command register. */ | |
| 1010 | + pci_restore_config_space_range(pdev, 4, 9, 10); | |
| 1011 | + pci_restore_config_space_range(pdev, 0, 3, 0); | |
| 1012 | + } else { | |
| 1013 | + pci_restore_config_space_range(pdev, 0, 15, 0); | |
| 1014 | + } | |
| 1015 | +} | |
| 1016 | + | |
| 1005 | 1017 | /** |
| 1006 | 1018 | * pci_restore_state - Restore the saved state of a PCI device |
| 1007 | 1019 | * @dev: - PCI device that we're dealing with |
| @@ -1015,13 +1027,7 @@ void pci_restore_state(struct pci_dev *dev) · 7 unmodified lines | ||
| 1015 | 1027 | pci_restore_pcie_state(dev); |
| 1016 | 1028 | pci_restore_ats_state(dev); |
| 1017 | 1029 | |
| 1018 | − pci_restore_config_space(dev, 10, 15, 0); | |
| 1019 | − /* | |
| 1020 | − * The Base Address register should be programmed before the command | |
| 1021 | − * register(s) | |
| 1022 | − */ | |
| 1023 | − pci_restore_config_space(dev, 4, 9, 10); | |
| 1024 | − pci_restore_config_space(dev, 0, 3, 0); | |
| 1030 | + pci_restore_config_space(dev); | |
| 1025 | 1031 | |
| 1026 | 1032 | pci_restore_pcix_state(dev); |
| 1027 | 1033 | pci_restore_msi_state(dev); |
| @@ -908,10 +908,6 @@ static int pinctrl_groups_show(struct seq_file *s, void *what) · 907 unmodified lines | ||
| 908 | 908 | const struct pinctrl_ops *ops = pctldev->desc->pctlops; |
| 909 | 909 | unsigned selector = 0; |
| 910 | 910 | |
| 911 | − /* No grouping */ | |
| 912 | − if (!ops) | |
| 913 | − return 0; | |
| 914 | − | |
| 915 | 911 | mutex_lock(&pinctrl_mutex); |
| 916 | 912 | |
| 917 | 913 | seq_puts(s, "registered pin groups:\n"); |
| @@ -1225,6 +1221,19 @@ static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) · 307 unmodified lines | ||
| 1225 | 1221 | |
| 1226 | 1222 | #endif |
| 1227 | 1223 | |
| 1224 | +static int pinctrl_check_ops(struct pinctrl_dev *pctldev) | |
| 1225 | +{ | |
| 1226 | + const struct pinctrl_ops *ops = pctldev->desc->pctlops; | |
| 1227 | + | |
| 1228 | + if (!ops || | |
| 1229 | + !ops->list_groups || | |
| 1230 | + !ops->get_group_name || | |
| 1231 | + !ops->get_group_pins) | |
| 1232 | + return -EINVAL; | |
| 1233 | + | |
| 1234 | + return 0; | |
| 1235 | +} | |
| 1236 | + | |
| 1228 | 1237 | /** |
| 1229 | 1238 | * pinctrl_register() - register a pin controller device |
| 1230 | 1239 | * @pctldesc: descriptor for this pin controller |
| @@ -1256,6 +1265,14 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc, · 25 unmodified lines | ||
| 1256 | 1265 | INIT_LIST_HEAD(&pctldev->gpio_ranges); |
| 1257 | 1266 | pctldev->dev = dev; |
| 1258 | 1267 | |
| 1268 | + /* check core ops for sanity */ | |
| 1269 | + ret = pinctrl_check_ops(pctldev); | |
| 1270 | + if (ret) { | |
| 1271 | + pr_err("%s pinctrl ops lacks necessary functions\n", | |
| 1272 | + pctldesc->name); | |
| 1273 | + goto out_err; | |
| 1274 | + } | |
| 1275 | + | |
| 1259 | 1276 | /* If we're implementing pinmuxing, check the ops for sanity */ |
| 1260 | 1277 | if (pctldesc->pmxops) { |
| 1261 | 1278 | ret = pinmux_check_ops(pctldev); |
| @@ -50,7 +50,7 @@ · 49 unmodified lines | ||
| 50 | 50 | */ |
| 51 | 51 | #undef START_IN_KERNEL_MODE |
| 52 | 52 | |
| 53 | −#define DRV_VER "0.5.24" | |
| 53 | +#define DRV_VER "0.5.26" | |
| 54 | 54 | |
| 55 | 55 | /* |
| 56 | 56 | * According to the Atom N270 datasheet, |
| @@ -83,8 +83,8 @@ static int kernelmode; · 26 unmodified lines | ||
| 83 | 83 | #endif |
| 84 | 84 | |
| 85 | 85 | static unsigned int interval = 10; |
| 86 | −static unsigned int fanon = 63000; | |
| 87 | −static unsigned int fanoff = 58000; | |
| 86 | +static unsigned int fanon = 60000; | |
| 87 | +static unsigned int fanoff = 53000; | |
| 88 | 88 | static unsigned int verbose; |
| 89 | 89 | static unsigned int fanstate = ACERHDF_FAN_AUTO; |
| 90 | 90 | static char force_bios[16]; |
| @@ -150,6 +150,8 @@ static const struct bios_settings_t bios_tbl[] = { · 59 unmodified lines | ||
| 150 | 150 | {"Acer", "AOA150", "v0.3308", 0x55, 0x58, {0x20, 0x00} }, |
| 151 | 151 | {"Acer", "AOA150", "v0.3309", 0x55, 0x58, {0x20, 0x00} }, |
| 152 | 152 | {"Acer", "AOA150", "v0.3310", 0x55, 0x58, {0x20, 0x00} }, |
| 153 | + /* LT1005u */ | |
| 154 | + {"Acer", "LT-10Q", "v0.3310", 0x55, 0x58, {0x20, 0x00} }, | |
| 153 | 155 | /* Acer 1410 */ |
| 154 | 156 | {"Acer", "Aspire 1410", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, |
| 155 | 157 | {"Acer", "Aspire 1410", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, |
| @@ -161,6 +163,7 @@ static const struct bios_settings_t bios_tbl[] = { · 5 unmodified lines | ||
| 161 | 163 | {"Acer", "Aspire 1410", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, |
| 162 | 164 | {"Acer", "Aspire 1410", "v1.3308", 0x55, 0x58, {0x9e, 0x00} }, |
| 163 | 165 | {"Acer", "Aspire 1410", "v1.3310", 0x55, 0x58, {0x9e, 0x00} }, |
| 166 | + {"Acer", "Aspire 1410", "v1.3314", 0x55, 0x58, {0x9e, 0x00} }, | |
| 164 | 167 | /* Acer 1810xx */ |
| 165 | 168 | {"Acer", "Aspire 1810TZ", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, |
| 166 | 169 | {"Acer", "Aspire 1810T", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, |
| @@ -183,29 +186,44 @@ static const struct bios_settings_t bios_tbl[] = { · 16 unmodified lines | ||
| 183 | 186 | {"Acer", "Aspire 1810TZ", "v1.3310", 0x55, 0x58, {0x9e, 0x00} }, |
| 184 | 187 | {"Acer", "Aspire 1810T", "v1.3310", 0x55, 0x58, {0x9e, 0x00} }, |
| 185 | 188 | {"Acer", "Aspire 1810TZ", "v1.3314", 0x55, 0x58, {0x9e, 0x00} }, |
| 189 | + {"Acer", "Aspire 1810T", "v1.3314", 0x55, 0x58, {0x9e, 0x00} }, | |
| 186 | 190 | /* Acer 531 */ |
| 191 | + {"Acer", "AO531h", "v0.3104", 0x55, 0x58, {0x20, 0x00} }, | |
| 187 | 192 | {"Acer", "AO531h", "v0.3201", 0x55, 0x58, {0x20, 0x00} }, |
| 193 | + {"Acer", "AO531h", "v0.3304", 0x55, 0x58, {0x20, 0x00} }, | |
| 194 | + /* Acer 751 */ | |
| 195 | + {"Acer", "AO751h", "V0.3212", 0x55, 0x58, {0x21, 0x00} }, | |
| 196 | + /* Acer 1825 */ | |
| 197 | + {"Acer", "Aspire 1825PTZ", "V1.3118", 0x55, 0x58, {0x9e, 0x00} }, | |
| 198 | + {"Acer", "Aspire 1825PTZ", "V1.3127", 0x55, 0x58, {0x9e, 0x00} }, | |
| 199 | + /* Acer TravelMate 7730 */ | |
| 200 | + {"Acer", "TravelMate 7730G", "v0.3509", 0x55, 0x58, {0xaf, 0x00} }, | |
| 188 | 201 | /* Gateway */ |
| 189 | − {"Gateway", "AOA110", "v0.3103", 0x55, 0x58, {0x21, 0x00} }, | |
| 190 | − {"Gateway", "AOA150", "v0.3103", 0x55, 0x58, {0x20, 0x00} }, | |
| 191 | − {"Gateway", "LT31", "v1.3103", 0x55, 0x58, {0x9e, 0x00} }, | |
| 192 | − {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00} }, | |
| 193 | − {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00} }, | |
| 202 | + {"Gateway", "AOA110", "v0.3103", 0x55, 0x58, {0x21, 0x00} }, | |
| 203 | + {"Gateway", "AOA150", "v0.3103", 0x55, 0x58, {0x20, 0x00} }, | |
| 204 | + {"Gateway", "LT31", "v1.3103", 0x55, 0x58, {0x9e, 0x00} }, | |
| 205 | + {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00} }, | |
| 206 | + {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00} }, | |
| 207 | + {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00} }, | |
| 194 | 208 | /* Packard Bell */ |
| 195 | − {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00} }, | |
| 196 | − {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} }, | |
| 197 | − {"Packard Bell", "AOA110", "v0.3105", 0x55, 0x58, {0x21, 0x00} }, | |
| 198 | − {"Packard Bell", "AOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} }, | |
| 199 | − {"Packard Bell", "DOTMU", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, | |
| 200 | − {"Packard Bell", "DOTMU", "v0.3120", 0x55, 0x58, {0x9e, 0x00} }, | |
| 201 | − {"Packard Bell", "DOTMU", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, | |
| 202 | − {"Packard Bell", "DOTMU", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, | |
| 203 | − {"Packard Bell", "DOTMU", "v0.3115", 0x55, 0x58, {0x9e, 0x00} }, | |
| 204 | − {"Packard Bell", "DOTMU", "v0.3117", 0x55, 0x58, {0x9e, 0x00} }, | |
| 205 | − {"Packard Bell", "DOTMU", "v0.3119", 0x55, 0x58, {0x9e, 0x00} }, | |
| 206 | − {"Packard Bell", "DOTMU", "v1.3204", 0x55, 0x58, {0x9e, 0x00} }, | |
| 207 | − {"Packard Bell", "DOTMA", "v1.3201", 0x55, 0x58, {0x9e, 0x00} }, | |
| 208 | − {"Packard Bell", "DOTMA", "v1.3302", 0x55, 0x58, {0x9e, 0x00} }, | |
| 209 | + {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00} }, | |
| 210 | + {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} }, | |
| 211 | + {"Packard Bell", "AOA110", "v0.3105", 0x55, 0x58, {0x21, 0x00} }, | |
| 212 | + {"Packard Bell", "AOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} }, | |
| 213 | + {"Packard Bell", "ENBFT", "V1.3118", 0x55, 0x58, {0x9e, 0x00} }, | |
| 214 | + {"Packard Bell", "ENBFT", "V1.3127", 0x55, 0x58, {0x9e, 0x00} }, | |
| 215 | + {"Packard Bell", "DOTMU", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, | |
| 216 | + {"Packard Bell", "DOTMU", "v0.3120", 0x55, 0x58, {0x9e, 0x00} }, | |
| 217 | + {"Packard Bell", "DOTMU", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, | |
| 218 | + {"Packard Bell", "DOTMU", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, | |
| 219 | + {"Packard Bell", "DOTMU", "v0.3115", 0x55, 0x58, {0x9e, 0x00} }, | |
| 220 | + {"Packard Bell", "DOTMU", "v0.3117", 0x55, 0x58, {0x9e, 0x00} }, | |
| 221 | + {"Packard Bell", "DOTMU", "v0.3119", 0x55, 0x58, {0x9e, 0x00} }, | |
| 222 | + {"Packard Bell", "DOTMU", "v1.3204", 0x55, 0x58, {0x9e, 0x00} }, | |
| 223 | + {"Packard Bell", "DOTMA", "v1.3201", 0x55, 0x58, {0x9e, 0x00} }, | |
| 224 | + {"Packard Bell", "DOTMA", "v1.3302", 0x55, 0x58, {0x9e, 0x00} }, | |
| 225 | + {"Packard Bell", "DOTMA", "v1.3303t", 0x55, 0x58, {0x9e, 0x00} }, | |
| 226 | + {"Packard Bell", "DOTVR46", "v1.3308", 0x55, 0x58, {0x9e, 0x00} }, | |
| 209 | 227 | /* pewpew-terminator */ |
| 210 | 228 | {"", "", "", 0, 0, {0, 0} } |
| 211 | 229 | }; |
| @@ -701,15 +719,20 @@ MODULE_LICENSE("GPL"); · 489 unmodified lines | ||
| 701 | 719 | MODULE_AUTHOR("Peter Feuerer"); |
| 702 | 720 | MODULE_DESCRIPTION("Aspire One temperature and fan driver"); |
| 703 | 721 | MODULE_ALIAS("dmi:*:*Acer*:pnAOA*:"); |
| 722 | +MODULE_ALIAS("dmi:*:*Acer*:pnAO751h*:"); | |
| 704 | 723 | MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1410*:"); |
| 705 | 724 | MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1810*:"); |
| 725 | +MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1825PTZ:"); | |
| 706 | 726 | MODULE_ALIAS("dmi:*:*Acer*:pnAO531*:"); |
| 727 | +MODULE_ALIAS("dmi:*:*Acer*:TravelMate*7730G:"); | |
| 707 | 728 | MODULE_ALIAS("dmi:*:*Gateway*:pnAOA*:"); |
| 708 | 729 | MODULE_ALIAS("dmi:*:*Gateway*:pnLT31*:"); |
| 709 | 730 | MODULE_ALIAS("dmi:*:*Packard*Bell*:pnAOA*:"); |
| 710 | 731 | MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOA*:"); |
| 711 | 732 | MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTMU*:"); |
| 733 | +MODULE_ALIAS("dmi:*:*Packard*Bell*:pnENBFT*:"); | |
| 712 | 734 | MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTMA*:"); |
| 735 | +MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTVR46*:"); | |
| 713 | 736 | |
| 714 | 737 | module_init(acerhdf_init); |
| 715 | 738 | module_exit(acerhdf_exit); |
| @@ -212,6 +212,7 @@ static struct dmi_system_id __devinitdata dell_quirks[] = { · 211 unmodified lines | ||
| 212 | 212 | }, |
| 213 | 213 | .driver_data = &quirk_dell_vostro_v130, |
| 214 | 214 | }, |
| 215 | + { } | |
| 215 | 216 | }; |
| 216 | 217 | |
| 217 | 218 | static struct calling_interface_buffer *buffer; |
| @@ -1565,7 +1565,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) · 1564 unmodified lines | ||
| 1565 | 1565 | ips->poll_turbo_status = true; |
| 1566 | 1566 | |
| 1567 | 1567 | if (!ips_get_i915_syms(ips)) { |
| 1568 | − dev_err(&dev->dev, "failed to get i915 symbols, graphics turbo disabled\n"); | |
| 1568 | + dev_info(&dev->dev, "failed to get i915 symbols, graphics turbo disabled until i915 loads\n"); | |
| 1569 | 1569 | ips->gpu_turbo_enabled = false; |
| 1570 | 1570 | } else { |
| 1571 | 1571 | dev_dbg(&dev->dev, "graphics turbo enabled\n"); |
| @@ -902,6 +902,7 @@ read_rtc: · 901 unmodified lines | ||
| 902 | 902 | } |
| 903 | 903 | ds1307->nvram->attr.name = "nvram"; |
| 904 | 904 | ds1307->nvram->attr.mode = S_IRUGO | S_IWUSR; |
| 905 | + sysfs_bin_attr_init(ds1307->nvram); | |
| 905 | 906 | ds1307->nvram->read = ds1307_nvram_read, |
| 906 | 907 | ds1307->nvram->write = ds1307_nvram_write, |
| 907 | 908 | ds1307->nvram->size = chip->nvram_size; |
| @@ -2844,6 +2844,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 2843 unmodified lines | ||
| 2844 | 2844 | sector_t recid, trkid; |
| 2845 | 2845 | unsigned int offs; |
| 2846 | 2846 | unsigned int count, count_to_trk_end; |
| 2847 | + int ret; | |
| 2847 | 2848 | |
| 2848 | 2849 | basedev = block->base; |
| 2849 | 2850 | if (rq_data_dir(req) == READ) { |
| @@ -2884,8 +2885,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 34 unmodified lines | ||
| 2884 | 2885 | |
| 2885 | 2886 | itcw = itcw_init(cqr->data, itcw_size, itcw_op, 0, ctidaw, 0); |
| 2886 | 2887 | if (IS_ERR(itcw)) { |
| 2887 | − dasd_sfree_request(cqr, startdev); | |
| 2888 | − return ERR_PTR(-EINVAL); | |
| 2888 | + ret = -EINVAL; | |
| 2889 | + goto out_error; | |
| 2889 | 2890 | } |
| 2890 | 2891 | cqr->cpaddr = itcw_get_tcw(itcw); |
| 2891 | 2892 | if (prepare_itcw(itcw, first_trk, last_trk, |
| @@ -2897,8 +2898,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 5 unmodified lines | ||
| 2897 | 2898 | /* Clock not in sync and XRC is enabled. |
| 2898 | 2899 | * Try again later. |
| 2899 | 2900 | */ |
| 2900 | − dasd_sfree_request(cqr, startdev); | |
| 2901 | − return ERR_PTR(-EAGAIN); | |
| 2901 | + ret = -EAGAIN; | |
| 2902 | + goto out_error; | |
| 2902 | 2903 | } |
| 2903 | 2904 | len_to_track_end = 0; |
| 2904 | 2905 | /* |
| @@ -2937,8 +2938,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 32 unmodified lines | ||
| 2937 | 2938 | tidaw_flags = 0; |
| 2938 | 2939 | last_tidaw = itcw_add_tidaw(itcw, tidaw_flags, |
| 2939 | 2940 | dst, part_len); |
| 2940 | − if (IS_ERR(last_tidaw)) | |
| 2941 | − return ERR_PTR(-EINVAL); | |
| 2941 | + if (IS_ERR(last_tidaw)) { | |
| 2942 | + ret = -EINVAL; | |
| 2943 | + goto out_error; | |
| 2944 | + } | |
| 2942 | 2945 | dst += part_len; |
| 2943 | 2946 | } |
| 2944 | 2947 | } |
| @@ -2947,8 +2950,10 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 2 unmodified lines | ||
| 2947 | 2950 | dst = page_address(bv->bv_page) + bv->bv_offset; |
| 2948 | 2951 | last_tidaw = itcw_add_tidaw(itcw, 0x00, |
| 2949 | 2952 | dst, bv->bv_len); |
| 2950 | − if (IS_ERR(last_tidaw)) | |
| 2951 | − return ERR_PTR(-EINVAL); | |
| 2953 | + if (IS_ERR(last_tidaw)) { | |
| 2954 | + ret = -EINVAL; | |
| 2955 | + goto out_error; | |
| 2956 | + } | |
| 2952 | 2957 | } |
| 2953 | 2958 | } |
| 2954 | 2959 | last_tidaw->flags |= TIDAW_FLAGS_LAST; |
| @@ -2968,6 +2973,9 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 13 unmodified lines | ||
| 2968 | 2973 | cqr->buildclk = get_clock(); |
| 2969 | 2974 | cqr->status = DASD_CQR_FILLED; |
| 2970 | 2975 | return cqr; |
| 2976 | +out_error: | |
| 2977 | + dasd_sfree_request(cqr, startdev); | |
| 2978 | + return ERR_PTR(ret); | |
| 2971 | 2979 | } |
| 2972 | 2980 | |
| 2973 | 2981 | static struct dasd_ccw_req *dasd_eckd_build_cp(struct dasd_device *startdev, |
| @@ -903,7 +903,7 @@ static int ur_set_online(struct ccw_device *cdev) · 902 unmodified lines | ||
| 903 | 903 | goto fail_urdev_put; |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | − cdev_init(urd->char_device, &ur_fops); | |
| 906 | + urd->char_device->ops = &ur_fops; | |
| 907 | 907 | urd->char_device->dev = MKDEV(major, minor); |
| 908 | 908 | urd->char_device->owner = ur_fops.owner; |
| 909 | 909 | |
| @@ -4549,8 +4549,12 @@ static int ipr_ata_slave_alloc(struct scsi_device *sdev) · 4548 unmodified lines | ||
| 4549 | 4549 | ENTER; |
| 4550 | 4550 | if (sdev->sdev_target) |
| 4551 | 4551 | sata_port = sdev->sdev_target->hostdata; |
| 4552 | − if (sata_port) | |
| 4552 | + if (sata_port) { | |
| 4553 | 4553 | rc = ata_sas_port_init(sata_port->ap); |
| 4554 | + if (rc == 0) | |
| 4555 | + rc = ata_sas_sync_probe(sata_port->ap); | |
| 4556 | + } | |
| 4557 | + | |
| 4554 | 4558 | if (rc) |
| 4555 | 4559 | ipr_slave_destroy(sdev); |
| 4556 | 4560 | |
| @@ -1742,17 +1742,19 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, · 1741 unmodified lines | ||
| 1742 | 1742 | |
| 1743 | 1743 | mfs = ntohs(flp->fl_csp.sp_bb_data) & |
| 1744 | 1744 | FC_SP_BB_DATA_MASK; |
| 1745 | − if (mfs >= FC_SP_MIN_MAX_PAYLOAD && | |
| 1746 | − mfs <= lport->mfs) { | |
| 1747 | − lport->mfs = mfs; | |
| 1748 | − fc_host_maxframe_size(lport->host) = mfs; | |
| 1749 | − } else { | |
| 1745 | + | |
| 1746 | + if (mfs < FC_SP_MIN_MAX_PAYLOAD || mfs > FC_SP_MAX_MAX_PAYLOAD) { | |
| 1750 | 1747 | FC_LPORT_DBG(lport, "FLOGI bad mfs:%hu response, " |
| 1751 | 1748 | "lport->mfs:%hu\n", mfs, lport->mfs); |
| 1752 | 1749 | fc_lport_error(lport, fp); |
| 1753 | 1750 | goto err; |
| 1754 | 1751 | } |
| 1755 | 1752 | |
| 1753 | + if (mfs <= lport->mfs) { | |
| 1754 | + lport->mfs = mfs; | |
| 1755 | + fc_host_maxframe_size(lport->host) = mfs; | |
| 1756 | + } | |
| 1757 | + | |
| 1756 | 1758 | csp_flags = ntohs(flp->fl_csp.sp_features); |
| 1757 | 1759 | r_a_tov = ntohl(flp->fl_csp.sp_r_a_tov); |
| 1758 | 1760 | e_d_tov = ntohl(flp->fl_csp.sp_e_d_tov); |
| @@ -546,11 +546,12 @@ static struct ata_port_info sata_port_info = { · 545 unmodified lines | ||
| 546 | 546 | .port_ops = &sas_sata_ops |
| 547 | 547 | }; |
| 548 | 548 | |
| 549 | −int sas_ata_init_host_and_port(struct domain_device *found_dev) | |
| 549 | +int sas_ata_init(struct domain_device *found_dev) | |
| 550 | 550 | { |
| 551 | 551 | struct sas_ha_struct *ha = found_dev->port->ha; |
| 552 | 552 | struct Scsi_Host *shost = ha->core.shost; |
| 553 | 553 | struct ata_port *ap; |
| 554 | + int rc; | |
| 554 | 555 | |
| 555 | 556 | ata_host_init(&found_dev->sata_dev.ata_host, |
| 556 | 557 | ha->dev, |
| @@ -567,8 +568,11 @@ int sas_ata_init_host_and_port(struct domain_device *found_dev) · 10 unmodified lines | ||
| 567 | 568 | ap->private_data = found_dev; |
| 568 | 569 | ap->cbl = ATA_CBL_SATA; |
| 569 | 570 | ap->scsi_host = shost; |
| 570 | − /* publish initialized ata port */ | |
| 571 | − smp_wmb(); | |
| 571 | + rc = ata_sas_port_init(ap); | |
| 572 | + if (rc) { | |
| 573 | + ata_sas_port_destroy(ap); | |
| 574 | + return rc; | |
| 575 | + } | |
| 572 | 576 | found_dev->sata_dev.ap = ap; |
| 573 | 577 | |
| 574 | 578 | return 0; |
| @@ -648,18 +652,13 @@ static void sas_get_ata_command_set(struct domain_device *dev) · 73 unmodified lines | ||
| 648 | 652 | void sas_probe_sata(struct asd_sas_port *port) |
| 649 | 653 | { |
| 650 | 654 | struct domain_device *dev, *n; |
| 651 | − int err; | |
| 652 | 655 | |
| 653 | 656 | mutex_lock(&port->ha->disco_mutex); |
| 654 | − list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) { | |
| 657 | + list_for_each_entry(dev, &port->disco_list, disco_list_node) { | |
| 655 | 658 | if (!dev_is_sata(dev)) |
| 656 | 659 | continue; |
| 657 | 660 | |
| 658 | − err = sas_ata_init_host_and_port(dev); | |
| 659 | − if (err) | |
| 660 | − sas_fail_probe(dev, __func__, err); | |
| 661 | − else | |
| 662 | − ata_sas_async_port_init(dev->sata_dev.ap); | |
| 661 | + ata_sas_async_probe(dev->sata_dev.ap); | |
| 663 | 662 | } |
| 664 | 663 | mutex_unlock(&port->ha->disco_mutex); |
| 665 | 664 | |
| @@ -718,18 +717,6 @@ static void async_sas_ata_eh(void *data, async_cookie_t cookie) · 52 unmodified lines | ||
| 718 | 717 | sas_put_device(dev); |
| 719 | 718 | } |
| 720 | 719 | |
| 721 | −static bool sas_ata_dev_eh_valid(struct domain_device *dev) | |
| 722 | −{ | |
| 723 | − struct ata_port *ap; | |
| 724 | − | |
| 725 | − if (!dev_is_sata(dev)) | |
| 726 | − return false; | |
| 727 | − ap = dev->sata_dev.ap; | |
| 728 | − /* consume fully initialized ata ports */ | |
| 729 | − smp_rmb(); | |
| 730 | − return !!ap; | |
| 731 | −} | |
| 732 | − | |
| 733 | 720 | void sas_ata_strategy_handler(struct Scsi_Host *shost) |
| 734 | 721 | { |
| 735 | 722 | struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost); |
| @@ -753,7 +740,7 @@ void sas_ata_strategy_handler(struct Scsi_Host *shost) · 17 unmodified lines | ||
| 753 | 740 | |
| 754 | 741 | spin_lock(&port->dev_list_lock); |
| 755 | 742 | list_for_each_entry(dev, &port->dev_list, dev_list_node) { |
| 756 | − if (!sas_ata_dev_eh_valid(dev)) | |
| 743 | + if (!dev_is_sata(dev)) | |
| 757 | 744 | continue; |
| 758 | 745 | async_schedule_domain(async_sas_ata_eh, dev, &async); |
| 759 | 746 | } |
| @@ -72,6 +72,7 @@ static int sas_get_port_device(struct asd_sas_port *port) · 71 unmodified lines | ||
| 72 | 72 | struct asd_sas_phy *phy; |
| 73 | 73 | struct sas_rphy *rphy; |
| 74 | 74 | struct domain_device *dev; |
| 75 | + int rc = -ENODEV; | |
| 75 | 76 | |
| 76 | 77 | dev = sas_alloc_device(); |
| 77 | 78 | if (!dev) |
| @@ -110,9 +111,16 @@ static int sas_get_port_device(struct asd_sas_port *port) · 32 unmodified lines | ||
| 110 | 111 | |
| 111 | 112 | sas_init_dev(dev); |
| 112 | 113 | |
| 114 | + dev->port = port; | |
| 113 | 115 | switch (dev->dev_type) { |
| 114 | − case SAS_END_DEV: | |
| 115 | 116 | case SATA_DEV: |
| 117 | + rc = sas_ata_init(dev); | |
| 118 | + if (rc) { | |
| 119 | + rphy = NULL; | |
| 120 | + break; | |
| 121 | + } | |
| 122 | + /* fall through */ | |
| 123 | + case SAS_END_DEV: | |
| 116 | 124 | rphy = sas_end_device_alloc(port->port); |
| 117 | 125 | break; |
| 118 | 126 | case EDGE_DEV: |
| @@ -131,19 +139,14 @@ static int sas_get_port_device(struct asd_sas_port *port) · 12 unmodified lines | ||
| 131 | 139 | |
| 132 | 140 | if (!rphy) { |
| 133 | 141 | sas_put_device(dev); |
| 134 | − return -ENODEV; | |
| 142 | + return rc; | |
| 135 | 143 | } |
| 136 | 144 | |
| 137 | − spin_lock_irq(&port->phy_list_lock); | |
| 138 | − list_for_each_entry(phy, &port->phy_list, port_phy_el) | |
| 139 | − sas_phy_set_target(phy, dev); | |
| 140 | − spin_unlock_irq(&port->phy_list_lock); | |
| 141 | 145 | rphy->identify.phy_identifier = phy->phy->identify.phy_identifier; |
| 142 | 146 | memcpy(dev->sas_addr, port->attached_sas_addr, SAS_ADDR_SIZE); |
| 143 | 147 | sas_fill_in_rphy(dev, rphy); |
| 144 | 148 | sas_hash_addr(dev->hashed_sas_addr, dev->sas_addr); |
| 145 | 149 | port->port_dev = dev; |
| 146 | − dev->port = port; | |
| 147 | 150 | dev->linkrate = port->linkrate; |
| 148 | 151 | dev->min_linkrate = port->linkrate; |
| 149 | 152 | dev->max_linkrate = port->linkrate; |
| @@ -155,6 +158,7 @@ static int sas_get_port_device(struct asd_sas_port *port) · 5 unmodified lines | ||
| 155 | 158 | sas_device_set_phy(dev, port->port); |
| 156 | 159 | |
| 157 | 160 | dev->rphy = rphy; |
| 161 | + get_device(&dev->rphy->dev); | |
| 158 | 162 | |
| 159 | 163 | if (dev_is_sata(dev) || dev->dev_type == SAS_END_DEV) |
| 160 | 164 | list_add_tail(&dev->disco_list_node, &port->disco_list); |
| @@ -164,6 +168,11 @@ static int sas_get_port_device(struct asd_sas_port *port) · 3 unmodified lines | ||
| 164 | 168 | spin_unlock_irq(&port->dev_list_lock); |
| 165 | 169 | } |
| 166 | 170 | |
| 171 | + spin_lock_irq(&port->phy_list_lock); | |
| 172 | + list_for_each_entry(phy, &port->phy_list, port_phy_el) | |
| 173 | + sas_phy_set_target(phy, dev); | |
| 174 | + spin_unlock_irq(&port->phy_list_lock); | |
| 175 | + | |
| 167 | 176 | return 0; |
| 168 | 177 | } |
| 169 | 178 | |
| @@ -205,8 +214,7 @@ void sas_notify_lldd_dev_gone(struct domain_device *dev) · 35 unmodified lines | ||
| 205 | 214 | static void sas_probe_devices(struct work_struct *work) |
| 206 | 215 | { |
| 207 | 216 | struct domain_device *dev, *n; |
| 208 | − struct sas_discovery_event *ev = | |
| 209 | − container_of(work, struct sas_discovery_event, work); | |
| 217 | + struct sas_discovery_event *ev = to_sas_discovery_event(work); | |
| 210 | 218 | struct asd_sas_port *port = ev->port; |
| 211 | 219 | |
| 212 | 220 | clear_bit(DISCE_PROBE, &port->disc.pending); |
| @@ -255,6 +263,9 @@ void sas_free_device(struct kref *kref) · 42 unmodified lines | ||
| 255 | 263 | { |
| 256 | 264 | struct domain_device *dev = container_of(kref, typeof(*dev), kref); |
| 257 | 265 | |
| 266 | + put_device(&dev->rphy->dev); | |
| 267 | + dev->rphy = NULL; | |
| 268 | + | |
| 258 | 269 | if (dev->parent) |
| 259 | 270 | sas_put_device(dev->parent); |
| 260 | 271 | |
| @@ -291,8 +302,7 @@ static void sas_unregister_common_dev(struct asd_sas_port *port, struct domain_d · 30 unmodified lines | ||
| 291 | 302 | static void sas_destruct_devices(struct work_struct *work) |
| 292 | 303 | { |
| 293 | 304 | struct domain_device *dev, *n; |
| 294 | − struct sas_discovery_event *ev = | |
| 295 | − container_of(work, struct sas_discovery_event, work); | |
| 305 | + struct sas_discovery_event *ev = to_sas_discovery_event(work); | |
| 296 | 306 | struct asd_sas_port *port = ev->port; |
| 297 | 307 | |
| 298 | 308 | clear_bit(DISCE_DESTRUCT, &port->disc.pending); |
| @@ -302,7 +312,6 @@ static void sas_destruct_devices(struct work_struct *work) · 3 unmodified lines | ||
| 302 | 312 | |
| 303 | 313 | sas_remove_children(&dev->rphy->dev); |
| 304 | 314 | sas_rphy_delete(dev->rphy); |
| 305 | − dev->rphy = NULL; | |
| 306 | 315 | sas_unregister_common_dev(port, dev); |
| 307 | 316 | } |
| 308 | 317 | } |
| @@ -314,11 +323,11 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev) · 5 unmodified lines | ||
| 314 | 323 | /* this rphy never saw sas_rphy_add */ |
| 315 | 324 | list_del_init(&dev->disco_list_node); |
| 316 | 325 | sas_rphy_free(dev->rphy); |
| 317 | − dev->rphy = NULL; | |
| 318 | 326 | sas_unregister_common_dev(port, dev); |
| 327 | + return; | |
| 319 | 328 | } |
| 320 | 329 | |
| 321 | − if (dev->rphy && !test_and_set_bit(SAS_DEV_DESTROY, &dev->state)) { | |
| 330 | + if (!test_and_set_bit(SAS_DEV_DESTROY, &dev->state)) { | |
| 322 | 331 | sas_rphy_unlink(dev->rphy); |
| 323 | 332 | list_move_tail(&dev->disco_list_node, &port->destroy_list); |
| 324 | 333 | sas_discover_event(dev->port, DISCE_DESTRUCT); |
| @@ -377,8 +386,7 @@ static void sas_discover_domain(struct work_struct *work) · 52 unmodified lines | ||
| 377 | 386 | { |
| 378 | 387 | struct domain_device *dev; |
| 379 | 388 | int error = 0; |
| 380 | − struct sas_discovery_event *ev = | |
| 381 | − container_of(work, struct sas_discovery_event, work); | |
| 389 | + struct sas_discovery_event *ev = to_sas_discovery_event(work); | |
| 382 | 390 | struct asd_sas_port *port = ev->port; |
| 383 | 391 | |
| 384 | 392 | clear_bit(DISCE_DISCOVER_DOMAIN, &port->disc.pending); |
| @@ -419,8 +427,6 @@ static void sas_discover_domain(struct work_struct *work) · 34 unmodified lines | ||
| 419 | 427 | |
| 420 | 428 | if (error) { |
| 421 | 429 | sas_rphy_free(dev->rphy); |
| 422 | − dev->rphy = NULL; | |
| 423 | − | |
| 424 | 430 | list_del_init(&dev->disco_list_node); |
| 425 | 431 | spin_lock_irq(&port->dev_list_lock); |
| 426 | 432 | list_del_init(&dev->dev_list_node); |
| @@ -437,8 +443,7 @@ static void sas_discover_domain(struct work_struct *work) · 10 unmodified lines | ||
| 437 | 443 | static void sas_revalidate_domain(struct work_struct *work) |
| 438 | 444 | { |
| 439 | 445 | int res = 0; |
| 440 | − struct sas_discovery_event *ev = | |
| 441 | − container_of(work, struct sas_discovery_event, work); | |
| 446 | + struct sas_discovery_event *ev = to_sas_discovery_event(work); | |
| 442 | 447 | struct asd_sas_port *port = ev->port; |
| 443 | 448 | struct sas_ha_struct *ha = port->ha; |
| 444 | 449 | |
| @@ -466,21 +471,25 @@ static void sas_revalidate_domain(struct work_struct *work) · 21 unmodified lines | ||
| 466 | 471 | |
| 467 | 472 | /* ---------- Events ---------- */ |
| 468 | 473 | |
| 469 | −static void sas_chain_work(struct sas_ha_struct *ha, struct work_struct *work) | |
| 474 | +static void sas_chain_work(struct sas_ha_struct *ha, struct sas_work *sw) | |
| 470 | 475 | { |
| 471 | − /* chained work is not subject to SA_HA_DRAINING or SAS_HA_REGISTERED */ | |
| 472 | − scsi_queue_work(ha->core.shost, work); | |
| 476 | + /* chained work is not subject to SA_HA_DRAINING or | |
| 477 | + * SAS_HA_REGISTERED, because it is either submitted in the | |
| 478 | + * workqueue, or known to be submitted from a context that is | |
| 479 | + * not racing against draining | |
| 480 | + */ | |
| 481 | + scsi_queue_work(ha->core.shost, &sw->work); | |
| 473 | 482 | } |
| 474 | 483 | |
| 475 | 484 | static void sas_chain_event(int event, unsigned long *pending, |
| 476 | − struct work_struct *work, | |
| 485 | + struct sas_work *sw, | |
| 477 | 486 | struct sas_ha_struct *ha) |
| 478 | 487 | { |
| 479 | 488 | if (!test_and_set_bit(event, pending)) { |
| 480 | 489 | unsigned long flags; |
| 481 | 490 | |
| 482 | 491 | spin_lock_irqsave(&ha->state_lock, flags); |
| 483 | − sas_chain_work(ha, work); | |
| 492 | + sas_chain_work(ha, sw); | |
| 484 | 493 | spin_unlock_irqrestore(&ha->state_lock, flags); |
| 485 | 494 | } |
| 486 | 495 | } |
| @@ -519,7 +528,7 @@ void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *port) · 32 unmodified lines | ||
| 519 | 528 | |
| 520 | 529 | disc->pending = 0; |
| 521 | 530 | for (i = 0; i < DISC_NUM_EVENTS; i++) { |
| 522 | − INIT_WORK(&disc->disc_work[i].work, sas_event_fns[i]); | |
| 531 | + INIT_SAS_WORK(&disc->disc_work[i].work, sas_event_fns[i]); | |
| 523 | 532 | disc->disc_work[i].port = port; |
| 524 | 533 | } |
| 525 | 534 | } |
| @@ -27,19 +27,21 @@ · 26 unmodified lines | ||
| 27 | 27 | #include "sas_internal.h" |
| 28 | 28 | #include "sas_dump.h" |
| 29 | 29 | |
| 30 | −void sas_queue_work(struct sas_ha_struct *ha, struct work_struct *work) | |
| 30 | +void sas_queue_work(struct sas_ha_struct *ha, struct sas_work *sw) | |
| 31 | 31 | { |
| 32 | 32 | if (!test_bit(SAS_HA_REGISTERED, &ha->state)) |
| 33 | 33 | return; |
| 34 | 34 | |
| 35 | − if (test_bit(SAS_HA_DRAINING, &ha->state)) | |
| 36 | − list_add(&work->entry, &ha->defer_q); | |
| 37 | − else | |
| 38 | − scsi_queue_work(ha->core.shost, work); | |
| 35 | + if (test_bit(SAS_HA_DRAINING, &ha->state)) { | |
| 36 | + /* add it to the defer list, if not already pending */ | |
| 37 | + if (list_empty(&sw->drain_node)) | |
| 38 | + list_add(&sw->drain_node, &ha->defer_q); | |
| 39 | + } else | |
| 40 | + scsi_queue_work(ha->core.shost, &sw->work); | |
| 39 | 41 | } |
| 40 | 42 | |
| 41 | 43 | static void sas_queue_event(int event, unsigned long *pending, |
| 42 | − struct work_struct *work, | |
| 44 | + struct sas_work *work, | |
| 43 | 45 | struct sas_ha_struct *ha) |
| 44 | 46 | { |
| 45 | 47 | if (!test_and_set_bit(event, pending)) { |
| @@ -55,7 +57,7 @@ static void sas_queue_event(int event, unsigned long *pending, · 9 unmodified lines | ||
| 55 | 57 | void __sas_drain_work(struct sas_ha_struct *ha) |
| 56 | 58 | { |
| 57 | 59 | struct workqueue_struct *wq = ha->core.shost->work_q; |
| 58 | − struct work_struct *w, *_w; | |
| 60 | + struct sas_work *sw, *_sw; | |
| 59 | 61 | |
| 60 | 62 | set_bit(SAS_HA_DRAINING, &ha->state); |
| 61 | 63 | /* flush submitters */ |
| @@ -66,9 +68,9 @@ void __sas_drain_work(struct sas_ha_struct *ha) · 4 unmodified lines | ||
| 66 | 68 | |
| 67 | 69 | spin_lock_irq(&ha->state_lock); |
| 68 | 70 | clear_bit(SAS_HA_DRAINING, &ha->state); |
| 69 | − list_for_each_entry_safe(w, _w, &ha->defer_q, entry) { | |
| 70 | − list_del_init(&w->entry); | |
| 71 | − sas_queue_work(ha, w); | |
| 71 | + list_for_each_entry_safe(sw, _sw, &ha->defer_q, drain_node) { | |
| 72 | + list_del_init(&sw->drain_node); | |
| 73 | + sas_queue_work(ha, sw); | |
| 72 | 74 | } |
| 73 | 75 | spin_unlock_irq(&ha->state_lock); |
| 74 | 76 | } |
| @@ -151,7 +153,7 @@ int sas_init_events(struct sas_ha_struct *sas_ha) · 76 unmodified lines | ||
| 151 | 153 | int i; |
| 152 | 154 | |
| 153 | 155 | for (i = 0; i < HA_NUM_EVENTS; i++) { |
| 154 | − INIT_WORK(&sas_ha->ha_events[i].work, sas_ha_event_fns[i]); | |
| 156 | + INIT_SAS_WORK(&sas_ha->ha_events[i].work, sas_ha_event_fns[i]); | |
| 155 | 157 | sas_ha->ha_events[i].ha = sas_ha; |
| 156 | 158 | } |
| 157 | 159 | |
| @@ -202,6 +202,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 201 unmodified lines | ||
| 202 | 202 | u8 sas_addr[SAS_ADDR_SIZE]; |
| 203 | 203 | struct smp_resp *resp = rsp; |
| 204 | 204 | struct discover_resp *dr = &resp->disc; |
| 205 | + struct sas_ha_struct *ha = dev->port->ha; | |
| 205 | 206 | struct expander_device *ex = &dev->ex_dev; |
| 206 | 207 | struct ex_phy *phy = &ex->ex_phy[phy_id]; |
| 207 | 208 | struct sas_rphy *rphy = dev->rphy; |
| @@ -209,6 +210,8 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 1 unmodified line | ||
| 209 | 210 | char *type; |
| 210 | 211 | |
| 211 | 212 | if (new_phy) { |
| 213 | + if (WARN_ON_ONCE(test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state))) | |
| 214 | + return; | |
| 212 | 215 | phy->phy = sas_phy_alloc(&rphy->dev, phy_id); |
| 213 | 216 | |
| 214 | 217 | /* FIXME: error_handling */ |
| @@ -233,6 +236,8 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 18 unmodified lines | ||
| 233 | 236 | memcpy(sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); |
| 234 | 237 | |
| 235 | 238 | phy->attached_dev_type = to_dev_type(dr); |
| 239 | + if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) | |
| 240 | + goto out; | |
| 236 | 241 | phy->phy_id = phy_id; |
| 237 | 242 | phy->linkrate = dr->linkrate; |
| 238 | 243 | phy->attached_sata_host = dr->attached_sata_host; |
| @@ -240,7 +245,14 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 1 unmodified line | ||
| 240 | 245 | phy->attached_sata_ps = dr->attached_sata_ps; |
| 241 | 246 | phy->attached_iproto = dr->iproto << 1; |
| 242 | 247 | phy->attached_tproto = dr->tproto << 1; |
| 243 | − memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE); | |
| 248 | + /* help some expanders that fail to zero sas_address in the 'no | |
| 249 | + * device' case | |
| 250 | + */ | |
| 251 | + if (phy->attached_dev_type == NO_DEVICE || | |
| 252 | + phy->linkrate < SAS_LINK_RATE_1_5_GBPS) | |
| 253 | + memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); | |
| 254 | + else | |
| 255 | + memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE); | |
| 244 | 256 | phy->attached_phy_id = dr->attached_phy_id; |
| 245 | 257 | phy->phy_change_count = dr->change_count; |
| 246 | 258 | phy->routing_attr = dr->routing_attr; |
| @@ -266,6 +278,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 19 unmodified lines | ||
| 266 | 278 | return; |
| 267 | 279 | } |
| 268 | 280 | |
| 281 | + out: | |
| 269 | 282 | switch (phy->attached_dev_type) { |
| 270 | 283 | case SATA_PENDING: |
| 271 | 284 | type = "stp pending"; |
| @@ -304,7 +317,15 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 32 unmodified lines | ||
| 304 | 317 | else |
| 305 | 318 | return; |
| 306 | 319 | |
| 307 | − SAS_DPRINTK("ex %016llx phy%02d:%c:%X attached: %016llx (%s)\n", | |
| 320 | + /* if the attached device type changed and ata_eh is active, | |
| 321 | + * make sure we run revalidation when eh completes (see: | |
| 322 | + * sas_enable_revalidation) | |
| 323 | + */ | |
| 324 | + if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) | |
| 325 | + set_bit(DISCE_REVALIDATE_DOMAIN, &dev->port->disc.pending); | |
| 326 | + | |
| 327 | + SAS_DPRINTK("%sex %016llx phy%02d:%c:%X attached: %016llx (%s)\n", | |
| 328 | + test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state) ? "ata: " : "", | |
| 308 | 329 | SAS_ADDR(dev->sas_addr), phy->phy_id, |
| 309 | 330 | sas_route_char(dev, phy), phy->linkrate, |
| 310 | 331 | SAS_ADDR(phy->attached_sas_addr), type); |
| @@ -776,13 +797,16 @@ static struct domain_device *sas_ex_discover_end_dev( · 465 unmodified lines | ||
| 776 | 797 | if (res) |
| 777 | 798 | goto out_free; |
| 778 | 799 | |
| 800 | + sas_init_dev(child); | |
| 801 | + res = sas_ata_init(child); | |
| 802 | + if (res) | |
| 803 | + goto out_free; | |
| 779 | 804 | rphy = sas_end_device_alloc(phy->port); |
| 780 | − if (unlikely(!rphy)) | |
| 805 | + if (!rphy) | |
| 781 | 806 | goto out_free; |
| 782 | 807 | |
| 783 | − sas_init_dev(child); | |
| 784 | − | |
| 785 | 808 | child->rphy = rphy; |
| 809 | + get_device(&rphy->dev); | |
| 786 | 810 | |
| 787 | 811 | list_add_tail(&child->disco_list_node, &parent->port->disco_list); |
| 788 | 812 | |
| @@ -806,6 +830,7 @@ static struct domain_device *sas_ex_discover_end_dev( · 17 unmodified lines | ||
| 806 | 830 | sas_init_dev(child); |
| 807 | 831 | |
| 808 | 832 | child->rphy = rphy; |
| 833 | + get_device(&rphy->dev); | |
| 809 | 834 | sas_fill_in_rphy(child, rphy); |
| 810 | 835 | |
| 811 | 836 | list_add_tail(&child->disco_list_node, &parent->port->disco_list); |
| @@ -830,8 +855,6 @@ static struct domain_device *sas_ex_discover_end_dev( · 18 unmodified lines | ||
| 830 | 855 | |
| 831 | 856 | out_list_del: |
| 832 | 857 | sas_rphy_free(child->rphy); |
| 833 | − child->rphy = NULL; | |
| 834 | − | |
| 835 | 858 | list_del(&child->disco_list_node); |
| 836 | 859 | spin_lock_irq(&parent->port->dev_list_lock); |
| 837 | 860 | list_del(&child->dev_list_node); |
| @@ -911,6 +934,7 @@ static struct domain_device *sas_ex_discover_expander( · 73 unmodified lines | ||
| 911 | 934 | } |
| 912 | 935 | port = parent->port; |
| 913 | 936 | child->rphy = rphy; |
| 937 | + get_device(&rphy->dev); | |
| 914 | 938 | edev = rphy_to_expander_device(rphy); |
| 915 | 939 | child->dev_type = phy->attached_dev_type; |
| 916 | 940 | kref_get(&parent->kref); |
| @@ -934,6 +958,7 @@ static struct domain_device *sas_ex_discover_expander( · 17 unmodified lines | ||
| 934 | 958 | |
| 935 | 959 | res = sas_discover_expander(child); |
| 936 | 960 | if (res) { |
| 961 | + sas_rphy_delete(rphy); | |
| 937 | 962 | spin_lock_irq(&parent->port->dev_list_lock); |
| 938 | 963 | list_del(&child->dev_list_node); |
| 939 | 964 | spin_unlock_irq(&parent->port->dev_list_lock); |
| @@ -1718,9 +1743,17 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, · 778 unmodified lines | ||
| 1718 | 1743 | int phy_change_count = 0; |
| 1719 | 1744 | |
| 1720 | 1745 | res = sas_get_phy_change_count(dev, i, &phy_change_count); |
| 1721 | − if (res) | |
| 1722 | − goto out; | |
| 1723 | − else if (phy_change_count != ex->ex_phy[i].phy_change_count) { | |
| 1746 | + switch (res) { | |
| 1747 | + case SMP_RESP_PHY_VACANT: | |
| 1748 | + case SMP_RESP_NO_PHY: | |
| 1749 | + continue; | |
| 1750 | + case SMP_RESP_FUNC_ACC: | |
| 1751 | + break; | |
| 1752 | + default: | |
| 1753 | + return res; | |
| 1754 | + } | |
| 1755 | + | |
| 1756 | + if (phy_change_count != ex->ex_phy[i].phy_change_count) { | |
| 1724 | 1757 | if (update) |
| 1725 | 1758 | ex->ex_phy[i].phy_change_count = |
| 1726 | 1759 | phy_change_count; |
| @@ -1728,8 +1761,7 @@ static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, · 1 unmodified line | ||
| 1728 | 1761 | return 0; |
| 1729 | 1762 | } |
| 1730 | 1763 | } |
| 1731 | −out: | |
| 1732 | − return res; | |
| 1764 | + return 0; | |
| 1733 | 1765 | } |
| 1734 | 1766 | |
| 1735 | 1767 | static int sas_get_ex_change_count(struct domain_device *dev, int *ecc) |
| @@ -94,8 +94,7 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr) · 93 unmodified lines | ||
| 94 | 94 | |
| 95 | 95 | void sas_hae_reset(struct work_struct *work) |
| 96 | 96 | { |
| 97 | − struct sas_ha_event *ev = | |
| 98 | − container_of(work, struct sas_ha_event, work); | |
| 97 | + struct sas_ha_event *ev = to_sas_ha_event(work); | |
| 99 | 98 | struct sas_ha_struct *ha = ev->ha; |
| 100 | 99 | |
| 101 | 100 | clear_bit(HAE_RESET, &ha->pending); |
| @@ -369,14 +368,14 @@ static void sas_phy_release(struct sas_phy *phy) · 267 unmodified lines | ||
| 369 | 368 | |
| 370 | 369 | static void phy_reset_work(struct work_struct *work) |
| 371 | 370 | { |
| 372 | − struct sas_phy_data *d = container_of(work, typeof(*d), reset_work); | |
| 371 | + struct sas_phy_data *d = container_of(work, typeof(*d), reset_work.work); | |
| 373 | 372 | |
| 374 | 373 | d->reset_result = transport_sas_phy_reset(d->phy, d->hard_reset); |
| 375 | 374 | } |
| 376 | 375 | |
| 377 | 376 | static void phy_enable_work(struct work_struct *work) |
| 378 | 377 | { |
| 379 | − struct sas_phy_data *d = container_of(work, typeof(*d), enable_work); | |
| 378 | + struct sas_phy_data *d = container_of(work, typeof(*d), enable_work.work); | |
| 380 | 379 | |
| 381 | 380 | d->enable_result = sas_phy_enable(d->phy, d->enable); |
| 382 | 381 | } |
| @@ -389,8 +388,8 @@ static int sas_phy_setup(struct sas_phy *phy) · 6 unmodified lines | ||
| 389 | 388 | return -ENOMEM; |
| 390 | 389 | |
| 391 | 390 | mutex_init(&d->event_lock); |
| 392 | − INIT_WORK(&d->reset_work, phy_reset_work); | |
| 393 | − INIT_WORK(&d->enable_work, phy_enable_work); | |
| 391 | + INIT_SAS_WORK(&d->reset_work, phy_reset_work); | |
| 392 | + INIT_SAS_WORK(&d->enable_work, phy_enable_work); | |
| 394 | 393 | d->phy = phy; |
| 395 | 394 | phy->hostdata = d; |
| 396 | 395 | |
| @@ -45,10 +45,10 @@ struct sas_phy_data { · 44 unmodified lines | ||
| 45 | 45 | struct mutex event_lock; |
| 46 | 46 | int hard_reset; |
| 47 | 47 | int reset_result; |
| 48 | − struct work_struct reset_work; | |
| 48 | + struct sas_work reset_work; | |
| 49 | 49 | int enable; |
| 50 | 50 | int enable_result; |
| 51 | − struct work_struct enable_work; | |
| 51 | + struct sas_work enable_work; | |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | 54 | void sas_scsi_recover_host(struct Scsi_Host *shost); |
| @@ -80,7 +80,7 @@ void sas_porte_broadcast_rcvd(struct work_struct *work); · 25 unmodified lines | ||
| 80 | 80 | void sas_porte_link_reset_err(struct work_struct *work); |
| 81 | 81 | void sas_porte_timer_event(struct work_struct *work); |
| 82 | 82 | void sas_porte_hard_reset(struct work_struct *work); |
| 83 | −void sas_queue_work(struct sas_ha_struct *ha, struct work_struct *work); | |
| 83 | +void sas_queue_work(struct sas_ha_struct *ha, struct sas_work *sw); | |
| 84 | 84 | |
| 85 | 85 | int sas_notify_lldd_dev_found(struct domain_device *); |
| 86 | 86 | void sas_notify_lldd_dev_gone(struct domain_device *); |
| @@ -32,8 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | static void sas_phye_loss_of_signal(struct work_struct *work) |
| 34 | 34 | { |
| 35 | − struct asd_sas_event *ev = | |
| 36 | − container_of(work, struct asd_sas_event, work); | |
| 35 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 37 | 36 | struct asd_sas_phy *phy = ev->phy; |
| 38 | 37 | |
| 39 | 38 | clear_bit(PHYE_LOSS_OF_SIGNAL, &phy->phy_events_pending); |
| @@ -43,8 +42,7 @@ static void sas_phye_loss_of_signal(struct work_struct *work) · 3 unmodified lines | ||
| 43 | 42 | |
| 44 | 43 | static void sas_phye_oob_done(struct work_struct *work) |
| 45 | 44 | { |
| 46 | − struct asd_sas_event *ev = | |
| 47 | − container_of(work, struct asd_sas_event, work); | |
| 45 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 48 | 46 | struct asd_sas_phy *phy = ev->phy; |
| 49 | 47 | |
| 50 | 48 | clear_bit(PHYE_OOB_DONE, &phy->phy_events_pending); |
| @@ -53,8 +51,7 @@ static void sas_phye_oob_done(struct work_struct *work) · 2 unmodified lines | ||
| 53 | 51 | |
| 54 | 52 | static void sas_phye_oob_error(struct work_struct *work) |
| 55 | 53 | { |
| 56 | − struct asd_sas_event *ev = | |
| 57 | − container_of(work, struct asd_sas_event, work); | |
| 54 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 58 | 55 | struct asd_sas_phy *phy = ev->phy; |
| 59 | 56 | struct sas_ha_struct *sas_ha = phy->ha; |
| 60 | 57 | struct asd_sas_port *port = phy->port; |
| @@ -85,8 +82,7 @@ static void sas_phye_oob_error(struct work_struct *work) · 24 unmodified lines | ||
| 85 | 82 | |
| 86 | 83 | static void sas_phye_spinup_hold(struct work_struct *work) |
| 87 | 84 | { |
| 88 | − struct asd_sas_event *ev = | |
| 89 | − container_of(work, struct asd_sas_event, work); | |
| 85 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 90 | 86 | struct asd_sas_phy *phy = ev->phy; |
| 91 | 87 | struct sas_ha_struct *sas_ha = phy->ha; |
| 92 | 88 | struct sas_internal *i = |
| @@ -127,14 +123,12 @@ int sas_register_phys(struct sas_ha_struct *sas_ha) · 34 unmodified lines | ||
| 127 | 123 | phy->error = 0; |
| 128 | 124 | INIT_LIST_HEAD(&phy->port_phy_el); |
| 129 | 125 | for (k = 0; k < PORT_NUM_EVENTS; k++) { |
| 130 | − INIT_WORK(&phy->port_events[k].work, | |
| 131 | − sas_port_event_fns[k]); | |
| 126 | + INIT_SAS_WORK(&phy->port_events[k].work, sas_port_event_fns[k]); | |
| 132 | 127 | phy->port_events[k].phy = phy; |
| 133 | 128 | } |
| 134 | 129 | |
| 135 | 130 | for (k = 0; k < PHY_NUM_EVENTS; k++) { |
| 136 | − INIT_WORK(&phy->phy_events[k].work, | |
| 137 | − sas_phy_event_fns[k]); | |
| 131 | + INIT_SAS_WORK(&phy->phy_events[k].work, sas_phy_event_fns[k]); | |
| 138 | 132 | phy->phy_events[k].phy = phy; |
| 139 | 133 | } |
| 140 | 134 | |
| @@ -144,8 +138,7 @@ int sas_register_phys(struct sas_ha_struct *sas_ha) · 3 unmodified lines | ||
| 144 | 138 | spin_lock_init(&phy->sas_prim_lock); |
| 145 | 139 | phy->frame_rcvd_size = 0; |
| 146 | 140 | |
| 147 | − phy->phy = sas_phy_alloc(&sas_ha->core.shost->shost_gendev, | |
| 148 | − i); | |
| 141 | + phy->phy = sas_phy_alloc(&sas_ha->core.shost->shost_gendev, i); | |
| 149 | 142 | if (!phy->phy) |
| 150 | 143 | return -ENOMEM; |
| 151 | 144 | |
| @@ -123,7 +123,7 @@ static void sas_form_port(struct asd_sas_phy *phy) · 122 unmodified lines | ||
| 123 | 123 | spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags); |
| 124 | 124 | |
| 125 | 125 | if (!port->port) { |
| 126 | − port->port = sas_port_alloc(phy->phy->dev.parent, phy->id); | |
| 126 | + port->port = sas_port_alloc(phy->phy->dev.parent, port->id); | |
| 127 | 127 | BUG_ON(!port->port); |
| 128 | 128 | sas_port_add(port->port); |
| 129 | 129 | } |
| @@ -208,8 +208,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) · 78 unmodified lines | ||
| 208 | 208 | |
| 209 | 209 | void sas_porte_bytes_dmaed(struct work_struct *work) |
| 210 | 210 | { |
| 211 | − struct asd_sas_event *ev = | |
| 212 | − container_of(work, struct asd_sas_event, work); | |
| 211 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 213 | 212 | struct asd_sas_phy *phy = ev->phy; |
| 214 | 213 | |
| 215 | 214 | clear_bit(PORTE_BYTES_DMAED, &phy->port_events_pending); |
| @@ -219,8 +218,7 @@ void sas_porte_bytes_dmaed(struct work_struct *work) · 3 unmodified lines | ||
| 219 | 218 | |
| 220 | 219 | void sas_porte_broadcast_rcvd(struct work_struct *work) |
| 221 | 220 | { |
| 222 | − struct asd_sas_event *ev = | |
| 223 | − container_of(work, struct asd_sas_event, work); | |
| 221 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 224 | 222 | struct asd_sas_phy *phy = ev->phy; |
| 225 | 223 | unsigned long flags; |
| 226 | 224 | u32 prim; |
| @@ -237,8 +235,7 @@ void sas_porte_broadcast_rcvd(struct work_struct *work) · 10 unmodified lines | ||
| 237 | 235 | |
| 238 | 236 | void sas_porte_link_reset_err(struct work_struct *work) |
| 239 | 237 | { |
| 240 | − struct asd_sas_event *ev = | |
| 241 | − container_of(work, struct asd_sas_event, work); | |
| 238 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 242 | 239 | struct asd_sas_phy *phy = ev->phy; |
| 243 | 240 | |
| 244 | 241 | clear_bit(PORTE_LINK_RESET_ERR, &phy->port_events_pending); |
| @@ -248,8 +245,7 @@ void sas_porte_link_reset_err(struct work_struct *work) · 3 unmodified lines | ||
| 248 | 245 | |
| 249 | 246 | void sas_porte_timer_event(struct work_struct *work) |
| 250 | 247 | { |
| 251 | − struct asd_sas_event *ev = | |
| 252 | − container_of(work, struct asd_sas_event, work); | |
| 248 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 253 | 249 | struct asd_sas_phy *phy = ev->phy; |
| 254 | 250 | |
| 255 | 251 | clear_bit(PORTE_TIMER_EVENT, &phy->port_events_pending); |
| @@ -259,8 +255,7 @@ void sas_porte_timer_event(struct work_struct *work) · 3 unmodified lines | ||
| 259 | 255 | |
| 260 | 256 | void sas_porte_hard_reset(struct work_struct *work) |
| 261 | 257 | { |
| 262 | − struct asd_sas_event *ev = | |
| 263 | − container_of(work, struct asd_sas_event, work); | |
| 258 | + struct asd_sas_event *ev = to_asd_sas_event(work); | |
| 264 | 259 | struct asd_sas_phy *phy = ev->phy; |
| 265 | 260 | |
| 266 | 261 | clear_bit(PORTE_HARD_RESET, &phy->port_events_pending); |
| @@ -1638,7 +1638,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost, · 1637 unmodified lines | ||
| 1638 | 1638 | request_fn_proc *request_fn) |
| 1639 | 1639 | { |
| 1640 | 1640 | struct request_queue *q; |
| 1641 | − struct device *dev = shost->shost_gendev.parent; | |
| 1641 | + struct device *dev = shost->dma_dev; | |
| 1642 | 1642 | |
| 1643 | 1643 | q = blk_init_queue(request_fn, NULL); |
| 1644 | 1644 | if (!q) |
| @@ -74,7 +74,7 @@ config SPI_ATMEL · 73 unmodified lines | ||
| 74 | 74 | This selects a driver for the Atmel SPI Controller, present on |
| 75 | 75 | many AT32 (AVR32) and AT91 (ARM) chips. |
| 76 | 76 | |
| 77 | −config SPI_BFIN | |
| 77 | +config SPI_BFIN5XX | |
| 78 | 78 | tristate "SPI controller driver for ADI Blackfin5xx" |
| 79 | 79 | depends on BLACKFIN |
| 80 | 80 | help |
| @@ -15,7 +15,7 @@ obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o · 14 unmodified lines | ||
| 15 | 15 | obj-$(CONFIG_SPI_ATH79) += spi-ath79.o |
| 16 | 16 | obj-$(CONFIG_SPI_AU1550) += spi-au1550.o |
| 17 | 17 | obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o |
| 18 | −obj-$(CONFIG_SPI_BFIN) += spi-bfin5xx.o | |
| 18 | +obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o | |
| 19 | 19 | obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o |
| 20 | 20 | obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o |
| 21 | 21 | obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * Broadcom BCM63xx SPI controller support |
| 3 | 3 | * |
| 4 | − * Copyright (C) 2009-2011 Florian Fainelli <florian@openwrt.org> | |
| 4 | + * Copyright (C) 2009-2012 Florian Fainelli <florian@openwrt.org> | |
| 5 | 5 | * Copyright (C) 2010 Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com> |
| 6 | 6 | * |
| 7 | 7 | * This program is free software; you can redistribute it and/or |
| @@ -30,6 +30,8 @@ · 22 unmodified lines | ||
| 30 | 30 | #include <linux/spi/spi.h> |
| 31 | 31 | #include <linux/completion.h> |
| 32 | 32 | #include <linux/err.h> |
| 33 | +#include <linux/workqueue.h> | |
| 34 | +#include <linux/pm_runtime.h> | |
| 33 | 35 | |
| 34 | 36 | #include <bcm63xx_dev_spi.h> |
| 35 | 37 | |
| @@ -37,8 +39,6 @@ · 1 unmodified line | ||
| 37 | 39 | #define DRV_VER "0.1.2" |
| 38 | 40 | |
| 39 | 41 | struct bcm63xx_spi { |
| 40 | − spinlock_t lock; | |
| 41 | − int stopping; | |
| 42 | 42 | struct completion done; |
| 43 | 43 | |
| 44 | 44 | void __iomem *regs; |
| @@ -96,17 +96,12 @@ static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = { · 51 unmodified lines | ||
| 96 | 96 | { 391000, SPI_CLK_0_391MHZ } |
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | −static int bcm63xx_spi_setup_transfer(struct spi_device *spi, | |
| 100 | − struct spi_transfer *t) | |
| 99 | +static int bcm63xx_spi_check_transfer(struct spi_device *spi, | |
| 100 | + struct spi_transfer *t) | |
| 101 | 101 | { |
| 102 | − struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); | |
| 103 | 102 | u8 bits_per_word; |
| 104 | − u8 clk_cfg, reg; | |
| 105 | − u32 hz; | |
| 106 | − int i; | |
| 107 | 103 | |
| 108 | 104 | bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; |
| 109 | − hz = (t) ? t->speed_hz : spi->max_speed_hz; | |
| 110 | 105 | if (bits_per_word != 8) { |
| 111 | 106 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", |
| 112 | 107 | __func__, bits_per_word); |
| @@ -119,6 +114,19 @@ static int bcm63xx_spi_setup_transfer(struct spi_device *spi, · 6 unmodified lines | ||
| 119 | 114 | return -EINVAL; |
| 120 | 115 | } |
| 121 | 116 | |
| 117 | + return 0; | |
| 118 | +} | |
| 119 | + | |
| 120 | +static void bcm63xx_spi_setup_transfer(struct spi_device *spi, | |
| 121 | + struct spi_transfer *t) | |
| 122 | +{ | |
| 123 | + struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); | |
| 124 | + u32 hz; | |
| 125 | + u8 clk_cfg, reg; | |
| 126 | + int i; | |
| 127 | + | |
| 128 | + hz = (t) ? t->speed_hz : spi->max_speed_hz; | |
| 129 | + | |
| 122 | 130 | /* Find the closest clock configuration */ |
| 123 | 131 | for (i = 0; i < SPI_CLK_MASK; i++) { |
| 124 | 132 | if (hz <= bcm63xx_spi_freq_table[i][0]) { |
| @@ -139,8 +147,6 @@ static int bcm63xx_spi_setup_transfer(struct spi_device *spi, · 14 unmodified lines | ||
| 139 | 147 | bcm_spi_writeb(bs, reg, SPI_CLK_CFG); |
| 140 | 148 | dev_dbg(&spi->dev, "Setting clock register to %02x (hz %d)\n", |
| 141 | 149 | clk_cfg, hz); |
| 142 | − | |
| 143 | − return 0; | |
| 144 | 150 | } |
| 145 | 151 | |
| 146 | 152 | /* the spi->mode bits understood by this driver: */ |
| @@ -153,9 +159,6 @@ static int bcm63xx_spi_setup(struct spi_device *spi) · 6 unmodified lines | ||
| 153 | 159 | |
| 154 | 160 | bs = spi_master_get_devdata(spi->master); |
| 155 | 161 | |
| 156 | − if (bs->stopping) | |
| 157 | − return -ESHUTDOWN; | |
| 158 | − | |
| 159 | 162 | if (!spi->bits_per_word) |
| 160 | 163 | spi->bits_per_word = 8; |
| 161 | 164 | |
| @@ -165,7 +168,7 @@ static int bcm63xx_spi_setup(struct spi_device *spi) · 3 unmodified lines | ||
| 165 | 168 | return -EINVAL; |
| 166 | 169 | } |
| 167 | 170 | |
| 168 | − ret = bcm63xx_spi_setup_transfer(spi, NULL); | |
| 171 | + ret = bcm63xx_spi_check_transfer(spi, NULL); | |
| 169 | 172 | if (ret < 0) { |
| 170 | 173 | dev_err(&spi->dev, "setup: unsupported mode bits %x\n", |
| 171 | 174 | spi->mode & ~MODEBITS); |
| @@ -190,28 +193,29 @@ static void bcm63xx_spi_fill_tx_fifo(struct bcm63xx_spi *bs) · 18 unmodified lines | ||
| 190 | 193 | bs->remaining_bytes -= size; |
| 191 | 194 | } |
| 192 | 195 | |
| 193 | −static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) | |
| 196 | +static unsigned int bcm63xx_txrx_bufs(struct spi_device *spi, | |
| 197 | + struct spi_transfer *t) | |
| 194 | 198 | { |
| 195 | 199 | struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); |
| 196 | 200 | u16 msg_ctl; |
| 197 | 201 | u16 cmd; |
| 198 | 202 | |
| 203 | + /* Disable the CMD_DONE interrupt */ | |
| 204 | + bcm_spi_writeb(bs, 0, SPI_INT_MASK); | |
| 205 | + | |
| 199 | 206 | dev_dbg(&spi->dev, "txrx: tx %p, rx %p, len %d\n", |
| 200 | 207 | t->tx_buf, t->rx_buf, t->len); |
| 201 | 208 | |
| 202 | 209 | /* Transmitter is inhibited */ |
| 203 | 210 | bs->tx_ptr = t->tx_buf; |
| 204 | 211 | bs->rx_ptr = t->rx_buf; |
| 205 | − init_completion(&bs->done); | |
| 206 | 212 | |
| 207 | 213 | if (t->tx_buf) { |
| 208 | 214 | bs->remaining_bytes = t->len; |
| 209 | 215 | bcm63xx_spi_fill_tx_fifo(bs); |
| 210 | 216 | } |
| 211 | 217 | |
| 212 | − /* Enable the command done interrupt which | |
| 213 | − * we use to determine completion of a command */ | |
| 214 | − bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK); | |
| 218 | + init_completion(&bs->done); | |
| 215 | 219 | |
| 216 | 220 | /* Fill in the Message control register */ |
| 217 | 221 | msg_ctl = (t->len << SPI_BYTE_CNT_SHIFT); |
| @@ -230,33 +234,76 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) · 12 unmodified lines | ||
| 230 | 234 | cmd |= (0 << SPI_CMD_PREPEND_BYTE_CNT_SHIFT); |
| 231 | 235 | cmd |= (spi->chip_select << SPI_CMD_DEVICE_ID_SHIFT); |
| 232 | 236 | bcm_spi_writew(bs, cmd, SPI_CMD); |
| 233 | − wait_for_completion(&bs->done); | |
| 234 | 237 | |
| 235 | − /* Disable the CMD_DONE interrupt */ | |
| 236 | − bcm_spi_writeb(bs, 0, SPI_INT_MASK); | |
| 238 | + /* Enable the CMD_DONE interrupt */ | |
| 239 | + bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK); | |
| 237 | 240 | |
| 238 | 241 | return t->len - bs->remaining_bytes; |
| 239 | 242 | } |
| 240 | 243 | |
| 241 | −static int bcm63xx_transfer(struct spi_device *spi, struct spi_message *m) | |
| 244 | +static int bcm63xx_spi_prepare_transfer(struct spi_master *master) | |
| 242 | 245 | { |
| 243 | − struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); | |
| 244 | − struct spi_transfer *t; | |
| 245 | − int ret = 0; | |
| 246 | + struct bcm63xx_spi *bs = spi_master_get_devdata(master); | |
| 246 | 247 | |
| 247 | − if (unlikely(list_empty(&m->transfers))) | |
| 248 | − return -EINVAL; | |
| 248 | + pm_runtime_get_sync(&bs->pdev->dev); | |
| 249 | 249 | |
| 250 | − if (bs->stopping) | |
| 251 | − return -ESHUTDOWN; | |
| 250 | + return 0; | |
| 251 | +} | |
| 252 | + | |
| 253 | +static int bcm63xx_spi_unprepare_transfer(struct spi_master *master) | |
| 254 | +{ | |
| 255 | + struct bcm63xx_spi *bs = spi_master_get_devdata(master); | |
| 256 | + | |
| 257 | + pm_runtime_put(&bs->pdev->dev); | |
| 258 | + | |
| 259 | + return 0; | |
| 260 | +} | |
| 261 | + | |
| 262 | +static int bcm63xx_spi_transfer_one(struct spi_master *master, | |
| 263 | + struct spi_message *m) | |
| 264 | +{ | |
| 265 | + struct bcm63xx_spi *bs = spi_master_get_devdata(master); | |
| 266 | + struct spi_transfer *t; | |
| 267 | + struct spi_device *spi = m->spi; | |
| 268 | + int status = 0; | |
| 269 | + unsigned int timeout = 0; | |
| 252 | 270 | |
| 253 | 271 | list_for_each_entry(t, &m->transfers, transfer_list) { |
| 254 | − ret += bcm63xx_txrx_bufs(spi, t); | |
| 255 | − } | |
| 272 | + unsigned int len = t->len; | |
| 273 | + u8 rx_tail; | |
| 256 | 274 | |
| 257 | − m->complete(m->context); | |
| 275 | + status = bcm63xx_spi_check_transfer(spi, t); | |
| 276 | + if (status < 0) | |
| 277 | + goto exit; | |
| 258 | 278 | |
| 259 | − return ret; | |
| 279 | + /* configure adapter for a new transfer */ | |
| 280 | + bcm63xx_spi_setup_transfer(spi, t); | |
| 281 | + | |
| 282 | + while (len) { | |
| 283 | + /* send the data */ | |
| 284 | + len -= bcm63xx_txrx_bufs(spi, t); | |
| 285 | + | |
| 286 | + timeout = wait_for_completion_timeout(&bs->done, HZ); | |
| 287 | + if (!timeout) { | |
| 288 | + status = -ETIMEDOUT; | |
| 289 | + goto exit; | |
| 290 | + } | |
| 291 | + | |
| 292 | + /* read out all data */ | |
| 293 | + rx_tail = bcm_spi_readb(bs, SPI_RX_TAIL); | |
| 294 | + | |
| 295 | + /* Read out all the data */ | |
| 296 | + if (rx_tail) | |
| 297 | + memcpy_fromio(bs->rx_ptr, bs->rx_io, rx_tail); | |
| 298 | + } | |
| 299 | + | |
| 300 | + m->actual_length += t->len; | |
| 301 | + } | |
| 302 | +exit: | |
| 303 | + m->status = status; | |
| 304 | + spi_finalize_current_message(master); | |
| 305 | + | |
| 306 | + return 0; | |
| 260 | 307 | } |
| 261 | 308 | |
| 262 | 309 | /* This driver supports single master mode only. Hence |
| @@ -267,39 +314,15 @@ static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id) · 4 unmodified lines | ||
| 267 | 314 | struct spi_master *master = (struct spi_master *)dev_id; |
| 268 | 315 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
| 269 | 316 | u8 intr; |
| 270 | − u16 cmd; | |
| 271 | 317 | |
| 272 | 318 | /* Read interupts and clear them immediately */ |
| 273 | 319 | intr = bcm_spi_readb(bs, SPI_INT_STATUS); |
| 274 | 320 | bcm_spi_writeb(bs, SPI_INTR_CLEAR_ALL, SPI_INT_STATUS); |
| 275 | 321 | bcm_spi_writeb(bs, 0, SPI_INT_MASK); |
| 276 | 322 | |
| 277 | − /* A tansfer completed */ | |
| 278 | − if (intr & SPI_INTR_CMD_DONE) { | |
| 279 | − u8 rx_tail; | |
| 280 | − | |
| 281 | − rx_tail = bcm_spi_readb(bs, SPI_RX_TAIL); | |
| 282 | − | |
| 283 | − /* Read out all the data */ | |
| 284 | − if (rx_tail) | |
| 285 | − memcpy_fromio(bs->rx_ptr, bs->rx_io, rx_tail); | |
| 286 | − | |
| 287 | − /* See if there is more data to send */ | |
| 288 | − if (bs->remaining_bytes > 0) { | |
| 289 | − bcm63xx_spi_fill_tx_fifo(bs); | |
| 290 | − | |
| 291 | − /* Start the transfer */ | |
| 292 | − bcm_spi_writew(bs, SPI_HD_W << SPI_MSG_TYPE_SHIFT, | |
| 293 | − SPI_MSG_CTL); | |
| 294 | − cmd = bcm_spi_readw(bs, SPI_CMD); | |
| 295 | − cmd |= SPI_CMD_START_IMMEDIATE; | |
| 296 | − cmd |= (0 << SPI_CMD_PREPEND_BYTE_CNT_SHIFT); | |
| 297 | − bcm_spi_writeb(bs, SPI_INTR_CMD_DONE, SPI_INT_MASK); | |
| 298 | − bcm_spi_writew(bs, cmd, SPI_CMD); | |
| 299 | − } else { | |
| 300 | − complete(&bs->done); | |
| 301 | − } | |
| 302 | − } | |
| 323 | + /* A transfer completed */ | |
| 324 | + if (intr & SPI_INTR_CMD_DONE) | |
| 325 | + complete(&bs->done); | |
| 303 | 326 | |
| 304 | 327 | return IRQ_HANDLED; |
| 305 | 328 | } |
| @@ -345,7 +368,6 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev) · 39 unmodified lines | ||
| 345 | 368 | } |
| 346 | 369 | |
| 347 | 370 | bs = spi_master_get_devdata(master); |
| 348 | − init_completion(&bs->done); | |
| 349 | 371 | |
| 350 | 372 | platform_set_drvdata(pdev, master); |
| 351 | 373 | bs->pdev = pdev; |
| @@ -379,12 +401,13 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev) · 27 unmodified lines | ||
| 379 | 401 | master->bus_num = pdata->bus_num; |
| 380 | 402 | master->num_chipselect = pdata->num_chipselect; |
| 381 | 403 | master->setup = bcm63xx_spi_setup; |
| 382 | − master->transfer = bcm63xx_transfer; | |
| 404 | + master->prepare_transfer_hardware = bcm63xx_spi_prepare_transfer; | |
| 405 | + master->unprepare_transfer_hardware = bcm63xx_spi_unprepare_transfer; | |
| 406 | + master->transfer_one_message = bcm63xx_spi_transfer_one; | |
| 407 | + master->mode_bits = MODEBITS; | |
| 383 | 408 | bs->speed_hz = pdata->speed_hz; |
| 384 | − bs->stopping = 0; | |
| 385 | 409 | bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA)); |
| 386 | 410 | bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA)); |
| 387 | − spin_lock_init(&bs->lock); | |
| 388 | 411 | |
| 389 | 412 | /* Initialize hardware */ |
| 390 | 413 | clk_enable(bs->clk); |
| @@ -418,18 +441,16 @@ static int __devexit bcm63xx_spi_remove(struct platform_device *pdev) · 27 unmodified lines | ||
| 418 | 441 | struct spi_master *master = platform_get_drvdata(pdev); |
| 419 | 442 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
| 420 | 443 | |
| 444 | + spi_unregister_master(master); | |
| 445 | + | |
| 421 | 446 | /* reset spi block */ |
| 422 | 447 | bcm_spi_writeb(bs, 0, SPI_INT_MASK); |
| 423 | − spin_lock(&bs->lock); | |
| 424 | − bs->stopping = 1; | |
| 425 | 448 | |
| 426 | 449 | /* HW shutdown */ |
| 427 | 450 | clk_disable(bs->clk); |
| 428 | 451 | clk_put(bs->clk); |
| 429 | 452 | |
| 430 | − spin_unlock(&bs->lock); | |
| 431 | 453 | platform_set_drvdata(pdev, 0); |
| 432 | − spi_unregister_master(master); | |
| 433 | 454 | |
| 434 | 455 | return 0; |
| 435 | 456 | } |
| @@ -252,19 +252,15 @@ static void · 251 unmodified lines | ||
| 252 | 252 | bfin_sport_spi_restore_state(struct bfin_sport_spi_master_data *drv_data) |
| 253 | 253 | { |
| 254 | 254 | struct bfin_sport_spi_slave_data *chip = drv_data->cur_chip; |
| 255 | − unsigned int bits = (drv_data->ops == &bfin_sport_transfer_ops_u8 ? 7 : 15); | |
| 256 | 255 | |
| 257 | 256 | bfin_sport_spi_disable(drv_data); |
| 258 | 257 | dev_dbg(drv_data->dev, "restoring spi ctl state\n"); |
| 259 | 258 | |
| 260 | 259 | bfin_write(&drv_data->regs->tcr1, chip->ctl_reg); |
| 261 | − bfin_write(&drv_data->regs->tcr2, bits); | |
| 262 | 260 | bfin_write(&drv_data->regs->tclkdiv, chip->baud); |
| 263 | − bfin_write(&drv_data->regs->tfsdiv, bits); | |
| 264 | 261 | SSYNC(); |
| 265 | 262 | |
| 266 | 263 | bfin_write(&drv_data->regs->rcr1, chip->ctl_reg & ~(ITCLK | ITFS)); |
| 267 | − bfin_write(&drv_data->regs->rcr2, bits); | |
| 268 | 264 | SSYNC(); |
| 269 | 265 | |
| 270 | 266 | bfin_sport_spi_cs_active(chip); |
| @@ -420,11 +416,15 @@ bfin_sport_spi_pump_transfers(unsigned long data) · 149 unmodified lines | ||
| 420 | 416 | drv_data->cs_change = transfer->cs_change; |
| 421 | 417 | |
| 422 | 418 | /* Bits per word setup */ |
| 423 | − bits_per_word = transfer->bits_per_word ? : message->spi->bits_per_word; | |
| 424 | − if (bits_per_word == 8) | |
| 425 | − drv_data->ops = &bfin_sport_transfer_ops_u8; | |
| 426 | − else | |
| 419 | + bits_per_word = transfer->bits_per_word ? : | |
| 420 | + message->spi->bits_per_word ? : 8; | |
| 421 | + if (bits_per_word % 16 == 0) | |
| 427 | 422 | drv_data->ops = &bfin_sport_transfer_ops_u16; |
| 423 | + else | |
| 424 | + drv_data->ops = &bfin_sport_transfer_ops_u8; | |
| 425 | + bfin_write(&drv_data->regs->tcr2, bits_per_word - 1); | |
| 426 | + bfin_write(&drv_data->regs->tfsdiv, bits_per_word - 1); | |
| 427 | + bfin_write(&drv_data->regs->rcr2, bits_per_word - 1); | |
| 428 | 428 | |
| 429 | 429 | drv_data->state = RUNNING_STATE; |
| 430 | 430 | |
| @@ -598,11 +598,12 @@ bfin_sport_spi_setup(struct spi_device *spi) · 167 unmodified lines | ||
| 598 | 598 | } |
| 599 | 599 | chip->cs_chg_udelay = chip_info->cs_chg_udelay; |
| 600 | 600 | chip->idle_tx_val = chip_info->idle_tx_val; |
| 601 | − spi->bits_per_word = chip_info->bits_per_word; | |
| 602 | 601 | } |
| 603 | 602 | } |
| 604 | 603 | |
| 605 | − if (spi->bits_per_word != 8 && spi->bits_per_word != 16) { | |
| 604 | + if (spi->bits_per_word % 8) { | |
| 605 | + dev_err(&spi->dev, "%d bits_per_word is not supported\n", | |
| 606 | + spi->bits_per_word); | |
| 606 | 607 | ret = -EINVAL; |
| 607 | 608 | goto error; |
| 608 | 609 | } |
| @@ -396,7 +396,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 395 unmodified lines | ||
| 396 | 396 | /* last read */ |
| 397 | 397 | if (drv_data->rx) { |
| 398 | 398 | dev_dbg(&drv_data->pdev->dev, "last read\n"); |
| 399 | − if (n_bytes % 2) { | |
| 399 | + if (!(n_bytes % 2)) { | |
| 400 | 400 | u16 *buf = (u16 *)drv_data->rx; |
| 401 | 401 | for (loop = 0; loop < n_bytes / 2; loop++) |
| 402 | 402 | *buf++ = bfin_read(&drv_data->regs->rdbr); |
| @@ -424,7 +424,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 21 unmodified lines | ||
| 424 | 424 | if (drv_data->rx && drv_data->tx) { |
| 425 | 425 | /* duplex */ |
| 426 | 426 | dev_dbg(&drv_data->pdev->dev, "duplex: write_TDBR\n"); |
| 427 | − if (n_bytes % 2) { | |
| 427 | + if (!(n_bytes % 2)) { | |
| 428 | 428 | u16 *buf = (u16 *)drv_data->rx; |
| 429 | 429 | u16 *buf2 = (u16 *)drv_data->tx; |
| 430 | 430 | for (loop = 0; loop < n_bytes / 2; loop++) { |
| @@ -442,7 +442,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 11 unmodified lines | ||
| 442 | 442 | } else if (drv_data->rx) { |
| 443 | 443 | /* read */ |
| 444 | 444 | dev_dbg(&drv_data->pdev->dev, "read: write_TDBR\n"); |
| 445 | − if (n_bytes % 2) { | |
| 445 | + if (!(n_bytes % 2)) { | |
| 446 | 446 | u16 *buf = (u16 *)drv_data->rx; |
| 447 | 447 | for (loop = 0; loop < n_bytes / 2; loop++) { |
| 448 | 448 | *buf++ = bfin_read(&drv_data->regs->rdbr); |
| @@ -458,7 +458,7 @@ static irqreturn_t bfin_spi_pio_irq_handler(int irq, void *dev_id) · 9 unmodified lines | ||
| 458 | 458 | } else if (drv_data->tx) { |
| 459 | 459 | /* write */ |
| 460 | 460 | dev_dbg(&drv_data->pdev->dev, "write: write_TDBR\n"); |
| 461 | − if (n_bytes % 2) { | |
| 461 | + if (!(n_bytes % 2)) { | |
| 462 | 462 | u16 *buf = (u16 *)drv_data->tx; |
| 463 | 463 | for (loop = 0; loop < n_bytes / 2; loop++) { |
| 464 | 464 | bfin_read(&drv_data->regs->rdbr); |
| @@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data) · 122 unmodified lines | ||
| 587 | 587 | if (message->state == DONE_STATE) { |
| 588 | 588 | dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n"); |
| 589 | 589 | message->status = 0; |
| 590 | + bfin_spi_flush(drv_data); | |
| 590 | 591 | bfin_spi_giveback(drv_data); |
| 591 | 592 | return; |
| 592 | 593 | } |
| @@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data) · 277 unmodified lines | ||
| 870 | 871 | message->actual_length += drv_data->len_in_bytes; |
| 871 | 872 | /* Move to next transfer of this msg */ |
| 872 | 873 | message->state = bfin_spi_next_transfer(drv_data); |
| 873 | − if (drv_data->cs_change) | |
| 874 | + if (drv_data->cs_change && message->state != DONE_STATE) { | |
| 875 | + bfin_spi_flush(drv_data); | |
| 874 | 876 | bfin_spi_cs_deactive(drv_data, chip); |
| 877 | + } | |
| 875 | 878 | } |
| 876 | 879 | |
| 877 | 880 | /* Schedule next transfer tasklet */ |
| @@ -1026,7 +1029,6 @@ static int bfin_spi_setup(struct spi_device *spi) · 148 unmodified lines | ||
| 1026 | 1029 | chip->cs_chg_udelay = chip_info->cs_chg_udelay; |
| 1027 | 1030 | chip->idle_tx_val = chip_info->idle_tx_val; |
| 1028 | 1031 | chip->pio_interrupt = chip_info->pio_interrupt; |
| 1029 | − spi->bits_per_word = chip_info->bits_per_word; | |
| 1030 | 1032 | } else { |
| 1031 | 1033 | /* force a default base state */ |
| 1032 | 1034 | chip->ctl_reg &= bfin_ctl_reg; |
| @@ -545,13 +545,12 @@ static void ep93xx_spi_pio_transfer(struct ep93xx_spi *espi) · 544 unmodified lines | ||
| 545 | 545 | * in case of failure. |
| 546 | 546 | */ |
| 547 | 547 | static struct dma_async_tx_descriptor * |
| 548 | −ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) | |
| 548 | +ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_transfer_direction dir) | |
| 549 | 549 | { |
| 550 | 550 | struct spi_transfer *t = espi->current_msg->state; |
| 551 | 551 | struct dma_async_tx_descriptor *txd; |
| 552 | 552 | enum dma_slave_buswidth buswidth; |
| 553 | 553 | struct dma_slave_config conf; |
| 554 | − enum dma_transfer_direction slave_dirn; | |
| 555 | 554 | struct scatterlist *sg; |
| 556 | 555 | struct sg_table *sgt; |
| 557 | 556 | struct dma_chan *chan; |
| @@ -567,14 +566,13 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 9 unmodified lines | ||
| 567 | 566 | memset(&conf, 0, sizeof(conf)); |
| 568 | 567 | conf.direction = dir; |
| 569 | 568 | |
| 570 | − if (dir == DMA_FROM_DEVICE) { | |
| 569 | + if (dir == DMA_DEV_TO_MEM) { | |
| 571 | 570 | chan = espi->dma_rx; |
| 572 | 571 | buf = t->rx_buf; |
| 573 | 572 | sgt = &espi->rx_sgt; |
| 574 | 573 | |
| 575 | 574 | conf.src_addr = espi->sspdr_phys; |
| 576 | 575 | conf.src_addr_width = buswidth; |
| 577 | − slave_dirn = DMA_DEV_TO_MEM; | |
| 578 | 576 | } else { |
| 579 | 577 | chan = espi->dma_tx; |
| 580 | 578 | buf = t->tx_buf; |
| @@ -582,7 +580,6 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 1 unmodified line | ||
| 582 | 580 | |
| 583 | 581 | conf.dst_addr = espi->sspdr_phys; |
| 584 | 582 | conf.dst_addr_width = buswidth; |
| 585 | − slave_dirn = DMA_MEM_TO_DEV; | |
| 586 | 583 | } |
| 587 | 584 | |
| 588 | 585 | ret = dmaengine_slave_config(chan, &conf); |
| @@ -633,8 +630,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 44 unmodified lines | ||
| 633 | 630 | if (!nents) |
| 634 | 631 | return ERR_PTR(-ENOMEM); |
| 635 | 632 | |
| 636 | − txd = dmaengine_prep_slave_sg(chan, sgt->sgl, nents, | |
| 637 | − slave_dirn, DMA_CTRL_ACK); | |
| 633 | + txd = dmaengine_prep_slave_sg(chan, sgt->sgl, nents, dir, DMA_CTRL_ACK); | |
| 638 | 634 | if (!txd) { |
| 639 | 635 | dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); |
| 640 | 636 | return ERR_PTR(-ENOMEM); |
| @@ -651,12 +647,12 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_data_direction dir) · 10 unmodified lines | ||
| 651 | 647 | * unmapped. |
| 652 | 648 | */ |
| 653 | 649 | static void ep93xx_spi_dma_finish(struct ep93xx_spi *espi, |
| 654 | − enum dma_data_direction dir) | |
| 650 | + enum dma_transfer_direction dir) | |
| 655 | 651 | { |
| 656 | 652 | struct dma_chan *chan; |
| 657 | 653 | struct sg_table *sgt; |
| 658 | 654 | |
| 659 | − if (dir == DMA_FROM_DEVICE) { | |
| 655 | + if (dir == DMA_DEV_TO_MEM) { | |
| 660 | 656 | chan = espi->dma_rx; |
| 661 | 657 | sgt = &espi->rx_sgt; |
| 662 | 658 | } else { |
| @@ -677,16 +673,16 @@ static void ep93xx_spi_dma_transfer(struct ep93xx_spi *espi) · 14 unmodified lines | ||
| 677 | 673 | struct spi_message *msg = espi->current_msg; |
| 678 | 674 | struct dma_async_tx_descriptor *rxd, *txd; |
| 679 | 675 | |
| 680 | − rxd = ep93xx_spi_dma_prepare(espi, DMA_FROM_DEVICE); | |
| 676 | + rxd = ep93xx_spi_dma_prepare(espi, DMA_DEV_TO_MEM); | |
| 681 | 677 | if (IS_ERR(rxd)) { |
| 682 | 678 | dev_err(&espi->pdev->dev, "DMA RX failed: %ld\n", PTR_ERR(rxd)); |
| 683 | 679 | msg->status = PTR_ERR(rxd); |
| 684 | 680 | return; |
| 685 | 681 | } |
| 686 | 682 | |
| 687 | − txd = ep93xx_spi_dma_prepare(espi, DMA_TO_DEVICE); | |
| 683 | + txd = ep93xx_spi_dma_prepare(espi, DMA_MEM_TO_DEV); | |
| 688 | 684 | if (IS_ERR(txd)) { |
| 689 | − ep93xx_spi_dma_finish(espi, DMA_FROM_DEVICE); | |
| 685 | + ep93xx_spi_dma_finish(espi, DMA_DEV_TO_MEM); | |
| 690 | 686 | dev_err(&espi->pdev->dev, "DMA TX failed: %ld\n", PTR_ERR(rxd)); |
| 691 | 687 | msg->status = PTR_ERR(txd); |
| 692 | 688 | return; |
| @@ -705,8 +701,8 @@ static void ep93xx_spi_dma_transfer(struct ep93xx_spi *espi) · 12 unmodified lines | ||
| 705 | 701 | |
| 706 | 702 | wait_for_completion(&espi->wait); |
| 707 | 703 | |
| 708 | − ep93xx_spi_dma_finish(espi, DMA_TO_DEVICE); | |
| 709 | − ep93xx_spi_dma_finish(espi, DMA_FROM_DEVICE); | |
| 704 | + ep93xx_spi_dma_finish(espi, DMA_MEM_TO_DEV); | |
| 705 | + ep93xx_spi_dma_finish(espi, DMA_DEV_TO_MEM); | |
| 710 | 706 | } |
| 711 | 707 | |
| 712 | 708 | /** |
| @@ -1667,9 +1667,15 @@ static int calculate_effective_freq(struct pl022 *pl022, int freq, struct · 1666 unmodified lines | ||
| 1667 | 1667 | /* cpsdvsr = 254 & scr = 255 */ |
| 1668 | 1668 | min_tclk = spi_rate(rate, CPSDVR_MAX, SCR_MAX); |
| 1669 | 1669 | |
| 1670 | − if (!((freq <= max_tclk) && (freq >= min_tclk))) { | |
| 1670 | + if (freq > max_tclk) | |
| 1671 | + dev_warn(&pl022->adev->dev, | |
| 1672 | + "Max speed that can be programmed is %d Hz, you requested %d\n", | |
| 1673 | + max_tclk, freq); | |
| 1674 | + | |
| 1675 | + if (freq < min_tclk) { | |
| 1671 | 1676 | dev_err(&pl022->adev->dev, |
| 1672 | − "controller data is incorrect: out of range frequency"); | |
| 1677 | + "Requested frequency: %d Hz is less than minimum possible %d Hz\n", | |
| 1678 | + freq, min_tclk); | |
| 1673 | 1679 | return -EINVAL; |
| 1674 | 1680 | } |
| 1675 | 1681 | |
| @@ -1681,26 +1687,37 @@ static int calculate_effective_freq(struct pl022 *pl022, int freq, struct · 5 unmodified lines | ||
| 1681 | 1687 | while (scr <= SCR_MAX) { |
| 1682 | 1688 | tmp = spi_rate(rate, cpsdvsr, scr); |
| 1683 | 1689 | |
| 1684 | − if (tmp > freq) | |
| 1690 | + if (tmp > freq) { | |
| 1691 | + /* we need lower freq */ | |
| 1685 | 1692 | scr++; |
| 1693 | + continue; | |
| 1694 | + } | |
| 1695 | + | |
| 1686 | 1696 | /* |
| 1687 | − * If found exact value, update and break. | |
| 1688 | − * If found more closer value, update and continue. | |
| 1697 | + * If found exact value, mark found and break. | |
| 1698 | + * If found more closer value, update and break. | |
| 1689 | 1699 | */ |
| 1690 | − else if ((tmp == freq) || (tmp > best_freq)) { | |
| 1700 | + if (tmp > best_freq) { | |
| 1691 | 1701 | best_freq = tmp; |
| 1692 | 1702 | best_cpsdvsr = cpsdvsr; |
| 1693 | 1703 | best_scr = scr; |
| 1694 | 1704 | |
| 1695 | 1705 | if (tmp == freq) |
| 1696 | − break; | |
| 1706 | + found = 1; | |
| 1697 | 1707 | } |
| 1698 | − scr++; | |
| 1708 | + /* | |
| 1709 | + * increased scr will give lower rates, which are not | |
| 1710 | + * required | |
| 1711 | + */ | |
| 1712 | + break; | |
| 1699 | 1713 | } |
| 1700 | 1714 | cpsdvsr += 2; |
| 1701 | 1715 | scr = SCR_MIN; |
| 1702 | 1716 | } |
| 1703 | 1717 | |
| 1718 | + WARN(!best_freq, "pl022: Matching cpsdvsr and scr not found for %d Hz rate \n", | |
| 1719 | + freq); | |
| 1720 | + | |
| 1704 | 1721 | clk_freq->cpsdvsr = (u8) (best_cpsdvsr & 0xFF); |
| 1705 | 1722 | clk_freq->scr = (u8) (best_scr & 0xFF); |
| 1706 | 1723 | dev_dbg(&pl022->adev->dev, |
| @@ -1823,9 +1840,12 @@ static int pl022_setup(struct spi_device *spi) · 116 unmodified lines | ||
| 1823 | 1840 | } else |
| 1824 | 1841 | chip->cs_control = chip_info->cs_control; |
| 1825 | 1842 | |
| 1826 | − if (bits <= 3) { | |
| 1827 | − /* PL022 doesn't support less than 4-bits */ | |
| 1843 | + /* Check bits per word with vendor specific range */ | |
| 1844 | + if ((bits <= 3) || (bits > pl022->vendor->max_bpw)) { | |
| 1828 | 1845 | status = -ENOTSUPP; |
| 1846 | + dev_err(&spi->dev, "illegal data size for this controller!\n"); | |
| 1847 | + dev_err(&spi->dev, "This controller can only handle 4 <= n <= %d bit words\n", | |
| 1848 | + pl022->vendor->max_bpw); | |
| 1829 | 1849 | goto err_config_params; |
| 1830 | 1850 | } else if (bits <= 8) { |
| 1831 | 1851 | dev_dbg(&spi->dev, "4 <= n <=8 bits per word\n"); |
| @@ -1838,20 +1858,10 @@ static int pl022_setup(struct spi_device *spi) · 6 unmodified lines | ||
| 1838 | 1858 | chip->read = READING_U16; |
| 1839 | 1859 | chip->write = WRITING_U16; |
| 1840 | 1860 | } else { |
| 1841 | − if (pl022->vendor->max_bpw >= 32) { | |
| 1842 | − dev_dbg(&spi->dev, "17 <= n <= 32 bits per word\n"); | |
| 1843 | − chip->n_bytes = 4; | |
| 1844 | − chip->read = READING_U32; | |
| 1845 | − chip->write = WRITING_U32; | |
| 1846 | − } else { | |
| 1847 | − dev_err(&spi->dev, | |
| 1848 | − "illegal data size for this controller!\n"); | |
| 1849 | − dev_err(&spi->dev, | |
| 1850 | − "a standard pl022 can only handle " | |
| 1851 | − "1 <= n <= 16 bit words\n"); | |
| 1852 | − status = -ENOTSUPP; | |
| 1853 | − goto err_config_params; | |
| 1854 | − } | |
| 1861 | + dev_dbg(&spi->dev, "17 <= n <= 32 bits per word\n"); | |
| 1862 | + chip->n_bytes = 4; | |
| 1863 | + chip->read = READING_U32; | |
| 1864 | + chip->write = WRITING_U32; | |
| 1855 | 1865 | } |
| 1856 | 1866 | |
| 1857 | 1867 | /* Now Initialize all register settings required for this chip */ |
| @@ -36,6 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | #include <linux/prefetch.h> |
| 37 | 37 | #include <linux/ratelimit.h> |
| 38 | 38 | #include <linux/smp.h> |
| 39 | +#include <linux/interrupt.h> | |
| 39 | 40 | #include <net/dst.h> |
| 40 | 41 | #ifdef CONFIG_XFRM |
| 41 | 42 | #include <linux/xfrm.h> |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | #include <linux/ip.h> |
| 33 | 33 | #include <linux/ratelimit.h> |
| 34 | 34 | #include <linux/string.h> |
| 35 | +#include <linux/interrupt.h> | |
| 35 | 36 | #include <net/dst.h> |
| 36 | 37 | #ifdef CONFIG_XFRM |
| 37 | 38 | #include <linux/xfrm.h> |
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include <linux/etherdevice.h> |
| 32 | 32 | #include <linux/phy.h> |
| 33 | 33 | #include <linux/slab.h> |
| 34 | +#include <linux/interrupt.h> | |
| 34 | 35 | |
| 35 | 36 | #include <net/dst.h> |
| 36 | 37 | |
| @@ -383,8 +383,6 @@ static void oz_tx_frame_free(struct oz_pd *pd, struct oz_tx_frame *f) · 382 unmodified lines | ||
| 383 | 383 | pd->tx_pool = &f->link; |
| 384 | 384 | pd->tx_pool_count++; |
| 385 | 385 | f = 0; |
| 386 | − } else { | |
| 387 | − kfree(f); | |
| 388 | 386 | } |
| 389 | 387 | spin_unlock_bh(&pd->tx_frame_lock); |
| 390 | 388 | if (f) |
| @@ -79,10 +79,6 @@ · 78 unmodified lines | ||
| 79 | 79 | #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) |
| 80 | 80 | #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) |
| 81 | 81 | |
| 82 | −#define OMAP343X_CTRL_REGADDR(reg) \ | |
| 83 | − OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) | |
| 84 | − | |
| 85 | − | |
| 86 | 82 | /* Forward Declarations: */ |
| 87 | 83 | static int bridge_brd_monitor(struct bridge_dev_context *dev_ctxt); |
| 88 | 84 | static int bridge_brd_read(struct bridge_dev_context *dev_ctxt, |
| @@ -418,19 +414,27 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, · 329 unmodified lines | ||
| 418 | 414 | |
| 419 | 415 | /* Assert RST1 i.e only the RST only for DSP megacell */ |
| 420 | 416 | if (!status) { |
| 417 | + /* | |
| 418 | + * XXX: ioremapping MUST be removed once ctrl | |
| 419 | + * function is made available. | |
| 420 | + */ | |
| 421 | + void __iomem *ctrl = ioremap(OMAP343X_CTRL_BASE, SZ_4K); | |
| 422 | + if (!ctrl) | |
| 423 | + return -ENOMEM; | |
| 424 | + | |
| 421 | 425 | (*pdata->dsp_prm_rmw_bits)(OMAP3430_RST1_IVA2_MASK, |
| 422 | 426 | OMAP3430_RST1_IVA2_MASK, OMAP3430_IVA2_MOD, |
| 423 | 427 | OMAP2_RM_RSTCTRL); |
| 424 | 428 | /* Mask address with 1K for compatibility */ |
| 425 | 429 | __raw_writel(dsp_addr & OMAP3_IVA2_BOOTADDR_MASK, |
| 426 | − OMAP343X_CTRL_REGADDR( | |
| 427 | − OMAP343X_CONTROL_IVA2_BOOTADDR)); | |
| 430 | + ctrl + OMAP343X_CONTROL_IVA2_BOOTADDR); | |
| 428 | 431 | /* |
| 429 | 432 | * Set bootmode to self loop if dsp_debug flag is true |
| 430 | 433 | */ |
| 431 | 434 | __raw_writel((dsp_debug) ? OMAP3_IVA2_BOOTMOD_IDLE : 0, |
| 432 | − OMAP343X_CTRL_REGADDR( | |
| 433 | − OMAP343X_CONTROL_IVA2_BOOTMOD)); | |
| 435 | + ctrl + OMAP343X_CONTROL_IVA2_BOOTMOD); | |
| 436 | + | |
| 437 | + iounmap(ctrl); | |
| 434 | 438 | } |
| 435 | 439 | } |
| 436 | 440 | if (!status) { |
| @@ -53,7 +53,10 @@ int dsp_wdt_init(void) · 52 unmodified lines | ||
| 53 | 53 | int ret = 0; |
| 54 | 54 | |
| 55 | 55 | dsp_wdt.sm_wdt = NULL; |
| 56 | − dsp_wdt.reg_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_WDT3_BASE); | |
| 56 | + dsp_wdt.reg_base = ioremap(OMAP34XX_WDT3_BASE, SZ_4K); | |
| 57 | + if (!dsp_wdt.reg_base) | |
| 58 | + return -ENOMEM; | |
| 59 | + | |
| 57 | 60 | tasklet_init(&dsp_wdt.wdt3_tasklet, dsp_wdt_dpc, 0); |
| 58 | 61 | |
| 59 | 62 | dsp_wdt.fclk = clk_get(NULL, "wdt3_fck"); |
| @@ -99,6 +102,9 @@ void dsp_wdt_exit(void) · 39 unmodified lines | ||
| 99 | 102 | dsp_wdt.fclk = NULL; |
| 100 | 103 | dsp_wdt.iclk = NULL; |
| 101 | 104 | dsp_wdt.sm_wdt = NULL; |
| 105 | + | |
| 106 | + if (dsp_wdt.reg_base) | |
| 107 | + iounmap(dsp_wdt.reg_base); | |
| 102 | 108 | dsp_wdt.reg_base = NULL; |
| 103 | 109 | } |
| 104 | 110 | |
| @@ -2,7 +2,7 @@ config ZCACHE · 1 unmodified line | ||
| 2 | 2 | bool "Dynamic compression of swap pages and clean pagecache pages" |
| 3 | 3 | # X86 dependency is because zsmalloc uses non-portable pte/tlb |
| 4 | 4 | # functions |
| 5 | − depends on (CLEANCACHE || FRONTSWAP) && CRYPTO && X86 | |
| 5 | + depends on (CLEANCACHE || FRONTSWAP) && CRYPTO=y && X86 | |
| 6 | 6 | select ZSMALLOC |
| 7 | 7 | select CRYPTO_LZO |
| 8 | 8 | default n |
| @@ -1073,8 +1073,10 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state, · 1072 unmodified lines | ||
| 1073 | 1073 | (new_serial.close_delay != port->close_delay) || |
| 1074 | 1074 | (new_serial.xmit_fifo_size != state->xmit_fifo_size) || |
| 1075 | 1075 | ((new_serial.flags & ~ASYNC_USR_MASK) != |
| 1076 | − (port->flags & ~ASYNC_USR_MASK))) | |
| 1076 | + (port->flags & ~ASYNC_USR_MASK))) { | |
| 1077 | + tty_unlock(); | |
| 1077 | 1078 | return -EPERM; |
| 1079 | + } | |
| 1078 | 1080 | port->flags = ((port->flags & ~ASYNC_USR_MASK) | |
| 1079 | 1081 | (new_serial.flags & ASYNC_USR_MASK)); |
| 1080 | 1082 | state->custom_divisor = new_serial.custom_divisor; |
| @@ -154,10 +154,9 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) · 153 unmodified lines | ||
| 154 | 154 | port->x_char = 0; |
| 155 | 155 | return IRQ_HANDLED; |
| 156 | 156 | } |
| 157 | − if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { | |
| 158 | − clps711xuart_stop_tx(port); | |
| 159 | − return IRQ_HANDLED; | |
| 160 | − } | |
| 157 | + | |
| 158 | + if (uart_circ_empty(xmit) || uart_tx_stopped(port)) | |
| 159 | + goto disable_tx_irq; | |
| 161 | 160 | |
| 162 | 161 | count = port->fifosize >> 1; |
| 163 | 162 | do { |
| @@ -171,8 +170,11 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) · 7 unmodified lines | ||
| 171 | 170 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
| 172 | 171 | uart_write_wakeup(port); |
| 173 | 172 | |
| 174 | − if (uart_circ_empty(xmit)) | |
| 175 | − clps711xuart_stop_tx(port); | |
| 173 | + if (uart_circ_empty(xmit)) { | |
| 174 | + disable_tx_irq: | |
| 175 | + disable_irq_nosync(TX_IRQ(port)); | |
| 176 | + tx_enabled(port) = 0; | |
| 177 | + } | |
| 176 | 178 | |
| 177 | 179 | return IRQ_HANDLED; |
| 178 | 180 | } |
| @@ -1447,9 +1447,11 @@ static int pch_uart_verify_port(struct uart_port *port, · 1446 unmodified lines | ||
| 1447 | 1447 | __func__); |
| 1448 | 1448 | return -EOPNOTSUPP; |
| 1449 | 1449 | #endif |
| 1450 | − priv->use_dma = 1; | |
| 1451 | 1450 | priv->use_dma_flag = 1; |
| 1452 | 1451 | dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n"); |
| 1452 | + if (!priv->use_dma) | |
| 1453 | + pch_request_dma(port); | |
| 1454 | + priv->use_dma = 1; | |
| 1453 | 1455 | } |
| 1454 | 1456 | |
| 1455 | 1457 | return 0; |
| @@ -469,7 +469,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) · 468 unmodified lines | ||
| 469 | 469 | tty = NULL; |
| 470 | 470 | if (r3 & (CHAEXT | CHATxIP | CHARxIP)) { |
| 471 | 471 | if (!ZS_IS_OPEN(uap_a)) { |
| 472 | − pmz_debug("ChanA interrupt while open !\n"); | |
| 472 | + pmz_debug("ChanA interrupt while not open !\n"); | |
| 473 | 473 | goto skip_a; |
| 474 | 474 | } |
| 475 | 475 | write_zsreg(uap_a, R0, RES_H_IUS); |
| @@ -493,8 +493,8 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) · 17 unmodified lines | ||
| 493 | 493 | spin_lock(&uap_b->port.lock); |
| 494 | 494 | tty = NULL; |
| 495 | 495 | if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { |
| 496 | − if (!ZS_IS_OPEN(uap_a)) { | |
| 497 | − pmz_debug("ChanB interrupt while open !\n"); | |
| 496 | + if (!ZS_IS_OPEN(uap_b)) { | |
| 497 | + pmz_debug("ChanB interrupt while not open !\n"); | |
| 498 | 498 | goto skip_b; |
| 499 | 499 | } |
| 500 | 500 | write_zsreg(uap_b, R0, RES_H_IUS); |
| @@ -157,8 +157,9 @@ static void wdm_out_callback(struct urb *urb) · 156 unmodified lines | ||
| 157 | 157 | spin_lock(&desc->iuspin); |
| 158 | 158 | desc->werr = urb->status; |
| 159 | 159 | spin_unlock(&desc->iuspin); |
| 160 | − clear_bit(WDM_IN_USE, &desc->flags); | |
| 161 | 160 | kfree(desc->outbuf); |
| 161 | + desc->outbuf = NULL; | |
| 162 | + clear_bit(WDM_IN_USE, &desc->flags); | |
| 162 | 163 | wake_up(&desc->wait); |
| 163 | 164 | } |
| 164 | 165 | |
| @@ -338,7 +339,7 @@ static ssize_t wdm_write · 173 unmodified lines | ||
| 338 | 339 | if (we < 0) |
| 339 | 340 | return -EIO; |
| 340 | 341 | |
| 341 | − desc->outbuf = buf = kmalloc(count, GFP_KERNEL); | |
| 342 | + buf = kmalloc(count, GFP_KERNEL); | |
| 342 | 343 | if (!buf) { |
| 343 | 344 | rv = -ENOMEM; |
| 344 | 345 | goto outnl; |
| @@ -406,10 +407,12 @@ static ssize_t wdm_write · 61 unmodified lines | ||
| 406 | 407 | req->wIndex = desc->inum; |
| 407 | 408 | req->wLength = cpu_to_le16(count); |
| 408 | 409 | set_bit(WDM_IN_USE, &desc->flags); |
| 410 | + desc->outbuf = buf; | |
| 409 | 411 | |
| 410 | 412 | rv = usb_submit_urb(desc->command, GFP_KERNEL); |
| 411 | 413 | if (rv < 0) { |
| 412 | 414 | kfree(buf); |
| 415 | + desc->outbuf = NULL; | |
| 413 | 416 | clear_bit(WDM_IN_USE, &desc->flags); |
| 414 | 417 | dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); |
| 415 | 418 | } else { |
| @@ -493,6 +493,15 @@ static int hcd_pci_suspend_noirq(struct device *dev) · 492 unmodified lines | ||
| 493 | 493 | |
| 494 | 494 | pci_save_state(pci_dev); |
| 495 | 495 | |
| 496 | + /* | |
| 497 | + * Some systems crash if an EHCI controller is in D3 during | |
| 498 | + * a sleep transition. We have to leave such controllers in D0. | |
| 499 | + */ | |
| 500 | + if (hcd->broken_pci_sleep) { | |
| 501 | + dev_dbg(dev, "Staying in PCI D0\n"); | |
| 502 | + return retval; | |
| 503 | + } | |
| 504 | + | |
| 496 | 505 | /* If the root hub is dead rather than suspended, disallow remote |
| 497 | 506 | * wakeup. usb_hc_died() should ensure that both hosts are marked as |
| 498 | 507 | * dying, so we only need to check the primary roothub. |
| @@ -1667,7 +1667,6 @@ void usb_disconnect(struct usb_device **pdev) · 1666 unmodified lines | ||
| 1667 | 1667 | { |
| 1668 | 1668 | struct usb_device *udev = *pdev; |
| 1669 | 1669 | int i; |
| 1670 | − struct usb_hcd *hcd = bus_to_hcd(udev->bus); | |
| 1671 | 1670 | |
| 1672 | 1671 | /* mark the device as inactive, so any further urb submissions for |
| 1673 | 1672 | * this device (and any of its children) will fail immediately. |
| @@ -1690,9 +1689,7 @@ void usb_disconnect(struct usb_device **pdev) · 16 unmodified lines | ||
| 1690 | 1689 | * so that the hardware is now fully quiesced. |
| 1691 | 1690 | */ |
| 1692 | 1691 | dev_dbg (&udev->dev, "unregistering device\n"); |
| 1693 | − mutex_lock(hcd->bandwidth_mutex); | |
| 1694 | 1692 | usb_disable_device(udev, 0); |
| 1695 | − mutex_unlock(hcd->bandwidth_mutex); | |
| 1696 | 1693 | usb_hcd_synchronize_unlinks(udev); |
| 1697 | 1694 | |
| 1698 | 1695 | usb_remove_ep_devs(&udev->ep0); |
| @@ -1136,8 +1136,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, · 1135 unmodified lines | ||
| 1136 | 1136 | * Deallocates hcd/hardware state for the endpoints (nuking all or most |
| 1137 | 1137 | * pending urbs) and usbcore state for the interfaces, so that usbcore |
| 1138 | 1138 | * must usb_set_configuration() before any interfaces could be used. |
| 1139 | − * | |
| 1140 | − * Must be called with hcd->bandwidth_mutex held. | |
| 1141 | 1139 | */ |
| 1142 | 1140 | void usb_disable_device(struct usb_device *dev, int skip_ep0) |
| 1143 | 1141 | { |
| @@ -1190,7 +1188,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) · 46 unmodified lines | ||
| 1190 | 1188 | usb_disable_endpoint(dev, i + USB_DIR_IN, false); |
| 1191 | 1189 | } |
| 1192 | 1190 | /* Remove endpoints from the host controller internal state */ |
| 1191 | + mutex_lock(hcd->bandwidth_mutex); | |
| 1193 | 1192 | usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
| 1193 | + mutex_unlock(hcd->bandwidth_mutex); | |
| 1194 | 1194 | /* Second pass: remove endpoint pointers */ |
| 1195 | 1195 | } |
| 1196 | 1196 | for (i = skip_ep0; i < 16; ++i) { |
| @@ -1750,7 +1750,6 @@ free_interfaces: · 553 unmodified lines | ||
| 1750 | 1750 | /* if it's already configured, clear out old state first. |
| 1751 | 1751 | * getting rid of old interfaces means unbinding their drivers. |
| 1752 | 1752 | */ |
| 1753 | − mutex_lock(hcd->bandwidth_mutex); | |
| 1754 | 1753 | if (dev->state != USB_STATE_ADDRESS) |
| 1755 | 1754 | usb_disable_device(dev, 1); /* Skip ep0 */ |
| 1756 | 1755 | |
| @@ -1763,6 +1762,7 @@ free_interfaces: · 6 unmodified lines | ||
| 1763 | 1762 | * host controller will not allow submissions to dropped endpoints. If |
| 1764 | 1763 | * this call fails, the device state is unchanged. |
| 1765 | 1764 | */ |
| 1765 | + mutex_lock(hcd->bandwidth_mutex); | |
| 1766 | 1766 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); |
| 1767 | 1767 | if (ret < 0) { |
| 1768 | 1768 | mutex_unlock(hcd->bandwidth_mutex); |
| @@ -206,11 +206,11 @@ static void dwc3_free_event_buffers(struct dwc3 *dwc) · 205 unmodified lines | ||
| 206 | 206 | |
| 207 | 207 | for (i = 0; i < dwc->num_event_buffers; i++) { |
| 208 | 208 | evt = dwc->ev_buffs[i]; |
| 209 | − if (evt) { | |
| 209 | + if (evt) | |
| 210 | 210 | dwc3_free_one_event_buffer(dwc, evt); |
| 211 | − dwc->ev_buffs[i] = NULL; | |
| 212 | − } | |
| 213 | 211 | } |
| 212 | + | |
| 213 | + kfree(dwc->ev_buffs); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
| @@ -353,6 +353,9 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, · 352 unmodified lines | ||
| 353 | 353 | |
| 354 | 354 | dwc->test_mode_nr = wIndex >> 8; |
| 355 | 355 | dwc->test_mode = true; |
| 356 | + break; | |
| 357 | + default: | |
| 358 | + return -EINVAL; | |
| 356 | 359 | } |
| 357 | 360 | break; |
| 358 | 361 | |
| @@ -559,15 +562,20 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, · 200 unmodified lines | ||
| 559 | 562 | length = trb->size & DWC3_TRB_SIZE_MASK; |
| 560 | 563 | |
| 561 | 564 | if (dwc->ep0_bounced) { |
| 565 | + unsigned transfer_size = ur->length; | |
| 566 | + unsigned maxp = ep0->endpoint.maxpacket; | |
| 567 | + | |
| 568 | + transfer_size += (maxp - (transfer_size % maxp)); | |
| 562 | 569 | transferred = min_t(u32, ur->length, |
| 563 | − ep0->endpoint.maxpacket - length); | |
| 570 | + transfer_size - length); | |
| 564 | 571 | memcpy(ur->buf, dwc->ep0_bounce, transferred); |
| 565 | 572 | dwc->ep0_bounced = false; |
| 566 | 573 | } else { |
| 567 | 574 | transferred = ur->length - length; |
| 568 | − ur->actual += transferred; | |
| 569 | 575 | } |
| 570 | 576 | |
| 577 | + ur->actual += transferred; | |
| 578 | + | |
| 571 | 579 | if ((epnum & 1) && ur->actual < ur->length) { |
| 572 | 580 | /* for some reason we did not get everything out */ |
| 573 | 581 | |
| @@ -1863,8 +1863,8 @@ static int __devinit at91udc_probe(struct platform_device *pdev) · 1862 unmodified lines | ||
| 1863 | 1863 | mod_timer(&udc->vbus_timer, |
| 1864 | 1864 | jiffies + VBUS_POLL_TIMEOUT); |
| 1865 | 1865 | } else { |
| 1866 | − if (request_irq(udc->board.vbus_pin, at91_vbus_irq, | |
| 1867 | − 0, driver_name, udc)) { | |
| 1866 | + if (request_irq(gpio_to_irq(udc->board.vbus_pin), | |
| 1867 | + at91_vbus_irq, 0, driver_name, udc)) { | |
| 1868 | 1868 | DBG("request vbus irq %d failed\n", |
| 1869 | 1869 | udc->board.vbus_pin); |
| 1870 | 1870 | retval = -EBUSY; |
| @@ -1886,7 +1886,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev) · 15 unmodified lines | ||
| 1886 | 1886 | return 0; |
| 1887 | 1887 | fail4: |
| 1888 | 1888 | if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled) |
| 1889 | − free_irq(udc->board.vbus_pin, udc); | |
| 1889 | + free_irq(gpio_to_irq(udc->board.vbus_pin), udc); | |
| 1890 | 1890 | fail3: |
| 1891 | 1891 | if (gpio_is_valid(udc->board.vbus_pin)) |
| 1892 | 1892 | gpio_free(udc->board.vbus_pin); |
| @@ -1924,7 +1924,7 @@ static int __exit at91udc_remove(struct platform_device *pdev) · 31 unmodified lines | ||
| 1924 | 1924 | device_init_wakeup(&pdev->dev, 0); |
| 1925 | 1925 | remove_debug_file(udc); |
| 1926 | 1926 | if (gpio_is_valid(udc->board.vbus_pin)) { |
| 1927 | − free_irq(udc->board.vbus_pin, udc); | |
| 1927 | + free_irq(gpio_to_irq(udc->board.vbus_pin), udc); | |
| 1928 | 1928 | gpio_free(udc->board.vbus_pin); |
| 1929 | 1929 | } |
| 1930 | 1930 | free_irq(udc->udp_irq, udc); |
| @@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g, · 926 unmodified lines | ||
| 927 | 927 | |
| 928 | 928 | dum->driver = NULL; |
| 929 | 929 | |
| 930 | − dummy_pullup(&dum->gadget, 0); | |
| 931 | 930 | return 0; |
| 932 | 931 | } |
| 933 | 932 | |
| @@ -712,7 +712,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value) · 711 unmodified lines | ||
| 712 | 712 | if (code == FUNCTIONFS_INTERFACE_REVMAP) { |
| 713 | 713 | struct ffs_function *func = ffs->func; |
| 714 | 714 | ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV; |
| 715 | − } else if (gadget->ops->ioctl) { | |
| 715 | + } else if (gadget && gadget->ops->ioctl) { | |
| 716 | 716 | ret = gadget->ops->ioctl(gadget, code, value); |
| 717 | 717 | } else { |
| 718 | 718 | ret = -ENOTTY; |
| @@ -1382,6 +1382,7 @@ static void functionfs_unbind(struct ffs_data *ffs) · 663 unmodified lines | ||
| 1382 | 1382 | ffs->ep0req = NULL; |
| 1383 | 1383 | ffs->gadget = NULL; |
| 1384 | 1384 | ffs_data_put(ffs); |
| 1385 | + clear_bit(FFS_FL_BOUND, &ffs->flags); | |
| 1385 | 1386 | } |
| 1386 | 1387 | } |
| 1387 | 1388 | |
| @@ -2189,7 +2189,7 @@ unknown_cmnd: · 2188 unmodified lines | ||
| 2189 | 2189 | common->data_size_from_cmnd = 0; |
| 2190 | 2190 | sprintf(unknown, "Unknown x%02x", common->cmnd[0]); |
| 2191 | 2191 | reply = check_command(common, common->cmnd_size, |
| 2192 | − DATA_DIR_UNKNOWN, 0xff, 0, unknown); | |
| 2192 | + DATA_DIR_UNKNOWN, ~0, 0, unknown); | |
| 2193 | 2193 | if (reply == 0) { |
| 2194 | 2194 | common->curlun->sense_data = SS_INVALID_COMMAND; |
| 2195 | 2195 | reply = -EINVAL; |
| @@ -500,6 +500,7 @@ rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) · 499 unmodified lines | ||
| 500 | 500 | if (buf) { |
| 501 | 501 | memcpy(req->buf, buf, n); |
| 502 | 502 | req->complete = rndis_response_complete; |
| 503 | + req->context = rndis; | |
| 503 | 504 | rndis_free_response(rndis->config, buf); |
| 504 | 505 | value = n; |
| 505 | 506 | } |
| @@ -2579,7 +2579,7 @@ static int do_scsi_command(struct fsg_dev *fsg) · 2578 unmodified lines | ||
| 2579 | 2579 | fsg->data_size_from_cmnd = 0; |
| 2580 | 2580 | sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]); |
| 2581 | 2581 | if ((reply = check_command(fsg, fsg->cmnd_size, |
| 2582 | − DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) { | |
| 2582 | + DATA_DIR_UNKNOWN, ~0, 0, unknown)) == 0) { | |
| 2583 | 2583 | fsg->curlun->sense_data = SS_INVALID_COMMAND; |
| 2584 | 2584 | reply = -EINVAL; |
| 2585 | 2585 | } |
| @@ -730,7 +730,7 @@ static void fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req) · 729 unmodified lines | ||
| 730 | 730 | : (1 << (ep_index(ep))); |
| 731 | 731 | |
| 732 | 732 | /* check if the pipe is empty */ |
| 733 | − if (!(list_empty(&ep->queue))) { | |
| 733 | + if (!(list_empty(&ep->queue)) && !(ep_index(ep) == 0)) { | |
| 734 | 734 | /* Add td to the end */ |
| 735 | 735 | struct fsl_req *lastreq; |
| 736 | 736 | lastreq = list_entry(ep->queue.prev, struct fsl_req, queue); |
| @@ -918,10 +918,6 @@ fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) · 181 unmodified lines | ||
| 918 | 918 | return -ENOMEM; |
| 919 | 919 | } |
| 920 | 920 | |
| 921 | − /* Update ep0 state */ | |
| 922 | − if ((ep_index(ep) == 0)) | |
| 923 | − udc->ep0_state = DATA_STATE_XMIT; | |
| 924 | − | |
| 925 | 921 | /* irq handler advances the queue */ |
| 926 | 922 | if (req != NULL) |
| 927 | 923 | list_add_tail(&req->queue, &ep->queue); |
| @@ -1279,7 +1275,8 @@ static int ep0_prime_status(struct fsl_udc *udc, int direction) · 351 unmodified lines | ||
| 1279 | 1275 | udc->ep0_dir = USB_DIR_OUT; |
| 1280 | 1276 | |
| 1281 | 1277 | ep = &udc->eps[0]; |
| 1282 | − udc->ep0_state = WAIT_FOR_OUT_STATUS; | |
| 1278 | + if (udc->ep0_state != DATA_STATE_XMIT) | |
| 1279 | + udc->ep0_state = WAIT_FOR_OUT_STATUS; | |
| 1283 | 1280 | |
| 1284 | 1281 | req->ep = ep; |
| 1285 | 1282 | req->req.length = 0; |
| @@ -1384,6 +1381,9 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value, · 98 unmodified lines | ||
| 1384 | 1381 | |
| 1385 | 1382 | list_add_tail(&req->queue, &ep->queue); |
| 1386 | 1383 | udc->ep0_state = DATA_STATE_XMIT; |
| 1384 | + if (ep0_prime_status(udc, EP_DIR_OUT)) | |
| 1385 | + ep0stall(udc); | |
| 1386 | + | |
| 1387 | 1387 | return; |
| 1388 | 1388 | stall: |
| 1389 | 1389 | ep0stall(udc); |
| @@ -1492,6 +1492,14 @@ static void setup_received_irq(struct fsl_udc *udc, · 102 unmodified lines | ||
| 1492 | 1492 | spin_lock(&udc->lock); |
| 1493 | 1493 | udc->ep0_state = (setup->bRequestType & USB_DIR_IN) |
| 1494 | 1494 | ? DATA_STATE_XMIT : DATA_STATE_RECV; |
| 1495 | + /* | |
| 1496 | + * If the data stage is IN, send status prime immediately. | |
| 1497 | + * See 2.0 Spec chapter 8.5.3.3 for detail. | |
| 1498 | + */ | |
| 1499 | + if (udc->ep0_state == DATA_STATE_XMIT) | |
| 1500 | + if (ep0_prime_status(udc, EP_DIR_OUT)) | |
| 1501 | + ep0stall(udc); | |
| 1502 | + | |
| 1495 | 1503 | } else { |
| 1496 | 1504 | /* No data phase, IN status from gadget */ |
| 1497 | 1505 | udc->ep0_dir = USB_DIR_IN; |
| @@ -1520,9 +1528,8 @@ static void ep0_req_complete(struct fsl_udc *udc, struct fsl_ep *ep0, · 22 unmodified lines | ||
| 1520 | 1528 | |
| 1521 | 1529 | switch (udc->ep0_state) { |
| 1522 | 1530 | case DATA_STATE_XMIT: |
| 1523 | − /* receive status phase */ | |
| 1524 | − if (ep0_prime_status(udc, EP_DIR_OUT)) | |
| 1525 | − ep0stall(udc); | |
| 1531 | + /* already primed at setup_received_irq */ | |
| 1532 | + udc->ep0_state = WAIT_FOR_OUT_STATUS; | |
| 1526 | 1533 | break; |
| 1527 | 1534 | case DATA_STATE_RECV: |
| 1528 | 1535 | /* send status phase */ |
| @@ -161,7 +161,7 @@ static struct usb_composite_driver gfs_driver = { · 160 unmodified lines | ||
| 161 | 161 | static struct ffs_data *gfs_ffs_data; |
| 162 | 162 | static unsigned long gfs_registered; |
| 163 | 163 | |
| 164 | −static int gfs_init(void) | |
| 164 | +static int __init gfs_init(void) | |
| 165 | 165 | { |
| 166 | 166 | ENTER(); |
| 167 | 167 | |
| @@ -169,7 +169,7 @@ static int gfs_init(void) · 1 unmodified line | ||
| 169 | 169 | } |
| 170 | 170 | module_init(gfs_init); |
| 171 | 171 | |
| 172 | −static void gfs_exit(void) | |
| 172 | +static void __exit gfs_exit(void) | |
| 173 | 173 | { |
| 174 | 174 | ENTER(); |
| 175 | 175 | |
| @@ -340,7 +340,7 @@ static void s3c_hsotg_init_fifo(struct s3c_hsotg *hsotg) · 339 unmodified lines | ||
| 340 | 340 | /* currently we allocate TX FIFOs for all possible endpoints, |
| 341 | 341 | * and assume that they are all the same size. */ |
| 342 | 342 | |
| 343 | − for (ep = 0; ep <= 15; ep++) { | |
| 343 | + for (ep = 1; ep <= 15; ep++) { | |
| 344 | 344 | val = addr; |
| 345 | 345 | val |= size << S3C_DPTXFSIZn_DPTxFSize_SHIFT; |
| 346 | 346 | addr += size; |
| @@ -741,7 +741,7 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, · 394 unmodified lines | ||
| 741 | 741 | /* write size / packets */ |
| 742 | 742 | writel(epsize, hsotg->regs + epsize_reg); |
| 743 | 743 | |
| 744 | − if (using_dma(hsotg)) { | |
| 744 | + if (using_dma(hsotg) && !continuing) { | |
| 745 | 745 | unsigned int dma_reg; |
| 746 | 746 | |
| 747 | 747 | /* write DMA address to control register, buffer already |
| @@ -1696,10 +1696,12 @@ static void s3c_hsotg_set_ep_maxpacket(struct s3c_hsotg *hsotg, · 948 unmodified lines | ||
| 1696 | 1696 | reg |= mpsval; |
| 1697 | 1697 | writel(reg, regs + S3C_DIEPCTL(ep)); |
| 1698 | 1698 | |
| 1699 | − reg = readl(regs + S3C_DOEPCTL(ep)); | |
| 1700 | − reg &= ~S3C_DxEPCTL_MPS_MASK; | |
| 1701 | − reg |= mpsval; | |
| 1702 | − writel(reg, regs + S3C_DOEPCTL(ep)); | |
| 1699 | + if (ep) { | |
| 1700 | + reg = readl(regs + S3C_DOEPCTL(ep)); | |
| 1701 | + reg &= ~S3C_DxEPCTL_MPS_MASK; | |
| 1702 | + reg |= mpsval; | |
| 1703 | + writel(reg, regs + S3C_DOEPCTL(ep)); | |
| 1704 | + } | |
| 1703 | 1705 | |
| 1704 | 1706 | return; |
| 1705 | 1707 | |
| @@ -1919,7 +1921,8 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx, · 213 unmodified lines | ||
| 1919 | 1921 | ints & S3C_DIEPMSK_TxFIFOEmpty) { |
| 1920 | 1922 | dev_dbg(hsotg->dev, "%s: ep%d: TxFIFOEmpty\n", |
| 1921 | 1923 | __func__, idx); |
| 1922 | − s3c_hsotg_trytx(hsotg, hs_ep); | |
| 1924 | + if (!using_dma(hsotg)) | |
| 1925 | + s3c_hsotg_trytx(hsotg, hs_ep); | |
| 1923 | 1926 | } |
| 1924 | 1927 | } |
| 1925 | 1928 | } |
| @@ -263,9 +263,9 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) · 262 unmodified lines | ||
| 263 | 263 | |
| 264 | 264 | if (udc_is_newstyle(udc)) { |
| 265 | 265 | udc->driver->disconnect(udc->gadget); |
| 266 | + usb_gadget_disconnect(udc->gadget); | |
| 266 | 267 | udc->driver->unbind(udc->gadget); |
| 267 | 268 | usb_gadget_udc_stop(udc->gadget, udc->driver); |
| 268 | − usb_gadget_disconnect(udc->gadget); | |
| 269 | 269 | } else { |
| 270 | 270 | usb_gadget_stop(udc->gadget, udc->driver); |
| 271 | 271 | } |
| @@ -411,9 +411,13 @@ static ssize_t usb_udc_softconn_store(struct device *dev, · 139 unmodified lines | ||
| 411 | 411 | struct usb_udc *udc = container_of(dev, struct usb_udc, dev); |
| 412 | 412 | |
| 413 | 413 | if (sysfs_streq(buf, "connect")) { |
| 414 | + if (udc_is_newstyle(udc)) | |
| 415 | + usb_gadget_udc_start(udc->gadget, udc->driver); | |
| 414 | 416 | usb_gadget_connect(udc->gadget); |
| 415 | 417 | } else if (sysfs_streq(buf, "disconnect")) { |
| 416 | 418 | usb_gadget_disconnect(udc->gadget); |
| 419 | + if (udc_is_newstyle(udc)) | |
| 420 | + usb_gadget_udc_stop(udc->gadget, udc->driver); | |
| 417 | 421 | } else { |
| 418 | 422 | dev_err(dev, "unsupported command '%s'\n", buf); |
| 419 | 423 | return -EINVAL; |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | struct uvc_request_data |
| 30 | 30 | { |
| 31 | − unsigned int length; | |
| 31 | + __s32 length; | |
| 32 | 32 | __u8 data[60]; |
| 33 | 33 | }; |
| 34 | 34 | |
| @@ -543,11 +543,11 @@ done: · 542 unmodified lines | ||
| 543 | 543 | return ret; |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | +/* called with queue->irqlock held.. */ | |
| 546 | 547 | static struct uvc_buffer * |
| 547 | 548 | uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) |
| 548 | 549 | { |
| 549 | 550 | struct uvc_buffer *nextbuf; |
| 550 | − unsigned long flags; | |
| 551 | 551 | |
| 552 | 552 | if ((queue->flags & UVC_QUEUE_DROP_INCOMPLETE) && |
| 553 | 553 | buf->buf.length != buf->buf.bytesused) { |
| @@ -556,14 +556,12 @@ uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) · 2 unmodified lines | ||
| 556 | 556 | return buf; |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | − spin_lock_irqsave(&queue->irqlock, flags); | |
| 560 | 559 | list_del(&buf->queue); |
| 561 | 560 | if (!list_empty(&queue->irqqueue)) |
| 562 | 561 | nextbuf = list_first_entry(&queue->irqqueue, struct uvc_buffer, |
| 563 | 562 | queue); |
| 564 | 563 | else |
| 565 | 564 | nextbuf = NULL; |
| 566 | − spin_unlock_irqrestore(&queue->irqlock, flags); | |
| 567 | 565 | |
| 568 | 566 | buf->buf.sequence = queue->sequence++; |
| 569 | 567 | do_gettimeofday(&buf->buf.timestamp); |
| @@ -39,7 +39,7 @@ uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data) · 38 unmodified lines | ||
| 39 | 39 | if (data->length < 0) |
| 40 | 40 | return usb_ep_set_halt(cdev->gadget->ep0); |
| 41 | 41 | |
| 42 | − req->length = min(uvc->event_length, data->length); | |
| 42 | + req->length = min_t(unsigned int, uvc->event_length, data->length); | |
| 43 | 43 | req->zero = data->length < uvc->event_length; |
| 44 | 44 | req->dma = DMA_ADDR_INVALID; |
| 45 | 45 | |
| @@ -218,6 +218,9 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci, · 217 unmodified lines | ||
| 218 | 218 | u32 portsc; |
| 219 | 219 | struct usb_hcd *hcd = ehci_to_hcd(ehci); |
| 220 | 220 | void __iomem *non_ehci = hcd->regs; |
| 221 | + struct fsl_usb2_platform_data *pdata; | |
| 222 | + | |
| 223 | + pdata = hcd->self.controller->platform_data; | |
| 221 | 224 | |
| 222 | 225 | portsc = ehci_readl(ehci, &ehci->regs->port_status[port_offset]); |
| 223 | 226 | portsc &= ~(PORT_PTS_MSK | PORT_PTS_PTW); |
| @@ -234,7 +237,9 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci, · 10 unmodified lines | ||
| 234 | 237 | /* fall through */ |
| 235 | 238 | case FSL_USB2_PHY_UTMI: |
| 236 | 239 | /* enable UTMI PHY */ |
| 237 | − setbits32(non_ehci + FSL_SOC_USB_CTRL, CTRL_UTMI_PHY_EN); | |
| 240 | + if (pdata->have_sysif_regs) | |
| 241 | + setbits32(non_ehci + FSL_SOC_USB_CTRL, | |
| 242 | + CTRL_UTMI_PHY_EN); | |
| 238 | 243 | portsc |= PORT_PTS_UTMI; |
| 239 | 244 | break; |
| 240 | 245 | case FSL_USB2_PHY_NONE: |
| @@ -858,8 +858,13 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) · 857 unmodified lines | ||
| 858 | 858 | goto dead; |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | + /* | |
| 862 | + * We don't use STS_FLR, but some controllers don't like it to | |
| 863 | + * remain on, so mask it out along with the other status bits. | |
| 864 | + */ | |
| 865 | + masked_status = status & (INTR_MASK | STS_FLR); | |
| 866 | + | |
| 861 | 867 | /* Shared IRQ? */ |
| 862 | − masked_status = status & INTR_MASK; | |
| 863 | 868 | if (!masked_status || unlikely(ehci->rh_state == EHCI_RH_HALTED)) { |
| 864 | 869 | spin_unlock(&ehci->lock); |
| 865 | 870 | return IRQ_NONE; |
| @@ -910,7 +915,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) · 44 unmodified lines | ||
| 910 | 915 | pcd_status = status; |
| 911 | 916 | |
| 912 | 917 | /* resume root hub? */ |
| 913 | − if (!(cmd & CMD_RUN)) | |
| 918 | + if (ehci->rh_state == EHCI_RH_SUSPENDED) | |
| 914 | 919 | usb_hcd_resume_root_hub(hcd); |
| 915 | 920 | |
| 916 | 921 | /* get per-port change detect bits */ |
| @@ -42,6 +42,7 @@ · 41 unmodified lines | ||
| 42 | 42 | #include <plat/usb.h> |
| 43 | 43 | #include <linux/regulator/consumer.h> |
| 44 | 44 | #include <linux/pm_runtime.h> |
| 45 | +#include <linux/gpio.h> | |
| 45 | 46 | |
| 46 | 47 | /* EHCI Register Set */ |
| 47 | 48 | #define EHCI_INSNREG04 (0xA0) |
| @@ -191,6 +192,19 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 143 unmodified lines | ||
| 191 | 192 | } |
| 192 | 193 | } |
| 193 | 194 | |
| 195 | + if (pdata->phy_reset) { | |
| 196 | + if (gpio_is_valid(pdata->reset_gpio_port[0])) | |
| 197 | + gpio_request_one(pdata->reset_gpio_port[0], | |
| 198 | + GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | |
| 199 | + | |
| 200 | + if (gpio_is_valid(pdata->reset_gpio_port[1])) | |
| 201 | + gpio_request_one(pdata->reset_gpio_port[1], | |
| 202 | + GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | |
| 203 | + | |
| 204 | + /* Hold the PHY in RESET for enough time till DIR is high */ | |
| 205 | + udelay(10); | |
| 206 | + } | |
| 207 | + | |
| 194 | 208 | pm_runtime_enable(dev); |
| 195 | 209 | pm_runtime_get_sync(dev); |
| 196 | 210 | |
| @@ -237,6 +251,19 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 40 unmodified lines | ||
| 237 | 251 | /* root ports should always stay powered */ |
| 238 | 252 | ehci_port_power(omap_ehci, 1); |
| 239 | 253 | |
| 254 | + if (pdata->phy_reset) { | |
| 255 | + /* Hold the PHY in RESET for enough time till | |
| 256 | + * PHY is settled and ready | |
| 257 | + */ | |
| 258 | + udelay(10); | |
| 259 | + | |
| 260 | + if (gpio_is_valid(pdata->reset_gpio_port[0])) | |
| 261 | + gpio_set_value(pdata->reset_gpio_port[0], 1); | |
| 262 | + | |
| 263 | + if (gpio_is_valid(pdata->reset_gpio_port[1])) | |
| 264 | + gpio_set_value(pdata->reset_gpio_port[1], 1); | |
| 265 | + } | |
| 266 | + | |
| 240 | 267 | return 0; |
| 241 | 268 | |
| 242 | 269 | err_add_hcd: |
| @@ -259,8 +286,9 @@ err_io: · 16 unmodified lines | ||
| 259 | 286 | */ |
| 260 | 287 | static int ehci_hcd_omap_remove(struct platform_device *pdev) |
| 261 | 288 | { |
| 262 | − struct device *dev = &pdev->dev; | |
| 263 | − struct usb_hcd *hcd = dev_get_drvdata(dev); | |
| 289 | + struct device *dev = &pdev->dev; | |
| 290 | + struct usb_hcd *hcd = dev_get_drvdata(dev); | |
| 291 | + struct ehci_hcd_omap_platform_data *pdata = dev->platform_data; | |
| 264 | 292 | |
| 265 | 293 | usb_remove_hcd(hcd); |
| 266 | 294 | disable_put_regulator(dev->platform_data); |
| @@ -269,6 +297,13 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) · 2 unmodified lines | ||
| 269 | 297 | pm_runtime_put_sync(dev); |
| 270 | 298 | pm_runtime_disable(dev); |
| 271 | 299 | |
| 300 | + if (pdata->phy_reset) { | |
| 301 | + if (gpio_is_valid(pdata->reset_gpio_port[0])) | |
| 302 | + gpio_free(pdata->reset_gpio_port[0]); | |
| 303 | + | |
| 304 | + if (gpio_is_valid(pdata->reset_gpio_port[1])) | |
| 305 | + gpio_free(pdata->reset_gpio_port[1]); | |
| 306 | + } | |
| 272 | 307 | return 0; |
| 273 | 308 | } |
| 274 | 309 | |
| @@ -144,6 +144,14 @@ static int ehci_pci_setup(struct usb_hcd *hcd) · 143 unmodified lines | ||
| 144 | 144 | hcd->has_tt = 1; |
| 145 | 145 | tdi_reset(ehci); |
| 146 | 146 | } |
| 147 | + if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) { | |
| 148 | + /* EHCI #1 or #2 on 6 Series/C200 Series chipset */ | |
| 149 | + if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) { | |
| 150 | + ehci_info(ehci, "broken D3 during system sleep on ASUS\n"); | |
| 151 | + hcd->broken_pci_sleep = 1; | |
| 152 | + device_set_wakeup_capable(&pdev->dev, false); | |
| 153 | + } | |
| 154 | + } | |
| 147 | 155 | break; |
| 148 | 156 | case PCI_VENDOR_ID_TDI: |
| 149 | 157 | if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { |
| @@ -731,7 +731,6 @@ static int tegra_ehci_probe(struct platform_device *pdev) · 730 unmodified lines | ||
| 731 | 731 | err = -ENODEV; |
| 732 | 732 | goto fail; |
| 733 | 733 | } |
| 734 | − set_irq_flags(irq, IRQF_VALID); | |
| 735 | 734 | |
| 736 | 735 | #ifdef CONFIG_USB_OTG_UTILS |
| 737 | 736 | if (pdata->operating_mode == TEGRA_USB_OTG) { |
| @@ -94,7 +94,7 @@ static void at91_stop_hc(struct platform_device *pdev) · 93 unmodified lines | ||
| 94 | 94 | |
| 95 | 95 | /*-------------------------------------------------------------------------*/ |
| 96 | 96 | |
| 97 | −static void usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *); | |
| 97 | +static void __devexit usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *); | |
| 98 | 98 | |
| 99 | 99 | /* configure so an HC device and id are always provided */ |
| 100 | 100 | /* always called with process context; sleeping is OK */ |
| @@ -108,7 +108,7 @@ static void usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *); · 7 unmodified lines | ||
| 108 | 108 | * then invokes the start() method for the HCD associated with it |
| 109 | 109 | * through the hotplug entry's driver_data. |
| 110 | 110 | */ |
| 111 | −static int usb_hcd_at91_probe(const struct hc_driver *driver, | |
| 111 | +static int __devinit usb_hcd_at91_probe(const struct hc_driver *driver, | |
| 112 | 112 | struct platform_device *pdev) |
| 113 | 113 | { |
| 114 | 114 | int retval; |
| @@ -203,7 +203,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, · 88 unmodified lines | ||
| 203 | 203 | * context, "rmmod" or something similar. |
| 204 | 204 | * |
| 205 | 205 | */ |
| 206 | −static void usb_hcd_at91_remove(struct usb_hcd *hcd, | |
| 206 | +static void __devexit usb_hcd_at91_remove(struct usb_hcd *hcd, | |
| 207 | 207 | struct platform_device *pdev) |
| 208 | 208 | { |
| 209 | 209 | usb_remove_hcd(hcd); |
| @@ -545,7 +545,7 @@ static int __devinit ohci_at91_of_init(struct platform_device *pdev) · 335 unmodified lines | ||
| 545 | 545 | |
| 546 | 546 | /*-------------------------------------------------------------------------*/ |
| 547 | 547 | |
| 548 | −static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) | |
| 548 | +static int __devinit ohci_hcd_at91_drv_probe(struct platform_device *pdev) | |
| 549 | 549 | { |
| 550 | 550 | struct at91_usbh_data *pdata; |
| 551 | 551 | int i; |
| @@ -620,7 +620,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) · 68 unmodified lines | ||
| 620 | 620 | return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev); |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | −static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) | |
| 623 | +static int __devexit ohci_hcd_at91_drv_remove(struct platform_device *pdev) | |
| 624 | 624 | { |
| 625 | 625 | struct at91_usbh_data *pdata = pdev->dev.platform_data; |
| 626 | 626 | int i; |
| @@ -696,7 +696,7 @@ MODULE_ALIAS("platform:at91_ohci"); · 69 unmodified lines | ||
| 696 | 696 | |
| 697 | 697 | static struct platform_driver ohci_hcd_at91_driver = { |
| 698 | 698 | .probe = ohci_hcd_at91_drv_probe, |
| 699 | − .remove = ohci_hcd_at91_drv_remove, | |
| 699 | + .remove = __devexit_p(ohci_hcd_at91_drv_remove), | |
| 700 | 700 | .shutdown = usb_hcd_platform_shutdown, |
| 701 | 701 | .suspend = ohci_hcd_at91_drv_suspend, |
| 702 | 702 | .resume = ohci_hcd_at91_drv_resume, |
| @@ -423,7 +423,7 @@ alloc_sglist(int nents, int max, int vary) · 422 unmodified lines | ||
| 423 | 423 | unsigned i; |
| 424 | 424 | unsigned size = max; |
| 425 | 425 | |
| 426 | − sg = kmalloc(nents * sizeof *sg, GFP_KERNEL); | |
| 426 | + sg = kmalloc_array(nents, sizeof *sg, GFP_KERNEL); | |
| 427 | 427 | if (!sg) |
| 428 | 428 | return NULL; |
| 429 | 429 | sg_init_table(sg, nents); |
| @@ -904,6 +904,9 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param) · 474 unmodified lines | ||
| 904 | 904 | struct ctrl_ctx context; |
| 905 | 905 | int i; |
| 906 | 906 | |
| 907 | + if (param->sglen == 0 || param->iterations > UINT_MAX / param->sglen) | |
| 908 | + return -EOPNOTSUPP; | |
| 909 | + | |
| 907 | 910 | spin_lock_init(&context.lock); |
| 908 | 911 | context.dev = dev; |
| 909 | 912 | init_completion(&context.complete); |
| @@ -1981,8 +1984,6 @@ usbtest_ioctl(struct usb_interface *intf, unsigned int code, void *buf) · 1071 unmodified lines | ||
| 1981 | 1984 | |
| 1982 | 1985 | /* queued control messaging */ |
| 1983 | 1986 | case 10: |
| 1984 | − if (param->sglen == 0) | |
| 1985 | − break; | |
| 1986 | 1987 | retval = 0; |
| 1987 | 1988 | dev_info(&intf->dev, |
| 1988 | 1989 | "TEST 10: queue %d control calls, %d times\n", |
| @@ -2276,6 +2277,8 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id) · 287 unmodified lines | ||
| 2276 | 2277 | if (status < 0) { |
| 2277 | 2278 | WARNING(dev, "couldn't get endpoints, %d\n", |
| 2278 | 2279 | status); |
| 2280 | + kfree(dev->buf); | |
| 2281 | + kfree(dev); | |
| 2279 | 2282 | return status; |
| 2280 | 2283 | } |
| 2281 | 2284 | /* may find bulk or ISO pipes */ |
| @@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kref) · 98 unmodified lines | ||
| 99 | 99 | usb_put_dev(dev->udev); |
| 100 | 100 | if (dev->cntl_urb) { |
| 101 | 101 | usb_kill_urb(dev->cntl_urb); |
| 102 | − if (dev->cntl_req) | |
| 103 | − usb_free_coherent(dev->udev, YUREX_BUF_SIZE, | |
| 104 | − dev->cntl_req, dev->cntl_urb->setup_dma); | |
| 102 | + kfree(dev->cntl_req); | |
| 105 | 103 | if (dev->cntl_buffer) |
| 106 | 104 | usb_free_coherent(dev->udev, YUREX_BUF_SIZE, |
| 107 | 105 | dev->cntl_buffer, dev->cntl_urb->transfer_dma); |
| @@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ · 126 unmodified lines | ||
| 234 | 232 | } |
| 235 | 233 | |
| 236 | 234 | /* allocate buffer for control req */ |
| 237 | − dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, | |
| 238 | − GFP_KERNEL, | |
| 239 | − &dev->cntl_urb->setup_dma); | |
| 235 | + dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL); | |
| 240 | 236 | if (!dev->cntl_req) { |
| 241 | 237 | err("Could not allocate cntl_req"); |
| 242 | 238 | goto error; |
| @@ -286,7 +282,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ · 43 unmodified lines | ||
| 286 | 282 | usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr), |
| 287 | 283 | dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt, |
| 288 | 284 | dev, 1); |
| 289 | − dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | |
| 285 | + dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | |
| 290 | 286 | if (usb_submit_urb(dev->urb, GFP_KERNEL)) { |
| 291 | 287 | retval = -EIO; |
| 292 | 288 | err("Could not submitting URB"); |
| @@ -386,7 +386,7 @@ static int davinci_musb_init(struct musb *musb) · 385 unmodified lines | ||
| 386 | 386 | usb_nop_xceiv_register(); |
| 387 | 387 | musb->xceiv = usb_get_transceiver(); |
| 388 | 388 | if (!musb->xceiv) |
| 389 | − return -ENODEV; | |
| 389 | + goto unregister; | |
| 390 | 390 | |
| 391 | 391 | musb->mregs += DAVINCI_BASE_OFFSET; |
| 392 | 392 | |
| @@ -444,6 +444,7 @@ static int davinci_musb_init(struct musb *musb) · 51 unmodified lines | ||
| 444 | 444 | |
| 445 | 445 | fail: |
| 446 | 446 | usb_put_transceiver(musb->xceiv); |
| 447 | +unregister: | |
| 447 | 448 | usb_nop_xceiv_unregister(); |
| 448 | 449 | return -ENODEV; |
| 449 | 450 | } |
| @@ -137,6 +137,9 @@ static int musb_ulpi_read(struct usb_phy *phy, u32 offset) · 136 unmodified lines | ||
| 137 | 137 | int i = 0; |
| 138 | 138 | u8 r; |
| 139 | 139 | u8 power; |
| 140 | + int ret; | |
| 141 | + | |
| 142 | + pm_runtime_get_sync(phy->io_dev); | |
| 140 | 143 | |
| 141 | 144 | /* Make sure the transceiver is not in low power mode */ |
| 142 | 145 | power = musb_readb(addr, MUSB_POWER); |
| @@ -154,15 +157,22 @@ static int musb_ulpi_read(struct usb_phy *phy, u32 offset) · 11 unmodified lines | ||
| 154 | 157 | while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL) |
| 155 | 158 | & MUSB_ULPI_REG_CMPLT)) { |
| 156 | 159 | i++; |
| 157 | − if (i == 10000) | |
| 158 | − return -ETIMEDOUT; | |
| 160 | + if (i == 10000) { | |
| 161 | + ret = -ETIMEDOUT; | |
| 162 | + goto out; | |
| 163 | + } | |
| 159 | 164 | |
| 160 | 165 | } |
| 161 | 166 | r = musb_readb(addr, MUSB_ULPI_REG_CONTROL); |
| 162 | 167 | r &= ~MUSB_ULPI_REG_CMPLT; |
| 163 | 168 | musb_writeb(addr, MUSB_ULPI_REG_CONTROL, r); |
| 164 | 169 | |
| 165 | − return musb_readb(addr, MUSB_ULPI_REG_DATA); | |
| 170 | + ret = musb_readb(addr, MUSB_ULPI_REG_DATA); | |
| 171 | + | |
| 172 | +out: | |
| 173 | + pm_runtime_put(phy->io_dev); | |
| 174 | + | |
| 175 | + return ret; | |
| 166 | 176 | } |
| 167 | 177 | |
| 168 | 178 | static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) |
| @@ -171,6 +181,9 @@ static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) · 2 unmodified lines | ||
| 171 | 181 | int i = 0; |
| 172 | 182 | u8 r = 0; |
| 173 | 183 | u8 power; |
| 184 | + int ret = 0; | |
| 185 | + | |
| 186 | + pm_runtime_get_sync(phy->io_dev); | |
| 174 | 187 | |
| 175 | 188 | /* Make sure the transceiver is not in low power mode */ |
| 176 | 189 | power = musb_readb(addr, MUSB_POWER); |
| @@ -184,15 +197,20 @@ static int musb_ulpi_write(struct usb_phy *phy, u32 offset, u32 data) · 7 unmodified lines | ||
| 184 | 197 | while (!(musb_readb(addr, MUSB_ULPI_REG_CONTROL) |
| 185 | 198 | & MUSB_ULPI_REG_CMPLT)) { |
| 186 | 199 | i++; |
| 187 | − if (i == 10000) | |
| 188 | − return -ETIMEDOUT; | |
| 200 | + if (i == 10000) { | |
| 201 | + ret = -ETIMEDOUT; | |
| 202 | + goto out; | |
| 203 | + } | |
| 189 | 204 | } |
| 190 | 205 | |
| 191 | 206 | r = musb_readb(addr, MUSB_ULPI_REG_CONTROL); |
| 192 | 207 | r &= ~MUSB_ULPI_REG_CMPLT; |
| 193 | 208 | musb_writeb(addr, MUSB_ULPI_REG_CONTROL, r); |
| 194 | 209 | |
| 195 | − return 0; | |
| 210 | +out: | |
| 211 | + pm_runtime_put(phy->io_dev); | |
| 212 | + | |
| 213 | + return ret; | |
| 196 | 214 | } |
| 197 | 215 | #else |
| 198 | 216 | #define musb_ulpi_read NULL |
| @@ -1904,14 +1922,17 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 1705 unmodified lines | ||
| 1904 | 1922 | |
| 1905 | 1923 | if (!musb->isr) { |
| 1906 | 1924 | status = -ENODEV; |
| 1907 | − goto fail3; | |
| 1925 | + goto fail2; | |
| 1908 | 1926 | } |
| 1909 | 1927 | |
| 1910 | 1928 | if (!musb->xceiv->io_ops) { |
| 1929 | + musb->xceiv->io_dev = musb->controller; | |
| 1911 | 1930 | musb->xceiv->io_priv = musb->mregs; |
| 1912 | 1931 | musb->xceiv->io_ops = &musb_ulpi_access; |
| 1913 | 1932 | } |
| 1914 | 1933 | |
| 1934 | + pm_runtime_get_sync(musb->controller); | |
| 1935 | + | |
| 1915 | 1936 | #ifndef CONFIG_MUSB_PIO_ONLY |
| 1916 | 1937 | if (use_dma && dev->dma_mask) { |
| 1917 | 1938 | struct dma_controller *c; |
| @@ -2023,6 +2044,8 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 105 unmodified lines | ||
| 2023 | 2044 | goto fail5; |
| 2024 | 2045 | #endif |
| 2025 | 2046 | |
| 2047 | + pm_runtime_put(musb->controller); | |
| 2048 | + | |
| 2026 | 2049 | dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n", |
| 2027 | 2050 | ({char *s; |
| 2028 | 2051 | switch (musb->board_mode) { |
| @@ -2047,6 +2070,9 @@ fail4: · 18 unmodified lines | ||
| 2047 | 2070 | musb_gadget_cleanup(musb); |
| 2048 | 2071 | |
| 2049 | 2072 | fail3: |
| 2073 | + pm_runtime_put_sync(musb->controller); | |
| 2074 | + | |
| 2075 | +fail2: | |
| 2050 | 2076 | if (musb->irq_wake) |
| 2051 | 2077 | device_init_wakeup(dev, 0); |
| 2052 | 2078 | musb_platform_exit(musb); |
| @@ -449,7 +449,7 @@ struct musb { · 448 unmodified lines | ||
| 449 | 449 | * We added this flag to forcefully disable double |
| 450 | 450 | * buffering until we get it working. |
| 451 | 451 | */ |
| 452 | − unsigned double_buffer_not_ok:1 __deprecated; | |
| 452 | + unsigned double_buffer_not_ok:1; | |
| 453 | 453 | |
| 454 | 454 | struct musb_hdrc_config *config; |
| 455 | 455 | |
| @@ -2098,7 +2098,7 @@ static int musb_cleanup_urb(struct urb *urb, struct musb_qh *qh) · 2097 unmodified lines | ||
| 2098 | 2098 | } |
| 2099 | 2099 | |
| 2100 | 2100 | /* turn off DMA requests, discard state, stop polling ... */ |
| 2101 | − if (is_in) { | |
| 2101 | + if (ep->epnum && is_in) { | |
| 2102 | 2102 | /* giveback saves bulk toggle */ |
| 2103 | 2103 | csr = musb_h_flush_rxfifo(ep, 0); |
| 2104 | 2104 | |
| @@ -282,7 +282,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) · 281 unmodified lines | ||
| 282 | 282 | |
| 283 | 283 | static int omap2430_musb_init(struct musb *musb) |
| 284 | 284 | { |
| 285 | − u32 l, status = 0; | |
| 285 | + u32 l; | |
| 286 | + int status = 0; | |
| 286 | 287 | struct device *dev = musb->controller; |
| 287 | 288 | struct musb_hdrc_platform_data *plat = dev->platform_data; |
| 288 | 289 | struct omap_musb_board_data *data = plat->board_data; |
| @@ -301,7 +302,7 @@ static int omap2430_musb_init(struct musb *musb) · 12 unmodified lines | ||
| 301 | 302 | |
| 302 | 303 | status = pm_runtime_get_sync(dev); |
| 303 | 304 | if (status < 0) { |
| 304 | − dev_err(dev, "pm_runtime_get_sync FAILED"); | |
| 305 | + dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); | |
| 305 | 306 | goto err1; |
| 306 | 307 | } |
| 307 | 308 | |
| @@ -333,6 +334,7 @@ static int omap2430_musb_init(struct musb *musb) · 25 unmodified lines | ||
| 333 | 334 | |
| 334 | 335 | setup_timer(&musb_idle_timer, musb_do_idle, (unsigned long) musb); |
| 335 | 336 | |
| 337 | + pm_runtime_put_noidle(musb->controller); | |
| 336 | 338 | return 0; |
| 337 | 339 | |
| 338 | 340 | err1: |
| @@ -452,14 +454,14 @@ static int __devinit omap2430_probe(struct platform_device *pdev) · 113 unmodified lines | ||
| 452 | 454 | goto err2; |
| 453 | 455 | } |
| 454 | 456 | |
| 457 | + pm_runtime_enable(&pdev->dev); | |
| 458 | + | |
| 455 | 459 | ret = platform_device_add(musb); |
| 456 | 460 | if (ret) { |
| 457 | 461 | dev_err(&pdev->dev, "failed to register musb device\n"); |
| 458 | 462 | goto err2; |
| 459 | 463 | } |
| 460 | 464 | |
| 461 | − pm_runtime_enable(&pdev->dev); | |
| 462 | − | |
| 463 | 465 | return 0; |
| 464 | 466 | |
| 465 | 467 | err2: |
| @@ -478,7 +480,6 @@ static int __devexit omap2430_remove(struct platform_device *pdev) · 12 unmodified lines | ||
| 478 | 480 | |
| 479 | 481 | platform_device_del(glue->musb); |
| 480 | 482 | platform_device_put(glue->musb); |
| 481 | − pm_runtime_put(&pdev->dev); | |
| 482 | 483 | kfree(glue); |
| 483 | 484 | |
| 484 | 485 | return 0; |
| @@ -491,11 +492,13 @@ static int omap2430_runtime_suspend(struct device *dev) · 6 unmodified lines | ||
| 491 | 492 | struct omap2430_glue *glue = dev_get_drvdata(dev); |
| 492 | 493 | struct musb *musb = glue_to_musb(glue); |
| 493 | 494 | |
| 494 | − musb->context.otg_interfsel = musb_readl(musb->mregs, | |
| 495 | − OTG_INTERFSEL); | |
| 495 | + if (musb) { | |
| 496 | + musb->context.otg_interfsel = musb_readl(musb->mregs, | |
| 497 | + OTG_INTERFSEL); | |
| 496 | 498 | |
| 497 | − omap2430_low_level_exit(musb); | |
| 498 | − usb_phy_set_suspend(musb->xceiv, 1); | |
| 499 | + omap2430_low_level_exit(musb); | |
| 500 | + usb_phy_set_suspend(musb->xceiv, 1); | |
| 501 | + } | |
| 499 | 502 | |
| 500 | 503 | return 0; |
| 501 | 504 | } |
| @@ -505,11 +508,13 @@ static int omap2430_runtime_resume(struct device *dev) · 3 unmodified lines | ||
| 505 | 508 | struct omap2430_glue *glue = dev_get_drvdata(dev); |
| 506 | 509 | struct musb *musb = glue_to_musb(glue); |
| 507 | 510 | |
| 508 | − omap2430_low_level_init(musb); | |
| 509 | − musb_writel(musb->mregs, OTG_INTERFSEL, | |
| 510 | − musb->context.otg_interfsel); | |
| 511 | + if (musb) { | |
| 512 | + omap2430_low_level_init(musb); | |
| 513 | + musb_writel(musb->mregs, OTG_INTERFSEL, | |
| 514 | + musb->context.otg_interfsel); | |
| 511 | 515 | |
| 512 | − usb_phy_set_suspend(musb->xceiv, 0); | |
| 516 | + usb_phy_set_suspend(musb->xceiv, 0); | |
| 517 | + } | |
| 513 | 518 | |
| 514 | 519 | return 0; |
| 515 | 520 | } |
| @@ -96,7 +96,7 @@ static void gpio_vbus_work(struct work_struct *work) · 95 unmodified lines | ||
| 96 | 96 | struct gpio_vbus_data *gpio_vbus = |
| 97 | 97 | container_of(work, struct gpio_vbus_data, work); |
| 98 | 98 | struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data; |
| 99 | − int gpio; | |
| 99 | + int gpio, status; | |
| 100 | 100 | |
| 101 | 101 | if (!gpio_vbus->phy.otg->gadget) |
| 102 | 102 | return; |
| @@ -108,7 +108,9 @@ static void gpio_vbus_work(struct work_struct *work) · 5 unmodified lines | ||
| 108 | 108 | */ |
| 109 | 109 | gpio = pdata->gpio_pullup; |
| 110 | 110 | if (is_vbus_powered(pdata)) { |
| 111 | + status = USB_EVENT_VBUS; | |
| 111 | 112 | gpio_vbus->phy.state = OTG_STATE_B_PERIPHERAL; |
| 113 | + gpio_vbus->phy.last_event = status; | |
| 112 | 114 | usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget); |
| 113 | 115 | |
| 114 | 116 | /* drawing a "unit load" is *always* OK, except for OTG */ |
| @@ -117,6 +119,9 @@ static void gpio_vbus_work(struct work_struct *work) · 2 unmodified lines | ||
| 117 | 119 | /* optionally enable D+ pullup */ |
| 118 | 120 | if (gpio_is_valid(gpio)) |
| 119 | 121 | gpio_set_value(gpio, !pdata->gpio_pullup_inverted); |
| 122 | + | |
| 123 | + atomic_notifier_call_chain(&gpio_vbus->phy.notifier, | |
| 124 | + status, gpio_vbus->phy.otg->gadget); | |
| 120 | 125 | } else { |
| 121 | 126 | /* optionally disable D+ pullup */ |
| 122 | 127 | if (gpio_is_valid(gpio)) |
| @@ -125,7 +130,12 @@ static void gpio_vbus_work(struct work_struct *work) · 2 unmodified lines | ||
| 125 | 130 | set_vbus_draw(gpio_vbus, 0); |
| 126 | 131 | |
| 127 | 132 | usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget); |
| 133 | + status = USB_EVENT_NONE; | |
| 128 | 134 | gpio_vbus->phy.state = OTG_STATE_B_IDLE; |
| 135 | + gpio_vbus->phy.last_event = status; | |
| 136 | + | |
| 137 | + atomic_notifier_call_chain(&gpio_vbus->phy.notifier, | |
| 138 | + status, gpio_vbus->phy.otg->gadget); | |
| 129 | 139 | } |
| 130 | 140 | } |
| 131 | 141 | |
| @@ -287,6 +297,9 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) · 155 unmodified lines | ||
| 287 | 297 | irq, err); |
| 288 | 298 | goto err_irq; |
| 289 | 299 | } |
| 300 | + | |
| 301 | + ATOMIC_INIT_NOTIFIER_HEAD(&gpio_vbus->phy.notifier); | |
| 302 | + | |
| 290 | 303 | INIT_WORK(&gpio_vbus->work, gpio_vbus_work); |
| 291 | 304 | |
| 292 | 305 | gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw"); |
| @@ -287,7 +287,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request, · 286 unmodified lines | ||
| 287 | 287 | /* Issue the request, attempting to read 'size' bytes */ |
| 288 | 288 | result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), |
| 289 | 289 | request, REQTYPE_DEVICE_TO_HOST, 0x0000, |
| 290 | − port_priv->bInterfaceNumber, buf, size, 300); | |
| 290 | + port_priv->bInterfaceNumber, buf, size, | |
| 291 | + USB_CTRL_GET_TIMEOUT); | |
| 291 | 292 | |
| 292 | 293 | /* Convert data into an array of integers */ |
| 293 | 294 | for (i = 0; i < length; i++) |
| @@ -340,12 +341,14 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request, · 46 unmodified lines | ||
| 340 | 341 | result = usb_control_msg(serial->dev, |
| 341 | 342 | usb_sndctrlpipe(serial->dev, 0), |
| 342 | 343 | request, REQTYPE_HOST_TO_DEVICE, 0x0000, |
| 343 | − port_priv->bInterfaceNumber, buf, size, 300); | |
| 344 | + port_priv->bInterfaceNumber, buf, size, | |
| 345 | + USB_CTRL_SET_TIMEOUT); | |
| 344 | 346 | } else { |
| 345 | 347 | result = usb_control_msg(serial->dev, |
| 346 | 348 | usb_sndctrlpipe(serial->dev, 0), |
| 347 | 349 | request, REQTYPE_HOST_TO_DEVICE, data[0], |
| 348 | − port_priv->bInterfaceNumber, NULL, 0, 300); | |
| 350 | + port_priv->bInterfaceNumber, NULL, 0, | |
| 351 | + USB_CTRL_SET_TIMEOUT); | |
| 349 | 352 | } |
| 350 | 353 | |
| 351 | 354 | kfree(buf); |
| @@ -221,7 +221,7 @@ static const struct sierra_iface_info typeB_interface_list = { · 220 unmodified lines | ||
| 221 | 221 | }; |
| 222 | 222 | |
| 223 | 223 | /* 'blacklist' of interfaces not served by this driver */ |
| 224 | −static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11 }; | |
| 224 | +static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11, 19, 20 }; | |
| 225 | 225 | static const struct sierra_iface_info direct_ip_interface_blacklist = { |
| 226 | 226 | .infolen = ARRAY_SIZE(direct_ip_non_serial_ifaces), |
| 227 | 227 | .ifaceinfo = direct_ip_non_serial_ifaces, |
| @@ -289,7 +289,6 @@ static const struct usb_device_id id_table[] = { · 61 unmodified lines | ||
| 289 | 289 | { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */ |
| 290 | 290 | { USB_DEVICE(0x1199, 0x6859) }, /* Sierra Wireless AirCard 885 E */ |
| 291 | 291 | { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */ |
| 292 | − { USB_DEVICE(0x1199, 0x68A2) }, /* Sierra Wireless MC7710 */ | |
| 293 | 292 | /* Sierra Wireless C885 */ |
| 294 | 293 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)}, |
| 295 | 294 | /* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */ |
| @@ -299,6 +298,9 @@ static const struct usb_device_id id_table[] = { · 3 unmodified lines | ||
| 299 | 298 | /* Sierra Wireless HSPA Non-Composite Device */ |
| 300 | 299 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)}, |
| 301 | 300 | { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */ |
| 301 | + { USB_DEVICE(0x1199, 0x68A2), /* Sierra Wireless MC77xx in QMI mode */ | |
| 302 | + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | |
| 303 | + }, | |
| 302 | 304 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ |
| 303 | 305 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
| 304 | 306 | }, |
| @@ -645,7 +645,8 @@ void hwarc_neep_cb(struct urb *urb) · 644 unmodified lines | ||
| 645 | 645 | dev_err(dev, "NEEP: URB error %d\n", urb->status); |
| 646 | 646 | } |
| 647 | 647 | result = usb_submit_urb(urb, GFP_ATOMIC); |
| 648 | − if (result < 0) { | |
| 648 | + if (result < 0 && result != -ENODEV && result != -EPERM) { | |
| 649 | + /* ignoring unrecoverable errors */ | |
| 649 | 650 | dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n", |
| 650 | 651 | result); |
| 651 | 652 | goto error; |
| @@ -107,6 +107,7 @@ struct uwb_rc_neh { · 106 unmodified lines | ||
| 107 | 107 | u8 evt_type; |
| 108 | 108 | __le16 evt; |
| 109 | 109 | u8 context; |
| 110 | + u8 completed; | |
| 110 | 111 | uwb_rc_cmd_cb_f cb; |
| 111 | 112 | void *arg; |
| 112 | 113 | |
| @@ -409,6 +410,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size · 296 unmodified lines | ||
| 409 | 410 | struct device *dev = &rc->uwb_dev.dev; |
| 410 | 411 | struct uwb_rc_neh *neh; |
| 411 | 412 | struct uwb_rceb *notif; |
| 413 | + unsigned long flags; | |
| 412 | 414 | |
| 413 | 415 | if (rceb->bEventContext == 0) { |
| 414 | 416 | notif = kmalloc(size, GFP_ATOMIC); |
| @@ -422,7 +424,11 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size · 7 unmodified lines | ||
| 422 | 424 | } else { |
| 423 | 425 | neh = uwb_rc_neh_lookup(rc, rceb); |
| 424 | 426 | if (neh) { |
| 425 | − del_timer_sync(&neh->timer); | |
| 427 | + spin_lock_irqsave(&rc->neh_lock, flags); | |
| 428 | + /* to guard against a timeout */ | |
| 429 | + neh->completed = 1; | |
| 430 | + del_timer(&neh->timer); | |
| 431 | + spin_unlock_irqrestore(&rc->neh_lock, flags); | |
| 426 | 432 | uwb_rc_neh_cb(neh, rceb, size); |
| 427 | 433 | } else |
| 428 | 434 | dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n", |
| @@ -568,6 +574,10 @@ static void uwb_rc_neh_timer(unsigned long arg) · 139 unmodified lines | ||
| 568 | 574 | unsigned long flags; |
| 569 | 575 | |
| 570 | 576 | spin_lock_irqsave(&rc->neh_lock, flags); |
| 577 | + if (neh->completed) { | |
| 578 | + spin_unlock_irqrestore(&rc->neh_lock, flags); | |
| 579 | + return; | |
| 580 | + } | |
| 571 | 581 | if (neh->context) |
| 572 | 582 | __uwb_rc_neh_rm(rc, neh); |
| 573 | 583 | else |
| @@ -238,7 +238,7 @@ static void handle_tx(struct vhost_net *net) · 237 unmodified lines | ||
| 238 | 238 | |
| 239 | 239 | vq->heads[vq->upend_idx].len = len; |
| 240 | 240 | ubuf->callback = vhost_zerocopy_callback; |
| 241 | − ubuf->arg = vq->ubufs; | |
| 241 | + ubuf->ctx = vq->ubufs; | |
| 242 | 242 | ubuf->desc = vq->upend_idx; |
| 243 | 243 | msg.msg_control = ubuf; |
| 244 | 244 | msg.msg_controllen = sizeof(ubuf); |
| @@ -155,7 +155,7 @@ static int vhost_test_release(struct inode *inode, struct file *f) · 154 unmodified lines | ||
| 155 | 155 | |
| 156 | 156 | vhost_test_stop(n, &private); |
| 157 | 157 | vhost_test_flush(n); |
| 158 | − vhost_dev_cleanup(&n->dev); | |
| 158 | + vhost_dev_cleanup(&n->dev, false); | |
| 159 | 159 | /* We do an extra flush before freeing memory, |
| 160 | 160 | * since jobs can re-queue themselves. */ |
| 161 | 161 | vhost_test_flush(n); |
| @@ -1598,10 +1598,9 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs) · 1597 unmodified lines | ||
| 1598 | 1598 | kfree(ubufs); |
| 1599 | 1599 | } |
| 1600 | 1600 | |
| 1601 | −void vhost_zerocopy_callback(void *arg) | |
| 1601 | +void vhost_zerocopy_callback(struct ubuf_info *ubuf) | |
| 1602 | 1602 | { |
| 1603 | − struct ubuf_info *ubuf = arg; | |
| 1604 | − struct vhost_ubuf_ref *ubufs = ubuf->arg; | |
| 1603 | + struct vhost_ubuf_ref *ubufs = ubuf->ctx; | |
| 1605 | 1604 | struct vhost_virtqueue *vq = ubufs->vq; |
| 1606 | 1605 | |
| 1607 | 1606 | /* set len = 1 to mark this desc buffers done DMA */ |
| @@ -188,7 +188,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *); · 187 unmodified lines | ||
| 188 | 188 | |
| 189 | 189 | int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, |
| 190 | 190 | unsigned int log_num, u64 len); |
| 191 | −void vhost_zerocopy_callback(void *arg); | |
| 191 | +void vhost_zerocopy_callback(struct ubuf_info *); | |
| 192 | 192 | int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq); |
| 193 | 193 | |
| 194 | 194 | #define vq_err(vq, fmt, ...) do { \ |
| @@ -13,6 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <linux/errno.h> |
| 14 | 14 | #include <linux/string.h> |
| 15 | 15 | #include <linux/fb.h> |
| 16 | +#include <linux/gpio.h> | |
| 16 | 17 | #include <linux/slab.h> |
| 17 | 18 | #include <linux/init.h> |
| 18 | 19 | #include <linux/types.h> |
| @@ -28,6 +28,13 @@ · 27 unmodified lines | ||
| 28 | 28 | #include <linux/slab.h> |
| 29 | 29 | #include <linux/module.h> |
| 30 | 30 | |
| 31 | +/* | |
| 32 | + * Balloon device works in 4K page units. So each page is pointed to by | |
| 33 | + * multiple balloon pages. All memory counters in this driver are in balloon | |
| 34 | + * page units. | |
| 35 | + */ | |
| 36 | +#define VIRTIO_BALLOON_PAGES_PER_PAGE (PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT) | |
| 37 | + | |
| 31 | 38 | struct virtio_balloon |
| 32 | 39 | { |
| 33 | 40 | struct virtio_device *vdev; |
| @@ -42,8 +49,13 @@ struct virtio_balloon · 8 unmodified lines | ||
| 42 | 49 | /* Waiting for host to ack the pages we released. */ |
| 43 | 50 | struct completion acked; |
| 44 | 51 | |
| 45 | − /* The pages we've told the Host we're not using. */ | |
| 52 | + /* Number of balloon pages we've told the Host we're not using. */ | |
| 46 | 53 | unsigned int num_pages; |
| 54 | + /* | |
| 55 | + * The pages we've told the Host we're not using. | |
| 56 | + * Each page on this list adds VIRTIO_BALLOON_PAGES_PER_PAGE | |
| 57 | + * to num_pages above. | |
| 58 | + */ | |
| 47 | 59 | struct list_head pages; |
| 48 | 60 | |
| 49 | 61 | /* The array of pfns we tell the Host about. */ |
| @@ -66,7 +78,13 @@ static u32 page_to_balloon_pfn(struct page *page) · 16 unmodified lines | ||
| 66 | 78 | |
| 67 | 79 | BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT); |
| 68 | 80 | /* Convert pfn from Linux page size to balloon page size. */ |
| 69 | − return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT); | |
| 81 | + return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE; | |
| 82 | +} | |
| 83 | + | |
| 84 | +static struct page *balloon_pfn_to_page(u32 pfn) | |
| 85 | +{ | |
| 86 | + BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE); | |
| 87 | + return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE); | |
| 70 | 88 | } |
| 71 | 89 | |
| 72 | 90 | static void balloon_ack(struct virtqueue *vq) |
| @@ -96,12 +114,23 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) · 23 unmodified lines | ||
| 96 | 114 | wait_for_completion(&vb->acked); |
| 97 | 115 | } |
| 98 | 116 | |
| 117 | +static void set_page_pfns(u32 pfns[], struct page *page) | |
| 118 | +{ | |
| 119 | + unsigned int i; | |
| 120 | + | |
| 121 | + /* Set balloon pfns pointing at this page. | |
| 122 | + * Note that the first pfn points at start of the page. */ | |
| 123 | + for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++) | |
| 124 | + pfns[i] = page_to_balloon_pfn(page) + i; | |
| 125 | +} | |
| 126 | + | |
| 99 | 127 | static void fill_balloon(struct virtio_balloon *vb, size_t num) |
| 100 | 128 | { |
| 101 | 129 | /* We can only do one array worth at a time. */ |
| 102 | 130 | num = min(num, ARRAY_SIZE(vb->pfns)); |
| 103 | 131 | |
| 104 | − for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) { | |
| 132 | + for (vb->num_pfns = 0; vb->num_pfns < num; | |
| 133 | + vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { | |
| 105 | 134 | struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY | |
| 106 | 135 | __GFP_NOMEMALLOC | __GFP_NOWARN); |
| 107 | 136 | if (!page) { |
| @@ -113,9 +142,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num) · 5 unmodified lines | ||
| 113 | 142 | msleep(200); |
| 114 | 143 | break; |
| 115 | 144 | } |
| 116 | − vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page); | |
| 145 | + set_page_pfns(vb->pfns + vb->num_pfns, page); | |
| 146 | + vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE; | |
| 117 | 147 | totalram_pages--; |
| 118 | − vb->num_pages++; | |
| 119 | 148 | list_add(&page->lru, &vb->pages); |
| 120 | 149 | } |
| 121 | 150 | |
| @@ -130,8 +159,9 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num) · 8 unmodified lines | ||
| 130 | 159 | { |
| 131 | 160 | unsigned int i; |
| 132 | 161 | |
| 133 | − for (i = 0; i < num; i++) { | |
| 134 | − __free_page(pfn_to_page(pfns[i])); | |
| 162 | + /* Find pfns pointing at start of each page, get pages and free them. */ | |
| 163 | + for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) { | |
| 164 | + __free_page(balloon_pfn_to_page(pfns[i])); | |
| 135 | 165 | totalram_pages++; |
| 136 | 166 | } |
| 137 | 167 | } |
| @@ -143,11 +173,12 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num) · 5 unmodified lines | ||
| 143 | 173 | /* We can only do one array worth at a time. */ |
| 144 | 174 | num = min(num, ARRAY_SIZE(vb->pfns)); |
| 145 | 175 | |
| 146 | − for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) { | |
| 176 | + for (vb->num_pfns = 0; vb->num_pfns < num; | |
| 177 | + vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { | |
| 147 | 178 | page = list_first_entry(&vb->pages, struct page, lru); |
| 148 | 179 | list_del(&page->lru); |
| 149 | − vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page); | |
| 150 | − vb->num_pages--; | |
| 180 | + set_page_pfns(vb->pfns + vb->num_pfns, page); | |
| 181 | + vb->num_pages -= VIRTIO_BALLOON_PAGES_PER_PAGE; | |
| 151 | 182 | } |
| 152 | 183 | |
| 153 | 184 | /* |
| @@ -234,11 +265,14 @@ static void virtballoon_changed(struct virtio_device *vdev) · 80 unmodified lines | ||
| 234 | 265 | |
| 235 | 266 | static inline s64 towards_target(struct virtio_balloon *vb) |
| 236 | 267 | { |
| 237 | − u32 v; | |
| 268 | + __le32 v; | |
| 269 | + s64 target; | |
| 270 | + | |
| 238 | 271 | vb->vdev->config->get(vb->vdev, |
| 239 | 272 | offsetof(struct virtio_balloon_config, num_pages), |
| 240 | 273 | &v, sizeof(v)); |
| 241 | − return (s64)v - vb->num_pages; | |
| 274 | + target = le32_to_cpu(v); | |
| 275 | + return target - vb->num_pages; | |
| 242 | 276 | } |
| 243 | 277 | |
| 244 | 278 | static void update_balloon_size(struct virtio_balloon *vb) |
| @@ -435,16 +435,16 @@ static void hpwdt_start(void) · 434 unmodified lines | ||
| 435 | 435 | { |
| 436 | 436 | reload = SECS_TO_TICKS(soft_margin); |
| 437 | 437 | iowrite16(reload, hpwdt_timer_reg); |
| 438 | − iowrite16(0x85, hpwdt_timer_con); | |
| 438 | + iowrite8(0x85, hpwdt_timer_con); | |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | static void hpwdt_stop(void) |
| 442 | 442 | { |
| 443 | 443 | unsigned long data; |
| 444 | 444 | |
| 445 | − data = ioread16(hpwdt_timer_con); | |
| 445 | + data = ioread8(hpwdt_timer_con); | |
| 446 | 446 | data &= 0xFE; |
| 447 | − iowrite16(data, hpwdt_timer_con); | |
| 447 | + iowrite8(data, hpwdt_timer_con); | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | static void hpwdt_ping(void) |
| @@ -274,7 +274,7 @@ static unsigned int cpu_from_evtchn(unsigned int evtchn) · 273 unmodified lines | ||
| 274 | 274 | |
| 275 | 275 | static bool pirq_check_eoi_map(unsigned irq) |
| 276 | 276 | { |
| 277 | − return test_bit(irq, pirq_eoi_map); | |
| 277 | + return test_bit(pirq_from_irq(irq), pirq_eoi_map); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | static bool pirq_needs_eoi_flag(unsigned irq) |
| @@ -722,7 +722,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) · 721 unmodified lines | ||
| 722 | 722 | vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND; |
| 723 | 723 | |
| 724 | 724 | if (use_ptemod) |
| 725 | − vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP; | |
| 725 | + vma->vm_flags |= VM_DONTCOPY; | |
| 726 | 726 | |
| 727 | 727 | vma->vm_private_data = map; |
| 728 | 728 | |
| @@ -1029,6 +1029,7 @@ int gnttab_init(void) · 1028 unmodified lines | ||
| 1029 | 1029 | int i; |
| 1030 | 1030 | unsigned int max_nr_glist_frames, nr_glist_frames; |
| 1031 | 1031 | unsigned int nr_init_grefs; |
| 1032 | + int ret; | |
| 1032 | 1033 | |
| 1033 | 1034 | nr_grant_frames = 1; |
| 1034 | 1035 | boot_max_nr_grant_frames = __max_nr_grant_frames(); |
| @@ -1047,12 +1048,16 @@ int gnttab_init(void) · 12 unmodified lines | ||
| 1047 | 1048 | nr_glist_frames = (nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP; |
| 1048 | 1049 | for (i = 0; i < nr_glist_frames; i++) { |
| 1049 | 1050 | gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_KERNEL); |
| 1050 | − if (gnttab_list[i] == NULL) | |
| 1051 | + if (gnttab_list[i] == NULL) { | |
| 1052 | + ret = -ENOMEM; | |
| 1051 | 1053 | goto ini_nomem; |
| 1054 | + } | |
| 1052 | 1055 | } |
| 1053 | 1056 | |
| 1054 | − if (gnttab_resume() < 0) | |
| 1055 | − return -ENODEV; | |
| 1057 | + if (gnttab_resume() < 0) { | |
| 1058 | + ret = -ENODEV; | |
| 1059 | + goto ini_nomem; | |
| 1060 | + } | |
| 1056 | 1061 | |
| 1057 | 1062 | nr_init_grefs = nr_grant_frames * GREFS_PER_GRANT_FRAME; |
| 1058 | 1063 | |
| @@ -1070,7 +1075,7 @@ int gnttab_init(void) · 11 unmodified lines | ||
| 1070 | 1075 | for (i--; i >= 0; i--) |
| 1071 | 1076 | free_page((unsigned long)gnttab_list[i]); |
| 1072 | 1077 | kfree(gnttab_list); |
| 1073 | − return -ENOMEM; | |
| 1078 | + return ret; | |
| 1074 | 1079 | } |
| 1075 | 1080 | EXPORT_SYMBOL_GPL(gnttab_init); |
| 1076 | 1081 | |
| @@ -132,6 +132,7 @@ static void do_suspend(void) · 131 unmodified lines | ||
| 132 | 132 | err = dpm_suspend_end(PMSG_FREEZE); |
| 133 | 133 | if (err) { |
| 134 | 134 | printk(KERN_ERR "dpm_suspend_end failed: %d\n", err); |
| 135 | + si.cancelled = 0; | |
| 135 | 136 | goto out_resume; |
| 136 | 137 | } |
| 137 | 138 | |
| @@ -128,7 +128,10 @@ static int push_cxx_to_hypervisor(struct acpi_processor *_pr) · 127 unmodified lines | ||
| 128 | 128 | pr_debug(" C%d: %s %d uS\n", |
| 129 | 129 | cx->type, cx->desc, (u32)cx->latency); |
| 130 | 130 | } |
| 131 | − } else | |
| 131 | + } else if (ret != -EINVAL) | |
| 132 | + /* EINVAL means the ACPI ID is incorrect - meaning the ACPI | |
| 133 | + * table is referencing a non-existing CPU - which can happen | |
| 134 | + * with broken ACPI tables. */ | |
| 132 | 135 | pr_err(DRV_NAME "(CX): Hypervisor error (%d) for ACPI CPU%u\n", |
| 133 | 136 | ret, _pr->acpi_id); |
| 134 | 137 | |
| @@ -135,7 +135,7 @@ static int read_backend_details(struct xenbus_device *xendev) · 134 unmodified lines | ||
| 135 | 135 | return xenbus_read_otherend_details(xendev, "backend-id", "backend"); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | −static int is_device_connecting(struct device *dev, void *data) | |
| 138 | +static int is_device_connecting(struct device *dev, void *data, bool ignore_nonessential) | |
| 139 | 139 | { |
| 140 | 140 | struct xenbus_device *xendev = to_xenbus_device(dev); |
| 141 | 141 | struct device_driver *drv = data; |
| @@ -152,16 +152,41 @@ static int is_device_connecting(struct device *dev, void *data) · 10 unmodified lines | ||
| 152 | 152 | if (drv && (dev->driver != drv)) |
| 153 | 153 | return 0; |
| 154 | 154 | |
| 155 | + if (ignore_nonessential) { | |
| 156 | + /* With older QEMU, for PVonHVM guests the guest config files | |
| 157 | + * could contain: vfb = [ 'vnc=1, vnclisten=0.0.0.0'] | |
| 158 | + * which is nonsensical as there is no PV FB (there can be | |
| 159 | + * a PVKB) running as HVM guest. */ | |
| 160 | + | |
| 161 | + if ((strncmp(xendev->nodename, "device/vkbd", 11) == 0)) | |
| 162 | + return 0; | |
| 163 | + | |
| 164 | + if ((strncmp(xendev->nodename, "device/vfb", 10) == 0)) | |
| 165 | + return 0; | |
| 166 | + } | |
| 155 | 167 | xendrv = to_xenbus_driver(dev->driver); |
| 156 | 168 | return (xendev->state < XenbusStateConnected || |
| 157 | 169 | (xendev->state == XenbusStateConnected && |
| 158 | 170 | xendrv->is_ready && !xendrv->is_ready(xendev))); |
| 159 | 171 | } |
| 172 | +static int essential_device_connecting(struct device *dev, void *data) | |
| 173 | +{ | |
| 174 | + return is_device_connecting(dev, data, true /* ignore PV[KBB+FB] */); | |
| 175 | +} | |
| 176 | +static int non_essential_device_connecting(struct device *dev, void *data) | |
| 177 | +{ | |
| 178 | + return is_device_connecting(dev, data, false); | |
| 179 | +} | |
| 160 | 180 | |
| 161 | −static int exists_connecting_device(struct device_driver *drv) | |
| 181 | +static int exists_essential_connecting_device(struct device_driver *drv) | |
| 162 | 182 | { |
| 163 | 183 | return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv, |
| 164 | − is_device_connecting); | |
| 184 | + essential_device_connecting); | |
| 185 | +} | |
| 186 | +static int exists_non_essential_connecting_device(struct device_driver *drv) | |
| 187 | +{ | |
| 188 | + return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv, | |
| 189 | + non_essential_device_connecting); | |
| 165 | 190 | } |
| 166 | 191 | |
| 167 | 192 | static int print_device_status(struct device *dev, void *data) |
| @@ -192,6 +217,23 @@ static int print_device_status(struct device *dev, void *data) · 24 unmodified lines | ||
| 192 | 217 | /* We only wait for device setup after most initcalls have run. */ |
| 193 | 218 | static int ready_to_wait_for_devices; |
| 194 | 219 | |
| 220 | +static bool wait_loop(unsigned long start, unsigned int max_delay, | |
| 221 | + unsigned int *seconds_waited) | |
| 222 | +{ | |
| 223 | + if (time_after(jiffies, start + (*seconds_waited+5)*HZ)) { | |
| 224 | + if (!*seconds_waited) | |
| 225 | + printk(KERN_WARNING "XENBUS: Waiting for " | |
| 226 | + "devices to initialise: "); | |
| 227 | + *seconds_waited += 5; | |
| 228 | + printk("%us...", max_delay - *seconds_waited); | |
| 229 | + if (*seconds_waited == max_delay) | |
| 230 | + return true; | |
| 231 | + } | |
| 232 | + | |
| 233 | + schedule_timeout_interruptible(HZ/10); | |
| 234 | + | |
| 235 | + return false; | |
| 236 | +} | |
| 195 | 237 | /* |
| 196 | 238 | * On a 5-minute timeout, wait for all devices currently configured. We need |
| 197 | 239 | * to do this to guarantee that the filesystems and / or network devices |
| @@ -215,19 +257,14 @@ static void wait_for_devices(struct xenbus_driver *xendrv) · 17 unmodified lines | ||
| 215 | 257 | if (!ready_to_wait_for_devices || !xen_domain()) |
| 216 | 258 | return; |
| 217 | 259 | |
| 218 | − while (exists_connecting_device(drv)) { | |
| 219 | − if (time_after(jiffies, start + (seconds_waited+5)*HZ)) { | |
| 220 | − if (!seconds_waited) | |
| 221 | − printk(KERN_WARNING "XENBUS: Waiting for " | |
| 222 | − "devices to initialise: "); | |
| 223 | − seconds_waited += 5; | |
| 224 | − printk("%us...", 300 - seconds_waited); | |
| 225 | − if (seconds_waited == 300) | |
| 226 | − break; | |
| 227 | − } | |
| 228 | − | |
| 229 | − schedule_timeout_interruptible(HZ/10); | |
| 230 | − } | |
| 260 | + while (exists_non_essential_connecting_device(drv)) | |
| 261 | + if (wait_loop(start, 30, &seconds_waited)) | |
| 262 | + break; | |
| 263 | + | |
| 264 | + /* Skips PVKB and PVFB check.*/ | |
| 265 | + while (exists_essential_connecting_device(drv)) | |
| 266 | + if (wait_loop(start, 270, &seconds_waited)) | |
| 267 | + break; | |
| 231 | 268 | |
| 232 | 269 | if (seconds_waited) |
| 233 | 270 | printk("\n"); |
| @@ -93,9 +93,8 @@ static void aio_free_ring(struct kioctx *ctx) · 92 unmodified lines | ||
| 93 | 93 | put_page(info->ring_pages[i]); |
| 94 | 94 | |
| 95 | 95 | if (info->mmap_size) { |
| 96 | − down_write(&ctx->mm->mmap_sem); | |
| 97 | − do_munmap(ctx->mm, info->mmap_base, info->mmap_size); | |
| 98 | − up_write(&ctx->mm->mmap_sem); | |
| 96 | + BUG_ON(ctx->mm != current->mm); | |
| 97 | + vm_munmap(info->mmap_base, info->mmap_size); | |
| 99 | 98 | } |
| 100 | 99 | |
| 101 | 100 | if (info->ring_pages && info->ring_pages != info->internal_pages) |
| @@ -389,6 +388,17 @@ void exit_aio(struct mm_struct *mm) · 287 unmodified lines | ||
| 389 | 388 | "exit_aio:ioctx still alive: %d %d %d\n", |
| 390 | 389 | atomic_read(&ctx->users), ctx->dead, |
| 391 | 390 | ctx->reqs_active); |
| 391 | + /* | |
| 392 | + * We don't need to bother with munmap() here - | |
| 393 | + * exit_mmap(mm) is coming and it'll unmap everything. | |
| 394 | + * Since aio_free_ring() uses non-zero ->mmap_size | |
| 395 | + * as indicator that it needs to unmap the area, | |
| 396 | + * just set it to 0; aio_free_ring() is the only | |
| 397 | + * place that uses ->mmap_size, so it's safe. | |
| 398 | + * That way we get all munmap done to current->mm - | |
| 399 | + * all other callers have ctx->mm == current->mm. | |
| 400 | + */ | |
| 401 | + ctx->ring_info.mmap_size = 0; | |
| 392 | 402 | put_ioctx(ctx); |
| 393 | 403 | } |
| 394 | 404 | } |
| @@ -110,7 +110,6 @@ struct autofs_sb_info { · 109 unmodified lines | ||
| 110 | 110 | int sub_version; |
| 111 | 111 | int min_proto; |
| 112 | 112 | int max_proto; |
| 113 | − int compat_daemon; | |
| 114 | 113 | unsigned long exp_timeout; |
| 115 | 114 | unsigned int type; |
| 116 | 115 | int reghost_enabled; |
| @@ -270,6 +269,17 @@ int autofs4_fill_super(struct super_block *, void *, int); · 153 unmodified lines | ||
| 270 | 269 | struct autofs_info *autofs4_new_ino(struct autofs_sb_info *); |
| 271 | 270 | void autofs4_clean_ino(struct autofs_info *); |
| 272 | 271 | |
| 272 | +static inline int autofs_prepare_pipe(struct file *pipe) | |
| 273 | +{ | |
| 274 | + if (!pipe->f_op || !pipe->f_op->write) | |
| 275 | + return -EINVAL; | |
| 276 | + if (!S_ISFIFO(pipe->f_dentry->d_inode->i_mode)) | |
| 277 | + return -EINVAL; | |
| 278 | + /* We want a packet pipe */ | |
| 279 | + pipe->f_flags |= O_DIRECT; | |
| 280 | + return 0; | |
| 281 | +} | |
| 282 | + | |
| 273 | 283 | /* Queue management functions */ |
| 274 | 284 | |
| 275 | 285 | int autofs4_wait(struct autofs_sb_info *,struct dentry *, enum autofs_notify); |
| @@ -376,7 +376,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp, · 375 unmodified lines | ||
| 376 | 376 | err = -EBADF; |
| 377 | 377 | goto out; |
| 378 | 378 | } |
| 379 | − if (!pipe->f_op || !pipe->f_op->write) { | |
| 379 | + if (autofs_prepare_pipe(pipe) < 0) { | |
| 380 | 380 | err = -EPIPE; |
| 381 | 381 | fput(pipe); |
| 382 | 382 | goto out; |
| @@ -385,7 +385,6 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp, · 2 unmodified lines | ||
| 385 | 385 | sbi->pipefd = pipefd; |
| 386 | 386 | sbi->pipe = pipe; |
| 387 | 387 | sbi->catatonic = 0; |
| 388 | − sbi->compat_daemon = is_compat_task(); | |
| 389 | 388 | } |
| 390 | 389 | out: |
| 391 | 390 | mutex_unlock(&sbi->wq_mutex); |
| @@ -19,7 +19,6 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <linux/parser.h> |
| 20 | 20 | #include <linux/bitops.h> |
| 21 | 21 | #include <linux/magic.h> |
| 22 | −#include <linux/compat.h> | |
| 23 | 22 | #include "autofs_i.h" |
| 24 | 23 | #include <linux/module.h> |
| 25 | 24 | |
| @@ -225,7 +224,6 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) · 199 unmodified lines | ||
| 225 | 224 | set_autofs_type_indirect(&sbi->type); |
| 226 | 225 | sbi->min_proto = 0; |
| 227 | 226 | sbi->max_proto = 0; |
| 228 | − sbi->compat_daemon = is_compat_task(); | |
| 229 | 227 | mutex_init(&sbi->wq_mutex); |
| 230 | 228 | mutex_init(&sbi->pipe_mutex); |
| 231 | 229 | spin_lock_init(&sbi->fs_lock); |
| @@ -292,7 +290,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) · 60 unmodified lines | ||
| 292 | 290 | printk("autofs: could not open pipe file descriptor\n"); |
| 293 | 291 | goto fail_dput; |
| 294 | 292 | } |
| 295 | − if (!pipe->f_op || !pipe->f_op->write) | |
| 293 | + if (autofs_prepare_pipe(pipe) < 0) | |
| 296 | 294 | goto fail_fput; |
| 297 | 295 | sbi->pipe = pipe; |
| 298 | 296 | sbi->pipefd = pipefd; |
| @@ -91,24 +91,7 @@ static int autofs4_write(struct autofs_sb_info *sbi, · 90 unmodified lines | ||
| 91 | 91 | |
| 92 | 92 | return (bytes > 0); |
| 93 | 93 | } |
| 94 | − | |
| 95 | −/* | |
| 96 | − * The autofs_v5 packet was misdesigned. | |
| 97 | − * | |
| 98 | − * The packets are identical on x86-32 and x86-64, but have different | |
| 99 | − * alignment. Which means that 'sizeof()' will give different results. | |
| 100 | − * Fix it up for the case of running 32-bit user mode on a 64-bit kernel. | |
| 101 | − */ | |
| 102 | −static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi) | |
| 103 | −{ | |
| 104 | − size_t pktsz = sizeof(struct autofs_v5_packet); | |
| 105 | −#if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT) | |
| 106 | − if (sbi->compat_daemon > 0) | |
| 107 | − pktsz -= 4; | |
| 108 | −#endif | |
| 109 | − return pktsz; | |
| 110 | −} | |
| 111 | − | |
| 94 | + | |
| 112 | 95 | static void autofs4_notify_daemon(struct autofs_sb_info *sbi, |
| 113 | 96 | struct autofs_wait_queue *wq, |
| 114 | 97 | int type) |
| @@ -172,7 +155,8 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, · 57 unmodified lines | ||
| 172 | 155 | { |
| 173 | 156 | struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet; |
| 174 | 157 | |
| 175 | − pktsz = autofs_v5_packet_size(sbi); | |
| 158 | + pktsz = sizeof(*packet); | |
| 159 | + | |
| 176 | 160 | packet->wait_queue_token = wq->wait_queue_token; |
| 177 | 161 | packet->len = wq->name.len; |
| 178 | 162 | memcpy(packet->name, wq->name.name, wq->name.len); |
| @@ -50,9 +50,7 @@ static int set_brk(unsigned long start, unsigned long end) · 49 unmodified lines | ||
| 50 | 50 | end = PAGE_ALIGN(end); |
| 51 | 51 | if (end > start) { |
| 52 | 52 | unsigned long addr; |
| 53 | − down_write(¤t->mm->mmap_sem); | |
| 54 | − addr = do_brk(start, end - start); | |
| 55 | − up_write(¤t->mm->mmap_sem); | |
| 53 | + addr = vm_brk(start, end - start); | |
| 56 | 54 | if (BAD_ADDR(addr)) |
| 57 | 55 | return addr; |
| 58 | 56 | } |
| @@ -280,9 +278,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) · 221 unmodified lines | ||
| 280 | 278 | pos = 32; |
| 281 | 279 | map_size = ex.a_text+ex.a_data; |
| 282 | 280 | #endif |
| 283 | − down_write(¤t->mm->mmap_sem); | |
| 284 | − error = do_brk(text_addr & PAGE_MASK, map_size); | |
| 285 | − up_write(¤t->mm->mmap_sem); | |
| 281 | + error = vm_brk(text_addr & PAGE_MASK, map_size); | |
| 286 | 282 | if (error != (text_addr & PAGE_MASK)) { |
| 287 | 283 | send_sig(SIGKILL, current, 0); |
| 288 | 284 | return error; |
| @@ -313,9 +309,7 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) · 24 unmodified lines | ||
| 313 | 309 | |
| 314 | 310 | if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) { |
| 315 | 311 | loff_t pos = fd_offset; |
| 316 | − down_write(¤t->mm->mmap_sem); | |
| 317 | − do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data); | |
| 318 | − up_write(¤t->mm->mmap_sem); | |
| 312 | + vm_brk(N_TXTADDR(ex), ex.a_text+ex.a_data); | |
| 319 | 313 | bprm->file->f_op->read(bprm->file, |
| 320 | 314 | (char __user *)N_TXTADDR(ex), |
| 321 | 315 | ex.a_text+ex.a_data, &pos); |
| @@ -325,24 +319,20 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) · 3 unmodified lines | ||
| 325 | 319 | goto beyond_if; |
| 326 | 320 | } |
| 327 | 321 | |
| 328 | − down_write(¤t->mm->mmap_sem); | |
| 329 | − error = do_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, | |
| 322 | + error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, | |
| 330 | 323 | PROT_READ | PROT_EXEC, |
| 331 | 324 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE, |
| 332 | 325 | fd_offset); |
| 333 | − up_write(¤t->mm->mmap_sem); | |
| 334 | 326 | |
| 335 | 327 | if (error != N_TXTADDR(ex)) { |
| 336 | 328 | send_sig(SIGKILL, current, 0); |
| 337 | 329 | return error; |
| 338 | 330 | } |
| 339 | 331 | |
| 340 | − down_write(¤t->mm->mmap_sem); | |
| 341 | − error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data, | |
| 332 | + error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data, | |
| 342 | 333 | PROT_READ | PROT_WRITE | PROT_EXEC, |
| 343 | 334 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE, |
| 344 | 335 | fd_offset + ex.a_text); |
| 345 | − up_write(¤t->mm->mmap_sem); | |
| 346 | 336 | if (error != N_DATADDR(ex)) { |
| 347 | 337 | send_sig(SIGKILL, current, 0); |
| 348 | 338 | return error; |
| @@ -412,9 +402,7 @@ static int load_aout_library(struct file *file) · 63 unmodified lines | ||
| 412 | 402 | "N_TXTOFF is not page aligned. Please convert library: %s\n", |
| 413 | 403 | file->f_path.dentry->d_name.name); |
| 414 | 404 | } |
| 415 | − down_write(¤t->mm->mmap_sem); | |
| 416 | − do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); | |
| 417 | − up_write(¤t->mm->mmap_sem); | |
| 405 | + vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); | |
| 418 | 406 | |
| 419 | 407 | file->f_op->read(file, (char __user *)start_addr, |
| 420 | 408 | ex.a_text + ex.a_data, &pos); |
| @@ -425,12 +413,10 @@ static int load_aout_library(struct file *file) · 4 unmodified lines | ||
| 425 | 413 | goto out; |
| 426 | 414 | } |
| 427 | 415 | /* Now use mmap to map the library into memory. */ |
| 428 | − down_write(¤t->mm->mmap_sem); | |
| 429 | − error = do_mmap(file, start_addr, ex.a_text + ex.a_data, | |
| 416 | + error = vm_mmap(file, start_addr, ex.a_text + ex.a_data, | |
| 430 | 417 | PROT_READ | PROT_WRITE | PROT_EXEC, |
| 431 | 418 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE, |
| 432 | 419 | N_TXTOFF(ex)); |
| 433 | − up_write(¤t->mm->mmap_sem); | |
| 434 | 420 | retval = error; |
| 435 | 421 | if (error != start_addr) |
| 436 | 422 | goto out; |
| @@ -438,9 +424,7 @@ static int load_aout_library(struct file *file) · 1 unmodified line | ||
| 438 | 424 | len = PAGE_ALIGN(ex.a_text + ex.a_data); |
| 439 | 425 | bss = ex.a_text + ex.a_data + ex.a_bss; |
| 440 | 426 | if (bss > len) { |
| 441 | − down_write(¤t->mm->mmap_sem); | |
| 442 | − error = do_brk(start_addr + len, bss - len); | |
| 443 | − up_write(¤t->mm->mmap_sem); | |
| 427 | + error = vm_brk(start_addr + len, bss - len); | |
| 444 | 428 | retval = error; |
| 445 | 429 | if (error != start_addr + len) |
| 446 | 430 | goto out; |
| @@ -82,9 +82,7 @@ static int set_brk(unsigned long start, unsigned long end) · 81 unmodified lines | ||
| 82 | 82 | end = ELF_PAGEALIGN(end); |
| 83 | 83 | if (end > start) { |
| 84 | 84 | unsigned long addr; |
| 85 | − down_write(¤t->mm->mmap_sem); | |
| 86 | − addr = do_brk(start, end - start); | |
| 87 | − up_write(¤t->mm->mmap_sem); | |
| 85 | + addr = vm_brk(start, end - start); | |
| 88 | 86 | if (BAD_ADDR(addr)) |
| 89 | 87 | return addr; |
| 90 | 88 | } |
| @@ -514,9 +512,7 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, · 423 unmodified lines | ||
| 514 | 512 | elf_bss = ELF_PAGESTART(elf_bss + ELF_MIN_ALIGN - 1); |
| 515 | 513 | |
| 516 | 514 | /* Map the last of the bss segment */ |
| 517 | − down_write(¤t->mm->mmap_sem); | |
| 518 | − error = do_brk(elf_bss, last_bss - elf_bss); | |
| 519 | − up_write(¤t->mm->mmap_sem); | |
| 515 | + error = vm_brk(elf_bss, last_bss - elf_bss); | |
| 520 | 516 | if (BAD_ADDR(error)) |
| 521 | 517 | goto out_close; |
| 522 | 518 | } |
| @@ -962,10 +958,8 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) · 439 unmodified lines | ||
| 962 | 958 | and some applications "depend" upon this behavior. |
| 963 | 959 | Since we do not have the power to recompile these, we |
| 964 | 960 | emulate the SVr4 behavior. Sigh. */ |
| 965 | − down_write(¤t->mm->mmap_sem); | |
| 966 | − error = do_mmap(NULL, 0, PAGE_SIZE, PROT_READ | PROT_EXEC, | |
| 961 | + error = vm_mmap(NULL, 0, PAGE_SIZE, PROT_READ | PROT_EXEC, | |
| 967 | 962 | MAP_FIXED | MAP_PRIVATE, 0); |
| 968 | − up_write(¤t->mm->mmap_sem); | |
| 969 | 963 | } |
| 970 | 964 | |
| 971 | 965 | #ifdef ELF_PLAT_INIT |
| @@ -1050,8 +1044,7 @@ static int load_elf_library(struct file *file) · 78 unmodified lines | ||
| 1050 | 1044 | eppnt++; |
| 1051 | 1045 | |
| 1052 | 1046 | /* Now use mmap to map the library into memory. */ |
| 1053 | − down_write(¤t->mm->mmap_sem); | |
| 1054 | − error = do_mmap(file, | |
| 1047 | + error = vm_mmap(file, | |
| 1055 | 1048 | ELF_PAGESTART(eppnt->p_vaddr), |
| 1056 | 1049 | (eppnt->p_filesz + |
| 1057 | 1050 | ELF_PAGEOFFSET(eppnt->p_vaddr)), |
| @@ -1059,7 +1052,6 @@ static int load_elf_library(struct file *file) · 1 unmodified line | ||
| 1059 | 1052 | MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE, |
| 1060 | 1053 | (eppnt->p_offset - |
| 1061 | 1054 | ELF_PAGEOFFSET(eppnt->p_vaddr))); |
| 1062 | − up_write(¤t->mm->mmap_sem); | |
| 1063 | 1055 | if (error != ELF_PAGESTART(eppnt->p_vaddr)) |
| 1064 | 1056 | goto out_free_ph; |
| 1065 | 1057 | |
| @@ -1072,11 +1064,8 @@ static int load_elf_library(struct file *file) · 6 unmodified lines | ||
| 1072 | 1064 | len = ELF_PAGESTART(eppnt->p_filesz + eppnt->p_vaddr + |
| 1073 | 1065 | ELF_MIN_ALIGN - 1); |
| 1074 | 1066 | bss = eppnt->p_memsz + eppnt->p_vaddr; |
| 1075 | − if (bss > len) { | |
| 1076 | − down_write(¤t->mm->mmap_sem); | |
| 1077 | − do_brk(len, bss - len); | |
| 1078 | − up_write(¤t->mm->mmap_sem); | |
| 1079 | − } | |
| 1067 | + if (bss > len) | |
| 1068 | + vm_brk(len, bss - len); | |
| 1080 | 1069 | error = 0; |
| 1081 | 1070 | |
| 1082 | 1071 | out_free_ph: |
| @@ -390,21 +390,17 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, · 389 unmodified lines | ||
| 390 | 390 | (executable_stack == EXSTACK_DEFAULT && VM_STACK_FLAGS & VM_EXEC)) |
| 391 | 391 | stack_prot |= PROT_EXEC; |
| 392 | 392 | |
| 393 | − down_write(¤t->mm->mmap_sem); | |
| 394 | − current->mm->start_brk = do_mmap(NULL, 0, stack_size, stack_prot, | |
| 393 | + current->mm->start_brk = vm_mmap(NULL, 0, stack_size, stack_prot, | |
| 395 | 394 | MAP_PRIVATE | MAP_ANONYMOUS | |
| 396 | 395 | MAP_UNINITIALIZED | MAP_GROWSDOWN, |
| 397 | 396 | 0); |
| 398 | 397 | |
| 399 | 398 | if (IS_ERR_VALUE(current->mm->start_brk)) { |
| 400 | − up_write(¤t->mm->mmap_sem); | |
| 401 | 399 | retval = current->mm->start_brk; |
| 402 | 400 | current->mm->start_brk = 0; |
| 403 | 401 | goto error_kill; |
| 404 | 402 | } |
| 405 | 403 | |
| 406 | − up_write(¤t->mm->mmap_sem); | |
| 407 | − | |
| 408 | 404 | current->mm->brk = current->mm->start_brk; |
| 409 | 405 | current->mm->context.end_brk = current->mm->start_brk; |
| 410 | 406 | current->mm->context.end_brk += |
| @@ -955,10 +951,8 @@ static int elf_fdpic_map_file_constdisp_on_uclinux( · 544 unmodified lines | ||
| 955 | 951 | if (params->flags & ELF_FDPIC_FLAG_EXECUTABLE) |
| 956 | 952 | mflags |= MAP_EXECUTABLE; |
| 957 | 953 | |
| 958 | − down_write(&mm->mmap_sem); | |
| 959 | − maddr = do_mmap(NULL, load_addr, top - base, | |
| 954 | + maddr = vm_mmap(NULL, load_addr, top - base, | |
| 960 | 955 | PROT_READ | PROT_WRITE | PROT_EXEC, mflags, 0); |
| 961 | − up_write(&mm->mmap_sem); | |
| 962 | 956 | if (IS_ERR_VALUE(maddr)) |
| 963 | 957 | return (int) maddr; |
| 964 | 958 | |
| @@ -1096,10 +1090,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, · 131 unmodified lines | ||
| 1096 | 1090 | |
| 1097 | 1091 | /* create the mapping */ |
| 1098 | 1092 | disp = phdr->p_vaddr & ~PAGE_MASK; |
| 1099 | − down_write(&mm->mmap_sem); | |
| 1100 | − maddr = do_mmap(file, maddr, phdr->p_memsz + disp, prot, flags, | |
| 1093 | + maddr = vm_mmap(file, maddr, phdr->p_memsz + disp, prot, flags, | |
| 1101 | 1094 | phdr->p_offset - disp); |
| 1102 | − up_write(&mm->mmap_sem); | |
| 1103 | 1095 | |
| 1104 | 1096 | kdebug("mmap[%d] <file> sz=%lx pr=%x fl=%x of=%lx --> %08lx", |
| 1105 | 1097 | loop, phdr->p_memsz + disp, prot, flags, |
| @@ -1143,10 +1135,8 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params, · 37 unmodified lines | ||
| 1143 | 1135 | unsigned long xmaddr; |
| 1144 | 1136 | |
| 1145 | 1137 | flags |= MAP_FIXED | MAP_ANONYMOUS; |
| 1146 | − down_write(&mm->mmap_sem); | |
| 1147 | − xmaddr = do_mmap(NULL, xaddr, excess - excess1, | |
| 1138 | + xmaddr = vm_mmap(NULL, xaddr, excess - excess1, | |
| 1148 | 1139 | prot, flags, 0); |
| 1149 | − up_write(&mm->mmap_sem); | |
| 1150 | 1140 | |
| 1151 | 1141 | kdebug("mmap[%d] <anon>" |
| 1152 | 1142 | " ad=%lx sz=%lx pr=%x fl=%x of=0 --> %08lx", |
| @@ -542,10 +542,8 @@ static int load_flat_file(struct linux_binprm * bprm, · 541 unmodified lines | ||
| 542 | 542 | */ |
| 543 | 543 | DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); |
| 544 | 544 | |
| 545 | − down_write(¤t->mm->mmap_sem); | |
| 546 | − textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, | |
| 545 | + textpos = vm_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, | |
| 547 | 546 | MAP_PRIVATE|MAP_EXECUTABLE, 0); |
| 548 | − up_write(¤t->mm->mmap_sem); | |
| 549 | 547 | if (!textpos || IS_ERR_VALUE(textpos)) { |
| 550 | 548 | if (!textpos) |
| 551 | 549 | textpos = (unsigned long) -ENOMEM; |
| @@ -556,10 +554,8 @@ static int load_flat_file(struct linux_binprm * bprm, · 4 unmodified lines | ||
| 556 | 554 | |
| 557 | 555 | len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long); |
| 558 | 556 | len = PAGE_ALIGN(len); |
| 559 | − down_write(¤t->mm->mmap_sem); | |
| 560 | − realdatastart = do_mmap(0, 0, len, | |
| 557 | + realdatastart = vm_mmap(0, 0, len, | |
| 561 | 558 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0); |
| 562 | − up_write(¤t->mm->mmap_sem); | |
| 563 | 559 | |
| 564 | 560 | if (realdatastart == 0 || IS_ERR_VALUE(realdatastart)) { |
| 565 | 561 | if (!realdatastart) |
| @@ -603,10 +599,8 @@ static int load_flat_file(struct linux_binprm * bprm, · 37 unmodified lines | ||
| 603 | 599 | |
| 604 | 600 | len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long); |
| 605 | 601 | len = PAGE_ALIGN(len); |
| 606 | − down_write(¤t->mm->mmap_sem); | |
| 607 | − textpos = do_mmap(0, 0, len, | |
| 602 | + textpos = vm_mmap(0, 0, len, | |
| 608 | 603 | PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0); |
| 609 | − up_write(¤t->mm->mmap_sem); | |
| 610 | 604 | |
| 611 | 605 | if (!textpos || IS_ERR_VALUE(textpos)) { |
| 612 | 606 | if (!textpos) |
| @@ -147,10 +147,8 @@ static int map_som_binary(struct file *file, · 146 unmodified lines | ||
| 147 | 147 | code_size = SOM_PAGEALIGN(hpuxhdr->exec_tsize); |
| 148 | 148 | current->mm->start_code = code_start; |
| 149 | 149 | current->mm->end_code = code_start + code_size; |
| 150 | − down_write(¤t->mm->mmap_sem); | |
| 151 | − retval = do_mmap(file, code_start, code_size, prot, | |
| 150 | + retval = vm_mmap(file, code_start, code_size, prot, | |
| 152 | 151 | flags, SOM_PAGESTART(hpuxhdr->exec_tfile)); |
| 153 | − up_write(¤t->mm->mmap_sem); | |
| 154 | 152 | if (retval < 0 && retval > -1024) |
| 155 | 153 | goto out; |
| 156 | 154 | |
| @@ -158,20 +156,16 @@ static int map_som_binary(struct file *file, · 1 unmodified line | ||
| 158 | 156 | data_size = SOM_PAGEALIGN(hpuxhdr->exec_dsize); |
| 159 | 157 | current->mm->start_data = data_start; |
| 160 | 158 | current->mm->end_data = bss_start = data_start + data_size; |
| 161 | − down_write(¤t->mm->mmap_sem); | |
| 162 | − retval = do_mmap(file, data_start, data_size, | |
| 159 | + retval = vm_mmap(file, data_start, data_size, | |
| 163 | 160 | prot | PROT_WRITE, flags, |
| 164 | 161 | SOM_PAGESTART(hpuxhdr->exec_dfile)); |
| 165 | − up_write(¤t->mm->mmap_sem); | |
| 166 | 162 | if (retval < 0 && retval > -1024) |
| 167 | 163 | goto out; |
| 168 | 164 | |
| 169 | 165 | som_brk = bss_start + SOM_PAGEALIGN(hpuxhdr->exec_bsize); |
| 170 | 166 | current->mm->start_brk = current->mm->brk = som_brk; |
| 171 | − down_write(¤t->mm->mmap_sem); | |
| 172 | − retval = do_mmap(NULL, bss_start, som_brk - bss_start, | |
| 167 | + retval = vm_mmap(NULL, bss_start, som_brk - bss_start, | |
| 173 | 168 | prot | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, 0); |
| 174 | − up_write(¤t->mm->mmap_sem); | |
| 175 | 169 | if (retval > 0 || retval < -1024) |
| 176 | 170 | retval = 0; |
| 177 | 171 | out: |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include "ulist.h" |
| 23 | 23 | #include "transaction.h" |
| 24 | 24 | #include "delayed-ref.h" |
| 25 | +#include "locking.h" | |
| 25 | 26 | |
| 26 | 27 | /* |
| 27 | 28 | * this structure records all encountered refs on the way up to the root |
| @@ -893,18 +894,22 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, · 865 unmodified lines | ||
| 893 | 894 | s64 bytes_left = size - 1; |
| 894 | 895 | struct extent_buffer *eb = eb_in; |
| 895 | 896 | struct btrfs_key found_key; |
| 897 | + int leave_spinning = path->leave_spinning; | |
| 896 | 898 | |
| 897 | 899 | if (bytes_left >= 0) |
| 898 | 900 | dest[bytes_left] = '\0'; |
| 899 | 901 | |
| 902 | + path->leave_spinning = 1; | |
| 900 | 903 | while (1) { |
| 901 | 904 | len = btrfs_inode_ref_name_len(eb, iref); |
| 902 | 905 | bytes_left -= len; |
| 903 | 906 | if (bytes_left >= 0) |
| 904 | 907 | read_extent_buffer(eb, dest + bytes_left, |
| 905 | 908 | (unsigned long)(iref + 1), len); |
| 906 | − if (eb != eb_in) | |
| 909 | + if (eb != eb_in) { | |
| 910 | + btrfs_tree_read_unlock_blocking(eb); | |
| 907 | 911 | free_extent_buffer(eb); |
| 912 | + } | |
| 908 | 913 | ret = inode_ref_info(parent, 0, fs_root, path, &found_key); |
| 909 | 914 | if (ret > 0) |
| 910 | 915 | ret = -ENOENT; |
| @@ -919,8 +924,11 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, · 8 unmodified lines | ||
| 919 | 924 | slot = path->slots[0]; |
| 920 | 925 | eb = path->nodes[0]; |
| 921 | 926 | /* make sure we can use eb after releasing the path */ |
| 922 | − if (eb != eb_in) | |
| 927 | + if (eb != eb_in) { | |
| 923 | 928 | atomic_inc(&eb->refs); |
| 929 | + btrfs_tree_read_lock(eb); | |
| 930 | + btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | |
| 931 | + } | |
| 924 | 932 | btrfs_release_path(path); |
| 925 | 933 | |
| 926 | 934 | iref = btrfs_item_ptr(eb, slot, struct btrfs_inode_ref); |
| @@ -931,6 +939,7 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, · 4 unmodified lines | ||
| 931 | 939 | } |
| 932 | 940 | |
| 933 | 941 | btrfs_release_path(path); |
| 942 | + path->leave_spinning = leave_spinning; | |
| 934 | 943 | |
| 935 | 944 | if (ret) |
| 936 | 945 | return ERR_PTR(ret); |
| @@ -1247,7 +1256,7 @@ static int iterate_irefs(u64 inum, struct btrfs_root *fs_root, · 310 unmodified lines | ||
| 1247 | 1256 | struct btrfs_path *path, |
| 1248 | 1257 | iterate_irefs_t *iterate, void *ctx) |
| 1249 | 1258 | { |
| 1250 | − int ret; | |
| 1259 | + int ret = 0; | |
| 1251 | 1260 | int slot; |
| 1252 | 1261 | u32 cur; |
| 1253 | 1262 | u32 len; |
| @@ -1259,7 +1268,8 @@ static int iterate_irefs(u64 inum, struct btrfs_root *fs_root, · 5 unmodified lines | ||
| 1259 | 1268 | struct btrfs_inode_ref *iref; |
| 1260 | 1269 | struct btrfs_key found_key; |
| 1261 | 1270 | |
| 1262 | − while (1) { | |
| 1271 | + while (!ret) { | |
| 1272 | + path->leave_spinning = 1; | |
| 1263 | 1273 | ret = inode_ref_info(inum, parent ? parent+1 : 0, fs_root, path, |
| 1264 | 1274 | &found_key); |
| 1265 | 1275 | if (ret < 0) |
| @@ -1275,6 +1285,8 @@ static int iterate_irefs(u64 inum, struct btrfs_root *fs_root, · 9 unmodified lines | ||
| 1275 | 1285 | eb = path->nodes[0]; |
| 1276 | 1286 | /* make sure we can use eb after releasing the path */ |
| 1277 | 1287 | atomic_inc(&eb->refs); |
| 1288 | + btrfs_tree_read_lock(eb); | |
| 1289 | + btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); | |
| 1278 | 1290 | btrfs_release_path(path); |
| 1279 | 1291 | |
| 1280 | 1292 | item = btrfs_item_nr(eb, slot); |
| @@ -1288,13 +1300,12 @@ static int iterate_irefs(u64 inum, struct btrfs_root *fs_root, · 7 unmodified lines | ||
| 1288 | 1300 | (unsigned long long)found_key.objectid, |
| 1289 | 1301 | (unsigned long long)fs_root->objectid); |
| 1290 | 1302 | ret = iterate(parent, iref, eb, ctx); |
| 1291 | − if (ret) { | |
| 1292 | − free_extent_buffer(eb); | |
| 1303 | + if (ret) | |
| 1293 | 1304 | break; |
| 1294 | − } | |
| 1295 | 1305 | len = sizeof(*iref) + name_len; |
| 1296 | 1306 | iref = (struct btrfs_inode_ref *)((char *)iref + len); |
| 1297 | 1307 | } |
| 1308 | + btrfs_tree_read_unlock_blocking(eb); | |
| 1298 | 1309 | free_extent_buffer(eb); |
| 1299 | 1310 | } |
| 1300 | 1311 | |
| @@ -1414,6 +1425,8 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, · 113 unmodified lines | ||
| 1414 | 1425 | |
| 1415 | 1426 | void free_ipath(struct inode_fs_paths *ipath) |
| 1416 | 1427 | { |
| 1428 | + if (!ipath) | |
| 1429 | + return; | |
| 1417 | 1430 | kfree(ipath->fspath); |
| 1418 | 1431 | kfree(ipath); |
| 1419 | 1432 | } |
| @@ -1078,7 +1078,7 @@ struct btrfs_fs_info { · 1077 unmodified lines | ||
| 1078 | 1078 | * is required instead of the faster short fsync log commits |
| 1079 | 1079 | */ |
| 1080 | 1080 | u64 last_trans_log_full_commit; |
| 1081 | − unsigned long mount_opt:21; | |
| 1081 | + unsigned long mount_opt; | |
| 1082 | 1082 | unsigned long compress_type:4; |
| 1083 | 1083 | u64 max_inline; |
| 1084 | 1084 | u64 alloc_start; |
| @@ -2166,7 +2166,7 @@ BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item, · 1081 unmodified lines | ||
| 2166 | 2166 | |
| 2167 | 2167 | static inline bool btrfs_root_readonly(struct btrfs_root *root) |
| 2168 | 2168 | { |
| 2169 | − return root->root_item.flags & BTRFS_ROOT_SUBVOL_RDONLY; | |
| 2169 | + return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0; | |
| 2170 | 2170 | } |
| 2171 | 2171 | |
| 2172 | 2172 | /* struct btrfs_root_backup */ |
| @@ -383,17 +383,16 @@ static int btree_read_extent_buffer_pages(struct btrfs_root *root, · 382 unmodified lines | ||
| 383 | 383 | if (test_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags)) |
| 384 | 384 | break; |
| 385 | 385 | |
| 386 | − if (!failed_mirror) { | |
| 387 | − failed = 1; | |
| 388 | − printk(KERN_ERR "failed mirror was %d\n", eb->failed_mirror); | |
| 389 | − failed_mirror = eb->failed_mirror; | |
| 390 | − } | |
| 391 | − | |
| 392 | 386 | num_copies = btrfs_num_copies(&root->fs_info->mapping_tree, |
| 393 | 387 | eb->start, eb->len); |
| 394 | 388 | if (num_copies == 1) |
| 395 | 389 | break; |
| 396 | 390 | |
| 391 | + if (!failed_mirror) { | |
| 392 | + failed = 1; | |
| 393 | + failed_mirror = eb->read_mirror; | |
| 394 | + } | |
| 395 | + | |
| 397 | 396 | mirror_num++; |
| 398 | 397 | if (mirror_num == failed_mirror) |
| 399 | 398 | mirror_num++; |
| @@ -564,7 +563,7 @@ struct extent_buffer *find_eb_for_page(struct extent_io_tree *tree, · 164 unmodified lines | ||
| 564 | 563 | } |
| 565 | 564 | |
| 566 | 565 | static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, |
| 567 | − struct extent_state *state) | |
| 566 | + struct extent_state *state, int mirror) | |
| 568 | 567 | { |
| 569 | 568 | struct extent_io_tree *tree; |
| 570 | 569 | u64 found_start; |
| @@ -589,6 +588,7 @@ static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, · 18 unmodified lines | ||
| 589 | 588 | if (!reads_done) |
| 590 | 589 | goto err; |
| 591 | 590 | |
| 591 | + eb->read_mirror = mirror; | |
| 592 | 592 | if (test_bit(EXTENT_BUFFER_IOERR, &eb->bflags)) { |
| 593 | 593 | ret = -EIO; |
| 594 | 594 | goto err; |
| @@ -652,7 +652,7 @@ static int btree_io_failed_hook(struct page *page, int failed_mirror) · 57 unmodified lines | ||
| 652 | 652 | |
| 653 | 653 | eb = (struct extent_buffer *)page->private; |
| 654 | 654 | set_bit(EXTENT_BUFFER_IOERR, &eb->bflags); |
| 655 | − eb->failed_mirror = failed_mirror; | |
| 655 | + eb->read_mirror = failed_mirror; | |
| 656 | 656 | if (test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags)) |
| 657 | 657 | btree_readahead_hook(root, eb, eb->start, -EIO); |
| 658 | 658 | return -EIO; /* we fixed nothing */ |
| @@ -2254,9 +2254,9 @@ int open_ctree(struct super_block *sb, · 1595 unmodified lines | ||
| 2254 | 2254 | goto fail_sb_buffer; |
| 2255 | 2255 | } |
| 2256 | 2256 | |
| 2257 | − if (sectorsize < PAGE_SIZE) { | |
| 2258 | − printk(KERN_WARNING "btrfs: Incompatible sector size " | |
| 2259 | − "found on %s\n", sb->s_id); | |
| 2257 | + if (sectorsize != PAGE_SIZE) { | |
| 2258 | + printk(KERN_WARNING "btrfs: Incompatible sector size(%lu) " | |
| 2259 | + "found on %s\n", (unsigned long)sectorsize, sb->s_id); | |
| 2260 | 2260 | goto fail_sb_buffer; |
| 2261 | 2261 | } |
| 2262 | 2262 | |
| @@ -2301,6 +2301,7 @@ static noinline int run_clustered_refs(struct btrfs_trans_handle *trans, · 2300 unmodified lines | ||
| 2301 | 2301 | |
| 2302 | 2302 | if (ret) { |
| 2303 | 2303 | printk(KERN_DEBUG "btrfs: run_delayed_extent_op returned %d\n", ret); |
| 2304 | + spin_lock(&delayed_refs->lock); | |
| 2304 | 2305 | return ret; |
| 2305 | 2306 | } |
| 2306 | 2307 | |
| @@ -2331,6 +2332,7 @@ static noinline int run_clustered_refs(struct btrfs_trans_handle *trans, · 24 unmodified lines | ||
| 2331 | 2332 | |
| 2332 | 2333 | if (ret) { |
| 2333 | 2334 | printk(KERN_DEBUG "btrfs: run_one_delayed_ref returned %d\n", ret); |
| 2335 | + spin_lock(&delayed_refs->lock); | |
| 2334 | 2336 | return ret; |
| 2335 | 2337 | } |
| 2336 | 2338 | |
| @@ -3769,13 +3771,10 @@ again: · 1432 unmodified lines | ||
| 3769 | 3771 | */ |
| 3770 | 3772 | if (current->journal_info) |
| 3771 | 3773 | return -EAGAIN; |
| 3772 | − ret = wait_event_interruptible(space_info->wait, | |
| 3773 | − !space_info->flush); | |
| 3774 | − /* Must have been interrupted, return */ | |
| 3775 | − if (ret) { | |
| 3776 | − printk(KERN_DEBUG "btrfs: %s returning -EINTR\n", __func__); | |
| 3774 | + ret = wait_event_killable(space_info->wait, !space_info->flush); | |
| 3775 | + /* Must have been killed, return */ | |
| 3776 | + if (ret) | |
| 3777 | 3777 | return -EINTR; |
| 3778 | − } | |
| 3779 | 3778 | |
| 3780 | 3779 | spin_lock(&space_info->lock); |
| 3781 | 3780 | } |
| @@ -4215,8 +4214,8 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info) · 433 unmodified lines | ||
| 4215 | 4214 | |
| 4216 | 4215 | num_bytes = calc_global_metadata_size(fs_info); |
| 4217 | 4216 | |
| 4218 | − spin_lock(&block_rsv->lock); | |
| 4219 | 4217 | spin_lock(&sinfo->lock); |
| 4218 | + spin_lock(&block_rsv->lock); | |
| 4220 | 4219 | |
| 4221 | 4220 | block_rsv->size = num_bytes; |
| 4222 | 4221 | |
| @@ -4242,8 +4241,8 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info) · 19 unmodified lines | ||
| 4242 | 4241 | block_rsv->full = 1; |
| 4243 | 4242 | } |
| 4244 | 4243 | |
| 4245 | − spin_unlock(&sinfo->lock); | |
| 4246 | 4244 | spin_unlock(&block_rsv->lock); |
| 4245 | + spin_unlock(&sinfo->lock); | |
| 4247 | 4246 | } |
| 4248 | 4247 | |
| 4249 | 4248 | static void init_global_block_rsv(struct btrfs_fs_info *fs_info) |
| @@ -402,20 +402,28 @@ static int split_state(struct extent_io_tree *tree, struct extent_state *orig, · 401 unmodified lines | ||
| 402 | 402 | return 0; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | +static struct extent_state *next_state(struct extent_state *state) | |
| 406 | +{ | |
| 407 | + struct rb_node *next = rb_next(&state->rb_node); | |
| 408 | + if (next) | |
| 409 | + return rb_entry(next, struct extent_state, rb_node); | |
| 410 | + else | |
| 411 | + return NULL; | |
| 412 | +} | |
| 413 | + | |
| 405 | 414 | /* |
| 406 | 415 | * utility function to clear some bits in an extent state struct. |
| 407 | − * it will optionally wake up any one waiting on this state (wake == 1), or | |
| 408 | − * forcibly remove the state from the tree (delete == 1). | |
| 416 | + * it will optionally wake up any one waiting on this state (wake == 1) | |
| 409 | 417 | * |
| 410 | 418 | * If no bits are set on the state struct after clearing things, the |
| 411 | 419 | * struct is freed and removed from the tree |
| 412 | 420 | */ |
| 413 | −static int clear_state_bit(struct extent_io_tree *tree, | |
| 414 | − struct extent_state *state, | |
| 415 | − int *bits, int wake) | |
| 421 | +static struct extent_state *clear_state_bit(struct extent_io_tree *tree, | |
| 422 | + struct extent_state *state, | |
| 423 | + int *bits, int wake) | |
| 416 | 424 | { |
| 425 | + struct extent_state *next; | |
| 417 | 426 | int bits_to_clear = *bits & ~EXTENT_CTLBITS; |
| 418 | − int ret = state->state & bits_to_clear; | |
| 419 | 427 | |
| 420 | 428 | if ((bits_to_clear & EXTENT_DIRTY) && (state->state & EXTENT_DIRTY)) { |
| 421 | 429 | u64 range = state->end - state->start + 1; |
| @@ -427,6 +435,7 @@ static int clear_state_bit(struct extent_io_tree *tree, · 5 unmodified lines | ||
| 427 | 435 | if (wake) |
| 428 | 436 | wake_up(&state->wq); |
| 429 | 437 | if (state->state == 0) { |
| 438 | + next = next_state(state); | |
| 430 | 439 | if (state->tree) { |
| 431 | 440 | rb_erase(&state->rb_node, &tree->state); |
| 432 | 441 | state->tree = NULL; |
| @@ -436,8 +445,9 @@ static int clear_state_bit(struct extent_io_tree *tree, · 3 unmodified lines | ||
| 436 | 445 | } |
| 437 | 446 | } else { |
| 438 | 447 | merge_state(tree, state); |
| 448 | + next = next_state(state); | |
| 439 | 449 | } |
| 440 | − return ret; | |
| 450 | + return next; | |
| 441 | 451 | } |
| 442 | 452 | |
| 443 | 453 | static struct extent_state * |
| @@ -476,7 +486,6 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, · 32 unmodified lines | ||
| 476 | 486 | struct extent_state *state; |
| 477 | 487 | struct extent_state *cached; |
| 478 | 488 | struct extent_state *prealloc = NULL; |
| 479 | − struct rb_node *next_node; | |
| 480 | 489 | struct rb_node *node; |
| 481 | 490 | u64 last_end; |
| 482 | 491 | int err; |
| @@ -528,14 +537,11 @@ hit_next: · 45 unmodified lines | ||
| 528 | 537 | WARN_ON(state->end < start); |
| 529 | 538 | last_end = state->end; |
| 530 | 539 | |
| 531 | − if (state->end < end && !need_resched()) | |
| 532 | − next_node = rb_next(&state->rb_node); | |
| 533 | − else | |
| 534 | − next_node = NULL; | |
| 535 | − | |
| 536 | 540 | /* the state doesn't have the wanted bits, go ahead */ |
| 537 | − if (!(state->state & bits)) | |
| 541 | + if (!(state->state & bits)) { | |
| 542 | + state = next_state(state); | |
| 538 | 543 | goto next; |
| 544 | + } | |
| 539 | 545 | |
| 540 | 546 | /* |
| 541 | 547 | * | ---- desired range ---- | |
| @@ -593,16 +599,13 @@ hit_next: · 51 unmodified lines | ||
| 593 | 599 | goto out; |
| 594 | 600 | } |
| 595 | 601 | |
| 596 | − clear_state_bit(tree, state, &bits, wake); | |
| 602 | + state = clear_state_bit(tree, state, &bits, wake); | |
| 597 | 603 | next: |
| 598 | 604 | if (last_end == (u64)-1) |
| 599 | 605 | goto out; |
| 600 | 606 | start = last_end + 1; |
| 601 | − if (start <= end && next_node) { | |
| 602 | − state = rb_entry(next_node, struct extent_state, | |
| 603 | − rb_node); | |
| 607 | + if (start <= end && state && !need_resched()) | |
| 604 | 608 | goto hit_next; |
| 605 | − } | |
| 606 | 609 | goto search_again; |
| 607 | 610 | |
| 608 | 611 | out: |
| @@ -2301,7 +2304,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) · 1692 unmodified lines | ||
| 2301 | 2304 | u64 start; |
| 2302 | 2305 | u64 end; |
| 2303 | 2306 | int whole_page; |
| 2304 | − int failed_mirror; | |
| 2307 | + int mirror; | |
| 2305 | 2308 | int ret; |
| 2306 | 2309 | |
| 2307 | 2310 | if (err) |
| @@ -2340,20 +2343,18 @@ static void end_bio_extent_readpage(struct bio *bio, int err) · 32 unmodified lines | ||
| 2340 | 2343 | } |
| 2341 | 2344 | spin_unlock(&tree->lock); |
| 2342 | 2345 | |
| 2346 | + mirror = (int)(unsigned long)bio->bi_bdev; | |
| 2343 | 2347 | if (uptodate && tree->ops && tree->ops->readpage_end_io_hook) { |
| 2344 | 2348 | ret = tree->ops->readpage_end_io_hook(page, start, end, |
| 2345 | − state); | |
| 2349 | + state, mirror); | |
| 2346 | 2350 | if (ret) |
| 2347 | 2351 | uptodate = 0; |
| 2348 | 2352 | else |
| 2349 | 2353 | clean_io_failure(start, page); |
| 2350 | 2354 | } |
| 2351 | 2355 | |
| 2352 | − if (!uptodate) | |
| 2353 | − failed_mirror = (int)(unsigned long)bio->bi_bdev; | |
| 2354 | − | |
| 2355 | 2356 | if (!uptodate && tree->ops && tree->ops->readpage_io_failed_hook) { |
| 2356 | − ret = tree->ops->readpage_io_failed_hook(page, failed_mirror); | |
| 2357 | + ret = tree->ops->readpage_io_failed_hook(page, mirror); | |
| 2357 | 2358 | if (!ret && !err && |
| 2358 | 2359 | test_bit(BIO_UPTODATE, &bio->bi_flags)) |
| 2359 | 2360 | uptodate = 1; |
| @@ -2368,8 +2369,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) · 8 unmodified lines | ||
| 2368 | 2369 | * can't handle the error it will return -EIO and we |
| 2369 | 2370 | * remain responsible for that page. |
| 2370 | 2371 | */ |
| 2371 | − ret = bio_readpage_error(bio, page, start, end, | |
| 2372 | − failed_mirror, NULL); | |
| 2372 | + ret = bio_readpage_error(bio, page, start, end, mirror, NULL); | |
| 2373 | 2373 | if (ret == 0) { |
| 2374 | 2374 | uptodate = |
| 2375 | 2375 | test_bit(BIO_UPTODATE, &bio->bi_flags); |
| @@ -4462,7 +4462,7 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, · 2086 unmodified lines | ||
| 4462 | 4462 | } |
| 4463 | 4463 | |
| 4464 | 4464 | clear_bit(EXTENT_BUFFER_IOERR, &eb->bflags); |
| 4465 | − eb->failed_mirror = 0; | |
| 4465 | + eb->read_mirror = 0; | |
| 4466 | 4466 | atomic_set(&eb->io_pages, num_reads); |
| 4467 | 4467 | for (i = start_i; i < num_pages; i++) { |
| 4468 | 4468 | page = extent_buffer_page(eb, i); |
| @@ -79,7 +79,7 @@ struct extent_io_ops { · 78 unmodified lines | ||
| 79 | 79 | u64 start, u64 end, |
| 80 | 80 | struct extent_state *state); |
| 81 | 81 | int (*readpage_end_io_hook)(struct page *page, u64 start, u64 end, |
| 82 | − struct extent_state *state); | |
| 82 | + struct extent_state *state, int mirror); | |
| 83 | 83 | int (*writepage_end_io_hook)(struct page *page, u64 start, u64 end, |
| 84 | 84 | struct extent_state *state, int uptodate); |
| 85 | 85 | void (*set_bit_hook)(struct inode *inode, struct extent_state *state, |
| @@ -135,7 +135,7 @@ struct extent_buffer { · 49 unmodified lines | ||
| 135 | 135 | spinlock_t refs_lock; |
| 136 | 136 | atomic_t refs; |
| 137 | 137 | atomic_t io_pages; |
| 138 | − int failed_mirror; | |
| 138 | + int read_mirror; | |
| 139 | 139 | struct list_head leak_list; |
| 140 | 140 | struct rcu_head rcu_head; |
| 141 | 141 | pid_t lock_owner; |
| @@ -567,6 +567,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, · 566 unmodified lines | ||
| 567 | 567 | int extent_type; |
| 568 | 568 | int recow; |
| 569 | 569 | int ret; |
| 570 | + int modify_tree = -1; | |
| 570 | 571 | |
| 571 | 572 | if (drop_cache) |
| 572 | 573 | btrfs_drop_extent_cache(inode, start, end - 1, 0); |
| @@ -575,10 +576,13 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, · 2 unmodified lines | ||
| 575 | 576 | if (!path) |
| 576 | 577 | return -ENOMEM; |
| 577 | 578 | |
| 579 | + if (start >= BTRFS_I(inode)->disk_i_size) | |
| 580 | + modify_tree = 0; | |
| 581 | + | |
| 578 | 582 | while (1) { |
| 579 | 583 | recow = 0; |
| 580 | 584 | ret = btrfs_lookup_file_extent(trans, root, path, ino, |
| 581 | − search_start, -1); | |
| 585 | + search_start, modify_tree); | |
| 582 | 586 | if (ret < 0) |
| 583 | 587 | break; |
| 584 | 588 | if (ret > 0 && path->slots[0] > 0 && search_start == start) { |
| @@ -634,7 +638,8 @@ next_slot: · 49 unmodified lines | ||
| 634 | 638 | } |
| 635 | 639 | |
| 636 | 640 | search_start = max(key.offset, start); |
| 637 | − if (recow) { | |
| 641 | + if (recow || !modify_tree) { | |
| 642 | + modify_tree = -1; | |
| 638 | 643 | btrfs_release_path(path); |
| 639 | 644 | continue; |
| 640 | 645 | } |
| @@ -1947,7 +1947,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, · 1946 unmodified lines | ||
| 1947 | 1947 | * extent_io.c will try to find good copies for us. |
| 1948 | 1948 | */ |
| 1949 | 1949 | static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, |
| 1950 | − struct extent_state *state) | |
| 1950 | + struct extent_state *state, int mirror) | |
| 1951 | 1951 | { |
| 1952 | 1952 | size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT); |
| 1953 | 1953 | struct inode *inode = page->mapping->host; |
| @@ -4069,7 +4069,7 @@ static struct inode *new_simple_dir(struct super_block *s, · 2115 unmodified lines | ||
| 4069 | 4069 | BTRFS_I(inode)->dummy_inode = 1; |
| 4070 | 4070 | |
| 4071 | 4071 | inode->i_ino = BTRFS_EMPTY_SUBVOL_DIR_OBJECTID; |
| 4072 | − inode->i_op = &simple_dir_inode_operations; | |
| 4072 | + inode->i_op = &btrfs_dir_ro_inode_operations; | |
| 4073 | 4073 | inode->i_fop = &simple_dir_operations; |
| 4074 | 4074 | inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; |
| 4075 | 4075 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
| @@ -4140,14 +4140,18 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry) · 64 unmodified lines | ||
| 4140 | 4140 | static int btrfs_dentry_delete(const struct dentry *dentry) |
| 4141 | 4141 | { |
| 4142 | 4142 | struct btrfs_root *root; |
| 4143 | + struct inode *inode = dentry->d_inode; | |
| 4143 | 4144 | |
| 4144 | − if (!dentry->d_inode && !IS_ROOT(dentry)) | |
| 4145 | − dentry = dentry->d_parent; | |
| 4145 | + if (!inode && !IS_ROOT(dentry)) | |
| 4146 | + inode = dentry->d_parent->d_inode; | |
| 4146 | 4147 | |
| 4147 | − if (dentry->d_inode) { | |
| 4148 | − root = BTRFS_I(dentry->d_inode)->root; | |
| 4148 | + if (inode) { | |
| 4149 | + root = BTRFS_I(inode)->root; | |
| 4149 | 4150 | if (btrfs_root_refs(&root->root_item) == 0) |
| 4150 | 4151 | return 1; |
| 4152 | + | |
| 4153 | + if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) | |
| 4154 | + return 1; | |
| 4151 | 4155 | } |
| 4152 | 4156 | return 0; |
| 4153 | 4157 | } |
| @@ -4188,7 +4192,6 @@ static int btrfs_real_readdir(struct file *filp, void *dirent, · 34 unmodified lines | ||
| 4188 | 4192 | struct btrfs_path *path; |
| 4189 | 4193 | struct list_head ins_list; |
| 4190 | 4194 | struct list_head del_list; |
| 4191 | − struct qstr q; | |
| 4192 | 4195 | int ret; |
| 4193 | 4196 | struct extent_buffer *leaf; |
| 4194 | 4197 | int slot; |
| @@ -4279,7 +4282,6 @@ static int btrfs_real_readdir(struct file *filp, void *dirent, · 84 unmodified lines | ||
| 4279 | 4282 | |
| 4280 | 4283 | while (di_cur < di_total) { |
| 4281 | 4284 | struct btrfs_key location; |
| 4282 | − struct dentry *tmp; | |
| 4283 | 4285 | |
| 4284 | 4286 | if (verify_dir_item(root, leaf, di)) |
| 4285 | 4287 | break; |
| @@ -4300,35 +4302,15 @@ static int btrfs_real_readdir(struct file *filp, void *dirent, · 14 unmodified lines | ||
| 4300 | 4302 | d_type = btrfs_filetype_table[btrfs_dir_type(leaf, di)]; |
| 4301 | 4303 | btrfs_dir_item_key_to_cpu(leaf, di, &location); |
| 4302 | 4304 | |
| 4303 | − q.name = name_ptr; | |
| 4304 | − q.len = name_len; | |
| 4305 | − q.hash = full_name_hash(q.name, q.len); | |
| 4306 | − tmp = d_lookup(filp->f_dentry, &q); | |
| 4307 | − if (!tmp) { | |
| 4308 | − struct btrfs_key *newkey; | |
| 4309 | − | |
| 4310 | − newkey = kzalloc(sizeof(struct btrfs_key), | |
| 4311 | − GFP_NOFS); | |
| 4312 | − if (!newkey) | |
| 4313 | − goto no_dentry; | |
| 4314 | − tmp = d_alloc(filp->f_dentry, &q); | |
| 4315 | − if (!tmp) { | |
| 4316 | − kfree(newkey); | |
| 4317 | − dput(tmp); | |
| 4318 | − goto no_dentry; | |
| 4319 | − } | |
| 4320 | − memcpy(newkey, &location, | |
| 4321 | − sizeof(struct btrfs_key)); | |
| 4322 | − tmp->d_fsdata = newkey; | |
| 4323 | − tmp->d_flags |= DCACHE_NEED_LOOKUP; | |
| 4324 | − d_rehash(tmp); | |
| 4325 | − dput(tmp); | |
| 4326 | − } else { | |
| 4327 | − dput(tmp); | |
| 4328 | − } | |
| 4329 | −no_dentry: | |
| 4305 | + | |
| 4330 | 4306 | /* is this a reference to our own snapshot? If so |
| 4331 | − * skip it | |
| 4307 | + * skip it. | |
| 4308 | + * | |
| 4309 | + * In contrast to old kernels, we insert the snapshot's | |
| 4310 | + * dir item and dir index after it has been created, so | |
| 4311 | + * we won't find a reference to our own snapshot. We | |
| 4312 | + * still keep the following code for backward | |
| 4313 | + * compatibility. | |
| 4332 | 4314 | */ |
| 4333 | 4315 | if (location.type == BTRFS_ROOT_ITEM_KEY && |
| 4334 | 4316 | location.objectid == root->root_key.objectid) { |
| @@ -2262,7 +2262,10 @@ static long btrfs_ioctl_dev_info(struct btrfs_root *root, void __user *arg) · 2261 unmodified lines | ||
| 2262 | 2262 | di_args->bytes_used = dev->bytes_used; |
| 2263 | 2263 | di_args->total_bytes = dev->total_bytes; |
| 2264 | 2264 | memcpy(di_args->uuid, dev->uuid, sizeof(di_args->uuid)); |
| 2265 | − strncpy(di_args->path, dev->name, sizeof(di_args->path)); | |
| 2265 | + if (dev->name) | |
| 2266 | + strncpy(di_args->path, dev->name, sizeof(di_args->path)); | |
| 2267 | + else | |
| 2268 | + di_args->path[0] = '\0'; | |
| 2266 | 2269 | |
| 2267 | 2270 | out: |
| 2268 | 2271 | if (ret == 0 && copy_to_user(arg, di_args, sizeof(*di_args))) |
| @@ -250,14 +250,12 @@ static struct reada_zone *reada_find_zone(struct btrfs_fs_info *fs_info, · 249 unmodified lines | ||
| 250 | 250 | struct btrfs_bio *bbio) |
| 251 | 251 | { |
| 252 | 252 | int ret; |
| 253 | − int looped = 0; | |
| 254 | 253 | struct reada_zone *zone; |
| 255 | 254 | struct btrfs_block_group_cache *cache = NULL; |
| 256 | 255 | u64 start; |
| 257 | 256 | u64 end; |
| 258 | 257 | int i; |
| 259 | 258 | |
| 260 | −again: | |
| 261 | 259 | zone = NULL; |
| 262 | 260 | spin_lock(&fs_info->reada_lock); |
| 263 | 261 | ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, |
| @@ -274,9 +272,6 @@ again: · 10 unmodified lines | ||
| 274 | 272 | spin_unlock(&fs_info->reada_lock); |
| 275 | 273 | } |
| 276 | 274 | |
| 277 | − if (looped) | |
| 278 | − return NULL; | |
| 279 | − | |
| 280 | 275 | cache = btrfs_lookup_block_group(fs_info, logical); |
| 281 | 276 | if (!cache) |
| 282 | 277 | return NULL; |
| @@ -307,13 +302,15 @@ again: · 24 unmodified lines | ||
| 307 | 302 | ret = radix_tree_insert(&dev->reada_zones, |
| 308 | 303 | (unsigned long)(zone->end >> PAGE_CACHE_SHIFT), |
| 309 | 304 | zone); |
| 310 | − spin_unlock(&fs_info->reada_lock); | |
| 311 | 305 | |
| 312 | − if (ret) { | |
| 306 | + if (ret == -EEXIST) { | |
| 313 | 307 | kfree(zone); |
| 314 | − looped = 1; | |
| 315 | − goto again; | |
| 308 | + ret = radix_tree_gang_lookup(&dev->reada_zones, (void **)&zone, | |
| 309 | + logical >> PAGE_CACHE_SHIFT, 1); | |
| 310 | + if (ret == 1) | |
| 311 | + kref_get(&zone->refcnt); | |
| 316 | 312 | } |
| 313 | + spin_unlock(&fs_info->reada_lock); | |
| 317 | 314 | |
| 318 | 315 | return zone; |
| 319 | 316 | } |
| @@ -323,26 +320,26 @@ static struct reada_extent *reada_find_extent(struct btrfs_root *root, · 3 unmodified lines | ||
| 323 | 320 | struct btrfs_key *top, int level) |
| 324 | 321 | { |
| 325 | 322 | int ret; |
| 326 | − int looped = 0; | |
| 327 | 323 | struct reada_extent *re = NULL; |
| 324 | + struct reada_extent *re_exist = NULL; | |
| 328 | 325 | struct btrfs_fs_info *fs_info = root->fs_info; |
| 329 | 326 | struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree; |
| 330 | 327 | struct btrfs_bio *bbio = NULL; |
| 331 | 328 | struct btrfs_device *dev; |
| 329 | + struct btrfs_device *prev_dev; | |
| 332 | 330 | u32 blocksize; |
| 333 | 331 | u64 length; |
| 334 | 332 | int nzones = 0; |
| 335 | 333 | int i; |
| 336 | 334 | unsigned long index = logical >> PAGE_CACHE_SHIFT; |
| 337 | 335 | |
| 338 | −again: | |
| 339 | 336 | spin_lock(&fs_info->reada_lock); |
| 340 | 337 | re = radix_tree_lookup(&fs_info->reada_tree, index); |
| 341 | 338 | if (re) |
| 342 | 339 | kref_get(&re->refcnt); |
| 343 | 340 | spin_unlock(&fs_info->reada_lock); |
| 344 | 341 | |
| 345 | − if (re || looped) | |
| 342 | + if (re) | |
| 346 | 343 | return re; |
| 347 | 344 | |
| 348 | 345 | re = kzalloc(sizeof(*re), GFP_NOFS); |
| @@ -398,16 +395,31 @@ again: · 49 unmodified lines | ||
| 398 | 395 | /* insert extent in reada_tree + all per-device trees, all or nothing */ |
| 399 | 396 | spin_lock(&fs_info->reada_lock); |
| 400 | 397 | ret = radix_tree_insert(&fs_info->reada_tree, index, re); |
| 398 | + if (ret == -EEXIST) { | |
| 399 | + re_exist = radix_tree_lookup(&fs_info->reada_tree, index); | |
| 400 | + BUG_ON(!re_exist); | |
| 401 | + kref_get(&re_exist->refcnt); | |
| 402 | + spin_unlock(&fs_info->reada_lock); | |
| 403 | + goto error; | |
| 404 | + } | |
| 401 | 405 | if (ret) { |
| 402 | 406 | spin_unlock(&fs_info->reada_lock); |
| 403 | − if (ret != -ENOMEM) { | |
| 404 | − /* someone inserted the extent in the meantime */ | |
| 405 | − looped = 1; | |
| 406 | − } | |
| 407 | 407 | goto error; |
| 408 | 408 | } |
| 409 | + prev_dev = NULL; | |
| 409 | 410 | for (i = 0; i < nzones; ++i) { |
| 410 | 411 | dev = bbio->stripes[i].dev; |
| 412 | + if (dev == prev_dev) { | |
| 413 | + /* | |
| 414 | + * in case of DUP, just add the first zone. As both | |
| 415 | + * are on the same device, there's nothing to gain | |
| 416 | + * from adding both. | |
| 417 | + * Also, it wouldn't work, as the tree is per device | |
| 418 | + * and adding would fail with EEXIST | |
| 419 | + */ | |
| 420 | + continue; | |
| 421 | + } | |
| 422 | + prev_dev = dev; | |
| 411 | 423 | ret = radix_tree_insert(&dev->reada_extents, index, re); |
| 412 | 424 | if (ret) { |
| 413 | 425 | while (--i >= 0) { |
| @@ -450,9 +462,7 @@ error: · 36 unmodified lines | ||
| 450 | 462 | } |
| 451 | 463 | kfree(bbio); |
| 452 | 464 | kfree(re); |
| 453 | − if (looped) | |
| 454 | − goto again; | |
| 455 | − return NULL; | |
| 465 | + return re_exist; | |
| 456 | 466 | } |
| 457 | 467 | |
| 458 | 468 | static void reada_kref_dummy(struct kref *kr) |
| @@ -1279,7 +1279,9 @@ static int __update_reloc_root(struct btrfs_root *root, int del) · 1278 unmodified lines | ||
| 1279 | 1279 | if (rb_node) |
| 1280 | 1280 | backref_tree_panic(rb_node, -EEXIST, node->bytenr); |
| 1281 | 1281 | } else { |
| 1282 | + spin_lock(&root->fs_info->trans_lock); | |
| 1282 | 1283 | list_del_init(&root->root_list); |
| 1284 | + spin_unlock(&root->fs_info->trans_lock); | |
| 1283 | 1285 | kfree(node); |
| 1284 | 1286 | } |
| 1285 | 1287 | return 0; |
| @@ -3811,7 +3813,7 @@ restart: · 2525 unmodified lines | ||
| 3811 | 3813 | |
| 3812 | 3814 | ret = btrfs_block_rsv_check(rc->extent_root, rc->block_rsv, 5); |
| 3813 | 3815 | if (ret < 0) { |
| 3814 | − if (ret != -EAGAIN) { | |
| 3816 | + if (ret != -ENOSPC) { | |
| 3815 | 3817 | err = ret; |
| 3816 | 3818 | WARN_ON(1); |
| 3817 | 3819 | break; |
| @@ -1257,12 +1257,6 @@ static int scrub_checksum_data(struct scrub_block *sblock) · 1256 unmodified lines | ||
| 1257 | 1257 | if (memcmp(csum, on_disk_csum, sdev->csum_size)) |
| 1258 | 1258 | fail = 1; |
| 1259 | 1259 | |
| 1260 | − if (fail) { | |
| 1261 | − spin_lock(&sdev->stat_lock); | |
| 1262 | − ++sdev->stat.csum_errors; | |
| 1263 | − spin_unlock(&sdev->stat_lock); | |
| 1264 | − } | |
| 1265 | − | |
| 1266 | 1260 | return fail; |
| 1267 | 1261 | } |
| 1268 | 1262 | |
| @@ -1335,15 +1329,6 @@ static int scrub_checksum_tree_block(struct scrub_block *sblock) · 66 unmodified lines | ||
| 1335 | 1329 | if (memcmp(calculated_csum, on_disk_csum, sdev->csum_size)) |
| 1336 | 1330 | ++crc_fail; |
| 1337 | 1331 | |
| 1338 | − if (crc_fail || fail) { | |
| 1339 | − spin_lock(&sdev->stat_lock); | |
| 1340 | − if (crc_fail) | |
| 1341 | − ++sdev->stat.csum_errors; | |
| 1342 | − if (fail) | |
| 1343 | − ++sdev->stat.verify_errors; | |
| 1344 | − spin_unlock(&sdev->stat_lock); | |
| 1345 | − } | |
| 1346 | − | |
| 1347 | 1332 | return fail || crc_fail; |
| 1348 | 1333 | } |
| 1349 | 1334 | |
| @@ -815,7 +815,6 @@ int btrfs_sync_fs(struct super_block *sb, int wait) · 814 unmodified lines | ||
| 815 | 815 | return 0; |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | − btrfs_start_delalloc_inodes(root, 0); | |
| 819 | 818 | btrfs_wait_ordered_extents(root, 0, 0); |
| 820 | 819 | |
| 821 | 820 | trans = btrfs_start_transaction(root, 0); |
| @@ -1148,13 +1147,15 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) · 326 unmodified lines | ||
| 1148 | 1147 | if (ret) |
| 1149 | 1148 | goto restore; |
| 1150 | 1149 | } else { |
| 1151 | − if (fs_info->fs_devices->rw_devices == 0) | |
| 1150 | + if (fs_info->fs_devices->rw_devices == 0) { | |
| 1152 | 1151 | ret = -EACCES; |
| 1153 | 1152 | goto restore; |
| 1153 | + } | |
| 1154 | 1154 | |
| 1155 | − if (btrfs_super_log_root(fs_info->super_copy) != 0) | |
| 1155 | + if (btrfs_super_log_root(fs_info->super_copy) != 0) { | |
| 1156 | 1156 | ret = -EINVAL; |
| 1157 | 1157 | goto restore; |
| 1158 | + } | |
| 1158 | 1159 | |
| 1159 | 1160 | ret = btrfs_cleanup_fs_roots(fs_info); |
| 1160 | 1161 | if (ret) |
| @@ -73,8 +73,10 @@ loop: · 72 unmodified lines | ||
| 73 | 73 | |
| 74 | 74 | cur_trans = root->fs_info->running_transaction; |
| 75 | 75 | if (cur_trans) { |
| 76 | − if (cur_trans->aborted) | |
| 76 | + if (cur_trans->aborted) { | |
| 77 | + spin_unlock(&root->fs_info->trans_lock); | |
| 77 | 78 | return cur_trans->aborted; |
| 79 | + } | |
| 78 | 80 | atomic_inc(&cur_trans->use_count); |
| 79 | 81 | atomic_inc(&cur_trans->num_writers); |
| 80 | 82 | cur_trans->num_joined++; |
| @@ -1400,6 +1402,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, · 1319 unmodified lines | ||
| 1400 | 1402 | ret = commit_fs_roots(trans, root); |
| 1401 | 1403 | if (ret) { |
| 1402 | 1404 | mutex_unlock(&root->fs_info->tree_log_mutex); |
| 1405 | + mutex_unlock(&root->fs_info->reloc_mutex); | |
| 1403 | 1406 | goto cleanup_transaction; |
| 1404 | 1407 | } |
| 1405 | 1408 | |
| @@ -1411,6 +1414,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, · 5 unmodified lines | ||
| 1411 | 1414 | ret = commit_cowonly_roots(trans, root); |
| 1412 | 1415 | if (ret) { |
| 1413 | 1416 | mutex_unlock(&root->fs_info->tree_log_mutex); |
| 1417 | + mutex_unlock(&root->fs_info->reloc_mutex); | |
| 1414 | 1418 | goto cleanup_transaction; |
| 1415 | 1419 | } |
| 1416 | 1420 | |
| @@ -3324,12 +3324,14 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, · 3323 unmodified lines | ||
| 3324 | 3324 | stripe_size = devices_info[ndevs-1].max_avail; |
| 3325 | 3325 | num_stripes = ndevs * dev_stripes; |
| 3326 | 3326 | |
| 3327 | − if (stripe_size * num_stripes > max_chunk_size * ncopies) { | |
| 3327 | + if (stripe_size * ndevs > max_chunk_size * ncopies) { | |
| 3328 | 3328 | stripe_size = max_chunk_size * ncopies; |
| 3329 | − do_div(stripe_size, num_stripes); | |
| 3329 | + do_div(stripe_size, ndevs); | |
| 3330 | 3330 | } |
| 3331 | 3331 | |
| 3332 | 3332 | do_div(stripe_size, dev_stripes); |
| 3333 | + | |
| 3334 | + /* align to BTRFS_STRIPE_LEN */ | |
| 3333 | 3335 | do_div(stripe_size, BTRFS_STRIPE_LEN); |
| 3334 | 3336 | stripe_size *= BTRFS_STRIPE_LEN; |
| 3335 | 3337 | |
| @@ -3805,10 +3807,11 @@ static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, · 469 unmodified lines | ||
| 3805 | 3807 | else if (mirror_num) |
| 3806 | 3808 | stripe_index += mirror_num - 1; |
| 3807 | 3809 | else { |
| 3810 | + int old_stripe_index = stripe_index; | |
| 3808 | 3811 | stripe_index = find_live_mirror(map, stripe_index, |
| 3809 | 3812 | map->sub_stripes, stripe_index + |
| 3810 | 3813 | current->pid % map->sub_stripes); |
| 3811 | − mirror_num = stripe_index + 1; | |
| 3814 | + mirror_num = stripe_index - old_stripe_index + 1; | |
| 3812 | 3815 | } |
| 3813 | 3816 | } else { |
| 3814 | 3817 | /* |
| @@ -4350,8 +4353,10 @@ static int open_seed_devices(struct btrfs_root *root, u8 *fsid) · 535 unmodified lines | ||
| 4350 | 4353 | |
| 4351 | 4354 | ret = __btrfs_open_devices(fs_devices, FMODE_READ, |
| 4352 | 4355 | root->fs_info->bdev_holder); |
| 4353 | − if (ret) | |
| 4356 | + if (ret) { | |
| 4357 | + free_fs_devices(fs_devices); | |
| 4354 | 4358 | goto out; |
| 4359 | + } | |
| 4355 | 4360 | |
| 4356 | 4361 | if (!fs_devices->seeding) { |
| 4357 | 4362 | __btrfs_close_devices(fs_devices); |
| @@ -985,7 +985,6 @@ grow_dev_page(struct block_device *bdev, sector_t block, · 984 unmodified lines | ||
| 985 | 985 | return page; |
| 986 | 986 | |
| 987 | 987 | failed: |
| 988 | − BUG(); | |
| 989 | 988 | unlock_page(page); |
| 990 | 989 | page_cache_release(page); |
| 991 | 990 | return NULL; |
| @@ -370,13 +370,13 @@ cifs_show_options(struct seq_file *s, struct dentry *root) · 369 unmodified lines | ||
| 370 | 370 | (int)(srcaddr->sa_family)); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | − seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); | |
| 373 | + seq_printf(s, ",uid=%u", cifs_sb->mnt_uid); | |
| 374 | 374 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) |
| 375 | 375 | seq_printf(s, ",forceuid"); |
| 376 | 376 | else |
| 377 | 377 | seq_printf(s, ",noforceuid"); |
| 378 | 378 | |
| 379 | − seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); | |
| 379 | + seq_printf(s, ",gid=%u", cifs_sb->mnt_gid); | |
| 380 | 380 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) |
| 381 | 381 | seq_printf(s, ",forcegid"); |
| 382 | 382 | else |
| @@ -434,9 +434,13 @@ cifs_show_options(struct seq_file *s, struct dentry *root) · 51 unmodified lines | ||
| 434 | 434 | seq_printf(s, ",noperm"); |
| 435 | 435 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) |
| 436 | 436 | seq_printf(s, ",strictcache"); |
| 437 | + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPUID) | |
| 438 | + seq_printf(s, ",backupuid=%u", cifs_sb->mnt_backupuid); | |
| 439 | + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_BACKUPGID) | |
| 440 | + seq_printf(s, ",backupgid=%u", cifs_sb->mnt_backupgid); | |
| 437 | 441 | |
| 438 | − seq_printf(s, ",rsize=%d", cifs_sb->rsize); | |
| 439 | − seq_printf(s, ",wsize=%d", cifs_sb->wsize); | |
| 442 | + seq_printf(s, ",rsize=%u", cifs_sb->rsize); | |
| 443 | + seq_printf(s, ",wsize=%u", cifs_sb->wsize); | |
| 440 | 444 | /* convert actimeo and display it in seconds */ |
| 441 | 445 | seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ); |
| 442 | 446 | |
| @@ -109,6 +109,8 @@ enum { · 108 unmodified lines | ||
| 109 | 109 | |
| 110 | 110 | /* Options which could be blank */ |
| 111 | 111 | Opt_blank_pass, |
| 112 | + Opt_blank_user, | |
| 113 | + Opt_blank_ip, | |
| 112 | 114 | |
| 113 | 115 | Opt_err |
| 114 | 116 | }; |
| @@ -183,11 +185,15 @@ static const match_table_t cifs_mount_option_tokens = { · 68 unmodified lines | ||
| 183 | 185 | { Opt_wsize, "wsize=%s" }, |
| 184 | 186 | { Opt_actimeo, "actimeo=%s" }, |
| 185 | 187 | |
| 188 | + { Opt_blank_user, "user=" }, | |
| 189 | + { Opt_blank_user, "username=" }, | |
| 186 | 190 | { Opt_user, "user=%s" }, |
| 187 | 191 | { Opt_user, "username=%s" }, |
| 188 | 192 | { Opt_blank_pass, "pass=" }, |
| 189 | 193 | { Opt_pass, "pass=%s" }, |
| 190 | 194 | { Opt_pass, "password=%s" }, |
| 195 | + { Opt_blank_ip, "ip=" }, | |
| 196 | + { Opt_blank_ip, "addr=" }, | |
| 191 | 197 | { Opt_ip, "ip=%s" }, |
| 192 | 198 | { Opt_ip, "addr=%s" }, |
| 193 | 199 | { Opt_unc, "unc=%s" }, |
| @@ -1117,7 +1123,7 @@ static int get_option_ul(substring_t args[], unsigned long *option) · 923 unmodified lines | ||
| 1117 | 1123 | string = match_strdup(args); |
| 1118 | 1124 | if (string == NULL) |
| 1119 | 1125 | return -ENOMEM; |
| 1120 | − rc = kstrtoul(string, 10, option); | |
| 1126 | + rc = kstrtoul(string, 0, option); | |
| 1121 | 1127 | kfree(string); |
| 1122 | 1128 | |
| 1123 | 1129 | return rc; |
| @@ -1534,15 +1540,17 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 410 unmodified lines | ||
| 1534 | 1540 | |
| 1535 | 1541 | /* String Arguments */ |
| 1536 | 1542 | |
| 1543 | + case Opt_blank_user: | |
| 1544 | + /* null user, ie. anonymous authentication */ | |
| 1545 | + vol->nullauth = 1; | |
| 1546 | + vol->username = NULL; | |
| 1547 | + break; | |
| 1537 | 1548 | case Opt_user: |
| 1538 | 1549 | string = match_strdup(args); |
| 1539 | 1550 | if (string == NULL) |
| 1540 | 1551 | goto out_nomem; |
| 1541 | 1552 | |
| 1542 | − if (!*string) { | |
| 1543 | − /* null user, ie. anonymous authentication */ | |
| 1544 | − vol->nullauth = 1; | |
| 1545 | − } else if (strnlen(string, MAX_USERNAME_SIZE) > | |
| 1553 | + if (strnlen(string, MAX_USERNAME_SIZE) > | |
| 1546 | 1554 | MAX_USERNAME_SIZE) { |
| 1547 | 1555 | printk(KERN_WARNING "CIFS: username too long\n"); |
| 1548 | 1556 | goto cifs_parse_mount_err; |
| @@ -1611,14 +1619,15 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 62 unmodified lines | ||
| 1611 | 1619 | } |
| 1612 | 1620 | vol->password[j] = '\0'; |
| 1613 | 1621 | break; |
| 1622 | + case Opt_blank_ip: | |
| 1623 | + vol->UNCip = NULL; | |
| 1624 | + break; | |
| 1614 | 1625 | case Opt_ip: |
| 1615 | 1626 | string = match_strdup(args); |
| 1616 | 1627 | if (string == NULL) |
| 1617 | 1628 | goto out_nomem; |
| 1618 | 1629 | |
| 1619 | − if (!*string) { | |
| 1620 | − vol->UNCip = NULL; | |
| 1621 | − } else if (strnlen(string, INET6_ADDRSTRLEN) > | |
| 1630 | + if (strnlen(string, INET6_ADDRSTRLEN) > | |
| 1622 | 1631 | INET6_ADDRSTRLEN) { |
| 1623 | 1632 | printk(KERN_WARNING "CIFS: ip address " |
| 1624 | 1633 | "too long\n"); |
| @@ -1636,12 +1645,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 11 unmodified lines | ||
| 1636 | 1645 | if (string == NULL) |
| 1637 | 1646 | goto out_nomem; |
| 1638 | 1647 | |
| 1639 | − if (!*string) { | |
| 1640 | − printk(KERN_WARNING "CIFS: invalid path to " | |
| 1641 | − "network resource\n"); | |
| 1642 | − goto cifs_parse_mount_err; | |
| 1643 | − } | |
| 1644 | − | |
| 1645 | 1648 | temp_len = strnlen(string, 300); |
| 1646 | 1649 | if (temp_len == 300) { |
| 1647 | 1650 | printk(KERN_WARNING "CIFS: UNC name too long\n"); |
| @@ -1670,11 +1673,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 22 unmodified lines | ||
| 1670 | 1673 | if (string == NULL) |
| 1671 | 1674 | goto out_nomem; |
| 1672 | 1675 | |
| 1673 | − if (!*string) { | |
| 1674 | − printk(KERN_WARNING "CIFS: invalid domain" | |
| 1675 | − " name\n"); | |
| 1676 | − goto cifs_parse_mount_err; | |
| 1677 | − } else if (strnlen(string, 256) == 256) { | |
| 1676 | + if (strnlen(string, 256) == 256) { | |
| 1678 | 1677 | printk(KERN_WARNING "CIFS: domain name too" |
| 1679 | 1678 | " long\n"); |
| 1680 | 1679 | goto cifs_parse_mount_err; |
| @@ -1693,11 +1692,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 12 unmodified lines | ||
| 1693 | 1692 | if (string == NULL) |
| 1694 | 1693 | goto out_nomem; |
| 1695 | 1694 | |
| 1696 | − if (!*string) { | |
| 1697 | − printk(KERN_WARNING "CIFS: srcaddr value not" | |
| 1698 | − " specified\n"); | |
| 1699 | − goto cifs_parse_mount_err; | |
| 1700 | − } else if (!cifs_convert_address( | |
| 1695 | + if (!cifs_convert_address( | |
| 1701 | 1696 | (struct sockaddr *)&vol->srcaddr, |
| 1702 | 1697 | string, strlen(string))) { |
| 1703 | 1698 | printk(KERN_WARNING "CIFS: Could not parse" |
| @@ -1710,11 +1705,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 6 unmodified lines | ||
| 1710 | 1705 | if (string == NULL) |
| 1711 | 1706 | goto out_nomem; |
| 1712 | 1707 | |
| 1713 | − if (!*string) { | |
| 1714 | − printk(KERN_WARNING "CIFS: Invalid path" | |
| 1715 | − " prefix\n"); | |
| 1716 | − goto cifs_parse_mount_err; | |
| 1717 | − } | |
| 1718 | 1708 | temp_len = strnlen(string, 1024); |
| 1719 | 1709 | if (string[0] != '/') |
| 1720 | 1710 | temp_len++; /* missing leading slash */ |
| @@ -1742,11 +1732,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 21 unmodified lines | ||
| 1742 | 1732 | if (string == NULL) |
| 1743 | 1733 | goto out_nomem; |
| 1744 | 1734 | |
| 1745 | − if (!*string) { | |
| 1746 | − printk(KERN_WARNING "CIFS: Invalid iocharset" | |
| 1747 | − " specified\n"); | |
| 1748 | − goto cifs_parse_mount_err; | |
| 1749 | − } else if (strnlen(string, 1024) >= 65) { | |
| 1735 | + if (strnlen(string, 1024) >= 65) { | |
| 1750 | 1736 | printk(KERN_WARNING "CIFS: iocharset name " |
| 1751 | 1737 | "too long.\n"); |
| 1752 | 1738 | goto cifs_parse_mount_err; |
| @@ -1771,11 +1757,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 18 unmodified lines | ||
| 1771 | 1757 | if (string == NULL) |
| 1772 | 1758 | goto out_nomem; |
| 1773 | 1759 | |
| 1774 | − if (!*string) { | |
| 1775 | − printk(KERN_WARNING "CIFS: No socket option" | |
| 1776 | − " specified\n"); | |
| 1777 | − goto cifs_parse_mount_err; | |
| 1778 | − } | |
| 1779 | 1760 | if (strnicmp(string, "TCP_NODELAY", 11) == 0) |
| 1780 | 1761 | vol->sockopt_tcp_nodelay = 1; |
| 1781 | 1762 | break; |
| @@ -1784,12 +1765,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 2 unmodified lines | ||
| 1784 | 1765 | if (string == NULL) |
| 1785 | 1766 | goto out_nomem; |
| 1786 | 1767 | |
| 1787 | − if (!*string) { | |
| 1788 | − printk(KERN_WARNING "CIFS: Invalid (empty)" | |
| 1789 | − " netbiosname\n"); | |
| 1790 | − break; | |
| 1791 | − } | |
| 1792 | − | |
| 1793 | 1768 | memset(vol->source_rfc1001_name, 0x20, |
| 1794 | 1769 | RFC1001_NAME_LEN); |
| 1795 | 1770 | /* |
| @@ -1817,11 +1792,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 21 unmodified lines | ||
| 1817 | 1792 | if (string == NULL) |
| 1818 | 1793 | goto out_nomem; |
| 1819 | 1794 | |
| 1820 | − if (!*string) { | |
| 1821 | − printk(KERN_WARNING "CIFS: Empty server" | |
| 1822 | − " netbiosname specified\n"); | |
| 1823 | − break; | |
| 1824 | − } | |
| 1825 | 1795 | /* last byte, type, is 0x20 for servr type */ |
| 1826 | 1796 | memset(vol->target_rfc1001_name, 0x20, |
| 1827 | 1797 | RFC1001_NAME_LEN_WITH_NULL); |
| @@ -1848,12 +1818,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 20 unmodified lines | ||
| 1848 | 1818 | if (string == NULL) |
| 1849 | 1819 | goto out_nomem; |
| 1850 | 1820 | |
| 1851 | − if (!*string) { | |
| 1852 | − cERROR(1, "no protocol version specified" | |
| 1853 | − " after vers= mount option"); | |
| 1854 | − goto cifs_parse_mount_err; | |
| 1855 | − } | |
| 1856 | − | |
| 1857 | 1821 | if (strnicmp(string, "cifs", 4) == 0 || |
| 1858 | 1822 | strnicmp(string, "1", 1) == 0) { |
| 1859 | 1823 | /* This is the default */ |
| @@ -1868,12 +1832,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 8 unmodified lines | ||
| 1868 | 1832 | if (string == NULL) |
| 1869 | 1833 | goto out_nomem; |
| 1870 | 1834 | |
| 1871 | − if (!*string) { | |
| 1872 | − printk(KERN_WARNING "CIFS: no security flavor" | |
| 1873 | − " specified\n"); | |
| 1874 | − break; | |
| 1875 | − } | |
| 1876 | − | |
| 1877 | 1835 | if (cifs_parse_security_flavors(string, vol) != 0) |
| 1878 | 1836 | goto cifs_parse_mount_err; |
| 1879 | 1837 | break; |
| @@ -3270,10 +3228,6 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, · 1390 unmodified lines | ||
| 3270 | 3228 | |
| 3271 | 3229 | cifs_sb->mnt_uid = pvolume_info->linux_uid; |
| 3272 | 3230 | cifs_sb->mnt_gid = pvolume_info->linux_gid; |
| 3273 | − if (pvolume_info->backupuid_specified) | |
| 3274 | − cifs_sb->mnt_backupuid = pvolume_info->backupuid; | |
| 3275 | − if (pvolume_info->backupgid_specified) | |
| 3276 | − cifs_sb->mnt_backupgid = pvolume_info->backupgid; | |
| 3277 | 3231 | cifs_sb->mnt_file_mode = pvolume_info->file_mode; |
| 3278 | 3232 | cifs_sb->mnt_dir_mode = pvolume_info->dir_mode; |
| 3279 | 3233 | cFYI(1, "file mode: 0x%hx dir mode: 0x%hx", |
| @@ -3304,10 +3258,14 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, · 24 unmodified lines | ||
| 3304 | 3258 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_RWPIDFORWARD; |
| 3305 | 3259 | if (pvolume_info->cifs_acl) |
| 3306 | 3260 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_ACL; |
| 3307 | − if (pvolume_info->backupuid_specified) | |
| 3261 | + if (pvolume_info->backupuid_specified) { | |
| 3308 | 3262 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_BACKUPUID; |
| 3309 | − if (pvolume_info->backupgid_specified) | |
| 3263 | + cifs_sb->mnt_backupuid = pvolume_info->backupuid; | |
| 3264 | + } | |
| 3265 | + if (pvolume_info->backupgid_specified) { | |
| 3310 | 3266 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CIFS_BACKUPGID; |
| 3267 | + cifs_sb->mnt_backupgid = pvolume_info->backupgid; | |
| 3268 | + } | |
| 3311 | 3269 | if (pvolume_info->override_uid) |
| 3312 | 3270 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_UID; |
| 3313 | 3271 | if (pvolume_info->override_gid) |
| @@ -2178,7 +2178,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov, · 2177 unmodified lines | ||
| 2178 | 2178 | unsigned long nr_pages, i; |
| 2179 | 2179 | size_t copied, len, cur_len; |
| 2180 | 2180 | ssize_t total_written = 0; |
| 2181 | − loff_t offset = *poffset; | |
| 2181 | + loff_t offset; | |
| 2182 | 2182 | struct iov_iter it; |
| 2183 | 2183 | struct cifsFileInfo *open_file; |
| 2184 | 2184 | struct cifs_tcon *tcon; |
| @@ -2200,6 +2200,7 @@ cifs_iovec_write(struct file *file, const struct iovec *iov, · 15 unmodified lines | ||
| 2200 | 2200 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
| 2201 | 2201 | open_file = file->private_data; |
| 2202 | 2202 | tcon = tlink_tcon(open_file->tlink); |
| 2203 | + offset = *poffset; | |
| 2203 | 2204 | |
| 2204 | 2205 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) |
| 2205 | 2206 | pid = open_file->pid; |
| @@ -1736,6 +1736,18 @@ static int _can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now) · 1735 unmodified lines | ||
| 1736 | 1736 | if (now && conv && !(lkb->lkb_exflags & DLM_LKF_QUECVT)) |
| 1737 | 1737 | return 1; |
| 1738 | 1738 | |
| 1739 | + /* | |
| 1740 | + * Even if the convert is compat with all granted locks, | |
| 1741 | + * QUECVT forces it behind other locks on the convert queue. | |
| 1742 | + */ | |
| 1743 | + | |
| 1744 | + if (now && conv && (lkb->lkb_exflags & DLM_LKF_QUECVT)) { | |
| 1745 | + if (list_empty(&r->res_convertqueue)) | |
| 1746 | + return 1; | |
| 1747 | + else | |
| 1748 | + goto out; | |
| 1749 | + } | |
| 1750 | + | |
| 1739 | 1751 | /* |
| 1740 | 1752 | * The NOORDER flag is set to avoid the standard vms rules on grant |
| 1741 | 1753 | * order. |
| @@ -1663,8 +1663,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, · 1662 unmodified lines | ||
| 1663 | 1663 | if (op == EPOLL_CTL_ADD) { |
| 1664 | 1664 | if (is_file_epoll(tfile)) { |
| 1665 | 1665 | error = -ELOOP; |
| 1666 | − if (ep_loop_check(ep, tfile) != 0) | |
| 1666 | + if (ep_loop_check(ep, tfile) != 0) { | |
| 1667 | + clear_tfile_check_list(); | |
| 1667 | 1668 | goto error_tgt_fput; |
| 1669 | + } | |
| 1668 | 1670 | } else |
| 1669 | 1671 | list_add(&tfile->f_tfile_llink, &tfile_check_list); |
| 1670 | 1672 | } |
| @@ -1203,9 +1203,6 @@ struct ext4_sb_info { · 1202 unmodified lines | ||
| 1203 | 1203 | unsigned long s_ext_blocks; |
| 1204 | 1204 | unsigned long s_ext_extents; |
| 1205 | 1205 | #endif |
| 1206 | − /* ext4 extent cache stats */ | |
| 1207 | − unsigned long extent_cache_hits; | |
| 1208 | − unsigned long extent_cache_misses; | |
| 1209 | 1206 | |
| 1210 | 1207 | /* for buddy allocator */ |
| 1211 | 1208 | struct ext4_group_info ***s_group_info; |
| @@ -2066,10 +2066,6 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block, · 2065 unmodified lines | ||
| 2066 | 2066 | ret = 1; |
| 2067 | 2067 | } |
| 2068 | 2068 | errout: |
| 2069 | − if (!ret) | |
| 2070 | − sbi->extent_cache_misses++; | |
| 2071 | − else | |
| 2072 | − sbi->extent_cache_hits++; | |
| 2073 | 2069 | trace_ext4_ext_in_cache(inode, block, ret); |
| 2074 | 2070 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); |
| 2075 | 2071 | return ret; |
| @@ -2882,7 +2878,7 @@ static int ext4_split_extent_at(handle_t *handle, · 806 unmodified lines | ||
| 2882 | 2878 | if (err) |
| 2883 | 2879 | goto fix_extent_len; |
| 2884 | 2880 | /* update the extent length and mark as initialized */ |
| 2885 | − ex->ee_len = cpu_to_le32(ee_len); | |
| 2881 | + ex->ee_len = cpu_to_le16(ee_len); | |
| 2886 | 2882 | ext4_ext_try_to_merge(inode, path, ex); |
| 2887 | 2883 | err = ext4_ext_dirty(handle, inode, path + depth); |
| 2888 | 2884 | goto out; |
| @@ -1305,20 +1305,20 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args) · 1304 unmodified lines | ||
| 1305 | 1305 | ext4_msg(sb, KERN_ERR, |
| 1306 | 1306 | "Cannot change journaled " |
| 1307 | 1307 | "quota options when quota turned on"); |
| 1308 | − return 0; | |
| 1308 | + return -1; | |
| 1309 | 1309 | } |
| 1310 | 1310 | qname = match_strdup(args); |
| 1311 | 1311 | if (!qname) { |
| 1312 | 1312 | ext4_msg(sb, KERN_ERR, |
| 1313 | 1313 | "Not enough memory for storing quotafile name"); |
| 1314 | − return 0; | |
| 1314 | + return -1; | |
| 1315 | 1315 | } |
| 1316 | 1316 | if (sbi->s_qf_names[qtype] && |
| 1317 | 1317 | strcmp(sbi->s_qf_names[qtype], qname)) { |
| 1318 | 1318 | ext4_msg(sb, KERN_ERR, |
| 1319 | 1319 | "%s quota file already specified", QTYPE2NAME(qtype)); |
| 1320 | 1320 | kfree(qname); |
| 1321 | − return 0; | |
| 1321 | + return -1; | |
| 1322 | 1322 | } |
| 1323 | 1323 | sbi->s_qf_names[qtype] = qname; |
| 1324 | 1324 | if (strchr(sbi->s_qf_names[qtype], '/')) { |
| @@ -1326,7 +1326,7 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args) · 1 unmodified line | ||
| 1326 | 1326 | "quotafile must be on filesystem root"); |
| 1327 | 1327 | kfree(sbi->s_qf_names[qtype]); |
| 1328 | 1328 | sbi->s_qf_names[qtype] = NULL; |
| 1329 | − return 0; | |
| 1329 | + return -1; | |
| 1330 | 1330 | } |
| 1331 | 1331 | set_opt(sb, QUOTA); |
| 1332 | 1332 | return 1; |
| @@ -1341,7 +1341,7 @@ static int clear_qf_name(struct super_block *sb, int qtype) · 8 unmodified lines | ||
| 1341 | 1341 | sbi->s_qf_names[qtype]) { |
| 1342 | 1342 | ext4_msg(sb, KERN_ERR, "Cannot change journaled quota options" |
| 1343 | 1343 | " when quota turned on"); |
| 1344 | − return 0; | |
| 1344 | + return -1; | |
| 1345 | 1345 | } |
| 1346 | 1346 | /* |
| 1347 | 1347 | * The space will be released later when all options are confirmed |
| @@ -1450,6 +1450,16 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, · 102 unmodified lines | ||
| 1450 | 1450 | const struct mount_opts *m; |
| 1451 | 1451 | int arg = 0; |
| 1452 | 1452 | |
| 1453 | +#ifdef CONFIG_QUOTA | |
| 1454 | + if (token == Opt_usrjquota) | |
| 1455 | + return set_qf_name(sb, USRQUOTA, &args[0]); | |
| 1456 | + else if (token == Opt_grpjquota) | |
| 1457 | + return set_qf_name(sb, GRPQUOTA, &args[0]); | |
| 1458 | + else if (token == Opt_offusrjquota) | |
| 1459 | + return clear_qf_name(sb, USRQUOTA); | |
| 1460 | + else if (token == Opt_offgrpjquota) | |
| 1461 | + return clear_qf_name(sb, GRPQUOTA); | |
| 1462 | +#endif | |
| 1453 | 1463 | if (args->from && match_int(args, &arg)) |
| 1454 | 1464 | return -1; |
| 1455 | 1465 | switch (token) { |
| @@ -1549,18 +1559,6 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, · 93 unmodified lines | ||
| 1549 | 1559 | sbi->s_mount_opt |= m->mount_opt; |
| 1550 | 1560 | } |
| 1551 | 1561 | #ifdef CONFIG_QUOTA |
| 1552 | − } else if (token == Opt_usrjquota) { | |
| 1553 | − if (!set_qf_name(sb, USRQUOTA, &args[0])) | |
| 1554 | − return -1; | |
| 1555 | − } else if (token == Opt_grpjquota) { | |
| 1556 | − if (!set_qf_name(sb, GRPQUOTA, &args[0])) | |
| 1557 | − return -1; | |
| 1558 | − } else if (token == Opt_offusrjquota) { | |
| 1559 | − if (!clear_qf_name(sb, USRQUOTA)) | |
| 1560 | − return -1; | |
| 1561 | − } else if (token == Opt_offgrpjquota) { | |
| 1562 | − if (!clear_qf_name(sb, GRPQUOTA)) | |
| 1563 | − return -1; | |
| 1564 | 1562 | } else if (m->flags & MOPT_QFMT) { |
| 1565 | 1563 | if (sb_any_quota_loaded(sb) && |
| 1566 | 1564 | sbi->s_jquota_fmt != m->mount_opt) { |
| @@ -1599,7 +1597,9 @@ static int parse_options(char *options, struct super_block *sb, · 32 unmodified lines | ||
| 1599 | 1597 | unsigned int *journal_ioprio, |
| 1600 | 1598 | int is_remount) |
| 1601 | 1599 | { |
| 1600 | +#ifdef CONFIG_QUOTA | |
| 1602 | 1601 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
| 1602 | +#endif | |
| 1603 | 1603 | char *p; |
| 1604 | 1604 | substring_t args[MAX_OPT_ARGS]; |
| 1605 | 1605 | int token; |
| @@ -2366,18 +2366,6 @@ static ssize_t lifetime_write_kbytes_show(struct ext4_attr *a, · 760 unmodified lines | ||
| 2366 | 2366 | EXT4_SB(sb)->s_sectors_written_start) >> 1))); |
| 2367 | 2367 | } |
| 2368 | 2368 | |
| 2369 | −static ssize_t extent_cache_hits_show(struct ext4_attr *a, | |
| 2370 | − struct ext4_sb_info *sbi, char *buf) | |
| 2371 | −{ | |
| 2372 | − return snprintf(buf, PAGE_SIZE, "%lu\n", sbi->extent_cache_hits); | |
| 2373 | −} | |
| 2374 | − | |
| 2375 | −static ssize_t extent_cache_misses_show(struct ext4_attr *a, | |
| 2376 | − struct ext4_sb_info *sbi, char *buf) | |
| 2377 | −{ | |
| 2378 | − return snprintf(buf, PAGE_SIZE, "%lu\n", sbi->extent_cache_misses); | |
| 2379 | −} | |
| 2380 | − | |
| 2381 | 2369 | static ssize_t inode_readahead_blks_store(struct ext4_attr *a, |
| 2382 | 2370 | struct ext4_sb_info *sbi, |
| 2383 | 2371 | const char *buf, size_t count) |
| @@ -2435,8 +2423,6 @@ static struct ext4_attr ext4_attr_##name = __ATTR(name, mode, show, store) · 51 unmodified lines | ||
| 2435 | 2423 | EXT4_RO_ATTR(delayed_allocation_blocks); |
| 2436 | 2424 | EXT4_RO_ATTR(session_write_kbytes); |
| 2437 | 2425 | EXT4_RO_ATTR(lifetime_write_kbytes); |
| 2438 | −EXT4_RO_ATTR(extent_cache_hits); | |
| 2439 | −EXT4_RO_ATTR(extent_cache_misses); | |
| 2440 | 2426 | EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, sbi_ui_show, |
| 2441 | 2427 | inode_readahead_blks_store, s_inode_readahead_blks); |
| 2442 | 2428 | EXT4_RW_ATTR_SBI_UI(inode_goal, s_inode_goal); |
| @@ -2452,8 +2438,6 @@ static struct attribute *ext4_attrs[] = { · 9 unmodified lines | ||
| 2452 | 2438 | ATTR_LIST(delayed_allocation_blocks), |
| 2453 | 2439 | ATTR_LIST(session_write_kbytes), |
| 2454 | 2440 | ATTR_LIST(lifetime_write_kbytes), |
| 2455 | − ATTR_LIST(extent_cache_hits), | |
| 2456 | − ATTR_LIST(extent_cache_misses), | |
| 2457 | 2441 | ATTR_LIST(inode_readahead_blks), |
| 2458 | 2442 | ATTR_LIST(inode_goal), |
| 2459 | 2443 | ATTR_LIST(mb_stats), |
| @@ -387,9 +387,6 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, · 386 unmodified lines | ||
| 387 | 387 | if (fc->no_create) |
| 388 | 388 | return -ENOSYS; |
| 389 | 389 | |
| 390 | − if (flags & O_DIRECT) | |
| 391 | − return -EINVAL; | |
| 392 | − | |
| 393 | 390 | forget = fuse_alloc_forget(); |
| 394 | 391 | if (!forget) |
| 395 | 392 | return -ENOMEM; |
| @@ -644,13 +641,12 @@ static int fuse_unlink(struct inode *dir, struct dentry *entry) · 248 unmodified lines | ||
| 644 | 641 | fuse_put_request(fc, req); |
| 645 | 642 | if (!err) { |
| 646 | 643 | struct inode *inode = entry->d_inode; |
| 644 | + struct fuse_inode *fi = get_fuse_inode(inode); | |
| 647 | 645 | |
| 648 | − /* | |
| 649 | − * Set nlink to zero so the inode can be cleared, if the inode | |
| 650 | − * does have more links this will be discovered at the next | |
| 651 | − * lookup/getattr. | |
| 652 | − */ | |
| 653 | − clear_nlink(inode); | |
| 646 | + spin_lock(&fc->lock); | |
| 647 | + fi->attr_version = ++fc->attr_version; | |
| 648 | + drop_nlink(inode); | |
| 649 | + spin_unlock(&fc->lock); | |
| 654 | 650 | fuse_invalidate_attr(inode); |
| 655 | 651 | fuse_invalidate_attr(dir); |
| 656 | 652 | fuse_invalidate_entry_cache(entry); |
| @@ -762,8 +758,17 @@ static int fuse_link(struct dentry *entry, struct inode *newdir, · 105 unmodified lines | ||
| 762 | 758 | will reflect changes in the backing inode (link count, |
| 763 | 759 | etc.) |
| 764 | 760 | */ |
| 765 | − if (!err || err == -EINTR) | |
| 761 | + if (!err) { | |
| 762 | + struct fuse_inode *fi = get_fuse_inode(inode); | |
| 763 | + | |
| 764 | + spin_lock(&fc->lock); | |
| 765 | + fi->attr_version = ++fc->attr_version; | |
| 766 | + inc_nlink(inode); | |
| 767 | + spin_unlock(&fc->lock); | |
| 768 | + fuse_invalidate_attr(inode); | |
| 769 | + } else if (err == -EINTR) { | |
| 766 | 770 | fuse_invalidate_attr(inode); |
| 771 | + } | |
| 767 | 772 | return err; |
| 768 | 773 | } |
| 769 | 774 | |
| @@ -194,10 +194,6 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir) · 193 unmodified lines | ||
| 194 | 194 | struct fuse_conn *fc = get_fuse_conn(inode); |
| 195 | 195 | int err; |
| 196 | 196 | |
| 197 | − /* VFS checks this, but only _after_ ->open() */ | |
| 198 | − if (file->f_flags & O_DIRECT) | |
| 199 | − return -EINVAL; | |
| 200 | − | |
| 201 | 197 | err = generic_file_open(inode, file); |
| 202 | 198 | if (err) |
| 203 | 199 | return err; |
| @@ -932,17 +928,23 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, · 728 unmodified lines | ||
| 932 | 928 | struct file *file = iocb->ki_filp; |
| 933 | 929 | struct address_space *mapping = file->f_mapping; |
| 934 | 930 | size_t count = 0; |
| 931 | + size_t ocount = 0; | |
| 935 | 932 | ssize_t written = 0; |
| 933 | + ssize_t written_buffered = 0; | |
| 936 | 934 | struct inode *inode = mapping->host; |
| 937 | 935 | ssize_t err; |
| 938 | 936 | struct iov_iter i; |
| 937 | + loff_t endbyte = 0; | |
| 939 | 938 | |
| 940 | 939 | WARN_ON(iocb->ki_pos != pos); |
| 941 | 940 | |
| 942 | − err = generic_segment_checks(iov, &nr_segs, &count, VERIFY_READ); | |
| 941 | + ocount = 0; | |
| 942 | + err = generic_segment_checks(iov, &nr_segs, &ocount, VERIFY_READ); | |
| 943 | 943 | if (err) |
| 944 | 944 | return err; |
| 945 | 945 | |
| 946 | + count = ocount; | |
| 947 | + | |
| 946 | 948 | mutex_lock(&inode->i_mutex); |
| 947 | 949 | vfs_check_frozen(inode->i_sb, SB_FREEZE_WRITE); |
| 948 | 950 | |
| @@ -962,11 +964,41 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, · 13 unmodified lines | ||
| 962 | 964 | |
| 963 | 965 | file_update_time(file); |
| 964 | 966 | |
| 965 | − iov_iter_init(&i, iov, nr_segs, count, 0); | |
| 966 | − written = fuse_perform_write(file, mapping, &i, pos); | |
| 967 | − if (written >= 0) | |
| 968 | − iocb->ki_pos = pos + written; | |
| 967 | + if (file->f_flags & O_DIRECT) { | |
| 968 | + written = generic_file_direct_write(iocb, iov, &nr_segs, | |
| 969 | + pos, &iocb->ki_pos, | |
| 970 | + count, ocount); | |
| 971 | + if (written < 0 || written == count) | |
| 972 | + goto out; | |
| 973 | + | |
| 974 | + pos += written; | |
| 975 | + count -= written; | |
| 969 | 976 | |
| 977 | + iov_iter_init(&i, iov, nr_segs, count, written); | |
| 978 | + written_buffered = fuse_perform_write(file, mapping, &i, pos); | |
| 979 | + if (written_buffered < 0) { | |
| 980 | + err = written_buffered; | |
| 981 | + goto out; | |
| 982 | + } | |
| 983 | + endbyte = pos + written_buffered - 1; | |
| 984 | + | |
| 985 | + err = filemap_write_and_wait_range(file->f_mapping, pos, | |
| 986 | + endbyte); | |
| 987 | + if (err) | |
| 988 | + goto out; | |
| 989 | + | |
| 990 | + invalidate_mapping_pages(file->f_mapping, | |
| 991 | + pos >> PAGE_CACHE_SHIFT, | |
| 992 | + endbyte >> PAGE_CACHE_SHIFT); | |
| 993 | + | |
| 994 | + written += written_buffered; | |
| 995 | + iocb->ki_pos = pos + written_buffered; | |
| 996 | + } else { | |
| 997 | + iov_iter_init(&i, iov, nr_segs, count, 0); | |
| 998 | + written = fuse_perform_write(file, mapping, &i, pos); | |
| 999 | + if (written >= 0) | |
| 1000 | + iocb->ki_pos = pos + written; | |
| 1001 | + } | |
| 970 | 1002 | out: |
| 971 | 1003 | current->backing_dev_info = NULL; |
| 972 | 1004 | mutex_unlock(&inode->i_mutex); |
| @@ -1101,30 +1133,41 @@ static ssize_t fuse_direct_read(struct file *file, char __user *buf, · 128 unmodified lines | ||
| 1101 | 1133 | return res; |
| 1102 | 1134 | } |
| 1103 | 1135 | |
| 1104 | −static ssize_t fuse_direct_write(struct file *file, const char __user *buf, | |
| 1105 | − size_t count, loff_t *ppos) | |
| 1136 | +static ssize_t __fuse_direct_write(struct file *file, const char __user *buf, | |
| 1137 | + size_t count, loff_t *ppos) | |
| 1106 | 1138 | { |
| 1107 | 1139 | struct inode *inode = file->f_path.dentry->d_inode; |
| 1108 | 1140 | ssize_t res; |
| 1109 | 1141 | |
| 1110 | − if (is_bad_inode(inode)) | |
| 1111 | − return -EIO; | |
| 1112 | − | |
| 1113 | − /* Don't allow parallel writes to the same file */ | |
| 1114 | − mutex_lock(&inode->i_mutex); | |
| 1115 | 1142 | res = generic_write_checks(file, ppos, &count, 0); |
| 1116 | 1143 | if (!res) { |
| 1117 | 1144 | res = fuse_direct_io(file, buf, count, ppos, 1); |
| 1118 | 1145 | if (res > 0) |
| 1119 | 1146 | fuse_write_update_size(inode, *ppos); |
| 1120 | 1147 | } |
| 1121 | − mutex_unlock(&inode->i_mutex); | |
| 1122 | 1148 | |
| 1123 | 1149 | fuse_invalidate_attr(inode); |
| 1124 | 1150 | |
| 1125 | 1151 | return res; |
| 1126 | 1152 | } |
| 1127 | 1153 | |
| 1154 | +static ssize_t fuse_direct_write(struct file *file, const char __user *buf, | |
| 1155 | + size_t count, loff_t *ppos) | |
| 1156 | +{ | |
| 1157 | + struct inode *inode = file->f_path.dentry->d_inode; | |
| 1158 | + ssize_t res; | |
| 1159 | + | |
| 1160 | + if (is_bad_inode(inode)) | |
| 1161 | + return -EIO; | |
| 1162 | + | |
| 1163 | + /* Don't allow parallel writes to the same file */ | |
| 1164 | + mutex_lock(&inode->i_mutex); | |
| 1165 | + res = __fuse_direct_write(file, buf, count, ppos); | |
| 1166 | + mutex_unlock(&inode->i_mutex); | |
| 1167 | + | |
| 1168 | + return res; | |
| 1169 | +} | |
| 1170 | + | |
| 1128 | 1171 | static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) |
| 1129 | 1172 | { |
| 1130 | 1173 | __free_page(req->pages[0]); |
| @@ -2077,6 +2120,57 @@ int fuse_notify_poll_wakeup(struct fuse_conn *fc, · 946 unmodified lines | ||
| 2077 | 2120 | return 0; |
| 2078 | 2121 | } |
| 2079 | 2122 | |
| 2123 | +static ssize_t fuse_loop_dio(struct file *filp, const struct iovec *iov, | |
| 2124 | + unsigned long nr_segs, loff_t *ppos, int rw) | |
| 2125 | +{ | |
| 2126 | + const struct iovec *vector = iov; | |
| 2127 | + ssize_t ret = 0; | |
| 2128 | + | |
| 2129 | + while (nr_segs > 0) { | |
| 2130 | + void __user *base; | |
| 2131 | + size_t len; | |
| 2132 | + ssize_t nr; | |
| 2133 | + | |
| 2134 | + base = vector->iov_base; | |
| 2135 | + len = vector->iov_len; | |
| 2136 | + vector++; | |
| 2137 | + nr_segs--; | |
| 2138 | + | |
| 2139 | + if (rw == WRITE) | |
| 2140 | + nr = __fuse_direct_write(filp, base, len, ppos); | |
| 2141 | + else | |
| 2142 | + nr = fuse_direct_read(filp, base, len, ppos); | |
| 2143 | + | |
| 2144 | + if (nr < 0) { | |
| 2145 | + if (!ret) | |
| 2146 | + ret = nr; | |
| 2147 | + break; | |
| 2148 | + } | |
| 2149 | + ret += nr; | |
| 2150 | + if (nr != len) | |
| 2151 | + break; | |
| 2152 | + } | |
| 2153 | + | |
| 2154 | + return ret; | |
| 2155 | +} | |
| 2156 | + | |
| 2157 | + | |
| 2158 | +static ssize_t | |
| 2159 | +fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |
| 2160 | + loff_t offset, unsigned long nr_segs) | |
| 2161 | +{ | |
| 2162 | + ssize_t ret = 0; | |
| 2163 | + struct file *file = NULL; | |
| 2164 | + loff_t pos = 0; | |
| 2165 | + | |
| 2166 | + file = iocb->ki_filp; | |
| 2167 | + pos = offset; | |
| 2168 | + | |
| 2169 | + ret = fuse_loop_dio(file, iov, nr_segs, &pos, rw); | |
| 2170 | + | |
| 2171 | + return ret; | |
| 2172 | +} | |
| 2173 | + | |
| 2080 | 2174 | static const struct file_operations fuse_file_operations = { |
| 2081 | 2175 | .llseek = fuse_file_llseek, |
| 2082 | 2176 | .read = do_sync_read, |
| @@ -2120,6 +2214,7 @@ static const struct address_space_operations fuse_file_aops = { · 37 unmodified lines | ||
| 2120 | 2214 | .readpages = fuse_readpages, |
| 2121 | 2215 | .set_page_dirty = __set_page_dirty_nobuffers, |
| 2122 | 2216 | .bmap = fuse_bmap, |
| 2217 | + .direct_IO = fuse_direct_IO, | |
| 2123 | 2218 | }; |
| 2124 | 2219 | |
| 2125 | 2220 | void fuse_init_file_inode(struct inode *inode) |
| @@ -947,6 +947,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) · 946 unmodified lines | ||
| 947 | 947 | sb->s_magic = FUSE_SUPER_MAGIC; |
| 948 | 948 | sb->s_op = &fuse_super_operations; |
| 949 | 949 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
| 950 | + sb->s_time_gran = 1; | |
| 950 | 951 | sb->s_export_op = &fuse_export_operations; |
| 951 | 952 | |
| 952 | 953 | file = fget(d.fd); |
| @@ -200,10 +200,11 @@ static int make_mode(const unsigned int lmstate) · 199 unmodified lines | ||
| 200 | 200 | return -1; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | −static u32 make_flags(const u32 lkid, const unsigned int gfs_flags, | |
| 203 | +static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags, | |
| 204 | 204 | const int req) |
| 205 | 205 | { |
| 206 | 206 | u32 lkf = DLM_LKF_VALBLK; |
| 207 | + u32 lkid = gl->gl_lksb.sb_lkid; | |
| 207 | 208 | |
| 208 | 209 | if (gfs_flags & LM_FLAG_TRY) |
| 209 | 210 | lkf |= DLM_LKF_NOQUEUE; |
| @@ -227,8 +228,11 @@ static u32 make_flags(const u32 lkid, const unsigned int gfs_flags, · 17 unmodified lines | ||
| 227 | 228 | BUG(); |
| 228 | 229 | } |
| 229 | 230 | |
| 230 | − if (lkid != 0) | |
| 231 | + if (lkid != 0) { | |
| 231 | 232 | lkf |= DLM_LKF_CONVERT; |
| 233 | + if (test_bit(GLF_BLOCKING, &gl->gl_flags)) | |
| 234 | + lkf |= DLM_LKF_QUECVT; | |
| 235 | + } | |
| 232 | 236 | |
| 233 | 237 | return lkf; |
| 234 | 238 | } |
| @@ -250,7 +254,7 @@ static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state, · 15 unmodified lines | ||
| 250 | 254 | char strname[GDLM_STRNAME_BYTES] = ""; |
| 251 | 255 | |
| 252 | 256 | req = make_mode(req_state); |
| 253 | − lkf = make_flags(gl->gl_lksb.sb_lkid, flags, req); | |
| 257 | + lkf = make_flags(gl, flags, req); | |
| 254 | 258 | gfs2_glstats_inc(gl, GFS2_LKS_DCOUNT); |
| 255 | 259 | gfs2_sbstats_inc(gl, GFS2_LKS_DCOUNT); |
| 256 | 260 | if (gl->gl_lksb.sb_lkid) { |
| @@ -485,6 +485,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, · 484 unmodified lines | ||
| 485 | 485 | inode->i_fop = &simple_dir_operations; |
| 486 | 486 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ |
| 487 | 487 | inc_nlink(inode); |
| 488 | + lockdep_annotate_inode_mutex_key(inode); | |
| 488 | 489 | } |
| 489 | 490 | return inode; |
| 490 | 491 | } |
| @@ -723,7 +723,7 @@ start_journal_io: · 722 unmodified lines | ||
| 723 | 723 | if (commit_transaction->t_need_data_flush && |
| 724 | 724 | (journal->j_fs_dev != journal->j_dev) && |
| 725 | 725 | (journal->j_flags & JBD2_BARRIER)) |
| 726 | − blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); | |
| 726 | + blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL); | |
| 727 | 727 | |
| 728 | 728 | /* Done it all: now write the commit record asynchronously. */ |
| 729 | 729 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, |
| @@ -859,7 +859,7 @@ wait_for_iobuf: · 129 unmodified lines | ||
| 859 | 859 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, |
| 860 | 860 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) && |
| 861 | 861 | journal->j_flags & JBD2_BARRIER) { |
| 862 | − blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL); | |
| 862 | + blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL); | |
| 863 | 863 | } |
| 864 | 864 | |
| 865 | 865 | if (err) |
| @@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat) · 240 unmodified lines | ||
| 241 | 241 | p = xdr_inline_decode(xdr, 4); |
| 242 | 242 | if (unlikely(p == NULL)) |
| 243 | 243 | goto out_overflow; |
| 244 | − if (unlikely(*p > nlm4_failed)) | |
| 244 | + if (unlikely(ntohl(*p) > ntohl(nlm4_failed))) | |
| 245 | 245 | goto out_bad_xdr; |
| 246 | 246 | *stat = *p; |
| 247 | 247 | return 0; |
| @@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr, · 235 unmodified lines | ||
| 236 | 236 | p = xdr_inline_decode(xdr, 4); |
| 237 | 237 | if (unlikely(p == NULL)) |
| 238 | 238 | goto out_overflow; |
| 239 | − if (unlikely(*p > nlm_lck_denied_grace_period)) | |
| 239 | + if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period))) | |
| 240 | 240 | goto out_enum; |
| 241 | 241 | *stat = *p; |
| 242 | 242 | return 0; |
| @@ -1429,7 +1429,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry · 1428 unmodified lines | ||
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | 1431 | open_flags = nd->intent.open.flags; |
| 1432 | − attr.ia_valid = 0; | |
| 1432 | + attr.ia_valid = ATTR_OPEN; | |
| 1433 | 1433 | |
| 1434 | 1434 | ctx = create_nfs_open_context(dentry, open_flags); |
| 1435 | 1435 | res = ERR_CAST(ctx); |
| @@ -1536,7 +1536,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd) · 100 unmodified lines | ||
| 1536 | 1536 | if (IS_ERR(ctx)) |
| 1537 | 1537 | goto out; |
| 1538 | 1538 | |
| 1539 | − attr.ia_valid = 0; | |
| 1539 | + attr.ia_valid = ATTR_OPEN; | |
| 1540 | 1540 | if (openflags & O_TRUNC) { |
| 1541 | 1541 | attr.ia_valid |= ATTR_SIZE; |
| 1542 | 1542 | attr.ia_size = 0; |
| @@ -59,6 +59,7 @@ struct nfs_unique_id { · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | #define NFS_SEQID_CONFIRMED 1 |
| 61 | 61 | struct nfs_seqid_counter { |
| 62 | + ktime_t create_time; | |
| 62 | 63 | int owner_id; |
| 63 | 64 | int flags; |
| 64 | 65 | u32 counter; |
| @@ -838,7 +838,8 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, · 837 unmodified lines | ||
| 838 | 838 | p->o_arg.open_flags = flags; |
| 839 | 839 | p->o_arg.fmode = fmode & (FMODE_READ|FMODE_WRITE); |
| 840 | 840 | p->o_arg.clientid = server->nfs_client->cl_clientid; |
| 841 | − p->o_arg.id = sp->so_seqid.owner_id; | |
| 841 | + p->o_arg.id.create_time = ktime_to_ns(sp->so_seqid.create_time); | |
| 842 | + p->o_arg.id.uniquifier = sp->so_seqid.owner_id; | |
| 842 | 843 | p->o_arg.name = &dentry->d_name; |
| 843 | 844 | p->o_arg.server = server; |
| 844 | 845 | p->o_arg.bitmask = server->attr_bitmask; |
| @@ -1466,8 +1467,7 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata) · 621 unmodified lines | ||
| 1466 | 1467 | goto unlock_no_action; |
| 1467 | 1468 | rcu_read_unlock(); |
| 1468 | 1469 | } |
| 1469 | − /* Update sequence id. */ | |
| 1470 | − data->o_arg.id = sp->so_seqid.owner_id; | |
| 1470 | + /* Update client id. */ | |
| 1471 | 1471 | data->o_arg.clientid = sp->so_server->nfs_client->cl_clientid; |
| 1472 | 1472 | if (data->o_arg.claim == NFS4_OPEN_CLAIM_PREVIOUS) { |
| 1473 | 1473 | task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; |
| @@ -1954,10 +1954,19 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred, · 480 unmodified lines | ||
| 1954 | 1954 | }; |
| 1955 | 1955 | int err; |
| 1956 | 1956 | do { |
| 1957 | − err = nfs4_handle_exception(server, | |
| 1958 | − _nfs4_do_setattr(inode, cred, fattr, sattr, state), | |
| 1959 | − &exception); | |
| 1957 | + err = _nfs4_do_setattr(inode, cred, fattr, sattr, state); | |
| 1958 | + switch (err) { | |
| 1959 | + case -NFS4ERR_OPENMODE: | |
| 1960 | + if (state && !(state->state & FMODE_WRITE)) { | |
| 1961 | + err = -EBADF; | |
| 1962 | + if (sattr->ia_valid & ATTR_OPEN) | |
| 1963 | + err = -EACCES; | |
| 1964 | + goto out; | |
| 1965 | + } | |
| 1966 | + } | |
| 1967 | + err = nfs4_handle_exception(server, err, &exception); | |
| 1960 | 1968 | } while (exception.retry); |
| 1969 | +out: | |
| 1961 | 1970 | return err; |
| 1962 | 1971 | } |
| 1963 | 1972 | |
| @@ -4558,7 +4567,9 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f · 2594 unmodified lines | ||
| 4558 | 4567 | static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request) |
| 4559 | 4568 | { |
| 4560 | 4569 | struct nfs_server *server = NFS_SERVER(state->inode); |
| 4561 | − struct nfs4_exception exception = { }; | |
| 4570 | + struct nfs4_exception exception = { | |
| 4571 | + .inode = state->inode, | |
| 4572 | + }; | |
| 4562 | 4573 | int err; |
| 4563 | 4574 | |
| 4564 | 4575 | do { |
| @@ -4576,7 +4587,9 @@ static int nfs4_lock_reclaim(struct nfs4_state *state, struct file_lock *request · 11 unmodified lines | ||
| 4576 | 4587 | static int nfs4_lock_expired(struct nfs4_state *state, struct file_lock *request) |
| 4577 | 4588 | { |
| 4578 | 4589 | struct nfs_server *server = NFS_SERVER(state->inode); |
| 4579 | − struct nfs4_exception exception = { }; | |
| 4590 | + struct nfs4_exception exception = { | |
| 4591 | + .inode = state->inode, | |
| 4592 | + }; | |
| 4580 | 4593 | int err; |
| 4581 | 4594 | |
| 4582 | 4595 | err = nfs4_set_lock_state(state, request); |
| @@ -4676,6 +4689,7 @@ static int nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock * · 93 unmodified lines | ||
| 4676 | 4689 | { |
| 4677 | 4690 | struct nfs4_exception exception = { |
| 4678 | 4691 | .state = state, |
| 4692 | + .inode = state->inode, | |
| 4679 | 4693 | }; |
| 4680 | 4694 | int err; |
| 4681 | 4695 | |
| @@ -4721,6 +4735,20 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request) · 39 unmodified lines | ||
| 4721 | 4735 | |
| 4722 | 4736 | if (state == NULL) |
| 4723 | 4737 | return -ENOLCK; |
| 4738 | + /* | |
| 4739 | + * Don't rely on the VFS having checked the file open mode, | |
| 4740 | + * since it won't do this for flock() locks. | |
| 4741 | + */ | |
| 4742 | + switch (request->fl_type & (F_RDLCK|F_WRLCK|F_UNLCK)) { | |
| 4743 | + case F_RDLCK: | |
| 4744 | + if (!(filp->f_mode & FMODE_READ)) | |
| 4745 | + return -EBADF; | |
| 4746 | + break; | |
| 4747 | + case F_WRLCK: | |
| 4748 | + if (!(filp->f_mode & FMODE_WRITE)) | |
| 4749 | + return -EBADF; | |
| 4750 | + } | |
| 4751 | + | |
| 4724 | 4752 | do { |
| 4725 | 4753 | status = nfs4_proc_setlk(state, cmd, request); |
| 4726 | 4754 | if ((status != -EAGAIN) || IS_SETLK(cmd)) |
| @@ -393,6 +393,7 @@ nfs4_remove_state_owner_locked(struct nfs4_state_owner *sp) · 392 unmodified lines | ||
| 393 | 393 | static void |
| 394 | 394 | nfs4_init_seqid_counter(struct nfs_seqid_counter *sc) |
| 395 | 395 | { |
| 396 | + sc->create_time = ktime_get(); | |
| 396 | 397 | sc->flags = 0; |
| 397 | 398 | sc->counter = 0; |
| 398 | 399 | spin_lock_init(&sc->lock); |
| @@ -434,13 +435,17 @@ nfs4_alloc_state_owner(struct nfs_server *server, · 35 unmodified lines | ||
| 434 | 435 | static void |
| 435 | 436 | nfs4_drop_state_owner(struct nfs4_state_owner *sp) |
| 436 | 437 | { |
| 437 | − if (!RB_EMPTY_NODE(&sp->so_server_node)) { | |
| 438 | + struct rb_node *rb_node = &sp->so_server_node; | |
| 439 | + | |
| 440 | + if (!RB_EMPTY_NODE(rb_node)) { | |
| 438 | 441 | struct nfs_server *server = sp->so_server; |
| 439 | 442 | struct nfs_client *clp = server->nfs_client; |
| 440 | 443 | |
| 441 | 444 | spin_lock(&clp->cl_lock); |
| 442 | − rb_erase(&sp->so_server_node, &server->state_owners); | |
| 443 | − RB_CLEAR_NODE(&sp->so_server_node); | |
| 445 | + if (!RB_EMPTY_NODE(rb_node)) { | |
| 446 | + rb_erase(rb_node, &server->state_owners); | |
| 447 | + RB_CLEAR_NODE(rb_node); | |
| 448 | + } | |
| 444 | 449 | spin_unlock(&clp->cl_lock); |
| 445 | 450 | } |
| 446 | 451 | } |
| @@ -516,6 +521,14 @@ out: · 69 unmodified lines | ||
| 516 | 521 | /** |
| 517 | 522 | * nfs4_put_state_owner - Release a nfs4_state_owner |
| 518 | 523 | * @sp: state owner data to release |
| 524 | + * | |
| 525 | + * Note that we keep released state owners on an LRU | |
| 526 | + * list. | |
| 527 | + * This caches valid state owners so that they can be | |
| 528 | + * reused, to avoid the OPEN_CONFIRM on minor version 0. | |
| 529 | + * It also pins the uniquifier of dropped state owners for | |
| 530 | + * a while, to ensure that those state owner names are | |
| 531 | + * never reused. | |
| 519 | 532 | */ |
| 520 | 533 | void nfs4_put_state_owner(struct nfs4_state_owner *sp) |
| 521 | 534 | { |
| @@ -525,15 +538,9 @@ void nfs4_put_state_owner(struct nfs4_state_owner *sp) · 3 unmodified lines | ||
| 525 | 538 | if (!atomic_dec_and_lock(&sp->so_count, &clp->cl_lock)) |
| 526 | 539 | return; |
| 527 | 540 | |
| 528 | − if (!RB_EMPTY_NODE(&sp->so_server_node)) { | |
| 529 | − sp->so_expires = jiffies; | |
| 530 | − list_add_tail(&sp->so_lru, &server->state_owners_lru); | |
| 531 | − spin_unlock(&clp->cl_lock); | |
| 532 | − } else { | |
| 533 | − nfs4_remove_state_owner_locked(sp); | |
| 534 | − spin_unlock(&clp->cl_lock); | |
| 535 | − nfs4_free_state_owner(sp); | |
| 536 | − } | |
| 541 | + sp->so_expires = jiffies; | |
| 542 | + list_add_tail(&sp->so_lru, &server->state_owners_lru); | |
| 543 | + spin_unlock(&clp->cl_lock); | |
| 537 | 544 | } |
| 538 | 545 | |
| 539 | 546 | /** |
| @@ -74,7 +74,7 @@ static int nfs4_stat_to_errno(int); · 73 unmodified lines | ||
| 74 | 74 | /* lock,open owner id: |
| 75 | 75 | * we currently use size 2 (u64) out of (NFS4_OPAQUE_LIMIT >> 2) |
| 76 | 76 | */ |
| 77 | −#define open_owner_id_maxsz (1 + 1 + 4) | |
| 77 | +#define open_owner_id_maxsz (1 + 2 + 1 + 1 + 2) | |
| 78 | 78 | #define lock_owner_id_maxsz (1 + 1 + 4) |
| 79 | 79 | #define decode_lockowner_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ)) |
| 80 | 80 | #define compound_encode_hdr_maxsz (3 + (NFS4_MAXTAGLEN >> 2)) |
| @@ -1340,12 +1340,13 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena · 1259 unmodified lines | ||
| 1340 | 1340 | */ |
| 1341 | 1341 | encode_nfs4_seqid(xdr, arg->seqid); |
| 1342 | 1342 | encode_share_access(xdr, arg->fmode); |
| 1343 | − p = reserve_space(xdr, 32); | |
| 1343 | + p = reserve_space(xdr, 36); | |
| 1344 | 1344 | p = xdr_encode_hyper(p, arg->clientid); |
| 1345 | − *p++ = cpu_to_be32(20); | |
| 1345 | + *p++ = cpu_to_be32(24); | |
| 1346 | 1346 | p = xdr_encode_opaque_fixed(p, "open id:", 8); |
| 1347 | 1347 | *p++ = cpu_to_be32(arg->server->s_dev); |
| 1348 | − xdr_encode_hyper(p, arg->id); | |
| 1348 | + *p++ = cpu_to_be32(arg->id.uniquifier); | |
| 1349 | + xdr_encode_hyper(p, arg->id.create_time); | |
| 1349 | 1350 | } |
| 1350 | 1351 | |
| 1351 | 1352 | static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg) |
| @@ -322,7 +322,7 @@ out_bad: · 321 unmodified lines | ||
| 322 | 322 | while (!list_empty(res)) { |
| 323 | 323 | data = list_entry(res->next, struct nfs_read_data, list); |
| 324 | 324 | list_del(&data->list); |
| 325 | − nfs_readdata_free(data); | |
| 325 | + nfs_readdata_release(data); | |
| 326 | 326 | } |
| 327 | 327 | nfs_readpage_release(req); |
| 328 | 328 | return -ENOMEM; |
| @@ -2767,11 +2767,15 @@ static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type, · 2766 unmodified lines | ||
| 2767 | 2767 | char *root_devname; |
| 2768 | 2768 | size_t len; |
| 2769 | 2769 | |
| 2770 | − len = strlen(hostname) + 3; | |
| 2770 | + len = strlen(hostname) + 5; | |
| 2771 | 2771 | root_devname = kmalloc(len, GFP_KERNEL); |
| 2772 | 2772 | if (root_devname == NULL) |
| 2773 | 2773 | return ERR_PTR(-ENOMEM); |
| 2774 | − snprintf(root_devname, len, "%s:/", hostname); | |
| 2774 | + /* Does hostname needs to be enclosed in brackets? */ | |
| 2775 | + if (strchr(hostname, ':')) | |
| 2776 | + snprintf(root_devname, len, "[%s]:/", hostname); | |
| 2777 | + else | |
| 2778 | + snprintf(root_devname, len, "%s:/", hostname); | |
| 2775 | 2779 | root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data); |
| 2776 | 2780 | kfree(root_devname); |
| 2777 | 2781 | return root_mnt; |
| @@ -682,7 +682,8 @@ static struct nfs_page *nfs_try_to_update_request(struct inode *inode, · 681 unmodified lines | ||
| 682 | 682 | req->wb_bytes = rqend - req->wb_offset; |
| 683 | 683 | out_unlock: |
| 684 | 684 | spin_unlock(&inode->i_lock); |
| 685 | − nfs_clear_request_commit(req); | |
| 685 | + if (req) | |
| 686 | + nfs_clear_request_commit(req); | |
| 686 | 687 | return req; |
| 687 | 688 | out_flushme: |
| 688 | 689 | spin_unlock(&inode->i_lock); |
| @@ -1018,7 +1019,7 @@ out_bad: · 329 unmodified lines | ||
| 1018 | 1019 | while (!list_empty(res)) { |
| 1019 | 1020 | data = list_entry(res->next, struct nfs_write_data, list); |
| 1020 | 1021 | list_del(&data->list); |
| 1021 | − nfs_writedata_free(data); | |
| 1022 | + nfs_writedata_release(data); | |
| 1022 | 1023 | } |
| 1023 | 1024 | nfs_redirty_request(req); |
| 1024 | 1025 | return -ENOMEM; |
| @@ -803,13 +803,13 @@ encode_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, · 802 unmodified lines | ||
| 803 | 803 | return p; |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | −static int | |
| 806 | +static __be32 | |
| 807 | 807 | compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, |
| 808 | 808 | const char *name, int namlen) |
| 809 | 809 | { |
| 810 | 810 | struct svc_export *exp; |
| 811 | 811 | struct dentry *dparent, *dchild; |
| 812 | − int rv = 0; | |
| 812 | + __be32 rv = nfserr_noent; | |
| 813 | 813 | |
| 814 | 814 | dparent = cd->fh.fh_dentry; |
| 815 | 815 | exp = cd->fh.fh_export; |
| @@ -817,26 +817,20 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, · 1 unmodified line | ||
| 817 | 817 | if (isdotent(name, namlen)) { |
| 818 | 818 | if (namlen == 2) { |
| 819 | 819 | dchild = dget_parent(dparent); |
| 820 | − if (dchild == dparent) { | |
| 821 | − /* filesystem root - cannot return filehandle for ".." */ | |
| 822 | − dput(dchild); | |
| 823 | − return -ENOENT; | |
| 824 | − } | |
| 820 | + /* filesystem root - cannot return filehandle for ".." */ | |
| 821 | + if (dchild == dparent) | |
| 822 | + goto out; | |
| 825 | 823 | } else |
| 826 | 824 | dchild = dget(dparent); |
| 827 | 825 | } else |
| 828 | 826 | dchild = lookup_one_len(name, dparent, namlen); |
| 829 | 827 | if (IS_ERR(dchild)) |
| 830 | − return -ENOENT; | |
| 831 | − rv = -ENOENT; | |
| 828 | + return rv; | |
| 832 | 829 | if (d_mountpoint(dchild)) |
| 833 | 830 | goto out; |
| 834 | − rv = fh_compose(fhp, exp, dchild, &cd->fh); | |
| 835 | − if (rv) | |
| 836 | − goto out; | |
| 837 | 831 | if (!dchild->d_inode) |
| 838 | 832 | goto out; |
| 839 | − rv = 0; | |
| 833 | + rv = fh_compose(fhp, exp, dchild, &cd->fh); | |
| 840 | 834 | out: |
| 841 | 835 | dput(dchild); |
| 842 | 836 | return rv; |
| @@ -845,7 +839,7 @@ out: · 2 unmodified lines | ||
| 845 | 839 | static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen) |
| 846 | 840 | { |
| 847 | 841 | struct svc_fh fh; |
| 848 | − int err; | |
| 842 | + __be32 err; | |
| 849 | 843 | |
| 850 | 844 | fh_init(&fh, NFS3_FHSIZE); |
| 851 | 845 | err = compose_entry_fh(cd, &fh, name, namlen); |
| @@ -235,15 +235,15 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o · 234 unmodified lines | ||
| 235 | 235 | */ |
| 236 | 236 | if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0) |
| 237 | 237 | open->op_bmval[1] = (FATTR4_WORD1_TIME_ACCESS | |
| 238 | − FATTR4_WORD1_TIME_MODIFY); | |
| 238 | + FATTR4_WORD1_TIME_MODIFY); | |
| 239 | 239 | } else { |
| 240 | 240 | status = nfsd_lookup(rqstp, current_fh, |
| 241 | 241 | open->op_fname.data, open->op_fname.len, resfh); |
| 242 | 242 | fh_unlock(current_fh); |
| 243 | − if (status) | |
| 244 | − goto out; | |
| 245 | − status = nfsd_check_obj_isreg(resfh); | |
| 246 | 243 | } |
| 244 | + if (status) | |
| 245 | + goto out; | |
| 246 | + status = nfsd_check_obj_isreg(resfh); | |
| 247 | 247 | if (status) |
| 248 | 248 | goto out; |
| 249 | 249 | |
| @@ -841,6 +841,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, · 591 unmodified lines | ||
| 841 | 841 | struct nfsd4_setattr *setattr) |
| 842 | 842 | { |
| 843 | 843 | __be32 status = nfs_ok; |
| 844 | + int err; | |
| 844 | 845 | |
| 845 | 846 | if (setattr->sa_iattr.ia_valid & ATTR_SIZE) { |
| 846 | 847 | nfs4_lock_state(); |
| @@ -852,9 +853,9 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, · 5 unmodified lines | ||
| 852 | 853 | return status; |
| 853 | 854 | } |
| 854 | 855 | } |
| 855 | − status = fh_want_write(&cstate->current_fh); | |
| 856 | − if (status) | |
| 857 | − return status; | |
| 856 | + err = fh_want_write(&cstate->current_fh); | |
| 857 | + if (err) | |
| 858 | + return nfserrno(err); | |
| 858 | 859 | status = nfs_ok; |
| 859 | 860 | |
| 860 | 861 | status = check_attr_support(rqstp, cstate, setattr->sa_bmval, |
| @@ -577,7 +577,7 @@ cld_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) · 576 unmodified lines | ||
| 577 | 577 | struct cld_net *cn = nn->cld_net; |
| 578 | 578 | |
| 579 | 579 | if (mlen != sizeof(*cmsg)) { |
| 580 | − dprintk("%s: got %lu bytes, expected %lu\n", __func__, mlen, | |
| 580 | + dprintk("%s: got %zu bytes, expected %zu\n", __func__, mlen, | |
| 581 | 581 | sizeof(*cmsg)); |
| 582 | 582 | return -EINVAL; |
| 583 | 583 | } |
| @@ -4211,16 +4211,14 @@ out: · 4210 unmodified lines | ||
| 4211 | 4211 | * vfs_test_lock. (Arguably perhaps test_lock should be done with an |
| 4212 | 4212 | * inode operation.) |
| 4213 | 4213 | */ |
| 4214 | −static int nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock) | |
| 4214 | +static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock) | |
| 4215 | 4215 | { |
| 4216 | 4216 | struct file *file; |
| 4217 | − int err; | |
| 4218 | − | |
| 4219 | − err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); | |
| 4220 | − if (err) | |
| 4221 | − return err; | |
| 4222 | − err = vfs_test_lock(file, lock); | |
| 4223 | − nfsd_close(file); | |
| 4217 | + __be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); | |
| 4218 | + if (!err) { | |
| 4219 | + err = nfserrno(vfs_test_lock(file, lock)); | |
| 4220 | + nfsd_close(file); | |
| 4221 | + } | |
| 4224 | 4222 | return err; |
| 4225 | 4223 | } |
| 4226 | 4224 | |
| @@ -4234,7 +4232,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, · 7 unmodified lines | ||
| 4234 | 4232 | struct inode *inode; |
| 4235 | 4233 | struct file_lock file_lock; |
| 4236 | 4234 | struct nfs4_lockowner *lo; |
| 4237 | − int error; | |
| 4238 | 4235 | __be32 status; |
| 4239 | 4236 | |
| 4240 | 4237 | if (locks_in_grace()) |
| @@ -4280,12 +4277,10 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, · 39 unmodified lines | ||
| 4280 | 4277 | |
| 4281 | 4278 | nfs4_transform_lock_offset(&file_lock); |
| 4282 | 4279 | |
| 4283 | − status = nfs_ok; | |
| 4284 | − error = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock); | |
| 4285 | − if (error) { | |
| 4286 | − status = nfserrno(error); | |
| 4280 | + status = nfsd_test_lock(rqstp, &cstate->current_fh, &file_lock); | |
| 4281 | + if (status) | |
| 4287 | 4282 | goto out; |
| 4288 | − } | |
| 4283 | + | |
| 4289 | 4284 | if (file_lock.fl_type != F_UNLCK) { |
| 4290 | 4285 | status = nfserr_denied; |
| 4291 | 4286 | nfs4_set_lock_denied(&file_lock, &lockt->lt_denied); |
| @@ -1392,7 +1392,7 @@ nfsd4_decode_test_stateid(struct nfsd4_compoundargs *argp, struct nfsd4_test_sta · 1391 unmodified lines | ||
| 1392 | 1392 | for (i = 0; i < test_stateid->ts_num_ids; i++) { |
| 1393 | 1393 | stateid = kmalloc(sizeof(struct nfsd4_test_stateid_id), GFP_KERNEL); |
| 1394 | 1394 | if (!stateid) { |
| 1395 | − status = PTR_ERR(stateid); | |
| 1395 | + status = nfserrno(-ENOMEM); | |
| 1396 | 1396 | goto out; |
| 1397 | 1397 | } |
| 1398 | 1398 | |
| @@ -3410,7 +3410,7 @@ nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, int nfserr, · 2011 unmodified lines | ||
| 3410 | 3410 | *p++ = htonl(test_stateid->ts_num_ids); |
| 3411 | 3411 | |
| 3412 | 3412 | list_for_each_entry_safe(stateid, next, &test_stateid->ts_stateid_list, ts_id_list) { |
| 3413 | − *p++ = htonl(stateid->ts_id_status); | |
| 3413 | + *p++ = stateid->ts_id_status; | |
| 3414 | 3414 | } |
| 3415 | 3415 | |
| 3416 | 3416 | ADJUST_ARGS(); |
| @@ -1458,7 +1458,7 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, · 1457 unmodified lines | ||
| 1458 | 1458 | switch (createmode) { |
| 1459 | 1459 | case NFS3_CREATE_UNCHECKED: |
| 1460 | 1460 | if (! S_ISREG(dchild->d_inode->i_mode)) |
| 1461 | − err = nfserr_exist; | |
| 1461 | + goto out; | |
| 1462 | 1462 | else if (truncp) { |
| 1463 | 1463 | /* in nfsv4, we need to treat this case a little |
| 1464 | 1464 | * differently. we don't want to truncate the |
| @@ -1134,7 +1134,7 @@ static int ocfs2_adjust_rightmost_branch(handle_t *handle, · 1133 unmodified lines | ||
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | el = path_leaf_el(path); |
| 1137 | − rec = &el->l_recs[le32_to_cpu(el->l_next_free_rec) - 1]; | |
| 1137 | + rec = &el->l_recs[le16_to_cpu(el->l_next_free_rec) - 1]; | |
| 1138 | 1138 | |
| 1139 | 1139 | ocfs2_adjust_rightmost_records(handle, et, path, rec); |
| 1140 | 1140 | |
| @@ -1036,14 +1036,14 @@ static int ocfs2_get_refcount_cpos_end(struct ocfs2_caching_info *ci, · 1035 unmodified lines | ||
| 1036 | 1036 | |
| 1037 | 1037 | tmp_el = left_path->p_node[subtree_root].el; |
| 1038 | 1038 | blkno = left_path->p_node[subtree_root+1].bh->b_blocknr; |
| 1039 | − for (i = 0; i < le32_to_cpu(tmp_el->l_next_free_rec); i++) { | |
| 1039 | + for (i = 0; i < le16_to_cpu(tmp_el->l_next_free_rec); i++) { | |
| 1040 | 1040 | if (le64_to_cpu(tmp_el->l_recs[i].e_blkno) == blkno) { |
| 1041 | 1041 | *cpos_end = le32_to_cpu(tmp_el->l_recs[i+1].e_cpos); |
| 1042 | 1042 | break; |
| 1043 | 1043 | } |
| 1044 | 1044 | } |
| 1045 | 1045 | |
| 1046 | − BUG_ON(i == le32_to_cpu(tmp_el->l_next_free_rec)); | |
| 1046 | + BUG_ON(i == le16_to_cpu(tmp_el->l_next_free_rec)); | |
| 1047 | 1047 | |
| 1048 | 1048 | out: |
| 1049 | 1049 | ocfs2_free_path(left_path); |
| @@ -1468,7 +1468,7 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh, · 418 unmodified lines | ||
| 1468 | 1468 | |
| 1469 | 1469 | trace_ocfs2_divide_leaf_refcount_block( |
| 1470 | 1470 | (unsigned long long)ref_leaf_bh->b_blocknr, |
| 1471 | − le32_to_cpu(rl->rl_count), le32_to_cpu(rl->rl_used)); | |
| 1471 | + le16_to_cpu(rl->rl_count), le16_to_cpu(rl->rl_used)); | |
| 1472 | 1472 | |
| 1473 | 1473 | /* |
| 1474 | 1474 | * XXX: Improvement later. |
| @@ -2411,7 +2411,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb, · 936 unmodified lines | ||
| 2411 | 2411 | rb = (struct ocfs2_refcount_block *) |
| 2412 | 2412 | prev_bh->b_data; |
| 2413 | 2413 | |
| 2414 | − if (le64_to_cpu(rb->rf_records.rl_used) + | |
| 2414 | + if (le16_to_cpu(rb->rf_records.rl_used) + | |
| 2415 | 2415 | recs_add > |
| 2416 | 2416 | le16_to_cpu(rb->rf_records.rl_count)) |
| 2417 | 2417 | ref_blocks++; |
| @@ -2476,7 +2476,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb, · 58 unmodified lines | ||
| 2476 | 2476 | if (prev_bh) { |
| 2477 | 2477 | rb = (struct ocfs2_refcount_block *)prev_bh->b_data; |
| 2478 | 2478 | |
| 2479 | − if (le64_to_cpu(rb->rf_records.rl_used) + recs_add > | |
| 2479 | + if (le16_to_cpu(rb->rf_records.rl_used) + recs_add > | |
| 2480 | 2480 | le16_to_cpu(rb->rf_records.rl_count)) |
| 2481 | 2481 | ref_blocks++; |
| 2482 | 2482 | |
| @@ -3629,7 +3629,7 @@ int ocfs2_refcounted_xattr_delete_need(struct inode *inode, · 1146 unmodified lines | ||
| 3629 | 3629 | * one will split a refcount rec, so totally we need |
| 3630 | 3630 | * clusters * 2 new refcount rec. |
| 3631 | 3631 | */ |
| 3632 | − if (le64_to_cpu(rb->rf_records.rl_used) + clusters * 2 > | |
| 3632 | + if (le16_to_cpu(rb->rf_records.rl_used) + clusters * 2 > | |
| 3633 | 3633 | le16_to_cpu(rb->rf_records.rl_count)) |
| 3634 | 3634 | ref_blocks++; |
| 3635 | 3635 | |
| @@ -600,7 +600,7 @@ static void ocfs2_bg_alloc_cleanup(handle_t *handle, · 599 unmodified lines | ||
| 600 | 600 | ret = ocfs2_free_clusters(handle, cluster_ac->ac_inode, |
| 601 | 601 | cluster_ac->ac_bh, |
| 602 | 602 | le64_to_cpu(rec->e_blkno), |
| 603 | − le32_to_cpu(rec->e_leaf_clusters)); | |
| 603 | + le16_to_cpu(rec->e_leaf_clusters)); | |
| 604 | 604 | if (ret) |
| 605 | 605 | mlog_errno(ret); |
| 606 | 606 | /* Try all the clusters to free */ |
| @@ -1628,7 +1628,7 @@ static int ocfs2_bg_discontig_fix_by_rec(struct ocfs2_suballoc_result *res, · 1021 unmodified lines | ||
| 1628 | 1628 | { |
| 1629 | 1629 | unsigned int bpc = le16_to_cpu(cl->cl_bpc); |
| 1630 | 1630 | unsigned int bitoff = le32_to_cpu(rec->e_cpos) * bpc; |
| 1631 | − unsigned int bitcount = le32_to_cpu(rec->e_leaf_clusters) * bpc; | |
| 1631 | + unsigned int bitcount = le16_to_cpu(rec->e_leaf_clusters) * bpc; | |
| 1632 | 1632 | |
| 1633 | 1633 | if (res->sr_bit_offset < bitoff) |
| 1634 | 1634 | return 0; |
| @@ -346,6 +346,16 @@ static const struct pipe_buf_operations anon_pipe_buf_ops = { · 345 unmodified lines | ||
| 346 | 346 | .get = generic_pipe_buf_get, |
| 347 | 347 | }; |
| 348 | 348 | |
| 349 | +static const struct pipe_buf_operations packet_pipe_buf_ops = { | |
| 350 | + .can_merge = 0, | |
| 351 | + .map = generic_pipe_buf_map, | |
| 352 | + .unmap = generic_pipe_buf_unmap, | |
| 353 | + .confirm = generic_pipe_buf_confirm, | |
| 354 | + .release = anon_pipe_buf_release, | |
| 355 | + .steal = generic_pipe_buf_steal, | |
| 356 | + .get = generic_pipe_buf_get, | |
| 357 | +}; | |
| 358 | + | |
| 349 | 359 | static ssize_t |
| 350 | 360 | pipe_read(struct kiocb *iocb, const struct iovec *_iov, |
| 351 | 361 | unsigned long nr_segs, loff_t pos) |
| @@ -407,6 +417,13 @@ redo: · 55 unmodified lines | ||
| 407 | 417 | ret += chars; |
| 408 | 418 | buf->offset += chars; |
| 409 | 419 | buf->len -= chars; |
| 420 | + | |
| 421 | + /* Was it a packet buffer? Clean up and exit */ | |
| 422 | + if (buf->flags & PIPE_BUF_FLAG_PACKET) { | |
| 423 | + total_len = chars; | |
| 424 | + buf->len = 0; | |
| 425 | + } | |
| 426 | + | |
| 410 | 427 | if (!buf->len) { |
| 411 | 428 | buf->ops = NULL; |
| 412 | 429 | ops->release(pipe, buf); |
| @@ -459,6 +476,11 @@ redo: · 46 unmodified lines | ||
| 459 | 476 | return ret; |
| 460 | 477 | } |
| 461 | 478 | |
| 479 | +static inline int is_packetized(struct file *file) | |
| 480 | +{ | |
| 481 | + return (file->f_flags & O_DIRECT) != 0; | |
| 482 | +} | |
| 483 | + | |
| 462 | 484 | static ssize_t |
| 463 | 485 | pipe_write(struct kiocb *iocb, const struct iovec *_iov, |
| 464 | 486 | unsigned long nr_segs, loff_t ppos) |
| @@ -593,6 +615,11 @@ redo2: · 128 unmodified lines | ||
| 593 | 615 | buf->ops = &anon_pipe_buf_ops; |
| 594 | 616 | buf->offset = 0; |
| 595 | 617 | buf->len = chars; |
| 618 | + buf->flags = 0; | |
| 619 | + if (is_packetized(filp)) { | |
| 620 | + buf->ops = &packet_pipe_buf_ops; | |
| 621 | + buf->flags = PIPE_BUF_FLAG_PACKET; | |
| 622 | + } | |
| 596 | 623 | pipe->nrbufs = ++bufs; |
| 597 | 624 | pipe->tmp_page = NULL; |
| 598 | 625 | |
| @@ -1013,7 +1040,7 @@ struct file *create_write_pipe(int flags) · 414 unmodified lines | ||
| 1013 | 1040 | goto err_dentry; |
| 1014 | 1041 | f->f_mapping = inode->i_mapping; |
| 1015 | 1042 | |
| 1016 | − f->f_flags = O_WRONLY | (flags & O_NONBLOCK); | |
| 1043 | + f->f_flags = O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT)); | |
| 1017 | 1044 | f->f_version = 0; |
| 1018 | 1045 | |
| 1019 | 1046 | return f; |
| @@ -1057,7 +1084,7 @@ int do_pipe_flags(int *fd, int flags) · 37 unmodified lines | ||
| 1057 | 1084 | int error; |
| 1058 | 1085 | int fdw, fdr; |
| 1059 | 1086 | |
| 1060 | − if (flags & ~(O_CLOEXEC | O_NONBLOCK)) | |
| 1087 | + if (flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT)) | |
| 1061 | 1088 | return -EINVAL; |
| 1062 | 1089 | |
| 1063 | 1090 | fw = create_write_pipe(flags); |
| @@ -597,9 +597,6 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr, · 596 unmodified lines | ||
| 597 | 597 | if (!page) |
| 598 | 598 | continue; |
| 599 | 599 | |
| 600 | − if (PageReserved(page)) | |
| 601 | − continue; | |
| 602 | − | |
| 603 | 600 | /* Clear accessed and referenced bits. */ |
| 604 | 601 | ptep_test_and_clear_young(vma, addr, pte); |
| 605 | 602 | ClearPageReferenced(page); |
| @@ -35,6 +35,14 @@ typedef union sigval { · 34 unmodified lines | ||
| 35 | 35 | #define __ARCH_SI_BAND_T long |
| 36 | 36 | #endif |
| 37 | 37 | |
| 38 | +#ifndef __ARCH_SI_CLOCK_T | |
| 39 | +#define __ARCH_SI_CLOCK_T __kernel_clock_t | |
| 40 | +#endif | |
| 41 | + | |
| 42 | +#ifndef __ARCH_SI_ATTRIBUTES | |
| 43 | +#define __ARCH_SI_ATTRIBUTES | |
| 44 | +#endif | |
| 45 | + | |
| 38 | 46 | #ifndef HAVE_ARCH_SIGINFO_T |
| 39 | 47 | |
| 40 | 48 | typedef struct siginfo { |
| @@ -72,8 +80,8 @@ typedef struct siginfo { · 31 unmodified lines | ||
| 72 | 80 | __kernel_pid_t _pid; /* which child */ |
| 73 | 81 | __ARCH_SI_UID_T _uid; /* sender's uid */ |
| 74 | 82 | int _status; /* exit code */ |
| 75 | − __kernel_clock_t _utime; | |
| 76 | − __kernel_clock_t _stime; | |
| 83 | + __ARCH_SI_CLOCK_T _utime; | |
| 84 | + __ARCH_SI_CLOCK_T _stime; | |
| 77 | 85 | } _sigchld; |
| 78 | 86 | |
| 79 | 87 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ |
| @@ -91,7 +99,7 @@ typedef struct siginfo { · 11 unmodified lines | ||
| 91 | 99 | int _fd; |
| 92 | 100 | } _sigpoll; |
| 93 | 101 | } _sifields; |
| 94 | −} siginfo_t; | |
| 102 | +} __ARCH_SI_ATTRIBUTES siginfo_t; | |
| 95 | 103 | |
| 96 | 104 | #endif |
| 97 | 105 | |
| @@ -554,7 +554,18 @@ extern int __init efi_setup_pcdp_console(char *); · 553 unmodified lines | ||
| 554 | 554 | #define EFI_VARIABLE_NON_VOLATILE 0x0000000000000001 |
| 555 | 555 | #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002 |
| 556 | 556 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004 |
| 557 | − | |
| 557 | +#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000000000008 | |
| 558 | +#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000000000000010 | |
| 559 | +#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020 | |
| 560 | +#define EFI_VARIABLE_APPEND_WRITE 0x0000000000000040 | |
| 561 | + | |
| 562 | +#define EFI_VARIABLE_MASK (EFI_VARIABLE_NON_VOLATILE | \ | |
| 563 | + EFI_VARIABLE_BOOTSERVICE_ACCESS | \ | |
| 564 | + EFI_VARIABLE_RUNTIME_ACCESS | \ | |
| 565 | + EFI_VARIABLE_HARDWARE_ERROR_RECORD | \ | |
| 566 | + EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | \ | |
| 567 | + EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \ | |
| 568 | + EFI_VARIABLE_APPEND_WRITE) | |
| 558 | 569 | /* |
| 559 | 570 | * The type of search to perform when calling boottime->locate_handle |
| 560 | 571 | */ |
| @@ -593,7 +593,7 @@ struct fuse_dirent { · 592 unmodified lines | ||
| 593 | 593 | __u64 off; |
| 594 | 594 | __u32 namelen; |
| 595 | 595 | __u32 type; |
| 596 | − char name[0]; | |
| 596 | + char name[]; | |
| 597 | 597 | }; |
| 598 | 598 | |
| 599 | 599 | #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) |
| @@ -13,4 +13,8 @@ extern int pxa_last_gpio; · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | extern int pxa_irq_to_gpio(int irq); |
| 15 | 15 | |
| 16 | +struct pxa_gpio_platform_data { | |
| 17 | + int (*gpio_set_wake)(unsigned int gpio, unsigned int on); | |
| 18 | +}; | |
| 19 | + | |
| 16 | 20 | #endif /* __GPIO_PXA_H */ |
| @@ -26,9 +26,9 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <linux/device.h> |
| 27 | 27 | #include <linux/mutex.h> |
| 28 | 28 | #include <linux/scatterlist.h> |
| 29 | −#include <linux/spinlock.h> | |
| 30 | 29 | #include <linux/list.h> |
| 31 | 30 | #include <linux/module.h> |
| 31 | +#include <linux/notifier.h> | |
| 32 | 32 | |
| 33 | 33 | /* HSI message ttype */ |
| 34 | 34 | #define HSI_MSG_READ 0 |
| @@ -121,18 +121,18 @@ static inline int hsi_register_board_info(struct hsi_board_info const *info, · 86 unmodified lines | ||
| 121 | 121 | * @device: Driver model representation of the device |
| 122 | 122 | * @tx_cfg: HSI TX configuration |
| 123 | 123 | * @rx_cfg: HSI RX configuration |
| 124 | − * @hsi_start_rx: Called after incoming wake line goes high | |
| 125 | − * @hsi_stop_rx: Called after incoming wake line goes low | |
| 124 | + * @e_handler: Callback for handling port events (RX Wake High/Low) | |
| 125 | + * @pclaimed: Keeps tracks if the clients claimed its associated HSI port | |
| 126 | + * @nb: Notifier block for port events | |
| 126 | 127 | */ |
| 127 | 128 | struct hsi_client { |
| 128 | 129 | struct device device; |
| 129 | 130 | struct hsi_config tx_cfg; |
| 130 | 131 | struct hsi_config rx_cfg; |
| 131 | − void (*hsi_start_rx)(struct hsi_client *cl); | |
| 132 | − void (*hsi_stop_rx)(struct hsi_client *cl); | |
| 133 | 132 | /* private: */ |
| 133 | + void (*ehandler)(struct hsi_client *, unsigned long); | |
| 134 | 134 | unsigned int pclaimed:1; |
| 135 | − struct list_head link; | |
| 135 | + struct notifier_block nb; | |
| 136 | 136 | }; |
| 137 | 137 | |
| 138 | 138 | #define to_hsi_client(dev) container_of(dev, struct hsi_client, device) |
| @@ -147,6 +147,10 @@ static inline void *hsi_client_drvdata(struct hsi_client *cl) · 8 unmodified lines | ||
| 147 | 147 | return dev_get_drvdata(&cl->device); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | +int hsi_register_port_event(struct hsi_client *cl, | |
| 151 | + void (*handler)(struct hsi_client *, unsigned long)); | |
| 152 | +int hsi_unregister_port_event(struct hsi_client *cl); | |
| 153 | + | |
| 150 | 154 | /** |
| 151 | 155 | * struct hsi_client_driver - Driver associated to an HSI client |
| 152 | 156 | * @driver: Driver model representation of the driver |
| @@ -214,8 +218,7 @@ void hsi_free_msg(struct hsi_msg *msg); · 61 unmodified lines | ||
| 214 | 218 | * @start_tx: Callback to inform that a client wants to TX data |
| 215 | 219 | * @stop_tx: Callback to inform that a client no longer wishes to TX data |
| 216 | 220 | * @release: Callback to inform that a client no longer uses the port |
| 217 | − * @clients: List of hsi_clients using the port. | |
| 218 | − * @clock: Lock to serialize access to the clients list. | |
| 221 | + * @n_head: Notifier chain for signaling port events to the clients. | |
| 219 | 222 | */ |
| 220 | 223 | struct hsi_port { |
| 221 | 224 | struct device device; |
| @@ -231,14 +234,14 @@ struct hsi_port { · 9 unmodified lines | ||
| 231 | 234 | int (*start_tx)(struct hsi_client *cl); |
| 232 | 235 | int (*stop_tx)(struct hsi_client *cl); |
| 233 | 236 | int (*release)(struct hsi_client *cl); |
| 234 | − struct list_head clients; | |
| 235 | − spinlock_t clock; | |
| 237 | + /* private */ | |
| 238 | + struct atomic_notifier_head n_head; | |
| 236 | 239 | }; |
| 237 | 240 | |
| 238 | 241 | #define to_hsi_port(dev) container_of(dev, struct hsi_port, device) |
| 239 | 242 | #define hsi_get_port(cl) to_hsi_port((cl)->device.parent) |
| 240 | 243 | |
| 241 | −void hsi_event(struct hsi_port *port, unsigned int event); | |
| 244 | +int hsi_event(struct hsi_port *port, unsigned long event); | |
| 242 | 245 | int hsi_claim_port(struct hsi_client *cl, unsigned int share); |
| 243 | 246 | void hsi_release_port(struct hsi_client *cl); |
| 244 | 247 | |
| @@ -270,13 +273,13 @@ struct hsi_controller { · 25 unmodified lines | ||
| 270 | 273 | struct module *owner; |
| 271 | 274 | unsigned int id; |
| 272 | 275 | unsigned int num_ports; |
| 273 | − struct hsi_port *port; | |
| 276 | + struct hsi_port **port; | |
| 274 | 277 | }; |
| 275 | 278 | |
| 276 | 279 | #define to_hsi_controller(dev) container_of(dev, struct hsi_controller, device) |
| 277 | 280 | |
| 278 | 281 | struct hsi_controller *hsi_alloc_controller(unsigned int n_ports, gfp_t flags); |
| 279 | −void hsi_free_controller(struct hsi_controller *hsi); | |
| 282 | +void hsi_put_controller(struct hsi_controller *hsi); | |
| 280 | 283 | int hsi_register_controller(struct hsi_controller *hsi); |
| 281 | 284 | void hsi_unregister_controller(struct hsi_controller *hsi); |
| 282 | 285 | |
| @@ -294,7 +297,7 @@ static inline void *hsi_controller_drvdata(struct hsi_controller *hsi) · 11 unmodified lines | ||
| 294 | 297 | static inline struct hsi_port *hsi_find_port_num(struct hsi_controller *hsi, |
| 295 | 298 | unsigned int num) |
| 296 | 299 | { |
| 297 | − return (num < hsi->num_ports) ? &hsi->port[num] : NULL; | |
| 300 | + return (num < hsi->num_ports) ? hsi->port[num] : NULL; | |
| 298 | 301 | } |
| 299 | 302 | |
| 300 | 303 | /* |
| @@ -666,23 +666,11 @@ struct twl4030_codec_data { · 665 unmodified lines | ||
| 666 | 666 | unsigned int check_defaults:1; |
| 667 | 667 | unsigned int reset_registers:1; |
| 668 | 668 | unsigned int hs_extmute:1; |
| 669 | − u16 hs_left_step; | |
| 670 | − u16 hs_right_step; | |
| 671 | − u16 hf_left_step; | |
| 672 | − u16 hf_right_step; | |
| 673 | 669 | void (*set_hs_extmute)(int mute); |
| 674 | 670 | }; |
| 675 | 671 | |
| 676 | 672 | struct twl4030_vibra_data { |
| 677 | 673 | unsigned int coexist; |
| 678 | − | |
| 679 | − /* twl6040 */ | |
| 680 | − unsigned int vibldrv_res; /* left driver resistance */ | |
| 681 | − unsigned int vibrdrv_res; /* right driver resistance */ | |
| 682 | − unsigned int viblmotor_res; /* left motor resistance */ | |
| 683 | − unsigned int vibrmotor_res; /* right motor resistance */ | |
| 684 | − int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */ | |
| 685 | − int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ | |
| 686 | 674 | }; |
| 687 | 675 | |
| 688 | 676 | struct twl4030_audio_data { |
| @@ -49,6 +49,12 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data); · 48 unmodified lines | ||
| 49 | 49 | * IRQ_TYPE_LEVEL_LOW - low level triggered |
| 50 | 50 | * IRQ_TYPE_LEVEL_MASK - Mask to filter out the level bits |
| 51 | 51 | * IRQ_TYPE_SENSE_MASK - Mask for all the above bits |
| 52 | + * IRQ_TYPE_DEFAULT - For use by some PICs to ask irq_set_type | |
| 53 | + * to setup the HW to a sane default (used | |
| 54 | + * by irqdomain map() callbacks to synchronize | |
| 55 | + * the HW state and SW flags for a newly | |
| 56 | + * allocated descriptor). | |
| 57 | + * | |
| 52 | 58 | * IRQ_TYPE_PROBE - Special flag for probing in progress |
| 53 | 59 | * |
| 54 | 60 | * Bits which can be modified via irq_set/clear/modify_status_flags() |
| @@ -77,6 +83,7 @@ enum { · 22 unmodified lines | ||
| 77 | 83 | IRQ_TYPE_LEVEL_LOW = 0x00000008, |
| 78 | 84 | IRQ_TYPE_LEVEL_MASK = (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH), |
| 79 | 85 | IRQ_TYPE_SENSE_MASK = 0x0000000f, |
| 86 | + IRQ_TYPE_DEFAULT = IRQ_TYPE_SENSE_MASK, | |
| 80 | 87 | |
| 81 | 88 | IRQ_TYPE_PROBE = 0x00000010, |
| 82 | 89 | |
| @@ -596,6 +596,7 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); · 595 unmodified lines | ||
| 596 | 596 | |
| 597 | 597 | #ifdef CONFIG_IOMMU_API |
| 598 | 598 | int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot); |
| 599 | +void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot); | |
| 599 | 600 | int kvm_iommu_map_guest(struct kvm *kvm); |
| 600 | 601 | int kvm_iommu_unmap_guest(struct kvm *kvm); |
| 601 | 602 | int kvm_assign_device(struct kvm *kvm, |
| @@ -609,6 +610,11 @@ static inline int kvm_iommu_map_pages(struct kvm *kvm, · 7 unmodified lines | ||
| 609 | 610 | return 0; |
| 610 | 611 | } |
| 611 | 612 | |
| 613 | +static inline void kvm_iommu_unmap_pages(struct kvm *kvm, | |
| 614 | + struct kvm_memory_slot *slot) | |
| 615 | +{ | |
| 616 | +} | |
| 617 | + | |
| 612 | 618 | static inline int kvm_iommu_map_guest(struct kvm *kvm) |
| 613 | 619 | { |
| 614 | 620 | return -ENODEV; |
| @@ -996,7 +996,8 @@ extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, · 995 unmodified lines | ||
| 996 | 996 | extern void ata_sas_port_destroy(struct ata_port *); |
| 997 | 997 | extern struct ata_port *ata_sas_port_alloc(struct ata_host *, |
| 998 | 998 | struct ata_port_info *, struct Scsi_Host *); |
| 999 | −extern int ata_sas_async_port_init(struct ata_port *); | |
| 999 | +extern void ata_sas_async_probe(struct ata_port *ap); | |
| 1000 | +extern int ata_sas_sync_probe(struct ata_port *ap); | |
| 1000 | 1001 | extern int ata_sas_port_init(struct ata_port *); |
| 1001 | 1002 | extern int ata_sas_port_start(struct ata_port *ap); |
| 1002 | 1003 | extern void ata_sas_port_stop(struct ata_port *ap); |
| @@ -8,41 +8,14 @@ · 7 unmodified lines | ||
| 8 | 8 | #ifndef __MFD_DB5500_PRCMU_H |
| 9 | 9 | #define __MFD_DB5500_PRCMU_H |
| 10 | 10 | |
| 11 | −#ifdef CONFIG_MFD_DB5500_PRCMU | |
| 12 | − | |
| 13 | −void db5500_prcmu_early_init(void); | |
| 14 | −int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state); | |
| 15 | −int db5500_prcmu_set_display_clocks(void); | |
| 16 | −int db5500_prcmu_disable_dsipll(void); | |
| 17 | −int db5500_prcmu_enable_dsipll(void); | |
| 18 | −int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | |
| 19 | −int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | |
| 20 | −void db5500_prcmu_enable_wakeups(u32 wakeups); | |
| 21 | −int db5500_prcmu_request_clock(u8 clock, bool enable); | |
| 22 | −void db5500_prcmu_config_abb_event_readout(u32 abb_events); | |
| 23 | −void db5500_prcmu_get_abb_event_buffer(void __iomem **buf); | |
| 24 | −int prcmu_resetout(u8 resoutn, u8 state); | |
| 25 | −int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |
| 26 | − bool keep_ap_pll); | |
| 27 | −int db5500_prcmu_config_esram0_deep_sleep(u8 state); | |
| 28 | −void db5500_prcmu_system_reset(u16 reset_code); | |
| 29 | −u16 db5500_prcmu_get_reset_code(void); | |
| 30 | −bool db5500_prcmu_is_ac_wake_requested(void); | |
| 31 | −int db5500_prcmu_set_arm_opp(u8 opp); | |
| 32 | −int db5500_prcmu_get_arm_opp(void); | |
| 33 | − | |
| 34 | −#else /* !CONFIG_UX500_SOC_DB5500 */ | |
| 35 | − | |
| 36 | −static inline void db5500_prcmu_early_init(void) {} | |
| 37 | − | |
| 38 | −static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | |
| 11 | +static inline int prcmu_resetout(u8 resoutn, u8 state) | |
| 39 | 12 | { |
| 40 | − return -ENOSYS; | |
| 13 | + return 0; | |
| 41 | 14 | } |
| 42 | 15 | |
| 43 | −static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | |
| 16 | +static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state) | |
| 44 | 17 | { |
| 45 | − return -ENOSYS; | |
| 18 | + return 0; | |
| 46 | 19 | } |
| 47 | 20 | |
| 48 | 21 | static inline int db5500_prcmu_request_clock(u8 clock, bool enable) |
| @@ -50,69 +23,82 @@ static inline int db5500_prcmu_request_clock(u8 clock, bool enable) · 1 unmodified line | ||
| 50 | 23 | return 0; |
| 51 | 24 | } |
| 52 | 25 | |
| 53 | −static inline int db5500_prcmu_set_display_clocks(void) | |
| 26 | +static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |
| 27 | + bool keep_ap_pll) | |
| 54 | 28 | { |
| 55 | 29 | return 0; |
| 56 | 30 | } |
| 57 | 31 | |
| 58 | −static inline int db5500_prcmu_disable_dsipll(void) | |
| 32 | +static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state) | |
| 59 | 33 | { |
| 60 | 34 | return 0; |
| 61 | 35 | } |
| 62 | 36 | |
| 63 | −static inline int db5500_prcmu_enable_dsipll(void) | |
| 37 | +static inline u16 db5500_prcmu_get_reset_code(void) | |
| 64 | 38 | { |
| 65 | 39 | return 0; |
| 66 | 40 | } |
| 67 | 41 | |
| 68 | −static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state) | |
| 42 | +static inline bool db5500_prcmu_is_ac_wake_requested(void) | |
| 69 | 43 | { |
| 70 | 44 | return 0; |
| 71 | 45 | } |
| 72 | 46 | |
| 73 | −static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {} | |
| 74 | − | |
| 75 | −static inline int prcmu_resetout(u8 resoutn, u8 state) | |
| 47 | +static inline int db5500_prcmu_set_arm_opp(u8 opp) | |
| 76 | 48 | { |
| 77 | 49 | return 0; |
| 78 | 50 | } |
| 79 | 51 | |
| 80 | −static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state) | |
| 52 | +static inline int db5500_prcmu_get_arm_opp(void) | |
| 81 | 53 | { |
| 82 | 54 | return 0; |
| 83 | 55 | } |
| 84 | 56 | |
| 85 | −static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {} | |
| 86 | 57 | static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {} |
| 87 | 58 | |
| 88 | −static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |
| 89 | − bool keep_ap_pll) | |
| 90 | −{ | |
| 91 | − return 0; | |
| 92 | −} | |
| 59 | +static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {} | |
| 93 | 60 | |
| 94 | 61 | static inline void db5500_prcmu_system_reset(u16 reset_code) {} |
| 95 | 62 | |
| 96 | −static inline u16 db5500_prcmu_get_reset_code(void) | |
| 63 | +static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {} | |
| 64 | + | |
| 65 | +#ifdef CONFIG_MFD_DB5500_PRCMU | |
| 66 | + | |
| 67 | +void db5500_prcmu_early_init(void); | |
| 68 | +int db5500_prcmu_set_display_clocks(void); | |
| 69 | +int db5500_prcmu_disable_dsipll(void); | |
| 70 | +int db5500_prcmu_enable_dsipll(void); | |
| 71 | +int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | |
| 72 | +int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | |
| 73 | + | |
| 74 | +#else /* !CONFIG_UX500_SOC_DB5500 */ | |
| 75 | + | |
| 76 | +static inline void db5500_prcmu_early_init(void) {} | |
| 77 | + | |
| 78 | +static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | |
| 97 | 79 | { |
| 98 | − return 0; | |
| 80 | + return -ENOSYS; | |
| 99 | 81 | } |
| 100 | 82 | |
| 101 | −static inline bool db5500_prcmu_is_ac_wake_requested(void) | |
| 83 | +static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | |
| 102 | 84 | { |
| 103 | − return 0; | |
| 85 | + return -ENOSYS; | |
| 104 | 86 | } |
| 105 | 87 | |
| 106 | −static inline int db5500_prcmu_set_arm_opp(u8 opp) | |
| 88 | +static inline int db5500_prcmu_set_display_clocks(void) | |
| 107 | 89 | { |
| 108 | 90 | return 0; |
| 109 | 91 | } |
| 110 | 92 | |
| 111 | −static inline int db5500_prcmu_get_arm_opp(void) | |
| 93 | +static inline int db5500_prcmu_disable_dsipll(void) | |
| 112 | 94 | { |
| 113 | 95 | return 0; |
| 114 | 96 | } |
| 115 | 97 | |
| 98 | +static inline int db5500_prcmu_enable_dsipll(void) | |
| 99 | +{ | |
| 100 | + return 0; | |
| 101 | +} | |
| 116 | 102 | |
| 117 | 103 | #endif /* CONFIG_MFD_DB5500_PRCMU */ |
| 118 | 104 | |
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | #include <linux/mutex.h> |
| 28 | 28 | #include <linux/types.h> |
| 29 | +#include <linux/regmap.h> | |
| 29 | 30 | |
| 30 | 31 | #define RC5T583_MAX_REGS 0xF8 |
| 31 | 32 | |
| @@ -279,14 +280,44 @@ struct rc5t583_platform_data { · 247 unmodified lines | ||
| 279 | 280 | bool enable_shutdown; |
| 280 | 281 | }; |
| 281 | 282 | |
| 282 | −int rc5t583_write(struct device *dev, u8 reg, uint8_t val); | |
| 283 | −int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val); | |
| 284 | −int rc5t583_set_bits(struct device *dev, unsigned int reg, | |
| 285 | − unsigned int bit_mask); | |
| 286 | −int rc5t583_clear_bits(struct device *dev, unsigned int reg, | |
| 287 | − unsigned int bit_mask); | |
| 288 | −int rc5t583_update(struct device *dev, unsigned int reg, | |
| 289 | − unsigned int val, unsigned int mask); | |
| 283 | +static inline int rc5t583_write(struct device *dev, uint8_t reg, uint8_t val) | |
| 284 | +{ | |
| 285 | + struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 286 | + return regmap_write(rc5t583->regmap, reg, val); | |
| 287 | +} | |
| 288 | + | |
| 289 | +static inline int rc5t583_read(struct device *dev, uint8_t reg, uint8_t *val) | |
| 290 | +{ | |
| 291 | + struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 292 | + unsigned int ival; | |
| 293 | + int ret; | |
| 294 | + ret = regmap_read(rc5t583->regmap, reg, &ival); | |
| 295 | + if (!ret) | |
| 296 | + *val = (uint8_t)ival; | |
| 297 | + return ret; | |
| 298 | +} | |
| 299 | + | |
| 300 | +static inline int rc5t583_set_bits(struct device *dev, unsigned int reg, | |
| 301 | + unsigned int bit_mask) | |
| 302 | +{ | |
| 303 | + struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 304 | + return regmap_update_bits(rc5t583->regmap, reg, bit_mask, bit_mask); | |
| 305 | +} | |
| 306 | + | |
| 307 | +static inline int rc5t583_clear_bits(struct device *dev, unsigned int reg, | |
| 308 | + unsigned int bit_mask) | |
| 309 | +{ | |
| 310 | + struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 311 | + return regmap_update_bits(rc5t583->regmap, reg, bit_mask, 0); | |
| 312 | +} | |
| 313 | + | |
| 314 | +static inline int rc5t583_update(struct device *dev, unsigned int reg, | |
| 315 | + unsigned int val, unsigned int mask) | |
| 316 | +{ | |
| 317 | + struct rc5t583 *rc5t583 = dev_get_drvdata(dev); | |
| 318 | + return regmap_update_bits(rc5t583->regmap, reg, mask, val); | |
| 319 | +} | |
| 320 | + | |
| 290 | 321 | int rc5t583_ext_power_req_config(struct device *dev, int deepsleep_id, |
| 291 | 322 | int ext_pwr_req, int deepsleep_slot_nr); |
| 292 | 323 | int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base); |
| @@ -174,8 +174,35 @@ · 173 unmodified lines | ||
| 174 | 174 | #define TWL6040_SYSCLK_SEL_LPPLL 0 |
| 175 | 175 | #define TWL6040_SYSCLK_SEL_HPPLL 1 |
| 176 | 176 | |
| 177 | +struct twl6040_codec_data { | |
| 178 | + u16 hs_left_step; | |
| 179 | + u16 hs_right_step; | |
| 180 | + u16 hf_left_step; | |
| 181 | + u16 hf_right_step; | |
| 182 | +}; | |
| 183 | + | |
| 184 | +struct twl6040_vibra_data { | |
| 185 | + unsigned int vibldrv_res; /* left driver resistance */ | |
| 186 | + unsigned int vibrdrv_res; /* right driver resistance */ | |
| 187 | + unsigned int viblmotor_res; /* left motor resistance */ | |
| 188 | + unsigned int vibrmotor_res; /* right motor resistance */ | |
| 189 | + int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */ | |
| 190 | + int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */ | |
| 191 | +}; | |
| 192 | + | |
| 193 | +struct twl6040_platform_data { | |
| 194 | + int audpwron_gpio; /* audio power-on gpio */ | |
| 195 | + unsigned int irq_base; | |
| 196 | + | |
| 197 | + struct twl6040_codec_data *codec; | |
| 198 | + struct twl6040_vibra_data *vibra; | |
| 199 | +}; | |
| 200 | + | |
| 201 | +struct regmap; | |
| 202 | + | |
| 177 | 203 | struct twl6040 { |
| 178 | 204 | struct device *dev; |
| 205 | + struct regmap *regmap; | |
| 179 | 206 | struct mutex mutex; |
| 180 | 207 | struct mutex io_mutex; |
| 181 | 208 | struct mutex irq_mutex; |
| @@ -1393,29 +1393,20 @@ extern int install_special_mapping(struct mm_struct *mm, · 1392 unmodified lines | ||
| 1393 | 1393 | |
| 1394 | 1394 | extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
| 1395 | 1395 | |
| 1396 | −extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |
| 1397 | − unsigned long len, unsigned long prot, | |
| 1398 | − unsigned long flag, unsigned long pgoff); | |
| 1399 | 1396 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
| 1400 | 1397 | unsigned long len, unsigned long flags, |
| 1401 | 1398 | vm_flags_t vm_flags, unsigned long pgoff); |
| 1402 | − | |
| 1403 | −static inline unsigned long do_mmap(struct file *file, unsigned long addr, | |
| 1404 | − unsigned long len, unsigned long prot, | |
| 1405 | − unsigned long flag, unsigned long offset) | |
| 1406 | −{ | |
| 1407 | − unsigned long ret = -EINVAL; | |
| 1408 | − if ((offset + PAGE_ALIGN(len)) < offset) | |
| 1409 | − goto out; | |
| 1410 | − if (!(offset & ~PAGE_MASK)) | |
| 1411 | − ret = do_mmap_pgoff(file, addr, len, prot, flag, offset >> PAGE_SHIFT); | |
| 1412 | −out: | |
| 1413 | − return ret; | |
| 1414 | −} | |
| 1415 | − | |
| 1399 | +extern unsigned long do_mmap(struct file *, unsigned long, | |
| 1400 | + unsigned long, unsigned long, | |
| 1401 | + unsigned long, unsigned long); | |
| 1416 | 1402 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); |
| 1417 | 1403 | |
| 1418 | −extern unsigned long do_brk(unsigned long, unsigned long); | |
| 1404 | +/* These take the mm semaphore themselves */ | |
| 1405 | +extern unsigned long vm_brk(unsigned long, unsigned long); | |
| 1406 | +extern int vm_munmap(unsigned long, size_t); | |
| 1407 | +extern unsigned long vm_mmap(struct file *, unsigned long, | |
| 1408 | + unsigned long, unsigned long, | |
| 1409 | + unsigned long, unsigned long); | |
| 1419 | 1410 | |
| 1420 | 1411 | /* truncate.c */ |
| 1421 | 1412 | extern void truncate_inode_pages(struct address_space *, loff_t); |
| @@ -481,7 +481,7 @@ struct mmc_driver { · 480 unmodified lines | ||
| 481 | 481 | struct device_driver drv; |
| 482 | 482 | int (*probe)(struct mmc_card *); |
| 483 | 483 | void (*remove)(struct mmc_card *); |
| 484 | − int (*suspend)(struct mmc_card *, pm_message_t); | |
| 484 | + int (*suspend)(struct mmc_card *); | |
| 485 | 485 | int (*resume)(struct mmc_card *); |
| 486 | 486 | }; |
| 487 | 487 | |
| @@ -312,6 +312,11 @@ struct nfs4_layoutreturn { · 311 unmodified lines | ||
| 312 | 312 | int rpc_status; |
| 313 | 313 | }; |
| 314 | 314 | |
| 315 | +struct stateowner_id { | |
| 316 | + __u64 create_time; | |
| 317 | + __u32 uniquifier; | |
| 318 | +}; | |
| 319 | + | |
| 315 | 320 | /* |
| 316 | 321 | * Arguments to the open call. |
| 317 | 322 | */ |
| @@ -321,7 +326,7 @@ struct nfs_openargs { · 3 unmodified lines | ||
| 321 | 326 | int open_flags; |
| 322 | 327 | fmode_t fmode; |
| 323 | 328 | __u64 clientid; |
| 324 | − __u64 id; | |
| 329 | + struct stateowner_id id; | |
| 325 | 330 | union { |
| 326 | 331 | struct { |
| 327 | 332 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
| @@ -1,3 +1,4 @@ | ||
| 1 | +header-y += cld.h | |
| 1 | 2 | header-y += debug.h |
| 2 | 3 | header-y += export.h |
| 3 | 4 | header-y += nfsfh.h |
| @@ -12,6 +12,8 @@ · 11 unmodified lines | ||
| 12 | 12 | #ifndef __LINUX_PINCTRL_MACHINE_H |
| 13 | 13 | #define __LINUX_PINCTRL_MACHINE_H |
| 14 | 14 | |
| 15 | +#include <linux/bug.h> | |
| 16 | + | |
| 15 | 17 | #include "pinctrl-state.h" |
| 16 | 18 | |
| 17 | 19 | enum pinctrl_map_type { |
| @@ -148,7 +150,7 @@ struct pinctrl_map { · 130 unmodified lines | ||
| 148 | 150 | #define PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(dev, grp, cfgs) \ |
| 149 | 151 | PIN_MAP_CONFIGS_GROUP(dev, PINCTRL_STATE_DEFAULT, dev, grp, cfgs) |
| 150 | 152 | |
| 151 | −#ifdef CONFIG_PINMUX | |
| 153 | +#ifdef CONFIG_PINCTRL | |
| 152 | 154 | |
| 153 | 155 | extern int pinctrl_register_mappings(struct pinctrl_map const *map, |
| 154 | 156 | unsigned num_maps); |
| @@ -6,6 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | #define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ |
| 7 | 7 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ |
| 8 | 8 | #define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ |
| 9 | +#define PIPE_BUF_FLAG_PACKET 0x08 /* read() as a packet */ | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * struct pipe_buffer - a linux kernel pipe buffer |
| @@ -238,11 +238,12 @@ enum { · 237 unmodified lines | ||
| 238 | 238 | /* |
| 239 | 239 | * The callback notifies userspace to release buffers when skb DMA is done in |
| 240 | 240 | * lower device, the skb last reference should be 0 when calling this. |
| 241 | − * The desc is used to track userspace buffer index. | |
| 241 | + * The ctx field is used to track device context. | |
| 242 | + * The desc field is used to track userspace buffer index. | |
| 242 | 243 | */ |
| 243 | 244 | struct ubuf_info { |
| 244 | − void (*callback)(void *); | |
| 245 | − void *arg; | |
| 245 | + void (*callback)(struct ubuf_info *); | |
| 246 | + void *ctx; | |
| 246 | 247 | unsigned long desc; |
| 247 | 248 | }; |
| 248 | 249 | |
| @@ -254,7 +254,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 253 unmodified lines | ||
| 254 | 254 | * driver is finished with this message, it must call |
| 255 | 255 | * spi_finalize_current_message() so the subsystem can issue the next |
| 256 | 256 | * transfer |
| 257 | − * @prepare_transfer_hardware: there are currently no more messages on the | |
| 257 | + * @unprepare_transfer_hardware: there are currently no more messages on the | |
| 258 | 258 | * queue so the subsystem notifies the driver that it may relax the |
| 259 | 259 | * hardware by issuing this call |
| 260 | 260 | * |
| @@ -126,6 +126,8 @@ struct usb_hcd { · 125 unmodified lines | ||
| 126 | 126 | unsigned wireless:1; /* Wireless USB HCD */ |
| 127 | 127 | unsigned authorized_default:1; |
| 128 | 128 | unsigned has_tt:1; /* Integrated TT in root hub */ |
| 129 | + unsigned broken_pci_sleep:1; /* Don't put the | |
| 130 | + controller in PCI-D3 for system sleep */ | |
| 129 | 131 | |
| 130 | 132 | unsigned int irq; /* irq allocated */ |
| 131 | 133 | void __iomem *regs; /* device memory/io */ |
| @@ -94,6 +94,7 @@ struct usb_phy { · 93 unmodified lines | ||
| 94 | 94 | |
| 95 | 95 | struct usb_otg *otg; |
| 96 | 96 | |
| 97 | + struct device *io_dev; | |
| 97 | 98 | struct usb_phy_io_ops *io_ops; |
| 98 | 99 | void __iomem *io_priv; |
| 99 | 100 | |
| @@ -26,13 +26,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, · 25 unmodified lines | ||
| 26 | 26 | PGFREE, PGACTIVATE, PGDEACTIVATE, |
| 27 | 27 | PGFAULT, PGMAJFAULT, |
| 28 | 28 | FOR_ALL_ZONES(PGREFILL), |
| 29 | − FOR_ALL_ZONES(PGSTEAL), | |
| 29 | + FOR_ALL_ZONES(PGSTEAL_KSWAPD), | |
| 30 | + FOR_ALL_ZONES(PGSTEAL_DIRECT), | |
| 30 | 31 | FOR_ALL_ZONES(PGSCAN_KSWAPD), |
| 31 | 32 | FOR_ALL_ZONES(PGSCAN_DIRECT), |
| 32 | 33 | #ifdef CONFIG_NUMA |
| 33 | 34 | PGSCAN_ZONE_RECLAIM_FAILED, |
| 34 | 35 | #endif |
| 35 | − PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | |
| 36 | + PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, | |
| 36 | 37 | KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, |
| 37 | 38 | KSWAPD_SKIP_CONGESTION_WAIT, |
| 38 | 39 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
| @@ -36,7 +36,11 @@ struct dst_entry { · 35 unmodified lines | ||
| 36 | 36 | struct net_device *dev; |
| 37 | 37 | struct dst_ops *ops; |
| 38 | 38 | unsigned long _metrics; |
| 39 | − unsigned long expires; | |
| 39 | + union { | |
| 40 | + unsigned long expires; | |
| 41 | + /* point to where the dst_entry copied from */ | |
| 42 | + struct dst_entry *from; | |
| 43 | + }; | |
| 40 | 44 | struct dst_entry *path; |
| 41 | 45 | struct neighbour __rcu *_neighbour; |
| 42 | 46 | #ifdef CONFIG_XFRM |
| @@ -123,6 +123,54 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) · 122 unmodified lines | ||
| 123 | 123 | return ((struct rt6_info *)dst)->rt6i_idev; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | +static inline void rt6_clean_expires(struct rt6_info *rt) | |
| 127 | +{ | |
| 128 | + if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) | |
| 129 | + dst_release(rt->dst.from); | |
| 130 | + | |
| 131 | + rt->rt6i_flags &= ~RTF_EXPIRES; | |
| 132 | + rt->dst.from = NULL; | |
| 133 | +} | |
| 134 | + | |
| 135 | +static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires) | |
| 136 | +{ | |
| 137 | + if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) | |
| 138 | + dst_release(rt->dst.from); | |
| 139 | + | |
| 140 | + rt->rt6i_flags |= RTF_EXPIRES; | |
| 141 | + rt->dst.expires = expires; | |
| 142 | +} | |
| 143 | + | |
| 144 | +static inline void rt6_update_expires(struct rt6_info *rt, int timeout) | |
| 145 | +{ | |
| 146 | + if (!(rt->rt6i_flags & RTF_EXPIRES)) { | |
| 147 | + if (rt->dst.from) | |
| 148 | + dst_release(rt->dst.from); | |
| 149 | + /* dst_set_expires relies on expires == 0 | |
| 150 | + * if it has not been set previously. | |
| 151 | + */ | |
| 152 | + rt->dst.expires = 0; | |
| 153 | + } | |
| 154 | + | |
| 155 | + dst_set_expires(&rt->dst, timeout); | |
| 156 | + rt->rt6i_flags |= RTF_EXPIRES; | |
| 157 | +} | |
| 158 | + | |
| 159 | +static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) | |
| 160 | +{ | |
| 161 | + struct dst_entry *new = (struct dst_entry *) from; | |
| 162 | + | |
| 163 | + if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) { | |
| 164 | + if (new == rt->dst.from) | |
| 165 | + return; | |
| 166 | + dst_release(rt->dst.from); | |
| 167 | + } | |
| 168 | + | |
| 169 | + rt->rt6i_flags &= ~RTF_EXPIRES; | |
| 170 | + rt->dst.from = new; | |
| 171 | + dst_hold(new); | |
| 172 | +} | |
| 173 | + | |
| 126 | 174 | struct fib6_walker_t { |
| 127 | 175 | struct list_head lh; |
| 128 | 176 | struct fib6_node *root, *node; |
| @@ -245,7 +245,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(const struct red_parms · 244 unmodified lines | ||
| 245 | 245 | * |
| 246 | 246 | * dummy packets as a burst after idle time, i.e. |
| 247 | 247 | * |
| 248 | − * p->qavg *= (1-W)^m | |
| 248 | + * v->qavg *= (1-W)^m | |
| 249 | 249 | * |
| 250 | 250 | * This is an apparently overcomplicated solution (f.e. we have to |
| 251 | 251 | * precompute a table to make this calculation in reasonable time) |
| @@ -279,7 +279,7 @@ static inline unsigned long red_calc_qavg_no_idle_time(const struct red_parms *p · 27 unmodified lines | ||
| 279 | 279 | unsigned int backlog) |
| 280 | 280 | { |
| 281 | 281 | /* |
| 282 | − * NOTE: p->qavg is fixed point number with point at Wlog. | |
| 282 | + * NOTE: v->qavg is fixed point number with point at Wlog. | |
| 283 | 283 | * The formula below is equvalent to floating point |
| 284 | 284 | * version: |
| 285 | 285 | * |
| @@ -390,7 +390,7 @@ static inline void red_adaptative_algo(struct red_parms *p, struct red_vars *v) · 104 unmodified lines | ||
| 390 | 390 | if (red_is_idling(v)) |
| 391 | 391 | qavg = red_calc_qavg_from_idle_time(p, v); |
| 392 | 392 | |
| 393 | − /* p->qavg is fixed point number with point at Wlog */ | |
| 393 | + /* v->qavg is fixed point number with point at Wlog */ | |
| 394 | 394 | qavg >>= p->Wlog; |
| 395 | 395 | |
| 396 | 396 | if (qavg > p->target_max && p->max_P <= MAX_P_MAX) |
| @@ -246,6 +246,7 @@ struct cg_proto; · 245 unmodified lines | ||
| 246 | 246 | * @sk_user_data: RPC layer private data |
| 247 | 247 | * @sk_sndmsg_page: cached page for sendmsg |
| 248 | 248 | * @sk_sndmsg_off: cached offset for sendmsg |
| 249 | + * @sk_peek_off: current peek_offset value | |
| 249 | 250 | * @sk_send_head: front of stuff to transmit |
| 250 | 251 | * @sk_security: used by security modules |
| 251 | 252 | * @sk_mark: generic packet mark |
| @@ -217,11 +217,29 @@ struct domain_device { · 216 unmodified lines | ||
| 217 | 217 | struct kref kref; |
| 218 | 218 | }; |
| 219 | 219 | |
| 220 | −struct sas_discovery_event { | |
| 220 | +struct sas_work { | |
| 221 | + struct list_head drain_node; | |
| 221 | 222 | struct work_struct work; |
| 223 | +}; | |
| 224 | + | |
| 225 | +static inline void INIT_SAS_WORK(struct sas_work *sw, void (*fn)(struct work_struct *)) | |
| 226 | +{ | |
| 227 | + INIT_WORK(&sw->work, fn); | |
| 228 | + INIT_LIST_HEAD(&sw->drain_node); | |
| 229 | +} | |
| 230 | + | |
| 231 | +struct sas_discovery_event { | |
| 232 | + struct sas_work work; | |
| 222 | 233 | struct asd_sas_port *port; |
| 223 | 234 | }; |
| 224 | 235 | |
| 236 | +static inline struct sas_discovery_event *to_sas_discovery_event(struct work_struct *work) | |
| 237 | +{ | |
| 238 | + struct sas_discovery_event *ev = container_of(work, typeof(*ev), work.work); | |
| 239 | + | |
| 240 | + return ev; | |
| 241 | +} | |
| 242 | + | |
| 225 | 243 | struct sas_discovery { |
| 226 | 244 | struct sas_discovery_event disc_work[DISC_NUM_EVENTS]; |
| 227 | 245 | unsigned long pending; |
| @@ -244,7 +262,7 @@ struct asd_sas_port { · 16 unmodified lines | ||
| 244 | 262 | struct list_head destroy_list; |
| 245 | 263 | enum sas_linkrate linkrate; |
| 246 | 264 | |
| 247 | − struct work_struct work; | |
| 265 | + struct sas_work work; | |
| 248 | 266 | |
| 249 | 267 | /* public: */ |
| 250 | 268 | int id; |
| @@ -270,10 +288,17 @@ struct asd_sas_port { · 19 unmodified lines | ||
| 270 | 288 | }; |
| 271 | 289 | |
| 272 | 290 | struct asd_sas_event { |
| 273 | − struct work_struct work; | |
| 291 | + struct sas_work work; | |
| 274 | 292 | struct asd_sas_phy *phy; |
| 275 | 293 | }; |
| 276 | 294 | |
| 295 | +static inline struct asd_sas_event *to_asd_sas_event(struct work_struct *work) | |
| 296 | +{ | |
| 297 | + struct asd_sas_event *ev = container_of(work, typeof(*ev), work.work); | |
| 298 | + | |
| 299 | + return ev; | |
| 300 | +} | |
| 301 | + | |
| 277 | 302 | /* The phy pretty much is controlled by the LLDD. |
| 278 | 303 | * The class only reads those fields. |
| 279 | 304 | */ |
| @@ -333,10 +358,17 @@ struct scsi_core { · 53 unmodified lines | ||
| 333 | 358 | }; |
| 334 | 359 | |
| 335 | 360 | struct sas_ha_event { |
| 336 | − struct work_struct work; | |
| 361 | + struct sas_work work; | |
| 337 | 362 | struct sas_ha_struct *ha; |
| 338 | 363 | }; |
| 339 | 364 | |
| 365 | +static inline struct sas_ha_event *to_sas_ha_event(struct work_struct *work) | |
| 366 | +{ | |
| 367 | + struct sas_ha_event *ev = container_of(work, typeof(*ev), work.work); | |
| 368 | + | |
| 369 | + return ev; | |
| 370 | +} | |
| 371 | + | |
| 340 | 372 | enum sas_ha_state { |
| 341 | 373 | SAS_HA_REGISTERED, |
| 342 | 374 | SAS_HA_DRAINING, |
| @@ -37,7 +37,7 @@ static inline int dev_is_sata(struct domain_device *dev) · 36 unmodified lines | ||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy); |
| 40 | −int sas_ata_init_host_and_port(struct domain_device *found_dev); | |
| 40 | +int sas_ata_init(struct domain_device *dev); | |
| 41 | 41 | void sas_ata_task_abort(struct sas_task *task); |
| 42 | 42 | void sas_ata_strategy_handler(struct Scsi_Host *shost); |
| 43 | 43 | void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, |
| @@ -52,7 +52,7 @@ static inline int dev_is_sata(struct domain_device *dev) · 8 unmodified lines | ||
| 52 | 52 | { |
| 53 | 53 | return 0; |
| 54 | 54 | } |
| 55 | −static inline int sas_ata_init_host_and_port(struct domain_device *found_dev) | |
| 55 | +static inline int sas_ata_init(struct domain_device *dev) | |
| 56 | 56 | { |
| 57 | 57 | return 0; |
| 58 | 58 | } |
| @@ -225,13 +225,9 @@ static int __init loglevel(char *str) · 224 unmodified lines | ||
| 225 | 225 | |
| 226 | 226 | early_param("loglevel", loglevel); |
| 227 | 227 | |
| 228 | −/* | |
| 229 | − * Unknown boot options get handed to init, unless they look like | |
| 230 | − * unused parameters (modprobe will find them in /proc/cmdline). | |
| 231 | − */ | |
| 232 | −static int __init unknown_bootoption(char *param, char *val) | |
| 228 | +/* Change NUL term back to "=", to make "param" the whole string. */ | |
| 229 | +static int __init repair_env_string(char *param, char *val) | |
| 233 | 230 | { |
| 234 | − /* Change NUL term back to "=", to make "param" the whole string. */ | |
| 235 | 231 | if (val) { |
| 236 | 232 | /* param=val or param="val"? */ |
| 237 | 233 | if (val == param+strlen(param)+1) |
| @@ -243,6 +239,16 @@ static int __init unknown_bootoption(char *param, char *val) · 5 unmodified lines | ||
| 243 | 239 | } else |
| 244 | 240 | BUG(); |
| 245 | 241 | } |
| 242 | + return 0; | |
| 243 | +} | |
| 244 | + | |
| 245 | +/* | |
| 246 | + * Unknown boot options get handed to init, unless they look like | |
| 247 | + * unused parameters (modprobe will find them in /proc/cmdline). | |
| 248 | + */ | |
| 249 | +static int __init unknown_bootoption(char *param, char *val) | |
| 250 | +{ | |
| 251 | + repair_env_string(param, val); | |
| 246 | 252 | |
| 247 | 253 | /* Handle obsolete-style parameters */ |
| 248 | 254 | if (obsolete_checksetup(param)) |
| @@ -732,11 +738,6 @@ static char *initcall_level_names[] __initdata = { · 483 unmodified lines | ||
| 732 | 738 | "late parameters", |
| 733 | 739 | }; |
| 734 | 740 | |
| 735 | −static int __init ignore_unknown_bootoption(char *param, char *val) | |
| 736 | −{ | |
| 737 | − return 0; | |
| 738 | −} | |
| 739 | − | |
| 740 | 741 | static void __init do_initcall_level(int level) |
| 741 | 742 | { |
| 742 | 743 | extern const struct kernel_param __start___param[], __stop___param[]; |
| @@ -747,7 +748,7 @@ static void __init do_initcall_level(int level) · 4 unmodified lines | ||
| 747 | 748 | static_command_line, __start___param, |
| 748 | 749 | __stop___param - __start___param, |
| 749 | 750 | level, level, |
| 750 | − ignore_unknown_bootoption); | |
| 751 | + repair_env_string); | |
| 751 | 752 | |
| 752 | 753 | for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++) |
| 753 | 754 | do_one_initcall(*fn); |
| @@ -3183,7 +3183,7 @@ static void perf_event_for_each(struct perf_event *event, · 3182 unmodified lines | ||
| 3183 | 3183 | perf_event_for_each_child(event, func); |
| 3184 | 3184 | func(event); |
| 3185 | 3185 | list_for_each_entry(sibling, &event->sibling_list, group_entry) |
| 3186 | − perf_event_for_each_child(event, func); | |
| 3186 | + perf_event_for_each_child(sibling, func); | |
| 3187 | 3187 | mutex_unlock(&ctx->mutex); |
| 3188 | 3188 | } |
| 3189 | 3189 | |
| @@ -4,10 +4,10 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | #include <linux/kallsyms.h> |
| 6 | 6 | |
| 7 | −#define P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f) | |
| 8 | −#define PS(f) if (desc->istate & f) printk("%14s set\n", #f) | |
| 7 | +#define ___P(f) if (desc->status_use_accessors & f) printk("%14s set\n", #f) | |
| 8 | +#define ___PS(f) if (desc->istate & f) printk("%14s set\n", #f) | |
| 9 | 9 | /* FIXME */ |
| 10 | −#define PD(f) do { } while (0) | |
| 10 | +#define ___PD(f) do { } while (0) | |
| 11 | 11 | |
| 12 | 12 | static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) |
| 13 | 13 | { |
| @@ -23,23 +23,23 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc) · 9 unmodified lines | ||
| 23 | 23 | print_symbol("%s\n", (unsigned long)desc->action->handler); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | − P(IRQ_LEVEL); | |
| 27 | − P(IRQ_PER_CPU); | |
| 28 | − P(IRQ_NOPROBE); | |
| 29 | − P(IRQ_NOREQUEST); | |
| 30 | − P(IRQ_NOTHREAD); | |
| 31 | − P(IRQ_NOAUTOEN); | |
| 26 | + ___P(IRQ_LEVEL); | |
| 27 | + ___P(IRQ_PER_CPU); | |
| 28 | + ___P(IRQ_NOPROBE); | |
| 29 | + ___P(IRQ_NOREQUEST); | |
| 30 | + ___P(IRQ_NOTHREAD); | |
| 31 | + ___P(IRQ_NOAUTOEN); | |
| 32 | 32 | |
| 33 | − PS(IRQS_AUTODETECT); | |
| 34 | − PS(IRQS_REPLAY); | |
| 35 | − PS(IRQS_WAITING); | |
| 36 | − PS(IRQS_PENDING); | |
| 33 | + ___PS(IRQS_AUTODETECT); | |
| 34 | + ___PS(IRQS_REPLAY); | |
| 35 | + ___PS(IRQS_WAITING); | |
| 36 | + ___PS(IRQS_PENDING); | |
| 37 | 37 | |
| 38 | − PD(IRQS_INPROGRESS); | |
| 39 | − PD(IRQS_DISABLED); | |
| 40 | − PD(IRQS_MASKED); | |
| 38 | + ___PD(IRQS_INPROGRESS); | |
| 39 | + ___PD(IRQS_DISABLED); | |
| 40 | + ___PD(IRQS_MASKED); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | −#undef P | |
| 44 | −#undef PS | |
| 45 | −#undef PD | |
| 43 | +#undef ___P | |
| 44 | +#undef ___PS | |
| 45 | +#undef ___PD | |
| @@ -51,6 +51,23 @@ · 50 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | #define MAP_PAGE_ENTRIES (PAGE_SIZE / sizeof(sector_t) - 1) |
| 53 | 53 | |
| 54 | +/* | |
| 55 | + * Number of free pages that are not high. | |
| 56 | + */ | |
| 57 | +static inline unsigned long low_free_pages(void) | |
| 58 | +{ | |
| 59 | + return nr_free_pages() - nr_free_highpages(); | |
| 60 | +} | |
| 61 | + | |
| 62 | +/* | |
| 63 | + * Number of pages required to be kept free while writing the image. Always | |
| 64 | + * half of all available low pages before the writing starts. | |
| 65 | + */ | |
| 66 | +static inline unsigned long reqd_free_pages(void) | |
| 67 | +{ | |
| 68 | + return low_free_pages() / 2; | |
| 69 | +} | |
| 70 | + | |
| 54 | 71 | struct swap_map_page { |
| 55 | 72 | sector_t entries[MAP_PAGE_ENTRIES]; |
| 56 | 73 | sector_t next_swap; |
| @@ -72,7 +89,7 @@ struct swap_map_handle { · 15 unmodified lines | ||
| 72 | 89 | sector_t cur_swap; |
| 73 | 90 | sector_t first_sector; |
| 74 | 91 | unsigned int k; |
| 75 | − unsigned long nr_free_pages, written; | |
| 92 | + unsigned long reqd_free_pages; | |
| 76 | 93 | u32 crc32; |
| 77 | 94 | }; |
| 78 | 95 | |
| @@ -316,8 +333,7 @@ static int get_swap_writer(struct swap_map_handle *handle) · 237 unmodified lines | ||
| 316 | 333 | goto err_rel; |
| 317 | 334 | } |
| 318 | 335 | handle->k = 0; |
| 319 | − handle->nr_free_pages = nr_free_pages() >> 1; | |
| 320 | − handle->written = 0; | |
| 336 | + handle->reqd_free_pages = reqd_free_pages(); | |
| 321 | 337 | handle->first_sector = handle->cur_swap; |
| 322 | 338 | return 0; |
| 323 | 339 | err_rel: |
| @@ -352,11 +368,11 @@ static int swap_write_page(struct swap_map_handle *handle, void *buf, · 28 unmodified lines | ||
| 352 | 368 | handle->cur_swap = offset; |
| 353 | 369 | handle->k = 0; |
| 354 | 370 | } |
| 355 | − if (bio_chain && ++handle->written > handle->nr_free_pages) { | |
| 371 | + if (bio_chain && low_free_pages() <= handle->reqd_free_pages) { | |
| 356 | 372 | error = hib_wait_on_bio_chain(bio_chain); |
| 357 | 373 | if (error) |
| 358 | 374 | goto out; |
| 359 | − handle->written = 0; | |
| 375 | + handle->reqd_free_pages = reqd_free_pages(); | |
| 360 | 376 | } |
| 361 | 377 | out: |
| 362 | 378 | return error; |
| @@ -618,7 +634,7 @@ static int save_image_lzo(struct swap_map_handle *handle, · 255 unmodified lines | ||
| 618 | 634 | * Adjust number of free pages after all allocations have been done. |
| 619 | 635 | * We don't want to run out of pages when writing. |
| 620 | 636 | */ |
| 621 | − handle->nr_free_pages = nr_free_pages() >> 1; | |
| 637 | + handle->reqd_free_pages = reqd_free_pages(); | |
| 622 | 638 | |
| 623 | 639 | /* |
| 624 | 640 | * Start the CRC32 thread. |
| @@ -1820,7 +1820,6 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), · 1819 unmodified lines | ||
| 1820 | 1820 | * a quiescent state betweentimes. |
| 1821 | 1821 | */ |
| 1822 | 1822 | local_irq_save(flags); |
| 1823 | − WARN_ON_ONCE(cpu_is_offline(smp_processor_id())); | |
| 1824 | 1823 | rdp = this_cpu_ptr(rsp->rda); |
| 1825 | 1824 | |
| 1826 | 1825 | /* Add the callback to our list. */ |
| @@ -6405,16 +6405,26 @@ static void __sdt_free(const struct cpumask *cpu_map) · 6404 unmodified lines | ||
| 6405 | 6405 | struct sd_data *sdd = &tl->data; |
| 6406 | 6406 | |
| 6407 | 6407 | for_each_cpu(j, cpu_map) { |
| 6408 | − struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); | |
| 6409 | − if (sd && (sd->flags & SD_OVERLAP)) | |
| 6410 | − free_sched_groups(sd->groups, 0); | |
| 6411 | − kfree(*per_cpu_ptr(sdd->sd, j)); | |
| 6412 | − kfree(*per_cpu_ptr(sdd->sg, j)); | |
| 6413 | − kfree(*per_cpu_ptr(sdd->sgp, j)); | |
| 6408 | + struct sched_domain *sd; | |
| 6409 | + | |
| 6410 | + if (sdd->sd) { | |
| 6411 | + sd = *per_cpu_ptr(sdd->sd, j); | |
| 6412 | + if (sd && (sd->flags & SD_OVERLAP)) | |
| 6413 | + free_sched_groups(sd->groups, 0); | |
| 6414 | + kfree(*per_cpu_ptr(sdd->sd, j)); | |
| 6415 | + } | |
| 6416 | + | |
| 6417 | + if (sdd->sg) | |
| 6418 | + kfree(*per_cpu_ptr(sdd->sg, j)); | |
| 6419 | + if (sdd->sgp) | |
| 6420 | + kfree(*per_cpu_ptr(sdd->sgp, j)); | |
| 6414 | 6421 | } |
| 6415 | 6422 | free_percpu(sdd->sd); |
| 6423 | + sdd->sd = NULL; | |
| 6416 | 6424 | free_percpu(sdd->sg); |
| 6425 | + sdd->sg = NULL; | |
| 6417 | 6426 | free_percpu(sdd->sgp); |
| 6427 | + sdd->sgp = NULL; | |
| 6418 | 6428 | } |
| 6419 | 6429 | } |
| 6420 | 6430 | |
| @@ -784,7 +784,7 @@ account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se) · 783 unmodified lines | ||
| 784 | 784 | update_load_add(&rq_of(cfs_rq)->load, se->load.weight); |
| 785 | 785 | #ifdef CONFIG_SMP |
| 786 | 786 | if (entity_is_task(se)) |
| 787 | − list_add_tail(&se->group_node, &rq_of(cfs_rq)->cfs_tasks); | |
| 787 | + list_add(&se->group_node, &rq_of(cfs_rq)->cfs_tasks); | |
| 788 | 788 | #endif |
| 789 | 789 | cfs_rq->nr_running++; |
| 790 | 790 | } |
| @@ -3215,6 +3215,8 @@ static int move_one_task(struct lb_env *env) · 2424 unmodified lines | ||
| 3215 | 3215 | |
| 3216 | 3216 | static unsigned long task_h_load(struct task_struct *p); |
| 3217 | 3217 | |
| 3218 | +static const unsigned int sched_nr_migrate_break = 32; | |
| 3219 | + | |
| 3218 | 3220 | /* |
| 3219 | 3221 | * move_tasks tries to move up to load_move weighted load from busiest to |
| 3220 | 3222 | * this_rq, as part of a balancing operation within domain "sd". |
| @@ -3242,7 +3244,7 @@ static int move_tasks(struct lb_env *env) · 21 unmodified lines | ||
| 3242 | 3244 | |
| 3243 | 3245 | /* take a breather every nr_migrate tasks */ |
| 3244 | 3246 | if (env->loop > env->loop_break) { |
| 3245 | − env->loop_break += sysctl_sched_nr_migrate; | |
| 3247 | + env->loop_break += sched_nr_migrate_break; | |
| 3246 | 3248 | env->flags |= LBF_NEED_BREAK; |
| 3247 | 3249 | break; |
| 3248 | 3250 | } |
| @@ -3252,7 +3254,7 @@ static int move_tasks(struct lb_env *env) · 3 unmodified lines | ||
| 3252 | 3254 | |
| 3253 | 3255 | load = task_h_load(p); |
| 3254 | 3256 | |
| 3255 | − if (load < 16 && !env->sd->nr_balance_failed) | |
| 3257 | + if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed) | |
| 3256 | 3258 | goto next; |
| 3257 | 3259 | |
| 3258 | 3260 | if ((load / 2) > env->load_move) |
| @@ -4407,7 +4409,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, · 1148 unmodified lines | ||
| 4407 | 4409 | .dst_cpu = this_cpu, |
| 4408 | 4410 | .dst_rq = this_rq, |
| 4409 | 4411 | .idle = idle, |
| 4410 | − .loop_break = sysctl_sched_nr_migrate, | |
| 4412 | + .loop_break = sched_nr_migrate_break, | |
| 4411 | 4413 | }; |
| 4412 | 4414 | |
| 4413 | 4415 | cpumask_copy(cpus, cpu_active_mask); |
| @@ -4445,10 +4447,10 @@ redo: · 31 unmodified lines | ||
| 4445 | 4447 | * correctly treated as an imbalance. |
| 4446 | 4448 | */ |
| 4447 | 4449 | env.flags |= LBF_ALL_PINNED; |
| 4448 | − env.load_move = imbalance; | |
| 4449 | − env.src_cpu = busiest->cpu; | |
| 4450 | − env.src_rq = busiest; | |
| 4451 | − env.loop_max = busiest->nr_running; | |
| 4450 | + env.load_move = imbalance; | |
| 4451 | + env.src_cpu = busiest->cpu; | |
| 4452 | + env.src_rq = busiest; | |
| 4453 | + env.loop_max = min_t(unsigned long, sysctl_sched_nr_migrate, busiest->nr_running); | |
| 4452 | 4454 | |
| 4453 | 4455 | more_balance: |
| 4454 | 4456 | local_irq_save(flags); |
| @@ -68,3 +68,4 @@ SCHED_FEAT(TTWU_QUEUE, true) · 67 unmodified lines | ||
| 68 | 68 | |
| 69 | 69 | SCHED_FEAT(FORCE_SD_OVERLAP, false) |
| 70 | 70 | SCHED_FEAT(RT_RUNTIME_SHARE, true) |
| 71 | +SCHED_FEAT(LB_MIN, false) | |
| @@ -346,7 +346,8 @@ int tick_resume_broadcast(void) · 345 unmodified lines | ||
| 346 | 346 | tick_get_broadcast_mask()); |
| 347 | 347 | break; |
| 348 | 348 | case TICKDEV_MODE_ONESHOT: |
| 349 | − broadcast = tick_resume_broadcast_oneshot(bc); | |
| 349 | + if (!cpumask_empty(tick_get_broadcast_mask())) | |
| 350 | + broadcast = tick_resume_broadcast_oneshot(bc); | |
| 350 | 351 | break; |
| 351 | 352 | } |
| 352 | 353 | } |
| @@ -373,6 +374,9 @@ static int tick_broadcast_set_event(ktime_t expires, int force) · 20 unmodified lines | ||
| 373 | 374 | { |
| 374 | 375 | struct clock_event_device *bc = tick_broadcast_device.evtdev; |
| 375 | 376 | |
| 377 | + if (bc->mode != CLOCK_EVT_MODE_ONESHOT) | |
| 378 | + clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); | |
| 379 | + | |
| 376 | 380 | return clockevents_program_event(bc, expires, force); |
| 377 | 381 | } |
| 378 | 382 | |
| @@ -531,7 +535,6 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) · 152 unmodified lines | ||
| 531 | 535 | int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC; |
| 532 | 536 | |
| 533 | 537 | bc->event_handler = tick_handle_oneshot_broadcast; |
| 534 | − clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); | |
| 535 | 538 | |
| 536 | 539 | /* Take the do_timer update */ |
| 537 | 540 | tick_do_timer_cpu = cpu; |
| @@ -549,6 +552,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) · 11 unmodified lines | ||
| 549 | 552 | to_cpumask(tmpmask)); |
| 550 | 553 | |
| 551 | 554 | if (was_periodic && !cpumask_empty(to_cpumask(tmpmask))) { |
| 555 | + clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); | |
| 552 | 556 | tick_broadcast_init_next_event(to_cpumask(tmpmask), |
| 553 | 557 | tick_next_period); |
| 554 | 558 | tick_broadcast_set_event(tick_next_period, 1); |
| @@ -577,15 +581,10 @@ void tick_broadcast_switch_to_oneshot(void) · 22 unmodified lines | ||
| 577 | 581 | raw_spin_lock_irqsave(&tick_broadcast_lock, flags); |
| 578 | 582 | |
| 579 | 583 | tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT; |
| 580 | − | |
| 581 | − if (cpumask_empty(tick_get_broadcast_mask())) | |
| 582 | − goto end; | |
| 583 | − | |
| 584 | 584 | bc = tick_broadcast_device.evtdev; |
| 585 | 585 | if (bc) |
| 586 | 586 | tick_broadcast_setup_oneshot(bc); |
| 587 | 587 | |
| 588 | −end: | |
| 589 | 588 | raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags); |
| 590 | 589 | } |
| 591 | 590 | |
| @@ -4629,7 +4629,8 @@ static ssize_t · 4628 unmodified lines | ||
| 4629 | 4629 | rb_simple_read(struct file *filp, char __user *ubuf, |
| 4630 | 4630 | size_t cnt, loff_t *ppos) |
| 4631 | 4631 | { |
| 4632 | − struct ring_buffer *buffer = filp->private_data; | |
| 4632 | + struct trace_array *tr = filp->private_data; | |
| 4633 | + struct ring_buffer *buffer = tr->buffer; | |
| 4633 | 4634 | char buf[64]; |
| 4634 | 4635 | int r; |
| 4635 | 4636 | |
| @@ -4647,7 +4648,8 @@ static ssize_t · 11 unmodified lines | ||
| 4647 | 4648 | rb_simple_write(struct file *filp, const char __user *ubuf, |
| 4648 | 4649 | size_t cnt, loff_t *ppos) |
| 4649 | 4650 | { |
| 4650 | − struct ring_buffer *buffer = filp->private_data; | |
| 4651 | + struct trace_array *tr = filp->private_data; | |
| 4652 | + struct ring_buffer *buffer = tr->buffer; | |
| 4651 | 4653 | unsigned long val; |
| 4652 | 4654 | int ret; |
| 4653 | 4655 | |
| @@ -4734,7 +4736,7 @@ static __init int tracer_init_debugfs(void) · 80 unmodified lines | ||
| 4734 | 4736 | &trace_clock_fops); |
| 4735 | 4737 | |
| 4736 | 4738 | trace_create_file("tracing_on", 0644, d_tracer, |
| 4737 | − global_trace.buffer, &rb_simple_fops); | |
| 4739 | + &global_trace, &rb_simple_fops); | |
| 4738 | 4740 | |
| 4739 | 4741 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 4740 | 4742 | trace_create_file("dyn_ftrace_total_info", 0444, d_tracer, |
| @@ -836,11 +836,11 @@ extern const char *__stop___trace_bprintk_fmt[]; · 835 unmodified lines | ||
| 836 | 836 | filter) |
| 837 | 837 | #include "trace_entries.h" |
| 838 | 838 | |
| 839 | −#ifdef CONFIG_FUNCTION_TRACER | |
| 839 | +#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_FUNCTION_TRACER) | |
| 840 | 840 | int perf_ftrace_event_register(struct ftrace_event_call *call, |
| 841 | 841 | enum trace_reg type, void *data); |
| 842 | 842 | #else |
| 843 | 843 | #define perf_ftrace_event_register NULL |
| 844 | −#endif /* CONFIG_FUNCTION_TRACER */ | |
| 844 | +#endif | |
| 845 | 845 | |
| 846 | 846 | #endif /* _LINUX_KERNEL_TRACE_H */ |
| @@ -652,6 +652,8 @@ int trace_print_lat_context(struct trace_iterator *iter) · 651 unmodified lines | ||
| 652 | 652 | { |
| 653 | 653 | u64 next_ts; |
| 654 | 654 | int ret; |
| 655 | + /* trace_find_next_entry will reset ent_size */ | |
| 656 | + int ent_size = iter->ent_size; | |
| 655 | 657 | struct trace_seq *s = &iter->seq; |
| 656 | 658 | struct trace_entry *entry = iter->ent, |
| 657 | 659 | *next_entry = trace_find_next_entry(iter, NULL, |
| @@ -660,6 +662,9 @@ int trace_print_lat_context(struct trace_iterator *iter) · 2 unmodified lines | ||
| 660 | 662 | unsigned long abs_usecs = ns2usecs(iter->ts - iter->tr->time_start); |
| 661 | 663 | unsigned long rel_usecs; |
| 662 | 664 | |
| 665 | + /* Restore the original ent_size */ | |
| 666 | + iter->ent_size = ent_size; | |
| 667 | + | |
| 663 | 668 | if (!next_entry) |
| 664 | 669 | next_ts = iter->ts; |
| 665 | 670 | rel_usecs = ns2usecs(next_ts - iter->ts); |
| @@ -177,8 +177,8 @@ int mpi_rshift(MPI x, MPI a, unsigned n) · 176 unmodified lines | ||
| 177 | 177 | */ |
| 178 | 178 | int mpi_lshift_limbs(MPI a, unsigned int count) |
| 179 | 179 | { |
| 180 | − mpi_ptr_t ap = a->d; | |
| 181 | − int n = a->nlimbs; | |
| 180 | + const int n = a->nlimbs; | |
| 181 | + mpi_ptr_t ap; | |
| 182 | 182 | int i; |
| 183 | 183 | |
| 184 | 184 | if (!count || !n) |
| @@ -187,6 +187,7 @@ int mpi_lshift_limbs(MPI a, unsigned int count) · 2 unmodified lines | ||
| 187 | 187 | if (RESIZE_IF_NEEDED(a, n + count) < 0) |
| 188 | 188 | return -ENOMEM; |
| 189 | 189 | |
| 190 | + ap = a->d; | |
| 190 | 191 | for (i = n - 1; i >= 0; i--) |
| 191 | 192 | ap[i + count] = ap[i]; |
| 192 | 193 | for (i = 0; i < count; i++) |
| @@ -532,7 +532,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, · 531 unmodified lines | ||
| 532 | 532 | struct vm_area_struct *vma, |
| 533 | 533 | unsigned long address, int avoid_reserve) |
| 534 | 534 | { |
| 535 | − struct page *page; | |
| 535 | + struct page *page = NULL; | |
| 536 | 536 | struct mempolicy *mpol; |
| 537 | 537 | nodemask_t *nodemask; |
| 538 | 538 | struct zonelist *zonelist; |
| @@ -330,6 +330,9 @@ static int __init_memblock memblock_add_region(struct memblock_type *type, · 329 unmodified lines | ||
| 330 | 330 | phys_addr_t end = base + memblock_cap_size(base, &size); |
| 331 | 331 | int i, nr_new; |
| 332 | 332 | |
| 333 | + if (!size) | |
| 334 | + return 0; | |
| 335 | + | |
| 333 | 336 | /* special case for empty array */ |
| 334 | 337 | if (type->regions[0].size == 0) { |
| 335 | 338 | WARN_ON(type->cnt != 1 || type->total_size); |
| @@ -430,6 +433,9 @@ static int __init_memblock memblock_isolate_range(struct memblock_type *type, · 94 unmodified lines | ||
| 430 | 433 | |
| 431 | 434 | *start_rgn = *end_rgn = 0; |
| 432 | 435 | |
| 436 | + if (!size) | |
| 437 | + return 0; | |
| 438 | + | |
| 433 | 439 | /* we'll create at most two more regions */ |
| 434 | 440 | while (type->cnt + 2 > type->max) |
| 435 | 441 | if (memblock_double_array(type) < 0) |
| @@ -514,7 +520,6 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size) · 78 unmodified lines | ||
| 514 | 520 | (unsigned long long)base, |
| 515 | 521 | (unsigned long long)base + size, |
| 516 | 522 | (void *)_RET_IP_); |
| 517 | − BUG_ON(0 == size); | |
| 518 | 523 | |
| 519 | 524 | return memblock_add_region(_rgn, base, size, MAX_NUMNODES); |
| 520 | 525 | } |
| @@ -2476,10 +2476,10 @@ struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) · 2475 unmodified lines | ||
| 2476 | 2476 | static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, |
| 2477 | 2477 | struct page *page, |
| 2478 | 2478 | unsigned int nr_pages, |
| 2479 | − struct page_cgroup *pc, | |
| 2480 | 2479 | enum charge_type ctype, |
| 2481 | 2480 | bool lrucare) |
| 2482 | 2481 | { |
| 2482 | + struct page_cgroup *pc = lookup_page_cgroup(page); | |
| 2483 | 2483 | struct zone *uninitialized_var(zone); |
| 2484 | 2484 | bool was_on_lru = false; |
| 2485 | 2485 | bool anon; |
| @@ -2716,7 +2716,6 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, · 230 unmodified lines | ||
| 2716 | 2716 | { |
| 2717 | 2717 | struct mem_cgroup *memcg = NULL; |
| 2718 | 2718 | unsigned int nr_pages = 1; |
| 2719 | − struct page_cgroup *pc; | |
| 2720 | 2719 | bool oom = true; |
| 2721 | 2720 | int ret; |
| 2722 | 2721 | |
| @@ -2730,11 +2729,10 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, · 7 unmodified lines | ||
| 2730 | 2729 | oom = false; |
| 2731 | 2730 | } |
| 2732 | 2731 | |
| 2733 | − pc = lookup_page_cgroup(page); | |
| 2734 | 2732 | ret = __mem_cgroup_try_charge(mm, gfp_mask, nr_pages, &memcg, oom); |
| 2735 | 2733 | if (ret == -ENOMEM) |
| 2736 | 2734 | return ret; |
| 2737 | − __mem_cgroup_commit_charge(memcg, page, nr_pages, pc, ctype, false); | |
| 2735 | + __mem_cgroup_commit_charge(memcg, page, nr_pages, ctype, false); | |
| 2738 | 2736 | return 0; |
| 2739 | 2737 | } |
| 2740 | 2738 | |
| @@ -2831,16 +2829,13 @@ static void · 90 unmodified lines | ||
| 2831 | 2829 | __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *memcg, |
| 2832 | 2830 | enum charge_type ctype) |
| 2833 | 2831 | { |
| 2834 | − struct page_cgroup *pc; | |
| 2835 | − | |
| 2836 | 2832 | if (mem_cgroup_disabled()) |
| 2837 | 2833 | return; |
| 2838 | 2834 | if (!memcg) |
| 2839 | 2835 | return; |
| 2840 | 2836 | cgroup_exclude_rmdir(&memcg->css); |
| 2841 | 2837 | |
| 2842 | − pc = lookup_page_cgroup(page); | |
| 2843 | − __mem_cgroup_commit_charge(memcg, page, 1, pc, ctype, true); | |
| 2838 | + __mem_cgroup_commit_charge(memcg, page, 1, ctype, true); | |
| 2844 | 2839 | /* |
| 2845 | 2840 | * Now swap is on-memory. This means this page may be |
| 2846 | 2841 | * counted both as mem and swap....double count. |
| @@ -3298,14 +3293,13 @@ int mem_cgroup_prepare_migration(struct page *page, · 451 unmodified lines | ||
| 3298 | 3293 | * page. In the case new page is migrated but not remapped, new page's |
| 3299 | 3294 | * mapcount will be finally 0 and we call uncharge in end_migration(). |
| 3300 | 3295 | */ |
| 3301 | − pc = lookup_page_cgroup(newpage); | |
| 3302 | 3296 | if (PageAnon(page)) |
| 3303 | 3297 | ctype = MEM_CGROUP_CHARGE_TYPE_MAPPED; |
| 3304 | 3298 | else if (page_is_file_cache(page)) |
| 3305 | 3299 | ctype = MEM_CGROUP_CHARGE_TYPE_CACHE; |
| 3306 | 3300 | else |
| 3307 | 3301 | ctype = MEM_CGROUP_CHARGE_TYPE_SHMEM; |
| 3308 | − __mem_cgroup_commit_charge(memcg, newpage, 1, pc, ctype, false); | |
| 3302 | + __mem_cgroup_commit_charge(memcg, newpage, 1, ctype, false); | |
| 3309 | 3303 | return ret; |
| 3310 | 3304 | } |
| 3311 | 3305 | |
| @@ -3392,7 +3386,7 @@ void mem_cgroup_replace_page_cache(struct page *oldpage, · 80 unmodified lines | ||
| 3392 | 3386 | * the newpage may be on LRU(or pagevec for LRU) already. We lock |
| 3393 | 3387 | * LRU while we overwrite pc->mem_cgroup. |
| 3394 | 3388 | */ |
| 3395 | − __mem_cgroup_commit_charge(memcg, newpage, 1, pc, type, true); | |
| 3389 | + __mem_cgroup_commit_charge(memcg, newpage, 1, type, true); | |
| 3396 | 3390 | } |
| 3397 | 3391 | |
| 3398 | 3392 | #ifdef CONFIG_DEBUG_VM |
| @@ -1361,11 +1361,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, · 1360 unmodified lines | ||
| 1361 | 1361 | |
| 1362 | 1362 | mm = get_task_mm(task); |
| 1363 | 1363 | put_task_struct(task); |
| 1364 | − if (mm) | |
| 1365 | − err = do_migrate_pages(mm, old, new, | |
| 1366 | − capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); | |
| 1367 | − else | |
| 1364 | + | |
| 1365 | + if (!mm) { | |
| 1368 | 1366 | err = -EINVAL; |
| 1367 | + goto out; | |
| 1368 | + } | |
| 1369 | + | |
| 1370 | + err = do_migrate_pages(mm, old, new, | |
| 1371 | + capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE); | |
| 1369 | 1372 | |
| 1370 | 1373 | mmput(mm); |
| 1371 | 1374 | out: |
| @@ -1388,14 +1388,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, · 1387 unmodified lines | ||
| 1388 | 1388 | mm = get_task_mm(task); |
| 1389 | 1389 | put_task_struct(task); |
| 1390 | 1390 | |
| 1391 | − if (mm) { | |
| 1392 | − if (nodes) | |
| 1393 | − err = do_pages_move(mm, task_nodes, nr_pages, pages, | |
| 1394 | − nodes, status, flags); | |
| 1395 | − else | |
| 1396 | − err = do_pages_stat(mm, nr_pages, pages, status); | |
| 1397 | − } else | |
| 1398 | − err = -EINVAL; | |
| 1391 | + if (!mm) | |
| 1392 | + return -EINVAL; | |
| 1393 | + | |
| 1394 | + if (nodes) | |
| 1395 | + err = do_pages_move(mm, task_nodes, nr_pages, pages, | |
| 1396 | + nodes, status, flags); | |
| 1397 | + else | |
| 1398 | + err = do_pages_stat(mm, nr_pages, pages, status); | |
| 1399 | 1399 | |
| 1400 | 1400 | mmput(mm); |
| 1401 | 1401 | return err; |
| @@ -240,6 +240,8 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) · 239 unmodified lines | ||
| 240 | 240 | return next; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | +static unsigned long do_brk(unsigned long addr, unsigned long len); | |
| 244 | + | |
| 243 | 245 | SYSCALL_DEFINE1(brk, unsigned long, brk) |
| 244 | 246 | { |
| 245 | 247 | unsigned long rlim, retval; |
| @@ -951,7 +953,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) · 705 unmodified lines | ||
| 951 | 953 | * The caller must hold down_write(¤t->mm->mmap_sem). |
| 952 | 954 | */ |
| 953 | 955 | |
| 954 | −unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |
| 956 | +static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |
| 955 | 957 | unsigned long len, unsigned long prot, |
| 956 | 958 | unsigned long flags, unsigned long pgoff) |
| 957 | 959 | { |
| @@ -1087,7 +1089,32 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, · 129 unmodified lines | ||
| 1087 | 1089 | |
| 1088 | 1090 | return mmap_region(file, addr, len, flags, vm_flags, pgoff); |
| 1089 | 1091 | } |
| 1090 | −EXPORT_SYMBOL(do_mmap_pgoff); | |
| 1092 | + | |
| 1093 | +unsigned long do_mmap(struct file *file, unsigned long addr, | |
| 1094 | + unsigned long len, unsigned long prot, | |
| 1095 | + unsigned long flag, unsigned long offset) | |
| 1096 | +{ | |
| 1097 | + if (unlikely(offset + PAGE_ALIGN(len) < offset)) | |
| 1098 | + return -EINVAL; | |
| 1099 | + if (unlikely(offset & ~PAGE_MASK)) | |
| 1100 | + return -EINVAL; | |
| 1101 | + return do_mmap_pgoff(file, addr, len, prot, flag, offset >> PAGE_SHIFT); | |
| 1102 | +} | |
| 1103 | +EXPORT_SYMBOL(do_mmap); | |
| 1104 | + | |
| 1105 | +unsigned long vm_mmap(struct file *file, unsigned long addr, | |
| 1106 | + unsigned long len, unsigned long prot, | |
| 1107 | + unsigned long flag, unsigned long offset) | |
| 1108 | +{ | |
| 1109 | + unsigned long ret; | |
| 1110 | + struct mm_struct *mm = current->mm; | |
| 1111 | + | |
| 1112 | + down_write(&mm->mmap_sem); | |
| 1113 | + ret = do_mmap(file, addr, len, prot, flag, offset); | |
| 1114 | + up_write(&mm->mmap_sem); | |
| 1115 | + return ret; | |
| 1116 | +} | |
| 1117 | +EXPORT_SYMBOL(vm_mmap); | |
| 1091 | 1118 | |
| 1092 | 1119 | SYSCALL_DEFINE6(mmap_pgoff, unsigned long, addr, unsigned long, len, |
| 1093 | 1120 | unsigned long, prot, unsigned long, flags, |
| @@ -2105,21 +2132,25 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) · 1011 unmodified lines | ||
| 2105 | 2132 | |
| 2106 | 2133 | return 0; |
| 2107 | 2134 | } |
| 2108 | − | |
| 2109 | 2135 | EXPORT_SYMBOL(do_munmap); |
| 2110 | 2136 | |
| 2111 | −SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) | |
| 2137 | +int vm_munmap(unsigned long start, size_t len) | |
| 2112 | 2138 | { |
| 2113 | 2139 | int ret; |
| 2114 | 2140 | struct mm_struct *mm = current->mm; |
| 2115 | 2141 | |
| 2116 | − profile_munmap(addr); | |
| 2117 | − | |
| 2118 | 2142 | down_write(&mm->mmap_sem); |
| 2119 | − ret = do_munmap(mm, addr, len); | |
| 2143 | + ret = do_munmap(mm, start, len); | |
| 2120 | 2144 | up_write(&mm->mmap_sem); |
| 2121 | 2145 | return ret; |
| 2122 | 2146 | } |
| 2147 | +EXPORT_SYMBOL(vm_munmap); | |
| 2148 | + | |
| 2149 | +SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) | |
| 2150 | +{ | |
| 2151 | + profile_munmap(addr); | |
| 2152 | + return vm_munmap(addr, len); | |
| 2153 | +} | |
| 2123 | 2154 | |
| 2124 | 2155 | static inline void verify_mm_writelocked(struct mm_struct *mm) |
| 2125 | 2156 | { |
| @@ -2136,7 +2167,7 @@ static inline void verify_mm_writelocked(struct mm_struct *mm) · 10 unmodified lines | ||
| 2136 | 2167 | * anonymous maps. eventually we may be able to do some |
| 2137 | 2168 | * brk-specific accounting here. |
| 2138 | 2169 | */ |
| 2139 | −unsigned long do_brk(unsigned long addr, unsigned long len) | |
| 2170 | +static unsigned long do_brk(unsigned long addr, unsigned long len) | |
| 2140 | 2171 | { |
| 2141 | 2172 | struct mm_struct * mm = current->mm; |
| 2142 | 2173 | struct vm_area_struct * vma, * prev; |
| @@ -2232,7 +2263,17 @@ out: · 89 unmodified lines | ||
| 2232 | 2263 | return addr; |
| 2233 | 2264 | } |
| 2234 | 2265 | |
| 2235 | −EXPORT_SYMBOL(do_brk); | |
| 2266 | +unsigned long vm_brk(unsigned long addr, unsigned long len) | |
| 2267 | +{ | |
| 2268 | + struct mm_struct *mm = current->mm; | |
| 2269 | + unsigned long ret; | |
| 2270 | + | |
| 2271 | + down_write(&mm->mmap_sem); | |
| 2272 | + ret = do_brk(addr, len); | |
| 2273 | + up_write(&mm->mmap_sem); | |
| 2274 | + return ret; | |
| 2275 | +} | |
| 2276 | +EXPORT_SYMBOL(vm_brk); | |
| 2236 | 2277 | |
| 2237 | 2278 | /* Release all mmaps. */ |
| 2238 | 2279 | void exit_mmap(struct mm_struct *mm) |
| @@ -298,13 +298,19 @@ void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, · 297 unmodified lines | ||
| 298 | 298 | if (WARN_ON_ONCE(slab_is_available())) |
| 299 | 299 | return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); |
| 300 | 300 | |
| 301 | +again: | |
| 301 | 302 | ptr = __alloc_memory_core_early(pgdat->node_id, size, align, |
| 302 | 303 | goal, -1ULL); |
| 303 | 304 | if (ptr) |
| 304 | 305 | return ptr; |
| 305 | 306 | |
| 306 | − return __alloc_memory_core_early(MAX_NUMNODES, size, align, | |
| 307 | − goal, -1ULL); | |
| 307 | + ptr = __alloc_memory_core_early(MAX_NUMNODES, size, align, | |
| 308 | + goal, -1ULL); | |
| 309 | + if (!ptr && goal) { | |
| 310 | + goal = 0; | |
| 311 | + goto again; | |
| 312 | + } | |
| 313 | + return ptr; | |
| 308 | 314 | } |
| 309 | 315 | |
| 310 | 316 | void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, |
| @@ -1233,7 +1233,7 @@ enomem: · 1232 unmodified lines | ||
| 1233 | 1233 | /* |
| 1234 | 1234 | * handle mapping creation for uClinux |
| 1235 | 1235 | */ |
| 1236 | −unsigned long do_mmap_pgoff(struct file *file, | |
| 1236 | +static unsigned long do_mmap_pgoff(struct file *file, | |
| 1237 | 1237 | unsigned long addr, |
| 1238 | 1238 | unsigned long len, |
| 1239 | 1239 | unsigned long prot, |
| @@ -1470,7 +1470,32 @@ error_getting_region: · 230 unmodified lines | ||
| 1470 | 1470 | show_free_areas(0); |
| 1471 | 1471 | return -ENOMEM; |
| 1472 | 1472 | } |
| 1473 | −EXPORT_SYMBOL(do_mmap_pgoff); | |
| 1473 | + | |
| 1474 | +unsigned long do_mmap(struct file *file, unsigned long addr, | |
| 1475 | + unsigned long len, unsigned long prot, | |
| 1476 | + unsigned long flag, unsigned long offset) | |
| 1477 | +{ | |
| 1478 | + if (unlikely(offset + PAGE_ALIGN(len) < offset)) | |
| 1479 | + return -EINVAL; | |
| 1480 | + if (unlikely(offset & ~PAGE_MASK)) | |
| 1481 | + return -EINVAL; | |
| 1482 | + return do_mmap_pgoff(file, addr, len, prot, flag, offset >> PAGE_SHIFT); | |
| 1483 | +} | |
| 1484 | +EXPORT_SYMBOL(do_mmap); | |
| 1485 | + | |
| 1486 | +unsigned long vm_mmap(struct file *file, unsigned long addr, | |
| 1487 | + unsigned long len, unsigned long prot, | |
| 1488 | + unsigned long flag, unsigned long offset) | |
| 1489 | +{ | |
| 1490 | + unsigned long ret; | |
| 1491 | + struct mm_struct *mm = current->mm; | |
| 1492 | + | |
| 1493 | + down_write(&mm->mmap_sem); | |
| 1494 | + ret = do_mmap(file, addr, len, prot, flag, offset); | |
| 1495 | + up_write(&mm->mmap_sem); | |
| 1496 | + return ret; | |
| 1497 | +} | |
| 1498 | +EXPORT_SYMBOL(vm_mmap); | |
| 1474 | 1499 | |
| 1475 | 1500 | SYSCALL_DEFINE6(mmap_pgoff, unsigned long, addr, unsigned long, len, |
| 1476 | 1501 | unsigned long, prot, unsigned long, flags, |
| @@ -1709,16 +1734,22 @@ erase_whole_vma: · 232 unmodified lines | ||
| 1709 | 1734 | } |
| 1710 | 1735 | EXPORT_SYMBOL(do_munmap); |
| 1711 | 1736 | |
| 1712 | −SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) | |
| 1737 | +int vm_munmap(unsigned long addr, size_t len) | |
| 1713 | 1738 | { |
| 1714 | − int ret; | |
| 1715 | 1739 | struct mm_struct *mm = current->mm; |
| 1740 | + int ret; | |
| 1716 | 1741 | |
| 1717 | 1742 | down_write(&mm->mmap_sem); |
| 1718 | 1743 | ret = do_munmap(mm, addr, len); |
| 1719 | 1744 | up_write(&mm->mmap_sem); |
| 1720 | 1745 | return ret; |
| 1721 | 1746 | } |
| 1747 | +EXPORT_SYMBOL(vm_munmap); | |
| 1748 | + | |
| 1749 | +SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len) | |
| 1750 | +{ | |
| 1751 | + return vm_munmap(addr, len); | |
| 1752 | +} | |
| 1722 | 1753 | |
| 1723 | 1754 | /* |
| 1724 | 1755 | * release all the mappings made in a process's VM space |
| @@ -1744,7 +1775,7 @@ void exit_mmap(struct mm_struct *mm) · 19 unmodified lines | ||
| 1744 | 1775 | kleave(""); |
| 1745 | 1776 | } |
| 1746 | 1777 | |
| 1747 | −unsigned long do_brk(unsigned long addr, unsigned long len) | |
| 1778 | +unsigned long vm_brk(unsigned long addr, unsigned long len) | |
| 1748 | 1779 | { |
| 1749 | 1780 | return -ENOMEM; |
| 1750 | 1781 | } |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | */ |
| 27 | 27 | static const struct address_space_operations swap_aops = { |
| 28 | 28 | .writepage = swap_writepage, |
| 29 | − .set_page_dirty = __set_page_dirty_nobuffers, | |
| 29 | + .set_page_dirty = __set_page_dirty_no_writeback, | |
| 30 | 30 | .migratepage = migrate_page, |
| 31 | 31 | }; |
| 32 | 32 | |
| @@ -1568,9 +1568,14 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz, · 1567 unmodified lines | ||
| 1568 | 1568 | reclaim_stat->recent_scanned[0] += nr_anon; |
| 1569 | 1569 | reclaim_stat->recent_scanned[1] += nr_file; |
| 1570 | 1570 | |
| 1571 | − if (current_is_kswapd()) | |
| 1572 | − __count_vm_events(KSWAPD_STEAL, nr_reclaimed); | |
| 1573 | − __count_zone_vm_events(PGSTEAL, zone, nr_reclaimed); | |
| 1571 | + if (global_reclaim(sc)) { | |
| 1572 | + if (current_is_kswapd()) | |
| 1573 | + __count_zone_vm_events(PGSTEAL_KSWAPD, zone, | |
| 1574 | + nr_reclaimed); | |
| 1575 | + else | |
| 1576 | + __count_zone_vm_events(PGSTEAL_DIRECT, zone, | |
| 1577 | + nr_reclaimed); | |
| 1578 | + } | |
| 1574 | 1579 | |
| 1575 | 1580 | putback_inactive_pages(mz, &page_list); |
| 1576 | 1581 | |
| @@ -738,7 +738,8 @@ const char * const vmstat_text[] = { · 737 unmodified lines | ||
| 738 | 738 | "pgmajfault", |
| 739 | 739 | |
| 740 | 740 | TEXTS_FOR_ZONES("pgrefill") |
| 741 | − TEXTS_FOR_ZONES("pgsteal") | |
| 741 | + TEXTS_FOR_ZONES("pgsteal_kswapd") | |
| 742 | + TEXTS_FOR_ZONES("pgsteal_direct") | |
| 742 | 743 | TEXTS_FOR_ZONES("pgscan_kswapd") |
| 743 | 744 | TEXTS_FOR_ZONES("pgscan_direct") |
| 744 | 745 | |
| @@ -747,7 +748,6 @@ const char * const vmstat_text[] = { · 2 unmodified lines | ||
| 747 | 748 | #endif |
| 748 | 749 | "pginodesteal", |
| 749 | 750 | "slabs_scanned", |
| 750 | − "kswapd_steal", | |
| 751 | 751 | "kswapd_inodesteal", |
| 752 | 752 | "kswapd_low_wmark_hit_quickly", |
| 753 | 753 | "kswapd_high_wmark_hit_quickly", |
| @@ -2011,16 +2011,17 @@ static void __exit ax25_exit(void) · 2010 unmodified lines | ||
| 2011 | 2011 | proc_net_remove(&init_net, "ax25_route"); |
| 2012 | 2012 | proc_net_remove(&init_net, "ax25"); |
| 2013 | 2013 | proc_net_remove(&init_net, "ax25_calls"); |
| 2014 | − ax25_rt_free(); | |
| 2015 | − ax25_uid_free(); | |
| 2016 | − ax25_dev_free(); | |
| 2017 | 2014 | |
| 2018 | − ax25_unregister_sysctl(); | |
| 2019 | 2015 | unregister_netdevice_notifier(&ax25_dev_notifier); |
| 2016 | + ax25_unregister_sysctl(); | |
| 2020 | 2017 | |
| 2021 | 2018 | dev_remove_pack(&ax25_packet_type); |
| 2022 | 2019 | |
| 2023 | 2020 | sock_unregister(PF_AX25); |
| 2024 | 2021 | proto_unregister(&ax25_proto); |
| 2022 | + | |
| 2023 | + ax25_rt_free(); | |
| 2024 | + ax25_uid_free(); | |
| 2025 | + ax25_dev_free(); | |
| 2025 | 2026 | } |
| 2026 | 2027 | module_exit(ax25_exit); |
| @@ -103,6 +103,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt) · 102 unmodified lines | ||
| 103 | 103 | skb->protocol = htons(ETH_P_IPV6); |
| 104 | 104 | break; |
| 105 | 105 | default: |
| 106 | + kfree_skb(skb); | |
| 106 | 107 | priv->netdev->stats.rx_errors++; |
| 107 | 108 | return -EINVAL; |
| 108 | 109 | } |
| @@ -220,14 +221,16 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev) · 111 unmodified lines | ||
| 220 | 221 | |
| 221 | 222 | if (skb->len > priv->netdev->mtu) { |
| 222 | 223 | pr_warn("Size of skb exceeded MTU\n"); |
| 224 | + kfree_skb(skb); | |
| 223 | 225 | dev->stats.tx_errors++; |
| 224 | − return -ENOSPC; | |
| 226 | + return NETDEV_TX_OK; | |
| 225 | 227 | } |
| 226 | 228 | |
| 227 | 229 | if (!priv->flowenabled) { |
| 228 | 230 | pr_debug("dropping packets flow off\n"); |
| 231 | + kfree_skb(skb); | |
| 229 | 232 | dev->stats.tx_dropped++; |
| 230 | − return NETDEV_TX_BUSY; | |
| 233 | + return NETDEV_TX_OK; | |
| 231 | 234 | } |
| 232 | 235 | |
| 233 | 236 | if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP) |
| @@ -242,7 +245,7 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev) · 8 unmodified lines | ||
| 242 | 245 | result = priv->chnl.dn->transmit(priv->chnl.dn, pkt); |
| 243 | 246 | if (result) { |
| 244 | 247 | dev->stats.tx_dropped++; |
| 245 | − return result; | |
| 248 | + return NETDEV_TX_OK; | |
| 246 | 249 | } |
| 247 | 250 | |
| 248 | 251 | /* Update statistics. */ |
| @@ -1409,14 +1409,34 @@ EXPORT_SYMBOL(register_netdevice_notifier); · 1408 unmodified lines | ||
| 1409 | 1409 | * register_netdevice_notifier(). The notifier is unlinked into the |
| 1410 | 1410 | * kernel structures and may then be reused. A negative errno code |
| 1411 | 1411 | * is returned on a failure. |
| 1412 | + * | |
| 1413 | + * After unregistering unregister and down device events are synthesized | |
| 1414 | + * for all devices on the device list to the removed notifier to remove | |
| 1415 | + * the need for special case cleanup code. | |
| 1412 | 1416 | */ |
| 1413 | 1417 | |
| 1414 | 1418 | int unregister_netdevice_notifier(struct notifier_block *nb) |
| 1415 | 1419 | { |
| 1420 | + struct net_device *dev; | |
| 1421 | + struct net *net; | |
| 1416 | 1422 | int err; |
| 1417 | 1423 | |
| 1418 | 1424 | rtnl_lock(); |
| 1419 | 1425 | err = raw_notifier_chain_unregister(&netdev_chain, nb); |
| 1426 | + if (err) | |
| 1427 | + goto unlock; | |
| 1428 | + | |
| 1429 | + for_each_net(net) { | |
| 1430 | + for_each_netdev(net, dev) { | |
| 1431 | + if (dev->flags & IFF_UP) { | |
| 1432 | + nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); | |
| 1433 | + nb->notifier_call(nb, NETDEV_DOWN, dev); | |
| 1434 | + } | |
| 1435 | + nb->notifier_call(nb, NETDEV_UNREGISTER, dev); | |
| 1436 | + nb->notifier_call(nb, NETDEV_UNREGISTER_BATCH, dev); | |
| 1437 | + } | |
| 1438 | + } | |
| 1439 | +unlock: | |
| 1420 | 1440 | rtnl_unlock(); |
| 1421 | 1441 | return err; |
| 1422 | 1442 | } |
| @@ -150,6 +150,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) · 149 unmodified lines | ||
| 150 | 150 | for (i = 0; i < msg->entries; i++) { |
| 151 | 151 | if (!memcmp(&location, msg->points[i].pc, sizeof(void *))) { |
| 152 | 152 | msg->points[i].count++; |
| 153 | + atomic_inc(&data->dm_hit_count); | |
| 153 | 154 | goto out; |
| 154 | 155 | } |
| 155 | 156 | } |
| @@ -83,21 +83,29 @@ assign: · 82 unmodified lines | ||
| 83 | 83 | |
| 84 | 84 | static int ops_init(const struct pernet_operations *ops, struct net *net) |
| 85 | 85 | { |
| 86 | − int err; | |
| 86 | + int err = -ENOMEM; | |
| 87 | + void *data = NULL; | |
| 88 | + | |
| 87 | 89 | if (ops->id && ops->size) { |
| 88 | − void *data = kzalloc(ops->size, GFP_KERNEL); | |
| 90 | + data = kzalloc(ops->size, GFP_KERNEL); | |
42 more lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 159 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 99 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 365 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.