aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DocBook/media/v4l/pixfmt.xml4
-rw-r--r--Documentation/DocBook/media/v4l/v4l2.xml2
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-create-bufs.xml5
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-dqevent.xml2
-rw-r--r--Documentation/stable_kernel_rules.txt6
-rw-r--r--Makefile2
-rw-r--r--arch/arm/mach-exynos/Kconfig8
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c6
-rw-r--r--arch/arm/mach-omap2/board-flash.c5
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c5
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9d.c1
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c1
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c3
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c8
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c7
-rw-r--r--arch/arm/mach-shmobile/platsmp.c5
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c2
-rw-r--r--arch/arm/mm/dma-mapping.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2_cam.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/map-s3c.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/watchdog-reset.h2
-rw-r--r--arch/m68k/platform/coldfire/clk.c7
-rw-r--r--arch/powerpc/include/asm/hw_irq.h5
-rw-r--r--arch/powerpc/kernel/entry_64.S97
-rw-r--r--arch/powerpc/kernel/irq.c2
-rw-r--r--arch/powerpc/kernel/prom_init.c4
-rw-r--r--arch/powerpc/mm/numa.c2
-rw-r--r--arch/powerpc/net/bpf_jit_64.S2
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/pseries/processor_idle.c2
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c4
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7343.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7366.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7734.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-shx3.c2
-rw-r--r--arch/x86/ia32/ia32_signal.c2
-rw-r--r--arch/x86/include/asm/cpufeature.h2
-rw-r--r--arch/x86/kernel/acpi/boot.c27
-rw-r--r--arch/x86/kernel/cpu/mkcapflags.pl25
-rw-r--r--arch/x86/kernel/cpu/scattered.c2
-rw-r--r--arch/x86/kernel/kgdb.c8
-rw-r--r--arch/x86/kernel/reboot.c8
-rw-r--r--arch/x86/lib/csum-wrappers_64.c2
-rw-r--r--drivers/acpi/acpi_pad.c7
-rw-r--r--drivers/acpi/apei/apei-base.c17
-rw-r--r--drivers/acpi/apei/apei-internal.h9
-rw-r--r--drivers/acpi/apei/ghes.c6
-rw-r--r--drivers/acpi/processor_idle.c32
-rw-r--r--drivers/acpi/sysfs.c4
-rw-r--r--drivers/acpi/video.c2
-rw-r--r--drivers/base/power/main.c6
-rw-r--r--drivers/bluetooth/ath3k.c3
-rw-r--r--drivers/bluetooth/btmrvl_drv.h2
-rw-r--r--drivers/bluetooth/btmrvl_main.c14
-rw-r--r--drivers/bluetooth/btmrvl_sdio.c8
-rw-r--r--drivers/bluetooth/btusb.c2
-rw-r--r--drivers/clk/clk.c26
-rw-r--r--drivers/clk/mxs/clk-imx23.c12
-rw-r--r--drivers/clk/mxs/clk-imx28.c32
-rw-r--r--drivers/clk/spear/spear6xx_clock.c2
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c1
-rw-r--r--drivers/gpu/drm/i915/i915_suspend.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c16
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_prime.c23
-rw-r--r--drivers/gpu/drm/udl/udl_main.c2
-rw-r--r--drivers/hid/Kconfig43
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/hid-logitech-dj.c38
-rw-r--r--drivers/hid/hid-magicmouse.c6
-rw-r--r--drivers/hid/usbhid/Kconfig8
-rw-r--r--drivers/hwmon/applesmc.c2
-rw-r--r--drivers/hwmon/coretemp.c4
-rw-r--r--drivers/hwmon/jc42.c2
-rw-r--r--drivers/hwmon/lineage-pem.c2
-rw-r--r--drivers/hwmon/ltc4261.c2
-rw-r--r--drivers/hwmon/max16065.c2
-rw-r--r--drivers/media/common/saa7146_fops.c5
-rw-r--r--drivers/media/dvb/frontends/cx24110.c4
-rw-r--r--drivers/media/dvb/frontends/cxd2820r_c.c2
-rw-r--r--drivers/media/dvb/frontends/lg2160.c2
-rw-r--r--drivers/media/dvb/siano/smsusb.c2
-rw-r--r--drivers/media/radio/radio-maxiradio.c2
-rw-r--r--drivers/media/radio/radio-sf16fmr2.c2
-rw-r--r--drivers/media/radio/si470x/radio-si470x-usb.c2
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c84
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c5
-rw-r--r--drivers/media/video/bt8xx/bttv.h1
-rw-r--r--drivers/media/video/bt8xx/bttvp.h1
-rw-r--r--drivers/media/video/bw-qcam.c47
-rw-r--r--drivers/media/video/cx18/cx18-driver.c10
-rw-r--r--drivers/media/video/cx18/cx18-driver.h2
-rw-r--r--drivers/media/video/cx18/cx18-firmware.c9
-rw-r--r--drivers/media/video/cx18/cx18-mailbox.c15
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c2
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c1
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c2
-rw-r--r--drivers/media/video/gspca/gspca.c4
-rw-r--r--drivers/media/video/gspca/ov534.c32
-rw-r--r--drivers/media/video/gspca/ov534_9.c1
-rw-r--r--drivers/media/video/gspca/pac7311.c2
-rw-r--r--drivers/media/video/gspca/sn9c20x.c24
-rw-r--r--drivers/media/video/gspca/sonixj.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c18
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.h2
-rw-r--r--drivers/media/video/mem2mem_testdev.c50
-rw-r--r--drivers/media/video/mx2_camera.c52
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c2
-rw-r--r--drivers/media/video/s5p-mfc/regs-mfc.h5
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_dec.c4
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_enc.c12
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_opr.h4
-rw-r--r--drivers/media/video/s5p-mfc/s5p_mfc_shm.h3
-rw-r--r--drivers/media/video/smiapp/Kconfig2
-rw-r--r--drivers/media/video/smiapp/smiapp-core.c1
-rw-r--r--drivers/media/video/tuner-core.c2
-rw-r--r--drivers/media/video/v4l2-dev.c4
-rw-r--r--drivers/media/video/v4l2-ioctl.c1
-rw-r--r--drivers/media/video/vino.c4
-rw-r--r--drivers/media/video/vivi.c6
-rw-r--r--drivers/mmc/card/block.c14
-rw-r--r--drivers/mmc/host/omap_hsmmc.c15
-rw-r--r--drivers/mtd/ubi/debug.c8
-rw-r--r--drivers/net/bonding/bond_procfs.c15
-rw-r--r--drivers/net/caif/caif_hsi.c5
-rw-r--r--drivers/net/can/c_can/c_can.c4
-rw-r--r--drivers/net/can/flexcan.c4
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c8
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c54
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.c12
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.h2
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c2
-rw-r--r--drivers/net/ethernet/intel/Kconfig10
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c16
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c13
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c18
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h1
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c2
-rw-r--r--drivers/net/ethernet/realtek/r8169.c1
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c12
-rw-r--r--drivers/net/phy/micrel.c8
-rw-r--r--drivers/net/usb/ipheth.c5
-rw-r--r--drivers/net/usb/qmi_wwan.c83
-rw-r--r--drivers/net/usb/usbnet.c53
-rw-r--r--drivers/net/wireless/airo.c4
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c27
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c31
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c6
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c25
-rw-r--r--drivers/net/wireless/mwifiex/txrx.c10
-rw-r--r--drivers/net/wireless/mwifiex/uap_cmd.c11
-rw-r--r--drivers/net/wireless/rndis_wlan.c2
-rw-r--r--drivers/net/wireless/ti/wl1251/acx.c2
-rw-r--r--drivers/net/wireless/ti/wl1251/event.c3
-rw-r--r--drivers/net/wireless/ti/wl1251/spi.c4
-rw-r--r--drivers/net/xen-netfront.c8
-rw-r--r--drivers/oprofile/oprofile_perf.c2
-rw-r--r--drivers/regulator/palmas-regulator.c7
-rw-r--r--drivers/regulator/tps65023-regulator.c2
-rw-r--r--drivers/regulator/tps6524x-regulator.c2
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/staging/media/lirc/lirc_serial.c6
-rw-r--r--drivers/usb/Makefile2
-rw-r--r--drivers/usb/dwc3/gadget.c3
-rw-r--r--drivers/usb/gadget/fsl_qe_udc.h4
-rw-r--r--drivers/usb/gadget/lpc32xx_udc.c1
-rw-r--r--drivers/usb/musb/musb_host.c14
-rw-r--r--drivers/usb/otg/twl6030-usb.c15
-rw-r--r--drivers/usb/phy/Kconfig4
-rw-r--r--drivers/usb/serial/cp210x.c11
-rw-r--r--drivers/usb/serial/option.c8
-rw-r--r--drivers/usb/storage/scsiglue.c6
-rw-r--r--drivers/usb/storage/unusual_devs.h7
-rw-r--r--drivers/vhost/vhost.c3
-rw-r--r--drivers/watchdog/hpwdt.c4
-rw-r--r--drivers/watchdog/iTCO_wdt.c1
-rw-r--r--drivers/watchdog/watchdog_dev.c2
-rw-r--r--fs/ubifs/debug.c8
-rw-r--r--fs/ubifs/find.c4
-rw-r--r--fs/udf/super.c102
-rw-r--r--include/asm-generic/bug.h19
-rw-r--r--include/linux/irq.h2
-rw-r--r--include/linux/skbuff.h7
-rw-r--r--include/linux/videodev2.h6
-rw-r--r--include/net/bluetooth/hci.h6
-rw-r--r--include/net/mac80211.h6
-rw-r--r--include/net/phonet/gprs.h2
-rw-r--r--include/scsi/scsi_device.h1
-rw-r--r--include/sound/tea575x-tuner.h3
-rw-r--r--kernel/printk.c299
-rw-r--r--kernel/rcutree.c14
-rw-r--r--net/9p/protocol.c2
-rw-r--r--net/batman-adv/routing.c2
-rw-r--r--net/batman-adv/translation-table.c12
-rw-r--r--net/bluetooth/hci_event.c48
-rw-r--r--net/bluetooth/hidp/Kconfig2
-rw-r--r--net/bluetooth/l2cap_core.c21
-rw-r--r--net/bluetooth/mgmt.c20
-rw-r--r--net/bluetooth/smp.c11
-rw-r--r--net/bridge/br_if.c1
-rw-r--r--net/bridge/br_netlink.c2
-rw-r--r--net/bridge/br_private.h1
-rw-r--r--net/caif/caif_dev.c3
-rw-r--r--net/caif/caif_socket.c1
-rw-r--r--net/can/raw.c3
-rw-r--r--net/core/dev.c23
-rw-r--r--net/ipv6/ip6_fib.c4
-rw-r--r--net/ipv6/route.c41
-rw-r--r--net/ipv6/tcp_ipv6.c3
-rw-r--r--net/iucv/af_iucv.c1
-rw-r--r--net/l2tp/l2tp_eth.c45
-rw-r--r--net/mac80211/cfg.c3
-rw-r--r--net/mac80211/mlme.c4
-rw-r--r--net/mac80211/sta_info.h5
-rw-r--r--net/mac802154/tx.c3
-rw-r--r--net/phonet/af_phonet.c4
-rw-r--r--net/phonet/datagram.c4
-rw-r--r--net/phonet/pep-gprs.c2
-rw-r--r--net/phonet/pep.c2
-rw-r--r--net/phonet/pn_dev.c4
-rw-r--r--net/phonet/pn_netlink.c4
-rw-r--r--net/phonet/socket.c4
-rw-r--r--net/phonet/sysctl.c2
-rw-r--r--net/sctp/protocol.c2
-rw-r--r--net/wireless/reg.c2
-rw-r--r--net/wireless/util.c2
-rwxr-xr-x[-rw-r--r--]scripts/gfp-translate0
-rw-r--r--sound/i2c/other/tea575x-tuner.c21
-rw-r--r--sound/pci/es1968.c2
-rw-r--r--sound/pci/fm801.c4
-rw-r--r--sound/pci/hda/Kconfig13
-rw-r--r--sound/pci/hda/hda_auto_parser.c1
-rw-r--r--sound/pci/hda/hda_auto_parser.h10
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/patch_conexant.c6
-rw-r--r--sound/pci/hda/patch_realtek.c15
-rw-r--r--sound/pci/hda/patch_sigmatel.c7
-rw-r--r--sound/soc/codecs/wm8994.c3
-rw-r--r--sound/usb/mixer_maps.c8
-rw-r--r--sound/usb/quirks-table.h30
257 files changed, 1564 insertions, 1061 deletions
diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index f5ac15ed0549..e58934c92895 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -986,13 +986,13 @@ http://www.thedirks.org/winnov/</ulink></para></entry>
986 <row id="V4L2-PIX-FMT-Y4"> 986 <row id="V4L2-PIX-FMT-Y4">
987 <entry><constant>V4L2_PIX_FMT_Y4</constant></entry> 987 <entry><constant>V4L2_PIX_FMT_Y4</constant></entry>
988 <entry>'Y04 '</entry> 988 <entry>'Y04 '</entry>
989 <entry>Old 4-bit greyscale format. Only the least significant 4 bits of each byte are used, 989 <entry>Old 4-bit greyscale format. Only the most significant 4 bits of each byte are used,
990the other bits are set to 0.</entry> 990the other bits are set to 0.</entry>
991 </row> 991 </row>
992 <row id="V4L2-PIX-FMT-Y6"> 992 <row id="V4L2-PIX-FMT-Y6">
993 <entry><constant>V4L2_PIX_FMT_Y6</constant></entry> 993 <entry><constant>V4L2_PIX_FMT_Y6</constant></entry>
994 <entry>'Y06 '</entry> 994 <entry>'Y06 '</entry>
995 <entry>Old 6-bit greyscale format. Only the least significant 6 bits of each byte are used, 995 <entry>Old 6-bit greyscale format. Only the most significant 6 bits of each byte are used,
996the other bits are set to 0.</entry> 996the other bits are set to 0.</entry>
997 </row> 997 </row>
998 </tbody> 998 </tbody>
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index 015c561754b7..008c2d73a484 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -560,6 +560,7 @@ and discussions on the V4L mailing list.</revremark>
560 &sub-g-tuner; 560 &sub-g-tuner;
561 &sub-log-status; 561 &sub-log-status;
562 &sub-overlay; 562 &sub-overlay;
563 &sub-prepare-buf;
563 &sub-qbuf; 564 &sub-qbuf;
564 &sub-querybuf; 565 &sub-querybuf;
565 &sub-querycap; 566 &sub-querycap;
@@ -567,7 +568,6 @@ and discussions on the V4L mailing list.</revremark>
567 &sub-query-dv-preset; 568 &sub-query-dv-preset;
568 &sub-query-dv-timings; 569 &sub-query-dv-timings;
569 &sub-querystd; 570 &sub-querystd;
570 &sub-prepare-buf;
571 &sub-reqbufs; 571 &sub-reqbufs;
572 &sub-s-hw-freq-seek; 572 &sub-s-hw-freq-seek;
573 &sub-streamon; 573 &sub-streamon;
diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
index 765549ff8a71..a2474ecb574a 100644
--- a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml
@@ -108,10 +108,9 @@ information.</para>
108/></entry> 108/></entry>
109 </row> 109 </row>
110 <row> 110 <row>
111 <entry>__u32</entry> 111 <entry>struct&nbsp;v4l2_format</entry>
112 <entry><structfield>format</structfield></entry> 112 <entry><structfield>format</structfield></entry>
113 <entry>Filled in by the application, preserved by the driver. 113 <entry>Filled in by the application, preserved by the driver.</entry>
114 See <xref linkend="v4l2-format" />.</entry>
115 </row> 114 </row>
116 <row> 115 <row>
117 <entry>__u32</entry> 116 <entry>__u32</entry>
diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
index e8714aa16433..98a856f9ec30 100644
--- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml
@@ -89,7 +89,7 @@
89 <row> 89 <row>
90 <entry></entry> 90 <entry></entry>
91 <entry>&v4l2-event-frame-sync;</entry> 91 <entry>&v4l2-event-frame-sync;</entry>
92 <entry><structfield>frame</structfield></entry> 92 <entry><structfield>frame_sync</structfield></entry>
93 <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry> 93 <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry>
94 </row> 94 </row>
95 <row> 95 <row>
diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt
index f0ab5cf28fca..4a7b54bd37e8 100644
--- a/Documentation/stable_kernel_rules.txt
+++ b/Documentation/stable_kernel_rules.txt
@@ -12,6 +12,12 @@ Rules on what kind of patches are accepted, and which ones are not, into the
12 marked CONFIG_BROKEN), an oops, a hang, data corruption, a real 12 marked CONFIG_BROKEN), an oops, a hang, data corruption, a real
13 security issue, or some "oh, that's not good" issue. In short, something 13 security issue, or some "oh, that's not good" issue. In short, something
14 critical. 14 critical.
15 - Serious issues as reported by a user of a distribution kernel may also
16 be considered if they fix a notable performance or interactivity issue.
17 As these fixes are not as obvious and have a higher risk of a subtle
18 regression they should only be submitted by a distribution kernel
19 maintainer and include an addendum linking to a bugzilla entry if it
20 exists and additional information on the user-visible impact.
15 - New device IDs and quirks are also accepted. 21 - New device IDs and quirks are also accepted.
16 - No "theoretical race condition" issues, unless an explanation of how the 22 - No "theoretical race condition" issues, unless an explanation of how the
17 race can be exploited is also provided. 23 race can be exploited is also provided.
diff --git a/Makefile b/Makefile
index 3fdfde2c1b7d..81ea15450049 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 3 1VERSION = 3
2PATCHLEVEL = 5 2PATCHLEVEL = 5
3SUBLEVEL = 0 3SUBLEVEL = 0
4EXTRAVERSION = -rc4 4EXTRAVERSION = -rc5
5NAME = Saber-toothed Squirrel 5NAME = Saber-toothed Squirrel
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 573be57d3d28..6f6d13f91e4c 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -212,7 +212,7 @@ config MACH_SMDKV310
212 select EXYNOS_DEV_SYSMMU 212 select EXYNOS_DEV_SYSMMU
213 select EXYNOS4_DEV_AHCI 213 select EXYNOS4_DEV_AHCI
214 select SAMSUNG_DEV_KEYPAD 214 select SAMSUNG_DEV_KEYPAD
215 select EXYNOS4_DEV_DMA 215 select EXYNOS_DEV_DMA
216 select SAMSUNG_DEV_PWM 216 select SAMSUNG_DEV_PWM
217 select EXYNOS4_DEV_USB_OHCI 217 select EXYNOS4_DEV_USB_OHCI
218 select EXYNOS4_SETUP_FIMD0 218 select EXYNOS4_SETUP_FIMD0
@@ -264,7 +264,7 @@ config MACH_UNIVERSAL_C210
264 select S5P_DEV_ONENAND 264 select S5P_DEV_ONENAND
265 select S5P_DEV_TV 265 select S5P_DEV_TV
266 select EXYNOS_DEV_SYSMMU 266 select EXYNOS_DEV_SYSMMU
267 select EXYNOS4_DEV_DMA 267 select EXYNOS_DEV_DMA
268 select EXYNOS_DEV_DRM 268 select EXYNOS_DEV_DRM
269 select EXYNOS4_SETUP_FIMD0 269 select EXYNOS4_SETUP_FIMD0
270 select EXYNOS4_SETUP_I2C1 270 select EXYNOS4_SETUP_I2C1
@@ -303,7 +303,7 @@ config MACH_NURI
303 select S5P_DEV_MFC 303 select S5P_DEV_MFC
304 select S5P_DEV_USB_EHCI 304 select S5P_DEV_USB_EHCI
305 select S5P_SETUP_MIPIPHY 305 select S5P_SETUP_MIPIPHY
306 select EXYNOS4_DEV_DMA 306 select EXYNOS_DEV_DMA
307 select EXYNOS_DEV_DRM 307 select EXYNOS_DEV_DRM
308 select EXYNOS4_SETUP_FIMC 308 select EXYNOS4_SETUP_FIMC
309 select EXYNOS4_SETUP_FIMD0 309 select EXYNOS4_SETUP_FIMD0
@@ -341,7 +341,7 @@ config MACH_ORIGEN
341 select SAMSUNG_DEV_PWM 341 select SAMSUNG_DEV_PWM
342 select EXYNOS_DEV_DRM 342 select EXYNOS_DEV_DRM
343 select EXYNOS_DEV_SYSMMU 343 select EXYNOS_DEV_SYSMMU
344 select EXYNOS4_DEV_DMA 344 select EXYNOS_DEV_DMA
345 select EXYNOS4_DEV_USB_OHCI 345 select EXYNOS4_DEV_USB_OHCI
346 select EXYNOS4_SETUP_FIMD0 346 select EXYNOS4_SETUP_FIMD0
347 select EXYNOS4_SETUP_SDHCI 347 select EXYNOS4_SETUP_SDHCI
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 17dc66a085a5..e1a17ac7b3b4 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -152,13 +152,14 @@ enum mx6q_clks {
152 ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3, 152 ssi2, ssi3, uart_ipg, uart_serial, usboh3, usdhc1, usdhc2, usdhc3,
153 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg, 153 usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
154 pll4_audio, pll5_video, pll6_mlb, pll7_usb_host, pll8_enet, ssi1_ipg, 154 pll4_audio, pll5_video, pll6_mlb, pll7_usb_host, pll8_enet, ssi1_ipg,
155 ssi2_ipg, ssi3_ipg, clk_max 155 ssi2_ipg, ssi3_ipg, rom,
156 clk_max
156}; 157};
157 158
158static struct clk *clk[clk_max]; 159static struct clk *clk[clk_max];
159 160
160static enum mx6q_clks const clks_init_on[] __initconst = { 161static enum mx6q_clks const clks_init_on[] __initconst = {
161 mmdc_ch0_axi, mmdc_ch1_axi, 162 mmdc_ch0_axi, rom,
162}; 163};
163 164
164int __init mx6q_clocks_init(void) 165int __init mx6q_clocks_init(void)
@@ -364,6 +365,7 @@ int __init mx6q_clocks_init(void)
364 clk[gpmi_bch] = imx_clk_gate2("gpmi_bch", "usdhc4", base + 0x78, 26); 365 clk[gpmi_bch] = imx_clk_gate2("gpmi_bch", "usdhc4", base + 0x78, 26);
365 clk[gpmi_io] = imx_clk_gate2("gpmi_io", "enfc", base + 0x78, 28); 366 clk[gpmi_io] = imx_clk_gate2("gpmi_io", "enfc", base + 0x78, 28);
366 clk[gpmi_apb] = imx_clk_gate2("gpmi_apb", "usdhc3", base + 0x78, 30); 367 clk[gpmi_apb] = imx_clk_gate2("gpmi_apb", "usdhc3", base + 0x78, 30);
368 clk[rom] = imx_clk_gate2("rom", "ahb", base + 0x7c, 0);
367 clk[sata] = imx_clk_gate2("sata", "ipg", base + 0x7c, 4); 369 clk[sata] = imx_clk_gate2("sata", "ipg", base + 0x7c, 4);
368 clk[sdma] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6); 370 clk[sdma] = imx_clk_gate2("sdma", "ahb", base + 0x7c, 6);
369 clk[spba] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12); 371 clk[spba] = imx_clk_gate2("spba", "ipg", base + 0x7c, 12);
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 70a81f900bb5..53c39d239d6e 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
97 97
98 gpmc_onenand_init(&board_onenand_data); 98 gpmc_onenand_init(&board_onenand_data);
99} 99}
100#else
101void
102__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
103{
104}
105#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ 100#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
106 101
107#if defined(CONFIG_MTD_NAND_OMAP2) || \ 102#if defined(CONFIG_MTD_NAND_OMAP2) || \
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index e2b701e164f6..ba6f9a0a43e9 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3417,9 +3417,12 @@ int __init omap4xxx_clk_init(void)
3417 if (cpu_is_omap443x()) { 3417 if (cpu_is_omap443x()) {
3418 cpu_mask = RATE_IN_4430; 3418 cpu_mask = RATE_IN_4430;
3419 cpu_clkflg = CK_443X; 3419 cpu_clkflg = CK_443X;
3420 } else if (cpu_is_omap446x()) { 3420 } else if (cpu_is_omap446x() || cpu_is_omap447x()) {
3421 cpu_mask = RATE_IN_4460 | RATE_IN_4430; 3421 cpu_mask = RATE_IN_4460 | RATE_IN_4430;
3422 cpu_clkflg = CK_446X | CK_443X; 3422 cpu_clkflg = CK_446X | CK_443X;
3423
3424 if (cpu_is_omap447x())
3425 pr_warn("WARNING: OMAP4470 clock data incomplete!\n");
3423 } else { 3426 } else {
3424 return 0; 3427 return 0;
3425 } 3428 }
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 9e37026ef9dd..9bd135531d76 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -779,6 +779,7 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
779 .init_irq = r8a7740_init_irq, 779 .init_irq = r8a7740_init_irq,
780 .handle_irq = shmobile_handle_irq_intc, 780 .handle_irq = shmobile_handle_irq_intc,
781 .init_machine = eva_init, 781 .init_machine = eva_init,
782 .init_late = shmobile_init_late,
782 .timer = &shmobile_timer, 783 .timer = &shmobile_timer,
783 .dt_compat = eva_boards_compat_dt, 784 .dt_compat = eva_boards_compat_dt,
784MACHINE_END 785MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9d.c b/arch/arm/mach-shmobile/board-kzm9d.c
index 7bc5e7d39f9b..6a33cf393428 100644
--- a/arch/arm/mach-shmobile/board-kzm9d.c
+++ b/arch/arm/mach-shmobile/board-kzm9d.c
@@ -80,6 +80,7 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d")
80 .init_irq = emev2_init_irq, 80 .init_irq = emev2_init_irq,
81 .handle_irq = gic_handle_irq, 81 .handle_irq = gic_handle_irq,
82 .init_machine = kzm9d_add_standard_devices, 82 .init_machine = kzm9d_add_standard_devices,
83 .init_late = shmobile_init_late,
83 .timer = &shmobile_timer, 84 .timer = &shmobile_timer,
84 .dt_compat = kzm9d_boards_compat_dt, 85 .dt_compat = kzm9d_boards_compat_dt,
85MACHINE_END 86MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index d8e33b682832..c0ae815e7beb 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -455,6 +455,7 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
455 .init_irq = sh73a0_init_irq, 455 .init_irq = sh73a0_init_irq,
456 .handle_irq = gic_handle_irq, 456 .handle_irq = gic_handle_irq,
457 .init_machine = kzm_init, 457 .init_machine = kzm_init,
458 .init_late = shmobile_init_late,
458 .timer = &shmobile_timer, 459 .timer = &shmobile_timer,
459 .dt_compat = kzm9g_boards_compat_dt, 460 .dt_compat = kzm9g_boards_compat_dt,
460MACHINE_END 461MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index b577f7c44678..150122a44630 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1512,6 +1512,9 @@ static void __init mackerel_init(void)
1512 gpio_request(GPIO_FN_SDHID0_1, NULL); 1512 gpio_request(GPIO_FN_SDHID0_1, NULL);
1513 gpio_request(GPIO_FN_SDHID0_0, NULL); 1513 gpio_request(GPIO_FN_SDHID0_0, NULL);
1514 1514
1515 /* SDHI0 PORT172 card-detect IRQ26 */
1516 gpio_request(GPIO_FN_IRQ26_172, NULL);
1517
1515#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1518#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1516 /* enable SDHI1 */ 1519 /* enable SDHI1 */
1517 gpio_request(GPIO_FN_SDHICMD1, NULL); 1520 gpio_request(GPIO_FN_SDHICMD1, NULL);
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 472d1f5361e5..3946c4ba2aa8 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -475,9 +475,9 @@ static struct clk *late_main_clks[] = {
475 475
476enum { MSTP001, 476enum { MSTP001,
477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, 477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
478 MSTP219, 478 MSTP219, MSTP218,
479 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 479 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
480 MSTP331, MSTP329, MSTP325, MSTP323, MSTP318, 480 MSTP331, MSTP329, MSTP325, MSTP323,
481 MSTP314, MSTP313, MSTP312, MSTP311, 481 MSTP314, MSTP313, MSTP312, MSTP311,
482 MSTP303, MSTP302, MSTP301, MSTP300, 482 MSTP303, MSTP302, MSTP301, MSTP300,
483 MSTP411, MSTP410, MSTP403, 483 MSTP411, MSTP410, MSTP403,
@@ -497,6 +497,7 @@ static struct clk mstp_clks[MSTP_NR] = {
497 [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ 497 [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */
498 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ 498 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
499 [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ 499 [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */
500 [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* SY-DMAC */
500 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 501 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
501 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 502 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
502 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ 503 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
@@ -508,7 +509,6 @@ static struct clk mstp_clks[MSTP_NR] = {
508 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 509 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
509 [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */ 510 [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
510 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ 511 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
511 [MSTP318] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 18, 0), /* SY-DMAC */
512 [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */ 512 [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */
513 [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */ 513 [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */
514 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ 514 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
@@ -552,6 +552,7 @@ static struct clk_lookup lookups[] = {
552 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 552 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
553 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 553 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
554 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ 554 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
555 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */
555 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 556 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
556 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ 557 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
557 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ 558 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
@@ -563,7 +564,6 @@ static struct clk_lookup lookups[] = {
563 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ 564 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
564 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ 565 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
565 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 566 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
566 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP318]), /* SY-DMAC */
567 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 567 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
568 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ 568 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
569 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ 569 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
index 550b23df4fd4..f04fad4ec4fb 100644
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ b/arch/arm/mach-shmobile/intc-r8a7779.c
@@ -35,6 +35,9 @@
35#define INT2SMSKCR3 0xfe7822ac 35#define INT2SMSKCR3 0xfe7822ac
36#define INT2SMSKCR4 0xfe7822b0 36#define INT2SMSKCR4 0xfe7822b0
37 37
38#define INT2NTSR0 0xfe700060
39#define INT2NTSR1 0xfe700064
40
38static int r8a7779_set_wake(struct irq_data *data, unsigned int on) 41static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
39{ 42{
40 return 0; /* always allow wakeup */ 43 return 0; /* always allow wakeup */
@@ -49,6 +52,10 @@ void __init r8a7779_init_irq(void)
49 gic_init(0, 29, gic_dist_base, gic_cpu_base); 52 gic_init(0, 29, gic_dist_base, gic_cpu_base);
50 gic_arch_extn.irq_set_wake = r8a7779_set_wake; 53 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
51 54
55 /* route all interrupts to ARM */
56 __raw_writel(0xffffffff, INT2NTSR0);
57 __raw_writel(0x3fffffff, INT2NTSR1);
58
52 /* unmask all known interrupts in INTCS2 */ 59 /* unmask all known interrupts in INTCS2 */
53 __raw_writel(0xfffffff0, INT2SMSKCR0); 60 __raw_writel(0xfffffff0, INT2SMSKCR0);
54 __raw_writel(0xfff7ffff, INT2SMSKCR1); 61 __raw_writel(0xfff7ffff, INT2SMSKCR1);
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index bacdd667e3b1..e859fcdb3d58 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -25,7 +25,12 @@
25#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \ 25#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \
26 of_machine_is_compatible("renesas,sh73a0")) 26 of_machine_is_compatible("renesas,sh73a0"))
27#define is_r8a7779() machine_is_marzen() 27#define is_r8a7779() machine_is_marzen()
28
29#ifdef CONFIG_ARCH_EMEV2
28#define is_emev2() of_machine_is_compatible("renesas,emev2") 30#define is_emev2() of_machine_is_compatible("renesas,emev2")
31#else
32#define is_emev2() (0)
33#endif
29 34
30static unsigned int __init shmobile_smp_get_core_count(void) 35static unsigned int __init shmobile_smp_get_core_count(void)
31{ 36{
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 6a4bd582c028..fafce9ce8218 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -484,7 +484,7 @@ static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
484 }, 484 },
485}; 485};
486 486
487#define SH7372_CHCLR 0x220 487#define SH7372_CHCLR (0x220 - 0x20)
488 488
489static const struct sh_dmae_channel sh7372_dmae_channels[] = { 489static const struct sh_dmae_channel sh7372_dmae_channels[] = {
490 { 490 {
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index d766e4256b74..4044abcf6f9d 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1067,7 +1067,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size, gfp_t
1067 return NULL; 1067 return NULL;
1068 1068
1069 while (count) { 1069 while (count) {
1070 int j, order = __ffs(count); 1070 int j, order = __fls(count);
1071 1071
1072 pages[i] = alloc_pages(gfp | __GFP_NOWARN, order); 1072 pages[i] = alloc_pages(gfp | __GFP_NOWARN, order);
1073 while (!pages[i] && order) 1073 while (!pages[i] && order)
diff --git a/arch/arm/plat-mxc/include/mach/mx2_cam.h b/arch/arm/plat-mxc/include/mach/mx2_cam.h
index 7ded6f1f74bc..3c080a32dbf5 100644
--- a/arch/arm/plat-mxc/include/mach/mx2_cam.h
+++ b/arch/arm/plat-mxc/include/mach/mx2_cam.h
@@ -23,6 +23,7 @@
23#ifndef __MACH_MX2_CAM_H_ 23#ifndef __MACH_MX2_CAM_H_
24#define __MACH_MX2_CAM_H_ 24#define __MACH_MX2_CAM_H_
25 25
26#define MX2_CAMERA_SWAP16 (1 << 0)
26#define MX2_CAMERA_EXT_VSYNC (1 << 1) 27#define MX2_CAMERA_EXT_VSYNC (1 << 1)
27#define MX2_CAMERA_CCIR (1 << 2) 28#define MX2_CAMERA_CCIR (1 << 2)
28#define MX2_CAMERA_CCIR_INTERLACE (1 << 3) 29#define MX2_CAMERA_CCIR_INTERLACE (1 << 3)
@@ -30,6 +31,7 @@
30#define MX2_CAMERA_GATED_CLOCK (1 << 5) 31#define MX2_CAMERA_GATED_CLOCK (1 << 5)
31#define MX2_CAMERA_INV_DATA (1 << 6) 32#define MX2_CAMERA_INV_DATA (1 << 6)
32#define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7) 33#define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7)
34#define MX2_CAMERA_PACK_DIR_MSB (1 << 8)
33 35
34/** 36/**
35 * struct mx2_camera_platform_data - optional platform data for mx2_camera 37 * struct mx2_camera_platform_data - optional platform data for mx2_camera
diff --git a/arch/arm/plat-samsung/include/plat/map-s3c.h b/arch/arm/plat-samsung/include/plat/map-s3c.h
index 7d048759b772..c0c70a895ca8 100644
--- a/arch/arm/plat-samsung/include/plat/map-s3c.h
+++ b/arch/arm/plat-samsung/include/plat/map-s3c.h
@@ -22,7 +22,7 @@
22#define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG 22#define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG
23 23
24#define S3C2412_VA_SSMC S3C_ADDR_CPU(0x00000000) 24#define S3C2412_VA_SSMC S3C_ADDR_CPU(0x00000000)
25#define S3C2412_VA_EBI S3C_ADDR_CPU(0x00010000) 25#define S3C2412_VA_EBI S3C_ADDR_CPU(0x00100000)
26 26
27#define S3C2410_PA_UART (0x50000000) 27#define S3C2410_PA_UART (0x50000000)
28#define S3C24XX_PA_UART S3C2410_PA_UART 28#define S3C24XX_PA_UART S3C2410_PA_UART
diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
index f19aff19205c..bc4db9b04e36 100644
--- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
+++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
@@ -25,7 +25,7 @@ static inline void arch_wdt_reset(void)
25 25
26 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ 26 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
27 27
28 if (s3c2410_wdtclk) 28 if (!IS_ERR(s3c2410_wdtclk))
29 clk_enable(s3c2410_wdtclk); 29 clk_enable(s3c2410_wdtclk);
30 30
31 /* put initial values into count and data */ 31 /* put initial values into count and data */
diff --git a/arch/m68k/platform/coldfire/clk.c b/arch/m68k/platform/coldfire/clk.c
index 9f1260c5e2ad..44da406897e5 100644
--- a/arch/m68k/platform/coldfire/clk.c
+++ b/arch/m68k/platform/coldfire/clk.c
@@ -42,4 +42,11 @@ unsigned long clk_get_rate(struct clk *clk)
42 return MCF_CLK; 42 return MCF_CLK;
43} 43}
44EXPORT_SYMBOL(clk_get_rate); 44EXPORT_SYMBOL(clk_get_rate);
45
46struct clk *devm_clk_get(struct device *dev, const char *id)
47{
48 return NULL;
49}
50EXPORT_SYMBOL(devm_clk_get);
51
45/***************************************************************************/ 52/***************************************************************************/
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 32b394f3b854..6eb75b80488c 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -103,6 +103,11 @@ static inline void hard_irq_disable(void)
103/* include/linux/interrupt.h needs hard_irq_disable to be a macro */ 103/* include/linux/interrupt.h needs hard_irq_disable to be a macro */
104#define hard_irq_disable hard_irq_disable 104#define hard_irq_disable hard_irq_disable
105 105
106static inline bool lazy_irq_pending(void)
107{
108 return !!(get_paca()->irq_happened & ~PACA_IRQ_HARD_DIS);
109}
110
106/* 111/*
107 * This is called by asynchronous interrupts to conditionally 112 * This is called by asynchronous interrupts to conditionally
108 * re-enable hard interrupts when soft-disabled after having 113 * re-enable hard interrupts when soft-disabled after having
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index ed1718feb9d9..5971c85df136 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -558,27 +558,54 @@ _GLOBAL(ret_from_except_lite)
558 mtmsrd r10,1 /* Update machine state */ 558 mtmsrd r10,1 /* Update machine state */
559#endif /* CONFIG_PPC_BOOK3E */ 559#endif /* CONFIG_PPC_BOOK3E */
560 560
561#ifdef CONFIG_PREEMPT
562 clrrdi r9,r1,THREAD_SHIFT /* current_thread_info() */ 561 clrrdi r9,r1,THREAD_SHIFT /* current_thread_info() */
563 li r0,_TIF_NEED_RESCHED /* bits to check */
564 ld r3,_MSR(r1) 562 ld r3,_MSR(r1)
565 ld r4,TI_FLAGS(r9) 563 ld r4,TI_FLAGS(r9)
566 /* Move MSR_PR bit in r3 to _TIF_SIGPENDING position in r0 */
567 rlwimi r0,r3,32+TIF_SIGPENDING-MSR_PR_LG,_TIF_SIGPENDING
568 and. r0,r4,r0 /* check NEED_RESCHED and maybe SIGPENDING */
569 bne do_work
570
571#else /* !CONFIG_PREEMPT */
572 ld r3,_MSR(r1) /* Returning to user mode? */
573 andi. r3,r3,MSR_PR 564 andi. r3,r3,MSR_PR
574 beq restore /* if not, just restore regs and return */ 565 beq resume_kernel
575 566
576 /* Check current_thread_info()->flags */ 567 /* Check current_thread_info()->flags */
568 andi. r0,r4,_TIF_USER_WORK_MASK
569 beq restore
570
571 andi. r0,r4,_TIF_NEED_RESCHED
572 beq 1f
573 bl .restore_interrupts
574 bl .schedule
575 b .ret_from_except_lite
576
5771: bl .save_nvgprs
578 bl .restore_interrupts
579 addi r3,r1,STACK_FRAME_OVERHEAD
580 bl .do_notify_resume
581 b .ret_from_except
582
583resume_kernel:
584#ifdef CONFIG_PREEMPT
585 /* Check if we need to preempt */
586 andi. r0,r4,_TIF_NEED_RESCHED
587 beq+ restore
588 /* Check that preempt_count() == 0 and interrupts are enabled */
589 lwz r8,TI_PREEMPT(r9)
590 cmpwi cr1,r8,0
591 ld r0,SOFTE(r1)
592 cmpdi r0,0
593 crandc eq,cr1*4+eq,eq
594 bne restore
595
596 /*
597 * Here we are preempting the current task. We want to make
598 * sure we are soft-disabled first
599 */
600 SOFT_DISABLE_INTS(r3,r4)
6011: bl .preempt_schedule_irq
602
603 /* Re-test flags and eventually loop */
577 clrrdi r9,r1,THREAD_SHIFT 604 clrrdi r9,r1,THREAD_SHIFT
578 ld r4,TI_FLAGS(r9) 605 ld r4,TI_FLAGS(r9)
579 andi. r0,r4,_TIF_USER_WORK_MASK 606 andi. r0,r4,_TIF_NEED_RESCHED
580 bne do_work 607 bne 1b
581#endif /* !CONFIG_PREEMPT */ 608#endif /* CONFIG_PREEMPT */
582 609
583 .globl fast_exc_return_irq 610 .globl fast_exc_return_irq
584fast_exc_return_irq: 611fast_exc_return_irq:
@@ -759,50 +786,6 @@ restore_check_irq_replay:
759#endif /* CONFIG_PPC_BOOK3E */ 786#endif /* CONFIG_PPC_BOOK3E */
7601: b .ret_from_except /* What else to do here ? */ 7871: b .ret_from_except /* What else to do here ? */
761 788
762
763
7643:
765do_work:
766#ifdef CONFIG_PREEMPT
767 andi. r0,r3,MSR_PR /* Returning to user mode? */
768 bne user_work
769 /* Check that preempt_count() == 0 and interrupts are enabled */
770 lwz r8,TI_PREEMPT(r9)
771 cmpwi cr1,r8,0
772 ld r0,SOFTE(r1)
773 cmpdi r0,0
774 crandc eq,cr1*4+eq,eq
775 bne restore
776
777 /*
778 * Here we are preempting the current task. We want to make
779 * sure we are soft-disabled first
780 */
781 SOFT_DISABLE_INTS(r3,r4)
7821: bl .preempt_schedule_irq
783
784 /* Re-test flags and eventually loop */
785 clrrdi r9,r1,THREAD_SHIFT
786 ld r4,TI_FLAGS(r9)
787 andi. r0,r4,_TIF_NEED_RESCHED
788 bne 1b
789 b restore
790
791user_work:
792#endif /* CONFIG_PREEMPT */
793
794 andi. r0,r4,_TIF_NEED_RESCHED
795 beq 1f
796 bl .restore_interrupts
797 bl .schedule
798 b .ret_from_except_lite
799
8001: bl .save_nvgprs
801 bl .restore_interrupts
802 addi r3,r1,STACK_FRAME_OVERHEAD
803 bl .do_notify_resume
804 b .ret_from_except
805
806unrecov_restore: 789unrecov_restore:
807 addi r3,r1,STACK_FRAME_OVERHEAD 790 addi r3,r1,STACK_FRAME_OVERHEAD
808 bl .unrecoverable_exception 791 bl .unrecoverable_exception
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 7835a5e1ea5f..1b415027ec0e 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -277,7 +277,7 @@ EXPORT_SYMBOL(arch_local_irq_restore);
277 * NOTE: This is called with interrupts hard disabled but not marked 277 * NOTE: This is called with interrupts hard disabled but not marked
278 * as such in paca->irq_happened, so we need to resync this. 278 * as such in paca->irq_happened, so we need to resync this.
279 */ 279 */
280void restore_interrupts(void) 280void notrace restore_interrupts(void)
281{ 281{
282 if (irqs_disabled()) { 282 if (irqs_disabled()) {
283 local_paca->irq_happened |= PACA_IRQ_HARD_DIS; 283 local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 1b488e5305c5..0794a3017b1b 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1312,7 +1312,7 @@ static struct opal_secondary_data {
1312 1312
1313extern char opal_secondary_entry; 1313extern char opal_secondary_entry;
1314 1314
1315static void prom_query_opal(void) 1315static void __init prom_query_opal(void)
1316{ 1316{
1317 long rc; 1317 long rc;
1318 1318
@@ -1436,7 +1436,7 @@ static void __init prom_opal_hold_cpus(void)
1436 prom_debug("prom_opal_hold_cpus: end...\n"); 1436 prom_debug("prom_opal_hold_cpus: end...\n");
1437} 1437}
1438 1438
1439static void prom_opal_takeover(void) 1439static void __init prom_opal_takeover(void)
1440{ 1440{
1441 struct opal_secondary_data *data = &RELOC(opal_secondary_data); 1441 struct opal_secondary_data *data = &RELOC(opal_secondary_data);
1442 struct opal_takeover_args *args = &data->args; 1442 struct opal_takeover_args *args = &data->args;
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b6edbb3b4a54..6e8f677f5646 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -635,7 +635,7 @@ static inline int __init read_usm_ranges(const u32 **usm)
635 */ 635 */
636static void __init parse_drconf_memory(struct device_node *memory) 636static void __init parse_drconf_memory(struct device_node *memory)
637{ 637{
638 const u32 *dm, *usm; 638 const u32 *uninitialized_var(dm), *usm;
639 unsigned int n, rc, ranges, is_kexec_kdump = 0; 639 unsigned int n, rc, ranges, is_kexec_kdump = 0;
640 unsigned long lmb_size, base, size, sz; 640 unsigned long lmb_size, base, size, sz;
641 int nid; 641 int nid;
diff --git a/arch/powerpc/net/bpf_jit_64.S b/arch/powerpc/net/bpf_jit_64.S
index 55ba3855a97f..7d3a3b5619a2 100644
--- a/arch/powerpc/net/bpf_jit_64.S
+++ b/arch/powerpc/net/bpf_jit_64.S
@@ -105,6 +105,7 @@ sk_load_byte_msh_positive_offset:
105 mr r4, r_addr; \ 105 mr r4, r_addr; \
106 li r6, SIZE; \ 106 li r6, SIZE; \
107 bl skb_copy_bits; \ 107 bl skb_copy_bits; \
108 nop; \
108 /* R3 = 0 on success */ \ 109 /* R3 = 0 on success */ \
109 addi r1, r1, BPF_PPC_SLOWPATH_FRAME; \ 110 addi r1, r1, BPF_PPC_SLOWPATH_FRAME; \
110 ld r0, 16(r1); \ 111 ld r0, 16(r1); \
@@ -156,6 +157,7 @@ bpf_slow_path_byte_msh:
156 mr r4, r_addr; \ 157 mr r4, r_addr; \
157 li r5, SIZE; \ 158 li r5, SIZE; \
158 bl bpf_internal_load_pointer_neg_helper; \ 159 bl bpf_internal_load_pointer_neg_helper; \
160 nop; \
159 /* R3 != 0 on success */ \ 161 /* R3 != 0 on success */ \
160 addi r1, r1, BPF_PPC_SLOWPATH_FRAME; \ 162 addi r1, r1, BPF_PPC_SLOWPATH_FRAME; \
161 ld r0, 16(r1); \ 163 ld r0, 16(r1); \
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 0915b1ad66ce..2d311c0caf8e 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -106,7 +106,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index,
106 tcep++; 106 tcep++;
107 } 107 }
108 108
109 if (tbl->it_type == TCE_PCI_SWINV_CREATE) 109 if (tbl->it_type & TCE_PCI_SWINV_CREATE)
110 tce_invalidate_pSeries_sw(tbl, tces, tcep - 1); 110 tce_invalidate_pSeries_sw(tbl, tces, tcep - 1);
111 return 0; 111 return 0;
112} 112}
@@ -121,7 +121,7 @@ static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages)
121 while (npages--) 121 while (npages--)
122 *(tcep++) = 0; 122 *(tcep++) = 0;
123 123
124 if (tbl->it_type == TCE_PCI_SWINV_FREE) 124 if (tbl->it_type & TCE_PCI_SWINV_FREE)
125 tce_invalidate_pSeries_sw(tbl, tces, tcep - 1); 125 tce_invalidate_pSeries_sw(tbl, tces, tcep - 1);
126} 126}
127 127
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
index 41a34bc4a9a2..e61483e8e960 100644
--- a/arch/powerpc/platforms/pseries/processor_idle.c
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -106,7 +106,7 @@ static void check_and_cede_processor(void)
106 * we first hard disable then check. 106 * we first hard disable then check.
107 */ 107 */
108 hard_irq_disable(); 108 hard_irq_disable();
109 if (get_paca()->irq_happened == 0) 109 if (!lazy_irq_pending())
110 cede_processor(); 110 cede_processor();
111} 111}
112 112
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 158c9176e42a..43a179ce9afc 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -201,8 +201,8 @@ static struct resource kfr2r09_usb0_gadget_resources[] = {
201 .flags = IORESOURCE_MEM, 201 .flags = IORESOURCE_MEM,
202 }, 202 },
203 [1] = { 203 [1] = {
204 .start = evtirq(0xa20), 204 .start = evt2irq(0xa20),
205 .end = evtirq(0xa20), 205 .end = evt2irq(0xa20),
206 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 206 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
207 }, 207 },
208}; 208};
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index c045142f7338..9e702f2f8045 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -239,7 +239,7 @@ static int __init pcie_clk_init(struct sh7786_pcie_port *port)
239 clk->enable_reg = (void __iomem *)(chan->reg_base + SH4A_PCIEPHYCTLR); 239 clk->enable_reg = (void __iomem *)(chan->reg_base + SH4A_PCIEPHYCTLR);
240 clk->enable_bit = BITS_CKE; 240 clk->enable_bit = BITS_CKE;
241 241
242 ret = sh_clk_mstp32_register(clk, 1); 242 ret = sh_clk_mstp_register(clk, 1);
243 if (unlikely(ret < 0)) 243 if (unlikely(ret < 0))
244 goto err_phy; 244 goto err_phy;
245 245
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
index ea01a72f1b94..53638e231cd0 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
@@ -283,7 +283,7 @@ int __init arch_clk_init(void)
283 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 283 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
284 284
285 if (!ret) 285 if (!ret)
286 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 286 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
287 287
288 return ret; 288 return ret;
289} 289}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
index 7ac07b4f75de..22e485d1990b 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
@@ -276,7 +276,7 @@ int __init arch_clk_init(void)
276 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 276 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
277 277
278 if (!ret) 278 if (!ret)
279 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 279 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
280 280
281 return ret; 281 return ret;
282} 282}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index 8e1f97010c0d..c4cb740e4d10 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -261,7 +261,7 @@ int __init arch_clk_init(void)
261 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 261 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
262 262
263 if (!ret) 263 if (!ret)
264 ret = sh_clk_mstp32_register(mstp_clks, HWBLK_NR); 264 ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR);
265 265
266 return ret; 266 return ret;
267} 267}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index 35f75cf0c7e5..37c41c7747a3 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -311,7 +311,7 @@ int __init arch_clk_init(void)
311 ret = sh_clk_div6_register(div6_clks, DIV6_NR); 311 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
312 312
313 if (!ret) 313 if (!ret)
314 ret = sh_clk_mstp32_register(mstp_clks, HWBLK_NR); 314 ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR);
315 315
316 return ret; 316 return ret;
317} 317}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 2a87901673fe..c87e78f73234 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -375,7 +375,7 @@ int __init arch_clk_init(void)
375 ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR); 375 ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR);
376 376
377 if (!ret) 377 if (!ret)
378 ret = sh_clk_mstp32_register(mstp_clks, HWBLK_NR); 378 ret = sh_clk_mstp_register(mstp_clks, HWBLK_NR);
379 379
380 return ret; 380 return ret;
381} 381}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
index 1697642c1f73..deb683abacf0 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
@@ -260,7 +260,7 @@ int __init arch_clk_init(void)
260 &div4_table); 260 &div4_table);
261 261
262 if (!ret) 262 if (!ret)
263 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 263 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
264 264
265 return ret; 265 return ret;
266} 266}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index 04ab5aeaf920..e84a43229b9c 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -148,7 +148,7 @@ int __init arch_clk_init(void)
148 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 148 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
149 &div4_table); 149 &div4_table);
150 if (!ret) 150 if (!ret)
151 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 151 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
152 152
153 return ret; 153 return ret;
154} 154}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index ab1c58f2d101..1c83788db76a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -175,7 +175,7 @@ int __init arch_clk_init(void)
175 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 175 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
176 &div4_table); 176 &div4_table);
177 if (!ret) 177 if (!ret)
178 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 178 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
179 179
180 return ret; 180 return ret;
181} 181}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index 491709483e10..8bba6f159023 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -194,7 +194,7 @@ int __init arch_clk_init(void)
194 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 194 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
195 &div4_table); 195 &div4_table);
196 if (!ret) 196 if (!ret)
197 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 197 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
198 198
199 return ret; 199 return ret;
200} 200}
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index 0f11b392bf46..a9422dab0ce7 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -149,7 +149,7 @@ int __init arch_clk_init(void)
149 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 149 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
150 &div4_table); 150 &div4_table);
151 if (!ret) 151 if (!ret)
152 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 152 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
153 153
154 return ret; 154 return ret;
155} 155}
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index daeca56211e3..673ac9b63d6b 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -38,7 +38,7 @@
38int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) 38int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
39{ 39{
40 int err = 0; 40 int err = 0;
41 bool ia32 = is_ia32_task(); 41 bool ia32 = test_thread_flag(TIF_IA32);
42 42
43 if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t))) 43 if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
44 return -EFAULT; 44 return -EFAULT;
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 340ee49961a6..f91e80f4f180 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -176,7 +176,7 @@
176#define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */ 176#define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */
177#define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */ 177#define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */
178#define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */ 178#define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */
179#define X86_FEATURE_DTS (7*32+ 7) /* Digital Thermal Sensor */ 179#define X86_FEATURE_DTHERM (7*32+ 7) /* Digital Thermal Sensor */
180#define X86_FEATURE_HW_PSTATE (7*32+ 8) /* AMD HW-PState */ 180#define X86_FEATURE_HW_PSTATE (7*32+ 8) /* AMD HW-PState */
181 181
182/* Virtualization flags: Linux defined, word 8 */ 182/* Virtualization flags: Linux defined, word 8 */
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 8afb69319815..b2297e58c6ed 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -422,12 +422,14 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
422 return 0; 422 return 0;
423 } 423 }
424 424
425 if (intsrc->source_irq == 0 && intsrc->global_irq == 2) { 425 if (intsrc->source_irq == 0) {
426 if (acpi_skip_timer_override) { 426 if (acpi_skip_timer_override) {
427 printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); 427 printk(PREFIX "BIOS IRQ0 override ignored.\n");
428 return 0; 428 return 0;
429 } 429 }
430 if (acpi_fix_pin2_polarity && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { 430
431 if ((intsrc->global_irq == 2) && acpi_fix_pin2_polarity
432 && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) {
431 intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK; 433 intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK;
432 printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n"); 434 printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n");
433 } 435 }
@@ -1334,17 +1336,12 @@ static int __init dmi_disable_acpi(const struct dmi_system_id *d)
1334} 1336}
1335 1337
1336/* 1338/*
1337 * Force ignoring BIOS IRQ0 pin2 override 1339 * Force ignoring BIOS IRQ0 override
1338 */ 1340 */
1339static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) 1341static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
1340{ 1342{
1341 /*
1342 * The ati_ixp4x0_rev() early PCI quirk should have set
1343 * the acpi_skip_timer_override flag already:
1344 */
1345 if (!acpi_skip_timer_override) { 1343 if (!acpi_skip_timer_override) {
1346 WARN(1, KERN_ERR "ati_ixp4x0 quirk not complete.\n"); 1344 pr_notice("%s detected: Ignoring BIOS IRQ0 override\n",
1347 pr_notice("%s detected: Ignoring BIOS IRQ0 pin2 override\n",
1348 d->ident); 1345 d->ident);
1349 acpi_skip_timer_override = 1; 1346 acpi_skip_timer_override = 1;
1350 } 1347 }
@@ -1438,7 +1435,7 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
1438 * is enabled. This input is incorrectly designated the 1435 * is enabled. This input is incorrectly designated the
1439 * ISA IRQ 0 via an interrupt source override even though 1436 * ISA IRQ 0 via an interrupt source override even though
1440 * it is wired to the output of the master 8259A and INTIN0 1437 * it is wired to the output of the master 8259A and INTIN0
1441 * is not connected at all. Force ignoring BIOS IRQ0 pin2 1438 * is not connected at all. Force ignoring BIOS IRQ0
1442 * override in that cases. 1439 * override in that cases.
1443 */ 1440 */
1444 { 1441 {
@@ -1473,6 +1470,14 @@ static struct dmi_system_id __initdata acpi_dmi_table_late[] = {
1473 DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"), 1470 DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq 6715b"),
1474 }, 1471 },
1475 }, 1472 },
1473 {
1474 .callback = dmi_ignore_irq0_timer_override,
1475 .ident = "FUJITSU SIEMENS",
1476 .matches = {
1477 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1478 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
1479 },
1480 },
1476 {} 1481 {}
1477}; 1482};
1478 1483
diff --git a/arch/x86/kernel/cpu/mkcapflags.pl b/arch/x86/kernel/cpu/mkcapflags.pl
index dfea390e1608..c7b3fe2d72e0 100644
--- a/arch/x86/kernel/cpu/mkcapflags.pl
+++ b/arch/x86/kernel/cpu/mkcapflags.pl
@@ -1,4 +1,4 @@
1#!/usr/bin/perl 1#!/usr/bin/perl -w
2# 2#
3# Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h 3# Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h
4# 4#
@@ -11,22 +11,35 @@ open(OUT, "> $out\0") or die "$0: cannot create: $out: $!\n";
11print OUT "#include <asm/cpufeature.h>\n\n"; 11print OUT "#include <asm/cpufeature.h>\n\n";
12print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n"; 12print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n";
13 13
14%features = ();
15$err = 0;
16
14while (defined($line = <IN>)) { 17while (defined($line = <IN>)) {
15 if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) { 18 if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) {
16 $macro = $1; 19 $macro = $1;
17 $feature = $2; 20 $feature = "\L$2";
18 $tail = $3; 21 $tail = $3;
19 if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) { 22 if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) {
20 $feature = $1; 23 $feature = "\L$1";
21 } 24 }
22 25
23 if ($feature ne '') { 26 next if ($feature eq '');
24 printf OUT "\t%-32s = \"%s\",\n", 27
25 "[$macro]", "\L$feature"; 28 if ($features{$feature}++) {
29 print STDERR "$in: duplicate feature name: $feature\n";
30 $err++;
26 } 31 }
32 printf OUT "\t%-32s = \"%s\",\n", "[$macro]", $feature;
27 } 33 }
28} 34}
29print OUT "};\n"; 35print OUT "};\n";
30 36
31close(IN); 37close(IN);
32close(OUT); 38close(OUT);
39
40if ($err) {
41 unlink($out);
42 exit(1);
43}
44
45exit(0);
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
index addf9e82a7f2..ee8e9abc859f 100644
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -31,7 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
31 const struct cpuid_bit *cb; 31 const struct cpuid_bit *cb;
32 32
33 static const struct cpuid_bit __cpuinitconst cpuid_bits[] = { 33 static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
34 { X86_FEATURE_DTS, CR_EAX, 0, 0x00000006, 0 }, 34 { X86_FEATURE_DTHERM, CR_EAX, 0, 0x00000006, 0 },
35 { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 }, 35 { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 },
36 { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 }, 36 { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 },
37 { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 }, 37 { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 },
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 8bfb6146f753..3f61904365cf 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -444,12 +444,12 @@ void kgdb_roundup_cpus(unsigned long flags)
444 444
445/** 445/**
446 * kgdb_arch_handle_exception - Handle architecture specific GDB packets. 446 * kgdb_arch_handle_exception - Handle architecture specific GDB packets.
447 * @vector: The error vector of the exception that happened. 447 * @e_vector: The error vector of the exception that happened.
448 * @signo: The signal number of the exception that happened. 448 * @signo: The signal number of the exception that happened.
449 * @err_code: The error code of the exception that happened. 449 * @err_code: The error code of the exception that happened.
450 * @remcom_in_buffer: The buffer of the packet we have read. 450 * @remcomInBuffer: The buffer of the packet we have read.
451 * @remcom_out_buffer: The buffer of %BUFMAX bytes to write a packet into. 451 * @remcomOutBuffer: The buffer of %BUFMAX bytes to write a packet into.
452 * @regs: The &struct pt_regs of the current process. 452 * @linux_regs: The &struct pt_regs of the current process.
453 * 453 *
454 * This function MUST handle the 'c' and 's' command packets, 454 * This function MUST handle the 'c' and 's' command packets,
455 * as well packets to set / remove a hardware breakpoint, if used. 455 * as well packets to set / remove a hardware breakpoint, if used.
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 25b48edb847c..5de92f1abd76 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -451,6 +451,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
451 DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"), 451 DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
452 }, 452 },
453 }, 453 },
454 { /* Handle problems with rebooting on the Precision M6600. */
455 .callback = set_pci_reboot,
456 .ident = "Dell OptiPlex 990",
457 .matches = {
458 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
459 DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
460 },
461 },
454 { } 462 { }
455}; 463};
456 464
diff --git a/arch/x86/lib/csum-wrappers_64.c b/arch/x86/lib/csum-wrappers_64.c
index 459b58a8a15c..25b7ae8d058a 100644
--- a/arch/x86/lib/csum-wrappers_64.c
+++ b/arch/x86/lib/csum-wrappers_64.c
@@ -115,7 +115,7 @@ EXPORT_SYMBOL(csum_partial_copy_to_user);
115 * @src: source address 115 * @src: source address
116 * @dst: destination address 116 * @dst: destination address
117 * @len: number of bytes to be copied. 117 * @len: number of bytes to be copied.
118 * @isum: initial sum that is added into the result (32bit unfolded) 118 * @sum: initial sum that is added into the result (32bit unfolded)
119 * 119 *
120 * Returns an 32bit unfolded checksum of the buffer. 120 * Returns an 32bit unfolded checksum of the buffer.
121 */ 121 */
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index a43fa1a57d57..1502c50273b5 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -36,6 +36,7 @@
36#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" 36#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
37#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 37#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
38static DEFINE_MUTEX(isolated_cpus_lock); 38static DEFINE_MUTEX(isolated_cpus_lock);
39static DEFINE_MUTEX(round_robin_lock);
39 40
40static unsigned long power_saving_mwait_eax; 41static unsigned long power_saving_mwait_eax;
41 42
@@ -107,7 +108,7 @@ static void round_robin_cpu(unsigned int tsk_index)
107 if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) 108 if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
108 return; 109 return;
109 110
110 mutex_lock(&isolated_cpus_lock); 111 mutex_lock(&round_robin_lock);
111 cpumask_clear(tmp); 112 cpumask_clear(tmp);
112 for_each_cpu(cpu, pad_busy_cpus) 113 for_each_cpu(cpu, pad_busy_cpus)
113 cpumask_or(tmp, tmp, topology_thread_cpumask(cpu)); 114 cpumask_or(tmp, tmp, topology_thread_cpumask(cpu));
@@ -116,7 +117,7 @@ static void round_robin_cpu(unsigned int tsk_index)
116 if (cpumask_empty(tmp)) 117 if (cpumask_empty(tmp))
117 cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); 118 cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus);
118 if (cpumask_empty(tmp)) { 119 if (cpumask_empty(tmp)) {
119 mutex_unlock(&isolated_cpus_lock); 120 mutex_unlock(&round_robin_lock);
120 return; 121 return;
121 } 122 }
122 for_each_cpu(cpu, tmp) { 123 for_each_cpu(cpu, tmp) {
@@ -131,7 +132,7 @@ static void round_robin_cpu(unsigned int tsk_index)
131 tsk_in_cpu[tsk_index] = preferred_cpu; 132 tsk_in_cpu[tsk_index] = preferred_cpu;
132 cpumask_set_cpu(preferred_cpu, pad_busy_cpus); 133 cpumask_set_cpu(preferred_cpu, pad_busy_cpus);
133 cpu_weight[preferred_cpu]++; 134 cpu_weight[preferred_cpu]++;
134 mutex_unlock(&isolated_cpus_lock); 135 mutex_unlock(&round_robin_lock);
135 136
136 set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); 137 set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu));
137} 138}
diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index 5577762daee1..6686b1eaf13e 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -243,7 +243,7 @@ static int pre_map_gar_callback(struct apei_exec_context *ctx,
243 u8 ins = entry->instruction; 243 u8 ins = entry->instruction;
244 244
245 if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) 245 if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER)
246 return acpi_os_map_generic_address(&entry->register_region); 246 return apei_map_generic_address(&entry->register_region);
247 247
248 return 0; 248 return 0;
249} 249}
@@ -276,7 +276,7 @@ static int post_unmap_gar_callback(struct apei_exec_context *ctx,
276 u8 ins = entry->instruction; 276 u8 ins = entry->instruction;
277 277
278 if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) 278 if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER)
279 acpi_os_unmap_generic_address(&entry->register_region); 279 apei_unmap_generic_address(&entry->register_region);
280 280
281 return 0; 281 return 0;
282} 282}
@@ -606,6 +606,19 @@ static int apei_check_gar(struct acpi_generic_address *reg, u64 *paddr,
606 return 0; 606 return 0;
607} 607}
608 608
609int apei_map_generic_address(struct acpi_generic_address *reg)
610{
611 int rc;
612 u32 access_bit_width;
613 u64 address;
614
615 rc = apei_check_gar(reg, &address, &access_bit_width);
616 if (rc)
617 return rc;
618 return acpi_os_map_generic_address(reg);
619}
620EXPORT_SYMBOL_GPL(apei_map_generic_address);
621
609/* read GAR in interrupt (including NMI) or process context */ 622/* read GAR in interrupt (including NMI) or process context */
610int apei_read(u64 *val, struct acpi_generic_address *reg) 623int apei_read(u64 *val, struct acpi_generic_address *reg)
611{ 624{
diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h
index cca240a33038..f220d642136e 100644
--- a/drivers/acpi/apei/apei-internal.h
+++ b/drivers/acpi/apei/apei-internal.h
@@ -7,6 +7,8 @@
7#define APEI_INTERNAL_H 7#define APEI_INTERNAL_H
8 8
9#include <linux/cper.h> 9#include <linux/cper.h>
10#include <linux/acpi.h>
11#include <linux/acpi_io.h>
10 12
11struct apei_exec_context; 13struct apei_exec_context;
12 14
@@ -68,6 +70,13 @@ static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 actio
68/* IP has been set in instruction function */ 70/* IP has been set in instruction function */
69#define APEI_EXEC_SET_IP 1 71#define APEI_EXEC_SET_IP 1
70 72
73int apei_map_generic_address(struct acpi_generic_address *reg);
74
75static inline void apei_unmap_generic_address(struct acpi_generic_address *reg)
76{
77 acpi_os_unmap_generic_address(reg);
78}
79
71int apei_read(u64 *val, struct acpi_generic_address *reg); 80int apei_read(u64 *val, struct acpi_generic_address *reg);
72int apei_write(u64 val, struct acpi_generic_address *reg); 81int apei_write(u64 val, struct acpi_generic_address *reg);
73 82
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 9b3cac0abecc..1599566ed1fe 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -301,7 +301,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
301 if (!ghes) 301 if (!ghes)
302 return ERR_PTR(-ENOMEM); 302 return ERR_PTR(-ENOMEM);
303 ghes->generic = generic; 303 ghes->generic = generic;
304 rc = acpi_os_map_generic_address(&generic->error_status_address); 304 rc = apei_map_generic_address(&generic->error_status_address);
305 if (rc) 305 if (rc)
306 goto err_free; 306 goto err_free;
307 error_block_length = generic->error_block_length; 307 error_block_length = generic->error_block_length;
@@ -321,7 +321,7 @@ static struct ghes *ghes_new(struct acpi_hest_generic *generic)
321 return ghes; 321 return ghes;
322 322
323err_unmap: 323err_unmap:
324 acpi_os_unmap_generic_address(&generic->error_status_address); 324 apei_unmap_generic_address(&generic->error_status_address);
325err_free: 325err_free:
326 kfree(ghes); 326 kfree(ghes);
327 return ERR_PTR(rc); 327 return ERR_PTR(rc);
@@ -330,7 +330,7 @@ err_free:
330static void ghes_fini(struct ghes *ghes) 330static void ghes_fini(struct ghes *ghes)
331{ 331{
332 kfree(ghes->estatus); 332 kfree(ghes->estatus);
333 acpi_os_unmap_generic_address(&ghes->generic->error_status_address); 333 apei_unmap_generic_address(&ghes->generic->error_status_address);
334} 334}
335 335
336enum { 336enum {
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f3decb30223f..47a8caa89dbe 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -224,6 +224,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,
224/* 224/*
225 * Suspend / resume control 225 * Suspend / resume control
226 */ 226 */
227static int acpi_idle_suspend;
227static u32 saved_bm_rld; 228static u32 saved_bm_rld;
228 229
229static void acpi_idle_bm_rld_save(void) 230static void acpi_idle_bm_rld_save(void)
@@ -242,13 +243,21 @@ static void acpi_idle_bm_rld_restore(void)
242 243
243int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) 244int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
244{ 245{
246 if (acpi_idle_suspend == 1)
247 return 0;
248
245 acpi_idle_bm_rld_save(); 249 acpi_idle_bm_rld_save();
250 acpi_idle_suspend = 1;
246 return 0; 251 return 0;
247} 252}
248 253
249int acpi_processor_resume(struct acpi_device * device) 254int acpi_processor_resume(struct acpi_device * device)
250{ 255{
256 if (acpi_idle_suspend == 0)
257 return 0;
258
251 acpi_idle_bm_rld_restore(); 259 acpi_idle_bm_rld_restore();
260 acpi_idle_suspend = 0;
252 return 0; 261 return 0;
253} 262}
254 263
@@ -754,6 +763,12 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
754 763
755 local_irq_disable(); 764 local_irq_disable();
756 765
766 if (acpi_idle_suspend) {
767 local_irq_enable();
768 cpu_relax();
769 return -EBUSY;
770 }
771
757 lapic_timer_state_broadcast(pr, cx, 1); 772 lapic_timer_state_broadcast(pr, cx, 1);
758 kt1 = ktime_get_real(); 773 kt1 = ktime_get_real();
759 acpi_idle_do_entry(cx); 774 acpi_idle_do_entry(cx);
@@ -823,6 +838,12 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
823 838
824 local_irq_disable(); 839 local_irq_disable();
825 840
841 if (acpi_idle_suspend) {
842 local_irq_enable();
843 cpu_relax();
844 return -EBUSY;
845 }
846
826 if (cx->entry_method != ACPI_CSTATE_FFH) { 847 if (cx->entry_method != ACPI_CSTATE_FFH) {
827 current_thread_info()->status &= ~TS_POLLING; 848 current_thread_info()->status &= ~TS_POLLING;
828 /* 849 /*
@@ -907,14 +928,21 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
907 drv, drv->safe_state_index); 928 drv, drv->safe_state_index);
908 } else { 929 } else {
909 local_irq_disable(); 930 local_irq_disable();
910 acpi_safe_halt(); 931 if (!acpi_idle_suspend)
932 acpi_safe_halt();
911 local_irq_enable(); 933 local_irq_enable();
912 return -EINVAL; 934 return -EBUSY;
913 } 935 }
914 } 936 }
915 937
916 local_irq_disable(); 938 local_irq_disable();
917 939
940 if (acpi_idle_suspend) {
941 local_irq_enable();
942 cpu_relax();
943 return -EBUSY;
944 }
945
918 if (cx->entry_method != ACPI_CSTATE_FFH) { 946 if (cx->entry_method != ACPI_CSTATE_FFH) {
919 current_thread_info()->status &= ~TS_POLLING; 947 current_thread_info()->status &= ~TS_POLLING;
920 /* 948 /*
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 9f66181c814e..240a24400976 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
173{ 173{
174 int result = 0; 174 int result = 0;
175 175
176 if (!strncmp(val, "enable", strlen("enable") - 1)) { 176 if (!strncmp(val, "enable", strlen("enable"))) {
177 result = acpi_debug_trace(trace_method_name, trace_debug_level, 177 result = acpi_debug_trace(trace_method_name, trace_debug_level,
178 trace_debug_layer, 0); 178 trace_debug_layer, 0);
179 if (result) 179 if (result)
@@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
181 goto exit; 181 goto exit;
182 } 182 }
183 183
184 if (!strncmp(val, "disable", strlen("disable") - 1)) { 184 if (!strncmp(val, "disable", strlen("disable"))) {
185 int name = 0; 185 int name = 0;
186 result = acpi_debug_trace((char *)&name, trace_debug_level, 186 result = acpi_debug_trace((char *)&name, trace_debug_level,
187 trace_debug_layer, 0); 187 trace_debug_layer, 0);
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index a576575617d7..1e0a9e17c31d 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -558,6 +558,8 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
558 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 558 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
559 struct acpi_object_list args = { 1, &arg0 }; 559 struct acpi_object_list args = { 1, &arg0 };
560 560
561 if (!video->cap._DOS)
562 return 0;
561 563
562 if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) 564 if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1)
563 return -EINVAL; 565 return -EINVAL;
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index e0fb5b0435a3..9cb845e49334 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1031,7 +1031,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
1031 dpm_wait_for_children(dev, async); 1031 dpm_wait_for_children(dev, async);
1032 1032
1033 if (async_error) 1033 if (async_error)
1034 return 0; 1034 goto Complete;
1035 1035
1036 pm_runtime_get_noresume(dev); 1036 pm_runtime_get_noresume(dev);
1037 if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) 1037 if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
@@ -1040,7 +1040,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
1040 if (pm_wakeup_pending()) { 1040 if (pm_wakeup_pending()) {
1041 pm_runtime_put_sync(dev); 1041 pm_runtime_put_sync(dev);
1042 async_error = -EBUSY; 1042 async_error = -EBUSY;
1043 return 0; 1043 goto Complete;
1044 } 1044 }
1045 1045
1046 device_lock(dev); 1046 device_lock(dev);
@@ -1097,6 +1097,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
1097 } 1097 }
1098 1098
1099 device_unlock(dev); 1099 device_unlock(dev);
1100
1101 Complete:
1100 complete_all(&dev->power.completion); 1102 complete_all(&dev->power.completion);
1101 1103
1102 if (error) { 1104 if (error) {
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index ad591bd240ec..10308cd8a7ed 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[] = {
63 63
64 /* Atheros AR3011 with sflash firmware*/ 64 /* Atheros AR3011 with sflash firmware*/
65 { USB_DEVICE(0x0CF3, 0x3002) }, 65 { USB_DEVICE(0x0CF3, 0x3002) },
66 { USB_DEVICE(0x0CF3, 0xE019) },
66 { USB_DEVICE(0x13d3, 0x3304) }, 67 { USB_DEVICE(0x13d3, 0x3304) },
67 { USB_DEVICE(0x0930, 0x0215) }, 68 { USB_DEVICE(0x0930, 0x0215) },
68 { USB_DEVICE(0x0489, 0xE03D) }, 69 { USB_DEVICE(0x0489, 0xE03D) },
@@ -77,6 +78,7 @@ static struct usb_device_id ath3k_table[] = {
77 { USB_DEVICE(0x04CA, 0x3005) }, 78 { USB_DEVICE(0x04CA, 0x3005) },
78 { USB_DEVICE(0x13d3, 0x3362) }, 79 { USB_DEVICE(0x13d3, 0x3362) },
79 { USB_DEVICE(0x0CF3, 0xE004) }, 80 { USB_DEVICE(0x0CF3, 0xE004) },
81 { USB_DEVICE(0x0930, 0x0219) },
80 82
81 /* Atheros AR5BBU12 with sflash firmware */ 83 /* Atheros AR5BBU12 with sflash firmware */
82 { USB_DEVICE(0x0489, 0xE02C) }, 84 { USB_DEVICE(0x0489, 0xE02C) },
@@ -101,6 +103,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
101 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, 103 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
102 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, 104 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
103 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, 105 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
106 { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
104 107
105 /* Atheros AR5BBU22 with sflash firmware */ 108 /* Atheros AR5BBU22 with sflash firmware */
106 { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, 109 { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btmrvl_drv.h b/drivers/bluetooth/btmrvl_drv.h
index 94f2d65131c4..27068d149380 100644
--- a/drivers/bluetooth/btmrvl_drv.h
+++ b/drivers/bluetooth/btmrvl_drv.h
@@ -136,7 +136,7 @@ int btmrvl_remove_card(struct btmrvl_private *priv);
136 136
137void btmrvl_interrupt(struct btmrvl_private *priv); 137void btmrvl_interrupt(struct btmrvl_private *priv);
138 138
139void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb); 139bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb);
140int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); 140int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb);
141 141
142int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); 142int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd);
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 681ca9d18e12..dc304def8400 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -44,23 +44,33 @@ void btmrvl_interrupt(struct btmrvl_private *priv)
44} 44}
45EXPORT_SYMBOL_GPL(btmrvl_interrupt); 45EXPORT_SYMBOL_GPL(btmrvl_interrupt);
46 46
47void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb) 47bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb)
48{ 48{
49 struct hci_event_hdr *hdr = (void *) skb->data; 49 struct hci_event_hdr *hdr = (void *) skb->data;
50 struct hci_ev_cmd_complete *ec; 50 struct hci_ev_cmd_complete *ec;
51 u16 opcode, ocf; 51 u16 opcode, ocf, ogf;
52 52
53 if (hdr->evt == HCI_EV_CMD_COMPLETE) { 53 if (hdr->evt == HCI_EV_CMD_COMPLETE) {
54 ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE); 54 ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE);
55 opcode = __le16_to_cpu(ec->opcode); 55 opcode = __le16_to_cpu(ec->opcode);
56 ocf = hci_opcode_ocf(opcode); 56 ocf = hci_opcode_ocf(opcode);
57 ogf = hci_opcode_ogf(opcode);
58
57 if (ocf == BT_CMD_MODULE_CFG_REQ && 59 if (ocf == BT_CMD_MODULE_CFG_REQ &&
58 priv->btmrvl_dev.sendcmdflag) { 60 priv->btmrvl_dev.sendcmdflag) {
59 priv->btmrvl_dev.sendcmdflag = false; 61 priv->btmrvl_dev.sendcmdflag = false;
60 priv->adapter->cmd_complete = true; 62 priv->adapter->cmd_complete = true;
61 wake_up_interruptible(&priv->adapter->cmd_wait_q); 63 wake_up_interruptible(&priv->adapter->cmd_wait_q);
62 } 64 }
65
66 if (ogf == OGF) {
67 BT_DBG("vendor event skipped: ogf 0x%4.4x", ogf);
68 kfree_skb(skb);
69 return false;
70 }
63 } 71 }
72
73 return true;
64} 74}
65EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt); 75EXPORT_SYMBOL_GPL(btmrvl_check_evtpkt);
66 76
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index a853244e7fd7..0cd61d9f07cd 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -562,10 +562,12 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
562 skb_put(skb, buf_len); 562 skb_put(skb, buf_len);
563 skb_pull(skb, SDIO_HEADER_LEN); 563 skb_pull(skb, SDIO_HEADER_LEN);
564 564
565 if (type == HCI_EVENT_PKT) 565 if (type == HCI_EVENT_PKT) {
566 btmrvl_check_evtpkt(priv, skb); 566 if (btmrvl_check_evtpkt(priv, skb))
567 hci_recv_frame(skb);
568 } else
569 hci_recv_frame(skb);
567 570
568 hci_recv_frame(skb);
569 hdev->stat.byte_rx += buf_len; 571 hdev->stat.byte_rx += buf_len;
570 break; 572 break;
571 573
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index c9463af8e564..83ebb241bfcc 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -125,6 +125,7 @@ static struct usb_device_id blacklist_table[] = {
125 125
126 /* Atheros 3011 with sflash firmware */ 126 /* Atheros 3011 with sflash firmware */
127 { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, 127 { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
128 { USB_DEVICE(0x0cf3, 0xe019), .driver_info = BTUSB_IGNORE },
128 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, 129 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
129 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE }, 130 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
130 { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE }, 131 { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
@@ -139,6 +140,7 @@ static struct usb_device_id blacklist_table[] = {
139 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, 140 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
140 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, 141 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
141 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, 142 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
143 { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
142 144
143 /* Atheros AR5BBU12 with sflash firmware */ 145 /* Atheros AR5BBU12 with sflash firmware */
144 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, 146 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 687b00d67c8a..dcbe05616090 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -850,18 +850,21 @@ static void clk_change_rate(struct clk *clk)
850{ 850{
851 struct clk *child; 851 struct clk *child;
852 unsigned long old_rate; 852 unsigned long old_rate;
853 unsigned long best_parent_rate = 0;
853 struct hlist_node *tmp; 854 struct hlist_node *tmp;
854 855
855 old_rate = clk->rate; 856 old_rate = clk->rate;
856 857
858 if (clk->parent)
859 best_parent_rate = clk->parent->rate;
860
857 if (clk->ops->set_rate) 861 if (clk->ops->set_rate)
858 clk->ops->set_rate(clk->hw, clk->new_rate, clk->parent->rate); 862 clk->ops->set_rate(clk->hw, clk->new_rate, best_parent_rate);
859 863
860 if (clk->ops->recalc_rate) 864 if (clk->ops->recalc_rate)
861 clk->rate = clk->ops->recalc_rate(clk->hw, 865 clk->rate = clk->ops->recalc_rate(clk->hw, best_parent_rate);
862 clk->parent->rate);
863 else 866 else
864 clk->rate = clk->parent->rate; 867 clk->rate = best_parent_rate;
865 868
866 if (clk->notifier_count && old_rate != clk->rate) 869 if (clk->notifier_count && old_rate != clk->rate)
867 __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate); 870 __clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
@@ -999,7 +1002,7 @@ static struct clk *__clk_init_parent(struct clk *clk)
999 1002
1000 if (!clk->parents) 1003 if (!clk->parents)
1001 clk->parents = 1004 clk->parents =
1002 kmalloc((sizeof(struct clk*) * clk->num_parents), 1005 kzalloc((sizeof(struct clk*) * clk->num_parents),
1003 GFP_KERNEL); 1006 GFP_KERNEL);
1004 1007
1005 if (!clk->parents) 1008 if (!clk->parents)
@@ -1065,9 +1068,13 @@ static int __clk_set_parent(struct clk *clk, struct clk *parent)
1065 old_parent = clk->parent; 1068 old_parent = clk->parent;
1066 1069
1067 /* find index of new parent clock using cached parent ptrs */ 1070 /* find index of new parent clock using cached parent ptrs */
1068 for (i = 0; i < clk->num_parents; i++) 1071 if (clk->parents)
1069 if (clk->parents[i] == parent) 1072 for (i = 0; i < clk->num_parents; i++)
1070 break; 1073 if (clk->parents[i] == parent)
1074 break;
1075 else
1076 clk->parents = kzalloc((sizeof(struct clk*) * clk->num_parents),
1077 GFP_KERNEL);
1071 1078
1072 /* 1079 /*
1073 * find index of new parent clock using string name comparison 1080 * find index of new parent clock using string name comparison
@@ -1076,7 +1083,8 @@ static int __clk_set_parent(struct clk *clk, struct clk *parent)
1076 if (i == clk->num_parents) 1083 if (i == clk->num_parents)
1077 for (i = 0; i < clk->num_parents; i++) 1084 for (i = 0; i < clk->num_parents; i++)
1078 if (!strcmp(clk->parent_names[i], parent->name)) { 1085 if (!strcmp(clk->parent_names[i], parent->name)) {
1079 clk->parents[i] = __clk_lookup(parent->name); 1086 if (clk->parents)
1087 clk->parents[i] = __clk_lookup(parent->name);
1080 break; 1088 break;
1081 } 1089 }
1082 1090
diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c
index f7be225f544c..db2391c054ee 100644
--- a/drivers/clk/mxs/clk-imx23.c
+++ b/drivers/clk/mxs/clk-imx23.c
@@ -71,7 +71,7 @@ static void __init clk_misc_init(void)
71 __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC); 71 __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC);
72} 72}
73 73
74static struct clk_lookup uart_lookups[] __initdata = { 74static struct clk_lookup uart_lookups[] = {
75 { .dev_id = "duart", }, 75 { .dev_id = "duart", },
76 { .dev_id = "mxs-auart.0", }, 76 { .dev_id = "mxs-auart.0", },
77 { .dev_id = "mxs-auart.1", }, 77 { .dev_id = "mxs-auart.1", },
@@ -80,31 +80,31 @@ static struct clk_lookup uart_lookups[] __initdata = {
80 { .dev_id = "80070000.serial", }, 80 { .dev_id = "80070000.serial", },
81}; 81};
82 82
83static struct clk_lookup hbus_lookups[] __initdata = { 83static struct clk_lookup hbus_lookups[] = {
84 { .dev_id = "imx23-dma-apbh", }, 84 { .dev_id = "imx23-dma-apbh", },
85 { .dev_id = "80004000.dma-apbh", }, 85 { .dev_id = "80004000.dma-apbh", },
86}; 86};
87 87
88static struct clk_lookup xbus_lookups[] __initdata = { 88static struct clk_lookup xbus_lookups[] = {
89 { .dev_id = "duart", .con_id = "apb_pclk"}, 89 { .dev_id = "duart", .con_id = "apb_pclk"},
90 { .dev_id = "80070000.serial", .con_id = "apb_pclk"}, 90 { .dev_id = "80070000.serial", .con_id = "apb_pclk"},
91 { .dev_id = "imx23-dma-apbx", }, 91 { .dev_id = "imx23-dma-apbx", },
92 { .dev_id = "80024000.dma-apbx", }, 92 { .dev_id = "80024000.dma-apbx", },
93}; 93};
94 94
95static struct clk_lookup ssp_lookups[] __initdata = { 95static struct clk_lookup ssp_lookups[] = {
96 { .dev_id = "imx23-mmc.0", }, 96 { .dev_id = "imx23-mmc.0", },
97 { .dev_id = "imx23-mmc.1", }, 97 { .dev_id = "imx23-mmc.1", },
98 { .dev_id = "80010000.ssp", }, 98 { .dev_id = "80010000.ssp", },
99 { .dev_id = "80034000.ssp", }, 99 { .dev_id = "80034000.ssp", },
100}; 100};
101 101
102static struct clk_lookup lcdif_lookups[] __initdata = { 102static struct clk_lookup lcdif_lookups[] = {
103 { .dev_id = "imx23-fb", }, 103 { .dev_id = "imx23-fb", },
104 { .dev_id = "80030000.lcdif", }, 104 { .dev_id = "80030000.lcdif", },
105}; 105};
106 106
107static struct clk_lookup gpmi_lookups[] __initdata = { 107static struct clk_lookup gpmi_lookups[] = {
108 { .dev_id = "imx23-gpmi-nand", }, 108 { .dev_id = "imx23-gpmi-nand", },
109 { .dev_id = "8000c000.gpmi", }, 109 { .dev_id = "8000c000.gpmi", },
110}; 110};
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c
index 2826a2606a29..7fad6c8c13d2 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -120,7 +120,7 @@ static void __init clk_misc_init(void)
120 writel_relaxed(val, FRAC0); 120 writel_relaxed(val, FRAC0);
121} 121}
122 122
123static struct clk_lookup uart_lookups[] __initdata = { 123static struct clk_lookup uart_lookups[] = {
124 { .dev_id = "duart", }, 124 { .dev_id = "duart", },
125 { .dev_id = "mxs-auart.0", }, 125 { .dev_id = "mxs-auart.0", },
126 { .dev_id = "mxs-auart.1", }, 126 { .dev_id = "mxs-auart.1", },
@@ -135,71 +135,71 @@ static struct clk_lookup uart_lookups[] __initdata = {
135 { .dev_id = "80074000.serial", }, 135 { .dev_id = "80074000.serial", },
136}; 136};
137 137
138static struct clk_lookup hbus_lookups[] __initdata = { 138static struct clk_lookup hbus_lookups[] = {
139 { .dev_id = "imx28-dma-apbh", }, 139 { .dev_id = "imx28-dma-apbh", },
140 { .dev_id = "80004000.dma-apbh", }, 140 { .dev_id = "80004000.dma-apbh", },
141}; 141};
142 142
143static struct clk_lookup xbus_lookups[] __initdata = { 143static struct clk_lookup xbus_lookups[] = {
144 { .dev_id = "duart", .con_id = "apb_pclk"}, 144 { .dev_id = "duart", .con_id = "apb_pclk"},
145 { .dev_id = "80074000.serial", .con_id = "apb_pclk"}, 145 { .dev_id = "80074000.serial", .con_id = "apb_pclk"},
146 { .dev_id = "imx28-dma-apbx", }, 146 { .dev_id = "imx28-dma-apbx", },
147 { .dev_id = "80024000.dma-apbx", }, 147 { .dev_id = "80024000.dma-apbx", },
148}; 148};
149 149
150static struct clk_lookup ssp0_lookups[] __initdata = { 150static struct clk_lookup ssp0_lookups[] = {
151 { .dev_id = "imx28-mmc.0", }, 151 { .dev_id = "imx28-mmc.0", },
152 { .dev_id = "80010000.ssp", }, 152 { .dev_id = "80010000.ssp", },
153}; 153};
154 154
155static struct clk_lookup ssp1_lookups[] __initdata = { 155static struct clk_lookup ssp1_lookups[] = {
156 { .dev_id = "imx28-mmc.1", }, 156 { .dev_id = "imx28-mmc.1", },
157 { .dev_id = "80012000.ssp", }, 157 { .dev_id = "80012000.ssp", },
158}; 158};
159 159
160static struct clk_lookup ssp2_lookups[] __initdata = { 160static struct clk_lookup ssp2_lookups[] = {
161 { .dev_id = "imx28-mmc.2", }, 161 { .dev_id = "imx28-mmc.2", },
162 { .dev_id = "80014000.ssp", }, 162 { .dev_id = "80014000.ssp", },
163}; 163};
164 164
165static struct clk_lookup ssp3_lookups[] __initdata = { 165static struct clk_lookup ssp3_lookups[] = {
166 { .dev_id = "imx28-mmc.3", }, 166 { .dev_id = "imx28-mmc.3", },
167 { .dev_id = "80016000.ssp", }, 167 { .dev_id = "80016000.ssp", },
168}; 168};
169 169
170static struct clk_lookup lcdif_lookups[] __initdata = { 170static struct clk_lookup lcdif_lookups[] = {
171 { .dev_id = "imx28-fb", }, 171 { .dev_id = "imx28-fb", },
172 { .dev_id = "80030000.lcdif", }, 172 { .dev_id = "80030000.lcdif", },
173}; 173};
174 174
175static struct clk_lookup gpmi_lookups[] __initdata = { 175static struct clk_lookup gpmi_lookups[] = {
176 { .dev_id = "imx28-gpmi-nand", }, 176 { .dev_id = "imx28-gpmi-nand", },
177 { .dev_id = "8000c000.gpmi", }, 177 { .dev_id = "8000c000.gpmi", },
178}; 178};
179 179
180static struct clk_lookup fec_lookups[] __initdata = { 180static struct clk_lookup fec_lookups[] = {
181 { .dev_id = "imx28-fec.0", }, 181 { .dev_id = "imx28-fec.0", },
182 { .dev_id = "imx28-fec.1", }, 182 { .dev_id = "imx28-fec.1", },
183 { .dev_id = "800f0000.ethernet", }, 183 { .dev_id = "800f0000.ethernet", },
184 { .dev_id = "800f4000.ethernet", }, 184 { .dev_id = "800f4000.ethernet", },
185}; 185};
186 186
187static struct clk_lookup can0_lookups[] __initdata = { 187static struct clk_lookup can0_lookups[] = {
188 { .dev_id = "flexcan.0", }, 188 { .dev_id = "flexcan.0", },
189 { .dev_id = "80032000.can", }, 189 { .dev_id = "80032000.can", },
190}; 190};
191 191
192static struct clk_lookup can1_lookups[] __initdata = { 192static struct clk_lookup can1_lookups[] = {
193 { .dev_id = "flexcan.1", }, 193 { .dev_id = "flexcan.1", },
194 { .dev_id = "80034000.can", }, 194 { .dev_id = "80034000.can", },
195}; 195};
196 196
197static struct clk_lookup saif0_lookups[] __initdata = { 197static struct clk_lookup saif0_lookups[] = {
198 { .dev_id = "mxs-saif.0", }, 198 { .dev_id = "mxs-saif.0", },
199 { .dev_id = "80042000.saif", }, 199 { .dev_id = "80042000.saif", },
200}; 200};
201 201
202static struct clk_lookup saif1_lookups[] __initdata = { 202static struct clk_lookup saif1_lookups[] = {
203 { .dev_id = "mxs-saif.1", }, 203 { .dev_id = "mxs-saif.1", },
204 { .dev_id = "80046000.saif", }, 204 { .dev_id = "80046000.saif", },
205}; 205};
@@ -245,8 +245,8 @@ int __init mx28_clocks_init(void)
245 clks[pll2] = mxs_clk_pll("pll2", "ref_xtal", PLL2CTRL0, 23, 50000000); 245 clks[pll2] = mxs_clk_pll("pll2", "ref_xtal", PLL2CTRL0, 23, 50000000);
246 clks[ref_cpu] = mxs_clk_ref("ref_cpu", "pll0", FRAC0, 0); 246 clks[ref_cpu] = mxs_clk_ref("ref_cpu", "pll0", FRAC0, 0);
247 clks[ref_emi] = mxs_clk_ref("ref_emi", "pll0", FRAC0, 1); 247 clks[ref_emi] = mxs_clk_ref("ref_emi", "pll0", FRAC0, 1);
248 clks[ref_io0] = mxs_clk_ref("ref_io0", "pll0", FRAC0, 2); 248 clks[ref_io1] = mxs_clk_ref("ref_io1", "pll0", FRAC0, 2);
249 clks[ref_io1] = mxs_clk_ref("ref_io1", "pll0", FRAC0, 3); 249 clks[ref_io0] = mxs_clk_ref("ref_io0", "pll0", FRAC0, 3);
250 clks[ref_pix] = mxs_clk_ref("ref_pix", "pll0", FRAC1, 0); 250 clks[ref_pix] = mxs_clk_ref("ref_pix", "pll0", FRAC1, 0);
251 clks[ref_hsadc] = mxs_clk_ref("ref_hsadc", "pll0", FRAC1, 1); 251 clks[ref_hsadc] = mxs_clk_ref("ref_hsadc", "pll0", FRAC1, 1);
252 clks[ref_gpmi] = mxs_clk_ref("ref_gpmi", "pll0", FRAC1, 2); 252 clks[ref_gpmi] = mxs_clk_ref("ref_gpmi", "pll0", FRAC1, 2);
diff --git a/drivers/clk/spear/spear6xx_clock.c b/drivers/clk/spear/spear6xx_clock.c
index 554d64b062a1..61026ae564ab 100644
--- a/drivers/clk/spear/spear6xx_clock.c
+++ b/drivers/clk/spear/spear6xx_clock.c
@@ -298,7 +298,7 @@ void __init spear6xx_clk_init(void)
298 298
299 clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0, PERIP1_CLK_ENB, 299 clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0, PERIP1_CLK_ENB,
300 GMAC_CLK_ENB, 0, &_lock); 300 GMAC_CLK_ENB, 0, &_lock);
301 clk_register_clkdev(clk, NULL, "gmac"); 301 clk_register_clkdev(clk, NULL, "e0800000.ethernet");
302 302
303 clk = clk_register_gate(NULL, "i2c_clk", "ahb_clk", 0, PERIP1_CLK_ENB, 303 clk = clk_register_gate(NULL, "i2c_clk", "ahb_clk", 0, PERIP1_CLK_ENB,
304 I2C_CLK_ENB, 0, &_lock); 304 I2C_CLK_ENB, 0, &_lock);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b1fe0edda955..ed3224c37423 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -412,7 +412,6 @@ static void gen6_queue_rps_work(struct drm_i915_private *dev_priv,
412 */ 412 */
413 413
414 spin_lock_irqsave(&dev_priv->rps_lock, flags); 414 spin_lock_irqsave(&dev_priv->rps_lock, flags);
415 WARN(dev_priv->pm_iir & pm_iir, "Missed a PM interrupt\n");
416 dev_priv->pm_iir |= pm_iir; 415 dev_priv->pm_iir |= pm_iir;
417 I915_WRITE(GEN6_PMIMR, dev_priv->pm_iir); 416 I915_WRITE(GEN6_PMIMR, dev_priv->pm_iir);
418 POSTING_READ(GEN6_PMIMR); 417 POSTING_READ(GEN6_PMIMR);
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 0ede02a99d91..a748e5cabe14 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -740,8 +740,11 @@ static void i915_restore_display(struct drm_device *dev)
740 if (HAS_PCH_SPLIT(dev)) { 740 if (HAS_PCH_SPLIT(dev)) {
741 I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->saveBLC_PWM_CTL); 741 I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->saveBLC_PWM_CTL);
742 I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->saveBLC_PWM_CTL2); 742 I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->saveBLC_PWM_CTL2);
743 I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL); 743 /* NOTE: BLC_PWM_CPU_CTL must be written after BLC_PWM_CPU_CTL2;
744 * otherwise we get blank eDP screen after S3 on some machines
745 */
744 I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->saveBLC_CPU_PWM_CTL2); 746 I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->saveBLC_CPU_PWM_CTL2);
747 I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL);
745 I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS); 748 I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS);
746 I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS); 749 I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS);
747 I915_WRITE(PCH_PP_DIVISOR, dev_priv->savePP_DIVISOR); 750 I915_WRITE(PCH_PP_DIVISOR, dev_priv->savePP_DIVISOR);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a7c727d0c105..a8538ac0299d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6921,19 +6921,6 @@ static void i915_disable_vga(struct drm_device *dev)
6921 POSTING_READ(vga_reg); 6921 POSTING_READ(vga_reg);
6922} 6922}
6923 6923
6924static void ivb_pch_pwm_override(struct drm_device *dev)
6925{
6926 struct drm_i915_private *dev_priv = dev->dev_private;
6927
6928 /*
6929 * IVB has CPU eDP backlight regs too, set things up to let the
6930 * PCH regs control the backlight
6931 */
6932 I915_WRITE(BLC_PWM_CPU_CTL2, PWM_ENABLE);
6933 I915_WRITE(BLC_PWM_CPU_CTL, 0);
6934 I915_WRITE(BLC_PWM_PCH_CTL1, PWM_ENABLE | (1<<30));
6935}
6936
6937void intel_modeset_init_hw(struct drm_device *dev) 6924void intel_modeset_init_hw(struct drm_device *dev)
6938{ 6925{
6939 struct drm_i915_private *dev_priv = dev->dev_private; 6926 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -6950,9 +6937,6 @@ void intel_modeset_init_hw(struct drm_device *dev)
6950 gen6_enable_rps(dev_priv); 6937 gen6_enable_rps(dev_priv);
6951 gen6_update_ring_freq(dev_priv); 6938 gen6_update_ring_freq(dev_priv);
6952 } 6939 }
6953
6954 if (IS_IVYBRIDGE(dev))
6955 ivb_pch_pwm_override(dev);
6956} 6940}
6957 6941
6958void intel_modeset_init(struct drm_device *dev) 6942void intel_modeset_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 153b9a15469b..1074bc5dd418 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -467,7 +467,7 @@ int nouveau_fbcon_init(struct drm_device *dev)
467 nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; 467 nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs;
468 468
469 ret = drm_fb_helper_init(dev, &nfbdev->helper, 469 ret = drm_fb_helper_init(dev, &nfbdev->helper,
470 nv_two_heads(dev) ? 2 : 1, 4); 470 dev->mode_config.num_crtc, 4);
471 if (ret) { 471 if (ret) {
472 kfree(nfbdev); 472 kfree(nfbdev);
473 return ret; 473 return ret;
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
index a89240e5fb29..a25cf2cb931f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -1,3 +1,26 @@
1/*
2 * Copyright 2011 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Authors: Dave Airlie
23 */
1 24
2#include "drmP.h" 25#include "drmP.h"
3#include "drm.h" 26#include "drm.h"
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index a8d5f09428c7..4c2d836a0893 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -61,7 +61,7 @@ static int udl_parse_vendor_descriptor(struct drm_device *dev,
61 u8 length; 61 u8 length;
62 u16 key; 62 u16 key;
63 63
64 key = *((u16 *) desc); 64 key = le16_to_cpu(*((u16 *) desc));
65 desc += sizeof(u16); 65 desc += sizeof(u16);
66 length = *desc; 66 length = *desc;
67 desc++; 67 desc++;
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 034c80a10f1f..bef04c192768 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -1,20 +1,11 @@
1# 1#
2# HID driver configuration 2# HID driver configuration
3# 3#
4menuconfig HID_SUPPORT 4menu "HID support"
5 bool "HID Devices" 5 depends on INPUT
6 depends on INPUT
7 default y
8 ---help---
9 Say Y here to get to see options for various computer-human interface
10 device drivers. This option alone does not add any kernel code.
11
12 If you say N, all options in this submenu will be skipped and disabled.
13
14if HID_SUPPORT
15 6
16config HID 7config HID
17 tristate "Generic HID support" 8 tristate "HID bus support"
18 depends on INPUT 9 depends on INPUT
19 default y 10 default y
20 ---help--- 11 ---help---
@@ -23,14 +14,17 @@ config HID
23 most commonly used to refer to the USB-HID specification, but other 14 most commonly used to refer to the USB-HID specification, but other
24 devices (such as, but not strictly limited to, Bluetooth) are 15 devices (such as, but not strictly limited to, Bluetooth) are
25 designed using HID specification (this involves certain keyboards, 16 designed using HID specification (this involves certain keyboards,
26 mice, tablets, etc). This option compiles into kernel the generic 17 mice, tablets, etc). This option adds the HID bus to the kernel,
27 HID layer code (parser, usages, etc.), which can then be used by 18 together with generic HID layer code. The HID devices are added and
28 transport-specific HID implementation (like USB or Bluetooth). 19 removed from the HID bus by the transport-layer drivers, such as
20 usbhid (USB_HID) and hidp (BT_HIDP).
29 21
30 For docs and specs, see http://www.usb.org/developers/hidpage/ 22 For docs and specs, see http://www.usb.org/developers/hidpage/
31 23
32 If unsure, say Y. 24 If unsure, say Y.
33 25
26if HID
27
34config HID_BATTERY_STRENGTH 28config HID_BATTERY_STRENGTH
35 bool "Battery level reporting for HID devices" 29 bool "Battery level reporting for HID devices"
36 depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY 30 depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY
@@ -59,23 +53,22 @@ config HIDRAW
59 53
60 If unsure, say Y. 54 If unsure, say Y.
61 55
62source "drivers/hid/usbhid/Kconfig"
63
64menu "Special HID drivers"
65 depends on HID
66
67config HID_GENERIC 56config HID_GENERIC
68 tristate "Generic HID driver" 57 tristate "Generic HID driver"
69 depends on HID 58 depends on HID
70 default y 59 default HID
71 ---help--- 60 ---help---
72 Support for generic HID devices. 61 Support for generic devices on the HID bus. This includes most
62 keyboards and mice, joysticks, tablets and digitizers.
73 63
74 To compile this driver as a module, choose M here: the module 64 To compile this driver as a module, choose M here: the module
75 will be called hid-generic. 65 will be called hid-generic.
76 66
77 If unsure, say Y. 67 If unsure, say Y.
78 68
69menu "Special HID drivers"
70 depends on HID
71
79config HID_A4TECH 72config HID_A4TECH
80 tristate "A4 tech mice" if EXPERT 73 tristate "A4 tech mice" if EXPERT
81 depends on USB_HID 74 depends on USB_HID
@@ -662,4 +655,8 @@ config HID_ZYDACRON
662 655
663endmenu 656endmenu
664 657
665endif # HID_SUPPORT 658endif # HID
659
660source "drivers/hid/usbhid/Kconfig"
661
662endmenu
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8e3a6b261477..6ac0286b5375 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1880,6 +1880,7 @@ static const struct hid_device_id hid_ignore_list[] = {
1880 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)}, 1880 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)},
1881 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)}, 1881 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)},
1882 { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) }, 1882 { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) },
1883 { HID_USB_DEVICE(USB_VENDOR_ID_AXENTIA, USB_DEVICE_ID_AXENTIA_FM_RADIO) },
1883 { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) }, 1884 { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) },
1884 { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) }, 1885 { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) },
1885 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) }, 1886 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 9373f535dfe9..d1cdd2d28409 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -160,6 +160,9 @@
160#define USB_VENDOR_ID_AVERMEDIA 0x07ca 160#define USB_VENDOR_ID_AVERMEDIA 0x07ca
161#define USB_DEVICE_ID_AVER_FM_MR800 0xb800 161#define USB_DEVICE_ID_AVER_FM_MR800 0xb800
162 162
163#define USB_VENDOR_ID_AXENTIA 0x12cf
164#define USB_DEVICE_ID_AXENTIA_FM_RADIO 0x7111
165
163#define USB_VENDOR_ID_BAANTO 0x2453 166#define USB_VENDOR_ID_BAANTO 0x2453
164#define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100 167#define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100
165 168
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 5e8a7ed42344..0f9c146fc00d 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -436,27 +436,37 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
436 436
437static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) 437static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
438{ 438{
439 struct dj_report dj_report; 439 struct dj_report *dj_report;
440 int retval;
440 441
441 memset(&dj_report, 0, sizeof(dj_report)); 442 dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL);
442 dj_report.report_id = REPORT_ID_DJ_SHORT; 443 if (!dj_report)
443 dj_report.device_index = 0xFF; 444 return -ENOMEM;
444 dj_report.report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES; 445 dj_report->report_id = REPORT_ID_DJ_SHORT;
445 return logi_dj_recv_send_report(djrcv_dev, &dj_report); 446 dj_report->device_index = 0xFF;
447 dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
448 retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
449 kfree(dj_report);
450 return retval;
446} 451}
447 452
448static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, 453static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
449 unsigned timeout) 454 unsigned timeout)
450{ 455{
451 struct dj_report dj_report; 456 struct dj_report *dj_report;
457 int retval;
452 458
453 memset(&dj_report, 0, sizeof(dj_report)); 459 dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL);
454 dj_report.report_id = REPORT_ID_DJ_SHORT; 460 if (!dj_report)
455 dj_report.device_index = 0xFF; 461 return -ENOMEM;
456 dj_report.report_type = REPORT_TYPE_CMD_SWITCH; 462 dj_report->report_id = REPORT_ID_DJ_SHORT;
457 dj_report.report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F; 463 dj_report->device_index = 0xFF;
458 dj_report.report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout; 464 dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
459 return logi_dj_recv_send_report(djrcv_dev, &dj_report); 465 dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
466 dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout;
467 retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
468 kfree(dj_report);
469 return retval;
460} 470}
461 471
462 472
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 7cf3ffe4b7bc..40ac6654f1d1 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -426,8 +426,10 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h
426 __set_bit(EV_ABS, input->evbit); 426 __set_bit(EV_ABS, input->evbit);
427 427
428 input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0); 428 input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0);
429 input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 4, 0); 429 input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255 << 2,
430 input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255, 4, 0); 430 4, 0);
431 input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255 << 2,
432 4, 0);
431 input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0); 433 input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0);
432 434
433 /* Note: Touch Y position from the device is inverted relative 435 /* Note: Touch Y position from the device is inverted relative
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig
index 0f20fd17cf06..0108c5991a04 100644
--- a/drivers/hid/usbhid/Kconfig
+++ b/drivers/hid/usbhid/Kconfig
@@ -1,13 +1,13 @@
1comment "USB Input Devices" 1menu "USB HID support"
2 depends on USB 2 depends on USB
3 3
4config USB_HID 4config USB_HID
5 tristate "USB Human Interface Device (full HID) support" 5 tristate "USB HID transport layer"
6 default y 6 default y
7 depends on USB && INPUT 7 depends on USB && INPUT
8 select HID 8 select HID
9 ---help--- 9 ---help---
10 Say Y here if you want full HID support to connect USB keyboards, 10 Say Y here if you want to connect USB keyboards,
11 mice, joysticks, graphic tablets, or any other HID based devices 11 mice, joysticks, graphic tablets, or any other HID based devices
12 to your computer via USB, as well as Uninterruptible Power Supply 12 to your computer via USB, as well as Uninterruptible Power Supply
13 (UPS) and monitor control devices. 13 (UPS) and monitor control devices.
@@ -81,4 +81,4 @@ config USB_MOUSE
81 81
82endmenu 82endmenu
83 83
84 84endmenu
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 70d62f5bc909..2cde9ecf7731 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -8,7 +8,7 @@
8 * 8 *
9 * Based on hdaps.c driver: 9 * Based on hdaps.c driver:
10 * Copyright (C) 2005 Robert Love <rml@novell.com> 10 * Copyright (C) 2005 Robert Love <rml@novell.com>
11 * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com> 11 * Copyright (C) 2005 Jesper Juhl <jj@chaosbits.net>
12 * 12 *
13 * Fan control based on smcFanControl: 13 * Fan control based on smcFanControl:
14 * Copyright (C) 2006 Hendrik Holtmann <holtmann@mac.com> 14 * Copyright (C) 2006 Hendrik Holtmann <holtmann@mac.com>
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 7f1feb2f467a..637c51c11b44 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -693,7 +693,7 @@ static void __cpuinit get_core_online(unsigned int cpu)
693 * sensors. We check this bit only, all the early CPUs 693 * sensors. We check this bit only, all the early CPUs
694 * without thermal sensors will be filtered out. 694 * without thermal sensors will be filtered out.
695 */ 695 */
696 if (!cpu_has(c, X86_FEATURE_DTS)) 696 if (!cpu_has(c, X86_FEATURE_DTHERM))
697 return; 697 return;
698 698
699 if (!pdev) { 699 if (!pdev) {
@@ -794,7 +794,7 @@ static struct notifier_block coretemp_cpu_notifier __refdata = {
794}; 794};
795 795
796static const struct x86_cpu_id coretemp_ids[] = { 796static const struct x86_cpu_id coretemp_ids[] = {
797 { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTS }, 797 { X86_VENDOR_INTEL, X86_FAMILY_ANY, X86_MODEL_ANY, X86_FEATURE_DTHERM },
798 {} 798 {}
799}; 799};
800MODULE_DEVICE_TABLE(x86cpu, coretemp_ids); 800MODULE_DEVICE_TABLE(x86cpu, coretemp_ids);
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index a9bfd6736d9a..e72ba5d2a824 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -590,6 +590,6 @@ abort:
590 590
591module_i2c_driver(jc42_driver); 591module_i2c_driver(jc42_driver);
592 592
593MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); 593MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
594MODULE_DESCRIPTION("JC42 driver"); 594MODULE_DESCRIPTION("JC42 driver");
595MODULE_LICENSE("GPL"); 595MODULE_LICENSE("GPL");
diff --git a/drivers/hwmon/lineage-pem.c b/drivers/hwmon/lineage-pem.c
index d264937c7f5e..bd75d2415432 100644
--- a/drivers/hwmon/lineage-pem.c
+++ b/drivers/hwmon/lineage-pem.c
@@ -567,6 +567,6 @@ static struct i2c_driver pem_driver = {
567 567
568module_i2c_driver(pem_driver); 568module_i2c_driver(pem_driver);
569 569
570MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); 570MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
571MODULE_DESCRIPTION("Lineage CPL PEM hardware monitoring driver"); 571MODULE_DESCRIPTION("Lineage CPL PEM hardware monitoring driver");
572MODULE_LICENSE("GPL"); 572MODULE_LICENSE("GPL");
diff --git a/drivers/hwmon/ltc4261.c b/drivers/hwmon/ltc4261.c
index 069b7d34d8f9..77476a575c4e 100644
--- a/drivers/hwmon/ltc4261.c
+++ b/drivers/hwmon/ltc4261.c
@@ -292,6 +292,6 @@ static struct i2c_driver ltc4261_driver = {
292 292
293module_i2c_driver(ltc4261_driver); 293module_i2c_driver(ltc4261_driver);
294 294
295MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); 295MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
296MODULE_DESCRIPTION("LTC4261 driver"); 296MODULE_DESCRIPTION("LTC4261 driver");
297MODULE_LICENSE("GPL"); 297MODULE_LICENSE("GPL");
diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c
index 822261be84dd..019427d7a5fd 100644
--- a/drivers/hwmon/max16065.c
+++ b/drivers/hwmon/max16065.c
@@ -692,6 +692,6 @@ static struct i2c_driver max16065_driver = {
692 692
693module_i2c_driver(max16065_driver); 693module_i2c_driver(max16065_driver);
694 694
695MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); 695MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
696MODULE_DESCRIPTION("MAX16065 driver"); 696MODULE_DESCRIPTION("MAX16065 driver");
697MODULE_LICENSE("GPL"); 697MODULE_LICENSE("GPL");
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index 7d42c11c8684..0cdbd742974a 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -198,7 +198,6 @@ static int fops_open(struct file *file)
198 struct saa7146_dev *dev = video_drvdata(file); 198 struct saa7146_dev *dev = video_drvdata(file);
199 struct saa7146_fh *fh = NULL; 199 struct saa7146_fh *fh = NULL;
200 int result = 0; 200 int result = 0;
201 enum v4l2_buf_type type;
202 201
203 DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev)); 202 DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev));
204 203
@@ -207,10 +206,6 @@ static int fops_open(struct file *file)
207 206
208 DEB_D("using: %p\n", dev); 207 DEB_D("using: %p\n", dev);
209 208
210 type = vdev->vfl_type == VFL_TYPE_GRABBER
211 ? V4L2_BUF_TYPE_VIDEO_CAPTURE
212 : V4L2_BUF_TYPE_VBI_CAPTURE;
213
214 /* check if an extension is registered */ 209 /* check if an extension is registered */
215 if( NULL == dev->ext ) { 210 if( NULL == dev->ext ) {
216 DEB_S("no extension registered for this device\n"); 211 DEB_S("no extension registered for this device\n");
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c
index 98ecaf0900d6..3180f5b2a6a6 100644
--- a/drivers/media/dvb/frontends/cx24110.c
+++ b/drivers/media/dvb/frontends/cx24110.c
@@ -516,9 +516,9 @@ static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
516 if(cx24110_readreg(state,0x10)&0x40) { 516 if(cx24110_readreg(state,0x10)&0x40) {
517 /* the RS error counter has finished one counting window */ 517 /* the RS error counter has finished one counting window */
518 cx24110_writereg(state,0x10,0x60); /* select the byer reg */ 518 cx24110_writereg(state,0x10,0x60); /* select the byer reg */
519 cx24110_readreg(state, 0x12) | 519 (void)(cx24110_readreg(state, 0x12) |
520 (cx24110_readreg(state, 0x13) << 8) | 520 (cx24110_readreg(state, 0x13) << 8) |
521 (cx24110_readreg(state, 0x14) << 16); 521 (cx24110_readreg(state, 0x14) << 16));
522 cx24110_writereg(state,0x10,0x70); /* select the bler reg */ 522 cx24110_writereg(state,0x10,0x70); /* select the bler reg */
523 state->lastbler=cx24110_readreg(state,0x12)| 523 state->lastbler=cx24110_readreg(state,0x12)|
524 (cx24110_readreg(state,0x13)<<8)| 524 (cx24110_readreg(state,0x13)<<8)|
diff --git a/drivers/media/dvb/frontends/cxd2820r_c.c b/drivers/media/dvb/frontends/cxd2820r_c.c
index 945404991529..ed3b0ba624de 100644
--- a/drivers/media/dvb/frontends/cxd2820r_c.c
+++ b/drivers/media/dvb/frontends/cxd2820r_c.c
@@ -121,7 +121,7 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe)
121 if (ret) 121 if (ret)
122 goto error; 122 goto error;
123 123
124 switch ((buf[0] >> 0) & 0x03) { 124 switch ((buf[0] >> 0) & 0x07) {
125 case 0: 125 case 0:
126 c->modulation = QAM_16; 126 c->modulation = QAM_16;
127 break; 127 break;
diff --git a/drivers/media/dvb/frontends/lg2160.c b/drivers/media/dvb/frontends/lg2160.c
index a3ab1a5b6597..cc11260e99df 100644
--- a/drivers/media/dvb/frontends/lg2160.c
+++ b/drivers/media/dvb/frontends/lg2160.c
@@ -126,7 +126,7 @@ static int lg216x_write_regs(struct lg216x_state *state,
126 126
127 lg_reg("writing %d registers...\n", len); 127 lg_reg("writing %d registers...\n", len);
128 128
129 for (i = 0; i < len - 1; i++) { 129 for (i = 0; i < len; i++) {
130 ret = lg216x_write_reg(state, regs[i].reg, regs[i].val); 130 ret = lg216x_write_reg(state, regs[i].reg, regs[i].val);
131 if (lg_fail(ret)) 131 if (lg_fail(ret))
132 return ret; 132 return ret;
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index 63c004a25e0b..664e460f247b 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -544,6 +544,8 @@ static const struct usb_device_id smsusb_id_table[] __devinitconst = {
544 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, 544 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
545 { USB_DEVICE(0x2040, 0xc0a0), 545 { USB_DEVICE(0x2040, 0xc0a0),
546 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, 546 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
547 { USB_DEVICE(0x2040, 0xf5a0),
548 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
547 { } /* Terminating entry */ 549 { } /* Terminating entry */
548 }; 550 };
549 551
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index 740a3d5520c7..b415211d0c4b 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -157,7 +157,7 @@ static int __devinit maxiradio_probe(struct pci_dev *pdev, const struct pci_devi
157 goto err_out_free_region; 157 goto err_out_free_region;
158 158
159 dev->io = pci_resource_start(pdev, 0); 159 dev->io = pci_resource_start(pdev, 0);
160 if (snd_tea575x_init(&dev->tea)) { 160 if (snd_tea575x_init(&dev->tea, THIS_MODULE)) {
161 printk(KERN_ERR "radio-maxiradio: Unable to detect TEA575x tuner\n"); 161 printk(KERN_ERR "radio-maxiradio: Unable to detect TEA575x tuner\n");
162 goto err_out_free_region; 162 goto err_out_free_region;
163 } 163 }
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c
index 52b8011f1b23..4efcbec74c52 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -238,7 +238,7 @@ static int __devinit fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io)
238 snprintf(fmr2->tea.bus_info, sizeof(fmr2->tea.bus_info), "%s:%s", 238 snprintf(fmr2->tea.bus_info, sizeof(fmr2->tea.bus_info), "%s:%s",
239 fmr2->is_fmd2 ? "PnP" : "ISA", dev_name(pdev)); 239 fmr2->is_fmd2 ? "PnP" : "ISA", dev_name(pdev));
240 240
241 if (snd_tea575x_init(&fmr2->tea)) { 241 if (snd_tea575x_init(&fmr2->tea, THIS_MODULE)) {
242 printk(KERN_ERR "radio-sf16fmr2: Unable to detect TEA575x tuner\n"); 242 printk(KERN_ERR "radio-sf16fmr2: Unable to detect TEA575x tuner\n");
243 release_region(fmr2->io, 2); 243 release_region(fmr2->io, 2);
244 return -ENODEV; 244 return -ENODEV;
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c
index e9f638761296..f412f7ab270b 100644
--- a/drivers/media/radio/si470x/radio-si470x-usb.c
+++ b/drivers/media/radio/si470x/radio-si470x-usb.c
@@ -51,6 +51,8 @@ static struct usb_device_id si470x_usb_driver_id_table[] = {
51 { USB_DEVICE_AND_INTERFACE_INFO(0x1b80, 0xd700, USB_CLASS_HID, 0, 0) }, 51 { USB_DEVICE_AND_INTERFACE_INFO(0x1b80, 0xd700, USB_CLASS_HID, 0, 0) },
52 /* Sanei Electric, Inc. FM USB Radio (sold as DealExtreme.com PCear) */ 52 /* Sanei Electric, Inc. FM USB Radio (sold as DealExtreme.com PCear) */
53 { USB_DEVICE_AND_INTERFACE_INFO(0x10c5, 0x819a, USB_CLASS_HID, 0, 0) }, 53 { USB_DEVICE_AND_INTERFACE_INFO(0x10c5, 0x819a, USB_CLASS_HID, 0, 0) },
54 /* Axentia ALERT FM USB Receiver */
55 { USB_DEVICE_AND_INTERFACE_INFO(0x12cf, 0x7111, USB_CLASS_HID, 0, 0) },
54 /* Terminating entry */ 56 /* Terminating entry */
55 { } 57 { }
56}; 58};
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index ff2933ab705f..856ab962cd63 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -371,7 +371,6 @@ struct tvcard bttv_tvcards[] = {
371 .muxsel = MUXSEL(2, 3, 1, 1), 371 .muxsel = MUXSEL(2, 3, 1, 1),
372 .gpiomux = { 2, 0, 0, 0 }, 372 .gpiomux = { 2, 0, 0, 0 },
373 .gpiomute = 10, 373 .gpiomute = 10,
374 .needs_tvaudio = 1,
375 .tuner_type = UNSET, 374 .tuner_type = UNSET,
376 .tuner_addr = ADDR_UNSET, 375 .tuner_addr = ADDR_UNSET,
377 }, 376 },
@@ -384,7 +383,6 @@ struct tvcard bttv_tvcards[] = {
384 .muxsel = MUXSEL(2, 3, 1, 1), 383 .muxsel = MUXSEL(2, 3, 1, 1),
385 .gpiomux = { 0, 1, 2, 3 }, 384 .gpiomux = { 0, 1, 2, 3 },
386 .gpiomute = 4, 385 .gpiomute = 4,
387 .needs_tvaudio = 1,
388 .tuner_type = UNSET, 386 .tuner_type = UNSET,
389 .tuner_addr = ADDR_UNSET, 387 .tuner_addr = ADDR_UNSET,
390 }, 388 },
@@ -398,7 +396,6 @@ struct tvcard bttv_tvcards[] = {
398 .gpiomux = { 4, 0, 2, 3 }, 396 .gpiomux = { 4, 0, 2, 3 },
399 .gpiomute = 1, 397 .gpiomute = 1,
400 .no_msp34xx = 1, 398 .no_msp34xx = 1,
401 .needs_tvaudio = 1,
402 .tuner_type = TUNER_PHILIPS_NTSC, 399 .tuner_type = TUNER_PHILIPS_NTSC,
403 .tuner_addr = ADDR_UNSET, 400 .tuner_addr = ADDR_UNSET,
404 .pll = PLL_28, 401 .pll = PLL_28,
@@ -414,7 +411,6 @@ struct tvcard bttv_tvcards[] = {
414 .gpiomask = 0, 411 .gpiomask = 0,
415 .muxsel = MUXSEL(2, 3, 1, 1), 412 .muxsel = MUXSEL(2, 3, 1, 1),
416 .gpiomux = { 0 }, 413 .gpiomux = { 0 },
417 .needs_tvaudio = 0,
418 .tuner_type = TUNER_ABSENT, 414 .tuner_type = TUNER_ABSENT,
419 .tuner_addr = ADDR_UNSET, 415 .tuner_addr = ADDR_UNSET,
420 }, 416 },
@@ -427,7 +423,6 @@ struct tvcard bttv_tvcards[] = {
427 .muxsel = MUXSEL(2, 3, 1, 0), 423 .muxsel = MUXSEL(2, 3, 1, 0),
428 .gpiomux = { 0, 1, 0, 1 }, 424 .gpiomux = { 0, 1, 0, 1 },
429 .gpiomute = 3, 425 .gpiomute = 3,
430 .needs_tvaudio = 1,
431 .tuner_type = UNSET, 426 .tuner_type = UNSET,
432 .tuner_addr = ADDR_UNSET, 427 .tuner_addr = ADDR_UNSET,
433 }, 428 },
@@ -440,7 +435,6 @@ struct tvcard bttv_tvcards[] = {
440 .gpiomask = 0x0f, 435 .gpiomask = 0x0f,
441 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 }, 436 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
442 /* 0x04 for some cards ?? */ 437 /* 0x04 for some cards ?? */
443 .needs_tvaudio = 1,
444 .tuner_type = UNSET, 438 .tuner_type = UNSET,
445 .tuner_addr = ADDR_UNSET, 439 .tuner_addr = ADDR_UNSET,
446 .audio_mode_gpio= avermedia_tvphone_audio, 440 .audio_mode_gpio= avermedia_tvphone_audio,
@@ -454,7 +448,6 @@ struct tvcard bttv_tvcards[] = {
454 .gpiomask = 0, 448 .gpiomask = 0,
455 .muxsel = MUXSEL(2, 3, 1, 0, 0), 449 .muxsel = MUXSEL(2, 3, 1, 0, 0),
456 .gpiomux = { 0 }, 450 .gpiomux = { 0 },
457 .needs_tvaudio = 1,
458 .tuner_type = TUNER_ABSENT, 451 .tuner_type = TUNER_ABSENT,
459 .tuner_addr = ADDR_UNSET, 452 .tuner_addr = ADDR_UNSET,
460 }, 453 },
@@ -469,7 +462,6 @@ struct tvcard bttv_tvcards[] = {
469 .muxsel = MUXSEL(2, 3, 1, 1), 462 .muxsel = MUXSEL(2, 3, 1, 1),
470 .gpiomux = { 0, 0xc00, 0x800, 0x400 }, 463 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
471 .gpiomute = 0xc00, 464 .gpiomute = 0xc00,
472 .needs_tvaudio = 1,
473 .pll = PLL_28, 465 .pll = PLL_28,
474 .tuner_type = UNSET, 466 .tuner_type = UNSET,
475 .tuner_addr = ADDR_UNSET, 467 .tuner_addr = ADDR_UNSET,
@@ -482,7 +474,6 @@ struct tvcard bttv_tvcards[] = {
482 .gpiomask = 3, 474 .gpiomask = 3,
483 .muxsel = MUXSEL(2, 3, 1, 1), 475 .muxsel = MUXSEL(2, 3, 1, 1),
484 .gpiomux = { 1, 1, 2, 3 }, 476 .gpiomux = { 1, 1, 2, 3 },
485 .needs_tvaudio = 0,
486 .pll = PLL_28, 477 .pll = PLL_28,
487 .tuner_type = TUNER_TEMIC_PAL, 478 .tuner_type = TUNER_TEMIC_PAL,
488 .tuner_addr = ADDR_UNSET, 479 .tuner_addr = ADDR_UNSET,
@@ -496,7 +487,6 @@ struct tvcard bttv_tvcards[] = {
496 .muxsel = MUXSEL(2, 0, 1, 1), 487 .muxsel = MUXSEL(2, 0, 1, 1),
497 .gpiomux = { 0, 1, 2, 3 }, 488 .gpiomux = { 0, 1, 2, 3 },
498 .gpiomute = 4, 489 .gpiomute = 4,
499 .needs_tvaudio = 1,
500 .pll = PLL_28, 490 .pll = PLL_28,
501 .tuner_type = UNSET, 491 .tuner_type = UNSET,
502 .tuner_addr = ADDR_UNSET, 492 .tuner_addr = ADDR_UNSET,
@@ -510,7 +500,6 @@ struct tvcard bttv_tvcards[] = {
510 .muxsel = MUXSEL(2, 3, 1, 1), 500 .muxsel = MUXSEL(2, 3, 1, 1),
511 .gpiomux = { 0x20001,0x10001, 0, 0 }, 501 .gpiomux = { 0x20001,0x10001, 0, 0 },
512 .gpiomute = 10, 502 .gpiomute = 10,
513 .needs_tvaudio = 1,
514 .tuner_type = UNSET, 503 .tuner_type = UNSET,
515 .tuner_addr = ADDR_UNSET, 504 .tuner_addr = ADDR_UNSET,
516 }, 505 },
@@ -524,7 +513,6 @@ struct tvcard bttv_tvcards[] = {
524 .gpiomask = 15, 513 .gpiomask = 15,
525 .muxsel = MUXSEL(2, 3, 1, 1), 514 .muxsel = MUXSEL(2, 3, 1, 1),
526 .gpiomux = { 13, 14, 11, 7 }, 515 .gpiomux = { 13, 14, 11, 7 },
527 .needs_tvaudio = 1,
528 .tuner_type = UNSET, 516 .tuner_type = UNSET,
529 .tuner_addr = ADDR_UNSET, 517 .tuner_addr = ADDR_UNSET,
530 }, 518 },
@@ -536,7 +524,6 @@ struct tvcard bttv_tvcards[] = {
536 .gpiomask = 15, 524 .gpiomask = 15,
537 .muxsel = MUXSEL(2, 3, 1, 1), 525 .muxsel = MUXSEL(2, 3, 1, 1),
538 .gpiomux = { 13, 14, 11, 7 }, 526 .gpiomux = { 13, 14, 11, 7 },
539 .needs_tvaudio = 1,
540 .msp34xx_alt = 1, 527 .msp34xx_alt = 1,
541 .pll = PLL_28, 528 .pll = PLL_28,
542 .tuner_type = TUNER_PHILIPS_PAL, 529 .tuner_type = TUNER_PHILIPS_PAL,
@@ -553,7 +540,6 @@ struct tvcard bttv_tvcards[] = {
553 .muxsel = MUXSEL(2, 3, 1, 1), 540 .muxsel = MUXSEL(2, 3, 1, 1),
554 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */ 541 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
555 .gpiomute = 4, 542 .gpiomute = 4,
556 .needs_tvaudio = 1,
557 .pll = PLL_28, 543 .pll = PLL_28,
558 .tuner_type = UNSET, 544 .tuner_type = UNSET,
559 .tuner_addr = ADDR_UNSET, 545 .tuner_addr = ADDR_UNSET,
@@ -567,7 +553,6 @@ struct tvcard bttv_tvcards[] = {
567 .muxsel = MUXSEL(2, 3, 1, 1), 553 .muxsel = MUXSEL(2, 3, 1, 1),
568 .gpiomux = { 0, 0, 1, 0 }, 554 .gpiomux = { 0, 0, 1, 0 },
569 .gpiomute = 10, 555 .gpiomute = 10,
570 .needs_tvaudio = 1,
571 .tuner_type = UNSET, 556 .tuner_type = UNSET,
572 .tuner_addr = ADDR_UNSET, 557 .tuner_addr = ADDR_UNSET,
573 }, 558 },
@@ -583,7 +568,6 @@ struct tvcard bttv_tvcards[] = {
583 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */ 568 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
584 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, 569 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
585 .gpiomute = 0x002000, 570 .gpiomute = 0x002000,
586 .needs_tvaudio = 1,
587 .pll = PLL_28, 571 .pll = PLL_28,
588 .tuner_type = UNSET, 572 .tuner_type = UNSET,
589 .tuner_addr = ADDR_UNSET, 573 .tuner_addr = ADDR_UNSET,
@@ -597,7 +581,6 @@ struct tvcard bttv_tvcards[] = {
597 .muxsel = MUXSEL(2, 3, 1, 1, 0), 581 .muxsel = MUXSEL(2, 3, 1, 1, 0),
598 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 }, 582 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
599 .gpiomute = 0xcfa007, 583 .gpiomute = 0xcfa007,
600 .needs_tvaudio = 1,
601 .tuner_type = UNSET, 584 .tuner_type = UNSET,
602 .tuner_addr = ADDR_UNSET, 585 .tuner_addr = ADDR_UNSET,
603 .volume_gpio = winview_volume, 586 .volume_gpio = winview_volume,
@@ -611,7 +594,6 @@ struct tvcard bttv_tvcards[] = {
611 .gpiomask = 0, 594 .gpiomask = 0,
612 .muxsel = MUXSEL(2, 3, 1, 1), 595 .muxsel = MUXSEL(2, 3, 1, 1),
613 .gpiomux = { 1, 0, 0, 0 }, 596 .gpiomux = { 1, 0, 0, 0 },
614 .needs_tvaudio = 1,
615 .tuner_type = UNSET, 597 .tuner_type = UNSET,
616 .tuner_addr = ADDR_UNSET, 598 .tuner_addr = ADDR_UNSET,
617 }, 599 },
@@ -660,7 +642,6 @@ struct tvcard bttv_tvcards[] = {
660 .muxsel = MUXSEL(2, 3, 1, 1), 642 .muxsel = MUXSEL(2, 3, 1, 1),
661 .gpiomux = { 0, 1, 0x800, 0x400 }, 643 .gpiomux = { 0, 1, 0x800, 0x400 },
662 .gpiomute = 0xc00, 644 .gpiomute = 0xc00,
663 .needs_tvaudio = 1,
664 .pll = PLL_28, 645 .pll = PLL_28,
665 .tuner_type = UNSET, 646 .tuner_type = UNSET,
666 .tuner_addr = ADDR_UNSET, 647 .tuner_addr = ADDR_UNSET,
@@ -691,7 +672,6 @@ struct tvcard bttv_tvcards[] = {
691 .muxsel = MUXSEL(2, 3, 1, 1), 672 .muxsel = MUXSEL(2, 3, 1, 1),
692 .gpiomux = {0x400, 0x400, 0x400, 0x400 }, 673 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
693 .gpiomute = 0xc00, 674 .gpiomute = 0xc00,
694 .needs_tvaudio = 1,
695 .pll = PLL_28, 675 .pll = PLL_28,
696 .tuner_type = UNSET, 676 .tuner_type = UNSET,
697 .tuner_addr = ADDR_UNSET, 677 .tuner_addr = ADDR_UNSET,
@@ -706,7 +686,6 @@ struct tvcard bttv_tvcards[] = {
706 .muxsel = MUXSEL(2, 3, 1, 1), 686 .muxsel = MUXSEL(2, 3, 1, 1),
707 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, 687 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
708 .gpiomute = 0x40000, 688 .gpiomute = 0x40000,
709 .needs_tvaudio = 0,
710 .tuner_type = TUNER_PHILIPS_PAL, 689 .tuner_type = TUNER_PHILIPS_PAL,
711 .tuner_addr = ADDR_UNSET, 690 .tuner_addr = ADDR_UNSET,
712 .audio_mode_gpio= terratv_audio, 691 .audio_mode_gpio= terratv_audio,
@@ -720,7 +699,6 @@ struct tvcard bttv_tvcards[] = {
720 .muxsel = MUXSEL(2, 0, 1, 1), 699 .muxsel = MUXSEL(2, 0, 1, 1),
721 .gpiomux = { 0, 1, 2, 3 }, 700 .gpiomux = { 0, 1, 2, 3 },
722 .gpiomute = 4, 701 .gpiomute = 4,
723 .needs_tvaudio = 1,
724 .tuner_type = UNSET, 702 .tuner_type = UNSET,
725 .tuner_addr = ADDR_UNSET, 703 .tuner_addr = ADDR_UNSET,
726 }, 704 },
@@ -748,7 +726,6 @@ struct tvcard bttv_tvcards[] = {
748 .muxsel = MUXSEL(2, 3, 1, 1), 726 .muxsel = MUXSEL(2, 3, 1, 1),
749 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 }, 727 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
750 .gpiomute = 0x40000, 728 .gpiomute = 0x40000,
751 .needs_tvaudio = 0,
752 .tuner_type = TUNER_PHILIPS_PAL, 729 .tuner_type = TUNER_PHILIPS_PAL,
753 .tuner_addr = ADDR_UNSET, 730 .tuner_addr = ADDR_UNSET,
754 .audio_mode_gpio= terratv_audio, 731 .audio_mode_gpio= terratv_audio,
@@ -793,7 +770,6 @@ struct tvcard bttv_tvcards[] = {
793 .gpiomask = 0, 770 .gpiomask = 0,
794 .muxsel = MUXSEL(2, 3, 1, 0, 0), 771 .muxsel = MUXSEL(2, 3, 1, 0, 0),
795 .gpiomux = { 0 }, 772 .gpiomux = { 0 },
796 .needs_tvaudio = 1,
797 .tuner_type = TUNER_ABSENT, 773 .tuner_type = TUNER_ABSENT,
798 .tuner_addr = ADDR_UNSET, 774 .tuner_addr = ADDR_UNSET,
799 .muxsel_hook = PXC200_muxsel, 775 .muxsel_hook = PXC200_muxsel,
@@ -834,7 +810,6 @@ struct tvcard bttv_tvcards[] = {
834 .gpiomask = 0, 810 .gpiomask = 0,
835 .muxsel = MUXSEL(2, 3, 1, 1), 811 .muxsel = MUXSEL(2, 3, 1, 1),
836 .gpiomux = { 0 }, 812 .gpiomux = { 0 },
837 .needs_tvaudio = 0,
838 .tuner_type = TUNER_ABSENT, 813 .tuner_type = TUNER_ABSENT,
839 .tuner_addr = ADDR_UNSET, 814 .tuner_addr = ADDR_UNSET,
840 }, 815 },
@@ -847,7 +822,6 @@ struct tvcard bttv_tvcards[] = {
847 .muxsel = MUXSEL(2, 3, 1, 1), 822 .muxsel = MUXSEL(2, 3, 1, 1),
848 .gpiomux = { 0x500, 0, 0x300, 0x900 }, 823 .gpiomux = { 0x500, 0, 0x300, 0x900 },
849 .gpiomute = 0x900, 824 .gpiomute = 0x900,
850 .needs_tvaudio = 1,
851 .pll = PLL_28, 825 .pll = PLL_28,
852 .tuner_type = TUNER_PHILIPS_PAL, 826 .tuner_type = TUNER_PHILIPS_PAL,
853 .tuner_addr = ADDR_UNSET, 827 .tuner_addr = ADDR_UNSET,
@@ -874,7 +848,6 @@ struct tvcard bttv_tvcards[] = {
874 Note: There exists another variant "Winfast 2000" with tv stereo !? 848 Note: There exists another variant "Winfast 2000" with tv stereo !?
875 Note: eeprom only contains FF and pci subsystem id 107d:6606 849 Note: eeprom only contains FF and pci subsystem id 107d:6606
876 */ 850 */
877 .needs_tvaudio = 0,
878 .pll = PLL_28, 851 .pll = PLL_28,
879 .has_radio = 1, 852 .has_radio = 1,
880 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */ 853 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
@@ -934,7 +907,6 @@ struct tvcard bttv_tvcards[] = {
934 .muxsel = MUXSEL(2, 3, 1, 0), 907 .muxsel = MUXSEL(2, 3, 1, 0),
935 .gpiomux = { 0x551400, 0x551200, 0, 0 }, 908 .gpiomux = { 0x551400, 0x551200, 0, 0 },
936 .gpiomute = 0x551c00, 909 .gpiomute = 0x551c00,
937 .needs_tvaudio = 1,
938 .pll = PLL_28, 910 .pll = PLL_28,
939 .tuner_type = TUNER_PHILIPS_PAL_I, 911 .tuner_type = TUNER_PHILIPS_PAL_I,
940 .tuner_addr = ADDR_UNSET, 912 .tuner_addr = ADDR_UNSET,
@@ -949,7 +921,6 @@ struct tvcard bttv_tvcards[] = {
949 .muxsel = MUXSEL(2, 3, 1, 1), 921 .muxsel = MUXSEL(2, 3, 1, 1),
950 .gpiomux = { 2, 0xd0001, 0, 0 }, 922 .gpiomux = { 2, 0xd0001, 0, 0 },
951 .gpiomute = 1, 923 .gpiomute = 1,
952 .needs_tvaudio = 0,
953 .pll = PLL_28, 924 .pll = PLL_28,
954 .tuner_type = UNSET, 925 .tuner_type = UNSET,
955 .tuner_addr = ADDR_UNSET, 926 .tuner_addr = ADDR_UNSET,
@@ -966,7 +937,6 @@ struct tvcard bttv_tvcards[] = {
966 .gpiomux = { 4, 0, 2, 3 }, 937 .gpiomux = { 4, 0, 2, 3 },
967 .gpiomute = 1, 938 .gpiomute = 1,
968 .no_msp34xx = 1, 939 .no_msp34xx = 1,
969 .needs_tvaudio = 1,
970 .tuner_type = TUNER_PHILIPS_NTSC, 940 .tuner_type = TUNER_PHILIPS_NTSC,
971 .tuner_addr = ADDR_UNSET, 941 .tuner_addr = ADDR_UNSET,
972 .pll = PLL_28, 942 .pll = PLL_28,
@@ -980,7 +950,6 @@ struct tvcard bttv_tvcards[] = {
980 .gpiomask = 15, 950 .gpiomask = 15,
981 .muxsel = MUXSEL(2, 3, 1, 1), 951 .muxsel = MUXSEL(2, 3, 1, 1),
982 .gpiomux = { 13, 4, 11, 7 }, 952 .gpiomux = { 13, 4, 11, 7 },
983 .needs_tvaudio = 1,
984 .pll = PLL_28, 953 .pll = PLL_28,
985 .tuner_type = UNSET, 954 .tuner_type = UNSET,
986 .tuner_addr = ADDR_UNSET, 955 .tuner_addr = ADDR_UNSET,
@@ -995,7 +964,6 @@ struct tvcard bttv_tvcards[] = {
995 .gpiomask = 0, 964 .gpiomask = 0,
996 .muxsel = MUXSEL(2, 3, 1, 1), 965 .muxsel = MUXSEL(2, 3, 1, 1),
997 .gpiomux = { 0, 0, 0, 0}, 966 .gpiomux = { 0, 0, 0, 0},
998 .needs_tvaudio = 1,
999 .no_msp34xx = 1, 967 .no_msp34xx = 1,
1000 .pll = PLL_28, 968 .pll = PLL_28,
1001 .tuner_type = TUNER_PHILIPS_PAL_I, 969 .tuner_type = TUNER_PHILIPS_PAL_I,
@@ -1066,7 +1034,6 @@ struct tvcard bttv_tvcards[] = {
1066 .muxsel = MUXSEL(2, 3, 1, 1), 1034 .muxsel = MUXSEL(2, 3, 1, 1),
1067 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 }, 1035 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1068 .gpiomute = 0x40000, 1036 .gpiomute = 0x40000,
1069 .needs_tvaudio = 1,
1070 .no_msp34xx = 1, 1037 .no_msp34xx = 1,
1071 .pll = PLL_35, 1038 .pll = PLL_35,
1072 .tuner_type = TUNER_PHILIPS_PAL_I, 1039 .tuner_type = TUNER_PHILIPS_PAL_I,
@@ -1084,7 +1051,6 @@ struct tvcard bttv_tvcards[] = {
1084 .muxsel = MUXSEL(2, 3, 1, 1), 1051 .muxsel = MUXSEL(2, 3, 1, 1),
1085 .gpiomux = {2,0,0,0 }, 1052 .gpiomux = {2,0,0,0 },
1086 .gpiomute = 1, 1053 .gpiomute = 1,
1087 .needs_tvaudio = 1,
1088 .pll = PLL_28, 1054 .pll = PLL_28,
1089 .tuner_type = UNSET, 1055 .tuner_type = UNSET,
1090 .tuner_addr = ADDR_UNSET, 1056 .tuner_addr = ADDR_UNSET,
@@ -1163,7 +1129,6 @@ struct tvcard bttv_tvcards[] = {
1163 MUX2 (mask 0x30000): 1129 MUX2 (mask 0x30000):
1164 0,2,3= from MSP34xx 1130 0,2,3= from MSP34xx
1165 1= FM stereo Radio from Tuner */ 1131 1= FM stereo Radio from Tuner */
1166 .needs_tvaudio = 0,
1167 .pll = PLL_28, 1132 .pll = PLL_28,
1168 .tuner_type = UNSET, 1133 .tuner_type = UNSET,
1169 .tuner_addr = ADDR_UNSET, 1134 .tuner_addr = ADDR_UNSET,
@@ -1179,7 +1144,6 @@ struct tvcard bttv_tvcards[] = {
1179 .muxsel = MUXSEL(2, 3, 1, 1), 1144 .muxsel = MUXSEL(2, 3, 1, 1),
1180 .gpiomux = { 0, 0, 0x10, 8 }, 1145 .gpiomux = { 0, 0, 0x10, 8 },
1181 .gpiomute = 4, 1146 .gpiomute = 4,
1182 .needs_tvaudio = 1,
1183 .pll = PLL_28, 1147 .pll = PLL_28,
1184 .tuner_type = TUNER_PHILIPS_PAL, 1148 .tuner_type = TUNER_PHILIPS_PAL,
1185 .tuner_addr = ADDR_UNSET, 1149 .tuner_addr = ADDR_UNSET,
@@ -1218,7 +1182,6 @@ struct tvcard bttv_tvcards[] = {
1218 .muxsel = MUXSEL(2, 3, 1, 0), 1182 .muxsel = MUXSEL(2, 3, 1, 0),
1219 .gpiomux = { 2, 0, 0, 0 }, 1183 .gpiomux = { 2, 0, 0, 0 },
1220 .gpiomute = 10, 1184 .gpiomute = 10,
1221 .needs_tvaudio = 0,
1222 .pll = PLL_28, 1185 .pll = PLL_28,
1223 .tuner_type = TUNER_TEMIC_PAL, 1186 .tuner_type = TUNER_TEMIC_PAL,
1224 .tuner_addr = ADDR_UNSET, 1187 .tuner_addr = ADDR_UNSET,
@@ -1250,7 +1213,6 @@ struct tvcard bttv_tvcards[] = {
1250 .gpiomask = 0, 1213 .gpiomask = 0,
1251 .muxsel = MUXSEL(3, 1), 1214 .muxsel = MUXSEL(3, 1),
1252 .gpiomux = { 0 }, 1215 .gpiomux = { 0 },
1253 .needs_tvaudio = 0,
1254 .no_msp34xx = 1, 1216 .no_msp34xx = 1,
1255 .pll = PLL_35, 1217 .pll = PLL_35,
1256 .tuner_type = TUNER_ABSENT, 1218 .tuner_type = TUNER_ABSENT,
@@ -1266,7 +1228,6 @@ struct tvcard bttv_tvcards[] = {
1266 .muxsel = MUXSEL(2, 3, 1, 1), 1228 .muxsel = MUXSEL(2, 3, 1, 1),
1267 .gpiomux = { 0x400, 0x400, 0x400, 0x400 }, 1229 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1268 .gpiomute = 0x800, 1230 .gpiomute = 0x800,
1269 .needs_tvaudio = 1,
1270 .pll = PLL_28, 1231 .pll = PLL_28,
1271 .tuner_type = TUNER_TEMIC_4036FY5_NTSC, 1232 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1272 .tuner_addr = ADDR_UNSET, 1233 .tuner_addr = ADDR_UNSET,
@@ -1312,7 +1273,6 @@ struct tvcard bttv_tvcards[] = {
1312 .muxsel = MUXSEL(2, 2), 1273 .muxsel = MUXSEL(2, 2),
1313 .gpiomux = { }, 1274 .gpiomux = { },
1314 .no_msp34xx = 1, 1275 .no_msp34xx = 1,
1315 .needs_tvaudio = 0,
1316 .pll = PLL_28, 1276 .pll = PLL_28,
1317 .tuner_type = TUNER_ABSENT, 1277 .tuner_type = TUNER_ABSENT,
1318 .tuner_addr = ADDR_UNSET, 1278 .tuner_addr = ADDR_UNSET,
@@ -1329,7 +1289,6 @@ struct tvcard bttv_tvcards[] = {
1329 .muxsel = MUXSEL(2, 3, 1, 0), 1289 .muxsel = MUXSEL(2, 3, 1, 0),
1330 .gpiomux = { 1, 0, 4, 4 }, 1290 .gpiomux = { 1, 0, 4, 4 },
1331 .gpiomute = 9, 1291 .gpiomute = 9,
1332 .needs_tvaudio = 0,
1333 .pll = PLL_28, 1292 .pll = PLL_28,
1334 .tuner_type = TUNER_PHILIPS_PAL, 1293 .tuner_type = TUNER_PHILIPS_PAL,
1335 .tuner_addr = ADDR_UNSET, 1294 .tuner_addr = ADDR_UNSET,
@@ -1379,7 +1338,6 @@ struct tvcard bttv_tvcards[] = {
1379 .gpiomute = 0x1800, 1338 .gpiomute = 0x1800,
1380 .audio_mode_gpio= fv2000s_audio, 1339 .audio_mode_gpio= fv2000s_audio,
1381 .no_msp34xx = 1, 1340 .no_msp34xx = 1,
1382 .needs_tvaudio = 1,
1383 .pll = PLL_28, 1341 .pll = PLL_28,
1384 .tuner_type = TUNER_PHILIPS_PAL, 1342 .tuner_type = TUNER_PHILIPS_PAL,
1385 .tuner_addr = ADDR_UNSET, 1343 .tuner_addr = ADDR_UNSET,
@@ -1393,7 +1351,6 @@ struct tvcard bttv_tvcards[] = {
1393 .muxsel = MUXSEL(2, 3, 1, 1), 1351 .muxsel = MUXSEL(2, 3, 1, 1),
1394 .gpiomux = { 0x500, 0x500, 0x300, 0x900 }, 1352 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1395 .gpiomute = 0x900, 1353 .gpiomute = 0x900,
1396 .needs_tvaudio = 1,
1397 .pll = PLL_28, 1354 .pll = PLL_28,
1398 .tuner_type = TUNER_PHILIPS_PAL, 1355 .tuner_type = TUNER_PHILIPS_PAL,
1399 .tuner_addr = ADDR_UNSET, 1356 .tuner_addr = ADDR_UNSET,
@@ -1477,7 +1434,6 @@ struct tvcard bttv_tvcards[] = {
1477 .muxsel = MUXSEL(2, 3, 1, 1), 1434 .muxsel = MUXSEL(2, 3, 1, 1),
1478 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */ 1435 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1479 .gpiomute = 13, 1436 .gpiomute = 13,
1480 .needs_tvaudio = 1,
1481 .pll = PLL_28, 1437 .pll = PLL_28,
1482 .tuner_type = TUNER_LG_PAL_I_FM, 1438 .tuner_type = TUNER_LG_PAL_I_FM,
1483 .tuner_addr = ADDR_UNSET, 1439 .tuner_addr = ADDR_UNSET,
@@ -1514,7 +1470,6 @@ struct tvcard bttv_tvcards[] = {
1514 .muxsel = MUXSEL(2, 3, 1, 1), 1470 .muxsel = MUXSEL(2, 3, 1, 1),
1515 .gpiomux = { 0x01, 0x00, 0x03, 0x03 }, 1471 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1516 .gpiomute = 0x09, 1472 .gpiomute = 0x09,
1517 .needs_tvaudio = 1,
1518 .no_msp34xx = 1, 1473 .no_msp34xx = 1,
1519 .pll = PLL_28, 1474 .pll = PLL_28,
1520 .tuner_type = TUNER_PHILIPS_PAL, 1475 .tuner_type = TUNER_PHILIPS_PAL,
@@ -1540,7 +1495,6 @@ struct tvcard bttv_tvcards[] = {
1540 .gpiomask = 0, 1495 .gpiomask = 0,
1541 .muxsel = MUXSEL(2, 3, 1, 0, 0), 1496 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1542 .gpiomux = { 0 }, 1497 .gpiomux = { 0 },
1543 .needs_tvaudio = 0,
1544 .tuner_type = TUNER_ABSENT, 1498 .tuner_type = TUNER_ABSENT,
1545 .tuner_addr = ADDR_UNSET, 1499 .tuner_addr = ADDR_UNSET,
1546 }, 1500 },
@@ -1567,7 +1521,6 @@ struct tvcard bttv_tvcards[] = {
1567 .muxsel = MUXSEL(2, 1, 1), 1521 .muxsel = MUXSEL(2, 1, 1),
1568 .gpiomux = { 0, 1, 2, 2 }, 1522 .gpiomux = { 0, 1, 2, 2 },
1569 .gpiomute = 4, 1523 .gpiomute = 4,
1570 .needs_tvaudio = 0,
1571 .tuner_type = TUNER_PHILIPS_PAL, 1524 .tuner_type = TUNER_PHILIPS_PAL,
1572 .tuner_addr = ADDR_UNSET, 1525 .tuner_addr = ADDR_UNSET,
1573 .pll = PLL_28, 1526 .pll = PLL_28,
@@ -1597,7 +1550,6 @@ struct tvcard bttv_tvcards[] = {
1597 .gpiomask = 0, 1550 .gpiomask = 0,
1598 .muxsel = MUXSEL(2, 3, 1, 0), 1551 .muxsel = MUXSEL(2, 3, 1, 0),
1599 .gpiomux = { 0 }, 1552 .gpiomux = { 0 },
1600 .needs_tvaudio = 0,
1601 .no_msp34xx = 1, 1553 .no_msp34xx = 1,
1602 .pll = PLL_28, 1554 .pll = PLL_28,
1603 .tuner_type = TUNER_ABSENT, 1555 .tuner_type = TUNER_ABSENT,
@@ -1619,7 +1571,6 @@ struct tvcard bttv_tvcards[] = {
1619 * btwincap uses 0x80000/0x80003 1571 * btwincap uses 0x80000/0x80003
1620 */ 1572 */
1621 .gpiomute = 4, 1573 .gpiomute = 4,
1622 .needs_tvaudio = 0,
1623 .no_msp34xx = 1, 1574 .no_msp34xx = 1,
1624 .pll = PLL_28, 1575 .pll = PLL_28,
1625 .tuner_type = TUNER_PHILIPS_PAL, 1576 .tuner_type = TUNER_PHILIPS_PAL,
@@ -1655,7 +1606,6 @@ struct tvcard bttv_tvcards[] = {
1655 /* .audio_inputs= 1, */ 1606 /* .audio_inputs= 1, */
1656 .svhs = 2, 1607 .svhs = 2,
1657 .muxsel = MUXSEL(2, 0, 1, 1), 1608 .muxsel = MUXSEL(2, 0, 1, 1),
1658 .needs_tvaudio = 1,
1659 .pll = PLL_28, 1609 .pll = PLL_28,
1660 .tuner_type = UNSET, 1610 .tuner_type = UNSET,
1661 .tuner_addr = ADDR_UNSET, 1611 .tuner_addr = ADDR_UNSET,
@@ -1875,7 +1825,6 @@ struct tvcard bttv_tvcards[] = {
1875 .muxsel = MUXSEL(2, 3, 1, 1), 1825 .muxsel = MUXSEL(2, 3, 1, 1),
1876 .gpiomux = { 0, 1, 2, 3}, 1826 .gpiomux = { 0, 1, 2, 3},
1877 .gpiomute = 4, 1827 .gpiomute = 4,
1878 .needs_tvaudio = 1,
1879 .tuner_type = TUNER_PHILIPS_PAL, 1828 .tuner_type = TUNER_PHILIPS_PAL,
1880 .tuner_addr = ADDR_UNSET, 1829 .tuner_addr = ADDR_UNSET,
1881 .pll = PLL_28, 1830 .pll = PLL_28,
@@ -1902,7 +1851,6 @@ struct tvcard bttv_tvcards[] = {
1902 .gpiomask = 0, 1851 .gpiomask = 0,
1903 .muxsel = MUXSEL(2, 3), 1852 .muxsel = MUXSEL(2, 3),
1904 .gpiomux = { 0 }, 1853 .gpiomux = { 0 },
1905 .needs_tvaudio = 0,
1906 .no_msp34xx = 1, 1854 .no_msp34xx = 1,
1907 .pll = PLL_28, 1855 .pll = PLL_28,
1908 .tuner_type = TUNER_ABSENT, 1856 .tuner_type = TUNER_ABSENT,
@@ -1920,7 +1868,6 @@ struct tvcard bttv_tvcards[] = {
1920 /* Tuner, Radio, external, internal, off, on */ 1868 /* Tuner, Radio, external, internal, off, on */
1921 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 }, 1869 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1922 .gpiomute = 0x0f, 1870 .gpiomute = 0x0f,
1923 .needs_tvaudio = 0,
1924 .no_msp34xx = 1, 1871 .no_msp34xx = 1,
1925 .pll = PLL_28, 1872 .pll = PLL_28,
1926 .tuner_type = TUNER_PHILIPS_NTSC, 1873 .tuner_type = TUNER_PHILIPS_NTSC,
@@ -1936,7 +1883,6 @@ struct tvcard bttv_tvcards[] = {
1936 .svhs = 2, 1883 .svhs = 2,
1937 .gpiomask = 0x00, 1884 .gpiomask = 0x00,
1938 .muxsel = MUXSEL(2, 3, 1, 1), 1885 .muxsel = MUXSEL(2, 3, 1, 1),
1939 .needs_tvaudio = 1,
1940 .no_msp34xx = 1, 1886 .no_msp34xx = 1,
1941 .pll = PLL_28, 1887 .pll = PLL_28,
1942 .tuner_type = TUNER_PHILIPS_PAL, 1888 .tuner_type = TUNER_PHILIPS_PAL,
@@ -2034,7 +1980,6 @@ struct tvcard bttv_tvcards[] = {
2034 .gpiomask = 0, 1980 .gpiomask = 0,
2035 .muxsel = MUXSEL(2, 3, 1, 0), 1981 .muxsel = MUXSEL(2, 3, 1, 0),
2036 .gpiomux = { 0 }, 1982 .gpiomux = { 0 },
2037 .needs_tvaudio = 0,
2038 .no_msp34xx = 1, 1983 .no_msp34xx = 1,
2039 .pll = PLL_28, 1984 .pll = PLL_28,
2040 .tuner_type = TUNER_ABSENT, 1985 .tuner_type = TUNER_ABSENT,
@@ -2049,7 +1994,6 @@ struct tvcard bttv_tvcards[] = {
2049 .gpiomask = 0x00, 1994 .gpiomask = 0x00,
2050 .muxsel = MUXSEL(2, 3, 1, 0), 1995 .muxsel = MUXSEL(2, 3, 1, 0),
2051 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 1996 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2052 .needs_tvaudio = 0,
2053 .pll = PLL_28, 1997 .pll = PLL_28,
2054 .tuner_type = TUNER_ABSENT, 1998 .tuner_type = TUNER_ABSENT,
2055 .tuner_addr = ADDR_UNSET, 1999 .tuner_addr = ADDR_UNSET,
@@ -2062,7 +2006,6 @@ struct tvcard bttv_tvcards[] = {
2062 .gpiomask = 0x00, 2006 .gpiomask = 0x00,
2063 .muxsel = MUXSEL(2, 3, 1, 1), 2007 .muxsel = MUXSEL(2, 3, 1, 1),
2064 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2008 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2065 .needs_tvaudio = 0,
2066 .pll = PLL_28, 2009 .pll = PLL_28,
2067 .tuner_type = TUNER_ABSENT, 2010 .tuner_type = TUNER_ABSENT,
2068 .tuner_addr = ADDR_UNSET, 2011 .tuner_addr = ADDR_UNSET,
@@ -2079,7 +2022,6 @@ struct tvcard bttv_tvcards[] = {
2079 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0), 2022 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
2080 .muxsel_hook = phytec_muxsel, 2023 .muxsel_hook = phytec_muxsel,
2081 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2024 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2082 .needs_tvaudio = 1,
2083 .pll = PLL_28, 2025 .pll = PLL_28,
2084 .tuner_type = TUNER_ABSENT, 2026 .tuner_type = TUNER_ABSENT,
2085 .tuner_addr = ADDR_UNSET, 2027 .tuner_addr = ADDR_UNSET,
@@ -2094,7 +2036,6 @@ struct tvcard bttv_tvcards[] = {
2094 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1), 2036 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
2095 .muxsel_hook = phytec_muxsel, 2037 .muxsel_hook = phytec_muxsel,
2096 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2038 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2097 .needs_tvaudio = 1,
2098 .pll = PLL_28, 2039 .pll = PLL_28,
2099 .tuner_type = TUNER_ABSENT, 2040 .tuner_type = TUNER_ABSENT,
2100 .tuner_addr = ADDR_UNSET, 2041 .tuner_addr = ADDR_UNSET,
@@ -2118,7 +2059,6 @@ struct tvcard bttv_tvcards[] = {
2118 .tuner_type = TUNER_ABSENT, 2059 .tuner_type = TUNER_ABSENT,
2119 .tuner_addr = ADDR_UNSET, 2060 .tuner_addr = ADDR_UNSET,
2120 .svhs = NO_SVHS, /* card has no svhs */ 2061 .svhs = NO_SVHS, /* card has no svhs */
2121 .needs_tvaudio = 0,
2122 .no_msp34xx = 1, 2062 .no_msp34xx = 1,
2123 .no_tda7432 = 1, 2063 .no_tda7432 = 1,
2124 .gpiomask = 0x00, 2064 .gpiomask = 0x00,
@@ -2168,7 +2108,6 @@ struct tvcard bttv_tvcards[] = {
2168 .gpiomask = 3, 2108 .gpiomask = 3,
2169 .muxsel = MUXSEL(2, 3, 1, 1), 2109 .muxsel = MUXSEL(2, 3, 1, 1),
2170 .gpiomux = { 1, 1, 1, 1 }, 2110 .gpiomux = { 1, 1, 1, 1 },
2171 .needs_tvaudio = 1,
2172 .tuner_type = TUNER_PHILIPS_PAL, 2111 .tuner_type = TUNER_PHILIPS_PAL,
2173 .tuner_addr = ADDR_UNSET, 2112 .tuner_addr = ADDR_UNSET,
2174 .pll = PLL_35, 2113 .pll = PLL_35,
@@ -2210,7 +2149,6 @@ struct tvcard bttv_tvcards[] = {
2210 .muxsel = MUXSEL(2, 3, 1, 0), 2149 .muxsel = MUXSEL(2, 3, 1, 0),
2211 .no_msp34xx = 1, 2150 .no_msp34xx = 1,
2212 .no_tda7432 = 1, 2151 .no_tda7432 = 1,
2213 .needs_tvaudio = 0,
2214 .tuner_type = TUNER_ABSENT, 2152 .tuner_type = TUNER_ABSENT,
2215 .tuner_addr = ADDR_UNSET, 2153 .tuner_addr = ADDR_UNSET,
2216 }, 2154 },
@@ -2222,7 +2160,6 @@ struct tvcard bttv_tvcards[] = {
2222 .tuner_type = TUNER_PHILIPS_PAL, 2160 .tuner_type = TUNER_PHILIPS_PAL,
2223 .tuner_addr = ADDR_UNSET, 2161 .tuner_addr = ADDR_UNSET,
2224 .svhs = 2, 2162 .svhs = 2,
2225 .needs_tvaudio = 0,
2226 .gpiomask = 0x68, 2163 .gpiomask = 0x68,
2227 .muxsel = MUXSEL(2, 3, 1), 2164 .muxsel = MUXSEL(2, 3, 1),
2228 .gpiomux = { 0x68, 0x68, 0x61, 0x61 }, 2165 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
@@ -2241,7 +2178,6 @@ struct tvcard bttv_tvcards[] = {
2241 .muxsel = MUXSEL(2, 3, 1, 1), 2178 .muxsel = MUXSEL(2, 3, 1, 1),
2242 .gpiomux = { 0, 1, 2, 2 }, 2179 .gpiomux = { 0, 1, 2, 2 },
2243 .gpiomute = 3, 2180 .gpiomute = 3,
2244 .needs_tvaudio = 0,
2245 .pll = PLL_28, 2181 .pll = PLL_28,
2246 .tuner_type = TUNER_PHILIPS_PAL, 2182 .tuner_type = TUNER_PHILIPS_PAL,
2247 .tuner_addr = ADDR_UNSET, 2183 .tuner_addr = ADDR_UNSET,
@@ -2265,7 +2201,6 @@ struct tvcard bttv_tvcards[] = {
2265 .muxsel = MUXSEL(2, 2, 2, 2), 2201 .muxsel = MUXSEL(2, 2, 2, 2),
2266 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2202 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2267 .pll = PLL_28, 2203 .pll = PLL_28,
2268 .needs_tvaudio = 0,
2269 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/ 2204 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2270 .tuner_type = TUNER_ABSENT, 2205 .tuner_type = TUNER_ABSENT,
2271 .tuner_addr = ADDR_UNSET, 2206 .tuner_addr = ADDR_UNSET,
@@ -2358,7 +2293,6 @@ struct tvcard bttv_tvcards[] = {
2358 .muxsel = MUXSEL(2, 3, 1, 1), 2293 .muxsel = MUXSEL(2, 3, 1, 1),
2359 .gpiomux = { 2, 0, 0, 0 }, 2294 .gpiomux = { 2, 0, 0, 0 },
2360 .gpiomute = 10, 2295 .gpiomute = 10,
2361 .needs_tvaudio = 0,
2362 .pll = PLL_28, 2296 .pll = PLL_28,
2363 .tuner_type = TUNER_PHILIPS_PAL, 2297 .tuner_type = TUNER_PHILIPS_PAL,
2364 .tuner_addr = ADDR_UNSET, 2298 .tuner_addr = ADDR_UNSET,
@@ -2405,7 +2339,6 @@ struct tvcard bttv_tvcards[] = {
2405 .tuner_addr = ADDR_UNSET, 2339 .tuner_addr = ADDR_UNSET,
2406 .gpiomask = 0x008007, 2340 .gpiomask = 0x008007,
2407 .gpiomux = { 0, 0x000001,0,0 }, 2341 .gpiomux = { 0, 0x000001,0,0 },
2408 .needs_tvaudio = 1,
2409 .has_radio = 1, 2342 .has_radio = 1,
2410 }, 2343 },
2411 [BTTV_BOARD_TIBET_CS16] = { 2344 [BTTV_BOARD_TIBET_CS16] = {
@@ -2518,7 +2451,6 @@ struct tvcard bttv_tvcards[] = {
2518 .muxsel = MUXSEL(2, 3, 1, 1), 2451 .muxsel = MUXSEL(2, 3, 1, 1),
2519 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 }, 2452 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2520 .gpiomute = 0x002000, 2453 .gpiomute = 0x002000,
2521 .needs_tvaudio = 1,
2522 .pll = PLL_28, 2454 .pll = PLL_28,
2523 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF, 2455 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2524 .tuner_addr = 0xc1 >>1, 2456 .tuner_addr = 0xc1 >>1,
@@ -2534,7 +2466,6 @@ struct tvcard bttv_tvcards[] = {
2534 .muxsel = MUXSEL(2, 3, 1, 1), 2466 .muxsel = MUXSEL(2, 3, 1, 1),
2535 .gpiomux = { 0, 1, 2, 2 }, 2467 .gpiomux = { 0, 1, 2, 2 },
2536 .gpiomute = 3, 2468 .gpiomute = 3,
2537 .needs_tvaudio = 0,
2538 .pll = PLL_28, 2469 .pll = PLL_28,
2539 .tuner_type = TUNER_TENA_9533_DI, 2470 .tuner_type = TUNER_TENA_9533_DI,
2540 .tuner_addr = ADDR_UNSET, 2471 .tuner_addr = ADDR_UNSET,
@@ -2615,7 +2546,6 @@ struct tvcard bttv_tvcards[] = {
2615 .muxsel = MUXSEL(2, 3, 1, 1), 2546 .muxsel = MUXSEL(2, 3, 1, 1),
2616 .gpiomux = { 2, 0, 0, 0 }, 2547 .gpiomux = { 2, 0, 0, 0 },
2617 .gpiomute = 1, 2548 .gpiomute = 1,
2618 .needs_tvaudio = 1,
2619 .pll = PLL_28, 2549 .pll = PLL_28,
2620 .tuner_type = TUNER_PHILIPS_NTSC, 2550 .tuner_type = TUNER_PHILIPS_NTSC,
2621 .tuner_addr = ADDR_UNSET, 2551 .tuner_addr = ADDR_UNSET,
@@ -2714,7 +2644,6 @@ struct tvcard bttv_tvcards[] = {
2714 .muxsel = MUXSEL(2, 3, 1, 1), 2644 .muxsel = MUXSEL(2, 3, 1, 1),
2715 .gpiomux = { 0x20001,0x10001, 0, 0 }, 2645 .gpiomux = { 0x20001,0x10001, 0, 0 },
2716 .gpiomute = 10, 2646 .gpiomute = 10,
2717 .needs_tvaudio = 1,
2718 .pll = PLL_28, 2647 .pll = PLL_28,
2719 .tuner_type = TUNER_PHILIPS_PAL_I, 2648 .tuner_type = TUNER_PHILIPS_PAL_I,
2720 .tuner_addr = ADDR_UNSET, 2649 .tuner_addr = ADDR_UNSET,
@@ -2746,7 +2675,6 @@ struct tvcard bttv_tvcards[] = {
2746 .muxsel = MUXSEL(2, 3, 1, 1), 2675 .muxsel = MUXSEL(2, 3, 1, 1),
2747 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */ 2676 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
2748 .gpiomute = 3, /* CONTVFMi */ 2677 .gpiomute = 3, /* CONTVFMi */
2749 .needs_tvaudio = 0,
2750 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */ 2678 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2751 .tuner_addr = ADDR_UNSET, 2679 .tuner_addr = ADDR_UNSET,
2752 .pll = PLL_28, 2680 .pll = PLL_28,
@@ -2785,7 +2713,6 @@ struct tvcard bttv_tvcards[] = {
2785 .gpiomask = 0x00, 2713 .gpiomask = 0x00,
2786 .muxsel = MUXSEL(0, 2, 3, 1), 2714 .muxsel = MUXSEL(0, 2, 3, 1),
2787 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2715 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2788 .needs_tvaudio = 0,
2789 .pll = PLL_28, 2716 .pll = PLL_28,
2790 .tuner_type = TUNER_ABSENT, 2717 .tuner_type = TUNER_ABSENT,
2791 .tuner_addr = ADDR_UNSET, 2718 .tuner_addr = ADDR_UNSET,
@@ -2799,7 +2726,6 @@ struct tvcard bttv_tvcards[] = {
2799 .gpiomask = 0x00, 2726 .gpiomask = 0x00,
2800 .muxsel = MUXSEL(2, 3, 1), 2727 .muxsel = MUXSEL(2, 3, 1),
2801 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2728 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2802 .needs_tvaudio = 0,
2803 .pll = PLL_28, 2729 .pll = PLL_28,
2804 .tuner_type = TUNER_ABSENT, 2730 .tuner_type = TUNER_ABSENT,
2805 .tuner_addr = ADDR_UNSET, 2731 .tuner_addr = ADDR_UNSET,
@@ -2813,7 +2739,6 @@ struct tvcard bttv_tvcards[] = {
2813 .gpiomask = 0x00, 2739 .gpiomask = 0x00,
2814 .muxsel = MUXSEL(3, 2, 1), 2740 .muxsel = MUXSEL(3, 2, 1),
2815 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */ 2741 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2816 .needs_tvaudio = 0,
2817 .pll = PLL_28, 2742 .pll = PLL_28,
2818 .tuner_type = TUNER_ABSENT, 2743 .tuner_type = TUNER_ABSENT,
2819 .tuner_addr = ADDR_UNSET, 2744 .tuner_addr = ADDR_UNSET,
@@ -2877,7 +2802,6 @@ struct tvcard bttv_tvcards[] = {
2877 .gpiomask = 0, 2802 .gpiomask = 0,
2878 .muxsel = MUXSEL(2, 3), 2803 .muxsel = MUXSEL(2, 3),
2879 .gpiomux = { 0 }, 2804 .gpiomux = { 0 },
2880 .needs_tvaudio = 0,
2881 .no_msp34xx = 1, 2805 .no_msp34xx = 1,
2882 .pll = PLL_28, 2806 .pll = PLL_28,
2883 .tuner_type = TUNER_ABSENT, 2807 .tuner_type = TUNER_ABSENT,
@@ -3649,7 +3573,7 @@ void __devinit bttv_init_tuner(struct bttv *btv)
3649 struct tuner_setup tun_setup; 3573 struct tuner_setup tun_setup;
3650 3574
3651 /* Load tuner module before issuing tuner config call! */ 3575 /* Load tuner module before issuing tuner config call! */
3652 if (bttv_tvcards[btv->c.type].has_radio) 3576 if (btv->has_radio)
3653 v4l2_i2c_new_subdev(&btv->c.v4l2_dev, 3577 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3654 &btv->c.i2c_adap, "tuner", 3578 &btv->c.i2c_adap, "tuner",
3655 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); 3579 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
@@ -3664,7 +3588,7 @@ void __devinit bttv_init_tuner(struct bttv *btv)
3664 tun_setup.type = btv->tuner_type; 3588 tun_setup.type = btv->tuner_type;
3665 tun_setup.addr = addr; 3589 tun_setup.addr = addr;
3666 3590
3667 if (bttv_tvcards[btv->c.type].has_radio) 3591 if (btv->has_radio)
3668 tun_setup.mode_mask |= T_RADIO; 3592 tun_setup.mode_mask |= T_RADIO;
3669 3593
3670 bttv_call_all(btv, tuner, s_type_addr, &tun_setup); 3594 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
@@ -3724,6 +3648,10 @@ static void __devinit hauppauge_eeprom(struct bttv *btv)
3724 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name); 3648 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3725 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB; 3649 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3726 } 3650 }
3651
3652 /* The 61334 needs the msp3410 to do the radio demod to get sound */
3653 if (tv.model == 61334)
3654 btv->radio_uses_msp_demodulator = 1;
3727} 3655}
3728 3656
3729static int terratec_active_radio_upgrade(struct bttv *btv) 3657static int terratec_active_radio_upgrade(struct bttv *btv)
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index a9cfb0f4be48..ff7a589d8e0f 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1218,6 +1218,11 @@ audio_mux(struct bttv *btv, int input, int mute)
1218 For now this is sufficient. */ 1218 For now this is sufficient. */
1219 switch (input) { 1219 switch (input) {
1220 case TVAUDIO_INPUT_RADIO: 1220 case TVAUDIO_INPUT_RADIO:
1221 /* Some boards need the msp do to the radio demod */
1222 if (btv->radio_uses_msp_demodulator) {
1223 in = MSP_INPUT_DEFAULT;
1224 break;
1225 }
1221 in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 1226 in = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1,
1222 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 1227 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART);
1223 break; 1228 break;
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index c5171619ac79..acfe2f3b92d9 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -236,7 +236,6 @@ struct tvcard {
236 /* i2c audio flags */ 236 /* i2c audio flags */
237 unsigned int no_msp34xx:1; 237 unsigned int no_msp34xx:1;
238 unsigned int no_tda7432:1; 238 unsigned int no_tda7432:1;
239 unsigned int needs_tvaudio:1;
240 unsigned int msp34xx_alt:1; 239 unsigned int msp34xx_alt:1;
241 /* Note: currently no card definition needs to mark the presence 240 /* Note: currently no card definition needs to mark the presence
242 of a RDS saa6588 chip. If this is ever needed, then add a new 241 of a RDS saa6588 chip. If this is ever needed, then add a new
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index db943a8d580d..70fd4f23f605 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -440,6 +440,7 @@ struct bttv {
440 /* radio data/state */ 440 /* radio data/state */
441 int has_radio; 441 int has_radio;
442 int radio_user; 442 int radio_user;
443 int radio_uses_msp_demodulator;
443 444
444 /* miro/pinnacle + Aimslab VHX 445 /* miro/pinnacle + Aimslab VHX
445 philips matchbox (tea5757 radio tuner) support */ 446 philips matchbox (tea5757 radio tuner) support */
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 2520219f01ba..5b75a64b199b 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -607,8 +607,9 @@ static long qc_capture(struct qcam *q, char __user *buf, unsigned long len)
607 } 607 }
608 o = i * pixels_per_line + pixels_read + k; 608 o = i * pixels_per_line + pixels_read + k;
609 if (o < len) { 609 if (o < len) {
610 u8 ch = invert - buffer[k];
610 got++; 611 got++;
611 put_user((invert - buffer[k]) << shift, buf + o); 612 put_user(ch << shift, buf + o);
612 } 613 }
613 } 614 }
614 pixels_read += bytes; 615 pixels_read += bytes;
@@ -648,8 +649,8 @@ static int qcam_querycap(struct file *file, void *priv,
648 struct qcam *qcam = video_drvdata(file); 649 struct qcam *qcam = video_drvdata(file);
649 650
650 strlcpy(vcap->driver, qcam->v4l2_dev.name, sizeof(vcap->driver)); 651 strlcpy(vcap->driver, qcam->v4l2_dev.name, sizeof(vcap->driver));
651 strlcpy(vcap->card, "B&W Quickcam", sizeof(vcap->card)); 652 strlcpy(vcap->card, "Connectix B&W Quickcam", sizeof(vcap->card));
652 strlcpy(vcap->bus_info, "parport", sizeof(vcap->bus_info)); 653 strlcpy(vcap->bus_info, qcam->pport->name, sizeof(vcap->bus_info));
653 vcap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE; 654 vcap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE;
654 vcap->capabilities = vcap->device_caps | V4L2_CAP_DEVICE_CAPS; 655 vcap->capabilities = vcap->device_caps | V4L2_CAP_DEVICE_CAPS;
655 return 0; 656 return 0;
@@ -688,8 +689,8 @@ static int qcam_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f
688 pix->height = qcam->height / qcam->transfer_scale; 689 pix->height = qcam->height / qcam->transfer_scale;
689 pix->pixelformat = (qcam->bpp == 4) ? V4L2_PIX_FMT_Y4 : V4L2_PIX_FMT_Y6; 690 pix->pixelformat = (qcam->bpp == 4) ? V4L2_PIX_FMT_Y4 : V4L2_PIX_FMT_Y6;
690 pix->field = V4L2_FIELD_NONE; 691 pix->field = V4L2_FIELD_NONE;
691 pix->bytesperline = qcam->width; 692 pix->bytesperline = pix->width;
692 pix->sizeimage = qcam->width * qcam->height; 693 pix->sizeimage = pix->width * pix->height;
693 /* Just a guess */ 694 /* Just a guess */
694 pix->colorspace = V4L2_COLORSPACE_SRGB; 695 pix->colorspace = V4L2_COLORSPACE_SRGB;
695 return 0; 696 return 0;
@@ -757,7 +758,7 @@ static int qcam_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdes
757 "4-Bit Monochrome", V4L2_PIX_FMT_Y4, 758 "4-Bit Monochrome", V4L2_PIX_FMT_Y4,
758 { 0, 0, 0, 0 } 759 { 0, 0, 0, 0 }
759 }, 760 },
760 { 0, 0, 0, 761 { 1, 0, 0,
761 "6-Bit Monochrome", V4L2_PIX_FMT_Y6, 762 "6-Bit Monochrome", V4L2_PIX_FMT_Y6,
762 { 0, 0, 0, 0 } 763 { 0, 0, 0, 0 }
763 }, 764 },
@@ -772,6 +773,25 @@ static int qcam_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdes
772 return 0; 773 return 0;
773} 774}
774 775
776static int qcam_enum_framesizes(struct file *file, void *fh,
777 struct v4l2_frmsizeenum *fsize)
778{
779 static const struct v4l2_frmsize_discrete sizes[] = {
780 { 80, 60 },
781 { 160, 120 },
782 { 320, 240 },
783 };
784
785 if (fsize->index > 2)
786 return -EINVAL;
787 if (fsize->pixel_format != V4L2_PIX_FMT_Y4 &&
788 fsize->pixel_format != V4L2_PIX_FMT_Y6)
789 return -EINVAL;
790 fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
791 fsize->discrete = sizes[fsize->index];
792 return 0;
793}
794
775static ssize_t qcam_read(struct file *file, char __user *buf, 795static ssize_t qcam_read(struct file *file, char __user *buf,
776 size_t count, loff_t *ppos) 796 size_t count, loff_t *ppos)
777{ 797{
@@ -795,6 +815,11 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
795 return len; 815 return len;
796} 816}
797 817
818static unsigned int qcam_poll(struct file *filp, poll_table *wait)
819{
820 return v4l2_ctrl_poll(filp, wait) | POLLIN | POLLRDNORM;
821}
822
798static int qcam_s_ctrl(struct v4l2_ctrl *ctrl) 823static int qcam_s_ctrl(struct v4l2_ctrl *ctrl)
799{ 824{
800 struct qcam *qcam = 825 struct qcam *qcam =
@@ -828,7 +853,7 @@ static const struct v4l2_file_operations qcam_fops = {
828 .owner = THIS_MODULE, 853 .owner = THIS_MODULE,
829 .open = v4l2_fh_open, 854 .open = v4l2_fh_open,
830 .release = v4l2_fh_release, 855 .release = v4l2_fh_release,
831 .poll = v4l2_ctrl_poll, 856 .poll = qcam_poll,
832 .unlocked_ioctl = video_ioctl2, 857 .unlocked_ioctl = video_ioctl2,
833 .read = qcam_read, 858 .read = qcam_read,
834}; 859};
@@ -839,6 +864,7 @@ static const struct v4l2_ioctl_ops qcam_ioctl_ops = {
839 .vidioc_s_input = qcam_s_input, 864 .vidioc_s_input = qcam_s_input,
840 .vidioc_enum_input = qcam_enum_input, 865 .vidioc_enum_input = qcam_enum_input,
841 .vidioc_enum_fmt_vid_cap = qcam_enum_fmt_vid_cap, 866 .vidioc_enum_fmt_vid_cap = qcam_enum_fmt_vid_cap,
867 .vidioc_enum_framesizes = qcam_enum_framesizes,
842 .vidioc_g_fmt_vid_cap = qcam_g_fmt_vid_cap, 868 .vidioc_g_fmt_vid_cap = qcam_g_fmt_vid_cap,
843 .vidioc_s_fmt_vid_cap = qcam_s_fmt_vid_cap, 869 .vidioc_s_fmt_vid_cap = qcam_s_fmt_vid_cap,
844 .vidioc_try_fmt_vid_cap = qcam_try_fmt_vid_cap, 870 .vidioc_try_fmt_vid_cap = qcam_try_fmt_vid_cap,
@@ -864,9 +890,9 @@ static struct qcam *qcam_init(struct parport *port)
864 return NULL; 890 return NULL;
865 891
866 v4l2_dev = &qcam->v4l2_dev; 892 v4l2_dev = &qcam->v4l2_dev;
867 strlcpy(v4l2_dev->name, "bw-qcam", sizeof(v4l2_dev->name)); 893 snprintf(v4l2_dev->name, sizeof(v4l2_dev->name), "bw-qcam%d", num_cams);
868 894
869 if (v4l2_device_register(NULL, v4l2_dev) < 0) { 895 if (v4l2_device_register(port->dev, v4l2_dev) < 0) {
870 v4l2_err(v4l2_dev, "Could not register v4l2_device\n"); 896 v4l2_err(v4l2_dev, "Could not register v4l2_device\n");
871 kfree(qcam); 897 kfree(qcam);
872 return NULL; 898 return NULL;
@@ -886,7 +912,7 @@ static struct qcam *qcam_init(struct parport *port)
886 return NULL; 912 return NULL;
887 } 913 }
888 qcam->pport = port; 914 qcam->pport = port;
889 qcam->pdev = parport_register_device(port, "bw-qcam", NULL, NULL, 915 qcam->pdev = parport_register_device(port, v4l2_dev->name, NULL, NULL,
890 NULL, 0, NULL); 916 NULL, 0, NULL);
891 if (qcam->pdev == NULL) { 917 if (qcam->pdev == NULL) {
892 v4l2_err(v4l2_dev, "couldn't register for %s.\n", port->name); 918 v4l2_err(v4l2_dev, "couldn't register for %s.\n", port->name);
@@ -975,6 +1001,7 @@ static int init_bwqcam(struct parport *port)
975 return -ENODEV; 1001 return -ENODEV;
976 } 1002 }
977 qc_calibrate(qcam); 1003 qc_calibrate(qcam);
1004 v4l2_ctrl_handler_setup(&qcam->hdl);
978 1005
979 parport_release(qcam->pdev); 1006 parport_release(qcam->pdev);
980 1007
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index b55d57cc1a1c..7e5ffd6f5178 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -838,10 +838,10 @@ static int cx18_setup_pci(struct cx18 *cx, struct pci_dev *pci_dev,
838 } 838 }
839 839
840 CX18_DEBUG_INFO("cx%d (rev %d) at %02x:%02x.%x, " 840 CX18_DEBUG_INFO("cx%d (rev %d) at %02x:%02x.%x, "
841 "irq: %d, latency: %d, memory: 0x%lx\n", 841 "irq: %d, latency: %d, memory: 0x%llx\n",
842 cx->pci_dev->device, cx->card_rev, pci_dev->bus->number, 842 cx->pci_dev->device, cx->card_rev, pci_dev->bus->number,
843 PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn), 843 PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn),
844 cx->pci_dev->irq, pci_latency, (unsigned long)cx->base_addr); 844 cx->pci_dev->irq, pci_latency, (u64)cx->base_addr);
845 845
846 return 0; 846 return 0;
847} 847}
@@ -938,7 +938,7 @@ static int __devinit cx18_probe(struct pci_dev *pci_dev,
938 if (retval) 938 if (retval)
939 goto err; 939 goto err;
940 940
941 CX18_DEBUG_INFO("base addr: 0x%08x\n", cx->base_addr); 941 CX18_DEBUG_INFO("base addr: 0x%llx\n", (u64)cx->base_addr);
942 942
943 /* PCI Device Setup */ 943 /* PCI Device Setup */
944 retval = cx18_setup_pci(cx, pci_dev, pci_id); 944 retval = cx18_setup_pci(cx, pci_dev, pci_id);
@@ -946,8 +946,8 @@ static int __devinit cx18_probe(struct pci_dev *pci_dev,
946 goto free_workqueues; 946 goto free_workqueues;
947 947
948 /* map io memory */ 948 /* map io memory */
949 CX18_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", 949 CX18_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
950 cx->base_addr + CX18_MEM_OFFSET, CX18_MEM_SIZE); 950 (u64)cx->base_addr + CX18_MEM_OFFSET, CX18_MEM_SIZE);
951 cx->enc_mem = ioremap_nocache(cx->base_addr + CX18_MEM_OFFSET, 951 cx->enc_mem = ioremap_nocache(cx->base_addr + CX18_MEM_OFFSET,
952 CX18_MEM_SIZE); 952 CX18_MEM_SIZE);
953 if (!cx->enc_mem) { 953 if (!cx->enc_mem) {
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h
index 7a37e0ee136f..2767c64df0c8 100644
--- a/drivers/media/video/cx18/cx18-driver.h
+++ b/drivers/media/video/cx18/cx18-driver.h
@@ -622,7 +622,7 @@ struct cx18 {
622 unique ID. Starts at 1, so 0 can be used as 622 unique ID. Starts at 1, so 0 can be used as
623 uninitialized value in the stream->id. */ 623 uninitialized value in the stream->id. */
624 624
625 u32 base_addr; 625 resource_size_t base_addr;
626 626
627 u8 card_rev; 627 u8 card_rev;
628 void __iomem *enc_mem, *reg_mem; 628 void __iomem *enc_mem, *reg_mem;
diff --git a/drivers/media/video/cx18/cx18-firmware.c b/drivers/media/video/cx18/cx18-firmware.c
index 1b3fb502e6be..b85c292a849a 100644
--- a/drivers/media/video/cx18/cx18-firmware.c
+++ b/drivers/media/video/cx18/cx18-firmware.c
@@ -164,8 +164,13 @@ static int load_apu_fw_direct(const char *fn, u8 __iomem *dst, struct cx18 *cx,
164 164
165 apu_version = (vers[0] << 24) | (vers[4] << 16) | vers[32]; 165 apu_version = (vers[0] << 24) | (vers[4] << 16) | vers[32];
166 while (offset + sizeof(seghdr) < fw->size) { 166 while (offset + sizeof(seghdr) < fw->size) {
167 /* TODO: byteswapping */ 167 const u32 *shptr = src + offset / 4;
168 memcpy(&seghdr, src + offset / 4, sizeof(seghdr)); 168
169 seghdr.sync1 = le32_to_cpu(shptr[0]);
170 seghdr.sync2 = le32_to_cpu(shptr[1]);
171 seghdr.addr = le32_to_cpu(shptr[2]);
172 seghdr.size = le32_to_cpu(shptr[3]);
173
169 offset += sizeof(seghdr); 174 offset += sizeof(seghdr);
170 if (seghdr.sync1 != APU_ROM_SYNC1 || 175 if (seghdr.sync1 != APU_ROM_SYNC1 ||
171 seghdr.sync2 != APU_ROM_SYNC2) { 176 seghdr.sync2 != APU_ROM_SYNC2) {
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c
index ed8118390b02..eabf00c6351b 100644
--- a/drivers/media/video/cx18/cx18-mailbox.c
+++ b/drivers/media/video/cx18/cx18-mailbox.c
@@ -434,6 +434,7 @@ static int epu_dma_done_irq(struct cx18 *cx, struct cx18_in_work_order *order)
434{ 434{
435 u32 handle, mdl_ack_offset, mdl_ack_count; 435 u32 handle, mdl_ack_offset, mdl_ack_count;
436 struct cx18_mailbox *mb; 436 struct cx18_mailbox *mb;
437 int i;
437 438
438 mb = &order->mb; 439 mb = &order->mb;
439 handle = mb->args[0]; 440 handle = mb->args[0];
@@ -447,8 +448,9 @@ static int epu_dma_done_irq(struct cx18 *cx, struct cx18_in_work_order *order)
447 return -1; 448 return -1;
448 } 449 }
449 450
450 cx18_memcpy_fromio(cx, order->mdl_ack, cx->enc_mem + mdl_ack_offset, 451 for (i = 0; i < sizeof(struct cx18_mdl_ack) * mdl_ack_count; i += sizeof(u32))
451 sizeof(struct cx18_mdl_ack) * mdl_ack_count); 452 ((u32 *)order->mdl_ack)[i / sizeof(u32)] =
453 cx18_readl(cx, cx->enc_mem + mdl_ack_offset + i);
452 454
453 if ((order->flags & CX18_F_EWO_MB_STALE) == 0) 455 if ((order->flags & CX18_F_EWO_MB_STALE) == 0)
454 mb_ack_irq(cx, order); 456 mb_ack_irq(cx, order);
@@ -538,6 +540,7 @@ void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu)
538 struct cx18_mailbox *order_mb; 540 struct cx18_mailbox *order_mb;
539 struct cx18_in_work_order *order; 541 struct cx18_in_work_order *order;
540 int submit; 542 int submit;
543 int i;
541 544
542 switch (rpu) { 545 switch (rpu) {
543 case CPU: 546 case CPU:
@@ -562,10 +565,12 @@ void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu)
562 order_mb = &order->mb; 565 order_mb = &order->mb;
563 566
564 /* mb->cmd and mb->args[0] through mb->args[2] */ 567 /* mb->cmd and mb->args[0] through mb->args[2] */
565 cx18_memcpy_fromio(cx, &order_mb->cmd, &mb->cmd, 4 * sizeof(u32)); 568 for (i = 0; i < 4; i++)
569 (&order_mb->cmd)[i] = cx18_readl(cx, &mb->cmd + i);
570
566 /* mb->request and mb->ack. N.B. we want to read mb->ack last */ 571 /* mb->request and mb->ack. N.B. we want to read mb->ack last */
567 cx18_memcpy_fromio(cx, &order_mb->request, &mb->request, 572 for (i = 0; i < 2; i++)
568 2 * sizeof(u32)); 573 (&order_mb->request)[i] = cx18_readl(cx, &mb->request + i);
569 574
570 if (order_mb->request == order_mb->ack) { 575 if (order_mb->request == order_mb->ack) {
571 CX18_DEBUG_WARN("Possibly falling behind: %s self-ack'ed our " 576 CX18_DEBUG_WARN("Possibly falling behind: %s self-ack'ed our "
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index e46446a449c0..ed7b2aa1ed83 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -471,7 +471,7 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
471 dprintk(1,"Loading firmware ...\n"); 471 dprintk(1,"Loading firmware ...\n");
472 dataptr = (u32*)firmware->data; 472 dataptr = (u32*)firmware->data;
473 for (i = 0; i < (firmware->size >> 2); i++) { 473 for (i = 0; i < (firmware->size >> 2); i++) {
474 value = *dataptr; 474 value = le32_to_cpu(*dataptr);
475 checksum += ~value; 475 checksum += ~value;
476 memory_write(dev->core, i, value); 476 memory_write(dev->core, i, value);
477 dataptr++; 477 dataptr++;
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 20a7e24de6fb..92da7c28b6f0 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -974,6 +974,7 @@ struct em28xx_board em28xx_boards[] = {
974 [EM2884_BOARD_CINERGY_HTC_STICK] = { 974 [EM2884_BOARD_CINERGY_HTC_STICK] = {
975 .name = "Terratec Cinergy HTC Stick", 975 .name = "Terratec Cinergy HTC Stick",
976 .has_dvb = 1, 976 .has_dvb = 1,
977 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
977#if 0 978#if 0
978 .tuner_type = TUNER_PHILIPS_TDA8290, 979 .tuner_type = TUNER_PHILIPS_TDA8290,
979 .tuner_addr = 0x41, 980 .tuner_addr = 0x41,
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index fce5f7680c99..5e30c4f3f248 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -527,6 +527,8 @@ static int em28xx_ir_init(struct em28xx *dev)
527 527
528 if (dev->board.ir_codes == NULL) { 528 if (dev->board.ir_codes == NULL) {
529 /* No remote control support */ 529 /* No remote control support */
530 em28xx_warn("Remote control support is not available for "
531 "this card.\n");
530 return 0; 532 return 0;
531 } 533 }
532 534
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 137166d73945..31721eadc597 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -1653,7 +1653,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
1653 enum v4l2_buf_type buf_type) 1653 enum v4l2_buf_type buf_type)
1654{ 1654{
1655 struct gspca_dev *gspca_dev = video_drvdata(file); 1655 struct gspca_dev *gspca_dev = video_drvdata(file);
1656 int ret; 1656 int i, ret;
1657 1657
1658 if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 1658 if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1659 return -EINVAL; 1659 return -EINVAL;
@@ -1678,6 +1678,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
1678 wake_up_interruptible(&gspca_dev->wq); 1678 wake_up_interruptible(&gspca_dev->wq);
1679 1679
1680 /* empty the transfer queues */ 1680 /* empty the transfer queues */
1681 for (i = 0; i < gspca_dev->nframes; i++)
1682 gspca_dev->frame[i].v4l2_buf.flags &= ~BUF_ALL_FLAGS;
1681 atomic_set(&gspca_dev->fr_q, 0); 1683 atomic_set(&gspca_dev->fr_q, 0);
1682 atomic_set(&gspca_dev->fr_i, 0); 1684 atomic_set(&gspca_dev->fr_i, 0);
1683 gspca_dev->fr_o = 0; 1685 gspca_dev->fr_o = 0;
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c
index b5acb1e4b4e7..80c81dd6d68b 100644
--- a/drivers/media/video/gspca/ov534.c
+++ b/drivers/media/video/gspca/ov534.c
@@ -96,7 +96,7 @@ static void setbrightness(struct gspca_dev *gspca_dev);
96static void setcontrast(struct gspca_dev *gspca_dev); 96static void setcontrast(struct gspca_dev *gspca_dev);
97static void setgain(struct gspca_dev *gspca_dev); 97static void setgain(struct gspca_dev *gspca_dev);
98static void setexposure(struct gspca_dev *gspca_dev); 98static void setexposure(struct gspca_dev *gspca_dev);
99static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val); 99static void setagc(struct gspca_dev *gspca_dev);
100static void setawb(struct gspca_dev *gspca_dev); 100static void setawb(struct gspca_dev *gspca_dev);
101static void setaec(struct gspca_dev *gspca_dev); 101static void setaec(struct gspca_dev *gspca_dev);
102static void setsharpness(struct gspca_dev *gspca_dev); 102static void setsharpness(struct gspca_dev *gspca_dev);
@@ -189,7 +189,7 @@ static const struct ctrl sd_ctrls[] = {
189 .step = 1, 189 .step = 1,
190 .default_value = 1, 190 .default_value = 1,
191 }, 191 },
192 .set = sd_setagc 192 .set_control = setagc
193 }, 193 },
194[AWB] = { 194[AWB] = {
195 { 195 {
@@ -851,6 +851,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev)
851 int i; 851 int i;
852 852
853 for (i = 0; i < 5; i++) { 853 for (i = 0; i < 5; i++) {
854 msleep(10);
854 data = ov534_reg_read(gspca_dev, OV534_REG_STATUS); 855 data = ov534_reg_read(gspca_dev, OV534_REG_STATUS);
855 856
856 switch (data) { 857 switch (data) {
@@ -1242,10 +1243,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
1242 1243
1243 cam->ctrls = sd->ctrls; 1244 cam->ctrls = sd->ctrls;
1244 1245
1245 /* the auto white balance control works only when auto gain is set */
1246 if (sd_ctrls[AGC].qctrl.default_value == 0)
1247 gspca_dev->ctrl_inac |= (1 << AWB);
1248
1249 cam->cam_mode = ov772x_mode; 1246 cam->cam_mode = ov772x_mode;
1250 cam->nmodes = ARRAY_SIZE(ov772x_mode); 1247 cam->nmodes = ARRAY_SIZE(ov772x_mode);
1251 1248
@@ -1486,29 +1483,6 @@ scan_next:
1486 } while (remaining_len > 0); 1483 } while (remaining_len > 0);
1487} 1484}
1488 1485
1489static int sd_setagc(struct gspca_dev *gspca_dev, __s32 val)
1490{
1491 struct sd *sd = (struct sd *) gspca_dev;
1492
1493 sd->ctrls[AGC].val = val;
1494
1495 /* the auto white balance control works only
1496 * when auto gain is set */
1497 if (val) {
1498 gspca_dev->ctrl_inac &= ~(1 << AWB);
1499 } else {
1500 gspca_dev->ctrl_inac |= (1 << AWB);
1501 if (sd->ctrls[AWB].val) {
1502 sd->ctrls[AWB].val = 0;
1503 if (gspca_dev->streaming)
1504 setawb(gspca_dev);
1505 }
1506 }
1507 if (gspca_dev->streaming)
1508 setagc(gspca_dev);
1509 return gspca_dev->usb_err;
1510}
1511
1512static int sd_querymenu(struct gspca_dev *gspca_dev, 1486static int sd_querymenu(struct gspca_dev *gspca_dev,
1513 struct v4l2_querymenu *menu) 1487 struct v4l2_querymenu *menu)
1514{ 1488{
diff --git a/drivers/media/video/gspca/ov534_9.c b/drivers/media/video/gspca/ov534_9.c
index b5797308a39b..1fd41f0d2e95 100644
--- a/drivers/media/video/gspca/ov534_9.c
+++ b/drivers/media/video/gspca/ov534_9.c
@@ -1008,6 +1008,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev)
1008 int i; 1008 int i;
1009 1009
1010 for (i = 0; i < 5; i++) { 1010 for (i = 0; i < 5; i++) {
1011 msleep(10);
1011 data = reg_r(gspca_dev, OV534_REG_STATUS); 1012 data = reg_r(gspca_dev, OV534_REG_STATUS);
1012 1013
1013 switch (data) { 1014 switch (data) {
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index 2cb7d95f7be7..115da169f32a 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -418,7 +418,7 @@ static int sd_init_controls(struct gspca_dev *gspca_dev)
418 struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; 418 struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
419 419
420 gspca_dev->vdev.ctrl_handler = hdl; 420 gspca_dev->vdev.ctrl_handler = hdl;
421 v4l2_ctrl_handler_init(hdl, 4); 421 v4l2_ctrl_handler_init(hdl, 5);
422 422
423 sd->contrast = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 423 sd->contrast = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
424 V4L2_CID_CONTRAST, 0, 15, 1, 7); 424 V4L2_CID_CONTRAST, 0, 15, 1, 7);
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
index ad098202d7f0..6c31e46a1fd2 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -1761,7 +1761,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev)
1761 V4L2_CID_SATURATION, 0, 255, 1, 127); 1761 V4L2_CID_SATURATION, 0, 255, 1, 127);
1762 sd->hue = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 1762 sd->hue = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1763 V4L2_CID_HUE, -180, 180, 1, 0); 1763 V4L2_CID_HUE, -180, 180, 1, 0);
1764 v4l2_ctrl_cluster(4, &sd->brightness);
1765 1764
1766 sd->gamma = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 1765 sd->gamma = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1767 V4L2_CID_GAMMA, 0, 255, 1, 0x10); 1766 V4L2_CID_GAMMA, 0, 255, 1, 0x10);
@@ -1770,7 +1769,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev)
1770 V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0x28); 1769 V4L2_CID_BLUE_BALANCE, 0, 127, 1, 0x28);
1771 sd->red = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 1770 sd->red = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1772 V4L2_CID_RED_BALANCE, 0, 127, 1, 0x28); 1771 V4L2_CID_RED_BALANCE, 0, 127, 1, 0x28);
1773 v4l2_ctrl_cluster(2, &sd->blue);
1774 1772
1775 if (sd->sensor != SENSOR_OV9655 && sd->sensor != SENSOR_SOI968 && 1773 if (sd->sensor != SENSOR_OV9655 && sd->sensor != SENSOR_SOI968 &&
1776 sd->sensor != SENSOR_OV7670 && sd->sensor != SENSOR_MT9M001 && 1774 sd->sensor != SENSOR_OV7670 && sd->sensor != SENSOR_MT9M001 &&
@@ -1779,7 +1777,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev)
1779 V4L2_CID_HFLIP, 0, 1, 1, 0); 1777 V4L2_CID_HFLIP, 0, 1, 1, 0);
1780 sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 1778 sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1781 V4L2_CID_VFLIP, 0, 1, 1, 0); 1779 V4L2_CID_VFLIP, 0, 1, 1, 0);
1782 v4l2_ctrl_cluster(2, &sd->hflip);
1783 } 1780 }
1784 1781
1785 if (sd->sensor != SENSOR_SOI968 && sd->sensor != SENSOR_MT9VPRB && 1782 if (sd->sensor != SENSOR_SOI968 && sd->sensor != SENSOR_MT9VPRB &&
@@ -1794,6 +1791,20 @@ static int sd_init_controls(struct gspca_dev *gspca_dev)
1794 V4L2_CID_GAIN, 0, 28, 1, 0); 1791 V4L2_CID_GAIN, 0, 28, 1, 0);
1795 sd->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, 1792 sd->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1796 V4L2_CID_AUTOGAIN, 0, 1, 1, 1); 1793 V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
1794 }
1795
1796 sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1797 V4L2_CID_JPEG_COMPRESSION_QUALITY, 50, 90, 1, 80);
1798 if (hdl->error) {
1799 pr_err("Could not initialize controls\n");
1800 return hdl->error;
1801 }
1802
1803 v4l2_ctrl_cluster(4, &sd->brightness);
1804 v4l2_ctrl_cluster(2, &sd->blue);
1805 if (sd->hflip)
1806 v4l2_ctrl_cluster(2, &sd->hflip);
1807 if (sd->autogain) {
1797 if (sd->sensor == SENSOR_SOI968) 1808 if (sd->sensor == SENSOR_SOI968)
1798 /* this sensor doesn't have the exposure control and 1809 /* this sensor doesn't have the exposure control and
1799 autogain is clustered with gain instead. This works 1810 autogain is clustered with gain instead. This works
@@ -1803,13 +1814,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev)
1803 /* Otherwise autogain is clustered with exposure. */ 1814 /* Otherwise autogain is clustered with exposure. */
1804 v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, false); 1815 v4l2_ctrl_auto_cluster(2, &sd->autogain, 0, false);
1805 } 1816 }
1806
1807 sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
1808 V4L2_CID_JPEG_COMPRESSION_QUALITY, 50, 90, 1, 80);
1809 if (hdl->error) {
1810 pr_err("Could not initialize controls\n");
1811 return hdl->error;
1812 }
1813 return 0; 1817 return 0;
1814} 1818}
1815 1819
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 4d1696d1a7f4..f38faa9b37c3 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -3120,7 +3120,7 @@ static const struct sd_desc sd_desc = {
3120 | (SENSOR_ ## sensor << 8) \ 3120 | (SENSOR_ ## sensor << 8) \
3121 | (flags) 3121 | (flags)
3122static const struct usb_device_id device_table[] = { 3122static const struct usb_device_id device_table[] = {
3123 {USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)}, 3123 {USB_DEVICE(0x0458, 0x7025), BSF(SN9C120, MI0360B, F_PDN_INV)},
3124 {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)}, 3124 {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)},
3125 {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)}, 3125 {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)},
3126 {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)}, 3126 {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)},
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 057929e165ab..5462ce2f60ea 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -866,10 +866,10 @@ static int ivtv_setup_pci(struct ivtv *itv, struct pci_dev *pdev,
866 pci_write_config_dword(pdev, 0x40, 0xffff); 866 pci_write_config_dword(pdev, 0x40, 0xffff);
867 867
868 IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, " 868 IVTV_DEBUG_INFO("%d (rev %d) at %02x:%02x.%x, "
869 "irq: %d, latency: %d, memory: 0x%lx\n", 869 "irq: %d, latency: %d, memory: 0x%llx\n",
870 pdev->device, pdev->revision, pdev->bus->number, 870 pdev->device, pdev->revision, pdev->bus->number,
871 PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), 871 PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn),
872 pdev->irq, pci_latency, (unsigned long)itv->base_addr); 872 pdev->irq, pci_latency, (u64)itv->base_addr);
873 873
874 return 0; 874 return 0;
875} 875}
@@ -1007,7 +1007,7 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
1007 itv->cxhdl.priv = itv; 1007 itv->cxhdl.priv = itv;
1008 itv->cxhdl.func = ivtv_api_func; 1008 itv->cxhdl.func = ivtv_api_func;
1009 1009
1010 IVTV_DEBUG_INFO("base addr: 0x%08x\n", itv->base_addr); 1010 IVTV_DEBUG_INFO("base addr: 0x%llx\n", (u64)itv->base_addr);
1011 1011
1012 /* PCI Device Setup */ 1012 /* PCI Device Setup */
1013 retval = ivtv_setup_pci(itv, pdev, pci_id); 1013 retval = ivtv_setup_pci(itv, pdev, pci_id);
@@ -1017,8 +1017,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
1017 goto free_mem; 1017 goto free_mem;
1018 1018
1019 /* map io memory */ 1019 /* map io memory */
1020 IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", 1020 IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
1021 itv->base_addr + IVTV_ENCODER_OFFSET, IVTV_ENCODER_SIZE); 1021 (u64)itv->base_addr + IVTV_ENCODER_OFFSET, IVTV_ENCODER_SIZE);
1022 itv->enc_mem = ioremap_nocache(itv->base_addr + IVTV_ENCODER_OFFSET, 1022 itv->enc_mem = ioremap_nocache(itv->base_addr + IVTV_ENCODER_OFFSET,
1023 IVTV_ENCODER_SIZE); 1023 IVTV_ENCODER_SIZE);
1024 if (!itv->enc_mem) { 1024 if (!itv->enc_mem) {
@@ -1034,8 +1034,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
1034 } 1034 }
1035 1035
1036 if (itv->has_cx23415) { 1036 if (itv->has_cx23415) {
1037 IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", 1037 IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
1038 itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE); 1038 (u64)itv->base_addr + IVTV_DECODER_OFFSET, IVTV_DECODER_SIZE);
1039 itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET, 1039 itv->dec_mem = ioremap_nocache(itv->base_addr + IVTV_DECODER_OFFSET,
1040 IVTV_DECODER_SIZE); 1040 IVTV_DECODER_SIZE);
1041 if (!itv->dec_mem) { 1041 if (!itv->dec_mem) {
@@ -1056,8 +1056,8 @@ static int __devinit ivtv_probe(struct pci_dev *pdev,
1056 } 1056 }
1057 1057
1058 /* map registers memory */ 1058 /* map registers memory */
1059 IVTV_DEBUG_INFO("attempting ioremap at 0x%08x len 0x%08x\n", 1059 IVTV_DEBUG_INFO("attempting ioremap at 0x%llx len 0x%08x\n",
1060 itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); 1060 (u64)itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE);
1061 itv->reg_mem = 1061 itv->reg_mem =
1062 ioremap_nocache(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE); 1062 ioremap_nocache(itv->base_addr + IVTV_REG_OFFSET, IVTV_REG_SIZE);
1063 if (!itv->reg_mem) { 1063 if (!itv->reg_mem) {
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h
index 2e220028aad2..a7e00f8938f8 100644
--- a/drivers/media/video/ivtv/ivtv-driver.h
+++ b/drivers/media/video/ivtv/ivtv-driver.h
@@ -622,7 +622,7 @@ struct ivtv {
622 struct v4l2_subdev *sd_video; /* controlling video decoder subdev */ 622 struct v4l2_subdev *sd_video; /* controlling video decoder subdev */
623 struct v4l2_subdev *sd_audio; /* controlling audio subdev */ 623 struct v4l2_subdev *sd_audio; /* controlling audio subdev */
624 struct v4l2_subdev *sd_muxer; /* controlling audio muxer subdev */ 624 struct v4l2_subdev *sd_muxer; /* controlling audio muxer subdev */
625 u32 base_addr; /* PCI resource base address */ 625 resource_size_t base_addr; /* PCI resource base address */
626 volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */ 626 volatile void __iomem *enc_mem; /* pointer to mapped encoder memory */
627 volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */ 627 volatile void __iomem *dec_mem; /* pointer to mapped decoder memory */
628 volatile void __iomem *reg_mem; /* pointer to mapped registers */ 628 volatile void __iomem *reg_mem; /* pointer to mapped registers */
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c
index d2dec585e61b..3945556f5733 100644
--- a/drivers/media/video/mem2mem_testdev.c
+++ b/drivers/media/video/mem2mem_testdev.c
@@ -110,22 +110,6 @@ enum {
110 V4L2_M2M_DST = 1, 110 V4L2_M2M_DST = 1,
111}; 111};
112 112
113/* Source and destination queue data */
114static struct m2mtest_q_data q_data[2];
115
116static struct m2mtest_q_data *get_q_data(enum v4l2_buf_type type)
117{
118 switch (type) {
119 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
120 return &q_data[V4L2_M2M_SRC];
121 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
122 return &q_data[V4L2_M2M_DST];
123 default:
124 BUG();
125 }
126 return NULL;
127}
128
129#define V4L2_CID_TRANS_TIME_MSEC V4L2_CID_PRIVATE_BASE 113#define V4L2_CID_TRANS_TIME_MSEC V4L2_CID_PRIVATE_BASE
130#define V4L2_CID_TRANS_NUM_BUFS (V4L2_CID_PRIVATE_BASE + 1) 114#define V4L2_CID_TRANS_NUM_BUFS (V4L2_CID_PRIVATE_BASE + 1)
131 115
@@ -198,8 +182,26 @@ struct m2mtest_ctx {
198 int aborting; 182 int aborting;
199 183
200 struct v4l2_m2m_ctx *m2m_ctx; 184 struct v4l2_m2m_ctx *m2m_ctx;
185
186 /* Source and destination queue data */
187 struct m2mtest_q_data q_data[2];
201}; 188};
202 189
190static struct m2mtest_q_data *get_q_data(struct m2mtest_ctx *ctx,
191 enum v4l2_buf_type type)
192{
193 switch (type) {
194 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
195 return &ctx->q_data[V4L2_M2M_SRC];
196 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
197 return &ctx->q_data[V4L2_M2M_DST];
198 default:
199 BUG();
200 }
201 return NULL;
202}
203
204
203static struct v4l2_queryctrl *get_ctrl(int id) 205static struct v4l2_queryctrl *get_ctrl(int id)
204{ 206{
205 int i; 207 int i;
@@ -223,7 +225,7 @@ static int device_process(struct m2mtest_ctx *ctx,
223 int tile_w, bytes_left; 225 int tile_w, bytes_left;
224 int width, height, bytesperline; 226 int width, height, bytesperline;
225 227
226 q_data = get_q_data(V4L2_BUF_TYPE_VIDEO_OUTPUT); 228 q_data = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
227 229
228 width = q_data->width; 230 width = q_data->width;
229 height = q_data->height; 231 height = q_data->height;
@@ -436,7 +438,7 @@ static int vidioc_g_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f)
436 if (!vq) 438 if (!vq)
437 return -EINVAL; 439 return -EINVAL;
438 440
439 q_data = get_q_data(f->type); 441 q_data = get_q_data(ctx, f->type);
440 442
441 f->fmt.pix.width = q_data->width; 443 f->fmt.pix.width = q_data->width;
442 f->fmt.pix.height = q_data->height; 444 f->fmt.pix.height = q_data->height;
@@ -535,7 +537,7 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f)
535 if (!vq) 537 if (!vq)
536 return -EINVAL; 538 return -EINVAL;
537 539
538 q_data = get_q_data(f->type); 540 q_data = get_q_data(ctx, f->type);
539 if (!q_data) 541 if (!q_data)
540 return -EINVAL; 542 return -EINVAL;
541 543
@@ -747,7 +749,7 @@ static int m2mtest_queue_setup(struct vb2_queue *vq,
747 struct m2mtest_q_data *q_data; 749 struct m2mtest_q_data *q_data;
748 unsigned int size, count = *nbuffers; 750 unsigned int size, count = *nbuffers;
749 751
750 q_data = get_q_data(vq->type); 752 q_data = get_q_data(ctx, vq->type);
751 753
752 size = q_data->width * q_data->height * q_data->fmt->depth >> 3; 754 size = q_data->width * q_data->height * q_data->fmt->depth >> 3;
753 755
@@ -775,7 +777,7 @@ static int m2mtest_buf_prepare(struct vb2_buffer *vb)
775 777
776 dprintk(ctx->dev, "type: %d\n", vb->vb2_queue->type); 778 dprintk(ctx->dev, "type: %d\n", vb->vb2_queue->type);
777 779
778 q_data = get_q_data(vb->vb2_queue->type); 780 q_data = get_q_data(ctx, vb->vb2_queue->type);
779 781
780 if (vb2_plane_size(vb, 0) < q_data->sizeimage) { 782 if (vb2_plane_size(vb, 0) < q_data->sizeimage) {
781 dprintk(ctx->dev, "%s data will not fit into plane (%lu < %lu)\n", 783 dprintk(ctx->dev, "%s data will not fit into plane (%lu < %lu)\n",
@@ -860,6 +862,9 @@ static int m2mtest_open(struct file *file)
860 ctx->transtime = MEM2MEM_DEF_TRANSTIME; 862 ctx->transtime = MEM2MEM_DEF_TRANSTIME;
861 ctx->num_processed = 0; 863 ctx->num_processed = 0;
862 864
865 ctx->q_data[V4L2_M2M_SRC].fmt = &formats[0];
866 ctx->q_data[V4L2_M2M_DST].fmt = &formats[0];
867
863 ctx->m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &queue_init); 868 ctx->m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &queue_init);
864 869
865 if (IS_ERR(ctx->m2m_ctx)) { 870 if (IS_ERR(ctx->m2m_ctx)) {
@@ -986,9 +991,6 @@ static int m2mtest_probe(struct platform_device *pdev)
986 goto err_m2m; 991 goto err_m2m;
987 } 992 }
988 993
989 q_data[V4L2_M2M_SRC].fmt = &formats[0];
990 q_data[V4L2_M2M_DST].fmt = &formats[0];
991
992 return 0; 994 return 0;
993 995
994 v4l2_m2m_release(dev->m2m_dev); 996 v4l2_m2m_release(dev->m2m_dev);
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index ded26b7286fa..41f9a254b245 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -345,19 +345,6 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
345 PRP_INTR_CH2OVF, 345 PRP_INTR_CH2OVF,
346 } 346 }
347 }, 347 },
348 {
349 .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8,
350 .out_fmt = V4L2_PIX_FMT_YUV420,
351 .cfg = {
352 .channel = 2,
353 .in_fmt = PRP_CNTL_DATA_IN_YUV422,
354 .out_fmt = PRP_CNTL_CH2_OUT_YUV420,
355 .src_pixel = 0x22000888, /* YUV422 (YUYV) */
356 .irq_flags = PRP_INTR_RDERR | PRP_INTR_CH2WERR |
357 PRP_INTR_CH2FC | PRP_INTR_LBOVF |
358 PRP_INTR_CH2OVF,
359 }
360 },
361}; 348};
362 349
363static struct mx2_fmt_cfg *mx27_emma_prp_get_format( 350static struct mx2_fmt_cfg *mx27_emma_prp_get_format(
@@ -984,7 +971,6 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
984 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 971 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
985 struct mx2_camera_dev *pcdev = ici->priv; 972 struct mx2_camera_dev *pcdev = ici->priv;
986 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; 973 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
987 const struct soc_camera_format_xlate *xlate;
988 unsigned long common_flags; 974 unsigned long common_flags;
989 int ret; 975 int ret;
990 int bytesperline; 976 int bytesperline;
@@ -1029,31 +1015,14 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
1029 return ret; 1015 return ret;
1030 } 1016 }
1031 1017
1032 xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
1033 if (!xlate) {
1034 dev_warn(icd->parent, "Format %x not found\n", pixfmt);
1035 return -EINVAL;
1036 }
1037
1038 if (xlate->code == V4L2_MBUS_FMT_YUYV8_2X8) {
1039 csicr1 |= CSICR1_PACK_DIR;
1040 csicr1 &= ~CSICR1_SWAP16_EN;
1041 dev_dbg(icd->parent, "already yuyv format, don't convert\n");
1042 } else if (xlate->code == V4L2_MBUS_FMT_UYVY8_2X8) {
1043 csicr1 &= ~CSICR1_PACK_DIR;
1044 csicr1 |= CSICR1_SWAP16_EN;
1045 dev_dbg(icd->parent, "convert uyvy mbus format into yuyv\n");
1046 } else {
1047 dev_warn(icd->parent, "mbus format not supported\n");
1048 return -EINVAL;
1049 }
1050
1051 if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING) 1018 if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
1052 csicr1 |= CSICR1_REDGE; 1019 csicr1 |= CSICR1_REDGE;
1053 if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH) 1020 if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
1054 csicr1 |= CSICR1_SOF_POL; 1021 csicr1 |= CSICR1_SOF_POL;
1055 if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH) 1022 if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
1056 csicr1 |= CSICR1_HSYNC_POL; 1023 csicr1 |= CSICR1_HSYNC_POL;
1024 if (pcdev->platform_flags & MX2_CAMERA_SWAP16)
1025 csicr1 |= CSICR1_SWAP16_EN;
1057 if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC) 1026 if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC)
1058 csicr1 |= CSICR1_EXT_VSYNC; 1027 csicr1 |= CSICR1_EXT_VSYNC;
1059 if (pcdev->platform_flags & MX2_CAMERA_CCIR) 1028 if (pcdev->platform_flags & MX2_CAMERA_CCIR)
@@ -1064,6 +1033,8 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
1064 csicr1 |= CSICR1_GCLK_MODE; 1033 csicr1 |= CSICR1_GCLK_MODE;
1065 if (pcdev->platform_flags & MX2_CAMERA_INV_DATA) 1034 if (pcdev->platform_flags & MX2_CAMERA_INV_DATA)
1066 csicr1 |= CSICR1_INV_DATA; 1035 csicr1 |= CSICR1_INV_DATA;
1036 if (pcdev->platform_flags & MX2_CAMERA_PACK_DIR_MSB)
1037 csicr1 |= CSICR1_PACK_DIR;
1067 1038
1068 pcdev->csicr1 = csicr1; 1039 pcdev->csicr1 = csicr1;
1069 1040
@@ -1138,8 +1109,7 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd,
1138 return 0; 1109 return 0;
1139 } 1110 }
1140 1111
1141 if (code == V4L2_MBUS_FMT_YUYV8_2X8 || 1112 if (code == V4L2_MBUS_FMT_YUYV8_2X8) {
1142 code == V4L2_MBUS_FMT_UYVY8_2X8) {
1143 formats++; 1113 formats++;
1144 if (xlate) { 1114 if (xlate) {
1145 /* 1115 /*
@@ -1155,18 +1125,6 @@ static int mx2_camera_get_formats(struct soc_camera_device *icd,
1155 } 1125 }
1156 } 1126 }
1157 1127
1158 if (code == V4L2_MBUS_FMT_UYVY8_2X8) {
1159 formats++;
1160 if (xlate) {
1161 xlate->host_fmt =
1162 soc_mbus_get_fmtdesc(V4L2_MBUS_FMT_YUYV8_2X8);
1163 xlate->code = code;
1164 dev_dbg(dev, "Providing host format %s for sensor code %d\n",
1165 xlate->host_fmt->name, code);
1166 xlate++;
1167 }
1168 }
1169
1170 /* Generic pass-trough */ 1128 /* Generic pass-trough */
1171 formats++; 1129 formats++;
1172 if (xlate) { 1130 if (xlate) {
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index fedcd561ba27..92fc5a20fb76 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -615,7 +615,7 @@ int fimc_ctrls_create(struct fimc_ctx *ctx)
615 ctx->effect.type = FIMC_REG_CIIMGEFF_FIN_BYPASS; 615 ctx->effect.type = FIMC_REG_CIIMGEFF_FIN_BYPASS;
616 616
617 if (!handler->error) { 617 if (!handler->error) {
618 v4l2_ctrl_cluster(3, &ctrls->colorfx); 618 v4l2_ctrl_cluster(2, &ctrls->colorfx);
619 ctrls->ready = true; 619 ctrls->ready = true;
620 } 620 }
621 621
diff --git a/drivers/media/video/s5p-mfc/regs-mfc.h b/drivers/media/video/s5p-mfc/regs-mfc.h
index 053a8a872fd7..a19bece41ba9 100644
--- a/drivers/media/video/s5p-mfc/regs-mfc.h
+++ b/drivers/media/video/s5p-mfc/regs-mfc.h
@@ -164,10 +164,15 @@
164 decoded pic */ 164 decoded pic */
165#define S5P_FIMV_SI_DISPLAY_Y_ADR 0x2010 /* luma addr of displayed pic */ 165#define S5P_FIMV_SI_DISPLAY_Y_ADR 0x2010 /* luma addr of displayed pic */
166#define S5P_FIMV_SI_DISPLAY_C_ADR 0x2014 /* chroma addrof displayed pic */ 166#define S5P_FIMV_SI_DISPLAY_C_ADR 0x2014 /* chroma addrof displayed pic */
167
167#define S5P_FIMV_SI_CONSUMED_BYTES 0x2018 /* Consumed number of bytes to 168#define S5P_FIMV_SI_CONSUMED_BYTES 0x2018 /* Consumed number of bytes to
168 decode a frame */ 169 decode a frame */
169#define S5P_FIMV_SI_DISPLAY_STATUS 0x201c /* status of decoded picture */ 170#define S5P_FIMV_SI_DISPLAY_STATUS 0x201c /* status of decoded picture */
170 171
172#define S5P_FIMV_SI_DECODE_Y_ADR 0x2024 /* luma addr of decoded pic */
173#define S5P_FIMV_SI_DECODE_C_ADR 0x2028 /* chroma addrof decoded pic */
174#define S5P_FIMV_SI_DECODE_STATUS 0x202c /* status of decoded picture */
175
171#define S5P_FIMV_SI_CH0_SB_ST_ADR 0x2044 /* start addr of stream buf */ 176#define S5P_FIMV_SI_CH0_SB_ST_ADR 0x2044 /* start addr of stream buf */
172#define S5P_FIMV_SI_CH0_SB_FRM_SIZE 0x2048 /* size of stream buf */ 177#define S5P_FIMV_SI_CH0_SB_FRM_SIZE 0x2048 /* size of stream buf */
173#define S5P_FIMV_SI_CH0_DESC_ADR 0x204c /* addr of descriptor buf */ 178#define S5P_FIMV_SI_CH0_DESC_ADR 0x204c /* addr of descriptor buf */
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c
index c25ec022d267..4dd32fc8fd82 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_dec.c
@@ -627,13 +627,13 @@ static int s5p_mfc_dec_s_ctrl(struct v4l2_ctrl *ctrl)
627 627
628 switch (ctrl->id) { 628 switch (ctrl->id) {
629 case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY: 629 case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY:
630 ctx->loop_filter_mpeg4 = ctrl->val; 630 ctx->display_delay = ctrl->val;
631 break; 631 break;
632 case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE: 632 case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE:
633 ctx->display_delay_enable = ctrl->val; 633 ctx->display_delay_enable = ctrl->val;
634 break; 634 break;
635 case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: 635 case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER:
636 ctx->display_delay = ctrl->val; 636 ctx->loop_filter_mpeg4 = ctrl->val;
637 break; 637 break;
638 case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: 638 case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE:
639 ctx->slice_interface = ctrl->val; 639 ctx->slice_interface = ctrl->val;
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c
index acedb2004be3..03d83340e7fb 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c
@@ -243,12 +243,6 @@ static struct mfc_control controls[] = {
243 .minimum = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, 243 .minimum = V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
244 .maximum = V4L2_MPEG_VIDEO_H264_LEVEL_4_0, 244 .maximum = V4L2_MPEG_VIDEO_H264_LEVEL_4_0,
245 .default_value = V4L2_MPEG_VIDEO_H264_LEVEL_1_0, 245 .default_value = V4L2_MPEG_VIDEO_H264_LEVEL_1_0,
246 .menu_skip_mask = ~(
247 (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_1) |
248 (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_2) |
249 (1 << V4L2_MPEG_VIDEO_H264_LEVEL_5_0) |
250 (1 << V4L2_MPEG_VIDEO_H264_LEVEL_5_1)
251 ),
252 }, 246 },
253 { 247 {
254 .id = V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL, 248 .id = V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL,
@@ -494,7 +488,7 @@ static struct mfc_control controls[] = {
494 .type = V4L2_CTRL_TYPE_MENU, 488 .type = V4L2_CTRL_TYPE_MENU,
495 .minimum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED, 489 .minimum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED,
496 .maximum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED, 490 .maximum = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED,
497 .default_value = 0, 491 .default_value = V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED,
498 .menu_skip_mask = 0, 492 .menu_skip_mask = 0,
499 }, 493 },
500 { 494 {
@@ -534,7 +528,7 @@ static struct mfc_control controls[] = {
534 .type = V4L2_CTRL_TYPE_MENU, 528 .type = V4L2_CTRL_TYPE_MENU,
535 .minimum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE, 529 .minimum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE,
536 .maximum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE, 530 .maximum = V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE,
537 .default_value = 0, 531 .default_value = V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE,
538 .menu_skip_mask = 0, 532 .menu_skip_mask = 0,
539 }, 533 },
540 { 534 {
@@ -907,6 +901,8 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
907 mfc_err("failed to try output format\n"); 901 mfc_err("failed to try output format\n");
908 return -EINVAL; 902 return -EINVAL;
909 } 903 }
904 v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1,
905 &pix_fmt_mp->height, 4, 1080, 1, 0);
910 } else { 906 } else {
911 mfc_err("invalid buf type\n"); 907 mfc_err("invalid buf type\n");
912 return -EINVAL; 908 return -EINVAL;
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_opr.h b/drivers/media/video/s5p-mfc/s5p_mfc_opr.h
index db83836e6a9f..5932d1c782c5 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_opr.h
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_opr.h
@@ -57,10 +57,12 @@ void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq);
57 S5P_FIMV_SI_DISPLAY_Y_ADR) << \ 57 S5P_FIMV_SI_DISPLAY_Y_ADR) << \
58 MFC_OFFSET_SHIFT) 58 MFC_OFFSET_SHIFT)
59#define s5p_mfc_get_dec_y_adr() (readl(dev->regs_base + \ 59#define s5p_mfc_get_dec_y_adr() (readl(dev->regs_base + \
60 S5P_FIMV_SI_DISPLAY_Y_ADR) << \ 60 S5P_FIMV_SI_DECODE_Y_ADR) << \
61 MFC_OFFSET_SHIFT) 61 MFC_OFFSET_SHIFT)
62#define s5p_mfc_get_dspl_status() readl(dev->regs_base + \ 62#define s5p_mfc_get_dspl_status() readl(dev->regs_base + \
63 S5P_FIMV_SI_DISPLAY_STATUS) 63 S5P_FIMV_SI_DISPLAY_STATUS)
64#define s5p_mfc_get_dec_status() readl(dev->regs_base + \
65 S5P_FIMV_SI_DECODE_STATUS)
64#define s5p_mfc_get_frame_type() (readl(dev->regs_base + \ 66#define s5p_mfc_get_frame_type() (readl(dev->regs_base + \
65 S5P_FIMV_DECODE_FRAME_TYPE) \ 67 S5P_FIMV_DECODE_FRAME_TYPE) \
66 & S5P_FIMV_DECODE_FRAME_MASK) 68 & S5P_FIMV_DECODE_FRAME_MASK)
diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_shm.h b/drivers/media/video/s5p-mfc/s5p_mfc_shm.h
index 764eac6bcc4c..cf962a466276 100644
--- a/drivers/media/video/s5p-mfc/s5p_mfc_shm.h
+++ b/drivers/media/video/s5p-mfc/s5p_mfc_shm.h
@@ -13,8 +13,7 @@
13#ifndef S5P_MFC_SHM_H_ 13#ifndef S5P_MFC_SHM_H_
14#define S5P_MFC_SHM_H_ 14#define S5P_MFC_SHM_H_
15 15
16enum MFC_SHM_OFS 16enum MFC_SHM_OFS {
17{
18 EXTENEDED_DECODE_STATUS = 0x00, /* D */ 17 EXTENEDED_DECODE_STATUS = 0x00, /* D */
19 SET_FRAME_TAG = 0x04, /* D */ 18 SET_FRAME_TAG = 0x04, /* D */
20 GET_FRAME_TAG_TOP = 0x08, /* D */ 19 GET_FRAME_TAG_TOP = 0x08, /* D */
diff --git a/drivers/media/video/smiapp/Kconfig b/drivers/media/video/smiapp/Kconfig
index f7b35ff443bf..fb99ff18be07 100644
--- a/drivers/media/video/smiapp/Kconfig
+++ b/drivers/media/video/smiapp/Kconfig
@@ -1,6 +1,6 @@
1config VIDEO_SMIAPP 1config VIDEO_SMIAPP
2 tristate "SMIA++/SMIA sensor support" 2 tristate "SMIA++/SMIA sensor support"
3 depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API 3 depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAVE_CLK
4 select VIDEO_SMIAPP_PLL 4 select VIDEO_SMIAPP_PLL
5 ---help--- 5 ---help---
6 This is a generic driver for SMIA++/SMIA camera modules. 6 This is a generic driver for SMIA++/SMIA camera modules.
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c
index f518026cb67b..e8c93c89265a 100644
--- a/drivers/media/video/smiapp/smiapp-core.c
+++ b/drivers/media/video/smiapp/smiapp-core.c
@@ -32,6 +32,7 @@
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/regulator/consumer.h> 34#include <linux/regulator/consumer.h>
35#include <linux/slab.h>
35#include <linux/v4l2-mediabus.h> 36#include <linux/v4l2-mediabus.h>
36#include <media/v4l2-device.h> 37#include <media/v4l2-device.h>
37 38
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 3e050e12153b..1ad5ab6ce5cf 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1178,7 +1178,7 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1178 return 0; 1178 return 0;
1179 if (vt->type == t->mode && analog_ops->get_afc) 1179 if (vt->type == t->mode && analog_ops->get_afc)
1180 vt->afc = analog_ops->get_afc(&t->fe); 1180 vt->afc = analog_ops->get_afc(&t->fe);
1181 if (t->mode != V4L2_TUNER_RADIO) { 1181 if (vt->type != V4L2_TUNER_RADIO) {
1182 vt->capability |= V4L2_TUNER_CAP_NORM; 1182 vt->capability |= V4L2_TUNER_CAP_NORM;
1183 vt->rangelow = tv_range[0] * 16; 1183 vt->rangelow = tv_range[0] * 16;
1184 vt->rangehigh = tv_range[1] * 16; 1184 vt->rangehigh = tv_range[1] * 16;
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 5ccbd4629f9c..83dbb2ddff10 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -656,7 +656,7 @@ static void determine_valid_ioctls(struct video_device *vdev)
656 SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd); 656 SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd);
657 SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd); 657 SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd);
658 SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd); 658 SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd);
659 if (ops->vidioc_g_parm || vdev->current_norm) 659 if (ops->vidioc_g_parm || vdev->vfl_type == VFL_TYPE_GRABBER)
660 set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls); 660 set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls);
661 SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm); 661 SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm);
662 SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner); 662 SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner);
@@ -679,6 +679,8 @@ static void determine_valid_ioctls(struct video_device *vdev)
679 SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_PRESET, vidioc_query_dv_preset); 679 SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_PRESET, vidioc_query_dv_preset);
680 SET_VALID_IOCTL(ops, VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings); 680 SET_VALID_IOCTL(ops, VIDIOC_S_DV_TIMINGS, vidioc_s_dv_timings);
681 SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings); 681 SET_VALID_IOCTL(ops, VIDIOC_G_DV_TIMINGS, vidioc_g_dv_timings);
682 SET_VALID_IOCTL(ops, VIDIOC_ENUM_DV_TIMINGS, vidioc_enum_dv_timings);
683 SET_VALID_IOCTL(ops, VIDIOC_QUERY_DV_TIMINGS, vidioc_query_dv_timings);
682 /* yes, really vidioc_subscribe_event */ 684 /* yes, really vidioc_subscribe_event */
683 SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event); 685 SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event);
684 SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event); 686 SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event);
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 91be4e871f43..d7fa8962d8b3 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1680,6 +1680,7 @@ static long __video_do_ioctl(struct file *file,
1680 break; 1680 break;
1681 1681
1682 ret = 0; 1682 ret = 0;
1683 p->parm.capture.readbuffers = 2;
1683 if (ops->vidioc_g_std) 1684 if (ops->vidioc_g_std)
1684 ret = ops->vidioc_g_std(file, fh, &std); 1685 ret = ops->vidioc_g_std(file, fh, &std);
1685 if (ret == 0) 1686 if (ret == 0)
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index 4d7391ec8001..aae1720b2f2d 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -2561,7 +2561,7 @@ static int vino_acquire_input(struct vino_channel_settings *vcs)
2561 } else if (vino_drvdata->decoder 2561 } else if (vino_drvdata->decoder
2562 && (vino_drvdata->decoder_owner == VINO_NO_CHANNEL)) { 2562 && (vino_drvdata->decoder_owner == VINO_NO_CHANNEL)) {
2563 int input; 2563 int input;
2564 int data_norm; 2564 int data_norm = 0;
2565 v4l2_std_id norm; 2565 v4l2_std_id norm;
2566 2566
2567 input = VINO_INPUT_COMPOSITE; 2567 input = VINO_INPUT_COMPOSITE;
@@ -2651,7 +2651,7 @@ static int vino_set_input(struct vino_channel_settings *vcs, int input)
2651 } 2651 }
2652 2652
2653 if (vino_drvdata->decoder_owner == vcs->channel) { 2653 if (vino_drvdata->decoder_owner == vcs->channel) {
2654 int data_norm; 2654 int data_norm = 0;
2655 v4l2_std_id norm; 2655 v4l2_std_id norm;
2656 2656
2657 ret = decoder_call(video, s_routing, 2657 ret = decoder_call(video, s_routing,
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 0960d7f0d394..08c10240e70f 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1149,10 +1149,14 @@ static ssize_t
1149vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) 1149vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
1150{ 1150{
1151 struct vivi_dev *dev = video_drvdata(file); 1151 struct vivi_dev *dev = video_drvdata(file);
1152 int err;
1152 1153
1153 dprintk(dev, 1, "read called\n"); 1154 dprintk(dev, 1, "read called\n");
1154 return vb2_read(&dev->vb_vidq, data, count, ppos, 1155 mutex_lock(&dev->mutex);
1156 err = vb2_read(&dev->vb_vidq, data, count, ppos,
1155 file->f_flags & O_NONBLOCK); 1157 file->f_flags & O_NONBLOCK);
1158 mutex_unlock(&dev->mutex);
1159 return err;
1156} 1160}
1157 1161
1158static unsigned int 1162static unsigned int
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index dd2d374dcc7a..276d21ce6bc1 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -554,7 +554,6 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
554 struct mmc_request mrq = {NULL}; 554 struct mmc_request mrq = {NULL};
555 struct mmc_command cmd = {0}; 555 struct mmc_command cmd = {0};
556 struct mmc_data data = {0}; 556 struct mmc_data data = {0};
557 unsigned int timeout_us;
558 557
559 struct scatterlist sg; 558 struct scatterlist sg;
560 559
@@ -574,23 +573,12 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
574 cmd.arg = 0; 573 cmd.arg = 0;
575 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC; 574 cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
576 575
577 data.timeout_ns = card->csd.tacc_ns * 100;
578 data.timeout_clks = card->csd.tacc_clks * 100;
579
580 timeout_us = data.timeout_ns / 1000;
581 timeout_us += data.timeout_clks * 1000 /
582 (card->host->ios.clock / 1000);
583
584 if (timeout_us > 100000) {
585 data.timeout_ns = 100000000;
586 data.timeout_clks = 0;
587 }
588
589 data.blksz = 4; 576 data.blksz = 4;
590 data.blocks = 1; 577 data.blocks = 1;
591 data.flags = MMC_DATA_READ; 578 data.flags = MMC_DATA_READ;
592 data.sg = &sg; 579 data.sg = &sg;
593 data.sg_len = 1; 580 data.sg_len = 1;
581 mmc_set_data_timeout(&data, card);
594 582
595 mrq.cmd = &cmd; 583 mrq.cmd = &cmd;
596 mrq.data = &data; 584 mrq.data = &data;
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9a7a60aeb19e..389a3eedfc24 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -85,7 +85,6 @@
85#define BRR_ENABLE (1 << 5) 85#define BRR_ENABLE (1 << 5)
86#define DTO_ENABLE (1 << 20) 86#define DTO_ENABLE (1 << 20)
87#define INIT_STREAM (1 << 1) 87#define INIT_STREAM (1 << 1)
88#define ACEN_ACMD12 (1 << 2)
89#define DP_SELECT (1 << 21) 88#define DP_SELECT (1 << 21)
90#define DDIR (1 << 4) 89#define DDIR (1 << 4)
91#define DMA_EN 0x1 90#define DMA_EN 0x1
@@ -117,7 +116,6 @@
117#define OMAP_MMC_MAX_CLOCK 52000000 116#define OMAP_MMC_MAX_CLOCK 52000000
118#define DRIVER_NAME "omap_hsmmc" 117#define DRIVER_NAME "omap_hsmmc"
119 118
120#define AUTO_CMD12 (1 << 0) /* Auto CMD12 support */
121/* 119/*
122 * One controller can have multiple slots, like on some omap boards using 120 * One controller can have multiple slots, like on some omap boards using
123 * omap.c controller driver. Luckily this is not currently done on any known 121 * omap.c controller driver. Luckily this is not currently done on any known
@@ -177,7 +175,6 @@ struct omap_hsmmc_host {
177 int reqs_blocked; 175 int reqs_blocked;
178 int use_reg; 176 int use_reg;
179 int req_in_progress; 177 int req_in_progress;
180 unsigned int flags;
181 struct omap_hsmmc_next next_data; 178 struct omap_hsmmc_next next_data;
182 179
183 struct omap_mmc_platform_data *pdata; 180 struct omap_mmc_platform_data *pdata;
@@ -773,8 +770,6 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
773 cmdtype = 0x3; 770 cmdtype = 0x3;
774 771
775 cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22); 772 cmdreg = (cmd->opcode << 24) | (resptype << 16) | (cmdtype << 22);
776 if ((host->flags & AUTO_CMD12) && mmc_op_multi(cmd->opcode))
777 cmdreg |= ACEN_ACMD12;
778 773
779 if (data) { 774 if (data) {
780 cmdreg |= DP_SELECT | MSBS | BCE; 775 cmdreg |= DP_SELECT | MSBS | BCE;
@@ -847,14 +842,11 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data)
847 else 842 else
848 data->bytes_xfered = 0; 843 data->bytes_xfered = 0;
849 844
850 if (data->stop && ((!(host->flags & AUTO_CMD12)) || data->error)) { 845 if (!data->stop) {
851 omap_hsmmc_start_command(host, data->stop, NULL);
852 } else {
853 if (data->stop)
854 data->stop->resp[0] = OMAP_HSMMC_READ(host->base,
855 RSP76);
856 omap_hsmmc_request_done(host, data->mrq); 846 omap_hsmmc_request_done(host, data->mrq);
847 return;
857 } 848 }
849 omap_hsmmc_start_command(host, data->stop, NULL);
858} 850}
859 851
860/* 852/*
@@ -1859,7 +1851,6 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
1859 host->mapbase = res->start + pdata->reg_offset; 1851 host->mapbase = res->start + pdata->reg_offset;
1860 host->base = ioremap(host->mapbase, SZ_4K); 1852 host->base = ioremap(host->mapbase, SZ_4K);
1861 host->power_mode = MMC_POWER_OFF; 1853 host->power_mode = MMC_POWER_OFF;
1862 host->flags = AUTO_CMD12;
1863 host->next_data.cookie = 1; 1854 host->next_data.cookie = 1;
1864 1855
1865 platform_set_drvdata(pdev, host); 1856 platform_set_drvdata(pdev, host);
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index 09d4f8d9d592..7c1380305219 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -264,7 +264,7 @@ static struct dentry *dfs_rootdir;
264 */ 264 */
265int ubi_debugfs_init(void) 265int ubi_debugfs_init(void)
266{ 266{
267 if (!IS_ENABLED(DEBUG_FS)) 267 if (!IS_ENABLED(CONFIG_DEBUG_FS))
268 return 0; 268 return 0;
269 269
270 dfs_rootdir = debugfs_create_dir("ubi", NULL); 270 dfs_rootdir = debugfs_create_dir("ubi", NULL);
@@ -284,7 +284,7 @@ int ubi_debugfs_init(void)
284 */ 284 */
285void ubi_debugfs_exit(void) 285void ubi_debugfs_exit(void)
286{ 286{
287 if (IS_ENABLED(DEBUG_FS)) 287 if (IS_ENABLED(CONFIG_DEBUG_FS))
288 debugfs_remove(dfs_rootdir); 288 debugfs_remove(dfs_rootdir);
289} 289}
290 290
@@ -407,7 +407,7 @@ int ubi_debugfs_init_dev(struct ubi_device *ubi)
407 struct dentry *dent; 407 struct dentry *dent;
408 struct ubi_debug_info *d = ubi->dbg; 408 struct ubi_debug_info *d = ubi->dbg;
409 409
410 if (!IS_ENABLED(DEBUG_FS)) 410 if (!IS_ENABLED(CONFIG_DEBUG_FS))
411 return 0; 411 return 0;
412 412
413 n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME, 413 n = snprintf(d->dfs_dir_name, UBI_DFS_DIR_LEN + 1, UBI_DFS_DIR_NAME,
@@ -477,6 +477,6 @@ out:
477 */ 477 */
478void ubi_debugfs_exit_dev(struct ubi_device *ubi) 478void ubi_debugfs_exit_dev(struct ubi_device *ubi)
479{ 479{
480 if (IS_ENABLED(DEBUG_FS)) 480 if (IS_ENABLED(CONFIG_DEBUG_FS))
481 debugfs_remove_recursive(ubi->dbg->dfs_dir); 481 debugfs_remove_recursive(ubi->dbg->dfs_dir);
482} 482}
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index ad284baafe87..3cea38d37344 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -150,14 +150,25 @@ static void bond_info_show_master(struct seq_file *seq)
150 } 150 }
151} 151}
152 152
153static const char *bond_slave_link_status(s8 link)
154{
155 static const char * const status[] = {
156 [BOND_LINK_UP] = "up",
157 [BOND_LINK_FAIL] = "going down",
158 [BOND_LINK_DOWN] = "down",
159 [BOND_LINK_BACK] = "going back",
160 };
161
162 return status[link];
163}
164
153static void bond_info_show_slave(struct seq_file *seq, 165static void bond_info_show_slave(struct seq_file *seq,
154 const struct slave *slave) 166 const struct slave *slave)
155{ 167{
156 struct bonding *bond = seq->private; 168 struct bonding *bond = seq->private;
157 169
158 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); 170 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
159 seq_printf(seq, "MII Status: %s\n", 171 seq_printf(seq, "MII Status: %s\n", bond_slave_link_status(slave->link));
160 (slave->link == BOND_LINK_UP) ? "up" : "down");
161 if (slave->speed == SPEED_UNKNOWN) 172 if (slave->speed == SPEED_UNKNOWN)
162 seq_printf(seq, "Speed: %s\n", "Unknown"); 173 seq_printf(seq, "Speed: %s\n", "Unknown");
163 else 174 else
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 1520814c77c7..4a27adb7ae67 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -693,8 +693,6 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
693 */ 693 */
694 memcpy(rx_buf, (u8 *)piggy_desc, 694 memcpy(rx_buf, (u8 *)piggy_desc,
695 CFHSI_DESC_SHORT_SZ); 695 CFHSI_DESC_SHORT_SZ);
696 /* Mark no embedded frame here */
697 piggy_desc->offset = 0;
698 if (desc_pld_len == -EPROTO) 696 if (desc_pld_len == -EPROTO)
699 goto out_of_sync; 697 goto out_of_sync;
700 } 698 }
@@ -737,6 +735,8 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
737 /* Extract any payload in piggyback descriptor. */ 735 /* Extract any payload in piggyback descriptor. */
738 if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0) 736 if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0)
739 goto out_of_sync; 737 goto out_of_sync;
738 /* Mark no embedded frame after extracting it */
739 piggy_desc->offset = 0;
740 } 740 }
741 } 741 }
742 742
@@ -1178,6 +1178,7 @@ int cfhsi_probe(struct platform_device *pdev)
1178 dev_err(&ndev->dev, "%s: Registration error: %d.\n", 1178 dev_err(&ndev->dev, "%s: Registration error: %d.\n",
1179 __func__, res); 1179 __func__, res);
1180 free_netdev(ndev); 1180 free_netdev(ndev);
1181 return -ENODEV;
1181 } 1182 }
1182 /* Add CAIF HSI device to list. */ 1183 /* Add CAIF HSI device to list. */
1183 spin_lock(&cfhsi_list_lock); 1184 spin_lock(&cfhsi_list_lock);
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 8dc84d66eea1..86cd532c78f9 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -590,8 +590,8 @@ static void c_can_chip_config(struct net_device *dev)
590 priv->write_reg(priv, &priv->regs->control, 590 priv->write_reg(priv, &priv->regs->control,
591 CONTROL_ENABLE_AR); 591 CONTROL_ENABLE_AR);
592 592
593 if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY & 593 if ((priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) &&
594 CAN_CTRLMODE_LOOPBACK)) { 594 (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)) {
595 /* loopback + silent mode : useful for hot self-test */ 595 /* loopback + silent mode : useful for hot self-test */
596 priv->write_reg(priv, &priv->regs->control, CONTROL_EIE | 596 priv->write_reg(priv, &priv->regs->control, CONTROL_EIE |
597 CONTROL_SIE | CONTROL_IE | CONTROL_TEST); 597 CONTROL_SIE | CONTROL_IE | CONTROL_TEST);
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 38c0690df5c8..81d474102378 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -939,12 +939,12 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
939 return PTR_ERR(pinctrl); 939 return PTR_ERR(pinctrl);
940 940
941 if (pdev->dev.of_node) { 941 if (pdev->dev.of_node) {
942 const u32 *clock_freq_p; 942 const __be32 *clock_freq_p;
943 943
944 clock_freq_p = of_get_property(pdev->dev.of_node, 944 clock_freq_p = of_get_property(pdev->dev.of_node,
945 "clock-frequency", NULL); 945 "clock-frequency", NULL);
946 if (clock_freq_p) 946 if (clock_freq_p)
947 clock_freq = *clock_freq_p; 947 clock_freq = be32_to_cpup(clock_freq_p);
948 } 948 }
949 949
950 if (!clock_freq) { 950 if (!clock_freq) {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index cbc56f274e0c..8098eea9704d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -190,7 +190,7 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
190 190
191 if ((netif_tx_queue_stopped(txq)) && 191 if ((netif_tx_queue_stopped(txq)) &&
192 (bp->state == BNX2X_STATE_OPEN) && 192 (bp->state == BNX2X_STATE_OPEN) &&
193 (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3)) 193 (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4))
194 netif_tx_wake_queue(txq); 194 netif_tx_wake_queue(txq);
195 195
196 __netif_tx_unlock(txq); 196 __netif_tx_unlock(txq);
@@ -2516,8 +2516,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget)
2516/* we split the first BD into headers and data BDs 2516/* we split the first BD into headers and data BDs
2517 * to ease the pain of our fellow microcode engineers 2517 * to ease the pain of our fellow microcode engineers
2518 * we use one mapping for both BDs 2518 * we use one mapping for both BDs
2519 * So far this has only been observed to happen
2520 * in Other Operating Systems(TM)
2521 */ 2519 */
2522static noinline u16 bnx2x_tx_split(struct bnx2x *bp, 2520static noinline u16 bnx2x_tx_split(struct bnx2x *bp,
2523 struct bnx2x_fp_txdata *txdata, 2521 struct bnx2x_fp_txdata *txdata,
@@ -3171,7 +3169,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3171 3169
3172 txdata->tx_bd_prod += nbd; 3170 txdata->tx_bd_prod += nbd;
3173 3171
3174 if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 3)) { 3172 if (unlikely(bnx2x_tx_avail(bp, txdata) < MAX_SKB_FRAGS + 4)) {
3175 netif_tx_stop_queue(txq); 3173 netif_tx_stop_queue(txq);
3176 3174
3177 /* paired memory barrier is in bnx2x_tx_int(), we have to keep 3175 /* paired memory barrier is in bnx2x_tx_int(), we have to keep
@@ -3180,7 +3178,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
3180 smp_mb(); 3178 smp_mb();
3181 3179
3182 fp->eth_q_stats.driver_xoff++; 3180 fp->eth_q_stats.driver_xoff++;
3183 if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 3) 3181 if (bnx2x_tx_avail(bp, txdata) >= MAX_SKB_FRAGS + 4)
3184 netif_tx_wake_queue(txq); 3182 netif_tx_wake_queue(txq);
3185 } 3183 }
3186 txdata->tx_pkt++; 3184 txdata->tx_pkt++;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index a3fb7215cd89..6e7d5c0843b4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -40,6 +40,7 @@
40#define I2C_BSC0 0 40#define I2C_BSC0 0
41#define I2C_BSC1 1 41#define I2C_BSC1 1
42#define I2C_WA_RETRY_CNT 3 42#define I2C_WA_RETRY_CNT 3
43#define I2C_WA_PWR_ITER (I2C_WA_RETRY_CNT - 1)
43#define MCPR_IMC_COMMAND_READ_OP 1 44#define MCPR_IMC_COMMAND_READ_OP 1
44#define MCPR_IMC_COMMAND_WRITE_OP 2 45#define MCPR_IMC_COMMAND_WRITE_OP 2
45 46
@@ -7659,6 +7660,28 @@ static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7659 return -EINVAL; 7660 return -EINVAL;
7660} 7661}
7661 7662
7663static void bnx2x_warpcore_power_module(struct link_params *params,
7664 struct bnx2x_phy *phy,
7665 u8 power)
7666{
7667 u32 pin_cfg;
7668 struct bnx2x *bp = params->bp;
7669
7670 pin_cfg = (REG_RD(bp, params->shmem_base +
7671 offsetof(struct shmem_region,
7672 dev_info.port_hw_config[params->port].e3_sfp_ctrl)) &
7673 PORT_HW_CFG_E3_PWR_DIS_MASK) >>
7674 PORT_HW_CFG_E3_PWR_DIS_SHIFT;
7675
7676 if (pin_cfg == PIN_CFG_NA)
7677 return;
7678 DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n",
7679 power, pin_cfg);
7680 /* Low ==> corresponding SFP+ module is powered
7681 * high ==> the SFP+ module is powered down
7682 */
7683 bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1);
7684}
7662static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, 7685static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7663 struct link_params *params, 7686 struct link_params *params,
7664 u16 addr, u8 byte_cnt, 7687 u16 addr, u8 byte_cnt,
@@ -7678,6 +7701,12 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7678 /* 4 byte aligned address */ 7701 /* 4 byte aligned address */
7679 addr32 = addr & (~0x3); 7702 addr32 = addr & (~0x3);
7680 do { 7703 do {
7704 if (cnt == I2C_WA_PWR_ITER) {
7705 bnx2x_warpcore_power_module(params, phy, 0);
7706 /* Note that 100us are not enough here */
7707 usleep_range(1000,1000);
7708 bnx2x_warpcore_power_module(params, phy, 1);
7709 }
7681 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt, 7710 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
7682 data_array); 7711 data_array);
7683 } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT)); 7712 } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT));
@@ -8200,29 +8229,6 @@ static void bnx2x_set_sfp_module_fault_led(struct link_params *params,
8200 bnx2x_set_e1e2_module_fault_led(params, gpio_mode); 8229 bnx2x_set_e1e2_module_fault_led(params, gpio_mode);
8201} 8230}
8202 8231
8203static void bnx2x_warpcore_power_module(struct link_params *params,
8204 struct bnx2x_phy *phy,
8205 u8 power)
8206{
8207 u32 pin_cfg;
8208 struct bnx2x *bp = params->bp;
8209
8210 pin_cfg = (REG_RD(bp, params->shmem_base +
8211 offsetof(struct shmem_region,
8212 dev_info.port_hw_config[params->port].e3_sfp_ctrl)) &
8213 PORT_HW_CFG_E3_PWR_DIS_MASK) >>
8214 PORT_HW_CFG_E3_PWR_DIS_SHIFT;
8215
8216 if (pin_cfg == PIN_CFG_NA)
8217 return;
8218 DP(NETIF_MSG_LINK, "Setting SFP+ module power to %d using pin cfg %d\n",
8219 power, pin_cfg);
8220 /* Low ==> corresponding SFP+ module is powered
8221 * high ==> the SFP+ module is powered down
8222 */
8223 bnx2x_set_cfg_pin(bp, pin_cfg, power ^ 1);
8224}
8225
8226static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy, 8232static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy,
8227 struct link_params *params) 8233 struct link_params *params)
8228{ 8234{
@@ -9748,7 +9754,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy,
9748 9754
9749 msleep(1); 9755 msleep(1);
9750 9756
9751 if (!(CHIP_IS_E1(bp))) 9757 if (!(CHIP_IS_E1x(bp)))
9752 port = BP_PATH(bp); 9758 port = BP_PATH(bp);
9753 else 9759 else
9754 port = params->port; 9760 port = params->port;
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 8d06ea381741..921c2082af4c 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -122,15 +122,15 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
122 goto done; 122 goto done;
123 123
124 if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) { 124 if (compl_status == MCC_STATUS_UNAUTHORIZED_REQUEST) {
125 dev_warn(&adapter->pdev->dev, "This domain(VM) is not " 125 dev_warn(&adapter->pdev->dev,
126 "permitted to execute this cmd (opcode %d)\n", 126 "opcode %d-%d is not permitted\n",
127 opcode); 127 opcode, subsystem);
128 } else { 128 } else {
129 extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) & 129 extd_status = (compl->status >> CQE_STATUS_EXTD_SHIFT) &
130 CQE_STATUS_EXTD_MASK; 130 CQE_STATUS_EXTD_MASK;
131 dev_err(&adapter->pdev->dev, "Cmd (opcode %d) failed:" 131 dev_err(&adapter->pdev->dev,
132 "status %d, extd-status %d\n", 132 "opcode %d-%d failed:status %d-%d\n",
133 opcode, compl_status, extd_status); 133 opcode, subsystem, compl_status, extd_status);
134 } 134 }
135 } 135 }
136done: 136done:
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 9625bf420c16..b3f3fc3d1323 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1566,7 +1566,7 @@ struct be_hw_stats_v1 {
1566 u32 rsvd0[BE_TXP_SW_SZ]; 1566 u32 rsvd0[BE_TXP_SW_SZ];
1567 struct be_erx_stats_v1 erx; 1567 struct be_erx_stats_v1 erx;
1568 struct be_pmem_stats pmem; 1568 struct be_pmem_stats pmem;
1569 u32 rsvd1[3]; 1569 u32 rsvd1[18];
1570}; 1570};
1571 1571
1572struct be_cmd_req_get_stats_v1 { 1572struct be_cmd_req_get_stats_v1 {
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index fdb50cec6b51..501dfa9c88ec 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3237,7 +3237,7 @@ static void be_netdev_init(struct net_device *netdev)
3237 3237
3238 netdev->flags |= IFF_MULTICAST; 3238 netdev->flags |= IFF_MULTICAST;
3239 3239
3240 netif_set_gso_max_size(netdev, 65535); 3240 netif_set_gso_max_size(netdev, 65535 - ETH_HLEN);
3241 3241
3242 netdev->netdev_ops = &be_netdev_ops; 3242 netdev->netdev_ops = &be_netdev_ops;
3243 3243
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index 79b07ec6726f..0cafe4fe9406 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -122,8 +122,10 @@ config IGB_DCA
122 122
123config IGB_PTP 123config IGB_PTP
124 bool "PTP Hardware Clock (PHC)" 124 bool "PTP Hardware Clock (PHC)"
125 default y 125 default n
126 depends on IGB && PTP_1588_CLOCK 126 depends on IGB && EXPERIMENTAL
127 select PPS
128 select PTP_1588_CLOCK
127 ---help--- 129 ---help---
128 Say Y here if you want to use PTP Hardware Clock (PHC) in the 130 Say Y here if you want to use PTP Hardware Clock (PHC) in the
129 driver. Only the basic clock operations have been implemented. 131 driver. Only the basic clock operations have been implemented.
@@ -223,7 +225,9 @@ config IXGBE_DCB
223config IXGBE_PTP 225config IXGBE_PTP
224 bool "PTP Clock Support" 226 bool "PTP Clock Support"
225 default n 227 default n
226 depends on IXGBE && PTP_1588_CLOCK 228 depends on IXGBE && EXPERIMENTAL
229 select PPS
230 select PTP_1588_CLOCK
227 ---help--- 231 ---help---
228 Say Y here if you want support for 1588 Timestamping with a 232 Say Y here if you want support for 1588 Timestamping with a
229 PHC device, using the PTP 1588 Clock support. This is 233 PHC device, using the PTP 1588 Clock support. This is
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index e65083958421..5e84eaac48c1 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -206,8 +206,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
206 mac->rar_entry_count = E1000_RAR_ENTRIES_82580; 206 mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
207 break; 207 break;
208 case e1000_i350: 208 case e1000_i350:
209 case e1000_i210:
210 case e1000_i211:
211 mac->rar_entry_count = E1000_RAR_ENTRIES_I350; 209 mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
212 break; 210 break;
213 default: 211 default:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 3ef3c5284e52..7af291e236bf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -196,7 +196,7 @@ enum ixgbe_ring_state_t {
196 __IXGBE_HANG_CHECK_ARMED, 196 __IXGBE_HANG_CHECK_ARMED,
197 __IXGBE_RX_RSC_ENABLED, 197 __IXGBE_RX_RSC_ENABLED,
198 __IXGBE_RX_CSUM_UDP_ZERO_ERR, 198 __IXGBE_RX_CSUM_UDP_ZERO_ERR,
199 __IXGBE_RX_FCOE_BUFSZ, 199 __IXGBE_RX_FCOE,
200}; 200};
201 201
202#define check_for_tx_hang(ring) \ 202#define check_for_tx_hang(ring) \
@@ -290,7 +290,7 @@ struct ixgbe_ring_feature {
290#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192) 290#if defined(IXGBE_FCOE) && (PAGE_SIZE < 8192)
291static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring) 291static inline unsigned int ixgbe_rx_pg_order(struct ixgbe_ring *ring)
292{ 292{
293 return test_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state) ? 1 : 0; 293 return test_bit(__IXGBE_RX_FCOE, &ring->state) ? 1 : 0;
294} 294}
295#else 295#else
296#define ixgbe_rx_pg_order(_ring) 0 296#define ixgbe_rx_pg_order(_ring) 0
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index af1a5314b494..c377706e81a8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -634,7 +634,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter,
634 f = &adapter->ring_feature[RING_F_FCOE]; 634 f = &adapter->ring_feature[RING_F_FCOE];
635 if ((rxr_idx >= f->mask) && 635 if ((rxr_idx >= f->mask) &&
636 (rxr_idx < f->mask + f->indices)) 636 (rxr_idx < f->mask + f->indices))
637 set_bit(__IXGBE_RX_FCOE_BUFSZ, &ring->state); 637 set_bit(__IXGBE_RX_FCOE, &ring->state);
638 } 638 }
639 639
640#endif /* IXGBE_FCOE */ 640#endif /* IXGBE_FCOE */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 17ad6a3c1be1..18ca3bcadf0c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1058,17 +1058,17 @@ static inline void ixgbe_rx_hash(struct ixgbe_ring *ring,
1058#ifdef IXGBE_FCOE 1058#ifdef IXGBE_FCOE
1059/** 1059/**
1060 * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type 1060 * ixgbe_rx_is_fcoe - check the rx desc for incoming pkt type
1061 * @adapter: address of board private structure 1061 * @ring: structure containing ring specific data
1062 * @rx_desc: advanced rx descriptor 1062 * @rx_desc: advanced rx descriptor
1063 * 1063 *
1064 * Returns : true if it is FCoE pkt 1064 * Returns : true if it is FCoE pkt
1065 */ 1065 */
1066static inline bool ixgbe_rx_is_fcoe(struct ixgbe_adapter *adapter, 1066static inline bool ixgbe_rx_is_fcoe(struct ixgbe_ring *ring,
1067 union ixgbe_adv_rx_desc *rx_desc) 1067 union ixgbe_adv_rx_desc *rx_desc)
1068{ 1068{
1069 __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; 1069 __le16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
1070 1070
1071 return (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 1071 return test_bit(__IXGBE_RX_FCOE, &ring->state) &&
1072 ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) == 1072 ((pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_ETQF_MASK)) ==
1073 (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE << 1073 (cpu_to_le16(IXGBE_ETQF_FILTER_FCOE <<
1074 IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT))); 1074 IXGBE_RXDADV_PKTTYPE_ETQF_SHIFT)));
@@ -1148,7 +1148,7 @@ static bool ixgbe_alloc_mapped_page(struct ixgbe_ring *rx_ring,
1148 1148
1149 /* alloc new page for storage */ 1149 /* alloc new page for storage */
1150 if (likely(!page)) { 1150 if (likely(!page)) {
1151 page = alloc_pages(GFP_ATOMIC | __GFP_COLD, 1151 page = alloc_pages(GFP_ATOMIC | __GFP_COLD | __GFP_COMP,
1152 ixgbe_rx_pg_order(rx_ring)); 1152 ixgbe_rx_pg_order(rx_ring));
1153 if (unlikely(!page)) { 1153 if (unlikely(!page)) {
1154 rx_ring->rx_stats.alloc_rx_page_failed++; 1154 rx_ring->rx_stats.alloc_rx_page_failed++;
@@ -1549,6 +1549,12 @@ static bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1549 skb->truesize -= ixgbe_rx_bufsz(rx_ring); 1549 skb->truesize -= ixgbe_rx_bufsz(rx_ring);
1550 } 1550 }
1551 1551
1552#ifdef IXGBE_FCOE
1553 /* do not attempt to pad FCoE Frames as this will disrupt DDP */
1554 if (ixgbe_rx_is_fcoe(rx_ring, rx_desc))
1555 return false;
1556
1557#endif
1552 /* if skb_pad returns an error the skb was freed */ 1558 /* if skb_pad returns an error the skb was freed */
1553 if (unlikely(skb->len < 60)) { 1559 if (unlikely(skb->len < 60)) {
1554 int pad_len = 60 - skb->len; 1560 int pad_len = 60 - skb->len;
@@ -1775,7 +1781,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
1775 1781
1776#ifdef IXGBE_FCOE 1782#ifdef IXGBE_FCOE
1777 /* if ddp, not passing to ULD unless for FCP_RSP or error */ 1783 /* if ddp, not passing to ULD unless for FCP_RSP or error */
1778 if (ixgbe_rx_is_fcoe(adapter, rx_desc)) { 1784 if (ixgbe_rx_is_fcoe(rx_ring, rx_desc)) {
1779 ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb); 1785 ddp_bytes = ixgbe_fcoe_ddp(adapter, rx_desc, skb);
1780 if (!ddp_bytes) { 1786 if (!ddp_bytes) {
1781 dev_kfree_skb_any(skb); 1787 dev_kfree_skb_any(skb);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index ddc6a4d19302..dcebd128becf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -708,6 +708,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
708{ 708{
709 struct ixgbe_hw *hw = &adapter->hw; 709 struct ixgbe_hw *hw = &adapter->hw;
710 u32 incval = 0; 710 u32 incval = 0;
711 u32 timinca = 0;
711 u32 shift = 0; 712 u32 shift = 0;
712 u32 cycle_speed; 713 u32 cycle_speed;
713 unsigned long flags; 714 unsigned long flags;
@@ -730,8 +731,16 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
730 break; 731 break;
731 } 732 }
732 733
733 /* Bail if the cycle speed didn't change */ 734 /*
734 if (adapter->cycle_speed == cycle_speed) 735 * grab the current TIMINCA value from the register so that it can be
736 * double checked. If the register value has been cleared, it must be
737 * reset to the correct value for generating a cyclecounter. If
738 * TIMINCA is zero, the SYSTIME registers do not increment at all.
739 */
740 timinca = IXGBE_READ_REG(hw, IXGBE_TIMINCA);
741
742 /* Bail if the cycle speed didn't change and TIMINCA is non-zero */
743 if (adapter->cycle_speed == cycle_speed && timinca)
735 return; 744 return;
736 745
737 /* disable the SDP clock out */ 746 /* disable the SDP clock out */
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 926d8aac941c..073b85b45fc5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -929,15 +929,20 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv)
929 if (priv->rx_cq[i].buf) 929 if (priv->rx_cq[i].buf)
930 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); 930 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]);
931 } 931 }
932
933 if (priv->base_tx_qpn) {
934 mlx4_qp_release_range(priv->mdev->dev, priv->base_tx_qpn, priv->tx_ring_num);
935 priv->base_tx_qpn = 0;
936 }
932} 937}
933 938
934int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) 939int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
935{ 940{
936 struct mlx4_en_port_profile *prof = priv->prof; 941 struct mlx4_en_port_profile *prof = priv->prof;
937 int i; 942 int i;
938 int base_tx_qpn, err; 943 int err;
939 944
940 err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &base_tx_qpn); 945 err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &priv->base_tx_qpn);
941 if (err) { 946 if (err) {
942 en_err(priv, "failed reserving range for TX rings\n"); 947 en_err(priv, "failed reserving range for TX rings\n");
943 return err; 948 return err;
@@ -949,7 +954,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
949 prof->tx_ring_size, i, TX)) 954 prof->tx_ring_size, i, TX))
950 goto err; 955 goto err;
951 956
952 if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], base_tx_qpn + i, 957 if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], priv->base_tx_qpn + i,
953 prof->tx_ring_size, TXBB_SIZE)) 958 prof->tx_ring_size, TXBB_SIZE))
954 goto err; 959 goto err;
955 } 960 }
@@ -969,7 +974,6 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
969 974
970err: 975err:
971 en_err(priv, "Failed to allocate NIC resources\n"); 976 en_err(priv, "Failed to allocate NIC resources\n");
972 mlx4_qp_release_range(priv->mdev->dev, base_tx_qpn, priv->tx_ring_num);
973 return -ENOMEM; 977 return -ENOMEM;
974} 978}
975 979
@@ -1204,9 +1208,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
1204 en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num); 1208 en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num);
1205 1209
1206 /* Configure port */ 1210 /* Configure port */
1211 mlx4_en_calc_rx_buf(dev);
1207 err = mlx4_SET_PORT_general(mdev->dev, priv->port, 1212 err = mlx4_SET_PORT_general(mdev->dev, priv->port,
1208 MLX4_EN_MIN_MTU, 1213 priv->rx_skb_size + ETH_FCS_LEN,
1209 0, 0, 0, 0); 1214 prof->tx_pause, prof->tx_ppp,
1215 prof->rx_pause, prof->rx_ppp);
1210 if (err) { 1216 if (err) {
1211 en_err(priv, "Failed setting port general configurations " 1217 en_err(priv, "Failed setting port general configurations "
1212 "for port %d, with error %d\n", priv->port, err); 1218 "for port %d, with error %d\n", priv->port, err);
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index ee6f4fe00837..a0313de122de 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1975,6 +1975,8 @@ slave_start:
1975 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) && 1975 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X) &&
1976 !mlx4_is_mfunc(dev)) { 1976 !mlx4_is_mfunc(dev)) {
1977 dev->flags &= ~MLX4_FLAG_MSI_X; 1977 dev->flags &= ~MLX4_FLAG_MSI_X;
1978 dev->caps.num_comp_vectors = 1;
1979 dev->caps.comp_pool = 0;
1978 pci_disable_msix(pdev); 1980 pci_disable_msix(pdev);
1979 err = mlx4_setup_hca(dev); 1981 err = mlx4_setup_hca(dev);
1980 } 1982 }
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 6ae350921b1a..225c20d47900 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -495,6 +495,7 @@ struct mlx4_en_priv {
495 int vids[128]; 495 int vids[128];
496 bool wol; 496 bool wol;
497 struct device *ddev; 497 struct device *ddev;
498 int base_tx_qpn;
498 499
499#ifdef CONFIG_MLX4_EN_DCB 500#ifdef CONFIG_MLX4_EN_DCB
500 struct ieee_ets ets; 501 struct ieee_ets ets;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 46e77a2c5121..ad98f4d7919d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
479 479
480 for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { 480 for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
481 pfn = pci_info[i].id; 481 pfn = pci_info[i].id;
482 if (pfn > QLCNIC_MAX_PCI_FUNC) { 482 if (pfn >= QLCNIC_MAX_PCI_FUNC) {
483 ret = QL_STATUS_INVALID_PARAM; 483 ret = QL_STATUS_INVALID_PARAM;
484 goto err_eswitch; 484 goto err_eswitch;
485 } 485 }
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7260aa79466a..d7a04e091101 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3894,6 +3894,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
3894 case RTL_GIGA_MAC_VER_22: 3894 case RTL_GIGA_MAC_VER_22:
3895 case RTL_GIGA_MAC_VER_23: 3895 case RTL_GIGA_MAC_VER_23:
3896 case RTL_GIGA_MAC_VER_24: 3896 case RTL_GIGA_MAC_VER_24:
3897 case RTL_GIGA_MAC_VER_34:
3897 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST); 3898 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);
3898 break; 3899 break;
3899 default: 3900 default:
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 667169b82526..79bf09b41971 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1011,7 +1011,7 @@ static int sh_eth_txfree(struct net_device *ndev)
1011} 1011}
1012 1012
1013/* Packet receive function */ 1013/* Packet receive function */
1014static int sh_eth_rx(struct net_device *ndev) 1014static int sh_eth_rx(struct net_device *ndev, u32 intr_status)
1015{ 1015{
1016 struct sh_eth_private *mdp = netdev_priv(ndev); 1016 struct sh_eth_private *mdp = netdev_priv(ndev);
1017 struct sh_eth_rxdesc *rxdesc; 1017 struct sh_eth_rxdesc *rxdesc;
@@ -1102,9 +1102,11 @@ static int sh_eth_rx(struct net_device *ndev)
1102 /* Restart Rx engine if stopped. */ 1102 /* Restart Rx engine if stopped. */
1103 /* If we don't need to check status, don't. -KDU */ 1103 /* If we don't need to check status, don't. -KDU */
1104 if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) { 1104 if (!(sh_eth_read(ndev, EDRRR) & EDRRR_R)) {
1105 /* fix the values for the next receiving */ 1105 /* fix the values for the next receiving if RDE is set */
1106 mdp->cur_rx = mdp->dirty_rx = (sh_eth_read(ndev, RDFAR) - 1106 if (intr_status & EESR_RDE)
1107 sh_eth_read(ndev, RDLAR)) >> 4; 1107 mdp->cur_rx = mdp->dirty_rx =
1108 (sh_eth_read(ndev, RDFAR) -
1109 sh_eth_read(ndev, RDLAR)) >> 4;
1108 sh_eth_write(ndev, EDRRR_R, EDRRR); 1110 sh_eth_write(ndev, EDRRR_R, EDRRR);
1109 } 1111 }
1110 1112
@@ -1273,7 +1275,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
1273 EESR_RTSF | /* short frame recv */ 1275 EESR_RTSF | /* short frame recv */
1274 EESR_PRE | /* PHY-LSI recv error */ 1276 EESR_PRE | /* PHY-LSI recv error */
1275 EESR_CERF)){ /* recv frame CRC error */ 1277 EESR_CERF)){ /* recv frame CRC error */
1276 sh_eth_rx(ndev); 1278 sh_eth_rx(ndev, intr_status);
1277 } 1279 }
1278 1280
1279 /* Tx Check */ 1281 /* Tx Check */
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 590f902deb6b..9d6c80c8a0cf 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -161,7 +161,7 @@ static struct phy_driver ks8051_driver = {
161static struct phy_driver ks8001_driver = { 161static struct phy_driver ks8001_driver = {
162 .phy_id = PHY_ID_KS8001, 162 .phy_id = PHY_ID_KS8001,
163 .name = "Micrel KS8001 or KS8721", 163 .name = "Micrel KS8001 or KS8721",
164 .phy_id_mask = 0x00fffff0, 164 .phy_id_mask = 0x00ffffff,
165 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 165 .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
166 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 166 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
167 .config_init = kszphy_config_init, 167 .config_init = kszphy_config_init,
@@ -174,7 +174,7 @@ static struct phy_driver ks8001_driver = {
174 174
175static struct phy_driver ksz9021_driver = { 175static struct phy_driver ksz9021_driver = {
176 .phy_id = PHY_ID_KSZ9021, 176 .phy_id = PHY_ID_KSZ9021,
177 .phy_id_mask = 0x000fff10, 177 .phy_id_mask = 0x000ffffe,
178 .name = "Micrel KSZ9021 Gigabit PHY", 178 .name = "Micrel KSZ9021 Gigabit PHY",
179 .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause 179 .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause
180 | SUPPORTED_Asym_Pause), 180 | SUPPORTED_Asym_Pause),
@@ -240,8 +240,8 @@ MODULE_AUTHOR("David J. Choi");
240MODULE_LICENSE("GPL"); 240MODULE_LICENSE("GPL");
241 241
242static struct mdio_device_id __maybe_unused micrel_tbl[] = { 242static struct mdio_device_id __maybe_unused micrel_tbl[] = {
243 { PHY_ID_KSZ9021, 0x000fff10 }, 243 { PHY_ID_KSZ9021, 0x000ffffe },
244 { PHY_ID_KS8001, 0x00fffff0 }, 244 { PHY_ID_KS8001, 0x00ffffff },
245 { PHY_ID_KS8737, 0x00fffff0 }, 245 { PHY_ID_KS8737, 0x00fffff0 },
246 { PHY_ID_KS8041, 0x00fffff0 }, 246 { PHY_ID_KS8041, 0x00fffff0 },
247 { PHY_ID_KS8051, 0x00fffff0 }, 247 { PHY_ID_KS8051, 0x00fffff0 },
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 964031e3da87..a28a983d465e 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -59,6 +59,7 @@
59#define USB_PRODUCT_IPHONE_3G 0x1292 59#define USB_PRODUCT_IPHONE_3G 0x1292
60#define USB_PRODUCT_IPHONE_3GS 0x1294 60#define USB_PRODUCT_IPHONE_3GS 0x1294
61#define USB_PRODUCT_IPHONE_4 0x1297 61#define USB_PRODUCT_IPHONE_4 0x1297
62#define USB_PRODUCT_IPAD 0x129a
62#define USB_PRODUCT_IPHONE_4_VZW 0x129c 63#define USB_PRODUCT_IPHONE_4_VZW 0x129c
63#define USB_PRODUCT_IPHONE_4S 0x12a0 64#define USB_PRODUCT_IPHONE_4S 0x12a0
64 65
@@ -101,6 +102,10 @@ static struct usb_device_id ipheth_table[] = {
101 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 102 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
102 IPHETH_USBINTF_PROTO) }, 103 IPHETH_USBINTF_PROTO) },
103 { USB_DEVICE_AND_INTERFACE_INFO( 104 { USB_DEVICE_AND_INTERFACE_INFO(
105 USB_VENDOR_APPLE, USB_PRODUCT_IPAD,
106 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
107 IPHETH_USBINTF_PROTO) },
108 { USB_DEVICE_AND_INTERFACE_INFO(
104 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, 109 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
105 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 110 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
106 IPHETH_USBINTF_PROTO) }, 111 IPHETH_USBINTF_PROTO) },
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 3b206786b5e7..3767a1225860 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -257,29 +257,6 @@ err:
257 return rv; 257 return rv;
258} 258}
259 259
260/* Gobi devices uses identical class/protocol codes for all interfaces regardless
261 * of function. Some of these are CDC ACM like and have the exact same endpoints
262 * we are looking for. This leaves two possible strategies for identifying the
263 * correct interface:
264 * a) hardcoding interface number, or
265 * b) use the fact that the wwan interface is the only one lacking additional
266 * (CDC functional) descriptors
267 *
268 * Let's see if we can get away with the generic b) solution.
269 */
270static int qmi_wwan_bind_gobi(struct usbnet *dev, struct usb_interface *intf)
271{
272 int rv = -EINVAL;
273
274 /* ignore any interface with additional descriptors */
275 if (intf->cur_altsetting->extralen)
276 goto err;
277
278 rv = qmi_wwan_bind_shared(dev, intf);
279err:
280 return rv;
281}
282
283static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf) 260static void qmi_wwan_unbind_shared(struct usbnet *dev, struct usb_interface *intf)
284{ 261{
285 struct usb_driver *subdriver = (void *)dev->data[0]; 262 struct usb_driver *subdriver = (void *)dev->data[0];
@@ -347,15 +324,15 @@ static const struct driver_info qmi_wwan_shared = {
347 .manage_power = qmi_wwan_manage_power, 324 .manage_power = qmi_wwan_manage_power,
348}; 325};
349 326
350static const struct driver_info qmi_wwan_gobi = { 327static const struct driver_info qmi_wwan_force_int0 = {
351 .description = "Qualcomm Gobi wwan/QMI device", 328 .description = "Qualcomm WWAN/QMI device",
352 .flags = FLAG_WWAN, 329 .flags = FLAG_WWAN,
353 .bind = qmi_wwan_bind_gobi, 330 .bind = qmi_wwan_bind_shared,
354 .unbind = qmi_wwan_unbind_shared, 331 .unbind = qmi_wwan_unbind_shared,
355 .manage_power = qmi_wwan_manage_power, 332 .manage_power = qmi_wwan_manage_power,
333 .data = BIT(0), /* interface whitelist bitmap */
356}; 334};
357 335
358/* ZTE suck at making USB descriptors */
359static const struct driver_info qmi_wwan_force_int1 = { 336static const struct driver_info qmi_wwan_force_int1 = {
360 .description = "Qualcomm WWAN/QMI device", 337 .description = "Qualcomm WWAN/QMI device",
361 .flags = FLAG_WWAN, 338 .flags = FLAG_WWAN,
@@ -365,6 +342,15 @@ static const struct driver_info qmi_wwan_force_int1 = {
365 .data = BIT(1), /* interface whitelist bitmap */ 342 .data = BIT(1), /* interface whitelist bitmap */
366}; 343};
367 344
345static const struct driver_info qmi_wwan_force_int3 = {
346 .description = "Qualcomm WWAN/QMI device",
347 .flags = FLAG_WWAN,
348 .bind = qmi_wwan_bind_shared,
349 .unbind = qmi_wwan_unbind_shared,
350 .manage_power = qmi_wwan_manage_power,
351 .data = BIT(3), /* interface whitelist bitmap */
352};
353
368static const struct driver_info qmi_wwan_force_int4 = { 354static const struct driver_info qmi_wwan_force_int4 = {
369 .description = "Qualcomm WWAN/QMI device", 355 .description = "Qualcomm WWAN/QMI device",
370 .flags = FLAG_WWAN, 356 .flags = FLAG_WWAN,
@@ -390,16 +376,23 @@ static const struct driver_info qmi_wwan_force_int4 = {
390static const struct driver_info qmi_wwan_sierra = { 376static const struct driver_info qmi_wwan_sierra = {
391 .description = "Sierra Wireless wwan/QMI device", 377 .description = "Sierra Wireless wwan/QMI device",
392 .flags = FLAG_WWAN, 378 .flags = FLAG_WWAN,
393 .bind = qmi_wwan_bind_gobi, 379 .bind = qmi_wwan_bind_shared,
394 .unbind = qmi_wwan_unbind_shared, 380 .unbind = qmi_wwan_unbind_shared,
395 .manage_power = qmi_wwan_manage_power, 381 .manage_power = qmi_wwan_manage_power,
396 .data = BIT(8) | BIT(19), /* interface whitelist bitmap */ 382 .data = BIT(8) | BIT(19), /* interface whitelist bitmap */
397}; 383};
398 384
399#define HUAWEI_VENDOR_ID 0x12D1 385#define HUAWEI_VENDOR_ID 0x12D1
386
387/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
388#define QMI_GOBI1K_DEVICE(vend, prod) \
389 USB_DEVICE(vend, prod), \
390 .driver_info = (unsigned long)&qmi_wwan_force_int3
391
392/* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */
400#define QMI_GOBI_DEVICE(vend, prod) \ 393#define QMI_GOBI_DEVICE(vend, prod) \
401 USB_DEVICE(vend, prod), \ 394 USB_DEVICE(vend, prod), \
402 .driver_info = (unsigned long)&qmi_wwan_gobi 395 .driver_info = (unsigned long)&qmi_wwan_force_int0
403 396
404static const struct usb_device_id products[] = { 397static const struct usb_device_id products[] = {
405 { /* Huawei E392, E398 and possibly others sharing both device id and more... */ 398 { /* Huawei E392, E398 and possibly others sharing both device id and more... */
@@ -510,20 +503,24 @@ static const struct usb_device_id products[] = {
510 .bInterfaceProtocol = 0xff, 503 .bInterfaceProtocol = 0xff,
511 .driver_info = (unsigned long)&qmi_wwan_sierra, 504 .driver_info = (unsigned long)&qmi_wwan_sierra,
512 }, 505 },
513 {QMI_GOBI_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 506
514 {QMI_GOBI_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ 507 /* Gobi 1000 devices */
515 {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */ 508 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
516 {QMI_GOBI_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ 509 {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
517 {QMI_GOBI_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ 510 {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
518 {QMI_GOBI_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ 511 {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
519 {QMI_GOBI_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ 512 {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
520 {QMI_GOBI_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ 513 {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
521 {QMI_GOBI_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ 514 {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
522 {QMI_GOBI_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ 515 {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
523 {QMI_GOBI_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ 516 {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
524 {QMI_GOBI_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ 517 {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
525 {QMI_GOBI_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ 518 {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
526 {QMI_GOBI_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */ 519 {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
520 {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
521 {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
522
523 /* Gobi 2000 and 3000 devices */
527 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ 524 {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
528 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ 525 {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
529 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ 526 {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 9f58330f1312..aba769d77459 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -796,11 +796,13 @@ int usbnet_open (struct net_device *net)
796 if (info->manage_power) { 796 if (info->manage_power) {
797 retval = info->manage_power(dev, 1); 797 retval = info->manage_power(dev, 1);
798 if (retval < 0) 798 if (retval < 0)
799 goto done; 799 goto done_manage_power_error;
800 usb_autopm_put_interface(dev->intf); 800 usb_autopm_put_interface(dev->intf);
801 } 801 }
802 return retval; 802 return retval;
803 803
804done_manage_power_error:
805 clear_bit(EVENT_DEV_OPEN, &dev->flags);
804done: 806done:
805 usb_autopm_put_interface(dev->intf); 807 usb_autopm_put_interface(dev->intf);
806done_nopm: 808done_nopm:
@@ -876,9 +878,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
876{ 878{
877 struct usbnet *dev = netdev_priv(net); 879 struct usbnet *dev = netdev_priv(net);
878 880
879 strncpy (info->driver, dev->driver_name, sizeof info->driver); 881 strlcpy (info->driver, dev->driver_name, sizeof info->driver);
880 strncpy (info->version, DRIVER_VERSION, sizeof info->version); 882 strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
881 strncpy (info->fw_version, dev->driver_info->description, 883 strlcpy (info->fw_version, dev->driver_info->description,
882 sizeof info->fw_version); 884 sizeof info->fw_version);
883 usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info); 885 usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
884} 886}
@@ -1202,6 +1204,21 @@ deferred:
1202} 1204}
1203EXPORT_SYMBOL_GPL(usbnet_start_xmit); 1205EXPORT_SYMBOL_GPL(usbnet_start_xmit);
1204 1206
1207static void rx_alloc_submit(struct usbnet *dev, gfp_t flags)
1208{
1209 struct urb *urb;
1210 int i;
1211
1212 /* don't refill the queue all at once */
1213 for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) {
1214 urb = usb_alloc_urb(0, flags);
1215 if (urb != NULL) {
1216 if (rx_submit(dev, urb, flags) == -ENOLINK)
1217 return;
1218 }
1219 }
1220}
1221
1205/*-------------------------------------------------------------------------*/ 1222/*-------------------------------------------------------------------------*/
1206 1223
1207// tasklet (work deferred from completions, in_irq) or timer 1224// tasklet (work deferred from completions, in_irq) or timer
@@ -1241,26 +1258,14 @@ static void usbnet_bh (unsigned long param)
1241 !timer_pending (&dev->delay) && 1258 !timer_pending (&dev->delay) &&
1242 !test_bit (EVENT_RX_HALT, &dev->flags)) { 1259 !test_bit (EVENT_RX_HALT, &dev->flags)) {
1243 int temp = dev->rxq.qlen; 1260 int temp = dev->rxq.qlen;
1244 int qlen = RX_QLEN (dev); 1261
1245 1262 if (temp < RX_QLEN(dev)) {
1246 if (temp < qlen) { 1263 rx_alloc_submit(dev, GFP_ATOMIC);
1247 struct urb *urb;
1248 int i;
1249
1250 // don't refill the queue all at once
1251 for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) {
1252 urb = usb_alloc_urb (0, GFP_ATOMIC);
1253 if (urb != NULL) {
1254 if (rx_submit (dev, urb, GFP_ATOMIC) ==
1255 -ENOLINK)
1256 return;
1257 }
1258 }
1259 if (temp != dev->rxq.qlen) 1264 if (temp != dev->rxq.qlen)
1260 netif_dbg(dev, link, dev->net, 1265 netif_dbg(dev, link, dev->net,
1261 "rxqlen %d --> %d\n", 1266 "rxqlen %d --> %d\n",
1262 temp, dev->rxq.qlen); 1267 temp, dev->rxq.qlen);
1263 if (dev->rxq.qlen < qlen) 1268 if (dev->rxq.qlen < RX_QLEN(dev))
1264 tasklet_schedule (&dev->bh); 1269 tasklet_schedule (&dev->bh);
1265 } 1270 }
1266 if (dev->txq.qlen < TX_QLEN (dev)) 1271 if (dev->txq.qlen < TX_QLEN (dev))
@@ -1513,6 +1518,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
1513 spin_lock_irq(&dev->txq.lock); 1518 spin_lock_irq(&dev->txq.lock);
1514 /* don't autosuspend while transmitting */ 1519 /* don't autosuspend while transmitting */
1515 if (dev->txq.qlen && PMSG_IS_AUTO(message)) { 1520 if (dev->txq.qlen && PMSG_IS_AUTO(message)) {
1521 dev->suspend_count--;
1516 spin_unlock_irq(&dev->txq.lock); 1522 spin_unlock_irq(&dev->txq.lock);
1517 return -EBUSY; 1523 return -EBUSY;
1518 } else { 1524 } else {
@@ -1569,6 +1575,13 @@ int usbnet_resume (struct usb_interface *intf)
1569 spin_unlock_irq(&dev->txq.lock); 1575 spin_unlock_irq(&dev->txq.lock);
1570 1576
1571 if (test_bit(EVENT_DEV_OPEN, &dev->flags)) { 1577 if (test_bit(EVENT_DEV_OPEN, &dev->flags)) {
1578 /* handle remote wakeup ASAP */
1579 if (!dev->wait &&
1580 netif_device_present(dev->net) &&
1581 !timer_pending(&dev->delay) &&
1582 !test_bit(EVENT_RX_HALT, &dev->flags))
1583 rx_alloc_submit(dev, GFP_KERNEL);
1584
1572 if (!(dev->txq.qlen >= TX_QLEN(dev))) 1585 if (!(dev->txq.qlen >= TX_QLEN(dev)))
1573 netif_tx_wake_all_queues(dev->net); 1586 netif_tx_wake_all_queues(dev->net);
1574 tasklet_schedule (&dev->bh); 1587 tasklet_schedule (&dev->bh);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 520a4b2eb9cc..a747c632597a 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -7233,8 +7233,8 @@ static int airo_get_aplist(struct net_device *dev,
7233 } 7233 }
7234 } else { 7234 } else {
7235 dwrq->flags = 1; /* Should be define'd */ 7235 dwrq->flags = 1; /* Should be define'd */
7236 memcpy(extra + sizeof(struct sockaddr)*i, 7236 memcpy(extra + sizeof(struct sockaddr) * i, qual,
7237 &qual, sizeof(struct iw_quality)*i); 7237 sizeof(struct iw_quality) * i);
7238 } 7238 }
7239 dwrq->length = i; 7239 dwrq->length = i;
7240 7240
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index fbaa30930076..44ad6fe0278f 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1045,11 +1045,11 @@ ath5k_drain_tx_buffs(struct ath5k_hw *ah)
1045 1045
1046 ath5k_txbuf_free_skb(ah, bf); 1046 ath5k_txbuf_free_skb(ah, bf);
1047 1047
1048 spin_lock_bh(&ah->txbuflock); 1048 spin_lock(&ah->txbuflock);
1049 list_move_tail(&bf->list, &ah->txbuf); 1049 list_move_tail(&bf->list, &ah->txbuf);
1050 ah->txbuf_len++; 1050 ah->txbuf_len++;
1051 txq->txq_len--; 1051 txq->txq_len--;
1052 spin_unlock_bh(&ah->txbuflock); 1052 spin_unlock(&ah->txbuflock);
1053 } 1053 }
1054 txq->link = NULL; 1054 txq->link = NULL;
1055 txq->txq_poll_mark = false; 1055 txq->txq_poll_mark = false;
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index a277cf6f339d..4866550ddd96 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -214,6 +214,7 @@ struct ath_frame_info {
214 enum ath9k_key_type keytype; 214 enum ath9k_key_type keytype;
215 u8 keyix; 215 u8 keyix;
216 u8 retries; 216 u8 retries;
217 u8 rtscts_rate;
217}; 218};
218 219
219struct ath_buf_state { 220struct ath_buf_state {
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 2b8f61c210e1..abbd6effd60d 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1496,6 +1496,7 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
1496 priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--; 1496 priv->num_sta_assoc_vif++ : priv->num_sta_assoc_vif--;
1497 1497
1498 if (priv->ah->opmode == NL80211_IFTYPE_STATION) { 1498 if (priv->ah->opmode == NL80211_IFTYPE_STATION) {
1499 ath9k_htc_choose_set_bssid(priv);
1499 if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1)) 1500 if (bss_conf->assoc && (priv->num_sta_assoc_vif == 1))
1500 ath9k_htc_start_ani(priv); 1501 ath9k_htc_start_ani(priv);
1501 else if (priv->num_sta_assoc_vif == 0) 1502 else if (priv->num_sta_assoc_vif == 0)
@@ -1503,13 +1504,11 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
1503 } 1504 }
1504 } 1505 }
1505 1506
1506 if (changed & BSS_CHANGED_BSSID) { 1507 if (changed & BSS_CHANGED_IBSS) {
1507 if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) { 1508 if (priv->ah->opmode == NL80211_IFTYPE_ADHOC) {
1508 common->curaid = bss_conf->aid; 1509 common->curaid = bss_conf->aid;
1509 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN); 1510 memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
1510 ath9k_htc_set_bssid(priv); 1511 ath9k_htc_set_bssid(priv);
1511 } else if (priv->ah->opmode == NL80211_IFTYPE_STATION) {
1512 ath9k_htc_choose_set_bssid(priv);
1513 } 1512 }
1514 } 1513 }
1515 1514
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 7db1890448f2..1c68e564f503 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -784,13 +784,25 @@ static void ath9k_hw_init_qos(struct ath_hw *ah)
784 784
785u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah) 785u32 ar9003_get_pll_sqsum_dvc(struct ath_hw *ah)
786{ 786{
787 struct ath_common *common = ath9k_hw_common(ah);
788 int i = 0;
789
787 REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); 790 REG_CLR_BIT(ah, PLL3, PLL3_DO_MEAS_MASK);
788 udelay(100); 791 udelay(100);
789 REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK); 792 REG_SET_BIT(ah, PLL3, PLL3_DO_MEAS_MASK);
790 793
791 while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) 794 while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0) {
795
792 udelay(100); 796 udelay(100);
793 797
798 if (WARN_ON_ONCE(i >= 100)) {
799 ath_err(common, "PLL4 meaurement not done\n");
800 break;
801 }
802
803 i++;
804 }
805
794 return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3; 806 return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3;
795} 807}
796EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc); 808EXPORT_SYMBOL(ar9003_get_pll_sqsum_dvc);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 4de4473776ac..dac1a2709e3c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -971,6 +971,15 @@ void ath_hw_pll_work(struct work_struct *work)
971 hw_pll_work.work); 971 hw_pll_work.work);
972 u32 pll_sqsum; 972 u32 pll_sqsum;
973 973
974 /*
975 * ensure that the PLL WAR is executed only
976 * after the STA is associated (or) if the
977 * beaconing had started in interfaces that
978 * uses beacons.
979 */
980 if (!(sc->sc_flags & SC_OP_BEACONS))
981 return;
982
974 if (AR_SREV_9485(sc->sc_ah)) { 983 if (AR_SREV_9485(sc->sc_ah)) {
975 984
976 ath9k_ps_wakeup(sc); 985 ath9k_ps_wakeup(sc);
@@ -1443,15 +1452,6 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1443 } 1452 }
1444 } 1453 }
1445 1454
1446 if ((ah->opmode == NL80211_IFTYPE_ADHOC) ||
1447 ((vif->type == NL80211_IFTYPE_ADHOC) &&
1448 sc->nvifs > 0)) {
1449 ath_err(common, "Cannot create ADHOC interface when other"
1450 " interfaces already exist.\n");
1451 ret = -EINVAL;
1452 goto out;
1453 }
1454
1455 ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); 1455 ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
1456 1456
1457 sc->nvifs++; 1457 sc->nvifs++;
@@ -1476,15 +1476,6 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1476 mutex_lock(&sc->mutex); 1476 mutex_lock(&sc->mutex);
1477 ath9k_ps_wakeup(sc); 1477 ath9k_ps_wakeup(sc);
1478 1478
1479 /* See if new interface type is valid. */
1480 if ((new_type == NL80211_IFTYPE_ADHOC) &&
1481 (sc->nvifs > 1)) {
1482 ath_err(common, "When using ADHOC, it must be the only"
1483 " interface.\n");
1484 ret = -EINVAL;
1485 goto out;
1486 }
1487
1488 if (ath9k_uses_beacons(new_type) && 1479 if (ath9k_uses_beacons(new_type) &&
1489 !ath9k_uses_beacons(vif->type)) { 1480 !ath9k_uses_beacons(vif->type)) {
1490 if (sc->nbcnvifs >= ATH_BCBUF) { 1481 if (sc->nbcnvifs >= ATH_BCBUF) {
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index d59dd01d6cde..4d571394c7a8 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -938,6 +938,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
938 struct ieee80211_tx_rate *rates; 938 struct ieee80211_tx_rate *rates;
939 const struct ieee80211_rate *rate; 939 const struct ieee80211_rate *rate;
940 struct ieee80211_hdr *hdr; 940 struct ieee80211_hdr *hdr;
941 struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
941 int i; 942 int i;
942 u8 rix = 0; 943 u8 rix = 0;
943 944
@@ -948,18 +949,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
948 949
949 /* set dur_update_en for l-sig computation except for PS-Poll frames */ 950 /* set dur_update_en for l-sig computation except for PS-Poll frames */
950 info->dur_update = !ieee80211_is_pspoll(hdr->frame_control); 951 info->dur_update = !ieee80211_is_pspoll(hdr->frame_control);
951 952 info->rtscts_rate = fi->rtscts_rate;
952 /*
953 * We check if Short Preamble is needed for the CTS rate by
954 * checking the BSS's global flag.
955 * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used.
956 */
957 rate = ieee80211_get_rts_cts_rate(sc->hw, tx_info);
958 info->rtscts_rate = rate->hw_value;
959
960 if (tx_info->control.vif &&
961 tx_info->control.vif->bss_conf.use_short_preamble)
962 info->rtscts_rate |= rate->hw_value_short;
963 953
964 for (i = 0; i < 4; i++) { 954 for (i = 0; i < 4; i++) {
965 bool is_40, is_sgi, is_sp; 955 bool is_40, is_sgi, is_sp;
@@ -1001,13 +991,13 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
1001 } 991 }
1002 992
1003 /* legacy rates */ 993 /* legacy rates */
994 rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
1004 if ((tx_info->band == IEEE80211_BAND_2GHZ) && 995 if ((tx_info->band == IEEE80211_BAND_2GHZ) &&
1005 !(rate->flags & IEEE80211_RATE_ERP_G)) 996 !(rate->flags & IEEE80211_RATE_ERP_G))
1006 phy = WLAN_RC_PHY_CCK; 997 phy = WLAN_RC_PHY_CCK;
1007 else 998 else
1008 phy = WLAN_RC_PHY_OFDM; 999 phy = WLAN_RC_PHY_OFDM;
1009 1000
1010 rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
1011 info->rates[i].Rate = rate->hw_value; 1001 info->rates[i].Rate = rate->hw_value;
1012 if (rate->hw_value_short) { 1002 if (rate->hw_value_short) {
1013 if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) 1003 if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
@@ -1776,10 +1766,22 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
1776 struct ieee80211_sta *sta = tx_info->control.sta; 1766 struct ieee80211_sta *sta = tx_info->control.sta;
1777 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 1767 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
1778 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1768 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1769 const struct ieee80211_rate *rate;
1779 struct ath_frame_info *fi = get_frame_info(skb); 1770 struct ath_frame_info *fi = get_frame_info(skb);
1780 struct ath_node *an = NULL; 1771 struct ath_node *an = NULL;
1781 enum ath9k_key_type keytype; 1772 enum ath9k_key_type keytype;
1773 bool short_preamble = false;
1774
1775 /*
1776 * We check if Short Preamble is needed for the CTS rate by
1777 * checking the BSS's global flag.
1778 * But for the rate series, IEEE80211_TX_RC_USE_SHORT_PREAMBLE is used.
1779 */
1780 if (tx_info->control.vif &&
1781 tx_info->control.vif->bss_conf.use_short_preamble)
1782 short_preamble = true;
1782 1783
1784 rate = ieee80211_get_rts_cts_rate(hw, tx_info);
1783 keytype = ath9k_cmn_get_hw_crypto_keytype(skb); 1785 keytype = ath9k_cmn_get_hw_crypto_keytype(skb);
1784 1786
1785 if (sta) 1787 if (sta)
@@ -1794,6 +1796,9 @@ static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
1794 fi->keyix = ATH9K_TXKEYIX_INVALID; 1796 fi->keyix = ATH9K_TXKEYIX_INVALID;
1795 fi->keytype = keytype; 1797 fi->keytype = keytype;
1796 fi->framelen = framelen; 1798 fi->framelen = framelen;
1799 fi->rtscts_rate = rate->hw_value;
1800 if (short_preamble)
1801 fi->rtscts_rate |= rate->hw_value_short;
1797} 1802}
1798 1803
1799u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) 1804u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index e7c157e5ebeb..7f97dec8534d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2239,6 +2239,7 @@ static ssize_t iwl_dbgfs_echo_test_write(struct file *file,
2239 return count; 2239 return count;
2240} 2240}
2241 2241
2242#ifdef CONFIG_IWLWIFI_DEBUG
2242static ssize_t iwl_dbgfs_log_event_read(struct file *file, 2243static ssize_t iwl_dbgfs_log_event_read(struct file *file,
2243 char __user *user_buf, 2244 char __user *user_buf,
2244 size_t count, loff_t *ppos) 2245 size_t count, loff_t *ppos)
@@ -2276,6 +2277,7 @@ static ssize_t iwl_dbgfs_log_event_write(struct file *file,
2276 2277
2277 return count; 2278 return count;
2278} 2279}
2280#endif
2279 2281
2280static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file, 2282static ssize_t iwl_dbgfs_calib_disabled_read(struct file *file,
2281 char __user *user_buf, 2283 char __user *user_buf,
@@ -2345,7 +2347,9 @@ DEBUGFS_READ_FILE_OPS(bt_traffic);
2345DEBUGFS_READ_WRITE_FILE_OPS(protection_mode); 2347DEBUGFS_READ_WRITE_FILE_OPS(protection_mode);
2346DEBUGFS_READ_FILE_OPS(reply_tx_error); 2348DEBUGFS_READ_FILE_OPS(reply_tx_error);
2347DEBUGFS_WRITE_FILE_OPS(echo_test); 2349DEBUGFS_WRITE_FILE_OPS(echo_test);
2350#ifdef CONFIG_IWLWIFI_DEBUG
2348DEBUGFS_READ_WRITE_FILE_OPS(log_event); 2351DEBUGFS_READ_WRITE_FILE_OPS(log_event);
2352#endif
2349DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled); 2353DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled);
2350 2354
2351/* 2355/*
@@ -2405,7 +2409,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2405 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 2409 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
2406 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 2410 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
2407 DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR); 2411 DEBUGFS_ADD_FILE(echo_test, dir_debug, S_IWUSR);
2412#ifdef CONFIG_IWLWIFI_DEBUG
2408 DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR); 2413 DEBUGFS_ADD_FILE(log_event, dir_debug, S_IWUSR | S_IRUSR);
2414#endif
2409 2415
2410 if (iwl_advanced_bt_coexist(priv)) 2416 if (iwl_advanced_bt_coexist(priv))
2411 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR); 2417 DEBUGFS_ADD_FILE(bt_traffic, dir_debug, S_IRUSR);
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 015fec3371a0..ce61b6fae1c9 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1484,7 +1484,7 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1484 struct wireless_dev *wdev; 1484 struct wireless_dev *wdev;
1485 1485
1486 if (!adapter) 1486 if (!adapter)
1487 return NULL; 1487 return ERR_PTR(-EFAULT);
1488 1488
1489 switch (type) { 1489 switch (type) {
1490 case NL80211_IFTYPE_UNSPECIFIED: 1490 case NL80211_IFTYPE_UNSPECIFIED:
@@ -1494,12 +1494,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1494 if (priv->bss_mode) { 1494 if (priv->bss_mode) {
1495 wiphy_err(wiphy, 1495 wiphy_err(wiphy,
1496 "cannot create multiple sta/adhoc ifaces\n"); 1496 "cannot create multiple sta/adhoc ifaces\n");
1497 return NULL; 1497 return ERR_PTR(-EINVAL);
1498 } 1498 }
1499 1499
1500 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); 1500 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
1501 if (!wdev) 1501 if (!wdev)
1502 return NULL; 1502 return ERR_PTR(-ENOMEM);
1503 1503
1504 wdev->wiphy = wiphy; 1504 wdev->wiphy = wiphy;
1505 priv->wdev = wdev; 1505 priv->wdev = wdev;
@@ -1522,12 +1522,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1522 1522
1523 if (priv->bss_mode) { 1523 if (priv->bss_mode) {
1524 wiphy_err(wiphy, "Can't create multiple AP interfaces"); 1524 wiphy_err(wiphy, "Can't create multiple AP interfaces");
1525 return NULL; 1525 return ERR_PTR(-EINVAL);
1526 } 1526 }
1527 1527
1528 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); 1528 wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
1529 if (!wdev) 1529 if (!wdev)
1530 return NULL; 1530 return ERR_PTR(-ENOMEM);
1531 1531
1532 priv->wdev = wdev; 1532 priv->wdev = wdev;
1533 wdev->wiphy = wiphy; 1533 wdev->wiphy = wiphy;
@@ -1544,14 +1544,15 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1544 break; 1544 break;
1545 default: 1545 default:
1546 wiphy_err(wiphy, "type not supported\n"); 1546 wiphy_err(wiphy, "type not supported\n");
1547 return NULL; 1547 return ERR_PTR(-EINVAL);
1548 } 1548 }
1549 1549
1550 dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name, 1550 dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name,
1551 ether_setup, 1); 1551 ether_setup, 1);
1552 if (!dev) { 1552 if (!dev) {
1553 wiphy_err(wiphy, "no memory available for netdevice\n"); 1553 wiphy_err(wiphy, "no memory available for netdevice\n");
1554 goto error; 1554 priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
1555 return ERR_PTR(-ENOMEM);
1555 } 1556 }
1556 1557
1557 mwifiex_init_priv_params(priv, dev); 1558 mwifiex_init_priv_params(priv, dev);
@@ -1582,7 +1583,9 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1582 /* Register network device */ 1583 /* Register network device */
1583 if (register_netdevice(dev)) { 1584 if (register_netdevice(dev)) {
1584 wiphy_err(wiphy, "cannot register virtual network device\n"); 1585 wiphy_err(wiphy, "cannot register virtual network device\n");
1585 goto error; 1586 free_netdev(dev);
1587 priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
1588 return ERR_PTR(-EFAULT);
1586 } 1589 }
1587 1590
1588 sema_init(&priv->async_sem, 1); 1591 sema_init(&priv->async_sem, 1);
@@ -1594,12 +1597,6 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1594 mwifiex_dev_debugfs_init(priv); 1597 mwifiex_dev_debugfs_init(priv);
1595#endif 1598#endif
1596 return dev; 1599 return dev;
1597error:
1598 if (dev && (dev->reg_state == NETREG_UNREGISTERED))
1599 free_netdev(dev);
1600 priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
1601
1602 return NULL;
1603} 1600}
1604EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf); 1601EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
1605 1602
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c
index e2faec4db108..cecb27283196 100644
--- a/drivers/net/wireless/mwifiex/txrx.c
+++ b/drivers/net/wireless/mwifiex/txrx.c
@@ -161,15 +161,11 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
161 goto done; 161 goto done;
162 162
163 for (i = 0; i < adapter->priv_num; i++) { 163 for (i = 0; i < adapter->priv_num; i++) {
164
165 tpriv = adapter->priv[i]; 164 tpriv = adapter->priv[i];
166 165
167 if ((GET_BSS_ROLE(tpriv) == MWIFIEX_BSS_ROLE_STA) && 166 if (tpriv->media_connected &&
168 (tpriv->media_connected)) { 167 netif_queue_stopped(tpriv->netdev))
169 if (netif_queue_stopped(tpriv->netdev)) 168 mwifiex_wake_up_net_dev_queue(tpriv->netdev, adapter);
170 mwifiex_wake_up_net_dev_queue(tpriv->netdev,
171 adapter);
172 }
173 } 169 }
174done: 170done:
175 dev_kfree_skb_any(skb); 171 dev_kfree_skb_any(skb);
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c
index 8173ab66066d..89f9a2a45de3 100644
--- a/drivers/net/wireless/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/mwifiex/uap_cmd.c
@@ -27,6 +27,17 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
27 struct cfg80211_ap_settings *params) { 27 struct cfg80211_ap_settings *params) {
28 int i; 28 int i;
29 29
30 if (!params->privacy) {
31 bss_config->protocol = PROTOCOL_NO_SECURITY;
32 bss_config->key_mgmt = KEY_MGMT_NONE;
33 bss_config->wpa_cfg.length = 0;
34 priv->sec_info.wep_enabled = 0;
35 priv->sec_info.wpa_enabled = 0;
36 priv->sec_info.wpa2_enabled = 0;
37
38 return 0;
39 }
40
30 switch (params->auth_type) { 41 switch (params->auth_type) {
31 case NL80211_AUTHTYPE_OPEN_SYSTEM: 42 case NL80211_AUTHTYPE_OPEN_SYSTEM:
32 bss_config->auth_mode = WLAN_AUTH_OPEN; 43 bss_config->auth_mode = WLAN_AUTH_OPEN;
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 2e9e6af21362..dfcd02ab6cae 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2110,7 +2110,7 @@ resize_buf:
2110 while (check_bssid_list_item(bssid, bssid_len, buf, len)) { 2110 while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
2111 if (rndis_bss_info_update(usbdev, bssid) && match_bssid && 2111 if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
2112 matched) { 2112 matched) {
2113 if (!ether_addr_equal(bssid->mac, match_bssid)) 2113 if (ether_addr_equal(bssid->mac, match_bssid))
2114 *matched = true; 2114 *matched = true;
2115 } 2115 }
2116 2116
diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c
index ad87a1ac6462..db6430c1a084 100644
--- a/drivers/net/wireless/ti/wl1251/acx.c
+++ b/drivers/net/wireless/ti/wl1251/acx.c
@@ -869,7 +869,7 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime)
869 } 869 }
870 870
871 *mactime = tsf_info->current_tsf_lsb | 871 *mactime = tsf_info->current_tsf_lsb |
872 (tsf_info->current_tsf_msb << 31); 872 ((u64)tsf_info->current_tsf_msb << 32);
873 873
874out: 874out:
875 kfree(tsf_info); 875 kfree(tsf_info);
diff --git a/drivers/net/wireless/ti/wl1251/event.c b/drivers/net/wireless/ti/wl1251/event.c
index 9f15ccaf8f05..5ec50a476a69 100644
--- a/drivers/net/wireless/ti/wl1251/event.c
+++ b/drivers/net/wireless/ti/wl1251/event.c
@@ -76,8 +76,7 @@ static int wl1251_event_process(struct wl1251 *wl, struct event_mailbox *mbox)
76 } 76 }
77 } 77 }
78 78
79 if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID && 79 if (vector & SYNCHRONIZATION_TIMEOUT_EVENT_ID) {
80 wl->station_mode != STATION_ACTIVE_MODE) {
81 wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT"); 80 wl1251_debug(DEBUG_EVENT, "SYNCHRONIZATION_TIMEOUT_EVENT");
82 81
83 /* indicate to the stack, that beacons have been lost */ 82 /* indicate to the stack, that beacons have been lost */
diff --git a/drivers/net/wireless/ti/wl1251/spi.c b/drivers/net/wireless/ti/wl1251/spi.c
index 87f6305bda2c..567660cd2fcd 100644
--- a/drivers/net/wireless/ti/wl1251/spi.c
+++ b/drivers/net/wireless/ti/wl1251/spi.c
@@ -73,6 +73,8 @@ static void wl1251_spi_reset(struct wl1251 *wl)
73 spi_sync(wl_to_spi(wl), &m); 73 spi_sync(wl_to_spi(wl), &m);
74 74
75 wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); 75 wl1251_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN);
76
77 kfree(cmd);
76} 78}
77 79
78static void wl1251_spi_wake(struct wl1251 *wl) 80static void wl1251_spi_wake(struct wl1251 *wl)
@@ -127,6 +129,8 @@ static void wl1251_spi_wake(struct wl1251 *wl)
127 spi_sync(wl_to_spi(wl), &m); 129 spi_sync(wl_to_spi(wl), &m);
128 130
129 wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN); 131 wl1251_dump(DEBUG_SPI, "spi init -> ", cmd, WSPI_INIT_CMD_LEN);
132
133 kfree(cmd);
130} 134}
131 135
132static void wl1251_spi_reset_wake(struct wl1251 *wl) 136static void wl1251_spi_reset_wake(struct wl1251 *wl)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 2027afe405fe..30899901aef5 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1935,14 +1935,14 @@ static int __devexit xennet_remove(struct xenbus_device *dev)
1935 1935
1936 dev_dbg(&dev->dev, "%s\n", dev->nodename); 1936 dev_dbg(&dev->dev, "%s\n", dev->nodename);
1937 1937
1938 unregister_netdev(info->netdev);
1939
1940 xennet_disconnect_backend(info); 1938 xennet_disconnect_backend(info);
1941 1939
1942 del_timer_sync(&info->rx_refill_timer);
1943
1944 xennet_sysfs_delif(info->netdev); 1940 xennet_sysfs_delif(info->netdev);
1945 1941
1942 unregister_netdev(info->netdev);
1943
1944 del_timer_sync(&info->rx_refill_timer);
1945
1946 free_percpu(info->stats); 1946 free_percpu(info->stats);
1947 1947
1948 free_netdev(info->netdev); 1948 free_netdev(info->netdev);
diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c
index da14432806c6..efc4b7f308cf 100644
--- a/drivers/oprofile/oprofile_perf.c
+++ b/drivers/oprofile/oprofile_perf.c
@@ -25,7 +25,7 @@ static int oprofile_perf_enabled;
25static DEFINE_MUTEX(oprofile_perf_mutex); 25static DEFINE_MUTEX(oprofile_perf_mutex);
26 26
27static struct op_counter_config *counter_config; 27static struct op_counter_config *counter_config;
28static struct perf_event **perf_events[nr_cpumask_bits]; 28static struct perf_event **perf_events[NR_CPUS];
29static int num_counters; 29static int num_counters;
30 30
31/* 31/*
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 9b7ca90057d5..795f75a6ac33 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -673,7 +673,9 @@ static __devinit int palmas_probe(struct platform_device *pdev)
673 pmic->desc[id].ops = &palmas_ops_smps10; 673 pmic->desc[id].ops = &palmas_ops_smps10;
674 pmic->desc[id].vsel_reg = PALMAS_SMPS10_CTRL; 674 pmic->desc[id].vsel_reg = PALMAS_SMPS10_CTRL;
675 pmic->desc[id].vsel_mask = SMPS10_VSEL; 675 pmic->desc[id].vsel_mask = SMPS10_VSEL;
676 pmic->desc[id].enable_reg = PALMAS_SMPS10_STATUS; 676 pmic->desc[id].enable_reg =
677 PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
678 PALMAS_SMPS10_STATUS);
677 pmic->desc[id].enable_mask = SMPS10_BOOST_EN; 679 pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
678 } 680 }
679 681
@@ -739,7 +741,8 @@ static __devinit int palmas_probe(struct platform_device *pdev)
739 741
740 pmic->desc[id].type = REGULATOR_VOLTAGE; 742 pmic->desc[id].type = REGULATOR_VOLTAGE;
741 pmic->desc[id].owner = THIS_MODULE; 743 pmic->desc[id].owner = THIS_MODULE;
742 pmic->desc[id].enable_reg = palmas_regs_info[id].ctrl_addr; 744 pmic->desc[id].enable_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE,
745 palmas_regs_info[id].ctrl_addr);
743 pmic->desc[id].enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE; 746 pmic->desc[id].enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE;
744 747
745 if (pdata && pdata->reg_data) 748 if (pdata && pdata->reg_data)
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c
index f841bd0db6aa..8f1be8586c72 100644
--- a/drivers/regulator/tps65023-regulator.c
+++ b/drivers/regulator/tps65023-regulator.c
@@ -71,7 +71,7 @@
71 71
72/* LDO_CTRL bitfields */ 72/* LDO_CTRL bitfields */
73#define TPS65023_LDO_CTRL_LDOx_SHIFT(ldo_id) ((ldo_id)*4) 73#define TPS65023_LDO_CTRL_LDOx_SHIFT(ldo_id) ((ldo_id)*4)
74#define TPS65023_LDO_CTRL_LDOx_MASK(ldo_id) (0x0F << ((ldo_id)*4)) 74#define TPS65023_LDO_CTRL_LDOx_MASK(ldo_id) (0x07 << ((ldo_id)*4))
75 75
76/* Number of step-down converters available */ 76/* Number of step-down converters available */
77#define TPS65023_NUM_DCDC 3 77#define TPS65023_NUM_DCDC 3
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c
index b88b3df82381..1b299aacf22f 100644
--- a/drivers/regulator/tps6524x-regulator.c
+++ b/drivers/regulator/tps6524x-regulator.c
@@ -482,7 +482,7 @@ static int get_voltage_sel(struct regulator_dev *rdev)
482 info = &supply_info[rdev_get_id(rdev)]; 482 info = &supply_info[rdev_get_id(rdev)];
483 483
484 if (info->flags & FIXED_VOLTAGE) 484 if (info->flags & FIXED_VOLTAGE)
485 return info->fixed_voltage; 485 return 0;
486 486
487 ret = read_field(hw, &info->voltage); 487 ret = read_field(hw, &info->voltage);
488 if (ret < 0) 488 if (ret < 0)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6f0a4c612b3b..6f72b80121a0 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1899,6 +1899,8 @@ static int sd_try_rc16_first(struct scsi_device *sdp)
1899{ 1899{
1900 if (sdp->host->max_cmd_len < 16) 1900 if (sdp->host->max_cmd_len < 16)
1901 return 0; 1901 return 0;
1902 if (sdp->try_rc_10_first)
1903 return 0;
1902 if (sdp->scsi_level > SCSI_SPC_2) 1904 if (sdp->scsi_level > SCSI_SPC_2)
1903 return 1; 1905 return 1;
1904 if (scsi_device_protection(sdp)) 1906 if (scsi_device_protection(sdp))
diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c
index 3295ea63f3eb..97ef67036e3f 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -129,6 +129,7 @@ static void send_space_homebrew(long length);
129 129
130static struct lirc_serial hardware[] = { 130static struct lirc_serial hardware[] = {
131 [LIRC_HOMEBREW] = { 131 [LIRC_HOMEBREW] = {
132 .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_HOMEBREW].lock),
132 .signal_pin = UART_MSR_DCD, 133 .signal_pin = UART_MSR_DCD,
133 .signal_pin_change = UART_MSR_DDCD, 134 .signal_pin_change = UART_MSR_DDCD,
134 .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), 135 .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR),
@@ -145,6 +146,7 @@ static struct lirc_serial hardware[] = {
145 }, 146 },
146 147
147 [LIRC_IRDEO] = { 148 [LIRC_IRDEO] = {
149 .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_IRDEO].lock),
148 .signal_pin = UART_MSR_DSR, 150 .signal_pin = UART_MSR_DSR,
149 .signal_pin_change = UART_MSR_DDSR, 151 .signal_pin_change = UART_MSR_DDSR,
150 .on = UART_MCR_OUT2, 152 .on = UART_MCR_OUT2,
@@ -156,6 +158,7 @@ static struct lirc_serial hardware[] = {
156 }, 158 },
157 159
158 [LIRC_IRDEO_REMOTE] = { 160 [LIRC_IRDEO_REMOTE] = {
161 .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_IRDEO_REMOTE].lock),
159 .signal_pin = UART_MSR_DSR, 162 .signal_pin = UART_MSR_DSR,
160 .signal_pin_change = UART_MSR_DDSR, 163 .signal_pin_change = UART_MSR_DDSR,
161 .on = (UART_MCR_RTS | UART_MCR_DTR | UART_MCR_OUT2), 164 .on = (UART_MCR_RTS | UART_MCR_DTR | UART_MCR_OUT2),
@@ -167,6 +170,7 @@ static struct lirc_serial hardware[] = {
167 }, 170 },
168 171
169 [LIRC_ANIMAX] = { 172 [LIRC_ANIMAX] = {
173 .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_ANIMAX].lock),
170 .signal_pin = UART_MSR_DCD, 174 .signal_pin = UART_MSR_DCD,
171 .signal_pin_change = UART_MSR_DDCD, 175 .signal_pin_change = UART_MSR_DDCD,
172 .on = 0, 176 .on = 0,
@@ -177,6 +181,7 @@ static struct lirc_serial hardware[] = {
177 }, 181 },
178 182
179 [LIRC_IGOR] = { 183 [LIRC_IGOR] = {
184 .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_IGOR].lock),
180 .signal_pin = UART_MSR_DSR, 185 .signal_pin = UART_MSR_DSR,
181 .signal_pin_change = UART_MSR_DDSR, 186 .signal_pin_change = UART_MSR_DDSR,
182 .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), 187 .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR),
@@ -201,6 +206,7 @@ static struct lirc_serial hardware[] = {
201 * See also http://www.nslu2-linux.org for this device 206 * See also http://www.nslu2-linux.org for this device
202 */ 207 */
203 [LIRC_NSLU2] = { 208 [LIRC_NSLU2] = {
209 .lock = __SPIN_LOCK_UNLOCKED(hardware[LIRC_NSLU2].lock),
204 .signal_pin = UART_MSR_CTS, 210 .signal_pin = UART_MSR_CTS,
205 .signal_pin_change = UART_MSR_DCTS, 211 .signal_pin_change = UART_MSR_DCTS,
206 .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR), 212 .on = (UART_MCR_RTS | UART_MCR_OUT2 | UART_MCR_DTR),
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index c691eea51537..f5ed3d75fa5a 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -46,7 +46,7 @@ obj-$(CONFIG_USB_MICROTEK) += image/
46obj-$(CONFIG_USB_SERIAL) += serial/ 46obj-$(CONFIG_USB_SERIAL) += serial/
47 47
48obj-$(CONFIG_USB) += misc/ 48obj-$(CONFIG_USB) += misc/
49obj-$(CONFIG_USB) += phy/ 49obj-$(CONFIG_USB_COMMON) += phy/
50obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/ 50obj-$(CONFIG_EARLY_PRINTK_DBGP) += early/
51 51
52obj-$(CONFIG_USB_ATM) += atm/ 52obj-$(CONFIG_USB_ATM) += atm/
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 3df1a1973b05..ec70df7aba17 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1091,7 +1091,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
1091 if (r == req) { 1091 if (r == req) {
1092 /* wait until it is processed */ 1092 /* wait until it is processed */
1093 dwc3_stop_active_transfer(dwc, dep->number); 1093 dwc3_stop_active_transfer(dwc, dep->number);
1094 goto out0; 1094 goto out1;
1095 } 1095 }
1096 dev_err(dwc->dev, "request %p was not queued to %s\n", 1096 dev_err(dwc->dev, "request %p was not queued to %s\n",
1097 request, ep->name); 1097 request, ep->name);
@@ -1099,6 +1099,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
1099 goto out0; 1099 goto out0;
1100 } 1100 }
1101 1101
1102out1:
1102 /* giveback the request */ 1103 /* giveback the request */
1103 dwc3_gadget_giveback(dep, req, -ECONNRESET); 1104 dwc3_gadget_giveback(dep, req, -ECONNRESET);
1104 1105
diff --git a/drivers/usb/gadget/fsl_qe_udc.h b/drivers/usb/gadget/fsl_qe_udc.h
index 4c07ca9cebf3..7026919fc901 100644
--- a/drivers/usb/gadget/fsl_qe_udc.h
+++ b/drivers/usb/gadget/fsl_qe_udc.h
@@ -153,10 +153,10 @@ struct usb_ep_para{
153#define USB_BUSMODE_DTB 0x02 153#define USB_BUSMODE_DTB 0x02
154 154
155/* Endpoint basic handle */ 155/* Endpoint basic handle */
156#define ep_index(EP) ((EP)->desc->bEndpointAddress & 0xF) 156#define ep_index(EP) ((EP)->ep.desc->bEndpointAddress & 0xF)
157#define ep_maxpacket(EP) ((EP)->ep.maxpacket) 157#define ep_maxpacket(EP) ((EP)->ep.maxpacket)
158#define ep_is_in(EP) ((ep_index(EP) == 0) ? (EP->udc->ep0_dir == \ 158#define ep_is_in(EP) ((ep_index(EP) == 0) ? (EP->udc->ep0_dir == \
159 USB_DIR_IN) : ((EP)->desc->bEndpointAddress \ 159 USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \
160 & USB_DIR_IN) == USB_DIR_IN) 160 & USB_DIR_IN) == USB_DIR_IN)
161 161
162/* ep0 transfer state */ 162/* ep0 transfer state */
diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
index 262acfd53e32..2ab0388d93eb 100644
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -61,6 +61,7 @@
61#include <mach/irqs.h> 61#include <mach/irqs.h>
62#include <mach/board.h> 62#include <mach/board.h>
63#ifdef CONFIG_USB_GADGET_DEBUG_FILES 63#ifdef CONFIG_USB_GADGET_DEBUG_FILES
64#include <linux/debugfs.h>
64#include <linux/seq_file.h> 65#include <linux/seq_file.h>
65#endif 66#endif
66 67
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index ef8d744800ac..e090c799d87b 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
375 */ 375 */
376 if (list_empty(&qh->hep->urb_list)) { 376 if (list_empty(&qh->hep->urb_list)) {
377 struct list_head *head; 377 struct list_head *head;
378 struct dma_controller *dma = musb->dma_controller;
378 379
379 if (is_in) 380 if (is_in) {
380 ep->rx_reinit = 1; 381 ep->rx_reinit = 1;
381 else 382 if (ep->rx_channel) {
383 dma->channel_release(ep->rx_channel);
384 ep->rx_channel = NULL;
385 }
386 } else {
382 ep->tx_reinit = 1; 387 ep->tx_reinit = 1;
388 if (ep->tx_channel) {
389 dma->channel_release(ep->tx_channel);
390 ep->tx_channel = NULL;
391 }
392 }
383 393
384 /* Clobber old pointers to this qh */ 394 /* Clobber old pointers to this qh */
385 musb_ep_set_qh(ep, is_in, NULL); 395 musb_ep_set_qh(ep, is_in, NULL);
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
index d2a9a8e691b9..0eabb049b6a9 100644
--- a/drivers/usb/otg/twl6030-usb.c
+++ b/drivers/usb/otg/twl6030-usb.c
@@ -305,9 +305,8 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl)
305 305
306 regulator_enable(twl->usb3v3); 306 regulator_enable(twl->usb3v3);
307 twl->asleep = 1; 307 twl->asleep = 1;
308 twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, 0x1); 308 twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_CLR);
309 twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, 309 twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_SET);
310 0x10);
311 status = USB_EVENT_ID; 310 status = USB_EVENT_ID;
312 otg->default_a = true; 311 otg->default_a = true;
313 twl->phy.state = OTG_STATE_A_IDLE; 312 twl->phy.state = OTG_STATE_A_IDLE;
@@ -316,12 +315,10 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl)
316 atomic_notifier_call_chain(&twl->phy.notifier, status, 315 atomic_notifier_call_chain(&twl->phy.notifier, status,
317 otg->gadget); 316 otg->gadget);
318 } else { 317 } else {
319 twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, 318 twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_CLR);
320 0x10); 319 twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET);
321 twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET,
322 0x1);
323 } 320 }
324 twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_LATCH_CLR, status); 321 twl6030_writeb(twl, TWL_MODULE_USB, status, USB_ID_INT_LATCH_CLR);
325 322
326 return IRQ_HANDLED; 323 return IRQ_HANDLED;
327} 324}
@@ -343,7 +340,7 @@ static int twl6030_enable_irq(struct usb_phy *x)
343{ 340{
344 struct twl6030_usb *twl = phy_to_twl(x); 341 struct twl6030_usb *twl = phy_to_twl(x);
345 342
346 twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET, 0x1); 343 twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET);
347 twl6030_interrupt_unmask(0x05, REG_INT_MSK_LINE_C); 344 twl6030_interrupt_unmask(0x05, REG_INT_MSK_LINE_C);
348 twl6030_interrupt_unmask(0x05, REG_INT_MSK_STS_C); 345 twl6030_interrupt_unmask(0x05, REG_INT_MSK_STS_C);
349 346
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 3cfabcba7447..e7cf84f0751a 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -2,11 +2,11 @@
2# Physical Layer USB driver configuration 2# Physical Layer USB driver configuration
3# 3#
4comment "USB Physical Layer drivers" 4comment "USB Physical Layer drivers"
5 depends on USB 5 depends on USB || USB_GADGET
6 6
7config USB_ISP1301 7config USB_ISP1301
8 tristate "NXP ISP1301 USB transceiver support" 8 tristate "NXP ISP1301 USB transceiver support"
9 depends on USB 9 depends on USB || USB_GADGET
10 depends on I2C 10 depends on I2C
11 help 11 help
12 Say Y here to add support for the NXP ISP1301 USB transceiver driver. 12 Say Y here to add support for the NXP ISP1301 USB transceiver driver.
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 73d25cd8cba5..1e71079ce33b 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -93,6 +93,7 @@ static const struct usb_device_id id_table[] = {
93 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 93 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
94 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ 94 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */
95 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 95 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
96 { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */
96 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ 97 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
97 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ 98 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
98 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */ 99 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
@@ -134,7 +135,13 @@ static const struct usb_device_id id_table[] = {
134 { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ 135 { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */
135 { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ 136 { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
136 { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ 137 { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
138 { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */
139 { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */
137 { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ 140 { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
141 { USB_DEVICE(0x166A, 0x0304) }, /* Clipsal 5000CT2 C-Bus Black and White Touchscreen */
142 { USB_DEVICE(0x166A, 0x0305) }, /* Clipsal C-5000CT2 C-Bus Spectrum Colour Touchscreen */
143 { USB_DEVICE(0x166A, 0x0401) }, /* Clipsal L51xx C-Bus Architectural Dimmer */
144 { USB_DEVICE(0x166A, 0x0101) }, /* Clipsal 5560884 C-Bus Multi-room Audio Matrix Switcher */
138 { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ 145 { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
139 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ 146 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */
140 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ 147 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
@@ -146,7 +153,11 @@ static const struct usb_device_id id_table[] = {
146 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ 153 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
147 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ 154 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
148 { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */ 155 { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
156 { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
157 { USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */
149 { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ 158 { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
159 { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */
160 { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */
150 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ 161 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
151 { } /* Terminating Entry */ 162 { } /* Terminating Entry */
152}; 163};
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 9520c4c54743..a0382b24866e 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -236,6 +236,7 @@ static void option_instat_callback(struct urb *urb);
236#define NOVATELWIRELESS_PRODUCT_G1 0xA001 236#define NOVATELWIRELESS_PRODUCT_G1 0xA001
237#define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 237#define NOVATELWIRELESS_PRODUCT_G1_M 0xA002
238#define NOVATELWIRELESS_PRODUCT_G2 0xA010 238#define NOVATELWIRELESS_PRODUCT_G2 0xA010
239#define NOVATELWIRELESS_PRODUCT_MC551 0xB001
239 240
240/* AMOI PRODUCTS */ 241/* AMOI PRODUCTS */
241#define AMOI_VENDOR_ID 0x1614 242#define AMOI_VENDOR_ID 0x1614
@@ -497,6 +498,10 @@ static void option_instat_callback(struct urb *urb);
497/* MediaTek products */ 498/* MediaTek products */
498#define MEDIATEK_VENDOR_ID 0x0e8d 499#define MEDIATEK_VENDOR_ID 0x0e8d
499 500
501/* Cellient products */
502#define CELLIENT_VENDOR_ID 0x2692
503#define CELLIENT_PRODUCT_MEN200 0x9005
504
500/* some devices interfaces need special handling due to a number of reasons */ 505/* some devices interfaces need special handling due to a number of reasons */
501enum option_blacklist_reason { 506enum option_blacklist_reason {
502 OPTION_BLACKLIST_NONE = 0, 507 OPTION_BLACKLIST_NONE = 0,
@@ -734,6 +739,8 @@ static const struct usb_device_id option_ids[] = {
734 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, 739 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) },
735 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, 740 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) },
736 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, 741 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) },
742 /* Novatel Ovation MC551 a.k.a. Verizon USB551L */
743 { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC551, 0xff, 0xff, 0xff) },
737 744
738 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, 745 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
739 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, 746 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
@@ -1233,6 +1240,7 @@ static const struct usb_device_id option_ids[] = {
1233 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) }, 1240 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a1, 0xff, 0x02, 0x01) },
1234 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) }, 1241 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x00, 0x00) },
1235 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */ 1242 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x00a2, 0xff, 0x02, 0x01) }, /* MediaTek MT6276M modem & app port */
1243 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
1236 { } /* Terminating entry */ 1244 { } /* Terminating entry */
1237}; 1245};
1238MODULE_DEVICE_TABLE(usb, option_ids); 1246MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index a324a5d21e99..11418da9bc09 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -202,6 +202,12 @@ static int slave_configure(struct scsi_device *sdev)
202 if (us->fflags & US_FL_NO_READ_CAPACITY_16) 202 if (us->fflags & US_FL_NO_READ_CAPACITY_16)
203 sdev->no_read_capacity_16 = 1; 203 sdev->no_read_capacity_16 = 1;
204 204
205 /*
206 * Many devices do not respond properly to READ_CAPACITY_16.
207 * Tell the SCSI layer to try READ_CAPACITY_10 first.
208 */
209 sdev->try_rc_10_first = 1;
210
205 /* assume SPC3 or latter devices support sense size > 18 */ 211 /* assume SPC3 or latter devices support sense size > 18 */
206 if (sdev->scsi_level > SCSI_SPC_2) 212 if (sdev->scsi_level > SCSI_SPC_2)
207 us->fflags |= US_FL_SANE_SENSE; 213 us->fflags |= US_FL_SANE_SENSE;
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index caf22bf5f822..1719886bb9be 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1107,13 +1107,6 @@ UNUSUAL_DEV( 0x090a, 0x1200, 0x0000, 0x9999,
1107 USB_SC_RBC, USB_PR_BULK, NULL, 1107 USB_SC_RBC, USB_PR_BULK, NULL,
1108 0 ), 1108 0 ),
1109 1109
1110/* Feiya QDI U2 DISK, reported by Hans de Goede <hdegoede@redhat.com> */
1111UNUSUAL_DEV( 0x090c, 0x1000, 0x0000, 0xffff,
1112 "Feiya",
1113 "QDI U2 DISK",
1114 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1115 US_FL_NO_READ_CAPACITY_16 ),
1116
1117/* aeb */ 1110/* aeb */
1118UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff, 1111UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff,
1119 "Feiya", 1112 "Feiya",
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 94dbd25caa30..112156f68afb 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -191,7 +191,9 @@ static int vhost_worker(void *data)
191 struct vhost_dev *dev = data; 191 struct vhost_dev *dev = data;
192 struct vhost_work *work = NULL; 192 struct vhost_work *work = NULL;
193 unsigned uninitialized_var(seq); 193 unsigned uninitialized_var(seq);
194 mm_segment_t oldfs = get_fs();
194 195
196 set_fs(USER_DS);
195 use_mm(dev->mm); 197 use_mm(dev->mm);
196 198
197 for (;;) { 199 for (;;) {
@@ -229,6 +231,7 @@ static int vhost_worker(void *data)
229 231
230 } 232 }
231 unuse_mm(dev->mm); 233 unuse_mm(dev->mm);
234 set_fs(oldfs);
232 return 0; 235 return 0;
233} 236}
234 237
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 2b763815aeec..1eff743ec497 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -146,7 +146,7 @@ struct cmn_registers {
146} __attribute__((packed)); 146} __attribute__((packed));
147 147
148static unsigned int hpwdt_nmi_decoding; 148static unsigned int hpwdt_nmi_decoding;
149static unsigned int allow_kdump; 149static unsigned int allow_kdump = 1;
150static unsigned int is_icru; 150static unsigned int is_icru;
151static DEFINE_SPINLOCK(rom_lock); 151static DEFINE_SPINLOCK(rom_lock);
152static void *cru_rom_addr; 152static void *cru_rom_addr;
@@ -756,6 +756,8 @@ error:
756static void hpwdt_exit_nmi_decoding(void) 756static void hpwdt_exit_nmi_decoding(void)
757{ 757{
758 unregister_nmi_handler(NMI_UNKNOWN, "hpwdt"); 758 unregister_nmi_handler(NMI_UNKNOWN, "hpwdt");
759 unregister_nmi_handler(NMI_SERR, "hpwdt");
760 unregister_nmi_handler(NMI_IO_CHECK, "hpwdt");
759 if (cru_rom_addr) 761 if (cru_rom_addr)
760 iounmap(cru_rom_addr); 762 iounmap(cru_rom_addr);
761} 763}
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index bc47e9012f37..9c2c27c3b424 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -699,3 +699,4 @@ MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver");
699MODULE_VERSION(DRV_VERSION); 699MODULE_VERSION(DRV_VERSION);
700MODULE_LICENSE("GPL"); 700MODULE_LICENSE("GPL");
701MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 701MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
702MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 672d169bf1da..ef8edecfc526 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -349,7 +349,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
349 sizeof(struct watchdog_info)) ? -EFAULT : 0; 349 sizeof(struct watchdog_info)) ? -EFAULT : 0;
350 case WDIOC_GETSTATUS: 350 case WDIOC_GETSTATUS:
351 err = watchdog_get_status(wdd, &val); 351 err = watchdog_get_status(wdd, &val);
352 if (err) 352 if (err == -ENODEV)
353 return err; 353 return err;
354 return put_user(val, p); 354 return put_user(val, p);
355 case WDIOC_GETBOOTSTATUS: 355 case WDIOC_GETBOOTSTATUS:
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 84a7e6f3c046..92df3b081539 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2918,7 +2918,7 @@ int dbg_debugfs_init_fs(struct ubifs_info *c)
2918 struct dentry *dent; 2918 struct dentry *dent;
2919 struct ubifs_debug_info *d = c->dbg; 2919 struct ubifs_debug_info *d = c->dbg;
2920 2920
2921 if (!IS_ENABLED(DEBUG_FS)) 2921 if (!IS_ENABLED(CONFIG_DEBUG_FS))
2922 return 0; 2922 return 0;
2923 2923
2924 n = snprintf(d->dfs_dir_name, UBIFS_DFS_DIR_LEN + 1, UBIFS_DFS_DIR_NAME, 2924 n = snprintf(d->dfs_dir_name, UBIFS_DFS_DIR_LEN + 1, UBIFS_DFS_DIR_NAME,
@@ -3013,7 +3013,7 @@ out:
3013 */ 3013 */
3014void dbg_debugfs_exit_fs(struct ubifs_info *c) 3014void dbg_debugfs_exit_fs(struct ubifs_info *c)
3015{ 3015{
3016 if (IS_ENABLED(DEBUG_FS)) 3016 if (IS_ENABLED(CONFIG_DEBUG_FS))
3017 debugfs_remove_recursive(c->dbg->dfs_dir); 3017 debugfs_remove_recursive(c->dbg->dfs_dir);
3018} 3018}
3019 3019
@@ -3099,7 +3099,7 @@ int dbg_debugfs_init(void)
3099 const char *fname; 3099 const char *fname;
3100 struct dentry *dent; 3100 struct dentry *dent;
3101 3101
3102 if (!IS_ENABLED(DEBUG_FS)) 3102 if (!IS_ENABLED(CONFIG_DEBUG_FS))
3103 return 0; 3103 return 0;
3104 3104
3105 fname = "ubifs"; 3105 fname = "ubifs";
@@ -3166,7 +3166,7 @@ out:
3166 */ 3166 */
3167void dbg_debugfs_exit(void) 3167void dbg_debugfs_exit(void)
3168{ 3168{
3169 if (IS_ENABLED(DEBUG_FS)) 3169 if (IS_ENABLED(CONFIG_DEBUG_FS))
3170 debugfs_remove_recursive(dfs_rootdir); 3170 debugfs_remove_recursive(dfs_rootdir);
3171} 3171}
3172 3172
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c
index 2559d174e004..28ec13af28d9 100644
--- a/fs/ubifs/find.c
+++ b/fs/ubifs/find.c
@@ -939,8 +939,8 @@ static int find_dirtiest_idx_leb(struct ubifs_info *c)
939 } 939 }
940 dbg_find("LEB %d, dirty %d and free %d flags %#x", lp->lnum, lp->dirty, 940 dbg_find("LEB %d, dirty %d and free %d flags %#x", lp->lnum, lp->dirty,
941 lp->free, lp->flags); 941 lp->free, lp->flags);
942 ubifs_assert(lp->flags | LPROPS_TAKEN); 942 ubifs_assert(lp->flags & LPROPS_TAKEN);
943 ubifs_assert(lp->flags | LPROPS_INDEX); 943 ubifs_assert(lp->flags & LPROPS_INDEX);
944 return lnum; 944 return lnum;
945} 945}
946 946
diff --git a/fs/udf/super.c b/fs/udf/super.c
index ac8a348dcb69..8d86a8706c0e 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -56,6 +56,7 @@
56#include <linux/seq_file.h> 56#include <linux/seq_file.h>
57#include <linux/bitmap.h> 57#include <linux/bitmap.h>
58#include <linux/crc-itu-t.h> 58#include <linux/crc-itu-t.h>
59#include <linux/log2.h>
59#include <asm/byteorder.h> 60#include <asm/byteorder.h>
60 61
61#include "udf_sb.h" 62#include "udf_sb.h"
@@ -1215,16 +1216,65 @@ out_bh:
1215 return ret; 1216 return ret;
1216} 1217}
1217 1218
1219static int udf_load_sparable_map(struct super_block *sb,
1220 struct udf_part_map *map,
1221 struct sparablePartitionMap *spm)
1222{
1223 uint32_t loc;
1224 uint16_t ident;
1225 struct sparingTable *st;
1226 struct udf_sparing_data *sdata = &map->s_type_specific.s_sparing;
1227 int i;
1228 struct buffer_head *bh;
1229
1230 map->s_partition_type = UDF_SPARABLE_MAP15;
1231 sdata->s_packet_len = le16_to_cpu(spm->packetLength);
1232 if (!is_power_of_2(sdata->s_packet_len)) {
1233 udf_err(sb, "error loading logical volume descriptor: "
1234 "Invalid packet length %u\n",
1235 (unsigned)sdata->s_packet_len);
1236 return -EIO;
1237 }
1238 if (spm->numSparingTables > 4) {
1239 udf_err(sb, "error loading logical volume descriptor: "
1240 "Too many sparing tables (%d)\n",
1241 (int)spm->numSparingTables);
1242 return -EIO;
1243 }
1244
1245 for (i = 0; i < spm->numSparingTables; i++) {
1246 loc = le32_to_cpu(spm->locSparingTable[i]);
1247 bh = udf_read_tagged(sb, loc, loc, &ident);
1248 if (!bh)
1249 continue;
1250
1251 st = (struct sparingTable *)bh->b_data;
1252 if (ident != 0 ||
1253 strncmp(st->sparingIdent.ident, UDF_ID_SPARING,
1254 strlen(UDF_ID_SPARING)) ||
1255 sizeof(*st) + le16_to_cpu(st->reallocationTableLen) >
1256 sb->s_blocksize) {
1257 brelse(bh);
1258 continue;
1259 }
1260
1261 sdata->s_spar_map[i] = bh;
1262 }
1263 map->s_partition_func = udf_get_pblock_spar15;
1264 return 0;
1265}
1266
1218static int udf_load_logicalvol(struct super_block *sb, sector_t block, 1267static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1219 struct kernel_lb_addr *fileset) 1268 struct kernel_lb_addr *fileset)
1220{ 1269{
1221 struct logicalVolDesc *lvd; 1270 struct logicalVolDesc *lvd;
1222 int i, j, offset; 1271 int i, offset;
1223 uint8_t type; 1272 uint8_t type;
1224 struct udf_sb_info *sbi = UDF_SB(sb); 1273 struct udf_sb_info *sbi = UDF_SB(sb);
1225 struct genericPartitionMap *gpm; 1274 struct genericPartitionMap *gpm;
1226 uint16_t ident; 1275 uint16_t ident;
1227 struct buffer_head *bh; 1276 struct buffer_head *bh;
1277 unsigned int table_len;
1228 int ret = 0; 1278 int ret = 0;
1229 1279
1230 bh = udf_read_tagged(sb, block, block, &ident); 1280 bh = udf_read_tagged(sb, block, block, &ident);
@@ -1232,15 +1282,20 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1232 return 1; 1282 return 1;
1233 BUG_ON(ident != TAG_IDENT_LVD); 1283 BUG_ON(ident != TAG_IDENT_LVD);
1234 lvd = (struct logicalVolDesc *)bh->b_data; 1284 lvd = (struct logicalVolDesc *)bh->b_data;
1235 1285 table_len = le32_to_cpu(lvd->mapTableLength);
1236 i = udf_sb_alloc_partition_maps(sb, le32_to_cpu(lvd->numPartitionMaps)); 1286 if (sizeof(*lvd) + table_len > sb->s_blocksize) {
1237 if (i != 0) { 1287 udf_err(sb, "error loading logical volume descriptor: "
1238 ret = i; 1288 "Partition table too long (%u > %lu)\n", table_len,
1289 sb->s_blocksize - sizeof(*lvd));
1239 goto out_bh; 1290 goto out_bh;
1240 } 1291 }
1241 1292
1293 ret = udf_sb_alloc_partition_maps(sb, le32_to_cpu(lvd->numPartitionMaps));
1294 if (ret)
1295 goto out_bh;
1296
1242 for (i = 0, offset = 0; 1297 for (i = 0, offset = 0;
1243 i < sbi->s_partitions && offset < le32_to_cpu(lvd->mapTableLength); 1298 i < sbi->s_partitions && offset < table_len;
1244 i++, offset += gpm->partitionMapLength) { 1299 i++, offset += gpm->partitionMapLength) {
1245 struct udf_part_map *map = &sbi->s_partmaps[i]; 1300 struct udf_part_map *map = &sbi->s_partmaps[i];
1246 gpm = (struct genericPartitionMap *) 1301 gpm = (struct genericPartitionMap *)
@@ -1275,38 +1330,9 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
1275 } else if (!strncmp(upm2->partIdent.ident, 1330 } else if (!strncmp(upm2->partIdent.ident,
1276 UDF_ID_SPARABLE, 1331 UDF_ID_SPARABLE,
1277 strlen(UDF_ID_SPARABLE))) { 1332 strlen(UDF_ID_SPARABLE))) {
1278 uint32_t loc; 1333 if (udf_load_sparable_map(sb, map,
1279 struct sparingTable *st; 1334 (struct sparablePartitionMap *)gpm) < 0)
1280 struct sparablePartitionMap *spm = 1335 goto out_bh;
1281 (struct sparablePartitionMap *)gpm;
1282
1283 map->s_partition_type = UDF_SPARABLE_MAP15;
1284 map->s_type_specific.s_sparing.s_packet_len =
1285 le16_to_cpu(spm->packetLength);
1286 for (j = 0; j < spm->numSparingTables; j++) {
1287 struct buffer_head *bh2;
1288
1289 loc = le32_to_cpu(
1290 spm->locSparingTable[j]);
1291 bh2 = udf_read_tagged(sb, loc, loc,
1292 &ident);
1293 map->s_type_specific.s_sparing.
1294 s_spar_map[j] = bh2;
1295
1296 if (bh2 == NULL)
1297 continue;
1298
1299 st = (struct sparingTable *)bh2->b_data;
1300 if (ident != 0 || strncmp(
1301 st->sparingIdent.ident,
1302 UDF_ID_SPARING,
1303 strlen(UDF_ID_SPARING))) {
1304 brelse(bh2);
1305 map->s_type_specific.s_sparing.
1306 s_spar_map[j] = NULL;
1307 }
1308 }
1309 map->s_partition_func = udf_get_pblock_spar15;
1310 } else if (!strncmp(upm2->partIdent.ident, 1336 } else if (!strncmp(upm2->partIdent.ident,
1311 UDF_ID_METADATA, 1337 UDF_ID_METADATA,
1312 strlen(UDF_ID_METADATA))) { 1338 strlen(UDF_ID_METADATA))) {
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 506ec19a3736..7d10f962aa13 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -3,10 +3,18 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5 5
6#ifdef CONFIG_GENERIC_BUG
7#define BUGFLAG_WARNING (1 << 0)
8#define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8))
9#define BUG_GET_TAINT(bug) ((bug)->flags >> 8)
10#endif
11
12#ifndef __ASSEMBLY__
13#include <linux/kernel.h>
14
6#ifdef CONFIG_BUG 15#ifdef CONFIG_BUG
7 16
8#ifdef CONFIG_GENERIC_BUG 17#ifdef CONFIG_GENERIC_BUG
9#ifndef __ASSEMBLY__
10struct bug_entry { 18struct bug_entry {
11#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS 19#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
12 unsigned long bug_addr; 20 unsigned long bug_addr;
@@ -23,17 +31,8 @@ struct bug_entry {
23#endif 31#endif
24 unsigned short flags; 32 unsigned short flags;
25}; 33};
26#endif /* __ASSEMBLY__ */
27
28#define BUGFLAG_WARNING (1 << 0)
29#define BUGFLAG_TAINT(taint) (BUGFLAG_WARNING | ((taint) << 8))
30#define BUG_GET_TAINT(bug) ((bug)->flags >> 8)
31
32#endif /* CONFIG_GENERIC_BUG */ 34#endif /* CONFIG_GENERIC_BUG */
33 35
34#ifndef __ASSEMBLY__
35#include <linux/kernel.h>
36
37/* 36/*
38 * Don't use BUG() or BUG_ON() unless there's really no way out; one 37 * Don't use BUG() or BUG_ON() unless there's really no way out; one
39 * example might be detecting data structure corruption in the middle 38 * example might be detecting data structure corruption in the middle
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 61f5cec031e0..a5261e3d2e3c 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -301,8 +301,6 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
301 * @irq_pm_shutdown: function called from core code on shutdown once per chip 301 * @irq_pm_shutdown: function called from core code on shutdown once per chip
302 * @irq_print_chip: optional to print special chip info in show_interrupts 302 * @irq_print_chip: optional to print special chip info in show_interrupts
303 * @flags: chip specific flags 303 * @flags: chip specific flags
304 *
305 * @release: release function solely used by UML
306 */ 304 */
307struct irq_chip { 305struct irq_chip {
308 const char *name; 306 const char *name;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b534a1be540a..642cb7355df3 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -225,14 +225,11 @@ enum {
225 /* device driver is going to provide hardware time stamp */ 225 /* device driver is going to provide hardware time stamp */
226 SKBTX_IN_PROGRESS = 1 << 2, 226 SKBTX_IN_PROGRESS = 1 << 2,
227 227
228 /* ensure the originating sk reference is available on driver level */
229 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
230
231 /* device driver supports TX zero-copy buffers */ 228 /* device driver supports TX zero-copy buffers */
232 SKBTX_DEV_ZEROCOPY = 1 << 4, 229 SKBTX_DEV_ZEROCOPY = 1 << 3,
233 230
234 /* generate wifi status information (where possible) */ 231 /* generate wifi status information (where possible) */
235 SKBTX_WIFI_STATUS = 1 << 5, 232 SKBTX_WIFI_STATUS = 1 << 4,
236}; 233};
237 234
238/* 235/*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 370d11106c11..2039c5d3292e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2640,9 +2640,9 @@ struct v4l2_create_buffers {
2640 2640
2641/* Experimental, these three ioctls may change over the next couple of kernel 2641/* Experimental, these three ioctls may change over the next couple of kernel
2642 versions. */ 2642 versions. */
2643#define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 96, struct v4l2_enum_dv_timings) 2643#define VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
2644#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 97, struct v4l2_dv_timings) 2644#define VIDIOC_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
2645#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 98, struct v4l2_dv_timings_cap) 2645#define VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
2646 2646
2647/* Reminder: when adding new ioctls please add support for them to 2647/* Reminder: when adding new ioctls please add support for them to
2648 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 2648 drivers/media/video/v4l2-compat-ioctl32.c as well! */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 66a7b579e31c..3def64ba77fa 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1144,6 +1144,12 @@ struct extended_inquiry_info {
1144 __u8 data[240]; 1144 __u8 data[240];
1145} __packed; 1145} __packed;
1146 1146
1147#define HCI_EV_KEY_REFRESH_COMPLETE 0x30
1148struct hci_ev_key_refresh_complete {
1149 __u8 status;
1150 __le16 handle;
1151} __packed;
1152
1147#define HCI_EV_IO_CAPA_REQUEST 0x31 1153#define HCI_EV_IO_CAPA_REQUEST 0x31
1148struct hci_ev_io_capa_request { 1154struct hci_ev_io_capa_request {
1149 bdaddr_t bdaddr; 1155 bdaddr_t bdaddr;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 1937c7d98304..95e39b6a02ec 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1940,6 +1940,11 @@ enum ieee80211_rate_control_changed {
1940 * to also unregister the device. If it returns 1, then mac80211 1940 * to also unregister the device. If it returns 1, then mac80211
1941 * will also go through the regular complete restart on resume. 1941 * will also go through the regular complete restart on resume.
1942 * 1942 *
1943 * @set_wakeup: Enable or disable wakeup when WoWLAN configuration is
1944 * modified. The reason is that device_set_wakeup_enable() is
1945 * supposed to be called when the configuration changes, not only
1946 * in suspend().
1947 *
1943 * @add_interface: Called when a netdevice attached to the hardware is 1948 * @add_interface: Called when a netdevice attached to the hardware is
1944 * enabled. Because it is not called for monitor mode devices, @start 1949 * enabled. Because it is not called for monitor mode devices, @start
1945 * and @stop must be implemented. 1950 * and @stop must be implemented.
@@ -2966,6 +2971,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
2966 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 2971 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
2967 * @hw: pointer obtained from ieee80211_alloc_hw(). 2972 * @hw: pointer obtained from ieee80211_alloc_hw().
2968 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2973 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2974 * @band: the band to calculate the frame duration on
2969 * @frame_len: the length of the frame. 2975 * @frame_len: the length of the frame.
2970 * @rate: the rate at which the frame is going to be transmitted. 2976 * @rate: the rate at which the frame is going to be transmitted.
2971 * 2977 *
diff --git a/include/net/phonet/gprs.h b/include/net/phonet/gprs.h
index 928daf595beb..bcd525e39a0b 100644
--- a/include/net/phonet/gprs.h
+++ b/include/net/phonet/gprs.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 6efb2e1416e0..ba9698852321 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -151,6 +151,7 @@ struct scsi_device {
151 SD_LAST_BUGGY_SECTORS */ 151 SD_LAST_BUGGY_SECTORS */
152 unsigned no_read_disc_info:1; /* Avoid READ_DISC_INFO cmds */ 152 unsigned no_read_disc_info:1; /* Avoid READ_DISC_INFO cmds */
153 unsigned no_read_capacity_16:1; /* Avoid READ_CAPACITY_16 cmds */ 153 unsigned no_read_capacity_16:1; /* Avoid READ_CAPACITY_16 cmds */
154 unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */
154 unsigned is_visible:1; /* is the device visible in sysfs */ 155 unsigned is_visible:1; /* is the device visible in sysfs */
155 156
156 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 157 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index ec3f910aa40b..0c3c2fb0f939 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -44,6 +44,7 @@ struct snd_tea575x_ops {
44 44
45struct snd_tea575x { 45struct snd_tea575x {
46 struct v4l2_device *v4l2_dev; 46 struct v4l2_device *v4l2_dev;
47 struct v4l2_file_operations fops;
47 struct video_device vd; /* video device */ 48 struct video_device vd; /* video device */
48 int radio_nr; /* radio_nr */ 49 int radio_nr; /* radio_nr */
49 bool tea5759; /* 5759 chip is present */ 50 bool tea5759; /* 5759 chip is present */
@@ -62,7 +63,7 @@ struct snd_tea575x {
62 int (*ext_init)(struct snd_tea575x *tea); 63 int (*ext_init)(struct snd_tea575x *tea);
63}; 64};
64 65
65int snd_tea575x_init(struct snd_tea575x *tea); 66int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
66void snd_tea575x_exit(struct snd_tea575x *tea); 67void snd_tea575x_exit(struct snd_tea575x *tea);
67 68
68#endif /* __SOUND_TEA575X_TUNER_H */ 69#endif /* __SOUND_TEA575X_TUNER_H */
diff --git a/kernel/printk.c b/kernel/printk.c
index a2276b916769..dba18211685e 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -193,12 +193,19 @@ static int console_may_schedule;
193 * separated by ',', and find the message after the ';' character. 193 * separated by ',', and find the message after the ';' character.
194 */ 194 */
195 195
196enum log_flags {
197 LOG_DEFAULT = 0,
198 LOG_NOCONS = 1, /* already flushed, do not print to console */
199};
200
196struct log { 201struct log {
197 u64 ts_nsec; /* timestamp in nanoseconds */ 202 u64 ts_nsec; /* timestamp in nanoseconds */
198 u16 len; /* length of entire record */ 203 u16 len; /* length of entire record */
199 u16 text_len; /* length of text buffer */ 204 u16 text_len; /* length of text buffer */
200 u16 dict_len; /* length of dictionary buffer */ 205 u16 dict_len; /* length of dictionary buffer */
201 u16 level; /* syslog level + facility */ 206 u8 facility; /* syslog facility */
207 u8 flags:5; /* internal record flags */
208 u8 level:3; /* syslog level */
202}; 209};
203 210
204/* 211/*
@@ -286,6 +293,7 @@ static u32 log_next(u32 idx)
286 293
287/* insert record into the buffer, discard old ones, update heads */ 294/* insert record into the buffer, discard old ones, update heads */
288static void log_store(int facility, int level, 295static void log_store(int facility, int level,
296 enum log_flags flags, u64 ts_nsec,
289 const char *dict, u16 dict_len, 297 const char *dict, u16 dict_len,
290 const char *text, u16 text_len) 298 const char *text, u16 text_len)
291{ 299{
@@ -329,8 +337,13 @@ static void log_store(int facility, int level,
329 msg->text_len = text_len; 337 msg->text_len = text_len;
330 memcpy(log_dict(msg), dict, dict_len); 338 memcpy(log_dict(msg), dict, dict_len);
331 msg->dict_len = dict_len; 339 msg->dict_len = dict_len;
332 msg->level = (facility << 3) | (level & 7); 340 msg->facility = facility;
333 msg->ts_nsec = local_clock(); 341 msg->level = level & 7;
342 msg->flags = flags & 0x1f;
343 if (ts_nsec > 0)
344 msg->ts_nsec = ts_nsec;
345 else
346 msg->ts_nsec = local_clock();
334 memset(log_dict(msg) + dict_len, 0, pad_len); 347 memset(log_dict(msg) + dict_len, 0, pad_len);
335 msg->len = sizeof(struct log) + text_len + dict_len + pad_len; 348 msg->len = sizeof(struct log) + text_len + dict_len + pad_len;
336 349
@@ -446,7 +459,7 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf,
446 ts_usec = msg->ts_nsec; 459 ts_usec = msg->ts_nsec;
447 do_div(ts_usec, 1000); 460 do_div(ts_usec, 1000);
448 len = sprintf(user->buf, "%u,%llu,%llu;", 461 len = sprintf(user->buf, "%u,%llu,%llu;",
449 msg->level, user->seq, ts_usec); 462 (msg->facility << 3) | msg->level, user->seq, ts_usec);
450 463
451 /* escape non-printable characters */ 464 /* escape non-printable characters */
452 for (i = 0; i < msg->text_len; i++) { 465 for (i = 0; i < msg->text_len; i++) {
@@ -787,6 +800,21 @@ static bool printk_time;
787#endif 800#endif
788module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR); 801module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
789 802
803static size_t print_time(u64 ts, char *buf)
804{
805 unsigned long rem_nsec;
806
807 if (!printk_time)
808 return 0;
809
810 if (!buf)
811 return 15;
812
813 rem_nsec = do_div(ts, 1000000000);
814 return sprintf(buf, "[%5lu.%06lu] ",
815 (unsigned long)ts, rem_nsec / 1000);
816}
817
790static size_t print_prefix(const struct log *msg, bool syslog, char *buf) 818static size_t print_prefix(const struct log *msg, bool syslog, char *buf)
791{ 819{
792 size_t len = 0; 820 size_t len = 0;
@@ -803,18 +831,7 @@ static size_t print_prefix(const struct log *msg, bool syslog, char *buf)
803 } 831 }
804 } 832 }
805 833
806 if (printk_time) { 834 len += print_time(msg->ts_nsec, buf ? buf + len : NULL);
807 if (buf) {
808 unsigned long long ts = msg->ts_nsec;
809 unsigned long rem_nsec = do_div(ts, 1000000000);
810
811 len += sprintf(buf + len, "[%5lu.%06lu] ",
812 (unsigned long) ts, rem_nsec / 1000);
813 } else {
814 len += 15;
815 }
816 }
817
818 return len; 835 return len;
819} 836}
820 837
@@ -862,28 +879,49 @@ static int syslog_print(char __user *buf, int size)
862{ 879{
863 char *text; 880 char *text;
864 struct log *msg; 881 struct log *msg;
865 int len; 882 int len = 0;
866 883
867 text = kmalloc(LOG_LINE_MAX, GFP_KERNEL); 884 text = kmalloc(LOG_LINE_MAX, GFP_KERNEL);
868 if (!text) 885 if (!text)
869 return -ENOMEM; 886 return -ENOMEM;
870 887
871 raw_spin_lock_irq(&logbuf_lock); 888 while (size > 0) {
872 if (syslog_seq < log_first_seq) { 889 size_t n;
873 /* messages are gone, move to first one */
874 syslog_seq = log_first_seq;
875 syslog_idx = log_first_idx;
876 }
877 msg = log_from_idx(syslog_idx);
878 len = msg_print_text(msg, true, text, LOG_LINE_MAX);
879 syslog_idx = log_next(syslog_idx);
880 syslog_seq++;
881 raw_spin_unlock_irq(&logbuf_lock);
882 890
883 if (len > size) 891 raw_spin_lock_irq(&logbuf_lock);
884 len = -EINVAL; 892 if (syslog_seq < log_first_seq) {
885 else if (len > 0 && copy_to_user(buf, text, len)) 893 /* messages are gone, move to first one */
886 len = -EFAULT; 894 syslog_seq = log_first_seq;
895 syslog_idx = log_first_idx;
896 }
897 if (syslog_seq == log_next_seq) {
898 raw_spin_unlock_irq(&logbuf_lock);
899 break;
900 }
901 msg = log_from_idx(syslog_idx);
902 n = msg_print_text(msg, true, text, LOG_LINE_MAX);
903 if (n <= size) {
904 syslog_idx = log_next(syslog_idx);
905 syslog_seq++;
906 } else
907 n = 0;
908 raw_spin_unlock_irq(&logbuf_lock);
909
910 if (!n)
911 break;
912
913 len += n;
914 size -= n;
915 buf += n;
916 n = copy_to_user(buf - n, text, n);
917
918 if (n) {
919 len -= n;
920 if (!len)
921 len = -EFAULT;
922 break;
923 }
924 }
887 925
888 kfree(text); 926 kfree(text);
889 return len; 927 return len;
@@ -1040,6 +1078,7 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
1040 /* Clear ring buffer */ 1078 /* Clear ring buffer */
1041 case SYSLOG_ACTION_CLEAR: 1079 case SYSLOG_ACTION_CLEAR:
1042 syslog_print_all(NULL, 0, true); 1080 syslog_print_all(NULL, 0, true);
1081 break;
1043 /* Disable logging to console */ 1082 /* Disable logging to console */
1044 case SYSLOG_ACTION_CONSOLE_OFF: 1083 case SYSLOG_ACTION_CONSOLE_OFF:
1045 if (saved_console_loglevel == -1) 1084 if (saved_console_loglevel == -1)
@@ -1272,15 +1311,92 @@ static inline void printk_delay(void)
1272 } 1311 }
1273} 1312}
1274 1313
1314/*
1315 * Continuation lines are buffered, and not committed to the record buffer
1316 * until the line is complete, or a race forces it. The line fragments
1317 * though, are printed immediately to the consoles to ensure everything has
1318 * reached the console in case of a kernel crash.
1319 */
1320static struct cont {
1321 char buf[LOG_LINE_MAX];
1322 size_t len; /* length == 0 means unused buffer */
1323 size_t cons; /* bytes written to console */
1324 struct task_struct *owner; /* task of first print*/
1325 u64 ts_nsec; /* time of first print */
1326 u8 level; /* log level of first message */
1327 u8 facility; /* log level of first message */
1328 bool flushed:1; /* buffer sealed and committed */
1329} cont;
1330
1331static void cont_flush(void)
1332{
1333 if (cont.flushed)
1334 return;
1335 if (cont.len == 0)
1336 return;
1337
1338 log_store(cont.facility, cont.level, LOG_NOCONS, cont.ts_nsec,
1339 NULL, 0, cont.buf, cont.len);
1340
1341 cont.flushed = true;
1342}
1343
1344static bool cont_add(int facility, int level, const char *text, size_t len)
1345{
1346 if (cont.len && cont.flushed)
1347 return false;
1348
1349 if (cont.len + len > sizeof(cont.buf)) {
1350 cont_flush();
1351 return false;
1352 }
1353
1354 if (!cont.len) {
1355 cont.facility = facility;
1356 cont.level = level;
1357 cont.owner = current;
1358 cont.ts_nsec = local_clock();
1359 cont.cons = 0;
1360 cont.flushed = false;
1361 }
1362
1363 memcpy(cont.buf + cont.len, text, len);
1364 cont.len += len;
1365 return true;
1366}
1367
1368static size_t cont_print_text(char *text, size_t size)
1369{
1370 size_t textlen = 0;
1371 size_t len;
1372
1373 if (cont.cons == 0) {
1374 textlen += print_time(cont.ts_nsec, text);
1375 size -= textlen;
1376 }
1377
1378 len = cont.len - cont.cons;
1379 if (len > 0) {
1380 if (len+1 > size)
1381 len = size-1;
1382 memcpy(text + textlen, cont.buf + cont.cons, len);
1383 textlen += len;
1384 cont.cons = cont.len;
1385 }
1386
1387 if (cont.flushed) {
1388 text[textlen++] = '\n';
1389 /* got everything, release buffer */
1390 cont.len = 0;
1391 }
1392 return textlen;
1393}
1394
1275asmlinkage int vprintk_emit(int facility, int level, 1395asmlinkage int vprintk_emit(int facility, int level,
1276 const char *dict, size_t dictlen, 1396 const char *dict, size_t dictlen,
1277 const char *fmt, va_list args) 1397 const char *fmt, va_list args)
1278{ 1398{
1279 static int recursion_bug; 1399 static int recursion_bug;
1280 static char cont_buf[LOG_LINE_MAX];
1281 static size_t cont_len;
1282 static int cont_level;
1283 static struct task_struct *cont_task;
1284 static char textbuf[LOG_LINE_MAX]; 1400 static char textbuf[LOG_LINE_MAX];
1285 char *text = textbuf; 1401 char *text = textbuf;
1286 size_t text_len; 1402 size_t text_len;
@@ -1326,7 +1442,8 @@ asmlinkage int vprintk_emit(int facility, int level,
1326 recursion_bug = 0; 1442 recursion_bug = 0;
1327 printed_len += strlen(recursion_msg); 1443 printed_len += strlen(recursion_msg);
1328 /* emit KERN_CRIT message */ 1444 /* emit KERN_CRIT message */
1329 log_store(0, 2, NULL, 0, recursion_msg, printed_len); 1445 log_store(0, 2, LOG_DEFAULT, 0,
1446 NULL, 0, recursion_msg, printed_len);
1330 } 1447 }
1331 1448
1332 /* 1449 /*
@@ -1364,55 +1481,37 @@ asmlinkage int vprintk_emit(int facility, int level,
1364 } 1481 }
1365 1482
1366 if (!newline) { 1483 if (!newline) {
1367 if (cont_len && (prefix || cont_task != current)) { 1484 /*
1368 /* 1485 * Flush the conflicting buffer. An earlier newline was missing,
1369 * Flush earlier buffer, which is either from a 1486 * or another task also prints continuation lines.
1370 * different thread, or when we got a new prefix. 1487 */
1371 */ 1488 if (cont.len && (prefix || cont.owner != current))
1372 log_store(facility, cont_level, NULL, 0, cont_buf, cont_len); 1489 cont_flush();
1373 cont_len = 0;
1374 }
1375
1376 if (!cont_len) {
1377 cont_level = level;
1378 cont_task = current;
1379 }
1380 1490
1381 /* buffer or append to earlier buffer from the same thread */ 1491 /* buffer line if possible, otherwise store it right away */
1382 if (cont_len + text_len > sizeof(cont_buf)) 1492 if (!cont_add(facility, level, text, text_len))
1383 text_len = sizeof(cont_buf) - cont_len; 1493 log_store(facility, level, LOG_DEFAULT, 0,
1384 memcpy(cont_buf + cont_len, text, text_len); 1494 dict, dictlen, text, text_len);
1385 cont_len += text_len;
1386 } else { 1495 } else {
1387 if (cont_len && cont_task == current) { 1496 bool stored = false;
1388 if (prefix) {
1389 /*
1390 * New prefix from the same thread; flush. We
1391 * either got no earlier newline, or we race
1392 * with an interrupt.
1393 */
1394 log_store(facility, cont_level,
1395 NULL, 0, cont_buf, cont_len);
1396 cont_len = 0;
1397 }
1398 1497
1399 /* append to the earlier buffer and flush */ 1498 /*
1400 if (cont_len + text_len > sizeof(cont_buf)) 1499 * If an earlier newline was missing and it was the same task,
1401 text_len = sizeof(cont_buf) - cont_len; 1500 * either merge it with the current buffer and flush, or if
1402 memcpy(cont_buf + cont_len, text, text_len); 1501 * there was a race with interrupts (prefix == true) then just
1403 cont_len += text_len; 1502 * flush it out and store this line separately.
1404 log_store(facility, cont_level, 1503 */
1405 NULL, 0, cont_buf, cont_len); 1504 if (cont.len && cont.owner == current) {
1406 cont_len = 0; 1505 if (!prefix)
1407 cont_task = NULL; 1506 stored = cont_add(facility, level, text, text_len);
1408 printed_len = cont_len; 1507 cont_flush();
1409 } else {
1410 /* ordinary single and terminated line */
1411 log_store(facility, level,
1412 dict, dictlen, text, text_len);
1413 printed_len = text_len;
1414 } 1508 }
1509
1510 if (!stored)
1511 log_store(facility, level, LOG_DEFAULT, 0,
1512 dict, dictlen, text, text_len);
1415 } 1513 }
1514 printed_len += text_len;
1416 1515
1417 /* 1516 /*
1418 * Try to acquire and then immediately release the console semaphore. 1517 * Try to acquire and then immediately release the console semaphore.
@@ -1499,11 +1598,18 @@ EXPORT_SYMBOL(printk);
1499#else 1598#else
1500 1599
1501#define LOG_LINE_MAX 0 1600#define LOG_LINE_MAX 0
1601static struct cont {
1602 size_t len;
1603 size_t cons;
1604 u8 level;
1605 bool flushed:1;
1606} cont;
1502static struct log *log_from_idx(u32 idx) { return NULL; } 1607static struct log *log_from_idx(u32 idx) { return NULL; }
1503static u32 log_next(u32 idx) { return 0; } 1608static u32 log_next(u32 idx) { return 0; }
1504static void call_console_drivers(int level, const char *text, size_t len) {} 1609static void call_console_drivers(int level, const char *text, size_t len) {}
1505static size_t msg_print_text(const struct log *msg, bool syslog, 1610static size_t msg_print_text(const struct log *msg, bool syslog,
1506 char *buf, size_t size) { return 0; } 1611 char *buf, size_t size) { return 0; }
1612static size_t cont_print_text(char *text, size_t size) { return 0; }
1507 1613
1508#endif /* CONFIG_PRINTK */ 1614#endif /* CONFIG_PRINTK */
1509 1615
@@ -1795,6 +1901,7 @@ static u32 console_idx;
1795 */ 1901 */
1796void console_unlock(void) 1902void console_unlock(void)
1797{ 1903{
1904 static char text[LOG_LINE_MAX];
1798 static u64 seen_seq; 1905 static u64 seen_seq;
1799 unsigned long flags; 1906 unsigned long flags;
1800 bool wake_klogd = false; 1907 bool wake_klogd = false;
@@ -1807,10 +1914,23 @@ void console_unlock(void)
1807 1914
1808 console_may_schedule = 0; 1915 console_may_schedule = 0;
1809 1916
1917 /* flush buffered message fragment immediately to console */
1918 raw_spin_lock_irqsave(&logbuf_lock, flags);
1919 if (cont.len && (cont.cons < cont.len || cont.flushed)) {
1920 size_t len;
1921
1922 len = cont_print_text(text, sizeof(text));
1923 raw_spin_unlock(&logbuf_lock);
1924 stop_critical_timings();
1925 call_console_drivers(cont.level, text, len);
1926 start_critical_timings();
1927 local_irq_restore(flags);
1928 } else
1929 raw_spin_unlock_irqrestore(&logbuf_lock, flags);
1930
1810again: 1931again:
1811 for (;;) { 1932 for (;;) {
1812 struct log *msg; 1933 struct log *msg;
1813 static char text[LOG_LINE_MAX];
1814 size_t len; 1934 size_t len;
1815 int level; 1935 int level;
1816 1936
@@ -1825,13 +1945,22 @@ again:
1825 console_seq = log_first_seq; 1945 console_seq = log_first_seq;
1826 console_idx = log_first_idx; 1946 console_idx = log_first_idx;
1827 } 1947 }
1828 1948skip:
1829 if (console_seq == log_next_seq) 1949 if (console_seq == log_next_seq)
1830 break; 1950 break;
1831 1951
1832 msg = log_from_idx(console_idx); 1952 msg = log_from_idx(console_idx);
1833 level = msg->level & 7; 1953 if (msg->flags & LOG_NOCONS) {
1954 /*
1955 * Skip record we have buffered and already printed
1956 * directly to the console when we received it.
1957 */
1958 console_idx = log_next(console_idx);
1959 console_seq++;
1960 goto skip;
1961 }
1834 1962
1963 level = msg->level;
1835 len = msg_print_text(msg, false, text, sizeof(text)); 1964 len = msg_print_text(msg, false, text, sizeof(text));
1836 1965
1837 console_idx = log_next(console_idx); 1966 console_idx = log_next(console_idx);
@@ -2409,7 +2538,7 @@ EXPORT_SYMBOL_GPL(kmsg_dump_get_line);
2409 * kmsg_dump_get_buffer - copy kmsg log lines 2538 * kmsg_dump_get_buffer - copy kmsg log lines
2410 * @dumper: registered kmsg dumper 2539 * @dumper: registered kmsg dumper
2411 * @syslog: include the "<4>" prefixes 2540 * @syslog: include the "<4>" prefixes
2412 * @line: buffer to copy the line to 2541 * @buf: buffer to copy the line to
2413 * @size: maximum size of the buffer 2542 * @size: maximum size of the buffer
2414 * @len: length of line placed into buffer 2543 * @len: length of line placed into buffer
2415 * 2544 *
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 3b0f1337f75b..38ecdda3f55f 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1530,7 +1530,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
1530{ 1530{
1531 unsigned long flags; 1531 unsigned long flags;
1532 struct rcu_head *next, *list, **tail; 1532 struct rcu_head *next, *list, **tail;
1533 int bl, count, count_lazy; 1533 int bl, count, count_lazy, i;
1534 1534
1535 /* If no callbacks are ready, just return.*/ 1535 /* If no callbacks are ready, just return.*/
1536 if (!cpu_has_callbacks_ready_to_invoke(rdp)) { 1536 if (!cpu_has_callbacks_ready_to_invoke(rdp)) {
@@ -1553,9 +1553,9 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
1553 rdp->nxtlist = *rdp->nxttail[RCU_DONE_TAIL]; 1553 rdp->nxtlist = *rdp->nxttail[RCU_DONE_TAIL];
1554 *rdp->nxttail[RCU_DONE_TAIL] = NULL; 1554 *rdp->nxttail[RCU_DONE_TAIL] = NULL;
1555 tail = rdp->nxttail[RCU_DONE_TAIL]; 1555 tail = rdp->nxttail[RCU_DONE_TAIL];
1556 for (count = RCU_NEXT_SIZE - 1; count >= 0; count--) 1556 for (i = RCU_NEXT_SIZE - 1; i >= 0; i--)
1557 if (rdp->nxttail[count] == rdp->nxttail[RCU_DONE_TAIL]) 1557 if (rdp->nxttail[i] == rdp->nxttail[RCU_DONE_TAIL])
1558 rdp->nxttail[count] = &rdp->nxtlist; 1558 rdp->nxttail[i] = &rdp->nxtlist;
1559 local_irq_restore(flags); 1559 local_irq_restore(flags);
1560 1560
1561 /* Invoke callbacks. */ 1561 /* Invoke callbacks. */
@@ -1583,9 +1583,9 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp)
1583 if (list != NULL) { 1583 if (list != NULL) {
1584 *tail = rdp->nxtlist; 1584 *tail = rdp->nxtlist;
1585 rdp->nxtlist = list; 1585 rdp->nxtlist = list;
1586 for (count = 0; count < RCU_NEXT_SIZE; count++) 1586 for (i = 0; i < RCU_NEXT_SIZE; i++)
1587 if (&rdp->nxtlist == rdp->nxttail[count]) 1587 if (&rdp->nxtlist == rdp->nxttail[i])
1588 rdp->nxttail[count] = tail; 1588 rdp->nxttail[i] = tail;
1589 else 1589 else
1590 break; 1590 break;
1591 } 1591 }
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 9ee48cb30179..3d33ecf13327 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -368,7 +368,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
368 const char *sptr = va_arg(ap, const char *); 368 const char *sptr = va_arg(ap, const char *);
369 uint16_t len = 0; 369 uint16_t len = 0;
370 if (sptr) 370 if (sptr)
371 len = min_t(uint16_t, strlen(sptr), 371 len = min_t(size_t, strlen(sptr),
372 USHRT_MAX); 372 USHRT_MAX);
373 373
374 errcode = p9pdu_writef(pdu, proto_version, 374 errcode = p9pdu_writef(pdu, proto_version,
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 840e2c64a301..015471d801b4 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -617,6 +617,8 @@ int recv_tt_query(struct sk_buff *skb, struct hard_iface *recv_if)
617 * changes */ 617 * changes */
618 if (skb_linearize(skb) < 0) 618 if (skb_linearize(skb) < 0)
619 goto out; 619 goto out;
620 /* skb_linearize() possibly changed skb->data */
621 tt_query = (struct tt_query_packet *)skb->data;
620 622
621 tt_len = tt_query->tt_data * sizeof(struct tt_change); 623 tt_len = tt_query->tt_data * sizeof(struct tt_change);
622 624
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index a66c2dcd1088..2ab83d7fb1f8 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -141,13 +141,14 @@ static void tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
141 struct tt_orig_list_entry *orig_entry; 141 struct tt_orig_list_entry *orig_entry;
142 142
143 orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); 143 orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu);
144 atomic_dec(&orig_entry->orig_node->tt_size);
145 orig_node_free_ref(orig_entry->orig_node); 144 orig_node_free_ref(orig_entry->orig_node);
146 kfree(orig_entry); 145 kfree(orig_entry);
147} 146}
148 147
149static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry) 148static void tt_orig_list_entry_free_ref(struct tt_orig_list_entry *orig_entry)
150{ 149{
150 /* to avoid race conditions, immediately decrease the tt counter */
151 atomic_dec(&orig_entry->orig_node->tt_size);
151 call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu); 152 call_rcu(&orig_entry->rcu, tt_orig_list_entry_free_rcu);
152} 153}
153 154
@@ -910,7 +911,6 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
910 } 911 }
911 spin_unlock_bh(list_lock); 912 spin_unlock_bh(list_lock);
912 } 913 }
913 atomic_set(&orig_node->tt_size, 0);
914 orig_node->tt_initialised = false; 914 orig_node->tt_initialised = false;
915} 915}
916 916
@@ -2031,10 +2031,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
2031{ 2031{
2032 struct tt_local_entry *tt_local_entry = NULL; 2032 struct tt_local_entry *tt_local_entry = NULL;
2033 struct tt_global_entry *tt_global_entry = NULL; 2033 struct tt_global_entry *tt_global_entry = NULL;
2034 bool ret = true; 2034 bool ret = false;
2035 2035
2036 if (!atomic_read(&bat_priv->ap_isolation)) 2036 if (!atomic_read(&bat_priv->ap_isolation))
2037 return false; 2037 goto out;
2038 2038
2039 tt_local_entry = tt_local_hash_find(bat_priv, dst); 2039 tt_local_entry = tt_local_hash_find(bat_priv, dst);
2040 if (!tt_local_entry) 2040 if (!tt_local_entry)
@@ -2044,10 +2044,10 @@ bool is_ap_isolated(struct bat_priv *bat_priv, uint8_t *src, uint8_t *dst)
2044 if (!tt_global_entry) 2044 if (!tt_global_entry)
2045 goto out; 2045 goto out;
2046 2046
2047 if (_is_ap_isolated(tt_local_entry, tt_global_entry)) 2047 if (!_is_ap_isolated(tt_local_entry, tt_global_entry))
2048 goto out; 2048 goto out;
2049 2049
2050 ret = false; 2050 ret = true;
2051 2051
2052out: 2052out:
2053 if (tt_global_entry) 2053 if (tt_global_entry)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 4eefb7f65cf6..94ad124a4ea3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3043,6 +3043,50 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
3043 hci_dev_unlock(hdev); 3043 hci_dev_unlock(hdev);
3044} 3044}
3045 3045
3046static void hci_key_refresh_complete_evt(struct hci_dev *hdev,
3047 struct sk_buff *skb)
3048{
3049 struct hci_ev_key_refresh_complete *ev = (void *) skb->data;
3050 struct hci_conn *conn;
3051
3052 BT_DBG("%s status %u handle %u", hdev->name, ev->status,
3053 __le16_to_cpu(ev->handle));
3054
3055 hci_dev_lock(hdev);
3056
3057 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
3058 if (!conn)
3059 goto unlock;
3060
3061 if (!ev->status)
3062 conn->sec_level = conn->pending_sec_level;
3063
3064 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
3065
3066 if (ev->status && conn->state == BT_CONNECTED) {
3067 hci_acl_disconn(conn, HCI_ERROR_AUTH_FAILURE);
3068 hci_conn_put(conn);
3069 goto unlock;
3070 }
3071
3072 if (conn->state == BT_CONFIG) {
3073 if (!ev->status)
3074 conn->state = BT_CONNECTED;
3075
3076 hci_proto_connect_cfm(conn, ev->status);
3077 hci_conn_put(conn);
3078 } else {
3079 hci_auth_cfm(conn, ev->status);
3080
3081 hci_conn_hold(conn);
3082 conn->disc_timeout = HCI_DISCONN_TIMEOUT;
3083 hci_conn_put(conn);
3084 }
3085
3086unlock:
3087 hci_dev_unlock(hdev);
3088}
3089
3046static inline u8 hci_get_auth_req(struct hci_conn *conn) 3090static inline u8 hci_get_auth_req(struct hci_conn *conn)
3047{ 3091{
3048 /* If remote requests dedicated bonding follow that lead */ 3092 /* If remote requests dedicated bonding follow that lead */
@@ -3559,6 +3603,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
3559 hci_extended_inquiry_result_evt(hdev, skb); 3603 hci_extended_inquiry_result_evt(hdev, skb);
3560 break; 3604 break;
3561 3605
3606 case HCI_EV_KEY_REFRESH_COMPLETE:
3607 hci_key_refresh_complete_evt(hdev, skb);
3608 break;
3609
3562 case HCI_EV_IO_CAPA_REQUEST: 3610 case HCI_EV_IO_CAPA_REQUEST:
3563 hci_io_capa_request_evt(hdev, skb); 3611 hci_io_capa_request_evt(hdev, skb);
3564 break; 3612 break;
diff --git a/net/bluetooth/hidp/Kconfig b/net/bluetooth/hidp/Kconfig
index 4deaca78e91e..9332bc7aa851 100644
--- a/net/bluetooth/hidp/Kconfig
+++ b/net/bluetooth/hidp/Kconfig
@@ -1,6 +1,6 @@
1config BT_HIDP 1config BT_HIDP
2 tristate "HIDP protocol support" 2 tristate "HIDP protocol support"
3 depends on BT && INPUT && HID_SUPPORT 3 depends on BT && INPUT
4 select HID 4 select HID
5 help 5 help
6 HIDP (Human Interface Device Protocol) is a transport layer 6 HIDP (Human Interface Device Protocol) is a transport layer
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 24f144b72a96..4554e80d16a3 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1295,7 +1295,12 @@ static void security_timeout(struct work_struct *work)
1295 struct l2cap_conn *conn = container_of(work, struct l2cap_conn, 1295 struct l2cap_conn *conn = container_of(work, struct l2cap_conn,
1296 security_timer.work); 1296 security_timer.work);
1297 1297
1298 l2cap_conn_del(conn->hcon, ETIMEDOUT); 1298 BT_DBG("conn %p", conn);
1299
1300 if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) {
1301 smp_chan_destroy(conn);
1302 l2cap_conn_del(conn->hcon, ETIMEDOUT);
1303 }
1299} 1304}
1300 1305
1301static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) 1306static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
@@ -2910,12 +2915,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
2910 while (len >= L2CAP_CONF_OPT_SIZE) { 2915 while (len >= L2CAP_CONF_OPT_SIZE) {
2911 len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); 2916 len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
2912 2917
2913 switch (type) { 2918 if (type != L2CAP_CONF_RFC)
2914 case L2CAP_CONF_RFC: 2919 continue;
2915 if (olen == sizeof(rfc)) 2920
2916 memcpy(&rfc, (void *)val, olen); 2921 if (olen != sizeof(rfc))
2917 goto done; 2922 break;
2918 } 2923
2924 memcpy(&rfc, (void *)val, olen);
2925 goto done;
2919 } 2926 }
2920 2927
2921 /* Use sane default values in case a misbehaving remote device 2928 /* Use sane default values in case a misbehaving remote device
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 25d220776079..3e5e3362ea00 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1598,7 +1598,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
1598 else 1598 else
1599 conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); 1599 conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr);
1600 1600
1601 if (!conn) { 1601 if (!conn || conn->state == BT_OPEN || conn->state == BT_CLOSED) {
1602 err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, 1602 err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT,
1603 MGMT_STATUS_NOT_CONNECTED); 1603 MGMT_STATUS_NOT_CONNECTED);
1604 goto failed; 1604 goto failed;
@@ -1873,6 +1873,22 @@ static void pairing_complete_cb(struct hci_conn *conn, u8 status)
1873 pairing_complete(cmd, mgmt_status(status)); 1873 pairing_complete(cmd, mgmt_status(status));
1874} 1874}
1875 1875
1876static void le_connect_complete_cb(struct hci_conn *conn, u8 status)
1877{
1878 struct pending_cmd *cmd;
1879
1880 BT_DBG("status %u", status);
1881
1882 if (!status)
1883 return;
1884
1885 cmd = find_pairing(conn);
1886 if (!cmd)
1887 BT_DBG("Unable to find a pending command");
1888 else
1889 pairing_complete(cmd, mgmt_status(status));
1890}
1891
1876static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, 1892static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
1877 u16 len) 1893 u16 len)
1878{ 1894{
@@ -1934,6 +1950,8 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
1934 /* For LE, just connecting isn't a proof that the pairing finished */ 1950 /* For LE, just connecting isn't a proof that the pairing finished */
1935 if (cp->addr.type == BDADDR_BREDR) 1951 if (cp->addr.type == BDADDR_BREDR)
1936 conn->connect_cfm_cb = pairing_complete_cb; 1952 conn->connect_cfm_cb = pairing_complete_cb;
1953 else
1954 conn->connect_cfm_cb = le_connect_complete_cb;
1937 1955
1938 conn->security_cfm_cb = pairing_complete_cb; 1956 conn->security_cfm_cb = pairing_complete_cb;
1939 conn->disconn_cfm_cb = pairing_complete_cb; 1957 conn->disconn_cfm_cb = pairing_complete_cb;
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 6fc7c4708f3e..37df4e9b3896 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -648,7 +648,7 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb)
648 648
649 auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM; 649 auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM;
650 650
651 ret = tk_request(conn, 0, auth, rsp->io_capability, req->io_capability); 651 ret = tk_request(conn, 0, auth, req->io_capability, rsp->io_capability);
652 if (ret) 652 if (ret)
653 return SMP_UNSPECIFIED; 653 return SMP_UNSPECIFIED;
654 654
@@ -703,7 +703,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
703 return 0; 703 return 0;
704} 704}
705 705
706static u8 smp_ltk_encrypt(struct l2cap_conn *conn) 706static u8 smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
707{ 707{
708 struct smp_ltk *key; 708 struct smp_ltk *key;
709 struct hci_conn *hcon = conn->hcon; 709 struct hci_conn *hcon = conn->hcon;
@@ -712,6 +712,9 @@ static u8 smp_ltk_encrypt(struct l2cap_conn *conn)
712 if (!key) 712 if (!key)
713 return 0; 713 return 0;
714 714
715 if (sec_level > BT_SECURITY_MEDIUM && !key->authenticated)
716 return 0;
717
715 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) 718 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags))
716 return 1; 719 return 1;
717 720
@@ -732,7 +735,7 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
732 735
733 hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); 736 hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req);
734 737
735 if (smp_ltk_encrypt(conn)) 738 if (smp_ltk_encrypt(conn, hcon->pending_sec_level))
736 return 0; 739 return 0;
737 740
738 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) 741 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
@@ -771,7 +774,7 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
771 return 1; 774 return 1;
772 775
773 if (hcon->link_mode & HCI_LM_MASTER) 776 if (hcon->link_mode & HCI_LM_MASTER)
774 if (smp_ltk_encrypt(conn)) 777 if (smp_ltk_encrypt(conn, sec_level))
775 goto done; 778 goto done;
776 779
777 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) 780 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 0a942fbccc9a..e1144e1617be 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -240,6 +240,7 @@ int br_add_bridge(struct net *net, const char *name)
240 return -ENOMEM; 240 return -ENOMEM;
241 241
242 dev_net_set(dev, net); 242 dev_net_set(dev, net);
243 dev->rtnl_link_ops = &br_link_ops;
243 244
244 res = register_netdev(dev); 245 res = register_netdev(dev);
245 if (res) 246 if (res)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 2080485515f1..fe41260fbf38 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -208,7 +208,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
208 return 0; 208 return 0;
209} 209}
210 210
211static struct rtnl_link_ops br_link_ops __read_mostly = { 211struct rtnl_link_ops br_link_ops __read_mostly = {
212 .kind = "bridge", 212 .kind = "bridge",
213 .priv_size = sizeof(struct net_bridge), 213 .priv_size = sizeof(struct net_bridge),
214 .setup = br_dev_setup, 214 .setup = br_dev_setup,
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 1a8ad4fb9a6b..a768b2408edf 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -549,6 +549,7 @@ extern int (*br_fdb_test_addr_hook)(struct net_device *dev, unsigned char *addr)
549#endif 549#endif
550 550
551/* br_netlink.c */ 551/* br_netlink.c */
552extern struct rtnl_link_ops br_link_ops;
552extern int br_netlink_init(void); 553extern int br_netlink_init(void);
553extern void br_netlink_fini(void); 554extern void br_netlink_fini(void);
554extern void br_ifinfo_notify(int event, struct net_bridge_port *port); 555extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index aa6f716524fd..554b31289607 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -4,8 +4,7 @@
4 * Author: Sjur Brendeland/sjur.brandeland@stericsson.com 4 * Author: Sjur Brendeland/sjur.brandeland@stericsson.com
5 * License terms: GNU General Public License (GPL) version 2 5 * License terms: GNU General Public License (GPL) version 2
6 * 6 *
7 * Borrowed heavily from file: pn_dev.c. Thanks to 7 * Borrowed heavily from file: pn_dev.c. Thanks to Remi Denis-Courmont
8 * Remi Denis-Courmont <remi.denis-courmont@nokia.com>
9 * and Sakari Ailus <sakari.ailus@nokia.com> 8 * and Sakari Ailus <sakari.ailus@nokia.com>
10 */ 9 */
11 10
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index fb8944355264..78f1cdad5b33 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -220,6 +220,7 @@ static void caif_ctrl_cb(struct cflayer *layr,
220 cfsk_hold, cfsk_put); 220 cfsk_hold, cfsk_put);
221 cf_sk->sk.sk_state = CAIF_CONNECTED; 221 cf_sk->sk.sk_state = CAIF_CONNECTED;
222 set_tx_flow_on(cf_sk); 222 set_tx_flow_on(cf_sk);
223 cf_sk->sk.sk_shutdown = 0;
223 cf_sk->sk.sk_state_change(&cf_sk->sk); 224 cf_sk->sk.sk_state_change(&cf_sk->sk);
224 break; 225 break;
225 226
diff --git a/net/can/raw.c b/net/can/raw.c
index cde1b4a20f75..46cca3a91d19 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
681 if (err < 0) 681 if (err < 0)
682 goto free_skb; 682 goto free_skb;
683 683
684 /* to be able to check the received tx sock reference in raw_rcv() */
685 skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
686
687 skb->dev = dev; 684 skb->dev = dev;
688 skb->sk = sk; 685 skb->sk = sk;
689 686
diff --git a/net/core/dev.c b/net/core/dev.c
index cd0981977f5c..6df214041a5e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2089,25 +2089,6 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
2089 return 0; 2089 return 0;
2090} 2090}
2091 2091
2092/*
2093 * Try to orphan skb early, right before transmission by the device.
2094 * We cannot orphan skb if tx timestamp is requested or the sk-reference
2095 * is needed on driver level for other reasons, e.g. see net/can/raw.c
2096 */
2097static inline void skb_orphan_try(struct sk_buff *skb)
2098{
2099 struct sock *sk = skb->sk;
2100
2101 if (sk && !skb_shinfo(skb)->tx_flags) {
2102 /* skb_tx_hash() wont be able to get sk.
2103 * We copy sk_hash into skb->rxhash
2104 */
2105 if (!skb->rxhash)
2106 skb->rxhash = sk->sk_hash;
2107 skb_orphan(skb);
2108 }
2109}
2110
2111static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) 2092static bool can_checksum_protocol(netdev_features_t features, __be16 protocol)
2112{ 2093{
2113 return ((features & NETIF_F_GEN_CSUM) || 2094 return ((features & NETIF_F_GEN_CSUM) ||
@@ -2193,8 +2174,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2193 if (!list_empty(&ptype_all)) 2174 if (!list_empty(&ptype_all))
2194 dev_queue_xmit_nit(skb, dev); 2175 dev_queue_xmit_nit(skb, dev);
2195 2176
2196 skb_orphan_try(skb);
2197
2198 features = netif_skb_features(skb); 2177 features = netif_skb_features(skb);
2199 2178
2200 if (vlan_tx_tag_present(skb) && 2179 if (vlan_tx_tag_present(skb) &&
@@ -2304,7 +2283,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb,
2304 if (skb->sk && skb->sk->sk_hash) 2283 if (skb->sk && skb->sk->sk_hash)
2305 hash = skb->sk->sk_hash; 2284 hash = skb->sk->sk_hash;
2306 else 2285 else
2307 hash = (__force u16) skb->protocol ^ skb->rxhash; 2286 hash = (__force u16) skb->protocol;
2308 hash = jhash_1word(hash, hashrnd); 2287 hash = jhash_1word(hash, hashrnd);
2309 2288
2310 return (u16) (((u64) hash * qcount) >> 32) + qoffset; 2289 return (u16) (((u64) hash * qcount) >> 32) + qoffset;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 74c21b924a79..608327661960 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1349,8 +1349,8 @@ static int fib6_walk_continue(struct fib6_walker_t *w)
1349 if (w->leaf && fn->fn_flags & RTN_RTINFO) { 1349 if (w->leaf && fn->fn_flags & RTN_RTINFO) {
1350 int err; 1350 int err;
1351 1351
1352 if (w->count < w->skip) { 1352 if (w->skip) {
1353 w->count++; 1353 w->skip--;
1354 continue; 1354 continue;
1355 } 1355 }
1356 1356
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 999a982ad3fd..becb048d18d4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2957,10 +2957,6 @@ static int __net_init ip6_route_net_init(struct net *net)
2957 net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ; 2957 net->ipv6.sysctl.ip6_rt_mtu_expires = 10*60*HZ;
2958 net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40; 2958 net->ipv6.sysctl.ip6_rt_min_advmss = IPV6_MIN_MTU - 20 - 40;
2959 2959
2960#ifdef CONFIG_PROC_FS
2961 proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops);
2962 proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
2963#endif
2964 net->ipv6.ip6_rt_gc_expire = 30*HZ; 2960 net->ipv6.ip6_rt_gc_expire = 30*HZ;
2965 2961
2966 ret = 0; 2962 ret = 0;
@@ -2981,10 +2977,6 @@ out_ip6_dst_ops:
2981 2977
2982static void __net_exit ip6_route_net_exit(struct net *net) 2978static void __net_exit ip6_route_net_exit(struct net *net)
2983{ 2979{
2984#ifdef CONFIG_PROC_FS
2985 proc_net_remove(net, "ipv6_route");
2986 proc_net_remove(net, "rt6_stats");
2987#endif
2988 kfree(net->ipv6.ip6_null_entry); 2980 kfree(net->ipv6.ip6_null_entry);
2989#ifdef CONFIG_IPV6_MULTIPLE_TABLES 2981#ifdef CONFIG_IPV6_MULTIPLE_TABLES
2990 kfree(net->ipv6.ip6_prohibit_entry); 2982 kfree(net->ipv6.ip6_prohibit_entry);
@@ -2993,11 +2985,33 @@ static void __net_exit ip6_route_net_exit(struct net *net)
2993 dst_entries_destroy(&net->ipv6.ip6_dst_ops); 2985 dst_entries_destroy(&net->ipv6.ip6_dst_ops);
2994} 2986}
2995 2987
2988static int __net_init ip6_route_net_init_late(struct net *net)
2989{
2990#ifdef CONFIG_PROC_FS
2991 proc_net_fops_create(net, "ipv6_route", 0, &ipv6_route_proc_fops);
2992 proc_net_fops_create(net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
2993#endif
2994 return 0;
2995}
2996
2997static void __net_exit ip6_route_net_exit_late(struct net *net)
2998{
2999#ifdef CONFIG_PROC_FS
3000 proc_net_remove(net, "ipv6_route");
3001 proc_net_remove(net, "rt6_stats");
3002#endif
3003}
3004
2996static struct pernet_operations ip6_route_net_ops = { 3005static struct pernet_operations ip6_route_net_ops = {
2997 .init = ip6_route_net_init, 3006 .init = ip6_route_net_init,
2998 .exit = ip6_route_net_exit, 3007 .exit = ip6_route_net_exit,
2999}; 3008};
3000 3009
3010static struct pernet_operations ip6_route_net_late_ops = {
3011 .init = ip6_route_net_init_late,
3012 .exit = ip6_route_net_exit_late,
3013};
3014
3001static struct notifier_block ip6_route_dev_notifier = { 3015static struct notifier_block ip6_route_dev_notifier = {
3002 .notifier_call = ip6_route_dev_notify, 3016 .notifier_call = ip6_route_dev_notify,
3003 .priority = 0, 3017 .priority = 0,
@@ -3047,19 +3061,25 @@ int __init ip6_route_init(void)
3047 if (ret) 3061 if (ret)
3048 goto xfrm6_init; 3062 goto xfrm6_init;
3049 3063
3064 ret = register_pernet_subsys(&ip6_route_net_late_ops);
3065 if (ret)
3066 goto fib6_rules_init;
3067
3050 ret = -ENOBUFS; 3068 ret = -ENOBUFS;
3051 if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) || 3069 if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) ||
3052 __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) || 3070 __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) ||
3053 __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL)) 3071 __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL))
3054 goto fib6_rules_init; 3072 goto out_register_late_subsys;
3055 3073
3056 ret = register_netdevice_notifier(&ip6_route_dev_notifier); 3074 ret = register_netdevice_notifier(&ip6_route_dev_notifier);
3057 if (ret) 3075 if (ret)
3058 goto fib6_rules_init; 3076 goto out_register_late_subsys;
3059 3077
3060out: 3078out:
3061 return ret; 3079 return ret;
3062 3080
3081out_register_late_subsys:
3082 unregister_pernet_subsys(&ip6_route_net_late_ops);
3063fib6_rules_init: 3083fib6_rules_init:
3064 fib6_rules_cleanup(); 3084 fib6_rules_cleanup();
3065xfrm6_init: 3085xfrm6_init:
@@ -3078,6 +3098,7 @@ out_kmem_cache:
3078void ip6_route_cleanup(void) 3098void ip6_route_cleanup(void)
3079{ 3099{
3080 unregister_netdevice_notifier(&ip6_route_dev_notifier); 3100 unregister_netdevice_notifier(&ip6_route_dev_notifier);
3101 unregister_pernet_subsys(&ip6_route_net_late_ops);
3081 fib6_rules_cleanup(); 3102 fib6_rules_cleanup();
3082 xfrm6_fini(); 3103 xfrm6_fini();
3083 fib6_gc_cleanup(); 3104 fib6_gc_cleanup();
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 3a9aec29581a..9df64a50b075 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1212,7 +1212,8 @@ have_isn:
1212 tcp_rsk(req)->snt_isn = isn; 1212 tcp_rsk(req)->snt_isn = isn;
1213 tcp_rsk(req)->snt_synack = tcp_time_stamp; 1213 tcp_rsk(req)->snt_synack = tcp_time_stamp;
1214 1214
1215 security_inet_conn_request(sk, skb, req); 1215 if (security_inet_conn_request(sk, skb, req))
1216 goto drop_and_release;
1216 1217
1217 if (tcp_v6_send_synack(sk, req, 1218 if (tcp_v6_send_synack(sk, req,
1218 (struct request_values *)&tmp_ext, 1219 (struct request_values *)&tmp_ext,
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 07d7d55a1b93..cd6f7a991d80 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -372,7 +372,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
372 skb_trim(skb, skb->dev->mtu); 372 skb_trim(skb, skb->dev->mtu);
373 } 373 }
374 skb->protocol = ETH_P_AF_IUCV; 374 skb->protocol = ETH_P_AF_IUCV;
375 skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
376 nskb = skb_clone(skb, GFP_ATOMIC); 375 nskb = skb_clone(skb, GFP_ATOMIC);
377 if (!nskb) 376 if (!nskb)
378 return -ENOMEM; 377 return -ENOMEM;
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 185f12f4a5fa..47b259fccd27 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -42,6 +42,11 @@ struct l2tp_eth {
42 struct sock *tunnel_sock; 42 struct sock *tunnel_sock;
43 struct l2tp_session *session; 43 struct l2tp_session *session;
44 struct list_head list; 44 struct list_head list;
45 atomic_long_t tx_bytes;
46 atomic_long_t tx_packets;
47 atomic_long_t rx_bytes;
48 atomic_long_t rx_packets;
49 atomic_long_t rx_errors;
45}; 50};
46 51
47/* via l2tp_session_priv() */ 52/* via l2tp_session_priv() */
@@ -88,24 +93,40 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
88 struct l2tp_eth *priv = netdev_priv(dev); 93 struct l2tp_eth *priv = netdev_priv(dev);
89 struct l2tp_session *session = priv->session; 94 struct l2tp_session *session = priv->session;
90 95
96 atomic_long_add(skb->len, &priv->tx_bytes);
97 atomic_long_inc(&priv->tx_packets);
98
91 l2tp_xmit_skb(session, skb, session->hdr_len); 99 l2tp_xmit_skb(session, skb, session->hdr_len);
92 100
93 dev->stats.tx_bytes += skb->len; 101 return NETDEV_TX_OK;
94 dev->stats.tx_packets++; 102}
95 103
96 return 0; 104static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev,
105 struct rtnl_link_stats64 *stats)
106{
107 struct l2tp_eth *priv = netdev_priv(dev);
108
109 stats->tx_bytes = atomic_long_read(&priv->tx_bytes);
110 stats->tx_packets = atomic_long_read(&priv->tx_packets);
111 stats->rx_bytes = atomic_long_read(&priv->rx_bytes);
112 stats->rx_packets = atomic_long_read(&priv->rx_packets);
113 stats->rx_errors = atomic_long_read(&priv->rx_errors);
114 return stats;
97} 115}
98 116
117
99static struct net_device_ops l2tp_eth_netdev_ops = { 118static struct net_device_ops l2tp_eth_netdev_ops = {
100 .ndo_init = l2tp_eth_dev_init, 119 .ndo_init = l2tp_eth_dev_init,
101 .ndo_uninit = l2tp_eth_dev_uninit, 120 .ndo_uninit = l2tp_eth_dev_uninit,
102 .ndo_start_xmit = l2tp_eth_dev_xmit, 121 .ndo_start_xmit = l2tp_eth_dev_xmit,
122 .ndo_get_stats64 = l2tp_eth_get_stats64,
103}; 123};
104 124
105static void l2tp_eth_dev_setup(struct net_device *dev) 125static void l2tp_eth_dev_setup(struct net_device *dev)
106{ 126{
107 ether_setup(dev); 127 ether_setup(dev);
108 dev->priv_flags &= ~IFF_TX_SKB_SHARING; 128 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
129 dev->features |= NETIF_F_LLTX;
109 dev->netdev_ops = &l2tp_eth_netdev_ops; 130 dev->netdev_ops = &l2tp_eth_netdev_ops;
110 dev->destructor = free_netdev; 131 dev->destructor = free_netdev;
111} 132}
@@ -114,17 +135,17 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
114{ 135{
115 struct l2tp_eth_sess *spriv = l2tp_session_priv(session); 136 struct l2tp_eth_sess *spriv = l2tp_session_priv(session);
116 struct net_device *dev = spriv->dev; 137 struct net_device *dev = spriv->dev;
138 struct l2tp_eth *priv = netdev_priv(dev);
117 139
118 if (session->debug & L2TP_MSG_DATA) { 140 if (session->debug & L2TP_MSG_DATA) {
119 unsigned int length; 141 unsigned int length;
120 u8 *ptr = skb->data;
121 142
122 length = min(32u, skb->len); 143 length = min(32u, skb->len);
123 if (!pskb_may_pull(skb, length)) 144 if (!pskb_may_pull(skb, length))
124 goto error; 145 goto error;
125 146
126 pr_debug("%s: eth recv\n", session->name); 147 pr_debug("%s: eth recv\n", session->name);
127 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length); 148 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length);
128 } 149 }
129 150
130 if (!pskb_may_pull(skb, sizeof(ETH_HLEN))) 151 if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
@@ -139,15 +160,15 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
139 nf_reset(skb); 160 nf_reset(skb);
140 161
141 if (dev_forward_skb(dev, skb) == NET_RX_SUCCESS) { 162 if (dev_forward_skb(dev, skb) == NET_RX_SUCCESS) {
142 dev->stats.rx_packets++; 163 atomic_long_inc(&priv->rx_packets);
143 dev->stats.rx_bytes += data_len; 164 atomic_long_add(data_len, &priv->rx_bytes);
144 } else 165 } else {
145 dev->stats.rx_errors++; 166 atomic_long_inc(&priv->rx_errors);
146 167 }
147 return; 168 return;
148 169
149error: 170error:
150 dev->stats.rx_errors++; 171 atomic_long_inc(&priv->rx_errors);
151 kfree_skb(skb); 172 kfree_skb(skb);
152} 173}
153 174
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index e9cecca5c44d..7d5108a867ad 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2093,6 +2093,9 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
2093 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 2093 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
2094 int i, ret; 2094 int i, ret;
2095 2095
2096 if (!ieee80211_sdata_running(sdata))
2097 return -ENETDOWN;
2098
2096 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) { 2099 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
2097 ret = drv_set_bitrate_mask(local, sdata, mask); 2100 ret = drv_set_bitrate_mask(local, sdata, mask);
2098 if (ret) 2101 if (ret)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 91d84cc77bbf..66e4fcdd1c6b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1352,6 +1352,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1352 if (WARN_ON(!ifmgd->associated)) 1352 if (WARN_ON(!ifmgd->associated))
1353 return; 1353 return;
1354 1354
1355 ieee80211_stop_poll(sdata);
1356
1355 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); 1357 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
1356 1358
1357 ifmgd->associated = NULL; 1359 ifmgd->associated = NULL;
@@ -2612,8 +2614,6 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata,
2612 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 2614 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2613 u8 frame_buf[DEAUTH_DISASSOC_LEN]; 2615 u8 frame_buf[DEAUTH_DISASSOC_LEN];
2614 2616
2615 ieee80211_stop_poll(sdata);
2616
2617 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, 2617 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason,
2618 false, frame_buf); 2618 false, frame_buf);
2619 mutex_unlock(&ifmgd->mtx); 2619 mutex_unlock(&ifmgd->mtx);
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 3bb24a121c95..a470e1123a55 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -271,6 +271,9 @@ struct sta_ampdu_mlme {
271 * @plink_timer: peer link watch timer 271 * @plink_timer: peer link watch timer
272 * @plink_timer_was_running: used by suspend/resume to restore timers 272 * @plink_timer_was_running: used by suspend/resume to restore timers
273 * @t_offset: timing offset relative to this host 273 * @t_offset: timing offset relative to this host
274 * @t_offset_setpoint: reference timing offset of this sta to be used when
275 * calculating clockdrift
276 * @ch_type: peer's channel type
274 * @debugfs: debug filesystem info 277 * @debugfs: debug filesystem info
275 * @dead: set to true when sta is unlinked 278 * @dead: set to true when sta is unlinked
276 * @uploaded: set to true when sta is uploaded to the driver 279 * @uploaded: set to true when sta is uploaded to the driver
@@ -278,6 +281,8 @@ struct sta_ampdu_mlme {
278 * @sta: station information we share with the driver 281 * @sta: station information we share with the driver
279 * @sta_state: duplicates information about station state (for debug) 282 * @sta_state: duplicates information about station state (for debug)
280 * @beacon_loss_count: number of times beacon loss has triggered 283 * @beacon_loss_count: number of times beacon loss has triggered
284 * @supports_40mhz: tracks whether the station advertised 40 MHz support
285 * as we overwrite its HT parameters with the currently used value
281 */ 286 */
282struct sta_info { 287struct sta_info {
283 /* General information, mostly static */ 288 /* General information, mostly static */
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index 8781d8f904d9..434b6873b352 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -83,9 +83,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
83{ 83{
84 struct xmit_work *work; 84 struct xmit_work *work;
85 85
86 if (!(priv->phy->channels_supported[page] & (1 << chan))) 86 if (!(priv->phy->channels_supported[page] & (1 << chan))) {
87 WARN_ON(1); 87 WARN_ON(1);
88 return NETDEV_TX_OK; 88 return NETDEV_TX_OK;
89 }
89 90
90 if (!(priv->hw.flags & IEEE802154_HW_OMIT_CKSUM)) { 91 if (!(priv->hw.flags & IEEE802154_HW_OMIT_CKSUM)) {
91 u16 crc = crc_ccitt(0, skb->data, skb->len); 92 u16 crc = crc_ccitt(0, skb->data, skb->len);
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index 779ce4ff92ec..5a940dbd74a3 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c
index bf35b4e1a14c..12c30f3e643e 100644
--- a/net/phonet/datagram.c
+++ b/net/phonet/datagram.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c
index d01208968c83..a2fba7edfd1f 100644
--- a/net/phonet/pep-gprs.c
+++ b/net/phonet/pep-gprs.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 9dd4f926f7d1..576f22c9c76e 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 36f75a9e2c3d..5bf6341e2dd4 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
index cfdf135fcd69..7dd762a464e5 100644
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Remi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 89cfa9ce4939..0acc943f713a 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Authors: Sakari Ailus <sakari.ailus@nokia.com>
9 * Original author: Sakari Ailus <sakari.ailus@nokia.com> 9 * Rémi Denis-Courmont
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c
index 696348fd31a1..d6bbbbd0af18 100644
--- a/net/phonet/sysctl.c
+++ b/net/phonet/sysctl.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2008 Nokia Corporation. 6 * Copyright (C) 2008 Nokia Corporation.
7 * 7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com> 8 * Author: Rémi Denis-Courmont
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 5942d27b1444..9c90811d1134 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -673,7 +673,9 @@ void sctp_addr_wq_timeout_handler(unsigned long arg)
673 SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n"); 673 SCTP_DEBUG_PRINTK("sctp_addrwq_timo_handler: sctp_asconf_mgmt failed\n");
674 sctp_bh_unlock_sock(sk); 674 sctp_bh_unlock_sock(sk);
675 } 675 }
676#if IS_ENABLED(CONFIG_IPV6)
676free_next: 677free_next:
678#endif
677 list_del(&addrw->list); 679 list_del(&addrw->list);
678 kfree(addrw); 680 kfree(addrw);
679 } 681 }
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 15f347477a99..baf5704740ee 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1389,7 +1389,7 @@ static void reg_set_request_processed(void)
1389 spin_unlock(&reg_requests_lock); 1389 spin_unlock(&reg_requests_lock);
1390 1390
1391 if (last_request->initiator == NL80211_REGDOM_SET_BY_USER) 1391 if (last_request->initiator == NL80211_REGDOM_SET_BY_USER)
1392 cancel_delayed_work_sync(&reg_timeout); 1392 cancel_delayed_work(&reg_timeout);
1393 1393
1394 if (need_more_processing) 1394 if (need_more_processing)
1395 schedule_work(&reg_work); 1395 schedule_work(&reg_work);
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 8f2d68fc3a44..316cfd00914f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -804,7 +804,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
804 ntype == NL80211_IFTYPE_P2P_CLIENT)) 804 ntype == NL80211_IFTYPE_P2P_CLIENT))
805 return -EBUSY; 805 return -EBUSY;
806 806
807 if (ntype != otype) { 807 if (ntype != otype && netif_running(dev)) {
808 err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr, 808 err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr,
809 ntype); 809 ntype);
810 if (err) 810 if (err)
diff --git a/scripts/gfp-translate b/scripts/gfp-translate
index c9230e158a8f..c9230e158a8f 100644..100755
--- a/scripts/gfp-translate
+++ b/scripts/gfp-translate
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 582aace20ea3..7eca25fae413 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -37,8 +37,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips"); 37MODULE_DESCRIPTION("Routines for control of TEA5757/5759 Philips AM/FM radio tuner chips");
38MODULE_LICENSE("GPL"); 38MODULE_LICENSE("GPL");
39 39
40#define FREQ_LO (76U * 16000) 40#define FREQ_LO ((tea->tea5759 ? 760 : 875) * 1600U)
41#define FREQ_HI (108U * 16000) 41#define FREQ_HI ((tea->tea5759 ? 910 : 1080) * 1600U)
42 42
43/* 43/*
44 * definitions 44 * definitions
@@ -120,9 +120,9 @@ static u32 snd_tea575x_read(struct snd_tea575x *tea)
120 return data; 120 return data;
121} 121}
122 122
123static u32 snd_tea575x_get_freq(struct snd_tea575x *tea) 123static u32 snd_tea575x_val_to_freq(struct snd_tea575x *tea, u32 val)
124{ 124{
125 u32 freq = snd_tea575x_read(tea) & TEA575X_BIT_FREQ_MASK; 125 u32 freq = val & TEA575X_BIT_FREQ_MASK;
126 126
127 if (freq == 0) 127 if (freq == 0)
128 return freq; 128 return freq;
@@ -139,6 +139,11 @@ static u32 snd_tea575x_get_freq(struct snd_tea575x *tea)
139 return clamp(freq * 16, FREQ_LO, FREQ_HI); /* from kHz */ 139 return clamp(freq * 16, FREQ_LO, FREQ_HI); /* from kHz */
140} 140}
141 141
142static u32 snd_tea575x_get_freq(struct snd_tea575x *tea)
143{
144 return snd_tea575x_val_to_freq(tea, snd_tea575x_read(tea));
145}
146
142static void snd_tea575x_set_freq(struct snd_tea575x *tea) 147static void snd_tea575x_set_freq(struct snd_tea575x *tea)
143{ 148{
144 u32 freq = tea->freq; 149 u32 freq = tea->freq;
@@ -156,6 +161,7 @@ static void snd_tea575x_set_freq(struct snd_tea575x *tea)
156 tea->val &= ~TEA575X_BIT_FREQ_MASK; 161 tea->val &= ~TEA575X_BIT_FREQ_MASK;
157 tea->val |= freq & TEA575X_BIT_FREQ_MASK; 162 tea->val |= freq & TEA575X_BIT_FREQ_MASK;
158 snd_tea575x_write(tea, tea->val); 163 snd_tea575x_write(tea, tea->val);
164 tea->freq = snd_tea575x_val_to_freq(tea, tea->val);
159} 165}
160 166
161/* 167/*
@@ -317,7 +323,6 @@ static int tea575x_s_ctrl(struct v4l2_ctrl *ctrl)
317} 323}
318 324
319static const struct v4l2_file_operations tea575x_fops = { 325static const struct v4l2_file_operations tea575x_fops = {
320 .owner = THIS_MODULE,
321 .unlocked_ioctl = video_ioctl2, 326 .unlocked_ioctl = video_ioctl2,
322 .open = v4l2_fh_open, 327 .open = v4l2_fh_open,
323 .release = v4l2_fh_release, 328 .release = v4l2_fh_release,
@@ -337,7 +342,6 @@ static const struct v4l2_ioctl_ops tea575x_ioctl_ops = {
337}; 342};
338 343
339static const struct video_device tea575x_radio = { 344static const struct video_device tea575x_radio = {
340 .fops = &tea575x_fops,
341 .ioctl_ops = &tea575x_ioctl_ops, 345 .ioctl_ops = &tea575x_ioctl_ops,
342 .release = video_device_release_empty, 346 .release = video_device_release_empty,
343}; 347};
@@ -349,7 +353,7 @@ static const struct v4l2_ctrl_ops tea575x_ctrl_ops = {
349/* 353/*
350 * initialize all the tea575x chips 354 * initialize all the tea575x chips
351 */ 355 */
352int snd_tea575x_init(struct snd_tea575x *tea) 356int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
353{ 357{
354 int retval; 358 int retval;
355 359
@@ -374,6 +378,9 @@ int snd_tea575x_init(struct snd_tea575x *tea)
374 tea->vd.lock = &tea->mutex; 378 tea->vd.lock = &tea->mutex;
375 tea->vd.v4l2_dev = tea->v4l2_dev; 379 tea->vd.v4l2_dev = tea->v4l2_dev;
376 tea->vd.ctrl_handler = &tea->ctrl_handler; 380 tea->vd.ctrl_handler = &tea->ctrl_handler;
381 tea->fops = tea575x_fops;
382 tea->fops.owner = owner;
383 tea->vd.fops = &tea->fops;
377 set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags); 384 set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags);
378 /* disable hw_freq_seek if we can't use it */ 385 /* disable hw_freq_seek if we can't use it */
379 if (tea->cannot_read_data) 386 if (tea->cannot_read_data)
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 67f47d891959..52b5c0bf90c1 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2769,7 +2769,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
2769 chip->tea.ops = &snd_es1968_tea_ops; 2769 chip->tea.ops = &snd_es1968_tea_ops;
2770 strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card)); 2770 strlcpy(chip->tea.card, "SF64-PCE2", sizeof(chip->tea.card));
2771 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); 2771 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
2772 if (!snd_tea575x_init(&chip->tea)) 2772 if (!snd_tea575x_init(&chip->tea, THIS_MODULE))
2773 printk(KERN_INFO "es1968: detected TEA575x radio\n"); 2773 printk(KERN_INFO "es1968: detected TEA575x radio\n");
2774#endif 2774#endif
2775 2775
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index f69662322750..b32e8024ea86 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -1254,7 +1254,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1254 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci)); 1254 sprintf(chip->tea.bus_info, "PCI:%s", pci_name(pci));
1255 if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 && 1255 if ((tea575x_tuner & TUNER_TYPE_MASK) > 0 &&
1256 (tea575x_tuner & TUNER_TYPE_MASK) < 4) { 1256 (tea575x_tuner & TUNER_TYPE_MASK) < 4) {
1257 if (snd_tea575x_init(&chip->tea)) { 1257 if (snd_tea575x_init(&chip->tea, THIS_MODULE)) {
1258 snd_printk(KERN_ERR "TEA575x radio not found\n"); 1258 snd_printk(KERN_ERR "TEA575x radio not found\n");
1259 snd_fm801_free(chip); 1259 snd_fm801_free(chip);
1260 return -ENODEV; 1260 return -ENODEV;
@@ -1263,7 +1263,7 @@ static int __devinit snd_fm801_create(struct snd_card *card,
1263 /* autodetect tuner connection */ 1263 /* autodetect tuner connection */
1264 for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) { 1264 for (tea575x_tuner = 1; tea575x_tuner <= 3; tea575x_tuner++) {
1265 chip->tea575x_tuner = tea575x_tuner; 1265 chip->tea575x_tuner = tea575x_tuner;
1266 if (!snd_tea575x_init(&chip->tea)) { 1266 if (!snd_tea575x_init(&chip->tea, THIS_MODULE)) {
1267 snd_printk(KERN_INFO "detected TEA575x radio type %s\n", 1267 snd_printk(KERN_INFO "detected TEA575x radio type %s\n",
1268 get_tea575x_gpio(chip)->name); 1268 get_tea575x_gpio(chip)->name);
1269 break; 1269 break;
diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
index 163b6b5de3eb..d03079764189 100644
--- a/sound/pci/hda/Kconfig
+++ b/sound/pci/hda/Kconfig
@@ -97,19 +97,6 @@ config SND_HDA_CODEC_REALTEK
97 snd-hda-codec-realtek. 97 snd-hda-codec-realtek.
98 This module is automatically loaded at probing. 98 This module is automatically loaded at probing.
99 99
100config SND_HDA_ENABLE_REALTEK_QUIRKS
101 bool "Build static quirks for Realtek codecs"
102 depends on SND_HDA_CODEC_REALTEK
103 default y
104 help
105 Say Y here to build the static quirks codes for Realtek codecs.
106 If you need the "model" preset that the default BIOS auto-parser
107 can't handle, turn this option on.
108
109 If your device works with model=auto option, basically you don't
110 need the quirk code. By turning this off, you can reduce the
111 module size quite a lot.
112
113config SND_HDA_CODEC_ANALOG 100config SND_HDA_CODEC_ANALOG
114 bool "Build Analog Device HD-audio codec support" 101 bool "Build Analog Device HD-audio codec support"
115 default y 102 default y
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index 6e9ef3e25093..f7520b9f909c 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -618,7 +618,6 @@ int snd_hda_gen_add_verbs(struct hda_gen_spec *spec,
618 const struct hda_verb *list) 618 const struct hda_verb *list)
619{ 619{
620 const struct hda_verb **v; 620 const struct hda_verb **v;
621 snd_array_init(&spec->verbs, sizeof(struct hda_verb *), 8);
622 v = snd_array_new(&spec->verbs); 621 v = snd_array_new(&spec->verbs);
623 if (!v) 622 if (!v)
624 return -ENOMEM; 623 return -ENOMEM;
diff --git a/sound/pci/hda/hda_auto_parser.h b/sound/pci/hda/hda_auto_parser.h
index 2a7889dfbd1b..632ad0ad3007 100644
--- a/sound/pci/hda/hda_auto_parser.h
+++ b/sound/pci/hda/hda_auto_parser.h
@@ -157,4 +157,14 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
157 const struct snd_pci_quirk *quirk, 157 const struct snd_pci_quirk *quirk,
158 const struct hda_fixup *fixlist); 158 const struct hda_fixup *fixlist);
159 159
160static inline void snd_hda_gen_init(struct hda_gen_spec *spec)
161{
162 snd_array_init(&spec->verbs, sizeof(struct hda_verb *), 8);
163}
164
165static inline void snd_hda_gen_free(struct hda_gen_spec *spec)
166{
167 snd_array_free(&spec->verbs);
168}
169
160#endif /* __SOUND_HDA_AUTO_PARSER_H */ 170#endif /* __SOUND_HDA_AUTO_PARSER_H */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7504e62188d6..51cb2a2e4fce 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1184,6 +1184,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
1184{ 1184{
1185 if (!codec) 1185 if (!codec)
1186 return; 1186 return;
1187 snd_hda_jack_tbl_clear(codec);
1187 restore_init_pincfgs(codec); 1188 restore_init_pincfgs(codec);
1188#ifdef CONFIG_SND_HDA_POWER_SAVE 1189#ifdef CONFIG_SND_HDA_POWER_SAVE
1189 cancel_delayed_work(&codec->power_work); 1190 cancel_delayed_work(&codec->power_work);
@@ -1192,6 +1193,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
1192 list_del(&codec->list); 1193 list_del(&codec->list);
1193 snd_array_free(&codec->mixers); 1194 snd_array_free(&codec->mixers);
1194 snd_array_free(&codec->nids); 1195 snd_array_free(&codec->nids);
1196 snd_array_free(&codec->cvt_setups);
1195 snd_array_free(&codec->conn_lists); 1197 snd_array_free(&codec->conn_lists);
1196 snd_array_free(&codec->spdif_out); 1198 snd_array_free(&codec->spdif_out);
1197 codec->bus->caddr_tbl[codec->addr] = NULL; 1199 codec->bus->caddr_tbl[codec->addr] = NULL;
@@ -2333,6 +2335,8 @@ int snd_hda_codec_reset(struct hda_codec *codec)
2333 /* free only driver_pins so that init_pins + user_pins are restored */ 2335 /* free only driver_pins so that init_pins + user_pins are restored */
2334 snd_array_free(&codec->driver_pins); 2336 snd_array_free(&codec->driver_pins);
2335 restore_pincfgs(codec); 2337 restore_pincfgs(codec);
2338 snd_array_free(&codec->cvt_setups);
2339 snd_array_free(&codec->spdif_out);
2336 codec->num_pcms = 0; 2340 codec->num_pcms = 0;
2337 codec->pcm_info = NULL; 2341 codec->pcm_info = NULL;
2338 codec->preset = NULL; 2342 codec->preset = NULL;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 172370b3793b..2bf99fc1cbf2 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -445,8 +445,10 @@ static int conexant_init(struct hda_codec *codec)
445 445
446static void conexant_free(struct hda_codec *codec) 446static void conexant_free(struct hda_codec *codec)
447{ 447{
448 struct conexant_spec *spec = codec->spec;
449 snd_hda_gen_free(&spec->gen);
448 snd_hda_detach_beep_device(codec); 450 snd_hda_detach_beep_device(codec);
449 kfree(codec->spec); 451 kfree(spec);
450} 452}
451 453
452static const struct snd_kcontrol_new cxt_capture_mixers[] = { 454static const struct snd_kcontrol_new cxt_capture_mixers[] = {
@@ -4466,6 +4468,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
4466 SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410), 4468 SND_PCI_QUIRK(0x17aa, 0x21ce, "Lenovo T420", CXT_PINCFG_LENOVO_TP410),
4467 SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410), 4469 SND_PCI_QUIRK(0x17aa, 0x21cf, "Lenovo T520", CXT_PINCFG_LENOVO_TP410),
4468 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC), 4470 SND_PCI_QUIRK(0x17aa, 0x3975, "Lenovo U300s", CXT_FIXUP_STEREO_DMIC),
4471 SND_PCI_QUIRK(0x17aa, 0x397b, "Lenovo S205", CXT_FIXUP_STEREO_DMIC),
4469 {} 4472 {}
4470}; 4473};
4471 4474
@@ -4497,6 +4500,7 @@ static int patch_conexant_auto(struct hda_codec *codec)
4497 if (!spec) 4500 if (!spec)
4498 return -ENOMEM; 4501 return -ENOMEM;
4499 codec->spec = spec; 4502 codec->spec = spec;
4503 snd_hda_gen_init(&spec->gen);
4500 4504
4501 switch (codec->vendor_id) { 4505 switch (codec->vendor_id) {
4502 case 0x14f15045: 4506 case 0x14f15045:
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f8f4906e498d..5ccf10a4d593 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2289,6 +2289,7 @@ static void alc_free(struct hda_codec *codec)
2289 alc_shutup(codec); 2289 alc_shutup(codec);
2290 alc_free_kctls(codec); 2290 alc_free_kctls(codec);
2291 alc_free_bind_ctls(codec); 2291 alc_free_bind_ctls(codec);
2292 snd_hda_gen_free(&spec->gen);
2292 kfree(spec); 2293 kfree(spec);
2293 snd_hda_detach_beep_device(codec); 2294 snd_hda_detach_beep_device(codec);
2294} 2295}
@@ -4253,6 +4254,7 @@ static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
4253 return -ENOMEM; 4254 return -ENOMEM;
4254 codec->spec = spec; 4255 codec->spec = spec;
4255 spec->mixer_nid = mixer_nid; 4256 spec->mixer_nid = mixer_nid;
4257 snd_hda_gen_init(&spec->gen);
4256 4258
4257 err = alc_codec_rename_from_preset(codec); 4259 err = alc_codec_rename_from_preset(codec);
4258 if (err < 0) { 4260 if (err < 0) {
@@ -6705,6 +6707,12 @@ static int patch_alc662(struct hda_codec *codec)
6705 6707
6706 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6708 alc_fix_pll_init(codec, 0x20, 0x04, 15);
6707 6709
6710 alc_pick_fixup(codec, alc662_fixup_models,
6711 alc662_fixup_tbl, alc662_fixups);
6712 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6713
6714 alc_auto_parse_customize_define(codec);
6715
6708 if ((alc_get_coef0(codec) & (1 << 14)) && 6716 if ((alc_get_coef0(codec) & (1 << 14)) &&
6709 codec->bus->pci->subsystem_vendor == 0x1025 && 6717 codec->bus->pci->subsystem_vendor == 0x1025 &&
6710 spec->cdefine.platform_type == 1) { 6718 spec->cdefine.platform_type == 1) {
@@ -6712,12 +6720,6 @@ static int patch_alc662(struct hda_codec *codec)
6712 goto error; 6720 goto error;
6713 } 6721 }
6714 6722
6715 alc_pick_fixup(codec, alc662_fixup_models,
6716 alc662_fixup_tbl, alc662_fixups);
6717 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6718
6719 alc_auto_parse_customize_define(codec);
6720
6721 /* automatic parse from the BIOS config */ 6723 /* automatic parse from the BIOS config */
6722 err = alc662_parse_auto_config(codec); 6724 err = alc662_parse_auto_config(codec);
6723 if (err < 0) 6725 if (err < 0)
@@ -6800,6 +6802,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
6800 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 }, 6802 { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
6801 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 }, 6803 { .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
6802 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 }, 6804 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
6805 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
6803 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660", 6806 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
6804 .patch = patch_alc861 }, 6807 .patch = patch_alc861 },
6805 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd }, 6808 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7db8228f1b88..07675282015a 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4367,7 +4367,7 @@ static int stac92xx_init(struct hda_codec *codec)
4367 AC_PINCTL_IN_EN); 4367 AC_PINCTL_IN_EN);
4368 for (i = 0; i < spec->num_pwrs; i++) { 4368 for (i = 0; i < spec->num_pwrs; i++) {
4369 hda_nid_t nid = spec->pwr_nids[i]; 4369 hda_nid_t nid = spec->pwr_nids[i];
4370 int pinctl, def_conf; 4370 unsigned int pinctl, def_conf;
4371 4371
4372 def_conf = snd_hda_codec_get_pincfg(codec, nid); 4372 def_conf = snd_hda_codec_get_pincfg(codec, nid);
4373 def_conf = get_defcfg_connect(def_conf); 4373 def_conf = get_defcfg_connect(def_conf);
@@ -4376,6 +4376,11 @@ static int stac92xx_init(struct hda_codec *codec)
4376 stac_toggle_power_map(codec, nid, 0); 4376 stac_toggle_power_map(codec, nid, 0);
4377 continue; 4377 continue;
4378 } 4378 }
4379 if (def_conf == AC_JACK_PORT_FIXED) {
4380 /* no need for jack detection for fixed pins */
4381 stac_toggle_power_map(codec, nid, 1);
4382 continue;
4383 }
4379 /* power on when no jack detection is available */ 4384 /* power on when no jack detection is available */
4380 /* or when the VREF is used for controlling LED */ 4385 /* or when the VREF is used for controlling LED */
4381 if (!spec->hp_detect || 4386 if (!spec->hp_detect ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index aa8c98b628da..1436b6ce74d1 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -727,9 +727,6 @@ static void wm1811_jackdet_set_mode(struct snd_soc_codec *codec, u16 mode)
727 if (!wm8994->jackdet || !wm8994->jack_cb) 727 if (!wm8994->jackdet || !wm8994->jack_cb)
728 return; 728 return;
729 729
730 if (!wm8994->jackdet || !wm8994->jack_cb)
731 return;
732
733 if (wm8994->active_refcount) 730 if (wm8994->active_refcount)
734 mode = WM1811_JACKDET_MODE_AUDIO; 731 mode = WM1811_JACKDET_MODE_AUDIO;
735 732
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
index 41daaa24c25f..e71fe55cebef 100644
--- a/sound/usb/mixer_maps.c
+++ b/sound/usb/mixer_maps.c
@@ -341,6 +341,14 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
341 .map = audigy2nx_map, 341 .map = audigy2nx_map,
342 .selector_map = audigy2nx_selectors, 342 .selector_map = audigy2nx_selectors,
343 }, 343 },
344 { /* Logitech, Inc. QuickCam Pro for Notebooks */
345 .id = USB_ID(0x046d, 0x0991),
346 .ignore_ctl_error = 1,
347 },
348 { /* Logitech, Inc. QuickCam E 3500 */
349 .id = USB_ID(0x046d, 0x09a4),
350 .ignore_ctl_error = 1,
351 },
344 { 352 {
345 /* Hercules DJ Console (Windows Edition) */ 353 /* Hercules DJ Console (Windows Edition) */
346 .id = USB_ID(0x06f8, 0xb000), 354 .id = USB_ID(0x06f8, 0xb000),
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index d89ab4c7d44b..79780fa57a43 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -1831,6 +1831,36 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1831 } 1831 }
1832 } 1832 }
1833}, 1833},
1834{
1835 USB_DEVICE(0x0582, 0x014d),
1836 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1837 /* .vendor_name = "BOSS", */
1838 /* .product_name = "GT-100", */
1839 .ifnum = QUIRK_ANY_INTERFACE,
1840 .type = QUIRK_COMPOSITE,
1841 .data = (const struct snd_usb_audio_quirk[]) {
1842 {
1843 .ifnum = 1,
1844 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1845 },
1846 {
1847 .ifnum = 2,
1848 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1849 },
1850 {
1851 .ifnum = 3,
1852 .type = QUIRK_MIDI_FIXED_ENDPOINT,
1853 .data = & (const struct snd_usb_midi_endpoint_info) {
1854 .out_cables = 0x0001,
1855 .in_cables = 0x0001
1856 }
1857 },
1858 {
1859 .ifnum = -1
1860 }
1861 }
1862 }
1863},
1834 1864
1835/* Guillemot devices */ 1865/* Guillemot devices */
1836{ 1866{