diff options
61 files changed, 515 insertions, 521 deletions
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/alsa/soc/codec.txt index 37ba3a72cb76..bce23a4a7875 100644 --- a/Documentation/sound/alsa/soc/codec.txt +++ b/Documentation/sound/alsa/soc/codec.txt | |||
| @@ -27,42 +27,38 @@ ASoC Codec driver breakdown | |||
| 27 | 27 | ||
| 28 | 1 - Codec DAI and PCM configuration | 28 | 1 - Codec DAI and PCM configuration |
| 29 | ----------------------------------- | 29 | ----------------------------------- |
| 30 | Each codec driver must have a struct snd_soc_codec_dai to define its DAI and | 30 | Each codec driver must have a struct snd_soc_dai_driver to define its DAI and |
| 31 | PCM capabilities and operations. This struct is exported so that it can be | 31 | PCM capabilities and operations. This struct is exported so that it can be |
| 32 | registered with the core by your machine driver. | 32 | registered with the core by your machine driver. |
| 33 | 33 | ||
| 34 | e.g. | 34 | e.g. |
| 35 | 35 | ||
| 36 | struct snd_soc_codec_dai wm8731_dai = { | 36 | static struct snd_soc_dai_ops wm8731_dai_ops = { |
| 37 | .name = "WM8731", | 37 | .prepare = wm8731_pcm_prepare, |
| 38 | /* playback capabilities */ | 38 | .hw_params = wm8731_hw_params, |
| 39 | .shutdown = wm8731_shutdown, | ||
| 40 | .digital_mute = wm8731_mute, | ||
| 41 | .set_sysclk = wm8731_set_dai_sysclk, | ||
| 42 | .set_fmt = wm8731_set_dai_fmt, | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct snd_soc_dai_driver wm8731_dai = { | ||
| 46 | .name = "wm8731-hifi", | ||
| 39 | .playback = { | 47 | .playback = { |
| 40 | .stream_name = "Playback", | 48 | .stream_name = "Playback", |
| 41 | .channels_min = 1, | 49 | .channels_min = 1, |
| 42 | .channels_max = 2, | 50 | .channels_max = 2, |
| 43 | .rates = WM8731_RATES, | 51 | .rates = WM8731_RATES, |
| 44 | .formats = WM8731_FORMATS,}, | 52 | .formats = WM8731_FORMATS,}, |
| 45 | /* capture capabilities */ | ||
| 46 | .capture = { | 53 | .capture = { |
| 47 | .stream_name = "Capture", | 54 | .stream_name = "Capture", |
| 48 | .channels_min = 1, | 55 | .channels_min = 1, |
| 49 | .channels_max = 2, | 56 | .channels_max = 2, |
| 50 | .rates = WM8731_RATES, | 57 | .rates = WM8731_RATES, |
| 51 | .formats = WM8731_FORMATS,}, | 58 | .formats = WM8731_FORMATS,}, |
| 52 | /* pcm operations - see section 4 below */ | 59 | .ops = &wm8731_dai_ops, |
| 53 | .ops = { | 60 | .symmetric_rates = 1, |
| 54 | .prepare = wm8731_pcm_prepare, | ||
| 55 | .hw_params = wm8731_hw_params, | ||
| 56 | .shutdown = wm8731_shutdown, | ||
| 57 | }, | ||
| 58 | /* DAI operations - see DAI.txt */ | ||
| 59 | .dai_ops = { | ||
| 60 | .digital_mute = wm8731_mute, | ||
| 61 | .set_sysclk = wm8731_set_dai_sysclk, | ||
| 62 | .set_fmt = wm8731_set_dai_fmt, | ||
| 63 | } | ||
| 64 | }; | 61 | }; |
| 65 | EXPORT_SYMBOL_GPL(wm8731_dai); | ||
| 66 | 62 | ||
| 67 | 63 | ||
| 68 | 2 - Codec control IO | 64 | 2 - Codec control IO |
| @@ -186,13 +182,14 @@ when the mute is applied or freed. | |||
| 186 | 182 | ||
| 187 | i.e. | 183 | i.e. |
| 188 | 184 | ||
| 189 | static int wm8974_mute(struct snd_soc_codec *codec, | 185 | static int wm8974_mute(struct snd_soc_dai *dai, int mute) |
| 190 | struct snd_soc_codec_dai *dai, int mute) | ||
| 191 | { | 186 | { |
| 192 | u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf; | 187 | struct snd_soc_codec *codec = dai->codec; |
| 193 | if(mute) | 188 | u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf; |
| 194 | wm8974_write(codec, WM8974_DAC, mute_reg | 0x40); | 189 | |
| 190 | if (mute) | ||
| 191 | snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40); | ||
| 195 | else | 192 | else |
| 196 | wm8974_write(codec, WM8974_DAC, mute_reg); | 193 | snd_soc_write(codec, WM8974_DAC, mute_reg); |
| 197 | return 0; | 194 | return 0; |
| 198 | } | 195 | } |
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/alsa/soc/machine.txt index 2524c75557df..3e2ec9cbf397 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/alsa/soc/machine.txt | |||
| @@ -12,6 +12,8 @@ the following struct:- | |||
| 12 | struct snd_soc_card { | 12 | struct snd_soc_card { |
| 13 | char *name; | 13 | char *name; |
| 14 | 14 | ||
| 15 | ... | ||
| 16 | |||
| 15 | int (*probe)(struct platform_device *pdev); | 17 | int (*probe)(struct platform_device *pdev); |
| 16 | int (*remove)(struct platform_device *pdev); | 18 | int (*remove)(struct platform_device *pdev); |
| 17 | 19 | ||
| @@ -22,12 +24,13 @@ struct snd_soc_card { | |||
| 22 | int (*resume_pre)(struct platform_device *pdev); | 24 | int (*resume_pre)(struct platform_device *pdev); |
| 23 | int (*resume_post)(struct platform_device *pdev); | 25 | int (*resume_post)(struct platform_device *pdev); |
| 24 | 26 | ||
| 25 | /* machine stream operations */ | 27 | ... |
| 26 | struct snd_soc_ops *ops; | ||
| 27 | 28 | ||
| 28 | /* CPU <--> Codec DAI links */ | 29 | /* CPU <--> Codec DAI links */ |
| 29 | struct snd_soc_dai_link *dai_link; | 30 | struct snd_soc_dai_link *dai_link; |
| 30 | int num_links; | 31 | int num_links; |
| 32 | |||
| 33 | ... | ||
| 31 | }; | 34 | }; |
| 32 | 35 | ||
| 33 | probe()/remove() | 36 | probe()/remove() |
| @@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs | |||
| 42 | and DMA is suspended and resumed. Optional. | 45 | and DMA is suspended and resumed. Optional. |
| 43 | 46 | ||
| 44 | 47 | ||
| 45 | Machine operations | ||
| 46 | ------------------ | ||
| 47 | The machine specific audio operations can be set here. Again this is optional. | ||
| 48 | |||
| 49 | |||
| 50 | Machine DAI Configuration | 48 | Machine DAI Configuration |
| 51 | ------------------------- | 49 | ------------------------- |
| 52 | The machine DAI configuration glues all the codec and CPU DAIs together. It can | 50 | The machine DAI configuration glues all the codec and CPU DAIs together. It can |
| @@ -61,8 +59,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. | |||
| 61 | static struct snd_soc_dai_link corgi_dai = { | 59 | static struct snd_soc_dai_link corgi_dai = { |
| 62 | .name = "WM8731", | 60 | .name = "WM8731", |
| 63 | .stream_name = "WM8731", | 61 | .stream_name = "WM8731", |
| 64 | .cpu_dai = &pxa_i2s_dai, | 62 | .cpu_dai_name = "pxa-is2-dai", |
| 65 | .codec_dai = &wm8731_dai, | 63 | .codec_dai_name = "wm8731-hifi", |
| 64 | .platform_name = "pxa-pcm-audio", | ||
| 65 | .codec_name = "wm8713-codec.0-001a", | ||
| 66 | .init = corgi_wm8731_init, | 66 | .init = corgi_wm8731_init, |
| 67 | .ops = &corgi_ops, | 67 | .ops = &corgi_ops, |
| 68 | }; | 68 | }; |
| @@ -77,26 +77,6 @@ static struct snd_soc_card snd_soc_corgi = { | |||
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | 79 | ||
| 80 | Machine Audio Subsystem | ||
| 81 | ----------------------- | ||
| 82 | |||
| 83 | The machine soc device glues the platform, machine and codec driver together. | ||
| 84 | Private data can also be set here. e.g. | ||
| 85 | |||
| 86 | /* corgi audio private data */ | ||
| 87 | static struct wm8731_setup_data corgi_wm8731_setup = { | ||
| 88 | .i2c_address = 0x1b, | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* corgi audio subsystem */ | ||
| 92 | static struct snd_soc_device corgi_snd_devdata = { | ||
| 93 | .machine = &snd_soc_corgi, | ||
| 94 | .platform = &pxa2xx_soc_platform, | ||
| 95 | .codec_dev = &soc_codec_dev_wm8731, | ||
| 96 | .codec_data = &corgi_wm8731_setup, | ||
| 97 | }; | ||
| 98 | |||
| 99 | |||
| 100 | Machine Power Map | 80 | Machine Power Map |
| 101 | ----------------- | 81 | ----------------- |
| 102 | 82 | ||
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/alsa/soc/platform.txt index 06d835987c6a..d57efad37e0a 100644 --- a/Documentation/sound/alsa/soc/platform.txt +++ b/Documentation/sound/alsa/soc/platform.txt | |||
| @@ -20,9 +20,10 @@ struct snd_soc_ops { | |||
| 20 | int (*trigger)(struct snd_pcm_substream *, int); | 20 | int (*trigger)(struct snd_pcm_substream *, int); |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | The platform driver exports its DMA functionality via struct snd_soc_platform:- | 23 | The platform driver exports its DMA functionality via struct |
| 24 | snd_soc_platform_driver:- | ||
| 24 | 25 | ||
| 25 | struct snd_soc_platform { | 26 | struct snd_soc_platform_driver { |
| 26 | char *name; | 27 | char *name; |
| 27 | 28 | ||
| 28 | int (*probe)(struct platform_device *pdev); | 29 | int (*probe)(struct platform_device *pdev); |
| @@ -34,6 +35,13 @@ struct snd_soc_platform { | |||
| 34 | int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); | 35 | int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *); |
| 35 | void (*pcm_free)(struct snd_pcm *); | 36 | void (*pcm_free)(struct snd_pcm *); |
| 36 | 37 | ||
| 38 | /* | ||
| 39 | * For platform caused delay reporting. | ||
| 40 | * Optional. | ||
| 41 | */ | ||
| 42 | snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *, | ||
| 43 | struct snd_soc_dai *); | ||
| 44 | |||
| 37 | /* platform stream ops */ | 45 | /* platform stream ops */ |
| 38 | struct snd_pcm_ops *pcm_ops; | 46 | struct snd_pcm_ops *pcm_ops; |
| 39 | }; | 47 | }; |
diff --git a/MAINTAINERS b/MAINTAINERS index 2261749c0aed..55592f8b672c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -3150,7 +3150,7 @@ S: Orphan | |||
| 3150 | F: drivers/video/imsttfb.c | 3150 | F: drivers/video/imsttfb.c |
| 3151 | 3151 | ||
| 3152 | INFINIBAND SUBSYSTEM | 3152 | INFINIBAND SUBSYSTEM |
| 3153 | M: Roland Dreier <rolandd@cisco.com> | 3153 | M: Roland Dreier <roland@kernel.org> |
| 3154 | M: Sean Hefty <sean.hefty@intel.com> | 3154 | M: Sean Hefty <sean.hefty@intel.com> |
| 3155 | M: Hal Rosenstock <hal.rosenstock@gmail.com> | 3155 | M: Hal Rosenstock <hal.rosenstock@gmail.com> |
| 3156 | L: linux-rdma@vger.kernel.org | 3156 | L: linux-rdma@vger.kernel.org |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 96deec63bcf3..89178164af5e 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
| @@ -368,7 +368,7 @@ INSTALL := install | |||
| 368 | extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) | 368 | extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) |
| 369 | hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) | 369 | hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y)) |
| 370 | wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper | 370 | wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper |
| 371 | dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts)) | 371 | dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts)) |
| 372 | 372 | ||
| 373 | all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed) | 373 | all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed) |
| 374 | 374 | ||
diff --git a/arch/powerpc/boot/dts/mpc8308rdb.dts b/arch/powerpc/boot/dts/mpc8308rdb.dts index d3db02f98ddd..a0bd1881081e 100644 --- a/arch/powerpc/boot/dts/mpc8308rdb.dts +++ b/arch/powerpc/boot/dts/mpc8308rdb.dts | |||
| @@ -109,7 +109,7 @@ | |||
| 109 | #address-cells = <1>; | 109 | #address-cells = <1>; |
| 110 | #size-cells = <1>; | 110 | #size-cells = <1>; |
| 111 | device_type = "soc"; | 111 | device_type = "soc"; |
| 112 | compatible = "fsl,mpc8315-immr", "simple-bus"; | 112 | compatible = "fsl,mpc8308-immr", "simple-bus"; |
| 113 | ranges = <0 0xe0000000 0x00100000>; | 113 | ranges = <0 0xe0000000 0x00100000>; |
| 114 | reg = <0xe0000000 0x00000200>; | 114 | reg = <0xe0000000 0x00000200>; |
| 115 | bus-frequency = <0>; | 115 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts index 2bbecbb4cbf9..69422eb24d97 100644 --- a/arch/powerpc/boot/dts/p1022ds.dts +++ b/arch/powerpc/boot/dts/p1022ds.dts | |||
| @@ -291,13 +291,13 @@ | |||
| 291 | ranges = <0x0 0xc100 0x200>; | 291 | ranges = <0x0 0xc100 0x200>; |
| 292 | cell-index = <1>; | 292 | cell-index = <1>; |
| 293 | dma00: dma-channel@0 { | 293 | dma00: dma-channel@0 { |
| 294 | compatible = "fsl,eloplus-dma-channel"; | 294 | compatible = "fsl,ssi-dma-channel"; |
| 295 | reg = <0x0 0x80>; | 295 | reg = <0x0 0x80>; |
| 296 | cell-index = <0>; | 296 | cell-index = <0>; |
| 297 | interrupts = <76 2>; | 297 | interrupts = <76 2>; |
| 298 | }; | 298 | }; |
| 299 | dma01: dma-channel@80 { | 299 | dma01: dma-channel@80 { |
| 300 | compatible = "fsl,eloplus-dma-channel"; | 300 | compatible = "fsl,ssi-dma-channel"; |
| 301 | reg = <0x80 0x80>; | 301 | reg = <0x80 0x80>; |
| 302 | cell-index = <1>; | 302 | cell-index = <1>; |
| 303 | interrupts = <77 2>; | 303 | interrupts = <77 2>; |
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index f87f0e15cfa7..9c3f22c6cde1 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig | |||
| @@ -2,7 +2,7 @@ CONFIG_PPC64=y | |||
| 2 | CONFIG_ALTIVEC=y | 2 | CONFIG_ALTIVEC=y |
| 3 | CONFIG_VSX=y | 3 | CONFIG_VSX=y |
| 4 | CONFIG_SMP=y | 4 | CONFIG_SMP=y |
| 5 | CONFIG_NR_CPUS=128 | 5 | CONFIG_NR_CPUS=1024 |
| 6 | CONFIG_EXPERIMENTAL=y | 6 | CONFIG_EXPERIMENTAL=y |
| 7 | CONFIG_SYSVIPC=y | 7 | CONFIG_SYSVIPC=y |
| 8 | CONFIG_POSIX_MQUEUE=y | 8 | CONFIG_POSIX_MQUEUE=y |
| @@ -45,6 +45,8 @@ CONFIG_KEXEC=y | |||
| 45 | CONFIG_IRQ_ALL_CPUS=y | 45 | CONFIG_IRQ_ALL_CPUS=y |
| 46 | CONFIG_MEMORY_HOTPLUG=y | 46 | CONFIG_MEMORY_HOTPLUG=y |
| 47 | CONFIG_MEMORY_HOTREMOVE=y | 47 | CONFIG_MEMORY_HOTREMOVE=y |
| 48 | CONFIG_PPC_64K_PAGES=y | ||
| 49 | CONFIG_PPC_SUBPAGE_PROT=y | ||
| 48 | CONFIG_SCHED_SMT=y | 50 | CONFIG_SCHED_SMT=y |
| 49 | CONFIG_HOTPLUG_PCI=m | 51 | CONFIG_HOTPLUG_PCI=m |
| 50 | CONFIG_HOTPLUG_PCI_RPA=m | 52 | CONFIG_HOTPLUG_PCI_RPA=m |
| @@ -184,6 +186,7 @@ CONFIG_ACENIC_OMIT_TIGON_I=y | |||
| 184 | CONFIG_E1000=y | 186 | CONFIG_E1000=y |
| 185 | CONFIG_E1000E=y | 187 | CONFIG_E1000E=y |
| 186 | CONFIG_TIGON3=y | 188 | CONFIG_TIGON3=y |
| 189 | CONFIG_BNX2=m | ||
| 187 | CONFIG_CHELSIO_T1=m | 190 | CONFIG_CHELSIO_T1=m |
| 188 | CONFIG_CHELSIO_T3=m | 191 | CONFIG_CHELSIO_T3=m |
| 189 | CONFIG_EHEA=y | 192 | CONFIG_EHEA=y |
| @@ -311,9 +314,7 @@ CONFIG_DEBUG_KERNEL=y | |||
| 311 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 314 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set |
| 312 | CONFIG_LATENCYTOP=y | 315 | CONFIG_LATENCYTOP=y |
| 313 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 316 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
| 314 | CONFIG_IRQSOFF_TRACER=y | ||
| 315 | CONFIG_SCHED_TRACER=y | 317 | CONFIG_SCHED_TRACER=y |
| 316 | CONFIG_STACK_TRACER=y | ||
| 317 | CONFIG_BLK_DEV_IO_TRACE=y | 318 | CONFIG_BLK_DEV_IO_TRACE=y |
| 318 | CONFIG_DEBUG_STACKOVERFLOW=y | 319 | CONFIG_DEBUG_STACKOVERFLOW=y |
| 319 | CONFIG_DEBUG_STACK_USAGE=y | 320 | CONFIG_DEBUG_STACK_USAGE=y |
diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h index 96a7d067fbb2..921a8470e18a 100644 --- a/arch/powerpc/include/asm/feature-fixups.h +++ b/arch/powerpc/include/asm/feature-fixups.h | |||
| @@ -37,18 +37,21 @@ label##2: \ | |||
| 37 | .align 2; \ | 37 | .align 2; \ |
| 38 | label##3: | 38 | label##3: |
| 39 | 39 | ||
| 40 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ | 40 | #define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect) \ |
| 41 | label##4: \ | 41 | label##4: \ |
| 42 | .popsection; \ | 42 | .popsection; \ |
| 43 | .pushsection sect,"a"; \ | 43 | .pushsection sect,"a"; \ |
| 44 | .align 3; \ | 44 | .align 3; \ |
| 45 | label##5: \ | 45 | label##5: \ |
| 46 | FTR_ENTRY_LONG msk; \ | 46 | FTR_ENTRY_LONG msk; \ |
| 47 | FTR_ENTRY_LONG val; \ | 47 | FTR_ENTRY_LONG val; \ |
| 48 | FTR_ENTRY_OFFSET label##1b-label##5b; \ | 48 | FTR_ENTRY_OFFSET label##1b-label##5b; \ |
| 49 | FTR_ENTRY_OFFSET label##2b-label##5b; \ | 49 | FTR_ENTRY_OFFSET label##2b-label##5b; \ |
| 50 | FTR_ENTRY_OFFSET label##3b-label##5b; \ | 50 | FTR_ENTRY_OFFSET label##3b-label##5b; \ |
| 51 | FTR_ENTRY_OFFSET label##4b-label##5b; \ | 51 | FTR_ENTRY_OFFSET label##4b-label##5b; \ |
| 52 | .ifgt (label##4b-label##3b)-(label##2b-label##1b); \ | ||
| 53 | .error "Feature section else case larger than body"; \ | ||
| 54 | .endif; \ | ||
| 52 | .popsection; | 55 | .popsection; |
| 53 | 56 | ||
| 54 | 57 | ||
diff --git a/arch/powerpc/include/asm/immap_qe.h b/arch/powerpc/include/asm/immap_qe.h index 4e10f508570a..0edb6842b13d 100644 --- a/arch/powerpc/include/asm/immap_qe.h +++ b/arch/powerpc/include/asm/immap_qe.h | |||
| @@ -467,13 +467,22 @@ struct qe_immap { | |||
| 467 | extern struct qe_immap __iomem *qe_immr; | 467 | extern struct qe_immap __iomem *qe_immr; |
| 468 | extern phys_addr_t get_qe_base(void); | 468 | extern phys_addr_t get_qe_base(void); |
| 469 | 469 | ||
| 470 | static inline unsigned long immrbar_virt_to_phys(void *address) | 470 | /* |
| 471 | * Returns the offset within the QE address space of the given pointer. | ||
| 472 | * | ||
| 473 | * Note that the QE does not support 36-bit physical addresses, so if | ||
| 474 | * get_qe_base() returns a number above 4GB, the caller will probably fail. | ||
| 475 | */ | ||
| 476 | static inline phys_addr_t immrbar_virt_to_phys(void *address) | ||
| 471 | { | 477 | { |
| 472 | if ( ((u32)address >= (u32)qe_immr) && | 478 | void *q = (void *)qe_immr; |
| 473 | ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) ) | 479 | |
| 474 | return (unsigned long)(address - (u32)qe_immr + | 480 | /* Is it a MURAM address? */ |
| 475 | (u32)get_qe_base()); | 481 | if ((address >= q) && (address < (q + QE_IMMAP_SIZE))) |
| 476 | return (unsigned long)virt_to_phys(address); | 482 | return get_qe_base() + (address - q); |
| 483 | |||
| 484 | /* It's an address returned by kmalloc */ | ||
| 485 | return virt_to_phys(address); | ||
| 477 | } | 486 | } |
| 478 | 487 | ||
| 479 | #endif /* __KERNEL__ */ | 488 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h index b85d8ddbb666..b0b06d85788d 100644 --- a/arch/powerpc/include/asm/irqflags.h +++ b/arch/powerpc/include/asm/irqflags.h | |||
| @@ -12,24 +12,44 @@ | |||
| 12 | 12 | ||
| 13 | #else | 13 | #else |
| 14 | #ifdef CONFIG_TRACE_IRQFLAGS | 14 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 15 | #ifdef CONFIG_IRQSOFF_TRACER | ||
| 16 | /* | ||
| 17 | * Since the ftrace irqsoff latency trace checks CALLER_ADDR1, | ||
| 18 | * which is the stack frame here, we need to force a stack frame | ||
| 19 | * in case we came from user space. | ||
| 20 | */ | ||
| 21 | #define TRACE_WITH_FRAME_BUFFER(func) \ | ||
| 22 | mflr r0; \ | ||
| 23 | stdu r1, -32(r1); \ | ||
| 24 | std r0, 16(r1); \ | ||
| 25 | stdu r1, -32(r1); \ | ||
| 26 | bl func; \ | ||
| 27 | ld r1, 0(r1); \ | ||
| 28 | ld r1, 0(r1); | ||
| 29 | #else | ||
| 30 | #define TRACE_WITH_FRAME_BUFFER(func) \ | ||
| 31 | bl func; | ||
| 32 | #endif | ||
| 33 | |||
| 15 | /* | 34 | /* |
| 16 | * Most of the CPU's IRQ-state tracing is done from assembly code; we | 35 | * Most of the CPU's IRQ-state tracing is done from assembly code; we |
| 17 | * have to call a C function so call a wrapper that saves all the | 36 | * have to call a C function so call a wrapper that saves all the |
| 18 | * C-clobbered registers. | 37 | * C-clobbered registers. |
| 19 | */ | 38 | */ |
| 20 | #define TRACE_ENABLE_INTS bl .trace_hardirqs_on | 39 | #define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) |
| 21 | #define TRACE_DISABLE_INTS bl .trace_hardirqs_off | 40 | #define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) |
| 22 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ | 41 | |
| 23 | cmpdi en,0; \ | 42 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ |
| 24 | bne 95f; \ | 43 | cmpdi en,0; \ |
| 25 | stb en,PACASOFTIRQEN(r13); \ | 44 | bne 95f; \ |
| 26 | bl .trace_hardirqs_off; \ | 45 | stb en,PACASOFTIRQEN(r13); \ |
| 27 | b skip; \ | 46 | TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) \ |
| 28 | 95: bl .trace_hardirqs_on; \ | 47 | b skip; \ |
| 48 | 95: TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) \ | ||
| 29 | li en,1; | 49 | li en,1; |
| 30 | #define TRACE_AND_RESTORE_IRQ(en) \ | 50 | #define TRACE_AND_RESTORE_IRQ(en) \ |
| 31 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ | 51 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ |
| 32 | stb en,PACASOFTIRQEN(r13); \ | 52 | stb en,PACASOFTIRQEN(r13); \ |
| 33 | 96: | 53 | 96: |
| 34 | #else | 54 | #else |
| 35 | #define TRACE_ENABLE_INTS | 55 | #define TRACE_ENABLE_INTS |
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 8433d36619a1..991d5998d6be 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
| @@ -116,9 +116,6 @@ struct machdep_calls { | |||
| 116 | * If for some reason there is no irq, but the interrupt | 116 | * If for some reason there is no irq, but the interrupt |
| 117 | * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */ | 117 | * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */ |
| 118 | unsigned int (*get_irq)(void); | 118 | unsigned int (*get_irq)(void); |
| 119 | #ifdef CONFIG_KEXEC | ||
| 120 | void (*kexec_cpu_down)(int crash_shutdown, int secondary); | ||
| 121 | #endif | ||
| 122 | 119 | ||
| 123 | /* PCI stuff */ | 120 | /* PCI stuff */ |
| 124 | /* Called after scanning the bus, before allocating resources */ | 121 | /* Called after scanning the bus, before allocating resources */ |
| @@ -235,11 +232,7 @@ struct machdep_calls { | |||
| 235 | void (*machine_shutdown)(void); | 232 | void (*machine_shutdown)(void); |
| 236 | 233 | ||
| 237 | #ifdef CONFIG_KEXEC | 234 | #ifdef CONFIG_KEXEC |
| 238 | /* Called to do the minimal shutdown needed to run a kexec'd kernel | 235 | void (*kexec_cpu_down)(int crash_shutdown, int secondary); |
| 239 | * to run successfully. | ||
| 240 | * XXX Should we move this one out of kexec scope? | ||
| 241 | */ | ||
| 242 | void (*machine_crash_shutdown)(struct pt_regs *regs); | ||
| 243 | 236 | ||
| 244 | /* Called to do what every setup is needed on image and the | 237 | /* Called to do what every setup is needed on image and the |
| 245 | * reboot code buffer. Returns 0 on success. | 238 | * reboot code buffer. Returns 0 on success. |
| @@ -247,15 +240,6 @@ struct machdep_calls { | |||
| 247 | * claims to support kexec. | 240 | * claims to support kexec. |
| 248 | */ | 241 | */ |
| 249 | int (*machine_kexec_prepare)(struct kimage *image); | 242 | int (*machine_kexec_prepare)(struct kimage *image); |
| 250 | |||
| 251 | /* Called to handle any machine specific cleanup on image */ | ||
| 252 | void (*machine_kexec_cleanup)(struct kimage *image); | ||
| 253 | |||
| 254 | /* Called to perform the _real_ kexec. | ||
| 255 | * Do NOT allocate memory or fail here. We are past the point of | ||
| 256 | * no return. | ||
| 257 | */ | ||
| 258 | void (*machine_kexec)(struct kimage *image); | ||
| 259 | #endif /* CONFIG_KEXEC */ | 243 | #endif /* CONFIG_KEXEC */ |
| 260 | 244 | ||
| 261 | #ifdef CONFIG_SUSPEND | 245 | #ifdef CONFIG_SUSPEND |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index ff0005eec7dd..125fc1ad665d 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
| @@ -283,6 +283,7 @@ | |||
| 283 | #define HID0_NOPTI (1<<0) /* No-op dcbt and dcbst instr. */ | 283 | #define HID0_NOPTI (1<<0) /* No-op dcbt and dcbst instr. */ |
| 284 | 284 | ||
| 285 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ | 285 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ |
| 286 | #ifdef CONFIG_6xx | ||
| 286 | #define HID1_EMCP (1<<31) /* 7450 Machine Check Pin Enable */ | 287 | #define HID1_EMCP (1<<31) /* 7450 Machine Check Pin Enable */ |
| 287 | #define HID1_DFS (1<<22) /* 7447A Dynamic Frequency Scaling */ | 288 | #define HID1_DFS (1<<22) /* 7447A Dynamic Frequency Scaling */ |
| 288 | #define HID1_PC0 (1<<16) /* 7450 PLL_CFG[0] */ | 289 | #define HID1_PC0 (1<<16) /* 7450 PLL_CFG[0] */ |
| @@ -292,6 +293,7 @@ | |||
| 292 | #define HID1_SYNCBE (1<<11) /* 7450 ABE for sync, eieio */ | 293 | #define HID1_SYNCBE (1<<11) /* 7450 ABE for sync, eieio */ |
| 293 | #define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */ | 294 | #define HID1_ABE (1<<10) /* 7450 Address Broadcast Enable */ |
| 294 | #define HID1_PS (1<<16) /* 750FX PLL selection */ | 295 | #define HID1_PS (1<<16) /* 750FX PLL selection */ |
| 296 | #endif | ||
| 295 | #define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */ | 297 | #define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */ |
| 296 | #define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */ | 298 | #define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */ |
| 297 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 299 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index 667a498eaee1..e68c69bf741a 100644 --- a/arch/powerpc/include/asm/reg_booke.h +++ b/arch/powerpc/include/asm/reg_booke.h | |||
| @@ -246,6 +246,20 @@ | |||
| 246 | store or cache line push */ | 246 | store or cache line push */ |
| 247 | #endif | 247 | #endif |
| 248 | 248 | ||
| 249 | /* Bit definitions for the HID1 */ | ||
| 250 | #ifdef CONFIG_E500 | ||
| 251 | /* e500v1/v2 */ | ||
| 252 | #define HID1_PLL_CFG_MASK 0xfc000000 /* PLL_CFG input pins */ | ||
| 253 | #define HID1_RFXE 0x00020000 /* Read fault exception enable */ | ||
| 254 | #define HID1_R1DPE 0x00008000 /* R1 data bus parity enable */ | ||
| 255 | #define HID1_R2DPE 0x00004000 /* R2 data bus parity enable */ | ||
| 256 | #define HID1_ASTME 0x00002000 /* Address bus streaming mode enable */ | ||
| 257 | #define HID1_ABE 0x00001000 /* Address broadcast enable */ | ||
| 258 | #define HID1_MPXTT 0x00000400 /* MPX re-map transfer type */ | ||
| 259 | #define HID1_ATS 0x00000080 /* Atomic status */ | ||
| 260 | #define HID1_MID_MASK 0x0000000f /* MID input pins */ | ||
| 261 | #endif | ||
| 262 | |||
| 249 | /* Bit definitions for the DBSR. */ | 263 | /* Bit definitions for the DBSR. */ |
| 250 | /* | 264 | /* |
| 251 | * DBSR bits which have conflicting definitions on true Book E versus IBM 40x. | 265 | * DBSR bits which have conflicting definitions on true Book E versus IBM 40x. |
diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h index 0ab8d869e3d6..0c8b35d75232 100644 --- a/arch/powerpc/include/asm/spu.h +++ b/arch/powerpc/include/asm/spu.h | |||
| @@ -203,14 +203,6 @@ void spu_irq_setaffinity(struct spu *spu, int cpu); | |||
| 203 | void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa, | 203 | void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa, |
| 204 | void *code, int code_size); | 204 | void *code, int code_size); |
| 205 | 205 | ||
| 206 | #ifdef CONFIG_KEXEC | ||
| 207 | void crash_register_spus(struct list_head *list); | ||
| 208 | #else | ||
| 209 | static inline void crash_register_spus(struct list_head *list) | ||
| 210 | { | ||
| 211 | } | ||
| 212 | #endif | ||
| 213 | |||
| 214 | extern void spu_invalidate_slbs(struct spu *spu); | 206 | extern void spu_invalidate_slbs(struct spu *spu); |
| 215 | extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); | 207 | extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); |
| 216 | int spu_64k_pages_available(void); | 208 | int spu_64k_pages_available(void); |
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S index 894e64fa481e..5c518ad3445c 100644 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S | |||
| @@ -64,6 +64,12 @@ _GLOBAL(__setup_cpu_e500v2) | |||
| 64 | bl __e500_icache_setup | 64 | bl __e500_icache_setup |
| 65 | bl __e500_dcache_setup | 65 | bl __e500_dcache_setup |
| 66 | bl __setup_e500_ivors | 66 | bl __setup_e500_ivors |
| 67 | #ifdef CONFIG_RAPIDIO | ||
| 68 | /* Ensure that RFXE is set */ | ||
| 69 | mfspr r3,SPRN_HID1 | ||
| 70 | oris r3,r3,HID1_RFXE@h | ||
| 71 | mtspr SPRN_HID1,r3 | ||
| 72 | #endif | ||
| 67 | mtlr r4 | 73 | mtlr r4 |
| 68 | blr | 74 | blr |
| 69 | _GLOBAL(__setup_cpu_e500mc) | 75 | _GLOBAL(__setup_cpu_e500mc) |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index be5ab18b03b5..8d74a24c5502 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
| @@ -116,7 +116,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 116 | .pmc_type = PPC_PMC_IBM, | 116 | .pmc_type = PPC_PMC_IBM, |
| 117 | .oprofile_cpu_type = "ppc64/power3", | 117 | .oprofile_cpu_type = "ppc64/power3", |
| 118 | .oprofile_type = PPC_OPROFILE_RS64, | 118 | .oprofile_type = PPC_OPROFILE_RS64, |
| 119 | .machine_check = machine_check_generic, | ||
| 120 | .platform = "power3", | 119 | .platform = "power3", |
| 121 | }, | 120 | }, |
| 122 | { /* Power3+ */ | 121 | { /* Power3+ */ |
| @@ -132,7 +131,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 132 | .pmc_type = PPC_PMC_IBM, | 131 | .pmc_type = PPC_PMC_IBM, |
| 133 | .oprofile_cpu_type = "ppc64/power3", | 132 | .oprofile_cpu_type = "ppc64/power3", |
| 134 | .oprofile_type = PPC_OPROFILE_RS64, | 133 | .oprofile_type = PPC_OPROFILE_RS64, |
| 135 | .machine_check = machine_check_generic, | ||
| 136 | .platform = "power3", | 134 | .platform = "power3", |
| 137 | }, | 135 | }, |
| 138 | { /* Northstar */ | 136 | { /* Northstar */ |
| @@ -148,7 +146,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 148 | .pmc_type = PPC_PMC_IBM, | 146 | .pmc_type = PPC_PMC_IBM, |
| 149 | .oprofile_cpu_type = "ppc64/rs64", | 147 | .oprofile_cpu_type = "ppc64/rs64", |
| 150 | .oprofile_type = PPC_OPROFILE_RS64, | 148 | .oprofile_type = PPC_OPROFILE_RS64, |
| 151 | .machine_check = machine_check_generic, | ||
| 152 | .platform = "rs64", | 149 | .platform = "rs64", |
| 153 | }, | 150 | }, |
| 154 | { /* Pulsar */ | 151 | { /* Pulsar */ |
| @@ -164,7 +161,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 164 | .pmc_type = PPC_PMC_IBM, | 161 | .pmc_type = PPC_PMC_IBM, |
| 165 | .oprofile_cpu_type = "ppc64/rs64", | 162 | .oprofile_cpu_type = "ppc64/rs64", |
| 166 | .oprofile_type = PPC_OPROFILE_RS64, | 163 | .oprofile_type = PPC_OPROFILE_RS64, |
| 167 | .machine_check = machine_check_generic, | ||
| 168 | .platform = "rs64", | 164 | .platform = "rs64", |
| 169 | }, | 165 | }, |
| 170 | { /* I-star */ | 166 | { /* I-star */ |
| @@ -180,7 +176,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 180 | .pmc_type = PPC_PMC_IBM, | 176 | .pmc_type = PPC_PMC_IBM, |
| 181 | .oprofile_cpu_type = "ppc64/rs64", | 177 | .oprofile_cpu_type = "ppc64/rs64", |
| 182 | .oprofile_type = PPC_OPROFILE_RS64, | 178 | .oprofile_type = PPC_OPROFILE_RS64, |
| 183 | .machine_check = machine_check_generic, | ||
| 184 | .platform = "rs64", | 179 | .platform = "rs64", |
| 185 | }, | 180 | }, |
| 186 | { /* S-star */ | 181 | { /* S-star */ |
| @@ -196,7 +191,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 196 | .pmc_type = PPC_PMC_IBM, | 191 | .pmc_type = PPC_PMC_IBM, |
| 197 | .oprofile_cpu_type = "ppc64/rs64", | 192 | .oprofile_cpu_type = "ppc64/rs64", |
| 198 | .oprofile_type = PPC_OPROFILE_RS64, | 193 | .oprofile_type = PPC_OPROFILE_RS64, |
| 199 | .machine_check = machine_check_generic, | ||
| 200 | .platform = "rs64", | 194 | .platform = "rs64", |
| 201 | }, | 195 | }, |
| 202 | { /* Power4 */ | 196 | { /* Power4 */ |
| @@ -212,7 +206,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 212 | .pmc_type = PPC_PMC_IBM, | 206 | .pmc_type = PPC_PMC_IBM, |
| 213 | .oprofile_cpu_type = "ppc64/power4", | 207 | .oprofile_cpu_type = "ppc64/power4", |
| 214 | .oprofile_type = PPC_OPROFILE_POWER4, | 208 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 215 | .machine_check = machine_check_generic, | ||
| 216 | .platform = "power4", | 209 | .platform = "power4", |
| 217 | }, | 210 | }, |
| 218 | { /* Power4+ */ | 211 | { /* Power4+ */ |
| @@ -228,7 +221,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 228 | .pmc_type = PPC_PMC_IBM, | 221 | .pmc_type = PPC_PMC_IBM, |
| 229 | .oprofile_cpu_type = "ppc64/power4", | 222 | .oprofile_cpu_type = "ppc64/power4", |
| 230 | .oprofile_type = PPC_OPROFILE_POWER4, | 223 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 231 | .machine_check = machine_check_generic, | ||
| 232 | .platform = "power4", | 224 | .platform = "power4", |
| 233 | }, | 225 | }, |
| 234 | { /* PPC970 */ | 226 | { /* PPC970 */ |
| @@ -247,7 +239,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 247 | .cpu_restore = __restore_cpu_ppc970, | 239 | .cpu_restore = __restore_cpu_ppc970, |
| 248 | .oprofile_cpu_type = "ppc64/970", | 240 | .oprofile_cpu_type = "ppc64/970", |
| 249 | .oprofile_type = PPC_OPROFILE_POWER4, | 241 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 250 | .machine_check = machine_check_generic, | ||
| 251 | .platform = "ppc970", | 242 | .platform = "ppc970", |
| 252 | }, | 243 | }, |
| 253 | { /* PPC970FX */ | 244 | { /* PPC970FX */ |
| @@ -266,7 +257,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 266 | .cpu_restore = __restore_cpu_ppc970, | 257 | .cpu_restore = __restore_cpu_ppc970, |
| 267 | .oprofile_cpu_type = "ppc64/970", | 258 | .oprofile_cpu_type = "ppc64/970", |
| 268 | .oprofile_type = PPC_OPROFILE_POWER4, | 259 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 269 | .machine_check = machine_check_generic, | ||
| 270 | .platform = "ppc970", | 260 | .platform = "ppc970", |
| 271 | }, | 261 | }, |
| 272 | { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */ | 262 | { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */ |
| @@ -285,7 +275,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 285 | .cpu_restore = __restore_cpu_ppc970, | 275 | .cpu_restore = __restore_cpu_ppc970, |
| 286 | .oprofile_cpu_type = "ppc64/970MP", | 276 | .oprofile_cpu_type = "ppc64/970MP", |
| 287 | .oprofile_type = PPC_OPROFILE_POWER4, | 277 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 288 | .machine_check = machine_check_generic, | ||
| 289 | .platform = "ppc970", | 278 | .platform = "ppc970", |
| 290 | }, | 279 | }, |
| 291 | { /* PPC970MP */ | 280 | { /* PPC970MP */ |
| @@ -304,7 +293,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 304 | .cpu_restore = __restore_cpu_ppc970, | 293 | .cpu_restore = __restore_cpu_ppc970, |
| 305 | .oprofile_cpu_type = "ppc64/970MP", | 294 | .oprofile_cpu_type = "ppc64/970MP", |
| 306 | .oprofile_type = PPC_OPROFILE_POWER4, | 295 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 307 | .machine_check = machine_check_generic, | ||
| 308 | .platform = "ppc970", | 296 | .platform = "ppc970", |
| 309 | }, | 297 | }, |
| 310 | { /* PPC970GX */ | 298 | { /* PPC970GX */ |
| @@ -322,7 +310,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 322 | .cpu_setup = __setup_cpu_ppc970, | 310 | .cpu_setup = __setup_cpu_ppc970, |
| 323 | .oprofile_cpu_type = "ppc64/970", | 311 | .oprofile_cpu_type = "ppc64/970", |
| 324 | .oprofile_type = PPC_OPROFILE_POWER4, | 312 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 325 | .machine_check = machine_check_generic, | ||
| 326 | .platform = "ppc970", | 313 | .platform = "ppc970", |
| 327 | }, | 314 | }, |
| 328 | { /* Power5 GR */ | 315 | { /* Power5 GR */ |
| @@ -343,7 +330,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 343 | */ | 330 | */ |
| 344 | .oprofile_mmcra_sihv = MMCRA_SIHV, | 331 | .oprofile_mmcra_sihv = MMCRA_SIHV, |
| 345 | .oprofile_mmcra_sipr = MMCRA_SIPR, | 332 | .oprofile_mmcra_sipr = MMCRA_SIPR, |
| 346 | .machine_check = machine_check_generic, | ||
| 347 | .platform = "power5", | 333 | .platform = "power5", |
| 348 | }, | 334 | }, |
| 349 | { /* Power5++ */ | 335 | { /* Power5++ */ |
| @@ -360,7 +346,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 360 | .oprofile_type = PPC_OPROFILE_POWER4, | 346 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 361 | .oprofile_mmcra_sihv = MMCRA_SIHV, | 347 | .oprofile_mmcra_sihv = MMCRA_SIHV, |
| 362 | .oprofile_mmcra_sipr = MMCRA_SIPR, | 348 | .oprofile_mmcra_sipr = MMCRA_SIPR, |
| 363 | .machine_check = machine_check_generic, | ||
| 364 | .platform = "power5+", | 349 | .platform = "power5+", |
| 365 | }, | 350 | }, |
| 366 | { /* Power5 GS */ | 351 | { /* Power5 GS */ |
| @@ -378,7 +363,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 378 | .oprofile_type = PPC_OPROFILE_POWER4, | 363 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 379 | .oprofile_mmcra_sihv = MMCRA_SIHV, | 364 | .oprofile_mmcra_sihv = MMCRA_SIHV, |
| 380 | .oprofile_mmcra_sipr = MMCRA_SIPR, | 365 | .oprofile_mmcra_sipr = MMCRA_SIPR, |
| 381 | .machine_check = machine_check_generic, | ||
| 382 | .platform = "power5+", | 366 | .platform = "power5+", |
| 383 | }, | 367 | }, |
| 384 | { /* POWER6 in P5+ mode; 2.04-compliant processor */ | 368 | { /* POWER6 in P5+ mode; 2.04-compliant processor */ |
| @@ -390,7 +374,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 390 | .mmu_features = MMU_FTR_HPTE_TABLE, | 374 | .mmu_features = MMU_FTR_HPTE_TABLE, |
| 391 | .icache_bsize = 128, | 375 | .icache_bsize = 128, |
| 392 | .dcache_bsize = 128, | 376 | .dcache_bsize = 128, |
| 393 | .machine_check = machine_check_generic, | ||
| 394 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", | 377 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", |
| 395 | .oprofile_type = PPC_OPROFILE_POWER4, | 378 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 396 | .platform = "power5+", | 379 | .platform = "power5+", |
| @@ -413,7 +396,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 413 | .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR, | 396 | .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR, |
| 414 | .oprofile_mmcra_clear = POWER6_MMCRA_THRM | | 397 | .oprofile_mmcra_clear = POWER6_MMCRA_THRM | |
| 415 | POWER6_MMCRA_OTHER, | 398 | POWER6_MMCRA_OTHER, |
| 416 | .machine_check = machine_check_generic, | ||
| 417 | .platform = "power6x", | 399 | .platform = "power6x", |
| 418 | }, | 400 | }, |
| 419 | { /* 2.05-compliant processor, i.e. Power6 "architected" mode */ | 401 | { /* 2.05-compliant processor, i.e. Power6 "architected" mode */ |
| @@ -425,7 +407,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 425 | .mmu_features = MMU_FTR_HPTE_TABLE, | 407 | .mmu_features = MMU_FTR_HPTE_TABLE, |
| 426 | .icache_bsize = 128, | 408 | .icache_bsize = 128, |
| 427 | .dcache_bsize = 128, | 409 | .dcache_bsize = 128, |
| 428 | .machine_check = machine_check_generic, | ||
| 429 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", | 410 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", |
| 430 | .oprofile_type = PPC_OPROFILE_POWER4, | 411 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 431 | .platform = "power6", | 412 | .platform = "power6", |
| @@ -440,7 +421,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 440 | MMU_FTR_TLBIE_206, | 421 | MMU_FTR_TLBIE_206, |
| 441 | .icache_bsize = 128, | 422 | .icache_bsize = 128, |
| 442 | .dcache_bsize = 128, | 423 | .dcache_bsize = 128, |
| 443 | .machine_check = machine_check_generic, | ||
| 444 | .oprofile_type = PPC_OPROFILE_POWER4, | 424 | .oprofile_type = PPC_OPROFILE_POWER4, |
| 445 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", | 425 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", |
| 446 | .platform = "power7", | 426 | .platform = "power7", |
| @@ -492,7 +472,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 492 | .pmc_type = PPC_PMC_IBM, | 472 | .pmc_type = PPC_PMC_IBM, |
| 493 | .oprofile_cpu_type = "ppc64/cell-be", | 473 | .oprofile_cpu_type = "ppc64/cell-be", |
| 494 | .oprofile_type = PPC_OPROFILE_CELL, | 474 | .oprofile_type = PPC_OPROFILE_CELL, |
| 495 | .machine_check = machine_check_generic, | ||
| 496 | .platform = "ppc-cell-be", | 475 | .platform = "ppc-cell-be", |
| 497 | }, | 476 | }, |
| 498 | { /* PA Semi PA6T */ | 477 | { /* PA Semi PA6T */ |
| @@ -510,7 +489,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 510 | .cpu_restore = __restore_cpu_pa6t, | 489 | .cpu_restore = __restore_cpu_pa6t, |
| 511 | .oprofile_cpu_type = "ppc64/pa6t", | 490 | .oprofile_cpu_type = "ppc64/pa6t", |
| 512 | .oprofile_type = PPC_OPROFILE_PA6T, | 491 | .oprofile_type = PPC_OPROFILE_PA6T, |
| 513 | .machine_check = machine_check_generic, | ||
| 514 | .platform = "pa6t", | 492 | .platform = "pa6t", |
| 515 | }, | 493 | }, |
| 516 | { /* default match */ | 494 | { /* default match */ |
| @@ -524,7 +502,6 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 524 | .dcache_bsize = 128, | 502 | .dcache_bsize = 128, |
| 525 | .num_pmcs = 6, | 503 | .num_pmcs = 6, |
| 526 | .pmc_type = PPC_PMC_IBM, | 504 | .pmc_type = PPC_PMC_IBM, |
| 527 | .machine_check = machine_check_generic, | ||
| 528 | .platform = "power4", | 505 | .platform = "power4", |
| 529 | } | 506 | } |
| 530 | #endif /* CONFIG_PPC_BOOK3S_64 */ | 507 | #endif /* CONFIG_PPC_BOOK3S_64 */ |
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 832c8c4db254..3d569e2aff18 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c | |||
| @@ -48,7 +48,7 @@ int crashing_cpu = -1; | |||
| 48 | static cpumask_t cpus_in_crash = CPU_MASK_NONE; | 48 | static cpumask_t cpus_in_crash = CPU_MASK_NONE; |
| 49 | cpumask_t cpus_in_sr = CPU_MASK_NONE; | 49 | cpumask_t cpus_in_sr = CPU_MASK_NONE; |
| 50 | 50 | ||
| 51 | #define CRASH_HANDLER_MAX 2 | 51 | #define CRASH_HANDLER_MAX 3 |
| 52 | /* NULL terminated list of shutdown handles */ | 52 | /* NULL terminated list of shutdown handles */ |
| 53 | static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1]; | 53 | static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1]; |
| 54 | static DEFINE_SPINLOCK(crash_handlers_lock); | 54 | static DEFINE_SPINLOCK(crash_handlers_lock); |
| @@ -125,7 +125,7 @@ static void crash_kexec_prepare_cpus(int cpu) | |||
| 125 | smp_wmb(); | 125 | smp_wmb(); |
| 126 | 126 | ||
| 127 | /* | 127 | /* |
| 128 | * FIXME: Until we will have the way to stop other CPUSs reliabally, | 128 | * FIXME: Until we will have the way to stop other CPUs reliably, |
| 129 | * the crash CPU will send an IPI and wait for other CPUs to | 129 | * the crash CPU will send an IPI and wait for other CPUs to |
| 130 | * respond. | 130 | * respond. |
| 131 | * Delay of at least 10 seconds. | 131 | * Delay of at least 10 seconds. |
| @@ -254,72 +254,6 @@ void crash_kexec_secondary(struct pt_regs *regs) | |||
| 254 | cpus_in_sr = CPU_MASK_NONE; | 254 | cpus_in_sr = CPU_MASK_NONE; |
| 255 | } | 255 | } |
| 256 | #endif | 256 | #endif |
| 257 | #ifdef CONFIG_SPU_BASE | ||
| 258 | |||
| 259 | #include <asm/spu.h> | ||
| 260 | #include <asm/spu_priv1.h> | ||
| 261 | |||
| 262 | struct crash_spu_info { | ||
| 263 | struct spu *spu; | ||
| 264 | u32 saved_spu_runcntl_RW; | ||
| 265 | u32 saved_spu_status_R; | ||
| 266 | u32 saved_spu_npc_RW; | ||
| 267 | u64 saved_mfc_sr1_RW; | ||
| 268 | u64 saved_mfc_dar; | ||
| 269 | u64 saved_mfc_dsisr; | ||
| 270 | }; | ||
| 271 | |||
| 272 | #define CRASH_NUM_SPUS 16 /* Enough for current hardware */ | ||
| 273 | static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS]; | ||
| 274 | |||
| 275 | static void crash_kexec_stop_spus(void) | ||
| 276 | { | ||
| 277 | struct spu *spu; | ||
| 278 | int i; | ||
| 279 | u64 tmp; | ||
| 280 | |||
| 281 | for (i = 0; i < CRASH_NUM_SPUS; i++) { | ||
| 282 | if (!crash_spu_info[i].spu) | ||
| 283 | continue; | ||
| 284 | |||
| 285 | spu = crash_spu_info[i].spu; | ||
| 286 | |||
| 287 | crash_spu_info[i].saved_spu_runcntl_RW = | ||
| 288 | in_be32(&spu->problem->spu_runcntl_RW); | ||
| 289 | crash_spu_info[i].saved_spu_status_R = | ||
| 290 | in_be32(&spu->problem->spu_status_R); | ||
| 291 | crash_spu_info[i].saved_spu_npc_RW = | ||
| 292 | in_be32(&spu->problem->spu_npc_RW); | ||
| 293 | |||
| 294 | crash_spu_info[i].saved_mfc_dar = spu_mfc_dar_get(spu); | ||
| 295 | crash_spu_info[i].saved_mfc_dsisr = spu_mfc_dsisr_get(spu); | ||
| 296 | tmp = spu_mfc_sr1_get(spu); | ||
| 297 | crash_spu_info[i].saved_mfc_sr1_RW = tmp; | ||
| 298 | |||
| 299 | tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK; | ||
| 300 | spu_mfc_sr1_set(spu, tmp); | ||
| 301 | |||
| 302 | __delay(200); | ||
| 303 | } | ||
| 304 | } | ||
| 305 | |||
| 306 | void crash_register_spus(struct list_head *list) | ||
| 307 | { | ||
| 308 | struct spu *spu; | ||
| 309 | |||
| 310 | list_for_each_entry(spu, list, full_list) { | ||
| 311 | if (WARN_ON(spu->number >= CRASH_NUM_SPUS)) | ||
| 312 | continue; | ||
| 313 | |||
| 314 | crash_spu_info[spu->number].spu = spu; | ||
| 315 | } | ||
| 316 | } | ||
| 317 | |||
| 318 | #else | ||
| 319 | static inline void crash_kexec_stop_spus(void) | ||
| 320 | { | ||
| 321 | } | ||
| 322 | #endif /* CONFIG_SPU_BASE */ | ||
| 323 | 257 | ||
| 324 | /* | 258 | /* |
| 325 | * Register a function to be called on shutdown. Only use this if you | 259 | * Register a function to be called on shutdown. Only use this if you |
| @@ -439,8 +373,6 @@ void default_machine_crash_shutdown(struct pt_regs *regs) | |||
| 439 | crash_shutdown_cpu = -1; | 373 | crash_shutdown_cpu = -1; |
| 440 | __debugger_fault_handler = old_handler; | 374 | __debugger_fault_handler = old_handler; |
| 441 | 375 | ||
| 442 | crash_kexec_stop_spus(); | ||
| 443 | |||
| 444 | if (ppc_md.kexec_cpu_down) | 376 | if (ppc_md.kexec_cpu_down) |
| 445 | ppc_md.kexec_cpu_down(1, 0); | 377 | ppc_md.kexec_cpu_down(1, 0); |
| 446 | } | 378 | } |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index c22dc1ec1c94..56212bc0ab08 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
| @@ -880,7 +880,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) | |||
| 880 | */ | 880 | */ |
| 881 | andi. r10,r9,MSR_EE | 881 | andi. r10,r9,MSR_EE |
| 882 | beq 1f | 882 | beq 1f |
| 883 | /* | ||
| 884 | * Since the ftrace irqsoff latency trace checks CALLER_ADDR1, | ||
| 885 | * which is the stack frame here, we need to force a stack frame | ||
| 886 | * in case we came from user space. | ||
| 887 | */ | ||
| 888 | stwu r1,-32(r1) | ||
| 889 | mflr r0 | ||
| 890 | stw r0,4(r1) | ||
| 891 | stwu r1,-32(r1) | ||
| 883 | bl trace_hardirqs_on | 892 | bl trace_hardirqs_on |
| 893 | lwz r1,0(r1) | ||
| 894 | lwz r1,0(r1) | ||
| 884 | lwz r9,_MSR(r1) | 895 | lwz r9,_MSR(r1) |
| 885 | 1: | 896 | 1: |
| 886 | #endif /* CONFIG_TRACE_IRQFLAGS */ | 897 | #endif /* CONFIG_TRACE_IRQFLAGS */ |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index df7e20c191cd..49a170af8145 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/memblock.h> | 15 | #include <linux/memblock.h> |
| 16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
| 17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
| 18 | #include <linux/ftrace.h> | ||
| 18 | 19 | ||
| 19 | #include <asm/machdep.h> | 20 | #include <asm/machdep.h> |
| 20 | #include <asm/prom.h> | 21 | #include <asm/prom.h> |
| @@ -44,10 +45,7 @@ void machine_kexec_mask_interrupts(void) { | |||
| 44 | 45 | ||
| 45 | void machine_crash_shutdown(struct pt_regs *regs) | 46 | void machine_crash_shutdown(struct pt_regs *regs) |
| 46 | { | 47 | { |
| 47 | if (ppc_md.machine_crash_shutdown) | 48 | default_machine_crash_shutdown(regs); |
| 48 | ppc_md.machine_crash_shutdown(regs); | ||
| 49 | else | ||
| 50 | default_machine_crash_shutdown(regs); | ||
| 51 | } | 49 | } |
| 52 | 50 | ||
| 53 | /* | 51 | /* |
| @@ -65,8 +63,6 @@ int machine_kexec_prepare(struct kimage *image) | |||
| 65 | 63 | ||
| 66 | void machine_kexec_cleanup(struct kimage *image) | 64 | void machine_kexec_cleanup(struct kimage *image) |
| 67 | { | 65 | { |
| 68 | if (ppc_md.machine_kexec_cleanup) | ||
| 69 | ppc_md.machine_kexec_cleanup(image); | ||
| 70 | } | 66 | } |
| 71 | 67 | ||
| 72 | void arch_crash_save_vmcoreinfo(void) | 68 | void arch_crash_save_vmcoreinfo(void) |
| @@ -87,10 +83,13 @@ void arch_crash_save_vmcoreinfo(void) | |||
| 87 | */ | 83 | */ |
| 88 | void machine_kexec(struct kimage *image) | 84 | void machine_kexec(struct kimage *image) |
| 89 | { | 85 | { |
| 90 | if (ppc_md.machine_kexec) | 86 | int save_ftrace_enabled; |
| 91 | ppc_md.machine_kexec(image); | 87 | |
| 92 | else | 88 | save_ftrace_enabled = __ftrace_enabled_save(); |
| 93 | default_machine_kexec(image); | 89 | |
| 90 | default_machine_kexec(image); | ||
| 91 | |||
| 92 | __ftrace_enabled_restore(save_ftrace_enabled); | ||
| 94 | 93 | ||
| 95 | /* Fall back to normal restart if we're still alive. */ | 94 | /* Fall back to normal restart if we're still alive. */ |
| 96 | machine_restart(NULL); | 95 | machine_restart(NULL); |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 84906d3fc860..7a1d5cb76932 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
| @@ -631,7 +631,7 @@ void show_regs(struct pt_regs * regs) | |||
| 631 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS | 631 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS |
| 632 | printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); | 632 | printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr); |
| 633 | #else | 633 | #else |
| 634 | printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr); | 634 | printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr); |
| 635 | #endif | 635 | #endif |
| 636 | printk("TASK = %p[%d] '%s' THREAD: %p", | 636 | printk("TASK = %p[%d] '%s' THREAD: %p", |
| 637 | current, task_pid_nr(current), current->comm, task_thread_info(current)); | 637 | current, task_pid_nr(current), current->comm, task_thread_info(current)); |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 2b442e6c21e6..bf5f5ce3a7bd 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
| @@ -256,31 +256,16 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf, | |||
| 256 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 256 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); |
| 257 | struct rtas_update_flash_t *uf; | 257 | struct rtas_update_flash_t *uf; |
| 258 | char msg[RTAS_MSG_MAXLEN]; | 258 | char msg[RTAS_MSG_MAXLEN]; |
| 259 | int msglen; | ||
| 260 | 259 | ||
| 261 | uf = (struct rtas_update_flash_t *) dp->data; | 260 | uf = dp->data; |
| 262 | 261 | ||
| 263 | if (!strcmp(dp->name, FIRMWARE_FLASH_NAME)) { | 262 | if (!strcmp(dp->name, FIRMWARE_FLASH_NAME)) { |
| 264 | get_flash_status_msg(uf->status, msg); | 263 | get_flash_status_msg(uf->status, msg); |
| 265 | } else { /* FIRMWARE_UPDATE_NAME */ | 264 | } else { /* FIRMWARE_UPDATE_NAME */ |
| 266 | sprintf(msg, "%d\n", uf->status); | 265 | sprintf(msg, "%d\n", uf->status); |
| 267 | } | 266 | } |
| 268 | msglen = strlen(msg); | ||
| 269 | if (msglen > count) | ||
| 270 | msglen = count; | ||
| 271 | |||
| 272 | if (ppos && *ppos != 0) | ||
| 273 | return 0; /* be cheap */ | ||
| 274 | |||
| 275 | if (!access_ok(VERIFY_WRITE, buf, msglen)) | ||
| 276 | return -EINVAL; | ||
| 277 | 267 | ||
| 278 | if (copy_to_user(buf, msg, msglen)) | 268 | return simple_read_from_buffer(buf, count, ppos, msg, strlen(msg)); |
| 279 | return -EFAULT; | ||
| 280 | |||
| 281 | if (ppos) | ||
| 282 | *ppos = msglen; | ||
| 283 | return msglen; | ||
| 284 | } | 269 | } |
| 285 | 270 | ||
| 286 | /* constructor for flash_block_cache */ | 271 | /* constructor for flash_block_cache */ |
| @@ -394,26 +379,13 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf, | |||
| 394 | char msg[RTAS_MSG_MAXLEN]; | 379 | char msg[RTAS_MSG_MAXLEN]; |
| 395 | int msglen; | 380 | int msglen; |
| 396 | 381 | ||
| 397 | args_buf = (struct rtas_manage_flash_t *) dp->data; | 382 | args_buf = dp->data; |
| 398 | if (args_buf == NULL) | 383 | if (args_buf == NULL) |
| 399 | return 0; | 384 | return 0; |
| 400 | 385 | ||
| 401 | msglen = sprintf(msg, "%d\n", args_buf->status); | 386 | msglen = sprintf(msg, "%d\n", args_buf->status); |
| 402 | if (msglen > count) | ||
| 403 | msglen = count; | ||
| 404 | 387 | ||
| 405 | if (ppos && *ppos != 0) | 388 | return simple_read_from_buffer(buf, count, ppos, msg, msglen); |
| 406 | return 0; /* be cheap */ | ||
| 407 | |||
| 408 | if (!access_ok(VERIFY_WRITE, buf, msglen)) | ||
| 409 | return -EINVAL; | ||
| 410 | |||
| 411 | if (copy_to_user(buf, msg, msglen)) | ||
| 412 | return -EFAULT; | ||
| 413 | |||
| 414 | if (ppos) | ||
| 415 | *ppos = msglen; | ||
| 416 | return msglen; | ||
| 417 | } | 389 | } |
| 418 | 390 | ||
| 419 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, | 391 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, |
| @@ -495,24 +467,11 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf, | |||
| 495 | char msg[RTAS_MSG_MAXLEN]; | 467 | char msg[RTAS_MSG_MAXLEN]; |
| 496 | int msglen; | 468 | int msglen; |
| 497 | 469 | ||
| 498 | args_buf = (struct rtas_validate_flash_t *) dp->data; | 470 | args_buf = dp->data; |
| 499 | 471 | ||
| 500 | if (ppos && *ppos != 0) | ||
| 501 | return 0; /* be cheap */ | ||
| 502 | |||
| 503 | msglen = get_validate_flash_msg(args_buf, msg); | 472 | msglen = get_validate_flash_msg(args_buf, msg); |
| 504 | if (msglen > count) | ||
| 505 | msglen = count; | ||
| 506 | |||
| 507 | if (!access_ok(VERIFY_WRITE, buf, msglen)) | ||
| 508 | return -EINVAL; | ||
| 509 | |||
| 510 | if (copy_to_user(buf, msg, msglen)) | ||
| 511 | return -EFAULT; | ||
| 512 | 473 | ||
| 513 | if (ppos) | 474 | return simple_read_from_buffer(buf, count, ppos, msg, msglen); |
| 514 | *ppos = msglen; | ||
| 515 | return msglen; | ||
| 516 | } | 475 | } |
| 517 | 476 | ||
| 518 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, | 477 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, |
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c index 0438f819fe6b..049dbecb5dbc 100644 --- a/arch/powerpc/kernel/rtasd.c +++ b/arch/powerpc/kernel/rtasd.c | |||
| @@ -160,7 +160,7 @@ static int log_rtas_len(char * buf) | |||
| 160 | /* rtas fixed header */ | 160 | /* rtas fixed header */ |
| 161 | len = 8; | 161 | len = 8; |
| 162 | err = (struct rtas_error_log *)buf; | 162 | err = (struct rtas_error_log *)buf; |
| 163 | if (err->extended_log_length) { | 163 | if (err->extended && err->extended_log_length) { |
| 164 | 164 | ||
| 165 | /* extended header */ | 165 | /* extended header */ |
| 166 | len += err->extended_log_length; | 166 | len += err->extended_log_length; |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 09e4dea4a85a..09d31dbf43f9 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
| @@ -265,11 +265,26 @@ void accumulate_stolen_time(void) | |||
| 265 | { | 265 | { |
| 266 | u64 sst, ust; | 266 | u64 sst, ust; |
| 267 | 267 | ||
| 268 | sst = scan_dispatch_log(get_paca()->starttime_user); | 268 | u8 save_soft_enabled = local_paca->soft_enabled; |
| 269 | ust = scan_dispatch_log(get_paca()->starttime); | 269 | u8 save_hard_enabled = local_paca->hard_enabled; |
| 270 | get_paca()->system_time -= sst; | 270 | |
| 271 | get_paca()->user_time -= ust; | 271 | /* We are called early in the exception entry, before |
| 272 | get_paca()->stolen_time += ust + sst; | 272 | * soft/hard_enabled are sync'ed to the expected state |
| 273 | * for the exception. We are hard disabled but the PACA | ||
| 274 | * needs to reflect that so various debug stuff doesn't | ||
| 275 | * complain | ||
| 276 | */ | ||
| 277 | local_paca->soft_enabled = 0; | ||
| 278 | local_paca->hard_enabled = 0; | ||
| 279 | |||
| 280 | sst = scan_dispatch_log(local_paca->starttime_user); | ||
| 281 | ust = scan_dispatch_log(local_paca->starttime); | ||
| 282 | local_paca->system_time -= sst; | ||
| 283 | local_paca->user_time -= ust; | ||
| 284 | local_paca->stolen_time += ust + sst; | ||
| 285 | |||
| 286 | local_paca->soft_enabled = save_soft_enabled; | ||
| 287 | local_paca->hard_enabled = save_hard_enabled; | ||
| 273 | } | 288 | } |
| 274 | 289 | ||
| 275 | static inline u64 calculate_stolen_time(u64 stop_tb) | 290 | static inline u64 calculate_stolen_time(u64 stop_tb) |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 1b2cdc8eec90..bd74fac169be 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
| @@ -626,12 +626,6 @@ void machine_check_exception(struct pt_regs *regs) | |||
| 626 | if (recover > 0) | 626 | if (recover > 0) |
| 627 | return; | 627 | return; |
| 628 | 628 | ||
| 629 | if (user_mode(regs)) { | ||
| 630 | regs->msr |= MSR_RI; | ||
| 631 | _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); | ||
| 632 | return; | ||
| 633 | } | ||
| 634 | |||
| 635 | #if defined(CONFIG_8xx) && defined(CONFIG_PCI) | 629 | #if defined(CONFIG_8xx) && defined(CONFIG_PCI) |
| 636 | /* the qspan pci read routines can cause machine checks -- Cort | 630 | /* the qspan pci read routines can cause machine checks -- Cort |
| 637 | * | 631 | * |
| @@ -643,16 +637,12 @@ void machine_check_exception(struct pt_regs *regs) | |||
| 643 | return; | 637 | return; |
| 644 | #endif | 638 | #endif |
| 645 | 639 | ||
| 646 | if (debugger_fault_handler(regs)) { | 640 | if (debugger_fault_handler(regs)) |
| 647 | regs->msr |= MSR_RI; | ||
| 648 | return; | 641 | return; |
| 649 | } | ||
| 650 | 642 | ||
| 651 | if (check_io_access(regs)) | 643 | if (check_io_access(regs)) |
| 652 | return; | 644 | return; |
| 653 | 645 | ||
| 654 | if (debugger_fault_handler(regs)) | ||
| 655 | return; | ||
| 656 | die("Machine check", regs, SIGBUS); | 646 | die("Machine check", regs, SIGBUS); |
| 657 | 647 | ||
| 658 | /* Must die if the interrupt is not recoverable */ | 648 | /* Must die if the interrupt is not recoverable */ |
diff --git a/arch/powerpc/lib/feature-fixups-test.S b/arch/powerpc/lib/feature-fixups-test.S index cb737484c5aa..f4613118132e 100644 --- a/arch/powerpc/lib/feature-fixups-test.S +++ b/arch/powerpc/lib/feature-fixups-test.S | |||
| @@ -172,6 +172,25 @@ globl(ftr_fixup_test6_expected) | |||
| 172 | 3: or 3,3,3 | 172 | 3: or 3,3,3 |
| 173 | 173 | ||
| 174 | 174 | ||
| 175 | #if 0 | ||
| 176 | /* Test that if we have a larger else case the assembler spots it and | ||
| 177 | * reports an error. #if 0'ed so as not to break the build normally. | ||
| 178 | */ | ||
| 179 | ftr_fixup_test7: | ||
| 180 | or 1,1,1 | ||
| 181 | BEGIN_FTR_SECTION | ||
| 182 | or 2,2,2 | ||
| 183 | or 2,2,2 | ||
| 184 | or 2,2,2 | ||
| 185 | FTR_SECTION_ELSE | ||
| 186 | or 3,3,3 | ||
| 187 | or 3,3,3 | ||
| 188 | or 3,3,3 | ||
| 189 | or 3,3,3 | ||
| 190 | ALT_FTR_SECTION_END(0, 1) | ||
| 191 | or 1,1,1 | ||
| 192 | #endif | ||
| 193 | |||
| 175 | #define MAKE_MACRO_TEST(TYPE) \ | 194 | #define MAKE_MACRO_TEST(TYPE) \ |
| 176 | globl(ftr_fixup_test_ ##TYPE##_macros) \ | 195 | globl(ftr_fixup_test_ ##TYPE##_macros) \ |
| 177 | or 1,1,1; \ | 196 | or 1,1,1; \ |
diff --git a/arch/powerpc/platforms/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c index 661d354e4ff2..d0c4e15b7794 100644 --- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c | |||
| @@ -57,12 +57,12 @@ static void __init mpc830x_rdb_init_IRQ(void) | |||
| 57 | ipic_set_default_priority(); | 57 | ipic_set_default_priority(); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | struct const char *board[] __initdata = { | 60 | static const char *board[] __initdata = { |
| 61 | "MPC8308RDB", | 61 | "MPC8308RDB", |
| 62 | "fsl,mpc8308rdb", | 62 | "fsl,mpc8308rdb", |
| 63 | "denx,mpc8308_p1m", | 63 | "denx,mpc8308_p1m", |
| 64 | NULL | 64 | NULL |
| 65 | } | 65 | }; |
| 66 | 66 | ||
| 67 | /* | 67 | /* |
| 68 | * Called very early, MMU is off, device-tree isn't unflattened | 68 | * Called very early, MMU is off, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c index b54cd736a895..f859ead49a8d 100644 --- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c | |||
| @@ -60,11 +60,11 @@ static void __init mpc831x_rdb_init_IRQ(void) | |||
| 60 | ipic_set_default_priority(); | 60 | ipic_set_default_priority(); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | struct const char *board[] __initdata = { | 63 | static const char *board[] __initdata = { |
| 64 | "MPC8313ERDB", | 64 | "MPC8313ERDB", |
| 65 | "fsl,mpc8315erdb", | 65 | "fsl,mpc8315erdb", |
| 66 | NULL | 66 | NULL |
| 67 | } | 67 | }; |
| 68 | 68 | ||
| 69 | /* | 69 | /* |
| 70 | * Called very early, MMU is off, device-tree isn't unflattened | 70 | * Called very early, MMU is off, device-tree isn't unflattened |
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h index 0fea8811d45b..82a434510d83 100644 --- a/arch/powerpc/platforms/83xx/mpc83xx.h +++ b/arch/powerpc/platforms/83xx/mpc83xx.h | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | /* system i/o configuration register high */ | 36 | /* system i/o configuration register high */ |
| 37 | #define MPC83XX_SICRH_OFFS 0x118 | 37 | #define MPC83XX_SICRH_OFFS 0x118 |
| 38 | #define MPC8308_SICRH_USB_MASK 0x000c0000 | ||
| 39 | #define MPC8308_SICRH_USB_ULPI 0x00040000 | ||
| 38 | #define MPC834X_SICRH_USB_UTMI 0x00020000 | 40 | #define MPC834X_SICRH_USB_UTMI 0x00020000 |
| 39 | #define MPC831X_SICRH_USB_MASK 0x000000e0 | 41 | #define MPC831X_SICRH_USB_MASK 0x000000e0 |
| 40 | #define MPC831X_SICRH_USB_ULPI 0x000000a0 | 42 | #define MPC831X_SICRH_USB_ULPI 0x000000a0 |
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c index 3ba4bb7d41bb..2c64164722d0 100644 --- a/arch/powerpc/platforms/83xx/usb.c +++ b/arch/powerpc/platforms/83xx/usb.c | |||
| @@ -127,7 +127,8 @@ int mpc831x_usb_cfg(void) | |||
| 127 | 127 | ||
| 128 | /* Configure clock */ | 128 | /* Configure clock */ |
| 129 | immr_node = of_get_parent(np); | 129 | immr_node = of_get_parent(np); |
| 130 | if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) | 130 | if (immr_node && (of_device_is_compatible(immr_node, "fsl,mpc8315-immr") || |
| 131 | of_device_is_compatible(immr_node, "fsl,mpc8308-immr"))) | ||
| 131 | clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, | 132 | clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, |
| 132 | MPC8315_SCCR_USB_MASK, | 133 | MPC8315_SCCR_USB_MASK, |
| 133 | MPC8315_SCCR_USB_DRCM_01); | 134 | MPC8315_SCCR_USB_DRCM_01); |
| @@ -138,7 +139,11 @@ int mpc831x_usb_cfg(void) | |||
| 138 | 139 | ||
| 139 | /* Configure pin mux for ULPI. There is no pin mux for UTMI */ | 140 | /* Configure pin mux for ULPI. There is no pin mux for UTMI */ |
| 140 | if (prop && !strcmp(prop, "ulpi")) { | 141 | if (prop && !strcmp(prop, "ulpi")) { |
| 141 | if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) { | 142 | if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) { |
| 143 | clrsetbits_be32(immap + MPC83XX_SICRH_OFFS, | ||
| 144 | MPC8308_SICRH_USB_MASK, | ||
| 145 | MPC8308_SICRH_USB_ULPI); | ||
| 146 | } else if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) { | ||
| 142 | clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, | 147 | clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, |
| 143 | MPC8315_SICRL_USB_MASK, | 148 | MPC8315_SICRL_USB_MASK, |
| 144 | MPC8315_SICRL_USB_ULPI); | 149 | MPC8315_SICRL_USB_ULPI); |
| @@ -173,6 +178,9 @@ int mpc831x_usb_cfg(void) | |||
| 173 | !strcmp(prop, "utmi"))) { | 178 | !strcmp(prop, "utmi"))) { |
| 174 | u32 refsel; | 179 | u32 refsel; |
| 175 | 180 | ||
| 181 | if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) | ||
| 182 | goto out; | ||
| 183 | |||
| 176 | if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) | 184 | if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) |
| 177 | refsel = CONTROL_REFSEL_24MHZ; | 185 | refsel = CONTROL_REFSEL_24MHZ; |
| 178 | else | 186 | else |
| @@ -186,9 +194,11 @@ int mpc831x_usb_cfg(void) | |||
| 186 | temp = CONTROL_PHY_CLK_SEL_ULPI; | 194 | temp = CONTROL_PHY_CLK_SEL_ULPI; |
| 187 | #ifdef CONFIG_USB_OTG | 195 | #ifdef CONFIG_USB_OTG |
| 188 | /* Set OTG_PORT */ | 196 | /* Set OTG_PORT */ |
| 189 | dr_mode = of_get_property(np, "dr_mode", NULL); | 197 | if (!of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) { |
| 190 | if (dr_mode && !strcmp(dr_mode, "otg")) | 198 | dr_mode = of_get_property(np, "dr_mode", NULL); |
| 191 | temp |= CONTROL_OTG_PORT; | 199 | if (dr_mode && !strcmp(dr_mode, "otg")) |
| 200 | temp |= CONTROL_OTG_PORT; | ||
| 201 | } | ||
| 192 | #endif /* CONFIG_USB_OTG */ | 202 | #endif /* CONFIG_USB_OTG */ |
| 193 | out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp); | 203 | out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp); |
| 194 | } else { | 204 | } else { |
| @@ -196,6 +206,7 @@ int mpc831x_usb_cfg(void) | |||
| 196 | ret = -EINVAL; | 206 | ret = -EINVAL; |
| 197 | } | 207 | } |
| 198 | 208 | ||
| 209 | out: | ||
| 199 | iounmap(usb_regs); | 210 | iounmap(usb_regs); |
| 200 | of_node_put(np); | 211 | of_node_put(np); |
| 201 | return ret; | 212 | return ret; |
diff --git a/arch/powerpc/platforms/cell/cpufreq_spudemand.c b/arch/powerpc/platforms/cell/cpufreq_spudemand.c index 968c1c0b4d5b..d809836bcf5f 100644 --- a/arch/powerpc/platforms/cell/cpufreq_spudemand.c +++ b/arch/powerpc/platforms/cell/cpufreq_spudemand.c | |||
| @@ -39,8 +39,6 @@ struct spu_gov_info_struct { | |||
| 39 | }; | 39 | }; |
| 40 | static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info); | 40 | static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info); |
| 41 | 41 | ||
| 42 | static struct workqueue_struct *kspugov_wq; | ||
| 43 | |||
| 44 | static int calc_freq(struct spu_gov_info_struct *info) | 42 | static int calc_freq(struct spu_gov_info_struct *info) |
| 45 | { | 43 | { |
| 46 | int cpu; | 44 | int cpu; |
| @@ -71,14 +69,14 @@ static void spu_gov_work(struct work_struct *work) | |||
| 71 | __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H); | 69 | __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H); |
| 72 | 70 | ||
| 73 | delay = usecs_to_jiffies(info->poll_int); | 71 | delay = usecs_to_jiffies(info->poll_int); |
| 74 | queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay); | 72 | schedule_delayed_work_on(info->policy->cpu, &info->work, delay); |
| 75 | } | 73 | } |
| 76 | 74 | ||
| 77 | static void spu_gov_init_work(struct spu_gov_info_struct *info) | 75 | static void spu_gov_init_work(struct spu_gov_info_struct *info) |
| 78 | { | 76 | { |
| 79 | int delay = usecs_to_jiffies(info->poll_int); | 77 | int delay = usecs_to_jiffies(info->poll_int); |
| 80 | INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work); | 78 | INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work); |
| 81 | queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay); | 79 | schedule_delayed_work_on(info->policy->cpu, &info->work, delay); |
| 82 | } | 80 | } |
| 83 | 81 | ||
| 84 | static void spu_gov_cancel_work(struct spu_gov_info_struct *info) | 82 | static void spu_gov_cancel_work(struct spu_gov_info_struct *info) |
| @@ -152,27 +150,15 @@ static int __init spu_gov_init(void) | |||
| 152 | { | 150 | { |
| 153 | int ret; | 151 | int ret; |
| 154 | 152 | ||
| 155 | kspugov_wq = create_workqueue("kspugov"); | ||
| 156 | if (!kspugov_wq) { | ||
| 157 | printk(KERN_ERR "creation of kspugov failed\n"); | ||
| 158 | ret = -EFAULT; | ||
| 159 | goto out; | ||
| 160 | } | ||
| 161 | |||
| 162 | ret = cpufreq_register_governor(&spu_governor); | 153 | ret = cpufreq_register_governor(&spu_governor); |
| 163 | if (ret) { | 154 | if (ret) |
| 164 | printk(KERN_ERR "registration of governor failed\n"); | 155 | printk(KERN_ERR "registration of governor failed\n"); |
| 165 | destroy_workqueue(kspugov_wq); | ||
| 166 | goto out; | ||
| 167 | } | ||
| 168 | out: | ||
| 169 | return ret; | 156 | return ret; |
| 170 | } | 157 | } |
| 171 | 158 | ||
| 172 | static void __exit spu_gov_exit(void) | 159 | static void __exit spu_gov_exit(void) |
| 173 | { | 160 | { |
| 174 | cpufreq_unregister_governor(&spu_governor); | 161 | cpufreq_unregister_governor(&spu_governor); |
| 175 | destroy_workqueue(kspugov_wq); | ||
| 176 | } | 162 | } |
| 177 | 163 | ||
| 178 | 164 | ||
diff --git a/arch/powerpc/platforms/cell/qpace_setup.c b/arch/powerpc/platforms/cell/qpace_setup.c index 1b5749042756..d31c594cfdf3 100644 --- a/arch/powerpc/platforms/cell/qpace_setup.c +++ b/arch/powerpc/platforms/cell/qpace_setup.c | |||
| @@ -145,9 +145,4 @@ define_machine(qpace) { | |||
| 145 | .calibrate_decr = generic_calibrate_decr, | 145 | .calibrate_decr = generic_calibrate_decr, |
| 146 | .progress = qpace_progress, | 146 | .progress = qpace_progress, |
| 147 | .init_IRQ = iic_init_IRQ, | 147 | .init_IRQ = iic_init_IRQ, |
| 148 | #ifdef CONFIG_KEXEC | ||
| 149 | .machine_kexec = default_machine_kexec, | ||
| 150 | .machine_kexec_prepare = default_machine_kexec_prepare, | ||
| 151 | .machine_crash_shutdown = default_machine_crash_shutdown, | ||
| 152 | #endif | ||
| 153 | }; | 148 | }; |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 8547e86bfb42..acfaccea5f4f 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <asm/spu_csa.h> | 37 | #include <asm/spu_csa.h> |
| 38 | #include <asm/xmon.h> | 38 | #include <asm/xmon.h> |
| 39 | #include <asm/prom.h> | 39 | #include <asm/prom.h> |
| 40 | #include <asm/kexec.h> | ||
| 40 | 41 | ||
| 41 | const struct spu_management_ops *spu_management_ops; | 42 | const struct spu_management_ops *spu_management_ops; |
| 42 | EXPORT_SYMBOL_GPL(spu_management_ops); | 43 | EXPORT_SYMBOL_GPL(spu_management_ops); |
| @@ -727,6 +728,75 @@ static ssize_t spu_stat_show(struct sys_device *sysdev, | |||
| 727 | 728 | ||
| 728 | static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); | 729 | static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); |
| 729 | 730 | ||
| 731 | #ifdef CONFIG_KEXEC | ||
| 732 | |||
| 733 | struct crash_spu_info { | ||
| 734 | struct spu *spu; | ||
| 735 | u32 saved_spu_runcntl_RW; | ||
| 736 | u32 saved_spu_status_R; | ||
| 737 | u32 saved_spu_npc_RW; | ||
| 738 | u64 saved_mfc_sr1_RW; | ||
| 739 | u64 saved_mfc_dar; | ||
| 740 | u64 saved_mfc_dsisr; | ||
| 741 | }; | ||
| 742 | |||
| 743 | #define CRASH_NUM_SPUS 16 /* Enough for current hardware */ | ||
| 744 | static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS]; | ||
| 745 | |||
| 746 | static void crash_kexec_stop_spus(void) | ||
| 747 | { | ||
| 748 | struct spu *spu; | ||
| 749 | int i; | ||
| 750 | u64 tmp; | ||
| 751 | |||
| 752 | for (i = 0; i < CRASH_NUM_SPUS; i++) { | ||
| 753 | if (!crash_spu_info[i].spu) | ||
| 754 | continue; | ||
| 755 | |||
| 756 | spu = crash_spu_info[i].spu; | ||
| 757 | |||
| 758 | crash_spu_info[i].saved_spu_runcntl_RW = | ||
| 759 | in_be32(&spu->problem->spu_runcntl_RW); | ||
| 760 | crash_spu_info[i].saved_spu_status_R = | ||
| 761 | in_be32(&spu->problem->spu_status_R); | ||
| 762 | crash_spu_info[i].saved_spu_npc_RW = | ||
| 763 | in_be32(&spu->problem->spu_npc_RW); | ||
| 764 | |||
| 765 | crash_spu_info[i].saved_mfc_dar = spu_mfc_dar_get(spu); | ||
| 766 | crash_spu_info[i].saved_mfc_dsisr = spu_mfc_dsisr_get(spu); | ||
| 767 | tmp = spu_mfc_sr1_get(spu); | ||
| 768 | crash_spu_info[i].saved_mfc_sr1_RW = tmp; | ||
| 769 | |||
| 770 | tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK; | ||
| 771 | spu_mfc_sr1_set(spu, tmp); | ||
| 772 | |||
| 773 | __delay(200); | ||
| 774 | } | ||
| 775 | } | ||
| 776 | |||
| 777 | static void crash_register_spus(struct list_head *list) | ||
| 778 | { | ||
| 779 | struct spu *spu; | ||
| 780 | int ret; | ||
| 781 | |||
| 782 | list_for_each_entry(spu, list, full_list) { | ||
| 783 | if (WARN_ON(spu->number >= CRASH_NUM_SPUS)) | ||
| 784 | continue; | ||
| 785 | |||
| 786 | crash_spu_info[spu->number].spu = spu; | ||
| 787 | } | ||
| 788 | |||
| 789 | ret = crash_shutdown_register(&crash_kexec_stop_spus); | ||
| 790 | if (ret) | ||
| 791 | printk(KERN_ERR "Could not register SPU crash handler"); | ||
| 792 | } | ||
| 793 | |||
| 794 | #else | ||
| 795 | static inline void crash_register_spus(struct list_head *list) | ||
| 796 | { | ||
| 797 | } | ||
| 798 | #endif | ||
| 799 | |||
| 730 | static int __init init_spu_base(void) | 800 | static int __init init_spu_base(void) |
| 731 | { | 801 | { |
| 732 | int i, ret = 0; | 802 | int i, ret = 0; |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 02f7b113a31b..3c7c3f82d842 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
| @@ -219,24 +219,17 @@ spufs_mem_write(struct file *file, const char __user *buffer, | |||
| 219 | loff_t pos = *ppos; | 219 | loff_t pos = *ppos; |
| 220 | int ret; | 220 | int ret; |
| 221 | 221 | ||
| 222 | if (pos < 0) | ||
| 223 | return -EINVAL; | ||
| 224 | if (pos > LS_SIZE) | 222 | if (pos > LS_SIZE) |
| 225 | return -EFBIG; | 223 | return -EFBIG; |
| 226 | if (size > LS_SIZE - pos) | ||
| 227 | size = LS_SIZE - pos; | ||
| 228 | 224 | ||
| 229 | ret = spu_acquire(ctx); | 225 | ret = spu_acquire(ctx); |
| 230 | if (ret) | 226 | if (ret) |
| 231 | return ret; | 227 | return ret; |
| 232 | 228 | ||
| 233 | local_store = ctx->ops->get_ls(ctx); | 229 | local_store = ctx->ops->get_ls(ctx); |
| 234 | ret = copy_from_user(local_store + pos, buffer, size); | 230 | size = simple_write_to_buffer(local_store, LS_SIZE, ppos, buffer, size); |
| 235 | spu_release(ctx); | 231 | spu_release(ctx); |
| 236 | 232 | ||
| 237 | if (ret) | ||
| 238 | return -EFAULT; | ||
| 239 | *ppos = pos + size; | ||
| 240 | return size; | 233 | return size; |
| 241 | } | 234 | } |
| 242 | 235 | ||
| @@ -574,18 +567,15 @@ spufs_regs_write(struct file *file, const char __user *buffer, | |||
| 574 | if (*pos >= sizeof(lscsa->gprs)) | 567 | if (*pos >= sizeof(lscsa->gprs)) |
| 575 | return -EFBIG; | 568 | return -EFBIG; |
| 576 | 569 | ||
| 577 | size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size); | ||
| 578 | *pos += size; | ||
| 579 | |||
| 580 | ret = spu_acquire_saved(ctx); | 570 | ret = spu_acquire_saved(ctx); |
| 581 | if (ret) | 571 | if (ret) |
| 582 | return ret; | 572 | return ret; |
| 583 | 573 | ||
| 584 | ret = copy_from_user((char *)lscsa->gprs + *pos - size, | 574 | size = simple_write_to_buffer(lscsa->gprs, sizeof(lscsa->gprs), pos, |
| 585 | buffer, size) ? -EFAULT : size; | 575 | buffer, size); |
| 586 | 576 | ||
| 587 | spu_release_saved(ctx); | 577 | spu_release_saved(ctx); |
| 588 | return ret; | 578 | return size; |
| 589 | } | 579 | } |
| 590 | 580 | ||
| 591 | static const struct file_operations spufs_regs_fops = { | 581 | static const struct file_operations spufs_regs_fops = { |
| @@ -630,18 +620,15 @@ spufs_fpcr_write(struct file *file, const char __user * buffer, | |||
| 630 | if (*pos >= sizeof(lscsa->fpcr)) | 620 | if (*pos >= sizeof(lscsa->fpcr)) |
| 631 | return -EFBIG; | 621 | return -EFBIG; |
| 632 | 622 | ||
| 633 | size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size); | ||
| 634 | |||
| 635 | ret = spu_acquire_saved(ctx); | 623 | ret = spu_acquire_saved(ctx); |
| 636 | if (ret) | 624 | if (ret) |
| 637 | return ret; | 625 | return ret; |
| 638 | 626 | ||
| 639 | *pos += size; | 627 | size = simple_write_to_buffer(&lscsa->fpcr, sizeof(lscsa->fpcr), pos, |
| 640 | ret = copy_from_user((char *)&lscsa->fpcr + *pos - size, | 628 | buffer, size); |
| 641 | buffer, size) ? -EFAULT : size; | ||
| 642 | 629 | ||
| 643 | spu_release_saved(ctx); | 630 | spu_release_saved(ctx); |
| 644 | return ret; | 631 | return size; |
| 645 | } | 632 | } |
| 646 | 633 | ||
| 647 | static const struct file_operations spufs_fpcr_fops = { | 634 | static const struct file_operations spufs_fpcr_fops = { |
diff --git a/arch/powerpc/platforms/embedded6xx/gamecube.c b/arch/powerpc/platforms/embedded6xx/gamecube.c index 1106fd99627f..a138e14bad2e 100644 --- a/arch/powerpc/platforms/embedded6xx/gamecube.c +++ b/arch/powerpc/platforms/embedded6xx/gamecube.c | |||
| @@ -75,14 +75,6 @@ static void gamecube_shutdown(void) | |||
| 75 | flipper_quiesce(); | 75 | flipper_quiesce(); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | #ifdef CONFIG_KEXEC | ||
| 79 | static int gamecube_kexec_prepare(struct kimage *image) | ||
| 80 | { | ||
| 81 | return 0; | ||
| 82 | } | ||
| 83 | #endif /* CONFIG_KEXEC */ | ||
| 84 | |||
| 85 | |||
| 86 | define_machine(gamecube) { | 78 | define_machine(gamecube) { |
| 87 | .name = "gamecube", | 79 | .name = "gamecube", |
| 88 | .probe = gamecube_probe, | 80 | .probe = gamecube_probe, |
| @@ -95,9 +87,6 @@ define_machine(gamecube) { | |||
| 95 | .calibrate_decr = generic_calibrate_decr, | 87 | .calibrate_decr = generic_calibrate_decr, |
| 96 | .progress = udbg_progress, | 88 | .progress = udbg_progress, |
| 97 | .machine_shutdown = gamecube_shutdown, | 89 | .machine_shutdown = gamecube_shutdown, |
| 98 | #ifdef CONFIG_KEXEC | ||
| 99 | .machine_kexec_prepare = gamecube_kexec_prepare, | ||
| 100 | #endif | ||
| 101 | }; | 90 | }; |
| 102 | 91 | ||
| 103 | 92 | ||
diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c index 649473a729b8..1b5dc1a2e145 100644 --- a/arch/powerpc/platforms/embedded6xx/wii.c +++ b/arch/powerpc/platforms/embedded6xx/wii.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
| 20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
| 21 | #include <linux/kexec.h> | ||
| 22 | #include <linux/of_platform.h> | 21 | #include <linux/of_platform.h> |
| 23 | #include <linux/memblock.h> | 22 | #include <linux/memblock.h> |
| 24 | #include <mm/mmu_decl.h> | 23 | #include <mm/mmu_decl.h> |
| @@ -226,13 +225,6 @@ static void wii_shutdown(void) | |||
| 226 | flipper_quiesce(); | 225 | flipper_quiesce(); |
| 227 | } | 226 | } |
| 228 | 227 | ||
| 229 | #ifdef CONFIG_KEXEC | ||
| 230 | static int wii_machine_kexec_prepare(struct kimage *image) | ||
| 231 | { | ||
| 232 | return 0; | ||
| 233 | } | ||
| 234 | #endif /* CONFIG_KEXEC */ | ||
| 235 | |||
| 236 | define_machine(wii) { | 228 | define_machine(wii) { |
| 237 | .name = "wii", | 229 | .name = "wii", |
| 238 | .probe = wii_probe, | 230 | .probe = wii_probe, |
| @@ -246,9 +238,6 @@ define_machine(wii) { | |||
| 246 | .calibrate_decr = generic_calibrate_decr, | 238 | .calibrate_decr = generic_calibrate_decr, |
| 247 | .progress = udbg_progress, | 239 | .progress = udbg_progress, |
| 248 | .machine_shutdown = wii_shutdown, | 240 | .machine_shutdown = wii_shutdown, |
| 249 | #ifdef CONFIG_KEXEC | ||
| 250 | .machine_kexec_prepare = wii_machine_kexec_prepare, | ||
| 251 | #endif | ||
| 252 | }; | 241 | }; |
| 253 | 242 | ||
| 254 | static struct of_device_id wii_of_bus[] = { | 243 | static struct of_device_id wii_of_bus[] = { |
diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pseries/kexec.c index 53cbd53d8740..77d38a5e2ff9 100644 --- a/arch/powerpc/platforms/pseries/kexec.c +++ b/arch/powerpc/platforms/pseries/kexec.c | |||
| @@ -61,13 +61,3 @@ void __init setup_kexec_cpu_down_xics(void) | |||
| 61 | { | 61 | { |
| 62 | ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; | 62 | ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; |
| 63 | } | 63 | } |
| 64 | |||
| 65 | static int __init pseries_kexec_setup(void) | ||
| 66 | { | ||
| 67 | ppc_md.machine_kexec = default_machine_kexec; | ||
| 68 | ppc_md.machine_kexec_prepare = default_machine_kexec_prepare; | ||
| 69 | ppc_md.machine_crash_shutdown = default_machine_crash_shutdown; | ||
| 70 | |||
| 71 | return 0; | ||
| 72 | } | ||
| 73 | machine_device_initcall(pseries, pseries_kexec_setup); | ||
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index a4fc6da87c2e..c55d7ad9c648 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c | |||
| @@ -54,7 +54,8 @@ | |||
| 54 | static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; | 54 | static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; |
| 55 | static DEFINE_SPINLOCK(ras_log_buf_lock); | 55 | static DEFINE_SPINLOCK(ras_log_buf_lock); |
| 56 | 56 | ||
| 57 | static char mce_data_buf[RTAS_ERROR_LOG_MAX]; | 57 | static char global_mce_data_buf[RTAS_ERROR_LOG_MAX]; |
| 58 | static DEFINE_PER_CPU(__u64, mce_data_buf); | ||
| 58 | 59 | ||
| 59 | static int ras_get_sensor_state_token; | 60 | static int ras_get_sensor_state_token; |
| 60 | static int ras_check_exception_token; | 61 | static int ras_check_exception_token; |
| @@ -196,12 +197,24 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id) | |||
| 196 | return IRQ_HANDLED; | 197 | return IRQ_HANDLED; |
| 197 | } | 198 | } |
| 198 | 199 | ||
| 199 | /* Get the error information for errors coming through the | 200 | /* |
| 201 | * Some versions of FWNMI place the buffer inside the 4kB page starting at | ||
| 202 | * 0x7000. Other versions place it inside the rtas buffer. We check both. | ||
| 203 | */ | ||
| 204 | #define VALID_FWNMI_BUFFER(A) \ | ||
| 205 | ((((A) >= 0x7000) && ((A) < 0x7ff0)) || \ | ||
| 206 | (((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16)))) | ||
| 207 | |||
| 208 | /* | ||
| 209 | * Get the error information for errors coming through the | ||
| 200 | * FWNMI vectors. The pt_regs' r3 will be updated to reflect | 210 | * FWNMI vectors. The pt_regs' r3 will be updated to reflect |
| 201 | * the actual r3 if possible, and a ptr to the error log entry | 211 | * the actual r3 if possible, and a ptr to the error log entry |
| 202 | * will be returned if found. | 212 | * will be returned if found. |
| 203 | * | 213 | * |
| 204 | * The mce_data_buf does not have any locks or protection around it, | 214 | * If the RTAS error is not of the extended type, then we put it in a per |
| 215 | * cpu 64bit buffer. If it is the extended type we use global_mce_data_buf. | ||
| 216 | * | ||
| 217 | * The global_mce_data_buf does not have any locks or protection around it, | ||
| 205 | * if a second machine check comes in, or a system reset is done | 218 | * if a second machine check comes in, or a system reset is done |
| 206 | * before we have logged the error, then we will get corruption in the | 219 | * before we have logged the error, then we will get corruption in the |
| 207 | * error log. This is preferable over holding off on calling | 220 | * error log. This is preferable over holding off on calling |
| @@ -210,20 +223,31 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id) | |||
| 210 | */ | 223 | */ |
| 211 | static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs) | 224 | static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs) |
| 212 | { | 225 | { |
| 213 | unsigned long errdata = regs->gpr[3]; | ||
| 214 | struct rtas_error_log *errhdr = NULL; | ||
| 215 | unsigned long *savep; | 226 | unsigned long *savep; |
| 227 | struct rtas_error_log *h, *errhdr = NULL; | ||
| 228 | |||
| 229 | if (!VALID_FWNMI_BUFFER(regs->gpr[3])) { | ||
| 230 | printk(KERN_ERR "FWNMI: corrupt r3\n"); | ||
| 231 | return NULL; | ||
| 232 | } | ||
| 216 | 233 | ||
| 217 | if ((errdata >= 0x7000 && errdata < 0x7fff0) || | 234 | savep = __va(regs->gpr[3]); |
| 218 | (errdata >= rtas.base && errdata < rtas.base + rtas.size - 16)) { | 235 | regs->gpr[3] = savep[0]; /* restore original r3 */ |
| 219 | savep = __va(errdata); | 236 | |
| 220 | regs->gpr[3] = savep[0]; /* restore original r3 */ | 237 | /* If it isn't an extended log we can use the per cpu 64bit buffer */ |
| 221 | memset(mce_data_buf, 0, RTAS_ERROR_LOG_MAX); | 238 | h = (struct rtas_error_log *)&savep[1]; |
| 222 | memcpy(mce_data_buf, (char *)(savep + 1), RTAS_ERROR_LOG_MAX); | 239 | if (!h->extended) { |
| 223 | errhdr = (struct rtas_error_log *)mce_data_buf; | 240 | memcpy(&__get_cpu_var(mce_data_buf), h, sizeof(__u64)); |
| 241 | errhdr = (struct rtas_error_log *)&__get_cpu_var(mce_data_buf); | ||
| 224 | } else { | 242 | } else { |
| 225 | printk("FWNMI: corrupt r3\n"); | 243 | int len; |
| 244 | |||
| 245 | len = max_t(int, 8+h->extended_log_length, RTAS_ERROR_LOG_MAX); | ||
| 246 | memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX); | ||
| 247 | memcpy(global_mce_data_buf, h, len); | ||
| 248 | errhdr = (struct rtas_error_log *)global_mce_data_buf; | ||
| 226 | } | 249 | } |
| 250 | |||
| 227 | return errhdr; | 251 | return errhdr; |
| 228 | } | 252 | } |
| 229 | 253 | ||
| @@ -235,7 +259,7 @@ static void fwnmi_release_errinfo(void) | |||
| 235 | { | 259 | { |
| 236 | int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL); | 260 | int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL); |
| 237 | if (ret != 0) | 261 | if (ret != 0) |
| 238 | printk("FWNMI: nmi-interlock failed: %d\n", ret); | 262 | printk(KERN_ERR "FWNMI: nmi-interlock failed: %d\n", ret); |
| 239 | } | 263 | } |
| 240 | 264 | ||
| 241 | int pSeries_system_reset_exception(struct pt_regs *regs) | 265 | int pSeries_system_reset_exception(struct pt_regs *regs) |
| @@ -259,31 +283,43 @@ int pSeries_system_reset_exception(struct pt_regs *regs) | |||
| 259 | * Return 1 if corrected (or delivered a signal). | 283 | * Return 1 if corrected (or delivered a signal). |
| 260 | * Return 0 if there is nothing we can do. | 284 | * Return 0 if there is nothing we can do. |
| 261 | */ | 285 | */ |
| 262 | static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err) | 286 | static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err) |
| 263 | { | 287 | { |
| 264 | int nonfatal = 0; | 288 | int recovered = 0; |
| 265 | 289 | ||
| 266 | if (err->disposition == RTAS_DISP_FULLY_RECOVERED) { | 290 | if (!(regs->msr & MSR_RI)) { |
| 291 | /* If MSR_RI isn't set, we cannot recover */ | ||
| 292 | recovered = 0; | ||
| 293 | |||
| 294 | } else if (err->disposition == RTAS_DISP_FULLY_RECOVERED) { | ||
| 267 | /* Platform corrected itself */ | 295 | /* Platform corrected itself */ |
| 268 | nonfatal = 1; | 296 | recovered = 1; |
| 269 | } else if ((regs->msr & MSR_RI) && | 297 | |
| 270 | user_mode(regs) && | 298 | } else if (err->disposition == RTAS_DISP_LIMITED_RECOVERY) { |
| 271 | err->severity == RTAS_SEVERITY_ERROR_SYNC && | 299 | /* Platform corrected itself but could be degraded */ |
| 272 | err->disposition == RTAS_DISP_NOT_RECOVERED && | 300 | printk(KERN_ERR "MCE: limited recovery, system may " |
| 273 | err->target == RTAS_TARGET_MEMORY && | 301 | "be degraded\n"); |
| 274 | err->type == RTAS_TYPE_ECC_UNCORR && | 302 | recovered = 1; |
| 275 | !(current->pid == 0 || is_global_init(current))) { | 303 | |
| 276 | /* Kill off a user process with an ECC error */ | 304 | } else if (user_mode(regs) && !is_global_init(current) && |
| 277 | printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n", | 305 | err->severity == RTAS_SEVERITY_ERROR_SYNC) { |
| 278 | current->pid); | 306 | |
| 279 | /* XXX something better for ECC error? */ | 307 | /* |
| 280 | _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); | 308 | * If we received a synchronous error when in userspace |
| 281 | nonfatal = 1; | 309 | * kill the task. Firmware may report details of the fail |
| 310 | * asynchronously, so we can't rely on the target and type | ||
| 311 | * fields being valid here. | ||
| 312 | */ | ||
| 313 | printk(KERN_ERR "MCE: uncorrectable error, killing task " | ||
| 314 | "%s:%d\n", current->comm, current->pid); | ||
| 315 | |||
| 316 | _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip); | ||
| 317 | recovered = 1; | ||
| 282 | } | 318 | } |
| 283 | 319 | ||
| 284 | log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal); | 320 | log_error((char *)err, ERR_TYPE_RTAS_LOG, 0); |
| 285 | 321 | ||
| 286 | return nonfatal; | 322 | return recovered; |
| 287 | } | 323 | } |
| 288 | 324 | ||
| 289 | /* | 325 | /* |
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 9f99bef2adec..8c6cab013278 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c | |||
| @@ -1555,8 +1555,6 @@ int fsl_rio_setup(struct platform_device *dev) | |||
| 1555 | saved_mcheck_exception = ppc_md.machine_check_exception; | 1555 | saved_mcheck_exception = ppc_md.machine_check_exception; |
| 1556 | ppc_md.machine_check_exception = fsl_rio_mcheck_exception; | 1556 | ppc_md.machine_check_exception = fsl_rio_mcheck_exception; |
| 1557 | #endif | 1557 | #endif |
| 1558 | /* Ensure that RFXE is set */ | ||
| 1559 | mtspr(SPRN_HID1, (mfspr(SPRN_HID1) | 0x20000)); | ||
| 1560 | 1558 | ||
| 1561 | return 0; | 1559 | return 0; |
| 1562 | err: | 1560 | err: |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 7c1342618a30..b0c8469e5ddd 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
| @@ -674,7 +674,8 @@ void mpic_unmask_irq(unsigned int irq) | |||
| 674 | /* make sure mask gets to controller before we return to user */ | 674 | /* make sure mask gets to controller before we return to user */ |
| 675 | do { | 675 | do { |
| 676 | if (!loops--) { | 676 | if (!loops--) { |
| 677 | printk(KERN_ERR "mpic_enable_irq timeout\n"); | 677 | printk(KERN_ERR "%s: timeout on hwirq %u\n", |
| 678 | __func__, src); | ||
| 678 | break; | 679 | break; |
| 679 | } | 680 | } |
| 680 | } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK); | 681 | } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK); |
| @@ -695,7 +696,8 @@ void mpic_mask_irq(unsigned int irq) | |||
| 695 | /* make sure mask gets to controller before we return to user */ | 696 | /* make sure mask gets to controller before we return to user */ |
| 696 | do { | 697 | do { |
| 697 | if (!loops--) { | 698 | if (!loops--) { |
| 698 | printk(KERN_ERR "mpic_enable_irq timeout\n"); | 699 | printk(KERN_ERR "%s: timeout on hwirq %u\n", |
| 700 | __func__, src); | ||
| 699 | break; | 701 | break; |
| 700 | } | 702 | } |
| 701 | } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK)); | 703 | } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK)); |
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c index 9d30105a0c4a..6a6fe8939645 100644 --- a/arch/x86/xen/irq.c +++ b/arch/x86/xen/irq.c | |||
| @@ -126,7 +126,7 @@ static const struct pv_irq_ops xen_irq_ops __initdata = { | |||
| 126 | #endif | 126 | #endif |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | void __init xen_init_irq_ops() | 129 | void __init xen_init_irq_ops(void) |
| 130 | { | 130 | { |
| 131 | pv_irq_ops = xen_irq_ops; | 131 | pv_irq_ops = xen_irq_ops; |
| 132 | x86_init.irqs.intr_init = xen_init_IRQ; | 132 | x86_init.irqs.intr_init = xen_init_IRQ; |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 8f2251d2a3f8..ddc81a06edb9 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
| @@ -237,7 +237,25 @@ void __init xen_build_dynamic_phys_to_machine(void) | |||
| 237 | p2m_top[topidx] = mid; | 237 | p2m_top[topidx] = mid; |
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | p2m_top[topidx][mididx] = &mfn_list[pfn]; | 240 | /* |
| 241 | * As long as the mfn_list has enough entries to completely | ||
| 242 | * fill a p2m page, pointing into the array is ok. But if | ||
| 243 | * not the entries beyond the last pfn will be undefined. | ||
| 244 | * And guessing that the 'what-ever-there-is' does not take it | ||
| 245 | * too kindly when changing it to invalid markers, a new page | ||
| 246 | * is allocated, initialized and filled with the valid part. | ||
| 247 | */ | ||
| 248 | if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) { | ||
| 249 | unsigned long p2midx; | ||
| 250 | unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE); | ||
| 251 | p2m_init(p2m); | ||
| 252 | |||
| 253 | for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) { | ||
| 254 | p2m[p2midx] = mfn_list[pfn + p2midx]; | ||
| 255 | } | ||
| 256 | p2m_top[topidx][mididx] = p2m; | ||
| 257 | } else | ||
| 258 | p2m_top[topidx][mididx] = &mfn_list[pfn]; | ||
| 241 | } | 259 | } |
| 242 | 260 | ||
| 243 | m2p_override_init(); | 261 | m2p_override_init(); |
diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig index 68f942cb30f2..0c56989cd907 100644 --- a/drivers/firewire/Kconfig +++ b/drivers/firewire/Kconfig | |||
| @@ -49,15 +49,13 @@ config FIREWIRE_SBP2 | |||
| 49 | configuration section. | 49 | configuration section. |
| 50 | 50 | ||
| 51 | config FIREWIRE_NET | 51 | config FIREWIRE_NET |
| 52 | tristate "IP networking over 1394 (EXPERIMENTAL)" | 52 | tristate "IP networking over 1394" |
| 53 | depends on FIREWIRE && INET && EXPERIMENTAL | 53 | depends on FIREWIRE && INET |
| 54 | help | 54 | help |
| 55 | This enables IPv4 over IEEE 1394, providing IP connectivity with | 55 | This enables IPv4 over IEEE 1394, providing IP connectivity with |
| 56 | other implementations of RFC 2734 as found on several operating | 56 | other implementations of RFC 2734 as found on several operating |
| 57 | systems. Multicast support is currently limited. | 57 | systems. Multicast support is currently limited. |
| 58 | 58 | ||
| 59 | NOTE, this driver is not stable yet! | ||
| 60 | |||
| 61 | To compile this driver as a module, say M here: The module will be | 59 | To compile this driver as a module, say M here: The module will be |
| 62 | called firewire-net. | 60 | called firewire-net. |
| 63 | 61 | ||
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index be0492398ef9..24ff35511e2b 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
| @@ -75,6 +75,8 @@ static size_t config_rom_length = 1 + 4 + 1 + 1; | |||
| 75 | #define BIB_IRMC ((1) << 31) | 75 | #define BIB_IRMC ((1) << 31) |
| 76 | #define NODE_CAPABILITIES 0x0c0083c0 /* per IEEE 1394 clause 8.3.2.6.5.2 */ | 76 | #define NODE_CAPABILITIES 0x0c0083c0 /* per IEEE 1394 clause 8.3.2.6.5.2 */ |
| 77 | 77 | ||
| 78 | #define CANON_OUI 0x000085 | ||
| 79 | |||
| 78 | static void generate_config_rom(struct fw_card *card, __be32 *config_rom) | 80 | static void generate_config_rom(struct fw_card *card, __be32 *config_rom) |
| 79 | { | 81 | { |
| 80 | struct fw_descriptor *desc; | 82 | struct fw_descriptor *desc; |
| @@ -284,6 +286,7 @@ static void bm_work(struct work_struct *work) | |||
| 284 | bool root_device_is_running; | 286 | bool root_device_is_running; |
| 285 | bool root_device_is_cmc; | 287 | bool root_device_is_cmc; |
| 286 | bool irm_is_1394_1995_only; | 288 | bool irm_is_1394_1995_only; |
| 289 | bool keep_this_irm; | ||
| 287 | 290 | ||
| 288 | spin_lock_irq(&card->lock); | 291 | spin_lock_irq(&card->lock); |
| 289 | 292 | ||
| @@ -305,6 +308,10 @@ static void bm_work(struct work_struct *work) | |||
| 305 | irm_is_1394_1995_only = irm_device && irm_device->config_rom && | 308 | irm_is_1394_1995_only = irm_device && irm_device->config_rom && |
| 306 | (irm_device->config_rom[2] & 0x000000f0) == 0; | 309 | (irm_device->config_rom[2] & 0x000000f0) == 0; |
| 307 | 310 | ||
| 311 | /* Canon MV5i works unreliably if it is not root node. */ | ||
| 312 | keep_this_irm = irm_device && irm_device->config_rom && | ||
| 313 | irm_device->config_rom[3] >> 8 == CANON_OUI; | ||
| 314 | |||
| 308 | root_id = root_node->node_id; | 315 | root_id = root_node->node_id; |
| 309 | irm_id = card->irm_node->node_id; | 316 | irm_id = card->irm_node->node_id; |
| 310 | local_id = card->local_node->node_id; | 317 | local_id = card->local_node->node_id; |
| @@ -333,7 +340,7 @@ static void bm_work(struct work_struct *work) | |||
| 333 | goto pick_me; | 340 | goto pick_me; |
| 334 | } | 341 | } |
| 335 | 342 | ||
| 336 | if (irm_is_1394_1995_only) { | 343 | if (irm_is_1394_1995_only && !keep_this_irm) { |
| 337 | new_root_id = local_id; | 344 | new_root_id = local_id; |
| 338 | fw_notify("%s, making local node (%02x) root.\n", | 345 | fw_notify("%s, making local node (%02x) root.\n", |
| 339 | "IRM is not 1394a compliant", new_root_id); | 346 | "IRM is not 1394a compliant", new_root_id); |
| @@ -382,7 +389,7 @@ static void bm_work(struct work_struct *work) | |||
| 382 | 389 | ||
| 383 | spin_lock_irq(&card->lock); | 390 | spin_lock_irq(&card->lock); |
| 384 | 391 | ||
| 385 | if (rcode != RCODE_COMPLETE) { | 392 | if (rcode != RCODE_COMPLETE && !keep_this_irm) { |
| 386 | /* | 393 | /* |
| 387 | * The lock request failed, maybe the IRM | 394 | * The lock request failed, maybe the IRM |
| 388 | * isn't really IRM capable after all. Let's | 395 | * isn't really IRM capable after all. Let's |
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index c2e194c58667..7ed08fd1214e 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
| @@ -191,6 +191,7 @@ struct fwnet_peer { | |||
| 191 | struct fwnet_device *dev; | 191 | struct fwnet_device *dev; |
| 192 | u64 guid; | 192 | u64 guid; |
| 193 | u64 fifo; | 193 | u64 fifo; |
| 194 | __be32 ip; | ||
| 194 | 195 | ||
| 195 | /* guarded by dev->lock */ | 196 | /* guarded by dev->lock */ |
| 196 | struct list_head pd_list; /* received partial datagrams */ | 197 | struct list_head pd_list; /* received partial datagrams */ |
| @@ -570,6 +571,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
| 570 | peer->speed = sspd; | 571 | peer->speed = sspd; |
| 571 | if (peer->max_payload > max_payload) | 572 | if (peer->max_payload > max_payload) |
| 572 | peer->max_payload = max_payload; | 573 | peer->max_payload = max_payload; |
| 574 | |||
| 575 | peer->ip = arp1394->sip; | ||
| 573 | } | 576 | } |
| 574 | spin_unlock_irqrestore(&dev->lock, flags); | 577 | spin_unlock_irqrestore(&dev->lock, flags); |
| 575 | 578 | ||
| @@ -1470,6 +1473,7 @@ static int fwnet_add_peer(struct fwnet_device *dev, | |||
| 1470 | peer->dev = dev; | 1473 | peer->dev = dev; |
| 1471 | peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4]; | 1474 | peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4]; |
| 1472 | peer->fifo = FWNET_NO_FIFO_ADDR; | 1475 | peer->fifo = FWNET_NO_FIFO_ADDR; |
| 1476 | peer->ip = 0; | ||
| 1473 | INIT_LIST_HEAD(&peer->pd_list); | 1477 | INIT_LIST_HEAD(&peer->pd_list); |
| 1474 | peer->pdg_size = 0; | 1478 | peer->pdg_size = 0; |
| 1475 | peer->datagram_label = 0; | 1479 | peer->datagram_label = 0; |
| @@ -1589,10 +1593,13 @@ static int fwnet_remove(struct device *_dev) | |||
| 1589 | 1593 | ||
| 1590 | mutex_lock(&fwnet_device_mutex); | 1594 | mutex_lock(&fwnet_device_mutex); |
| 1591 | 1595 | ||
| 1596 | net = dev->netdev; | ||
| 1597 | if (net && peer->ip) | ||
| 1598 | arp_invalidate(net, peer->ip); | ||
| 1599 | |||
| 1592 | fwnet_remove_peer(peer, dev); | 1600 | fwnet_remove_peer(peer, dev); |
| 1593 | 1601 | ||
| 1594 | if (list_empty(&dev->peer_list)) { | 1602 | if (list_empty(&dev->peer_list)) { |
| 1595 | net = dev->netdev; | ||
| 1596 | unregister_netdev(net); | 1603 | unregister_netdev(net); |
| 1597 | 1604 | ||
| 1598 | if (dev->local_fifo != FWNET_NO_FIFO_ADDR) | 1605 | if (dev->local_fifo != FWNET_NO_FIFO_ADDR) |
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 2e041fd0a00c..f3a29f264db9 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
| @@ -443,7 +443,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb) | |||
| 443 | tries = 0; | 443 | tries = 0; |
| 444 | for (;;) { | 444 | for (;;) { |
| 445 | nr = i2c_master_recv(fcu, buf, nb); | 445 | nr = i2c_master_recv(fcu, buf, nb); |
| 446 | if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100) | 446 | if (nr > 0 || (nr < 0 && nr != -ENODEV) || tries >= 100) |
| 447 | break; | 447 | break; |
| 448 | msleep(10); | 448 | msleep(10); |
| 449 | ++tries; | 449 | ++tries; |
| @@ -464,7 +464,7 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb) | |||
| 464 | tries = 0; | 464 | tries = 0; |
| 465 | for (;;) { | 465 | for (;;) { |
| 466 | nw = i2c_master_send(fcu, buf, nb); | 466 | nw = i2c_master_send(fcu, buf, nb); |
| 467 | if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100) | 467 | if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100) |
| 468 | break; | 468 | break; |
| 469 | msleep(10); | 469 | msleep(10); |
| 470 | ++tries; | 470 | ++tries; |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 7aa767d4f06f..85c8cc8f2473 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
| @@ -754,7 +754,7 @@ static int ext3_release_dquot(struct dquot *dquot); | |||
| 754 | static int ext3_mark_dquot_dirty(struct dquot *dquot); | 754 | static int ext3_mark_dquot_dirty(struct dquot *dquot); |
| 755 | static int ext3_write_info(struct super_block *sb, int type); | 755 | static int ext3_write_info(struct super_block *sb, int type); |
| 756 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 756 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
| 757 | char *path); | 757 | struct path *path); |
| 758 | static int ext3_quota_on_mount(struct super_block *sb, int type); | 758 | static int ext3_quota_on_mount(struct super_block *sb, int type); |
| 759 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, | 759 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, |
| 760 | size_t len, loff_t off); | 760 | size_t len, loff_t off); |
| @@ -2877,27 +2877,20 @@ static int ext3_quota_on_mount(struct super_block *sb, int type) | |||
| 2877 | * Standard function to be called on quota_on | 2877 | * Standard function to be called on quota_on |
| 2878 | */ | 2878 | */ |
| 2879 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 2879 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
| 2880 | char *name) | 2880 | struct path *path) |
| 2881 | { | 2881 | { |
| 2882 | int err; | 2882 | int err; |
| 2883 | struct path path; | ||
| 2884 | 2883 | ||
| 2885 | if (!test_opt(sb, QUOTA)) | 2884 | if (!test_opt(sb, QUOTA)) |
| 2886 | return -EINVAL; | 2885 | return -EINVAL; |
| 2887 | 2886 | ||
| 2888 | err = kern_path(name, LOOKUP_FOLLOW, &path); | ||
| 2889 | if (err) | ||
| 2890 | return err; | ||
| 2891 | |||
| 2892 | /* Quotafile not on the same filesystem? */ | 2887 | /* Quotafile not on the same filesystem? */ |
| 2893 | if (path.mnt->mnt_sb != sb) { | 2888 | if (path->mnt->mnt_sb != sb) |
| 2894 | path_put(&path); | ||
| 2895 | return -EXDEV; | 2889 | return -EXDEV; |
| 2896 | } | ||
| 2897 | /* Journaling quota? */ | 2890 | /* Journaling quota? */ |
| 2898 | if (EXT3_SB(sb)->s_qf_names[type]) { | 2891 | if (EXT3_SB(sb)->s_qf_names[type]) { |
| 2899 | /* Quotafile not of fs root? */ | 2892 | /* Quotafile not of fs root? */ |
| 2900 | if (path.dentry->d_parent != sb->s_root) | 2893 | if (path->dentry->d_parent != sb->s_root) |
| 2901 | ext3_msg(sb, KERN_WARNING, | 2894 | ext3_msg(sb, KERN_WARNING, |
| 2902 | "warning: Quota file not on filesystem root. " | 2895 | "warning: Quota file not on filesystem root. " |
| 2903 | "Journaled quota will not work."); | 2896 | "Journaled quota will not work."); |
| @@ -2907,7 +2900,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
| 2907 | * When we journal data on quota file, we have to flush journal to see | 2900 | * When we journal data on quota file, we have to flush journal to see |
| 2908 | * all updates to the file when we bypass pagecache... | 2901 | * all updates to the file when we bypass pagecache... |
| 2909 | */ | 2902 | */ |
| 2910 | if (ext3_should_journal_data(path.dentry->d_inode)) { | 2903 | if (ext3_should_journal_data(path->dentry->d_inode)) { |
| 2911 | /* | 2904 | /* |
| 2912 | * We don't need to lock updates but journal_flush() could | 2905 | * We don't need to lock updates but journal_flush() could |
| 2913 | * otherwise be livelocked... | 2906 | * otherwise be livelocked... |
| @@ -2915,15 +2908,11 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
| 2915 | journal_lock_updates(EXT3_SB(sb)->s_journal); | 2908 | journal_lock_updates(EXT3_SB(sb)->s_journal); |
| 2916 | err = journal_flush(EXT3_SB(sb)->s_journal); | 2909 | err = journal_flush(EXT3_SB(sb)->s_journal); |
| 2917 | journal_unlock_updates(EXT3_SB(sb)->s_journal); | 2910 | journal_unlock_updates(EXT3_SB(sb)->s_journal); |
| 2918 | if (err) { | 2911 | if (err) |
| 2919 | path_put(&path); | ||
| 2920 | return err; | 2912 | return err; |
| 2921 | } | ||
| 2922 | } | 2913 | } |
| 2923 | 2914 | ||
| 2924 | err = dquot_quota_on_path(sb, type, format_id, &path); | 2915 | return dquot_quota_on(sb, type, format_id, path); |
| 2925 | path_put(&path); | ||
| 2926 | return err; | ||
| 2927 | } | 2916 | } |
| 2928 | 2917 | ||
| 2929 | /* Read data from quotafile - avoid pagecache and such because we cannot afford | 2918 | /* Read data from quotafile - avoid pagecache and such because we cannot afford |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index cb10a06775e4..48ce561fafac 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -1161,7 +1161,7 @@ static int ext4_release_dquot(struct dquot *dquot); | |||
| 1161 | static int ext4_mark_dquot_dirty(struct dquot *dquot); | 1161 | static int ext4_mark_dquot_dirty(struct dquot *dquot); |
| 1162 | static int ext4_write_info(struct super_block *sb, int type); | 1162 | static int ext4_write_info(struct super_block *sb, int type); |
| 1163 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 1163 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
| 1164 | char *path); | 1164 | struct path *path); |
| 1165 | static int ext4_quota_off(struct super_block *sb, int type); | 1165 | static int ext4_quota_off(struct super_block *sb, int type); |
| 1166 | static int ext4_quota_on_mount(struct super_block *sb, int type); | 1166 | static int ext4_quota_on_mount(struct super_block *sb, int type); |
| 1167 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, | 1167 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, |
| @@ -4558,27 +4558,20 @@ static int ext4_quota_on_mount(struct super_block *sb, int type) | |||
| 4558 | * Standard function to be called on quota_on | 4558 | * Standard function to be called on quota_on |
| 4559 | */ | 4559 | */ |
| 4560 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 4560 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
| 4561 | char *name) | 4561 | struct path *path) |
| 4562 | { | 4562 | { |
| 4563 | int err; | 4563 | int err; |
| 4564 | struct path path; | ||
| 4565 | 4564 | ||
| 4566 | if (!test_opt(sb, QUOTA)) | 4565 | if (!test_opt(sb, QUOTA)) |
| 4567 | return -EINVAL; | 4566 | return -EINVAL; |
| 4568 | 4567 | ||
| 4569 | err = kern_path(name, LOOKUP_FOLLOW, &path); | ||
| 4570 | if (err) | ||
| 4571 | return err; | ||
| 4572 | |||
| 4573 | /* Quotafile not on the same filesystem? */ | 4568 | /* Quotafile not on the same filesystem? */ |
| 4574 | if (path.mnt->mnt_sb != sb) { | 4569 | if (path->mnt->mnt_sb != sb) |
| 4575 | path_put(&path); | ||
| 4576 | return -EXDEV; | 4570 | return -EXDEV; |
| 4577 | } | ||
| 4578 | /* Journaling quota? */ | 4571 | /* Journaling quota? */ |
| 4579 | if (EXT4_SB(sb)->s_qf_names[type]) { | 4572 | if (EXT4_SB(sb)->s_qf_names[type]) { |
| 4580 | /* Quotafile not in fs root? */ | 4573 | /* Quotafile not in fs root? */ |
| 4581 | if (path.dentry->d_parent != sb->s_root) | 4574 | if (path->dentry->d_parent != sb->s_root) |
| 4582 | ext4_msg(sb, KERN_WARNING, | 4575 | ext4_msg(sb, KERN_WARNING, |
| 4583 | "Quota file not on filesystem root. " | 4576 | "Quota file not on filesystem root. " |
| 4584 | "Journaled quota will not work"); | 4577 | "Journaled quota will not work"); |
| @@ -4589,7 +4582,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
| 4589 | * all updates to the file when we bypass pagecache... | 4582 | * all updates to the file when we bypass pagecache... |
| 4590 | */ | 4583 | */ |
| 4591 | if (EXT4_SB(sb)->s_journal && | 4584 | if (EXT4_SB(sb)->s_journal && |
| 4592 | ext4_should_journal_data(path.dentry->d_inode)) { | 4585 | ext4_should_journal_data(path->dentry->d_inode)) { |
| 4593 | /* | 4586 | /* |
| 4594 | * We don't need to lock updates but journal_flush() could | 4587 | * We don't need to lock updates but journal_flush() could |
| 4595 | * otherwise be livelocked... | 4588 | * otherwise be livelocked... |
| @@ -4597,15 +4590,11 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
| 4597 | jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); | 4590 | jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal); |
| 4598 | err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); | 4591 | err = jbd2_journal_flush(EXT4_SB(sb)->s_journal); |
| 4599 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); | 4592 | jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal); |
| 4600 | if (err) { | 4593 | if (err) |
| 4601 | path_put(&path); | ||
| 4602 | return err; | 4594 | return err; |
| 4603 | } | ||
| 4604 | } | 4595 | } |
| 4605 | 4596 | ||
| 4606 | err = dquot_quota_on_path(sb, type, format_id, &path); | 4597 | return dquot_quota_on(sb, type, format_id, path); |
| 4607 | path_put(&path); | ||
| 4608 | return err; | ||
| 4609 | } | 4598 | } |
| 4610 | 4599 | ||
| 4611 | static int ext4_quota_off(struct super_block *sb, int type) | 4600 | static int ext4_quota_off(struct super_block *sb, int type) |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 06d1f749ca89..38f986d2447e 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -993,8 +993,7 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb) | |||
| 993 | } | 993 | } |
| 994 | 994 | ||
| 995 | /* Handle quota on quotactl */ | 995 | /* Handle quota on quotactl */ |
| 996 | static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, | 996 | static int ocfs2_quota_on(struct super_block *sb, int type, int format_id) |
| 997 | char *path) | ||
| 998 | { | 997 | { |
| 999 | unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, | 998 | unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, |
| 1000 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; | 999 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; |
| @@ -1013,7 +1012,7 @@ static int ocfs2_quota_off(struct super_block *sb, int type) | |||
| 1013 | } | 1012 | } |
| 1014 | 1013 | ||
| 1015 | static const struct quotactl_ops ocfs2_quotactl_ops = { | 1014 | static const struct quotactl_ops ocfs2_quotactl_ops = { |
| 1016 | .quota_on = ocfs2_quota_on, | 1015 | .quota_on_meta = ocfs2_quota_on, |
| 1017 | .quota_off = ocfs2_quota_off, | 1016 | .quota_off = ocfs2_quota_off, |
| 1018 | .quota_sync = dquot_quota_sync, | 1017 | .quota_sync = dquot_quota_sync, |
| 1019 | .get_info = dquot_get_dqinfo, | 1018 | .get_info = dquot_get_dqinfo, |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 84becd3e4772..a2a622e079f0 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
| @@ -2189,8 +2189,8 @@ int dquot_resume(struct super_block *sb, int type) | |||
| 2189 | } | 2189 | } |
| 2190 | EXPORT_SYMBOL(dquot_resume); | 2190 | EXPORT_SYMBOL(dquot_resume); |
| 2191 | 2191 | ||
| 2192 | int dquot_quota_on_path(struct super_block *sb, int type, int format_id, | 2192 | int dquot_quota_on(struct super_block *sb, int type, int format_id, |
| 2193 | struct path *path) | 2193 | struct path *path) |
| 2194 | { | 2194 | { |
| 2195 | int error = security_quota_on(path->dentry); | 2195 | int error = security_quota_on(path->dentry); |
| 2196 | if (error) | 2196 | if (error) |
| @@ -2204,20 +2204,6 @@ int dquot_quota_on_path(struct super_block *sb, int type, int format_id, | |||
| 2204 | DQUOT_LIMITS_ENABLED); | 2204 | DQUOT_LIMITS_ENABLED); |
| 2205 | return error; | 2205 | return error; |
| 2206 | } | 2206 | } |
| 2207 | EXPORT_SYMBOL(dquot_quota_on_path); | ||
| 2208 | |||
| 2209 | int dquot_quota_on(struct super_block *sb, int type, int format_id, char *name) | ||
| 2210 | { | ||
| 2211 | struct path path; | ||
| 2212 | int error; | ||
| 2213 | |||
| 2214 | error = kern_path(name, LOOKUP_FOLLOW, &path); | ||
| 2215 | if (!error) { | ||
| 2216 | error = dquot_quota_on_path(sb, type, format_id, &path); | ||
| 2217 | path_put(&path); | ||
| 2218 | } | ||
| 2219 | return error; | ||
| 2220 | } | ||
| 2221 | EXPORT_SYMBOL(dquot_quota_on); | 2207 | EXPORT_SYMBOL(dquot_quota_on); |
| 2222 | 2208 | ||
| 2223 | /* | 2209 | /* |
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index b299961e1edb..b34bdb25490c 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
| @@ -64,18 +64,15 @@ static int quota_sync_all(int type) | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id, | 66 | static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id, |
| 67 | void __user *addr) | 67 | struct path *path) |
| 68 | { | 68 | { |
| 69 | char *pathname; | 69 | if (!sb->s_qcop->quota_on && !sb->s_qcop->quota_on_meta) |
| 70 | int ret = -ENOSYS; | 70 | return -ENOSYS; |
| 71 | 71 | if (sb->s_qcop->quota_on_meta) | |
| 72 | pathname = getname(addr); | 72 | return sb->s_qcop->quota_on_meta(sb, type, id); |
| 73 | if (IS_ERR(pathname)) | 73 | if (IS_ERR(path)) |
| 74 | return PTR_ERR(pathname); | 74 | return PTR_ERR(path); |
| 75 | if (sb->s_qcop->quota_on) | 75 | return sb->s_qcop->quota_on(sb, type, id, path); |
| 76 | ret = sb->s_qcop->quota_on(sb, type, id, pathname); | ||
| 77 | putname(pathname); | ||
| 78 | return ret; | ||
| 79 | } | 76 | } |
| 80 | 77 | ||
| 81 | static int quota_getfmt(struct super_block *sb, int type, void __user *addr) | 78 | static int quota_getfmt(struct super_block *sb, int type, void __user *addr) |
| @@ -241,7 +238,7 @@ static int quota_getxquota(struct super_block *sb, int type, qid_t id, | |||
| 241 | 238 | ||
| 242 | /* Copy parameters and call proper function */ | 239 | /* Copy parameters and call proper function */ |
| 243 | static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, | 240 | static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, |
| 244 | void __user *addr) | 241 | void __user *addr, struct path *path) |
| 245 | { | 242 | { |
| 246 | int ret; | 243 | int ret; |
| 247 | 244 | ||
| @@ -256,7 +253,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, | |||
| 256 | 253 | ||
| 257 | switch (cmd) { | 254 | switch (cmd) { |
| 258 | case Q_QUOTAON: | 255 | case Q_QUOTAON: |
| 259 | return quota_quotaon(sb, type, cmd, id, addr); | 256 | return quota_quotaon(sb, type, cmd, id, path); |
| 260 | case Q_QUOTAOFF: | 257 | case Q_QUOTAOFF: |
| 261 | if (!sb->s_qcop->quota_off) | 258 | if (!sb->s_qcop->quota_off) |
| 262 | return -ENOSYS; | 259 | return -ENOSYS; |
| @@ -335,6 +332,7 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special, | |||
| 335 | { | 332 | { |
| 336 | uint cmds, type; | 333 | uint cmds, type; |
| 337 | struct super_block *sb = NULL; | 334 | struct super_block *sb = NULL; |
| 335 | struct path path, *pathp = NULL; | ||
| 338 | int ret; | 336 | int ret; |
| 339 | 337 | ||
| 340 | cmds = cmd >> SUBCMDSHIFT; | 338 | cmds = cmd >> SUBCMDSHIFT; |
| @@ -351,12 +349,27 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special, | |||
| 351 | return -ENODEV; | 349 | return -ENODEV; |
| 352 | } | 350 | } |
| 353 | 351 | ||
| 352 | /* | ||
| 353 | * Path for quotaon has to be resolved before grabbing superblock | ||
| 354 | * because that gets s_umount sem which is also possibly needed by path | ||
| 355 | * resolution (think about autofs) and thus deadlocks could arise. | ||
| 356 | */ | ||
| 357 | if (cmds == Q_QUOTAON) { | ||
| 358 | ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW, &path); | ||
| 359 | if (ret) | ||
| 360 | pathp = ERR_PTR(ret); | ||
| 361 | else | ||
| 362 | pathp = &path; | ||
| 363 | } | ||
| 364 | |||
| 354 | sb = quotactl_block(special); | 365 | sb = quotactl_block(special); |
| 355 | if (IS_ERR(sb)) | 366 | if (IS_ERR(sb)) |
| 356 | return PTR_ERR(sb); | 367 | return PTR_ERR(sb); |
| 357 | 368 | ||
| 358 | ret = do_quotactl(sb, type, cmds, id, addr); | 369 | ret = do_quotactl(sb, type, cmds, id, addr, pathp); |
| 359 | 370 | ||
| 360 | drop_super(sb); | 371 | drop_super(sb); |
| 372 | if (pathp && !IS_ERR(pathp)) | ||
| 373 | path_put(pathp); | ||
| 361 | return ret; | 374 | return ret; |
| 362 | } | 375 | } |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 2575682a9ead..0aab04f46827 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
| @@ -632,7 +632,7 @@ static int reiserfs_acquire_dquot(struct dquot *); | |||
| 632 | static int reiserfs_release_dquot(struct dquot *); | 632 | static int reiserfs_release_dquot(struct dquot *); |
| 633 | static int reiserfs_mark_dquot_dirty(struct dquot *); | 633 | static int reiserfs_mark_dquot_dirty(struct dquot *); |
| 634 | static int reiserfs_write_info(struct super_block *, int); | 634 | static int reiserfs_write_info(struct super_block *, int); |
| 635 | static int reiserfs_quota_on(struct super_block *, int, int, char *); | 635 | static int reiserfs_quota_on(struct super_block *, int, int, struct path *); |
| 636 | 636 | ||
| 637 | static const struct dquot_operations reiserfs_quota_operations = { | 637 | static const struct dquot_operations reiserfs_quota_operations = { |
| 638 | .write_dquot = reiserfs_write_dquot, | 638 | .write_dquot = reiserfs_write_dquot, |
| @@ -2048,25 +2048,21 @@ static int reiserfs_quota_on_mount(struct super_block *sb, int type) | |||
| 2048 | * Standard function to be called on quota_on | 2048 | * Standard function to be called on quota_on |
| 2049 | */ | 2049 | */ |
| 2050 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | 2050 | static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, |
| 2051 | char *name) | 2051 | struct path *path) |
| 2052 | { | 2052 | { |
| 2053 | int err; | 2053 | int err; |
| 2054 | struct path path; | ||
| 2055 | struct inode *inode; | 2054 | struct inode *inode; |
| 2056 | struct reiserfs_transaction_handle th; | 2055 | struct reiserfs_transaction_handle th; |
| 2057 | 2056 | ||
| 2058 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) | 2057 | if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) |
| 2059 | return -EINVAL; | 2058 | return -EINVAL; |
| 2060 | 2059 | ||
| 2061 | err = kern_path(name, LOOKUP_FOLLOW, &path); | ||
| 2062 | if (err) | ||
| 2063 | return err; | ||
| 2064 | /* Quotafile not on the same filesystem? */ | 2060 | /* Quotafile not on the same filesystem? */ |
| 2065 | if (path.mnt->mnt_sb != sb) { | 2061 | if (path->mnt->mnt_sb != sb) { |
| 2066 | err = -EXDEV; | 2062 | err = -EXDEV; |
| 2067 | goto out; | 2063 | goto out; |
| 2068 | } | 2064 | } |
| 2069 | inode = path.dentry->d_inode; | 2065 | inode = path->dentry->d_inode; |
| 2070 | /* We must not pack tails for quota files on reiserfs for quota IO to work */ | 2066 | /* We must not pack tails for quota files on reiserfs for quota IO to work */ |
| 2071 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { | 2067 | if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { |
| 2072 | err = reiserfs_unpack(inode, NULL); | 2068 | err = reiserfs_unpack(inode, NULL); |
| @@ -2082,7 +2078,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
| 2082 | /* Journaling quota? */ | 2078 | /* Journaling quota? */ |
| 2083 | if (REISERFS_SB(sb)->s_qf_names[type]) { | 2079 | if (REISERFS_SB(sb)->s_qf_names[type]) { |
| 2084 | /* Quotafile not of fs root? */ | 2080 | /* Quotafile not of fs root? */ |
| 2085 | if (path.dentry->d_parent != sb->s_root) | 2081 | if (path->dentry->d_parent != sb->s_root) |
| 2086 | reiserfs_warning(sb, "super-6521", | 2082 | reiserfs_warning(sb, "super-6521", |
| 2087 | "Quota file not on filesystem root. " | 2083 | "Quota file not on filesystem root. " |
| 2088 | "Journalled quota will not work."); | 2084 | "Journalled quota will not work."); |
| @@ -2101,9 +2097,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id, | |||
| 2101 | if (err) | 2097 | if (err) |
| 2102 | goto out; | 2098 | goto out; |
| 2103 | } | 2099 | } |
| 2104 | err = dquot_quota_on_path(sb, type, format_id, &path); | 2100 | err = dquot_quota_on(sb, type, format_id, path); |
| 2105 | out: | 2101 | out: |
| 2106 | path_put(&path); | ||
| 2107 | return err; | 2102 | return err; |
| 2108 | } | 2103 | } |
| 2109 | 2104 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 956a35532f47..f6385fc17ad4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -470,6 +470,7 @@ static inline void set_compound_order(struct page *page, unsigned long order) | |||
| 470 | page[1].lru.prev = (void *)order; | 470 | page[1].lru.prev = (void *)order; |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | #ifdef CONFIG_MMU | ||
| 473 | /* | 474 | /* |
| 474 | * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when | 475 | * Do pte_mkwrite, but only if the vma says VM_WRITE. We do this when |
| 475 | * servicing faults for write access. In the normal case, do always want | 476 | * servicing faults for write access. In the normal case, do always want |
| @@ -482,6 +483,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma) | |||
| 482 | pte = pte_mkwrite(pte); | 483 | pte = pte_mkwrite(pte); |
| 483 | return pte; | 484 | return pte; |
| 484 | } | 485 | } |
| 486 | #endif | ||
| 485 | 487 | ||
| 486 | /* | 488 | /* |
| 487 | * Multiple processes may "see" the same page. E.g. for untouched | 489 | * Multiple processes may "see" the same page. E.g. for untouched |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 94c1f03b50eb..9a85412e0db6 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
| @@ -322,9 +322,12 @@ struct dquot_operations { | |||
| 322 | qsize_t *(*get_reserved_space) (struct inode *); | 322 | qsize_t *(*get_reserved_space) (struct inode *); |
| 323 | }; | 323 | }; |
| 324 | 324 | ||
| 325 | struct path; | ||
| 326 | |||
| 325 | /* Operations handling requests from userspace */ | 327 | /* Operations handling requests from userspace */ |
| 326 | struct quotactl_ops { | 328 | struct quotactl_ops { |
| 327 | int (*quota_on)(struct super_block *, int, int, char *); | 329 | int (*quota_on)(struct super_block *, int, int, struct path *); |
| 330 | int (*quota_on_meta)(struct super_block *, int, int); | ||
| 328 | int (*quota_off)(struct super_block *, int); | 331 | int (*quota_off)(struct super_block *, int); |
| 329 | int (*quota_sync)(struct super_block *, int, int); | 332 | int (*quota_sync)(struct super_block *, int, int); |
| 330 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); | 333 | int (*get_info)(struct super_block *, int, struct if_dqinfo *); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 223b14cd129c..eb354f6f26b3 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
| @@ -76,11 +76,9 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
| 76 | 76 | ||
| 77 | int dquot_file_open(struct inode *inode, struct file *file); | 77 | int dquot_file_open(struct inode *inode, struct file *file); |
| 78 | 78 | ||
| 79 | int dquot_quota_on(struct super_block *sb, int type, int format_id, | ||
| 80 | char *path); | ||
| 81 | int dquot_enable(struct inode *inode, int type, int format_id, | 79 | int dquot_enable(struct inode *inode, int type, int format_id, |
| 82 | unsigned int flags); | 80 | unsigned int flags); |
| 83 | int dquot_quota_on_path(struct super_block *sb, int type, int format_id, | 81 | int dquot_quota_on(struct super_block *sb, int type, int format_id, |
| 84 | struct path *path); | 82 | struct path *path); |
| 85 | int dquot_quota_on_mount(struct super_block *sb, char *qf_name, | 83 | int dquot_quota_on_mount(struct super_block *sb, char *qf_name, |
| 86 | int format_id, int type); | 84 | int format_id, int type); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 269dbff70b92..be4df4c6fd56 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -1721,7 +1721,9 @@ static void alc_apply_fixup(struct hda_codec *codec, int action) | |||
| 1721 | { | 1721 | { |
| 1722 | struct alc_spec *spec = codec->spec; | 1722 | struct alc_spec *spec = codec->spec; |
| 1723 | int id = spec->fixup_id; | 1723 | int id = spec->fixup_id; |
| 1724 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
| 1724 | const char *modelname = spec->fixup_name; | 1725 | const char *modelname = spec->fixup_name; |
| 1726 | #endif | ||
| 1725 | int depth = 0; | 1727 | int depth = 0; |
| 1726 | 1728 | ||
| 1727 | if (!spec->fixup_list) | 1729 | if (!spec->fixup_list) |
| @@ -10930,9 +10932,6 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) | |||
| 10930 | return 0; | 10932 | return 0; |
| 10931 | } | 10933 | } |
| 10932 | 10934 | ||
| 10933 | static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec, | ||
| 10934 | const struct auto_pin_cfg *cfg); | ||
| 10935 | |||
| 10936 | /* almost identical with ALC880 parser... */ | 10935 | /* almost identical with ALC880 parser... */ |
| 10937 | static int alc882_parse_auto_config(struct hda_codec *codec) | 10936 | static int alc882_parse_auto_config(struct hda_codec *codec) |
| 10938 | { | 10937 | { |
| @@ -10950,10 +10949,7 @@ static int alc882_parse_auto_config(struct hda_codec *codec) | |||
| 10950 | err = alc880_auto_fill_dac_nids(spec, &spec->autocfg); | 10949 | err = alc880_auto_fill_dac_nids(spec, &spec->autocfg); |
| 10951 | if (err < 0) | 10950 | if (err < 0) |
| 10952 | return err; | 10951 | return err; |
| 10953 | if (codec->vendor_id == 0x10ec0887) | 10952 | err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg); |
| 10954 | err = alc861vd_auto_create_multi_out_ctls(spec, &spec->autocfg); | ||
| 10955 | else | ||
| 10956 | err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg); | ||
| 10957 | if (err < 0) | 10953 | if (err < 0) |
| 10958 | return err; | 10954 | return err; |
| 10959 | err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0], | 10955 | err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0], |
| @@ -12635,6 +12631,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
| 12635 | ALC262_HP_BPC), | 12631 | ALC262_HP_BPC), |
| 12636 | SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series", | 12632 | SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series", |
| 12637 | ALC262_HP_BPC), | 12633 | ALC262_HP_BPC), |
| 12634 | SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series", | ||
| 12635 | ALC262_HP_BPC), | ||
| 12638 | SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series", | 12636 | SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series", |
| 12639 | ALC262_HP_BPC), | 12637 | ALC262_HP_BPC), |
| 12640 | SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), | 12638 | SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), |
| @@ -14957,6 +14955,7 @@ static struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 14957 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | 14955 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
| 14958 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), | 14956 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
| 14959 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | 14957 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
| 14958 | SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | ||
| 14960 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), | 14959 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
| 14961 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), | 14960 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
| 14962 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), | 14961 | SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), |
| @@ -17134,7 +17133,7 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec) | |||
| 17134 | #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) | 17133 | #define alc861vd_idx_to_mixer_switch(nid) ((nid) + 0x0c) |
| 17135 | 17134 | ||
| 17136 | /* add playback controls from the parsed DAC table */ | 17135 | /* add playback controls from the parsed DAC table */ |
| 17137 | /* Based on ALC880 version. But ALC861VD and ALC887 have separate, | 17136 | /* Based on ALC880 version. But ALC861VD has separate, |
| 17138 | * different NIDs for mute/unmute switch and volume control */ | 17137 | * different NIDs for mute/unmute switch and volume control */ |
| 17139 | static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec, | 17138 | static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec, |
| 17140 | const struct auto_pin_cfg *cfg) | 17139 | const struct auto_pin_cfg *cfg) |
| @@ -19461,6 +19460,7 @@ enum { | |||
| 19461 | ALC662_FIXUP_ASPIRE, | 19460 | ALC662_FIXUP_ASPIRE, |
| 19462 | ALC662_FIXUP_IDEAPAD, | 19461 | ALC662_FIXUP_IDEAPAD, |
| 19463 | ALC272_FIXUP_MARIO, | 19462 | ALC272_FIXUP_MARIO, |
| 19463 | ALC662_FIXUP_CZC_P10T, | ||
| 19464 | }; | 19464 | }; |
| 19465 | 19465 | ||
| 19466 | static const struct alc_fixup alc662_fixups[] = { | 19466 | static const struct alc_fixup alc662_fixups[] = { |
| @@ -19481,7 +19481,14 @@ static const struct alc_fixup alc662_fixups[] = { | |||
| 19481 | [ALC272_FIXUP_MARIO] = { | 19481 | [ALC272_FIXUP_MARIO] = { |
| 19482 | .type = ALC_FIXUP_FUNC, | 19482 | .type = ALC_FIXUP_FUNC, |
| 19483 | .v.func = alc272_fixup_mario, | 19483 | .v.func = alc272_fixup_mario, |
| 19484 | } | 19484 | }, |
| 19485 | [ALC662_FIXUP_CZC_P10T] = { | ||
| 19486 | .type = ALC_FIXUP_VERBS, | ||
| 19487 | .v.verbs = (const struct hda_verb[]) { | ||
| 19488 | {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0}, | ||
| 19489 | {} | ||
| 19490 | } | ||
| 19491 | }, | ||
| 19485 | }; | 19492 | }; |
| 19486 | 19493 | ||
| 19487 | static struct snd_pci_quirk alc662_fixup_tbl[] = { | 19494 | static struct snd_pci_quirk alc662_fixup_tbl[] = { |
| @@ -19489,6 +19496,7 @@ static struct snd_pci_quirk alc662_fixup_tbl[] = { | |||
| 19489 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | 19496 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
| 19490 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), | 19497 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
| 19491 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), | 19498 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
| 19499 | SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), | ||
| 19492 | {} | 19500 | {} |
| 19493 | }; | 19501 | }; |
| 19494 | 19502 | ||
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index 7b62de089fee..20c6b079d0df 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c | |||
| @@ -580,6 +580,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice) | |||
| 580 | { | 580 | { |
| 581 | int err; | 581 | int err; |
| 582 | struct snd_akm4xxx *ak; | 582 | struct snd_akm4xxx *ak; |
| 583 | unsigned char tmp; | ||
| 583 | 584 | ||
| 584 | if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 && | 585 | if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 && |
| 585 | ice->eeprom.gpiodir == 0x7b) | 586 | ice->eeprom.gpiodir == 0x7b) |
| @@ -622,6 +623,12 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice) | |||
| 622 | break; | 623 | break; |
| 623 | } | 624 | } |
| 624 | 625 | ||
| 626 | /* initialize the SPI clock to high */ | ||
| 627 | tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA); | ||
| 628 | tmp |= ICE1712_DELTA_AP_CCLK; | ||
| 629 | snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp); | ||
| 630 | udelay(5); | ||
| 631 | |||
| 625 | /* initialize spdif */ | 632 | /* initialize spdif */ |
| 626 | switch (ice->eeprom.subvendor) { | 633 | switch (ice->eeprom.subvendor) { |
| 627 | case ICE1712_SUBDEVICE_AUDIOPHILE: | 634 | case ICE1712_SUBDEVICE_AUDIOPHILE: |
diff --git a/sound/soc/blackfin/Kconfig b/sound/soc/blackfin/Kconfig index 3abeeddc67d3..ae403597fd31 100644 --- a/sound/soc/blackfin/Kconfig +++ b/sound/soc/blackfin/Kconfig | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | config SND_BF5XX_I2S | 1 | config SND_BF5XX_I2S |
| 2 | tristate "SoC I2S Audio for the ADI BF5xx chip" | 2 | tristate "SoC I2S Audio for the ADI BF5xx chip" |
| 3 | depends on BLACKFIN | 3 | depends on BLACKFIN |
| 4 | select SND_BF5XX_SOC_SPORT | ||
| 4 | help | 5 | help |
| 5 | Say Y or M if you want to add support for codecs attached to | 6 | Say Y or M if you want to add support for codecs attached to |
| 6 | the Blackfin SPORT (synchronous serial ports) interface in I2S | 7 | the Blackfin SPORT (synchronous serial ports) interface in I2S |
| @@ -35,6 +36,7 @@ config SND_BFIN_AD73311_SE | |||
| 35 | config SND_BF5XX_TDM | 36 | config SND_BF5XX_TDM |
| 36 | tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" | 37 | tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" |
| 37 | depends on (BLACKFIN && SND_SOC) | 38 | depends on (BLACKFIN && SND_SOC) |
| 39 | select SND_BF5XX_SOC_SPORT | ||
| 38 | help | 40 | help |
| 39 | Say Y or M if you want to add support for codecs attached to | 41 | Say Y or M if you want to add support for codecs attached to |
| 40 | the Blackfin SPORT (synchronous serial ports) interface in TDM | 42 | the Blackfin SPORT (synchronous serial ports) interface in TDM |
| @@ -61,6 +63,10 @@ config SND_BF5XX_SOC_AD193X | |||
| 61 | config SND_BF5XX_AC97 | 63 | config SND_BF5XX_AC97 |
| 62 | tristate "SoC AC97 Audio for the ADI BF5xx chip" | 64 | tristate "SoC AC97 Audio for the ADI BF5xx chip" |
| 63 | depends on BLACKFIN | 65 | depends on BLACKFIN |
| 66 | select AC97_BUS | ||
| 67 | select SND_SOC_AC97_BUS | ||
| 68 | select SND_BF5XX_SOC_SPORT | ||
| 69 | select SND_BF5XX_SOC_AC97 | ||
| 64 | help | 70 | help |
| 65 | Say Y or M if you want to add support for codecs attached to | 71 | Say Y or M if you want to add support for codecs attached to |
| 66 | the Blackfin SPORT (synchronous serial ports) interface in slot 16 | 72 | the Blackfin SPORT (synchronous serial ports) interface in slot 16 |
| @@ -122,17 +128,12 @@ config SND_BF5XX_SOC_SPORT | |||
| 122 | 128 | ||
| 123 | config SND_BF5XX_SOC_I2S | 129 | config SND_BF5XX_SOC_I2S |
| 124 | tristate | 130 | tristate |
| 125 | select SND_BF5XX_SOC_SPORT | ||
| 126 | 131 | ||
| 127 | config SND_BF5XX_SOC_TDM | 132 | config SND_BF5XX_SOC_TDM |
| 128 | tristate | 133 | tristate |
| 129 | select SND_BF5XX_SOC_SPORT | ||
| 130 | 134 | ||
| 131 | config SND_BF5XX_SOC_AC97 | 135 | config SND_BF5XX_SOC_AC97 |
| 132 | tristate | 136 | tristate |
| 133 | select AC97_BUS | ||
| 134 | select SND_SOC_AC97_BUS | ||
| 135 | select SND_BF5XX_SOC_SPORT | ||
| 136 | 137 | ||
| 137 | config SND_BF5XX_SPORT_NUM | 138 | config SND_BF5XX_SPORT_NUM |
| 138 | int "Set a SPORT for Sound chip" | 139 | int "Set a SPORT for Sound chip" |
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index c5f856ec27ca..ffbac26b9bce 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c | |||
| @@ -260,9 +260,9 @@ static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) | |||
| 260 | pr_debug("%s : sport %d\n", __func__, dai->id); | 260 | pr_debug("%s : sport %d\n", __func__, dai->id); |
| 261 | if (!dai->active) | 261 | if (!dai->active) |
| 262 | return 0; | 262 | return 0; |
| 263 | if (dai->capture.active) | 263 | if (dai->capture_active) |
| 264 | sport_rx_stop(sport); | 264 | sport_rx_stop(sport); |
| 265 | if (dai->playback.active) | 265 | if (dai->playback_active) |
| 266 | sport_tx_stop(sport); | 266 | sport_tx_stop(sport); |
| 267 | return 0; | 267 | return 0; |
| 268 | } | 268 | } |
diff --git a/sound/soc/blackfin/bf5xx-tdm.c b/sound/soc/blackfin/bf5xx-tdm.c index 125123929f16..5515ac9e05c7 100644 --- a/sound/soc/blackfin/bf5xx-tdm.c +++ b/sound/soc/blackfin/bf5xx-tdm.c | |||
| @@ -210,7 +210,7 @@ static int bf5xx_tdm_set_channel_map(struct snd_soc_dai *dai, | |||
| 210 | #ifdef CONFIG_PM | 210 | #ifdef CONFIG_PM |
| 211 | static int bf5xx_tdm_suspend(struct snd_soc_dai *dai) | 211 | static int bf5xx_tdm_suspend(struct snd_soc_dai *dai) |
| 212 | { | 212 | { |
| 213 | struct sport_device *sport = dai->private_data; | 213 | struct sport_device *sport = snd_soc_dai_get_drvdata(dai); |
| 214 | 214 | ||
| 215 | if (!dai->active) | 215 | if (!dai->active) |
| 216 | return 0; | 216 | return 0; |
| @@ -235,13 +235,13 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai) | |||
| 235 | ret = -EBUSY; | 235 | ret = -EBUSY; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | ret = sport_config_rx(sport, IRFS, 0x1F, 0, 0); | 238 | ret = sport_config_rx(sport, 0, 0x1F, 0, 0); |
| 239 | if (ret) { | 239 | if (ret) { |
| 240 | pr_err("SPORT is busy!\n"); | 240 | pr_err("SPORT is busy!\n"); |
| 241 | ret = -EBUSY; | 241 | ret = -EBUSY; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | ret = sport_config_tx(sport, ITFS, 0x1F, 0, 0); | 244 | ret = sport_config_tx(sport, 0, 0x1F, 0, 0); |
| 245 | if (ret) { | 245 | if (ret) { |
| 246 | pr_err("SPORT is busy!\n"); | 246 | pr_err("SPORT is busy!\n"); |
| 247 | ret = -EBUSY; | 247 | ret = -EBUSY; |
| @@ -303,14 +303,14 @@ static int __devinit bfin_tdm_probe(struct platform_device *pdev) | |||
| 303 | goto sport_config_err; | 303 | goto sport_config_err; |
| 304 | } | 304 | } |
| 305 | 305 | ||
| 306 | ret = sport_config_rx(sport_handle, IRFS, 0x1F, 0, 0); | 306 | ret = sport_config_rx(sport_handle, 0, 0x1F, 0, 0); |
| 307 | if (ret) { | 307 | if (ret) { |
| 308 | pr_err("SPORT is busy!\n"); | 308 | pr_err("SPORT is busy!\n"); |
| 309 | ret = -EBUSY; | 309 | ret = -EBUSY; |
| 310 | goto sport_config_err; | 310 | goto sport_config_err; |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | ret = sport_config_tx(sport_handle, ITFS, 0x1F, 0, 0); | 313 | ret = sport_config_tx(sport_handle, 0, 0x1F, 0, 0); |
| 314 | if (ret) { | 314 | if (ret) { |
| 315 | pr_err("SPORT is busy!\n"); | 315 | pr_err("SPORT is busy!\n"); |
| 316 | ret = -EBUSY; | 316 | ret = -EBUSY; |
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index 2d4f896d7fec..3ceaef68e01d 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c | |||
| @@ -104,6 +104,7 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = { | |||
| 104 | .name = "hsdet-gpio", | 104 | .name = "hsdet-gpio", |
| 105 | .report = SND_JACK_HEADSET, | 105 | .report = SND_JACK_HEADSET, |
| 106 | .debounce_time = 200, | 106 | .debounce_time = 200, |
| 107 | .invert = 1, | ||
| 107 | }, | 108 | }, |
| 108 | }; | 109 | }; |
| 109 | 110 | ||
| @@ -192,7 +193,7 @@ static struct snd_soc_dai_link z2_dai = { | |||
| 192 | .cpu_dai_name = "pxa2xx-i2s", | 193 | .cpu_dai_name = "pxa2xx-i2s", |
| 193 | .codec_dai_name = "wm8750-hifi", | 194 | .codec_dai_name = "wm8750-hifi", |
| 194 | .platform_name = "pxa-pcm-audio", | 195 | .platform_name = "pxa-pcm-audio", |
| 195 | .codec_name = "wm8750-codec.0-001a", | 196 | .codec_name = "wm8750-codec.0-001b", |
| 196 | .init = z2_wm8750_init, | 197 | .init = z2_wm8750_init, |
| 197 | .ops = &z2_ops, | 198 | .ops = &z2_ops, |
| 198 | }; | 199 | }; |
